V0.2.0: fixed a save/load issue with Cloak of Shadows
This commit is contained in:
parent
b436df4682
commit
f033a2b872
|
@ -378,7 +378,7 @@ public abstract class Char extends Actor {
|
||||||
sprite.add( CharSprite.State.LEVITATING );
|
sprite.add( CharSprite.State.LEVITATING );
|
||||||
} else if (buff instanceof Frost) {
|
} else if (buff instanceof Frost) {
|
||||||
sprite.add( CharSprite.State.FROZEN );
|
sprite.add( CharSprite.State.FROZEN );
|
||||||
} else if (buff instanceof Invisibility) {
|
} else if (buff instanceof Invisibility || buff instanceof CloakOfShadows.cloakStealth) {
|
||||||
if (!(buff instanceof Shadows)) {
|
if (!(buff instanceof Shadows)) {
|
||||||
sprite.showStatus( CharSprite.POSITIVE, "invisible" );
|
sprite.showStatus( CharSprite.POSITIVE, "invisible" );
|
||||||
}
|
}
|
||||||
|
@ -396,7 +396,7 @@ public abstract class Char extends Actor {
|
||||||
sprite.remove( CharSprite.State.BURNING );
|
sprite.remove( CharSprite.State.BURNING );
|
||||||
} else if (buff instanceof Levitation) {
|
} else if (buff instanceof Levitation) {
|
||||||
sprite.remove( CharSprite.State.LEVITATING );
|
sprite.remove( CharSprite.State.LEVITATING );
|
||||||
} else if (buff instanceof Invisibility || buff instanceof CloakOfShadows.cloakStealth && invisible <= 0) {
|
} else if ((buff instanceof Invisibility || buff instanceof CloakOfShadows.cloakStealth) && invisible <= 0) {
|
||||||
sprite.remove( CharSprite.State.INVISIBLE );
|
sprite.remove( CharSprite.State.INVISIBLE );
|
||||||
} else if (buff instanceof Paralysis) {
|
} else if (buff instanceof Paralysis) {
|
||||||
sprite.remove( CharSprite.State.PARALYSED );
|
sprite.remove( CharSprite.State.PARALYSED );
|
||||||
|
@ -424,7 +424,7 @@ public abstract class Char extends Actor {
|
||||||
sprite.add( CharSprite.State.BURNING );
|
sprite.add( CharSprite.State.BURNING );
|
||||||
} else if (buff instanceof Levitation) {
|
} else if (buff instanceof Levitation) {
|
||||||
sprite.add( CharSprite.State.LEVITATING );
|
sprite.add( CharSprite.State.LEVITATING );
|
||||||
} else if (buff instanceof Invisibility) {
|
} else if (buff instanceof Invisibility || buff instanceof CloakOfShadows.cloakStealth) {
|
||||||
sprite.add( CharSprite.State.INVISIBLE );
|
sprite.add( CharSprite.State.INVISIBLE );
|
||||||
} else if (buff instanceof Paralysis) {
|
} else if (buff instanceof Paralysis) {
|
||||||
sprite.add( CharSprite.State.PARALYSED );
|
sprite.add( CharSprite.State.PARALYSED );
|
||||||
|
|
|
@ -96,6 +96,15 @@ public class CloakOfShadows extends Artifact {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void activate(Char ch){
|
||||||
|
super.activate(ch);
|
||||||
|
if (stealthed){
|
||||||
|
activeBuff = activeBuff();
|
||||||
|
activeBuff.attachTo(ch);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -221,15 +230,5 @@ public class CloakOfShadows extends Artifact {
|
||||||
public void restoreFromBundle( Bundle bundle ) {
|
public void restoreFromBundle( Bundle bundle ) {
|
||||||
super.restoreFromBundle(bundle);
|
super.restoreFromBundle(bundle);
|
||||||
stealthed = bundle.getBoolean("stealthed");
|
stealthed = bundle.getBoolean("stealthed");
|
||||||
if (stealthed) {
|
|
||||||
Hero hero = Dungeon.hero;
|
|
||||||
activeBuff = activeBuff();
|
|
||||||
activeBuff.attachTo(hero);
|
|
||||||
if (hero.sprite.parent != null) {
|
|
||||||
hero.sprite.parent.add(new AlphaTweener(hero.sprite, 0.4f, 0.4f));
|
|
||||||
} else {
|
|
||||||
hero.sprite.alpha(0.4f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user