+ if((last_health <= 0 && getstati(STAT_HEALTH) > 0) || (!spectatee_status && last_spectatee)) // also cover switching from a spectator to a player instantly\r
+ if not(spectatee_status && last_spectatee != spectatee_status) // not if we switched players and that detects a different health\r
+ respawned = TRUE; // stays true for one frame\r
+\r
+ // helper system\r
+ if(cvar("cl_helper"))\r
+ if not(getstati(STAT_ARMOR) < g_power || time <= power_boot)\r
+ {\r
+ if(intermission || respawned || spectatee_status < 0 || getstati(STAT_HEALTH) <= 0 || getstati(STAT_VORE_EATEN))\r
+ {\r
+ // Set these helper messages as having been triggered, so that the player must first reach them before they complain.\r
+ // Otherwise, if you don't have any start armor for instance, the helper will complain about low armor when we spawn.\r
+ helper_health = TRUE;\r
+ helper_armor = TRUE;\r
+ helper_ammo = TRUE;\r
+ helper_stomachload = TRUE;\r
+ }\r
+ else if(helper_pause <= time)\r
+ {\r
+ // health helper\r
+ if(getstati(STAT_HEALTH) <= cvar("cl_helper_item_health"))\r
+ {\r
+ if(cvar("cl_helper_item_health") && !helper_health)\r
+ {\r
+ sound(self, CHAN_VOICE, strcat("helper/", cvar_string("cl_helper_voice"), "/health.wav"), VOL_BASEVOICE, ATTN_NONE);\r
+ helper_health = TRUE;\r
+ helper_pause = time + cvar("cl_helper_pause");\r
+ helper_ammo = time + cvar("cl_helper_pause");\r
+ }\r
+ }\r
+ else if(helper_health)\r
+ helper_health = FALSE;\r
+\r
+ // armor helper\r
+ if(getstati(STAT_ARMOR) <= cvar("cl_helper_item_armor"))\r
+ {\r
+ if(cvar("cl_helper_item_armor") && !helper_armor)\r
+ {\r
+ sound(self, CHAN_VOICE, strcat("helper/", cvar_string("cl_helper_voice"), "/armor.wav"), VOL_BASEVOICE, ATTN_NONE);\r
+ helper_armor = TRUE;\r
+ helper_pause = time + cvar("cl_helper_pause");\r
+ }\r
+ }\r
+ else if(helper_armor)\r
+ helper_armor = FALSE;\r
+\r
+ // ammo helper\r
+ if(getstati(STAT_FUEL) <= cvar("cl_helper_item_ammo_fuel"))\r
+ {\r
+ if(cvar("cl_helper_item_ammo_fuel") && !helper_ammo)\r
+ {\r
+ sound(self, CHAN_VOICE, strcat("helper/", cvar_string("cl_helper_voice"), "/ammo.wav"), VOL_BASEVOICE, ATTN_NONE);\r
+ helper_ammo = TRUE;\r
+ helper_pause = time + cvar("cl_helper_pause");\r
+ }\r
+ }\r
+ else if(helper_ammo)\r
+ helper_ammo = FALSE;\r
+\r
+ // speed helper\r
+ if(vlen(pmove_vel) >= cvar("cl_helper_item_speed"))\r
+ {\r
+ if(cvar("cl_helper_item_speed") && !helper_speed)\r
+ {\r
+ sound(self, CHAN_VOICE, strcat("helper/", cvar_string("cl_helper_voice"), "/speed.wav"), VOL_BASEVOICE, ATTN_NONE);\r
+ helper_speed = TRUE;\r
+ helper_pause = time + cvar("cl_helper_pause");\r
+ }\r
+ }\r
+ else if(helper_speed)\r
+ helper_speed = FALSE;\r
+\r
+ // stomach load helper\r
+ if(getstati(STAT_VORE_LOAD) / getstati(STAT_VORE_MAXLOAD) >= cvar("cl_helper_item_stomachload"))\r
+ {\r
+ if(cvar("cl_helper_item_stomachload") && !helper_stomachload)\r
+ {\r
+ sound(self, CHAN_VOICE, strcat("helper/", cvar_string("cl_helper_voice"), "/stomachload.wav"), VOL_BASEVOICE, ATTN_NONE);\r
+ helper_stomachload = TRUE;\r
+ helper_pause = time + cvar("cl_helper_pause");\r
+ }\r
+ }\r
+ else if(helper_stomachload)\r
+ helper_stomachload = FALSE;\r
+ }\r
+ }\r
+\r
+ // event chase camera\r
+ if(cvar("chase_active") <= 0) // greater than 0 means it's enabled manually, and this code is skipped\r
+ {\r
+ if(spectatee_status >= 0 && (cvar("cl_eventchase_death") && getstati(STAT_HEALTH) <= 0 && !intermission && !getstati(STAT_VORE_EATEN)) || intermission)\r
+ {\r
+ // make special vector since we can't use view_origin (It is one frame old as of this code, it gets set later with the results this code makes.)\r
+ vector current_view_origin = getpropertyvec(VF_ORIGIN);\r
+ \r
+ // We must enable chase_active to get a third person view (weapon viewmodel hidden and own player model showing).\r
+ // Ideally, there should be another way to enable third person cameras, such as through setproperty()\r
+ if(!cvar("chase_active"))\r
+ cvar_set("chase_active", "-1"); // -1 enables chase_active while marking it as set by this code, and not by the user (which would be 1)\r
+\r
+ // make the camera smooth back\r
+ if(cvar("cl_eventchase_speed") && eventchase_current_distance < cvar("cl_eventchase_distance"))\r
+ eventchase_current_distance += cvar("cl_eventchase_speed") * (cvar("cl_eventchase_distance") - eventchase_current_distance) * frametime; // slow down the further we get\r
+ else if(eventchase_current_distance != cvar("cl_eventchase_distance"))\r
+ eventchase_current_distance = cvar("cl_eventchase_distance");\r
+\r
+ vector eventchase_target_origin;\r
+ makevectors(view_angles);\r
+ // pass 1, used to check where the camera would go and obtain the trace_fraction\r
+ eventchase_target_origin = current_view_origin - v_forward * eventchase_current_distance;\r
+ WarpZone_TraceLine(current_view_origin, eventchase_target_origin, MOVE_WORLDONLY, self);\r
+ // pass 2, also multiplying view_forward with trace_fraction, to prevent the camera from going through walls\r
+ // The 0.1 subtraction is to not limit the camera precisely at the wall surface, as that allows the view to poke through\r
+ eventchase_target_origin = current_view_origin - v_forward * eventchase_current_distance * (trace_fraction - 0.1);\r
+ WarpZone_TraceLine(current_view_origin, eventchase_target_origin, MOVE_WORLDONLY, self);\r
+\r
+ setproperty(VF_ORIGIN, trace_endpos);\r
+ setproperty(VF_ANGLES, WarpZone_TransformVAngles(WarpZone_trace_transform, view_angles));\r
+ }\r
+ else if(cvar("chase_active") < 0) // time to disable chase_active if it was set by this code\r
+ {\r
+ cvar_set("chase_active", "0");\r
+ eventchase_current_distance = 0; // start from 0 next time\r
+ }\r
+ }\r
+\r
+ if(frametime)\r