Rith, Liberated Primeval and support (#1409)

* Rith, Liberated Primeval and support

* Add AI hints

Co-authored-by: TRT <>
This commit is contained in:
tool4ever
2022-08-28 05:40:44 +02:00
committed by GitHub
parent ba8df4cd71
commit a35ffbcb0f
3 changed files with 19 additions and 2 deletions

View File

@@ -2419,7 +2419,7 @@ public class GameAction {
}
// for Zangief do this before runWaitingTriggers DamageDone
damageMap.triggerExcessDamage(isCombat, lethalDamage, game);
damageMap.triggerExcessDamage(isCombat, lethalDamage, game, lkiCache);
// lose life simultaneously
if (isCombat) {

View File

@@ -104,7 +104,7 @@ public class CardDamageMap extends ForwardingTable<Card, GameEntity, Integer> {
game.getTriggerHandler().runTrigger(TriggerType.DamageAll, runParams, false);
}
public void triggerExcessDamage(boolean isCombat, Map<Card, Integer> lethalDamage, final Game game) {
public void triggerExcessDamage(boolean isCombat, Map<Card, Integer> lethalDamage, final Game game, final Map<Integer, Card> lkiCache) {
for (Entry<Card, Integer> damaged : lethalDamage.entrySet()) {
int sum = 0;
for (Integer i : this.column(damaged.getKey()).values()) {
@@ -112,6 +112,10 @@ public class CardDamageMap extends ForwardingTable<Card, GameEntity, Integer> {
}
int excess = sum - (damaged.getKey().hasBeenDealtDeathtouchDamage() ? 1 : damaged.getValue());
// also update the DamageHistory, but overwrite previous excess outcomes
// because Rith, Liberated Primeval cares about who controlled it at this moment
lkiCache.get(damaged.getKey().getId()).setHasBeenDealtExcessDamageThisTurn(excess > 0);
if (excess > 0) {
damaged.getKey().setHasBeenDealtExcessDamageThisTurn(true);
// Run triggers

View File

@@ -0,0 +1,13 @@
Name:Rith, Liberated Primeval
ManaCost:2 R G W
Types:Legendary Creature Dragon
PT:5/5
K:Flying
K:Ward:2
S:Mode$ Continuous | Affected$ Dragon.Other+YouCtrl | AddKeyword$ Ward:2 | Description$ Other Dragons you control have ward {2}.
T:Mode$ Phase | Phase$ End of Turn | ValidPlayer$ You | CheckSVar$ DragonCheck | Execute$ DBDragon | TriggerDescription$ At the beginning of your end step, if a creature or planeswalker an opponent controlled was dealt excess damage this turn, create a 4/4 red Dragon creature token with flying.
SVar:DBDragon:DB$ Token | TokenScript$ r_4_4_dragon_flying
SVar:DragonCheck:Count$NumDamageThisTurn Card Creature.OppCtrl+wasDealtExcessDamageThisTurn,Planeswalker.OppCtrl+wasDealtExcessDamageThisTurn
DeckHas:Ability$Token
DeckHints:Type$Dragon
Oracle:Flying, ward {2}\nOther dragons you control have ward {2}.\nAt the beginning of your end step, if a creature or planeswalker an opponent controlled was dealt excess damage this turn, create a 4/4 red Dragon creature token with flying.