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))
69 if not (self.tur_head.enemy)
71 self.tur_head.enemy = spawn();
72 self.tur_head.enemy.effects = EF_LOWPRECISION;
75 setmodel(self.tur_head.enemy,"models/vhshield.md3");
76 setattachment(self.tur_head.enemy,self,"");
78 self.tur_head.enemy.colormod = '1 1 1';
79 self.tur_head.enemy.alpha = 0.45;
80 self.tur_head.enemy.scale = (256 / vlen(self.maxs - self.mins));
81 self.tur_head.enemy.angles = vectoangles(normalize(hitloc - self.origin)) - self.angles;
82 self.tur_head.enemy.think = shieldhit_think;
83 self.tur_head.enemy.nextthink = time;
85 self.vehicle_shield -= damage;
86 if(self.vehicle_shield < 0)
88 self.tur_head.enemy.colormod = '10 0 -1';
89 ddmg_take = fabs(self.vehicle_shield);
90 self.vehicle_shield = 0;
91 self.tur_head.enemy.alpha = 0.75;
92 self.vehicle_health -= ddmg_take;
96 self.vehicle_health -= damage;
100 self.owner.vehicle_health = self.vehicle_health / CCVAR("_health");
102 if(self.vehicle_flags & VHF_HASSHIELD)
103 self.owner.vehicle_shield = self.vehicle_shield / cvar(strcat(self.cvar_basename,"_shield"));
107 if(self.vehicle_health <= 0)
110 if(self.vehicle_flags & VHF_DEATHEJECT)
111 self.vehicle_exit(VHEF_EJECT);
121 self.vehicle_exit = self.vehicle_exit;
122 self.vehicle_enter = self.vehicle_exit;
123 self.vehicle_die = self.vehicle_exit;
124 self.vehicle_spawn = self.vehicle_exit;
125 //self.vehicle_message = self.vehicle_exit;