v3.0.0: fixed runestones working with magic immune buff

This commit is contained in:
Evan Debenham
2024-11-17 15:32:16 -05:00
parent 402a04cf7d
commit 5be44cdfae
2 changed files with 4 additions and 1 deletions

View File

@@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.stones;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicImmune;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.bags.Bag;
@@ -51,7 +52,7 @@ public abstract class InventoryStone extends Runestone {
@Override
public void execute(Hero hero, String action) {
super.execute(hero, action);
if (action.equals(AC_USE)){
if (action.equals(AC_USE) && hero.buff(MagicImmune.class) == null){
activate(curUser.pos);
}
}

View File

@@ -24,6 +24,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.stones;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicImmune;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.journal.Catalog;
@@ -48,6 +49,7 @@ public abstract class Runestone extends Item {
protected void onThrow(int cell) {
///inventory stones are thrown like normal items, other stones don't trigger when thrown into pits
if (this instanceof InventoryStone ||
Dungeon.hero.buff(MagicImmune.class) != null ||
(Dungeon.level.pit[cell] && Actor.findChar(cell) == null)){
if (!anonymous) super.onThrow( cell );
} else {