Make item use mods an external function

This commit is contained in:
2022-07-20 17:06:45 +01:00
parent 795c4c1987
commit 12246462fe
22 changed files with 232 additions and 297 deletions
+4 -8
View File
@@ -2,13 +2,9 @@ module Dodge.Combine.Module where
import Dodge.Data
import Dodge.Tesla
import Dodge.Item.Weapon.ExtraEffect
import Dodge.Item.Weapon.TriggerType
import LensHelp
import Geometry
import Dodge.Beam
import Dodge.Base.Coordinate
import Data.Maybe
moduleModification :: ItemModuleType -> Item -> Item
moduleModification imt = case imt of
@@ -45,10 +41,10 @@ moduleModification imt = case imt of
& itUse . useAim . aimRange .~ 0
-- a better option would be to involve a "scope" centered on the firing
-- position
directedTelPos it cr w = (p,a)
where
p = fromMaybe (_crPos cr) $ it ^? itTargeting . tgPos . _Just
a = argV (mouseWorldPos w -.- p)
-- directedTelPos it cr w = (p,a)
-- where
-- p = fromMaybe (_crPos cr) $ it ^? itTargeting . tgPos . _Just
-- a = argV (mouseWorldPos w -.- p)
applyModules :: Item -> Item
applyModules it = foldr moduleModification it (_iyModules (_itType it))