Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
sv_pinata.qc
Go to the documentation of this file.
1#include "sv_pinata.qh"
2
6
7MUTATOR_HOOKFUNCTION(pinata, PlayerDies)
8{
10
11 for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
12 {
13 .entity weaponentity = weaponentities[slot];
14
15 if(frag_target.(weaponentity).m_weapon == WEP_Null)
16 continue;
17
18 if(slot > 0 && !autocvar_g_pinata_offhand)
19 break;
20
21 FOREACH(Weapons, it != WEP_Null, {
22 if(STAT(WEAPONS, frag_target) & WepSet_FromWeapon(it))
23 if(frag_target.(weaponentity).m_weapon != it)
25 W_ThrowNewWeapon(frag_target, it.m_id, false, CENTER_OR_VIEWOFS(frag_target), randomvec() * 175 + '0 0 325', weaponentity);
26 });
27 }
28
29 return true;
30}
31
32MUTATOR_HOOKFUNCTION(pinata, BuildMutatorsString)
33{
34 M_ARGV(0, string) = strcat(M_ARGV(0, string), ":Pinata");
35}
36
37MUTATOR_HOOKFUNCTION(pinata, BuildMutatorsPrettyString)
38{
39 M_ARGV(0, string) = strcat(M_ARGV(0, string), ", PiƱata");
40}
#define MUTATOR_IS_ENABLED(this)
Definition base.qh:193
#define REGISTER_MUTATOR(...)
Definition base.qh:295
#define MUTATOR_HOOKFUNCTION(...)
Definition base.qh:335
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
#define M_ARGV(x, type)
Definition events.qh:17
ERASEABLE bool expr_evaluate(string s)
Evaluate an expression of the form: [+ | -]?
Definition cvar.qh:48
Weapons
Definition guide.qh:113
#define FOREACH(list, cond, body)
Definition iter.qh:19
#define STAT(...)
Definition stats.qh:82
vector randomvec(void)
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))
entity frag_target
Definition sv_ctf.qc:2321
bool autocvar_g_pinata_offhand
Definition sv_pinata.qc:4
string autocvar_g_pinata
Definition sv_pinata.qc:3
bool W_IsWeaponThrowable(entity this, int w)
Definition throwing.qc:118
float W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vector velo,.entity weaponentity)
Definition throwing.qc:22
#define CENTER_OR_VIEWOFS(ent)
Definition utils.qh:29
#define WepSet_FromWeapon(it)
Definition all.qh:46
const int MAX_WEAPONSLOTS
Definition weapon.qh:16
entity weaponentities[MAX_WEAPONSLOTS]
Definition weapon.qh:17