# No scope, like on_game_start
on_monthly_pulse = {
	events = {
#		guardian.10 #ǰϵˣÿ+1
#		unrest.162 #ūҽ֣ûūʱ¼
#		unrest.164 #10ūұ
#		syndaw.100 # servitor morale̷ȼ	
#		marauder.511 # Great Khan Dies
		#marauder.11 # Marauder infighting - commented out for now
#		crisis.120 # Feral Prethoryn
#		crisis.123 # Feral Prethoryn infighting
#		marauder.113
#		guardian.170
#		guardian.172
#		action.85 # flip planets to starbase owner
#		marauder.150 # AI hires Marauder raids
#		marauder.151 # AI hires Marauder mercs
#		action.90 # rebuild outpost for orphaned colonies
#		unrest.166	
		xilin_ai.1 #ϣ۹ai
		harmonious_planet.1 #г
		harmonious_planet.13 #ʧȥĸһΪĸ
		harmonious_planet.14 #ǸʽҷȺΪ
		harmonious_planet.29	#ȡ鱣Ĵ
	}
}

# No scope, like on_game_start
on_yearly_pulse = {
	events = {
#		pirate.4 #,ɿset_country_flag = birth_of_piracyֹ
#		crisis.204 # Spawn Infestors if less than 4 are available, on_yearly_pulseֳԮ
#		crisis.205 # Spawn Constructors if less than 4 are available, on_yearly_pulse 幤̴Ԯ
#		crisis.208 # Destroy Swarm if no planets and only 5 or less ships remain 
#		crisis.240 # Prethoryn army reinforcements ûʱ½Ԯ	
#		crisis.1254 # Destroy EXDs if no portals and only 5 or less ships remain ħ
#		crisis.2080 #ϳ˿ֲж
#		crisis.2310 #еΣ¼
#		action.64 # species assimilationͬ
#		marauder.100
#		crisis.122
#		marauder.85
#		marauder.160
		harmonious_planet.10 #ĸּ
	}
}

# No scope, like on_game_start
on_five_year_pulse = {
	events = {
#		crisis_trigger.1 #Σ
		xilin_crisis_trigger.1 #modΣ
	}
}

# Triggers when the game starts
on_game_start = {
	events = {
#		game_start.1  #4ʼ¼̫ϵ
#		game_start.2  #׶ȥ
#		game_start.3  #Ϸʼ
#		game_start.5  #趨ʱ
#		game_start.31
#ϣ۹ʼ,event¼
    xilin.1    
	}
}

# Called during empire initialization when starting a new game if has_secondary_species game rule is true.
# Called before empire_init_create_capital_pops.
# scope: planet
# from: secondary species
empire_init_create_capital_secondary_pops = {
	events = {
		#game_start.11	# secondary species: assign trait_machine_unit, turn into robotics, then create pops
		# at this point the species might have changed (because we added traits), so FROM might not be the secondary species anymore
		harmonious_planet.16 #ӵкгǷǷȺҵĳʼ
	}
}

# A pop has finished migrating to another planet
# Root = pop
# From = Tile on the new planet
# FromFrom = Tile on the old planet
on_pop_migration_end = {
	events = {
#		action.58  #buff
		xilin_pop.3 #
		xilin_pop.4 #ȥȡ
		harmonious_planet.24 #˿Ƿﵽ2/3Ƿδﵽ1/3,鱣Ǽbuff
    harmonious_planet.26 #˿ȥԭǷ˿δ2/3Ƴ鱣buff
	}
}
# We changed a species right
# This = pop
on_pop_rights_change = {
	events = {
#		utopia.90 # remove withdrawal when blissed
#		utopia.91 # add withdrawal after bliss
		xilin_pop.2 #þȨķԾ
		xilin_pop.10 #ʧȥȨķƳ
		xilin_diplomacy.3 #ʳаȱ
	}
}

# A pop has been born
# This = pop
#on_pop_birth = {
#	events = {
#	}
#}

# A pop has been built
# This = pop
#ʼ
on_buildable_pop_created = { 
	events = {
#		crisis.2055
#		crisis.2312
		harmonious_planet.31 #Ƿ鱣ֹͣ
		harmonious_planet.24 #ǷҪ鱣
	}
}

# A pop has become fully grown
# This = pop
on_pop_fully_grown = {
	events = {
#		action.66	  # Add new organic sanctuaries & remove unused onesµлӻ-ɾδʹõ
		xilin_pop.2  #þȨķԾ	
    xilin_pop.7 #ʹͽȷ
    xilin_pop.8 #߾ĸʸʹͽϳԵ
    xilin_diplomacy.2 #ҵ˿ڴ
    harmonious_planet.24	#˿Ƿﵽ2/3Ƿδﵽ1/3,鱣Ǽbuff
		harmonious_planet.25 #˿ڴﵽ1/3,Ƴ鱣buff
	}
}

