Merge branch 'thrasta' into 'master'

MH2: Thrasta and "Trample over planeswalkers"

See merge request core-developers/forge!4824
This commit is contained in:
Michael Kamensky
2021-06-05 03:17:27 +00:00
7 changed files with 34 additions and 6 deletions

View File

@@ -2028,9 +2028,10 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
|| keyword.equals("Living Weapon") || keyword.equals("Myriad") || keyword.equals("Exploit")
|| keyword.equals("Changeling") || keyword.equals("Delve")
|| keyword.equals("Split second") || keyword.equals("Sunburst")
|| keyword.equals("Suspend") // for the ones without amounnt
|| keyword.equals("Suspend") // for the ones without amount
|| keyword.equals("Foretell") // for the ones without cost
|| keyword.equals("Hideaway") || keyword.equals("Ascend")
|| keyword.equals("Trample over planeswalkers")
|| keyword.equals("Totem armor") || keyword.equals("Battle cry")
|| keyword.equals("Devoid") || keyword.equals("Riot")){
sbLong.append(keyword).append(" (").append(inst.getReminderText()).append(")");

View File

@@ -779,6 +779,16 @@ public class Combat {
assignedDamage = true;
GameEntity defender = getDefenderByAttacker(band);
// If the Attacker is unblocked, or it's a trampler and has 0 blockers, deal damage to defender
if (defender instanceof Card && attacker.hasKeyword("Trample over planeswalkers")) {
if (orderedBlockers == null || orderedBlockers.isEmpty()) {
CardCollection cc = new CardCollection();
cc.add((Card)defender);
orderedBlockers = cc;
} else {
orderedBlockers.add((Card) defender);
}
defender = getDefenderPlayerByAttacker(attacker);
}
if (orderedBlockers == null || orderedBlockers.isEmpty()) {
if (trampler || !band.isBlocked()) { // this is called after declare blockers, no worries 'bout nulls in isBlocked
damageMap.put(attacker, defender, damageDealt);

View File

@@ -153,6 +153,7 @@ public enum Keyword {
SUSPEND("Suspend", Suspend.class, false, "Rather than cast this card from your hand, you may pay %s and exile it with {%d:time counter} on it. At the beginning of your upkeep, remove a time counter. When the last is removed, cast it without paying its mana cost."),
TOTEM_ARMOR("Totem armor", SimpleKeyword.class, true, "If enchanted permanent would be destroyed, instead remove all damage marked on it and destroy this Aura."),
TRAMPLE("Trample", SimpleKeyword.class, true, "This creature can deal excess combat damage to the player or planeswalker it's attacking."),
TRAMPLE_OVER_PLANESWALKERS("Trample over planeswalkers", SimpleKeyword.class, true, "This creature can deal excess combat damage to the controller of the planeswalker its attacking."),
TRANSFIGURE("Transfigure", KeywordWithCost.class, false, "%s, Sacrifice this creature: Search your library for a creature card with the same mana value as this creature and put that card onto the battlefield, then shuffle. Transfigure only as a sorcery."),
TRANSMUTE("Transmute", KeywordWithCost.class, false, "%s, Discard this card: Search your library for a card with the same mana value as this card, reveal it, and put it into your hand, then shuffle. Transmute only as a sorcery."),
TRIBUTE("Tribute", KeywordWithAmount.class, false, "As this creature enters the battlefield, an opponent of your choice may put {%d:+1/+1 counter} on it."),

View File

@@ -448,7 +448,9 @@ public class VAssignCombatDamage {
}
else {
lethalDamage = Math.max(0, card.getLethalDamage());
if (attackerHasDeathtouch) {
if (card.getCurrentState().getType().isPlaneswalker()) {
lethalDamage = Integer.valueOf(card.getCurrentState().getLoyalty());
} else if (attackerHasDeathtouch) {
lethalDamage = Math.min(lethalDamage, 1);
}
}

View File

@@ -461,8 +461,10 @@ public class VAssignCombatDamage extends FDialog {
}
else {
lethalDamage = Math.max(0, source.getLethalDamage());
if (attackerHasDeathtouch) {
lethalDamage = Math.min(lethalDamage, 1);
if (card.getCurrentState().getType().isPlaneswalker()) {
lethalDamage = Integer.valueOf(card.getCurrentState().getLoyalty());
} else if (attackerHasDeathtouch) {
lethalDamage = Math.min(lethalDamage, 1);
}
}
return lethalDamage;

View File

@@ -0,0 +1,11 @@
Name:Thrasta, Tempest's Roar
ManaCost:10 G G
Types:Legendary Creature Dinosaur
PT:7/7
S:Mode$ ReduceCost | ValidCard$ Card.Self | Type$ Spell | Amount$ X | EffectZone$ All | Description$ This spell costs {3} less to cast for each other spell cast this turn.
SVar:X:Count$ThisTurnCast_Card.Other/Times.3
K:Trample
K:Haste
K:Trample over planeswalkers
S:Mode$ Continuous | Affected$ Card.Self+ThisTurnEntered | AddKeyword$ Hexproof | Description$ CARDNAME has hexproof as long as it entered the battlefield this turn.
Oracle:This spell costs {3} less to cast for each other spell cast this turn.\nTrample, haste\nTrample over planeswalkers (This creature can deal excess combat damage to the controller of the planeswalker its attacking.)\nThrasta, Tempests Roar has hexproof as long as it entered the battlefield this turn.

View File

@@ -356,8 +356,9 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
map.put(null, damageDealt);
} else {
if ((attacker.hasKeyword(Keyword.TRAMPLE) && defender != null) || (blockers.size() > 1)
|| (attacker.hasKeyword("You may assign CARDNAME's combat damage divided as you choose among defending" +
" player and/or any number of creatures they control.")) && overrideOrder && blockers.size() >0) {
|| ((attacker.hasKeyword("You may assign CARDNAME's combat damage divided as you choose among " +
"defending player and/or any number of creatures they control.")) && overrideOrder &&
blockers.size() >0) || (attacker.hasKeyword("Trample over planeswalkers") && defender instanceof Card)) {
GameEntityViewMap<Card, CardView> gameCacheBlockers = GameEntityView.getMap(blockers);
final CardView vAttacker = CardView.get(attacker);
final GameEntityView vDefender = GameEntityView.get(defender);