Merging Source v1.7.2: item changes
This commit is contained in:
@@ -147,8 +147,8 @@ public abstract class Wand extends KindOfWeapon {
|
||||
|
||||
@Override
|
||||
public boolean doUnequip( Hero hero, boolean collect ) {
|
||||
charger.detach();
|
||||
return super.doUnequip(hero, collect);
|
||||
onDetach();
|
||||
return super.doUnequip( hero, collect );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -188,17 +188,10 @@ public abstract class Wand extends KindOfWeapon {
|
||||
public void charge( Char owner ) {
|
||||
(charger = new Charger()).attachTo( owner );
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item detach( Bag container ) {
|
||||
stopCharging();
|
||||
return super.detach( container );
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item detachAll( Bag container) {
|
||||
public void onDetach( ) {
|
||||
stopCharging();
|
||||
return super.detachAll( container );
|
||||
}
|
||||
|
||||
public void stopCharging() {
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.items.wands;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Vertigo;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||
@@ -37,8 +39,12 @@ public class WandOfAmok extends Wand {
|
||||
protected void onZap( int cell ) {
|
||||
Char ch = Actor.findChar( cell );
|
||||
if (ch != null) {
|
||||
|
||||
Buff.affect( ch, Amok.class, 3f + level() );
|
||||
|
||||
if (ch == Dungeon.hero) {
|
||||
Buff.affect( ch, Vertigo.class, Vertigo.duration(ch) );
|
||||
} else {
|
||||
Buff.affect( ch, Amok.class, 3f + level() );
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
@@ -17,12 +17,12 @@
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.items.wands;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.NPC;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.MagicMissile;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||
@@ -104,7 +104,7 @@ public class WandOfFlock extends Wand {
|
||||
"A flick of this wand summons a flock of magic sheep, creating temporary impenetrable obstacle.";
|
||||
}
|
||||
|
||||
public static class Sheep extends Mob.NPC {
|
||||
public static class Sheep extends NPC {
|
||||
|
||||
private static final String[] QUOTES = {"Baa!", "Baa?", "Baa.", "Baa..."};
|
||||
|
||||
|
||||
@@ -48,7 +48,6 @@ public class WandOfLightning extends Wand {
|
||||
|
||||
@Override
|
||||
protected void onZap( int cell ) {
|
||||
// The actual effect is processed in "fx" method
|
||||
|
||||
if (!curUser.isAlive()) {
|
||||
Dungeon.fail( Utils.format( ResultDescriptions.ITEM, name, Dungeon.depth ) );
|
||||
|
||||
@@ -38,7 +38,7 @@ public class WandOfPoison extends Wand {
|
||||
Char ch = Actor.findChar( cell );
|
||||
if (ch != null) {
|
||||
|
||||
Buff.affect( ch, Poison.class ).set( Poison.durationFactor( ch ) * (1 + 2 * (float)Math.pow( 1.5, level() )) );
|
||||
Buff.affect( ch, Poison.class ).set( Poison.durationFactor( ch ) * (5 + level()) );
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ public class WandOfTelekinesis extends Wand {
|
||||
ch.pos = next;
|
||||
Actor.freeCell( next );
|
||||
|
||||
// Refactoring needed!
|
||||
// FIXME
|
||||
if (ch instanceof Mob) {
|
||||
Dungeon.level.mobPress( (Mob)ch );
|
||||
} else {
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.items.wands;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.NPC;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
@@ -44,7 +44,7 @@ public class WandOfTeleportation extends Wand {
|
||||
setKnown();
|
||||
ScrollOfTeleportation.teleportHero( curUser );
|
||||
|
||||
} else if (ch != null && !(ch instanceof Mob.NPC)) {
|
||||
} else if (ch != null && !(ch instanceof NPC)) {
|
||||
|
||||
int count = 10;
|
||||
int pos;
|
||||
|
||||
Reference in New Issue
Block a user