X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fgamemodes%2Fgamemode%2Fnexball%2Fnexball.qc;h=163d7b81cbda375b689661b62b3e7498ad77bd65;hb=f366b93e1d9e8ebdff81c9277f9958178dcb38d0;hp=8e632f7c7ebd1524bd9f3a74689486c868e4a838;hpb=0a980f57412cf2253cfd73c8c01a26fb04c87189;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc b/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc index 8e632f7c7..163d7b81c 100644 --- a/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc +++ b/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc @@ -1,6 +1,5 @@ #include "nexball.qh" -#ifdef IMPLEMENTATION #ifdef CSQC int autocvar_cl_eventchase_nexball = 1; @@ -70,8 +69,6 @@ float OtherTeam(float t) //works only if there are two teams on the map! } const float ST_NEXBALL_GOALS = 1; -const float SP_NEXBALL_GOALS = 4; -const float SP_NEXBALL_FAULTS = 5; void nb_ScoreRules(int teams) { ScoreRules_basics(teams, 0, 0, true); @@ -106,9 +103,9 @@ void nexball_setstatus(entity this) { if(this.ballcarried.teamtime && (this.ballcarried.teamtime < time)) { - bprint("The ", Team_ColoredFullName(this.team), " held the ball for too long.\n"); - DropBall(this.ballcarried, this.ballcarried.owner.origin, '0 0 0'); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(this.team, INFO_NEXBALL_RETURN_HELD)); entity e = this.ballcarried; + DropBall(this.ballcarried, this.ballcarried.owner.origin, '0 0 0'); ResetBall(e); } else @@ -258,7 +255,7 @@ void ResetBall(entity this) if(this.cnt < 2) // step 1 { if(time == this.teamtime) - bprint("The ", Team_ColoredFullName(this.team), " held the ball for too long.\n"); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(this.team, INFO_NEXBALL_RETURN_HELD)); settouch(this, func_null); set_movetype(this, MOVETYPE_NOCLIP); @@ -461,7 +458,7 @@ spawnfunc(nexball_team) void nb_spawnteam(string teamname, float teamcolor) { - LOG_TRACE("^2spawned team ", teamname, "\n"); + LOG_TRACE("^2spawned team ", teamname); entity e = new(nexball_team); e.netname = teamname; e.cnt = teamcolor; @@ -764,14 +761,14 @@ void W_Nexball_Touch(entity this, entity toucher) delete(this); } -void W_Nexball_Attack(entity actor, float t) +void W_Nexball_Attack(entity actor, .entity weaponentity, float t) { entity ball; float mul, mi, ma; if(!(ball = actor.ballcarried)) return; - W_SetupShot(actor, false, 4, SND_NB_SHOOT1, CH_WEAPON_A, 0); + W_SetupShot(actor, weaponentity, false, 4, SND_NB_SHOOT1, CH_WEAPON_A, 0); tracebox(w_shotorg, BALL_MINS, BALL_MAXS, w_shotorg, MOVE_WORLDONLY, NULL); if(trace_startsolid) { @@ -802,12 +799,12 @@ void W_Nexball_Attack(entity actor, float t) vector trigger_push_calculatevelocity(vector org, entity tgt, float ht); -void W_Nexball_Attack2(entity actor) +void W_Nexball_Attack2(entity actor, .entity weaponentity) { if(actor.ballcarried.enemy) { entity _ball = actor.ballcarried; - W_SetupShot(actor, false, 4, SND_NB_SHOOT1, CH_WEAPON_A, 0); + W_SetupShot(actor, weaponentity, false, 4, SND_NB_SHOOT1, CH_WEAPON_A, 0); DropBall(_ball, w_shotorg, trigger_push_calculatevelocity(_ball.origin, _ball.enemy, 32)); setthink(_ball, W_Nexball_Think); _ball.nextthink = time; @@ -817,7 +814,7 @@ void W_Nexball_Attack2(entity actor) if(!autocvar_g_nexball_tackling) return; - W_SetupShot(actor, false, 2, SND_NB_SHOOT2, CH_WEAPON_A, 0); + W_SetupShot(actor, weaponentity, false, 2, SND_NB_SHOOT2, CH_WEAPON_A, 0); entity missile = new(ballstealer); missile.owner = actor; @@ -837,6 +834,8 @@ void W_Nexball_Attack2(entity actor) missile.effects = EF_BRIGHTFIELD | EF_LOWPRECISION; missile.flags = FL_PROJECTILE; + IL_PUSH(g_projectiles, missile); + IL_PUSH(g_bot_dodge, missile); CSQCProjectile(missile, true, PROJECTILE_ELECTRO, true); } @@ -882,19 +881,19 @@ METHOD(BallStealer, wr_think, void(BallStealer thiswep, entity actor, .entity we } else { - W_Nexball_Attack(actor, -1); + W_Nexball_Attack(actor, weaponentity, -1); weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, autocvar_g_balance_nexball_primary_animtime, w_ready); } if(fire & 2) if(weapon_prepareattack(thiswep, actor, weaponentity, true, autocvar_g_balance_nexball_secondary_refire)) { - W_Nexball_Attack2(actor); + W_Nexball_Attack2(actor, weaponentity); weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, autocvar_g_balance_nexball_secondary_animtime, w_ready); } if(!(fire & 1) && actor.metertime && actor.ballcarried) { - W_Nexball_Attack(actor, time - actor.metertime); + W_Nexball_Attack(actor, weaponentity, time - actor.metertime); // DropBall or stealing will set metertime back to 0 weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, autocvar_g_balance_nexball_primary_animtime, w_ready); } @@ -1087,7 +1086,7 @@ MUTATOR_HOOKFUNCTION(nb, ItemTouch) return MUT_ITEMTOUCH_CONTINUE; } -MUTATOR_HOOKFUNCTION(nb, GetTeamCount) +MUTATOR_HOOKFUNCTION(nb, CheckAllowedTeams) { M_ARGV(1, string) = "nexball_team"; return true; @@ -1158,4 +1157,3 @@ REGISTER_MUTATOR(nb, g_nexball) } #endif -#endif