v2.4.2: Fixed wondrous resin not triggering from wild magic zaps

This commit is contained in:
Evan Debenham
2024-06-02 16:32:39 -04:00
parent ff3b5eb63d
commit cba6917995

View File

@@ -32,6 +32,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.ArmorAbility;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.ClassArmor;
import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.WondrousResin;
import com.shatteredpixel.shatteredpixeldungeon.items.wands.CursedWand;
import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand;
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
@@ -143,18 +144,44 @@ public class WildMagic extends ArmorAbility {
@Override
public void call() {
cur.onZap(aim);
boolean alsoCursedZap = Random.Float() < WondrousResin.extraCurseEffectChance();
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);
if (alsoCursedZap){
CursedWand.cursedZap(cur,
hero,
new Ballistica(hero.pos, cell, Ballistica.MAGIC_BOLT),
new Callback() {
@Override
public void call() {
afterZap(cur, wands, hero, cell);
}
});
} else {
afterZap(cur, wands, hero, cell);
}
}
});
} else {
afterZap(cur, wands, hero, cell);
if (alsoCursedZap){
CursedWand.cursedZap(cur,
hero,
new Ballistica(hero.pos, cell, Ballistica.MAGIC_BOLT),
new Callback() {
@Override
public void call() {
afterZap(cur, wands, hero, cell);
}
});
} else {
afterZap(cur, wands, hero, cell);
}
}
}
});
} else {
CursedWand.cursedZap(cur,
hero,