X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fmutators%2Fgamemode_nexball.qc;h=92e707b061948c84ca2598c90bde7f42bfde3732;hb=971eb36c4ccfde80cd46767b0c20e2d97350821e;hp=85377836d5f432887b77737c25a8036978cc96b1;hpb=57e8b59f96ec28979c3dc01811412c9c26e60fdc;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/mutators/gamemode_nexball.qc b/qcsrc/server/mutators/gamemode_nexball.qc index 85377836d..92e707b06 100644 --- a/qcsrc/server/mutators/gamemode_nexball.qc +++ b/qcsrc/server/mutators/gamemode_nexball.qc @@ -8,9 +8,9 @@ vector autocvar_g_nexball_viewmodel_offset; 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! @@ -22,6 +22,17 @@ 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) { @@ -288,7 +299,7 @@ void basketball_touch(void) football_touch(); return; } - if(!self.cnt && IS_PLAYER(other) && !other.frozen && (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; @@ -457,16 +468,6 @@ void nb_spawnteams(void) } } -// 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) @@ -694,7 +695,7 @@ void W_Nexball_Touch(void) 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; @@ -740,7 +741,7 @@ void W_Nexball_Attack(float t) 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 @@ -1011,8 +1012,6 @@ MUTATOR_DEFINITION(gamemode_nexball) 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_INIT); // abuse - // General settings /* CVTOV(g_nexball_football_boost_forward); //100