New WIP missile turret
This commit is contained in:
@@ -9,7 +9,7 @@ import mindustry.gen.*;
|
||||
public class MoveEffectAbility extends Ability{
|
||||
public float minVelocity = 0.08f;
|
||||
public float interval = 3f;
|
||||
public float x, y;
|
||||
public float x, y, rotation;
|
||||
public boolean rotateEffect = false;
|
||||
public float effectParam = 3f;
|
||||
public boolean teamColor = false;
|
||||
@@ -37,7 +37,7 @@ public class MoveEffectAbility extends Ability{
|
||||
if(unit.vel.len2() >= minVelocity * minVelocity && (counter >= interval)){
|
||||
Tmp.v1.trns(unit.rotation - 90f, x, y);
|
||||
counter %= interval;
|
||||
effect.at(Tmp.v1.x + unit.x, Tmp.v1.y + unit.y, rotateEffect ? unit.rotation : effectParam, teamColor ? unit.team.color : color, parentizeEffects ? unit : null);
|
||||
effect.at(Tmp.v1.x + unit.x, Tmp.v1.y + unit.y, (rotateEffect ? unit.rotation : effectParam) + rotation, teamColor ? unit.team.color : color, parentizeEffects ? unit : null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -654,10 +654,19 @@ public class BulletType extends Content implements Cloneable{
|
||||
spawned.set(x, y);
|
||||
spawned.rotation = angle;
|
||||
//immediately spawn at top speed, since it was launched
|
||||
spawned.vel.trns(angle, spawnUnit.speed);
|
||||
if(spawnUnit.missileAccelTime <= 0f){
|
||||
spawned.vel.trns(angle, spawnUnit.speed);
|
||||
}
|
||||
//assign unit owner
|
||||
if(spawned.controller() instanceof MissileAI ai && owner instanceof Unit unit){
|
||||
ai.shooter = unit;
|
||||
if(spawned.controller() instanceof MissileAI ai){
|
||||
if(owner instanceof Unit unit){
|
||||
ai.shooter = unit;
|
||||
}
|
||||
|
||||
if(owner instanceof ControlBlock control){
|
||||
ai.shooter = control.unit();
|
||||
}
|
||||
|
||||
}
|
||||
spawned.add();
|
||||
}
|
||||
|
||||
@@ -406,7 +406,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
|
||||
|
||||
//make sure trail doesn't just go poof
|
||||
if(trail != null && trail.size() > 0){
|
||||
Fx.trailFade.at(x, y, trail.width(), team.color, trail.copy());
|
||||
Fx.trailFade.at(x, y, trail.width(), type.trailColor == null ? team.color : type.trailColor, trail.copy());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -584,7 +584,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
|
||||
}
|
||||
|
||||
for(WeaponMount mount : mounts){
|
||||
if(mount.weapon.shootOnDeath && !(mount.weapon.bullet.killShooter && mount.shoot)){
|
||||
if(mount.weapon.shootOnDeath && !(mount.weapon.bullet.killShooter && mount.totalShots > 0)){
|
||||
mount.reload = 0f;
|
||||
mount.shoot = true;
|
||||
mount.weapon.update(self(), mount);
|
||||
|
||||
@@ -34,7 +34,7 @@ public class RegionPart extends DrawPart{
|
||||
public float outlineLayerOffset = -0.001f;
|
||||
public float x, y, rotation;
|
||||
public float moveX, moveY, moveRot;
|
||||
public @Nullable Color color, colorTo;
|
||||
public @Nullable Color color, colorTo, mixColor, mixColorTo;
|
||||
public Color heatColor = Pal.turretHeat.cpy();
|
||||
public Seq<DrawPart> children = new Seq<>();
|
||||
public Seq<PartMove> moves = new Seq<>();
|
||||
@@ -105,6 +105,13 @@ public class RegionPart extends DrawPart{
|
||||
}else if(color != null){
|
||||
Draw.color(color);
|
||||
}
|
||||
|
||||
if(mixColor != null && mixColorTo != null){
|
||||
Draw.mixcol(mixColor, mixColorTo, prog);
|
||||
}else if(mixColor != null){
|
||||
Draw.mixcol(mixColor, mixColor.a);
|
||||
}
|
||||
|
||||
Draw.blend(blending);
|
||||
Draw.rect(region, rx, ry, rot);
|
||||
Draw.blend();
|
||||
@@ -118,6 +125,9 @@ public class RegionPart extends DrawPart{
|
||||
Draw.xscl *= sign;
|
||||
}
|
||||
|
||||
Draw.color();
|
||||
Draw.mixcol();
|
||||
|
||||
Draw.z(z);
|
||||
|
||||
//draw child, if applicable - only at the end
|
||||
@@ -162,6 +172,7 @@ public class RegionPart extends DrawPart{
|
||||
|
||||
heat = Core.atlas.find(realName + "-heat");
|
||||
for(var child : children){
|
||||
child.turretShading = turretShading;
|
||||
child.load(name);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user