Skip to content

Commit

Permalink
1.6.4 Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuria-Shikibe committed Feb 20, 2021
1 parent af0daa4 commit ce7c434
Show file tree
Hide file tree
Showing 48 changed files with 1,342 additions and 1,036 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
## Cautions
**DOES NOT SUPPORT _IOS_**

Require install `jdk 14` or maybe jdk in other versions.
Require install `jdk 14` or maybe jdk in other versions(at least 8).

Unzip the Mod.zip file first, then install the mod in game;
Unzip the Mod.zip file first or download from _Release_, then install the mod in game;

Mod is ***unstable*** and ***WIP***.
Mod is ***unstable***(mainly for phones, which are some UI and load problems) and ***WIP***.

All codes are here, and no *safety* problems.

Expand All @@ -24,3 +24,4 @@ However, the advance load now causes stuck problem when the game is loaded on a
If you find your device cannot afford it, open the mod file folder and find the "new-horizon" folder then open the properties file in it, and then rewrite the "@active.advance-load*" to false, then open the game again.

**However, when the mod is deleted, the setting file wouldn't be deleted automatically, so before I solve this problem, you may have to delete it by yourself.**

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/sprites/blocks/turrets/gravity.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/sprites/units/striker-cell.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/sprites/units/striker-weapon-heat.png
Binary file not shown.
Binary file modified assets/sprites/units/striker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/sprites/units/tarlidor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/sprites/units/warper.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/sprites/units/weapons/anti-air-pulse-laser.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/sprites/units/weapons/arc-blaster.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/sprites/units/weapons/impulse.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/sprites/units/weapons/large-launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/sprites/units/weapons/launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/sprites/units/weapons/stiken.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/sprites/units/weapons/swepter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion mod.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ displayName: "NewHorizonMod"
author: "Yuria"
main: "newhorizon.NewHorizon"
description: "Expanded contents, including Units, Turrets, Blocks, etc.\n\n [accent]This mod adds a new setting dialog when start the game.[] [gray]By choose the available setting, you can activate in-game debug panel and advance load, which creates outline icons and unit full icons automatically. However, the advance load now causes stuck problem when the game is loaded on a phone. So for your gaming experience, I made it defaults false. If you are confident with your device, active it. If you find your device cannot afford it, open the mod file folder and find the 'new-horizon' folder then open the properties file in it, and then rewrite the ''@active.advance-load*' to false, then open the game again."
version: "1.6.3.1 beta"
version: "1.6.4 beta"
minGameVersion: 125
43 changes: 23 additions & 20 deletions resource/bundles/bundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ unit.new-horizon-annihilation.name = Annihilation
unit.new-horizon-annihilation.description = Equipped combat laser cannon and missile launcher.
unit.new-horizon-warper.name = Warper
unit.new-horizon-warper.description = High velocity air bomber.

unit.new-horizon-destruction.name = Destruction
unit.new-horizon-destruction.description = Weird.

block.new-horizon-jump-gate.name = Ground-closed Jump Gate
block.new-horizon-jump-gate.description = Call in certain fleet to support fight.\n[sky]Can summon senior units.
Expand Down Expand Up @@ -118,7 +119,8 @@ block.new-horizon-disposable-battery.name = Disposable Battery
block.new-horizon-disposable-battery.description = Provides power after built immediately, cannot charge and would be destroyed after power run out.\n\n[lightgray]Need to be linked by hand.
block.new-horizon-radiation-generator.name = Radiation Generator
block.new-horizon-radiation-generator.description = A smaller type of decay generator compared to the RTG generator, but also cheaper.

block.new-horizon-gravity.name = Gravity
block.new-horizon-gravity.description = Can attract multiple units at the same time.



Expand Down Expand Up @@ -186,26 +188,27 @@ active.advance-load* = Advance Load
active.debug = Debug Mod
@active.advance-load*.extra = Don't activate it unless you are confident with your phone.

