]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
Consumable items will scale down as they are digested, which will be implemented...
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 19 Nov 2011 14:08:36 +0000 (16:08 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 19 Nov 2011 14:08:36 +0000 (16:08 +0200)
data/qcsrc/server/t_items.qc

index e634c4bc7a8524331b4ec438b0c0185ee954d44c..b0c2eed7eeb090f1984d0525385bb23120f59f66 100644 (file)
@@ -219,6 +219,7 @@ void Item_ScheduleInitialRespawn(entity e)
        Item_ScheduleRespawnIn(e, game_starttime - time + ITEM_RESPAWNTIME_INITIAL(e));\r
 }\r
 \r
+.float inithealth;\r
 void Item_Consumable_Remove(entity e, float regurgitate);\r
 void Item_Consumable_Think()\r
 {\r
@@ -238,11 +239,12 @@ 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
+\r
                if(stov(cvar_string("g_vore_regurgitatecolor_color_digest")))\r
                        self.colormod = stov(cvar_string("g_vore_regurgitatecolor_color_digest"));\r
        }\r
 \r
-       dprint("!!!!!!!!\n");\r
        self.nextthink = time;\r
 }\r
 \r
@@ -289,6 +291,7 @@ void Item_Consumable_Spawn(entity e, entity pl)
        item.solid = SOLID_NOT;\r
        setmodel(item, e.model);\r
        item.health = e.health;\r
+       item.inithealth = e.health;\r
        item.max_health = e.max_health;\r
        item.dmg = e.dmg;\r
 \r
@@ -338,6 +341,7 @@ void Item_DroppedConsumable_Spawn(entity e)
        item.solid = SOLID_TRIGGER;\r
        setmodel(item, e.model);\r
        item.health = e.health;\r
+       item.inithealth = e.inithealth;\r
        item.max_health = e.max_health;\r
        item.dmg = e.dmg;\r
        item.scale = e.scale;\r