v2.0.0: implemented duelist abilities for the accurate weapons

This commit is contained in:
Evan Debenham
2022-11-28 17:24:05 -05:00
parent b7d580c0bc
commit 9a74c44844
5 changed files with 103 additions and 0 deletions

View File

@@ -1488,6 +1488,8 @@ items.weapon.melee.assassinsblade.desc=A small wavy blade made of obsidian, diff
items.weapon.melee.battleaxe.name=battle axe
items.weapon.melee.battleaxe.stats_desc=This is a rather accurate weapon.
items.weapon.melee.battleaxe.ability_name=heavy blow
items.weapon.melee.battleaxe.ability_desc=The Duelist can perform a _heavy blow_ with a battle axe. This strong but predictable attack has -75% accuracy, but deals +35% damage and applies vulnerable for 5 turns if it hits. Heavy blow can surprise attack.
items.weapon.melee.battleaxe.desc=The enormous steel head of this battle axe puts considerable heft behind each wide stroke.
items.weapon.melee.crossbow.name=crossbow
@@ -1540,6 +1542,8 @@ items.weapon.melee.greatsword.desc=This towering blade inflicts heavy damage by
items.weapon.melee.handaxe.name=hand axe
items.weapon.melee.handaxe.stats_desc=This is a rather accurate weapon.
items.weapon.melee.handaxe.ability_name=heavy blow
items.weapon.melee.handaxe.ability_desc=The Duelist can perform a _heavy blow_ with a hand axe. This strong but predictable attack has -75% accuracy, but deals +45% damage and applies vulnerable for 5 turns if it hits. Heavy blow can surprise attack.
items.weapon.melee.handaxe.desc=A light axe, most commonly used for felling trees. The wide blade works well against foes as well.
items.weapon.melee.knuckles.name=knuckleduster
@@ -1553,6 +1557,8 @@ items.weapon.melee.longsword.desc=This sword's long razor-sharp steel blade shin
items.weapon.melee.mace.name=mace
items.weapon.melee.mace.stats_desc=This is a rather accurate weapon.
items.weapon.melee.mace.ability_name=heavy blow
items.weapon.melee.mace.ability_desc=The Duelist can perform a _heavy blow_ with a mace. This strong but predictable attack has -75% accuracy, but deals +40% damage and applies vulnerable for 5 turns if it hits. Heavy blow can surprise attack.
items.weapon.melee.mace.desc=The large iron head of this weapon inflicts substantial damage.
items.weapon.melee.magesstaff.name=mage's staff
@@ -1635,6 +1641,8 @@ items.weapon.melee.sword$cleavetracker.desc=The duelist is ready to follow up on
items.weapon.melee.warhammer.name=war hammer
items.weapon.melee.warhammer.stats_desc=This is a rather accurate weapon.
items.weapon.melee.warhammer.ability_name=heavy blow
items.weapon.melee.warhammer.ability_desc=The Duelist can perform a _heavy blow_ with a war hammer. This strong but predictable attack has -75% accuracy, but deals +30% damage and applies vulnerable for 5 turns if it hits. Heavy blow can surprise attack.
items.weapon.melee.warhammer.desc=Few creatures can withstand the crushing blow of this towering mass of lead and steel, but it takes great strength to use effectively.
items.weapon.melee.whip.name=whip

View File

@@ -22,6 +22,8 @@
package com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
public class BattleAxe extends MeleeWeapon {
@@ -41,4 +43,14 @@ public class BattleAxe extends MeleeWeapon {
lvl*(tier+1); //scaling unchanged
}
@Override
public String targetingPrompt() {
return Messages.get(this, "prompt");
}
@Override
protected void duelistAbility(Hero hero, Integer target) {
Mace.heavyBlowAbility(hero, target, 1.35f, this);
}
}

View File

@@ -22,7 +22,17 @@
package com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee;
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.Vulnerable;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.watabou.noosa.audio.Sample;
import com.watabou.utils.Callback;
public class HandAxe extends MeleeWeapon {
@@ -41,4 +51,14 @@ public class HandAxe extends MeleeWeapon {
lvl*(tier+1); //scaling unchanged
}
@Override
public String targetingPrompt() {
return Messages.get(this, "prompt");
}
@Override
protected void duelistAbility(Hero hero, Integer target) {
Mace.heavyBlowAbility(hero, target, 1.45f, this);
}
}

View File

@@ -22,7 +22,17 @@
package com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee;
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.Vulnerable;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.watabou.noosa.audio.Sample;
import com.watabou.utils.Callback;
public class Mace extends MeleeWeapon {
@@ -41,4 +51,45 @@ public class Mace extends MeleeWeapon {
lvl*(tier+1); //scaling unchanged
}
@Override
public String targetingPrompt() {
return Messages.get(this, "prompt");
}
@Override
protected void duelistAbility(Hero hero, Integer target) {
Mace.heavyBlowAbility(hero, target, 1.40f, this);
}
public static void heavyBlowAbility(Hero hero, Integer target, float dmgMulti, MeleeWeapon wep){
if (target == null) {
return;
}
Char enemy = Actor.findChar(target);
if (enemy == null || enemy == hero || hero.isCharmedBy(enemy) || !Dungeon.level.heroFOV[target]) {
GLog.w(Messages.get(wep, "ability_no_target"));
return;
}
if (!hero.canAttack(enemy)){
GLog.w(Messages.get(wep, "ability_bad_position"));
return;
}
hero.sprite.attack(enemy.pos, new Callback() {
@Override
public void call() {
if (hero.attack(enemy, dmgMulti, 0, 0.25f)) {
Sample.INSTANCE.play(Assets.Sounds.HIT_STRONG);
if (enemy.isAlive()){
Buff.affect(enemy, Vulnerable.class, 5f);
}
}
hero.spendAndNext(hero.attackDelay());
wep.onAbilityUsed(hero);
}
});
}
}

View File

@@ -22,6 +22,8 @@
package com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
public class WarHammer extends MeleeWeapon {
@@ -41,4 +43,14 @@ public class WarHammer extends MeleeWeapon {
lvl*(tier+1); //scaling unchanged
}
@Override
public String targetingPrompt() {
return Messages.get(this, "prompt");
}
@Override
protected void duelistAbility(Hero hero, Integer target) {
Mace.heavyBlowAbility(hero, target, 1.30f, this);
}
}