Skip to content

Commit

Permalink
*Fix to Scout camp quest again + Make fallen rider text an option
Browse files Browse the repository at this point in the history
- Make sure party_is_active for force_faction script
- Add TLD option menu allowing players to disable unseated rider text.
  • Loading branch information
khamukkamu committed Apr 21, 2017
1 parent 6fe9e97 commit 6cae37d
Show file tree
Hide file tree
Showing 27 changed files with 1,507 additions and 1,384 deletions.
579 changes: 290 additions & 289 deletions ModuleSystem/ID/ID_parties.py

Large diffs are not rendered by default.

39 changes: 30 additions & 9 deletions ModuleSystem/module_game_menus.py
Expand Up @@ -361,7 +361,10 @@
("resume_travelling" ,[],"Resume travelling." ,[(change_screen_return),]),
]
),
( "custom_battle_2",mnf_disable_all_keys,

###CUSTOMBATTLE2###

("custom_battle_2",mnf_disable_all_keys,
"^^^^^^{s16}",
"none",
[(assign, "$g_battle_result", 0),
Expand Down Expand Up @@ -3075,6 +3078,19 @@
(troop_set_slot, "trp_player", slot_troop_subfaction, subfac_pelargir),
(troop_add_item, "trp_player", "itm_gon_tab_shield_b"),
(display_message, "@Subfac Blackroot set, player given shield!")]),
("spawn_static_party",[], "Spawn Static Party Near Player", [
(party_relocate_near_party, "p_scout_party", "p_main_party", 5),
(display_message, "@Static Scou Party Spawned!")]),
("remove_static_party",[], "Clear Static Party Near Player", [
(party_clear, "p_scout_party"),
(display_message, "@Static Party Clear Attempted!")]),
("check_if_party_is_active",[], "Is Scout Party Active?", [
(try_begin),
(party_is_active, "p_scout_party"),
(display_message, "@Scout Party is ACTIVE!", color_good_news),
(else_try),
(display_message, "@Scout Party is NOT ACTIVE", color_bad_news),
(try_end)]),
("camp_khamtest_back",[],"Back",[(jump_to_menu, "mnu_camp")]),
]),

Expand Down Expand Up @@ -3126,6 +3142,11 @@
],"Animal ambushes: {s7}",[
(store_sub, "$tld_option_animal_ambushes", 1, "$tld_option_animal_ambushes"),(val_clamp, "$tld_option_animal_ambushes", 0, 2)]),

("game_options_horse_ko",[(try_begin),(eq,"$show_mount_ko_message",1),(str_store_string, s7, "@ON"),
(else_try),(str_store_string, s7, "@OFF"),(try_end),
],"Show fallen rider damage messages: {s7}",[
(store_sub, "$show_mount_ko_message", 1, "$show_mount_ko_message"),(val_clamp, "$show_mount_ko_message", 0, 2)]),

("game_options_tweaks",[],"Gameplay tweaks...",[(jump_to_menu, "mnu_camp_tweaks")]),