# A pop has been resettled to another planet
# Root = pop
# From = Tile on the old planet
on_pop_resettled = {
	events = {
#		action.67 #ͣлӻ
    harmonious_planet.24 #Ǩƽ˿Ƿﵽ2/3Ƿδﵽ1/3,鱣Ǽbuff
    harmonious_planet.27 #˿ڰóȥ˿δ2/3Ƴ鱣buff
	}
}


#Fired whenever a new owner is set for a planet,
#be it after a war or through a trade
#From = Country scope (new owner)
#This = Planet scope
on_planet_transfer = {
	events = {
#		action.42 #۹ΨһߵĻڳռ˿
#		apoc.202 # lose new holy world status		
		xilin_pop.5
		xilin_pop.6 #ûʧȥ
		harmonious_planet.2 #Ǻгһúг󣬺г
		harmonious_planet.15 #Ǻгһúг
		harmonious_planet.17 #гҶغгû״̬
		harmonious_planet.18 #г򱻷Ⱥߣûʧȥ
		harmonious_planet.30  #򱻲֧ҶߣһЩضƳ
		xilin_pop.11 ##ͨˣתΪϣɻе
		xilin_pop.12 #ʹͽ˿ϣʹͽκ
		xilin_pop.13 #ϣ۹ϵ
	}
}

# Executes after a policy has been changed
# use last_changed_policy to identify which policy it was
# This = Country
on_policy_changed = {
	events = {
#		action.35 # Observation Posts set to Passive study when policy is downgraded to Passive
#		syndaw.1300 # banning AI can cause Uprising
#		syndaw.1305 # banning bot workers can cause Uprising
#		leader.30 # banning AI will remove AI-dependent traits from leaders
#		action.80 # banning AI will remove existing Synthetic Armies
		xilin_pop.9 #ɺʳ
	}
}

# A planet has been colonized.
# Scope = Planet
on_colonized = {
	events = {
#		crisis.203 #ֳ
#		anomaly.4171 #gas_rich_planetֳ
#		tutorial.27
#		tutorial.444 #Increase num_colonies variable
		#factions.105 # Colonialists New Colony
#		akx.9499 #ʱֳ֮¼
		#action.55
		xilin_pop.5 #򣬾þ
	}
}

# A country has increased the level of a tech, use last_increased_tech trigger to check tech and level.
# This = Country
on_tech_increased = {
	events = {
#		tutorial.6
#		tutorial.64
#		tutorial.73
		#crisis.2190
#		anomaly.1191 #¼
#		anomaly.1193 #¼
    xilin_ascension_perk.1 #ϣĽƷ
    xilin_ascension_perk.3 #ϣƿؽ
    xilin_ascension_perk.5 #ϣѪƤҷ
    xilin_ascension_perk.7 #ϣںϽ
    xilin_ascension_perk.71 #ϣںϽ
    xilin_ascension_perk.9 #ϣʤ
    xilin_ascension_perk.11 #ϣ鳬ʥ
    xilin_diplomacy.13  #׷()׷(ӹ)
    harmonious_planet.20 #ĸرĿ
	}
}

# This = owner of ship 1 (destroyed)
# From = owner of ship 2 (combatant)
# FromFrom = ship 1
# FromFromFrom = ship 2
on_ship_destroyed_victim = {
	events = {
#		syndaw.30   #е۹챸׼
#		mandate.143 #촬
#		nomad.95  #ܹʵ𣬸Ϊر״̬
#		guardian.3002 #Horror Destroyed
#		guardian.3101 #η
#		guardian.592  #Curatorչˣ Destroyed 
#		guardian.140  #Trader Destroyed
#		crisis.1281  #ռêݻ
#		crisis.1282 #ħɱ
#		crisis.217 #Prethoryn Kill Count
#		crisis.2070 #Contingency Kill Count(еΣ)
#		crisis.1012 # Portal Destroyed
#		crisis.1115 #Second Portal Destroyed
#		crisis.1215 #Third Portal Destroyed
#		marauder.4
#		marauder.505
#		marauder.509
#		crisis.80
#		marauder.525
		xilin_leader.1 #ϣ쵼˸
	}
}

# Executed as a leader has died
# This = Country
# From = Leader
on_leader_death = {
	events = {
#		pretender.1 #ûм̳
#		mandate.21 #ʧ
#		akx.9330  #עᣬ
#		marauder.70
		xilin_leader.10 #ϣ쵼˸
	}
}

