mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
[DOM] Some fixes and tooltip rule text changes.
This commit is contained in:
parent
97b2b2feac
commit
e821d22fb6
38 changed files with 151 additions and 145 deletions
|
|
@ -14,6 +14,7 @@ import mage.filter.common.FilterCreaturePermanent;
|
|||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -71,7 +72,7 @@ public class AttacksWithCreaturesTriggeredAbility extends TriggeredAbilityImpl {
|
|||
|
||||
@Override
|
||||
public String getRule() {
|
||||
StringBuilder sb = new StringBuilder("Whenever you attack with " + minAttackers + " or more ");
|
||||
StringBuilder sb = new StringBuilder("Whenever you attack with " + CardUtil.numberToText(minAttackers) + " or more ");
|
||||
sb.append(filter.getMessage());
|
||||
sb.append(", ");
|
||||
sb.append(super.getRule());
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ public class BeginningOfUpkeepTriggeredAbility extends TriggeredAbilityImpl {
|
|||
case OPPONENT:
|
||||
return sb.insert(0, generateZoneString()).insert(0, "At the beginning of each opponent's upkeep, ").toString();
|
||||
case ANY:
|
||||
return sb.insert(0, generateZoneString()).insert(0, "At the beginning of each player's upkeep, ").toString();
|
||||
return sb.insert(0, generateZoneString()).insert(0, "At the beginning of each upkeep, ").toString();
|
||||
case CONTROLLER_ATTACHED_TO:
|
||||
return sb.insert(0, generateZoneString()).insert(0, "At the beginning of the upkeep of enchanted creature's controller, ").toString();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,9 +52,14 @@ public class ReturnToHandChosenControlledPermanentCost extends CostImpl {
|
|||
target.setNotTarget(true);
|
||||
this.addTarget(target);
|
||||
if (target.getMaxNumberOfTargets() > 1 && target.getMaxNumberOfTargets() == target.getNumberOfTargets()) {
|
||||
this.text = "return " + CardUtil.numberToText(target.getMaxNumberOfTargets()) + ' ' + target.getTargetName() + " you control to their owner's hand";
|
||||
this.text = "return " + CardUtil.numberToText(target.getMaxNumberOfTargets()) + ' '
|
||||
+ target.getTargetName()
|
||||
+ (target.getTargetName().endsWith(" you control") ? "" : " you control")
|
||||
+ " to their owner's hand";
|
||||
} else {
|
||||
this.text = "return " + target.getTargetName() + " you control to its owner's hand";
|
||||
this.text = "return " + target.getTargetName()
|
||||
+ (target.getTargetName().endsWith(" you control") ? "" : " you control")
|
||||
+ " to its owner's hand";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,37 +1,39 @@
|
|||
package mage.abilities.dynamicvalue;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.game.Game;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class AdditiveDynamicValue implements DynamicValue {
|
||||
|
||||
private List<DynamicValue> dynamicValues;
|
||||
private final List<DynamicValue> dynamicValues;
|
||||
|
||||
/**
|
||||
* Creates a {@link DynamicValue} from that adds together multiple {@link DynamicValue}s.
|
||||
* Creates a {@link DynamicValue} from that adds together multiple
|
||||
* {@link DynamicValue}s.
|
||||
*
|
||||
* @param dynamicValues The dynamic values to add together.
|
||||
*/
|
||||
public AdditiveDynamicValue(DynamicValue...dynamicValues){
|
||||
public AdditiveDynamicValue(DynamicValue... dynamicValues) {
|
||||
this.dynamicValues = Arrays.asList(dynamicValues);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a {@link DynamicValue} from that adds together multiple {@link DynamicValue}s.
|
||||
* Creates a {@link DynamicValue} from that adds together multiple
|
||||
* {@link DynamicValue}s.
|
||||
*
|
||||
* @param dynamicValues The dynamic values to add together.
|
||||
*/
|
||||
public AdditiveDynamicValue(List<DynamicValue> dynamicValues){
|
||||
public AdditiveDynamicValue(List<DynamicValue> dynamicValues) {
|
||||
this.dynamicValues = dynamicValues;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
return dynamicValues.stream().mapToInt(d->d.calculate(game, sourceAbility, effect)).sum();
|
||||
return dynamicValues.stream().mapToInt(d -> d.calculate(game, sourceAbility, effect)).sum();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ public class AddManaOfAnyColorEffect extends BasicManaEffect {
|
|||
.append(CardUtil.numberToText(amount))
|
||||
.append(" mana of any ")
|
||||
.append(amount > 1 ? "one " : "")
|
||||
.append("color to your mana pool").toString();
|
||||
.append("color").toString();
|
||||
}
|
||||
|
||||
public AddManaOfAnyColorEffect(final AddManaOfAnyColorEffect effect) {
|
||||
|
|
|
|||
|
|
@ -169,6 +169,7 @@ public class LookLibraryAndPickControllerEffect extends LookLibraryControllerEff
|
|||
* @param targetZonePickedCards
|
||||
* @param optional
|
||||
* @param putOnTopSelected
|
||||
* @param anyOrder
|
||||
*/
|
||||
public LookLibraryAndPickControllerEffect(DynamicValue numberOfCards,
|
||||
boolean mayShuffleAfter, DynamicValue numberToPick,
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ public class PreventDamageToAttachedEffect extends PreventionEffectImpl {
|
|||
}
|
||||
|
||||
public PreventDamageToAttachedEffect(Duration duration, AttachmentType attachmentType, int amountToPrevent, boolean combatOnly) {
|
||||
super(duration, Integer.MAX_VALUE, false, false);
|
||||
super(duration, amountToPrevent, combatOnly, false);
|
||||
this.attachmentType = attachmentType;
|
||||
staticText = setText();
|
||||
}
|
||||
|
|
@ -88,14 +88,14 @@ public class PreventDamageToAttachedEffect extends PreventionEffectImpl {
|
|||
sb.append("combat ");
|
||||
}
|
||||
sb.append("damage that would be dealt to ");
|
||||
sb.append(attachmentType.toString()).append(" creature");
|
||||
sb.append(attachmentType.verb()).append(" creature");
|
||||
} else {
|
||||
sb.append("If a source would deal ");
|
||||
if (onlyCombat) {
|
||||
sb.append("combat ");
|
||||
}
|
||||
sb.append("damage to ");
|
||||
sb.append(attachmentType.toString());
|
||||
sb.append(attachmentType.verb());
|
||||
sb.append("creature, prevent ").append(amountToPrevent);;
|
||||
sb.append("of that damage");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ public class UntapLandsEffect extends OneShotEffect {
|
|||
super(Outcome.Untap);
|
||||
this.amount = amount;
|
||||
this.upTo = upTo;
|
||||
staticText = "Untap " + (upTo ? "up to " : "") + CardUtil.numberToText(amount, staticText) + " lands";
|
||||
staticText = "untap " + (upTo ? "up to " : "") + CardUtil.numberToText(amount, staticText) + " lands";
|
||||
}
|
||||
|
||||
public UntapLandsEffect(final UntapLandsEffect effect) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue