void nexball_setstatus(void)
{
entity oldself;
- self.items &~= IT_KEY1;
+ self.items &= ~IT_KEY1;
if(self.ballcarried)
{
if(self.ballcarried.teamtime && (self.ballcarried.teamtime < time))
{
- bprint("The ", ColoredTeamName(self.team), " held the ball for too long.\n");
+ bprint("The ", Team_ColoredFullName(self.team), " held the ball for too long.\n");
oldself = self;
self = self.ballcarried;
DropBall(self, self.owner.origin, '0 0 0');
DropBall(self, ownr.origin, ownr.velocity);
makevectors(ownr.v_angle_y * '0 1 0');
ownr.velocity += ('0 0 0.75' - v_forward) * 1000;
- ownr.flags &~= FL_ONGROUND;
+ ownr.flags &= ~FL_ONGROUND;
}
void GiveBall(entity plyr, entity ball)
if((ownr = ball.owner))
{
- ownr.effects &~= autocvar_g_nexball_basketball_effects_default;
+ ownr.effects &= ~autocvar_g_nexball_basketball_effects_default;
ownr.ballcarried = world;
if(ownr.metertime)
{
ball.nb_dropper = plyr;
plyr.effects |= autocvar_g_nexball_basketball_effects_default;
- ball.effects &~= autocvar_g_nexball_basketball_effects_default;
+ ball.effects &= ~autocvar_g_nexball_basketball_effects_default;
ball.velocity = '0 0 0';
ball.movetype = MOVETYPE_NONE;
ownr = self;
self = plyr;
- WEPSET_COPY_EE(self.weaponentity, self);
+ self.weaponentity.weapons = self.weapons;
self.weaponentity.switchweapon = self.weapon;
- WEPSET_COPY_EW(self, WEP_PORTO);
+ self.weapons = WEPSET_PORTO;
weapon_action(WEP_PORTO, WR_RESETPLAYER);
self.switchweapon = WEP_PORTO;
W_SwitchWeapon(WEP_PORTO);
void DropBall(entity ball, vector org, vector vel)
{
ball.effects |= autocvar_g_nexball_basketball_effects_default;
- ball.effects &~= EF_NOSHADOW;
- ball.owner.effects &~= autocvar_g_nexball_basketball_effects_default;
+ ball.effects &= ~EF_NOSHADOW;
+ ball.owner.effects &= ~autocvar_g_nexball_basketball_effects_default;
setattachment(ball, world, "");
setorigin(ball, org);
ball.movetype = MOVETYPE_BOUNCE;
- ball.flags &~= FL_ONGROUND;
+ ball.flags &= ~FL_ONGROUND;
ball.scale = ball_scale;
ball.velocity = vel;
ball.nb_droptime = time;
void InitBall(void)
{
if(gameover) return;
- self.flags &~= FL_ONGROUND;
+ self.flags &= ~FL_ONGROUND;
self.movetype = MOVETYPE_BOUNCE;
if(self.classname == "nexball_basketball")
self.touch = basketball_touch;
self.teamtime = 0;
self.pusher = world;
self.team = FALSE;
- sound(self, CH_TRIGGER, self.noise1, VOL_BASE, ATTN_NORM);
+ sound(self, CH_TRIGGER, self.noise1, VOL_BASE, ATTEN_NORM);
WaypointSprite_Ping(self.waypointsprite_attachedforcarrier);
LogNB("init", world);
}
if(self.cnt < 2) // step 1
{
if(time == self.teamtime)
- bprint("The ", ColoredTeamName(self.team), " held the ball for too long.\n");
+ bprint("The ", Team_ColoredFullName(self.team), " held the ball for too long.\n");
+
self.touch = func_null;
self.movetype = MOVETYPE_NOCLIP;
self.velocity = '0 0 0'; // just in case?
{
if(time > self.lastground + 0.1)
{
- sound(self, CH_TRIGGER, self.noise, VOL_BASE, ATTN_NORM);
+ sound(self, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NORM);
self.lastground = time;
}
if(vlen(self.velocity) && !self.cnt)
self.nextthink = time + autocvar_g_nexball_delay_idle;
return;
}
- if(other.classname != "player")
+ if (!IS_PLAYER(other))
return;
if(other.health < 1)
return;
football_touch();
return;
}
- if(!self.cnt && other.classname == "player" && (other != self.nb_dropper || time > self.nb_droptime + autocvar_g_nexball_delay_collect))
+ if(!self.cnt && IS_PLAYER(other) && (other != self.nb_dropper || time > self.nb_droptime + autocvar_g_nexball_delay_collect))
{
if(other.health <= 0)
return;
}
else if(other.solid == SOLID_BSP)
{
- sound(self, CH_TRIGGER, self.noise, VOL_BASE, ATTN_NORM);
+ sound(self, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NORM);
if(vlen(self.velocity) && !self.cnt)
self.nextthink = min(time + autocvar_g_nexball_delay_idle, self.teamtime);
}
else
otherteam = 0;
- if((isclient = ball.pusher.flags & FL_CLIENT))
+ if((isclient = IS_CLIENT(ball.pusher)))
pname = ball.pusher.netname;
else
pname = "Someone (?)";
{
LogNB("fault", ball.pusher);
if(nb_teams == 2)
- bprint(ColoredTeamName(otherteam), " gets a point due to ", pname, "^7's silliness.\n");
+ bprint(Team_ColoredFullName(otherteam), " gets a point due to ", pname, "^7's silliness.\n");
else
- bprint(ColoredTeamName(ball.team), " loses a point due to ", pname, "^7's silliness.\n");
+ bprint(Team_ColoredFullName(ball.team), " loses a point due to ", pname, "^7's silliness.\n");
pscore = -1;
}
else if(self.team == GOAL_OUT)
else //score
{
LogNB(strcat("goal:", ftos(self.team)), ball.pusher);
- bprint("Goaaaaal! ", pname, "^7 scored a point for the ", ColoredTeamName(ball.team), ".\n");
+ bprint("Goaaaaal! ", pname, "^7 scored a point for the ", Team_ColoredFullName(ball.team), ".\n");
pscore = 1;
}
- sound(ball, CH_TRIGGER, self.noise, VOL_BASE, ATTN_NONE);
+ sound(ball, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NONE);
if(ball.team && pscore)
{
{
switch(e.team)
{
- case COLOR_TEAM1:
+ case NUM_TEAM_1:
if(!t_r)
{
nb_spawnteam("Red", e.team-1) ;
t_r = 1;
}
break;
- case COLOR_TEAM2:
+ case NUM_TEAM_2:
if(!t_b)
{
nb_spawnteam("Blue", e.team-1) ;
t_b = 1;
}
break;
- case COLOR_TEAM3:
+ case NUM_TEAM_3:
if(!t_y)
{
nb_spawnteam("Yellow", e.team-1);
t_y = 1;
}
break;
- case COLOR_TEAM4:
+ case NUM_TEAM_4:
if(!t_p)
{
nb_spawnteam("Pink", e.team-1) ;
// balls += 4; // using the remaining bits to count balls will leave more than the max edict count, so it's fine
- if(!self.model)
+ if(self.model == "")
{
self.model = "models/nexball/ball.md3";
self.scale = 1.3;
if(!autocvar_g_nexball_sound_bounce)
self.noise = "";
- else if(!self.noise)
+ else if(self.noise == "")
self.noise = "sound/nexball/bounce.wav";
//bounce sound placeholder (FIXME)
- if(!self.noise1)
+ if(self.noise1 == "")
self.noise1 = "sound/nexball/drop.wav";
//ball drop sound placeholder (FIXME)
- if(!self.noise2)
+ if(self.noise2 == "")
self.noise2 = "sound/nexball/steal.wav";
//stealing sound placeholder (FIXME)
if(self.noise) precache_sound(self.noise);
{
nexball_mode |= NBM_BASKETBALL;
self.classname = "nexball_basketball";
- if not(balls & BALL_BASKET)
+ if (!(balls & BALL_BASKET))
{
/*
CVTOV(g_nexball_basketball_effects_default);
}
EXACTTRIGGER_INIT;
self.classname = "nexball_goal";
- if(!self.noise)
+ if(self.noise == "")
self.noise = "ctf/respawn.wav";
precache_sound(self.noise);
self.touch = GoalTouch;
void spawnfunc_nexball_redgoal(void)
{
- self.team = COLOR_TEAM1;
+ self.team = NUM_TEAM_1;
SpawnGoal();
}
void spawnfunc_nexball_bluegoal(void)
{
- self.team = COLOR_TEAM2;
+ self.team = NUM_TEAM_2;
SpawnGoal();
}
void spawnfunc_nexball_yellowgoal(void)
{
- self.team = COLOR_TEAM3;
+ self.team = NUM_TEAM_3;
SpawnGoal();
}
void spawnfunc_nexball_pinkgoal(void)
{
- self.team = COLOR_TEAM4;
+ self.team = NUM_TEAM_4;
SpawnGoal();
}
void spawnfunc_nexball_fault(void)
{
self.team = GOAL_FAULT;
- if(!self.noise)
+ if(self.noise == "")
self.noise = "misc/typehit.wav";
SpawnGoal();
}
void spawnfunc_nexball_out(void)
{
self.team = GOAL_OUT;
- if(!self.noise)
+ if(self.noise == "")
self.noise = "misc/typehit.wav";
SpawnGoal();
}
PROJECTILE_TOUCH;
if(attacker.team != other.team || autocvar_g_nexball_basketball_teamsteal)
- if((ball = other.ballcarried) && (attacker.classname == "player"))
+ if((ball = other.ballcarried) && (IS_PLAYER(attacker)))
{
other.velocity = other.velocity + normalize(self.velocity) * other.damageforcescale * autocvar_g_balance_nexball_secondary_force;
- other.flags &~= FL_ONGROUND;
+ other.flags &= ~FL_ONGROUND;
if(!attacker.ballcarried)
{
LogNB("stole", attacker);
- sound(other, CH_TRIGGER, ball.noise2, VOL_BASE, ATTN_NORM);
+ sound(other, CH_TRIGGER, ball.noise2, VOL_BASE, ATTEN_NORM);
if(attacker.team == other.team && time > attacker.teamkill_complain)
{
{
if(!self.owner)
{
- self.effects &~= EF_FLAME;
+ self.effects &= ~EF_FLAME;
self.scale = 1;
self.customizeentityforclient = func_null;
return TRUE;
if(self.enemy)
self.effects |= EF_FLAME;
else
- self.effects &~= EF_FLAME;
+ self.effects &= ~EF_FLAME;
}
else
{
- self.effects &~= EF_FLAME;
+ self.effects &= ~EF_FLAME;
self.scale = 1;
}
precache_sound("misc/typehit.wav");
}
else if(req == WR_SETUP)
- weapon_setup(WEP_PORTO);
- else if(req == WR_SUICIDEMESSAGE)
- {
- w_deathtypestring = "is a weirdo";
- }
- else if(req == WR_KILLMESSAGE)
{
- w_deathtypestring = "got killed by #'s black magic";
+ weapon_setup(WEP_PORTO);
}
// No need to check WR_CHECKAMMO* or WR_AIM, it should always return TRUE
return TRUE;
//tracebox(self.origin + self.view_ofs, '-2 -2 -2', '2 2 2', self.origin + self.view_ofs + v_forward * autocvar_g_nexball_safepass_maxdist);
crosshair_trace(self);
if( trace_ent &&
- trace_ent.flags & FL_CLIENT &&
+ IS_CLIENT(trace_ent) &&
trace_ent.deadflag == DEAD_NO &&
trace_ent.team == self.team &&
vlen(trace_ent.origin - self.origin) <= autocvar_g_nexball_safepass_maxdist )
}
else
{
- if(!WEPSET_EMPTY_E(self.weaponentity))
+ if(self.weaponentity.weapons)
{
- WEPSET_COPY_EE(self, self.weaponentity);
+ self.weapons = self.weaponentity.weapons;
weapon_action(WEP_PORTO, WR_RESETPLAYER);
self.switchweapon = self.weaponentity.switchweapon;
W_SwitchWeapon(self.switchweapon);
- WEPSET_CLEAR_E(self.weaponentity);
+ self.weaponentity.weapons = '0 0 0';
}
}
}
+
+ nexball_setstatus();
+
return FALSE;
}
MUTATOR_HOOKFUNCTION(nexball_PlayerSpawn)
{
- WEPSET_CLEAR_E(self.weaponentity);
+ self.weaponentity.weapons = '0 0 0';
if(nexball_mode & NBM_BASKETBALL)
- WEPSET_OR_EW(self, WEP_PORTO);
+ self.weapons |= WEPSET_PORTO;
else
- WEPSET_CLEAR_E(self);
+ self.weapons = '0 0 0';
+
+ return FALSE;
+}
+MUTATOR_HOOKFUNCTION(nexball_SetStartItems)
+{
+ start_items |= IT_UNLIMITED_SUPERWEAPONS; // FIXME BAD BAD BAD BAD HACK, NEXBALL SHOULDN'T ABUSE PORTO'S WEAPON SLOT
+
return FALSE;
}
MUTATOR_HOOK(BuildMutatorsString, nexball_BuildMutatorsString, CBC_ORDER_ANY);
MUTATOR_HOOK(PlayerSpawn, nexball_PlayerSpawn, CBC_ORDER_ANY);
MUTATOR_HOOK(PlayerPreThink, nexball_PlayerPreThink, CBC_ORDER_ANY);
+ MUTATOR_HOOK(SetStartItems, nexball_SetStartItems, CBC_ORDER_ANY);
MUTATOR_ONADD
{