summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-09-21 20:03:28 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-09-21 20:03:28 +0000
commit1dee1ada624931648ac37a7a7f175f6c9a4a63a3 (patch)
tree1c9d7fa02f4d92e68086c0c8304f4fcca1621901 /crawl-ref
parentea2e13d9dc897bbe45a55d7a58e544f2ef44c970 (diff)
downloadcrawl-ref-1dee1ada624931648ac37a7a7f175f6c9a4a63a3.tar.gz
crawl-ref-1dee1ada624931648ac37a7a7f175f6c9a4a63a3.zip
Fix 2121686: buggy net handling when returning to a level
FR 2029644: Some small tutorial improvements. Switch off autopickup if you see a monster turn invisible. (BR 2085502) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6970 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/beam.cc19
-rw-r--r--crawl-ref/source/effects.cc4
-rw-r--r--crawl-ref/source/files.cc4
-rw-r--r--crawl-ref/source/mon-util.cc14
-rw-r--r--crawl-ref/source/monstuff.cc2
-rw-r--r--crawl-ref/source/mstuff2.cc1
-rw-r--r--crawl-ref/source/tutorial.cc44
7 files changed, 57 insertions, 31 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index 9a425efb87..136ccfd092 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -2597,14 +2597,21 @@ int mons_ench_f2(monsters *monster, bolt &pbolt)
player_monster_visible(monster) ? "for a moment."
: "and vanishes!" );
- // Don't swap weapons just because you can't see it anymore!
- you.attribute[ATTR_WEAPON_SWAP_INTERRUPTED] = 0;
-
- if (Options.tutorial_left)
+ if (!player_monster_visible(monster))
{
- learned_something_new(TUT_INVISIBLE_DANGER);
- if (!player_monster_visible(monster))
+ // Don't swap weapons just because you can't see it anymore!
+ you.attribute[ATTR_WEAPON_SWAP_INTERRUPTED] = 0;
+
+ // Also turn off autopickup.
+ Options.autopickup_on = false;
+ mpr("Deactivating autopickup; reactivate with Ctrl-A.",
+ MSGCH_WARN);
+
+ if (Options.tutorial_left)
+ {
+ learned_something_new(TUT_INVISIBLE_DANGER);
Options.tut_seen_invisible = you.num_turns;
+ }
}
}
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index 522c6f0742..70e5843bf0 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -2863,6 +2863,10 @@ void update_level(double elapsedTime)
false);
}
+ // Handle nets specially to remove the trapping property of the net.
+ if (mons_is_caught(mon))
+ mon->del_ench(ENCH_HELD, true);
+
_catchup_monster_moves(mon, turns);
if (turns >= 10 && mon->alive())
diff --git a/crawl-ref/source/files.cc b/crawl-ref/source/files.cc
index 710d4985d1..6b05ab4d86 100644
--- a/crawl-ref/source/files.cc
+++ b/crawl-ref/source/files.cc
@@ -1158,7 +1158,8 @@ bool load( dungeon_feature_type stair_taken, load_mode_type load_mode,
char minorVersion;
std::string reason;
- if (!_get_and_validate_version( levelFile, majorVersion, minorVersion, &reason ))
+ if (!_get_and_validate_version( levelFile, majorVersion, minorVersion,
+ &reason ))
{
end(-1, false, "\nLevel file is invalid. %s\n",
reason.c_str());
@@ -1265,6 +1266,7 @@ bool load( dungeon_feature_type stair_taken, load_mode_type load_mode,
#ifndef USE_TILE
viewwindow(true, false);
#endif
+ mpr("Call handle_monsters()", MSGCH_DIAGNOSTICS);
handle_monsters();
}
}
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index 3f2d8dbd81..b5c01206ba 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -5428,7 +5428,7 @@ static bool _prepare_del_ench(monsters* mon, const mon_enchant &me)
// Monster un-submerging while under player. Try to move to an
// adjacent square in which the monster could have been submerged
- // and have it unusbmerge from there.
+ // and have it unsubmerge from there.
coord_def target_square;
int okay_squares = 0;
@@ -5480,6 +5480,7 @@ static bool _prepare_del_ench(monsters* mon, const mon_enchant &me)
bool monsters::del_ench(enchant_type ench, bool quiet, bool effect)
{
+ mpr("in del_ench()", MSGCH_DIAGNOSTICS);
mon_enchant_list::iterator i = enchantments.find(ench);
if (i == enchantments.end())
return (false);
@@ -5652,7 +5653,6 @@ void monsters::remove_enchantment_effect(const mon_enchant &me, bool quiet)
int net = get_trapping_net(this->pos());
if (net != NON_ITEM)
remove_item_stationary(mitm[net]);
-
if (!quiet)
simple_monster_message(this, " breaks free.");
break;
@@ -6772,7 +6772,7 @@ bool monsters::should_drink_potion(potion_type ptype) const
return rc;
}
-// Return the ID status gained.
+// Return the ID status gained.
item_type_id_state_type monsters::drink_potion_effect(potion_type ptype)
{
simple_monster_message(this, " drinks a potion.");
@@ -6785,15 +6785,15 @@ item_type_id_state_type monsters::drink_potion_effect(potion_type ptype)
{
heal(5 + random2(7));
simple_monster_message(this, " is healed!");
-
+
const enchant_type cured_enchants[] = {
ENCH_POISON, ENCH_SICK, ENCH_CONFUSION, ENCH_ROT
};
-
+
// We can differentiate healing and heal wounds (and blood,
// for vampires) by seeing if any status ailments are cured.
for (unsigned int i = 0; i < ARRAYSZ(cured_enchants); ++i)
- if (del_ench(cured_enchants[i]))
+ if (del_ench(cured_enchants[i]))
ident = ID_KNOWN_TYPE;
}
break;
@@ -6839,7 +6839,7 @@ item_type_id_state_type monsters::drink_potion_effect(potion_type ptype)
default:
break;
}
-
+
return ident;
}
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index 3beb84676d..d062422cd9 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -4324,7 +4324,7 @@ static bool _handle_potion(monsters *monster, bolt & beem)
// Give ID if necessary.
if (was_visible && id != ID_UNKNOWN_TYPE)
set_ident_type(OBJ_POTIONS, ptype, id);
-
+
// Remove it from inventory.
if (dec_mitm_item_quantity(potion_idx, 1))
monster->inv[MSLOT_POTION] = NON_ITEM;
diff --git a/crawl-ref/source/mstuff2.cc b/crawl-ref/source/mstuff2.cc
index bba8acf260..5206e76278 100644
--- a/crawl-ref/source/mstuff2.cc
+++ b/crawl-ref/source/mstuff2.cc
@@ -2619,6 +2619,5 @@ void mons_clear_trapping_net(monsters *mon)
const int net = get_trapping_net(mon->pos());
if (net != NON_ITEM)
remove_item_stationary(mitm[net]);
-
mon->del_ench(ENCH_HELD, true);
}
diff --git a/crawl-ref/source/tutorial.cc b/crawl-ref/source/tutorial.cc
index 536d07fc53..8c9a99f57a 100644
--- a/crawl-ref/source/tutorial.cc
+++ b/crawl-ref/source/tutorial.cc
@@ -1961,8 +1961,9 @@ void learned_something_new(tutorial_event_type seen_what, coord_def gc)
#endif
"is a closed door. You can open it by walking into it. "
"Sometimes it is useful to close a door. Do so by pressing "
- "<w>C</w>, followed by the direction, or simply "
- "<w>Ctrl-Direction</w>.";
+ "<w>C</w> while standing next to it. If there are several "
+ "doors you will then be prompted for a direction. "
+ "Alternatively, you can also use <w>Ctrl-Direction</w>.";
#ifdef USE_TILE
text << "\nIn Tiles, the same can be achieved by clicking on an "
"adjacent door square.";
@@ -2695,21 +2696,34 @@ void learned_something_new(tutorial_event_type seen_what, coord_def gc)
break;
case TUT_SPELL_MISCAST:
- text << "You just miscast a spell. If the spell casting success "
- "chance is high (which can be checked by entering <w>z\?</w>) "
- "then a miscast merely means the spell is not working, along "
- "with a harmless side effect. However, for spells with a "
- "low success rate there's a chance of contaminating yourself "
- "with magical energy, plus a chance of an additional harmful "
- "side effect. Normally this isn't a problem, since magical "
- "contamination bleeds off over time, but if you're repeatedly "
- "contaminated in a short amount of time you'll mutate or "
- "suffer from other ill side effects.\n\n"
-
- "Note that a miscast spell will still consume the full amount "
+ {
+ text << "You just miscast a spell. ";
+
+ item_def *armour = you.slot_item(EQ_BODY_ARMOUR);
+ item_def *shield = you.slot_item(EQ_SHIELD);
+ if (armour && !is_light_armour(*armour) || shield)
+ {
+ text << "Wearing heavy body armour or using a shield, especially a "
+ "large one, can severely hamper your spellcasting "
+ "abilities. You can check the effect of this by comparing "
+ "the success rates on the <w>z\?</w> screen with and "
+ "without the item being worn.\n\n";
+ }
+
+ text << "If the spellcasting success chance is high (which can be "
+ "checked by entering <w>z\?</w>) then a miscast merely means "
+ "the spell is not working, along with a harmless side effect. "
+ "However, for spells with a low success rate there's a chance "
+ "of contaminating yourself with magical energy, plus a chance "
+ "of an additional harmful side effect. Normally this isn't a "
+ "problem, since magical contamination bleeds off over time, "
+ "but if you're repeatedly contaminated in a short amount of "
+ "time you'll mutate or suffer from other ill side effects.\n\n";
+
+ text << "Note that a miscast spell will still consume the full amount "
"of MP and nutrition that a successfully cast spell would.";
break;
-
+ }
case TUT_SPELL_HUNGER:
text << "The spell you just cast made you hungrier; you can see how "
"hungry spells make you by entering <w>z\?!</w>. The amount of "