[Fix] Fixed Mace Rockets

This commit is contained in:
Allanis 2014-05-21 13:20:06 +01:00
parent 0dd9514139
commit b75cf3d698
2 changed files with 26 additions and 55 deletions

View File

@ -586,8 +586,8 @@
<sound>missile</sound>
<spfx_shield>ExpM</spfx_shield>
<spfx_armour>ExpM</spfx_armour>
<duration>5</duration>
<thrust>600</thrust>
<duration>3</duration>
<thrust>300</thrust>
<speed>1000</speed>
<damage type="kinetic">35</damage>
</specific>

View File

@ -842,22 +842,20 @@ static Weapon* weapon_create(const Outfit* outfit, const double dir, const Vec2*
w->solid->pos.y + w->solid->vel.y);
break;
/* Turrets are a special case. */
/* Dumb missiles and turrets. */
case OUTFIT_TYPE_TURRET_DUMB_AMMO:
case OUTFIT_TYPE_MISSILE_DUMB_AMMO:
if(w->outfit->type == OUTFIT_TYPE_TURRET_DUMB_AMMO) {
pilot_target = pilot_get(w->target);
if(pilot_target == NULL)
rdir = dir;
else {
/* Get the distance. */
dist = vect_dist(pos, &pilot_target->solid->pos);
/* Aim. */
/*
* Try to predict where the enemy will be.
*
* Time for shots to reach that distance.
*/
/* Try to predict where the enemy will be. */
/* Time for shots to reach that distance. */
t = dist / w->outfit->u.amm.speed;
/* Position is calculated on where it should be. */
@ -869,11 +867,9 @@ static Weapon* weapon_create(const Outfit* outfit, const double dir, const Vec2*
/* Set angle to face. */
rdir = ANGLE(x, y);
}
if(outfit->u.amm.accuracy != 0.) {
rdir += NormalInverse(RNGF()*0.9 + 0.05) /* Get rid of extreme values. */
* outfit->u.amm.accuracy/2. * 1./180.*M_PI;
if((rdir > 2.*M_PI) || (rdir < 0.))
rdir = fmod(rdir, 2.*M_PI);
}
else {
rdir = dir;
}
/* If thrust is 0. We assume it starts out at speed. */
@ -886,33 +882,8 @@ static Weapon* weapon_create(const Outfit* outfit, const double dir, const Vec2*
w->timer = outfit->u.amm.duration;
w->solid = solid_create(mass, rdir, pos, &v);
if(w->outfit->u.amm.thrust != 0.)
vect_pset(&w->solid->force, w->outfit->u.amm.thrust, rdir);
w->voice = sound_playPos(w->outfit->u.amm.sound,
w->solid->pos.x + w->solid->vel.x,
w->solid->pos.y + w->solid->vel.y);
break;
vect_pset(&w->solid->force, w->outfit->u.amm.thrust * mass, rdir);
/* Dumb missiles are a mix of missile and bolt. */
case OUTFIT_TYPE_MISSILE_DUMB_AMMO:
mass = w->outfit->mass;
rdir = dir;
if(outfit->u.amm.accuracy != 0.) {
rdir += NormalInverse(RNGF()*0.9 + 0.05) /* Get rid of extreme values. */
* outfit->u.amm.accuracy/2. * 1./180.*M_PI;
if((rdir > 2.*M_PI) || (rdir < 0.))
rdir = fmod(rdir, 2.*M_PI);
}
/* If thrust is 0. we assume it starts out at speed. */
if(outfit->u.amm.thrust == 0.)
vect_pset(&v, w->outfit->u.amm.speed, rdir);
else
vectnull(&v);
w->timer = outfit->u.amm.duration;
w->solid = solid_create(mass, rdir, pos, &v);
w->voice = sound_playPos(w->outfit->u.amm.sound,
w->solid->pos.x + w->solid->vel.x,
w->solid->pos.y + w->solid->vel.y);