Item_ScheduleRespawnIn(e, game_starttime - time + ITEM_RESPAWNTIME_INITIAL(e));\r
}\r
\r
-void Item_Consumable_Remove();\r
+void Item_Consumable_Remove(entity e, float regurgitate);\r
void Item_Consumable_Think()\r
{\r
if(self.predator.regurgitate_prepare && time > self.predator.regurgitate_prepare)\r
{\r
self.predator.regurgitate_prepare = 0;\r
self.predator.complain_vore = time + complain_delay_time; // prevent complaining the next frame if this empties our stomach\r
- Item_Consumable_Remove();\r
+ Item_Consumable_Remove(self, TRUE);\r
return;\r
}\r
\r
if(self.predator.classname != "player")\r
{\r
// no longer a player, remove consumable items\r
- Item_Consumable_Remove();\r
+ Item_Consumable_Remove(self, TRUE);\r
return;\r
}\r
if(self.predator.stat_eaten)\r
{\r
// prey can't hold consumable items\r
- Item_Consumable_Remove();\r
+ Item_Consumable_Remove(self, TRUE);\r
return;\r
}\r
\r
return TRUE;\r
}\r
\r
-void Item_Consumable_Remove()\r
+void Item_DroppedConsumable_Spawn(entity e);\r
+void Item_Consumable_Remove(entity e, float regurgitate)\r
{\r
- // predator effects, some common to those in Vore_Regurgitate\r
- PlayerSound(self.predator, playersound_regurgitate, CHAN_VOICE, VOICETYPE_PLAYERSOUND);\r
- setanim(self.predator, self.predator.anim_pain1, FALSE, TRUE, TRUE); // looks good for swallowing / regurgitating\r
- pointparticles(particleeffectnum("vore_regurgitate"), self.predator.origin, '0 0 0', 1);\r
- self.predator.punchangle_x += cvar("g_balance_vore_regurgitate_predator_punchangle_item");\r
- self.predator.regurgitate_prepare = 0;\r
- self.predator.action_delay = time + cvar("g_balance_vore_action_delay");\r
+ if(regurgitate)\r
+ {\r
+ // predator effects, some common to those in Vore_Regurgitate\r
+ PlayerSound(e.predator, playersound_regurgitate, CHAN_VOICE, VOICETYPE_PLAYERSOUND);\r
+ setanim(e.predator, e.predator.anim_pain1, FALSE, TRUE, TRUE); // looks good for swallowing / regurgitating\r
+ pointparticles(particleeffectnum("vore_regurgitate"), e.predator.origin, '0 0 0', 1);\r
+ e.predator.punchangle_x += cvar("g_balance_vore_regurgitate_predator_punchangle_item");\r
+ e.predator.regurgitate_prepare = 0;\r
+ e.predator.action_delay = time + cvar("g_balance_vore_action_delay");\r
+\r
+ Item_DroppedConsumable_Spawn(e);\r
+ }\r
\r
- self.nextthink = 0;\r
- remove(self);\r
- self = world;\r
+ e.nextthink = 0;\r
+ remove(e);\r
+ e = world;\r
}\r
\r
void Item_Consumable_Spawn(entity e, entity pl)\r
Vore_AutoDigest(pl);\r
}\r
\r
+void Item_DroppedConsumable_Spawn(entity e)\r
+{\r
+ entity item;\r
+ item = spawn();\r
+ item.owner = world;\r
+ item.classname = "droppedconsumable";\r
+ item.movetype = MOVETYPE_TOSS;\r
+ item.solid = SOLID_TRIGGER;\r
+ setmodel(item, e.model);\r
+ item.health = e.health;\r
+ item.max_health = e.max_health;\r
+ item.dmg = e.dmg;\r
+ item.scale = e.scale;\r
+ item.colormod = e.colormod;\r
+\r
+ setorigin(item, e.predator.origin);\r
+ item.angles = e.angles;\r
+ makevectors(e.predator.v_angle);\r
+ item.velocity = v_forward * cvar("g_balance_vore_regurgitate_force");\r
+ e.predator.velocity += -v_forward * cvar("g_balance_vore_regurgitate_predatorforce");\r
+}\r
+\r
float Item_GiveTo(entity item, entity player)\r
{\r
float _switchweapon;\r