void ka_TouchEvent();
void ka_RespawnBall() // runs whenever the ball needs to be relocated
-{
+{SELFPARAM();
if(gameover) { return; }
vector oldballorigin = self.origin;
}
void ka_TimeScoring()
-{
+{SELFPARAM();
if(self.owner.ballcarried)
{ // add points for holding the ball after a certain amount of time
if(autocvar_g_keepaway_score_timepoints)
}
void ka_TouchEvent() // runs any time that the ball comes in contact with something
-{
+{SELFPARAM();
if(gameover) { return; }
if(!self) { return; }
if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
}
void ka_Reset() // used to clear the ballcarrier whenever the match switches from warmup to normal
-{
+{SELFPARAM();
if((self.owner) && (IS_PLAYER(self.owner)))
ka_DropEvent(self.owner);
// ================
void havocbot_goalrating_ball(float ratingscale, vector org)
-{
+{SELFPARAM();
float t;
entity ball_owner;
ball_owner = ka_ball.owner;
}
void havocbot_role_ka_carrier()
-{
+{SELFPARAM();
if (self.deadflag != DEAD_NO)
return;
}
void havocbot_role_ka_collector()
-{
+{SELFPARAM();
if (self.deadflag != DEAD_NO)
return;
// ==============
MUTATOR_HOOKFUNCTION(ka_Scoring)
-{
+{SELFPARAM();
if((frag_attacker != frag_target) && (IS_PLAYER(frag_attacker)))
{
if(frag_target.ballcarried) { // add to amount of times killing carrier
}
MUTATOR_HOOKFUNCTION(ka_PlayerPreThink)
-{
+{SELFPARAM();
// clear the item used for the ball in keepaway
self.items &= ~IT_KEY1;
}
MUTATOR_HOOKFUNCTION(ka_PlayerUseKey)
-{
+{SELFPARAM();
if(MUTATOR_RETURNVALUE == 0)
if(self.ballcarried)
{
}
MUTATOR_HOOKFUNCTION(ka_RemovePlayer)
-{
+{SELFPARAM();
if(self.ballcarried) { ka_DropEvent(self); } // a player with the ball has left the match, drop it
return 0;
}
MUTATOR_HOOKFUNCTION(ka_PlayerPowerups)
-{
+{SELFPARAM();
// In the future this hook is supposed to allow me to do some extra stuff with waypointsprites and invisibility powerup
// So bare with me until I can fix a certain bug with ka_ballcarrier_waypointsprite_visible_for_player()
}
MUTATOR_HOOKFUNCTION(ka_PlayerPhysics)
-{
+{SELFPARAM();
if(self.ballcarried)
{
self.stat_sv_airspeedlimit_nonqw *= autocvar_g_keepaway_ballcarrier_highspeed;
}
MUTATOR_HOOKFUNCTION(ka_BotShouldAttack)
-{
+{SELFPARAM();
// if neither player has ball then don't attack unless the ball is on the ground
if(!checkentity.ballcarried && !self.ballcarried && ka_ball.owner)
return true;
}
MUTATOR_HOOKFUNCTION(ka_BotRoles)
-{
+{SELFPARAM();
if (self.ballcarried)
self.havocbot_role = havocbot_role_ka_carrier;
else