upgrade2 = Upgrade Target
upgrade2.description = Upgrade target to a higher level.
dark-enr-laser.description = Continuous Laser, pierce enemies and deals damage.
dark-enr-laser = Dark Energy Continuous Laser
decay-laser.description = Generate lasers that strikes enemies.
decay-laser = Dark Energy Lasers
bomb-storm.description = Throw plenty of bombs.
bomb-storm = Bomb Storm
arc-9000.description = Awful and Strong.
arc-9000 = ARC - 9000
curve-bomb.description = Only Deals Damage to UNITs.
curve-bomb = Curve Bomb
air-raid.description = Launch heavy missiles and deals tons of damage.
air-raid = Missile Strike
rocket-strike = Rockets Strike
rocket-strike.description = Launch tons of deadly rockets.
upgrade-data.upgrade2 = Upgrade Target
upgrade-data.upgrade2.description = Upgrade target to a higher level.
upgrade-data.dark-enr-laser.description = Continuous Laser, pierce enemies and deals damage.
upgrade-data.dark-enr-laser = Dark Energy Continuous Laser
upgrade-data.decay-laser.description = Generate lasers that strikes enemies.
upgrade-data.decay-laser = Dark Energy Lasers
upgrade-data.bomb-storm.description = Throw plenty of bombs.
upgrade-data.bomb-storm = Bomb Storm
upgrade-data.arc-9000.description = Awful and Strong.
upgrade-data.arc-9000 = ARC - 9000
upgrade-data.curve-bomb.description = Only Deals Damage to UNITs.
upgrade-data.curve-bomb = Curve Bomb
upgrade-data.air-raid.description = Launch heavy missiles and deals tons of damage.
upgrade-data.air-raid = Missile Strike
upgrade-data.rocket-strike = Rockets Strike
upgrade-data.rocket-strike.description = Launch tons of deadly rockets.

confirm.link = Are you sure jump to this link
update.fix = UI and Crash problems. Changes for 125 release.
update.add = Some new Blocks.

update.fix = UI and Crash problems.
update.add = New unit and block.
update.remove = null.
update.other = Some numerical optimization.

Expand Down
44 changes: 25 additions & 19 deletions resource/bundles/bundle_zh_CN.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ unit.new-horizon-striker.description = 重型空中单位,装备了远程镭
unit.new-horizon-annihilation.name = 湮灭者
unit.new-horizon-annihilation.description = 重型地面单位,装备了格斗激光器和导弹匣。“它可能跑不快,但你可以试试和它的导弹比谁跑的快。”
unit.new-horizon-warper.name = 突进
unit.new-horizon-warper.description = 超高速轰炸机.
unit.new-horizon-warper.description = 超高速轰炸机。
unit.new-horizon-destruction.name=消逝
unit.new-horizon-destruction.description=重型空中战斗单位。

block.new-horizon-jump-gate.name = 近地折跃门
block.new-horizon-jump-gate.description = 引导一些单位支援战斗。“前方净空,诸君,武运昌隆!”\n\n[accent]需要初级折跃门作为底座.
Expand All @@ -18,9 +20,9 @@ block.new-horizon-end-of-era-upgrader.description = 用于升级[accent]终蔫[]
block.new-horizon-small-zeta-crystal-factory.name = 小型Zeta晶合成仪
block.new-horizon-small-zeta-crystal-factory.description = 不太专业的小型合成器。
block.new-horizon-thermo-core-positive-factory.name = 反零能转换仪
block.new-horizon-thermo-core-positive-factory.description = 将零位能转换为反零能
block.new-horizon-thermo-core-positive-factory.description = 将反零能转换为正零能
block.new-horizon-thermo-core-negative-factory.name = 正零能转换仪
block.new-horizon-thermo-core-negative-factory.description = 将反零能转换为正零能
block.new-horizon-thermo-core-negative-factory.description = 将零位能转换为反零能
block.new-horizon-dark-energy-factory.name = 暗能合成器
block.new-horizon-dark-energy-factory.description = 合成暗能。“快进到正反湮灭。”
block.new-horizon-fusion-core-energy-factory.name = 聚变能封存器
Expand Down Expand Up @@ -117,6 +119,8 @@ block.new-horizon-armor-power-node.name = 装甲能量节点
block.new-horizon-armor-power-node.description = 拥有更高的血量,但最多链接数和链接距离被削弱了。
block.new-horizon-radiation-generator.name = 放射发电机
block.new-horizon-radiation-generator.description = 相较于RTG发电机更为简单的型号,效率不高但便宜。
block.new-horizon-gravity.name=引力
block.new-horizon-gravity.description=可以同时吸引多个单位。


