mirror of
https://github.com/magefree/mage.git
synced 2026-01-24 04:09:54 -08:00
Minor improvements - StringBuilder now have initial value
This commit is contained in:
parent
aa01db1432
commit
0bc9cf91a8
15 changed files with 61 additions and 81 deletions
|
|
@ -27,9 +27,6 @@
|
|||
*/
|
||||
package mage.cards.b;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
|
|
@ -47,6 +44,10 @@ import mage.game.Game;
|
|||
import mage.game.permanent.Permanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author fireshoes
|
||||
|
|
@ -64,14 +65,14 @@ public class BoldwyrIntimidator extends CardImpl {
|
|||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoldwyrIntimidatorEffect()));
|
||||
|
||||
// {R}: Target creature becomes a Coward until end of turn.
|
||||
Effect effect = new BecomesCreatureTypeTargetEffect(Duration.EndOfTurn, new ArrayList<>(Arrays.asList("Coward")), true);
|
||||
Effect effect = new BecomesCreatureTypeTargetEffect(Duration.EndOfTurn, new ArrayList<>(Collections.singletonList("Coward")), true);
|
||||
effect.setText("Target creature becomes a Coward until end of turn");
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{R}"));
|
||||
ability.addTarget(new TargetCreaturePermanent());
|
||||
this.addAbility(ability);
|
||||
|
||||
// {2}{R}: Target creature becomes a Warrior until end of turn.
|
||||
effect = new BecomesCreatureTypeTargetEffect(Duration.EndOfTurn, new ArrayList<>(Arrays.asList("Warrior")), true);
|
||||
effect = new BecomesCreatureTypeTargetEffect(Duration.EndOfTurn, new ArrayList<>(Collections.singletonList("Warrior")), true);
|
||||
effect.setText("Target creature becomes a Warrior until end of turn");
|
||||
ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{2}{R}"));
|
||||
ability.addTarget(new TargetCreaturePermanent());
|
||||
|
|
|
|||
|
|
@ -27,9 +27,6 @@
|
|||
*/
|
||||
package mage.cards.c;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Ability;
|
||||
|
|
@ -61,6 +58,10 @@ import mage.players.Player;
|
|||
import mage.target.common.TargetCardInGraveyard;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author emerald000
|
||||
|
|
@ -132,7 +133,7 @@ class ChainerDementiaMasterEffect extends OneShotEffect {
|
|||
ContinuousEffectImpl effect = new BecomesColorTargetEffect(ObjectColor.BLACK, Duration.WhileOnBattlefield);
|
||||
effect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
game.addEffect(effect, source);
|
||||
effect = new BecomesCreatureTypeTargetEffect(Duration.WhileOnBattlefield, new ArrayList<>(Arrays.asList("Nightmare")), false);
|
||||
effect = new BecomesCreatureTypeTargetEffect(Duration.WhileOnBattlefield, new ArrayList<>(Collections.singletonList("Nightmare")), false);
|
||||
effect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
game.addEffect(effect, source);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.c;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.common.PayEnergyCost;
|
||||
|
|
@ -49,6 +48,8 @@ import mage.players.Player;
|
|||
import mage.target.TargetPermanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
|
|
@ -104,9 +105,10 @@ class ConfiscationCoupEffect extends OneShotEffect {
|
|||
if (targetPermanent != null) {
|
||||
Cost cost = new PayEnergyCost(targetPermanent.getManaCost().convertedManaCost());
|
||||
if (cost.canPay(source, source.getSourceId(), source.getControllerId(), game)) {
|
||||
String energy = "";
|
||||
for (int i = 0; i < targetPermanent.getManaCost().convertedManaCost(); i++) {
|
||||
energy += "{E}";
|
||||
int convertedManaCost = targetPermanent.getManaCost().convertedManaCost();
|
||||
StringBuilder energy = new StringBuilder(convertedManaCost);
|
||||
for (int i = 0; i < convertedManaCost; i++) {
|
||||
energy.append("{E}");
|
||||
}
|
||||
if (controller.chooseUse(outcome, "Pay " + energy + " to get control of " + targetPermanent.getLogName() + '?', source, game)) {
|
||||
if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), true)) {
|
||||
|
|
|
|||
|
|
@ -27,10 +27,12 @@
|
|||
*/
|
||||
package mage.cards.c;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.DamageEverythingEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
|
|
@ -40,11 +42,9 @@ import mage.constants.TargetController;
|
|||
import mage.counters.CounterType;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
import mage.players.Player;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.DamageEverythingEffect;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
|
||||
|
||||
|
|
@ -93,14 +93,12 @@ class CycloneEffect extends OneShotEffect {
|
|||
Player player = game.getPlayer(source.getControllerId());
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
int total = permanent.getCounters(game).getCount(CounterType.WIND);
|
||||
|
||||
String greens = "";
|
||||
|
||||
StringBuilder greens = new StringBuilder(total);
|
||||
for (int i=0; i < total; i++){
|
||||
greens+="{G}";
|
||||
greens.append("{G}");
|
||||
}
|
||||
|
||||
if(this.choice(game, source, player, new ManaCostsImpl(greens))){
|
||||
if(this.choice(game, source, player, new ManaCostsImpl(greens.toString()))){
|
||||
DamageEverythingEffect dmg = new DamageEverythingEffect(total);
|
||||
dmg.apply(game, source);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -27,8 +27,6 @@
|
|||
*/
|
||||
package mage.cards.e;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
|
|
@ -46,6 +44,9 @@ import mage.constants.Zone;
|
|||
import mage.filter.common.FilterCreatureCard;
|
||||
import mage.target.common.TargetCardInHand;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
|
|
@ -65,7 +66,7 @@ public class ErebossEmissary extends CardImpl {
|
|||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(
|
||||
new BoostEnchantedEffect(2, 2, Duration.EndOfTurn),
|
||||
new BoostSourceEffect(2, 2, Duration.EndOfTurn),
|
||||
new SourceHasSubtypeCondition(Arrays.asList("Aura")),
|
||||
new SourceHasSubtypeCondition(Collections.singletonList("Aura")),
|
||||
"{this} gets +2/+2 until end of turn. If Erebos's Emissary is an Aura, enchanted creature gets +2/+2 until end of turn instead"),
|
||||
new DiscardTargetCost(new TargetCardInHand(new FilterCreatureCard()))));
|
||||
|
||||
|
|
|
|||
|
|
@ -27,9 +27,6 @@
|
|||
*/
|
||||
package mage.cards.o;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility;
|
||||
import mage.abilities.costs.common.DiscardCardCost;
|
||||
|
|
@ -51,6 +48,10 @@ import mage.filter.FilterPermanent;
|
|||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.filter.predicate.permanent.AnotherPredicate;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author fireshoes
|
||||
|
|
@ -82,7 +83,7 @@ public class OliviaMobilizedForWar extends CardImpl {
|
|||
effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn);
|
||||
effect.setText(", it gains haste until end of turn,");
|
||||
doIfCostPaid.addEffect(effect);
|
||||
effect = new BecomesCreatureTypeTargetEffect(Duration.WhileOnBattlefield, new ArrayList<>(Arrays.asList("Vampire")), false);
|
||||
effect = new BecomesCreatureTypeTargetEffect(Duration.WhileOnBattlefield, new ArrayList<>(Collections.singletonList("Vampire")), false);
|
||||
effect.setText("and it becomes a Vampire in addition to its other types");
|
||||
doIfCostPaid.addEffect(effect);
|
||||
this.addAbility(new EntersBattlefieldControlledTriggeredAbility(Zone.BATTLEFIELD, doIfCostPaid, filter, false, SetTargetPointer.PERMANENT, null));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue