Add IntMapHelper, locate wall cutting bug

This commit is contained in:
jgk
2021-05-22 15:14:21 +02:00
parent 26f0ca4ab5
commit 9c2bcbec10
35 changed files with 221 additions and 139 deletions
+6 -5
View File
@@ -22,14 +22,15 @@ tryMeleeAttack cr tcr
| _crMeleeCooldown cr == Just 0
&& dist (_crPos tcr) cpos < _crRad cr + _crRad tcr + 5
&& abs (_crDir cr - argV (_crPos tcr -.- cpos)) < pi/4
= cr & crActionPlan . crStrategy .~ StrategyActions MeleeStrike meleeActions
-- = cr & crActionPlan . crStrategy .~ StrategyActions MeleeStrike meleeActions
= cr & crActionPlan . crImpulse .~ [Melee $ _crID tcr]
| otherwise = cr
where
cpos = _crPos cr
meleeActions =
[DoImpulses [Melee (_crID tcr)]
`DoActionThen` DoImpulses [ChangeStrategy WatchAndWait]
]
--meleeActions =
-- [DoImpulses [Melee (_crID tcr)]
-- `DoActionThen` DoImpulses [ChangeStrategy WatchAndWait]
-- ]
chaseTargetR
:: (Creature -> World -> Maybe Creature) -- ^ Function for determining target