on_actions = {
	on_startup = {
		effect = {
			every_country = {
				limit = {
					is_ai = no
					has_game_rule = {
						rule = a_sa_gc_mod_rule
						option = sa_gc_start_event_rule
					}
				}
				country_event = {id = ex_limit_sa_mod.1 }
				set_variable = {
					root.open_close = 1
				}
			}
			622 = { 
                add_building_construction = {
                    type = prc_simple_arsenal
                    level = 2
                    province = 12356
                }
                add_resource = {
                    type = steel
                    amount = 6
                }
                add_resource = {
                    type = tungsten
                    amount = 6
                }
                add_resource = {
                    type = aluminium
                    amount = 2
                }
            }
            615 = {
                add_resource = {
                    type = steel
                    amount = 20
                }
            }
            683 = {
                add_resource = {
                    type = tungsten
                    amount = 7
                }
            }
            756 = {
                add_resource = {
                    type = oil
                    amount = 10
                }
            }
            754 = {
                add_resource = {
                    type = steel
                    amount = 8
                }
            }
            619 = {
                add_resource = {
                    type = steel
                    amount = 8
                }
                add_resource = {
                    type = aluminium
                    amount = 8
                }
                add_resource = {
                    type = chromium
                    amount = 8
                }
            }
            618 = {
                add_resource = {
                    type = oil
                    amount = 8
                }
            }
		}
	}
	on_startup = {
		effect = {
			random_country = {
				country_event = { id = ex_limit_sa_mod.3 }
			}
			every_state = {
				if = {
					limit = {
						any_province_building_level = {
							province = {
								all_provinces = yes
							}
							building = naval_base
							level > 4
						}
						NOT = {
							has_state_flag = industrial_complex_construction_speed_factor_TT_1
						}
					}
					set_state_flag = industrial_complex_construction_speed_factor_TT_1
				}
				if = {
					limit = {
						check_variable = {
							building_level@army_school > 1
						}
						NOT = {
							has_state_flag = army_school_1_TT
						}
					}
					set_state_flag = army_school_1_TT
				}
				if = {
					limit = {
						check_variable = {
							building_level@arms_factory > 4
						}
						NOT = {
							has_state_flag = arms_factory_4_TT
						}
					}
					set_state_flag = arms_factory_4_TT
				}
				if = {
					limit = {
						check_variable = {
							building_level@Academy_of_Sciences > 0
						}
						NOT = {
							has_state_flag = Academy_of_Sciences_0_TT
						}
					}
					set_state_flag = Academy_of_Sciences_0_TT
				}
				if = {
					limit = {
						naval_base > 4
						NOT = {
							has_state_flag = naval_base_4_TT
						}
					}
					set_state_flag = naval_base_4_TT
				}
				if = {
					limit = {
						check_variable = {
							building_level@air_base > 4
						}
						NOT = {
							has_state_flag = air_base_4_TT
						}
					}
					set_state_flag = air_base_4_TT
				}
			}
			every_country = {
				limit = {
					is_major = yes
				}
				capital_scope = {
					add_building_construction = {
						type = Academy_of_Sciences
						level = 2
					}
				}
				random_controlled_state = {
					limit = {
						is_core_of = PREV
						Academy_of_Sciences = 0
					}
					add_building_construction = {
						type = Academy_of_Sciences
						level = 1
					}
				}
				if = {
					limit = { 
						OR = {
							TAG = USA
							TAG = GER
							TAG = ENG
						}
					}
					random_controlled_state = {
						limit = {
							is_core_of = PREV
							Academy_of_Sciences = 0
						}
						add_building_construction = {
							type = Academy_of_Sciences
							level = 1
						}
					}
				}
			}
		}
	}
	on_daily = {
		effect = {
			ROOT = {
				if = {
					limit = {
						NOT = {
							has_tech = synthetic_refinery_num
						}
					}
					country_event = { id = ex_limit_sa_mod.4 }
				}
				if = {
					limit = {
						NOT = {
							has_dynamic_modifier = {
								modifier = Academy_of_Sciences
							}
						}
					}
					country_event = { id = ex_limit_sa_mod.5 }
				}
			}
		}
	}
	on_weekly = {
		effect = {
			# ===== 征兵精神同步：原版法案 → GC 精神（双向） =====
			if = {
				limit = {
					has_idea = disarmed_nation
					NOT = { has_idea = gc_conscription_none }
				}
				add_ideas = gc_conscription_none
			}
			if = {
				limit = {
					has_idea = gc_conscription_none
					NOT = { has_idea = disarmed_nation }
				}
				remove_ideas = gc_conscription_none
			}
			if = {
				limit = {
					has_idea = volunteer_only
					NOT = { has_idea = gc_conscription_volunteer }
				}
				add_ideas = gc_conscription_volunteer
			}
			if = {
				limit = {
					has_idea = gc_conscription_volunteer
					NOT = { has_idea = volunteer_only }
				}
				remove_ideas = gc_conscription_volunteer
			}
			if = {
				limit = {
					has_idea = limited_conscription
					NOT = { has_idea = gc_conscription_limited }
				}
				add_ideas = gc_conscription_limited
			}
			if = {
				limit = {
					has_idea = gc_conscription_limited
					NOT = { has_idea = limited_conscription }
				}
				remove_ideas = gc_conscription_limited
			}
			if = {
				limit = {
					has_idea = extensive_conscription
					NOT = { has_idea = gc_conscription_extensive }
				}
				add_ideas = gc_conscription_extensive
			}
			if = {
				limit = {
					has_idea = gc_conscription_extensive
					NOT = { has_idea = extensive_conscription }
				}
				remove_ideas = gc_conscription_extensive
			}
			if = {
				limit = {
					has_idea = service_by_requirement
					NOT = { has_idea = gc_conscription_service_by_requirement }
				}
				add_ideas = gc_conscription_service_by_requirement
			}
			if = {
				limit = {
					has_idea = gc_conscription_service_by_requirement
					NOT = { has_idea = service_by_requirement }
				}
				remove_ideas = gc_conscription_service_by_requirement
			}
			if = {
				limit = {
					has_idea = all_adults_serve
					NOT = { has_idea = gc_conscription_total_mobilization }
				}
				add_ideas = gc_conscription_total_mobilization
			}
			if = {
				limit = {
					has_idea = gc_conscription_total_mobilization
					NOT = { has_idea = all_adults_serve }
				}
				remove_ideas = gc_conscription_total_mobilization
			}
			if = {
				limit = {
					has_idea = scraping_the_barrel
					NOT = { has_idea = gc_conscription_scraping }
				}
				add_ideas = gc_conscription_scraping
			}
			if = {
				limit = {
					has_idea = gc_conscription_scraping
					NOT = { has_idea = scraping_the_barrel }
				}
				remove_ideas = gc_conscription_scraping
			}
			# ===== 原有逻辑继续 =====
			every_owned_state = {
				if = {
					limit = { 
						is_in_array = {
							array = ROOT.regional_development_state_gc
							value = THIS
						}
						NOT = { has_dynamic_modifier = {modifier = gc_dym_1_state} }
					}
					increase_state_category = yes
					remove_from_array = {
						array = ROOT.regional_development_state_gc
						value = THIS
					}
				}
			}
			every_owned_state = {
				if = {
					limit = {
						any_province_building_level = {
							province = {
								all_provinces = yes
							}
							building = naval_base
							level > 4
						}
						NOT = {
							has_state_flag = industrial_complex_construction_speed_factor_TT_1
						}
					}
					set_state_flag = industrial_complex_construction_speed_factor_TT_1
				}
				if = {
					limit = {
						check_variable = {
							building_level@army_school > 1
						}
						NOT = {
							has_state_flag = army_school_1_TT
						}
					}
					set_state_flag = army_school_1_TT
				}
				if = {
					limit = {
						check_variable = {
							building_level@arms_factory > 4
						}
						NOT = {
							has_state_flag = arms_factory_4_TT
						}
					}
					set_state_flag = arms_factory_4_TT
				}
				if = {
					limit = {
						check_variable = {
							building_level@Academy_of_Sciences > 0
						}
						NOT = {
							has_state_flag = Academy_of_Sciences_0_TT
						}
					}
					set_state_flag = Academy_of_Sciences_0_TT
				}
				if = {
					limit = {
						naval_base > 4
						NOT = {
							has_state_flag = naval_base_4_TT
						}
					}
					set_state_flag = naval_base_4_TT
				}
				if = {
					limit = {
						check_variable = {
							building_level@air_base > 4
						}
						NOT = {
							has_state_flag = air_base_4_TT
						}
					}
					set_state_flag = air_base_4_TT
				}
			}
			
			clear_variable = ROOT.gc_dym_1_country^1
			clear_variable = ROOT.gc_dym_1_country^2

					every_owned_state = {
						add_to_variable = {
							ROOT.gc_dym_1_country^1 = THIS.modifier@factories_used_by_regional_development_gc
						}
						add_to_variable = {
							ROOT.gc_dym_1_country^2 = THIS.modifier@steel_for_regional_development_gc
						}
					}
					if = {
						limit = { 
							NOT = {
								has_dynamic_modifier = {
									modifier = gc_dym_1_country
								}
							}
						}
						add_dynamic_modifier = {
							modifier = gc_dym_1_country
						}
					}
		}
	}
	on_state_control_changed = {
		effect = {
			FROM.FROM = {
				if = {
					limit = { 
						has_dynamic_modifier = {
							modifier = gc_dym_1_country
						}
					}
					remove_dynamic_modifier = {
					modifier = gc_dym_1_state
				}
				if = {
					limit = { 
						is_in_array = {
							array = FROM.regional_development_state_gc
							value = THIS
						}
					}
					remove_from_array = {
						array = FROM.regional_development_state_gc
						value = THIS
					}
				}
				}
			}
		}
	}
	on_weekly = {
		effect = {
				if = {
					limit = {
						has_tech = infantry_weapons
						prc_simple_arsenal >0
					}
					THIS = {
						add_equipment_to_stockpile = {
							type = infantry_equipment
							amount = modifier@prc_simple_arsenal_gun_gc
						}
					}
				}
				if = {
					limit = { 
						has_tech = tech_support 
						prc_simple_arsenal >0
					}
					THIS = {
						add_equipment_to_stockpile = {
							type = support_equipment
							amount = modifier@prc_simple_arsenal_support_equipment_gc
						}
					}
				}
				if = {
					limit = { 
						has_tech = gw_artillery
						prc_simple_arsenal >0
					}
					THIS = {
						add_equipment_to_stockpile = {
							type = artillery_equipment
							amount = modifier@prc_simple_arsenal_artillery_gc
						}
					}
				}
				if = {
					limit = { 
						check_variable = {
							modifier@research_points_gc > 0
						}
					}
					meta_effect = {
						text = {
							random_list = {
								1 = {
									add_breakthrough_progress = {
										specialization = specialization_land
										value = [research_points_gc_v]
									}
								}
								1 = {
									add_breakthrough_progress = {
										specialization = specialization_naval
										value = [research_points_gc_v]
									}
								}
								1 = {
									add_breakthrough_progress = {
										specialization = specialization_nuclear
										value = [research_points_gc_v]
									}
								}
								1 = {
									add_breakthrough_progress = {
										specialization = specialization_air
										value = [research_points_gc_v]
									}
								}
							}
						}
						research_points_gc_v = "[?modifier@research_points_gc]"
					}
				}
		}
	}
	on_monthly = {
		effect = {
			# 清空上月统计
			clear_variable = ROOT.gc_draft_total
			clear_variable = ROOT.gc_draft_deserted
			clear_variable = ROOT.gc_draft_gained
			clear_variable = ROOT.gc_draft_states
			# 首先检查国家是否有非零的征兵效率系数（有对应的征兵法案）
			if = {
				limit = {
					check_variable = { modifier@conscription_quota_factor_gc > 0 }
				}
				# 遍历所有拥有征兵中心的州
				every_controlled_state = {
					limit = {
						Conscription_Center_gc > 0
					}
					# 读取 modifier 值
					set_temp_variable = { draft_base = THIS.modifier@conscription_quota_gc }
					set_temp_variable = { draft_factor = PREV.modifier@conscription_quota_factor_gc }
					set_temp_variable = { draft_desert = PREV.modifier@conscription_desertion_gc }
					set_temp_variable = { draft_drafted = draft_base }
					multiply_temp_variable = { draft_drafted = draft_factor }
					# 从省份扣除人力
					set_temp_variable = { draft_negative = draft_drafted }
					multiply_temp_variable = { draft_negative = -1 }
					add_manpower = draft_negative
					# 计算逃亡数
					set_temp_variable = { desert = draft_drafted }
					multiply_temp_variable = { desert = draft_desert }
					# 实际获得人力 = drafted - deserted
					set_temp_variable = { gained = draft_drafted }
					subtract_from_temp_variable = { gained = desert }
					PREV = { add_manpower = gained }
					# 累加月度统计
					add_to_variable = { ROOT.gc_draft_total = draft_drafted }
					add_to_variable = { ROOT.gc_draft_deserted = desert }
					add_to_variable = { ROOT.gc_draft_gained = gained }
					add_to_variable = { ROOT.gc_draft_states = 1 }
				}
			}
			# 如果有任何征兵活动且玩家未关闭报告，触发月度事件
			if = {
				limit = {
					check_variable = { ROOT.gc_draft_total > 0 }
					is_ai = no
					NOT = {
						has_country_flag = gc_hide_draft_report
					}
				}
				country_event = { id = gc_draft_report.10 }
			}
		}
	}
}