trigger · has_country_custom_difficulty_setting
Definition
- Supported scope:
COUNTRY - Supported target:
any
Description
Returns true if the game has any custom difficulty on the scope nation
has_country_custom_difficulty_settingCOUNTRYanyReturns true if the game has any custom difficulty on the scope nation
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
这个 trigger 常用于自定义难度系统相关的 mod 场景中,例如当玩家为某个国家开启了自定义难度选项后,动态调整该国的科研速度、工厂产出或 AI 行为。也可以用在 focus 或 decision 的 available 块中,限制某些强力选项仅在标准难度下才能触发。
# 在某个国家事件的 trigger 中,检测是否启用了自定义难度
country_event = {
id = my_mod.1
trigger = {
has_country_custom_difficulty_setting = yes
# 只有开启了自定义难度的国家才会触发此事件
}
...
}
[has_country_flag](/wiki/trigger/has_country_flag):先用 flag 记录玩家对难度的选择行为,再结合本 trigger 双重确认状态,避免误判。[has_active_rule](/wiki/trigger/has_active_rule):自定义难度往往伴随特定规则的开关,两者配合可以精确区分多种难度配置组合。[add_ideas](/wiki/effect/add_ideas):检测到自定义难度后,通过添加 idea 来动态平衡国家属性,是最常见的后续效果写法。[country_event](/wiki/effect/country_event):确认自定义难度生效后触发专属事件,向玩家提示当前难度状态或给予特殊奖惩。limit 块嵌套层级较深时忘记切换 scope。