Allow for equipment items to set a minimum view distance
This commit is contained in:
@@ -36,13 +36,13 @@ import qualified Data.Set as S
|
||||
import qualified SDL
|
||||
autoEffect :: (Item -> Creature -> World -> World) -> Int -> SoundID -> Item -> Creature -> World -> World
|
||||
autoEffect eff t sid itm cr w
|
||||
| _eparamInt (_eqParams (_itUse itm)) < 1 = eff itm cr w
|
||||
| _eparamInt (_eqParams (_eqEq $ _itUse itm)) < 1 = eff itm cr w
|
||||
& creatures . ix (_crID cr) . crInv . ix (fromJust $ _itInvPos itm)
|
||||
. itUse . eqParams . eparamInt .~ t
|
||||
. itUse . eqEq . eqParams . eparamInt .~ t
|
||||
& soundStart OnceSound (_crPos cr) sid Nothing
|
||||
| otherwise = w
|
||||
& creatures . ix (_crID cr) . crInv . ix (fromJust $ _itInvPos itm)
|
||||
. itUse . eqParams . eparamInt -~ 1
|
||||
. itUse . eqEq . eqParams . eparamInt -~ 1
|
||||
|
||||
{- | Automatically send out radar pulses that detect walls. -}
|
||||
autoRadarEffect :: Item -> Creature -> World -> World
|
||||
|
||||
Reference in New Issue
Block a user