trigger · is_winning
Definition
- Supported scope:
COMBATANT - Supported target:
none
Description
check if defender side in combat
is_winningCOMBATANTnonecheck if defender side in combat
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
is_winning 常用于战斗事件或战斗相关决议中,根据某一方是否处于优势来触发不同的叙事效果或奖励,例如为正在获胜的一方额外增加士气加成事件。也可在 limit 块中筛选特定战斗方,配合特质解锁或战斗 modifier 实现动态战场机制。
# 战斗事件:获胜方触发鼓舞效果
combat_event = {
id = my_mod.combat.1
trigger = {
is_winning = yes
is_attacker = no # 确保是防守方正在获胜
}
option = {
name = my_mod.combat.1.a
# 此处添加效果
}
}
is_winning 搭配可精确区分「进攻方获胜」还是「防守方获胜」,避免逻辑歧义。is_winning 只能在 COMBATANT scope 下使用,若在国家或省份 scope 中调用会静默失败或报错,新手容易忘记先通过 combat 相关块进入正确 scope。is_winning = yes 等同于"已经赢得战斗",实际上它只反映当前战斗中该方是否处于优势状态,战斗尚未结束,条件随战况实时变化。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.
is_winning is commonly used in combat events or combat-related decisions to trigger different narrative effects or rewards based on whether one side holds an advantage. For example, it can grant morale bonuses to the winning side, or be used in limit blocks to filter specific combatants, working in tandem with trait unlocks or combat modifiers to implement dynamic battlefield mechanics.
# Combat event: Morale boost for the winning side
combat_event = {
id = my_mod.combat.1
trigger = {
is_winning = yes
is_attacker = no # Ensures the defending side is winning
}
option = {
name = my_mod.combat.1.a
# Add effects here
}
}
is_winning, these allow precise distinction between "attacker winning" and "defender winning," eliminating logical ambiguity.is_winning can only be used within COMBATANT scope. Calling it in country or province scope will silently fail or throw an error—a common mistake for beginners who forget to enter the correct scope via combat-related blocks first.is_winning = yes means "already won the battle," when it actually reflects whether that side currently holds an advantage in the ongoing combat. The battle is not yet concluded, and the condition updates in real-time as the situation evolves.