// spawnflags:
// 1 = start disabled (needs to be triggered to activate)
// 2 = indicate damage
+// 4 = don't take direct damage (needs to be triggered to 'explode', then triggered again to restore)
// notes:
// for mdl_dead to work, origin must be set (using a common/origin brush).
// Otherwise mdl_dead will be displayed at the map origin, and nobody would
self.bot_attack = false;
self.event_damage = func_null;
self.state = 1;
+ if(self.spawnflags & 4)
+ self.use = func_null;
func_breakable_colormod();
if (self.noise1)
stopsound (self, CH_TRIGGER_SINGLE);
WaypointSprite_UpdateMaxHealth(self.sprite, self.max_health);
WaypointSprite_UpdateHealth(self.sprite, self.health);
}
- self.takedamage = DAMAGE_AIM;
- self.bot_attack = true;
- self.event_damage = func_breakable_damage;
+ if(!(self.spawnflags & 4))
+ {
+ self.takedamage = DAMAGE_AIM;
+ self.bot_attack = true;
+ self.event_damage = func_breakable_damage;
+ }
self.state = 0;
self.nextthink = 0; // cancel auto respawn
func_breakable_colormod();
self.mdl = self.model;
SetBrushEntityModel();
- self.use = func_breakable_restore;
+ if(self.spawnflags & 4)
+ self.use = func_breakable_destroy;
+ else
+ self.use = func_breakable_restore;
+
+ if(self.spawnflags & 4)
+ {
+ self.takedamage = DAMAGE_NO;
+ self.event_damage = func_null;
+ self.bot_attack = false;
+ }
// precache all the models
if (self.mdl_dead)
}
void spawnfunc_item_armor_big (void) {
- self.classname = "item_armor_big";
if(!self.armorvalue)
self.armorvalue = g_pickup_armorbig;
if(!self.max_armorvalue)
}
void spawnfunc_item_armor_large (void) {
- self.classname = "item_armor_large";
if(!self.armorvalue)
self.armorvalue = g_pickup_armorlarge;
if(!self.max_armorvalue)
}
void spawnfunc_item_health_small (void) {
- self.classname = "item_health_small";
if(!self.max_health)
self.max_health = g_pickup_healthsmall_max;
if(!self.health)
}
void spawnfunc_item_health_medium (void) {
- self.classname = "item_health_medium";
if(!self.max_health)
self.max_health = g_pickup_healthmedium_max;
if(!self.health)
}
void spawnfunc_item_health_large (void) {
- self.classname = "item_health_large";
if(!self.max_health)
self.max_health = g_pickup_healthlarge_max;
if(!self.health)