summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-03-24 13:41:56 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-03-24 13:41:56 +0000
commit9bec932ccdd73db4bab274c36acf0cb9de818b88 (patch)
tree0e112fbec6a1e894f63828ead92d90aadfd8a246 /crawl-ref
parent80c2e92a48255ff21bb397442fd75f03f47ac1f1 (diff)
downloadcrawl-ref-9bec932ccdd73db4bab274c36acf0cb9de818b88.tar.gz
crawl-ref-9bec932ccdd73db4bab274c36acf0cb9de818b88.zip
Change reciting speech code to use seed_rng(turn counter) instead, to
yield more varied choices. Also add dozens of synonyms to godspeak.txt. Tweak religious favour descriptions for good gods to only say that their "wrath is upon you" if you now worship a god they hate (evil god, or Xom, for Zin). Ely will now also heal/protect holy beings, and only protect allies the player can see. Otherwise they can't do anything to prevent its death anyway. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3857 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/dat/database/godspeak.txt151
-rw-r--r--crawl-ref/source/delay.cc29
-rw-r--r--crawl-ref/source/describe.cc42
-rw-r--r--crawl-ref/source/monstuff.cc19
4 files changed, 199 insertions, 42 deletions
diff --git a/crawl-ref/source/dat/database/godspeak.txt b/crawl-ref/source/dat/database/godspeak.txt
index 4abab6d5c8..f3e548243b 100644
--- a/crawl-ref/source/dat/database/godspeak.txt
+++ b/crawl-ref/source/dat/database/godspeak.txt
@@ -368,22 +368,55 @@ Beogh seems highly displeased.
##########################################################
# Messages for the *player* using Zin's Recite invocation
##########################################################
+recite_start
+
+begin
+
+launch into
+
+embark on
+
+%%%%
+recite_what
+
+a poem about
+
+the sacred texts on
+
+the word of Zin on
+
+sonorously on
+
+loudly on
+
+%%%%
zin_recite_speech_start
w:40
-reciting @subject@
+begin reciting @axioms_of_law@
+
+begin reciting @recite_what@ @recite_subject@
+
+begin preaching about @recite_subject@
+
+@recite_start@ a @lecture_modifier@ lecture about @recite_subject@
-reciting a poem about @subject@
+begin explaining in detail about @recite_subject@
-preaching about @subject@
+begin explaining the importance of @important_subject@
-a @lecture_modifier@ lecture about @subject@
+@recite_start@ a @lecture_modifier@ sermon about @recite_subject@
+
+@recite_start@ a @lecture_modifier@ speech about @recite_subject@
+
+w:5
+begin speaking about @recite_subject@
-explaining in detail about @subject@
%%%%
# the short form of the above, for continuing/stopping/finishing
-# reciting - order and weights must be the same as above!
-zin_recite_speech_
+# reciting -- order and weights must be the same as above!
+# doesn't need finishing interpunction
+zin_recite_speech_other
w:50
reciting
@@ -392,7 +425,14 @@ preaching
your lecture
+w:20
your explanations
+
+your sermon
+
+w:15
+your speech
+
%%%%
lecture_modifier
@@ -401,12 +441,101 @@ lengthy
passionate
stern
+
%%%%
-subject
+axioms_of_law
+
+Zin's Axioms of Law.
+
+the Axioms of Law.
+
+the books of the Law.
+
+the sacred Law of Zin.
+
+%%%%
+# used for "explaining the importance of ..."
+important_subject
+
+# law
+w:50
+@axioms_of_law@
+
+the eternal Law.
+
+obedience to the Law.
+
+the one true way.
+
+# purity
+purity of body and mind.
+
+preserving your bodily integrity.
+
+keeping your body clean and pure.
+
+proper care of body and soul.
+
+# mutations
+avoiding mutations.
+
+just saying no to mutations.
+
+# respecting intelligent beings
+proper burial practice.
+
+# demons
+not dealing with demons.
+
+rejecting the service of demons.
+
+%%%%
+# the subject of your recital/lecture/whatever
+# needs the full dot or exclamation mark
+recite_subject
+
+w:120
+@important_subject@
+
+# first, law and order
+w:80
+@axioms_of_law@
+
+the Law and the prophets.
+
+the importance of the Law.
+
+# anti-mutation
+mutations, and how to avoid them.
+
+potions of Mutation - the devil's brew!
+
+Neqoxecs and Cacodemons -- may they all be destroyed!
+
+# respecting intelligent beings
+a proper diet respecting intelligent beings.
+
+# necromancy and evil
+the evils of necromancy.
+
+undead, and why they are evil.
+
+# the gods
+the fall of Lugonu.
+
+the alliance of Zin and the Shining One.
+
+the evilness of @evil_god@.
+%%%%
+evil_god
+
+Kikubaaqudgha
+
+Makhleb
-Zin's Axioms of Law
+Yredelmnul
-the Axioms of Law
+Beogh
-the importance of the Law
+Lugonu
%%%%
diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc
index adfdad2bbf..d54fcdfe41 100644
--- a/crawl-ref/source/delay.cc
+++ b/crawl-ref/source/delay.cc
@@ -195,14 +195,17 @@ static int recite_to_monsters(int x, int y, int pow, int unused)
static const char* _get_recite_speech(const std::string key, int weight)
{
- const std::string str
- = getWeightedSpeechString("zin_recite_speech_", key,
- weight + you.x_pos + you.y_pos);
-
+ seed_rng( weight + you.x_pos + you.y_pos);
+ const std::string str = getSpeakString("zin_recite_speech_" + key);
+
if (!str.empty())
return (str.c_str());
-
- return ("reciting the Axioms of Law");
+
+ // in case nothing is found
+ if (key == "start")
+ return ("begin reciting the Axioms of Law.");
+
+ return ("reciting");
}
// Returns true if this delay can act as a parent to other delays, i.e. if
@@ -352,7 +355,7 @@ void stop_delay( bool stop_stair_travel )
case DELAY_RECITE:
mprf(MSGCH_PLAIN, "You stop %s.",
- _get_recite_speech("stop", delay.parm1 + delay.parm2));
+ _get_recite_speech("other", you.num_turns + delay.duration));
pop_delay();
break;
@@ -484,8 +487,8 @@ int check_recital_audience()
continue;
mons = &menv[mid];
- if (!found_monsters)
- found_monsters = true;
+ if (!found_monsters)
+ found_monsters = true;
// can not be affected in these states
if (recite_mons_useless(mons))
@@ -550,8 +553,8 @@ void handle_delay( void )
mpr("You begin to meditate on the wall.", MSGCH_MULTITURN_ACTION);
break;
case DELAY_RECITE:
- mprf(MSGCH_PLAIN, "You begin %s.",
- _get_recite_speech("start", delay.parm1 + delay.parm2));
+ mprf(MSGCH_PLAIN, "You %s",
+ _get_recite_speech("start", you.num_turns + delay.duration));
apply_area_visible(recite_to_monsters, delay.parm1);
break;
default:
@@ -701,7 +704,7 @@ void handle_delay( void )
break;
case DELAY_RECITE:
mprf(MSGCH_MULTITURN_ACTION, "You continue %s.",
- _get_recite_speech("continue", delay.parm1 + delay.parm2));
+ _get_recite_speech("other", you.num_turns + delay.duration+1));
apply_area_visible(recite_to_monsters, delay.parm1);
break;
case DELAY_MULTIDROP:
@@ -808,7 +811,7 @@ static void finish_delay(const delay_queue_item &delay)
case DELAY_RECITE:
mprf(MSGCH_PLAIN, "You finish %s.",
- _get_recite_speech("finish", delay.parm1 + delay.parm2));
+ _get_recite_speech("other", you.num_turns + delay.duration));
break;
case DELAY_PASSWALL:
diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc
index 71af3e2b9a..7fa4f9b43e 100644
--- a/crawl-ref/source/describe.cc
+++ b/crawl-ref/source/describe.cc
@@ -2304,9 +2304,9 @@ std::string describe_favour(god_type which_god)
{
const int penance = you.penance[which_god];
return (penance >= 50) ? "Godly wrath is upon you!" :
- (penance >= 20) ? "You've transgressed heavily! Be penitent!" :
- (penance >= 5 ) ? "You are under penance."
- : "You should show more discipline.";
+ (penance >= 20) ? "You've transgressed heavily! Be penitent!" :
+ (penance >= 5 ) ? "You are under penance."
+ : "You should show more discipline.";
}
return (which_god == GOD_XOM)?
@@ -2367,6 +2367,19 @@ static std::string religion_help( god_type god )
return result;
}
+static bool _god_hates_your_god( god_type which_god )
+{
+ // non-good gods always hate your current god
+ if (!is_good_god(which_god))
+ return (true);
+
+ // Zin hates Xom and Makhleb
+ if (which_god == GOD_ZIN && is_chaotic_god(you.religion))
+ return (true);
+
+ return (is_evil_god(you.religion));
+}
+
void describe_god( god_type which_god, bool give_title )
{
int colour; // mv: colour used for some messages
@@ -2501,12 +2514,23 @@ void describe_god( god_type which_god, bool give_title )
if (you.religion != which_god)
{
textcolor (colour);
- cprintf( (you.penance[which_god] >= 50) ? "%s's wrath is upon you!" :
- (you.penance[which_god] >= 20) ? "%s is annoyed with you." :
- (you.penance[which_god] >= 5) ? "%s well remembers your sins." :
- (you.penance[which_god] > 0) ? "%s is ready to forgive your sins." :
- (you.worshipped[which_god]) ? "%s is ambivalent towards you."
- : "%s is neutral towards you.",
+ int which_god_penance = you.penance[which_god];
+
+ // give more appropriate for the good gods
+ if (which_god_penance > 0 && is_good_god(which_god))
+ {
+ if (is_good_god(you.religion))
+ which_god_penance = 0;
+ else if (!_god_hates_your_god(which_god) && which_god_penance >= 5)
+ which_god_penance = 2; // == "Come back to the one true church!"
+ }
+
+ cprintf( (which_god_penance >= 50) ? "%s's wrath is upon you!" :
+ (which_god_penance >= 20) ? "%s is annoyed with you." :
+ (which_god_penance >= 5) ? "%s well remembers your sins." :
+ (which_god_penance > 0) ? "%s is ready to forgive your sins." :
+ (you.worshipped[which_god]) ? "%s is ambivalent towards you."
+ : "%s is neutral towards you.",
god_name(which_god).c_str() );
}
else
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index e415c688ad..d31395218e 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -487,21 +487,21 @@ static bool _ely_protects_ally(monsters *monster)
ASSERT(you.religion == GOD_ELYVILON);
if (mons_holiness(monster) != MH_NATURAL
+ && mons_holiness(monster) != MH_HOLY
|| !mons_friendly(monster)
+ || !mons_near(monster)
+ || !player_monster_visible(monster) // for simplicity
|| !one_chance_in(20))
{
return (false);
}
- if (player_monster_visible(monster) && mons_near(monster))
- {
- monster->hit_points = 1;
- snprintf(info, INFO_SIZE, " protects %s%s from harm!%s",
- mons_is_unique(monster->type) ? "" : "your ",
- monster->name(DESC_PLAIN).c_str(),
- coinflip() ? "" : " You feel responsible.");
- simple_god_message(info);
- }
+ monster->hit_points = 1;
+ snprintf(info, INFO_SIZE, " protects %s%s from harm!%s",
+ mons_is_unique(monster->type) ? "" : "your ",
+ monster->name(DESC_PLAIN).c_str(),
+ coinflip() ? "" : " You feel responsible.");
+ simple_god_message(info);
lose_piety(1);
return (true);
@@ -520,6 +520,7 @@ static bool _ely_heals_monster(monsters *monster, killer_type killer, int i)
const int ely_penance = you.penance[god];
if (mons_holiness(monster) != MH_NATURAL
+ && mons_holiness(monster) != MH_HOLY
|| mons_friendly(monster)
|| !one_chance_in(10))
{