mirror of
https://github.com/correl/mage.git
synced 2025-01-12 11:08:01 +00:00
Updated menace and explore abilities to show or hide description
This commit is contained in:
parent
096d020c94
commit
70e99e185b
3 changed files with 61 additions and 5 deletions
|
@ -43,19 +43,59 @@ import mage.players.Player;
|
|||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
* @author TheElk801, JayDi85
|
||||
*/
|
||||
public class ExploreSourceEffect extends OneShotEffect {
|
||||
|
||||
public static final String RULE_TEXT = "it explores. <i>(Reveal the top card of your library. Put that card into your hand if it's a land. Otherwise, put a +1/+1 counter on this creature, then put the card back or put it into your graveyard.)</i>";
|
||||
// "it explores. <i>(Reveal the top card of your library. Put that card into your hand if it's a land. Otherwise, put a +1/+1 counter on this creature, then put the card back or put it into your graveyard.)</i>";
|
||||
private static final String RULE_TEXT_START = "explores.";
|
||||
private static final String RULE_TEXT_HINT = "<i>(Reveal the top card of your library. Put that card into your hand if it's a land. Otherwise, put a +1/+1 counter on this creature, then put the card back or put it into your graveyard.)</i>";
|
||||
|
||||
public static String getRuleText(boolean showAbilityHint) {
|
||||
return getRuleText(showAbilityHint, null);
|
||||
}
|
||||
public static String getRuleText(boolean showAbilityHint, String whosExplores) {
|
||||
|
||||
String res = whosExplores;
|
||||
if(res == null){ res = "it"; }
|
||||
|
||||
res += " " + RULE_TEXT_START;
|
||||
|
||||
if (showAbilityHint) {
|
||||
res += " " + RULE_TEXT_HINT;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
private String sourceName = "it";
|
||||
private boolean showAbilityHint = true;
|
||||
|
||||
public ExploreSourceEffect() {
|
||||
this(true);
|
||||
}
|
||||
|
||||
public ExploreSourceEffect(boolean showAbilityHint) {
|
||||
this(showAbilityHint, null);
|
||||
}
|
||||
|
||||
public ExploreSourceEffect(boolean showAbilityHint, String whosExplores) {
|
||||
super(Outcome.Benefit);
|
||||
this.staticText = RULE_TEXT;
|
||||
|
||||
if(whosExplores != null) {
|
||||
this.sourceName = whosExplores;
|
||||
}
|
||||
setText();
|
||||
}
|
||||
|
||||
public ExploreSourceEffect(final ExploreSourceEffect effect) {
|
||||
super(effect);
|
||||
this.showAbilityHint = effect.showAbilityHint;
|
||||
this.sourceName = effect.sourceName;
|
||||
setText();
|
||||
}
|
||||
|
||||
private void setText(){
|
||||
this.staticText = getRuleText(this.showAbilityHint, this.sourceName);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -39,8 +39,12 @@ import mage.game.Game;
|
|||
public class ExploreTargetEffect extends OneShotEffect {
|
||||
|
||||
public ExploreTargetEffect() {
|
||||
this(true);
|
||||
}
|
||||
|
||||
public ExploreTargetEffect(boolean showAbilityHint) {
|
||||
super(Outcome.Benefit);
|
||||
this.staticText = ExploreSourceEffect.RULE_TEXT;
|
||||
this.staticText = ExploreSourceEffect.getRuleText(showAbilityHint);
|
||||
}
|
||||
|
||||
public ExploreTargetEffect(final ExploreTargetEffect effect) {
|
||||
|
|
|
@ -16,12 +16,20 @@ import mage.constants.Zone;
|
|||
*/
|
||||
public class MenaceAbility extends StaticAbility { // Menace may not be a Singleton because the source ability is needed in the continuous effect
|
||||
|
||||
private boolean showAbilityHint = true;
|
||||
|
||||
public MenaceAbility() {
|
||||
this(true);
|
||||
}
|
||||
|
||||
public MenaceAbility(boolean showAbilityHint) {
|
||||
super(Zone.BATTLEFIELD, new CantBeBlockedByOneEffect(2));
|
||||
this.showAbilityHint = showAbilityHint;
|
||||
}
|
||||
|
||||
public MenaceAbility(final MenaceAbility ability) {
|
||||
super(ability);
|
||||
this.showAbilityHint = ability.showAbilityHint;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -31,7 +39,11 @@ public class MenaceAbility extends StaticAbility { // Menace may not be a Single
|
|||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Menace <i>(This creature can't be blocked except by two or more creatures.)</i>";
|
||||
String res = "Menace";
|
||||
if (this.showAbilityHint) {
|
||||
res += " <i>(This creature can't be blocked except by two or more creatures.)</i>";
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue