Xonotic
sv_spawner.qc
Go to the documentation of this file.
1
#include "
sv_spawner.qh
"
2
3
#include <
common/monsters/sv_monsters.qh
>
4
#include <
common/monsters/sv_spawn.qh
>
5
6
void
spawner_use
(
entity
this
,
entity
actor,
entity
trigger)
7
{
8
int
moncount = 0;
9
IL_EACH
(
g_monsters
, it.realowner ==
this
,
10
{
11
++moncount;
12
});
13
14
if
(moncount >= this.
count
)
15
return
;
16
17
entity
e =
spawn
();
18
e.noalign = this.
noalign
;
19
e.angles = this.
angles
;
20
e.monster_skill = this.
monster_skill
;
21
e.skin = this.
skin
;
22
e =
spawnmonster
(e, this.
spawnmob
, MON_Null,
this
,
this
, this.
origin
,
false
,
true
, this.
monster_moveflags
);
23
}
24
25
spawnfunc
(monster_spawner)
26
{
27
if
(!
autocvar_g_monsters
|| !this.
spawnmob
|| this.
spawnmob
==
""
) {
delete
(
this
);
return
; }
28
29
this.
use
=
spawner_use
;
30
}
IL_EACH
#define IL_EACH(this, cond, body)
Definition:
intrusivelist.qh:169
spawnmonster
entity spawnmonster(entity e, string monster, Monster monster_id, entity spawnedby, entity own, vector orig, bool respwn, bool removeifinvalid, int moveflag)
Definition:
sv_spawn.qc:14
spawner_use
void spawner_use(entity this, entity actor, entity trigger)
Definition:
sv_spawner.qc:6
spawn
entity spawn(void)
skin
skin
Definition:
ent_cs.qc:143
spawnfunc
spawnfunc(monster_spawner)
Definition:
sv_spawner.qc:25
entity
entity() spawn
origin
origin
Definition:
ent_cs.qc:114
spawnmob
string spawnmob
Definition:
sv_spawner.qh:3
noalign
float noalign
Definition:
items.qh:42
sv_spawn.qh
monster_skill
int monster_skill
Definition:
sv_monsters.qh:96
monster_moveflags
int monster_moveflags
Definition:
sv_monsters.qh:47
sv_monsters.qh
autocvar_g_monsters
float autocvar_g_monsters
Definition:
sv_monsters.qh:5
count
float count
Definition:
powerups.qc:22
angles
vector angles
Definition:
csprogsdefs.qc:104
use
#define use
Definition:
csprogsdefs.qh:50
sv_spawner.qh
g_monsters
IntrusiveList g_monsters
Definition:
sv_monsters.qh:144
common
monsters
sv_spawner.qc
Generated on Thu Mar 17 2022 17:26:28 for Xonotic by
1.8.13