float autocvar_g_balance_nexball_secondary_refire;
float autocvar_g_balance_nexball_secondary_speed;
-void basketball_touch();
-void football_touch();
-void ResetBall();
+void basketball_touch(entity this);
+void football_touch(entity this);
+void ResetBall(entity this);
const int NBM_NONE = 0;
const int NBM_FOOTBALL = 2;
const int NBM_BASKETBALL = 4;
{
if(this.owner)
DropBall(this, this.owner.origin, '0 0 0');
- ResetBall();
+ ResetBall(this);
}
void nexball_setstatus()
{
bprint("The ", Team_ColoredFullName(this.team), " held the ball for too long.\n");
DropBall(this.ballcarried, this.ballcarried.owner.origin, '0 0 0');
- WITHSELF(this.ballcarried, ResetBall());
+ entity e = this.ballcarried;
+ WITHSELF(e, ResetBall(e));
}
else
this.items |= IT_KEY1;
}
}
-void DropOwner()
-{SELFPARAM();
+void DropOwner(entity this)
+{
entity ownr;
ownr = this.owner;
DropBall(this, ownr.origin, ownr.velocity);
plyr.(weaponentity).m_switchweapon = PS(plyr).m_weapon;
plyr.weapons = WEPSET(NEXBALL);
Weapon w = WEP_NEXBALL;
- WITHSELF(plyr, w.wr_resetplayer(w));
+ WITHSELF(plyr, w.wr_resetplayer(w, plyr));
PS(plyr).m_switchweapon = WEP_NEXBALL;
WITHSELF(plyr, W_SwitchWeapon(plyr, WEP_NEXBALL));
}
ball.owner = world;
}
-void InitBall()
-{SELFPARAM();
+void InitBall(entity this)
+{
if(gameover) return;
UNSET_ONGROUND(this);
this.movetype = MOVETYPE_BOUNCE;
LogNB("init", world);
}
-void ResetBall()
-{SELFPARAM();
+void ResetBall(entity this)
+{
if(this.cnt < 2) // step 1
{
if(time == this.teamtime)
}
}
-void football_touch()
-{SELFPARAM();
+void football_touch(entity this)
+{
if(other.solid == SOLID_BSP)
{
if(time > self.lastground + 0.1)
self.avelocity = -250 * v_forward; // maybe there is a way to make it look better?
}
-void basketball_touch()
-{SELFPARAM();
+void basketball_touch(entity this)
+{
if(other.ballcarried)
{
- football_touch();
+ football_touch(this);
return;
}
if(!self.cnt && IS_PLAYER(other) && !STAT(FROZEN, other) && !IS_DEAD(other) && (other != self.nb_dropper || time > self.nb_droptime + autocvar_g_nexball_delay_collect))
}
}
-void GoalTouch()
-{SELFPARAM();
+void GoalTouch(entity this)
+{
entity ball;
float isclient, pscore, otherteam;
string pname;
//=======================//
-void W_Nexball_Think()
-{SELFPARAM();
+void W_Nexball_Think(entity this)
+{
//dprint("W_Nexball_Think\n");
//vector new_dir = steerlib_arrive(this.enemy.origin, 2500);
vector new_dir = normalize(this.enemy.origin + '0 0 50' - this.origin);
this.nextthink = time;
}
-void W_Nexball_Touch()
-{SELFPARAM();
+void W_Nexball_Touch(entity this)
+{
entity ball, attacker;
attacker = self.owner;
//self.think = func_null;
W_SetupProjVelocity_Basic(missile, autocvar_g_balance_nexball_secondary_speed, 0);
missile.angles = vectoangles(missile.velocity);
settouch(missile, W_Nexball_Touch);
- setthink(missile, SUB_Remove_self);
+ setthink(missile, SUB_Remove);
missile.nextthink = time + autocvar_g_balance_nexball_secondary_lifetime; //FIXME: use a distance instead?
missile.effects = EF_BRIGHTFIELD | EF_LOWPRECISION;
}
}
-METHOD(BallStealer, wr_setup, void(BallStealer this))
+METHOD(BallStealer, wr_setup, void(BallStealer this, entity actor))
{
TC(BallStealer, this);
//weapon_setup(WEP_PORTO.m_id);
{
self.weapons = self.(weaponentity).weapons;
Weapon w = WEP_NEXBALL;
- w.wr_resetplayer(w);
+ w.wr_resetplayer(w, self);
PS(self).m_switchweapon = self.(weaponentity).m_switchweapon;
W_SwitchWeapon(self, PS(self).m_switchweapon);