Skip to content

Commit

Permalink
Fix Potato not protecting Block
Browse files Browse the repository at this point in the history
  • Loading branch information
kiooeht committed Nov 29, 2018
1 parent 5af3c56 commit 0b8b080
Showing 1 changed file with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.evacipated.cardcrawl.mod.hubris.powers;

import com.evacipated.cardcrawl.mod.stslib.powers.interfaces.OnLoseBlockPower;
import com.evacipated.cardcrawl.mod.stslib.powers.interfaces.OnLoseTempHpPower;
import com.megacrit.cardcrawl.cards.DamageInfo;
import com.megacrit.cardcrawl.core.AbstractCreature;
Expand All @@ -8,7 +9,7 @@
import com.megacrit.cardcrawl.localization.PowerStrings;
import com.megacrit.cardcrawl.powers.AbstractPower;

public class PotatoPower extends AbstractPower implements OnLoseTempHpPower
public class PotatoPower extends AbstractPower implements OnLoseTempHpPower, OnLoseBlockPower
{
public static final String POWER_ID = "hubris:Potato";
private static final PowerStrings powerStrings = CardCrawlGame.languagePack.getPowerStrings(POWER_ID);
Expand Down Expand Up @@ -56,7 +57,7 @@ public void atEndOfTurn(boolean isPlayer)
@Override
public int onAttacked(DamageInfo info, int damageAmount)
{
if (duringTurn) {
if (duringTurn && damageAmount > 0) {
flashWithoutSound();
return 0;
}
Expand All @@ -66,7 +67,17 @@ public int onAttacked(DamageInfo info, int damageAmount)
@Override
public int onLoseTempHp(DamageInfo info, int damageAmount)
{
if (duringTurn) {
if (duringTurn && damageAmount > 0) {
flashWithoutSound();
return 0;
}
return damageAmount;
}

@Override
public int onLoseBlock(DamageInfo info, int damageAmount)
{
if (duringTurn && damageAmount > 0) {
flashWithoutSound();
return 0;
}
Expand Down

0 comments on commit 0b8b080

Please sign in to comment.