From cec608b8d0525ca92194c82e0002b7787048981f Mon Sep 17 00:00:00 2001 From: swordshine Date: Mon, 28 May 2018 21:33:45 +0800 Subject: [PATCH 1/4] - Added Will Kenrith --- .../res/cardsfolder/upcoming/will_kenrith.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 forge-gui/res/cardsfolder/upcoming/will_kenrith.txt diff --git a/forge-gui/res/cardsfolder/upcoming/will_kenrith.txt b/forge-gui/res/cardsfolder/upcoming/will_kenrith.txt new file mode 100644 index 00000000000..fb1b14ab01f --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/will_kenrith.txt @@ -0,0 +1,15 @@ +Name:Will Kenrith +ManaCost:4 U U +Types:Legendary Planeswalker Will +Loyalty:4 +Text:CARDNAME can be your commander. +K:Partner:Rowan Kenrith +A:AB$ Animate | Cost$ AddCounter<2/LOYALTY> | Planeswalker$ True | UntilYourNextTurn$ True | ValidTgts$ Creature | TargetMin$ 0 | TargetMax$ 2 | Power$ 0 | Toughness$ 3 | IsCurse$ True | RemoveAllAbilities$ True | SpellDescription$ Until your next turn, up to two target creatures each have base power and toughness 0/3 and lose all abilities. +A:AB$ Draw | Cost$ SubCounter<2/LOYALTY> | Planeswalker$ True | ValidTgts$ Player | NumCards$ 2 | SubAbility$ DBEffect | SpellDescription$ Target player draws two cards. Until your next turn, instant, sorcery, and planeswalker spells that player casts cost {2} less to cast. +SVar:DBEffect:DB$ Effect | StaticAbilities$ WillReduceCost | RememberObjects$ Targeted | Duration$ UntilYourNextTurn +SVar:WillReduceCost:Mode$ ReduceCost | EffectZone$ Command | ValidCard$ Instant,Sorcery,Planeswalker | Type$ Spell | Activator$ Player.IsRemembered | Amount$ 2 | Description$ Until your next turn, instant, sorcery, and planeswalker spells that player casts cost {2} less to cast. +A:AB$ Effect | Cost$ SubCounter<8/LOYALTY> | Planeswalker$ True | Ultimate$ True | ValidTgts$ Player | EffectOwner$ Targeted | Name$ Emblem - Will Kenrith | Image$ emblem_will_kenrith | Triggers$ CopySpell | SVars$ TrigCopy | Duration$ Permanent | AILogic$ Always | SpellDescription$ Target player gets an emblem with "Whenever you cast an instant or sorcery spell, copy it. You may choose new targets for the copy." +SVar:CopySpell:Mode$ SpellCast | ValidCard$ Instant,Sorcery | ValidActivatingPlayer$ You | Execute$ TrigCopy | TriggerZones$ Command | TriggerDescription$ Whenever you cast an instant or sorcery spell, copy it. You may choose new targets for the copy. +SVar:TrigCopy:DB$ CopySpellAbility | Defined$ TriggeredSpellAbility +DeckHints:Name$Rowan Kenrith +Oracle:[+2]: Until your next turn, up to two target creatures each have base power and toughness 0/3 and lose all abilities.\n[-2]: Target player draws two cards. Until your next turn, instant, sorcery, and planeswalker spells that player casts cost {2} less to cast.\n[-8]: Target player gets an emblem with "Whenever you cast an instant or sorcery spell, copy it. You may choose new targets for the copy."\nPartner with Rowan Kenrith\nWill Kenrith can be your commander. From 52d3318a9cbad8b3e892671dc13e067c37c15741 Mon Sep 17 00:00:00 2001 From: swordshine Date: Mon, 28 May 2018 21:35:19 +0800 Subject: [PATCH 2/4] - Updated some scripts for multiplayer --- .../java/forge/game/ability/effects/AnimateEffect.java | 2 ++ .../src/main/java/forge/game/cost/CostAdjustment.java | 4 ++++ .../game/staticability/StaticAbilityCantBeCast.java | 10 ++++++++++ forge-gui/res/cardsfolder/c/city_of_solitude.txt | 6 ++---- forge-gui/res/cardsfolder/d/defense_grid.txt | 3 +-- forge-gui/res/cardsfolder/d/dosan_the_falling_leaf.txt | 3 +-- .../res/cardsfolder/upcoming/khorvath_brightflame.txt | 1 + .../res/cardsfolder/upcoming/sylvia_brightspear.txt | 1 + 8 files changed, 22 insertions(+), 8 deletions(-) diff --git a/forge-game/src/main/java/forge/game/ability/effects/AnimateEffect.java b/forge-game/src/main/java/forge/game/ability/effects/AnimateEffect.java index cb4429f3e25..59c9f4a5a93 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/AnimateEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/AnimateEffect.java @@ -466,6 +466,8 @@ public class AnimateEffect extends AnimateEffectBase { sb.append(" until ").append(host).append(" leaves the battlefield."); } else if (sa.hasParam("UntilYourNextUpkeep")) { sb.append(" until your next upkeep."); + } else if (sa.hasParam("UntilYourNextTurn")) { + sb.append(" until your next turn."); } else if (sa.hasParam("UntilControllerNextUntap")) { sb.append(" until its controller's next untap step."); } else { diff --git a/forge-game/src/main/java/forge/game/cost/CostAdjustment.java b/forge-game/src/main/java/forge/game/cost/CostAdjustment.java index 82bfc0608db..70d6c91083d 100644 --- a/forge-game/src/main/java/forge/game/cost/CostAdjustment.java +++ b/forge-game/src/main/java/forge/game/cost/CostAdjustment.java @@ -440,6 +440,10 @@ public class CostAdjustment { || !activator.isValid(params.get("Activator"), controller, hostCard, sa))) { return false; } + if (params.containsKey("NonActivatorTurn") && ((activator == null) + || hostCard.getGame().getPhaseHandler().isPlayerTurn(activator))) { + return false; + } if (params.containsKey("Type")) { final String type = params.get("Type"); diff --git a/forge-game/src/main/java/forge/game/staticability/StaticAbilityCantBeCast.java b/forge-game/src/main/java/forge/game/staticability/StaticAbilityCantBeCast.java index 48474fc9242..49a95c13fa6 100644 --- a/forge-game/src/main/java/forge/game/staticability/StaticAbilityCantBeCast.java +++ b/forge-game/src/main/java/forge/game/staticability/StaticAbilityCantBeCast.java @@ -67,6 +67,11 @@ public class StaticAbilityCantBeCast { } } + if (params.containsKey("NonCasterTurn") && (activator != null) + && activator.getGame().getPhaseHandler().isPlayerTurn(activator)) { + return false; + } + if (params.containsKey("NumLimitEachTurn") && activator != null) { int limit = Integer.parseInt(params.get("NumLimitEachTurn")); String valid = params.containsKey("ValidCard") ? params.get("ValidCard") : "Card"; @@ -127,6 +132,11 @@ public class StaticAbilityCantBeCast { return false; } + if (params.containsKey("NonActivatorTurn") && (activator != null) + && activator.getGame().getPhaseHandler().isPlayerTurn(activator)) { + return false; + } + return true; } diff --git a/forge-gui/res/cardsfolder/c/city_of_solitude.txt b/forge-gui/res/cardsfolder/c/city_of_solitude.txt index c6e63509b87..b47a9677d30 100644 --- a/forge-gui/res/cardsfolder/c/city_of_solitude.txt +++ b/forge-gui/res/cardsfolder/c/city_of_solitude.txt @@ -1,10 +1,8 @@ Name:City of Solitude ManaCost:2 G Types:Enchantment -S:Mode$ CantBeCast | ValidCard$ Card | Condition$ PlayerTurn | Caster$ Opponent | Description$ Players can cast spells and activate abilities only during their own turns. -S:Mode$ CantBeCast | ValidCard$ Card | Condition$ NotPlayerTurn | Caster$ You -S:Mode$ CantBeActivated | ValidCard$ Card | Condition$ PlayerTurn | Activator$ Opponent -S:Mode$ CantBeActivated | ValidCard$ Card | Condition$ NotPlayerTurn | Activator$ You +S:Mode$ CantBeCast | ValidCard$ Card | NonCasterTurn$ True | Description$ Players can cast spells and activate abilities only during their own turns. +S:Mode$ CantBeActivated | ValidCard$ Card | NonActivatorTurn$ True SVar:NonStackingEffect:True SVar:RemRandomDeck:True SVar:Picture:http://wizards.com/global/images/magic/general/city_of_solitude.jpg diff --git a/forge-gui/res/cardsfolder/d/defense_grid.txt b/forge-gui/res/cardsfolder/d/defense_grid.txt index c93603e4e31..81dfc3151cd 100644 --- a/forge-gui/res/cardsfolder/d/defense_grid.txt +++ b/forge-gui/res/cardsfolder/d/defense_grid.txt @@ -1,8 +1,7 @@ Name:Defense Grid ManaCost:2 Types:Artifact -S:Mode$ RaiseCost | Activator$ You | Type$ Spell | Amount$ 3 | Condition$ NotPlayerTurn | Description$ Each spell costs {3} more to cast except during its controller's turn. -S:Mode$ RaiseCost | Activator$ Opponent | Type$ Spell | Amount$ 3 | Condition$ PlayerTurn +S:Mode$ RaiseCost | Activator$ Player | Type$ Spell | Amount$ 3 | NonActivatorTurn$ True | Description$ Each spell costs {3} more to cast except during its controller's turn. SVar:RemRandomDeck:True SVar:Picture:http://www.wizards.com/global/images/magic/general/defense_grid.jpg Oracle:Each spell costs {3} more to cast except during its controller's turn. diff --git a/forge-gui/res/cardsfolder/d/dosan_the_falling_leaf.txt b/forge-gui/res/cardsfolder/d/dosan_the_falling_leaf.txt index 72b6c56a5b4..620bcfddbbd 100644 --- a/forge-gui/res/cardsfolder/d/dosan_the_falling_leaf.txt +++ b/forge-gui/res/cardsfolder/d/dosan_the_falling_leaf.txt @@ -2,7 +2,6 @@ Name:Dosan the Falling Leaf ManaCost:1 G G Types:Legendary Creature Human Monk PT:2/2 -S:Mode$ CantBeCast | ValidCard$ Card | Condition$ PlayerTurn | Caster$ Opponent | Description$ Players can cast spells only during their own turns. -S:Mode$ CantBeCast | ValidCard$ Card | Condition$ NotPlayerTurn | Caster$ You +S:Mode$ CantBeCast | ValidCard$ Card | NonCasterTurn$ True | Description$ Players can cast spells only during their own turns. SVar:Picture:http://www.wizards.com/global/images/magic/general/dosan_the_falling_leaf.jpg Oracle:Players can cast spells only during their own turns. diff --git a/forge-gui/res/cardsfolder/upcoming/khorvath_brightflame.txt b/forge-gui/res/cardsfolder/upcoming/khorvath_brightflame.txt index 405c6dd451f..f32a231d8fc 100644 --- a/forge-gui/res/cardsfolder/upcoming/khorvath_brightflame.txt +++ b/forge-gui/res/cardsfolder/upcoming/khorvath_brightflame.txt @@ -6,5 +6,6 @@ K:Partner:Sylvia Brightspear:Sylvia K:Flying K:Haste S:Mode$ Continuous | Affected$ Knight.YourTeamCtrl | AddKeyword$ Flying & Haste | Description$ Knights your team controls have flying and haste. +DeckHints:Name$Sylvia Brightspear SVar:Picture:http://www.wizards.com/global/images/magic/general/khorvath_brightflame.jpg Oracle:Partner with Sylvia Brightspear (When this creature enters the battlefield, target player may put Sylvia into their hand from their library, then shuffle.)\nFlying, haste\nKnights your team controls have flying and haste. diff --git a/forge-gui/res/cardsfolder/upcoming/sylvia_brightspear.txt b/forge-gui/res/cardsfolder/upcoming/sylvia_brightspear.txt index 64368245c67..7039b061e0d 100644 --- a/forge-gui/res/cardsfolder/upcoming/sylvia_brightspear.txt +++ b/forge-gui/res/cardsfolder/upcoming/sylvia_brightspear.txt @@ -5,5 +5,6 @@ PT:2/2 K:Partner:Khorvath Brightflame:Khorvath K:Double Strike S:Mode$ Continuous | Affected$ Dragon.YourTeamCtrl | AddKeyword$ Double Strike | Description$ Dragons your team controls have double strike. +DeckHints:Name$Khorvath Brightflame SVar:Picture:http://www.wizards.com/global/images/magic/general/sylvia_brightspear.jpg Oracle:Partner with Khorvath Brightflame (When this creature enters the battlefield, target player may put Khorvath into their hand from their library, then shuffle.)\nDouble strike\nDragons your team controls have double strike. From 1b7bdd2e57fa1a55ea66272b4309848bb351d3e9 Mon Sep 17 00:00:00 2001 From: swordshine Date: Mon, 28 May 2018 22:40:34 +0800 Subject: [PATCH 3/4] - Added Demon/Angel Partners --- .../main/java/forge/game/ability/AbilityUtils.java | 4 ++++ .../src/main/java/forge/game/player/Player.java | 8 ++++++++ .../main/java/forge/game/player/PlayerProperty.java | 4 ++++ .../res/cardsfolder/upcoming/krav_the_unredeemed.txt | 12 ++++++++++++ .../res/cardsfolder/upcoming/regna_the_redeemer.txt | 11 +++++++++++ 5 files changed, 39 insertions(+) create mode 100644 forge-gui/res/cardsfolder/upcoming/krav_the_unredeemed.txt create mode 100644 forge-gui/res/cardsfolder/upcoming/regna_the_redeemer.txt diff --git a/forge-game/src/main/java/forge/game/ability/AbilityUtils.java b/forge-game/src/main/java/forge/game/ability/AbilityUtils.java index a8cbaba37bc..dfd17fce19f 100644 --- a/forge-game/src/main/java/forge/game/ability/AbilityUtils.java +++ b/forge-game/src/main/java/forge/game/ability/AbilityUtils.java @@ -439,6 +439,10 @@ public class AbilityUtils { players.addAll(game.getPlayers()); val = CardFactoryUtil.playerXCount(players, calcX[1], card); } + else if (hType.equals("YourTeam")) { + players.addAll(player.getYourTeam()); + val = CardFactoryUtil.playerXCount(players, calcX[1], card); + } else if (hType.equals("Opponents")) { players.addAll(player.getOpponents()); val = CardFactoryUtil.playerXCount(players, calcX[1], card); diff --git a/forge-game/src/main/java/forge/game/player/Player.java b/forge-game/src/main/java/forge/game/player/Player.java index fc3db4f65d1..64797d921d6 100644 --- a/forge-game/src/main/java/forge/game/player/Player.java +++ b/forge-game/src/main/java/forge/game/player/Player.java @@ -309,6 +309,14 @@ public class Player extends GameEntity implements Comparable { return getAllOtherPlayers().filter(Predicates.not(PlayerPredicates.isOpponentOf(this))); } + /** + * returns allied players. + * Should keep player relations somewhere in the match structure + */ + public final PlayerCollection getYourTeam() { + return game.getPlayers().filter(Predicates.not(PlayerPredicates.isOpponentOf(this))); + } + /** * returns all other players. * Should keep player relations somewhere in the match structure diff --git a/forge-game/src/main/java/forge/game/player/PlayerProperty.java b/forge-game/src/main/java/forge/game/player/PlayerProperty.java index 1fe534d07db..7658f93b2be 100644 --- a/forge-game/src/main/java/forge/game/player/PlayerProperty.java +++ b/forge-game/src/main/java/forge/game/player/PlayerProperty.java @@ -38,6 +38,10 @@ public class PlayerProperty { return false; } } + } else if (property.equals("YourTeam")) { + if (player.isOpponentOf(sourceController)) { + return false; + } } else if (property.equals("Allies")) { if (player.equals(sourceController) || player.isOpponentOf(sourceController)) { return false; diff --git a/forge-gui/res/cardsfolder/upcoming/krav_the_unredeemed.txt b/forge-gui/res/cardsfolder/upcoming/krav_the_unredeemed.txt new file mode 100644 index 00000000000..c0d8d075ad4 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/krav_the_unredeemed.txt @@ -0,0 +1,12 @@ +Name:Krav, the Unredeemed +ManaCost:4 B +Types:Legendary Creature Demon +PT:3/3 +K:Partner:Regna, the Redeemer:Regna +K:Flying +A:AB$ Draw | Cost$ B Sac | ValidTgts$ Player | TgtPrompt$ Choose a player | NumCards$ ChosenX | References$ X | SubAbility$ DBGainLife | SpellDescription$ Target player draws X cards and gains X life. Put X +1/+1 counters on CARDNAME. +SVar:DBGainLife:DB$ GainLife | Defined$ Targeted | LifeAmount$ ChosenX | References$ X | SubAbility$ DBPutCounter +SVar:DBPutCounter:DB$ PutCounter | Defined$ Self | CounterType$ P1P1 | CounterNum$ ChosenX | References$ X +SVar:X:XChoice +DeckHints:Name$Regna, the Redeemer +Oracle:Partner with Regna, the Redeemer (When this creature enters the battlefield, target player may put Regna into their hand from their library, then shuffle.)\n{B}, Sacrifice X creatures: Target player draws X cards and gains X life. Put X +1/+1 counters on Krav, the Unredeemed. diff --git a/forge-gui/res/cardsfolder/upcoming/regna_the_redeemer.txt b/forge-gui/res/cardsfolder/upcoming/regna_the_redeemer.txt new file mode 100644 index 00000000000..f668a6a43d2 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/regna_the_redeemer.txt @@ -0,0 +1,11 @@ +Name:Regna, the Redeemer +ManaCost:5 W +Types:Legendary Creature Angel +PT:4/4 +K:Partner:Krav, the Unredeemed:Krav +K:Flying +T:Mode$ Phase | Phase$ End of Turn | TriggerZones$ Battlefield | CheckSVar$ X | SVarCompare$ GE1 | Execute$ TrigToken | TriggerDescription$ At the beginning of each end step, if your team gained life this turn, create two 1/1 white Warrior creature tokens. +SVar:TrigToken:DB$ Token | TokenAmount$ 2 | TokenName$ Warrior | TokenTypes$ Creature,Warrior | TokenOwner$ You | TokenColors$ White | TokenPower$ 1 | TokenToughness$ 1 | TokenImage$ w 1 1 Warrior +SVar:X:PlayerCountYourTeam$HighestLifeGainedThisTurn +DeckHints:Name$Krav, the Unredeemed +Oracle:Partner with Krav, the Unredeemed (When this creature enters the battlefield, target player may put Krav into their hand from their library, then shuffle.)\nFlying\nAt the beginning of each end step, if your team gained life this turn, create two 1/1 white Warrior creature tokens. From 8f3aec9ec179f583d57163dd82ec417df0ea1f34 Mon Sep 17 00:00:00 2001 From: swordshine Date: Mon, 28 May 2018 23:02:18 +0800 Subject: [PATCH 4/4] - Added some cards --- forge-gui/res/cardsfolder/upcoming/ley_weaver.txt | 8 ++++++++ forge-gui/res/cardsfolder/upcoming/lore_weaver.txt | 8 ++++++++ 2 files changed, 16 insertions(+) create mode 100644 forge-gui/res/cardsfolder/upcoming/ley_weaver.txt create mode 100644 forge-gui/res/cardsfolder/upcoming/lore_weaver.txt diff --git a/forge-gui/res/cardsfolder/upcoming/ley_weaver.txt b/forge-gui/res/cardsfolder/upcoming/ley_weaver.txt new file mode 100644 index 00000000000..8edaec16b94 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/ley_weaver.txt @@ -0,0 +1,8 @@ +Name:Ley Weaver +ManaCost:3 G +Types:Creature Human Druid +PT:2/2 +K:Partner:Lore Weaver +A:AB$ Untap | Cost$ T | TargetMin$ 2 | TargetMax$ 2 | ValidTgts$ Land | TgtPrompt$ Select target land | SpellDescription$ Untap two target lands. +DeckHints:Name$Lore Weaver +Oracle:Partner with Lore Weaver (When this creature enters the battlefield, target player may put Lore Weaver into their hand from their library, then shuffle.)\n{T}: Untap two target lands. diff --git a/forge-gui/res/cardsfolder/upcoming/lore_weaver.txt b/forge-gui/res/cardsfolder/upcoming/lore_weaver.txt new file mode 100644 index 00000000000..8897e63a7ce --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/lore_weaver.txt @@ -0,0 +1,8 @@ +Name:Lore Weaver +ManaCost:3 U +Types:Creature Human Wizard +PT:2/2 +K:Partner:Ley Weaver +A:AB$ Draw | Cost$ 5 U U | NumCards$ 2 | ValidTgts$ Player | TgtPrompt$ Choose a player | SpellDescription$ Target player draws two cards. +DeckHints:Name$Ley Weaver +Oracle:Partner with Ley Weaver (When this creature enters the battlefield, target player may put Ley Weaver into their hand from their library, then shuffle.)\n{5}{U}{U}: Target player draws two cards.