mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
K'rrik and his phyrexian like ability
This commit is contained in:
committed by
swordshine
parent
ea552253ef
commit
b554198a96
@@ -707,4 +707,13 @@ public class ManaCostBeingPaid {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public boolean hasAnyKind(int kind) {
|
||||
for (ManaCostShard s : unpaidShards.keySet()) {
|
||||
if (s.isOfKind(kind)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
10
forge-gui/res/cardsfolder/upcoming/krrik_son_of_yawgmoth.txt
Normal file
10
forge-gui/res/cardsfolder/upcoming/krrik_son_of_yawgmoth.txt
Normal file
@@ -0,0 +1,10 @@
|
||||
Name:K'rrik, Son of Yawgmoth
|
||||
ManaCost:4 B/P B/P B/P
|
||||
Types:Legendary Creature Horror Minion
|
||||
PT:2/2
|
||||
K:Lifelink
|
||||
S:Mode$ Continuous | Affected$ You | AddKeyword$ PayLifeInsteadOf:B | Description$ For each {B} in a cost, you may pay 2 life rather than pay that mana.
|
||||
T:Mode$ SpellCast | ValidCard$ Card.Black | ValidActivatingPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigPutCounter | TriggerDescription$ Whenever you cast a black spell, put a +1/+1 counter on CARDNAME.
|
||||
SVar:TrigPutCounter:DB$ PutCounter | Defined$ Self | CounterType$ P1P1 | CounterNum$ 1
|
||||
SVar:BuffedBy:Card.Black
|
||||
Oracle:({B/P} can be paid with either {B} or 2 life.)\nLifelink\nFor each {B} in a cost, you may pay 2 life rather than pay that mana.\nWhenever you cast a black spell, put a +1/+1 counter on K'rrik, Son of Yawgmoth.
|
||||
@@ -1,5 +1,11 @@
|
||||
package forge.match.input;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import forge.card.mana.ManaAtom;
|
||||
import forge.card.mana.ManaCostShard;
|
||||
import forge.game.card.Card;
|
||||
import forge.game.mana.ManaConversionMatrix;
|
||||
import forge.game.mana.ManaCostBeingPaid;
|
||||
@@ -9,6 +15,7 @@ import forge.model.FModel;
|
||||
import forge.player.PlayerControllerHuman;
|
||||
import forge.properties.ForgePreferences;
|
||||
import forge.util.ITriggerEvent;
|
||||
import forge.util.Lang;
|
||||
|
||||
public class InputPayManaOfCostPayment extends InputPayMana {
|
||||
public InputPayManaOfCostPayment(final PlayerControllerHuman controller, ManaCostBeingPaid cost, SpellAbility spellAbility, Player payer, ManaConversionMatrix matrix) {
|
||||
@@ -19,14 +26,21 @@ public class InputPayManaOfCostPayment extends InputPayMana {
|
||||
}
|
||||
|
||||
private static final long serialVersionUID = 3467312982164195091L;
|
||||
private int phyLifeToLose = 0;
|
||||
//private int phyLifeToLose = 0;
|
||||
private ManaConversionMatrix extraMatrix;
|
||||
|
||||
@Override
|
||||
protected final void onPlayerSelected(Player selected, final ITriggerEvent triggerEvent) {
|
||||
if (player == selected) {
|
||||
if (player.canPayLife(this.phyLifeToLose + 2) && manaCost.payPhyrexian()) {
|
||||
this.phyLifeToLose += 2;
|
||||
if (player.canPayLife(this.phyLifeToLose + 2)) {
|
||||
if (manaCost.payPhyrexian()) {
|
||||
this.phyLifeToLose += 2;
|
||||
} else {
|
||||
if (player.hasKeyword("PayLifeInsteadOf:B") && manaCost.hasAnyKind(ManaAtom.BLACK)) {
|
||||
manaCost.decreaseShard(ManaCostShard.BLACK, 1);
|
||||
this.phyLifeToLose += 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.showMessage();
|
||||
@@ -71,8 +85,20 @@ public class InputPayManaOfCostPayment extends InputPayMana {
|
||||
msg.append(" life paid for phyrexian mana)");
|
||||
}
|
||||
|
||||
if (manaCost.containsPhyrexianMana()) {
|
||||
msg.append("\n(Click on your life total to pay life for phyrexian mana.)");
|
||||
boolean isLifeInsteadBlack = player.hasKeyword("PayLifeInsteadOf:B") && manaCost.hasAnyKind(ManaAtom.BLACK);
|
||||
|
||||
if (manaCost.containsPhyrexianMana() || isLifeInsteadBlack) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("Click on your life total to pay life for ");
|
||||
List<String> list = Lists.newArrayList();
|
||||
if (manaCost.containsPhyrexianMana()) {
|
||||
list.add("phyrexian mana");
|
||||
}
|
||||
if (isLifeInsteadBlack) {
|
||||
list.add("black mana");
|
||||
}
|
||||
sb.append(Lang.joinHomogenous(list, null, "or")).append(".");
|
||||
msg.append("\n(").append(sb).append(")");
|
||||
}
|
||||
|
||||
return msg.toString();
|
||||
|
||||
@@ -17,7 +17,13 @@
|
||||
*/
|
||||
package forge.match.input;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import forge.card.mana.ManaAtom;
|
||||
import forge.card.mana.ManaCost;
|
||||
import forge.card.mana.ManaCostShard;
|
||||
import forge.game.Game;
|
||||
import forge.game.card.Card;
|
||||
import forge.game.mana.ManaCostBeingPaid;
|
||||
@@ -27,6 +33,7 @@ import forge.model.FModel;
|
||||
import forge.player.PlayerControllerHuman;
|
||||
import forge.properties.ForgePreferences;
|
||||
import forge.util.ITriggerEvent;
|
||||
import forge.util.Lang;
|
||||
|
||||
//pays the cost of a card played from the player's hand
|
||||
//the card is removed from the players hand if the cost is paid
|
||||
@@ -64,8 +71,15 @@ public class InputPayManaSimple extends InputPayMana {
|
||||
@Override
|
||||
protected final void onPlayerSelected(final Player selected, final ITriggerEvent triggerEvent) {
|
||||
if (player == selected) {
|
||||
if (player.canPayLife(this.phyLifeToLose + 2) && manaCost.payPhyrexian()) {
|
||||
this.phyLifeToLose += 2;
|
||||
if (player.canPayLife(this.phyLifeToLose + 2)) {
|
||||
if (manaCost.payPhyrexian()) {
|
||||
this.phyLifeToLose += 2;
|
||||
} else {
|
||||
if (player.hasKeyword("PayLifeInsteadOf:B") && manaCost.hasAnyKind(ManaAtom.BLACK)) {
|
||||
manaCost.decreaseShard(ManaCostShard.BLACK, 1);
|
||||
this.phyLifeToLose += 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.showMessage();
|
||||
@@ -132,8 +146,20 @@ public class InputPayManaSimple extends InputPayMana {
|
||||
msg.append(" life paid for phyrexian mana)");
|
||||
}
|
||||
|
||||
if (this.manaCost.containsPhyrexianMana()) {
|
||||
msg.append("\n(Click on your life total to pay life for phyrexian mana.)");
|
||||
boolean isLifeInsteadBlack = player.hasKeyword("PayLifeInsteadOf:B") && manaCost.hasAnyKind(ManaAtom.BLACK);
|
||||
|
||||
if (manaCost.containsPhyrexianMana() || isLifeInsteadBlack) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("Click on your life total to pay life for ");
|
||||
List<String> list = Lists.newArrayList();
|
||||
if (manaCost.containsPhyrexianMana()) {
|
||||
list.add("phyrexian mana");
|
||||
}
|
||||
if (isLifeInsteadBlack) {
|
||||
list.add("black mana");
|
||||
}
|
||||
sb.append(Lang.joinHomogenous(list, null, "or")).append(".");
|
||||
msg.append("\n(").append(sb).append(")");
|
||||
}
|
||||
|
||||
// has its own variant of checkIfPaid
|
||||
|
||||
Reference in New Issue
Block a user