mirror of
https://github.com/magefree/mage.git
synced 2025-12-26 13:32:06 -08:00
commit
81193148e9
59 changed files with 673 additions and 233 deletions
|
|
@ -1,15 +1,16 @@
|
|||
package mage;
|
||||
|
||||
/**
|
||||
* Used to identify specific actions/events and to be able to assign them to the
|
||||
* correct watcher or other processing.
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public enum MageIdentifier {
|
||||
GisaAndGeralfWatcher,
|
||||
KaradorGhostChieftainWatcher,
|
||||
KessDissidentMageWatcher,
|
||||
LurrusOfTheDreamDenWatcher,
|
||||
MuldrothaTheGravetideWatcher
|
||||
}
|
||||
package mage;
|
||||
|
||||
/**
|
||||
* Used to identify specific actions/events and to be able to assign them to the
|
||||
* correct watcher or other processing.
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public enum MageIdentifier {
|
||||
GisaAndGeralfWatcher,
|
||||
KaradorGhostChieftainWatcher,
|
||||
KessDissidentMageWatcher,
|
||||
LurrusOfTheDreamDenWatcher,
|
||||
MuldrothaTheGravetideWatcher,
|
||||
WishWatcher
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,39 @@
|
|||
package mage.abilities.dynamicvalue.common;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
* @author JayDi85
|
||||
*/
|
||||
public enum SideboardCardsYouControlCount implements DynamicValue {
|
||||
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
Player player = game.getPlayer(sourceAbility.getControllerId());
|
||||
if (player == null) {
|
||||
return 0;
|
||||
}
|
||||
return player.getSideboard().size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public SideboardCardsYouControlCount copy() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "1";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return "cards in your sideboard";
|
||||
}
|
||||
}
|
||||
|
|
@ -592,9 +592,14 @@ public class ContinuousEffects implements Serializable {
|
|||
Map<String, String> keyChoices = new HashMap<>();
|
||||
for (ApprovingObject approvingObject : possibleApprovingObjects) {
|
||||
MageObject mageObject = game.getObject(approvingObject.getApprovingAbility().getSourceId());
|
||||
keyChoices.put(approvingObject.getApprovingAbility().getId().toString(),
|
||||
(approvingObject.getApprovingAbility().getRule(mageObject == null ? "" : mageObject.getName()))
|
||||
+ (mageObject == null ? "" : " (" + mageObject.getIdName() + ")"));
|
||||
String choiceKey = approvingObject.getApprovingAbility().getId().toString();
|
||||
String choiceValue;
|
||||
if (mageObject == null) {
|
||||
choiceValue = approvingObject.getApprovingAbility().getRule();
|
||||
} else {
|
||||
choiceValue = mageObject.getIdName() + ": " + approvingObject.getApprovingAbility().getRule(mageObject.getName());
|
||||
}
|
||||
keyChoices.put(choiceKey, choiceValue);
|
||||
}
|
||||
Choice choicePermitting = new ChoiceImpl(true);
|
||||
choicePermitting.setMessage("Choose the permitting object");
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.abilities.effects.common;
|
||||
|
||||
import java.util.Set;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
package mage.abilities.hint.common;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.dynamicvalue.common.SideboardCardsYouControlCount;
|
||||
import mage.abilities.hint.Hint;
|
||||
import mage.abilities.hint.ValueHint;
|
||||
import mage.game.Game;
|
||||
|
||||
/**
|
||||
* @author JayDi85
|
||||
*/
|
||||
public enum OpenSideboardHint implements Hint {
|
||||
|
||||
instance;
|
||||
private static final Hint hint = new ValueHint("Cards in your sideboard", SideboardCardsYouControlCount.instance);
|
||||
|
||||
@Override
|
||||
public String getText(Game game, Ability ability) {
|
||||
return hint.getText(game, ability) + " (<i>Right click on battlefield to open player's sideboard at any time</i>)";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Hint copy() {
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
|
|
@ -59,5 +59,6 @@ public enum PlayerAction {
|
|||
HOLD_PRIORITY,
|
||||
UNHOLD_PRIORITY,
|
||||
VIEW_LIMITED_DECK,
|
||||
VIEW_SIDEBOARD,
|
||||
TOGGLE_RECORD_MACRO
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3646,13 +3646,22 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
}
|
||||
}
|
||||
|
||||
// check to play companion cards
|
||||
// outside cards
|
||||
if (fromAll || fromZone == Zone.OUTSIDE) {
|
||||
// companion cards
|
||||
for (Cards companionCards : game.getState().getCompanion().values()) {
|
||||
for (Card card : companionCards.getCards(game)) {
|
||||
getPlayableFromObjectAll(game, Zone.OUTSIDE, card, availableMana, playable);
|
||||
}
|
||||
}
|
||||
|
||||
// sideboard cards (example: Wish)
|
||||
for (UUID sideboardCardId : this.getSideboard()) {
|
||||
Card sideboardCard = game.getCard(sideboardCardId);
|
||||
if (sideboardCard != null) {
|
||||
getPlayableFromObjectAll(game, Zone.OUTSIDE, sideboardCard, availableMana, playable);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// check if it's possible to play the top card of a library
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue