From e84091249f6051d081d48e8e33b9d1db9941a5d2 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 4 Aug 2022 16:02:37 -0400 Subject: [PATCH] v1.4.0: added text to mirror image and retribution, fixed MI not IDing --- .../assets/messages/items/items.properties | 3 + .../items/scrolls/ScrollOfMirrorImage.java | 75 ++----------------- .../items/scrolls/ScrollOfRetribution.java | 3 + .../scrolls/exotic/ScrollOfPsionicBlast.java | 2 + 4 files changed, 15 insertions(+), 68 deletions(-) diff --git a/core/src/main/assets/messages/items/items.properties b/core/src/main/assets/messages/items/items.properties index fc9a12c12..b9da764da 100644 --- a/core/src/main/assets/messages/items/items.properties +++ b/core/src/main/assets/messages/items/items.properties @@ -939,9 +939,12 @@ items.scrolls.scrollofmagicmapping.layout=You are now aware of the level layout. items.scrolls.scrollofmagicmapping.desc=When this scroll is read, an image of crystal clarity will be etched into your memory, alerting you to the precise layout of the level and revealing all hidden secrets. The locations of items and creatures will remain unknown. items.scrolls.scrollofmirrorimage.name=scroll of mirror image +items.scrolls.scrollofmirrorimage.copies=The scroll forms mirror images of you. +items.scrolls.scrollofmirrorimage.no_copies=The scroll attempts to create mirror images of you, but they have nowhere to go. items.scrolls.scrollofmirrorimage.desc=The incantation on this scroll will create two illusory twins of the reader. These mirror images act as weaker clones of the reader, and will chase down their enemies. They have no durability however, and will fade upon taking damage. items.scrolls.scrollofretribution.name=scroll of retribution +items.scrolls.scrollofretribution.blast=Powerful magical energy erupts from the scroll! items.scrolls.scrollofretribution.desc=This scroll contains destructive energy which channels the reader's suffering outward into a blast of power. The weaker the reader is, the more damage they will deal. At very low health this scroll can kill most enemies instantly.\n\nUsing the scroll takes a toll on the user however, blinding and weakening them. items.scrolls.scrollofrage.name=scroll of rage diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMirrorImage.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMirrorImage.java index 311bd9ab1..5fbe8cc92 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMirrorImage.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMirrorImage.java @@ -28,8 +28,10 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.MirrorImage; +import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; +import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.watabou.noosa.audio.Sample; import com.watabou.utils.Bundle; import com.watabou.utils.PathFinder; @@ -47,11 +49,12 @@ public class ScrollOfMirrorImage extends Scroll { @Override public void doRead() { - int spawnedImages = spawnImages(curUser, NIMAGES); - - if (spawnedImages > 0) { - identify(); + if ( spawnImages(curUser, NIMAGES) > 0){ + GLog.i(Messages.get(this, "copies")); + } else { + GLog.i(Messages.get(this, "no_copies")); } + identify(); Sample.INSTANCE.play( Assets.Sounds.READ ); @@ -86,70 +89,6 @@ public class ScrollOfMirrorImage extends Scroll { return spawned; } - - public static class DelayedImageSpawner extends Buff{ - - public DelayedImageSpawner(){ - this(NIMAGES, NIMAGES, 1); - } - - public DelayedImageSpawner( int total, int perRound, float delay){ - super(); - totImages = total; - imPerRound = perRound; - this.delay = delay; - } - - private int totImages; - private int imPerRound; - private float delay; - - @Override - public boolean attachTo(Char target) { - if (super.attachTo(target)){ - spend(delay); - return true; - } else { - return false; - } - } - - @Override - public boolean act() { - - int spawned = spawnImages((Hero)target, Math.min(totImages, imPerRound)); - - totImages -= spawned; - - if (totImages <0){ - detach(); - } else { - spend( delay ); - } - - return true; - } - - private static final String TOTAL = "images"; - private static final String PER_ROUND = "per_round"; - private static final String DELAY = "delay"; - - @Override - public void storeInBundle(Bundle bundle) { - super.storeInBundle(bundle); - bundle.put( TOTAL, totImages ); - bundle.put( PER_ROUND, imPerRound ); - bundle.put( DELAY, delay ); - } - - @Override - public void restoreFromBundle(Bundle bundle) { - super.restoreFromBundle(bundle); - totImages = bundle.getInt( TOTAL ); - imPerRound = bundle.getInt( PER_ROUND ); - delay = bundle.getFloat( DELAY ); - } - } @Override public int value() { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRetribution.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRetribution.java index 16bb885c4..56a3252cf 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRetribution.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRetribution.java @@ -27,8 +27,10 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Blindness; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Weakness; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; +import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; +import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.watabou.noosa.audio.Sample; public class ScrollOfRetribution extends Scroll { @@ -47,6 +49,7 @@ public class ScrollOfRetribution extends Scroll { float power = Math.min( 4f, 4.45f*hpPercent); Sample.INSTANCE.play( Assets.Sounds.BLAST ); + GLog.i(Messages.get(this, "blast")); for (Mob mob : Dungeon.level.mobs.toArray( new Mob[0] )) { if (Dungeon.level.heroFOV[mob.pos]) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfPsionicBlast.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfPsionicBlast.java index 7eefc6f07..170177c7b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfPsionicBlast.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfPsionicBlast.java @@ -28,6 +28,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Blindness; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Weakness; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; +import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRetribution; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; @@ -46,6 +47,7 @@ public class ScrollOfPsionicBlast extends ExoticScroll { GameScene.flash( 0x80FFFFFF ); Sample.INSTANCE.play( Assets.Sounds.BLAST ); + GLog.i(Messages.get(ScrollOfRetribution.class, "blast")); int targets = 0; for (Mob mob : Dungeon.level.mobs.toArray( new Mob[0] )) {