("game_options_back",[],"Back to camp menu.",[(jump_to_menu, "mnu_camp")]),
Expand Down Expand Up @@ -9183,12 +9204,12 @@
(modify_visitors_at_site, "scn_scout_camp_rohan_good_small"),
(assign, ":scout_camp_scene", "scn_scout_camp_rohan_good_small"),
(else_try),
(is_between, ":level", 17,23),
(gt, ":level", 17),
(faction_slot_eq, "$players_kingdom", slot_faction_side, faction_side_good),
(modify_visitors_at_site, "scn_scout_camp_rohan_evil_big"),
(assign, ":scout_camp_scene", "scn_scout_camp_rohan_evil_big"),
(else_try),
(is_between, ":level", 17,23),
(gt, ":level", 17),
(modify_visitors_at_site, "scn_scout_camp_rohan_good_big"),
(assign, ":scout_camp_scene", "scn_scout_camp_rohan_good_big"),
(try_end),
Expand All @@ -9209,12 +9230,12 @@
(modify_visitors_at_site, "scn_scout_camp_gondor_good_small"),
(assign, ":scout_camp_scene", "scn_scout_camp_gondor_good_small"),
(else_try),
(is_between, ":level", 17,23),
(gt, ":level", 17),
(faction_slot_eq, "$players_kingdom", slot_faction_side, faction_side_good),
(modify_visitors_at_site, "scn_scout_camp_gondor_evil_big"),
(assign, ":scout_camp_scene", "scn_scout_camp_gondor_evil_big"),
(else_try),
(is_between, ":level", 17,23),
(gt, ":level", 17),
(modify_visitors_at_site, "scn_scout_camp_gondor_good_big"),
(assign, ":scout_camp_scene", "scn_scout_camp_gondor_good_big"),
(try_end),
Expand All @@ -9236,12 +9257,12 @@
(modify_visitors_at_site, "scn_scout_camp_mirk_good_small"),
(assign, ":scout_camp_scene", "scn_scout_camp_mirk_good_small"),
(else_try),
(is_between, ":level", 17,23),
(gt, ":level", 17),
(faction_slot_eq, "$players_kingdom", slot_faction_side, faction_side_good),
(modify_visitors_at_site, "scn_scout_camp_mirk_evil_big"),
(assign, ":scout_camp_scene", "scn_scout_camp_mirk_evil_big"),
(else_try),
(is_between, ":level", 17,23),
(gt, ":level", 17),
(modify_visitors_at_site, "scn_scout_camp_mirk_good_big"),
(assign, ":scout_camp_scene", "scn_scout_camp_mirk_good_big"),
(try_end),
Expand All @@ -9259,12 +9280,12 @@
(modify_visitors_at_site, "scn_scout_camp_north_good_small"),
(assign, ":scout_camp_scene", "scn_scout_camp_north_good_small"),
(else_try),
(is_between, ":level", 17,23),
(gt, ":level", 17),
(faction_slot_eq, "$players_kingdom", slot_faction_side, faction_side_good),
(modify_visitors_at_site, "scn_scout_camp_north_evil_big"),
(assign, ":scout_camp_scene", "scn_scout_camp_north_evil_big"),
(else_try),
(is_between, ":level", 17,23),
(gt, ":level", 17),
(modify_visitors_at_site, "scn_scout_camp_north_good_big"),
(assign, ":scout_camp_scene", "scn_scout_camp_north_good_big"),
(try_end),
Expand Down
1 change: 1 addition & 0 deletions ModuleSystem/module_mission_templates_TLD_wb.py
Expand Up @@ -887,6 +887,7 @@
(agent_get_team, ":team_victim", ":agent_rider"),
(assign, reg22, ":damage"),
(try_begin),
(eq, "$show_mount_ko_message",1),
(troop_get_class, ":class", ":troop_no"),
(this_or_next|troop_is_hero, ":troop_no"),
(eq, ":class", 2), # Cavalry
Expand Down
2 changes: 2 additions & 0 deletions ModuleSystem/module_parties.py
Expand Up @@ -273,6 +273,8 @@
("calenhad","Calenhad",icon_gondor_beacon |pf_is_static|pf_no_label|pf_disabled|pf_always_visible, no_menu, pt_none, fac_neutral ,0,ai_bhvr_hold,0,(-18.36, 10.32),[],170),
("amon_anwar","Amon_Anwar",icon_gondor_beacon|pf_is_static|pf_no_label|pf_disabled|pf_always_visible, no_menu, pt_none, fac_neutral ,0,ai_bhvr_hold,0,(-13.57, 6.69), [],170),

#Kham test
("scout_party","Scout_Party",icon_footman_gondor, no_menu, pt_gondor_scouts,fac_gondor,0,ai_bhvr_hold,0,(13.6,54.6),[(trp_squire_of_gondor,1,0)]),