item.new-horizon-emergency-replace.name = Null
Expand Down Expand Up @@ -182,21 +186,23 @@ active.debug = 调试模式
active.advance-load* = 超前加载
@active.advance-load*.extra = 除非你对你的手机有信心,否则后果自负。

upgrade2 = 升级目标
upgrade2.description = 更 上 一 层 楼
dark-enr-laser.description = 暗能激光器,对成片的敌人打出成吨的伤害。“这玩意可比融毁好用多了。”
dark-enr-laser = 暗能激光
decay-laser.description = 发射用于驱逐敌人的速射激光。
decay-laser = 速射激光
bomb-storm.description = 投射一堆炸弹。
bomb-storm = 炸弹风暴
arc-9000.description = 可怕且强大。
arc-9000 = ARC - 9000
curve-bomb.description = 只对单位有用。
curve-bomb = 曲线火炮
air-raid.description = 发射重型导弹,也造成成吨的伤害。
air-raid = 导弹冲击
rocket-strike = 火箭雨
rocket-strike.description = 发射一群火箭。
upgrade-data.upgrade2 = 升级目标
upgrade-data.upgrade2.description = 更 上 一 层 楼
upgrade-data.dark-enr-laser.description = 暗能激光器,对成片的敌人打出成吨的伤害。“这玩意可比融毁好用多了。”
upgrade-data.dark-enr-laser = 暗能激光
upgrade-data.decay-laser.description = 发射用于驱逐敌人的速射激光。
upgrade-data.decay-laser = 速射激光
upgrade-data.bomb-storm.description = 投射一堆炸弹。
upgrade-data.bomb-storm = 炸弹风暴
upgrade-data.arc-9000.description = 可怕且强大。
upgrade-data.arc-9000 = ARC - 9000
upgrade-data.curve-bomb.description = 只对单位有用。
upgrade-data.curve-bomb = 曲线火炮
upgrade-data.air-raid.description = 发射重型导弹,也造成成吨的伤害。
upgrade-data.air-raid = 导弹冲击
upgrade-data.rocket-strike = 火箭雨
upgrade-data.rocket-strike.description = 发射一群火箭。

confirm.link = 确定跳转至此链接


Binary file modified resource/sounds/railGunBlast.ogg
Binary file not shown.
Binary file modified resource/sounds/railGunCharge.ogg
Binary file not shown.
10 changes: 4 additions & 6 deletions src/newhorizon/NewHorizon.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,20 @@
import mindustry.ui.Styles;
import mindustry.ui.dialogs.BaseDialog;
import newhorizon.content.*;
import newhorizon.effects.EffectTrail;
import newhorizon.func.NHSetting;
import newhorizon.func.SettingDialog;
import newhorizon.func.TableFuncs;

import java.io.IOException;
import java.net.URL;

import static newhorizon.func.TableFuncs.*;


