From f15a620c4526586e5f9db39057e0b45feffe53bc Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 14 Aug 2022 15:39:56 -0400 Subject: [PATCH] Allow neoplasm on water/arkycite/etc --- core/src/mindustry/content/Liquids.java | 3 +++ core/src/mindustry/entities/Puddles.java | 3 +-- core/src/mindustry/mod/Mods.java | 2 +- core/src/mindustry/type/Liquid.java | 3 +++ core/src/mindustry/world/blocks/power/LightBlock.java | 4 ++-- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/core/src/mindustry/content/Liquids.java b/core/src/mindustry/content/Liquids.java index d0189e9a9a..00aa63071d 100644 --- a/core/src/mindustry/content/Liquids.java +++ b/core/src/mindustry/content/Liquids.java @@ -33,6 +33,7 @@ public class Liquids{ effect = StatusEffects.tarred; boilPoint = 0.65f; gasColor = Color.grays(0.4f); + canStayOn.add(water); }}; cryofluid = new Liquid("cryofluid", Color.valueOf("6ecdec")){{ @@ -53,6 +54,7 @@ public class Liquids{ spreadTarget = Liquids.water; moveThroughBlocks = true; incinerable = true; + canStayOn.addAll(water, oil, cryofluid); colorFrom = Color.valueOf("e8803f"); colorTo = Color.valueOf("8c1225"); @@ -61,6 +63,7 @@ public class Liquids{ arkycite = new Liquid("arkycite", Color.valueOf("84a94b")){{ flammability = 0.4f; viscosity = 0.7f; + neoplasm.canStayOn.add(this); }}; gallium = new Liquid("gallium", Color.valueOf("9a9dbf")){{ diff --git a/core/src/mindustry/entities/Puddles.java b/core/src/mindustry/entities/Puddles.java index 20e8264ecb..decbd596b1 100644 --- a/core/src/mindustry/entities/Puddles.java +++ b/core/src/mindustry/entities/Puddles.java @@ -129,9 +129,8 @@ public class Puddles{ /** * Returns whether the first liquid can 'stay' on the second one. - * Currently, the only place where this can happen is oil on water. */ private static boolean canStayOn(Liquid liquid, Liquid other){ - return liquid == Liquids.oil && other == Liquids.water; + return liquid.canStayOn.contains(other); } } diff --git a/core/src/mindustry/mod/Mods.java b/core/src/mindustry/mod/Mods.java index 27a7aff17a..151796555d 100644 --- a/core/src/mindustry/mod/Mods.java +++ b/core/src/mindustry/mod/Mods.java @@ -962,7 +962,7 @@ public class Mods implements Loadable{ Core.settings.put("mod-" + baseName + "-enabled", false); } - if(!headless){ + if(!headless && Core.settings.getBool("mod-" + baseName + "-enabled", true)){ Log.info("Loaded mod '@' in @ms", meta.name, Time.elapsed()); } diff --git a/core/src/mindustry/type/Liquid.java b/core/src/mindustry/type/Liquid.java index 9fb9259b64..c0a96d1646 100644 --- a/core/src/mindustry/type/Liquid.java +++ b/core/src/mindustry/type/Liquid.java @@ -3,6 +3,7 @@ package mindustry.type; import arc.graphics.*; import arc.graphics.g2d.*; import arc.math.*; +import arc.struct.*; import arc.util.*; import mindustry.content.*; import mindustry.ctype.*; @@ -63,6 +64,8 @@ public class Liquid extends UnlockableContent implements Senseable{ public Effect vaporEffect = Fx.vapor; /** If true, this liquid is hidden in most UI. */ public boolean hidden; + /** Liquids this puddle can stay on, e.g. oil on water. */ + public ObjectSet canStayOn = new ObjectSet<>(); public Liquid(String name, Color color){ super(name); diff --git a/core/src/mindustry/world/blocks/power/LightBlock.java b/core/src/mindustry/world/blocks/power/LightBlock.java index 882323d131..f129eef1e6 100644 --- a/core/src/mindustry/world/blocks/power/LightBlock.java +++ b/core/src/mindustry/world/blocks/power/LightBlock.java @@ -38,9 +38,9 @@ public class LightBlock extends Block{ @Override public void init(){ - //double needed for some reason - lightRadius = radius*2f; + lightRadius = radius*3f; emitLight = true; + super.init(); }