v3.1.0: fixed magical sleep not cancelling sleep state on allies

This commit is contained in:
Evan Debenham
2025-04-01 13:25:12 -04:00
parent e378152da8
commit 2fd975707d

View File

@@ -43,6 +43,7 @@ public class MagicalSleep extends Buff {
if (target.HP == target.HT) {
if (target instanceof Hero) GLog.i(Messages.get(this, "toohealthy"));
detach();
return true;
} else {
if (target instanceof Hero) GLog.i(Messages.get(this, "fallasleep"));
}
@@ -78,10 +79,14 @@ public class MagicalSleep extends Buff {
@Override
public void detach() {
if (target.paralysed > 0)
if (target.paralysed > 0) {
target.paralysed--;
if (target instanceof Hero)
}
if (target instanceof Hero) {
((Hero) target).resting = false;
} else if (target instanceof Mob && target.alignment == Char.Alignment.ALLY && ((Mob) target).state == ((Mob) target).SLEEPING){
((Mob) target).state = ((Mob) target).WANDERING;
}
super.detach();
}