WIP scathe phase ammo / Shield ability fixes

This commit is contained in:
Anuken 2025-01-11 17:35:38 -05:00
parent 5fc95b36a3
commit 3af562e624
9 changed files with 108 additions and 9 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -592,3 +592,4 @@
63090=remove-ore|block-remove-ore-ui
63089=small-heat-redirector|block-small-heat-redirector-ui
63088=large-cliff-crusher|block-large-cliff-crusher-ui
63087=scathe-missile-phase|unit-scathe-missile-phase-ui

View File

@ -4112,7 +4112,7 @@ public class Blocks{
hitEffect = despawnEffect = Fx.hitSquaresColor;
buildingDamageMultiplier = 0.2f;
}},
Items.oxide, new BasicBulletType(8f, 90){{
Items.oxide, new BasicBulletType(8f, 95){{
knockback = 3f;
width = 25f;
hitSize = 7f;
@ -4127,8 +4127,8 @@ public class Blocks{
hitEffect = despawnEffect = Fx.hitSquaresColor;
buildingDamageMultiplier = 0.2f;
}},
Items.silicon, new BasicBulletType(8f, 33){{
knockback = 2f;
Items.silicon, new BasicBulletType(8f, 34){{
knockback = 3f;
width = 25f;
hitSize = 7f;
height = 20f;
@ -4478,10 +4478,10 @@ public class Blocks{
}},
Items.silicon, new BasicBulletType(){{
damage = 35;
homingPower = 0.03f;
homingPower = 0.045f;
reloadMultiplier = 0.9f;
speed = 8.5f;
speed = 9f;
width = height = 16;
shrinkY = 0.3f;
backSprite = "large-bomb-back";
@ -4750,7 +4750,7 @@ public class Blocks{
requirements(Category.turret, with(Items.silicon, 450, Items.graphite, 400, Items.tungsten, 500, Items.oxide, 100, Items.carbide, 200));
ammo(
Items.carbide, new BasicBulletType(0f, 1){{
Items.carbide, new BulletType(){{
shootEffect = Fx.shootBig;
smokeEffect = Fx.shootSmokeMissile;
ammoMultiplier = 1f;
@ -4833,6 +4833,96 @@ public class Blocks{
interval = 7f;
}});
}};
}},
//TODO - needs balancing
Items.phaseFabric, new BulletType(){{
shootEffect = Fx.shootBig;
smokeEffect = Fx.shootSmokeMissile;
ammoMultiplier = 1f;
reloadMultiplier = 0.8f;
spawnUnit = new MissileUnitType("scathe-missile-phase"){{
speed = 4.4f;
maxRange = 6f;
lifetime = 60f * 5.7f;
outlineColor = Pal.darkOutline;
engineColor = trailColor = Color.valueOf("ffd37f");
engineLayer = Layer.effect;
engineSize = 3.1f;
engineOffset = 10f;
rotateSpeed = 0.2f;
trailLength = 18;
missileAccelTime = 50f;
lowAltitude = true;
loopSound = Sounds.missileTrail;
loopSoundVolume = 0.6f;
deathSound = Sounds.largeExplosion;
targetAir = false;
targetUnderBlocks = false;
fogRadius = 6f;
health = 250;
weapons.add(new Weapon(){{
shootCone = 360f;
mirror = false;
reload = 1f;
deathExplosionEffect = Fx.massiveExplosion;
shootOnDeath = true;
shake = 10f;
bullet = new ExplosionBulletType(1500f, 50f){{
hitColor = engineColor;
shootEffect = new MultiEffect(Fx.massiveExplosion, Fx.scatheExplosion, Fx.scatheLight, new WaveEffect(){{
lifetime = 10f;
strokeFrom = 4f;
sizeTo = 130f;
}});
collidesAir = false;
buildingDamageMultiplier = 0.2f;
ammoMultiplier = 1f;
fragLifeMin = 0.1f;
fragBullets = 7;
fragBullet = new ArtilleryBulletType(3.4f, 32){{
buildingDamageMultiplier = 0.2f;
drag = 0.02f;
hitEffect = Fx.massiveExplosion;
despawnEffect = Fx.scatheSlash;
knockback = 0.8f;
lifetime = 23f;
width = height = 18f;
collidesTiles = false;
splashDamageRadius = 40f;
splashDamage = 160f;
backColor = trailColor = hitColor = engineColor;
frontColor = Color.white;
smokeEffect = Fx.shootBigSmoke2;
despawnShake = 7f;
lightRadius = 30f;
lightColor = engineColor;
lightOpacity = 0.5f;
trailLength = 20;
trailWidth = 3.5f;
trailEffect = Fx.none;
}};
}};
}});
abilities.add(new MoveEffectAbility(){{
effect = Fx.missileTrailSmoke;
rotation = 180f;
y = -9f;
color = Color.grays(0.6f).lerp(Pal.redLight, 0.5f).a(0.4f);
interval = 7f;
}});
abilities.add(new ForceFieldAbility(30f, 0f, 160f, 999999999f));
}};
}}
);

View File

@ -15,6 +15,7 @@ public abstract class Ability implements Cloneable{
public void update(Unit unit){}
public void draw(Unit unit){}
public void death(Unit unit){}
public void created(Unit unit){}
public void init(UnitType type){}
public void displayBars(Unit unit, Table bars){}
public void addStats(Table t){

View File

@ -131,6 +131,11 @@ public class ForceFieldAbility extends Ability{
bars.add(new Bar("stat.shieldhealth", Pal.accent, () -> unit.shield / max)).row();
}
@Override
public void created(Unit unit){
unit.shield = max;
}
public void checkRadius(Unit unit){
//timer2 is used to store radius scale as an effect
realRad = radiusScale * radius;

View File

@ -11,7 +11,6 @@ import mindustry.*;
import mindustry.content.*;
import mindustry.gen.*;
import mindustry.graphics.*;
import mindustry.type.*;
import mindustry.ui.*;
public class ShieldArcAbility extends Ability{
@ -102,7 +101,7 @@ public class ShieldArcAbility extends Ability{
}
@Override
public void init(UnitType type){
public void created(Unit unit){
data = max;
}

View File

@ -465,6 +465,9 @@ public class UnitType extends UnlockableContent implements Senseable{
if(unit.controller() instanceof CommandAI command && defaultCommand != null){
command.command = defaultCommand;
}
for(var ability : unit.abilities){
ability.created(unit);
}
unit.ammo = ammoCapacity; //fill up on ammo upon creation
unit.elevation = flying ? 1f : 0;
unit.heal();

View File

@ -26,4 +26,4 @@ org.gradle.caching=true
org.gradle.internal.http.socketTimeout=100000
org.gradle.internal.http.connectionTimeout=100000
android.enableR8.fullMode=false
archash=124ba82104
archash=d631900a9e