# add extra towns before this point
("spawn_points_end","last_spawn_point",pf_disabled|pf_is_static, no_menu, pt_none, fac_commoners,0,ai_bhvr_hold,0,(-7.746731,1.880096),[(trp_looter,15,0)]),
Expand Down
84 changes: 81 additions & 3 deletions ModuleSystem/module_scripts.py
Expand Up @@ -1888,6 +1888,7 @@ def set_item_score():
(assign, "$player_allowed_siege",0), #Kham - Player Initiated Sieges
(assign, "$butcher_trait_kills", 0), #Kham - Butcher Trait
(assign, "$player_control_allies",0), #Kham - Player Control Allies global
(assign, "$show_mount_ko_message",1),#Kham - Show Horse KO Message - ON by default
#(try_for_range, ":beacon", "p_amon_din", "p_spawn_points_end"),
# (set_position_delta, -3.0,6.0,65.0),
# (party_add_particle_system, ":beacon", "psys_lamp_fire"),
Expand Down Expand Up @@ -21162,15 +21163,22 @@ def set_item_score():
(store_random_in_range, ":town", 0,4),
(try_begin),
(eq, ":town", 0),
(party_is_active, "p_town_edoras"),
(assign, reg0, "p_town_edoras"),
(else_try),
(eq, ":town", 1),
(party_is_active, "p_town_east_emnet"),
(assign, reg0, "p_town_east_emnet"),
(else_try),
(eq, ":town", 2),
(party_is_active, "p_town_eastfold"),
(assign, reg0, "p_town_eastfold"),
(else_try),
(eq, ":town",3),
(party_is_active, "p_town_eastfold"),
(assign, reg0, "p_town_west_emnet"),
(else_try),
(call_script, "script_cf_get_random_enemy_center_within_range", "p_main_party", tld_max_quest_distance),
(try_end),

## Gondor Region
Expand All @@ -21179,15 +21187,22 @@ def set_item_score():
(store_random_in_range, ":town", 0,4),
(try_begin),
(eq, ":town", 0),
(party_is_active, "p_town_minas_tirith"),
(assign, reg0, "p_town_minas_tirith"),
(else_try),
(eq, ":town", 1),
(party_is_active, "p_town_pelargir"),
(assign, reg0, "p_town_pelargir"),
(else_try),
(eq, ":town", 2),
(party_is_active, "p_town_linhir"),
(assign, reg0, "p_town_linhir"),
(else_try),
(eq, ":town", 2),
(party_is_active, "p_town_lossarnach"),
(assign, reg0, "p_town_lossarnach"),
(else_try),
(call_script, "script_cf_get_random_enemy_center_within_range", "p_main_party", tld_max_quest_distance),
(try_end),

## Center Region
Expand All @@ -21196,15 +21211,22 @@ def set_item_score():
(store_random_in_range, ":town", 0,4),
(try_begin),
(eq, ":town", 0),
(party_is_active, "p_town_caras_galadhon"),
(assign, reg0, "p_town_caras_galadhon"),
(else_try),
(eq, ":town", 1),
(party_is_active, "p_town_imladris_camp"),
(assign, reg0, "p_town_imladris_camp"),
(else_try),
(eq, ":town", 2),
(party_is_active, "p_town_beorn_house"),
(assign, reg0, "p_town_beorn_house"),
(else_try),
(eq, ":town", 3),
(party_is_active, "p_town_cerin_dolen"),
(assign, reg0, "p_town_cerin_dolen"),
(else_try),
(call_script, "script_cf_get_random_enemy_center_within_range", "p_main_party", tld_max_quest_distance),
(try_end),

