Skip to content

Commit

Permalink
* Prep files for new troll attacks pt2
Browse files Browse the repository at this point in the history
  • Loading branch information
khamukkamu committed Oct 2, 2018
1 parent 62ea747 commit 696aed9
Show file tree
Hide file tree
Showing 20 changed files with 953 additions and 751 deletions.
2 changes: 0 additions & 2 deletions ModuleSystem/conflicting_mno.log

This file was deleted.

6 changes: 5 additions & 1 deletion ModuleSystem/module_constants.py
Expand Up @@ -2694,4 +2694,8 @@ def sq(distance):
ENCOUNTER_EFFECT_MORALE_BUFF = 10
ENCOUNTER_EFFECT_MORALE_DEBUFF = 10

slot_party_scripted_ai = 309
slot_party_scripted_ai = 309


slot_troll_agent_charging = 50
slot_troll_agent_last_charge = 51
13 changes: 13 additions & 0 deletions ModuleSystem/module_game_menus.py
Expand Up @@ -917,6 +917,17 @@
(set_visitors, 1, "trp_gondor_veteran_spearmen", 8),
(set_visitors, 16, "trp_troll_of_moria", 1),
(str_store_string, s16, "@TEST: troll VS infantry"),
(else_try),
(eq, "$g_custom_battle_scenario", 17),
(assign, "$g_custom_battle_scene", "scn_minas_tirith_center"),
(assign, "$g_player_troop", "trp_gondor_veteran_swordsmen"),
(set_player_troop, "$g_player_troop"),
(modify_visitors_at_site, "$g_custom_battle_scene"),
(set_visitor, 0, "$g_player_troop"),
(set_visitors, 1, "trp_gondor_militiamen", 20),
(set_visitors, 1, "trp_archer_of_gondor", 10),
(set_visitors, 16, "trp_olog_hai", 1),
(str_store_string, s16, "@TEST: troll VS Weak infantry"),
(else_try),
# TROLL TEST
(eq, "$g_custom_battle_scenario", 11),
Expand Down Expand Up @@ -1291,6 +1302,8 @@
]+concatenate_scripts([[
("troll_battle_scenario_10",[]," Test: Troll VS Infantry",
[(assign, "$g_custom_battle_scenario", 10),(jump_to_menu, "mnu_custom_battle_2"),]),
("troll_battle_scenario_17",[]," Test: Troll VS Weak Infantry",
[(assign, "$g_custom_battle_scenario", 17),(jump_to_menu, "mnu_custom_battle_2"),]),
("troll_battle_scenario_11",[]," Test: Troll VS Archers",
[(assign, "$g_custom_battle_scenario", 11),(jump_to_menu, "mnu_custom_battle_2"),]),
("troll_battle_scenario_12",[]," Test: Troll VS Cavalry",
Expand Down
3 changes: 2 additions & 1 deletion ModuleSystem/module_mission_templates.py
Expand Up @@ -926,6 +926,7 @@
] or [])



tld_common_battle_scripts = ((is_a_wb_mt==1) and [

### WB only triggers
Expand All @@ -952,7 +953,7 @@
#tld_wargs_attack_horses, # WIP (CppCoder)
tld_slow_wounded,
custom_tld_spawn_troop, custom_tld_init_battle,
custom_tld_horses_hate_trolls, custom_troll_hitting,
custom_tld_horses_hate_trolls, #custom_troll_hitting,
tld_cheer_on_space_when_battle_over_press, tld_cheer_on_space_when_battle_over_release,
nazgul_sweeps,
custom_warg_sounds, custom_lone_wargs_are_aggressive, #custom_lone_wargs_special_attack, # WIP, needs more work (mtarini); Improved, but still WIP. (CppCoder)
Expand Down
151 changes: 149 additions & 2 deletions ModuleSystem/module_mission_templates_TLD.py
Expand Up @@ -2198,8 +2198,8 @@
(agent_get_troop_id, ":troop_id", ":dealer"),
(troop_get_type, ":type", ":troop_id"),
(eq, ":type", tf_troll),
#(store_random_in_range, ":rand", 0, 3),
#(eq, ":rand", 0), # 1/3 chance of dealing AOE
(store_random_in_range, ":rand", 0, 3),
(eq, ":rand", 0), # 1/3 chance of dealing AOE

],[

Expand Down Expand Up @@ -2280,6 +2280,153 @@
(agent_stop_running_away, ":first_victim_horse"),
(try_end),
]),

(ti_on_agent_hit, 0, 0, [

# Trigger Param 1: receiver agent no
# Trigger Param 2: dealer agent no
# Trigger Param 3: inflicted damage
# Trigger Param 4: raw damage (before being soaked by armor)
# Trigger Param 5: hit bone
# Trigger Param 6: item kind no
# Trigger Param 7: item modifier
# Trigger Param 8: missile item kind no
# Trigger Param 9: missile item modifier
# Trigger Param 10: damage type
# Position Register 0: position of the blow
# rotation gives the direction of the blow
# Trigger Result: if set, damage dealt to agent

(store_trigger_param_1, ":receiver"),
(store_trigger_param_3, ":damage"),

(agent_is_active, ":receiver"),
(agent_is_alive, ":receiver"),
(gt, ":receiver", 0),
(agent_get_troop_id, ":troll", ":receiver"),
(troop_get_type, ":type", ":troll"),
(eq, ":type", tf_troll),

(gt, ":damage", 5),

],[

(store_trigger_param_1, ":receiver"),
(store_trigger_param_3, ":damage"),

(agent_is_active, ":receiver"),
(agent_is_alive, ":receiver"),

(gt, ":receiver", 0),
(agent_get_troop_id, ":troll", ":receiver"),
(troop_get_type, ":type", ":troll"),
(eq, ":type", tf_troll),
(gt, ":damage", 5),

(agent_get_slot, ":last_charge", ":receiver", slot_troll_agent_last_charge),
(store_mission_timer_a, ":time"),
(try_begin),
(eq, ":last_charge", 0),
(assign, ":cooldown", 0),
(else_try),
(assign, ":cooldown", 30),
(try_end),

(try_begin),
(agent_slot_eq, ":receiver", slot_troll_agent_charging, 0),
(val_add, ":last_charge", ":cooldown"),
(gt, ":time", ":last_charge"),
(agent_set_speed_modifier, ":receiver", 200),
(agent_set_slot, ":receiver", slot_troll_agent_charging, 1),
(store_mission_timer_a, ":time"),
(agent_set_slot, ":receiver", slot_troll_agent_last_charge, ":time"),
(agent_set_animation, ":receiver", "anim_cheer", 1),
(display_message, "@Troll is Charging!"),
(agent_play_sound, ":receiver", "snd_troll_grunt_long"),
(else_try),
(agent_slot_eq, ":receiver", slot_troll_agent_charging, 1),
(set_trigger_result, 0),
(try_end),

]),

(5, 0, 0, [

(gt, "$trolls_in_battle"),
],[

(try_for_agents, ":troll"),
(agent_is_alive, ":troll"),
(agent_is_active, ":troll"),
(agent_is_human, ":troll"),
(gt, ":troll", 0),
(agent_get_troop_id,":troll_troop_id",":troll"), # is it a troll?
(troop_get_type, ":troll_type", ":troll_troop_id"),
(eq, ":troll_type", tf_troll),
(agent_slot_eq, ":troll", slot_troll_agent_charging, 1),
(agent_get_slot, ":time_last_charge", ":troll", slot_troll_agent_last_charge),
(store_mission_timer_a, ":time"),
(val_add, ":time_last_charge", 10),
(gt, ":time", ":time_last_charge"),
(agent_set_slot, ":troll", slot_troll_agent_charging, 0),
(agent_set_speed_modifier, ":troll", 30),
(assign, reg65, ":time"),
(assign, reg66, ":time_last_charge"),
(display_message, "@Charge turned off -- Time: {reg65}, Last Charge: {reg66}"),
(try_end),

]),

(0,0,0, [(gt, "$trolls_in_battle", 0)],[

(try_for_agents, ":troll"),
(agent_is_active, ":troll"),
(agent_is_alive, ":troll"),
(agent_is_human, ":troll"),
(gt, ":troll", 0),
(agent_get_troop_id, ":troll_troop_id", ":troll"),
(troop_get_type, ":troll_type", ":troll_troop_id"),
(eq, ":troll_type", tf_troll),
(agent_slot_eq, ":troll", slot_troll_agent_charging, 1),
(agent_get_position, pos19, ":troll"),

(set_fixed_point_multiplier, 100),

(try_for_agents, ":nearby_enemies", pos19, 100),
(agent_is_active, ":nearby_enemies"),
(agent_is_alive, ":nearby_enemies"),
(agent_is_human, ":nearby_enemies"),
(gt, ":nearby_enemies", 0),
(neq, ":nearby_enemies", ":troll"), #don't hit yourself

(agent_get_troop_id, ":victim_troop_id", ":nearby_enemies"),
(troop_get_type, ":victim_type", ":victim_troop_id"),
(agent_get_horse, ":victim_horse", ":nearby_enemies"),
(neq, ":victim_type", tf_troll), #no plowthrough for trolls

(store_random_in_range, ":flyback_anim", 0, 2),
# then, set animation
# human (non trolls, non horse) victims
(try_begin),
(eq, ":flyback_anim", 0),
# troll is in front of victim
(agent_set_animation, ":nearby_enemies", "anim_strike_fly_back_rise_from_left"), # send them flying back
(else_try),
(agent_set_animation, ":nearby_enemies", "anim_strike_fly_back_rise"), # send them flying back
(try_end),

(try_begin),
(gt, ":victim_horse", 1),
(agent_start_running_away, ":victim_horse"),
(agent_stop_running_away, ":victim_horse"),
(try_end),
(store_random_in_range,":random_timings",1,5),
(agent_set_animation_progress, ":nearby_enemies", ":random_timings"), # differentiate timings a bit
(try_end),
(try_end),

]),

] or [])


