v2.0.0: added quickslot and wndItem functionality for duelist abilities

This commit is contained in:
Evan Debenham
2022-11-08 15:04:14 -05:00
parent f548aebcd8
commit 48330367c3
3 changed files with 41 additions and 3 deletions

View File

@@ -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.

View File

@@ -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();

View File

@@ -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<String> actions(Hero hero) {
ArrayList<String> 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