Cleanup terminal display
This commit is contained in:
@@ -19,7 +19,7 @@ defaultApplyDamage ds cr w = foldl' (applyIndividualDamage cr) w ds'
|
||||
& creatures . ix (_crID cr) %~ doPoisonDam
|
||||
where
|
||||
(ps,ds') = partition isPoison ds
|
||||
isPoison Damage{_dmType=PoisonDam} = True
|
||||
isPoison Damage{_dmType=POISONDAM} = True
|
||||
isPoison _ = False
|
||||
poisonDam = quot (max 0 (sum (map _dmAmount ps))) 10
|
||||
doPoisonDam = crHP -~ poisonDam
|
||||
@@ -60,7 +60,7 @@ applyIndividualDamage cr w dm = applyDamageEffect dm (_dmEffect dm) cr $ applyIn
|
||||
|
||||
applyIndividualDamage' :: Creature -> World -> Damage -> World
|
||||
applyIndividualDamage' cr w dm = case _dmType dm of
|
||||
Piercing -> applyPiercingDamage cr dm w
|
||||
PIERCING -> applyPiercingDamage cr dm w
|
||||
_ -> w & damageHP cr (_dmAmount dm)
|
||||
|
||||
applyPiercingDamage :: Creature -> Damage -> World -> World
|
||||
|
||||
@@ -93,6 +93,6 @@ followImpulse cr w imp = case imp of
|
||||
posFromID cid' = _crPos $ _creatures w IM.! cid'
|
||||
rr a = randomR (-a,a) $ _randGen w
|
||||
hitCr i = (creatures . ix i . crState . crDamage
|
||||
.:~ Damage Blunt 100 cpos (posFromID i) (posFromID i) NoDamageEffect
|
||||
.:~ Damage BLUNT 100 cpos (posFromID i) (posFromID i) NoDamageEffect
|
||||
)
|
||||
. soundStart (CrSound cid) cpos hitS Nothing
|
||||
|
||||
@@ -88,16 +88,16 @@ damToExpBarrel :: [Damage] -> Creature -> Creature
|
||||
damToExpBarrel ds cr = foldr damToExpBarrel' (foldr damToExpBarrel' cr pierceDam) otherDam
|
||||
where
|
||||
(pierceDam,otherDam) = partition isPierce ds
|
||||
isPierce Damage{_dmType = Piercing{}} = True
|
||||
isPierce Damage{_dmType = PIERCING{}} = True
|
||||
isPierce _ = False
|
||||
|
||||
damToExpBarrel' :: Damage -> Creature -> Creature
|
||||
damToExpBarrel' dm cr = case _dmType dm of
|
||||
Piercing -> over (crState . crSpState . piercedPoints) ((:) $ int -.- _crPos cr)
|
||||
$ over crHP (\hp -> hp - div amount 200) cr
|
||||
PoisonDam -> cr
|
||||
SparkDam -> cr
|
||||
PushDam -> cr LensHelp.& crPos .+.+~ (1 / _crMass cr *.* _dePushBack (_dmEffect dm))
|
||||
PIERCING -> over (crState . crSpState . piercedPoints) ((:) $ int -.- _crPos cr)
|
||||
$ cr & crHP -~ div amount 200
|
||||
POISONDAM -> cr
|
||||
SPARKING -> cr
|
||||
PUSHDAM -> cr LensHelp.& crPos .+.+~ (1 / _crMass cr *.* _dePushBack (_dmEffect dm))
|
||||
_ -> cr LensHelp.& crHP -~ amount
|
||||
where
|
||||
amount = _dmAmount dm
|
||||
|
||||
Reference in New Issue
Block a user