Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
sv_buffs.qc
Go to the documentation of this file.
1#include "sv_buffs.qh"
2
7
8#include "buff/_mod.qh"
9
11{
12 entity player = WaypointSprite_getviewentity(client);
13 entity myowner = this.owner;
14 entity heldbuff = buff_FirstFromFlags(myowner);
15
16 if (!heldbuff)
17 return false;
18
19 if (myowner.alpha <= 0.5 && myowner.alpha != 0 && DIFF_TEAM(player, myowner))
20 return false;
21
22 if (MUTATOR_CALLHOOK(BuffModel_Customize, this, player))
23 return false;
24
25 if (player == myowner)
26 {
27 // somewhat hide the model, but keep the glow
28 this.effects = 0;
29 this.alpha = -1;
30 }
31 else
32 {
34 this.alpha = myowner.alpha;
35 }
36 return true;
37}
38
40{
41 this.nextthink = time;
42 entity player = this.owner;
43 if (player.alpha < 0 || player.buff_model != this)
44 {
45 if (player) // remnant from ChatBubbleThink, same question... WHY?!
46 player.buff_model = NULL;
47 delete(this);
48 return;
49 }
50
51 entity heldbuff = buff_FirstFromFlags(player);
52
53 if (!heldbuff)
54 {
55 this.effects = EF_NODRAW;
56 return;
57 }
58
59 this.color = heldbuff.m_color;
60 this.glowmod = heldbuff.m_color;
61 this.skin = heldbuff.m_skin;
62
63 this.effects = player.effects;
65 this.effects &= EFMASK_CHEAP; // eat performance
66
67 this.alpha = player.alpha;
68}
69
71{
72 if (player.buff_model)
73 delete(player.buff_model);
74 player.buff_model = NULL;
75}
76
78{
79 player.buff_model = new(buff_model);
80 setmodel(player.buff_model, MDL_BUFF);
81 setsize(player.buff_model, '0 0 -40', '0 0 40');
82 setattachment(player.buff_model, player, "");
83 setorigin(player.buff_model, '0 0 1' * (player.buff_model.maxs.z * 1));
84 player.buff_model.owner = player;
85 player.buff_model.exteriormodeltoclient = player;
86 player.buff_model.scale = 0.7;
87 player.buff_model.pflags = PFLAGS_FULLDYNAMIC;
88 player.buff_model.light_lev = 200;
89 setthink(player.buff_model, buffs_BuffModel_Think);
90 player.buff_model.nextthink = time;
91 setcefc(player.buff_model, buffs_BuffModel_Customize);
92}
93
95{
96 if (this.alpha < 0)
97 return;
98 // spawn a buff model entity if needed
99 if (!this.buff_model)
101}
102
103void buff_Effect(entity player, entity eff, vector eff_loc, vector eff_vel, int eff_cnt, bool hide)
104{
105 if (time < player.buff_effect_delay || !autocvar_g_buffs_effects)
106 return;
107
108 float pl_alpha = (!player.alpha ? 1 : player.alpha);
109 if (pl_alpha > 0)
110 Send_Effect_Core(eff, eff_loc, eff_vel, eff_cnt,
111 '0 0 0', '0 0 0',
112 pl_alpha, pl_alpha, -1,
113 (hide ? player : NULL)
114 );
115 player.buff_effect_delay = time + 1/16; // 0.0625; prevent spam
116}
117
118// buff item
120{
121 if (!this.owner.buff_active && !this.owner.buff_activetime || !this.owner.buffdef)
122 return false;
123
124 entity heldbuff = buff_FirstFromFlags(view); // TODO: cache this information so it isn't performing a loop every frame
125 if (heldbuff)
126 return CS_CVAR(view).cvar_cl_buffs_autoreplace == false || heldbuff != this.owner.buffdef;
127
128 return WaypointSprite_visible_for_player(this, player, view);
129}
130
132{
134 return;
135
136 entity buff = e.buffdef;
137 entity wp = WaypointSprite_Spawn(WP_Buff, 0, autocvar_g_buffs_waypoint_distance, e, '0 0 1' * e.maxs.z, NULL, e.team_forced, e, buff_waypoint, true, RADARICON_Buff);
138 wp.wp_extra = buff.m_id;
139 WaypointSprite_UpdateTeamRadar(e.buff_waypoint, RADARICON_Buff, e.glowmod);
140 e.buff_waypoint.waypointsprite_visible_for_player = buff_Waypoint_visible_for_player;
141}
142
143void buff_SetCooldown(entity this, float cd)
144{
145 cd = max(0, cd);
146
147 if (!this.buff_waypoint)
149 if (this.buff_waypoint)
151
152 this.buff_activetime = cd;
153 this.buff_active = !cd;
154}
155
157{
158 if (game_stopped)
159 return;
160
161 vector oldbufforigin = this.origin;
162 this.velocity = '0 0 200';
163
166 {
167 entity spot = SelectSpawnPoint(this, true);
168 setorigin(this, spot.origin);
169 this.velocity = (randomvec() * 100) + '0 0 200';
170 this.angles = spot.angles;
171 }
172
173 tracebox(this.origin, this.mins * 1.5, this.maxs * 1.5, this.origin, MOVE_NOMONSTERS, this);
174
175 setorigin(this, trace_endpos); // attempt to unstick
176
178
179 makevectors(this.angles);
180 this.angles = '0 0 0';
183
184 Send_Effect(EFFECT_ITEM_TELEPORT, oldbufforigin + ((this.mins + this.maxs) * 0.5), '0 0 0', 1);
185 Send_Effect(EFFECT_ITEM_TELEPORT, CENTER_OR_VIEWOFS(this), '0 0 0', 1);
186
188
189 sound(this, CH_TRIGGER, SND_KA_RESPAWN, VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere)
190}
191
193{
194 if (game_stopped)
195 return;
196
198 {
199 buff_Respawn(this);
200 return;
201 }
202
203 if (!this.buff_active)
204 return;
205
206 if (MUTATOR_CALLHOOK(BuffTouch, this, toucher))
207 return;
208 toucher = M_ARGV(1, entity);
209
210 if (!IS_PLAYER(toucher))
211 return; // incase mutator changed toucher
212
213 if ((this.team_forced && toucher.team != this.team_forced)
214 || toucher.vehicle
215 || !this.buffdef // TODO: error out or maybe reset type if this occurs?
216 || time < toucher.buff_shield)
217 // can't touch this
218 return;
219
220 entity thebuff = this.buffdef;
222 int removal_type = STATUSEFFECT_REMOVE_NORMAL;
223
224 if (heldbuff)
225 {
226 if (CS_CVAR(toucher).cvar_cl_buffs_autoreplace && heldbuff != thebuff)
227 {
228 int buffid = heldbuff.m_id;
229 Send_Notification(NOTIF_ONE, toucher, MSG_INFO, INFO_ITEM_BUFF_LOST, toucher.netname, buffid);
231 Send_Notification(NOTIF_ALL_EXCEPT, toucher, MSG_INFO, INFO_ITEM_BUFF_LOST, toucher.netname, buffid);
232 //sound(toucher, CH_TRIGGER, SND_BUFF_LOST, VOL_BASE, ATTN_NORM);
233 removal_type = STATUSEFFECT_REMOVE_CLEAR;
234 }
235 else
236 return; // do nothing
237 }
238
239 this.owner = toucher;
240 this.buff_active = false;
241 this.lifetime = 0;
242 Send_Notification(NOTIF_ONE, toucher, MSG_MULTI, ITEM_BUFF_GOT, thebuff.m_id);
244 Send_Notification(NOTIF_ALL_EXCEPT, toucher, MSG_INFO, INFO_ITEM_BUFF, toucher.netname, thebuff.m_id);
245
246 Send_Effect(EFFECT_ITEM_PICKUP, CENTER_OR_VIEWOFS(this), '0 0 0', 1);
247 sound(toucher, CH_TRIGGER, SND_SHIELD_RESPAWN, VOL_BASE, ATTN_NORM);
248 float bufftime = (this.buffs_finished) ? this.buffs_finished : thebuff.m_time(thebuff);
249
250 buff_RemoveAll(toucher, removal_type); // remove previous buffs so that a new one may be added
251 if (!bufftime)
252 bufftime = 999;
253 StatusEffects_apply(thebuff, toucher, time + bufftime, 0);
254}
255
257{
258 if (!buff)
259 return false;
260 if (buff == BUFF_AMMO && ((start_items & IT_UNLIMITED_AMMO) || cvar("g_melee_only")))
261 return false;
262 if (buff == BUFF_VAMPIRE && cvar("g_vampire"))
263 return false;
264 return cvar(strcat("g_buffs_", buff.netname));
265}
266
268
270{
272 FOREACH(StatusEffects, it.instanceOfBuff && buff_Available(it),
273 {
274 // if it's already been chosen, give it a lower priority
275 float myseencount = (it.buff_seencount > 0) ? it.buff_seencount : 1; // no division by zero please!
276 RandomSelection_AddEnt(it, max(0.2, 1 / myseencount), 1);
277 });
279 if (!newbuff)
280 return;
281 ++newbuff.buff_seencount; // lower chances of seeing this buff again soon
282 ent.buffdef = newbuff;
283}
284
285void buff_RemoveAll(entity actor, int removal_type)
286{
287 if (!actor.statuseffects)
288 return;
289 FOREACH(StatusEffects, it.instanceOfBuff, it.m_remove(it, actor, removal_type));
290}
291
293{
294 if (!actor.statuseffects)
295 return NULL;
296 FOREACH(StatusEffects, it.instanceOfBuff && it.m_active(it, actor), return it);
297 return NULL;
298}
299
301{
304
305 if (this.buffdef != this.oldbuffs)
306 {
307 entity buff = this.buffdef;
308 this.color = buff.m_color;
309 this.glowmod = buff.m_color;
310 this.skin = buff.m_skin;
311
312 setmodel(this, MDL_BUFF);
313 setsize(this, ITEM_D_MINS, ITEM_L_MAXS);
314
315 if (this.buff_waypoint)
316 {
317 //WaypointSprite_Disown(this.buff_waypoint, 1);
320 if (this.buff_activetime)
322 }
323
324 this.oldbuffs = this.buffdef;
325 }
326
327 if (!game_stopped
330 {
332 this.buff_activetime_updated = true;
333 }
334
335 if (!this.buff_active && !this.buff_activetime)
336 if (!this.owner || STAT(FROZEN, this.owner) || IS_DEAD(this.owner)
337 || !this.owner.iscreature || this.owner.vehicle
338 || this.pickup_anyway > 0 || (this.pickup_anyway >= 0 && autocvar_g_buffs_pickup_anyway)
339 || this.buffdef != buff_FirstFromFlags(this.owner))
340 {
342 this.owner = NULL;
343 if (autocvar_g_buffs_randomize & (teamplay ? 2 : 1))
344 buff_NewType(this);
345
347 buff_Respawn(this);
348 }
349
350 if (this.buff_activetime
351 && !game_stopped
353 {
355
356 if (!this.buff_activetime)
357 {
358 this.buff_active = true;
359 sound(this, CH_TRIGGER, SND_STRENGTH_RESPAWN, VOL_BASE, ATTN_NORM);
360 Send_Effect(EFFECT_ITEM_RESPAWN, CENTER_OR_VIEWOFS(this), '0 0 0', 1);
361 }
362 }
363
364 if (this.buff_active)
365 {
366 if (this.team_forced && !this.buff_waypoint)
368
369 if (this.lifetime && time >= this.lifetime)
370 buff_Respawn(this);
371 }
372
373 this.nextthink = time;
374 //this.angles.y = time * 110.1;
375}
376
378{
379 if (this.targetname != "" && !(this.spawnflags & 16)) // q3compat
380 {
381 // buffs have no equivalent of Item_Show(this, -1)
382 this.effects = EF_NODRAW;
383 this.solid = SOLID_NOT; // u can't touch this
384 setorigin(this, this.origin); // unlink from the area grid
385 this.nextthink = 0;
386 if (this.buff_waypoint)
388 return;
389 }
390
391 if (autocvar_g_buffs_randomize & (teamplay ? 2 : 1))
392 buff_NewType(this);
393 this.owner = NULL;
396 if (this.buff_activetime)
398 this.buff_activetime_updated = false;
399
401 buff_Respawn(this);
402}
403
404bool buff_Customize(entity this, entity client)
405{
406 entity player = WaypointSprite_getviewentity(client);
407 if ((!this.buff_active || !this.buffdef) || (this.team_forced && player.team != this.team_forced))
408 {
409 this.alpha = 0.3;
410 if (this.effects & EF_FULLBRIGHT)
411 this.effects &= ~EF_FULLBRIGHT;
412 this.pflags = 0;
413 }
414 else
415 {
416 this.alpha = 1;
417 if (!(this.effects & EF_FULLBRIGHT))
418 this.effects |= EF_FULLBRIGHT;
419 this.light_lev = 220 + 36 * sin(time);
421 }
422 return true;
423}
424
426{
428 delete_fn(this);
429}
430
432{
433 if (!autocvar_g_buffs)
434 {
435 delete(this);
436 return;
437 }
438
439 entity buff = this.buffdef;
440
441 // item_buff_random provides a null type so force randomization in that case
442 // otherwise replace the buff type if it's unavailable and the option is enabled
443 if (!buff || (autocvar_g_buffs_replace_available && !buff_Available(buff)))
444 {
445 buff_NewType(this);
446 buff = this.buffdef;
447 }
448
449 // the buff type is still invalid or unavailable, simply delete the item
450 if (!buff || !buff_Available(buff))
451 {
452 delete(this);
453 return;
454 }
455
456 this.classname = "item_buff";
457 this.solid = SOLID_TRIGGER;
458 this.flags = FL_ITEM;
459 this.bot_pickup = true;
460 this.bot_pickupevalfunc = generic_pickupevalfunc;
461 this.bot_pickupbasevalue = 1000;
462 IL_PUSH(g_items, this);
463 setthink(this, buff_Think);
464 settouch(this, buff_Touch);
465 setmodel(this, MDL_BUFF);
466 setsize(this, ITEM_D_MINS, ITEM_L_MAXS);
467 this.reset = buff_Reset;
468 this.nextthink = time + 0.1;
469 this.gravity = 1;
471 this.scale = 1;
472 this.skin = buff.m_skin;
475 setcefc(this, buff_Customize);
476 //this.gravity = 100;
477 this.color = buff.m_color;
478 this.glowmod = buff.m_color;
480 this.buff_active = !this.buff_activetime;
482 this.dtor = buff_Delete;
483
484 if (!this.buffs_finished)
485 this.buffs_finished = this.count; // legacy support
486
487 if (this.spawnflags & 1)
488 this.noalign = true;
489 if (this.noalign)
490 set_movetype(this, MOVETYPE_NONE); // reset by random location
491
492 buff_Reset(this);
493}
494
495void buff_Init_Compat(entity ent, entity replacement)
496{
497 if (teamplay)
498 {
499 if (ent.spawnflags & 2)
500 ent.team_forced = NUM_TEAM_1;
501 else if (ent.spawnflags & 4)
502 ent.team_forced = NUM_TEAM_2;
503 }
504
505 ent.buffdef = replacement;
506
507 buff_Init(ent);
508}
509
511{
512 setorigin(ent, old.origin);
513 ent.angles = old.angles;
514 ent.noalign = ITEM_SHOULD_KEEP_POSITION(old);
515
516 buff_Init(ent);
517}
518
519METHOD(Buff, m_apply, void(StatusEffect this, entity actor, float eff_time, float eff_flags))
520{
521 if (IS_PLAYER(actor))
522 actor.effects |= EF_NOSHADOW; // does not play well with buff icon
523 SUPER(Buff).m_apply(this, actor, eff_time, eff_flags);
524}
525METHOD(Buff, m_remove, void(StatusEffect this, entity actor, int removal_type))
526{
527 bool was_active = actor.statuseffects && (actor.statuseffects.statuseffect_flags[this.m_id] & STATUSEFFECT_FLAG_ACTIVE);
528 if (was_active)
529 {
530 int buffid = this.m_id;
531 if (removal_type == STATUSEFFECT_REMOVE_TIMEOUT)
532 {
533 Send_Notification(NOTIF_ONE, actor, MSG_MULTI, ITEM_BUFF_DROP, buffid); // TODO: special timeout message?
534 sound(actor, CH_TRIGGER, SND_BUFF_LOST, VOL_BASE, ATTN_NORM);
535 }
536 else if (removal_type == STATUSEFFECT_REMOVE_NORMAL && !IS_INDEPENDENT_PLAYER(actor))
537 Send_Notification(NOTIF_ALL_EXCEPT, actor, MSG_INFO, INFO_ITEM_BUFF_LOST, actor.netname, buffid);
538 actor.buff_shield = time + max(0, autocvar_g_buffs_pickup_delay); // always put in a delay, even if small
539 }
540 if (IS_PLAYER(actor))
541 actor.effects &= ~EF_NOSHADOW;
542 SUPER(Buff).m_remove(this, actor, removal_type);
543}
544
545
546// mutator hooks
547MUTATOR_HOOKFUNCTION(buffs, Damage_Calculate)
548{
549 entity frag_attacker = M_ARGV(1, entity);
551 float frag_deathtype = M_ARGV(3, float);
552 float frag_damage = M_ARGV(4, float);
554
555 if (frag_deathtype == DEATH_BUFF_INFERNO.m_id
556 || frag_deathtype == DEATH_BUFF_VENGEANCE.m_id)
557 return; // no recurrence
558
559 if (StatusEffects_active(BUFF_RESISTANCE, frag_target))
561
562 if (StatusEffects_active(BUFF_MEDIC, frag_target)
563 && GetResource(frag_target, RES_HEALTH) - frag_damage <= 0
564 && !ITEM_DAMAGE_NEEDKILL(frag_deathtype)
565 && frag_attacker)
567
568 if (StatusEffects_active(BUFF_JUMP, frag_target))
570
571 if (StatusEffects_active(BUFF_VENGEANCE, frag_target)
572 && frag_attacker && frag_attacker != frag_target
573 && !ITEM_DAMAGE_NEEDKILL(frag_deathtype))
574 {
575 entity dmgent = new_pure(dmgent);
576
578 dmgent.enemy = frag_attacker;
579 dmgent.owner = frag_target;
581 dmgent.nextthink = time + 0.1;
582 }
583
584 if (StatusEffects_active(BUFF_BASH, frag_target))
586
587 if (StatusEffects_active(BUFF_BASH, frag_attacker))
589
590 if (StatusEffects_active(BUFF_DISABILITY, frag_attacker))
592
593 if (StatusEffects_active(BUFF_INFERNO, frag_target))
594 {
595 if (frag_deathtype == DEATH_FIRE.m_id)
596 frag_damage = 0;
597 if (frag_deathtype == DEATH_LAVA.m_id)
598 frag_damage *= 0.5; // TODO: cvarize?
599 }
600
601 if (frag_attacker != frag_target)
602 {
603 if (StatusEffects_active(BUFF_LUCK, frag_attacker))
605
606 if (StatusEffects_active(BUFF_INFERNO, frag_attacker))
607 {
609 Fire_AddDamage(frag_target, frag_attacker, buff_Inferno_CalculateDamage(frag_damage), btime, DEATH_BUFF_INFERNO.m_id);
610 }
611 }
612
613 M_ARGV(4, float) = frag_damage;
615}
616
618{
620 return;
621
622 entity player = M_ARGV(0, entity);
623
624 entity heldbuff = buff_FirstFromFlags(player);
625 if (heldbuff)
626 {
627 int buffid = heldbuff.m_id;
628 Send_Notification(NOTIF_ONE, player, MSG_MULTI, ITEM_BUFF_DROP, buffid);
629 if (!IS_INDEPENDENT_PLAYER(player))
630 Send_Notification(NOTIF_ALL_EXCEPT, player, MSG_INFO, INFO_ITEM_BUFF_LOST, player.netname, buffid);
631
633 player.buff_shield = time + max(0, autocvar_g_buffs_pickup_delay);
634 sound(player, CH_TRIGGER, SND_BUFF_LOST, VOL_BASE, ATTN_NORM);
635 return true;
636 }
637}
638
640{
642 return false;
643}
644MUTATOR_HOOKFUNCTION(buffs, MakePlayerObserver)
645{
646 entity player = M_ARGV(0, entity);
647 return buffs_RemovePlayer(player);
648}
650{
651 entity player = M_ARGV(0, entity);
652 return buffs_RemovePlayer(player);
653}
654
655MUTATOR_HOOKFUNCTION(buffs, FilterItem)
656{
657 if (autocvar_g_buffs < 0)
658 return false; // no auto replacing of entities in this mode
659
660 entity item = M_ARGV(0, entity);
661
662 if (autocvar_g_buffs_replace_powerups && item.itemdef.instanceOfPowerup)
663 {
664 entity e = spawn();
665 buff_SpawnReplacement(e, item);
666 return true;
667 }
668
669 return false;
670}
671
673{
674 entity player = M_ARGV(0, entity);
675
676 if (game_stopped || IS_DEAD(player) || !IS_PLAYER(player))
677 return;
678
679 // NOTE: this is kept here to ensure crouches are picked up each player movement frame
680 if (StatusEffects_active(BUFF_FLIGHT, player))
681 {
682 if (!PHYS_INPUT_BUTTON_CROUCH(player))
683 player.buff_flight_crouchheld = false;
684 else if (!player.buff_flight_crouchheld)
685 {
686 player.buff_flight_crouchheld = true;
687 player.gravity *= -1;
688 }
689 }
690
691 if (IS_PLAYER(player))
693}
694
695MUTATOR_HOOKFUNCTION(buffs, BuildMutatorsString)
696{
697 if (autocvar_g_buffs > 0) // only report as a mutator if they're enabled
698 M_ARGV(0, string) = strcat(M_ARGV(0, string), ":Buffs");
699}
700
701MUTATOR_HOOKFUNCTION(buffs, BuildMutatorsPrettyString)
702{
703 if (autocvar_g_buffs > 0)
704 M_ARGV(0, string) = strcat(M_ARGV(0, string), ", Buffs");
705}
706
708{
710 if (find(NULL, classname, "item_buff") == NULL)
711 for (int i = 0; i < autocvar_g_buffs_spawn_count; ++i)
712 {
713 entity e = spawn();
714 e.spawnflags |= 64; // always randomize
715 e.velocity = randomvec() * 250; // this gets reset anyway if random location works
716 buff_Init(e);
717 }
718}
719
721{
722 // if buffs are above 0, allow random spawning
723 if (autocvar_g_buffs > 0 && autocvar_g_buffs_spawn_count > 0)
725}
float bot_pickup
Definition api.qh:43
const int CBC_ORDER_FIRST
Definition base.qh:10
#define MUTATOR_CALLHOOK(id,...)
Definition base.qh:143
#define MUTATOR_HOOKFUNCTION(...)
Definition base.qh:335
#define MUTATOR_RETURNVALUE
Definition base.qh:328
vector buff_Bash_AttackerCalculateForce(vector frag_force, entity frag_target, entity frag_attacker)
Definition bash.qc:10
vector buff_Bash_TargetCalculateForce(vector frag_force, entity frag_target, entity frag_attacker)
Definition bash.qc:4
float bot_pickupbasevalue
Definition bot.qh:68
int team_forced
Definition buffs.qh:59
entity buffdef
Definition buffs.qh:58
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
Definition buffs.qh:17
float lifetime
Definition powerups.qc:23
float count
Definition powerups.qc:22
float alpha
Definition items.qc:13
float gravity
Definition items.qh:17
entity owner
Definition main.qh:87
int spawnflags
Definition ammo.qh:15
float buffs_finished
Definition item.qh:95
const int IT_UNLIMITED_AMMO
Definition item.qh:23
const vector ITEM_L_MAXS
Definition item.qh:84
const vector ITEM_D_MINS
Definition item.qh:82
#define setmodel(this, m)
Definition model.qh:26
#define M_ARGV(x, type)
Definition events.qh:17
#define PHYS_INPUT_BUTTON_CROUCH(s)
Definition player.qh:156
#define IS_DEAD(s)
Definition player.qh:244
#define IS_PLAYER(s)
Definition player.qh:242
float game_starttime
Definition stats.qh:82
float game_stopped
Definition stats.qh:81
const int INITPRIO_FINDTARGET
Definition constants.qh:88
#define EFMASK_CHEAP
Definition constants.qh:100
const int FL_ITEM
Definition constants.qh:69
string classname
float Q3SURFACEFLAG_SKY
float flags
float DPCONTENTS_SKY
const float MOVE_NOMONSTERS
const float EF_STARDUST
const float SOLID_TRIGGER
float DPCONTENTS_DONOTENTER
float DPCONTENTS_SOLID
float frametime
float DPCONTENTS_CORPSE
vector mins
vector velocity
float DPCONTENTS_BODY
const float EF_FULLBRIGHT
const float SOLID_NOT
float effects
float DPCONTENTS_PLAYERCLIP
float DPCONTENTS_SLIME
float time
vector trace_endpos
vector maxs
float nextthink
vector origin
float DPCONTENTS_LAVA
float solid
const float ATTN_NORM
const float EF_NOSHADOW
const float EF_NODRAW
float dphitcontentsmask
const float PFLAGS_FULLDYNAMIC
#define spawn
vector glowmod
float Fire_AddDamage(entity e, entity o, float d, float t, float dt)
Definition damage.qc:960
void buff_Disability_ApplyStunned(entity frag_target, entity frag_attacker)
Definition disability.qc:4
float pflags
float EF_LOWPRECISION
float light_lev
Definition dynlight.qc:13
vector color
Definition dynlight.qc:15
int m_id
Definition effect.qh:18
void Send_Effect_Core(entity eff, vector eff_loc, vector eff_vel, int eff_cnt, vector eff_col_min, vector eff_col_max, float eff_alpha_min, float eff_alpha_max, float eff_alpha_fade, entity ignore)
Definition all.qc:74
void Send_Effect(entity eff, vector eff_loc, vector eff_vel, int eff_cnt)
Definition all.qc:155
ent angles
Definition ent_cs.qc:146
skin
Definition ent_cs.qc:168
float buff_Inferno_CalculateTime(float dmg)
Definition inferno.qc:4
float buff_Inferno_CalculateDamage(float frag_damage)
Definition inferno.qc:19
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
#define ITEM_SHOULD_KEEP_POSITION(item)
Returns whether item should keep its position or be dropped to the ground.
Definition spawning.qh:52
#define FOREACH(list, cond, body)
Definition iter.qh:19
float buff_Jump_ChangeDamage(float frag_damage, float frag_deathtype)
Definition jump.qc:4
#define PlayerPreThink
Definition _all.inc:258
#define ClientDisconnect
Definition _all.inc:246
#define STAT(...)
Definition stats.qh:94
float buff_Luck_CalculateDamage(float frag_damage)
Definition luck.qc:4
float buff_Medic_CalculateSurviveDamage(float frag_damage, float health)
Definition medic.qc:16
float cvar(string name)
entity find(entity start,.string field, string match)
vector randomvec(void)
float sin(float f)
float max(float f,...)
void set_movetype(entity this, int mt)
Definition movetypes.qc:4
const int MOVETYPE_NONE
Definition movetypes.qh:133
const int MOVETYPE_TOSS
Definition movetypes.qh:139
@ STATUSEFFECT_REMOVE_CLEAR
Effect is being forcibly removed without calling any additional mechanics.
Definition all.qh:30
@ STATUSEFFECT_REMOVE_NORMAL
Effect is being removed by a function, calls regular removal mechanics.
Definition all.qh:28
@ STATUSEFFECT_REMOVE_TIMEOUT
Definition all.qh:29
@ STATUSEFFECT_FLAG_ACTIVE
Definition all.qh:22
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))
void Send_Notification(NOTIF broadcast, entity client, MSG net_type, Notification net_name,...count)
Definition all.qc:1500
#define SUPER(cname)
Definition oo.qh:236
#define new_pure(class)
purely logical entities (not linked to the area grid)
Definition oo.qh:66
#define METHOD(cname, name, prototype)
Definition oo.qh:274
#define NULL
Definition post.qh:14
#define makevectors
Definition post.qh:21
float scale
Definition projectile.qc:14
ERASEABLE void RandomSelection_Init()
Definition random.qc:4
#define RandomSelection_AddEnt(e, weight, priority)
Definition random.qh:14
entity RandomSelection_chosen_ent
Definition random.qh:5
float buff_Resistance_CalculateDamage(float frag_damage)
Definition resistance.qc:4
#define round_handler_IsActive()
#define round_handler_IsRoundStarted()
#define setthink(e, f)
vector
Definition self.qh:96
#define setcefc(e, f)
entity entity toucher
Definition self.qh:76
#define settouch(e, f)
Definition self.qh:77
void PlayerUseKey(entity this)
Definition client.qc:2631
#define IS_INDEPENDENT_PLAYER(e)
Definition client.qh:312
float generic_pickupevalfunc(entity player, entity item)
Definition items.qc:885
IntrusiveList g_items
Definition items.qh:119
#define ITEM_TOUCH_NEEDKILL()
Definition items.qh:122
#define ITEM_DAMAGE_NEEDKILL(dt)
Definition items.qh:123
bool noalign
Definition items.qh:37
entity SelectSpawnPoint(entity this, bool anypoint)
const int CH_TRIGGER
Definition sound.qh:12
const float VOL_BASE
Definition sound.qh:36
const float ATTEN_NONE
Definition sound.qh:27
#define sound(e, c, s, v, a)
Definition sound.qh:52
#define CS_CVAR(this)
Definition state.qh:51
bool StatusEffects_active(StatusEffect this, entity actor)
void StatusEffects_apply(StatusEffect this, entity actor, float eff_time, int eff_flags)
void buff_Think(entity this)
Definition sv_buffs.qc:300
void buffs_BuffModel_Think(entity this)
Definition sv_buffs.qc:39
void buff_Delete(entity this)
Definition sv_buffs.qc:425
void buff_NewType(entity ent)
Definition sv_buffs.qc:269
void buffs_Initialize()
Definition sv_buffs.qc:720
void buff_Init(entity this)
Definition sv_buffs.qc:431
void buff_SpawnReplacement(entity ent, entity old)
Definition sv_buffs.qc:510
bool buffs_RemovePlayer(entity player)
Definition sv_buffs.qc:639
bool buffs_BuffModel_Customize(entity this, entity client)
Definition sv_buffs.qc:10
entity buff_FirstFromFlags(entity actor)
Definition sv_buffs.qc:292
int buff_seencount
Definition sv_buffs.qc:267
bool buff_Waypoint_visible_for_player(entity this, entity player, entity view)
Definition sv_buffs.qc:119
float buff_Available(entity buff)
Definition sv_buffs.qc:256
void buff_Effect(entity player, entity eff, vector eff_loc, vector eff_vel, int eff_cnt, bool hide)
Spawn effects on a player with a buff.
Definition sv_buffs.qc:103
void buffs_DelayedInit(entity this)
Definition sv_buffs.qc:707
void buff_SetCooldown(entity this, float cd)
Definition sv_buffs.qc:143
void buff_RemoveAll(entity actor, int removal_type)
Definition sv_buffs.qc:285
void buff_Init_Compat(entity ent, entity replacement)
Definition sv_buffs.qc:495
void buff_Reset(entity this)
Definition sv_buffs.qc:377
bool buff_Customize(entity this, entity client)
Definition sv_buffs.qc:404
void buffs_BuffModel_Spawn(entity player)
Definition sv_buffs.qc:77
void buff_Respawn(entity this)
Definition sv_buffs.qc:156
void buff_Touch(entity this, entity toucher)
Definition sv_buffs.qc:192
void buffs_BuffModel_Remove(entity player)
Definition sv_buffs.qc:70
void buff_Waypoint_Spawn(entity e)
Definition sv_buffs.qc:131
void buffs_BuffModel_Update(entity this)
Definition sv_buffs.qc:94
float autocvar_g_buffs_cooldown_activate
Definition sv_buffs.qh:31
float buff_activetime
Definition sv_buffs.qh:39
entity buff_model
Definition sv_buffs.qh:44
int autocvar_g_buffs_randomize
Definition sv_buffs.qh:23
entity oldbuffs
Definition sv_buffs.qh:42
bool buff_activetime_updated
Definition sv_buffs.qh:40
int autocvar_g_buffs_random_location_attempts
Definition sv_buffs.qh:26
bool autocvar_g_buffs_pickup_anyway
Definition sv_buffs.qh:21
entity buff_waypoint
Definition sv_buffs.qh:41
bool autocvar_g_buffs_replace_available
Definition sv_buffs.qh:29
bool autocvar_g_buffs_effects
Definition sv_buffs.qh:19
int autocvar_g_buffs_spawn_count
Definition sv_buffs.qh:27
float autocvar_g_buffs_cooldown_respawn
Definition sv_buffs.qh:32
bool autocvar_g_buffs_random_location
Definition sv_buffs.qh:25
float autocvar_g_buffs_pickup_delay
Definition sv_buffs.qh:22
bool buff_active
Definition sv_buffs.qh:38
bool autocvar_g_buffs_replace_powerups
Definition sv_buffs.qh:28
float autocvar_g_buffs_waypoint_distance
Definition sv_buffs.qh:20
bool autocvar_g_buffs_drop
Definition sv_buffs.qh:30
float autocvar_g_buffs_random_lifetime
Definition sv_buffs.qh:24
float frag_damage
Definition sv_ctf.qc:2316
vector frag_force
Definition sv_ctf.qc:2317
entity frag_target
Definition sv_ctf.qc:2315
var void delete_fn(entity e)
const int NUM_TEAM_2
Definition teams.qh:14
bool teamplay
Definition teams.qh:59
#define DIFF_TEAM(a, b)
Definition teams.qh:242
const int NUM_TEAM_1
Definition teams.qh:13
string targetname
Definition triggers.qh:56
#define CENTER_OR_VIEWOFS(ent)
Definition utils.qh:31
void buff_Vengeance_DelayedDamage(entity this)
Definition vengeance.qc:4
float buff_Vengeance_CalculateDamage(float frag_damage)
Definition vengeance.qc:15
void WaypointSprite_Kill(entity wp)
void WaypointSprite_UpdateTeamRadar(entity e, entity icon, vector col)
void WaypointSprite_Ping(entity e)
entity WaypointSprite_Spawn(entity spr, float _lifetime, float maxdistance, entity ref, vector ofs, entity showto, float t, entity own,.entity ownfield, float hideable, entity icon)
bool WaypointSprite_visible_for_player(entity this, entity player, entity view)
entity WaypointSprite_getviewentity(entity e)
void WaypointSprite_UpdateBuildFinished(entity e, float f)
float MoveToRandomMapLocation(entity e, float goodcontents, float badcontents, float badsurfaceflags, float attempts, float maxaboveground, float minviewdistance)
Definition world.qc:1249
void InitializeEntity(entity e, void(entity this) func, int order)
Definition world.qc:2227
int start_items
Definition world.qh:83