Cleanup, allow more general magShield deflection
This commit is contained in:
+5
-4
@@ -35,21 +35,22 @@ useE :: LocationLDT ItemLink ComposedItem -> Creature -> World -> World
|
||||
useE loc cr = case eo of
|
||||
Nothing -> id
|
||||
Just EDoNothing -> id
|
||||
Just EMagShield -> useMagShield itm cr
|
||||
Just (EMagShield mt) -> useMagShield mt itm cr
|
||||
Just EWristShield -> setWristShieldPos itm cr
|
||||
Just EHeadLamp -> createHeadLamp itm cr
|
||||
where
|
||||
itm = loc ^. locLDT . ldtValue . _1
|
||||
eo = itm ^? itUse . uequipEffect . eeUse
|
||||
|
||||
useMagShield :: Item -> Creature -> World -> World
|
||||
useMagShield _ cr w = w & cWorld . lWorld . magnets .:~ themagnet
|
||||
-- this should probably drain energy
|
||||
useMagShield :: MagnetBuBu -> Item -> Creature -> World -> World
|
||||
useMagShield mt _ cr w = w & cWorld . lWorld . magnets .:~ themagnet
|
||||
where
|
||||
themagnet =
|
||||
Magnet
|
||||
{ _mgPos = _crPos cr
|
||||
--, _mgField = MagnetBuBuCurveAroundField 50 200
|
||||
, _mgField = MagnetDeflect
|
||||
, _mgField = mt
|
||||
}
|
||||
|
||||
onEquipWristShield :: Item -> Creature -> World -> World
|
||||
|
||||
Reference in New Issue
Block a user