mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
- Moving a bunch of the src files into organized packages.
This commit is contained in:
194
.gitattributes
vendored
194
.gitattributes
vendored
@@ -7873,34 +7873,6 @@ src/com/cloudgarden/layout/AnchorConstraint.java -text svneol=native#text/plain
|
|||||||
src/com/cloudgarden/layout/AnchorLayout.java -text svneol=native#text/plain
|
src/com/cloudgarden/layout/AnchorLayout.java -text svneol=native#text/plain
|
||||||
src/com/esotericsoftware/minlog/Log.java svneol=native#text/plain
|
src/com/esotericsoftware/minlog/Log.java svneol=native#text/plain
|
||||||
src/forge/AIPlayer.java -text svneol=native#text/plain
|
src/forge/AIPlayer.java -text svneol=native#text/plain
|
||||||
src/forge/Ability.java svneol=native#text/plain
|
|
||||||
src/forge/AbilityFactory.java -text svneol=native#text/plain
|
|
||||||
src/forge/AbilityFactory_AlterLife.java -text svneol=native#text/plain
|
|
||||||
src/forge/AbilityFactory_Animate.java -text svneol=native#text/plain
|
|
||||||
src/forge/AbilityFactory_Bounce.java -text svneol=native#text/plain
|
|
||||||
src/forge/AbilityFactory_ChangeZone.java -text svneol=native#text/plain
|
|
||||||
src/forge/AbilityFactory_Clash.java -text svneol=native#text/plain
|
|
||||||
src/forge/AbilityFactory_Combat.java -text svneol=native#text/plain
|
|
||||||
src/forge/AbilityFactory_CounterMagic.java -text svneol=native#text/plain
|
|
||||||
src/forge/AbilityFactory_Counters.java -text svneol=native#text/plain
|
|
||||||
src/forge/AbilityFactory_DealDamage.java -text svneol=native#text/plain
|
|
||||||
src/forge/AbilityFactory_Destroy.java -text svneol=native#text/plain
|
|
||||||
src/forge/AbilityFactory_Fetch.java -text svneol=native#text/plain
|
|
||||||
src/forge/AbilityFactory_GainControl.java -text svneol=native#text/plain
|
|
||||||
src/forge/AbilityFactory_Mana.java -text svneol=native#text/plain
|
|
||||||
src/forge/AbilityFactory_PermanentState.java -text svneol=native#text/plain
|
|
||||||
src/forge/AbilityFactory_Pump.java -text svneol=native#text/plain
|
|
||||||
src/forge/AbilityFactory_Regenerate.java -text svneol=native#text/plain
|
|
||||||
src/forge/AbilityFactory_Sacrifice.java -text svneol=native#text/plain
|
|
||||||
src/forge/AbilityFactory_Token.java -text svneol=native#text/plain
|
|
||||||
src/forge/AbilityFactory_Turns.java -text svneol=native#text/plain
|
|
||||||
src/forge/AbilityFactory_ZoneAffecting.java -text svneol=native#text/plain
|
|
||||||
src/forge/Ability_Activated.java svneol=native#text/plain
|
|
||||||
src/forge/Ability_Cost.java -text svneol=native#text/plain
|
|
||||||
src/forge/Ability_Mana.java -text svneol=native#text/plain
|
|
||||||
src/forge/Ability_Static.java -text svneol=native#text/plain
|
|
||||||
src/forge/Ability_Sub.java -text svneol=native#text/plain
|
|
||||||
src/forge/Ability_Triggered.java svneol=native#text/plain
|
|
||||||
src/forge/AllZone.java svneol=native#text/plain
|
src/forge/AllZone.java svneol=native#text/plain
|
||||||
src/forge/AllZoneUtil.java -text svneol=native#text/plain
|
src/forge/AllZoneUtil.java -text svneol=native#text/plain
|
||||||
src/forge/BackgroundPanel.java -text svneol=native#text/plain
|
src/forge/BackgroundPanel.java -text svneol=native#text/plain
|
||||||
@@ -7911,15 +7883,6 @@ src/forge/BoosterPack.java svneol=native#text/plain
|
|||||||
src/forge/ButtonUtil.java svneol=native#text/plain
|
src/forge/ButtonUtil.java svneol=native#text/plain
|
||||||
src/forge/Card.java -text svneol=native#text/plain
|
src/forge/Card.java -text svneol=native#text/plain
|
||||||
src/forge/CardContainer.java svneol=native#text/plain
|
src/forge/CardContainer.java svneol=native#text/plain
|
||||||
src/forge/CardFactory.java -text svneol=native#text/plain
|
|
||||||
src/forge/CardFactoryUtil.java -text svneol=native#text/plain
|
|
||||||
src/forge/CardFactory_Auras.java -text svneol=native#text/plain
|
|
||||||
src/forge/CardFactory_Creatures.java -text svneol=native#text/plain
|
|
||||||
src/forge/CardFactory_Equipment.java -text svneol=native#text/plain
|
|
||||||
src/forge/CardFactory_Instants.java -text svneol=native#text/plain
|
|
||||||
src/forge/CardFactory_Lands.java -text svneol=native#text/plain
|
|
||||||
src/forge/CardFactory_Planeswalkers.java -text svneol=native#text/plain
|
|
||||||
src/forge/CardFactory_Sorceries.java -text svneol=native#text/plain
|
|
||||||
src/forge/CardFilter.java -text svneol=native#text/plain
|
src/forge/CardFilter.java -text svneol=native#text/plain
|
||||||
src/forge/CardList.java -text svneol=native#text/plain
|
src/forge/CardList.java -text svneol=native#text/plain
|
||||||
src/forge/CardListFilter.java svneol=native#text/plain
|
src/forge/CardListFilter.java svneol=native#text/plain
|
||||||
@@ -7944,7 +7907,6 @@ src/forge/ComputerUtil_Block2.java svneol=native#text/plain
|
|||||||
src/forge/Computer_Race.java svneol=native#text/plain
|
src/forge/Computer_Race.java svneol=native#text/plain
|
||||||
src/forge/Constant.java svneol=native#text/plain
|
src/forge/Constant.java svneol=native#text/plain
|
||||||
src/forge/CopyFiles.java -text svneol=native#text/plain
|
src/forge/CopyFiles.java -text svneol=native#text/plain
|
||||||
src/forge/Cost_Payment.java -text svneol=native#text/plain
|
|
||||||
src/forge/Counters.java svneol=native#text/plain
|
src/forge/Counters.java svneol=native#text/plain
|
||||||
src/forge/Deck.java svneol=native#text/plain
|
src/forge/Deck.java svneol=native#text/plain
|
||||||
src/forge/DeckIO.java svneol=native#text/plain
|
src/forge/DeckIO.java svneol=native#text/plain
|
||||||
@@ -7963,13 +7925,6 @@ src/forge/GUI_Quest_Filter.java -text svneol=native#text/plain
|
|||||||
src/forge/GameAction.java svneol=native#text/plain
|
src/forge/GameAction.java svneol=native#text/plain
|
||||||
src/forge/GameActionUtil.java -text svneol=native#text/plain
|
src/forge/GameActionUtil.java -text svneol=native#text/plain
|
||||||
src/forge/GameInfo.java -text svneol=native#text/plain
|
src/forge/GameInfo.java -text svneol=native#text/plain
|
||||||
src/forge/Generate2ColorDeck.java -text svneol=native#text/plain
|
|
||||||
src/forge/Generate3ColorDeck.java -text svneol=native#text/plain
|
|
||||||
src/forge/GenerateConstructedDeck.java -text svneol=native#text/plain
|
|
||||||
src/forge/GenerateConstructedMultiColorDeck.java -text svneol=native#text/plain
|
|
||||||
src/forge/GenerateDraftDeck.java svneol=native#text/plain
|
|
||||||
src/forge/GenerateSealedDeck.java svneol=native#text/plain
|
|
||||||
src/forge/GenerateThemeDeck.java -text svneol=native#text/plain
|
|
||||||
src/forge/GuiDisplay.java svneol=native#text/plain
|
src/forge/GuiDisplay.java svneol=native#text/plain
|
||||||
src/forge/GuiDisplay2.java svneol=native#text/plain
|
src/forge/GuiDisplay2.java svneol=native#text/plain
|
||||||
src/forge/GuiDisplay3.java svneol=native#text/plain
|
src/forge/GuiDisplay3.java svneol=native#text/plain
|
||||||
@@ -8000,29 +7955,10 @@ src/forge/HumanPlayer.java -text svneol=native#text/plain
|
|||||||
src/forge/IO.java svneol=native#text/plain
|
src/forge/IO.java svneol=native#text/plain
|
||||||
src/forge/ImageCache.java svneol=native#text/plain
|
src/forge/ImageCache.java svneol=native#text/plain
|
||||||
src/forge/ImagePreviewPanel.java -text svneol=native#text/plain
|
src/forge/ImagePreviewPanel.java -text svneol=native#text/plain
|
||||||
src/forge/Input.java svneol=native#text/plain
|
|
||||||
src/forge/InputControl.java svneol=native#text/plain
|
|
||||||
src/forge/Input_Attack.java svneol=native#text/plain
|
|
||||||
src/forge/Input_Block.java svneol=native#text/plain
|
|
||||||
src/forge/Input_Cleanup.java svneol=native#text/plain
|
|
||||||
src/forge/Input_Mulligan.java svneol=native#text/plain
|
|
||||||
src/forge/Input_PassPriority.java -text svneol=native#text/plain
|
|
||||||
src/forge/Input_PayManaCost.java svneol=native#text/plain
|
|
||||||
src/forge/Input_PayManaCostUtil.java svneol=native#text/plain
|
|
||||||
src/forge/Input_PayManaCost_Ability.java svneol=native#text/plain
|
|
||||||
src/forge/KeyListenerTest.java -text svneol=native#text/plain
|
src/forge/KeyListenerTest.java -text svneol=native#text/plain
|
||||||
src/forge/ListProperties.java -text svneol=native#text/plain
|
src/forge/ListProperties.java -text svneol=native#text/plain
|
||||||
src/forge/MP3Player.java -text svneol=native#text/plain
|
src/forge/MP3Player.java -text svneol=native#text/plain
|
||||||
src/forge/MagicStack.java svneol=native#text/plain
|
src/forge/MagicStack.java svneol=native#text/plain
|
||||||
src/forge/Mana.java -text svneol=native#text/plain
|
|
||||||
src/forge/ManaCost.java -text svneol=native#text/plain
|
|
||||||
src/forge/ManaPool.java svneol=native#text/plain
|
|
||||||
src/forge/Mana_Part.java svneol=native#text/plain
|
|
||||||
src/forge/Mana_PartColor.java svneol=native#text/plain
|
|
||||||
src/forge/Mana_PartColorless.java svneol=native#text/plain
|
|
||||||
src/forge/Mana_PartSnow.java svneol=native#text/plain
|
|
||||||
src/forge/Mana_PartSplit.java svneol=native#text/plain
|
|
||||||
src/forge/Mana_PartTest.java svneol=native#text/plain
|
|
||||||
src/forge/MenuItem_HowToPlay.java svneol=native#text/plain
|
src/forge/MenuItem_HowToPlay.java svneol=native#text/plain
|
||||||
src/forge/Move.java svneol=native#text/plain
|
src/forge/Move.java svneol=native#text/plain
|
||||||
src/forge/MoveAttack.java svneol=native#text/plain
|
src/forge/MoveAttack.java svneol=native#text/plain
|
||||||
@@ -8059,52 +7995,106 @@ src/forge/RunTest.java svneol=native#text/plain
|
|||||||
src/forge/SetInfo.java -text svneol=native#text/plain
|
src/forge/SetInfo.java -text svneol=native#text/plain
|
||||||
src/forge/SetInfoUtil.java -text svneol=native#text/plain
|
src/forge/SetInfoUtil.java -text svneol=native#text/plain
|
||||||
src/forge/SimpleCombat.java svneol=native#text/plain
|
src/forge/SimpleCombat.java svneol=native#text/plain
|
||||||
src/forge/Spell.java svneol=native#text/plain
|
|
||||||
src/forge/SpellAbility.java -text svneol=native#text/plain
|
|
||||||
src/forge/SpellAbilityList.java svneol=native#text/plain
|
|
||||||
src/forge/SpellAbilityUtil.java svneol=native#text/plain
|
|
||||||
src/forge/SpellAbility_Requirements.java -text svneol=native#text/plain
|
|
||||||
src/forge/SpellAbility_Restriction.java -text svneol=native#text/plain
|
|
||||||
src/forge/Spell_Evoke.java svneol=native#text/plain
|
|
||||||
src/forge/Spell_Permanent.java svneol=native#text/plain
|
|
||||||
src/forge/StaticEffect.java -text svneol=native#text/plain
|
src/forge/StaticEffect.java -text svneol=native#text/plain
|
||||||
src/forge/StaticEffects.java -text svneol=native#text/plain
|
src/forge/StaticEffects.java -text svneol=native#text/plain
|
||||||
src/forge/TableModel.java -text svneol=native#text/plain
|
src/forge/TableModel.java -text svneol=native#text/plain
|
||||||
src/forge/TableSorter.java svneol=native#text/plain
|
src/forge/TableSorter.java svneol=native#text/plain
|
||||||
src/forge/Target.java -text svneol=native#text/plain
|
|
||||||
src/forge/Target_Selection.java -text svneol=native#text/plain
|
|
||||||
src/forge/TempRun.java svneol=native#text/plain
|
src/forge/TempRun.java svneol=native#text/plain
|
||||||
src/forge/Test.java svneol=native#text/plain
|
src/forge/Test.java svneol=native#text/plain
|
||||||
src/forge/TestMove.java svneol=native#text/plain
|
src/forge/TestMove.java svneol=native#text/plain
|
||||||
src/forge/TestPanel.java svneol=native#text/plain
|
src/forge/TestPanel.java svneol=native#text/plain
|
||||||
src/forge/Time.java svneol=native#text/plain
|
src/forge/Time.java svneol=native#text/plain
|
||||||
src/forge/Trigger.java -text svneol=native#text/plain
|
|
||||||
src/forge/TriggerHandler.java -text svneol=native#text/plain
|
|
||||||
src/forge/Trigger_AttackerBlocked.java -text svneol=native#text/plain
|
|
||||||
src/forge/Trigger_AttackerUnblocked.java -text svneol=native#text/plain
|
|
||||||
src/forge/Trigger_Attacks.java -text svneol=native#text/plain
|
|
||||||
src/forge/Trigger_Blocks.java -text svneol=native#text/plain
|
|
||||||
src/forge/Trigger_ChangesZone.java -text svneol=native#text/plain
|
|
||||||
src/forge/Trigger_CounterAdded.java -text svneol=native#text/plain
|
|
||||||
src/forge/Trigger_Cycled.java -text svneol=native#text/plain
|
|
||||||
src/forge/Trigger_DamageDone.java -text svneol=native#text/plain
|
|
||||||
src/forge/Trigger_Discarded.java -text svneol=native#text/plain
|
|
||||||
src/forge/Trigger_Drawn.java -text svneol=native#text/plain
|
|
||||||
src/forge/Trigger_LandPlayed.java -text svneol=native#text/plain
|
|
||||||
src/forge/Trigger_LifeGained.java -text svneol=native#text/plain
|
|
||||||
src/forge/Trigger_LifeLost.java -text svneol=native#text/plain
|
|
||||||
src/forge/Trigger_Phase.java -text svneol=native#text/plain
|
|
||||||
src/forge/Trigger_Sacrificed.java -text svneol=native#text/plain
|
|
||||||
src/forge/Trigger_Shuffled.java -text svneol=native#text/plain
|
|
||||||
src/forge/Trigger_SpellAbilityCast.java -text svneol=native#text/plain
|
|
||||||
src/forge/Trigger_Taps.java -text svneol=native#text/plain
|
|
||||||
src/forge/Trigger_TurnFaceUp.java -text svneol=native#text/plain
|
|
||||||
src/forge/Trigger_Unequip.java -text svneol=native#text/plain
|
|
||||||
src/forge/Trigger_Untaps.java -text svneol=native#text/plain
|
|
||||||
src/forge/UndoCommand.java svneol=native#text/plain
|
src/forge/UndoCommand.java svneol=native#text/plain
|
||||||
src/forge/Wait.java svneol=native#text/plain
|
src/forge/Wait.java svneol=native#text/plain
|
||||||
src/forge/WinLose.java svneol=native#text/plain
|
src/forge/WinLose.java svneol=native#text/plain
|
||||||
src/forge/ZCTrigger.java svneol=native#text/plain
|
src/forge/ZCTrigger.java svneol=native#text/plain
|
||||||
|
src/forge/card/abilityFactory/AbilityFactory.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/abilityFactory/AbilityFactory_AlterLife.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/abilityFactory/AbilityFactory_Animate.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/abilityFactory/AbilityFactory_Bounce.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/abilityFactory/AbilityFactory_ChangeZone.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/abilityFactory/AbilityFactory_Clash.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/abilityFactory/AbilityFactory_Combat.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/abilityFactory/AbilityFactory_CounterMagic.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/abilityFactory/AbilityFactory_Counters.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/abilityFactory/AbilityFactory_DealDamage.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/abilityFactory/AbilityFactory_Destroy.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/abilityFactory/AbilityFactory_Fetch.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/abilityFactory/AbilityFactory_GainControl.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/abilityFactory/AbilityFactory_Mana.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/abilityFactory/AbilityFactory_PermanentState.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/abilityFactory/AbilityFactory_Pump.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/abilityFactory/AbilityFactory_Regenerate.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/abilityFactory/AbilityFactory_Sacrifice.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/abilityFactory/AbilityFactory_Token.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/abilityFactory/AbilityFactory_Turns.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/abilityFactory/AbilityFactory_ZoneAffecting.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/cardFactory/CardFactory.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/cardFactory/CardFactoryUtil.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/cardFactory/CardFactory_Auras.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/cardFactory/CardFactory_Creatures.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/cardFactory/CardFactory_Equipment.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/cardFactory/CardFactory_Instants.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/cardFactory/CardFactory_Lands.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/cardFactory/CardFactory_Planeswalkers.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/cardFactory/CardFactory_Sorceries.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/mana/Mana.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/mana/ManaCost.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/mana/ManaPool.java svneol=native#text/plain
|
||||||
|
src/forge/card/mana/Mana_Part.java svneol=native#text/plain
|
||||||
|
src/forge/card/mana/Mana_PartColor.java svneol=native#text/plain
|
||||||
|
src/forge/card/mana/Mana_PartColorless.java svneol=native#text/plain
|
||||||
|
src/forge/card/mana/Mana_PartSnow.java svneol=native#text/plain
|
||||||
|
src/forge/card/mana/Mana_PartSplit.java svneol=native#text/plain
|
||||||
|
src/forge/card/mana/Mana_PartTest.java svneol=native#text/plain
|
||||||
|
src/forge/card/spellability/Ability.java svneol=native#text/plain
|
||||||
|
src/forge/card/spellability/Ability_Activated.java svneol=native#text/plain
|
||||||
|
src/forge/card/spellability/Ability_Mana.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/spellability/Ability_Static.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/spellability/Ability_Sub.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/spellability/Ability_Triggered.java svneol=native#text/plain
|
||||||
|
src/forge/card/spellability/Cost.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/spellability/Cost_Payment.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/spellability/Spell.java svneol=native#text/plain
|
||||||
|
src/forge/card/spellability/SpellAbility.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/spellability/SpellAbilityList.java svneol=native#text/plain
|
||||||
|
src/forge/card/spellability/SpellAbilityUtil.java svneol=native#text/plain
|
||||||
|
src/forge/card/spellability/SpellAbility_Requirements.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/spellability/SpellAbility_Restriction.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/spellability/Spell_Evoke.java svneol=native#text/plain
|
||||||
|
src/forge/card/spellability/Spell_Permanent.java svneol=native#text/plain
|
||||||
|
src/forge/card/spellability/Target.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/spellability/Target_Selection.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/trigger/Trigger.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/trigger/TriggerHandler.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/trigger/Trigger_AttackerBlocked.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/trigger/Trigger_AttackerUnblocked.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/trigger/Trigger_Attacks.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/trigger/Trigger_Blocks.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/trigger/Trigger_ChangesZone.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/trigger/Trigger_CounterAdded.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/trigger/Trigger_Cycled.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/trigger/Trigger_DamageDone.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/trigger/Trigger_Discarded.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/trigger/Trigger_Drawn.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/trigger/Trigger_LandPlayed.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/trigger/Trigger_LifeGained.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/trigger/Trigger_LifeLost.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/trigger/Trigger_Phase.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/trigger/Trigger_Sacrificed.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/trigger/Trigger_Shuffled.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/trigger/Trigger_SpellAbilityCast.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/trigger/Trigger_Taps.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/trigger/Trigger_TurnFaceUp.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/trigger/Trigger_Unequip.java -text svneol=native#text/plain
|
||||||
|
src/forge/card/trigger/Trigger_Untaps.java -text svneol=native#text/plain
|
||||||
|
src/forge/deck/generate/Generate2ColorDeck.java -text svneol=native#text/plain
|
||||||
|
src/forge/deck/generate/Generate3ColorDeck.java -text svneol=native#text/plain
|
||||||
|
src/forge/deck/generate/GenerateConstructedDeck.java -text svneol=native#text/plain
|
||||||
|
src/forge/deck/generate/GenerateConstructedMultiColorDeck.java -text svneol=native#text/plain
|
||||||
|
src/forge/deck/generate/GenerateDraftDeck.java svneol=native#text/plain
|
||||||
|
src/forge/deck/generate/GenerateSealedDeck.java svneol=native#text/plain
|
||||||
|
src/forge/deck/generate/GenerateThemeDeck.java -text svneol=native#text/plain
|
||||||
src/forge/error/ErrorViewer.java svneol=native#text/plain
|
src/forge/error/ErrorViewer.java svneol=native#text/plain
|
||||||
src/forge/error/ExceptionHandler.java -text svneol=native#text/plain
|
src/forge/error/ExceptionHandler.java -text svneol=native#text/plain
|
||||||
src/forge/gui/ForgeAction.java svneol=native#text/plain
|
src/forge/gui/ForgeAction.java svneol=native#text/plain
|
||||||
@@ -8115,6 +8105,16 @@ src/forge/gui/MultiLineLabelUI.java svneol=native#text/plain
|
|||||||
src/forge/gui/game/CardDetailPanel.java svneol=native#text/plain
|
src/forge/gui/game/CardDetailPanel.java svneol=native#text/plain
|
||||||
src/forge/gui/game/CardPanel.java svneol=native#text/plain
|
src/forge/gui/game/CardPanel.java svneol=native#text/plain
|
||||||
src/forge/gui/game/CardPicturePanel.java svneol=native#text/plain
|
src/forge/gui/game/CardPicturePanel.java svneol=native#text/plain
|
||||||
|
src/forge/gui/input/Input.java svneol=native#text/plain
|
||||||
|
src/forge/gui/input/InputControl.java svneol=native#text/plain
|
||||||
|
src/forge/gui/input/Input_Attack.java svneol=native#text/plain
|
||||||
|
src/forge/gui/input/Input_Block.java svneol=native#text/plain
|
||||||
|
src/forge/gui/input/Input_Cleanup.java svneol=native#text/plain
|
||||||
|
src/forge/gui/input/Input_Mulligan.java svneol=native#text/plain
|
||||||
|
src/forge/gui/input/Input_PassPriority.java -text svneol=native#text/plain
|
||||||
|
src/forge/gui/input/Input_PayManaCost.java svneol=native#text/plain
|
||||||
|
src/forge/gui/input/Input_PayManaCostUtil.java svneol=native#text/plain
|
||||||
|
src/forge/gui/input/Input_PayManaCost_Ability.java svneol=native#text/plain
|
||||||
src/forge/properties/ForgePreferences.java svneol=native#text/plain
|
src/forge/properties/ForgePreferences.java svneol=native#text/plain
|
||||||
src/forge/properties/ForgeProps.java svneol=native#text/plain
|
src/forge/properties/ForgeProps.java svneol=native#text/plain
|
||||||
src/forge/properties/NewConstants.java svneol=native#text/plain
|
src/forge/properties/NewConstants.java svneol=native#text/plain
|
||||||
|
|||||||
@@ -3,6 +3,9 @@ package forge;
|
|||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
import forge.card.cardFactory.CardFactoryUtil;
|
||||||
|
import forge.card.spellability.SpellAbility;
|
||||||
|
|
||||||
|
|
||||||
public class AIPlayer extends Player{
|
public class AIPlayer extends Player{
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
package forge;
|
package forge;
|
||||||
|
|
||||||
|
|
||||||
|
import forge.card.cardFactory.CardFactory;
|
||||||
|
import forge.card.mana.ManaPool;
|
||||||
|
import forge.card.trigger.TriggerHandler;
|
||||||
|
import forge.gui.input.InputControl;
|
||||||
import forge.properties.ForgeProps;
|
import forge.properties.ForgeProps;
|
||||||
import forge.properties.NewConstants;
|
import forge.properties.NewConstants;
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ package forge;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import forge.card.cardFactory.CardFactoryUtil;
|
||||||
import forge.gui.GuiUtils;
|
import forge.gui.GuiUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -12,6 +12,15 @@ import java.util.Map.Entry;
|
|||||||
|
|
||||||
import com.esotericsoftware.minlog.Log;
|
import com.esotericsoftware.minlog.Log;
|
||||||
|
|
||||||
|
import forge.card.cardFactory.CardFactory;
|
||||||
|
import forge.card.cardFactory.CardFactoryUtil;
|
||||||
|
import forge.card.mana.ManaCost;
|
||||||
|
import forge.card.spellability.Ability_Mana;
|
||||||
|
import forge.card.spellability.Ability_Triggered;
|
||||||
|
import forge.card.spellability.SpellAbility;
|
||||||
|
import forge.card.spellability.Spell_Permanent;
|
||||||
|
import forge.card.trigger.Trigger;
|
||||||
|
|
||||||
public class Card extends MyObservable {
|
public class Card extends MyObservable {
|
||||||
private static int nextUniqueNumber;
|
private static int nextUniqueNumber;
|
||||||
private int uniqueNumber = nextUniqueNumber++;
|
private int uniqueNumber = nextUniqueNumber++;
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ import java.util.Collections;
|
|||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
|
import forge.card.cardFactory.CardFactoryUtil;
|
||||||
|
|
||||||
|
|
||||||
public class CardList implements Iterable<Card> {
|
public class CardList implements Iterable<Card> {
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import java.util.Comparator;
|
|||||||
|
|
||||||
import com.esotericsoftware.minlog.Log;
|
import com.esotericsoftware.minlog.Log;
|
||||||
|
|
||||||
|
import forge.card.cardFactory.CardFactoryUtil;
|
||||||
|
|
||||||
public class CardListUtil
|
public class CardListUtil
|
||||||
{
|
{
|
||||||
public static CardList filterToughness(CardList in, int atLeastToughness)
|
public static CardList filterToughness(CardList in, int atLeastToughness)
|
||||||
|
|||||||
@@ -9,6 +9,9 @@ import java.util.Map;
|
|||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import forge.card.mana.ManaCost;
|
||||||
|
import forge.card.spellability.SpellAbility;
|
||||||
|
import forge.card.spellability.SpellAbilityList;
|
||||||
import forge.properties.ForgeProps;
|
import forge.properties.ForgeProps;
|
||||||
import forge.properties.NewConstants;
|
import forge.properties.NewConstants;
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ package forge;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
|
|
||||||
|
import forge.card.mana.ManaCost;
|
||||||
|
|
||||||
public class Card_Color {
|
public class Card_Color {
|
||||||
// takes care of individual card color, for global color change effects use AllZone.GameInfo.getColorChanges()
|
// takes care of individual card color, for global color change effects use AllZone.GameInfo.getColorChanges()
|
||||||
private EnumSet<Color> col;
|
private EnumSet<Color> col;
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ package forge;
|
|||||||
|
|
||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
|
|
||||||
|
import forge.card.mana.ManaCost;
|
||||||
|
|
||||||
public enum Color {
|
public enum Color {
|
||||||
Colorless(0),
|
Colorless(0),
|
||||||
White(1),
|
White(1),
|
||||||
|
|||||||
@@ -9,11 +9,16 @@ import java.util.regex.Pattern;
|
|||||||
|
|
||||||
import com.esotericsoftware.minlog.Log;
|
import com.esotericsoftware.minlog.Log;
|
||||||
|
|
||||||
|
import forge.card.abilityFactory.AbilityFactory;
|
||||||
|
import forge.card.cardFactory.CardFactoryUtil;
|
||||||
|
import forge.card.spellability.Ability;
|
||||||
|
import forge.card.trigger.Trigger;
|
||||||
import forge.gui.GuiUtils;
|
import forge.gui.GuiUtils;
|
||||||
|
import forge.gui.input.Input_PayManaCost_Ability;
|
||||||
|
|
||||||
|
|
||||||
public class CombatUtil {
|
public class CombatUtil {
|
||||||
static boolean Lorthos_Cancelled;
|
private static boolean Lorthos_Cancelled;
|
||||||
|
|
||||||
|
|
||||||
//can the creature block given the combat state?
|
//can the creature block given the combat state?
|
||||||
@@ -1781,7 +1786,7 @@ public class CombatUtil {
|
|||||||
CardList Silence = AllZoneUtil.getPlayerCardsInPlay(c.getController().getOpponent());
|
CardList Silence = AllZoneUtil.getPlayerCardsInPlay(c.getController().getOpponent());
|
||||||
Silence = Silence.getName("Linvala, Keeper of Silence");
|
Silence = Silence.getName("Linvala, Keeper of Silence");
|
||||||
if(Silence.size() == 0) {
|
if(Silence.size() == 0) {
|
||||||
Lorthos_Cancelled = false;
|
setLorthosCancelled(false);
|
||||||
if(c.getController().equals(AllZone.HumanPlayer)) {
|
if(c.getController().equals(AllZone.HumanPlayer)) {
|
||||||
AllZone.InputControl.setInput(new Input_PayManaCost_Ability("Activate " + c.getName() + "'s ability: " + "\r\n",
|
AllZone.InputControl.setInput(new Input_PayManaCost_Ability("Activate " + c.getName() + "'s ability: " + "\r\n",
|
||||||
ability.getManaCost(), paidCommand, unpaidCommand));
|
ability.getManaCost(), paidCommand, unpaidCommand));
|
||||||
@@ -2404,4 +2409,14 @@ public class CombatUtil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void setLorthosCancelled(boolean lorthos_Cancelled) {
|
||||||
|
Lorthos_Cancelled = lorthos_Cancelled;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static boolean isLorthosCancelled() {
|
||||||
|
return Lorthos_Cancelled;
|
||||||
|
}
|
||||||
|
|
||||||
}//Class CombatUtil
|
}//Class CombatUtil
|
||||||
|
|||||||
@@ -5,6 +5,9 @@ import java.util.ArrayList;
|
|||||||
|
|
||||||
import com.esotericsoftware.minlog.Log;
|
import com.esotericsoftware.minlog.Log;
|
||||||
|
|
||||||
|
import forge.card.cardFactory.CardFactoryUtil;
|
||||||
|
import forge.card.spellability.SpellAbility;
|
||||||
|
|
||||||
|
|
||||||
public class ComputerAI_General implements Computer {
|
public class ComputerAI_General implements Computer {
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ package forge;
|
|||||||
|
|
||||||
import com.esotericsoftware.minlog.Log;
|
import com.esotericsoftware.minlog.Log;
|
||||||
|
|
||||||
|
import forge.gui.input.Input;
|
||||||
|
|
||||||
|
|
||||||
public class ComputerAI_Input extends Input {
|
public class ComputerAI_Input extends Input {
|
||||||
private static final long serialVersionUID = -3091338639571662216L;
|
private static final long serialVersionUID = -3091338639571662216L;
|
||||||
|
|||||||
@@ -2,6 +2,9 @@ package forge;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import forge.card.cardFactory.CardFactoryUtil;
|
||||||
|
import forge.card.spellability.SpellAbility;
|
||||||
|
|
||||||
public class ComputerAI_counterSpells2 {
|
public class ComputerAI_counterSpells2 {
|
||||||
|
|
||||||
public static ArrayList<String> KeywordedCounterspells = new ArrayList<String>();
|
public static ArrayList<String> KeywordedCounterspells = new ArrayList<String>();
|
||||||
|
|||||||
@@ -3,6 +3,16 @@ import java.util.ArrayList;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
|
|
||||||
|
import forge.card.abilityFactory.AbilityFactory;
|
||||||
|
import forge.card.cardFactory.CardFactoryUtil;
|
||||||
|
import forge.card.mana.ManaCost;
|
||||||
|
import forge.card.spellability.Ability;
|
||||||
|
import forge.card.spellability.Ability_Mana;
|
||||||
|
import forge.card.spellability.Cost;
|
||||||
|
import forge.card.spellability.Cost_Payment;
|
||||||
|
import forge.card.spellability.SpellAbility;
|
||||||
|
import forge.card.spellability.Target;
|
||||||
|
|
||||||
|
|
||||||
public class ComputerUtil
|
public class ComputerUtil
|
||||||
{
|
{
|
||||||
@@ -30,7 +40,7 @@ public class ComputerUtil
|
|||||||
if(sa.isSpell() && !source.isCopiedSpell())
|
if(sa.isSpell() && !source.isCopiedSpell())
|
||||||
AllZone.GameAction.moveToStack(source);
|
AllZone.GameAction.moveToStack(source);
|
||||||
|
|
||||||
Ability_Cost cost = sa.getPayCosts();
|
Cost cost = sa.getPayCosts();
|
||||||
Target tgt = sa.getTarget();
|
Target tgt = sa.getTarget();
|
||||||
|
|
||||||
if (cost == null){
|
if (cost == null){
|
||||||
@@ -187,12 +197,12 @@ public class ComputerUtil
|
|||||||
ManaCost cost = new ManaCost(mana);
|
ManaCost cost = new ManaCost(mana);
|
||||||
|
|
||||||
// Tack xMana Payments into mana here if X is a set value
|
// Tack xMana Payments into mana here if X is a set value
|
||||||
if (sa.getPayCosts() != null && cost.xcounter > 0){
|
if (sa.getPayCosts() != null && cost.getXcounter() > 0){
|
||||||
String xSvar = card.getSVar("X").equals("Count$xPaid") ? "PayX" : "X";
|
String xSvar = card.getSVar("X").equals("Count$xPaid") ? "PayX" : "X";
|
||||||
// For Count$xPaid set PayX in the AFs then use that here
|
// For Count$xPaid set PayX in the AFs then use that here
|
||||||
// Else calculate it as appropriate.
|
// Else calculate it as appropriate.
|
||||||
if (!card.getSVar(xSvar).equals("")){
|
if (!card.getSVar(xSvar).equals("")){
|
||||||
int manaToAdd = AbilityFactory.calculateAmount(card, xSvar, sa) * cost.xcounter;
|
int manaToAdd = AbilityFactory.calculateAmount(card, xSvar, sa) * cost.getXcounter();
|
||||||
cost.increaseColorlessMana(manaToAdd);
|
cost.increaseColorlessMana(manaToAdd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -272,7 +282,7 @@ public class ComputerUtil
|
|||||||
static public boolean canPayAdditionalCosts(SpellAbility sa)
|
static public boolean canPayAdditionalCosts(SpellAbility sa)
|
||||||
{
|
{
|
||||||
// Add additional cost checks here before attempting to activate abilities
|
// Add additional cost checks here before attempting to activate abilities
|
||||||
Ability_Cost cost = sa.getPayCosts();
|
Cost cost = sa.getPayCosts();
|
||||||
if (cost == null)
|
if (cost == null)
|
||||||
return true;
|
return true;
|
||||||
Card card = sa.getSourceCard();
|
Card card = sa.getSourceCard();
|
||||||
@@ -480,7 +490,7 @@ public class ComputerUtil
|
|||||||
|
|
||||||
Card card = sa.getSourceCard();
|
Card card = sa.getSourceCard();
|
||||||
// Tack xMana Payments into mana here if X is a set value
|
// Tack xMana Payments into mana here if X is a set value
|
||||||
if (sa.getPayCosts() != null && cost.xcounter > 0){
|
if (sa.getPayCosts() != null && cost.getXcounter() > 0){
|
||||||
String xSvar = card.getSVar("X").equals("Count$xPaid") ? "PayX" : "X";
|
String xSvar = card.getSVar("X").equals("Count$xPaid") ? "PayX" : "X";
|
||||||
// For Count$xPaid set PayX in the AFs then use that here
|
// For Count$xPaid set PayX in the AFs then use that here
|
||||||
// Else calculate it as appropriate.
|
// Else calculate it as appropriate.
|
||||||
@@ -489,7 +499,7 @@ public class ComputerUtil
|
|||||||
manaToAdd = Integer.parseInt(card.getSVar(xSvar));
|
manaToAdd = Integer.parseInt(card.getSVar(xSvar));
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
manaToAdd = AbilityFactory.calculateAmount(card, xSvar, sa) * cost.xcounter;
|
manaToAdd = AbilityFactory.calculateAmount(card, xSvar, sa) * cost.getXcounter();
|
||||||
}
|
}
|
||||||
|
|
||||||
cost.increaseColorlessMana(manaToAdd);
|
cost.increaseColorlessMana(manaToAdd);
|
||||||
@@ -833,7 +843,7 @@ public class ComputerUtil
|
|||||||
Arrays.sort(sa, c);
|
Arrays.sort(sa, c);
|
||||||
}//sortSpellAbilityByCost()
|
}//sortSpellAbilityByCost()
|
||||||
|
|
||||||
static void sacrificePermanents(int amount, CardList list) {
|
static public void sacrificePermanents(int amount, CardList list) {
|
||||||
// used in Annihilator and AF_Sacrifice
|
// used in Annihilator and AF_Sacrifice
|
||||||
int max = list.size();
|
int max = list.size();
|
||||||
if (max > amount)
|
if (max > amount)
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ package forge;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
import forge.card.cardFactory.CardFactoryUtil;
|
||||||
|
|
||||||
//doesHumanAttackAndWin() uses the global variable AllZone.ComputerPlayer
|
//doesHumanAttackAndWin() uses the global variable AllZone.ComputerPlayer
|
||||||
public class ComputerUtil_Attack2 {
|
public class ComputerUtil_Attack2 {
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ package forge;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import forge.card.cardFactory.CardFactoryUtil;
|
||||||
|
|
||||||
|
|
||||||
public class ComputerUtil_Block2
|
public class ComputerUtil_Block2
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
package forge;
|
package forge;
|
||||||
|
|
||||||
|
import forge.card.spellability.Ability;
|
||||||
|
import forge.card.spellability.SpellAbility;
|
||||||
|
|
||||||
//handles "until end of turn" and "at end of turn" commands from cards
|
//handles "until end of turn" and "at end of turn" commands from cards
|
||||||
public class EndOfTurn implements java.io.Serializable
|
public class EndOfTurn implements java.io.Serializable
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,24 @@
|
|||||||
package forge;
|
package forge;
|
||||||
|
|
||||||
|
|
||||||
|
import forge.card.cardFactory.CardFactory;
|
||||||
|
import forge.card.cardFactory.CardFactoryUtil;
|
||||||
|
import forge.card.mana.ManaCost;
|
||||||
|
import forge.card.mana.ManaPool;
|
||||||
|
import forge.card.spellability.Ability;
|
||||||
|
import forge.card.spellability.Ability_Static;
|
||||||
|
import forge.card.spellability.Cost;
|
||||||
|
import forge.card.spellability.Cost_Payment;
|
||||||
|
import forge.card.spellability.Spell;
|
||||||
|
import forge.card.spellability.SpellAbility;
|
||||||
|
import forge.card.spellability.SpellAbility_Requirements;
|
||||||
|
import forge.card.spellability.Target_Selection;
|
||||||
|
import forge.card.trigger.Trigger;
|
||||||
|
import forge.deck.generate.GenerateConstructedDeck;
|
||||||
import forge.gui.GuiUtils;
|
import forge.gui.GuiUtils;
|
||||||
|
import forge.gui.input.Input_Mulligan;
|
||||||
|
import forge.gui.input.Input_PayManaCost;
|
||||||
|
import forge.gui.input.Input_PayManaCost_Ability;
|
||||||
import forge.properties.ForgeProps;
|
import forge.properties.ForgeProps;
|
||||||
import forge.properties.NewConstants.LANG.GameAction.GAMEACTION_TEXT;
|
import forge.properties.NewConstants.LANG.GameAction.GAMEACTION_TEXT;
|
||||||
|
|
||||||
@@ -201,7 +218,7 @@ public class GameAction {
|
|||||||
};
|
};
|
||||||
|
|
||||||
String recoverCost = recoverable.getKeyword().get(recoverable.getKeywordPosition("Recover")).split(":")[1];
|
String recoverCost = recoverable.getKeyword().get(recoverable.getKeywordPosition("Recover")).split(":")[1];
|
||||||
Ability_Cost abCost = new Ability_Cost(recoverCost,recoverable.getName(),false);
|
Cost abCost = new Cost(recoverCost,recoverable.getName(),false);
|
||||||
abRecover.setPayCosts(abCost);
|
abRecover.setPayCosts(abCost);
|
||||||
|
|
||||||
StringBuilder question = new StringBuilder("Recover ");
|
StringBuilder question = new StringBuilder("Recover ");
|
||||||
@@ -735,7 +752,7 @@ public class GameAction {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static boolean MultiTarget_Cancelled = false;
|
private static boolean MultiTarget_Cancelled = false;
|
||||||
public void runWheneverKeyword(Card c, String Event, Object[] Custom_Parameters) {
|
public void runWheneverKeyword(Card c, String Event, Object[] Custom_Parameters) {
|
||||||
/**
|
/**
|
||||||
* Custom_Parameters Info:
|
* Custom_Parameters Info:
|
||||||
@@ -1041,7 +1058,7 @@ public class GameAction {
|
|||||||
private static final long serialVersionUID = -83034517601871955L;
|
private static final long serialVersionUID = -83034517601871955L;
|
||||||
|
|
||||||
public void execute() {
|
public void execute() {
|
||||||
MultiTarget_Cancelled = false;
|
setMultiTargetCancelled(false);
|
||||||
for(int i = 0; i < F_Multiple_Targets; i++) {
|
for(int i = 0; i < F_Multiple_Targets; i++) {
|
||||||
AllZone.InputControl.setInput(CardFactoryUtil.input_MultitargetCreatureOrPlayer(F_SpellAbility , i , F_Amount[0]*F_Multiple_Targets,new Command() {
|
AllZone.InputControl.setInput(CardFactoryUtil.input_MultitargetCreatureOrPlayer(F_SpellAbility , i , F_Amount[0]*F_Multiple_Targets,new Command() {
|
||||||
|
|
||||||
@@ -2228,7 +2245,7 @@ public class GameAction {
|
|||||||
Constant.Quest.fantasyQuest[0] = true;
|
Constant.Quest.fantasyQuest[0] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean Start_Cut = false;
|
private boolean Start_Cut = false;
|
||||||
boolean StaticEffectKeywordReset = true;
|
boolean StaticEffectKeywordReset = true;
|
||||||
public void newGame(Deck humanDeck, Deck computerDeck) {
|
public void newGame(Deck humanDeck, Deck computerDeck) {
|
||||||
// AllZone.Computer = new ComputerAI_Input(new ComputerAI_General());
|
// AllZone.Computer = new ComputerAI_Input(new ComputerAI_General());
|
||||||
@@ -2405,7 +2422,7 @@ public class GameAction {
|
|||||||
if (Constant.Runtime.matchState.countWinLose() == 0)
|
if (Constant.Runtime.matchState.countWinLose() == 0)
|
||||||
{
|
{
|
||||||
// New code to determine who goes first. Delete this if it doesn't work properly
|
// New code to determine who goes first. Delete this if it doesn't work properly
|
||||||
if(Start_Cut)
|
if(isStartCut())
|
||||||
seeWhoPlaysFirst();
|
seeWhoPlaysFirst();
|
||||||
else
|
else
|
||||||
seeWhoPlaysFirst_CoinToss();
|
seeWhoPlaysFirst_CoinToss();
|
||||||
@@ -2424,7 +2441,7 @@ public class GameAction {
|
|||||||
AllZone.Human_Battlefield.add(mp);
|
AllZone.Human_Battlefield.add(mp);
|
||||||
|
|
||||||
AllZone.InputControl.setInput(new Input_Mulligan());
|
AllZone.InputControl.setInput(new Input_Mulligan());
|
||||||
Phase.GameBegins = 1;
|
Phase.setGameBegins(1);
|
||||||
}//newGame()
|
}//newGame()
|
||||||
|
|
||||||
//this is where the computer cheats
|
//this is where the computer cheats
|
||||||
@@ -2586,8 +2603,8 @@ public class GameAction {
|
|||||||
}
|
}
|
||||||
}//seeWhoPlaysFirst_CoinToss()
|
}//seeWhoPlaysFirst_CoinToss()
|
||||||
|
|
||||||
Card HumanCut = null;
|
private Card HumanCut = null;
|
||||||
Card ComputerCut = null;
|
private Card ComputerCut = null;
|
||||||
|
|
||||||
public void seeWhoPlaysFirst() {
|
public void seeWhoPlaysFirst() {
|
||||||
|
|
||||||
@@ -2611,7 +2628,7 @@ public class GameAction {
|
|||||||
if(Starter_Determined == true) break;
|
if(Starter_Determined == true) break;
|
||||||
|
|
||||||
if(HLibrary.size() > 0)
|
if(HLibrary.size() > 0)
|
||||||
HumanCut = HLibrary.get(MyRandom.random.nextInt(HLibrary.size()));
|
setHumanCut(HLibrary.get(MyRandom.random.nextInt(HLibrary.size())));
|
||||||
else {
|
else {
|
||||||
computerStartsGame();
|
computerStartsGame();
|
||||||
JOptionPane.showMessageDialog(null, ForgeProps.getLocalized(GAMEACTION_TEXT.HUMAN_MANA_COST) + "\r\n" + ForgeProps.getLocalized(GAMEACTION_TEXT.COMPUTER_STARTS), "", JOptionPane.INFORMATION_MESSAGE);
|
JOptionPane.showMessageDialog(null, ForgeProps.getLocalized(GAMEACTION_TEXT.HUMAN_MANA_COST) + "\r\n" + ForgeProps.getLocalized(GAMEACTION_TEXT.COMPUTER_STARTS), "", JOptionPane.INFORMATION_MESSAGE);
|
||||||
@@ -2619,26 +2636,26 @@ public class GameAction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(CLibrary.size() > 0)
|
if(CLibrary.size() > 0)
|
||||||
ComputerCut = CLibrary.get(MyRandom.random.nextInt(CLibrary.size()));
|
setComputerCut(CLibrary.get(MyRandom.random.nextInt(CLibrary.size())));
|
||||||
else {
|
else {
|
||||||
JOptionPane.showMessageDialog(null, ForgeProps.getLocalized(GAMEACTION_TEXT.COMPUTER_MANA_COST) + "\r\n" + ForgeProps.getLocalized(GAMEACTION_TEXT.HUMAN_STARTS), "", JOptionPane.INFORMATION_MESSAGE);
|
JOptionPane.showMessageDialog(null, ForgeProps.getLocalized(GAMEACTION_TEXT.COMPUTER_MANA_COST) + "\r\n" + ForgeProps.getLocalized(GAMEACTION_TEXT.HUMAN_STARTS), "", JOptionPane.INFORMATION_MESSAGE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Cut_Count = Cut_Count + 1;
|
Cut_Count = Cut_Count + 1;
|
||||||
AllZone.GameAction.moveTo(AllZone.getZone(Constant.Zone.Library, AllZone.HumanPlayer),AllZone.GameAction.HumanCut);
|
AllZone.GameAction.moveTo(AllZone.getZone(Constant.Zone.Library, AllZone.HumanPlayer),AllZone.GameAction.getHumanCut());
|
||||||
AllZone.GameAction.moveTo(AllZone.getZone(Constant.Zone.Library, AllZone.ComputerPlayer),AllZone.GameAction.ComputerCut);
|
AllZone.GameAction.moveTo(AllZone.getZone(Constant.Zone.Library, AllZone.ComputerPlayer),AllZone.GameAction.getComputerCut());
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append(ForgeProps.getLocalized(GAMEACTION_TEXT.HUMAN_CUT) + HumanCut.getName() + " (" + HumanCut.getManaCost() + ")" + "\r\n");
|
sb.append(ForgeProps.getLocalized(GAMEACTION_TEXT.HUMAN_CUT) + getHumanCut().getName() + " (" + getHumanCut().getManaCost() + ")" + "\r\n");
|
||||||
sb.append(ForgeProps.getLocalized(GAMEACTION_TEXT.COMPUTER_CUT) + ComputerCut.getName() + " (" + ComputerCut.getManaCost() + ")" + "\r\n");
|
sb.append(ForgeProps.getLocalized(GAMEACTION_TEXT.COMPUTER_CUT) + getComputerCut().getName() + " (" + getComputerCut().getManaCost() + ")" + "\r\n");
|
||||||
sb.append("\r\n" + "Number of times the deck has been cut: " + Cut_Count + "\r\n");
|
sb.append("\r\n" + "Number of times the deck has been cut: " + Cut_Count + "\r\n");
|
||||||
if(CardUtil.getConvertedManaCost(ComputerCut.getManaCost()) > CardUtil.getConvertedManaCost(HumanCut.getManaCost())){
|
if(CardUtil.getConvertedManaCost(getComputerCut().getManaCost()) > CardUtil.getConvertedManaCost(getHumanCut().getManaCost())){
|
||||||
computerStartsGame();
|
computerStartsGame();
|
||||||
JOptionPane.showMessageDialog(null, sb + ForgeProps.getLocalized(GAMEACTION_TEXT.COMPUTER_STARTS), "", JOptionPane.INFORMATION_MESSAGE);
|
JOptionPane.showMessageDialog(null, sb + ForgeProps.getLocalized(GAMEACTION_TEXT.COMPUTER_STARTS), "", JOptionPane.INFORMATION_MESSAGE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if(CardUtil.getConvertedManaCost(ComputerCut.getManaCost()) < CardUtil.getConvertedManaCost(HumanCut.getManaCost())) {
|
else if(CardUtil.getConvertedManaCost(getComputerCut().getManaCost()) < CardUtil.getConvertedManaCost(getHumanCut().getManaCost())) {
|
||||||
JOptionPane.showMessageDialog(null, sb + ForgeProps.getLocalized(GAMEACTION_TEXT.HUMAN_STARTS), "", JOptionPane.INFORMATION_MESSAGE);
|
JOptionPane.showMessageDialog(null, sb + ForgeProps.getLocalized(GAMEACTION_TEXT.HUMAN_STARTS), "", JOptionPane.INFORMATION_MESSAGE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -2856,7 +2873,7 @@ public class GameAction {
|
|||||||
} // isSpell
|
} // isSpell
|
||||||
|
|
||||||
// Get Cost Reduction
|
// Get Cost Reduction
|
||||||
if(Phase.GameBegins == 1) { // Remove GameBegins from Phase and into The starting game code
|
if(Phase.getGameBegins() == 1) { // Remove GameBegins from Phase and into The starting game code
|
||||||
CardList Cards_In_Play = new CardList();
|
CardList Cards_In_Play = new CardList();
|
||||||
Cards_In_Play.addAll(AllZone.getZone(Constant.Zone.Battlefield, AllZone.HumanPlayer).getCards());
|
Cards_In_Play.addAll(AllZone.getZone(Constant.Zone.Battlefield, AllZone.HumanPlayer).getCards());
|
||||||
Cards_In_Play.addAll(AllZone.getZone(Constant.Zone.Battlefield, AllZone.ComputerPlayer).getCards());
|
Cards_In_Play.addAll(AllZone.getZone(Constant.Zone.Battlefield, AllZone.ComputerPlayer).getCards());
|
||||||
@@ -3218,7 +3235,7 @@ public class GameAction {
|
|||||||
Cost_Payment payment = null;
|
Cost_Payment payment = null;
|
||||||
if(sa.getPayCosts() == null)
|
if(sa.getPayCosts() == null)
|
||||||
{
|
{
|
||||||
payment = new Cost_Payment(new Ability_Cost("0",sa.getSourceCard().getName(),sa.isAbility()), sa);
|
payment = new Cost_Payment(new Cost("0",sa.getSourceCard().getName(),sa.isAbility()), sa);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -3480,4 +3497,36 @@ public class GameAction {
|
|||||||
}
|
}
|
||||||
}//for
|
}//for
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void setMultiTargetCancelled(boolean multiTarget_Cancelled) {
|
||||||
|
MultiTarget_Cancelled = multiTarget_Cancelled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isMultiTargetCancelled() {
|
||||||
|
return MultiTarget_Cancelled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setComputerCut(Card computerCut) {
|
||||||
|
ComputerCut = computerCut;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Card getComputerCut() {
|
||||||
|
return ComputerCut;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStartCut(boolean start_Cut) {
|
||||||
|
Start_Cut = start_Cut;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isStartCut() {
|
||||||
|
return Start_Cut;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHumanCut(Card humanCut) {
|
||||||
|
HumanCut = humanCut;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Card getHumanCut() {
|
||||||
|
return HumanCut;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,21 @@ import java.util.HashMap;
|
|||||||
|
|
||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
|
|
||||||
|
import forge.card.abilityFactory.AbilityFactory;
|
||||||
|
import forge.card.cardFactory.CardFactory;
|
||||||
|
import forge.card.cardFactory.CardFactoryUtil;
|
||||||
|
import forge.card.spellability.Ability;
|
||||||
|
import forge.card.spellability.Ability_Activated;
|
||||||
|
import forge.card.spellability.Ability_Mana;
|
||||||
|
import forge.card.spellability.Ability_Static;
|
||||||
|
import forge.card.spellability.Cost;
|
||||||
|
import forge.card.spellability.Spell;
|
||||||
|
import forge.card.spellability.SpellAbility;
|
||||||
|
import forge.card.spellability.Target;
|
||||||
import forge.gui.GuiUtils;
|
import forge.gui.GuiUtils;
|
||||||
|
import forge.gui.input.Input;
|
||||||
|
import forge.gui.input.Input_PayManaCostUtil;
|
||||||
|
import forge.gui.input.Input_PayManaCost_Ability;
|
||||||
|
|
||||||
|
|
||||||
public class GameActionUtil {
|
public class GameActionUtil {
|
||||||
@@ -390,7 +404,7 @@ public class GameActionUtil {
|
|||||||
Card source = sa.getSourceCard();
|
Card source = sa.getSourceCard();
|
||||||
if(!source.isCopiedSpell() && source.getKeyword().contains("Storm"))
|
if(!source.isCopiedSpell() && source.getKeyword().contains("Storm"))
|
||||||
{
|
{
|
||||||
int StormNumber = Phase.StormCount - 1;
|
int StormNumber = Phase.getStormCount() - 1;
|
||||||
for(int i = 0; i < StormNumber; i++)
|
for(int i = 0; i < StormNumber; i++)
|
||||||
AllZone.CardFactory.copySpellontoStack(source, source, sa, true);
|
AllZone.CardFactory.copySpellontoStack(source, source, sa, true);
|
||||||
}
|
}
|
||||||
@@ -5962,7 +5976,7 @@ public class GameActionUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!hasAbility) {
|
if(!hasAbility) {
|
||||||
Ability_Cost abCost = new Ability_Cost("T", c.getName(), true);
|
Cost abCost = new Cost("T", c.getName(), true);
|
||||||
Target target = new Target(c,"TgtCP");
|
Target target = new Target(c,"TgtCP");
|
||||||
final Ability_Activated ability = new Ability_Activated(c, abCost, target)
|
final Ability_Activated ability = new Ability_Activated(c, abCost, target)
|
||||||
{
|
{
|
||||||
@@ -6705,7 +6719,7 @@ public class GameActionUtil {
|
|||||||
PlayerZone opponentPlayZone = AllZone.getZone(Constant.Zone.Battlefield,AllZone.ComputerPlayer);
|
PlayerZone opponentPlayZone = AllZone.getZone(Constant.Zone.Battlefield,AllZone.ComputerPlayer);
|
||||||
CardList opponentCreatureList = new CardList(opponentPlayZone.getCards());
|
CardList opponentCreatureList = new CardList(opponentPlayZone.getCards());
|
||||||
opponentCreatureList = opponentCreatureList.getType("Creature");
|
opponentCreatureList = opponentCreatureList.getType("Creature");
|
||||||
if(Phase.Sac_Dauntless_Escort == true) {
|
if(Phase.isSacDauntlessEscort() == true) {
|
||||||
if(PlayerCreatureList.size() != 0) {
|
if(PlayerCreatureList.size() != 0) {
|
||||||
for(int i = 0; i < PlayerCreatureList.size(); i++) {
|
for(int i = 0; i < PlayerCreatureList.size(); i++) {
|
||||||
Card c = PlayerCreatureList.get(i);
|
Card c = PlayerCreatureList.get(i);
|
||||||
@@ -6738,7 +6752,7 @@ public class GameActionUtil {
|
|||||||
opponentPlayZone = AllZone.getZone(Constant.Zone.Battlefield,AllZone.HumanPlayer);
|
opponentPlayZone = AllZone.getZone(Constant.Zone.Battlefield,AllZone.HumanPlayer);
|
||||||
opponentCreatureList = new CardList(opponentPlayZone.getCards());
|
opponentCreatureList = new CardList(opponentPlayZone.getCards());
|
||||||
opponentCreatureList = opponentCreatureList.getType("Creature");
|
opponentCreatureList = opponentCreatureList.getType("Creature");
|
||||||
if(Phase.Sac_Dauntless_Escort_Comp == true) {
|
if(Phase.isSacDauntlessEscortAI() == true) {
|
||||||
if(PlayerCreatureList.size() != 0) {
|
if(PlayerCreatureList.size() != 0) {
|
||||||
for(int i = 0; i < PlayerCreatureList.size(); i++) {
|
for(int i = 0; i < PlayerCreatureList.size(); i++) {
|
||||||
Card c = PlayerCreatureList.get(i);
|
Card c = PlayerCreatureList.get(i);
|
||||||
@@ -7180,7 +7194,7 @@ public class GameActionUtil {
|
|||||||
CardList next = new CardList();
|
CardList next = new CardList();
|
||||||
|
|
||||||
public void execute() {
|
public void execute() {
|
||||||
if(Phase.GameBegins == 1) {
|
if(Phase.getGameBegins() == 1) {
|
||||||
// reset creatures
|
// reset creatures
|
||||||
removeSwampwalk(old);
|
removeSwampwalk(old);
|
||||||
|
|
||||||
@@ -7247,7 +7261,7 @@ public class GameActionUtil {
|
|||||||
CardList next = new CardList();
|
CardList next = new CardList();
|
||||||
|
|
||||||
public void execute() {
|
public void execute() {
|
||||||
if(Phase.GameBegins == 1) {
|
if(Phase.getGameBegins() == 1) {
|
||||||
// reset creatures
|
// reset creatures
|
||||||
removeFirstStrike(old);
|
removeFirstStrike(old);
|
||||||
|
|
||||||
@@ -7314,7 +7328,7 @@ public class GameActionUtil {
|
|||||||
CardList next = new CardList();
|
CardList next = new CardList();
|
||||||
|
|
||||||
public void execute() {
|
public void execute() {
|
||||||
if(Phase.GameBegins == 1) {
|
if(Phase.getGameBegins() == 1) {
|
||||||
// reset creatures
|
// reset creatures
|
||||||
removeHaste(old);
|
removeHaste(old);
|
||||||
|
|
||||||
@@ -7381,7 +7395,7 @@ public class GameActionUtil {
|
|||||||
CardList next = new CardList();
|
CardList next = new CardList();
|
||||||
|
|
||||||
public void execute() {
|
public void execute() {
|
||||||
if(Phase.GameBegins == 1) {
|
if(Phase.getGameBegins() == 1) {
|
||||||
// reset creatures
|
// reset creatures
|
||||||
removeFlying(old);
|
removeFlying(old);
|
||||||
|
|
||||||
@@ -7448,7 +7462,7 @@ public class GameActionUtil {
|
|||||||
CardList next = new CardList();
|
CardList next = new CardList();
|
||||||
|
|
||||||
public void execute() {
|
public void execute() {
|
||||||
if(Phase.GameBegins == 1) {
|
if(Phase.getGameBegins() == 1) {
|
||||||
// reset creatures
|
// reset creatures
|
||||||
removeTrample(old);
|
removeTrample(old);
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ package forge;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import forge.card.mana.ManaCost;
|
||||||
|
|
||||||
public class GameInfo {
|
public class GameInfo {
|
||||||
private boolean computerStartedThisGame = false;
|
private boolean computerStartedThisGame = false;
|
||||||
|
|
||||||
|
|||||||
@@ -2,12 +2,18 @@
|
|||||||
package forge;
|
package forge;
|
||||||
|
|
||||||
|
|
||||||
|
import forge.card.cardFactory.CardFactoryUtil;
|
||||||
|
import forge.card.spellability.SpellAbility;
|
||||||
import forge.error.ErrorViewer;
|
import forge.error.ErrorViewer;
|
||||||
import forge.gui.ForgeAction;
|
import forge.gui.ForgeAction;
|
||||||
import forge.gui.GuiUtils;
|
import forge.gui.GuiUtils;
|
||||||
import forge.gui.game.CardDetailPanel;
|
import forge.gui.game.CardDetailPanel;
|
||||||
import forge.gui.game.CardPanel;
|
import forge.gui.game.CardPanel;
|
||||||
import forge.gui.game.CardPicturePanel;
|
import forge.gui.game.CardPicturePanel;
|
||||||
|
import forge.gui.input.Input_Attack;
|
||||||
|
import forge.gui.input.Input_Block;
|
||||||
|
import forge.gui.input.Input_PayManaCost;
|
||||||
|
import forge.gui.input.Input_PayManaCost_Ability;
|
||||||
import forge.properties.ForgePreferences;
|
import forge.properties.ForgePreferences;
|
||||||
import forge.properties.ForgeProps;
|
import forge.properties.ForgeProps;
|
||||||
import forge.properties.NewConstants;
|
import forge.properties.NewConstants;
|
||||||
|
|||||||
@@ -5,11 +5,17 @@ import arcane.ui.HandArea;
|
|||||||
import arcane.ui.PlayArea;
|
import arcane.ui.PlayArea;
|
||||||
import arcane.ui.ViewPanel;
|
import arcane.ui.ViewPanel;
|
||||||
import arcane.ui.util.Animation;
|
import arcane.ui.util.Animation;
|
||||||
|
import forge.card.cardFactory.CardFactoryUtil;
|
||||||
|
import forge.card.spellability.SpellAbility;
|
||||||
import forge.error.ErrorViewer;
|
import forge.error.ErrorViewer;
|
||||||
import forge.gui.ForgeAction;
|
import forge.gui.ForgeAction;
|
||||||
import forge.gui.GuiUtils;
|
import forge.gui.GuiUtils;
|
||||||
import forge.gui.game.CardDetailPanel;
|
import forge.gui.game.CardDetailPanel;
|
||||||
import forge.gui.game.CardPanel;
|
import forge.gui.game.CardPanel;
|
||||||
|
import forge.gui.input.Input_Attack;
|
||||||
|
import forge.gui.input.Input_Block;
|
||||||
|
import forge.gui.input.Input_PayManaCost;
|
||||||
|
import forge.gui.input.Input_PayManaCost_Ability;
|
||||||
import forge.properties.ForgePreferences;
|
import forge.properties.ForgePreferences;
|
||||||
import forge.properties.ForgeProps;
|
import forge.properties.ForgeProps;
|
||||||
import forge.properties.NewConstants;
|
import forge.properties.NewConstants;
|
||||||
|
|||||||
@@ -21,6 +21,9 @@ import javax.swing.event.MouseInputAdapter;
|
|||||||
|
|
||||||
import arcane.ui.PlayArea;
|
import arcane.ui.PlayArea;
|
||||||
import arcane.ui.util.Animation;
|
import arcane.ui.util.Animation;
|
||||||
|
import forge.card.cardFactory.CardFactoryUtil;
|
||||||
|
import forge.card.mana.ManaPool;
|
||||||
|
import forge.card.spellability.Ability_Mana;
|
||||||
import forge.gui.game.CardPanel;
|
import forge.gui.game.CardPanel;
|
||||||
import forge.properties.NewConstants;
|
import forge.properties.NewConstants;
|
||||||
|
|
||||||
@@ -913,7 +916,7 @@ public class GuiDisplayUtil implements NewConstants {
|
|||||||
p.repaint();
|
p.repaint();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void updateGUI() {
|
public static void updateGUI() {
|
||||||
AllZone.Computer_Battlefield.updateObservers();
|
AllZone.Computer_Battlefield.updateObservers();
|
||||||
AllZone.Human_Battlefield.updateObservers();
|
AllZone.Human_Battlefield.updateObservers();
|
||||||
AllZone.Human_Hand.updateObservers();
|
AllZone.Human_Hand.updateObservers();
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ package forge;
|
|||||||
import java.util.Observable;
|
import java.util.Observable;
|
||||||
import java.util.Observer;
|
import java.util.Observer;
|
||||||
|
|
||||||
|
import forge.gui.input.Input;
|
||||||
|
|
||||||
|
|
||||||
public class GuiInput extends MyObservable implements Observer {
|
public class GuiInput extends MyObservable implements Observer {
|
||||||
Input input;
|
Input input;
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import javax.swing.JOptionPane;
|
|||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
import javax.swing.filechooser.FileFilter;
|
import javax.swing.filechooser.FileFilter;
|
||||||
|
|
||||||
|
import forge.deck.generate.GenerateConstructedDeck;
|
||||||
import forge.error.ErrorViewer;
|
import forge.error.ErrorViewer;
|
||||||
import forge.gui.GuiUtils;
|
import forge.gui.GuiUtils;
|
||||||
import forge.properties.ForgeProps;
|
import forge.properties.ForgeProps;
|
||||||
|
|||||||
@@ -266,7 +266,7 @@ public class Gui_DownloadSetPictures_LQ extends DefaultBoundedRangeModel impleme
|
|||||||
// pause
|
// pause
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Thread.sleep(2442);
|
Thread.sleep(150);
|
||||||
}
|
}
|
||||||
catch (InterruptedException e)
|
catch (InterruptedException e)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,6 +3,13 @@ package forge;
|
|||||||
import arcane.ui.util.ManaSymbols;
|
import arcane.ui.util.ManaSymbols;
|
||||||
import arcane.util.MultiplexOutputStream;
|
import arcane.util.MultiplexOutputStream;
|
||||||
import com.esotericsoftware.minlog.Log;
|
import com.esotericsoftware.minlog.Log;
|
||||||
|
|
||||||
|
import forge.deck.generate.Generate2ColorDeck;
|
||||||
|
import forge.deck.generate.Generate3ColorDeck;
|
||||||
|
import forge.deck.generate.GenerateConstructedDeck;
|
||||||
|
import forge.deck.generate.GenerateConstructedMultiColorDeck;
|
||||||
|
import forge.deck.generate.GenerateSealedDeck;
|
||||||
|
import forge.deck.generate.GenerateThemeDeck;
|
||||||
import forge.error.ErrorViewer;
|
import forge.error.ErrorViewer;
|
||||||
import forge.error.ExceptionHandler;
|
import forge.error.ExceptionHandler;
|
||||||
import forge.gui.GuiUtils;
|
import forge.gui.GuiUtils;
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ public class Gui_WinLose extends JFrame implements NewConstants {
|
|||||||
private void setup() {
|
private void setup() {
|
||||||
AllZone.GameInfo.clearColorChanges();
|
AllZone.GameInfo.clearColorChanges();
|
||||||
QuestMatchState winLose = Constant.Runtime.matchState;
|
QuestMatchState winLose = Constant.Runtime.matchState;
|
||||||
Phase.GameBegins = 0;
|
Phase.setGameBegins(0);
|
||||||
//3 is the match length, 3 is the number of games
|
//3 is the match length, 3 is the number of games
|
||||||
//disable buttons if match is up, or human player won 2 or lost 2 games already
|
//disable buttons if match is up, or human player won 2 or lost 2 games already
|
||||||
if((winLose.countWinLose() == 3) || (winLose.getWin() == 2) || (winLose.getLose() == 2)) {
|
if((winLose.countWinLose() == 3) || (winLose.getWin() == 2) || (winLose.getLose() == 2)) {
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
|
|
||||||
package forge;
|
package forge;
|
||||||
|
|
||||||
|
import forge.card.cardFactory.CardFactoryUtil;
|
||||||
|
import forge.card.spellability.SpellAbility;
|
||||||
import forge.gui.GuiUtils;
|
import forge.gui.GuiUtils;
|
||||||
|
import forge.gui.input.Input;
|
||||||
|
|
||||||
|
|
||||||
public class HumanPlayer extends Player{
|
public class HumanPlayer extends Player{
|
||||||
|
|||||||
@@ -6,6 +6,19 @@ import java.util.Iterator;
|
|||||||
|
|
||||||
import com.esotericsoftware.minlog.Log;
|
import com.esotericsoftware.minlog.Log;
|
||||||
|
|
||||||
|
import forge.card.abilityFactory.AbilityFactory;
|
||||||
|
import forge.card.cardFactory.CardFactoryUtil;
|
||||||
|
import forge.card.mana.ManaCost;
|
||||||
|
import forge.card.spellability.Ability;
|
||||||
|
import forge.card.spellability.Ability_Mana;
|
||||||
|
import forge.card.spellability.Ability_Static;
|
||||||
|
import forge.card.spellability.Ability_Triggered;
|
||||||
|
import forge.card.spellability.SpellAbility;
|
||||||
|
import forge.card.spellability.Spell_Permanent;
|
||||||
|
import forge.card.spellability.Target;
|
||||||
|
import forge.gui.input.Input;
|
||||||
|
import forge.gui.input.Input_PayManaCost_Ability;
|
||||||
|
|
||||||
public class MagicStack extends MyObservable {
|
public class MagicStack extends MyObservable {
|
||||||
private ArrayList<SpellAbility> stack = new ArrayList<SpellAbility>();
|
private ArrayList<SpellAbility> stack = new ArrayList<SpellAbility>();
|
||||||
private ArrayList<SpellAbility> frozenStack = new ArrayList<SpellAbility>();
|
private ArrayList<SpellAbility> frozenStack = new ArrayList<SpellAbility>();
|
||||||
@@ -253,7 +266,7 @@ public class MagicStack extends MyObservable {
|
|||||||
push(sp);
|
push(sp);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (sp.payCosts != null){
|
else if (sp.getPayCosts() != null){
|
||||||
push(sp);
|
push(sp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -602,7 +615,7 @@ public class MagicStack extends MyObservable {
|
|||||||
this.updateObservers();
|
this.updateObservers();
|
||||||
|
|
||||||
if (sp.isSpell() && !sp.getSourceCard().isCopiedSpell()) {
|
if (sp.isSpell() && !sp.getSourceCard().isCopiedSpell()) {
|
||||||
Phase.StormCount = Phase.StormCount + 1;
|
Phase.setStormCount(Phase.getStormCount() + 1);
|
||||||
if (sp.getSourceCard().getController() == AllZone.HumanPlayer) {
|
if (sp.getSourceCard().getController() == AllZone.HumanPlayer) {
|
||||||
Phase.PlayerSpellCount = Phase.PlayerSpellCount + 1;
|
Phase.PlayerSpellCount = Phase.PlayerSpellCount + 1;
|
||||||
if (sp.getSourceCard().isCreature()) {
|
if (sp.getSourceCard().isCreature()) {
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import java.util.Map;
|
|||||||
import java.util.StringTokenizer;
|
import java.util.StringTokenizer;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
|
import forge.card.spellability.SpellAbility;
|
||||||
import forge.error.ErrorViewer;
|
import forge.error.ErrorViewer;
|
||||||
import forge.properties.ForgeProps;
|
import forge.properties.ForgeProps;
|
||||||
import forge.properties.NewConstants;
|
import forge.properties.NewConstants;
|
||||||
|
|||||||
@@ -12,21 +12,21 @@ public class Phase extends MyObservable
|
|||||||
private int phaseIndex;
|
private int phaseIndex;
|
||||||
private int turn;
|
private int turn;
|
||||||
|
|
||||||
static int GameBegins = 0;
|
private static int GameBegins = 0;
|
||||||
static int StormCount;
|
private static int StormCount;
|
||||||
static CardList HighTides = new CardList();
|
private static CardList HighTides = new CardList();
|
||||||
static int PlayerSpellCount;
|
static int PlayerSpellCount;
|
||||||
static int PlayerCreatureSpellCount;
|
static int PlayerCreatureSpellCount;
|
||||||
static int ComputerSpellCount;
|
static int ComputerSpellCount;
|
||||||
static int ComputerCreatureSpellCount;
|
static int ComputerCreatureSpellCount;
|
||||||
static boolean Sac_Dauntless_Escort;
|
private static boolean Sac_Dauntless_Escort;
|
||||||
static boolean Sac_Dauntless_Escort_Comp;
|
private static boolean Sac_Dauntless_Escort_Comp;
|
||||||
|
|
||||||
//Not sure these should be here but I can't think of a better place
|
//Not sure these should be here but I can't think of a better place
|
||||||
static ArrayList<Integer> ManaDrain_BonusMana_Human = new ArrayList<Integer>();
|
private static ArrayList<Integer> ManaDrain_BonusMana_Human = new ArrayList<Integer>();
|
||||||
static ArrayList<Integer> ManaDrain_BonusMana_AI = new ArrayList<Integer>();
|
private static ArrayList<Integer> ManaDrain_BonusMana_AI = new ArrayList<Integer>();
|
||||||
static CardList ManaDrain_Source_Human = new CardList();
|
private static CardList ManaDrain_Source_Human = new CardList();
|
||||||
static CardList ManaDrain_Source_AI = new CardList();
|
private static CardList ManaDrain_Source_AI = new CardList();
|
||||||
|
|
||||||
private Stack<Player> extraTurns = new Stack<Player>();
|
private Stack<Player> extraTurns = new Stack<Player>();
|
||||||
|
|
||||||
@@ -136,7 +136,7 @@ public class Phase extends MyObservable
|
|||||||
resetPriority();
|
resetPriority();
|
||||||
bPhaseEffects = true;
|
bPhaseEffects = true;
|
||||||
needToNextPhase = false;
|
needToNextPhase = false;
|
||||||
GameBegins = 0;
|
setGameBegins(0);
|
||||||
phaseIndex = 0;
|
phaseIndex = 0;
|
||||||
extraTurns.clear();
|
extraTurns.clear();
|
||||||
nCombatsThisTurn = 0;
|
nCombatsThisTurn = 0;
|
||||||
@@ -147,8 +147,8 @@ public class Phase extends MyObservable
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void turnReset(){
|
public void turnReset(){
|
||||||
StormCount = 0;
|
setStormCount(0);
|
||||||
HighTides.clear();
|
getHighTides().clear();
|
||||||
PlayerSpellCount = 0;
|
PlayerSpellCount = 0;
|
||||||
PlayerCreatureSpellCount = 0;
|
PlayerCreatureSpellCount = 0;
|
||||||
ComputerSpellCount = 0;
|
ComputerSpellCount = 0;
|
||||||
@@ -178,22 +178,22 @@ public class Phase extends MyObservable
|
|||||||
// TODO: Move the function to Player class, and use gainManaDrainMana() instead
|
// TODO: Move the function to Player class, and use gainManaDrainMana() instead
|
||||||
// turn.gainManaDrainMana();
|
// turn.gainManaDrainMana();
|
||||||
|
|
||||||
if (turn.isHuman() && Phase.ManaDrain_BonusMana_Human.size() != 0){
|
if (turn.isHuman() && Phase.getManaDrain_BonusMana_Human().size() != 0){
|
||||||
for(int i=0;i<Phase.ManaDrain_BonusMana_Human.size();i++)
|
for(int i=0;i<Phase.getManaDrain_BonusMana_Human().size();i++)
|
||||||
AllZone.ManaPool.addManaToFloating(Integer.toString(Phase.ManaDrain_BonusMana_Human.get(i)), Phase.ManaDrain_Source_Human.get(i) );
|
AllZone.ManaPool.addManaToFloating(Integer.toString(Phase.getManaDrain_BonusMana_Human().get(i)), Phase.getManaDrain_Source_Human().get(i) );
|
||||||
|
|
||||||
Phase.ManaDrain_BonusMana_Human.clear();
|
Phase.getManaDrain_BonusMana_Human().clear();
|
||||||
Phase.ManaDrain_Source_Human.clear();
|
Phase.getManaDrain_Source_Human().clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(turn.isComputer() && Phase.ManaDrain_BonusMana_AI.size() != 0){
|
if(turn.isComputer() && Phase.getManaDrain_BonusMana_AI().size() != 0){
|
||||||
//for(int i=0;i<Phase.ManaDrain_BonusMana_AI.size();i++)
|
//for(int i=0;i<Phase.ManaDrain_BonusMana_AI.size();i++)
|
||||||
// AllZone.ManaPool.addManaToFloating(Integer.toString(Phase.ManaDrain_BonusMana_AI.get(i)), Phase.ManaDrain_Source_AI.get(i) );
|
// AllZone.ManaPool.addManaToFloating(Integer.toString(Phase.ManaDrain_BonusMana_AI.get(i)), Phase.ManaDrain_Source_AI.get(i) );
|
||||||
|
|
||||||
// Mana is currently lost for AI. The above commented code was adding to the Human's mana pool
|
// Mana is currently lost for AI. The above commented code was adding to the Human's mana pool
|
||||||
|
|
||||||
Phase.ManaDrain_BonusMana_AI.clear();
|
Phase.getManaDrain_BonusMana_AI().clear();
|
||||||
Phase.ManaDrain_Source_AI.clear();
|
Phase.getManaDrain_Source_AI().clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -602,4 +602,78 @@ public class Phase extends MyObservable
|
|||||||
phase.nextPhase();
|
phase.nextPhase();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void setSacDauntlessEscort(boolean sac_Dauntless_Escort) {
|
||||||
|
Sac_Dauntless_Escort = sac_Dauntless_Escort;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isSacDauntlessEscort() {
|
||||||
|
return Sac_Dauntless_Escort;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setSacDauntlessEscortAI(boolean sac_Dauntless_Escort_Comp) {
|
||||||
|
Sac_Dauntless_Escort_Comp = sac_Dauntless_Escort_Comp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isSacDauntlessEscortAI() {
|
||||||
|
return Sac_Dauntless_Escort_Comp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setStormCount(int stormCount) {
|
||||||
|
StormCount = stormCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int getStormCount() {
|
||||||
|
return StormCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setHighTides(CardList highTides) {
|
||||||
|
HighTides = highTides;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static CardList getHighTides() {
|
||||||
|
return HighTides;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setManaDrain_BonusMana_Human(
|
||||||
|
ArrayList<Integer> manaDrain_BonusMana_Human) {
|
||||||
|
ManaDrain_BonusMana_Human = manaDrain_BonusMana_Human;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ArrayList<Integer> getManaDrain_BonusMana_Human() {
|
||||||
|
return ManaDrain_BonusMana_Human;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setManaDrain_Source_Human(CardList manaDrain_Source_Human) {
|
||||||
|
ManaDrain_Source_Human = manaDrain_Source_Human;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static CardList getManaDrain_Source_Human() {
|
||||||
|
return ManaDrain_Source_Human;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setManaDrain_BonusMana_AI(
|
||||||
|
ArrayList<Integer> manaDrain_BonusMana_AI) {
|
||||||
|
ManaDrain_BonusMana_AI = manaDrain_BonusMana_AI;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ArrayList<Integer> getManaDrain_BonusMana_AI() {
|
||||||
|
return ManaDrain_BonusMana_AI;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setManaDrain_Source_AI(CardList manaDrain_Source_AI) {
|
||||||
|
ManaDrain_Source_AI = manaDrain_Source_AI;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static CardList getManaDrain_Source_AI() {
|
||||||
|
return ManaDrain_Source_AI;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setGameBegins(int gameBegins) {
|
||||||
|
GameBegins = gameBegins;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int getGameBegins() {
|
||||||
|
return GameBegins;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,9 @@ package forge;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import forge.card.cardFactory.CardFactoryUtil;
|
||||||
|
import forge.gui.input.Input;
|
||||||
|
|
||||||
public class PhaseUtil {
|
public class PhaseUtil {
|
||||||
// ******* UNTAP PHASE *****
|
// ******* UNTAP PHASE *****
|
||||||
private static boolean skipUntap(Player p) {
|
private static boolean skipUntap(Player p) {
|
||||||
|
|||||||
@@ -9,6 +9,10 @@ import java.util.Random;
|
|||||||
|
|
||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
|
|
||||||
|
import forge.card.cardFactory.CardFactoryUtil;
|
||||||
|
import forge.card.spellability.Ability;
|
||||||
|
import forge.card.spellability.SpellAbility;
|
||||||
|
|
||||||
|
|
||||||
public abstract class Player extends MyObservable{
|
public abstract class Player extends MyObservable{
|
||||||
protected String name;
|
protected String name;
|
||||||
|
|||||||
@@ -1,12 +1,16 @@
|
|||||||
|
|
||||||
package forge;
|
package forge;
|
||||||
|
|
||||||
|
import forge.card.cardFactory.CardFactoryUtil;
|
||||||
|
import forge.card.spellability.Ability;
|
||||||
|
import forge.card.spellability.SpellAbility;
|
||||||
|
|
||||||
public class PlayerZone_ComesIntoPlay extends DefaultPlayerZone {
|
public class PlayerZone_ComesIntoPlay extends DefaultPlayerZone {
|
||||||
private static final long serialVersionUID = 5750837078903423978L;
|
private static final long serialVersionUID = 5750837078903423978L;
|
||||||
|
|
||||||
private boolean trigger = true;
|
private boolean trigger = true;
|
||||||
private boolean leavesTrigger = true;
|
private boolean leavesTrigger = true;
|
||||||
static boolean SimultaneousEntry = false; // For Cards with Multiple Token Entry. Only Affects Allies at the moment.
|
private static boolean SimultaneousEntry = false; // For Cards with Multiple Token Entry. Only Affects Allies at the moment.
|
||||||
static int SimultaneousEntryCounter = 1; // For Cards with Multiple Token Entry. Only Affects Allies at the moment.
|
static int SimultaneousEntryCounter = 1; // For Cards with Multiple Token Entry. Only Affects Allies at the moment.
|
||||||
|
|
||||||
public PlayerZone_ComesIntoPlay(String zone, Player player) {
|
public PlayerZone_ComesIntoPlay(String zone, Player player) {
|
||||||
@@ -322,4 +326,12 @@ public class PlayerZone_ComesIntoPlay extends DefaultPlayerZone {
|
|||||||
trigger = b;
|
trigger = b;
|
||||||
leavesTrigger = b;
|
leavesTrigger = b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void setSimultaneousEntry(boolean simultaneousEntry) {
|
||||||
|
SimultaneousEntry = simultaneousEntry;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isSimultaneousEntry() {
|
||||||
|
return SimultaneousEntry;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,10 @@ package forge;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import forge.card.spellability.Ability_Activated;
|
||||||
|
import forge.card.spellability.Cost;
|
||||||
|
import forge.card.spellability.SpellAbility;
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public class QuestUtil {
|
public class QuestUtil {
|
||||||
@@ -146,7 +150,7 @@ public class QuestUtil {
|
|||||||
if (level == 6)
|
if (level == 6)
|
||||||
{
|
{
|
||||||
final Card crd = c;
|
final Card crd = c;
|
||||||
Ability_Cost abCost = new Ability_Cost("T", crd.getName(), true);
|
Cost abCost = new Cost("T", crd.getName(), true);
|
||||||
final SpellAbility ability = new Ability_Activated(crd, abCost, null){
|
final SpellAbility ability = new Ability_Activated(crd, abCost, null){
|
||||||
private static final long serialVersionUID = 7546242087593613719L;
|
private static final long serialVersionUID = 7546242087593613719L;
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import java.util.StringTokenizer;
|
|||||||
import java.util.zip.ZipEntry;
|
import java.util.zip.ZipEntry;
|
||||||
import java.util.zip.ZipFile;
|
import java.util.zip.ZipFile;
|
||||||
|
|
||||||
|
import forge.card.trigger.TriggerHandler;
|
||||||
import forge.error.ErrorViewer;
|
import forge.error.ErrorViewer;
|
||||||
import forge.properties.ForgeProps;
|
import forge.properties.ForgeProps;
|
||||||
import forge.properties.NewConstants;
|
import forge.properties.NewConstants;
|
||||||
|
|||||||
@@ -3,6 +3,10 @@ import java.util.ArrayList;
|
|||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import forge.card.cardFactory.CardFactory;
|
||||||
|
import forge.card.mana.ManaCost;
|
||||||
|
import forge.gui.input.Input_PayManaCostUtil;
|
||||||
|
|
||||||
public class RunTest
|
public class RunTest
|
||||||
{
|
{
|
||||||
//@SuppressWarnings("unchecked") // HashSet needs <type>
|
//@SuppressWarnings("unchecked") // HashSet needs <type>
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ import java.util.HashMap;
|
|||||||
|
|
||||||
import com.esotericsoftware.minlog.Log;
|
import com.esotericsoftware.minlog.Log;
|
||||||
|
|
||||||
|
import forge.card.cardFactory.CardFactoryUtil;
|
||||||
|
|
||||||
|
|
||||||
public class StaticEffects
|
public class StaticEffects
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
package forge;
|
package forge;
|
||||||
interface UndoCommand extends Command
|
public interface UndoCommand extends Command
|
||||||
{
|
{
|
||||||
public void execute();
|
public void execute();
|
||||||
public void undo();
|
public void undo();
|
||||||
|
|||||||
@@ -1,8 +1,22 @@
|
|||||||
package forge;
|
package forge.card.abilityFactory;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import forge.AllZone;
|
||||||
|
import forge.AllZoneUtil;
|
||||||
|
import forge.Card;
|
||||||
|
import forge.CardList;
|
||||||
|
import forge.ComputerAI_counterSpells2;
|
||||||
|
import forge.Constant;
|
||||||
|
import forge.Player;
|
||||||
|
import forge.card.cardFactory.CardFactoryUtil;
|
||||||
|
import forge.card.spellability.Ability_Sub;
|
||||||
|
import forge.card.spellability.Cost;
|
||||||
|
import forge.card.spellability.SpellAbility;
|
||||||
|
import forge.card.spellability.SpellAbility_Restriction;
|
||||||
|
import forge.card.spellability.Target;
|
||||||
|
|
||||||
public class AbilityFactory {
|
public class AbilityFactory {
|
||||||
|
|
||||||
private Card hostC = null;
|
private Card hostC = null;
|
||||||
@@ -37,9 +51,9 @@ public class AbilityFactory {
|
|||||||
return isDb;
|
return isDb;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Ability_Cost abCost = null;
|
private Cost abCost = null;
|
||||||
|
|
||||||
public Ability_Cost getAbCost()
|
public Cost getAbCost()
|
||||||
{
|
{
|
||||||
return abCost;
|
return abCost;
|
||||||
}
|
}
|
||||||
@@ -148,7 +162,7 @@ public class AbilityFactory {
|
|||||||
if (!isDb){
|
if (!isDb){
|
||||||
if (!mapParams.containsKey("Cost"))
|
if (!mapParams.containsKey("Cost"))
|
||||||
throw new RuntimeException("AbilityFactory : getAbility -- no Cost in " + hostCard.getName());
|
throw new RuntimeException("AbilityFactory : getAbility -- no Cost in " + hostCard.getName());
|
||||||
abCost = new Ability_Cost(mapParams.get("Cost"), hostCard.getName(), isAb);
|
abCost = new Cost(mapParams.get("Cost"), hostCard.getName(), isAb);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mapParams.containsKey("ValidTgts"))
|
if (mapParams.containsKey("ValidTgts"))
|
||||||
@@ -1,9 +1,23 @@
|
|||||||
package forge;
|
package forge.card.abilityFactory;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
import forge.AllZone;
|
||||||
|
import forge.AllZoneUtil;
|
||||||
|
import forge.Card;
|
||||||
|
import forge.ComputerUtil;
|
||||||
|
import forge.Counters;
|
||||||
|
import forge.Player;
|
||||||
|
import forge.card.cardFactory.CardFactoryUtil;
|
||||||
|
import forge.card.spellability.Ability_Activated;
|
||||||
|
import forge.card.spellability.Ability_Sub;
|
||||||
|
import forge.card.spellability.Cost;
|
||||||
|
import forge.card.spellability.Spell;
|
||||||
|
import forge.card.spellability.SpellAbility;
|
||||||
|
import forge.card.spellability.Target;
|
||||||
|
|
||||||
public class AbilityFactory_AlterLife {
|
public class AbilityFactory_AlterLife {
|
||||||
// An AbilityFactory subclass for Gaining, Losing, or Setting Life totals.
|
// An AbilityFactory subclass for Gaining, Losing, or Setting Life totals.
|
||||||
|
|
||||||
@@ -144,7 +158,7 @@ public class AbilityFactory_AlterLife {
|
|||||||
public static boolean gainLifeCanPlayAI(final AbilityFactory af, final SpellAbility sa){
|
public static boolean gainLifeCanPlayAI(final AbilityFactory af, final SpellAbility sa){
|
||||||
Random r = new Random();
|
Random r = new Random();
|
||||||
HashMap<String,String> params = af.getMapParams();
|
HashMap<String,String> params = af.getMapParams();
|
||||||
Ability_Cost abCost = sa.getPayCosts();
|
Cost abCost = sa.getPayCosts();
|
||||||
final Card source = sa.getSourceCard();
|
final Card source = sa.getSourceCard();
|
||||||
int life = AllZone.ComputerPlayer.getLife();
|
int life = AllZone.ComputerPlayer.getLife();
|
||||||
int lifeAmount = AbilityFactory.calculateAmount(af.getHostCard(), params.get("LifeAmount"), sa);
|
int lifeAmount = AbilityFactory.calculateAmount(af.getHostCard(), params.get("LifeAmount"), sa);
|
||||||
@@ -397,7 +411,7 @@ public class AbilityFactory_AlterLife {
|
|||||||
|
|
||||||
public static boolean loseLifeCanPlayAI(final AbilityFactory af, final SpellAbility sa){
|
public static boolean loseLifeCanPlayAI(final AbilityFactory af, final SpellAbility sa){
|
||||||
Random r = new Random();
|
Random r = new Random();
|
||||||
Ability_Cost abCost = sa.getPayCosts();
|
Cost abCost = sa.getPayCosts();
|
||||||
final Card source = sa.getSourceCard();
|
final Card source = sa.getSourceCard();
|
||||||
int humanLife = AllZone.HumanPlayer.getLife();
|
int humanLife = AllZone.HumanPlayer.getLife();
|
||||||
int aiLife = AllZone.ComputerPlayer.getLife();
|
int aiLife = AllZone.ComputerPlayer.getLife();
|
||||||
@@ -717,7 +731,7 @@ public class AbilityFactory_AlterLife {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static boolean poisonCanPlayAI(final AbilityFactory af, final SpellAbility sa, final String amountStr){
|
private static boolean poisonCanPlayAI(final AbilityFactory af, final SpellAbility sa, final String amountStr){
|
||||||
Ability_Cost abCost = sa.getPayCosts();
|
Cost abCost = sa.getPayCosts();
|
||||||
//int humanPoison = AllZone.HumanPlayer.getPoisonCounters();
|
//int humanPoison = AllZone.HumanPlayer.getPoisonCounters();
|
||||||
int humanLife = AllZone.HumanPlayer.getLife();
|
int humanLife = AllZone.HumanPlayer.getLife();
|
||||||
//int aiPoison = AllZone.ComputerPlayer.getPoisonCounters();
|
//int aiPoison = AllZone.ComputerPlayer.getPoisonCounters();
|
||||||
@@ -1,10 +1,24 @@
|
|||||||
package forge;
|
package forge.card.abilityFactory;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Hashtable;
|
import java.util.Hashtable;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
import forge.AllZone;
|
||||||
|
import forge.Card;
|
||||||
|
import forge.Command;
|
||||||
|
import forge.ComputerUtil;
|
||||||
|
import forge.Constant;
|
||||||
|
import forge.card.cardFactory.CardFactoryUtil;
|
||||||
|
import forge.card.spellability.Ability_Activated;
|
||||||
|
import forge.card.spellability.Ability_Sub;
|
||||||
|
import forge.card.spellability.Spell;
|
||||||
|
import forge.card.spellability.SpellAbility;
|
||||||
|
import forge.card.spellability.Target;
|
||||||
|
import forge.card.trigger.Trigger;
|
||||||
|
import forge.card.trigger.TriggerHandler;
|
||||||
|
|
||||||
public class AbilityFactory_Animate {
|
public class AbilityFactory_Animate {
|
||||||
|
|
||||||
//**************************************************************
|
//**************************************************************
|
||||||
@@ -132,6 +146,7 @@ public class AbilityFactory_Animate {
|
|||||||
if(tgts.size() == 1) sb.append("s a");
|
if(tgts.size() == 1) sb.append("s a");
|
||||||
//if power is -1, we'll assume it's not just setting toughness
|
//if power is -1, we'll assume it's not just setting toughness
|
||||||
if(power != -1) sb.append(" ").append(power).append("/").append(toughness);
|
if(power != -1) sb.append(" ").append(power).append("/").append(toughness);
|
||||||
|
|
||||||
if(colors.size() > 0) sb.append(" ");
|
if(colors.size() > 0) sb.append(" ");
|
||||||
for(int i = 0; i < colors.size(); i++) {
|
for(int i = 0; i < colors.size(); i++) {
|
||||||
sb.append(colors.get(i));
|
sb.append(colors.get(i));
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package forge;
|
package forge.card.abilityFactory;
|
||||||
|
|
||||||
public class AbilityFactory_Bounce {
|
public class AbilityFactory_Bounce {
|
||||||
// An AbilityFactory subclass for bouncing and exiling permanents
|
// An AbilityFactory subclass for bouncing and exiling permanents
|
||||||
@@ -1,9 +1,25 @@
|
|||||||
package forge;
|
package forge.card.abilityFactory;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
import forge.AllZone;
|
||||||
|
import forge.AllZoneUtil;
|
||||||
|
import forge.Card;
|
||||||
|
import forge.CardList;
|
||||||
|
import forge.ComputerUtil;
|
||||||
|
import forge.Constant;
|
||||||
|
import forge.GameActionUtil;
|
||||||
|
import forge.Player;
|
||||||
|
import forge.PlayerZone;
|
||||||
|
import forge.card.cardFactory.CardFactoryUtil;
|
||||||
|
import forge.card.spellability.Ability_Activated;
|
||||||
|
import forge.card.spellability.Ability_Sub;
|
||||||
|
import forge.card.spellability.Cost;
|
||||||
|
import forge.card.spellability.Spell;
|
||||||
|
import forge.card.spellability.SpellAbility;
|
||||||
|
import forge.card.spellability.Target;
|
||||||
import forge.gui.GuiUtils;
|
import forge.gui.GuiUtils;
|
||||||
|
|
||||||
public class AbilityFactory_ChangeZone {
|
public class AbilityFactory_ChangeZone {
|
||||||
@@ -185,7 +201,7 @@ public class AbilityFactory_ChangeZone {
|
|||||||
|
|
||||||
private static boolean changeHiddenOriginCanPlayAI(AbilityFactory af, SpellAbility sa){
|
private static boolean changeHiddenOriginCanPlayAI(AbilityFactory af, SpellAbility sa){
|
||||||
// Fetching should occur fairly often as it helps cast more spells, and have access to more mana
|
// Fetching should occur fairly often as it helps cast more spells, and have access to more mana
|
||||||
Ability_Cost abCost = af.getAbCost();
|
Cost abCost = af.getAbCost();
|
||||||
Card source = af.getHostCard();
|
Card source = af.getHostCard();
|
||||||
HashMap<String,String> params = af.getMapParams();
|
HashMap<String,String> params = af.getMapParams();
|
||||||
//String destination = params.get("Destination");
|
//String destination = params.get("Destination");
|
||||||
@@ -705,7 +721,7 @@ public class AbilityFactory_ChangeZone {
|
|||||||
|
|
||||||
private static boolean changeKnownOriginCanPlayAI(AbilityFactory af, SpellAbility sa){
|
private static boolean changeKnownOriginCanPlayAI(AbilityFactory af, SpellAbility sa){
|
||||||
// Retrieve either this card, or target Cards in Graveyard
|
// Retrieve either this card, or target Cards in Graveyard
|
||||||
Ability_Cost abCost = af.getAbCost();
|
Cost abCost = af.getAbCost();
|
||||||
final Card source = af.getHostCard();
|
final Card source = af.getHostCard();
|
||||||
HashMap<String,String> params = af.getMapParams();
|
HashMap<String,String> params = af.getMapParams();
|
||||||
|
|
||||||
@@ -1236,7 +1252,7 @@ public class AbilityFactory_ChangeZone {
|
|||||||
|
|
||||||
private static boolean changeZoneAllCanPlayAI(AbilityFactory af, SpellAbility sa){
|
private static boolean changeZoneAllCanPlayAI(AbilityFactory af, SpellAbility sa){
|
||||||
// Change Zone All, can be any type moving from one zone to another
|
// Change Zone All, can be any type moving from one zone to another
|
||||||
Ability_Cost abCost = af.getAbCost();
|
Cost abCost = af.getAbCost();
|
||||||
Card source = af.getHostCard();
|
Card source = af.getHostCard();
|
||||||
HashMap<String,String> params = af.getMapParams();
|
HashMap<String,String> params = af.getMapParams();
|
||||||
String destination = params.get("Destination");
|
String destination = params.get("Destination");
|
||||||
@@ -1,12 +1,16 @@
|
|||||||
package forge;
|
package forge.card.abilityFactory;
|
||||||
|
|
||||||
import java.util.Random;
|
import forge.card.spellability.Ability_Activated;
|
||||||
|
import forge.card.spellability.Ability_Sub;
|
||||||
|
import forge.card.spellability.Spell;
|
||||||
|
import forge.card.spellability.SpellAbility;
|
||||||
|
|
||||||
public class AbilityFactory_Clash {
|
public class AbilityFactory_Clash {
|
||||||
|
|
||||||
public static SpellAbility getAbility(final AbilityFactory AF)
|
public static SpellAbility getAbility(final AbilityFactory AF)
|
||||||
{
|
{
|
||||||
final SpellAbility abClash = new Ability_Activated(AF.getHostCard(),AF.getAbCost(),AF.getAbTgt()) {
|
final SpellAbility abClash = new Ability_Activated(AF.getHostCard(),AF.getAbCost(),AF.getAbTgt()) {
|
||||||
|
private static final long serialVersionUID = -8019637116128196248L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canPlayAI()
|
public boolean canPlayAI()
|
||||||
@@ -45,6 +49,7 @@ public class AbilityFactory_Clash {
|
|||||||
public static SpellAbility getSpell(final AbilityFactory AF)
|
public static SpellAbility getSpell(final AbilityFactory AF)
|
||||||
{
|
{
|
||||||
final SpellAbility spClash = new Spell(AF.getHostCard(),AF.getAbCost(),AF.getAbTgt()) {
|
final SpellAbility spClash = new Spell(AF.getHostCard(),AF.getAbCost(),AF.getAbTgt()) {
|
||||||
|
private static final long serialVersionUID = -4991665176268317172L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canPlayAI()
|
public boolean canPlayAI()
|
||||||
@@ -83,6 +88,7 @@ public class AbilityFactory_Clash {
|
|||||||
public static SpellAbility getDrawback(final AbilityFactory AF)
|
public static SpellAbility getDrawback(final AbilityFactory AF)
|
||||||
{
|
{
|
||||||
final SpellAbility dbClash = new Ability_Sub(AF.getHostCard(),AF.getAbTgt()) {
|
final SpellAbility dbClash = new Ability_Sub(AF.getHostCard(),AF.getAbTgt()) {
|
||||||
|
private static final long serialVersionUID = -3850086157052881360L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canPlayAI()
|
public boolean canPlayAI()
|
||||||
@@ -1,7 +1,18 @@
|
|||||||
package forge;
|
package forge.card.abilityFactory;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import forge.AllZone;
|
||||||
|
import forge.Card;
|
||||||
|
import forge.CombatUtil;
|
||||||
|
import forge.ComputerUtil;
|
||||||
|
import forge.Constant;
|
||||||
|
import forge.card.cardFactory.CardFactoryUtil;
|
||||||
|
import forge.card.spellability.Ability_Activated;
|
||||||
|
import forge.card.spellability.Ability_Sub;
|
||||||
|
import forge.card.spellability.Spell;
|
||||||
|
import forge.card.spellability.SpellAbility;
|
||||||
|
|
||||||
public class AbilityFactory_Combat {
|
public class AbilityFactory_Combat {
|
||||||
//**************************************************************
|
//**************************************************************
|
||||||
// ****************************** FOG **************************
|
// ****************************** FOG **************************
|
||||||
@@ -1,9 +1,26 @@
|
|||||||
package forge;
|
package forge.card.abilityFactory;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import forge.AllZone;
|
||||||
|
import forge.AllZoneUtil;
|
||||||
|
import forge.Card;
|
||||||
|
import forge.CardList;
|
||||||
|
import forge.CardListFilter;
|
||||||
|
import forge.Command;
|
||||||
|
import forge.ComputerUtil;
|
||||||
|
import forge.Constant;
|
||||||
|
import forge.GameActionUtil;
|
||||||
|
import forge.Player;
|
||||||
|
import forge.card.cardFactory.CardFactoryUtil;
|
||||||
|
import forge.card.spellability.Ability;
|
||||||
|
import forge.card.spellability.Ability_Activated;
|
||||||
|
import forge.card.spellability.Ability_Sub;
|
||||||
|
import forge.card.spellability.Spell;
|
||||||
|
import forge.card.spellability.SpellAbility;
|
||||||
import forge.gui.GuiUtils;
|
import forge.gui.GuiUtils;
|
||||||
|
import forge.gui.input.Input;
|
||||||
|
|
||||||
//Type - Spell or Ability or SpellOrAbility
|
//Type - Spell or Ability or SpellOrAbility
|
||||||
//CounterValid - a "valid" expression for types to counter
|
//CounterValid - a "valid" expression for types to counter
|
||||||
@@ -1,10 +1,29 @@
|
|||||||
package forge;
|
package forge.card.abilityFactory;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
import forge.AllZone;
|
||||||
|
import forge.AllZoneUtil;
|
||||||
|
import forge.ButtonUtil;
|
||||||
|
import forge.Card;
|
||||||
|
import forge.CardList;
|
||||||
|
import forge.CardListFilter;
|
||||||
|
import forge.ComputerUtil;
|
||||||
|
import forge.Constant;
|
||||||
|
import forge.Counters;
|
||||||
|
import forge.Player;
|
||||||
|
import forge.PlayerZone;
|
||||||
|
import forge.card.cardFactory.CardFactoryUtil;
|
||||||
|
import forge.card.spellability.Ability_Activated;
|
||||||
|
import forge.card.spellability.Ability_Sub;
|
||||||
|
import forge.card.spellability.Cost;
|
||||||
|
import forge.card.spellability.Spell;
|
||||||
|
import forge.card.spellability.SpellAbility;
|
||||||
|
import forge.card.spellability.Target;
|
||||||
import forge.gui.GuiUtils;
|
import forge.gui.GuiUtils;
|
||||||
|
import forge.gui.input.Input;
|
||||||
|
|
||||||
public class AbilityFactory_Counters {
|
public class AbilityFactory_Counters {
|
||||||
// An AbilityFactory subclass for Putting or Removing Counters on Cards.
|
// An AbilityFactory subclass for Putting or Removing Counters on Cards.
|
||||||
@@ -138,7 +157,7 @@ public class AbilityFactory_Counters {
|
|||||||
public static boolean putCanPlayAI(final AbilityFactory af, final SpellAbility sa){
|
public static boolean putCanPlayAI(final AbilityFactory af, final SpellAbility sa){
|
||||||
// AI needs to be expanded, since this function can be pretty complex based on what the expected targets could be
|
// AI needs to be expanded, since this function can be pretty complex based on what the expected targets could be
|
||||||
Random r = new Random();
|
Random r = new Random();
|
||||||
Ability_Cost abCost = sa.getPayCosts();
|
Cost abCost = sa.getPayCosts();
|
||||||
Target abTgt = sa.getTarget();
|
Target abTgt = sa.getTarget();
|
||||||
final Card source = sa.getSourceCard();
|
final Card source = sa.getSourceCard();
|
||||||
CardList list;
|
CardList list;
|
||||||
@@ -610,7 +629,7 @@ public class AbilityFactory_Counters {
|
|||||||
public static boolean removeCanPlayAI(final AbilityFactory af, final SpellAbility sa){
|
public static boolean removeCanPlayAI(final AbilityFactory af, final SpellAbility sa){
|
||||||
// AI needs to be expanded, since this function can be pretty complex based on what the expected targets could be
|
// AI needs to be expanded, since this function can be pretty complex based on what the expected targets could be
|
||||||
Random r = new Random();
|
Random r = new Random();
|
||||||
Ability_Cost abCost = sa.getPayCosts();
|
Cost abCost = sa.getPayCosts();
|
||||||
//Target abTgt = sa.getTarget();
|
//Target abTgt = sa.getTarget();
|
||||||
final Card source = sa.getSourceCard();
|
final Card source = sa.getSourceCard();
|
||||||
//CardList list;
|
//CardList list;
|
||||||
@@ -1145,7 +1164,7 @@ public class AbilityFactory_Counters {
|
|||||||
// AI needs to be expanded, since this function can be pretty complex based on what the expected targets could be
|
// AI needs to be expanded, since this function can be pretty complex based on what the expected targets could be
|
||||||
Random r = new Random();
|
Random r = new Random();
|
||||||
HashMap<String,String> params = af.getMapParams();
|
HashMap<String,String> params = af.getMapParams();
|
||||||
Ability_Cost abCost = sa.getPayCosts();
|
Cost abCost = sa.getPayCosts();
|
||||||
final Card source = sa.getSourceCard();
|
final Card source = sa.getSourceCard();
|
||||||
CardList hList;
|
CardList hList;
|
||||||
CardList cList;
|
CardList cList;
|
||||||
@@ -1,10 +1,27 @@
|
|||||||
|
|
||||||
package forge;
|
package forge.card.abilityFactory;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
import forge.AllZone;
|
||||||
|
import forge.AllZoneUtil;
|
||||||
|
import forge.Card;
|
||||||
|
import forge.CardList;
|
||||||
|
import forge.CardListFilter;
|
||||||
|
import forge.ComputerUtil;
|
||||||
|
import forge.Constant;
|
||||||
|
import forge.Counters;
|
||||||
|
import forge.Player;
|
||||||
|
import forge.card.cardFactory.CardFactoryUtil;
|
||||||
|
import forge.card.spellability.Ability_Activated;
|
||||||
|
import forge.card.spellability.Ability_Sub;
|
||||||
|
import forge.card.spellability.Cost;
|
||||||
|
import forge.card.spellability.Spell;
|
||||||
|
import forge.card.spellability.SpellAbility;
|
||||||
|
import forge.card.spellability.Target;
|
||||||
|
|
||||||
public class AbilityFactory_DealDamage {
|
public class AbilityFactory_DealDamage {
|
||||||
private AbilityFactory AF = null;
|
private AbilityFactory AF = null;
|
||||||
|
|
||||||
@@ -665,7 +682,7 @@ public class AbilityFactory_DealDamage {
|
|||||||
private boolean damageAllCanPlayAI(final AbilityFactory af, final SpellAbility sa){
|
private boolean damageAllCanPlayAI(final AbilityFactory af, final SpellAbility sa){
|
||||||
// AI needs to be expanded, since this function can be pretty complex based on what the expected targets could be
|
// AI needs to be expanded, since this function can be pretty complex based on what the expected targets could be
|
||||||
Random r = new Random();
|
Random r = new Random();
|
||||||
Ability_Cost abCost = sa.getPayCosts();
|
Cost abCost = sa.getPayCosts();
|
||||||
final Card source = sa.getSourceCard();
|
final Card source = sa.getSourceCard();
|
||||||
final HashMap<String,String> params = af.getMapParams();
|
final HashMap<String,String> params = af.getMapParams();
|
||||||
|
|
||||||
@@ -1,9 +1,23 @@
|
|||||||
package forge;
|
package forge.card.abilityFactory;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
import forge.AllZone;
|
||||||
|
import forge.AllZoneUtil;
|
||||||
|
import forge.Card;
|
||||||
|
import forge.CardList;
|
||||||
|
import forge.CardListFilter;
|
||||||
|
import forge.ComputerUtil;
|
||||||
|
import forge.card.cardFactory.CardFactoryUtil;
|
||||||
|
import forge.card.spellability.Ability_Activated;
|
||||||
|
import forge.card.spellability.Ability_Sub;
|
||||||
|
import forge.card.spellability.Cost;
|
||||||
|
import forge.card.spellability.Spell;
|
||||||
|
import forge.card.spellability.SpellAbility;
|
||||||
|
import forge.card.spellability.Target;
|
||||||
|
|
||||||
public class AbilityFactory_Destroy {
|
public class AbilityFactory_Destroy {
|
||||||
// An AbilityFactory subclass for destroying permanents
|
// An AbilityFactory subclass for destroying permanents
|
||||||
// *********************************************************************************
|
// *********************************************************************************
|
||||||
@@ -96,7 +110,7 @@ public class AbilityFactory_Destroy {
|
|||||||
public static boolean destroyCanPlayAI(final AbilityFactory af, final SpellAbility sa){
|
public static boolean destroyCanPlayAI(final AbilityFactory af, final SpellAbility sa){
|
||||||
// AI needs to be expanded, since this function can be pretty complex based on what the expected targets could be
|
// AI needs to be expanded, since this function can be pretty complex based on what the expected targets could be
|
||||||
Random r = new Random();
|
Random r = new Random();
|
||||||
Ability_Cost abCost = sa.getPayCosts();
|
Cost abCost = sa.getPayCosts();
|
||||||
Target abTgt = sa.getTarget();
|
Target abTgt = sa.getTarget();
|
||||||
final Card source = sa.getSourceCard();
|
final Card source = sa.getSourceCard();
|
||||||
final boolean noRegen = af.getMapParams().containsKey("NoRegen");
|
final boolean noRegen = af.getMapParams().containsKey("NoRegen");
|
||||||
@@ -501,7 +515,7 @@ public class AbilityFactory_Destroy {
|
|||||||
public static boolean destroyAllCanPlayAI(final AbilityFactory af, final SpellAbility sa, final boolean noRegen){
|
public static boolean destroyAllCanPlayAI(final AbilityFactory af, final SpellAbility sa, final boolean noRegen){
|
||||||
// AI needs to be expanded, since this function can be pretty complex based on what the expected targets could be
|
// AI needs to be expanded, since this function can be pretty complex based on what the expected targets could be
|
||||||
Random r = new Random();
|
Random r = new Random();
|
||||||
Ability_Cost abCost = sa.getPayCosts();
|
Cost abCost = sa.getPayCosts();
|
||||||
final Card source = sa.getSourceCard();
|
final Card source = sa.getSourceCard();
|
||||||
final HashMap<String,String> params = af.getMapParams();
|
final HashMap<String,String> params = af.getMapParams();
|
||||||
String Valid = "";
|
String Valid = "";
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package forge;
|
package forge.card.abilityFactory;
|
||||||
|
|
||||||
public class AbilityFactory_Fetch {
|
public class AbilityFactory_Fetch {
|
||||||
// An AbilityFactory subclass for Fetching Cards from Places
|
// An AbilityFactory subclass for Fetching Cards from Places
|
||||||
@@ -1,10 +1,25 @@
|
|||||||
package forge;
|
package forge.card.abilityFactory;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Hashtable;
|
import java.util.Hashtable;
|
||||||
|
|
||||||
|
import forge.AllZone;
|
||||||
|
import forge.AllZoneUtil;
|
||||||
|
import forge.Card;
|
||||||
|
import forge.CardList;
|
||||||
|
import forge.CardListFilter;
|
||||||
|
import forge.Command;
|
||||||
|
import forge.Constant;
|
||||||
|
import forge.card.cardFactory.CardFactoryUtil;
|
||||||
|
import forge.card.spellability.Ability;
|
||||||
|
import forge.card.spellability.Ability_Activated;
|
||||||
|
import forge.card.spellability.Ability_Sub;
|
||||||
|
import forge.card.spellability.Spell;
|
||||||
|
import forge.card.spellability.SpellAbility;
|
||||||
|
import forge.card.spellability.Target;
|
||||||
|
|
||||||
//AB:GainControl|ValidTgts$Creature|TgtPrompt$Select target legendary creature|LoseControl$Untap,LoseControl|SpellDescription$Gain control of target xxxxxxx
|
//AB:GainControl|ValidTgts$Creature|TgtPrompt$Select target legendary creature|LoseControl$Untap,LoseControl|SpellDescription$Gain control of target xxxxxxx
|
||||||
|
|
||||||
//GainControl specific params:
|
//GainControl specific params:
|
||||||
@@ -1,9 +1,23 @@
|
|||||||
package forge;
|
package forge.card.abilityFactory;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import forge.AllZone;
|
||||||
|
import forge.AllZoneUtil;
|
||||||
|
import forge.Card;
|
||||||
|
import forge.CardList;
|
||||||
|
import forge.Constant;
|
||||||
|
import forge.Counters;
|
||||||
|
import forge.Player;
|
||||||
|
import forge.card.cardFactory.CardFactoryUtil;
|
||||||
|
import forge.card.spellability.Ability_Mana;
|
||||||
|
import forge.card.spellability.Ability_Sub;
|
||||||
|
import forge.card.spellability.Cost;
|
||||||
|
import forge.card.spellability.Spell;
|
||||||
|
import forge.card.spellability.SpellAbility;
|
||||||
import forge.gui.GuiUtils;
|
import forge.gui.GuiUtils;
|
||||||
|
import forge.gui.input.Input_PayManaCostUtil;
|
||||||
|
|
||||||
public class AbilityFactory_Mana {
|
public class AbilityFactory_Mana {
|
||||||
// ****************************** MANA ************************
|
// ****************************** MANA ************************
|
||||||
@@ -39,7 +53,7 @@ public class AbilityFactory_Mana {
|
|||||||
|
|
||||||
final AbilityFactory af = AF;
|
final AbilityFactory af = AF;
|
||||||
// To get the mana to resolve properly, we need the spell to contain an Ability_Mana
|
// To get the mana to resolve properly, we need the spell to contain an Ability_Mana
|
||||||
Ability_Cost tmp = new Ability_Cost("0", AF.getHostCard().getName(), false);
|
Cost tmp = new Cost("0", AF.getHostCard().getName(), false);
|
||||||
Ability_Mana tmpMana = new Ability_Mana(AF.getHostCard(), tmp, produced){
|
Ability_Mana tmpMana = new Ability_Mana(AF.getHostCard(), tmp, produced){
|
||||||
private static final long serialVersionUID = 1454043766057140491L;
|
private static final long serialVersionUID = 1454043766057140491L;
|
||||||
|
|
||||||
@@ -78,7 +92,7 @@ public class AbilityFactory_Mana {
|
|||||||
|
|
||||||
final AbilityFactory af = AF;
|
final AbilityFactory af = AF;
|
||||||
// To get the mana to resolve properly, we need the spell to contain an Ability_Mana
|
// To get the mana to resolve properly, we need the spell to contain an Ability_Mana
|
||||||
Ability_Cost tmp = new Ability_Cost("0", AF.getHostCard().getName(), false);
|
Cost tmp = new Cost("0", AF.getHostCard().getName(), false);
|
||||||
Ability_Mana tmpMana = new Ability_Mana(AF.getHostCard(), tmp, produced){
|
Ability_Mana tmpMana = new Ability_Mana(AF.getHostCard(), tmp, produced){
|
||||||
private static final long serialVersionUID = 1454043766057140491L;
|
private static final long serialVersionUID = 1454043766057140491L;
|
||||||
|
|
||||||
@@ -140,7 +154,7 @@ public class AbilityFactory_Mana {
|
|||||||
|
|
||||||
public static void manaResolve(Ability_Mana abMana, AbilityFactory af, SpellAbility sa){
|
public static void manaResolve(Ability_Mana abMana, AbilityFactory af, SpellAbility sa){
|
||||||
// Spells are not undoable
|
// Spells are not undoable
|
||||||
abMana.undoable = af.isAbility() && abMana.isUndoable();
|
abMana.setUndoable(af.isAbility() && abMana.isUndoable());
|
||||||
|
|
||||||
HashMap<String,String> params = af.getMapParams();
|
HashMap<String,String> params = af.getMapParams();
|
||||||
Card card = af.getHostCard();
|
Card card = af.getHostCard();
|
||||||
@@ -149,7 +163,7 @@ public class AbilityFactory_Mana {
|
|||||||
|
|
||||||
// convert these to SubAbilities when appropriate
|
// convert these to SubAbilities when appropriate
|
||||||
if (params.containsKey("Stuck")){
|
if (params.containsKey("Stuck")){
|
||||||
abMana.undoable = false;
|
abMana.setUndoable(false);
|
||||||
card.addExtrinsicKeyword("This card doesn't untap during your next untap step.");
|
card.addExtrinsicKeyword("This card doesn't untap during your next untap step.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -157,7 +171,7 @@ public class AbilityFactory_Mana {
|
|||||||
if (deplete != null){
|
if (deplete != null){
|
||||||
int num = card.getCounters(Counters.getType(deplete));
|
int num = card.getCounters(Counters.getType(deplete));
|
||||||
if (num == 0){
|
if (num == 0){
|
||||||
abMana.undoable = false;
|
abMana.setUndoable(false);
|
||||||
AllZone.GameAction.sacrifice(card);
|
AllZone.GameAction.sacrifice(card);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -186,10 +200,10 @@ public class AbilityFactory_Mana {
|
|||||||
|
|
||||||
try{
|
try{
|
||||||
if (params.get("Amount") != null && amount != Integer.parseInt(params.get("Amount")))
|
if (params.get("Amount") != null && amount != Integer.parseInt(params.get("Amount")))
|
||||||
abMana.undoable = false;
|
abMana.setUndoable(false);
|
||||||
}
|
}
|
||||||
catch(NumberFormatException n){
|
catch(NumberFormatException n){
|
||||||
abMana.undoable = false;
|
abMana.setUndoable(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
@@ -247,7 +261,7 @@ public class AbilityFactory_Mana {
|
|||||||
|
|
||||||
final AbilityFactory af = AF;
|
final AbilityFactory af = AF;
|
||||||
// To get the mana to resolve properly, we need the spell to contain an Ability_Mana
|
// To get the mana to resolve properly, we need the spell to contain an Ability_Mana
|
||||||
Ability_Cost tmp = new Ability_Cost("0", AF.getHostCard().getName(), false);
|
Cost tmp = new Cost("0", AF.getHostCard().getName(), false);
|
||||||
Ability_Mana tmpMana = new Ability_Mana(AF.getHostCard(), tmp, produced){
|
Ability_Mana tmpMana = new Ability_Mana(AF.getHostCard(), tmp, produced){
|
||||||
private static final long serialVersionUID = 1454043766057140491L;
|
private static final long serialVersionUID = 1454043766057140491L;
|
||||||
|
|
||||||
@@ -282,7 +296,7 @@ public class AbilityFactory_Mana {
|
|||||||
|
|
||||||
public static void manaReflectedResolve(Ability_Mana abMana, AbilityFactory af){
|
public static void manaReflectedResolve(Ability_Mana abMana, AbilityFactory af){
|
||||||
// Spells are not undoable
|
// Spells are not undoable
|
||||||
abMana.undoable = af.isAbility() && abMana.isUndoable();
|
abMana.setUndoable(af.isAbility() && abMana.isUndoable());
|
||||||
|
|
||||||
Card card = af.getHostCard();
|
Card card = af.getHostCard();
|
||||||
|
|
||||||
@@ -458,7 +472,7 @@ public class AbilityFactory_Mana {
|
|||||||
|
|
||||||
// if mana production has any type of SubAbility, undoable=false
|
// if mana production has any type of SubAbility, undoable=false
|
||||||
if (af.hasSubAbility()){
|
if (af.hasSubAbility()){
|
||||||
abMana.undoable = false;
|
abMana.setUndoable(false);
|
||||||
Ability_Sub abSub = abMana.getSubAbility();
|
Ability_Sub abSub = abMana.getSubAbility();
|
||||||
if (abSub != null){
|
if (abSub != null){
|
||||||
abSub.resolve();
|
abSub.resolve();
|
||||||
@@ -1,9 +1,21 @@
|
|||||||
package forge;
|
package forge.card.abilityFactory;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
import forge.AllZone;
|
||||||
|
import forge.AllZoneUtil;
|
||||||
|
import forge.Card;
|
||||||
|
import forge.CardList;
|
||||||
|
import forge.CardListFilter;
|
||||||
|
import forge.ComputerUtil;
|
||||||
|
import forge.card.cardFactory.CardFactoryUtil;
|
||||||
|
import forge.card.spellability.Ability_Activated;
|
||||||
|
import forge.card.spellability.Ability_Sub;
|
||||||
|
import forge.card.spellability.Spell;
|
||||||
|
import forge.card.spellability.SpellAbility;
|
||||||
|
import forge.card.spellability.Target;
|
||||||
import forge.gui.GuiUtils;
|
import forge.gui.GuiUtils;
|
||||||
|
|
||||||
public class AbilityFactory_PermanentState {
|
public class AbilityFactory_PermanentState {
|
||||||
@@ -1,9 +1,26 @@
|
|||||||
package forge;
|
package forge.card.abilityFactory;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
import forge.AllZone;
|
||||||
|
import forge.AllZoneUtil;
|
||||||
|
import forge.Card;
|
||||||
|
import forge.CardList;
|
||||||
|
import forge.CardListFilter;
|
||||||
|
import forge.Command;
|
||||||
|
import forge.ComputerUtil;
|
||||||
|
import forge.Constant;
|
||||||
|
import forge.Counters;
|
||||||
|
import forge.card.cardFactory.CardFactoryUtil;
|
||||||
|
import forge.card.spellability.Ability_Activated;
|
||||||
|
import forge.card.spellability.Ability_Sub;
|
||||||
|
import forge.card.spellability.Spell;
|
||||||
|
import forge.card.spellability.SpellAbility;
|
||||||
|
import forge.card.spellability.SpellAbility_Restriction;
|
||||||
|
import forge.card.spellability.Target;
|
||||||
|
|
||||||
public class AbilityFactory_Pump {
|
public class AbilityFactory_Pump {
|
||||||
|
|
||||||
private final ArrayList<String> Keywords = new ArrayList<String>();
|
private final ArrayList<String> Keywords = new ArrayList<String>();
|
||||||
@@ -1,9 +1,25 @@
|
|||||||
package forge;
|
package forge.card.abilityFactory;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
|
import forge.AllZone;
|
||||||
|
import forge.AllZoneUtil;
|
||||||
|
import forge.Card;
|
||||||
|
import forge.CardList;
|
||||||
|
import forge.CardListUtil;
|
||||||
|
import forge.CombatUtil;
|
||||||
|
import forge.Command;
|
||||||
|
import forge.ComputerUtil;
|
||||||
|
import forge.Constant;
|
||||||
|
import forge.card.cardFactory.CardFactoryUtil;
|
||||||
|
import forge.card.spellability.Ability_Activated;
|
||||||
|
import forge.card.spellability.Ability_Sub;
|
||||||
|
import forge.card.spellability.Spell;
|
||||||
|
import forge.card.spellability.SpellAbility;
|
||||||
|
import forge.card.spellability.Target;
|
||||||
|
|
||||||
public class AbilityFactory_Regenerate {
|
public class AbilityFactory_Regenerate {
|
||||||
|
|
||||||
// Ex: A:SP$Regenerate | Cost$W | Tgt$TgtC | SpellDescription$Regenerate target creature.
|
// Ex: A:SP$Regenerate | Cost$W | Tgt$TgtC | SpellDescription$Regenerate target creature.
|
||||||
@@ -1,8 +1,22 @@
|
|||||||
package forge;
|
package forge.card.abilityFactory;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import forge.AllZone;
|
||||||
|
import forge.AllZoneUtil;
|
||||||
|
import forge.Card;
|
||||||
|
import forge.CardList;
|
||||||
|
import forge.ComputerUtil;
|
||||||
|
import forge.Constant;
|
||||||
|
import forge.Player;
|
||||||
|
import forge.card.cardFactory.CardFactoryUtil;
|
||||||
|
import forge.card.spellability.Ability_Activated;
|
||||||
|
import forge.card.spellability.Ability_Sub;
|
||||||
|
import forge.card.spellability.Spell;
|
||||||
|
import forge.card.spellability.SpellAbility;
|
||||||
|
import forge.card.spellability.Target;
|
||||||
|
|
||||||
public class AbilityFactory_Sacrifice {
|
public class AbilityFactory_Sacrifice {
|
||||||
//**************************************************************
|
//**************************************************************
|
||||||
// *************************** Sacrifice ***********************
|
// *************************** Sacrifice ***********************
|
||||||
@@ -1,8 +1,25 @@
|
|||||||
package forge;
|
package forge.card.abilityFactory;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
import forge.AllZone;
|
||||||
|
import forge.AllZoneUtil;
|
||||||
|
import forge.Card;
|
||||||
|
import forge.CardList;
|
||||||
|
import forge.Command;
|
||||||
|
import forge.ComputerUtil;
|
||||||
|
import forge.Player;
|
||||||
|
import forge.card.cardFactory.CardFactoryUtil;
|
||||||
|
import forge.card.spellability.Ability_Activated;
|
||||||
|
import forge.card.spellability.Ability_Sub;
|
||||||
|
import forge.card.spellability.Cost;
|
||||||
|
import forge.card.spellability.Spell;
|
||||||
|
import forge.card.spellability.SpellAbility;
|
||||||
|
import forge.card.spellability.Target;
|
||||||
|
import forge.card.trigger.Trigger;
|
||||||
|
import forge.card.trigger.TriggerHandler;
|
||||||
|
|
||||||
public class AbilityFactory_Token extends AbilityFactory {
|
public class AbilityFactory_Token extends AbilityFactory {
|
||||||
private AbilityFactory AF = null;
|
private AbilityFactory AF = null;
|
||||||
|
|
||||||
@@ -184,7 +201,7 @@ public class AbilityFactory_Token extends AbilityFactory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean tokenCanPlayAI(SpellAbility sa){
|
private boolean tokenCanPlayAI(SpellAbility sa){
|
||||||
Ability_Cost cost = sa.getPayCosts();
|
Cost cost = sa.getPayCosts();
|
||||||
if (!ComputerUtil.canPayCost(sa)) // If there is a cost payment it's usually not mandatory
|
if (!ComputerUtil.canPayCost(sa)) // If there is a cost payment it's usually not mandatory
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@@ -1,8 +1,19 @@
|
|||||||
package forge;
|
package forge.card.abilityFactory;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import forge.AllZone;
|
||||||
|
import forge.Card;
|
||||||
|
import forge.ComputerUtil;
|
||||||
|
import forge.Player;
|
||||||
|
import forge.card.cardFactory.CardFactoryUtil;
|
||||||
|
import forge.card.spellability.Ability_Activated;
|
||||||
|
import forge.card.spellability.Ability_Sub;
|
||||||
|
import forge.card.spellability.Spell;
|
||||||
|
import forge.card.spellability.SpellAbility;
|
||||||
|
import forge.card.spellability.Target;
|
||||||
|
|
||||||
public class AbilityFactory_Turns {
|
public class AbilityFactory_Turns {
|
||||||
// *************************************************************************
|
// *************************************************************************
|
||||||
// ************************* ADD TURN **************************************
|
// ************************* ADD TURN **************************************
|
||||||
@@ -1,9 +1,28 @@
|
|||||||
package forge;
|
package forge.card.abilityFactory;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
import forge.AllZone;
|
||||||
|
import forge.AllZoneUtil;
|
||||||
|
import forge.Card;
|
||||||
|
import forge.CardList;
|
||||||
|
import forge.CardListUtil;
|
||||||
|
import forge.CardUtil;
|
||||||
|
import forge.ComputerUtil;
|
||||||
|
import forge.Constant;
|
||||||
|
import forge.Counters;
|
||||||
|
import forge.GameActionUtil;
|
||||||
|
import forge.Player;
|
||||||
|
import forge.PlayerZone;
|
||||||
|
import forge.card.cardFactory.CardFactoryUtil;
|
||||||
|
import forge.card.spellability.Ability_Activated;
|
||||||
|
import forge.card.spellability.Ability_Sub;
|
||||||
|
import forge.card.spellability.Cost;
|
||||||
|
import forge.card.spellability.Spell;
|
||||||
|
import forge.card.spellability.SpellAbility;
|
||||||
|
import forge.card.spellability.Target;
|
||||||
import forge.gui.GuiUtils;
|
import forge.gui.GuiUtils;
|
||||||
|
|
||||||
public class AbilityFactory_ZoneAffecting {
|
public class AbilityFactory_ZoneAffecting {
|
||||||
@@ -144,7 +163,7 @@ public class AbilityFactory_ZoneAffecting {
|
|||||||
|
|
||||||
Target tgt = af.getAbTgt();
|
Target tgt = af.getAbTgt();
|
||||||
Card source = sa.getSourceCard();
|
Card source = sa.getSourceCard();
|
||||||
Ability_Cost abCost = af.getAbCost();
|
Cost abCost = af.getAbCost();
|
||||||
|
|
||||||
if (abCost != null){
|
if (abCost != null){
|
||||||
// AI currently disabled for these costs
|
// AI currently disabled for these costs
|
||||||
@@ -498,7 +517,7 @@ public class AbilityFactory_ZoneAffecting {
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
Card source = sa.getSourceCard();
|
Card source = sa.getSourceCard();
|
||||||
Ability_Cost abCost = af.getAbCost();
|
Cost abCost = af.getAbCost();
|
||||||
|
|
||||||
if (abCost != null){
|
if (abCost != null){
|
||||||
// AI currently disabled for these costs
|
// AI currently disabled for these costs
|
||||||
@@ -929,7 +948,7 @@ public class AbilityFactory_ZoneAffecting {
|
|||||||
|
|
||||||
Target tgt = af.getAbTgt();
|
Target tgt = af.getAbTgt();
|
||||||
Card source = sa.getSourceCard();
|
Card source = sa.getSourceCard();
|
||||||
Ability_Cost abCost = af.getAbCost();
|
Cost abCost = af.getAbCost();
|
||||||
|
|
||||||
if (abCost != null){
|
if (abCost != null){
|
||||||
// AI currently disabled for these costs
|
// AI currently disabled for these costs
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package forge;
|
package forge.card.cardFactory;
|
||||||
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@@ -13,8 +13,40 @@ import javax.swing.JOptionPane;
|
|||||||
|
|
||||||
import com.esotericsoftware.minlog.Log;
|
import com.esotericsoftware.minlog.Log;
|
||||||
|
|
||||||
|
import forge.AllZone;
|
||||||
|
import forge.AllZoneUtil;
|
||||||
|
import forge.ButtonUtil;
|
||||||
|
import forge.Card;
|
||||||
|
import forge.CardList;
|
||||||
|
import forge.CardListFilter;
|
||||||
|
import forge.CardListUtil;
|
||||||
|
import forge.CardUtil;
|
||||||
|
import forge.Command;
|
||||||
|
import forge.ComputerAI_counterSpells2;
|
||||||
|
import forge.ComputerUtil;
|
||||||
|
import forge.Constant;
|
||||||
|
import forge.Counters;
|
||||||
|
import forge.FileUtil;
|
||||||
|
import forge.GameActionUtil;
|
||||||
|
import forge.HandSizeOp;
|
||||||
|
import forge.Player;
|
||||||
|
import forge.PlayerZone;
|
||||||
|
import forge.ReadCard;
|
||||||
|
import forge.card.abilityFactory.AbilityFactory;
|
||||||
|
import forge.card.mana.ManaCost;
|
||||||
|
import forge.card.spellability.Ability;
|
||||||
|
import forge.card.spellability.Ability_Activated;
|
||||||
|
import forge.card.spellability.Ability_Mana;
|
||||||
|
import forge.card.spellability.Ability_Static;
|
||||||
|
import forge.card.spellability.Cost;
|
||||||
|
import forge.card.spellability.Spell;
|
||||||
|
import forge.card.spellability.SpellAbility;
|
||||||
|
import forge.card.spellability.Spell_Permanent;
|
||||||
|
import forge.card.spellability.Target;
|
||||||
import forge.error.ErrorViewer;
|
import forge.error.ErrorViewer;
|
||||||
import forge.gui.GuiUtils;
|
import forge.gui.GuiUtils;
|
||||||
|
import forge.gui.input.Input;
|
||||||
|
import forge.gui.input.Input_PayManaCostUtil;
|
||||||
import forge.properties.ForgeProps;
|
import forge.properties.ForgeProps;
|
||||||
import forge.properties.NewConstants;
|
import forge.properties.NewConstants;
|
||||||
|
|
||||||
@@ -188,7 +220,7 @@ public class CardFactory implements NewConstants {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
final void copySpellontoStack(Card source, Card original, SpellAbility sa, boolean bCopyDetails) {
|
public final void copySpellontoStack(Card source, Card original, SpellAbility sa, boolean bCopyDetails) {
|
||||||
if (sa.getPayCosts() == null){
|
if (sa.getPayCosts() == null){
|
||||||
copySpellontoStack(source, source, bCopyDetails);
|
copySpellontoStack(source, source, bCopyDetails);
|
||||||
return;
|
return;
|
||||||
@@ -227,7 +259,7 @@ public class CardFactory implements NewConstants {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
final void copySpellontoStack(Card source, Card original, boolean bCopyDetails) {
|
public final void copySpellontoStack(Card source, Card original, boolean bCopyDetails) {
|
||||||
SpellAbility[] sas = original.getSpellAbility();
|
SpellAbility[] sas = original.getSpellAbility();
|
||||||
SpellAbility sa = null;
|
SpellAbility sa = null;
|
||||||
for(int i = 0; i < sas.length; i++) {
|
for(int i = 0; i < sas.length; i++) {
|
||||||
@@ -313,7 +345,7 @@ public class CardFactory implements NewConstants {
|
|||||||
return getCard2(cardName, owner);
|
return getCard2(cardName, owner);
|
||||||
}
|
}
|
||||||
|
|
||||||
final static int hasKeyword(Card c, String k) {
|
public final static int hasKeyword(Card c, String k) {
|
||||||
ArrayList<String> a = c.getKeyword();
|
ArrayList<String> a = c.getKeyword();
|
||||||
for(int i = 0; i < a.size(); i++)
|
for(int i = 0; i < a.size(); i++)
|
||||||
if(a.get(i).toString().startsWith(k)) return i;
|
if(a.get(i).toString().startsWith(k)) return i;
|
||||||
@@ -4686,8 +4718,8 @@ public class CardFactory implements NewConstants {
|
|||||||
{
|
{
|
||||||
SpellAbility bbSA = sa.copy();
|
SpellAbility bbSA = sa.copy();
|
||||||
String newCost = CardUtil.addManaCosts(card.getManaCost(), bbCost);
|
String newCost = CardUtil.addManaCosts(card.getManaCost(), bbCost);
|
||||||
if (bbSA.payCosts != null)
|
if (bbSA.getPayCosts() != null)
|
||||||
bbSA.payCosts = new Ability_Cost(newCost, sa.getSourceCard().getName(), false); // create new abCost
|
bbSA.setPayCosts(new Cost(newCost, sa.getSourceCard().getName(), false)); // create new abCost
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append("Buyback ").append(bbCost).append(" (You may pay an additional ").append(bbCost);
|
sb.append("Buyback ").append(bbCost).append(" (You may pay an additional ").append(bbCost);
|
||||||
sb.append(" as you cast this spell. If you do, put this card into your hand as it resolves.)");
|
sb.append(" as you cast this spell. If you do, put this card into your hand as it resolves.)");
|
||||||
@@ -4852,7 +4884,7 @@ public class CardFactory implements NewConstants {
|
|||||||
final String col = color;
|
final String col = color;
|
||||||
//card.setChosenType(input[0]);
|
//card.setChosenType(input[0]);
|
||||||
|
|
||||||
Ability_Cost a1Cost = new Ability_Cost("3 T", cardName, true);
|
Cost a1Cost = new Cost("3 T", cardName, true);
|
||||||
final Ability_Activated a1 = new Ability_Activated(card, a1Cost, null) {
|
final Ability_Activated a1 = new Ability_Activated(card, a1Cost, null) {
|
||||||
|
|
||||||
private static final long serialVersionUID = -2114111483117171609L;
|
private static final long serialVersionUID = -2114111483117171609L;
|
||||||
@@ -4972,7 +5004,7 @@ public class CardFactory implements NewConstants {
|
|||||||
|
|
||||||
//*************** START *********** START **************************
|
//*************** START *********** START **************************
|
||||||
else if(cardName.equals("That Which Was Taken")) {
|
else if(cardName.equals("That Which Was Taken")) {
|
||||||
Ability_Cost abCost = new Ability_Cost("4 T", cardName, true);
|
Cost abCost = new Cost("4 T", cardName, true);
|
||||||
Target target = new Target(card,"Select target permanent other than "+cardName, new String[] {"Permanent.Other"});
|
Target target = new Target(card,"Select target permanent other than "+cardName, new String[] {"Permanent.Other"});
|
||||||
final Ability_Activated ability = new Ability_Activated(card, abCost, target) {
|
final Ability_Activated ability = new Ability_Activated(card, abCost, target) {
|
||||||
private static final long serialVersionUID = -8996435083734446340L;
|
private static final long serialVersionUID = -8996435083734446340L;
|
||||||
@@ -5373,7 +5405,7 @@ public class CardFactory implements NewConstants {
|
|||||||
//*************** START *********** START **************************
|
//*************** START *********** START **************************
|
||||||
else if(cardName.equals("Volrath's Dungeon")) {
|
else if(cardName.equals("Volrath's Dungeon")) {
|
||||||
|
|
||||||
Ability_Cost dungeonCost = new Ability_Cost("Discard<1/Card>", cardName, true);
|
Cost dungeonCost = new Cost("Discard<1/Card>", cardName, true);
|
||||||
Target dungeonTgt = new Target(card,"Volrath's Dungeon - Target player" , "player".split(","));
|
Target dungeonTgt = new Target(card,"Volrath's Dungeon - Target player" , "player".split(","));
|
||||||
|
|
||||||
final SpellAbility dungeon = new Ability_Activated(card, dungeonCost, dungeonTgt){
|
final SpellAbility dungeon = new Ability_Activated(card, dungeonCost, dungeonTgt){
|
||||||
@@ -5410,7 +5442,7 @@ public class CardFactory implements NewConstants {
|
|||||||
};//SpellAbility dungeon
|
};//SpellAbility dungeon
|
||||||
|
|
||||||
|
|
||||||
Ability_Cost bailCost = new Ability_Cost("PayLife<5>", cardName, true);
|
Cost bailCost = new Cost("PayLife<5>", cardName, true);
|
||||||
final SpellAbility bail = new Ability_Activated(card, bailCost, null){
|
final SpellAbility bail = new Ability_Activated(card, bailCost, null){
|
||||||
private static final long serialVersionUID = -8990402917139817175L;
|
private static final long serialVersionUID = -8990402917139817175L;
|
||||||
|
|
||||||
@@ -5547,7 +5579,7 @@ public class CardFactory implements NewConstants {
|
|||||||
else if(cardName.equals("Ashnod's Transmogrant")) {
|
else if(cardName.equals("Ashnod's Transmogrant")) {
|
||||||
final String[] Tgts = { "Creature.nonArtifact" };
|
final String[] Tgts = { "Creature.nonArtifact" };
|
||||||
|
|
||||||
Ability_Cost abCost = new Ability_Cost("T Sac<1/CARDNAME>", cardName, true);
|
Cost abCost = new Cost("T Sac<1/CARDNAME>", cardName, true);
|
||||||
Target abTgt = new Target(card,"Select target nonartifact creature to Transmogrify", Tgts);
|
Target abTgt = new Target(card,"Select target nonartifact creature to Transmogrify", Tgts);
|
||||||
|
|
||||||
final Ability_Activated ability = new Ability_Activated(card, abCost, abTgt){
|
final Ability_Activated ability = new Ability_Activated(card, abCost, abTgt){
|
||||||
@@ -5592,7 +5624,7 @@ public class CardFactory implements NewConstants {
|
|||||||
//*************** START *********** START **************************
|
//*************** START *********** START **************************
|
||||||
else if(cardName.equals("Door to Nothingness")) {
|
else if(cardName.equals("Door to Nothingness")) {
|
||||||
Target target = new Target(card,"Select target player", new String[] {"Player"});
|
Target target = new Target(card,"Select target player", new String[] {"Player"});
|
||||||
Ability_Cost abCost = new Ability_Cost("G G R R B B U U W W T Sac<1/CARDNAME>", cardName, true);
|
Cost abCost = new Cost("G G R R B B U U W W T Sac<1/CARDNAME>", cardName, true);
|
||||||
Ability_Activated ab1 = new Ability_Activated(card, abCost, target) {
|
Ability_Activated ab1 = new Ability_Activated(card, abCost, target) {
|
||||||
|
|
||||||
private static final long serialVersionUID = 6665327569823149191L;
|
private static final long serialVersionUID = 6665327569823149191L;
|
||||||
@@ -5653,7 +5685,7 @@ public class CardFactory implements NewConstants {
|
|||||||
|
|
||||||
//*************** START *********** START **************************
|
//*************** START *********** START **************************
|
||||||
else if(cardName.equals("Goblin Charbelcher")) {
|
else if(cardName.equals("Goblin Charbelcher")) {
|
||||||
Ability_Cost abCost = new Ability_Cost("3 T", cardName, true);
|
Cost abCost = new Cost("3 T", cardName, true);
|
||||||
final Ability_Activated ability = new Ability_Activated(card, abCost, new Target(card,"TgtCP")) {
|
final Ability_Activated ability = new Ability_Activated(card, abCost, new Target(card,"TgtCP")) {
|
||||||
private static final long serialVersionUID = -840041589720758423L;
|
private static final long serialVersionUID = -840041589720758423L;
|
||||||
|
|
||||||
@@ -5757,7 +5789,7 @@ public class CardFactory implements NewConstants {
|
|||||||
//*************** START *********** START **************************
|
//*************** START *********** START **************************
|
||||||
else if(cardName.equals("Isochron Scepter"))
|
else if(cardName.equals("Isochron Scepter"))
|
||||||
{
|
{
|
||||||
Ability_Cost abCost = new Ability_Cost("2 T", cardName, true);
|
Cost abCost = new Cost("2 T", cardName, true);
|
||||||
final Ability_Activated freeCast = new Ability_Activated(card, abCost, null)
|
final Ability_Activated freeCast = new Ability_Activated(card, abCost, null)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -5906,7 +5938,7 @@ public class CardFactory implements NewConstants {
|
|||||||
* put a 5/5 colorless Djinn artifact creature token with flying
|
* put a 5/5 colorless Djinn artifact creature token with flying
|
||||||
* onto the battlefield.
|
* onto the battlefield.
|
||||||
*/
|
*/
|
||||||
Ability_Cost abCost = new Ability_Cost("1 Sac<1/CARDNAME>", cardName, true);
|
Cost abCost = new Cost("1 Sac<1/CARDNAME>", cardName, true);
|
||||||
final SpellAbility ability = new Ability_Activated(card, abCost, null) {
|
final SpellAbility ability = new Ability_Activated(card, abCost, null) {
|
||||||
private static final long serialVersionUID = -5741302550353410000L;
|
private static final long serialVersionUID = -5741302550353410000L;
|
||||||
|
|
||||||
@@ -5948,7 +5980,7 @@ public class CardFactory implements NewConstants {
|
|||||||
* turn's upkeep.
|
* turn's upkeep.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Ability_Cost abCost = new Ability_Cost("1 T Sac<1/CARDNAME>", cardName, true);
|
Cost abCost = new Cost("1 T Sac<1/CARDNAME>", cardName, true);
|
||||||
Target target = new Target(card,"Select target player", new String[]{"Player"});
|
Target target = new Target(card,"Select target player", new String[]{"Player"});
|
||||||
final Ability_Activated ability = new Ability_Activated(card, abCost, target) {
|
final Ability_Activated ability = new Ability_Activated(card, abCost, target) {
|
||||||
private static final long serialVersionUID = -6711849408085138636L;
|
private static final long serialVersionUID = -6711849408085138636L;
|
||||||
@@ -6015,7 +6047,7 @@ public class CardFactory implements NewConstants {
|
|||||||
//*************** START *********** START **************************
|
//*************** START *********** START **************************
|
||||||
else if(cardName.equals("Grindstone")) {
|
else if(cardName.equals("Grindstone")) {
|
||||||
Target target = new Target(card,"Select target player", new String[] {"Player"});
|
Target target = new Target(card,"Select target player", new String[] {"Player"});
|
||||||
Ability_Cost abCost = new Ability_Cost("3 T", cardName, true);
|
Cost abCost = new Cost("3 T", cardName, true);
|
||||||
Ability_Activated ab1 = new Ability_Activated(card, abCost, target) {
|
Ability_Activated ab1 = new Ability_Activated(card, abCost, target) {
|
||||||
private static final long serialVersionUID = -6281219446216L;
|
private static final long serialVersionUID = -6281219446216L;
|
||||||
|
|
||||||
@@ -6071,7 +6103,7 @@ public class CardFactory implements NewConstants {
|
|||||||
* cards in that player's graveyard.
|
* cards in that player's graveyard.
|
||||||
*/
|
*/
|
||||||
Target target = new Target(card,"Select target player", new String[] {"Player"});
|
Target target = new Target(card,"Select target player", new String[] {"Player"});
|
||||||
Ability_Cost abCost = new Ability_Cost("5 T", cardName, true);
|
Cost abCost = new Cost("5 T", cardName, true);
|
||||||
Ability_Activated ab1 = new Ability_Activated(card, abCost, target) {
|
Ability_Activated ab1 = new Ability_Activated(card, abCost, target) {
|
||||||
private static final long serialVersionUID = -6282104343089446216L;
|
private static final long serialVersionUID = -6282104343089446216L;
|
||||||
|
|
||||||
@@ -6102,7 +6134,7 @@ public class CardFactory implements NewConstants {
|
|||||||
//*************** START *********** START **************************
|
//*************** START *********** START **************************
|
||||||
else if(cardName.equals("Glasses of Urza")) {
|
else if(cardName.equals("Glasses of Urza")) {
|
||||||
Target target = new Target(card,"Select target player", new String[] {"Player"});
|
Target target = new Target(card,"Select target player", new String[] {"Player"});
|
||||||
Ability_Cost abCost = new Ability_Cost("T", cardName, true);
|
Cost abCost = new Cost("T", cardName, true);
|
||||||
final Ability_Activated ability = new Ability_Activated(card, abCost, target) {
|
final Ability_Activated ability = new Ability_Activated(card, abCost, target) {
|
||||||
private static final long serialVersionUID = -3857979945891501990L;
|
private static final long serialVersionUID = -3857979945891501990L;
|
||||||
|
|
||||||
@@ -6235,7 +6267,7 @@ public class CardFactory implements NewConstants {
|
|||||||
* Tap, Sacrifice Tormod's Crypt: Exile all cards from target player's graveyard.
|
* Tap, Sacrifice Tormod's Crypt: Exile all cards from target player's graveyard.
|
||||||
*/
|
*/
|
||||||
Target target = new Target(card,"Select target player", new String[] {"Player"});
|
Target target = new Target(card,"Select target player", new String[] {"Player"});
|
||||||
Ability_Cost abCost = new Ability_Cost("T Sac<1/CARDNAME>", cardName, true);
|
Cost abCost = new Cost("T Sac<1/CARDNAME>", cardName, true);
|
||||||
final Ability_Activated ability = new Ability_Activated(card, abCost, target) {
|
final Ability_Activated ability = new Ability_Activated(card, abCost, target) {
|
||||||
|
|
||||||
private static final long serialVersionUID = -8877371657709894494L;
|
private static final long serialVersionUID = -8877371657709894494L;
|
||||||
@@ -6274,7 +6306,7 @@ public class CardFactory implements NewConstants {
|
|||||||
* Tap, Sacrifice Mirror Universe: Exchange life totals with
|
* Tap, Sacrifice Mirror Universe: Exchange life totals with
|
||||||
* target opponent. Activate this ability only during your upkeep.
|
* target opponent. Activate this ability only during your upkeep.
|
||||||
*/
|
*/
|
||||||
Ability_Cost abCost = new Ability_Cost("T Sac<1/CARDNAME>", cardName, true);
|
Cost abCost = new Cost("T Sac<1/CARDNAME>", cardName, true);
|
||||||
final Ability_Activated ability = new Ability_Activated(card, abCost, null) {
|
final Ability_Activated ability = new Ability_Activated(card, abCost, null) {
|
||||||
private static final long serialVersionUID = -1409850598108909739L;
|
private static final long serialVersionUID = -1409850598108909739L;
|
||||||
|
|
||||||
@@ -6358,7 +6390,7 @@ public class CardFactory implements NewConstants {
|
|||||||
final String Tgts[] = {"Creature"};
|
final String Tgts[] = {"Creature"};
|
||||||
Target target= new Target(card,"Select target creature.", Tgts, "1", "1");
|
Target target= new Target(card,"Select target creature.", Tgts, "1", "1");
|
||||||
|
|
||||||
final Ability_Cost cost = new Ability_Cost("3", card.getName(), true);
|
final Cost cost = new Cost("3", card.getName(), true);
|
||||||
|
|
||||||
final SpellAbility ability = new Ability_Activated(card, cost, target) {
|
final SpellAbility ability = new Ability_Activated(card, cost, target) {
|
||||||
private static final long serialVersionUID = 8941566961041310961L;
|
private static final long serialVersionUID = 8941566961041310961L;
|
||||||
@@ -6418,7 +6450,7 @@ public class CardFactory implements NewConstants {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
abMana.undoable = false;
|
abMana.setUndoable(false);
|
||||||
|
|
||||||
final Ability addMana = new Ability(card, "0", desc.toString()) {
|
final Ability addMana = new Ability(card, "0", desc.toString()) {
|
||||||
private static final long serialVersionUID = -5356224416791741957L;
|
private static final long serialVersionUID = -5356224416791741957L;
|
||||||
@@ -6480,7 +6512,7 @@ public class CardFactory implements NewConstants {
|
|||||||
* 2, Tap: Flip a coin. If you win the flip, sacrifice Sorcerer's
|
* 2, Tap: Flip a coin. If you win the flip, sacrifice Sorcerer's
|
||||||
* Strongbox and draw three cards.
|
* Strongbox and draw three cards.
|
||||||
*/
|
*/
|
||||||
Ability_Cost abCost = new Ability_Cost("2 T", cardName, true);
|
Cost abCost = new Cost("2 T", cardName, true);
|
||||||
final SpellAbility ability = new Ability_Activated(card, abCost, null) {
|
final SpellAbility ability = new Ability_Activated(card, abCost, null) {
|
||||||
private static final long serialVersionUID = 5152381570537520053L;
|
private static final long serialVersionUID = 5152381570537520053L;
|
||||||
|
|
||||||
@@ -6515,7 +6547,7 @@ public class CardFactory implements NewConstants {
|
|||||||
* to the number of time counters on it to each creature and
|
* to the number of time counters on it to each creature and
|
||||||
* each player.
|
* each player.
|
||||||
*/
|
*/
|
||||||
Ability_Cost abCost = new Ability_Cost("1 T Sac<1/CARDNAME>", cardName, true);
|
Cost abCost = new Cost("1 T Sac<1/CARDNAME>", cardName, true);
|
||||||
final Ability_Activated ability = new Ability_Activated(card, abCost, null) {
|
final Ability_Activated ability = new Ability_Activated(card, abCost, null) {
|
||||||
private static final long serialVersionUID = 7550743617522146304L;
|
private static final long serialVersionUID = 7550743617522146304L;
|
||||||
|
|
||||||
@@ -6683,7 +6715,7 @@ public class CardFactory implements NewConstants {
|
|||||||
|
|
||||||
//*************** START *********** START **************************
|
//*************** START *********** START **************************
|
||||||
else if(cardName.equals("Scroll Rack")) {
|
else if(cardName.equals("Scroll Rack")) {
|
||||||
Ability_Cost abCost = new Ability_Cost("1 T", cardName, true);
|
Cost abCost = new Cost("1 T", cardName, true);
|
||||||
final Ability_Activated ability = new Ability_Activated(card, abCost, null) {
|
final Ability_Activated ability = new Ability_Activated(card, abCost, null) {
|
||||||
private static final long serialVersionUID = -5588587187720068547L;
|
private static final long serialVersionUID = -5588587187720068547L;
|
||||||
|
|
||||||
@@ -6759,7 +6791,7 @@ public class CardFactory implements NewConstants {
|
|||||||
* 3, Tap: Name a card. Reveal a card at random from your hand. If it's the named card,
|
* 3, Tap: Name a card. Reveal a card at random from your hand. If it's the named card,
|
||||||
* Cursed Scroll deals 2 damage to target creature or player.
|
* Cursed Scroll deals 2 damage to target creature or player.
|
||||||
*/
|
*/
|
||||||
Ability_Cost abCost = new Ability_Cost("3 T", cardName, true);
|
Cost abCost = new Cost("3 T", cardName, true);
|
||||||
final Ability_Activated ability = new Ability_Activated(card, abCost, new Target(card,"TgtCP")) {
|
final Ability_Activated ability = new Ability_Activated(card, abCost, new Target(card,"TgtCP")) {
|
||||||
private static final long serialVersionUID = 7550743617522146304L;
|
private static final long serialVersionUID = 7550743617522146304L;
|
||||||
|
|
||||||
@@ -6862,7 +6894,7 @@ public class CardFactory implements NewConstants {
|
|||||||
freeCast.setDescription("Play the previously revealed top card of your library for free.");
|
freeCast.setDescription("Play the previously revealed top card of your library for free.");
|
||||||
freeCast.setStackDescription(cardName+" - play card without paying its mana cost.");
|
freeCast.setStackDescription(cardName+" - play card without paying its mana cost.");
|
||||||
|
|
||||||
Ability_Cost abCost = new Ability_Cost("5 T", cardName, true);
|
Cost abCost = new Cost("5 T", cardName, true);
|
||||||
final Ability_Activated ability = new Ability_Activated(card, abCost, null) {
|
final Ability_Activated ability = new Ability_Activated(card, abCost, null) {
|
||||||
private static final long serialVersionUID = -7328518969488588777L;
|
private static final long serialVersionUID = -7328518969488588777L;
|
||||||
|
|
||||||
@@ -7366,8 +7398,8 @@ public class CardFactory implements NewConstants {
|
|||||||
{
|
{
|
||||||
SpellAbility altCostSA = sa.copy();
|
SpellAbility altCostSA = sa.copy();
|
||||||
|
|
||||||
Ability_Cost abCost = new Ability_Cost(altCost, card.getName(), altCostSA.isAbility());
|
Cost abCost = new Cost(altCost, card.getName(), altCostSA.isAbility());
|
||||||
altCostSA.payCosts = abCost;
|
altCostSA.setPayCosts(abCost);
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package forge;
|
package forge.card.cardFactory;
|
||||||
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -11,7 +11,39 @@ import java.util.Map.Entry;
|
|||||||
|
|
||||||
import com.esotericsoftware.minlog.Log;
|
import com.esotericsoftware.minlog.Log;
|
||||||
|
|
||||||
|
import forge.AllZone;
|
||||||
|
import forge.AllZoneUtil;
|
||||||
|
import forge.ButtonUtil;
|
||||||
|
import forge.Card;
|
||||||
|
import forge.CardList;
|
||||||
|
import forge.CardListFilter;
|
||||||
|
import forge.CardListUtil;
|
||||||
|
import forge.CardUtil;
|
||||||
|
import forge.Card_Color;
|
||||||
|
import forge.Combat;
|
||||||
|
import forge.CombatUtil;
|
||||||
|
import forge.Command;
|
||||||
|
import forge.CommandArgs;
|
||||||
|
import forge.ComputerUtil;
|
||||||
|
import forge.Constant;
|
||||||
|
import forge.Counters;
|
||||||
|
import forge.GameAction;
|
||||||
|
import forge.GameActionUtil;
|
||||||
|
import forge.Phase;
|
||||||
|
import forge.Player;
|
||||||
|
import forge.PlayerZone;
|
||||||
|
import forge.card.spellability.Ability;
|
||||||
|
import forge.card.spellability.Ability_Activated;
|
||||||
|
import forge.card.spellability.Ability_Mana;
|
||||||
|
import forge.card.spellability.Ability_Static;
|
||||||
|
import forge.card.spellability.Cost;
|
||||||
|
import forge.card.spellability.Spell;
|
||||||
|
import forge.card.spellability.SpellAbility;
|
||||||
|
import forge.card.spellability.SpellAbility_Restriction;
|
||||||
|
import forge.card.spellability.Target;
|
||||||
import forge.gui.GuiUtils;
|
import forge.gui.GuiUtils;
|
||||||
|
import forge.gui.input.Input;
|
||||||
|
import forge.gui.input.Input_PayManaCost;
|
||||||
|
|
||||||
|
|
||||||
public class CardFactoryUtil {
|
public class CardFactoryUtil {
|
||||||
@@ -825,7 +857,7 @@ public class CardFactoryUtil {
|
|||||||
|
|
||||||
|
|
||||||
public static SpellAbility ability_Untap(final Card sourceCard, String cost) {
|
public static SpellAbility ability_Untap(final Card sourceCard, String cost) {
|
||||||
Ability_Cost abCost = new Ability_Cost(cost, sourceCard.getName(), true);
|
Cost abCost = new Cost(cost, sourceCard.getName(), true);
|
||||||
final SpellAbility a1 = new Ability_Activated(sourceCard, abCost, null) {
|
final SpellAbility a1 = new Ability_Activated(sourceCard, abCost, null) {
|
||||||
private static final long serialVersionUID = -8604400186962948654L;
|
private static final long serialVersionUID = -8604400186962948654L;
|
||||||
|
|
||||||
@@ -851,7 +883,7 @@ public class CardFactoryUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static SpellAbility ability_Flashback(final Card sourceCard, String cost) {
|
public static SpellAbility ability_Flashback(final Card sourceCard, String cost) {
|
||||||
Ability_Cost fbCost = new Ability_Cost(cost,sourceCard.getName(),true);
|
Cost fbCost = new Cost(cost,sourceCard.getName(),true);
|
||||||
final SpellAbility flashback = new Spell(sourceCard) {
|
final SpellAbility flashback = new Spell(sourceCard) {
|
||||||
|
|
||||||
private static final long serialVersionUID = -4196027546564209412L;
|
private static final long serialVersionUID = -4196027546564209412L;
|
||||||
@@ -884,7 +916,7 @@ public class CardFactoryUtil {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
flashback.payCosts = fbCost;
|
flashback.setPayCosts(fbCost);
|
||||||
|
|
||||||
String costString = fbCost.toString().replace(":", ".");
|
String costString = fbCost.toString().replace(":", ".");
|
||||||
|
|
||||||
@@ -903,7 +935,7 @@ public class CardFactoryUtil {
|
|||||||
|
|
||||||
public static Ability_Activated ability_Unearth(final Card sourceCard, String manaCost) {
|
public static Ability_Activated ability_Unearth(final Card sourceCard, String manaCost) {
|
||||||
|
|
||||||
Ability_Cost cost = new Ability_Cost(manaCost, sourceCard.getName(), true);
|
Cost cost = new Cost(manaCost, sourceCard.getName(), true);
|
||||||
final Ability_Activated unearth = new Ability_Activated(sourceCard, cost, null) {
|
final Ability_Activated unearth = new Ability_Activated(sourceCard, cost, null) {
|
||||||
private static final long serialVersionUID = -5633945565395478009L;
|
private static final long serialVersionUID = -5633945565395478009L;
|
||||||
|
|
||||||
@@ -1054,7 +1086,7 @@ public class CardFactoryUtil {
|
|||||||
public static SpellAbility ability_Merc_Search(final Card sourceCard, String cost) {
|
public static SpellAbility ability_Merc_Search(final Card sourceCard, String cost) {
|
||||||
final int intCost = Integer.parseInt(cost);
|
final int intCost = Integer.parseInt(cost);
|
||||||
|
|
||||||
final Ability_Cost abCost = new Ability_Cost("T", sourceCard.getName(), true);
|
final Cost abCost = new Cost("T", sourceCard.getName(), true);
|
||||||
abCost.setMana(cost);
|
abCost.setMana(cost);
|
||||||
final SpellAbility ability = new Ability_Activated(sourceCard, abCost, null){
|
final SpellAbility ability = new Ability_Activated(sourceCard, abCost, null){
|
||||||
private static final long serialVersionUID = 4988299801575232348L;
|
private static final long serialVersionUID = 4988299801575232348L;
|
||||||
@@ -1143,7 +1175,7 @@ public class CardFactoryUtil {
|
|||||||
public static SpellAbility ability_Rebel_Search(final Card sourceCard, String cost) {
|
public static SpellAbility ability_Rebel_Search(final Card sourceCard, String cost) {
|
||||||
final int converted = Integer.parseInt(cost) - 1;
|
final int converted = Integer.parseInt(cost) - 1;
|
||||||
|
|
||||||
final Ability_Cost abCost = new Ability_Cost("T", sourceCard.getName(), true);
|
final Cost abCost = new Cost("T", sourceCard.getName(), true);
|
||||||
abCost.setMana(cost);
|
abCost.setMana(cost);
|
||||||
final SpellAbility ability = new Ability_Activated(sourceCard, abCost, null){
|
final SpellAbility ability = new Ability_Activated(sourceCard, abCost, null){
|
||||||
private static final long serialVersionUID = 7219065355049285681L;
|
private static final long serialVersionUID = 7219065355049285681L;
|
||||||
@@ -1197,7 +1229,6 @@ public class CardFactoryUtil {
|
|||||||
CardList rebels = new CardList();
|
CardList rebels = new CardList();
|
||||||
CardList list = new CardList(lib.getCards());
|
CardList list = new CardList(lib.getCards());
|
||||||
list = list.getType("Rebel");
|
list = list.getType("Rebel");
|
||||||
list = list.getPermanents();
|
|
||||||
|
|
||||||
if(list.size() == 0) return;
|
if(list.size() == 0) return;
|
||||||
|
|
||||||
@@ -1254,7 +1285,7 @@ public class CardFactoryUtil {
|
|||||||
|
|
||||||
public static SpellAbility ability_cycle(final Card sourceCard, String cycleCost) {
|
public static SpellAbility ability_cycle(final Card sourceCard, String cycleCost) {
|
||||||
cycleCost += " Discard<1/CARDNAME>";
|
cycleCost += " Discard<1/CARDNAME>";
|
||||||
Ability_Cost abCost = new Ability_Cost(cycleCost, sourceCard.getName(), true);
|
Cost abCost = new Cost(cycleCost, sourceCard.getName(), true);
|
||||||
|
|
||||||
final SpellAbility cycle = new Ability_Activated(sourceCard, abCost, null) {
|
final SpellAbility cycle = new Ability_Activated(sourceCard, abCost, null) {
|
||||||
private static final long serialVersionUID = -4960704261761785512L;
|
private static final long serialVersionUID = -4960704261761785512L;
|
||||||
@@ -1343,7 +1374,7 @@ public class CardFactoryUtil {
|
|||||||
public static SpellAbility ability_typecycle(final Card sourceCard, String cycleCost, final String type) {
|
public static SpellAbility ability_typecycle(final Card sourceCard, String cycleCost, final String type) {
|
||||||
String description;
|
String description;
|
||||||
cycleCost += " Discard<1/CARDNAME>";
|
cycleCost += " Discard<1/CARDNAME>";
|
||||||
Ability_Cost abCost = new Ability_Cost(cycleCost, sourceCard.getName(), true);
|
Cost abCost = new Cost(cycleCost, sourceCard.getName(), true);
|
||||||
|
|
||||||
final SpellAbility cycle = new Ability_Activated(sourceCard, abCost, null) {
|
final SpellAbility cycle = new Ability_Activated(sourceCard, abCost, null) {
|
||||||
private static final long serialVersionUID = -4960704261761785512L;
|
private static final long serialVersionUID = -4960704261761785512L;
|
||||||
@@ -1421,7 +1452,7 @@ public class CardFactoryUtil {
|
|||||||
|
|
||||||
public static SpellAbility ability_transmute(final Card sourceCard, String transmuteCost) {
|
public static SpellAbility ability_transmute(final Card sourceCard, String transmuteCost) {
|
||||||
transmuteCost += " Discard<1/CARDNAME>";
|
transmuteCost += " Discard<1/CARDNAME>";
|
||||||
Ability_Cost abCost = new Ability_Cost(transmuteCost, sourceCard.getName(), true);
|
Cost abCost = new Cost(transmuteCost, sourceCard.getName(), true);
|
||||||
|
|
||||||
final SpellAbility transmute = new Ability_Activated(sourceCard, abCost, null) {
|
final SpellAbility transmute = new Ability_Activated(sourceCard, abCost, null) {
|
||||||
private static final long serialVersionUID = -4960704261761785512L;
|
private static final long serialVersionUID = -4960704261761785512L;
|
||||||
@@ -1523,7 +1554,7 @@ public class CardFactoryUtil {
|
|||||||
return suspend;
|
return suspend;
|
||||||
}//ability_suspend()
|
}//ability_suspend()
|
||||||
|
|
||||||
public static SpellAbility eqPump_Equip(final Card sourceCard, final int Power, final int Tough, final String[] extrinsicKeywords, final Ability_Cost abCost) {
|
public static SpellAbility eqPump_Equip(final Card sourceCard, final int Power, final int Tough, final String[] extrinsicKeywords, final Cost abCost) {
|
||||||
Target target = new Target(sourceCard, "Select target creature you control", "Creature.YouCtrl".split(","));
|
Target target = new Target(sourceCard, "Select target creature you control", "Creature.YouCtrl".split(","));
|
||||||
final SpellAbility equip = new Ability_Activated(sourceCard, abCost, target) {
|
final SpellAbility equip = new Ability_Activated(sourceCard, abCost, target) {
|
||||||
private static final long serialVersionUID = -4960704261761785512L;
|
private static final long serialVersionUID = -4960704261761785512L;
|
||||||
@@ -1631,7 +1662,7 @@ public class CardFactoryUtil {
|
|||||||
return equip;
|
return equip;
|
||||||
}//eqPump_Equip() ( was vanila_equip() )
|
}//eqPump_Equip() ( was vanila_equip() )
|
||||||
|
|
||||||
public static Command eqPump_onEquip(final Card sourceCard, final int Power, final int Tough, final String[] extrinsicKeywords, final Ability_Cost abCost) {
|
public static Command eqPump_onEquip(final Card sourceCard, final int Power, final int Tough, final String[] extrinsicKeywords, final Cost abCost) {
|
||||||
|
|
||||||
Command onEquip = new Command() {
|
Command onEquip = new Command() {
|
||||||
|
|
||||||
@@ -1657,7 +1688,7 @@ public class CardFactoryUtil {
|
|||||||
return onEquip;
|
return onEquip;
|
||||||
}//eqPump_onEquip ( was vanila_onequip() )
|
}//eqPump_onEquip ( was vanila_onequip() )
|
||||||
|
|
||||||
public static Command eqPump_unEquip(final Card sourceCard, final int Power, final int Tough, final String[] extrinsicKeywords, final Ability_Cost abCost) {
|
public static Command eqPump_unEquip(final Card sourceCard, final int Power, final int Tough, final String[] extrinsicKeywords, final Cost abCost) {
|
||||||
|
|
||||||
Command onUnEquip = new Command() {
|
Command onUnEquip = new Command() {
|
||||||
|
|
||||||
@@ -1984,7 +2015,7 @@ public class CardFactoryUtil {
|
|||||||
|
|
||||||
public static Ability_Mana getEldraziSpawnAbility(final Card c)
|
public static Ability_Mana getEldraziSpawnAbility(final Card c)
|
||||||
{
|
{
|
||||||
Ability_Cost cost = new Ability_Cost("Sac<1/CARDNAME>", c.getName(), true);
|
Cost cost = new Cost("Sac<1/CARDNAME>", c.getName(), true);
|
||||||
Ability_Mana mana = new Ability_Mana(c, cost, "1"){
|
Ability_Mana mana = new Ability_Mana(c, cost, "1"){
|
||||||
private static final long serialVersionUID = -2478676548112738019L;
|
private static final long serialVersionUID = -2478676548112738019L;
|
||||||
};
|
};
|
||||||
@@ -2495,14 +2526,14 @@ public class CardFactoryUtil {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void showMessage() {
|
public void showMessage() {
|
||||||
if(GameAction.MultiTarget_Cancelled == true) stop();
|
if(GameAction.isMultiTargetCancelled() == true) stop();
|
||||||
if(i == 0) AllZone.Display.showMessage("Select target creature or player: " + (i_max) + " more damage to deal");
|
if(i == 0) AllZone.Display.showMessage("Select target creature or player: " + (i_max) + " more damage to deal");
|
||||||
else AllZone.Display.showMessage("Select target creature or player: " + (i) + " more damage to deal");
|
else AllZone.Display.showMessage("Select target creature or player: " + (i) + " more damage to deal");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void selectButtonCancel() {
|
public void selectButtonCancel() {
|
||||||
GameAction.MultiTarget_Cancelled = true;
|
GameAction.setMultiTargetCancelled(true);
|
||||||
stop();
|
stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2534,14 +2565,14 @@ public class CardFactoryUtil {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void showMessage() {
|
public void showMessage() {
|
||||||
if(CombatUtil.Lorthos_Cancelled == true) stop();
|
if(CombatUtil.isLorthosCancelled() == true) stop();
|
||||||
AllZone.Display.showMessage("Select target Permanents for Lorthos: " + (i + 1) + " more to pick");
|
AllZone.Display.showMessage("Select target Permanents for Lorthos: " + (i + 1) + " more to pick");
|
||||||
ButtonUtil.enableOnlyCancel();
|
ButtonUtil.enableOnlyCancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void selectButtonCancel() {
|
public void selectButtonCancel() {
|
||||||
CombatUtil.Lorthos_Cancelled = true;
|
CombatUtil.setLorthosCancelled(true);
|
||||||
stop();
|
stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
package forge;
|
package forge.card.cardFactory;
|
||||||
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -8,7 +8,28 @@ import java.util.StringTokenizer;
|
|||||||
|
|
||||||
import com.esotericsoftware.minlog.Log;
|
import com.esotericsoftware.minlog.Log;
|
||||||
|
|
||||||
|
import forge.AllZone;
|
||||||
|
import forge.AllZoneUtil;
|
||||||
|
import forge.ButtonUtil;
|
||||||
|
import forge.Card;
|
||||||
|
import forge.CardList;
|
||||||
|
import forge.CardListFilter;
|
||||||
|
import forge.CardListUtil;
|
||||||
|
import forge.CardUtil;
|
||||||
|
import forge.Command;
|
||||||
|
import forge.Constant;
|
||||||
|
import forge.Player;
|
||||||
|
import forge.PlayerZone;
|
||||||
|
import forge.card.spellability.Ability;
|
||||||
|
import forge.card.spellability.Ability_Activated;
|
||||||
|
import forge.card.spellability.Ability_Mana;
|
||||||
|
import forge.card.spellability.Cost;
|
||||||
|
import forge.card.spellability.Spell;
|
||||||
|
import forge.card.spellability.SpellAbility;
|
||||||
|
import forge.card.spellability.Spell_Permanent;
|
||||||
|
import forge.card.spellability.Target;
|
||||||
import forge.gui.GuiUtils;
|
import forge.gui.GuiUtils;
|
||||||
|
import forge.gui.input.Input;
|
||||||
|
|
||||||
|
|
||||||
class CardFactory_Auras {
|
class CardFactory_Auras {
|
||||||
@@ -112,7 +133,7 @@ class CardFactory_Auras {
|
|||||||
card.clearSpellAbility();
|
card.clearSpellAbility();
|
||||||
card.addSpellAbility(spell);
|
card.addSpellAbility(spell);
|
||||||
|
|
||||||
Ability_Cost abCost = new Ability_Cost("W W T", spell.getTargetCard() != null ? spell.getTargetCard().getName(): "", true);
|
Cost abCost = new Cost("W W T", spell.getTargetCard() != null ? spell.getTargetCard().getName(): "", true);
|
||||||
final Ability_Activated produceCaribou = new Ability_Activated(spell.getTargetCard(), abCost, null) {
|
final Ability_Activated produceCaribou = new Ability_Activated(spell.getTargetCard(), abCost, null) {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1358032097310954750L;
|
private static final long serialVersionUID = 1358032097310954750L;
|
||||||
@@ -304,7 +325,7 @@ class CardFactory_Auras {
|
|||||||
card.clearSpellAbility();
|
card.clearSpellAbility();
|
||||||
card.addSpellAbility(spell);
|
card.addSpellAbility(spell);
|
||||||
|
|
||||||
Ability_Cost abCost = new Ability_Cost("G U T", spell.getTargetCard() != null ? spell.getTargetCard().getName(): "", true);
|
Cost abCost = new Cost("G U T", spell.getTargetCard() != null ? spell.getTargetCard().getName(): "", true);
|
||||||
final Ability_Activated produceDrakes = new Ability_Activated(spell.getTargetCard(), abCost, null) {
|
final Ability_Activated produceDrakes = new Ability_Activated(spell.getTargetCard(), abCost, null) {
|
||||||
|
|
||||||
private static final long serialVersionUID = -3849765771560556442L;
|
private static final long serialVersionUID = -3849765771560556442L;
|
||||||
@@ -1435,7 +1456,7 @@ class CardFactory_Auras {
|
|||||||
tgt.setZone(Constant.Zone.Graveyard);
|
tgt.setZone(Constant.Zone.Graveyard);
|
||||||
animate.setTarget(tgt);
|
animate.setTarget(tgt);
|
||||||
|
|
||||||
Ability_Cost cost = new Ability_Cost("1 B", cardName, false);
|
Cost cost = new Cost("1 B", cardName, false);
|
||||||
animate.setPayCosts(cost);
|
animate.setPayCosts(cost);
|
||||||
|
|
||||||
animate.getRestrictions().setActivateZone(Constant.Zone.Hand);
|
animate.getRestrictions().setActivateZone(Constant.Zone.Hand);
|
||||||
@@ -1533,7 +1554,7 @@ class CardFactory_Auras {
|
|||||||
costString = "5 U U";
|
costString = "5 U U";
|
||||||
else if(cardName.equals("Confiscate"))
|
else if(cardName.equals("Confiscate"))
|
||||||
costString = "4 U U";
|
costString = "4 U U";
|
||||||
Ability_Cost cost = new Ability_Cost(costString, cardName, false);
|
Cost cost = new Cost(costString, cardName, false);
|
||||||
Target tgt = new Target(card,"Select target Permanent", "Permanent".split(","));
|
Target tgt = new Target(card,"Select target Permanent", "Permanent".split(","));
|
||||||
|
|
||||||
final SpellAbility spell = new Spell(card, cost, tgt) {
|
final SpellAbility spell = new Spell(card, cost, tgt) {
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
package forge;
|
package forge.card.cardFactory;
|
||||||
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -13,7 +13,42 @@ import javax.swing.JOptionPane;
|
|||||||
|
|
||||||
import com.esotericsoftware.minlog.Log;
|
import com.esotericsoftware.minlog.Log;
|
||||||
|
|
||||||
|
import forge.AllZone;
|
||||||
|
import forge.AllZoneUtil;
|
||||||
|
import forge.ButtonUtil;
|
||||||
|
import forge.Card;
|
||||||
|
import forge.CardList;
|
||||||
|
import forge.CardListFilter;
|
||||||
|
import forge.CardListUtil;
|
||||||
|
import forge.CardUtil;
|
||||||
|
import forge.Combat;
|
||||||
|
import forge.Command;
|
||||||
|
import forge.CommandReturn;
|
||||||
|
import forge.ComputerUtil;
|
||||||
|
import forge.Constant;
|
||||||
|
import forge.Counters;
|
||||||
|
import forge.GameActionUtil;
|
||||||
|
import forge.MyRandom;
|
||||||
|
import forge.Player;
|
||||||
|
import forge.PlayerZone;
|
||||||
|
import forge.PlayerZone_ComesIntoPlay;
|
||||||
|
import forge.Phase;
|
||||||
|
import forge.card.spellability.Ability;
|
||||||
|
import forge.card.spellability.Ability_Activated;
|
||||||
|
import forge.card.spellability.Ability_Mana;
|
||||||
|
import forge.card.spellability.Ability_Static;
|
||||||
|
import forge.card.spellability.Ability_Sub;
|
||||||
|
import forge.card.spellability.Cost;
|
||||||
|
import forge.card.spellability.Spell;
|
||||||
|
import forge.card.spellability.SpellAbility;
|
||||||
|
import forge.card.spellability.Spell_Permanent;
|
||||||
|
import forge.card.spellability.Target;
|
||||||
|
import forge.card.trigger.Trigger;
|
||||||
|
import forge.card.trigger.TriggerHandler;
|
||||||
import forge.gui.GuiUtils;
|
import forge.gui.GuiUtils;
|
||||||
|
import forge.gui.input.Input;
|
||||||
|
import forge.gui.input.Input_PayManaCost;
|
||||||
|
import forge.gui.input.Input_PayManaCost_Ability;
|
||||||
|
|
||||||
public class CardFactory_Creatures {
|
public class CardFactory_Creatures {
|
||||||
|
|
||||||
@@ -63,7 +98,7 @@ public class CardFactory_Creatures {
|
|||||||
//*************** START *********** START **************************
|
//*************** START *********** START **************************
|
||||||
if(cardName.equals("Lurking Informant")) {
|
if(cardName.equals("Lurking Informant")) {
|
||||||
Target target = new Target(card,"Select target player", new String[] {"Player"});
|
Target target = new Target(card,"Select target player", new String[] {"Player"});
|
||||||
Ability_Cost abCost = new Ability_Cost("2 T", cardName, true);
|
Cost abCost = new Cost("2 T", cardName, true);
|
||||||
final SpellAbility a1 = new Ability_Activated(card, abCost, target) {
|
final SpellAbility a1 = new Ability_Activated(card, abCost, target) {
|
||||||
private static final long serialVersionUID = 1446529067071763245L;
|
private static final long serialVersionUID = 1446529067071763245L;
|
||||||
|
|
||||||
@@ -176,7 +211,7 @@ public class CardFactory_Creatures {
|
|||||||
//*************** START *********** START **************************
|
//*************** START *********** START **************************
|
||||||
else if(cardName.equals("Kiki-Jiki, Mirror Breaker")) {
|
else if(cardName.equals("Kiki-Jiki, Mirror Breaker")) {
|
||||||
final CardFactory cfact = cf;
|
final CardFactory cfact = cf;
|
||||||
Ability_Cost abCost = new Ability_Cost("T", cardName, true);
|
Cost abCost = new Cost("T", cardName, true);
|
||||||
Target target = new Target(card,"Select target nonlegendary creature you control.", new String[] {"Creature.nonLegendary+YouCtrl"});
|
Target target = new Target(card,"Select target nonlegendary creature you control.", new String[] {"Creature.nonLegendary+YouCtrl"});
|
||||||
final Ability_Activated ability = new Ability_Activated(card, abCost, target) {
|
final Ability_Activated ability = new Ability_Activated(card, abCost, target) {
|
||||||
private static final long serialVersionUID = -943706942500499644L;
|
private static final long serialVersionUID = -943706942500499644L;
|
||||||
@@ -318,7 +353,7 @@ public class CardFactory_Creatures {
|
|||||||
|
|
||||||
//*************** START *********** START **************************
|
//*************** START *********** START **************************
|
||||||
else if(cardName.equals("Loxodon Hierarch")) {
|
else if(cardName.equals("Loxodon Hierarch")) {
|
||||||
Ability_Cost abCost = new Ability_Cost("G W Sac<1/CARDNAME>", cardName, true);
|
Cost abCost = new Cost("G W Sac<1/CARDNAME>", cardName, true);
|
||||||
final Ability_Activated ability = new Ability_Activated(card, abCost, null) {
|
final Ability_Activated ability = new Ability_Activated(card, abCost, null) {
|
||||||
private static final long serialVersionUID = 6606519504236074186L;
|
private static final long serialVersionUID = 6606519504236074186L;
|
||||||
|
|
||||||
@@ -356,7 +391,7 @@ public class CardFactory_Creatures {
|
|||||||
|
|
||||||
//*************** START *********** START **************************
|
//*************** START *********** START **************************
|
||||||
else if(cardName.equals("Gilder Bairn")) {
|
else if(cardName.equals("Gilder Bairn")) {
|
||||||
Ability_Cost abCost = new Ability_Cost("2 GU Untap", cardName, true);
|
Cost abCost = new Cost("2 GU Untap", cardName, true);
|
||||||
Target tgt = new Target(card,"Select target permanent.", new String[]{"Permanent"});
|
Target tgt = new Target(card,"Select target permanent.", new String[]{"Permanent"});
|
||||||
final Ability_Activated a1 = new Ability_Activated(card, abCost, tgt) {
|
final Ability_Activated a1 = new Ability_Activated(card, abCost, tgt) {
|
||||||
private static final long serialVersionUID = -1847685865277129366L;
|
private static final long serialVersionUID = -1847685865277129366L;
|
||||||
@@ -1872,7 +1907,7 @@ public class CardFactory_Creatures {
|
|||||||
|
|
||||||
//*************** START *********** START **************************
|
//*************** START *********** START **************************
|
||||||
else if (cardName.equals("Disciple of Kangee")) {
|
else if (cardName.equals("Disciple of Kangee")) {
|
||||||
Ability_Cost abCost = new Ability_Cost("U T", cardName, true);
|
Cost abCost = new Cost("U T", cardName, true);
|
||||||
final Ability_Activated ability = new Ability_Activated(card, abCost, new Target(card,"TgtC")) {
|
final Ability_Activated ability = new Ability_Activated(card, abCost, new Target(card,"TgtC")) {
|
||||||
private static final long serialVersionUID = -5169389637917649036L;
|
private static final long serialVersionUID = -5169389637917649036L;
|
||||||
|
|
||||||
@@ -2090,7 +2125,7 @@ public class CardFactory_Creatures {
|
|||||||
|
|
||||||
//*************** START *********** START **************************
|
//*************** START *********** START **************************
|
||||||
else if(cardName.equals("Hermit Druid")) {
|
else if(cardName.equals("Hermit Druid")) {
|
||||||
Ability_Cost abCost = new Ability_Cost("G T", cardName, true);
|
Cost abCost = new Cost("G T", cardName, true);
|
||||||
final Ability_Activated ability = new Ability_Activated(card, abCost, null) {
|
final Ability_Activated ability = new Ability_Activated(card, abCost, null) {
|
||||||
private static final long serialVersionUID = 5884624727757154056L;
|
private static final long serialVersionUID = 5884624727757154056L;
|
||||||
|
|
||||||
@@ -2142,7 +2177,7 @@ public class CardFactory_Creatures {
|
|||||||
|
|
||||||
//*************** START *********** START **************************
|
//*************** START *********** START **************************
|
||||||
else if(cardName.equals("Sorceress Queen") || cardName.equals("Serendib Sorcerer")) {
|
else if(cardName.equals("Sorceress Queen") || cardName.equals("Serendib Sorcerer")) {
|
||||||
Ability_Cost abCost = new Ability_Cost("T", cardName, true);
|
Cost abCost = new Cost("T", cardName, true);
|
||||||
Target target = new Target(card,"Select target creature other than "+cardName, new String[] {"Creature.Other"});
|
Target target = new Target(card,"Select target creature other than "+cardName, new String[] {"Creature.Other"});
|
||||||
final Ability_Activated ability = new Ability_Activated(card, abCost, target) {
|
final Ability_Activated ability = new Ability_Activated(card, abCost, target) {
|
||||||
private static final long serialVersionUID = -6853184726011448677L;
|
private static final long serialVersionUID = -6853184726011448677L;
|
||||||
@@ -2304,7 +2339,7 @@ public class CardFactory_Creatures {
|
|||||||
PlayerZone opponentPlayZone = AllZone.getZone(Constant.Zone.Battlefield, AllZone.HumanPlayer);
|
PlayerZone opponentPlayZone = AllZone.getZone(Constant.Zone.Battlefield, AllZone.HumanPlayer);
|
||||||
CardList opponentCreatureList = new CardList(opponentPlayZone.getCards());
|
CardList opponentCreatureList = new CardList(opponentPlayZone.getCards());
|
||||||
opponentCreatureList = opponentCreatureList.getType("Creature");
|
opponentCreatureList = opponentCreatureList.getType("Creature");
|
||||||
return ((PlayerCreatureList.size() + 1 > 2* opponentCreatureList.size() + 1) && (Phase.Sac_Dauntless_Escort_Comp == false) && (AllZone.Phase.getPhase().equals(Constant.Phase.Main1))) ;
|
return ((PlayerCreatureList.size() + 1 > 2* opponentCreatureList.size() + 1) && (Phase.isSacDauntlessEscortAI() == false) && (AllZone.Phase.getPhase().equals(Constant.Phase.Main1))) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
final Command untilEOT = new Command() {
|
final Command untilEOT = new Command() {
|
||||||
@@ -2312,9 +2347,9 @@ public class CardFactory_Creatures {
|
|||||||
|
|
||||||
public void execute() {
|
public void execute() {
|
||||||
if(card.getController() == AllZone.HumanPlayer) {
|
if(card.getController() == AllZone.HumanPlayer) {
|
||||||
Phase.Sac_Dauntless_Escort = false;
|
Phase.setSacDauntlessEscort(false);
|
||||||
} else {
|
} else {
|
||||||
Phase.Sac_Dauntless_Escort_Comp = false;
|
Phase.setSacDauntlessEscortAI(false);
|
||||||
}
|
}
|
||||||
PlayerZone PlayerPlayZone = AllZone.getZone(Constant.Zone.Battlefield, card.getController());
|
PlayerZone PlayerPlayZone = AllZone.getZone(Constant.Zone.Battlefield, card.getController());
|
||||||
CardList PlayerCreatureList = new CardList(PlayerPlayZone.getCards());
|
CardList PlayerCreatureList = new CardList(PlayerPlayZone.getCards());
|
||||||
@@ -2331,9 +2366,9 @@ public class CardFactory_Creatures {
|
|||||||
public void resolve() {
|
public void resolve() {
|
||||||
AllZone.GameAction.sacrifice(card);
|
AllZone.GameAction.sacrifice(card);
|
||||||
if(card.getController() == AllZone.HumanPlayer) {
|
if(card.getController() == AllZone.HumanPlayer) {
|
||||||
Phase.Sac_Dauntless_Escort = true;
|
Phase.setSacDauntlessEscort(true);
|
||||||
}
|
}
|
||||||
else Phase.Sac_Dauntless_Escort_Comp = true;
|
else Phase.setSacDauntlessEscortAI(true);
|
||||||
|
|
||||||
AllZone.EndOfTurn.addUntil(untilEOT);
|
AllZone.EndOfTurn.addUntil(untilEOT);
|
||||||
}
|
}
|
||||||
@@ -2345,7 +2380,7 @@ public class CardFactory_Creatures {
|
|||||||
|
|
||||||
//*************** START *********** START **************************
|
//*************** START *********** START **************************
|
||||||
else if(cardName.equals("Wojek Embermage")) {
|
else if(cardName.equals("Wojek Embermage")) {
|
||||||
Ability_Cost abCost = new Ability_Cost("T", cardName, true);
|
Cost abCost = new Cost("T", cardName, true);
|
||||||
Target tgt = new Target(card,"TgtC");
|
Target tgt = new Target(card,"TgtC");
|
||||||
final Ability_Activated ability = new Ability_Activated(card, abCost, tgt) {
|
final Ability_Activated ability = new Ability_Activated(card, abCost, tgt) {
|
||||||
private static final long serialVersionUID = -1208482961653326721L;
|
private static final long serialVersionUID = -1208482961653326721L;
|
||||||
@@ -2434,7 +2469,7 @@ public class CardFactory_Creatures {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Ability_Cost abCost = new Ability_Cost("T", cardName, true);
|
Cost abCost = new Cost("T", cardName, true);
|
||||||
Target tgt = new Target(card,"Target creature other than "+cardName, "Creature.Other".split(","));
|
Target tgt = new Target(card,"Target creature other than "+cardName, "Creature.Other".split(","));
|
||||||
final Ability_Activated ability = new Ability_Activated(card, abCost, tgt){
|
final Ability_Activated ability = new Ability_Activated(card, abCost, tgt){
|
||||||
private static final long serialVersionUID = -8454685126878522607L;
|
private static final long serialVersionUID = -8454685126878522607L;
|
||||||
@@ -2468,7 +2503,7 @@ public class CardFactory_Creatures {
|
|||||||
|
|
||||||
//*************** START *********** START **************************
|
//*************** START *********** START **************************
|
||||||
else if(cardName.equals("Mayael the Anima")) {
|
else if(cardName.equals("Mayael the Anima")) {
|
||||||
Ability_Cost abCost = new Ability_Cost("3 R G W T", cardName, true);
|
Cost abCost = new Cost("3 R G W T", cardName, true);
|
||||||
final Ability_Activated ability = new Ability_Activated(card, abCost, null) {
|
final Ability_Activated ability = new Ability_Activated(card, abCost, null) {
|
||||||
|
|
||||||
private static final long serialVersionUID = -9076784333448226913L;
|
private static final long serialVersionUID = -9076784333448226913L;
|
||||||
@@ -2564,7 +2599,7 @@ public class CardFactory_Creatures {
|
|||||||
|
|
||||||
//*************** START *********** START **************************
|
//*************** START *********** START **************************
|
||||||
else if(cardName.equals("Helldozer")) {
|
else if(cardName.equals("Helldozer")) {
|
||||||
Ability_Cost abCost = new Ability_Cost("B B B T", cardName, true);
|
Cost abCost = new Cost("B B B T", cardName, true);
|
||||||
Target target = new Target(card,"Select target land.", new String[]{"Land"});
|
Target target = new Target(card,"Select target land.", new String[]{"Land"});
|
||||||
final Ability_Activated ability = new Ability_Activated(card, abCost, target) {
|
final Ability_Activated ability = new Ability_Activated(card, abCost, target) {
|
||||||
private static final long serialVersionUID = 6426884086364885861L;
|
private static final long serialVersionUID = 6426884086364885861L;
|
||||||
@@ -2670,7 +2705,7 @@ public class CardFactory_Creatures {
|
|||||||
final String[] color = new String[1];
|
final String[] color = new String[1];
|
||||||
final long[] timeStamp = new long[1];
|
final long[] timeStamp = new long[1];
|
||||||
|
|
||||||
final Ability_Cost abCost = new Ability_Cost("Discard<1/Card>", cardName, true);
|
final Cost abCost = new Cost("Discard<1/Card>", cardName, true);
|
||||||
|
|
||||||
//mana tap ability
|
//mana tap ability
|
||||||
final SpellAbility ability = new Ability_Activated(card, abCost, null) {
|
final SpellAbility ability = new Ability_Activated(card, abCost, null) {
|
||||||
@@ -2758,7 +2793,7 @@ public class CardFactory_Creatures {
|
|||||||
final long[] timeStamp = new long[1];
|
final long[] timeStamp = new long[1];
|
||||||
|
|
||||||
//color change ability
|
//color change ability
|
||||||
Ability_Cost abCost = new Ability_Cost("G", cardName, true);
|
Cost abCost = new Cost("G", cardName, true);
|
||||||
final Ability_Activated ability = new Ability_Activated(card, abCost, null) {
|
final Ability_Activated ability = new Ability_Activated(card, abCost, null) {
|
||||||
private static final long serialVersionUID = -5362934962417382279L;
|
private static final long serialVersionUID = -5362934962417382279L;
|
||||||
|
|
||||||
@@ -3149,7 +3184,7 @@ public class CardFactory_Creatures {
|
|||||||
|
|
||||||
//*************** START *********** START **************************
|
//*************** START *********** START **************************
|
||||||
else if(cardName.equals("Goldmeadow Lookout")) {
|
else if(cardName.equals("Goldmeadow Lookout")) {
|
||||||
final Ability_Cost lookCost = new Ability_Cost("W T Discard<1/Card>", card.getName(), true);
|
final Cost lookCost = new Cost("W T Discard<1/Card>", card.getName(), true);
|
||||||
final SpellAbility ability = new Ability_Activated(card, lookCost, null){
|
final SpellAbility ability = new Ability_Activated(card, lookCost, null){
|
||||||
private static final long serialVersionUID = -8413409735529340094L;
|
private static final long serialVersionUID = -8413409735529340094L;
|
||||||
|
|
||||||
@@ -3163,7 +3198,7 @@ public class CardFactory_Creatures {
|
|||||||
card.getController(), "W", new String[] {"Creature", "Kithkin", "Soldier"}, 1, 1, new String[] {""});
|
card.getController(), "W", new String[] {"Creature", "Kithkin", "Soldier"}, 1, 1, new String[] {""});
|
||||||
|
|
||||||
for(final Card c:cl) {
|
for(final Card c:cl) {
|
||||||
final Ability_Cost abCost = new Ability_Cost("W T", c.getName(), true);
|
final Cost abCost = new Cost("W T", c.getName(), true);
|
||||||
final Target tgt = new Target(card,"TgtC");
|
final Target tgt = new Target(card,"TgtC");
|
||||||
final SpellAbility tokenAbility = new Ability_Activated(card, abCost, tgt){
|
final SpellAbility tokenAbility = new Ability_Activated(card, abCost, tgt){
|
||||||
private static final long serialVersionUID = -7327585136675896817L;
|
private static final long serialVersionUID = -7327585136675896817L;
|
||||||
@@ -3288,7 +3323,7 @@ public class CardFactory_Creatures {
|
|||||||
//*************** START *********** START **************************
|
//*************** START *********** START **************************
|
||||||
else if(cardName.equals("Rhys the Redeemed")) {
|
else if(cardName.equals("Rhys the Redeemed")) {
|
||||||
|
|
||||||
Ability_Cost abCost = new Ability_Cost("4 GW GW T", card.getName(), true);
|
Cost abCost = new Cost("4 GW GW T", card.getName(), true);
|
||||||
final Ability_Activated copyTokens1 = new Ability_Activated(card, abCost, null) {
|
final Ability_Activated copyTokens1 = new Ability_Activated(card, abCost, null) {
|
||||||
private static final long serialVersionUID = 6297992502069547478L;
|
private static final long serialVersionUID = 6297992502069547478L;
|
||||||
|
|
||||||
@@ -3635,7 +3670,7 @@ public class CardFactory_Creatures {
|
|||||||
//*************** START *********** START **************************
|
//*************** START *********** START **************************
|
||||||
else if(cardName.equals("Master of the Wild Hunt")) {
|
else if(cardName.equals("Master of the Wild Hunt")) {
|
||||||
|
|
||||||
final Ability_Cost abCost = new Ability_Cost("T", cardName, true);
|
final Cost abCost = new Cost("T", cardName, true);
|
||||||
final Target abTgt = new Target(card,"Target a creature to Hunt", "Creature".split(","));
|
final Target abTgt = new Target(card,"Target a creature to Hunt", "Creature".split(","));
|
||||||
final Ability_Activated ability = new Ability_Activated(card, abCost, abTgt) {
|
final Ability_Activated ability = new Ability_Activated(card, abCost, abTgt) {
|
||||||
private static final long serialVersionUID = 35050145102566898L;
|
private static final long serialVersionUID = 35050145102566898L;
|
||||||
@@ -3781,7 +3816,7 @@ public class CardFactory_Creatures {
|
|||||||
|
|
||||||
//*************** START *********** START **************************
|
//*************** START *********** START **************************
|
||||||
else if(cardName.equals("Scarblade Elite")) {
|
else if(cardName.equals("Scarblade Elite")) {
|
||||||
Ability_Cost abCost = new Ability_Cost("T", cardName, true);
|
Cost abCost = new Cost("T", cardName, true);
|
||||||
final Ability_Activated ability = new Ability_Activated(card, abCost, new Target(card,"TgtC")) {
|
final Ability_Activated ability = new Ability_Activated(card, abCost, new Target(card,"TgtC")) {
|
||||||
private static final long serialVersionUID = 3505019464802566898L;
|
private static final long serialVersionUID = 3505019464802566898L;
|
||||||
|
|
||||||
@@ -3864,7 +3899,7 @@ public class CardFactory_Creatures {
|
|||||||
|
|
||||||
//*************** START *********** START **************************
|
//*************** START *********** START **************************
|
||||||
else if(cardName.equals("Gilt-Leaf Archdruid")) {
|
else if(cardName.equals("Gilt-Leaf Archdruid")) {
|
||||||
Ability_Cost abCost = new Ability_Cost("tapXType<7/Druid>", cardName, true);
|
Cost abCost = new Cost("tapXType<7/Druid>", cardName, true);
|
||||||
Target tgt = new Target(card,"Select a player to gain lands from", "Player".split(","));
|
Target tgt = new Target(card,"Select a player to gain lands from", "Player".split(","));
|
||||||
final SpellAbility stealLands = new Ability_Activated(card, abCost, tgt){
|
final SpellAbility stealLands = new Ability_Activated(card, abCost, tgt){
|
||||||
private static final long serialVersionUID = 636594487143500891L;
|
private static final long serialVersionUID = 636594487143500891L;
|
||||||
@@ -4247,7 +4282,7 @@ public class CardFactory_Creatures {
|
|||||||
//*************** START *********** START **************************
|
//*************** START *********** START **************************
|
||||||
else if(cardName.equals("Molten Hydra")) {
|
else if(cardName.equals("Molten Hydra")) {
|
||||||
Target target = new Target(card,"TgtCP");
|
Target target = new Target(card,"TgtCP");
|
||||||
Ability_Cost abCost = new Ability_Cost("T", cardName, true);
|
Cost abCost = new Cost("T", cardName, true);
|
||||||
final Ability_Activated ability2 = new Ability_Activated(card, abCost, target) {
|
final Ability_Activated ability2 = new Ability_Activated(card, abCost, target) {
|
||||||
private static final long serialVersionUID = 2626619319289064289L;
|
private static final long serialVersionUID = 2626619319289064289L;
|
||||||
|
|
||||||
@@ -4891,11 +4926,11 @@ public class CardFactory_Creatures {
|
|||||||
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, getSourceCard().getController());
|
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, getSourceCard().getController());
|
||||||
CardList DoublingSeasons = new CardList(play.getCards());
|
CardList DoublingSeasons = new CardList(play.getCards());
|
||||||
DoublingSeasons = DoublingSeasons.getName("Doubling Season");
|
DoublingSeasons = DoublingSeasons.getName("Doubling Season");
|
||||||
PlayerZone_ComesIntoPlay.SimultaneousEntry = true;
|
PlayerZone_ComesIntoPlay.setSimultaneousEntry(true);
|
||||||
double Count = DoublingSeasons.size();
|
double Count = DoublingSeasons.size();
|
||||||
Count = Math.pow(2,Count);
|
Count = Math.pow(2,Count);
|
||||||
for(int i = 0; i < Count; i++) {
|
for(int i = 0; i < Count; i++) {
|
||||||
if(i + 1 == Count) PlayerZone_ComesIntoPlay.SimultaneousEntry = false;
|
if(i + 1 == Count) PlayerZone_ComesIntoPlay.setSimultaneousEntry(false);
|
||||||
Card Copy = AllZone.CardFactory.copyCardintoNew(getSourceCard());
|
Card Copy = AllZone.CardFactory.copyCardintoNew(getSourceCard());
|
||||||
Copy.setToken(true);
|
Copy.setToken(true);
|
||||||
Copy.setController(getSourceCard().getController());
|
Copy.setController(getSourceCard().getController());
|
||||||
@@ -4936,7 +4971,7 @@ public class CardFactory_Creatures {
|
|||||||
//*************** START *********** START **************************
|
//*************** START *********** START **************************
|
||||||
else if(cardName.equals("Thoughtcutter Agent")) {
|
else if(cardName.equals("Thoughtcutter Agent")) {
|
||||||
Target target = new Target(card,"Select target player", new String[] {"Player"});
|
Target target = new Target(card,"Select target player", new String[] {"Player"});
|
||||||
Ability_Cost abCost = new Ability_Cost("U B T", cardName, true);
|
Cost abCost = new Cost("U B T", cardName, true);
|
||||||
final Ability_Activated ability = new Ability_Activated(card, abCost, target) {
|
final Ability_Activated ability = new Ability_Activated(card, abCost, target) {
|
||||||
private static final long serialVersionUID = -3880035465617987801L;
|
private static final long serialVersionUID = -3880035465617987801L;
|
||||||
|
|
||||||
@@ -5020,7 +5055,7 @@ public class CardFactory_Creatures {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Ability_Cost abCost = new Ability_Cost("0", cardName, true);
|
Cost abCost = new Cost("0", cardName, true);
|
||||||
final Ability_Activated ability = new Ability_Activated(card, abCost, null) {
|
final Ability_Activated ability = new Ability_Activated(card, abCost, null) {
|
||||||
private static final long serialVersionUID = -8345060615720565828L;
|
private static final long serialVersionUID = -8345060615720565828L;
|
||||||
|
|
||||||
@@ -5407,11 +5442,11 @@ public class CardFactory_Creatures {
|
|||||||
public boolean canPlayAI() {
|
public boolean canPlayAI() {
|
||||||
CardList human = AllZoneUtil.getCreaturesInPlay(AllZone.HumanPlayer);
|
CardList human = AllZoneUtil.getCreaturesInPlay(AllZone.HumanPlayer);
|
||||||
CardListUtil.sortAttack(human);
|
CardListUtil.sortAttack(human);
|
||||||
return (human.get(0).getNetAttack() < Phase.StormCount && Phase.StormCount > 1);
|
return (human.get(0).getNetAttack() < Phase.getStormCount() && Phase.getStormCount() > 1);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
for(int i = 0; i < Phase.StormCount - 1; i++) {
|
for(int i = 0; i < Phase.getStormCount() - 1; i++) {
|
||||||
card.addCounter(Counters.P1P1, 1);
|
card.addCounter(Counters.P1P1, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5570,7 +5605,7 @@ public class CardFactory_Creatures {
|
|||||||
//*************** START *********** START **************************
|
//*************** START *********** START **************************
|
||||||
else if (cardName.equals("Kargan Dragonlord"))
|
else if (cardName.equals("Kargan Dragonlord"))
|
||||||
{
|
{
|
||||||
Ability_Cost abCost = new Ability_Cost("R", cardName, true);
|
Cost abCost = new Cost("R", cardName, true);
|
||||||
|
|
||||||
final SpellAbility ability = new Ability_Activated(card, abCost, null) {
|
final SpellAbility ability = new Ability_Activated(card, abCost, null) {
|
||||||
private static final long serialVersionUID = -2252408767635375616L;
|
private static final long serialVersionUID = -2252408767635375616L;
|
||||||
@@ -5705,7 +5740,7 @@ public class CardFactory_Creatures {
|
|||||||
final String Tgts[] = {"Creature.attacking"};
|
final String Tgts[] = {"Creature.attacking"};
|
||||||
Target target = new Target(card,"Select target attacking creature.", Tgts);
|
Target target = new Target(card,"Select target attacking creature.", Tgts);
|
||||||
|
|
||||||
final Ability_Cost cost = new Ability_Cost("T", card.getName(), true);
|
final Cost cost = new Cost("T", card.getName(), true);
|
||||||
|
|
||||||
final SpellAbility ability = new Ability_Activated(card, cost, target) {
|
final SpellAbility ability = new Ability_Activated(card, cost, target) {
|
||||||
private static final long serialVersionUID = 3750045284339229395L;
|
private static final long serialVersionUID = 3750045284339229395L;
|
||||||
@@ -5837,7 +5872,7 @@ public class CardFactory_Creatures {
|
|||||||
* player, and half X damage, rounded up, to you.
|
* player, and half X damage, rounded up, to you.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Ability_Cost abCost = new Ability_Cost("X T", cardName, true);
|
Cost abCost = new Cost("X T", cardName, true);
|
||||||
Target tgt = new Target(card,"TgtCP");
|
Target tgt = new Target(card,"TgtCP");
|
||||||
|
|
||||||
final Ability_Activated ability = new Ability_Activated(card, abCost, tgt) {
|
final Ability_Activated ability = new Ability_Activated(card, abCost, tgt) {
|
||||||
@@ -5901,7 +5936,7 @@ public class CardFactory_Creatures {
|
|||||||
|
|
||||||
//*************** START *********** START **************************
|
//*************** START *********** START **************************
|
||||||
else if(cardName.equals("Metalworker")) {
|
else if(cardName.equals("Metalworker")) {
|
||||||
final Ability_Cost abCost = new Ability_Cost("T", card.getName(), true);
|
final Cost abCost = new Cost("T", card.getName(), true);
|
||||||
|
|
||||||
final SpellAbility ability = new Ability_Activated(card, abCost, null) {
|
final SpellAbility ability = new Ability_Activated(card, abCost, null) {
|
||||||
private static final long serialVersionUID = 6661308920885136284L;
|
private static final long serialVersionUID = 6661308920885136284L;
|
||||||
@@ -5953,7 +5988,7 @@ public class CardFactory_Creatures {
|
|||||||
Ability_Mana abMana = new Ability_Mana(card, "0", "1", 2*revealed.size()) {
|
Ability_Mana abMana = new Ability_Mana(card, "0", "1", 2*revealed.size()) {
|
||||||
private static final long serialVersionUID = -2182129023960978132L;
|
private static final long serialVersionUID = -2182129023960978132L;
|
||||||
};
|
};
|
||||||
abMana.undoable = false;
|
abMana.setUndoable(false);
|
||||||
abMana.produceMana();
|
abMana.produceMana();
|
||||||
|
|
||||||
stop();
|
stop();
|
||||||
@@ -6085,7 +6120,7 @@ public class CardFactory_Creatures {
|
|||||||
|
|
||||||
//*************** START *********** START **************************
|
//*************** START *********** START **************************
|
||||||
else if(cardName.equals("Phyrexian Scuta")) {
|
else if(cardName.equals("Phyrexian Scuta")) {
|
||||||
Ability_Cost abCost = new Ability_Cost("3 B PayLife<3>", cardName, false);
|
Cost abCost = new Cost("3 B PayLife<3>", cardName, false);
|
||||||
final SpellAbility kicker = new Spell(card, abCost, null) {
|
final SpellAbility kicker = new Spell(card, abCost, null) {
|
||||||
private static final long serialVersionUID = -6420757044982294960L;
|
private static final long serialVersionUID = -6420757044982294960L;
|
||||||
|
|
||||||
@@ -6401,7 +6436,7 @@ public class CardFactory_Creatures {
|
|||||||
* Then that player discards all cards with that name revealed this way.
|
* Then that player discards all cards with that name revealed this way.
|
||||||
* Activate this ability only during your turn.
|
* Activate this ability only during your turn.
|
||||||
*/
|
*/
|
||||||
Ability_Cost abCost = new Ability_Cost("X T", cardName, true);
|
Cost abCost = new Cost("X T", cardName, true);
|
||||||
Target target = new Target(card,"Select target opponent", "Opponent".split(","));
|
Target target = new Target(card,"Select target opponent", "Opponent".split(","));
|
||||||
Ability_Activated discard = new Ability_Activated(card, abCost, target) {
|
Ability_Activated discard = new Ability_Activated(card, abCost, target) {
|
||||||
private static final long serialVersionUID = 4839778470534392198L;
|
private static final long serialVersionUID = 4839778470534392198L;
|
||||||
@@ -6475,7 +6510,7 @@ public class CardFactory_Creatures {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
final Ability_Cost abCost = new Ability_Cost("Discard<2/Card>", cardName, true);
|
final Cost abCost = new Cost("Discard<2/Card>", cardName, true);
|
||||||
final Ability_Activated toExile = new Ability_Activated(card, abCost, null) {
|
final Ability_Activated toExile = new Ability_Activated(card, abCost, null) {
|
||||||
private static final long serialVersionUID = 7850843970664800204L;
|
private static final long serialVersionUID = 7850843970664800204L;
|
||||||
|
|
||||||
@@ -6581,7 +6616,7 @@ public class CardFactory_Creatures {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Ability_Cost abCost = new Ability_Cost("T", cardName, true);
|
Cost abCost = new Cost("T", cardName, true);
|
||||||
Target t1 = new Target(card, "Select target equipment you control", "Equipment.YouCtrl".split(","));
|
Target t1 = new Target(card, "Select target equipment you control", "Equipment.YouCtrl".split(","));
|
||||||
final Ability_Activated ability = new Ability_Activated(card, abCost, t1) {
|
final Ability_Activated ability = new Ability_Activated(card, abCost, t1) {
|
||||||
private static final long serialVersionUID = 3818559481920103914L;
|
private static final long serialVersionUID = 3818559481920103914L;
|
||||||
@@ -6604,7 +6639,7 @@ public class CardFactory_Creatures {
|
|||||||
|
|
||||||
//*************** START *********** START **************************
|
//*************** START *********** START **************************
|
||||||
else if(cardName.equals("Gore Vassal")) {
|
else if(cardName.equals("Gore Vassal")) {
|
||||||
Ability_Cost abCost = new Ability_Cost("Sac<1/CARDNAME>", cardName, true);
|
Cost abCost = new Cost("Sac<1/CARDNAME>", cardName, true);
|
||||||
final Ability_Activated ability = new Ability_Activated(card, abCost, new Target(card, "TgtC")) {
|
final Ability_Activated ability = new Ability_Activated(card, abCost, new Target(card, "TgtC")) {
|
||||||
private static final long serialVersionUID = 3689290210743241201L;
|
private static final long serialVersionUID = 3689290210743241201L;
|
||||||
|
|
||||||
@@ -6644,7 +6679,7 @@ public class CardFactory_Creatures {
|
|||||||
|
|
||||||
//*************** START *********** START **************************
|
//*************** START *********** START **************************
|
||||||
else if (cardName.equals("Orcish Captain")) {
|
else if (cardName.equals("Orcish Captain")) {
|
||||||
Ability_Cost abCost = new Ability_Cost("1", cardName, true);
|
Cost abCost = new Cost("1", cardName, true);
|
||||||
Target target = new Target(card, "Select target Orc creature", "Creature.Orc".split(","));
|
Target target = new Target(card, "Select target Orc creature", "Creature.Orc".split(","));
|
||||||
final Ability_Activated ability = new Ability_Activated(card, abCost, target) {
|
final Ability_Activated ability = new Ability_Activated(card, abCost, target) {
|
||||||
private static final long serialVersionUID = 6724781940648179318L;
|
private static final long serialVersionUID = 6724781940648179318L;
|
||||||
@@ -6695,7 +6730,7 @@ public class CardFactory_Creatures {
|
|||||||
//*************** START *********** START **************************
|
//*************** START *********** START **************************
|
||||||
else if(cardName.equals("Orcish Spy")) {
|
else if(cardName.equals("Orcish Spy")) {
|
||||||
Target target = new Target(card,"Select target player", new String[] {"Player"});
|
Target target = new Target(card,"Select target player", new String[] {"Player"});
|
||||||
Ability_Cost abCost = new Ability_Cost("T", cardName, true);
|
Cost abCost = new Cost("T", cardName, true);
|
||||||
final Ability_Activated ability = new Ability_Activated(card, abCost, target) {
|
final Ability_Activated ability = new Ability_Activated(card, abCost, target) {
|
||||||
private static final long serialVersionUID = -7781215422160018196L;
|
private static final long serialVersionUID = -7781215422160018196L;
|
||||||
|
|
||||||
@@ -1,9 +1,26 @@
|
|||||||
|
|
||||||
package forge;
|
package forge.card.cardFactory;
|
||||||
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import forge.AllZone;
|
||||||
|
import forge.Card;
|
||||||
|
import forge.CardList;
|
||||||
|
import forge.CardListFilter;
|
||||||
|
import forge.CardUtil;
|
||||||
|
import forge.Command;
|
||||||
|
import forge.Constant;
|
||||||
|
import forge.Counters;
|
||||||
|
import forge.Phase;
|
||||||
|
import forge.Player;
|
||||||
|
import forge.card.spellability.Ability;
|
||||||
|
import forge.card.spellability.Ability_Activated;
|
||||||
|
import forge.card.spellability.Cost;
|
||||||
|
import forge.card.spellability.Target;
|
||||||
|
import forge.card.trigger.Trigger;
|
||||||
|
import forge.card.trigger.TriggerHandler;
|
||||||
|
|
||||||
|
|
||||||
class CardFactory_Equipment {
|
class CardFactory_Equipment {
|
||||||
|
|
||||||
@@ -22,7 +39,7 @@ class CardFactory_Equipment {
|
|||||||
|
|
||||||
//*************** START *********** START **************************
|
//*************** START *********** START **************************
|
||||||
if (cardName.equals("Umbral Mantle")) {
|
if (cardName.equals("Umbral Mantle")) {
|
||||||
Ability_Cost abCost = new Ability_Cost("0", cardName, true);
|
Cost abCost = new Cost("0", cardName, true);
|
||||||
Target target = new Target(card, "Select target creature you control", "Creature.YouCtrl".split(","));
|
Target target = new Target(card, "Select target creature you control", "Creature.YouCtrl".split(","));
|
||||||
final Ability_Activated equip = new Ability_Activated(card, abCost, target) {
|
final Ability_Activated equip = new Ability_Activated(card, abCost, target) {
|
||||||
private static final long serialVersionUID = -6122939616068165612L;
|
private static final long serialVersionUID = -6122939616068165612L;
|
||||||
@@ -360,7 +377,7 @@ class CardFactory_Equipment {
|
|||||||
String extrinsicKeywords[] = {"none"}; // for equips with no keywords to add
|
String extrinsicKeywords[] = {"none"}; // for equips with no keywords to add
|
||||||
|
|
||||||
//final String manaCost = tmpCost.trim();
|
//final String manaCost = tmpCost.trim();
|
||||||
final Ability_Cost abCost = new Ability_Cost(tmpCost.trim(), card.getName(), true);
|
final Cost abCost = new Cost(tmpCost.trim(), card.getName(), true);
|
||||||
int Power = 0;
|
int Power = 0;
|
||||||
int Tough = 0;
|
int Tough = 0;
|
||||||
|
|
||||||
@@ -1,10 +1,35 @@
|
|||||||
package forge;
|
package forge.card.cardFactory;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
|
|
||||||
|
import forge.AllZone;
|
||||||
|
import forge.AllZoneUtil;
|
||||||
|
import forge.ButtonUtil;
|
||||||
|
import forge.Card;
|
||||||
|
import forge.CardList;
|
||||||
|
import forge.CardListFilter;
|
||||||
|
import forge.CardListUtil;
|
||||||
|
import forge.CardUtil;
|
||||||
|
import forge.Combat;
|
||||||
|
import forge.Command;
|
||||||
|
import forge.ComputerUtil;
|
||||||
|
import forge.Constant;
|
||||||
|
import forge.GameActionUtil;
|
||||||
|
import forge.MyRandom;
|
||||||
|
import forge.PhaseUtil;
|
||||||
|
import forge.Player;
|
||||||
|
import forge.PlayerZone;
|
||||||
|
import forge.Phase;
|
||||||
|
import forge.card.spellability.Ability_Activated;
|
||||||
|
import forge.card.spellability.Cost;
|
||||||
|
import forge.card.spellability.Spell;
|
||||||
|
import forge.card.spellability.SpellAbility;
|
||||||
|
import forge.card.spellability.Target;
|
||||||
import forge.gui.GuiUtils;
|
import forge.gui.GuiUtils;
|
||||||
|
import forge.gui.input.Input;
|
||||||
|
import forge.gui.input.Input_PayManaCost;
|
||||||
|
|
||||||
|
|
||||||
public class CardFactory_Instants {
|
public class CardFactory_Instants {
|
||||||
@@ -925,7 +950,7 @@ public class CardFactory_Instants {
|
|||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
final Card creature = getTargetCard();
|
final Card creature = getTargetCard();
|
||||||
Ability_Cost abCost = new Ability_Cost("T", creature.getName(), true);
|
Cost abCost = new Cost("T", creature.getName(), true);
|
||||||
Target tgt = new Target(card,"Select target nonland permanent", new String[] {"Permanent.nonLand"});
|
Target tgt = new Target(card,"Select target nonland permanent", new String[] {"Permanent.nonLand"});
|
||||||
final Ability_Activated tBanish = new Ability_Activated(creature, abCost, tgt) {
|
final Ability_Activated tBanish = new Ability_Activated(creature, abCost, tgt) {
|
||||||
private static final long serialVersionUID = -1008113001678623984L;
|
private static final long serialVersionUID = -1008113001678623984L;
|
||||||
@@ -1087,7 +1112,7 @@ public class CardFactory_Instants {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
Phase.HighTides.add(this.getSourceCard());
|
Phase.getHighTides().add(this.getSourceCard());
|
||||||
}//resolve()
|
}//resolve()
|
||||||
};//SpellAbility
|
};//SpellAbility
|
||||||
card.clearSpellAbility();
|
card.clearSpellAbility();
|
||||||
@@ -1459,13 +1484,13 @@ public class CardFactory_Instants {
|
|||||||
|
|
||||||
if(card.getController().equals(AllZone.HumanPlayer))
|
if(card.getController().equals(AllZone.HumanPlayer))
|
||||||
{
|
{
|
||||||
Phase.ManaDrain_BonusMana_Human.add(CardUtil.getConvertedManaCost(sa.getSourceCard()));
|
Phase.getManaDrain_BonusMana_Human().add(CardUtil.getConvertedManaCost(sa.getSourceCard()));
|
||||||
Phase.ManaDrain_Source_Human.add(card);
|
Phase.getManaDrain_Source_Human().add(card);
|
||||||
}
|
}
|
||||||
else if(card.getController().equals(AllZone.ComputerPlayer))
|
else if(card.getController().equals(AllZone.ComputerPlayer))
|
||||||
{
|
{
|
||||||
Phase.ManaDrain_BonusMana_AI.add(CardUtil.getConvertedManaCost(sa.getSourceCard()));
|
Phase.getManaDrain_BonusMana_AI().add(CardUtil.getConvertedManaCost(sa.getSourceCard()));
|
||||||
Phase.ManaDrain_Source_AI.add(card);
|
Phase.getManaDrain_Source_AI().add(card);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2116,7 +2141,7 @@ public class CardFactory_Instants {
|
|||||||
* creature has infect, Burn the Impure deals 3 damage to that
|
* creature has infect, Burn the Impure deals 3 damage to that
|
||||||
* creature's controller.
|
* creature's controller.
|
||||||
*/
|
*/
|
||||||
Ability_Cost abCost = new Ability_Cost("1 R", cardName, false);
|
Cost abCost = new Cost("1 R", cardName, false);
|
||||||
final SpellAbility spell = new Spell(card, abCost, new Target(card, "TgtC")) {
|
final SpellAbility spell = new Spell(card, abCost, new Target(card, "TgtC")) {
|
||||||
private static final long serialVersionUID = -3069135027502686218L;
|
private static final long serialVersionUID = -3069135027502686218L;
|
||||||
int damage = 3;
|
int damage = 3;
|
||||||
@@ -2182,7 +2207,7 @@ public class CardFactory_Instants {
|
|||||||
* type target player controls, or untap all tapped permanents of that type that
|
* type target player controls, or untap all tapped permanents of that type that
|
||||||
* player controls.
|
* player controls.
|
||||||
*/
|
*/
|
||||||
Ability_Cost abCost = new Ability_Cost("2 U U", cardName, false);
|
Cost abCost = new Cost("2 U U", cardName, false);
|
||||||
Target target = new Target(card, "Select target player", "Player".split(","));
|
Target target = new Target(card, "Select target player", "Player".split(","));
|
||||||
final SpellAbility spell = new Spell(card, abCost, target) {
|
final SpellAbility spell = new Spell(card, abCost, target) {
|
||||||
private static final long serialVersionUID = -2175586347805121896L;
|
private static final long serialVersionUID = -2175586347805121896L;
|
||||||
@@ -1,11 +1,32 @@
|
|||||||
|
|
||||||
package forge;
|
package forge.card.cardFactory;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
|
|
||||||
|
import forge.AllZone;
|
||||||
|
import forge.AllZoneUtil;
|
||||||
|
import forge.ButtonUtil;
|
||||||
|
import forge.Card;
|
||||||
|
import forge.CardList;
|
||||||
|
import forge.CardListFilter;
|
||||||
|
import forge.CardUtil;
|
||||||
|
import forge.Command;
|
||||||
|
import forge.Constant;
|
||||||
|
import forge.Counters;
|
||||||
|
import forge.GameActionUtil;
|
||||||
|
import forge.MyRandom;
|
||||||
|
import forge.Player;
|
||||||
|
import forge.PlayerZone;
|
||||||
|
import forge.card.spellability.Ability;
|
||||||
|
import forge.card.spellability.Ability_Activated;
|
||||||
|
import forge.card.spellability.Ability_Mana;
|
||||||
|
import forge.card.spellability.Cost;
|
||||||
|
import forge.card.spellability.SpellAbility;
|
||||||
|
import forge.card.spellability.Target;
|
||||||
import forge.gui.GuiUtils;
|
import forge.gui.GuiUtils;
|
||||||
|
import forge.gui.input.Input;
|
||||||
|
|
||||||
class CardFactory_Lands {
|
class CardFactory_Lands {
|
||||||
|
|
||||||
@@ -27,7 +48,7 @@ class CardFactory_Lands {
|
|||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
Ability_Cost abCost = new Ability_Cost("T", card.getName(), true);
|
Cost abCost = new Cost("T", card.getName(), true);
|
||||||
final SpellAbility ability = new Ability_Activated(card, abCost, null){
|
final SpellAbility ability = new Ability_Activated(card, abCost, null){
|
||||||
private static final long serialVersionUID = 1416258136308898492L;
|
private static final long serialVersionUID = 1416258136308898492L;
|
||||||
|
|
||||||
@@ -313,7 +334,7 @@ class CardFactory_Lands {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Ability_Cost abCost = new Ability_Cost("G U T", cardName, true);
|
Cost abCost = new Cost("G U T", cardName, true);
|
||||||
Ability_Activated ability = new Ability_Activated(card, abCost, null) {
|
Ability_Activated ability = new Ability_Activated(card, abCost, null) {
|
||||||
private static final long serialVersionUID = 1416258136308898492L;
|
private static final long serialVersionUID = 1416258136308898492L;
|
||||||
|
|
||||||
@@ -548,7 +569,7 @@ class CardFactory_Lands {
|
|||||||
/*
|
/*
|
||||||
* Tap: The power of target creature with flying becomes 0 until end of turn.
|
* Tap: The power of target creature with flying becomes 0 until end of turn.
|
||||||
*/
|
*/
|
||||||
Ability_Cost abCost = new Ability_Cost("T", cardName, true);
|
Cost abCost = new Cost("T", cardName, true);
|
||||||
final String Tgts[] = {"Creature.withFlying"};
|
final String Tgts[] = {"Creature.withFlying"};
|
||||||
Target target = new Target(card,"Select target creature with flying.", Tgts);
|
Target target = new Target(card,"Select target creature with flying.", Tgts);
|
||||||
final Ability_Activated ability = new Ability_Activated(card, abCost, target) {
|
final Ability_Activated ability = new Ability_Activated(card, abCost, target) {
|
||||||
@@ -633,7 +654,7 @@ class CardFactory_Lands {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
abMana.undoable = false;
|
abMana.setUndoable(false);
|
||||||
|
|
||||||
final Ability addMana = new Ability(card, "0", desc.toString()) {
|
final Ability addMana = new Ability(card, "0", desc.toString()) {
|
||||||
private static final long serialVersionUID = -7805885635696245285L;
|
private static final long serialVersionUID = -7805885635696245285L;
|
||||||
@@ -793,7 +814,7 @@ class CardFactory_Lands {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
abMana.undoable = false;
|
abMana.setUndoable(false);
|
||||||
|
|
||||||
final Ability addMana = new Ability(card, "1", description.toString()) {
|
final Ability addMana = new Ability(card, "1", description.toString()) {
|
||||||
private static final long serialVersionUID = 7177960799748450242L;
|
private static final long serialVersionUID = 7177960799748450242L;
|
||||||
@@ -818,7 +839,7 @@ class CardFactory_Lands {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
abMana.undoable = false;
|
abMana.setUndoable(false);
|
||||||
abMana.produceMana(mana());
|
abMana.produceMana(mana());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -1,12 +1,35 @@
|
|||||||
|
|
||||||
package forge;
|
package forge.card.cardFactory;
|
||||||
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
import com.esotericsoftware.minlog.Log;
|
import com.esotericsoftware.minlog.Log;
|
||||||
|
|
||||||
|
import forge.AllZone;
|
||||||
|
import forge.AllZoneUtil;
|
||||||
|
import forge.ButtonUtil;
|
||||||
|
import forge.Card;
|
||||||
|
import forge.CardList;
|
||||||
|
import forge.CardListFilter;
|
||||||
|
import forge.CardListUtil;
|
||||||
|
import forge.CardUtil;
|
||||||
|
import forge.CombatUtil;
|
||||||
|
import forge.Command;
|
||||||
|
import forge.Constant;
|
||||||
|
import forge.Counters;
|
||||||
|
import forge.GameActionUtil;
|
||||||
|
import forge.Player;
|
||||||
|
import forge.PlayerZone;
|
||||||
|
import forge.Phase;
|
||||||
|
import forge.card.spellability.Ability;
|
||||||
|
import forge.card.spellability.Ability_Activated;
|
||||||
|
import forge.card.spellability.Ability_Mana;
|
||||||
|
import forge.card.spellability.Cost;
|
||||||
|
import forge.card.spellability.SpellAbility;
|
||||||
|
import forge.card.spellability.Target;
|
||||||
import forge.gui.GuiUtils;
|
import forge.gui.GuiUtils;
|
||||||
|
import forge.gui.input.Input;
|
||||||
|
|
||||||
|
|
||||||
class CardFactory_Planeswalkers {
|
class CardFactory_Planeswalkers {
|
||||||
@@ -678,7 +701,7 @@ class CardFactory_Planeswalkers {
|
|||||||
else if(cardName.equals("Ajani Vengeant")) {
|
else if(cardName.equals("Ajani Vengeant")) {
|
||||||
|
|
||||||
//ability3
|
//ability3
|
||||||
Ability_Cost cost = new Ability_Cost("SubCounter<7/LOYALTY>", cardName, true);
|
Cost cost = new Cost("SubCounter<7/LOYALTY>", cardName, true);
|
||||||
final SpellAbility ability3 = new Ability_Activated(card, cost, new Target(card,"P")){
|
final SpellAbility ability3 = new Ability_Activated(card, cost, new Target(card,"P")){
|
||||||
private static final long serialVersionUID = -1200172251117224702L;
|
private static final long serialVersionUID = -1200172251117224702L;
|
||||||
|
|
||||||
@@ -1367,7 +1390,7 @@ class CardFactory_Planeswalkers {
|
|||||||
Ability_Mana abMana = new Ability_Mana(card, "0", "R", list.size()) {
|
Ability_Mana abMana = new Ability_Mana(card, "0", "R", list.size()) {
|
||||||
private static final long serialVersionUID = -2182129023960978132L;
|
private static final long serialVersionUID = -2182129023960978132L;
|
||||||
};
|
};
|
||||||
abMana.undoable = false;
|
abMana.setUndoable(false);
|
||||||
abMana.produceMana();
|
abMana.produceMana();
|
||||||
|
|
||||||
}//resolve()
|
}//resolve()
|
||||||
@@ -1827,7 +1850,7 @@ class CardFactory_Planeswalkers {
|
|||||||
* from among them and put it into your hand. Put the rest on the bottom of your
|
* from among them and put it into your hand. Put the rest on the bottom of your
|
||||||
* library in any order.
|
* library in any order.
|
||||||
*/
|
*/
|
||||||
Ability_Cost abCost1 = new Ability_Cost("AddCounter<1/LOYALTY>", cardName, true);
|
Cost abCost1 = new Cost("AddCounter<1/LOYALTY>", cardName, true);
|
||||||
final SpellAbility ability1 = new Ability_Activated(card, abCost1, null) {
|
final SpellAbility ability1 = new Ability_Activated(card, abCost1, null) {
|
||||||
private static final long serialVersionUID = 3817068914199871827L;
|
private static final long serialVersionUID = 3817068914199871827L;
|
||||||
|
|
||||||
@@ -1905,7 +1928,7 @@ class CardFactory_Planeswalkers {
|
|||||||
/*
|
/*
|
||||||
* -1: Target artifact becomes a 5/5 artifact creature.
|
* -1: Target artifact becomes a 5/5 artifact creature.
|
||||||
*/
|
*/
|
||||||
Ability_Cost abCost2 = new Ability_Cost("SubCounter<1/LOYALTY>", cardName, true);
|
Cost abCost2 = new Cost("SubCounter<1/LOYALTY>", cardName, true);
|
||||||
Target target = new Target(card, "Select target artifact", "Artifact".split(","));
|
Target target = new Target(card, "Select target artifact", "Artifact".split(","));
|
||||||
final SpellAbility ability2 = new Ability_Activated(card, abCost2, target) {
|
final SpellAbility ability2 = new Ability_Activated(card, abCost2, target) {
|
||||||
private static final long serialVersionUID = -669957056327870077L;
|
private static final long serialVersionUID = -669957056327870077L;
|
||||||
@@ -1942,7 +1965,7 @@ class CardFactory_Planeswalkers {
|
|||||||
/*
|
/*
|
||||||
* Target player loses X life and you gain X life, where X is twice the number of artifacts you control.
|
* Target player loses X life and you gain X life, where X is twice the number of artifacts you control.
|
||||||
*/
|
*/
|
||||||
Ability_Cost abCost3 = new Ability_Cost("SubCounter<4/LOYALTY>", cardName, true);
|
Cost abCost3 = new Cost("SubCounter<4/LOYALTY>", cardName, true);
|
||||||
Target target2 = new Target(card, "Select target player", "Player".split(","));
|
Target target2 = new Target(card, "Select target player", "Player".split(","));
|
||||||
final SpellAbility ability3 = new Ability_Activated(card, abCost3, target2) {
|
final SpellAbility ability3 = new Ability_Activated(card, abCost3, target2) {
|
||||||
private static final long serialVersionUID = 4407137815355315502L;
|
private static final long serialVersionUID = 4407137815355315502L;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package forge;
|
package forge.card.cardFactory;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@@ -11,7 +11,35 @@ import javax.swing.JOptionPane;
|
|||||||
|
|
||||||
import com.esotericsoftware.minlog.Log;
|
import com.esotericsoftware.minlog.Log;
|
||||||
|
|
||||||
|
import forge.AllZone;
|
||||||
|
import forge.AllZoneUtil;
|
||||||
|
import forge.ButtonUtil;
|
||||||
|
import forge.Card;
|
||||||
|
import forge.CardList;
|
||||||
|
import forge.CardListFilter;
|
||||||
|
import forge.CardListUtil;
|
||||||
|
import forge.CardUtil;
|
||||||
|
import forge.Command;
|
||||||
|
import forge.ComputerUtil;
|
||||||
|
import forge.Constant;
|
||||||
|
import forge.Counters;
|
||||||
|
import forge.GameActionUtil;
|
||||||
|
import forge.HandSizeOp;
|
||||||
|
import forge.Player;
|
||||||
|
import forge.PlayerZone;
|
||||||
|
import forge.PlayerZone_ComesIntoPlay;
|
||||||
|
import forge.card.spellability.Ability;
|
||||||
|
import forge.card.spellability.Ability_Activated;
|
||||||
|
import forge.card.spellability.Ability_Mana;
|
||||||
|
import forge.card.spellability.Cost;
|
||||||
|
import forge.card.spellability.Spell;
|
||||||
|
import forge.card.spellability.SpellAbility;
|
||||||
|
import forge.card.spellability.Spell_Permanent;
|
||||||
|
import forge.card.spellability.Target;
|
||||||
|
import forge.card.trigger.Trigger;
|
||||||
import forge.gui.GuiUtils;
|
import forge.gui.GuiUtils;
|
||||||
|
import forge.gui.input.Input;
|
||||||
|
import forge.gui.input.Input_PayManaCost;
|
||||||
|
|
||||||
public class CardFactory_Sorceries {
|
public class CardFactory_Sorceries {
|
||||||
|
|
||||||
@@ -359,7 +387,7 @@ public class CardFactory_Sorceries {
|
|||||||
|
|
||||||
//*************** START *********** START **************************
|
//*************** START *********** START **************************
|
||||||
else if(cardName.equals("Cruel Ultimatum")) {
|
else if(cardName.equals("Cruel Ultimatum")) {
|
||||||
Ability_Cost abCost = new Ability_Cost("U U B B B R R", cardName, false);
|
Cost abCost = new Cost("U U B B B R R", cardName, false);
|
||||||
Target tgt = new Target(card,"Select target opponent", "Opponent".split(","));
|
Target tgt = new Target(card,"Select target opponent", "Opponent".split(","));
|
||||||
final SpellAbility spell = new Spell(card,abCost, tgt) {
|
final SpellAbility spell = new Spell(card,abCost, tgt) {
|
||||||
|
|
||||||
@@ -2144,10 +2172,10 @@ public class CardFactory_Sorceries {
|
|||||||
|
|
||||||
if(AllZone.GameAction.isCardInPlay(getTargetCard())
|
if(AllZone.GameAction.isCardInPlay(getTargetCard())
|
||||||
&& CardFactoryUtil.canTarget(card, getTargetCard())) {
|
&& CardFactoryUtil.canTarget(card, getTargetCard())) {
|
||||||
PlayerZone_ComesIntoPlay.SimultaneousEntry = true;
|
PlayerZone_ComesIntoPlay.setSimultaneousEntry(true);
|
||||||
double Count = AllZoneUtil.getDoublingSeasonMagnitude(card.getController());
|
double Count = AllZoneUtil.getDoublingSeasonMagnitude(card.getController());
|
||||||
for(int i = 0; i < Count; i++) {
|
for(int i = 0; i < Count; i++) {
|
||||||
if(i + 1 == Count) PlayerZone_ComesIntoPlay.SimultaneousEntry = false;
|
if(i + 1 == Count) PlayerZone_ComesIntoPlay.setSimultaneousEntry(false);
|
||||||
final Card Copy = AllZone.CardFactory.copyCardintoNew(getTargetCard());
|
final Card Copy = AllZone.CardFactory.copyCardintoNew(getTargetCard());
|
||||||
|
|
||||||
//Slight hack for copying stuff that has triggered abilities
|
//Slight hack for copying stuff that has triggered abilities
|
||||||
@@ -2233,10 +2261,10 @@ public class CardFactory_Sorceries {
|
|||||||
card.setKicked(true);
|
card.setKicked(true);
|
||||||
if(AllZone.GameAction.isCardInPlay(getTargetCard())
|
if(AllZone.GameAction.isCardInPlay(getTargetCard())
|
||||||
&& CardFactoryUtil.canTarget(card, getTargetCard())) {
|
&& CardFactoryUtil.canTarget(card, getTargetCard())) {
|
||||||
PlayerZone_ComesIntoPlay.SimultaneousEntry = true;
|
PlayerZone_ComesIntoPlay.setSimultaneousEntry(true);
|
||||||
int Count = 5 * AllZoneUtil.getDoublingSeasonMagnitude(card.getController());
|
int Count = 5 * AllZoneUtil.getDoublingSeasonMagnitude(card.getController());
|
||||||
for(int i = 0; i < Count; i++) {
|
for(int i = 0; i < Count; i++) {
|
||||||
if(i + 1 == Count) PlayerZone_ComesIntoPlay.SimultaneousEntry = false;
|
if(i + 1 == Count) PlayerZone_ComesIntoPlay.setSimultaneousEntry(false);
|
||||||
final Card Copy = AllZone.CardFactory.copyCardintoNew(getTargetCard());
|
final Card Copy = AllZone.CardFactory.copyCardintoNew(getTargetCard());
|
||||||
|
|
||||||
//Slight hack for copying stuff that has triggered abilities
|
//Slight hack for copying stuff that has triggered abilities
|
||||||
@@ -3461,7 +3489,7 @@ public class CardFactory_Sorceries {
|
|||||||
* Tap target untapped creature you control. If you do, add X to
|
* Tap target untapped creature you control. If you do, add X to
|
||||||
* your mana pool, where X is that creature's converted mana cost.
|
* your mana pool, where X is that creature's converted mana cost.
|
||||||
*/
|
*/
|
||||||
Ability_Cost cost = new Ability_Cost("U", cardName, false);
|
Cost cost = new Cost("U", cardName, false);
|
||||||
Target tgt = new Target(card,"Select an untapped creature you control", "Creature.untapped+YouCtrl".split(","));
|
Target tgt = new Target(card,"Select an untapped creature you control", "Creature.untapped+YouCtrl".split(","));
|
||||||
final SpellAbility spell = new Spell(card, cost, tgt) {
|
final SpellAbility spell = new Spell(card, cost, tgt) {
|
||||||
|
|
||||||
@@ -4172,7 +4200,7 @@ public class CardFactory_Sorceries {
|
|||||||
|
|
||||||
//*************** START *********** START **************************
|
//*************** START *********** START **************************
|
||||||
else if(cardName.equals("Choking Sands")) {
|
else if(cardName.equals("Choking Sands")) {
|
||||||
Ability_Cost abCost = new Ability_Cost("1 B B", cardName, false);
|
Cost abCost = new Cost("1 B B", cardName, false);
|
||||||
Target target = new Target(card,"Select target non-Swamp land.", new String[]{"Land.nonSwamp"});
|
Target target = new Target(card,"Select target non-Swamp land.", new String[]{"Land.nonSwamp"});
|
||||||
final SpellAbility spell = new Spell(card, abCost, target) {
|
final SpellAbility spell = new Spell(card, abCost, target) {
|
||||||
private static final long serialVersionUID = 6499378648382900112L;
|
private static final long serialVersionUID = 6499378648382900112L;
|
||||||
@@ -4228,7 +4256,7 @@ public class CardFactory_Sorceries {
|
|||||||
* When you cycle Decree of Justice, you may pay X. If you do, put X 1/1
|
* When you cycle Decree of Justice, you may pay X. If you do, put X 1/1
|
||||||
* white Soldier creature tokens onto the battlefield.
|
* white Soldier creature tokens onto the battlefield.
|
||||||
*/
|
*/
|
||||||
Ability_Cost abCost = new Ability_Cost("X", cardName, false);
|
Cost abCost = new Cost("X", cardName, false);
|
||||||
final SpellAbility ability = new Ability_Activated(card, abCost, null) {
|
final SpellAbility ability = new Ability_Activated(card, abCost, null) {
|
||||||
private static final long serialVersionUID = -7995897172138409120L;
|
private static final long serialVersionUID = -7995897172138409120L;
|
||||||
|
|
||||||
@@ -1,4 +1,8 @@
|
|||||||
package forge;
|
package forge.card.mana;
|
||||||
|
|
||||||
|
import forge.Card;
|
||||||
|
import forge.Constant;
|
||||||
|
import forge.gui.input.Input_PayManaCostUtil;
|
||||||
|
|
||||||
public class Mana {
|
public class Mana {
|
||||||
private String color;
|
private String color;
|
||||||
@@ -1,16 +1,19 @@
|
|||||||
package forge;
|
package forge.card.mana;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.StringTokenizer;
|
import java.util.StringTokenizer;
|
||||||
|
|
||||||
|
import forge.Constant;
|
||||||
|
import forge.gui.input.Input_PayManaCostUtil;
|
||||||
|
|
||||||
public class ManaCost {
|
public class ManaCost {
|
||||||
//holds Mana_Part objects
|
//holds Mana_Part objects
|
||||||
//ManaPartColor is stored before ManaPartColorless
|
//ManaPartColor is stored before ManaPartColorless
|
||||||
private ArrayList<Object> manaPart;
|
private ArrayList<Object> manaPart;
|
||||||
private HashMap<String,Integer> sunburstMap = new HashMap<String,Integer>();
|
private HashMap<String,Integer> sunburstMap = new HashMap<String,Integer>();
|
||||||
int xcounter = 0;
|
private int xcounter = 0;
|
||||||
|
|
||||||
//manaCost can be like "0", "3", "G", "GW", "10", "3 GW", "10 GW"
|
//manaCost can be like "0", "3", "G", "GW", "10", "3 GW", "10 GW"
|
||||||
//or "split hybrid mana" like "2/G 2/G", "2/B 2/B 2/B"
|
//or "split hybrid mana" like "2/G 2/G", "2/B 2/B 2/B"
|
||||||
@@ -25,7 +28,7 @@ public class ManaCost {
|
|||||||
manaCost = "0";
|
manaCost = "0";
|
||||||
else
|
else
|
||||||
manaCost = manaCost.substring(2);
|
manaCost = manaCost.substring(2);
|
||||||
xcounter++;
|
setXcounter(getXcounter() + 1);
|
||||||
}
|
}
|
||||||
manaPart = split(manaCost);
|
manaPart = split(manaCost);
|
||||||
}
|
}
|
||||||
@@ -203,7 +206,7 @@ public class ManaCost {
|
|||||||
//need to reverse everything since the colored mana is stored first
|
//need to reverse everything since the colored mana is stored first
|
||||||
Collections.reverse(list);
|
Collections.reverse(list);
|
||||||
|
|
||||||
for(int i = 0; i < xcounter; i++)
|
for(int i = 0; i < getXcounter(); i++)
|
||||||
sb.append(" ").append("X");
|
sb.append(" ").append("X");
|
||||||
|
|
||||||
for(int i = 0; i < list.size(); i++) {
|
for(int i = 0; i < list.size(); i++) {
|
||||||
@@ -239,7 +242,7 @@ public class ManaCost {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cmc += 0.00001* xcounter;
|
cmc += 0.00001* getXcounter();
|
||||||
return cmc;
|
return cmc;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -290,4 +293,12 @@ public class ManaCost {
|
|||||||
return new Mana_PartColor(partCost);
|
return new Mana_PartColor(partCost);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setXcounter(int xcounter) {
|
||||||
|
this.xcounter = xcounter;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getXcounter() {
|
||||||
|
return xcounter;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,11 +1,19 @@
|
|||||||
|
|
||||||
package forge;
|
package forge.card.mana;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import forge.AllZoneUtil;
|
||||||
|
import forge.Card;
|
||||||
|
import forge.CardUtil;
|
||||||
|
import forge.Constant;
|
||||||
|
import forge.Player;
|
||||||
|
import forge.card.spellability.Ability_Mana;
|
||||||
|
import forge.card.spellability.SpellAbility;
|
||||||
import forge.gui.GuiUtils;
|
import forge.gui.GuiUtils;
|
||||||
|
import forge.gui.input.Input_PayManaCostUtil;
|
||||||
|
|
||||||
|
|
||||||
public class ManaPool extends Card {
|
public class ManaPool extends Card {
|
||||||
@@ -118,7 +126,6 @@ public class ManaPool extends Card {
|
|||||||
for(Mana m : manaList){
|
for(Mana m : manaList){
|
||||||
addManaToPool(floatingMana, m);
|
addManaToPool(floatingMana, m);
|
||||||
}
|
}
|
||||||
AllZone.GameAction.checkStateEffects();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ArrayList<Mana> convertStringToMana(String manaStr, Card card){
|
public static ArrayList<Mana> convertStringToMana(String manaStr, Card card){
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
package forge;
|
package forge.card.mana;
|
||||||
|
|
||||||
|
|
||||||
public abstract class Mana_Part {
|
public abstract class Mana_Part {
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
|
|
||||||
package forge;
|
package forge.card.mana;
|
||||||
|
|
||||||
|
import forge.gui.input.Input_PayManaCostUtil;
|
||||||
|
|
||||||
|
|
||||||
public class Mana_PartColor extends Mana_Part {
|
public class Mana_PartColor extends Mana_Part {
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package forge;
|
package forge.card.mana;
|
||||||
import forge.error.ErrorViewer;
|
import forge.error.ErrorViewer;
|
||||||
|
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package forge;
|
package forge.card.mana;
|
||||||
public class Mana_PartSnow extends Mana_Part {
|
public class Mana_PartSnow extends Mana_Part {
|
||||||
|
|
||||||
private boolean isPaid = false;
|
private boolean isPaid = false;
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
|
|
||||||
package forge;
|
package forge.card.mana;
|
||||||
|
|
||||||
|
import forge.gui.input.Input_PayManaCostUtil;
|
||||||
|
|
||||||
|
|
||||||
//handles mana costs like 2/R or 2/B
|
//handles mana costs like 2/R or 2/B
|
||||||
@@ -1,4 +1,8 @@
|
|||||||
package forge;
|
package forge.card.mana;
|
||||||
|
|
||||||
|
import forge.Card;
|
||||||
|
import forge.Constant;
|
||||||
|
|
||||||
public class Mana_PartTest
|
public class Mana_PartTest
|
||||||
{
|
{
|
||||||
static void testPayManaCost()
|
static void testPayManaCost()
|
||||||
@@ -1,8 +1,14 @@
|
|||||||
|
|
||||||
package forge;
|
package forge.card.spellability;
|
||||||
|
|
||||||
import com.esotericsoftware.minlog.Log;
|
import com.esotericsoftware.minlog.Log;
|
||||||
|
|
||||||
|
import forge.AllZone;
|
||||||
|
import forge.AllZoneUtil;
|
||||||
|
import forge.Card;
|
||||||
|
import forge.CardList;
|
||||||
|
import forge.CardListFilter;
|
||||||
|
|
||||||
|
|
||||||
abstract public class Ability extends SpellAbility {
|
abstract public class Ability extends SpellAbility {
|
||||||
//Slight hack for Pithing Needle
|
//Slight hack for Pithing Needle
|
||||||
@@ -1,11 +1,18 @@
|
|||||||
|
|
||||||
package forge;
|
package forge.card.spellability;
|
||||||
|
|
||||||
|
import forge.AllZone;
|
||||||
|
import forge.AllZoneUtil;
|
||||||
|
import forge.Card;
|
||||||
|
import forge.CardList;
|
||||||
|
import forge.CardListFilter;
|
||||||
|
import forge.Constant;
|
||||||
|
|
||||||
|
|
||||||
abstract public class Ability_Activated extends SpellAbility implements java.io.Serializable {
|
abstract public class Ability_Activated extends SpellAbility implements java.io.Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
public Ability_Activated(Card sourceCard, Ability_Cost abCost, Target tgt) {
|
public Ability_Activated(Card sourceCard, Cost abCost, Target tgt) {
|
||||||
super(SpellAbility.Ability, sourceCard);
|
super(SpellAbility.Ability, sourceCard);
|
||||||
setManaCost(abCost.getTotalMana());
|
setManaCost(abCost.getTotalMana());
|
||||||
setPayCosts(abCost);
|
setPayCosts(abCost);
|
||||||
@@ -1,7 +1,13 @@
|
|||||||
package forge;
|
package forge.card.spellability;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import forge.AllZone;
|
||||||
|
import forge.AllZoneUtil;
|
||||||
|
import forge.Card;
|
||||||
|
import forge.CardList;
|
||||||
|
import forge.Phase;
|
||||||
|
import forge.card.cardFactory.CardFactoryUtil;
|
||||||
import forge.gui.GuiUtils;
|
import forge.gui.GuiUtils;
|
||||||
|
|
||||||
abstract public class Ability_Mana extends Ability_Activated implements java.io.Serializable {
|
abstract public class Ability_Mana extends Ability_Activated implements java.io.Serializable {
|
||||||
@@ -18,14 +24,14 @@ abstract public class Ability_Mana extends Ability_Activated implements java.io.
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Ability_Mana(Card sourceCard, String parse, String produced, int num) {
|
public Ability_Mana(Card sourceCard, String parse, String produced, int num) {
|
||||||
this(sourceCard, new Ability_Cost(parse, sourceCard.getName(), true), produced, num);
|
this(sourceCard, new Cost(parse, sourceCard.getName(), true), produced, num);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Ability_Mana(Card sourceCard, Ability_Cost cost, String produced) {
|
public Ability_Mana(Card sourceCard, Cost cost, String produced) {
|
||||||
this(sourceCard, cost, produced, 1);
|
this(sourceCard, cost, produced, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Ability_Mana(Card sourceCard, Ability_Cost cost, String produced, int num) {
|
public Ability_Mana(Card sourceCard, Cost cost, String produced, int num) {
|
||||||
super(sourceCard, cost, null);
|
super(sourceCard, cost, null);
|
||||||
|
|
||||||
origProduced = produced;
|
origProduced = produced;
|
||||||
@@ -84,10 +90,10 @@ abstract public class Ability_Mana extends Ability_Activated implements java.io.
|
|||||||
if (source.getType().contains("Island")){
|
if (source.getType().contains("Island")){
|
||||||
// If High Tide triggers, make mana undoable
|
// If High Tide triggers, make mana undoable
|
||||||
|
|
||||||
int size = Phase.HighTides.size();
|
int size = Phase.getHighTides().size();
|
||||||
for(int i = 0; i < size; i++){
|
for(int i = 0; i < size; i++){
|
||||||
this.undoable = false;
|
this.undoable = false;
|
||||||
AllZone.ManaPool.addManaToFloating("U", Phase.HighTides.get(i));
|
AllZone.ManaPool.addManaToFloating("U", Phase.getHighTides().get(i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,7 +1,9 @@
|
|||||||
package forge;
|
package forge.card.spellability;
|
||||||
|
|
||||||
import com.esotericsoftware.minlog.Log;
|
import com.esotericsoftware.minlog.Log;
|
||||||
|
|
||||||
|
import forge.Card;
|
||||||
|
|
||||||
abstract public class Ability_Static extends Ability {
|
abstract public class Ability_Static extends Ability {
|
||||||
public Ability_Static(Card sourceCard, String manaCost) {
|
public Ability_Static(Card sourceCard, String manaCost) {
|
||||||
super(sourceCard, manaCost);
|
super(sourceCard, manaCost);
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
package forge;
|
package forge.card.spellability;
|
||||||
|
|
||||||
|
import forge.Card;
|
||||||
|
|
||||||
abstract public class Ability_Sub extends SpellAbility implements java.io.Serializable {
|
abstract public class Ability_Sub extends SpellAbility implements java.io.Serializable {
|
||||||
private static final long serialVersionUID = 4650634415821733134L;
|
private static final long serialVersionUID = 4650634415821733134L;
|
||||||
@@ -1,9 +1,14 @@
|
|||||||
|
|
||||||
package forge;
|
package forge.card.spellability;
|
||||||
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
import forge.Card;
|
||||||
|
import forge.CardList;
|
||||||
|
import forge.Command;
|
||||||
|
import forge.ZCTrigger;
|
||||||
|
|
||||||
|
|
||||||
public class Ability_Triggered extends Ability implements Command {
|
public class Ability_Triggered extends Ability implements Command {
|
||||||
|
|
||||||
@@ -1,8 +1,13 @@
|
|||||||
package forge;
|
package forge.card.spellability;
|
||||||
|
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
public class Ability_Cost {
|
import forge.AllZone;
|
||||||
|
import forge.Card;
|
||||||
|
import forge.Counters;
|
||||||
|
import forge.card.mana.ManaCost;
|
||||||
|
|
||||||
|
public class Cost {
|
||||||
private boolean isAbility = true;
|
private boolean isAbility = true;
|
||||||
|
|
||||||
private boolean sacCost = false;
|
private boolean sacCost = false;
|
||||||
@@ -116,7 +121,7 @@ public class Ability_Cost {
|
|||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
public Ability_Cost(String parse, String cardName, boolean bAbility)
|
public Cost(String parse, String cardName, boolean bAbility)
|
||||||
{
|
{
|
||||||
isAbility = bAbility;
|
isAbility = bAbility;
|
||||||
// when adding new costs for cost string, place them here
|
// when adding new costs for cost string, place them here
|
||||||
@@ -1,16 +1,31 @@
|
|||||||
package forge;
|
package forge.card.spellability;
|
||||||
|
|
||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
|
|
||||||
|
import forge.AllZone;
|
||||||
|
import forge.AllZoneUtil;
|
||||||
|
import forge.ButtonUtil;
|
||||||
|
import forge.Card;
|
||||||
|
import forge.CardList;
|
||||||
|
import forge.CardListFilter;
|
||||||
|
import forge.ComputerUtil;
|
||||||
|
import forge.Constant;
|
||||||
|
import forge.Counters;
|
||||||
|
import forge.Phase;
|
||||||
|
import forge.PlayerZone;
|
||||||
|
import forge.card.abilityFactory.AbilityFactory;
|
||||||
|
import forge.card.mana.ManaCost;
|
||||||
import forge.gui.GuiUtils;
|
import forge.gui.GuiUtils;
|
||||||
|
import forge.gui.input.Input;
|
||||||
|
import forge.gui.input.Input_PayManaCostUtil;
|
||||||
|
|
||||||
public class Cost_Payment {
|
public class Cost_Payment {
|
||||||
private Ability_Cost cost = null;
|
private Cost cost = null;
|
||||||
private SpellAbility ability = null;
|
private SpellAbility ability = null;
|
||||||
private Card card = null;
|
private Card card = null;
|
||||||
private SpellAbility_Requirements req = null;
|
private SpellAbility_Requirements req = null;
|
||||||
|
|
||||||
public Ability_Cost getCost() { return cost; }
|
public Cost getCost() { return cost; }
|
||||||
public SpellAbility getAbility() { return ability; }
|
public SpellAbility getAbility() { return ability; }
|
||||||
public Card getCard() { return card; }
|
public Card getCard() { return card; }
|
||||||
|
|
||||||
@@ -53,7 +68,7 @@ public class Cost_Payment {
|
|||||||
public void setPayTapXType(boolean bTapX) { payTapXType = bTapX; }
|
public void setPayTapXType(boolean bTapX) { payTapXType = bTapX; }
|
||||||
public void setPayReturn(boolean bReturn){ payReturn = bReturn; }
|
public void setPayReturn(boolean bReturn){ payReturn = bReturn; }
|
||||||
|
|
||||||
public Cost_Payment(Ability_Cost cost, SpellAbility abil){
|
public Cost_Payment(Cost cost, SpellAbility abil){
|
||||||
this.cost = cost;
|
this.cost = cost;
|
||||||
this.ability = abil;
|
this.ability = abil;
|
||||||
card = this.ability.getSourceCard();
|
card = this.ability.getSourceCard();
|
||||||
@@ -73,7 +88,7 @@ public class Cost_Payment {
|
|||||||
payReturn = !cost.getReturnCost();
|
payReturn = !cost.getReturnCost();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean canPayAdditionalCosts(Ability_Cost cost, SpellAbility ability){
|
public static boolean canPayAdditionalCosts(Cost cost, SpellAbility ability){
|
||||||
if (cost == null)
|
if (cost == null)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
@@ -500,7 +515,7 @@ public class Cost_Payment {
|
|||||||
if (cost.getExileFromHandThis())
|
if (cost.getExileFromHandThis())
|
||||||
exileFromHandCard.add(card);
|
exileFromHandCard.add(card);
|
||||||
else
|
else
|
||||||
exileFromHandCard = ComputerUtil.chooseExileFromHandType(cost.getExileFromHandType(), card, ability.getTargetCard(), cost.getExileFromHandAmount());
|
exileFromHandCard = ComputerUtil.chooseExileType(cost.getExileFromHandType(), card, ability.getTargetCard(), cost.getExileFromHandAmount());
|
||||||
|
|
||||||
if (exileFromHandCard.size() != cost.getExileFromHandAmount()){
|
if (exileFromHandCard.size() != cost.getExileFromHandAmount()){
|
||||||
System.out.println("Couldn't find a valid card to exile for: "+card.getName());
|
System.out.println("Couldn't find a valid card to exile for: "+card.getName());
|
||||||
@@ -648,7 +663,7 @@ public class Cost_Payment {
|
|||||||
public static Input input_payMana(final SpellAbility sa, final Cost_Payment payment, int manaToAdd){
|
public static Input input_payMana(final SpellAbility sa, final Cost_Payment payment, int manaToAdd){
|
||||||
final ManaCost manaCost;
|
final ManaCost manaCost;
|
||||||
|
|
||||||
if(Phase.GameBegins == 1) {
|
if(Phase.getGameBegins() == 1) {
|
||||||
if(sa.getSourceCard().isCopiedSpell() && sa.isSpell()) {
|
if(sa.getSourceCard().isCopiedSpell() && sa.isSpell()) {
|
||||||
manaCost = new ManaCost("0");
|
manaCost = new ManaCost("0");
|
||||||
} else {
|
} else {
|
||||||
@@ -1,4 +1,8 @@
|
|||||||
package forge;
|
package forge.card.spellability;
|
||||||
|
import forge.AllZone;
|
||||||
|
import forge.Card;
|
||||||
|
import forge.Constant;
|
||||||
|
import forge.Phase;
|
||||||
import forge.error.ErrorViewer;
|
import forge.error.ErrorViewer;
|
||||||
|
|
||||||
|
|
||||||
@@ -14,7 +18,7 @@ abstract public class Spell extends SpellAbility implements java.io.Serializable
|
|||||||
getRestrictions().setActivateZone(Constant.Zone.Hand);
|
getRestrictions().setActivateZone(Constant.Zone.Hand);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Spell(Card sourceCard, Ability_Cost abCost, Target abTgt) {
|
public Spell(Card sourceCard, Cost abCost, Target abTgt) {
|
||||||
super(SpellAbility.Spell, sourceCard);
|
super(SpellAbility.Spell, sourceCard);
|
||||||
|
|
||||||
setManaCost(sourceCard.getManaCost());
|
setManaCost(sourceCard.getManaCost());
|
||||||
@@ -1,8 +1,17 @@
|
|||||||
|
|
||||||
package forge;
|
package forge.card.spellability;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import forge.Card;
|
||||||
|
import forge.CardList;
|
||||||
|
import forge.Command;
|
||||||
|
import forge.CommandArgs;
|
||||||
|
import forge.Player;
|
||||||
|
import forge.card.abilityFactory.AbilityFactory;
|
||||||
|
import forge.card.mana.Mana;
|
||||||
|
import forge.gui.input.Input;
|
||||||
|
|
||||||
|
|
||||||
//only SpellAbility can go on the stack
|
//only SpellAbility can go on the stack
|
||||||
//override any methods as needed
|
//override any methods as needed
|
||||||
@@ -47,7 +56,7 @@ public abstract class SpellAbility {
|
|||||||
private Input afterResolve;
|
private Input afterResolve;
|
||||||
private Input afterPayMana;
|
private Input afterPayMana;
|
||||||
|
|
||||||
protected Ability_Cost payCosts = null;
|
protected Cost payCosts = null;
|
||||||
protected Target chosenTarget = null;
|
protected Target chosenTarget = null;
|
||||||
|
|
||||||
private SpellAbility_Restriction restrictions = new SpellAbility_Restriction();
|
private SpellAbility_Restriction restrictions = new SpellAbility_Restriction();
|
||||||
@@ -258,11 +267,11 @@ public abstract class SpellAbility {
|
|||||||
afterPayMana = in;
|
afterPayMana = in;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Ability_Cost getPayCosts() {
|
public Cost getPayCosts() {
|
||||||
return payCosts;
|
return payCosts;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPayCosts(Ability_Cost abCost) {
|
public void setPayCosts(Cost abCost) {
|
||||||
payCosts = abCost;
|
payCosts = abCost;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
|
|
||||||
package forge;
|
package forge.card.spellability;
|
||||||
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import forge.ComputerUtil;
|
||||||
|
|
||||||
|
|
||||||
public class SpellAbilityList {
|
public class SpellAbilityList {
|
||||||
private ArrayList<SpellAbility> list = new ArrayList<SpellAbility>();
|
private ArrayList<SpellAbility> list = new ArrayList<SpellAbility>();
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
package forge;
|
package forge.card.spellability;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import forge.AllZoneUtil;
|
||||||
|
import forge.Card;
|
||||||
|
import forge.CardList;
|
||||||
|
import forge.CardListFilter;
|
||||||
|
import forge.CardUtil;
|
||||||
|
import forge.Player;
|
||||||
|
import forge.UndoCommand;
|
||||||
|
|
||||||
public class SpellAbilityUtil
|
public class SpellAbilityUtil
|
||||||
{
|
{
|
||||||
//only works for MONO-COLORED spells
|
//only works for MONO-COLORED spells
|
||||||
@@ -1,7 +1,11 @@
|
|||||||
package forge;
|
package forge.card.spellability;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import forge.AllZone;
|
||||||
|
import forge.Card;
|
||||||
|
import forge.PlayerZone;
|
||||||
|
|
||||||
public class SpellAbility_Requirements {
|
public class SpellAbility_Requirements {
|
||||||
private SpellAbility ability = null;
|
private SpellAbility ability = null;
|
||||||
private Target_Selection select = null;
|
private Target_Selection select = null;
|
||||||
@@ -1,7 +1,16 @@
|
|||||||
package forge;
|
package forge.card.spellability;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import forge.AllZone;
|
||||||
|
import forge.AllZoneUtil;
|
||||||
|
import forge.Card;
|
||||||
|
import forge.CardList;
|
||||||
|
import forge.Constant;
|
||||||
|
import forge.Phase;
|
||||||
|
import forge.Player;
|
||||||
|
import forge.card.cardFactory.CardFactoryUtil;
|
||||||
|
|
||||||
public class SpellAbility_Restriction {
|
public class SpellAbility_Restriction {
|
||||||
// A class for handling SpellAbility Restrictions. These restrictions include:
|
// A class for handling SpellAbility Restrictions. These restrictions include:
|
||||||
// Zone, Phase, OwnTurn, Speed (instant/sorcery), Amount per Turn, Player,
|
// Zone, Phase, OwnTurn, Speed (instant/sorcery), Amount per Turn, Player,
|
||||||
@@ -128,7 +137,7 @@ public class SpellAbility_Restriction {
|
|||||||
int levelMax = 0;
|
int levelMax = 0;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
SpellAbility_Restriction(){ }
|
public SpellAbility_Restriction(){ }
|
||||||
|
|
||||||
public boolean canPlay(Card c, SpellAbility sa){
|
public boolean canPlay(Card c, SpellAbility sa){
|
||||||
if (!AllZone.getZone(c).getZoneName().equals(activateZone))
|
if (!AllZone.getZone(c).getZoneName().equals(activateZone))
|
||||||
@@ -1,5 +1,8 @@
|
|||||||
|
|
||||||
package forge;
|
package forge.card.spellability;
|
||||||
|
|
||||||
|
import forge.AllZone;
|
||||||
|
import forge.Card;
|
||||||
|
|
||||||
|
|
||||||
public class Spell_Evoke extends Spell_Permanent {
|
public class Spell_Evoke extends Spell_Permanent {
|
||||||
@@ -1,5 +1,18 @@
|
|||||||
|
|
||||||
package forge;
|
package forge.card.spellability;
|
||||||
|
|
||||||
|
import forge.AllZone;
|
||||||
|
import forge.AllZoneUtil;
|
||||||
|
import forge.ButtonUtil;
|
||||||
|
import forge.Card;
|
||||||
|
import forge.CardList;
|
||||||
|
import forge.Command;
|
||||||
|
import forge.CommandReturn;
|
||||||
|
import forge.Constant;
|
||||||
|
import forge.Player;
|
||||||
|
import forge.card.cardFactory.CardFactory;
|
||||||
|
import forge.card.cardFactory.CardFactoryUtil;
|
||||||
|
import forge.gui.input.Input;
|
||||||
|
|
||||||
|
|
||||||
public class Spell_Permanent extends Spell {
|
public class Spell_Permanent extends Spell {
|
||||||
@@ -1,7 +1,14 @@
|
|||||||
package forge;
|
package forge.card.spellability;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import forge.AllZone;
|
||||||
|
import forge.Card;
|
||||||
|
import forge.Constant;
|
||||||
|
import forge.Player;
|
||||||
|
import forge.card.abilityFactory.AbilityFactory;
|
||||||
|
import forge.card.cardFactory.CardFactoryUtil;
|
||||||
|
|
||||||
public class Target {
|
public class Target {
|
||||||
private boolean bMandatory = false;
|
private boolean bMandatory = false;
|
||||||
private Card srcCard;
|
private Card srcCard;
|
||||||
@@ -1,8 +1,18 @@
|
|||||||
package forge;
|
package forge.card.spellability;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import forge.AllZone;
|
||||||
|
import forge.AllZoneUtil;
|
||||||
|
import forge.ButtonUtil;
|
||||||
|
import forge.Card;
|
||||||
|
import forge.CardList;
|
||||||
|
import forge.Constant;
|
||||||
|
import forge.Player;
|
||||||
|
import forge.PlayerZone;
|
||||||
|
import forge.card.cardFactory.CardFactoryUtil;
|
||||||
import forge.gui.GuiUtils;
|
import forge.gui.GuiUtils;
|
||||||
|
import forge.gui.input.Input;
|
||||||
|
|
||||||
public class Target_Selection {
|
public class Target_Selection {
|
||||||
private Target target = null;
|
private Target target = null;
|
||||||
@@ -1,8 +1,16 @@
|
|||||||
package forge;
|
package forge.card.trigger;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import forge.AllZone;
|
||||||
|
import forge.AllZoneUtil;
|
||||||
|
import forge.Card;
|
||||||
|
import forge.CardList;
|
||||||
|
import forge.Player;
|
||||||
|
import forge.card.cardFactory.CardFactoryUtil;
|
||||||
|
import forge.card.spellability.SpellAbility;
|
||||||
|
|
||||||
public abstract class Trigger {
|
public abstract class Trigger {
|
||||||
|
|
||||||
protected String name;
|
protected String name;
|
||||||
@@ -167,7 +175,7 @@ public abstract class Trigger {
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if(mapParams.get("PlayersPoisoned").equals("Each") && !(hostCard.getController().poisonCounters != 0 && hostCard.getController().getPoisonCounters() != 0 ))
|
else if(mapParams.get("PlayersPoisoned").equals("Each") && !(hostCard.getController().getPoisonCounters() != 0 && hostCard.getController().getPoisonCounters() != 0 ))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -222,7 +230,7 @@ public abstract class Trigger {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean matchesValid(Object o,String[] valids,Card srcCard)
|
public boolean matchesValid(Object o,String[] valids,Card srcCard)
|
||||||
{
|
{
|
||||||
if(o instanceof Card)
|
if(o instanceof Card)
|
||||||
{
|
{
|
||||||
@@ -1,8 +1,26 @@
|
|||||||
package forge;
|
package forge.card.trigger;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import forge.AllZone;
|
||||||
|
import forge.AllZoneUtil;
|
||||||
|
import forge.Card;
|
||||||
|
import forge.CardList;
|
||||||
|
import forge.Command;
|
||||||
|
import forge.CommandArgs;
|
||||||
|
import forge.ComputerUtil;
|
||||||
|
import forge.GameActionUtil;
|
||||||
|
import forge.Player;
|
||||||
|
import forge.card.abilityFactory.AbilityFactory;
|
||||||
|
import forge.card.spellability.Ability;
|
||||||
|
import forge.card.spellability.Ability_Sub;
|
||||||
|
import forge.card.spellability.Cost;
|
||||||
|
import forge.card.spellability.SpellAbility;
|
||||||
|
import forge.card.spellability.SpellAbility_Restriction;
|
||||||
|
import forge.card.spellability.Target;
|
||||||
|
import forge.gui.input.Input;
|
||||||
|
|
||||||
public class TriggerHandler {
|
public class TriggerHandler {
|
||||||
|
|
||||||
private ArrayList<Trigger> registeredTriggers = new ArrayList<Trigger>();
|
private ArrayList<Trigger> registeredTriggers = new ArrayList<Trigger>();
|
||||||
@@ -750,7 +768,7 @@ public class TriggerHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setPayCosts(Ability_Cost abCost)
|
public void setPayCosts(Cost abCost)
|
||||||
{
|
{
|
||||||
sa[0].setPayCosts(abCost);
|
sa[0].setPayCosts(abCost);
|
||||||
}
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user