v2.2.0: fixed wild magic not triggering TryToZap logic

also formalized armor abilities working through antimagic
This commit is contained in:
Evan Debenham
2023-09-05 12:48:59 -04:00
parent af7c95b7af
commit f6e55a633b
4 changed files with 41 additions and 36 deletions

View File

@@ -266,7 +266,7 @@ actors.buffs.magicalsleep.wakeup=You wake up feeling refreshed and healthy.
actors.buffs.magicalsleep.desc=This character has fallen into a deep magical sleep which they will not wake from naturally.\n\nMagical sleep is similar to regular sleep, except that only damage will cause the target to wake up.\n\nFor the hero and their allies, magical sleep has some restorative properties, allowing them to rapidly heal while resting.
actors.buffs.magicimmune.name=immune to magic
actors.buffs.magicimmune.desc=All magical effects have lost their hold on you, you are completely impervious to them.\n\nWhile magic immune all harmful and helpful magical effects will not apply to you, including curses, enchants, wands, scrolls, rings, artifacts, etc.\n\nTurns of magic immunity remaining: %s.
actors.buffs.magicimmune.desc=All magical effects have lost their hold on you, you are completely impervious to them.\n\nWhile magic immune all harmful and helpful magical effects will not apply to you, including curses, enchants, wands, scrolls, rings, artifacts, etc. Heroic armor abilities are strong enough to work regardless of this effect.\n\nTurns of magic immunity remaining: %s.
actors.buffs.mindvision.name=mind vision
actors.buffs.mindvision.desc=Somehow you are able to see all creatures on this floor through your mind. It's a weird feeling.\n\nAll characters on this floor are visible to you as long as you have mind vision. Seeing a creature through mind vision counts as it being seen or nearby for the purposes of many magical effects.\n\nTurns of mind vision remaining: %s.

View File

@@ -1069,7 +1069,7 @@ items.scrolls.exotic.scrollofsirenssong$enthralled.name=enthralled
items.scrolls.exotic.scrollofsirenssong$enthralled.desc=This creature has been bewitched by the magic of a scroll of siren's song.\n\nAn enthralled character is permanently your ally, and will fight any enemies they encounter.
items.scrolls.exotic.scrollofantimagic.name=scroll of anti-magic
items.scrolls.exotic.scrollofantimagic.desc=The incantation on this scroll will surround you with a magical aura that temporarily blocks all magical effects, harmful or helpful.
items.scrolls.exotic.scrollofantimagic.desc=The incantation on this scroll will surround you with a magical aura that temporarily blocks all magical effects, harmful or helpful. Heroic armor abilities are strong enough to work regardless however.
items.scrolls.exotic.scrollofchallenge.name=scroll of challenge
items.scrolls.exotic.scrollofchallenge.desc=When read aloud, this scroll will unleash a great roar that draws enemies to the user while simultaneously creating a small arena around them.\n\nAs long as the reader stays in this arena they will take 33% less damage from all sources (this is applied before other forms of damage reduction), and they will not lose satiety.\n\nThe size of the arena will scale with the size of the area the reader is in. It will be particularly small in some boss areas.

View File

@@ -137,42 +137,46 @@ public class WildMagic extends ArmorAbility {
hero.sprite.zap(cell);
float startTime = Game.timeTotal;
if (!cur.cursed) {
cur.fx(aim, new Callback() {
@Override
public void call() {
cur.onZap(aim);
if (Game.timeTotal - startTime < 0.33f){
hero.sprite.parent.add(new Delayer(0.33f - (Game.timeTotal - startTime)) {
if (cur.tryToZap(hero, cell)) {
if (!cur.cursed) {
cur.fx(aim, new Callback() {
@Override
public void call() {
cur.onZap(aim);
if (Game.timeTotal - startTime < 0.33f) {
hero.sprite.parent.add(new Delayer(0.33f - (Game.timeTotal - startTime)) {
@Override
protected void onComplete() {
afterZap(cur, wands, hero, cell);
}
});
} else {
afterZap(cur, wands, hero, cell);
}
}
});
} else {
CursedWand.cursedZap(cur,
hero,
new Ballistica(hero.pos, cell, Ballistica.MAGIC_BOLT),
new Callback() {
@Override
protected void onComplete() {
afterZap(cur, wands, hero, cell);
public void call() {
if (Game.timeTotal - startTime < 0.33f) {
hero.sprite.parent.add(new Delayer(0.33f - (Game.timeTotal - startTime)) {
@Override
protected void onComplete() {
afterZap(cur, wands, hero, cell);
}
});
} else {
afterZap(cur, wands, hero, cell);
}
}
});
} else {
afterZap(cur, wands, hero, cell);
}
}
});
}
} else {
CursedWand.cursedZap(cur,
hero,
new Ballistica(hero.pos, cell, Ballistica.MAGIC_BOLT),
new Callback() {
@Override
public void call() {
if (Game.timeTotal - startTime < 0.33f){
hero.sprite.parent.add(new Delayer(0.33f - (Game.timeTotal - startTime)) {
@Override
protected void onComplete() {
afterZap(cur, wands, hero, cell);
}
});
} else {
afterZap(cur, wands, hero, cell);
}
}
});
afterZap(cur, wands, hero, cell);
}
}

View File

@@ -136,12 +136,13 @@ public abstract class Wand extends Item {
public boolean tryToZap( Hero owner, int target ){
if (owner.buff(MagicImmune.class) != null){
if (owner.buff(WildMagic.WildMagicTracker.class) == null && owner.buff(MagicImmune.class) != null){
GLog.w( Messages.get(this, "no_magic") );
return false;
}
if ( curCharges >= chargesPerCast()){
//if we're using wild magic, then assume we have charges
if ( owner.buff(WildMagic.WildMagicTracker.class) != null || curCharges >= chargesPerCast()){
return true;
} else {
GLog.w(Messages.get(this, "fizzles"));