diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
index 32a10a6e..78c68ac8 100644
--- a/.idea/codeStyles/Project.xml
+++ b/.idea/codeStyles/Project.xml
@@ -81,6 +81,10 @@
+
+
+
+
diff --git a/assets/sprites/units/centurion-base.png b/assets/sprites/units/centurion-base.png
index 85112dc3..2e62c0d8 100644
Binary files a/assets/sprites/units/centurion-base.png and b/assets/sprites/units/centurion-base.png differ
diff --git a/assets/sprites/units/centurion-cell.png b/assets/sprites/units/centurion-cell.png
index 66b9182f..c78f533a 100644
Binary files a/assets/sprites/units/centurion-cell.png and b/assets/sprites/units/centurion-cell.png differ
diff --git a/assets/sprites/units/centurion-full.png b/assets/sprites/units/centurion-full.png
index a9802da5..45f811b1 100644
Binary files a/assets/sprites/units/centurion-full.png and b/assets/sprites/units/centurion-full.png differ
diff --git a/assets/sprites/units/centurion-outline.png b/assets/sprites/units/centurion-outline.png
new file mode 100644
index 00000000..f5988a14
Binary files /dev/null and b/assets/sprites/units/centurion-outline.png differ
diff --git a/assets/sprites/units/centurion-weapon.png b/assets/sprites/units/centurion-weapon.png
index f6da8b3a..97c82eeb 100644
Binary files a/assets/sprites/units/centurion-weapon.png and b/assets/sprites/units/centurion-weapon.png differ
diff --git a/assets/sprites/units/centurion.png b/assets/sprites/units/centurion.png
index 5c375489..cedf30d3 100644
Binary files a/assets/sprites/units/centurion.png and b/assets/sprites/units/centurion.png differ
diff --git a/revisions/MechChainedUnit/0.json b/revisions/MechChainedUnit/0.json
new file mode 100644
index 00000000..bbcf32e8
--- /dev/null
+++ b/revisions/MechChainedUnit/0.json
@@ -0,0 +1 @@
+{fields:[{name:abilities,type:"mindustry.entities.abilities.Ability[]"},{name:ammo,type:float},{name:baseRotation,type:float},{name:childID,type:int},{name:controller,type:mindustry.entities.units.UnitController},{name:elevation,type:float},{name:flag,type:double},{name:grown,type:boolean},{name:health,type:float},{name:isShooting,type:boolean},{name:mineTile,type:mindustry.world.Tile},{name:mounts,type:"mindustry.entities.units.WeaponMount[]"},{name:parentID,type:int},{name:plans,type:arc.struct.Queue},{name:rotation,type:float},{name:shield,type:float},{name:spawnedByCore,type:boolean},{name:stack,type:mindustry.type.ItemStack},{name:statuses,type:arc.struct.Seq},{name:team,type:mindustry.game.Team},{name:type,type:mindustry.type.UnitType},{name:updateBuilding,type:boolean},{name:vel,type:arc.math.geom.Vec2},{name:x,type:float},{name:y,type:float}]}
\ No newline at end of file
diff --git a/src/omaloon/OmaloonMod.java b/src/omaloon/OmaloonMod.java
index 94f157cc..ff496d34 100644
--- a/src/omaloon/OmaloonMod.java
+++ b/src/omaloon/OmaloonMod.java
@@ -16,48 +16,39 @@
import omaloon.net.*;
import omaloon.ui.*;
import omaloon.ui.dialogs.*;
-import omaloon.ui.fragments.*;
import omaloon.utils.*;
import omaloon.world.blocks.environment.*;
import omaloon.world.save.OlDelayedItemTransfer;
import static arc.Core.app;
+import static omaloon.core.OlUI.*;
public class OmaloonMod extends Mod{
- public static EditorListener editorListener;
- public static SafeClearer safeClearer;
-
- public static ShapedEnvPlacerFragment shapedEnvPlacerFragment;
- public static CliffFragment cliffFragment;
-
- public static OlInputDialog olInputDialog;
- public static OlGameDataDialog olGameDataDialog;
- public static OlGameDialog olGameDialog;
- public static OlEndDialog olEndDialog;
/**
* Buffer radius increase to take splashRadius into account, increase if necessary.
*/
public static float shieldBuffer = 40f;
+ public static SafeClearer safeClearer;
+ public static OlUI ui;
+ public static EditorListener editorListener;
public OmaloonMod(){
super();
OlCall.registerPackets();
new OlDelayedItemTransfer();
+ if(!Vars.headless)
+ editorListener = new EditorListener();
+
+ ui = new OlUI(OlBinding.values());
+
Events.on(EventType.ClientLoadEvent.class, e -> {
- StartSplash.build(Vars.ui.menuGroup);
- StartSplash.show();
- if(!Vars.mobile && !Vars.headless){
- shapedEnvPlacerFragment.build(Vars.ui.hudGroup);
- cliffFragment.build(Vars.ui.hudGroup);
- OlBinding.load();
- }
Vars.maps.all().removeAll(map -> {
- if(map.mod != null && map.mod.name.equals("omaloon")){
- Mods.LoadedMod otherMod = Vars.mods.getMod("test-utils");
- return otherMod == null || !otherMod.enabled();
+ if(map.mod == null || !map.mod.name.equals("omaloon")){
+ return false;
}
- return false;
+ Mods.LoadedMod otherMod = Vars.mods.getMod("test-utils");
+ return otherMod == null || !otherMod.enabled();
});
Core.app.addListener(new ApplicationListener(){
@Override
@@ -78,26 +69,42 @@ public void update(){
OlIcons.load();
OlSettings.load();
EventHints.addHints();
- CustomShapePropProcess.instance = new CustomShapePropProcess();
- Vars.asyncCore.processes.add(CustomShapePropProcess.instance);
+ CustomShapePropProcess.create();
safeClearer = new SafeClearer();
});
Events.on(EventType.FileTreeInitEvent.class, e ->
- app.post(OlShaders::load)
+ app.post(OlShaders::load)
);
Events.on(EventType.MusicRegisterEvent.class, e ->
- OlMusics.load()
+ OlMusics.load()
);
Events.on(EventType.DisposeEvent.class, e ->
- OlShaders.dispose()
+ OlShaders.dispose()
);
Log.info("Loaded OmaloonMod constructor.");
}
+ public static void olLog(String string, Object... args){
+ Log.infoTag("omaloon", Strings.format(string, args));
+ }
+
+ public static void resetSaves(Planet planet){
+ planet.sectors.each(sector -> {
+ if(!sector.hasSave()) return;
+ sector.save.delete();
+ sector.save = null;
+ });
+ }
+
+ public static void resetTree(TechNode root){
+ root.reset();
+ root.content.clearUnlock();
+ root.children.each(OmaloonMod::resetTree);
+ }
@Override
public void registerServerCommands(CommandHandler handler){
@@ -112,21 +119,14 @@ public void registerClientCommands(CommandHandler handler){
@Override
public void init(){
super.init();
- if(!Vars.headless){
- shapedEnvPlacerFragment = new ShapedEnvPlacerFragment();
- cliffFragment = new CliffFragment();
- olInputDialog = new OlInputDialog();
- olGameDataDialog = new OlGameDataDialog();
- olGameDialog = new OlGameDialog();
- olEndDialog = new OlEndDialog();
- Events.on(EventType.SectorCaptureEvent.class, e -> {
- if(e.sector.preset == OlSectorPresets.deadValley) olEndDialog.show(Core.scene, Actions.sequence(
+ IconLoader.loadIcons();
+ if(Vars.headless) return;
+ Events.on(EventType.SectorCaptureEvent.class, e -> {
+ if(e.sector.preset == OlSectorPresets.deadValley) olEndDialog.show(Core.scene, Actions.sequence(
Actions.fadeOut(0),
Actions.fadeIn(1)
- ));
- });
- }
- IconLoader.loadIcons();
+ ));
+ });
}
@Override
@@ -144,19 +144,4 @@ public void loadContent(){
OlSchematics.load();
OlTechTree.load();
}
-
- public static void resetSaves(Planet planet){
- planet.sectors.each(sector -> {
- if(sector.hasSave()){
- sector.save.delete();
- sector.save = null;
- }
- });
- }
-
- public static void resetTree(TechNode root){
- root.reset();
- root.content.clearUnlock();
- root.children.each(OmaloonMod::resetTree);
- }
}
diff --git a/src/omaloon/ai/MillipedeAI.java b/src/omaloon/ai/MillipedeAI.java
index c7179d72..4877e580 100644
--- a/src/omaloon/ai/MillipedeAI.java
+++ b/src/omaloon/ai/MillipedeAI.java
@@ -46,8 +46,8 @@ public void updateWeapons(){
}
float
- mountX = u.x + Angles.trnsx(rotation, weapon.x, weapon.y),
- mountY = u.y + Angles.trnsy(rotation, weapon.x, weapon.y);
+ mountX = u.x + Angles.trnsx(rotation, weapon.x, weapon.y),
+ mountY = u.y + Angles.trnsy(rotation, weapon.x, weapon.y);
if(unit.type.singleTarget){
mount.target = target;
@@ -99,7 +99,7 @@ public void updateMovement(){
@Override
public Teamc findTarget(float x, float y, float range, boolean air, boolean ground){
Teamc target = commandTarget != null && commandTarget.within(x, y, range) &&
- commandTarget.team() == unit.team && commandTarget.isNull() ? commandTarget : null;
+ commandTarget.team() == unit.team && commandTarget.isNull() ? commandTarget : null;
return target != null ? target : super.findTarget(x, y, range, air, ground);
}
diff --git a/src/omaloon/content/OlFx.java b/src/omaloon/content/OlFx.java
index 580c6f55..8334bf58 100644
--- a/src/omaloon/content/OlFx.java
+++ b/src/omaloon/content/OlFx.java
@@ -23,7 +23,7 @@ public class OlFx{
public static final Vec2 vec = new Vec2(), vec2 = new Vec2();
public static Effect
- bigExplosionStone = new Effect(80f, e -> randLenVectors(e.id, 22, e.fin() * 50f, (x, y) -> {
+ bigExplosionStone = new Effect(80f, e -> randLenVectors(e.id, 22, e.fin() * 50f, (x, y) -> {
float elevation = Interp.bounceIn.apply(e.fout() - 0.3f) * (Mathf.randomSeed((int)Angles.angle(x, y), 30f, 60f));
Draw.z(Layer.power + 0.1f);
@@ -34,285 +34,271 @@ public class OlFx{
Draw.color(e.color);
Fill.circle(e.x + x, e.y + y + elevation, 12f);
})),
-
- carborundumCraft = new Effect(60f, e -> {
- rand.setSeed(e.id);
- Draw.color(Color.valueOf("7545D5").mul(1.5f));
- randLenVectors(e.id, 10, 8 * e.finpow(), (x, y) -> {
- vec.trns(Mathf.angle(x, y), 8f).add(x + e.x, y + e.y);
- float rad = (3 + rand.range(2));
- Drawf.light(vec.x, vec.y, (rad + 8f) * e.fout(), Color.valueOf("7545D5"), 0.3f);
- Fill.circle(vec.x, vec.y, rad * e.fout());
- });
-
- if(e.time <= 5) Effect.shake(0.5f, 5f, e.x, e.y);
- }),
-
- explosionStone = new Effect(60f, e -> randLenVectors(e.id, 12, e.fin() * 50f, (x, y) -> {
- float elevation = Interp.bounceIn.apply(e.fout() - 0.3f) * (Mathf.randomSeed((int)Angles.angle(x, y), 30f, 60f));
-
- Draw.z(Layer.power + 0.1f);
- Draw.color(Pal.shadow);
- Fill.circle(e.x + x, e.y + y, 12f);
-
- Draw.z(Layer.power + 0.2f);
- Draw.color(e.color);
- Fill.circle(e.x + x, e.y + y + elevation, 12f);
- })),
-
- fellStone = new Effect(120f, e -> {
- if(!(e.data instanceof HailStoneBulletType.HailStoneData data)) return;
-
- rand.setSeed(e.id);
- vec2.trns(rand.random(360f), data.fallTime / 2f + rand.random(data.fallTime));
- float scl = Interp.bounceIn.apply(e.fout() - 0.3f);
- float rot = vec2.angle();
- float x = e.x + (vec2.x * e.finpow()), y = e.y + (vec2.y * e.finpow());
-
- Draw.z(Layer.power + 0.1f);
- Drawm.shadow(data.region, x, y, rot, Math.min(e.fout(), Pal.shadow.a));
-
- Draw.z(Layer.power + 0.2f);
- Draw.color(e.color);
- Draw.alpha(e.fout());
- Draw.rect(data.region, x, y + (scl * data.fallTime / 2f), rot);
- }),
- fellStoneAghanite = new Effect(120f, e -> {
- if(!(e.data instanceof HailStoneBulletType.HailStoneData data)) return;
-
- rand.setSeed(e.id);
- vec2.trns(e.rotation + rand.range(30f), data.fallTime / 2f + rand.random(data.fallTime));
- float scl = Interp.bounceIn.apply(e.fout() - 0.3f);
- float rot = vec2.angle();
- float x = e.x + (vec2.x * e.finpow()), y = e.y + (vec2.y * e.finpow());
-
- Draw.z(Layer.power + 0.1f);
- Drawm.shadow(data.region, x, y, rot, Math.min(e.fout(), Pal.shadow.a));
-
- Draw.z(Layer.power + 0.2f);
- Draw.color(e.color);
- Draw.alpha(e.fout());
- Draw.rect(data.region, x, y + (scl * data.fallTime / 2f), rot);
- }),
-
- drillHammerHit = new Effect(80f, e -> {
- color(e.color, Color.gray, e.fin());
- alpha(0.6f);
- Draw.z(Layer.block);
-
- rand.setSeed(e.id);
- for(int i = 0; i < 3; i++){
- float len = rand.random(6f), rot = rand.range(40f) + e.rotation;
-
- e.scaled(e.lifetime * rand.random(0.3f, 1f), e2 -> {
- vec.trns(rot, len * e2.finpow());
-
- Fill.square(e2.x + vec.x, e2.y + vec.y, 1.5f * e2.fslope() + 0.2f, 45);
+ carborundumCraft = new Effect(60f, e -> {
+ rand.setSeed(e.id);
+ Draw.color(Color.valueOf("7545D5").mul(1.5f));
+ randLenVectors(e.id, 10, 8 * e.finpow(), (x, y) -> {
+ vec.trns(Mathf.angle(x, y), 8f).add(x + e.x, y + e.y);
+ float rad = (3 + rand.range(2));
+ Drawf.light(vec.x, vec.y, (rad + 8f) * e.fout(), Color.valueOf("7545D5"), 0.3f);
+ Fill.circle(vec.x, vec.y, rad * e.fout());
});
- }
- }),
-
- hammerHit = new Effect(80f, e -> {
- color(e.color, e.fout(0.1f));
-
- rand.setSeed(e.id);
- for(int i = 0; i < 3; i++){
- float len = rand.random(16f), rot = rand.range(360f) + e.rotation;
-
- e.scaled(e.lifetime * rand.random(0.3f, 1f), e2 -> {
- vec.trns(rot, len * e2.finpow());
- Fill.circle(e2.x + vec.x, e2.y + vec.y, 2.5f * e2.fslope() + 0.2f);
+ if(e.time <= 5) Effect.shake(0.5f, 5f, e.x, e.y);
+ }),
+ explosionStone = new Effect(60f, e -> randLenVectors(e.id, 12, e.fin() * 50f, (x, y) -> {
+ float elevation = Interp.bounceIn.apply(e.fout() - 0.3f) * (Mathf.randomSeed((int)Angles.angle(x, y), 30f, 60f));
+
+ Draw.z(Layer.power + 0.1f);
+ Draw.color(Pal.shadow);
+ Fill.circle(e.x + x, e.y + y, 12f);
+
+ Draw.z(Layer.power + 0.2f);
+ Draw.color(e.color);
+ Fill.circle(e.x + x, e.y + y + elevation, 12f);
+ })),
+ fellStone = new Effect(120f, e -> {
+ if(!(e.data instanceof HailStoneBulletType.HailStoneData data)) return;
+
+ rand.setSeed(e.id);
+ vec2.trns(rand.random(360f), data.fallTime / 2f + rand.random(data.fallTime));
+ float scl = Interp.bounceIn.apply(e.fout() - 0.3f);
+ float rot = vec2.angle();
+ float x = e.x + (vec2.x * e.finpow()), y = e.y + (vec2.y * e.finpow());
+
+ Draw.z(Layer.power + 0.1f);
+ Drawm.shadow(data.region, x, y, rot, Math.min(e.fout(), Pal.shadow.a));
+
+ Draw.z(Layer.power + 0.2f);
+ Draw.color(e.color);
+ Draw.alpha(e.fout());
+ Draw.rect(data.region, x, y + (scl * data.fallTime / 2f), rot);
+ }),
+ fellStoneAghanite = new Effect(120f, e -> {
+ if(!(e.data instanceof HailStoneBulletType.HailStoneData data)) return;
+
+ rand.setSeed(e.id);
+ vec2.trns(e.rotation + rand.range(30f), data.fallTime / 2f + rand.random(data.fallTime));
+ float scl = Interp.bounceIn.apply(e.fout() - 0.3f);
+ float rot = vec2.angle();
+ float x = e.x + (vec2.x * e.finpow()), y = e.y + (vec2.y * e.finpow());
+
+ Draw.z(Layer.power + 0.1f);
+ Drawm.shadow(data.region, x, y, rot, Math.min(e.fout(), Pal.shadow.a));
+
+ Draw.z(Layer.power + 0.2f);
+ Draw.color(e.color);
+ Draw.alpha(e.fout());
+ Draw.rect(data.region, x, y + (scl * data.fallTime / 2f), rot);
+ }),
+ drillHammerHit = new Effect(80f, e -> {
+ color(e.color, Color.gray, e.fin());
+ alpha(0.6f);
+ Draw.z(Layer.block);
+
+ rand.setSeed(e.id);
+ for(int i = 0; i < 3; i++){
+ float len = rand.random(6f), rot = rand.range(40f) + e.rotation;
+
+ e.scaled(e.lifetime * rand.random(0.3f, 1f), e2 -> {
+ vec.trns(rot, len * e2.finpow());
+
+ Fill.square(e2.x + vec.x, e2.y + vec.y, 1.5f * e2.fslope() + 0.2f, 45);
+ });
+ }
+ }),
+ hammerHit = new Effect(80f, e -> {
+ color(e.color, e.fout(0.1f));
+
+ rand.setSeed(e.id);
+ for(int i = 0; i < 3; i++){
+ float len = rand.random(16f), rot = rand.range(360f) + e.rotation;
+
+ e.scaled(e.lifetime * rand.random(0.3f, 1f), e2 -> {
+ vec.trns(rot, len * e2.finpow());
+
+ Fill.circle(e2.x + vec.x, e2.y + vec.y, 2.5f * e2.fslope() + 0.2f);
+ });
+ }
+ }).layer(Layer.blockUnder),
+ hitSage = new Effect(30f, e -> {
+ Lines.stroke(3f * e.fout(), Color.valueOf("8CA9E8"));
+ Lines.circle(e.x, e.y, 32f * e.finpow());
+ for(int i = 0; i < 4; i++){
+ Draw.color(Color.valueOf("D1EFFF"));
+ Drawf.tri(e.x, e.y, 6f * e.fout(), 24f * e.finpow(), e.rotation + i * 90f + 45f);
+ }
+ }),
+ stealInvalid = new Effect(60f, e -> {
+ if(!(e.data instanceof Block block)) return;
+
+ Draw.mixcol(Color.white, 0);
+ Draw.alpha(e.fout());
+ Draw.rect(
+ block.uiIcon,
+ e.x + Math3D.xOffset(e.x, block.size * e.finpowdown()),
+ e.y + Math3D.yOffset(e.y, block.size * e.finpowdown()),
+ -45 * e.fin()
+ );
+ Draw.mixcol(Color.white, e.foutpow());
+ Draw.alpha(e.foutpowdown());
+ Draw.rect(
+ Core.atlas.find("omaloon-hail-shield-base"),
+ e.x + Math3D.xOffset(e.x, block.size * e.finpowdown()),
+ e.y + Math3D.yOffset(e.y, block.size * e.finpowdown()),
+ -45 * e.fin() + Time.time * 4
+ );
+ Draw.rect(
+ Core.atlas.find("omaloon-hail-shield"),
+ e.x + Math3D.xOffset(e.x, block.size * e.finpowdown()),
+ e.y + Math3D.yOffset(e.y, block.size * e.finpowdown()),
+ -45 * e.fin()
+ );
+ }).layer(Layer.effect + 1),
+ javelinShoot = new Effect(60f, e -> {
+ rand.setSeed(e.id);
+ randLenVectors(e.id, 10, 32f * e.finpow(), e.rotation, 15, (x, y) -> {
+ Draw.alpha(rand.random(0.25f, 0.5f));
+ Fill.circle(e.x + x, e.y + y, 3f * e.fout());
});
- }
- }).layer(Layer.blockUnder),
-
- hitSage = new Effect(30f, e -> {
- Lines.stroke(3f * e.fout(), Color.valueOf("8CA9E8"));
- Lines.circle(e.x, e.y, 32f * e.finpow());
- for(int i = 0; i < 4; i++){
- Draw.color(Color.valueOf("D1EFFF"));
- Drawf.tri(e.x, e.y, 6f * e.fout(), 24f * e.finpow(), e.rotation + i * 90f + 45f);
- }
- }),
-
- stealInvalid = new Effect(60f, e -> {
- if(!(e.data instanceof Block block)) return;
-
- Draw.mixcol(Color.white, 0);
- Draw.alpha(e.fout());
- Draw.rect(
- block.uiIcon,
- e.x + Math3D.xOffset(e.x, block.size * e.finpowdown()),
- e.y + Math3D.yOffset(e.y, block.size * e.finpowdown()),
- -45 * e.fin()
- );
- Draw.mixcol(Color.white, e.foutpow());
- Draw.alpha(e.foutpowdown());
- Draw.rect(
- Core.atlas.find("omaloon-hail-shield-base"),
- e.x + Math3D.xOffset(e.x, block.size * e.finpowdown()),
- e.y + Math3D.yOffset(e.y, block.size * e.finpowdown()),
- -45 * e.fin() + Time.time * 4
- );
- Draw.rect(
- Core.atlas.find("omaloon-hail-shield"),
- e.x + Math3D.xOffset(e.x, block.size * e.finpowdown()),
- e.y + Math3D.yOffset(e.y, block.size * e.finpowdown()),
- -45 * e.fin()
- );
- }).layer(Layer.effect + 1),
-
- javelinShoot = new Effect(60f, e -> {
- rand.setSeed(e.id);
- randLenVectors(e.id, 10, 32f * e.finpow(), e.rotation, 15, (x, y) -> {
- Draw.alpha(rand.random(0.25f, 0.5f));
- Fill.circle(e.x + x, e.y + y, 3f * e.fout());
- });
- }),
- javelinMissileShoot = new Effect(30f, e -> {
- rand.setSeed(e.id);
- Draw.blend(Blending.additive);
- randLenVectors(e.id, 10, 32f * e.finpow(), e.rotation + 180f, 15f, (x, y) -> {
- Draw.color(Pal.missileYellow, Pal.turretHeat, rand.random(1f));
- Fill.circle(e.x + x, e.y + y, rand.random(2f, 4f) * e.fout());
- Draw.color(Pal.accent, Pal.missileYellowBack, rand.random(1f));
- Fill.circle(e.x + x, e.y + y, rand.random(2f, 4f) * e.fout());
- });
- Draw.blend();
- }),
-
- flowOut = new Effect(60f, e -> {
- Draw.color(e.color);
- Draw.alpha(e.fout() / 5);
- vec.trns(e.rotation, 4f).add(e.x, e.y);
- Angles.randLenVectors(e.id, 3, 16 * e.fin(), e.rotation, 10, (x, y) -> {
- Fill.circle(vec.x + x, vec.y + y, 3 * e.fin());
- });
- vec.trns(e.rotation, -4f).add(e.x, e.y);
- Angles.randLenVectors(e.id + 2, 3, 16 * e.fin(), e.rotation + 180, 10, (x, y) -> {
- Fill.circle(vec.x + x, vec.y + y, 3 * e.fin());
- });
- Draw.alpha(e.fout() / 7);
- Angles.randLenVectors(e.id + 1, 3, 16 * e.fin(), e.rotation + 180, 20, (x, y) -> {
- Fill.rect(vec.x + x, vec.y + y, 5 * e.fin(), e.fin(), vec.angleTo(vec.x + x, vec.y + y));
- });
- vec.trns(e.rotation, 4f).add(e.x, e.y);
- Angles.randLenVectors(e.id + 3, 3, 16 * e.fin(), e.rotation, 20, (x, y) -> {
- Fill.rect(vec.x + x, vec.y + y, 5 * e.fin(), e.fin(), vec.angleTo(vec.x + x, vec.y + y));
- });
- }),
- flowIn = new Effect(60f, e -> {
- Draw.color(e.color);
- Draw.alpha(e.fin() / 5);
- vec.trns(e.rotation, 4f).add(e.x, e.y);
- Angles.randLenVectors(e.id, 3, 16 * e.fout(), e.rotation, 10, (x, y) -> {
- Fill.circle(vec.x + x, vec.y + y, 3 * e.fout());
- });
- vec.trns(e.rotation, -4f).add(e.x, e.y);
- Angles.randLenVectors(e.id + 2, 3, 16 * e.fout(), e.rotation + 180, 10, (x, y) -> {
- Fill.circle(vec.x + x, vec.y + y, 3 * e.fout());
- });
- Draw.alpha(e.fin() / 7);
- Angles.randLenVectors(e.id + 1, 3, 16 * e.fout(), e.rotation + 180, 20, (x, y) -> {
- Fill.rect(vec.x + x, vec.y + y, 5 * e.fout(), e.fout(), vec.angleTo(vec.x + x, vec.y + y));
- });
- vec.trns(e.rotation, 4f).add(e.x, e.y);
- Angles.randLenVectors(e.id + 3, 3, 16 * e.fout(), e.rotation, 20, (x, y) -> {
- Fill.rect(vec.x + x, vec.y + y, 5 * e.fout(), e.fout(), vec.angleTo(vec.x + x, vec.y + y));
- });
- }),
-
- pumpOut = new Effect(60f, e -> {
- Draw.color(e.color);
- Draw.alpha(e.fout() / 5);
- vec.trns(e.rotation, 4f).add(e.x, e.y);
- Angles.randLenVectors(e.id, 3, 16 * e.fin(), e.rotation, 10, (x, y) -> {
- Fill.circle(vec.x + x, vec.y + y, 3 * e.fin());
- });
- Draw.alpha(e.fout() / 7);
- vec.trns(e.rotation, 4f).add(e.x, e.y);
- Angles.randLenVectors(e.id + 3, 3, 16 * e.fin(), e.rotation, 20, (x, y) -> {
- Fill.rect(vec.x + x, vec.y + y, 5 * e.fin(), e.fin(), vec.angleTo(vec.x + x, vec.y + y));
- });
- }),
- pumpIn = new Effect(60f, e -> {
- Draw.color(e.color);
- Draw.alpha(e.fin() / 5);
- vec.trns(e.rotation, 4f).add(e.x, e.y);
- Angles.randLenVectors(e.id, 3, 16 * e.fout(), e.rotation, 10, (x, y) -> {
- Fill.circle(vec.x + x, vec.y + y, 3 * e.fout());
- });
- Draw.alpha(e.fin() / 7);
- Angles.randLenVectors(e.id + 3, 3, 16 * e.fout(), e.rotation, 20, (x, y) -> {
- Fill.rect(vec.x + x, vec.y + y, 5 * e.fout(), e.fout(), vec.angleTo(vec.x + x, vec.y + y));
- });
- }),
-
- shelterRotate = new Effect(60f, e -> {
- if(!(e.data instanceof Block data)) return;
-
- Draw.color(Pal.accent, e.fout());
- Fill.rect(e.x, e.y, data.size * 8f, data.size * 8f);
- Lines.stroke(2f * e.fout(), Pal.accent);
- Lines.rect(
- e.x - data.size * 4f,
- e.y - data.size * 4f,
- data.size * 8f,
- data.size * 8f
- );
- Lines.circle(e.x, e.y, data.size * 16f * e.finpow());
- vec.trns(e.rotation, data.size * 16f * e.finpow()).add(e.x, e.y);
-
- Drawf.tri(vec.x, vec.y, 4f, 8f * e.foutpow(), e.rotation);
- }),
-
- shootShockwave = new Effect(60f, e -> {
- Draw.color(Color.valueOf("8CA9E8"));
-
- float
- fin = Interp.circleOut.apply(e.fout()),
- fin2 = new Interp.ExpOut(10, 10).apply(e.fin()),
- fout = new Interp.ExpOut(10, 10).apply(e.fout());
-
- float progress = e.fin();
-
- float cover = 280f * fin2 - 40f * Mathf.slope(Interp.circleOut.apply(e.fin()));
-
- vec.trns(e.rotation, 5.5f - 15f * fin).add(e.x, e.y);
-
- EFill.donutEllipse(
- vec.x, vec.y,
- 4f * progress * fout, 14f * fout,
- 2f * progress * fout, 12f * fout,
- cover / 360f,
- -cover / 2f, e.rotation
- );
- }).followParent(true).rotWithParent(true),
-
- breakShapedProp = new Effect(23, e -> {
- if(!(e.data instanceof MultiPropGroup group)) return;
-
- float scl = Math.max(e.rotation, 1);
- color(Tmp.c1.set(e.color).mul(1.1f));
-
- for(Tile tile : group.group){
- randLenVectors(e.id + tile.pos(), 2, 19f * e.finpow() * scl, (x, y) -> {
- float wx = tile.worldx() + x;
- float wy = tile.worldy() + y;
- Fill.circle(wx, wy, e.fout() * 3.5f * scl + 0.3f);
+ }),
+ javelinMissileShoot = new Effect(30f, e -> {
+ rand.setSeed(e.id);
+ Draw.blend(Blending.additive);
+ randLenVectors(e.id, 10, 32f * e.finpow(), e.rotation + 180f, 15f, (x, y) -> {
+ Draw.color(Pal.missileYellow, Pal.turretHeat, rand.random(1f));
+ Fill.circle(e.x + x, e.y + y, rand.random(2f, 4f) * e.fout());
+ Draw.color(Pal.accent, Pal.missileYellowBack, rand.random(1f));
+ Fill.circle(e.x + x, e.y + y, rand.random(2f, 4f) * e.fout());
});
- }
- }).layer(Layer.debris),
-
- staticStone = new Effect(250f, e -> {
- if(!(e.data instanceof HailStoneBulletType.HailStoneData data)) return;
-
- Draw.z(Layer.power + 0.1f);
- Draw.color(e.color);
- Draw.alpha(e.fout());
- Draw.rect(data.region, e.x, e.y, Mathf.randomSeed(e.id) * 360);
- }),
+ Draw.blend();
+ }),
+ flowOut = new Effect(60f, e -> {
+ Draw.color(e.color);
+ Draw.alpha(e.fout() / 5);
+ vec.trns(e.rotation, 4f).add(e.x, e.y);
+ Angles.randLenVectors(e.id, 3, 16 * e.fin(), e.rotation, 10, (x, y) -> {
+ Fill.circle(vec.x + x, vec.y + y, 3 * e.fin());
+ });
+ vec.trns(e.rotation, -4f).add(e.x, e.y);
+ Angles.randLenVectors(e.id + 2, 3, 16 * e.fin(), e.rotation + 180, 10, (x, y) -> {
+ Fill.circle(vec.x + x, vec.y + y, 3 * e.fin());
+ });
+ Draw.alpha(e.fout() / 7);
+ Angles.randLenVectors(e.id + 1, 3, 16 * e.fin(), e.rotation + 180, 20, (x, y) -> {
+ Fill.rect(vec.x + x, vec.y + y, 5 * e.fin(), e.fin(), vec.angleTo(vec.x + x, vec.y + y));
+ });
+ vec.trns(e.rotation, 4f).add(e.x, e.y);
+ Angles.randLenVectors(e.id + 3, 3, 16 * e.fin(), e.rotation, 20, (x, y) -> {
+ Fill.rect(vec.x + x, vec.y + y, 5 * e.fin(), e.fin(), vec.angleTo(vec.x + x, vec.y + y));
+ });
+ }),
+ flowIn = new Effect(60f, e -> {
+ Draw.color(e.color);
+ Draw.alpha(e.fin() / 5);
+ vec.trns(e.rotation, 4f).add(e.x, e.y);
+ Angles.randLenVectors(e.id, 3, 16 * e.fout(), e.rotation, 10, (x, y) -> {
+ Fill.circle(vec.x + x, vec.y + y, 3 * e.fout());
+ });
+ vec.trns(e.rotation, -4f).add(e.x, e.y);
+ Angles.randLenVectors(e.id + 2, 3, 16 * e.fout(), e.rotation + 180, 10, (x, y) -> {
+ Fill.circle(vec.x + x, vec.y + y, 3 * e.fout());
+ });
+ Draw.alpha(e.fin() / 7);
+ Angles.randLenVectors(e.id + 1, 3, 16 * e.fout(), e.rotation + 180, 20, (x, y) -> {
+ Fill.rect(vec.x + x, vec.y + y, 5 * e.fout(), e.fout(), vec.angleTo(vec.x + x, vec.y + y));
+ });
+ vec.trns(e.rotation, 4f).add(e.x, e.y);
+ Angles.randLenVectors(e.id + 3, 3, 16 * e.fout(), e.rotation, 20, (x, y) -> {
+ Fill.rect(vec.x + x, vec.y + y, 5 * e.fout(), e.fout(), vec.angleTo(vec.x + x, vec.y + y));
+ });
+ }),
+ pumpOut = new Effect(60f, e -> {
+ Draw.color(e.color);
+ Draw.alpha(e.fout() / 5);
+ vec.trns(e.rotation, 4f).add(e.x, e.y);
+ Angles.randLenVectors(e.id, 3, 16 * e.fin(), e.rotation, 10, (x, y) -> {
+ Fill.circle(vec.x + x, vec.y + y, 3 * e.fin());
+ });
+ Draw.alpha(e.fout() / 7);
+ vec.trns(e.rotation, 4f).add(e.x, e.y);
+ Angles.randLenVectors(e.id + 3, 3, 16 * e.fin(), e.rotation, 20, (x, y) -> {
+ Fill.rect(vec.x + x, vec.y + y, 5 * e.fin(), e.fin(), vec.angleTo(vec.x + x, vec.y + y));
+ });
+ }),
+ pumpIn = new Effect(60f, e -> {
+ Draw.color(e.color);
+ Draw.alpha(e.fin() / 5);
+ vec.trns(e.rotation, 4f).add(e.x, e.y);
+ Angles.randLenVectors(e.id, 3, 16 * e.fout(), e.rotation, 10, (x, y) -> {
+ Fill.circle(vec.x + x, vec.y + y, 3 * e.fout());
+ });
+ Draw.alpha(e.fin() / 7);
+ Angles.randLenVectors(e.id + 3, 3, 16 * e.fout(), e.rotation, 20, (x, y) -> {
+ Fill.rect(vec.x + x, vec.y + y, 5 * e.fout(), e.fout(), vec.angleTo(vec.x + x, vec.y + y));
+ });
+ }),
+ shelterRotate = new Effect(60f, e -> {
+ if(!(e.data instanceof Block data)) return;
+
+ Draw.color(Pal.accent, e.fout());
+ Fill.rect(e.x, e.y, data.size * 8f, data.size * 8f);
+ Lines.stroke(2f * e.fout(), Pal.accent);
+ Lines.rect(
+ e.x - data.size * 4f,
+ e.y - data.size * 4f,
+ data.size * 8f,
+ data.size * 8f
+ );
+ Lines.circle(e.x, e.y, data.size * 16f * e.finpow());
+ vec.trns(e.rotation, data.size * 16f * e.finpow()).add(e.x, e.y);
+
+ Drawf.tri(vec.x, vec.y, 4f, 8f * e.foutpow(), e.rotation);
+ }),
+ shootShockwave = new Effect(60f, e -> {
+ Draw.color(Color.valueOf("8CA9E8"));
+
+ float
+ fin = Interp.circleOut.apply(e.fout()),
+ fin2 = new Interp.ExpOut(10, 10).apply(e.fin()),
+ fout = new Interp.ExpOut(10, 10).apply(e.fout());
+
+ float progress = e.fin();
+
+ float cover = 280f * fin2 - 40f * Mathf.slope(Interp.circleOut.apply(e.fin()));
+
+ vec.trns(e.rotation, 5.5f - 15f * fin).add(e.x, e.y);
+
+ EFill.donutEllipse(
+ vec.x, vec.y,
+ 4f * progress * fout, 14f * fout,
+ 2f * progress * fout, 12f * fout,
+ cover / 360f,
+ -cover / 2f, e.rotation
+ );
+ }).followParent(true).rotWithParent(true),
+ breakShapedProp = new Effect(23, e -> {
+ if(!(e.data instanceof MultiPropGroup group)) return;
+
+ float scl = Math.max(e.rotation, 1);
+ color(Tmp.c1.set(e.color).mul(1.1f));
+
+ for(Tile tile : group.group){
+ randLenVectors(e.id + tile.pos(), 2, 19f * e.finpow() * scl, (x, y) -> {
+ float wx = tile.worldx() + x;
+ float wy = tile.worldy() + y;
+ Fill.circle(wx, wy, e.fout() * 3.5f * scl + 0.3f);
+ });
+ }
+ }).layer(Layer.debris),
+ staticStone = new Effect(250f, e -> {
+ if(!(e.data instanceof HailStoneBulletType.HailStoneData data)) return;
+
+ Draw.z(Layer.power + 0.1f);
+ Draw.color(e.color);
+ Draw.alpha(e.fout());
+ Draw.rect(data.region, e.x, e.y, Mathf.randomSeed(e.id) * 360);
+ }),
windTail = new Effect(100f, e -> {
diff --git a/src/omaloon/content/OlItems.java b/src/omaloon/content/OlItems.java
index 395b6839..d8bf98bc 100644
--- a/src/omaloon/content/OlItems.java
+++ b/src/omaloon/content/OlItems.java
@@ -7,7 +7,7 @@
public class OlItems{
public static Item
- cobalt, carborundum,
+ cobalt, carborundum,
end;
@@ -24,7 +24,7 @@ public static void load(){
}};
glasmoreItems.addAll(
- cobalt, carborundum, Items.beryllium, Items.coal, Items.graphite
+ cobalt, carborundum, Items.beryllium, Items.coal, Items.graphite
);
}
}
diff --git a/src/omaloon/content/OlLiquids.java b/src/omaloon/content/OlLiquids.java
index a5770a19..f14a7534 100644
--- a/src/omaloon/content/OlLiquids.java
+++ b/src/omaloon/content/OlLiquids.java
@@ -14,7 +14,7 @@
public class OlLiquids{
public static Liquid
- glacium, tiredGlacium,
+ glacium, tiredGlacium,
end;
diff --git a/src/omaloon/content/OlMusics.java b/src/omaloon/content/OlMusics.java
index 1f4c450d..459a5191 100644
--- a/src/omaloon/content/OlMusics.java
+++ b/src/omaloon/content/OlMusics.java
@@ -19,8 +19,8 @@ public class OlMusics{
private static final ObjectMap> musicSets = new ObjectMap<>();
public static Music
- // Vanilla
- launch, land,
+ // Vanilla
+ launch, land,
// Omaloon launch
orbital,
// Glasmore music
@@ -99,16 +99,16 @@ private static void setupEventHandlers(){
/** Updates launch music based on current planet. */
private static void updateLaunchMusic(){
Musics.launch = (Vars.ui.planet.state.planet == OlPlanets.omaloon || Vars.ui.planet.state.planet == OlPlanets.glasmore)
- ? orbital
- : launch;
+ ? orbital
+ : launch;
}
/** Updates landing music based on core block type. */
private static void updateLandMusic(){
Vars.state.rules.defaultTeam.cores().each(core ->
- Musics.land = (core.block == OlStorageBlocks.landingCapsule || core.block == OlStorageBlocks.coreFloe)
- ? glLand
- : land);
+ Musics.land = (core.block == OlStorageBlocks.landingCapsule || core.block == OlStorageBlocks.coreFloe)
+ ? glLand
+ : land);
}
/** Updates planet music sets based on a current planet. */
diff --git a/src/omaloon/content/OlPlanets.java b/src/omaloon/content/OlPlanets.java
index b2a553c8..eb8fb00a 100644
--- a/src/omaloon/content/OlPlanets.java
+++ b/src/omaloon/content/OlPlanets.java
@@ -34,14 +34,14 @@ public static void load(){
solarSystem = this;
meshLoader = () -> new SunMesh(
- this, 4, 5, 0.3f, 1.0f, 1.2f, 1, 1.3f,
-
- valueOf("#8B4513"),
- valueOf("#A0522D"),
- valueOf("c2311e"),
- valueOf("ff6730"),
- valueOf("bf342f"),
- valueOf("8e261d")
+ this, 4, 5, 0.3f, 1.0f, 1.2f, 1, 1.3f,
+
+ valueOf("#8B4513"),
+ valueOf("#A0522D"),
+ valueOf("c2311e"),
+ valueOf("ff6730"),
+ valueOf("bf342f"),
+ valueOf("8e261d")
);
}};
@@ -134,76 +134,76 @@ public static void load(){
heights.add(new HeightPass.ClampHeight(0f, 0.8f));
colors.addAll(
- new NoiseColorPass(){{
- scale = 1.5;
- persistence = 0.5;
- octaves = 3;
- magnitude = 1.2f;
- min = 0.3f;
- max = 0.6f;
- out = OlEnvironmentBlocks.deadGrass.mapColor;
- offset.set(1500f, 300f, -500f);
- }},
- new NoiseColorPass(){{
- seed = 5;
- scale = 1.5;
- persistence = 0.5;
- octaves = 5;
- magnitude = 1.2f;
- min = 0.1f;
- max = 0.4f;
- out = OlEnvironmentBlocks.aghatite.mapColor;
- offset.set(1500f, 300f, -500f);
- }},
- new NoiseColorPass(){{
- seed = 8;
- scale = 1.5;
- persistence = 0.5;
- octaves = 7;
- magnitude = 1.2f;
- min = 0.1f;
- max = 0.4f;
- out = OlEnvironmentBlocks.quartzSand.mapColor;
- offset.set(1500f, 300f, -500f);
- }}
+ new NoiseColorPass(){{
+ scale = 1.5;
+ persistence = 0.5;
+ octaves = 3;
+ magnitude = 1.2f;
+ min = 0.3f;
+ max = 0.6f;
+ out = OlEnvironmentBlocks.deadGrass.mapColor;
+ offset.set(1500f, 300f, -500f);
+ }},
+ new NoiseColorPass(){{
+ seed = 5;
+ scale = 1.5;
+ persistence = 0.5;
+ octaves = 5;
+ magnitude = 1.2f;
+ min = 0.1f;
+ max = 0.4f;
+ out = OlEnvironmentBlocks.aghatite.mapColor;
+ offset.set(1500f, 300f, -500f);
+ }},
+ new NoiseColorPass(){{
+ seed = 8;
+ scale = 1.5;
+ persistence = 0.5;
+ octaves = 7;
+ magnitude = 1.2f;
+ min = 0.1f;
+ max = 0.4f;
+ out = OlEnvironmentBlocks.quartzSand.mapColor;
+ offset.set(1500f, 300f, -500f);
+ }}
);
for(int i = 0; i < 5; i++){
colors.add(new SphereColorPass(new Vec3().setToRandomDirection(), 0.06f, OlEnvironmentBlocks.grenite.mapColor));
}
colors.add(
- new FlatColorPass(){{
- min = max = 0f;
- out = OlEnvironmentBlocks.blueIce.mapColor;
- }},
- new FlatColorPass(){{
- min = 0.3f;
- max = 0.5f;
- out = OlEnvironmentBlocks.deadGrass.mapColor;
- }},
- new FlatColorPass(){{
- max = 1f;
- min = 0.5f;
- out = OlEnvironmentBlocks.blueIce.mapColor;
- }}
+ new FlatColorPass(){{
+ min = max = 0f;
+ out = OlEnvironmentBlocks.blueIce.mapColor;
+ }},
+ new FlatColorPass(){{
+ min = 0.3f;
+ max = 0.5f;
+ out = OlEnvironmentBlocks.deadGrass.mapColor;
+ }},
+ new FlatColorPass(){{
+ max = 1f;
+ min = 0.5f;
+ out = OlEnvironmentBlocks.blueIce.mapColor;
+ }}
);
craters.map(height -> (HeightPass.SphereHeight)height).each(height -> colors.add(
- new SphereColorPass(height.pos, height.radius / 1.75f, OlEnvironmentBlocks.glacium.mapColor)
+ new SphereColorPass(height.pos, height.radius / 1.75f, OlEnvironmentBlocks.glacium.mapColor)
));
}};
meshLoader = () -> new MultiMesh(
- new AtmosphereHexMesh(7),
- new HexMesh(this, 7),
+ new AtmosphereHexMesh(7),
+ new HexMesh(this, 7),
- new CircleMesh(atlas.find("omaloon-ring4"), this, 80, 2.55f, 2.6f, ringPos),
- new CircleMesh(atlas.find("omaloon-ring3"), this, 80, 2.2f, 2.5f, ringPos),
- new CircleMesh(atlas.find("omaloon-ring2"), this, 80, 1.9f, 2.1f, ringPos),
- new CircleMesh(atlas.find("omaloon-ring1"), this, 80, 1.8f, 1.85f, ringPos)
+ new CircleMesh(atlas.find("omaloon-ring4"), this, 80, 2.55f, 2.6f, ringPos),
+ new CircleMesh(atlas.find("omaloon-ring3"), this, 80, 2.2f, 2.5f, ringPos),
+ new CircleMesh(atlas.find("omaloon-ring2"), this, 80, 1.9f, 2.1f, ringPos),
+ new CircleMesh(atlas.find("omaloon-ring1"), this, 80, 1.8f, 1.85f, ringPos)
);
cloudMeshLoader = () -> new MultiMesh(
- new HexSkyMesh(this, 6, -0.5f, 0.14f, 6, OlEnvironmentBlocks.blueIce.mapColor.cpy().a(0.2f), 2, 0.42f, 1f, 0.6f),
- new HexSkyMesh(this, 1, 0.6f, 0.15f, 6, OlEnvironmentBlocks.blueIce.mapColor.cpy().a(0.2f), 2, 0.42f, 1.2f, 0.5f)
+ new HexSkyMesh(this, 6, -0.5f, 0.14f, 6, OlEnvironmentBlocks.blueIce.mapColor.cpy().a(0.2f), 2, 0.42f, 1f, 0.6f),
+ new HexSkyMesh(this, 1, 0.6f, 0.15f, 6, OlEnvironmentBlocks.blueIce.mapColor.cpy().a(0.2f), 2, 0.42f, 1.2f, 0.5f)
);
}};
@@ -218,14 +218,14 @@ public static void load(){
generator = new PurpuraPlanetGenerator();
meshLoader = () -> new MultiMesh(
- new AtmosphereHexMesh(7),
- new HexMesh(this, 7)
+ new AtmosphereHexMesh(7),
+ new HexMesh(this, 7)
);
cloudMeshLoader = () -> new MultiMesh(
- new HexSkyMesh(this, 1, 1f, 0.05f, 6, Color.valueOf("242424").a(0.6f), 2, 0.8f, 1f, 0.f),
- new HexSkyMesh(this, 2, -1.3f, 0.06f, 6, Color.valueOf("413B42").a(0.6f), 2, 0.8f, 1f, 0.5f),
- new HexSkyMesh(this, 3, 1.3f, 0.07f, 6, Color.valueOf("7F777E").a(0.6f), 2, 0.8f, 1.2f, 0.5f),
- new HexSkyMesh(this, 4, -1.6f, 0.08f, 6, Color.valueOf("B2B2B2").a(0.6f), 2, 0.8f, 1.2f, 0.5f)
+ new HexSkyMesh(this, 1, 1f, 0.05f, 6, Color.valueOf("242424").a(0.6f), 2, 0.8f, 1f, 0.f),
+ new HexSkyMesh(this, 2, -1.3f, 0.06f, 6, Color.valueOf("413B42").a(0.6f), 2, 0.8f, 1f, 0.5f),
+ new HexSkyMesh(this, 3, 1.3f, 0.07f, 6, Color.valueOf("7F777E").a(0.6f), 2, 0.8f, 1.2f, 0.5f),
+ new HexSkyMesh(this, 4, -1.6f, 0.08f, 6, Color.valueOf("B2B2B2").a(0.6f), 2, 0.8f, 1.2f, 0.5f)
);
}};
@@ -252,15 +252,15 @@ public static void load(){
Rand rand = new Rand(id + 2);
meshes.add(new NoiseMesh(
- this, 0, 2, radius, 2, 0.55f, 0.45f, 14f,
- color, tinted, 3, 0.6f, 0.38f, 0.5f
+ this, 0, 2, radius, 2, 0.55f, 0.45f, 14f,
+ color, tinted, 3, 0.6f, 0.38f, 0.5f
));
for(int j = 0; j < 8; j++){
meshes.add(new MatMesh(
- new NoiseMesh(this, j + 1, 1, 0.022f + rand.random(0.039f) * 2f, 2, 0.6f, 0.38f, 20f,
- color, tinted, 3, 0.6f, 0.38f, 0.5f),
- new Mat3D().setToTranslation(Tmp.v31.setToRandomDirection(rand).setLength(rand.random(0.44f, 1.4f) * 2f)))
+ new NoiseMesh(this, j + 1, 1, 0.022f + rand.random(0.039f) * 2f, 2, 0.6f, 0.38f, 20f,
+ color, tinted, 3, 0.6f, 0.38f, 0.5f),
+ new Mat3D().setToTranslation(Tmp.v31.setToRandomDirection(rand).setLength(rand.random(0.44f, 1.4f) * 2f)))
);
}
@@ -290,15 +290,15 @@ public static void load(){
Rand rand = new Rand(id + 2);
meshes.add(new NoiseMesh(
- this, 0, 2, radius, 2, 0.55f, 0.45f, 14f,
- color, tinted, 3, 0.6f, 0.38f, 0.5f
+ this, 0, 2, radius, 2, 0.55f, 0.45f, 14f,
+ color, tinted, 3, 0.6f, 0.38f, 0.5f
));
for(int j = 0; j < 8; j++){
meshes.add(new MatMesh(
- new NoiseMesh(this, j + 1, 1, 0.022f + rand.random(0.039f) * 2f, 2, 0.6f, 0.38f, 20f,
- color, tinted, 3, 0.6f, 0.38f, 0.5f),
- new Mat3D().setToTranslation(Tmp.v31.setToRandomDirection(rand).setLength(rand.random(0.44f, 1.4f) * 2f)))
+ new NoiseMesh(this, j + 1, 1, 0.022f + rand.random(0.039f) * 2f, 2, 0.6f, 0.38f, 20f,
+ color, tinted, 3, 0.6f, 0.38f, 0.5f),
+ new Mat3D().setToTranslation(Tmp.v31.setToRandomDirection(rand).setLength(rand.random(0.44f, 1.4f) * 2f)))
);
}
@@ -328,15 +328,15 @@ public static void load(){
Rand rand = new Rand(id + 2);
meshes.add(new NoiseMesh(
- this, 0, 2, radius, 2, 0.55f, 0.45f, 14f,
- color, tinted, 3, 0.6f, 0.38f, 0.5f
+ this, 0, 2, radius, 2, 0.55f, 0.45f, 14f,
+ color, tinted, 3, 0.6f, 0.38f, 0.5f
));
for(int j = 0; j < 8; j++){
meshes.add(new MatMesh(
- new NoiseMesh(this, j + 1, 1, 0.022f + rand.random(0.039f) * 2f, 2, 0.6f, 0.38f, 20f,
- color, tinted, 3, 0.6f, 0.38f, 0.5f),
- new Mat3D().setToTranslation(Tmp.v31.setToRandomDirection(rand).setLength(rand.random(0.44f, 1.4f) * 2f)))
+ new NoiseMesh(this, j + 1, 1, 0.022f + rand.random(0.039f) * 2f, 2, 0.6f, 0.38f, 20f,
+ color, tinted, 3, 0.6f, 0.38f, 0.5f),
+ new Mat3D().setToTranslation(Tmp.v31.setToRandomDirection(rand).setLength(rand.random(0.44f, 1.4f) * 2f)))
);
}
diff --git a/src/omaloon/content/OlSchematics.java b/src/omaloon/content/OlSchematics.java
index a2a77f28..29956e05 100644
--- a/src/omaloon/content/OlSchematics.java
+++ b/src/omaloon/content/OlSchematics.java
@@ -9,8 +9,8 @@
public class OlSchematics{
public static Schematic
- landingCapsule,
- coreFloe;
+ landingCapsule,
+ coreFloe;
public static void load(){
landingCapsule = Schematics.readBase64("bXNjaAF4nGNgYmBiZmDJS8xNZeD3ScxLycxLV3BOLCguzUll4E5JLU4uyiwoyczPY2BgYMtJTErNKWZgio5lZBDPz03Myc/P082BaNJNhmpiYGBkAANGAJEyGHs=");
diff --git a/src/omaloon/content/OlSectorPresets.java b/src/omaloon/content/OlSectorPresets.java
index dc99fb91..93eef76c 100644
--- a/src/omaloon/content/OlSectorPresets.java
+++ b/src/omaloon/content/OlSectorPresets.java
@@ -8,7 +8,7 @@
import omaloon.type.*;
import static arc.util.Time.*;
-import static omaloon.type.ExtraSectorPreset.getFlag;
+import static omaloon.type.ExtraSectorPreset.*;
public class OlSectorPresets{
public static SectorPreset theCrater, redeploymentPath, deadValley;
@@ -17,8 +17,8 @@ public static void load(){
theCrater = new ExtraSectorPreset("crater", OlPlanets.glasmore, 492, () -> {
if(getFlag("hail", true)){
Vars.state.rules.weather.add(new WeatherEntry(OlWeathers.hailStone,
- 2.5f * toMinutes, 5f * toMinutes,
- 30f * Time.toSeconds, 1.5f * toMinutes
+ 2.5f * toMinutes, 5f * toMinutes,
+ 30f * Time.toSeconds, 1.5f * toMinutes
){{
always = true;
}});
@@ -26,8 +26,8 @@ public static void load(){
if(getFlag("final", true) && !Vars.state.rules.weather.isEmpty()){
Vars.state.rules.weather.clear();
Vars.state.rules.weather.add(new WeatherEntry(OlWeathers.hailStone,
- 2.5f * toMinutes, 5f * toMinutes,
- 30f * toSeconds, 1.5f * toMinutes
+ 2.5f * toMinutes, 5f * toMinutes,
+ 30f * toSeconds, 1.5f * toMinutes
));
Groups.weather.each(weather -> weather.life = 300f);
}
@@ -42,8 +42,8 @@ public static void load(){
if(getFlag("addweather", true)){
Vars.state.rules.weather.clear();
Vars.state.rules.weather.add(
- new WeatherEntry(OlWeathers.wind, toMinutes, 12f * toMinutes, 2f * toMinutes, 3f * toMinutes),
- new WeatherEntry(OlWeathers.aghaniteStorm, 1.5f * toMinutes, 5f * toMinutes, 5f * toMinutes, 8f * toMinutes)
+ new WeatherEntry(OlWeathers.wind, toMinutes, 12f * toMinutes, 2f * toMinutes, 3f * toMinutes),
+ new WeatherEntry(OlWeathers.aghaniteStorm, 1.5f * toMinutes, 5f * toMinutes, 5f * toMinutes, 8f * toMinutes)
);
}
}){{
diff --git a/src/omaloon/content/OlSounds.java b/src/omaloon/content/OlSounds.java
index cdfb18d4..32910c3a 100644
--- a/src/omaloon/content/OlSounds.java
+++ b/src/omaloon/content/OlSounds.java
@@ -8,17 +8,17 @@
public class OlSounds{
public static Sound
- debrisBreak = new Sound(),
- bigHailstoneHit = new Sound(),
- giantHailstoneFall = new Sound(),
- giantHailstoneHit = new Sound(),
- hailRain = new Sound(),
- hammer = new Sound(),
- jam = new Sound(),
- shelter = new Sound(),
- shelterPush = new Sound(),
- theShoot = new Sound(),
- convergence = new Sound();
+ debrisBreak = new Sound(),
+ bigHailstoneHit = new Sound(),
+ giantHailstoneFall = new Sound(),
+ giantHailstoneHit = new Sound(),
+ hailRain = new Sound(),
+ hammer = new Sound(),
+ jam = new Sound(),
+ shelter = new Sound(),
+ shelterPush = new Sound(),
+ theShoot = new Sound(),
+ convergence = new Sound();
public static void load(){
debrisBreak = loadSound("debris_break");
diff --git a/src/omaloon/content/OlStatusEffects.java b/src/omaloon/content/OlStatusEffects.java
index 8dd13031..9db6495f 100644
--- a/src/omaloon/content/OlStatusEffects.java
+++ b/src/omaloon/content/OlStatusEffects.java
@@ -16,8 +16,8 @@
public class OlStatusEffects{
public static StatusEffect
- glacied, breeze,
- filledWithWater, filledWithGlacium, filledWithSlag, filledWithOil;
+ glacied, breeze,
+ filledWithWater, filledWithGlacium, filledWithSlag, filledWithOil;
public static void load(){
glacied = new StatusEffect("glacied"){{
diff --git a/src/omaloon/content/OlTechTree.java b/src/omaloon/content/OlTechTree.java
index 706aede9..519bfe25 100644
--- a/src/omaloon/content/OlTechTree.java
+++ b/src/omaloon/content/OlTechTree.java
@@ -11,7 +11,7 @@
import static omaloon.content.blocks.OlDefenceBlocks.*;
import static omaloon.content.blocks.OlDistributionBlocks.*;
import static omaloon.content.blocks.OlPowerBlocks.*;
-import static omaloon.content.blocks.OlProductionBlocks.hammerDrill;
+import static omaloon.content.blocks.OlProductionBlocks.*;
import static omaloon.content.blocks.OlStorageBlocks.*;
public class OlTechTree{
@@ -89,8 +89,8 @@ public static void load(){
node(theCrater, () -> {
node(redeploymentPath, with(
- new SectorComplete(theCrater),
- new Research(coreFloe)
+ new SectorComplete(theCrater),
+ new Research(coreFloe)
), () -> {
node(deadValley, with(new SectorComplete(redeploymentPath)), () -> {
diff --git a/src/omaloon/content/OlUnitTypes.java b/src/omaloon/content/OlUnitTypes.java
index 99ed28e2..b3fb2508 100644
--- a/src/omaloon/content/OlUnitTypes.java
+++ b/src/omaloon/content/OlUnitTypes.java
@@ -78,25 +78,25 @@ public static void load(){
return 0;
};
chainWeapons.add(
- Seq.with(),
- Seq.with(
- new Weapon("omaloon-collector-beam"){{
- x = 0f;
- y = 1f;
- rotate = true;
- mirror = false;
- reload = 60f;
- bullet = new ArtilleryBulletType(5f, 7){{
- maxRange = 40f;
- collidesTiles = collidesAir = collidesGround = true;
- width = height = 11f;
- splashDamage = 25f;
- splashDamageRadius = 25f;
- trailColor = hitColor = lightColor = backColor = Pal.thoriumPink;
- frontColor = Pal.thoriumPink;
- }};
- }}
- )
+ Seq.with(),
+ Seq.with(
+ new Weapon("omaloon-collector-beam"){{
+ x = 0f;
+ y = 1f;
+ rotate = true;
+ mirror = false;
+ reload = 60f;
+ bullet = new ArtilleryBulletType(5f, 7){{
+ maxRange = 40f;
+ collidesTiles = collidesAir = collidesGround = true;
+ width = height = 11f;
+ splashDamage = 25f;
+ splashDamageRadius = 25f;
+ trailColor = hitColor = lightColor = backColor = Pal.thoriumPink;
+ frontColor = Pal.thoriumPink;
+ }};
+ }}
+ )
);
}};
@@ -262,13 +262,13 @@ public static void load(){
}});
abilities.add(
- new JavelinAbility(20f, 5f, 29f){{
- minDamage = 5f;
- minSpeed = 2;
- maxSpeed = 4;
- magX = 0.2f;
- magY = 0.1f;
- }}
+ new JavelinAbility(20f, 5f, 29f){{
+ minDamage = 5f;
+ minSpeed = 2;
+ maxSpeed = 4;
+ magX = 0.2f;
+ magY = 0.1f;
+ }}
);
weapons.add(new Weapon(name + "-launcher"){{
@@ -333,68 +333,68 @@ public static void load(){
shootCone = 20f;
bullets = new BulletType[]{
- new LiquidBulletType(OlLiquids.glacium){{
- recoil = 0.06f;
- killShooter = true;
-
- speed = 2.5f;
- drag = 0.009f;
- shootEffect = Fx.shootSmall;
- lifetime = 27f;
- collidesAir = false;
- status = OlStatusEffects.glacied;
- statusDuration = 60f * 5f;
-
- despawnSound = hitSound = Sounds.splash;
- }},
- new LiquidBulletType(Liquids.water){{
- recoil = 0.06f;
- killShooter = true;
-
- speed = 2.5f;
- drag = 0.009f;
- shootEffect = Fx.shootSmall;
- lifetime = 27f;
- collidesAir = false;
- status = StatusEffects.wet;
- statusDuration = 60f * 5f;
-
- despawnSound = hitSound = Sounds.splash;
- }},
- new LiquidBulletType(Liquids.slag){{
- recoil = 0.06f;
- killShooter = true;
-
- speed = 2.5f;
- drag = 0.009f;
- shootEffect = Fx.shootSmall;
- lifetime = 27f;
- collidesAir = false;
- status = StatusEffects.melting;
- statusDuration = 60f * 5f;
-
- despawnSound = hitSound = Sounds.splash;
- }},
- new LiquidBulletType(Liquids.oil){{
- recoil = 0.06f;
- killShooter = true;
-
- speed = 2.5f;
- drag = 0.009f;
- shootEffect = Fx.shootSmall;
- lifetime = 27f;
- collidesAir = false;
- status = StatusEffects.tarred;
- statusDuration = 60f * 5f;
-
- despawnSound = hitSound = Sounds.splash;
- }}
+ new LiquidBulletType(OlLiquids.glacium){{
+ recoil = 0.06f;
+ killShooter = true;
+
+ speed = 2.5f;
+ drag = 0.009f;
+ shootEffect = Fx.shootSmall;
+ lifetime = 27f;
+ collidesAir = false;
+ status = OlStatusEffects.glacied;
+ statusDuration = 60f * 5f;
+
+ despawnSound = hitSound = Sounds.splash;
+ }},
+ new LiquidBulletType(Liquids.water){{
+ recoil = 0.06f;
+ killShooter = true;
+
+ speed = 2.5f;
+ drag = 0.009f;
+ shootEffect = Fx.shootSmall;
+ lifetime = 27f;
+ collidesAir = false;
+ status = StatusEffects.wet;
+ statusDuration = 60f * 5f;
+
+ despawnSound = hitSound = Sounds.splash;
+ }},
+ new LiquidBulletType(Liquids.slag){{
+ recoil = 0.06f;
+ killShooter = true;
+
+ speed = 2.5f;
+ drag = 0.009f;
+ shootEffect = Fx.shootSmall;
+ lifetime = 27f;
+ collidesAir = false;
+ status = StatusEffects.melting;
+ statusDuration = 60f * 5f;
+
+ despawnSound = hitSound = Sounds.splash;
+ }},
+ new LiquidBulletType(Liquids.oil){{
+ recoil = 0.06f;
+ killShooter = true;
+
+ speed = 2.5f;
+ drag = 0.009f;
+ shootEffect = Fx.shootSmall;
+ lifetime = 27f;
+ collidesAir = false;
+ status = StatusEffects.tarred;
+ statusDuration = 60f * 5f;
+
+ despawnSound = hitSound = Sounds.splash;
+ }}
};
icons = new String[]{
- "omaloon-filled-with-glacium",
- "omaloon-filled-with-water",
- "omaloon-filled-with-slag",
- "omaloon-filled-with-oil"
+ "omaloon-filled-with-glacium",
+ "omaloon-filled-with-water",
+ "omaloon-filled-with-slag",
+ "omaloon-filled-with-oil"
};
bulletFilter = unit -> {
if(unit.hasEffect(OlStatusEffects.filledWithGlacium)) return bullets[0];
@@ -454,28 +454,34 @@ public static void load(){
health = 250;
range = 100;
+ outlineRegion = atlas.find("omaloon-centurion-outline");
+ alwaysCreateOutline = true;
+
weapons.add(new Weapon("omaloon-centurion-weapon"){{
shootSound = OlSounds.theShoot;
mirror = true;
top = false;
- x = 5.5f;
- y = 0.7f;
+ layerOffset = -0.001f;
+ reload = 35f;
+ x = 5.75f;
+ y = 0.27f;
shootX = -0.5f;
shootY = 5.5f;
- reload = 35f;
- recoil = 0.6f;
+ recoil = 1.3f;
+ inaccuracy = 25;
- shoot.shots = 2;
- shoot.shotDelay = 4f;
+ shoot.shots = 4;
+ shoot.shotDelay = 0.2f;
+ velocityRnd = 0.5f;
shootCone = 45f;
ejectEffect = Fx.casing1;
- bullet = new BasicBulletType(2.5f, 5){{
- width = 7f;
- height = 7f;
- lifetime = 35f;
+ bullet = new BasicBulletType(5.5f, 5){{
+ width = 4f;
+ height = 4f;
+ lifetime = 12f;
maxRange = 100;
@@ -483,26 +489,8 @@ public static void load(){
hitEffect = Fx.none;
hitColor = backColor = trailColor = Color.valueOf("feb380");
- trailWidth = 1.3f;
+ trailWidth = 0.8f;
trailLength = 10;
-
- fragBullet = new BasicBulletType(2.5f, 1.5f){{
- width = 4f;
- height = 4f;
- lifetime = 15f;
-
- despawnEffect = Fx.none;
- hitEffect = Fx.none;
- hitColor = backColor = trailColor = Color.valueOf("feb380");
-
- trailWidth = 0.8f;
- trailLength = 10;
- }};
-
- fragOnHit = true;
- fragBullets = 4;
- fragRandomSpread = 45f;
- fragVelocityMin = 0.7f;
}};
}});
}};
@@ -698,30 +686,30 @@ public static void load(){
}};
weapons.addAll(
- new Weapon("omaloon-sage-salvo"){{
- reload = 90f;
- rotate = true;
- rotateSpeed = 12f;
- x = 6.5f;
- y = 1f;
-
- shoot.firstShotDelay = 40f;
+ new Weapon("omaloon-sage-salvo"){{
+ reload = 90f;
+ rotate = true;
+ rotateSpeed = 12f;
+ x = 6.5f;
+ y = 1f;
- shootCone = 45f;
+ shoot.firstShotDelay = 40f;
- shootSound = Sounds.missile;
- bullet = shootType;
- }},
- new Weapon("omaloon-sage-salvo"){{
- reload = 90f;
- rotate = true;
- rotateSpeed = 14f;
- x = -10.25f;
- y = -8f;
+ shootCone = 45f;
- shootSound = Sounds.missile;
- bullet = shootType;
- }}
+ shootSound = Sounds.missile;
+ bullet = shootType;
+ }},
+ new Weapon("omaloon-sage-salvo"){{
+ reload = 90f;
+ rotate = true;
+ rotateSpeed = 14f;
+ x = -10.25f;
+ y = -8f;
+
+ shootSound = Sounds.missile;
+ bullet = shootType;
+ }}
);
}};
//endregion
diff --git a/src/omaloon/content/OlWeathers.java b/src/omaloon/content/OlWeathers.java
index 5bee02a5..f78696c5 100644
--- a/src/omaloon/content/OlWeathers.java
+++ b/src/omaloon/content/OlWeathers.java
@@ -25,7 +25,7 @@ public static void load(){
sound = OlSounds.hailRain;
setBullets(
- //TODO (Maybe this should be added in to the other weather?), Random: Meteor Rain Maybe
+ //TODO (Maybe this should be added in to the other weather?), Random: Meteor Rain Maybe
/*new HailStoneBulletType("omaloon-hailstone-giant", 1){{
hitEffect = Fx.explosion.layer(Layer.power);
hitSound = OlSounds.giantHailstoneHit;
@@ -37,42 +37,42 @@ public static void load(){
hitShake = 40f;
}}, 1/1600f,*/
- new HailStoneBulletType("omaloon-hailstone-big", 3){{
- hitEffect = Fx.explosion.layer(Layer.power);
- hitSound = OlSounds.bigHailstoneHit;
- hitSoundVolume = 0.2f;
- despawnEffect = OlFx.staticStone;
- damage = splashDamage = 95f;
- splashDamageRadius = 40f;
-
- canCollideFalling = pierce = true;
- fallingDamage = 120f;
- fallingRadius = 30f;
- minDistanceFallingCollide = 15f;
- hitFallingEffect = OlFx.bigExplosionStone;
- hitFallingColor = Color.valueOf("5e9098");
- }}, 1 / 1600f,
-
- new HailStoneBulletType("omaloon-hailstone-middle", 2){{
- hitEffect = Fx.dynamicWave.layer(Layer.power);
- despawnEffect = OlFx.fellStone;
- damage = splashDamage = 10f;
- splashDamageRadius = 25f;
-
- canCollideFalling = true;
- fallingDamage = 25f;
- fallingRadius = 15f;
- minDistanceFallingCollide = 5f;
- hitFallingEffect = OlFx.explosionStone;
- hitFallingColor = Color.valueOf("5e9098");
- }}, 1 / 12f,
-
- new HailStoneBulletType("omaloon-hailstone-small", 5){{
- hitEffect = Fx.none;
- despawnEffect = OlFx.fellStone;
- splashDamage = 0f;
- splashDamageRadius = 0;
- }}, 1f
+ new HailStoneBulletType("omaloon-hailstone-big", 3){{
+ hitEffect = Fx.explosion.layer(Layer.power);
+ hitSound = OlSounds.bigHailstoneHit;
+ hitSoundVolume = 0.2f;
+ despawnEffect = OlFx.staticStone;
+ damage = splashDamage = 95f;
+ splashDamageRadius = 40f;
+
+ canCollideFalling = pierce = true;
+ fallingDamage = 120f;
+ fallingRadius = 30f;
+ minDistanceFallingCollide = 15f;
+ hitFallingEffect = OlFx.bigExplosionStone;
+ hitFallingColor = Color.valueOf("5e9098");
+ }}, 1 / 1600f,
+
+ new HailStoneBulletType("omaloon-hailstone-middle", 2){{
+ hitEffect = Fx.dynamicWave.layer(Layer.power);
+ despawnEffect = OlFx.fellStone;
+ damage = splashDamage = 10f;
+ splashDamageRadius = 25f;
+
+ canCollideFalling = true;
+ fallingDamage = 25f;
+ fallingRadius = 15f;
+ minDistanceFallingCollide = 5f;
+ hitFallingEffect = OlFx.explosionStone;
+ hitFallingColor = Color.valueOf("5e9098");
+ }}, 1 / 12f,
+
+ new HailStoneBulletType("omaloon-hailstone-small", 5){{
+ hitEffect = Fx.none;
+ despawnEffect = OlFx.fellStone;
+ splashDamage = 0f;
+ splashDamageRadius = 0;
+ }}, 1f
);
}};
@@ -93,7 +93,7 @@ public static void load(){
sound = Sounds.wind;
setBullets(
- //TODO (Maybe this should be added in to the other weather?), Random: Meteor Rain Maybe
+ //TODO (Maybe this should be added in to the other weather?), Random: Meteor Rain Maybe
/*new HailStoneBulletType("omaloon-hailstone-giant", 1){{
hitEffect = Fx.explosion.layer(Layer.power);
hitSound = OlSounds.giantHailstoneHit;
@@ -105,51 +105,51 @@ public static void load(){
hitShake = 40f;
}}, 1/1600f,*/
- new HailStoneBulletType("omaloon-aghanite-storm-big", 3){{
- speed = 4f;
-
- hitEffect = Fx.explosion.layer(Layer.power);
- hitSound = OlSounds.bigHailstoneHit;
- hitSoundVolume = 0.2f;
- despawnEffect = OlFx.staticStone;
- damage = splashDamage = 95f;
- splashDamageRadius = 40f;
-
- canCollideFalling = pierce = true;
- immovable = false;
- fallingDamage = 120f;
- fallingRadius = 30f;
- minDistanceFallingCollide = 15f;
- hitFallingEffect = OlFx.bigExplosionStone;
- hitFallingColor = Color.valueOf("5e9098");
- }}, 1 / 1600f,
-
- new HailStoneBulletType("omaloon-aghanite-storm-middle", 2){{
- speed = 4f;
-
- hitEffect = Fx.none;
- despawnEffect = OlFx.fellStoneAghanite;
- damage = splashDamage = 10f;
- splashDamageRadius = 25f;
-
- canCollideFalling = true;
- immovable = false;
- fallingDamage = 25f;
- fallingRadius = 15f;
- minDistanceFallingCollide = 5f;
- hitFallingEffect = OlFx.explosionStone;
- hitFallingColor = Color.valueOf("5e9098");
- }}, 1 / 12f,
-
- new HailStoneBulletType("omaloon-aghanite-storm-small", 5){{
- speed = 4f;
-
- immovable = false;
- hitEffect = Fx.none;
- despawnEffect = OlFx.fellStoneAghanite;
- splashDamage = 0f;
- splashDamageRadius = 0;
- }}, 1f
+ new HailStoneBulletType("omaloon-aghanite-storm-big", 3){{
+ speed = 4f;
+
+ hitEffect = Fx.explosion.layer(Layer.power);
+ hitSound = OlSounds.bigHailstoneHit;
+ hitSoundVolume = 0.2f;
+ despawnEffect = OlFx.staticStone;
+ damage = splashDamage = 95f;
+ splashDamageRadius = 40f;
+
+ canCollideFalling = pierce = true;
+ immovable = false;
+ fallingDamage = 120f;
+ fallingRadius = 30f;
+ minDistanceFallingCollide = 15f;
+ hitFallingEffect = OlFx.bigExplosionStone;
+ hitFallingColor = Color.valueOf("5e9098");
+ }}, 1 / 1600f,
+
+ new HailStoneBulletType("omaloon-aghanite-storm-middle", 2){{
+ speed = 4f;
+
+ hitEffect = Fx.none;
+ despawnEffect = OlFx.fellStoneAghanite;
+ damage = splashDamage = 10f;
+ splashDamageRadius = 25f;
+
+ canCollideFalling = true;
+ immovable = false;
+ fallingDamage = 25f;
+ fallingRadius = 15f;
+ minDistanceFallingCollide = 5f;
+ hitFallingEffect = OlFx.explosionStone;
+ hitFallingColor = Color.valueOf("5e9098");
+ }}, 1 / 12f,
+
+ new HailStoneBulletType("omaloon-aghanite-storm-small", 5){{
+ speed = 4f;
+
+ immovable = false;
+ hitEffect = Fx.none;
+ despawnEffect = OlFx.fellStoneAghanite;
+ splashDamage = 0f;
+ splashDamageRadius = 0;
+ }}, 1f
);
}};
diff --git a/src/omaloon/content/blocks/OlCraftingBlocks.java b/src/omaloon/content/blocks/OlCraftingBlocks.java
index 5848177f..a9f07df4 100644
--- a/src/omaloon/content/blocks/OlCraftingBlocks.java
+++ b/src/omaloon/content/blocks/OlCraftingBlocks.java
@@ -16,8 +16,8 @@ public class OlCraftingBlocks{
public static void load(){
carborundumPress = new PressureCrafter("carborundum-press"){{
requirements(Category.crafting, with(
- OlItems.cobalt, 30,
- Items.beryllium, 30
+ OlItems.cobalt, 30,
+ Items.beryllium, 30
));
researchCostMultiplier = 0.3f;
size = 2;
@@ -32,8 +32,8 @@ public static void load(){
endRange = 50f;
efficiencyMultiplier = 1.6f;
curve = t -> Math.min(
- 9f / 2f * (1f - t),
- 9f / 7f * t
+ 9f / 2f * (1f - t),
+ 9f / 7f * t
);
optimalPressure = 40f;
hasOptimalPressure = true;
@@ -44,9 +44,9 @@ public static void load(){
graphitePress = new PressureCrafter("graphite-press"){{
requirements(Category.crafting, with(
- OlItems.cobalt, 15,
- Items.beryllium, 25,
- OlItems.carborundum, 2
+ OlItems.cobalt, 15,
+ Items.beryllium, 25,
+ OlItems.carborundum, 2
));
size = 2;
craftTime = 140f;
@@ -59,8 +59,8 @@ public static void load(){
endRange = 50f;
efficiencyMultiplier = 1.5f;
curve = t -> Math.min(
- 8f * (1f - t),
- 8f / 7f * t
+ 8f * (1f - t),
+ 8f / 7f * t
);
optimalPressure = 45f;
hasOptimalPressure = true;
diff --git a/src/omaloon/content/blocks/OlDefenceBlocks.java b/src/omaloon/content/blocks/OlDefenceBlocks.java
index e2916d6d..7db1d2a4 100644
--- a/src/omaloon/content/blocks/OlDefenceBlocks.java
+++ b/src/omaloon/content/blocks/OlDefenceBlocks.java
@@ -24,8 +24,8 @@
public class OlDefenceBlocks{
public static Block
- //projectors
- repairer, smallShelter,
+ //projectors
+ repairer, smallShelter,
//turrets
apex, convergence, blast, javelin,
//walls
@@ -37,8 +37,8 @@ public static void load(){
//region projectors
repairer = new RepairProjector("repairer"){{
requirements(Category.effect, with(
- OlItems.carborundum, 10,
- Items.beryllium, 15, Items.graphite, 3
+ OlItems.carborundum, 10,
+ Items.beryllium, 15, Items.graphite, 3
));
researchCostMultiplier = 0.6f;
consumePower(0.2f);
@@ -50,8 +50,8 @@ public static void load(){
smallShelter = new Shelter("small-shelter"){{
requirements(Category.effect, with(
- OlItems.cobalt, 25,
- Items.beryllium, 30
+ OlItems.cobalt, 25,
+ Items.beryllium, 30
));
researchCostMultiplier = 0.3f;
size = 2;
@@ -81,66 +81,66 @@ public static void load(){
//region turrets
apex = new ItemTurret("apex"){{
requirements(Category.turret, with(
- OlItems.carborundum, 10,
- OlItems.cobalt, 20
+ OlItems.carborundum, 10,
+ OlItems.cobalt, 20
));
outlineColor = Color.valueOf("2f2f36");
ammo(OlItems.cobalt,
- new BasicBulletType(2.5f, 9){{
- width = 7f;
- height = 7f;
- lifetime = 25f;
- ammoMultiplier = 3;
+ new BasicBulletType(2.5f, 9){{
+ width = 7f;
+ height = 7f;
+ lifetime = 25f;
+ ammoMultiplier = 3;
- despawnEffect = Fx.hitBulletColor;
- hitEffect = Fx.hitBulletColor;
- hitColor = OlItems.cobalt.color;
-
- trailWidth = 1.3f;
- trailLength = 10;
- trailColor = OlItems.cobalt.color;
-
- backColor = OlItems.cobalt.color;
-
- fragBullet = new BasicBulletType(2.5f, 2.5f){{
- width = 4f;
- height = 4f;
- lifetime = 15f;
-
- despawnEffect = Fx.none;
- hitEffect = Fx.none;
+ despawnEffect = Fx.hitBulletColor;
+ hitEffect = Fx.hitBulletColor;
hitColor = OlItems.cobalt.color;
- trailWidth = 0.8f;
+ trailWidth = 1.3f;
trailLength = 10;
trailColor = OlItems.cobalt.color;
backColor = OlItems.cobalt.color;
- }};
- fragOnHit = true;
- fragBullets = 4;
- fragRandomSpread = 45f;
- fragVelocityMin = 0.7f;
- }},
- Items.graphite, new BasicBulletType(4f, 16){{
- width = 7f;
- height = 7f;
- lifetime = 25f;
- ammoMultiplier = 2;
- reloadMultiplier = 1.13f;
-
- despawnEffect = Fx.hitBulletColor;
- hitEffect = Fx.hitBulletColor;
- hitColor = Items.graphite.color;
-
- trailWidth = 1.3f;
- trailLength = 3;
- trailColor = Items.graphite.color;
-
- backColor = Items.graphite.color;
- knockback = 0.8f;
- }}
+ fragBullet = new BasicBulletType(2.5f, 2.5f){{
+ width = 4f;
+ height = 4f;
+ lifetime = 15f;
+
+ despawnEffect = Fx.none;
+ hitEffect = Fx.none;
+ hitColor = OlItems.cobalt.color;
+
+ trailWidth = 0.8f;
+ trailLength = 10;
+ trailColor = OlItems.cobalt.color;
+
+ backColor = OlItems.cobalt.color;
+ }};
+
+ fragOnHit = true;
+ fragBullets = 4;
+ fragRandomSpread = 45f;
+ fragVelocityMin = 0.7f;
+ }},
+ Items.graphite, new BasicBulletType(4f, 16){{
+ width = 7f;
+ height = 7f;
+ lifetime = 25f;
+ ammoMultiplier = 2;
+ reloadMultiplier = 1.13f;
+
+ despawnEffect = Fx.hitBulletColor;
+ hitEffect = Fx.hitBulletColor;
+ hitColor = Items.graphite.color;
+
+ trailWidth = 1.3f;
+ trailLength = 3;
+ trailColor = Items.graphite.color;
+
+ backColor = Items.graphite.color;
+ knockback = 0.8f;
+ }}
);
shootY = 0f;
@@ -158,9 +158,9 @@ Items.graphite, new BasicBulletType(4f, 16){{
blast = new BlastTower("blast"){{
requirements(Category.turret, with(
- OlItems.carborundum, 25,
- OlItems.cobalt, 40,
- Items.beryllium, 40, Items.graphite, 10
+ OlItems.carborundum, 25,
+ OlItems.cobalt, 40,
+ Items.beryllium, 40, Items.graphite, 10
));
size = 2;
consumePower(70f / 60f);
@@ -173,8 +173,8 @@ Items.graphite, new BasicBulletType(4f, 16){{
hasOptimalPressure = true;
curve = t -> Math.min(
- 9f / 8f * (1f - t),
- 9f * t
+ 9f / 8f * (1f - t),
+ 9f * t
);
}});
targetGround = true;
@@ -189,9 +189,9 @@ Items.graphite, new BasicBulletType(4f, 16){{
convergence = new PowerTurret("convergence"){{
requirements(Category.turret, with(
- OlItems.carborundum, 20,
- OlItems.cobalt, 15,
- Items.beryllium, 20
+ OlItems.carborundum, 20,
+ OlItems.cobalt, 15,
+ Items.beryllium, 20
));
consumePower(0.2f);
outlineColor = Color.valueOf("2f2f36");
@@ -275,34 +275,34 @@ public void draw(Bullet b){
drawer = new DrawTurret("gl-"){{
parts.add(
- new RegionPart("-missile"){{
- y = 2f;
- progress = PartProgress.smoothReload.curve(Interp.pow2In);
-
- colorTo = new Color(1f, 1f, 1f, 0f);
- color = Color.white;
- mixColorTo = Pal.accent;
- mixColor = new Color(1f, 1f, 1f, 0f);
- outline = false;
- under = true;
-
- layerOffset = -0.01f;
- }}
+ new RegionPart("-missile"){{
+ y = 2f;
+ progress = PartProgress.smoothReload.curve(Interp.pow2In);
+
+ colorTo = new Color(1f, 1f, 1f, 0f);
+ color = Color.white;
+ mixColorTo = Pal.accent;
+ mixColor = new Color(1f, 1f, 1f, 0f);
+ outline = false;
+ under = true;
+
+ layerOffset = -0.01f;
+ }}
);
}};
shootSound = OlSounds.theShoot;
consumeItems(with(
- Items.coal, 1,
- OlItems.carborundum, 3
+ Items.coal, 1,
+ OlItems.carborundum, 3
));
consume(new ConsumeFluid(null, 36){{
startRange = 1.8f;
endRange = 18f;
curve = t -> Math.min(
- 2f * t,
- -2 * t + 2
+ 2f * t,
+ -2 * t + 2
);
hasOptimalPressure = true;
diff --git a/src/omaloon/content/blocks/OlDistributionBlocks.java b/src/omaloon/content/blocks/OlDistributionBlocks.java
index 306fb1ea..f67b25fe 100644
--- a/src/omaloon/content/blocks/OlDistributionBlocks.java
+++ b/src/omaloon/content/blocks/OlDistributionBlocks.java
@@ -16,8 +16,8 @@
public class OlDistributionBlocks{
public static Block
- //item
- tubeConveyor, tubeDistributor, tubeJunction, tubeSorter, tubeGate, tubeBridge,
+ //item
+ tubeConveyor, tubeDistributor, tubeJunction, tubeSorter, tubeGate, tubeBridge,
//liquid
liquidTube, liquidJunction, liquidBridge, liquidPump, filterPump, liquidValve, liquidGauge,
@@ -28,7 +28,7 @@ public static void load(){
// region items
tubeConveyor = new TubeConveyor("tube-conveyor"){{
requirements(Category.distribution, with(
- OlItems.cobalt, 1
+ OlItems.cobalt, 1
));
researchCost = empty;
health = 65;
@@ -38,39 +38,39 @@ public static void load(){
tubeDistributor = new TubeDistributor("tube-distributor"){{
requirements(Category.distribution, with(
- OlItems.cobalt, 3
+ OlItems.cobalt, 3
));
researchCost = empty;
speed = 10f;
buildCostMultiplier = 4f;
health = 65;
drawer = new DrawMulti(
- new DrawRegion("-bottom"){{
- layer = Layer.blockUnder;
- }}
+ new DrawRegion("-bottom"){{
+ layer = Layer.blockUnder;
+ }}
);
}};
tubeJunction = new TubeJunction("tube-junction"){{
requirements(Category.distribution, with(
- OlItems.cobalt, 3
+ OlItems.cobalt, 3
));
researchCostMultiplier = 0.3f;
speed = 25;
capacity = 4;
health = 65;
drawer = new DrawMulti(
- new DrawRegion("-bottom"){{
- layer = Layer.blockUnder;
- }},
- new DrawDefault()
+ new DrawRegion("-bottom"){{
+ layer = Layer.blockUnder;
+ }},
+ new DrawDefault()
);
}};
tubeSorter = new TubeSorter("tube-sorter"){{
requirements(Category.distribution, with(
- OlItems.cobalt, 3,
- Items.beryllium, 2, OlItems.carborundum, 1
+ OlItems.cobalt, 3,
+ Items.beryllium, 2, OlItems.carborundum, 1
));
researchCostMultiplier = 0.3f;
health = 65;
@@ -78,8 +78,8 @@ public static void load(){
tubeGate = new TubeGate("tube-gate"){{
requirements(Category.distribution, with(
- OlItems.cobalt, 3,
- Items.beryllium, 2, OlItems.carborundum, 1
+ OlItems.cobalt, 3,
+ Items.beryllium, 2, OlItems.carborundum, 1
));
researchCostMultiplier = 0.3f;
health = 65;
@@ -87,8 +87,8 @@ public static void load(){
tubeBridge = new TubeItemBridge("tube-bridge-conveyor"){{
requirements(Category.distribution, with(
- OlItems.cobalt, 3,
- Items.beryllium, 2
+ OlItems.cobalt, 3,
+ Items.beryllium, 2
));
researchCostMultiplier = 0.3f;
fadeIn = moveArrows = false;
@@ -102,34 +102,34 @@ public static void load(){
//region liquids
liquidTube = new PressureLiquidConduit("liquid-tube"){{
requirements(Category.liquid, with(
- OlItems.cobalt, 2
+ OlItems.cobalt, 2
));
researchCost = with(
- OlItems.cobalt, 10
+ OlItems.cobalt, 10
);
}};
liquidJunction = new PressureLiquidJunction("liquid-junction"){{
requirements(Category.liquid, with(
- OlItems.cobalt, 5
+ OlItems.cobalt, 5
));
researchCostMultiplier = 0.3f;
}};
liquidBridge = new PressureLiquidBridge("liquid-bridge"){{
requirements(Category.liquid, with(
- OlItems.cobalt, 2,
- Items.beryllium, 3
+ OlItems.cobalt, 2,
+ Items.beryllium, 3
));
range = 4;
}};
liquidPump = new PressureLiquidPump("liquid-pump"){{
requirements(Category.liquid, with(
- OlItems.cobalt, 4
+ OlItems.cobalt, 4
));
researchCost = with(
- OlItems.cobalt, 25
+ OlItems.cobalt, 25
);
pumpStrength = 5f / 60f;
@@ -147,10 +147,10 @@ public static void load(){
filterPump = new PressureLiquidPump("filter-pump"){{
requirements(Category.liquid, with(
- OlItems.cobalt, 4
+ OlItems.cobalt, 4
));
researchCost = with(
- OlItems.cobalt, 20
+ OlItems.cobalt, 20
);
pumpStrength = 1f / 6f;
pressureDifference = 0;
@@ -166,12 +166,12 @@ public static void load(){
liquidValve = new PressureLiquidValve("liquid-valve"){{
requirements(Category.liquid, BuildVisibility.sandboxOnly, with(
- OlItems.cobalt, 2,
- Items.beryllium, 2
+ OlItems.cobalt, 2,
+ Items.beryllium, 2
));
researchCost = with(
- OlItems.cobalt, 20,
- Items.beryllium, 20
+ OlItems.cobalt, 20,
+ Items.beryllium, 20
);
pressureLoss = 0.3f;
@@ -181,12 +181,12 @@ public static void load(){
liquidGauge = new PressureLiquidGauge("liquid-gauge"){{
requirements(Category.liquid, with(
- OlItems.cobalt, 2,
- Items.beryllium, 1
+ OlItems.cobalt, 2,
+ Items.beryllium, 1
));
researchCost = with(
- OlItems.cobalt, 20,
- Items.beryllium, 10
+ OlItems.cobalt, 20,
+ Items.beryllium, 10
);
}};
//endregion
diff --git a/src/omaloon/content/blocks/OlEnvironmentBlocks.java b/src/omaloon/content/blocks/OlEnvironmentBlocks.java
index 5b9b04d3..f874dd53 100644
--- a/src/omaloon/content/blocks/OlEnvironmentBlocks.java
+++ b/src/omaloon/content/blocks/OlEnvironmentBlocks.java
@@ -12,43 +12,43 @@
public class OlEnvironmentBlocks{
public static Block
- //cliff
- cliffUp, cliffHelper,
+ //cliff
+ cliffUp, cliffHelper,
//ores
oreCobalt, oreBeryllium, oreCoal,
//biomes
deadShrub, gerbDebris,
- deadGrass,
+ deadGrass,
frozenSoilWall, frozenSoilBoulder,
- frozenSoil,
+ frozenSoil,
albasterWall, albasterBoulder,
- albaster, albasterTiles, albasterCrater,
+ albaster, albasterTiles, albasterCrater,
aghatiteWall, weatheredAghaniteWall, cobaltedAghaniteWall,
- aghatiteBoulder, weatheredAghaniteBoulder, berylledAghaniteBoulder, cobaltedAghaniteStones,
- aghaniteConcretion, largeAghaniteConcretion,
- aghatite, aghatitePebbles,
- smoothAghanite, weatheredAghanite, aghaniteShale, aghaniteDust,
- coastalAghanite, berylledAghanite, cobaltedAghanite,
+ aghatiteBoulder, weatheredAghaniteBoulder, berylledAghaniteBoulder, cobaltedAghaniteStones,
+ aghaniteConcretion, largeAghaniteConcretion,
+ aghatite, aghatitePebbles,
+ smoothAghanite, weatheredAghanite, aghaniteShale, aghaniteDust,
+ coastalAghanite, berylledAghanite, cobaltedAghanite,
quartzSandWall, quartzSandBoulder,
- quartzSand,
+ quartzSand,
deepGlacium, glacium, greniteGlacium,
- greniteWall, darkGreniteWall, greniteBoulder,
- grenite, coastalGrenite,
+ greniteWall, darkGreniteWall, greniteBoulder,
+ grenite, coastalGrenite,
blueIceWall, blueSnowWall, blueBoulder,
- blueIce, blueIcePieces, blueSnow, blueSnowdrifts, weatheredIce,
+ blueIce, blueIcePieces, blueSnow, blueSnowdrifts, weatheredIce,
//artificial
glasmoreMetal, ruinedGerbTiles, ruinedGerbMasonry,
- ruinedGerbWall,
+ ruinedGerbWall,
//dead tree
fallenDeadTree, fallenDeadTreeTopHalf, fallenDeadTreeBottomHalf,
- spikedTree, bushTree,
- standingDeadTree, deadTreeStump,
+ spikedTree, bushTree,
+ standingDeadTree, deadTreeStump,
end;
@@ -335,15 +335,15 @@ public static void load(){
variants = 8;
canMirror = true;
spriteOffsets = new Vec2[]{
- new Vec2(-16f, -32f),
- new Vec2(8f, -32f),
- new Vec2(-16, -32f),
- new Vec2(-8f, -32f),
-
- new Vec2(-8f, -16f),
- new Vec2(-32f, -16f),
- new Vec2(0f, -16f),
- new Vec2(-32f, -16f)
+ new Vec2(-16f, -32f),
+ new Vec2(8f, -32f),
+ new Vec2(-16, -32f),
+ new Vec2(-8f, -32f),
+
+ new Vec2(-8f, -16f),
+ new Vec2(-32f, -16f),
+ new Vec2(0f, -16f),
+ new Vec2(-32f, -16f)
};
}};
fallenDeadTreeTopHalf = new CustomShapeProp("fallen-dead-tree-top-half"){{
@@ -351,15 +351,15 @@ public static void load(){
variants = 8;
canMirror = true;
spriteOffsets = new Vec2[]{
- new Vec2(-8f, -16f),
- new Vec2(-8f, -16f),
- new Vec2(-8f, -16f),
- new Vec2(0f, -16f),
-
- new Vec2(-16f, -8f),
- new Vec2(-16f, -8f),
- new Vec2(-8f, -8f),
- new Vec2(-16f, -8f)
+ new Vec2(-8f, -16f),
+ new Vec2(-8f, -16f),
+ new Vec2(-8f, -16f),
+ new Vec2(0f, -16f),
+
+ new Vec2(-16f, -8f),
+ new Vec2(-16f, -8f),
+ new Vec2(-8f, -8f),
+ new Vec2(-16f, -8f)
};
}};
fallenDeadTreeBottomHalf = new CustomShapeProp("fallen-dead-tree-bottom-half"){{
@@ -367,15 +367,15 @@ public static void load(){
variants = 8;
canMirror = true;
spriteOffsets = new Vec2[]{
- new Vec2(-12f, -8f),
- new Vec2(-4f, -8f),
- new Vec2(-12f, -8f),
- new Vec2(-12f, -8f),
-
- new Vec2(-8f, -12f),
- new Vec2(-8f, -12f),
- new Vec2(0f, -12f),
- new Vec2(-8f, -12f)
+ new Vec2(-12f, -8f),
+ new Vec2(-4f, -8f),
+ new Vec2(-12f, -8f),
+ new Vec2(-12f, -8f),
+
+ new Vec2(-8f, -12f),
+ new Vec2(-8f, -12f),
+ new Vec2(0f, -12f),
+ new Vec2(-8f, -12f)
};
}};
@@ -393,7 +393,7 @@ public static void load(){
clipSize = 32f;
variants = 1;
spriteOffsets = new Vec2[]{
- new Vec2(-4f, -12f),
+ new Vec2(-4f, -12f),
};
}};
deadTreeStump = new CustomShapeProp("dead-tree-stump"){{
@@ -401,7 +401,7 @@ public static void load(){
variants = 1;
rotateRegions = drawUnder = true;
spriteOffsets = new Vec2[]{
- new Vec2(-4f, -4f),
+ new Vec2(-4f, -4f),
};
}};
//endregion
diff --git a/src/omaloon/content/blocks/OlPowerBlocks.java b/src/omaloon/content/blocks/OlPowerBlocks.java
index 2040f60c..32040027 100644
--- a/src/omaloon/content/blocks/OlPowerBlocks.java
+++ b/src/omaloon/content/blocks/OlPowerBlocks.java
@@ -17,26 +17,26 @@
public class OlPowerBlocks{
public static Block
- windTurbine, coalGenerator, impulseNode,
+ windTurbine, coalGenerator, impulseNode,
end;
public static void load(){
windTurbine = new WindGenerator("wind-turbine"){{
requirements(Category.power, with(
- Items.beryllium, 7
+ Items.beryllium, 7
));
researchCostMultiplier = 0.5f;
drawer = new DrawMulti(
- new DrawDefault(),
- new Draw3dSpin("-holder", "-rotator"){{
- baseOffset.x = Vars.tilesize / 2f;
- axis = Vec3.Y;
- rotationProvider(WindGeneratorBuild::baseRotation);
- rotationAroundAxis = -55f;
- rotateSpeed = baseRotateSpeed = 3.3f;
- scale.set(0.5f, 1f, 0f);
- }}
+ new DrawDefault(),
+ new Draw3dSpin("-holder", "-rotator"){{
+ baseOffset.x = Vars.tilesize / 2f;
+ axis = Vec3.Y;
+ rotationProvider(WindGeneratorBuild::baseRotation);
+ rotationAroundAxis = -55f;
+ rotateSpeed = baseRotateSpeed = 3.3f;
+ scale.set(0.5f, 1f, 0f);
+ }}
);
size = 1;
powerProduction = 0.2f;
@@ -44,8 +44,8 @@ public static void load(){
coalGenerator = new ConsumeGenerator("coal-generator"){{
requirements(Category.power, with(
- OlItems.cobalt, 15,
- Items.beryllium, 10, Items.graphite, 5
+ OlItems.cobalt, 15,
+ Items.beryllium, 10, Items.graphite, 5
));
powerProduction = 1f;
itemDuration = 120f;
@@ -58,19 +58,19 @@ public static void load(){
consumeItem(Items.coal, 1);
drawer = new DrawMulti(new DrawDefault(),
- new DrawFlame(Color.valueOf("ffcd66")){{
- flameRadius = 2f;
- flameRadiusIn = 1f;
- flameRadiusScl = 4f;
- flameRadiusMag = 1f;
- flameRadiusInMag = 0.5f;
- }}
+ new DrawFlame(Color.valueOf("ffcd66")){{
+ flameRadius = 2f;
+ flameRadiusIn = 1f;
+ flameRadiusScl = 4f;
+ flameRadiusMag = 1f;
+ flameRadiusInMag = 0.5f;
+ }}
);
}};
impulseNode = new ImpulseNode("impulse-node"){{
requirements(Category.power, with(
- Items.beryllium, 5
+ Items.beryllium, 5
));
researchCostMultiplier = 0.5f;
maxNodes = 10;
diff --git a/src/omaloon/content/blocks/OlProductionBlocks.java b/src/omaloon/content/blocks/OlProductionBlocks.java
index 96ea2c94..fe788261 100644
--- a/src/omaloon/content/blocks/OlProductionBlocks.java
+++ b/src/omaloon/content/blocks/OlProductionBlocks.java
@@ -11,17 +11,17 @@
public class OlProductionBlocks{
public static Block
- hammerDrill,
+ hammerDrill,
end;
public static void load(){
hammerDrill = new HammerDrill("hammer-drill"){{
requirements(Category.production, with(
- OlItems.cobalt, 10
+ OlItems.cobalt, 10
));
researchCost = with(
- OlItems.cobalt, 30
+ OlItems.cobalt, 30
);
drillTime = 920f;
tier = 3;
@@ -40,8 +40,8 @@ public static void load(){
hasOptimalPressure = true;
curve = t -> Math.min(
- 9f / 8f * (1f - t),
- 9f * t
+ 9f / 8f * (1f - t),
+ 9f * t
);
}});
}};
diff --git a/src/omaloon/content/blocks/OlStorageBlocks.java b/src/omaloon/content/blocks/OlStorageBlocks.java
index a181e075..31f5d8d8 100644
--- a/src/omaloon/content/blocks/OlStorageBlocks.java
+++ b/src/omaloon/content/blocks/OlStorageBlocks.java
@@ -11,14 +11,14 @@
public class OlStorageBlocks{
public static Block
- landingCapsule, coreFloe,
- end;
+ landingCapsule, coreFloe,
+ end;
public static void load(){
landingCapsule = new GlassmoreCoreBlock("landing-capsule"){{
requirements(Category.effect, BuildVisibility.editorOnly, with(
- OlItems.cobalt, 600,
- Items.beryllium, 300, Items.coal, 50
+ OlItems.cobalt, 600,
+ Items.beryllium, 300, Items.coal, 50
));
isFirstTier = true;
@@ -35,9 +35,9 @@ public static void load(){
coreFloe = new GlassmoreCoreBlock("core-floe"){{
requirements(Category.effect, with(
- OlItems.carborundum, 250,
- OlItems.cobalt, 450,
- Items.beryllium, 350
+ OlItems.carborundum, 250,
+ OlItems.cobalt, 450,
+ Items.beryllium, 350
));
researchCost = empty;
diff --git a/src/omaloon/core/OlSettings.java b/src/omaloon/core/OlSettings.java
index 4e25ce44..685cce74 100644
--- a/src/omaloon/core/OlSettings.java
+++ b/src/omaloon/core/OlSettings.java
@@ -7,7 +7,6 @@
import mindustry.ui.*;
import mindustry.ui.dialogs.*;
import mindustry.ui.dialogs.SettingsMenuDialog.SettingsTable.*;
-import omaloon.*;
import omaloon.content.*;
import static arc.Core.*;
@@ -22,26 +21,26 @@ public static void load(){
table.table(Tex.button, cat -> {
if(!mobile || Core.settings.getBool("keyboard")){
cat.button(
- "@settings.controls",
- Icon.move,
- Styles.flatt,
- iconMed,
- () -> OmaloonMod.olInputDialog.show()
+ "@settings.controls",
+ Icon.move,
+ Styles.flatt,
+ iconMed,
+ () -> OlUI.olInputDialog.show()
).growX().marginLeft(8f).height(50f).row();
}
cat.button(
- "@settings.game",
- Icon.settings,
- Styles.flatt,
- iconMed,
- () -> OmaloonMod.olGameDialog.show()
+ "@settings.game",
+ Icon.settings,
+ Styles.flatt,
+ iconMed,
+ () -> OlUI.olGameDialog.show()
).growX().marginLeft(8f).height(50f).row();
cat.button(
- "@settings.omaloon-moddata",
- Icon.save,
- Styles.flatt,
- iconMed,
- () -> OmaloonMod.olGameDataDialog.show()
+ "@settings.omaloon-moddata",
+ Icon.save,
+ Styles.flatt,
+ iconMed,
+ () -> OlUI.olGameDataDialog.show()
).growX().marginLeft(8f).height(50f).row();
}).width(Math.min(Core.graphics.getWidth() / 1.2f, 460.0F)).padBottom(45);
// table.sliderPref("@setting.omaloon-shield-opacity", 20, 0, 100, s -> s + "%");
@@ -52,23 +51,23 @@ public static void load(){
//discord link
table.fill(c -> c
- .bottom()
- .right()
- .button(
- Icon.discord,
- new ImageButton.ImageButtonStyle(),
- () -> {
- if(!app.openURI(discordURL)){
- ui.showInfoFade("@linkfail");
- app.setClipboardText(discordURL);
- }
- }
- )
- .marginTop(9f)
- .marginLeft(10f)
- .tooltip(bundle.get("setting.omaloon-discord-join"))
- .size(84, 45)
- .name("discord"));
+ .bottom()
+ .right()
+ .button(
+ Icon.discord,
+ new ImageButton.ImageButtonStyle(),
+ () -> {
+ if(!app.openURI(discordURL)){
+ ui.showInfoFade("@linkfail");
+ app.setClipboardText(discordURL);
+ }
+ }
+ )
+ .marginTop(9f)
+ .marginLeft(10f)
+ .tooltip(bundle.get("setting.omaloon-discord-join"))
+ .size(84, 45)
+ .name("discord"));
});
}
diff --git a/src/omaloon/core/OlUI.java b/src/omaloon/core/OlUI.java
new file mode 100644
index 00000000..94db6093
--- /dev/null
+++ b/src/omaloon/core/OlUI.java
@@ -0,0 +1,70 @@
+package omaloon.core;
+
+import arc.Core;
+import arc.Events;
+import arc.KeyBinds;
+import arc.util.Time;
+import mindustry.Vars;
+import mindustry.game.EventType;
+import omaloon.OmaloonMod;
+import omaloon.ui.StartSplash;
+import omaloon.ui.dialogs.OlEndDialog;
+import omaloon.ui.dialogs.OlGameDataDialog;
+import omaloon.ui.dialogs.OlGameDialog;
+import omaloon.ui.dialogs.OlInputDialog;
+import omaloon.ui.fragments.CliffFragment;
+import omaloon.ui.fragments.ShapedEnvPlacerFragment;
+
+import static arc.Core.settings;
+
+
+public class OlUI {
+ public static ShapedEnvPlacerFragment shapedEnvPlacerFragment;
+ public static CliffFragment cliffFragment;
+ public static OlInputDialog olInputDialog;
+ public static OlGameDataDialog olGameDataDialog;
+ public static OlGameDialog olGameDialog;
+ public static OlEndDialog olEndDialog;
+
+ public OlUI(KeyBinds.KeyBind... binds) {
+ setKeybinds(binds);
+
+
+ Events.on(EventType.ClientLoadEvent.class,it->onClient());
+ }
+ protected void onClient(){
+ StartSplash.build(Vars.ui.menuGroup);
+ StartSplash.show();
+ if (Vars.mobile) return;
+
+ shapedEnvPlacerFragment = new ShapedEnvPlacerFragment();
+ cliffFragment = new CliffFragment();
+ olInputDialog = new OlInputDialog();
+ olGameDataDialog = new OlGameDataDialog();
+ olGameDialog = new OlGameDialog();
+ olEndDialog = new OlEndDialog();
+
+ shapedEnvPlacerFragment.build(Vars.ui.hudGroup);
+ cliffFragment.build(Vars.ui.hudGroup);
+ }
+
+ /**
+ * @author Zelaux
+ * source
+ * */
+ protected void setKeybinds(KeyBinds.KeyBind... modBindings){
+ Time.mark();
+ KeyBinds.KeyBind[] keyBinds = Core.keybinds.getKeybinds();
+ KeyBinds.KeyBind[] defs = new KeyBinds.KeyBind[keyBinds.length + modBindings.length];
+ for (int i = 0; i < defs.length; i++) {
+ if (i {
- boolean omaloonOnly = block.minfo.mod != null && block.minfo.mod.name.equals("omaloon");
- boolean sandboxOnly = block.buildVisibility == BuildVisibility.sandboxOnly || block.buildVisibility == BuildVisibility.editorOnly;
- boolean empty = Vars.player.team().data().getBuildings(block).isEmpty();
-
- return !omaloonOnly && !sandboxOnly && !empty && !(block instanceof ConstructBlock);
- });
- if(out != null) invalidBuilds.add(Vars.player.team().data().getBuildings(out));
- invalidBuilds.removeAll(b -> b instanceof ConstructBlock.ConstructBuild);
- }
-
- if(!invalidBuilds.isEmpty()){
- invalidBuilds.each(build -> {
- OlFx.stealInvalid.at(build.x, build.y, 0, build.block);
- build.tile.setAir();
- });
- }
+ if(!enabled()) return;
+
+ invalidBuilds.clear();
+ if(Vars.state.isCampaign() && Vars.state.getPlanet().solarSystem == OlPlanets.omaloon){
+ Block out = Vars.content.blocks().find(block -> {
+ boolean omaloonOnly = block.minfo.mod != null && block.minfo.mod.name.equals("omaloon");
+ boolean sandboxOnly = block.buildVisibility == BuildVisibility.sandboxOnly || block.buildVisibility == BuildVisibility.editorOnly;
+ boolean empty = Vars.player.team().data().getBuildings(block).isEmpty();
+
+ return !omaloonOnly && !sandboxOnly && !empty && !(block instanceof ConstructBlock);
+ });
+ if(out != null) invalidBuilds.add(Vars.player.team().data().getBuildings(out));
+ invalidBuilds.removeAll(b -> b instanceof ConstructBlock.ConstructBuild);
+ }
+
+ if(!invalidBuilds.isEmpty()){
+ invalidBuilds.each(build -> {
+ OlFx.stealInvalid.at(build.x, build.y, 0, build.block);
+ build.tile.setAir();
+ });
}
}
}
diff --git a/src/omaloon/entities/abilities/HailShieldAbility.java b/src/omaloon/entities/abilities/HailShieldAbility.java
index 1387c2cc..3f830698 100644
--- a/src/omaloon/entities/abilities/HailShieldAbility.java
+++ b/src/omaloon/entities/abilities/HailShieldAbility.java
@@ -19,7 +19,7 @@
import java.util.concurrent.atomic.*;
import static mindustry.Vars.tilesize;
-import static omaloon.OmaloonMod.shieldBuffer;
+import static omaloon.OmaloonMod.*;
/**
* An ability for a shield covering the unit that protects from hail, but not enemy bullets.
@@ -123,8 +123,8 @@ public void draw(Unit unit){
if(alpha > 0.001f){
Fill.light(unit.x + x, unit.y + y, Lines.circleVertices(radius), radius,
- Color.clear,
- Tmp.c2.set(Pal.heal).lerp(Color.white, Mathf.clamp(unit.hitTime() / 2f)).a(0.7f * alpha)
+ Color.clear,
+ Tmp.c2.set(Pal.heal).lerp(Color.white, Mathf.clamp(unit.hitTime() / 2f)).a(0.7f * alpha)
);
}
}
@@ -132,7 +132,7 @@ public void draw(Unit unit){
@Override
public void update(Unit unit){
float dx = unit.x + x,
- dy = unit.y + y;
+ dy = unit.y + y;
if(broken){
if(damage > 0){
@@ -146,30 +146,30 @@ public void update(Unit unit){
AtomicBoolean wasHit = new AtomicBoolean(false);
Groups.bullet.intersect(
- unit.x + x - radius - shieldBuffer,
- unit.y + y - radius - shieldBuffer,
- (radius + shieldBuffer) * 2f,
- (radius + shieldBuffer) * 2f,
- b -> {
- if(b.team == Team.derelict){
- if(Mathf.dst(unit.x + x, unit.y + y, b.x, b.y) <= radius + b.type.splashDamageRadius){
- b.absorb();
- if(parentizeEffect){
- hitEffect.at(dx, dy, b.hitSize, hitColor);
- hitSound.at(dx, dy, Mathf.random(0.9f, 1.1f), hitSoundVolume);
- }else{
- hitEffect.at(b.x, b.y, b.hitSize, hitColor);
- hitSound.at(b.x, b.y, Mathf.random(0.9f, 1.1f), hitSoundVolume);
- }
- damage += b.damage;
- wasHit.set(true);
- if(damage > maxHealth){
- broken = true;
- breakEffect.at(dx, dy, b.hitSize, unit);
+ unit.x + x - radius - shieldBuffer,
+ unit.y + y - radius - shieldBuffer,
+ (radius + shieldBuffer) * 2f,
+ (radius + shieldBuffer) * 2f,
+ b -> {
+ if(b.team == Team.derelict){
+ if(Mathf.dst(unit.x + x, unit.y + y, b.x, b.y) <= radius + b.type.splashDamageRadius){
+ b.absorb();
+ if(parentizeEffect){
+ hitEffect.at(dx, dy, b.hitSize, hitColor);
+ hitSound.at(dx, dy, Mathf.random(0.9f, 1.1f), hitSoundVolume);
+ }else{
+ hitEffect.at(b.x, b.y, b.hitSize, hitColor);
+ hitSound.at(b.x, b.y, Mathf.random(0.9f, 1.1f), hitSoundVolume);
+ }
+ damage += b.damage;
+ wasHit.set(true);
+ if(damage > maxHealth){
+ broken = true;
+ breakEffect.at(dx, dy, b.hitSize, unit);
+ }
}
}
}
- }
);
if(wasHit.get()){
diff --git a/src/omaloon/entities/abilities/JavelinAbility.java b/src/omaloon/entities/abilities/JavelinAbility.java
index 1b820aa1..5aef1234 100644
--- a/src/omaloon/entities/abilities/JavelinAbility.java
+++ b/src/omaloon/entities/abilities/JavelinAbility.java
@@ -104,9 +104,9 @@ public JavelinAbility(){
@Override
public void addStats(Table t){
t.add(
- "[lightgray]" + Stat.damage.localized() + ": [white]" +
- Strings.autoFixed(60f * minDamage / damageInterval, 2) + " - " +
- Strings.autoFixed(60f * damage / damageInterval, 2) + " " + StatUnit.perSecond.localized()
+ "[lightgray]" + Stat.damage.localized() + ": [white]" +
+ Strings.autoFixed(60f * minDamage / damageInterval, 2) + " - " +
+ Strings.autoFixed(60f * damage / damageInterval, 2) + " " + StatUnit.perSecond.localized()
).row();
t.add("[lightgray]" + Stat.range.localized() + ": [white]" + Strings.autoFixed(radius / 8f, 2) + " " + StatUnit.blocks.localized()).row();
t.add("[lightgray]" + OlStats.minSpeed.localized() + ": [white]" + Strings.autoFixed(minSpeed / 8f, 2) + " " + StatUnit.tilesSecond.localized()).row();
@@ -122,8 +122,8 @@ public void draw(Unit unit){
if(overlayRegion == null) overlayRegion = Core.atlas.find(name);
float
- drawx = unit.x + x + Mathf.sin(Time.time + unit.id, sclX, magX),
- drawy = unit.y + y + Mathf.sin(Time.time + sinOffset + unit.id, sclY, magY);
+ drawx = unit.x + x + Mathf.sin(Time.time + unit.id, sclX, magX),
+ drawy = unit.y + y + Mathf.sin(Time.time + sinOffset + unit.id, sclY, magY);
float z = Draw.z();
Draw.z(z - layerOffset);
Draw.color(color);
diff --git a/src/omaloon/entities/bullet/FallingBulletType.java b/src/omaloon/entities/bullet/FallingBulletType.java
index 32f35f7c..c5f15a7c 100644
--- a/src/omaloon/entities/bullet/FallingBulletType.java
+++ b/src/omaloon/entities/bullet/FallingBulletType.java
@@ -102,7 +102,7 @@ public void update(Bullet b){
public void updateFalling(Bullet b){
if(canCollideFalling && isLanding(b)){
Teamc target = Units.closestTarget(b.team, b.x, b.y, fallingRadius,
- e -> e.checkTarget(true, false) && e.team != b.team && !b.hasCollided(e.id) //ONLY AIR UNITS
+ e -> e.checkTarget(true, false) && e.team != b.team && !b.hasCollided(e.id) //ONLY AIR UNITS
);
Vec2 pos = getTrajectory(b);
diff --git a/src/omaloon/entities/bullet/LaunchBulletType.java b/src/omaloon/entities/bullet/LaunchBulletType.java
index 2884dbc2..b3871a8e 100644
--- a/src/omaloon/entities/bullet/LaunchBulletType.java
+++ b/src/omaloon/entities/bullet/LaunchBulletType.java
@@ -47,8 +47,8 @@ public class LaunchBulletType extends BasicBulletType{
public float pitch = 1f;
public static final FrameBuffer
- drawBuffer = new FrameBuffer(),
- shadowBuffer = new FrameBuffer();
+ drawBuffer = new FrameBuffer(),
+ shadowBuffer = new FrameBuffer();
public static final Seq shadowRuns = new Seq<>();
public static boolean shouldResize;
@@ -90,12 +90,12 @@ public LaunchBulletType(float speed, float damage){
public void createFrags(Bullet b, float x, float y){
if(fragBullet != null){
Angles.randLenVectors(b.id, fragBullets, fragRadius, (ox, oy) -> fragBullet.create(
- b,
- Mathf.lerp(b.originX, x + ox, fragAt),
- Mathf.lerp(b.originY, y + oy, fragAt),
- Angles.angle(b.originX, b.originY, x + ox, y + oy),
- 1f,
- b.lifetime / lifetime
+ b,
+ Mathf.lerp(b.originX, x + ox, fragAt),
+ Mathf.lerp(b.originY, y + oy, fragAt),
+ Angles.angle(b.originX, b.originY, x + ox, y + oy),
+ 1f,
+ b.lifetime / lifetime
));
}
}
@@ -111,28 +111,28 @@ public void draw(Bullet b){
float currentPitch = b.fin() / fadeAt;
mat.set(quat.set(
- Angles.trnsx(b.rotation(), shrinkInterp.apply(currentPitch) * pitch),
- Angles.trnsy(b.rotation(), shrinkInterp.apply(currentPitch) * pitch),
- 1f, 0f
+ Angles.trnsx(b.rotation(), shrinkInterp.apply(currentPitch) * pitch),
+ Angles.trnsy(b.rotation(), shrinkInterp.apply(currentPitch) * pitch),
+ 1f, 0f
));
drawBuffer.begin(Color.clear);
for(int i = 4; i >= 0; i--){
if(backRegion.found()){
Draw3d.rect(
- mat, backRegion,
- b.x - width / 2f + Angles.trnsx(b.rotation(), currentPitch / 4f * i),
- b.y - height / 2f + Angles.trnsy(b.rotation(), currentPitch / 4f * i),
- width, height, b.rotation()
+ mat, backRegion,
+ b.x - width / 2f + Angles.trnsx(b.rotation(), currentPitch / 4f * i),
+ b.y - height / 2f + Angles.trnsy(b.rotation(), currentPitch / 4f * i),
+ width, height, b.rotation()
);
}
}
for(int i = 4; i >= 0; i--){
Draw3d.rect(
- mat, frontRegion,
- b.x - width / 2f + Angles.trnsx(b.rotation(), currentPitch / 4f * i),
- b.y - height / 2f + Angles.trnsy(b.rotation(), currentPitch / 4f * i),
- width, height, b.rotation() + 90
+ mat, frontRegion,
+ b.x - width / 2f + Angles.trnsx(b.rotation(), currentPitch / 4f * i),
+ b.y - height / 2f + Angles.trnsy(b.rotation(), currentPitch / 4f * i),
+ width, height, b.rotation() + 90
);
}
drawBuffer.end();
@@ -148,9 +148,9 @@ public void draw(Bullet b){
public void drawShadow(Bullet b){
if(b.fin() <= 0.5f){
shadowRuns.add(() -> Fill.circle(
- Mathf.lerp(b.x, b.originX, shadowInterp.apply(Mathf.clamp(b.fin() * 2f))),
- Mathf.lerp(b.y, b.originY, shadowInterp.apply(Mathf.clamp(b.fin() * 2f))),
- hitSize
+ Mathf.lerp(b.x, b.originX, shadowInterp.apply(Mathf.clamp(b.fin() * 2f))),
+ Mathf.lerp(b.y, b.originY, shadowInterp.apply(Mathf.clamp(b.fin() * 2f))),
+ hitSize
));
}else{
if(fragBullet != null){
@@ -158,9 +158,9 @@ public void drawShadow(Bullet b){
float endX = b.x + Tmp.v1.set(b.vel).scl(b.lifetime - b.time).x + x;
float endY = b.y + Tmp.v1.set(b.vel).scl(b.lifetime - b.time).y + y;
Fill.circle(
- Mathf.lerp(b.originX, endX, fragInterp.apply(Mathf.clamp(b.fin() * 2f - 1f)) * fragAt),
- Mathf.lerp(b.originY, endY, fragInterp.apply(Mathf.clamp(b.fin() * 2f - 1f)) * fragAt),
- fragBullet.hitSize
+ Mathf.lerp(b.originX, endX, fragInterp.apply(Mathf.clamp(b.fin() * 2f - 1f)) * fragAt),
+ Mathf.lerp(b.originY, endY, fragInterp.apply(Mathf.clamp(b.fin() * 2f - 1f)) * fragAt),
+ fragBullet.hitSize
);
}));
}
diff --git a/src/omaloon/entities/comp/ChainedComp.java b/src/omaloon/entities/comp/ChainedComp.java
index 4ff649eb..5d885c15 100644
--- a/src/omaloon/entities/comp/ChainedComp.java
+++ b/src/omaloon/entities/comp/ChainedComp.java
@@ -15,340 +15,356 @@
import omaloon.type.*;
import omaloon.utils.*;
+/**
+ * @author Liz
+ */
@SuppressWarnings({"unused", "unchecked", "RedundantVariable", "UnnecessaryReturnStatement"})
@EntityComponent
-abstract class ChainedComp implements Unitc{
- transient Unit head, tail, parent, child;
-
- transient float growTime = 0, chainTime = 0;
-
- // internal values that i wish i had the entityanno knowledge to not make it generate io
- private int parentID = -1, childID = -1;
- boolean grown;
-
- @Import
- UnitType type;
- @Import
- UnitController controller;
- @Import
- Team team;
- @Import
- float x, y, rotation;
- @Import
- WeaponMount[] mounts;
-
- /**
- * Add first segments if this unit is not grown.
- */
- @Override
- public void add(){
- head = tail = self();
-
- if(!grown){
- for(int i = 0; i < checkType(type).minSegments - 1; i++){
- grow();
- }
- // i need this because again, i don't know how to not genio.
- grown = true;
- }
+abstract class ChainedComp implements Unitc {
+ transient Unit head, tail, parent, child;
+
+ transient float growTime = 0, chainTime = 0;
+
+ // internal values that i wish i had the entityanno knowledge to not make it generate io
+ private int parentID = -1, childID = -1;
+ boolean grown;
+
+ @Import UnitType type;
+ @Import UnitController controller;
+ @Import Team team;
+ @Import float x, y, rotation;
+ @Import WeaponMount[] mounts;
+
+ /**
+ * Add first segments if this unit is not grown.
+ */
+ @Override
+ public void add() {
+ head = tail = self();
+
+ if(!grown) {
+ for(int i = 0; i < checkType(type).minSegments - 1; i++) grow();
+ // i need this because again, i don't know how to not genio.
+ grown = true;
}
-
- @Override
- public void aim(float x, float y){
- if(isHead()){
- final float finalX = x, finalY = y;
- consBackwards(u -> {
- if(!u.isHead()) u.aim(finalX, finalY);
- });
- }
+ }
+
+ @Override
+ public void aim(float x, float y) {
+ if(isHead()) {
+ final float finalX = x, finalY = y;
+ consBackwards(u -> {
+ if(!u.isHead()) u.aim(finalX, finalY);
+ });
}
+ }
+
+ /**
+ * Multiplies the unit cap to fit the amount of biggest sized chains. If it overflows, then just pick the regular unit cap.
+ */
+ @Override
+ @Replace
+ public int cap() {
+ MillipedeUnitType uType = checkType(type);
+ return Math.max(Units.getCap(team) * Math.max(uType.segmentLength, uType.maxSegments), Units.getCap(team));
+ }
+
+ /**
+ * Wrong cast errors are way too long. So long in fact that the crash box is too small for it.
+ */
+ public MillipedeUnitType checkType(UnitType def) {
+ if(!(def instanceof MillipedeUnitType)) throw new RuntimeException("Unit's type must be MillipedeUnitType");
+ return (MillipedeUnitType) def;
+ }
+
+ /**
+ * Connects this centipede with another one.
+ *
+ * If this unit is not the chain unit's tail, it'll call this method on the tail unit.
+ *
+ *
+ * If Parameter "to" is not the chain unit's head, "to" will become its head() method.
+ *
+ */
+ public void connect(Unit to) {
+ Chainedc cast = ((Chainedc) to).head().as();
+ if(isTail()) {
+ cast.parent(self());
+ child = to;
+
+ ((Chainedc) head).consBackwards(u -> {
+ u.head(head);
+ u.tail(cast.tail());
+ });
- /**
- * Multiplies the unit cap to fit the amount of biggest sized chains. If it overflows, then just pick the regular unit cap.
- */
- @Override
- @Replace
- public int cap(){
- MillipedeUnitType uType = checkType(type);
- return Math.max(Units.getCap(team) * Math.max(uType.segmentLength, uType.maxSegments), Units.getCap(team));
+ ((Chainedc) head).consBackwards(u -> {
+ u.setupWeapons(u.type);
+ if(!(u.controller() instanceof Player)) u.resetController();
+ });
+ } else ((Chainedc) tail).connect(to);
}
- /**
- * Wrong cast errors are way too long. So long in fact that the crash box is too small for it.
- */
- public MillipedeUnitType checkType(UnitType def){
- if(!(def instanceof MillipedeUnitType)) throw new RuntimeException("Unit's type must be MillipedeUnitType");
- return (MillipedeUnitType)def;
+ /**
+ * @param cons will run through this unit and it's children recursively.
+ */
+ public void consBackwards(Cons cons) {
+ T current = as();
+ cons.get(current);
+ while(current.child() != null) {
+ cons.get(current.child().as());
+ current = current.child().as();
}
-
- /**
- * Connects this centipede with another one.
- *
- * If this unit is not the chain unit's tail, it'll call this method on the tail unit.
- *
- *
- * If Parameter "to" is not the chain unit's head, "to" will become its head() method.
- *
- */
- public void connect(Unit to){
- Chainedc cast = ((Chainedc)to).head().as();
- if(isTail()){
- cast.parent(self());
- child = to;
-
- ((Chainedc)head).consBackwards(u -> {
- u.head(head);
- u.tail(cast.tail());
- });
-
- ((Chainedc)head).consBackwards(u -> {
- u.setupWeapons(u.type);
- if(!(u.controller() instanceof Player)) u.resetController();
- });
- }else ((Chainedc)tail).connect(to);
+ }
+
+ /**
+ * @param cons will run through this unit and it's parents recursively.
+ */
+ public void consForward(Cons cons) {
+ T current = as();
+ cons.get(current);
+ while(current.parent() != null) {
+ cons.get(current.parent().as());
+ current = current.parent().as();
}
-
- /**
- * @param cons will run through this unit and it's children recursively.
- */
- public void consBackwards(Cons cons){
- T current = as();
- cons.get(current);
- while(current.child() != null){
- cons.get(current.child().as());
- current = current.child().as();
- }
+ }
+
+ /**
+ * Force a specific controller on certain parts of the chain.
+ */
+ @MethodPriority(-1)
+ @Override
+ @BreakAll
+ public void controller(UnitController next) {
+ if(!isHead()) {
+ if(next instanceof Player) {
+ head.controller(next);
+ return;
+ }
+
+ controller = new AIController();
+ if(controller.unit() != self()) controller.unit(self());
+ return;
}
-
- /**
- * @param cons will run through this unit and it's parents recursively.
- */
- public void consForward(Cons cons){
- T current = as();
- cons.get(current);
- while(current.parent() != null){
- cons.get(current.parent().as());
- current = current.parent().as();
- }
+ }
+
+ @Override
+ public void controlWeapons(boolean rotate, boolean shoot) {
+ if(isHead()) consBackwards(unit -> {
+ if(!unit.isHead()) unit.controlWeapons(rotate, shoot);
+ });
+ }
+
+ /**
+ * Counts the amount of children from this unit recursively.
+ */
+ public int countBackwards() {
+ int out = 0;
+
+ T current = as();
+ while(current.child() != null) {
+ out++;
+ current = current.child().as();
}
- /**
- * Force a specific controller on certain parts of the chain.
- */
- @MethodPriority(-1)
- @Override
- @BreakAll
- public void controller(UnitController next){
- if(!isHead()){
- if(next instanceof Player){
- head.controller(next);
- return;
- }
-
- controller = new AIController();
- if(controller.unit() != self()) controller.unit(self());
- return;
- }
- }
-
- @Override
- public void controlWeapons(boolean rotate, boolean shoot){
- if(isHead()) consBackwards(unit -> {
- if(!unit.isHead()) unit.controlWeapons(rotate, shoot);
- });
- }
-
- /**
- * Counts the amount of children from this unit recursively.
- */
- public int countBackwards(){
- int out = 0;
+ return out;
+ }
- T current = as();
- while(current.child() != null){
- out++;
- current = current.child().as();
- }
+ /**
+ * Counts the amount of parents from this unit recursively.
+ */
+ public int countForward() {
+ int out = 0;
- return out;
+ T current = as();
+ while(current.parent() != null) {
+ out++;
+ current = current.parent().as();
}
- /**
- * Counts the amount of parents from this unit recursively.
- */
- public int countForward(){
- int out = 0;
-
- T current = as();
- while(current.parent() != null){
- out++;
- current = current.parent().as();
- }
-
- return out;
+ return out;
+ }
+
+ /**
+ * Adds an extra segment to the chain.
+ */
+ public void grow() {
+ if(!isTail()) {
+ ((Chainedc) tail).grow();
+ } else {
+ MillipedeUnitType uType = checkType(type);
+
+ T tail = ((T) type.create(team));
+ tail.grown(true);
+ tail.set(
+ x + Angles.trnsx(rotation + 90, 0, uType.segmentOffset),
+ y + Angles.trnsy(rotation + 90, 0, uType.segmentOffset)
+ );
+ tail.rotation = rotation;
+ tail.add();
+ connect(tail);
}
-
- /**
- * Adds an extra segment to the chain.
- */
- public void grow(){
- if(!isTail()){
- ((Chainedc)tail).grow();
- }else{
- MillipedeUnitType uType = checkType(type);
-
- T tail = ((T)type.create(team));
- tail.grown(true);
- tail.set(
- x + Angles.trnsx(rotation + 90, 0, uType.segmentOffset),
- y + Angles.trnsy(rotation + 90, 0, uType.segmentOffset)
- );
- tail.rotation = rotation;
- tail.add();
- connect(tail);
- }
- }
-
- /**
- * Self explanatory, they'll return true if it is the head, if it isn't the head nor the tail, or if it is tje tail. Respectively.
- */
- public boolean isHead(){
- return head == self();
- }
-
- public boolean isSegment(){
- return head != self() && tail != self();
+ }
+
+ /**
+ * Self explanatory, they'll return true if it is the head, if it isn't the head nor the tail, or if it is tje tail. Respectively.
+ */
+ public boolean isHead() {
+ return head == self();
+ }
+ public boolean isSegment() {
+ return head != self() && tail != self();
+ }
+ public boolean isTail() {
+ return tail == self();
+ }
+
+ /**
+ * It moves whenever the head moves.
+ */
+ @Override
+ @Replace
+ public boolean moving() {
+ return head.vel.len() > 0.01f;
+ }
+
+ /**
+ * Read parent and child id.
+ */
+ @Override
+ public void read(Reads read) {
+ parentID = read.i();
+ childID = read.i();
+ }
+
+ /**
+ * Split the chain or kill the whole chain if an unit is removed.
+ */
+ @Override
+ public void remove() {
+ if(checkType(type).splittable) {
+ if(parent != null) {
+ ((Chainedc) parent).child(null);
+ ((Chainedc) parent).consForward(u -> {
+ u.tail(parent);
+ u.setupWeapons(u.type);
+ });
+ }
+ if(child != null) {
+ ((Chainedc) child).parent(null);
+ ((Chainedc) child).consBackwards(u -> {
+ u.head(child);
+ u.setupWeapons(u.type);
+ });
+ }
+ if(parent != null && child != null) checkType(type).splitSound.at(x, y);
+ } else {
+ if(parent != null) ((Chainedc) parent).consForward(Unitc::kill);
+ if(child != null) ((Chainedc) child).consBackwards(Unitc::kill);
}
-
- public boolean isTail(){
- return tail == self();
+ }
+
+ /**
+ * Updates the mounts to be based on the unit's position in the chain. Called when the chain connects.
+ */
+ @Override
+ @Replace
+ public void setupWeapons(UnitType def) {
+ MillipedeUnitType uType = checkType(def);
+ Seq weapons = uType.chainWeapons.get(uType.weaponsIndex.get(self()));
+ mounts = new WeaponMount[weapons.size];
+ for(int i = 0; i < mounts.length; i++) {
+ mounts[i] = weapons.get(i).mountType.get(weapons.get(i));
}
-
- /**
- * Read parent and child id.
- */
- @Override
- public void read(Reads read){
- parentID = read.i();
- childID = read.i();
+ }
+
+ /**
+ * Add proper solidity for everything because i can't do it better than this.
+ */
+ @Override
+ @Replace(1)
+ public EntityCollisions.SolidPred solidity() {
+ if (!isHead()) return null;
+ if (self() instanceof Mechc) return EntityCollisions::solid;
+ if (self() instanceof Legsc) return type.allowLegStep ? EntityCollisions::legsSolid : EntityCollisions::solid;
+ if (self() instanceof WaterMovec) return EntityCollisions::waterSolid;
+ return null;
+ }
+
+ /**
+ * Connect the units together after read.
+ */
+ @Override
+ public void update() {
+ if(parentID != -1) {
+ if(parent == null) ((Chainedc)Groups.unit.getByID(parentID)).connect(self());
+ parentID = -1;
}
-
- /**
- * Split the chain or kill the whole chain if an unit is removed.
- */
- @Override
- public void remove(){
- if(checkType(type).splittable){
- if(parent != null){
- ((Chainedc)parent).child(null);
- ((Chainedc)parent).consForward(u -> {
- u.tail(parent);
- u.setupWeapons(u.type);
- });
- }
- if(child != null){
- ((Chainedc)child).parent(null);
- ((Chainedc)child).consBackwards(u -> {
- u.head(child);
- u.setupWeapons(u.type);
- });
- }
- if(parent != null && child != null) checkType(type).splitSound.at(x, y);
- }else{
- if(parent != null) ((Chainedc)parent).consForward(Unitc::kill);
- if(child != null) ((Chainedc)child).consBackwards(Unitc::kill);
- }
+ if(childID != -1) {
+ if(child == null) connect(Groups.unit.getByID(childID));
+ childID = -1;
}
- /**
- * Updates the mounts to be based on the unit's position in the chain. Called when the chain connects.
- */
- @Override
- @Replace
- public void setupWeapons(UnitType def){
- MillipedeUnitType uType = checkType(def);
- Seq weapons = uType.chainWeapons.get(uType.weaponsIndex.get(self()));
- mounts = new WeaponMount[weapons.size];
- for(int i = 0; i < mounts.length; i++){
- mounts[i] = weapons.get(i).mountType.get(weapons.get(i));
- }
- }
+ if(isTail()) {
+ MillipedeUnitType uType = checkType(type);
- /**
- * Connect the units together after read.
- */
- @Override
- public void update(){
- if(parentID != -1){
- if(parent == null) ((Chainedc)Groups.unit.getByID(parentID)).connect(self());
- parentID = -1;
+ if(countForward() + 1 < uType.segmentLength && uType.regenTime > 0) {
+ growTime += Time.delta;
+ if(growTime > uType.regenTime) {
+ grow();
+ uType.chainSound.at(x, y);
+ growTime %= uType.regenTime;
}
- if(childID != -1){
- if(child == null) connect(Groups.unit.getByID(childID));
- childID = -1;
- }
-
- if(isTail()){
- MillipedeUnitType uType = checkType(type);
-
- if(countForward() + 1 < uType.segmentLength && uType.regenTime > 0){
- growTime += Time.delta;
- if(growTime > uType.regenTime){
- grow();
- uType.chainSound.at(x, y);
- growTime %= uType.regenTime;
- }
- }
-
- Tmp.r1.setCentered(
- x + Angles.trnsx(rotation + 90, 0, uType.segmentOffset),
- y + Angles.trnsy(rotation + 90, 0, uType.segmentOffset),
- uType.segmentOffset
- );
- Units.nearby(Tmp.r1, u -> {
- if(u instanceof Chainedc chain && chain.isHead() && u != head && countForward() + chain.countBackwards() + 2 <= uType.maxSegments && uType.chainTime > 0){
- chainTime += Time.delta;
- if(chainTime > uType.chainTime){
- Log.info("a");
- connect(u);
- uType.chainSound.at(x, y);
- chainTime %= uType.chainTime;
- }
- }
- });
-
- if(countForward() + 1 < uType.minSegments){
- consBackwards(Unitc::kill);
- }
+ }
+
+ Tmp.r1.setCentered(
+ x + Angles.trnsx(rotation + 90, 0, uType.segmentOffset),
+ y + Angles.trnsy(rotation + 90, 0, uType.segmentOffset),
+ uType.segmentOffset
+ );
+ Units.nearby(Tmp.r1, u -> {
+ if(u instanceof Chainedc chain && chain.isHead() && u != head && countForward() + chain.countBackwards() + 2 <= uType.maxSegments && uType.chainTime > 0) {
+ chainTime += Time.delta;
+ if(chainTime > uType.chainTime) {
+ Log.info("a");
+ connect(u);
+ uType.chainSound.at(x, y);
+ chainTime %= uType.chainTime;
+ }
}
- }
+ });
- /**
- * Updates the position and rotation of each segment in the chain.
- */
- @Insert("update()")
- public void updateChain(){
- MillipedeUnitType uType = checkType(type);
- if(isHead()) consBackwards(c -> {
- if(c.parent() != null){
- Tmp.v1.set(c).sub(c.parent()).nor().scl(uType.segmentOffset);
- float angleDst = OlUtils.angleDistSigned(Tmp.v1.angle(), c.parent().rotation + 180);
- if(Math.abs(angleDst) > uType.angleLimit){
- Tmp.v1.rotate(-Tmp.v1.angle() + c.parent().rotation + 180 + (angleDst > 0 ? uType.angleLimit : -uType.angleLimit));
- }
- Tmp.v1.add(c.parent());
- c.set(Tmp.v1.x, Tmp.v1.y);
- c.rotation = c.angleTo(c.parent());
- }
- });
- }
-
- /**
- * Save parent and child id to be read later.
- */
- @Override
- public void write(Writes write){
- write.i(parent == null ? -1 : parent.id);
- write.i(child == null ? -1 : child.id);
+ if(countForward() + 1 < uType.minSegments) {
+ consBackwards(Unitc::kill);
+ }
}
+ }
+
+ /**
+ * Updates the position and rotation of each segment in the chain.
+ */
+ @Insert("update()")
+ public void updateChain() {
+ MillipedeUnitType uType = checkType(type);
+ if(isHead()) consBackwards(c -> {
+ if(c.parent() != null){
+ Tmp.v1.set(c).sub(c.parent()).nor().scl(uType.segmentOffset);
+ float angleDst = OlUtils.angleDistSigned(Tmp.v1.angle(), c.parent().rotation + 180);
+ if(Math.abs(angleDst) > uType.angleLimit) {
+ Tmp.v1.rotate(-Tmp.v1.angle() + c.parent().rotation + 180 + (angleDst > 0 ? uType.angleLimit : -uType.angleLimit));
+ }
+ Tmp.v1.add(c.parent());
+ c.set(Tmp.v1.x, Tmp.v1.y);
+ c.rotation = c.angleTo(c.parent());
+ }
+ });
+ }
+
+ /**
+ * Save parent and child id to be read later.
+ */
+ @Override
+ public void write(Writes write) {
+ write.i(parent == null ? -1 : parent.id);
+ write.i(child == null ? -1 : child.id);
+ }
}
diff --git a/src/omaloon/entities/comp/CoreComp.java b/src/omaloon/entities/comp/CoreComp.java
index 7762910b..c109c876 100644
--- a/src/omaloon/entities/comp/CoreComp.java
+++ b/src/omaloon/entities/comp/CoreComp.java
@@ -29,9 +29,9 @@ public void updateBuildLogic(){
Queue plans = plans();
for(BuildPlan req : plans){
boolean valid =
- ((req.tile() != null && req.tile().build instanceof ConstructBlock.ConstructBuild cons && cons.current == req.block) ||
- (req.breaking ? Build.validBreak(team(), req.x, req.y) :
- Build.validPlace(req.block, team(), req.x, req.y, req.rotation)));
+ ((req.tile() != null && req.tile().build instanceof ConstructBlock.ConstructBuild cons && cons.current == req.block) ||
+ (req.breaking ? Build.validBreak(team(), req.x, req.y) :
+ Build.validPlace(req.block, team(), req.x, req.y, req.rotation)));
if(!valid) plans.remove(req);
}
}
diff --git a/src/omaloon/entities/comp/FloatMechComp.java b/src/omaloon/entities/comp/FloatMechComp.java
index ccf1ebb7..58f1ffee 100644
--- a/src/omaloon/entities/comp/FloatMechComp.java
+++ b/src/omaloon/entities/comp/FloatMechComp.java
@@ -49,7 +49,7 @@ public void update(){
float width = hitSize / 2f * side, length = type.mechStride * 1.35f;
float cx = x + Angles.trnsx(baseRotation, length, width),
- cy = y + Angles.trnsy(baseRotation, length, width);
+ cy = y + Angles.trnsy(baseRotation, length, width);
if(type.stepShake > 0){
Effect.shake(type.stepShake, type.stepShake, cx, cy);
diff --git a/src/omaloon/entities/part/ConstructPart.java b/src/omaloon/entities/part/ConstructPart.java
index 97a54014..55a962f5 100644
--- a/src/omaloon/entities/part/ConstructPart.java
+++ b/src/omaloon/entities/part/ConstructPart.java
@@ -45,10 +45,10 @@ public ConstructPart(String suffix){
@Override
public void draw(PartParams params){
float z = Draw.z(),
- dx = params.x + Angles.trnsx(params.rotation - 90f, x, y),
- dy = params.y + Angles.trnsy(params.rotation - 90f, x, y),
- dr = params.rotation + rot - 90,
- prog = progress.getClamp(params);
+ dx = params.x + Angles.trnsx(params.rotation - 90f, x, y),
+ dy = params.y + Angles.trnsy(params.rotation - 90f, x, y),
+ dr = params.rotation + rot - 90,
+ prog = progress.getClamp(params);
Draw.z(z + outlineLayerOffset);
Draw.rect(outlineRegion, dx, dy, dr);
Draw.z(z + layerOffset);
diff --git a/src/omaloon/graphics/OlGraphics.java b/src/omaloon/graphics/OlGraphics.java
index 8efa54b1..3657c249 100644
--- a/src/omaloon/graphics/OlGraphics.java
+++ b/src/omaloon/graphics/OlGraphics.java
@@ -38,28 +38,28 @@ public static TextureRegion[] getRegions(TextureRegion region, int w, int h, int
}
static int[][] joinschkdirs = {
- {-1, 1}, {0, 1}, {1, 1},
- {-1, 0},/*{X}*/{1, 0},
- {-1, -1}, {0, -1}, {1, -1},
+ {-1, 1}, {0, 1}, {1, 1},
+ {-1, 0},/*{X}*/{1, 0},
+ {-1, -1}, {0, -1}, {1, -1},
};
static int[] joinsMap = {
- 39, 39, 27, 27, 39, 39, 27, 27, 38, 38, 17, 26, 38, 38, 17, 26, 36,
- 36, 16, 16, 36, 36, 24, 24, 37, 37, 41, 21, 37, 37, 43, 25, 39,
- 39, 27, 27, 39, 39, 27, 27, 38, 38, 17, 26, 38, 38, 17, 26, 36,
- 36, 16, 16, 36, 36, 24, 24, 37, 37, 41, 21, 37, 37, 43, 25, 3,
- 3, 15, 15, 3, 3, 15, 15, 5, 5, 29, 31, 5, 5, 29, 31, 4,
- 4, 40, 40, 4, 4, 20, 20, 28, 28, 10, 11, 28, 28, 23, 32, 3,
- 3, 15, 15, 3, 3, 15, 15, 2, 2, 9, 14, 2, 2, 9, 14, 4,
- 4, 40, 40, 4, 4, 20, 20, 30, 30, 47, 44, 30, 30, 22, 6, 39,
- 39, 27, 27, 39, 39, 27, 27, 38, 38, 17, 26, 38, 38, 17, 26, 36,
- 36, 16, 16, 36, 36, 24, 24, 37, 37, 41, 21, 37, 37, 43, 25, 39,
- 39, 27, 27, 39, 39, 27, 27, 38, 38, 17, 26, 38, 38, 17, 26, 36,
- 36, 16, 16, 36, 36, 24, 24, 37, 37, 41, 21, 37, 37, 43, 25, 3,
- 3, 15, 15, 3, 3, 15, 15, 5, 5, 29, 31, 5, 5, 29, 31, 0,
- 0, 42, 42, 0, 0, 12, 12, 8, 8, 35, 34, 8, 8, 33, 7, 3,
- 3, 15, 15, 3, 3, 15, 15, 2, 2, 9, 14, 2, 2, 9, 14, 0,
- 0, 42, 42, 0, 0, 12, 12, 1, 1, 45, 18, 1, 1, 19, 13
+ 39, 39, 27, 27, 39, 39, 27, 27, 38, 38, 17, 26, 38, 38, 17, 26, 36,
+ 36, 16, 16, 36, 36, 24, 24, 37, 37, 41, 21, 37, 37, 43, 25, 39,
+ 39, 27, 27, 39, 39, 27, 27, 38, 38, 17, 26, 38, 38, 17, 26, 36,
+ 36, 16, 16, 36, 36, 24, 24, 37, 37, 41, 21, 37, 37, 43, 25, 3,
+ 3, 15, 15, 3, 3, 15, 15, 5, 5, 29, 31, 5, 5, 29, 31, 4,
+ 4, 40, 40, 4, 4, 20, 20, 28, 28, 10, 11, 28, 28, 23, 32, 3,
+ 3, 15, 15, 3, 3, 15, 15, 2, 2, 9, 14, 2, 2, 9, 14, 4,
+ 4, 40, 40, 4, 4, 20, 20, 30, 30, 47, 44, 30, 30, 22, 6, 39,
+ 39, 27, 27, 39, 39, 27, 27, 38, 38, 17, 26, 38, 38, 17, 26, 36,
+ 36, 16, 16, 36, 36, 24, 24, 37, 37, 41, 21, 37, 37, 43, 25, 39,
+ 39, 27, 27, 39, 39, 27, 27, 38, 38, 17, 26, 38, 38, 17, 26, 36,
+ 36, 16, 16, 36, 36, 24, 24, 37, 37, 41, 21, 37, 37, 43, 25, 3,
+ 3, 15, 15, 3, 3, 15, 15, 5, 5, 29, 31, 5, 5, 29, 31, 0,
+ 0, 42, 42, 0, 0, 12, 12, 8, 8, 35, 34, 8, 8, 33, 7, 3,
+ 3, 15, 15, 3, 3, 15, 15, 2, 2, 9, 14, 2, 2, 9, 14, 0,
+ 0, 42, 42, 0, 0, 12, 12, 1, 1, 45, 18, 1, 1, 19, 13
};
public static int getMaskIndex(T[][] map, int x, int y, Boolf canConnect){
@@ -93,12 +93,12 @@ public static void bubbles(int seed, float x, float y, int bubblesAmount, float
for(int i = 0; i < bubblesAmount; i++){
float
- angle = rand.random(360f),
- fin = (rand.random(0.8f) * (Time.time / baseLife)) % rand.random(0.1f, 0.6f),
- len = rand.random(baseSize / 2f, baseSize) / fin,
+ angle = rand.random(360f),
+ fin = (rand.random(0.8f) * (Time.time / baseLife)) % rand.random(0.1f, 0.6f),
+ len = rand.random(baseSize / 2f, baseSize) / fin,
- trnsx = x + Angles.trnsx(angle, len, rand.random(baseSize / 4f, baseSize / 4f)),
- trnsy = y + Angles.trnsy(angle, len, rand.random(baseSize / 4f, baseSize / 4f));
+ trnsx = x + Angles.trnsx(angle, len, rand.random(baseSize / 4f, baseSize / 4f)),
+ trnsy = y + Angles.trnsy(angle, len, rand.random(baseSize / 4f, baseSize / 4f));
Fill.poly(trnsx, trnsy, 18, Interp.sine.apply(fin * 3.5f) * bubblesSize);
}
diff --git a/src/omaloon/graphics/OlShaders.java b/src/omaloon/graphics/OlShaders.java
index 440f3c93..31df785d 100644
--- a/src/omaloon/graphics/OlShaders.java
+++ b/src/omaloon/graphics/OlShaders.java
@@ -95,8 +95,8 @@ public static class OlLoadShader extends Shader{
public OlLoadShader(String fragment, String vertex){
super(
- file(vertex + ".vert"),
- file(fragment + ".frag")
+ file(vertex + ".vert"),
+ file(fragment + ".frag")
);
}
@@ -134,8 +134,8 @@ public void loadNoise(){
@Override
public void apply(){
setUniformf("u_campos",
- camera.position.x - camera.width / 2,
- camera.position.y - camera.height / 2
+ camera.position.x - camera.width / 2,
+ camera.position.y - camera.height / 2
);
setUniformf("u_ccampos", camera.position);
setUniformf("u_resolution", camera.width, camera.height);
diff --git a/src/omaloon/graphics/g3d/CircleMesh.java b/src/omaloon/graphics/g3d/CircleMesh.java
index 466da36f..ad4f82f2 100644
--- a/src/omaloon/graphics/g3d/CircleMesh.java
+++ b/src/omaloon/graphics/g3d/CircleMesh.java
@@ -11,6 +11,9 @@
import mindustry.type.*;
import omaloon.graphics.*;
+/**
+ * @author Zelaux
+ */
public class CircleMesh extends PlanetMesh{
public final Mesh mesh;
public TextureRegion region;
@@ -23,8 +26,6 @@ public CircleMesh(TextureRegion region, Planet planet, int sides, float radiusIn
MeshUtils.begin(sides * 6/*points amount*/ * (3/*pos*/ + 3/*normal*/ + 2/*texCords*/) * 2/*top and bottom normal*/);
- Tmp.v33.setZero();
-
class MeshPoint{
final Vec3 position;
final Vec2 textureCords;
@@ -36,47 +37,52 @@ public MeshPoint(Vec3 position, Vec2 textureCords){
}
MeshPoint[] meshPoints = {
- new MeshPoint(Tmp.v31.setZero(), Tmp.v1.set(0, 0)),
- new MeshPoint(Tmp.v33.setZero(), Tmp.v3.set(1, 0)),
- new MeshPoint(Tmp.v34.setZero(), Tmp.v4.set(1, 1)),
- new MeshPoint(Tmp.v32.setZero(), Tmp.v2.set(0, 1)),
+ new MeshPoint(Tmp.v31.setZero(), Tmp.v1.set(0, 0)),
+ new MeshPoint(Tmp.v33.setZero(), Tmp.v3.set(1, 0)),
+ new MeshPoint(Tmp.v34.setZero(), Tmp.v4.set(1, 1)),
+ new MeshPoint(Tmp.v32.setZero(), Tmp.v2.set(0, 1)),
};
int[] order = {0, 1, 2, 2, 3, 0};
- Vec3 plane = new Vec3()
- .set(1, 0, 0)
- .rotate(Vec3.X, 90)
- .rotate(Vec3.X, axis.angle(Vec3.X) + 1)
- .rotate(Vec3.Y, axis.angle(Vec3.Y) + 1)
- .rotate(Vec3.Z, axis.angle(Vec3.Z) + 1)
- .crs(axis);
+ Vec3 plane = new Vec3();
+ if(axis.y == 0){
+ plane.set(0, 1, 0);
+ }else{
+ float val = axis.dot(1, 0, 1);
+ float calcY = -val / axis.y;
+
+ float len = Mathf.sqrt(2 + calcY * calcY);
+ float invLen = 1 / len;
+
+ plane.set(invLen, calcY / len, invLen);
+ }
Vec3 inv = axis.cpy().unaryMinus();
+ float angleStep = 360f / sides;
for(int i = 0; i < sides; i++){
+ float angle = i * angleStep;
+ float nextAngle = angle + angleStep;
+
meshPoints[0].position
- .set(plane)
- .rotate(axis, i * 1f / sides * 360)
- .setLength2(1)
- .scl(radiusIn);
+ .set(plane)
+ .rotate(axis, angle)
+ .scl(radiusIn);
meshPoints[1].position
- .set(plane)
- .rotate(axis, i * 1f / sides * 360)
- .setLength2(1)
- .scl(radiusOut);
+ .set(plane)
+ .rotate(axis, angle)
+ .scl(radiusOut);
meshPoints[2].position
- .set(plane)
- .rotate(axis, (i + 1f) / sides * 360)
- .setLength2(1)
- .scl(radiusOut);
+ .set(plane)
+ .rotate(axis, nextAngle)
+ .scl(radiusOut);
meshPoints[3].position
- .set(plane)
- .rotate(axis, (i + 1f) / sides * 360)
- .setLength2(1)
- .scl(radiusIn);
+ .set(plane)
+ .rotate(axis, nextAngle)
+ .scl(radiusIn);
for(int j : order){
MeshPoint point = meshPoints[j];
@@ -91,6 +97,10 @@ public MeshPoint(Vec3 position, Vec2 textureCords){
mesh = MeshUtils.end();
}
+ private static Shader shader(){
+ return OlShaders.planetTextureShader;
+ }
+
@Override
public void render(PlanetParams params, Mat3D projection, Mat3D transform){
//don't waste performance rendering 0-alpha
@@ -119,12 +129,12 @@ public void render(PlanetParams params, Mat3D projection, Mat3D transform){
public void preRender(PlanetParams params){
OlShaders.planetTextureShader.planet = planet;
OlShaders.planetTextureShader.lightDir
- .set(planet.solarSystem.position)
- .sub(planet.position)
- .rotate(Vec3.Y, planet.getRotation())
- .nor();
+ .set(planet.solarSystem.position)
+ .sub(planet.position)
+ .rotate(Vec3.Y, planet.getRotation())
+ .nor();
OlShaders.planetTextureShader.ambientColor
- .set(planet.solarSystem.lightColor);
+ .set(planet.solarSystem.lightColor);
//TODO: better disappearing
OlShaders.planetTextureShader.alpha = params.planet == planet ? 1f - params.uiAlpha : 1f;
}
@@ -134,8 +144,4 @@ private void setPlanetInfo(String name, Planet planet){
Shader shader = shader();
shader.setUniformf(name, position.x, position.y, position.z, planet.radius);
}
-
- private static Shader shader(){
- return OlShaders.planetTextureShader;
- }
}
\ No newline at end of file
diff --git a/src/omaloon/graphics/g3d/MeshUtils.java b/src/omaloon/graphics/g3d/MeshUtils.java
index 7f995c3f..a60a5afe 100644
--- a/src/omaloon/graphics/g3d/MeshUtils.java
+++ b/src/omaloon/graphics/g3d/MeshUtils.java
@@ -5,19 +5,19 @@
public class MeshUtils{
static final Vec3
- v1 = new Vec3(),
- v2 = new Vec3(),
- v3 = new Vec3(),
- v4 = new Vec3();
+ v1 = new Vec3(),
+ v2 = new Vec3(),
+ v3 = new Vec3(),
+ v4 = new Vec3();
static final float[] floats = new float[8]; //3 + 3 + 2
static Mesh mesh;
static void begin(int count){
mesh = new Mesh(true, count, 0,
- VertexAttribute.position3,
- VertexAttribute.normal,
- VertexAttribute.texCoords
+ VertexAttribute.position3,
+ VertexAttribute.normal,
+ VertexAttribute.texCoords
);
mesh.getVerticesBuffer().limit(mesh.getMaxVertices());
@@ -28,8 +28,8 @@ static Mesh end(){
Mesh last = mesh;
last.getVerticesBuffer().limit(last
- .getVerticesBuffer()
- .position()
+ .getVerticesBuffer()
+ .position()
);
mesh = null;
@@ -38,9 +38,9 @@ static Mesh end(){
static Vec3 normal(Vec3 v1, Vec3 v2, Vec3 v3){
return v4.set(v2).sub(v1).crs(
- v3.x - v1.x,
- v3.y - v1.y,
- v3.z - v1.z
+ v3.x - v1.x,
+ v3.y - v1.y,
+ v3.z - v1.z
).nor();
}
diff --git a/src/omaloon/graphics/shaders/DepthAtmosphereShader.java b/src/omaloon/graphics/shaders/DepthAtmosphereShader.java
index 8c4c09dd..5370f4bf 100644
--- a/src/omaloon/graphics/shaders/DepthAtmosphereShader.java
+++ b/src/omaloon/graphics/shaders/DepthAtmosphereShader.java
@@ -7,7 +7,7 @@
import omaloon.type.*;
import static arc.Core.graphics;
-import static omaloon.graphics.OlShaders.file;
+import static omaloon.graphics.OlShaders.*;
/**
* An atmosphere shader that incorporates the planet shape in a form of depth texture. Better quality, but at the little
diff --git a/src/omaloon/graphics/shaders/DepthShader.java b/src/omaloon/graphics/shaders/DepthShader.java
index b6c25d80..13a2f324 100644
--- a/src/omaloon/graphics/shaders/DepthShader.java
+++ b/src/omaloon/graphics/shaders/DepthShader.java
@@ -3,7 +3,7 @@
import arc.graphics.g3d.*;
import arc.graphics.gl.*;
-import static omaloon.graphics.OlShaders.file;
+import static omaloon.graphics.OlShaders.*;
/**
* Specialized mesh shader to capture fragment depths.
diff --git a/src/omaloon/maps/planets/GlasmorePlanetGenerator.java b/src/omaloon/maps/planets/GlasmorePlanetGenerator.java
index 5c081faa..09899ef1 100644
--- a/src/omaloon/maps/planets/GlasmorePlanetGenerator.java
+++ b/src/omaloon/maps/planets/GlasmorePlanetGenerator.java
@@ -35,7 +35,8 @@ public float getHeight(Vec3 position){
public Color getColor(Vec3 position){
Color color = baseColor;
for(ColorPass c : colors){
- if(c.color(position, rawHeight(position)) != null) color = c.color(position, rawHeight(position));
+ Color calculated = c.color(position, rawHeight(position));
+ if(calculated != null) color = calculated;
}
return color;
}
diff --git a/src/omaloon/maps/planets/PurpuraPlanetGenerator.java b/src/omaloon/maps/planets/PurpuraPlanetGenerator.java
index e7ed4fa2..3a393e40 100644
--- a/src/omaloon/maps/planets/PurpuraPlanetGenerator.java
+++ b/src/omaloon/maps/planets/PurpuraPlanetGenerator.java
@@ -14,12 +14,12 @@ public class PurpuraPlanetGenerator extends PlanetGenerator{
public float rotationScl = 360;
public Color[] colors = new Color[]{
- valueOf("242424"),
- valueOf("413B42"),
- valueOf("7F777E"),
- valueOf("B2B2B2"),
- valueOf("807881"),
- valueOf("4F424D")
+ valueOf("242424"),
+ valueOf("413B42"),
+ valueOf("7F777E"),
+ valueOf("B2B2B2"),
+ valueOf("807881"),
+ valueOf("4F424D")
};
@Override
diff --git a/src/omaloon/math/OlMath.java b/src/omaloon/math/OlMath.java
index 728e9c6c..60703c9e 100644
--- a/src/omaloon/math/OlMath.java
+++ b/src/omaloon/math/OlMath.java
@@ -16,18 +16,18 @@ public class OlMath{
*/
public static float flowRate(float pressureStart, float pressureEnd, float capacityStart, float capacityEnd, float density, float viscosity){
return
- (
- capacityStart * (
- pressureStart * (
- capacityStart + capacityEnd
- ) - (
- pressureEnd * capacityEnd + pressureStart * capacityStart
- )
- )
- ) / (
- density * (
- capacityStart + capacityEnd
- ) * viscosity
- );
+ (
+ capacityStart * (
+ pressureStart * (
+ capacityStart + capacityEnd
+ ) - (
+ pressureEnd * capacityEnd + pressureStart * capacityStart
+ )
+ )
+ ) / (
+ density * (
+ capacityStart + capacityEnd
+ ) * viscosity
+ );
}
}
diff --git a/src/omaloon/struct/IntRef.java b/src/omaloon/struct/IntRef.java
index fbd0a5cc..0acc6328 100644
--- a/src/omaloon/struct/IntRef.java
+++ b/src/omaloon/struct/IntRef.java
@@ -2,10 +2,10 @@
public class IntRef{
public static final IntRef
- tmp1 = new IntRef(),
- tmp2 = new IntRef(),
- tmp3 = new IntRef(),
- tmp4 = new IntRef();
+ tmp1 = new IntRef(),
+ tmp2 = new IntRef(),
+ tmp3 = new IntRef(),
+ tmp4 = new IntRef();
public int value;
public IntRef zero(){
diff --git a/src/omaloon/type/GlassmoreUnitType.java b/src/omaloon/type/GlassmoreUnitType.java
index 645fa705..c52bce23 100644
--- a/src/omaloon/type/GlassmoreUnitType.java
+++ b/src/omaloon/type/GlassmoreUnitType.java
@@ -185,11 +185,11 @@ public void drawMech(FloatMechc floatMech){
Draw.mixcol(Tmp.c1.set(mechLegColor).lerp(Color.white, Mathf.clamp(unit.hitTime)), Math.max(Math.max(0, i * extension / mechStride), unit.hitTime));
Draw.rect(legRegion,
- unit.x + Angles.trnsx(floatMech.baseRotation(), extension * i - boostTrns, -boostTrns * i),
- unit.y + Angles.trnsy(floatMech.baseRotation(), extension * i - boostTrns, -boostTrns * i),
- legRegion.width * legRegion.scl() * i,
- legRegion.height * legRegion.scl() * (1 - Math.max(-sin * i, 0) * 0.5f),
- floatMech.baseRotation() - 90 + 35f * i * e);
+ unit.x + Angles.trnsx(floatMech.baseRotation(), extension * i - boostTrns, -boostTrns * i),
+ unit.y + Angles.trnsy(floatMech.baseRotation(), extension * i - boostTrns, -boostTrns * i),
+ legRegion.width * legRegion.scl() * i,
+ legRegion.height * legRegion.scl() * (1 - Math.max(-sin * i, 0) * 0.5f),
+ floatMech.baseRotation() - 90 + 35f * i * e);
}
Draw.mixcol(Color.white, unit.hitTime);
diff --git a/src/omaloon/type/MillipedeUnitType.java b/src/omaloon/type/MillipedeUnitType.java
index 53d19201..920b84c4 100644
--- a/src/omaloon/type/MillipedeUnitType.java
+++ b/src/omaloon/type/MillipedeUnitType.java
@@ -19,7 +19,7 @@
public class MillipedeUnitType extends GlassmoreUnitType{
public TextureRegion segmentRegion, tailRegion, segmentCellRegion, tailCellRegion,
- segmentOutline, tailOutline;
+ segmentOutline, tailOutline;
public Seq bottomWeapons = new Seq<>();
//Millipedes
/**
@@ -120,6 +120,7 @@ public void init(){
chainWeapons.each(w -> {
sortSegWeapons(w);
+ if(weapons.isEmpty() && !w.isEmpty()) weapons.add(w.first());
w.each(Weapon::init);
});
}
diff --git a/src/omaloon/type/OrnitopterUnitType.java b/src/omaloon/type/OrnitopterUnitType.java
index 1c938fc5..e41831a8 100644
--- a/src/omaloon/type/OrnitopterUnitType.java
+++ b/src/omaloon/type/OrnitopterUnitType.java
@@ -42,16 +42,16 @@ public void drawBlade(Unit unit){
Draw.z(z + blade.layerOffset);
Draw.alpha(blade.blurRegion.found() ? 1 - (copter.bladeMoveSpeedScl() / 0.8f) : 1);
Draw.rect(
- blade.bladeOutlineRegion, rx, ry,
- blade.bladeOutlineRegion.width * bladeScl * sign,
- blade.bladeOutlineRegion.height * bladeScl,
- unit.rotation - 90 + sign * Mathf.randomSeed(copter.drawSeed() + (seedOffset++), blade.bladeMaxMoveAngle, -blade.bladeMinMoveAngle)
+ blade.bladeOutlineRegion, rx, ry,
+ blade.bladeOutlineRegion.width * bladeScl * sign,
+ blade.bladeOutlineRegion.height * bladeScl,
+ unit.rotation - 90 + sign * Mathf.randomSeed(copter.drawSeed() + (seedOffset++), blade.bladeMaxMoveAngle, -blade.bladeMinMoveAngle)
);
Draw.mixcol(Color.white, unit.hitTime);
Draw.rect(blade.bladeRegion, rx, ry,
- blade.bladeRegion.width * bladeScl * sign,
- blade.bladeRegion.height * bladeScl,
- unit.rotation - 90 + sign * Mathf.randomSeed(copter.drawSeed() + (seedOffset++), blade.bladeMaxMoveAngle, -blade.bladeMinMoveAngle)
+ blade.bladeRegion.width * bladeScl * sign,
+ blade.bladeRegion.height * bladeScl,
+ unit.rotation - 90 + sign * Mathf.randomSeed(copter.drawSeed() + (seedOffset++), blade.bladeMaxMoveAngle, -blade.bladeMinMoveAngle)
);
Draw.reset();
}
@@ -60,10 +60,10 @@ public void drawBlade(Unit unit){
Draw.z(z + blade.layerOffset);
Draw.alpha(copter.bladeMoveSpeedScl() * blade.blurAlpha * (copter.dead() ? copter.bladeMoveSpeedScl() * 0.5f : 1));
Draw.rect(
- blade.blurRegion, rx, ry,
- blade.blurRegion.width * bladeScl * sign,
- blade.blurRegion.height * bladeScl,
- unit.rotation - 90 + sign * Mathf.randomSeed(copter.drawSeed() + (seedOffset++), blade.bladeMaxMoveAngle, -blade.bladeMinMoveAngle)
+ blade.blurRegion, rx, ry,
+ blade.blurRegion.width * bladeScl * sign,
+ blade.blurRegion.height * bladeScl,
+ unit.rotation - 90 + sign * Mathf.randomSeed(copter.drawSeed() + (seedOffset++), blade.bladeMaxMoveAngle, -blade.bladeMinMoveAngle)
);
Draw.reset();
}
@@ -72,10 +72,10 @@ public void drawBlade(Unit unit){
Draw.z(z + blade.layerOffset + 0.001f);
Draw.alpha(copter.bladeMoveSpeedScl() * blade.blurAlpha * (copter.dead() ? copter.bladeMoveSpeedScl() * 0.5f : 1));
Draw.rect(
- blade.shadeRegion, rx, ry,
- blade.shadeRegion.width * shadeScl * sign,
- blade.shadeRegion.height * shadeScl,
- unit.rotation - 90 + sign * Mathf.randomSeed(copter.drawSeed() + (seedOffset++), blade.bladeMaxMoveAngle, -blade.bladeMinMoveAngle)
+ blade.shadeRegion, rx, ry,
+ blade.shadeRegion.width * shadeScl * sign,
+ blade.shadeRegion.height * shadeScl,
+ unit.rotation - 90 + sign * Mathf.randomSeed(copter.drawSeed() + (seedOffset++), blade.bladeMaxMoveAngle, -blade.bladeMinMoveAngle)
);
Draw.mixcol(Color.white, unit.hitTime);
Draw.reset();
diff --git a/src/omaloon/type/liquid/CrystalLiquid.java b/src/omaloon/type/liquid/CrystalLiquid.java
index 34f90a79..23f0f896 100644
--- a/src/omaloon/type/liquid/CrystalLiquid.java
+++ b/src/omaloon/type/liquid/CrystalLiquid.java
@@ -12,8 +12,8 @@
public class CrystalLiquid extends Liquid{
public Color
- colorFrom = Color.white.cpy(),
- colorTo = Color.white.cpy();
+ colorFrom = Color.white.cpy(),
+ colorTo = Color.white.cpy();
public int cells = 18;
@@ -34,9 +34,9 @@ public void drawPuddle(Puddle puddle){
Draw.color(Tmp.c1.set(color).shiftValue(-0.05f));
Fill.poly(
- x + Mathf.sin(Time.time + id * 5, sscl, smag),
- y + Mathf.sin(Time.time + id * 3, sscl, smag),
- 6, f * 8.6f
+ x + Mathf.sin(Time.time + id * 5, sscl, smag),
+ y + Mathf.sin(Time.time + id * 3, sscl, smag),
+ 6, f * 8.6f
);
rand.setSeed(id);
@@ -48,10 +48,10 @@ public void drawPuddle(Puddle puddle){
Draw.color(colorFrom, colorTo, rand.random(1f));
Fill.poly(
- vx + Mathf.sin(Time.time + i * 53, sscl, smag),
- vy + Mathf.sin(Time.time + i * 3, sscl, smag),
- 6,
- f * 3.8f * rand.random(0.2f, 1f) * Mathf.absin(Time.time + ((i + id) % 60) * 54, 75f * rand.random(1f, 2f), 1f)
+ vx + Mathf.sin(Time.time + i * 53, sscl, smag),
+ vy + Mathf.sin(Time.time + i * 3, sscl, smag),
+ 6,
+ f * 3.8f * rand.random(0.2f, 1f) * Mathf.absin(Time.time + ((i + id) % 60) * 54, 75f * rand.random(1f, 2f), 1f)
);
}
diff --git a/src/omaloon/ui/OlBinding.java b/src/omaloon/ui/OlBinding.java
index 402bc73d..a46883b4 100644
--- a/src/omaloon/ui/OlBinding.java
+++ b/src/omaloon/ui/OlBinding.java
@@ -3,9 +3,6 @@
import arc.KeyBinds.*;
import arc.input.InputDevice.*;
import arc.input.*;
-import mindustry.input.*;
-
-import static arc.Core.*;
public enum OlBinding implements KeyBind{
shaped_env_placer(KeyCode.o, "omaloon-editor"),
@@ -29,17 +26,4 @@ public KeybindValue defaultValue(DeviceType type){
public String category(){
return category;
}
-
- public static void load(){
- KeyBind[] orign = Binding.values();
- KeyBind[] moded = values();
- KeyBind[] binds = new KeyBind[orign.length + moded.length];
-
- System.arraycopy(orign, 0, binds, 0, orign.length);
- System.arraycopy(moded, 0, binds, orign.length, moded.length);
-
- keybinds.setDefaults(binds);
- settings.load(); // update controls
-// ui.controls = new KeybindDialog();
- }
}
diff --git a/src/omaloon/ui/StartSplash.java b/src/omaloon/ui/StartSplash.java
index 39f2929f..6bd7829a 100644
--- a/src/omaloon/ui/StartSplash.java
+++ b/src/omaloon/ui/StartSplash.java
@@ -33,20 +33,20 @@ public static void show(){
cont.visible(() -> true);
omaloonIcon.actions(
- Actions.alpha(0f),
- Actions.delay(1f),
- Actions.fadeIn(1f, Interp.pow3Out),
- Actions.delay(1f),
- Actions.fadeOut(1f, Interp.pow3Out)
+ Actions.alpha(0f),
+ Actions.delay(1f),
+ Actions.fadeIn(1f, Interp.pow3Out),
+ Actions.delay(1f),
+ Actions.fadeOut(1f, Interp.pow3Out)
);
cont.actions(
- Actions.delay(6f, Actions.fadeOut(1f)),
- Actions.run(() -> {
- cont.visible(() -> false);
- cont.touchable(() -> Touchable.disabled);
- onComplete();
- })
+ Actions.delay(6f, Actions.fadeOut(1f)),
+ Actions.run(() -> {
+ cont.visible(() -> false);
+ cont.touchable(() -> Touchable.disabled);
+ onComplete();
+ })
);
}
diff --git a/src/omaloon/ui/dialogs/EventHints.java b/src/omaloon/ui/dialogs/EventHints.java
index 41f9b2bc..79c1296e 100644
--- a/src/omaloon/ui/dialogs/EventHints.java
+++ b/src/omaloon/ui/dialogs/EventHints.java
@@ -13,20 +13,20 @@
public enum EventHints implements Hint{
air(
- () -> false,
- () -> Vars.state.rules.defaultTeam.data().buildings.contains(b -> b instanceof HasPressure)
+ () -> false,
+ () -> Vars.state.rules.defaultTeam.data().buildings.contains(b -> b instanceof HasPressure)
),
drill(
- () -> false,
- () -> Vars.state.rules.defaultTeam.data().buildings.contains(b -> b instanceof PressureDrillBuild)
+ () -> false,
+ () -> Vars.state.rules.defaultTeam.data().buildings.contains(b -> b instanceof PressureDrillBuild)
),
pump_chaining(
- () -> false,
- () -> Vars.control.input.block instanceof PressureLiquidPump
+ () -> false,
+ () -> Vars.control.input.block instanceof PressureLiquidPump
),
shelter(
- () -> false,
- () -> Vars.state.rules.defaultTeam.data().buildings.contains(b -> b instanceof ShelterBuild)
+ () -> false,
+ () -> Vars.state.rules.defaultTeam.data().buildings.contains(b -> b instanceof ShelterBuild)
);
final Boolp complete;
@@ -40,7 +40,7 @@ public enum EventHints implements Hint{
public static void addHints(){
Vars.ui.hints.hints.add(Seq.with(EventHints.values()).removeAll(
- hint -> Core.settings.getBool(prefix + hint.name() + "-hint-done", false)
+ hint -> Core.settings.getBool(prefix + hint.name() + "-hint-done", false)
));
}
diff --git a/src/omaloon/ui/dialogs/OlDisclaimerDialog.java b/src/omaloon/ui/dialogs/OlDisclaimerDialog.java
index 7ac7a029..01c72364 100644
--- a/src/omaloon/ui/dialogs/OlDisclaimerDialog.java
+++ b/src/omaloon/ui/dialogs/OlDisclaimerDialog.java
@@ -32,11 +32,11 @@ public OlDisclaimerDialog(){
});
b.actions(
- Actions.alpha(0),
- Actions.moveBy(0f, 0f),
- Actions.delay(1.5f),
- Actions.fadeIn(1f),
- Actions.delay(1f)
+ Actions.alpha(0),
+ Actions.moveBy(0f, 0f),
+ Actions.delay(1.5f),
+ Actions.fadeIn(1f),
+ Actions.delay(1f)
);
b.getStyle().disabledFontColor = b.getStyle().fontColor;
@@ -48,15 +48,15 @@ public OlDisclaimerDialog(){
}).get();
s.setDisabled(() ->
- s.color.a < 1
+ s.color.a < 1
);
s.actions(
- Actions.alpha(0),
- Actions.moveBy(0f, 0f),
- Actions.delay(2f),
- Actions.fadeIn(1f),
- Actions.delay(1f)
+ Actions.alpha(0),
+ Actions.moveBy(0f, 0f),
+ Actions.delay(2f),
+ Actions.fadeIn(1f),
+ Actions.delay(1f)
);
s.getStyle().disabledFontColor = b.getStyle().fontColor;
diff --git a/src/omaloon/ui/dialogs/OlDiscordLink.java b/src/omaloon/ui/dialogs/OlDiscordLink.java
index ab283dcc..86c6fc5c 100644
--- a/src/omaloon/ui/dialogs/OlDiscordLink.java
+++ b/src/omaloon/ui/dialogs/OlDiscordLink.java
@@ -25,7 +25,7 @@ public OlDiscordLink(){
img.row();
img.image().height(5).width(40f).color(
- color.cpy().mul(0.8f, 0.8f, 0.8f, 1f)
+ color.cpy().mul(0.8f, 0.8f, 0.8f, 1f)
);
}).expandY();
diff --git a/src/omaloon/ui/dialogs/OlEndDialog.java b/src/omaloon/ui/dialogs/OlEndDialog.java
index e853738c..aefce6e4 100644
--- a/src/omaloon/ui/dialogs/OlEndDialog.java
+++ b/src/omaloon/ui/dialogs/OlEndDialog.java
@@ -13,14 +13,14 @@ public OlEndDialog(){
buttons.remove();
cont.stack(
- new Table(t -> t.add("@ui.omaloon-finished-campaign")),
- new Table(t -> t.add(mobile ? "@ui.omaloon-exit-dialog.mobile" : "@ui.omaloon-exit-dialog")).bottom().left()
+ new Table(t -> t.add("@ui.omaloon-finished-campaign")),
+ new Table(t -> t.add(mobile ? "@ui.omaloon-exit-dialog.mobile" : "@ui.omaloon-exit-dialog")).bottom().left()
).grow();
actions(Actions.fadeOut(1));
clicked(() -> hide(Actions.sequence(
- Actions.fadeIn(0),
- Actions.fadeOut(1)
+ Actions.fadeIn(0),
+ Actions.fadeOut(1)
)));
}
}
diff --git a/src/omaloon/ui/dialogs/OlGameDataDialog.java b/src/omaloon/ui/dialogs/OlGameDataDialog.java
index fb6c0255..d5031d8f 100644
--- a/src/omaloon/ui/dialogs/OlGameDataDialog.java
+++ b/src/omaloon/ui/dialogs/OlGameDataDialog.java
@@ -15,25 +15,25 @@ public OlGameDataDialog(){
cont.table(Tex.button, cat -> {
cat.button(
- "@settings.clearresearch",
- Icon.trash,
- Styles.flatt,
- Vars.iconMed,
- () -> Vars.ui.showConfirm("@settings.omaloon-clearresearch-confirm", () -> OmaloonMod.resetTree(OlPlanets.glasmore.techTree))
+ "@settings.clearresearch",
+ Icon.trash,
+ Styles.flatt,
+ Vars.iconMed,
+ () -> Vars.ui.showConfirm("@settings.omaloon-clearresearch-confirm", () -> OmaloonMod.resetTree(OlPlanets.glasmore.techTree))
).growX().marginLeft(8).height(50).row();
cat.button(
- "@settings.clearcampaignsaves",
- Icon.trash,
- Styles.flatt,
- Vars.iconMed,
- () -> Vars.ui.showConfirm("@settings.omaloon-clearcampaignsaves-confirm", () -> OmaloonMod.resetSaves(OlPlanets.glasmore))
+ "@settings.clearcampaignsaves",
+ Icon.trash,
+ Styles.flatt,
+ Vars.iconMed,
+ () -> Vars.ui.showConfirm("@settings.omaloon-clearcampaignsaves-confirm", () -> OmaloonMod.resetSaves(OlPlanets.glasmore))
).growX().marginLeft(8).height(50).row();
cat.button(
- "@settings.omaloon-resethints",
- Icon.trash,
- Styles.flatt,
- Vars.iconMed,
- () -> Vars.ui.showConfirm("@settings.omaloon-resethints-confirm", EventHints::reset)
+ "@settings.omaloon-resethints",
+ Icon.trash,
+ Styles.flatt,
+ Vars.iconMed,
+ () -> Vars.ui.showConfirm("@settings.omaloon-resethints-confirm", EventHints::reset)
).growX().marginLeft(8).height(50).row();
}).width(400f).row();
}
diff --git a/src/omaloon/ui/dialogs/OlGameDialog.java b/src/omaloon/ui/dialogs/OlGameDialog.java
index 7892abbe..af6b03b3 100644
--- a/src/omaloon/ui/dialogs/OlGameDialog.java
+++ b/src/omaloon/ui/dialogs/OlGameDialog.java
@@ -59,31 +59,31 @@ public void rebuild(){
cont.clear();
addSlider(
- "@setting.omaloon-shield-opacity", null, "omaloon-shield-opacity",
- new Slider(0, 100, 1, false), 20,
- f -> Strings.autoFixed(f, 20) + "%"
+ "@setting.omaloon-shield-opacity", null, "omaloon-shield-opacity",
+ new Slider(0, 100, 1, false), 20,
+ f -> Strings.autoFixed(f, 20) + "%"
);
addCheck(
- "@setting.omaloon-show-disclaimer", null, "omaloon-show-disclaimer",
- false, b -> {
- }
+ "@setting.omaloon-show-disclaimer", null, "omaloon-show-disclaimer",
+ false, b -> {
+ }
);
addCheck(
- "@setting.omaloon-enable-soft-cleaner", "@setting.omaloon-enable-soft-cleaner.description", "omaloon-enable-soft-cleaner",
- true, b -> {
- }
+ "@setting.omaloon-enable-soft-cleaner", "@setting.omaloon-enable-soft-cleaner.description", "omaloon-enable-soft-cleaner",
+ true, b -> {
+ }
);
addCheck(
- "@setting.omaloon-check-updates", null, "omaloon-check-updates",
- true, b -> {
- }
+ "@setting.omaloon-check-updates", null, "omaloon-check-updates",
+ true, b -> {
+ }
);
addCheck(
- "@setting.omaloon-display-liquid-stats", "@setting.omaloon-display-liquid-stats.description", "omaloon-display-liquid-stats",
- true, b -> {
- }
+ "@setting.omaloon-display-liquid-stats", "@setting.omaloon-display-liquid-stats.description", "omaloon-display-liquid-stats",
+ true, b -> {
+ }
);
cont.button("@settings.reset", () -> {
diff --git a/src/omaloon/ui/dialogs/OlInputDialog.java b/src/omaloon/ui/dialogs/OlInputDialog.java
index ccdf89fb..5c363cbd 100644
--- a/src/omaloon/ui/dialogs/OlInputDialog.java
+++ b/src/omaloon/ui/dialogs/OlInputDialog.java
@@ -120,9 +120,9 @@ public boolean scrolled(InputEvent event, float x, float y, float amountX, float
}
if(act) rebindTable.actions(
- Actions.moveBy(rebindTable.getWidth(), 0),
- Actions.fadeIn(0),
- Actions.moveBy(-rebindTable.getWidth(), 0f, 0.5f, Interp.sine)
+ Actions.moveBy(rebindTable.getWidth(), 0),
+ Actions.fadeIn(0),
+ Actions.moveBy(-rebindTable.getWidth(), 0f, 0.5f, Interp.sine)
);
Time.runTask(30f, () -> getScene().setScrollFocus(rebindDialog));
@@ -148,9 +148,9 @@ private void rebind(KeyBinds.Section section, KeyBinds.KeyBind bind, KeyCode new
rebindKey = null;
rebindAxis = false;
rebindTable.actions(
- Actions.moveBy(rebindTable.getWidth(), 0f, 0.5f, Interp.sine),
- Actions.fadeOut(0f),
- Actions.moveBy(-rebindTable.getWidth(), 0f)
+ Actions.moveBy(rebindTable.getWidth(), 0f, 0.5f, Interp.sine),
+ Actions.fadeOut(0f),
+ Actions.moveBy(-rebindTable.getWidth(), 0f)
);
}
}
diff --git a/src/omaloon/ui/dialogs/OlUpdateCheckerDialog.java b/src/omaloon/ui/dialogs/OlUpdateCheckerDialog.java
index b2314887..c0b86213 100644
--- a/src/omaloon/ui/dialogs/OlUpdateCheckerDialog.java
+++ b/src/omaloon/ui/dialogs/OlUpdateCheckerDialog.java
@@ -87,11 +87,11 @@ public static void handle(Http.HttpResponse res){
try{
Fi file = tmpDirectory.child(repo.replace("/", "") + ".zip");
Streams.copyProgress(
- res.getResultAsStream(),
- file.write(false),
- res.getContentLength(),
- 4096,
- p -> progress = p
+ res.getResultAsStream(),
+ file.write(false),
+ res.getContentLength(),
+ 4096,
+ p -> progress = p
);
mods.importMod(file).setRepo(repo);
diff --git a/src/omaloon/ui/elements/CenterBar.java b/src/omaloon/ui/elements/CenterBar.java
index 1a4cd14d..e2415e90 100644
--- a/src/omaloon/ui/elements/CenterBar.java
+++ b/src/omaloon/ui/elements/CenterBar.java
@@ -108,10 +108,10 @@ public void draw(){
Drawable top = Tex.barTop;
top.draw(
- x + (width / 2f - Core.atlas.find("bar-top").width / 2f) * (Math.min(value, 0f) + 1f),
- y,
- Core.atlas.find("bar-top").width + (-Core.atlas.find("bar-top").width / 2f + width / 2f) * Math.abs(value),
- height
+ x + (width / 2f - Core.atlas.find("bar-top").width / 2f) * (Math.min(value, 0f) + 1f),
+ y,
+ Core.atlas.find("bar-top").width + (-Core.atlas.find("bar-top").width / 2f + width / 2f) * Math.abs(value),
+ height
);
Draw.color();
diff --git a/src/omaloon/ui/fragments/CliffFragment.java b/src/omaloon/ui/fragments/CliffFragment.java
index fa31e2fd..73073d1b 100644
--- a/src/omaloon/ui/fragments/CliffFragment.java
+++ b/src/omaloon/ui/fragments/CliffFragment.java
@@ -10,14 +10,14 @@
import arc.scene.ui.layout.*;
import mindustry.gen.*;
import mindustry.ui.*;
-import omaloon.*;
+import omaloon.OmaloonMod;
import omaloon.ui.*;
import omaloon.world.blocks.environment.*;
import static mindustry.Vars.*;
public class CliffFragment extends Table{
- private Table layout;
+ private final Table layout;
private boolean enabled;
private final Color col = Color.valueOf("645654");
@@ -63,19 +63,19 @@ private void toggle(){
enabled = !enabled;
if(enabled){
layout.actions(
- Actions.moveBy(-layout.getWidth(), 0),
- Actions.parallel(
- Actions.alpha(1, 0.3f, Interp.pow3Out),
- Actions.moveBy(layout.getWidth(), 0, 0.3f, Interp.pow3Out)
- )
+ Actions.moveBy(-layout.getWidth(), 0),
+ Actions.parallel(
+ Actions.alpha(1, 0.3f, Interp.pow3Out),
+ Actions.moveBy(layout.getWidth(), 0, 0.3f, Interp.pow3Out)
+ )
);
}else{
layout.actions(
- Actions.parallel(
- Actions.moveBy(-layout.getWidth(), 0, 0.3f, Interp.pow3Out),
- Actions.alpha(0, 0.3f, Interp.pow3Out)
- ),
- Actions.moveBy(layout.getWidth(), 0)
+ Actions.parallel(
+ Actions.moveBy(-layout.getWidth(), 0, 0.3f, Interp.pow3Out),
+ Actions.alpha(0, 0.3f, Interp.pow3Out)
+ ),
+ Actions.moveBy(layout.getWidth(), 0)
);
}
}
diff --git a/src/omaloon/ui/fragments/ShapedEnvPlacerFragment.java b/src/omaloon/ui/fragments/ShapedEnvPlacerFragment.java
index c419fd2a..0d00b628 100644
--- a/src/omaloon/ui/fragments/ShapedEnvPlacerFragment.java
+++ b/src/omaloon/ui/fragments/ShapedEnvPlacerFragment.java
@@ -21,13 +21,13 @@
import mindustry.ui.*;
import mindustry.world.*;
import mindustry.world.blocks.environment.*;
-import omaloon.*;
+import omaloon.OmaloonMod;
import omaloon.ui.*;
import omaloon.world.blocks.environment.*;
import static arc.Core.*;
import static mindustry.Vars.*;
-import static omaloon.OmaloonMod.shapedEnvPlacerFragment;
+import static omaloon.core.OlUI.shapedEnvPlacerFragment;
public class ShapedEnvPlacerFragment extends Table{
private Table indicator;
@@ -64,33 +64,33 @@ public ShapedEnvPlacerFragment(){
t1.pane(Styles.smallPane, selector -> content.blocks().each(block -> block instanceof CustomShapeProp, block -> {
Button b = selector.button(
- button -> button.add(new Image(block.uiIcon).setScaling(Scaling.fit)).size(32),
- new Button.ButtonStyle(){{
- up = Tex.windowEmpty;
- down = Tex.windowEmpty;
- checked = Tex.buttonSelect;
- }},
- () -> {
- currentBlock = block;
- currentShape = 1;
- }
+ button -> button.add(new Image(block.uiIcon).setScaling(Scaling.fit)).size(32),
+ new Button.ButtonStyle(){{
+ up = Tex.windowEmpty;
+ down = Tex.windowEmpty;
+ checked = Tex.buttonSelect;
+ }},
+ () -> {
+ currentBlock = block;
+ currentShape = 1;
+ }
).size(50f).tooltip(block.localizedName).get();
b.update(() -> b.setChecked(currentBlock == block));
})).size(300f, 50f).padTop(5f);
t1.row();
t1.button(
- b -> b.add("@place"),
- new Button.ButtonStyle(){{
- up = Tex.windowEmpty;
- down = Tex.windowEmpty;
- over = Tex.buttonSelect;
- }},
- () -> {
- if(selecting && visible){
- place();
+ b -> b.add("@place"),
+ new Button.ButtonStyle(){{
+ up = Tex.windowEmpty;
+ down = Tex.windowEmpty;
+ over = Tex.buttonSelect;
+ }},
+ () -> {
+ if(selecting && visible){
+ place();
+ }
}
- }
).size(120f, 40f).pad(5f);
t1.setTransform(true);
}).fill().bottom();
@@ -152,7 +152,7 @@ public void tap(InputEvent event, float x, float y, int count, KeyCode button){
private boolean isOverIndicator(float x, float y){
if(indicator == null) return true;
return !(x >= indicator.x) || !(x <= indicator.x + indicator.getWidth()) ||
- !(y >= indicator.y) || !(y <= indicator.y + indicator.getHeight());
+ !(y >= indicator.y) || !(y <= indicator.y + indicator.getHeight());
}
//TODO: What a monstrosity...
@@ -261,21 +261,21 @@ public void toggle(){
private void showUI(){
indicator.actions(
- Actions.moveBy(0, -indicator.getHeight()),
- Actions.parallel(
- Actions.alpha(1, 0.3f, Interp.pow3Out),
- Actions.moveBy(0, indicator.getHeight(), 0.3f, Interp.pow3Out)
- )
+ Actions.moveBy(0, -indicator.getHeight()),
+ Actions.parallel(
+ Actions.alpha(1, 0.3f, Interp.pow3Out),
+ Actions.moveBy(0, indicator.getHeight(), 0.3f, Interp.pow3Out)
+ )
);
}
private void hideUI(){
indicator.actions(
- Actions.parallel(
- Actions.moveBy(0, -indicator.getHeight(), 0.3f, Interp.pow3In),
- Actions.alpha(0, 0.3f, Interp.pow3In)
- ),
- Actions.moveBy(0, indicator.getHeight())
+ Actions.parallel(
+ Actions.moveBy(0, -indicator.getHeight(), 0.3f, Interp.pow3In),
+ Actions.alpha(0, 0.3f, Interp.pow3In)
+ ),
+ Actions.moveBy(0, indicator.getHeight())
);
}
@@ -299,15 +299,15 @@ private void changeShape(int delta){
private void mirrorVertically(){
int[][] pairs = (currentShape <= 4) ?
- new int[][]{{1, 4}, {2, 3}} :
- new int[][]{{5, 6}, {8, 7}};
+ new int[][]{{1, 4}, {2, 3}} :
+ new int[][]{{5, 6}, {8, 7}};
applyMirror(pairs);
}
private void mirrorHorizontally(){
int[][] pairs = (currentShape <= 4) ?
- new int[][]{{1, 2}, {3, 4}} :
- new int[][]{{5, 8}, {7, 6}};
+ new int[][]{{1, 2}, {3, 4}} :
+ new int[][]{{5, 8}, {7, 6}};
applyMirror(pairs);
}
diff --git a/src/omaloon/world/blocks/defense/BlastTower.java b/src/omaloon/world/blocks/defense/BlastTower.java
index a90a84ae..2aeea810 100644
--- a/src/omaloon/world/blocks/defense/BlastTower.java
+++ b/src/omaloon/world/blocks/defense/BlastTower.java
@@ -135,9 +135,9 @@ public void shoot(){
shootSound.at(this);
waveEffect.layer(Layer.blockUnder).at(x, y, range, waveColor);
tile.getLinkedTiles(t -> OlFx.hammerHit.layer(Layer.blockUnder).at(
- t.worldx(), t.worldy(),
- angleTo(t.worldx(), t.worldy()) + Mathf.range(360f),
- Tmp.c1.set(t.floor().mapColor).mul(1.5f + Mathf.range(0.15f)))
+ t.worldx(), t.worldy(),
+ angleTo(t.worldx(), t.worldy()) + Mathf.range(360f),
+ Tmp.c1.set(t.floor().mapColor).mul(1.5f + Mathf.range(0.15f)))
);
float damageMultiplier = efficiencyMultiplier();
diff --git a/src/omaloon/world/blocks/defense/Shelter.java b/src/omaloon/world/blocks/defense/Shelter.java
index 575d4ec8..dceb5e6c 100644
--- a/src/omaloon/world/blocks/defense/Shelter.java
+++ b/src/omaloon/world/blocks/defense/Shelter.java
@@ -26,7 +26,7 @@
import omaloon.world.interfaces.*;
import omaloon.world.meta.*;
-import static omaloon.OmaloonMod.shieldBuffer;
+import static omaloon.OmaloonMod.*;
public class Shelter extends Block{
@Load(value = "@-base", fallback = {"block-@size"})
@@ -183,9 +183,9 @@ public void draw(){
Tmp.v1.trns(360f / configSerrations * i, size * 8f);
Lines.stroke(2 * Interp.circle.apply(configureWarmup), Pal.accent);
Lines.lineAngle(
- Tmp.v1.x + x, Tmp.v1.y + y,
- Tmp.v1.angle(),
- (0.5f + 3f * Interp.circleIn.apply(dot)) * Interp.circle.apply(configureWarmup)
+ Tmp.v1.x + x, Tmp.v1.y + y,
+ Tmp.v1.angle(),
+ (0.5f + 3f * Interp.circleIn.apply(dot)) * Interp.circle.apply(configureWarmup)
);
}
}
@@ -243,25 +243,25 @@ public void updateTile(){
float radius = shieldRange * warmup + shieldBuffer;
Groups.bullet.intersect(
- x - radius,
- y - radius,
- radius * 2f,
- radius * 2f,
- b -> {
- if(b.team == Team.derelict){
- float distance = Mathf.dst(x, y, b.x, b.y);
- float angle = Math.abs(((b.angleTo(x, y) - rot) % 360f + 360f) % 360f - 180f);
- boolean inWarmupRadius = distance <= warmup * (hitSize() * 1.4f);
-
- if((distance <= shieldRange * warmup + b.type.splashDamageRadius && angle <= shieldAngle / 2f) || inWarmupRadius){
- b.absorb();
- hitEffect.at(b.x, b.y, b.hitSize);
- hitSound.at(b.x, b.y, Mathf.random(0.9f, 1.1f), hitSoundVolume);
- shieldDamage += b.damage;
- if(shieldDamage >= shieldHealth) broken = true;
+ x - radius,
+ y - radius,
+ radius * 2f,
+ radius * 2f,
+ b -> {
+ if(b.team == Team.derelict){
+ float distance = Mathf.dst(x, y, b.x, b.y);
+ float angle = Math.abs(((b.angleTo(x, y) - rot) % 360f + 360f) % 360f - 180f);
+ boolean inWarmupRadius = distance <= warmup * (hitSize() * 1.4f);
+
+ if((distance <= shieldRange * warmup + b.type.splashDamageRadius && angle <= shieldAngle / 2f) || inWarmupRadius){
+ b.absorb();
+ hitEffect.at(b.x, b.y, b.hitSize);
+ hitSound.at(b.x, b.y, Mathf.random(0.9f, 1.1f), hitSoundVolume);
+ shieldDamage += b.damage;
+ if(shieldDamage >= shieldHealth) broken = true;
+ }
}
}
- }
);
}
}else{
diff --git a/src/omaloon/world/blocks/distribution/TubeConveyor.java b/src/omaloon/world/blocks/distribution/TubeConveyor.java
index 7a7d4a4f..9f525a6b 100644
--- a/src/omaloon/world/blocks/distribution/TubeConveyor.java
+++ b/src/omaloon/world/blocks/distribution/TubeConveyor.java
@@ -20,18 +20,18 @@
import static arc.Core.atlas;
import static mindustry.Vars.*;
-import static omaloon.utils.OlUtils.reverse;
+import static omaloon.utils.OlUtils.*;
public class TubeConveyor extends Conveyor{
private static final float itemSpace = 0.4f;
private static final int capacity = 3;
public static final int[][] tiles = new int[][]{
- {},
- {0, 2}, {1, 3}, {0, 1},
- {0, 2}, {0, 2}, {1, 2},
- {0, 1, 2}, {1, 3}, {0, 3},
- {1, 3}, {0, 1, 3}, {2, 3},
- {0, 2, 3}, {1, 2, 3}, {0, 1, 2, 3}
+ {},
+ {0, 2}, {1, 3}, {0, 1},
+ {0, 2}, {0, 2}, {1, 2},
+ {0, 1, 2}, {1, 3}, {0, 3},
+ {1, 3}, {0, 1, 3}, {2, 3},
+ {0, 2, 3}, {1, 2, 3}, {0, 1, 2, 3}
};
public TextureRegion[][] topRegion;
@@ -51,15 +51,15 @@ public void init(){
public boolean validBlock(Block otherblock){
return ((otherblock instanceof TubeConveyor) || (otherblock instanceof TubeDistributor) ||
- (otherblock instanceof TubeSorter) || (otherblock instanceof TubeJunction) ||
- (otherblock instanceof TubeGate) || otherblock instanceof TubeItemBridge ||
- (otherblock instanceof CoreBlock) || (otherblock instanceof ItemSource) || (otherblock instanceof ItemVoid));
+ (otherblock instanceof TubeSorter) || (otherblock instanceof TubeJunction) ||
+ (otherblock instanceof TubeGate) || otherblock instanceof TubeItemBridge ||
+ (otherblock instanceof CoreBlock) || (otherblock instanceof ItemSource) || (otherblock instanceof ItemVoid));
}
@Override
public boolean blends(Tile tile, int rotation, int otherx, int othery, int otherrot, Block otherblock){
return (otherblock instanceof TubeDistributor) || (otherblock.outputsItems() || (lookingAt(tile, rotation, otherx, othery, otherblock) && otherblock.hasItems))
- && lookingAtEither(tile, rotation, otherx, othery, otherrot, otherblock) && validBlock(otherblock);
+ && lookingAtEither(tile, rotation, otherx, othery, otherrot, otherblock) && validBlock(otherblock);
}
@Override
@@ -74,14 +74,14 @@ public Block getReplacement(BuildPlan req, Seq plans){
if(junctionReplacement == null) return this;
Boolf cont = p -> plans.contains(o -> o.x == req.x + p.x && o.y == req.y + p.y
- && (req.block instanceof TubeConveyor || req.block instanceof Junction));
+ && (req.block instanceof TubeConveyor || req.block instanceof Junction));
return cont.get(Geometry.d4(req.rotation))
- && cont.get(Geometry.d4(req.rotation - 2))
- && req.tile() != null
- && req.tile().block() instanceof TubeConveyor
- && Mathf.mod(req.tile().build.rotation - req.rotation, 2) == 1
- ? junctionReplacement
- : this;
+ && cont.get(Geometry.d4(req.rotation - 2))
+ && req.tile() != null
+ && req.tile().block() instanceof TubeConveyor
+ && Mathf.mod(req.tile().build.rotation - req.rotation, 2) == 1
+ ? junctionReplacement
+ : this;
}
@Override
@@ -96,11 +96,11 @@ public void drawPlanRegion(BuildPlan req, Eachable list){
int x = req.x + point.x, y = req.y + point.y;
if(x >= other.x - (other.block.size - 1) / 2 && x <= other.x + (other.block.size / 2) && y >= other.y - (other.block.size - 1) / 2 && y <= other.y + (other.block.size / 2)){
if((other.block instanceof Conveyor ?
- (req.rotation == i || (other.rotation + 2) % 4 == i) :
- (
- (req.rotation == i && other.block.acceptsItems) ||
- (req.rotation != i && other.block.outputsItems())
- )) && validBlock(other.block)
+ (req.rotation == i || (other.rotation + 2) % 4 == i) :
+ (
+ (req.rotation == i && other.block.acceptsItems) ||
+ (req.rotation != i && other.block.outputsItems())
+ )) && validBlock(other.block)
){
directionals[i] = other;
}
@@ -119,14 +119,14 @@ public void drawPlanRegion(BuildPlan req, Eachable list){
Draw.rect(topRegion[0][mask], req.drawx(), req.drawy(), 0);
for(int i : tiles[mask]){
if(
- directionals[i] == null ||
- (directionals[i].block instanceof Conveyor ?
- (directionals[i].rotation + 2) % 4 == req.rotation :
- (
- (req.rotation == i && !directionals[i].block.acceptsItems) ||
- (req.rotation != i && !directionals[i].block.outputsItems())
- )
- )
+ directionals[i] == null ||
+ (directionals[i].block instanceof Conveyor ?
+ (directionals[i].rotation + 2) % 4 == req.rotation :
+ (
+ (req.rotation == i && !directionals[i].block.acceptsItems) ||
+ (req.rotation != i && !directionals[i].block.outputsItems())
+ )
+ )
){
int id = i == 0 || i == 3 ? 1 : 0;
Draw.rect(capRegion[id], req.drawx(), req.drawy(), i == 0 || i == 2 ? 0 : -90);
@@ -171,7 +171,7 @@ public void updateTile(){
if(isEnd(reverse(rotation)) && blendbits == 0){
float nextMaxReverse = aligned ? (items.total() > 2 ? (0.5f - Math.max(itemSpace - nextc.minitem, 0))
- : Math.max(itemSpace - nextc.minitem, 0)) : 0f;
+ : Math.max(itemSpace - nextc.minitem, 0)) : 0f;
float movedReverse = speed * edelta();
@@ -218,8 +218,8 @@ public void updateTile(){
}
if(minitem < itemSpace + (blendbits == 1 ? 0.3f : 0f)
- || isEnd(reverse(rotation)) && items.total() >= 2
- || isEnd(reverse(rotation)) && isEnd(rotation) && items.total() >= 1){
+ || isEnd(reverse(rotation)) && items.total() >= 2
+ || isEnd(reverse(rotation)) && isEnd(rotation) && items.total() >= 1){
clogHeat = Mathf.approachDelta(clogHeat, 1f, 1f / 60f);
}else{
clogHeat = 0f;
@@ -240,16 +240,16 @@ public Building buildAt(int i){
public boolean valid(int i){
Building b = buildAt(i);
return b != null && (b instanceof TubeConveyorBuild ? (b.front() != null && b.front() == this)
- : b.block.acceptsItems) && ((b.block instanceof TubeConveyor) || (b.block instanceof TubeDistributor) ||
- (b.block instanceof TubeSorter) || (b.block instanceof TubeJunction) ||
- (b.block instanceof TubeGate) || b.block instanceof TubeItemBridge ||
- (b.block instanceof CoreBlock) || (b.block instanceof ItemSource) || (b.block instanceof ItemVoid));
+ : b.block.acceptsItems) && ((b.block instanceof TubeConveyor) || (b.block instanceof TubeDistributor) ||
+ (b.block instanceof TubeSorter) || (b.block instanceof TubeJunction) ||
+ (b.block instanceof TubeGate) || b.block instanceof TubeItemBridge ||
+ (b.block instanceof CoreBlock) || (b.block instanceof ItemSource) || (b.block instanceof ItemVoid));
}
public boolean isEnd(int i){
var b = buildAt(i);
return (!valid(i) && (b == null ? null : b.block) != this.block) ||
- (b instanceof ConveyorBuild && ((b.rotation + 2) % 4 == rotation || (b.front() != this && back() == b)));
+ (b instanceof ConveyorBuild && ((b.rotation + 2) % 4 == rotation || (b.front() != this && back() == b)));
}
@Override
@@ -264,8 +264,8 @@ public void draw(){
float rot = i == 0 ? rotation * 90 : (dir) * 90;
Draw.rect(sliced(regions[0][frame], i != 0 ? SliceMode.bottom : SliceMode.top),
- x + Geometry.d4x(dir) * tilesize * 0.75f, y + Geometry.d4y(dir) * tilesize * 0.75f,
- rot);
+ x + Geometry.d4x(dir) * tilesize * 0.75f, y + Geometry.d4y(dir) * tilesize * 0.75f,
+ rot);
}
}
@@ -275,7 +275,7 @@ public void draw(){
Draw.z(Layer.block - 0.2f);
float layer = Layer.block - 0.2f, wwidth = world.unitWidth(), wheight = world.unitHeight(),
- scaling = 0.01f;
+ scaling = 0.01f;
for(int i = 0; i < len; i++){
Item item = ids[i];
@@ -309,10 +309,10 @@ public void drawCracks(){
@Override
public boolean pass(Item item){
if(item != null && next != null && next.team == team && next.acceptItem(this, item) &&
- ((next.block instanceof TubeConveyor) || (next.block instanceof TubeDistributor) ||
- (next.block instanceof TubeSorter) || (next.block instanceof TubeJunction) ||
- (next.block instanceof TubeGate) || next.block instanceof TubeItemBridge ||
- (next.block instanceof CoreBlock) || (next.block instanceof ItemSource) || (next.block instanceof ItemVoid))){
+ ((next.block instanceof TubeConveyor) || (next.block instanceof TubeDistributor) ||
+ (next.block instanceof TubeSorter) || (next.block instanceof TubeJunction) ||
+ (next.block instanceof TubeGate) || next.block instanceof TubeItemBridge ||
+ (next.block instanceof CoreBlock) || (next.block instanceof ItemSource) || (next.block instanceof ItemVoid))){
next.handleItem(this, item);
return true;
}
@@ -326,10 +326,10 @@ public boolean acceptItem(Building source, Item item){
if(facing == null) return false;
int direction = Math.abs(facing.relativeTo(tile.x, tile.y) - rotation);
return (((direction == 0) && minitem >= itemSpace) || ((direction % 2 == 1) && minitem > 0.7f)) && !(source.block.rotate && next == source) &&
- ((source.block instanceof TubeConveyor) || (source.block instanceof TubeDistributor) ||
- (source.block instanceof TubeSorter) || (source.block instanceof TubeJunction) ||
- (source.block instanceof TubeGate) || source.block instanceof TubeItemBridge ||
- (source.block instanceof CoreBlock) || (source.block instanceof ItemSource) || (source.block instanceof ItemVoid));
+ ((source.block instanceof TubeConveyor) || (source.block instanceof TubeDistributor) ||
+ (source.block instanceof TubeSorter) || (source.block instanceof TubeJunction) ||
+ (source.block instanceof TubeGate) || source.block instanceof TubeItemBridge ||
+ (source.block instanceof CoreBlock) || (source.block instanceof ItemSource) || (source.block instanceof ItemVoid));
}
@Override
@@ -355,11 +355,11 @@ public void onProximityUpdate(){
Building otherblock = nearby(i);
if(otherblock == null) continue;
if((otherblock.block instanceof Conveyor ?
- (rotation == i || (otherblock.rotation + 2) % 4 == i) :
- (
- (rotation == i && otherblock.block.acceptsItems) ||
- (rotation != i && otherblock.block.outputsItems())
- )) && validBlock(otherblock.block)
+ (rotation == i || (otherblock.rotation + 2) % 4 == i) :
+ (
+ (rotation == i && otherblock.block.acceptsItems) ||
+ (rotation != i && otherblock.block.outputsItems())
+ )) && validBlock(otherblock.block)
){
tiling |= (1 << i);
}
diff --git a/src/omaloon/world/blocks/distribution/TubeDistributor.java b/src/omaloon/world/blocks/distribution/TubeDistributor.java
index 4167f964..fd4af9f3 100644
--- a/src/omaloon/world/blocks/distribution/TubeDistributor.java
+++ b/src/omaloon/world/blocks/distribution/TubeDistributor.java
@@ -15,7 +15,7 @@
import static arc.Core.atlas;
import static mindustry.Vars.itemSize;
-import static omaloon.utils.OlUtils.reverse;
+import static omaloon.utils.OlUtils.*;
public class TubeDistributor extends Router{
public DrawBlock drawer = new DrawDefault();
@@ -94,7 +94,7 @@ public void updateTile(){
}
if(items.total() > 0 && !Vars.state.isPaused() && (!(time >= 1f) && (blockValidInDirection(targetAngle())))
- || (!blockValidInDirection(targetAngle()) && !(time >= 0.4f))){
+ || (!blockValidInDirection(targetAngle()) && !(time >= 0.4f))){
lastRot = rot;
rot += speed * angle * delta();
}
@@ -103,17 +103,17 @@ public void updateTile(){
private float computeAngle(int sa, int ta){
return (sa == 0) ? ((ta == 2) ? 1 : ((ta == 0 || ta == 3) ? -1 : 1)) :
- (sa == 2) ? ((ta == 0 || ta == 1) ? -1 : 1) :
- (sa == 1) ? ((ta == 0 || ta == 3) ? -1 : 1) :
- ((ta == 0 || ta == 1) ? 1 : -1);
+ (sa == 2) ? ((ta == 0 || ta == 1) ? -1 : 1) :
+ (sa == 1) ? ((ta == 0 || ta == 3) ? -1 : 1) :
+ ((ta == 0 || ta == 1) ? 1 : -1);
}
public boolean blockValidInDirection(int direction){
Tile targetTile = tile.nearby(direction);
return targetTile != null && (targetTile.block().hasItems
- || targetTile.block() instanceof Junction
- || targetTile.block() instanceof TubeSorter
- || targetTile.block() instanceof OverflowGate
+ || targetTile.block() instanceof Junction
+ || targetTile.block() instanceof TubeSorter
+ || targetTile.block() instanceof OverflowGate
);
}
@@ -176,7 +176,7 @@ public void drawItem(){
if(sourceAngle() == targetAngle()){
oy = time >= 0.5f ? linearMove : -linearMove;
ox = time >= 0.5f ? (time * s2 - s) * (targetAngle() == 0 ? 1 : -1)
- : (time * s2 - s) * (targetAngle() == 0 ? -1 : 1);
+ : (time * s2 - s) * (targetAngle() == 0 ? -1 : 1);
}else{
oy = linearMove;
ox = (time * s2 - s) * (targetAngle() == 0 ? 1 : -1);
@@ -190,7 +190,7 @@ public void drawItem(){
if(sourceAngle() == targetAngle()){
ox = time >= 0.5f ? linearMove : -linearMove;
oy = time >= 0.5f ? (time * s2 - s) * (targetAngle() == 1 ? 1 : -1)
- : (time * s2 - s) * (targetAngle() == 1 ? -1 : 1);
+ : (time * s2 - s) * (targetAngle() == 1 ? -1 : 1);
}else{
ox = (float)Math.sin(Math.PI * time) / 2.4f * s;
oy = (time * s2 - s) * (targetAngle() == 1 ? 1 : -1);
diff --git a/src/omaloon/world/blocks/distribution/TubeGate.java b/src/omaloon/world/blocks/distribution/TubeGate.java
index c7ef9d62..6a0c069e 100644
--- a/src/omaloon/world/blocks/distribution/TubeGate.java
+++ b/src/omaloon/world/blocks/distribution/TubeGate.java
@@ -67,9 +67,9 @@ public Object config(){
if(from == -1) return null;
Building to = nearby((from + 2) % 4);
boolean
- fromInst = src.block.instantTransfer,
- canForward = to != null && to.team == team && !(fromInst && to.block.instantTransfer) && to.acceptItem(this, item),
- inv = invert == enabled;
+ fromInst = src.block.instantTransfer,
+ canForward = to != null && to.team == team && !(fromInst && to.block.instantTransfer) && to.acceptItem(this, item),
+ inv = invert == enabled;
if(!canForward || inv){
Building a = nearby(Mathf.mod(from - 1, 4));
diff --git a/src/omaloon/world/blocks/distribution/TubeItemBridge.java b/src/omaloon/world/blocks/distribution/TubeItemBridge.java
index 8f9ffd5d..1af2efd5 100644
--- a/src/omaloon/world/blocks/distribution/TubeItemBridge.java
+++ b/src/omaloon/world/blocks/distribution/TubeItemBridge.java
@@ -71,9 +71,9 @@ public void setStats(){
public void setBars(){
super.setBars();
addBar("connections", entity -> new Bar(() ->
- Core.bundle.format("bar.powerlines", cast(entity).realConnections(), maxConnections - 1),
- () -> Pal.items,
- () -> (float)cast(entity).realConnections() / (float)(maxConnections - 1)
+ Core.bundle.format("bar.powerlines", cast(entity).realConnections(), maxConnections - 1),
+ () -> Pal.items,
+ () -> (float)cast(entity).realConnections() / (float)(maxConnections - 1)
));
}
@@ -81,9 +81,9 @@ public void setBars(){
public void drawBridge(BuildPlan req, float ox, float oy, float flip){
drawBridge(bridgeRegion, endRegion, new Vec2(req.drawx(), req.drawy()), new Vec2(ox, oy));
Draw.rect(arrowRegion,
- (req.drawx() + ox) / 2f,
- (req.drawy() + oy) / 2f,
- Angles.angle(req.drawx(), req.drawy(), ox, oy)
+ (req.drawx() + ox) / 2f,
+ (req.drawy() + oy) / 2f,
+ Angles.angle(req.drawx(), req.drawy(), ox, oy)
);
}
@@ -111,7 +111,7 @@ public Tile findLinkTile(int x, int y, boolean checkBlock){
Tile tile = world.tile(x, y);
if(tile != null && lastBuild != null && lastBuild.tile != tile){
boolean validLink = checkBlock ? linkValid(tile, lastBuild.tile) && lastBuild.link == -1 :
- linkValid(tile, lastBuild.tile, false, true);
+ linkValid(tile, lastBuild.tile, false, true);
if(validLink) return lastBuild.tile;
}
return null;
@@ -132,10 +132,10 @@ public void drawPlace(int x, int y, int rotation, boolean valid){
Draw.z(Layer.blockUnder - 0.3f);
Lines.poly(new Vec2[]{
- start.cpy().add(Tmp.v1.trns(angle, -0.4f)),
- end.cpy().add(Tmp.v1.trns(angle, -0.4f)),
- end.cpy().add(Tmp.v1.trns(angle, 0.4f)),
- start.cpy().add(Tmp.v1.trns(angle, 0.4f)),
+ start.cpy().add(Tmp.v1.trns(angle, -0.4f)),
+ end.cpy().add(Tmp.v1.trns(angle, -0.4f)),
+ end.cpy().add(Tmp.v1.trns(angle, 0.4f)),
+ start.cpy().add(Tmp.v1.trns(angle, 0.4f)),
}, 0, 0, 8);
Tmp.v1.set(start).sub(end).setLength(4);
@@ -186,10 +186,10 @@ public boolean linkValid(Tile tile, Tile other, boolean checkDouble, boolean old
connected = other.build.as().link == tile.pos();
}
return ((block.connectFilter.get(other.build)) || !(tile.block() instanceof ItemBridge) && other.block() == this) &&
- b2 &&
- (other.team() == tile.team() || other.block() != this) &&
+ b2 &&
+ (other.team() == tile.team() || other.block() != this) &&
- (!checkDouble || !connected);
+ (!checkDouble || !connected);
}else{
if(!positionsValid(tile.x, tile.y, other.x, other.y)) break check;
boolean b3 = other.team() == tile.team() || tile.block() != this;
@@ -199,8 +199,8 @@ public boolean linkValid(Tile tile, Tile other, boolean checkDouble, boolean old
return b2 && b3 && b4;
}else{
return (other.block() == tile.block() && tile.block() == this || !(tile.block() instanceof ItemBridge) && other.block() == this)
- && b3 &&
- (!checkDouble || ((ItemBridgeBuild)other.build).link != tile.pos());
+ && b3 &&
+ (!checkDouble || ((ItemBridgeBuild)other.build).link != tile.pos());
}
}
}
@@ -268,7 +268,7 @@ public boolean onConfigureBuildTapped(Building other){
this.configure(other.pos());
other.configure(-1);
}else if(linkValid(this.tile, other.tile)
- && other instanceof TubeItemBridgeBuild bridge){
+ && other instanceof TubeItemBridgeBuild bridge){
if(this.link == other.pos()){
other.as().incoming.removeValue(this.pos());
@@ -450,7 +450,7 @@ public void drawConfigure(){
}
if(orderedMap.containsKey(this)) orderedMap.remove(this);
orderedMap.each((other, linked) ->
- Drawf.select(other.x, other.y, (float)(other.block().size * 8) / 2.0F + 2.0F + (linked ? 0.0F : Mathf.absin(Time.time, 4.0F, 1.0F)), linked ? Pal.place : Pal.breakInvalid)
+ Drawf.select(other.x, other.y, (float)(other.block().size * 8) / 2.0F + 2.0F + (linked ? 0.0F : Mathf.absin(Time.time, 4.0F, 1.0F)), linked ? Pal.place : Pal.breakInvalid)
);
}
diff --git a/src/omaloon/world/blocks/distribution/TubeSorter.java b/src/omaloon/world/blocks/distribution/TubeSorter.java
index 87116c10..9c02e1a7 100644
--- a/src/omaloon/world/blocks/distribution/TubeSorter.java
+++ b/src/omaloon/world/blocks/distribution/TubeSorter.java
@@ -100,9 +100,9 @@ public Building getTileTarget(Item item, Building source, boolean flip){
Building a = nearby(Mathf.mod(dir - 1, 4));
Building b = nearby(Mathf.mod(dir + 1, 4));
boolean ac = a != null && !(a.block.instantTransfer && source.block.instantTransfer) &&
- a.acceptItem(this, item);
+ a.acceptItem(this, item);
boolean bc = b != null && !(b.block.instantTransfer && source.block.instantTransfer) &&
- b.acceptItem(this, item);
+ b.acceptItem(this, item);
if(ac && !bc){
to = a;
diff --git a/src/omaloon/world/blocks/environment/CustomShapeProp.java b/src/omaloon/world/blocks/environment/CustomShapeProp.java
index b75a9e04..322e1068 100644
--- a/src/omaloon/world/blocks/environment/CustomShapeProp.java
+++ b/src/omaloon/world/blocks/environment/CustomShapeProp.java
@@ -100,14 +100,14 @@ public void drawBase(Tile tile){
if(multiProp != null){
Draw.z(layer);
if(drawUnder) Draw.rect(underRegions[multiProp.shape],
- tile.worldx() + spriteOffsets[multiProp.shape].x,
- tile.worldy() + spriteOffsets[multiProp.shape].y,
- rotateRegions ? Mathf.randomSeed(tile.pos() + 1, 0, 4) * 90f : 0f
+ tile.worldx() + spriteOffsets[multiProp.shape].x,
+ tile.worldy() + spriteOffsets[multiProp.shape].y,
+ rotateRegions ? Mathf.randomSeed(tile.pos() + 1, 0, 4) * 90f : 0f
);
Draw.rect(variantRegions[multiProp.shape],
- tile.worldx() + spriteOffsets[multiProp.shape].x,
- tile.worldy() + spriteOffsets[multiProp.shape].y,
- rotateRegions ? Mathf.randomSeed(tile.pos(), -rotateRegionMagnitude, rotateRegionMagnitude) : 0f
+ tile.worldx() + spriteOffsets[multiProp.shape].x,
+ tile.worldy() + spriteOffsets[multiProp.shape].y,
+ rotateRegions ? Mathf.randomSeed(tile.pos(), -rotateRegionMagnitude, rotateRegionMagnitude) : 0f
);
}
}
@@ -117,8 +117,8 @@ public void drawShadow(Tile tile){
MultiPropGroup multiProp = CustomShapePropProcess.instance.multiProps.find(multiPropGroup -> multiPropGroup.center == tile);
if(multiProp != null){
Draw.rect(shadows[multiProp.shape],
- tile.worldx() + spriteOffsets[multiProp.shape].x,
- tile.worldy() + spriteOffsets[multiProp.shape].y
+ tile.worldx() + spriteOffsets[multiProp.shape].x,
+ tile.worldy() + spriteOffsets[multiProp.shape].y
);
}
}
@@ -140,9 +140,9 @@ public void load(){
@Override
public Runnable removed(MultiPropGroup from){
return () -> deconstructEffect.at(
- from.center.worldx() + spriteOffsets[from.shape].x,
- from.center.worldy() + spriteOffsets[from.shape].y,
- 0, mapColor, from
+ from.center.worldx() + spriteOffsets[from.shape].x,
+ from.center.worldy() + spriteOffsets[from.shape].y,
+ 0, mapColor, from
);
}
diff --git a/src/omaloon/world/blocks/environment/CustomShapePropProcess.java b/src/omaloon/world/blocks/environment/CustomShapePropProcess.java
index 41208d39..7af6bf15 100644
--- a/src/omaloon/world/blocks/environment/CustomShapePropProcess.java
+++ b/src/omaloon/world/blocks/environment/CustomShapePropProcess.java
@@ -14,6 +14,10 @@ public class CustomShapePropProcess implements AsyncProcess{
public Seq multiPropTiles = new Seq<>();
public Seq multiProps = new Seq<>();
+ public static void create() {
+ Vars.asyncCore.processes.add(instance = new CustomShapePropProcess());
+ }
+
@Override
public void init(){
multiPropTiles.clear();
diff --git a/src/omaloon/world/blocks/environment/OlCliff.java b/src/omaloon/world/blocks/environment/OlCliff.java
index 5e6b87ca..4c028404 100644
--- a/src/omaloon/world/blocks/environment/OlCliff.java
+++ b/src/omaloon/world/blocks/environment/OlCliff.java
@@ -37,8 +37,8 @@ public static void processCliffs(){
}
for(int i = 0; i < 4; i++){
if(
- tile.nearby(i).block() instanceof CliffHelper &&
- tile.nearby((i + 1) % 4).block() instanceof CliffHelper
+ tile.nearby(i).block() instanceof CliffHelper &&
+ tile.nearby((i + 1) % 4).block() instanceof CliffHelper
) tile.data = (byte)(i + 9);
}
if(tile.data == 0) tile.setBlock(Blocks.air);
diff --git a/src/omaloon/world/blocks/liquid/PressureLiquidConduit.java b/src/omaloon/world/blocks/liquid/PressureLiquidConduit.java
index 83d6dfe9..eba41ac2 100644
--- a/src/omaloon/world/blocks/liquid/PressureLiquidConduit.java
+++ b/src/omaloon/world/blocks/liquid/PressureLiquidConduit.java
@@ -62,8 +62,8 @@ public void drawPlanRegion(BuildPlan plan, Eachable list){
for(int i = 0; i < 4; i++){
Point2 side = new Point2(plan.x, plan.y).add(Geometry.d4[i]);
if(new Point2(next.x, next.y).equals(side) && (
- (next.block instanceof PressureLiquidConduit || next.block instanceof PressureLiquidPump || next.block instanceof PressureLiquidValve) ?
- (plan.rotation % 2 == i % 2 || next.rotation % 2 == i % 2) : (next.block.outputsLiquid))
+ (next.block instanceof PressureLiquidConduit || next.block instanceof PressureLiquidPump || next.block instanceof PressureLiquidValve) ?
+ (plan.rotation % 2 == i % 2 || next.rotation % 2 == i % 2) : (next.block.outputsLiquid))
){
proximity[i] = next;
break;
@@ -117,10 +117,10 @@ public Block getReplacement(BuildPlan req, Seq plans){
Boolf cont = p -> plans.contains(o -> o.x == req.x + p.x && o.y == req.y + p.y && (req.block instanceof PressureLiquidConduit || req.block instanceof PressureLiquidJunction));
return cont.get(Geometry.d4(req.rotation)) &&
- cont.get(Geometry.d4(req.rotation - 2)) &&
- req.tile() != null &&
- req.tile().block() instanceof PressureLiquidConduit &&
- Mathf.mod(req.build().rotation - req.rotation, 2) == 1 ? junctionReplacement : this;
+ cont.get(Geometry.d4(req.rotation - 2)) &&
+ req.tile() != null &&
+ req.tile().block() instanceof PressureLiquidConduit &&
+ Mathf.mod(req.build().rotation - req.rotation, 2) == 1 ? junctionReplacement : this;
}
@Override
@@ -155,9 +155,9 @@ public boolean acceptsPressurizedFluid(HasPressure from, @Nullable Liquid liquid
@Override
public boolean connects(HasPressure to){
return (
- to instanceof PressureLiquidConduitBuild || to instanceof PressureLiquidValveBuild) ?
- (front() == to || back() == to || to.front() == this || to.back() == this) :
- to != null && HasPressureImpl.super.connects(to);
+ to instanceof PressureLiquidConduitBuild || to instanceof PressureLiquidValveBuild) ?
+ (front() == to || back() == to || to.front() == this || to.back() == this) :
+ to != null && HasPressureImpl.super.connects(to);
}
@Override
@@ -187,7 +187,7 @@ public void onProximityUpdate(){
for(int i = 0; i < 4; i++){
HasPressure build = nearby(i) instanceof HasPressure ? (HasPressure)nearby(i) : null;
if(
- build != null && connected(build)
+ build != null && connected(build)
) tiling |= (1 << i);
}
}
diff --git a/src/omaloon/world/blocks/liquid/PressureLiquidGauge.java b/src/omaloon/world/blocks/liquid/PressureLiquidGauge.java
index b8a108ff..99d3d33e 100644
--- a/src/omaloon/world/blocks/liquid/PressureLiquidGauge.java
+++ b/src/omaloon/world/blocks/liquid/PressureLiquidGauge.java
@@ -109,9 +109,9 @@ public void setBars(){
HasPressure build = (HasPressure)entity;
return new CenterBar(
- () -> Core.bundle.get("bar.pressure") + (build.pressure().getPressure(build.pressure().getMain()) < 0 ? "-" : "+") + Strings.autoFixed(Math.abs(build.pressure().getPressure(build.pressure().getMain())), 2),
- () -> build.pressure().getPressure(build.pressure().getMain()) > 0 ? maxColor : minColor,
- () -> Mathf.map(build.pressure().getPressure(build.pressure().getMain()), pressureConfig.minPressure, pressureConfig.maxPressure, -1, 1)
+ () -> Core.bundle.get("bar.pressure") + (build.pressure().getPressure(build.pressure().getMain()) < 0 ? "-" : "+") + Strings.autoFixed(Math.abs(build.pressure().getPressure(build.pressure().getMain())), 2),
+ () -> build.pressure().getPressure(build.pressure().getMain()) > 0 ? maxColor : minColor,
+ () -> Mathf.map(build.pressure().getPressure(build.pressure().getMain()), pressureConfig.minPressure, pressureConfig.maxPressure, -1, 1)
);
});
}
@@ -135,8 +135,8 @@ public boolean acceptsPressurizedFluid(HasPressure from, @Nullable Liquid liquid
@Override
public boolean connects(HasPressure to){
return HasPressureImpl.super.connects(to) && to instanceof PressureLiquidValve.PressureLiquidValveBuild ?
- (front() == to || back() == to) && (to.front() == this || to.back() == this) :
- (front() == to || back() == to);
+ (front() == to || back() == to) && (to.front() == this || to.back() == this) :
+ (front() == to || back() == to);
}
@Override
@@ -159,18 +159,18 @@ public void draw(){
float p = Mathf.map(pressure().getPressure(pressure().getMain()), pressureConfig.minPressure, pressureConfig.maxPressure, -1, 1);
Draw.color(
- Color.white,
- pressure().getPressure(pressure().getMain()) > 0 ? maxColor : minColor,
- Math.abs(p)
+ Color.white,
+ pressure().getPressure(pressure().getMain()) > 0 ? maxColor : minColor,
+ Math.abs(p)
);
Draw.rect(gaugeRegion,
- x,
- y,
- (rotdeg() + 90) % 180 - 90 + (
- pressure().getPressure(pressure().getMain()) > pressureConfig.maxPressure + 1 ||
- pressure().getPressure(pressure().getMain()) < pressureConfig.minPressure - 1
- ? Mathf.randomSeed((long)Time.time, -360f, 360f) : p * 180f
- )
+ x,
+ y,
+ (rotdeg() + 90) % 180 - 90 + (
+ pressure().getPressure(pressure().getMain()) > pressureConfig.maxPressure + 1 ||
+ pressure().getPressure(pressure().getMain()) < pressureConfig.minPressure - 1
+ ? Mathf.randomSeed((long)Time.time, -360f, 360f) : p * 180f
+ )
);
}
diff --git a/src/omaloon/world/blocks/liquid/PressureLiquidPump.java b/src/omaloon/world/blocks/liquid/PressureLiquidPump.java
index 5c38cdba..c161cc81 100644
--- a/src/omaloon/world/blocks/liquid/PressureLiquidPump.java
+++ b/src/omaloon/world/blocks/liquid/PressureLiquidPump.java
@@ -185,8 +185,8 @@ public void draw(){
HasPressure back = getFrom();
if(
- (front != null && front.pressure().getMain() != null) ||
- (back != null && back.pressure().getMain() != null)
+ (front != null && front.pressure().getMain() != null) ||
+ (back != null && back.pressure().getMain() != null)
){
Color tmpColor = Tmp.c1;
@@ -197,14 +197,14 @@ public void draw(){
}
if(
- front != null && front.pressure().getMain() != null &&
- back != null && back.pressure().getMain() != null
+ front != null && front.pressure().getMain() != null &&
+ back != null && back.pressure().getMain() != null
) tmpColor.lerp(back.pressure().getMain().color, 0.5f);
float alpha =
- (front != null && front.pressure().getMain() != null ? Mathf.clamp(front.pressure().liquids[front.pressure().getMain().id] / (front.pressure().liquids[front.pressure().getMain().id] + front.pressure().air)) : 0) +
- (back != null && back.pressure().getMain() != null ? Mathf.clamp(back.pressure().liquids[back.pressure().getMain().id] / (back.pressure().liquids[back.pressure().getMain().id] + back.pressure().air)) : 0);
+ (front != null && front.pressure().getMain() != null ? Mathf.clamp(front.pressure().liquids[front.pressure().getMain().id] / (front.pressure().liquids[front.pressure().getMain().id] + front.pressure().air)) : 0) +
+ (back != null && back.pressure().getMain() != null ? Mathf.clamp(back.pressure().liquids[back.pressure().getMain().id] / (back.pressure().liquids[back.pressure().getMain().id] + back.pressure().air)) : 0);
alpha /= ((front == null ? 0 : 1f) + (back == null ? 0 : 1f));
smoothAlpha = Mathf.approachDelta(smoothAlpha, alpha, PressureModule.smoothingSpeed);
@@ -304,12 +304,12 @@ public void updateTile(){
float backPressure = back == null ? 0 : back.pressure().getPressure(pumpLiquid);
float maxFlow = OlMath.flowRate(
- backPressure + pressureDifference * chainSize(),
- frontPressure,
- back == null ? 5 : back.pressureConfig().fluidCapacity,
- front == null ? 5 : front.pressureConfig().fluidCapacity,
- OlLiquids.getDensity(pumpLiquid),
- 1
+ backPressure + pressureDifference * chainSize(),
+ frontPressure,
+ back == null ? 5 : back.pressureConfig().fluidCapacity,
+ front == null ? 5 : front.pressureConfig().fluidCapacity,
+ OlLiquids.getDensity(pumpLiquid),
+ 1
);
if(back != null){
@@ -323,9 +323,9 @@ public void updateTile(){
pressure.pressure = 0;
float flow = Mathf.clamp(
- (maxFlow > 0 ? pumpStrength : -pumpStrength) / chainSize() * Time.delta,
- -Math.abs(maxFlow),
- Math.abs(maxFlow)
+ (maxFlow > 0 ? pumpStrength : -pumpStrength) / chainSize() * Time.delta,
+ -Math.abs(maxFlow),
+ Math.abs(maxFlow)
);
if(effectTimer >= effectInterval && !Mathf.zero(flow, 0.001f)){
@@ -346,9 +346,9 @@ public void updateTile(){
functioning = !Mathf.zero(flow, 0.001f);
if(
- front == null || back == null ||
- (front.acceptsPressurizedFluid(back, pumpLiquid, flow) &&
- back.outputsPressurizedFluid(front, pumpLiquid, flow))
+ front == null || back == null ||
+ (front.acceptsPressurizedFluid(back, pumpLiquid, flow) &&
+ back.outputsPressurizedFluid(front, pumpLiquid, flow))
){
effectTimer += edelta();
if(front != null) front.addFluid(pumpLiquid, flow);
diff --git a/src/omaloon/world/blocks/liquid/PressureLiquidValve.java b/src/omaloon/world/blocks/liquid/PressureLiquidValve.java
index b5cf3622..f858a528 100644
--- a/src/omaloon/world/blocks/liquid/PressureLiquidValve.java
+++ b/src/omaloon/world/blocks/liquid/PressureLiquidValve.java
@@ -149,8 +149,8 @@ public boolean acceptsPressurizedFluid(HasPressure from, @Nullable Liquid liquid
@Override
public boolean connects(HasPressure to){
return HasPressureImpl.super.connects(to) && to instanceof PressureLiquidValveBuild ?
- (front() == to || back() == to) && (to.front() == this || to.back() == this) :
- (front() == to || back() == to);
+ (front() == to || back() == to) && (to.front() == this || to.back() == this) :
+ (front() == to || back() == to);
}
@Override
@@ -209,24 +209,24 @@ public void updatePressure(){
if(pressureAmount < openMin){
effectInterval += delta();
addFluid(null, Math.min(openMin - pressureAmount, OlMath.flowRate(
- 0,
- pressureAmount,
- 5,
- pressureConfig.fluidCapacity,
- OlLiquids.getDensity(null),
- OlLiquids.getViscosity(null)
+ 0,
+ pressureAmount,
+ 5,
+ pressureConfig.fluidCapacity,
+ OlLiquids.getDensity(null),
+ OlLiquids.getViscosity(null)
)));
draining = Mathf.approachDelta(draining, 1, 0.014f);
}
if(pressureAmount > openMax){
effectInterval += delta();
removeFluid(pressure.getMain(), Math.min(pressureAmount - openMax, OlMath.flowRate(
- pressureAmount,
- 0,
- pressureConfig.fluidCapacity,
- 5,
- OlLiquids.getDensity(null),
- OlLiquids.getViscosity(null)
+ pressureAmount,
+ 0,
+ pressureConfig.fluidCapacity,
+ 5,
+ OlLiquids.getDensity(null),
+ OlLiquids.getViscosity(null)
)));
draining = Mathf.approachDelta(draining, 1, 0.014f);
}
diff --git a/src/omaloon/world/blocks/power/ImpulseNode.java b/src/omaloon/world/blocks/power/ImpulseNode.java
index dabf0667..d3ab691f 100644
--- a/src/omaloon/world/blocks/power/ImpulseNode.java
+++ b/src/omaloon/world/blocks/power/ImpulseNode.java
@@ -53,14 +53,14 @@ public void draw(){
Building other = otherTile.build;
if(other != null){
float angle1 = Angles.angle(x, y, other.x, other.y),
- vx = Mathf.cosDeg(angle1), vy = Mathf.sinDeg(angle1),
- len1 = size * tilesize / 2f - 1.5f, len2 = other.block.size * tilesize / 2f - 1.5f;
+ vx = Mathf.cosDeg(angle1), vy = Mathf.sinDeg(angle1),
+ len1 = size * tilesize / 2f - 1.5f, len2 = other.block.size * tilesize / 2f - 1.5f;
lightning(x + vx * len1, y + vy * len1,
- other.x - vx * len2, other.y - vy * len2,
- 2, Mathf.random(-8f, 8f),
- laserColor2.cpy().lerp(laserColor1, power.graph.getSatisfaction()).a(Renderer.laserOpacity),
- Fx.lightning.layer(Layer.power));
+ other.x - vx * len2, other.y - vy * len2,
+ 2, Mathf.random(-8f, 8f),
+ laserColor2.cpy().lerp(laserColor1, power.graph.getSatisfaction()).a(Renderer.laserOpacity),
+ Fx.lightning.layer(Layer.power));
}
}
}
diff --git a/src/omaloon/world/blocks/power/WindGenerator.java b/src/omaloon/world/blocks/power/WindGenerator.java
index d3e6603e..204e665e 100644
--- a/src/omaloon/world/blocks/power/WindGenerator.java
+++ b/src/omaloon/world/blocks/power/WindGenerator.java
@@ -46,10 +46,10 @@ public void drawOverlay(float x, float y, int rotation){
x -= size / 2f;
y -= size / 2f;
Drawm.dashPoly(size / 8f, Pal.accent,
- x, y,
- x + size, y,
- x + size, y + size,
- x, y + size);
+ x, y,
+ x + size, y,
+ x + size, y + size,
+ x, y + size);
}
@Override
@@ -88,7 +88,7 @@ public boolean intersectsSpacing(int sx, int sy, int ox, int oy, int ext){ //TOD
int sizeOffset = 1 - (size & 1);
return ox >= sx + sizeOffset - spacingOffset && ox <= sx + spacingOffset &&
- oy >= sy + sizeOffset - spacingOffset && oy <= sy + spacingOffset;
+ oy >= sy + sizeOffset - spacingOffset && oy <= sy + spacingOffset;
}
public boolean intersectsSpacing(Tile self, Tile other){
diff --git a/src/omaloon/world/blocks/sandbox/PressureLiquidSource.java b/src/omaloon/world/blocks/sandbox/PressureLiquidSource.java
index 2e8c997f..ee2dc4da 100644
--- a/src/omaloon/world/blocks/sandbox/PressureLiquidSource.java
+++ b/src/omaloon/world/blocks/sandbox/PressureLiquidSource.java
@@ -82,9 +82,9 @@ public void setBars(){
HasPressure build = (HasPressure)entity;
return new CenterBar(
- () -> Core.bundle.get("bar.pressure") + (build.pressure().getPressure(build.pressure().getMain()) < 0 ? "-" : "+") + Strings.autoFixed(Math.abs(build.pressure().getPressure(build.pressure().getMain())), 2),
- () -> Color.white,
- () -> Mathf.map(build.pressure().getPressure(build.pressure().getMain()), pressureConfig.minPressure, pressureConfig.maxPressure, -1, 1)
+ () -> Core.bundle.get("bar.pressure") + (build.pressure().getPressure(build.pressure().getMain()) < 0 ? "-" : "+") + Strings.autoFixed(Math.abs(build.pressure().getPressure(build.pressure().getMain())), 2),
+ () -> Color.white,
+ () -> Mathf.map(build.pressure().getPressure(build.pressure().getMain()), pressureConfig.minPressure, pressureConfig.maxPressure, -1, 1)
);
});
}
@@ -104,35 +104,35 @@ public void buildConfiguration(Table cont){
cont.table(Styles.black6, table -> {
table.pane(Styles.smallPane, liquids -> Vars.content.liquids().each(liquid -> {
Button button = liquids.button(
- new TextureRegionDrawable(liquid.uiIcon),
- new ImageButtonStyle(){{
- over = Styles.flatOver;
- down = checked = Tex.flatDownBase;
- }}, () -> {
- if(this.liquid != liquid.id){
- configure(new SourceEntry(){{
- fluid = liquid;
- amount = targetAmount;
- }});
- }else{
- configure(new SourceEntry(){{
- fluid = null;
- amount = targetAmount;
- }});
+ new TextureRegionDrawable(liquid.uiIcon),
+ new ImageButtonStyle(){{
+ over = Styles.flatOver;
+ down = checked = Tex.flatDownBase;
+ }}, () -> {
+ if(this.liquid != liquid.id){
+ configure(new SourceEntry(){{
+ fluid = liquid;
+ amount = targetAmount;
+ }});
+ }else{
+ configure(new SourceEntry(){{
+ fluid = null;
+ amount = targetAmount;
+ }});
+ }
}
- }
).tooltip(liquid.localizedName).size(40f).get();
button.update(() -> button.setChecked(liquid.id == this.liquid));
if((Vars.content.liquids().indexOf(liquid) + 1) % 4 == 0) liquids.row();
})).maxHeight(160f).row();
table.add("@filter.option.amount").padTop(5f).padBottom(5f).row();
table.field(
- "" + targetAmount,
- (field, c) -> Character.isDigit(c) || ((!field.getText().contains(".")) && c == '.') || (field.getText().isEmpty() && c == '-'),
- s -> configure(new SourceEntry(){{
- fluid = Vars.content.liquid(liquid);
- amount = Strings.parseFloat(s, 0f);
- }})
+ "" + targetAmount,
+ (field, c) -> Character.isDigit(c) || ((!field.getText().contains(".")) && c == '.') || (field.getText().isEmpty() && c == '-'),
+ s -> configure(new SourceEntry(){{
+ fluid = Vars.content.liquid(liquid);
+ amount = Strings.parseFloat(s, 0f);
+ }})
);
}).margin(5f);
}
diff --git a/src/omaloon/world/consumers/ConsumeFluid.java b/src/omaloon/world/consumers/ConsumeFluid.java
index 09e361ad..969050be 100644
--- a/src/omaloon/world/consumers/ConsumeFluid.java
+++ b/src/omaloon/world/consumers/ConsumeFluid.java
@@ -74,16 +74,16 @@ public void display(Stats stats){
if(startRange != endRange){
stats.add(
- OlStats.pressureRange,
- Core.bundle.get("stat.omaloon-pressure-range.format"),
- (startRange == 0 ? "" : (startRange > 0 ? "+" : "-")) + Strings.autoFixed(Math.abs(startRange), 2),
- (endRange == 0 ? "" : (endRange > 0 ? "+" : "-")) + Strings.autoFixed(Math.abs(endRange), 2)
+ OlStats.pressureRange,
+ Core.bundle.get("stat.omaloon-pressure-range.format"),
+ (startRange == 0 ? "" : (startRange > 0 ? "+" : "-")) + Strings.autoFixed(Math.abs(startRange), 2),
+ (endRange == 0 ? "" : (endRange > 0 ? "+" : "-")) + Strings.autoFixed(Math.abs(endRange), 2)
);
if(hasOptimalPressure) stats.add(
- OlStats.optimalPressure,
- Core.bundle.get("stat.omaloon-optimal-pressure.format"),
- (optimalPressure == 0 ? "" : (optimalPressure > 0 ? "+" : "-")) + Strings.autoFixed(Math.abs(optimalPressure), 2),
- Strings.autoFixed(efficiencyMultiplier * 100f, 2)
+ OlStats.optimalPressure,
+ Core.bundle.get("stat.omaloon-optimal-pressure.format"),
+ (optimalPressure == 0 ? "" : (optimalPressure > 0 ? "+" : "-")) + Strings.autoFixed(Math.abs(optimalPressure), 2),
+ Strings.autoFixed(efficiencyMultiplier * 100f, 2)
);
}
}
diff --git a/src/omaloon/world/interfaces/HasPressure.java b/src/omaloon/world/interfaces/HasPressure.java
index f1ba4f9a..14be3f5c 100644
--- a/src/omaloon/world/interfaces/HasPressure.java
+++ b/src/omaloon/world/interfaces/HasPressure.java
@@ -60,11 +60,11 @@ default HasPressure getPressureDestination(HasPressure from, float pressure){
*/
default Seq nextBuilds(){
return proximity().select(
- b -> b instanceof HasPressure
+ b -> b instanceof HasPressure
).as().map(
- b -> b.getPressureDestination(this, 0)
+ b -> b.getPressureDestination(this, 0)
).removeAll(
- b -> !connected(b) && proximity().contains((Building)b) || !pressureConfig().isAllowed(b.block())
+ b -> !connected(b) && proximity().contains((Building)b) || !pressureConfig().isAllowed(b.block())
);
}
diff --git a/src/omaloon/world/meta/OlStats.java b/src/omaloon/world/meta/OlStats.java
index 984f9ea5..201e38f2 100644
--- a/src/omaloon/world/meta/OlStats.java
+++ b/src/omaloon/world/meta/OlStats.java
@@ -15,8 +15,8 @@ public class OlStats{
public static final StatCat pressure = new StatCat("omaloon-pressure");
public static final Stat
- minSpeed = new Stat("omaloon-min-speed"),
- maxSpeed = new Stat("omaloon-max-speed"),
+ minSpeed = new Stat("omaloon-min-speed"),
+ maxSpeed = new Stat("omaloon-max-speed"),
fluidCapacity = new Stat("omaloon-fluid-capacity", StatCat.liquids),
@@ -25,22 +25,22 @@ public class OlStats{
pressureFlow = new Stat("omaloon-pressureflow", pressure),
pumpStrength = new Stat("omaloon-pump-strength", pressure),
- pressureGradient = new Stat("omaloon-pressure-gradient", pressure),
+ pressureGradient = new Stat("omaloon-pressure-gradient", pressure),
maxPressure = new Stat("omaloon-max-pressure", pressure),
- minPressure = new Stat("omaloon-min-pressure", pressure),
+ minPressure = new Stat("omaloon-min-pressure", pressure),
pressureRange = new Stat("omaloon-pressure-range", pressure),
- optimalPressure = new Stat("omaloon-optimal-pressure", pressure);
+ optimalPressure = new Stat("omaloon-optimal-pressure", pressure);
public static final StatUnit
- blocksCubed = new StatUnit("omaloon-blocks-cubed"),
+ blocksCubed = new StatUnit("omaloon-blocks-cubed"),
densityUnit = new StatUnit("omaloon-density-unit", "\uC357"),
- viscosityUnit = new StatUnit("omaloon-viscosity-unit", "\uC357"),
+ viscosityUnit = new StatUnit("omaloon-viscosity-unit", "\uC357"),
pressureUnit = new StatUnit("omaloon-pressure-unit", "\uC357"),
- pressureSecond = new StatUnit("omaloon-pressureSecond", "\uC357");
+ pressureSecond = new StatUnit("omaloon-pressureSecond", "\uC357");
public static StatValue fluid(@Nullable Liquid liquid, float amount, float time, boolean showContinuous){
return table -> {
diff --git a/src/omaloon/world/meta/PressureConfig.java b/src/omaloon/world/meta/PressureConfig.java
index 4e4662de..7482405d 100644
--- a/src/omaloon/world/meta/PressureConfig.java
+++ b/src/omaloon/world/meta/PressureConfig.java
@@ -70,11 +70,11 @@ public class PressureConfig{
* Always allowed block types
*/
private static final Class>[] alwaysAllowed = {
- PressureLiquidBridge.class,
- PressureLiquidConduit.class,
- PressureLiquidJunction.class,
- PressureLiquidPump.class,
- PressureLiquidValve.class
+ PressureLiquidBridge.class,
+ PressureLiquidConduit.class,
+ PressureLiquidJunction.class,
+ PressureLiquidPump.class,
+ PressureLiquidValve.class
};
public void addStats(Stats stats){
@@ -109,27 +109,27 @@ public void addBars(Block block){
// }
// ));
block.addBar("pressure-liquid", (Building entity) -> new Bar(
- () -> {
- HasPressure build = (HasPressure)entity;
- Liquid current = build.pressure().getMain();
+ () -> {
+ HasPressure build = (HasPressure)entity;
+ Liquid current = build.pressure().getMain();
- if(current == null) return Core.bundle.get("bar.air") + Strings.autoFixed(build.pressure().air, 2);
- return Core.bundle.format("bar.pressure-liquid",
- current.localizedName,
- Strings.autoFixed(build.pressure().liquids[current.id], 2),
- Strings.autoFixed(build.pressure().air, 2)
- );
- },
- () -> {
- HasPressure build = (HasPressure)entity;
- Liquid current = build.pressure().getMain();
- return current != null ? current.color : Color.lightGray;
- },
- () -> {
- HasPressure build = (HasPressure)entity;
- Liquid current = build.pressure().getMain();
- return current != null ? Mathf.clamp(build.pressure().liquids[current.id] / (build.pressure().liquids[current.id] + build.pressure().air)) : 0;
- }
+ if(current == null) return Core.bundle.get("bar.air") + Strings.autoFixed(build.pressure().air, 2);
+ return Core.bundle.format("bar.pressure-liquid",
+ current.localizedName,
+ Strings.autoFixed(build.pressure().liquids[current.id], 2),
+ Strings.autoFixed(build.pressure().air, 2)
+ );
+ },
+ () -> {
+ HasPressure build = (HasPressure)entity;
+ Liquid current = build.pressure().getMain();
+ return current != null ? current.color : Color.lightGray;
+ },
+ () -> {
+ HasPressure build = (HasPressure)entity;
+ Liquid current = build.pressure().getMain();
+ return current != null ? Mathf.clamp(build.pressure().liquids[current.id] / (build.pressure().liquids[current.id] + build.pressure().air)) : 0;
+ }
));
}
diff --git a/src/omaloon/world/meta/PressureSection.java b/src/omaloon/world/meta/PressureSection.java
index 97502794..be5e4727 100644
--- a/src/omaloon/world/meta/PressureSection.java
+++ b/src/omaloon/world/meta/PressureSection.java
@@ -104,27 +104,27 @@ public void updateTransfer(){
amounts.clear();
for(Entry entry : links){
float flow = OlMath.flowRate(
- entry.value.pressure().getPressure(main),
- entry.key.pressure().getPressure(main),
- entry.value.pressureConfig().fluidCapacity,
- entry.key.pressureConfig().fluidCapacity,
- OlLiquids.getDensity(main),
- OlLiquids.getViscosity(main)
+ entry.value.pressure().getPressure(main),
+ entry.key.pressure().getPressure(main),
+ entry.value.pressureConfig().fluidCapacity,
+ entry.key.pressureConfig().fluidCapacity,
+ OlLiquids.getDensity(main),
+ OlLiquids.getViscosity(main)
) / (2f * links.size);
if(
- (
- flow > 0 ?
- (
- entry.key.acceptsPressurizedFluid(entry.value, main, flow) &&
- entry.value.outputsPressurizedFluid(entry.key, main, flow)
- ) :
- (
- entry.value.acceptsPressurizedFluid(entry.key, main, flow) &&
- entry.key.outputsPressurizedFluid(entry.value, main, flow)
- )
- ) &&
- (entry.key.pressure().get(main) > 0 || entry.value.pressure().get(main) > 0)
+ (
+ flow > 0 ?
+ (
+ entry.key.acceptsPressurizedFluid(entry.value, main, flow) &&
+ entry.value.outputsPressurizedFluid(entry.key, main, flow)
+ ) :
+ (
+ entry.value.acceptsPressurizedFluid(entry.key, main, flow) &&
+ entry.key.outputsPressurizedFluid(entry.value, main, flow)
+ )
+ ) &&
+ (entry.key.pressure().get(main) > 0 || entry.value.pressure().get(main) > 0)
){
amounts.add(flow);
}else{
@@ -133,18 +133,18 @@ public void updateTransfer(){
}
for(Entry entry : links){
float maxFlow = OlMath.flowRate(
- entry.value.pressure().getPressure(main),
- entry.key.pressure().getPressure(main),
- entry.value.pressureConfig().fluidCapacity,
- entry.key.pressureConfig().fluidCapacity,
- OlLiquids.getDensity(main),
- 1
+ entry.value.pressure().getPressure(main),
+ entry.key.pressure().getPressure(main),
+ entry.value.pressureConfig().fluidCapacity,
+ entry.key.pressureConfig().fluidCapacity,
+ OlLiquids.getDensity(main),
+ 1
) / (2f * links.size);
float flow = Mathf.clamp(
- amounts.get(links.indexOf(entry)) * Time.delta,
- -Math.abs(maxFlow),
- Math.abs(maxFlow)
+ amounts.get(links.indexOf(entry)) * Time.delta,
+ -Math.abs(maxFlow),
+ Math.abs(maxFlow)
);
if(flow != 0){
entry.key.addFluid(main, flow);
@@ -155,25 +155,25 @@ public void updateTransfer(){
amounts.clear();
for(Entry entry : links){
float flow = OlMath.flowRate(
- entry.value.pressure().getPressure(null),
- entry.key.pressure().getPressure(null),
- entry.value.pressureConfig().fluidCapacity,
- entry.key.pressureConfig().fluidCapacity,
- OlLiquids.getDensity(null),
- OlLiquids.getViscosity(null)
+ entry.value.pressure().getPressure(null),
+ entry.key.pressure().getPressure(null),
+ entry.value.pressureConfig().fluidCapacity,
+ entry.key.pressureConfig().fluidCapacity,
+ OlLiquids.getDensity(null),
+ OlLiquids.getViscosity(null)
) / (2f * links.size);
if(
- (
- flow > 0 ?
- (
- entry.key.acceptsPressurizedFluid(entry.value, null, flow) &&
- entry.value.outputsPressurizedFluid(entry.key, null, flow)
- ) : (
- entry.value.acceptsPressurizedFluid(entry.key, null, flow) &&
- entry.key.outputsPressurizedFluid(entry.value, null, flow)
- )
- )
+ (
+ flow > 0 ?
+ (
+ entry.key.acceptsPressurizedFluid(entry.value, null, flow) &&
+ entry.value.outputsPressurizedFluid(entry.key, null, flow)
+ ) : (
+ entry.value.acceptsPressurizedFluid(entry.key, null, flow) &&
+ entry.key.outputsPressurizedFluid(entry.value, null, flow)
+ )
+ )
){
amounts.add(flow);
}else{
@@ -182,18 +182,18 @@ public void updateTransfer(){
}
for(Entry entry : links){
float maxFlow = OlMath.flowRate(
- entry.value.pressure().getPressure(null),
- entry.key.pressure().getPressure(null),
- entry.value.pressureConfig().fluidCapacity,
- entry.key.pressureConfig().fluidCapacity,
- OlLiquids.getDensity(null),
- 1
+ entry.value.pressure().getPressure(null),
+ entry.key.pressure().getPressure(null),
+ entry.value.pressureConfig().fluidCapacity,
+ entry.key.pressureConfig().fluidCapacity,
+ OlLiquids.getDensity(null),
+ 1
) / (2f * links.size);
float flow = Mathf.clamp(
- amounts.get(links.indexOf(entry)) * Time.delta,
- -Math.abs(maxFlow),
- Math.abs(maxFlow)
+ amounts.get(links.indexOf(entry)) * Time.delta,
+ -Math.abs(maxFlow),
+ Math.abs(maxFlow)
);
if(flow != 0){
entry.key.addFluid(null, amounts.get(links.indexOf(entry)));