v2.0.0: stopped using xbow ability while buff is already present

This commit is contained in:
Evan Debenham
2023-01-13 16:51:54 -05:00
parent 098fed0450
commit ccb944fb30

View File

@@ -22,10 +22,13 @@
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.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
public class Crossbow extends MeleeWeapon {
@@ -47,6 +50,11 @@ public class Crossbow extends MeleeWeapon {
@Override
protected void duelistAbility(Hero hero, Integer target) {
if (hero.buff(ChargedShot.class) != null){
GLog.w(Messages.get(this, "ability_cant_use"));
return;
}
beforeAbilityUsed(hero);
Buff.affect(hero, ChargedShot.class);
hero.sprite.operate(hero.pos);