Move creature mass out of record
This commit is contained in:
@@ -10,6 +10,7 @@ module Dodge.HeldUse (
|
||||
heldEffectMuzzles,
|
||||
) where
|
||||
|
||||
import Dodge.Creature.Mass
|
||||
import Dodge.Data.Muzzle
|
||||
import Dodge.Data.UseDelay
|
||||
import Dodge.Item.UseDelay
|
||||
@@ -455,7 +456,7 @@ applySoundCME itm cr = fromMaybe id $ do
|
||||
applyRecoil :: Item -> Creature -> World -> World
|
||||
applyRecoil itm cr =
|
||||
cWorld . lWorld . creatures . ix (_crID cr) . crPos
|
||||
+~ rotateV (_crDir cr) (V2 ((- recoilAmount itm) / _crMass cr) 0)
|
||||
+~ rotateV (_crDir cr) (V2 ((- recoilAmount itm) / crMass (_crType cr)) 0)
|
||||
|
||||
recoilAmount :: Item -> Float
|
||||
recoilAmount itm
|
||||
@@ -559,7 +560,7 @@ applySidePush maxSide cr w =
|
||||
& randGen .~ g
|
||||
where
|
||||
cid = _crID cr
|
||||
push = rotateV (_crDir cr) (V2 0 (pushAmount / _crMass cr))
|
||||
push = rotateV (_crDir cr) (V2 0 (pushAmount / crMass (_crType cr)))
|
||||
(pushAmount, g) = randomR (- maxSide, maxSide) $ _randGen w
|
||||
|
||||
applyTorqueCME :: Item -> Creature -> World -> World
|
||||
|
||||
Reference in New Issue
Block a user