#include "spiderbot.qh"
+#if defined(SVQC)
+ #include <common/gamemodes/gamemode/ctf/sv_ctf.qh>
+#endif
+
+#ifdef GAMEQC
+
const int SBRM_FIRST = 1;
const int SBRM_VOLLY = 1;
const int SBRM_GUIDE = 2;
vehic.angles_x = bound(-autocvar_g_vehicle_spiderbot_tiltlimit, vehic.angles_x, autocvar_g_vehicle_spiderbot_tiltlimit);
vehic.angles_z = bound(-autocvar_g_vehicle_spiderbot_tiltlimit, vehic.angles_z, autocvar_g_vehicle_spiderbot_tiltlimit);
- if(!forbidWeaponUse(this))
+ if(!weaponLocked(this) && !weaponUseForbidden(this))
if(PHYS_INPUT_BUTTON_ATCK(this))
{
vehic.cnt = time;
.entity weaponentity = weaponentities[0]; // TODO: unhardcode
fireBullet(this, weaponentity, v, v_forward, autocvar_g_vehicle_spiderbot_minigun_spread, autocvar_g_vehicle_spiderbot_minigun_solidpenetration,
- autocvar_g_vehicle_spiderbot_minigun_damage, autocvar_g_vehicle_spiderbot_minigun_force, DEATH_VH_SPID_MINIGUN.m_id, EFFECT_BULLET);
+ autocvar_g_vehicle_spiderbot_minigun_damage, 0, autocvar_g_vehicle_spiderbot_minigun_force, DEATH_VH_SPID_MINIGUN.m_id, EFFECT_BULLET);
sound (gun, CH_WEAPON_A, SND_UZI_FIRE, VOL_BASE, ATTEN_NORM);
//trailparticles(this, _particleeffectnum("spiderbot_minigun_trail"), v, trace_endpos);
return;
}
- entity h = spawn(), g1 = spawn(), g2 = spawn(), b = spawn();
+ entity h = new(spiderbot_top), g1 = new(spiderbot_gun), g2 = new(spiderbot_gun), b = new(spiderbot_body);
setmodel(b, MDL_VEH_SPIDERBOT_BODY);
setmodel(h, MDL_VEH_SPIDERBOT_TOP);
b.angles = this.angles;
setsize(b, this.mins, this.maxs);
+ h.solid = SOLID_BBOX; // before setorigin for immediate area grid linking
vector org = gettaginfo(this, gettagindex(this, "tag_head"));
setorigin(h, org);
set_movetype(h, MOVETYPE_BOUNCE);
- h.solid = SOLID_BBOX;
h.velocity = v_up * (500 + random() * 500) + randomvec() * 128;
h.modelflags = MF_ROCKET;
h.effects = EF_FLAME | EF_LOWPRECISION;
setthink(h, spiderbot_headfade);
h.nextthink = time;
+ g1.solid = SOLID_CORPSE; // before setorigin for immediate area grid linking
org = gettaginfo(this.tur_head, gettagindex(this.tur_head, "tag_hardpoint01"));
setorigin(g1, org);
set_movetype(g1, MOVETYPE_TOSS);
- g1.solid = SOLID_CORPSE;
g1.velocity = v_forward * 700 + (randomvec() * 32);
g1.avelocity = randomvec() * 180;
+ g2.solid = SOLID_CORPSE; // before setorigin for immediate area grid linking
org = gettaginfo(this.tur_head, gettagindex(this.tur_head, "tag_hardpoint02"));
setorigin(g2, org);
set_movetype(g2, MOVETYPE_TOSS);
- g2.solid = SOLID_CORPSE;
g2.velocity = v_forward * 700 + (randomvec() * 32);
g2.avelocity = randomvec() * 180;
}
METHOD(Spiderbot, vr_death, void(Spiderbot thisveh, entity instance))
{
- SetResource(instance, RES_HEALTH, 0);
+ SetResourceExplicit(instance, RES_HEALTH, 0);
instance.event_damage = func_null;
instance.takedamage = DAMAGE_NO;
settouch(instance, func_null);
if(!instance.gun1)
{
instance.vehicles_impulse = spiderbot_impulse;
- instance.gun1 = spawn();
- instance.gun2 = spawn();
+ instance.gun1 = new(spiderbot_gun);
+ instance.gun2 = new(spiderbot_gun);
setmodel(instance.gun1, MDL_VEH_SPIDERBOT_GUN);
setmodel(instance.gun2, MDL_VEH_SPIDERBOT_GUN);
setattachment(instance.gun1, instance.tur_head, "tag_hardpoint01");
setorigin(instance, instance.pos1 + '0 0 128');
instance.angles = instance.pos2;
instance.damageforcescale = 0.03;
- SetResource(instance, RES_HEALTH, autocvar_g_vehicle_spiderbot_health);
+ SetResourceExplicit(instance, RES_HEALTH, autocvar_g_vehicle_spiderbot_health);
instance.vehicle_shield = autocvar_g_vehicle_spiderbot_shield;
instance.PlayerPhysplug = spiderbot_frame;
instance.vehicle_flags |= VHF_HEALTHREGEN;
instance.respawntime = autocvar_g_vehicle_spiderbot_respawntime;
- SetResource(instance, RES_HEALTH, autocvar_g_vehicle_spiderbot_health);
+ SetResourceExplicit(instance, RES_HEALTH, autocvar_g_vehicle_spiderbot_health);
instance.vehicle_shield = autocvar_g_vehicle_spiderbot_shield;
instance.max_health = GetResource(instance, RES_HEALTH);
instance.pushable = true; // spiderbot can use jumppads
}
#endif
+
+#endif