# First policy below is the default if no other selected

maximize_profit = {
	can_select = {
		FROM = {
			has_trader = ROOT
		}
	}

	trade_power = {
		duration = -1
		 power_modifier = 0.5
		key = maximize_profits
	}
	
	center_of_reformation = no
	button_gfx = GFX_Trading_Policy_Max_Profit
}

hostile_trading = {
	can_select = {
		FROM = {
			has_trader = ROOT
		}
	}

	# Also applied versus countries with the node as their home node
	countries_with_merchant_modifier = {
		spy_offence = 2.5
	}
	
	button_gfx = GFX_Trading_Policy_Hostile_Trading
}

improve_inland_routes = {
	can_select = {
		FROM = {			
			has_trader = ROOT
		}
		if = {
			limit = { NOT = { has_government_attribute = free_improve_inland_routes } }
			FROM = {
				trade_share = {
					country = ROOT
					share = 50
				}
			}
		}
	}

	can_maintain = {
		FROM = {			
			has_trader = ROOT
		}
		if = {
			limit = { NOT = { has_government_attribute = free_improve_inland_routes } }
			FROM = {
				trade_share = {
					country = ROOT
					share = 40
				}
			}
		}
	}
	
	node_province_modifier = {
		siege_ability = 1
		artillery_bonus_vs_fort = 10
	}	
	button_gfx = GFX_Trading_Policy_Improve_Routes
}

establish_communities = {
	can_select = {
		FROM = {
			has_trader = ROOT
		}
	}
	countries_with_merchant_modifier = {
		improve_relation_modifier = 1.5
	}
	
	button_gfx = GFX_Trading_Policy_Establish_Communities
}

propagate_religion = {
	unique = yes # Only one country can select this in a certain node.

	can_select = {
		OR = {
			religion_group = muslim
			AND = {
				religion_group = dharmic
				mission_completed = mnd_maj_porch_of_mecca
			}
			custom_trigger_tooltip = {
				tooltip = can_use_propagate_religion_tt
				has_country_flag = can_use_propagate_religion
				#OR = {
				#	has_country_flag = can_use_propagate_religion
				#	has_government_attribute = can_propogate_religion
				#}
			}
			custom_trigger_tooltip = {
				tooltip = can_spread_reformation_tt
				AND = {
					#has_government_attribute = can_spread_the_reformation
					has_reform = reformer_state_reform
					OR = {
						current_age = age_of_discovery
						current_age = age_of_reformation
					}
				}
			}
		}
		dominant_religion = ROOT
		if = {
			limit = { has_country_flag = 15_trade_power_for_propogate_religion }
			FROM = {
				has_trader = ROOT
				is_node_in_trade_company_region = yes
				trade_share = {
					country = ROOT
					share = 15
				}
			}
		}
		else_if = {
			limit = { mission_completed = atj_porch_of_mecca }
			FROM = {
				has_trader = ROOT
				is_node_in_trade_company_region = yes
				trade_share = {
					country = ROOT
					share = 35
				}
			}
		}
		else = {
			FROM = {
				has_trader = ROOT
				is_node_in_trade_company_region = yes
				trade_share = {
					country = ROOT
					share = 50
				}
			}
		}
	}

	can_maintain = {
		OR = {
			religion_group = muslim
			AND = {
				religion_group = dharmic
				mission_completed = mnd_maj_porch_of_mecca
			}
			custom_trigger_tooltip = {
				tooltip = can_use_propagate_religion_tt
				OR = {
					has_country_flag = can_use_propagate_religion
					has_government_attribute = can_propogate_religion
				}
			}
			custom_trigger_tooltip = {
				tooltip = can_spread_reformation_tt
				has_government_attribute = can_spread_the_reformation
				OR = {
					current_age = age_of_discovery
					current_age = age_of_reformation
				}
			}
		}
		dominant_religion = ROOT
		if = {
			limit = { has_country_flag = 15_trade_power_for_propogate_religion }
			FROM = {
				has_trader = ROOT
				is_node_in_trade_company_region = yes
				trade_share = {
					country = ROOT
					share = 5
				}
			}
		}
		else_if = {
			limit = { mission_completed = atj_porch_of_mecca }
			FROM = {
				has_trader = ROOT
				is_node_in_trade_company_region = yes
				trade_share = {
					country = ROOT
					share = 25
				}
			}
		}
		else = {
			FROM = {
				has_trader = ROOT
				is_node_in_trade_company_region = yes
				trade_share = {
					country = ROOT
					share = 40
				}
			}
		}
	}

	show_alert = yes
	center_of_reformation = yes
	button_gfx = GFX_Trading_Policy_Propagate_Religion
}