mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 12:31:59 -08:00
updated Krark's Thumb, still doesn't work in multiples
This commit is contained in:
parent
57a362ae29
commit
c34f611279
5 changed files with 51 additions and 18 deletions
|
|
@ -1,5 +1,7 @@
|
|||
package mage.game.events;
|
||||
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
|
|
@ -21,10 +23,18 @@ public class CoinFlippedEvent extends GameEvent {
|
|||
return result;
|
||||
}
|
||||
|
||||
public String getResultName() {
|
||||
return CardUtil.booleanToFlipName(result);
|
||||
}
|
||||
|
||||
public boolean getChosen() {
|
||||
return chosen;
|
||||
}
|
||||
|
||||
public String getChosenName() {
|
||||
return CardUtil.booleanToFlipName(chosen);
|
||||
}
|
||||
|
||||
public boolean isWinnable() {
|
||||
return winnable;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package mage.game.events;
|
||||
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
|
|
@ -21,6 +23,10 @@ public class FlipCoinEvent extends GameEvent {
|
|||
return result;
|
||||
}
|
||||
|
||||
public String getResultName() {
|
||||
return CardUtil.booleanToFlipName(result);
|
||||
}
|
||||
|
||||
public void setResult(boolean result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
|
@ -29,6 +35,10 @@ public class FlipCoinEvent extends GameEvent {
|
|||
return chosen;
|
||||
}
|
||||
|
||||
public String getChosenName() {
|
||||
return CardUtil.booleanToFlipName(chosen);
|
||||
}
|
||||
|
||||
public boolean isWinnable() {
|
||||
return winnable;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2558,7 +2558,7 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
|
||||
@Override
|
||||
public boolean flipCoin(Ability source, Game game, boolean winnable) {
|
||||
return this.flipCoin(source, game, true, null);
|
||||
return this.flipCoin(source, game, winnable, null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -354,6 +354,13 @@ public final class CardUtil {
|
|||
return message;
|
||||
}
|
||||
|
||||
public static String booleanToFlipName(boolean flip) {
|
||||
if (flip) {
|
||||
return "Heads";
|
||||
}
|
||||
return "Tails";
|
||||
}
|
||||
|
||||
public static boolean checkNumeric(String s) {
|
||||
return s.chars().allMatch(Character::isDigit);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue