Skip to content

变量总表

本页用于固化当前项目中应复用的变量名体系。

它不是“示例建议”,而是后续词条维护、解析器实现、校验器实现时的统一基线。

本页依据两个来源建立:

  1. 旧站数据源 scripts/popologyData.js
  2. b2popology.com 的术语页

已确认的事实如下:

  • 旧站正文中最频繁的战斗缩写依次包括 sdprmdjcd 等。
  • 旧站正文中高频语义结构包括:
    • size
    • placeable on
    • Unlock Cost
    • cooldown
    • duration
    • crosspath
    • replaced by
    • subtower
  • 旧站与现有注册表已经覆盖的核心项包括:
    • 基础伤害
    • 陶瓷加伤
    • 迷彩加伤
    • 穿透
    • 索敌方式
    • 伤害类型
  • 仍需专项补强的项包括:
    • 击退
    • 弹射方式 / 连锁方式
    • 条件性 xx 加伤
    • 气球 buff / debuff
    • 论文式交叉引用
  • 术语页对以下缩写给出了稳定定义:
    • d
    • md
    • fd
    • fmd
    • cd
    • ld
    • cad
    • frd
    • sd
    • j
    • p
    • i
    • r
    • s
    • jr
    • jsp
    • js
    • ds

后续变量命名不得直接沿用旧站缩写作为最终字段名。

旧站缩写只作为:

  1. 读者熟悉的展示符号
  2. 历史数据导入时的映射来源
  3. 解析器中的别名层

本项目内部正式字段必须使用全称英文 snake_case 语义名。

旧站缩写正式字段名含义
ddamage基础伤害
mdmoab_damage对 MOAB 类额外伤害
fdfortified_damage对强化目标额外伤害
fmdfortified_moab_damage对强化 MOAB 额外伤害
cdceramic_damage对陶瓷额外伤害
ldlead_damage对铅额外伤害
cadcamo_damage对迷彩额外伤害
frdfrozen_damage对冻结目标额外伤害
sdstunned_damage对眩晕目标额外伤害
jprojectiles同时发射弹体数
ppierce穿透
iimpact不可被穿透增益影响的命中次数
rrange攻击或探测半径
sattack_cooldown攻击冷却
jrprojectile_radius投射物半径
jspprojectile_speed投射物速度
jsprojectile_lifespan投射物持续时间
dsemission_delay发射延迟

所有变量必须按层级命名,不允许临时缩写。

hero_id.level.{level}.component.field

示例:

quincy.level.3.ability.rapid_shot.cooldown
quincy.level.10.ability.storm_of_arrows.duration
bonnie.level.7.minecart.upgrade_1.purchase_price
tower_id.base.field

示例:

dart_monkey.base.place_cost
dart_monkey.base.size
dart_monkey.base.placement
dart_monkey.base.range
tower_id.path.{top|middle|bottom}.t{tier}.component.field

示例:

dart_monkey.path.top.t3.attack.main.damage
dart_monkey.path.middle.t4.ability.fan_club.cooldown
banana_farm.path.middle.t3.economy.bank_capacity
entity_id.table.{table_name}.{row_key}.field

示例:

bonnie.table.minecart_upgrade.lv1.purchase_price
bonnie.table.minecart_upgrade.lv1.sell_value
banana_farm.table.sellback.top_t3.sell_value

后续任何新变量必须先挂入以下一级域之一。

用于版本和显示元数据。

推荐字段:

  • version
  • official_version
  • site_fix_version
  • language_mode
  • summary

用于实体的基础信息。

推荐字段:

  • place_cost
  • unlock_cost
  • sell_value
  • sellback_rate
  • size
  • footprint_radius
  • placement
  • range
  • line_of_sight
  • can_see_over_obstacles
  • leveling_multiplier
  • leveling_curve

这是最核心的复用域。

推荐字段:

  • damage
  • base_damage
  • moab_damage
  • fortified_damage
  • fortified_moab_damage
  • ceramic_damage
  • lead_damage
  • camo_damage
  • frozen_damage
  • stunned_damage
  • projectiles
  • spread_degrees
  • pierce
  • impact
  • range
  • attack_cooldown
  • attack_speed
  • damage_type
  • damage_flags
  • knockback_distance
  • knockback_force
  • knockback_duration
  • knockback_mode
  • projectile_radius
  • projectile_speed
  • projectile_lifespan
  • emission_delay
  • chain_count
  • chain_range
  • chain_falloff
  • bounce_mode
  • bounce_count
  • bounce_angle
  • ricochet_mode
  • blast_mode
  • zone_mode
  • passive_mode
  • can_hit_camo
  • decamo
  • deregrow
  • defort
  • can_rehit
  • can_rebound

