Track slime amount using ints

This commit is contained in:
2026-05-06 15:40:31 +01:00
parent e927de6508
commit b76148ae2a
12 changed files with 203 additions and 147 deletions
+11 -1
View File
@@ -47,8 +47,18 @@ isBee cr = case cr ^. crType of
BeeCrit{} -> True
_ -> False
crslime :: Creature -> Int
crslime cr = case cr ^. crType of
SlimeCrit {_slimeSlime=r} | HP{} <- cr ^. crHP -> r -- r ^ (2::Int)
HiveCrit {_hiveSlime=x} -> x
BeeCrit {_beeSlime=x} -> 400 + x
_ -> 0
crs :: Universe -> [Creature]
crs u = u ^.. uvWorld . cWorld . lWorld . creatures . each
testStringInit :: Universe -> [String]
testStringInit _ = mempty
testStringInit u = [show . getSum $ foldMap (Sum . crslime) (crs u)]
--u = u ^.. tocrs . each . filtered isBee . crActionPlan . apStrategy . to show
-- u ^.. tocrs . ix 1 . crPos . _xy . to show
-- <> u ^.. tocrs . ix 1 . crType . slimeCompression . to show