Add damage origins
This commit is contained in:
@@ -29,7 +29,7 @@ blinkActionMousePos cr w =
|
||||
& blinkDistortions cpos p3
|
||||
& cWorld . lWorld . creatures . ix cid . crPos . _xy .~ p3
|
||||
& blinkShockwave cid p3
|
||||
& inverseShockwaveAt (cpos `v2z` 20) 40 2 2
|
||||
& inverseShockwaveAt (cpos `v2z` 20) 40 2 2 (CrIndirectO cid)
|
||||
where
|
||||
cid = _crID cr
|
||||
p1 = w ^. cWorld . lWorld . lAimPos
|
||||
@@ -63,11 +63,11 @@ unsafeBlinkAction cr w
|
||||
. blinkDistortions cpos mwp
|
||||
. set (cWorld . lWorld . creatures . ix cid . crPos . _xy) mwp
|
||||
. blinkShockwave cid mwp
|
||||
$ inverseShockwaveAt (cpos `v2z` 20) 40 2 2 w
|
||||
$ inverseShockwaveAt (cpos `v2z` 20) 40 2 2 (CrIndirectO cid) w
|
||||
| otherwise =
|
||||
w
|
||||
& blinkActionFail cr
|
||||
& cWorld . lWorld . creatures . ix cid . crDamage .:~ Enterrement 100000000
|
||||
& cWorld . lWorld . creatures . ix cid . crDamage .:~ Enterrement 100000000 (CrIndirectO cid)
|
||||
where
|
||||
success = fromMaybe True $ do
|
||||
wl <- snd $ collidePointWallsFilter (const True) mwp cpos w
|
||||
@@ -82,7 +82,7 @@ blinkShockwave ::
|
||||
Point2 ->
|
||||
World ->
|
||||
World
|
||||
blinkShockwave i p = makeShockwaveAt [i] (p `v2z` 20) 60 1 2 cyan
|
||||
blinkShockwave i p = makeShockwaveAt [i] (p `v2z` 20) 60 1 2 cyan (CrIndirectO i)
|
||||
|
||||
-- | Like a blink action, but no ingoing distortion
|
||||
blinkActionFail :: Creature -> World -> World
|
||||
@@ -91,7 +91,7 @@ blinkActionFail cr w =
|
||||
& soundMultiFrom [TeleSound 0, TeleSound 1] p3 teleS Nothing
|
||||
-- & cWorld . lWorld . distortions .:~ distortionBulge
|
||||
& cWorld . lWorld . creatures . ix cid . crPos . _xy .~ p3
|
||||
& inverseShockwaveAt (cpos `v2z` 20) 40 2 2
|
||||
& inverseShockwaveAt (cpos `v2z` 20) 40 2 2 (CrIndirectO cid)
|
||||
where
|
||||
-- distR = 120
|
||||
-- distortionBulge = RadialDistortion cpos (cpos +.+ V2 distR 0) (cpos +.+ V2 0 distR) 1.9
|
||||
|
||||
@@ -16,7 +16,7 @@ applyCreatureDamage :: [Damage] -> Creature -> World -> World
|
||||
applyCreatureDamage dms cr w = foldl' (applyIndividualDamage cr) w dms
|
||||
|
||||
applyIndividualDamage :: Creature -> World -> Damage -> World
|
||||
applyIndividualDamage cr w (Inertial _ _ v) = w
|
||||
applyIndividualDamage cr w (Inertial _ _ v _) = w
|
||||
& cWorld . lWorld . creatures . ix (_crID cr) . crPos . _xy +~ fmap (/ crMass (cr ^. crType)) v
|
||||
applyIndividualDamage cr w dm =
|
||||
let (i,w') = damMatSideEffect dm (crMaterial (_crType cr)) (Left cr) w
|
||||
|
||||
@@ -91,9 +91,9 @@ followImpulse cid w = \case
|
||||
rr a = randomR (- a, a) $ _randGen w
|
||||
hitCr i =
|
||||
cWorld . lWorld . creatures . ix i . crDamage
|
||||
.:~ Blunt 100 (posFromID i) (posFromID i - cpos)
|
||||
.:~ Blunt 100 (posFromID i) (posFromID i - cpos) (CrMeleeO cid)
|
||||
hitCrd a i =
|
||||
cWorld . lWorld . creatures . ix i . crDamage
|
||||
<>~ [Blunt 100 (posFromID i) (posFromID i - cpos)
|
||||
, Inertial 0 (posFromID i) (50 * unitVectorAtAngle (cr ^. crDir + a))
|
||||
<>~ [Blunt 100 (posFromID i) (posFromID i - cpos) (CrMeleeO cid)
|
||||
, Inertial 0 (posFromID i) (50 * unitVectorAtAngle (cr ^. crDir + a)) (CrMeleeO cid)
|
||||
]
|
||||
|
||||
@@ -225,6 +225,7 @@ shineTargetLaser cr loc w = fromMaybe (w & pointittarg . itTgPos .~ Nothing) $ d
|
||||
, _lpPos = pos
|
||||
-- , _lpColor = col
|
||||
, _lpType = TargetingLaser (_itID itm)
|
||||
, _lpOrigin = CrWeaponO $ cr ^. crID
|
||||
}
|
||||
where
|
||||
o = locOrient loc cr
|
||||
|
||||
Reference in New Issue
Block a user