v2.4.0: fixed some bugs in wondrous resin cursed wand effects

This commit is contained in:
Evan Debenham
2024-05-10 11:25:53 -04:00
parent 41022d2b9b
commit 83467489ba
2 changed files with 9 additions and 7 deletions
@@ -197,7 +197,7 @@ public class ScrollOfMetamorphosis extends ExoticScroll {
public WndMetamorphReplace(Talent replacing, int tier){ public WndMetamorphReplace(Talent replacing, int tier){
super(); super();
if (!identifiedByUse) { if (!identifiedByUse && curItem instanceof ScrollOfMetamorphosis) {
curItem.detach(curUser.belongings.backpack); curItem.detach(curUser.belongings.backpack);
} }
identifiedByUse = false; identifiedByUse = false;
@@ -306,6 +306,7 @@ public class CursedWand {
if (ch != null){ if (ch != null){
Buff.affect(ch, Hex.class, Hex.DURATION); Buff.affect(ch, Hex.class, Hex.DURATION);
} }
return true;
} }
if (user instanceof Hero) { if (user instanceof Hero) {
CursingTrap.curse( (Hero) user ); CursingTrap.curse( (Hero) user );
@@ -395,20 +396,21 @@ public class CursedWand {
Mimic mimic = Mimic.spawnAt(spawnCell, GoldenMimic.class, false); Mimic mimic = Mimic.spawnAt(spawnCell, GoldenMimic.class, false);
mimic.stopHiding(); mimic.stopHiding();
mimic.alignment = Char.Alignment.ENEMY; mimic.alignment = Char.Alignment.ENEMY;
//play vfx/sfx manually as mimic isn't in the scene yet
Sample.INSTANCE.play(Assets.Sounds.MIMIC, 1, 0.85f);
CellEmitter.get(mimic.pos).burst(Speck.factory(Speck.STAR), 10);
mimic.items.clear();
GameScene.add(mimic);
if (positiveOnly){
Buff.affect(mimic, ScrollOfSirensSong.Enthralled.class);
} else {
Item reward; Item reward;
do { do {
reward = Generator.randomUsingDefaults(Random.oneOf(Generator.Category.WEAPON, Generator.Category.ARMOR, reward = Generator.randomUsingDefaults(Random.oneOf(Generator.Category.WEAPON, Generator.Category.ARMOR,
Generator.Category.RING, Generator.Category.WAND)); Generator.Category.RING, Generator.Category.WAND));
} while (reward.level() < 1); } while (reward.level() < 1);
//play vfx/sfx manually as mimic isn't in the scene yet
Sample.INSTANCE.play(Assets.Sounds.MIMIC, 1, 0.85f);
CellEmitter.get(mimic.pos).burst(Speck.factory(Speck.STAR), 10);
mimic.items.clear();
mimic.items.add(reward); mimic.items.add(reward);
GameScene.add(mimic);
if (positiveOnly){
Buff.affect(mimic, ScrollOfSirensSong.Enthralled.class);
} }
return true; return true;