summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Lawrence Ramsey <dolorous@users.sourceforge.net>2009-11-19 05:55:49 -0600
committerDavid Lawrence Ramsey <dolorous@users.sourceforge.net>2009-11-19 06:31:39 -0600
commitad599ad1c85be1ffba72f5aacacf869fa85010ca (patch)
tree40ee99cb940687ed21de444be1bbf78003b3316f
parentb1aaf507f2ecb50a7792037b1f9894e06591ce3d (diff)
downloadcrawl-ref-ad599ad1c85be1ffba72f5aacacf869fa85010ca.tar.gz
crawl-ref-ad599ad1c85be1ffba72f5aacacf869fa85010ca.zip
Split chaotic things into unclean and chaotic things.
Chaotic things are now shapeshifters, mutators, etc., while unclean things are diseasing things, rotting things, etc. Zin still hates both. As good gods treat both unholy and evil monsters as evil, he'll treat both unclean and chaotic monsters as chaotic. Note that silver will only do extra damage to chaotics, as before.
-rw-r--r--crawl-ref/source/artefact.h3
-rw-r--r--crawl-ref/source/beam.cc2
-rw-r--r--crawl-ref/source/describe.cc2
-rw-r--r--crawl-ref/source/enum.h3
-rw-r--r--crawl-ref/source/fight.cc2
-rw-r--r--crawl-ref/source/goditem.cc55
-rw-r--r--crawl-ref/source/goditem.h4
-rw-r--r--crawl-ref/source/mon-stuff.cc4
-rw-r--r--crawl-ref/source/mon-util.cc2
-rw-r--r--crawl-ref/source/monster.cc35
-rw-r--r--crawl-ref/source/monster.h2
-rw-r--r--crawl-ref/source/religion.cc25
-rw-r--r--crawl-ref/source/spl-cast.cc5
-rw-r--r--crawl-ref/source/spl-cast.h49
-rw-r--r--crawl-ref/source/spl-data.h10
15 files changed, 151 insertions, 52 deletions
diff --git a/crawl-ref/source/artefact.h b/crawl-ref/source/artefact.h
index 16ee0dda3d..ba7ed1c183 100644
--- a/crawl-ref/source/artefact.h
+++ b/crawl-ref/source/artefact.h
@@ -127,7 +127,8 @@ enum unrand_flag_type
UNRAND_FLAG_HOLY = 0x02,
UNRAND_FLAG_UNHOLY = 0x04,
UNRAND_FLAG_EVIL = 0x08,
- UNRAND_FLAG_CHAOTIC = 0x10
+ UNRAND_FLAG_UNCLEAN = 0x10,
+ UNRAND_FLAG_CHAOTIC = 0x20
};
enum setup_missile_type
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index af3a9108e8..79068c942f 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -2466,7 +2466,7 @@ int mons_adjust_flavoured(monsters *monster, bolt &pbolt, int hurted,
miasma_monster(monster, pbolt.whose_kill());
if (YOU_KILL(pbolt.thrower))
- did_god_conduct(DID_CHAOS, 2, pbolt.effect_known);
+ did_god_conduct(DID_UNCLEAN, 2, pbolt.effect_known);
}
break;
diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc
index cae6b21798..3899bb07cc 100644
--- a/crawl-ref/source/describe.cc
+++ b/crawl-ref/source/describe.cc
@@ -3643,7 +3643,7 @@ void describe_god( god_type which_god, bool give_title )
(you.piety >= 50) ? "sometimes" :
"occasionally";
- cprintf("%s %s shields you from chaotic effects." EOL,
+ cprintf("%s %s shields you from unclean and chaotic effects." EOL,
god_name(which_god).c_str(), how);
}
else if (which_god == GOD_SHINING_ONE)
diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h
index ac7503ec95..2d19fba815 100644
--- a/crawl-ref/source/enum.h
+++ b/crawl-ref/source/enum.h
@@ -774,7 +774,8 @@ enum conduct_type
DID_EAT_SOULED_BEING, // Zin
DID_DELIBERATE_MUTATING, // Zin
DID_CAUSE_GLOWING, // Zin
- DID_CHAOS, // Zin (used weapon/magic of chaos)
+ DID_UNCLEAN, // Zin (used unclean weapon/magic)
+ DID_CHAOS, // Zin (used chaotic weapon/magic)
DID_DESECRATE_ORCISH_REMAINS, // Beogh
DID_DESTROY_ORCISH_IDOL, // Beogh
DID_CREATE_LIFE, // unused
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc
index a5b01f2b78..5df207a29b 100644
--- a/crawl-ref/source/fight.cc
+++ b/crawl-ref/source/fight.cc
@@ -3416,7 +3416,7 @@ bool melee_attack::apply_damage_brand()
if (attacker->atype() == ACT_PLAYER && damage_brand == SPWPN_CHAOS)
{
- // If your god objects to using chaos then it makes the
+ // If your god objects to using chaos, then it makes the
// brand obvious.
if (did_god_conduct(DID_CHAOS, 2 + random2(3), brand_was_known))
obvious_effect = true;
diff --git a/crawl-ref/source/goditem.cc b/crawl-ref/source/goditem.cc
index 41d2d275c5..849cd63ede 100644
--- a/crawl-ref/source/goditem.cc
+++ b/crawl-ref/source/goditem.cc
@@ -174,6 +174,32 @@ bool is_evil_item(const item_def& item)
return (retval);
}
+bool is_unclean_item(const item_def& item)
+{
+ bool retval = false;
+
+ if (is_unrandom_artefact(item))
+ {
+ unrandart_entry* entry = get_unrand_entry(item.special);
+
+ if (entry->flags & UNRAND_FLAG_UNCLEAN)
+ return (true);
+ }
+
+ switch (item.base_type)
+ {
+ case OBJ_BOOKS:
+ retval = is_unclean_spellbook(item);
+ case OBJ_STAVES:
+ retval = is_unclean_rod(item);
+ break;
+ default:
+ break;
+ }
+
+ return (retval);
+}
+
bool is_chaotic_item(const item_def& item)
{
bool retval = false;
@@ -309,6 +335,15 @@ bool is_evil_spell(spell_type spell, god_type god)
return (is_evil_discipline(disciplines));
}
+bool is_unclean_spell(spell_type spell, god_type god)
+{
+ UNUSED(god);
+
+ unsigned int flags = get_spell_flags(spell);
+
+ return (flags & SPFLAG_UNCLEAN);
+}
+
bool is_chaotic_spell(spell_type spell, god_type god)
{
UNUSED(god);
@@ -386,6 +421,11 @@ bool is_evil_spellbook(const item_def& item)
return (is_spellbook_type(item, false, is_evil_spell));
}
+bool is_unclean_spellbook(const item_def& item)
+{
+ return (is_spellbook_type(item, false, is_unclean_spell));
+}
+
bool is_chaotic_spellbook(const item_def& item)
{
return (is_spellbook_type(item, false, is_chaotic_spell));
@@ -416,6 +456,11 @@ bool is_evil_rod(const item_def& item)
return (is_spellbook_type(item, true, is_evil_spell));
}
+bool is_unclean_rod(const item_def& item)
+{
+ return (is_spellbook_type(item, true, is_unclean_spell));
+}
+
bool is_chaotic_rod(const item_def& item)
{
return (is_spellbook_type(item, true, is_chaotic_spell));
@@ -458,7 +503,13 @@ conduct_type god_hates_item_handling(const item_def &item)
switch (you.religion)
{
case GOD_ZIN:
- if (item_type_known(item) && is_chaotic_item(item))
+ if (!item_type_known(item))
+ return (DID_NOTHING);
+
+ if (is_unclean_item(item))
+ return (DID_UNCLEAN);
+
+ if (is_chaotic_item(item))
return (DID_CHAOS);
break;
@@ -552,7 +603,7 @@ bool god_hates_spell_type(spell_type spell, god_type god)
switch (god)
{
case GOD_ZIN:
- if (is_chaotic_spell(spell))
+ if (is_unclean_spell(spell) || is_chaotic_spell(spell))
return (true);
break;
diff --git a/crawl-ref/source/goditem.h b/crawl-ref/source/goditem.h
index 9f0e32cdec..be0bbe05f7 100644
--- a/crawl-ref/source/goditem.h
+++ b/crawl-ref/source/goditem.h
@@ -11,6 +11,7 @@ bool is_holy_item(const item_def& item);
bool is_unholy_item(const item_def& item);
bool is_potentially_evil_item(const item_def& item);
bool is_evil_item(const item_def& item);
+bool is_unclean_item(const item_def& item);
bool is_chaotic_item(const item_def& item);
bool is_hasty_item(const item_def& item);
bool is_holy_discipline(int discipline);
@@ -18,6 +19,7 @@ bool is_evil_discipline(int discipline);
bool is_holy_spell(spell_type spell, god_type god = GOD_NO_GOD);
bool is_unholy_spell(spell_type spell, god_type god = GOD_NO_GOD);
bool is_evil_spell(spell_type spell, god_type god = GOD_NO_GOD);
+bool is_unclean_spell(spell_type spell, god_type god = GOD_NO_GOD);
bool is_chaotic_spell(spell_type spell, god_type god = GOD_NO_GOD);
bool is_hasty_spell(spell_type spell, god_type god = GOD_NO_GOD);
bool is_any_spell(spell_type spell, god_type god = GOD_NO_GOD);
@@ -28,12 +30,14 @@ bool is_spellbook_type(const item_def& item, bool book_or_rod,
bool is_holy_spellbook(const item_def& item);
bool is_unholy_spellbook(const item_def& item);
bool is_evil_spellbook(const item_def& item);
+bool is_unclean_spellbook(const item_def& item);
bool is_chaotic_spellbook(const item_def& item);
bool is_hasty_spellbook(const item_def& item);
bool god_hates_spellbook(const item_def& item);
bool is_holy_rod(const item_def& item);
bool is_unholy_rod(const item_def& item);
bool is_evil_rod(const item_def& item);
+bool is_unclean_rod(const item_def& item);
bool is_chaotic_rod(const item_def& item);
bool is_hasty_rod(const item_def& item);
bool god_hates_rod(const item_def& item);
diff --git a/crawl-ref/source/mon-stuff.cc b/crawl-ref/source/mon-stuff.cc
index 030d5e0a0c..f43a814030 100644
--- a/crawl-ref/source/mon-stuff.cc
+++ b/crawl-ref/source/mon-stuff.cc
@@ -1655,8 +1655,8 @@ int monster_die(monsters *monster, killer_type killer,
monster->hit_dice, true, monster);
}
- // Zin hates chaotic beings.
- if (monster->is_chaotic())
+ // Zin hates unclean and chaotic beings.
+ if (monster->is_unclean() || monster->is_chaotic())
{
did_god_conduct(DID_KILL_CHAOTIC,
monster->hit_dice, true, monster);
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index f77dc8fc64..22392fa3f1 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -1376,7 +1376,7 @@ monster_type random_draconian_monster_species()
// Note: For consistent behavior in player_will_anger_monster(), all
// spellbooks a given monster can get here should produce the same
// return values in is_holy_spell(), (is_unholy_spell() ||
-// is_evil_spell()), and is_chaotic_spell().
+// is_evil_spell()), and (is_unclean_spell() || is_chaotic_spell()).
//
// FIXME: This is not true for one set of spellbooks; MST_WIZARD_IV
// contains the unholy Banishment spell, but the other MST_WIZARD-type
diff --git a/crawl-ref/source/monster.cc b/crawl-ref/source/monster.cc
index 0d6e8d0fe2..ccbdceabc1 100644
--- a/crawl-ref/source/monster.cc
+++ b/crawl-ref/source/monster.cc
@@ -2766,6 +2766,15 @@ bool monsters::has_evil_spell() const
return (false);
}
+bool monsters::has_unclean_spell() const
+{
+ for (int i = 0; i < NUM_MONSTER_SPELL_SLOTS; ++i)
+ if (is_unclean_spell(spells[i]))
+ return (true);
+
+ return (false);
+}
+
bool monsters::has_chaotic_spell() const
{
for (int i = 0; i < NUM_MONSTER_SPELL_SLOTS; ++i)
@@ -3037,6 +3046,23 @@ bool monsters::is_evil() const
return (false);
}
+bool monsters::is_unclean() const
+{
+ if (has_unclean_spell())
+ return (true);
+
+ if (has_attack_flavour(AF_DISEASE)
+ || has_attack_flavour(AF_HUNGER)
+ || has_attack_flavour(AF_ROT)
+ || has_attack_flavour(AF_STEAL)
+ || has_attack_flavour(AF_STEAL_FOOD))
+ {
+ return (true);
+ }
+
+ return (false);
+}
+
bool monsters::is_chaotic() const
{
if (type == MONS_UGLY_THING || type == MONS_VERY_UGLY_THING)
@@ -3052,14 +3078,9 @@ bool monsters::is_chaotic() const
if (has_chaotic_spell())
return (true);
- if (has_attack_flavour(AF_DISEASE)
- || has_attack_flavour(AF_HUNGER)
- || has_attack_flavour(AF_MUTATE)
- || has_attack_flavour(AF_ROT)
+ if (has_attack_flavour(AF_MUTATE)
|| has_attack_flavour(AF_KLOWN)
- || has_attack_flavour(AF_CHAOS)
- || has_attack_flavour(AF_STEAL)
- || has_attack_flavour(AF_STEAL_FOOD))
+ || has_attack_flavour(AF_CHAOS))
{
return (true);
}
diff --git a/crawl-ref/source/monster.h b/crawl-ref/source/monster.h
index dce3d7e60e..84a291cef8 100644
--- a/crawl-ref/source/monster.h
+++ b/crawl-ref/source/monster.h
@@ -305,6 +305,7 @@ public:
bool is_holy() const;
bool is_unholy() const;
bool is_evil() const;
+ bool is_unclean() const;
bool is_chaotic() const;
int res_fire() const;
int res_steam() const;
@@ -356,6 +357,7 @@ public:
bool has_holy_spell() const;
bool has_unholy_spell() const;
bool has_evil_spell() const;
+ bool has_unclean_spell() const;
bool has_chaotic_spell() const;
bool has_attack_flavour(int flavour) const;
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index 7860f78e95..0e9118c43b 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -720,7 +720,7 @@ std::string get_god_likes(god_type which_god, bool verbose)
switch (which_god)
{
case GOD_ZIN:
- really_likes.push_back("you kill chaotic monsters");
+ really_likes.push_back("you kill unclean and chaotic monsters");
break;
case GOD_YREDELEMNUL:
@@ -826,7 +826,7 @@ std::string get_god_dislikes(god_type which_god, bool /*verbose*/)
case GOD_ZIN:
dislikes.push_back("you deliberately mutate yourself");
dislikes.push_back("you polymorph monsters");
- dislikes.push_back("you use chaotic magic or items");
+ dislikes.push_back("you use unclean or chaotic magic or items");
dislikes.push_back("you eat the flesh of sentient beings");
break;
@@ -1436,7 +1436,7 @@ bool _has_jelly()
bool is_good_lawful_follower(const monsters* mon)
{
return (mon->alive() && !mon->is_unholy() && !mon->is_evil()
- && !mon->is_chaotic() && mon->friendly());
+ && !mon->is_unclean() && !mon->is_chaotic() && mon->friendly());
}
bool is_good_follower(const monsters* mon)
@@ -3384,6 +3384,21 @@ bool did_god_conduct(conduct_type thing_done, int level, bool known,
}
break;
+ case DID_UNCLEAN:
+ if (you.religion == GOD_ZIN)
+ {
+ retval = true;
+ if (!known)
+ {
+ simple_god_message(" forgives your inadvertent unclean "
+ "act, just this once.");
+ break;
+ }
+ piety_change = -level;
+ penance = level;
+ }
+ break;
+
case DID_CHAOS:
if (you.religion == GOD_ZIN)
{
@@ -3465,8 +3480,8 @@ bool did_god_conduct(conduct_type thing_done, int level, bool known,
"Servant Kill Holy", "Spell Memorise", "Spell Cast",
"Spell Practise", "Spell Nonutility", "Cards", "Stimulants",
"Drink Blood", "Cannibalism", "Eat Meat", "Eat Souled Being",
- "Deliberate Mutation", "Cause Glowing", "Use Chaos",
- "Desecrate Orcish Remains", "Destroy Orcish Idol",
+ "Deliberate Mutation", "Cause Glowing", "Use Unclean",
+ "Use Chaos", "Desecrate Orcish Remains", "Destroy Orcish Idol",
"Create Life", "Kill Slime", "Kill Plant", "Ally Kill Plant",
"Was Hasty"
};
diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc
index 7af775c0f0..2c648db20f 100644
--- a/crawl-ref/source/spl-cast.cc
+++ b/crawl-ref/source/spl-cast.cc
@@ -940,11 +940,14 @@ static void _spellcasting_side_effects(spell_type spell, bool idonly = false)
did_god_conduct(DID_UNHOLY, 10 + spell_difficulty(spell));
}
+ if (is_unclean_spell(spell))
+ did_god_conduct(DID_UNCLEAN, 10 + spell_difficulty(spell));
+
if (is_chaotic_spell(spell))
did_god_conduct(DID_CHAOS, 10 + spell_difficulty(spell));
// Linley says: Condensation Shield needs some disadvantages to keep
- // it from being a no-brainer... this isn't much, but its a start -- bwr
+ // it from being a no-brainer... this isn't much, but its a start. - bwr
if (spell_typematch(spell, SPTYP_FIRE))
expose_player_to_element(BEAM_FIRE, 0);
diff --git a/crawl-ref/source/spl-cast.h b/crawl-ref/source/spl-cast.h
index d8ea84b81f..9f5c658d86 100644
--- a/crawl-ref/source/spl-cast.h
+++ b/crawl-ref/source/spl-cast.h
@@ -12,30 +12,31 @@
enum spflag_type
{
- SPFLAG_NONE = 0x00000,
- SPFLAG_DIR_OR_TARGET = 0x00001, // use DIR_NONE targetting
- SPFLAG_TARGET = 0x00002, // use DIR_TARGET targetting
- SPFLAG_GRID = 0x00004, // use DIR_GRID targetting
- SPFLAG_DIR = 0x00008, // use DIR_DIR targetting
- SPFLAG_TARGETTING_MASK = 0x0000f, // used to test for targetting
- SPFLAG_HELPFUL = 0x00010, // TARG_FRIENDS used
- SPFLAG_NEUTRAL = 0x00020, // TARG_ANY used
- SPFLAG_NOT_SELF = 0x00040, // aborts on isMe
- SPFLAG_UNHOLY = 0x00080, // counts as "unholy"
- SPFLAG_CHAOTIC = 0x00100, // counts as "chaotic"
- SPFLAG_HASTY = 0x00200, // counts as "hasty"
- SPFLAG_MAPPING = 0x00400, // a mapping spell of some kind
- SPFLAG_ESCAPE = 0x00800, // useful for running away
- SPFLAG_RECOVERY = 0x01000, // healing or recovery spell
- SPFLAG_AREA = 0x02000, // area affect
- SPFLAG_BATTLE = 0x04000, // a non-Conjuration spell that
- // is still a battle spell
- SPFLAG_CARD = 0x08000, // a card effect spell
- SPFLAG_MONSTER = 0x10000, // monster-only spell
- SPFLAG_INNATE = 0x20000, // an innate spell, even if
- // use by a priest/wizard
- SPFLAG_NOISY = 0x40000, // makes noise, even if innate
- SPFLAG_TESTING = 0x80000 // a testing/debugging spell
+ SPFLAG_NONE = 0x000000,
+ SPFLAG_DIR_OR_TARGET = 0x000001, // use DIR_NONE targetting
+ SPFLAG_TARGET = 0x000002, // use DIR_TARGET targetting
+ SPFLAG_GRID = 0x000004, // use DIR_GRID targetting
+ SPFLAG_DIR = 0x000008, // use DIR_DIR targetting
+ SPFLAG_TARGETTING_MASK = 0x00000f, // used to test for targetting
+ SPFLAG_HELPFUL = 0x000010, // TARG_FRIENDS used
+ SPFLAG_NEUTRAL = 0x000020, // TARG_ANY used
+ SPFLAG_NOT_SELF = 0x000040, // aborts on isMe
+ SPFLAG_UNHOLY = 0x000080, // counts as "unholy"
+ SPFLAG_UNCLEAN = 0x000100, // counts as "unclean"
+ SPFLAG_CHAOTIC = 0x000200, // counts as "chaotic"
+ SPFLAG_HASTY = 0x000400, // counts as "hasty"
+ SPFLAG_MAPPING = 0x000800, // a mapping spell of some kind
+ SPFLAG_ESCAPE = 0x001000, // useful for running away
+ SPFLAG_RECOVERY = 0x002000, // healing or recovery spell
+ SPFLAG_AREA = 0x004000, // area affect
+ SPFLAG_BATTLE = 0x008000, // a non-Conjuration spell that
+ // is still a battle spell
+ SPFLAG_CARD = 0x010000, // a card effect spell
+ SPFLAG_MONSTER = 0x020000, // monster-only spell
+ SPFLAG_INNATE = 0x040000, // an innate spell, even if
+ // use by a priest/wizard
+ SPFLAG_NOISY = 0x080000, // makes noise, even if innate
+ SPFLAG_TESTING = 0x100000 // a testing/debugging spell
};
enum spret_type
diff --git a/crawl-ref/source/spl-data.h b/crawl-ref/source/spl-data.h
index 07439062ff..c09cf95ee3 100644
--- a/crawl-ref/source/spl-data.h
+++ b/crawl-ref/source/spl-data.h
@@ -180,7 +180,7 @@
{
SPELL_POLYMORPH_OTHER, "Polymorph Other",
- SPTYP_TRANSMUTATION, // removed enchantment, wasn't needed -- bwr
+ SPTYP_TRANSMUTATION, // removed enchantment, wasn't needed - bwr
SPFLAG_DIR_OR_TARGET | SPFLAG_NOT_SELF | SPFLAG_CHAOTIC,
5,
200,
@@ -640,7 +640,7 @@
{
SPELL_SUMMON_SWARM, "Summon Swarm",
SPTYP_SUMMONING,
- SPFLAG_CHAOTIC | SPFLAG_BATTLE,
+ SPFLAG_UNCLEAN | SPFLAG_BATTLE,
6,
200,
-1, -1,
@@ -1094,7 +1094,7 @@
{
SPELL_CORPSE_ROT, "Corpse Rot",
SPTYP_NECROMANCY,
- SPFLAG_AREA | SPFLAG_NEUTRAL | SPFLAG_CHAOTIC,
+ SPFLAG_AREA | SPFLAG_NEUTRAL | SPFLAG_UNCLEAN,
2,
0,
-1, -1,
@@ -2241,7 +2241,7 @@
{
SPELL_MIASMA, "Miasma",
SPTYP_CONJURATION,
- SPFLAG_DIR_OR_TARGET | SPFLAG_CHAOTIC | SPFLAG_MONSTER,
+ SPFLAG_DIR_OR_TARGET | SPFLAG_UNCLEAN | SPFLAG_MONSTER,
6,
0,
6, 6,
@@ -2254,7 +2254,7 @@
{
SPELL_SUMMON_DRAKES, "Summon Drakes",
SPTYP_SUMMONING | SPTYP_NECROMANCY, // since it can summon shadow dragons
- SPFLAG_CHAOTIC | SPFLAG_MONSTER,
+ SPFLAG_UNCLEAN | SPFLAG_MONSTER,
6,
0,
-1, -1,