# This = owner of fleet 1
# From = owner of fleet 2
# FromFrom = fleet 1
# FromFromFrom = fleet 2
on_entering_battle = {
	events = {
#		nomad.96 #ʱĴ
#		nomad.98
#		nomad.99
#		guardian.330 #ұ
#		guardian.155 #ѩ˾
#		guardian.158 #˾
#		guardian.161 #Ľչ˾
#		guardian.595 #չ˱
    xilin_battle.1 #˶ս
    xilin_battle.6 #ά˹ս
	}
}

# This = Ship
# From = Disabler Ship
#Ǳ任Ȩ󴥷
on_ship_disabled = {
	events = {
#		country.201	#콢Ҵܣ½Ŀ(Ȥ1)
#		country.212 #콢Ҵܣ½Ŀ
#		country.217 #콢Ҵܣ½Ŀ
#		country.222 #аͽ콢˴
#		guardian.2100 #رݱ̱
		xilin_battle.11 #˶ع
		xilin_battle.12 #ά˹ع
	}
}


# This = owner of ship 1 (destroyed)
# From = owner of ship 2 (combatant)
# FromFrom = ship 1
# FromFromFrom = ship 2
#ǱЧ
#on_ship_disengaged_victim = {
#	events = {
#	}
#}



# This = owner of fleet 1 (winner)
# From = owner of fleet 2 (loser)
# FromFrom = fleet 1
# FromFromFrom = fleet 2
#¼ʱȻս,ǱЧ(Ǳ޷action)
#on_space_battle_won = {
#	events = {
#		#achievement.1	
#	}
#}

# This = owner of fleet 1 (loser)
# From = owner of fleet 2 (winner)
# FromFrom = fleet 1
# FromFromFrom = fleet 2
#¼ʱȻս,ǱЧ(ǱЧ)
on_space_battle_lost = {
	events = {
		xilin_battle.2 #ս˶ع
		xilin_battle.7 #սά˹ع
	}
}

# This = owner of fleet 1 (destroyed)
# From = owner of fleet 2 (combatant)
# FromFrom = fleet 1
# FromFromFrom = fleet 2
#¼ʱԴս״̬,ǱЧ
#on_fleet_destroyed_victim = {
#	events = {
#		country.16
#		country.18
#		country.20
#		country.220
#		galactic_features.3
#		country.1021
#		country.1060
#		anomaly.3097
#		guardian.331
#		guardian.1072 #removes modifier if you have a station in orbit of pantagruel
#		guardian.3203
		#guardian.649
#		marauder.51
		#marauder.13 - Marauder infighting aftermath - commented out for now
#		crisis.108
#		crisis.125
#		marauder.115
		#xilin_battle.2 #ս˶ع
		#xilin_battle.7 #սά˹ع		
#	}
#}

# This = owner of fleet 1 (combatant)
# From = owner of fleet 2 (destroyed)
# FromFrom = fleet 1
# FromFromFrom = fleet 2
#on_fleet_destroyed_perp = {
#	events = {
#		country.9 # Probe Recovered Through Battle
#		country.11 # Subspace Anomaly Defeated
#		country.14 # Modified Probe Defeated
#		country.215 # Shipyard DestroyedڽѾ?
#		country.216 # Cultist Ships Defeated
#		country.1020 # Probes destroyed˻(¼)
#		country.1043 #Pirates killed by player, porting to diploɱѧҶԻ(?)
#		colony.181 # Asteroid Destroyed
#		observation.5 # Asteroid Destroyed
#		story.109  # Amoeba kill-check for chain 1
#		#story.114
#		story.209 # Crystal kill-check for chain 1
#		story.309 # Drone kill-check for chain 1
#		story.311 #˻ ˻50
#		story.214 # Crystal kill-check for chain 2
#		story.216 # On-action check for destroyed crystal fleetˮɱ
#		story.332 # station destroyed ˻վݻ
#		story.409 # Cloud kill-check for chain 1
#		anomaly.3101 #ransomeer_chain,pirates destroyed, 50/50 port to survival
#		anomaly.3120 #ܺ
#		galactic_features.360 # If Void Cloud fleet destroys two fleets, a new Void Cloud is created
#		crisis.1111 # Extradimensionals Fight Each Otherħһڧ
#		crisis.70  # Swarm Kill Count
#		guardian.1009 # Stellarite behaviour - chase aggressor setup - from destroyed fleet׷ɱ
#		guardian.1012 # Stellarite behaviour - chase aggressor continuation from combat
#		guardian.1015 # Stellarite behavior - return home to feed
#		guardian.1032 #սָ
#		guardian.1040 #
#		guardian.648 ## Dragon retaliates if hurt and fleet destroyed
#		guardian.655 # On won battle but wounded, hibernate(Ѫ,˯)
#		guardian.670 ## victorious admiral gains dragonslayer trait
#		guardian.334 # You destroyed an artist station
#		guardian.2014 # Wraith killed
#		guardian.4 # guardian kill checkά̹֪ͨ
#		pirate.25 # Destroyed Pirate Stationݻٺͷ()
#		pirate.13 ## perp port ݻٺϵĴ
#		akx.9318  #עս
#		akx.10030 #ʱ֮
#		factions.330 ## Industrialist Recent Monster ExterminationҵҪ
#		factions.10 # Killed Guardian
#		crisis.2472 ## Contingency Kill Count(aiΣ)
#    xilin_battle.21 #ս˶ع
#    xilin_battle.71 #սޣά˹ع
#	}
#	random_events = {
#		300 = 0
#		2 = leader.1 ## New Admiralս½
#		2 = leader.5 # Trickster gained from Victory
#		2 = leader.6 # Aggressive gained from Victory
#		2 = leader.7 # Unyielding gained from Victory
#		2 = leader.8 # Gale Speed gained from Victory
#		2 = leader.9 # Lethargic lost from Victory
#		2 = leader.17 # Nervous lost from Victory
#	}
#}

