diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-01-09 17:27:13 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-01-09 17:27:13 +0000 |
commit | 340eb55f6f4e86a27ae17457d04d81ca52c17e6f (patch) | |
tree | 32b3d924f5feda39cee37eb4139e21f541ffb819 /crawl-ref | |
parent | 5698a4093e17ffde7c118393b221830c1b29dd94 (diff) | |
download | crawl-ref-340eb55f6f4e86a27ae17457d04d81ca52c17e6f.tar.gz crawl-ref-340eb55f6f4e86a27ae17457d04d81ca52c17e6f.zip |
List quiver in status section like you do for the hand weapon.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3234 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/source/acr.cc | 3 | ||||
-rw-r--r-- | crawl-ref/source/command.cc | 3 | ||||
-rw-r--r-- | crawl-ref/source/externs.h | 1 | ||||
-rw-r--r-- | crawl-ref/source/it_use2.cc | 3 | ||||
-rw-r--r-- | crawl-ref/source/item_use.cc | 4 | ||||
-rw-r--r-- | crawl-ref/source/itemprop.cc | 4 | ||||
-rw-r--r-- | crawl-ref/source/items.cc | 7 | ||||
-rw-r--r-- | crawl-ref/source/output.cc | 31 | ||||
-rw-r--r-- | crawl-ref/source/player.cc | 1 | ||||
-rw-r--r-- | crawl-ref/source/spells3.cc | 6 | ||||
-rw-r--r-- | crawl-ref/source/stuff.cc | 1 | ||||
-rw-r--r-- | crawl-ref/source/transfor.cc | 1 |
12 files changed, 59 insertions, 6 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index a5c7e4ed7b..ada4a177c9 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -823,6 +823,7 @@ static void handle_wizard_command( void ) } } you.wield_change = true; + you.quiver_change = true; break; case 'I': @@ -838,6 +839,7 @@ static void handle_wizard_command( void ) } } you.wield_change = true; + you.quiver_change = true; // Forget things that nearby monsters are carrying, as well // (for use with the "give monster an item" wizard targetting @@ -3669,6 +3671,7 @@ static bool initialise(void) you.redraw_experience = true; you.redraw_gold = true; you.wield_change = true; + you.quiver_change = true; you.start_time = time( NULL ); // start timer on session diff --git a/crawl-ref/source/command.cc b/crawl-ref/source/command.cc index 3f1d62435a..afc561d7eb 100644 --- a/crawl-ref/source/command.cc +++ b/crawl-ref/source/command.cc @@ -161,7 +161,10 @@ void swap_inv_slots(int from_slot, int to_slot, bool verbose) } if (to_slot == you.equip[EQ_WEAPON] || from_slot == you.equip[EQ_WEAPON]) + { you.wield_change = true; + you.quiver_change = true; + } } static void adjust_item(void) diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h index dd382f2aa4..c6e372094e 100644 --- a/crawl-ref/source/externs.h +++ b/crawl-ref/source/externs.h @@ -603,6 +603,7 @@ public: char hunger_state; bool wield_change; // redraw weapon + bool quiver_change; // redraw quiver bool received_weapon_warning; unsigned long redraw_status_flags; diff --git a/crawl-ref/source/it_use2.cc b/crawl-ref/source/it_use2.cc index 5ee28cd004..daa3f14ab9 100644 --- a/crawl-ref/source/it_use2.cc +++ b/crawl-ref/source/it_use2.cc @@ -371,6 +371,7 @@ bool unwield_item(bool showMsgs) you.equip[EQ_WEAPON] = -1; you.special_wield = SPWLD_NONE; you.wield_change = true; + you.quiver_change = true; item_def &item(you.inv[unw]); @@ -492,7 +493,7 @@ bool unwield_item(bool showMsgs) if (item.base_type == OBJ_STAVES && item.sub_type == STAFF_POWER) { calc_mp(); - mpr("You fell your mana capacity decrease."); + mpr("You feel your mana capacity decrease."); } return (true); diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index c3a546b013..84009cc8d5 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -288,6 +288,7 @@ bool wield_weapon(bool auto_wield, int slot, bool show_weff_messages) you.time_taken /= 2; you.wield_change = true; + you.quiver_change = true; you.turn_is_over = true; return (true); @@ -1459,7 +1460,10 @@ static bool choose_fire_target(dist &target, int &item) { item = beh.item; if (you.inv[beh.item].quantity > 1) + { you.quiver = beh.item; + you.quiver_change = true; + } } return (true); diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc index f7c386ae1f..ff70a00594 100644 --- a/crawl-ref/source/itemprop.cc +++ b/crawl-ref/source/itemprop.cc @@ -469,8 +469,10 @@ void do_curse_item( item_def &item ) } xom_is_stimulated(amusement); } - + item.flags |= ISFLAG_CURSED; + + you.quiver_change = true; // potentially affected } void do_uncurse_item( item_def &item ) diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc index d5346e87c6..d43d325278 100644 --- a/crawl-ref/source/items.cc +++ b/crawl-ref/source/items.cc @@ -240,6 +240,9 @@ bool dec_inv_item_quantity( int obj, int amount ) if (you.equip[EQ_WEAPON] == obj) you.wield_change = true; + if (you.quiver == obj) + you.quiver_change = true; + if (you.inv[obj].quantity <= amount) { for (int i = 0; i < NUM_EQUIP; i++) @@ -308,6 +311,9 @@ void inc_inv_item_quantity( int obj, int amount ) { if (you.equip[EQ_WEAPON] == obj) you.wield_change = true; + + if (you.quiver == obj) + you.quiver_change = true; you.inv[obj].quantity += amount; burden_change(); @@ -1559,6 +1565,7 @@ int move_item_to_player( int obj, int quant_got, bool quiet ) item.quantity = quant_got; dec_mitm_item_quantity( obj, quant_got ); + you.quiver_change = true; burden_change(); if (!quiet) diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc index 7003483091..f527dfec17 100644 --- a/crawl-ref/source/output.cc +++ b/crawl-ref/source/output.cc @@ -31,6 +31,7 @@ #include "itemname.h" #include "itemprop.h" #include "items.h" +#include "item_use.h" #include "menu.h" #include "message.h" #include "ouch.h" @@ -392,6 +393,32 @@ void print_stats(void) you.wield_change = false; } + if (you.quiver_change) + { + gotoxy(1, 14, GOTO_STAT); + clear_to_end_of_line(); + gotoxy(1, 14, GOTO_STAT); + + you.quiver = get_fire_item_index(); + + if (you.quiver == ENDOFPACK) + cprintf("Nothing quivered"); + else + { + const item_def& quiver = you.inv[you.quiver]; + textcolor(quiver.colour); + + const std::string prefix = menu_colour_item_prefix(quiver); + const int prefcol = menu_colour(quiver.name(DESC_INVENTORY), prefix); + if (prefcol != -1) + textcolor(prefcol); + + cprintf("%s", quiver.name(DESC_INVENTORY, true).substr(0,38).c_str()); + textcolor(LIGHTGREY); + } + you.quiver_change = false; + } + // The colour scheme for these flags is currently: // // - yellow, "orange", red for bad conditions @@ -402,9 +429,9 @@ void print_stats(void) if (you.redraw_status_flags & REDRAW_LINE_1_MASK) { - gotoxy(1, 14, GOTO_STAT); + gotoxy(1, 15, GOTO_STAT); clear_to_end_of_line(); - gotoxy(1, 14, GOTO_STAT); + gotoxy(1, 15, GOTO_STAT); switch (you.burden_state) { diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index bc8348e39f..ed1f96de09 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -5260,6 +5260,7 @@ void player::init() hunger_state = HS_SATIATED; wield_change = false; + quiver_change = false; received_weapon_warning = false; gold = 0; diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc index aa0a62dcf8..45d130daff 100644 --- a/crawl-ref/source/spells3.cc +++ b/crawl-ref/source/spells3.cc @@ -981,7 +981,11 @@ void cast_poison_ammo(void) { mprf("%s %s covered in a thin film of poison.", old_desc, (you.inv[ammo].quantity == 1) ? "is" : "are"); - you.wield_change = true; + + if (ammo == you.equip[EQ_WEAPON]) + you.wield_change = true; + else if (ammo == you.quiver) + you.quiver_change = true; } else { diff --git a/crawl-ref/source/stuff.cc b/crawl-ref/source/stuff.cc index 2ab600cd8c..4e20392423 100644 --- a/crawl-ref/source/stuff.cc +++ b/crawl-ref/source/stuff.cc @@ -530,6 +530,7 @@ void redraw_screen(void) you.redraw_gold = true; you.redraw_experience = true; you.wield_change = true; + you.quiver_change = true; set_redraw_status( REDRAW_LINE_1_MASK | REDRAW_LINE_2_MASK | REDRAW_LINE_3_MASK ); diff --git a/crawl-ref/source/transfor.cc b/crawl-ref/source/transfor.cc index 3dc1d8e6a9..80314c20c5 100644 --- a/crawl-ref/source/transfor.cc +++ b/crawl-ref/source/transfor.cc @@ -52,7 +52,6 @@ bool remove_equipment(std::set<equipment_type> removed) { unwield_item(); canned_msg(MSG_EMPTY_HANDED); - you.wield_change = true; } // Remove items in order (std::set is a sorted container) |