Sprite cleanup / Stats / More balancing / New events
This commit is contained in:
@@ -2,6 +2,7 @@ package io.anuke.mindustry.game;
|
||||
|
||||
import io.anuke.arc.Events.Event;
|
||||
import io.anuke.mindustry.core.GameState.State;
|
||||
import io.anuke.mindustry.entities.Unit;
|
||||
import io.anuke.mindustry.entities.traits.BuilderTrait;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
|
||||
@@ -81,6 +82,18 @@ public class EventType{
|
||||
}
|
||||
}
|
||||
|
||||
public static class BlockBuildEndEvent implements Event{
|
||||
public final Tile tile;
|
||||
public final Team team;
|
||||
public final boolean breaking;
|
||||
|
||||
public BlockBuildEndEvent(Tile tile, Team team, boolean breaking){
|
||||
this.tile = tile;
|
||||
this.team = team;
|
||||
this.breaking = breaking;
|
||||
}
|
||||
}
|
||||
|
||||
/**Called when a player or drone begins building something.
|
||||
* This does not necessarily happen when a new BuildBlock is created.*/
|
||||
public static class BuildSelectEvent implements Event{
|
||||
@@ -97,6 +110,22 @@ public class EventType{
|
||||
}
|
||||
}
|
||||
|
||||
public static class BlockDestroyEvent implements Event{
|
||||
public final Tile tile;
|
||||
|
||||
public BlockDestroyEvent(Tile tile){
|
||||
this.tile = tile;
|
||||
}
|
||||
}
|
||||
|
||||
public static class UnitDestroyEvent implements Event{
|
||||
public final Unit unit;
|
||||
|
||||
public UnitDestroyEvent(Unit unit){
|
||||
this.unit = unit;
|
||||
}
|
||||
}
|
||||
|
||||
public static class ResizeEvent implements Event{
|
||||
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ public class GlobalData{
|
||||
public void addItem(Item item, int amount){
|
||||
modified = true;
|
||||
items.getAndIncrement(item, 0, amount);
|
||||
state.stats.itemsDelivered.getAndIncrement(item, 0, amount);
|
||||
}
|
||||
|
||||
public boolean hasItems(ItemStack[] stacks){
|
||||
|
||||
23
core/src/io/anuke/mindustry/game/Stats.java
Normal file
23
core/src/io/anuke/mindustry/game/Stats.java
Normal file
@@ -0,0 +1,23 @@
|
||||
package io.anuke.mindustry.game;
|
||||
|
||||
import io.anuke.annotations.Annotations.Serialize;
|
||||
import io.anuke.arc.collection.ObjectIntMap;
|
||||
import io.anuke.mindustry.type.Item;
|
||||
|
||||
@Serialize
|
||||
public class Stats{
|
||||
/**Items delivered to global resoure counter. Zones only.*/
|
||||
public ObjectIntMap<Item> itemsDelivered = new ObjectIntMap<>();
|
||||
/**Enemy (red team) units destroyed.*/
|
||||
public int enemyUnitsDestroyed;
|
||||
/**Total waves lasted.*/
|
||||
public int wavesLasted;
|
||||
/**Total (ms) time lasted in this save/zone.*/
|
||||
public long timeLasted;
|
||||
/**Friendly buildings fully built.*/
|
||||
public int buildingsBuilt;
|
||||
/**Friendly buildings fully deconstructed.*/
|
||||
public int buildingsDeconstructed;
|
||||
/**Friendly buildings destroyed.*/
|
||||
public int buildingsDestroyed;
|
||||
}
|
||||
Reference in New Issue
Block a user