V0.2.0: Corrected a bug from the source involving free hits on game loads
This commit is contained in:
parent
cce6e8dfa0
commit
69e82d475d
|
@ -84,6 +84,7 @@ public abstract class Mob extends Char {
|
|||
};
|
||||
|
||||
private static final String STATE = "state";
|
||||
private static final String SEEN = "seen";
|
||||
private static final String TARGET = "target";
|
||||
|
||||
@Override
|
||||
|
@ -92,6 +93,7 @@ public abstract class Mob extends Char {
|
|||
super.storeInBundle( bundle );
|
||||
|
||||
bundle.put( STATE, state.toString() );
|
||||
bundle.put( SEEN, enemySeen);
|
||||
if (state != State.SLEEPING) {
|
||||
bundle.put( TARGET, target );
|
||||
}
|
||||
|
@ -103,6 +105,7 @@ public abstract class Mob extends Char {
|
|||
super.restoreFromBundle( bundle );
|
||||
|
||||
state = State.valueOf( bundle.getString( STATE ) );
|
||||
enemySeen = bundle.getBoolean( SEEN );
|
||||
if (state != State.SLEEPING) {
|
||||
target = bundle.getInt( TARGET );
|
||||
}
|
||||
|
@ -388,9 +391,10 @@ public abstract class Mob extends Char {
|
|||
if (penalty != 0)
|
||||
defenseSkill *= Math.pow(0.75, penalty);
|
||||
return defenseSkill;
|
||||
} else
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int defenseProc( Char enemy, int damage ) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user