+#include "../../common/triggers/subs.qh"
+
float autocvar_g_vehicles_crush_dmg;
float autocvar_g_vehicles_crush_force;
float autocvar_g_vehicles_delayspawn;
float autocvar_g_vehicles_delayspawn_jitter;
-var float autocvar_g_vehicles_nex_damagerate = 0.5;
-var float autocvar_g_vehicles_uzi_damagerate = 0.5;
-var float autocvar_g_vehicles_rifle_damagerate = 0.75;
-var float autocvar_g_vehicles_minstanex_damagerate = 0.001;
-var float autocvar_g_vehicles_tag_damagerate = 5;
+float autocvar_g_vehicles_vortex_damagerate = 0.5;
+float autocvar_g_vehicles_machinegun_damagerate = 0.5;
+float autocvar_g_vehicles_rifle_damagerate = 0.75;
+float autocvar_g_vehicles_vaporizer_damagerate = 0.001;
+float autocvar_g_vehicles_tag_damagerate = 5;
float autocvar_g_vehicles;
WriteByte(MSG_ENTITY, self.cnt);
- WriteCoord(MSG_ENTITY, self.origin_x);
- WriteCoord(MSG_ENTITY, self.origin_y);
- WriteCoord(MSG_ENTITY, self.origin_z);
+ WriteCoord(MSG_ENTITY, self.origin.x);
+ WriteCoord(MSG_ENTITY, self.origin.y);
+ WriteCoord(MSG_ENTITY, self.origin.z);
- WriteByte(MSG_ENTITY, rint(self.colormod_x * 255));
- WriteByte(MSG_ENTITY, rint(self.colormod_y * 255));
- WriteByte(MSG_ENTITY, rint(self.colormod_z * 255));
+ WriteByte(MSG_ENTITY, rint(self.colormod.x * 255));
+ WriteByte(MSG_ENTITY, rint(self.colormod.y * 255));
+ WriteByte(MSG_ENTITY, rint(self.colormod.z * 255));
- return TRUE;
+ return true;
}
void UpdateAuxiliaryXhair(entity own, vector loc, vector clr, float axh_id)
axh.cnt = axh_id;
axh.drawonlytoclient = own;
axh.owner = own;
- Net_LinkEntity(axh, FALSE, 0, SendAuxiliaryXhair);
+ Net_LinkEntity(axh, false, 0, SendAuxiliaryXhair);
}
setorigin(axh, loc);
PROJECTILE_TOUCH;
self.event_damage = func_null;
- RadiusDamage (self, self.realowner, self.shot_dmg, 0, self.shot_radius, self, self.shot_force, self.totalfrags, other);
+ RadiusDamage (self, self.realowner, self.shot_dmg, 0, self.shot_radius, self, world, self.shot_force, self.totalfrags, other);
remove (self);
}
proj.solid = SOLID_BBOX;
proj.movetype = MOVETYPE_FLYMISSILE;
proj.flags = FL_PROJECTILE;
- proj.bot_dodge = TRUE;
+ proj.bot_dodge = true;
proj.bot_dodgerating = _dmg;
proj.velocity = _vel;
proj.touch = vehicles_projectile_explode;
self.touch = vehicles_touch;
self.event_damage = vehicles_damage;
self.reset = vehicles_reset;
- self.iscreature = TRUE;
- self.teleportable = FALSE; // no teleporting for vehicles, too buggy
- self.damagedbycontents = TRUE;
+ self.iscreature = true;
+ self.teleportable = false; // no teleporting for vehicles, too buggy
+ self.damagedbycontents = true;
self.movetype = MOVETYPE_WALK;
self.solid = SOLID_SLIDEBOX;
self.takedamage = DAMAGE_AIM;
self.deadflag = DEAD_NO;
- self.bot_attack = TRUE;
+ self.bot_attack = true;
self.flags = FL_NOTARGET;
self.avelocity = '0 0 0';
self.velocity = '0 0 0';
float vehicles_crushable(entity e)
{
if(IS_PLAYER(e))
- return TRUE;
+ return true;
if(e.flags & FL_MONSTER)
- return TRUE;
+ return true;
- return FALSE;
+ return false;
}
void vehicles_impact(float _minspeed, float _speedfac, float _maxpain)
vehicles_enter();
}
-var float autocvar_g_vehicles_allow_bots = 0;
+float autocvar_g_vehicles_allow_bots = 0;
void vehicles_enter()
{
// Remove this when bots know how to use vehicles
if(self.phase > time)
return;
+ if(other.frozen)
+ return;
+ if(other.vehicle)
+ return;
+ if(other.deadflag != DEAD_NO)
+ return;
if(teamplay)
if(self.team)
self.team = self.owner.team;
self.flags -= FL_NOTARGET;
- self.monster_attack = TRUE;
+ self.monster_attack = true;
if (IS_REAL_CLIENT(other))
{
WriteByte (MSG_ONE, SVC_SETVIEWANGLES);
if(self.tur_head)
{
- WriteAngle(MSG_ONE, self.tur_head.angles_x + self.angles_x); // tilt
- WriteAngle(MSG_ONE, self.tur_head.angles_y + self.angles_y); // yaw
+ WriteAngle(MSG_ONE, self.tur_head.angles.x + self.angles.x); // tilt
+ WriteAngle(MSG_ONE, self.tur_head.angles.y + self.angles.y); // yaw
WriteAngle(MSG_ONE, 0); // roll
}
else
{
- WriteAngle(MSG_ONE, self.angles_x * -1); // tilt
- WriteAngle(MSG_ONE, self.angles_y); // yaw
+ WriteAngle(MSG_ONE, self.angles.x * -1); // tilt
+ WriteAngle(MSG_ONE, self.angles.y); // yaw
WriteAngle(MSG_ONE, 0); // roll
}
}
for(i = 0; i < 100; ++i)
{
v = randomvec();
- v_z = 0;
+ v.z = 0;
v = v2 + normalize(v) * mysize;
tracebox(v2, PL_MIN, PL_MAX, v, MOVE_NORMAL, self.owner);
if(trace_fraction == 1.0 && !trace_startsolid && !trace_allsolid)
return;
}
- vehicles_exit_running = TRUE;
+ vehicles_exit_running = true;
if(IS_CLIENT(self))
{
_vehicle = self.vehicle;
{
_vehicle.vehicle_exit(eject);
self = _oldself;
- vehicles_exit_running = FALSE;
+ vehicles_exit_running = false;
return;
}
}
WriteByte (MSG_ONE, SVC_SETVIEWANGLES);
WriteAngle(MSG_ONE, 0);
- WriteAngle(MSG_ONE, _vehicle.angles_y);
+ WriteAngle(MSG_ONE, _vehicle.angles.y);
WriteAngle(MSG_ONE, 0);
}
sound (_vehicle, CH_TRIGGER_SINGLE, "misc/null.wav", 1, ATTEN_NORM);
_vehicle.vehicle_hudmodel.viewmodelforclient = _vehicle;
_vehicle.phase = time + 1;
- _vehicle.monster_attack = FALSE;
+ _vehicle.monster_attack = false;
_vehicle.vehicle_exit(eject);
_vehicle.owner = world;
self = _oldself;
- vehicles_exit_running = FALSE;
+ vehicles_exit_running = false;
}
{
self.dmg_time = time;
- if(DEATH_ISWEAPON(deathtype, WEP_NEX))
- damage *= autocvar_g_vehicles_nex_damagerate;
+ // WEAPONTODO
+ if(DEATH_ISWEAPON(deathtype, WEP_VORTEX))
+ damage *= autocvar_g_vehicles_vortex_damagerate;
- if(DEATH_ISWEAPON(deathtype, WEP_UZI))
- damage *= autocvar_g_vehicles_uzi_damagerate;
+ if(DEATH_ISWEAPON(deathtype, WEP_MACHINEGUN))
+ damage *= autocvar_g_vehicles_machinegun_damagerate;
if(DEATH_ISWEAPON(deathtype, WEP_RIFLE))
damage *= autocvar_g_vehicles_rifle_damagerate;
- if(DEATH_ISWEAPON(deathtype, WEP_MINSTANEX))
- damage *= autocvar_g_vehicles_minstanex_damagerate;
+ if(DEATH_ISWEAPON(deathtype, WEP_VAPORIZER))
+ damage *= autocvar_g_vehicles_vaporizer_damagerate;
if(DEATH_ISWEAPON(deathtype, WEP_SEEKER))
damage *= autocvar_g_vehicles_tag_damagerate;
rgb = Team_ColorRGB(self.team);
else
rgb = '1 1 1';
- WaypointSprite_Spawn("vehicle", 0, 0, self, '0 0 64', world, 0, self, waypointsprite_attached, TRUE, RADARICON_POWERUP, rgb);
+ WaypointSprite_Spawn("vehicle", 0, 0, self, '0 0 64', world, 0, self, waypointsprite_attached, true, RADARICON_POWERUP, rgb);
if(self.waypointsprite_attached)
{
WaypointSprite_UpdateRule(self.waypointsprite_attached, self.wp00.team, SPRITERULE_DEFAULT);
setattachment(_slot.vehicle_hudmodel, _slot, "");
setattachment(_slot.vehicle_viewport, _slot.vehicle_hudmodel, "");
- return TRUE;
+ return true;
}
float vehicle_initialize(string net_name,
float _max_shield)
{
if(!autocvar_g_vehicles)
- return FALSE;
+ return false;
if(self.targetname)
{
self.tur_head = spawn();
self.tur_head.owner = self;
self.takedamage = DAMAGE_AIM;
- self.bot_attack = TRUE;
- self.iscreature = TRUE;
- self.teleportable = FALSE; // no teleporting for vehicles, too buggy
- self.damagedbycontents = TRUE;
+ self.bot_attack = true;
+ self.iscreature = true;
+ self.teleportable = false; // no teleporting for vehicles, too buggy
+ self.damagedbycontents = true;
self.hud = vhud;
self.tur_health = _max_health;
self.tur_head.tur_health = _max_shield;
self.tur_head.team = self.team;
if(MUTATOR_CALLHOOK(VehicleSpawn))
- return FALSE;
+ return false;
- return TRUE;
+ return true;
}
vector vehicle_aimturret(entity _vehic, vector _target, entity _turrret, string _tagname,
vtag = gettaginfo(_turrret, gettagindex(_turrret, _tagname));
vtmp = vectoangles(normalize(_target - vtag));
vtmp = AnglesTransform_ToAngles(AnglesTransform_LeftDivide(AnglesTransform_FromAngles(_vehic.angles), AnglesTransform_FromAngles(vtmp))) - _turrret.angles;
- vtmp = AnglesTransform_Normalize(vtmp, TRUE);
+ vtmp = AnglesTransform_Normalize(vtmp, true);
ftmp = _aimspeed * frametime;
- vtmp_y = bound(-ftmp, vtmp_y, ftmp);
- vtmp_x = bound(-ftmp, vtmp_x, ftmp);
- _turrret.angles_y = bound(_rotlimit_min, _turrret.angles_y + vtmp_y, _rotlimit_max);
- _turrret.angles_x = bound(_pichlimit_min, _turrret.angles_x + vtmp_x, _pichlimit_max);
+ vtmp.y = bound(-ftmp, vtmp.y, ftmp);
+ vtmp.x = bound(-ftmp, vtmp.x, ftmp);
+ _turrret.angles_y = bound(_rotlimit_min, _turrret.angles.y + vtmp.y, _rotlimit_max);
+ _turrret.angles_x = bound(_pichlimit_min, _turrret.angles.x + vtmp.x, _pichlimit_max);
return vtag;
}