Sprite cleanup / Stats / More balancing / New events

This commit is contained in:
Anuken
2019-01-17 15:30:50 -05:00
parent ccc20a9716
commit c6af151bf3
89 changed files with 1144 additions and 1047 deletions

View File

@@ -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{
}

View File

@@ -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){

View 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;
}