v1.4.0: added text to mirror image and retribution, fixed MI not IDing
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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]) {
|
||||
|
||||
@@ -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] )) {
|
||||
|
||||
Reference in New Issue
Block a user