Skip to content

Commit

Permalink
simplified the monsterGenChance formula; more monsters at deep levels…
Browse files Browse the repository at this point in the history
…, too
  • Loading branch information
Mikolaj committed Mar 7, 2011
1 parent 41125e8 commit f1c674f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Level.hs
Expand Up @@ -30,9 +30,9 @@ data LevelName = LambdaCave Int | Exit
-- could further influence the chance, and the chance could also affect
-- which monster is generated.
monsterGenChance :: LevelName -> [Monster] -> Rnd Bool
monsterGenChance (LambdaCave n) [] = chance $ 1%25
monsterGenChance (LambdaCave n) l = chance $ 1%((400 + (fromIntegral (L.length l) * 100) - (fromIntegral n * 50)) `max` 50)
monsterGenChance _ _ = return False
monsterGenChance (LambdaCave n) ms =
chance $ 1%(fromIntegral (250 + 200 * (L.length ms - n)) `max` 50)
monsterGenChance _ _ = return False

instance Binary LevelName where
put (LambdaCave n) = put n
Expand Down

0 comments on commit f1c674f

Please sign in to comment.