summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-22 21:57:35 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-22 21:57:35 +0000
commitea78e3b88da2c70285b09f34c9c5d8230280405b (patch)
treeb4de694fd30792e67bf1ebde5e3f770794992949 /crawl-ref
parentf7cb474e41b75c37273b79d4fe5e7e24da81950d (diff)
downloadcrawl-ref-ea78e3b88da2c70285b09f34c9c5d8230280405b.tar.gz
crawl-ref-ea78e3b88da2c70285b09f34c9c5d8230280405b.zip
Swap '.' and '!' in the targetting interface.
Forbid bats wearing hats/caps or rings. (That makes amulets the only type of equipment Vampires can keep on when transforming.) To make up for it, increase their damage stats again. Also fix it being possible to (un)equip the allowed items in Tiles while in bat form. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6055 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/docs/crawl_manual.txt13
-rw-r--r--crawl-ref/settings/init.txt2
-rw-r--r--crawl-ref/source/acr.cc20
-rw-r--r--crawl-ref/source/command.cc4
-rw-r--r--crawl-ref/source/database.cc6
-rw-r--r--crawl-ref/source/database.h2
-rw-r--r--crawl-ref/source/directn.cc4
-rw-r--r--crawl-ref/source/fight.cc4
-rw-r--r--crawl-ref/source/item_use.cc39
-rw-r--r--crawl-ref/source/message.cc22
-rw-r--r--crawl-ref/source/religion.cc14
-rw-r--r--crawl-ref/source/transfor.cc9
-rw-r--r--crawl-ref/source/xom.cc7
13 files changed, 87 insertions, 59 deletions
diff --git a/crawl-ref/docs/crawl_manual.txt b/crawl-ref/docs/crawl_manual.txt
index f4f1216157..88e9bb806a 100644
--- a/crawl-ref/docs/crawl_manual.txt
+++ b/crawl-ref/docs/crawl_manual.txt
@@ -1016,12 +1016,13 @@ screen. Else, you use the following commands:
nearer to further away. Similarly, '-' cycles backwards.
- Any direction key moves the cursor by one square. Occasionally, it
can be useful to target non-inhabited squares.
- - When you are content with your choice of target, press one of '.'
- (period), Del, Enter, or Space to fire at the target. If you press
- '!', you also fire, but the spell/missile will stop at the target's
- square if it misses. This can be useful to keep friendlies out of the
- fire, and is also the only way to attack submerged creatures. You can
- press Escape if you changed your mind - no turns are deducted.
+ - When you are content with your choice of target, press one of '!'
+ Del, Enter, or Space to fire at the target. If you press '.'
+ (period), you also fire, but the spell/missile will stop at the
+ target's square if it misses. This can be useful to keep friendlies
+ out of the fire, and is also the only way to attack submerged
+ creatures. You can press Escape if you changed your mind - no turns
+ are deducted.
There are some shortcuts while targeting:
- Typing Shift-direction on your keypad fires straight away in that
diff --git a/crawl-ref/settings/init.txt b/crawl-ref/settings/init.txt
index 84dead9dcc..19252434d2 100644
--- a/crawl-ref/settings/init.txt
+++ b/crawl-ref/settings/init.txt
@@ -277,7 +277,7 @@ menu_colour = notes:white:Reached XP level
# message_colour = mute:(HP|Magic) restored
# message_colour = mute:warning:Not with.*(in view|monsters around)
-# You can also enforce a -more- prompt for messages
+# You can also enforce a --more-- prompt for messages
# force_more_message = You are starting to lose your buoyancy
##### 4-k Firing Commands #######################
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc
index 067db5d042..58ce26362c 100644
--- a/crawl-ref/source/acr.cc
+++ b/crawl-ref/source/acr.cc
@@ -1856,8 +1856,9 @@ void process_command( command_type cmd )
case CMD_REST:
if (i_feel_safe())
{
- if ( you.hp == you.hp_max
- && you.magic_points == you.max_magic_points )
+ if ((you.hp == you.hp_max || you.species == SP_VAMPIRE
+ && you.hunger_state == HS_STARVING)
+ && you.magic_points == you.max_magic_points )
{
mpr("You start searching.");
}
@@ -2075,6 +2076,11 @@ void process_command( command_type cmd )
case CMD_REMOVE_ARMOUR:
{
+ if (you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT)
+ {
+ mpr("You can't wear or remove anything in your present form.");
+ break;
+ }
int index = 0;
if (armour_prompt("Take off which item?", &index, OPER_TAKEOFF))
@@ -2083,20 +2089,10 @@ void process_command( command_type cmd )
break;
case CMD_REMOVE_JEWELLERY:
- if (you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT)
- {
- canned_msg(MSG_PRESENT_FORM);
- break;
- }
remove_ring();
break;
case CMD_WEAR_JEWELLERY:
- if (you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT)
- {
- canned_msg(MSG_PRESENT_FORM);
- break;
- }
puton_ring(-1, false);
break;
diff --git a/crawl-ref/source/command.cc b/crawl-ref/source/command.cc
index b105afd8eb..a50b5d0ac7 100644
--- a/crawl-ref/source/command.cc
+++ b/crawl-ref/source/command.cc
@@ -733,8 +733,8 @@ static const char *targeting_help_1 =
"<h>Targeting (zapping wands, casting spells, etc.):\n"
"The keys from examine surroundings also work here.\n"
"In addition, you can use:\n"
- "<w>.</w> : fire at target (<w>Enter</w>, <w>Del</w>, <w>Space</w>)\n"
- "<w>!</w> : fire at target and stop there (may hit submerged creatures)\n"
+ "<w>!</w> : fire at target (<w>Enter</w>, <w>Del</w>, <w>Space</w>)\n"
+ "<w>.</w> : fire at target and stop there (may hit submerged creatures)\n"
"<w>p</w> : fire at Previous target (also <w>f</w>)\n"
"<w>:</w> : show/hide beam path\n"
"<w>Shift-Dir</w> : shoot straight-line beam\n"
diff --git a/crawl-ref/source/database.cc b/crawl-ref/source/database.cc
index 254b800b57..f60a8b59eb 100644
--- a/crawl-ref/source/database.cc
+++ b/crawl-ref/source/database.cc
@@ -654,7 +654,7 @@ std::string getShoutString(const std::string &monst,
/////////////////////////////////////////////////////////////////////////////
// Speak DB specific functions.
-std::string getSpeakString(const std::string &monst)
+std::string getSpeakString(const std::string &key)
{
if (!SpeakDB)
return ("");
@@ -662,9 +662,9 @@ std::string getSpeakString(const std::string &monst)
int num_replacements = 0;
#ifdef DEBUG_MONSPEAK
- mprf(MSGCH_DIAGNOSTICS, "monster speech lookup for %s", monst.c_str());
+ mprf(MSGCH_DIAGNOSTICS, "monster speech lookup for %s", key.c_str());
#endif
- return _getRandomizedStr(SpeakDB, monst, "", num_replacements);
+ return _getRandomizedStr(SpeakDB, key, "", num_replacements);
}
/////////////////////////////////////////////////////////////////////////////
diff --git a/crawl-ref/source/database.h b/crawl-ref/source/database.h
index 138a7fe0b2..9a5c44e9ba 100644
--- a/crawl-ref/source/database.h
+++ b/crawl-ref/source/database.h
@@ -60,7 +60,7 @@ std::vector<std::string> getLongDescBodiesByRegex(const std::string &regex,
std::string getShoutString(const std::string &monst,
const std::string &suffix = "");
-std::string getSpeakString(const std::string &monst);
+std::string getSpeakString(const std::string &key);
std::string getRandNameString(const std::string &itemtype,
const std::string &suffix = "");
std::string getHelpString(const std::string &topic);
diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc
index 6e395a802a..e84c8d8319 100644
--- a/crawl-ref/source/directn.cc
+++ b/crawl-ref/source/directn.cc
@@ -2524,10 +2524,10 @@ command_type targeting_behaviour::get_command(int key)
case CONTROL('C'): return CMD_TARGET_CYCLE_BEAM;
#endif
case ':': return CMD_TARGET_HIDE_BEAM;
+ case '!': return CMD_TARGET_SELECT;
case '\r': return CMD_TARGET_SELECT;
- case '.': return CMD_TARGET_SELECT;
case '5': return CMD_TARGET_SELECT;
- case '!': return CMD_TARGET_SELECT_ENDPOINT;
+ case '.': return CMD_TARGET_SELECT_ENDPOINT;
case '\\':
case '\t': return CMD_TARGET_FIND_PORTAL;
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc
index 2b1e89e019..1c702548ac 100644
--- a/crawl-ref/source/fight.cc
+++ b/crawl-ref/source/fight.cc
@@ -3038,7 +3038,7 @@ int melee_attack::player_calc_base_unarmed_damage()
damage = 5;
break;
case TRAN_BAT:
- damage = (you.species == SP_VAMPIRE ? 1 : coinflip());
+ damage = (you.species == SP_VAMPIRE ? 2 : 1);
break;
case TRAN_ICE_BEAST:
damage = 12;
@@ -3075,7 +3075,7 @@ int melee_attack::player_calc_base_unarmed_damage()
if (you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT)
{
// Bats really don't do a lot of damage.
- damage += random2(you.skills[SK_UNARMED_COMBAT]/5 + 1);
+ damage += you.skills[SK_UNARMED_COMBAT]/5;
}
else
damage += you.skills[SK_UNARMED_COMBAT];
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index e462ffb936..6390e5b743 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -101,10 +101,11 @@ bool can_wield(const item_def *weapon, bool say_reason,
SAY(canned_msg(MSG_TOO_BERSERK));
return false;
}
+
if (!can_equip( EQ_WEAPON, ignore_temporary_disability ))
{
SAY(mpr("You can't wield anything in your present form."));
- return false;
+ return (false);
}
if (!ignore_temporary_disability
@@ -113,7 +114,7 @@ bool can_wield(const item_def *weapon, bool say_reason,
&& item_cursed( you.inv[you.equip[EQ_WEAPON]] ))
{
SAY(mpr("You can't unwield your weapon to draw a new one!"));
- return false;
+ return (false);
}
// If we don't have an actual weapon to check, return now.
@@ -818,6 +819,12 @@ static bool cloak_is_being_removed( void )
//---------------------------------------------------------------
void wear_armour( int slot ) // slot is for tiles
{
+ if (you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT)
+ {
+ mpr("You can't wear anything in your present form.");
+ return;
+ }
+
int armour_wear_2 = 0;
if (slot != -1)
@@ -2848,7 +2855,9 @@ static int prompt_ring_to_remove(int new_ring)
int c;
do
+ {
c = getch();
+ }
while (c != lslot && c != rslot && c != ESCAPE && c != ' ');
mesclr();
@@ -3072,6 +3081,12 @@ bool puton_item(int item_slot, bool prompt_finger)
bool puton_ring(int slot, bool prompt_finger)
{
+ if (you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT)
+ {
+ mpr("You can't put on anything in your present form.");
+ return (false);
+ }
+
int item_slot;
if (inv_count() < 1)
@@ -3186,6 +3201,12 @@ void jewellery_remove_effects(item_def &item)
bool remove_ring(int slot, bool announce)
{
+ if (you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT)
+ {
+ mpr("You can't wear or remove anything in your present form.");
+ return (false);
+ }
+
equipment_type hand_used = EQ_NONE;
int ring_wear_2;
@@ -4804,26 +4825,34 @@ void tile_use_item(int idx, InvAction act)
// Use it
const int type = item.base_type;
+/*
+ if ((type == OBJ_ARMOUR || type == OBJ_JEWELLERY)
+ && you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT)
+ {
+ canned_msg(MSG_PRESENT_FORM);
+ return;
+ }
+*/
switch (type)
{
case OBJ_WEAPONS:
case OBJ_STAVES:
case OBJ_MISCELLANY:
- // wield any unwielded item of these types
+ // Wield any unwielded item of these types.
if (!equipped)
{
if (check_warning_inscriptions(item, OPER_WIELD))
wield_weapon(true, idx);
return;
}
- // evoke misc. items and rods
+ // Evoke misc. items and rods.
if (type == OBJ_MISCELLANY || item_is_rod(item))
{
if (check_warning_inscriptions(item, OPER_EVOKE))
evoke_wielded();
return;
}
- // unwield staves or weapons
+ // Unwield staves or weapons.
if (check_warning_inscriptions(item, OPER_WIELD))
wield_weapon(true, PROMPT_GOT_SPECIAL); // unwield
return;
diff --git a/crawl-ref/source/message.cc b/crawl-ref/source/message.cc
index dfc4baad0c..46d1e2b4dd 100644
--- a/crawl-ref/source/message.cc
+++ b/crawl-ref/source/message.cc
@@ -424,7 +424,6 @@ void mpr(const char *inf, msg_channel_type channel, int param)
return;
}
-
char mbuf[400];
size_t i = 0;
const int stepsize = get_number_of_cols() - 1;
@@ -434,24 +433,26 @@ void mpr(const char *inf, msg_channel_type channel, int param)
// If a message is exactly STEPSIZE characters long,
// it should precisely fit in one line. The printing is thus
// from I to I + STEPSIZE - 1. Stop when I reaches MSGLEN.
- while ( i < msglen || i == 0 )
+ while (i < msglen || i == 0)
{
strncpy( mbuf, inf + i, stepsize );
mbuf[stepsize] = 0;
// Did the message break?
- if ( i + stepsize < msglen )
+ if (i + stepsize < msglen)
{
// Aes, find a nicer place to break it.
int lookback, where = 0;
- for ( lookback = 0; lookback < lookback_size; ++lookback )
+ for (lookback = 0; lookback < lookback_size; ++lookback)
{
where = stepsize - 1 - lookback;
- if ( where >= 0 && isspace(mbuf[where]) )
+ if (where >= 0 && isspace(mbuf[where]))
+ {
// aha!
break;
+ }
}
- if ( lookback != lookback_size )
+ if (lookback != lookback_size)
{
// Found a good spot to break.
mbuf[where] = 0;
@@ -463,7 +464,7 @@ void mpr(const char *inf, msg_channel_type channel, int param)
else
i += stepsize;
- base_mpr( mbuf, channel, param );
+ base_mpr(mbuf, channel, param);
}
}
@@ -658,6 +659,7 @@ static int prepare_message(const std::string& imsg, msg_channel_type channel,
if (New_Message_Count == num_lines - 1)
more();
}
+
return colour;
}
@@ -710,9 +712,9 @@ static void mpr_formatted_output(formatted_string fs, int colour)
need_prefix = false;
}
- for ( unsigned i = 0; i < fs.ops.size(); ++i )
+ for (unsigned i = 0; i < fs.ops.size(); ++i)
{
- switch ( fs.ops[i].type )
+ switch (fs.ops[i].type)
{
case FSOP_COLOUR:
colour = fs.ops[i].x;
@@ -726,7 +728,7 @@ static void mpr_formatted_output(formatted_string fs, int colour)
break;
}
}
- message_out( Message_Line, colour, "", Options.delay_message_clear? 2 : 1);
+ message_out(Message_Line, colour, "", Options.delay_message_clear? 2 : 1);
}
// Line wrapping is not available here!
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index 01dbc8d09d..b9b2a994ae 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -2150,8 +2150,8 @@ god_type string_to_god(const char *name)
void god_speaks( god_type god, const char *mesg )
{
- mpr( mesg, MSGCH_GOD, god );
-} // end god_speaks()
+ mpr(mesg, MSGCH_GOD, god);
+}
// This function is the merger of done_good() and naughty().
// Returns true if god was interested (good or bad) in conduct.
@@ -2808,8 +2808,10 @@ static void _dock_piety(int piety_loss, int penance)
else if (penance) // only if still in religion
{
if (last_penance_lecture != you.num_turns)
+ {
god_speaks(you.religion,
"\"You will pay for your transgression, mortal!\"");
+ }
last_penance_lecture = you.num_turns;
_inc_penance(penance);
}
@@ -2902,7 +2904,7 @@ void gain_piety(int pgn)
const char first = pmsg[0];
if ( first )
{
- if ( isupper(first) )
+ if (isupper(first))
god_speaks(you.religion, pmsg);
else
{
@@ -3244,9 +3246,9 @@ void lose_piety(int pgn)
{
const char* pmsg = god_lose_power_messages[you.religion][i];
const char first = pmsg[0];
- if ( first )
+ if (first)
{
- if ( isupper(first) )
+ if (isupper(first))
god_speaks(you.religion, pmsg);
else
{
@@ -3255,7 +3257,7 @@ void lose_piety(int pgn)
}
}
- if ( _need_water_walking() && !beogh_water_walk() )
+ if (_need_water_walking() && !beogh_water_walk())
{
fall_into_a_pool( you.x_pos, you.y_pos, true,
grd[you.x_pos][you.y_pos] );
diff --git a/crawl-ref/source/transfor.cc b/crawl-ref/source/transfor.cc
index 2eaaf8ff4b..b27ad87854 100644
--- a/crawl-ref/source/transfor.cc
+++ b/crawl-ref/source/transfor.cc
@@ -50,12 +50,9 @@ static void _init_equipment_removal(std::set<equipment_type> &rem_stuff,
break;
case TRAN_BAT:
- // Bats CAN wear soft helmets.
- if (you.equip[EQ_HELMET] == -1
- || !is_hard_helmet(you.inv[you.equip[EQ_HELMET]]))
- {
- rem_stuff.erase(EQ_HELMET);
- }
+ // Bats can't wear rings.
+ rem_stuff.insert(EQ_LEFT_RING);
+ rem_stuff.insert(EQ_RIGHT_RING);
break;
case TRAN_ICE_BEAST:
diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc
index a933a075a3..8a27691849 100644
--- a/crawl-ref/source/xom.cc
+++ b/crawl-ref/source/xom.cc
@@ -117,10 +117,11 @@ static const char* _get_xom_speech(const std::string key)
if (result.empty())
result = getSpeakString("Xom general effect");
- if (!result.empty())
- return (result.c_str());
+ if (result.empty())
+ return ("Xom makes something happen.");
- return ("Xom makes something happen.");
+// mprf(MSGCH_DIAGNOSTICS, "Xom speech result: %s", result.c_str());
+ return (result.c_str());
}
static void _xom_is_stimulated(int maxinterestingness,