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;
190 ball = player.ballcarried;
191
192 if(!ball) { return; }
193
194 // reset the ball
195 setattachment(ball, NULL, "");
197 ball.previous_owner = player;
198 ball.wait = time + 0.5; // same as for thrown weapons
200 ball.nextthink = time + autocvar_g_tkaball_respawntime;
201 ball.takedamage = DAMAGE_YES;
202 ball.scale = 1; // it's smaller while carried
203 ball.alpha = 1; // in case the carrier had an invisibility effect
204 ball.solid = SOLID_TRIGGER; // before setorigin to ensure area grid linking
205 setorigin(ball, player.origin + ball.origin + '0 0 10'); // include attachment offset to reduce jump
206 nudgeoutofsolid_OrFallback(ball); // a ball has a horizontally bigger bbox than a player
207 ball.velocity = '0 0 200' + '0 100 0'*crandom() + '100 0 0'*crandom();
208 ball.owner = NULL;
209 navigation_dynamicgoal_set(ball, player);
210
211 // messages and sounds
212 tka_EventLog("dropped", player);
213 Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_KEEPAWAY_DROPPED, player.netname);
214 Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_KEEPAWAY_DROPPED, player.netname);
215 sound(NULL, CH_TRIGGER, SND_KA_DROPPED, VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere)
216
217 // waypoints
219 {
220 WaypointSprite_Spawn(WP_KaBall, 0, 0, ball, '0 0 64', NULL, ball.team, ball, waypointsprite_attachedforcarrier, false, RADARICON_FLAGCARRIER);
221 WaypointSprite_UpdateRule(ball.waypointsprite_attachedforcarrier, 0, SPRITERULE_DEFAULT);
222 WaypointSprite_Ping(ball.waypointsprite_attachedforcarrier);
223 }
224
225 if (ball.ballcarried) // >1 ball was chained, first one was just dropped
226 {
227 player.ballcarried = ball.ballcarried; // move the next one up
228 ball.ballcarried = NULL; // prevent infinite loop
229 }
230 else // no balls remaining so remove bc status
231 tka_PlayerReset(player);
232}
233
235
236MODEL(TKA_BALL, "models/orbs/orbblue.md3");
237
239{
240 IL_EACH(g_tkaballs, true,
241 {
242 if (it.owner) // it was attached
243 tka_PlayerReset(it.owner);
244 else
246 delete(it);
247 });
248}
249
251{
252 int i = 0;
253 do // never allow less than 1 ball to spawn
254 {
255 entity e = new(keepawayball);
256 setmodel(e, MDL_TKA_BALL);
257 // 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
258 // bones_was_here: that was WITH sv_legacy_bbox_expand 1 and FL_ITEM (mins -= '15 15 1'; maxs += '15 15 1')
259 // it's round so should have a symmetrical bbox, same height as pickup items so it can't be jumped over in any physics
260 setsize(e, '-24 -24 -24', '24 24 24');
261 e.damageforcescale = autocvar_g_tkaball_damageforcescale;
262 e.takedamage = DAMAGE_YES;
263 e.solid = SOLID_TRIGGER;
265 e.glow_color = autocvar_g_tkaball_trail_color;
266 e.glow_trail = true;
267 e.flags = FL_ITEM;
268 IL_PUSH(g_items, e);
269 e.pushable = true;
271 e.owner = NULL;
274
276
277 ++i;
278 }
279 while (i < autocvar_g_tkaball_count);
280}
281
283{
284 if(time < game_starttime)
285 {
286 if (!IL_EMPTY(g_tkaballs))
288 }
289 else
290 {
291 if (IL_EMPTY(g_tkaballs))
293 }
294
295 this.nextthink = time;
296}
297
298
299// ================
300// Bot player logic
301// ================
302
304{
305 entity ball_wp = e.waypointsprite_attachedforcarrier;
306 if (!ball_wp)
307 if (dropped || !ball_wp.waypointsprite_visible_for_player(ball_wp, this, WaypointSprite_getviewentity(this)))
308 { // has no waypoint, or waypoint not visible
309 if (!checkpvs(this.origin + this.view_ofs, e)) // ball cannot be seen
310 return false;
311 }
312 return true;
313}
314
315void havocbot_goalrating_tkaball(entity this, float ratingscale, float ratingscale_sameteam, vector org)
316{
317 entity ball = NULL, ball_carried = NULL;
318
319 // stops at last ball, prefers ball without carrier
320 IL_EACH(g_tkaballs, it.owner != this,
321 {
322 if (it.owner)
323 {
324 if (!tka_waypointsprite_visible_for_bot(this, it.owner, false))
325 continue;
326 ball_carried = it.owner;
327 }
328 else
329 {
330 if (!tka_waypointsprite_visible_for_bot(this, it, true))
331 continue;
332 ball = it;
333 }
334 });
335
336 if (ball)
337 navigation_routerating(this, ball, ratingscale, 2000);
338 else if (ball_carried)
339 {
340 if (DIFF_TEAM(ball_carried, this))
341 navigation_routerating(this, ball_carried, ratingscale, 2000);
342 else
343 navigation_routerating(this, ball_carried, ratingscale_sameteam, 2000);
344 }
345}
346
348{
349 if (IS_DEAD(this))
350 return;
351
353 {
355 havocbot_goalrating_items(this, 10000, this.origin, 10000);
356 havocbot_goalrating_enemyplayers(this, 10000, this.origin, 10000);
357 havocbot_goalrating_waypoints(this, 1, this.origin, 3000);
359
361 }
362
363 if (!this.ballcarried)
364 {
365 this.havocbot_role = havocbot_role_tka_collector;
367 }
368}
369
371{
372 if (IS_DEAD(this))
373 return;
374
376 {
378 havocbot_goalrating_items(this, 10000, this.origin, 10000);
379 havocbot_goalrating_enemyplayers(this, 500, this.origin, 10000);
380 havocbot_goalrating_tkaball(this, 8000, 4000, this.origin);
382
384 }
385
386 if (this.ballcarried)
387 {
388 this.havocbot_role = havocbot_role_tka_carrier;
390 }
391}
392
393
394// ==============
395// Hook Functions
396// ==============
397
398MUTATOR_HOOKFUNCTION(tka, PlayerDies)
399{
400 entity frag_attacker = M_ARGV(1, entity);
402
403 if(frag_attacker != frag_target && IS_PLAYER(frag_attacker) && DIFF_TEAM(frag_attacker, frag_target))
404 {
405 bool team_has_ball = false;
406 IL_EACH(g_tkaballs, it.owner != frag_attacker && SAME_TEAM(it.owner, frag_attacker),
407 {
408 team_has_ball = true;
409 break;
410 });
411 if(frag_target.ballcarried) // add to amount of times killing carrier
412 {
413 GameRules_scoring_add(frag_attacker, TKA_CARRIERKILLS, 1);
414 if(autocvar_g_tka_score_bckill) // add bckills to the score
416 }
417 else if(!frag_attacker.ballcarried && !(autocvar_g_tka_score_team && team_has_ball))
418 {
420 Send_Notification(NOTIF_ONE_ONLY, frag_attacker, MSG_CENTER, CENTER_KEEPAWAY_WARN);
421 }
422
423 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)
425 }
426
427 while (frag_target.ballcarried)
428 tka_DropEvent(frag_target); // a player with ball(s) has died, drop them
429}
430
431MUTATOR_HOOKFUNCTION(tka, GiveFragsForKill)
432{
433 M_ARGV(2, float) = 0; // no frags counted in keepaway
434 return true; // you deceptive little bugger ;3 This needs to be true in order for this function to even count.
435}
436
437MUTATOR_HOOKFUNCTION(tka, Scores_CountFragsRemaining)
438{
439 // announce remaining frags, but only when timed scoring is off
441}
442
444{
445 entity player = M_ARGV(0, entity);
446
447 // clear the item used for the ball in keepaway
448 STAT(TKA_BALLSTATUS, player) = 0;
449
450 // if the player has the ball, make sure they have the item for it (Used for HUD primarily)
451 if(player.ballcarried)
452 STAT(TKA_BALLSTATUS, player) |= TKA_BALL_CARRYING;
453
454 IL_EACH(g_tkaballs, true,
455 {
456 if(!it.owner)
457 STAT(TKA_BALLSTATUS, player) |= TKA_BALL_DROPPED;
458 else
459 {
460 // TODO: teamless carrier?
461 switch(it.owner.team)
462 {
463 case NUM_TEAM_1: STAT(TKA_BALLSTATUS, player) |= TKA_BALL_TAKEN_RED; break;
464 case NUM_TEAM_2: STAT(TKA_BALLSTATUS, player) |= TKA_BALL_TAKEN_BLUE; break;
465 case NUM_TEAM_3: STAT(TKA_BALLSTATUS, player) |= TKA_BALL_TAKEN_YELLOW; break;
466 case NUM_TEAM_4: STAT(TKA_BALLSTATUS, player) |= TKA_BALL_TAKEN_PINK; break;
467 }
468 }
469 });
470}
471
473{
474 entity player = M_ARGV(0, entity);
475
476 if(MUTATOR_RETURNVALUE == 0)
477 if(player.ballcarried)
478 {
479 tka_DropEvent(player);
480 return true;
481 }
482}
483
484MUTATOR_HOOKFUNCTION(tka, Damage_Calculate) // for changing damage and force values that are applied to players
485{
486 entity frag_attacker = M_ARGV(1, entity);
488
489 // as a gametype rule, only apply scaling to player versus player combat
490 if (!IS_PLAYER(frag_attacker) || !IS_PLAYER(frag_target))
491 return;
492
493 if (frag_attacker.ballcarried) // if the attacker is a ballcarrier
494 {
495 if (frag_target == frag_attacker) // damage done to themselves
496 {
499 }
500 else if (frag_target.ballcarried) // damage done to other ballcarriers
501 {
504 }
505 else // damage done to noncarriers
506 {
509 }
510 }
511 else
512 {
513 if (frag_target == frag_attacker) // damage done to themselves
514 {
517 }
518 else if (frag_target.ballcarried) // damage done to ballcarriers
519 {
522 }
523 else // damage done to other noncarriers
524 {
527 }
528 }
529}
530
532{
533 entity player = M_ARGV(0, entity);
534
535 while (player.ballcarried)
536 tka_DropEvent(player); // a player with ball(s) has left the match, drop them
537}
538
539MUTATOR_HOOKFUNCTION(tka, MakePlayerObserver)
540{
541 entity player = M_ARGV(0, entity);
542
543 while (player.ballcarried)
544 tka_DropEvent(player); // a player with ball(s) has left the match, drop them
545}
546
547MUTATOR_HOOKFUNCTION(tka, PlayerPowerups)
548{
549// entity player = M_ARGV(0, entity);
550
551 // In the future this hook is supposed to allow me to do some extra stuff with waypointsprites and invisibility powerup
552 // So bare with me until I can fix a certain bug with tka_ballcarrier_waypointsprite_visible_for_player()
553}
554
555
556MUTATOR_HOOKFUNCTION(tka, PlayerPhysics_UpdateStats)
557{
558 entity player = M_ARGV(0, entity);
559 // these automatically reset, no need to worry
560
561 if(player.ballcarried)
562 STAT(MOVEVARS_HIGHSPEED, player) *= autocvar_g_tka_ballcarrier_highspeed;
563}
564
565MUTATOR_HOOKFUNCTION(tka, BotShouldAttack)
566{
567 entity bot = M_ARGV(0, entity);
568 entity targ = M_ARGV(1, entity);
569
570 // if neither player has ball then don't attack unless the ball is on the ground
571 bool have_held_ball = false, team_has_ball = false;
572 IL_EACH(g_tkaballs, it.owner,
573 {
574 have_held_ball = true;
575 if(SAME_TEAM(bot, it.owner))
576 team_has_ball = true;
577 });
578
579 if(!targ.ballcarried && !bot.ballcarried && have_held_ball && !(autocvar_g_tka_score_team && team_has_ball))
580 return true;
581}
582
583MUTATOR_HOOKFUNCTION(tka, HavocBot_ChooseRole)
584{
585 entity bot = M_ARGV(0, entity);
586
587 if (bot.ballcarried)
588 bot.havocbot_role = havocbot_role_tka_carrier;
589 else
590 bot.havocbot_role = havocbot_role_tka_collector;
591 return true;
592}
593
594MUTATOR_HOOKFUNCTION(tka, DropSpecialItems)
595{
597
598 while (frag_target.ballcarried)
600}
601
603{
604 entity spectatee = M_ARGV(0, entity);
605 entity client = M_ARGV(1, entity);
606
607 STAT(TKA_BALLSTATUS, client) = STAT(TKA_BALLSTATUS, spectatee);
608}
609
611{
612 M_ARGV(0, float) = tka_teams;
613 return true;
614}
615
616void tka_Initialize()
617{
619 if(tka_teams < 2)
620 tka_teams = cvar("g_tka_teams"); // read the cvar directly as it gets written earlier in the same frame
621 tka_teams = BITS(bound(2, tka_teams, 4));
623 field(SP_TKA_PICKUPS, "pickups", 0);
624 field(SP_TKA_CARRIERKILLS, "bckills", 0);
625 field(SP_TKA_BCTIME, "bctime", SFL_SORT_PRIO_SECONDARY);
626 });
627
628 g_tkaballs = IL_NEW();
629 entity tka_Handler = new_pure(tka_Handler);
630 setthink(tka_Handler, tka_Handler_CheckBall);
632}
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:245
#define IS_PLAYER(s)
Definition player.qh:243
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:124
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:1793
void PlayerUseKey(entity this)
Definition client.qc:2584
#define IS_INDEPENDENT_PLAYER(e)
Definition client.qh:312
IntrusiveList g_items
Definition items.qh:125
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:2321
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:303
void havocbot_goalrating_tkaball(entity this, float ratingscale, float ratingscale_sameteam, vector org)
Definition sv_tka.qc:315
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:347
bool autocvar_g_tka_score_team
Definition sv_tka.qc:19
void tka_Handler_CheckBall(entity this)
Definition sv_tka.qc:282
void tka_RemoveBalls()
Definition sv_tka.qc:238
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:250
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:370
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:66
const int TKA_BALL_TAKEN_YELLOW
Definition tka.qh:64
const int TKA_BALL_TAKEN_RED
Definition tka.qh:62
const int TKA_BALL_DROPPED
Definition tka.qh:67
const int TKA_BALL_TAKEN_PINK
Definition tka.qh:65
const int TKA_BALL_TAKEN_BLUE
Definition tka.qh:63
#define IS_INVISIBLE(v)
Definition utils.qh:27
#define IS_SPEC(v)
Definition utils.qh:10
#define FOREACH_CLIENT(cond, body)
Definition utils.qh:50
#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:1231
void InitializeEntity(entity e, void(entity this) func, int order)
Definition world.qc:2209