Tweaks concerning item types
This commit is contained in:
@@ -28,7 +28,7 @@ useRootItem crid w = (worldEventFlags . at InventoryChange ?~ ()) . fromMaybe w
|
||||
itmtree <- invRootTrees (_crInv cr) ^? ix itRef
|
||||
let itm = itmtree ^. ldtValue . _1
|
||||
case itmtree ^. ldtValue . _2 of
|
||||
WeaponPlatformSF ->
|
||||
HeldPlatformSF ->
|
||||
return $
|
||||
heldEffect (bimap _iatType fst3 itmtree) cr w
|
||||
& pointerToItem itm . itUse . heldHammer .~ HammerDown
|
||||
|
||||
@@ -2,6 +2,7 @@ module Dodge.Creature.Update (
|
||||
updateCreature,
|
||||
) where
|
||||
|
||||
import Control.Lens
|
||||
import Dodge.Creature.YourControl
|
||||
import Dodge.Creature.State
|
||||
import Dodge.Barreloid
|
||||
@@ -11,8 +12,14 @@ import Dodge.Lampoid
|
||||
|
||||
updateCreature :: Creature -> World -> World
|
||||
updateCreature cr = case _crType cr of
|
||||
Avatar{} -> crUpdate yourControl cr
|
||||
Avatar{} -> (cWorld . lWorld . creatures . ix 0 . crType . avatarPulse %~ updatePulse)
|
||||
. crUpdate yourControl cr
|
||||
Lampoid{} -> updateLampoid cr
|
||||
Humanoid{} -> updateHumanoid cr
|
||||
Barreloid{} -> updateBarreloid cr
|
||||
NonDrawnCreature -> id
|
||||
|
||||
updatePulse :: Pulse -> Pulse
|
||||
updatePulse PulseStatus {_pulseRate = pr, _pulseProgress = pp}
|
||||
| pp >= pr = PulseStatus pr 0
|
||||
| otherwise = PulseStatus pr (pp + 1)
|
||||
|
||||
Reference in New Issue
Block a user