X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fattic%2Fnexball.qc;h=dc9c91ce68d9102ffaaccaa5a4a13fe335b99fd9;hb=e63ba76493751c027455b946d0b94b3a5beace47;hp=a068a33a54e236017194c3ec5ac05e5caa0b9df1;hpb=a321c69d9d812d97741c33099eaf295b1fa518ab;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/attic/nexball.qc b/qcsrc/server/attic/nexball.qc index a068a33a5..dc9c91ce6 100644 --- a/qcsrc/server/attic/nexball.qc +++ b/qcsrc/server/attic/nexball.qc @@ -28,6 +28,9 @@ float nb_teams; .float teamtime; +.float nb_dropperid; +.float nb_droptime; + void nb_delayedinit(); void nb_init() // Called early (worldspawn stage) { @@ -155,14 +158,14 @@ void GiveBall (entity plyr, entity ball) ball.owner = ball.pusher = plyr; //"owner" is set to the player carrying, "pusher" to the last player who touched it ball.team = plyr.team; plyr.ballcarried = ball; - ball.dropperid = plyr.playerid; + ball.nb_dropperid = plyr.playerid; plyr.effects |= g_nexball_basketball_effects_default; ball.effects &~= g_nexball_basketball_effects_default; ball.velocity = '0 0 0'; ball.movetype = MOVETYPE_NONE; - ball.touch = SUB_Null; + ball.touch = func_null; ball.effects |= EF_NOSHADOW; ball.scale = 1; // scale down. @@ -188,7 +191,7 @@ void DropBall (entity ball, vector org, vector vel) ball.flags &~= FL_ONGROUND; ball.scale = ball_scale; ball.velocity = vel; - ball.ctf_droptime = time; + ball.nb_droptime = time; ball.touch = basketball_touch; ball.think = ResetBall; ball.nextthink = min(time + g_nexball_delay_idle, ball.teamtime); @@ -232,7 +235,7 @@ void ResetBall (void) if (self.cnt < 2) { // step 1 if (time == self.teamtime) bprint("The ", ColoredTeamName(self.team), " held the ball for too long.\n"); - self.touch = SUB_Null; + self.touch = func_null; self.movetype = MOVETYPE_NOCLIP; self.velocity = '0 0 0'; // just in case? if(!self.cnt) @@ -302,7 +305,7 @@ void basketball_touch (void) football_touch(); return; } - if (!self.cnt && other.classname == "player" && (other.playerid != self.dropperid || time > self.ctf_droptime + autocvar_g_nexball_delay_collect)) { + if (!self.cnt && other.classname == "player" && (other.playerid != self.nb_dropperid || time > self.nb_droptime + autocvar_g_nexball_delay_collect)) { if (other.health <= 0) return; LogNB("caught", other); @@ -391,7 +394,7 @@ void GoalTouch (void) ball.cnt = 1; ball.think = ResetBall; if (ball.classname == "nexball_basketball") - ball.touch = football_touch; // better than SUB_Null: football control until the ball gets reset + ball.touch = football_touch; // better than func_null: football control until the ball gets reset ball.nextthink = time + autocvar_g_nexball_delay_goal * (self.team != GOAL_OUT); } @@ -424,10 +427,10 @@ void nb_spawnteams (void) { switch(e.team) { - case COLOR_TEAM1: if(!t_r) { nb_spawnteam ("Red", e.team-1) ; t_r = 1; } break; - case COLOR_TEAM2: if(!t_b) { nb_spawnteam ("Blue", e.team-1) ; t_b = 1; } break; - case COLOR_TEAM3: if(!t_y) { nb_spawnteam ("Yellow", e.team-1); t_y = 1; } break; - case COLOR_TEAM4: if(!t_p) { nb_spawnteam ("Pink", e.team-1) ; t_p = 1; } break; + case NUM_TEAM_1: if(!t_r) { nb_spawnteam ("Red", e.team-1) ; t_r = 1; } break; + case NUM_TEAM_2: if(!t_b) { nb_spawnteam ("Blue", e.team-1) ; t_b = 1; } break; + case NUM_TEAM_3: if(!t_y) { nb_spawnteam ("Yellow", e.team-1); t_y = 1; } break; + case NUM_TEAM_4: if(!t_p) { nb_spawnteam ("Pink", e.team-1) ; t_p = 1; } break; } } } @@ -538,22 +541,22 @@ void SpawnGoal (void) 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(); }