Add debug to copy to clipboard any clicked-on creature

This commit is contained in:
2026-05-04 21:17:22 +01:00
parent 6b3d75cbb2
commit 5d5d0a539b
13 changed files with 212 additions and 207 deletions
+9 -3
View File
@@ -161,8 +161,11 @@ updateCalmBee cr cid w
, x >= 0.5 = w & tocr . crType . beeSlime -~ 0.5
| Just x <- cr ^? crType . beeSlime
, x < 0.5
, Just hcr <- gethive
, distance (cr ^. crPos . _xy) (hcr ^. crPos . _xy) < 30
, Just ReturnToHive <- cr ^? crActionPlan . apStrategy
= w & tocr . crActionPlan . apStrategy .~ Search
& tocr . crActionPlan . apAction .~ NoAction
| Just hcr <- gethive
, Just _ <- cr ^? crStance . carriage . mountID
, Just x <- cr ^? crType . beeSlime
@@ -180,8 +183,10 @@ updateCalmBee cr cid w
= w & tocr . crActionPlan . apAction .~ PathTo (hcr ^. crPos . _xy) NoAction
& tocr . crActionPlan . apStrategy .~ ReturnToHive
| Nothing <- cr ^? crActionPlan . apStrategy . harvestTarget
, Just tcr <- listToMaybe . sortOn (distance cxy . (^. crPos . _xy)) . IM.elems . IM.filter istarget $ crsNearCirc cxy 100 w =
, xs@(_:_) <- IM.elems . IM.filter istarget $ crsNearCirc cxy 100 w
, (tcr,g') <- runState (takeOne xs) (w ^. randGen) =
w & tocr . crActionPlan . apStrategy .~ HarvestFrom (tcr ^. crID)
& randGen .~ g'
| Just tid <- cr ^? crStance . carriage . mountID
, Just SlimeCrit{} <- w ^? cWorld . lWorld . creatures . ix tid . crType = w
& tocr . crType . beeSlime +~ sspeed
@@ -195,7 +200,8 @@ 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 (SearchTimed 0) <- cr ^? crActionPlan . apStrategy
= w & tocr . crActionPlan . apStrategy .~ ReturnToHive
| Just PathTo{} <- cr ^? crActionPlan . apAction = w
& tocr . crActionPlan . apStrategy . searchTimer %~ (max 0 . subtract 1)
| otherwise = w
@@ -203,7 +209,7 @@ updateCalmBee cr cid w
& randGen .~ g
& tocr . crActionPlan . apStrategy .~ SearchTimed 200
where
(p,g) = runState (randOnCirc 150) (w ^. randGen)
(p,g) = runState (randOnCirc 200) (w ^. randGen)
cxy = cr ^. crPos . _xy
mountshakeoff mid = fromMaybe True $ do
mcr <- w ^? cWorld . lWorld . creatures . ix mid