precache_sound ("weapons/uzi_fire.wav");
}
-//.entity tur_base;
void turret_remove()
{
- entity th;
dprint("Removing turret type ", ftos(self.turret_type), "\n");
- th = self.tur_head;
- self.tur_head = world;
- remove(th);
+
+ remove(self.tur_head);
+ self.tur_head = world;
}
void turret_changeteam()
if(random() < 0.25)
te_spark(self.origin + '0 0 40', randomvec() * 256 + '0 0 256', 16);
- self.drawmask = MASK_NORMAL;
+ self.drawmask = MASK_NORMAL;
}
-//void(entity e, entity tagentity, string tagname) setattachment = #443;
-void turret_construct()
+string tid2info_base;
+string tid2info_head;
+vector tid2info_min;
+vector tid2info_max;
+void turret_tid2info(float _tid)
{
- string sbase, shead;
- vector _min, _max;
-
- if(self.tur_head == world)
- self.tur_head = spawn();
-
- sbase = "models/turrets/base.md3";
- _min = '-32 -32 0';
- _max = '32 32 64';
-
- switch(self.turret_type)
+ tid2info_base = "models/turrets/base.md3";
+ tid2info_min = '-32 -32 0';
+ tid2info_max = '32 32 64';
+
+ switch(_tid)
{
case TID_EWHEEL:
- sbase = "models/turrets/ewheel-base2.md3";
- shead = "models/turrets/ewheel-gun1.md3";
+ tid2info_base = "models/turrets/ewheel-base2.md3";
+ tid2info_head = "models/turrets/ewheel-gun1.md3";
break;
case TID_FLAC:
- shead = "models/turrets/flac.md3";
+ tid2info_head = "models/turrets/flac.md3";
break;
case TID_FUSION:
- shead = "models/turrets/reactor.md3";
- _min = '-34 -34 0';
- _max = '34 34 90';
+ tid2info_head = "models/turrets/reactor.md3";
+ tid2info_min = '-34 -34 0';
+ tid2info_max = '34 34 90';
break;
case TID_HELLION:
- shead = "models/turrets/hellion.md3";
+ tid2info_head = "models/turrets/hellion.md3";
break;
case TID_HK:
- shead = "models/turrets/hk.md3";
+ tid2info_head = "models/turrets/hk.md3";
break;
case TID_MACHINEGUN:
- shead = "models/turrets/machinegun.md3";
+ tid2info_head = "models/turrets/machinegun.md3";
break;
case TID_MLRS:
- shead = "models/turrets/mlrs.md3";
+ tid2info_head = "models/turrets/mlrs.md3";
break;
case TID_PHASER:
- shead = "models/turrets/phaser.md3";
+ tid2info_head = "models/turrets/phaser.md3";
break;
case TID_PLASMA:
- shead = "models/turrets/plasma.md3";
+ tid2info_head = "models/turrets/plasma.md3";
break;
case TID_PLASMA_DUAL:
- shead = "models/turrets/plasmad.md3";
+ tid2info_head = "models/turrets/plasmad.md3";
break;
case TID_TESLA:
- sbase = "models/turrets/tesla_base.md3";
- shead = "models/turrets/tesla_head.md3";
- _min = '-60 -60 0';
- _max ='60 60 128';
+ tid2info_base = "models/turrets/tesla_base.md3";
+ tid2info_head = "models/turrets/tesla_head.md3";
+ tid2info_min = '-60 -60 0';
+ tid2info_max ='60 60 128';
break;
case TID_WALKER:
- sbase = "models/turrets/walker_body.md3";
- shead = "models/turrets/walker_head_minigun.md3";
- _min = '-70 -70 0';
- _max = '70 70 95';
+ tid2info_base = "models/turrets/walker_body.md3";
+ tid2info_head = "models/turrets/walker_head_minigun.md3";
+ tid2info_min = '-70 -70 0';
+ tid2info_max = '70 70 95';
break;
- }
+ }
+}
+
+//void(entity e, entity tagentity, string tagname) setattachment = #443;
+void turret_construct()
+{
+ if(self.tur_head == world)
+ self.tur_head = spawn();
+
+ turret_tid2info(self.turret_type);
setorigin(self, self.origin);
-
+
self.tur_head.classname = "turret_head";
self.tur_head.owner = self;
- setmodel(self, sbase);
- setmodel(self.tur_head, shead);
+ setmodel(self, tid2info_base);
+ setmodel(self.tur_head, tid2info_head);
self.tur_head.move_movetype = MOVETYPE_NOCLIP;
self.move_movetype = MOVETYPE_NOCLIP;
self.tur_head.angles = self.angles;
- setsize(self, _min, _max);
+ setsize(self, tid2info_min, tid2info_max);
setsize(self.tur_head, '0 0 0', '0 0 0');
setorigin(self.tur_head, gettaginfo(self, gettagindex(self, "tag_head")));
self.entremove = turret_remove;
}
+entity turret_gibtoss(string _model, vector _from, vector _to, vector _cmod, float _explode);
+void turret_gibboom();
+
+void turret_gib_draw()
+{
+ Movetype_Physics_MatchTicrate(autocvar_cl_gibs_ticrate, autocvar_cl_gibs_sloppy);
+ self.drawmask = MASK_NORMAL;
+
+ if(self.cnt)
+ {
+ if(time >= self.nextthink)
+ {
+ turret_gibboom();
+ remove(self);
+ }
+ }
+ else
+ {
+ self.alpha = bound(0, self.nextthink - time, 1);
+ if(self.alpha < ALPHA_MIN_VISIBLE)
+ remove(self);
+ }
+}
+
+void turret_gibboom()
+{
+ float i;
+ sound (self, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+ pointparticles(particleeffectnum("rocket_explode"), self.origin, '0 0 0', 1);
+
+ for (i = 1; i < 5; i = i +1)
+ turret_gibtoss(strcat("models/turrets/head-gib", ftos(i), ".md3"), self.origin, self.velocity + randomvec() * 700, '0 0 0', FALSE);
+}
+
+entity turret_gibtoss(string _model, vector _from, vector _to, vector _cmod, float _explode)
+{
+ entity gib;
+
+ gib = spawn();
+ setorigin(gib, _from);
+ setmodel(gib, _model);
+ gib.colormod = _cmod;
+ gib.solid = SOLID_CORPSE;
+ gib.draw = turret_gib_draw;
+ gib.cnt = _explode;
+
+ if(_explode)
+ {
+ gib.nextthink = time + 0.2 * (autocvar_cl_gibs_lifetime * (1 + prandom() * 0.15));
+ gib.effects = EF_FLAME;
+ }
+ else
+ gib.nextthink = time + autocvar_cl_gibs_lifetime * (1 + prandom() * 0.15);
+
+ gib.gravity = 1;
+ gib.move_movetype = MOVETYPE_BOUNCE;
+ gib.move_origin = gib.origin = _from;
+ gib.move_velocity = _to;
+ gib.move_avelocity = prandomvec() * 32;
+ gib.move_time = time;
+ gib.damageforcescale = 1;
+
+ return gib;
+}
+
+void turret_die()
+{
+ entity headgib;
+
+ setmodel(self, "");
+ setmodel(self.tur_head, "");
+ sound (self, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+ pointparticles(particleeffectnum("rocket_explode"), self.origin, '0 0 0', 1);
+ turret_tid2info(self.turret_type);
+
+ // Base
+ if(self.turret_type == TID_EWHEEL)
+ turret_gibtoss(tid2info_base, self.origin, self.velocity, '-1 -1 -1', FALSE);
+ else if (self.turret_type == TID_WALKER)
+ turret_gibtoss(tid2info_base, self.origin, self.velocity, '-1 -1 -1', FALSE);
+ else if (self.turret_type == TID_TESLA)
+ turret_gibtoss(tid2info_base, self.origin, self.velocity, '-1 -1 -1', FALSE);
+ else
+ {
+ if (random() > 0.5)
+ {
+ turret_gibtoss("models/turrets/base-gib2.md3", self.origin + '0 0 2', '0 0 50' + randomvec() * 150, '0 0 0', FALSE);
+ turret_gibtoss("models/turrets/base-gib3.md3", self.origin + '0 0 2', '0 0 50' + randomvec() * 150, '0 0 0', FALSE);
+ turret_gibtoss("models/turrets/base-gib4.md3", self.origin + '0 0 2', '0 0 50' + randomvec() * 150, '0 0 0', FALSE);
+ }
+ else
+ turret_gibtoss("models/turrets/base-gib1.md3", self.origin, '0 0 0', '0 0 0', TRUE);
+ }
+
+ headgib = turret_gibtoss(tid2info_head, self.origin + '0 0 32', '0 0 200' + randomvec() * 200, '-1 -1 -1', TRUE);
+ headgib.angles = headgib.move_angles = self.tur_head.angles;
+ headgib.avelocity = headgib.move_avelocity = self.tur_head.move_avelocity + randomvec() * 45;
+ headgib.avelocity_y = headgib.move_avelocity_y = headgib.move_avelocity_y * 5;
+ headgib.gravity = 0.5;
+}
+
void ent_turret()
{
float sf;
self.team = _team;
turret_changeteam();
}
- }
+ }
+
+ if(sf == TNSF_DIE)
+ turret_die();
}
// Comment out below to skip turrets
#define TTURRETS_ENABLED
-//#define TTURRETS_CSQC
#ifdef TTURRETS_ENABLED
#ifdef SVQC
float TNSF_SETUP = 8;
float TNSF_ANG = 16;
float TNSF_AVEL = 32;
+float TNSF_DIE = 64;
+float TNSF_FIRE = 128;
+
float TNSF_FULL_UPDATE = 16777215;
#endif // TTURRETS_ENABLED
/*
-* Trow a turret gib
+* Spawn a boom, trow fake bits arround
+* and hide the real ones.
*/
-void turret_gib_damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector vforce)
-{
- self.velocity += vforce;
-}
-
-void turret_trowgib(
- vector v_from, vector v_to, vector v_colormod,
- string smodel,
- float f_lifetime, float f_fadetime, float b_burn)
+void turret_hide()
{
- local entity gib;
- local entity burn;
-
- gib = spawn();
-
- gib.classname = "turret_gib";
- setmodel(gib, smodel);
- setorigin(gib, v_from);
- SUB_SetFade(gib,time + f_lifetime, 2);
-
- gib.solid = SOLID_BBOX;
- gib.movetype = MOVETYPE_BOUNCE;
- gib.takedamage = DAMAGE_YES;
- gib.event_damage = turret_gib_damage;
- gib.health = -1;
- gib.effects = EF_LOWPRECISION;
- gib.flags = FL_NOTARGET;
- gib.colormod = v_colormod;
- gib.velocity = v_to;
-
- if (b_burn)
- {
- burn = spawn();
- burn.effects = EF_LOWPRECISION;//|EF_FLAME;
- setattachment(burn,gib,"");
- setorigin(burn,(gib.mins + gib.maxs) * 0.5);
- SUB_SetFade(burn,time + (f_lifetime * 0.5), 2);
- }
+ self.effects |= EF_NODRAW;
+ self.nextthink = time + self.respawntime - 0.2;
+ self.think = turret_stdproc_respawn;
}
-void turret_gib_boom()
-{
- entity gib;
- float i;
- string s;
-
- for (i = 1; i < 5; i = i +1)
- {
- gib = spawn();
- gib.classname = "turret_gib";
-
- s = strcat("models/turrets/head-gib",ftos(i));
- s = strcat(s,".md3");
- setmodel(gib, s);
-
- setorigin(gib,self.origin);
-
- SUB_SetFade(gib,time + 5,2);
-
- gib.solid = SOLID_BBOX;
- gib.movetype = MOVETYPE_BOUNCE;
- gib.gravity = 0.5;
- gib.damageforcescale = 2;
- gib.takedamage = DAMAGE_YES;
- gib.event_damage = turret_gib_damage;
- gib.health = -1;
- gib.effects = EF_LOWPRECISION;
- gib.flags = FL_NOTARGET;
- gib.velocity = self.velocity + (randomvec() * 700);
- gib.avelocity = randomvec() * 64;
- }
-
- WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
- WriteByte (MSG_BROADCAST, 78);
- WriteCoord (MSG_BROADCAST, self.origin_x);
- WriteCoord (MSG_BROADCAST, self.origin_y);
- WriteCoord (MSG_BROADCAST, self.origin_z);
-
- remove(self);
-}
-
-void turret_trowgib2(
- vector v_from, vector v_to, vector v_colormod,
- entity e_mimic, float boomtime)
-{
- entity gib;
-
- gib = spawn();
-
- gib.classname = "turret_gib";
- setmodel(gib,e_mimic.model);
- setorigin(gib,v_from);
-
- gib.solid = SOLID_BBOX;
-
- gib.movetype = MOVETYPE_BOUNCE;
- gib.gravity = 0.75;
- gib.damageforcescale = 2;
- gib.takedamage = DAMAGE_YES;
- gib.event_damage = turret_gib_damage;
- gib.health = -1;
- gib.effects = EF_LOWPRECISION;
- gib.flags = FL_NOTARGET;
- gib.colormod = v_colormod;
- gib.velocity = v_to;
- gib.avelocity = randomvec() * 32;
- gib.think = turret_gib_boom;
- gib.nextthink = boomtime;
- //gib.effects = EF_FLAME;
-
-
-}
-/*
-* Spawn a boom, trow fake bits arround
-* and hide the real ones.
-*/
void turret_stdproc_die()
{
vector org2;
self.deadflag = DEAD_DEAD;
self.tur_head.deadflag = self.deadflag;
-
- sound (self, CHAN_PLAYER, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
- org2 = self.origin + '0 0 40';
-
-// Explotion grafix
- WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
- WriteByte (MSG_BROADCAST, 78);
- WriteCoord (MSG_BROADCAST, org2_x);
- WriteCoord (MSG_BROADCAST, org2_y);
- WriteCoord (MSG_BROADCAST, org2_z);
// Unsolidify and hide real parts
self.solid = SOLID_NOT;
self.event_damage = SUB_Null;
self.takedamage = DAMAGE_NO;
- self.effects = EF_NODRAW;
self.health = 0;
-
+/*
// Trow fake parts arround
// base
if not(self.damage_flags & TFL_DMG_DEATH_NOGIBS)
// Go boom
//RadiusDamage (self,self, min(self.ammo,50),min(self.ammo,50) * 0.25,250,world,min(self.ammo,50)*5,DEATH_TURRET,world);
-
+*/
if(self.damage_flags & TFL_DMG_DEATH_NORESPAWN)
{
if (self.turret_diehook)
else
{
// Setup respawn
- self.nextthink = time + self.respawntime;
- self.think = turret_stdproc_respawn;
+ self.SendFlags = TNSF_DIE;
+ self.nextthink = time + 0.2;
+ self.think = turret_hide;
if (self.turret_diehook)
self.turret_diehook();
self.nextthink = time + self.ticrate;
self.SendFlags = TNSF_FULL_UPDATE;
- self.think = turret_link; // CSQC?
+ self.think = turret_link;
if (self.turret_respawnhook)
self.turret_respawnhook();
-
}
/*
self.think = turret_stdproc_die;
}
- // CSQC
self.SendFlags |= TNSF_STATUS;
-
}
* (unless you have a very good reason not to)
* if the return value is 0, the turret should be removed.
*/
-float turret_stdproc_init (string cvar_base_name, float csqc_shared, string base, string head, float _turret_type)
+float turret_stdproc_init (string cvar_base_name, string base, string head, float _turret_type)
{
entity e, ee;
e.think = turrets_manager_think;
e.nextthink = time + 2;
}
-#ifndef TTURRETS_CSQC
- csqc_shared = 0;
-#endif
+
/*
if(csqc_shared)
{
self.target_validate_flags = self.target_select_flags;
-
// Ammo stuff
if not (self.ammo_max)
self.ammo_max = self.shot_dmg * 10;
// Offsets & origins
if (!self.tur_shotorg) self.tur_shotorg = '50 0 50';
+
+ if (!self.health)
+ self.health = 150;
-// Gane hooks
+// Game hooks
if(MUTATOR_CALLHOOK(TurretSpawn))
return 0;
setorigin(self.tur_head, '0 0 0');
setattachment(self.tur_head, self, "tag_head");
- if (!self.health)
- self.health = 150;
-
self.tur_health = self.health;
self.solid = SOLID_BBOX;
self.tur_head.solid = SOLID_NOT;
self.idle_aim = '0 0 0';
// Attach stdprocs. override when and what needed
+ self.turret_firecheckfunc = turret_stdproc_firecheck;
+ self.turret_firefunc = turret_stdproc_fire;
+ self.event_damage = turret_stdproc_damage;
+
if (self.turrcaps_flags & TFL_TURRCAPS_SUPPORT)
- {
self.turret_score_target = turret_stdproc_targetscore_support;
- self.turret_firecheckfunc = turret_stdproc_firecheck;
- self.turret_firefunc = turret_stdproc_fire;
- self.event_damage = turret_stdproc_damage;
- }
else
- {
self.turret_score_target = turret_stdproc_targetscore_generic;
- self.turret_firecheckfunc = turret_stdproc_firecheck;
- self.turret_firefunc = turret_stdproc_fire;
- self.event_damage = turret_stdproc_damage;
- }
self.use = turret_stdproc_use;
self.bot_attack = TRUE;
self.use();
}
- Net_LinkEntity(self, TRUE, 0, turret_send);
turret_stdproc_respawn();
-
- // Initiate the main AI loop
- /*self.nextthink = time;
- if(csqc_shared)
- self.think = turret_link;
- else
- self.think = turret_think;
- */
+
+ if (!turret_tag_fire_update())
+ dprint("Warning: Turret ",self.classname, " faild to initialize md3 tags\n");
+
return 1;
}
-/*
-.float target_select_flags; /// target selection flags
-float TFL_TARGETSELECT_NO = 1; /// Dont select a target on its own.
-float TFL_TARGETSELECT_LOS = 2; /// Need line of sight
-float TFL_TARGETSELECT_PLAYERS = 4; /// Players are valid targets
-float TFL_TARGETSELECT_MISSILES = 8; /// Missiles are valid targets
-float TFL_TARGETSELECT_TRIGGERTARGET = 16; /// Responds to turret_trigger_target events
-float TFL_TARGETSELECT_ANGLELIMITS = 32; /// Angular limitations of turret head limits target selection
-float TFL_TARGETSELECT_RANGELIMTS = 64; /// Range limits apply in targetselection
-float TFL_TARGETSELECT_TEAMCHECK = 128; /// Consider team own <-> targets team
-float TFL_TARGETSELECT_NOBUILTIN = 256; /// Cant select targets on its own. needs to be triggerd or slaved.
-float TFL_TARGETSELECT_OWNTEAM = 512;
-*/
-
float turret_stdproc_targetscore_support(entity _turret,entity _target)
{
float score; // Total score
- float s_score,d_score;
+ float s_score, d_score;
if (_turret.enemy == _target) s_score = 1;
*/
float turret_stdproc_targetscore_generic(entity _turret, entity _target)
{
- //vector v_tmp;
float d_dist; // Defendmode Distance
-
float score; // Total score
-
float d_score; // Distance score
float a_score; // Angular score
float m_score; // missile score
{
// Make a normlized value base on the targets distance from our optimal killzone
ikr = _turret.target_range_optimal;
- d_score = min(ikr,tvt_dist) / max(ikr,tvt_dist);
+ d_score = min(ikr, tvt_dist) / max(ikr, tvt_dist);
}
- /*
- // Determine the maximum time it could take this turrent to aim at someting.
- max_aim_delay = (max(_turret.aim_maxrot,_turret.aim_maxpitch) / _turret.aim_speed * 2);
-
- // Find out how long it would take to aim at this taget.
- aim_delay = (thadf+0.01) / _turret.aim_speed;
-
- // Turn this info into a normalized value.
- aim_delay = (min(max_aim_delay,aim_delay) / max_aim_delay);
- a_score = 1 - aim_delay;
- */
-
- //a_score = 1 - (tvt_thadf / max(_turret.aim_maxrot,_turret.aim_maxpitch));
a_score = 1 - tvt_thadf / _turret.aim_maxrot;
if ((_turret.target_select_missilebias > 0) && (_target.flags & FL_PROJECTILE))
{
self.velocity = '0 0 0';
- turret_trowgib2(self.origin, self.velocity + '0 0 400', '-0.6 -0.2 -02', self, 3 + time + random() * 2);
+ //turret_trowgib2(self.origin, self.velocity + '0 0 400', '-0.6 -0.2 -02', self, 3 + time + random() * 2);
if (self.pathcurrent)
pathlib_deletepath(self.pathcurrent.owner);
self.turret_diehook = ewheel_diehook;
- if (turret_stdproc_init("ewheel_std", TRUE, "models/turrets/ewheel-base2.md3", "models/turrets/ewheel-gun1.md3", TID_EWHEEL) == 0)
+ if (turret_stdproc_init("ewheel_std", "models/turrets/ewheel-base2.md3", "models/turrets/ewheel-gun1.md3", TID_EWHEEL) == 0)
{
remove(self);
return;
self.tur_head.aim_speed = autocvar_g_turrets_unit_ewheel_turnrate;
self.tur_head.aim_speed = self.tur_head.aim_speed / (1 / self.ticrate);
- if (!turret_tag_fire_update())
- dprint("Warning: Turret ",self.classname, " faild to initialize md3 tags\n");
-
//setorigin(self,self.origin + '0 0 128');
if (self.target != "")
{
{
float ftmp;
- // FIXME: tur_impacttime is not accurate enougth, this is a dirty hakk to make flac work.
-
- //w_deathtypestring = "got caught in the flack.";
-
-
-
if( (self.enemy != world) &&
(vlen(self.origin - self.enemy.origin) < self.owner.shot_radius * 3) )
{
// OMG HAXX!
setorigin(self,self.enemy.origin + randomvec() * self.owner.shot_radius);
}
-
-
-
+
te_explosion (self.origin);
ftmp = crandom();
self.ammo_flags = TFL_AMMO_ROCKETS | TFL_AMMO_RECHARGE;
self.aim_flags = TFL_AIM_LEAD | TFL_AIM_SHOTTIMECOMPENSATE;
- if (turret_stdproc_init("flac_std", TRUE, "models/turrets/base.md3", "models/turrets/flac.md3", TID_FLAC) == 0)
+ if (turret_stdproc_init("flac_std", "models/turrets/base.md3", "models/turrets/flac.md3", TID_FLAC) == 0)
{
remove(self);
return;
self.damage_flags |= TFL_DMG_HEADSHAKE;
self.target_select_flags |= TFL_TARGETSELECT_NOTURRETS | TFL_TARGETSELECT_MISSILESONLY;
- if (!turret_tag_fire_update())
- dprint("Warning: Turret ",self.classname, " faild to initialize md3 tags\n");
// Our fire routine
self.turret_firefunc = turret_flac_attack;
self.track_flags = TFL_TRACK_NO;
// self.turret_respawnhook = turret_fusionreactor_respawnhook;
- if (turret_stdproc_init("fusreac_std", TRUE,"models/turrets/base.md3", "models/turrets/reactor.md3", TID_FUSION) == 0)
+ if (turret_stdproc_init("fusreac_std", "models/turrets/base.md3", "models/turrets/reactor.md3", TID_FUSION) == 0)
{
remove(self);
return;
self.firecheck_flags = TFL_FIRECHECK_WORLD | TFL_FIRECHECK_DEAD | TFL_FIRECHECK_DISTANCES | TFL_FIRECHECK_TEAMCECK | TFL_FIRECHECK_REFIRE | TFL_FIRECHECK_AFF | TFL_FIRECHECK_OWM_AMMO;
self.ammo_flags = TFL_AMMO_ROCKETS | TFL_AMMO_RECHARGE;
- if (turret_stdproc_init("hellion_std", TRUE, "models/turrets/base.md3", "models/turrets/hellion.md3", TID_HELLION) == 0)
+ if (turret_stdproc_init("hellion_std", "models/turrets/base.md3", "models/turrets/hellion.md3", TID_HELLION) == 0)
{
remove(self);
return;
}
- if (!turret_tag_fire_update())
- dprint("Warning: Turret ",self.classname, " faild to initialize md3 tags\n");
-
self.turret_firefunc = turret_hellion_attack;
self.turret_postthink = turret_hellion_postthink;
}
self.shoot_flags = TFL_SHOOT_CLEARTARGET;
- if (turret_stdproc_init("hk_std", TRUE, "models/turrets/base.md3", "models/turrets/hk.md3", TID_HK) == 0)
+ if (turret_stdproc_init("hk_std", "models/turrets/base.md3", "models/turrets/hk.md3", TID_HK) == 0)
{
remove(self);
return;
self.target_validate_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_TEAMCHECK;
-
- if (!turret_tag_fire_update())
- dprint("Warning: Turret ",self.classname, " faild to initialize md3 tags\n");
-
// Our fire routine
self.turret_firefunc = turret_hk_attack;
if not (autocvar_g_antilag_bullets)
self.turrcaps_flags |= TFL_TURRCAPS_HITSCAN;
- if (turret_stdproc_init("machinegun_std", TRUE, "models/turrets/base.md3", "models/turrets/machinegun.md3", TID_MACHINEGUN) == 0)
+ if (turret_stdproc_init("machinegun_std", "models/turrets/base.md3", "models/turrets/machinegun.md3", TID_MACHINEGUN) == 0)
{
remove(self);
return;
self.damage_flags |= TFL_DMG_HEADSHAKE;
- if (!turret_tag_fire_update())
- dprint("Warning: Turret ",self.classname, " faild to initialize md3 tags\n");
-
// Our fire routine
self.turret_firefunc = turret_machinegun_attack;
self.ammo_flags = TFL_AMMO_ROCKETS | TFL_AMMO_RECHARGE;
self.aim_flags = TFL_AIM_LEAD | TFL_AIM_SHOTTIMECOMPENSATE;// | TFL_AIM_GROUND2;
- if (turret_stdproc_init("mlrs_std", TRUE, "models/turrets/base.md3", "models/turrets/mlrs.md3", TID_MLRS) == 0)
+ if (turret_stdproc_init("mlrs_std", "models/turrets/base.md3", "models/turrets/mlrs.md3", TID_MLRS) == 0)
{
remove(self);
return;
self.shoot_flags |= TFL_SHOOT_VOLLYALWAYS;
self.volly_counter = self.shot_volly;
- if (!turret_tag_fire_update())
- dprint("Warning: Turret ",self.classname, " faild to initialize md3 tags\n");
-
// Our fire routine
self.turret_firefunc = turret_mlrs_attack;
self.turret_postthink = turret_mlrs_postthink;
self.ammo_flags = TFL_AMMO_ENERGY | TFL_AMMO_RECHARGE | TFL_AMMO_RECIVE;
self.aim_flags = TFL_AIM_LEAD;
- if (turret_stdproc_init("phaser_std", TRUE, "models/turrets/base.md3","models/turrets/phaser.md3", TID_PHASER) == 0)
+ if (turret_stdproc_init("phaser_std", "models/turrets/base.md3","models/turrets/phaser.md3", TID_PHASER) == 0)
{
remove(self);
return;
}
- if (!turret_tag_fire_update())
- dprint("Warning: Turret ",self.classname, " faild to initialize md3 tags\n");
-
self.turret_firecheckfunc = turret_phaser_firecheck;
self.turret_firefunc = turret_phaser_attack;
self.turret_postthink = turret_phaser_postthink;
self.aim_flags = TFL_AIM_LEAD | TFL_AIM_SHOTTIMECOMPENSATE | TFL_AIM_GROUND2;
self.turrcaps_flags = TFL_TURRCAPS_RADIUSDMG | TFL_TURRCAPS_MEDPROJ | TFL_TURRCAPS_PLAYERKILL | TFL_TURRCAPS_MISSILEKILL;
- if (turret_stdproc_init("plasma_std", TRUE, "models/turrets/base.md3", "models/turrets/plasma.md3", TID_PLASMA) == 0)
+ if (turret_stdproc_init("plasma_std", "models/turrets/base.md3", "models/turrets/plasma.md3", TID_PLASMA) == 0)
{
remove(self);
return;
self.damage_flags |= TFL_DMG_HEADSHAKE;
self.firecheck_flags |= TFL_FIRECHECK_AFF;
- if (!turret_tag_fire_update())
- dprint("Warning: Turret ",self.classname, " faild to initialize md3 tags\n");
-
// Our fireing routine
self.turret_firefunc = turret_plasma_attack;
self.aim_flags = TFL_AIM_LEAD | TFL_AIM_SHOTTIMECOMPENSATE | TFL_AIM_GROUND2 ;
self.turrcaps_flags = TFL_TURRCAPS_RADIUSDMG | TFL_TURRCAPS_MEDPROJ | TFL_TURRCAPS_PLAYERKILL;
- if (turret_stdproc_init("plasma_dual", TRUE, "models/turrets/base.md3", "models/turrets/plasmad.md3", TID_PLASMA_DUAL) == 0)
+ if (turret_stdproc_init("plasma_dual", "models/turrets/base.md3", "models/turrets/plasmad.md3", TID_PLASMA_DUAL) == 0)
{
remove(self);
return;
self.damage_flags |= TFL_DMG_HEADSHAKE;
self.firecheck_flags |= TFL_FIRECHECK_AFF;
- if (!turret_tag_fire_update())
- dprint("Warning: Turret ",self.classname, " faild to initialize md3 tags\n");
-
// Our fireing routine
self.turret_firefunc = turret_plasma_dual_attack;
self.aim_flags = TFL_AIM_NO;
self.track_flags = TFL_TRACK_NO;
- if (turret_stdproc_init("tesla_std", TRUE, "models/turrets/tesla_base.md3", "models/turrets/tesla_head.md3", TID_TESLA) == 0)
+ if (turret_stdproc_init("tesla_std", "models/turrets/tesla_base.md3", "models/turrets/tesla_head.md3", TID_TESLA) == 0)
{
remove(self);
return;
self.target_validate_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_MISSILES |
TFL_TARGETSELECT_RANGELIMTS | TFL_TARGETSELECT_TEAMCHECK;
- if (!turret_tag_fire_update())
- dprint("Warning: Turret ",self.classname, " faild to initialize md3 tags\n");
-
self.turret_firefunc = turret_tesla_fire;
self.turret_postthink = turret_tesla_postthink;
self.turret_firecheckfunc = turret_tesla_firecheck;
void walker_diehook()
{
- turret_trowgib2(self.origin, self.velocity + v_up * 200, '-0.6 -0.2 -02', self,time + random() * 1);
- turret_trowgib2(self.origin + '0 0 64', self.velocity + v_forward * 150 + v_up * 150, '-0.2 -0.2 -02', self.tur_head, 3 + time + random() * 2);
+ //turret_trowgib2(self.origin, self.velocity + v_up * 200, '-0.6 -0.2 -02', self,time + random() * 1);
+ //turret_trowgib2(self.origin + '0 0 64', self.velocity + v_forward * 150 + v_up * 150, '-0.2 -0.2 -02', self.tur_head, 3 + time + random() * 2);
if (self.pathcurrent)
pathlib_deletepath(self.pathcurrent.owner);
self.turret_diehook = walker_diehook;
self.ticrate = 0.05;
- if (turret_stdproc_init("walker_std", TRUE, "models/turrets/walker_body.md3", "models/turrets/walker_head_minigun.md3", TID_WALKER) == 0)
+ if (turret_stdproc_init("walker_std", "models/turrets/walker_body.md3", "models/turrets/walker_head_minigun.md3", TID_WALKER) == 0)
{
remove(self);
return;
}
- if (!turret_tag_fire_update())
- dprint("Warning: Turret ",self.classname, " faild to initialize md3 tags\n");
-
self.damage_flags |= TFL_DMG_DEATH_NOGIBS;
self.target_select_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_RANGELIMTS | TFL_TARGETSELECT_TEAMCHECK | TFL_TARGETSELECT_LOS;
self.target_validate_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_RANGELIMTS | TFL_TARGETSELECT_TEAMCHECK | TFL_TARGETSELECT_LOS;