1 #using scripts\codescripts\struct;
3 #insert scripts\shared\shared.gsh;
5 #using scripts\shared\array_shared;
6 #using scripts\shared\callbacks_shared;
7 #using scripts\shared\killstreaks_shared;
8 #using scripts\shared\laststand_shared;
9 #using scripts\shared\math_shared;
10 #using scripts\shared\system_shared;
11 #using scripts\shared\table_shared;
12 #using scripts\shared\util_shared;
13 #using scripts\shared\weapons_shared;
15 #using scripts\zm\_zm;
16 #using scripts\zm\_zm_powerups;
17 #using scripts\zm\_zm_spawner;
18 #using scripts\zm\_zm_stats;
19 #using scripts\zm\_zm_utility;
20 #using scripts\zm\_zm_weapons;
22 #insert scripts\zm\_zm_attackables.gsh;
24 #namespace zm_attackables;
34 foreach( attackable
in level.attackables )
38 if ( isdefined( attackable.target ) )
43 attackable.is_active =
false;
44 attackable.health = attackable.bundle.max_health;
46 if ( GetDvarInt(
"zm_attackables" ) > 0 )
48 attackable.is_active =
true;
49 attackable.health = 1000;
61 foreach( attackable
in level.attackables )
63 if ( !
IS_TRUE( attackable.is_active ) )
68 dist = Distance(
self.origin, attackable.origin );
69 if ( dist < attackable.bundle.aggro_distance )
93 foreach( slot
in self.slot )
95 if ( !isdefined( slot.entity ) )
98 entity.attackable_slot = slot;
108 foreach( slot
in self.slot )
110 if ( !IsAlive( slot.entity ) )
112 slot.entity = undefined;
116 if (
IS_TRUE( slot.entity.missingLegs ) )
118 slot.entity = undefined;
126 self.is_active =
true;
130 if(
self.health <= 0 )
132 self.health =
self.bundle.max_health;
138 self.is_active =
false;
144 self notify(
"attackable_damaged" );
146 if (
self.health <= 0 )
148 self notify(
"attackable_deactivated" );
150 if( !
IS_TRUE(
self.b_deferred_deactivation ) )
159 self do_damage( entity.meleeWeapon.meleeDamage );