refactor: pass creature to weapon use function, as opposed to just id
This commit is contained in:
@@ -32,14 +32,16 @@ decCharMode
|
||||
decCharMode i = creatures . ix 0 . crInv . ix i . itAttachment . _Just %~ decCharMode'
|
||||
|
||||
charFiringStrat
|
||||
:: [(Char, Int -> World -> World)] -- ^ Different firing effects for different characters
|
||||
-> Int -- ^ Creature id
|
||||
:: [(Char, Creature -> World -> World)] -- ^ Different firing effects for different characters
|
||||
-> Creature -- ^ Creature id
|
||||
-> World
|
||||
-> World
|
||||
charFiringStrat strats cid w = case w ^? creatures . ix cid . crInv
|
||||
charFiringStrat strats cr w = case w ^? creatures . ix cid . crInv
|
||||
. ix (_crInvSel $ _creatures w IM.! cid) . itAttachment . _Just . itCharMode of
|
||||
Just (c :<| _) -> fromJust (Prelude.lookup c strats) cid w
|
||||
Just (c :<| _) -> fromJust (Prelude.lookup c strats) cr w
|
||||
_ -> w
|
||||
where
|
||||
cid = _crID cr
|
||||
|
||||
increaseFuse
|
||||
:: Int -- ^ Old fuse time
|
||||
|
||||
Reference in New Issue
Block a user