summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-08 21:53:05 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-08 21:53:05 +0000
commit7cc66e61e50963ba90a5db8db19cf75890d3c733 (patch)
treefa2ee702c472095c0c3c2326fd7920d02875e29a
parent8cbb227becdc172839b901aedf972022dc73118d (diff)
downloadcrawl-ref-7cc66e61e50963ba90a5db8db19cf75890d3c733.tar.gz
crawl-ref-7cc66e61e50963ba90a5db8db19cf75890d3c733.zip
Apply more commits into 0.4 branch, again mostly by Haran:
6950, 6954, 6959, 6962, 6963, 6965, 6968, 6970 (partly), 6997, 6998, 7001, 7061, 7065, 7071, 7132 (partly), 7174, 7186, 7213, 7233, 7268, 7268, 7293, 7319, 7339, 7358, 7393 (partly) * Tweak a few monster flags. * Fix autoswapping jewellery taking longer than manual swapping. * Fix crash when attempting to create nonexisting monster in wizmode. * Make ego armour descriptions follow abbreviation guidelines. * Fixed buggy monster movement away from the player. * Disabled traps in the Abyss. * Fixed a few other minor bugs, and improves messaging. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.4@7788 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/acr.cc3
-rw-r--r--crawl-ref/source/beam.cc2
-rw-r--r--crawl-ref/source/dat/lua/wield.lua6
-rw-r--r--crawl-ref/source/debug.cc9
-rw-r--r--crawl-ref/source/delay.cc40
-rw-r--r--crawl-ref/source/describe.cc12
-rw-r--r--crawl-ref/source/dungeon.cc4
-rw-r--r--crawl-ref/source/effects.cc10
-rw-r--r--crawl-ref/source/food.cc25
-rw-r--r--crawl-ref/source/invent.cc7
-rw-r--r--crawl-ref/source/invent.h3
-rw-r--r--crawl-ref/source/item_use.cc15
-rw-r--r--crawl-ref/source/item_use.h2
-rw-r--r--crawl-ref/source/itemname.cc60
-rw-r--r--crawl-ref/source/items.cc17
-rw-r--r--crawl-ref/source/items.h2
-rw-r--r--crawl-ref/source/mon-data.h14
-rw-r--r--crawl-ref/source/mon-util.cc14
-rw-r--r--crawl-ref/source/monstuff.cc13
-rw-r--r--crawl-ref/source/newgame.cc18
-rw-r--r--crawl-ref/source/player.cc13
-rw-r--r--crawl-ref/source/religion.cc7
-rw-r--r--crawl-ref/source/skills2.cc27
-rw-r--r--crawl-ref/source/view.cc20
24 files changed, 206 insertions, 137 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc
index 7aabcfaa40..59df526ad9 100644
--- a/crawl-ref/source/acr.cc
+++ b/crawl-ref/source/acr.cc
@@ -1475,7 +1475,8 @@ static void _input()
if (you_are_delayed())
{
- _world_reacts();
+ if (you.time_taken)
+ _world_reacts();
return;
}
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index 6bb3fadd40..20e762e6b9 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -3824,7 +3824,7 @@ static int _affect_player( bolt &beam, item_def *item )
else if (_beam_is_blockable(beam))
{
// Non-beams can be blocked or dodged.
- if (you.equip[EQ_SHIELD] != -1
+ if (you.shield()
&& !beam.aimed_at_feet
&& player_shield_class() > 0)
{
diff --git a/crawl-ref/source/dat/lua/wield.lua b/crawl-ref/source/dat/lua/wield.lua
index e4fe9951e3..b068b543de 100644
--- a/crawl-ref/source/dat/lua/wield.lua
+++ b/crawl-ref/source/dat/lua/wield.lua
@@ -32,13 +32,15 @@ function ch_item_wieldable(it)
end
if spells["Sandblast"]
- and string.find( item.name(it, "a"), " stones?$" )
+ and item.class(it, true) == "missile"
+ and string.find( item.name(it, "a"), " stones?" )
then
return true
end
if spells["Sticks to Snakes"]
- and string.find( item.name(it, "a"), " arrows?$" )
+ and item.class(it, true) == "missile"
+ and string.find( item.name(it, "a"), " arrows?" )
then
return true
end
diff --git a/crawl-ref/source/debug.cc b/crawl-ref/source/debug.cc
index c3ff393224..8ef16c9685 100644
--- a/crawl-ref/source/debug.cc
+++ b/crawl-ref/source/debug.cc
@@ -455,8 +455,15 @@ void wizard_create_spec_monster(void)
{
int mon = _debug_prompt_for_int( "Create which monster by number? ", true );
- if (mon == -1)
+ if (mon == -1 || (mon >= NUM_MONSTERS
+ && mon != RANDOM_MONSTER
+ && mon != RANDOM_DRACONIAN
+ && mon != RANDOM_BASE_DRACONIAN
+ && mon != RANDOM_NONBASE_DRACONIAN
+ && mon != WANDERING_MONSTER))
+ {
canned_msg( MSG_OK );
+ }
else
{
create_monster(
diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc
index 5aa664fc53..25d68a68a9 100644
--- a/crawl-ref/source/delay.cc
+++ b/crawl-ref/source/delay.cc
@@ -974,6 +974,15 @@ void handle_delay( void )
mprf(MSGCH_MULTITURN_ACTION, "You continue bottling blood from "
"the corpse.");
break;
+
+ case DELAY_JEWELLERY_ON:
+ case DELAY_WEAPON_SWAP:
+ // These are 1-turn delays where the time cost is handled
+ // in _finish_delay().
+ // FIXME: get rid of this hack!
+ you.time_taken = 0;
+ break;
+
case DELAY_MEMORISE:
mpr("You continue memorising.", MSGCH_MULTITURN_ACTION);
break;
@@ -1027,15 +1036,15 @@ static void _finish_delay(const delay_queue_item &delay)
switch (delay.type)
{
case DELAY_WEAPON_SWAP:
- weapon_switch( delay.parm1 );
+ weapon_switch(delay.parm1);
break;
case DELAY_JEWELLERY_ON:
- puton_ring( delay.parm1, false );
+ puton_ring(delay.parm1, false);
break;
case DELAY_ARMOUR_ON:
- _armour_wear_effects( delay.parm1 );
+ _armour_wear_effects(delay.parm1);
break;
case DELAY_ARMOUR_OFF:
@@ -1043,8 +1052,7 @@ static void _finish_delay(const delay_queue_item &delay)
mprf("You finish taking off %s.",
you.inv[delay.parm1].name(DESC_NOCAP_YOUR).c_str());
- const equipment_type slot =
- get_armour_slot( you.inv[delay.parm1] );
+ const equipment_type slot = get_armour_slot(you.inv[delay.parm1]);
if (slot == EQ_BODY_ARMOUR)
{
@@ -1055,28 +1063,12 @@ static void _finish_delay(const delay_queue_item &delay)
switch (slot)
{
case EQ_SHIELD:
- if (delay.parm1 == you.equip[EQ_SHIELD])
- you.equip[EQ_SHIELD] = -1;
- break;
-
case EQ_CLOAK:
- if (delay.parm1 == you.equip[EQ_CLOAK])
- you.equip[EQ_CLOAK] = -1;
- break;
-
case EQ_HELMET:
- if (delay.parm1 == you.equip[EQ_HELMET])
- you.equip[EQ_HELMET] = -1;
- break;
-
case EQ_GLOVES:
- if (delay.parm1 == you.equip[EQ_GLOVES])
- you.equip[EQ_GLOVES] = -1;
- break;
-
case EQ_BOOTS:
- if (delay.parm1 == you.equip[EQ_BOOTS])
- you.equip[EQ_BOOTS] = -1;
+ if (delay.parm1 == you.equip[slot])
+ you.equip[slot] = -1;
break;
default:
@@ -1743,7 +1735,7 @@ inline static bool _monster_warning(activity_interrupt_type ai,
const monsters* mon = static_cast<const monsters*>(at.data);
if (!mon->visible())
return (false);
- if (at.context == "already seen")
+ if (at.context == "already seen" || at.context == "uncharm")
{
// Only say "comes into view" if the monster wasn't in view
// during the previous turn.
diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc
index 631fa0769b..e7530ba1e9 100644
--- a/crawl-ref/source/describe.cc
+++ b/crawl-ref/source/describe.cc
@@ -946,16 +946,8 @@ static std::string _describe_weapon( const item_def &item, bool verbose)
"it drains the life of those it strikes.";
break;
case SPWPN_SPEED:
- if (is_range_weapon(item))
- {
- description += "It allows its wielder to fire twice when "
- "they would otherwise have fired only once.";
- }
- else
- {
- description += "It allows its wielder to attack twice when "
- "they would otherwise have struck only once.";
- }
+ description += "Attacks with this weapon take half as long "
+ "as usual.";
break;
case SPWPN_VORPAL:
if (is_range_weapon(item))
diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc
index d24e9e2e34..49e78f8c35 100644
--- a/crawl-ref/source/dungeon.cc
+++ b/crawl-ref/source/dungeon.cc
@@ -1306,7 +1306,9 @@ static void _build_dungeon_level(int level_number, int level_type)
if (dgn_level_vetoed)
return;
- _place_traps(level_number);
+ if (level_type != LEVEL_ABYSS)
+ _place_traps(level_number);
+
_place_fog_machines(level_number);
// Place items.
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index dfd013c784..959480db75 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -136,6 +136,7 @@ int holy_word_monsters(int x, int y, int pow, int caster)
// Currently, holy word annoys the monsters it affects because it
// can kill them, and because hostile monsters don't use it.
behaviour_event(monster, ME_ANNOY, MHITYOU);
+ simple_monster_message(monster, " convulses!");
hurt_monster(monster, hploss);
if (hploss)
@@ -148,8 +149,6 @@ int holy_word_monsters(int x, int y, int pow, int caster)
}
}
- simple_monster_message(monster, " convulses!");
-
if (monster->speed_increment >= 25)
{
retval = 1;
@@ -1310,6 +1309,7 @@ static int _find_acquirement_subtype(object_class_type class_wanted,
// If the book is invalid find any valid one.
while (book_rarity(type_wanted) == 100
+ || type_wanted == BOOK_HEALING
|| type_wanted == BOOK_DESTRUCTION
|| type_wanted == BOOK_MANUAL)
{
@@ -1528,7 +1528,7 @@ bool acquirement(object_class_type class_wanted, int agent,
if (thing_created == NON_ITEM)
continue;
- const item_def &doodad(mitm[thing_created]);
+ item_def &doodad(mitm[thing_created]);
if (doodad.base_type == OBJ_WEAPONS
&& !can_wield(&doodad, false, true)
|| doodad.base_type == OBJ_ARMOUR
@@ -2937,6 +2937,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/food.cc b/crawl-ref/source/food.cc
index 29914b32c1..b70dc6d8da 100644
--- a/crawl-ref/source/food.cc
+++ b/crawl-ref/source/food.cc
@@ -136,7 +136,7 @@ void weapon_switch( int targ )
if (targ == -1) // Unarmed Combat.
{
// Already unarmed?
- if (you.equip[EQ_WEAPON] == -1)
+ if (!you.weapon())
return;
mpr( "You switch back to your bare hands." );
@@ -161,7 +161,7 @@ void weapon_switch( int targ )
// Well yeah, but that's because interacting with the wielding
// code is a mess... this whole function's purpose was to
// isolate this hack until there's a proper way to do things. -- bwr
- if (you.equip[EQ_WEAPON] != -1)
+ if (you.weapon())
unwield_item(false);
you.equip[EQ_WEAPON] = targ;
@@ -173,13 +173,25 @@ void weapon_switch( int targ )
if (Options.chunks_autopickup || you.species == SP_VAMPIRE)
autopickup();
+ // Same amount of time as normal wielding.
+ // FIXME: this duplicated code is begging for a bug.
+ if (you.weapon())
+ {
+ you.time_taken /= 2;
+ }
+ else // swapping to empty hands is faster
+ {
+ you.time_taken *= 3;
+ you.time_taken /= 10;
+ }
+
you.turn_is_over = true;
}
// Look for a butchering implement. If fallback is true,
// prompt the user if no obvious options exist.
// Returns whether a weapon was switched.
-static int _find_butchering_implement(int &butcher_tool)
+static bool _find_butchering_implement(int &butcher_tool)
{
// When berserk, you can't change weapons. Sanity check!
if (!can_wield(NULL, true))
@@ -209,7 +221,7 @@ static int _find_butchering_implement(int &butcher_tool)
// Look for a butchering implement in your pack.
for (int i = 0; i < ENDOFPACK; ++i)
{
- const item_def& tool(you.inv[i]);
+ item_def& tool(you.inv[i]);
if (is_valid_item( tool )
&& tool.base_type == OBJ_WEAPONS
&& can_cut_meat( tool )
@@ -241,7 +253,7 @@ static int _find_butchering_implement(int &butcher_tool)
const int item_slot = prompt_invent_item(
"What would you like to use? (- for none)?",
- MT_INVLIST, OSEL_WIELD,
+ MT_INVLIST, OSEL_BUTCHERY,
true, true, true, '-', -1, NULL, OPER_WIELD);
if (prompt_failed(item_slot))
@@ -2012,6 +2024,9 @@ bool is_preferred_food(const item_def &food)
if (food.base_type != OBJ_FOOD)
return (false);
+
+ if (is_poisonous(food))
+ return (false);
// Honeycombs are tasty for everyone.
if (food.sub_type == FOOD_HONEYCOMB || food.sub_type == FOOD_ROYAL_JELLY)
diff --git a/crawl-ref/source/invent.cc b/crawl-ref/source/invent.cc
index b33334fe2e..1f40e4e40e 100644
--- a/crawl-ref/source/invent.cc
+++ b/crawl-ref/source/invent.cc
@@ -370,6 +370,8 @@ static std::string _no_selectables_message(int item_selector)
return("You aren't carrying any wands.");
case OSEL_THROWABLE:
return("You aren't carrying any items that might be thrown or fired.");
+ case OSEL_BUTCHERY:
+ return("You aren't carrying any sharp implements.");
}
return("You aren't carrying any such object.");
@@ -845,6 +847,9 @@ static bool _item_class_selected(const item_def &i, int selector)
return (itype == OBJ_WEAPONS || itype == OBJ_STAVES
|| itype == OBJ_MISCELLANY);
+ case OSEL_BUTCHERY:
+ return (itype == OBJ_WEAPONS && can_cut_meat(i));
+
case OSEL_MEMORISE:
return (itype == OBJ_BOOKS && i.sub_type != BOOK_MANUAL
&& (i.sub_type != BOOK_DESTRUCTION || !item_type_known(i)));
@@ -1351,7 +1356,7 @@ int prompt_invent_item( const char *prompt,
}
if (!_any_items_to_select(type_expect) && type_expect != OSEL_WIELD
- && mtype == MT_INVLIST)
+ && type_expect != OSEL_BUTCHERY && mtype == MT_INVLIST)
{
mprf(MSGCH_PROMPT, "%s",
_no_selectables_message(type_expect).c_str());
diff --git a/crawl-ref/source/invent.h b/crawl-ref/source/invent.h
index 6ae30e9441..2f97c22ae1 100644
--- a/crawl-ref/source/invent.h
+++ b/crawl-ref/source/invent.h
@@ -31,7 +31,8 @@ enum object_selector
OSEL_ENCH_ARM = -7,
OSEL_VAMP_EAT = -8,
OSEL_DRAW_DECK = -9,
- OSEL_THROWABLE = -10
+ OSEL_THROWABLE = -10,
+ OSEL_BUTCHERY = -11
};
#define PROMPT_ABORT -1
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index 32be70e0d3..eb429cd7b1 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -91,7 +91,7 @@ static bool _fire_validate_item(int selected, std::string& err);
// Rather messy - we've gathered all the can't-wield logic from wield_weapon()
// here.
-bool can_wield(const item_def *weapon, bool say_reason,
+bool can_wield(item_def *weapon, bool say_reason,
bool ignore_temporary_disability)
{
#define SAY(x) if (say_reason) { x; } else
@@ -172,7 +172,18 @@ bool can_wield(const item_def *weapon, bool say_reason,
if ((you.is_undead || you.species == SP_DEMONSPAWN)
&& (weap_brand == SPWPN_HOLY_WRATH || is_blessed_blade(*weapon)))
{
- SAY(mpr("This weapon will not allow you to wield it."));
+ if (say_reason)
+ {
+ mpr("This weapon is holy and will not allow you to wield it.");
+ // If it's a standard weapon, you know its ego now.
+ if (!is_artefact(*weapon) && !is_blessed_blade(*weapon)
+ && !item_type_known(*weapon))
+ {
+ set_ident_flags(*weapon, ISFLAG_KNOW_TYPE);
+ if (in_inventory(*weapon))
+ mpr(weapon->name(DESC_INVENTORY_EQUIP).c_str());
+ }
+ }
return (false);
}
diff --git a/crawl-ref/source/item_use.h b/crawl-ref/source/item_use.h
index 4c5fa69d5f..0965130480 100644
--- a/crawl-ref/source/item_use.h
+++ b/crawl-ref/source/item_use.h
@@ -128,7 +128,7 @@ struct item_def;
/* ***********************************************************************
* called from: food
* *********************************************************************** */
-bool can_wield(const item_def *weapon, bool say_why = false,
+bool can_wield(item_def *weapon, bool say_why = false,
bool ignore_temporary_disability = false);
// last updated 12may2000 {dlb}
diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc
index 75483d22b8..7bb5423d86 100644
--- a/crawl-ref/source/itemname.cc
+++ b/crawl-ref/source/itemname.cc
@@ -202,15 +202,11 @@ std::string item_def::name(description_level_type descrip,
if (this->link == you.equip[EQ_WEAPON])
{
- if (you.inv[ you.equip[EQ_WEAPON] ].base_type == OBJ_WEAPONS
- || item_is_staff( you.inv[ you.equip[EQ_WEAPON] ] ))
- {
+ if (this->base_type == OBJ_WEAPONS || item_is_staff(*this))
buff << " (weapon)";
- }
else
- {
buff << " (in hand)";
- }
+
equipped = true;
}
else if (this->link == you.equip[EQ_CLOAK]
@@ -238,12 +234,17 @@ std::string item_def::name(description_level_type descrip,
buff << " (around neck)";
equipped = true;
}
+ else if (this->link == you.m_quiver->get_fire_item(NULL))
+ {
+ buff << " (quivered)";
+ equipped = true; // well, sort of
+ }
}
if (descrip != DESC_BASENAME)
{
const bool tried = !ident && !equipped && item_type_tried(*this);
- std::string tried_str = "";
+ std::string tried_str;
if (tried)
{
@@ -399,25 +400,25 @@ static const char* armour_ego_name( special_armour_type sparm, bool terse )
{
switch (sparm)
{
- case SPARM_RUNNING: return " (run)";
- case SPARM_FIRE_RESISTANCE: return " (R-fire)";
- case SPARM_COLD_RESISTANCE: return " (R-cold)";
- case SPARM_POISON_RESISTANCE: return " (R-poison)";
- case SPARM_SEE_INVISIBLE: return " (see invis)";
- case SPARM_DARKNESS: return " (darkness)";
- case SPARM_STRENGTH: return " (str)";
- case SPARM_DEXTERITY: return " (dex)";
- case SPARM_INTELLIGENCE: return " (int)";
- case SPARM_PONDEROUSNESS: return " (ponderous)";
- case SPARM_LEVITATION: return " (levitate)";
- case SPARM_MAGIC_RESISTANCE: return " (R-magic)";
- case SPARM_PROTECTION: return " (protect)";
- case SPARM_STEALTH: return " (stealth)";
- case SPARM_RESISTANCE: return " (resist)";
- case SPARM_POSITIVE_ENERGY: return " (R-neg)"; // ha ha
- case SPARM_ARCHMAGI: return " (Archmagi)";
- case SPARM_PRESERVATION: return " (preserve)";
- default: return " (buggy)";
+ case SPARM_RUNNING: return " {run}";
+ case SPARM_FIRE_RESISTANCE: return " {rF+}";
+ case SPARM_COLD_RESISTANCE: return " {rC+}";
+ case SPARM_POISON_RESISTANCE: return " {rPois}";
+ case SPARM_SEE_INVISIBLE: return " {SInv}";
+ case SPARM_DARKNESS: return " {darkness}";
+ case SPARM_STRENGTH: return " {Str+3}";
+ case SPARM_DEXTERITY: return " {Dex+3}";
+ case SPARM_INTELLIGENCE: return " {Int+3}";
+ case SPARM_PONDEROUSNESS: return " {ponderous}";
+ case SPARM_LEVITATION: return " {Lev}";
+ case SPARM_MAGIC_RESISTANCE: return " {MR}";
+ case SPARM_PROTECTION: return " {AC+3}";
+ case SPARM_STEALTH: return " {Stlth+}";
+ case SPARM_RESISTANCE: return " {rC+ rF+}";
+ case SPARM_POSITIVE_ENERGY: return " {rN+}";
+ case SPARM_ARCHMAGI: return " {Archmagi}";
+ case SPARM_PRESERVATION: return " {rCorr, Cons}";
+ default: return " {buggy}";
}
}
}
@@ -2634,12 +2635,17 @@ const std::string menu_colour_item_prefix(const item_def &item, bool temp)
case OBJ_WEAPONS:
case OBJ_ARMOUR:
case OBJ_JEWELLERY:
- if (item_is_equipped(item))
+ if (item_is_equipped(item, true))
prefixes.push_back("equipped");
if (is_artefact(item))
prefixes.push_back("artefact");
break;
+ case OBJ_MISSILES:
+ if (item_is_equipped(item, true))
+ prefixes.push_back("equipped");
+ break;
+
default:
break;
}
diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc
index eed2f0be2d..b7ccb19185 100644
--- a/crawl-ref/source/items.cc
+++ b/crawl-ref/source/items.cc
@@ -2478,24 +2478,17 @@ item_def find_item_type(object_class_type base_type, std::string name)
return (item);
}
-bool item_is_equipped(const item_def &item)
+bool item_is_equipped(const item_def &item, bool quiver_too)
{
if (item.x != -1 || item.y != -1)
return (false);
for (int i = 0; i < NUM_EQUIP; i++)
- {
- if (you.equip[i] == EQ_NONE)
- continue;
-
- const item_def& eq(you.inv[you.equip[i]]);
-
- if (!is_valid_item(eq))
- continue;
-
- if (&eq == &item)
+ if (item.link == you.equip[i])
return (true);
- }
+
+ if (quiver_too && item.link == you.m_quiver->get_fire_item(NULL))
+ return (true);
return (false);
}
diff --git a/crawl-ref/source/items.h b/crawl-ref/source/items.h
index bdccd3bc43..1a398e5efd 100644
--- a/crawl-ref/source/items.h
+++ b/crawl-ref/source/items.h
@@ -149,7 +149,7 @@ bool need_to_autoinscribe();
void request_autoinscribe(bool do_inscribe = true);
void autoinscribe();
-bool item_is_equipped(const item_def &item);
+bool item_is_equipped(const item_def &item, bool quiver_too = false);
void item_was_lost(const item_def &item);
void item_was_destroyed(const item_def &item, int cause = -1);
diff --git a/crawl-ref/source/mon-data.h b/crawl-ref/source/mon-data.h
index e69bb991d9..84dffa4124 100644
--- a/crawl-ref/source/mon-data.h
+++ b/crawl-ref/source/mon-data.h
@@ -1599,8 +1599,7 @@
// angelic beings ('A')
{
MONS_ANGEL, 'A', WHITE, "Angel",
- M_FIGHTER | M_FLIES | M_SPELLCASTER | M_SEE_INVIS | M_WARM_BLOOD
- | M_SPEAKS,
+ M_FIGHTER | M_FLIES | M_SPELLCASTER | M_SEE_INVIS | M_SPEAKS,
MR_RES_POISON | MR_RES_ELEC,
0, 10, MONS_ANGEL, MONS_ANGEL, MH_HOLY, -8,
{ {AT_HIT, AF_PLAIN, 25}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK },
@@ -1611,8 +1610,7 @@
{
MONS_DAEVA, 'A', YELLOW, "Daeva",
- M_FIGHTER | M_LEVITATE | M_SPELLCASTER | M_SEE_INVIS | M_WARM_BLOOD
- | M_SPEAKS,
+ M_FIGHTER | M_LEVITATE | M_SPELLCASTER | M_SEE_INVIS | M_SPEAKS,
MR_RES_POISON,
0, 12, MONS_ANGEL, MONS_DAEVA, MH_HOLY, -8,
{ {AT_HIT, AF_PLAIN, 25}, {AT_HIT, AF_PLAIN, 10}, {AT_HIT, AF_PLAIN, 10},
@@ -1987,7 +1985,7 @@
400, 10, MONS_GIANT_EYEBALL, MONS_EYE_OF_DRAINING, MH_NATURAL, MAG_IMMUNE,
{ AT_NO_ATK, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK },
{ 7, 3, 5, 0 },
- 3, 1, MST_NO_SPELLS, CE_MUTAGEN_RANDOM, Z_NOZOMBIE, S_SILENT, I_PLANT,
+ 3, 1, MST_NO_SPELLS, CE_POISONOUS, Z_NOZOMBIE, S_SILENT, I_PLANT,
HT_LAND, 5, DEFAULT_ENERGY, MONUSE_NOTHING, SIZE_MEDIUM
},
@@ -2021,7 +2019,7 @@
0, 14, MONS_SHINING_EYE, MONS_SHINING_EYE, MH_NATURAL, MAG_IMMUNE,
{ AT_NO_ATK, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK },
{ 10, 3, 5, 0 },
- 3, 1, MST_SHINING_EYE, CE_POISONOUS, Z_NOZOMBIE, S_SILENT, I_PLANT,
+ 3, 1, MST_SHINING_EYE, CE_MUTAGEN_RANDOM, Z_NOZOMBIE, S_SILENT, I_PLANT,
HT_LAND, 7, DEFAULT_ENERGY, MONUSE_NOTHING, SIZE_MEDIUM
},
@@ -2232,7 +2230,7 @@
{ {AT_HIT, AF_PLAIN, 7}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK },
{ 5, 3, 5, 0 },
3, 12, MST_NO_SPELLS, CE_POISONOUS, Z_SMALL, S_SILENT, I_NORMAL,
- HT_LAND, 10, DEFAULT_ENERGY, MONUSE_WEAPONS_ARMOUR, SIZE_SMALL
+ HT_LAND, 10, DEFAULT_ENERGY, MONUSE_WEAPONS_ARMOUR, SIZE_MEDIUM
},
{
@@ -2935,7 +2933,7 @@
{
MONS_LAVA_SNAKE, 'S', RED, "lava snake",
- M_SPECIAL_ABILITY,
+ M_WARM_BLOOD | M_SPECIAL_ABILITY,
mrd(MR_RES_FIRE, 3) | MR_VUL_COLD,
0, 10, MONS_SNAKE, MONS_LAVA_SNAKE, MH_NATURAL, -3,
{ {AT_BITE, AF_FIRE, 7}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK },
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index c4431e63eb..12ce3a1b03 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -3261,15 +3261,23 @@ bool monsters::can_use_missile(const item_def &item) const
if (item.base_type != OBJ_MISSILES)
return (false);
- if (item.sub_type == MI_THROWING_NET && body_size(PSIZE_BODY) < SIZE_MEDIUM)
+ if ((item.sub_type == MI_THROWING_NET || item.sub_type == MI_JAVELIN)
+ && body_size(PSIZE_BODY) < SIZE_MEDIUM)
+ {
return (false);
+ }
if (item.sub_type == MI_LARGE_ROCK && !can_throw_rocks())
return (false);
- // These don't need any launcher, and are always okay.
- if (item.sub_type == MI_STONE || item.sub_type == MI_DART)
+ // Stones and darts don't need any launcher, and are always okay.
+ // Other missile types that don't need any launcher should be okay
+ // if we've gotten this far.
+ if (item.sub_type == MI_STONE || item.sub_type == MI_DART
+ || !has_launcher(item))
+ {
return (true);
+ }
item_def *launch;
for (int i = MSLOT_WEAPON; i <= MSLOT_ALT_WEAPON; ++i)
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index 494de41b99..5e10ddbf67 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -7292,9 +7292,8 @@ static bool _monster_move(monsters *monster)
// If neither does, do nothing.
if (good_move[mmov_x + 1][mmov_y + 1] == false)
{
- int current_distance = grid_distance(monster->x, monster->y,
- monster->target_x,
- monster->target_y);
+ int current_distance = distance(monster->x, monster->y,
+ monster->target_x, monster->target_y);
int dir = -1;
int i, mod, newdir;
@@ -7335,10 +7334,10 @@ static bool _monster_move(monsters *monster)
newdir = (dir + 8 + mod) % 8;
if (good_move[compass_x[newdir] + 1][compass_y[newdir] + 1])
{
- dist[i] = grid_distance(monster->x + compass_x[newdir],
- monster->y + compass_y[newdir],
- monster->target_x,
- monster->target_y);
+ dist[i] = distance(monster->x + compass_x[newdir],
+ monster->y + compass_y[newdir],
+ monster->target_x,
+ monster->target_y);
}
else
{
diff --git a/crawl-ref/source/newgame.cc b/crawl-ref/source/newgame.cc
index 86f4d07c52..15422763de 100644
--- a/crawl-ref/source/newgame.cc
+++ b/crawl-ref/source/newgame.cc
@@ -2023,7 +2023,8 @@ static bool _choose_book( item_def& book, int firstbook, int numbooks )
_print_character_info();
textcolor( CYAN );
- cprintf(EOL "You have a choice of books:" EOL);
+ cprintf(EOL "You have a choice of books: "
+ "(Press %% for a list of aptitudes)" EOL);
for (int i = 0; i < numbooks; ++i)
{
@@ -2080,6 +2081,9 @@ static bool _choose_book( item_def& book, int firstbook, int numbooks )
else
keyin = ('a' + Options.prev_book - 1);
}
+ case '%':
+ list_commands('%');
+ return _choose_book(book, firstbook, numbooks);
default:
break;
}
@@ -2301,7 +2305,8 @@ static bool _choose_weapon()
_print_character_info();
textcolor( CYAN );
- cprintf(EOL "You have a choice of weapons:" EOL);
+ cprintf(EOL "You have a choice of weapons: "
+ "(Press %% for a list of aptitudes)" EOL);
bool prevmatch = false;
for (int i = 0; i < num_choices; i++)
@@ -2373,6 +2378,11 @@ static bool _choose_weapon()
keyin = 'a' + i;
}
}
+ case '%':
+ list_commands('%');
+ return _choose_weapon();
+ default:
+ break;
}
}
while (keyin != '*' && keyin != '+'
@@ -3834,10 +3844,10 @@ spec_query:
break;
// access to the help files
case '?':
- list_commands(false, '1');
+ list_commands('1');
return choose_race();
case '%':
- list_commands(false, '%');
+ list_commands('%');
return choose_race();
default:
break;
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index 8176cf067b..b552b652e8 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -3731,7 +3731,7 @@ void display_char_status()
if (you.haloed())
{
- int halo_size = halo_radius();
+ const int halo_size = halo_radius();
if (halo_size > 6)
mpr( "You are illuminated by a large divine halo." );
else if (halo_size > 3)
@@ -3839,6 +3839,13 @@ void display_char_status()
mpr("You are burdened.");
else if (you.burden_state == BS_OVERLOADED)
mpr("You are overloaded with stuff.");
+ else if (you.species == SP_KENKU && you.flight_mode() == FL_FLY)
+ {
+ if (you.travelling_light())
+ mpr("Your small burden allows quick flight.");
+ else
+ mpr("Your heavy burden is slowing your flight.");
+ }
if (you.duration[DUR_SAGE])
mprf("You are studying %s.", skill_name(you.sage_bonus_skill));
@@ -4174,8 +4181,8 @@ std::string species_name(species_type speci, int level, bool genus, bool adj,
{
switch (speci)
{
- case SP_MOUNTAIN_DWARF: res = "Mountain Dwarf"; break;
- default: res = "Dwarf"; break;
+ case SP_MOUNTAIN_DWARF: res = "Mountain Dwarf"; break;
+ default: res = "Dwarf"; break;
}
}
}
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index b5282efd3b..dc0ec7208a 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -690,6 +690,10 @@ std::string get_god_dislikes(god_type which_god, bool /*verbose*/)
dislikes.push_back("cast spells");
break;
+ case GOD_BEOGH:
+ dislikes.push_back("you destroy orcish idols");
+ break;
+
default:
break;
}
@@ -3104,7 +3108,8 @@ bool god_dislikes_item_handling(const item_def &item)
}
}
else if (item.base_type == OBJ_STAVES
- && item.sub_type == STAFF_POISON || item.sub_type == STAFF_VENOM)
+ && (item.sub_type == STAFF_POISON
+ || item.sub_type == STAFF_VENOM))
{
return (true);
}
diff --git a/crawl-ref/source/skills2.cc b/crawl-ref/source/skills2.cc
index 69b6b294ba..53ea25ec97 100644
--- a/crawl-ref/source/skills2.cc
+++ b/crawl-ref/source/skills2.cc
@@ -75,8 +75,9 @@ typedef skill_title_key_t stk;
// Referring to the skill itself is fine ("Transmuter") but not impressive.
// No overlaps, high diversity.
-// Replace @genus@ with lowercase genus, @Genus@ with uppercase, and %s
-// with special cases defined below, including but not limited to species.
+// Replace @Adj@ with uppercase adjective form, @genus@ with lowercase genus,
+// @Genus@ with uppercase genus, and %s with special cases defined below,
+// including but not limited to species.
// NOTE: Even though %s could be used with most of these, remember that
// the character's race will be listed on the next line. It's only really
@@ -88,22 +89,22 @@ const char *skills[50][6] =
// Skill name levels 1-7 levels 8-14 levels 15-20 levels 21-26 level 27
{"Fighting", "Skirmisher", "Fighter", "Warrior", "Slayer", "Conqueror"}, // 0
{"Short Blades", "Cutter", "Slicer", "Swashbuckler", "Blademaster", "Eviscerator"},
- {"Long Blades", "Slasher", "Carver", "Fencer", "@Genus@ Blade", "Swordmaster"},
+ {"Long Blades", "Slasher", "Carver", "Fencer", "@Adj@ Blade", "Swordmaster"},
{NULL}, // 3- was: great swords {dlb}
{"Axes", "Chopper", "Cleaver", "Hacker", "Severer", "Executioner"},
{"Maces & Flails", "Cudgeler", "Basher", "Bludgeoner", "Shatterer", "Skullcrusher"}, // 5
- {"Polearms", "Poker", "Spear-Bearer", "Impaler", "Phalangite", "@Genus@ Porcupine"},
+ {"Polearms", "Poker", "Spear-Bearer", "Impaler", "Phalangite", "@Adj@ Porcupine"},
{"Staves", "Twirler", "Cruncher", "Stickfighter", "Pulveriser", "Chief of Staff"},
- {"Slings", "Vandal", "Slinger", "Whirler", "Slingshot", "@Genus@ Catapult"},
+ {"Slings", "Vandal", "Slinger", "Whirler", "Slingshot", "@Adj@ Catapult"},
{"Bows", "Shooter", "Archer", "Marks@genus@", "Crack Shot", "Merry @Genus@"},
- {"Crossbows", "Bolt Thrower", "Quickloader", "Sharpshooter", "Sniper", "@Genus@ Arbalest"}, // 10
+ {"Crossbows", "Bolt Thrower", "Quickloader", "Sharpshooter", "Sniper", "@Adj@ Arbalest"}, // 10
{"Darts", "Dart Thrower", "Hurler", "Hedgehog", "Darts Champion", "Perforator"},
- {"Throwing", "Chucker", "Thrower", "Deadly Accurate", "Hawkeye", "@Genus@ Ballista"},
+ {"Throwing", "Chucker", "Thrower", "Deadly Accurate", "Hawkeye", "@Adj@ Ballista"},
{"Armour", "Covered", "Protected", "Tortoise", "Impregnable", "Invulnerable"},
{"Dodging", "Ducker", "Nimble", "Spry", "Acrobat", "Intangible"},
{"Stealth", "Sneak", "Covert", "Unseen", "Imperceptible", "Ninja"}, // 15
{"Stabbing", "Miscreant", "Blackguard", "Backstabber", "Cutthroat", "Politician"},
- {"Shields", "Shield-Bearer", "Hoplite", "Blocker", "Peltast", "@Genus@ Barricade"},
+ {"Shields", "Shield-Bearer", "Hoplite", "Blocker", "Peltast", "@Adj@ Barricade"},
{"Traps & Doors", "Scout", "Disarmer", "Vigilant", "Perceptive", "Dungeon Master"},
// STR based fighters, for DEX/martial arts titles see below
{"Unarmed Combat", "Ruffian", "Grappler", "Brawler", "Wrestler", "@Weight@weight Champion"},
@@ -119,7 +120,7 @@ const char *skills[50][6] =
{"Enchantments", "Charm-Maker", "Infuser", "Bewitcher", "Enchanter", "Spellbinder"},
{"Summonings", "Caller", "Summoner", "Convoker", "Demonologist", "Hellbinder"},
{"Necromancy", "Grave Robber", "Reanimator", "Necromancer", "Thanatomancer", "@Genus_Short@ of Death"},
- {"Translocations", "Grasshopper", "Placeless @Genus@", "Blinker", "Portalist", "Plane @Walker@"}, // 30
+ {"Translocations", "Grasshopper", "Placeless @Genus@", "Blinker", "Portalist", "Plane @Walker@"}, // 30
{"Transmigration", "Changer", "Transmogrifier", "Alchemist", "Malleable", "Shapeless @Genus@"},
{"Divinations", "Seer", "Soothsayer", "Diviner", "Augur", "Oracle"},
@@ -1976,6 +1977,11 @@ int str_to_skill(const std::string &skill)
return (SK_FIGHTING);
}
+static std::string _stk_adj_cap()
+{
+ return species_name(Skill_Species, 1, false, true);
+}
+
// [ds] @Genus@ distinguishes between Ogre-Mages and Ogres, but
// @genus@ does not. This is rather confusing.
static std::string _stk_genus_cap()
@@ -2022,7 +2028,7 @@ static std::string _stk_weight()
case SP_DEEP_ELF:
case SP_SLUDGE_ELF:
case SP_KENKU:
- return "Little";
+ return "Light";
case SP_HALFLING:
case SP_GNOME:
@@ -2035,6 +2041,7 @@ static std::string _stk_weight()
}
static skill_title_key_t _skill_title_keys[] = {
+ stk("Adj", _stk_adj_cap),
stk("Genus", _stk_genus_cap),
stk("genus", _stk_genus_nocap),
stk("Genus_Short", _stk_genus_short_cap),
diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc
index efe1e7bb3d..0fba5ac35b 100644
--- a/crawl-ref/source/view.cc
+++ b/crawl-ref/source/view.cc
@@ -3139,7 +3139,7 @@ void show_map( coord_def &spec_place, bool travel_mode )
arrange_features(features);
}
- char min_x = 80, max_x = 0, min_y = 0, max_y = 0;
+ int min_x = GXM, max_x = 0, min_y = 0, max_y = 0;
bool found_y = false;
const int num_lines = _get_number_of_lines_levelmap();
@@ -3534,13 +3534,17 @@ void show_map( coord_def &spec_place, bool travel_mode )
{
// Scrolling only happens when we don't have a large enough
// display to show the known map.
- if (scroll_y < 0 && ((screen_y += scroll_y) <= min_y + half_screen))
- screen_y = min_y + half_screen;
-
- if (scroll_y > 0 && ((screen_y += scroll_y) >= max_y - half_screen))
- screen_y = max_y - half_screen;
-
- scroll_y = 0;
+ if (scroll_y != 0)
+ {
+ const int old_screen_y = screen_y;
+ screen_y += scroll_y;
+ if (scroll_y < 0)
+ screen_y = std::max(screen_y, min_y + half_screen);
+ else
+ screen_y = std::min(screen_y, max_y - half_screen);
+ curs_y -= (screen_y - old_screen_y);
+ scroll_y = 0;
+ }
if (curs_y + move_y < 1)
{