mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
- Added Daxos of Meletis and Psychic Intrusion (only updated mana color conversion for human players)
This commit is contained in:
2
.gitattributes
vendored
2
.gitattributes
vendored
@@ -3219,6 +3219,7 @@ forge-gui/res/cardsfolder/d/dawns_reflection.txt -text
|
|||||||
forge-gui/res/cardsfolder/d/dawnstrider.txt svneol=native#text/plain
|
forge-gui/res/cardsfolder/d/dawnstrider.txt svneol=native#text/plain
|
||||||
forge-gui/res/cardsfolder/d/dawnstrike_paladin.txt -text
|
forge-gui/res/cardsfolder/d/dawnstrike_paladin.txt -text
|
||||||
forge-gui/res/cardsfolder/d/dawntreader_elk.txt -text
|
forge-gui/res/cardsfolder/d/dawntreader_elk.txt -text
|
||||||
|
forge-gui/res/cardsfolder/d/daxos_of_meletis.txt -text
|
||||||
forge-gui/res/cardsfolder/d/day_of_destiny.txt svneol=native#text/plain
|
forge-gui/res/cardsfolder/d/day_of_destiny.txt svneol=native#text/plain
|
||||||
forge-gui/res/cardsfolder/d/day_of_judgment.txt svneol=native#text/plain
|
forge-gui/res/cardsfolder/d/day_of_judgment.txt svneol=native#text/plain
|
||||||
forge-gui/res/cardsfolder/d/day_of_the_dragons.txt svneol=native#text/plain
|
forge-gui/res/cardsfolder/d/day_of_the_dragons.txt svneol=native#text/plain
|
||||||
@@ -9433,6 +9434,7 @@ forge-gui/res/cardsfolder/p/psychatog.txt svneol=native#text/plain
|
|||||||
forge-gui/res/cardsfolder/p/psychic_allergy.txt -text
|
forge-gui/res/cardsfolder/p/psychic_allergy.txt -text
|
||||||
forge-gui/res/cardsfolder/p/psychic_barrier.txt svneol=native#text/plain
|
forge-gui/res/cardsfolder/p/psychic_barrier.txt svneol=native#text/plain
|
||||||
forge-gui/res/cardsfolder/p/psychic_drain.txt svneol=native#text/plain
|
forge-gui/res/cardsfolder/p/psychic_drain.txt svneol=native#text/plain
|
||||||
|
forge-gui/res/cardsfolder/p/psychic_intrusion.txt -text
|
||||||
forge-gui/res/cardsfolder/p/psychic_membrane.txt svneol=native#text/plain
|
forge-gui/res/cardsfolder/p/psychic_membrane.txt svneol=native#text/plain
|
||||||
forge-gui/res/cardsfolder/p/psychic_miasma.txt -text svneol=unset#text/plain
|
forge-gui/res/cardsfolder/p/psychic_miasma.txt -text svneol=unset#text/plain
|
||||||
forge-gui/res/cardsfolder/p/psychic_overload.txt svneol=native#text/plain
|
forge-gui/res/cardsfolder/p/psychic_overload.txt svneol=native#text/plain
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ public class ComputerUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final Cost cost = sa.getPayCosts();
|
final Cost cost = sa.getPayCosts();
|
||||||
|
// TODO: update mana color conversion for Daxos of Meletis
|
||||||
if (cost == null) {
|
if (cost == null) {
|
||||||
if (ComputerUtilMana.payManaCost(ai, sa)) {
|
if (ComputerUtilMana.payManaCost(ai, sa)) {
|
||||||
game.getStack().addAndUnfreeze(sa);
|
game.getStack().addAndUnfreeze(sa);
|
||||||
@@ -105,8 +105,6 @@ public class ComputerUtil {
|
|||||||
game.getAction().reveal(sa.getSplicedCards(), ai, true, "Computer reveals spliced cards from ");
|
game.getAction().reveal(sa.getSplicedCards(), ai, true, "Computer reveals spliced cards from ");
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
// TODO: solve problems with TapsForMana triggers by adding
|
|
||||||
// sources tapped here if possible (ArsenalNut)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//Should not arrive here
|
//Should not arrive here
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package forge.game.ability;
|
package forge.game.ability;
|
||||||
|
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
|
|
||||||
import forge.card.MagicColor;
|
import forge.card.MagicColor;
|
||||||
import forge.card.mana.ManaCost;
|
import forge.card.mana.ManaCost;
|
||||||
import forge.card.mana.ManaCostShard;
|
import forge.card.mana.ManaCostShard;
|
||||||
@@ -15,10 +16,13 @@ import forge.game.spellability.SpellAbility;
|
|||||||
import forge.game.spellability.SpellAbilityStackInstance;
|
import forge.game.spellability.SpellAbilityStackInstance;
|
||||||
import forge.game.zone.ZoneType;
|
import forge.game.zone.ZoneType;
|
||||||
import forge.util.Expressions;
|
import forge.util.Expressions;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.commons.lang3.text.WordUtils;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO: Write javadoc for this type.
|
* TODO: Write javadoc for this type.
|
||||||
@@ -1354,4 +1358,29 @@ public class AbilityUtils {
|
|||||||
}
|
}
|
||||||
return CardFactoryUtil.xCount(c, s);
|
return CardFactoryUtil.xCount(c, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static final void applyManaColorConvertion(final Player p, final Map<String, String> params) {
|
||||||
|
String conversionType = params.get("ManaColorConversion");
|
||||||
|
|
||||||
|
// Choices are Additives(OR) or Restrictive(AND)
|
||||||
|
boolean additive = "Additive".equals(conversionType);
|
||||||
|
|
||||||
|
for(String c : MagicColor.Constant.COLORS_AND_COLORLESS) {
|
||||||
|
// Use the strings from MagicColor, since that's how the Script will be coming in as
|
||||||
|
String key = WordUtils.capitalize(c) + "Conversion";
|
||||||
|
if (params.containsKey(key)) {
|
||||||
|
String convertTo = params.get(key);
|
||||||
|
byte convertByte = 0;
|
||||||
|
if ("All".equals(convertTo)) {
|
||||||
|
convertByte = MagicColor.ALL_COLORS;
|
||||||
|
} else{
|
||||||
|
for(String convertColor : convertTo.split(",")) {
|
||||||
|
convertByte |= MagicColor.fromName(convertColor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// AdjustColorReplacement has two different matrices handling final mana conversion under the covers
|
||||||
|
p.getManaPool().adjustColorReplacement(MagicColor.fromName(c), convertByte, additive);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ package forge.game.staticability;
|
|||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import forge.card.CardType;
|
import forge.card.CardType;
|
||||||
import forge.card.ColorSet;
|
import forge.card.ColorSet;
|
||||||
import forge.card.MagicColor;
|
|
||||||
import forge.card.mana.ManaCostShard;
|
import forge.card.mana.ManaCostShard;
|
||||||
import forge.game.*;
|
import forge.game.*;
|
||||||
import forge.game.ability.AbilityFactory;
|
import forge.game.ability.AbilityFactory;
|
||||||
@@ -29,7 +28,6 @@ import forge.game.card.Card;
|
|||||||
import forge.game.card.CardFactoryUtil;
|
import forge.game.card.CardFactoryUtil;
|
||||||
import forge.game.card.CardLists;
|
import forge.game.card.CardLists;
|
||||||
import forge.game.card.CardUtil;
|
import forge.game.card.CardUtil;
|
||||||
import forge.game.mana.ManaPool;
|
|
||||||
import forge.game.player.Player;
|
import forge.game.player.Player;
|
||||||
import forge.game.replacement.ReplacementEffect;
|
import forge.game.replacement.ReplacementEffect;
|
||||||
import forge.game.replacement.ReplacementHandler;
|
import forge.game.replacement.ReplacementHandler;
|
||||||
@@ -39,8 +37,6 @@ import forge.game.trigger.Trigger;
|
|||||||
import forge.game.trigger.TriggerHandler;
|
import forge.game.trigger.TriggerHandler;
|
||||||
import forge.game.zone.ZoneType;
|
import forge.game.zone.ZoneType;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.commons.lang3.text.WordUtils;
|
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -341,29 +337,7 @@ public class StaticAbilityContinuous {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (params.containsKey("ManaColorConversion")) {
|
if (params.containsKey("ManaColorConversion")) {
|
||||||
String conversionType = params.get("ManaColorConversion");
|
AbilityUtils.applyManaColorConvertion(p, params);
|
||||||
|
|
||||||
// Choices are Additives(OR) or Restrictive(AND)
|
|
||||||
boolean additive = "Additive".equals(conversionType);
|
|
||||||
ManaPool pool = p.getManaPool();
|
|
||||||
|
|
||||||
for(String c : MagicColor.Constant.COLORS_AND_COLORLESS) {
|
|
||||||
// Use the strings from MagicColor, since that's how the Script will be coming in as
|
|
||||||
String key = WordUtils.capitalize(c) + "Conversion";
|
|
||||||
if (params.containsKey(key)) {
|
|
||||||
String convertTo = params.get(key);
|
|
||||||
byte convertByte = 0;
|
|
||||||
if ("All".equals(convertTo)) {
|
|
||||||
convertByte = MagicColor.ALL_COLORS;
|
|
||||||
} else{
|
|
||||||
for(String convertColor : convertTo.split(",")) {
|
|
||||||
convertByte |= MagicColor.fromName(convertColor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// AdjustColorReplacement has two different matrices handling final mana conversion under the covers
|
|
||||||
pool.adjustColorReplacement(MagicColor.fromName(c), convertByte, additive);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
19
forge-gui/res/cardsfolder/d/daxos_of_meletis.txt
Normal file
19
forge-gui/res/cardsfolder/d/daxos_of_meletis.txt
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
Name:Daxos of Meletis
|
||||||
|
ManaCost:1 W U
|
||||||
|
Types:Legendary Creature Human Soldier
|
||||||
|
PT:2/2
|
||||||
|
K:CantBeBlockedBy Creature.powerGE3
|
||||||
|
T:Mode$ DamageDone | ValidSource$ Card.Self | ValidTarget$ Player | CombatDamage$ True | Execute$ TrigExile | TriggerDescription$ Whenever CARDNAME deals combat damage to a player, exile the top card of that player's library. You gain life equal to that card's converted mana cost. Until end of turn, you may cast that card and you may spend mana as though it were mana of any color to cast it.
|
||||||
|
SVar:TrigExile:AB$ Mill | Cost$ 0 | Defined$ TriggeredTarget | NumCards$ 1 | Destination$ Exile | RememberMilled$ True | SubAbility$ DBGainLife
|
||||||
|
SVar:DBGainLife:DB$ GainLife | Defined$ You | LifeAmount$ X | References$ X | SubAbility$ DBEffect
|
||||||
|
SVar:X:Remembered$CardManaCost
|
||||||
|
SVar:DBEffect:DB$ Effect | StaticAbilities$ STPlay,STPlay2 | Triggers$ TriggerCastDoM | SVars$ TrigRemoveSelf,DoM | RememberObjects$ Remembered | SubAbility$ DBCleanup
|
||||||
|
SVar:STPlay:Mode$ Continuous | EffectZone$ Command | Affected$ Card.IsRemembered+nonLand+YouOwn | AddSVar$ DoM | AddHiddenKeyword$ May be played & May spend mana as though it were mana of any color to cast CARDNAME | AffectedZone$ Exile | Description$ Until end of turn, you may cast that card and you may spend mana as though it were mana of any color to cast it.
|
||||||
|
SVar:STPlay2:Mode$ Continuous | EffectZone$ Command | Affected$ Card.IsRemembered+nonLand+OppOwn | AddSVar$ DoM | AddHiddenKeyword$ May be played by your opponent & May spend mana as though it were mana of any color to cast CARDNAME | AffectedZone$ Exile
|
||||||
|
SVar:TriggerCastDoM:Mode$ SpellCast | ValidCard$ Card.IsRemembered | TriggerZones$ Command | Execute$ TrigRemoveSelf | Static$ True
|
||||||
|
SVar:TrigRemoveSelf:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile
|
||||||
|
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
||||||
|
SVar:DoM:SVar:ManaConversionMatrix:ManaColorConversion$ Additive | WhiteConversion$ All | BlueConversion$ All | BlackConversion$ All | RedConversion$ All | GreenConversion$ All | ColorlessConversion$ All
|
||||||
|
SVar:RemAIDeck:True
|
||||||
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/daxos_of_meletis.jpg
|
||||||
|
Oracle:Daxos of Meletis can't be blocked by creatures with power 3 or greater.\nWhenever Daxos of Meletis deals combat damage to a player, exile the top card of that player's library. You gain life equal to that card's converted mana cost. Until end of turn, you may cast that card and you may spend mana as though it were mana of any color to cast it.
|
||||||
13
forge-gui/res/cardsfolder/p/psychic_intrusion.txt
Normal file
13
forge-gui/res/cardsfolder/p/psychic_intrusion.txt
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
Name:Psychic Intrusion
|
||||||
|
ManaCost:3 U B
|
||||||
|
Types:Sorcery
|
||||||
|
A:SP$ ChangeZone | Cost$ 3 U B | Origin$ Hand,Graveyard | Destination$ Exile | ValidTgts$ Opponent | DefinedPlayer$ Targeted | Chooser$ You | TgtPrompt$ Select target opponent | ChangeType$ Card.nonLand | ChangeNum$ 1 | IsCurse$ True | RememberChanged$ True | SubAbility$ DBEffect | SpellDescription$ Target opponent reveals his or her hand. You choose a nonland card from that player's graveyard or hand and exile it. You may cast that card for as long as it remains exiled, and you may spend mana as though it were mana of any color to cast that spell.
|
||||||
|
SVar:DBEffect:DB$ Effect | StaticAbilities$ STPlay | Triggers$ TriggerCastPI | SVars$ TrigRemoveSelf,ManaConversionPI | RememberObjects$ Remembered | Duration$ Permanent | SubAbility$ DBCleanup
|
||||||
|
SVar:STPlay:Mode$ Continuous | EffectZone$ Command | Affected$ Card.IsRemembered+OppOwn | AddSVar$ ManaConversionPI | AddHiddenKeyword$ May be played by your opponent & May spend mana as though it were mana of any color to cast CARDNAME | AffectedZone$ Exile | Description$ You may cast that card and you may spend mana as though it were mana of any color to cast it.
|
||||||
|
SVar:TriggerCastPI:Mode$ SpellCast | ValidCard$ Card.IsRemembered | TriggerZones$ Command | Execute$ TrigRemoveSelf | Static$ True
|
||||||
|
SVar:TrigRemoveSelf:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile
|
||||||
|
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
||||||
|
SVar:ManaConversionPI:SVar:ManaConversionMatrix:ManaColorConversion$ Additive | WhiteConversion$ All | BlueConversion$ All | BlackConversion$ All | RedConversion$ All | GreenConversion$ All | ColorlessConversion$ All
|
||||||
|
SVar:RemAIDeck:True
|
||||||
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/psychic_intrusion.jpg
|
||||||
|
Oracle:Target opponent reveals his or her hand. You choose a nonland card from that player's graveyard or hand and exile it. You may cast that card for as long as it remains exiled, and you may spend mana as though it were mana of any color to cast that spell.
|
||||||
@@ -18,13 +18,16 @@
|
|||||||
package forge.gui.player;
|
package forge.gui.player;
|
||||||
|
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
|
|
||||||
import forge.card.CardType;
|
import forge.card.CardType;
|
||||||
import forge.game.Game;
|
import forge.game.Game;
|
||||||
import forge.game.GameObject;
|
import forge.game.GameObject;
|
||||||
|
import forge.game.ability.AbilityFactory;
|
||||||
import forge.game.ability.AbilityUtils;
|
import forge.game.ability.AbilityUtils;
|
||||||
import forge.game.card.Card;
|
import forge.game.card.Card;
|
||||||
import forge.game.cost.CostPartMana;
|
import forge.game.cost.CostPartMana;
|
||||||
import forge.game.cost.CostPayment;
|
import forge.game.cost.CostPayment;
|
||||||
|
import forge.game.mana.ManaPool;
|
||||||
import forge.game.player.Player;
|
import forge.game.player.Player;
|
||||||
import forge.game.player.PlayerController;
|
import forge.game.player.PlayerController;
|
||||||
import forge.game.spellability.AbilitySub;
|
import forge.game.spellability.AbilitySub;
|
||||||
@@ -32,9 +35,11 @@ import forge.game.spellability.Spell;
|
|||||||
import forge.game.spellability.SpellAbility;
|
import forge.game.spellability.SpellAbility;
|
||||||
import forge.game.spellability.TargetRestrictions;
|
import forge.game.spellability.TargetRestrictions;
|
||||||
import forge.game.zone.Zone;
|
import forge.game.zone.Zone;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@@ -60,8 +65,13 @@ public class HumanPlaySpellAbility {
|
|||||||
// used to rollback
|
// used to rollback
|
||||||
Zone fromZone = null;
|
Zone fromZone = null;
|
||||||
int zonePosition = 0;
|
int zonePosition = 0;
|
||||||
|
final ManaPool manapool = human.getManaPool();
|
||||||
|
|
||||||
final Card c = this.ability.getHostCard();
|
final Card c = this.ability.getHostCard();
|
||||||
|
boolean manaConversion = (ability.isSpell() && c.hasKeyword("May spend mana as though it were mana of any color to cast CARDNAME"));
|
||||||
|
|
||||||
|
Map<String, String> params = AbilityFactory.getMapParams(c.getSVar("ManaConversionMatrix"));
|
||||||
|
|
||||||
if (this.ability instanceof Spell && !c.isCopiedSpell()) {
|
if (this.ability instanceof Spell && !c.isCopiedSpell()) {
|
||||||
fromZone = game.getZoneOf(c);
|
fromZone = game.getZoneOf(c);
|
||||||
if (fromZone != null) {
|
if (fromZone != null) {
|
||||||
@@ -73,6 +83,9 @@ public class HumanPlaySpellAbility {
|
|||||||
// freeze Stack. No abilities should go onto the stack while I'm filling requirements.
|
// freeze Stack. No abilities should go onto the stack while I'm filling requirements.
|
||||||
game.getStack().freezeStack();
|
game.getStack().freezeStack();
|
||||||
|
|
||||||
|
if (manaConversion) {
|
||||||
|
AbilityUtils.applyManaColorConvertion(human, params);
|
||||||
|
}
|
||||||
// This line makes use of short-circuit evaluation of boolean values, that is each subsequent argument
|
// This line makes use of short-circuit evaluation of boolean values, that is each subsequent argument
|
||||||
// is only executed or evaluated if the first argument does not suffice to determine the value of the expression
|
// is only executed or evaluated if the first argument does not suffice to determine the value of the expression
|
||||||
boolean prerequisitesMet = this.announceValuesLikeX()
|
boolean prerequisitesMet = this.announceValuesLikeX()
|
||||||
@@ -91,6 +104,9 @@ public class HumanPlaySpellAbility {
|
|||||||
ability.getHostCard().unanimateBestow();
|
ability.getHostCard().unanimateBestow();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (manaConversion) {
|
||||||
|
manapool.restoreColorReplacements();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,6 +125,9 @@ public class HumanPlaySpellAbility {
|
|||||||
if (mayChooseTargets) {
|
if (mayChooseTargets) {
|
||||||
clearTargets(ability);
|
clearTargets(ability);
|
||||||
}
|
}
|
||||||
|
if (manaConversion) {
|
||||||
|
manapool.restoreColorReplacements();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user