Navigation Menu

Skip to content

Commit

Permalink
added trigger_hurt by request
Browse files Browse the repository at this point in the history
  • Loading branch information
st1x51 committed Oct 9, 2013
1 parent f41d81e commit e172a72
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion triggers.qc
Expand Up @@ -302,4 +302,36 @@ void() play_sound =
if (t < self.delay)
t = self.delay;
self.nextthink = time + t;
};
};
void() hurt_on =
{
self.solid = SOLID_TRIGGER;
self.nextthink = -1;
};

void() hurt_touch =
{
if (other.takedamage)
{
self.solid = SOLID_NOT;
T_Damage (other, self, self, self.dmg);
self.think = hurt_on;
self.nextthink = time + 1;
}

return;
};

/*QUAKED trigger_hurt (.5 .5 .5) ?
Any object touching this will be hurt
set dmg to damage amount
defalt dmg = 5
*/
void() trigger_hurt =
{
InitTrigger ();
self.touch = hurt_touch;
if (!self.dmg)
self.dmg = 5;
};

0 comments on commit e172a72

Please sign in to comment.