1 void vehicle_stdproc_enter()
5 void vehicle_stdproc_exit(float eject)
9 void vehicle_stdproc_shiledregen(float rmax, float dt)
11 if(self.vehicle_shield < rmax)
12 if(self.dmg_time + CCVAR("_shield_regen_dmgpause") < time)
14 self.vehicle_shield = min(self.vehicle_shield + CCVAR("_shield_regen") * dt, rmax);
17 self.owner.vehicle_shield = self.vehicle_shield / rmax;
21 void vehicle_stdproc_healthregen(float rmax, float dt)
24 if(self.dmg_time + CCVAR("_health_regen_dmgpause") < time)
25 if(self.vehicle_health < rmax)
27 self.vehicle_health = min(self.vehicle_health + CCVAR("_health_regen") * dt, rmax);
30 self.owner.vehicle_health = self.vehicle_health / rmax;
34 void vehicle_stdproc_energyregen(float rmax, float dt)
36 if(self.vehicle_energy < rmax)
38 self.vehicle_energy = min(self.vehicle_energy + CCVAR("_energy_regen") * dt, rmax);
41 self.owner.vehicle_energy = self.vehicle_energy / rmax;
45 void shieldhit_think()
47 self.alpha = self.alpha - 0.2;
55 self.nextthink = time + 0.1;
59 void vehicle_stdproc_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
66 if((self.vehicle_flags & VHF_HASSHIELD) && (self.vehicle_shield > 0))
70 if (wasfreed(self.tur_head.enemy) || self.tur_head.enemy == world)
72 self.tur_head.enemy = spawn();
73 self.tur_head.enemy.effects = EF_LOWPRECISION;
76 setmodel(self.tur_head.enemy, "models/vhshield.md3");
77 setattachment(self.tur_head.enemy, self, "");
79 self.tur_head.enemy.colormod = '1 1 1';
80 self.tur_head.enemy.alpha = 0.45;
81 self.tur_head.enemy.scale = (256 / vlen(self.maxs - self.mins));
82 self.tur_head.enemy.angles = vectoangles(normalize(hitloc - self.origin)) - self.angles;
83 self.tur_head.enemy.think = shieldhit_think;
84 self.tur_head.enemy.nextthink = time;
86 self.vehicle_shield -= damage;
87 if(self.vehicle_shield < 0)
89 self.tur_head.enemy.colormod = '10 0 -1';
90 ddmg_take = fabs(self.vehicle_shield);
91 self.vehicle_shield = 0;
92 self.tur_head.enemy.alpha = 0.75;
93 self.vehicle_health -= ddmg_take;
97 self.vehicle_health -= damage;
101 self.owner.vehicle_health = self.vehicle_health / CCVAR("_health");
103 if(self.vehicle_flags & VHF_HASSHIELD)
104 self.owner.vehicle_shield = self.vehicle_shield / cvar(strcat(self.cvar_basename,"_shield"));
108 if(self.vehicle_health <= 0)
111 if(self.vehicle_flags & VHF_DEATHEJECT)
112 self.vehicle_exit(VHEF_EJECT);
122 self.vehicle_exit = self.vehicle_exit;
123 self.vehicle_enter = self.vehicle_exit;
124 self.vehicle_die = self.vehicle_exit;
125 self.vehicle_spawn = self.vehicle_exit;
126 //self.vehicle_message = self.vehicle_exit;