# A fleet has successfully escaped from combat, executed right before the fleet enters FTL
# This = escaping fleet
# From = system escaped from
# FromFrom = system escaping to
on_emergency_ftl = {
	events = {
#		nomad.97 ### Nomads get attacked when weak and change fleet stance ###룬Ϊ״̬
#		guardian.1010
#		guardian.1013
#		guardian.1014
#		guardian.1020
#		guardian.1031
#		guardian.650
#		guardian.654
    xilin_battle.4 #ս˶ع
    xilin_battle.5 #ߣ˶ع
    xilin_battle.9 #սά˹ع
    xilin_battle.10 #ѣά˹ع
	}
#	random_events = {
#		310 = 0
#		10 = leader.10
#		10 = leader.12
#		10 = leader.13
#		10 = leader.14
#		10 = leader.11		
#	}
}

# A fleet has entered a system
# Scope = Fleet
# From = System
on_entering_system_fleet = {
	events = {
#		action.40
#		country.211
#		country.1002
#		anomaly.3095
#		country.204
#		country.205
#		country.206
#		story.218
#		story.220
#		story.330
		#story.408
#		anomaly.3114
#		anomaly.3115
#		nomad.3
#		nomad.7
#		nomad.8
#		guardian.96
#		guardian.1005
#		pirate.10
#		guardian.610
#		guardian.1030
#		akx.9200
#		akx.9300
#		akx.9600
#		akx.9610
    xilin_battle.3 #ս˶
    xilin_battle.8 #սά˹
	}
#	random_events = {
#		99 = 0
#		1 = akx.9000 #ʱ֮ٷһ
#	}
}

# This = Planet scope
# From = Country
# FromFrom = Pop
on_purge_complete = {
	events = {
#		crisis.202  #ֻʣ1ʱǱ泲
#		crisis.2044  #aiΣƽɱֻʣ1˿ʱAI۹
		# mandate.131
#		action.21 # Opinion effect on other empires۹ķӦ
#		utopia.180 # Gain resources for fanatic purifiers civic #
#		utopia.181 # Gain resources for devouring swarm
#		syndaw.1330 # Gain resources for exterminators
    xilin_diplomacy.1 #йҽʱϣ۹ΪȣΪ
	}
}

# This = country
# From = opponent war leader#ָ쵼սĹ
on_entering_war = {
	events = {
	  xilin_diplomacy.4 #ϣսƳϣ鿪ű߾flag
	}
}

# A war has been lost
# Root = Loser Warleader
# From = Winner Warleader
# FromFrom = War
on_war_lost = {
	events = {
#		action.38
#		fallen_empires.2  #ɱ
#		fallen_empires.12 #սܴսflag
		xilin_diplomacy.14 #ϣ۹ģս䱻
	}
}

#A building construction has been completed. 
#ֻеһνʱؽᴥaction,ᴥon_building_replaced
# This = Planet
# From = Tile
#on_building_complete = {
#	events = {
#		tutorial.14
#		tutorial.140
#		akx.10000 #ŷ٤ɣٻʱ֮
#		harmonious_planet.5 #º󣬱ɱ
#	}
#}

# A building construction has finished, replacing another building.
# This = Planet
# From = Tile
#on_building_replaced = {
#	events = {
#		colony.2020 #ŹֹĽ
#		guardian.305 #Ľһ
#		akx.10000 #ŷ٤ɣٻʱ֮
#		harmonious_planet.5 #º󣬱ɱ
#	}
#}

# A tile building has been ruined
# This = Planet
# From = Tile
on_building_ruined = {
	events = {
		 harmonious_planet.12 #ĸܱٻ
	}
}