Add bee pheremones

This commit is contained in:
2026-04-23 10:30:43 +01:00
parent f6e257464d
commit d06660fd06
8 changed files with 212 additions and 167 deletions
+6 -4
View File
@@ -331,18 +331,20 @@ checkDeath' cr w = case cr ^. crHP of
& dropAll cr -- the order of these is possibly important
& stopSoundFrom (CrWeaponSound (_crID cr) 0)
& corpseOrGib cr
& crEffectsOnDeath cr
& crDeathEffects cr
& tocr . crStance . carriage %~ toDeathCarriage
_ -> w
where
tocr = cWorld . lWorld . creatures . ix (_crID cr)
crEffectsOnDeath :: Creature -> World -> World
crEffectsOnDeath cr w = case cr ^. crType of
BeeCrit {_beeHive = mhid} -> fromMaybe w $ do
crDeathEffects :: Creature -> World -> World
crDeathEffects cr w = case cr ^. crType of
BeeCrit {_beeHive = mhid} -> beepheremone $ fromMaybe w $ do
hid <- mhid
return $ w & cWorld . lWorld . creatures . ix hid . crType . hiveChildren %~ IS.delete (cr ^. crID)
_ -> w
where
beepheremone = cWorld . lWorld . beePheremones .:~ BPheremone (cr ^. crPos . _xy) 200
startDeathTimer :: Creature -> Creature
startDeathTimer cr = cr & crDeathTimer ?~ case cr ^. crType of