mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 02:38:02 +00:00
Clean up (#2182)
This commit is contained in:
@@ -3,8 +3,6 @@ package forge.game.ability.effects;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import forge.game.Game;
|
||||
@@ -14,6 +12,7 @@ import forge.game.card.Card;
|
||||
import forge.game.event.GameEventCombatChanged;
|
||||
import forge.game.spellability.SpellAbility;
|
||||
import forge.game.trigger.TriggerType;
|
||||
import forge.util.Lang;
|
||||
|
||||
public class BecomesBlockedEffect extends SpellAbilityEffect {
|
||||
|
||||
@@ -21,9 +20,7 @@ public class BecomesBlockedEffect extends SpellAbilityEffect {
|
||||
protected String getStackDescription(SpellAbility sa) {
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
|
||||
final List<Card> tgtCards = getTargetCards(sa);
|
||||
|
||||
sb.append(StringUtils.join(tgtCards, ", "));
|
||||
sb.append(Lang.joinHomogenous(getTargetCards(sa)));
|
||||
sb.append(" becomes blocked.");
|
||||
|
||||
return sb.toString();
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
package forge.game.ability.effects;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
import forge.game.Game;
|
||||
@@ -19,6 +16,7 @@ import forge.game.player.Player;
|
||||
import forge.game.spellability.SpellAbility;
|
||||
import forge.game.spellability.SpellAbilityStackInstance;
|
||||
import forge.util.CardTranslation;
|
||||
import forge.util.Lang;
|
||||
import forge.util.Localizer;
|
||||
import forge.util.collect.FCollection;
|
||||
|
||||
@@ -28,10 +26,9 @@ public class ChangeCombatantsEffect extends SpellAbilityEffect {
|
||||
protected String getStackDescription(SpellAbility sa) {
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
|
||||
final List<Card> tgtCards = getTargetCards(sa);
|
||||
// should update when adding effects for defined blocker
|
||||
sb.append("Reselect the defender of ");
|
||||
sb.append(StringUtils.join(tgtCards, ", "));
|
||||
sb.append(Lang.joinHomogenous(getTargetCards(sa)));
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@@ -68,7 +68,6 @@ public class ChangeZoneAllEffect extends SpellAbilityEffect {
|
||||
if (origin.contains(ZoneType.Library) && sa.hasParam("Search") && !sa.getActivatingPlayer().canSearchLibraryWith(sa, p)) {
|
||||
cards.removeAll(p.getCardsIn(ZoneType.Library));
|
||||
}
|
||||
|
||||
}
|
||||
if (origin.contains(ZoneType.Library) && sa.hasParam("Search")) {
|
||||
// Search library using changezoneall effect need a param "Search"
|
||||
|
||||
@@ -20,7 +20,7 @@ public class ControlPlayerEffect extends SpellAbilityEffect {
|
||||
@Override
|
||||
protected String getStackDescription(SpellAbility sa) {
|
||||
List<Player> tgtPlayers = getTargetPlayers(sa);
|
||||
return TextUtil.concatWithSpace(sa.getActivatingPlayer().toString(),"controls", Lang.joinHomogenous(tgtPlayers),"during their next turn");
|
||||
return TextUtil.concatWithSpace(sa.getActivatingPlayer().toString(), "controls", Lang.joinHomogenous(tgtPlayers), "during their next turn");
|
||||
}
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
|
||||
@@ -28,8 +28,9 @@ public class CountersPutOrRemoveEffect extends SpellAbilityEffect {
|
||||
@Override
|
||||
protected String getStackDescription(SpellAbility sa) {
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
final Player pl = !sa.hasParam("DefinedPlayer") ? sa.getActivatingPlayer() :
|
||||
AbilityUtils.getDefinedPlayers(sa.getHostCard(), sa.getParam("DefinedPlayer"), sa).getFirst();
|
||||
final Player pl = sa.hasParam("DefinedPlayer") ?
|
||||
AbilityUtils.getDefinedPlayers(sa.getHostCard(), sa.getParam("DefinedPlayer"), sa).getFirst()
|
||||
: sa.getActivatingPlayer();
|
||||
sb.append(pl.getName());
|
||||
|
||||
if (sa.hasParam("CounterType")) {
|
||||
|
||||
@@ -18,6 +18,7 @@ import forge.game.player.PlayerController;
|
||||
import forge.game.spellability.SpellAbility;
|
||||
import forge.game.zone.Zone;
|
||||
import forge.game.zone.ZoneType;
|
||||
import forge.util.Lang;
|
||||
import forge.util.Localizer;
|
||||
|
||||
public class CountersRemoveEffect extends SpellAbilityEffect {
|
||||
@@ -53,13 +54,9 @@ public class CountersRemoveEffect extends SpellAbilityEffect {
|
||||
}
|
||||
sb.append(" from");
|
||||
|
||||
for (final Card c : getTargetCards(sa)) {
|
||||
sb.append(" ").append(c);
|
||||
}
|
||||
sb.append(Lang.joinHomogenous(getTargetCards(sa)));
|
||||
|
||||
for (final Player tgtPlayer : getTargetPlayers(sa)) {
|
||||
sb.append(" ").append(tgtPlayer);
|
||||
}
|
||||
sb.append(Lang.joinHomogenous(getTargetPlayers(sa)));
|
||||
|
||||
sb.append(".");
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import forge.game.card.CardLists;
|
||||
import forge.game.player.Player;
|
||||
import forge.game.spellability.SpellAbility;
|
||||
import forge.game.zone.ZoneType;
|
||||
import forge.util.Lang;
|
||||
import forge.util.collect.FCollectionView;
|
||||
|
||||
public class DamageEachEffect extends DamageBaseEffect {
|
||||
@@ -38,9 +39,7 @@ public class DamageEachEffect extends DamageBaseEffect {
|
||||
sb.append(sa.getParam("StackDescription"));
|
||||
} else {
|
||||
sb.append("Each ").append(desc).append(" deals ").append(dmg).append(" to ");
|
||||
for (final Player p : getTargetPlayers(sa)) {
|
||||
sb.append(p);
|
||||
}
|
||||
Lang.joinHomogenous(getTargetPlayers(sa));
|
||||
if (sa.hasParam("DefinedCards")) {
|
||||
if (sa.getParam("DefinedCards").equals("Self")) {
|
||||
sb.append(" itself");
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
package forge.game.ability.effects;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import forge.game.Game;
|
||||
import forge.game.ability.AbilityUtils;
|
||||
import forge.game.ability.SpellAbilityEffect;
|
||||
@@ -12,6 +8,7 @@ import forge.game.card.CardCollection;
|
||||
import forge.game.combat.Combat;
|
||||
import forge.game.player.Player;
|
||||
import forge.game.spellability.SpellAbility;
|
||||
import forge.util.Lang;
|
||||
|
||||
public class RemoveFromCombatEffect extends SpellAbilityEffect {
|
||||
|
||||
@@ -19,10 +16,8 @@ public class RemoveFromCombatEffect extends SpellAbilityEffect {
|
||||
protected String getStackDescription(SpellAbility sa) {
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
|
||||
final List<Card> tgtCards = getTargetCards(sa);
|
||||
|
||||
sb.append("Remove ");
|
||||
sb.append(StringUtils.join(tgtCards, ", "));
|
||||
sb.append(Lang.joinHomogenous(getTargetCards(sa)));
|
||||
sb.append(" from combat.");
|
||||
|
||||
return sb.toString();
|
||||
|
||||
@@ -563,6 +563,11 @@ public final class StaticAbilityContinuous {
|
||||
p.setMaxHandSize(max);
|
||||
}
|
||||
}
|
||||
if (params.containsKey("RaiseMaxHandSize")) {
|
||||
String rmhs = params.get("RaiseMaxHandSize");
|
||||
int rmax = AbilityUtils.calculateAmount(hostCard, rmhs, stAb);
|
||||
p.setMaxHandSize(p.getMaxHandSize() + rmax);
|
||||
}
|
||||
|
||||
if (params.containsKey("AdjustLandPlays")) {
|
||||
String mhs = params.get("AdjustLandPlays");
|
||||
@@ -573,6 +578,7 @@ public final class StaticAbilityContinuous {
|
||||
p.addMaxLandPlays(se.getTimestamp(), add);
|
||||
}
|
||||
}
|
||||
|
||||
if (params.containsKey("ControlOpponentsSearchingLibrary")) {
|
||||
Player cntl = Iterables.getFirst(AbilityUtils.getDefinedPlayers(hostCard, params.get("ControlOpponentsSearchingLibrary"), stAb), null);
|
||||
p.addControlledWhileSearching(se.getTimestamp(), cntl);
|
||||
@@ -592,12 +598,6 @@ public final class StaticAbilityContinuous {
|
||||
p.addAdditionalOptionalVote(se.getTimestamp(), add);
|
||||
}
|
||||
|
||||
if (params.containsKey("RaiseMaxHandSize")) {
|
||||
String rmhs = params.get("RaiseMaxHandSize");
|
||||
int rmax = AbilityUtils.calculateAmount(hostCard, rmhs, stAb);
|
||||
p.setMaxHandSize(p.getMaxHandSize() + rmax);
|
||||
}
|
||||
|
||||
if (params.containsKey("ManaConversion")) {
|
||||
AbilityUtils.applyManaColorConversion(p.getManaPool(), params);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user