T4/5 naval / Controversial weapon outlines

This commit is contained in:
Anuken
2020-09-18 18:54:09 -04:00
parent 6b6783f201
commit f53af781ba
29 changed files with 5356 additions and 5044 deletions
@@ -128,7 +128,6 @@ abstract class WeaponsComp implements Teamc, Posc, Rotc, Velc{
float rotation = this.rotation - 90;
float weaponRotation = rotation + (weapon.rotate ? mount.rotation : 0);
//m a t h
float mountX = this.x + Angles.trnsx(rotation, weapon.x, weapon.y),
mountY = this.y + Angles.trnsy(rotation, weapon.x, weapon.y);
@@ -166,9 +165,8 @@ abstract class WeaponsComp implements Teamc, Posc, Rotc, Velc{
Angles.shotgun(weapon.shots, weapon.spacing, rotation, f -> bullet(weapon, x, y, f + Mathf.range(weapon.inaccuracy), lifeScl));
}
if(this instanceof Velc){
((Velc)this).vel().add(Tmp.v1.trns(rotation + 180f, ammo.recoil));
}
vel().add(Tmp.v1.trns(rotation + 180f, ammo.recoil));
boolean parentize = ammo.keepVelocity;
Effect.shake(weapon.shake, weapon.shake, x, y);
@@ -178,6 +176,11 @@ abstract class WeaponsComp implements Teamc, Posc, Rotc, Velc{
}
private void bullet(Weapon weapon, float x, float y, float angle, float lifescl){
weapon.bullet.create(this, team(), x, y, angle, (1f - weapon.velocityRnd) + Mathf.random(weapon.velocityRnd), lifescl);
float xr = Mathf.range(weapon.xRand);
weapon.bullet.create(this, team(),
x + Angles.trnsx(angle, 0, xr),
y + Angles.trnsy(angle, 0, xr),
angle, (1f - weapon.velocityRnd) + Mathf.random(weapon.velocityRnd), lifescl);
}
}