Move held item scrolling into dedicated datatype
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
module Dodge.Item.Attachment
|
||||
( charFiringStratI
|
||||
, scrollCharMode
|
||||
, changeFuse
|
||||
) where
|
||||
import Dodge.Data
|
||||
@@ -13,32 +12,6 @@ import Data.Maybe
|
||||
import qualified Data.IntMap.Strict as IM
|
||||
|
||||
|
||||
scrollCharMode
|
||||
:: Float -- ^ Amount scrolled
|
||||
-> Creature
|
||||
-> Item
|
||||
-> Item
|
||||
scrollCharMode x _
|
||||
| x > 0 = incCharMode
|
||||
| x < 0 = decCharMode
|
||||
| otherwise = id
|
||||
|
||||
incCharMode
|
||||
:: Item
|
||||
-> Item
|
||||
incCharMode = itAttachment . atCharMode %~ cycleL
|
||||
where
|
||||
cycleL (x :<| xs) = xs |> x
|
||||
cycleL xs = xs
|
||||
|
||||
decCharMode
|
||||
:: Item
|
||||
-> Item
|
||||
decCharMode = itAttachment . atCharMode %~ cycleR
|
||||
where
|
||||
cycleR (xs :|> x) = x <| xs
|
||||
cycleR xs = xs
|
||||
|
||||
charFiringStratI
|
||||
:: [(Char, ChainEffect)] -- ^ Different firing effects for different characters
|
||||
-> ChainEffect
|
||||
|
||||
Reference in New Issue
Block a user