v2.0.0: stopped using xbow ability while buff is already present
This commit is contained in:
+8
@@ -22,10 +22,13 @@
|
|||||||
package com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee;
|
package com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||||
|
|
||||||
public class Crossbow extends MeleeWeapon {
|
public class Crossbow extends MeleeWeapon {
|
||||||
|
|
||||||
@@ -47,6 +50,11 @@ public class Crossbow extends MeleeWeapon {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void duelistAbility(Hero hero, Integer target) {
|
protected void duelistAbility(Hero hero, Integer target) {
|
||||||
|
if (hero.buff(ChargedShot.class) != null){
|
||||||
|
GLog.w(Messages.get(this, "ability_cant_use"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
beforeAbilityUsed(hero);
|
beforeAbilityUsed(hero);
|
||||||
Buff.affect(hero, ChargedShot.class);
|
Buff.affect(hero, ChargedShot.class);
|
||||||
hero.sprite.operate(hero.pos);
|
hero.sprite.operate(hero.pos);
|
||||||
|
|||||||
Reference in New Issue
Block a user