﻿###########################
# kosmos Events
###########################

add_namespace = kosmos

# Огневое испытание двигателя
country_event = {
	id = kosmos.1
	title = kosmos.1.t
	desc = kosmos.1.d
	picture = GFX_report_event_kosmos_1
	is_triggered_only = yes
	option = {
		name = kosmos.1.a
		hidden_effect = {
			random_list = {
				75 = {	
					modifier = {
						factor = 1.1
						has_stability > 0.85
					}
					modifier = {
						factor = 1.2
						has_available_idea_with_traits = { idea = rocket_scientist limit = 1 }
					}
					country_event = { hours = 1 id = kosmos.2 }					
				}
				25 = {
					modifier = {
						factor = 1.2
						has_stability < 0.5
					}
					country_event = { hours = 1 id = kosmos.3 }					
				}
			}
		}
		effect_tooltip = {
			random_list = {
				75 = {
					modifier = {
						factor = 1.2
						has_available_idea_with_traits = { idea = rocket_scientist limit = 1 }
					}
					country_event = kosmos.2
				}
				25 = {
					country_event = kosmos.3
				}
			}
		}		
	}
}
country_event = {  #good
	id = kosmos.2
	title = kosmos.2.t
	desc = kosmos.2.d
	picture = GFX_report_event_kosmos_2a
	is_triggered_only = yes
	option = {
		name = kosmos.2.a	
		set_country_flag = kosmos_dvijki_provereny
	}
}
country_event = {  #not good
	id = kosmos.3
	title = kosmos.3.t
	desc = kosmos.3.d
	picture = GFX_report_event_kosmos_2b
	is_triggered_only = yes
	option = {
		name = kosmos.3.a
			custom_effect_tooltip = kosmos.3.a.tt 
	}
}

# Запуск прототипа
country_event = {
	id = kosmos.4
	title = kosmos.4.t
	desc = kosmos.4.d
	picture = GFX_report_event_kosmos_4
	is_triggered_only = yes
	option = {
		name = kosmos.4.a
		hidden_effect = {
			random_list = {
				80 = {	
					modifier = {
						factor = 1.1
						has_stability > 0.85
					}
					modifier = {
						factor = 1.2
						has_available_idea_with_traits = { idea = rocket_scientist limit = 1 }
					}
					country_event = { hours = 1 id = kosmos.5 }					
				}
				10 = {					
					country_event = { hours = 1 id = kosmos.6 }					
				}
				10 = {					
					country_event = { hours = 1 id = kosmos.7 }					
				}
			}
		}
		effect_tooltip = {
			random_list = {
				80 = {
					modifier = {
						factor = 1.2
						has_available_idea_with_traits = { idea = rocket_scientist limit = 1 }
					}
					country_event = kosmos.5
				}
				10 = {
					country_event = kosmos.6
				}
				10 = {
					country_event = kosmos.7
				}				
			}
		}		
	}
}
country_event = {   
	id = kosmos.5
	title = kosmos.5.t
	desc = kosmos.5.d
	picture = GFX_report_event_kosmos_5
	is_triggered_only = yes
	option = {
		name = kosmos.5.a
		set_country_flag = kosmos_prototip_uletel
		hidden_effect = {
			news_event = { hours = 3 id = ar_news.69 }
		}
	}
}
country_event = {   
	id = kosmos.6
	title = kosmos.6.t
	desc = kosmos.6.d
	picture = GFX_report_event_kosmos_2b
	is_triggered_only = yes
	option = {
		name = kosmos.6.a
			custom_effect_tooltip = kosmos.6.a.tt 
			clr_country_flag = kosmos_prototip_gotov_complet_flag
	}
}
country_event = {  
	id = kosmos.7
	title = kosmos.7.t
	desc = kosmos.7.d
	picture = GFX_report_event_kosmos_7
	is_triggered_only = yes
	option = {
		name = kosmos.7.a
			custom_effect_tooltip = kosmos.7.a.tt 
			clr_country_flag = kosmos_prototip_gotov_complet_flag
	}
}

