summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authorevktalo <evktalo@c06c8d41-db1a-0410-9941-cceddc491573>2009-07-20 11:20:55 +0000
committerevktalo <evktalo@c06c8d41-db1a-0410-9941-cceddc491573>2009-07-20 11:20:55 +0000
commitd37b37e5631e98f098463195606d13467c334349 (patch)
treecc3f4822afcb805639dd123522edd50e37c3d01a /crawl-ref
parentbb40b309944e95aa6d7b73605a3108d17b7db740 (diff)
downloadcrawl-ref-d37b37e5631e98f098463195606d13467c334349.tar.gz
crawl-ref-d37b37e5631e98f098463195606d13467c334349.zip
Commit r10308 to 0.5: Milestones for entering Ice Caves, Minitombs and Sewers.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.5@10350 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/docs/level_design.txt25
-rw-r--r--crawl-ref/source/dat/clua/dungeon.lua4
-rw-r--r--crawl-ref/source/dat/icecave.des12
-rw-r--r--crawl-ref/source/dat/minitomb.des13
-rw-r--r--crawl-ref/source/dat/sewer.des11
5 files changed, 61 insertions, 4 deletions
diff --git a/crawl-ref/docs/level_design.txt b/crawl-ref/docs/level_design.txt
index a20d4e747a..91df249b33 100644
--- a/crawl-ref/docs/level_design.txt
+++ b/crawl-ref/docs/level_design.txt
@@ -1502,6 +1502,28 @@ You can then use this line in the map definition to execute the lua block:
You can also set env.spawn_random_rate() to have monsters generated from the
list during play.
+Milestones for portal vaults
+----------------------------
+
+This example is from icecave.des, defined in the lua preludes:
+
+{{
+function ice_cave_milestone(e)
+ crawl.mark_milestone("br.enter", "entered an Ice Cave.")
+end
+}}
+
+The function is called from each of the destination map definitions:
+
+: ice_cave_milestone(_G)
+
+This marks down entering the portal vault in the milestones. When the portal
+is entered, the destination map is chosen and the call to crawl.mark_milestone
+is executed along with the rest of the map definition.
+
+Adding milestones in a .des does have the slight catch of creating multiple
+milestones if the map fails validation for some reason, so it's best used
+in maps that will never fail validation.
I. Lua reference
===================
@@ -1808,7 +1830,8 @@ provide utility methods.
mpr, mesclr, random2, coinflip, one_chance_in, redraw_screen,
input_line, c_input_line, getch, kbhit, flush_input, sendkeys,
playsound, runmacro, bindkey, setopt, msgch_num, msgch_name, regex,
-message_filter, trim, split, game_started, err_trace, args
+message_filter, trim, split, game_started, err_trace, args,
+mark_milestone
Lua API - character information
diff --git a/crawl-ref/source/dat/clua/dungeon.lua b/crawl-ref/source/dat/clua/dungeon.lua
index cea1849ad3..7b9f1426da 100644
--- a/crawl-ref/source/dat/clua/dungeon.lua
+++ b/crawl-ref/source/dat/clua/dungeon.lua
@@ -357,7 +357,7 @@ function portal_next(e, next)
end
end
--- Turn persistant data into a human readable string
+-- Turn persistant data into a human readable string.
function persist_to_string()
return table_to_string(dgn.persist)
-end
+end \ No newline at end of file
diff --git a/crawl-ref/source/dat/icecave.des b/crawl-ref/source/dat/icecave.des
index fc010f72b5..0b0a7e2505 100644
--- a/crawl-ref/source/dat/icecave.des
+++ b/crawl-ref/source/dat/icecave.des
@@ -163,6 +163,12 @@ function ice_cave_caverns_natural_giant_monster_set(e)
end
}}
+# Add a milestone for entering the Ice Cave.
+{{
+function ice_cave_milestone(e)
+ crawl.mark_milestone("br.enter", "entered an Ice Cave.")
+end
+}}
# Entries ##########################################
@@ -297,6 +303,7 @@ SHUFFLE: "'
SUBST: "=. , ':x .:1
: ice_cave_colours(_G)
: ice_cave_random_monster_list_natural_giant(_G)
+: ice_cave_milestone(_G)
MONS: yak / wolf / polar bear w:4
MONS: polar bear
MONS: frost giant
@@ -375,6 +382,7 @@ SHUFFLE: "'
SUBST: "=. , ':x .:1
: ice_cave_colours(_G)
: dgn.set_random_mon_list("ice beast w:90 / ice dragon / nothing")
+: ice_cave_milestone(_G)
MONS: ice beast
MONS: ice dragon
MONS: ice beast generate_awake
@@ -436,6 +444,7 @@ KFEAT: - = floor w:9 / alarm trap w:1
COLOUR: - = white
: ice_cave_colours(_G)
: ice_cave_random_monster_list_undead_necromancer(_G)
+: ice_cave_milestone(_G)
MONS: ice beast
MONS: white imp
MONS: freezing wraith
@@ -520,6 +529,7 @@ KFEAT: ! = .
ice_cave_colours(_G)
dgn.set_random_mon_list("white imp w:35 / ufetubus w:35 / blue devil w:20 / \
ice devil / nothing")
+ice_cave_milestone(_G)
}}
MONS: white imp / ufetubus
MONS: ice devil / blue devil w:3
@@ -602,6 +612,7 @@ SUBST: - = x
SUBST: _ = w
: end
: ice_cave_colours(_G)
+: ice_cave_milestone(_G)
# Two different populations: undead/demon and natural/giant.
: if crawl.coinflip() then
: ice_cave_random_monster_list_undead_demon(_G)
@@ -696,6 +707,7 @@ SUBST: . = .:40 !:1
: place_fog(_G, "freezing vapour", 25)
KFEAT: ! = .
: ice_cave_colours(_G)
+: ice_cave_milestone(_G)
MAP
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xx..xxwwwwxxx.x.'x-.x5..5xxwwwwwxxx1...x.Wxxxxxx15415.xxxxxx......xxxx
diff --git a/crawl-ref/source/dat/minitomb.des b/crawl-ref/source/dat/minitomb.des
index e9bfe5d85c..30aed481ab 100644
--- a/crawl-ref/source/dat/minitomb.des
+++ b/crawl-ref/source/dat/minitomb.des
@@ -21,7 +21,7 @@ function minitomb_portal(e)
-- $F{xxx} will be substituted with the 'entity' property of the timed
-- marker, or with the desc property (if entity is not set).
messages = time_messages(timeout_turns,
- "Nearby sand pours into $F{the}.",
+ "Nearby sand pours into $F{the}.",
"Nearby sand pours into $F{the}, lightly covering it.",
"Nearby sand pours into $F{the}, greatly covering it.",
"Nearby sand pours into $F{the}, almost completely blocking access.")
@@ -55,6 +55,12 @@ function minitomb_setup_features(e)
end
}}
+# Add the milestone.
+{{
+function minitomb_milestone(e)
+ crawl.mark_milestone("br.enter", "entered a Minitomb.")
+end
+}}
#### Portal entry vaults.
default-depth: D:4-8
@@ -148,6 +154,7 @@ MONS: rat zombie / jackal zombie / snake zombie / goblin zombie / \
human zombie / elf zombie / centaur zombie
MONS: kobold zombie / orc zombie / hobgoblin zombie
: minitomb_setup_features(_G)
+: minitomb_milestone(_G)
MAP
xxxxxxxxxxxxxxxxxxxxxx
x.........<A.........x
@@ -210,6 +217,7 @@ KFEAT: ^ = net trap w:15 / needle trap w:4 / axe trap w:1 / floor w:20
COLOUR: ^ = red
KFEAT: W = dart trap / floor w:20
: minitomb_setup_features(_G)
+: minitomb_milestone(_G)
MAP
cccccccccccccccccccc
ccccccccc3c3c3c3c3c3c3cddddccc
@@ -258,6 +266,7 @@ KFEAT: ^ = alarm trap / floor w:20
SUBST: = : =+
SUBST: = = =+
: minitomb_setup_features(_G)
+: minitomb_milestone(_G)
MAP
vvv
vvv1vvv
@@ -316,6 +325,7 @@ MONS: snake zombie / hobgoblin zombie / orc zombie / kobold zombie / nothing
MONS: big kobold zombie / brown snake zombie / gnoll zombie / nothing
MONS: mummy
: minitomb_setup_features(_G)
+: minitomb_milestone(_G)
MAP
cccccccccccccccccccccc
c<11H~~~G1111F~~~E111c
@@ -353,6 +363,7 @@ MONS: orc zombie / kobold zombie / big kobold zombie / hobgoblin zombie
ITEM: nothing / any scroll w:5 / any potion
KFEAT: ^ = alarm trap
: minitomb_setup_features(_G)
+: minitomb_milestone(_G)
MAP
cccccccccccccccccccccc
cccc.....2222.....cccc
diff --git a/crawl-ref/source/dat/sewer.des b/crawl-ref/source/dat/sewer.des
index 5720213fc8..302f20e93c 100644
--- a/crawl-ref/source/dat/sewer.des
+++ b/crawl-ref/source/dat/sewer.des
@@ -78,6 +78,13 @@ function sewer_random_monster_list(e)
end
}}
+# Add the milestone.
+{{
+function sewer_milestone(e)
+ crawl.mark_milestone("br.enter", "entered a Sewer.")
+end
+}}
+
# Basic sewer entries ##########################################
default-depth: D:3-6
@@ -174,6 +181,7 @@ SUBST: ' = .W
SUBST: ? = .x
: sewer_colours(_G)
: sewer_random_monster_list(_G)
+: sewer_milestone(_G)
# some fresh water for the kobolds
KFEAT: Y = deep_water
KFEAT: y = shallow_water
@@ -242,6 +250,7 @@ WEIGHT: 30
SUBST: - = W..
: sewer_colours(_G)
: sewer_random_monster_list(_G)
+: sewer_milestone(_G)
ITEM: scroll of teleportation w:2 / scroll of blinking / \
scroll of random uselessness w:1
MONS: giant newt / small snake w:5 / \
@@ -291,6 +300,7 @@ TAGS: sewer no_item_gen no_monster_gen
ORIENT: encompass
: sewer_colours(_G)
: sewer_random_monster_list(_G)
+: sewer_milestone(_G)
MONS: giant lizard
ITEM: potion of berserk rage / potion of speed w:5
MONS: giant bat / giant mosquito w:2
@@ -350,6 +360,7 @@ COLOUR: ? = lightgreen
SUBST: - = W..
: sewer_colours(_G)
: sewer_random_monster_list(_G)
+: sewer_milestone(_G)
MONS: giant bat / giant newt / small snake / ooze w:2 / worm w:2 / \
snake w:1 / giant mosquito w:2
MONS: giant bat / giant mosquito w:2 / nothing w:2