diff --git a/core/src/main/assets/interfaces/buffs.png b/core/src/main/assets/interfaces/buffs.png index 3c9b04502..fab8b983d 100644 Binary files a/core/src/main/assets/interfaces/buffs.png and b/core/src/main/assets/interfaces/buffs.png differ diff --git a/core/src/main/assets/interfaces/large_buffs.png b/core/src/main/assets/interfaces/large_buffs.png index f84f75b1d..87385dd1e 100644 Binary files a/core/src/main/assets/interfaces/large_buffs.png and b/core/src/main/assets/interfaces/large_buffs.png differ diff --git a/core/src/main/assets/messages/actors/actors.properties b/core/src/main/assets/messages/actors/actors.properties index ee701a505..0d635a48b 100644 --- a/core/src/main/assets/messages/actors/actors.properties +++ b/core/src/main/assets/messages/actors/actors.properties @@ -171,6 +171,10 @@ actors.buffs.cripple.name=crippled actors.buffs.cripple.heromsg=You are crippled! actors.buffs.cripple.desc=You're pretty sure legs aren't meant to bend that way.\n\nCrippled halves movement speed, making moving a tile usually take two turns instead of one.\n\nTurns of cripple remaining: %s. +actors.buffs.daze.name=dazed +actors.buffs.daze.heromsg=You are dazed! +actors.buffs.daze.desc=Ringing ears and blurred vision make it difficult to fight.\n\nWhile dazed, accuracy and evasion are reduced by 50%%, making both landing and evading blows much harder.\n\nTurns of daze remaining: %s. + actors.buffs.degrade.name=degraded actors.buffs.degrade.heromsg=Your equipment feels weaker! actors.buffs.degrade.desc=Powerful dark magic is sapping the strength that scrolls of upgrade have applied to your equipment!\n\nWhile degraded, upgraded gear will be treated as if it is a lower level than it actually is. _Every upgrade after +3 becomes exponentially weaker than the last one._ The descriptions of your items will change to reflect their reduced power level.\n\nDegradation does not affect strength requirements, wand charges, durability of thrown weapons, or artifacts.\n\nTurns of degradation remaining: %s. Using a scroll of upgrade or remove curse will end degradation immediately. @@ -368,7 +372,7 @@ actors.buffs.stamina.desc=You have unending stamina, allowing for faster movemen actors.buffs.vulnerable.name=vulnerable actors.buffs.vulnerable.heromsg=You feel fragile! -actors.buffs.vulnerable.desc=This character's defenses have been weakened, increasing all physical damage that they take by 33%%, after that damage has been reduced by armor.\n\nTurns of vulnerable remaining: %s. +actors.buffs.vulnerable.desc=Vulnerability magic increases all physical damage that a character takes by 33%%, after that damage has been reduced by armor.\n\nTurns of vulnerable remaining: %s. actors.buffs.terror.name=terrified actors.buffs.terror.desc=Terror is manipulative magic which forces its target into an uncontrollable panic.\n\nTerrified characters are forced to run away from their opponent, trying to put as many doors and walls between them as possible. The shock of pain will lessen the duration of terror, however.\n\nTurns of terror remaining: %s. @@ -390,7 +394,7 @@ actors.buffs.wandempower.desc=Your damage-dealing wands have been empowered, inc actors.buffs.weakness.name=weakened actors.buffs.weakness.heromsg=You feel weakened! -actors.buffs.weakness.desc=Everything suddenly seems much heavier.\n\nWeakening reduces a character's physical strength, causing them to deal 33%% reduced damage.\n\nTurns of weakness remaining: %s. +actors.buffs.weakness.desc=Everything suddenly seems much heavier.\n\nWeakening magic reduces a character's physical strength, causing them to deal 33%% reduced damage.\n\nTurns of weakness remaining: %s. actors.buffs.wellfed.name=well fed actors.buffs.wellfed.desc=You feel quite satisfied and full.\n\nWhile well fed, your hunger will not increase, and you will heal an additional amount of health over time.\n\nTurns remaining: %d. diff --git a/core/src/main/assets/messages/items/items.properties b/core/src/main/assets/messages/items/items.properties index 50292a703..58f864492 100644 --- a/core/src/main/assets/messages/items/items.properties +++ b/core/src/main/assets/messages/items/items.properties @@ -1515,7 +1515,7 @@ 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 +55% damage and applies vulnerable and weaken for 5 turns if it hits. Heavy blow can surprise attack. +items.weapon.melee.battleaxe.ability_desc=The Duelist can perform a _heavy blow_ with a battle axe. This concentrated attack deals +35% damage and dazes for 5 turns, reducing accuracy and evasion by 50%. This ability costs 2 charges unless it surprises the enemy. 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 @@ -1586,7 +1586,7 @@ 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 +65% damage and applies vulnerable and weaken for 5 turns if it hits. Heavy blow can surprise attack. +items.weapon.melee.handaxe.ability_desc=The Duelist can perform a _heavy blow_ with a hand axe. This concentrated attack deals +45% damage and dazes for 5 turns, reducing accuracy and evasion by 50%. This ability costs 2 charges unless it surprises the enemy. 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.katana.name=katana @@ -1602,7 +1602,7 @@ 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 +60% damage and applies vulnerable and weaken for 5 turns if it hits. Heavy blow can surprise attack. +items.weapon.melee.mace.ability_desc=The Duelist can perform a _heavy blow_ with a mace. This concentrated attack deals +40% damage and dazes for 5 turns, reducing accuracy and evasion by 50%. This ability costs 2 charges unless it surprises the enemy. items.weapon.melee.mace.desc=The large iron head of this weapon inflicts substantial damage. items.weapon.melee.magesstaff.name=mage's staff @@ -1713,7 +1713,7 @@ 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 +50% damage and applies vulnerable and weaken for 5 turns if it hits. Heavy blow can surprise attack. +items.weapon.melee.warhammer.ability_desc=The Duelist can perform a _heavy blow_ with a war hammer. This concentrated attack deals +30% damage and dazes for 5 turns, reducing accuracy and evasion by 50%. This ability costs 2 charges unless it surprises the enemy. 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.warscythe.name=war scythe diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java index 3f1ec6205..f6f6f20d7 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java @@ -41,6 +41,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Charm; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Chill; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Corrosion; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Cripple; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Daze; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Doom; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Dread; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.FireImbue; @@ -542,6 +543,7 @@ public abstract class Char extends Actor { float acuRoll = Random.Float( acuStat ); if (attacker.buff(Bless.class) != null) acuRoll *= 1.25f; if (attacker.buff( Hex.class) != null) acuRoll *= 0.8f; + if (attacker.buff( Daze.class) != null) acuRoll *= 0.5f; for (ChampionEnemy buff : attacker.buffs(ChampionEnemy.class)){ acuRoll *= buff.evasionAndAccuracyFactor(); } @@ -550,6 +552,7 @@ public abstract class Char extends Actor { float defRoll = Random.Float( defStat ); if (defender.buff(Bless.class) != null) defRoll *= 1.25f; if (defender.buff( Hex.class) != null) defRoll *= 0.8f; + if (defender.buff( Daze.class) != null) defRoll *= 0.5f; for (ChampionEnemy buff : defender.buffs(ChampionEnemy.class)){ defRoll *= buff.evasionAndAccuracyFactor(); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Daze.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Daze.java new file mode 100644 index 000000000..1204cb150 --- /dev/null +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Daze.java @@ -0,0 +1,45 @@ +/* + * Pixel Dungeon + * Copyright (C) 2012-2015 Oleg Dolya + * + * Shattered Pixel Dungeon + * Copyright (C) 2014-2023 Evan Debenham + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + */ + +package com.shatteredpixel.shatteredpixeldungeon.actors.buffs; + +import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; + +public class Daze extends FlavourBuff { + + public static final float DURATION = 5f; + + { + type = buffType.NEGATIVE; + announced = true; + } + + @Override + public int icon() { + return BuffIndicator.DAZE; + } + + @Override + public float iconFadePercent() { + return Math.max(0, (DURATION - visualcooldown()) / DURATION); + } + +} diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/quest/Pickaxe.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/quest/Pickaxe.java index c331ac610..e79c39074 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/quest/Pickaxe.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/quest/Pickaxe.java @@ -208,7 +208,7 @@ public class Pickaxe extends MeleeWeapon { || enemy instanceof Scorpio) { damageMulti = 2f; } - beforeAbilityUsed(hero); + beforeAbilityUsed(hero, enemy); AttackIndicator.target(enemy); if (hero.attack(enemy, damageMulti, 0, Char.INFINITE_ACCURACY)) { if (enemy.isAlive()) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfCorruption.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfCorruption.java index 562ab4419..7faae4889 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfCorruption.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfCorruption.java @@ -38,6 +38,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Chill; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Corrosion; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Corruption; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Cripple; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Daze; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Doom; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Dread; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Drowsy; @@ -112,6 +113,7 @@ public class WandOfCorruption extends Wand { MAJOR_DEBUFFS.put(Hex.class, 2f); MAJOR_DEBUFFS.put(Paralysis.class, 1f); + MAJOR_DEBUFFS.put(Daze.class, 0f); MAJOR_DEBUFFS.put(Dread.class, 0f); MAJOR_DEBUFFS.put(Charm.class, 0f); MAJOR_DEBUFFS.put(MagicalSleep.class, 0f); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/AssassinsBlade.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/AssassinsBlade.java index 2ec23a6bc..8a463a858 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/AssassinsBlade.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/AssassinsBlade.java @@ -25,7 +25,6 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; -import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.watabou.utils.Random; @@ -67,8 +66,8 @@ public class AssassinsBlade extends MeleeWeapon { } @Override - public float abilityChargeUse( Hero hero ) { - return 2*super.abilityChargeUse(hero); + public float abilityChargeUse(Hero hero, Char target) { + return 2*super.abilityChargeUse(hero, target); } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/BattleAxe.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/BattleAxe.java index 6f7854cdf..521cfe76c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/BattleAxe.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/BattleAxe.java @@ -22,7 +22,9 @@ package com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee; import com.shatteredpixel.shatteredpixeldungeon.Assets; +import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; @@ -48,9 +50,18 @@ public class BattleAxe extends MeleeWeapon { return Messages.get(this, "prompt"); } + @Override + public float abilityChargeUse(Hero hero, Char target) { + if (target == null || (target instanceof Mob && ((Mob) target).surprisedBy(hero))) { + return super.abilityChargeUse(hero, target); + } else { + return 2*super.abilityChargeUse(hero, target); + } + } + @Override protected void duelistAbility(Hero hero, Integer target) { - Mace.heavyBlowAbility(hero, target, 1.55f, this); + Mace.heavyBlowAbility(hero, target, 1.35f, this); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Crossbow.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Crossbow.java index 6a6d6d7e3..7b4dc6729 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Crossbow.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Crossbow.java @@ -22,11 +22,8 @@ package com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee; import com.shatteredpixel.shatteredpixeldungeon.Assets; -import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.FlavourBuff; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; -import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfForce; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; @@ -72,7 +69,7 @@ public class Crossbow extends MeleeWeapon { return; } - beforeAbilityUsed(hero); + beforeAbilityUsed(hero, null); Buff.affect(hero, ChargedShot.class); hero.sprite.operate(hero.pos); hero.next(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Dagger.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Dagger.java index 60ada187d..c247bda4f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Dagger.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Dagger.java @@ -31,13 +31,8 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; -import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; -import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; -import com.shatteredpixel.shatteredpixeldungeon.utils.BArray; -import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.watabou.noosa.audio.Sample; -import com.watabou.utils.PathFinder; import com.watabou.utils.Random; public class Dagger extends MeleeWeapon { @@ -80,8 +75,8 @@ public class Dagger extends MeleeWeapon { } @Override - public float abilityChargeUse( Hero hero ) { - return 2*super.abilityChargeUse(hero); + public float abilityChargeUse(Hero hero, Char target) { + return 2*super.abilityChargeUse(hero, target); } @Override @@ -90,7 +85,7 @@ public class Dagger extends MeleeWeapon { } public static void sneakAbility(Hero hero, int invisTurns, MeleeWeapon wep){ - wep.beforeAbilityUsed(hero); + wep.beforeAbilityUsed(hero, null); Buff.affect(hero, Invisibility.class, invisTurns); hero.spendAndNext(Actor.TICK); CellEmitter.get( Dungeon.hero.pos ).burst( Speck.factory( Speck.WOOL ), 6 ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Dirk.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Dirk.java index c3cfbea95..dee1e4210 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Dirk.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Dirk.java @@ -25,7 +25,6 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; -import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.watabou.utils.Random; @@ -67,8 +66,8 @@ public class Dirk extends MeleeWeapon { } @Override - public float abilityChargeUse( Hero hero ) { - return 2*super.abilityChargeUse(hero); + public float abilityChargeUse(Hero hero, Char target) { + return 2*super.abilityChargeUse(hero, target); } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Flail.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Flail.java index c4101a35f..ac4efae03 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Flail.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Flail.java @@ -89,11 +89,11 @@ public class Flail extends MeleeWeapon { } } - public float abilityChargeUse( Hero hero ) { + public float abilityChargeUse(Hero hero, Char target) { if (Dungeon.hero.buff(SpinAbilityTracker.class) != null){ return 0; } else { - return 2*super.abilityChargeUse(hero); + return 2*super.abilityChargeUse(hero, target); } } @@ -106,7 +106,7 @@ public class Flail extends MeleeWeapon { return; } - beforeAbilityUsed(hero); + beforeAbilityUsed(hero, null); if (spin == null){ spin = Buff.affect(hero, SpinAbilityTracker.class, 3f); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Greataxe.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Greataxe.java index 869a0359d..9b29268da 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Greataxe.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Greataxe.java @@ -88,7 +88,7 @@ public class Greataxe extends MeleeWeapon { hero.sprite.attack(enemy.pos, new Callback() { @Override public void call() { - beforeAbilityUsed(hero); + beforeAbilityUsed(hero, enemy); AttackIndicator.target(enemy); if (hero.attack(enemy, 1.50f, 0, Char.INFINITE_ACCURACY)){ Sample.INSTANCE.play(Assets.Sounds.HIT_STRONG); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Greatsword.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Greatsword.java index 0c3d9217a..1ab5c566e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Greatsword.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Greatsword.java @@ -22,7 +22,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee; import com.shatteredpixel.shatteredpixeldungeon.Assets; -import com.shatteredpixel.shatteredpixeldungeon.Dungeon; +import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; @@ -38,11 +38,11 @@ public class Greatsword extends MeleeWeapon { } @Override - public float abilityChargeUse( Hero hero ) { + public float abilityChargeUse(Hero hero, Char target) { if (hero.buff(Sword.CleaveTracker.class) != null){ return 0; } else { - return super.abilityChargeUse( hero ); + return super.abilityChargeUse( hero, target); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/HandAxe.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/HandAxe.java index edb74d1d8..600cb157c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/HandAxe.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/HandAxe.java @@ -28,6 +28,7 @@ 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.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; @@ -56,9 +57,18 @@ public class HandAxe extends MeleeWeapon { return Messages.get(this, "prompt"); } + @Override + public float abilityChargeUse(Hero hero, Char target) { + if (target == null || (target instanceof Mob && ((Mob) target).surprisedBy(hero))) { + return super.abilityChargeUse(hero, target); + } else { + return 2*super.abilityChargeUse(hero, target); + } + } + @Override protected void duelistAbility(Hero hero, Integer target) { - Mace.heavyBlowAbility(hero, target, 1.65f, this); + Mace.heavyBlowAbility(hero, target, 0.45f, this); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Longsword.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Longsword.java index e01adb136..7d884917d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Longsword.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Longsword.java @@ -22,7 +22,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee; import com.shatteredpixel.shatteredpixeldungeon.Assets; -import com.shatteredpixel.shatteredpixeldungeon.Dungeon; +import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; @@ -38,11 +38,11 @@ public class Longsword extends MeleeWeapon { } @Override - public float abilityChargeUse( Hero hero ) { + public float abilityChargeUse(Hero hero, Char target) { if (hero.buff(Sword.CleaveTracker.class) != null){ return 0; } else { - return super.abilityChargeUse( hero ); + return super.abilityChargeUse( hero, target); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Mace.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Mace.java index a47a75140..222165429 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Mace.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Mace.java @@ -26,10 +26,12 @@ 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.Daze; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Vulnerable; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Weakness; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.ui.AttackIndicator; @@ -59,9 +61,18 @@ public class Mace extends MeleeWeapon { return Messages.get(this, "prompt"); } + @Override + public float abilityChargeUse(Hero hero, Char target) { + if (target == null || (target instanceof Mob && ((Mob) target).surprisedBy(hero))) { + return super.abilityChargeUse(hero, target); + } else { + return 2*super.abilityChargeUse(hero, target); + } + } + @Override protected void duelistAbility(Hero hero, Integer target) { - Mace.heavyBlowAbility(hero, target, 1.60f, this); + Mace.heavyBlowAbility(hero, target, 1.40f, this); } public static void heavyBlowAbility(Hero hero, Integer target, float dmgMulti, MeleeWeapon wep){ @@ -83,16 +94,31 @@ public class Mace extends MeleeWeapon { } hero.belongings.abilityWeapon = null; + //need to separately check charges here, as non-surprise attacks cost 2 + if (enemy instanceof Mob && !((Mob) enemy).surprisedBy(hero)){ + Charger charger = Buff.affect(hero, Charger.class); + if (Dungeon.hero.belongings.weapon == wep) { + if (charger.charges + charger.partialCharge < wep.abilityChargeUse(hero, enemy)){ + GLog.w(Messages.get(wep, "ability_no_charge")); + return; + } + } else { + if (charger.secondCharges + charger.secondPartialCharge < wep.abilityChargeUse(hero, enemy)){ + GLog.w(Messages.get(wep, "ability_no_charge")); + return; + } + } + } + hero.sprite.attack(enemy.pos, new Callback() { @Override public void call() { - wep.beforeAbilityUsed(hero); + wep.beforeAbilityUsed(hero, enemy); AttackIndicator.target(enemy); - if (hero.attack(enemy, dmgMulti, 0, 0.25f)) { + if (hero.attack(enemy, dmgMulti, 0, Char.INFINITE_ACCURACY)) { Sample.INSTANCE.play(Assets.Sounds.HIT_STRONG); if (enemy.isAlive()){ - Buff.affect(enemy, Vulnerable.class, 5f); - Buff.affect(enemy, Weakness.class, 5f); + Buff.affect(enemy, Daze.class, Daze.DURATION); } else { wep.onAbilityKill(hero, enemy); } 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 507523d13..88e2ba1d7 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 @@ -116,11 +116,11 @@ public class MeleeWeapon extends Weapon { GLog.w(Messages.get(this, "ability_low_str")); usesTargeting = false; } else if (hero.belongings.weapon == this && - (Buff.affect(hero, Charger.class).charges + Buff.affect(hero, Charger.class).partialCharge) < abilityChargeUse(hero)) { + (Buff.affect(hero, Charger.class).charges + Buff.affect(hero, Charger.class).partialCharge) < abilityChargeUse(hero, null)) { GLog.w(Messages.get(this, "ability_no_charge")); usesTargeting = false; } else if (hero.belongings.secondWep == this && - (Buff.affect(hero, Charger.class).secondCharges + Buff.affect(hero, Charger.class).secondPartialCharge) < abilityChargeUse(hero)) { + (Buff.affect(hero, Charger.class).secondCharges + Buff.affect(hero, Charger.class).secondPartialCharge) < abilityChargeUse(hero, null)) { GLog.w(Messages.get(this, "ability_no_charge")); usesTargeting = false; } else { @@ -194,18 +194,18 @@ public class MeleeWeapon extends Weapon { //do nothing by default } - protected void beforeAbilityUsed(Hero hero ){ + protected void beforeAbilityUsed(Hero hero, Char target){ hero.belongings.abilityWeapon = this; Charger charger = Buff.affect(hero, Charger.class); if (Dungeon.hero.belongings.weapon == this) { - charger.partialCharge -= abilityChargeUse(hero); + charger.partialCharge -= abilityChargeUse(hero, target); while (charger.partialCharge < 0 && charger.charges > 0) { charger.charges--; charger.partialCharge++; } } else { - charger.secondPartialCharge -= abilityChargeUse(hero); + charger.secondPartialCharge -= abilityChargeUse(hero, target); while (charger.secondPartialCharge < 0 && charger.secondCharges > 0) { charger.secondCharges--; charger.secondPartialCharge++; @@ -266,7 +266,7 @@ public class MeleeWeapon extends Weapon { } } - public float abilityChargeUse( Hero hero ){ + public float abilityChargeUse(Hero hero, Char target){ float chargeUse = 1f; if (hero.buff(Talent.CounterAbilityTacker.class) != null){ chargeUse = Math.max(0, chargeUse-0.5f*hero.pointsInTalent(Talent.COUNTER_ABILITY)); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Quarterstaff.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Quarterstaff.java index da83834b0..f07b7948a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Quarterstaff.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Quarterstaff.java @@ -51,13 +51,13 @@ public class Quarterstaff extends MeleeWeapon { } @Override - public float abilityChargeUse(Hero hero) { - return 2*super.abilityChargeUse(hero); + public float abilityChargeUse(Hero hero, Char target) { + return 2*super.abilityChargeUse(hero, target); } @Override protected void duelistAbility(Hero hero, Integer target) { - beforeAbilityUsed(hero); + beforeAbilityUsed(hero, null); Buff.prolong(hero, DefensiveStance.class, 4f); //4 turns as using the ability is instant hero.sprite.operate(hero.pos); hero.next(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Rapier.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Rapier.java index 4c8063d75..5df87b7ff 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Rapier.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Rapier.java @@ -125,7 +125,7 @@ public class Rapier extends MeleeWeapon { @Override public void call() { - wep.beforeAbilityUsed(hero); + wep.beforeAbilityUsed(hero, enemy); AttackIndicator.target(enemy); if (hero.attack(enemy, dmgMulti, dmgBoost, Char.INFINITE_ACCURACY)) { Sample.INSTANCE.play(Assets.Sounds.HIT_STRONG); @@ -139,7 +139,7 @@ public class Rapier extends MeleeWeapon { } }); } else { - wep.beforeAbilityUsed(hero); + wep.beforeAbilityUsed(hero, null); GLog.w(Messages.get(Rapier.class, "ability_no_target")); hero.spendAndNext(hero.speed()); wep.afterAbilityUsed(hero); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/RoundShield.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/RoundShield.java index 4b1818806..2919c3bb4 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/RoundShield.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/RoundShield.java @@ -66,7 +66,7 @@ public class RoundShield extends MeleeWeapon { } public static void guardAbility(Hero hero, int duration, MeleeWeapon wep){ - wep.beforeAbilityUsed(hero); + wep.beforeAbilityUsed(hero, null); Buff.prolong(hero, GuardTracker.class, duration); hero.sprite.operate(hero.pos); hero.spendAndNext(Actor.TICK); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/RunicBlade.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/RunicBlade.java index d11af94fb..c2a97b8d2 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/RunicBlade.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/RunicBlade.java @@ -86,7 +86,7 @@ public class RunicBlade extends MeleeWeapon { hero.sprite.attack(enemy.pos, new Callback() { @Override public void call() { - beforeAbilityUsed(hero); + beforeAbilityUsed(hero, enemy); AttackIndicator.target(enemy); if (hero.attack(enemy, 1f, 0, Char.INFINITE_ACCURACY)){ Sample.INSTANCE.play(Assets.Sounds.HIT_STRONG); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Sai.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Sai.java index 32a6c7330..c3bc3ac3e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Sai.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Sai.java @@ -26,7 +26,6 @@ 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.FlavourBuff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; @@ -38,8 +37,6 @@ import com.watabou.noosa.audio.Sample; import com.watabou.utils.Bundle; import com.watabou.utils.Callback; -import java.util.HashSet; - public class Sai extends MeleeWeapon { { @@ -89,7 +86,7 @@ public class Sai extends MeleeWeapon { hero.sprite.attack(enemy.pos, new Callback() { @Override public void call() { - wep.beforeAbilityUsed(hero); + wep.beforeAbilityUsed(hero, enemy); AttackIndicator.target(enemy); int recentHits = 0; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Scimitar.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Scimitar.java index b8e4600eb..5eb100763 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Scimitar.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Scimitar.java @@ -22,6 +22,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee; import com.shatteredpixel.shatteredpixeldungeon.Assets; +import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.FlavourBuff; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; @@ -46,13 +47,13 @@ public class Scimitar extends MeleeWeapon { } @Override - public float abilityChargeUse(Hero hero) { - return 2*super.abilityChargeUse(hero); + public float abilityChargeUse(Hero hero, Char target) { + return 2*super.abilityChargeUse(hero, target); } @Override protected void duelistAbility(Hero hero, Integer target) { - beforeAbilityUsed(hero); + beforeAbilityUsed(hero, null); Buff.prolong(hero, SwordDance.class, 4f); //4 turns as using the ability is instant hero.sprite.operate(hero.pos); hero.next(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Shortsword.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Shortsword.java index b8df33f7e..acb6a9a72 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Shortsword.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Shortsword.java @@ -22,7 +22,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee; import com.shatteredpixel.shatteredpixeldungeon.Assets; -import com.shatteredpixel.shatteredpixeldungeon.Dungeon; +import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; @@ -38,11 +38,11 @@ public class Shortsword extends MeleeWeapon { } @Override - public float abilityChargeUse( Hero hero ) { + public float abilityChargeUse(Hero hero, Char target) { if (hero.buff(Sword.CleaveTracker.class) != null){ return 0; } else { - return super.abilityChargeUse( hero ); + return super.abilityChargeUse( hero, target); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Sickle.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Sickle.java index 4ebd430f0..fd8b7e87e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Sickle.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Sickle.java @@ -86,7 +86,7 @@ public class Sickle extends MeleeWeapon { hero.sprite.attack(enemy.pos, new Callback() { @Override public void call() { - wep.beforeAbilityUsed(hero); + wep.beforeAbilityUsed(hero, enemy); AttackIndicator.target(enemy); Buff.affect(enemy, HarvestBleedTracker.class, 0).bleedFactor = bleedFactor; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Spear.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Spear.java index 7c5b85eb4..d6fa77ffa 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Spear.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Spear.java @@ -86,7 +86,7 @@ public class Spear extends MeleeWeapon { hero.sprite.attack(enemy.pos, new Callback() { @Override public void call() { - wep.beforeAbilityUsed(hero); + wep.beforeAbilityUsed(hero, enemy); AttackIndicator.target(enemy); if (hero.attack(enemy, dmgMulti, 0, Char.INFINITE_ACCURACY)) { if (enemy.isAlive()){ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Sword.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Sword.java index 987f01cc9..d53501193 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Sword.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Sword.java @@ -48,11 +48,11 @@ public class Sword extends MeleeWeapon { } @Override - public float abilityChargeUse( Hero hero ) { + public float abilityChargeUse(Hero hero, Char target) { if (hero.buff(Sword.CleaveTracker.class) != null){ return 0; } else { - return super.abilityChargeUse( hero ); + return super.abilityChargeUse( hero, target); } } @@ -88,7 +88,7 @@ public class Sword extends MeleeWeapon { hero.sprite.attack(enemy.pos, new Callback() { @Override public void call() { - wep.beforeAbilityUsed(hero); + wep.beforeAbilityUsed(hero, enemy); AttackIndicator.target(enemy); if (hero.attack(enemy, dmgMulti, 0, Char.INFINITE_ACCURACY)){ Sample.INSTANCE.play(Assets.Sounds.HIT_STRONG); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/WarHammer.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/WarHammer.java index 2d0d92d6b..84c6de7ed 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/WarHammer.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/WarHammer.java @@ -22,7 +22,9 @@ package com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee; import com.shatteredpixel.shatteredpixeldungeon.Assets; +import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; @@ -48,9 +50,18 @@ public class WarHammer extends MeleeWeapon { return Messages.get(this, "prompt"); } + @Override + public float abilityChargeUse(Hero hero, Char target) { + if (target == null || (target instanceof Mob && ((Mob) target).surprisedBy(hero))) { + return super.abilityChargeUse(hero, target); + } else { + return 2*super.abilityChargeUse(hero, target); + } + } + @Override protected void duelistAbility(Hero hero, Integer target) { - Mace.heavyBlowAbility(hero, target, 1.50f, this); + Mace.heavyBlowAbility(hero, target, 1.30f, this); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Whip.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Whip.java index 6aa89ffeb..ad98dbb6a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Whip.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Whip.java @@ -29,7 +29,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; -import com.shatteredpixel.shatteredpixeldungeon.ui.AttackIndicator; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.watabou.utils.Callback; @@ -82,7 +81,7 @@ public class Whip extends MeleeWeapon { hero.sprite.attack(hero.pos, new Callback() { @Override public void call() { - beforeAbilityUsed(hero); + beforeAbilityUsed(hero, finalClosest); for (Char ch : targets) { hero.attack(ch, 0, 1, ch == finalClosest ? Char.INFINITE_ACCURACY : 1); if (!ch.isAlive()){ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/WornShortsword.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/WornShortsword.java index e149d9112..4fbbe3d17 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/WornShortsword.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/WornShortsword.java @@ -22,7 +22,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee; import com.shatteredpixel.shatteredpixeldungeon.Assets; -import com.shatteredpixel.shatteredpixeldungeon.Dungeon; +import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; @@ -40,11 +40,11 @@ public class WornShortsword extends MeleeWeapon { } @Override - public float abilityChargeUse( Hero hero ) { + public float abilityChargeUse(Hero hero, Char target) { if (hero.buff(Sword.CleaveTracker.class) != null){ return 0; } else { - return super.abilityChargeUse( hero ); + return super.abilityChargeUse( hero, target); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/BuffIndicator.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/BuffIndicator.java index 3e2bb4664..a469de2af 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/BuffIndicator.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/BuffIndicator.java @@ -121,6 +121,7 @@ public class BuffIndicator extends Component { public static final int CHALLENGE = 67; public static final int MONK_ENERGY = 68; public static final int DUEL_COMBO = 69; + public static final int DAZE = 70; public static final int SIZE_SMALL = 7; public static final int SIZE_LARGE = 16;