Refactor crPos to be a V3

This commit is contained in:
2025-10-10 13:47:31 +01:00
parent 98ece551c7
commit 49fb982877
58 changed files with 375 additions and 307 deletions
+5 -4
View File
@@ -1,5 +1,6 @@
module Dodge.Humanoid where
import Linear
import Data.Maybe
import Dodge.Creature.Action
import Dodge.Creature
@@ -218,9 +219,9 @@ chooseMovementPistol' cr w =
$ g
where
g = _randGen w
cpos = _crPos cr
cpos = cr ^. crPos . _xy
ycr = w ^?! cWorld . lWorld . creatures . ix 0
ypos = _crPos ycr
ypos = ycr ^. crPos . _xy
chargeProb
| dist cpos ypos > 300 = 5
| dist cpos ypos > 150 = 1
@@ -252,8 +253,8 @@ retreatActionsPistol tcr cr =
`DoImpulsesAlongside` 3
`DoReplicate` ImpulsesList (replicate 9 [Move (V2 (-3) 0)] ++ [[UseItem]])
where
cpos = _crPos cr
tpos = _crPos tcr
cpos = cr ^. crPos . _xy
tpos = tcr ^. crPos . _xy
retreatOffset =
let a
| dist cpos tpos < 50 = 0