clean up CA and add some standard CA stuff like starting with all weapons and ammo...
authorfruitiex <fruitiex@f962a42d-fe04-0410-a3ab-8c8b0445ebaa>
Wed, 11 Nov 2009 13:36:28 +0000 (13:36 +0000)
committerfruitiex <fruitiex@f962a42d-fe04-0410-a3ab-8c8b0445ebaa>
Wed, 11 Nov 2009 13:36:28 +0000 (13:36 +0000)
git-svn-id: svn://svn.icculus.org/nexuiz/trunk@8269 f962a42d-fe04-0410-a3ab-8c8b0445ebaa

data/defaultNexuiz.cfg
data/qcsrc/server/arena.qc
data/qcsrc/server/cl_client.qc
data/qcsrc/server/cl_player.qc
data/qcsrc/server/cl_weapons.qc
data/qcsrc/server/g_damage.qc
data/qcsrc/server/miscfunctions.qc
data/qcsrc/server/sv_main.qc
data/qcsrc/server/t_items.qc
data/qcsrc/server/teamplay.qc

index 39652c6..063e348 100644 (file)
@@ -684,6 +684,12 @@ set g_arena_roundbased 1   "if disabled, the next player will spawn as soon as som
 set g_arena_warmup 5   "time, newly spawned players have to prepare themselves in round based matches"
 set g_arena_powerups 0 "enables powerups (superhealth, strength and shield), which are removed by default"
 
+// ca
+set g_ca 0 "Clan Arena: Played in rounds, once you're dead you're out! The team with survivors wins the round."
+set g_ca_point_limit 10 "point limit 10 is standard for clan arena"
+set g_ca_point_leadlimit 0
+set g_ca_warmup 10 "how long the players will have time to run around the map before the round starts"
+
 // onslaught
 set g_onslaught 0 "Onslaught: take control points towards the enemy generator and then destroy it"
 set g_onslaught_gen_health 5000
@@ -1609,6 +1615,7 @@ alias cl_hook_gamestart_ctf
 alias cl_hook_gamestart_rune
 alias cl_hook_gamestart_lms
 alias cl_hook_gamestart_arena
+alias cl_hook_gamestart_ca
 alias cl_hook_gamestart_kh
 alias cl_hook_gamestart_ons
 alias cl_hook_gamestart_as
@@ -1627,6 +1634,7 @@ alias sv_hook_gamestart_ctf
 alias sv_hook_gamestart_rune
 alias sv_hook_gamestart_lms
 alias sv_hook_gamestart_arena
+alias sv_hook_gamestart_ca
 alias sv_hook_gamestart_kh
 alias sv_hook_gamestart_ons
 alias sv_hook_gamestart_as
index bdb918c..ea975a5 100644 (file)
@@ -32,12 +32,12 @@ void reset_map(float dorespawn)
        entity oldself;
        oldself = self;
 
-       if(g_arena || g_ca)
-       if(cvar("g_arena_warmup"))
+       if(g_arena && cvar("g_arena_warmup"))
                warmup = time + cvar("g_arena_warmup");
-
-       if(g_ca)
+       else if(g_ca) {
+               warmup = time + cvar("g_ca_warmup");
                allowed_to_spawn = 1;
+       }
 
        lms_lowest_lives = 999;
        lms_next_place = player_count;
@@ -191,7 +191,7 @@ void Arena_Warmup()
        float f;
        string msg;
 
-       if((!g_arena && !g_ca) || !arena_roundbased || (time < game_starttime))
+       if((!g_arena && !g_ca) || (g_arena && !arena_roundbased) || (time < game_starttime))
                return;
 
        f = floor(warmup - time + 1);
index da1e834..1dff10b 100644 (file)
@@ -1966,10 +1966,10 @@ void player_regen (void)
        limita = limita * limit_mod;
        //limitf = limitf * limit_mod;
 
-       if(g_lms)
+       if(g_lms && g_ca)
                rot_mod = 0;
 
