Tweak melee movement
This commit is contained in:
@@ -70,9 +70,8 @@ updateLivingCreature cr = case cr ^. crType of
|
||||
CrabCrit{} -> crUpdate cid . performActions cid . crabCritInternal cid
|
||||
AutoCrit{} -> crUpdate cid
|
||||
SwarmCrit{} -> crUpdate cid
|
||||
HoverCrit{} -> \w ->
|
||||
crUpdate cid . performActions cid . hoverCritHoverSound cr $
|
||||
over (cWorld . lWorld . creatures . ix cid) (hoverCritInternal w) w
|
||||
HoverCrit{} -> crUpdate cid . performActions cid . hoverCritHoverSound cr .
|
||||
updateHoverCrit cid
|
||||
SlinkCrit{} -> slinkCritUpdate cid
|
||||
SlimeCrit{} -> slimeCritUpdate cid
|
||||
BeeCrit{} -> crUpdate cid . performActions cid . updateBeeFromPheremones cr cid . updateBeeCrit cr cid
|
||||
@@ -151,6 +150,9 @@ updateAggroBee cr cid w
|
||||
|
||||
-- do bees need to be able to see slime targets?
|
||||
-- if no path can be made, reset harvest action
|
||||
-- this should all be simplified
|
||||
-- should count how many are mounted on an individual slime, try for a different
|
||||
-- slime if too many
|
||||
updateCalmBee :: Creature -> Int -> World -> World
|
||||
updateCalmBee cr cid w
|
||||
| Just hcr <- gethive
|
||||
@@ -160,7 +162,7 @@ updateCalmBee cr cid w
|
||||
| Just x <- cr ^? crType . beeSlime
|
||||
, x < 0.5
|
||||
, Just ReturnToHive <- cr ^? crActionPlan . apStrategy
|
||||
= w & tocr . crActionPlan . apAction .~ NoAction
|
||||
= w & tocr . crActionPlan . apStrategy .~ Search
|
||||
| Just hcr <- gethive
|
||||
, Just _ <- cr ^? crStance . carriage . mountID
|
||||
, Just x <- cr ^? crType . beeSlime
|
||||
@@ -169,7 +171,7 @@ updateCalmBee cr cid w
|
||||
& tocr . crStance . carriage .~ Flying 0
|
||||
& tocr . crActionPlan . apStrategy .~ ReturnToHive
|
||||
| Just mid <- cr ^? crStance . carriage . mountID
|
||||
, mountshakeoff mid = w -- & tocr . crActionPlan . apStrategy .~ Search
|
||||
, mountshakeoff mid = w
|
||||
& tocr . crStance . carriage .~ Flying 0
|
||||
& tocr . crActionPlan . apStrategy .~ Search
|
||||
| Just hcr <- gethive
|
||||
@@ -193,11 +195,13 @@ updateCalmBee cr cid w
|
||||
& tocr . crActionPlan . apAction .~ NoAction
|
||||
| Just (tcr,_) <- gettarg = w
|
||||
& tocr . crActionPlan . apAction .~ PathTo (tcr ^. crPos . _xy) NoAction
|
||||
| Just (SearchTimed 0) <- cr ^? crActionPlan . apStrategy = w & tocr . crActionPlan . apStrategy .~ Search
|
||||
| Just PathTo{} <- cr ^? crActionPlan . apAction = w
|
||||
& tocr . crActionPlan . apStrategy . searchTimer %~ (max 0 . subtract 1)
|
||||
| otherwise = w
|
||||
& tocr . crActionPlan . apAction .~ PathTo (cxy + p) NoAction
|
||||
& randGen .~ g
|
||||
& tocr . crActionPlan . apStrategy .~ Search
|
||||
& randGen .~ g
|
||||
& tocr . crActionPlan . apStrategy .~ SearchTimed 200
|
||||
where
|
||||
(p,g) = runState (randOnCirc 150) (w ^. randGen)
|
||||
cxy = cr ^. crPos . _xy
|
||||
|
||||
Reference in New Issue
Block a user