diff --git a/core/src/main/assets/messages/items/items.properties b/core/src/main/assets/messages/items/items.properties index 3febb897e..415edab55 100644 --- a/core/src/main/assets/messages/items/items.properties +++ b/core/src/main/assets/messages/items/items.properties @@ -1561,6 +1561,7 @@ items.weapon.melee.magesstaff.no_wand=The staff currently has no magic in it, it items.weapon.melee.magesstaff.has_wand=The staff is currently imbued with a _%s._ items.weapon.melee.magesstaff.cursed_wand=The staff is cursed, making its magic chaotic and random. +items.weapon.melee.meleeweapon.ac_ability=ABILITY items.weapon.melee.meleeweapon.stats_known=This _tier-%1$d_ melee weapon deals _%2$d-%3$d damage_ and requires _%4$d strength_ to use properly. items.weapon.melee.meleeweapon.stats_unknown=Typically this _tier-%1$d_ melee weapon deals _%2$d-%3$d damage_ and requires _%4$d strength_ to use properly. items.weapon.melee.meleeweapon.probably_too_heavy=Probably this weapon is too heavy for you. diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/HeroClass.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/HeroClass.java index 192144e74..47f840763 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/HeroClass.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/HeroClass.java @@ -213,8 +213,8 @@ public enum HeroClass { (hero.belongings.weapon = new Rapier()).identify(); - //quickslot and thrown weapons? - //Dungeon.quickslot.setSlot(0, hero.belongings.weapon); + //thrown weapons? + Dungeon.quickslot.setSlot(0, hero.belongings.weapon); new PotionOfStrength().identify(); new ScrollOfMirrorImage().identify(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/MeleeWeapon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/MeleeWeapon.java index 3bae46b8d..e0669c067 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/MeleeWeapon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/MeleeWeapon.java @@ -24,12 +24,49 @@ package com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; +import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.watabou.utils.Random; +import java.util.ArrayList; + public class MeleeWeapon extends Weapon { - + + public static String AC_ABILITY = "ABILITY"; + + @Override + public String defaultAction() { + if (Dungeon.hero != null && Dungeon.hero.heroClass == HeroClass.DUELIST){ + return AC_ABILITY; + } else { + return null; + } + } + + @Override + public ArrayList actions(Hero hero) { + ArrayList actions = super.actions(hero); + if (isEquipped(hero) && hero.heroClass == HeroClass.DUELIST){ + actions.add(AC_ABILITY); + } + return actions; + } + + @Override + public void execute(Hero hero, String action) { + super.execute(hero, action); + + if (action.equals(AC_ABILITY)){ + if (!isEquipped(hero)){ + GLog.w("Need to Equip!"); + } else { + GLog.i("Weapon Ability TODO"); + } + } + } + public int tier; @Override