From 078e416b1adb3cf6577ca44a26d931fbcbbda0cd Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Tue, 6 Sep 2016 02:33:37 -0400 Subject: [PATCH] v0.4.2: fixed a bug with multiplicity and removed the unused pre-0.4.0 version of multiplicity --- .../items/armor/curses/Multiplicity.java | 4 +- .../items/armor/glyphs/Multiplicity.java | 78 ------------------- 2 files changed, 2 insertions(+), 80 deletions(-) delete mode 100644 core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Multiplicity.java diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/Multiplicity.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/Multiplicity.java index a62ebdb02..18f23eef6 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/Multiplicity.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/Multiplicity.java @@ -68,9 +68,9 @@ public class Multiplicity extends Armor.Glyph { m = Bestiary.mutable(Dungeon.depth % 5 == 0 ? Dungeon.depth - 1 : Dungeon.depth); } else { try { - m = (Mob)defender.getClass().newInstance(); + m = (Mob)attacker.getClass().newInstance(); Bundle store = new Bundle(); - defender.storeInBundle(store); + attacker.storeInBundle(store); m.restoreFromBundle(store); m.HP = m.HT; } catch (Exception e) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Multiplicity.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Multiplicity.java deleted file mode 100644 index 13eda08a1..000000000 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Multiplicity.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2016 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ -package com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs; - -import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; -import com.shatteredpixel.shatteredpixeldungeon.actors.Char; -import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; -import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.MirrorImage; -import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor; -import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor.Glyph; -import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportation; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; -import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; -import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; -import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite.Glowing; -import com.watabou.utils.PathFinder; -import com.watabou.utils.Random; - -import java.util.ArrayList; - -public class Multiplicity extends Glyph { - - private static ItemSprite.Glowing PINK = new ItemSprite.Glowing( 0xCCAA88 ); - - @Override - public int proc( Armor armor, Char attacker, Char defender, int damage) { - - int level = Math.max( 0, armor.level() ); - - if (Random.Int( level / 2 + 6 ) >= 5) { - - ArrayList respawnPoints = new ArrayList(); - - for (int i = 0; i < PathFinder.NEIGHBOURS8.length; i++) { - int p = defender.pos + PathFinder.NEIGHBOURS8[i]; - if (Actor.findChar( p ) == null && (Level.passable[p] || Level.avoid[p])) { - respawnPoints.add( p ); - } - } - - if (respawnPoints.size() > 0) { - MirrorImage mob = new MirrorImage(); - mob.duplicate( (Hero)defender ); - GameScene.add( mob ); - ScrollOfTeleportation.appear( mob, Random.element( respawnPoints ) ); - - defender.damage( Random.IntRange( 1, defender.HT / 6 ), this ); - checkOwner( defender ); - } - - } - - return damage; - } - - @Override - public Glowing glowing() { - return PINK; - } -}