"ship_capture",0,
"You are able to capture one of the enemy's ships. It's a {s2} made of {s3} wood, {s5} the fight, the '{s1}' is in {s4} conditions. Do you want to add this ship to your fleet?",
"none",
[
(assign, ":blocking", 0),
(try_begin),
# Player only joined the battle?
(eq, "$g_joined_battle_to_help", 1),
(assign, ":blocking", 1),
(else_try),
# Player has room for another ship?
(store_skill_level, ":cur_sea_king_skill", "skl_sea_king", "trp_player"),
(val_mul, ":cur_sea_king_skill", 2), #new skill adjust
(val_min, ":cur_sea_king_skill", 7), #new skill adjust
(val_sub, ":cur_sea_king_skill", 1),
(store_add, ":slot", slot_party_1_ship_type, ":cur_sea_king_skill"),
(party_get_slot, ":ship_type", "p_main_party", ":slot"),
(neq, ":ship_type", 0),
(assign, ":blocking", 1),
(else_try),
# Player has luck?
(party_get_skill_level, ":player_party_looting", "p_main_party", "skl_looting"),
(store_add, ":chance", TWEAK_CHANCE_CAPTURING_SHIP, ":player_party_looting"), # 10% is basic chance (up to 20% with looting skill)
(try_begin),
(eq, "$easy_wage", 1),# VC-3003
(val_mul, ":chance", 140), #so up to 28%
(val_div, ":chance", 100),
(try_end),
(store_random_in_range, ":rand", 1, 101),
(gt, ":rand", ":chance"), # = no luck
(assign, ":blocking", 1),
(else_try),
# invalid ship type entry (for example caused by VC-3658)
(try_begin),
(eq, "$player_team_in_sea_battle", 0),
(assign, ":quest", "qst_team_1_ships"),
(else_try),
(assign, ":quest", "qst_team_0_ships"),
(end_try),
(quest_get_slot, ":ship_type", ":quest", slot_quest_1_ship_type),
(this_or_next|lt, ":ship_type", ship_type_busse),
(gt, ":ship_type", ship_type_byrding),
(assign, ":blocking", 1),
(end_try),
(try_begin),
(neq, ":blocking", 0), # = no ship capture
(jump_to_menu, "mnu_total_victory"),
(else_try),
# all is ok:
(try_begin),
(eq, "$player_team_in_sea_battle", 0),
(assign, ":quest", "qst_team_1_ships"),
(else_try),
(assign, ":quest", "qst_team_0_ships"),
(end_try),
(quest_get_slot, "$ship_menu_current_ship_type", ":quest", slot_quest_1_ship_type),
(store_random_in_range, "$ship_menu_current_ship_name", "str_ship_name_1", "str_ship_names_end"),
(store_random_in_range, "$ship_menu_current_ship_quality", TWEAK_CAPTURED_SHIP_CONDITION_MIN, TWEAK_CAPTURED_SHIP_CONDITION_MAX),
(quest_get_slot, "$ship_menu_current_ship_propertys", ":quest", slot_quest_1_ship_prop),
(set_background_mesh,"mesh_pic_extra_viejo"),
(str_store_string, s1, "$ship_menu_current_ship_name"),
(call_script, "script_get_ship_properties", "$ship_menu_current_ship_type"),
(str_store_string, s2, reg7), #type_name
(call_script, "script_decode_value", "$ship_menu_current_ship_propertys"),
(assign, ":ship_wood", reg1),
(try_begin),
(eq, ":ship_wood", 1),
(str_store_string, s3, "@oak"),
(else_try),
(eq, ":ship_wood", 2),
(str_store_string, s3, "@pine"),
(else_try),
(str_store_string, s3, "@ash"),
(end_try),
(try_begin),
(gt, "$ship_menu_current_ship_quality", 80),
(str_store_string, s4, "@very good"),
(str_store_string, s5, "@and despite"),
(else_try),
(gt, "$ship_menu_current_ship_quality", 60),
(str_store_string, s4, "@good"),
(str_store_string, s5, "@and despite"),
(else_try),
(gt, "$ship_menu_current_ship_quality", 40),
(str_store_string, s4, "@acceptable"),
(str_store_string, s5, "@and despite"),
(else_try),
(gt, "$ship_menu_current_ship_quality", 20),
(str_store_string, s4, "@bad"),
(str_store_string, s5, "@but due to"),
(else_try),
(gt, "$ship_menu_current_ship_quality", 5),
(str_store_string, s4, "@very bad"),
(str_store_string, s5, "@but due to"),
(else_try),
(str_store_string, s4, "@dangerous"),
(str_store_string, s5, "@but due to"),
(end_try),
(end_try),
],