Skip to content

Commit

Permalink
Pronouns!
Browse files Browse the repository at this point in the history
  • Loading branch information
distributive committed Mar 10, 2024
1 parent 6e74bf7 commit 7e097ac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Sahasrara/Plugins/Netrunner/Type/Card.hs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ data Card = Card
influenceLimit :: !(Maybe Int),
memoryCost :: !(Maybe Int),
minimumDeckSize :: !(Maybe Int),
pronouns :: !(Maybe Text),
strength :: !(Maybe Stat),
strippedText :: !Text,
text :: !Text,
Expand Down Expand Up @@ -59,6 +60,7 @@ instance FromJSON Card where
influenceLimit <- a .: "influence_limit"
memoryCost <- a .:? "memory_cost"
minimumDeckSize <- a .:? "minimum_deck_size"
pronouns <- a .:? "pronouns"
strength <- a .:? "strength"
strippedText <- do
(st :: Maybe Text) <- a .:? "stripped_text"
Expand Down
4 changes: 4 additions & 0 deletions src/Sahasrara/Plugins/Netrunner/Utility/Card.hs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ toSubtitle Card {..} =
<> deckbuilding
<> link
<> "**\n"
<> cardPronouns
where
maybeIntToText = maybe "" intToText
maybeStatToText = maybe "" statToText
Expand Down Expand Up @@ -116,3 +117,6 @@ toSubtitle Card {..} =
then " (" <> maybeIntToText minimumDeckSize <> "/" <> maybeIntToText influenceLimit <> ")"
else ""
link = maybeEmptyPrependI " • Link: " baseLink
cardPronouns = case pronouns of
Nothing -> ""
Just p -> "(" <> p <> ")\n"

0 comments on commit 7e097ac

Please sign in to comment.