Refactor crPos to be a V3
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user