Destroying mounted lights flashes, move equipment datatype
This commit is contained in:
@@ -184,7 +184,7 @@ movementSideEff cr w
|
||||
_ -> w
|
||||
| otherwise = footstepSideEffect cr w
|
||||
where
|
||||
hasJetPack = any (\it -> it ^? itType . iyBase == Just JETPACK) $ _crInv cr
|
||||
hasJetPack = any (\it -> it ^? itType . iyBase == Just (EQUIP JETPACK)) $ _crInv cr
|
||||
oldPos = _crOldPos cr
|
||||
momentum' = 0.97 *.* (_crPos cr -.- _crOldPos cr)
|
||||
momentum'' | magV momentum' > 3 = 3 *.* normalizeV momentum'
|
||||
|
||||
@@ -21,8 +21,8 @@ strFromEquipment = sum . fmap equipmentStrValue . crCurrentEquipment
|
||||
|
||||
equipmentStrValue :: Item -> Int
|
||||
equipmentStrValue itm = case _iyBase $ _itType itm of
|
||||
FRONTARMOUR -> negate 3
|
||||
POWERLEGS -> 3
|
||||
EQUIP FRONTARMOUR -> negate 3
|
||||
EQUIP POWERLEGS -> 3
|
||||
_ -> 0
|
||||
|
||||
crCurrentEquipment :: Creature -> IM.IntMap Item
|
||||
|
||||
@@ -100,7 +100,7 @@ hasFrontArmour :: Point2 -> Creature -> Bool
|
||||
hasFrontArmour p cr = fromMaybe False $ do
|
||||
invid <- cr ^? crEquipment . ix OnChest
|
||||
ittype <- cr ^? crInv . ix invid . itType . iyBase
|
||||
return $ FRONTARMOUR == ittype
|
||||
return $ EQUIP FRONTARMOUR == ittype
|
||||
&& p /= _crOldPos cr
|
||||
&& angleVV (unitVectorAtAngle (_crDir cr + frontarmdirection)) (p -.- _crOldPos cr) < pi/2
|
||||
-- even though angleVV can generate NaN, the comparison seems to deal with it
|
||||
|
||||
Reference in New Issue
Block a user