# First policy below is the default if no other selected

maximize_profit = {
	potential = {
		NOT = { has_country_flag = disabled_trading_policy_maximize_profit }
	}
	can_select = {
		custom_trigger_tooltip = {
			tooltip = has_unlocked_trading_policy_maximize_profit_tt
			NOT = { has_country_flag = locked_trading_policy_maximize_profit }
		}
		FROM = {
			has_trader = ROOT
		}
	}

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

maximize_profit_upgraded = {
	potential = {
		NOT = { has_country_flag = disabled_trading_policy_maximize_profit_upgraded }
		has_country_flag = enabled_trading_policy_maximize_profit_upgraded
	}
	can_select = {
		custom_trigger_tooltip = {
			tooltip = has_unlocked_trading_policy_maximize_profit_upgraded_tt
			NOT = { has_country_flag = locked_trading_policy_maximize_profit_upgraded }
		}
		FROM = {
			has_trader = ROOT
		}
	}

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

hostile_trading = {
	potential = {
		NOT = { has_country_flag = disabled_trading_policy_hostile_trading }
	}
	can_select = {
		custom_trigger_tooltip = {
			tooltip = has_unlocked_trading_policy_hostile_trading_tt
			NOT = { has_country_flag = locked_trading_policy_hostile_trading }
		}
		FROM = {
			has_trader = ROOT
		}
	}

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

hostile_trading_upgraded = {
	potential = {
		NOT = { has_country_flag = disabled_trading_policy_hostile_trading_upgraded }
		has_country_flag = enabled_trading_policy_hostile_trading_upgraded
	}
	can_select = {
		custom_trigger_tooltip = {
			tooltip = has_unlocked_trading_policy_hostile_trading_upgraded_tt
			NOT = { has_country_flag = locked_trading_policy_hostile_trading_upgraded }
		}
		FROM = {
			has_trader = ROOT
		}
	}

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

improve_inland_routes = {
	potential = {
		NOT = { has_country_flag = disabled_trading_policy_improve_inland_routes }
	}
	can_select = {
		custom_trigger_tooltip = {
			tooltip = has_unlocked_trading_policy_improve_inland_routes_tt
			NOT = { has_country_flag = locked_trading_policy_improve_inland_routes }
		}
		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 = 0.10
		siege_blockade_progress = 1
		artillery_levels_available_vs_fort = 1
	}	
	button_gfx = GFX_Trading_Policy_Improve_Routes
	cooldown = no
}

improve_inland_routes_upgraded = {
	potential = {
		NOT = { has_country_flag = disabled_trading_policy_improve_inland_routes_upgraded }
		has_country_flag = enabled_trading_policy_improve_inland_routes_upgraded
	}
	can_select = {
		custom_trigger_tooltip = {
			tooltip = has_unlocked_trading_policy_improve_inland_routes_upgraded_tt
			NOT = { has_country_flag = locked_trading_policy_improve_inland_routes_upgraded }
		}
		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 = 0.25
		siege_blockade_progress = 1
		artillery_levels_available_vs_fort = 1
	}	
	button_gfx = GFX_Trading_Policy_Improve_Routes
	cooldown = no
}
establish_communities = {
	potential = {
		 NOT = {
			OR = { 
				has_country_flag = disabled_trading_policy_establish_communities
				has_country_flag = enabled_trading_policy_establish_communities_upgraded
			}
		}
	}
	can_select = {
		custom_trigger_tooltip = {
			tooltip = has_unlocked_trading_policy_establish_communities_tt
			NOT = { has_country_flag = locked_trading_policy_establish_communities }
		}
		FROM = {
			has_trader = ROOT
		}
	}
	countries_with_merchant_modifier = {
		improve_relation_modifier = 0.15
	}
	
	button_gfx = GFX_Trading_Policy_Establish_Communities
	cooldown = no
}

establish_communities_upgraded = {
	potential = {
		NOT = { has_country_flag = disabled_trading_policy_establish_communities_upgraded }
		has_country_flag = enabled_trading_policy_establish_communities_upgraded
	}
	can_select = {
		custom_trigger_tooltip = {
			tooltip = has_unlocked_trading_policy_establish_communities_upgraded_tt
			NOT = { has_country_flag = locked_trading_policy_establish_communities_upgraded }
		}
		FROM = {
			has_trader = ROOT
		}
	}
	countries_with_merchant_modifier = {
		improve_relation_modifier = 0.25
	}
	
	button_gfx = GFX_Trading_Policy_Establish_Communities
	cooldown = no
}

propagate_religion = {
	unique = yes															   

	can_select = {		
		dominant_religion = ROOT
		FROM = {
			has_trader = ROOT
			is_node_in_trade_company_region = yes
			trade_share = {
				country = ROOT
				share = 50
			}
		}
	}

	can_maintain = {
		dominant_religion = ROOT
		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
	cooldown = no
}
