v0.3.5: big consistency pass on how items handle execution

This commit is contained in:
Evan Debenham 2016-04-19 19:34:08 -04:00
parent a571dc7f02
commit e715e147ff
36 changed files with 163 additions and 151 deletions

View File

@ -50,14 +50,11 @@ public class Amulet extends Item {
@Override
public void execute( Hero hero, String action ) {
super.execute( hero, action );
if (action.equals(AC_END)) {
showAmuletScene( false );
} else {
super.execute( hero, action );
}
}

View File

@ -24,10 +24,9 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite.Glowing;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.watabou.noosa.audio.Sample;
import com.watabou.utils.Bundle;
@ -69,6 +68,9 @@ public class Ankh extends Item {
@Override
public void execute( final Hero hero, String action ) {
super.execute( hero, action );
if (action.equals( AC_BLESS )) {
DewVial vial = hero.belongings.getItem(DewVial.class);
@ -84,12 +86,7 @@ public class Ankh extends Item {
CellEmitter.get(hero.pos).start(Speck.factory(Speck.LIGHT), 0.2f, 3);
hero.sprite.operate( hero.pos );
}
} else {
super.execute( hero, action );
}
}
@Override

View File

@ -20,21 +20,20 @@
*/
package com.shatteredpixel.shatteredpixeldungeon.items;
import java.util.ArrayList;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.watabou.noosa.audio.Sample;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.ClassArmor;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.HeroSprite;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.shatteredpixel.shatteredpixeldungeon.windows.WndBag;
import com.watabou.noosa.audio.Sample;
import java.util.ArrayList;
public class ArmorKit extends Item {
@ -59,15 +58,14 @@ public class ArmorKit extends Item {
@Override
public void execute( Hero hero, String action ) {
super.execute( hero, action );
if (action == AC_APPLY) {
curUser = hero;
GameScene.selectItem( itemSelector, WndBag.Mode.ARMOR, Messages.get(this, "prompt") );
} else {
super.execute( hero, action );
}
}

View File

@ -20,23 +20,22 @@
*/
package com.shatteredpixel.shatteredpixeldungeon.items;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
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.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.BlastParticle;
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.SmokeParticle;
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
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.Random;
@ -74,13 +73,13 @@ public class Bomb extends Item {
@Override
public void execute(Hero hero, String action) {
if (action.equals( AC_LIGHTTHROW )){
super.execute(hero, action);
if (action.equals(AC_LIGHTTHROW)) {
lightingFuse = true;
action = AC_THROW;
} else
lightingFuse = false;
super.execute(hero, action);
}
@Override

View File

@ -42,13 +42,14 @@ public class BrokenSeal extends Item {
@Override
public void execute(Hero hero, String action) {
super.execute(hero, action);
if (action.equals(AC_AFFIX)){
curItem = this;
GameScene.selectItem(armorSelector, WndBag.Mode.ARMOR, Messages.get(this, "prompt"));
} else if (action.equals(AC_INFO)) {
GameScene.show(new WndItem(null, this, true));
} else {
super.execute(hero, action);
}
}

View File

@ -79,6 +79,9 @@ public class DewVial extends Item {
@Override
public void execute( final Hero hero, String action ) {
super.execute( hero, action );
if (action.equals( AC_DRINK )) {
if (volume > 0) {
@ -111,10 +114,6 @@ public class DewVial extends Item {
GLog.w( Messages.get(this, "empty") );
}
} else {
super.execute( hero, action );
}
}

View File

@ -49,6 +49,9 @@ public abstract class EquipableItem extends Item {
@Override
public void execute( Hero hero, String action ) {
super.execute( hero, action );
if (action.equals( AC_EQUIP )) {
//In addition to equipping itself, item reassigns itself to the quickslot
//This is a special case as the item is being removed from inventory, but is staying with the hero.
@ -60,8 +63,6 @@ public abstract class EquipableItem extends Item {
}
} else if (action.equals( AC_UNEQUIP )) {
doUnequip( hero, true );
} else {
super.execute( hero, action );
}
}

View File

@ -20,14 +20,10 @@
*/
package com.shatteredpixel.shatteredpixeldungeon.items;
import java.util.ArrayList;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.watabou.noosa.audio.Sample;
import com.watabou.noosa.tweeners.AlphaTweener;
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.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Bee;
import com.shatteredpixel.shatteredpixeldungeon.effects.Pushing;
@ -35,9 +31,13 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.Splash;
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.watabou.noosa.audio.Sample;
import com.watabou.noosa.tweeners.AlphaTweener;
import com.watabou.utils.Bundle;
import com.watabou.utils.Random;
import java.util.ArrayList;
public class Honeypot extends Item {
public static final String AC_SHATTER = "SHATTER";
@ -60,6 +60,9 @@ public class Honeypot extends Item {
@Override
public void execute( final Hero hero, String action ) {
super.execute( hero, action );
if (action.equals( AC_SHATTER )) {
hero.sprite.zap( hero.pos );
@ -69,9 +72,7 @@ public class Honeypot extends Item {
shatter( hero, hero.pos ).collect();
hero.next();
} else {
super.execute( hero, action );
}
}

View File

@ -51,12 +51,15 @@ public class MerchantsBeacon extends Item {
@Override
public void execute(Hero hero, String action) {
super.execute(hero, action);
if (action.equals(AC_USE)) {
detach( hero.belongings.backpack );
Shopkeeper.sell();
Sample.INSTANCE.play( Assets.SND_BEACON );
} else
super.execute(hero, action);
}
}
@Override

View File

@ -25,7 +25,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.effects.Enchanting;
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.PurpleParticle;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
@ -58,15 +57,14 @@ public class Stylus extends Item {
@Override
public void execute( Hero hero, String action ) {
super.execute( hero, action );
if (action.equals(AC_INSCRIBE)) {
curUser = hero;
GameScene.selectItem( itemSelector, WndBag.Mode.ARMOR, Messages.get(this, "prompt") );
} else {
super.execute( hero, action );
}
}

View File

@ -59,6 +59,9 @@ public class TomeOfMastery extends Item {
@Override
public void execute( Hero hero, String action ) {
super.execute( hero, action );
if (action.equals( AC_READ )) {
curUser = hero;
@ -85,10 +88,6 @@ public class TomeOfMastery extends Item {
}
GameScene.show( new WndChooseWay( this, way1, way2 ) );
} else {
super.execute( hero, action );
}
}

View File

@ -20,14 +20,14 @@
*/
package com.shatteredpixel.shatteredpixeldungeon.items;
import java.util.ArrayList;
import com.watabou.noosa.particles.Emitter;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Light;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.FlameParticle;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.watabou.noosa.particles.Emitter;
import java.util.ArrayList;
public class Torch extends Item {
@ -52,6 +52,8 @@ public class Torch extends Item {
@Override
public void execute( Hero hero, String action ) {
super.execute( hero, action );
if (action.equals( AC_LIGHT )) {
@ -66,10 +68,6 @@ public class Torch extends Item {
Emitter emitter = hero.sprite.centerEmitter();
emitter.start( FlameParticle.FACTORY, 0.2f, 3 );
} else {
super.execute( hero, action );
}
}

View File

@ -60,15 +60,14 @@ public class Weightstone extends Item {
@Override
public void execute( Hero hero, String action ) {
if (action == AC_APPLY) {
super.execute( hero, action );
if (action.equals(AC_APPLY)) {
curUser = hero;
GameScene.selectItem( itemSelector, WndBag.Mode.WEAPON, Messages.get(this, "select") );
} else {
super.execute( hero, action );
}
}

View File

@ -112,6 +112,9 @@ public class Armor extends EquipableItem {
@Override
public void execute(Hero hero, String action) {
super.execute(hero, action);
if (action.equals(AC_DETACH) && seal){
seal = false;
BrokenSeal.WarriorShield sigilBuff = hero.buff(BrokenSeal.WarriorShield.class);
@ -127,8 +130,6 @@ public class Armor extends EquipableItem {
if (!sigil.collect()){
Dungeon.level.drop(sigil, hero.pos);
}
} else {
super.execute(hero, action);
}
}

View File

@ -101,6 +101,9 @@ abstract public class ClassArmor extends Armor {
@Override
public void execute( Hero hero, String action ) {
super.execute( hero, action );
if (action.equals(AC_SPECIAL)) {
if (hero.HP < 3) {
@ -113,8 +116,6 @@ abstract public class ClassArmor extends Armor {
doSpecial();
}
} else {
super.execute( hero, action );
}
}

View File

@ -84,10 +84,11 @@ public class AlchemistsToolkit extends Artifact {
@Override
public void execute(Hero hero, String action ) {
super.execute(hero, action);
if (action.equals(AC_BREW)){
GameScene.selectItem(itemSelector, mode, inventoryTitle);
} else {
super.execute(hero, action);
}
}

View File

@ -57,6 +57,7 @@ public class ChaliceOfBlood extends Artifact {
@Override
public void execute(Hero hero, String action ) {
super.execute(hero, action);
if (action.equals(AC_PRICK)){
int damage = 3*(level()*level());

View File

@ -22,7 +22,6 @@ package com.shatteredpixel.shatteredpixeldungeon.items.artifacts;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
@ -72,6 +71,9 @@ public class CloakOfShadows extends Artifact {
@Override
public void execute( Hero hero, String action ) {
super.execute(hero, action);
if (action.equals( AC_STEALTH )) {
if (!stealthed){
@ -99,8 +101,7 @@ public class CloakOfShadows extends Artifact {
hero.sprite.operate( hero.pos );
}
} else
super.execute(hero, action);
}
}
@Override

View File

@ -86,6 +86,9 @@ public class DriedRose extends Artifact {
@Override
public void execute( Hero hero, String action ) {
super.execute(hero, action);
if (action.equals(AC_SUMMON)) {
if (spawned) GLog.i( Messages.get(this, "spawned") );
@ -128,8 +131,6 @@ public class DriedRose extends Artifact {
GLog.i( Messages.get(this, "no_space") );
}
} else{
super.execute(hero, action);
}
}

View File

@ -68,6 +68,9 @@ public class EtherealChains extends Artifact {
@Override
public void execute(Hero hero, String action) {
super.execute(hero, action);
if (action.equals(AC_CAST)){
curUser = hero;
@ -88,8 +91,7 @@ public class EtherealChains extends Artifact {
GameScene.selectCell(caster);
}
} else
super.execute(hero, action);
}
}
private CellSelector.Listener caster = new CellSelector.Listener(){

View File

@ -78,6 +78,7 @@ public class HornOfPlenty extends Artifact {
@Override
public void execute( Hero hero, String action ) {
super.execute(hero, action);
if (action.equals(AC_EAT)){
@ -128,6 +129,7 @@ public class HornOfPlenty extends Artifact {
} else if (action.equals(AC_STORE)){
GameScene.selectItem(itemSelector, mode, Messages.get(this, "prompt"));
}
}

View File

@ -105,6 +105,8 @@ public class LloydsBeacon extends Artifact {
@Override
public void execute( Hero hero, String action ) {
super.execute( hero, action );
if (action == AC_SET || action == AC_RETURN) {
if (Dungeon.bossLevel()) {
@ -172,10 +174,6 @@ public class LloydsBeacon extends Artifact {
}
} else {
super.execute( hero, action );
}
}

View File

@ -74,8 +74,11 @@ public class SandalsOfNature extends Artifact {
@Override
public void execute( Hero hero, String action ) {
super.execute(hero, action);
if (action.equals(AC_FEED)){
GameScene.selectItem(itemSelector, mode, Messages.get(this, "prompt"));
} else if (action.equals(AC_ROOT) && level() > 0){
if (!isEquipped( hero )) GLog.i( Messages.get(Artifact.class, "need_to_equip") );

View File

@ -65,6 +65,7 @@ public class TalismanOfForesight extends Artifact {
@Override
public void execute( Hero hero, String action ) {
super.execute(hero, action);
if (action.equals(AC_SCRY)){
if (!isEquipped(hero)) GLog.i( Messages.get(Artifact.class, "need_to_equip") );

View File

@ -69,6 +69,9 @@ public class TimekeepersHourglass extends Artifact {
@Override
public void execute( Hero hero, String action ) {
super.execute(hero, action);
if (action.equals(AC_ACTIVATE)){
if (!isEquipped( hero )) GLog.i( Messages.get(Artifact.class, "need_to_equip") );
@ -100,8 +103,7 @@ public class TimekeepersHourglass extends Artifact {
};
}
);
} else
super.execute(hero, action);
}
}
@Override

View File

@ -92,6 +92,9 @@ public class UnstableSpellbook extends Artifact {
@Override
public void execute( Hero hero, String action ) {
super.execute( hero, action );
if (action.equals( AC_READ )) {
if (hero.buff( Blindness.class ) != null) GLog.w( Messages.get(this, "blinded") );
@ -116,8 +119,7 @@ public class UnstableSpellbook extends Artifact {
} else if (action.equals( AC_ADD )) {
GameScene.selectItem(itemSelector, mode, Messages.get(this, "prompt"));
} else
super.execute( hero, action );
}
}
@Override

View File

@ -20,9 +20,6 @@
*/
package com.shatteredpixel.shatteredpixeldungeon.items.bags;
import java.util.ArrayList;
import java.util.Iterator;
import com.shatteredpixel.shatteredpixeldungeon.Badges;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
@ -33,6 +30,9 @@ import com.shatteredpixel.shatteredpixeldungeon.windows.WndBag;
import com.watabou.utils.Bundlable;
import com.watabou.utils.Bundle;
import java.util.ArrayList;
import java.util.Iterator;
public class Bag extends Item implements Iterable<Item> {
public static final String AC_OPEN = "OPEN";
@ -53,14 +53,13 @@ public class Bag extends Item implements Iterable<Item> {
@Override
public void execute( Hero hero, String action ) {
super.execute( hero, action );
if (action.equals( AC_OPEN )) {
GameScene.show( new WndBag( this, null, WndBag.Mode.ALL, null ) );
} else {
super.execute( hero, action );
}
}

View File

@ -27,7 +27,18 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Hunger;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.ToxicImbue;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.*;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfExperience;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfFrost;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfHealing;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfInvisibility;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfLevitation;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfLiquidFlame;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfMindVision;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfParalyticGas;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfPurity;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfStrength;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfToxicGas;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.plants.Plant.Seed;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
@ -67,6 +78,9 @@ public class Blandfruit extends Food {
@Override
public void execute( Hero hero, String action ) {
super.execute(hero, action);
if (action.equals( AC_EAT )){
if (potionAttrib == null) {
@ -91,8 +105,6 @@ public class Blandfruit extends Food {
} else
potionAttrib.apply(hero);
}
} else {
super.execute(hero, action);
}
}

View File

@ -65,6 +65,9 @@ public class Food extends Item {
@Override
public void execute( Hero hero, String action ) {
super.execute( hero, action );
if (action.equals( AC_EAT )) {
detach( hero.belongings.backpack );
@ -99,10 +102,6 @@ public class Food extends Item {
Statistics.foodEaten++;
Badges.validateFoodEaten();
} else {
super.execute( hero, action );
}
}

View File

@ -83,6 +83,7 @@ public class Pasty extends Food {
@Override
public void execute(Hero hero, String action) {
super.execute(hero, action);
if (action.equals(AC_EAT)){
switch(holiday){
case NONE: default:

View File

@ -131,6 +131,9 @@ public class Potion extends Item {
@Override
public void execute( final Hero hero, String action ) {
super.execute( hero, action );
if (action.equals( AC_DRINK )) {
if (isKnown() && (
@ -155,10 +158,6 @@ public class Potion extends Item {
drink( hero );
}
} else {
super.execute( hero, action );
}
}

View File

@ -20,10 +20,6 @@
*/
package com.shatteredpixel.shatteredpixeldungeon.items.quest;
import java.util.ArrayList;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.watabou.noosa.audio.Sample;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
@ -35,14 +31,18 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon;
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite.Glowing;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.watabou.noosa.audio.Sample;
import com.watabou.utils.Bundle;
import com.watabou.utils.Callback;
import java.util.ArrayList;
public class Pickaxe extends Weapon {
public static final String AC_MINE = "MINE";
@ -82,6 +82,8 @@ public class Pickaxe extends Weapon {
@Override
public void execute( final Hero hero, String action ) {
super.execute( hero, action );
if (action == AC_MINE) {
@ -132,10 +134,6 @@ public class Pickaxe extends Weapon {
GLog.w( Messages.get(this, "no_vein") );
} else {
super.execute( hero, action );
}
}

View File

@ -119,6 +119,9 @@ public abstract class Scroll extends Item {
@Override
public void execute( Hero hero, String action ) {
super.execute( hero, action );
if (action.equals( AC_READ )) {
if (hero.buff( Blindness.class ) != null) {
@ -133,10 +136,6 @@ public abstract class Scroll extends Item {
doRead();
}
} else {
super.execute( hero, action );
}
}

View File

@ -20,37 +20,36 @@
*/
package com.shatteredpixel.shatteredpixeldungeon.items.wands;
import java.util.ArrayList;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Recharging;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.SoulMark;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
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.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Recharging;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.SoulMark;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
import com.shatteredpixel.shatteredpixeldungeon.effects.MagicMissile;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.bags.Bag;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfMagic.Magic;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff;
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.scenes.CellSelector;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.ui.QuickSlotButton;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.watabou.noosa.audio.Sample;
import com.watabou.utils.Bundle;
import com.watabou.utils.Callback;
import com.watabou.utils.PointF;
import com.watabou.utils.Random;
import java.util.ArrayList;
public abstract class Wand extends Item {
private static final int USAGES_TO_KNOW = 20;
@ -88,16 +87,15 @@ public abstract class Wand extends Item {
@Override
public void execute( Hero hero, String action ) {
super.execute( hero, action );
if (action.equals( AC_ZAP )) {
curUser = hero;
curItem = this;
GameScene.selectCell( zapper );
} else {
super.execute( hero, action );
}
}

View File

@ -107,6 +107,9 @@ public class MagesStaff extends MeleeWeapon {
@Override
public void execute(Hero hero, String action) {
super.execute(hero, action);
if (action.equals(AC_IMBUE)) {
curUser = hero;
@ -120,8 +123,7 @@ public class MagesStaff extends MeleeWeapon {
}
wand.execute(hero, AC_ZAP);
} else
super.execute(hero, action);
}
}
@Override

View File

@ -20,14 +20,9 @@
*/
package com.shatteredpixel.shatteredpixeldungeon.plants;
import java.util.ArrayList;
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.SandalsOfNature;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
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.buffs.Barkskin;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
@ -38,13 +33,18 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.particles.LeafParticle;
import com.shatteredpixel.shatteredpixeldungeon.items.Dewdrop;
import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.SandalsOfNature;
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.PlantSprite;
import com.watabou.noosa.audio.Sample;
import com.watabou.utils.Bundlable;
import com.watabou.utils.Bundle;
import com.watabou.utils.Random;
import java.util.ArrayList;
public abstract class Plant implements Bundlable {
public String plantName = Messages.get(this, "name");
@ -150,6 +150,9 @@ public abstract class Plant implements Bundlable {
@Override
public void execute( Hero hero, String action ) {
super.execute (hero, action );
if (action.equals( AC_PLANT )) {
hero.spend( TIME_TO_PLANT );
@ -158,10 +161,6 @@ public abstract class Plant implements Bundlable {
hero.sprite.operate( hero.pos );
} else {
super.execute (hero, action );
}
}