From: MirceaKitsune Date: Sat, 19 Nov 2011 14:08:36 +0000 (+0200) Subject: Consumable items will scale down as they are digested, which will be implemented... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2928fc56c435fb514354cd35bf6a8fec774f0111;p=voretournament%2Fvoretournament.git Consumable items will scale down as they are digested, which will be implemented next --- diff --git a/data/qcsrc/server/t_items.qc b/data/qcsrc/server/t_items.qc index e634c4bc..b0c2eed7 100644 --- a/data/qcsrc/server/t_items.qc +++ b/data/qcsrc/server/t_items.qc @@ -219,6 +219,7 @@ void Item_ScheduleInitialRespawn(entity e) Item_ScheduleRespawnIn(e, game_starttime - time + ITEM_RESPAWNTIME_INITIAL(e)); } +.float inithealth; void Item_Consumable_Remove(entity e, float regurgitate); void Item_Consumable_Think() { @@ -238,11 +239,12 @@ void Item_Consumable_Think() if(self.predator.digesting) { + self.scale = self.health / self.inithealth; // scale matches the item's digestion progress + if(stov(cvar_string("g_vore_regurgitatecolor_color_digest"))) self.colormod = stov(cvar_string("g_vore_regurgitatecolor_color_digest")); } - dprint("!!!!!!!!\n"); self.nextthink = time; } @@ -289,6 +291,7 @@ void Item_Consumable_Spawn(entity e, entity pl) item.solid = SOLID_NOT; setmodel(item, e.model); item.health = e.health; + item.inithealth = e.health; item.max_health = e.max_health; item.dmg = e.dmg; @@ -338,6 +341,7 @@ void Item_DroppedConsumable_Spawn(entity e) item.solid = SOLID_TRIGGER; setmodel(item, e.model); item.health = e.health; + item.inithealth = e.inithealth; item.max_health = e.max_health; item.dmg = e.dmg; item.scale = e.scale;