这里的对应关系如下:

  • 基础伤害 -> damagebase_damage
  • 陶瓷加伤 -> ceramic_damage
  • 迷彩加伤 -> camo_damage
  • xx 加伤 -> 优先拆成对应专门字段;若没有专门字段,则写入 modifier.*.conditional_vs
  • 弹射方式 -> chain_*bounce_*ricochet_mode
  • 击退 -> knockback_*

用于索敌与攻击路径逻辑。

推荐字段:

  • targeting_mode
  • priority_mode
  • arc_mode
  • arc_direction
  • seeking
  • retarget_rate
  • lock_in_place
  • minimum_range
  • maximum_range
  • detect_camo
  • target_filters

这里用于承载你提到的 索敌方式

这是猴子 buff 与气球 buff/debuff 的统一模型。

推荐字段:

  • target_kind
  • target_scope
  • status_kind
  • duration
  • uptime
  • stack_count
  • stack_cap
  • damage_add
  • damage_mult
  • pierce_add
  • pierce_mult
  • range_add
  • range_mult
  • attack_cooldown_mult
  • attack_speed_mult
  • projectiles_add
  • projectiles_mult
  • move_speed_mult
  • turn_speed_mult
  • status_damage_add
  • cash_mult
  • conditional_vs
  • applies_to

其中:

  • 猴子 bufftarget_kind = monkey
  • 气球 buff / debufftarget_kind = bloon
  • xx 加伤 的条件表达优先写入 conditional_vs

用于主动/被动技能。

推荐字段:

  • cooldown
  • duration
  • initial_cooldown
  • battle_ready
  • charges
  • charge_interval
  • max_targets
  • radius
  • range
  • uptime
  • buff_type

用于加成或减益。

推荐字段:

  • target_scope
  • target_kind
  • damage_add
  • damage_mult
  • pierce_add
  • pierce_mult
  • range_add
  • range_mult
  • attack_cooldown_mult
  • attack_speed_mult
  • projectiles_add
  • projectiles_mult
  • special_damage_add
  • conditional_vs
  • applies_to

buff 保留为旧模型兼容层;后续新字段优先写入 modifier

这是新增的交叉引用域,用于实现你要求的“论文式交叉引用机制”。

推荐字段:

  • ref_id
  • ref_kind
  • ref_label
  • target_key
  • target_keys
  • target_section
  • relation_type
  • citation_text
  • explanation
  • depends_on
  • conflicts_with
  • derived_from
  • see_also

这类引用不是给读者看的纯装饰,而是给系统建立:

  1. 变量到变量
  2. 变量到正文段
  3. 正文段到表格行
  4. 结论到依据

的正式链接关系。

用于所有货币、存储、收益与出售逻辑。

推荐字段:

  • purchase_price
  • upgrade_cost
  • sell_value
  • sellback_rate
  • income_per_round
  • income_per_tick
  • income_interval
  • storage
  • storage_cap
  • bank_capacity
  • withdraw_bonus
  • cash_per_pop
  • cash_per_use
  • drop_value
  • payout_value
  • generation_count
  • generation_cap

用于副单位、召唤物、轨道物、持续物。

推荐字段:

  • unit_name
  • spawn_count
  • spawn_interval
  • spawn_cap
  • lifetime
  • health
  • range
  • speed
  • duration
  • inherits_buffs
  • inherits_crosspath
  • placement_mode

用于具有阶段、受伤、累积、充能、掉落的对象。

推荐字段:

  • health
  • shield
  • charge
  • charge_cap
  • stack_count
  • stack_cap
  • phase
  • state_name
  • damage_threshold
  • destroyed_drop_value
  • transform_target

用于明确记录交叉升级改写。

推荐字段:

  • crosspath_code
  • affected_field
  • override_value
  • bonus_value
  • replacement_value

为了避免反复造轮子,优先复用以下组件层。

