Add stopWatch

This commit is contained in:
2022-12-30 12:17:27 +00:00
parent 29d6307076
commit 828c4d9c5b
11 changed files with 70 additions and 22 deletions
+10
View File
@@ -14,12 +14,21 @@ useL :: Luse -> Item -> Creature -> World -> World
useL lu = case lu of
LDoNothing -> const $ const id
LRewind -> useRewindGun
LTimePause -> hammerCheckL useStopWatch
LTimeScroll -> hammerCheckL useTimeScrollGun
LShrink -> hammerCheckL useShrinkGun
LBlink -> hammerCheckL (shootL $ const blinkActionMousePos)
LUnsafeBlink -> hammerCheckL (shootL $ const unsafeBlinkAction)
LBoost -> boostSelfL 10
useStopWatch :: Item -> Creature -> World -> World
useStopWatch itm _ w = w
& cWorld . timeFlow .~ PausedTimeFlow
{ _timeFlowCharge = itm ^?! itUse . leftConsumption . wpCharge
, _scrollItemLocation = _itID itm
}
useTimeScrollGun :: Item -> Creature -> World -> World
useTimeScrollGun itm _ w = w & cWorld . timeFlow .~ ScrollTimeFlow
{ _scrollSmoothing = 0
@@ -28,6 +37,7 @@ useTimeScrollGun itm _ w = w & cWorld . timeFlow .~ ScrollTimeFlow
, _scrollItemLocation = _itID itm
}
useRewindGun :: Item -> Creature -> World -> World
useRewindGun itm _ w = w
& cWorld . timeFlow .~ RewindLeftClick