This commit is contained in:
2022-06-19 22:46:50 +01:00
parent b3c6944693
commit 8d457033a2
17 changed files with 33 additions and 33 deletions
+7 -7
View File
@@ -37,7 +37,7 @@ barrel = defaultInanimate
, color (greyN 0.5) $ circleSolid 8
]
, _crState = defaultState
{_crSpState = Barrel []
{_csSpState = Barrel []
}
, _crInv = IM.empty -- IM.fromList [(0,frontArmour)]
}
@@ -51,7 +51,7 @@ explosiveBarrel = defaultInanimate
. upperPrismPoly 20
$ polyCirc 4 10
, _crState = defaultState
{_crSpState = Barrel []
{_csSpState = Barrel []
}
, _crInv = IM.empty -- IM.fromList [(0,frontArmour)]
,_crApplyDamage = \_ _ -> id
@@ -68,7 +68,7 @@ updateExpBarrel cr w
| otherwise = makeExplosionAt (_crPos cr) $ stopSounds w & creatures . at (_crID cr) .~ Nothing
where
g = _randGen w
damages = _crDamage $ _crState cr
damages = _csDamage $ _crState cr
pierceSparks :: [World -> World]
pierceSparks
= zipWith4 (\p a -> createBarrelSpark (_crPos cr +.+ p) (a + argV p) (Just $ _crID cr))
@@ -76,10 +76,10 @@ updateExpBarrel cr w
as = randomRs (-0.7,0.7) g
colids = randomRs (0,11) g
times = randomRs (2,5) g
poss = _piercedPoints $ _crSpState $ _crState cr
newCr = Just $ applyFuseDamage $ set (crState . crDamage) [] $ damToExpBarrel damages cr
poss = _piercedPoints $ _csSpState $ _crState cr
newCr = Just $ applyFuseDamage $ set (crState . csDamage) [] $ damToExpBarrel damages cr
applyFuseDamage cr' = cr' & crHP %~
subtract (length . _piercedPoints . _crSpState $ _crState cr')
subtract (length . _piercedPoints . _csSpState $ _crState cr')
hiss | null poss = id
| otherwise = soundMultiFrom [BarrelHiss 0,BarrelHiss 1] (_crPos cr) foamSprayLoopS (Just 1)
stopSounds = stopSoundFrom (BarrelHiss 0) . stopSoundFrom (BarrelHiss 1)
@@ -93,7 +93,7 @@ damToExpBarrel ds cr = foldr damToExpBarrel' (foldr damToExpBarrel' cr pierceDam
damToExpBarrel' :: Damage -> Creature -> Creature
damToExpBarrel' dm cr = case _dmType dm of
PIERCING -> over (crState . crSpState . piercedPoints) ((:) $ int -.- _crPos cr)
PIERCING -> over (crState . csSpState . piercedPoints) ((:) $ int -.- _crPos cr)
$ cr & crHP -~ div amount 200
POISONDAM -> cr
SPARKING -> cr