-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
241 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/main/java/com/hearthsim/card/classic/spell/common/Conceal.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.hearthsim.card.classic.spell.common; | ||
|
||
import com.hearthsim.card.spellcard.SpellCard; | ||
import com.hearthsim.event.effect.EffectCharacter; | ||
import com.hearthsim.event.effect.EffectOnResolveAoe; | ||
import com.hearthsim.event.filter.FilterCharacter; | ||
|
||
/** | ||
* Created by oyachai on 8/10/15. | ||
*/ | ||
public class Conceal extends SpellCard implements EffectOnResolveAoe { | ||
|
||
public Conceal() { | ||
super(); | ||
} | ||
|
||
@Override | ||
public EffectCharacter getAoeEffect() { | ||
return EffectCharacter.STEALTH_UNTIL_NEXT_TURN; | ||
} | ||
|
||
@Override | ||
public FilterCharacter getAoeFilter() { | ||
return FilterCharacter.FRIENDLY_MINIONS; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
93 changes: 93 additions & 0 deletions
93
src/test/groovy/com/hearthsim/test/groovy/card/classic/spell/ConcealSpec.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
package com.hearthsim.test.groovy.card.classic.spell | ||
|
||
import com.hearthsim.Game | ||
import com.hearthsim.card.CharacterIndex | ||
import com.hearthsim.card.basic.minion.BloodfenRaptor | ||
import com.hearthsim.card.basic.minion.WarGolem | ||
import com.hearthsim.card.classic.spell.common.Conceal | ||
import com.hearthsim.model.BoardModel | ||
import com.hearthsim.test.groovy.card.CardSpec | ||
import com.hearthsim.test.helpers.BoardModelBuilder | ||
import com.hearthsim.util.tree.HearthTreeNode | ||
|
||
import static com.hearthsim.model.PlayerSide.CURRENT_PLAYER | ||
import static org.junit.Assert.assertEquals | ||
|
||
/** | ||
* Created by oyachai on 8/10/15. | ||
*/ | ||
class ConcealSpec extends CardSpec { | ||
|
||
HearthTreeNode root | ||
BoardModel startingBoard | ||
|
||
def setup() { | ||
|
||
startingBoard = new BoardModelBuilder().make { | ||
currentPlayer { | ||
hand([Conceal]) | ||
field([[minion: WarGolem], [minion: BloodfenRaptor]]) | ||
mana(10) | ||
} | ||
waitingPlayer { | ||
field([[minion: WarGolem]]) | ||
} | ||
} | ||
|
||
root = new HearthTreeNode(startingBoard) | ||
} | ||
|
||
def "Stealthed until next turn"() { | ||
def copiedBoard = startingBoard.deepCopy() | ||
|
||
def theCard = root.data_.getCurrentPlayer().getHand().get(0) | ||
def ret = theCard.useOn(CURRENT_PLAYER, CharacterIndex.HERO, root) | ||
|
||
expect: | ||
assertEquals(root, ret); | ||
|
||
assertBoardDelta(copiedBoard, ret.data_) { | ||
currentPlayer { | ||
removeCardFromHand(Conceal) | ||
mana(9) | ||
numCardsUsed(1) | ||
updateMinion(CharacterIndex.MINION_1, [stealthedUntilNextTurn: true]) | ||
updateMinion(CharacterIndex.MINION_2, [stealthedUntilNextTurn: true]) | ||
} | ||
} | ||
} | ||
|
||
def "no longer stealthed when the next turn begins"() { | ||
def copiedBoard = startingBoard.deepCopy() | ||
|
||
def theCard = root.data_.getCurrentPlayer().getHand().get(0) | ||
def ret = theCard.useOn(CURRENT_PLAYER, CharacterIndex.HERO, root) | ||
|
||
def ret2 = new HearthTreeNode(Game.beginTurn(ret.data_.deepCopy())) | ||
|
||
expect: | ||
assertEquals(root, ret); | ||
|
||
assertBoardDelta(copiedBoard, ret.data_) { | ||
currentPlayer { | ||
removeCardFromHand(Conceal) | ||
mana(9) | ||
numCardsUsed(1) | ||
updateMinion(CharacterIndex.MINION_1, [stealthedUntilNextTurn: true]) | ||
updateMinion(CharacterIndex.MINION_2, [stealthedUntilNextTurn: true]) | ||
} | ||
} | ||
|
||
assertBoardDelta(ret.data_, ret2.data_) { | ||
currentPlayer { | ||
mana(10) | ||
numCardsUsed(0) | ||
fatigueDamage(2) | ||
heroHealth(29) //fatigue damage | ||
updateMinion(CharacterIndex.MINION_1, [stealthedUntilNextTurn: false]) | ||
updateMinion(CharacterIndex.MINION_2, [stealthedUntilNextTurn: false]) | ||
} | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.