summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/docs/develop/levels/syntax.txt10
-rw-r--r--crawl-ref/settings/autopickup_exceptions.txt6
-rw-r--r--crawl-ref/source/SDLMain.m31
-rw-r--r--crawl-ref/source/beam.cc7
-rw-r--r--crawl-ref/source/cio.cc2
-rw-r--r--crawl-ref/source/cloud.cc5
-rw-r--r--crawl-ref/source/crash-u.cc3
-rw-r--r--crawl-ref/source/dat/crypt.des15
-rw-r--r--crawl-ref/source/dat/database/monspeak.txt12
-rw-r--r--crawl-ref/source/dat/descript/gods.txt2
-rw-r--r--crawl-ref/source/dat/descript/monsters.txt2
-rw-r--r--crawl-ref/source/dat/mini.des15
-rw-r--r--crawl-ref/source/dat/uniques.des2
-rw-r--r--crawl-ref/source/defines.h3
-rw-r--r--crawl-ref/source/dungeon.cc7
-rw-r--r--crawl-ref/source/effects.cc12
-rw-r--r--crawl-ref/source/enum.h1
-rw-r--r--crawl-ref/source/hiscores.cc6
-rw-r--r--crawl-ref/source/initfile.cc3
-rw-r--r--crawl-ref/source/item_use.cc3
-rw-r--r--crawl-ref/source/items.cc3
-rw-r--r--crawl-ref/source/l_mons.cc41
-rw-r--r--crawl-ref/source/libgui.cc2
-rw-r--r--crawl-ref/source/libgui.h2
-rw-r--r--crawl-ref/source/libutil.cc2
-rw-r--r--crawl-ref/source/libutil.h2
-rw-r--r--crawl-ref/source/mapdef.cc17
-rw-r--r--crawl-ref/source/mon-data.h22
-rw-r--r--crawl-ref/source/mon-gear.cc18
-rw-r--r--crawl-ref/source/mon-place.cc1
-rw-r--r--crawl-ref/source/mon-spll.h2
-rw-r--r--crawl-ref/source/mon-stuff.cc7
-rw-r--r--crawl-ref/source/mon-util.cc8
-rw-r--r--crawl-ref/source/mon-util.h3
-rw-r--r--crawl-ref/source/monster.cc3
-rw-r--r--crawl-ref/source/rltiles/dc-mon.txt1
-rw-r--r--crawl-ref/source/rltiles/dc-mon/plant_crypt.pngbin0 -> 1539 bytes
-rw-r--r--crawl-ref/source/spells3.cc18
-rw-r--r--crawl-ref/source/spells4.cc2
-rw-r--r--crawl-ref/source/teleport.cc4
-rw-r--r--crawl-ref/source/tilepick.cc3
-rw-r--r--crawl-ref/source/tilesdl.cc23
-rw-r--r--crawl-ref/source/tilesdl.h2
43 files changed, 209 insertions, 124 deletions
diff --git a/crawl-ref/docs/develop/levels/syntax.txt b/crawl-ref/docs/develop/levels/syntax.txt
index 1598f04719..642e7f5564 100644
--- a/crawl-ref/docs/develop/levels/syntax.txt
+++ b/crawl-ref/docs/develop/levels/syntax.txt
@@ -557,6 +557,16 @@ MONS: (list of monsters)
The colour "any" can be given, in which case a random colour
will be chosen when the monster is placed.
+ You can override the displayed monster tile using the "tile:"
+ specifier as follows:
+ MONS: rat tile:giant_bat
+
+ In tiles version, this would create a monster that uses the
+ 'giant_bat' tile, but is otherwise identical to a rat. Obviously, this
+ substition of one monster onto another should never be used, but it
+ can be useful for customised vault monsters if an alternate tile
+ exists. In ASCII mode, this will do nothing.
+
Note that 8, 9, 0 also place monsters (see the table).
If you want to place a random monster suitable for the level
diff --git a/crawl-ref/settings/autopickup_exceptions.txt b/crawl-ref/settings/autopickup_exceptions.txt
index 635bf1ec09..f04a255bf7 100644
--- a/crawl-ref/settings/autopickup_exceptions.txt
+++ b/crawl-ref/settings/autopickup_exceptions.txt
@@ -28,8 +28,6 @@ ae = dangerous_item
# subtype that means you already have one of it.) Also for some rings.
# Some items may already be excluded as bad_item, e.g. inaccuracy.
ae = amulet of (inaccuracy|the gourmand|controlled flight|warding)
-ae = amulet of (resist .*|clarity|rage|conservation)
+ae = amulet of (resist .*|clarity|rage|conservation|guardian spirit)
ae = ring of (see invisible|levitation|poison resistance|hunger)
-ae = ring of (fire|ice|sustenance|invisibility)
-ae = ring of (magical power|regeneration)
-
+ae = ring of (invisibility)
diff --git a/crawl-ref/source/SDLMain.m b/crawl-ref/source/SDLMain.m
index 94f1ee450a..658c817619 100644
--- a/crawl-ref/source/SDLMain.m
+++ b/crawl-ref/source/SDLMain.m
@@ -26,8 +26,8 @@
/* Portions of CPS.h */
typedef struct CPSProcessSerNum
{
- UInt32 lo;
- UInt32 hi;
+ UInt32 lo;
+ UInt32 hi;
} CPSProcessSerNum;
extern OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn);
@@ -87,15 +87,16 @@ static NSString *getApplicationName(void)
if (shouldChdir)
{
char parentdir[MAXPATHLEN];
- CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle());
- CFURLRef url2 = CFURLCreateCopyDeletingLastPathComponent(0, url);
- if (CFURLGetFileSystemRepresentation(url2, true, (UInt8 *)parentdir, MAXPATHLEN)) {
- assert ( chdir (parentdir) == 0 ); /* chdir to the binary app's parent */
- }
- CFRelease(url);
- CFRelease(url2);
- }
-
+ CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle());
+ CFURLRef url2 = CFURLCreateCopyDeletingLastPathComponent(0, url);
+ if (CFURLGetFileSystemRepresentation(url2, true, (UInt8 *)parentdir,
+ MAXPATHLEN))
+ {
+ assert ( chdir (parentdir) == 0 ); /* chdir to the binary app's parent */
+ }
+ CFRelease(url);
+ CFRelease(url2);
+ }
}
#if SDL_USE_NIB_FILE
@@ -358,13 +359,16 @@ int main (int argc, char **argv)
{
/* Copy the arguments into a global variable */
/* This is passed if we are launched by double-clicking */
- if ( argc >= 2 && strncmp (argv[1], "-psn", 4) == 0 ) {
+ if ( argc >= 2 && strncmp (argv[1], "-psn", 4) == 0 )
+ {
gArgv = (char **) SDL_malloc(sizeof (char *) * 2);
gArgv[0] = argv[0];
gArgv[1] = NULL;
gArgc = 1;
gFinderLaunch = YES;
- } else {
+ }
+ else
+ {
int i;
gArgc = argc;
gArgv = (char **) SDL_malloc(sizeof (char *) * (argc+1));
@@ -381,4 +385,3 @@ int main (int argc, char **argv)
#endif
return 0;
}
-
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index f531c50491..7f44ec6ffc 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -4948,7 +4948,9 @@ void bolt::affect_monster(monsters* mon)
{
msg::stream << mon->name(DESC_CAP_THE) << " deflects the "
<< name << '!' << std::endl;
- } else {
+ }
+ else
+ {
msg::stream << "The " << name << " misses "
<< mon->name(DESC_NOCAP_THE) << '.' << std::endl;
}
@@ -5968,7 +5970,8 @@ void bolt::determine_affected_cells(explosion_map& m, const coord_def& delta,
for (unsigned int i = 0; i < aoe_funcs.size(); ++i)
hits = (*aoe_funcs[i])(*this, loc) && hits;
- if (hits) {
+ if (hits)
+ {
// Hmm, I think we're OK.
m(delta + centre) = std::min(count, m(delta + centre));
}
diff --git a/crawl-ref/source/cio.cc b/crawl-ref/source/cio.cc
index 87f37df0cd..9c7a705c57 100644
--- a/crawl-ref/source/cio.cc
+++ b/crawl-ref/source/cio.cc
@@ -401,7 +401,7 @@ void line_reader::cursorto(int ncx)
{
int x = (start_x + ncx - 1) % wrapcol + 1;
int y = start_y + (start_x + ncx - 1) / wrapcol;
- ::cgotoxy(x, y, GOTO_LAST);
+ ::cgotoxy(x, y);
}
int line_reader::read_line(bool clear_previous)
diff --git a/crawl-ref/source/cloud.cc b/crawl-ref/source/cloud.cc
index 69a4e185fa..9678edc16c 100644
--- a/crawl-ref/source/cloud.cc
+++ b/crawl-ref/source/cloud.cc
@@ -771,14 +771,13 @@ void in_a_cloud()
case CLOUD_MUTAGENIC:
mpr("You are engulfed in a mutagenic fog!");
- if (coinflip()) {
+ if (coinflip())
+ {
mpr("Strange energies course through your body.");
if (one_chance_in(3))
you.mutate();
else
- {
give_bad_mutation();
- }
}
break;
diff --git a/crawl-ref/source/crash-u.cc b/crawl-ref/source/crash-u.cc
index 5b6614ad9d..b1309b385e 100644
--- a/crawl-ref/source/crash-u.cc
+++ b/crawl-ref/source/crash-u.cc
@@ -215,7 +215,8 @@ void write_stack_trace(FILE* file, int ignore_count)
// Now we prettify the printout to even show demangled C++ function names.
std::string bt = "";
- for (int i = 0; i < num_frames; i++) {
+ for (int i = 0; i < num_frames; i++)
+ {
#if defined (TARGET_OS_MACOSX)
char *addr = ::strstr(symbols[i], "0x");
char *mangled = ::strchr(addr, ' ') + 1;
diff --git a/crawl-ref/source/dat/crypt.des b/crawl-ref/source/dat/crypt.des
index 3ca4855d60..54e1fd6387 100644
--- a/crawl-ref/source/dat/crypt.des
+++ b/crawl-ref/source/dat/crypt.des
@@ -76,8 +76,9 @@ DEPTH: Crypt
MONS: death ooze
KFEAT: f = .
# "withered plant" instead of "plant"
-KMONS: f = w:2 col:darkgrey plant name:withered name_adjective / \
- w:1 col:lightgrey plant name:withered name_adjective
+KMONS: f = w:2 col:darkgrey plant name:withered name_adjective \
+ tile:withered_plant / w:1 col:lightgrey plant name:withered \
+ name_adjective tile:withered_plant
SUBST: p = f:2 .:1
SUBST: 1 = 1:3 .:1
MAP
@@ -317,8 +318,9 @@ ORIENT: float
TAGS: tomb_entry no_monster_gen
KFEAT: f = .
# "withered plant" instead of "plant"
-KMONS: f = w:2 col:darkgrey plant name:withered name_adjective / \
- w:1 col:lightgrey plant name:withered name_adjective
+KMONS: f = w:2 col:darkgrey plant name:withered name_adjective \
+ tile:withered_plant / w:1 col:lightgrey plant name:withered \
+ name_adjective tile:withered_plant
SUBST: p = f.
MAP
cccccccccc
@@ -632,8 +634,9 @@ SUBST: F = f ?
SUBST: f = p:1 .:1
KFEAT: p = .
# "withered plant" instead of "plant"
-KMONS: p = w:2 col:darkgrey plant name:withered name_adjective / \
- w:1 col:lightgrey plant name:withered name_adjective
+KMONS: f = w:2 col:darkgrey plant name:withered name_adjective \
+ tile:withered_plant / w:1 col:lightgrey plant name:withered \
+ name_adjective tile:withered_plant
####### hidden skeleton; sometimes good pain weapon, but draining short sword
KFEAT: ! = .
KMONS: ! = skeletal warrior ; w:2 dagger ego:pain | short sword ego:draining |\
diff --git a/crawl-ref/source/dat/database/monspeak.txt b/crawl-ref/source/dat/database/monspeak.txt
index 535f75524c..6b0a310829 100644
--- a/crawl-ref/source/dat/database/monspeak.txt
+++ b/crawl-ref/source/dat/database/monspeak.txt
@@ -1047,7 +1047,7 @@ _player_ghost_rare_
# Unique monsters
#######################################
%%%%
-############ AIZUL ### Renegade Guardian Naga Crusader whose vault got raided
+############ AIZUL ### Renegade guardian serpent whose vault was raided.
Aizul
@_Aizul_common_@
@@ -1064,7 +1064,7 @@ VISUAL:@The_monster@ yawns, and then pretends he didn't.
@The_monster@ says, "I wasn't actually sleeping!"
-VISUAL:@The_monster@ grinds his teeth.
+VISUAL:@The_monster@ hisses menacingly.
@The_monster@ screams @at_foe@, "I'll haunt your nightmares!"
%%%%
@@ -1074,12 +1074,18 @@ _Aizul_rare_
@The_monster@ hums a lullaby.
-VISUAL:@The_monster@ stretches carefully.
+VISUAL:@The_monster@ coils and then uncoils.
@The_monster@ says, "Everybody has to sleep sometimes."
@The_monster@ says @to_foe@, "Fancy a snooze?"
+@The_monster@ says, "They said they'd gotten someone better!"
+
+@The_monster@ says, "Replaced! How does it feel to be replaced?"
+
+@The_monster@ moans, "No job prospects! Who wants sleepy Aizul to guard their treasure?"
+
VISUAL:@The_monster@ winks several times @at_foe@.
%%%%
############ AGNES ### She is trying to get money and treasure
diff --git a/crawl-ref/source/dat/descript/gods.txt b/crawl-ref/source/dat/descript/gods.txt
index 6b960e4129..601a3987fb 100644
--- a/crawl-ref/source/dat/descript/gods.txt
+++ b/crawl-ref/source/dat/descript/gods.txt
@@ -80,7 +80,7 @@ Fedhas Madash is the god of plant and fungal life.
%%%%
Cheibriados
-Cheibriados is a god who meditates on the mystery of time. Those who choose to follow his path will learn to eschew unnecessary haste, slowing down both themselves and others, and hurt those who refuse to slow down. Especially devout followers may even temporarily abandon the flow of time and its needless disturbances.
+Cheibriados is a god who meditates on the mystery of time. Those who choose to follow this god's path will learn to eschew unnecessary haste, slowing down both themselves and others, and hurt those who refuse to slow down. Especially devout followers may even temporarily abandon the flow of time and its needless disturbances.
%%%%
Zin powers
diff --git a/crawl-ref/source/dat/descript/monsters.txt b/crawl-ref/source/dat/descript/monsters.txt
index ba0cc96cc9..3c7108bd0d 100644
--- a/crawl-ref/source/dat/descript/monsters.txt
+++ b/crawl-ref/source/dat/descript/monsters.txt
@@ -20,7 +20,7 @@ power.
%%%%
Aizul
-Once the guardian of a legendary treasure hoard, he was disgraced after thieves looted it while he slept. Left without a purpose he now slithers aimlessly from place to place, seeking redemption on the field of battle.
+Once the primary guardian of a legendary treasure hoard, he was disgraced after thieves looted it while he slept. Left without a job and a purpose, he now slithers aimlessly from place to place.
%%%%%
Agnes
diff --git a/crawl-ref/source/dat/mini.des b/crawl-ref/source/dat/mini.des
index da02a6a32e..1197e9936b 100644
--- a/crawl-ref/source/dat/mini.des
+++ b/crawl-ref/source/dat/mini.des
@@ -2661,3 +2661,18 @@ MAP
@....21=@
.....xxx
ENDMAP
+
+##############################################################################
+# Caryatid's revenge (AKB)
+#
+NAME: archer_statue
+DEPTH: D:8-, Vault, Elf
+MONS: statue name:archer name_adjective; longbow . arrow q:30
+MAP
+ ccc
+ccccc1ccccc
+...........
+...........
+ .........
+ .....
+ENDMAP
diff --git a/crawl-ref/source/dat/uniques.des b/crawl-ref/source/dat/uniques.des
index e45d0ee4c6..8e4e08525d 100644
--- a/crawl-ref/source/dat/uniques.des
+++ b/crawl-ref/source/dat/uniques.des
@@ -99,7 +99,7 @@ DEPTH: 14-16, !Lair, !Slime
: place_unique(_G, "Agnes")
NAME: uniq_aizul
-DEPTH: 16-25, !Lair, !Slime, Snake:2-5
+DEPTH: 13-25, !Lair, !Slime
: place_unique(_G, "Aizul")
NAME: uniq_azrael
diff --git a/crawl-ref/source/defines.h b/crawl-ref/source/defines.h
index 70cb440334..20809e552d 100644
--- a/crawl-ref/source/defines.h
+++ b/crawl-ref/source/defines.h
@@ -282,8 +282,7 @@ enum GotoRegion
GOTO_MSG, // cprintf > message
GOTO_STAT, // cprintf > character status
GOTO_DNGN, // cprintf > dungeon screen
- GOTO_MLIST,// cprintf > monster list
- GOTO_LAST // cprintf > last active region or CRT, if none
+ GOTO_MLIST // cprintf > monster list
};
// Mouse modes (for tiles)
diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc
index 652d9370f0..aab2d4e0e4 100644
--- a/crawl-ref/source/dungeon.cc
+++ b/crawl-ref/source/dungeon.cc
@@ -2997,7 +2997,9 @@ static builder_rc_type _builder_basic(int level_number)
#ifdef DEBUG_DIAGNOSTICS
mprf(MSGCH_DIAGNOSTICS, "Trail ends in shaft.");
#endif
- } else {
+ }
+ else
+ {
grd[xend][yend] = DNGN_FLOOR;
#ifdef DEBUG_DIAGNOSTICS
mprf(MSGCH_DIAGNOSTICS, "Trail does not end in shaft..");
@@ -4970,6 +4972,7 @@ int dgn_place_monster(mons_spec &mspec,
mg.mname = mspec.monname;
mg.hd = mspec.hd;
mg.hp = mspec.hp;
+ mg.props = mspec.props;
// Marking monsters as summoned
mg.abjuration_duration = mspec.abjuration_duration;
@@ -5016,6 +5019,8 @@ int dgn_place_monster(mons_spec &mspec,
_dgn_give_mon_spec_items(mspec, mindex, mid, monster_level);
if (mspec.explicit_spells)
mons.spells = mspec.spells;
+ if (mspec.props.exists("monster_tile"))
+ mons.props["monster_tile"] = mspec.props["monster_tile"].get_short();
// These are applied earlier to prevent issues with renamed monsters
// and "<monster> comes into view" (see delay.cc:_monster_warning).
//mons.flags |= mspec.extra_monster_flags;
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index ce7f664cea..7573ca6313 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -4092,14 +4092,18 @@ static void _catchup_monster_moves(monsters *mon, int turns)
}
bool changed = 0;
- for (int i = 0; i < range/x; i++) {
+ for (int i = 0; i < range/x; i++)
+ {
if (mon->behaviour == BEH_SLEEP)
break;
- if (coinflip()) {
+
+ if (coinflip())
+ {
changed = 1;
- if (coinflip()) {
+ if (coinflip())
mon->behaviour = BEH_SLEEP;
- } else {
+ else
+ {
mon->behaviour = BEH_WANDER;
mon->foe = MHITNOT;
mon->target = random_in_bounds();
diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h
index 8fce0f0b8e..4d9733c34a 100644
--- a/crawl-ref/source/enum.h
+++ b/crawl-ref/source/enum.h
@@ -2027,6 +2027,7 @@ enum monster_type // (int) menv[].type
MONS_ORANGE_STATUE,
MONS_SILVER_STATUE,
MONS_ICE_STATUE,
+ MONS_STATUE,
// Third batch of uniques
MONS_ROXANNE = 450, // -- statue, too!
diff --git a/crawl-ref/source/hiscores.cc b/crawl-ref/source/hiscores.cc
index 80da72274b..81bf6479e8 100644
--- a/crawl-ref/source/hiscores.cc
+++ b/crawl-ref/source/hiscores.cc
@@ -1084,8 +1084,10 @@ void scorefile_entry::init()
best_skill_lvl = you.skills[ best_skill ];
// Note all skills at level 27.
- for (int sk = 0; sk < NUM_SKILLS; ++sk) {
- if (you.skills[sk] == 27) {
+ for (int sk = 0; sk < NUM_SKILLS; ++sk)
+ {
+ if (you.skills[sk] == 27)
+ {
if (!maxed_skills.empty())
maxed_skills += ",";
maxed_skills += skill_name(sk);
diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc
index 158112a087..9fdbf2a886 100644
--- a/crawl-ref/source/initfile.cc
+++ b/crawl-ref/source/initfile.cc
@@ -907,7 +907,8 @@ void game_options::reset_options()
// Otherwise, do a check to see if we're using Apple_Terminal.
#ifndef USE_8_COLOUR_TERM_MAP
const char *term_program = getenv("TERM_PROGRAM");
- if (term_program && strcmp(term_program, "Apple_Terminal") == 0) {
+ if (term_program && strcmp(term_program, "Apple_Terminal") == 0)
+ {
#endif
for (int i = 0; i < 16; ++i)
colour[i] = i % 8;
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index 91eea53903..abb21d0fc2 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -2096,7 +2096,8 @@ bool setup_missile_beam(const actor *agent, bolt &beam, item_def &item,
beam.damage_funcs.push_back(_silver_damages_victim);
if (poisoned)
beam.hit_funcs.push_back(_poison_hit_victim);
- if (penetrating) {
+ if (penetrating)
+ {
beam.range_funcs.push_back(_item_penetrates_victim);
beam.hit_verb = "passes through";
}
diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc
index ad2d189658..a167165398 100644
--- a/crawl-ref/source/items.cc
+++ b/crawl-ref/source/items.cc
@@ -2313,9 +2313,8 @@ bool item_needs_autopickup(const item_def &item)
if ((item.flags & ISFLAG_THROWN) && Options.pickup_thrown)
return (true);
- if ((item.flags & ISFLAG_DROPPED) && !Options.pickup_dropped) {
+ if ((item.flags & ISFLAG_DROPPED) && !Options.pickup_dropped)
return (false);
- }
std::string itemname;
return _is_option_autopickup(item, itemname);
diff --git a/crawl-ref/source/l_mons.cc b/crawl-ref/source/l_mons.cc
index 0f7a4b75b8..9071039a65 100644
--- a/crawl-ref/source/l_mons.cc
+++ b/crawl-ref/source/l_mons.cc
@@ -125,8 +125,8 @@ static int l_mons_do_dismiss(lua_State *ls)
// dismiss is only callable from dlua, not from managed VMs (i.e.
// end-user scripts cannot dismiss monsters).
ASSERT_DLUA;
- monsters *mons =
- util_get_userdata<monsters>(ls, lua_upvalueindex(1));
+ monsters *mons = util_get_userdata<monsters>(ls, lua_upvalueindex(1));
+
if (mons->alive())
{
mons->flags |= MF_HARD_RESET;
@@ -142,12 +142,11 @@ static int l_mons_do_random_teleport(lua_State *ls)
// We should only be able to teleport monsters from dlua.
ASSERT_DLUA;
- monsters *mons =
- util_get_userdata<monsters>(ls, lua_upvalueindex(1));
+ monsters *mons = util_get_userdata<monsters>(ls, lua_upvalueindex(1));
+
if (mons->alive())
- {
mons->teleport(true);
- }
+
return (0);
}
@@ -241,10 +240,8 @@ static int monster_get(lua_State *ls)
return (0);
for (unsigned i = 0; i < sizeof(mons_attrs) / sizeof(mons_attrs[0]); ++i)
- {
if (!strcmp(attr, mons_attrs[i].attribute))
return (mons_attrs[i].accessor(ls, mw->mons, attr));
- }
return (0);
}
@@ -259,11 +256,14 @@ static const char *_monster_behaviour_names[] = {
"lurk"
};
-static beh_type behaviour_by_name(const std::string &name) {
+static beh_type behaviour_by_name(const std::string &name)
+{
ASSERT(ARRAYSZ(_monster_behaviour_names) == NUM_BEHAVIOURS);
+
for (unsigned i = 0; i < ARRAYSZ(_monster_behaviour_names); ++i)
if (name == _monster_behaviour_names[i])
return static_cast<beh_type>(i);
+
return NUM_BEHAVIOURS;
}
@@ -281,12 +281,13 @@ static int monster_set(lua_State *ls)
if (!attr)
return (0);
- if (!strcmp(attr, "beh")) {
+ if (!strcmp(attr, "beh"))
+ {
const beh_type beh =
- lua_isnumber(ls, 3) ?
- static_cast<beh_type>(luaL_checkint(ls, 3)) :
- lua_isstring(ls, 3) ? behaviour_by_name(lua_tostring(ls, 3)) :
- NUM_BEHAVIOURS;
+ lua_isnumber(ls, 3) ? static_cast<beh_type>(luaL_checkint(ls, 3)) :
+ lua_isstring(ls, 3) ? behaviour_by_name(lua_tostring(ls, 3))
+ : NUM_BEHAVIOURS;
+
if (beh != NUM_BEHAVIOURS)
mw->mons->behaviour = beh;
}
@@ -294,17 +295,21 @@ static int monster_set(lua_State *ls)
return (0);
}
-static int mons_behaviour(lua_State *ls) {
+static int mons_behaviour(lua_State *ls)
+{
if (lua_gettop(ls) < 1)
return (0);
- if (lua_isnumber(ls, 1)) {
+ if (lua_isnumber(ls, 1))
+ {
lua_pushvalue(ls, 1);
return (1);
}
- else if (lua_isstring(ls, 1)) {
+ else if (lua_isstring(ls, 1))
+ {
const beh_type beh = behaviour_by_name(lua_tostring(ls, 1));
- if (beh != NUM_BEHAVIOURS) {
+ if (beh != NUM_BEHAVIOURS)
+ {
lua_pushnumber(ls, beh);
return (1);
}
diff --git a/crawl-ref/source/libgui.cc b/crawl-ref/source/libgui.cc
index e14baa2896..eb63694c25 100644
--- a/crawl-ref/source/libgui.cc
+++ b/crawl-ref/source/libgui.cc
@@ -317,7 +317,7 @@ void message_out(int *which_line, int colour, const char *s, int firstcol)
tiles.message_out(which_line, colour, s, firstcol);
}
-void cgotoxy(int x, int y, int region)
+void cgotoxy(int x, int y, GotoRegion region)
{
tiles.cgotoxy(x, y, region);
}
diff --git a/crawl-ref/source/libgui.h b/crawl-ref/source/libgui.h
index d738075d7e..535a7cef5e 100644
--- a/crawl-ref/source/libgui.h
+++ b/crawl-ref/source/libgui.h
@@ -58,7 +58,7 @@ extern "C" int getch();
int getch_ck();
int clrscr();
void message_out(int *which_line, int colour, const char *s, int firstcol = 0);
-void cgotoxy(int x, int y, int region = GOTO_CRT);
+void cgotoxy(int x, int y, GotoRegion region = GOTO_CRT);
void clear_message_window();
void delay(int ms);
void update_screen();
diff --git a/crawl-ref/source/libutil.cc b/crawl-ref/source/libutil.cc
index c4988c7656..eeaf949b61 100644
--- a/crawl-ref/source/libutil.cc
+++ b/crawl-ref/source/libutil.cc
@@ -699,7 +699,7 @@ int snprintf( char *str, size_t size, const char *format, ... )
#endif
#ifndef USE_TILE
-void cgotoxy(int x, int y, int region)
+void cgotoxy(int x, int y, GotoRegion region)
{
ASSERT(x >= 1);
ASSERT(y >= 1);
diff --git a/crawl-ref/source/libutil.h b/crawl-ref/source/libutil.h
index 824b133be9..b32aa83be2 100644
--- a/crawl-ref/source/libutil.h
+++ b/crawl-ref/source/libutil.h
@@ -166,7 +166,7 @@ int snprintf( char *str, size_t size, const char *format, ... );
#endif
#ifndef USE_TILE
-void cgotoxy(int x, int y, int region = GOTO_CRT);
+void cgotoxy(int x, int y, GotoRegion region = GOTO_CRT);
#endif
template <typename T>
diff --git a/crawl-ref/source/mapdef.cc b/crawl-ref/source/mapdef.cc
index 4a9162cadd..76dc38c452 100644
--- a/crawl-ref/source/mapdef.cc
+++ b/crawl-ref/source/mapdef.cc
@@ -3160,6 +3160,23 @@ mons_list::mons_spec_slot mons_list::parse_mons_spec(std::string spec)
}
}
+ std::string tile = strip_tag_prefix(mon_str, "tile:");
+#ifdef USE_TILE
+ if (!tile.empty())
+ {
+ // Modify the string to prevent them from using non-mons tiles.
+ if (tile.find("mons_") == std::string::npos)
+ tile = std::string("mons_" + tile);
+ unsigned int index;
+ if (!tile_player_index(tile.c_str(), index))
+ {
+ error = make_stringf("bad tile name: \"%s\".", tile.c_str());
+ return (slot);
+ }
+ mspec.props["monster_tile"] = short(index);
+ }
+#endif
+
std::string name = strip_tag_prefix(mon_str, "name:");
if (!name.empty())
{
diff --git a/crawl-ref/source/mon-data.h b/crawl-ref/source/mon-data.h
index 93b54dd808..73dde6150e 100644
--- a/crawl-ref/source/mon-data.h
+++ b/crawl-ref/source/mon-data.h
@@ -4171,6 +4171,18 @@ static monsterentry mondata[] = {
MONUSE_NOTHING, MONEAT_NOTHING, SIZE_LARGE
},
+{
+ MONS_STATUE, '8', LIGHTGREY, "statue",
+ M_STATIONARY | M_SPEAKS,
+ MR_RES_POISON | MR_RES_FIRE | MR_RES_COLD | MR_RES_ELEC,
+ 0, 10, MONS_CLAY_GOLEM, MONS_STATUE, MH_NONLIVING, MAG_IMMUNE,
+ { {AT_HIT, AF_WEAP_ONLY, 20}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK },
+ { 8, 0, 0, 70 },
+ 12, 1, MST_NO_SPELLS, CE_NOCORPSE, Z_NOZOMBIE, S_SILENT,
+ I_HIGH, HT_LAND, FL_NONE, 10, DEFAULT_ENERGY,
+ MONUSE_STARTING_EQUIPMENT, MONEAT_NOTHING, SIZE_LARGE
+},
+
// gargoyles ('9')
{
MONS_GARGOYLE, '9', LIGHTGREY, "gargoyle",
@@ -4569,15 +4581,15 @@ static monsterentry mondata[] = {
{
MONS_AIZUL, 'N', LIGHTMAGENTA, "Aizul",
- M_FIGHTER | M_SPELLCASTER | M_SEE_INVIS | M_WARM_BLOOD | M_SPEAKS
+ M_SPELLCASTER | M_SEE_INVIS | M_WARM_BLOOD | M_SPEAKS
| M_ACTUAL_SPELLS | M_UNIQUE,
MR_RES_POISON,
- 750, 10, MONS_NAGA, MONS_GUARDIAN_NAGA, MH_NATURAL, -6,
- { {AT_HIT, AF_PLAIN, 28}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK },
+ 350, 10, MONS_NAGA, MONS_GUARDIAN_NAGA, MH_NATURAL, -6,
+ { {AT_HIT, AF_PLAIN, 25}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK },
{ 14, 0, 0, 142 },
- 6, 16, MST_AIZUL, CE_MUTAGEN_RANDOM, Z_NOZOMBIE, S_SHOUT,
+ 8, 18, MST_AIZUL, CE_MUTAGEN_RANDOM, Z_NOZOMBIE, S_SHOUT,
I_HIGH, HT_LAND, FL_NONE, 15, DEFAULT_ENERGY,
- MONUSE_WEAPONS_ARMOUR, MONEAT_NOTHING, SIZE_LARGE
+ MONUSE_NOTHING, MONEAT_NOTHING, SIZE_LARGE
},
{
diff --git a/crawl-ref/source/mon-gear.cc b/crawl-ref/source/mon-gear.cc
index f66fdb0410..96ff1feef1 100644
--- a/crawl-ref/source/mon-gear.cc
+++ b/crawl-ref/source/mon-gear.cc
@@ -274,16 +274,6 @@ static item_make_species_type _give_weapon(monsters *mon, int level,
do_curse_item(item);
break;
- case MONS_AIZUL:
- if (one_chance_in(3))
- level = MAKE_GOOD_ITEM;
-
- item_race = MAKE_ITEM_NO_RACE;
- item.base_type = OBJ_WEAPONS;
- item.sub_type = random_choose(WPN_HALBERD, WPN_SCIMITAR, WPN_GREAT_MACE,
- WPN_LONG_SWORD, WPN_EVENINGSTAR, -1);
- break;
-
case MONS_GNOLL:
case MONS_OGRE_MAGE:
case MONS_NAGA_WARRIOR:
@@ -1193,7 +1183,6 @@ void give_shield(monsters *mon, int level)
make_item_for_monster(mon, OBJ_ARMOUR, ARM_LARGE_SHIELD,
level * 2 + 1, MAKE_ITEM_RANDOM_RACE, 1);
break;
- case MONS_AIZUL:
case MONS_DONALD:
make_item_for_monster(mon, OBJ_ARMOUR, ARM_SHIELD,
level * 2 + 1, MAKE_ITEM_RANDOM_RACE, 1);
@@ -1490,13 +1479,6 @@ void give_armour(monsters *mon, int level)
force_colour = LIGHTCYAN;
break;
- case MONS_AIZUL:
- item_race = MAKE_ITEM_NO_RACE;
- item.base_type = OBJ_ARMOUR;
- item.sub_type = ARM_NAGA_BARDING;
- force_colour = RED;
- break;
-
default:
return;
}
diff --git a/crawl-ref/source/mon-place.cc b/crawl-ref/source/mon-place.cc
index d3da78c640..6629b8acf1 100644
--- a/crawl-ref/source/mon-place.cc
+++ b/crawl-ref/source/mon-place.cc
@@ -298,6 +298,7 @@ void spawn_random_monsters()
mgen_data mg(WANDERING_MONSTER);
mg.proximity = prox;
+ mg.foe = (you.char_direction == GDT_ASCENDING) ? MHITYOU : MHITNOT;
mons_place(mg);
viewwindow(false);
return;
diff --git a/crawl-ref/source/mon-spll.h b/crawl-ref/source/mon-spll.h
index 4b2f8fe176..ed5d9ea79e 100644
--- a/crawl-ref/source/mon-spll.h
+++ b/crawl-ref/source/mon-spll.h
@@ -1270,7 +1270,7 @@
SPELL_BLINK_OTHER,
SPELL_SLEEP,
SPELL_POISON_ARROW,
- SPELL_SLOW,
+ SPELL_POISON_ARROW,
SPELL_MINOR_HEALING
}
},
diff --git a/crawl-ref/source/mon-stuff.cc b/crawl-ref/source/mon-stuff.cc
index fc109c5aee..afe17384ac 100644
--- a/crawl-ref/source/mon-stuff.cc
+++ b/crawl-ref/source/mon-stuff.cc
@@ -1115,7 +1115,7 @@ static void _elven_twin_died(monsters* twin, bool in_transit)
found_duvessa = true;
break;
}
- else if (mi->type == MONS_DOWAN
+ else if (mi->type == MONS_DOWAN
|| (mi->props.exists("original_name")
&& mi->props["original_name"].get_string() == "Dowan"))
{
@@ -2095,8 +2095,8 @@ int monster_die(monsters *monster, killer_type killer,
// And his vault can be placed again.
you.uniq_map_names.erase("uniq_boris");
}
- else if (monster->type == MONS_KIRKE
- || (monster->props.exists("original_name")
+ else if (monster->type == MONS_KIRKE
+ || (monster->props.exists("original_name")
&& monster->props["original_name"].get_string() == "Kirke")
&& !in_transit)
{
@@ -3708,7 +3708,6 @@ void monster_teleport(monsters *monster, bool instan, bool silent)
monster->add_ench( mon_enchant(ENCH_TP, 0, KC_OTHER,
random_range(20, 30)) );
}
-
return;
}
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index d5b4a54201..e86602e9c9 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -1081,6 +1081,14 @@ mon_attack_def mons_attack_spec(const monsters *mon, int attk_number)
attk.flavour = RANDOM_ELEMENT(flavours);
}
+ if (attk.flavour == AF_WEAP_ONLY)
+ {
+ if (mon->inv[MSLOT_WEAPON] != NON_ITEM) // not mon->weapon() !
+ attk.flavour = AF_PLAIN;
+ else
+ return (mon_attack_def::attk(0, AT_NONE));
+ }
+
// Slime creature attacks are multiplied by the number merged.
if (mon->type == MONS_SLIME_CREATURE && mon->number > 1)
attk.damage *= mon->number;
diff --git a/crawl-ref/source/mon-util.h b/crawl-ref/source/mon-util.h
index e1e5491c94..a79260d378 100644
--- a/crawl-ref/source/mon-util.h
+++ b/crawl-ref/source/mon-util.h
@@ -85,7 +85,8 @@ enum mon_attack_flavour
AF_NAPALM,
AF_CHAOS,
AF_STEAL,
- AF_STEAL_FOOD
+ AF_STEAL_FOOD,
+ AF_WEAP_ONLY // AF_PLAIN if wielding a weapon, nothing if not
};
// Non-spell "summoning" types to give to monsters::mark_summoned(), or
diff --git a/crawl-ref/source/monster.cc b/crawl-ref/source/monster.cc
index 75667278e8..19872b3b9a 100644
--- a/crawl-ref/source/monster.cc
+++ b/crawl-ref/source/monster.cc
@@ -370,6 +370,7 @@ int monsters::body_weight() const
case MONS_QUICKSILVER_DRAGON:
case MONS_SILVER_STATUE:
+ case MONS_STATUE:
weight *= 4;
break;
@@ -1932,7 +1933,7 @@ void monsters::wield_melee_weapon(int near)
// Switch to the alternate weapon if it's not a ranged weapon, too,
// or switch away from our main weapon if it's a ranged weapon.
- if (alt && !is_range_weapon(*alt) || weap && !alt)
+ if (alt && !is_range_weapon(*alt) || weap && !alt && type != MONS_STATUE)
swap_weapons(near);
}
}
diff --git a/crawl-ref/source/rltiles/dc-mon.txt b/crawl-ref/source/rltiles/dc-mon.txt
index caaf32978f..3da868aa54 100644
--- a/crawl-ref/source/rltiles/dc-mon.txt
+++ b/crawl-ref/source/rltiles/dc-mon.txt
@@ -452,6 +452,7 @@ ogre_mage MONS_OGRE_MAGE
## Plants ('P')
plant MONS_PLANT
+plant_crypt MONS_WITHERED_PLANT
oklob_plant MONS_OKLOB_PLANT
## Trolls ('T')
diff --git a/crawl-ref/source/rltiles/dc-mon/plant_crypt.png b/crawl-ref/source/rltiles/dc-mon/plant_crypt.png
new file mode 100644
index 0000000000..f17a501d4f
--- /dev/null
+++ b/crawl-ref/source/rltiles/dc-mon/plant_crypt.png
Binary files differ
diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc
index 1c25a5ee72..480730e6f9 100644
--- a/crawl-ref/source/spells3.cc
+++ b/crawl-ref/source/spells3.cc
@@ -1447,7 +1447,7 @@ bool _cell_vetoes_teleport (const coord_def cell, bool check_monsters = true)
}
}
-void _handle_teleport_update (bool large_change, bool check_ring_TC,
+void _handle_teleport_update (bool large_change, bool check_ring_TC,
const coord_def old_pos)
{
if (large_change)
@@ -1566,9 +1566,13 @@ static bool _teleport_player(bool allow_control, bool new_abyss_area, bool wizar
if (pos == you.pos() || pos == coord_def(-1,-1))
{
if (!wizard_tele)
+ {
if (!yesno("Are you sure you want to cancel this teleport?",
true, 'n'))
+ {
continue;
+ }
+ }
you.turn_is_over = false;
return (false);
}
@@ -1582,7 +1586,6 @@ static bool _teleport_player(bool allow_control, bool new_abyss_area, bool wizar
more();
continue;
}
-
break;
}
@@ -1598,8 +1601,8 @@ static bool _teleport_player(bool allow_control, bool new_abyss_area, bool wizar
pos.y += random2(3) - 1;
}
#if DEBUG_DIAGNOSTICS
- mprf(MSGCH_DIAGNOSTICS,
- "Scattered target square (%d, %d)", pos.x, pos.y);
+ mprf(MSGCH_DIAGNOSTICS,
+ "Scattered target square (%d, %d)", pos.x, pos.y);
#endif
}
@@ -1729,7 +1732,8 @@ bool you_teleport_to (const coord_def where_to, bool move_monsters)
monsters *mons = monster_at(where);
mons->teleport(true);
}
- else {
+ else
+ {
for (adjacent_iterator ai(where); ai; ++ai)
{
if (!_cell_vetoes_teleport(*ai))
@@ -1739,7 +1743,7 @@ bool you_teleport_to (const coord_def where_to, bool move_monsters)
}
else
{
- if (monster_at(*ai) && move_monsters
+ if (monster_at(*ai) && move_monsters
&& !_cell_vetoes_teleport(*ai, false))
{
monsters *mons = monster_at(*ai);
@@ -1769,7 +1773,7 @@ bool you_teleport_to (const coord_def where_to, bool move_monsters)
void you_teleport_now(bool allow_control, bool new_abyss_area, bool wizard_tele)
{
- const bool randtele = _teleport_player(allow_control, new_abyss_area,
+ const bool randtele = _teleport_player(allow_control, new_abyss_area,
wizard_tele);
// Xom is amused by uncontrolled teleports that land you in a
diff --git a/crawl-ref/source/spells4.cc b/crawl-ref/source/spells4.cc
index 5147acc2ea..1ecaa4bd06 100644
--- a/crawl-ref/source/spells4.cc
+++ b/crawl-ref/source/spells4.cc
@@ -121,6 +121,7 @@ static int _shatter_monsters(coord_def where, int pow, int, actor *)
case MONS_IRON_GOLEM:
case MONS_CRYSTAL_GOLEM:
case MONS_ORANGE_STATUE:
+ case MONS_STATUE:
case MONS_EARTH_ELEMENTAL:
case MONS_GARGOYLE:
case MONS_SKELETAL_DRAGON:
@@ -1391,6 +1392,7 @@ bool cast_fragmentation(int pow, const dist& spd)
case MONS_STONE_GOLEM:
case MONS_EARTH_ELEMENTAL:
case MONS_GARGOYLE:
+ case MONS_STATUE:
explode = true;
beam.ex_size = 2;
beam.name = "blast of rock fragments";
diff --git a/crawl-ref/source/teleport.cc b/crawl-ref/source/teleport.cc
index c3b553552f..375c9f96bf 100644
--- a/crawl-ref/source/teleport.cc
+++ b/crawl-ref/source/teleport.cc
@@ -269,9 +269,11 @@ bool random_near_space(const coord_def& origin, coord_def& target,
int walls_between = 0;
if (!crawl_state.arena)
+ {
walls_between = num_feats_between(target, you.pos(),
DNGN_CLEAR_ROCK_WALL,
DNGN_CLEAR_PERMAROCK_WALL);
+ }
if (walls_between >= min_walls_between)
return (true);
@@ -279,5 +281,3 @@ bool random_near_space(const coord_def& origin, coord_def& target,
return (false);
}
-
-
diff --git a/crawl-ref/source/tilepick.cc b/crawl-ref/source/tilepick.cc
index f7f8c104c2..4af9a4e880 100644
--- a/crawl-ref/source/tilepick.cc
+++ b/crawl-ref/source/tilepick.cc
@@ -126,6 +126,9 @@ int tileidx_monster_base(const monsters *mon, bool detected)
if (detected)
type = mons_detected_base(mon->type);
+ if (mon->props.exists("monster_tile"))
+ return int(mon->props["monster_tile"].get_short());
+
switch (type)
{
// program bug
diff --git a/crawl-ref/source/tilesdl.cc b/crawl-ref/source/tilesdl.cc
index 40e8702485..83ce8e8724 100644
--- a/crawl-ref/source/tilesdl.cc
+++ b/crawl-ref/source/tilesdl.cc
@@ -1250,26 +1250,25 @@ int TilesFramework::get_number_of_cols()
}
}
-void TilesFramework::cgotoxy(int x, int y, int region)
+void TilesFramework::cgotoxy(int x, int y, GotoRegion region)
{
- if (region == GOTO_LAST)
- {
- // nothing
- }
- else if (region == GOTO_CRT)
+ switch (region)
{
+ case GOTO_CRT:
m_active_layer = LAYER_CRT;
TextRegion::text_mode = m_region_crt;
- }
- else if (region == GOTO_MSG)
- {
+ break;
+ case GOTO_MSG:
m_active_layer = LAYER_NORMAL;
TextRegion::text_mode = m_region_msg;
- }
- else if (region == GOTO_STAT)
- {
+ break;
+ case GOTO_STAT:
m_active_layer = LAYER_NORMAL;
TextRegion::text_mode = m_region_stat;
+ break;
+ default:
+ DEBUGSTR("invalid cgotoxy region in tiles: %d", region);
+ break;
}
TextRegion::cgotoxy(x, y);
diff --git a/crawl-ref/source/tilesdl.h b/crawl-ref/source/tilesdl.h
index 6693659078..d0faa256a9 100644
--- a/crawl-ref/source/tilesdl.h
+++ b/crawl-ref/source/tilesdl.h
@@ -95,7 +95,7 @@ public:
void message_out(int *which_line, int colour, const char *s, int firstcol);
- void cgotoxy(int x, int y, int region = GOTO_CRT);
+ void cgotoxy(int x, int y, GotoRegion region = GOTO_CRT);
int get_number_of_lines();
int get_number_of_cols();
void clear_message_window();