--- /dev/null
+#ifdef SVQC
+// Auto cvars
+float autocvar_g_vehicle_bumblebee_speed_forward;
+float autocvar_g_vehicle_bumblebee_speed_strafe;
+float autocvar_g_vehicle_bumblebee_speed_up;
+float autocvar_g_vehicle_bumblebee_speed_down;
+float autocvar_g_vehicle_bumblebee_turnspeed;
+float autocvar_g_vehicle_bumblebee_pitchspeed;
+float autocvar_g_vehicle_bumblebee_pitchlimit;
+float autocvar_g_vehicle_bumblebee_friction;
+
+float autocvar_g_vehicle_bumblebee_energy;
+float autocvar_g_vehicle_bumblebee_energy_regen;
+float autocvar_g_vehicle_bumblebee_energy_regen_pause;
+
+float autocvar_g_vehicle_bumblebee_health;
+float autocvar_g_vehicle_bumblebee_health_regen;
+float autocvar_g_vehicle_bumblebee_health_regen_pause;
+
+float autocvar_g_vehicle_bumblebee_shield;
+float autocvar_g_vehicle_bumblebee_shield_regen;
+float autocvar_g_vehicle_bumblebee_shield_regen_pause;
+
+float autocvar_g_vehicle_bumblebee_cannon_cost;
+float autocvar_g_vehicle_bumblebee_cannon_damage;
+float autocvar_g_vehicle_bumblebee_cannon_radius;
+float autocvar_g_vehicle_bumblebee_cannon_refire;
+float autocvar_g_vehicle_bumblebee_cannon_speed;
+float autocvar_g_vehicle_bumblebee_cannon_spread;
+float autocvar_g_vehicle_bumblebee_cannon_force;
+
+float autocvar_g_vehicle_bumblebee_cannon_turnspeed;
+float autocvar_g_vehicle_bumblebee_cannon_pitchlimit_down;
+float autocvar_g_vehicle_bumblebee_cannon_pitchlimit_up;
+float autocvar_g_vehicle_bumblebee_cannon_turnlimit_in;
+float autocvar_g_vehicle_bumblebee_cannon_turnlimit_out;
+
+float autocvar_g_vehicle_bumblebee_raygun_turnspeed;
+float autocvar_g_vehicle_bumblebee_raygun_pitchlimit_down;
+float autocvar_g_vehicle_bumblebee_raygun_pitchlimit_up;
+float autocvar_g_vehicle_bumblebee_raygun_turnlimit_sides;
+
+float autocvar_g_vehicle_bumblebee_respawntime;
+
+float autocvar_g_vehicle_bumblebee_blowup_radius;
+float autocvar_g_vehicle_bumblebee_blowup_coredamage;
+float autocvar_g_vehicle_bumblebee_blowup_edgedamage;
+float autocvar_g_vehicle_bumblebee_blowup_forceintensity;
+
+float autocvar_g_vehicle_bumblebee;
+
+#define BUMB_MIN '-120 -120 -120'
+#define BUMB_MAX '120 120 120'
+
+void bumb_fire_cannon(entity _gun, string _tagname, entity _owner)
+{
+ vector v;
+ entity bolt;
+
+ v = gettaginfo(_gun, gettagindex(_gun, _tagname));
+ bolt = vehicles_projectile("bigplasma_muzzleflash", "weapons/flacexp3.wav",
+ v, normalize(v_forward + randomvec() * autocvar_g_vehicle_bumblebee_cannon_spread) * autocvar_g_vehicle_bumblebee_cannon_speed,
+ autocvar_g_vehicle_bumblebee_cannon_damage, autocvar_g_vehicle_bumblebee_cannon_radius, autocvar_g_vehicle_bumblebee_cannon_force, 0,
+ DEATH_BUMB_GUN, PROJECTILE_BUMBLE_GUN, 0, TRUE, TRUE, _owner);
+
+
+ //bolt.velocity = v_forward * autocvar_g_vehicle_bumblebee_cannon_speed;
+}
+
+float bumb_gunner_frame()
+{
+ entity vehic, gun, gunner;
+
+ vehic = self.vehicle.owner;
+ gun = self.vehicle;
+ gunner = self;
+ self = vehic;
+
+ vehic.solid = SOLID_NOT;
+ setorigin(gunner, vehic.origin);
+ gunner.velocity = vehic.velocity;
+ crosshair_trace(gunner);
+ vector _ct = trace_endpos;
+ vector ad;
+
+ if(gun.lock_time < time)
+ gun.enemy = world;
+
+ if(trace_ent)
+ if(trace_ent.movetype)
+ if(trace_ent.takedamage)
+ if(!trace_ent.deadflag)
+ {
+ if(teamplay)
+ {
+ if(trace_ent.team != gunner.team)
+ {
+ gun.enemy = trace_ent;
+ gun.lock_time = time + 5;
+ }
+ }
+ else
+ {
+ gun.enemy = trace_ent;
+ gun.lock_time = time + 5;
+ }
+ }
+
+ if(gun.enemy)
+ {
+ float i, distance, impact_time;
+
+ vector vf = real_origin(gun.enemy);
+ vector _vel = gun.enemy.velocity;
+ if(gun.enemy.movetype == MOVETYPE_WALK)
+ _vel_z *= 0.1;
+
+
+ ad = vf;
+ for(i = 0; i < 4; ++i)
+ {
+ distance = vlen(ad - gunner.origin);
+ impact_time = distance / autocvar_g_vehicle_bumblebee_cannon_speed;
+ ad = vf + _vel * impact_time;
+ }
+ trace_endpos = ad;
+
+
+ UpdateAuxiliaryXhair(gunner, ad, '1 0 1', 1);
+ vehicle_aimturret(vehic, trace_endpos, vehic.gun1, "fire",
+ autocvar_g_vehicle_bumblebee_cannon_pitchlimit_down * -1, autocvar_g_vehicle_bumblebee_cannon_pitchlimit_up,
+ autocvar_g_vehicle_bumblebee_cannon_turnlimit_out * -1, autocvar_g_vehicle_bumblebee_cannon_turnlimit_in, autocvar_g_vehicle_bumblebee_cannon_turnspeed);
+
+ }
+ else
+ vehicle_aimturret(vehic, _ct, vehic.gun1, "fire",
+ autocvar_g_vehicle_bumblebee_cannon_pitchlimit_down * -1, autocvar_g_vehicle_bumblebee_cannon_pitchlimit_up,
+ autocvar_g_vehicle_bumblebee_cannon_turnlimit_out * -1, autocvar_g_vehicle_bumblebee_cannon_turnlimit_in, autocvar_g_vehicle_bumblebee_cannon_turnspeed);
+
+ if(gunner.BUTTON_ATCK)
+ if(time > gun.attack_finished_single)
+ if(vehic.vehicle_energy >= autocvar_g_vehicle_bumblebee_cannon_cost)
+ {
+ vehic.vehicle_energy -= autocvar_g_vehicle_bumblebee_cannon_cost;
+ vehic.wait = time;
+ bumb_fire_cannon(gun, "fire", gunner);
+ gun.attack_finished_single = time + autocvar_g_vehicle_bumblebee_cannon_refire;
+ }
+
+ VEHICLE_UPDATE_PLAYER(gunner, health, bumblebee);
+ VEHICLE_UPDATE_PLAYER(gunner, energy, bumblebee);
+
+ if(vehic.vehicle_flags & VHF_HASSHIELD)
+ VEHICLE_UPDATE_PLAYER(gunner, shield, bumblebee);
+
+ ad = gettaginfo(gun, gettagindex(gun, "fire"));
+ traceline(ad, ad + v_forward * MAX_SHOT_DISTANCE, MOVE_NORMAL, gun);
+ UpdateAuxiliaryXhair(gunner, trace_endpos, ('1 0 0' * gunner.vehicle_reload1) + ('0 1 0' * (1 - gunner.vehicle_reload1)), 0);
+
+
+ vehic.solid = SOLID_BBOX;
+ gunner.BUTTON_ATCK = gunner.BUTTON_ATCK2 = gunner.BUTTON_CROUCH = 0;
+ self = gunner;
+ return 1;
+}
+
+.entity gunner1;
+.entity gunner2;
+
+void bumb_gunner_exit(float _exitflag)
+{
+ dprint("^2Gunner1 exits\n");
+
+ if (clienttype(self) == CLIENTTYPE_REAL)
+ {
+ msg_entity = self;
+ WriteByte (MSG_ONE, SVC_SETVIEWPORT);
+ WriteEntity( MSG_ONE, self);
+
+ WriteByte (MSG_ONE, SVC_SETVIEWANGLES);
+ WriteAngle(MSG_ONE, 0);
+ WriteAngle(MSG_ONE, self.vehicle.angles_y);
+ WriteAngle(MSG_ONE, 0);
+ }
+
+ setsize(self, PL_MIN,PL_MAX);
+
+ self.takedamage = DAMAGE_AIM;
+ self.solid = SOLID_SLIDEBOX;
+ self.movetype = MOVETYPE_WALK;
+ self.effects &~= EF_NODRAW;
+ self.alpha = 1;
+ self.PlayerPhysplug = SUB_Null;
+ self.view_ofs = PL_VIEW_OFS;
+ self.event_damage = PlayerDamage;
+ self.hud = HUD_NORMAL;
+ self.switchweapon = self.vehicle.switchweapon;
+
+ if(self.flagcarried)
+ {
+ self.flagcarried.scale = 0.6;
+ setattachment(self.flagcarried, self, "");
+ setorigin(self.flagcarried, FLAG_CARRY_POS);
+ }
+
+ CSQCVehicleSetup(self, HUD_NORMAL);
+ self.vehicle.vehicle_hudmodel.viewmodelforclient = self.vehicle;
+
+ if(self == self.vehicle.owner.gunner1)
+ self.vehicle.owner.gunner1 = world;
+ else if(self == self.vehicle.owner.gunner2)
+ self.vehicle.owner.gunner2 = world;
+ else
+ dprint("^1self != gunner1 or gunner2, this is a BIG PROBLEM, tell tZork this happend.\n");
+
+ self.vehicle.phase = time + 1;
+ self.vehicle = world;
+}
+
+float bumb_gunner_enter()
+{
+ RemoveGrapplingHook(other);
+
+ self.gun1.vehicle_pilot = other;
+ self.gunner1 = other;
+ //self.gun1.owner = other;
+ self.gunner1.vehicle = self.gun1;
+ self.gun1.switchweapon = other.switchweapon;
+ self.gun1.vehicle_exit = bumb_gunner_exit;
+
+
+ other.angles = self.angles;
+ other.takedamage = DAMAGE_NO;
+ other.solid = SOLID_NOT;
+ other.movetype = MOVETYPE_NOCLIP;
+ other.alpha = -1;
+ other.event_damage = SUB_Null;
+ other.view_ofs = '0 0 0';
+ other.hud = self.gun1.hud;
+ other.PlayerPhysplug = self.gun1.PlayerPhysplug;
+ other.vehicle_ammo1 = self.vehicle_ammo1;
+ other.vehicle_ammo2 = self.vehicle_ammo2;
+ other.vehicle_reload1 = self.vehicle_reload1;
+ other.vehicle_reload2 = self.vehicle_reload2;
+ other.vehicle_energy = self.vehicle_energy;
+ other.PlayerPhysplug = bumb_gunner_frame;
+ other.flags &~= FL_ONGROUND;
+
+ msg_entity = other;
+ WriteByte (MSG_ONE, SVC_SETVIEWPORT);
+ WriteEntity(MSG_ONE, self.gun1.vehicle_viewport);
+ WriteByte (MSG_ONE, SVC_SETVIEWANGLES);
+ WriteAngle(MSG_ONE, self.gun1.angles_x + self.angles_x); // tilt
+ WriteAngle(MSG_ONE, self.gun1.angles_y + self.angles_y); // yaw
+ WriteAngle(MSG_ONE, 0); // roll
+ self.gun1.vehicle_hudmodel.viewmodelforclient = other;
+
+ return TRUE;
+}
+
+float vehicles_valid_pilot()
+{
+ if(other.classname != "player")
+ return FALSE;
+
+ if(other.deadflag != DEAD_NO)
+ return FALSE;
+
+ if(other.vehicle != world)
+ return FALSE;
+
+ // Remove this when bots know how to use vehicles.
+ if (clienttype(other) != CLIENTTYPE_REAL)
+ return FALSE;
+
+ return TRUE;
+}
+
+void bumb_touch()
+{
+
+ if(self.gunner1 != world && self.gunner2 != world)
+ {
+ vehicles_touch();
+ return;
+ }
+
+ if (vehicles_valid_pilot())
+ {
+ if(self.gun1.phase <= time)
+ if (bumb_gunner_enter())
+ return;
+
+ if(self.gun2.phase <= time)
+ if (bumb_gunner_enter())
+ return;
+
+ }
+
+ vehicles_touch();
+}
+
+float bumb_pilot_frame()
+{
+ entity pilot, vehic;
+ vector newvel;
+
+ pilot = self;
+ vehic = self.vehicle;
+ self = vehic;
+
+ if(vehic.deadflag != DEAD_NO)
+ {
+ self = pilot;
+ pilot.BUTTON_ATCK = pilot.BUTTON_ATCK2 = 0;
+ return 1;
+ }
+
+ crosshair_trace(pilot);
+
+ vector vang;
+ float ftmp;
+
+ vang = vehic.angles;
+ newvel = vectoangles(normalize(trace_endpos - self.origin + '0 0 32'));
+ vang_x *= -1;
+ newvel_x *= -1;
+ if(newvel_x > 180) newvel_x -= 360;
+ if(newvel_x < -180) newvel_x += 360;
+ if(newvel_y > 180) newvel_y -= 360;
+ if(newvel_y < -180) newvel_y += 360;
+
+ ftmp = shortangle_f(pilot.v_angle_y - vang_y, vang_y);
+ if(ftmp > 180) ftmp -= 360; if(ftmp < -180) ftmp += 360;
+ vehic.avelocity_y = bound(-autocvar_g_vehicle_bumblebee_turnspeed, ftmp + vehic.avelocity_y * 0.9, autocvar_g_vehicle_bumblebee_turnspeed);
+
+ // Pitch
+ ftmp = 0;
+ if(pilot.movement_x > 0 && vang_x < autocvar_g_vehicle_bumblebee_pitchlimit) ftmp = 5;
+ else if(pilot.movement_x < 0 && vang_x > -autocvar_g_vehicle_bumblebee_pitchlimit) ftmp = -20;
+
+ newvel_x = bound(-autocvar_g_vehicle_bumblebee_pitchlimit, newvel_x , autocvar_g_vehicle_bumblebee_pitchlimit);
+ ftmp = vang_x - bound(-autocvar_g_vehicle_bumblebee_pitchlimit, newvel_x + ftmp, autocvar_g_vehicle_bumblebee_pitchlimit);
+ vehic.avelocity_x = bound(-autocvar_g_vehicle_bumblebee_pitchspeed, ftmp + vehic.avelocity_x * 0.9, autocvar_g_vehicle_bumblebee_pitchspeed);
+
+ vehic.angles_x = anglemods(vehic.angles_x);
+ vehic.angles_y = anglemods(vehic.angles_y);
+ vehic.angles_z = anglemods(vehic.angles_z);
+
+ makevectors('0 1 0' * vehic.angles_y);
+ newvel = vehic.velocity * -autocvar_g_vehicle_bumblebee_friction;
+
+ if(pilot.movement_x != 0)
+ {
+ if(pilot.movement_x > 0)
+ newvel += v_forward * autocvar_g_vehicle_bumblebee_speed_forward;
+ else if(pilot.movement_x < 0)
+ newvel -= v_forward * autocvar_g_vehicle_bumblebee_speed_forward;
+ }
+
+ if(pilot.movement_y != 0)
+ {
+ if(pilot.movement_y < 0)
+ newvel -= v_right * autocvar_g_vehicle_bumblebee_speed_strafe;
+ else if(pilot.movement_y > 0)
+ newvel += v_right * autocvar_g_vehicle_bumblebee_speed_strafe;
+ ftmp = newvel * v_right;
+ ftmp *= frametime * 0.1;
+ vehic.angles_z = bound(-15, vehic.angles_z + ftmp, 15);
+ }
+ else
+ {
+ vehic.angles_z *= 0.95;
+ if(vehic.angles_z >= -1 && vehic.angles_z <= -1)
+ vehic.angles_z = 0;
+ }
+
+ if(pilot.BUTTON_CROUCH)
+ newvel -= v_up * autocvar_g_vehicle_bumblebee_speed_down;
+ else if (pilot.BUTTON_JUMP)
+ newvel += v_up * autocvar_g_vehicle_bumblebee_speed_up;
+
+ vehic.velocity += newvel * frametime;
+ pilot.velocity = pilot.movement = vehic.velocity;
+ setorigin(pilot,vehic.origin + '0 0 32');
+
+ vehicle_aimturret(vehic, trace_endpos, self.gun3, "fire",
+ autocvar_g_vehicle_bumblebee_raygun_pitchlimit_down * -1, autocvar_g_vehicle_bumblebee_raygun_pitchlimit_up,
+ autocvar_g_vehicle_bumblebee_raygun_turnlimit_sides * -1, autocvar_g_vehicle_bumblebee_raygun_turnlimit_sides, autocvar_g_vehicle_bumblebee_raygun_turnspeed);
+
+ /*
+ if(!vehic.gunner1)
+ vehicle_aimturret(vehic, trace_endpos, self.gun1, "fire",
+ autocvar_g_vehicle_bumblebee_cannon_pitchlimit_down * -1, autocvar_g_vehicle_bumblebee_cannon_pitchlimit_up,
+ autocvar_g_vehicle_bumblebee_cannon_turnlimit_out * -1, autocvar_g_vehicle_bumblebee_cannon_turnlimit_in, autocvar_g_vehicle_bumblebee_cannon_turnspeed);
+ //if(!vehic.gunner2)
+ vehicle_aimturret(vehic, trace_endpos, self.gun2, "fire",
+ autocvar_g_vehicle_bumblebee_cannon_pitchlimit_down * -1, autocvar_g_vehicle_bumblebee_cannon_pitchlimit_up,
+ autocvar_g_vehicle_bumblebee_cannon_turnlimit_in * -1, autocvar_g_vehicle_bumblebee_cannon_turnlimit_out, autocvar_g_vehicle_bumblebee_cannon_turnspeed);
+
+
+
+ if(pilot.BUTTON_ATCK)
+ if(time > vehic.attack_finished_single)
+ if(vehic.vehicle_energy >= autocvar_g_vehicle_bumblebee_cannon_cost)
+ {
+ vehic.vehicle_energy -= autocvar_g_vehicle_bumblebee_cannon_cost;
+ vehic.wait = time;
+
+ if(vehic.cnt)
+ {
+ bumb_fire_cannon(vehic.gun1, "fire", pilot);
+ vehic.cnt = 0;
+ }
+ else
+ {
+ bumb_fire_cannon(vehic.gun2, "fire", pilot);
+ vehic.cnt = 1;
+ }
+ vehic.attack_finished_single = time + autocvar_g_vehicle_bumblebee_cannon_refire;
+ }
+ */
+
+ if(vehic.vehicle_flags & VHF_SHIELDREGEN)
+ vehicles_regen(dmg_time, vehicle_shield, autocvar_g_vehicle_bumblebee_shield, autocvar_g_vehicle_bumblebee_shield_regen_pause, autocvar_g_vehicle_bumblebee_shield_regen, frametime, TRUE);
+
+ if(vehic.vehicle_flags & VHF_HEALTHREGEN)
+ vehicles_regen(dmg_time, vehicle_health, autocvar_g_vehicle_bumblebee_health, autocvar_g_vehicle_bumblebee_health_regen_pause, autocvar_g_vehicle_bumblebee_health_regen, frametime, FALSE);
+
+ if(vehic.vehicle_flags & VHF_ENERGYREGEN)
+ vehicles_regen(wait, vehicle_energy, autocvar_g_vehicle_bumblebee_energy, autocvar_g_vehicle_bumblebee_energy_regen_pause, autocvar_g_vehicle_bumblebee_energy_regen, frametime, FALSE);
+
+ VEHICLE_UPDATE_PLAYER(pilot, health, bumblebee);
+ VEHICLE_UPDATE_PLAYER(pilot, energy, bumblebee);
+
+ if(vehic.vehicle_flags & VHF_HASSHIELD)
+ VEHICLE_UPDATE_PLAYER(pilot, shield, bumblebee);
+
+
+ pilot.BUTTON_ATCK = pilot.BUTTON_ATCK2 = pilot.BUTTON_CROUCH = 0;
+ self = pilot;
+
+ return 1;
+}
+
+void bumb_think()
+{
+ self.velocity = self.velocity * 0.99;
+ self.nextthink = time + 0.1;
+}
+
+void bumb_enter()
+{
+ self.touch = bumb_touch;
+}
+
+void bumb_exit(float eject)
+{
+ self.owner = world;
+ self.touch = vehicles_touch;
+}
+
+void bumb_spawn(float _f)
+{
+ self.vehicle_health = autocvar_g_vehicle_bumblebee_health;
+ self.vehicle_shield = autocvar_g_vehicle_bumblebee_shield;
+ self.movetype = MOVETYPE_TOSS;
+ self.solid = SOLID_BBOX;
+ //self.vehicle_energy = 1;
+ self.movetype = MOVETYPE_FLY;
+ setorigin(self, self.origin + '0 0 25');
+}
+
+void bumb_die()
+{
+ self.deadflag = DEAD_DEAD;
+ self.vehicle_exit(VHEF_NORMAL);
+
+ self.health = 0;
+ self.event_damage = SUB_Null;
+ self.solid = SOLID_CORPSE;
+ self.takedamage = DAMAGE_NO;
+ self.deadflag = DEAD_DYING;
+ self.movetype = MOVETYPE_BOUNCE;
+
+ RadiusDamage (self, self.enemy, autocvar_g_vehicle_bumblebee_blowup_coredamage,
+ autocvar_g_vehicle_bumblebee_blowup_edgedamage,
+ autocvar_g_vehicle_bumblebee_blowup_radius, world,
+ autocvar_g_vehicle_bumblebee_blowup_forceintensity,
+ DEATH_WAKIBLOWUP, world);
+
+ pointparticles(particleeffectnum("rocket_explode"), findbetterlocation (self.origin, 16), '0 0 0', 1);
+}
+
+void bumb_dinit()
+{
+ if not (vehicle_initialize(
+ "Bumblebee", "models/vehicles/bumblebee_body.dpm",
+ "", "models/vehicles/spiderbot_cockpit.dpm", "", "", "tag_viewport",
+ HUD_BUMBLEBEE, BUMB_MIN, BUMB_MAX, FALSE,
+ bumb_spawn, autocvar_g_vehicle_bumblebee_respawntime,
+ bumb_pilot_frame, bumb_enter, bumb_exit,
+ bumb_die, bumb_think, FALSE, autocvar_g_vehicle_bumblebee_health))
+ {
+ remove(self);
+ return;
+ }
+
+
+ self.gun1 = spawn();
+ self.gun2 = spawn();
+ self.gun3 = spawn();
+
+ self.vehicle_flags |= VHF_MULTISLOT;
+
+ self.gun1.owner = self;
+ self.gun2.owner = self;
+ self.gun3.owner = self;
+
+ setmodel(self.gun1, "models/vehicles/bumblebee_plasma_right.dpm");
+ setmodel(self.gun2, "models/vehicles/bumblebee_plasma_left.dpm");
+ setmodel(self.gun3, "models/vehicles/bumblebee_ray.dpm");
+
+ setattachment(self.gun1, self, "cannon_right");
+ setattachment(self.gun2, self, "cannon_left");
+ setattachment(self.gun3, self, "raygun");
+
+ vehicle_addplayerslot(self, self.gun1, HUD_RAPTOR, "models/vehicles/wakizashi_cockpit.dpm", bumb_gunner_frame, bumb_gunner_exit);
+ vehicle_addplayerslot(self, self.gun2, HUD_RAPTOR, "models/vehicles/wakizashi_cockpit.dpm", bumb_gunner_frame, bumb_gunner_exit);
+
+ //fixme-model
+ setorigin(self.gun1.vehicle_hudmodel, '90 -27 -23');
+ setorigin(self.gun1.vehicle_viewport, '-85 0 50');
+
+ setorigin(self.gun2.vehicle_hudmodel, '90 -27 -23');
+ setorigin(self.gun2.vehicle_viewport, '-85 0 50');
+ self.scale = 1.5;
+
+ /*
+ float i;
+ for(i=1; gettaginfo(self.gun1, i), gettaginfo_name; ++i)
+ {
+
+ dprint(" ------- ^1gettaginfo_name^2(",ftos(i),") ^3=", gettaginfo_name, "\n");
+ }
+ */
+}
+
+void spawnfunc_vehicle_bumblebee()
+{
+ if(!autocvar_g_vehicle_bumblebee)
+ {
+ remove(self);
+ return;
+ }
+
+ precache_model ("models/vehicles/bumblebee_body.dpm");
+ precache_model ("models/vehicles/bumblebee_plasma_left.dpm");
+ precache_model ("models/vehicles/bumblebee_plasma_right.dpm");
+ precache_model ("models/vehicles/bumblebee_ray.dpm");
+ precache_model ("models/vehicles/wakizashi_cockpit.dpm");
+ precache_model ("models/vehicles/spiderbot_cockpit.dpm");
+ precache_model ("models/vehicles/raptor_cockpit.dpm");
+
+ if(autocvar_g_vehicle_bumblebee_energy)
+ if(autocvar_g_vehicle_bumblebee_energy_regen)
+ self.vehicle_flags |= VHF_ENERGYREGEN;
+
+ if(autocvar_g_vehicle_bumblebee_shield)
+ self.vehicle_flags |= VHF_HASSHIELD;
+
+ if(autocvar_g_vehicle_bumblebee_shield_regen)
+ self.vehicle_flags |= VHF_SHIELDREGEN;
+
+ if(autocvar_g_vehicle_bumblebee_health_regen)
+ self.vehicle_flags |= VHF_HEALTHREGEN;
+
+ self.think = bumb_dinit;
+ self.nextthink = time + 1;
+}
+#endif // SVQC
+
+#ifdef CSQC
+void bumblebee_draw()
+{
+
+}
+
+void bumblebee_draw2d()
+{
+
+}
+
+void bumblebee_read_extra()
+{
+
+}
+
+void vehicle_bumblebee_assemble()
+{
+
+}
+#endif //CSQC
+
+/*
+vector predict_target(entity _targ, vector _from, float _shot_speed)
+{
+ float i; // loop
+ float _distance; // How far to target
+ float _impact_time; // How long untill projectile impacts
+ vector _predict_pos; // Predicted enemy location
+ vector _original_origin;// Where target is before predicted
+
+ _original_origin = real_origin(_targ); // Typicaly center of target BBOX
+
+ _predict_pos = _original_origin;
+ for(i = 0; i < 4; ++i) // Loop a few times to increase prediction accuracy (increase loop count if accuracy is to low)
+ {
+ _distance = vlen(_predict_pos - _from); // Get distance to previos predicted location
+ _impact_time = _distance / _shot_speed; // Calculate impact time
+ _predict_pos = _original_origin + _targ.velocity * _impact_time; // Calculate new predicted location
+ }
+
+ return _predict_pos;
+}
+*/
\ No newline at end of file
void racer_enter();
// Auto cvars
+float autocvar_g_vehicle_racer;
+
float autocvar_g_vehicle_racer_speed_afterburn;
float autocvar_g_vehicle_racer_afterburn_cost;
bolt = vehicles_projectile("wakizashi_gun_muzzleflash", "weapons/lasergun_fire.wav",
v, normalize(v_forward + randomvec() * autocvar_g_vehicle_racer_cannon_spread) * autocvar_g_vehicle_racer_cannon_speed,
autocvar_g_vehicle_racer_cannon_damage, autocvar_g_vehicle_racer_cannon_radius, autocvar_g_vehicle_racer_cannon_force, 0,
- DEATH_WAKIGUN, PROJECTILE_WAKICANNON, 0, TRUE, TRUE);
+ DEATH_WAKIGUN, PROJECTILE_WAKICANNON, 0, TRUE, TRUE, self.owner);
// Fix z-aim (for chase mode)
v = normalize(trace_endpos - bolt.origin);
entity rocket = rocket = vehicles_projectile("wakizashi_rocket_launch", "weapons/rocket_fire.wav",
v, v_forward * autocvar_g_vehicle_racer_rocket_speed,
autocvar_g_vehicle_racer_rocket_damage, autocvar_g_vehicle_racer_rocket_radius, autocvar_g_vehicle_racer_rocket_force, 3,
- DEATH_WAKIROCKET, PROJECTILE_WAKIROCKET, 20, FALSE, FALSE);
+ DEATH_WAKIROCKET, PROJECTILE_WAKIROCKET, 20, FALSE, FALSE, self.owner);
rocket.lip = autocvar_g_vehicle_racer_rocket_accel * sys_frametime;
rocket.wait = autocvar_g_vehicle_racer_rocket_turnrate;
vehicles_regen(wait, vehicle_energy, autocvar_g_vehicle_racer_energy, autocvar_g_vehicle_racer_energy_regen_pause, autocvar_g_vehicle_racer_energy_regen, frametime, FALSE);
- VEHICLE_UPDATE_PLAYER(health, racer);
- VEHICLE_UPDATE_PLAYER(energy, racer);
+ VEHICLE_UPDATE_PLAYER(player, health, racer);
+ VEHICLE_UPDATE_PLAYER(player, energy, racer);
if(racer.vehicle_flags & VHF_HASSHIELD)
- VEHICLE_UPDATE_PLAYER(shield, racer);
+ VEHICLE_UPDATE_PLAYER(player, shield, racer);
player.BUTTON_ATCK = player.BUTTON_ATCK2 = 0;
setorigin(player,racer.origin + '0 0 32');
vehilces_impact(autocvar_g_vehicle_racer_bouncepain_x, autocvar_g_vehicle_racer_bouncepain_y, autocvar_g_vehicle_racer_bouncepain_z);
}
-void racer_spawn()
+void racer_spawn(float _spawnflag)
{
self.think = racer_think;
self.nextthink = time;
void spawnfunc_vehicle_racer()
{
+ if(!autocvar_g_vehicle_racer)
+ {
+ remove(self);
+ return;
+ }
+
self.vehicle_flags |= VHF_DMGSHAKE;
self.vehicle_flags |= VHF_DMGROLL;
precache_model ("models/vehicles/wakizashi.dpm");
precache_model ("models/vehicles/wakizashi_cockpit.dpm");
- vehicles_configcheck("vehicle_racer.cfg", autocvar_g_vehicle_racer_health);
if(autocvar_g_vehicle_racer_energy)
if(autocvar_g_vehicle_racer_energy_regen)
self.vehicle_flags |= VHF_ENERGYREGEN;
#define RAPTOR_MAX '80 80 70'
#ifdef SVQC
+float autocvar_g_vehicle_raptor;
+
float autocvar_g_vehicle_raptor_respawntime;
float autocvar_g_vehicle_raptor_takeofftime;
float autocvar_g_vehicle_raptor_bouncestop;
vector autocvar_g_vehicle_raptor_bouncepain;
-void raptor_spawn();
+void raptor_spawn(float);
float raptor_frame();
float raptor_takeoff();
vehicles_projectile("raptor_cannon_muzzleflash", "weapons/lasergun_fire.wav",
gettaginfo(gun, gettagindex(gun, tagname)), normalize(v_forward + randomvec() * autocvar_g_vehicle_raptor_cannon_spread) * autocvar_g_vehicle_raptor_cannon_speed,
autocvar_g_vehicle_raptor_cannon_damage, autocvar_g_vehicle_raptor_cannon_radius, autocvar_g_vehicle_raptor_cannon_force, 0,
- DEATH_RAPTOR_CANNON, PROJECTILE_RAPTORCANNON, 0, TRUE, TRUE);
+ DEATH_RAPTOR_CANNON, PROJECTILE_RAPTORCANNON, 0, TRUE, TRUE, self.owner);
}
void raptor_think()
raptor.bomb1.alpha = raptor.bomb2.alpha = (time - raptor.lip) / (raptor.delay - raptor.lip);
player.vehicle_reload2 = bound(0, raptor.bomb1.alpha * 100, 100);
- VEHICLE_UPDATE_PLAYER(health, raptor);
- VEHICLE_UPDATE_PLAYER(energy, raptor);
+ VEHICLE_UPDATE_PLAYER(player, health, raptor);
+ VEHICLE_UPDATE_PLAYER(player, energy, raptor);
if(self.vehicle_flags & VHF_HASSHIELD)
- VEHICLE_UPDATE_PLAYER(shield, raptor);
+ VEHICLE_UPDATE_PLAYER(player, shield, raptor);
player.BUTTON_ATCK = player.BUTTON_ATCK2 = player.BUTTON_CROUCH = 0;
self = player;
}
- VEHICLE_UPDATE_PLAYER(health, raptor);
- VEHICLE_UPDATE_PLAYER(energy, raptor);
+ VEHICLE_UPDATE_PLAYER(player, health, raptor);
+ VEHICLE_UPDATE_PLAYER(player, energy, raptor);
if(self.vehicle_flags & VHF_HASSHIELD)
- VEHICLE_UPDATE_PLAYER(shield, raptor);
+ VEHICLE_UPDATE_PLAYER(player, shield, raptor);
player.BUTTON_ATCK = player.BUTTON_ATCK2 = player.BUTTON_CROUCH = 0;
vehilces_impact(autocvar_g_vehicle_raptor_bouncepain_x, autocvar_g_vehicle_raptor_bouncepain_y, autocvar_g_vehicle_raptor_bouncepain_z);
}
-void raptor_spawn()
+void raptor_spawn(float _f)
{
self.frame = 0;
self.vehicle_health = autocvar_g_vehicle_raptor_health;
void spawnfunc_vehicle_raptor()
{
- vehicles_configcheck("vehicle_raptor.cfg", autocvar_g_vehicle_raptor_health);
-
+ if(!autocvar_g_vehicle_raptor)
+ {
+ remove(self);
+ return;
+ }
+
self.vehicle_flags |= VHF_DMGSHAKE;
self.vehicle_flags |= VHF_DMGROLL;
const vector SPIDERBOT_MAX = '75 75 125';
#ifdef SVQC
+float autocvar_g_vehicle_spiderbot;
+
float autocvar_g_vehicle_spiderbot_respawntime;
float autocvar_g_vehicle_spiderbot_speed_stop;
void spiderbot_exit(float eject);
void spiderbot_enter();
-void spiderbot_spawn();
+void spiderbot_spawn(float);
#define SBRM_FIRST 0
#define SBRM_VOLLY 0
#define SBRM_GUIDE 1
rocket = vehicles_projectile("spiderbot_rocket_launch", "weapons/rocket_fire.wav",
v, normalize(randomvec() * autocvar_g_vehicle_spiderbot_rocket_spread + v_forward) * autocvar_g_vehicle_spiderbot_rocket_speed,
autocvar_g_vehicle_spiderbot_rocket_damage, autocvar_g_vehicle_spiderbot_rocket_radius, autocvar_g_vehicle_spiderbot_rocket_force, 1,
- DEATH_SBROCKET, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, FALSE, TRUE);
+ DEATH_SBROCKET, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, FALSE, TRUE, self.owner);
crosshair_trace(self.owner);
float _dist = (random() * autocvar_g_vehicle_spiderbot_rocket_radius) + vlen(v - trace_endpos);
_dist -= (random() * autocvar_g_vehicle_spiderbot_rocket_radius) ;
rocket = vehicles_projectile("spiderbot_rocket_launch", "weapons/rocket_fire.wav",
v, normalize(v_forward) * autocvar_g_vehicle_spiderbot_rocket_speed,
autocvar_g_vehicle_spiderbot_rocket_damage, autocvar_g_vehicle_spiderbot_rocket_radius, autocvar_g_vehicle_spiderbot_rocket_force, 1,
- DEATH_SBROCKET, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, FALSE, FALSE);
+ DEATH_SBROCKET, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, FALSE, FALSE, self.owner);
crosshair_trace(self.owner);
rocket.pos1 = trace_endpos;
rocket.nextthink = time;
rocket = vehicles_projectile("spiderbot_rocket_launch", "weapons/rocket_fire.wav",
v, normalize(v_forward) * autocvar_g_vehicle_spiderbot_rocket_speed,
autocvar_g_vehicle_spiderbot_rocket_damage, autocvar_g_vehicle_spiderbot_rocket_radius, autocvar_g_vehicle_spiderbot_rocket_force, 1,
- DEATH_SBROCKET, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, FALSE, TRUE);
+ DEATH_SBROCKET, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, FALSE, TRUE, self.owner);
crosshair_trace(self.owner);
rocket.pos1 = trace_endpos + randomvec() * (0.75 * autocvar_g_vehicle_spiderbot_rocket_radius);
setorigin(player, spider.origin + '0 0 1' * SPIDERBOT_MAX_z);
player.velocity = spider.velocity;
- VEHICLE_UPDATE_PLAYER(health, spiderbot);
+ VEHICLE_UPDATE_PLAYER(player, health, spiderbot);
if(self.vehicle_flags & VHF_HASSHIELD)
- VEHICLE_UPDATE_PLAYER(shield, spiderbot);
+ VEHICLE_UPDATE_PLAYER(player, shield, spiderbot);
self = player;
return 1;
if(autocvar_g_vehicle_spiderbot_bouncepain_x)
vehilces_impact(autocvar_g_vehicle_spiderbot_bouncepain_x, autocvar_g_vehicle_spiderbot_bouncepain_y, autocvar_g_vehicle_spiderbot_bouncepain_z);
}
-void spiderbot_spawn()
+void spiderbot_spawn(float _f)
{
self.frame = 5;
self.tur_head.frame = 1;
void spawnfunc_vehicle_spiderbot()
{
+ if(!autocvar_g_vehicle_spiderbot)
+ {
+ remove(self);
+ return;
+ }
+
self.vehicle_flags |= VHF_DMGSHAKE;
//self.vehicle_flags |= VHF_DMGROLL;
//self.vehicle_flags |= VHF_DMGHEADROLL;
precache_sound ( "vehicles/spiderbot_walk.wav");
precache_sound ( "vehicles/spiderbot_land.wav");
- vehicles_configcheck("vehicle_spiderbot.cfg", autocvar_g_vehicle_spiderbot_health);
if(autocvar_g_vehicle_spiderbot_shield)
self.vehicle_flags |= VHF_HASSHIELD;
float autocvar_g_vehicles_uzi_damagerate = 0.5;
float autocvar_g_vehicles_rifle_damagerate = 0.75;
float autocvar_g_vehicles_minstanex_damagerate = 0.001;
+float autocvar_g_vehicles_tag_damagerate = 5;
void vehicles_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force);
// WriteByte(MSG_ONE, SVC_TEMPENTITY) uses reliable messagess, never use for thinsg that need continous updates.
void SendAuxiliaryXhair2(entity own, vector loc, vector clr, float axh_id)
{
- msg_entity = own;
+ msgexntity = own;
WriteByte(MSG_ONE, SVC_TEMPENTITY);
WriteByte(MSG_ONE, TE_CSQC_AUXILIARYXHAIR);
}
}
-#define VEHICLE_UPDATE_PLAYER(fld,vhname) \
-self.owner.vehicle_##fld = (self.vehicle_##fld / autocvar_g_vehicle_##vhname##_##fld) * 100
+#define VEHICLE_UPDATE_PLAYER(ply,fld,vhname) \
+ply.vehicle_##fld = (self.vehicle_##fld / autocvar_g_vehicle_##vhname##_##fld) * 100
#define vehicles_sweap_collision(orig,vel,dt,acm,mult) \
traceline(orig, orig + vel * dt, MOVE_NORMAL, self); \
vector _org, vector _vel,
float _dmg, float _radi, float _force, float _size,
float _deahtype, float _projtype, float _health,
- float _cull, float _clianim)
+ float _cull, float _clianim, entity _owner)
{
entity proj;
proj.touch = vehicles_projectile_explode;
proj.use = vehicles_projectile_explode;
proj.owner = self;
- proj.realowner = self.owner;
+ proj.realowner = _owner;
proj.think = SUB_Remove;
proj.nextthink = time + 30;
setorigin(self, self.pos1 + '0 0 0');
// Show it
pointparticles(particleeffectnum("teleport"), self.origin + '0 0 64', '0 0 0', 1);
-
+
+ if(self.vehicle_controller)
+ self.team = self.vehicle_controller.team;
+
vehicles_reset_colors();
- self.vehicle_spawn();
+ self.vehicle_spawn(VHSF_NORMAL);
}
// Better way of determening whats crushable needed! (fl_crushable?)
Standarrd vehicle release fucntion.
custom code goes in self.vehicle_exit
**/
+float vehicles_exit_running;
void vehicles_exit(float eject)
{
- entity oldself;
+ entity _vehicle;
+ entity _player;
+ entity _oldself = self;
+
+ if(vehicles_exit_running)
+ {
+ dprint("^1vehicles_exit allready running! this is not good..\n");
+ return;
+ }
+
if(self.flags & FL_CLIENT)
{
- oldself = self;
- self = self.vehicle;
+ _vehicle = self.vehicle;
+
+ if (_vehicle.vehicle_flags & VHF_PLAYERSLOT)
+ {
+ _vehicle.vehicle_exit(eject);
+ self = _oldself;
+ return;
+ }
}
+ else
+ _vehicle = self;
+
+ _player = _vehicle.owner;
+
+ self = _vehicle;
- self.flags |= FL_NOTARGET;
-
- if (self.owner)
+ if (_player)
{
- if (clienttype(self.owner) == CLIENTTYPE_REAL)
+ dprint("^3Player exits\n");
+
+ if (clienttype(_player) == CLIENTTYPE_REAL)
{
- msg_entity = self.owner;
+ msg_entity = _player;
WriteByte (MSG_ONE, SVC_SETVIEWPORT);
- WriteEntity( MSG_ONE, self.owner);
+ WriteEntity( MSG_ONE, _player);
WriteByte (MSG_ONE, SVC_SETVIEWANGLES);
- WriteAngle(MSG_ONE, 0); // pich
- WriteAngle(MSG_ONE, self.angles_y); // yaw
- WriteAngle(MSG_ONE, 0); // roll
+ WriteAngle(MSG_ONE, 0);
+ WriteAngle(MSG_ONE, _vehicle.angles_y);
+ WriteAngle(MSG_ONE, 0);
}
- setsize(self.owner, PL_MIN,PL_MAX);
-
- self.owner.takedamage = DAMAGE_AIM;
- self.owner.solid = SOLID_SLIDEBOX;
- self.owner.movetype = MOVETYPE_WALK;
- self.owner.effects &~= EF_NODRAW;
- self.owner.alpha = 1;
- self.owner.PlayerPhysplug = SUB_Null;
- self.owner.vehicle = world;
- self.owner.view_ofs = PL_VIEW_OFS;
- self.owner.event_damage = PlayerDamage;
- self.owner.hud = HUD_NORMAL;
- self.owner.switchweapon = self.switchweapon;
- //self.owner.BUTTON_USE = 0;
-
- if(self.owner.flagcarried)
+ setsize(_player, PL_MIN,PL_MAX);
+
+ _player.takedamage = DAMAGE_AIM;
+ _player.solid = SOLID_SLIDEBOX;
+ _player.movetype = MOVETYPE_WALK;
+ _player.effects &~= EF_NODRAW;
+ _player.alpha = 1;
+ _player.PlayerPhysplug = SUB_Null;
+ _player.vehicle = world;
+ _player.view_ofs = PL_VIEW_OFS;
+ _player.event_damage = PlayerDamage;
+ _player.hud = HUD_NORMAL;
+ _player.switchweapon = _vehicle.switchweapon;
+
+ if(_player.flagcarried)
{
- self.owner.flagcarried.scale = 0.6;
- setattachment(self.owner.flagcarried, self.owner, "");
- setorigin(self.owner.flagcarried, FLAG_CARRY_POS);
+ _player.flagcarried.scale = 0.6;
+ setattachment(_player.flagcarried, _player, "");
+ setorigin(_player.flagcarried, FLAG_CARRY_POS);
}
- CSQCVehicleSetup(self.owner, HUD_NORMAL);
+ CSQCVehicleSetup(_player, HUD_NORMAL);
}
+
- if(self.deadflag == DEAD_NO)
- self.avelocity = '0 0 0';
-
- self.vehicle_hudmodel.viewmodelforclient = self;
- self.tur_head.nodrawtoclient = world;
- vehicles_setreturn();
-
- self.phase = time + 1;
-
+ dprint("^1Pilot exits\n");
+ _vehicle.flags |= FL_NOTARGET;
+
+ if(_vehicle.deadflag == DEAD_NO)
+ _vehicle.avelocity = '0 0 0';
+
+ _vehicle.tur_head.nodrawtoclient = world;
+
if(!teamplay)
- self.team = 0;
+ _vehicle.team = 0;
else
- self.team = self.tur_head.team;
-
-
- sound (self, CH_TRIGGER_SINGLE, "misc/null.wav", 1, ATTN_NORM);
- self.vehicle_exit(eject);
- self.owner = world;
- vehicles_reset_colors();
-
- if(oldself)
- self = oldself;
+ _vehicle.team = _vehicle.tur_head.team;
+
+
+ sound (_vehicle, CH_TRIGGER_SINGLE, "misc/null.wav", 1, ATTN_NORM);
+ _vehicle.vehicle_hudmodel.viewmodelforclient = _vehicle;
+ _vehicle.phase = time + 1;
+
+ _vehicle.vehicle_exit(eject);
+
+ vehicles_setreturn();
+ vehicles_reset_colors();
+ _vehicle.owner = world;
+ self = _oldself;
}
if(DEATH_ISWEAPON(deathtype, WEP_MINSTANEX))
damage *= autocvar_g_vehicles_minstanex_damagerate;
+
+ if(DEATH_ISWEAPON(deathtype, WEP_SEEKER))
+ damage *= autocvar_g_vehicles_tag_damagerate;
self.enemy = attacker;
}
-void vehicles_configcheck(string configname, float check_cvar)
-{
- if(check_cvar == 0)
- localcmd(strcat("exec ", configname, "\n"));
-}
-
void vehicles_reset_colors()
{
entity e;
self.effects = _effects;
}
+void vehicle_use()
+{
+ dprint("vehicle ",self.netname, " used by ", activator.classname, "\n");
+
+ self.tur_head.team = activator.team;
+
+ if(self.tur_head.team == 0)
+ self.active = ACTIVE_NOT;
+ else
+ self.active = ACTIVE_ACTIVE;
+
+ if(self.active == ACTIVE_ACTIVE && self.deadflag != DEAD_NO)
+ {
+ vehicles_setreturn();
+ vehicles_reset_colors();
+ }
+ else if(self.active == ACTIVE_NOT && self.deadflag != DEAD_NO)
+ {
+
+ }
+}
+
+float vehicle_addplayerslot( entity _owner,
+ entity _slot,
+ float _hud,
+ string _hud_model,
+ float() _framefunc,
+ void(float) _exitfunc)
+{
+ if not (_owner.vehicle_flags & VHF_MULTISLOT)
+ _owner.vehicle_flags |= VHF_MULTISLOT;
+
+ _slot.PlayerPhysplug = _framefunc;
+ _slot.vehicle_exit = _exitfunc;
+ _slot.hud = _hud;
+ _slot.vehicle_flags = VHF_PLAYERSLOT;
+ _slot.vehicle_viewport = spawn();
+ _slot.vehicle_hudmodel = spawn();
+ _slot.vehicle_hudmodel.viewmodelforclient = _slot;
+ _slot.vehicle_viewport.effects = (EF_ADDITIVE | EF_DOUBLESIDED | EF_FULLBRIGHT | EF_NODEPTHTEST | EF_NOGUNBOB | EF_NOSHADOW | EF_LOWPRECISION | EF_SELECTABLE | EF_TELEPORT_BIT);
+
+ setmodel(_slot.vehicle_hudmodel, _hud_model);
+ setmodel(_slot.vehicle_viewport, "null");
+
+ setattachment(_slot.vehicle_hudmodel, _slot, "");
+ setattachment(_slot.vehicle_viewport, _slot.vehicle_hudmodel, "");
+
+ return TRUE;
+}
+
float vehicle_initialize(string net_name,
string bodymodel,
string topmodel,
vector min_s,
vector max_s,
float nodrop,
- void() spawnproc,
+ void(float _spawnflag) spawnproc,
float _respawntime,
float() physproc,
void() enterproc,
float use_csqc,
float _max_health)
{
+ if(self.targetname)
+ {
+ self.vehicle_controller = find(world, target, self.targetname);
+ if(!self.vehicle_controller)
+ {
+ bprint("^1WARNING: ^3Vehicle with invalid .targetname\n");
+ }
+ else
+ {
+ self.team = self.vehicle_controller.team;
+ self.use = vehicle_use;
+ }
+ }
+
addstat(STAT_HUD, AS_INT, hud);
addstat(STAT_VEHICLESTAT_HEALTH, AS_INT, vehicle_health);
addstat(STAT_VEHICLESTAT_SHIELD, AS_INT, vehicle_shield);
setmodel(self.vehicle_hudmodel, hudmodel);
setmodel(self.vehicle_viewport, "null");
-
if(topmodel != "")
{
setmodel(self.tur_head, topmodel);
tracebox(self.origin + '0 0 100', min_s, max_s, self.origin - '0 0 10000', MOVE_WORLDONLY, self);
setorigin(self, trace_endpos);
}
-
+
self.pos1 = self.origin;
self.pos2 = self.angles;
self.tur_head.team = self.team;
_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);
}
-
-
-void bugmenot()
-{
- self.vehicle_exit = self.vehicle_exit;
- self.vehicle_enter = self.vehicle_exit;
- self.vehicle_die = self.vehicle_exit;
- self.vehicle_spawn = self.vehicle_exit;
- self.AuxiliaryXhair = self.AuxiliaryXhair;
-}
#include "racer.qc"
#include "spiderbot.qc"
#include "raptor.qc"
-//#include "bumblebee.qc"
+#ifdef VEHICLES_UNSTABLE
+#include "bumblebee.qc"
+#endif
#endif
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;
+float VHF_DMGSHAKE = 1024; /// Add random velocity each frame if health < 50%
+float VHF_DMGROLL = 2048; /// Add random angles each frame if health < 50%
+float VHF_DMGHEADROLL = 4096; /// Add random head angles each frame if health < 50%
+float VHF_MULTISLOT = 8192; /// Vehicle has multiple player slots
+float VHF_PLAYERSLOT = 16384; /// This ent is a player slot on a multi-person vehicle
.entity gun1;
.entity gun2;
.entity gun3;
+.entity vehicle_shieldent; /// Entity to disply the shild effect on damage
+.entity vehicle;
+.entity vehicle_viewport;
+.entity vehicle_hudmodel;
+.entity vehicle_controller;
+.entity vehicle_pilot;
.float vehicle_health; /// If self is player this is 0..100 indicating precentage of health left on vehicle. If self is vehile, this is the real health value.
.float vehicle_energy; /// If self is player this is 0..100 indicating precentage of energy left on vehicle. If self is vehile, this is the real energy value.
.float vehicle_shield; /// If self is player this is 0..100 indicating precentage of shield left on vehicle. If self is vehile, this is the real shield value.
-.entity vehicle_shieldent; /// Entity to disply the shild effect on damage
.float vehicle_ammo1; /// If self is player this field's use depends on the individual vehile. If self is vehile, this is the real ammo1 value.
.float vehicle_reload1; /// If self is player this field's use depends on the individual vehile. If self is vehile, this is the real reload1 value.
.float vehicle_ammo2; /// If self is player this field's use depends on the individual vehile. If self is vehile, this is the real ammo2 value.
.float vehicle_reload2; /// If self is player this field's use depends on the individual vehile. If self is vehile, this is the real reload2 value.
-.entity vehicle;
-.entity vehicle_viewport;
-.entity vehicle_hudmodel;
-
.float sound_nexttime;
#define VOL_VEHICLEENGINE 1
.float hud;
.float dmg_time;
.float vehicle_respawntime;
-.void() vehicle_spawn;
+//.void() vehicle_spawn;
void vehicles_exit(float eject);
var .void(float exit_flags) vehicle_exit;
var .void() vehicle_enter; /// Vehicles custom funciton to be executed when owner exit it
var .void() vehicle_die; /// Vehicles custom function to be executed when vehile die
-var .void() vehicle_spawn; /// Vehicles custom fucntion to be efecuted when vehicle (re)spawns
+#define VHSF_NORMAL 0
+#define VHSF_FACTORY 2
+var .void(float _spawnflag) vehicle_spawn; /// Vehicles custom fucntion to be efecuted when vehicle (re)spawns
const var .float(float _imp) vehicles_impusle_null;
var .float(float _imp) vehicles_impusle;
.float vehicle_weapon2mode = volly_counter;
+//ยง var .void() vehicle_factory()
+
#ifdef VEHICLES_USE_ODE
void(entity e, float physics_enabled) physics_enable = #540; // enable or disable physics on object
void(entity e, vector force, vector force_pos) physics_addforce = #541; // apply a force from certain origin, length of force vector is power of force
exec vehicle_spiderbot.cfg
exec vehicle_bumblebee.cfg
-//set g_vehicle_racer_respawntime 10
-//set g_vehicle_spiderbot_respawntime 10
-//set g_vehicle_raptor_respawntime 10
+set g_vehicle_racer 1
+set g_vehicle_spiderbot 1
+set g_vehicle_raptor 1
+set g_vehicle_bumblebee 0
set g_vehicles_crush_dmg 70
set g_vehicles_crush_force 50
set g_vehicles_nex_damagerate 0.5
set g_vehicles_uzi_damagerate 0.5
set g_vehicles_rifle_damagerate 0.5
-set g_vehicles_minstanex_damagerate 0.001
\ No newline at end of file
+set g_vehicles_minstanex_damagerate 0.001
+set g_vehicles_tag_damagerate 4
\ No newline at end of file