Refactor, try to limit dependencies

This commit is contained in:
2022-07-28 00:59:56 +01:00
parent 8aa5c17ab9
commit 160560af5f
418 changed files with 15104 additions and 13342 deletions
+6 -6
View File
@@ -12,7 +12,7 @@ import Dodge.Wall.Move
import Dodge.Wall.Delete
import Dodge.Wall.ForceField
import Dodge.Item.Location
import Dodge.Data
import Dodge.Data.World
import Dodge.Item.Weapon.ExtraEffect
import Dodge.Item.Weapon.Radar
import Dodge.SoundLogic.ExternallyGeneratedSounds
@@ -47,24 +47,24 @@ useMagShield it cr w = w & cWorld . magnets . at mgid ?~ themagnet
onEquipWristShield :: Item -> Creature -> World -> World
onEquipWristShield itm cr w =
w
& pointerToItem itm . itUse . eqEq . eqParams .~ EquipID i
& pointerToItem itm . itUse . equipEffect . eeParams .~ EquipID i
& cWorld . walls . at i ?~ forceField{_wlID = i}
& setWristShieldPos (itm & itUse . eqEq . eqParams .~ EquipID i) cr
& setWristShieldPos (itm & itUse . equipEffect . eeParams .~ EquipID i) cr
where
i = IM.newKey (_walls (_cWorld w))
onRemoveWristShield :: Item -> Creature -> World -> World
onRemoveWristShield itm _ =
(pointerToItem itm . itUse . eqEq . eqParams .~ NoEquipParams) . deleteWallID i
(pointerToItem itm . itUse . equipEffect . eeParams .~ NoEquipParams) . deleteWallID i
where
i = _eparamID $ _eqParams $ _eqEq $ _itUse itm
i = _eparamID $ _eeParams $ _equipEffect $ _itUse itm
setWristShieldPos :: Item -> Creature -> World -> World
setWristShieldPos itm cr w =
w
& moveWallIDUnsafe i wlline
where
i = _eparamID $ _eqParams $ _eqEq $ _itUse itm
i = _eparamID $ _eeParams $ _equipEffect $ _itUse itm
wlline = (f (V3 (-10) 7 0), f (V3 10 7 0))
invid = _ipInvID (_itLocation itm)
handtrans = case cr ^? crInvEquipped . ix invid of