Anonymous | Login | 2024-04-25 08:04 CEST |
Main | My View | View Issues | Change Log | Wiki | Tavern | News |
Viewing Issue Simple Details [ Jump to Notes ] [ Wiki ] | [ View Advanced ] [ Issue History ] [ Print ] | ||||||
ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||
0007792 | [DCSS] Patches | minor | N/A | 2013-11-28 09:29 | 2013-11-29 01:59 | ||
Reporter | chris | View Status | public | ||||
Assigned To | neil | ||||||
Priority | normal | Resolution | done | ||||
Status | closed | Product Branch | 0.14 ancient branch | ||||
Summary | 0007792: Some message-related patches | ||||||
Description |
Replace `mprf(ch, s)` with `mpr(s, ch)` Replace `mprf(s)` with `mpr(s)` String semantics Remove hardcoded ENDOFPACK from a message The replacements were scripted then reviewed, the message-building code is one of many such rewrites in my queue, and 52 just happened to frown at me. |
||||||
Additional Information | |||||||
Tags | No tags attached. | ||||||
Attached Files |
7792.patch [^] (33,364 bytes) 2013-11-28 09:29 [Show Content] [Hide Content]From bc03ce998c7e2e5342934b4b782348c5c8f248f2 Mon Sep 17 00:00:00 2001 From: Chris Oelmueller <chris.oelmueller@gmail.com> Date: Thu, 28 Nov 2013 09:25:11 +0100 Subject: Remove hardcoded ENDOFPACK from a message --- crawl-ref/source/invent.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crawl-ref/source/invent.cc b/crawl-ref/source/invent.cc index 23f6e6f..fb119ad 100644 --- a/crawl-ref/source/invent.cc +++ b/crawl-ref/source/invent.cc @@ -408,11 +408,12 @@ void InvMenu::set_title(const string &s) const int cap = carrying_capacity(BS_UNENCUMBERED); stitle = make_stringf( - "Inventory: %.0f/%.0f aum (%d%%, %d/52 slots)", + "Inventory: %.0f/%.0f aum (%d%%, %d/%d slots)", BURDEN_TO_AUM * you.burden, BURDEN_TO_AUM * cap, (you.burden * 100) / cap, - inv_count()); + inv_count(), + ENDOFPACK); string prompt = "(_ for help)"; stitle = stitle + string(max(0, get_number_of_cols() - strwidth(stitle) -- 1.8.4.2 From 1783eed979ea711eabd0dc4fd27be9f4a661d3f6 Mon Sep 17 00:00:00 2001 From: Chris Oelmueller <chris.oelmueller@gmail.com> Date: Thu, 28 Nov 2013 09:25:11 +0100 Subject: String semantics --- crawl-ref/source/items.cc | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc index 3bfb71b..8140d4a 100644 --- a/crawl-ref/source/items.cc +++ b/crawl-ref/source/items.cc @@ -854,18 +854,17 @@ static string _menu_burden_invstatus(const Menu *menu, bool is_pickup = false) //TODO: Should somehow colour burdened/overloaded in LIGHTRED/RED // respectively {kittel} string newstate = - new_burd > carrying_capacity(BS_ENCUMBERED) ? "overloaded)" : - new_burd > carrying_capacity(BS_UNENCUMBERED) ? "burdened)" - : "unencumbered)"; - - string burden = "(Burden: "; - burden += Options.show_inventory_weights ? - make_stringf("%.0f%s/%.0f aum)", - you.burden * BURDEN_TO_AUM, - sw.c_str(), - carrying_capacity(BS_UNENCUMBERED) * BURDEN_TO_AUM) - : newstate; - return burden; + new_burd > carrying_capacity(BS_ENCUMBERED) ? "overloaded" : + new_burd > carrying_capacity(BS_UNENCUMBERED) ? "burdened" + : "unencumbered"; + if (Options.show_inventory_weights) + { + newstate = make_stringf("%.0f%s/%.0f aum", + you.burden * BURDEN_TO_AUM, + sw.c_str(), + carrying_capacity(BS_UNENCUMBERED) * BURDEN_TO_AUM); + } + return make_stringf("(Burden: %s)", newstate.c_str()); } static string _pickup_menu_title(const Menu *menu, const string &oldt) -- 1.8.4.2 From 1c0d47df1b92f9292927c4abb0e7c7df1b23805e Mon Sep 17 00:00:00 2001 From: Chris Oelmueller <chris.oelmueller@gmail.com> Date: Thu, 28 Nov 2013 09:25:12 +0100 Subject: Replace `mprf(s)` with `mpr(s)` Scripted, then manually reviewed. --- crawl-ref/source/abl-show.cc | 4 ++-- crawl-ref/source/beam.cc | 2 +- crawl-ref/source/behold.cc | 2 +- crawl-ref/source/chardump.cc | 2 +- crawl-ref/source/dbg-maps.cc | 2 +- crawl-ref/source/delay.cc | 4 ++-- crawl-ref/source/dgl-message.cc | 2 +- crawl-ref/source/directn.cc | 2 +- crawl-ref/source/dungeon.cc | 2 +- crawl-ref/source/fearmonger.cc | 2 +- crawl-ref/source/godabil.cc | 4 ++-- crawl-ref/source/item_use.cc | 4 ++-- crawl-ref/source/items.cc | 2 +- crawl-ref/source/melee_attack.cc | 2 +- crawl-ref/source/mon-abil.cc | 10 +++++----- crawl-ref/source/mon-stuff.cc | 4 ++-- crawl-ref/source/player-act.cc | 2 +- crawl-ref/source/player.cc | 2 +- crawl-ref/source/spl-other.cc | 2 +- crawl-ref/source/wiz-dgn.cc | 2 +- crawl-ref/source/wiz-fsim.cc | 10 +++++----- 21 files changed, 34 insertions(+), 34 deletions(-) diff --git a/crawl-ref/source/abl-show.cc b/crawl-ref/source/abl-show.cc index 48281ce..34e335c 100644 --- a/crawl-ref/source/abl-show.cc +++ b/crawl-ref/source/abl-show.cc @@ -1461,7 +1461,7 @@ static bool _check_ability_possible(const ability_def& abil, && !player_rotted()) { if (!quiet) - mprf("You don't need to restore your stats or hit points!"); + mpr("You don't need to restore your stats or hit points!"); return false; } return true; @@ -2717,7 +2717,7 @@ static bool _do_ability(const ability_def& abil) if (retval <= 0) { if (retval == 0) - mprf("No corpses are in range."); + mpr("No corpses are in range."); else canned_msg(MSG_OK); return false; diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index b31c32e..1a66858 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -2550,7 +2550,7 @@ void bolt::affect_endpoint() { if (you.see_cell(pos())) { - mprf("The wave splashes down."); + mpr("The wave splashes down."); noisy(25, pos()); } else diff --git a/crawl-ref/source/behold.cc b/crawl-ref/source/behold.cc index a1f9531..7c4f212 100644 --- a/crawl-ref/source/behold.cc +++ b/crawl-ref/source/behold.cc @@ -133,7 +133,7 @@ void player::beholders_check_noise(int loudness, bool axe) if (loudness >= 20 && beheld()) { - mprf("For a moment, your mind becomes perfectly clear!"); + mpr("For a moment, your mind becomes perfectly clear!"); clear_beholders(); _removed_beholder(); } diff --git a/crawl-ref/source/chardump.cc b/crawl-ref/source/chardump.cc index 13e6a62..e5de627 100644 --- a/crawl-ref/source/chardump.cc +++ b/crawl-ref/source/chardump.cc @@ -1516,7 +1516,7 @@ static bool _write_dump(const string &fname, dump_params &par, bool quiet) succeeded = true; if (!quiet) #ifdef DGAMELAUNCH - mprf("Char dumped successfully."); + mpr("Char dumped successfully."); #else mprf("Char dumped to '%s'.", file_name.c_str()); #endif diff --git a/crawl-ref/source/dbg-maps.cc b/crawl-ref/source/dbg-maps.cc index 214195d..a335a37 100644 --- a/crawl-ref/source/dbg-maps.cc +++ b/crawl-ref/source/dbg-maps.cc @@ -191,7 +191,7 @@ static bool mg_build_dungeon() static void mg_build_levels(int niters) { mesclr(); - mprf("Generating dungeon map stats"); + mpr("Generating dungeon map stats"); for (int i = 0; i < niters; ++i) { diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc index 06b8bde..721d289 100644 --- a/crawl-ref/source/delay.cc +++ b/crawl-ref/source/delay.cc @@ -969,7 +969,7 @@ static void _finish_delay(const delay_queue_item &delay) case DELAY_EAT: if (delay.parm3 > 0) // If duration was just one turn, don't print. - mprf("You finish eating."); + mpr("You finish eating."); // For chunks, warn the player if they're not getting much // nutrition. Also, print the other eating messages only now. if (delay.parm1) @@ -980,7 +980,7 @@ static void _finish_delay(const delay_queue_item &delay) case DELAY_FEED_VAMPIRE: { - mprf("You finish drinking."); + mpr("You finish drinking."); did_god_conduct(DID_DRINK_BLOOD, 8); diff --git a/crawl-ref/source/dgl-message.cc b/crawl-ref/source/dgl-message.cc index 255d995..dbb4803 100644 --- a/crawl-ref/source/dgl-message.cc +++ b/crawl-ref/source/dgl-message.cc @@ -123,7 +123,7 @@ void read_messages() static void _announce_messages() { // XXX: We could do a NetHack-like mail daemon here at some point. - mprf("Beep! Your pager goes off! Use _ to check your messages."); + mpr("Beep! Your pager goes off! Use _ to check your messages."); } void check_messages() diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc index be47f61..d5e893f 100644 --- a/crawl-ref/source/directn.cc +++ b/crawl-ref/source/directn.cc @@ -572,7 +572,7 @@ void full_describe_view() if (list_mons.empty() && list_items.empty() && list_features.empty()) { - mprf("No monsters, items or features are visible."); + mpr("No monsters, items or features are visible."); return; } diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc index 46044ba..7f7ed70 100644 --- a/crawl-ref/source/dungeon.cc +++ b/crawl-ref/source/dungeon.cc @@ -3103,7 +3103,7 @@ static void _slime_connectivity_fixup() // squares should have adjacency of DISCONNECT_DIST // but oh well if (env.level_map_mask(*adj_it) & MMT_VAULT) - mprf("Whoops, nicked a vault in slime connectivity fixup"); + mpr("Whoops, nicked a vault in slime connectivity fixup"); env.grid(*adj_it) = DNGN_FLOOR; } } diff --git a/crawl-ref/source/fearmonger.cc b/crawl-ref/source/fearmonger.cc index 591b3a2..3c12989 100644 --- a/crawl-ref/source/fearmonger.cc +++ b/crawl-ref/source/fearmonger.cc @@ -115,7 +115,7 @@ void player::fearmongers_check_noise(int loudness, bool axe) if (loudness >= 20 && beheld()) { - mprf("For a moment, your terror fades away!"); + mpr("For a moment, your terror fades away!"); clear_fearmongers(); _removed_fearmonger(); } diff --git a/crawl-ref/source/godabil.cc b/crawl-ref/source/godabil.cc index 0f230c4..40f13bb 100644 --- a/crawl-ref/source/godabil.cc +++ b/crawl-ref/source/godabil.cc @@ -3375,7 +3375,7 @@ void spare_beogh_convert() mpr("The priest welcomes you and lets you live."); else { - mprf("With a roar of approval, the orcs welcome you as one of their own, " - "and spare your life."); + mpr("With a roar of approval, the orcs welcome you as one of their own," + " and spare your life."); } } diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index 6dd1580..37447f5 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -657,7 +657,7 @@ bool can_wear_armour(const item_def &item, bool verbose, bool ignore_temporary) || player_mutation_level(MUT_CLAWS, false) >= 3) { if (verbose) - mprf("The hauberk won't fit your hands."); + mpr("The hauberk won't fit your hands."); return false; } @@ -665,7 +665,7 @@ bool can_wear_armour(const item_def &item, bool verbose, bool ignore_temporary) || player_mutation_level(MUT_ANTENNAE, false) >= 3) { if (verbose) - mprf("The hauberk won't fit your head."); + mpr("The hauberk won't fit your head."); return false; } } diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc index 8140d4a..ab3f683 100644 --- a/crawl-ref/source/items.cc +++ b/crawl-ref/source/items.cc @@ -2233,7 +2233,7 @@ void drop_last() } if (items_to_drop.empty()) - mprf("No item to drop."); + mpr("No item to drop."); else { you.last_pickup.clear(); diff --git a/crawl-ref/source/melee_attack.cc b/crawl-ref/source/melee_attack.cc index 73c8f31..2bd418f 100644 --- a/crawl-ref/source/melee_attack.cc +++ b/crawl-ref/source/melee_attack.cc @@ -308,7 +308,7 @@ bool melee_attack::handle_phase_attempted() if (defender && you.can_see(defender)) mprf("You jump-attack %s!", defender->name(DESC_THE).c_str()); else - mprf("You jump-attack!"); + mpr("You jump-attack!"); if (jump_blocked) { mpr("Something unseen blocks your movement!"); diff --git a/crawl-ref/source/mon-abil.cc b/crawl-ref/source/mon-abil.cc index 0dff19e..3cc1f59 100644 --- a/crawl-ref/source/mon-abil.cc +++ b/crawl-ref/source/mon-abil.cc @@ -1028,7 +1028,7 @@ static bool _siren_movement_effect(const monster* mons) if (!do_resist) { const coord_def oldpos = you.pos(); - mprf("The pull of her song draws you forwards."); + mpr("The pull of her song draws you forwards."); if (swapping) { @@ -2301,7 +2301,7 @@ static void _establish_connection(int tentacle, if (!last_mon) { // Should be something there, what to do if there isn't? - mprf("Error! failed to place monster in tentacle connect change"); + mpr("Error! failed to place monster in tentacle connect change"); break; } int last_mon_idx = last_mon->mindex(); @@ -2809,7 +2809,7 @@ static int _collect_connection_data(monster* start_monster, { current_mon = &menv[next_idx]; if (int(current_mon->number) != start_monster->mindex()) - mprf("link information corruption!!! tentacle in chain doesn't match mindex"); + mpr("link information corruption!!! tentacle in chain doesn't match mindex"); if (!retract_found) { retract_pos = current_mon->pos(); @@ -4590,7 +4590,7 @@ void ballisto_on_move(monster* mons, const coord_def& position) // Don't leave mold on squares we place ballistos on remove_mold(position); if (you.can_see(plant)) - mprf("A ballistomycete grows in the wake of the spore."); + mpr("A ballistomycete grows in the wake of the spore."); } mons->number = 40; @@ -5016,7 +5016,7 @@ void waterport_touch(monster* nymph, actor* target) nymph->pronoun(PRONOUN_POSSESSIVE, true).c_str()); } else if (target->is_player()) - mprf("You are drawn back into the water."); + mpr("You are drawn back into the water."); else { if (could_see_victim) diff --git a/crawl-ref/source/mon-stuff.cc b/crawl-ref/source/mon-stuff.cc index 557c256..4ac22a8 100644 --- a/crawl-ref/source/mon-stuff.cc +++ b/crawl-ref/source/mon-stuff.cc @@ -1491,7 +1491,7 @@ static void _make_spectral_thing(monster* mons, bool quiet) // Headless hydras cannot be made spectral hydras, sorry. if (spectre_type == MONS_HYDRA && mons->number == 0) { - mprf("A glowing mist gathers momentarily, then fades."); + mpr("A glowing mist gathers momentarily, then fades."); return; } @@ -2058,7 +2058,7 @@ int monster_die(monster* mons, killer_type killer, if (hp_heal && you.hp < you.hp_max && !you.duration[DUR_DEATHS_DOOR]) { - mprf("You feel a little better."); + mpr("You feel a little better."); inc_hp(hp_heal); } diff --git a/crawl-ref/source/player-act.cc b/crawl-ref/source/player-act.cc index 364f3ea..dfcd568 100644 --- a/crawl-ref/source/player-act.cc +++ b/crawl-ref/source/player-act.cc @@ -709,7 +709,7 @@ bool player::can_go_berserk(bool intentional, bool potion, bool quiet) const if (stasis(false)) { if (verbose) - mprf("You cannot go berserk while under stasis."); + mpr("You cannot go berserk while under stasis."); return false; } diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 78bfd9b..2cc60cc 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -5568,7 +5568,7 @@ void float_player() { if (you.fishtail) { - mprf("Your tail turns into legs as you fly out of the water."); + mpr("Your tail turns into legs as you fly out of the water."); merfolk_stop_swimming(); } else if (you.tengu_flight()) diff --git a/crawl-ref/source/spl-other.cc b/crawl-ref/source/spl-other.cc index b4bad54..037f0f6 100644 --- a/crawl-ref/source/spl-other.cc +++ b/crawl-ref/source/spl-other.cc @@ -493,7 +493,7 @@ spret_type cast_stoneskin(int pow, bool fail) { // We can't get here from normal casting, and probably don't want // a message from the Helm card. - // mprf("Your skin is naturally stony."); + // mpr("Your skin is naturally stony."); return SPRET_ABORT; } diff --git a/crawl-ref/source/wiz-dgn.cc b/crawl-ref/source/wiz-dgn.cc index 58949ef..6e9526a 100644 --- a/crawl-ref/source/wiz-dgn.cc +++ b/crawl-ref/source/wiz-dgn.cc @@ -565,7 +565,7 @@ bool debug_make_shop(const coord_def& pos) place_spec_shop(pos, new_shop_type, representative); link_items(); - mprf("Done."); + mpr("Done."); return true; } diff --git a/crawl-ref/source/wiz-fsim.cc b/crawl-ref/source/wiz-fsim.cc index 78a146f..bb2041d 100644 --- a/crawl-ref/source/wiz-fsim.cc +++ b/crawl-ref/source/wiz-fsim.cc @@ -259,7 +259,7 @@ static monster* _init_fsim() mon = create_monster(temp); if (!mon) { - mprf("Failed to create monster."); + mpr("Failed to create monster."); return NULL; } } @@ -277,7 +277,7 @@ static monster* _init_fsim() if (!adjacent(mon->pos(), you.pos())) { monster_die(mon, KILL_DISMISSED, NON_MONSTER); - mprf("Could not put monster adjacent to player."); + mpr("Could not put monster adjacent to player."); return 0; } @@ -518,7 +518,7 @@ static void _fsim_simple_scale(FILE * o, monster* mon, bool defense) // kill the loop if the user hits escape if (kbhit() && getchk() == 27) { - mprf("Cancelling simulation.\n"); + mpr("Cancelling simulation.\n"); fprintf(o, "Simulation cancelled!\n\n"); break; } @@ -564,7 +564,7 @@ static void _fsim_double_scale(FILE * o, monster* mon, bool defense) // kill the loop if the user hits escape if (kbhit() && getchk() == 27) { - mprf("Cancelling simulation.\n"); + mpr("Cancelling simulation.\n"); fprintf(o, "\nSimulation cancelled!\n\n"); return; } @@ -665,7 +665,7 @@ void wizard_fight_sim(bool double_scale) set_xl(xl, false); _uninit_fsim(mon); - mprf("Done."); + mpr("Done."); } #endif -- 1.8.4.2 From 74407b79adf24dc904b75cace6f29dc60e80bc61 Mon Sep 17 00:00:00 2001 From: Chris Oelmueller <chris.oelmueller@gmail.com> Date: Thu, 28 Nov 2013 09:25:12 +0100 Subject: Replace `mprf(ch, s)` with `mpr(s, ch)` Scripted, then manually reviewed. --- crawl-ref/source/art-func.h | 2 +- crawl-ref/source/dbg-maps.cc | 2 +- crawl-ref/source/dbg-scan.cc | 2 +- crawl-ref/source/delay.cc | 6 +++--- crawl-ref/source/dgl-message.cc | 2 +- crawl-ref/source/dgn-shoals.cc | 4 ++-- crawl-ref/source/directn.cc | 4 ++-- crawl-ref/source/item_use.cc | 2 +- crawl-ref/source/main.cc | 2 +- crawl-ref/source/mapmark.cc | 4 ++-- crawl-ref/source/mon-abil.cc | 2 +- crawl-ref/source/religion.cc | 2 +- crawl-ref/source/terrain.cc | 10 +++++----- crawl-ref/source/travel.cc | 2 +- crawl-ref/source/wiz-item.cc | 2 +- crawl-ref/source/wiz-mon.cc | 12 ++++++------ crawl-ref/source/wiz-you.cc | 6 +++--- crawl-ref/source/xom.cc | 2 +- 18 files changed, 34 insertions(+), 34 deletions(-) diff --git a/crawl-ref/source/art-func.h b/crawl-ref/source/art-func.h index b56b0bf..7725997 100644 --- a/crawl-ref/source/art-func.h +++ b/crawl-ref/source/art-func.h @@ -335,7 +335,7 @@ static void _SINGING_SWORD_equip(item_def *item, bool *show_msgs, bool unmeld) if (!item->props.exists("ss_welcome")) { - mprf(MSGCH_TALK, "The sword says, \"Hi! I'm the Singing Sword!\""); + mpr("The sword says, \"Hi! I'm the Singing Sword!\"", MSGCH_TALK); item->props["ss_welcome"].get_bool() = true; } else diff --git a/crawl-ref/source/dbg-maps.cc b/crawl-ref/source/dbg-maps.cc index a335a37..794524d 100644 --- a/crawl-ref/source/dbg-maps.cc +++ b/crawl-ref/source/dbg-maps.cc @@ -82,7 +82,7 @@ static bool mg_do_build_level(int niters) { if (kbhit() && key_is_escape(getchk())) { - mprf(MSGCH_WARN, "User requested cancel"); + mpr("User requested cancel", MSGCH_WARN); return false; } diff --git a/crawl-ref/source/dbg-scan.cc b/crawl-ref/source/dbg-scan.cc index 6ebadb3..8a42c06 100644 --- a/crawl-ref/source/dbg-scan.cc +++ b/crawl-ref/source/dbg-scan.cc @@ -220,7 +220,7 @@ void debug_item_scan(void) if (mons.name(DESC_PLAIN, true).find("questionable") != string::npos) { - mprf(MSGCH_ERROR, "Program bug detected!"); + mpr("Program bug detected!", MSGCH_ERROR); mprf(MSGCH_ERROR, "Buggy monster detected: monster #%d; position (%d,%d)", i, mons.pos().x, mons.pos().y); diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc index 721d289..4ec608d 100644 --- a/crawl-ref/source/delay.cc +++ b/crawl-ref/source/delay.cc @@ -863,7 +863,7 @@ void handle_delay() break; case DELAY_BUTCHER: - mprf(MSGCH_MULTITURN_ACTION, "You continue butchering the corpse."); + mpr("You continue butchering the corpse.", MSGCH_MULTITURN_ACTION); break; case DELAY_BOTTLE_BLOOD: @@ -916,7 +916,7 @@ void handle_delay() stop_delay(); return; } - mprf(MSGCH_MULTITURN_ACTION, "You continue drinking."); + mpr("You continue drinking.", MSGCH_MULTITURN_ACTION); vampire_nutrition_per_turn(corpse, 0); break; } @@ -1725,7 +1725,7 @@ void autotoggle_autopickup(bool off) else if (Options.autopickup_on < 0) // was turned off automatically { Options.autopickup_on = 1; - mprf(MSGCH_WARN, "Reactivating autopickup."); + mpr("Reactivating autopickup.", MSGCH_WARN); } } diff --git a/crawl-ref/source/dgl-message.cc b/crawl-ref/source/dgl-message.cc index dbb4803..6b057f4 100644 --- a/crawl-ref/source/dgl-message.cc +++ b/crawl-ref/source/dgl-message.cc @@ -84,7 +84,7 @@ static void _read_each_message() if (say_got_msg) { - mprf(MSGCH_PROMPT, "Your messages:"); + mpr("Your messages:", MSGCH_PROMPT); say_got_msg = false; } diff --git a/crawl-ref/source/dgn-shoals.cc b/crawl-ref/source/dgn-shoals.cc index 50c3f37..90d4d56 100644 --- a/crawl-ref/source/dgn-shoals.cc +++ b/crawl-ref/source/dgn-shoals.cc @@ -1050,7 +1050,7 @@ static void _shoals_apply_tide_at(coord_def c, int tide, bool incremental_tide) && !you.ground_level() && !you.permanent_flight()) { - mprf(MSGCH_WARN, "The tide rushes in under you."); + mpr("The tide rushes in under you.", MSGCH_WARN); } } @@ -1270,7 +1270,7 @@ void wizard_mod_tide() { if (!player_in_branch(BRANCH_SHOALS) || !env.heightmap.get()) { - mprf(MSGCH_WARN, "Not in Shoals or no heightmap; tide not available."); + mpr("Not in Shoals or no heightmap; tide not available.", MSGCH_WARN); return; } diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc index d5e893f..a7266c0 100644 --- a/crawl-ref/source/directn.cc +++ b/crawl-ref/source/directn.cc @@ -1552,7 +1552,7 @@ void direction_chooser::print_items_description() const get_menu_colour_prefix_tags(*item, DESC_A).c_str()); if (multiple_items_at(target())) - mprf(MSGCH_FLOOR_ITEMS, "There is something else lying underneath."); + mpr("There is something else lying underneath.", MSGCH_FLOOR_ITEMS); } void direction_chooser::print_floor_description(bool boring_too) const @@ -1608,7 +1608,7 @@ void direction_chooser::toggle_beam() { if (!needs_path) { - mprf(MSGCH_EXAMINE_FILTER, "This spell doesn't need a beam path."); + mpr("This spell doesn't need a beam path.", MSGCH_EXAMINE_FILTER); return; } diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index 37447f5..273c2e9 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -1102,7 +1102,7 @@ static int _prompt_ring_to_remove(int new_ring) mprf(MSGCH_PROMPT, "You're wearing all the rings you can. Remove which one?"); - mprf(MSGCH_PROMPT, "(<w>?</w> for menu, <w>Esc</w> to cancel)"); + mpr("(<w>?</w> for menu, <w>Esc</w> to cancel)", MSGCH_PROMPT); // FIXME: Needs TOUCH_UI version diff --git a/crawl-ref/source/main.cc b/crawl-ref/source/main.cc index abf4827..40a0423 100644 --- a/crawl-ref/source/main.cc +++ b/crawl-ref/source/main.cc @@ -1308,7 +1308,7 @@ static void _input() if (!has_pending_input() && !kbhit()) { if (++crawl_state.lua_calls_no_turn > 1000) - mprf(MSGCH_ERROR, "Infinite lua loop detected, aborting."); + mpr("Infinite lua loop detected, aborting.", MSGCH_ERROR); else clua.callfn("ready", 0, 0); } diff --git a/crawl-ref/source/mapmark.cc b/crawl-ref/source/mapmark.cc index 7da368b..a65913a 100644 --- a/crawl-ref/source/mapmark.cc +++ b/crawl-ref/source/mapmark.cc @@ -222,7 +222,7 @@ void map_lua_marker::check_register_table() { if (!lua_istable(dlua, -1)) { - mprf(MSGCH_ERROR, "lua_marker: Expected table, didn't get it."); + mpr("lua_marker: Expected table, didn't get it.", MSGCH_ERROR); initialised = false; return; } @@ -251,7 +251,7 @@ void map_lua_marker::write(writer &outf) const bool init = initialised; if (!get_table()) { - mprf(MSGCH_ERROR, "Couldn't find table."); + mpr("Couldn't find table.", MSGCH_ERROR); init = false; } diff --git a/crawl-ref/source/mon-abil.cc b/crawl-ref/source/mon-abil.cc index 3cc1f59..8f9eff1 100644 --- a/crawl-ref/source/mon-abil.cc +++ b/crawl-ref/source/mon-abil.cc @@ -1115,7 +1115,7 @@ static bool _orange_statue_effects(monster* mons) if (you.can_see(foe)) { if (foe->is_player()) - mprf(MSGCH_WARN, "A hostile presence attacks your mind!"); + mpr("A hostile presence attacks your mind!", MSGCH_WARN); else if (you.can_see(mons)) mprf(MSGCH_WARN, "%s fixes %s piercing gaze on %s.", mons->name(DESC_THE).c_str(), diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index dfe8631..9ebb9b2 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -2652,7 +2652,7 @@ static void _gain_piety_point() if (!one_chance_in(4) && !you_worship(GOD_JIYVA)) { #ifdef DEBUG_PIETY - mprf(MSGCH_DIAGNOSTICS, "Piety slowdown due to gift timeout."); + mpr("Piety slowdown due to gift timeout.", MSGCH_DIAGNOSTICS); #endif return; } diff --git a/crawl-ref/source/terrain.cc b/crawl-ref/source/terrain.cc index b7a3599..5aa1383 100644 --- a/crawl-ref/source/terrain.cc +++ b/crawl-ref/source/terrain.cc @@ -605,12 +605,12 @@ bool feat_destroys_item(dungeon_feature_type feat, const item_def &item, case DNGN_SHALLOW_WATER: case DNGN_DEEP_WATER: if (noisy) - mprf(MSGCH_SOUND, "You hear a splash."); + mpr("You hear a splash.", MSGCH_SOUND); return false; case DNGN_LAVA: if (noisy) - mprf(MSGCH_SOUND, "You hear a sizzling splash."); + mpr("You hear a sizzling splash.", MSGCH_SOUND); return true; default: @@ -627,17 +627,17 @@ bool feat_virtually_destroys_item(dungeon_feature_type feat, const item_def &ite { case DNGN_SHALLOW_WATER: if (noisy) - mprf(MSGCH_SOUND, "You hear a splash."); + mpr("You hear a splash.", MSGCH_SOUND); return false; case DNGN_DEEP_WATER: if (noisy) - mprf(MSGCH_SOUND, "You hear a splash."); + mpr("You hear a splash.", MSGCH_SOUND); return true; case DNGN_LAVA: if (noisy) - mprf(MSGCH_SOUND, "You hear a sizzling splash."); + mpr("You hear a sizzling splash.", MSGCH_SOUND); return true; default: diff --git a/crawl-ref/source/travel.cc b/crawl-ref/source/travel.cc index 1b119c2..a652409 100644 --- a/crawl-ref/source/travel.cc +++ b/crawl-ref/source/travel.cc @@ -4074,7 +4074,7 @@ bool runrest::run_should_stop() const { #ifndef USE_TILE_LOCAL // XXX: Remove this once exclusions are visible. - mprf(MSGCH_WARN, "Stopped running for exclusion."); + mpr("Stopped running for exclusion.", MSGCH_WARN); #endif return true; } diff --git a/crawl-ref/source/wiz-item.cc b/crawl-ref/source/wiz-item.cc index 0e55bd9..05de002 100644 --- a/crawl-ref/source/wiz-item.cc +++ b/crawl-ref/source/wiz-item.cc @@ -68,7 +68,7 @@ static void _make_all_books() void wizard_create_spec_object_by_name() { char buf[1024]; - mprf(MSGCH_PROMPT, "Enter name of item (or ITEM spec): "); + mpr("Enter name of item (or ITEM spec): ", MSGCH_PROMPT); if (cancellable_get_line_autohist(buf, sizeof buf) || !*buf) { canned_msg(MSG_OK); diff --git a/crawl-ref/source/wiz-mon.cc b/crawl-ref/source/wiz-mon.cc index e4381bd..0a482c7 100644 --- a/crawl-ref/source/wiz-mon.cc +++ b/crawl-ref/source/wiz-mon.cc @@ -1051,13 +1051,13 @@ void wizard_give_monster_item(monster* mon) if ((mon->flags & MF_HARD_RESET) && !(item.flags & ISFLAG_SUMMONED)) { - mprf(MSGCH_WARN, "WARNING: Monster has MF_HARD_RESET and all its " - "items will disappear when it does."); + mpr("WARNING: Monster has MF_HARD_RESET and all its " + "items will disappear when it does.", MSGCH_WARN); } else if ((item.flags & ISFLAG_SUMMONED) && !mon->is_summoned()) { - mprf(MSGCH_WARN, "WARNING: Item is summoned and will disappear when " - "the monster does."); + mpr("WARNING: Item is summoned and will disappear when " + "the monster does.", MSGCH_WARN); } // Monster's old item moves to player's inventory. if (old_eq != NON_ITEM) @@ -1065,8 +1065,8 @@ void wizard_give_monster_item(monster* mon) mpr("Fetching monster's old item."); if (mitm[old_eq].flags & ISFLAG_SUMMONED) { - mprf(MSGCH_WARN, "WARNING: Item is summoned and shouldn't really " - "be anywhere but in the inventory of a summoned monster."); + mpr("WARNING: Item is summoned and shouldn't really be anywhere " + "but in the inventory of a summoned monster.", MSGCH_WARN); } mitm[old_eq].pos.reset(); mitm[old_eq].link = NON_ITEM; diff --git a/crawl-ref/source/wiz-you.cc b/crawl-ref/source/wiz-you.cc index c9bb2ea..f3c44f0 100644 --- a/crawl-ref/source/wiz-you.cc +++ b/crawl-ref/source/wiz-you.cc @@ -703,7 +703,7 @@ bool wizard_add_mutation() void wizard_set_abyss() { char buf[80]; - mprf(MSGCH_PROMPT, "Enter values for X, Y, Z (space separated) or return: "); + mpr("Enter values for X, Y, Z (space separated) or return: ", MSGCH_PROMPT); if (!cancellable_get_line_autohist(buf, sizeof buf)) abyss_teleport(true); @@ -715,7 +715,7 @@ void wizard_set_abyss() void wizard_set_stats() { char buf[80]; - mprf(MSGCH_PROMPT, "Enter values for Str, Int, Dex (space separated): "); + mpr("Enter values for Str, Int, Dex (space separated): ", MSGCH_PROMPT); if (cancellable_get_line_autohist(buf, sizeof buf)) return; @@ -1004,7 +1004,7 @@ static void debug_downtick_xl(int newxl) void wizard_set_xl() { - mprf(MSGCH_PROMPT, "Enter new experience level: "); + mpr("Enter new experience level: ", MSGCH_PROMPT); char buf[30]; if (cancellable_get_line_autohist(buf, sizeof buf)) { diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc index 3f07193..36c28c8 100644 --- a/crawl-ref/source/xom.cc +++ b/crawl-ref/source/xom.cc @@ -4124,7 +4124,7 @@ void debug_xom_effects() FILE *ostat = fopen("xom_debug.stat", "a"); if (!ostat) { - mprf(MSGCH_ERROR, "Can't write 'xom_debug.stat'. Aborting."); + mpr("Can't write 'xom_debug.stat'. Aborting.", MSGCH_ERROR); return; } -- 1.8.4.2 7792b.patch [^] (8,569 bytes) 2013-11-28 10:19 [Show Content] [Hide Content] From 7534f1676a9b43c55ec2c465b124a931a0198447 Mon Sep 17 00:00:00 2001 From: Chris Oelmueller <chris.oelmueller@gmail.com> Date: Thu, 28 Nov 2013 10:12:47 +0100 Subject: Rename mprnojoin to mpr_nojoin For consistency with mpr_nocap, mpr_comma_separated_list and friends. --- crawl-ref/source/items.cc | 4 ++-- crawl-ref/source/misc.cc | 2 +- crawl-ref/source/mpr.h | 4 ++-- crawl-ref/source/ouch.cc | 4 ++-- crawl-ref/source/travel.cc | 2 +- crawl-ref/source/tutorial.cc | 14 +++++++------- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc index ab3f683..f2ffeed 100644 --- a/crawl-ref/source/items.cc +++ b/crawl-ref/source/items.cc @@ -794,14 +794,14 @@ void item_check(bool verbose) out_string += ' '; } } - mprnojoin(out_string, MSGCH_FLOOR_ITEMS); + mpr_nojoin(out_string, MSGCH_FLOOR_ITEMS); done_init_line = true; } if (verbose || items.size() <= msgwin_lines() - 1) { if (!done_init_line) - mprnojoin("Things that are here:", MSGCH_FLOOR_ITEMS); + mpr_nojoin("Things that are here:", MSGCH_FLOOR_ITEMS); for (unsigned int i = 0; i < items.size(); ++i) { item_def it(*items[i]); diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc index c7b94e5..4a700e5 100644 --- a/crawl-ref/source/misc.cc +++ b/crawl-ref/source/misc.cc @@ -1656,7 +1656,7 @@ int str_to_shoptype(const string &s) void list_shop_types() { - mprnojoin("Available shop types: "); + mpr_nojoin("Available shop types: "); for (unsigned i = 0; i < ARRAYSZ(shop_types); ++i) mpr_nocap(shop_types[i]); } diff --git a/crawl-ref/source/mpr.h b/crawl-ref/source/mpr.h index 78c3b91..eb5f887 100644 --- a/crawl-ref/source/mpr.h +++ b/crawl-ref/source/mpr.h @@ -89,8 +89,8 @@ msg_colour_type msg_colour(int colour); void mpr(string text, msg_channel_type channel=MSGCH_PLAIN, int param=0, bool nojoin=false, bool cap=true); -static inline void mprnojoin(string text, msg_channel_type channel=MSGCH_PLAIN, - int param=0) +static inline void mpr_nojoin(string text, msg_channel_type channel=MSGCH_PLAIN, + int param=0) { mpr(text, channel, param, true); } diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc index 79eb436..57d037e 100644 --- a/crawl-ref/source/ouch.cc +++ b/crawl-ref/source/ouch.cc @@ -1225,7 +1225,7 @@ void ouch(int dam, int death_source, kill_method_type death_type, if (!crawl_state.disables[DIS_SAVE_CHECKPOINTS]) save_game(false); - mprnojoin("You die..."); + mpr_nojoin("You die..."); xom_death_message((kill_method_type) se.get_death_type()); more(); @@ -1315,7 +1315,7 @@ void _end_game(scorefile_entry &se) && se.get_death_type() != KILLED_BY_QUITTING && se.get_death_type() != KILLED_BY_WINNING) { - mprnojoin("You die..."); // insert player name here? {dlb} + mpr_nojoin("You die..."); // insert player name here? {dlb} xom_death_message((kill_method_type) se.get_death_type()); switch (you.religion) diff --git a/crawl-ref/source/travel.cc b/crawl-ref/source/travel.cc index a652409..d708d05 100644 --- a/crawl-ref/source/travel.cc +++ b/crawl-ref/source/travel.cc @@ -3020,7 +3020,7 @@ void start_explore(bool grab_items) { if (Options.auto_sacrifice == AS_PROMPT) { - mprnojoin("Things which can be sacrificed:", MSGCH_FLOOR_ITEMS); + mpr_nojoin("Things which can be sacrificed:", MSGCH_FLOOR_ITEMS); for (stack_iterator si(you.visible_igrd(you.pos())); si; ++si) if (si->is_greedy_sacrificeable()) mpr_nocap(get_menu_colour_prefix_tags(*si, DESC_A)); diff --git a/crawl-ref/source/tutorial.cc b/crawl-ref/source/tutorial.cc index 139acf6..655d4c0 100644 --- a/crawl-ref/source/tutorial.cc +++ b/crawl-ref/source/tutorial.cc @@ -65,12 +65,12 @@ void tutorial_init_hint(const char* hintstr) void tutorial_death_message() { - mprnojoin("You die..."); - mprnojoin("In Crawl, death is a sad but common occurrence. " - "Note that there's usually something you could have done to " - "survive, for example by using some kind of item, running away, " - "resting between fights, or by avoiding combat entirely. " - "Keep trying, eventually you'll prevail!", - MSGCH_TUTORIAL); + mpr_nojoin("You die..."); + mpr_nojoin("In Crawl, death is a sad but common occurrence. " + "Note that there's usually something you could have done to " + "survive, for example by using some kind of item, running away, " + "resting between fights, or by avoiding combat entirely. " + "Keep trying, eventually you'll prevail!", + MSGCH_TUTORIAL); more(); } -- 1.8.4.2 From fa1e9f37ae9ed10bd149f194866c42c2d19ed262 Mon Sep 17 00:00:00 2001 From: Chris Oelmueller <chris.oelmueller@gmail.com> Date: Thu, 28 Nov 2013 10:12:48 +0100 Subject: Can "You die..." message --- crawl-ref/source/enum.h | 1 + crawl-ref/source/ouch.cc | 4 ++-- crawl-ref/source/stuff.cc | 3 +++ crawl-ref/source/tutorial.cc | 3 ++- crawl-ref/source/xom.cc | 4 ++-- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h index 12f573e..d426264 100644 --- a/crawl-ref/source/enum.h +++ b/crawl-ref/source/enum.h @@ -594,6 +594,7 @@ enum canned_message_type MSG_DECK_EXHAUSTED, MSG_BEING_WATCHED, MSG_CANNOT_MOVE, + MSG_YOU_DIE, }; enum char_set_type diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc index 57d037e..aef83f0 100644 --- a/crawl-ref/source/ouch.cc +++ b/crawl-ref/source/ouch.cc @@ -1225,7 +1225,7 @@ void ouch(int dam, int death_source, kill_method_type death_type, if (!crawl_state.disables[DIS_SAVE_CHECKPOINTS]) save_game(false); - mpr_nojoin("You die..."); + canned_msg(MSG_YOU_DIE); xom_death_message((kill_method_type) se.get_death_type()); more(); @@ -1315,7 +1315,7 @@ void _end_game(scorefile_entry &se) && se.get_death_type() != KILLED_BY_QUITTING && se.get_death_type() != KILLED_BY_WINNING) { - mpr_nojoin("You die..."); // insert player name here? {dlb} + canned_msg(MSG_YOU_DIE); xom_death_message((kill_method_type) se.get_death_type()); switch (you.religion) diff --git a/crawl-ref/source/stuff.cc b/crawl-ref/source/stuff.cc index e3758b4..b5fd4d0 100644 --- a/crawl-ref/source/stuff.cc +++ b/crawl-ref/source/stuff.cc @@ -523,6 +523,9 @@ void canned_msg(canned_message_type which_message) case MSG_CANNOT_MOVE: mpr("You cannot move."); break; + case MSG_YOU_DIE: + mpr_nojoin("You die..."); + break; } } diff --git a/crawl-ref/source/tutorial.cc b/crawl-ref/source/tutorial.cc index 655d4c0..1de972c 100644 --- a/crawl-ref/source/tutorial.cc +++ b/crawl-ref/source/tutorial.cc @@ -13,6 +13,7 @@ #include "player.h" #include "skills.h" #include "state.h" +#include "stuff.h" void set_tutorial_hunger(int hunger) { @@ -65,7 +66,7 @@ void tutorial_init_hint(const char* hintstr) void tutorial_death_message() { - mpr_nojoin("You die..."); + canned_msg(MSG_YOU_DIE); mpr_nojoin("In Crawl, death is a sad but common occurrence. " "Note that there's usually something you could have done to " "survive, for example by using some kind of item, running away, " diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc index 36c28c8..632910f 100644 --- a/crawl-ref/source/xom.cc +++ b/crawl-ref/source/xom.cc @@ -3632,7 +3632,7 @@ static void _handle_accidental_death(const int orig_hp, break; } - mpr("You die..."); + canned_msg(MSG_YOU_DIE); god_speaks(GOD_XOM, _get_xom_speech(speech_type).c_str()); god_speaks(GOD_XOM, _get_xom_speech("resurrection").c_str()); @@ -3997,7 +3997,7 @@ bool xom_saves_your_life(const int dam, const int death_source, return false; // Fake death message. - mpr("You die..."); + canned_msg(MSG_YOU_DIE); more(); const string key = _get_death_type_keyword(death_type); -- 1.8.4.2 |
||||||
|
Mantis 1.1.8[^] Copyright © 2000 - 2009 Mantis Group |