# Запуск ракеты!
country_event = {
	id = kosmos.8
	title = kosmos.8.t
	desc = kosmos.8.d
	picture = GFX_report_event_kosmos_8
	is_triggered_only = yes
	option = {
		name = kosmos.8.a
		hidden_effect = {
			random_list = {
				80 = {	
					modifier = {
						factor = 1.1
						has_stability > 0.95
					}
					modifier = {
						factor = 1.2
						has_available_idea_with_traits = { idea = rocket_scientist limit = 1 }
					}
					country_event = { hours = 1 id = kosmos.9 }					
				}
				20 = {
					modifier = {
						factor = 1.1
						has_stability < 0.3
					}
					country_event = { hours = 1 id = kosmos.10 }					
				}
			}
		}
		effect_tooltip = {
			random_list = {
				80 = {
					modifier = {
						factor = 1.2
						has_available_idea_with_traits = { idea = rocket_scientist limit = 1 }
					}
					country_event = kosmos.9
				}
				20 = {
					country_event = kosmos.10
				}
			}
		}		
	}
}
country_event = {   #pervy v kosmose
	id = kosmos.9
	title = kosmos.9.t
	desc = kosmos.9.d
	picture = GFX_report_event_kosmos_9
	is_triggered_only = yes
	option = {
		name = kosmos.9.a
#		custom_effect_tooltip = kosmos.6.a.tt 
		set_country_flag = kosmos_roketa_uletela_flag
		set_global_flag = pervy_sputnik_v_kosmose
		add_timed_idea = {
			idea = pervye_v_kosmose
			days = 500
		}		
		add_stability = 0.2
		every_other_country = {
			add_opinion_modifier = { target = ROOT modifier = pervyi_v_kosmose_10 }
		}
		every_other_country = {
			limit = {  num_of_factories > 40  }
			add_stability = -0.1
		}
		hidden_effect = {
			news_event = { hours = 3 id = ar_news.641 }
			add_dynamic_modifier = { modifier = ar_status_recon_sputnik_dynamic_modifier }
		}
	}
}
country_event = {   #fail
	id = kosmos.10
	title = kosmos.10.t
	desc = kosmos.10.d
	picture = GFX_report_event_kosmos_2b
	is_triggered_only = yes
	option = {
		name = kosmos.10.a
		custom_effect_tooltip = kosmos.6.a.tt 
		clr_country_flag = kosmos_roketa_gotova_flag
	}
}

# Запуск ракеты 2
country_event = {
	id = kosmos.11
	title = kosmos.11.t
	desc = kosmos.11.d
	picture = GFX_report_event_kosmos_8
	is_triggered_only = yes
	option = {
		name = kosmos.11.a
		hidden_effect = {
			random_list = {
				80 = {	
					modifier = {
						factor = 1.1
						has_stability > 0.9
					}
					modifier = {
						factor = 1.2
						has_available_idea_with_traits = { idea = rocket_scientist limit = 1 }
					}
					country_event = { hours = 1 id = kosmos.12 }					
				}
				20 = {					
					country_event = { hours = 1 id = kosmos.13 }					
				}
			}
		}
		effect_tooltip = {
			random_list = {
				80 = {
					modifier = {
						factor = 1.2
						has_available_idea_with_traits = { idea = rocket_scientist limit = 1 }
					}
					country_event = kosmos.12
				}
				20 = {
					country_event = kosmos.13
				}
			}
		}		
	}
}
country_event = {   #ne pervye v kosmose
	id = kosmos.12
	title = kosmos.12.t
	desc = kosmos.12.d
	picture = GFX_report_event_kosmos_9
	is_triggered_only = yes
	option = {
		name = kosmos.12.a
#		custom_effect_tooltip = kosmos.6.a.tt 
		set_country_flag = kosmos_roketa_uletela_flag	
		add_timed_idea = {
			idea = ochednye_v_kosmose
			days = 430
		}		
		add_stability = 0.12			
		hidden_effect = {
			news_event = { hours = 3 id = ar_news.642 }
			add_dynamic_modifier = { modifier = ar_status_recon_sputnik_dynamic_modifier }
		}			
	}
}
country_event = {   #fail
	id = kosmos.13
	title = kosmos.13.t
	desc = kosmos.13.d
	picture = GFX_report_event_kosmos_2b
	is_triggered_only = yes
	option = {
		name = kosmos.13.a
		custom_effect_tooltip = kosmos.6.a.tt 
		clr_country_flag = kosmos_roketa_gotova_flag
	}
}
country_event = {   #razr chertejei
	id = kosmos.14
	title = kosmos.14.t
	desc = kosmos.14.d
	picture = GFX_report_event_kosmos_14
	is_triggered_only = yes
	option = {
		name = kosmos.14.a	
		set_country_flag = kosmos_chertej_complet_flag
	}
}
country_event = {   #sistema upravleniya
	id = kosmos.15
	title = kosmos.15.t
	desc = kosmos.15.d
	picture = GFX_report_event_kosmos_15
	is_triggered_only = yes
	option = {
		name = kosmos.15.a	
		set_country_flag = kosmos_sistem_upravleniya_complet_flag
	}
}
country_event = {   #prototip gotov
	id = kosmos.16
	title = kosmos.16.t
	desc = kosmos.16.d
	picture = GFX_report_event_kosmos_16
	is_triggered_only = yes
	option = {
		name = kosmos.16.a	
		set_country_flag = kosmos_prototip_gotov_complet_flag
	}
}

