v2.4.2: Fixed wondrous resin not triggering from wild magic zaps
This commit is contained in:
+29
-2
@@ -32,6 +32,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.ArmorAbility;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.ArmorAbility;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.ClassArmor;
|
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.CursedWand;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand;
|
import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
|
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
|
||||||
@@ -143,18 +144,44 @@ public class WildMagic extends ArmorAbility {
|
|||||||
@Override
|
@Override
|
||||||
public void call() {
|
public void call() {
|
||||||
cur.onZap(aim);
|
cur.onZap(aim);
|
||||||
|
boolean alsoCursedZap = Random.Float() < WondrousResin.extraCurseEffectChance();
|
||||||
if (Game.timeTotal - startTime < 0.33f) {
|
if (Game.timeTotal - startTime < 0.33f) {
|
||||||
hero.sprite.parent.add(new Delayer(0.33f - (Game.timeTotal - startTime)) {
|
hero.sprite.parent.add(new Delayer(0.33f - (Game.timeTotal - startTime)) {
|
||||||
@Override
|
@Override
|
||||||
protected void onComplete() {
|
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 {
|
} 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 {
|
} else {
|
||||||
CursedWand.cursedZap(cur,
|
CursedWand.cursedZap(cur,
|
||||||
hero,
|
hero,
|
||||||
|
|||||||
Reference in New Issue
Block a user