Bulwark shield mechanics mostly done

This commit is contained in:
Anuken 2022-01-17 13:39:15 -05:00
parent 396c087072
commit 2d19c7ae97
37 changed files with 237 additions and 38 deletions

View file

@ -350,14 +350,23 @@ public class ApplicationTests{
}
@Test
void load(){
void saveLoad(){
world.loadMap(testMap);
Map map = state.map;
float hp = 30f;
Unit unit = UnitTypes.dagger.spawn(Team.sharded, 20f, 30f);
unit.health = hp;
SaveIO.save(saveDirectory.child("0.msav"));
resetWorld();
SaveIO.load(saveDirectory.child("0.msav"));
Unit spawned = Groups.unit.find(u -> u.type == UnitTypes.dagger);
assertNotNull(spawned, "Saved daggers must persist");
assertEquals(hp, spawned.health, "Spawned dagger health must save.");
assertEquals(world.width(), map.width);
assertEquals(world.height(), map.height);
assertTrue(state.teams.playerCores().size > 0);