diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index c2ae3c0d2d..b479a2ad8c 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -1721,6 +1721,8 @@ hint.presetLaunch = Gray [accent]landing zone sectors[], such as [accent]Frozen hint.presetDifficulty = This sector has a [scarlet]high enemy threat level[].\nLaunching to such sectors is [accent]not recommended[] without proper technology and preparation. hint.coreIncinerate = After the core is filled to capacity with an item, any extra items of that type it receives will be [accent]incinerated[]. hint.coopCampaign = When playing the [accent]co-op campaign[], items that are produced in the current map will also be sent [accent]to your local sectors[].\n\nAny new research done by the host also carries over. +hint.factoryControl = To set a unit factory's [accent]output destination[], click a factory block while in command mode, then right-click a location.\nUnits produced by it will automatically move there. +hint.factoryControl.mobile = To set a unit factory's [accent]output destination[], tap a factory block while in command mode, then tap a location.\nUnits produced by it will automatically move there. item.copper.description = Used in all types of construction and ammunition. item.copper.details = Copper. Abnormally abundant metal on Serpulo. Structurally weak unless reinforced. diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index 7744f77927..dc6040ffae 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -446,7 +446,6 @@ public class Blocks{ }}; redIce = new Floor("red-ice"){{ - //TODO red ice boulder dragMultiplier = 0.4f; speedMultiplier = 0.9f; attributes.set(Attribute.water, 0.4f); @@ -458,9 +457,9 @@ public class Blocks{ liquidDrop = Liquids.arkycite; liquidMultiplier = 1.5f; isLiquid = true; - //TODO status, cache layer for this crap - status = StatusEffects.wet; - statusDuration = 120f; + //TODO no status for now + //status = StatusEffects.slow; + //statusDuration = 120f; drownTime = 200f; cacheLayer = CacheLayer.arkycite; albedo = 0.9f; @@ -470,7 +469,6 @@ public class Blocks{ variants = 3; }}; - //TODO different vent colors rhyoliteVent = new SteamVent("rhyolite-vent"){{ parent = blendGroup = rhyolite; attributes.set(Attribute.steam, 1f); diff --git a/core/src/mindustry/game/EventType.java b/core/src/mindustry/game/EventType.java index 790cd1d07e..4ff085d3f4 100644 --- a/core/src/mindustry/game/EventType.java +++ b/core/src/mindustry/game/EventType.java @@ -1,5 +1,6 @@ package mindustry.game; +import arc.math.geom.*; import arc.util.*; import mindustry.core.GameState.*; import mindustry.ctype.*; @@ -267,6 +268,18 @@ public class EventType{ } } + public static class BuildingCommandEvent{ + public final Player player; + public final Building building; + public final Vec2 position; + + public BuildingCommandEvent(Player player, Building building, Vec2 position){ + this.player = player; + this.building = building; + this.position = position; + } + } + public static class GameOverEvent{ public final Team winner; diff --git a/core/src/mindustry/input/InputHandler.java b/core/src/mindustry/input/InputHandler.java index 30c295a58f..d27975e0bc 100644 --- a/core/src/mindustry/input/InputHandler.java +++ b/core/src/mindustry/input/InputHandler.java @@ -260,6 +260,8 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ if(!state.isPaused() && player == Vars.player){ Fx.moveCommand.at(target); } + + Events.fire(new BuildingCommandEvent(player, build, target)); } @Remote(called = Loc.server, targets = Loc.both, forward = true) diff --git a/core/src/mindustry/type/weapons/RepairBeamWeapon.java b/core/src/mindustry/type/weapons/RepairBeamWeapon.java index 6e96d1fad1..dad2e34abd 100644 --- a/core/src/mindustry/type/weapons/RepairBeamWeapon.java +++ b/core/src/mindustry/type/weapons/RepairBeamWeapon.java @@ -168,10 +168,10 @@ public class RepairBeamWeapon extends Weapon{ wx = unit.x + Angles.trnsx(weaponRotation, x, y), wy = unit.y + Angles.trnsy(weaponRotation, x, y); - float z = Draw.z(); - RepairTurret.drawBeam(wx, wy, unit.rotation + mount.rotation, shootY, unit.id, mount.target == null || controllable ? null : (Sized)mount.target, unit.team, heal.strength, - pulseStroke, pulseRadius, beamWidth + Mathf.absin(widthSinScl, widthSinMag), heal.lastEnd, heal.offset, laserColor, laserTopColor, - laser, laserEnd, laserTop, laserTopEnd); + float z = Draw.z(); + RepairTurret.drawBeam(wx, wy, unit.rotation + mount.rotation, shootY, unit.id, mount.target == null || controllable ? null : (Sized)mount.target, unit.team, heal.strength, + pulseStroke, pulseRadius, beamWidth + Mathf.absin(widthSinScl, widthSinMag), heal.lastEnd, heal.offset, laserColor, laserTopColor, + laser, laserEnd, laserTop, laserTopEnd); Draw.z(z); } } diff --git a/core/src/mindustry/ui/fragments/HintsFragment.java b/core/src/mindustry/ui/fragments/HintsFragment.java index 2101ed15fb..dc3ee10a35 100644 --- a/core/src/mindustry/ui/fragments/HintsFragment.java +++ b/core/src/mindustry/ui/fragments/HintsFragment.java @@ -12,12 +12,13 @@ import arc.struct.*; import arc.util.*; import mindustry.*; import mindustry.content.*; -import mindustry.game.*; import mindustry.game.EventType.*; +import mindustry.game.*; import mindustry.gen.*; import mindustry.input.*; import mindustry.ui.*; import mindustry.world.*; +import mindustry.world.blocks.payloads.PayloadBlock.*; import mindustry.world.meta.*; import static mindustry.Vars.*; @@ -38,7 +39,7 @@ public class HintsFragment{ public void build(Group parent){ group.setFillParent(true); group.touchable = Touchable.childrenOnly; - //TODO hints off for now. + //TODO hints off for now - figure out tutorial system. group.visibility = () -> !state.isCampaign() && Core.settings.getBool("hints", true) && ui.hudfrag.shown; group.update(() -> { if(current != null){ @@ -83,6 +84,11 @@ public class HintsFragment{ events.clear(); }); + Events.on(BuildingCommandEvent.class, e -> { + if(e.building instanceof PayloadBlockBuild){ + events.add("factorycontrol"); + } + }); } void checkNext(){ @@ -170,6 +176,8 @@ public class HintsFragment{ waveFire(() -> Groups.fire.size() > 0 && Blocks.wave.unlockedNow(), () -> indexer.getFlagged(state.rules.defaultTeam, BlockFlag.extinguisher).size > 0), generator(() -> control.input.block == Blocks.combustionGenerator, () -> ui.hints.placedBlocks.contains(Blocks.combustionGenerator)), guardian(() -> state.boss() != null && state.boss().armor >= 4, () -> state.boss() == null), + factoryControl(() -> !(state.isCampaign() && state.rules.sector.preset == SectorPresets.onset) && + state.rules.defaultTeam.data().getBuildings(Blocks.tankFabricator).size + state.rules.defaultTeam.data().getBuildings(Blocks.groundFactory).size > 0, () -> ui.hints.events.contains("factorycontrol")), coreUpgrade(() -> state.isCampaign() && Blocks.coreFoundation.unlocked() && state.rules.defaultTeam.core() != null && state.rules.defaultTeam.core().block == Blocks.coreShard diff --git a/core/src/mindustry/world/blocks/sandbox/LiquidVoid.java b/core/src/mindustry/world/blocks/sandbox/LiquidVoid.java index 6f25ac1bfc..ef2c62c341 100644 --- a/core/src/mindustry/world/blocks/sandbox/LiquidVoid.java +++ b/core/src/mindustry/world/blocks/sandbox/LiquidVoid.java @@ -14,6 +14,7 @@ public class LiquidVoid extends Block{ update = true; group = BlockGroup.liquids; envEnabled = Env.any; + liquidCapacity = 10000f; } @Override