From 1aa4f83dcacb9e6c03758649d50e3c79b64b9afa Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Sat, 26 Apr 2008 15:50:39 +0000 Subject: Change friendly pickup from a toggle to a more userfriendly, easily abortable prompt, and move orc names into a file of their own. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4670 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/acr.cc | 53 ++++++++--- crawl-ref/source/dat/database/monname.txt | 143 +++++++++++++++++++++++++++++ crawl-ref/source/dat/database/randname.txt | 139 ++-------------------------- crawl-ref/source/database.cc | 2 + crawl-ref/source/mon-util.cc | 11 +-- crawl-ref/source/religion.cc | 4 +- 6 files changed, 197 insertions(+), 155 deletions(-) create mode 100644 crawl-ref/source/dat/database/monname.txt diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index 48aff3f09b..ab8e70afb7 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -1849,9 +1849,32 @@ static void _mpr_monsters() } -/* note that in some actions, you don't want to clear afterwards. - e.g. list_jewellery, etc. */ +static void _print_friendly_pickup_setting(bool was_changed) +{ + std::string now = (was_changed? "now " : ""); + if (Options.friendly_pickup == -1) + { + mprf("Your allies are %sforbidden to pick up anything at all.", + now.c_str()); + } + else if (Options.friendly_pickup == 0) + { + mprf("Your allies may %sonly pick up items dropped by allies.", + now.c_str()); + } + else if (Options.friendly_pickup == 1) + { + mprf("Your allies may %spick up anything they need.", now.c_str()); + } + else + { + mprf("Your allies are %scollecting bugs!", now.c_str()); + } +} + +// note that in some actions, you don't want to clear afterwards. +// e.g. list_jewellery, etc. void process_command( command_type cmd ) { apply_berserk_penalty = true; @@ -2016,24 +2039,28 @@ void process_command( command_type cmd ) break; case CMD_TOGGLE_FRIENDLY_PICKUP: + { // Toggle pickup mode for friendlies. - if (Options.friendly_pickup == -1) - { + _print_friendly_pickup_setting(false); + mpr("Change to (n)othing, (f)riend-dropped, or (a)ll? ", MSGCH_PROMPT); + + char type = (char) getchm(KC_DEFAULT); + type = tolower(type); + + if (type == 'n') + Options.friendly_pickup = -1; + else if (type == 'f') Options.friendly_pickup = 0; - mpr("Your allies may now only pick up items dropped by allies."); - } - else if (Options.friendly_pickup == 0) - { + else if (type == 'a') Options.friendly_pickup = 1; - mpr("Your allies may now pick up anything they need."); - } else { - Options.friendly_pickup = -1; - mpr("Your allies are now forbidden to pick up anything at all."); + canned_msg( MSG_OK ); + break; } + _print_friendly_pickup_setting(true); break; - + } case CMD_MAKE_NOTE: make_user_note(); break; diff --git a/crawl-ref/source/dat/database/monname.txt b/crawl-ref/source/dat/database/monname.txt new file mode 100644 index 0000000000..c31b5fb595 --- /dev/null +++ b/crawl-ref/source/dat/database/monname.txt @@ -0,0 +1,143 @@ +###################################################### +# monname.txt: lookup monster names +# +# This file contains a lists of names for monster +# names. This is currently only used when one of your +# orcish follower as Beogh's messiah gets named by +# Beogh. +# +# Some important syllables +# beogh, bog = referring to Beogh +# ork, orc, org, ok etc. = referring to orcs +# +# Other syllables may be borrowed from real life, +# or made up. +# +# Feel free to add to this list. Like for the other +# database lists, you may add weights (defaults to +# w:10) to make certain names more or less likely. +###################################################### +%%%% +orc name + +# Obvious references to Beogh +Arbeogh + +Bogbarth + +# slavic name, meaning "god's gift" :) +Bogdan + +Bogdar + +Bogmar + +Bogric + +Bogrim + +Bogwald + +Bogward + +Bogwik + +Morbeogh + +Sharbogh + +# Obvious references to orcs in general +Alork + +Boruk + +Marbork + +Milork + +Okrist + +Oreg + +Orgrim + +Orik + +Orkrul + +Orkwin + +Oruk + +# Other +Agrik + +Arbolt + +Argrim + +Arkwar + +Berold + +Bladwarg + +Blodwig + +Boderik + +Bolgrim + +Borgoth + +Brandogh + +Brunolf + +Dorog + +Garbold + +Gorbash + +Gorg + +Grimold + +Herok + +Hilgar + +Koronagh + +Learuk + +Margrim + +Morguth + +Morun + +Murdo + +Norbak + +Olfik + +Olfrun + +Ugbert + +Ugrim + +Wardok + +Wargrak + +Worak + +Wulfoc + +Zorug + +%%%% diff --git a/crawl-ref/source/dat/database/randname.txt b/crawl-ref/source/dat/database/randname.txt index f2eef10b80..4fe0e2c378 100644 --- a/crawl-ref/source/dat/database/randname.txt +++ b/crawl-ref/source/dat/database/randname.txt @@ -46,6 +46,13 @@ # with orc slaying, or that Zin doesn't get picked for # randarts with mutagenic properties. # +# Randart names may only have a maximum length of 25 +# symbols (spaces included). This comparison takes +# place after all replacements have been taken care +# of, and the name is thus complete. If a name turns +# out to be longer than this threshold, the game +# will roll another one. +# # Note that weapons and armour use database names for # only half of all randarts created (the others are # entirely random names), for jewellery this is only @@ -684,137 +691,5 @@ glittering w:160 @general appearance@ -%%%% - -############################################## -# monster names -############################################## -orc name - -# Some important syllables -# beogh, bog = referring to Beogh -# ork, orc, org, ok, oc, og (and more) = referring to orcs -# -# Other syllables may be borrowed from real life, or made up. - -# Obvious references to Beogh -Arbeogh - -Bogbarth - -# slavic name, meaning "god's gift" :) -Bogdan - -Bogdar - -Bogmar - -Bogric - -Bogrim - -Bogwald - -Bogward - -Bogwik - -Morbeogh - -Sharbogh - -# Obvious references to orcs in general -Alork - -Boruk - -Marbork - -Milork - -Okrist - -Oreg - -Orgrim - -Orik - -Orkrul - -Orkwin - -Oruk - -# Other -Agrik - -Arbolt - -Argrim - -Arkwar - -Berold - -Bladwarg - -Blodwig - -Boderik - -Bolgrim - -Borgoth - -Brandogh - -Brunolf - -Dorog - -Garbold - -Gorbash - -Gorg - -Grimold - -Herok - -Hilgar - -Koronagh - -Learuk - -Margrim - -Morguth - -Morun - -Murdo - -Norbak - -Olfik - -Olfrun - -Ugbert - -Ugrim - -Wardok - -Wargrak - -Worak - -Wulfoc - -Zorug %%%% diff --git a/crawl-ref/source/database.cc b/crawl-ref/source/database.cc index 461e401d80..bfb5730f83 100644 --- a/crawl-ref/source/database.cc +++ b/crawl-ref/source/database.cc @@ -72,6 +72,8 @@ static TextDB AllDBs[] = "database/rand_wpn.txt", // mostly weapons "database/rand_arm.txt", // mostly armour "database/rand_all.txt", // jewellery and general + // This doesn't really belong here, but they *are* god gifts... + "database/monname.txt", // orcish names for beogh to choose from NULL), TextDB( "db/speak", diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index e6e2e15a7d..41a9142881 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -2965,7 +2965,6 @@ void monsters::swap_slots(mon_inv_type a, mon_inv_type b) void monsters::equip_weapon(item_def &item, int near, bool msg) { - if (msg && !need_message(near)) msg = false; @@ -3054,9 +3053,7 @@ void monsters::equip(item_def &item, int slot, int near) { case OBJ_WEAPONS: { - bool give_msg = (slot == MSLOT_WEAPON - || slot == MSLOT_ALT_WEAPON - && mons_wields_two_weapons(this)); + bool give_msg = (slot == MSLOT_WEAPON || mons_wields_two_weapons(this)); equip_weapon(item, near, give_msg); break; @@ -3154,9 +3151,7 @@ bool monsters::unequip(item_def &item, int slot, int near, bool force) { case OBJ_WEAPONS: { - bool give_msg = (slot == MSLOT_WEAPON - || slot == MSLOT_ALT_WEAPON - && mons_wields_two_weapons(this)); + bool give_msg = (slot == MSLOT_WEAPON || mons_wields_two_weapons(this)); unequip_weapon(item, near, give_msg); break; @@ -3242,7 +3237,7 @@ bool monsters::drop_item(int eslot, int near) // cursed items from being removed. bool was_unequipped = false; if (eslot == MSLOT_WEAPON || eslot == MSLOT_ARMOUR - || (eslot == MSLOT_ALT_WEAPON && mons_wields_two_weapons(this) )) + || eslot == MSLOT_ALT_WEAPON && mons_wields_two_weapons(this)) { if (!unequip(mitm[index], eslot, near)) return (false); diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index 664f008488..ef0a7e602e 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -1243,8 +1243,8 @@ bool bless_follower(int follower, } } - // These effects happen if no other blessing was chosen (90%), or if - // the above attempts were all unsuccessful. + // These effects happen if no other blessing was chosen (90%), + // or if the above attempts were all unsuccessful. switch (god) { case GOD_SHINING_ONE: -- cgit v1.2.3-54-g00ecf