Merge remote branch 'origin/samual/hitindication'
authorRudolf Polzer <divVerent@xonotic.org>
Mon, 14 Feb 2011 17:46:06 +0000 (18:46 +0100)
committerRudolf Polzer <divVerent@xonotic.org>
Mon, 14 Feb 2011 17:46:06 +0000 (18:46 +0100)
qcsrc/client/hud.qc
qcsrc/client/scoreboard.qc
qcsrc/common/mapinfo.qc
qcsrc/server/g_damage.qc
qcsrc/server/mutators/gamemode_keepaway.qc
qcsrc/server/scores_rules.qc
qcsrc/server/w_crylink.qc

index a383c35..e8309ef 100644 (file)
@@ -395,9 +395,9 @@ string MakeRaceString(float cp, float mytime, float histime, float lapdelta, str
        if(histime < 0)
                return strcat(col, cpname);
        else if(hisname == "")
-               return strcat(col, sprintf(_("%s (%s)")), cpname, timestr);
+               return strcat(col, sprintf(_("%s (%s)"), cpname, timestr));
        else
-               return strcat(col, sprintf(_("%s (%s %s)")), cpname, timestr, strcat(hisname, col, lapstr));
+               return strcat(col, sprintf(_("%s (%s %s)"), cpname, timestr, strcat(hisname, col, lapstr)));
 }
 
 // Check if the given name already exist in race rankings? In that case, where? (otherwise return 0)
