Skip to content

Commit

Permalink
*fixed warg leap attack, added warg leap attack to wargs (need perfor…
Browse files Browse the repository at this point in the history
…mance tests)
  • Loading branch information
khamukkamu committed Apr 15, 2018
1 parent 28e5771 commit 02d072f
Show file tree
Hide file tree
Showing 10 changed files with 496 additions and 328 deletions.
10 changes: 7 additions & 3 deletions ModuleSystem/module_animations_wb.py
Expand Up @@ -2291,9 +2291,13 @@
# [1.0, "wargLeapAttack", 0, 20, arf_blend_in_4|arf_use_walk_progress,pack4f(0.15,0.16,0.65,0.66), (0, 0, 0), 0.9]
# ],

["warg_leapattack", acf_enforce_all|acf_align_with_ground|acf_displace_position, amf_priority_rear|amf_play,
[1.2, "wargLeapAttack", 0, 20, arf_blend_in_4|arf_use_walk_progress,pack4f(0.15,0.16,0.65,0.66), (0, 0, 0), 0.9]
],
#["warg_leapattack", acf_enforce_all|acf_align_with_ground|acf_displace_position, amf_priority_rear|amf_play,
# [1.2, "wargLeapAttack", 0, 20, arf_blend_in_4|arf_use_walk_progress,pack4f(0.15,0.16,0.65,0.66), (0, 0, 0), 0.9]
# ],

["warg_leapattack", acf_enforce_lowerbody, amf_priority_jump|amf_play|amf_client_prediction,
[1.0, "anim_horse", 205, 222, arf_blend_in_4], #|arf_end_pos_0_25],
],

# Animal attack anims... (cppcoder, merlkir) - Fixed by Kham

Expand Down
14 changes: 13 additions & 1 deletion ModuleSystem/module_dialogs.py
Expand Up @@ -4414,7 +4414,19 @@
(assign, ":item", fac_reward_items_list[x][item_entry][1]),
(item_slot_eq, ":item", slot_item_given_as_reward, 0), # not already given
(assign, ":item_exists", 1),
(str_store_item_name, s20, ":item"),
(try_begin),
(this_or_next|eq, ":item", "itm_orc_brew"),
(eq, ":item", "itm_lembas"),
(str_store_item_name, s31, ":item"),
(str_store_string, s20, "@{s31} (Consumable. Can be rebought)"),
(else_try),
(this_or_next|eq, ":item", "itm_warg_reward"),
(eq, ":item", "itm_gondor_hunter"),
(str_store_item_name, s31, ":item"),
(str_store_string, s20, "@{s31} (Can be rebought)"),
(else_try),
(str_store_item_name, s20, ":item"),
(try_end),
(try_end),
] for item_entry in range(len(fac_reward_items_list[x]))
])+[
Expand Down
110 changes: 108 additions & 2 deletions ModuleSystem/module_mission_templates.py
Expand Up @@ -359,14 +359,14 @@
(try_for_agents, ":agent"),
(agent_is_alive, ":agent"),
(agent_is_human, ":agent"),
(call_script, "script_count_enemy_agents_around_agent", ":agent", 300),
(gt, reg0, 0),
(agent_get_troop_id, ":agent_trp", ":agent"),
(eq|this_or_next, ":agent_trp", "trp_spider"),
(eq|this_or_next, ":agent_trp", "trp_wolf"),
(eq, ":agent_trp", "trp_bear"),
(agent_get_horse, ":horse", ":agent"),
(ge, ":horse", 0),
(call_script, "script_count_enemy_agents_around_agent", ":agent", 300),
(gt, reg0, 0),
(store_random_in_range, ":rnd", 0, 100),

#Kham - Let's increase the likelihood of special attacks for the big guys, as charge attacks are not enough
Expand Down Expand Up @@ -495,6 +495,111 @@
(try_end),
])


