summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-07-03 10:58:08 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-07-03 10:58:08 +0000
commitde61f774d4b9787e998a24d966b45b5a211761dc (patch)
treef841e89492644243d4f5b08e44a2c60d88fea5cc
parent284b3dcc8ae13d9414c8e527e9aa0ebe07921d43 (diff)
downloadcrawl-ref-de61f774d4b9787e998a24d966b45b5a211761dc.tar.gz
crawl-ref-de61f774d4b9787e998a24d966b45b5a211761dc.zip
Made the weapon warning one-off (until you change weapons.)
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1726 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/enum.h4
-rw-r--r--crawl-ref/source/externs.h6
-rw-r--r--crawl-ref/source/fight.cc14
-rw-r--r--crawl-ref/source/item_use.cc3
-rw-r--r--crawl-ref/source/player.cc3
5 files changed, 19 insertions, 11 deletions
diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h
index 0dc20e6ff4..af60786a08 100644
--- a/crawl-ref/source/enum.h
+++ b/crawl-ref/source/enum.h
@@ -932,8 +932,8 @@ enum dragon_class_type
enum game_direction_type
{
- DIR_DESCENDING = 0, // 0 - change and lose savefile compatibility (!!!)
- DIR_ASCENDING = 1 // 1 - change and lose savefile compatibility (!!!)
+ DIR_DESCENDING = 0,
+ DIR_ASCENDING = 1
};
// NOTE: The order of these is very important to their usage!
diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h
index 89bb2b5fd5..a87304947d 100644
--- a/crawl-ref/source/externs.h
+++ b/crawl-ref/source/externs.h
@@ -661,6 +661,7 @@ public:
char hunger_state;
bool wield_change; // redraw weapon
+ bool received_weapon_warning;
unsigned long redraw_status_flags;
@@ -698,7 +699,7 @@ public:
burden_state_type burden_state;
FixedVector<spell_type, 25> spells;
char spell_no;
- game_direction_type char_direction; //
+ game_direction_type char_direction;
unsigned char pet_target;
@@ -1270,7 +1271,6 @@ struct game_state
bool need_save; // Set to true when game has started.
bool saving_game; // Set to true while in save_game.
bool updating_scores; // Set to true while updating hiscores.
- bool shopping; // Set if id has been munged for shopping.
int seen_hups; // Set to true if SIGHUP received.
@@ -1283,7 +1283,7 @@ struct game_state
game_state() : mouse_enabled(false), waiting_for_command(false),
terminal_resized(false), io_inited(false), need_save(false),
- saving_game(false), updating_scores(false), shopping(false),
+ saving_game(false), updating_scores(false),
seen_hups(0), unicode_ok(false), glyph2strfn(NULL),
multibyte_strlen(NULL), terminal_resize_handler(NULL),
terminal_resize_check(NULL)
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc
index f50b52c696..03208d6976 100644
--- a/crawl-ref/source/fight.cc
+++ b/crawl-ref/source/fight.cc
@@ -3194,12 +3194,14 @@ int melee_attack::mons_to_hit()
static void wielded_weapon_check(const item_def *weapon)
{
- if (weapon &&
- (weapon->base_type != OBJ_WEAPONS
- || is_range_weapon(*weapon)))
- {
- mpr("You might want to wield a more suitable implement when attacking monsters.", MSGCH_WARN);
- learned_something_new(TUT_WIELD_WEAPON); // for tutorial Rangers
+ if (you.received_weapon_warning == false &&
+ weapon &&
+ (weapon->base_type != OBJ_WEAPONS || is_range_weapon(*weapon)))
+ {
+ mpr("You might want to wield a more suitable implement when "
+ "attacking monsters.", MSGCH_WARN);
+ learned_something_new(TUT_WIELD_WEAPON); // for tutorial Rangers
+ you.received_weapon_warning = true;
}
}
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index f3544c7acc..2504377b1a 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -204,6 +204,9 @@ bool wield_weapon(bool auto_wield, int slot, bool show_weff_messages)
&& you.inv[item_slot].base_type != OBJ_MISSILES
&& you.inv[item_slot].base_type != OBJ_STAVES;
+ // Reset the warning counter.
+ you.received_weapon_warning = false;
+
// Prompt if not using the auto swap command, or if the swap slot
// is empty.
if (!auto_wield || !is_valid_item(you.inv[item_slot]) || force_unwield)
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index dcf781a9b4..cf8b5819a0 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -4503,6 +4503,9 @@ void player::init()
hunger = 6000;
hunger_state = HS_SATIATED;
+ wield_change = false;
+ received_weapon_warning = false;
+
gold = 0;
// speed = 10; // 0.75; // unused