Core zone tutorial hint
This commit is contained in:
@@ -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 ++;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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<Block> placedBlockCount = new ObjectIntMap<>();
|
||||
/** Record of enemy blocks that have been destroyed (from any source) by count. */
|
||||
public ObjectIntMap<Block> 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<Item> coreItemCount = new ObjectIntMap<>();
|
||||
|
||||
public int getPlaced(Block block){
|
||||
return placedBlockCount.get(block, 0);
|
||||
}
|
||||
|
||||
public int getDestroyed(Block block){
|
||||
return destroyedBlockCount.get(block, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user