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 (STAT(NADE_BONUS_TYPE, this) == NADE_TYPE_SPAWN.m_id && autocvar_g_nades_spawn_destroy_damage > 0)
31 Damage(this.realowner, attacker, attacker,
33 DEATH_TOUCHEXPLODE.m_id,
35 this.realowner.origin,
36 '0 0 0'
37 );
38 return false;
39}
40#endif // SVQC
41#ifdef MENUQC
42METHOD(SpawnNade, describe, string(SpawnNade this))
43{
44 TC(SpawnNade, this);
46 PAR(_("The %s detonates after a short delay, temporarily setting your spawnpoint to where it detonated. "
47 "It is useful for cases where you want to go back to some point on the map after you die."), COLORED_NAME(this));
48 return PAGE_TEXT;
49}
50#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:493
#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:642
#define PAR(...)
Adds an individually translatable paragraph to PAGE_TEXT without having to deal with strcat and sprin...
Definition string.qh:648
#define PAGE_TEXT_INIT()
Definition string.qh:641
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