51 if(game_stopped)
return;
71 Send_Effect(EFFECT_ELECTRO_COMBO, oldballorigin,
'0 0 0', 1);
72 Send_Effect(EFFECT_ELECTRO_COMBO, this.
origin,
'0 0 0', 1);
74 WaypointSprite_Spawn(WP_KaBall, 0, 0,
this,
'0 0 64',
NULL, this.
team,
this, waypointsprite_attachedforcarrier,
false, RADARICON_FLAGCARRIER);
75 WaypointSprite_Ping(this.waypointsprite_attachedforcarrier);
85 it.timepoints_counter = 0;
92 if(this.
owner.ballcarried)
114 if (!
this || game_stopped)
122 if(toucher.ballcarried) {
return; }
123 if(
IS_DEAD(toucher)) {
return; }
124 if(STAT(FROZEN, toucher)) {
return; }
127 Send_Effect(EFFECT_BALL_SPARKS, this.
origin,
'0 0 0', 1);
131 else if(this.
wait >
time) {
return; }
134 this.
owner = toucher;
135 toucher.ballcarried =
this;
137 setattachment(
this, toucher,
"");
155 toucher.glow_trail =
true;
160 Send_Notification(NOTIF_ALL,
NULL, MSG_INFO, INFO_KEEPAWAY_PICKUP, toucher.netname);
161 Send_Notification(NOTIF_ALL_EXCEPT, toucher, MSG_CENTER, CENTER_KEEPAWAY_PICKUP, toucher.netname);
162 Send_Notification(NOTIF_ONE, toucher, MSG_CENTER, CENTER_KEEPAWAY_PICKUP_SELF);
169 WaypointSprite_AttachCarrier(WP_KaBallCarrier, toucher, RADARICON_FLAGCARRIER);
171 WaypointSprite_UpdateRule(toucher.waypointsprite_attachedforcarrier, 0,
SPRITERULE_DEFAULT);
172 WaypointSprite_Ping(toucher.waypointsprite_attachedforcarrier);
173 WaypointSprite_Kill(this.waypointsprite_attachedforcarrier);
178 player.ballcarried =
NULL;
180 WaypointSprite_Kill(player.waypointsprite_attachedforcarrier);
183 player.glow_trail =
false;
189 entity ball = player.ballcarried;
191 if(!ball) {
return; }
194 setattachment(ball,
NULL,
"");
196 ball.wait =
time + 1;
202 ball.damagedbycontents =
true;
205 setorigin(ball, player.origin +
'0 0 10');
206 ball.velocity =
'0 0 200' +
'0 100 0'*
crandom() +
'100 0 0'*
crandom();
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);
217 WaypointSprite_Spawn(WP_KaBall, 0, 0, ball,
'0 0 64',
NULL, ball.team, ball, waypointsprite_attachedforcarrier,
false, RADARICON_FLAGCARRIER);
218 WaypointSprite_UpdateRule(ball.waypointsprite_attachedforcarrier, 0,
SPRITERULE_DEFAULT);
219 WaypointSprite_Ping(ball.waypointsprite_attachedforcarrier);
226 MODEL(KA_BALL,
"models/orbs/orbblue.md3");
230 entity player = ball.owner;
234 WaypointSprite_DetachCarrier(ball);
248 entity e =
new(keepawayball);
250 setsize(e,
'-16 -16 -20',
'16 16 20');
254 e.damagedbycontents =
true;
273 int realballcount =
max(1, ballcount);
274 for(
int j = 0; j < realballcount; ++j)
282 if(
time < game_starttime)
317 ball_carried = it.owner;
324 else if(ball_carried)
384 if((frag_attacker != frag_target) && (
IS_PLAYER(frag_attacker)))
386 if(frag_target.ballcarried) {
391 else if(!frag_attacker.ballcarried)
393 Send_Notification(NOTIF_ONE_ONLY, frag_attacker, MSG_CENTER, CENTER_KEEPAWAY_WARN);
395 if(frag_attacker.ballcarried)
399 if(frag_target.ballcarried) {
ka_DropEvent(frag_target); }
419 STAT(OBJECTIVE_STATUS, player) =
BITSET(STAT(OBJECTIVE_STATUS, player), KA_CARRYING, player.ballcarried !=
NULL);
427 if(player.ballcarried)
443 if(frag_attacker.ballcarried)
445 if(frag_target == frag_attacker)
458 if(frag_target == frag_attacker)
494 if(player.ballcarried)
504 if(player.ballcarried)
514 bool have_held_ball =
false;
517 have_held_ball = true;
520 if(!targ.ballcarried && !bot.ballcarried && have_held_ball)
539 if(frag_target.ballcarried)
ERASEABLE void IL_REMOVE(IntrusiveList this, entity it)
Remove any element, anywhere in the list.
float autocvar_g_keepaway_ballcarrier_selfdamage
entity SelectSpawnPoint(entity this, bool anypoint)
float autocvar_g_keepaway_ballcarrier_selfforce
float autocvar_g_keepaway_noncarrier_selfdamage
#define IL_EACH(this, cond, body)
int autocvar_g_keepaway_score_timepoints
void navigation_goalrating_start(entity this)
void havocbot_goalrating_items(entity this, float ratingscale, vector org, float sradius)
void havocbot_role_ka_collector(entity this)
float trace_dphitq3surfaceflags
void navigation_goalrating_end(entity this)
float autocvar_g_keepaway_ballcarrier_highspeed
const int SPRITERULE_DEFAULT
void GameRules_scoring_vip(entity player, bool value)
Mark a player as being 'important' (flag carrier, ball carrier, etc)
IntrusiveList g_damagedbycontents
void navigation_dynamicgoal_init(entity this, bool initially_static)
#define FOREACH_CLIENT(cond, body)
void ka_RemoveBall(entity ball)
#define GameRules_scoring_add(client, fld, value)
void ka_EventLog(string mode, entity actor)
void navigation_dynamicgoal_set(entity this, entity dropper)
float MoveToRandomMapLocation(entity e, float goodcontents, float badcontents, float badsurfaceflags, float attempts, float maxaboveground, float minviewdistance)
float DPCONTENTS_PLAYERCLIP
float autocvar_g_keepawayball_respawntime
void ka_Handler_CheckBall(entity this)
void havocbot_role_ka_carrier(entity this)
int autocvar_g_keepaway_score_killac
float autocvar_g_keepaway_noncarrier_force
void PlayerPreThink(entity this)
void havocbot_goalrating_enemyplayers(entity this, float ratingscale, vector org, float sradius)
float autocvar_g_keepawayball_damageforcescale
void navigation_routerating(entity this, entity e, float f, float rangebias)
#define setmodel(this, m)
MODEL(KA_BALL, "models/orbs/orbblue.md3")
void ka_DropEvent(entity player)
int autocvar_g_keepawayball_effects
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
bool navigation_goalrating_timeout(entity this)
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
void PlayerUseKey(entity this)
float autocvar_g_keepaway_ballcarrier_force
#define crandom()
Returns a random number between -1.0 and 1.0.
void GameLogEcho(string s)
#define MUTATOR_RETURNVALUE
#define GameRules_scoring_add_float2int(client, fld, value, float_field, score_factor)
float Q3SURFACEFLAG_NOIMPACT
void navigation_goalrating_timeout_set(entity this)
void navigation_goalrating_timeout_expire(entity this, float seconds)
#define BITSET(var, mask, flag)
void ka_TimeScoring(entity this)
vector(float skel, float bonenum) _skel_get_boneabs_hidden
void ka_SpawnBalls(int ballcount)
#define ITEM_DAMAGE_NEEDKILL(dt)
void navigation_dynamicgoal_unset(entity this)
void InitializeEntity(entity e, void(entity this) func, int order)
float autocvar_g_keepaway_noncarrier_damage
void ka_TouchEvent(entity this, entity toucher)
float autocvar_g_keepaway_ballcarrier_damage
void havocbot_goalrating_ball(entity this, float ratingscale, vector org)
void ka_RespawnBall(entity this)
void ka_DamageEvent(entity this, entity inflictor, entity attacker, float damage, int deathtype,.entity weaponentity, vector hitloc, vector force)
const float SOLID_TRIGGER
void havocbot_goalrating_waypoints(entity this, float ratingscale, vector org, float sradius)
int autocvar_g_keepawayball_trail_color
#define new_pure(class)
purely logical entities (.origin doesn't work)
int autocvar_g_keepaway_ballcarrier_effects
#define sound(e, c, s, v, a)
void ka_PlayerReset(entity player)
bool autocvar_sv_eventlog
float DPCONTENTS_DONOTENTER
bool autocvar_g_keepaway_noncarrier_warn
MUTATOR_HOOKFUNCTION(ka, reset_map_global)
bool ka_ballcarrier_waypointsprite_visible_for_player(entity this, entity player, entity view)
int autocvar_g_keepaway_score_bckill
float autocvar_g_keepaway_score_timeinterval
void set_movetype(entity this, int mt)
float autocvar_g_keepaway_noncarrier_selfforce