module Game.LambdaHack.Effect
( Effect(..), effectToSuffix, effectToBenefit
) where
import Game.LambdaHack.Random
data Effect =
NoEffect
| Heal
| Wound !RollDice
| Dominate
| SummonFriend
| SummonEnemy
| ApplyPerfume
| Regeneration
| Searching
| Ascend
| Descend
deriving (Show, Read, Eq, Ord)
effectToSuffix :: Effect -> String
effectToSuffix NoEffect = ""
effectToSuffix Heal = "of healing"
effectToSuffix (Wound dice@(RollDice a b)) =
if a == 0 && b == 0
then "of wounding"
else "(" ++ show dice ++ ")"
effectToSuffix Dominate = "of domination"
effectToSuffix SummonFriend = "of aid calling"
effectToSuffix SummonEnemy = "of summoning"
effectToSuffix ApplyPerfume = "of rose water"
effectToSuffix Regeneration = "of regeneration"
effectToSuffix Searching = "of searching"
effectToSuffix Ascend = "of ascending"
effectToSuffix Descend = "of descending"
effectToBenefit :: Effect -> Int
effectToBenefit NoEffect = 0
effectToBenefit Heal = 10
effectToBenefit (Wound _) = 10
effectToBenefit Dominate = 0
effectToBenefit SummonFriend = 100
effectToBenefit SummonEnemy = 0
effectToBenefit ApplyPerfume = 0
effectToBenefit Regeneration = 0
effectToBenefit Searching = 0
effectToBenefit Ascend = 0
effectToBenefit Descend = 0