#include "sv_turrets.qh"
+
#ifdef SVQC
-#include <server/autocvars.qh>
+#include <common/mapobjects/defs.qh>
+#include <server/bot/api.qh>
+#include <server/damage.qh>
+#include <server/weapons/common.qh>
+#include <server/weapons/weaponsystem.qh>
+#include <server/world.qh>
// Generic aiming
vector turret_aim_generic(entity this)
bool turret_send(entity this, entity to, float sf)
{
-
WriteHeader(MSG_ENTITY, ENT_CLIENT_TURRET);
WriteByte(MSG_ENTITY, sf);
if(sf & TNSF_SETUP)
WriteVector(MSG_ENTITY, this.origin);
- WriteAngle(MSG_ENTITY, this.angles_x);
- WriteAngle(MSG_ENTITY, this.angles_y);
+ WriteAngleVector2D(MSG_ENTITY, this.angles);
}
if(sf & TNSF_ANG)
ent.ammo_max *= ent.turret_scale_ammo;
ent.ammo_recharge *= ent.turret_scale_ammo;
ent.aim_speed *= ent.turret_scale_aim;
- ent.health *= ent.turret_scale_health;
+ SetResourceExplicit(ent, RES_HEALTH, GetResource(ent, RES_HEALTH) * ent.turret_scale_health);
ent.respawntime *= ent.turret_scale_respawn;
ent.shot_dmg *= ent.turret_scale_damage;
ent.shot_refire *= ent.turret_scale_refire;
this.event_damage = func_null;
#ifdef TURRET_DEBUG
float d;
- d = RadiusDamage (this, this.owner, this.owner.shot_dmg, 0, this.owner.shot_radius, this, NULL, this.owner.shot_force, this.totalfrags, DMG_NOWEP, NULL);
+ d = RadiusDamage (this, this.owner, this.owner.shot_dmg, 0, this.owner.shot_radius, this, NULL, this.owner.shot_force, this.projectiledeathtype, DMG_NOWEP, NULL);
this.owner.tur_debug_dmg_t_h = this.owner.tur_debug_dmg_t_h + d;
this.owner.tur_debug_dmg_t_f = this.owner.tur_debug_dmg_t_f + this.owner.shot_dmg;
#else
- RadiusDamage (this, this.realowner, this.owner.shot_dmg, 0, this.owner.shot_radius, this, NULL, this.owner.shot_force, this.totalfrags, DMG_NOWEP, NULL);
+ RadiusDamage (this, this.realowner, this.owner.shot_dmg, 0, this.owner.shot_radius, this, NULL, this.owner.shot_force, this.projectiledeathtype, DMG_NOWEP, NULL);
#endif
delete(this);
}
IL_PUSH(g_projectiles, proj);
IL_PUSH(g_bot_dodge, proj);
proj.enemy = actor.enemy;
- proj.totalfrags = _death;
+ proj.projectiledeathtype = _death;
PROJECTILE_MAKETRIGGER(proj);
if(_health)
{
tvt_thadv = angleofs3(e_turret.tur_head.origin, e_turret.angles + e_turret.tur_head.angles, e_target.origin);
tvt_tadv = shortangle_vxy(angleofs(e_turret, e_target), e_turret.angles);
tvt_thadf = vlen(tvt_thadv);
- tvt_tadf = vlen(tvt_tadv);
/*
if(validate_flags & TFL_TARGETSELECT_FOV)
entity e = find(NULL, classname, "turret_manager");
if(!e)
{
- e = new(turret_manager);
+ e = new_pure(turret_manager);
setthink(e, turrets_manager_think);
e.nextthink = time + 2;
}