From a6c2718354dc853d6851ca4d0bce7788bda4b80b Mon Sep 17 00:00:00 2001 From: Anuken Date: Tue, 13 Jan 2026 22:50:47 -0500 Subject: [PATCH] Core zone tutorial hint --- core/assets/bundles/bundle.properties | 1 + core/src/mindustry/core/Logic.java | 6 ++++++ core/src/mindustry/game/EventType.java | 2 +- core/src/mindustry/game/GameStats.java | 10 ++++++++++ core/src/mindustry/ui/fragments/HintsFragment.java | 4 ++++ 5 files changed, 22 insertions(+), 1 deletion(-) diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index b8bcb1cdff..f7aa626580 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -2130,6 +2130,7 @@ hint.waveFire = [accent]Wave[] turrets with water as ammunition will automatical hint.generator = :combustion-generator: [accent]Combustion Generators[] burn coal and transmit power to adjacent blocks.\n\nPower transmission range can be extended with :power-node: [accent]Power Nodes[]. hint.guardian = [accent]Guardian[] units are armored. Weak ammo such as [accent]Copper[] and [accent]Lead[] is [scarlet]not effective[].\n\nUse higher tier turrets or :graphite: [accent]Graphite[] :duo:Duo/:salvo:Salvo ammunition to take Guardians down. hint.coreUpgrade = Cores can be upgraded by [accent]placing higher-tier cores over them[].\n\nPlace a :core-foundation: [accent]Foundation[] core over the :core-shard: [accent]Shard[] core. Make sure it is free from nearby obstructions. +hint.serpuloCoreZone = Additional cores may be constructed on :core-zone: [accent]Core Zone[] tiles. hint.cannotUpgrade = A [red]:tree:[] icon over a payload unit indicates that its upgraded version is not researched yet.\n\nUnit upgrades must be researched in the [accent]:tree: tech tree[] before they can be produced in reconstructors. hint.presetLaunch = Gray [accent]landing zone sectors[], such as [accent]Frozen Forest[], can be launched to from anywhere. They do not require capture of nearby territory.\n\n[accent]Numbered sectors[], such as this one, are [accent]optional[]. hint.presetDifficulty = This sector has a [scarlet]high enemy threat level[].\nLaunching to such sectors is [accent]not recommended[] without proper technology and preparation. diff --git a/core/src/mindustry/core/Logic.java b/core/src/mindustry/core/Logic.java index 32c0191b48..ebbda4bd45 100644 --- a/core/src/mindustry/core/Logic.java +++ b/core/src/mindustry/core/Logic.java @@ -172,6 +172,12 @@ public class Logic implements ApplicationListener{ } }); + Events.on(BlockDestroyEvent.class, e -> { + if(e.tile.team() != state.rules.defaultTeam){ + state.stats.destroyedBlockCount.increment(e.tile.block()); + } + }); + Events.on(UnitDestroyEvent.class, e -> { if(e.unit.team() != state.rules.defaultTeam){ state.stats.enemyUnitsDestroyed ++; diff --git a/core/src/mindustry/game/EventType.java b/core/src/mindustry/game/EventType.java index 30f529a346..ce7befacc3 100644 --- a/core/src/mindustry/game/EventType.java +++ b/core/src/mindustry/game/EventType.java @@ -555,7 +555,7 @@ public class EventType{ } /** Called right before a block is destroyed. - * The tile entity of the tile in this event cannot be null when this happens.*/ + * The building of the tile in this event cannot be null when this happens.*/ public static class BlockDestroyEvent{ public final Tile tile; diff --git a/core/src/mindustry/game/GameStats.java b/core/src/mindustry/game/GameStats.java index a96fd80f8e..2ed099532d 100644 --- a/core/src/mindustry/game/GameStats.java +++ b/core/src/mindustry/game/GameStats.java @@ -19,9 +19,19 @@ public class GameStats{ public int unitsCreated; /** Record of blocks that have been placed by count. Used for objectives only. */ public ObjectIntMap placedBlockCount = new ObjectIntMap<>(); + /** Record of enemy blocks that have been destroyed (from any source) by count. */ + public ObjectIntMap destroyedBlockCount = new ObjectIntMap<>(); /** * Record of items that have entered the core through transport blocks. Used for objectives only. * This can easily be ""spoofed"" with unloaders, so don't use it for anything remotely important. * */ public ObjectIntMap coreItemCount = new ObjectIntMap<>(); + + public int getPlaced(Block block){ + return placedBlockCount.get(block, 0); + } + + public int getDestroyed(Block block){ + return destroyedBlockCount.get(block, 0); + } } diff --git a/core/src/mindustry/ui/fragments/HintsFragment.java b/core/src/mindustry/ui/fragments/HintsFragment.java index 5cc86f87df..d5326090fa 100644 --- a/core/src/mindustry/ui/fragments/HintsFragment.java +++ b/core/src/mindustry/ui/fragments/HintsFragment.java @@ -196,6 +196,10 @@ public class HintsFragment{ && state.rules.defaultTeam.core().block == Blocks.coreShard && state.rules.defaultTeam.core().items.has(Blocks.coreFoundation.requirements), () -> ui.hints.placedBlocks.contains(Blocks.coreFoundation)), + serpuloCoreZone(() -> state.isCampaign() && state.getPlanet() == Planets.serpulo && Vars.indexer.isBlockPresent(Blocks.coreZone) && + (!state.rules.attackMode || state.stats.getDestroyed(Blocks.coreShard) + state.stats.getDestroyed(Blocks.coreFoundation) + state.stats.getDestroyed(Blocks.coreNucleus) > 0), + () -> state.rules.defaultTeam.cores().size > 1), + presetLaunch(() -> state.isCampaign() && state.getSector().preset == null, () -> state.isCampaign() && state.getSector().preset == SectorPresets.frozenForest),