forked from External/mage
Implementing Daybound/Nightbound mechanic (#8200)
* adding initial day/night support in game state * remove card exclusion for testing * added functional implementation to abilities from main branch * functionally implemented NightCondition * updated DayNightHint * added support for nightbound entering transformed at night * [MID] Implemented Unnatural Moonrise * [MID] Implemented The Celestus * added some docs * changed access for state day/night methods * added transformation to day/night switch * re-added unfinished filter, removed day/night cards * fixed some errors with transforming * added hints to all day/night cards * added transformation prevention plus a test * added Immerwolf test * [MID] Implemented Tovolar, Dire Overlord / Tovolar, The Midnight Scourge * refactored some cards to not use isTransformable * removed transformable parameter * simplified some transform code * fixed null pointer exception * removed unnecessary canTransform method * fixed a small error * reworked implementation of rule 701.28f * small change in transform logic * fixed failiing test * fixed verify failure * small merge change * added support for day/night switching based on spells cast * [MID] Implemented Curse of Leeches / Leeching Lurkers * moved day/night handling to untap step * added tests for cards which set day and trigger from a change * [MID] Implemented Ludevic, Necrogenius / Olag, Ludevic's Hubris * added support for creatures transforming to match day/night when necessary * fixed verify failures * fixed another verify failure * remove temporary verify skip * added transform message * removed unnecessary transform message * [MID] Implemented Angelic Enforcer / Enduring Angel * updated DayNightHint with more information * fixed verify failure * merge fix * fixed Startled Awake / Persistent Nightmare / Moonmist interaction * added another test for Moonmist * merge fix * merge fix * [MID] Implemented Baneblade Scoundrel / Baneclaw Marauder * merge fix * [MID] various text fixes * [MID] a few more text fixes * Merge fix * Improved transform game logs (hints, source), fixed day/night logs, fixed miss game param (due code style); * fixed a test failure * Merge fix Co-authored-by: Oleg Agafonov <jaydi85@gmail.com>
This commit is contained in:
parent
6d4e5672c3
commit
30afb11cd2
305 changed files with 2174 additions and 1064 deletions
|
|
@ -1,16 +1,21 @@
|
|||
package mage.abilities.keyword;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.StaticAbility;
|
||||
import mage.constants.Zone;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.abilities.hint.common.DayNightHint;
|
||||
import mage.cards.Card;
|
||||
import mage.constants.*;
|
||||
import mage.game.Game;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
* TODO: Implement this
|
||||
*/
|
||||
public class NightboundAbility extends StaticAbility {
|
||||
|
||||
public NightboundAbility() {
|
||||
super(Zone.BATTLEFIELD, null);
|
||||
super(Zone.BATTLEFIELD, new NightboundEffect());
|
||||
this.addHint(DayNightHint.instance);
|
||||
}
|
||||
|
||||
private NightboundAbility(final NightboundAbility ability) {
|
||||
|
|
@ -26,4 +31,34 @@ public class NightboundAbility extends StaticAbility {
|
|||
public NightboundAbility copy() {
|
||||
return new NightboundAbility(this);
|
||||
}
|
||||
|
||||
public static boolean checkCard(Card card, Game game) {
|
||||
return game.checkDayNight(false)
|
||||
&& card.getSecondCardFace() != null
|
||||
&& card.getSecondCardFace().getAbilities().containsClass(NightboundAbility.class);
|
||||
}
|
||||
}
|
||||
|
||||
class NightboundEffect extends ContinuousEffectImpl {
|
||||
|
||||
NightboundEffect() {
|
||||
super(Duration.WhileOnBattlefield, Layer.PlayerEffects, SubLayer.NA, Outcome.Benefit);
|
||||
}
|
||||
|
||||
private NightboundEffect(final NightboundEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NightboundEffect copy() {
|
||||
return new NightboundEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
if (!game.hasDayNight()) {
|
||||
game.setDaytime(false);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue