Add IntMapHelper, locate wall cutting bug

This commit is contained in:
2021-05-22 15:14:21 +02:00
parent 26f0ca4ab5
commit 9c2bcbec10
35 changed files with 221 additions and 139 deletions
+4 -5
View File
@@ -11,6 +11,7 @@ import Dodge.WorldEvent
import Dodge.Creature.Action
import Geometry
import Picture
import qualified IntMapHelp as IM
import Data.List
--import Data.Char
@@ -24,7 +25,6 @@ import Control.Monad.State
--import qualified SDL.Mixer as Mix
import System.Random
--import qualified Data.Set as S
import qualified Data.IntMap.Strict as IM
--import qualified Data.Map as M
type CRUpdate = World -> (World -> World,StdGen) -> Creature -> ((World -> World,StdGen), Maybe Creature)
@@ -53,7 +53,7 @@ stateUpdate u w (f,g) cr =
. over decorations addCorpse
. dropByState cr
--crBeforeDeath = colCrWall w cr
addCorpse = insertNewKey
addCorpse = IM.insertNewKey
$ uncurry translate (_crOldPos cr)
$ rotate (_crDir cr)
(_crCorpse cr)
@@ -210,9 +210,8 @@ updateExpBarrel _ (f,g) cr
--perforate (Piercing amount sp int ep) cr = over (crState . crSpState . piercedPoints)
-- ((:) $ int -.- _crPos cr) cr
--perforate _ cr = cr
applyFuseDamage cr' = over crHP (subtract $ length (_piercedPoints
$ _crSpState $ _crState cr'))
cr'
applyFuseDamage cr' = cr' & crHP %~
subtract (length . _piercedPoints . _crSpState $ _crState cr')
hiss | null poss = id
| otherwise = soundMultiFrom [BarrelHiss 0,BarrelHiss 1] 41 50 1
stopSounds = stopSoundFrom (BarrelHiss 0) . stopSoundFrom (BarrelHiss 1)