index c719985..517065a 100644 (file)
@@ -17,6 +17,7 @@ string TranslateScoresLabel(string l)
        switch(l)
        {
                case "bckills": return CTX(_("SCO^bckills"));
+               case "bctime": return CTX(_("SCO^bctime"));
                case "caps": return CTX(_("SCO^caps"));
                case "deaths": return CTX(_("SCO^deaths"));
                case "destroyed": return CTX(_("SCO^destroyed"));
@@ -252,7 +253,7 @@ void Cmd_HUD_Help(float argc)
        print(_("^3frags^7                    kills - suicides\n"));
        print(_("^3kd^7                       The kill-death ratio\n"));
        print(_("^3caps^7                     How often a flag (CTF) or a key (KeyHunt) was captured\n"));
-       print(_("^3pickups^7                  How often a flag (CTF) or a key (KeyHunt) was picked up\n"));
+       print(_("^3pickups^7                  How often a flag (CTF) or a key (KeyHunt) or a ball (Keepaway) was picked up\n"));
        print(_("^3fckills^7                  Number of flag carrier kills\n"));
        print(_("^3returns^7                  Number of flag returns\n"));
        print(_("^3drops^7                    Number of flag drops\n"));
@@ -267,6 +268,8 @@ void Cmd_HUD_Help(float argc)
        print(_("^3fastest^7                  Time of fastest lap (race/cts)\n"));
        print(_("^3ticks^7                    Number of ticks (DOM)\n"));
        print(_("^3takes^7                    Number of domination points taken (DOM)\n"));
+       print(_("^3bckills^7                  Number of ball carrier kills\n"));
+       print(_("^3bctime^7                   Total amount of time holding the ball in Keepaway\n"));
        print(_("^3score^7                    Total score\n\n"));
 
        print(_("Before a field you can put a + or - sign, then a comma separated list\n"
@@ -293,7 +296,7 @@ string HUD_DefaultColumnLayout()
                "+lms/lives +lms/rank ",
                "+kh/caps +kh/pushes +kh/destroyed ",
                "?+race/laps ?+race/time ?+race/fastest ",
-               "+as/objectives +nexball/faults +nexball/goals +ka/drops +ka/pickups +ka/bckills +ka/time +freezetag/revivals ",
+               "+as/objectives +nexball/faults +nexball/goals +ka/pickups +ka/bckills +ka/bctime +freezetag/revivals ",
                "-lms,race,nexball/score");
 }
 
index 741565f..58f0cc8 100644 (file)
@@ -409,7 +409,6 @@ string _MapInfo_GetDefault(float t)
                case MAPINFO_TYPE_NEXBALL:         return "5 20 0";
                case MAPINFO_TYPE_CTS:             return "20 0 0";
                case MAPINFO_TYPE_FREEZETAG:       return "10 20 0";
-               case MAPINFO_TYPE_KEEPAWAY:        return "30 20 0";
                // NOTE: DO NOT ADD ANY MORE GAME TYPES HERE
                // THIS IS JUST LEGACY SUPPORT FOR NEXUIZ MAPS
                // ONLY ADD NEW STUFF TO _MapInfo_GetDefaultEx
@@ -470,6 +469,7 @@ void _MapInfo_Map_ApplyGametype(string s, float pWantedType, float pThisType, fl
                s = cdr(s);
        }
 
+       /* keepaway wuz here
        if(pWantedType == MAPINFO_TYPE_KEEPAWAY)
        {
                sa = car(s);
@@ -477,7 +477,8 @@ void _MapInfo_Map_ApplyGametype(string s, float pWantedType, float pThisType, fl
                        cvar_set("fraglimit", sa);
                s = cdr(s);
        }
-
+       */
+       
        // rc = timelimit timelimit_qualification laps laps_teamplay
        if(pWantedType == MAPINFO_TYPE_RACE)
        {
index 60b0bd4..d27c31a 100644 (file)
@@ -789,9 +789,8 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                                {
                                        if(damage > 0)
                                        {
-                                               if(attacker.weapon != WEP_LASER
-                                               && (attacker.weapon != WEP_ELECTRO || !autocvar_g_balance_electro_lightning)
-                                               && attacker.prevhitsound + autocvar_sv_hitsound_antispam_time < time)
+                                               if(deathtype != DEATH_FIRE)
+                                               if(attacker.prevhitsound + autocvar_sv_hitsound_antispam_time < time)
                                                {
                                                        if(targ.BUTTON_CHAT)
                                                                attacker.typehitsound += 1;
@@ -823,8 +822,8 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                                }
                                else
                                {
-                                       if(deathtype != DEATH_FIRE
-                                       && attacker.prevhitsound + autocvar_sv_hitsound_antispam_time < time)
+                                       if(deathtype != DEATH_FIRE)
+                                       if(attacker.prevhitsound + autocvar_sv_hitsound_antispam_time < time)
                                        {
                                                attacker.typehitsound += 1;
                                                attacker.prevhitsound = time;
index a23169c..60c39d4 100644 (file)
@@ -172,7 +172,7 @@ void ka_DropEvent(entity plyr) // runs any time that a player is supposed to los
        sound(other, CHAN_AUTO, "keepaway/dropped.wav", VOL_BASE, ATTN_NONE);   // ATTN_NONE (it's a sound intended to be heard anywhere) 
        
        // scoring
-       PlayerScore_Add(plyr, SP_KEEPAWAY_DROPS, 1);
+       // PlayerScore_Add(plyr, SP_KEEPAWAY_DROPS, 1); Not anymore, this is 100% the same as pickups and is useless.
        
        // waypoints
        WaypointSprite_Spawn("ka-ball", 0, 0, ball, '0 0 64', world, ball.team, ball, waypointsprite_attachedforcarrier, FALSE);
@@ -200,7 +200,7 @@ void ka_TimeScoring()
                if(autocvar_g_keepaway_score_timepoints)
                        PlayerScore_Add(self.owner, SP_SCORE, autocvar_g_keepaway_score_timepoints);
                        
-               PlayerScore_Add(self.owner, SP_KEEPAWAY_TIME, (autocvar_g_keepaway_score_timeinterval / 1)); // interval is divided by 1 so that time always shows "seconds"
+               PlayerScore_Add(self.owner, SP_KEEPAWAY_BCTIME, (autocvar_g_keepaway_score_timeinterval / 1)); // interval is divided by 1 so that time always shows "seconds"
                self.nextthink = time + autocvar_g_keepaway_score_timeinterval;
        }
 }
index 18c780d..2e75fef 100644 (file)
@@ -190,15 +190,13 @@ void ScoreRules_nexball(float teams)
 // Keep Away stuff
 #define SP_KEEPAWAY_PICKUPS 4
 #define SP_KEEPAWAY_CARRIERKILLS 5
-#define SP_KEEPAWAY_DROPS 6
-#define SP_KEEPAWAY_TIME 7
+#define SP_KEEPAWAY_BCTIME 6
 void ScoreRules_keepaway()
 {
        ScoreRules_basics(0, SFL_SORT_PRIO_PRIMARY, 0, TRUE); // SFL_SORT_PRIO_PRIMARY
        ScoreInfo_SetLabel_PlayerScore(SP_KEEPAWAY_PICKUPS,                     "pickups",              0);
        ScoreInfo_SetLabel_PlayerScore(SP_KEEPAWAY_CARRIERKILLS,        "bckills",              0);
-       ScoreInfo_SetLabel_PlayerScore(SP_KEEPAWAY_DROPS,                       "drops",                SFL_LOWER_IS_BETTER);
-       ScoreInfo_SetLabel_PlayerScore(SP_KEEPAWAY_TIME,                        "time",                 SFL_SORT_PRIO_SECONDARY);
+       ScoreInfo_SetLabel_PlayerScore(SP_KEEPAWAY_BCTIME,                      "bctime",                       SFL_SORT_PRIO_SECONDARY);
        ScoreRules_basics_end();
 }
 
index aa5029c..93a110d 100644 (file)
@@ -57,7 +57,10 @@ void W_Crylink_LinkExplode (entity e, entity e2)
        if(e == e.realowner.crylink_lastgroup)
                e.realowner.crylink_lastgroup = world;
 
-       RadiusDamage (e, e.realowner, autocvar_g_balance_crylink_primary_damage * a, autocvar_g_balance_crylink_primary_edgedamage * a, autocvar_g_balance_crylink_primary_radius, world, autocvar_g_balance_crylink_primary_force * a, e.projectiledeathtype, other);
+       if(e.projectiledeathtype & HITTYPE_SECONDARY)
+               RadiusDamage (e, e.realowner, autocvar_g_balance_crylink_secondary_damage * a, autocvar_g_balance_crylink_secondary_edgedamage * a, autocvar_g_balance_crylink_secondary_radius, world, autocvar_g_balance_crylink_secondary_force * a, e.projectiledeathtype, other);
+       else
+               RadiusDamage (e, e.realowner, autocvar_g_balance_crylink_primary_damage * a, autocvar_g_balance_crylink_primary_edgedamage * a, autocvar_g_balance_crylink_primary_radius, world, autocvar_g_balance_crylink_primary_force * a, e.projectiledeathtype, other);
 
        if(e.queuenext != e2)
                W_Crylink_LinkExplode(e.queuenext, e2);
@@ -279,7 +282,7 @@ void W_Crylink_Touch2 (void)
        }
 
        float a;
-       a = 1 - (time - self.fade_time) * self.fade_rate;
+       a = bound(0, 1 - (time - self.fade_time) * self.fade_rate, 1);
 
        finalhit = ((self.cnt <= 0) || (other.takedamage != DAMAGE_NO));
        if(finalhit)