quake-hipnotic-sdk/progs/hip_brk.qc
1997-03-11 00:00:00 +00:00

92 lines
2 KiB
C++

/* breakaway walls quickc program
by jim dose' 9/11/96
copyright (c)1996 hipnotic interactive, inc.
all rights reserved.
do not distribute.
*/
float multi_use = 1;
float invisible = 2;
void() damagethreshold_killed =
{
self.health = self.max_health;
// self.solid = solid_not;
activator = damage_attacker;
self.takedamage = damage_no;
sub_usetargets ();
self.takedamage = damage_yes;
if ( !( self.spawnflags & multi_use ) )
{
remove( self );
}
};
void() damagethreshold_pain =
{
self.health = self.max_health;
};
/*quaked trigger_damagethreshold (0 .5 .8) ? multi_use invisible
triggers only when a threshold of damage is exceeded.
when used in conjunction with func_breakawaywall, allows
walls that may be destroyed with a rocket blast.
multi_use tells the trigger to not to remove itself after
being fired. allows the trigger to be used multiple times.
invisible tells the trigger to not be visible.
"health" specifies how much damage must occur before trigger fires.
default is 60.
*/
void() trigger_damagethreshold =
{
self.mangle = self.angles;
self.angles = '0 0 0';
self.classname = "damagethreshold";
self.solid = solid_bsp;
self.movetype = movetype_push;
setorigin (self, self.origin);
setmodel (self, self.model);
setsize (self, self.mins , self.maxs);
if ( self.spawnflags & invisible )
{
self.model = string_null;
}
if (!self.health)
{
self.health = 60;
}
self.max_health = self.health;
self.takedamage = damage_yes;
self.blocked = sub_null;
self.th_pain = damagethreshold_pain;
self.th_die = damagethreshold_killed;
};
/*quaked func_breakawaywall (0 .5 .8) ?
special walltype that removes itself when triggered.
*/
void() func_breakawaywall =
{
self.mangle = self.angles;
self.angles = '0 0 0';
self.classname = "breakaway";
self.solid = solid_bsp;
self.movetype = movetype_push;
setorigin (self, self.origin);
setmodel (self, self.model);
setsize (self, self.mins , self.maxs);
self.use = sub_remove;
};