Improve bee pheremones

This commit is contained in:
2026-04-26 09:14:55 +01:00
parent 264651d34a
commit f4c59612ea
5 changed files with 41 additions and 20 deletions
+3 -2
View File
@@ -108,7 +108,7 @@ updateBeeFromPheremones cr cid w
| any f (w ^. cWorld . lWorld . beePheremones) = w & cWorld . lWorld . creatures . ix cid . crType . beeAggro .~ 300
| otherwise = w
where
f bp = distance (cr ^. crPos . _xy) (bp ^. bpPos) < 20
f bp = distance (cr ^. crPos . _xy) (bp ^. bpPos . _xy) < 20
updateBeeCrit :: Creature -> Int -> World -> World
updateBeeCrit cr
@@ -371,11 +371,12 @@ crDeathEffects cr w = case cr ^. crType of
return $ w & cWorld . lWorld . creatures . ix hid . crType . hiveChildren %~ IS.delete (cr ^. crID)
_ -> w
where
beepheremone = cWorld . lWorld . beePheremones .:~ BPheremone (cr ^. crPos . _xy) 200
beepheremone = cWorld . lWorld . beePheremones .:~ BPheremone (cr ^. crPos) (cr ^. crPos - cr ^. crOldPos) 200
startDeathTimer :: Creature -> Creature
startDeathTimer cr = cr & crDeathTimer ?~ case cr ^. crType of
HoverCrit{} -> 0
BeeCrit{} -> 0
_ -> 5
toDeathCarriage :: Carriage -> Carriage