Add debug to copy to clipboard any clicked-on creature
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user