]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
Further progress on the belly mass system
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 18 Jul 2011 10:54:37 +0000 (13:54 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 18 Jul 2011 10:54:37 +0000 (13:54 +0300)
data/balanceVT.cfg
data/qcsrc/server/bot/havocbot/vore_ai.qc
data/qcsrc/server/cl_client.qc
data/qcsrc/server/cl_physics.qc
data/qcsrc/server/cl_player.qc
data/qcsrc/server/defs.qh
data/qcsrc/server/g_world.qc
data/qcsrc/server/vore.qc

index a4e7bb1a6fc30650aa2badd173f8f29109d7d395..bcd266c5021a19a9f4859ddcebf7720c58d4a60c 100644 (file)
@@ -187,6 +187,8 @@ set g_balance_grabber_reload_time 2
 // {{{ 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_load_mass 30 "prey mass, influenced by player size"\r
+set g_balance_vore_weight_gravity 1 "you get this heavier the more you eat, at 1 each meal makes you two times heavier"\r
+set g_balance_vore_weight_speed 0.15 "you get this slower the more you eat, at 0.5 each meal makes you two times slower"\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_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
@@ -213,8 +215,6 @@ set g_balance_vore_digestion_distribute 1 "if enabled, digestion is reduced by t
 set g_balance_vore_digestion_scalediff 0.5 "if enabled, digestion damage is affected by the size of the predator compared to the size of the prey by this amount"\r
 set g_balance_vore_teamheal 1 "when enabled, having a team mate in your stomach will keep healing them by this amount"\r
 set g_balance_vore_teamheal_stable 150 "maximum amount of health you can gain from a teamheal (best kept equal or less than g_balance_health_rotstable)"\r
-set g_balance_vore_weight_gravity 1 "you get this heavier the more you eat, at 1 each meal makes you two times heavier"\r
-set g_balance_vore_weight_speed 0.15 "you get this slower the more you eat, at 0.5 each meal makes you two times slower"\r
 set g_balance_vore_kick_damage 30 "amount of damage you can do during stomach kick"\r
 set g_balance_vore_kick_delay 0.6 "how many seconds must pass before you can perform another stomach kick"\r
 set g_balance_vore_kick_force 420 "predators are pushed by this amount when stomach kicked, in the direction their prey is facing"\r
index b46f5a2f55d8884bb251358205787d9a986484c6..c3d1c1bdc93c037ea36b74cd19d920c50f236f12 100644 (file)
@@ -141,9 +141,9 @@ void Vore_AI()
                if(!cvar("g_vore_reversescoring")) // when reverse scoring is on, it's in the interest of the prey to get eaten, so the predator has nothing to fear
                {
                        if(skill >= 3) // make bots aware of this from skill 3 and up
-                               fear *= 1 + self.stomach_load; // the bigger our stomach, the less we want to put someone else in there
+                               fear *= 1 + self.stomach_maxload / self.stomach_load; // the bigger our stomach, the less we want to put someone else in there
                        if(skill >= 5) // make bots aware of this from skill 5 and up
-                               fear *= 1 + prey.stomach_load; // predators fear prey that have a large stomach
+                               fear *= 1 + prey.stomach_maxload / prey.stomach_load; // predators fear prey that have a large stomach
 
                        if(cvar("g_healthsize"))
                                fear *= (prey.scale / self.scale); // predators fear larger prey and are courageous toward smaller prey
index eaa93cf820e97497a2d2e6c245ad536f3390c270..eca3ad9fd69755e9f50e240400ea232a973df46b 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 > self.stat_stomachmaxload * 0.6)\r
+       if(self.stomach_load > self.stomach_maxload * 0.6)\r
                vore_state = 3;\r
-       else if(self.stomach_load > self.stat_stomachmaxload * 0.3)\r
+       else if(self.stomach_load > self.stomach_maxload * 0.3)\r
                vore_state = 2;\r
        else if(self.stomach_load)\r
                vore_state = 1;\r
@@ -2106,7 +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.stomach_maxload = spectatee.stomach_maxload;\r
        self.stat_digesting = spectatee.stat_digesting;\r
        self.stat_canleave = spectatee.stat_canleave;\r
        self.stat_canswallow = spectatee.stat_canswallow;\r
index 4394bdba850ac7c34a431509b44069c102c25036..7d916fd4030d4d3c071d35c45763c864c2972ba1 100644 (file)
@@ -508,7 +508,7 @@ void PM_Accelerate(vector wishdir, float wishspeed, float wishspeed0, float acce
                accelqw = -accelqw;\r
 \r
        if(cvar("g_balance_vore_weight_gravity") > 0) // apply stomach weight\r
-               wishspeed *= 1 - bound(0, self.stomach_load * cvar("g_balance_vore_weight_speed"), 1);\r
+               wishspeed *= 1 - bound(0, self.stomach_maxload / self.stomach_load * cvar("g_balance_vore_weight_speed"), 1);\r
        if(cvar("g_healthsize")) // if we are smaller or larger, we run slower or faster\r
                wishspeed *= (1 - cvar("g_healthsize_movementfactor")) + cvar("g_healthsize_movementfactor") * self.scale; \r
        if(self.swallow_progress_prey) // cut speed based on swallow progress for prey\r
index abc50c156b6f0ec83ff36e49e51d0d82dee3884c..411499c4c9e3af876f7418628526183bd6fe549c 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, bound(0, vol * (self.stomach_load / self.stat_stomachmaxload), 1), ATTN_NORM);\r
+                               sound(self, chan, sample, bound(0, vol * (self.stomach_load / self.stomach_maxload), 1), ATTN_NORM);\r
                        else\r
                                stopsound(self, chan);\r
                        break;\r
index 70b421efa85498e58c43d1213170c4682e863e61..11d295d25c38c62a3523f210b5b8c5690bcab154 100644 (file)
@@ -69,7 +69,7 @@ float maxclients;
 .entity fakepredator;\r
 .float swallow_progress_prey, swallow_progress_pred;\r
 .float digesting;\r
-.float stomach_load;\r
+.float stomach_load, stomach_maxload;\r
 .float weapon_delay;\r
 .float fakeprey;\r
 .float stat_eaten, stat_stomachload, stat_stomachmaxload, stat_digesting, stat_canleave, stat_canswallow;\r
index d96b63e7859b852cc6a512c638e5fe7accbbbd27..331e3a685333246da39732e92820c4d11ea2fb88 100644 (file)
@@ -659,7 +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_MAXLOAD, AS_INT, stomach_maxload);\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 848ddaf9327f5c21606c20cc9657bebd1a081b70..a62036c05104ccb09a15ea5338783d94fa5d66e6 100644 (file)
@@ -47,7 +47,7 @@ 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 >= self.stat_stomachmaxload)\r
+               else if(self.stomach_load >= self.stomach_maxload)\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
@@ -191,7 +191,7 @@ void Vore_WeightApply(entity e)
        // slowing the player is done in cl_physics.qc\r
 \r
        if(e.stomach_load != e.vore_oldstomachload)\r
