Refactor crPos to be a V3
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
module Dodge.Creature.Damage (applyCreatureDamage) where
|
||||
|
||||
import Linear
|
||||
import Dodge.Material.Damage
|
||||
import Data.List
|
||||
import Dodge.Creature.Mass
|
||||
@@ -25,11 +26,11 @@ applyPiercingDamage cr dm w
|
||||
= f . makeSpark NormalSpark p1 (argV (p1 - p)) $ w
|
||||
| otherwise = f . damageHP cr (_dmAmount dm) $ w
|
||||
where
|
||||
f = cWorld . lWorld . creatures . ix (_crID cr) . crPos +~ _dmVector dm
|
||||
f = cWorld . lWorld . creatures . ix (_crID cr) . crPos . _xy +~ _dmVector dm
|
||||
/ V2 x x
|
||||
x = crMass (_crType cr)
|
||||
p = _dmPos dm
|
||||
p1 = p + 2 *.* squashNormalizeV (p - _crPos cr)
|
||||
p1 = p + 2 *.* squashNormalizeV (p - cr ^. crPos . _xy)
|
||||
|
||||
damageHP :: Creature -> Int -> World -> World
|
||||
damageHP cr x =
|
||||
|
||||
Reference in New Issue
Block a user