summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-09 20:56:52 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-09 20:56:52 +0000
commit83749c5d2326aa46dd6840866353710d95a8baca (patch)
tree6e7e672150fbb5c1f2a7dd7247392f1425d7618d /crawl-ref/source
parenteff8f68d9b45112f8d68711ebb8e6ab8f3d140f3 (diff)
downloadcrawl-ref-83749c5d2326aa46dd6840866353710d95a8baca.tar.gz
crawl-ref-83749c5d2326aa46dd6840866353710d95a8baca.zip
Fix 2014303: Vampire hunger properties
Fix 2014275: Sif Muna giving manuals Fix 2013914: Draconians merging incorrectly Also, at the start of a tutorial game change all secret doors within a radius of 10 into closed doors, to avoid players encountering a dead-end really close to the entry. (And yes, I've had that happen.) Change display of forbidden choices in the character selection menus. It should now be clearer what's going on. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6463 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/abyss.cc1
-rw-r--r--crawl-ref/source/acr.cc4
-rw-r--r--crawl-ref/source/effects.cc2
-rw-r--r--crawl-ref/source/files.cc10
-rw-r--r--crawl-ref/source/mutation.cc8
-rw-r--r--crawl-ref/source/newgame.cc57
-rw-r--r--crawl-ref/source/output.cc23
-rw-r--r--crawl-ref/source/player.cc4
-rw-r--r--crawl-ref/source/randart.cc6
-rw-r--r--crawl-ref/source/stuff.cc2
-rw-r--r--crawl-ref/source/tutorial.cc15
-rw-r--r--crawl-ref/source/tutorial.h1
12 files changed, 84 insertions, 49 deletions
diff --git a/crawl-ref/source/abyss.cc b/crawl-ref/source/abyss.cc
index 2ded18e8a7..14440d8d0a 100644
--- a/crawl-ref/source/abyss.cc
+++ b/crawl-ref/source/abyss.cc
@@ -525,7 +525,6 @@ void area_shift(void)
}
}
-
for (unsigned int i = 0; i < MAX_CLOUDS; i++)
{
if (env.cloud[i].type == CLOUD_NONE)
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc
index 92f6ba80ef..437ca0d192 100644
--- a/crawl-ref/source/acr.cc
+++ b/crawl-ref/source/acr.cc
@@ -4107,6 +4107,10 @@ static bool _initialise(void)
// For a new game, wipe out monsters in LOS.
zap_los_monsters();
+
+ // For a newly started tutorial, turn secret doors into normal ones.
+ if (Options.tutorial_left)
+ tutorial_zap_secret_doors();
}
#ifdef USE_TILE
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index 123b2131c3..86ac9c40d9 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -1504,8 +1504,6 @@ bool acquirement(object_class_type class_wanted, int agent,
for (int item_tries = 0; item_tries < 40; item_tries++)
{
int type_wanted = _find_acquirement_subtype(class_wanted, quant);
- if (class_wanted == OBJ_BOOKS)
- type_wanted = BOOK_MANUAL;
// Clobber class_wanted for vampires.
if (you.species == SP_VAMPIRE && class_wanted == OBJ_FOOD)
diff --git a/crawl-ref/source/files.cc b/crawl-ref/source/files.cc
index f00a8cf58a..4e9a019817 100644
--- a/crawl-ref/source/files.cc
+++ b/crawl-ref/source/files.cc
@@ -1367,7 +1367,7 @@ void save_game(bool leave_game, const char *farewellmsg)
/* lua */
std::string luaFile = get_savedir_filename( you.your_name, "", "lua" );
clua.save(luaFile.c_str());
- // note that luaFile may not exist
+ // Note that luaFile may not exist.
DO_CHMOD_PRIVATE(luaFile.c_str());
#endif
@@ -1405,7 +1405,6 @@ void save_game(bool leave_game, const char *farewellmsg)
}
/* tutorial */
-
std::string tutorFile = get_savedir_filename(you.your_name, "", "tut");
FILE *tutorf = fopen(tutorFile.c_str(), "wb");
if (tutorf)
@@ -1503,7 +1502,7 @@ void _load_ghost(void)
ghosts.clear();
_restore_ghost_version(gfile, majorVersion, minorVersion);
- // sanity check - EOF
+ // Sanity check - EOF.
if (!feof(gfile))
{
fclose(gfile);
@@ -1521,10 +1520,10 @@ void _load_ghost(void)
mpr( "Loaded ghost.", MSGCH_DIAGNOSTICS );
#endif
- // remove bones file - ghosts are hardly permanent.
+ // Remove bones file - ghosts are hardly permanent.
unlink(cha_fil.c_str());
- // translate ghost to monster and place.
+ // Translate ghost to monster and place.
for (int imn = 0; imn < MAX_MONSTERS - 10 && !ghosts.empty(); imn++)
{
if (menv[imn].type != -1)
@@ -1601,7 +1600,6 @@ void restore_game(void)
}
/* tutorial */
-
std::string tutorFile = get_savedir_filename(you.your_name, "", "tut");
FILE *tutorf = fopen(tutorFile.c_str(), "rb");
if (tutorf)
diff --git a/crawl-ref/source/mutation.cc b/crawl-ref/source/mutation.cc
index ff05e986dd..7734e09b4c 100644
--- a/crawl-ref/source/mutation.cc
+++ b/crawl-ref/source/mutation.cc
@@ -1459,7 +1459,7 @@ static void _display_vampire_attributes()
{"Spell hunger ", "full ", "full ", "full ", "halved ", "none ", "none "},
- {EOL EOL "<w>Resistances</w>" EOL
+ {EOL "<w>Resistances</w>" EOL
"Poison resistance ", " ", " ", " ", " + ", " + ", " + "},
{"Cold resistance ", " ", " ", " ", " + ", " + ", " ++ "},
@@ -1468,7 +1468,7 @@ static void _display_vampire_attributes()
{"Torment resistance ", " ", " ", " ", " ", " ", " + "},
- {EOL EOL "<w>Other effects</w>" EOL
+ {EOL "<w>Other effects</w>" EOL
"Mutation chance ", "always ", "often ", "sometimes ", "never ", "never ", "never "},
{"Non-physical " EOL
@@ -1519,9 +1519,7 @@ static void _display_vampire_attributes()
result += EOL;
}
- result += EOL EOL;
- result += EOL EOL;
- result += EOL EOL;
+ result += EOL;
result += "Press '<w>!</w>' to toggle between mutations and properties depending on your " EOL
"hunger status." EOL;
diff --git a/crawl-ref/source/newgame.cc b/crawl-ref/source/newgame.cc
index bf08614904..68347be2a0 100644
--- a/crawl-ref/source/newgame.cc
+++ b/crawl-ref/source/newgame.cc
@@ -2307,18 +2307,18 @@ static bool _choose_weapon()
{
ASSERT(startwep[i] != WPN_UNKNOWN);
+ if (startwep_restrictions[i] == CC_BANNED)
+ continue;
+
if (startwep_restrictions[i] == CC_UNRESTRICTED)
textcolor(LIGHTGREY);
else
textcolor(DARKGREY);
- char letter = (startwep_restrictions[i] == CC_BANNED)
- ? ' ' : ('a' + i);
-
- if (startwep[i] == WPN_UNARMED)
- cprintf("%c - claws" EOL, letter);
- else
- cprintf("%c - %s" EOL, letter, weapon_base_name(startwep[i]));
+ const char letter = 'a' + i;
+ cprintf("%c - %s" EOL, letter,
+ startwep[i] == WPN_UNARMED ? "claws"
+ : weapon_base_name(startwep[i]));
if (Options.prev_weapon == startwep[i])
prevmatch = true;
@@ -2332,7 +2332,7 @@ static bool _choose_weapon()
"Bksp - Back to species and class selection; "
"X - Quit" EOL);
- if (Options.prev_weapon != WPN_UNKNOWN)
+ if (Options.prev_weapon == WPN_RANDOM || prevmatch)
{
cprintf("; Enter - %s",
Options.prev_weapon == WPN_RANDOM ? "Random" :
@@ -3577,20 +3577,21 @@ spec_query:
else
textcolor(DARKGREY);
- // Show banned races but omit letter
- char sletter;
+ // Show banned races as "unavailable".
if (you.char_class != JOB_UNKNOWN
&& _class_allowed(si, you.char_class) == CC_BANNED)
{
- sletter = ' ';
+ cprintf(" %s N/A", species_name(si, 1).c_str());
}
else
- sletter = index_to_letter(i);
+ {
+ char sletter = index_to_letter(i);
- if (sletter == Options.prev_race)
- prevraceok = true;
+ if (sletter == Options.prev_race)
+ prevraceok = true;
- cprintf( "%c - %s", sletter, species_name(si,1).c_str() );
+ cprintf("%c - %s", sletter, species_name(si, 1).c_str());
+ }
if (j % 2)
cprintf(EOL);
@@ -3824,17 +3825,20 @@ job_query:
else
textcolor(DARKGREY);
- // Show banned classes but omit letter.
- char letter;
+ // Show banned races as "unavailable".
if (_class_allowed(you.species, which_job) == CC_BANNED)
- letter = ' ';
+ {
+ cprintf(" %s N/A", get_class_name(which_job));
+ }
else
- letter = index_to_letter(i);
+ {
+ char sletter = index_to_letter(i);
- if (letter == Options.prev_cls)
- prevclassok = true;
+ if (sletter == Options.prev_cls)
+ prevclassok = true;
- cprintf( "%c - %s", letter, get_class_name(which_job) );
+ cprintf("%c - %s", sletter, get_class_name(which_job));
+ }
if (j % 2)
cprintf(EOL);
@@ -4204,10 +4208,11 @@ bool _give_items_skills()
cprintf("a - Zin (for traditional priests)" EOL);
cprintf("b - Yredelemnul (for priests of death)" EOL);
- const bool valid = _is_valid_religion(GOD_BEOGH);
- textcolor( valid ? LIGHTGREY : DARKGREY );
- cprintf("%s - Beogh (priest of Orcs)" EOL,
- valid ? "c" : " ");
+ if (_is_valid_religion(GOD_BEOGH))
+ {
+ textcolor(LIGHTGREY);
+ cprintf("c - Beogh (priest of Orcs)" EOL);
+ }
textcolor( BROWN );
cprintf(EOL "* - Random choice; "
diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc
index c5ff49069e..c0a57cabd7 100644
--- a/crawl-ref/source/output.cc
+++ b/crawl-ref/source/output.cc
@@ -1209,6 +1209,16 @@ monster_pane_info::less_than(const monster_pane_info& m1,
else if (m1.m_attitude > m2.m_attitude)
return (false);
+ // Force plain but different coloured draconians to be treated like the
+ // same sub-type.
+ if (!zombified && m1.m_mon->type >= MONS_DRACONIAN
+ && m1.m_mon->type <= MONS_PALE_DRACONIAN
+ && m2.m_mon->type >= MONS_DRACONIAN
+ && m2.m_mon->type <= MONS_PALE_DRACONIAN)
+ {
+ return (false);
+ }
+
// By descending difficulty
if (m1.m_difficulty > m2.m_difficulty)
return (true);
@@ -1234,8 +1244,8 @@ monster_pane_info::less_than(const monster_pane_info& m1,
if (zombified)
{
- // Because of the type checks above, if one of the two is zombified, so is
- // the other, and of the same type.
+ // Because of the type checks above, if one of the two is zombified, so
+ // is the other, and of the same type.
if (mons_is_zombified(m1.m_mon)
&& m1.m_mon->base_monster < m2.m_mon->base_monster)
{
@@ -1282,16 +1292,23 @@ void monster_pane_info::to_string( int count, std::string& desc,
}
else
{
- // Don't differentiate between dancing weapons or mimics
+ // Don't differentiate between dancing weapons, mimics, or draconians
// of different types.
if (m_fullname
&& m_mon->type != MONS_DANCING_WEAPON
+ && mons_genus(m_mon->type) != MONS_DRACONIAN
&& !mons_is_mimic(m_mon->type)
&& m_mon->mname.empty())
{
out << count << " "
<< pluralise(m_mon->name(DESC_PLAIN));
}
+ else if (m_mon->type >= MONS_DRACONIAN
+ && m_mon->type <= MONS_PALE_DRACONIAN)
+ {
+ out << count << " "
+ << pluralise(mons_type_name(MONS_DRACONIAN, DESC_PLAIN));
+ }
else
{
out << count << " "
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index aa308bf8d5..cfa61aadd7 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -2899,8 +2899,8 @@ void gain_exp( unsigned int exp_gained, unsigned int* actual_gain,
level_change();
- // increase tutorial time-out now that it's actually
- // become useful for a longer time
+ // Increase tutorial time-out now that it's actually
+ // become useful for a longer time.
if (Options.tutorial_left && you.experience_level == 7)
tutorial_finished();
diff --git a/crawl-ref/source/randart.cc b/crawl-ref/source/randart.cc
index e0108b9d80..d676e93813 100644
--- a/crawl-ref/source/randart.cc
+++ b/crawl-ref/source/randart.cc
@@ -110,12 +110,12 @@ static bool _god_fits_artefact(const god_type which_god, const item_def &item)
break;
case GOD_SIF_MUNA:
- // no weapons for Sif Muna
+ case GOD_KIKUBAAQUDGHA:
+ case GOD_VEHUMET:
+ // The magic gods: no weapons, no preventing spellcasting.
if (item.base_type == OBJ_WEAPONS)
return (false);
- case GOD_KIKUBAAQUDGHA:
- case GOD_VEHUMET:
if (randart_wpn_property( item, RAP_PREVENT_SPELLCASTING ))
return (false);
break;
diff --git a/crawl-ref/source/stuff.cc b/crawl-ref/source/stuff.cc
index 2ab5cec604..3406decaa9 100644
--- a/crawl-ref/source/stuff.cc
+++ b/crawl-ref/source/stuff.cc
@@ -1589,7 +1589,7 @@ void zap_los_monsters()
int imon = mgrd[gx][gy];
- // at tutorial beginning disallow items in line of sight
+ // At tutorial beginning disallow items in line of sight.
if (Options.tutorial_events[TUT_SEEN_FIRST_OBJECT])
{
int item = igrd[gx][gy];
diff --git a/crawl-ref/source/tutorial.cc b/crawl-ref/source/tutorial.cc
index 1507ade82a..ece23849de 100644
--- a/crawl-ref/source/tutorial.cc
+++ b/crawl-ref/source/tutorial.cc
@@ -262,6 +262,21 @@ static job_type _get_tutorial_job(unsigned int type)
}
}
+// Converts all secret doors in a fixed radius around the player's starting
+// position into normal closed doors.
+void tutorial_zap_secret_doors()
+{
+ for (int x = you.x_pos - 10; x <= you.x_pos + 10; x++)
+ for (int y = you.y_pos - 10; y <= you.y_pos + 10; y++)
+ {
+ if (!in_bounds(x,y))
+ continue;
+
+ if (grd[x][y] == DNGN_SECRET_DOOR)
+ grd[x][y] = DNGN_CLOSED_DOOR;
+ }
+}
+
// Prints the tutorial welcome screen.
static formatted_string _tut_starting_info(unsigned int width)
{
diff --git a/crawl-ref/source/tutorial.h b/crawl-ref/source/tutorial.h
index 88ec4c22d8..2b8d4e2f8f 100644
--- a/crawl-ref/source/tutorial.h
+++ b/crawl-ref/source/tutorial.h
@@ -29,6 +29,7 @@ void init_tutorial_options(void);
bool pick_tutorial(void);
void print_tutorial_menu(unsigned int type);
+void tutorial_zap_secret_doors(void);
formatted_string tut_starting_info2();
void tut_starting_screen(void);