Add forgotten files, many updates concerning turrets and shields
This commit is contained in:
@@ -21,6 +21,7 @@ import Picture
|
||||
import qualified IntMapHelp as IM
|
||||
--import StrictHelp
|
||||
|
||||
import Data.Maybe
|
||||
import Data.Function
|
||||
import Control.Lens
|
||||
--import Control.Applicative
|
||||
@@ -39,10 +40,14 @@ import qualified Data.Vector.Mutable as MV
|
||||
--dummyUpdate cr _ = (Endo id, Just cr)
|
||||
|
||||
-- | The movement is updated before the ai in order to correctly set the oldpos.
|
||||
-- This should be made more sensible: should the movement side effects apply to
|
||||
-- the creature before or after it has moved?
|
||||
-- currently invSideEffects are applied after the creature moves, to correctly
|
||||
-- update shield positions
|
||||
stateUpdate :: CRUpdate -> CRUpdate
|
||||
stateUpdate u cr w = case u (updateMovement cr) w of
|
||||
(f, maybeCr) ->
|
||||
( Endo $ invSideEff cr . movementSideEff cr . deathEff . appEndo f
|
||||
( Endo $ invSideEff (fromMaybe cr maybeCr) . movementSideEff cr . deathEff . appEndo f
|
||||
, fmap (stepReloading . stepItemUseCooldown . doDamage . crAutoReload) $ crOrCorpse =<< maybeCr
|
||||
)
|
||||
where
|
||||
|
||||
Reference in New Issue
Block a user