Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
sv_tka.qc
Go to the documentation of this file.
1#include "sv_tka.qh"
2
5
6.entity ballcarried;
7.entity previous_owner; // also used on kh keys
8
16
27
28bool tka_ballcarrier_waypointsprite_visible_for_player(entity this, entity player, entity view) // runs on waypoints which are attached to ballcarriers, updates once per frame
29{
30 if(view.ballcarried && IS_SPEC(player))
31 return false; // we don't want spectators of the ballcarrier to see the attached waypoint on the top of their screen
32 if(IS_SPEC(player) || warmup_stage || SAME_TEAM(player, this.owner))
33 return true;
34 if(IS_INVISIBLE(this.owner))
35 return false; // hide the waypointsprite if the owner is invisible
36
38}
39
40void tka_EventLog(string mode, entity actor) // use an alias for easy changing and quick editing later
41{
43 GameLogEcho(strcat(":tka:", mode, ((actor != NULL) ? (strcat(":", ftos(actor.team), ":", ftos(actor.playerid))) : "")));
44}
45
47void tka_RespawnBall(entity this) // runs whenever the ball needs to be relocated
48{
49 if(game_stopped) return;
50 vector oldballorigin = this.origin;
51
53 setorigin(this, SelectSpawnPoint(this, true).origin);
54
56 this.velocity = '0 0 200';
57 this.angles = '0 0 0';
62
63 Send_Effect(EFFECT_KA_BALL_RESPAWN, oldballorigin, '0 0 0', 1);
64 Send_Effect(EFFECT_KA_BALL_RESPAWN, this.origin, '0 0 0', 1);
65
67 {
68 WaypointSprite_Spawn(WP_KaBall, 0, 0, this, '0 0 64', NULL, this.team, this, waypointsprite_attachedforcarrier, false, RADARICON_FLAGCARRIER);
70 }
71
72 sound(this, CH_TRIGGER, SND_KA_RESPAWN, VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere)
73}
74
75// field where the decimal part of SCORE is accumulated (shared with other gametypes)
77MUTATOR_HOOKFUNCTION(tka, reset_map_global)
78{
79 FOREACH_CLIENT(true,
80 {
81 it.float2int_decimal_fld = 0;
82 });
83 return true;
84}
85
88{
91 GameRules_scoring_add(this.owner, TKA_BCTIME, frametime);
92
93 this.nextthink = time;
94
95 // animate, this is ~copied from KH
96#define BALL_XYSPEED 100 // KH 45
97#define BALL_XYDIST 24 // KH 24
98 makevectors(vec3(0, (360 * this.cnt / this.owner.ballcarried.cnt) + (time % 360) * BALL_XYSPEED, 0));
99 setorigin(this, vec3(v_forward.x * BALL_XYDIST, v_forward.y * BALL_XYDIST, this.origin.z));
100
101 // sync any invisibility effect
102 this.alpha = this.owner.alpha;
103}
104
105void tka_TouchEvent(entity this, entity toucher) // runs any time that the ball comes in contact with something
106{
107 if (!this || game_stopped)
108 return;
109
111 { // The ball fell off the map, respawn it since players can't get to it
112 tka_RespawnBall(this);
113 return;
114 }
115 if(IS_INDEPENDENT_PLAYER(toucher)) { return; }
116 if(IS_DEAD(toucher)) { return; }
117 if (!IS_PLAYER(toucher))
118 { // The ball just touched an object, most likely the world
119 Send_Effect(EFFECT_BALL_SPARKS, this.origin, '0 0 0', 1);
120 sound(this, CH_TRIGGER, SND_KA_TOUCH, VOL_BASE, ATTEN_NORM);
121 return;
122 }
123 else if(this.wait > time && this.previous_owner == toucher)
124 return;
125
126 if (toucher.ballcarried) // multiple balls exist
127 {
128 if (toucher.ballcarried.cnt >= autocvar_g_tka_ballcarrier_maxballs)
129 return;
130 this.ballcarried = toucher.ballcarried; // new ball will be inserted at start of chain
131 this.cnt = toucher.ballcarried.cnt + 1; // for orbit animation offset
132 }
133 else
134 this.cnt = 1;
135
136 // attach the ball to the player
137 this.owner = toucher;
138 toucher.ballcarried = this;
140 setattachment(this, toucher, "");
141 this.solid = SOLID_NOT; // before setorigin to ensure area grid unlinking
142 setorigin(this, '0 0 0');
143
144 // make the ball unable to do anything, set up time scoring
145 this.velocity = '0 0 0';
147 this.scale = 12/16; // somewhat smaller while carried
149 this.nextthink = time;
150 this.takedamage = DAMAGE_NO;
152
153 // messages and sounds
154 tka_EventLog("pickup", toucher);
155 Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_KEEPAWAY_PICKUP, toucher.netname);
156 Send_Notification(NOTIF_ALL_EXCEPT, toucher, MSG_CENTER, CENTER_KEEPAWAY_PICKUP, toucher.netname);
157 Send_Notification(NOTIF_ONE, toucher, MSG_CENTER, CENTER_KEEPAWAY_PICKUP_SELF);
158 sound(this.owner, CH_TRIGGER, SND_KA_PICKEDUP, VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere)
159
160 // scoring
161 GameRules_scoring_add(toucher, TKA_PICKUPS, 1);
162
163 // waypoints
164 WaypointSprite_AttachCarrier(WP_Null, toucher, RADARICON_FLAGCARRIER);
165 toucher.waypointsprite_attachedforcarrier.colormod = colormapPaletteColor(toucher.team - 1, 0);
166 toucher.waypointsprite_attachedforcarrier.waypointsprite_visible_for_player = tka_ballcarrier_waypointsprite_visible_for_player;
167 WaypointSprite_UpdateRule(toucher.waypointsprite_attachedforcarrier, toucher.team, SPRITERULE_TEAMPLAY);
168 if(toucher.team == NUM_TEAM_1)
169 WaypointSprite_UpdateSprites(toucher.waypointsprite_attachedforcarrier, WP_TkaBallCarrierRed, WP_KaBallCarrier, WP_TkaBallCarrierRed);
170 else if(toucher.team == NUM_TEAM_2)
171 WaypointSprite_UpdateSprites(toucher.waypointsprite_attachedforcarrier, WP_TkaBallCarrierBlue, WP_KaBallCarrier, WP_TkaBallCarrierBlue);
172 else if(toucher.team == NUM_TEAM_3)
173 WaypointSprite_UpdateSprites(toucher.waypointsprite_attachedforcarrier, WP_TkaBallCarrierYellow, WP_KaBallCarrier, WP_TkaBallCarrierYellow);
174 else if(toucher.team == NUM_TEAM_4)
175 WaypointSprite_UpdateSprites(toucher.waypointsprite_attachedforcarrier, WP_TkaBallCarrierPink, WP_KaBallCarrier, WP_TkaBallCarrierPink);
176 WaypointSprite_Ping(toucher.waypointsprite_attachedforcarrier);
178}
179
181{
182 player.ballcarried = NULL;
183 GameRules_scoring_vip(player, false);
184 WaypointSprite_Kill(player.waypointsprite_attachedforcarrier);
185}
186
187void tka_DropEvent(entity player) // runs any time that a player is supposed to lose the ball
188{
189 entity ball = player.ballcarried;
190
191 if(!ball) { return; }
192
193 // reset the ball
194 setattachment(ball, NULL, "");
196 ball.previous_owner = player;
197 ball.wait = time + 0.5; // same as for thrown weapons
199 ball.nextthink = time + autocvar_g_tkaball_respawntime;
200 ball.takedamage = DAMAGE_YES;
201 ball.scale = 1; // it's smaller while carried
202 ball.alpha = 1; // in case the carrier had an invisibility effect
203 ball.solid = SOLID_TRIGGER; // before setorigin to ensure area grid linking
204 setorigin(ball, player.origin + ball.origin + '0 0 10'); // include attachment offset to reduce jump
205 nudgeoutofsolid_OrFallback(ball); // a ball has a horizontally bigger bbox than a player
206 ball.velocity = '0 0 200' + '0 100 0'*crandom() + '100 0 0'*crandom();
207 ball.owner = NULL;
208 navigation_dynamicgoal_set(ball, player);
209
210 // messages and sounds
211 tka_EventLog("dropped", player);
212 Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_KEEPAWAY_DROPPED, player.netname);
213 Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_KEEPAWAY_DROPPED, player.netname);
214 sound(NULL, CH_TRIGGER, SND_KA_DROPPED, VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere)
215
216 // waypoints
218 {
219 WaypointSprite_Spawn(WP_KaBall, 0, 0, ball, '0 0 64', NULL, ball.team, ball, waypointsprite_attachedforcarrier, false, RADARICON_FLAGCARRIER);
220 WaypointSprite_UpdateRule(ball.waypointsprite_attachedforcarrier, 0, SPRITERULE_DEFAULT);
221 WaypointSprite_Ping(ball.waypointsprite_attachedforcarrier);
222 }
223
224 if (ball.ballcarried) // >1 ball was chained, first one was just dropped
225 {
226 player.ballcarried = ball.ballcarried; // move the next one up
227 ball.ballcarried = NULL; // prevent infinite loop
228 }
229 else // no balls remaining so remove bc status
230 tka_PlayerReset(player);
231}
232
234
235MODEL(TKA_BALL, "models/orbs/orbblue.md3");
236
238{
239 IL_EACH(g_tkaballs, true,
240 {
241 if (it.owner) // it was attached
242 tka_PlayerReset(it.owner);
243 else
245 delete(it);
246 });
247}
248
250{
251 int i = 0;
252 do // never allow less than 1 ball to spawn
253 {
254 entity e = new(keepawayball);
255 setmodel(e, MDL_TKA_BALL);
256 // 20 20 20 was too big, player is only 16 16 24... gotta cheat with the Z (20) axis so that the particle isn't cut off
257 // bones_was_here: that was WITH sv_legacy_bbox_expand 1 and FL_ITEM (mins -= '15 15 1'; maxs += '15 15 1')
258 // it's round so should have a symmetrical bbox, same height as pickup items so it can't be jumped over in any physics
259 setsize(e, '-24 -24 -24', '24 24 24');
260 e.damageforcescale = autocvar_g_tkaball_damageforcescale;
261 e.takedamage = DAMAGE_YES;
262 e.solid = SOLID_TRIGGER;
264 e.glow_color = autocvar_g_tkaball_trail_color;
265 e.glow_trail = true;
266 e.flags = FL_ITEM;
267 IL_PUSH(g_items, e);
268 e.pushable = true;
270 e.owner = NULL;
273
275
276 ++i;
277 }
278 while (i < autocvar_g_tkaball_count);
279}
280
282{
283 if(time < game_starttime)
284 {
285 if (!IL_EMPTY(g_tkaballs))
287 }
288 else
289 {
290 if (IL_EMPTY(g_tkaballs))
292 }
293
294 this.nextthink = time;
295}
296
297
298// ================
299// Bot player logic
300// ================
301
303{
304 entity ball_wp = e.waypointsprite_attachedforcarrier;
305 if (!ball_wp)
306 if (dropped || !ball_wp.waypointsprite_visible_for_player(ball_wp, this, WaypointSprite_getviewentity(this)))
307 { // has no waypoint, or waypoint not visible
308 if (!checkpvs(this.origin + this.view_ofs, e)) // ball cannot be seen
309 return false;
310 }
311 return true;
312}
313
314void havocbot_goalrating_tkaball(entity this, float ratingscale, float ratingscale_sameteam, vector org)
315{
316 entity ball = NULL, ball_carried = NULL;
317
318 // stops at last ball, prefers ball without carrier
319 IL_EACH(g_tkaballs, it.owner != this,
320 {
321 if (it.owner)
322 {
323 if (!tka_waypointsprite_visible_for_bot(this, it.owner, false))
324 continue;
325 ball_carried = it.owner;
326 }
327 else
328 {
329 if (!tka_waypointsprite_visible_for_bot(this, it, true))
330 continue;
331 ball = it;
332 }
333 });
334
335 if (ball)
336 navigation_routerating(this, ball, ratingscale, 2000);
337 else if (ball_carried)
338 {
339 if (DIFF_TEAM(ball_carried, this))
340 navigation_routerating(this, ball_carried, ratingscale, 2000);
341 else
342 navigation_routerating(this, ball_carried, ratingscale_sameteam, 2000);
343 }
344}
345
347{
348 if (IS_DEAD(this))
349 return;
350
352 {
354 havocbot_goalrating_items(this, 10000, this.origin, 10000);
355 havocbot_goalrating_enemyplayers(this, 10000, this.origin, 10000);
356 havocbot_goalrating_waypoints(this, 1, this.origin, 3000);
358
360 }
361
362 if (!this.ballcarried)
363 {
364 this.havocbot_role = havocbot_role_tka_collector;
366 }
367}
368
370{
371 if (IS_DEAD(this))
372 return;
373
375 {
377 havocbot_goalrating_items(this, 10000, this.origin, 10000);
378 havocbot_goalrating_enemyplayers(this, 500, this.origin, 10000);
379 havocbot_goalrating_tkaball(this, 8000, 4000, this.origin);
381
383 }
384
385 if (this.ballcarried)
386 {
387 this.havocbot_role = havocbot_role_tka_carrier;
389 }
390}
391
392
393// ==============
394// Hook Functions
395// ==============
396
397MUTATOR_HOOKFUNCTION(tka, PlayerDies)
398{
399 entity frag_attacker = M_ARGV(1, entity);
401
402 if(frag_attacker != frag_target && IS_PLAYER(frag_attacker) && DIFF_TEAM(frag_attacker, frag_target))
403 {
404 bool team_has_ball = false;
405 IL_EACH(g_tkaballs, it.owner != frag_attacker && SAME_TEAM(it.owner, frag_attacker),
406 {
407 team_has_ball = true;
408 break;
409 });
410 if(frag_target.ballcarried) // add to amount of times killing carrier
411 {
412 GameRules_scoring_add(frag_attacker, TKA_CARRIERKILLS, 1);
413 if(autocvar_g_tka_score_bckill) // add bckills to the score
415 }
416 else if(!frag_attacker.ballcarried && !(autocvar_g_tka_score_team && team_has_ball))
417 {
419 Send_Notification(NOTIF_ONE_ONLY, frag_attacker, MSG_CENTER, CENTER_KEEPAWAY_WARN);
420 }
421
422 if(frag_attacker.ballcarried || (autocvar_g_tka_score_team && team_has_ball)) // add to amount of kills while ballcarrier (or if team scoring is enabled)
424 }
425
426 while (frag_target.ballcarried)
427 tka_DropEvent(frag_target); // a player with ball(s) has died, drop them
428}
429
430MUTATOR_HOOKFUNCTION(tka, GiveFragsForKill)
431{
432 M_ARGV(2, float) = 0; // no frags counted in keepaway
433 return true; // you deceptive little bugger ;3 This needs to be true in order for this function to even count.
434}
435
436MUTATOR_HOOKFUNCTION(tka, Scores_CountFragsRemaining)
437{
438 // announce remaining frags, but only when timed scoring is off
440}
441
443{
444 entity player = M_ARGV(0, entity);
445
446 // clear the item used for the ball in keepaway
447 STAT(TKA_BALLSTATUS, player) = 0;
448
449 // if the player has the ball, make sure they have the item for it (Used for HUD primarily)
450 if(player.ballcarried)
451 STAT(TKA_BALLSTATUS, player) |= TKA_BALL_CARRYING;
452
453 IL_EACH(g_tkaballs, true,
454 {
455 if(!it.owner)
456 STAT(TKA_BALLSTATUS, player) |= TKA_BALL_DROPPED;
457 else
458 {
459 // TODO: teamless carrier?
460 switch(it.owner.team)
461 {
462 case NUM_TEAM_1: STAT(TKA_BALLSTATUS, player) |= TKA_BALL_TAKEN_RED; break;
463 case NUM_TEAM_2: STAT(TKA_BALLSTATUS, player) |= TKA_BALL_TAKEN_BLUE; break;
464 case NUM_TEAM_3: STAT(TKA_BALLSTATUS, player) |= TKA_BALL_TAKEN_YELLOW; break;
465 case NUM_TEAM_4: STAT(TKA_BALLSTATUS, player) |= TKA_BALL_TAKEN_PINK; break;
466 }
467 }
468 });
469}
470
472{
473 entity player = M_ARGV(0, entity);
474
475 if(MUTATOR_RETURNVALUE == 0)
476 if(player.ballcarried)
477 {
478 tka_DropEvent(player);
479 return true;
480 }
481}
482
483MUTATOR_HOOKFUNCTION(tka, Damage_Calculate) // for changing damage and force values that are applied to players
484{
485 entity frag_attacker = M_ARGV(1, entity);
487
488 // as a gametype rule, only apply scaling to player versus player combat
489 if (!IS_PLAYER(frag_attacker) || !IS_PLAYER(frag_target))
490 return;
491
492 if (frag_attacker.ballcarried) // if the attacker is a ballcarrier
493 {
494 if (frag_target == frag_attacker) // damage done to themselves
495 {
498 }
499 else if (frag_target.ballcarried) // damage done to other ballcarriers
500 {
503 }
504 else // damage done to noncarriers
505 {
508 }
509 }
510 else
511 {
512 if (frag_target == frag_attacker) // damage done to themselves
513 {
516 }
517 else if (frag_target.ballcarried) // damage done to ballcarriers
518 {
521 }
522 else // damage done to other noncarriers
523 {
526 }
527 }
528}
529
531{
532 entity player = M_ARGV(0, entity);
533
534 while (player.ballcarried)
535 tka_DropEvent(player); // a player with ball(s) has left the match, drop them
536}
537
538MUTATOR_HOOKFUNCTION(tka, MakePlayerObserver)
539{
540 entity player = M_ARGV(0, entity);
541
542 while (player.ballcarried)
543 tka_DropEvent(player); // a player with ball(s) has left the match, drop them
544}
545
546MUTATOR_HOOKFUNCTION(tka, PlayerPowerups)
547{
548// entity player = M_ARGV(0, entity);
549
550 // In the future this hook is supposed to allow me to do some extra stuff with waypointsprites and invisibility powerup
551 // So bare with me until I can fix a certain bug with tka_ballcarrier_waypointsprite_visible_for_player()
552}
553
554
555MUTATOR_HOOKFUNCTION(tka, PlayerPhysics_UpdateStats)
556{
557 entity player = M_ARGV(0, entity);
558 // these automatically reset, no need to worry
559
560 if(player.ballcarried)
561 STAT(MOVEVARS_HIGHSPEED, player) *= autocvar_g_tka_ballcarrier_highspeed;
562}
563
564MUTATOR_HOOKFUNCTION(tka, Bot_ForbidAttack)
565{
566 entity bot = M_ARGV(0, entity);
567 entity targ = M_ARGV(1, entity);
568
569 // if neither player has ball then don't attack unless the ball is on the ground
570 bool have_held_ball = false, team_has_ball = false;
571 IL_EACH(g_tkaballs, it.owner,
572 {
573 have_held_ball = true;
574 if(SAME_TEAM(bot, it.owner))
575 team_has_ball = true;
576 });
577
578 if(!targ.ballcarried && !bot.ballcarried && have_held_ball && !(autocvar_g_tka_score_team && team_has_ball))
579 return true;
580}
581
582MUTATOR_HOOKFUNCTION(tka, HavocBot_ChooseRole)
583{
584 entity bot = M_ARGV(0, entity);
585
586 if (bot.ballcarried)
587 bot.havocbot_role = havocbot_role_tka_carrier;
588 else
589 bot.havocbot_role = havocbot_role_tka_collector;
590 return true;
591}
592
593MUTATOR_HOOKFUNCTION(tka, DropSpecialItems)
594{
596
597 while (frag_target.ballcarried)
599}
600
602{
603 entity spectatee = M_ARGV(0, entity);
604 entity client = M_ARGV(1, entity);
605
606 STAT(TKA_BALLSTATUS, client) = STAT(TKA_BALLSTATUS, spectatee);
607}
608
610{
611 M_ARGV(0, float) = tka_teams;
612 return true;
613}
614
615MUTATOR_HOOKFUNCTION(tka, PreferPlayerScore_Clear)
616{
617 return true;
618}
619
620void tka_Initialize()
621{
623 if(tka_teams < 2)
624 tka_teams = cvar("g_tka_teams"); // read the cvar directly as it gets written earlier in the same frame
625 tka_teams = BITS(bound(2, tka_teams, 4));
627 field(SP_TKA_PICKUPS, "pickups", 0);
628 field(SP_TKA_CARRIERKILLS, "bckills", 0);
629 field(SP_TKA_BCTIME, "bctime", SFL_SORT_PRIO_SECONDARY);
630 });
631
632 g_tkaballs = IL_NEW();
633 entity tka_Handler = new_pure(tka_Handler);
634 setthink(tka_Handler, tka_Handler_CheckBall);
636}
void havocbot_goalrating_waypoints(entity this, float ratingscale, vector org, float sradius)
Definition roles.qc:16
void navigation_goalrating_start(entity this)
void navigation_goalrating_timeout_set(entity this)
Definition navigation.qc:20
bool navigation_goalrating_timeout(entity this)
Definition navigation.qc:44
void navigation_dynamicgoal_init(entity this, bool initially_static)
Definition navigation.qc:77
void navigation_routerating(entity this, entity e, float f, float rangebias)
void navigation_dynamicgoal_set(entity this, entity dropper)
Definition navigation.qc:87
void navigation_goalrating_timeout_expire(entity this, float seconds)
Definition navigation.qc:36
void navigation_goalrating_end(entity this)
void navigation_dynamicgoal_unset(entity this)
Definition navigation.qc:96
#define MUTATOR_HOOKFUNCTION(...)
Definition base.qh:335
const int CBC_ORDER_EXCLUSIVE
Definition base.qh:12
#define MUTATOR_RETURNVALUE
Definition base.qh:328
#define BITS(n)
Definition bits.qh:9
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
float cnt
Definition powerups.qc:24
bool pushable
Definition items.qc:14
float alpha
Definition items.qc:13
float wait
Definition items.qc:17
entity owner
Definition main.qh:87
bool warmup_stage
Definition main.qh:120
int team
Definition main.qh:188
#define colormapPaletteColor(c, isPants)
Definition color.qh:5
#define setmodel(this, m)
Definition model.qh:26
#define M_ARGV(x, type)
Definition events.qh:17
#define IS_DEAD(s)
Definition player.qh:244
#define IS_PLAYER(s)
Definition player.qh:242
const int SFL_SORT_PRIO_SECONDARY
Scoring priority (NOTE: PRIMARY is used for fraglimit) NOTE: SFL_SORT_PRIO_SECONDARY value must be lo...
Definition scores.qh:133
const int SFL_SORT_PRIO_PRIMARY
Definition scores.qh:134
float game_starttime
Definition stats.qh:82
float game_stopped
Definition stats.qh:81
const int INITPRIO_GAMETYPE
Definition constants.qh:94
const int FL_ITEM
Definition constants.qh:77
float Q3SURFACEFLAG_SKY
float DPCONTENTS_SKY
const float SOLID_TRIGGER
float DPCONTENTS_DONOTENTER
float DPCONTENTS_SOLID
float frametime
float DPCONTENTS_CORPSE
vector velocity
float DPCONTENTS_BODY
const float SOLID_NOT
float effects
float DPCONTENTS_PLAYERCLIP
float DPCONTENTS_SLIME
float time
float checkpvs(vector viewpos, entity viewee)
float nextthink
float trace_dphitq3surfaceflags
vector v_forward
vector origin
float DPCONTENTS_LAVA
float Q3SURFACEFLAG_NOIMPACT
void Send_Effect(entity eff, vector eff_loc, vector eff_vel, int eff_cnt)
Definition all.qc:120
ent angles
Definition ent_cs.qc:121
solid
Definition ent_cs.qc:165
void GameLogEcho(string s)
Definition gamelog.qc:15
bool autocvar_sv_eventlog
Definition gamelog.qh:3
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
#define IL_NEW()
#define IL_EACH(this, cond, body)
#define IL_EMPTY(this)
#define PlayerPreThink
Definition _all.inc:254
#define ClientDisconnect
Definition _all.inc:242
#define STAT(...)
Definition stats.qh:82
float bound(float min, float value, float max)
float cvar(string name)
string ftos(float f)
#define MODEL(name, path)
Definition all.qh:8
void set_movetype(entity this, int mt)
Definition movetypes.qc:4
const int MOVETYPE_NONE
Definition movetypes.qh:129
const int MOVETYPE_BOUNCE
Definition movetypes.qh:139
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:1573
#define new_pure(class)
purely logical entities (not linked to the area grid)
Definition oo.qh:67
#define NULL
Definition post.qh:14
#define makevectors
Definition post.qh:21
vector view_ofs
Definition progsdefs.qc:151
float scale
Definition projectile.qc:14
#define crandom()
Returns a random number between -1.0 and 1.0.
Definition random.qh:32
#define setthink(e, f)
vector
Definition self.qh:92
vector org
Definition self.qh:92
entity entity toucher
Definition self.qh:72
#define settouch(e, f)
Definition self.qh:73
void SpectateCopy(entity this, entity spectatee)
Definition client.qc:1794
void PlayerUseKey(entity this)
Definition client.qc:2585
#define IS_INDEPENDENT_PLAYER(e)
Definition client.qh:312
IntrusiveList g_items
Definition items.qh:119
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
const float ATTEN_NORM
Definition sound.qh:30
#define sound(e, c, s, v, a)
Definition sound.qh:52
const int DAMAGE_YES
Definition subs.qh:80
const int DAMAGE_NO
Definition subs.qh:79
float takedamage
Definition subs.qh:78
float float2int_decimal_fld
entity frag_target
Definition sv_ctf.qc:2314
entity ballcarried
#define BALL_XYSPEED
entity previous_owner
#define BALL_XYDIST
void havocbot_goalrating_items(entity this, float ratingscale, vector org, float sradius)
Definition roles.qc:106
void havocbot_goalrating_enemyplayers(entity this, float ratingscale, vector org, float sradius)
Definition roles.qc:176
#define GameRules_scoring_add_team_float2int(client, fld, value, float_field, score_factor)
Definition sv_rules.qh:87
#define GameRules_scoring_vip(player, value)
Definition sv_rules.qh:78
#define GameRules_scoring_add(client, fld, value)
Definition sv_rules.qh:85
#define GameRules_scoring_add_team(client, fld, value)
Definition sv_rules.qh:89
#define GameRules_scoring(teams, spprio, stprio, fields)
Definition sv_rules.qh:58
int autocvar_g_tka_ballcarrier_maxballs
Definition sv_tka.qc:9
bool autocvar_g_tka_noncarrier_warn
Definition sv_tka.qc:15
float autocvar_g_tka_ballcarrier_highspeed
Definition sv_tka.qc:10
int autocvar_g_tkaball_trail_color
Definition sv_tka.qc:25
bool tka_ballcarrier_waypointsprite_visible_for_player(entity this, entity player, entity view)
Definition sv_tka.qc:28
void tka_EventLog(string mode, entity actor)
Definition sv_tka.qc:40
bool tka_waypointsprite_visible_for_bot(entity this, entity e, bool dropped)
Definition sv_tka.qc:302
void havocbot_goalrating_tkaball(entity this, float ratingscale, float ratingscale_sameteam, vector org)
Definition sv_tka.qc:314
int autocvar_g_tka_score_bckill
Definition sv_tka.qc:17
vector autocvar_g_tka_ballcarrier_force
Definition sv_tka.qc:12
void tka_RespawnBall(entity this)
Definition sv_tka.qc:47
int autocvar_g_tka_score_timepoints
Definition sv_tka.qc:20
vector autocvar_g_tka_ballcarrier_damage
Definition sv_tka.qc:11
int autocvar_g_tka_score_killac
Definition sv_tka.qc:18
float autocvar_g_tkaball_respawntime
Definition sv_tka.qc:24
void havocbot_role_tka_carrier(entity this)
Definition sv_tka.qc:346
bool autocvar_g_tka_score_team
Definition sv_tka.qc:19
void tka_Handler_CheckBall(entity this)
Definition sv_tka.qc:281
void tka_RemoveBalls()
Definition sv_tka.qc:237
int autocvar_g_tkaball_count
Definition sv_tka.qc:21
void tka_BallThink_Carried(entity this)
runs (only) while a player is carrying the ball
Definition sv_tka.qc:87
vector autocvar_g_tka_noncarrier_force
Definition sv_tka.qc:14
void tka_TouchEvent(entity this, entity toucher)
Definition sv_tka.qc:105
void tka_SpawnBalls()
Definition sv_tka.qc:249
float autocvar_g_tkaball_damageforcescale
Definition sv_tka.qc:22
void tka_DropEvent(entity player)
Definition sv_tka.qc:187
void tka_PlayerReset(entity player)
Definition sv_tka.qc:180
int autocvar_g_tkaball_effects
Definition sv_tka.qc:23
int autocvar_g_tkaball_tracking
Definition sv_tka.qc:26
vector autocvar_g_tka_noncarrier_damage
Definition sv_tka.qc:13
void havocbot_role_tka_collector(entity this)
Definition sv_tka.qc:369
int autocvar_g_tka_teams_override
Definition sv_tka.qh:11
void tka_Initialize()
IntrusiveList g_tkaballs
Definition sv_tka.qh:13
int tka_teams
Definition sv_tka.qh:9
entity TeamBalance_CheckAllowedTeams(entity for_whom)
Checks whether the player can join teams according to global configuration and mutator settings.
Definition teamplay.qc:459
#define SAME_TEAM(a, b)
Definition teams.qh:241
const int NUM_TEAM_2
Definition teams.qh:14
const int NUM_TEAM_4
Definition teams.qh:16
const int NUM_TEAM_3
Definition teams.qh:15
#define DIFF_TEAM(a, b)
Definition teams.qh:242
const int NUM_TEAM_1
Definition teams.qh:13
const int TKA_BALL_CARRYING
Definition tka.qh:71
const int TKA_BALL_TAKEN_YELLOW
Definition tka.qh:69
const int TKA_BALL_TAKEN_RED
Definition tka.qh:67
const int TKA_BALL_DROPPED
Definition tka.qh:72
const int TKA_BALL_TAKEN_PINK
Definition tka.qh:70
const int TKA_BALL_TAKEN_BLUE
Definition tka.qh:68
#define IS_INVISIBLE(v)
Definition utils.qh:29
#define IS_SPEC(v)
Definition utils.qh:10
#define FOREACH_CLIENT(cond, body)
Definition utils.qh:52
#define vec3(_x, _y, _z)
Definition vector.qh:95
void WaypointSprite_Kill(entity wp)
void WaypointSprite_UpdateSprites(entity e, entity _m1, entity _m2, entity _m3)
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)
entity WaypointSprite_getviewentity(entity e)
entity WaypointSprite_AttachCarrier(entity spr, entity carrier, entity icon)
void WaypointSprite_DetachCarrier(entity carrier)
void WaypointSprite_UpdateRule(entity e, float t, float r)
const int SPRITERULE_DEFAULT
entity waypointsprite_attachedforcarrier
const int SPRITERULE_TEAMPLAY
float MoveToRandomMapLocation(entity e, float goodcontents, float badcontents, float badsurfaceflags, float attempts, float maxaboveground, float minviewdistance)
Definition world.qc:1252
void InitializeEntity(entity e, void(entity this) func, int order)
Definition world.qc:2230