Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
sv_rocketminsta.qc
Go to the documentation of this file.
1
#include "
sv_rocketminsta.qh
"
2
3
#include <
common/deathtypes/all.qh
>
4
#include <
server/round_handler.qh
>
5
6
REGISTER_MUTATOR
(rm,
autocvar_g_instagib
);
7
8
MUTATOR_HOOKFUNCTION
(rm, Damage_Calculate)
9
{
10
// we do it this way, so rm can be toggled during the match
11
if
(!
autocvar_g_rm
) {
return
; }
12
13
entity
frag_attacker =
M_ARGV
(1,
entity
);
14
entity
frag_target
=
M_ARGV
(2,
entity
);
15
float
frag_deathtype =
M_ARGV
(3,
float
);
16
float
frag_damage
=
M_ARGV
(4,
float
);
17
18
if
(
DEATH_ISWEAPON
(frag_deathtype, WEP_DEVASTATOR))
19
if
(frag_attacker ==
frag_target
||
frag_target
.classname ==
"nade"
)
20
frag_damage
= 0;
21
22
if
(
autocvar_g_rm_laser
)
23
if
(
DEATH_ISWEAPON
(frag_deathtype, WEP_ELECTRO))
24
if
(frag_attacker ==
frag_target
|| (
round_handler_IsActive
() && !
round_handler_IsRoundStarted
()))
25
frag_damage
= 0;
26
27
M_ARGV
(4,
float
) =
frag_damage
;
28
}
29
30
MUTATOR_HOOKFUNCTION
(rm, PlayerDies)
31
{
32
// we do it this way, so rm can be toggled during the match
33
if
(!
autocvar_g_rm
) {
return
; }
34
35
float
frag_deathtype =
M_ARGV
(3,
float
);
36
37
if
(
DEATH_ISWEAPON
(frag_deathtype, WEP_DEVASTATOR) ||
DEATH_ISWEAPON
(frag_deathtype, WEP_ELECTRO))
38
M_ARGV
(4,
float
) = 1000;
// always gib if it was a vaporizer death
39
}
REGISTER_MUTATOR
#define REGISTER_MUTATOR(...)
Definition
base.qh:295
MUTATOR_HOOKFUNCTION
#define MUTATOR_HOOKFUNCTION(...)
Definition
base.qh:335
entity
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
M_ARGV
#define M_ARGV(x, type)
Definition
events.qh:17
all.qh
DEATH_ISWEAPON
#define DEATH_ISWEAPON(t, w)
Definition
all.qh:46
round_handler.qh
round_handler_IsActive
#define round_handler_IsActive()
Definition
round_handler.qh:21
round_handler_IsRoundStarted
#define round_handler_IsRoundStarted()
Definition
round_handler.qh:24
frag_damage
float frag_damage
Definition
sv_ctf.qc:2322
frag_target
entity frag_target
Definition
sv_ctf.qc:2321
autocvar_g_rm
float autocvar_g_rm
Definition
sv_instagib.qh:8
autocvar_g_instagib
bool autocvar_g_instagib
Definition
sv_instagib.qh:27
autocvar_g_rm_laser
float autocvar_g_rm_laser
Definition
sv_instagib.qh:13
sv_rocketminsta.qh
common
mutators
mutator
rocketminsta
sv_rocketminsta.qc
Generated on
for Xonotic QuakeC by
1.14.0