Expand Down
82 changes: 81 additions & 1 deletion ModuleSystem/module_mission_templates_TLD_wb.py
Expand Up @@ -3426,7 +3426,7 @@
],[

(set_rain, 1, 500),

]),

(ti_after_mission_start, 0, ti_once, [
Expand Down Expand Up @@ -3536,4 +3536,84 @@
]),


]

voice_commands = [(ti_on_order_issued,0,3, [

#(store_trigger_param_1, ":order_issued"),
(store_trigger_param_2, ":agent_id"),
(get_player_agent_no, ":player"),
(agent_is_alive, ":player"),
(eq, ":agent_id", ":player"),

],[

(store_trigger_param_1, ":order_issued"),
(store_trigger_param_2, ":agent_id"),
(get_player_agent_no, ":player"),
(agent_is_alive, ":player"),
(eq, ":agent_id", ":player"),

(assign, ":sound_to_play", 0), # You can put a default sound here just in case.

(try_begin),
(eq, ":order_issued", mordr_hold), #Hold Command
(assign, ":sound_to_play", "snd_thunder"), #add the sound you want here
(else_try),
(eq, ":order_issued", mordr_follow), #Follow Command
(assign, ":sound_to_play", "snd_thunder"),
(else_try),
(eq, ":order_issued", mordr_charge), #Charge Command
(assign, ":sound_to_play", "snd_thunder"),
(else_try),
(eq, ":order_issued", mordr_mount), #Mount Command
(assign, ":sound_to_play", "snd_thunder"),
(try_end),

(agent_play_sound, ":player", ":sound_to_play"),

]),

(0,0,3, [

(assign, ":continue", 0),
(assign, ":last_gk", gk_reverse_order_group),
(get_player_agent_no, ":player"),
(agent_is_alive, ":player"),
(try_for_range, ":game_key", gk_everyone_hear, ":last_gk"),
(game_key_clicked, ":game_key"),
(assign, ":continue", 1),
(assign, ":last_gk", 0), #loop breaker
(try_end),

(eq, ":continue", 1),

], [

(get_player_agent_no, ":player"),
(agent_is_alive, ":player"),

(assign, ":continue", 0),
(assign, ":last_gk", gk_reverse_order_group),

(try_for_range, ":game_key", gk_everyone_hear, ":last_gk"),
(game_key_clicked, ":game_key"),
(assign, ":continue", 1),
(assign, ":last_gk", 0), #loop breaker
(assign, ":game_key_clicked", ":game_key"),
(try_end),

(eq, ":continue", 1),

(assign, ":sound_to_play", 0), # You can put a default sound here just in case.

(try_begin),
(eq, ":game_key_clicked", gk_everyone_hear),
(assign, ":sound_to_play", "snd_thunder"),
(else_try),
(eq, ":game_key_clicked", gk_infantry_hear),
(assign, ":sound_to_play", "snd_thunder"),
(try_end),
(agent_play_sound, ":player", ":sound_to_play"),
])
]

0 comments on commit 696aed9

Please sign in to comment.