diff options
Diffstat (limited to 'crawl-ref/source/dat')
-rw-r--r-- | crawl-ref/source/dat/clua/util.lua | 9 | ||||
-rw-r--r-- | crawl-ref/source/dat/clua/ziggurat.lua | 11 |
2 files changed, 20 insertions, 0 deletions
diff --git a/crawl-ref/source/dat/clua/util.lua b/crawl-ref/source/dat/clua/util.lua index fa78b189aa..4894f1fc67 100644 --- a/crawl-ref/source/dat/clua/util.lua +++ b/crawl-ref/source/dat/clua/util.lua @@ -190,6 +190,15 @@ function util.exists(list, pred) return false end +function util.contains(haystack, needle) + for _, value in ipairs(haystack) do + if value == needle then + return true + end + end + return false +end + function util.random_from(list) return list[ crawl.random2(#list) + 1 ] end diff --git a/crawl-ref/source/dat/clua/ziggurat.lua b/crawl-ref/source/dat/clua/ziggurat.lua index 9df1acade1..4a4679ba58 100644 --- a/crawl-ref/source/dat/clua/ziggurat.lua +++ b/crawl-ref/source/dat/clua/ziggurat.lua @@ -132,7 +132,18 @@ function ziggurat_awaken_all(mons) mons.beh = beh_wander end +function ziggurat_milestone() + local depth = zig().depth + if util.contains({ 1, 9, 15, 21, 24, 27 }, depth) then + crawl.mark_milestone(depth < 27 and "br.enter" or "br.end", + (depth == 1 and "entered a Ziggurat" or + ("reached level " .. depth .. " of a Ziggurat")) + .. ".") + end +end + function ziggurat_build_level(e) + ziggurat_milestone() if zig().depth == 1 then e.welcome("You land on top of a ziggurat so tall you cannot make out the ground.") end |