From 94733515e4ab47f909fc051d49f16f3a766f7dbf Mon Sep 17 00:00:00 2001 From: Anuken Date: Mon, 30 Sep 2019 17:12:08 -0400 Subject: [PATCH] Reduced spirit factory to 1 drone, 2x power --- .../io/anuke/mindustry/content/Blocks.java | 10 ++-- .../io/anuke/mindustry/content/Bullets.java | 46 +++-------------- .../io/anuke/mindustry/content/UnitTypes.java | 6 +-- .../entities/bullet/HealBulletType.java | 50 +++++++++++++++++++ .../io/anuke/mindustry/ui/ItemsDisplay.java | 4 +- 5 files changed, 66 insertions(+), 50 deletions(-) create mode 100644 core/src/io/anuke/mindustry/entities/bullet/HealBulletType.java diff --git a/core/src/io/anuke/mindustry/content/Blocks.java b/core/src/io/anuke/mindustry/content/Blocks.java index 8362b3e0b2..a0ef28f4b8 100644 --- a/core/src/io/anuke/mindustry/content/Blocks.java +++ b/core/src/io/anuke/mindustry/content/Blocks.java @@ -1631,18 +1631,18 @@ public class Blocks implements ContentList{ produceTime = 2500; size = 2; maxSpawn = 1; - consumes.power(1.1f); + consumes.power(1.2f); consumes.items(); }}; spiritFactory = new UnitFactory("spirit-factory"){{ requirements(Category.units, ItemStack.with(Items.metaglass, 45, Items.lead, 55, Items.silicon, 45)); type = UnitTypes.spirit; - produceTime = 3500; + produceTime = 4000; size = 2; - maxSpawn = 2; - consumes.power(0.80f); - consumes.items(new ItemStack(Items.silicon, 15), new ItemStack(Items.lead, 15)); + maxSpawn = 1; + consumes.power(1.2f); + consumes.items(new ItemStack(Items.silicon, 30), new ItemStack(Items.lead, 30)); }}; phantomFactory = new UnitFactory("phantom-factory"){{ diff --git a/core/src/io/anuke/mindustry/content/Bullets.java b/core/src/io/anuke/mindustry/content/Bullets.java index dad4758000..68382f121c 100644 --- a/core/src/io/anuke/mindustry/content/Bullets.java +++ b/core/src/io/anuke/mindustry/content/Bullets.java @@ -8,11 +8,9 @@ import io.anuke.mindustry.entities.*; import io.anuke.mindustry.entities.bullet.*; import io.anuke.mindustry.entities.effect.*; import io.anuke.mindustry.entities.type.*; -import io.anuke.mindustry.entities.type.Bullet; import io.anuke.mindustry.game.*; import io.anuke.mindustry.graphics.*; import io.anuke.mindustry.world.*; -import io.anuke.mindustry.world.blocks.*; import static io.anuke.mindustry.Vars.*; @@ -39,7 +37,7 @@ public class Bullets implements ContentList{ waterShot, cryoShot, slagShot, oilShot, //environment, misc. - fireball, basicFlame, pyraFlame, driverBolt, healBullet, frag, eruptorShot, + fireball, basicFlame, pyraFlame, driverBolt, healBullet, healBulletBig, frag, eruptorShot, //bombs bombExplosive, bombIncendiary, bombOil; @@ -376,43 +374,13 @@ public class Bullets implements ContentList{ statusDuration = 10f; }}; - healBullet = new BulletType(5.2f, 13){ - float healPercent = 3f; + healBullet = new HealBulletType(5.2f, 13){{ + healPercent = 3f; + }}; - { - shootEffect = Fx.shootHeal; - smokeEffect = Fx.hitLaser; - hitEffect = Fx.hitLaser; - despawnEffect = Fx.hitLaser; - collidesTeam = true; - } - - @Override - public boolean collides(Bullet b, Tile tile){ - return tile.getTeam() != b.getTeam() || tile.entity.healthf() < 1f; - } - - @Override - public void draw(Bullet b){ - Draw.color(Pal.heal); - Lines.stroke(2f); - Lines.lineAngleCenter(b.x, b.y, b.rot(), 7f); - Draw.color(Color.white); - Lines.lineAngleCenter(b.x, b.y, b.rot(), 3f); - Draw.reset(); - } - - @Override - public void hitTile(Bullet b, Tile tile){ - super.hit(b); - tile = tile.link(); - - if(tile.entity != null && tile.getTeam() == b.getTeam() && !(tile.block() instanceof BuildBlock)){ - Effects.effect(Fx.healBlockFull, Pal.heal, tile.drawx(), tile.drawy(), tile.block().size); - tile.entity.healBy(healPercent / 100f * tile.entity.maxHealth()); - } - } - }; + healBulletBig = new HealBulletType(5.2f, 15){{ + healPercent = 5.5f; + }}; fireball = new BulletType(1f, 4){ { diff --git a/core/src/io/anuke/mindustry/content/UnitTypes.java b/core/src/io/anuke/mindustry/content/UnitTypes.java index 9d164438cb..a3b598efdd 100644 --- a/core/src/io/anuke/mindustry/content/UnitTypes.java +++ b/core/src/io/anuke/mindustry/content/UnitTypes.java @@ -35,10 +35,10 @@ public class UnitTypes implements ContentList{ spirit = new UnitType("spirit", Spirit::new){{ flying = true; drag = 0.01f; - speed = 0.4f; + speed = 0.42f; maxVelocity = 1.6f; range = 50f; - health = 60; + health = 100; engineSize = 1.8f; engineOffset = 5.7f; weapon = new Weapon("heal-blaster"){{ @@ -48,7 +48,7 @@ public class UnitTypes implements ContentList{ roundrobin = true; ejectEffect = Fx.none; recoil = 2f; - bullet = Bullets.healBullet; + bullet = Bullets.healBulletBig; shootSound = Sounds.pew; }}; }}; diff --git a/core/src/io/anuke/mindustry/entities/bullet/HealBulletType.java b/core/src/io/anuke/mindustry/entities/bullet/HealBulletType.java new file mode 100644 index 0000000000..dab576883c --- /dev/null +++ b/core/src/io/anuke/mindustry/entities/bullet/HealBulletType.java @@ -0,0 +1,50 @@ +package io.anuke.mindustry.entities.bullet; + +import io.anuke.arc.graphics.*; +import io.anuke.arc.graphics.g2d.*; +import io.anuke.mindustry.content.*; +import io.anuke.mindustry.entities.*; +import io.anuke.mindustry.entities.type.*; +import io.anuke.mindustry.graphics.*; +import io.anuke.mindustry.world.*; +import io.anuke.mindustry.world.blocks.*; + +public class HealBulletType extends BulletType{ + protected float healPercent = 3f; + + public HealBulletType(float speed, float damage){ + super(speed, damage); + + shootEffect = Fx.shootHeal; + smokeEffect = Fx.hitLaser; + hitEffect = Fx.hitLaser; + despawnEffect = Fx.hitLaser; + collidesTeam = true; + } + + @Override + public boolean collides(Bullet b, Tile tile){ + return tile.getTeam() != b.getTeam() || tile.entity.healthf() < 1f; + } + + @Override + public void draw(Bullet b){ + Draw.color(Pal.heal); + Lines.stroke(2f); + Lines.lineAngleCenter(b.x, b.y, b.rot(), 7f); + Draw.color(Color.white); + Lines.lineAngleCenter(b.x, b.y, b.rot(), 3f); + Draw.reset(); + } + + @Override + public void hitTile(Bullet b, Tile tile){ + super.hit(b); + tile = tile.link(); + + if(tile.entity != null && tile.getTeam() == b.getTeam() && !(tile.block() instanceof BuildBlock)){ + Effects.effect(Fx.healBlockFull, Pal.heal, tile.drawx(), tile.drawy(), tile.block().size); + tile.entity.healBy(healPercent / 100f * tile.entity.maxHealth()); + } + } +} diff --git a/core/src/io/anuke/mindustry/ui/ItemsDisplay.java b/core/src/io/anuke/mindustry/ui/ItemsDisplay.java index b0da71ec09..b9c26d0974 100644 --- a/core/src/io/anuke/mindustry/ui/ItemsDisplay.java +++ b/core/src/io/anuke/mindustry/ui/ItemsDisplay.java @@ -28,9 +28,7 @@ public class ItemsDisplay extends Table{ table(Tex.button,t -> { t.margin(10).marginLeft(15).marginTop(15f); - t.add("$launcheditems").colspan(3).left(); - t.row(); - t.label(() -> state.is(State.menu) ? "" : "$launchinfo").colspan(3).width(210f).wrap().padBottom(4).left(); + t.label(() -> state.is(State.menu) ? "$launcheditems" : "$launchinfo").colspan(3).padBottom(4).left().colspan(3).width(210f).wrap(); t.row(); for(Item item : content.items()){ if(item.type == ItemType.material && data.isUnlocked(item)){