﻿prison_screen_exclude_PoW = {
	scope = character
	
	is_shown = {
		NOT = { is_in_prison_type = prisoner_of_war }
	}
}

prison_screen_PoW = {
	scope = character
	
	is_shown = {
		is_in_prison_type = prisoner_of_war
	}
}

# PoW_army_disband = {
# 	scope = army

# 	effect = {
# 		if = {
# 			limit = { exists = var:story_PoW }
# 			debug_log = "dbg_log PoW transfer to dungeon triggered on_disband"
# 			debug_log_scopes = no
# 			# Transfer PoWs to dungeon
# 			# TODO handle dungeon vs house arrest depending on has_character_flag = distinguished_PoW
# 			var:story_PoW = {
# 				every_in_list = {
# 					if = {
# 						limit = { is_imprisoned = no }
# 						debug_log = "PoW not imprisoned"
# 					}
# 					variable = story_PoW_list
# 					debug_log_scopes = no
# 					change_prison_type = dungeon
# 					remove_variable = story_PoW
# 				}
# 				end_story = yes
# 			}
# 			remove_variable = story_PoW
# 		}
# 	}
# }

# PoW_army_merge = {
# 	scope = army

# 	effect = {
# 		debug_log = "PoW armies merged"
# 		army_owner = { debug_log_scopes = no }
# 		debug_log_scopes = no
# 		location = { debug_log_scopes = no }

# 		save_temporary_scope_as = PoW_army
# 		location = { save_temporary_scope_as = army_location }
	
# 		army_owner = {
# 			if = {
# 				limit = {
# 					any_owned_story = {
# 						story_type = story_PoW
# 						var:story_location = scope:army_location
# 						NOT = { var:story_army = scope:PoW_army }
# 					}
# 				}
# 				debug_log = "found other story in location"
# 				if = {
# 					limit = { exists = scope:PoW_army.var:story_PoW }
# 					scope:PoW_army.var:story_PoW = { save_temporary_scope_as = new_story }
# 				}
# 				else = {
# 					set_variable = {
# 						name = PoW_army
# 						value = scope:PoW_army
# 					}
# 					create_story = {
# 						type = story_PoW
# 						save_temporary_scope_as = new_story
# 					}
# 					scope:PoW_army = {
# 						debug_log = "PoW new army"
# 						debug_log_scopes = no
# 						set_variable = {
# 							name = story_PoW
# 							value = scope:new_story
# 						}
# 					}
# 				}
# 				every_owned_story = {
# 					limit = {
# 						is_story_PoW_in_location = { LOCATION = scope:army_location }
# 						NOT = { var:story_army = scope:PoW_army }
# 					}
# 					debug_log = "story merged"
# 					var:story_army = { debug_log_scopes = no }
# 					PoW_transfer_to_story_same_character_effect = {
# 						OLD_STORY = THIS
# 						NEW_STORY = scope:new_story
# 					}				
# 				}
# 			}
# 			else = { debug_log = "NO story found"}
# 		}
# 	}
# }