v1.4.0: magical sight now makes the hero immune to blindness
This commit is contained in:
+16
@@ -22,11 +22,14 @@
|
|||||||
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
|
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
||||||
import com.watabou.noosa.Image;
|
import com.watabou.noosa.Image;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
|
|
||||||
public class MagicalSight extends FlavourBuff {
|
public class MagicalSight extends FlavourBuff {
|
||||||
|
|
||||||
public static final float DURATION = 50f;
|
public static final float DURATION = 50f;
|
||||||
@@ -52,10 +55,23 @@ public class MagicalSight extends FlavourBuff {
|
|||||||
return Math.max(0, (DURATION - visualcooldown()) / DURATION);
|
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
|
@Override
|
||||||
public void detach() {
|
public void detach() {
|
||||||
super.detach();
|
super.detach();
|
||||||
Dungeon.observe();
|
Dungeon.observe();
|
||||||
GameScene.updateFog();
|
GameScene.updateFog();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
immunities.add(Blindness.class);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user