this.realowner,
this.origin,
false,
- false
+ false,
+ true
);
vehspawncount++;
false,
false,
false,
- 1
+ 1,
+ true
);
turspawncount++;
return true;
}
-entity spawnturret (entity e, string turret, Turret tur, entity spawnedby, entity own, vector orig, bool respwn, bool invincible, bool removeifinvalid, int moveflag)
+entity spawnturret (entity e, string turret, Turret tur, entity spawnedby, entity own, vector orig, bool respwn, bool invincible, bool removeifinvalid, int moveflag, bool optional)
{
e.spawnflags = TSF_SUSPENDED;
+ e.optionalsetup = optional;
if(!respwn) { e.spawnflags |= TSL_NO_RESPAWN; }
if(invincible) { e.damage_flags |= TFL_DMG_NO; }
return NULL; // no good
}
// select a random valid turret type if no valid turret was provided
- return spawnturret(e, "random", TUR_Null, spawnedby, own, orig, respwn, invincible, removeifinvalid, moveflag);
+ return spawnturret(e, "random", TUR_Null, spawnedby, own, orig, respwn, invincible, removeifinvalid, moveflag, optional);
}
}
e.team = spawnedby.team; // colors handled in spawn code
// TODO: Create a "following player" feature when turret has moveflag
- //if(autocvar_g_monsters_owners)
+ //if(autocvar_g_monsters_owners && e.move_movetype == MOVETYPE_WALK)
// e.monster_follow = own; // using .owner makes the monster non-solid for its master
e.angles_y = spawnedby.angles_y;
}
if(!(e.spawnflags & TSF_SUSPENDED)) { delete(e); return NULL; } // remove even if told not to, as we didn't spawn any kind of turret
-
+
turret_initialize(e, tur);
+ //LOG_INFOF("^1tur.netname^3: %s", tur.netname);
+
+ if (e.optionalsetup)
+ e.tur_head.effects = (EF_DIMLIGHT | EF_FULLBRIGHT);
+
return e;
}
#endif
float autocvar_g_turrets_targetscan_maxdelay;
float autocvar_g_turrets_targetscan_mindelay;
-entity spawnturret(entity e, string turret, Turret tur, entity spawnedby, entity own, vector orig, bool respwn, bool invincible, bool removeifinvalid, int moveflag);
+entity spawnturret(entity e, string turret, Turret tur, entity spawnedby, entity own, vector orig, bool respwn, bool invincible, bool removeifinvalid, int moveflag, bool optional);
entity turret_projectile(entity actor, Sound _snd, float _size, float _health, float _death, float _proj_type, float _cull, float _cli_anim);
void turret_projectile_explode(entity this);
float turret_validate_target(entity e_turret, entity e_target, float validate_flags);
.float shot_volly_refire; // refire after completed volly
*/
+.bool optionalsetup; // optional setup
.float ticrate; // interal ai think rate
.entity tur_head; // top part of the turret
.entity tur_defend; // defend this entity
if (this.optionalsetup)
this.effects = EF_DIMLIGHT;
else
- this.effects = eff;
+ this.effects = eff;
Vehicle info = this.vehicledef; //REGISTRY_GET(Vehicles, this.vehicleid);
info.vr_setcolors(info, this);
return true;
}
-entity spawnvehicle (entity e, string vehicle, Vehicle veh, entity spawnedby, entity own, vector orig, bool respwn, bool removeifinvalid)
+entity spawnvehicle (entity e, string vehicle, Vehicle veh, entity spawnedby, entity own, vector orig, bool respwn, bool removeifinvalid, bool optional)
{
e.spawnflags = VHF_MULTISLOT;
- e.optionalsetup = true;
+ e.optionalsetup = optional;
// TODO: Make a respawn option, the following line isn't functional
if(!respwn) { e.spawnflags |= VHF_ISVEHICLE; }
return NULL; // no good
}
// select a random valid vehicle type if no valid vehicle was provided
- return spawnvehicle(e, "random", VEH_Null, spawnedby, own, orig, respwn, removeifinvalid);
+ return spawnvehicle(e, "random", VEH_Null, spawnedby, own, orig, respwn, removeifinvalid, optional);
}
}
.float lock_strength;
.float lock_time;
.float lock_soundtime;
-.bool optionalsetup;
+.bool optionalsetup;
// vehicle functions
.void(int _spawnflag) vehicle_spawn; /// Vehicles custom fucntion to be efecuted when vehicle (re)spawns
.float vehicle_enter_delay; // prevent players jumping to and from vehicles instantly
-entity spawnvehicle(entity e, string vehicle, Vehicle veh, entity spawnedby, entity own, vector orig, bool respwn, bool removeifinvalid);
+entity spawnvehicle(entity e, string vehicle, Vehicle veh, entity spawnedby, entity own, vector orig, bool respwn, bool removeifinvalid, bool optional);
void vehicles_exit(entity vehic, int eject);
bool vehicle_initialize(entity this, Vehicle info, float nodrop);
bool vehicle_impulse(entity this, int imp);