## Mirkwood Region
Expand All @@ -21213,12 +21235,18 @@ def set_item_score():
(store_random_in_range, ":town", 0,3),
(try_begin),
(eq, ":town", 0),
(party_is_active, "p_town_thranduils_halls"),
(assign, reg0, "p_town_thranduils_halls"),
(else_try),
(eq, ":town", 1),
(party_is_active, "p_town_woodelf_camp"),
(assign, reg0, "p_town_woodelf_camp"),
(else_try),
(eq, ":town", 2),
(party_is_active, "p_town_woodelf_camp"),
(assign, reg0, "p_town_woodelf_west_camp"),
(else_try),
(call_script, "script_cf_get_random_enemy_center_within_range", "p_main_party", tld_max_quest_distance),
(try_end),

## North Region
Expand All @@ -21227,20 +21255,33 @@ def set_item_score():
(store_random_in_range, ":town", 0,4),
(try_begin),
(eq, ":town", 0),
(party_is_active, "p_town_dale"),
(assign, reg0, "p_town_dale"),
(else_try),
(eq, ":town", 1),
(party_is_active, "p_town_erebor"),
(assign, reg0, "p_town_erebor"),
(else_try),
(eq, ":town", 2),
(party_is_active, "p_town_woodelf_camp"),
(assign, reg0, "p_town_esgaroth"),
(else_try),
(eq, ":town", 3),
(party_is_active, "p_town_ironhill_camp"),
(assign, reg0, "p_town_ironhill_camp"),
(else_try),
(call_script, "script_cf_get_random_enemy_center_within_range", "p_main_party", tld_max_quest_distance),
(try_end),
(else_try),

## Everything else, target Gondor
(assign, reg0, "p_town_minas_tirith"),
(try_begin),
(party_is_active, "p_town_minas_tirith"),
(assign, reg0, "p_town_minas_tirith"),
(else_try),
(call_script, "script_cf_get_random_enemy_center_within_range", "p_main_party", tld_max_quest_distance),
(try_end),

(try_end),

## End Evil side
Expand All @@ -21254,15 +21295,22 @@ def set_item_score():
(store_random_in_range, ":town", 0,4),
(try_begin),
(eq, ":town", 0),
(party_is_active, "p_town_isengard"),
(assign, reg0, "p_town_isengard"),
(else_try),
(eq, ":town", 1),
(party_is_active, "p_town_dunland_camp"),
(assign, reg0, "p_town_dunland_camp"),
(else_try),
(eq, ":town", 2),
(party_is_active, "p_town_urukhai_outpost"),
(assign, reg0, "p_town_urukhai_outpost"),
(else_try),
(eq, ":town", 3),
(party_is_active, "p_town_urukhai_outpost"),
(assign, reg0, "p_town_urukhai_r_camp"),
(else_try),
(call_script, "script_cf_get_random_enemy_center_within_range", "p_main_party", tld_max_quest_distance),
(try_end),

## Mordor / Khand / Umbar
Expand All @@ -21271,12 +21319,18 @@ def set_item_score():
(store_random_in_range, ":town", 0,3),
(try_begin),
(eq, ":town", 0),
(party_is_active, "p_town_minas_morgul"),
(assign, reg0, "p_town_minas_morgul"),
(else_try),
(eq, ":town", 1),
(party_is_active, "p_town_umbar_camp"),
(assign, reg0, "p_town_umbar_camp"),
(else_try),
(eq, ":town", 2),
(party_is_active, "p_town_khand_camp"),
(assign, reg0, "p_town_khand_camp"),
(else_try),
(call_script, "script_cf_get_random_enemy_center_within_range", "p_main_party", tld_max_quest_distance),
(try_end),

## Center Region
Expand All @@ -21285,15 +21339,22 @@ def set_item_score():
(store_random_in_range, ":town", 0,4),
(try_begin),
(eq, ":town", 0),
(party_is_active, "p_town_dol_guldur"),
(assign, reg0, "p_town_dol_guldur"),
(else_try),
(eq, ":town", 1),
(party_is_active, "p_town_gundabad"),
(assign, reg0, "p_town_gundabad"),
(else_try),
(eq, ":town", 2),
(party_is_active, "p_town_moria"),
(assign, reg0, "p_town_moria"),
(else_try),
(eq, ":town", 3),
(party_is_active, "p_town_moria"),
(assign, reg0, "p_town_goblin_south_outpost"),
(else_try),
(call_script, "script_cf_get_random_enemy_center_within_range", "p_main_party", tld_max_quest_distance),
(try_end),

