Xonotic
kill.qc
Go to the documentation of this file.
1 #include "kill.qh"
2 
3 #ifdef SVQC
4 void target_kill_use(entity this, entity actor, entity trigger)
5 {
6  if(this.active != ACTIVE_ACTIVE)
7  return;
8 
9  if(actor.takedamage == DAMAGE_NO)
10  return;
11 
12  if(!actor.iscreature && !actor.damagedbytriggers)
13  return;
14 
15  Damage(actor, this, trigger, 1000, DEATH_HURTTRIGGER.m_id, DMG_NOWEP, actor.origin, '0 0 0');
16 }
17 
18 void target_kill_reset(entity this)
19 {
20  this.active = ACTIVE_ACTIVE;
21 }
22 
23 spawnfunc(target_kill)
24 {
25  if (this.message == "")
26  this.message = "was in the wrong place";
27 
28  if (this.message2 == "")
29  this.message2 = "was thrown into a world of hurt by";
30 
31  this.use = target_kill_use;
32  this.reset = target_kill_reset;
33  this.active = ACTIVE_ACTIVE;
34 }
35 #endif
entity() spawn
spawnfunc(info_player_attacker)
Definition: sv_assault.qc:283
#define DMG_NOWEP
Definition: damage.qh:126
const int ACTIVE_ACTIVE
Definition: defs.qh:37
string message
Definition: powerups.qc:19
void Damage(entity targ, entity inflictor, entity attacker, float damage, int deathtype,.entity weaponentity, vector hitloc, vector force)
Definition: damage.qc:583
int active
Definition: defs.qh:34
#define use
Definition: csprogsdefs.qh:50
float DAMAGE_NO
Definition: progsdefs.qc:282