Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

[flavor_chi.2002] 宝船远航

时间范围
无固定时间范围(动态事件,无 fromto 字段)

触发概率
无固定概率(动态事件,无 monthly_chance 字段)

触发条件

  • 国家可能受宝船远航影响(possibly_impacted_by_treasure_voyages = yes

关键效果

  • 选项 A(无 historical_option 标记):
    • 支付与宝船货物价值相等的金币(add_gold = { value = var:chinese_treasure_voyage_cargo multiply = -1 }

背景介绍
此事件模拟了中国历史上著名的“郑和下西洋”宝船远航。当国家具备组织大规模海上远航的能力时,可派遣船队携带货物前往指定海域目标,以展示国威、进行贸易与外交活动。事件启动时会选定出发港口、目标海域与船队统帅,并规划海上航线。

完整事件代码

flavor_chi.2002 = {
	hide_portraits = yes
	type = country_event
	title = flavor_chi.2002.title
	desc = flavor_chi.2002.desc

	illustration_tags = {
		10 = exterior
		10 = regular
	}

	major = yes
	major_trigger = {
		possibly_impacted_by_treasure_voyages = yes
	}

	immediate = {
		event_illustration_poptype_effect = { foreground = pop_type:soldiers background = pop_type:soldiers }

		set_global_variable = {
			name = chinese_treasure_voyage_running
			value = ROOT
		}
		random_port_in_country = {
			limit = {
				OR = {
					integration_level = core
					integration_level = integrated
					dominant_culture ?= { is_primary_or_accepted_in = root }
				}
			}
			save_scope_as = start_location
		}
		set_variable = {
			name = chinese_treasure_voyage_cargo
			value = scope:target_value
		}
		set_variable = {
			name = chinese_treasure_target_area
			value = scope:target_area
		}
		set_variable = {
			name = chinese_treasure_fleet_location
			value = scope:start_location
		}
		set_variable = {
			name = chinese_treasure_start_location
			value = scope:start_location
		}
		set_variable = {
			name = gifts_received
			value = 0
		}
		set_variable = {
			name = remaining_locations
			value = 0
		}

		make_into_expedition_leader = { target = scope:target_character }

		save_scope_as = expedition_initiator

		set_chinese_expedition_scopes = yes

		var:chinese_treasure_target_area = {
			random_location_in_area = {
				limit = { is_coastal = yes }
				ROOT = {
					set_variable = {
						name = chinese_treasure_target_location
						value = PREV
					}
				}
			}
		}

		find_route = {
			start = var:chinese_treasure_fleet_location
			end = {
				this = scope:expedition_initiator.var:chinese_treasure_target_location
			}
			limit = {
				is_land = no
			}
			weight = {
				value = scope:distance
				if = {
					limit = {
						is_coastal = yes
					}
					multiply = 0.75
				}
			}
			movement_cost = yes
			effect = {
				save_route_to_the_target_effect = {
					variable_name = chinese_treasure_next_location
				}
				scope:expedition_initiator = {
					add_to_variable_list = {
						name = route_to_target_expedition_list
						target = PREV
					}
					change_variable = {
						name = remaining_locations
						add = 1
					}					
				}
			}
		}

		change_expedition_state = { status = travel_to }
	}

	option = {
		name = flavor_chi.2002.a
		
		custom_tooltip = chinese_treasure_expeditions_send_tooltip
		add_gold = {
			value = var:chinese_treasure_voyage_cargo
			multiply = -1
		}
	}

	after = {
		hidden_effect = {
			chinese_treasure_sail_to = {
				to = var:chinese_treasure_fleet_location.var:chinese_treasure_next_location
			}
		}
	}
}