mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
Minor card fixes
This commit is contained in:
@@ -788,7 +788,6 @@ public class ComputerUtilMana {
|
||||
String manaProduced = ignoreColor || ignoreType ? MagicColor.toShortString(toPay.getColorMask())
|
||||
: predictManafromSpellAbility(saPayment, ai, toPay);
|
||||
|
||||
// System.out.println(manaProduced);
|
||||
payMultipleMana(cost, manaProduced, ai);
|
||||
|
||||
// remove from available lists
|
||||
|
||||
@@ -81,7 +81,6 @@ public class CountersRemoveAi extends SpellAbilityAi {
|
||||
*/
|
||||
@Override
|
||||
protected boolean checkApiLogic(Player ai, SpellAbility sa) {
|
||||
|
||||
final String type = sa.getParam("CounterType");
|
||||
|
||||
if (sa.usesTargeting()) {
|
||||
|
||||
@@ -67,8 +67,7 @@ public class FightAi extends SpellAbilityAi {
|
||||
for (Card humanCreature : humCreatures) {
|
||||
if (ComputerUtilCombat.getDamageToKill(humanCreature) <= fighter1.getNetPower()
|
||||
&& humanCreature.getNetPower() < ComputerUtilCombat.getDamageToKill(fighter1)) {
|
||||
// todo: check min/max targets; see if we picked the best
|
||||
// matchup
|
||||
// todo: check min/max targets; see if we picked the best matchup
|
||||
sa.getTargets().add(humanCreature);
|
||||
return true;
|
||||
} else if (humanCreature.getSVar("Targeting").equals("Dies")) {
|
||||
@@ -85,8 +84,7 @@ public class FightAi extends SpellAbilityAi {
|
||||
for (Card aiCreature : aiCreatures) {
|
||||
if (ComputerUtilCombat.getDamageToKill(humanCreature) <= aiCreature.getNetPower()
|
||||
&& humanCreature.getNetPower() < ComputerUtilCombat.getDamageToKill(aiCreature)) {
|
||||
// todo: check min/max targets; see if we picked the
|
||||
// best matchup
|
||||
// todo: check min/max targets; see if we picked the best matchup
|
||||
sa.getTargets().add(humanCreature);
|
||||
sa.getTargets().add(aiCreature);
|
||||
return true;
|
||||
|
||||
@@ -73,10 +73,8 @@ public class CopySpellAbilityEffect extends SpellAbilityEffect {
|
||||
controllers = AbilityUtils.getDefinedPlayers(card, sa.getParam("Controller"), sa);
|
||||
}
|
||||
|
||||
|
||||
final List<SpellAbility> tgtSpells = getTargetSpells(sa);
|
||||
|
||||
|
||||
if (tgtSpells.size() == 0 || amount == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -430,7 +430,6 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
public boolean isOpponentOf(Player other) {
|
||||
return other != this && other != null && (other.teamNumber < 0 || other.teamNumber != teamNumber);
|
||||
}
|
||||
|
||||
public boolean isOpponentOf(String other) {
|
||||
Player otherPlayer = null;
|
||||
for (Player p : game.getPlayers()) {
|
||||
@@ -474,9 +473,7 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
public final boolean gainLife(int lifeGain, final Card source) {
|
||||
return gainLife(lifeGain, source, null);
|
||||
}
|
||||
|
||||
public final boolean gainLife(int lifeGain, final Card source, final SpellAbility sa) {
|
||||
|
||||
// Run any applicable replacement effects.
|
||||
final Map<AbilityKey, Object> repParams = AbilityKey.mapFromAffected(this);
|
||||
repParams.put(AbilityKey.LifeGained, lifeGain);
|
||||
@@ -544,7 +541,6 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
public final int loseLife(final int toLose) {
|
||||
return loseLife(toLose, false);
|
||||
}
|
||||
|
||||
public final int loseLife(final int toLose, final boolean manaBurn) {
|
||||
int lifeLost = 0;
|
||||
if (!canLoseLife()) {
|
||||
@@ -870,7 +866,6 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
public final int addCounter(final CounterType counterType, final int n, final Player source, final SpellAbility cause, final boolean applyMultiplier, GameEntityCounterTable table) {
|
||||
return addCounter(counterType, n, source, cause, applyMultiplier, true, table);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int addCounter(CounterType counterType, int n, final Player source, final SpellAbility cause, boolean applyMultiplier, boolean fireEvents, GameEntityCounterTable table) {
|
||||
int addAmount = n;
|
||||
@@ -1000,7 +995,6 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
public final void addChangedKeywords(final String[] addKeywords, final String[] removeKeywords, final Long timestamp) {
|
||||
addChangedKeywords(ImmutableList.copyOf(addKeywords), ImmutableList.copyOf(removeKeywords), timestamp);
|
||||
}
|
||||
|
||||
public final void addChangedKeywords(final List<String> addKeywords, final List<String> removeKeywords, final Long timestamp) {
|
||||
// if the key already exists - merge entries
|
||||
KeywordsChange cks = null;
|
||||
@@ -1050,8 +1044,6 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
public final void removeKeyword(final String keyword) {
|
||||
removeKeyword(keyword, true);
|
||||
}
|
||||
|
||||
|
||||
public final void removeKeyword(final String keyword, final boolean allInstances) {
|
||||
boolean keywordRemoved = false;
|
||||
|
||||
@@ -1082,7 +1074,6 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
public final boolean hasKeyword(final String keyword) {
|
||||
return keywords.contains(keyword);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean hasKeyword(final Keyword keyword) {
|
||||
return keywords.contains(keyword);
|
||||
@@ -1172,7 +1163,6 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
public boolean hasProtectionFrom(final Card source, final boolean checkSBA) {
|
||||
return hasProtectionFrom(source, checkSBA, false);
|
||||
}
|
||||
|
||||
public boolean hasProtectionFrom(final Card source, final boolean checkSBA, final boolean damageSource) {
|
||||
final boolean colorlessDamage = damageSource && source.hasKeyword("Colorless Damage Source");
|
||||
for (KeywordInterface ki : keywords) {
|
||||
@@ -1638,6 +1628,7 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
public final int getNumDiscardedThisTurn() {
|
||||
return numDiscardedThisTurn;
|
||||
}
|
||||
|
||||
public final void resetNumDiscardedThisTurn() {
|
||||
numDiscardedThisTurn = 0;
|
||||
}
|
||||
@@ -1925,7 +1916,6 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
public boolean hasTappedLandForManaThisTurn() {
|
||||
return tappedLandForManaThisTurn;
|
||||
}
|
||||
|
||||
public void setTappedLandForManaThisTurn(boolean tappedLandForManaThisTurn) {
|
||||
this.tappedLandForManaThisTurn = tappedLandForManaThisTurn;
|
||||
}
|
||||
@@ -2004,7 +1994,6 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
boolean isAnyOppLoseProof = false;
|
||||
for (Player p : game.getPlayers()) {
|
||||
if (p == this || p.getOutcome() != null) {
|
||||
|
||||
continue; // except self and already dead
|
||||
}
|
||||
isAnyOppLoseProof |= p.hasKeyword("You can't lose the game.");
|
||||
@@ -2083,7 +2072,6 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
public final boolean hasRevolt() {
|
||||
return revolt;
|
||||
}
|
||||
|
||||
public final void setRevolt(final boolean val) {
|
||||
revolt = val;
|
||||
}
|
||||
@@ -2143,7 +2131,6 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
public final void setLibrarySearched(final int l) {
|
||||
numLibrarySearchedOwn = l;
|
||||
}
|
||||
|
||||
public final int getLibrarySearched() {
|
||||
return numLibrarySearchedOwn;
|
||||
}
|
||||
@@ -2167,7 +2154,6 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
|
||||
@Override
|
||||
public final boolean isValid(final String restriction, final Player sourceController, final Card source, CardTraitBase spellAbility) {
|
||||
|
||||
final String[] incR = restriction.split("\\.", 2);
|
||||
|
||||
if (incR[0].equals("Opponent")) {
|
||||
@@ -2320,6 +2306,7 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
public final void resetSpellCastThisGame() {
|
||||
spellsCastThisGame = 0;
|
||||
}
|
||||
|
||||
public final int getLifeGainedByTeamThisTurn() {
|
||||
return lifeGainedByTeamThisTurn;
|
||||
}
|
||||
@@ -2647,7 +2634,6 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
public int getStartingHandSize() {
|
||||
return startingHandSize;
|
||||
}
|
||||
|
||||
public void setStartingHandSize(int shs) {
|
||||
startingHandSize = shs;
|
||||
}
|
||||
@@ -2687,7 +2673,6 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
* Puts my currently active planes, if any, at the bottom of my planar deck.
|
||||
*/
|
||||
public void leaveCurrentPlane() {
|
||||
|
||||
final Map<AbilityKey, Object> runParams = AbilityKey.newMap();
|
||||
runParams.put(AbilityKey.Cards, new CardCollection(currentPlanes));
|
||||
game.getTriggerHandler().runTrigger(TriggerType.PlaneswalkedFrom, runParams, false);
|
||||
@@ -2746,11 +2731,9 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
public CardCollectionView getInboundTokens() {
|
||||
return inboundTokens;
|
||||
}
|
||||
|
||||
public void addInboundToken(Card c) {
|
||||
inboundTokens.add(c);
|
||||
}
|
||||
|
||||
public void removeInboundToken(Card c) {
|
||||
inboundTokens.remove(c);
|
||||
}
|
||||
@@ -2791,7 +2774,6 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
ColorSet identity = ColorSet.fromMask(ci);
|
||||
return identity;
|
||||
}
|
||||
|
||||
public ColorSet getNotCommanderColorID() {
|
||||
if (commanders.isEmpty()) {
|
||||
return null;
|
||||
@@ -2804,7 +2786,6 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
Integer cast = commanderCast.get(commander);
|
||||
return cast == null ? 0 : cast.intValue();
|
||||
}
|
||||
|
||||
public void incCommanderCast(Card commander) {
|
||||
commanderCast.put(commander, getCommanderCast(commander) + 1);
|
||||
getView().updateCommanderCast(this, commander);
|
||||
@@ -2842,9 +2823,11 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
public void setExtraTurnCount(final int val) {
|
||||
view.setExtraTurnCount(val);
|
||||
}
|
||||
|
||||
public void setHasPriority(final boolean val) {
|
||||
view.setHasPriority(val);
|
||||
}
|
||||
|
||||
public boolean isAI() {
|
||||
return view.isAI();
|
||||
}
|
||||
@@ -3137,7 +3120,6 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
public CardCollectionView getLostOwnership() {
|
||||
return lostOwnership;
|
||||
}
|
||||
|
||||
public CardCollectionView getGainedOwnership() {
|
||||
return gainedOwnership;
|
||||
}
|
||||
@@ -3209,6 +3191,7 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
this.updateZoneForView(com);
|
||||
}
|
||||
}
|
||||
|
||||
public void updateKeywordCardAbilityText() {
|
||||
if(getKeywordCard() == null)
|
||||
return;
|
||||
@@ -3252,10 +3235,10 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
keywordEffect = null;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean hasBlessing() {
|
||||
return blessingEffect != null;
|
||||
}
|
||||
|
||||
public void setBlessing(boolean bless) {
|
||||
// no need to to change
|
||||
if ((blessingEffect != null) == bless) {
|
||||
@@ -3357,7 +3340,6 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
getView().updateAdditionalVote(this);
|
||||
getGame().fireEvent(new GameEventPlayerStatsChanged(this, false));
|
||||
}
|
||||
|
||||
public void removeAdditionalVote(long timestamp) {
|
||||
if (additionalVotes.remove(timestamp) != null) {
|
||||
getView().updateAdditionalVote(this);
|
||||
@@ -3420,7 +3402,6 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
public Set<Long> getControlVote() {
|
||||
return controlVotes;
|
||||
}
|
||||
|
||||
public void setControlVote(Set<Long> value) {
|
||||
controlVotes.clear();
|
||||
controlVotes.addAll(value);
|
||||
|
||||
@@ -3,9 +3,8 @@ ManaCost:4 U
|
||||
Types:Enchantment Aura Curse
|
||||
K:Enchant player
|
||||
A:SP$ Attach | Cost$ 4 U | ValidTgts$ Player | AILogic$ Curse
|
||||
T:Mode$ SpellCast | ValidCard$ Instant,Sorcery | ValidActivatingPlayer$ Player.EnchantedBy | Execute$ TrigCopy | TriggerZones$ Battlefield | OptionalDecider$ TriggeredCardOpponent | TriggerDescription$ Whenever enchanted player casts an instant or sorcery spell, each other player may copy that spell and may choose new targets for the copy they control.
|
||||
# TODO each player should copy it for multiplayer
|
||||
SVar:TrigCopy:DB$ CopySpellAbility | Defined$ TriggeredSpellAbility | Controller$ TriggeredCardOpponent | MayChooseTarget$ True
|
||||
T:Mode$ SpellCast | ValidCard$ Instant,Sorcery | ValidActivatingPlayer$ Player.EnchantedBy | Execute$ TrigCopy | TriggerZones$ Battlefield | TriggerDescription$ Whenever enchanted player casts an instant or sorcery spell, each other player may copy that spell and may choose new targets for the copy they control.
|
||||
SVar:TrigCopy:DB$ CopySpellAbility | Defined$ TriggeredSpellAbility | Controller$ TriggeredCardOpponent | Optional$ True | MayChooseTarget$ True
|
||||
AI:RemoveDeck:All
|
||||
SVar:RemMultiplayer:True
|
||||
Oracle:Enchant player\nWhenever enchanted player casts an instant or sorcery spell, each other player may copy that spell and may choose new targets for the copy they control.
|
||||
|
||||
@@ -3,7 +3,7 @@ ManaCost:2 G G
|
||||
Types:Creature Spirit
|
||||
PT:3/4
|
||||
T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Card.Self | Execute$ RepeatPayment | TriggerController$ TriggeredCardController | TriggerDescription$ When CARDNAME dies, each player may pay any amount of mana. Then each player creates a number of 1/1 green Squirrel creature tokens equal to the amount of mana they paid this way.
|
||||
SVar:RepeatPayment:DB$ RepeatEach | RepeatPlayers$ Player | StartingWithActivator$ True | RepeatSubAbility$ DBPay | StackDescription$ When CARDNAME dies, each player may pay any amount of mana. Then each player creates a number of 1/1 green Squirrel creature tokens equal to the amount of mana they paid this way.
|
||||
SVar:RepeatPayment:DB$ RepeatEach | RepeatPlayers$ Player | StartingWithActivator$ True | ChangeZoneTable$ True | RepeatSubAbility$ DBPay | StackDescription$ When CARDNAME dies, each player may pay any amount of mana. Then each player creates a number of 1/1 green Squirrel creature tokens equal to the amount of mana they paid this way.
|
||||
SVar:DBPay:DB$ ChooseNumber | Defined$ Player.IsRemembered | ChooseAnyNumber$ True | ListTitle$ Pay Any Mana | AILogic$ MaxForAnyController | SubAbility$ DBToken
|
||||
# TODO: ideally the tokens should be created simultaneously after all the players have finished paying mana, but that's difficult to implement.
|
||||
SVar:DBToken:DB$ Token | TokenAmount$ X | TokenScript$ g_1_1_squirrel | TokenOwner$ Player.IsRemembered | LegacyImage$ g 1 1 squirrel wth | UnlessCost$ X | UnlessPayer$ Player.IsRemembered | UnlessSwitched$ True
|
||||
|
||||
@@ -2,8 +2,7 @@ Name:Mutiny
|
||||
ManaCost:R
|
||||
Types:Sorcery
|
||||
A:SP$ Pump | Cost$ R | ValidTgts$ Creature.OppCtrl | AILogic$ PowerDmg | TgtPrompt$ Select target creature an opponent controls | SubAbility$ MutinyDamage | StackDescription$ None | SpellDescription$ Target creature an opponent controls deals damage equal to its power to another target creature that player controls.
|
||||
SVar:MutinyDamage:DB$ DealDamage | ValidTgts$ Creature.OppCtrl | TargetUnique$ True | AILogic$ PowerDmg | NumDmg$ X | DamageSource$ ParentTarget
|
||||
SVar:MutinyDamage:DB$ DealDamage | ValidTgts$ Creature.OppCtrl | TargetUnique$ True | TargetsWithSameController$ True | AILogic$ PowerDmg | NumDmg$ X | DamageSource$ ParentTarget
|
||||
SVar:X:ParentTargeted$CardPower
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/mutiny.jpg
|
||||
//TODO Not perfect yet, there seems to be no check whether the creature's controller is the same?
|
||||
Oracle:Target creature an opponent controls deals damage equal to its power to another target creature that player controls.
|
||||
@@ -4,7 +4,7 @@ Types:Legendary Creature Elf Warrior
|
||||
PT:2/2
|
||||
T:Mode$ Phase | Phase$ BeginCombat | ValidPlayer$ You | Execute$ TrigPayCost | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of combat on your turn, you may pay {X}{X}. When you do, distribute X +1/+1 counters among any number of target Elves.
|
||||
SVar:TrigPayCost:AB$ ImmediateTrigger | Cost$ X X | Execute$ TrigPutCounters | TriggerDescription$ When you pay {X}{X}, distribute X +1/+1 counters among any number of target Elf creatures you control.
|
||||
SVar:TrigPutCounters:DB$ PutCounter | ValidTgts$ Creature.Elf+YouCtrl | TgtPrompt$ Select any number of target Elf creatures you control to distribute counters to | CounterType$ P1P1 | CounterNum$ Y | TargetMin$ 1 | TargetMax$ X | DividedAsYouChoose$ X
|
||||
SVar:TrigPutCounters:DB$ PutCounter | ValidTgts$ Creature.Elf+YouCtrl | TgtPrompt$ Select any number of target Elf creatures you control to distribute counters to | CounterType$ P1P1 | CounterNum$ X | TargetMin$ 1 | TargetMax$ X | DividedAsYouChoose$ X
|
||||
SVar:X:Count$xPaid
|
||||
K:Partner
|
||||
DeckHas:Ability$Counters
|
||||
|
||||
Reference in New Issue
Block a user