diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-07-04 21:18:28 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-07-04 21:18:28 +0000 |
commit | adf10d7dd27e29e7cfd6ce3d7d0a16fb29e6ce5c (patch) | |
tree | 3bea1eb6e474e58d0aa2ac78334259048bcae904 /crawl-ref/source | |
parent | a51373bd73dcf4a99fa895ad24508ce5af2d426a (diff) | |
download | crawl-ref-adf10d7dd27e29e7cfd6ce3d7d0a16fb29e6ce5c.tar.gz crawl-ref-adf10d7dd27e29e7cfd6ce3d7d0a16fb29e6ce5c.zip |
Fix 2815574: Venom card not waking monsters.
Fix 2815185: Not updating wield display for rotting chunks.
Fix 2812496: Wrong message when attempting to chop with unwieldable
weapons. (Small patch by rafalmaj.)
Fix 2811476: Turn autopickup back on when gaining see invisible
(mutation, ring, artefact, spell).
Fix 2806314: Remove coinflip() for Sandblast range. Wielding rocks now
guarantees range of 2.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10096 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r-- | crawl-ref/source/beam.cc | 3 | ||||
-rw-r--r-- | crawl-ref/source/effects.cc | 7 | ||||
-rw-r--r-- | crawl-ref/source/food.cc | 17 | ||||
-rw-r--r-- | crawl-ref/source/item_use.cc | 20 | ||||
-rw-r--r-- | crawl-ref/source/mutation.cc | 12 | ||||
-rw-r--r-- | crawl-ref/source/spells4.cc | 10 | ||||
-rw-r--r-- | crawl-ref/source/spl-cast.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/spl-util.cc | 5 |
8 files changed, 56 insertions, 20 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index 4411d80d27..2065139a9d 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -2647,6 +2647,7 @@ bool poison_monster(monsters *monster, kill_category who, int levels, old_pois.degree > 0 ? " looks even sicker." : " is poisoned."); } + behaviour_event(monster, ME_ANNOY, (who == KC_YOU) ? MHITYOU : MHITNOT); } // Finally, take care of deity preferences. @@ -5065,10 +5066,8 @@ int bolt::range_used_on_hit(const actor* victim) const return (used); for (unsigned int i = 0; i < range_funcs.size(); ++i) - { if ( (*range_funcs[i])(*this, victim, used) ) break; - } return (used); } diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc index 7ef9ec7a2a..c1f9aa1759 100644 --- a/crawl-ref/source/effects.cc +++ b/crawl-ref/source/effects.cc @@ -592,7 +592,7 @@ bool lose_stat(unsigned char which_stat, unsigned char stat_loss, bool force, const char *cause, bool see_source) { bool statLowered = false; // must initialize to false {dlb} - char *ptr_stat = NULL; + char *ptr_stat = NULL; bool *ptr_redraw = NULL; char newValue = 0; // holds new value, for comparison to old {dlb} @@ -3045,7 +3045,8 @@ static void _rot_inventory_food(long time_delta) } turn_corpse_into_skeleton(item); - you.wield_change = true; + if (you.equip[EQ_WEAPON] == i) + you.wield_change = true; burden_changed_by_rot = true; num_corpses_rotted++; @@ -3059,6 +3060,8 @@ static void _rot_inventory_food(long time_delta) && (item.special + (time_delta / 20) >= 100)) { rotten_items.push_back(index_to_letter(i)); + if (you.equip[EQ_WEAPON] == i) + you.wield_change = true; } } diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc index f756cfbe70..eaa1692654 100644 --- a/crawl-ref/source/food.cc +++ b/crawl-ref/source/food.cc @@ -251,11 +251,13 @@ static bool _find_butchering_implement(int &butcher_tool) if (!potential_candidate) { - mpr("You don't carry any weapon that could be used for butchering."); + mpr("You don't carry any weapon you could use for butchering."); if (Options.tutorial_left) + { mpr("You should pick up the first knife, dagger, sword or axe " "you find so you can use it to butcher corpses.", MSGCH_TUTORIAL); + } return (false); } @@ -295,11 +297,16 @@ static bool _find_butchering_implement(int &butcher_tool) if (is_valid_item(you.inv[item_slot]) && you.inv[item_slot].base_type == OBJ_WEAPONS - && can_cut_meat(you.inv[item_slot]) - && can_wield(&you.inv[item_slot])) + && can_cut_meat(you.inv[item_slot])) { - butcher_tool = item_slot; - return (true); + if (can_wield(&you.inv[item_slot])) + { + butcher_tool = item_slot; + return (true); + } + + mpr("You can't wield this item!"); + return (false); } mpr("That item isn't sharp enough!"); diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index 1e5addc822..49c6496b15 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -3026,7 +3026,7 @@ bool thrown_object_destroyed(item_def *item, const coord_def& where, void jewellery_wear_effects(item_def &item) { item_type_id_state_type ident = ID_TRIED_TYPE; - artefact_prop_type fake_rap = ARTP_NUM_PROPERTIES; + artefact_prop_type fake_rap = ARTP_NUM_PROPERTIES; bool learn_pluses = false; // Randart jewellery shouldn't auto-ID just because the base type @@ -3051,12 +3051,20 @@ void jewellery_wear_effects(item_def &item) case RING_SUSTAIN_ABILITIES: case RING_SUSTENANCE: case RING_SLAYING: - case RING_SEE_INVISIBLE: case RING_WIZARDRY: case RING_REGENERATION: case RING_TELEPORT_CONTROL: break; + case RING_SEE_INVISIBLE: + // We might have to turn autopickup back on again. + // TODO: Check all monsters in LOS. If any of them are invisible + // (and thus become visible once the ring is worn), the ring + // should be autoidentified. + if (item_type_known(item)) + autotoggle_autopickup(false); + break; + case RING_PROTECTION: you.redraw_armour_class = true; if (item.plus != 0) @@ -3328,6 +3336,14 @@ bool safe_to_remove_or_wear(const item_def &item, bool remove, prop_str += artefact_known_wpn_property(item, ARTP_STRENGTH); prop_int += artefact_known_wpn_property(item, ARTP_INTELLIGENCE); prop_dex += artefact_known_wpn_property(item, ARTP_DEXTERITY); + + if (!remove && artefact_known_wpn_property(item, ARTP_EYESIGHT)) + { + // We might have to turn autopickup back on again. + // This is not optimal, in that it could also happen if we do + // not know the property (in which case it should become known). + autotoggle_autopickup(false); + } } if (remove) diff --git a/crawl-ref/source/mutation.cc b/crawl-ref/source/mutation.cc index bc1966fd8f..1d89da8ea2 100644 --- a/crawl-ref/source/mutation.cc +++ b/crawl-ref/source/mutation.cc @@ -28,6 +28,7 @@ REVISION("$Rev$"); #include "abl-show.h" #include "cio.h" +#include "delay.h" #include "defines.h" #include "effects.h" #include "format.h" @@ -1978,7 +1979,6 @@ static int _handle_conflicting_mutations(mutation_type mutation, }; for (unsigned i = 0; i < ARRAYSZ(simple_conflict); ++i) - { for (int j = 0; j < 2; ++j) { // If we have one of the pair, delete a level of the other, @@ -1991,7 +1991,6 @@ static int _handle_conflicting_mutations(mutation_type mutation, return (1); // Nothing more to do. } } - } return (0); } @@ -2192,10 +2191,8 @@ bool mutate(mutation_type which_mutation, bool failMsg, // Breathe poison replaces spit poison (so it takes the slot). for (int i = 0; i < 52; ++i) - { if (you.ability_letter_table[i] == ABIL_SPIT_POISON) you.ability_letter_table[i] = ABIL_BREATHE_POISON; - } } } @@ -2272,6 +2269,13 @@ bool mutate(mutation_type which_mutation, bool failMsg, } break; + case MUT_ACUTE_VISION: + // We might have to turn autopickup back on again. + mpr(mdef.gain[you.mutation[mutat]], MSGCH_MUTATION); + gain_msg = false; + autotoggle_autopickup(false); + break; + default: break; } diff --git a/crawl-ref/source/spells4.cc b/crawl-ref/source/spells4.cc index 8f0f6c8e08..c0904d16e2 100644 --- a/crawl-ref/source/spells4.cc +++ b/crawl-ref/source/spells4.cc @@ -349,8 +349,16 @@ void cast_see_invisible(int pow) if (player_see_invis()) mpr("Nothing seems to happen."); else + { mpr("Your vision seems to sharpen."); + // We might have to turn autopickup back on again. + // TODO: Once the spell times out we might want to check all monsters + // in LOS for invisibility and turn autopickup off again, if + // needed. + autotoggle_autopickup(false); + } + // No message if you already are under the spell. you.duration[DUR_SEE_INVISIBLE] += 10 + random2(2 + (pow / 2)); @@ -1821,7 +1829,7 @@ bool wielding_rocks() bool cast_sandblast(int pow, bolt &beam) { - const bool big = wielding_rocks(); + const bool big = wielding_rocks(); const bool success = zapping(big ? ZAP_SANDBLAST : ZAP_SMALL_SANDBLAST, pow, beam, true); diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc index 3d848bd82d..645b3d4edf 100644 --- a/crawl-ref/source/spl-cast.cc +++ b/crawl-ref/source/spl-cast.cc @@ -2302,7 +2302,7 @@ static int _power_to_barcount( int power ) int spell_power_bars( spell_type spell ) { const int cap = spell_power_cap(spell); - if ( cap == 0 ) + if (cap == 0) return -1; const int power = std::min(calc_spell_power(spell, true), cap); return _power_to_barcount(power); diff --git a/crawl-ref/source/spl-util.cc b/crawl-ref/source/spl-util.cc index 494ccbb50e..871f6a7ac9 100644 --- a/crawl-ref/source/spl-util.cc +++ b/crawl-ref/source/spl-util.cc @@ -974,13 +974,12 @@ int spell_power_cap(spell_type spell) return (_seekspell(spell)->power_cap); } -// Sandblast range is 1 if not wielding rocks, 1-2 if you are. -// For targetting purposes, of course, be optimistic about range. +// Sandblast range is 1 if not wielding rocks, 2 if you are. static int _sandblast_range(int pow, bool real_cast) { int res = 1; - if (wielding_rocks() && (!real_cast || coinflip())) + if (wielding_rocks()) res = 2; return (res); |