entity.base.place_cost
entity.base.unlock_cost
entity.base.size
entity.base.placement
entity.base.range
entity.[path/level/...].attack.main.damage
entity.[path/level/...].attack.main.pierce
entity.[path/level/...].attack.main.range
entity.[path/level/...].attack.main.attack_cooldown
entity.[path/level/...].attack.main.damage_type
entity.[path/level/...].attack.main.chain_count
entity.[path/level/...].attack.main.chain_range
entity.[path/level/...].attack.main.bounce_mode
entity.[path/level/...].attack.main.ricochet_mode
entity.[path/level/...].attack.main.knockback_distance
entity.[path/level/...].ability.main.cooldown
entity.[path/level/...].ability.main.duration
entity.[path/level/...].ability.main.initial_cooldown
entity.[path/level/...].economy.purchase_price
entity.[path/level/...].economy.sell_value
entity.[path/level/...].economy.sellback_rate
entity.[path/level/...].modifier.main.target_kind
entity.[path/level/...].modifier.main.damage_add
entity.[path/level/...].modifier.main.pierce_add
entity.[path/level/...].modifier.main.attack_cooldown_mult
entity.[path/level/...].modifier.main.applies_to
entity.[path/level/...].modifier.main.target_kind
entity.[path/level/...].modifier.main.status_kind
entity.[path/level/...].modifier.main.duration
entity.[path/level/...].modifier.main.move_speed_mult
entity.[path/level/...].modifier.main.damage_add

以下对象必须使用专门命名簇,不允许临时字段。

bonnie.minecart.upgrade.{index}.hero_level_required
bonnie.minecart.upgrade.{index}.purchase_price
bonnie.minecart.upgrade.{index}.sell_value
bonnie.minecart.upgrade.{index}.minecart_hp_after_purchase
bonnie.minecart.upgrade.{index}.destroyed_drop_value
bonnie.minecart.upgrade.{index}.cap_after_purchase
banana_farm.path.{path}.t{tier}.economy.income_per_round
banana_farm.path.{path}.t{tier}.economy.storage_cap
banana_farm.path.{path}.t{tier}.economy.bank_capacity
banana_farm.path.{path}.t{tier}.economy.withdraw_bonus
banana_farm.path.{path}.t{tier}.economy.sell_value

后续所有关键机制都要允许建立“论文式交叉引用”。

正式关系类型固定为:

  1. defines
  2. modifies
  3. inherits
  4. replaces
  5. depends_on
  6. conflicts_with
  7. derived_from
  8. see_also

推荐命名模板:

entity.[path|level|table|system].component.refs.{ref_name}.field

示例 1:

dart_monkey.path.top.t3.attack.main.refs.spikeball_replace.ref_id
dart_monkey.path.top.t3.attack.main.refs.spikeball_replace.relation_type
dart_monkey.path.top.t3.attack.main.refs.spikeball_replace.target_key

示例 2:

bonnie.minecart.upgrade.1.refs.sell_value_rule.ref_id
bonnie.minecart.upgrade.1.refs.sell_value_rule.derived_from
bonnie.minecart.upgrade.1.refs.sell_value_rule.target_key

这意味着后续页面可以实现:

  1. 点击 陶瓷加伤,跳到对应攻击条目
  2. 点击 猴子 buff,跳到该 buff 影响的攻击字段
  3. 点击 卖价,追溯其来自哪条矿车等级规则
  4. 点击结论,查看其正文依据和表格依据

以下写法以后都视为不合规:

  1. 直接把 dps 当正式字段名
  2. 使用 damage2extraDamagenew_price 这类语义不稳定字段
  3. 同一字段既表示基础值,又表示总值
  4. 同时用 sell_pricesell_value 指同一概念
  5. 同时用 cooldownattack_speed 表示同一个冷却概念而不说明换算关系
  6. 击退弹射方式气球 buff 继续写成无法复用的自由文本而不建立变量
  7. 写了关键结论却不给 reference 关系

对应的机器可读注册表已固化在:

src/data/entity-variable-registry.js

后续解析器、校验器和编辑 UI 应直接复用该文件,而不是在各自模块重新定义字段集。

从当前英雄与猴塔数据可稳定提炼出一套统一变量体系。

后续新词条、新机制或新版本更新时:

  1. 优先在本页已有域内选字段
  2. 若字段不存在,优先扩展已有域
  3. 只有在整个机制无法归入现有域时,才允许新增专项命名簇