1 #using scripts\codescripts\struct;
3 #insert scripts\shared\archetype_shared\archetype_shared.gsh;
4 #using scripts\shared\aat_shared;
5 #using scripts\shared\array_shared;
6 #using scripts\shared\clientfield_shared;
7 #using scripts\shared\flag_shared;
8 #using scripts\shared\fx_shared;
9 #using scripts\shared\math_shared;
10 #using scripts\shared\system_shared;
11 #using scripts\shared\util_shared;
12 #using scripts\shared\ai\systems\gib;
14 #insert scripts\shared\aat_zm.gsh;
15 #insert scripts\shared\shared.gsh;
16 #insert scripts\shared\version.gsh;
18 #using scripts\zm\_zm_stats;
19 #using scripts\zm\_zm_utility;
21 #insert scripts\zm\aats\_zm_aat_thunder_wall.gsh;
23 #insert scripts\zm\_zm_utility.gsh;
25 #precache( "material", ZM_AAT_THUNDER_WALL_DAMAGE_FEEDBACK_ICON );
26 #precache( "fx", ZM_AAT_THUNDER_WALL_BREAK_FX );
28 #namespace zm_aat_thunder_wall;
56 v_thunder_wall_blast_pos =
self.origin;
57 v_attacker_facing_forward_dir = VectorToAngles( v_thunder_wall_blast_pos - attacker.origin );
58 v_attacker_facing = attacker GetWeaponForwardDir();
59 v_attacker_orientation = attacker.angles;
61 a_ai_zombies = array::get_all_closest( v_thunder_wall_blast_pos, GetAITeamArray(
"axis" ), undefined, undefined, 2 *
ZM_AAT_THUNDER_WALL_RANGE );
62 if ( !isDefined( a_ai_zombies ) )
77 for ( i = 0; i < a_ai_zombies.size; i++ )
80 if ( !IsDefined( a_ai_zombies[i] ) || !IsAlive( a_ai_zombies[i] ) )
92 if ( a_ai_zombies[i] ==
self )
94 v_curr_zombie_origin =
self.origin;
95 v_curr_zombie_origin_sq = 0;
100 v_curr_zombie_origin = a_ai_zombies[i] GetCentroid();
101 v_curr_zombie_origin_sq = DistanceSquared( v_thunder_wall_blast_pos, v_curr_zombie_origin );
102 v_curr_zombie_to_thunder_wall = VectorNormalize( v_curr_zombie_origin - v_thunder_wall_blast_pos );
103 v_curr_zombie_facing_dot = VectorDot( v_attacker_facing, v_curr_zombie_to_thunder_wall );
106 if ( v_curr_zombie_facing_dot < 0 )
112 radial_origin = PointOnSegmentNearestToPoint( v_thunder_wall_blast_pos, end_pos, v_curr_zombie_origin );
113 if ( DistanceSquared( v_curr_zombie_origin, radial_origin ) > f_thunder_wall_effect_area_sq )
120 if ( v_curr_zombie_origin_sq < f_thunder_wall_range_sq )
122 a_ai_zombies[i] DoDamage( a_ai_zombies[i].health, v_curr_zombie_origin, attacker, attacker,
"none",
"MOD_IMPACT" );
124 if ( IsDefined( attacker ) && IsPlayer( attacker ) )
133 n_random_x = RandomFloatRange( -3, 3 );
134 n_random_y = RandomFloatRange( -3, 3 );
136 a_ai_zombies[i] StartRagdoll(
true );