diff --git a/core/assets/shaders/shockwave.frag b/core/assets/shaders/shockwave.frag index 1c5803075b..d9397920e8 100644 --- a/core/assets/shaders/shockwave.frag +++ b/core/assets/shaders/shockwave.frag @@ -1,6 +1,6 @@ #define MAX_SHOCKWAVES 64 -#define WAVE_RADIUS 4.0 -#define DIFF_SCL 1 +#define WAVE_RADIUS 5.0 +#define DIFF_SCL 1.5 #define WAVE_POW 0.8 varying vec2 v_texCoords; @@ -19,12 +19,12 @@ void main(){ for(int i = 0; i < MAX_SHOCKWAVES; i ++){ vec4 wave = u_shockwaves[i]; float radius = wave.z; - float strength = wave.w; float dst = distance(worldCoords, wave.xy); - float realStrength = 1.0 - pow(1.0 - strength, 5.0); + float strength = wave.w * (1.0 - abs(dst - radius) / WAVE_RADIUS); if(abs(dst - radius) <= WAVE_RADIUS){ - float diff = dst - radius; + float diff = (dst - radius); + float pdiff = 1.0 - pow(abs(diff * DIFF_SCL), WAVE_POW); float diffTime = diff * pdiff; vec2 relative = normalize(worldCoords - wave.xy); diff --git a/core/src/mindustry/content/UnitTypes.java b/core/src/mindustry/content/UnitTypes.java index 57b638d913..8231107f24 100644 --- a/core/src/mindustry/content/UnitTypes.java +++ b/core/src/mindustry/content/UnitTypes.java @@ -387,7 +387,7 @@ public class UnitTypes{ status = StatusEffects.shocked; statusDuration = 10f; hittable = false; - healPercent = 2f; + healPercent = 1.6f; collidesTeam = true; }}; }}; @@ -632,7 +632,7 @@ public class UnitTypes{ }}; atrax = new UnitType("atrax"){{ - speed = 0.57f; + speed = 0.6f; drag = 0.4f; hitSize = 13f; rotateSpeed = 3f; @@ -672,11 +672,11 @@ public class UnitTypes{ }}; spiroct = new UnitType("spiroct"){{ - speed = 0.52f; + speed = 0.54f; drag = 0.4f; hitSize = 15f; rotateSpeed = 3f; - health = 940; + health = 1000; immunities = ObjectSet.with(StatusEffects.burning, StatusEffects.melting); legCount = 6; legLength = 13f; @@ -979,7 +979,7 @@ public class UnitTypes{ targetAir = false; targetFlags = new BlockFlag[]{BlockFlag.generator, null}; hitSize = 7; - itemCapacity = 0; + itemCapacity = 10; weapons.add(new Weapon(){{ y = 0f; diff --git a/core/src/mindustry/entities/comp/BuilderComp.java b/core/src/mindustry/entities/comp/BuilderComp.java index 22a5f047e4..9f476f33e5 100644 --- a/core/src/mindustry/entities/comp/BuilderComp.java +++ b/core/src/mindustry/entities/comp/BuilderComp.java @@ -48,6 +48,8 @@ abstract class BuilderComp implements Posc, Statusc, Teamc, Rotc{ } public void updateBuildLogic(){ + if(type.buildSpeed <= 0f) return; + if(!headless){ //visual activity update if(lastActive != null && buildAlpha <= 0.01f){ diff --git a/core/src/mindustry/graphics/Shaders.java b/core/src/mindustry/graphics/Shaders.java index 71e36af43a..263514a706 100644 --- a/core/src/mindustry/graphics/Shaders.java +++ b/core/src/mindustry/graphics/Shaders.java @@ -416,7 +416,7 @@ public class Shaders{ @Override public void apply(){ - int count = data.size / 4; + int count = data.size / size; setUniformi("u_shockwave_count", count); if(count > 0){ diff --git a/core/src/mindustry/logic/GlobalConstants.java b/core/src/mindustry/logic/GlobalConstants.java index 00fa84b6fe..897429987c 100644 --- a/core/src/mindustry/logic/GlobalConstants.java +++ b/core/src/mindustry/logic/GlobalConstants.java @@ -25,7 +25,7 @@ public class GlobalConstants{ public static final Rand rand = new Rand(); //non-constants that depend on state - private static int varTime, varTick, varWave, varWaveTime; + private static int varTime, varTick, varSecond, varMinute, varWave, varWaveTime; private ObjectIntMap namesToIds = new ObjectIntMap<>(); private Seq vars = new Seq<>(Var.class); @@ -42,6 +42,8 @@ public class GlobalConstants{ //time varTime = put("@time", 0); varTick = put("@tick", 0); + varSecond = put("@second", 0); + varMinute = put("@minute", 0); varWave = put("@waveNumber", 0); varWaveTime = put("@waveTime", 0); @@ -120,6 +122,10 @@ public class GlobalConstants{ vars.items[varTime].numval = state.tick / 60.0 * 1000.0; vars.items[varTick].numval = state.tick; + //shorthands for seconds/minutes spent in save + vars.items[varSecond].numval = state.tick / 60f; + vars.items[varMinute].numval = state.tick / 60f / 60f; + //wave state vars.items[varWave].numval = state.wave; vars.items[varWaveTime].numval = state.wavetime / 60f; diff --git a/core/src/mindustry/type/PayloadSeq.java b/core/src/mindustry/type/PayloadSeq.java index 93a13b48bd..cda666ebba 100644 --- a/core/src/mindustry/type/PayloadSeq.java +++ b/core/src/mindustry/type/PayloadSeq.java @@ -6,7 +6,7 @@ import mindustry.*; import mindustry.ctype.*; public class PayloadSeq{ - private ObjectIntMap blocks = new ObjectIntMap<>(); + private ObjectIntMap payloads = new ObjectIntMap<>(); private int total; public boolean isEmpty(){ @@ -26,7 +26,7 @@ public class PayloadSeq{ } public void add(UnlockableContent block, int amount){ - blocks.increment(block, amount); + payloads.increment(block, amount); total += amount; } @@ -43,12 +43,12 @@ public class PayloadSeq{ } public void clear(){ - blocks.clear(); + payloads.clear(); total = 0; } public int get(UnlockableContent block){ - return blocks.get(block); + return payloads.get(block); } public boolean contains(Seq stacks){ @@ -70,8 +70,8 @@ public class PayloadSeq{ public void write(Writes write){ //IMPORTANT NOTICE: size is negated here because I changed the format of this class at some point //negated = new format - write.s(-blocks.size); - for(var entry : blocks.entries()){ + write.s(-payloads.size); + for(var entry : payloads.entries()){ write.b(entry.key.getContentType().ordinal()); write.s(entry.key.id); write.i(entry.value); @@ -80,7 +80,7 @@ public class PayloadSeq{ public void read(Reads read){ total = 0; - blocks.clear(); + payloads.clear(); short amount = read.s(); if(amount >= 0){ //old format, block only - can safely ignore, really