##############################
country_event = {	# разведспутник построен и запущен
	id = kosmos.17
	title = kosmos.17.t
	desc = kosmos.17.d
	picture = GFX_report_event_kosmos_16
	is_triggered_only = yes
	option = {
		name = kosmos.17.a	
		add_to_variable = { kosmos_sputnik_light_var = 1 }
		kosmos_renew_status_sputnikov = yes
	}
}

country_event = {	# разведспутник построен и РАЗБИЛСЯ при старте
	id = kosmos.18
	title = kosmos.18.t
	desc = kosmos.18.d
	picture = GFX_report_event_kosmos_2b
	is_triggered_only = yes
	option = {
		name = kosmos.18.a	
		kosmos_renew_status_sputnikov = yes
	}
}

country_event = {	#
	id = kosmos.19
	hidden = yes
	is_triggered_only = yes
	immediate = {
		if = {
			limit = {
				check_variable = { kosmos_sputnik_light_var > 0 }
			}
			random_list = {
				18 = {		# наш спутник сбит
					modifier = {
						factor = 1.2
						FROM = {
							has_country_flag = ar_kosmos_update_3_flag	# Модернизированная боевая часть
						}
					}
					modifier = {
						factor = 1.2
						FROM = {
							has_country_flag = ar_kosmos_update_5_flag	# Электронные вычислительные машины
						}
					}
					country_event = { id = kosmos.21 }
					FROM = {
						country_event = { id = kosmos.22 }
					}
				}
				31 = {	# наш спутник хотели сбить, но не получилось. мы видели
					modifier = {
						factor = 1.1						
						has_country_flag = ar_kosmos_update_5_flag	# Электронные вычислительные машины						
					}
					modifier = {
						factor = 1.1						
						has_country_flag = ar_kosmos_update_1_flag	# автоматическая система управления				
					}
					country_event = { id = kosmos.23 }
					FROM = {
						country_event = { id = kosmos.24 }
					}
				}
				51 = {	# наш спутник хотели сбить, но мы даже этого не заметили
					modifier = {
						factor = 0.6
						FROM = {
							has_country_flag = ar_kosmos_update_2_flag	# комплексных подготовительных мероприятий
						}
					}
					FROM = {
						country_event = { id = kosmos.25 }
					}
				}
			}
		}
		else = {
			FROM = {
				country_event = { id = kosmos.28 }
			}
		}
	}
	option = {
		name = kosmos.19.a			
	}
}

country_event = {	# тестовый эвент для нас
	id = kosmos.20
	title = kosmos.20.t
	desc = kosmos.20.d
	picture = GFX_report_event_kosmos_2b
	is_triggered_only = yes
	immediate = {
		custom_effect_tooltip = kosmos.20.tt
	}
	option = {
		name = kosmos.20.a	
		effect_tooltip = {
			random_list = {
				20 = {		# наш спутник сбит
					modifier = {
						factor = 1.1						
						has_country_flag = ar_kosmos_update_3_flag	# Модернизированная боевая часть						
					}
					modifier = {
						factor = 1.1						
						has_country_flag = ar_kosmos_update_5_flag	# Электронные вычислительные машины						
					}
					custom_effect_tooltip = kosmos.20.uspeh
				}
				30 = {	# наш спутник хотели сбить, но не получилось. мы видели
					modifier = {
						factor = 1.1
						FROM = {	
							has_country_flag = ar_kosmos_update_5_flag	# Электронные вычислительные машины		
						}		
					}
					modifier = {
						factor = 1.1
						FROM = {	
							has_country_flag = ar_kosmos_update_1_flag	# автоматическая система управления	
						}
					}
					custom_effect_tooltip = kosmos.20.mimo
				}
				50 = {	# наш спутник хотели сбить, но мы даже этого не заметили
					modifier = {
						factor = 0.6						
						has_country_flag = ar_kosmos_update_2_flag	# комплексных подготовительных мероприятий						
					}
					custom_effect_tooltip = kosmos.20.vzriv_na_starte
				}
			}		
		}
	}
}

