Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mod.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions src/newhorizon/content/NHBullets.java
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,9 @@ public static void load() {
}};

artilleryNgt = new TrailFadeBulletType(2f, 250) {{
velocityBegin = 2f;
velocityIncrease = 0f;

tracers = 1;
tracerStroke = 1.2f;
tracerSpacing = 4f;
Expand Down
55 changes: 19 additions & 36 deletions src/newhorizon/content/blocks/CraftingBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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")
Expand Down
6 changes: 5 additions & 1 deletion src/newhorizon/expand/block/inner/LinkBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -123,6 +123,10 @@ public void updateTile() {
public void draw() {
}

@Override
public void drawLight() {
}

@Override
public void drawSelect() {
if (linkBuild != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public void draw() {

@Override
public void drawLight() {
super.drawLight();
if (liquids != null) super.drawLight();
drawer.drawLight(this);
}

Expand Down
2 changes: 1 addition & 1 deletion src/newhorizon/expand/game/DefaultRaid.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
12 changes: 6 additions & 6 deletions src/newhorizon/expand/game/DefaultRaidStrength.java
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
15 changes: 13 additions & 2 deletions src/newhorizon/expand/game/RaidState.java
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
11 changes: 7 additions & 4 deletions src/newhorizon/expand/logic/RaidBulletUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
4 changes: 2 additions & 2 deletions src/newhorizon/expand/logic/components/ui/RaidMarker.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading