vector df;
float ftmp;
- player = self;
- racer = self.vehicle;
-
+ player = self;
+ racer = self.vehicle;
+ self = racer;
+
player.BUTTON_ZOOM = player.BUTTON_CROUCH = 0;
-
- self = racer;
-
+
+ vehicles_painframe();
+
if(racer.deadflag != DEAD_NO)
{
self = player;
{
traceline(self.origin, self.origin - '0 0 256', MOVE_NORMAL, self);
if(trace_fraction != 1.0)
- pointparticles(particleeffectnum("smoke_small"), trace_endpos, '0 0 0', 1);
+ pointparticles(particleeffectnum("smoke_small"), trace_endpos, '0 0 0', 1);
self.invincible_finished = time + 0.1 + (random() * 0.1);
}
-
if(self.strength_finished < time)
{
void spawnfunc_vehicle_racer()
{
+ self.vehicle_flags |= VHF_DMGSHAKE;
+ self.vehicle_flags |= VHF_DMGROLL;
precache_sound ("weapons/laserimpact.wav");
precache_sound ("weapons/lasergun_fire.wav");
player = self;
raptor = self.vehicle;
self = raptor;
-
+
+ vehicles_painframe();
/*
ftmp = vlen(self.velocity);
if(ftmp > autocvar_g_vehicle_raptor_speed_forward)
void spawnfunc_vehicle_raptor()
{
vehicles_configcheck("vehicle_raptor.cfg", autocvar_g_vehicle_raptor_health);
-
+
+ self.vehicle_flags |= VHF_DMGSHAKE;
+ self.vehicle_flags |= VHF_DMGROLL;
+
if(autocvar_g_vehicle_raptor_shield)
self.vehicle_flags |= VHF_HASSHIELD;
spider = self.vehicle;
self = spider;
+ vehicles_painframe();
+
player.BUTTON_ZOOM = 0;
player.BUTTON_CROUCH = 0;
player.switchweapon = 0;
void spawnfunc_vehicle_spiderbot()
{
+ self.vehicle_flags |= VHF_DMGSHAKE;
+ //self.vehicle_flags |= VHF_DMGROLL;
+ //self.vehicle_flags |= VHF_DMGHEADROLL;
+
precache_model ( "models/vhshield.md3");
precache_model ( "models/vehicles/spiderbot.dpm");
precache_model ( "models/vehicles/spiderbot_top.dpm");
}
}
+void vehicles_painframe()
+{
+//.float pain_finished; //Added by Supajoe
+
+ if(self.owner.vehicle_health <= 50)
+ if(self.pain_frame < time)
+ {
+ float _ftmp;
+ _ftmp = self.owner.vehicle_health / 50;
+ self.pain_frame = time + 0.1 + (random() * 0.5 * _ftmp);
+ pointparticles(particleeffectnum("smoke_small"), (self.origin + (randomvec() * 80)), '0 0 0', 1);
+
+ if(self.vehicle_flags & VHF_DMGSHAKE)
+ self.velocity += randomvec() * 30;
+
+ if(self.vehicle_flags & VHF_DMGROLL)
+ if(self.vehicle_flags & VHF_DMGHEADROLL)
+ self.tur_head.angles += randomvec();
+ else
+ self.angles += randomvec();
+
+ }
+}
+
void vehicles_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
{
self.dmg_time = time;
self.team = 0;
self.vehicle_flags |= VHF_ISVEHICLE;
-
+
setmodel(self, bodymodel);
self.vehicle_viewport = spawn();
float VHF_MOVE_GROUND = 128; /// Vehicle moves on gound
float VHF_MOVE_HOVER = 256; /// Vehicle hover close to gound
float VHF_MOVE_FLY = 512; /// Vehicle is airborn
+float VHF_DMGSHAKE = 1024;
+float VHF_DMGROLL = 2048;
+float VHF_DMGHEADROLL = 4096;
.entity gun1;
.entity gun2;