Add bee pheremones
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user