Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
spawn.qc
Go to the documentation of this file.
1#include "spawn.qh"
2
3#ifdef SVQC
5{
6 entity player = this.realowner;
7 entity spawnloc = new(nade_spawn_loc);
8 setorigin(spawnloc, this.origin);
9 setsize(spawnloc, player.mins, player.maxs);
10 set_movetype(spawnloc, MOVETYPE_NONE);
11 spawnloc.solid = SOLID_NOT;
12 spawnloc.drawonlytoclient = player;
13 spawnloc.effects = EF_STARDUST;
14 spawnloc.cnt = autocvar_g_nades_spawn_count;
15
16 if(player.nade_spawnloc)
17 delete(player.nade_spawnloc);
18
19 player.nade_spawnloc = spawnloc;
20}
21
27
29{
30 if(autocvar_g_nades_spawn_destroy_damage > 0 && STAT(NADE_BONUS_TYPE, this) == NADE_TYPE_SPAWN.m_id)
31 Damage(this.realowner, attacker, attacker, autocvar_g_nades_spawn_destroy_damage, DEATH_TOUCHEXPLODE.m_id, DMG_NOWEP, this.realowner.origin, '0 0 0');
32 return false;
33}
34#endif // SVQC
35#ifdef MENUQC
36METHOD(SpawnNade, describe, string(SpawnNade this))
37{
38 TC(SpawnNade, this);
40 PAR(_("The %s detonates after a short delay, temporarily setting your spawnpoint to where it detonated. "
41 "It is useful for cases where you want to go back to some point on the map after you die."), COLORED_NAME(this));
42 return PAGE_TEXT;
43}
44#endif // MENUQC
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
void SetResource(entity e, Resource res_type, float amount)
Sets the current amount of resource the given entity will have.
#define COLORED_NAME(this)
Definition color.qh:195
const float EF_STARDUST
const float SOLID_NOT
vector origin
void Damage(entity targ, entity inflictor, entity attacker, float damage, int deathtype,.entity weaponentity, vector hitloc, vector force)
Definition damage.qc:503
#define DMG_NOWEP
Definition damage.qh:104
#define TC(T, sym)
Definition _all.inc:82
#define STAT(...)
Definition stats.qh:82
void set_movetype(entity this, int mt)
Definition movetypes.qc:4
const int MOVETYPE_NONE
Definition movetypes.qh:129
void nade_spawn_boom(entity this)
Definition spawn.qc:4
void nade_spawn_SetSpawnHealth(entity player)
Definition spawn.qc:22
bool nade_spawn_DestroyDamage(entity this, entity attacker)
Definition spawn.qc:28
#define METHOD(cname, name, prototype)
Definition oo.qh:269
#define PAGE_TEXT
Definition string.qh:643
#define PAR(...)
Adds an individually translatable paragraph to PAGE_TEXT without having to deal with strcat and sprin...
Definition string.qh:649
#define PAGE_TEXT_INIT()
Definition string.qh:642
float autocvar_g_nades_spawn_destroy_damage
Definition sv_nades.qh:11
float autocvar_g_nades_spawn_health_respawn
Definition sv_nades.qh:10
int autocvar_g_nades_spawn_count
Definition sv_nades.qh:9
entity realowner