This commit is contained in:
2025-07-08 23:47:13 +01:00
parent 57be90fea2
commit 15db129633
2 changed files with 11 additions and 14 deletions
+2 -5
View File
@@ -220,11 +220,8 @@ copierItemUpdate itm cr w = fromMaybe w $ do
return $ w & pointerToItem itm . itUse . uValue .~ v return $ w & pointerToItem itm . itUse . uValue .~ v
doAnyEquipmentEffect :: LocationLDT ItemLink OItem -> Creature -> World -> World doAnyEquipmentEffect :: LocationLDT ItemLink OItem -> Creature -> World -> World
doAnyEquipmentEffect loc cr = case itm ^? itLocation . ilEquipSite . _Just of doAnyEquipmentEffect loc cr = maybe id (equipBackgroundEffect loc cr)
Just _ -> equipBackgroundEffect loc cr $ loc ^? locLDT . ldtValue . _1 . itLocation . ilEquipSite . _Just
_ -> id
where
itm = loc ^. locLDT . ldtValue . _1
tryUseParent :: LocationLDT ItemLink OItem -> World -> World tryUseParent :: LocationLDT ItemLink OItem -> World -> World
tryUseParent loc w = fromMaybe w $ do tryUseParent loc w = fromMaybe w $ do
+9 -9
View File
@@ -12,12 +12,13 @@ import Dodge.Wall.Move
import Geometry import Geometry
import LensHelp import LensHelp
equipBackgroundEffect :: LocationLDT ItemLink OItem -> Creature -> World -> World equipBackgroundEffect :: LocationLDT ItemLink OItem -> Creature -> EquipSite
-> World -> World
equipBackgroundEffect loc cr = case eo of equipBackgroundEffect loc cr = case eo of
EQUIP (MAGSHIELD mt) -> useMagShield mt itm cr EQUIP (MAGSHIELD mt) -> const $ useMagShield mt itm cr
EQUIP WRISTARMOUR -> setWristShieldPos itm cr EQUIP WRISTARMOUR -> setWristShieldPos itm cr
EQUIP HEADLAMP -> createHeadLamp itm cr EQUIP HEADLAMP -> const $ createHeadLamp itm cr
_ -> id _ -> const id
where where
itm = loc ^. locLDT . ldtValue . _1 itm = loc ^. locLDT . ldtValue . _1
eo = itm ^. itType eo = itm ^. itType
@@ -31,14 +32,13 @@ useMagShield mt _ cr w =
, _mgField = mt , _mgField = mt
} }
setWristShieldPos :: Item -> Creature -> World -> World setWristShieldPos :: Item -> Creature -> EquipSite -> World -> World
setWristShieldPos itm cr w = w & moveWallIDUnsafe i wlline setWristShieldPos itm cr x = moveWallIDUnsafe i wlline
where where
i = _itParamID $ _itParams itm i = _itParamID $ _itParams itm
wlline = (f (V3 (-10) 7 0), f (V3 10 7 0)) wlline = (f (V3 (-10) 7 0), f (V3 10 7 0))
invid = _ilInvID (_itLocation itm) handtrans = case x of
handtrans = case cr ^? crInv . ix invid . itLocation . ilEquipSite . _Just of OnLeftWrist -> \cr' -> translatePointToLeftHand cr' . g
Just OnLeftWrist -> \cr' -> translatePointToLeftHand cr' . g
_ -> translatePointToRightHand _ -> translatePointToRightHand
g g
| twists cr = (+.+.+ V3 (-5) 10 0) | twists cr = (+.+.+ V3 (-5) 10 0)