diff --git a/mod.hjson b/mod.hjson index 0101d19c..a2ff76b4 100644 --- a/mod.hjson +++ b/mod.hjson @@ -3,5 +3,5 @@ author: "Yuria & Lao" name: "new-horizon" main: "newhorizon.NewHorizon" description: "Beta Release. Campaign Not Included.\n\nCurrently contains stable content and optional vanilla override. \n\nMod is playable as extension for both Serpulo and Erekir. \n\nCampaign still WIP." -version: "2.1.0-hotfix" +version: "2.1.0-hotfix2" minGameVersion: 154 diff --git a/src/newhorizon/content/NHBullets.java b/src/newhorizon/content/NHBullets.java index 3cdc5a78..4f326dcb 100644 --- a/src/newhorizon/content/NHBullets.java +++ b/src/newhorizon/content/NHBullets.java @@ -360,6 +360,9 @@ public static void load() { }}; artilleryNgt = new TrailFadeBulletType(2f, 250) {{ + velocityBegin = 2f; + velocityIncrease = 0f; + tracers = 1; tracerStroke = 1.2f; tracerSpacing = 4f; diff --git a/src/newhorizon/content/blocks/CraftingBlock.java b/src/newhorizon/content/blocks/CraftingBlock.java index 744aef04..864056b6 100644 --- a/src/newhorizon/content/blocks/CraftingBlock.java +++ b/src/newhorizon/content/blocks/CraftingBlock.java @@ -6,6 +6,7 @@ import arc.graphics.g2d.Draw; import arc.graphics.g2d.Fill; import arc.graphics.g2d.Lines; +import arc.graphics.g2d.TextureRegion; import arc.math.Angles; import arc.math.Interp; import arc.math.Mathf; @@ -1581,46 +1582,28 @@ public void load(Block block) { drawer = new DrawMulti( new DrawRegionFlip("-base"), - new DrawRegion("-piston-1") { - @Override - public void draw(Building build) { - Tmp.v1.setAngle(90f + build.rotdeg()).setLength(Mathf.absin(build.totalProgress(), 12f, 3)); - Draw.rect(region, build.x + Tmp.v1.x, build.y + Tmp.v1.y, region.width / 4f, region.height / 4f); - } - }, - new DrawRegion("-piston-1") { - @Override - public void draw(Building build) { - Tmp.v1.setAngle(270f + build.rotdeg()).setLength(Mathf.absin(build.totalProgress(), 12f, 3)); - Draw.rect(region, build.x + Tmp.v1.x, build.y + Tmp.v1.y, region.width / 4f, -region.height / 4f); - } - }, - new DrawRegion("-piston-2") { - @Override - public void draw(Building build) { - Tmp.v1.setAngle(135f + build.rotdeg()).setLength(Mathf.absin(build.totalProgress(), 12f, 3)); - Draw.rect(region, build.x + Tmp.v1.x, build.y + Tmp.v1.y, region.width / 4f, region.height / 4f); - } - }, - new DrawRegion("-piston-2") { - @Override - public void draw(Building build) { - Tmp.v1.setAngle(45f + build.rotdeg()).setLength(Mathf.absin(build.totalProgress(), 12f, 3)); - Draw.rect(region, build.x + Tmp.v1.x, build.y + Tmp.v1.y, -region.width / 4f, region.height / 4f); - } - }, - new DrawRegion("-piston-2") { + new DrawBlock() { + TextureRegion piston1, piston2; + final float[] angles = {90f, 270f, 135f, 45f, 225f, 315f}; + final float[] flipX = {1f, 1f, 1f, -1f, 1f, -1f}; + final float[] flipY = {1f, -1f, 1f, 1f, -1f, -1f}; + final boolean[] piston1Used = {true, true, false, false, false, false}; + @Override public void draw(Building build) { - Tmp.v1.setAngle(225f + build.rotdeg()).setLength(Mathf.absin(build.totalProgress(), 12f, 3)); - Draw.rect(region, build.x + Tmp.v1.x, build.y + Tmp.v1.y, region.width / 4f, -region.height / 4f); + float len = Mathf.absin(build.totalProgress(), 12f, 3); + float rot = build.rotdeg(); + for (int i = 0; i < angles.length; i++) { + TextureRegion region = piston1Used[i] ? piston1 : piston2; + Tmp.v1.trns(angles[i] + rot, len); + Draw.rect(region, build.x + Tmp.v1.x, build.y + Tmp.v1.y, flipX[i] * region.width / 4f, flipY[i] * region.height / 4f, rot); + } } - }, - new DrawRegion("-piston-2") { + @Override - public void draw(Building build) { - Tmp.v1.setAngle(315f + build.rotdeg()).setLength(Mathf.absin(build.totalProgress(), 12f, 3)); - Draw.rect(region, build.x + Tmp.v1.x, build.y + Tmp.v1.y, -region.width / 4f, -region.height / 4f); + public void load(Block block) { + piston1 = Core.atlas.find(block.name + "-piston-1"); + piston2 = Core.atlas.find(block.name + "-piston-2"); } }, new DrawRegionFlip("-top") diff --git a/src/newhorizon/expand/block/inner/LinkBlock.java b/src/newhorizon/expand/block/inner/LinkBlock.java index f90df17e..b14a7cdd 100644 --- a/src/newhorizon/expand/block/inner/LinkBlock.java +++ b/src/newhorizon/expand/block/inner/LinkBlock.java @@ -102,7 +102,7 @@ public void updateLink(Building link) { if (link instanceof MultiBlockEntity) { linkBuild = link; items = link.items; - liquids = link.liquids; + if (link.liquids != null) liquids = link.liquids; //might not a good idea if do so //block = link.block; } else { @@ -123,6 +123,10 @@ public void updateTile() { public void draw() { } + @Override + public void drawLight() { + } + @Override public void drawSelect() { if (linkBuild != null) { diff --git a/src/newhorizon/expand/block/production/factory/MultiBlockCrafter.java b/src/newhorizon/expand/block/production/factory/MultiBlockCrafter.java index 39e7ef0f..fb7b4eed 100644 --- a/src/newhorizon/expand/block/production/factory/MultiBlockCrafter.java +++ b/src/newhorizon/expand/block/production/factory/MultiBlockCrafter.java @@ -158,7 +158,7 @@ public void draw() { @Override public void drawLight() { - super.drawLight(); + if (liquids != null) super.drawLight(); drawer.drawLight(this); } diff --git a/src/newhorizon/expand/game/DefaultRaid.java b/src/newhorizon/expand/game/DefaultRaid.java index 147420db..82e5b1b8 100644 --- a/src/newhorizon/expand/game/DefaultRaid.java +++ b/src/newhorizon/expand/game/DefaultRaid.java @@ -156,7 +156,7 @@ private static void registerRaidEvents() { event(5, NHBullets.synchroFusionEnergy, 180, 10, 10f, 120); event(6, NHBullets.laugraBullet, 180, 3, 3f, 60); event(7, NHBullets.saviourBullet, 240, 20, 4f, 90); - event(8, NHBullets.artilleryFusion, 180, 40, 6f, 72); + event(8, NHBullets.artilleryFusion, 180, 20, 6f, 72); event(9, NHBullets.artilleryNgt, 30, 10, 4f, 80); event(10, NHBullets.guardianBulletLightningBall, 180, 6, 2f, 60); event(11, NHBullets.railGun1, 120, 8, 3.0f, 30); diff --git a/src/newhorizon/expand/game/DefaultRaidStrength.java b/src/newhorizon/expand/game/DefaultRaidStrength.java index 5b34f1c8..e9a3264d 100644 --- a/src/newhorizon/expand/game/DefaultRaidStrength.java +++ b/src/newhorizon/expand/game/DefaultRaidStrength.java @@ -30,13 +30,13 @@ public class DefaultRaidStrength { private static final float[] TIER_MIN = { 0f, 0f, - 300f, - 800f, - 1200f, + 500f, + 1000f, 1800f, - 2800f, - 3600f, - 5600f + 2400f, + 3200f, + 4800f, + 6400f }; public static int maxTier() { diff --git a/src/newhorizon/expand/game/RaidState.java b/src/newhorizon/expand/game/RaidState.java index bce04e0d..fed2c2eb 100644 --- a/src/newhorizon/expand/game/RaidState.java +++ b/src/newhorizon/expand/game/RaidState.java @@ -14,12 +14,23 @@ private RaidState() { } public static void init() { + float fromSetting = defaultScale(); + if (Vars.state.rules.tags.containsKey(TAG)) { scale = readTag(); } else { - scale = defaultScale(); - writeTag(); + scale = fromSetting; + } + + if (!Vars.net.active()) { + if (fromSetting <= 0f) { + scale = 0f; + } else if (scale <= 0f) { + scale = fromSetting; + } } + + writeTag(); } private static float defaultScale() { diff --git a/src/newhorizon/expand/logic/RaidBulletUtil.java b/src/newhorizon/expand/logic/RaidBulletUtil.java index 54bb8438..0c7bc685 100644 --- a/src/newhorizon/expand/logic/RaidBulletUtil.java +++ b/src/newhorizon/expand/logic/RaidBulletUtil.java @@ -56,14 +56,17 @@ public static float raidRange(BulletType type) { public static float lifetimeScl(BulletType type, float dst) { if (dst <= 0f) return 1f; + if (type.scaleLife && type.range > 0.001f) { + return dst / type.range; + } if (type instanceof AccelBulletType || type instanceof LightningLinkerBulletType) { + if (type instanceof AccelBulletType accel && accel.velocityIncrease < 0.001f && accel.velocityBegin > 0.001f + && type.lifetime > 0.001f) { + return dst / (accel.velocityBegin * type.lifetime); + } if (type.speed > 0.001f && type.lifetime > 0.001f) return dst / (type.speed * type.lifetime); return 1f; } - if (type.scaleLife) { - float range = raidRange(type); - if (range > 0.001f) return dst / range; - } if (type.speed > 0.001f && type.lifetime > 0.001f) return dst / (type.speed * type.lifetime); return 1f; } diff --git a/src/newhorizon/expand/logic/components/action/EventRaidAction.java b/src/newhorizon/expand/logic/components/action/EventRaidAction.java index 9c0da2ba..d4f92f97 100644 --- a/src/newhorizon/expand/logic/components/action/EventRaidAction.java +++ b/src/newhorizon/expand/logic/components/action/EventRaidAction.java @@ -205,9 +205,12 @@ public void createBullet(Rand rand, int index) { Tmp.v1.trns(rand.random(360f), rand.random(spread)); float tx = targetX + Tmp.v1.x; float ty = targetY + Tmp.v1.y; - float dst = Mathf.dst(sourceX, sourceY, tx, ty); - float ang = Angles.angle(sourceX, sourceY, tx, ty); - RaidBulletUtil.spawn(bt, team, sourceX, sourceY, ang, -1, 1f, dst, tx, ty); + Tmp.v2.trns(rand.random(360f), rand.random(spread)); + float sx = sourceX + Tmp.v2.x; + float sy = sourceY + Tmp.v2.y; + float dst = Mathf.dst(sx, sy, tx, ty); + float ang = Angles.angle(sx, sy, tx, ty); + RaidBulletUtil.spawn(bt, team, sx, sy, ang, -1, 1f, dst, tx, ty); } public String alertBundleKey() { diff --git a/src/newhorizon/expand/logic/components/ui/RaidMarker.java b/src/newhorizon/expand/logic/components/ui/RaidMarker.java index a86b993b..d8591e53 100644 --- a/src/newhorizon/expand/logic/components/ui/RaidMarker.java +++ b/src/newhorizon/expand/logic/components/ui/RaidMarker.java @@ -172,13 +172,13 @@ private void projectAlongSource(float worldDist, Vec2 out) { @Override public void drawArrow() { float f = arrowScale(); + Color charge = chargeColor(); float alpha = chargeAlpha(); float scl = getScale(); float outerWorld = outerRingWorldRadius(); - Draw.color(markColor, Color.white, 0.075f); Draw.blend(Blending.additive); - Draw.alpha(alpha * 0.65f); + Draw.color(charge, alpha); for (int i = 0; i < 4; i++) { float s = (1 - ((Time.time + 25 * i) % 100) / 100) * f * scl * 1.75f;