mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
- Rewrote the Bloodthirst keyword as a macro for a proper replacement effect.
This commit is contained in:
@@ -2322,22 +2322,7 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
sbLong.append(keywords.get(i).toString()).append("\r\n");
|
||||
} else if (keyword.toString().contains("tap: add ")) {
|
||||
sbMana.append(keywords.get(i).toString()).append("\r\n");
|
||||
} else if (keyword.contains("Bloodthirst")) {
|
||||
final String k = keywords.get(i);
|
||||
final String[] kk = k.split(" ");
|
||||
sbLong.append(keywords.get(i)).append(
|
||||
" (If an opponent was dealt damage this turn, this creature enters the battlefield with ");
|
||||
sbLong.append(kk[1]).append(" +1/+1 counter");
|
||||
if (kk[1].equals("X")) {
|
||||
sbLong.append("s on it, where X is the damage dealt to your opponents this turn.)");
|
||||
sbLong.append("\r\n");
|
||||
} else {
|
||||
if (Integer.parseInt(kk[1]) > 1) {
|
||||
sbLong.append("s");
|
||||
}
|
||||
sbLong.append(" on it.)").append("\r\n");
|
||||
}
|
||||
} else if (keyword.startsWith("Modular") || keyword.startsWith("Soulshift")
|
||||
} else if (keyword.startsWith("Modular") || keyword.startsWith("Soulshift") || keyword.startsWith("Bloodthirst")
|
||||
|| keyword.startsWith("ETBReplacement") || keyword.startsWith("MayEffectFromOpeningHand")) {
|
||||
continue;
|
||||
} else if (keyword.startsWith("Provoke")) {
|
||||
|
||||
@@ -2108,6 +2108,10 @@ public class CardFactoryUtil {
|
||||
return CardFactoryUtil.doXMath(c.getDamageDoneThisTurn(), m, c);
|
||||
}
|
||||
|
||||
if (sq[0].equals("BloodthirstAmount")) {
|
||||
return CardFactoryUtil.doXMath(c.getController().getBloodthirstAmount(), m, c);
|
||||
}
|
||||
|
||||
if (sq[0].contains("RegeneratedThisTurn")) {
|
||||
return CardFactoryUtil.doXMath(c.getRegeneratedThisTurn(), m, c);
|
||||
}
|
||||
@@ -2203,7 +2207,11 @@ public class CardFactoryUtil {
|
||||
}
|
||||
|
||||
if (sq[0].contains("LifeOppLostThisTurn")) {
|
||||
return CardFactoryUtil.doXMath(cardController.getOpponent().getLifeLostThisTurn(), m, c);
|
||||
int lost = 0;
|
||||
for (Player opp : cardController.getOpponents()) {
|
||||
lost += opp.getLifeLostThisTurn();
|
||||
}
|
||||
return CardFactoryUtil.doXMath(lost, m, c);
|
||||
}
|
||||
|
||||
if (sq[0].equals("TotalDamageDoneByThisTurn")) {
|
||||
@@ -4668,24 +4676,17 @@ public class CardFactoryUtil {
|
||||
final int bloodthirst = CardFactoryUtil.hasKeyword(card, "Bloodthirst");
|
||||
if (bloodthirst != -1) {
|
||||
final String numCounters = card.getKeyword().get(bloodthirst).split(" ")[1];
|
||||
|
||||
card.addComesIntoPlayCommand(new Command() {
|
||||
private static final long serialVersionUID = -1849308549161972508L;
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
if (card.getController().hasBloodthirst()) {
|
||||
int toAdd = -1;
|
||||
String desc = "Bloodthirst "
|
||||
+ numCounters + " (If an opponent was dealt damage this turn, this creature enters the battlefield with "
|
||||
+ numCounters + " +1/+1 counters on it.)";
|
||||
if (numCounters.equals("X")) {
|
||||
toAdd = card.getController().getBloodthirstAmount();
|
||||
} else {
|
||||
toAdd = Integer.parseInt(numCounters);
|
||||
}
|
||||
card.addCounter(Counters.P1P1, toAdd);
|
||||
}
|
||||
desc = "Bloodthirst X (This creature enters the battlefield with X +1/+1 counters on it, " +
|
||||
"where X is the damage dealt to your opponents this turn.)";
|
||||
card.setSVar("X", "Count$BloodthirstAmount");
|
||||
}
|
||||
card.setSVar("X", "Count$BloodthirstAmount");
|
||||
|
||||
});
|
||||
card.addIntrinsicKeyword("etbCounter:P1P1:" + numCounters + ":Bloodthirst$ True:" + desc);
|
||||
} // bloodthirst
|
||||
|
||||
final int storm = card.getKeywordAmount("Storm");
|
||||
|
||||
@@ -198,6 +198,12 @@ public abstract class ReplacementEffect extends TriggerReplacementBase {
|
||||
}
|
||||
}
|
||||
|
||||
if (this.getMapParams().containsKey("Bloodthirst")) {
|
||||
if (this.getMapParams().get("Bloodthirst").equals("True") && !this.getHostCard().getController().hasBloodthirst()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.getMapParams().containsKey("PlayersPoisoned")) {
|
||||
if (this.getMapParams().get("PlayersPoisoned").equals("You")
|
||||
&& (this.getHostCard().getController().getPoisonCounters() == 0)) {
|
||||
|
||||
Reference in New Issue
Block a user