// Tandem (7)
set g_nades_pokenade_monster_lifetime 150 "How long pokenade monster will survive"
+set g_nades_pokenade_turret_lifetime 150 "How long pokenade turret will take to be in the world"
+set g_nades_pokenade_vehicle_lifetime 150 "How long pokenade vehicle will take to be in the world"
set g_nades_pokenade_type "zombie" "Monster, item, vehicle and turret to spawn"
set g_nades_tandemnade_type 0 "Tandem nade selection; 0: monster, 1: item, 2: vehicle, 3: turret"
set g_nades_tandem_ball_spread 0.5 "Maximum force which the ball will have on explosion"
if(!e)
return; // vehicle failed to be spawned
-
+
+ if(autocvar_g_nades_pokenade_vehicle_lifetime > 0)
+ e.vehicle_lifetime = time + autocvar_g_nades_pokenade_vehicle_lifetime;
return;
}
case 3:
if(!e)
return; // turret failed to be spawned
+ if(autocvar_g_nades_pokenade_turret_lifetime > 0)
+ e.turret_lifetime = time + autocvar_g_nades_pokenade_turret_lifetime;
return;
}
default:
string autocvar_g_nades_pokenade_type;
int autocvar_g_nades_tandemnade_type; //LegendGuard adds new nade cvar for emerald nade options 01-07-2021
float autocvar_g_nades_pokenade_monster_lifetime;
+float autocvar_g_nades_pokenade_turret_lifetime;
+float autocvar_g_nades_pokenade_vehicle_lifetime;
#endif
// use slots 70-100
void turret_think(entity this)
{
+ if(this.tur_spawned && this.turret_lifetime != 0)
+ if(time >= this.turret_lifetime)
+ {
+ tmp_vehcount--;
+
+ turret_die(this);
+ return;
+ }
+
this.nextthink = time + this.ticrate;
MUTATOR_CALLHOOK(TurretThink, this);
// Check if we have a vailid enemy, and try to find one if we dont.
// Don't attack against owner
- if (turret_select_target(this) == this.realowner) return;
+ if(turret_select_target(this) == this.realowner) return;
// g_turrets_targetscan_maxdelay forces a target re-scan at least this often
float do_target_scan = 0;
{
this.enemy = turret_select_target(this);
// Don't attack against owner
- if (this.enemy == this.realowner) return;
+ if(this.enemy == this.realowner) return;
this.target_select_time = time;
}
.float tur_dist_aimpos; // distance to aim location
.float tur_dist_impact_to_aimpos; // distance impact<->aim
.bool tur_spawned; // spawned turret using spawnturret
+.float turret_lifetime; // turret disappears instantly after this delay, set from spawn
.float volly_counter; // decrement counter from .shot_volly to 0
.float target_select_time; // last time turret had a valid target
.float target_validate_time; // throttle re-validation of current target
if(veh.owner)
return; // got here and didn't enter the gunner, return
+
if(!teamplay)
if(!veh.realowner)
if(veh.realowner != pl && autocvar_g_vehicles_steal)
void vehicles_think(entity this)
{
+ if(this.summoned && this.vehicle_lifetime != 0)
+ if(time >= this.vehicle_lifetime)
+ {
+ Send_Effect(EFFECT_TELEPORT, this.origin + '0 0 100', '0 0 0', 1);
+
+ tmp_vehcount--;
+
+ // to avoid weird entity assignments to other stuff like projectiles
+ delete(this.vehicle_shieldent);
+ delete(this.vehicle_hudmodel);
+ delete(this.tur_head);
+ delete(this.vehicle);
+ delete(this);
+ return;
+ }
+
this.nextthink = time + autocvar_g_vehicles_thinkrate;
if(this.owner)
.bool no_respawn_option;
.bool cannot_respawn;
.bool summoned;
+.float vehicle_lifetime; // vehicle disappears instantly after this delay, set from spawn
// vehicle functions
.void(int _spawnflag) vehicle_spawn; /// Vehicles custom fucntion to be efecuted when vehicle (re)spawns