From 7a2a6586becd96c6fcc45b8ac726e25c69a39b37 Mon Sep 17 00:00:00 2001 From: Anuken Date: Sat, 13 Apr 2019 17:45:53 -0400 Subject: [PATCH] Fixed nuclear reactor not exploding properly --- core/src/io/anuke/mindustry/entities/Damage.java | 8 +++++--- .../anuke/mindustry/world/blocks/power/ImpactReactor.java | 4 ++-- .../mindustry/world/blocks/power/NuclearReactor.java | 5 ++--- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/core/src/io/anuke/mindustry/entities/Damage.java b/core/src/io/anuke/mindustry/entities/Damage.java index ea05ff7997..91631ccad4 100644 --- a/core/src/io/anuke/mindustry/entities/Damage.java +++ b/core/src/io/anuke/mindustry/entities/Damage.java @@ -224,10 +224,12 @@ public class Damage{ //apply damage to entity if needed if(tile.entity != null && tile.getTeam() != team){ int health = (int)tile.entity.health; - tile.entity.damage(scaledDamage); - scaledDamage -= health; + if(tile.entity.health > 0){ + tile.entity.damage(scaledDamage); + scaledDamage -= health; - if(scaledDamage <= 0) continue; + if(scaledDamage <= 0) continue; + } } for(Point2 p : Geometry.d4){ diff --git a/core/src/io/anuke/mindustry/world/blocks/power/ImpactReactor.java b/core/src/io/anuke/mindustry/world/blocks/power/ImpactReactor.java index af40e9fe27..6be147b54d 100644 --- a/core/src/io/anuke/mindustry/world/blocks/power/ImpactReactor.java +++ b/core/src/io/anuke/mindustry/world/blocks/power/ImpactReactor.java @@ -27,8 +27,8 @@ public class ImpactReactor extends PowerGenerator{ protected int plasmas = 4; protected float warmupSpeed = 0.001f; protected float itemDuration = 60f; - protected int explosionRadius = 30; - protected int explosionDamage = 180; + protected int explosionRadius = 40; + protected int explosionDamage = 2000; protected Color plasma1 = Color.valueOf("ffd06b"), plasma2 = Color.valueOf("ff361b"); protected Color ind1 = Color.valueOf("858585"), ind2 = Color.valueOf("fea080"); diff --git a/core/src/io/anuke/mindustry/world/blocks/power/NuclearReactor.java b/core/src/io/anuke/mindustry/world/blocks/power/NuclearReactor.java index cd98e33184..21e233d5a4 100644 --- a/core/src/io/anuke/mindustry/world/blocks/power/NuclearReactor.java +++ b/core/src/io/anuke/mindustry/world/blocks/power/NuclearReactor.java @@ -34,8 +34,8 @@ public class NuclearReactor extends PowerGenerator{ protected int itemDuration = 120; //time to consume 1 fuel protected float heating = 0.01f; //heating per frame * fullness protected float smokeThreshold = 0.3f; //threshold at which block starts smoking - protected int explosionRadius = 19; - protected int explosionDamage = 135; + protected int explosionRadius = 30; + protected int explosionDamage = 1350; protected float flashThreshold = 0.46f; //heat threshold at which the lights start flashing protected float coolantPower = 0.5f; @@ -133,7 +133,6 @@ public class NuclearReactor extends PowerGenerator{ Damage.damage(tile.worldx(), tile.worldy(), explosionRadius * tilesize, explosionDamage * 4); - for(int i = 0; i < 20; i++){ Time.run(Mathf.random(50), () -> { tr.rnd(Mathf.random(40f));