Merge branch 'curse_of_hos' into 'master'

VOW: Curse of Hospitality

See merge request core-developers/forge!5731
This commit is contained in:
Michael Kamensky
2021-11-08 17:57:16 +00:00
2 changed files with 21 additions and 0 deletions

View File

@@ -25,6 +25,7 @@ import forge.game.zone.ZoneType;
import forge.item.PaperCard;
import forge.util.Expressions;
import forge.util.TextUtil;
import forge.util.collect.FCollection;
import forge.util.collect.FCollectionView;
import org.apache.commons.lang3.StringUtils;
@@ -1467,6 +1468,14 @@ public class CardProperty {
return false;
}
}
if (property.startsWith("attacking ")) { // generic "attacking [DefinedGameEntity]"
FCollection<GameEntity> defined = AbilityUtils.getDefinedEntities(source, property.split(" ")[1],
spellAbility);
final GameEntity defender = combat.getDefenderByAttacker(card);
if (!defined.contains(defender)) {
return false;
}
}
} else if (property.startsWith("notattacking")) {
return null == combat || !combat.isAttacking(card);
} else if (property.equals("attackedThisCombat")) {

View File

@@ -0,0 +1,12 @@
Name:Curse of Hospitality
ManaCost:2 R
Types:Enchantment Aura Curse
K:Enchant player
A:SP$ Attach | ValidTgts$ Player | TgtPrompt$ Select player to curse | AILogic$ Curse
S:Mode$ Continuous | Affected$ Creature.attacking EnchantedPlayer | AddKeyword$ Trample | Description$ Creatures attacking enchanted player have trample.
T:Mode$ DamageDone | ValidSource$ Creature | ValidTarget$ Player.EnchantedBy | TriggerZones$ Battlefield | CombatDamage$ True | Execute$ TrigExile | TriggerDescription$ Whenever a creature deals combat damage to enchanted player, that player exiles the top card of their library. Until end of turn, that creature's controller may play that card and they may spend mana as though it were mana of any color to cast that spell.
SVar:TrigExile:DB$ Dig | Defined$ TriggeredTarget | DigNum$ 1 | ChangeNum$ All | DestinationZone$ Exile | RememberChanged$ True | SubAbility$ DBEffect
SVar:DBEffect:DB$ Effect | EffectOwner$ TriggeredSourceController | Duration$ EndOfTurn | RememberObjects$ Remembered | StaticAbilities$ STPlay | ForgetOnMoved$ Exile | SubAbility$ DBCleanup
SVar:STPlay:Mode$ Continuous | MayPlay$ True | MayPlayIgnoreColor$ True | EffectZone$ Command | Affected$ Card.IsRemembered | AffectedZone$ Exile | Description$ Until end of turn, you may play the exiled card and may spend mana as though it were mana of any color to cast it.
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
Oracle:Enchant player\nCreatures attacking enchanted player have trample.\nWhenever a creature deals combat damage to enchanted player, that player exiles the top card of their library. Until end of turn, that creature's controller may play that card and they may spend mana as though it were mana of any color to cast that spell.