From: Mario Date: Tue, 19 Mar 2013 05:28:52 +0000 (+1100) Subject: Fix scoreboard showing incorrect monster count in TD X-Git-Tag: xonotic-v0.8.0~241^2^2~438 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d6f31d26248d2d231c3a77b7de0eeb7f8968c188;p=xonotic%2Fxonotic-data.pk3dir.git Fix scoreboard showing incorrect monster count in TD --- diff --git a/qcsrc/server/accuracy.qc b/qcsrc/server/accuracy.qc index f7a01d572..c5f3bc740 100644 --- a/qcsrc/server/accuracy.qc +++ b/qcsrc/server/accuracy.qc @@ -110,7 +110,7 @@ void accuracy_add(entity e, float w, float fired, float hit) float accuracy_isgooddamage(entity attacker, entity targ) { if(!inWarmupStage) - if(targ.flags & FL_CLIENT) + if((g_td && targ.flags & FL_MONSTER) || (!g_td && targ.flags & FL_CLIENT)) if(!(attacker.flags & FL_MONSTER)) // no accuracy for monsters if(targ.deadflag == DEAD_NO) if(IsDifferentTeam(attacker, targ)) diff --git a/qcsrc/server/mutators/gamemode_towerdefense.qc b/qcsrc/server/mutators/gamemode_towerdefense.qc index 0d8238ab2..d971d9e59 100644 --- a/qcsrc/server/mutators/gamemode_towerdefense.qc +++ b/qcsrc/server/mutators/gamemode_towerdefense.qc @@ -528,13 +528,13 @@ void combat_phase_announce() // TODO: clean up these fail nextthinks... void build_phase() { entity head; - float n_players = 0, gen_washealed = FALSE, player_washealed = FALSE; + float n_players = 0, gen_washealed = FALSE, mcount, mskill; current_phase = PHASE_BUILD; for(head = world;(head = find(head, classname, "td_generator")); ) { - if(head.health <= 5 && head.max_health > 10) + if(head.health <= 15 && head.max_health > 100) Announce("lastsecond"); if(head.health < head.max_health) @@ -548,28 +548,24 @@ void build_phase() FOR_EACH_PLAYER(head) { - if(head.health < 100) - { - player_washealed = TRUE; - break; // we found 1, so no need to check the others - } + if(head.health < 100) head.health = 100; + if(gen_washealed) PlayerScore_Add(head, SP_TD_SCORE, -autocvar_g_td_generator_damaged_points); + + n_players += 1; } + + mcount = autocvar_g_td_monster_count_increment * wave_count; + mskill = n_players * 0.02; - totalmonsters += autocvar_g_td_monster_count_increment * wave_count; + totalmonsters += mcount; monster_skill += autocvar_g_td_monsters_skill_increment; + monster_skill += mskill; + if(monster_skill < 1) monster_skill = 1; + if(totalmonsters < 1) totalmonsters = ((autocvar_g_td_monster_count > 0) ? autocvar_g_td_monster_count : 10); if(wave_count < 1) wave_count = 1; Send_Notification(NOTIF_ALL, world, MSG_MULTI, MULTI_TD_PHASE_BUILD, wave_count, totalmonsters, autocvar_g_td_buildphase_time); - - FOR_EACH_PLAYER(head) - { - if(head.health < 100) head.health = 100; - - if(gen_washealed) PlayerScore_Add(head, SP_TD_SCORE, -autocvar_g_td_generator_damaged_points); - - n_players += 1; - } FOR_EACH_MONSTER(head) { @@ -582,16 +578,6 @@ void build_phase() remove(head); } - if(n_players >= 2) - { - totalmonsters += n_players; - monster_skill += n_players * 0.05; - } - - if(monster_skill < 1) monster_skill = 1; - - if(totalmonsters < 1) totalmonsters = ((autocvar_g_td_monster_count > 0) ? autocvar_g_td_monster_count : 10); - monsters_total = totalmonsters; monsters_killed = 0;