npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

noita_lib

v1.0.4

Published

基于Web Component技术构建的 Noita 游戏UI元素工具库

Downloads

19

Readme

NoitaLib

基于Web Component技术构建的 Noita 游戏UI元素工具库 目前法术数据已经跟进至beta版[^1]

Version 法术数据进度 天赋精粹数据进度 实体数据进度


引入

通过html script元素引入

<script src="noitaLib.js"></script>

通过js impot语句引入

  • 使用index.mjs的版本
  • 或者在普通版本的"use strict";后加上export
// ES6 module
import noitaLib from "noitaLib.js";

构建

需要预先安装node环境, 在vscode调试中运行build即可 也可以手动执行build.js 在out目录会生成index.jsindex.mjs(es6模块)

html 中使用

法术

<noita-spell
    spell.id="法术ID"
    spell.name="法术名(伟大汉化)"
    spell.expression="法术查询表达式"
    display="显示模式"
><noita-spell/>

图标模式

通过 id/name 指定单个法术

<noita-spell spell.id="BOMB" display="icon"></noita-spell>

通过 expression 指定多个法术

<noita-spell spell.expression="#type_passive" display="icon"></noita-spell>

面板模式

通过 id/name 指定单个法术

<noita-spell spell.id="BOMB" display="panel"></noita-spell>

通过 expression 指定多个法术

<noita-spell spell.expression="#type_passive" display="panel"></noita-spell>

法杖

<noita-wand
    wand.name="法杖名"
    wand.shuffle="乱序(true/false)"
    wand.draw="抽取数"
    wand.fire-rate-wait="施放延迟"
    wand.reload-time="充能时间"
    wand.capacity="容量"
    wand.mana-max="法力上限"
    wand.mana-charge-speed="法力恢复速度"
    wand.spread-degrees="散射"
    wand.speed-multiplier="投射速度倍数"
    wand.static-spells="始终施放法术(法术序列表达式)"
    wand.dynamic-spells="填充法术(法术序列表达式)"
    display="显示模式"
><noita-wand/>

图标模式

  • [ ] 待实现

面板模式

<noita-wand
    display="panel"
    wand.name="幽魂闪光"
    wand.capacity="26"
    wand.draw="1"
    wand.fire-rate-wait="15"
    wand.reload-time="0"
    wand.shuffle="false"
    wand.spread-degrees="0"
    wand.speed-multiplier="1"
    wand.mana-charge-speed="600"
    wand.mana-max="1600"
    wand.static-spells="MANA_REDUCE:-1"
    wand.dynamic-spells="
        BLOOD_MAGIC:2
        BURST_X
        ADD_DEATH_TRIGGER
        CURSE_WITHER_PROJECTILE
        [DIGGER|POWERDIGGER|CHAINSAW]
        NOLLA SPIRAL_SHOT
        LIGHT_BULLET SUMMON_PORTAL:-1
        [
            DIGGER|
            POWERDIGGER|
            MATERIAL_WATER|
            MATERIAL_OIL|
            MATERIAL_BLOOD|
            MATERIAL_ACID|
            MATERIAL_CEMENT
        ]:13
        CHAINSAW
        RESET
    "
></noita-wand>

javascript 中使用

入口常量: noitaLib


noitaLib.entity.HTMLElement // HTMLElement 构造器 <noita-entity>
noitaLib.entity.queryById("BOMB") //DB.entity {id: 'BOMB', name: '炸弹'... }
noitaLib.spell.HTMLElement // HTMLElement 构造器 <noita-spell>
noitaLib.spell.queryByName("炸弹") //DB.spell {id: "BOMB", name: "炸弹", 
noitaLib.spell.queryById("BOMB") //DB.spell {id: "BOMB", name: "炸弹", description: "召唤一枚对地形破坏力极大的炸弹" ...}
noitaLib.wand.HTMLElement // HTMLElement 构造器 <noita-wand>
noitaLib.perk.HTMLElement // HTMLElement 构造器 <noita-perk>
noitaLib.perk.queryByName("暴击率 +") // DB.perk {id: 'CRITICAL_HIT', name: '暴击率 +', description: '提高你所有法术的暴击率' ...}
noitaLib.perk.queryById("CRITICAL_HIT") // DB.perk {id: 'CRITICAL_HIT', name: '暴击率 +', description: '提高你所有法术的暴击率' ...}

