]> de.git.xonotic.org Git - voretournament/voretournament.git/commitdiff
First part of a mass based swallowing system. Swallow limit will no longer be a playe...
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 18 Jul 2011 10:23:40 +0000 (13:23 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 18 Jul 2011 10:23:40 +0000 (13:23 +0300)
data/balanceVT.cfg
data/qcsrc/client/Main.qc
data/qcsrc/client/main.qh
data/qcsrc/client/sbar.qc
data/qcsrc/common/constants.qh
data/qcsrc/server/cl_client.qc
data/qcsrc/server/cl_player.qc
data/qcsrc/server/defs.qh
data/qcsrc/server/g_world.qc
data/qcsrc/server/miscfunctions.qc
data/qcsrc/server/vore.qc

index d644c044021fec59cdcb81c4c486a340e5f94732..2643e00f47b160df631befe7e5c908457e30fba6 100644 (file)
@@ -185,8 +185,8 @@ set g_balance_grabber_reload_time 2
 // }}}\r
 \r
 // {{{ stomach\r
+set g_balance_vore_load_capacity 100 "capacity percent a player's stomach has, influenced by player size"\r
 set g_balance_vore_swallow_range 140 "distance below which you can swallow another player when facing them"\r
-set g_balance_vore_swallow_limit 3 "how many players can fit in the stomach at a time, may range between 1 and 9"\r
 set g_balance_vore_swallow_speed_fill 2.5 "how long it takes to swallow a player, 0 is instant"\r
 set g_balance_vore_swallow_speed_fill_scalediff 0.5 "fill rate depends on predator size compared to prey size by this amount"\r
 set g_balance_vore_swallow_speed_fill_stomachload 1 "fill rate is influenced by the prey's stomach load"\r
index 90dce734b673441ad82db7c2dcb771a03272f977..d9449353761b1a90205c748fcb0e4ec61cf1f0c3 100644 (file)
@@ -1054,7 +1054,6 @@ void Ent_Init()
        g_weaponswitchdelay = ReadByte() / 255.0;\r
 \r
        g_vore = ReadShort();\r
-       g_balance_vore_swallow_limit = ReadShort();\r
        g_healthsize = ReadShort();\r
        g_healthsize_min = ReadShort();\r
        g_healthsize_max = ReadShort();\r
index b5801490c5b69385e3678cbdc1d4b750597113d9..245ed88606c3b26393aae8993e1f34843a525dcb 100644 (file)
@@ -167,7 +167,6 @@ float armorblockpercent;
 float g_weaponswitchdelay;\r
 \r
 float g_vore;\r
-float g_balance_vore_swallow_limit;\r
 float g_healthsize, g_healthsize_min, g_healthsize_max;\r
 float armor_max;\r
 float teamheal_max;\r
index 6aec0e8ea76638bba84975c553e5eacf077303b2..d405371874959adf2c1e4fa2bfffd671cceb325d 100644 (file)
@@ -3027,12 +3027,13 @@ void Sbar_Draw (void)
                        drawpic(bottomleft - '0 256 0', "gfx/hud/bg_stomach_status", '256 256 0', StomachStatus_ColorFade(hl_color), cvar("sbar_stomachboard_status_alpha") * sbar_alpha_fg, DRAWFLAG_NORMAL);\r
                        drawstring(bottomleft - '-80 173 0', hl_string, '11 11 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
 \r
-                       float stomach_load;\r
-                       stomach_load = getstati(STAT_VORE_LOAD); // shows the predator's stomach load when we are eaten, and ours otherwise\r
+                       float stomach_load, stomach_maxload; // shows the predator's stomach load when we are eaten, and ours otherwise\r
+                       stomach_load = getstati(STAT_VORE_LOAD);\r
+                       stomach_maxload = getstati(STAT_VORE_MAXLOAD);\r
 \r
                        vector status_pos;\r
                        string status_text;\r
-                       status_text = strcat(ftos(bound(0, stomach_load, 9)), "/", ftos(bound(0, g_balance_vore_swallow_limit, 9)));\r
+                       status_text = strcat(ftos(stomach_load), "/", ftos(stomach_maxload));\r
                        status_pos = bottomleft - '-44 171 0';\r
                        status_pos -= '1 0 0' * stringwidth(status_text, FALSE, '22 22 0') * 0.5;\r
                        drawstring(status_pos, status_text, '22 22 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
index 44f19165628906b02041ddb79bec533dc1518ab9..ea23f8619dcdc7570a2877d4865ba6d3d090bc50 100644 (file)
@@ -281,21 +281,21 @@ const float STAT_WEAPON_CLIPLOAD = 49;
 const float STAT_WEAPON_CLIPSIZE = 50;\r
 const float STAT_LAST_PICKUP = 51;\r
 const float STAT_VORE_LOAD = 52;\r
-const float STAT_VORE_DIGESTING = 53;\r
-const float STAT_VORE_EATEN = 54;\r
-const float STAT_VORE_CANLEAVE = 55;\r
-const float STAT_VORE_CANSWALLOW = 56;\r
-const float STAT_SBRING1_TYPE = 57;\r
-const float STAT_SBRING1_CLIP = 58;\r
-const float STAT_SBRING2_TYPE = 59;\r
-const float STAT_SBRING2_CLIP = 60;\r
+const float STAT_VORE_MAXLOAD = 53;\r
+const float STAT_VORE_DIGESTING = 54;\r
+const float STAT_VORE_EATEN = 55;\r
+const float STAT_VORE_CANLEAVE = 56;\r
+const float STAT_VORE_CANSWALLOW = 57;\r
+const float STAT_SBRING1_TYPE = 58;\r
+const float STAT_SBRING1_CLIP = 59;\r
+const float STAT_SBRING2_TYPE = 60;\r
+const float STAT_SBRING2_CLIP = 61;\r
+const float STAT_HUD = 62;\r
+const float HUD_NORMAL = 0;\r
 const float CTF_STATE_ATTACK = 1;\r
 const float CTF_STATE_DEFEND = 2;\r
 const float CTF_STATE_COMMANDER = 3;\r
 \r
-const float STAT_HUD = 61;\r
-const float HUD_NORMAL = 0;\r
-\r
 // moved that here so the client knows the max.\r
 // # of maps, I'll use arrays for them :P\r
 #define MAPVOTE_COUNT 10\r
index 2503070e54b0c3f2bf17237a92d8b20c163b00e1..eaa93cf820e97497a2d2e6c245ad536f3390c270 100644 (file)
@@ -436,9 +436,9 @@ string setmodel_state()
        newmodel_extension = substring(self.playermodel, strlen(self.playermodel) - 4, 4);\r
 \r
        float vore_state;\r
-       if(self.stomach_load > ceil(g_balance_vore_swallow_limit * 0.6))\r
+       if(self.stomach_load > self.stat_stomachmaxload * 0.6)\r
                vore_state = 3;\r
-       else if(self.stomach_load > ceil(g_balance_vore_swallow_limit * 0.3))\r
+       else if(self.stomach_load > self.stat_stomachmaxload * 0.3)\r
                vore_state = 2;\r
        else if(self.stomach_load)\r
                vore_state = 1;\r
@@ -1053,7 +1053,6 @@ float ClientInit_SendEntity(entity to, float sf)
        WriteByte(MSG_ENTITY, cvar("g_balance_weaponswitchdelay") * 255.0);\r
 \r
        WriteShort(MSG_ENTITY, cvar("g_vore"));\r
-       WriteShort(MSG_ENTITY, g_balance_vore_swallow_limit);\r
        WriteShort(MSG_ENTITY, cvar("g_healthsize"));\r
        WriteShort(MSG_ENTITY, cvar("g_healthsize_min"));\r
        WriteShort(MSG_ENTITY, cvar("g_healthsize_max"));\r
@@ -2107,6 +2106,7 @@ void SpectateCopy(entity spectatee) {
        self.stomach_load = spectatee.stomach_load;\r
        self.stat_eaten = spectatee.stat_eaten;\r
        self.stat_stomachload = spectatee.stat_stomachload;\r
+       self.stat_stomachmaxload = spectatee.stat_stomachmaxload;\r
        self.stat_digesting = spectatee.stat_digesting;\r
        self.stat_canleave = spectatee.stat_canleave;\r
        self.stat_canswallow = spectatee.stat_canswallow;\r
index 829a6501b777bf234d15110d7ad8a240b123fef3..abc50c156b6f0ec83ff36e49e51d0d82dee3884c 100644 (file)
@@ -1332,7 +1332,7 @@ void GlobalSound(string sample, float chan, float voicetype)
                        break;\r
                case VOICETYPE_GURGLE:\r
                        if(self.stomach_load)\r
-                               sound(self, chan, sample, vol * self.stomach_load / g_balance_vore_swallow_limit, ATTN_NORM);\r
+                               sound(self, chan, sample, bound(0, vol * (self.stomach_load / self.stat_stomachmaxload), 1), ATTN_NORM);\r
                        else\r
                                stopsound(self, chan);\r
                        break;\r
index 364e2fcc9d9f69cae90a135b920a5d89a114011b..70b421efa85498e58c43d1213170c4682e863e61 100644 (file)
@@ -21,7 +21,6 @@ float ctf_score_value(string parameter);
 \r
 float g_dm, g_domination, g_ctf, g_tdm, g_keyhunt, g_onslaught, g_assault, g_arena, g_ca, g_lms, g_race, g_cts, g_rpg;\r
 float g_cloaked, g_footsteps, g_jump_grunt, g_midair, g_norecoil, g_vampire, g_bloodloss;\r
-float g_balance_vore_swallow_limit;\r
 float g_warmup_limit;\r
 float g_warmup_allguns;\r
 float g_warmup_allow_timeout;\r
@@ -73,7 +72,7 @@ float maxclients;
 .float stomach_load;\r
 .float weapon_delay;\r
 .float fakeprey;\r
-.float stat_eaten, stat_stomachload, stat_digesting, stat_canleave, stat_canswallow;\r
+.float stat_eaten, stat_stomachload, stat_stomachmaxload, stat_digesting, stat_canleave, stat_canswallow;\r
 .float dropweapon_check;\r
 \r
 // Fields\r
index ababcf9357ba377b5b54941352a20596caea085f..d96b63e7859b852cc6a512c638e5fe7accbbbd27 100644 (file)
@@ -659,6 +659,7 @@ void spawnfunc_worldspawn (void)
        addstat(STAT_LAST_PICKUP, AS_FLOAT, last_pickup);\r
        addstat(STAT_WINNING, AS_FLOAT, winning);\r
        addstat(STAT_VORE_LOAD, AS_INT, stat_stomachload);\r
+       addstat(STAT_VORE_MAXLOAD, AS_INT, stat_stomachmaxload);\r
        addstat(STAT_VORE_CANSWALLOW, AS_INT, stat_canswallow);\r
        addstat(STAT_VORE_DIGESTING, AS_INT, stat_digesting);\r
        addstat(STAT_VORE_EATEN, AS_INT, stat_eaten);\r
index 2f36d6073eb03ecbf85862c12395cb15aba0be5b..d8c72f49cb03da9f54469147ba68ac5063bbcca4 100644 (file)
@@ -1017,7 +1017,6 @@ void readlevelcvars(void)
        g_norecoil = cvar("g_norecoil");\r
        g_vampire = cvar("g_vampire");\r
        g_bloodloss = cvar("g_bloodloss");\r
-       g_balance_vore_swallow_limit = bound(1, cvar("g_balance_vore_swallow_limit"), 9); // may only range between 1 and 9\r
        sv_maxidle = cvar("sv_maxidle");\r
        sv_maxidle_spectatorsareidle = cvar("sv_maxidle_spectatorsareidle");\r
        sv_pogostick = cvar("sv_pogostick");\r
index 90b0bfaefe7cf3ddc13316b3d4b7935fcb5556c2..98393a8fa0911f028fa3edd743730c103578f9fc 100644 (file)
@@ -47,8 +47,8 @@ float Swallow_condition_check(entity prey)
                        swallow_complain = "You cannot swallow your team mates\n";\r
                else if(!cvar("g_vore_spawnshield") && prey.spawnshieldtime > time)\r
                        swallow_complain = "You cannot swallow someone protected by the spawn shield\n";\r
-               else if(self.stomach_load >= g_balance_vore_swallow_limit)\r
-                       swallow_complain = strcat("You cannot swallow more than ^2", ftos(g_balance_vore_swallow_limit), "^7 players at a time\n");\r
+               else if(self.stomach_load >= self.stat_stomachmaxload)\r
+                       swallow_complain = "You do not have any more room to swallow this player.\n";\r
                else if(cvar("g_vore_biggergut") && prey.stomach_load > self.stomach_load)\r
                        swallow_complain = "You cannot swallow someone with a bigger stomach than yours\n";\r
                else if(cvar("g_vore_biggersize") && prey.scale > self.scale)\r
@@ -707,12 +707,20 @@ void Vore()
        else if(self.predator.classname == "player")\r
        {\r
                self.stat_stomachload = self.predator.stomach_load; // necessary for the stomach board\r
+               self.stat_stomachmaxload = self.predator.stat_stomachmaxload; // necessary for the stomach board\r
                self.stat_digesting = self.predator.digesting; // necessary for the stomach board\r
                self.stat_eaten = num_for_edict(self.predator);\r
        }\r
        else\r
        {\r
+               float vore_capacity;\r
+               vore_capacity = cvar("g_balance_vore_load_capacity");\r
+               if(cvar("g_healthsize"))\r
+                       vore_capacity *= self.scale;\r
+               vore_capacity = ceil(vore_capacity);\r
+\r
                self.stat_stomachload = self.stomach_load;\r
+               self.stat_stomachmaxload = vore_capacity;\r
                self.stat_digesting = self.digesting;\r
                self.stat_eaten = 0;\r
        }\r