Parentize Vela and Corvus shoot effects (#5997)

This commit is contained in:
Matthew Peng
2021-09-14 11:24:19 -07:00
committed by GitHub
parent 248f59131b
commit 4cb3bef1a7
3 changed files with 7 additions and 3 deletions

View File

@@ -362,13 +362,13 @@ public class Fx{
Fill.circle(e.x, e.y, e.fin() * 10);
Drawf.light(e.x, e.y, e.fin() * 20f, Pal.heal, 0.7f);
}),
}).followParent(true),
greenLaserChargeSmall = new Effect(40f, 100f, e -> {
color(Pal.heal);
stroke(e.fin() * 2f);
Lines.circle(e.x, e.y, e.fout() * 50f);
}),
}).followParent(true),
greenCloud = new Effect(80f, e -> {
color(Pal.heal);

View File

@@ -446,6 +446,7 @@ public class UnitTypes implements ContentList{
x = y = 0f;
firstShotDelay = Fx.greenLaserChargeSmall.lifetime - 1f;
parentizeEffects = true;
reload = 155f;
recoil = 0f;
@@ -535,6 +536,7 @@ public class UnitTypes implements ContentList{
shootStatusDuration = 60f * 2f;
shootStatus = StatusEffects.unmoving;
firstShotDelay = Fx.greenLaserCharge.lifetime;
parentizeEffects = true;
bullet = new LaserBulletType(){{
length = 460f;

View File

@@ -91,6 +91,8 @@ public class Weapon implements Cloneable{
public boolean ignoreRotation = false;
/** min velocity required for this weapon to shoot */
public float minShootVelocity = -1f;
/** should the shoot effects follow the unit (effects need followParent set to true for this to work) */
public boolean parentizeEffects;
/** internal value used for alternation - do not change! */
public int otherSide = -1;
/** sound used for shooting */
@@ -333,7 +335,7 @@ public class Weapon implements Cloneable{
Angles.shotgun(shots, spacing, rotation, f -> mount.bullet = bullet(unit, shootX, shootY, f + Mathf.range(inaccuracy), lifeScl));
}
boolean parentize = ammo.keepVelocity;
boolean parentize = ammo.keepVelocity || parentizeEffects;
if(delay){
Time.run(firstShotDelay, () -> {