Start to implement equipment sites on body
This commit is contained in:
@@ -8,11 +8,14 @@ import Geometry
|
||||
|
||||
import Control.Lens
|
||||
|
||||
-- the use of crOldPos is because the damage position is calculated on the
|
||||
-- previous frame
|
||||
-- Not sure if it is a good idea
|
||||
crIsArmouredFrom :: Point2 -> Creature -> Bool
|
||||
crIsArmouredFrom p cr
|
||||
= p /= _crPos cr
|
||||
= p /= _crOldPos cr
|
||||
&& any (\it -> it ^? itType == Just FRONTARMOUR) (_crInv cr)
|
||||
&& angleVV (unitVectorAtAngle $ _crDir cr) (p -.- _crPos cr) < pi/2
|
||||
&& angleVV (unitVectorAtAngle $ _crDir cr) (p -.- _crOldPos cr) < pi/2
|
||||
-- even though angleVV can generate NaN, the comparison seems to deal with it
|
||||
|
||||
--crOnSeg :: Point2 -> Point2 -> Creature -> Bool
|
||||
|
||||
Reference in New Issue
Block a user