Polar Aerodrome sector submission / Shields absorb unit wrecks
This commit is contained in:
@@ -833,6 +833,7 @@ sector.infestedCanyons.name = Infested Canyons
|
|||||||
sector.planetaryTerminal.name = Planetary Launch Terminal
|
sector.planetaryTerminal.name = Planetary Launch Terminal
|
||||||
sector.coastline.name = Coastline
|
sector.coastline.name = Coastline
|
||||||
sector.navalFortress.name = Naval Fortress
|
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.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.
|
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.facility32m.description = WIP, map submission by Stormride_R
|
||||||
sector.taintedWoods.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.infestedCanyons.description = WIP, map submission by Skeledragon
|
||||||
|
sector.polarAerodrome.description = WIP, map submission by hhh i 17
|
||||||
|
|
||||||
sector.onset.name = The Onset
|
sector.onset.name = The Onset
|
||||||
sector.aegis.name = Aegis
|
sector.aegis.name = Aegis
|
||||||
|
|||||||
BIN
core/assets/maps/polarAerodrome.msav
Normal file
BIN
core/assets/maps/polarAerodrome.msav
Normal file
Binary file not shown.
@@ -1889,21 +1889,21 @@ public class Blocks{
|
|||||||
|
|
||||||
titaniumConveyor = new Conveyor("titanium-conveyor"){{
|
titaniumConveyor = new Conveyor("titanium-conveyor"){{
|
||||||
requirements(Category.distribution, with(Items.copper, 1, Items.lead, 1, Items.titanium, 1));
|
requirements(Category.distribution, with(Items.copper, 1, Items.lead, 1, Items.titanium, 1));
|
||||||
health = 65;
|
health = 70;
|
||||||
speed = 0.08f;
|
speed = 0.08f;
|
||||||
displayedSpeed = 11f;
|
displayedSpeed = 11f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
plastaniumConveyor = new StackConveyor("plastanium-conveyor"){{
|
plastaniumConveyor = new StackConveyor("plastanium-conveyor"){{
|
||||||
requirements(Category.distribution, with(Items.plastanium, 1, Items.silicon, 1, Items.graphite, 1));
|
requirements(Category.distribution, with(Items.plastanium, 1, Items.silicon, 1, Items.graphite, 1));
|
||||||
health = 75;
|
health = 90;
|
||||||
speed = 4f / 60f;
|
speed = 4f / 60f;
|
||||||
itemCapacity = 10;
|
itemCapacity = 10;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
armoredConveyor = new ArmoredConveyor("armored-conveyor"){{
|
armoredConveyor = new ArmoredConveyor("armored-conveyor"){{
|
||||||
requirements(Category.distribution, with(Items.plastanium, 1, Items.thorium, 1, Items.metaglass, 1));
|
requirements(Category.distribution, with(Items.plastanium, 1, Items.thorium, 1, Items.metaglass, 1));
|
||||||
health = 180;
|
health = 280;
|
||||||
speed = 0.08f;
|
speed = 0.08f;
|
||||||
displayedSpeed = 11f;
|
displayedSpeed = 11f;
|
||||||
}};
|
}};
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ public class SectorPresets{
|
|||||||
public static SectorPreset
|
public static SectorPreset
|
||||||
groundZero,
|
groundZero,
|
||||||
craters, biomassFacility, taintedWoods, frozenForest, ruinousShores, facility32m, windsweptIslands, stainedMountains, tarFields,
|
craters, biomassFacility, taintedWoods, frozenForest, ruinousShores, facility32m, windsweptIslands, stainedMountains, tarFields,
|
||||||
fungalPass, infestedCanyons, extractionOutpost, saltFlats, overgrowth,
|
fungalPass, infestedCanyons, extractionOutpost, polarAerodrome, saltFlats, overgrowth,
|
||||||
impact0078, desolateRift, nuclearComplex, planetaryTerminal,
|
impact0078, desolateRift, nuclearComplex, planetaryTerminal,
|
||||||
coastline, navalFortress,
|
coastline, navalFortress,
|
||||||
|
|
||||||
@@ -76,6 +76,10 @@ public class SectorPresets{
|
|||||||
difficulty = 5;
|
difficulty = 5;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
polarAerodrome = new SectorPreset("polarAerodrome", serpulo, 68){{
|
||||||
|
difficulty = 7;
|
||||||
|
}};
|
||||||
|
|
||||||
coastline = new SectorPreset("coastline", serpulo, 108){{
|
coastline = new SectorPreset("coastline", serpulo, 108){{
|
||||||
captureWave = 30;
|
captureWave = 30;
|
||||||
difficulty = 5;
|
difficulty = 5;
|
||||||
|
|||||||
@@ -378,7 +378,7 @@ public class SerpuloTechTree{
|
|||||||
node(flare, () -> {
|
node(flare, () -> {
|
||||||
node(horizon, () -> {
|
node(horizon, () -> {
|
||||||
node(zenith, () -> {
|
node(zenith, () -> {
|
||||||
node(antumbra, () -> {
|
node(antumbra, Seq.with(new SectorComplete(polarAerodrome)), () -> {
|
||||||
node(eclipse, () -> {
|
node(eclipse, () -> {
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -514,7 +514,17 @@ public class SerpuloTechTree{
|
|||||||
new Research(airFactory),
|
new Research(airFactory),
|
||||||
new Research(mono)
|
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)
|
||||||
|
), () -> {
|
||||||
|
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -25,8 +25,10 @@ import mindustry.logic.*;
|
|||||||
import mindustry.type.*;
|
import mindustry.type.*;
|
||||||
import mindustry.ui.*;
|
import mindustry.ui.*;
|
||||||
import mindustry.world.*;
|
import mindustry.world.*;
|
||||||
|
import mindustry.world.blocks.*;
|
||||||
import mindustry.world.blocks.environment.*;
|
import mindustry.world.blocks.environment.*;
|
||||||
import mindustry.world.blocks.payloads.*;
|
import mindustry.world.blocks.payloads.*;
|
||||||
|
import mindustry.world.meta.*;
|
||||||
|
|
||||||
import static mindustry.Vars.*;
|
import static mindustry.Vars.*;
|
||||||
import static mindustry.logic.GlobalVars.*;
|
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 this unit crash landed (was flying), damage stuff in a radius
|
||||||
if(type.flying && !spawnedByCore && type.createWreck && state.rules.unitCrashDamage(team) > 0){
|
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){
|
if(!headless && type.createScorch){
|
||||||
|
|||||||
9
core/src/mindustry/world/blocks/UnitWreckShield.java
Normal file
9
core/src/mindustry/world/blocks/UnitWreckShield.java
Normal file
@@ -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);
|
||||||
|
}
|
||||||
@@ -19,6 +19,7 @@ import mindustry.graphics.*;
|
|||||||
import mindustry.logic.*;
|
import mindustry.logic.*;
|
||||||
import mindustry.ui.*;
|
import mindustry.ui.*;
|
||||||
import mindustry.world.*;
|
import mindustry.world.*;
|
||||||
|
import mindustry.world.blocks.*;
|
||||||
import mindustry.world.consumers.*;
|
import mindustry.world.consumers.*;
|
||||||
import mindustry.world.meta.*;
|
import mindustry.world.meta.*;
|
||||||
|
|
||||||
@@ -68,6 +69,7 @@ public class ForceProjector extends Block{
|
|||||||
envEnabled |= Env.space;
|
envEnabled |= Env.space;
|
||||||
ambientSound = Sounds.shield;
|
ambientSound = Sounds.shield;
|
||||||
ambientSoundVolume = 0.08f;
|
ambientSoundVolume = 0.08f;
|
||||||
|
flags = EnumSet.of(BlockFlag.shield);
|
||||||
|
|
||||||
if(consumeCoolant){
|
if(consumeCoolant){
|
||||||
consume(coolantConsumer = new ConsumeCoolant(coolantConsumption)).boost().update(false);
|
consume(coolantConsumer = new ConsumeCoolant(coolantConsumption)).boost().update(false);
|
||||||
@@ -120,7 +122,7 @@ public class ForceProjector extends Block{
|
|||||||
Draw.color();
|
Draw.color();
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ForceBuild extends Building implements Ranged{
|
public class ForceBuild extends Building implements Ranged, UnitWreckShield{
|
||||||
public boolean broken = true;
|
public boolean broken = true;
|
||||||
public float buildup, radscl, hit, warmup, phaseHeat;
|
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(){
|
public float realRadius(){
|
||||||
return (radius + phaseHeat * phaseRadiusBoost) * radscl;
|
return (radius + phaseHeat * phaseRadiusBoost) * radscl;
|
||||||
}
|
}
|
||||||
@@ -238,7 +251,7 @@ public class ForceProjector extends Block{
|
|||||||
Draw.z(Layer.block);
|
Draw.z(Layer.block);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
drawShield();
|
drawShield();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ public enum BlockFlag{
|
|||||||
extinguisher,
|
extinguisher,
|
||||||
/** Is a drill. */
|
/** Is a drill. */
|
||||||
drill,
|
drill,
|
||||||
|
/** Force projector block. */
|
||||||
|
shield,
|
||||||
|
|
||||||
//special, internal identifiers
|
//special, internal identifiers
|
||||||
launchPad,
|
launchPad,
|
||||||
@@ -32,5 +34,5 @@ public enum BlockFlag{
|
|||||||
public final static BlockFlag[] all = values();
|
public final static BlockFlag[] all = values();
|
||||||
|
|
||||||
/** Values for logic only. Filters out some internal flags. */
|
/** 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};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user