-       if (!g_minstagib && (!g_lms || cvar("g_lms_regenerate")))
+       if (!g_minstagib && !g_ca && (!g_lms || cvar("g_lms_regenerate")))
        {
                self.armorvalue = CalcRotRegen(self.armorvalue, mina, cvar("g_balance_armor_regen"), cvar("g_balance_armor_regenlinear"), regen_mod * frametime * (time > self.pauseregen_finished), maxa, cvar("g_balance_armor_rot"), cvar("g_balance_armor_rotlinear"), rot_mod * frametime * (time > self.pauserotarmor_finished), limita);
                self.health = CalcRotRegen(self.health, minh, cvar("g_balance_health_regen"), cvar("g_balance_health_regenlinear"), regen_mod * frametime * (time > self.pauseregen_finished), maxh, cvar("g_balance_health_rot"), cvar("g_balance_health_rotlinear"), rot_mod * frametime * (time > self.pauserothealth_finished), limith);
index 457f5da..6a81259 100644 (file)
@@ -475,7 +475,7 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
        else
                Violence_GibSplash_At(hitloc, force, 2, bound(0, damage, 200) / 16, self, attacker);
 
-       if(g_arena && numspawned < 2)
+       if((g_arena && numspawned < 2) || (g_ca && player_cnt < 2))
                return;
 
        if (!g_minstagib)
index 4ffbfa6..384be14 100644 (file)
@@ -302,7 +302,7 @@ void W_WeaponFrame()
        if (frametime)
                self.weapon_frametime = frametime;
 
-       if((arena_roundbased && time < warmup) || ((time < game_starttime) && !cvar("sv_ready_restart_after_countdown")))
+       if(((arena_roundbased || g_ca) && time < warmup) || ((time < game_starttime) && !cvar("sv_ready_restart_after_countdown")))
                return;
 
        if (!self.weaponentity || self.health < 1)
index bbbf914..3092d7d 100644 (file)
@@ -702,7 +702,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                                                {
                                                        teamdamage0 = max(attacker.dmg_team, cvar("g_teamdamage_threshold"));
                                                        attacker.dmg_team = attacker.dmg_team + damage;
-                                                       if(attacker.dmg_team > teamdamage0)
+                                                       if(attacker.dmg_team > teamdamage0 && !g_ca)
                                                                mirrordamage = cvar("g_mirrordamage") * (attacker.dmg_team - teamdamage0);
                                                        mirrorforce = cvar("g_mirrordamage") * vlen(force);
                                                        if(g_minstagib)
@@ -710,7 +710,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                                                                if(cvar("g_friendlyfire") == 0)
                                                                        damage = 0;
                                                        }
-                                                       else
+                                                       else if(!g_ca)
                                                                damage = cvar("g_friendlyfire") * damage;
                                                        // mirrordamage will be used LATER
                                                }
@@ -792,7 +792,12 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                        damage = damage * cvar("g_balance_powerup_invincible_takedamage");
 
                if (targ == attacker)
-                       damage = damage * cvar("g_balance_selfdamagepercent");  // Partial damage if the attacker hits himself
+               {
+                       if(g_ca)
+                               damage = 0;
+                       else
+                               damage = damage * cvar("g_balance_selfdamagepercent");  // Partial damage if the attacker hits himself
+               }
 
                // CTF: reduce damage/force
                if(g_ctf)
index 9f94b5e..2adcbdd 100644 (file)
@@ -935,7 +935,7 @@ void readplayerstartcvars()
     }
     else
     {
-        if (g_lms)
+        if (g_lms || g_ca)
         {
             start_ammo_shells = cvar("g_lms_start_ammo_shells");
             start_ammo_nails = cvar("g_lms_start_ammo_nails");
@@ -973,7 +973,7 @@ void readplayerstartcvars()
 
             if (t < 0) // "default" weapon selection
             {
-                if (g_lms)
+                if (g_lms || g_ca)
                     t = (e.spawnflags & WEPSPAWNFLAG_NORMAL);
                 else if (g_race || g_cts)
                     t = (i == WEP_LASER);
index 78e6f8d..2e85efd 100644 (file)
@@ -67,7 +67,7 @@ void CreatureFrame (void)
                                self.dmg = 2;
                        }
                        // check for falling damage
-                       if(!self.hook.state)
+                       if(!self.hook.state && !g_ca)
                        {
                                dm = vlen(self.oldvelocity) - vlen(self.velocity); // dm is now the velocity DECREASE. Velocity INCREASE should never cause a sound or any damage.
                                if (self.deadflag)
index a1b22b2..f6831f3 100644 (file)
@@ -788,7 +788,7 @@ void StartItem (string itemmodel, string pickupsound, float defaultrespawntime,
 
                weaponsInMap |= weaponid;
 
-               if(g_lms)
+               if(g_lms || g_ca)
                {
                        startitem_failed = TRUE;
                        remove(self);
index c20e3a4..60dfda8 100644 (file)
@@ -284,12 +284,10 @@ void InitGameplayMode()
                ScoreRules_lms();
        }
 
-       if(g_arena || g_ca)
+       if(g_arena)
        {
                game = GAME_ARENA;
                gamemode_name = "Arena";
-               if(g_ca)
-                       ActivateTeamplay();
                fraglimit_override = cvar("g_arena_point_limit");
                leadlimit_override = cvar("g_arena_point_leadlimit");
                maxspawned = cvar("g_arena_maxspawned");
@@ -298,6 +296,14 @@ void InitGameplayMode()
                arena_roundbased = cvar("g_arena_roundbased");
        }
 
+       if(g_ca)
+       {
+               game = GAME_CA;
+               gamemode_name = "Clan Arena";
+               ActivateTeamplay();
+               fraglimit_override = cvar("g_ca_point_limit");
+               leadlimit_override = cvar("g_ca_point_leadlimit");
+       }
        if(g_keyhunt)
        {
                game = GAME_KEYHUNT;