summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-04 23:57:21 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-04 23:57:21 +0000
commit288e44e2590d8791f0841a70ef50108582990278 (patch)
tree558d104f241393407765b96b89e6ac69b726af50 /crawl-ref
parent763ef75bd1f9c97c9f1ebee467bde287f156f483 (diff)
downloadcrawl-ref-288e44e2590d8791f0841a70ef50108582990278.tar.gz
crawl-ref-288e44e2590d8791f0841a70ef50108582990278.zip
Another one with a multitude of (smallish) changes.
- Fixed 1788033, 1787436, 1782862. - Modified basename, so it's a bit more useful and it's seeing use when not switching back during butcher. - Mummy Wanderers won't get a potion. - NOTE_XP_LEVEL_CHANGE notes "real" hp/mp. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2055 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/abl-show.cc2
-rw-r--r--crawl-ref/source/delay.cc11
-rw-r--r--crawl-ref/source/item_use.cc3
-rw-r--r--crawl-ref/source/itemname.cc40
-rw-r--r--crawl-ref/source/newgame.cc3
-rw-r--r--crawl-ref/source/player.cc18
-rw-r--r--crawl-ref/source/skills2.cc11
-rw-r--r--crawl-ref/source/skills2.h4
-rw-r--r--crawl-ref/source/spells3.cc1
9 files changed, 66 insertions, 27 deletions
diff --git a/crawl-ref/source/abl-show.cc b/crawl-ref/source/abl-show.cc
index 52277fdbad..ecbe9d0589 100644
--- a/crawl-ref/source/abl-show.cc
+++ b/crawl-ref/source/abl-show.cc
@@ -172,7 +172,7 @@ static const ability_def Ability_List[] =
{ ABIL_BREATHE_STEAM, "Breathe Steam", 0, 0, 75, 0, ABFLAG_BREATH },
{ ABIL_TRAN_BAT, "Bat Form", 2, 0, 25, 0, ABFLAG_NONE },
- { ABIL_SPIT_ACID, "Spit Acid", 0, 0, 125, 0, ABFLAG_BREATH },
+ { ABIL_SPIT_ACID, "Spit Acid", 0, 0, 125, 0, ABFLAG_NONE },
{ ABIL_FLY, "Fly", 3, 0, 100, 0, ABFLAG_NONE },
{ ABIL_SUMMON_MINOR_DEMON, "Summon Minor Demon", 3, 3, 75, 0, ABFLAG_NONE },
diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc
index 1638195697..56940a6726 100644
--- a/crawl-ref/source/delay.cc
+++ b/crawl-ref/source/delay.cc
@@ -158,15 +158,18 @@ void stop_delay( void )
// until it is done... it merely chains up individual actions
// into a single action. -- bwr
clear_pending_delays();
-
+
switch (delay.type)
{
case DELAY_BUTCHER:
// Corpse keeps track of work in plus2 field, see handle_delay() -- bwr
if (butcher_swap_warn)
- mpr("You stop butchering the corpse; not switching back to "
- "primary weapon.",
- MSGCH_WARN);
+ {
+ int swapwpn = you.delay_queue[1].parm1;
+ mprf(MSGCH_WARN, "You stop butchering the corpse; not switching "
+ "back to your %s.",
+ you.inv[swapwpn].name(DESC_BASENAME).c_str());
+ }
else
mpr( "You stop butchering the corpse." );
pop_delay();
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index 949f174fe4..463dd1413f 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -1141,8 +1141,7 @@ static bool fire_item_matches(const item_def &item, unsigned fire_type)
{
if ((fire_type & FIRE_DART) && item.sub_type == MI_DART)
return (true);
- if ((fire_type & FIRE_STONE)
- && (item.sub_type == MI_STONE || item.sub_type == MI_SLING_BULLET))
+ if ((fire_type & FIRE_STONE) && item.sub_type == MI_STONE)
return (true);
if ((fire_type & FIRE_JAVELIN) && item.sub_type == MI_JAVELIN)
return (true);
diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc
index 400a77da24..1c13c750ae 100644
--- a/crawl-ref/source/itemname.cc
+++ b/crawl-ref/source/itemname.cc
@@ -1019,8 +1019,11 @@ std::string item_def::name_aux( description_level_type desc,
if (know_type && !terse &&
(get_weapon_brand(*this) == SPWPN_VAMPIRICISM))
buff << "vampiric ";
-
- buff << item_base_name(*this);
+ }
+ buff << item_base_name(*this);
+
+ if (!basename)
+ {
if ( know_type )
buff << weapon_brand_name(*this, terse);
@@ -1152,6 +1155,11 @@ std::string item_def::name_aux( description_level_type desc,
break;
case OBJ_WANDS:
+ if (basename)
+ {
+ buff << "wand";
+ break;
+ }
if (know_type)
{
buff << "wand of " << wand_type_name(item_typ);
@@ -1174,6 +1182,11 @@ std::string item_def::name_aux( description_level_type desc,
break;
case OBJ_POTIONS:
+ if (basename)
+ {
+ buff << "potion";
+ break;
+ }
if (know_type)
{
buff << "potion of " << potion_type_name(item_typ);
@@ -1248,7 +1261,11 @@ std::string item_def::name_aux( description_level_type desc,
break;
case OBJ_SCROLLS:
- buff << "scroll ";
+ buff << "scroll";
+ if (basename)
+ break;
+ else
+ buff << " ";
if (know_type)
{
@@ -1268,9 +1285,9 @@ std::string item_def::name_aux( description_level_type desc,
if (basename)
{
if ( jewellery_is_amulet(*this) )
- buff << " amulet";
+ buff << "amulet";
else // i.e., an amulet
- buff << " ring";
+ buff << "ring";
break;
}
@@ -1343,6 +1360,11 @@ std::string item_def::name_aux( description_level_type desc,
{
if ( is_deck(*this) )
{
+ if (basename)
+ {
+ buff << "deck of cards";
+ break;
+ }
buff << deck_rarity_name(deck_rarity(*this)) << ' ';
}
buff << misc_type_name(item_typ, know_type);
@@ -1380,15 +1402,17 @@ std::string item_def::name_aux( description_level_type desc,
case OBJ_STAVES:
if (!know_type)
{
- buff << staff_primary_string(this->special) << " "
- << (item_is_rod( *this ) ? "rod" : "staff");
+ if (!basename)
+ buff << staff_primary_string(this->special) << " ";
+
+ buff << (item_is_rod( *this ) ? "rod" : "staff");
}
else
{
buff << (item_is_rod( *this ) ? "rod" : "staff")
<< " of " << staff_type_name(item_typ);
- if (item_is_rod(*this))
+ if (item_is_rod(*this) && !basename)
{
buff << " (" << (this->plus / ROD_CHARGE_MULT)
<< "/" << (this->plus2 / ROD_CHARGE_MULT)
diff --git a/crawl-ref/source/newgame.cc b/crawl-ref/source/newgame.cc
index ac86dfed9f..0669a91ed8 100644
--- a/crawl-ref/source/newgame.cc
+++ b/crawl-ref/source/newgame.cc
@@ -2868,6 +2868,9 @@ static void create_wanderer( void )
you.equip[EQ_WEAPON] = 0;
you.equip[EQ_BODY_ARMOUR] = 2;
+
+ if (you.species == SP_MUMMY)
+ you.inv[3].quantity = 0; // remove potion
}
static job_type letter_to_class(int keyn)
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index b6b43e2d62..42b1138904 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -3008,16 +3008,24 @@ void level_change(bool skip_ability_increase)
if (you.magic_points < 0)
you.magic_points = 0;
+ if (Options.use_notes)
+ {
+ // calculate "real" values for note-taking, i.e. ignore Berserk,
+ // transformations or equipped items
+ calc_hp(true);
+ calc_mp(true);
+
+ char buf[200];
+ sprintf(buf, "HP: %d/%d MP: %d/%d",
+ you.hp, you.hp_max, you.magic_points, you.max_magic_points);
+ take_note(Note(NOTE_XP_LEVEL_CHANGE, you.experience_level, 0, buf));
+ }
+ // recalculate for game
calc_hp();
calc_mp();
if (you.experience_level > you.max_level)
you.max_level = you.experience_level;
-
- char buf[200];
- sprintf(buf, "HP: %d/%d MP: %d/%d",
- you.hp, you.hp_max, you.magic_points, you.max_magic_points);
- take_note(Note(NOTE_XP_LEVEL_CHANGE, you.experience_level, 0, buf));
xom_is_stimulated(16);
diff --git a/crawl-ref/source/skills2.cc b/crawl-ref/source/skills2.cc
index 50ebe1228d..157580c3ee 100644
--- a/crawl-ref/source/skills2.cc
+++ b/crawl-ref/source/skills2.cc
@@ -2170,7 +2170,7 @@ void init_skill_order( void )
}
}
-int calc_hp(void)
+int calc_hp(bool real_hp)
{
int hitp;
@@ -2178,14 +2178,14 @@ int calc_hp(void)
hitp += (you.experience_level * you.skills[SK_FIGHTING]) / 5;
// being berserk makes you resistant to damage. I don't know why.
- if (you.duration[DUR_BERSERKER])
+ if (you.duration[DUR_BERSERKER] && !real_hp)
{
hitp *= 15;
hitp /= 10;
}
// some transformations give you extra hp
- switch (you.attribute[ATTR_TRANSFORMATION])
+ switch (you.attribute[ATTR_TRANSFORMATION] && !real_hp)
{
case TRAN_STATUE:
hitp *= 15;
@@ -2213,7 +2213,7 @@ int calc_hp(void)
} // end calc_hp()
-int calc_mp(void)
+int calc_mp(bool real_mp)
{
int enp;
@@ -2240,7 +2240,8 @@ int calc_mp(void)
you.max_magic_points = 50;
// now applied after scaling so that power items are more useful -- bwr
- you.max_magic_points += player_magical_power();
+ if (!real_mp)
+ you.max_magic_points += player_magical_power();
if (you.max_magic_points > 50)
you.max_magic_points = 50 + ((you.max_magic_points - 50) / 2);
diff --git a/crawl-ref/source/skills2.h b/crawl-ref/source/skills2.h
index ff792e0181..8618d6ee76 100644
--- a/crawl-ref/source/skills2.h
+++ b/crawl-ref/source/skills2.h
@@ -55,7 +55,7 @@ void init_skill_order( void );
/* ***********************************************************************
* called from: acr - it_use2 - item_use - newgame - ouch - player - skills
* *********************************************************************** */
-int calc_mp(void);
+int calc_mp(bool real_mp = false);
// last_updated 24may2000 {dlb}
@@ -63,7 +63,7 @@ int calc_mp(void);
* called from: ability - acr - food - it_use2 - misc - mutation -
* newgame - ouch - player - skills - spells1 - transfor
* *********************************************************************** */
-int calc_hp(void);
+int calc_hp(bool real_hp = false);
// last_updated 24may2000 {dlb}
diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc
index 8d31bab77b..694d429888 100644
--- a/crawl-ref/source/spells3.cc
+++ b/crawl-ref/source/spells3.cc
@@ -482,6 +482,7 @@ void dancing_weapon(int pow, bool force_hostile)
menv[summs].inv[MSLOT_WEAPON] = i;
menv[summs].colour = mitm[i].colour;
+ burden_change();
} // end dancing_weapon()
static bool monster_on_level(int monster)