]> git.xonotic.org Git - voretournament/voretournament.git/commitdiff
Allow items to be digested. Only partly implemented
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 19 Nov 2011 14:19:23 +0000 (16:19 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 19 Nov 2011 14:19:23 +0000 (16:19 +0200)
data/balanceVT.cfg
data/qcsrc/server/t_items.qc
data/qcsrc/server/vore.qc
data/qcsrc/server/vore.qh

index 962aeef6c6fbc25f264dbe6a583bcb7937efc061..5e3954759e55f6aaa11cb851977a0368a3817c5e 100644 (file)
@@ -218,6 +218,7 @@ set g_balance_vore_regurgitate_predator_punchangle_item 6 "your view gets tilted
 set g_balance_vore_regurgitate_prey_punchvector 50 "your view gets lowered by this amount when getting regurgitated"\r
 set g_balance_vore_digestion_damage 4 "amount of damage applied to victims during digestion"\r
 set g_balance_vore_digestion_damage_death 2 "amplify digestion damage by this amount when the prey is dead"\r
+set g_balance_vore_digestion_damage_item 2 "amount of damage applied to items during digestion"\r
 set g_balance_vore_digestion_limit -100 "prey can be digested down to this amount of health"\r
 set g_balance_vore_digestion_limit_regurgitate 1 "the predator automatically regurgitates prey that has reached the digestion limit"\r
 set g_balance_vore_digestion_limit_blockrespawn 1 "dead prey cannot respawn if it's still being digested"\r
index b0c2eed7eeb090f1984d0525385bb23120f59f66..43756ab69ab742bff41388c233f76bdf7761cb60 100644 (file)
@@ -220,6 +220,7 @@ void Item_ScheduleInitialRespawn(entity e)
 }\r
 \r
 .float inithealth;\r
+.float item_digestion_step;\r
 void Item_Consumable_Remove(entity e, float regurgitate);\r
 void Item_Consumable_Think()\r
 {\r
@@ -239,10 +240,26 @@ void Item_Consumable_Think()
 \r
        if(self.predator.digesting)\r
        {\r
-               self.scale = self.health / self.inithealth; // scale matches the item's digestion progress\r
+               if(time > self.item_digestion_step)\r
+               {\r
+                       // if distributed digestion is enabled, reduce digestion strength by the amount of prey in our stomach\r
+                       float damage, damage_offset;\r
+\r
+                       damage_offset = 1;\r
+                       if(cvar("g_balance_vore_digestion_distribute")) // apply distributed digestion damage\r
+                               damage_offset *= self.predator.stomach_load / self.predator.stomach_maxload;\r
+                       damage_offset = ceil(damage_offset);\r
+                       damage = cvar("g_balance_vore_digestion_damage_item") / damage_offset;\r
+\r
+                       self.health -= damage;\r
+                       self.predator.health += damage;\r
+                       self.scale = self.health / self.inithealth; // scale matches the item's digestion progress\r
+               }\r
 \r
                if(stov(cvar_string("g_vore_regurgitatecolor_color_digest")))\r
                        self.colormod = stov(cvar_string("g_vore_regurgitatecolor_color_digest"));\r
+\r
+               self.item_digestion_step = time + vore_steptime;\r
        }\r
 \r
        self.nextthink = time;\r
index 5870a69430c305bafd5669b839154e39a7186f70..e07db746bd17ca29af2907bbc86d7b5e45ea0160 100644 (file)
@@ -5,7 +5,6 @@
 const float system_delay_time = 0.1;\r
 const float complain_delay_time = 1;\r
 const float button_delay_time = 0.5;\r
-const float steptime = 0.1;\r
 \r
 entity Swallow_player_check()\r
 {\r
@@ -473,7 +472,7 @@ void Vore_Digest()
                        PlayerSound (self.predator, playersound_digest, CHAN_PLAYER, VOICETYPE_PLAYERSOUND);\r
                        self.predator.digestsound_finished = time + 0.5;\r
                }\r
-               self.digestion_step = time + steptime;\r
+               self.digestion_step = time + vore_steptime;\r
        }\r
 \r
        if(stov(cvar_string("g_vore_regurgitatecolor_color_digest")))\r
@@ -492,7 +491,7 @@ void Vore_Teamheal()
        if(time > self.teamheal_step)\r
        {\r
                self.health += cvar("g_balance_vore_teamheal");\r
-               self.teamheal_step = time + steptime;\r
+               self.teamheal_step = time + vore_steptime;\r
 \r
                // play beep sound when a team mate was healed to the maximum amount, to both the prey and the predator\r
                if(self.health >= cvar("g_balance_vore_teamheal_stable"))\r
index baf9ffbc37ab27d7502fcaad41cb3223c8a6d872..a03b4e150b803e1455e8428b1a02d9b2256708bf 100644 (file)
@@ -1,7 +1,9 @@
+const float vore_steptime = 0.1;\r
+\r
 void Vore();\r
 void Vore_Disconnect();\r
 .float regurgitate_prepare;\r
 \r
 entity Swallow_player_check();\r
 float Swallow_condition_check(entity prey);\r
-float Stomach_HasLivePrey(entity pred);
\ No newline at end of file
+float Stomach_HasLivePrey(entity pred);\r