float autocvar_g_vehicle_racer_rocket_locking_releasetime;
float autocvar_g_vehicle_racer_rocket_locked_time;
float autocvar_g_vehicle_racer_rocket_locked_maxangle;
+float autocvar_g_vehicle_racer_rocket_climbspeed;
float autocvar_g_vehicle_racer_respawntime;
newvel = oldvel + self.lip;
makevectors(vectoangles(olddir));
+ float time_to_impact = min(vlen(self.enemy.origin - self.origin) / vlen(self.velocity), 1);
+ vector predicted_origin = self.enemy.origin + self.enemy.velocity * time_to_impact;
+
traceline(self.origin, self.origin + v_forward * 64 - '0 0 32', MOVE_NORMAL, self);
- newdir = normalize(self.enemy.origin - self.origin);
+ newdir = normalize(predicted_origin - self.origin);
//vector
- float height_diff = self.enemy.origin_z - self.origin_z;
+ float height_diff = predicted_origin_z - self.origin_z;
if(vlen(newdir - v_forward) > autocvar_g_vehicle_racer_rocket_locked_maxangle)
{
newdir_z += 16 * sys_frametime;
self.velocity = normalize(olddir + newdir * autocvar_g_vehicle_racer_rocket_turnrate) * newvel;
- self.velocity_z -= 800 * sys_frametime ;
- self.velocity_z += max(height_diff, cvar("bajs")) * sys_frametime ;
+ self.velocity_z -= 800 * sys_frametime;
+ self.velocity_z += max(height_diff, autocvar_g_vehicle_racer_rocket_climbspeed) * sys_frametime ;
UpdateCSQCProjectile(self);
return;
if(self.owner.flagcarried)
setorigin(self.owner.flagcarried, '-190 0 96');
+
+ //targetdrone_spawn(self.origin + '0 0 512' + randomvec() * 256, 1);
}
void racer_exit(float eject)
.float lock_strength;
.float lock_time;
.float lock_soundtime;
+float DAMAGE_TARGETDRONE = 10;
+
+vector targetdrone_getnewspot()
+{
+
+ vector spot;
+ float i;
+ for(i = 0; i < 100; ++i)
+ {
+ spot = self.origin + randomvec() * 1024;
+ tracebox(spot, self.mins, self.maxs, spot, MOVE_NORMAL, self);
+ if(trace_fraction == 1.0 && trace_startsolid == 0 && trace_allsolid == 0)
+ return spot;
+ }
+ return self.origin;
+}
+void targetdrone_think();
+void targetdrone_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force);
+void targetdrone_renwe()
+{
+ self.think = targetdrone_think;
+ self.nextthink = time + 0.1;
+ setorigin(self, targetdrone_getnewspot());
+ self.health = 200;
+ self.takedamage = DAMAGE_TARGETDRONE;
+ self.event_damage = targetdrone_damage;
+ self.solid = SOLID_BBOX;
+ setmodel(self, "models/runematch/rune.mdl");
+ self.effects = EF_LOWPRECISION;
+ self.scale = 10;
+ self.movetype = MOVETYPE_BOUNCEMISSILE;
+ setsize(self, '-100 -100 -100', '100 100 100');
+
+}
+void targetdrone_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+{
+ self.health -= damage;
+ if(self.health <= 0)
+ {
+ pointparticles(particleeffectnum("explosion_medium"), self.origin, '0 0 0', 1);
+
+ if(!self.cnt)
+ remove(self);
+ else
+ {
+ self.think = targetdrone_renwe;
+ self.nextthink = time + 1 + random() * 2;
+ self.solid = SOLID_NOT;
+ setmodel(self, "");
+ }
+ }
+}
+entity targetdrone_getfear()
+{
+ entity fear;
+ float i;
+
+ for(i = 64; i <= 1024; i += 64)
+ {
+ fear = findradius(self.origin, i);
+ while(fear)
+ {
+ if(fear.bot_dodge)
+ return fear;
+
+ fear = fear.chain;
+ }
+ }
+
+ return world;
+}
+void targetdrone_think()
+{
+ self.nextthink = time + 0.1;
+
+ if(self.enemy)
+ if(self.enemy.deadflag != DEAD_NO)
+ self.enemy = targetdrone_getfear();
+
+ if(!self.enemy)
+ self.enemy = targetdrone_getfear();
+
+ vector newdir;
+
+ if(self.enemy)
+ newdir = steerlib_push(self.enemy.origin) + randomvec() * 0.75;
+ else
+ newdir = randomvec() * 0.75;
+
+ newdir = newdir * 0.5 + normalize(self.velocity) * 0.5;
+
+ if(self.enemy)
+ self.velocity = normalize(newdir) * (500 + (1024 / min(vlen(self.enemy.origin - self.origin), 1024)) * 700);
+ else
+ self.velocity = normalize(newdir) * 750;
+
+ tracebox(self.origin, self.mins, self.maxs, self.origin + self.velocity * 2, MOVE_NORMAL, self);
+ if(!trace_fraction == 1.0)
+ self.velocity = self.velocity * -1;
+
+ //normalize((normalize(self.velocity) * 0.5 + newdir * 0.5)) * 750;
+}
+
+void targetdrone_spawn(vector _where, float _autorenew)
+{
+ entity drone = spawn();
+ setorigin(drone, _where);
+ drone.think = targetdrone_renwe;
+ drone.nextthink = time + 0.1;
+ drone.cnt = _autorenew;
+}
+
void vehicles_locktarget(float incr, float decr, float _lock_time)
{
if(self.lock_target && self.lock_target.deadflag != DEAD_NO)
if(trace_ent.deadflag != DEAD_NO)
trace_ent = world;
- if not (trace_ent.vehicle_flags & VHF_ISVEHICLE || trace_ent.turrcaps_flags & TFL_TURRCAPS_ISTURRET)
+ if not (trace_ent.vehicle_flags & VHF_ISVEHICLE ||
+ trace_ent.turrcaps_flags & TFL_TURRCAPS_ISTURRET ||
+ trace_ent.takedamage == DAMAGE_TARGETDRONE)
trace_ent = world;
}
set g_vehicle_racer_turnspeed 200
set g_vehicle_racer_pitchspeed 100
-set g_vehicle_racer_maxpitch 25
-set g_vehicle_racer_turnroll 32
+set g_vehicle_racer_maxpitch 20
+set g_vehicle_racer_turnroll 16
set g_vehicle_racer_cannon_speed 9000
set g_vehicle_racer_cannon_damage 25
set g_vehicle_racer_rocket_speed 1000
set g_vehicle_racer_rocket_accel 1400
-set g_vehicle_racer_rocket_turnrate 0.2
+set g_vehicle_racer_rocket_turnrate 0.1
set g_vehicle_racer_rocket_damage 165
set g_vehicle_racer_rocket_force 350
set g_vehicle_racer_rocket_radius 125
set g_vehicle_racer_rocket_refire 6
set g_vehicle_racer_rocket_cost 0
+set g_vehicle_racer_rocket_climbspeed 1750
set g_vehicle_racer_rocket_locktarget 1
-set g_vehicle_racer_rocket_locking_time 0.5
-set g_vehicle_racer_rocket_locking_releasetime 1.6
+set g_vehicle_racer_rocket_locking_time 0.4
+set g_vehicle_racer_rocket_locking_releasetime 1.5
set g_vehicle_racer_rocket_locked_time 5
-set g_vehicle_racer_rocket_locked_maxangle 1.46
+set g_vehicle_racer_rocket_locked_maxangle 1.75
set g_vehicle_racer_blowup_radius 250
set g_vehicle_racer_blowup_coredamage 250