mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 21:29:17 -08:00
[WOM] Implement (not yet official) Mosswood Dreadknight (#10792)
This commit is contained in:
parent
557e0a06e1
commit
566f4dc7f7
5 changed files with 104 additions and 0 deletions
|
|
@ -117,6 +117,11 @@ public class SpellAbility extends ActivatedAbilityImpl {
|
|||
|
||||
// play from not own hand
|
||||
ApprovingObject approvingObject = game.getContinuousEffects().asThough(getSourceId(), AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, this, playerId, game);
|
||||
if (approvingObject == null && getSpellAbilityType().equals(SpellAbilityType.ADVENTURE_SPELL)) {
|
||||
// allowed to cast adventures from non-hand?
|
||||
approvingObject = game.getContinuousEffects().asThough(getSourceId(), AsThoughEffectType.CAST_ADVENTURE_FROM_NOT_OWN_HAND_ZONE, this, playerId, game);
|
||||
}
|
||||
|
||||
if (approvingObject == null) {
|
||||
Card card = game.getCard(sourceId);
|
||||
if (!(card != null && card.isOwnedBy(playerId))) {
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ public enum AsThoughEffectType {
|
|||
// 4. You must implement/override an applies method with "Ability affectedAbility" (e.g. check multiple play/cast abilities from all card's parts)
|
||||
// TODO: search all PLAY_FROM_NOT_OWN_HAND_ZONE and CAST_AS_INSTANT effects and add support of mainCard and objectId
|
||||
PLAY_FROM_NOT_OWN_HAND_ZONE(true, true),
|
||||
CAST_ADVENTURE_FROM_NOT_OWN_HAND_ZONE(true, true),
|
||||
CAST_AS_INSTANT(true, true),
|
||||
//
|
||||
ACTIVATE_AS_INSTANT(true, false),
|
||||
|
|
|
|||
|
|
@ -3848,6 +3848,12 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
// play hand from non hand zone (except battlefield - you can't play already played permanents)
|
||||
approvingObject = game.getContinuousEffects().asThough(object.getId(),
|
||||
AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, ability, this.getId(), game);
|
||||
|
||||
if (approvingObject == null && isPlaySpell
|
||||
&& ((SpellAbility) ability).getSpellAbilityType().equals(SpellAbilityType.ADVENTURE_SPELL)) {
|
||||
approvingObject = game.getContinuousEffects().asThough(object.getId(),
|
||||
AsThoughEffectType.CAST_ADVENTURE_FROM_NOT_OWN_HAND_ZONE, ability, this.getId(), game);
|
||||
}
|
||||
} else {
|
||||
// other abilities from direct zones
|
||||
approvingObject = null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue