SERVER: Add trigger_hurt from Quake

This commit is contained in:
cypress 2023-12-12 18:05:14 -05:00
parent 8ed98c51d8
commit f1754883ee
5 changed files with 36 additions and 4 deletions

View file

@ -258,6 +258,8 @@ void() SUB_Null2 = {};
.string name;
vector trace_plane_normal;
.float dmg;
//
// AI definitions
// Used for global one-zombie-at-a-time type ai

View file

@ -34,7 +34,6 @@ void() trigger_setskill = {remove(self);};
void() trigger_monsterjump = {remove(self);};
void() trigger_onlyregistered = {remove(self);};
void() trigger_push = {remove(self);};
void() trigger_hurt = {remove(self);};
// Player Starts
void() info_player_start = {};
void() info_player_start2 = {};

View file

@ -47,7 +47,6 @@ float DOOR_POWER = 64;
.float delay;
.void() think1;
.vector finaldest;
.float dmg;
.entity trigger_field;
.float wait;
.float speed;

View file

@ -149,8 +149,6 @@ void () func_rotating =
// func_train
// =================================
.float dmg;
void() train_next;
void() func_train_find;

View file

@ -355,3 +355,37 @@ void() trigger_once =
trigger_multiple();
}
//
// Quake Triggers
//
void() hurt_on =
{
self.solid = SOLID_TRIGGER;
self.nextthink = -1;
};
void() hurt_touch =
{
//if (other.takedamage)
{
self.solid = SOLID_NOT;
DamageHandler(other, self, self.dmg, S_ZOMBIE);
self.think = hurt_on;
self.nextthink = time + 1;
if (self.message)
centerprint(other, strcat(self.message, "\n"));
}
return;
};
void() trigger_hurt =
{
InitTrigger ();
self.touch = hurt_touch;
if (!self.dmg)
self.dmg = 5;
};