country_event = {	# наш спутник был сбит! 
	id = kosmos.21
	title = kosmos.21.t
	desc = kosmos.21.d
	picture = GFX_report_event_kosmos_2b
	is_triggered_only = yes
	immediate = {
		hidden_effect = {
			add_to_variable = { kosmos_sputnik_light_var = -1 }	
			kosmos_renew_status_sputnikov = yes	
		}	
	}
	option = {
		name = kosmos.21.a	
		custom_effect_tooltip = kosmos.21.a.tt
	}
}

country_event = {	# мы сбили спутник у [FROM.GetNameDef]
	id = kosmos.22
	title = kosmos.22.t
	desc = kosmos.22.d
	picture = GFX_report_event_kosmos_2b
	is_triggered_only = yes	
	option = {
		name = kosmos.22.a	
		custom_effect_tooltip = kosmos.22.a.tt
	}
}

country_event = {	# кто-то хотел перехватить наш спутник но не получилось
	id = kosmos.23
	title = kosmos.23.t
	desc = kosmos.23.d
	picture = GFX_report_event_kosmos_2b
	is_triggered_only = yes	
	option = {
		name = kosmos.23.a			
	}
}

country_event = {	# нам не удалось перехватить спутник у [FROM.GetNameDef]. наша противоракета пролетела мимо
	id = kosmos.24
	title = kosmos.24.t
	desc = kosmos.24.d
	picture = GFX_report_event_kosmos_2b
	is_triggered_only = yes	
	option = {
		name = kosmos.24.a			
	}
}

country_event = {	# мы промазали
	id = kosmos.25
	hidden = yes
	is_triggered_only = yes	
	immediate = {
		hidden_effect = {
			random_list = {
				30 = {
					country_event = { id = kosmos.26 }
				}
				30 = {
					country_event = { id = kosmos.27 }
				}
				40 = {
					country_event = { id = kosmos.28 }
				}
			}			
		}	
	}
	option = {
		name = kosmos.25.a			
	}
}

country_event = {	# нам не удалось перехватить спутник у [FROM.FROM.GetNameDef]. наша противоракета взорвалась на старте
	id = kosmos.26
	title = kosmos.26.t
	desc = kosmos.26.d
	picture = GFX_report_event_kosmos_2b
	is_triggered_only = yes	
	option = {
		name = kosmos.26.a			
	}
}

country_event = {	# нам не удалось перехватить спутник у [FROM.FROM.GetNameDef]. мы потеряли связь с нашей противоракетой
	id = kosmos.27
	title = kosmos.27.t
	desc = kosmos.27.d
	picture = GFX_report_event_kosmos_2b
	is_triggered_only = yes	
	option = {
		name = kosmos.27.a			
	}
}

country_event = {	# нам не удалось перехватить спутник у [FROM.FROM.GetNameDef]. наша противоракета знатно так отлонилась и промазала. скорее всего её даже не заметили
	id = kosmos.28
	title = kosmos.28.t
	desc = kosmos.28.d
	picture = GFX_report_event_kosmos_2b
	is_triggered_only = yes	
	option = {
		name = kosmos.28.a			
	}
}

## при модернизации боевой части бомбануло
country_event = {	
	id = kosmos.29
	title = kosmos.29.t
	desc = kosmos.29.d
	picture = GFX_report_event_kosmos_2b
	is_triggered_only = yes	
	option = {
		name = kosmos.29.a
		if = {
			limit = {
				has_active_mission = kosmos_boevaya_chast_mission
			}
			add_days_mission_timeout = {
				mission = kosmos_boevaya_chast_mission
				days = 70
			}
		}		
		hidden_effect = {	
			if = {
				limit = {
					has_idea = kosmos_boevaya_chast_mission_debuff
				}
				modify_timed_idea = {
					idea = kosmos_boevaya_chast_mission_debuff
					days = 70
				}
			}
		}
	}
}



