diff --git a/assets/bundles/bundle.properties b/assets/bundles/bundle.properties index 0c1c6a2..fa20dfb 100644 --- a/assets/bundles/bundle.properties +++ b/assets/bundles/bundle.properties @@ -42,7 +42,7 @@ block.meld2-rotary-kiln.name = Rotary Kiln block.meld2-rotary-kiln.description = Burns mass amounts of [#cbdbfc]Aspect[] as fuel, heats materials to process them in bulk.\n\n[accent]Carbolith + Tenbris -> Shadesteel + [#5b4739]Fumes[]\nSilver -> Annealed Silver\n\nClay-Mallows + Quartz Strata + Likestone Sediments -> Glassy-Mallows\n\nClay-Mallows + Likestone Sediments + Debris -> Crucible-Plating\nDebris + Shadesteel -> Crucible Platings block.meld2-pneumatic-extruder.name = Pneumatic Extruder -block.meld2-pneumatic-extruder.description = Extrudes material into pipes and capsules, uses [#cbdbfc]Aspect[] to run. [accent]\n\nDebris + Elnar -> Aspect Pipe\n\nSilver/Annealed Silver + Debris -> Aspect Pipe\n\nGlassy-Mallows + Silver/Annealed Silver + Storming Aspect -> [red]Aspect Bombs[] +block.meld2-pneumatic-extruder.description = Extrudes material into pipes and capsules, uses [#cbdbfc]Aspect[] to run.\n\nCan process crushing recipies but at a far reduced rate.\n\n[accent]\n\nDebris + Elnar -> Aspect Pipe\n\nSilver/Annealed Silver + Debris -> Aspect Pipe\n\nGlassy-Mallows + Silver/Annealed Silver + Storming Aspect -> [red]Aspect Bombs[] block.meld2-storm-iris.name = Storm Iris block.meld2-storm-iris.description = Converts stable [meld2-aether]Aether[] into charged [meld2-thundering-aether]Thundering Aether[] @@ -88,6 +88,12 @@ block.meld2-shadesteel-shingles.name = Shadesteel Shingles block.meld2-shadesteel-shingles.description = Mundane and bulky. block.meld2-shadesteel-shingles.details = Brick of Shadesteel bricks of Shadesteel ingots. +block.meld2-gate-spike.name = Gate Spike +block.meld2-gate-spike.description = Acts as a door. Causes all connected doors to enabling or disable when toggled. + +block.meld2-lake-rim.name = Lake Rim +block.meld2-lake-rim.description = Acts as a door, only placeable on the shoreline. + block.meld2-barricade.name = Barricade block.meld2-barricade.description = Provides cover against enemy projectiles.\nQuick to build.\n\nEasy way to store Compacted Bricks/Stony Gloop outside of the core for onsite use.\n\n[accent]Armored.[] @@ -621,7 +627,7 @@ item.meld2-tenbris.details = Fume infused hematite, more malleable and less brit item.meld2-motis.name = Motis item.meld2-motis.description = Raw material, valued for its natural magnetism. -item.meld2-motis.details = Fume infused magnetite, more malleable and less brittle but less hard than usual. +item.meld2-motis.details = Both motis and motus are valid spellings for this material. The correct pronunciation, however, is "mottes".\n\nThank god I took those linguistics classes... item.meld2-shadesteel.name = Shadesteel item.meld2-shadesteel.description = Not just some rock anymore.\nDurable building material. @@ -647,6 +653,20 @@ item.meld2-annealed-silver.name = Annealed Silver item.meld2-annealed-silver.description = Highly refined and attuned. Makes for a great aspect conductor. item.meld2-annealed-silver.details = An easily made aspect superconductor. + +item.meld2-vitali.name = Vitali +item.meld2-vitali.description = A component of Blood, and the primary material in Shadesteel. +item.meld2-vitali.details = Many attempts have been made to make Vitali into something more durable and flexible than Shadesteel. + +item.meld2-limmeri.name = Limmeri +item.meld2-limmeri.description = A lightweight, silvery metal. +item.meld2-limmeri.details = Mixes of Limmeri & Fume-bound Vitali have been used as a source of heat.\n\nIgniting Limmeri's passion for connection with a Pyro containing aspect allows it to steal the Fumes from the Vitali, scorching the air and ground around itself. + +item.meld2-mallum.name = Mallum +item.meld2-mallum.description = A dull, but flexible metal. Resistant to worldly corrosion, yet easily decayed by the aspects.\n\nGreat for soldering aplication. +item.meld2-mallum.details = + + item.meld2-iampsi.name = Iampsi item.meld2-iampsi.description = Hardy mineral found accumulating in deposits under dried riverbeds, or as spikes above surface.\n\nDecomposable for Silver and Quartz Strata, useful for grinding. item.meld2-iampsi.details = Radiance. @@ -1120,44 +1140,41 @@ status.meld2-fringe.name = Fringe status.meld2-fringe.description = Enlightens materials into a useable form. status.meld2-fringe.details = Hello Strata! -status.meld2-mangrove-a0-refreshed.name = Refreshed -status.meld2-mangrove-a0-refreshed.description = Doubles reload speed and slightly reduces damage taken. Invokes slight regeneration. - -status.meld2-mangrove-a1-infested.name = Infested -status.meld2-mangrove-a1-infested.description = Hefty amount of DoT an' damage taken and dealt is magnified. Doubles... reload speed?\n\n[gray]What applies this again?\nI don't know, but we've got to ru-[]\n[red][] +status.meld2-refreshed.name = Refreshed +status.meld2-refreshed.description = Doubles reload speed and slightly reduces damage taken. Invokes slight regeneration. -status.meld2-mangrove-b0-shattered-flame.name = Shattered Flame -status.meld2-mangrove-b0-shattered-flame.description = Sacrifice is power. +status.meld2-infested.name = Infested +status.meld2-infested.description = Hefty amount of DoT an' damage taken and dealt is magnified. Doubles... reload speed?\n\n[gray]What applies this again?\nI don't know, but we've got to ru-[]\n[red][] -status.meld2-mangrove-d0-mercury-poisoning.name = Mercury Poisoning -status.meld2-mangrove-d0-mercury-poisoning.description = Extremely deadly to critters of [#ea9ad6]Meld[] origin. Effects unknown.\n[gray]TODO: Update this for Strata +status.meld2-shattered-flame.name = Shattered Flame +status.meld2-shattered-flame.description = Sacrifice is power. -status.meld2-mangrove-d1-slippery.name = Mercury Coating -status.meld2-mangrove-d1-slippery.description = Coating of [#89828c]Mercury[].\n[gray]Fun!\nHey don't eat that-[] +status.meld2-mercury-poisoning.name = Mercury Poisoning +status.meld2-mercury-poisoning.description = Extremely deadly to critters of [#ea9ad6]Meld[] origin. Effects unknown.\n[gray]TODO: Update this for Strata -status.meld2-strata-a0-rally.name = Rally -status.meld2-strata-a0-rally.description = Increased mobility and reload. Applied by [accent]Commanders[] and [accent]Sonars[]. +status.meld2-slippery.name = Mercury Coating +status.meld2-slippery.description = Coating of [#89828c]Mercury[].\n[gray]Fun!\nHey don't eat that-[] -status.meld2-strata-a1-primed.name = Primed -status.meld2-strata-a1-primed.description = Increased mobility, damage, reload. Heavly increased health. This unit's ready to go off! +status.meld2-rally.name = Rally +status.meld2-rally.description = Increased mobility and reload. Applied by [accent]Commanders[] and [accent]Sonars[]. -status.meld2-strata-b0-anchored.name = Anchored -status.meld2-strata-b0-anchored.description = Heavly increased drag and health. Heavly decreased speed. Applied by [accent]Movement Anchors[] +status.meld2-anchored.name = Anchored +status.meld2-anchored.description = Heavly increased drag and health. Heavly decreased speed. Applied by [accent]Movement Anchors[] -status.meld2-strata-b1-rebound.name = Rebound -status.meld2-strata-b1-rebound.description = Heavly increased speed, slightly increased reload speed. Decreased drag. Applied by [accent]Movement Anchors[] +status.meld2-rebound.name = Rebound +status.meld2-rebound.description = Heavly increased speed, slightly increased reload speed. Decreased drag. Applied by [accent]Movement Anchors[] -status.meld2-wildlife-a0-amplified.name = Amplified -status.meld2-wildlife-a0-amplified.description = Amplifies mobility, durability and reload. Applied by [#ea9ad6]Meld Amplifiers[]. +status.meld2-amplified.name = Amplified +status.meld2-amplified.description = Amplifies mobility, durability and reload. Applied by [#ea9ad6]Meld Amplifiers[]. -status.meld2-wildlife-a1-reconstitution.name = Reconstitution -status.meld2-wildlife-a1-reconstitution.description = Increases durability and drag. Slightly decreases speed. Light regeneration. Applied by [#ea9ad6]Meld Beacons[]. Certain constructs spawn with this.\nOnly affects biological targets. +status.meld2-reconstitution.name = Reconstitution +status.meld2-reconstitution.description = Increases durability and drag. Slightly decreases speed. Light regeneration. Applied by [#ea9ad6]Meld Beacons[]. Certain constructs spawn with this.\nOnly affects biological targets. -status.meld2-wildlife-b0-sentry.name = Sentry -status.meld2-wildlife-b0-sentry.description = Heavily reduced mobility, but double fireate. Does constant DoT.\nCertain constructs apply this upon shooting. +status.meld2-sentry.name = Sentry +status.meld2-sentry.description = Heavily reduced mobility, but double fireate. Does constant DoT.\nCertain constructs apply this upon shooting. -status.meld2-wildlife-c0-surge.name = Surge -status.meld2-wildlife-c0-surge.description = Massive boost in reload speed, but heavly decreased damage.\nCertain constructs can intiate a surge with a long cooldown. +status.meld2-surge.name = Surge +status.meld2-surge.description = Massive boost in reload speed, but heavly decreased damage.\nCertain constructs can intiate a surge with a long cooldown. status.meld2-lacerated.name = Lacerated status.meld2-lacerated.description = Heavly reduced mobility and fireate. Increases durability slightly and encourages light regeneration.\n\nApplied by [#4bb66b]Resonarum[] related sources. No effect on armored meld or inorganic targets. @@ -1301,6 +1318,22 @@ objective.wavestarting = [accent]Waves starting in:[] [lightgray]{0}[] ability.spawndeath = Death Spawn(s) +ability.solidspeed = Solid Speed +ability.solidspeed.description = Speed when traveling on solid floors +ability.solidspeed.multi = Speed multiplier: {0}x + +ability.slipstreamhull = Slipstream Hull +ability.slipstreamhull.description = Moves unimpeded by sticky terrain! + +ability.beached = Beaches +ability.beached.description = Able to move on land, but rapidly loses speed. + +ability.fabricatorbattery = Fabricator Battery +ability.fabricatorbattery.description = Unit builds 5x as quickly while it has charge. + +ability.deathbirth = Death Birth +ability.deathbirth.description = Units spawned have a short, intense regeneration. + //Vanilla modifications research = Defragment researched = [lightgray]Defragmentation Progress: {0}% @@ -1330,6 +1363,9 @@ sectors.underattack.nodamage = [accent]In Progress... status.disarmed.name = Disarmed +database-category.lamp-psi = Lamp Psi +database-tag.lamp-psi = Iamp Psl + database-category.aspect = Aspecti database-tag.aspect-powergen = Potential/Power family database-tag.aspect-omnipotence = Progress @@ -1359,4 +1395,10 @@ bar.spool = Spool stat.aspect-efficiency = Efficiency stat.aspect-density = Density -stat.aspect-stats = Aspect Stats \ No newline at end of file +stat.aspect-stats = Aspect Stats + +overlay.deposit-missing = No deposits found :c +overlay.ore-missing = No ores found :c +overlay.drop-missing = Nothing to harvest... +overlay.friendly-fire = +overlay.in-fog = \ No newline at end of file diff --git a/assets/bundles/bundle.shitpost b/assets/bundles/bundle_shitpost.properties similarity index 65% rename from assets/bundles/bundle.shitpost rename to assets/bundles/bundle_shitpost.properties index b28ca18..1d77138 100644 --- a/assets/bundles/bundle.shitpost +++ b/assets/bundles/bundle_shitpost.properties @@ -14,8 +14,10 @@ block.meld2-pressure-vent.name = Amogus Escape route block.meld2-crystal-cracker.name = Tasty Wafer block.meld2-crystal-cracker.description = ...you know you wana\n\njust a lil nibble -block.meld2-overflow-chute.name = Smart Router -block.meld2-overflow-chute.description = Smart Router +block.meld2-aspect-channel.name = BetterConduit + +block.meld2-chute-overflow.name = Smart Router +block.meld2-chute-overflow.description = Smart Router block.meld2-depot.name = frankouloadertainer's frankouloadertainer-er @@ -23,7 +25,8 @@ liquid.meld2-aspect.name = Outdated Ass Destroyer liquid.meld2-storming-aspect.name = Bombspect liquid.meld2-bound-aspect.name = Leanspect -unit.meld-bulbhead.name = Bulbster -unit.meld-bulbhead.description = Meldieps the allied blocks as it Meldarras.io the enemies +unit.meld2-bulbhead.name = Bulbster +unit.meld2-bulbhead.description = Meldieps the allied blocks as it Meldarras.io the enemies -liquid.meld2-meld = Meld 2: Electric meldaloo \ No newline at end of file +liquid.meld2-meld.name = Meld 2: Electric meldaloo +liquid.meld2-meld.description = (the same) \ No newline at end of file diff --git a/assets/icon.png b/assets/icon.png index c414abd..cf83392 100644 Binary files a/assets/icon.png and b/assets/icon.png differ diff --git a/assets/shaders/light.frag b/assets/shaders/light.frag index c117372..1c0a218 100644 --- a/assets/shaders/light.frag +++ b/assets/shaders/light.frag @@ -9,9 +9,10 @@ uniform vec4 u_ambient; varying vec2 v_texCoords; -void main(){ +#define banding 8.0 +#define banding2 3.0 - float banding = 8.0; +void main(){ //Exclusion vec4 exclusion = texture2D(u_exclusion, v_texCoords); @@ -24,9 +25,9 @@ void main(){ float alpha = color.a; //Get the scaling right here... - alpha = clamp(floor((alpha) * 8.0)/8.0, 0.0, 1.0) * 0.3 + clamp(floor(alpha * 3.0)/3.0, 0.0, 1.0) * 0.3 + alpha * 0.4; + alpha = clamp(floor((alpha) * banding)/banding, 0.0, 1.0) * 0.3 + clamp(floor(alpha * banding2)/banding2, 0.0, 1.0) * 0.3 + alpha * 0.4; - vec4 totalColor = clamp(vec4(color.rgb * alpha, 1) + vec4(positionAmbient.rgb * positionAmbient.a, 1), 0.0, 1.0); + vec4 totalColor = clamp(vec4(color.rgb * alpha, 1.0) + vec4(positionAmbient.rgb * positionAmbient.a, 1.0), 0.0, 1.0); vec4 background = clamp(texture2D(u_texture, v_texCoords), 0.0, 1.0); diff --git a/assets/shaders/sonar.frag b/assets/shaders/sonar.frag index dec4079..e67b533 100644 --- a/assets/shaders/sonar.frag +++ b/assets/shaders/sonar.frag @@ -14,7 +14,7 @@ void main() { vec4 color = texture2D(u_texture, v_texCoords); gl_FragColor = color; - if(color.r == 1 && color.g + color.b > 0){ + if(color.r == 1.0 && color.g + color.b > 0.0){ color.a *= 0.5 * abs(sin((v_texCoords.x + v_texCoords.y) * 20.0 + u_time/20.0)); diff --git a/assets/sprites-override/ui/logo.png b/assets/sprites-override/ui/logo.png new file mode 100644 index 0000000..c35c253 Binary files /dev/null and b/assets/sprites-override/ui/logo.png differ diff --git a/assets/sprites/icon.png b/assets/sprites/icon.png index c414abd..cf83392 100644 Binary files a/assets/sprites/icon.png and b/assets/sprites/icon.png differ diff --git a/mod.hjson b/mod.hjson index d51d277..345a7e6 100644 --- a/mod.hjson +++ b/mod.hjson @@ -16,10 +16,10 @@ description: "[[]gray]Under scattered gloomy sunlight in the shimmering seas, wi subtitle: "[[]accent]What choice do I have...[[]]" #the mod version -version: gameplay test 5 +version: gameplay test 6 #the minimum game build required to run this mod -minGameVersion: 154 +minGameVersion: 157 #this is a java mod java: true diff --git a/src/meld/Meld.java b/src/meld/Meld.java index db7b790..87c04d2 100644 --- a/src/meld/Meld.java +++ b/src/meld/Meld.java @@ -34,7 +34,7 @@ public class Meld extends Mod{ public static NativeJavaPackage p = null; public static Melting melting; - + public Meld(){ Events.on(EventType.ClientLoadEvent.class, e -> { MeldRegions.load(); @@ -43,15 +43,17 @@ public Meld(){ Events.run(EventType.Trigger.draw, () -> { if(!MeldSettings.overlayOverFog) return; - Draw.draw(Layer.fogOfWar + 2, AboveOverlayRenderer::draw); - - //Just additive blending the fuck out of this layer in particular cause like fuck yes - Draw.drawRange(MeldLayers.smokeHigh, 1, () -> Draw.blend(Blending.additive), () -> Draw.blend(Blending.normal)); + Draw.draw(MeldLayers.overlayOver, AboveOverlayRenderer::draw); }); Events.on(EventType.FileTreeInitEvent.class, e -> { Core.app.post(MeldShaders::load); }); + + Events.on(EventType.FileTreeInitEvent.class, e -> { + // TODO: potentially run earlier? + Bundles.load(); + }); CustomExplosions.load(); } @@ -59,29 +61,6 @@ public Meld(){ public static String prefix(String in){ return name + "-" + in; } - private static final StringBuilder b = new StringBuilder(); - - //Thanks smolkey - public static String gradient(String in, Color... colors){ - if(colors.length == 1) return "[#" + colors[0].toString().substring(0, 6) + "]" + in + "[]"; - - b.setLength(0); - b.trimToSize(); - int length = in.length(); - int spaces = 0; - - for(int i = 0; i < length; i++){ - char ind = in.charAt(i); - if(Character.isWhitespace(ind)){ - spaces++; - b.append(' '); - continue; - } - b.append("[#").append(Tmp.c1.set(colors[0]).lerp(colors, (float) i / (length - spaces)).toString(), 0, 6).append("]").append(ind).append("[]"); - } - - return b.toString(); - } @Override public void init() { diff --git a/src/meld/content/MeldBlocks.java b/src/meld/content/MeldBlocks.java index 883b321..4ac49ea 100644 --- a/src/meld/content/MeldBlocks.java +++ b/src/meld/content/MeldBlocks.java @@ -1158,7 +1158,7 @@ public void update(Bullet b){ lakeRim = new LakeRim("lake-rim"){{ requirements(Category.defense, with(MeldItems.debris, 4)); size = 1; - health = 120; + health = 400; }}; frictionPad = new FrictionPad("friction-pad"){{ @@ -1202,7 +1202,7 @@ public void update(Bullet b){ size = 2; health = 800; - itemCapacity = 20; + itemCapacity = 50; }}; aspectIncinerator = new StorageIncinerator("aspect-incinerator"){{ @@ -1269,7 +1269,7 @@ public void update(Bullet b){ health = 420; placeableLiquid = true; - drillTime = 90; + drillTime = 180; tier = 2; buildTime = 90; @@ -1535,7 +1535,7 @@ Category.production, with( outputLiquidSlots = 1; inputLiquids.addAll(MeldLiquids.aspect, MeldLiquids.boundAspect, MeldLiquids.stormingAspect); - inputItems.addAll(MeldItems.tenbris, MeldItems.clayMallows, MeldItems.carbolith, MeldItems.debris, MeldItems.shadesteel, MeldItems.glassMallows, MeldItems.silver, MeldItems.likestoneSediments, MeldItems.quartzStrata); + inputItems.addAll(MeldItems.tenbris, MeldItems.clayMallows, MeldItems.carbolith, MeldItems.debris, MeldItems.shadesteel, MeldItems.silver, MeldItems.likestoneSediments, MeldItems.quartzStrata); outputItems.addAll(MeldItems.cruciblePlating, MeldItems.shadesteel, MeldItems.glassMallows, MeldItems.annealedSilver); outputLiquids.addAll(MeldLiquids.fumes); @@ -1553,8 +1553,8 @@ Category.production, with( itemCapacity = 10; inputLiquids.addAll(MeldLiquids.aspect, MeldLiquids.boundAspect, MeldLiquids.stormingAspect); - inputItems.addAll(MeldItems.shadesteel, MeldItems.elnarDust, MeldItems.debris, MeldItems.silver, MeldItems.annealedSilver, MeldItems.glassMallows); - outputItems.addAll(MeldItems.aspectPipe, MeldItems.aspectBomb); + inputItems.addAll(MeldItems.shadesteel, MeldItems.elnarDust, MeldItems.debris, MeldItems.silver, MeldItems.annealedSilver, MeldItems.glassMallows, MeldItems.iampsi); + outputItems.addAll(MeldItems.aspectPipe, MeldItems.aspectBomb, MeldItems.quartzStrata); inputLiquidSlots = 1; @@ -1606,6 +1606,9 @@ Category.production, with( ); }} ); + recipes.addAll( + MeldRecipes.crusherRecipies(2, 0.25f) + ); }}; crushWeaver = new AttributeCrafter("crush-weaver"){{ @@ -1933,6 +1936,8 @@ Category.production, with( requirements(Category.effect, with(MeldItems.iampsi, 30)); configurable = false; radius = 32; + databaseCategory = "lamp-psi"; + databaseTag = "lamp-psi"; consume(new StupidConsumeAspects(outletRate/5, AspectGroup.aspect)); }}; @@ -1967,7 +1972,7 @@ Category.production, with( platedChute = new Duct("plated-chute"){{ requirements(Category.distribution, with(MeldItems.cruciblePlating, 2)); armored = true; - health = 45; + health = 70; armor = 10; speed = 4f; }}; @@ -2472,7 +2477,7 @@ Category.production, with( meldCannon, meldMortar, craigCoffer, jillaCoffer, braigCoffer, billaCoffer, meldCultivator, - pipebox, pipelineBridge, pipelineCrossing, pipelineRouter, + pipeline, pipelineBridge, pipelineCrossing, pipelineRouter, carbonicBarrier, carbonicBarrierLarge, crystalBarrier, crystalBarrierLarge, meldAmplifier, meldCapsule, meldNode, meldSuppressor ); diff --git a/src/meld/content/MeldBullets.java b/src/meld/content/MeldBullets.java index c5930fc..fd62ff7 100644 --- a/src/meld/content/MeldBullets.java +++ b/src/meld/content/MeldBullets.java @@ -260,6 +260,9 @@ public static void load(){ bulletInterval = 2; + status = MeldStatusEffects.impaled; + statusDuration = 30; + fragBullet = new BasicBulletType(9, 4, Meld.prefix("clump")){{ speed = 9; damage = 0.5f; diff --git a/src/meld/content/MeldLiquids.java b/src/meld/content/MeldLiquids.java index 7802521..36cc61b 100644 --- a/src/meld/content/MeldLiquids.java +++ b/src/meld/content/MeldLiquids.java @@ -6,6 +6,7 @@ import arc.struct.Seq; import meld.fluid.Aspect; import meld.fluid.AspectGroup; +import meld.graphics.MeldPal; import mindustry.entities.effect.ParticleEffect; import mindustry.type.CellLiquid; import mindustry.type.Liquid; @@ -31,37 +32,46 @@ public static void load(){ aether = new Aspect("aether"){{ gas = true; color = Color.valueOf("cb8650"); + lightColor = Color.valueOf("412a0c").a(0.5f); + lightOpacity = 0.01f; temperature = 0.6f; }}; pollutantMixture = new Aspect("pollutant-mixture"){{ gas = true; - color = Color.valueOf("6a634d"); temperature = 0.6f; + + color = Color.valueOf("6a634d"); + lightOpacity = 0.001f; }}; thunderingAether = new Aspect("thundering-aether"){{ gas = true; - color = Color.valueOf("f35430"); temperature = 0.6f; explosiveness = 0.1f; + + color = Color.valueOf("f35430"); + lightOpacity = 0.02f; }}; aspect = new Aspect("aspect"){{ gas = true; flammability = 0.35f; explosiveness = 1; - color = Color.valueOf("cbdbfc"); temperature = 0.6f; + + color = Color.valueOf("cbdbfc"); + lightOpacity = 0.02f; }}; stormingAspect = new Aspect("storming-aspect"){{ gas = true; - color = Color.valueOf("aaadfd"); temperature = 0.6f; flammability = 1; explosiveness = 2; + color = Color.valueOf("aaadfd"); + lightOpacity = 0.05f; }}; boundAspect = new Aspect("bound-aspect"){{ @@ -73,6 +83,7 @@ public static void load(){ meld = new Aspect("meld"){{ gas = true; color = Color.valueOf("e4aad5"); + lightColor = MeldPal.meldFloorGlow; temperature = 0.6f; }}; diff --git a/src/meld/content/MeldMappings.java b/src/meld/content/MeldMappings.java index 5aea3aa..e587918 100644 --- a/src/meld/content/MeldMappings.java +++ b/src/meld/content/MeldMappings.java @@ -1,10 +1,13 @@ package meld.content; +import arc.struct.Seq; import meld.world.blocks.production.GrindingQuary; import meld.world.blocks.production.GrindingQuary.GrinderEntry; import mindustry.content.Planets; import mindustry.content.UnitTypes; import mindustry.type.ItemStack; +import mindustry.type.StatusEffect; +import mindustry.type.UnitType; import static meld.content.MeldEnvironment.*; import static meld.content.MeldLiquids.*; @@ -27,6 +30,9 @@ likestone, new GrinderEntry(120, likesalt, with(MeldItems.likestoneSediments, 10 meldCrystalFloor, new GrinderEntry(720, meldCrystalScattered, with(MeldItems.meldShard, 10)) ); + GrindingQuary.alwaysDump.addAll( + MeldItems.dissonitre, MeldItems.clayMallows, MeldItems.glassMallows, MeldItems.likestoneSediments, MeldItems.meldShard + ); nectar.canStayOn.addAll(mercury, ichor, ooze); mercury.canStayOn.addAll(mercury, ichor, ooze, blood); @@ -47,5 +53,25 @@ public static void loadAfter(){ UnitTypes.alpha.databaseTabs.clear(); UnitTypes.alpha.postInit(); + //TODO: Move to separate class? + Seq bioImmunities = Seq.with(MeldStatusEffects.aspectBurn); + Seq armorImmunities = Seq.with(MeldStatusEffects.lacerated, MeldStatusEffects.impaled); + Seq mechanicalImmunities = Seq.with(MeldStatusEffects.lacerated, MeldStatusEffects.impaled); + + Seq bio = Seq.with( + MeldUnits.blob, MeldUnits.craig, MeldUnits.braig, + MeldUnits.jilla, MeldUnits.scorcher + ); + Seq armor = Seq.with( + MeldUnits.afraig, MeldUnits.globkin, + MeldUnits.kathid + ); + Seq mechanical = Seq.with( + MeldUnits.bulbhead, MeldUnits.shark + ); + + bio.each(b -> b.immunities.addAll(bioImmunities)); + armor.each(b -> b.immunities.addAll(armorImmunities)); + mechanical.each(b -> b.immunities.addAll(mechanicalImmunities)); } } diff --git a/src/meld/content/MeldRecipes.java b/src/meld/content/MeldRecipes.java index 3ca3b4f..6be57fb 100644 --- a/src/meld/content/MeldRecipes.java +++ b/src/meld/content/MeldRecipes.java @@ -64,4 +64,19 @@ public static Seq kilnRecipies(float outlets, float speedMultiplier }} ); } + + //All crushing recipies + public static Seq crusherRecipies(float outlets, float speedMultiplier){ + return Seq.with( + new TimedRecipe(15/speedMultiplier){{ + consumers.addAll( + new ConsumeItems(with(MeldItems.iampsi, 1)), + new StupidConsumeAspects(outletRate * outlets, AspectGroup.aspect) + ); + producers.addAll( + new ProduceItem(new ItemStack(MeldItems.quartzStrata, 3)) + ); + }} + ); + } } diff --git a/src/meld/content/MeldStatusEffects.java b/src/meld/content/MeldStatusEffects.java index 1433c11..1769575 100644 --- a/src/meld/content/MeldStatusEffects.java +++ b/src/meld/content/MeldStatusEffects.java @@ -222,7 +222,7 @@ public void update(Unit unit, StatusEntry entry) { unit.dragMultiplier *= Mathf.clamp(3 - entry.time/300, 1f, 3); }{ dragMultiplier = 3; - }}; + }}; //Only affects unarmored lacerated = new StatusEffect("lacerated"){{ @@ -247,8 +247,8 @@ public void update(Unit unit, StatusEntry entry) { }; impaled = new StatusEffect("impaled"){{ - damage = 0.2f; - speedMultiplier = 0.45f; + damage = 1f; + speedMultiplier = 0.65f; buildSpeedMultiplier = 0.5f; }}; diff --git a/src/meld/content/MeldUnits.java b/src/meld/content/MeldUnits.java index 9a8dd86..d0d245a 100644 --- a/src/meld/content/MeldUnits.java +++ b/src/meld/content/MeldUnits.java @@ -10,6 +10,7 @@ import arc.math.Interp; import arc.math.Mathf; import arc.struct.ObjectIntMap; +import arc.struct.Seq; import arc.util.Log; import arc.util.Tmp; import meld.*; @@ -128,6 +129,7 @@ public static void load(){ bulbheadOverseer = new UnitType("bulbhead-overseer"){{ float IR = 80; + itemCapacity = 0; health = 240; armor = -40; lifetime = 360; @@ -288,11 +290,13 @@ public static void load(){ range = 100; - lightRadius = IR/2; + lightRadius = IR * 2; lightOpacity = 0.5f; + lightColor = Color.orange; buildSpeed = 1; mineTier = 2; mineSpeed = 8; + itemCapacity = 100; buildBeamOffset = 9; rotateToBuilding = false; @@ -636,6 +640,7 @@ public static void load(){ cannonOverseer = new MeldUnitType("cannon-overseer"){{ float IR = 120; + itemCapacity = 0; health = 800; lifetime = 360 * 6; speed = 0; @@ -867,7 +872,7 @@ public static void load(){ health = 200; armor = 45; - drownTimeMultiplier = 0.6f; + drownTimeMultiplier = 0.25f; drag = 0.14f; accel = 0.24f; @@ -1000,8 +1005,6 @@ public static void load(){ }} ); - immunities.addAll(MeldStatusEffects.aspectBurn); - weapons.addAll(craigWeapon(-3, 0)); constructor = LegsUnit::create; @@ -1130,8 +1133,6 @@ public static void load(){ }} ); - immunities.addAll(MeldStatusEffects.aspectBurn); - constructor = LegsUnit::create; }}; @@ -1187,7 +1188,6 @@ public static void load(){ }} ); - immunities.addAll(MeldStatusEffects.aspectBurn); constructor = LegsUnit::create; }}; @@ -1353,7 +1353,6 @@ public static void load(){ }} ); - immunities.addAll(MeldStatusEffects.lacerated); constructor = LegsUnit::create; }}; @@ -1409,7 +1408,6 @@ public static void load(){ }}; }} ); - immunities.addAll(MeldStatusEffects.aspectBurn); constructor = CrawlUnit::create; }}; @@ -1696,7 +1694,6 @@ public static void load(){ }}; }} ); - immunities.addAll(MeldStatusEffects.lacerated); constructor = LegsUnit::create; }}; diff --git a/src/meld/core/Bundles.java b/src/meld/core/Bundles.java new file mode 100644 index 0000000..9f11fbb --- /dev/null +++ b/src/meld/core/Bundles.java @@ -0,0 +1,44 @@ +package meld.core; + +import java.util.*; +import arc.*; +import arc.struct.*; +import arc.util.*; +import arc.util.io.*; +import meld.*; +import mindustry.*; +import mindustry.ui.dialogs.*; + +import static arc.Core.*; + +// very hacky dont do this +public final class Bundles{ + private static final Locale locale = new Locale("shitpost"); + + private Bundles(){} + + public static void load(){ + setupLocale(); + loadBundle(); + } + + private static void setupLocale(){ + Vars.locales = new Seq<>(Vars.locales).add(locale).toArray(); + LanguageDialog.displayNames.put(locale.toString(), "Meld Shitpost"); + } + + private static void loadBundle(){ + if(!settings.getString("locale").equals(locale.toString())) return; + Log.info("loading meld shitpost bundle"); + + var modRoot = Vars.mods.getMod(Meld.name).root; + var bundleFile = modRoot.child("bundles").child("bundle_" + locale + ".properties"); + if(!bundleFile.exists()){ + Log.warn("couldn't find shitpost bundle"); + return; + } + + Reflect.set(bundle, "locale", locale); + PropertiesUtils.load(bundle.getProperties(), bundleFile.reader()); + } +} diff --git a/src/meld/entities/unit/BulbheadEntity.java b/src/meld/entities/unit/BulbheadEntity.java index 49e6808..7eab08d 100644 --- a/src/meld/entities/unit/BulbheadEntity.java +++ b/src/meld/entities/unit/BulbheadEntity.java @@ -156,7 +156,10 @@ public void rotateMove(Vec2 vec) { } public void getNearbyLink(){ - if(CoreRaft.rafts.isEmpty()) return; + if(CoreRaft.rafts.isEmpty()) { + nearbyRaft = null; + return; + } nearbyRaft = CoreRaft.rafts.sort(raft -> raft.dst(this)).first(); if(!within(nearbyRaft, type.fogRadius * Vars.tilesize)) nearbyRaft = null; } diff --git a/src/meld/entities/unit/abilities/BezerkAbility.java b/src/meld/entities/unit/abilities/BezerkAbility.java index 368b933..02f9e03 100644 --- a/src/meld/entities/unit/abilities/BezerkAbility.java +++ b/src/meld/entities/unit/abilities/BezerkAbility.java @@ -56,7 +56,7 @@ public class BezerkAbility extends Ability { public Seq sedated = new Seq<>(); public BezerkAbility(){ - clear.add(MeldStatusEffects.sentry); + clear.add(MeldStatusEffects.sentry, MeldStatusEffects.impaled); sedated.addAll(MeldStatusEffects.lacerated); } diff --git a/src/meld/entities/unit/abilities/FabricatorBatteryAbility.java b/src/meld/entities/unit/abilities/FabricatorBatteryAbility.java index 4f0a889..fe2f052 100644 --- a/src/meld/entities/unit/abilities/FabricatorBatteryAbility.java +++ b/src/meld/entities/unit/abilities/FabricatorBatteryAbility.java @@ -78,20 +78,14 @@ public void update(Unit unit) { } if(active){ - if(enabled){ + if(enabled && unit.buildPlan().build() != null){ charge -= Time.delta * drainSpeed; unit.buildSpeedMultiplier *= speedMulti; zapTimer += Time.delta; if(zapTimer > 12){ zapTimer %= 12; Vec2 targ = new Vec2(); - if(unit.buildPlan().build() != null) { - targ.set(unit.buildPlan().build().x, unit.buildPlan().build().y); - } - else { - Tmp.v1.trns(Mathf.random(360), unit.type.hitSize + Mathf.random(0, 12)).add(unit); - targ.set(Tmp.v1); - } + targ.set(unit.buildPlan().build().x, unit.buildPlan().build().y); MeldFx.chainLightning.at(unit.x, unit.y, 0, Pal.accent, new MeldFx.VisualLightningHolder() { @Override @@ -180,7 +174,7 @@ public void draw(Unit unit) { Draw.rect(MeldRegions.chargeRegions[stage], dx - x * 2, dy); Vars.renderer.lights.add(() -> { - Fill.light(unit.x, unit.y, 4 + (int) lightRadius/4, lightRadius, Tmp.c1.set(unit.type.lightColor).a(1), Tmp.c2.set(unit.type.lightColor).a(0)); + Fill.light(unit.x, unit.y, 4 + (int) lightRadius/4, lightRadius, Tmp.c1.set(unit.type.lightColor).a((float) stage/stageMax * 0.5f), Tmp.c2.set(unit.type.lightColor).a(0)); }); } } diff --git a/src/meld/entities/unit/abilities/SlipstreamHullAbility.java b/src/meld/entities/unit/abilities/SlipstreamHullAbility.java index 994a2fc..f3e163e 100644 --- a/src/meld/entities/unit/abilities/SlipstreamHullAbility.java +++ b/src/meld/entities/unit/abilities/SlipstreamHullAbility.java @@ -13,7 +13,8 @@ public void update(Unit unit) { super.update(unit); if(unit.tileOn() != null) { Tile tile = unit.tileOn(); - unit.dragMultiplier /= Math.max(unit.tileOn().floor().dragMultiplier, 1); + unit.dragMultiplier /= Math.max(tile.floor().dragMultiplier, 1); + unit.speedMultiplier /= Math.max(tile.floor().speedMultiplier, 1); //TODO: Better wakes for naval units /* diff --git a/src/meld/entities/unit/abilities/SolidSpeedAbility.java b/src/meld/entities/unit/abilities/SolidSpeedAbility.java index 1665b6a..1764022 100644 --- a/src/meld/entities/unit/abilities/SolidSpeedAbility.java +++ b/src/meld/entities/unit/abilities/SolidSpeedAbility.java @@ -12,8 +12,8 @@ public class SolidSpeedAbility extends Ability { public SolidSpeedAbility(){ super(); - } + @Override public void update(Unit unit) { super.update(unit); diff --git a/src/meld/fluid/Aspect.java b/src/meld/fluid/Aspect.java index 70c6674..5954e86 100644 --- a/src/meld/fluid/Aspect.java +++ b/src/meld/fluid/Aspect.java @@ -12,6 +12,7 @@ public class Aspect extends Liquid { public boolean setDefaults = true; + //Opacity per liquid unit in a block public float lightOpacity = 0.5f; public Aspect(String name) { diff --git a/src/meld/graphics/MeldLayers.java b/src/meld/graphics/MeldLayers.java index 8525355..a514861 100644 --- a/src/meld/graphics/MeldLayers.java +++ b/src/meld/graphics/MeldLayers.java @@ -8,6 +8,7 @@ public class MeldLayers { funnyNumber = 0.691337f, smokeLow = 50 + funnyNumber, smokeHigh = 105 + funnyNumber, + overlayOver = Layer.fogOfWar + 2 + funnyNumber, sonar = Layer.fogOfWar + 1 + funnyNumber, sonarInside = Layer.fogOfWar + 3 + funnyNumber; } diff --git a/src/meld/graphics/MeldLightRenderer.java b/src/meld/graphics/MeldLightRenderer.java index 9d8667e..cf56808 100644 --- a/src/meld/graphics/MeldLightRenderer.java +++ b/src/meld/graphics/MeldLightRenderer.java @@ -211,6 +211,7 @@ public boolean enabled(){ } public void draw(){ + draw2(); } public void draw2(){ @@ -229,8 +230,8 @@ public void draw2(){ Draw.color(); buffer.begin(Color.clear); Draw.sort(false); - Gl.blendEquationSeparate(Gl.funcAdd, Gl.max); - Blending.additive.apply(); + Draw.blend(Blending.additive); + for(Runnable run : lights){ run.run(); } @@ -240,8 +241,6 @@ public void draw2(){ Draw.rect(circleRegion, cir.x, cir.y, cir.radius * 2, cir.radius * 2); } Draw.reset(); - Blending.normal.apply(); - Draw.sort(true); Texture lightTex = buffer.getTexture(); buffer.end(); Draw.color(); @@ -249,9 +248,6 @@ public void draw2(){ //TODO: potential memory leak Draw.color(); shadowBuffer.begin(Color.clear); - Draw.sort(false); - Blending.additive.apply(); - Gl.blendEquationSeparate(Gl.funcAdd, Gl.funcAdd); shadowBuffer.resize(Core.graphics.getWidth()/scaling, Core.graphics.getHeight()/scaling); for(Runnable run : shadows){ @@ -259,10 +255,10 @@ public void draw2(){ } Draw.reset(); - Blending.normal.apply(); Draw.sort(true); Texture exclusionTex = shadowBuffer.getTexture(); shadowBuffer.end(); + Draw.blend(Blending.normal); Draw.color(); diff --git a/src/meld/graphics/MeldPal.java b/src/meld/graphics/MeldPal.java index 2eb0d02..c1b61d1 100644 --- a/src/meld/graphics/MeldPal.java +++ b/src/meld/graphics/MeldPal.java @@ -6,9 +6,10 @@ public class MeldPal { public static Color - meldFloorGlow = Color.valueOf("d26ab12b"), - meldFloorGlowDeep = Color.valueOf("ca3fba21"), - meldFloorGlowHadal = Color.valueOf("ca3fba1b"), + //VERY low opacity since pools overlap with their light radius + meldFloorGlow = Color.valueOf("d26ab1").a(0.1f), + meldFloorGlowDeep = Color.valueOf("ca3fba").a(0.05f), + meldFloorGlowHadal = Color.valueOf("ca3fba").a(0.02f), aspect = Color.valueOf("f0f5fe"), diff --git a/src/meld/graphics/MeldShaders.java b/src/meld/graphics/MeldShaders.java index 976c189..4eccdc2 100644 --- a/src/meld/graphics/MeldShaders.java +++ b/src/meld/graphics/MeldShaders.java @@ -41,8 +41,6 @@ public static void load(){ sonar = new SonarShader("sonar"); light = new LightShaderMeld("light"); - - Events.run(EventType.Trigger.draw, () -> { sonarBuffer.resize(Core.graphics.getWidth(), Core.graphics.getHeight()); @@ -51,10 +49,6 @@ public static void load(){ Draw.draw(Layer.background, () -> { lightBuffer.begin(); }); - Draw.draw(Layer.light, () -> { - lightBuffer.end(); - MeldLightRenderer.thingo.draw2(); - }); } Draw.drawRange(MeldLayers.sonar, 0.1f, () -> { diff --git a/src/meld/graphics/TextModifiers.java b/src/meld/graphics/TextModifiers.java new file mode 100644 index 0000000..bfc283c --- /dev/null +++ b/src/meld/graphics/TextModifiers.java @@ -0,0 +1,68 @@ +package meld.graphics; + +import arc.Core; +import arc.graphics.Color; +import arc.math.Interp; +import arc.math.Mathf; +import arc.util.Time; +import arc.util.Tmp; + +public class TextModifiers { + + private static final StringBuilder b = new StringBuilder(); + + public static char[] glitchChars = new char[]{'-', '=', ',', '&'}; + + //Modifies the input string + public static String glitchy(String input, float edgeMultiplier, float baseChance, float speed){ + if(baseChance == 0) return input; + Mathf.rand.setSeed((int)(Time.globalTime/60 * speed)); + + StringBuilder output = new StringBuilder(); + for (float i = 0; i < input.length(); i++) { + int j = (int)i; + float chance = Mathf.lerp(baseChance, baseChance * edgeMultiplier, Interp.slope.apply(i/input.length())); + if(!Mathf.chance(chance * (1 + edgeMultiplier) * Interp.slope.apply(i/input.length()))){ + output.append(input.charAt(j)); + continue; + } + output.append(glitchChars[Mathf.ceilPositive(Mathf.random(glitchChars.length) - 1)]); + } + return output.toString(); + } + + //Modifies the input string + public static String glitchyNumb(float number, float chance, float speed){ + if(chance == 0) return String.valueOf(number); + Mathf.rand.setSeed((int)(Time.globalTime/60 * speed)); + if(Mathf.chance(chance)) return String.valueOf((int)Mathf.range(number)); + return String.valueOf(number); + } + + //Modifies the input string + public static String glitchyEntry(String input, float edgeMultiplier, float baseChance, float speed){ + return glitchy(Core.bundle.get(input), edgeMultiplier, baseChance, speed); + } + + //Thanks smolkey + public static String gradient(String in, Color... colors){ + if(colors.length == 1) return "[#" + colors[0].toString().substring(0, 6) + "]" + in + "[]"; + + b.setLength(0); + b.trimToSize(); + int length = in.length(); + int spaces = 0; + + for(int i = 0; i < length; i++){ + char ind = in.charAt(i); + if(Character.isWhitespace(ind)){ + spaces++; + b.append(' '); + continue; + } + b.append("[#").append(Tmp.c1.set(colors[0]).lerp(colors, (float) i / (length - spaces)).toString(), 0, 6).append("]").append(ind).append("[]"); + } + + return b.toString(); + } +} diff --git a/src/meld/graphics/TileDrawers.java b/src/meld/graphics/TileDrawers.java new file mode 100644 index 0000000..80b5701 --- /dev/null +++ b/src/meld/graphics/TileDrawers.java @@ -0,0 +1,30 @@ +package meld.graphics; + +import arc.graphics.g2d.Draw; +import arc.graphics.g2d.Fill; +import arc.math.Mathf; +import arc.util.Time; +import mindustry.Vars; +import mindustry.graphics.Pal; + +//Class which exclusively draws 1x1 squares. yes. +public class TileDrawers { + + public static float tileRad = Vars.tilesize/2f; + + public static void drawFog(float x, float y, float radius){ + float offset = x/4f + y; + offset/=Vars.tilesize; + Draw.color(Pal.gray, Pal.darkerGray, 0.5f + 0.5f * Mathf.sin(Time.globalTime/4f + offset, 1, 1)); + Draw.alpha(1); + Fill.square(x, y, radius); + Draw.reset(); + } + + public static void drawInvalid(float x, float y, float radius){ + Draw.color(Pal.health); + Draw.alpha(0.5f); + Fill.square(x, y, radius); + Draw.reset(); + } +} diff --git a/src/meld/graphics/part/SonarPart.java b/src/meld/graphics/part/SonarPart.java index 43b0c3f..b1e40d1 100644 --- a/src/meld/graphics/part/SonarPart.java +++ b/src/meld/graphics/part/SonarPart.java @@ -46,9 +46,7 @@ public void draw(PartParams params) { Vec2 pos = new Vec2(Tmp.v1); Vars.renderer.lights.add(() -> { - Draw.blend(Blending.additive); - Fill.light(pos.x, pos.y, 100, radius, Pal.accent, MeldPal.accentClear); - Draw.blend(Blending.normal); + Fill.light(pos.x, pos.y, 100, radius, Tmp.c1.set(Pal.accent).a(0.1f), MeldPal.accentClear); }); } } diff --git a/src/meld/io/ItemIO.java b/src/meld/io/ItemIO.java new file mode 100644 index 0000000..ef27bec --- /dev/null +++ b/src/meld/io/ItemIO.java @@ -0,0 +1,41 @@ +package meld.io; + +import arc.util.io.Reads; +import arc.util.io.Writes; +import mindustry.Vars; +import mindustry.type.Item; +import mindustry.type.ItemStack; + +//An IO class used to handle item-related input and output +public class ItemIO { + public static void writeStack(Writes write, ItemStack stack){ + write.str(stack.item.name); + write.i(stack.amount); + } + + public static ItemStack readStack(Reads reads){ + return new ItemStack(Vars.content.item(reads.str()), reads.i()); + } + public static void writeStacks(Writes write, ItemStack[] stacks){ + write.i(stacks.length); + for (ItemStack stack: stacks) { + writeStack(write, stack); + } + } + + public static ItemStack[] readStacks(Reads read){ + int size = read.i(); + ItemStack[] items = new ItemStack[size]; + for (int i = 0; i < size; i++) { + items[i] = readStack(read); + } + return items; + } + + public static void writeItem(Writes write, Item item){ + write.str(item == null ? "" : item.name); + } + public static Item readItem(Reads reads){ + return Vars.content.item(reads.str()); + } +} \ No newline at end of file diff --git a/src/meld/ui/MeldSettings.java b/src/meld/ui/MeldSettings.java index 61aed77..322efd6 100644 --- a/src/meld/ui/MeldSettings.java +++ b/src/meld/ui/MeldSettings.java @@ -59,7 +59,7 @@ public static void loadSettings(){ Vars.ui.settings.addCategory(Core.bundle.get("settings.meld-title"), Meld.prefix("icon"), t -> { check(t, SettingKeys.lighting, true, b -> replaceLighting = b); - check(t, SettingKeys.invertAmbient, true, b -> invertAmbient = b); + check(t, SettingKeys.invertAmbient, false, b -> invertAmbient = b); check(t, SettingKeys.connectedSonar, true, b -> connectedSonar = b); check(t, SettingKeys.overlayOverFog, true, b -> overlayOverFog = b); @@ -75,34 +75,6 @@ public static void loadSettings(){ check(t, SettingKeys.bulbheadOmnimove, false, MeldUnits::bulbheadOmnimove); check(t, SettingKeys.portSaves, false, b -> portSaves = b); }); - - /* - photosensitiveMode = Core.settings.getBool("settings.frostscape-flashing-lights-safety", false); - heatOverlay.enabled = Core.settings.getBool("settings.frostscape-heat-overlay", false); - simplifiedLightning = Core.settings.getBool("settings.frostscape-simple-lightning"); - parallax = Core.settings.getInt("settings.frostscape-parallax"); - - heatOverlay.enabled = Core.settings.getBool("settings.frostscape-heat-overlay", false); - ui.settings.addCategory(Core.bundle.get("settings.frostscape-title"), NAME + "-hunter", t -> { - t.sliderPref(Core.bundle.get("settings.frostscape-parallax"), 100, 1, 100, 1, s -> { - parallax = s/100; - return s + "%"; - }); - t.sliderPref(Core.bundle.get("settings.frostscape-wind-visual-force"), 1, 0, 8, 1, s -> s * 100 + "%"); - t.checkPref(Core.bundle.get("settings.frostscape-flashing-lights-safety"), false, b -> { - photosensitiveMode = b; - }); - t.checkPref(Core.bundle.get("settings.frostscape-heat-overlay"), false, b -> { - heatOverlay.enabled = b; - }); - t.checkPref(Core.bundle.get("settings.frostscape-simple-lightning"), false, b -> { - simplifiedLightning = b; - }); - t.row(); - t.add(Core.bundle.get("settings.frostscape.flashingwarning")).wrap().left().growX().padTop(3); - }); - - */ } } diff --git a/src/meld/world/WorldUtil.java b/src/meld/world/WorldUtil.java index 4a42173..356aef7 100644 --- a/src/meld/world/WorldUtil.java +++ b/src/meld/world/WorldUtil.java @@ -52,12 +52,14 @@ public static ItemModule totalQuarry(int x1, int y1, int x2, int y2){ return module; } - public static ItemModule totalQuarry(float x, float y, Block block, boolean blockable){ + public static ItemModule totalQuarry(float x, float y, Block block, boolean blockable, boolean respectFoW){ module.clear(); Tile startTile = world.tileWorld(x, y); if(startTile == null) return module; startTile.getLinkedTilesAs(block, (tile) -> { + if(respectFoW && !Vars.fogControl.isDiscovered(Vars.player.team(), tile.x, tile.y)) return; + if(tile == null || tile.solid() && blockable && tile.block() != block) return; GrindingQuary.GrinderEntry entry = GrindingQuary.grinderMap.get(tile.floor()); @@ -72,13 +74,13 @@ public static ItemModule totalQuarry(float x, float y, Block block, boolean bloc return module; } - public static ObjectFloatMap quarrySpeed(float x, float y, GrindingQuary block){ + public static ObjectFloatMap quarrySpeed(float x, float y, GrindingQuary block, boolean respectFoW){ speeds.clear(); Tile startTile = world.tileWorld(x, y); if(startTile == null) return speeds; startTile.getLinkedTilesAs(block, (tile) -> { - if(tile == null) return; + if(tile == null || respectFoW && !Vars.fogControl.isDiscovered(Vars.player.team(), tile.x, tile.y)) return; Item item = tile.overlay().itemDrop; if(item != null) speeds.put(item, speeds.get(item, 0) + block.drillSpeedOverlay(tile)); diff --git a/src/meld/world/blocks/defense/LakeRim.java b/src/meld/world/blocks/defense/LakeRim.java index 4be9ae6..4f544d2 100644 --- a/src/meld/world/blocks/defense/LakeRim.java +++ b/src/meld/world/blocks/defense/LakeRim.java @@ -21,5 +21,15 @@ public boolean canPlaceOn(Tile tile, Team team, int rotation) { if(nearby.floor().isLiquid) return true; } return false; + + + } + + public class LakeRimBuild extends DoorBuild{ + + @Override + public boolean checkSolid(){ + return !open; + } } } diff --git a/src/meld/world/blocks/fluid/VisualAspectPipe.java b/src/meld/world/blocks/fluid/VisualAspectPipe.java index 8319871..9b3699d 100644 --- a/src/meld/world/blocks/fluid/VisualAspectPipe.java +++ b/src/meld/world/blocks/fluid/VisualAspectPipe.java @@ -1,6 +1,7 @@ package meld.world.blocks.fluid; import arc.graphics.Blending; +import arc.graphics.Color; import arc.graphics.g2d.Draw; import arc.graphics.g2d.Fill; import arc.graphics.g2d.TextureRegion; @@ -250,9 +251,20 @@ public void drawInbetween(){ ); } } + } + Draw.blend(); + Draw.reset(); + } - Draw.blend(); - Draw.reset(); + @Override + public void drawLiquidLight(Liquid liquid, float amount) { + if (amount > 0.01F) { + Color color = liquid.lightColor; + float fract = 1.0f; + float opacity = color.a * fract; + if (opacity > 0.001F) { + Drawf.light(this.x, this.y, (float)this.block.size * 30.0F * fract, color, opacity * amount); + } } } } diff --git a/src/meld/world/blocks/producer/ProduceLiquid.java b/src/meld/world/blocks/producer/ProduceLiquid.java index 81b74c7..05f043c 100644 --- a/src/meld/world/blocks/producer/ProduceLiquid.java +++ b/src/meld/world/blocks/producer/ProduceLiquid.java @@ -1,6 +1,7 @@ package meld.world.blocks.producer; import arc.math.Mathf; +import arc.util.Time; import mindustry.gen.Building; import mindustry.type.ItemStack; import mindustry.type.Liquid; @@ -28,6 +29,6 @@ public float efficiency(Building build) { @Override public void update(Building build) { super.update(build); - build.handleLiquid(build, output.liquid, output.amount); + build.handleLiquid(build, output.liquid, output.amount * Time.delta); } } diff --git a/src/meld/world/blocks/production/Depot.java b/src/meld/world/blocks/production/Depot.java index c0b39f2..7525563 100644 --- a/src/meld/world/blocks/production/Depot.java +++ b/src/meld/world/blocks/production/Depot.java @@ -72,19 +72,24 @@ public Item config(){ return sortItem; } + @Override + public boolean acceptItem(Building source, Item item) { + return (sortItem == item || sortItem == null) && items.get(item) < getMaximumAccepted(item); + } @Override public void updateTile(){ if(lastItem == null && items.any()){ //branching just for the sake of my sanity here if(sortItem == null || sortItem == items.first()) lastItem = items.first(); + else if(items.has(sortItem)) lastItem = sortItem; } if(lastItem != null){ time += 1f / speed * delta(); Building target = getTileTarget(lastItem, lastInput, false); - if(target != null && (time >= 1f || !(target.block instanceof Router || target.block.instantTransfer))){ + if(target != null && (time >= 1f || !(target.block instanceof Depot || target.block.instantTransfer))){ getTileTarget(lastItem, lastInput, true); target.handleItem(this, lastItem); items.remove(lastItem, 1); diff --git a/src/meld/world/blocks/production/GrindingQuary.java b/src/meld/world/blocks/production/GrindingQuary.java index 58e6dce..b603f73 100644 --- a/src/meld/world/blocks/production/GrindingQuary.java +++ b/src/meld/world/blocks/production/GrindingQuary.java @@ -1,5 +1,6 @@ package meld.world.blocks.production; +import arc.Core; import arc.graphics.Color; import arc.graphics.g2d.Draw; import arc.graphics.g2d.Fill; @@ -13,6 +14,8 @@ import arc.util.io.Reads; import arc.util.io.Writes; import meld.graphics.Draww; +import meld.graphics.TextModifiers; +import meld.graphics.TileDrawers; import meld.world.WorldUtil; import meld.world.blocks.io.BlockIO; import meld.world.util.ItemLogic; @@ -29,9 +32,12 @@ import mindustry.world.consumers.Consume; import mindustry.world.modules.ItemModule; +import static meld.graphics.TileDrawers.tileRad; + public class GrindingQuary extends Block { public static ObjectMap grinderMap = new ObjectMap<>(); + public static Seq alwaysDump = new Seq<>(); public static ObjectFloatMap drillMultipliers = new ObjectFloatMap<>(); @@ -50,24 +56,34 @@ public GrindingQuary(String name) { } public Seq valid = new Seq<>(), overlay = new Seq<>(); + float fogTiles = 0; @Override public void drawOverlay(float x, float y, int rotation) { super.drawOverlay(x, y, rotation); - float drawx = x, drawy = y - (size * Vars.tilesize)/2f - 2; Tile start = Vars.world.tileWorld(x, y); + fogTiles = 0; + float multiplier = 1; if(start != null){ valid.clear(); overlay.clear(); + + if(Vars.control.input.block == null && start.build instanceof GrindingQuaryBuild build && start== build.tile && start.block() == this){ + multiplier = build.boostAmount; + } + start.getLinkedTilesAs(this, tile -> { if(tile != null){ + if(!Vars.fogControl.isDiscovered(Vars.player.team(), tile.x, tile.y)){ + fogTiles++; + TileDrawers.drawFog(tile.worldx(), tile.worldy(), tileRad); + return; + } if(tile.solid() && tile.block() != this){ - Draw.color(Pal.health); - Draw.alpha(0.5f); - Fill.square(tile.worldx(), tile.worldy(), Vars.tilesize/2f); + TileDrawers.drawInvalid(tile.worldx(), tile.worldy(), tileRad); return; } if(grinderMap.containsKey(tile.floor())){ @@ -78,6 +94,7 @@ public void drawOverlay(float x, float y, int rotation) { } } }); + //Draw this in stages valid.each(tile -> { Draw.color(Pal.accent); @@ -93,8 +110,8 @@ public void drawOverlay(float x, float y, int rotation) { valid.each(tile -> { Draw.color(Color.white); - float prog = Mathf.absin(Time.time/30 + (tile.x + tile.y) * Mathf.pi/3, 1, 1); - float prog2 = Time.time/240 + (tile.x + tile.y) * Mathf.pi % 1; + float prog = Mathf.absin(Time.globalTime/30 + (tile.x + tile.y) * Mathf.pi/3, 1, 1); + float prog2 = Time.globalTime/240 + (tile.x + tile.y) * Mathf.pi % 1; Draw.alpha(0.5f + 0.5f * prog); Draw.rect(tile.floor().region, tile.worldx(), tile.worldy() -2 + prog * 4, 4 + 4 * prog, 4 + 4 * Mathf.sin(prog), -15 + 30 * prog + 360 * prog2); }); @@ -107,24 +124,54 @@ public void drawOverlay(float x, float y, int rotation) { } Drawf.text(); - ItemModule depositItems = WorldUtil.totalQuarry(x, y, this, true); + + boolean found = false; + + float fogPercent = fogTiles/size/size; + float fin = fogPercent * fogPercent; + float glitchChance = fin, glitchSpeed = 2 + fin * 8; + + float drawx = x, drawy = y - (size * Vars.tilesize)/2f - 2; + ItemModule depositItems = WorldUtil.totalQuarry(x, y, this, true, true); for (Item item : Vars.content.items()) { float amount = depositItems.get(item); if(amount == 0) continue; - Draww.itemText(item.localizedName + ": " + amount, drawx, drawy, item); + found = true; + Draww.itemText(TextModifiers.glitchy(item.localizedName + ": " + TextModifiers.glitchyNumb(amount, glitchChance * 4, glitchSpeed * 4), 2, glitchChance, glitchSpeed), + drawx, drawy, item); drawy -= 10; } + if(!found){ + Draww.drawTextUnderlined(TextModifiers.glitchyEntry("overlay.deposit-missing", 2, glitchChance, glitchSpeed), + drawx, drawy, Pal.lightishGray); + } + + found = false; drawy = y + (size * Vars.tilesize)/2f + 2; - ObjectFloatMap drillSpeeds = WorldUtil.quarrySpeed(x, y, this); + ObjectFloatMap drillSpeeds = WorldUtil.quarrySpeed(x, y, this, true); for (Item item : Vars.content.items()) { float amount = drillSpeeds.get(item, 0); if(amount == 0) continue; - Draww.itemText(item.localizedName + ": " + amount + "/s", drawx, drawy, item); + found = true; + Draww.itemText(TextModifiers.glitchy(item.localizedName + ": " + TextModifiers.glitchyNumb(amount * multiplier, glitchChance * 4, glitchSpeed * 4) + "/s", 2, glitchChance, glitchSpeed), + drawx, drawy, item); drawy += 10; } + + if(!found){ + Draww.drawTextUnderlined(TextModifiers.glitchyEntry("overlay.ore-missing", 2, glitchChance, glitchSpeed), + drawx, drawy, Pal.lightishGray); + } + + drawx = x - (size * Vars.tilesize)/2f - 2; + drawy = y; + + if(multiplier > 1){ + Draww.drawTextUnderlined(multiplier + "x ", drawx, drawy, Pal.accent); + } } public static class GrinderEntry{ @@ -182,19 +229,32 @@ public boolean shouldConsume() { for (Item key : itemRates.keys()) { if(itemRates.get(key, 0) * drillMultipliers.get(key, 1) > 0 && acceptItem(this, key)) return true; } - return target != null; + return target != null && ItemLogic.capacity(entry.output, this); } @Override public void update(){ super.update(); updateDrilling(); - dump(); + + for (Item key : drillTimers.keys()) { + dumpAccumulate(key); + } + + alwaysDump.each(this::dumpAccumulate); progress += Time.delta/itemDuration; if(progress >= 1){ progress %= 1; + + //Get the speed boost from the non optional aspect consumer boostAmount = 1; + + for (Consume consumer : consumers) { + if(!consumer.booster && consumer.efficiency(this) > 0) boostAmount = consumer.efficiencyMultiplier(this); + } + //Get the speed boost from the non optional aspect consumer + for (Consume consumer : consumers) { if(consumer.booster && consumer.optional && consumer.efficiency(this) > 0) boostAmount *= consumer.efficiencyMultiplier(this); consumer.trigger(this); diff --git a/src/meld/world/blocks/production/SingleBeamDrill.java b/src/meld/world/blocks/production/SingleBeamDrill.java index 1864ebf..ee5386a 100644 --- a/src/meld/world/blocks/production/SingleBeamDrill.java +++ b/src/meld/world/blocks/production/SingleBeamDrill.java @@ -1,7 +1,9 @@ package meld.world.blocks.production; +import arc.Core; import arc.graphics.Color; import arc.graphics.g2d.Draw; +import arc.graphics.g2d.Fill; import arc.graphics.g2d.Lines; import arc.math.Mathf; import arc.math.geom.Geometry; @@ -12,10 +14,13 @@ import arc.struct.ObjectMap; import arc.util.Log; import arc.util.Time; +import arc.util.Tmp; import arc.util.io.Reads; import arc.util.io.Writes; import meld.content.MeldBullets; import meld.graphics.Draww; +import meld.graphics.TextModifiers; +import meld.graphics.TileDrawers; import mindustry.Vars; import mindustry.content.Fx; import mindustry.entities.Damage; @@ -32,8 +37,10 @@ import mindustry.world.Tile; import mindustry.world.blocks.production.BeamDrill; import mindustry.world.blocks.production.Drill; +import mindustry.world.consumers.Consume; import mindustry.world.meta.BlockFlag; +import static meld.graphics.TileDrawers.tileRad; import static mindustry.Vars.iconSmall; //HAS TO be an odd number in size. @@ -76,6 +83,15 @@ public SingleBeamDrill(String name) { @Override public void drawOverlay(float x, float y, int rotation) { + float multiplier = 1; + + Tile start = Vars.world.tileWorld(x, y); + if(start != null){ + if(Vars.control.input.block == null && start.build instanceof SingleBeamBuild build && start== build.tile && start.block() == this){ + multiplier = build.boostAmount; + } + } + Item found = null; int unusedTiles = range + 1; @@ -85,19 +101,29 @@ public void drawOverlay(float x, float y, int rotation) { int tx = (int) x/Vars.tilesize, ty = (int) y/Vars.tilesize; Tile other = null; + float drawy = y + Vars.tilesize * size/2f; + for(int i = 0; i < range; i++) { unusedTiles--; int j = i + offset; other = Vars.world.tile(tx + dir.x * j, ty + dir.y * j); + if(!Vars.fogControl.isDiscovered(Vars.player.team(), other.x, other.y)){ + TileDrawers.drawFog(other.worldx(), other.worldy(), tileRad); + Draww.drawTextUnderlined(TextModifiers.glitchyEntry("overlay.in-fog", 3, 0.15f, 2), x, drawy, Tmp.c1.set(Pal.lightishGray).lerp(Pal.gray, Mathf.absin(Time.globalTime/10f, 1, 1))); + + Drawf.dashLine(Pal.accent, x, y, x + dir.x * (range + offset) * Vars.tilesize, y + dir.y * (range + offset) * Vars.tilesize); + return; + } + if(other.solid()){ found = other.block().itemDrop; int mined = (int)((baseProductivity + distanceProductivity * unusedTiles) * itemMultipliers.get(found, 1)); if(found != null){ Item current = transformItems.get(found, found); - Draww.itemText(mined/drillTime * 60 + " " + current.localizedName + "/s", x, y + Vars.tilesize * size/2f, current); + Draww.itemText(mined/drillTime * 60 * multiplier+ " " + current.localizedName + "/s", x, drawy, current); if(found != current){ - float drawy = y - Vars.tilesize * size/2f; + drawy = y - Vars.tilesize * size/2f; float s = iconSmall / 4f; float textWidth = Draww.drawTextUnderlined("->", x, drawy, Pal.accent); Draw.mixcol(Color.darkGray, 1f); @@ -107,6 +133,19 @@ public void drawOverlay(float x, float y, int rotation) { Draw.rect(found.fullIcon, x - textWidth, drawy, s, s); Draw.rect(current.fullIcon, x + textWidth, drawy, s, s); } + + float drawx = x - (size * Vars.tilesize)/2f - 2; + drawy = y; + + if(multiplier > 1){ + Draww.drawTextUnderlined(multiplier + "x ", drawx, drawy, Pal.accent); + } + } + else if(other.build != null && other.build.team == Vars.player.team()){ + Draww.drawTextUnderlined(Core.bundle.get("overlay.friendly-fire"), x, drawy, Pal.remove); + } + else { + Draww.drawTextUnderlined(Core.bundle.get("overlay.drop-missing"), x, drawy, Pal.accent); } Lines.stroke(3); @@ -119,21 +158,36 @@ public void drawOverlay(float x, float y, int rotation) { Drawf.dashLine(Pal.accent, x, y, other.worldx(), other.worldy()); return; } + TileDrawers.drawInvalid(other.worldx(), other.worldy(), tileRad); } - Drawf.dashLine(Pal.accent, x, y, x + dir.x * range * Vars.tilesize, y + dir.y * range * Vars.tilesize); + //We havn't found anything to mine + Draww.drawTextUnderlined(Core.bundle.get("overlay.ore-missing"), x, drawy, Pal.lightishGray); + Drawf.dashLine(Pal.accent, x, y, x + dir.x * (range + offset) * Vars.tilesize, y + dir.y * (range + offset) * Vars.tilesize); } public class SingleBeamBuild extends Building{ public float time; + public float boostAmount = 1; @Override public boolean shouldConsume() { return super.shouldConsume() && healthf() >= minHealthf; } + @Override + public float edelta() { + return super.edelta() * boostAmount; + } + @Override public void updateTile() { super.updateTile(); + + boostAmount = 1; + for (Consume consumer : consumers) { + if(consumer.efficiency(this) > 0) boostAmount *= consumer.efficiencyMultiplier(this); + } + if(healthf() >= minHealthf) time += edelta(); if(time >= drillTime){ drill(); @@ -163,12 +217,17 @@ public void drill(){ other = Vars.world.tile(tx + dir.x * j, ty + dir.y * j); if(other.solid()){ - if(bigExplosion == null){ - Damage.dynamicExplosion(other.worldx(), other.worldy(), 5, 5, 30000, Vars.tilesize * 3, true, hitEffect); - Damage.dynamicExplosion(other.worldx(), other.worldy(), 5, 15, 0, Vars.tilesize * 2, true, hitEffect); - } - else bigExplosion.create(this, Team.derelict, other.worldx() - dir.x * Vars.tilesize, other.worldy() - dir.y * Vars.tilesize, 0); if(other.build != null) other.build.damage(targetDamage); + //BOOMY! :D + float boomx = other.worldx(), boomy = other.worldy(); + Time.run(5, () -> { + if(bigExplosion == null){ + Damage.dynamicExplosion(boomx, boomy, 5, 5, 30000, Vars.tilesize * 3, true, hitEffect); + Damage.dynamicExplosion(boomx, boomy, 5, 15, 0, Vars.tilesize * 2, true, hitEffect); + } + else bigExplosion.create(this, Team.derelict, boomx - dir.x * Vars.tilesize, boomy - dir.y * Vars.tilesize, 0); + + }); Item drop = other.wallDrop(); diff --git a/src/meld/world/blocks/units/UnitLogisticsPad.java b/src/meld/world/blocks/units/UnitLogisticsPad.java index c898d42..5d1af67 100644 --- a/src/meld/world/blocks/units/UnitLogisticsPad.java +++ b/src/meld/world/blocks/units/UnitLogisticsPad.java @@ -4,11 +4,14 @@ import arc.graphics.*; import arc.graphics.g2d.*; import arc.math.Mathf; +import arc.math.geom.Geometry; import arc.scene.ui.layout.*; import arc.struct.*; import arc.util.*; import arc.util.io.*; import arc.util.pooling.Pool.*; +import meld.graphics.TileDrawers; +import meld.io.ItemIO; import mindustry.Vars; import mindustry.entities.units.*; import mindustry.gen.*; @@ -56,6 +59,10 @@ public UnitLogisticsPad(String name){ config(Item.class, (UnloadingPadBuild tile, Item item) -> tile.sortItem = item); config(Float.class, (UnloadingPadBuild tile, Float value) -> tile.targetPercent = value); + config(Float[].class, (UnloadingPadBuild tile, Float[] value) -> { + tile.targetPercent = value[0]; + tile.sortItem = content.item(value[1].intValue()); + }); configClear((UnloadingPadBuild tile) -> tile.sortItem = null); } @@ -83,6 +90,16 @@ public void drawOverlay(float x, float y, int rotation) { x += offset; y += offset; + int tx = (int)x/tilesize, ty = (int)y/tilesize; + + int tileRange = (int)(range/tilesize/2f); + for(int dx = -tileRange; dx <= tileRange; dx++){ + for(int dy = -tileRange; dy <= tileRange; dy++){ + if(!fogControl.isDiscovered(player.team(), tx + dx, ty + dy)){ + TileDrawers.drawFog((tx + dx) * tilesize, (ty + dy) * tilesize, TileDrawers.tileRad); + } + } + } Drawf.dashSquare(Pal.accent, x, y, range); } @@ -206,8 +223,8 @@ public void buildConfiguration(Table table){ } @Override - public Item config(){ - return sortItem; + public Float[] config(){ + return new Float[]{targetPercent, (float)sortItem.id}; } @Override @@ -218,7 +235,7 @@ public byte version(){ @Override public void write(Writes write){ super.write(write); - write.i(sortItem == null ? -1 : sortItem.id); + ItemIO.writeItem(write, sortItem); write.f(targetPercent); write.f(unloadTimer); } @@ -226,8 +243,7 @@ public void write(Writes write){ @Override public void read(Reads read, byte revision){ super.read(read, revision); - id = read.i(); - sortItem = id == -1 ? null : content.item(id); + sortItem = ItemIO.readItem(read); targetPercent = read.f(); unloadTimer = read.f(); }