Cleanup actions/impulses
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
{-# LANGUAGE LambdaCase #-}
|
||||
--{-# LANGUAGE TupleSections #-}
|
||||
|
||||
module Dodge.Creature.Impulse (followImpulse) where
|
||||
@@ -21,7 +22,7 @@ import System.Random
|
||||
|
||||
-- note SwitchToItem doesn't necessarily update the root item correctly
|
||||
followImpulse :: Int -> World -> Impulse -> World
|
||||
followImpulse cid w imp = case imp of
|
||||
followImpulse cid w = \case
|
||||
ImpulseNothing -> w
|
||||
RandomImpulse rimp ->
|
||||
let (newimp, newgen) = runState (doRandImpulse rimp) (_randGen w)
|
||||
@@ -41,7 +42,7 @@ followImpulse cid w imp = case imp of
|
||||
Melee cid' ->
|
||||
hitCr cid' $
|
||||
crup
|
||||
( (crMvAbsolute (w ^. cWorld . lWorld) (10 *.* normalizeV (posFromID cid' -.- cpos))) . (crType . meleeCooldown .~ 20)
|
||||
( crMvAbsolute (w ^. cWorld . lWorld) (10 *.* normalizeV (posFromID cid' -.- cpos)) . (crType . meleeCooldown .~ 20)
|
||||
)
|
||||
RandomTurn a ->
|
||||
let (aa, g) = rr a
|
||||
|
||||
Reference in New Issue
Block a user