34 if(view.ballcarried &&
IS_SPEC(player))
66 Send_Effect(EFFECT_KA_BALL_RESPAWN, oldballorigin,
'0 0 0', 1);
71 WaypointSprite_Spawn(WP_KaBall, 0, 0,
this,
'0 0 64',
NULL, this.
team,
this,
waypointsprite_attachedforcarrier,
false, RADARICON_FLAGCARRIER);
84 it.float2int_decimal_fld = 0;
99#define BALL_XYSPEED 100
100#define BALL_XYDIST 24
150 setattachment(
this,
toucher,
"");
152 setorigin(
this,
'0 0 0');
186 player.ballcarried =
NULL;
193 entity ball = player.ballcarried;
195 if(!ball) {
return; }
198 setattachment(ball,
NULL,
"");
200 ball.previous_owner = player;
201 ball.wait =
time + 0.5;
206 ball.damagedbycontents =
true;
211 setorigin(ball, player.origin + ball.origin +
'0 0 10');
212 nudgeoutofsolid_OrFallback(ball);
213 ball.velocity =
'0 0 200' +
'0 100 0'*
crandom() +
'100 0 0'*
crandom();
226 WaypointSprite_Spawn(WP_KaBall, 0, 0, ball,
'0 0 64',
NULL, ball.team, ball,
waypointsprite_attachedforcarrier,
false, RADARICON_FLAGCARRIER);
231 if (ball.ballcarried)
233 player.ballcarried = ball.ballcarried;
234 ball.ballcarried =
NULL;
242MODEL(KA_BALL,
"models/orbs/orbblue.md3");
261 entity e =
new(keepawayball);
267 setsize(e,
'-24 -24 -24',
'24 24 24');
271 e.damagedbycontents =
true;
314 entity ball_wp = e.waypointsprite_attachedforcarrier;
333 if (!ka_waypointsprite_visible_for_bot(this, it.owner, false))
335 ball_carried = it.owner;
339 if (!ka_waypointsprite_visible_for_bot(this, it, true))
347 else if (ball_carried)
415 else if(!frag_attacker.ballcarried)
418 Send_Notification(NOTIF_ONE_ONLY, frag_attacker, MSG_CENTER, CENTER_KEEPAWAY_WARN);
421 if(frag_attacker.ballcarried)
454 if(player.ballcarried)
470 if (frag_attacker.ballcarried)
512 while (player.ballcarried)
520 while (player.ballcarried)
538 if(player.ballcarried)
548 bool have_held_ball =
false;
551 have_held_ball = true;
554 if(!targ.ballcarried && !bot.ballcarried && have_held_ball)
void havocbot_goalrating_waypoints(entity this, float ratingscale, vector org, float sradius)
void navigation_goalrating_start(entity this)
void navigation_goalrating_timeout_set(entity this)
bool navigation_goalrating_timeout(entity this)
void navigation_dynamicgoal_init(entity this, bool initially_static)
void navigation_routerating(entity this, entity e, float f, float rangebias)
void navigation_dynamicgoal_set(entity this, entity dropper)
void navigation_goalrating_timeout_expire(entity this, float seconds)
void navigation_goalrating_end(entity this)
void navigation_dynamicgoal_unset(entity this)
#define MUTATOR_HOOKFUNCTION(...)
#define MUTATOR_RETURNVALUE
#define BITSET(var, mask, flag)
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
#define setmodel(this, m)
const float SOLID_TRIGGER
float DPCONTENTS_DONOTENTER
float DPCONTENTS_PLAYERCLIP
float checkpvs(vector viewpos, entity viewee)
float trace_dphitq3surfaceflags
float Q3SURFACEFLAG_NOIMPACT
IntrusiveList g_damagedbycontents
void Send_Effect(entity eff, vector eff_loc, vector eff_vel, int eff_cnt)
void GameLogEcho(string s)
bool autocvar_sv_eventlog
ERASEABLE void IL_REMOVE(IntrusiveList this, entity it)
Remove any element, anywhere in the list.
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
#define IL_EACH(this, cond, body)
#define MODEL(name, path)
void set_movetype(entity this, int mt)
const int MOVETYPE_BOUNCE
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))
void Send_Notification(NOTIF broadcast, entity client, MSG net_type, Notification net_name,...count)
#define crandom()
Returns a random number between -1.0 and 1.0.
void PlayerUseKey(entity this)
#define IS_INDEPENDENT_PLAYER(e)
#define ITEM_DAMAGE_NEEDKILL(dt)
entity SelectSpawnPoint(entity this, bool anypoint)
#define sound(e, c, s, v, a)
float float2int_decimal_fld
int autocvar_g_keepawayball_trail_color
bool autocvar_g_keepaway_noncarrier_warn
vector autocvar_g_keepaway_ballcarrier_damage
int autocvar_g_keepawayball_tracking
void ka_DamageEvent(entity this, entity inflictor, entity attacker, float damage, int deathtype,.entity weaponentity, vector hitloc, vector force)
vector autocvar_g_keepaway_noncarrier_damage
void havocbot_role_ka_collector(entity this)
int autocvar_g_keepaway_ballcarrier_maxballs
float autocvar_g_keepawayball_respawntime
int autocvar_g_keepaway_score_timepoints
bool ka_waypointsprite_visible_for_bot(entity this, entity e, bool dropped)
float autocvar_g_keepaway_ballcarrier_highspeed
void ka_BallThink_Carried(entity this)
runs (only) while a player is carrying the ball
int autocvar_g_keepawayball_effects
int autocvar_g_keepawayball_count
void ka_RespawnBall(entity this)
float autocvar_g_keepawayball_damageforcescale
void ka_DropEvent(entity player)
int autocvar_g_keepaway_score_bckill
vector autocvar_g_keepaway_ballcarrier_force
void havocbot_goalrating_ball(entity this, float ratingscale, vector org)
int autocvar_g_keepaway_score_killac
bool ka_ballcarrier_waypointsprite_visible_for_player(entity this, entity player, entity view)
void ka_PlayerReset(entity player)
void ka_TouchEvent(entity this, entity toucher)
vector autocvar_g_keepaway_noncarrier_force
void havocbot_role_ka_carrier(entity this)
void ka_EventLog(string mode, entity actor)
void ka_Handler_CheckBall(entity this)
void havocbot_goalrating_items(entity this, float ratingscale, vector org, float sradius)
void havocbot_goalrating_enemyplayers(entity this, float ratingscale, vector org, float sradius)
#define GameRules_scoring_add_float2int(client, fld, value, float_field, score_factor)
#define GameRules_scoring_vip(player, value)
#define GameRules_scoring_add(client, fld, value)
#define FOREACH_CLIENT(cond, body)
void WaypointSprite_Kill(entity wp)
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
float MoveToRandomMapLocation(entity e, float goodcontents, float badcontents, float badsurfaceflags, float attempts, float maxaboveground, float minviewdistance)