[flavor_chi.2003] 中国宝船舰队位置移动
时间范围
- 事件类型:动态历史事件(无固定时间范围,由游戏逻辑触发)
- 触发概率:无固定月度概率,由游戏内部逻辑(
on_chinese_expedition_location_move)控制触发时机
触发条件
- 主要触发:由游戏内部机制
on_chinese_expedition_location_move调用,通常关联于中国宝船舰队探险路线的推进或状态变更。 - 备用触发:当舰队目标地块所属国家被吞并,导致
next_tile作用域失效时,通过检查变量chinese_treasure_fleet_location和chinese_expedition_route_deviation_return进行容错处理。
关键效果
- 唯一选项:
flavor_chi.2003.a(无具体效果描述,可能仅为确认或继续) - 核心操作:
- 更新舰队位置:若
next_tile作用域有效,将其值赋给变量chinese_treasure_fleet_location。 - 容错位置恢复:若
next_tile失效,但检测到舰队位置变量中存在chinese_expedition_route_deviation_return变量,则使用该变量中保存的地块作为新的next_tile,并更新舰队位置。 - 执行标准移动逻辑:调用
on_chinese_expedition_location_move效果。 - 更新舰队状态:调用
chinese_expedition_status_change效果。
- 更新舰队位置:若
背景介绍
此事件模拟了明朝郑和宝船舰队在远洋航行过程中的位置移动与路线管理。在游戏中,宝船舰队的探险是一个多阶段的过程,需要不断更新其所在位置以触发后续事件、交互或贸易活动。该事件作为舰队移动机制的核心,确保了即使因政治变动(如访问国被吞并)导致预定路线中断,舰队也能根据预设的备用路线或逻辑找到下一个目的地,维持探险的连续性。
完整事件代码
flavor_chi.2003 = {
type = country_event
title = flavor_chi.2003.title
desc = flavor_chi.2003.desc
hidden = yes
immediate = {
if = {
limit = { exists = scope:next_tile }
set_variable = {
name = chinese_treasure_fleet_location
value = scope:next_tile
}
}
else_if = { # Failsafe for if the next_tile scope fails to pass when visited country is annexed
limit = {
has_variable = chinese_treasure_fleet_location
var:chinese_treasure_fleet_location = {
has_variable = chinese_expedition_route_deviation_return
}
}
var:chinese_treasure_fleet_location = {
var:chinese_expedition_route_deviation_return = {
save_scope_as = next_tile
}
}
set_variable = {
name = chinese_treasure_fleet_location
value = scope:next_tile
}
}
on_chinese_expedition_location_move = yes
chinese_expedition_status_change = yes
}
option = {
name = flavor_chi.2003.a
}
after = {
}
}