## Mirkwood Region
Expand All @@ -21302,12 +21363,18 @@ def set_item_score():
(store_random_in_range, ":town", 0,3),
(try_begin),
(eq, ":town", 0),
(party_is_active, "p_town_gundabad_m_outpost"),
(assign, reg0, "p_town_gundabad_m_outpost"),
(else_try),
(eq, ":town", 1),
(party_is_active, "p_town_dol_guldur"),
(assign, reg0, "p_town_dol_guldur"),
(else_try),
(eq, ":town", 2),
(party_is_active, "p_town_rhun_south_camp"),
(assign, reg0, "p_town_rhun_south_camp"),
(else_try),
(call_script, "script_cf_get_random_enemy_center_within_range", "p_main_party", tld_max_quest_distance),
(try_end),

## North
Expand All @@ -21316,27 +21383,38 @@ def set_item_score():
(store_random_in_range, ":town", 0,4),
(try_begin),
(eq, ":town", 0),
(party_is_active, "p_town_morannon"),
(assign, reg0, "p_town_morannon"),
(else_try),
(eq, ":town", 1),
(party_is_active, "p_town_rhun_main_camp"),
(assign, reg0, "p_town_rhun_main_camp"),
(else_try),
(eq, ":town", 2),
(party_is_active, "p_town_goblin_north_outpost"),
(assign, reg0, "p_town_goblin_north_outpost"),
(else_try),
(eq, ":town", 3),
(party_is_active, "p_town_rhun_north_camp"),
(assign, reg0, "p_town_rhun_north_camp"),
(else_try),
(call_script, "script_cf_get_random_enemy_center_within_range", "p_main_party", tld_max_quest_distance),
(try_end),

## Everything else, target Mordor
(else_try),
(assign, reg0, "p_town_morannon"),
(try_begin),
(party_is_active, "p_town_morannon"),
(assign, reg0, "p_town_morannon"),
(else_try),
(call_script, "script_cf_get_random_enemy_center_within_range", "p_main_party", tld_max_quest_distance),
(try_end),
(try_end),
## End Good Side Targets
(try_end), #end Script
]),




]

Expand Down
2 changes: 2 additions & 0 deletions ModuleSystem/module_scripts_ai.py
Expand Up @@ -36,6 +36,7 @@
(troop_slot_eq, ":cur_troop", slot_troop_occupation, slto_kingdom_hero),
(troop_get_slot, ":cur_party", ":cur_troop", slot_troop_leaded_party),
(ge, ":cur_party", 0),
(party_is_active, ":cur_party"), #Kham - fix
(call_script, "script_party_calculate_strength", ":cur_party", 0), #will update slot_party_cached_strength for hero parties
(try_end),
(call_script, "script_party_calculate_strength", "p_main_party", 0), #will update slot_party_cached_strength for player party
Expand Down Expand Up @@ -104,6 +105,7 @@
(gt, ":faction_marshall", 0),
(troop_get_slot, ":faction_marshall_party", ":faction_marshall", slot_troop_leaded_party),
(gt, ":faction_marshall_party", 0),
(party_is_active, ":faction_marshall_party"),
(party_get_slot, ":faction_marshall_army_strength", ":faction_marshall_party", slot_party_cached_strength),
(party_get_slot, ":follower_strength", ":faction_marshall_party", slot_party_follower_strength),
(val_add, ":faction_marshall_army_strength", ":follower_strength"),
Expand Down
1 change: 1 addition & 0 deletions ModuleSystem/variables.txt
Expand Up @@ -678,3 +678,4 @@ player_control_allies
num_routed_us
num_routed_allies
num_routed_enemies
show_mount_ko_message

0 comments on commit 6cae37d

Please sign in to comment.