-
Notifications
You must be signed in to change notification settings - Fork 43
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
1 parent
50c56f1
commit 15cd971
Showing
11 changed files
with
117 additions
and
10 deletions.
There are no files selected for viewing
33 changes: 29 additions & 4 deletions
33
backend/arkham-api/library/Arkham/Enemy/Cards/MemoryOfATerribleDiscovery.hs
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 |
---|---|---|
@@ -1,15 +1,40 @@ | ||
module Arkham.Enemy.Cards.MemoryOfATerribleDiscovery (memoryOfATerribleDiscovery) where | ||
|
||
import Arkham.Ability | ||
import Arkham.Asset.Cards qualified as Assets | ||
import Arkham.Enemy.Cards qualified as Cards | ||
import Arkham.Enemy.Import.Lifted | ||
import Arkham.Enemy.Import.Lifted hiding (EnemyAttacks, EnemyDefeated) | ||
import Arkham.Helpers.Story | ||
import Arkham.Matcher | ||
import Arkham.Story.Cards qualified as Stories | ||
|
||
newtype MemoryOfATerribleDiscovery = MemoryOfATerribleDiscovery EnemyAttrs | ||
deriving anyclass (IsEnemy, HasModifiersFor) | ||
deriving newtype (Show, Eq, ToJSON, FromJSON, Entity, HasAbilities) | ||
deriving newtype (Show, Eq, ToJSON, FromJSON, Entity) | ||
|
||
memoryOfATerribleDiscovery :: EnemyCard MemoryOfATerribleDiscovery | ||
memoryOfATerribleDiscovery = enemy MemoryOfATerribleDiscovery Cards.memoryOfATerribleDiscovery (3, PerPlayer 4, 3) (1, 1) | ||
memoryOfATerribleDiscovery = | ||
enemyWith MemoryOfATerribleDiscovery Cards.memoryOfATerribleDiscovery (3, PerPlayer 4, 3) (1, 1) | ||
$ preyL | ||
.~ Prey (ControlsAsset $ assetIs Assets.averyClaypoolAntarcticGuide) | ||
|
||
instance HasAbilities MemoryOfATerribleDiscovery where | ||
getAbilities (MemoryOfATerribleDiscovery a) = | ||
extend | ||
a | ||
[ restricted a 1 OnSameLocation $ parleyAction (AddFrostTokenCost 1) | ||
, mkAbility a 2 $ forced $ EnemyDefeated #when You ByAny (be a) | ||
] | ||
|
||
instance RunMessage MemoryOfATerribleDiscovery where | ||
runMessage msg (MemoryOfATerribleDiscovery attrs) = runQueueT $ case msg of | ||
runMessage msg e@(MemoryOfATerribleDiscovery attrs) = runQueueT $ case msg of | ||
UseThisAbility _iid (isSource attrs -> True) 1 -> do | ||
nonAttackEnemyDamage (attrs.ability 1) 4 attrs.id | ||
pure e | ||
UseThisAbility iid (isSource attrs -> True) 2 -> do | ||
flipOverBy iid (attrs.ability 2) attrs | ||
pure e | ||
Flip iid _ (isTarget attrs -> True) -> do | ||
readStory iid attrs Stories.memoryOfATerribleDiscovery | ||
pure e | ||
_ -> MemoryOfATerribleDiscovery <$> liftRunMessage msg attrs |
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
34 changes: 30 additions & 4 deletions
34
backend/arkham-api/library/Arkham/Enemy/Cards/MemoryOfAnUnrequitedLove.hs
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 |
---|---|---|
@@ -1,15 +1,41 @@ | ||
module Arkham.Enemy.Cards.MemoryOfAnUnrequitedLove (memoryOfAnUnrequitedLove) where | ||
|
||
import Arkham.Ability | ||
import Arkham.Asset.Cards qualified as Assets | ||
import Arkham.Enemy.Cards qualified as Cards | ||
import Arkham.Enemy.Import.Lifted | ||
import Arkham.Enemy.Import.Lifted hiding (DiscoverClues, EnemyDefeated) | ||
import Arkham.Helpers.Story | ||
import Arkham.Helpers.Window | ||
import Arkham.Matcher | ||
import Arkham.Story.Cards qualified as Stories | ||
|
||
newtype MemoryOfAnUnrequitedLove = MemoryOfAnUnrequitedLove EnemyAttrs | ||
deriving anyclass (IsEnemy, HasModifiersFor) | ||
deriving newtype (Show, Eq, ToJSON, FromJSON, Entity, HasAbilities) | ||
deriving newtype (Show, Eq, ToJSON, FromJSON, Entity) | ||
|
||
memoryOfAnUnrequitedLove :: EnemyCard MemoryOfAnUnrequitedLove | ||
memoryOfAnUnrequitedLove = enemy MemoryOfAnUnrequitedLove Cards.memoryOfAnUnrequitedLove (4, PerPlayer 3, 3) (1, 1) | ||
memoryOfAnUnrequitedLove = | ||
enemyWith MemoryOfAnUnrequitedLove Cards.memoryOfAnUnrequitedLove (4, PerPlayer 3, 3) (1, 1) | ||
$ preyL | ||
.~ Prey (ControlsAsset $ assetIs Assets.drAmyKenslerProfessorOfBiology) | ||
|
||
instance HasAbilities MemoryOfAnUnrequitedLove where | ||
getAbilities (MemoryOfAnUnrequitedLove a) = | ||
extend | ||
a | ||
[ mkAbility a 1 $ freeReaction $ DiscoverClues #after You (locationWithEnemy a) (atLeast 1) | ||
, mkAbility a 2 $ forced $ EnemyDefeated #when You ByAny (be a) | ||
] | ||
|
||
instance RunMessage MemoryOfAnUnrequitedLove where | ||
runMessage msg (MemoryOfAnUnrequitedLove attrs) = runQueueT $ case msg of | ||
runMessage msg e@(MemoryOfAnUnrequitedLove attrs) = runQueueT $ case msg of | ||
UseCardAbility _iid (isSource attrs -> True) 1 (discoveredClues -> n) _ -> do | ||
nonAttackEnemyDamage (attrs.ability 1) n attrs.id | ||
pure e | ||
UseThisAbility iid (isSource attrs -> True) 2 -> do | ||
flipOverBy iid (attrs.ability 2) attrs | ||
pure e | ||
Flip iid _ (isTarget attrs -> True) -> do | ||
readStory iid attrs Stories.memoryOfAnUnrequitedLove | ||
pure e | ||
_ -> MemoryOfAnUnrequitedLove <$> liftRunMessage msg attrs |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module Arkham.Matcher.Target where | ||
|
||
import Arkham.Prelude | ||
|
||
data TargetMatcher | ||
|
||
instance Data TargetMatcher | ||
instance Show TargetMatcher | ||
instance Eq TargetMatcher | ||
instance Ord TargetMatcher | ||
instance ToJSON TargetMatcher | ||
instance FromJSON TargetMatcher |
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