diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index f997ca75e0..b02f1d641e 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -833,6 +833,7 @@ sector.infestedCanyons.name = Infested Canyons sector.planetaryTerminal.name = Planetary Launch Terminal sector.coastline.name = Coastline sector.navalFortress.name = Naval Fortress +sector.polarAerodrome.name = Polar Aerodrome sector.groundZero.description = The optimal location to begin once more. Low enemy threat. Few resources.\nGather as much lead and copper as possible.\nMove on. sector.frozenForest.description = Even here, closer to mountains, the spores have spread. The frigid temperatures cannot contain them forever.\n\nBegin the venture into power. Build combustion generators. Learn to use menders. @@ -856,6 +857,7 @@ sector.navalFortress.description = The enemy has established a base on a remote, sector.facility32m.description = WIP, map submission by Stormride_R sector.taintedWoods.description = WIP, map submission by Stormride_R sector.infestedCanyons.description = WIP, map submission by Skeledragon +sector.polarAerodrome.description = WIP, map submission by hhh i 17 sector.onset.name = The Onset sector.aegis.name = Aegis diff --git a/core/assets/maps/polarAerodrome.msav b/core/assets/maps/polarAerodrome.msav new file mode 100644 index 0000000000..a4137801c8 Binary files /dev/null and b/core/assets/maps/polarAerodrome.msav differ diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index f3a2d9332b..82b80e12b8 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -1889,21 +1889,21 @@ public class Blocks{ titaniumConveyor = new Conveyor("titanium-conveyor"){{ requirements(Category.distribution, with(Items.copper, 1, Items.lead, 1, Items.titanium, 1)); - health = 65; + health = 70; speed = 0.08f; displayedSpeed = 11f; }}; plastaniumConveyor = new StackConveyor("plastanium-conveyor"){{ requirements(Category.distribution, with(Items.plastanium, 1, Items.silicon, 1, Items.graphite, 1)); - health = 75; + health = 90; speed = 4f / 60f; itemCapacity = 10; }}; armoredConveyor = new ArmoredConveyor("armored-conveyor"){{ requirements(Category.distribution, with(Items.plastanium, 1, Items.thorium, 1, Items.metaglass, 1)); - health = 180; + health = 280; speed = 0.08f; displayedSpeed = 11f; }}; diff --git a/core/src/mindustry/content/SectorPresets.java b/core/src/mindustry/content/SectorPresets.java index 1e39b41105..75c991be2a 100644 --- a/core/src/mindustry/content/SectorPresets.java +++ b/core/src/mindustry/content/SectorPresets.java @@ -8,7 +8,7 @@ public class SectorPresets{ public static SectorPreset groundZero, craters, biomassFacility, taintedWoods, frozenForest, ruinousShores, facility32m, windsweptIslands, stainedMountains, tarFields, - fungalPass, infestedCanyons, extractionOutpost, saltFlats, overgrowth, + fungalPass, infestedCanyons, extractionOutpost, polarAerodrome, saltFlats, overgrowth, impact0078, desolateRift, nuclearComplex, planetaryTerminal, coastline, navalFortress, @@ -76,6 +76,10 @@ public class SectorPresets{ difficulty = 5; }}; + polarAerodrome = new SectorPreset("polarAerodrome", serpulo, 68){{ + difficulty = 7; + }}; + coastline = new SectorPreset("coastline", serpulo, 108){{ captureWave = 30; difficulty = 5; diff --git a/core/src/mindustry/content/SerpuloTechTree.java b/core/src/mindustry/content/SerpuloTechTree.java index ec0973bf36..c12fbde589 100644 --- a/core/src/mindustry/content/SerpuloTechTree.java +++ b/core/src/mindustry/content/SerpuloTechTree.java @@ -378,7 +378,7 @@ public class SerpuloTechTree{ node(flare, () -> { node(horizon, () -> { node(zenith, () -> { - node(antumbra, () -> { + node(antumbra, Seq.with(new SectorComplete(polarAerodrome)), () -> { node(eclipse, () -> { }); @@ -514,7 +514,17 @@ public class SerpuloTechTree{ new Research(airFactory), new Research(mono) ), () -> { + node(polarAerodrome, Seq.with( + new SectorComplete(fungalPass), + new SectorComplete(overgrowth), + new Research(multiplicativeReconstructor), + new Research(zenith), + new Research(swarmer), + new Research(cyclone), + new Research(blastDrill) + ), () -> { + }); }); }); diff --git a/core/src/mindustry/entities/comp/UnitComp.java b/core/src/mindustry/entities/comp/UnitComp.java index ffa2bc3592..f5cc151a2c 100644 --- a/core/src/mindustry/entities/comp/UnitComp.java +++ b/core/src/mindustry/entities/comp/UnitComp.java @@ -25,8 +25,10 @@ import mindustry.logic.*; import mindustry.type.*; import mindustry.ui.*; import mindustry.world.*; +import mindustry.world.blocks.*; import mindustry.world.blocks.environment.*; import mindustry.world.blocks.payloads.*; +import mindustry.world.meta.*; import static mindustry.Vars.*; import static mindustry.logic.GlobalVars.*; @@ -713,7 +715,11 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I //if this unit crash landed (was flying), damage stuff in a radius if(type.flying && !spawnedByCore && type.createWreck && state.rules.unitCrashDamage(team) > 0){ - Damage.damage(team, x, y, Mathf.pow(hitSize, 0.94f) * 1.25f, Mathf.pow(hitSize, 0.75f) * type.crashDamageMultiplier * 5f * state.rules.unitCrashDamage(team), true, false, true); + var shields = indexer.getEnemy(team, BlockFlag.shield); + float crashDamage = Mathf.pow(hitSize, 0.75f) * type.crashDamageMultiplier * 5f * state.rules.unitCrashDamage(team); + if(shields.isEmpty() || !shields.contains(b -> b instanceof UnitWreckShield s && s.absorbWreck(self(), crashDamage))){ + Damage.damage(team, x, y, Mathf.pow(hitSize, 0.94f) * 1.25f, crashDamage, true, false, true); + } } if(!headless && type.createScorch){ diff --git a/core/src/mindustry/world/blocks/UnitWreckShield.java b/core/src/mindustry/world/blocks/UnitWreckShield.java new file mode 100644 index 0000000000..062320cef2 --- /dev/null +++ b/core/src/mindustry/world/blocks/UnitWreckShield.java @@ -0,0 +1,9 @@ +package mindustry.world.blocks; + +import mindustry.gen.*; + +//TODO: horrible API design, but I'm not sure of a better way to do this right now. please don't use this class +public interface UnitWreckShield{ + /** @return whether the shield was able to absorb the unit wreck; this should apply damage to the shield if true is returned. */ + boolean absorbWreck(Unit unit, float damage); +} diff --git a/core/src/mindustry/world/blocks/defense/ForceProjector.java b/core/src/mindustry/world/blocks/defense/ForceProjector.java index 58ee4b6c2d..96d7efcb92 100644 --- a/core/src/mindustry/world/blocks/defense/ForceProjector.java +++ b/core/src/mindustry/world/blocks/defense/ForceProjector.java @@ -19,6 +19,7 @@ import mindustry.graphics.*; import mindustry.logic.*; import mindustry.ui.*; import mindustry.world.*; +import mindustry.world.blocks.*; import mindustry.world.consumers.*; import mindustry.world.meta.*; @@ -68,6 +69,7 @@ public class ForceProjector extends Block{ envEnabled |= Env.space; ambientSound = Sounds.shield; ambientSoundVolume = 0.08f; + flags = EnumSet.of(BlockFlag.shield); if(consumeCoolant){ consume(coolantConsumer = new ConsumeCoolant(coolantConsumption)).boost().update(false); @@ -120,7 +122,7 @@ public class ForceProjector extends Block{ Draw.color(); } - public class ForceBuild extends Building implements Ranged{ + public class ForceBuild extends Building implements Ranged, UnitWreckShield{ public boolean broken = true; public float buildup, radscl, hit, warmup, phaseHeat; @@ -214,6 +216,17 @@ public class ForceProjector extends Block{ } } + @Override + public boolean absorbWreck(Unit unit, float damage){ + boolean absorb = !broken && Intersector.isInRegularPolygon(sides, x, y, realRadius(), shieldRotation, unit.x, unit.y); + if(absorb){ + absorbEffect.at(unit); + hit = 1f; + buildup += damage; + } + return absorb; + } + public float realRadius(){ return (radius + phaseHeat * phaseRadiusBoost) * radscl; } @@ -238,7 +251,7 @@ public class ForceProjector extends Block{ Draw.z(Layer.block); Draw.reset(); } - + drawShield(); } diff --git a/core/src/mindustry/world/meta/BlockFlag.java b/core/src/mindustry/world/meta/BlockFlag.java index 257fa0c20a..82d073a780 100644 --- a/core/src/mindustry/world/meta/BlockFlag.java +++ b/core/src/mindustry/world/meta/BlockFlag.java @@ -22,6 +22,8 @@ public enum BlockFlag{ extinguisher, /** Is a drill. */ drill, + /** Force projector block. */ + shield, //special, internal identifiers launchPad, @@ -32,5 +34,5 @@ public enum BlockFlag{ public final static BlockFlag[] all = values(); /** Values for logic only. Filters out some internal flags. */ - public final static BlockFlag[] allLogic = {core, storage, generator, turret, factory, repair, battery, reactor, drill}; + public final static BlockFlag[] allLogic = {core, storage, generator, turret, factory, repair, battery, reactor, drill, shield}; }