void basketball_touch();
void football_touch();
void ResetBall();
-#define NBM_NONE 0
-#define NBM_FOOTBALL 2
-#define NBM_BASKETBALL 4
+const float NBM_NONE = 0;
+const float NBM_FOOTBALL = 2;
+const float NBM_BASKETBALL = 4;
float nexball_mode;
float OtherTeam(float t) //works only if there are two teams on the map!
return e.team;
}
+const float ST_NEXBALL_GOALS = 1;
+const float SP_NEXBALL_GOALS = 4;
+const float SP_NEXBALL_FAULTS = 5;
+void nb_ScoreRules(float teams)
+{
+ ScoreRules_basics(teams, 0, 0, TRUE);
+ ScoreInfo_SetLabel_TeamScore( ST_NEXBALL_GOALS, "goals", SFL_SORT_PRIO_PRIMARY);
+ ScoreInfo_SetLabel_PlayerScore( SP_NEXBALL_GOALS, "goals", SFL_SORT_PRIO_PRIMARY);
+ ScoreInfo_SetLabel_PlayerScore(SP_NEXBALL_FAULTS, "faults", SFL_SORT_PRIO_SECONDARY | SFL_LOWER_IS_BETTER);
+ ScoreRules_basics_end();
+}
void LogNB(string mode, entity actor)
{
self.weaponentity.weapons = self.weapons;
self.weaponentity.switchweapon = self.weapon;
self.weapons = WEPSET_PORTO;
- weapon_action(WEP_PORTO, WR_RESETPLAYER);
+ WEP_ACTION(WEP_PORTO, WR_RESETPLAYER);
self.switchweapon = WEP_PORTO;
W_SwitchWeapon(WEP_PORTO);
self = ownr;
football_touch();
return;
}
- if(!self.cnt && IS_PLAYER(other) && (other != self.nb_dropper || time > self.nb_droptime + autocvar_g_nexball_delay_collect))
+ if(!self.cnt && IS_PLAYER(other) && !other.frozen && !other.deadflag && (other != self.nb_dropper || time > self.nb_droptime + autocvar_g_nexball_delay_collect))
{
if(other.health <= 0)
return;
}
}
-// scoreboard setup
-void nb_ScoreRules(float teams)
-{
- ScoreRules_basics(teams, 0, 0, TRUE);
- ScoreInfo_SetLabel_TeamScore( ST_NEXBALL_GOALS, "goals", SFL_SORT_PRIO_PRIMARY);
- ScoreInfo_SetLabel_PlayerScore( SP_NEXBALL_GOALS, "goals", SFL_SORT_PRIO_PRIMARY);
- ScoreInfo_SetLabel_PlayerScore(SP_NEXBALL_FAULTS, "faults", SFL_SORT_PRIO_SECONDARY | SFL_LOWER_IS_BETTER);
- ScoreRules_basics_end();
-}
-
void nb_delayedinit(void)
{
if(find(world, classname, "nexball_team") == world)
PROJECTILE_TOUCH;
if(attacker.team != other.team || autocvar_g_nexball_basketball_teamsteal)
- if((ball = other.ballcarried) && !other.deadflag && (IS_PLAYER(attacker)))
+ if((ball = other.ballcarried) && !other.frozen && !other.deadflag && (IS_PLAYER(attacker)))
{
other.velocity = other.velocity + normalize(self.velocity) * other.damageforcescale * autocvar_g_balance_nexball_secondary_force;
other.flags &= ~FL_ONGROUND;
mi = autocvar_g_nexball_basketball_meter_minpower;
ma = max(mi, autocvar_g_nexball_basketball_meter_maxpower); // avoid confusion
//One triangle wave period with 1 as max
- mul = 2 * mod(t, g_nexball_meter_period) / g_nexball_meter_period;
+ mul = 2 * (t % g_nexball_meter_period) / g_nexball_meter_period;
if(mul > 1)
mul = 2 - mul;
mul = mi + (ma - mi) * mul; // range from the minimal power to the maximal power
setsize(missile, '0 0 0', '0 0 0');
setorigin(missile, w_shotorg);
- W_SetupProjectileVelocity(missile, autocvar_g_balance_nexball_secondary_speed, 0);
+ W_SetupProjVelocity_Basic(missile, autocvar_g_balance_nexball_secondary_speed, 0);
missile.angles = vectoangles(missile.velocity);
missile.touch = W_Nexball_Touch;
missile.think = SUB_Remove;
weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_nexball_primary_animtime, w_ready);
}
}
- else if(req == WR_PRECACHE)
+ else if(req == WR_INIT)
{
precache_model("models/weapons/g_porto.md3");
precache_model("models/weapons/v_porto.md3");
}
else if(req == WR_SETUP)
{
- weapon_setup(WEP_PORTO);
+ //weapon_setup(WEP_PORTO);
}
// No need to check WR_CHECKAMMO* or WR_AIM, it should always return TRUE
return TRUE;
if(self.weaponentity.weapons)
{
self.weapons = self.weaponentity.weapons;
- weapon_action(WEP_PORTO, WR_RESETPLAYER);
+ WEP_ACTION(WEP_PORTO, WR_RESETPLAYER);
self.switchweapon = self.weaponentity.switchweapon;
W_SwitchWeapon(self.switchweapon);
MUTATOR_HOOKFUNCTION(nexball_ForbidThrowing)
{
- if(self.weapon == WEP_GRENADE_LAUNCHER)
+ if(self.weapon == WEP_MORTAR)
return TRUE;
return FALSE;
MUTATOR_HOOKFUNCTION(nexball_FilterItem)
{
if(self.classname == "droppedweapon")
- if(self.weapon == WEP_GRENADE_LAUNCHER)
+ if(self.weapon == WEP_MORTAR)
return TRUE;
return FALSE;
g_nexball_meter_period = rint(g_nexball_meter_period * 32) / 32; //Round to 1/32ths to send as a byte multiplied by 32
addstat(STAT_NB_METERSTART, AS_FLOAT, metertime);
- w_porto(WR_PRECACHE); // abuse
-
// General settings
/*
CVTOV(g_nexball_football_boost_forward); //100