public class NewHorizon extends Mod{
public static String NHNAME;
public static String MOD_NAME;

public static String configName(String name){
return NHNAME + name;
return MOD_NAME + name;
}

private static void links(){
Expand Down Expand Up @@ -90,7 +88,7 @@ public static void startLog(){
dialog.closeOnBack();
dialog.cont.pane(inner -> {
inner.pane(table -> {
table.table(t -> t.image(Core.atlas.find(NHNAME + "upgrade"))).center().growX().fillY().row();
table.table(t -> t.image(Core.atlas.find(MOD_NAME + "upgrade"))).center().growX().fillY().row();
table.image().growX().height(OFFSET / 2.75f).pad(OFFSET / 3f).color(Color.white).row();
table.add("[white]<< Powered by NewHorizonMod >>", Styles.techLabel).row();
table.image().growX().height(OFFSET / 2.75f).pad(OFFSET / 3f).color(Color.white).row();
Expand Down Expand Up @@ -137,7 +135,7 @@ public void loadContent(){
}catch(IOException e){
throw new IllegalArgumentException(e);
}
NHNAME = NHSetting.modMeta.name + "-";
MOD_NAME = NHSetting.modMeta.name + "-";
Log.info("Loading NewHorizon Mod Objects");
NHSounds.load();
NHLoader loader = new NHLoader();
Expand Down
58 changes: 53 additions & 5 deletions src/newhorizon/block/adapt/DisposableBattery.java
Original file line number Diff line number Diff line change
@@ -1,23 +1,40 @@
package newhorizon.block.adapt;

import arc.Core;
import arc.graphics.Color;
import arc.graphics.g2d.Draw;
import arc.graphics.g2d.Fill;
import arc.graphics.g2d.TextureRegion;
import arc.math.Mathf;
import arc.struct.Seq;
import arc.util.Log;
import arc.util.Time;
import arc.util.io.Reads;
import arc.util.io.Writes;
import mindustry.gen.Building;
import mindustry.graphics.Pal;
import mindustry.ui.Bar;
import mindustry.world.blocks.power.Battery;
import mindustry.world.blocks.power.PowerDistributor;
import mindustry.world.consumers.ConsumePower;
import mindustry.world.meta.BlockStatus;
import mindustry.world.meta.Stat;
import mindustry.world.meta.StatUnit;

public class DisposableBattery extends Battery{
import static mindustry.Vars.tilesize;

public class DisposableBattery extends PowerDistributor{
public float consumption = 3f;

public TextureRegion topRegion;

public Color emptyLightColor = Color.valueOf("f8c266");
public Color fullLightColor = Color.valueOf("fb9567");

public DisposableBattery(String name){
super(name);
insulated = true;
rebuildable = false;
consumesPower = true;
}

@Override
Expand All @@ -26,6 +43,12 @@ public void setStats(){
this.stats.add(Stat.powerUse, consumption * 60f, StatUnit.powerSecond);
}

@Override
public void load(){
super.load();
topRegion = Core.atlas.find(name + "-top");
}

@Override
public void setBars(){
super.setBars();
Expand All @@ -43,19 +66,20 @@ public void setBars(){
}
}

public class DisposableBatteryBuild extends BatteryBuild{
public class DisposableBatteryBuild extends Building{
public float progress;

@Override
public void placed(){
super.placed();
power.status = 1;
power.status = 0;
}

@Override
public void updateTile(){
if(timer(0, Time.delta))progress += Math.max(0, (consumption + power.graph.getLastScaledPowerOut()) / consumes.getPower().capacity);
power.status = 1 - progress;
power.status = power.graph.getLastScaledPowerOut() / consumes.getPower().capacity * 1.125f;
Log.info(power.graph.getPowerNeeded() + " | " + power.graph.getSatisfaction());
if(progress > 1)kill();
}

Expand All @@ -70,5 +94,29 @@ public void read(Reads read, byte revision){
super.read(read, revision);
progress = read.f();
}

@Override
public void draw(){
Draw.color(emptyLightColor, fullLightColor, power.status);
Fill.square(x, y, tilesize * size / 2f - 1);
Draw.color();

Draw.rect(topRegion, x, y);
}

@Override
public void overwrote(Seq<Building> previous){
for(Building other : previous){
if(other.power != null && other.block.consumes.hasPower() && other.block.consumes.getPower().buffered){
float amount = other.block.consumes.getPower().capacity * other.power.status;
power.status = Mathf.clamp(power.status + amount / block.consumes.getPower().capacity);
}
}
}

@Override
public BlockStatus status(){
return BlockStatus.active;
}
}
}
3 changes: 1 addition & 2 deletions src/newhorizon/block/drawer/DrawHoldLiquid.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ public void draw(GenericCrafter.GenericCrafterBuild entity) {
float rotation = entity.block.rotate ? entity.rotdeg() : 0.0F;
Draw.rect(this.bottom, entity.x, entity.y, rotation);
if (entity.liquids.total() > 0.001F) {
Draw.color(entity.block.consumes.<ConsumeLiquid>get(ConsumeType.liquid).liquid.color);
Draw.alpha(entity.liquids.get(entity.block.consumes.<ConsumeLiquid>get(ConsumeType.liquid).liquid) / entity.block.liquidCapacity);
Draw.color(entity.block.consumes.<ConsumeLiquid>get(ConsumeType.liquid).liquid.color, entity.liquids.get(entity.block.consumes.<ConsumeLiquid>get(ConsumeType.liquid).liquid) / entity.block.liquidCapacity);
Draw.rect(this.liquid, entity.x, entity.y, rotation);
Draw.color();
}
Expand Down
20 changes: 10 additions & 10 deletions src/newhorizon/block/special/JumpGate.java
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public void setStats() {
stats.add(Stat.output, (t) -> {
t.row().add("[gray]Summon Types:").left().pad(TableFuncs.OFFSET).row();
for(UnitSet set : calls) {
t.add(new Tables.UnitSetTable(set, table -> table.button(Icon.infoCircle, Styles.clearTransi, () -> showInfo(set, "[accent]Caution[]: Summon needs building.")).size(LEN))).fill().row();
t.add(new Tables.UnitSetTable(set, table -> table.button(Icon.infoCircle, Styles.clearTransi, () -> showInfo(set, "[accent]Caution[gray]: Summon needs building.")).size(LEN))).fill().row();
}
});
}
Expand Down Expand Up @@ -189,8 +189,8 @@ public void setBars() {
@Override
public void load(){
super.load();
pointerRegion = Core.atlas.find(NewHorizon.NHNAME + "jump-gate-pointer");
arrowRegion = Core.atlas.find(NewHorizon.NHNAME + "jump-gate-arrow");
pointerRegion = Core.atlas.find(NewHorizon.MOD_NAME + "jump-gate-pointer");
arrowRegion = Core.atlas.find(NewHorizon.MOD_NAME + "jump-gate-arrow");
}

public class JumpGateBuild extends Building implements Ranged {
Expand Down Expand Up @@ -280,19 +280,19 @@ public void buildConfiguration(Table table) {
BaseDialog dialog = new BaseDialog("Call");
dialog.addCloseListener();

dialog.cont.pane(t -> t.table(inner -> {
inner.button("@back", Icon.left, dialog::hide).padBottom(TableFuncs.OFFSET / 2).fillX().height(LEN).row();
inner.button("@release", Icon.add, () -> spawn(getSet())).padBottom(TableFuncs.OFFSET / 2).disabled(b -> getSet() == null || success || !hasConsume(getSet()) || !canSpawn(getSet())).fillX().height(LEN).row();
dialog.cont.pane(inner ->
inner.table(callTable -> {
for(UnitSet set : calls) {
inner.add(new Tables.UnitSetTable(set, table2 -> {
callTable.add(new Tables.UnitSetTable(set, table2 -> {
table2.button(Icon.infoCircle, Styles.clearTransi, () -> showInfo(set, "[lightgray]CanCall?: " + TableFuncs.getJudge(canSpawn(set)) + "[]")).size(LEN);
table2.button(Icon.add, Styles.clearPartiali, () -> startBuild(set)).size(LEN).disabled(b -> !canSpawn(set) || error);
})).fill().row();
}
}).fill();
}).fill()).fill();

}).grow()
).fill().row();
dialog.cont.button("@release", Icon.add, Styles.cleart, () -> spawn(getSet())).padTop(TableFuncs.OFFSET / 2).disabled(b -> getSet() == null || success || !hasConsume(getSet()) || !canSpawn(getSet())).fillX().height(LEN).row();
dialog.cont.button("@back", Icon.left, Styles.cleart, dialog::hide).padTop(TableFuncs.OFFSET / 2).fillX().height(LEN).row();

table.button("Spawn", Icon.add, dialog::show).size(LEN * 5, LEN);
}

Expand Down
Loading

0 comments on commit ce7c434

Please sign in to comment.