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-28 11:26:54 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-28 11:26:54 +0000
commit30972f8855a581f440406e7bc5880f18a489efb4 (patch)
treed9f5f7e5e7d7e6cbffb6d579704b6cf61961b17b /crawl-ref/source
parent69d26de6e5bbfb0746e85fe5f620960578cd79bf (diff)
downloadcrawl-ref-30972f8855a581f440406e7bc5880f18a489efb4.tar.gz
crawl-ref-30972f8855a581f440406e7bc5880f18a489efb4.zip
Fix 2021696: allow_self_target = no even forbidding self-targetting for
area effect spells (now prompts) Fix 2028704: spell view toggle 'I' preventing forgetting spell slot 'I' Allow intelligent summoned monsters to equip themselves. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6703 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/acr.cc6
-rw-r--r--crawl-ref/source/command.cc6
-rw-r--r--crawl-ref/source/debug.cc6
-rw-r--r--crawl-ref/source/decks.cc3
-rw-r--r--crawl-ref/source/directn.cc17
-rw-r--r--crawl-ref/source/directn.h5
-rw-r--r--crawl-ref/source/item_use.cc2
-rw-r--r--crawl-ref/source/mon-util.cc4
-rw-r--r--crawl-ref/source/religion.cc26
-rw-r--r--crawl-ref/source/spells1.cc4
-rw-r--r--crawl-ref/source/spells3.cc4
-rw-r--r--crawl-ref/source/spl-cast.cc23
-rw-r--r--crawl-ref/source/spl-cast.h2
-rw-r--r--crawl-ref/source/spl-data.h2
-rw-r--r--crawl-ref/source/spl-util.cc6
-rw-r--r--crawl-ref/source/spl-util.h3
16 files changed, 70 insertions, 49 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc
index 74ce3aab57..4a49cbcbf5 100644
--- a/crawl-ref/source/acr.cc
+++ b/crawl-ref/source/acr.cc
@@ -1936,9 +1936,9 @@ void process_command( command_type cmd )
if (Options.tutorial_left
&& !god_gives_permanent_followers(you.religion))
{
- mpr("Only intelligent, permanent allies may equip themselves, "
- "which excludes all types of zombies as well as enslaved and "
- "summoned monsters.", MSGCH_TUTORIAL);
+ mpr("Only intelligent allies may equip themselves, which excludes "
+ "all types of zombies as well as hostile monsters you "
+ "enslaved.", MSGCH_TUTORIAL);
}
mpr("Change to (d)efault, (n)othing, (f)riend-dropped, or (a)ll? ",
diff --git a/crawl-ref/source/command.cc b/crawl-ref/source/command.cc
index 355a9d91e7..c3bb854955 100644
--- a/crawl-ref/source/command.cc
+++ b/crawl-ref/source/command.cc
@@ -377,12 +377,12 @@ static void _adjust_spells(void)
int keyin = 0;
if (Options.auto_list)
- keyin = list_spells();
+ keyin = list_spells(false);
else
{
keyin = get_ch();
if (keyin == '?' || keyin == '*')
- keyin = list_spells();
+ keyin = list_spells(false);
}
if (!isalpha(keyin))
@@ -393,7 +393,7 @@ static void _adjust_spells(void)
const int input_1 = keyin;
const int index_1 = letter_to_index( input_1 );
- spell_type spell = get_spell_by_letter( input_1 );
+ spell_type spell = get_spell_by_letter( input_1 );
if (spell == SPELL_NO_SPELL)
{
diff --git a/crawl-ref/source/debug.cc b/crawl-ref/source/debug.cc
index 8773d08211..bc7b14a405 100644
--- a/crawl-ref/source/debug.cc
+++ b/crawl-ref/source/debug.cc
@@ -7,10 +7,10 @@
*
* Change History (most recent first):
*
- * <4> 14/12/99 LRH Added cast_spec_spell_name()
+ * <4> 14/12/99 LRH Added cast_spec_spell_name()
* <3> 5/06/99 JDJ Added TRACE.
* <2> -/--/-- JDJ Added a bunch od debugging macros.
- * Old code is now #if WIZARD.
+ * Old code is now #if WIZARD.
* <1> -/--/-- LRH Created
*/
@@ -4140,7 +4140,7 @@ static void _move_player(int x, int y)
static void _move_monster(int x, int y, int mid1)
{
dist moves;
- direction(moves, DIR_NONE, TARG_ANY, -1, true, false, true,
+ direction(moves, DIR_NONE, TARG_ANY, -1, true, false, true, true,
"Move monster to where?");
if (!moves.isValid || !in_bounds(moves.tx, moves.ty))
diff --git a/crawl-ref/source/decks.cc b/crawl-ref/source/decks.cc
index 62d558fdd4..6f6983c276 100644
--- a/crawl-ref/source/decks.cc
+++ b/crawl-ref/source/decks.cc
@@ -1671,7 +1671,8 @@ static bool _damaging_card(card_type card, int power, deck_rarity_type rarity)
snprintf(info, INFO_SIZE, "You have drawn %s. Aim where? ",
card_name(card));
- if (spell_direction(target, beam, DIR_NONE, TARG_ENEMY, true, true, info)
+ if (spell_direction(target, beam, DIR_NONE, TARG_ENEMY, true, true, false,
+ info)
&& player_tracer(ZAP_DEBUGGING_RAY, power/4, beam))
{
zapping(ztype, random2(power/4), beam);
diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc
index 287045cdeb..8d62b42c81 100644
--- a/crawl-ref/source/directn.cc
+++ b/crawl-ref/source/directn.cc
@@ -519,7 +519,8 @@ static int _mlist_letter_to_index(char idx)
void direction(dist& moves, targeting_type restricts,
targ_mode_type mode, int range, bool just_looking,
- bool needs_path, bool may_target_monster, const char *prompt,
+ bool needs_path, bool may_target_monster,
+ bool may_target_self, const char *prompt,
targeting_behaviour *beh, bool cancel_at_self)
{
if (!beh)
@@ -1112,13 +1113,19 @@ void direction(dist& moves, targeting_type restricts,
&& mode == TARG_ENEMY
&& (cancel_at_self
|| Options.allow_self_target == CONFIRM_CANCEL
- || Options.allow_self_target == CONFIRM_PROMPT
- && !yesno("Really target yourself?", false, 'n')))
+ && !may_target_self
+ || (Options.allow_self_target == CONFIRM_PROMPT
+ || Options.allow_self_target == CONFIRM_CANCEL
+ && may_target_self)
+ && !yesno("Really target yourself?", false, 'n')))
{
if (cancel_at_self)
mpr("Sorry, you can't target yourself.");
- else if (Options.allow_self_target == CONFIRM_CANCEL)
+ else if (Options.allow_self_target == CONFIRM_CANCEL
+ && !may_target_self)
+ {
mpr("That would be overly suicidal.", MSGCH_EXAMINE_FILTER);
+ }
show_prompt = true;
}
@@ -1243,7 +1250,7 @@ std::string get_terse_square_desc(const coord_def &gc)
}
else if (!see_grid(gc))
{
- if (is_terrain_seen(gc))
+ if (is_terrain_seen(gc))
{
desc = feature_description(gc, false, DESC_PLAIN, false);
if (!see_grid(gc))
diff --git a/crawl-ref/source/directn.h b/crawl-ref/source/directn.h
index 029077bf3c..b4f1811161 100644
--- a/crawl-ref/source/directn.h
+++ b/crawl-ref/source/directn.h
@@ -150,8 +150,9 @@ struct dist
void direction( dist &moves, targeting_type restricts = DIR_NONE,
targ_mode_type mode = TARG_ANY, int range = -1,
bool just_looking = false, bool needs_path = true,
- bool may_target_monster = true, const char *prompt = NULL,
- targeting_behaviour *mod = NULL, bool cancel_at_self = false );
+ bool may_target_monster = true, bool may_target_self = false,
+ const char *prompt = NULL, targeting_behaviour *mod = NULL,
+ bool cancel_at_self = false );
bool in_los_bounds(const coord_def& p);
bool in_viewport_bounds(int x, int y);
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index ec6c9938fa..ee78a30170 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -1456,7 +1456,7 @@ static bool _fire_choose_item_and_target(int& slot, dist& target,
// XXX: This stuff should be done by direction()!
message_current_target();
- direction( target, DIR_NONE, TARG_ENEMY, -1, false, !teleport, true,
+ direction( target, DIR_NONE, TARG_ENEMY, -1, false, !teleport, true, false,
NULL, &beh );
if (beh.m_slot == -1)
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index 372204f9c1..2ee0dbe997 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -4164,10 +4164,6 @@ bool monsters::pickup_item(item_def &item, int near, bool force)
if (mons_friendly(this))
{
- // No pickup for abjurable (summoned) allies - not worth the hassle.
- if (has_ench(ENCH_ABJ))
- return (false);
-
// Never pick up gold or misc. items, it'd only annoy the player.
if (itype == OBJ_MISCELLANY || itype == OBJ_GOLD)
return (false);
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index 804ef912d2..08ecfd5d8c 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -911,19 +911,19 @@ static bool _need_missile_gift()
static void _get_pure_deck_weights(int weights[])
{
- weights[0] = you.sacrifice_value[OBJ_ARMOUR] + 1;
- weights[1] = you.sacrifice_value[OBJ_WEAPONS]
- + you.sacrifice_value[OBJ_STAVES]
- + you.sacrifice_value[OBJ_MISSILES] + 1;
- weights[2] = you.sacrifice_value[OBJ_MISCELLANY]
- + you.sacrifice_value[OBJ_JEWELLERY]
- + you.sacrifice_value[OBJ_BOOKS]
- + you.sacrifice_value[OBJ_GOLD]; // only via acquirement
- weights[3] = you.sacrifice_value[OBJ_CORPSES] / 2;
- weights[4] = you.sacrifice_value[OBJ_POTIONS]
- + you.sacrifice_value[OBJ_SCROLLS]
- + you.sacrifice_value[OBJ_WANDS]
- + you.sacrifice_value[OBJ_FOOD];
+ weights[0] = you.sacrifice_value[OBJ_ARMOUR] + 1;
+ weights[1] = you.sacrifice_value[OBJ_WEAPONS]
+ + you.sacrifice_value[OBJ_STAVES]
+ + you.sacrifice_value[OBJ_MISSILES] + 1;
+ weights[2] = you.sacrifice_value[OBJ_MISCELLANY]
+ + you.sacrifice_value[OBJ_JEWELLERY]
+ + you.sacrifice_value[OBJ_BOOKS]
+ + you.sacrifice_value[OBJ_GOLD]; // only via acquirement
+ weights[3] = you.sacrifice_value[OBJ_CORPSES] / 2;
+ weights[4] = you.sacrifice_value[OBJ_POTIONS]
+ + you.sacrifice_value[OBJ_SCROLLS]
+ + you.sacrifice_value[OBJ_WANDS]
+ + you.sacrifice_value[OBJ_FOOD];
}
static void _update_sacrifice_weights(int which)
diff --git a/crawl-ref/source/spells1.cc b/crawl-ref/source/spells1.cc
index cf793e20d3..e7d1d3715b 100644
--- a/crawl-ref/source/spells1.cc
+++ b/crawl-ref/source/spells1.cc
@@ -104,7 +104,7 @@ int blink(int pow, bool high_level_controlled_blink, bool wizard_blink)
while (true)
{
direction(beam, DIR_TARGET, TARG_ANY, -1, false, false, false,
- "Blink to where?");
+ false, "Blink to where?");
if (!beam.isValid || coord_def(beam.target()) == you.pos())
{
@@ -687,7 +687,7 @@ static int _healing_spell(int healed, int target_x = -1, int target_y = -1)
spd.isValid = spell_direction(spd, beam, DIR_TARGET,
you.religion == GOD_ELYVILON ?
TARG_ANY : TARG_FRIEND,
- true, true, "Heal whom?");
+ true, true, true, "Heal whom?");
}
else
{
diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc
index d973fda8c3..333b66f08f 100644
--- a/crawl-ref/source/spells3.cc
+++ b/crawl-ref/source/spells3.cc
@@ -78,7 +78,7 @@ bool cast_selective_amnesia(bool force)
if (keyin == '?' || keyin == '*')
{
// this reassignment is "key" {dlb}
- keyin = (unsigned char) list_spells();
+ keyin = (unsigned char) list_spells(false);
redraw_screen();
}
@@ -1075,7 +1075,7 @@ bool cast_twisted_resurrection(int pow, god_type god)
{
mpr("There are no corpses here!");
return (false);
- }
+ }
#if DEBUG_DIAGNOSTICS
mprf(MSGCH_DIAGNOSTICS, "Mass for abomination: %d", total_mass);
diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc
index 33d31faeb5..dc0609259e 100644
--- a/crawl-ref/source/spl-cast.cc
+++ b/crawl-ref/source/spl-cast.cc
@@ -191,7 +191,7 @@ static std::string _spell_extra_description(spell_type spell)
return desc.str();
}
-int list_spells()
+int list_spells(bool toggle_with_I)
{
ToggleableMenu spell_menu(MF_SINGLESELECT | MF_ANYPRINTABLE |
MF_ALWAYS_SHOW_MORE | MF_ALLOW_FORMATTING);
@@ -203,12 +203,22 @@ int list_spells()
" Hunger Level",
MEL_TITLE));
spell_menu.set_highlighter(NULL);
- spell_menu.set_more(formatted_string("Press '!' or 'I' to toggle spell view."));
spell_menu.add_toggle_key('!');
- spell_menu.add_toggle_key('I');
+ if (toggle_with_I)
+ {
+ spell_menu.set_more(
+ formatted_string("Press '!' or 'I' to toggle spell view."));
+ spell_menu.add_toggle_key('I');
+ }
+ else
+ {
+ spell_menu.set_more(
+ formatted_string("Press '!' to toggle spell view."));
+ }
+
spell_menu.set_tag("spell");
- for ( int i = 0; i < 52; ++i )
+ for (int i = 0; i < 52; ++i)
{
const char letter = index_to_letter(i);
const spell_type spell = get_spell_by_letter(letter);
@@ -1037,7 +1047,10 @@ spret_type your_spells(spell_type spell, int powc, bool allow_fail)
const bool needs_path = (!testbits(flags, SPFLAG_GRID)
&& !testbits(flags, SPFLAG_TARGET));
- if (!spell_direction(spd, beam, dir, targ, needs_path, true, prompt,
+ const bool dont_cancel_me = testbits(flags, SPFLAG_AREA);
+
+ if (!spell_direction(spd, beam, dir, targ, needs_path, true,
+ dont_cancel_me, prompt,
testbits(flags, SPFLAG_NOT_SELF)))
{
return (SPRET_ABORT);
diff --git a/crawl-ref/source/spl-cast.h b/crawl-ref/source/spl-cast.h
index 5c891a0a38..a2fbf69c53 100644
--- a/crawl-ref/source/spl-cast.h
+++ b/crawl-ref/source/spl-cast.h
@@ -41,7 +41,7 @@ enum spret_type
SPRET_SUCCESS
};
-int list_spells();
+int list_spells(bool toggle_with_I = true);
int spell_fail( spell_type spell );
int calc_spell_power(spell_type spell, bool apply_intel,
bool fail_rate_chk = false );
diff --git a/crawl-ref/source/spl-data.h b/crawl-ref/source/spl-data.h
index b081d116ac..300b8b123c 100644
--- a/crawl-ref/source/spl-data.h
+++ b/crawl-ref/source/spl-data.h
@@ -2060,7 +2060,7 @@
{
SPELL_EVAPORATE, "Evaporate",
SPTYP_FIRE | SPTYP_TRANSMIGRATION,
- SPFLAG_DIR_OR_TARGET,
+ SPFLAG_DIR_OR_TARGET | SPFLAG_AREA,
2, // XXX: level 2 or 3, what should it be now? -- bwr
200,
NULL,
diff --git a/crawl-ref/source/spl-util.cc b/crawl-ref/source/spl-util.cc
index 8e4d320447..73d0b16f84 100644
--- a/crawl-ref/source/spl-util.cc
+++ b/crawl-ref/source/spl-util.cc
@@ -739,13 +739,15 @@ void apply_area_cloud( int (*func) (int, int, int, int, cloud_type,
bool spell_direction( dist &spelld, bolt &pbolt,
targeting_type restrict, targ_mode_type mode,
bool needs_path, bool may_target_monster,
- const char *prompt, bool cancel_at_self )
+ bool may_target_self, const char *prompt,
+ bool cancel_at_self )
{
if (restrict != DIR_DIR)
message_current_target();
direction( spelld, restrict, mode, -1, false, needs_path,
- may_target_monster, prompt, NULL, cancel_at_self );
+ may_target_monster, may_target_self, prompt, NULL,
+ cancel_at_self );
if (!spelld.isValid)
{
diff --git a/crawl-ref/source/spl-util.h b/crawl-ref/source/spl-util.h
index 6bbbfdd9b8..315e84c697 100644
--- a/crawl-ref/source/spl-util.h
+++ b/crawl-ref/source/spl-util.h
@@ -116,7 +116,8 @@ bool spell_direction( dist &spelld, bolt &pbolt,
targeting_type restrict = DIR_NONE,
targ_mode_type mode = TARG_ENEMY,
bool needs_path = true, bool may_target_monster = true,
- const char *prompt = NULL, bool cancel_at_self = false );
+ bool may_target_self = false, const char *prompt = NULL,
+ bool cancel_at_self = false );
void apply_area_cloud(int (*func) (int, int, int, int, cloud_type,
kill_category),