From bf3b2c83099e4a7da14549193f6dc27eaf3a6b31 Mon Sep 17 00:00:00 2001 From: GlennFolker Date: Mon, 12 Oct 2020 08:31:01 +0700 Subject: [PATCH] donald trump --- src/mw/content/MWBlocks.java | 60 ++++++++++++++----- src/mw/content/MWItems.java | 12 ++-- src/mw/content/MWLiquids.java | 2 +- .../world/blocks/defense/InsulatorWall.java | 20 +++++++ .../world/blocks/defense/ReinforcedWall.java | 35 +++++++++++ 5 files changed, 108 insertions(+), 21 deletions(-) create mode 100644 src/mw/world/blocks/defense/ReinforcedWall.java diff --git a/src/mw/content/MWBlocks.java b/src/mw/content/MWBlocks.java index 744fdf77..6927f046 100644 --- a/src/mw/content/MWBlocks.java +++ b/src/mw/content/MWBlocks.java @@ -15,17 +15,17 @@ public class MWBlocks implements ContentList{ public static Block - //environment - lava, contaminatedWater, deepContaminatedWater, darksandContaminatedWater, sandContaminatedWater, + //environment + lava, contaminatedWater, deepContaminatedWater, darksandContaminatedWater, sandContaminatedWater, - //ores - oreIron, oreAluminum, oreUranium, + //ores + oreIron, oreAluminum, oreUranium, - //defense - insulatorWall, insulatorWallLarge, reinforcedWall, reinforcedWallLarge, steelWall, steelWallLarge, + //defense + insulatorWall, insulatorWallLarge, reinforcedWall, reinforcedWallLarge, steelWall, steelWallLarge, - //transport - aluminumConveyor, ironConveyor; + //transport + aluminumConveyor, ironConveyor; @Override public void load(){ @@ -131,13 +131,45 @@ public void load(){ //region defense insulatorWall = new InsulatorWall("insulator-wall"){{ - requirements(Category.defense, with(MWItems.insulationPlate, 1)); + requirements(Category.defense, with(MWItems.insulationPlate, 6)); - health = 1000; - solid = true; - sync = true; - update = true; - powerProduction = 2; + health = 900; + powerProduction = 2f; + }}; + + insulatorWallLarge = new InsulatorWall("insulator-wall-large"){{ + requirements(Category.defense, with(MWItems.insulationPlate, 24)); + + size = 2; + health = 3600; + powerProduction = 4f; + energyMultiplier = 30f; + }}; + + reinforcedWall = new ReinforcedWall("reinforced-wall"){{ + requirements(Category.defense, with(MWItems.iron, 6, Items.surgealloy, 4, MWItems.uranium, 3, Items.phasefabric, 1)); + + health = 1280; + }}; + + reinforcedWallLarge = new ReinforcedWall("reinforced-wall-large"){{ + requirements(Category.defense, with(MWItems.iron, 24, Items.surgealloy, 16, MWItems.uranium, 12, Items.phasefabric, 4)); + + size = 2; + health = 5120; + }}; + + steelWall = new Wall("steel-wall"){{ + requirements(Category.defense, with(MWItems.steel, 6)); + + health = 560; + }}; + + steelWallLarge = new Wall("steel-wall-large"){{ + requirements(Category.defense, with(MWItems.steel, 24)); + + size = 2; + health = 2240; }}; //end region diff --git a/src/mw/content/MWItems.java b/src/mw/content/MWItems.java index 5914f0b3..fd7cb9d5 100644 --- a/src/mw/content/MWItems.java +++ b/src/mw/content/MWItems.java @@ -7,12 +7,12 @@ public class MWItems implements ContentList{ public static Item - gravel, iron, aluminum, uranium, - steel, scrapPlate, insulationPlate, - apShell, heShell, - alienSporePod, radioactiveSporePod, - mk2Module, - coil, sulfur; + gravel, iron, aluminum, uranium, + steel, scrapPlate, insulationPlate, + apShell, heShell, + alienSporePod, radioactiveSporePod, + mk2Module, + coil, sulfur; @Override public void load(){ diff --git a/src/mw/content/MWLiquids.java b/src/mw/content/MWLiquids.java index 7570675f..9faf4868 100644 --- a/src/mw/content/MWLiquids.java +++ b/src/mw/content/MWLiquids.java @@ -8,7 +8,7 @@ public class MWLiquids implements ContentList{ public static Liquid - lava, contaminatedWater, acid, gas; + lava, contaminatedWater, acid, gas; @Override public void load(){ diff --git a/src/mw/world/blocks/defense/InsulatorWall.java b/src/mw/world/blocks/defense/InsulatorWall.java index 35f3b5a9..8ad2ef76 100644 --- a/src/mw/world/blocks/defense/InsulatorWall.java +++ b/src/mw/world/blocks/defense/InsulatorWall.java @@ -4,6 +4,7 @@ import arc.math.*; import arc.struct.*; import arc.util.*; +import arc.util.io.*; import mindustry.entities.bullet.*; import mindustry.gen.*; import mindustry.graphics.*; @@ -24,6 +25,8 @@ public class InsulatorWall extends Wall{ public InsulatorWall(String name){ super(name); + update = true; + sync = true; insulated = true; flashHit = true; consumesPower = false; @@ -64,5 +67,22 @@ public boolean collision(Bullet bullet){ return super.collision(bullet); } + + @Override + public float getPowerProduction(){ + return powerProduction * productionEfficiency; + } + + @Override + public void write(Writes write){ + super.write(write); + write.f(productionEfficiency); + } + + @Override + public void read(Reads read){ + super.read(read); + productionEfficiency = read.f(); + } } } diff --git a/src/mw/world/blocks/defense/ReinforcedWall.java b/src/mw/world/blocks/defense/ReinforcedWall.java new file mode 100644 index 00000000..575425ca --- /dev/null +++ b/src/mw/world/blocks/defense/ReinforcedWall.java @@ -0,0 +1,35 @@ +package mw.world.blocks.defense; + +import arc.graphics.*; +import mindustry.content.*; +import mindustry.entities.*; +import mindustry.world.blocks.defense.*; + +public class ReinforcedWall extends Wall{ + /** Delay at which the block heals itself */ + public float healTime = 90f; + /** Fraction of heal power, 1.0 is equivalent 100% */ + public float healPower = 1f / 15f; + + public Effect healEffect = Fx.healBlockFull; + public Color healColor = Color.valueOf("efefff"); + public int healTimer = timers++; + + public ReinforcedWall(String name){ + super(name); + update = true; + sync = true; + } + + public class ReinforcedWallBuild extends WallBuild{ + @Override + public void updateTile(){ + super.updateTile(); + + if(timer(healTimer, healTime)){ + heal(maxHealth() / healPower); + healEffect.at(x, y, rotation, healColor, size); + } + } + } +}