diff options
author | Nicholas Feinberg <pleasingfung@gmail.com> | 2014-07-27 22:37:11 -0700 |
---|---|---|
committer | Nicholas Feinberg <pleasingfung@gmail.com> | 2014-07-27 22:37:11 -0700 |
commit | d60393247bf21b88a7ab7f02af329e43fb6ba21a (patch) | |
tree | 816da6dd59a60f2b35415e6f368b7779b3d840fb | |
parent | 8821a77a8778b39e8abbadf1515ab905c596042d (diff) | |
download | crawl-ref-d60393247bf21b88a7ab7f02af329e43fb6ba21a.tar.gz crawl-ref-d60393247bf21b88a7ab7f02af329e43fb6ba21a.zip |
Move canned_message() from stuff.cc to message.cc
-rw-r--r-- | crawl-ref/source/attack.cc | 1 | ||||
-rw-r--r-- | crawl-ref/source/cloud.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/fight.cc | 1 | ||||
-rw-r--r-- | crawl-ref/source/message.cc | 127 | ||||
-rw-r--r-- | crawl-ref/source/message.h | 2 | ||||
-rw-r--r-- | crawl-ref/source/mon-abil.cc | 1 | ||||
-rw-r--r-- | crawl-ref/source/player-act.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/player-equip.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/ranged_attack.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/spl-tornado.cc | 1 | ||||
-rw-r--r-- | crawl-ref/source/spl-util.cc | 1 | ||||
-rw-r--r-- | crawl-ref/source/stuff.cc | 127 | ||||
-rw-r--r-- | crawl-ref/source/stuff.h | 6 | ||||
-rw-r--r-- | crawl-ref/source/teleport.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/transform.cc | 1 |
15 files changed, 142 insertions, 136 deletions
diff --git a/crawl-ref/source/attack.cc b/crawl-ref/source/attack.cc index a3e307dc8e..a11f4a61c8 100644 --- a/crawl-ref/source/attack.cc +++ b/crawl-ref/source/attack.cc @@ -25,6 +25,7 @@ #include "fineff.h" #include "itemname.h" #include "itemprop.h" +#include "message.h" #include "misc.h" #include "mon-behv.h" #include "mon-clone.h" diff --git a/crawl-ref/source/cloud.cc b/crawl-ref/source/cloud.cc index 4f094282a2..ee05f1e751 100644 --- a/crawl-ref/source/cloud.cc +++ b/crawl-ref/source/cloud.cc @@ -23,6 +23,7 @@ #include "losglobal.h" #include "mapmark.h" #include "melee_attack.h" +#include "message.h" #include "mgen_data.h" #include "misc.h" #include "mon-behv.h" @@ -33,7 +34,6 @@ #include "religion.h" #include "shout.h" #include "state.h" -#include "stuff.h" #include "terrain.h" #include "tiledef-gui.h" #include "tiledef-main.h" diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index 181004141c..3830e04e4a 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -24,6 +24,7 @@ #include "invent.h" #include "itemprop.h" #include "melee_attack.h" +#include "message.h" #include "mgen_data.h" #include "misc.h" #include "mon-behv.h" diff --git a/crawl-ref/source/message.cc b/crawl-ref/source/message.cc index 6fb63980c3..01ad5bad05 100644 --- a/crawl-ref/source/message.cc +++ b/crawl-ref/source/message.cc @@ -1547,6 +1547,133 @@ void more(bool user_forced) clear_messages(); } +void canned_msg(canned_message_type which_message) +{ + switch (which_message) + { + case MSG_SOMETHING_APPEARS: + mprf("Something appears %s!", + player_has_feet() ? "at your feet" : "before you"); + break; + case MSG_NOTHING_HAPPENS: + mpr("Nothing appears to happen."); + break; + case MSG_YOU_UNAFFECTED: + mpr("You are unaffected."); + break; + case MSG_YOU_RESIST: + mpr("You resist."); + learned_something_new(HINT_YOU_RESIST); + break; + case MSG_YOU_PARTIALLY_RESIST: + mpr("You partially resist."); + break; + case MSG_TOO_BERSERK: + mpr("You are too berserk!"); + crawl_state.cancel_cmd_repeat(); + break; + case MSG_TOO_CONFUSED: + mpr("You're too confused!"); + break; + case MSG_PRESENT_FORM: + mpr("You can't do that in your present form."); + crawl_state.cancel_cmd_repeat(); + break; + case MSG_NOTHING_CARRIED: + mpr("You aren't carrying anything."); + crawl_state.cancel_cmd_repeat(); + break; + case MSG_CANNOT_DO_YET: + mpr("You can't do that yet."); + crawl_state.cancel_cmd_repeat(); + break; + case MSG_OK: + mprf(MSGCH_PROMPT, "Okay, then."); + crawl_state.cancel_cmd_repeat(); + break; + case MSG_UNTHINKING_ACT: + mpr("Why would you want to do that?"); + crawl_state.cancel_cmd_repeat(); + break; + case MSG_NOTHING_THERE: + mpr("There's nothing there!"); + crawl_state.cancel_cmd_repeat(); + break; + case MSG_NOTHING_CLOSE_ENOUGH: + mpr("There's nothing close enough!"); + crawl_state.cancel_cmd_repeat(); + break; + case MSG_NO_ENERGY: + mpr("You don't have the energy to cast that spell."); + crawl_state.cancel_cmd_repeat(); + break; + case MSG_SPELL_FIZZLES: + mpr("The spell fizzles."); + break; + case MSG_HUH: + mprf(MSGCH_EXAMINE_FILTER, "Huh?"); + crawl_state.cancel_cmd_repeat(); + break; + case MSG_EMPTY_HANDED_ALREADY: + case MSG_EMPTY_HANDED_NOW: + { + const char* when = + (which_message == MSG_EMPTY_HANDED_ALREADY ? "already" : "now"); + if (you.species == SP_FELID) + mprf("Your mouth is %s empty.", when); + else if (you.has_usable_claws(true)) + mprf("You are %s empty-clawed.", when); + else if (you.has_usable_tentacles(true)) + mprf("You are %s empty-tentacled.", when); + else + mprf("You are %s empty-handed.", when); + break; + } + case MSG_YOU_BLINK: + mpr("You blink."); + break; + case MSG_STRANGE_STASIS: + mpr("You feel a strange sense of stasis."); + break; + case MSG_NO_SPELLS: + mpr("You don't know any spells."); + break; + case MSG_MANA_INCREASE: + mpr("You feel your magic capacity increase."); + break; + case MSG_MANA_DECREASE: + mpr("You feel your magic capacity decrease."); + break; + case MSG_DISORIENTED: + mpr("You feel momentarily disoriented."); + break; + case MSG_TOO_HUNGRY: + mpr("You're too hungry."); + break; + case MSG_DETECT_NOTHING: + mpr("You detect nothing."); + break; + case MSG_CALL_DEAD: + mpr("You call on the dead to rise..."); + break; + case MSG_ANIMATE_REMAINS: + mpr("You attempt to give life to the dead..."); + break; + case MSG_DECK_EXHAUSTED: + mpr("The deck of cards disappears in a puff of smoke."); + break; + case MSG_BEING_WATCHED: + mpr("You feel you are being watched by something."); + break; + case MSG_CANNOT_MOVE: + mpr("You cannot move."); + break; + case MSG_YOU_DIE: + mpr_nojoin(MSGCH_PLAIN, "You die..."); + break; + } +} + static bool is_channel_dumpworthy(msg_channel_type channel) { return channel != MSGCH_EQUIPMENT diff --git a/crawl-ref/source/message.h b/crawl-ref/source/message.h index d0a160a852..624d5e0039 100644 --- a/crawl-ref/source/message.h +++ b/crawl-ref/source/message.h @@ -24,6 +24,8 @@ void flush_prev_message(); void more(bool user_forced = false); +void canned_msg(canned_message_type which_message); + class formatted_string; void formatted_mpr(const formatted_string& fs, diff --git a/crawl-ref/source/mon-abil.cc b/crawl-ref/source/mon-abil.cc index 0c16fc953e..4a35a2f805 100644 --- a/crawl-ref/source/mon-abil.cc +++ b/crawl-ref/source/mon-abil.cc @@ -30,6 +30,7 @@ #include "itemprop.h" #include "losglobal.h" #include "libutil.h" +#include "message.h" #include "misc.h" #include "mon-act.h" #include "mon-behv.h" diff --git a/crawl-ref/source/player-act.cc b/crawl-ref/source/player-act.cc index d60ca4fd57..d304c60196 100644 --- a/crawl-ref/source/player-act.cc +++ b/crawl-ref/source/player-act.cc @@ -26,6 +26,7 @@ #include "items.h" #include "item_use.h" #include "libutil.h" +#include "message.h" #include "misc.h" #include "monster.h" #include "mon-util.h" // for decline_pronoun @@ -33,7 +34,6 @@ #include "religion.h" #include "spl-damage.h" #include "state.h" -#include "stuff.h" #include "terrain.h" #include "transform.h" #include "traps.h" diff --git a/crawl-ref/source/player-equip.cc b/crawl-ref/source/player-equip.cc index aa9dd272fe..468d8782c9 100644 --- a/crawl-ref/source/player-equip.cc +++ b/crawl-ref/source/player-equip.cc @@ -15,6 +15,7 @@ #include "itemprop.h" #include "items.h" #include "libutil.h" +#include "message.h" #include "misc.h" #include "notes.h" #include "options.h" @@ -28,7 +29,6 @@ #include "spl-summoning.h" #include "spl-wpnench.h" #include "state.h" -#include "stuff.h" #include "transform.h" #include "xom.h" diff --git a/crawl-ref/source/ranged_attack.cc b/crawl-ref/source/ranged_attack.cc index 5d5f53b2e0..7d40cad87d 100644 --- a/crawl-ref/source/ranged_attack.cc +++ b/crawl-ref/source/ranged_attack.cc @@ -16,12 +16,12 @@ #include "itemname.h" #include "itemprop.h" #include "libutil.h" +#include "message.h" #include "mon-behv.h" #include "mon-message.h" #include "monster.h" #include "player.h" #include "random.h" -#include "stuff.h" #include "teleport.h" #include "traps.h" diff --git a/crawl-ref/source/spl-tornado.cc b/crawl-ref/source/spl-tornado.cc index b3aba1ac2b..8c8ce67c7f 100644 --- a/crawl-ref/source/spl-tornado.cc +++ b/crawl-ref/source/spl-tornado.cc @@ -13,6 +13,7 @@ #include "godconduct.h" #include "libutil.h" #include "los.h" +#include "message.h" #include "mon-behv.h" #include "ouch.h" #include "shout.h" diff --git a/crawl-ref/source/spl-util.cc b/crawl-ref/source/spl-util.cc index d5f804d9fe..a24ac07297 100644 --- a/crawl-ref/source/spl-util.cc +++ b/crawl-ref/source/spl-util.cc @@ -27,6 +27,7 @@ #include "env.h" #include "items.h" #include "libutil.h" +#include "message.h" #include "mon-behv.h" #include "mon-util.h" #include "notes.h" diff --git a/crawl-ref/source/stuff.cc b/crawl-ref/source/stuff.cc index 88abdbc8e6..d8d0934309 100644 --- a/crawl-ref/source/stuff.cc +++ b/crawl-ref/source/stuff.cc @@ -389,133 +389,6 @@ int div_round_up(int num, int den) return num / den + (num % den != 0); } -void canned_msg(canned_message_type which_message) -{ - switch (which_message) - { - case MSG_SOMETHING_APPEARS: - mprf("Something appears %s!", - player_has_feet() ? "at your feet" : "before you"); - break; - case MSG_NOTHING_HAPPENS: - mpr("Nothing appears to happen."); - break; - case MSG_YOU_UNAFFECTED: - mpr("You are unaffected."); - break; - case MSG_YOU_RESIST: - mpr("You resist."); - learned_something_new(HINT_YOU_RESIST); - break; - case MSG_YOU_PARTIALLY_RESIST: - mpr("You partially resist."); - break; - case MSG_TOO_BERSERK: - mpr("You are too berserk!"); - crawl_state.cancel_cmd_repeat(); - break; - case MSG_TOO_CONFUSED: - mpr("You're too confused!"); - break; - case MSG_PRESENT_FORM: - mpr("You can't do that in your present form."); - crawl_state.cancel_cmd_repeat(); - break; - case MSG_NOTHING_CARRIED: - mpr("You aren't carrying anything."); - crawl_state.cancel_cmd_repeat(); - break; - case MSG_CANNOT_DO_YET: - mpr("You can't do that yet."); - crawl_state.cancel_cmd_repeat(); - break; - case MSG_OK: - mprf(MSGCH_PROMPT, "Okay, then."); - crawl_state.cancel_cmd_repeat(); - break; - case MSG_UNTHINKING_ACT: - mpr("Why would you want to do that?"); - crawl_state.cancel_cmd_repeat(); - break; - case MSG_NOTHING_THERE: - mpr("There's nothing there!"); - crawl_state.cancel_cmd_repeat(); - break; - case MSG_NOTHING_CLOSE_ENOUGH: - mpr("There's nothing close enough!"); - crawl_state.cancel_cmd_repeat(); - break; - case MSG_NO_ENERGY: - mpr("You don't have the energy to cast that spell."); - crawl_state.cancel_cmd_repeat(); - break; - case MSG_SPELL_FIZZLES: - mpr("The spell fizzles."); - break; - case MSG_HUH: - mprf(MSGCH_EXAMINE_FILTER, "Huh?"); - crawl_state.cancel_cmd_repeat(); - break; - case MSG_EMPTY_HANDED_ALREADY: - case MSG_EMPTY_HANDED_NOW: - { - const char* when = - (which_message == MSG_EMPTY_HANDED_ALREADY ? "already" : "now"); - if (you.species == SP_FELID) - mprf("Your mouth is %s empty.", when); - else if (you.has_usable_claws(true)) - mprf("You are %s empty-clawed.", when); - else if (you.has_usable_tentacles(true)) - mprf("You are %s empty-tentacled.", when); - else - mprf("You are %s empty-handed.", when); - break; - } - case MSG_YOU_BLINK: - mpr("You blink."); - break; - case MSG_STRANGE_STASIS: - mpr("You feel a strange sense of stasis."); - break; - case MSG_NO_SPELLS: - mpr("You don't know any spells."); - break; - case MSG_MANA_INCREASE: - mpr("You feel your magic capacity increase."); - break; - case MSG_MANA_DECREASE: - mpr("You feel your magic capacity decrease."); - break; - case MSG_DISORIENTED: - mpr("You feel momentarily disoriented."); - break; - case MSG_TOO_HUNGRY: - mpr("You're too hungry."); - break; - case MSG_DETECT_NOTHING: - mpr("You detect nothing."); - break; - case MSG_CALL_DEAD: - mpr("You call on the dead to rise..."); - break; - case MSG_ANIMATE_REMAINS: - mpr("You attempt to give life to the dead..."); - break; - case MSG_DECK_EXHAUSTED: - mpr("The deck of cards disappears in a puff of smoke."); - break; - case MSG_BEING_WATCHED: - mpr("You feel you are being watched by something."); - break; - case MSG_CANNOT_MOVE: - mpr("You cannot move."); - break; - case MSG_YOU_DIE: - mpr_nojoin(MSGCH_PLAIN, "You die..."); - break; - } -} - // Like yesno, but requires a full typed answer. // Unlike yesno, prompt should have no trailing space. // Returns true if the user typed "yes", false if something else or cancel. diff --git a/crawl-ref/source/stuff.h b/crawl-ref/source/stuff.h index 2105424f2d..115dcbf570 100644 --- a/crawl-ref/source/stuff.h +++ b/crawl-ref/source/stuff.h @@ -45,12 +45,10 @@ class game_ended_condition : public exception { }; -// canned messages & prompts - -void canned_msg(canned_message_type which_message); +// prompts bool yes_or_no(PRINTF(0, )); -typedef map<int, int> explicit_keymap; +typedef map<int, int> explicit_keymap; // doesn't need to be public bool yesno(const char * str, bool safe, int safeanswer, bool clear_after = true, bool interrupt_delays = true, bool noprompt = false, diff --git a/crawl-ref/source/teleport.cc b/crawl-ref/source/teleport.cc index 18a6dc0f79..c3b42ec0fb 100644 --- a/crawl-ref/source/teleport.cc +++ b/crawl-ref/source/teleport.cc @@ -17,6 +17,7 @@ #include "libutil.h" #include "los.h" #include "losglobal.h" +#include "message.h" #include "monster.h" #include "mon-behv.h" #include "mon-death.h" @@ -25,7 +26,6 @@ #include "random.h" #include "random-weight.h" #include "state.h" -#include "stuff.h" #include "terrain.h" #include "view.h" diff --git a/crawl-ref/source/transform.cc b/crawl-ref/source/transform.cc index 08af3d5fb2..a64ab8c237 100644 --- a/crawl-ref/source/transform.cc +++ b/crawl-ref/source/transform.cc @@ -23,6 +23,7 @@ #include "itemprop.h" #include "items.h" #include "libutil.h" +#include "message.h" #include "misc.h" #include "mon-abil.h" #include "mutation.h" |