summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2006-09-20 23:32:51 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2006-09-20 23:32:51 +0000
commit5e856e06238d18c9a42bc92b1d488ab475a01a5f (patch)
treeaf98dd7e3abcc800b6720638cb8a06560e15e983
parent79b18d33d39ce5d1b467c31f2d2db6abf86a3ba2 (diff)
downloadcrawl-ref-5e856e06238d18c9a42bc92b1d488ab475a01a5f.tar.gz
crawl-ref-5e856e06238d18c9a42bc92b1d488ab475a01a5f.zip
Fixed a zillion compiler warnings. Still another zillion left.
Put in the religion.cc changes which I'd forgot to add in from the inscription patch. [Note: if any of the god ability piety thresholds has changed, this should be changed in notes.cc] git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup@57 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/Kills.cc8
-rw-r--r--crawl-ref/source/debug.cc2
-rw-r--r--crawl-ref/source/fight.cc6
-rw-r--r--crawl-ref/source/food.cc4
-rw-r--r--crawl-ref/source/items.cc6
-rw-r--r--crawl-ref/source/libutil.h5
-rw-r--r--crawl-ref/source/mon-util.cc2
-rw-r--r--crawl-ref/source/mon-util.h2
-rw-r--r--crawl-ref/source/monplace.cc2
-rw-r--r--crawl-ref/source/religion.cc73
10 files changed, 79 insertions, 31 deletions
diff --git a/crawl-ref/source/Kills.cc b/crawl-ref/source/Kills.cc
index 06f465bb70..d49bf556ed 100644
--- a/crawl-ref/source/Kills.cc
+++ b/crawl-ref/source/Kills.cc
@@ -413,7 +413,7 @@ void Kills::record_ghost_kill(const struct monsters *mon)
kill_def::kill_def(const struct monsters *mon) : kills(0), exp(0)
{
- exp = exper_value( (struct monsters *) mon);
+ exp = exper_value(mon);
add_kill(mon, get_packed_place());
}
@@ -704,7 +704,7 @@ void kill_def::load(FILE *file)
kill_ghost::kill_ghost(const struct monsters *mon)
{
- exp = exper_value( (struct monsters *) mon);
+ exp = exper_value(mon);
place = get_packed_place();
ghost_name = ghost.name;
@@ -758,8 +758,8 @@ kill_monster_desc::kill_monster_desc(const monsters *mon)
}
if (modifier != M_NORMAL) monnum = mon->number;
- if (mons_has_ench((struct monsters *) mon, ENCH_SHAPESHIFTER) ||
- mons_has_ench((struct monsters *) mon, ENCH_GLOWING_SHAPESHIFTER))
+ if (mons_has_ench(mon, ENCH_SHAPESHIFTER) ||
+ mons_has_ench(mon, ENCH_GLOWING_SHAPESHIFTER))
modifier = M_SHAPESHIFTER;
// XXX: Ugly hack - merge all mimics into one mimic record.
diff --git a/crawl-ref/source/debug.cc b/crawl-ref/source/debug.cc
index 13bf8739d9..cd0dcdee43 100644
--- a/crawl-ref/source/debug.cc
+++ b/crawl-ref/source/debug.cc
@@ -506,7 +506,7 @@ void debug_change_species( void )
int sp = -1;
- for (int i = SP_HUMAN; i < NUM_SPECIES; i++)
+ for (i = SP_HUMAN; i < NUM_SPECIES; i++)
{
char sp_name[80];
strncpy( sp_name, species_name(i, you.experience_level), sizeof( sp_name ) );
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc
index 3a75fd7c9c..1e99ce93b5 100644
--- a/crawl-ref/source/fight.cc
+++ b/crawl-ref/source/fight.cc
@@ -1729,7 +1729,7 @@ bool you_attack(int monster_attacked, bool unarmed_attacks)
if (your_to_hit >= defender->evasion || one_chance_in(30))
{
- bool hit = true;
+ hit = true;
int dammod = 10;
const int dam_stat_val = calc_stat_to_dam_base();
@@ -2929,7 +2929,7 @@ bool monsters_fight(int monster_attacking, int monster_attacked)
int weapon = -1; // monster weapon, if any
int damage_taken = 0;
bool hit = false;
- int mmov_x = 0;
+ // int mmov_x = 0;
bool water_attack = false;
int specdam = 0;
int hand_used = 0;
@@ -3446,7 +3446,7 @@ bool monsters_fight(int monster_attacking, int monster_attacked)
{
if (sees)
{
- mmov_x = attacker->inv[hand_used];
+ // mmov_x = attacker->inv[hand_used];
strcpy(info, ptr_monam(attacker, DESC_CAP_THE));
strcat(info, " freezes ");
diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc
index d8a0765a25..1acf2f3d4f 100644
--- a/crawl-ref/source/food.cc
+++ b/crawl-ref/source/food.cc
@@ -338,7 +338,7 @@ bool butchery(void)
strcat(info, "\?");
mpr(info, MSGCH_PROMPT);
- unsigned char keyin = getch();
+ keyin = getch();
if (keyin == 0)
{
@@ -354,7 +354,7 @@ bool butchery(void)
return (false);
}
- int item_got = igrd[you.x_pos][you.y_pos];
+ item_got = igrd[you.x_pos][you.y_pos];
last_item = NON_ITEM;
diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc
index 190c5dd690..4439e8d4c9 100644
--- a/crawl-ref/source/items.cc
+++ b/crawl-ref/source/items.cc
@@ -181,9 +181,9 @@ int cull_items(void)
else if (is_unrandom_artefact( mitm[item] ))
{
// 9. unmark unrandart
- int x = find_unrandart_index(item);
- if (x >= 0)
- set_unrandart_exist(x, 0);
+ int z = find_unrandart_index(item);
+ if (z >= 0)
+ set_unrandart_exist(z, 0);
}
// POOF!
diff --git a/crawl-ref/source/libutil.h b/crawl-ref/source/libutil.h
index 807d3f25a2..94977aeeba 100644
--- a/crawl-ref/source/libutil.h
+++ b/crawl-ref/source/libutil.h
@@ -117,12 +117,13 @@ public:
text_pattern()
: pattern(), compiled_pattern(NULL),
- isvalid(false), ignore_case(false)
+ isvalid(false), ignore_case(false)
{
}
text_pattern(const text_pattern &tp)
- : pattern(tp.pattern),
+ : base_pattern(tp),
+ pattern(tp.pattern),
compiled_pattern(NULL),
isvalid(tp.isvalid),
ignore_case(tp.ignore_case)
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index 7ce15b9660..6ed25cad3c 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -747,7 +747,7 @@ int mons_type_hit_dice( int type )
}
-int exper_value( struct monsters *monster )
+int exper_value( const struct monsters *monster )
{
long x_val = 0;
diff --git a/crawl-ref/source/mon-util.h b/crawl-ref/source/mon-util.h
index c3f55c8d50..e6f97da0e6 100644
--- a/crawl-ref/source/mon-util.h
+++ b/crawl-ref/source/mon-util.h
@@ -174,7 +174,7 @@ bool mons_is_unique(int mclass);
* called from: describe - fight
* *********************************************************************** */
// int exper_value(int mclass, int mHD, int maxhp);
-int exper_value( struct monsters *monster );
+int exper_value( const struct monsters *monster );
// last updated 12may2000 {dlb}
diff --git a/crawl-ref/source/monplace.cc b/crawl-ref/source/monplace.cc
index 0d1013e3f2..26fb39e06b 100644
--- a/crawl-ref/source/monplace.cc
+++ b/crawl-ref/source/monplace.cc
@@ -1032,7 +1032,7 @@ static int band_member(int band, int power)
break;
case BAND_DRACONIAN:
{
- const int temp_rand = random2( (power < 24) ? 24 : 37 );
+ temp_rand = random2( (power < 24) ? 24 : 37 );
mon_type =
((temp_rand > 35) ? MONS_DRACONIAN_CALLER : // 1 in 34
(temp_rand > 33) ? MONS_DRACONIAN_KNIGHT : // 2 in 34
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index 8a2edd2095..8dd8702ff2 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -50,6 +50,7 @@
#include "monplace.h"
#include "mutation.h"
#include "newgame.h"
+#include "notes.h"
#include "ouch.h"
#include "player.h"
#include "randart.h"
@@ -179,7 +180,7 @@ void pray(void)
strcat(info, "un");
strcat(info, "life.");
- mpr(info);
+ mpr(info, MSGCH_PRAY);
return;
}
else if (you.religion == GOD_XOM)
@@ -211,7 +212,7 @@ void pray(void)
strcpy( info, "You offer a prayer to " );
strcat( info, god_name( you.religion ) );
strcat( info, "." );
- mpr(info);
+ mpr(info, MSGCH_PRAY);
you.duration[DUR_PRAYER] = 9 + (random2(you.piety) / 20)
+ (random2(you.piety) / 20);
@@ -232,7 +233,7 @@ void pray(void)
: "displeased");
strcat(info, ".");
- god_speaks(you.religion, info);
+ mpr( info, MSGCH_PRAY, you.religion );
if (you.piety > 130)
you.duration[DUR_PRAYER] *= 3;
@@ -310,6 +311,7 @@ void pray(void)
you.attribute[ATTR_CARD_COUNTDOWN] = 10;
inc_gift_timeout(5 + random2avg(9, 2));
you.num_gifts[you.religion]++;
+ take_note(Note(NOTE_GOD_GIFT, you.religion));
}
}
break;
@@ -329,6 +331,7 @@ void pray(void)
inc_gift_timeout( 4 + roll_dice(2,4) );
you.num_gifts[ you.religion ]++;
+ take_note(Note(NOTE_GOD_GIFT, you.religion));
}
break;
}
@@ -357,6 +360,7 @@ void pray(void)
inc_gift_timeout(30 + random2avg(19, 2));
you.num_gifts[ you.religion ]++;
+ take_note(Note(NOTE_GOD_GIFT, you.religion));
}
}
break;
@@ -373,6 +377,7 @@ void pray(void)
more();
inc_gift_timeout(4 + random2avg(7, 2));
you.num_gifts[you.religion]++;
+ take_note(Note(NOTE_GOD_GIFT, you.religion));
}
}
break;
@@ -452,6 +457,7 @@ void pray(void)
inc_gift_timeout(40 + random2avg(19, 2));
you.num_gifts[ you.religion ]++;
+ take_note(Note(NOTE_GOD_GIFT, you.religion));
}
// Vehumet gives books less readily
@@ -906,6 +912,10 @@ void Xom_acts(bool niceness, int sever, bool force_sever)
(temp_rand == 1) ? "Xom grants you a demonic servitor."
: "Xom opens a gate.");
}
+ else
+ {
+ god_speaks(GOD_XOM, "You hear Xom cackling.");
+ }
done_good = true; // well, for Xom, trying == doing {dlb}
}
@@ -978,10 +988,13 @@ void Xom_acts(bool niceness, int sever, bool force_sever)
}
} // end "Good Things"
- if (done_bad || done_good || one_chance_in(4))
- return;
- else
- goto okay_try_again;
+ if (done_bad || done_good )
+ return;
+ if ( one_chance_in(4) ) {
+ god_speaks(GOD_XOM, "Xom's attention is distracted from you.");
+ return;
+ }
+ goto okay_try_again;
} // end Xom_acts()
// This function is the merger of done_good() and naughty().
@@ -1382,6 +1395,7 @@ void gain_piety(char pgn)
if (you.piety >= 30 && old_piety < 30)
{
+ take_note(Note(NOTE_GOD_POWER, you.religion, 0));
switch (you.religion)
{
case GOD_NO_GOD:
@@ -1420,6 +1434,7 @@ void gain_piety(char pgn)
if (you.piety >= 50 && old_piety < 50)
{
+ take_note(Note(NOTE_GOD_POWER, you.religion, 1));
switch (you.religion)
{
case GOD_NO_GOD:
@@ -1465,6 +1480,7 @@ void gain_piety(char pgn)
if (you.piety >= 75 && old_piety < 75)
{
+ take_note(Note(NOTE_GOD_POWER, you.religion, 2));
switch (you.religion)
{
case GOD_NO_GOD:
@@ -1503,6 +1519,7 @@ void gain_piety(char pgn)
if (you.piety >= 100 && old_piety < 100)
{
+ take_note(Note(NOTE_GOD_POWER, you.religion, 3));
switch (you.religion)
{
case GOD_NO_GOD:
@@ -1545,6 +1562,7 @@ void gain_piety(char pgn)
if (you.piety >= 120 && old_piety < 120)
{
+ take_note(Note(NOTE_GOD_POWER, you.religion, 4));
switch (you.religion)
{
case GOD_NO_GOD:
@@ -1856,6 +1874,10 @@ void divine_retribution( int god )
{
simple_god_message( " sends the divine host to punish you for your evil ways!", god );
}
+ else
+ {
+ simple_god_message("'s divine host fails to appear.", god);
+ }
}
else
{
@@ -1905,6 +1927,10 @@ void divine_retribution( int god )
{
simple_god_message(" sends the divine host to punish you for your evil ways!", god);
}
+ else
+ {
+ simple_god_message("'s divine host fails to appear.", god);
+ }
}
else
{
@@ -1927,6 +1953,10 @@ void divine_retribution( int god )
simple_god_message(" sends a greater servant after you!",
god);
}
+ else
+ {
+ simple_god_message("'s greater servant is unavoidably detained.", god);
+ }
}
else
{
@@ -1944,6 +1974,8 @@ void divine_retribution( int god )
if (success)
simple_god_message(" sends minions to punish you.", god);
+ else
+ simple_god_message("'s minions fail to arrive.", god);
}
break;
@@ -1965,6 +1997,8 @@ void divine_retribution( int god )
if (success)
simple_god_message(" unleashes Death upon you!", god);
+ else
+ god_speaks(god, "Death has been delayed...for now.");
}
else
{
@@ -2006,6 +2040,8 @@ void divine_retribution( int god )
if (success)
simple_god_message(" sends a servant to punish you.", god);
+ else
+ simple_god_message("'s servant fails to arrive.", god);
}
else
{
@@ -2089,6 +2125,8 @@ void divine_retribution( int god )
if (success)
simple_god_message(" sends monsters to punish you.", god);
+ else
+ simple_god_message(" has no time to punish you...now.", god);
}
break;
@@ -2175,20 +2213,22 @@ void divine_retribution( int god )
if (success)
simple_god_message(" sends forces against you!", god);
+ else
+ simple_god_message("'s forces are busy with other wars.", god);
}
break;
case GOD_VEHUMET:
// conjuration and summoning theme
- simple_god_message("'s vengence finds you.", god);
+ simple_god_message("'s vengeance finds you.", god);
miscast_effect( coinflip() ? SPTYP_CONJURATION : SPTYP_SUMMONING,
8 + you.experience_level, random2avg(98, 3), 100,
"the wrath of Vehumet" );
break;
case GOD_NEMELEX_XOBEH:
- // like Xom, this might actually help the player -- bwr`
- simple_god_message(" makes you to draw from the Deck of Punishment.",
+ // like Xom, this might actually help the player -- bwr
+ simple_god_message(" makes you draw from the Deck of Punishment.",
god);
deck_of_cards(DECK_OF_PUNISHMENT);
break;
@@ -2213,7 +2253,7 @@ void divine_retribution( int god )
case 5:
case 6:
- miscast_effect(SK_DIVINATIONS, 9, 90, 100, "the will of Sif Muna");
+ miscast_effect(SPTYP_DIVINATION, 9, 90, 100, "the will of Sif Muna");
break;
case 7:
@@ -2241,11 +2281,13 @@ void divine_retribution( int god )
return;
}
- // Sometimes divine experiences are overwelming...
+ // Sometimes divine experiences are overwhelming...
if (one_chance_in(5) && you.experience_level < random2(37))
{
- if (coinflip())
+ if (coinflip()) {
+ mpr( "The divine experience confuses you!", MSGCH_WARN);
confuse_player( 3 + random2(10) );
+ }
else
{
if (you.slow < 90)
@@ -2265,6 +2307,8 @@ void excommunication(void)
{
const int old_god = you.religion;
+ take_note(Note(NOTE_LOSE_GOD, old_god));
+
you.duration[DUR_PRAYER] = 0;
you.religion = GOD_NO_GOD;
you.piety = 0;
@@ -2354,6 +2398,7 @@ static bool bless_weapon( int god, int brand, int colour )
you.wield_change = true;
you.num_gifts[god]++;
+ take_note(Note(NOTE_GOD_GIFT, you.religion));
you.flash_colour = colour;
viewwindow( true, false );
@@ -2572,6 +2617,8 @@ void god_pitch(unsigned char which_god)
if (you.worshipped[you.religion] < 100)
you.worshipped[you.religion]++;
+ take_note(Note(NOTE_GET_GOD, you.religion));
+
// Currently penance is just zeroed, this could be much more interesting.
you.penance[you.religion] = 0;