SUB_SetFade(item, time + 20, 1);\r
}\r
\r
+float Item_Swallow(entity item, entity player)\r
+{\r
+ float pickedup;\r
+ pickedup = FALSE;\r
+\r
+ item.swallow_progress_prey = min(item.swallow_progress_prey + 0.02, 1);\r
+ if(item.swallow_progress_prey < 1)\r
+ return FALSE; // item not eaten yet\r
+\r
+ if(item.dmg && cvar("g_vore")) // consumable item, only if the vore system is enabled\r
+ {\r
+ if(player.stomach_load + item.dmg <= player.stomach_maxload)\r
+ if not(!cvar("g_balance_health_consumable_alwayspickup") && player.health >= item.max_health)\r
+ {\r
+ pickedup = TRUE;\r
+ item.swallow_progress_prey = 0;\r
+ Item_Consumable_Spawn(item, player);\r
+ }\r
+ }\r
+ else if (player.health < item.max_health)\r
+ {\r
+ pickedup = TRUE;\r
+ item.swallow_progress_prey = 0;\r
+ player.health = min(player.health + item.health, item.max_health);\r
+ player.pauserothealth_finished = max(player.pauserothealth_finished, time + cvar("g_balance_pause_health_rot"));\r
+ }\r
+\r
+ player.swallow_progress_pred = item.swallow_progress_prey;\r
+ return pickedup;\r
+}\r
+\r
float Item_GiveTo(entity item, entity player)\r
{\r
float _switchweapon;\r
}\r
\r
if (item.health)\r
- {\r
- if(item.dmg && cvar("g_vore")) // consumable item, only if the vore system is enabled\r
- {\r
- if(player.stomach_load + item.dmg <= player.stomach_maxload)\r
- if not(!cvar("g_balance_health_consumable_alwayspickup") && player.health >= item.max_health)\r
- {\r
- pickedup = TRUE;\r
- Item_Consumable_Spawn(self, player);\r
- }\r
- }\r
- else if (player.health < item.max_health)\r
- {\r
- pickedup = TRUE;\r
- player.health = min(player.health + item.health, item.max_health);\r
- player.pauserothealth_finished = max(player.pauserothealth_finished, time + cvar("g_balance_pause_health_rot"));\r
- }\r
- }\r
+ pickedup = Item_Swallow(item, player);\r
if (item.armorvalue)\r
if (player.armorvalue < item.max_armorvalue)\r
{\r
return 1;\r
}\r
\r
+void Item_Think()\r
+{\r
+ self.nextthink = time;\r
+\r
+ if(!self.swallow_progress_prey)\r
+ return;\r
+\r
+ self.swallow_progress_prey = max(0, self.swallow_progress_prey - 0.01);\r
+ self.alpha = 1 / self.swallow_progress_prey;\r
+}\r
+\r
void Item_Touch (void)\r
{\r
entity e, head;\r
return item.bot_pickupbasevalue * c;\r
};\r
\r
-\r
.float is_item;\r
void StartItem (string itemmodel, string pickupsound, float defaultrespawntime, float defaultrespawntimejitter, string itemname, float itemid, float weaponid, float itemflags, float(entity player, entity item) pickupevalfunc, float pickupbasevalue)\r
{\r
self.weapons = weaponid;\r
self.flags = FL_ITEM | itemflags;\r
self.touch = Item_Touch;\r
+ self.think = Item_Think;\r
+ self.nextthink = time;\r
setmodel (self, self.mdl); // precision set below\r
self.effects |= EF_LOWPRECISION;\r
if((itemflags & FL_POWERUP) || self.health || self.armorvalue)\r
if(cvar("g_balance_vore_swallow_speed_decrease"))\r
{\r
if(self.swallow_progress_pred)\r
- {\r
- self.swallow_progress_pred -= cvar("g_balance_vore_swallow_speed_decrease") * frametime;\r
- if(self.swallow_progress_pred < 0)\r
- self.swallow_progress_pred = 0;\r
- }\r
+ self.swallow_progress_pred = max(0, self.swallow_progress_pred - cvar("g_balance_vore_swallow_speed_decrease") * frametime);\r
if(self.swallow_progress_prey)\r
- {\r
- self.swallow_progress_prey -= cvar("g_balance_vore_swallow_speed_decrease") * frametime;\r
- if(self.swallow_progress_prey < 0)\r
- self.swallow_progress_prey = 0;\r
- }\r
+ self.swallow_progress_prey = max(0, self.swallow_progress_prey - cvar("g_balance_vore_swallow_speed_decrease") * frametime);\r
}\r
\r
// set the predator's stomach load and capacity\r
\r
- +0.8: Some sort of bullet time feature in single player, by setting the slowmo cvar\r
\r
+- 0.8: Don't apply weight in vore.qc, since it's not a more general component\r
+\r
- 0.8 BUG: Stomach load appeared 101 while my health was 100\r
\r
-- 0.8: Give weapons a weight, which affects the player based on size\r
+- 0.8: Give weapons a weight, which affects the player based on size?\r
+\r
+- 0.8: How do teamed items work?\r
+\r
+- 0.8: Does item alpha break any game modes, now that slow swallowing items are implemented?\r
\r
- 0.8: Don't allow macros in the tutorial map (use health rot), since their weight makes it impossible to pass some parts\r
\r