diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-15 22:25:11 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-15 22:25:11 +0000 |
commit | 9555f782913d3cf3ab1e57a3280a6a0439df9154 (patch) | |
tree | d66fd342bc5da8000986a05b013c8ab6401dfe7d | |
parent | 420044b3c16c778b37fde736c26a7e4863b69a48 (diff) | |
download | crawl-ref-9555f782913d3cf3ab1e57a3280a6a0439df9154.tar.gz crawl-ref-9555f782913d3cf3ab1e57a3280a6a0439df9154.zip |
Fix Evaporate prompt doing the opposite of the player's answer.
Fix some more instances of crashes resulting from PROMPT_NOTHING.
Change shadow dragon corpse type to rotting.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6569 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r-- | crawl-ref/source/acr.cc | 20 | ||||
-rw-r--r-- | crawl-ref/source/beam.cc | 26 | ||||
-rw-r--r-- | crawl-ref/source/command.cc | 17 | ||||
-rw-r--r-- | crawl-ref/source/invent.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/item_use.cc | 21 | ||||
-rw-r--r-- | crawl-ref/source/mon-data.h | 2 | ||||
-rw-r--r-- | crawl-ref/source/quiver.cc | 7 | ||||
-rw-r--r-- | crawl-ref/source/spells4.cc | 19 | ||||
-rw-r--r-- | crawl-ref/source/spl-cast.cc | 6 |
9 files changed, 52 insertions, 68 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index 0a9eae96e5..a18ec6ec24 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -565,11 +565,11 @@ static void _handle_wizard_command( void ) { // This command isn't very exciting... feel free to replace. int i = prompt_invent_item( "Value of which item?", MT_INVLIST, -1 ); - if (i == PROMPT_ABORT || !is_random_artefact( you.inv[i] )) - { - canned_msg( MSG_OK ); + + if (prompt_failed(i)) break; - } + else if (!is_random_artefact( you.inv[i] )) + mpr("That item is not an artefact!"); else mprf("randart val: %d", randart_value(you.inv[i])); @@ -579,11 +579,9 @@ static void _handle_wizard_command( void ) { int i = prompt_invent_item( "Make an artefact out of which item?", MT_INVLIST, -1 ); - if (i == PROMPT_ABORT) - { - canned_msg( MSG_OK ); + + if (prompt_failed(i)) break; - } if (!_item_type_can_be_artefact(you.inv[i].base_type)) { @@ -685,11 +683,9 @@ static void _handle_wizard_command( void ) { // This command isn't very exciting but it's useful for debugging. int i = prompt_invent_item( "(Un)curse which item?", MT_INVLIST, -1 ); - if (i == PROMPT_ABORT) - { - canned_msg( MSG_OK ); + + if (prompt_failed(i)) break; - } item_def& item(you.inv[i]); diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index 2c8ba541d8..5ab52b9fe1 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -689,21 +689,21 @@ bool player_tracer( zap_type ztype, int power, bolt &pbolt, int range) if (range > 0) pbolt.rangeMax = range; - pbolt.is_tracer = true; - pbolt.source_x = you.x_pos; - pbolt.source_y = you.y_pos; - pbolt.can_see_invis = player_see_invis(); - pbolt.smart_monster = true; - pbolt.attitude = ATT_FRIENDLY; + pbolt.is_tracer = true; + pbolt.source_x = you.x_pos; + pbolt.source_y = you.y_pos; + pbolt.can_see_invis = player_see_invis(); + pbolt.smart_monster = true; + pbolt.attitude = ATT_FRIENDLY; // Init tracer variables. - pbolt.foe_count = pbolt.fr_count = 0; - pbolt.foe_power = pbolt.fr_power = 0; - pbolt.fr_helped = pbolt.fr_hurt = 0; - pbolt.foe_helped = pbolt.foe_hurt = 0; - pbolt.foe_ratio = 100; - pbolt.beam_cancelled= false; - pbolt.dont_stop_foe = pbolt.dont_stop_fr = false; + pbolt.foe_count = pbolt.fr_count = 0; + pbolt.foe_power = pbolt.fr_power = 0; + pbolt.fr_helped = pbolt.fr_hurt = 0; + pbolt.foe_helped = pbolt.foe_hurt = 0; + pbolt.foe_ratio = 100; + pbolt.beam_cancelled = false; + pbolt.dont_stop_foe = pbolt.dont_stop_fr = pbolt.dont_stop_player = false; fire_beam(pbolt); diff --git a/crawl-ref/source/command.cc b/crawl-ref/source/command.cc index 6ebf009edf..86879504ea 100644 --- a/crawl-ref/source/command.cc +++ b/crawl-ref/source/command.cc @@ -140,7 +140,6 @@ static std::string _get_version_changes(void) std::string help; char buf[200]; bool start = false; - bool skip_lines = true; while (fgets(buf, sizeof buf, fp)) { // Remove trailing spaces. @@ -152,18 +151,10 @@ static std::string _get_version_changes(void) break; } help = buf; - // Give up if you encountered the second set of underliners - // and still haven't encountered the keyword "Highlights". - if (help.find("---") != std::string::npos) - { - if (skip_lines) - { - skip_lines = false; - continue; - } - else if (!start) - break; - } + + // Give up if you encounter an older version. + if (help.find("Stone Soup 0.3.4") != std::string::npos) + break; if (help.find("Highlights") != std::string::npos) { diff --git a/crawl-ref/source/invent.cc b/crawl-ref/source/invent.cc index 16643193fb..9b12c69551 100644 --- a/crawl-ref/source/invent.cc +++ b/crawl-ref/source/invent.cc @@ -353,6 +353,8 @@ static std::string _no_selectables_message(int item_selector) return("You aren't carrying any decks from which to draw."); case OBJ_FOOD: return("You aren't carrying any food."); + case OBJ_POTIONS: + return("You aren't carrying any potions."); case OBJ_SCROLLS: case OBJ_BOOKS: return("You aren't carrying any books or scrolls."); diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index 88f6d9cb23..9fc7428131 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -798,7 +798,7 @@ bool armour_prompt( const std::string & mesg, int *index, operation_types oper) } return (succeeded); -} // end armour_prompt() +} static bool cloak_is_being_removed( void ) { @@ -3158,8 +3158,8 @@ bool puton_ring(int slot, bool prompt_finger) else { item_slot = prompt_invent_item( "Put on which piece of jewellery?", - MT_INVLIST, OBJ_JEWELLERY, true, true, true, 0, -1, - NULL, OPER_PUTON ); + MT_INVLIST, OBJ_JEWELLERY, true, true, + true, 0, -1, NULL, OPER_PUTON ); } if (prompt_failed(item_slot)) @@ -3304,10 +3304,10 @@ bool remove_ring(int slot, bool announce) if (hand_used == EQ_NONE) { const int equipn = - (slot == -1)? prompt_invent_item( "Remove which piece of jewellery?", - MT_INVLIST, - OBJ_JEWELLERY, true, true, true, - 0, -1, NULL, OPER_REMOVE) + (slot == -1)? prompt_invent_item("Remove which piece of jewellery?", + MT_INVLIST, + OBJ_JEWELLERY, true, true, true, + 0, -1, NULL, OPER_REMOVE) : slot; if (prompt_failed(equipn)) @@ -3593,6 +3593,7 @@ void prompt_inscribe_item() } item_slot = prompt_invent_item("Inscribe which item? ", MT_INVLIST, OSEL_ANY ); + if (prompt_failed(item_slot)) return; @@ -4101,12 +4102,8 @@ static bool _handle_enchant_armour( int item_slot ) OSEL_ENCH_ARM, true, true, false ); } - if (item_slot == PROMPT_ABORT || item_slot == PROMPT_NOTHING) - { - if (item_slot == PROMPT_ABORT) - canned_msg( MSG_OK ); + if (prompt_failed(item_slot)) return (false); - } item_def& arm(you.inv[item_slot]); diff --git a/crawl-ref/source/mon-data.h b/crawl-ref/source/mon-data.h index 1caaacdeab..5197d6b099 100644 --- a/crawl-ref/source/mon-data.h +++ b/crawl-ref/source/mon-data.h @@ -1889,7 +1889,7 @@ static monsterentry mondata[] = { { {AT_BITE, AF_DRAIN_XP, 20}, {AT_CLAW, AF_PLAIN, 15}, {AT_CLAW, AF_PLAIN, 15}, AT_NO_ATK }, { 17, 5, 5, 0 }, - 15, 10, MST_SHADOW_DRAGON, CE_MUTAGEN_RANDOM, Z_BIG, S_ROAR, I_ANIMAL, + 15, 10, MST_SHADOW_DRAGON, CE_HCL, Z_BIG, S_ROAR, I_ANIMAL, HT_LAND, 10, DEFAULT_ENERGY, MONUSE_NOTHING, SIZE_HUGE }, diff --git a/crawl-ref/source/quiver.cc b/crawl-ref/source/quiver.cc index e40a76159a..12b8d5a9ad 100644 --- a/crawl-ref/source/quiver.cc +++ b/crawl-ref/source/quiver.cc @@ -147,12 +147,7 @@ void choose_item_for_quiver() OSEL_THROWABLE, true, true, true, '-', you.equip[EQ_WEAPON], NULL, OPER_QUIVER ); - if (slot == PROMPT_ABORT) - { - canned_msg(MSG_OK); - return; - } - else if (slot == PROMPT_NOTHING) + if (prompt_failed(slot)) return; if (slot == PROMPT_GOT_SPECIAL) // '-' or empty quiver diff --git a/crawl-ref/source/spells4.cc b/crawl-ref/source/spells4.cc index 09eef4b231..3d58cdc192 100644 --- a/crawl-ref/source/spells4.cc +++ b/crawl-ref/source/spells4.cc @@ -1419,18 +1419,19 @@ bool cast_evaporate(int pow, bolt& beem, int potion) } // Fire tracer. - beem.source_x = you.x_pos; - beem.source_y = you.y_pos; - beem.can_see_invis = player_see_invis(); - beem.smart_monster = true; - beem.attitude = ATT_FRIENDLY; - beem.fr_count = 0; - beem.is_tracer = true; + beem.source_x = you.x_pos; + beem.source_y = you.y_pos; + beem.can_see_invis = player_see_invis(); + beem.smart_monster = true; + beem.attitude = ATT_FRIENDLY; + beem.fr_count = 0; + beem.beam_cancelled = false; + beem.is_tracer = true; fire_beam(beem); - if (beem.fr_count > 0) + if (beem.beam_cancelled) { - // We don't want to fire through friendlies. + // We don't want to fire through friendlies or at ourselves. canned_msg(MSG_OK); return (false); } diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc index dbe75b1a07..ed711ad7a1 100644 --- a/crawl-ref/source/spl-cast.cc +++ b/crawl-ref/source/spl-cast.cc @@ -1019,9 +1019,11 @@ spret_type your_spells(spell_type spell, int powc, bool allow_fail) { potion = prompt_invent_item("Throw which potion?", MT_INVLIST, OBJ_POTIONS); - if (potion == -1) + + if (prompt_failed(potion)) return (SPRET_ABORT); - else if (you.inv[potion].base_type != OBJ_POTIONS) + + if (you.inv[potion].base_type != OBJ_POTIONS) { mpr("This spell works only on potions!"); return (SPRET_ABORT); |