v2.1.0: reworked the Heavy Blow weapon ability

This commit is contained in:
Evan Debenham
2023-05-15 15:30:00 -04:00
parent 6c1b36b245
commit 08da3811f0
34 changed files with 176 additions and 76 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

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

View File

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

View File

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

View File

@@ -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 <http://www.gnu.org/licenses/>
*/
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);
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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