v0.8.0: fixed golden mimics gaining huge stat boosts from save/load

This commit is contained in:
Evan Debenham 2020-03-26 17:39:13 -04:00
parent 432c069691
commit e3d2d12e37
2 changed files with 10 additions and 7 deletions

View File

@ -76,9 +76,8 @@ public class GoldenMimic extends Mimic {
}
@Override
public void adjustStats(int level) {
//FIXME this causes level to keep increasing over save/load
super.adjustStats(Math.round(level*1.33f));
public void setLevel(int level) {
super.setLevel(Math.round(level*1.33f));
}
@Override

View File

@ -85,7 +85,8 @@ public class Mimic extends Mob {
if (bundle.contains( ITEMS )) {
items = new ArrayList<>((Collection<Item>) ((Collection<?>) bundle.getCollection(ITEMS)));
}
adjustStats( bundle.getInt( LEVEL ) );
level = bundle.getInt( LEVEL );
adjustStats(level);
super.restoreFromBundle(bundle);
if (state != PASSIVE && alignment == Alignment.NEUTRAL){
alignment = Alignment.ENEMY;
@ -217,9 +218,12 @@ public class Mimic extends Mob {
}
}
public void adjustStats( int level ) {
public void setLevel( int level ){
this.level = level;
adjustStats(level);
}
public void adjustStats( int level ) {
HP = HT = (1 + level) * 6;
defenseSkill = 2 + level/2;
@ -273,7 +277,7 @@ public class Mimic extends Mob {
}
m.items = new ArrayList<>( items );
m.adjustStats( Dungeon.depth );
m.setLevel( Dungeon.depth );
m.pos = pos;
//generate an extra reward for killing the mimic