tld_warg_leap_attack = (
1, 0, 0, [], [
(set_fixed_point_multiplier, 100),
(try_for_agents, ":agent"),
(agent_is_alive, ":agent"),
(agent_is_human, ":agent"),
(agent_get_troop_id, ":agent_trp", ":agent"),
(is_between, ":agent_trp", warg_ghost_begin, warg_ghost_end),
(agent_get_horse, ":warg", ":agent"),
(ge, ":warg", 0),
(call_script, "script_count_enemy_agents_around_agent", ":agent", 300),
(gt, reg0, 0),

(store_random_in_range, ":rnd", 0, 100),

(assign, ":chance", 55),

(lt, ":rnd", ":chance"),

(assign, ":enemy_in_front", 0),

] + ((is_a_wb_mt==1) and [
(agent_get_position, pos_belfry_begin, ":agent"),
(try_for_agents, ":target", pos_belfry_begin, 350),
] or [
(try_for_agents, ":target"),
]) + [

(neq, ":enemy_in_front", 1),
(neq, ":agent", ":target"), # Stop hitting yourself!
(neq, ":agent", ":warg"), # Stop hitting yourself!
(agent_get_position, pos1, ":agent"),
(agent_get_position, pos2, ":target"),
(get_distance_between_positions, ":dist", pos1, pos2),
(lt, ":dist", 300),
(neg|position_is_behind_position, pos2, pos1),
(agent_get_team, ":agent_team", ":agent"),
(agent_get_team, ":target_team", ":target"),
(teams_are_enemies, ":agent_team", ":target_team"),
(assign, ":enemy_in_front", 1),
(try_end),
(eq, ":enemy_in_front", 1),
(assign, ":anim", "anim_warg_leapattack"),

#Kham - let's give 'em some sounds when attacking
(try_begin),
(le, ":rnd", 25),
(assign, ":sound", "snd_wolf_strike"),
(else_try),
(assign, ":sound", "snd_warg_lone_woof"),
(try_end),

(try_begin),
(le, ":rnd", 25), #25% chance to make sound
(agent_play_sound, ":warg", ":sound"),
(try_end),

(agent_set_animation, ":warg", ":anim"),

(try_for_agents, ":target"),
(neq, ":agent", ":target"), # Stop hitting yourself!
(neq, ":agent", ":warg"), # Stop hitting yourself!
(agent_is_alive, ":agent"),
(agent_is_human, ":agent"),
(agent_get_position, pos1, ":agent"),
(agent_get_position, pos2, ":target"),
(get_distance_between_positions, ":dist", pos1, pos2),
(lt, ":dist", 300),
(neg|position_is_behind_position, pos2, pos1),
(agent_get_team, ":agent_team", ":agent"),
(agent_get_team, ":target_team", ":target"),
(teams_are_enemies, ":agent_team", ":target_team"),
(assign, ":damaged_agents", 0),
(assign, ":agents_to_damage", 100),
(store_random_in_range, reg0, 10, 16),
(try_begin),
(le, ":rnd", 30), #30% chance for a fly back
(assign, ":hit_anim", "anim_strike_fly_back"),
(else_try),
(assign, ":hit_anim", "anim_strike_chest_front"),
(try_end),
(assign, ":agents_to_damage", 1),
#(display_message, "@DEBUG: Warg Jump!"),
(try_begin),
(get_player_agent_no, ":player"),
(eq, ":target", ":player"),
(display_message, "@Received {reg0} damage."),
(try_end),
(le, ":damaged_agents", ":agents_to_damage"), # Allows us to limit the number of agents an animal can strike
(set_show_messages, 0),
(store_agent_hit_points,":hp",":target",1),
(val_sub, ":hp", reg0),
(agent_set_hit_points, ":target", ":hp", 1),
(try_begin),
(le, ":hp", 0),
(agent_deliver_damage_to_agent, ":agent", ":target"),
(try_end),
(set_show_messages, 1),
(val_add, ":damaged_agents", 1),
(agent_set_animation, ":target", ":hit_anim"),
(try_end),
(try_end),
])

tld_remove_riderless_animals = (

1, 0, 0, [(eq, "$animal_is_present",1)], [
Expand Down Expand Up @@ -604,6 +709,7 @@
tld_animals_init,
tld_animal_strikes,
tld_remove_riderless_animals,
tld_warg_leap_attack,
reset_fog,
] + tld_morale_triggers + fade + khams_custom_player_camera + tld_fallen_riders_get_damaged + bright_nights + tld_spawn_battle_animals

Expand Down
4 changes: 2 additions & 2 deletions _wb/actions.txt
Expand Up @@ -1236,8 +1236,8 @@
1.7 warg_jump 0 20 805306373 2829396006 0 0 0 0.9
horse_cancel_ani 0 50331743 1
0.25 anim_horse 600 601 1073741830 0 0 0 0 0
warg_leapattack 17410 33554506 1
1.2 wargLeapAttack 0 20 536870917 2829396006 0 0 0 0.9
warg_leapattack 256 50331650 1
1 anim_horse 205 222 5 0 0 0 0 0.0
bear_slap_right 17410 50331722 1
1.3 bear_slap_right 1 45 536870917 2829396006 0 0 0 0.9
bear_uppercut 17410 50331722 1
Expand Down
232 changes: 116 additions & 116 deletions _wb/conversation.txt

Large diffs are not rendered by default.

0 comments on commit 02d072f

Please sign in to comment.