summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-28 23:00:12 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-28 23:00:12 +0000
commitca1e897a646bb9c098a1fc651a3b4aa6c976ddc7 (patch)
treedbf6313bff2e2906a4f9ee61fdefff8594849522
parent0f8c8527e5a685509462e0990a7b6ec6595e445a (diff)
downloadcrawl-ref-ca1e897a646bb9c098a1fc651a3b4aa6c976ddc7.tar.gz
crawl-ref-ca1e897a646bb9c098a1fc651a3b4aa6c976ddc7.zip
Apply r6640, r6694 (both by Darshan), r6670 (Haran), r6679 and r6703
(me) to branch. Includes TSO no longer granting permanent allies and resultant friendly pickup change, and a number of smaller changes. Also update change log. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.4@6709 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/docs/changes.stone_soup23
-rw-r--r--crawl-ref/docs/options_guide.txt11
-rw-r--r--crawl-ref/settings/init.txt5
-rw-r--r--crawl-ref/source/acr.cc6
-rw-r--r--crawl-ref/source/command.cc18
-rw-r--r--crawl-ref/source/debug.cc6
-rw-r--r--crawl-ref/source/decks.cc3
-rw-r--r--crawl-ref/source/directn.cc15
-rw-r--r--crawl-ref/source/directn.h5
-rw-r--r--crawl-ref/source/externs.h4
-rw-r--r--crawl-ref/source/food.cc25
-rw-r--r--crawl-ref/source/it_use2.cc20
-rw-r--r--crawl-ref/source/item_use.cc2
-rw-r--r--crawl-ref/source/mon-util.cc4
-rw-r--r--crawl-ref/source/monstuff.cc2
-rw-r--r--crawl-ref/source/player.cc16
-rw-r--r--crawl-ref/source/religion.cc86
-rw-r--r--crawl-ref/source/spells1.cc4
-rw-r--r--crawl-ref/source/spells3.cc2
-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
-rw-r--r--crawl-ref/source/traps.cc2
25 files changed, 167 insertions, 128 deletions
diff --git a/crawl-ref/docs/changes.stone_soup b/crawl-ref/docs/changes.stone_soup
index 8530552b94..f18fafd955 100644
--- a/crawl-ref/docs/changes.stone_soup
+++ b/crawl-ref/docs/changes.stone_soup
@@ -3,23 +3,38 @@ Stone Soup 0.4.2 (2008????)
Disclaimer: These are merely the highlights, not an exhaustive list of changes.
-* Fixed vampire draining not destroying small corpses.
* Fixed defunct spell slot cap (and crash) with Selective Amnesia memorized.
-* Fixed Elf:1 arrival sometimes being disconnected.
+* Fixed the game crashing if PlaceInfo somehow ends up buggy.
+* Fixed runaway skill training.
+* Fixed vampire draining not destroying small corpses.
* Fixed player being incapable of attacking some monsters.
+* Fixed Elf:1 arrival sometimes being disconnected.
+* Fixed picking up runes not enabling teleport control.
+* Fixed macros not working with 0.3.4 keymaps by introducing keybinding.
* Fixed x_ and other feature hotkeys not working in the Abyss.
+* Fixed items being created in walls.
* Fixed randart bardings masquerading as boots.
+* Fixed not swapping with a fiery monster into a fire cloud still moving it.
* Fixed claws/ankus not being handled by the weapon option.
-* Fixed repeatedly interrupted butchering making no progress.
* Fixed maps being unable to place monsters on shallow water.
+* Fixed non-potion effects taking Vampire hunger states into account.
+* Fixed repeatedly interrupted butchering making no progress.
+* Fixed prompting because of inappropriate weapon despite being confused.
* Fixed resistances for lava creatures.
+* Weakened monster Dispel Undead.
* Existing ghosts are now saved back if an undead player dies on their level.
* TSO no longer minds if you attack an evil monster in an unchivalric manner.
+* TSO no longer grants permanent followers, only prolongs their existence.
+* Intelligent allies can now equip themselves even if non-permanent.
+* Cleansing Flame won't harm monsters if TSO would be angry about that.
* Abominations created by Twisted Resurrection count as undead again.
* Restrict freezing cloud to high-damage cold beams, reduce their duration.
* Reduce number of times a beam can bounce.
-* Self-hit prompts now respect the player's known resistances.
+* Count chunks and blood towards decks of summoning rather than wonder.
* Show monsters sensing/seeing invisible in their 'x' description.
+* Self-hit prompts now respect the player's known resistances.
+* Added chunk colour to lua eating prompt.
+* Added PCRE to the source tree.
Stone Soup 0.4.1 (20080717)
---------------------------
diff --git a/crawl-ref/docs/options_guide.txt b/crawl-ref/docs/options_guide.txt
index e7cb00a362..4325ba43da 100644
--- a/crawl-ref/docs/options_guide.txt
+++ b/crawl-ref/docs/options_guide.txt
@@ -508,11 +508,12 @@ default_friendly_pickup = (friend | none | all)
when you start a new game, or when you enter a level for the first
time.
- Note that this only works for intelligent permanent allies (such
- as you can get when worshipping Beogh or the Shining One), and
- that monsters have their own reasonings for which items they may
- need, and when they feel safe enough to pick them up. Except for
- "none", these options won't let you override these requirements.
+ Note that this only works for intelligent allies (such as you
+ can get when worshipping Beogh or when summoning intelligent
+ monsters), and that monsters have their own reasonings for which
+ items they may need, and when they feel safe enough to pick them
+ up. Except for "none", these options won't let you override these
+ requirements.
Also, friendly jellies won't ever eat any items, regardless of
this option.
diff --git a/crawl-ref/settings/init.txt b/crawl-ref/settings/init.txt
index cf1924e631..a483f0096a 100644
--- a/crawl-ref/settings/init.txt
+++ b/crawl-ref/settings/init.txt
@@ -261,8 +261,9 @@ include = menu_colours.txt
# Colouring of autoinscribed god gifts
menu_colour = pickup:green:god gift
-# Highlight selected items
-menu_colour = white:\w \+ .
+# Highlight (partly) selected items
+menu_colour = white:\w \+
+menu_colour = white:\w \#
# Colouring of messages
include = messages.txt
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc
index ab1102eb24..849f754946 100644
--- a/crawl-ref/source/acr.cc
+++ b/crawl-ref/source/acr.cc
@@ -1962,9 +1962,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 501e8ada2a..49abe4aaa9 100644
--- a/crawl-ref/source/command.cc
+++ b/crawl-ref/source/command.cc
@@ -296,18 +296,18 @@ void adjust(void)
void swap_inv_slots(int from_slot, int to_slot, bool verbose)
{
- // swap items
+ // Swap items.
item_def tmp = you.inv[to_slot];
- you.inv[to_slot] = you.inv[from_slot];
+ you.inv[to_slot] = you.inv[from_slot];
you.inv[from_slot] = tmp;
- // slot switching
+ // Slot switching.
tmp.slot = you.inv[to_slot].slot;
- you.inv[to_slot].slot = you.inv[from_slot].slot;
+ you.inv[to_slot].slot = you.inv[from_slot].slot;
you.inv[from_slot].slot = tmp.slot;
you.inv[from_slot].link = from_slot;
- you.inv[to_slot].link = to_slot;
+ you.inv[to_slot].link = to_slot;
for (int i = 0; i < NUM_EQUIP; i++)
{
@@ -330,6 +330,8 @@ void swap_inv_slots(int from_slot, int to_slot, bool verbose)
you.wield_change = true;
you.m_quiver->on_weapon_changed();
}
+ else // just to make sure
+ you.redraw_quiver = true;
}
static void _adjust_item(void)
@@ -375,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))
@@ -391,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 731664a7b6..c30b52f419 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
*/
@@ -4147,7 +4147,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 ed25476877..c748782d10 100644
--- a/crawl-ref/source/decks.cc
+++ b/crawl-ref/source/decks.cc
@@ -1680,7 +1680,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 9652a978ea..77ee90a963 100644
--- a/crawl-ref/source/directn.cc
+++ b/crawl-ref/source/directn.cc
@@ -471,7 +471,8 @@ static void _fill_monster_list(bool full_info)
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)
@@ -1064,13 +1065,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;
}
diff --git a/crawl-ref/source/directn.h b/crawl-ref/source/directn.h
index 557962186f..c890d4aa1a 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(int x, int y);
bool in_viewport_bounds(int x, int y);
diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h
index fdd48acfbb..66c056c8a6 100644
--- a/crawl-ref/source/externs.h
+++ b/crawl-ref/source/externs.h
@@ -530,9 +530,7 @@ public:
bool is_global() const;
void make_global();
- // Not const since it now tries to patch up problems instead of
- // merely asserting.
- void assert_validity();
+ void assert_validity() const;
const std::string short_name() const;
diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc
index d982ee7658..84c8ad5dc6 100644
--- a/crawl-ref/source/food.cc
+++ b/crawl-ref/source/food.cc
@@ -47,6 +47,7 @@
#include "mutation.h"
#include "output.h"
#include "player.h"
+#include "randart.h"
#include "religion.h"
#include "skills2.h"
#include "spells2.h"
@@ -208,17 +209,21 @@ static int _find_butchering_implement(int &butcher_tool)
// Look for a butchering implement in your pack.
for (int i = 0; i < ENDOFPACK; ++i)
{
- if (is_valid_item( you.inv[i] )
- && you.inv[i].base_type == OBJ_WEAPONS
- && can_cut_meat( you.inv[i] )
- && can_wield( &you.inv[i] ))
+ const item_def& tool(you.inv[i]);
+ if (is_valid_item( tool )
+ && tool.base_type == OBJ_WEAPONS
+ && can_cut_meat( tool )
+ && can_wield( &tool )
+ // Don't even suggest autocursing items.
+ && (!is_random_artefact(tool)
+ || !randart_known_wpn_property(tool, RAP_CURSED)))
{
if (Options.easy_butcher
- && item_known_uncursed(you.inv[i])
- && item_type_known(you.inv[i])
- && get_weapon_brand(you.inv[i]) != SPWPN_DISTORTION
+ && item_known_uncursed(tool)
+ && item_type_known(tool)
+ && get_weapon_brand(tool) != SPWPN_DISTORTION
// Don't even ask!
- && !has_warning_inscription(you.inv[i], OPER_WIELD))
+ && !has_warning_inscription(tool, OPER_WIELD))
{
butcher_tool = i;
return (true);
@@ -607,7 +612,7 @@ bool butchery(int which_corpse)
corpse_name.c_str());
repeat_prompt = false;
- keyin = tolower(c_getch());
+ keyin = tolower(getchm(KC_CONFIRM));
switch (keyin)
{
case 'b':
@@ -1204,7 +1209,7 @@ int eat_from_floor()
((si->quantity > 1) ? "one of " : ""),
item_name.c_str());
- int keyin = tolower(c_getch());
+ int keyin = tolower(getchm(KC_CONFIRM));
switch (keyin)
{
case 'q':
diff --git a/crawl-ref/source/it_use2.cc b/crawl-ref/source/it_use2.cc
index 5d7c6413e3..ad53a89f49 100644
--- a/crawl-ref/source/it_use2.cc
+++ b/crawl-ref/source/it_use2.cc
@@ -53,17 +53,18 @@ bool potion_effect( potion_type pot_eff, int pow, bool was_known )
if (pow > 150)
pow = 150;
- const int factor =
- (you.species == SP_VAMPIRE && you.hunger_state < HS_SATIATED ? 2 : 1);
+ const int factor = (you.species == SP_VAMPIRE
+ && you.hunger_state < HS_SATIATED && pow == 40 ? 2
+ : 1);
switch (pot_eff)
{
case POT_HEALING:
- inc_hp( (5 + random2(7)) / factor, false);
+ inc_hp((5 + random2(7)) / factor, false);
mpr("You feel better.");
- // only fix rot when healed to full
+ // Only fix rot when healed to full.
if (you.hp == you.hp_max)
{
unrot_hp(1);
@@ -180,7 +181,8 @@ bool potion_effect( potion_type pot_eff, int pow, bool was_known )
break;
case POT_LEVITATION:
- mprf("You feel %s buoyant.", !player_is_airborne() ? "very"
+ mprf(MSGCH_DURATION,
+ "You feel %s buoyant.", !player_is_airborne() ? "very"
: "more");
if (!player_is_airborne())
@@ -203,7 +205,8 @@ bool potion_effect( potion_type pot_eff, int pow, bool was_known )
}
else
{
- mprf("That liquid tasted %s nasty...",
+ mprf(MSGCH_WARN,
+ "That liquid tasted %s nasty...",
(pot_eff == POT_POISON) ? "very" : "extremely" );
poison_player( ((pot_eff == POT_POISON) ? 1 + random2avg(5, 2)
@@ -229,7 +232,8 @@ bool potion_effect( potion_type pot_eff, int pow, bool was_known )
case POT_INVISIBILITY:
mpr(!you.duration[DUR_INVIS] ? "You fade into invisibility!"
- : "You fade further into invisibility.");
+ : "You fade further into invisibility.",
+ MSGCH_DURATION);
// Invisibility cancels backlight.
you.duration[DUR_BACKLIGHT] = 0;
@@ -364,7 +368,7 @@ bool potion_effect( potion_type pot_eff, int pow, bool was_known )
break;
case POT_RESISTANCE:
- mpr("You feel protected.");
+ mpr("You feel protected.", MSGCH_DURATION);
you.duration[DUR_RESIST_FIRE] += (random2(pow) + 10) / factor;
you.duration[DUR_RESIST_COLD] += (random2(pow) + 10) / factor;
you.duration[DUR_RESIST_POISON] += (random2(pow) + 10) / factor;
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index 0d29c0f554..eec49676a7 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -1461,7 +1461,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 62f1beff85..3b07256850 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -4138,10 +4138,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/monstuff.cc b/crawl-ref/source/monstuff.cc
index a8021f6e1b..b28420d6aa 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -408,7 +408,7 @@ static void _give_monster_experience( monsters *victim,
{
if (you.religion == GOD_SHINING_ONE || you.religion == GOD_BEOGH
|| player_under_penance()
- || one_chance_in(3))
+ || !one_chance_in(3))
{
return;
}
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index 2f3ab09187..fc5a0076fc 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -6765,7 +6765,7 @@ void PlaceInfo::make_global()
branch = -1;
}
-void PlaceInfo::assert_validity()
+void PlaceInfo::assert_validity() const
{
// Check that level_type and branch match up.
ASSERT(is_global()
@@ -6777,10 +6777,10 @@ void PlaceInfo::assert_validity()
#if DEBUG
// Can't have visited a place without seeing any of its levels, and
// vice versa.
- if(!(num_visits == 0 && levels_seen == 0
- || num_visits > 0 && levels_seen > 0))
+ if (!(num_visits == 0 && levels_seen == 0
+ || num_visits > 0 && levels_seen > 0))
{
- mprf(MSGCH_DIAGNOSTICS, "PlaceInfo: num_vists/levels_seen mismatch");
+ mprf(MSGCH_DIAGNOSTICS, "PlaceInfo: num_visits/levels_seen mismatch");
num_visits = std::max((unsigned long) 1, num_visits);
levels_seen = std::max((unsigned long) 1, levels_seen);
}
@@ -6814,8 +6814,8 @@ void PlaceInfo::assert_validity()
}
}
- if(turns_total != (turns_explore + turns_travel + turns_interlevel
- + turns_resting + turns_other))
+ if (turns_total != (turns_explore + turns_travel + turns_interlevel
+ + turns_resting + turns_other))
{
mprf(MSGCH_DIAGNOSTICS, "PlaceInfo: turns breakdown doesn't sum "
"up properly.");
@@ -6823,8 +6823,8 @@ void PlaceInfo::assert_validity()
+ turns_resting + turns_other);
}
- if(elapsed_total != (elapsed_explore + elapsed_travel + elapsed_interlevel
- + elapsed_resting + elapsed_other))
+ if (elapsed_total != (elapsed_explore + elapsed_travel + elapsed_interlevel
+ + elapsed_resting + elapsed_other))
{
mprf(MSGCH_DIAGNOSTICS, "PlaceInfo: elapsed time breakdown doesn't "
"sum up properly.");
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index 57e472414e..2d0e44b142 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -914,19 +914,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)
@@ -1294,6 +1294,22 @@ static bool _tso_blessing_holy_arm(monsters* mon)
return (true);
}
+static bool _increase_ench_duration(monsters *mon,
+ mon_enchant ench,
+ const int increase)
+{
+ // Durations are saved as 16-bit signed ints, so clamp at the largest such.
+ const int MARSHALL_MAX = (1 << 15) - 1;
+
+ const int newdur = std::min(ench.duration + increase, MARSHALL_MAX);
+ if (ench.duration >= newdur)
+ return false;
+
+ ench.duration = newdur;
+ mon->update_ench(ench);
+ return true;
+}
+
static int _tso_blessing_extend_stay(monsters* mon)
{
if (!mon->has_ench(ENCH_ABJ))
@@ -1301,25 +1317,12 @@ static int _tso_blessing_extend_stay(monsters* mon)
mon_enchant abj = mon->get_ench(ENCH_ABJ);
- const int increase = 300 + random2(300);
- const int threshold = (increase + random2(increase)) * 2;
-
- // Extend the time an abjurable monster has before disappearing.
- abj.duration += increase;
-
- // If the extended stay is long enough, make it permanent. Note
- // that we have to delete the enchantment without removing the
- // enchantment effect, in order to keep the monster from
- // disappearing.
- if (abj.duration >= threshold)
- {
- mon->del_ench(ENCH_ABJ, true, false);
- return 2;
- }
- else
- mon->update_ench(abj);
-
- return 1;
+ // [ds] Disabling permanence for balance reasons, but extending duration
+ // increase. These numbers are tenths of a player turn. Holy monsters
+ // get a much bigger boost than random beasties.
+ const int base_increase = mon->holiness() == MH_HOLY? 1100 : 500;
+ const int increase = base_increase + random2(base_increase);
+ return _increase_ench_duration(mon, abj, increase);
}
static bool _tso_blessing_friendliness(monsters* mon)
@@ -1327,21 +1330,10 @@ static bool _tso_blessing_friendliness(monsters* mon)
if (!mon->has_ench(ENCH_CHARM))
return (false);
- mon->attitude = ATT_FRIENDLY;
-
- // The monster is not really *created* friendly, but should it
- // become hostile later on, it won't count as a good kill.
- mon->flags |= MF_CREATED_FRIENDLY;
-
- mons_make_god_gift(mon, GOD_SHINING_ONE);
-
- // If the monster is charmed, make it permanently friendly. Note
- // that we have to delete the enchantment without removing the
- // enchantment effect, in order to keep the monster from turning
- // hostile.
- mon->del_ench(ENCH_CHARM, true, false);
-
- return (true);
+ // [ds] Just increase charm duration, no permanent friendliness.
+ const int base_increase = 700;
+ return _increase_ench_duration(mon, mon->get_ench(ENCH_CHARM),
+ base_increase + random2(base_increase));
}
// If you don't currently have any followers, send a small band to help
diff --git a/crawl-ref/source/spells1.cc b/crawl-ref/source/spells1.cc
index c3900b4778..9fc757c509 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.tx, beam.ty) == you.pos())
{
@@ -689,7 +689,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 e2f1150de6..ae724e2077 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();
}
diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc
index ed711ad7a1..adca9c8e4e 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 f198140edd..12e20a6069 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 e64c2f089f..ba2fb65d0d 100644
--- a/crawl-ref/source/spl-util.cc
+++ b/crawl-ref/source/spl-util.cc
@@ -782,13 +782,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 b2dd736b7c..f3f4aafa55 100644
--- a/crawl-ref/source/spl-util.h
+++ b/crawl-ref/source/spl-util.h
@@ -132,7 +132,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),
diff --git a/crawl-ref/source/traps.cc b/crawl-ref/source/traps.cc
index 0b726a678f..9f656e95f6 100644
--- a/crawl-ref/source/traps.cc
+++ b/crawl-ref/source/traps.cc
@@ -522,7 +522,7 @@ void destroy_trap( const coord_def& pos )
}
}
-void disarm_trap( struct dist &disa )
+void disarm_trap( dist &disa )
{
if (you.duration[DUR_BERSERKER])
{