trigger · has_combat_modifier
Definition
- Supported scope:
COMBATANT - Supported target:
none
Description
check if combatant has modifier
has_combat_modifierCOMBATANTnonecheck if combatant has modifier
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
has_combat_modifier 常用于战斗事件或特殊机制 mod 中,根据交战方当前是否携带某个战斗修正来触发额外效果或决策,例如区分被"士气崩溃"修正压制的一方和正常交战方。也可用于战斗相关的动态 AI 行为脚本,检测特定增益/减益是否已经叠加,从而避免重复施加同名修正。
# 在战斗事件的触发条件中,仅当进攻方携带某修正时才激活
combat_event = {
id = my_mod.1
trigger = {
is_attacker = yes
has_combat_modifier = my_special_debuff
}
...
}
false,导致条件永远不满足。务必与定义该战斗修正的文件中的 key 严格保持一致,包括大小写。Hands-on notes are AI-generated and checked against the vanilla command vocabulary — treat them as a starting point, not authoritative reference. The definition above is the game's own documentation.
has_combat_modifier is commonly used in combat events or specialized mechanics mods to trigger additional effects or decisions based on whether a combatant currently carries a specific combat modifier. For example, it can distinguish between a side suppressed by a "morale collapse" modifier and a side engaged in normal combat. It can also be used in combat-related dynamic AI behavior scripts to detect whether specific buffs/debuffs have already been applied, thereby avoiding duplicate application of modifiers with the same name.
# In a combat event's trigger conditions, activate only when the attacker carries a specific modifier
combat_event = {
id = my_mod.1
trigger = {
is_attacker = yes
has_combat_modifier = my_special_debuff
}
...
}
false, causing the condition to never be satisfied. Always keep the name strictly consistent with the key in the file that defines the combat modifier, including capitalization.