Implement teleporting bullets

This commit is contained in:
2022-02-21 20:51:01 +00:00
parent 724ee21afc
commit f626fce105
23 changed files with 245 additions and 154 deletions
+10 -3
View File
@@ -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