noitaLib.cursor.add() // 添加游戏风格十字光标
noitaLib.cursor.remove() // 移除游戏风格十字光标

法术查询表达式

Token

  • 法术ID
    [A-Z_]+[0-9A-Z_]*
    法术id ::=
        <大写字母|_>(大写字母|数字|_)*
  • 法术标签
    #[0-9A-Za-z_]*
    法术标签 ::=
        #(大写字母|小写字母|数字|_)*
  • 集合运算符 &, |, !
  • 优先级运算符 (, )

语法

  • 法术ID法术标签 均表示法术集合 法术ID 为单个法术构成的法术集合
  • 集合运算符 表示集合之间的运算
  • 法术ID法术标签 之前使用逻辑运算符进行连接
  • 通过 优先级运算符 来控制优先级
  • BNF定义
    法术查询表达式 ::=
        集合运算表达式
    优先集合运算表达式 ::=
        "("集合运算表达式")"
    集合运算表达式 ::=
        (基本法术集合|集合运算表达式|优先集合运算表达式)(<集合运算符>(基本法术集合|集合运算表达式|优先集合运算表达式))*
    基本法术集合 ::=
        法术ID|法术标签
    集合运算符 ::=
        "&"|"|"|"!"

示例

noitaLib.spell.queryByExpression(法术查询表达式)
#type_projectile|RESET

所有投射物法术加魔杖刷新

#type_modifier&#mana_0

所有蓝耗为0的修正法术

DIGGER|POWERDIGGER|CHAINSAW

挖掘魔弹挖掘爆破链锯

法术序列表达式

Token

  • 法术ID
  • 可替换法术
    可替换法术 ::= "["[法术查询表达式]"]"
  • 法术重复次数
    :[0-9]+(~[0-9]+)?
    :~[0-9]+
    重复次数 ::= :(<数字>{数字}[~<数字>{数字}] | ~<数字>{数字})
  • 剩余次数
    \^[0-9]+
    剩余次数 ::= ^<数字>{数字}

语法

  • 可替换法术使用[]包裹法术查询表达式构成 表示此处有多个可替换的法术(表现为轮播)
  • 固定法术由法术ID构成 表示该位置仅允许此法术
  • 使用^拼接数量 表示该法术的剩余次数 默认为无限
  • 使用:拼接数量 表示该法术在序列中向右重复的次数 默认为1 使用拼接~和一个数值用于表示最小重复次数和最大重复次数 最小重复次数为0允许省略 即:~3
  • 法术序列由可替换法术固定法术及其附加信息构成
  • BNF定义
    法术序列表达式 ::= {基本法术单元}
    基本法术单元 ::= (法术ID|可替换法术)([重复次数][剩余次数] | [剩余次数][重复次数])

示例

<noita-wand wand.dynamic-spells="法术序列表达式"></noita-wand>
BURST_2 LIGHT_BULLET CHAINSAW


tips: 链锯在施法块最后预载可以将施法块释放延迟归零

RESET [ #type_passive]:3


tips: 一般情况下将被动法术置于魔杖刷新之后将免于耗蓝

LIGHT_BULLET_TRIGGER [HOMING_SHORT|HOMING]:~1 [LASER_EMITTER|LASER_EMITTER_FOUR|LASER_EMITTER_CUTTER]


tips: 使用电浆可以有效快速的击杀独眼 使用触发弹施放它可以免于电浆对自己造成伤害 使用追踪修正以保证电浆命中的稳定性(当然这不是必须的)

未完待续... [^1]: master build-Aug 29 2023.