Created
December 18, 2020 18:40
-
-
Save calebhearth/b84bc16c60665eced9339bfe2e881f4b to your computer and use it in GitHub Desktop.
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
ability :: Attrs -> Ability | |
ability attrs = | |
mkAbility (toSource attrs) 1 (ReactionAbility (AssetDefeated iid)) | |
instance ActionRunner env => HasActions env BrotherXavier where | |
getActions iid (AssetDefeated iid) (BrotherXavier a) | ownedBy a iid = do | |
let ability' = (iid, ability a) | |
unused <- notElem ability' . map unUsedAbility <$> getList () | |
pure | |
[ uncurry ActivateCardAbilityAction ability' | unused ] | |
getActions _ _ _ = pure [] | |
instance AssetRunner env => RunMessage env BrotherXavier where | |
runMessage msg a@(BrotherXavier attrs) = case msg of | |
AssetDefeated iid | getInvestigator attrs == iid -> | |
a <$ unshiftMessage | |
(chooseOne | |
iid | |
[ UseCardAbility iid (toSource attrs) Nothing 1 | |
, Continue "Do not use Brother Xavier's ability" | |
] | |
) | |
UseCardAbility iid source _ 1 | isSource attrs source -> | |
locationId <- getId @LocationId (getInvestigator attrs) | |
locationEnemyIds <- getSetList locationId | |
unshiftMessages | |
[chooseOne | |
iid | |
[ EnemyDamage eid iid (toSource attrs) 2 | eid <- locationEnemyIds ] | |
] | |
_ -> BrotherXavier <$> runMessage msg attrs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment