summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-06-14 18:14:26 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-06-14 18:14:26 +0000
commit9fc1df65621c76cb9edbb781df61fabb21f61342 (patch)
treef6d2e8a707dc19ce7d99496f85652908a4e0f72a /crawl-ref/source
parent6a4da2697718db5497d17b552c11448ee47ef52a (diff)
downloadcrawl-ref-9fc1df65621c76cb9edbb781df61fabb21f61342.tar.gz
crawl-ref-9fc1df65621c76cb9edbb781df61fabb21f61342.zip
Remember choice of Beogh in character selection.
Some code reindenting and housekeeping. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1587 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/externs.h5
-rw-r--r--crawl-ref/source/fight.cc8
-rw-r--r--crawl-ref/source/hiscores.cc14
-rw-r--r--crawl-ref/source/initfile.cc55
-rw-r--r--crawl-ref/source/initfile.h5
-rw-r--r--crawl-ref/source/libutil.cc19
-rw-r--r--crawl-ref/source/libutil.h5
-rw-r--r--crawl-ref/source/menu.cc4
-rw-r--r--crawl-ref/source/newgame.cc3
-rw-r--r--crawl-ref/source/religion.cc317
-rw-r--r--crawl-ref/source/religion.h1
-rw-r--r--crawl-ref/source/view.cc34
12 files changed, 201 insertions, 269 deletions
diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h
index 99f95df13e..dfcafa683d 100644
--- a/crawl-ref/source/externs.h
+++ b/crawl-ref/source/externs.h
@@ -1497,7 +1497,7 @@ public:
int book; // auto-choose book for character
int chaos_knight; // choice of god for Chaos Knights (Xom/Makleb)
int death_knight; // choice of god/necromancy for Death Knights
- int priest; // choice of god for priests (Zin/Yred)
+ god_type priest; // choice of god for priests (Zin/Yred)
bool random_pick; // randomly generate character
int hp_warning; // percentage hp for danger warning
int magic_point_warning; // percentage mp for danger warning
@@ -1659,7 +1659,8 @@ public:
std::string prev_name;
char prev_race;
char prev_cls;
- int prev_ck, prev_dk, prev_pr;
+ int prev_ck, prev_dk;
+ god_type prev_pr;
int prev_weapon;
int prev_book;
bool prev_randpick;
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc
index 4e01f554f8..1d22ac2dac 100644
--- a/crawl-ref/source/fight.cc
+++ b/crawl-ref/source/fight.cc
@@ -1002,16 +1002,12 @@ int melee_attack::player_apply_weapon_bonuses(int damage)
&& you.species == SP_HILL_ORC)
{
if (you.religion == GOD_BEOGH)
- {
- damage++;
- }
+ damage++;
if (coinflip())
- {
- damage++;
+ damage++;
}
}
- }
return (damage);
}
diff --git a/crawl-ref/source/hiscores.cc b/crawl-ref/source/hiscores.cc
index 4d72f3e42a..227406bf9a 100644
--- a/crawl-ref/source/hiscores.cc
+++ b/crawl-ref/source/hiscores.cc
@@ -38,6 +38,7 @@
#include "branch.h"
#include "files.h"
#include "hiscores.h"
+#include "initfile.h"
#include "itemname.h"
#include "itemprop.h"
#include "items.h"
@@ -651,19 +652,6 @@ static level_area_type str_to_level_area_type(const std::string &s)
return (LEVEL_DUNGEON);
}
-static god_type str_to_god(const std::string &god)
-{
- if (god.empty())
- return GOD_NO_GOD;
-
- for (int i = GOD_NO_GOD; i < NUM_GODS; ++i)
- {
- if (god_name(static_cast<god_type>(i)) == god)
- return (static_cast<god_type>(i));
- }
- return (GOD_NO_GOD);
-}
-
void scorefile_entry::init_with_fields()
{
version = fields->str_field("v");
diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc
index 234ee6cc57..6687b09a48 100644
--- a/crawl-ref/source/initfile.cc
+++ b/crawl-ref/source/initfile.cc
@@ -31,6 +31,7 @@
#include "invent.h"
#include "libutil.h"
#include "player.h"
+#include "religion.h"
#include "stash.h"
#include "stuff.h"
#include "travel.h"
@@ -40,8 +41,6 @@
const std::string game_options::interrupt_prefix = "interrupt_";
game_options Options;
-std::string &tolower_string( std::string &str );
-
const static char *obj_syms = ")([/%.?=!.+\\0}X$";
const static int obj_syms_len = 16;
@@ -52,6 +51,24 @@ template<class A, class B> void append_vector(A &dest, const B &src)
dest.insert( dest.end(), src.begin(), src.end() );
}
+god_type str_to_god(std::string god)
+{
+ if (god.empty())
+ return (GOD_NO_GOD);
+
+ lowercase(god);
+
+ if (god == "random")
+ return (GOD_RANDOM);
+
+ for (int i = GOD_NO_GOD; i < NUM_GODS; ++i)
+ {
+ if (lowercase_string(god_name(static_cast<god_type>(i))) == god)
+ return (static_cast<god_type>(i));
+ }
+ return (GOD_NO_GOD);
+}
+
const std::string cols[16] =
{
"black", "blue", "green", "cyan", "red", "magenta", "brown",
@@ -306,19 +323,6 @@ static int str_to_class( const std::string &str )
return ((index != -1) ? index_to_letter( index ) : 0);
}
-std::string & tolower_string( std::string &str )
-{
- if (str.length())
- {
- for (std::string::iterator cp = str.begin(); cp != str.end(); cp++)
- {
- *cp = tolower( *cp );
- }
- }
-
- return (str);
-}
-
static bool read_bool( const std::string &field, bool def_value )
{
bool ret = def_value;
@@ -1005,12 +1009,10 @@ static void write_newgame_options(FILE *f)
Options.prev_dk == DK_YREDELEMNUL? "yredelemnul" :
"random");
}
- if (Options.prev_pr != GOD_NO_GOD)
+ if (is_priest_god(Options.prev_pr) || Options.prev_pr == GOD_RANDOM)
{
fprintf(f, "priest = %s\n",
- Options.prev_pr == GOD_ZIN? "zin" :
- Options.prev_pr == GOD_YREDELEMNUL? "yredelemnul" :
- "random");
+ lowercase_string(god_name(Options.prev_pr)).c_str());
}
if (Options.prev_book != SBT_NO_SELECTION )
@@ -1393,8 +1395,8 @@ void game_options::read_option_line(const std::string &str, bool runscript)
}
// Clean up our data...
- tolower_string( trim_string( key ) );
- tolower_string( trim_string( subkey ) );
+ lowercase( trim_string( key ) );
+ lowercase( trim_string( subkey ) );
// some fields want capitals... none care about external spaces
trim_string( field );
@@ -1415,7 +1417,7 @@ void game_options::read_option_line(const std::string &str, bool runscript)
&& key != "message_colour" && key != "message_color"
&& key != "levels" && key != "level" && key != "entries")
{
- tolower_string( field );
+ lowercase( field );
}
// everything not a valid line is treated as a comment
@@ -1734,11 +1736,8 @@ void game_options::read_option_line(const std::string &str, bool runscript)
else if (key == "priest")
{
// choose this weapon for classes that get choice
- if (field == "zin")
- priest = GOD_ZIN;
- else if (field == "yredelemnul")
- priest = GOD_YREDELEMNUL;
- else if (field == "random")
+ priest = str_to_god(field);
+ if (!is_priest_god(priest))
priest = GOD_RANDOM;
}
else if (key == "fire_items_start")
@@ -2806,7 +2805,7 @@ int game_options::o_colour(const char *name, int def) const
{
std::string val = o_str(name);
trim_string(val);
- tolower_string(val);
+ lowercase(val);
int col = str_to_colour(val);
return (col == -1? def : col);
}
diff --git a/crawl-ref/source/initfile.h b/crawl-ref/source/initfile.h
index ae76fda4bc..2edd72a876 100644
--- a/crawl-ref/source/initfile.h
+++ b/crawl-ref/source/initfile.h
@@ -17,8 +17,9 @@
#include <string>
#include <cstdio>
-std::string & trim_string( std::string &str );
-std::string & tolower_string( std::string &str );
+#include "enum.h"
+
+god_type str_to_god(std::string god);
int str_to_colour( const std::string &str, int default_colour = -1 );
const char* colour_to_str( unsigned char colour );
diff --git a/crawl-ref/source/libutil.cc b/crawl-ref/source/libutil.cc
index bee74bab03..27d28e6e7a 100644
--- a/crawl-ref/source/libutil.cc
+++ b/crawl-ref/source/libutil.cc
@@ -180,17 +180,24 @@ std::string make_stringf(const char *s, ...)
return (buf);
}
-void uppercase(std::string &s)
+std::string &uppercase(std::string &s)
{
- /* yes, this is bad, but std::transform() has its own problems */
- for (unsigned int i = 0; i < s.size(); ++i)
+ for (unsigned i = 0, sz = s.size(); i < sz; ++i)
s[i] = toupper(s[i]);
+ return (s);
}
-void lowercase(std::string &s)
+std::string &lowercase(std::string &s)
{
- for (unsigned int i = 0; i < s.size(); ++i)
+ for (unsigned i = 0, sz = s.size(); i < sz; ++i)
s[i] = tolower(s[i]);
+ return (s);
+}
+
+std::string lowercase_string(std::string s)
+{
+ lowercase(s);
+ return (s);
}
bool ends_with(const std::string &s, const std::string &suffix)
@@ -461,7 +468,7 @@ std::string trimmed_string( std::string s )
}
// also used with macros
-std::string & trim_string( std::string &str )
+std::string &trim_string( std::string &str )
{
str.erase( 0, str.find_first_not_of( " \t\n\r" ) );
str.erase( str.find_last_not_of( " \t\n\r" ) + 1 );
diff --git a/crawl-ref/source/libutil.h b/crawl-ref/source/libutil.h
index 63746ee8b6..e9d6d987b8 100644
--- a/crawl-ref/source/libutil.h
+++ b/crawl-ref/source/libutil.h
@@ -27,8 +27,9 @@ void cursorxy(int x, int y);
int unmangle_direction_keys(int keyin, int keymap = 0,
bool fake_ctrl = true, bool fake_shift = true);
-void lowercase(std::string &s);
-void uppercase(std::string &s);
+std::string lowercase_string(std::string s);
+std::string &lowercase(std::string &s);
+std::string &uppercase(std::string &s);
bool ends_with(const std::string &s, const std::string &suffix);
std::string pluralise(const std::string &name,
const char *no_of[] = NULL);
diff --git a/crawl-ref/source/menu.cc b/crawl-ref/source/menu.cc
index 8c0ae7645b..e3e48fcc2a 100644
--- a/crawl-ref/source/menu.cc
+++ b/crawl-ref/source/menu.cc
@@ -668,12 +668,12 @@ void slider_menu::set_limits(int y1, int y2)
void slider_menu::select_search(const std::string &s)
{
std::string srch = s;
- tolower_string(srch);
+ lowercase(srch);
for (int i = 0, size = items.size(); i < size; ++i)
{
std::string text = items[i]->get_text();
- tolower_string(text);
+ lowercase(text);
std::string::size_type found = text.find(srch);
if (found != std::string::npos
diff --git a/crawl-ref/source/newgame.cc b/crawl-ref/source/newgame.cc
index 1832b8d00a..0fc453e787 100644
--- a/crawl-ref/source/newgame.cc
+++ b/crawl-ref/source/newgame.cc
@@ -127,7 +127,8 @@ static char letter_to_class(int keyn);
static char ng_race, ng_cls;
static bool ng_random;
-static int ng_ck, ng_dk, ng_pr;
+static int ng_ck, ng_dk;
+static god_type ng_pr;
static int ng_weapon;
static int ng_book;
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index a565607775..dd271451c3 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -300,6 +300,19 @@ static bool is_good_god(god_type god)
god == GOD_ELYVILON;
}
+bool is_priest_god(god_type god)
+{
+ switch (god)
+ {
+ case GOD_ZIN:
+ case GOD_YREDELEMNUL:
+ case GOD_BEOGH:
+ return (true);
+ default:
+ return (false);
+ }
+}
+
void dec_penance(god_type god, int val)
{
if (you.penance[god] > 0)
@@ -755,6 +768,9 @@ const char *god_name( god_type which_god, bool long_name ) // mv - rewritten
case GOD_NO_GOD:
sprintf(godname_buff, "No God");
break;
+ case GOD_RANDOM:
+ sprintf(godname_buff, "random");
+ break;
case GOD_ZIN:
sprintf(godname_buff, "Zin%s", long_name ? " the Law-Giver" : "");
break;
@@ -939,6 +955,7 @@ bool did_god_conduct( int thing_done, int level )
piety_change = -level;
// no penance as Beogh is not a good god
ret = true;
+ break;
default:
break;
}
@@ -1856,210 +1873,130 @@ void divine_retribution( god_type god )
break;
case GOD_BEOGH:
-
// orcish theme
switch (random2(8))
{
- case 0: // smiting (25%)
- case 1:
- divine_hurt = 10 + random2(10);
-
- for (loopy = 0; loopy < 5; loopy++)
- divine_hurt += random2( you.experience_level );
-
- if (!player_under_penance() && you.piety > random2(400))
- {
- snprintf(info, INFO_SIZE, "Mortal, I have averted the wrath "
- "of %s... this time.", god_name(GOD_BEOGH));
+ case 0: // smiting (25%)
+ case 1:
+ divine_hurt = 10 + random2(10);
+
+ for (loopy = 0; loopy < 5; loopy++)
+ divine_hurt += random2( you.experience_level );
+
+ if (!player_under_penance() && you.piety > random2(400))
+ {
+ snprintf(info, INFO_SIZE, "Mortal, I have averted the wrath "
+ "of %s... this time.", god_name(GOD_BEOGH));
god_speaks(you.religion, info);
- }
- else
- {
- simple_god_message( " smites you!", god );
- ouch( divine_hurt, 0, KILLED_BY_BEOGH_SMITING );
- dec_penance( GOD_BEOGH, 1 );
- }
- break;
+ }
+ else
+ {
+ simple_god_message( " smites you!", god );
+ ouch( divine_hurt, 0, KILLED_BY_BEOGH_SMITING );
+ dec_penance( GOD_BEOGH, 1 );
+ }
+ break;
// taken from makeitem.cc and spells3.cc:
- case 2: // send out one or two dancing weapons of orc slaying (12.5%)
- {
- // check num of (hostile) orcs around
- int num_wpn = 0;
- for (int i=0 ;i <= random2(2); i++)
+ case 2: // send out one or two dancing weapons of orc slaying (12.5%)
+ {
+ // check num of (hostile) orcs around
+ int num_wpn = 0;
+ for (int i=0 ;i <= random2(2); i++)
+ {
+ bool created = false;
+
+ // first create item
+ int it = get_item_slot();
+ if (it != NON_ITEM)
{
- bool created = false;
-
- // first create item
- int it = get_item_slot();
- if (it != NON_ITEM)
- {
- item_def &item = mitm[it];
+ item_def &item = mitm[it];
+
+ item.quantity = 1;
+ item.base_type = OBJ_WEAPONS;
+ // any melee weapon
+ item.sub_type = WPN_CLUB + random2(13);
+
+ set_item_ego_type( item, OBJ_WEAPONS, SPWPN_ORC_SLAYING );
+ // just how good should this weapon be?
+ item.plus = random2(3);
+ item.plus2 = random2(3);
- item.quantity = 1;
- item.base_type = OBJ_WEAPONS;
- // any melee weapon
- item.sub_type = WPN_CLUB + random2(13);
-
- set_item_ego_type( item, OBJ_WEAPONS, SPWPN_ORC_SLAYING );
- // just how good should this weapon be?
- item.plus = random2(3);
- item.plus2 = random2(3);
-
- if (coinflip())
- item.flags |= ISFLAG_CURSED;
-
- set_ident_type( item.base_type, item.sub_type, ID_KNOWN_TYPE );
- // for debugging + makes things more interesting
- // (doesn't seem to have any effect, though)
- set_ident_flags( item, ISFLAG_KNOW_PLUSES );
- set_ident_flags( item, ISFLAG_IDENT_MASK );
-
- // now create monster
- int mons = create_monster( MONS_DANCING_WEAPON, 0,
- BEH_HOSTILE, you.x_pos, you.y_pos, MHITYOU, 250 );
-
- // hand item information over to monster
- if (mons != -1 && mons != NON_MONSTER)
- {
- mitm[it] = item;
- mitm[it].quantity = 1;
- mitm[it].x = 0;
- mitm[it].y = 0;
- mitm[it].link = NON_ITEM;
- menv[mons].inv[MSLOT_WEAPON] = it;
- created = true;
- num_wpn++;
-
- if (coinflip()) // 50% chance of weapon disappearing on "death"
- menv[mons].flags |= MF_HARD_RESET;
- }
- }
- if (!created) // didn't work out! delete item
- {
- mitm[it].base_type = OBJ_UNASSIGNED;
- mitm[it].quantity = 0;
- }
- }
- if (num_wpn > 0)
- {
- snprintf(info, INFO_SIZE, " throws %s of orc slaying at you.",
- num_wpn > 1 ? "implements" : "an implement");
- simple_god_message(info, god);
- break;
- } // else fall through
- }
- default: // send orcs after you (5/8)
- {
-
- int points = you.experience_level * 2 + 3
- + random2(you.experience_level * 3);
-
- // "natural" bands
- if (points >= 30) // min: lvl 6, always: lvl 15
- punisher = MONS_ORC_HIGH_PRIEST;
- else if (points >= 24) // min: lvl 5, always: lvl 11
- punisher = MONS_ORC_KNIGHT;
- else if (points >= 18) // min: lvl 4, always: lvl 8
- punisher = MONS_ORC_WARLORD;
- else if (points >= 12) // min: lvl 2, always: lvl 5
- punisher = MONS_ORC_WARRIOR;
- else
- punisher = MONS_ORC;
+ if (coinflip())
+ item.flags |= ISFLAG_CURSED;
- int mons = create_monster(punisher, 0, BEH_HOSTILE, you.x_pos,
- you.y_pos, MHITYOU, 250, true);
-
- if (mons != -1 && mons != NON_MONSTER)
- simple_god_message(" sends forth an army of orcs.", god);
- else
- simple_god_message(" is still gathering forces against you.", god);
-
-/*
- success = false;
- int count = 0;
- int points = 3 + you.experience_level * 3;
-
- // artificial choice of band members
- while (points > 0 || count <= 1)
- {
- if (points > 30 && coinflip())
- {
- // quick reduction for large values
- punisher = MONS_ORC_HIGH_PRIEST;
- points -= 25;
- break;
- }
- else
- {
- switch (random2(15))
- {
- case 0: //(1/15)
- punisher = MONS_ORC_SORCERER;
- points -= 20;
- break;
-
- case 1: //(1/15)
- punisher = MONS_ORC_WARLORD;
- points -= 18;
- break;
-
- case 2: //(1/15)
- punisher = MONS_ORC_KNIGHT;
- points -= 15;
- break;
-
- case 3:
- case 4: //(2/15)
- punisher = MONS_ORC_WARRIOR;
- points -= 10;
- break;
-
- case 5:
- case 6:
- case 7: //(1/5)
- punisher = MONS_ORC_PRIEST;
- points -= 7;
- break;
-
- case 8:
- case 9: //(2/15)
- punisher = MONS_ORC_WIZARD;
- punisher -= 5;
- break;
-
- default: //(1/3)
- punisher = MONS_ORC;
- points -= 3;
- }
- }
-
- int mons = create_monster(punisher, 0, BEH_HOSTILE,
- you.x_pos, you.y_pos, MHITYOU, 250);
+ set_ident_type( item.base_type, item.sub_type,
+ ID_KNOWN_TYPE );
+
+ // for debugging + makes things more interesting
+ // (doesn't seem to have any effect, though)
+ set_ident_flags( item, ISFLAG_KNOW_PLUSES );
+ set_ident_flags( item, ISFLAG_IDENT_MASK );
+
+ // now create monster
+ int mons =
+ create_monster( MONS_DANCING_WEAPON, 0,
+ BEH_HOSTILE, you.x_pos, you.y_pos,
+ MHITYOU, 250 );
+
+ // hand item information over to monster
if (mons != -1 && mons != NON_MONSTER)
{
- count++;
- success = true;
- // just to make sure
- menv[mons].flags |= MF_CONVERT_ATTEMPT;
+ mitm[it] = item;
+ mitm[it].quantity = 1;
+ mitm[it].x = 0;
+ mitm[it].y = 0;
+ mitm[it].link = NON_ITEM;
+ menv[mons].inv[MSLOT_WEAPON] = it;
+ created = true;
+ num_wpn++;
+
+ // 50% chance of weapon disappearing on "death"
+ if (coinflip())
+ menv[mons].flags |= MF_HARD_RESET;
}
}
-
- if (success)
+ if (!created) // didn't work out! delete item
{
- std::string army_size;
- if (count > 5)
- army_size = "an army of";
- else
- army_size = "some";
-
- snprintf(info, INFO_SIZE, " sends forth %s orcs.", army_size.c_str());
- simple_god_message(info, god);
+ mitm[it].base_type = OBJ_UNASSIGNED;
+ mitm[it].quantity = 0;
}
- else
- simple_god_message(" is still gathering forces against you.", god);
-*/
- }
- break;
+ }
+ if (num_wpn > 0)
+ {
+ snprintf(info, INFO_SIZE, " throws %s of orc slaying at you.",
+ num_wpn > 1 ? "implements" : "an implement");
+ simple_god_message(info, god);
+ break;
+ } // else fall through
+ }
+ default: // send orcs after you (5/8)
+ {
+
+ int points = you.experience_level * 2 + 3
+ + random2(you.experience_level * 3);
+
+ // "natural" bands
+ if (points >= 30) // min: lvl 6, always: lvl 15
+ punisher = MONS_ORC_HIGH_PRIEST;
+ else if (points >= 24) // min: lvl 5, always: lvl 11
+ punisher = MONS_ORC_KNIGHT;
+ else if (points >= 18) // min: lvl 4, always: lvl 8
+ punisher = MONS_ORC_WARLORD;
+ else if (points >= 12) // min: lvl 2, always: lvl 5
+ punisher = MONS_ORC_WARRIOR;
+ else
+ punisher = MONS_ORC;
+
+ int mons = create_monster(punisher, 0, BEH_HOSTILE, you.x_pos,
+ you.y_pos, MHITYOU, 250, true);
+
+ if (mons != -1 && mons != NON_MONSTER)
+ simple_god_message(" sends forth an army of orcs.", god);
+ else
+ simple_god_message(" is still gathering forces against you.",
+ god);
+ break;
+ }
}
break;
diff --git a/crawl-ref/source/religion.h b/crawl-ref/source/religion.h
index 208f57b9bf..afed5bb7c1 100644
--- a/crawl-ref/source/religion.h
+++ b/crawl-ref/source/religion.h
@@ -16,6 +16,7 @@
#include "enum.h"
+bool is_priest_god(god_type god);
void simple_god_message( const char *event, god_type which_deity = GOD_NO_GOD );
int piety_breakpoint(int i);
const char *god_name(god_type which_god, bool long_name = false); //mv
diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc
index e6ece3e0e7..bb648c7741 100644
--- a/crawl-ref/source/view.cc
+++ b/crawl-ref/source/view.cc
@@ -722,7 +722,7 @@ void monster_grid(bool do_updates)
&& mons_player_visible(monster) && !mons_is_sleeping(monster)
&& !mons_is_confused(monster) && !mons_is_paralysed(monster))
{
- monster->flags |= MF_CONVERT_ATTEMPT;
+ monster->flags |= MF_CONVERT_ATTEMPT;
int hd = monster->hit_dice;
@@ -735,10 +735,10 @@ void monster_grid(bool do_updates)
&& get_weapon_brand( you.inv[wpn] ) == SPWPN_ORC_SLAYING
&& coinflip()) // 50% chance of conversion failing
{
- snprintf(info, INFO_SIZE, "%s flinches from your weapon.",
- monster->name(DESC_CAP_THE).c_str());
- mpr(info);
- continue;
+ snprintf(info, INFO_SIZE, "%s flinches from your weapon.",
+ monster->name(DESC_CAP_THE).c_str());
+ mpr(info);
+ continue;
}
if (player_monster_visible(monster)) // show reaction
@@ -795,18 +795,18 @@ void monster_grid(bool do_updates)
&& mons_player_visible(monster) && !mons_is_sleeping(monster)
&& !mons_is_confused(monster) && !mons_is_paralysed(monster))
{ // reconversion if no longer Beogh
-
- monster->attitude = ATT_HOSTILE;
- monster->behaviour = BEH_HOSTILE;
- // CREATED_FRIENDLY stays -> no piety bonus on killing these
-
- // give message only sometimes
- if (player_monster_visible(monster) && random2(4))
- {
- snprintf(info, INFO_SIZE, "%s deserts you.",
- monster->name(DESC_CAP_THE).c_str());
- mpr(info, MSGCH_MONSTER_ENCHANT);
- }
+
+ monster->attitude = ATT_HOSTILE;
+ monster->behaviour = BEH_HOSTILE;
+ // CREATED_FRIENDLY stays -> no piety bonus on killing these
+
+ // give message only sometimes
+ if (player_monster_visible(monster) && random2(4))
+ {
+ snprintf(info, INFO_SIZE, "%s deserts you.",
+ monster->name(DESC_CAP_THE).c_str());
+ mpr(info, MSGCH_MONSTER_ENCHANT);
+ }
} // end of Beogh routine
} // end "if (monster->type != -1 && mons_ner)"