]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into mirceakitsune/universal_reload_system
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 14 Feb 2011 16:08:51 +0000 (18:08 +0200)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 14 Feb 2011 16:08:51 +0000 (18:08 +0200)
qcsrc/client/hud.qc
qcsrc/client/scoreboard.qc
qcsrc/common/items.qc
qcsrc/common/items.qh
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 a383c355c9407cf9d9d57ece639623693c8cfa94..e8309ef4e92a75cfcb633108c2471e9462b6c281 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 c719985d033893428e5f84f4cf103224b4eaf59e..517065ac5dd02fade24a500103bdb580dc09e26e 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 5387c05aae1cac4d2d26d1aae4172536be840326..3ddf8099f51c0736471859939a61b79b97e21df6 100644 (file)
@@ -19,6 +19,18 @@ void register_weapon(float id, float(float) func, float ammotype, float i, float
        e.model2 = strzone(strcat("wpn-", e.mdl));
        e.impulse = i;
        e.bot_pickupbasevalue = pickupbasevalue;
+       if(ammotype & IT_SHELLS)
+               e.ammo_field = ammo_shells;
+       else if(ammotype & IT_NAILS)
+               e.ammo_field = ammo_nails;
+       else if(ammotype & IT_ROCKETS)
+               e.ammo_field = ammo_rockets;
+       else if(ammotype & IT_CELLS)
+               e.ammo_field = ammo_cells;
+       else if(ammotype & IT_FUEL)
+               e.ammo_field = ammo_fuel;
+       else
+               e.ammo_field = ammo_batteries;
 }
 float w_null(float dummy)
 {
index 9293618f1623c7b8c847294f1a4f2080275275a6..c98ff786b9cb9c12ceaa380907930d2f0334d7bd 100644 (file)
@@ -61,6 +61,14 @@ string W_FixWeaponOrder(string order, float complete);
 string W_NameWeaponOrder(string order);
 string W_NumberWeaponOrder(string order);
 
+// ammo types
+.float ammo_shells;
+.float ammo_nails;
+.float ammo_rockets;
+.float ammo_cells;
+.float ammo_fuel;
+.float ammo_batteries; // dummy
+
 // entity properties of weaponinfo:
 .float weapon; // WEP_...
 .float weapons; // WEPBIT_...
@@ -74,8 +82,7 @@ string W_NumberWeaponOrder(string order);
 .float impulse; // weapon impulse
 .float bot_pickupbasevalue; // bot weapon priority
 .string model2; // wpn- sprite name
-
-
+..float ammo_field; // main ammo field
 
 // dynamic weapon adding
 float w_null(float dummy);
index 741565f3d1decb20c5f70ed1a02ee47462f66595..58f0cc852a6e07383df3dadd8ce1d4e466c5a15a 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 e1ee5706856c05e98fd49c717c20bb6dee0277eb..68be349714138d5f6f865ac5d53494fd820fc1b1 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;
@@ -822,8 +821,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 a23169c37346758fb1c7adbec38f8586f74d30f7..60c39d43410498bc752265a9d0d9e1f645da9ca2 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 18c780d8147a2499d6869c02c9b9b448af361c96..2e75fefb9f41402bfa09193dfb313b1e3d452dd1 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 974e5a94bd8f1540f93d918496cd564cf521b094..d393a32f3e8b027404e7610e92c7405af558333e 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)