More reasonable AI behavior

This commit is contained in:
Anuken
2020-03-21 14:29:00 -04:00
parent 3563c929af
commit 4813d6c8ff
6 changed files with 31 additions and 10 deletions

View File

@@ -211,7 +211,7 @@ public abstract class BulletType extends Content{
bullet.damage(damage < 0 ? this.damage : damage);
bullet.add();
//if(keepVelocity && owner instanceof Velc) bullet.vel().add(((Velc)owner).vel());
if(keepVelocity && owner instanceof Velc) bullet.vel().add(((Velc)owner).vel());
return bullet;
}

View File

@@ -79,8 +79,8 @@ abstract class UnitComp implements Healthc, Velc, Statusc, Teamc, Itemsc, Hitbox
Vec2 v = Geometry.overlap(Tmp.r1, Tmp.r2, true);
float tm = mass() + unit.mass();
float s1 = mass() / tm, s2 = unit.mass() / tm;
move(v.x*s2/scale, v.y*s2/scale);
unit.move(-v.x*s1/scale, -v.y*s1/scale);
impulse(v.x*s2/scale, v.y*s2/scale);
unit.impulse(-v.x*s1/scale, -v.y*s1/scale);
}
@Override