Bullet cleap & inlining

This commit is contained in:
Anuke
2022-03-06 10:03:40 -05:00
parent cc3116f329
commit bc0b0b254d
9 changed files with 492 additions and 498 deletions
+439 -40
View File
@@ -2750,10 +2750,27 @@ public class Blocks{
duo = new ItemTurret("duo"){{ duo = new ItemTurret("duo"){{
requirements(Category.turret, with(Items.copper, 35), true); requirements(Category.turret, with(Items.copper, 35), true);
ammo( ammo(
Items.copper, Bullets.standardCopper, Items.copper, new BasicBulletType(2.5f, 9){{
Items.graphite, Bullets.standardDense, width = 7f;
Items.pyratite, Bullets.standardIncendiary, height = 9f;
Items.silicon, Bullets.standardHoming lifetime = 60f;
ammoMultiplier = 2;
}},
Items.graphite, new BasicBulletType(3.5f, 18){{
width = 9f;
height = 12f;
reloadMultiplier = 0.6f;
ammoMultiplier = 4;
lifetime = 60f;
}},
Items.silicon, new BasicBulletType(3f, 12){{
width = 7f;
height = 9f;
homingPower = 0.1f;
reloadMultiplier = 1.5f;
ammoMultiplier = 5;
lifetime = 60f;
}}
); );
shoot = new ShootAlternate(){{ shoot = new ShootAlternate(){{
@@ -2777,9 +2794,49 @@ public class Blocks{
scatter = new ItemTurret("scatter"){{ scatter = new ItemTurret("scatter"){{
requirements(Category.turret, with(Items.copper, 85, Items.lead, 45)); requirements(Category.turret, with(Items.copper, 85, Items.lead, 45));
ammo( ammo(
Items.scrap, Bullets.flakScrap, Items.scrap, new FlakBulletType(4f, 3){{
Items.lead, Bullets.flakLead, lifetime = 60f;
Items.metaglass, Bullets.flakGlass ammoMultiplier = 5f;
shootEffect = Fx.shootSmall;
reloadMultiplier = 0.5f;
width = 6f;
height = 8f;
hitEffect = Fx.flakExplosion;
splashDamage = 22f * 1.5f;
splashDamageRadius = 24f;
}},
Items.lead, new FlakBulletType(4.2f, 3){{
lifetime = 60f;
ammoMultiplier = 4f;
shootEffect = Fx.shootSmall;
width = 6f;
height = 8f;
hitEffect = Fx.flakExplosion;
splashDamage = 27f * 1.5f;
splashDamageRadius = 15f;
}},
Items.metaglass, new FlakBulletType(4f, 3){{
lifetime = 60f;
ammoMultiplier = 5f;
shootEffect = Fx.shootSmall;
reloadMultiplier = 0.8f;
width = 6f;
height = 8f;
hitEffect = Fx.flakExplosion;
splashDamage = 25f * 1.5f;
splashDamageRadius = 20f;
fragBullets = 6;
fragBullet = new BasicBulletType(3f, 5){{
width = 5f;
height = 12f;
shrinkY = 1f;
lifetime = 20f;
backColor = Pal.gray;
frontColor = Color.white;
despawnEffect = Fx.none;
collidesGround = false;
}};
}}
); );
reload = 18f; reload = 18f;
range = 220f; range = 220f;
@@ -2804,8 +2861,33 @@ public class Blocks{
scorch = new ItemTurret("scorch"){{ scorch = new ItemTurret("scorch"){{
requirements(Category.turret, with(Items.copper, 25, Items.graphite, 22)); requirements(Category.turret, with(Items.copper, 25, Items.graphite, 22));
ammo( ammo(
Items.coal, Bullets.basicFlame, Items.coal, new BulletType(3.35f, 17f){{
Items.pyratite, Bullets.pyraFlame ammoMultiplier = 3f;
hitSize = 7f;
lifetime = 18f;
pierce = true;
collidesAir = false;
statusDuration = 60f * 4;
shootEffect = Fx.shootSmallFlame;
hitEffect = Fx.hitFlameSmall;
despawnEffect = Fx.none;
status = StatusEffects.burning;
keepVelocity = false;
hittable = false;
}},
Items.pyratite, new BulletType(4f, 60f){{
ammoMultiplier = 6f;
hitSize = 7f;
lifetime = 18f;
pierce = true;
collidesAir = false;
statusDuration = 60f * 10;
shootEffect = Fx.shootPyraFlame;
hitEffect = Fx.hitFlameSmall;
despawnEffect = Fx.none;
status = StatusEffects.burning;
hittable = false;
}}
); );
recoilAmount = 0f; recoilAmount = 0f;
reload = 6f; reload = 6f;
@@ -2822,9 +2904,42 @@ public class Blocks{
hail = new ItemTurret("hail"){{ hail = new ItemTurret("hail"){{
requirements(Category.turret, with(Items.copper, 40, Items.graphite, 17)); requirements(Category.turret, with(Items.copper, 40, Items.graphite, 17));
ammo( ammo(
Items.graphite, Bullets.artilleryDense, Items.graphite, new ArtilleryBulletType(3f, 20){{
Items.silicon, Bullets.artilleryHoming, knockback = 0.8f;
Items.pyratite, Bullets.artilleryIncendiary lifetime = 80f;
width = height = 11f;
collidesTiles = false;
splashDamageRadius = 25f * 0.75f;
splashDamage = 33f;
}},
Items.silicon, new ArtilleryBulletType(3f, 20){{
knockback = 0.8f;
lifetime = 80f;
width = height = 11f;
collidesTiles = false;
splashDamageRadius = 25f * 0.75f;
splashDamage = 33f;
reloadMultiplier = 1.2f;
ammoMultiplier = 3f;
homingPower = 0.08f;
homingRange = 50f;
}},
Items.pyratite, new ArtilleryBulletType(3f, 25){{
hitEffect = Fx.blastExplosion;
knockback = 0.8f;
lifetime = 80f;
width = height = 13f;
collidesTiles = false;
splashDamageRadius = 25f * 0.75f;
splashDamage = 45f;
status = StatusEffects.burning;
statusDuration = 60f * 12f;
frontColor = Pal.lightishOrange;
backColor = Pal.lightOrange;
makeFire = true;
trailEffect = Fx.incendTrail;
ammoMultiplier = 4f;
}}
); );
targetAir = false; targetAir = false;
reload = 60f; reload = 60f;
@@ -2841,10 +2956,20 @@ public class Blocks{
wave = new LiquidTurret("wave"){{ wave = new LiquidTurret("wave"){{
requirements(Category.turret, with(Items.metaglass, 45, Items.lead, 75, Items.copper, 25)); requirements(Category.turret, with(Items.metaglass, 45, Items.lead, 75, Items.copper, 25));
ammo( ammo(
Liquids.water, Bullets.waterShot, Liquids.water,new LiquidBulletType(Liquids.water){{
Liquids.slag, Bullets.slagShot, knockback = 0.7f;
Liquids.cryofluid, Bullets.cryoShot, drag = 0.01f;
Liquids.oil, Bullets.oilShot }},
Liquids.slag, new LiquidBulletType(Liquids.slag){{
damage = 4;
drag = 0.01f;
}},
Liquids.cryofluid, new LiquidBulletType(Liquids.cryofluid){{
drag = 0.01f;
}},
Liquids.oil, new LiquidBulletType(Liquids.oil){{
drag = 0.01f;
}}
); );
size = 2; size = 2;
recoilAmount = 0f; recoilAmount = 0f;
@@ -2937,9 +3062,46 @@ public class Blocks{
swarmer = new ItemTurret("swarmer"){{ swarmer = new ItemTurret("swarmer"){{
requirements(Category.turret, with(Items.graphite, 35, Items.titanium, 35, Items.plastanium, 45, Items.silicon, 30)); requirements(Category.turret, with(Items.graphite, 35, Items.titanium, 35, Items.plastanium, 45, Items.silicon, 30));
ammo( ammo(
Items.blastCompound, Bullets.missileExplosive, Items.blastCompound, new MissileBulletType(3.7f, 10){{
Items.pyratite, Bullets.missileIncendiary, width = 8f;
Items.surgeAlloy, Bullets.missileSurge height = 8f;
shrinkY = 0f;
splashDamageRadius = 30f;
splashDamage = 30f * 1.5f;
ammoMultiplier = 5f;
hitEffect = Fx.blastExplosion;
despawnEffect = Fx.blastExplosion;
status = StatusEffects.blasted;
statusDuration = 60f;
}},
Items.pyratite, new MissileBulletType(3.7f, 12){{
frontColor = Pal.lightishOrange;
backColor = Pal.lightOrange;
width = 7f;
height = 8f;
shrinkY = 0f;
homingPower = 0.08f;
splashDamageRadius = 20f;
splashDamage = 30f * 1.5f;
makeFire = true;
ammoMultiplier = 5f;
hitEffect = Fx.blastExplosion;
status = StatusEffects.burning;
}},
Items.surgeAlloy, new MissileBulletType(3.7f, 18){{
width = 8f;
height = 8f;
shrinkY = 0f;
splashDamageRadius = 25f;
splashDamage = 25f * 1.4f;
hitEffect = Fx.blastExplosion;
despawnEffect = Fx.blastExplosion;
ammoMultiplier = 4f;
lightningDamage = 10;
lightning = 2;
lightningLength = 10;
}}
); );
shoot = new ShootAlternate(){{ shoot = new ShootAlternate(){{
@@ -2965,11 +3127,51 @@ public class Blocks{
salvo = new ItemTurret("salvo"){{ salvo = new ItemTurret("salvo"){{
requirements(Category.turret, with(Items.copper, 100, Items.graphite, 80, Items.titanium, 50)); requirements(Category.turret, with(Items.copper, 100, Items.graphite, 80, Items.titanium, 50));
ammo( ammo(
Items.copper, Bullets.standardCopper, Items.copper, new BasicBulletType(2.5f, 11){{
Items.graphite, Bullets.standardDense, width = 7f;
Items.pyratite, Bullets.standardIncendiary, height = 9f;
Items.silicon, Bullets.standardHoming, lifetime = 60f;
Items.thorium, Bullets.standardThorium ammoMultiplier = 2;
}},
Items.graphite, new BasicBulletType(3.5f, 20){{
width = 9f;
height = 12f;
reloadMultiplier = 0.6f;
ammoMultiplier = 4;
lifetime = 60f;
}},
Items.pyratite, new BasicBulletType(3.2f, 18){{
width = 10f;
height = 12f;
frontColor = Pal.lightishOrange;
backColor = Pal.lightOrange;
status = StatusEffects.burning;
hitEffect = new MultiEffect(Fx.hitBulletSmall, Fx.fireHit);
ammoMultiplier = 5;
splashDamage = 12f;
splashDamageRadius = 22f;
makeFire = true;
lifetime = 60f;
}},
Items.silicon, new BasicBulletType(3f, 15, "bullet"){{
width = 7f;
height = 9f;
homingPower = 0.1f;
reloadMultiplier = 1.5f;
ammoMultiplier = 5;
lifetime = 60f;
}},
Items.thorium, new BasicBulletType(4f, 29, "bullet"){{
width = 10f;
height = 13f;
shootEffect = Fx.shootBig;
smokeEffect = Fx.shootBigSmoke;
ammoMultiplier = 4;
lifetime = 60f;
}}
); );
size = 2; size = 2;
@@ -3008,10 +3210,50 @@ public class Blocks{
tsunami = new LiquidTurret("tsunami"){{ tsunami = new LiquidTurret("tsunami"){{
requirements(Category.turret, with(Items.metaglass, 100, Items.lead, 400, Items.titanium, 250, Items.thorium, 100)); requirements(Category.turret, with(Items.metaglass, 100, Items.lead, 400, Items.titanium, 250, Items.thorium, 100));
ammo( ammo(
Liquids.water, Bullets.heavyWaterShot, Liquids.water, new LiquidBulletType(Liquids.water){{
Liquids.slag, Bullets.heavySlagShot, lifetime = 49f;
Liquids.cryofluid, Bullets.heavyCryoShot, speed = 4f;
Liquids.oil, Bullets.heavyOilShot knockback = 1.7f;
puddleSize = 8f;
orbSize = 4f;
drag = 0.001f;
ammoMultiplier = 0.4f;
statusDuration = 60f * 4f;
damage = 0.2f;
}},
Liquids.slag, new LiquidBulletType(Liquids.slag){{
lifetime = 49f;
speed = 4f;
knockback = 1.3f;
puddleSize = 8f;
orbSize = 4f;
damage = 4.75f;
drag = 0.001f;
ammoMultiplier = 0.4f;
statusDuration = 60f * 4f;
}},
Liquids.cryofluid, new LiquidBulletType(Liquids.cryofluid){{
lifetime = 49f;
speed = 4f;
knockback = 1.3f;
puddleSize = 8f;
orbSize = 4f;
drag = 0.001f;
ammoMultiplier = 0.4f;
statusDuration = 60f * 4f;
damage = 0.2f;
}},
Liquids.oil, new LiquidBulletType(Liquids.oil){{
lifetime = 49f;
speed = 4f;
knockback = 1.3f;
puddleSize = 8f;
orbSize = 4f;
drag = 0.001f;
ammoMultiplier = 0.4f;
statusDuration = 60f * 4f;
damage = 0.2f;
}}
); );
size = 3; size = 3;
reload = 3f; reload = 3f;
@@ -3073,11 +3315,78 @@ public class Blocks{
ripple = new ItemTurret("ripple"){{ ripple = new ItemTurret("ripple"){{
requirements(Category.turret, with(Items.copper, 150, Items.graphite, 135, Items.titanium, 60)); requirements(Category.turret, with(Items.copper, 150, Items.graphite, 135, Items.titanium, 60));
ammo( ammo(
Items.graphite, Bullets.artilleryDense, Items.graphite, new ArtilleryBulletType(3f, 20){{
Items.silicon, Bullets.artilleryHoming, knockback = 0.8f;
Items.pyratite, Bullets.artilleryIncendiary, lifetime = 80f;
Items.blastCompound, Bullets.artilleryExplosive, width = height = 11f;
Items.plastanium, Bullets.artilleryPlastic collidesTiles = false;
splashDamageRadius = 25f * 0.75f;
splashDamage = 33f;
}},
Items.silicon, new ArtilleryBulletType(3f, 20){{
knockback = 0.8f;
lifetime = 80f;
width = height = 11f;
collidesTiles = false;
splashDamageRadius = 25f * 0.75f;
splashDamage = 33f;
reloadMultiplier = 1.2f;
ammoMultiplier = 3f;
homingPower = 0.08f;
homingRange = 50f;
}},
Items.pyratite, new ArtilleryBulletType(3f, 24){{
hitEffect = Fx.blastExplosion;
knockback = 0.8f;
lifetime = 80f;
width = height = 13f;
collidesTiles = false;
splashDamageRadius = 25f * 0.75f;
splashDamage = 45f;
status = StatusEffects.burning;
statusDuration = 60f * 12f;
frontColor = Pal.lightishOrange;
backColor = Pal.lightOrange;
makeFire = true;
trailEffect = Fx.incendTrail;
ammoMultiplier = 4f;
}},
Items.blastCompound, new ArtilleryBulletType(2f, 20, "shell"){{
hitEffect = Fx.blastExplosion;
knockback = 0.8f;
lifetime = 80f;
width = height = 14f;
collidesTiles = false;
ammoMultiplier = 4f;
splashDamageRadius = 45f * 0.75f;
splashDamage = 55f;
backColor = Pal.missileYellowBack;
frontColor = Pal.missileYellow;
status = StatusEffects.blasted;
}},
Items.plastanium, new ArtilleryBulletType(3.4f, 20, "shell"){{
hitEffect = Fx.plasticExplosion;
knockback = 1f;
lifetime = 80f;
width = height = 13f;
collidesTiles = false;
splashDamageRadius = 35f * 0.75f;
splashDamage = 45f;
fragBullet = new BasicBulletType(2.5f, 10, "bullet"){{
width = 10f;
height = 12f;
shrinkY = 1f;
lifetime = 15f;
backColor = Pal.plastaniumBack;
frontColor = Pal.plastaniumFront;
despawnEffect = Fx.none;
collidesAir = false;
}};
fragBullets = 10;
backColor = Pal.plastaniumBack;
frontColor = Pal.plastaniumFront;
}}
); );
targetAir = false; targetAir = false;
@@ -3104,10 +3413,68 @@ public class Blocks{
cyclone = new ItemTurret("cyclone"){{ cyclone = new ItemTurret("cyclone"){{
requirements(Category.turret, with(Items.copper, 200, Items.titanium, 125, Items.plastanium, 80)); requirements(Category.turret, with(Items.copper, 200, Items.titanium, 125, Items.plastanium, 80));
ammo( ammo(
Items.metaglass, Bullets.fragGlass, Items.metaglass, new FlakBulletType(4f, 9){{
Items.blastCompound, Bullets.fragExplosive, ammoMultiplier = 3f;
Items.plastanium, Bullets.fragPlastic, shootEffect = Fx.shootSmall;
Items.surgeAlloy, Bullets.fragSurge reloadMultiplier = 0.8f;
width = 6f;
height = 8f;
hitEffect = Fx.flakExplosion;
splashDamage = 28f * 1.5f;
splashDamageRadius = 22f;
fragBullet = new BasicBulletType(3f, 5, "bullet"){{
width = 5f;
height = 12f;
shrinkY = 1f;
lifetime = 20f;
backColor = Pal.gray;
frontColor = Color.white;
despawnEffect = Fx.none;
}};
fragBullets = 4;
explodeRange = 20f;
collidesGround = true;
}},
Items.blastCompound, new FlakBulletType(4f, 5){{
shootEffect = Fx.shootBig;
ammoMultiplier = 5f;
splashDamage = 26f * 1.5f;
splashDamageRadius = 60f;
collidesGround = true;
status = StatusEffects.blasted;
statusDuration = 60f;
}},
Items.plastanium, new FlakBulletType(4f, 6){{
splashDamageRadius = 40f;
splashDamage = 25f * 1.5f;
fragBullet = new BasicBulletType(2.5f, 12, "bullet"){{
width = 10f;
height = 12f;
shrinkY = 1f;
lifetime = 15f;
backColor = Pal.plastaniumBack;
frontColor = Pal.plastaniumFront;
despawnEffect = Fx.none;
}};
fragBullets = 6;
hitEffect = Fx.plasticExplosion;
frontColor = Pal.plastaniumFront;
backColor = Pal.plastaniumBack;
shootEffect = Fx.shootBig;
collidesGround = true;
explodeRange = 20f;
}},
Items.surgeAlloy, new FlakBulletType(4.5f, 13){{
ammoMultiplier = 5f;
splashDamage = 50f * 1.5f;
splashDamageRadius = 38f;
lightning = 2;
lightningLength = 7;
shootEffect = Fx.shootBig;
collidesGround = true;
explodeRange = 20f;
}}
); );
shootY = 8.75f; shootY = 8.75f;
shoot = new ShootBarrel(){{ shoot = new ShootBarrel(){{
@@ -3176,9 +3543,41 @@ public class Blocks{
spectre = new ItemTurret("spectre"){{ spectre = new ItemTurret("spectre"){{
requirements(Category.turret, with(Items.copper, 900, Items.graphite, 300, Items.surgeAlloy, 250, Items.plastanium, 175, Items.thorium, 250)); requirements(Category.turret, with(Items.copper, 900, Items.graphite, 300, Items.surgeAlloy, 250, Items.plastanium, 175, Items.thorium, 250));
ammo( ammo(
Items.graphite, Bullets.standardDenseBig, Items.graphite, new BasicBulletType(7.5f, 50){{
Items.pyratite, Bullets.standardIncendiaryBig, hitSize = 4.8f;
Items.thorium, Bullets.standardThoriumBig width = 15f;
height = 21f;
shootEffect = Fx.shootBig;
ammoMultiplier = 4;
reloadMultiplier = 1.7f;
knockback = 0.3f;
}},
Items.pyratite, new BasicBulletType(8f, 80){{
hitSize = 5;
width = 16f;
height = 23f;
shootEffect = Fx.shootBig;
pierceCap = 2;
pierceBuilding = true;
knockback = 0.7f;
}},
Items.thorium, new BasicBulletType(7f, 70){{
hitSize = 5;
width = 16f;
height = 21f;
frontColor = Pal.lightishOrange;
backColor = Pal.lightOrange;
status = StatusEffects.burning;
hitEffect = new MultiEffect(Fx.hitBulletSmall, Fx.fireHit);
shootEffect = Fx.shootBig;
makeFire = true;
pierceCap = 2;
pierceBuilding = true;
knockback = 0.6f;
ammoMultiplier = 3;
splashDamage = 20f;
splashDamageRadius = 25f;
}}
); );
reload = 7f; reload = 7f;
coolantMultiplier = 0.5f; coolantMultiplier = 0.5f;
+8 -448
View File
@@ -8,30 +8,17 @@ import mindustry.graphics.*;
public class Bullets{ public class Bullets{
public static BulletType public static BulletType
//artillery placeholder, spaceLiquid, damageLightning, damageLightningGround, fireball;
artilleryDense, artilleryPlastic, artilleryPlasticFrag, artilleryHoming, artilleryIncendiary, artilleryExplosive,
//flak
flakScrap, flakLead, flakGlass, flakGlassFrag,
//frag (flak-like but hits ground)
fragGlass, fragExplosive, fragPlastic, fragSurge, fragGlassFrag, fragPlasticFrag,
//missiles
missileExplosive, missileIncendiary, missileSurge,
//standard
standardCopper, standardDense, standardThorium, standardHoming, standardIncendiary,
standardDenseBig, standardThoriumBig, standardIncendiaryBig,
//liquid
waterShot, cryoShot, slagShot, oilShot, heavyWaterShot, heavyCryoShot, heavySlagShot, heavyOilShot, spaceLiquid,
//environment, misc.
damageLightning, damageLightningGround, fireball, basicFlame, pyraFlame;
public static void load(){ public static void load(){
placeholder = new BasicBulletType(2.5f, 9, "ohno"){{
width = 7f;
height = 9f;
lifetime = 60f;
ammoMultiplier = 2;
}};
//lightning bullets need to be initialized first. //lightning bullets need to be initialized first.
damageLightning = new BulletType(0.0001f, 0f){{ damageLightning = new BulletType(0.0001f, 0f){{
lifetime = Fx.lightning.lifetime; lifetime = Fx.lightning.lifetime;
@@ -47,435 +34,8 @@ public class Bullets{
damageLightningGround = damageLightning.copy(); damageLightningGround = damageLightning.copy();
damageLightningGround.collidesAir = false; damageLightningGround.collidesAir = false;
artilleryDense = new ArtilleryBulletType(3f, 20, "shell"){{
hitEffect = Fx.flakExplosion;
knockback = 0.8f;
lifetime = 80f;
width = height = 11f;
collidesTiles = false;
splashDamageRadius = 25f * 0.75f;
splashDamage = 33f;
}};
artilleryPlasticFrag = new BasicBulletType(2.5f, 10, "bullet"){{
width = 10f;
height = 12f;
shrinkY = 1f;
lifetime = 15f;
backColor = Pal.plastaniumBack;
frontColor = Pal.plastaniumFront;
despawnEffect = Fx.none;
collidesAir = false;
}};
artilleryPlastic = new ArtilleryBulletType(3.4f, 20, "shell"){{
hitEffect = Fx.plasticExplosion;
knockback = 1f;
lifetime = 80f;
width = height = 13f;
collidesTiles = false;
splashDamageRadius = 35f * 0.75f;
splashDamage = 45f;
fragBullet = artilleryPlasticFrag;
fragBullets = 10;
backColor = Pal.plastaniumBack;
frontColor = Pal.plastaniumFront;
}};
artilleryHoming = new ArtilleryBulletType(3f, 20, "shell"){{
hitEffect = Fx.flakExplosion;
knockback = 0.8f;
lifetime = 80f;
width = height = 11f;
collidesTiles = false;
splashDamageRadius = 25f * 0.75f;
splashDamage = 33f;
reloadMultiplier = 1.2f;
ammoMultiplier = 3f;
homingPower = 0.08f;
homingRange = 50f;
}};
artilleryIncendiary = new ArtilleryBulletType(3f, 20, "shell"){{
hitEffect = Fx.blastExplosion;
knockback = 0.8f;
lifetime = 80f;
width = height = 13f;
collidesTiles = false;
splashDamageRadius = 25f * 0.75f;
splashDamage = 40f;
status = StatusEffects.burning;
statusDuration = 60f * 12f;
frontColor = Pal.lightishOrange;
backColor = Pal.lightOrange;
makeFire = true;
trailEffect = Fx.incendTrail;
ammoMultiplier = 4f;
}};
artilleryExplosive = new ArtilleryBulletType(2f, 20, "shell"){{
hitEffect = Fx.blastExplosion;
knockback = 0.8f;
lifetime = 80f;
width = height = 14f;
collidesTiles = false;
ammoMultiplier = 4f;
splashDamageRadius = 45f * 0.75f;
splashDamage = 55f;
backColor = Pal.missileYellowBack;
frontColor = Pal.missileYellow;
status = StatusEffects.blasted;
}};
flakGlassFrag = new BasicBulletType(3f, 5, "bullet"){{
width = 5f;
height = 12f;
shrinkY = 1f;
lifetime = 20f;
backColor = Pal.gray;
frontColor = Color.white;
despawnEffect = Fx.none;
collidesGround = false;
}};
flakLead = new FlakBulletType(4.2f, 3){{
lifetime = 60f;
ammoMultiplier = 4f;
shootEffect = Fx.shootSmall;
width = 6f;
height = 8f;
hitEffect = Fx.flakExplosion;
splashDamage = 27f * 1.5f;
splashDamageRadius = 15f;
}};
flakScrap = new FlakBulletType(4f, 3){{
lifetime = 60f;
ammoMultiplier = 5f;
shootEffect = Fx.shootSmall;
reloadMultiplier = 0.5f;
width = 6f;
height = 8f;
hitEffect = Fx.flakExplosion;
splashDamage = 22f * 1.5f;
splashDamageRadius = 24f;
}};
flakGlass = new FlakBulletType(4f, 3){{
lifetime = 60f;
ammoMultiplier = 5f;
shootEffect = Fx.shootSmall;
reloadMultiplier = 0.8f;
width = 6f;
height = 8f;
hitEffect = Fx.flakExplosion;
splashDamage = 25f * 1.5f;
splashDamageRadius = 20f;
fragBullet = flakGlassFrag;
fragBullets = 6;
}};
fragGlassFrag = new BasicBulletType(3f, 5, "bullet"){{
width = 5f;
height = 12f;
shrinkY = 1f;
lifetime = 20f;
backColor = Pal.gray;
frontColor = Color.white;
despawnEffect = Fx.none;
}};
fragPlasticFrag = new BasicBulletType(2.5f, 12, "bullet"){{
width = 10f;
height = 12f;
shrinkY = 1f;
lifetime = 15f;
backColor = Pal.plastaniumBack;
frontColor = Pal.plastaniumFront;
despawnEffect = Fx.none;
}};
fragGlass = new FlakBulletType(4f, 9){{
ammoMultiplier = 3f;
shootEffect = Fx.shootSmall;
reloadMultiplier = 0.8f;
width = 6f;
height = 8f;
hitEffect = Fx.flakExplosion;
splashDamage = 28f * 1.5f;
splashDamageRadius = 22f;
fragBullet = fragGlassFrag;
fragBullets = 4;
explodeRange = 20f;
collidesGround = true;
}};
fragPlastic = new FlakBulletType(4f, 6){{
splashDamageRadius = 40f;
splashDamage = 25f * 1.5f;
fragBullet = fragPlasticFrag;
fragBullets = 6;
hitEffect = Fx.plasticExplosion;
frontColor = Pal.plastaniumFront;
backColor = Pal.plastaniumBack;
shootEffect = Fx.shootBig;
collidesGround = true;
explodeRange = 20f;
}};
fragExplosive = new FlakBulletType(4f, 5){{
shootEffect = Fx.shootBig;
ammoMultiplier = 5f;
splashDamage = 26f * 1.5f;
splashDamageRadius = 60f;
collidesGround = true;
status = StatusEffects.blasted;
statusDuration = 60f;
}};
fragSurge = new FlakBulletType(4.5f, 13){{
ammoMultiplier = 5f;
splashDamage = 50f * 1.5f;
splashDamageRadius = 38f;
lightning = 2;
lightningLength = 7;
shootEffect = Fx.shootBig;
collidesGround = true;
explodeRange = 20f;
}};
missileExplosive = new MissileBulletType(3.7f, 10){{
width = 8f;
height = 8f;
shrinkY = 0f;
splashDamageRadius = 30f;
splashDamage = 30f * 1.5f;
ammoMultiplier = 5f;
hitEffect = Fx.blastExplosion;
despawnEffect = Fx.blastExplosion;
status = StatusEffects.blasted;
statusDuration = 60f;
}};
missileIncendiary = new MissileBulletType(3.7f, 12){{
frontColor = Pal.lightishOrange;
backColor = Pal.lightOrange;
width = 7f;
height = 8f;
shrinkY = 0f;
homingPower = 0.08f;
splashDamageRadius = 20f;
splashDamage = 30f * 1.5f;
makeFire = true;
ammoMultiplier = 5f;
hitEffect = Fx.blastExplosion;
status = StatusEffects.burning;
}};
missileSurge = new MissileBulletType(3.7f, 18){{
width = 8f;
height = 8f;
shrinkY = 0f;
splashDamageRadius = 25f;
splashDamage = 25f * 1.4f;
hitEffect = Fx.blastExplosion;
despawnEffect = Fx.blastExplosion;
ammoMultiplier = 4f;
lightningDamage = 10;
lightning = 2;
lightningLength = 10;
}};
standardCopper = new BasicBulletType(2.5f, 9){{
width = 7f;
height = 9f;
lifetime = 60f;
shootEffect = Fx.shootSmall;
smokeEffect = Fx.shootSmallSmoke;
ammoMultiplier = 2;
}};
standardDense = new BasicBulletType(3.5f, 18){{
width = 9f;
height = 12f;
reloadMultiplier = 0.6f;
ammoMultiplier = 4;
lifetime = 60f;
}};
standardThorium = new BasicBulletType(4f, 29, "bullet"){{
width = 10f;
height = 13f;
shootEffect = Fx.shootBig;
smokeEffect = Fx.shootBigSmoke;
ammoMultiplier = 4;
lifetime = 60f;
}};
standardHoming = new BasicBulletType(3f, 12, "bullet"){{
width = 7f;
height = 9f;
homingPower = 0.1f;
reloadMultiplier = 1.5f;
ammoMultiplier = 5;
lifetime = 60f;
}};
standardIncendiary = new BasicBulletType(3.2f, 16, "bullet"){{
width = 10f;
height = 12f;
frontColor = Pal.lightishOrange;
backColor = Pal.lightOrange;
status = StatusEffects.burning;
hitEffect = new MultiEffect(Fx.hitBulletSmall, Fx.fireHit);
ammoMultiplier = 5;
splashDamage = 12f;
splashDamageRadius = 22f;
makeFire = true;
lifetime = 60f;
}};
standardDenseBig = new BasicBulletType(7.5f, 50, "bullet"){{
hitSize = 4.8f;
width = 15f;
height = 21f;
shootEffect = Fx.shootBig;
ammoMultiplier = 4;
reloadMultiplier = 1.7f;
knockback = 0.3f;
}};
standardThoriumBig = new BasicBulletType(8f, 80, "bullet"){{
hitSize = 5;
width = 16f;
height = 23f;
shootEffect = Fx.shootBig;
pierceCap = 2;
pierceBuilding = true;
knockback = 0.7f;
}};
standardIncendiaryBig = new BasicBulletType(7f, 70, "bullet"){{
hitSize = 5;
width = 16f;
height = 21f;
frontColor = Pal.lightishOrange;
backColor = Pal.lightOrange;
status = StatusEffects.burning;
hitEffect = new MultiEffect(Fx.hitBulletSmall, Fx.fireHit);
shootEffect = Fx.shootBig;
makeFire = true;
pierceCap = 2;
pierceBuilding = true;
knockback = 0.6f;
ammoMultiplier = 3;
splashDamage = 20f;
splashDamageRadius = 25f;
}};
fireball = new FireBulletType(1f, 4); fireball = new FireBulletType(1f, 4);
basicFlame = new BulletType(3.35f, 17f){{
ammoMultiplier = 3f;
hitSize = 7f;
lifetime = 18f;
pierce = true;
collidesAir = false;
statusDuration = 60f * 4;
shootEffect = Fx.shootSmallFlame;
hitEffect = Fx.hitFlameSmall;
despawnEffect = Fx.none;
status = StatusEffects.burning;
keepVelocity = false;
hittable = false;
}};
pyraFlame = new BulletType(4f, 60f){{
ammoMultiplier = 6f;
hitSize = 7f;
lifetime = 18f;
pierce = true;
collidesAir = false;
statusDuration = 60f * 10;
shootEffect = Fx.shootPyraFlame;
hitEffect = Fx.hitFlameSmall;
despawnEffect = Fx.none;
status = StatusEffects.burning;
hittable = false;
}};
waterShot = new LiquidBulletType(Liquids.water){{
knockback = 0.7f;
drag = 0.01f;
}};
cryoShot = new LiquidBulletType(Liquids.cryofluid){{
drag = 0.01f;
}};
slagShot = new LiquidBulletType(Liquids.slag){{
damage = 4;
drag = 0.01f;
}};
oilShot = new LiquidBulletType(Liquids.oil){{
drag = 0.01f;
}};
heavyWaterShot = new LiquidBulletType(Liquids.water){{
lifetime = 49f;
speed = 4f;
knockback = 1.7f;
puddleSize = 8f;
orbSize = 4f;
drag = 0.001f;
ammoMultiplier = 0.4f;
statusDuration = 60f * 4f;
damage = 0.2f;
}};
heavyCryoShot = new LiquidBulletType(Liquids.cryofluid){{
lifetime = 49f;
speed = 4f;
knockback = 1.3f;
puddleSize = 8f;
orbSize = 4f;
drag = 0.001f;
ammoMultiplier = 0.4f;
statusDuration = 60f * 4f;
damage = 0.2f;
}};
heavySlagShot = new LiquidBulletType(Liquids.slag){{
lifetime = 49f;
speed = 4f;
knockback = 1.3f;
puddleSize = 8f;
orbSize = 4f;
damage = 4.75f;
drag = 0.001f;
ammoMultiplier = 0.4f;
statusDuration = 60f * 4f;
}};
heavyOilShot = new LiquidBulletType(Liquids.oil){{
lifetime = 49f;
speed = 4f;
knockback = 1.3f;
puddleSize = 8f;
orbSize = 4f;
drag = 0.001f;
ammoMultiplier = 0.4f;
statusDuration = 60f * 4f;
damage = 0.2f;
}};
spaceLiquid = new SpaceLiquidBulletType(){{ spaceLiquid = new SpaceLiquidBulletType(){{
knockback = 0.7f; knockback = 0.7f;
drag = 0.01f; drag = 0.01f;
@@ -36,12 +36,12 @@ public class ErekirTechTree{
for(var bullet : item.ammoTypes.values()){ for(var bullet : item.ammoTypes.values()){
rebalanceBullet(bullet); rebalanceBullet(bullet);
} }
}else if(turret instanceof ContinuousTurret cont){
rebalanceBullet(cont.shootType);
}else if(turret instanceof ContinuousLiquidTurret cont){ }else if(turret instanceof ContinuousLiquidTurret cont){
for(var bullet : cont.ammoTypes.values()){ for(var bullet : cont.ammoTypes.values()){
rebalanceBullet(bullet); rebalanceBullet(bullet);
} }
}else if(turret instanceof ContinuousTurret cont){
rebalanceBullet(cont.shootType);
} }
} }
} }
+29 -6
View File
@@ -101,7 +101,11 @@ public class UnitTypes{
y = 2f; y = 2f;
top = false; top = false;
ejectEffect = Fx.casing1; ejectEffect = Fx.casing1;
bullet = Bullets.standardCopper; bullet = new BasicBulletType(2.5f, 9){{
width = 7f;
height = 9f;
lifetime = 60f;
}};
}}); }});
}}; }};
@@ -185,6 +189,12 @@ public class UnitTypes{
singleTarget = true; singleTarget = true;
drownTimeMultiplier = 4f; drownTimeMultiplier = 4f;
BulletType smallBullet = new BasicBulletType(3f, 10){{
width = 7f;
height = 9f;
lifetime = 50f;
}};
weapons.add( weapons.add(
new Weapon("scepter-weapon"){{ new Weapon("scepter-weapon"){{
top = false; top = false;
@@ -220,7 +230,7 @@ public class UnitTypes{
y = 6f; y = 6f;
rotate = true; rotate = true;
ejectEffect = Fx.casing1; ejectEffect = Fx.casing1;
bullet = Bullets.standardCopper; bullet = smallBullet;
}}, }},
new Weapon("mount-weapon"){{ new Weapon("mount-weapon"){{
reload = 16f; reload = 16f;
@@ -228,9 +238,8 @@ public class UnitTypes{
y = -7f; y = -7f;
rotate = true; rotate = true;
ejectEffect = Fx.casing1; ejectEffect = Fx.casing1;
bullet = Bullets.standardCopper; bullet = smallBullet;
}} }}
); );
}}; }};
@@ -1482,7 +1491,12 @@ public class UnitTypes{
y = 1.5f; y = 1.5f;
rotate = true; rotate = true;
ejectEffect = Fx.casing1; ejectEffect = Fx.casing1;
bullet = Bullets.standardCopper; bullet = new BasicBulletType(2.5f, 9){{
width = 7f;
height = 9f;
lifetime = 60f;
ammoMultiplier = 2;
}};
}}); }});
weapons.add(new Weapon("missiles-mount"){{ weapons.add(new Weapon("missiles-mount"){{
@@ -1539,7 +1553,16 @@ public class UnitTypes{
inaccuracy = 8f; inaccuracy = 8f;
ejectEffect = Fx.casing1; ejectEffect = Fx.casing1;
shootSound = Sounds.shoot; shootSound = Sounds.shoot;
bullet = Bullets.flakLead; bullet = new FlakBulletType(4.2f, 3){{
lifetime = 60f;
ammoMultiplier = 4f;
shootEffect = Fx.shootSmall;
width = 6f;
height = 8f;
hitEffect = Fx.flakExplosion;
splashDamage = 27f * 1.5f;
splashDamageRadius = 15f;
}};
}}); }});
weapons.add(new Weapon("artillery-mount"){{ weapons.add(new Weapon("artillery-mount"){{
@@ -16,6 +16,7 @@ public class ArtilleryBulletType extends BasicBulletType{
scaleVelocity = true; scaleVelocity = true;
hitShake = 1f; hitShake = 1f;
hitSound = Sounds.explosion; hitSound = Sounds.explosion;
hitEffect = Fx.flakExplosion;
shootEffect = Fx.shootBig; shootEffect = Fx.shootBig;
trailEffect = Fx.artilleryTrail; trailEffect = Fx.artilleryTrail;
+8
View File
@@ -423,6 +423,14 @@ public class UnitType extends UnlockableContent{
} }
} }
/*
for(int i = 0; i < weapons.size; i++){
var wep = weapons.get(i);
if(wep.bullet == Bullets.placeholder || wep.bullet == null){
throw new RuntimeException("Unit: " + name + ": weapon #" + i + " ('" + wep.name + "') does not have a bullet defined. Make sure you have a bullet: (JSON) or `bullet = ` field in your unit definition.");
}
}*/
if(pathCost == null){ if(pathCost == null){
pathCost = pathCost =
example instanceof WaterMovec ? ControlPathfinder.costNaval : example instanceof WaterMovec ? ControlPathfinder.costNaval :
+3 -1
View File
@@ -10,6 +10,7 @@ import arc.math.geom.*;
import arc.scene.ui.layout.*; import arc.scene.ui.layout.*;
import arc.struct.*; import arc.struct.*;
import arc.util.*; import arc.util.*;
import mindustry.annotations.Annotations.*;
import mindustry.audio.*; import mindustry.audio.*;
import mindustry.content.*; import mindustry.content.*;
import mindustry.entities.*; import mindustry.entities.*;
@@ -27,7 +28,7 @@ public class Weapon implements Cloneable{
/** displayed weapon region */ /** displayed weapon region */
public String name; public String name;
/** bullet shot */ /** bullet shot */
public BulletType bullet = Bullets.standardCopper; public BulletType bullet = Bullets.placeholder;
/** shell ejection effect */ /** shell ejection effect */
public Effect ejectEffect = Fx.none; public Effect ejectEffect = Fx.none;
/** whether to consume ammo when ammo is enabled in rules */ /** whether to consume ammo when ammo is enabled in rules */
@@ -427,6 +428,7 @@ public class Weapon implements Cloneable{
} }
} }
@CallSuper
public void init(){ public void init(){
} }
@@ -174,6 +174,7 @@ public class RepairBeamWeapon extends Weapon{
@Override @Override
public void init(){ public void init(){
super.init();
bullet.healPercent = fractionRepairSpeed; bullet.healPercent = fractionRepairSpeed;
} }
@@ -11,7 +11,7 @@ import mindustry.world.meta.*;
/** A turret that fires a continuous beam bullet with no reload or coolant necessary. The bullet only disappears when the turret stops shooting. */ /** A turret that fires a continuous beam bullet with no reload or coolant necessary. The bullet only disappears when the turret stops shooting. */
public class ContinuousTurret extends Turret{ public class ContinuousTurret extends Turret{
public BulletType shootType = Bullets.standardCopper; public BulletType shootType = Bullets.placeholder;
public ContinuousTurret(String name){ public ContinuousTurret(String name){
super(name); super(name);