Implement teleporting bullets
This commit is contained in:
+10
-3
@@ -1,10 +1,17 @@
|
||||
module Dodge.Module
|
||||
where
|
||||
( moduleSizes
|
||||
, moduleStrings
|
||||
) where
|
||||
import Dodge.Data
|
||||
|
||||
import Control.Lens
|
||||
import Data.Maybe
|
||||
|
||||
moduleSizes :: Item -> Int
|
||||
moduleSizes it = (fromMaybe 0 $ it ^? itModules . modHitEffect . modSize)
|
||||
+ (fromMaybe 0 $ it ^? itModules . modRifleMag . modSize)
|
||||
moduleSizes = moduleFold (+) (^? modSize) 0
|
||||
|
||||
moduleStrings :: Item -> [String]
|
||||
moduleStrings = moduleFold (++) (^? modName) []
|
||||
|
||||
moduleFold :: (m -> m -> m) -> (ItemModule -> Maybe m) -> m -> Item -> m
|
||||
moduleFold g f e = foldr (g . fromMaybe e . f) e . _itModules
|
||||
|
||||
Reference in New Issue
Block a user