v1.4.0: magical sight now makes the hero immune to blindness
This commit is contained in:
@@ -22,11 +22,14 @@
|
||||
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
||||
import com.watabou.noosa.Image;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
public class MagicalSight extends FlavourBuff {
|
||||
|
||||
public static final float DURATION = 50f;
|
||||
@@ -51,11 +54,24 @@ public class MagicalSight extends FlavourBuff {
|
||||
public float iconFadePercent() {
|
||||
return Math.max(0, (DURATION - visualcooldown()) / DURATION);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean attachTo(Char target) {
|
||||
if (super.attachTo(target)){
|
||||
Buff.detach(target, Blindness.class);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void detach() {
|
||||
super.detach();
|
||||
Dungeon.observe();
|
||||
GameScene.updateFog();
|
||||
}
|
||||
|
||||
{
|
||||
immunities.add(Blindness.class);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user