-               e.gravity += 1 + (e.stomach_load * cvar("g_balance_vore_weight_gravity") - e.vore_oldstomachload);\r
+               e.gravity += 1 + (e.stomach_maxload / e.stomach_load * cvar("g_balance_vore_weight_gravity") - e.vore_oldstomachload);\r
        if(e.gravity == 0)\r
                e.gravity = 0.00001; // 0 becomes 1 for gravity, so do this to allow 0 gravity\r
        e.vore_oldstomachload = e.stomach_load;\r
@@ -507,15 +507,15 @@ void Vore_Digest()
 \r
        if(time > self.digestion_step)\r
        {\r
-               // if distributed digestion is enabled, reduce digestion strength by the number of prey in our stomach\r
-               float reduce;\r
+               // if distributed digestion is enabled, reduce digestion strength by the amount of prey in our stomach\r
+               float vore_offset;\r
                if(cvar("g_balance_vore_digestion_distribute"))\r
-                       reduce = self.predator.stomach_load;\r
+                       vore_offset = self.predator.stomach_maxload / self.predator.stomach_load;\r
                else\r
-                       reduce = 1;\r
+                       vore_offset = 1;\r
 \r
                float damage;\r
-               damage = cvar("g_balance_vore_digestion_damage") / reduce;\r
+               damage = cvar("g_balance_vore_digestion_damage") / vore_offset;\r
 \r
                // apply player scale to digestion damage\r
                if(cvar("g_healthsize") && cvar("g_balance_vore_digestion_scalediff"))\r
@@ -523,7 +523,7 @@ void Vore_Digest()
 \r
                Damage(self, self.predator, self.predator, damage, DEATH_DIGESTION, self.origin, '0 0 0');\r
                if(cvar("g_balance_vore_digestion_vampire") && self.predator.health < cvar("g_balance_vore_digestion_vampire_stable"))\r
-                       self.predator.health += cvar("g_balance_vore_digestion_vampire") / reduce;\r
+                       self.predator.health += cvar("g_balance_vore_digestion_vampire") / vore_offset;\r
 \r
                if (self.predator.digestsound_finished < time)\r
                {\r
@@ -717,20 +717,14 @@ 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_stomachmaxload = self.predator.stomach_maxload; // 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_stomachmaxload = self.stomach_maxload;\r
                self.stat_digesting = self.digesting;\r
                self.stat_eaten = 0;\r
        }\r
@@ -800,6 +794,12 @@ void Vore()
        entity prey;\r
        prey = Swallow_player_check();\r
 \r
+       // set the predator's stomach capacity\r
+       self.stomach_maxload = cvar("g_balance_vore_load_capacity");\r
+       if(cvar("g_healthsize"))\r
+               self.stomach_maxload *= self.scale;\r
+       self.stomach_maxload = ceil(self.stomach_maxload);\r
+\r
        // attempt to swallow our new prey if we pressed the attack button, and there's any in range\r
        self.stat_canswallow = 0;\r
        if(Swallow_condition_check(prey))\r