Anonymous | Login | 2024-04-28 19:44 CEST |
Main | My View | View Issues | Change Log | Wiki | Tavern | News |
Viewing Issue Simple Details [ Jump to Notes ] [ Wiki ] | [ View Advanced ] [ Issue History ] [ Print ] | ||||||||||||
ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||||||
0007288 | [DCSS] Patches | feature | N/A | 2013-06-30 13:13 | 2013-11-10 19:19 | ||||||||
Reporter | pubby | View Status | public | ||||||||||
Assigned To | Kate | ||||||||||||
Priority | normal | Resolution | no change required | ||||||||||
Status | resolved | Product Branch | 0.13 ancient branch | ||||||||||
Summary | 0007288: Moth of Nihilism | ||||||||||||
Description |
> Nihilism blocks all forms of god effects, > with the exception of misconducts and penance. > For instance, a Chei follower would lose their stat bonus, > regain their speed, and not be able to use slouch. This patch is basically a bunch of conditionals sprinkled everywhere to check for this effect. I'm pretty certain I got all of the major effects, but chances are I missed one or two subtle ones. No tiles included. |
||||||||||||
Additional Information | |||||||||||||
Tags | amusement, noise, Remove | ||||||||||||
Attached Files |
nihilism1.patch [^] (87,355 bytes) 2013-06-30 13:13 [Show Content] [Hide Content]From 9235380004e67d635db7ed5e0c1a652b625866b7 Mon Sep 17 00:00:00 2001 From: pubby <pubby8@gmail.com> Date: Sun, 30 Jun 2013 05:44:24 -0500 Subject: [PATCH] Initial implementation of a nihilism status + moth Nihilism blocks all forms of god effects, with the exception of misconducts and penance. For instance, a Chei follower would lose their stat bonus, regain their speed, and not be able to use slouch. Currently, nihilism does not change the alliance of allies, with the exception of Yred's gifts, which will temporarily turn hostile. Player enchantments will be canceled upon becoming a nihilist, but monster enchantments will remain. This can be considered a bug, but it does not seem severe. --- crawl-ref/source/abl-show.cc | 29 +++++++++-- crawl-ref/source/abyss.cc | 10 +++- crawl-ref/source/actor.cc | 5 +- crawl-ref/source/actor.h | 3 ++ crawl-ref/source/areas.cc | 48 +++++++++++++++++- crawl-ref/source/areas.h | 3 ++ crawl-ref/source/attitude-change.cc | 35 +++++++++++--- crawl-ref/source/attitude-change.h | 1 + crawl-ref/source/dactions.cc | 10 +++- crawl-ref/source/decks.cc | 9 +++- crawl-ref/source/describe.cc | 11 ++++- crawl-ref/source/directn.cc | 8 +++ crawl-ref/source/effects.cc | 26 +++++++--- crawl-ref/source/enum.h | 4 +- crawl-ref/source/godabil.cc | 11 ++++- crawl-ref/source/godconduct.cc | 81 ++++++++++++++++++++++++------- crawl-ref/source/godpassive.cc | 18 +++++-- crawl-ref/source/godprayer.cc | 33 ++++++++++--- crawl-ref/source/item_use.cc | 2 +- crawl-ref/source/main.cc | 49 ++++++++++++++++--- crawl-ref/source/map_knowledge.cc | 6 ++- crawl-ref/source/map_knowledge.h | 1 + crawl-ref/source/melee_attack.cc | 9 +++- crawl-ref/source/misc.cc | 6 ++- crawl-ref/source/mon-act.cc | 14 ++++-- crawl-ref/source/mon-cast.cc | 12 ++++- crawl-ref/source/mon-data.h | 12 +++++ crawl-ref/source/mon-death.cc | 2 +- crawl-ref/source/mon-info.cc | 2 + crawl-ref/source/mon-info.h | 1 + crawl-ref/source/mon-stuff.cc | 49 ++++++++++++++----- crawl-ref/source/mon-util.cc | 3 +- crawl-ref/source/monster.h | 1 + crawl-ref/source/mutation.cc | 6 ++- crawl-ref/source/ouch.cc | 10 +++- crawl-ref/source/output.cc | 1 + crawl-ref/source/player.cc | 53 +++++++++++++++----- crawl-ref/source/player.h | 1 + crawl-ref/source/religion.cc | 94 +++++++++++++++++++++++++++++++++--- crawl-ref/source/religion.h | 2 + crawl-ref/source/rltiles/dc-feat.txt | 1 + crawl-ref/source/show.cc | 3 ++ crawl-ref/source/showsymb.cc | 2 + crawl-ref/source/spl-cast.cc | 5 +- crawl-ref/source/spl-goditem.cc | 10 ++-- crawl-ref/source/spl-miscast.cc | 7 ++- crawl-ref/source/spl-selfench.cc | 6 ++- crawl-ref/source/spl-summoning.cc | 8 +-- crawl-ref/source/spl-util.cc | 1 + crawl-ref/source/status.cc | 10 ++++ crawl-ref/source/status.h | 3 +- crawl-ref/source/tilecell.cc | 2 + crawl-ref/source/tilecell.h | 1 + crawl-ref/source/tiledgnbuf.cc | 2 + crawl-ref/source/tileview.cc | 3 ++ crawl-ref/source/tileweb.cc | 3 ++ crawl-ref/source/transform.cc | 6 ++- crawl-ref/source/view.cc | 1 - 58 files changed, 625 insertions(+), 130 deletions(-) diff --git a/crawl-ref/source/abl-show.cc b/crawl-ref/source/abl-show.cc index ad63ef9..3f42ad7 100644 --- a/crawl-ref/source/abl-show.cc +++ b/crawl-ref/source/abl-show.cc @@ -1243,6 +1243,11 @@ void no_ability_msg() if (you.flight_mode()) mpr("You're already flying!"); } + else if (you.nihilist() && you.religion != GOD_NO_GOD) + { + mprf("%s is meaningless to a nihilist!", + god_name(you.religion).c_str()); + } else if (silenced(you.pos()) && you.religion != GOD_NO_GOD) { // At the very least the player has "Renounce Religion", but @@ -1361,6 +1366,18 @@ static bool _check_ability_possible(const ability_def& abil, return false; } + if (nihilism(you.pos())) + { + talent tal = get_talent(abil.ability, false); + if (tal.is_invocation && tal.which != ABIL_RENOUNCE_RELIGION) + { + if (!quiet) + mprf("%s is meaningless to a nihilist!", + god_name(you.religion).c_str()); + return false; + } + } + if (silenced(you.pos()) && you.religion != GOD_NEMELEX_XOBEH) { talent tal = get_talent(abil.ability, false); @@ -3462,17 +3479,19 @@ static int _find_ability_slot(const ability_def &abil) vector<ability_type> get_god_abilities(bool include_unusable) { vector<ability_type> abilities; - if (you.religion == GOD_TROG && (include_unusable || !silenced(you.pos()))) + bool preventing_aura = silenced(you.pos()) || you.nihilist(); + if (you.religion == GOD_TROG && (include_unusable || !preventing_aura)) abilities.push_back(ABIL_TROG_BURN_SPELLBOOKS); - else if (you.religion == GOD_ELYVILON && (include_unusable || !silenced(you.pos()))) + else if (you.religion == GOD_ELYVILON && (include_unusable || !preventing_aura)) abilities.push_back(ABIL_ELYVILON_LESSER_HEALING_OTHERS); else if (you.transfer_skill_points > 0) abilities.push_back(ABIL_ASHENZARI_END_TRANSFER); - // Remaining abilities are unusable if under penance, or if silenced if not - // Nemelex abilities. + // Remaining abilities are unusable if under penance, under nihlism, + // or if silenced if not Nemelex abilities. if (!include_unusable && (player_under_penance() - || silenced(you.pos()) && you.religion != GOD_NEMELEX_XOBEH)) + || you.nihilist() + || (silenced(you.pos()) && you.religion != GOD_NEMELEX_XOBEH))) { return abilities; } diff --git a/crawl-ref/source/abyss.cc b/crawl-ref/source/abyss.cc index ab2cc14..8e64bb8 100644 --- a/crawl-ref/source/abyss.cc +++ b/crawl-ref/source/abyss.cc @@ -170,7 +170,9 @@ static int _abyssal_rune_roll() if (you.runes[RUNE_ABYSSAL] || you.depth < ABYSSAL_RUNE_MIN_LEVEL) return -1; const bool lugonu_favoured = - (you.religion == GOD_LUGONU && !player_under_penance() + (you.religion == GOD_LUGONU + && !player_under_penance() + && !you.nihilist() && you.piety >= piety_breakpoint(4)); const double depth = you.depth + lugonu_favoured; @@ -1513,8 +1515,12 @@ retry: static void _increase_depth() { int delta = you.time_taken * (you.abyss_speed + 40) / 200; - if (you.religion != GOD_CHEIBRIADOS || you.penance[GOD_CHEIBRIADOS]) + if (you.religion != GOD_CHEIBRIADOS + || you.penance[GOD_CHEIBRIADOS] + || you.nihilist()) + { delta *= 2; + } if (you.duration[DUR_TELEPORT]) delta *= 5; const double theta = abyssal_state.phase; diff --git a/crawl-ref/source/actor.cc b/crawl-ref/source/actor.cc index 87b7b9a..c6b767f 100644 --- a/crawl-ref/source/actor.cc +++ b/crawl-ref/source/actor.cc @@ -444,7 +444,10 @@ int actor::apply_ac(int damage, int max_damage, ac_type ac_rule, bool actor_slime_wall_immune(const actor *act) { return - act->is_player() && you.religion == GOD_JIYVA && !you.penance[GOD_JIYVA] + (act->is_player() + && you.religion == GOD_JIYVA + && !you.penance[GOD_JIYVA] + && !you.nihilist()) || act->res_acid() == 3; } diff --git a/crawl-ref/source/actor.h b/crawl-ref/source/actor.h index 0ff00c9..961cc8e 100644 --- a/crawl-ref/source/actor.h +++ b/crawl-ref/source/actor.h @@ -353,6 +353,8 @@ public: virtual bool umbraed() const; // Magically suppressed? virtual bool suppressed() const; + // Feeling nihilistic? (no religious effects) + virtual bool nihilist() const; // Being heated by a heat aura? virtual bool heated() const; // Squared halo radius. @@ -364,6 +366,7 @@ public: virtual int umbra_radius2 () const = 0; virtual int suppression_radius2 () const = 0; virtual int soul_aura_radius2 () const = 0; + virtual int nihilism_radius2 () const = 0; virtual int heat_radius2 () const = 0; virtual bool glows_naturally() const = 0; diff --git a/crawl-ref/source/areas.cc b/crawl-ref/source/areas.cc index d2e275b..f02dc2a 100644 --- a/crawl-ref/source/areas.cc +++ b/crawl-ref/source/areas.cc @@ -45,6 +45,7 @@ enum areaprop_flag APROP_DISJUNCTION = (1 << 10), APROP_SOUL_AURA = (1 << 11), APROP_HOT = (1 << 12), + APROP_NIHILISM = (1 << 13), }; struct area_centre @@ -88,7 +89,7 @@ void areas_actor_moved(const actor* act, const coord_def& oldpos) || act->halo_radius2() > -1 || act->silence_radius2() > -1 || act->liquefying_radius2() > -1 || act->umbra_radius2() > -1 || act->suppression_radius2() > -1 || act->heat_radius2() > -1) - || act->soul_aura_radius2() > -1) + || act->soul_aura_radius2() > -1 || act->nihilism_radius2() > -1) { // Not necessarily new, but certainly potentially interesting. invalidate_agrid(true); @@ -131,6 +132,16 @@ static void _update_agrid() no_areas = false; } + // Nihilism goes through walls too. + if ((r = ai->nihilism_radius2()) >= 0) + { + _agrid_centres.push_back(area_centre(AREA_NIHILISM, ai->pos(), r)); + + for (radius_iterator ri(ai->pos(), r, C_CIRCLE); ri; ++ri) + _set_agrid_flag(*ri, APROP_NIHILISM); + no_areas = false; + } + if ((r = ai->halo_radius2()) >= 0) { _agrid_centres.push_back(area_centre(AREA_HALO, ai->pos(), r)); @@ -266,6 +277,8 @@ static area_centre_type _get_first_area(const coord_def& f) return AREA_UMBRA; if (a & APROP_SUPPRESSION) return AREA_SUPPRESSION; + if (a & APROP_NIHILISM) + return AREA_NIHILISM; // liquid is always applied; actual_liquid is on top // of this. If we find the first, we don't care about // the second. @@ -585,7 +598,7 @@ bool haloed(const coord_def& p) return false; if (!_agrid_valid) _update_agrid(); - return _check_agrid_flag(p, APROP_HALO); + return _check_agrid_flag(p, APROP_HALO) && !nihilism(p); } bool actor::haloed() const @@ -835,6 +848,37 @@ int player::soul_aura_radius2() const } ///////////// +// Nihilism + +bool nihilism(const coord_def& p) +{ + if (!map_bounds(p)) + return false; + if (!_agrid_valid) + _update_agrid(); + + return _check_agrid_flag(p, APROP_NIHILISM); +} + +int monster::nihilism_radius2() const +{ + if (type == MONS_MOTH_OF_NIHILISM) + return 150; + else + return -1; +} + +bool actor::nihilist() const +{ + return ::nihilism(pos()); +} + +int player::nihilism_radius2() const +{ + return -1; +} + +///////////// // Heat aura (lava orcs). // Player radius diff --git a/crawl-ref/source/areas.h b/crawl-ref/source/areas.h index 8e68c0a..f9fa9da 100644 --- a/crawl-ref/source/areas.h +++ b/crawl-ref/source/areas.h @@ -15,6 +15,7 @@ enum area_centre_type AREA_DISJUNCTION, AREA_SOUL_AURA, AREA_HOT, + AREA_NIHILISM, }; void invalidate_agrid(bool recheck_new = false); @@ -52,6 +53,8 @@ bool suppressed(const coord_def& p); bool soul_aura(const coord_def& p); +bool nihilism(const coord_def& p); + // ...or is the area hot? bool heated(const coord_def& p); diff --git a/crawl-ref/source/attitude-change.cc b/crawl-ref/source/attitude-change.cc index daad2a4..0cd15e7 100644 --- a/crawl-ref/source/attitude-change.cc +++ b/crawl-ref/source/attitude-change.cc @@ -50,7 +50,9 @@ void good_god_follower_attitude_change(monster* mons) { mons->flags |= MF_ATT_CHANGE_ATTEMPT; - if (x_chance_in_y(you.piety, MAX_PIETY) && !you.penance[you.religion]) + if (x_chance_in_y(you.piety, MAX_PIETY) + && !you.penance[you.religion] + && !you.nihilist()) { const item_def* wpn = you.weapon(); if (wpn @@ -94,6 +96,7 @@ void beogh_follower_convert(monster* mons, bool orc_hit) const int hd = mons->hit_dice; if (you.piety >= piety_breakpoint(2) && !player_under_penance() + && !you.nihilist() && random2(you.piety / 15) + random2(4 + you.experience_level / 3) > random2(hd) + hd + random2(5)) { @@ -121,14 +124,13 @@ void slime_convert(monster* mons) && !mons->friendly() && !testbits(mons->flags, MF_ATT_CHANGE_ATTEMPT) && you.visible_to(mons) && !mons->asleep() - && !mons_is_confused(mons) && !mons->paralysed()) + && !mons_is_confused(mons) && !mons->paralysed() + && !player_under_penance() + && !you.nihilist()) { mons->flags |= MF_ATT_CHANGE_ATTEMPT; - if (!player_under_penance()) - { - _jiyva_convert_slime(mons); - stop_running(); - } + _jiyva_convert_slime(mons); + stop_running(); } } @@ -138,7 +140,8 @@ void fedhas_neutralise(monster* mons) && mons->attitude == ATT_HOSTILE && fedhas_neutralises(mons) && !testbits(mons->flags, MF_ATT_CHANGE_ATTEMPT) - && !player_under_penance()) + && !player_under_penance() + && !you.nihilist()) { _fedhas_neutralise_plant(mons); mons->flags |= MF_ATT_CHANGE_ATTEMPT; @@ -146,6 +149,22 @@ void fedhas_neutralise(monster* mons) } } +void yred_slave_reclaim(monster* mons) +{ + if (you.religion == GOD_YREDELEMNUL + && mons->attitude == ATT_HOSTILE + && mons_is_god_gift(mons, GOD_YREDELEMNUL) + && !testbits(mons->flags, MF_ATT_CHANGE_ATTEMPT) + && !player_under_penance() + && !you.nihilist()) + { + mons->flags |= MF_ATT_CHANGE_ATTEMPT; + mons->attitude = ATT_FRIENDLY; + mons_att_changed(mons); + stop_running(); + } +} + // Make summoned (temporary) god gifts disappear on penance or when // abandoning the god in question (Trog or TSO). bool make_god_gifts_disappear() diff --git a/crawl-ref/source/attitude-change.h b/crawl-ref/source/attitude-change.h index c503e03..3160dd8 100644 --- a/crawl-ref/source/attitude-change.h +++ b/crawl-ref/source/attitude-change.h @@ -7,6 +7,7 @@ bool fedhas_plants_hostile(); void beogh_follower_convert(monster* mons, bool orc_hit = false); void slime_convert(monster* mons); bool yred_slaves_abandon_you(); +void yred_slave_reclaim(monster* mons); bool beogh_followers_abandon_you(); bool make_god_gifts_disappear(); void good_god_holy_attitude_change(monster* holy); diff --git a/crawl-ref/source/dactions.cc b/crawl-ref/source/dactions.cc index 75bd161..668a248 100644 --- a/crawl-ref/source/dactions.cc +++ b/crawl-ref/source/dactions.cc @@ -56,6 +56,7 @@ static const char *daction_names[] = "slimes allow another conversion attempt", #endif "hogs to humans", + "yred slaves go temporarily hostile" }; #endif @@ -75,6 +76,7 @@ bool mons_matches_daction(const monster* mon, daction_type act) case DACT_ALLY_SPELLCASTER: return (mon->wont_attack() && mon->is_actual_spellcaster()); case DACT_ALLY_YRED_SLAVE: + case DACT_ALLY_YRED_SLAVE_RECLAIMABLE: // Changed: we don't force enslavement of those merely marked. return is_yred_undead_slave(mon); case DACT_ALLY_BEOGH: // both orcs and demons summoned by high priests @@ -166,6 +168,7 @@ void apply_daction_to_mons(monster* mon, daction_type act, bool local) case DACT_ALLY_UNCLEAN_CHAOTIC: case DACT_ALLY_SPELLCASTER: case DACT_ALLY_YRED_SLAVE: + case DACT_ALLY_YRED_SLAVE_RECLAIMABLE: case DACT_ALLY_BEOGH: case DACT_ALLY_SLIME: case DACT_ALLY_PLANT: @@ -180,8 +183,12 @@ void apply_daction_to_mons(monster* mon, daction_type act, bool local) // If you reconvert to Fedhas/Jiyva, plants/slimes will // love you again. - if (act == DACT_ALLY_PLANT || act == DACT_ALLY_SLIME) + if (act == DACT_ALLY_PLANT + || act == DACT_ALLY_SLIME + || act == DACT_ALLY_YRED_SLAVE_RECLAIMABLE) + { mon->flags &= ~MF_ATT_CHANGE_ATTEMPT; + } // No global message for Trog. if (act == DACT_ALLY_TROG && local) @@ -238,6 +245,7 @@ static void _apply_daction(daction_type act) case DACT_ALLY_UNCLEAN_CHAOTIC: case DACT_ALLY_SPELLCASTER: case DACT_ALLY_YRED_SLAVE: + case DACT_ALLY_YRED_SLAVE_RECLAIMABLE: case DACT_ALLY_BEOGH: case DACT_ALLY_SLIME: case DACT_ALLY_PLANT: diff --git a/crawl-ref/source/decks.cc b/crawl-ref/source/decks.cc index d759cb6..223213d 100644 --- a/crawl-ref/source/decks.cc +++ b/crawl-ref/source/decks.cc @@ -1529,8 +1529,12 @@ static void _damnation_card(int power, deck_rarity_type rarity) // Calculate how many extra banishments you get. const int power_level = _get_power_level(power, rarity); int nemelex_bonus = 0; - if (you.religion == GOD_NEMELEX_XOBEH && !player_under_penance()) + if (you.religion == GOD_NEMELEX_XOBEH + && !player_under_penance() + && !you.nihilist()) + { nemelex_bonus = you.piety; + } int extra_targets = power_level + random2(you.skill(SK_EVOCATIONS, 20) + nemelex_bonus) / 240; @@ -2910,7 +2914,8 @@ static int _card_power(deck_rarity_type rarity) if (you.penance[GOD_NEMELEX_XOBEH]) result -= you.penance[GOD_NEMELEX_XOBEH]; - else if (you.religion == GOD_NEMELEX_XOBEH) + else if (you.religion == GOD_NEMELEX_XOBEH + && !you.nihilist()) { result = you.piety; result *= (you.skill(SK_EVOCATIONS, 100) + 2500); diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc index d681446..73c043a 100644 --- a/crawl-ref/source/describe.cc +++ b/crawl-ref/source/describe.cc @@ -3903,6 +3903,9 @@ static string _describe_favour(god_type which_god) : "You should show more discipline."; } + if (you.nihilist()) + return "You don't see any point in religion."; + if (which_god == GOD_XOM) return uppercase_first(describe_xom_favour()); @@ -3918,6 +3921,9 @@ static string _describe_favour(god_type which_god) static string _religion_help(god_type god) { + if (you.nihilist()) + return ""; + string result = ""; switch (god) @@ -4184,7 +4190,7 @@ static string _describe_ash_skill_boost() while (!boosted_skills.empty()) { // For now, all the bonuses from the same bounded part have - // the same level. + // the same level.penance ASSERT(bonus == it->second); if (it->first == SK_CONJURATIONS) skills += "Magic schools"; @@ -4451,6 +4457,9 @@ void describe_god(god_type which_god, bool give_title) //mv: The following code shows abilities given by your god (if any). + // Nihilism does not change this text currently, although it does + // prevent use of such abilities. + textcolor(LIGHTGREY); const char *header = "Granted powers:"; const char *cost = "(Cost)"; diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc index bc1df93..426f892 100644 --- a/crawl-ref/source/directn.cc +++ b/crawl-ref/source/directn.cc @@ -3480,6 +3480,9 @@ static vector<string> _get_monster_desc_vector(const monster_info& mi) if (mi.is(MB_SUPPRESSED)) descs.push_back("suppressed"); + if (mi.is(MB_NIHILISM)) + descs.push_back("nihilistic"); + if (mi.is(MB_POSSESSABLE)) descs.push_back("possessable"); // FIXME: better adjective else if (mi.is(MB_ENSLAVED)) @@ -3557,6 +3560,9 @@ static string _get_monster_desc(const monster_info& mi) if (mi.is(MB_SUPPRESSED)) text += pronoun + " is surrounded by an aura of magical suppression.\n"; + if (mi.is(MB_NIHILISM)) + text += pronoun + " is surrounded by an aura of nihilism.\n"; + if (mi.intel() <= I_INSECT) text += pronoun + " is mindless.\n"; @@ -3820,6 +3826,8 @@ static bool _print_cloud_desc(const coord_def where) areas.push_back("lies inside a sanctuary"); if (silenced(where)) areas.push_back("is shrouded in silence"); + if (nihilism(where)) + areas.push_back("is very nihilistic"); if (haloed(where) && !umbraed(where)) areas.push_back("is lit by a halo"); if (umbraed(where) && !haloed(where)) diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc index 0d16949..41b20a9 100644 --- a/crawl-ref/source/effects.cc +++ b/crawl-ref/source/effects.cc @@ -1268,7 +1268,9 @@ bool vitrify_area(int radius) static void _hell_effects() { - if ((you.religion == GOD_ZIN && x_chance_in_y(you.piety, MAX_PIETY)) + if ((you.religion == GOD_ZIN + && !you.nihilist() + && x_chance_in_y(you.piety, MAX_PIETY)) || is_sanctuary(you.pos())) { simple_god_message("'s power protects you from the chaos of Hell!"); @@ -2184,6 +2186,7 @@ void handle_time() if (one_chance_in(30) && !(you.religion == GOD_CHEIBRIADOS && you.piety >= piety_breakpoint(0) + && !you.nihilist() && coinflip())) { mpr("Your disease is taking its toll.", MSGCH_WARN); @@ -2314,7 +2317,7 @@ void handle_time() { // Update the abyss speed. This place is unstable and the speed can // fluctuate. It's not a constant increase. - if (you.religion == GOD_CHEIBRIADOS && coinflip()) + if (you.religion == GOD_CHEIBRIADOS && !you.nihilist() && coinflip()) ; // Speed change less often for Chei. else if (coinflip() && you.abyss_speed < 100) ++you.abyss_speed; @@ -2338,7 +2341,11 @@ void handle_time() || env.cgrid(newpos) != EMPTY_CLOUD || testbits(env.pgrid(newpos), FPROP_NO_JIYVA)); - mgen_data mg(MONS_JELLY, BEH_STRICT_NEUTRAL, 0, 0, 0, newpos, + beh_type beh = BEH_STRICT_NEUTRAL; + if (player_under_penance() || you.nihilist()) + beh = BEH_HOSTILE; + + mgen_data mg(MONS_JELLY, beh, 0, 0, 0, newpos, MHITNOT, 0, GOD_JIYVA); mg.non_actor_summoner = "Jiyva"; @@ -2346,7 +2353,7 @@ void handle_time() success = true; } - if (success && !silenced(you.pos())) + if (success && !silenced(you.pos()) && !you.nihilist()) { switch (random2(3)) { @@ -2365,8 +2372,11 @@ void handle_time() } } - if (you.religion == GOD_JIYVA && x_chance_in_y(you.piety / 4, MAX_PIETY) - && !player_under_penance() && one_chance_in(4)) + if (you.religion == GOD_JIYVA + && x_chance_in_y(you.piety / 4, MAX_PIETY) + && !player_under_penance() + && !you.nihilist() + && one_chance_in(4)) { jiyva_stat_action(); } @@ -3220,7 +3230,9 @@ void slime_wall_damage(actor* act, int delay) if (act->is_player()) { - if (you.religion != GOD_JIYVA || you.penance[GOD_JIYVA]) + if (you.religion != GOD_JIYVA + || you.penance[GOD_JIYVA] + || you.nihilist()) { splash_with_acid(strength, NON_MONSTER, false, (walls > 1) ? "The walls burn you!" diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h index d412d7b..9cab777 100644 --- a/crawl-ref/source/enum.h +++ b/crawl-ref/source/enum.h @@ -2695,6 +2695,8 @@ enum monster_type // menv[].type MONS_POLYMOTH, + MONS_MOTH_OF_NIHILISM, + NUM_MONSTERS, // used for polymorph // MONS_NO_MONSTER can get put in savefiles, so it shouldn't change @@ -3731,7 +3733,6 @@ enum daction_type DACT_ALLY_BEOGH, // both orcs and demons summoned by high priests DACT_ALLY_SLIME, DACT_ALLY_PLANT, - NUM_DA_COUNTERS, // Leave space for new counters, as they need to be at the start. @@ -3753,6 +3754,7 @@ enum daction_type DACT_SLIME_NEW_ATTEMPT, #endif DACT_KIRKE_HOGS, + DACT_ALLY_YRED_SLAVE_RECLAIMABLE, // will turn friendly again NUM_DACTIONS, }; diff --git a/crawl-ref/source/godabil.cc b/crawl-ref/source/godabil.cc index d6ba814..9bcb771 100644 --- a/crawl-ref/source/godabil.cc +++ b/crawl-ref/source/godabil.cc @@ -751,7 +751,7 @@ bool zin_recite_to_single_monster(const coord_def& where, recite_type prayertype) { // That's a pretty good sanity check, I guess. - if (you.religion != GOD_ZIN) + if (you.religion != GOD_ZIN || you.nihilist()) return false; monster* mon = monster_at(where); @@ -1583,7 +1583,9 @@ bool trog_burn_spellbooks() bool beogh_water_walk() { - return (you.religion == GOD_BEOGH && !player_under_penance() + return (you.religion == GOD_BEOGH + && !player_under_penance() + && !you.nihilist() && you.piety >= piety_breakpoint(4)); } @@ -1881,6 +1883,7 @@ bool fedhas_passthrough(const monster* target) { return (target && fedhas_passthrough_class(target->type) + && !you.nihilist() && (mons_species(target->type) != MONS_OKLOB_PLANT || target->attitude != ATT_HOSTILE)); } @@ -1889,6 +1892,7 @@ bool fedhas_passthrough(const monster_info* target) { return (target && fedhas_passthrough_class(target->type) + && !you.nihilist() && (mons_species(target->type) != MONS_OKLOB_PLANT || target->attitude != ATT_HOSTILE)); } @@ -1897,6 +1901,9 @@ bool fedhas_passthrough(const monster_info* target) // particular beam go through a particular monster? bool fedhas_shoot_through(const bolt& beam, const monster* victim) { + if (you.nihilist()) + return false; + actor *originator = beam.agent(); if (!victim || !originator) return false; diff --git a/crawl-ref/source/godconduct.cc b/crawl-ref/source/godconduct.cc index 3204036..8f4daee 100644 --- a/crawl-ref/source/godconduct.cc +++ b/crawl-ref/source/godconduct.cc @@ -361,8 +361,11 @@ bool did_god_conduct(conduct_type thing_done, int level, bool known, case GOD_TROG: case GOD_BEOGH: case GOD_LUGONU: - if (god_hates_attacking_friend(you.religion, victim)) + if (god_hates_attacking_friend(you.religion, victim) + || you.nihilist()) + { break; + } if (thing_done == DID_BANISH) simple_god_message(" claims a new guest."); @@ -388,8 +391,11 @@ bool did_god_conduct(conduct_type thing_done, int level, bool known, case GOD_MAKHLEB: case GOD_BEOGH: case GOD_LUGONU: - if (god_hates_attacking_friend(you.religion, victim)) + if (god_hates_attacking_friend(you.religion, victim) + || you.nihilist()) + { break; + } simple_god_message(" accepts your kill."); retval = true; @@ -416,8 +422,11 @@ bool did_god_conduct(conduct_type thing_done, int level, bool known, case GOD_KIKUBAAQUDGHA: case GOD_BEOGH: case GOD_LUGONU: - if (god_hates_attacking_friend(you.religion, victim)) + if (god_hates_attacking_friend(you.religion, victim) + || you.nihilist()) + { break; + } simple_god_message(" accepts your kill."); retval = true; @@ -437,7 +446,8 @@ bool did_god_conduct(conduct_type thing_done, int level, bool known, case DID_KILL_NATURAL_UNHOLY: case DID_KILL_NATURAL_EVIL: if (you.religion == GOD_SHINING_ONE - && !god_hates_attacking_friend(you.religion, victim)) + && !god_hates_attacking_friend(you.religion, victim) + && !you.nihilist()) { simple_god_message(" accepts your kill."); retval = true; @@ -449,7 +459,8 @@ bool did_god_conduct(conduct_type thing_done, int level, bool known, case DID_KILL_UNCLEAN: case DID_KILL_CHAOTIC: if (you.religion == GOD_ZIN - && !god_hates_attacking_friend(you.religion, victim)) + && !god_hates_attacking_friend(you.religion, victim) + && !you.nihilist()) { simple_god_message(" accepts your kill."); retval = true; @@ -460,7 +471,8 @@ bool did_god_conduct(conduct_type thing_done, int level, bool known, case DID_KILL_PRIEST: if (you.religion == GOD_BEOGH - && !god_hates_attacking_friend(you.religion, victim)) + && !god_hates_attacking_friend(you.religion, victim) + && !you.nihilist()) { simple_god_message(" appreciates your killing of a heretic " "priest."); @@ -472,7 +484,8 @@ bool did_god_conduct(conduct_type thing_done, int level, bool known, case DID_KILL_WIZARD: if (you.religion == GOD_TROG - && !god_hates_attacking_friend(you.religion, victim)) + && !god_hates_attacking_friend(you.religion, victim) + && !you.nihilist()) { simple_god_message(" appreciates your killing of a magic " "user."); @@ -509,7 +522,8 @@ bool did_god_conduct(conduct_type thing_done, int level, bool known, case DID_KILL_ARTIFICIAL: if (you.religion == GOD_YREDELEMNUL - && !god_hates_attacking_friend(you.religion, victim)) + && !god_hates_attacking_friend(you.religion, victim) + && !you.nihilist()) { simple_god_message(" accepts your kill."); retval = true; @@ -546,8 +560,11 @@ bool did_god_conduct(conduct_type thing_done, int level, bool known, case GOD_MAKHLEB: case GOD_BEOGH: case GOD_LUGONU: - if (god_hates_attacking_friend(you.religion, victim)) + if (god_hates_attacking_friend(you.religion, victim) + || you.nihilist()) + { break; + } simple_god_message(" accepts your kill."); retval = true; @@ -575,8 +592,11 @@ bool did_god_conduct(conduct_type thing_done, int level, bool known, case GOD_MAKHLEB: case GOD_BEOGH: case GOD_LUGONU: - if (god_hates_attacking_friend(you.religion, victim)) + if (god_hates_attacking_friend(you.religion, victim) + || you.nihilist()) + { break; + } simple_god_message(" accepts your slave's kill."); retval = true; @@ -611,8 +631,11 @@ bool did_god_conduct(conduct_type thing_done, int level, bool known, case GOD_MAKHLEB: case GOD_BEOGH: case GOD_LUGONU: - if (god_hates_attacking_friend(you.religion, victim)) + if (god_hates_attacking_friend(you.religion, victim) + || you.nihilist()) + { break; + } simple_god_message(" accepts your collateral kill."); retval = true; @@ -633,6 +656,8 @@ bool did_god_conduct(conduct_type thing_done, int level, bool known, case GOD_MAKHLEB: case GOD_BEOGH: case GOD_LUGONU: + if (you.nihilist()) + break; simple_god_message(" accepts your slave's kill."); retval = true; piety_denom = level + 10 - you.experience_level/3; @@ -652,6 +677,8 @@ bool did_god_conduct(conduct_type thing_done, int level, bool known, case GOD_TROG: case GOD_BEOGH: case GOD_LUGONU: + if (you.nihilist()) + break; simple_god_message(" accepts your collateral kill."); retval = true; piety_denom = level + 10 - you.experience_level/3; @@ -670,6 +697,8 @@ bool did_god_conduct(conduct_type thing_done, int level, bool known, case GOD_MAKHLEB: case GOD_BEOGH: case GOD_LUGONU: + if (you.nihilist()) + break; simple_god_message(" accepts your slave's kill."); retval = true; piety_denom = level + 10 - you.experience_level/3; @@ -689,6 +718,8 @@ bool did_god_conduct(conduct_type thing_done, int level, bool known, case GOD_MAKHLEB: case GOD_BEOGH: case GOD_LUGONU: + if (you.nihilist()) + break; simple_god_message(" accepts your collateral kill."); retval = true; piety_denom = level + 10 - (is_good_god(you.religion) ? 0 : @@ -709,6 +740,8 @@ bool did_god_conduct(conduct_type thing_done, int level, bool known, case GOD_MAKHLEB: case GOD_BEOGH: case GOD_LUGONU: + if (you.nihilist()) + break; simple_god_message(" accepts your slave's kill."); retval = true; piety_denom = level + 10 - you.experience_level/3; @@ -729,6 +762,8 @@ bool did_god_conduct(conduct_type thing_done, int level, bool known, case GOD_TROG: case GOD_BEOGH: case GOD_LUGONU: + if (you.nihilist()) + break; simple_god_message(" accepts your collateral kill."); retval = true; piety_denom = level + 10 - (is_good_god(you.religion) ? 0 : @@ -744,7 +779,8 @@ bool did_god_conduct(conduct_type thing_done, int level, bool known, case DID_NATURAL_UNHOLY_KILLED_BY_SERVANT: case DID_NATURAL_EVIL_KILLED_BY_SERVANT: - if (you.religion == GOD_SHINING_ONE) + if (you.religion == GOD_SHINING_ONE + && !you.nihilist()) { simple_god_message(" accepts your collateral kill."); retval = true; @@ -755,7 +791,8 @@ bool did_god_conduct(conduct_type thing_done, int level, bool known, case DID_UNCLEAN_KILLED_BY_SERVANT: case DID_CHAOTIC_KILLED_BY_SERVANT: - if (you.religion == GOD_ZIN) + if (you.religion == GOD_ZIN + && !you.nihilist()) { simple_god_message(" accepts your collateral kill."); retval = true; @@ -766,7 +803,8 @@ bool did_god_conduct(conduct_type thing_done, int level, bool known, break; case DID_ARTIFICIAL_KILLED_BY_UNDEAD_SLAVE: - if (you.religion == GOD_YREDELEMNUL) + if (you.religion == GOD_YREDELEMNUL + && !you.nihilist()) { simple_god_message(" accepts your slave's kill."); retval = true; @@ -820,7 +858,8 @@ bool did_god_conduct(conduct_type thing_done, int level, bool known, break; case DID_CARDS: - if (you.religion == GOD_NEMELEX_XOBEH) + if (you.religion == GOD_NEMELEX_XOBEH + && !you.nihilist()) { piety_change = level; retval = true; @@ -978,7 +1017,8 @@ bool did_god_conduct(conduct_type thing_done, int level, bool known, break; case DID_EXPLORATION: - if (you.religion == GOD_ASHENZARI) + if (you.religion == GOD_ASHENZARI + && !you.nihilist()) { const int base_gain = 6; // base gain per dungeon level // levels: x1, x1.5, x2, x2.5, x3 @@ -989,7 +1029,8 @@ bool did_god_conduct(conduct_type thing_done, int level, bool known, break; case DID_SEE_MONSTER: - if (you.religion == GOD_SHINING_ONE) + if (you.religion == GOD_SHINING_ONE + && !you.nihilist()) { if (victim && (victim->is_evil() || victim->is_unholy())) break; @@ -1007,6 +1048,7 @@ bool did_god_conduct(conduct_type thing_done, int level, bool known, } if (you.religion == GOD_OKAWARU + && !you.nihilist() // currently no constructs and plants && (thing_done == DID_KILL_LIVING || thing_done == DID_KILL_UNDEAD @@ -1029,7 +1071,10 @@ bool did_god_conduct(conduct_type thing_done, int level, bool known, #endif if (piety_change > 0) - gain_piety(piety_change, piety_denom); + { + if (!you.nihilist()) + gain_piety(piety_change, piety_denom); + } else dock_piety(div_rand_round(-piety_change, piety_denom), penance); diff --git a/crawl-ref/source/godpassive.cc b/crawl-ref/source/godpassive.cc index cd0d3ce..a09d9f5 100644 --- a/crawl-ref/source/godpassive.cc +++ b/crawl-ref/source/godpassive.cc @@ -28,8 +28,12 @@ int che_stat_boost(int piety) { - if (you.religion != GOD_CHEIBRIADOS || you.penance[GOD_CHEIBRIADOS]) + if (you.religion != GOD_CHEIBRIADOS + || you.penance[GOD_CHEIBRIADOS] + || you.nihilist()) + { return 0; + } if (piety < 30) // Since you've already begun to slow down. return 1; if (piety > 160) // Fudging this slightly to agree with ****** piety. @@ -96,7 +100,8 @@ void jiyva_eat_offlevel_items() sacrifice_item_stack(*si, &js); item_was_destroyed(*si); destroy_item(si.link()); - jiyva_slurp_message(js); + if (!you.nihilist()) + jiyva_slurp_message(js); } return; } @@ -105,7 +110,7 @@ void jiyva_eat_offlevel_items() void jiyva_slurp_bonus(int item_value, int *js) { - if (you.penance[GOD_JIYVA]) + if (you.penance[GOD_JIYVA] || you.nihilist()) return; if (you.piety >= piety_breakpoint(1) @@ -406,6 +411,9 @@ bool god_id_item(item_def& item, bool silent) iflags_t old_ided = item.flags & ISFLAG_IDENT_MASK; iflags_t ided = 0; + if (you.nihilist()) + return false; + if (you.religion == GOD_ASHENZARI) { // Don't identify runes or the orb, since this has no gameplay purpose @@ -510,7 +518,7 @@ bool god_id_item(item_def& item, bool silent) void ash_id_monster_equipment(monster* mon) { - if (you.religion != GOD_ASHENZARI) + if (you.religion != GOD_ASHENZARI || you.nihilist()) return; bool id = false; @@ -621,7 +629,7 @@ map<skill_type, int8_t> ash_get_boosted_skills(eq_type type) { const int bondage = you.bondage[type]; map<skill_type, int8_t> boost; - if (bondage <= 0) + if (bondage <= 0 || you.nihilist()) return boost; // Include melded. diff --git a/crawl-ref/source/godprayer.cc b/crawl-ref/source/godprayer.cc index d64ed63..ef700c7 100644 --- a/crawl-ref/source/godprayer.cc +++ b/crawl-ref/source/godprayer.cc @@ -197,6 +197,12 @@ static bool _bless_weapon(god_type god, brand_type brand, int colour) // Prayer at your god's altar. static bool _altar_prayer() { + if (you.nihilist()) + { + mpr("You don't see the point in praying."); + return false; + } + // Different message from when first joining a religion. mpr("You prostrate yourself in front of the altar and pray."); @@ -296,6 +302,12 @@ static bool _altar_prayer() void pray() { + if (you.nihilist()) + { + mpr("You don't see the point."); + return; + } + if (you.cannot_speak()) { mpr("You are unable to make a sound!"); @@ -381,13 +393,19 @@ int zin_tithe(item_def& item, int quant, bool quiet, bool converting) } taken = tithe; you.attribute[ATTR_DONATIONS] += tithe; - mprf("You pay a tithe of %d gold.", tithe); - - if (item.plus == 1) // seen before worshipping Zin + if (!you.nihilist()) + { + mprf("You pay a tithe of %d gold.", tithe); + if (item.plus == 1) // seen before worshipping Zin + { + tithe = 0; + simple_god_message(" is a bit unhappy you did not bring this " + "gold earlier."); + } + } + else { - tithe = 0; - simple_god_message(" is a bit unhappy you did not bring this " - "gold earlier."); + mprf("You destroy %d gold. There's no point in collecting money.", tithe); } // A single scroll can give you more than D:1-18, Lair and Orc // together, limit the gains. You're still required to pay from @@ -415,7 +433,8 @@ int zin_tithe(item_def& item, int quant, bool quiet, bool converting) tithe *= 47; denom *= 20 + env.absdepth0; } - gain_piety(tithe * 3, denom); + if (!you.nihilist()) + gain_piety(tithe * 3, denom); } you.attribute[ATTR_TITHE_BASE] = due; return taken; diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index 3b02d2f..bb7fecd 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -1872,7 +1872,7 @@ void zap_wand(int slot) break; case WAND_HEAL_WOUNDS: - if (you.religion == GOD_ELYVILON) + if (you.religion == GOD_ELYVILON && !you.nihilist()) { targ_mode = TARG_ANY; break; diff --git a/crawl-ref/source/main.cc b/crawl-ref/source/main.cc index 35daf18..9ce1332 100644 --- a/crawl-ref/source/main.cc +++ b/crawl-ref/source/main.cc @@ -928,7 +928,9 @@ static void _start_running(int dir, int mode) for (adjacent_iterator ai(next_pos); ai; ++ai) { if (env.grid(*ai) == DNGN_SLIMY_WALL - && (you.religion != GOD_JIYVA || you.penance[GOD_JIYVA])) + && (you.religion != GOD_JIYVA + || you.penance[GOD_JIYVA] + || you.nihilist())) { mpr("You're about to run into the slime covered wall!", MSGCH_WARN); @@ -2626,8 +2628,10 @@ static void _decrement_durations() { // Note the beauty of Trog! They get an extra save that's at // the very least 20% and goes up to 100%. - if (you.religion == GOD_TROG && x_chance_in_y(you.piety, 150) - && !player_under_penance()) + if (you.religion == GOD_TROG + && x_chance_in_y(you.piety, 150) + && !player_under_penance() + && !you.nihilist()) { mpr("Trog's vigour flows through your veins."); } @@ -2765,7 +2769,9 @@ static void _decrement_durations() { int resilience = 400; - if (you.religion == GOD_CHEIBRIADOS && you.piety >= piety_breakpoint(0)) + if (you.religion == GOD_CHEIBRIADOS + && !you.nihilist() + && you.piety >= piety_breakpoint(0)) resilience = resilience * 3 / 2; // Faster rotting when hungry. @@ -3220,11 +3226,13 @@ static void _player_reacts_to_monsters() if (you.duration[DUR_FIRE_SHIELD] > 0) manage_fire_shield(you.time_taken); - // penance checked there (as you can have antennae too) + // penance and nihilism checked there (as you can have antennae too) if (player_mutation_level(MUT_ANTENNAE) || you.religion == GOD_ASHENZARI) check_antennae_detect(); - if ((you.religion == GOD_ASHENZARI && !player_under_penance()) + if ((you.religion == GOD_ASHENZARI + && !player_under_penance() + && !you.nihilist()) || you.mutation[MUT_JELLY_GROWTH]) { detect_items(-1); @@ -3285,6 +3293,35 @@ static void _player_reacts_to_monsters() else you.props.erase("exists_if_suppressed"); } + + // Entering/leaving a nihilism aura is like a suppression aura. + if (you.props.exists("exists_if_nihilist") != you.nihilist()) + { + if (you.nihilist()) + { + nihilism_cancel_god_effects(); + you.props["exists_if_nihilist"] = true; + } + else + { + you.props.erase("exists_if_nihilist"); + } + + // HP and MP generally aren't recalculated each step, so we do it now + calc_hp(); + calc_mp(); + + // Redraw everything + you.redraw_title = true; + you.redraw_hit_points = true; + you.redraw_magic_points = true; + you.redraw_stats.init(true); + you.redraw_armour_class = true; + you.redraw_evasion = true; + you.redraw_experience = true; + you.redraw_quiver = true; + notify_stat_change("nihilism"); + } } static void _update_golubria_traps() diff --git a/crawl-ref/source/map_knowledge.cc b/crawl-ref/source/map_knowledge.cc index 6a34864..f27849e 100644 --- a/crawl-ref/source/map_knowledge.cc +++ b/crawl-ref/source/map_knowledge.cc @@ -104,8 +104,12 @@ static int _map_quality() int passive = player_mutation_level(MUT_PASSIVE_MAPPING); // the explanation of this 51 vs max_piety of 200 is left as // an exercise to the reader - if (you.religion == GOD_ASHENZARI && !player_under_penance()) + if (you.religion == GOD_ASHENZARI + && !player_under_penance() + && !you.nihilist()) + { passive = max(passive, you.piety / 51); + } return passive; } diff --git a/crawl-ref/source/map_knowledge.h b/crawl-ref/source/map_knowledge.h index 47c5198..e65a738 100644 --- a/crawl-ref/source/map_knowledge.h +++ b/crawl-ref/source/map_knowledge.h @@ -51,6 +51,7 @@ struct cloud_info #define MAP_QUAD_HALOED 0X4000000 #define MAP_DISJUNCT 0X8000000 #define MAP_HOT 0x10000000 +#define MAP_NIHILISM 0x20000000 /* * A map_cell stores what the player knows about a cell. diff --git a/crawl-ref/source/melee_attack.cc b/crawl-ref/source/melee_attack.cc index 2c90786..e396c2a 100644 --- a/crawl-ref/source/melee_attack.cc +++ b/crawl-ref/source/melee_attack.cc @@ -535,6 +535,7 @@ bool melee_attack::handle_phase_hit() && !defender->is_summoned() && !defender->as_monster()->is_shapeshifter() && !player_under_penance() && you.piety >= piety_breakpoint(2) + && !you.nihilist() && mons_near(defender->as_monster()) && defender->asleep()) { hit_woke_orc = true; @@ -1780,7 +1781,9 @@ int melee_attack::player_apply_weapon_bonuses(int damage) if (get_equip_race(*weapon) == ISFLAG_ORCISH && player_genus(GENPC_ORCISH)) { - if (you.religion == GOD_BEOGH && !player_under_penance()) + if (you.religion == GOD_BEOGH + && !player_under_penance() + && !you.nihilist()) { #ifdef DEBUG_DIAGNOSTICS const int orig_damage = damage; @@ -3839,7 +3842,9 @@ int melee_attack::calc_to_hit(bool random) mhit += (random && coinflip() ? 2 : 1); } else if (get_equip_race(*weapon) == ISFLAG_ORCISH - && you.religion == GOD_BEOGH && !player_under_penance()) + && you.religion == GOD_BEOGH + && !player_under_penance() + && !you.nihilist()) { mhit++; } diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc index 007da15..9d0fc95 100644 --- a/crawl-ref/source/misc.cc +++ b/crawl-ref/source/misc.cc @@ -1251,8 +1251,12 @@ void search_around() int skill = (2/(1+exp(-(base_skill+120)/325.0))-1) * 225 + (base_skill/200.0) + 15; - if (you.religion == GOD_ASHENZARI && !player_under_penance()) + if (you.religion == GOD_ASHENZARI + && !player_under_penance() + && !you.nihilist()) + { skill += you.piety * 2; + } if (you.duration[DUR_SWIFTNESS]) skill = skill / 2; diff --git a/crawl-ref/source/mon-act.cc b/crawl-ref/source/mon-act.cc index 69b4d0e..eb772ef 100644 --- a/crawl-ref/source/mon-act.cc +++ b/crawl-ref/source/mon-act.cc @@ -1814,6 +1814,8 @@ static void _pre_monster_move(monster* mons) } fedhas_neutralise(mons); + slime_convert(mons); + yred_slave_reclaim(mons); // Monster just summoned (or just took stairs), skip this action. if (!mons_is_mimic(mons->type) && testbits(mons->flags, MF_JUST_SUMMONED)) @@ -2643,11 +2645,13 @@ static bool _monster_eat_item(monster* mons, bool nearby) if (you.religion == GOD_JIYVA) { - gain = sacrifice_item_stack(*si, &js, quant); - if (gain > PIETY_NONE) - simple_god_message(" appreciates your sacrifice."); - - jiyva_slurp_message(js); + if (!you.nihilist()) + { + gain = sacrifice_item_stack(*si, &js, quant); + if (gain > PIETY_NONE ) + simple_god_message(" appreciates your sacrifice."); + jiyva_slurp_message(js); + } } if (quant >= si->quantity) diff --git a/crawl-ref/source/mon-cast.cc b/crawl-ref/source/mon-cast.cc index e55060a..04f1b1c 100644 --- a/crawl-ref/source/mon-cast.cc +++ b/crawl-ref/source/mon-cast.cc @@ -2268,6 +2268,14 @@ bool handle_mon_spell(monster* mons, bolt &beem) return false; } + // Nihilist acts as silence for religious casters. + // This is probably too strict, but it's easy. + if (mons->nihilist() + && (priest || god != GOD_NO_GOD)) + { + return false; + } + // Shapeshifters don't get spells. if (mons->is_shapeshifter() && (priest || wizard)) return false; @@ -2820,7 +2828,7 @@ static int _monster_abjure_square(const coord_def &pos, // TSO and Trog's abjuration protection. bool shielded = false; - if (you.religion == GOD_SHINING_ONE) + if (you.religion == GOD_SHINING_ONE && !you.nihilist()) { pow = pow * (30 - target->hit_dice) / 30; if (pow < duration) @@ -2830,7 +2838,7 @@ static int _monster_abjure_square(const coord_def &pos, shielded = true; } } - else if (you.religion == GOD_TROG) + else if (you.religion == GOD_TROG && !you.nihilist()) { pow = pow * 4 / 5; if (pow < duration) diff --git a/crawl-ref/source/mon-data.h b/crawl-ref/source/mon-data.h index 1f6c1f7..99bce74 100644 --- a/crawl-ref/source/mon-data.h +++ b/crawl-ref/source/mon-data.h @@ -2505,6 +2505,18 @@ static monsterentry mondata[] = { MONUSE_NOTHING, MONEAT_NOTHING, SIZE_SMALL }, +{ + MONS_MOTH_OF_NIHILISM, 'y', LIGHTGREY, "moth of nihilism", + M_NO_SKELETON | M_NO_POLY_TO, + MR_NO_FLAGS, + 300, 6, MONS_MOTH, MONS_MOTH_OF_NIHILISM, MH_NATURAL, -3, + { {AT_BITE, AF_PLAIN, 20}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK }, + { 9, 3, 5, 0 }, + 0, 14, MST_NO_SPELLS, CE_CONTAMINATED, Z_SMALL, S_SILENT, + I_INSECT, HT_LAND, FL_WINGED, 12, DEFAULT_ENERGY, + MONUSE_NOTHING, MONEAT_NOTHING, SIZE_SMALL +}, + // small zombies, etc. ('z') // zombie, skeleton and simulacra species depend on corpse species, // or else are chosen randomly diff --git a/crawl-ref/source/mon-death.cc b/crawl-ref/source/mon-death.cc index aac0d93..2e60676 100644 --- a/crawl-ref/source/mon-death.cc +++ b/crawl-ref/source/mon-death.cc @@ -357,7 +357,7 @@ void elven_twins_pacify(monster* twin) ASSERT(!mons->neutral()); - if (you.religion == GOD_ELYVILON) + if (you.religion == GOD_ELYVILON && !you.nihilist()) gain_piety(random2(mons->max_hit_points / (2 + you.piety / 20)), 2); if (mons_near(mons)) diff --git a/crawl-ref/source/mon-info.cc b/crawl-ref/source/mon-info.cc index a27d28c..660d0ca 100644 --- a/crawl-ref/source/mon-info.cc +++ b/crawl-ref/source/mon-info.cc @@ -602,6 +602,8 @@ monster_info::monster_info(const monster* m, int milev) mb.set(MB_UMBRAED); if (m->suppressed()) mb.set(MB_SUPPRESSED); + if (m->nihilist()) + mb.set(MB_NIHILISM); if (mons_looks_stabbable(m)) mb.set(MB_STABBABLE); if (mons_looks_distracted(m)) diff --git a/crawl-ref/source/mon-info.h b/crawl-ref/source/mon-info.h index 8b45943..a292eca 100644 --- a/crawl-ref/source/mon-info.h +++ b/crawl-ref/source/mon-info.h @@ -98,6 +98,7 @@ enum monster_info_flags MB_WIND_AIDED, MB_SUMMONED_NO_STAIRS, // Temp. summoned and capped monsters MB_SUMMONED_CAPPED, // Expiring due to summons cap + MB_NIHILISM, NUM_MB_FLAGS }; diff --git a/crawl-ref/source/mon-stuff.cc b/crawl-ref/source/mon-stuff.cc index e80f84f..f25321b 100644 --- a/crawl-ref/source/mon-stuff.cc +++ b/crawl-ref/source/mon-stuff.cc @@ -568,6 +568,7 @@ static void _give_monster_experience(int experience, int killer_index) { if (you.religion != GOD_SHINING_ONE && you.religion != GOD_BEOGH || player_under_penance() + || you.nihilist() || !one_chance_in(3)) { return; @@ -748,7 +749,7 @@ int exp_rate(int killer) // your allies. static bool _ely_protect_ally(monster* mons, killer_type killer) { - if (you.religion != GOD_ELYVILON) + if (you.religion != GOD_ELYVILON || you.nihilist()) return false; if (!MON_KILL(killer) && !YOU_KILL(killer)) @@ -825,7 +826,7 @@ static bool _yred_enslave_soul(monster* mons, killer_type killer) { record_monster_defeat(mons, killer); record_monster_defeat(mons, KILL_ENSLAVED); - yred_make_enslaved_soul(mons, player_under_penance()); + yred_make_enslaved_soul(mons, player_under_penance() || you.nihilist()); return true; } @@ -837,8 +838,11 @@ static bool _beogh_forcibly_convert_orc(monster* mons, killer_type killer, { if (you.religion == GOD_BEOGH && mons_genus(mons->type) == MONS_ORC - && !mons->is_summoned() && !mons->is_shapeshifter() - && !player_under_penance() && you.piety >= piety_breakpoint(2) + && !mons->is_summoned() + && !mons->is_shapeshifter() + && !player_under_penance() + && !you.nihilist() + && you.piety >= piety_breakpoint(2) && mons_near(mons) && !mons_is_god_gift(mons)) { bool convert = false; @@ -1035,7 +1039,9 @@ static void _mummy_curse(monster* mons, killer_type killer, int index) && YOU_KILL(killer)) { // Kiku protects you from ordinary mummy curses. - if (you.religion == GOD_KIKUBAAQUDGHA && !player_under_penance() + if (you.religion == GOD_KIKUBAAQUDGHA + && !player_under_penance() + && !you.nihilist() && you.piety >= piety_breakpoint(1)) { simple_god_message(" averts the curse."); @@ -1669,7 +1675,9 @@ int monster_die(monster* mons, killer_type killer, if (killer == KILL_YOU && you.berserk()) { if (you.religion == GOD_TROG - && !player_under_penance() && you.piety > random2(1000)) + && !player_under_penance() + && !you.nihilist() + && you.piety > random2(1000)) { const int bonus = (3 + random2avg(10, 2)) / 2; @@ -2013,6 +2021,7 @@ int monster_die(monster* mons, killer_type killer, && (mons->is_evil() || mons->is_unholy())) && !mons_is_object(mons->type) && !player_under_penance() + && !you.nihilist() && random2(you.piety) >= piety_breakpoint(0) && !you.duration[DUR_DEATHS_DOOR]) { @@ -2033,6 +2042,7 @@ int monster_die(monster* mons, killer_type killer, && (mons->is_evil() || mons->is_unholy())) && !mons_is_object(mons->type) && !player_under_penance() + && !you.nihilist() && random2(you.piety) >= piety_breakpoint(0)) { if (you.species != SP_DJINNI ? @@ -2056,7 +2066,8 @@ int monster_die(monster* mons, killer_type killer, && (you.religion == GOD_BEOGH && random2(you.piety) >= piety_breakpoint(2)) && !mons_is_object(mons->type) - && !player_under_penance()) + && !player_under_penance() + && !you.nihilist()) { bless_follower(); } @@ -2267,6 +2278,7 @@ int monster_die(monster* mons, killer_type killer, if (you.religion == GOD_SHINING_ONE && (mons->is_evil() || mons->is_unholy()) && !player_under_penance() + && !you.nihilist() && random2(you.piety) >= piety_breakpoint(0) && !invalid_monster_index(killer_index)) { @@ -2289,6 +2301,7 @@ int monster_die(monster* mons, killer_type killer, if (you.religion == GOD_BEOGH && random2(you.piety) >= piety_breakpoint(2) && !player_under_penance() + && !you.nihilist() && !one_chance_in(3) && !invalid_monster_index(killer_index)) { @@ -2600,16 +2613,28 @@ int monster_die(monster* mons, killer_type killer, if (crawl_state.game_is_arena()) arena_monster_died(mons, killer, killer_index, silent, corpse); - // Monsters haloes should be removed when they die. - if (mons->holiness() == MH_HOLY) + // Monsters auras should be removed when they die. + // Monsters auras should be removed when they die. + if (mons->holiness() == MH_HOLY + || mons->type == MONS_PROFANE_SERVITOR + || mons->type == MONS_LOST_SOUL) + { invalidate_agrid(); - // Likewise silence and umbras + } if (mons->type == MONS_SILENT_SPECTRE - || mons->type == MONS_PROFANE_SERVITOR || mons->type == MONS_MOTH_OF_SUPPRESSION - || mons->type == MONS_LOST_SOUL) + || mons->type == MONS_MOTH_OF_NIHILISM) { invalidate_agrid(); + // Redraw everything, just to be safe + you.redraw_title = true; + you.redraw_hit_points = true; + you.redraw_magic_points = true; + you.redraw_stats.init(true); + you.redraw_armour_class = true; + you.redraw_evasion = true; + you.redraw_experience = true; + you.redraw_quiver = true; } // Done before items are dropped so that we can clone them diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index 1d0e017..b259bea 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -1530,7 +1530,8 @@ bool mons_class_can_use_stairs(monster_type mc) && mc != MONS_GERYON && mc != MONS_ROYAL_JELLY && mc != MONS_MOTH_OF_SUPPRESSION - && mc != MONS_POLYMOTH); + && mc != MONS_POLYMOTH + && mc != MONS_MOTH_OF_NIHILISM); } bool mons_can_use_stairs(const monster* mon) diff --git a/crawl-ref/source/monster.h b/crawl-ref/source/monster.h index e08644d..1846b8e 100644 --- a/crawl-ref/source/monster.h +++ b/crawl-ref/source/monster.h @@ -379,6 +379,7 @@ public: int umbra_radius2 () const; int suppression_radius2 () const; int soul_aura_radius2 () const; + int nihilism_radius2() const; int heat_radius2 () const; bool glows_naturally() const; bool petrified() const; diff --git a/crawl-ref/source/mutation.cc b/crawl-ref/source/mutation.cc index 1dd9f8e..bbbe583 100644 --- a/crawl-ref/source/mutation.cc +++ b/crawl-ref/source/mutation.cc @@ -1477,6 +1477,7 @@ bool mutate(mutation_type which_mutation, const string &reason, bool failMsg, // Zin's protection. if (you.religion == GOD_ZIN + && !you.nihilist() && (x_chance_in_y(you.piety, MAX_PIETY) || x_chance_in_y(you.piety, MAX_PIETY + 22))) { @@ -2475,7 +2476,8 @@ static bool _balance_demonic_guardian() void check_demonic_guardian() { // Don't spawn guardians with Oka, they're a huge pain. - if (you.religion == GOD_OKAWARU) + // If you're a nihilist you don't mind the pain though. + if (you.religion == GOD_OKAWARU && !you.nihilist()) return; const int mutlevel = player_mutation_level(MUT_DEMONIC_GUARDIAN); @@ -2523,7 +2525,7 @@ void check_demonic_guardian() void check_antennae_detect() { int radius = player_mutation_level(MUT_ANTENNAE) * 2; - if (you.religion == GOD_ASHENZARI && !player_under_penance()) + if (you.religion == GOD_ASHENZARI && !player_under_penance() && !you.nihilist()) radius = max(radius, you.piety / 20); if (radius <= 0) return; diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc index 8b1edc6..f6b6876 100644 --- a/crawl-ref/source/ouch.cc +++ b/crawl-ref/source/ouch.cc @@ -501,7 +501,8 @@ static bool _expose_invent_to_element(beam_type flavour, int strength) // Fedhas worshipers are exempt from the food destruction effect // of spores. if (flavour == BEAM_SPORE - && you.religion == GOD_FEDHAS) + && you.religion == GOD_FEDHAS + && !you.nihilist()) { simple_god_message(" protects your food from the spores.", GOD_FEDHAS); @@ -543,7 +544,9 @@ static bool _expose_invent_to_element(beam_type flavour, int strength) continue; } - if (you.religion == GOD_JIYVA && !player_under_penance() + if (you.religion == GOD_JIYVA + && !player_under_penance() + && !you.nihilist() && x_chance_in_y(you.piety, MAX_PIETY)) { ++jiyva_block; @@ -968,6 +971,9 @@ static void _maybe_spawn_jellies(int dam, const char* aux, if (death_source == NON_MONSTER) return; + if (you.nihilist()) + return; + monster_type mon = royal_jelly_ejectable_monster(); // Exclude torment damage. diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc index 6991e8e..a74a7a6 100644 --- a/crawl-ref/source/output.cc +++ b/crawl-ref/source/output.cc @@ -1007,6 +1007,7 @@ static void _get_status_lights(vector<status_light>& out) DUR_INFUSION, DUR_SONG_OF_SLAYING, DUR_SONG_OF_SHIELDING, + STATUS_NIHILISM, }; status_info inf; diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 6eeaea1..44b49d7 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -1362,8 +1362,12 @@ int player_hunger_rate(bool temp) hunger += 4; // If Cheibriados has slowed your life processes, you will hunger less. - if (you.religion == GOD_CHEIBRIADOS && you.piety >= piety_breakpoint(0)) + if (you.religion == GOD_CHEIBRIADOS + && !you.nihilist() + && you.piety >= piety_breakpoint(0)) + { hunger--; + } // Moved here from main.cc... maintaining the >= 40 behaviour. if (temp && you.hunger >= 40) @@ -1569,8 +1573,12 @@ int player_res_fire(bool calc_unid, bool temp, bool items) switch (you.form) { case TRAN_TREE: - if (you.religion == GOD_FEDHAS && !player_under_penance()) + if (you.religion == GOD_FEDHAS + && !player_under_penance() + && !you.nihilist()) + { rf++; + } break; case TRAN_ICE_BEAST: rf--; @@ -1641,8 +1649,12 @@ int player_res_cold(bool calc_unid, bool temp, bool items) switch (you.form) { case TRAN_TREE: - if (you.religion == GOD_FEDHAS && !player_under_penance()) + if (you.religion == GOD_FEDHAS + && !player_under_penance() + && !you.nihilist()) + { rc++; + } break; case TRAN_ICE_BEAST: rc += 3; @@ -1733,7 +1745,9 @@ int player_res_cold(bool calc_unid, bool temp, bool items) bool player::res_corr(bool calc_unid, bool items) const { - if (religion == GOD_JIYVA && piety >= piety_breakpoint(2)) + if (religion == GOD_JIYVA + && !you.nihilist() + && piety >= piety_breakpoint(2)) return true; if (you.form == TRAN_JELLY || you.form == TRAN_WISP) @@ -1856,6 +1870,7 @@ int player_kiku_res_torment() { return (you.religion == GOD_KIKUBAAQUDGHA && !player_under_penance() + && !you.nihilist() && you.piety >= piety_breakpoint(3) && !you.gift_timeout); // no protection during pain branding weapon } @@ -2314,7 +2329,7 @@ int player_movement_speed(bool ignore_burden) mv += 2 * you.wearing_ego(EQ_ALL_ARMOUR, SPARM_PONDEROUSNESS); // Cheibriados - if (you.religion == GOD_CHEIBRIADOS) + if (you.religion == GOD_CHEIBRIADOS && !you.nihilist()) mv += 2 + min(div_rand_round(you.piety, 20), 8); // Tengu can move slightly faster when flying. @@ -2470,7 +2485,9 @@ static int _player_armour_racial_bonus(const item_def& item) racial_bonus += 4; // an additional bonus for Beogh worshippers - if (you.religion == GOD_BEOGH && !player_under_penance()) + if (you.religion == GOD_BEOGH + && !player_under_penance() + && !you.nihilist()) { if (you.piety >= 185) racial_bonus += racial_bonus * 9 / 4; @@ -2925,7 +2942,8 @@ void forget_map(bool rot) const bool rot_resist = player_in_branch(BRANCH_LABYRINTH) && you.species == SP_MINOTAUR || player_in_branch(BRANCH_ABYSS) - && you.religion == GOD_LUGONU; + && you.religion == GOD_LUGONU + && !you.nihilist(); const double geometric_chance = 0.99; const int radius = (rot_resist ? 200 : 100); @@ -3011,7 +3029,8 @@ void gain_exp(unsigned int exp_gained, unsigned int* actual_gain) dprf("gain_exp: %d", exp_gained); - if (you.transfer_skill_points > 0) + if (you.transfer_skill_points > 0 + && !you.nihilist()) { // Can happen if the game got interrupted during target skill choice. if (is_invalid_skill(you.transfer_to_skill)) @@ -4372,7 +4391,8 @@ bool player::clarity(bool calc_unid, bool items) const return true; if (religion == GOD_ASHENZARI && piety >= piety_breakpoint(2) - && !player_under_penance()) + && !player_under_penance() + && !you.nihilist()) { return true; } @@ -5173,6 +5193,7 @@ void dec_poison_player() // chance that your poison level is simply unaffected and // you aren't hurt by poison. if (GOD_CHEIBRIADOS == you.religion + && !you.nihilist() && you.piety >= piety_breakpoint(0) && coinflip()) { @@ -6312,7 +6333,9 @@ int player::skill(skill_type sk, int scale, bool real) const level = min(level + 5 * scale, 27 * scale); if (you.penance[GOD_ASHENZARI]) level = max(level - min(4 * scale, level / 2), 0); - else if (you.religion == GOD_ASHENZARI && you.skill_boost[sk] + else if (you.religion == GOD_ASHENZARI + && !you.nihilist() + && you.skill_boost[sk] && piety_rank() > 2) { level = ash_skill_boost(sk, scale); @@ -6936,7 +6959,9 @@ bool player::tengu_flight() const bool player::nightvision() const { return (is_undead - || (religion == GOD_YREDELEMNUL && piety >= piety_breakpoint(2))); + || (religion == GOD_YREDELEMNUL + && !you.nihilist() + && piety >= piety_breakpoint(2))); } reach_type player::reach_range() const @@ -7380,8 +7405,10 @@ bool player::can_see_invisible(bool calc_unid, bool items) const if (player_mutation_level(MUT_EYEBALLS) == 3) return true; - if (you.religion == GOD_ASHENZARI && you.piety >= piety_breakpoint(2) - && !player_under_penance()) + if (you.religion == GOD_ASHENZARI + && you.piety >= piety_breakpoint(2) + && !player_under_penance() + && !you.nihilist()) { return true; } diff --git a/crawl-ref/source/player.h b/crawl-ref/source/player.h index 5d30ef0..9e20c5e 100644 --- a/crawl-ref/source/player.h +++ b/crawl-ref/source/player.h @@ -660,6 +660,7 @@ public: int umbra_radius2() const; int suppression_radius2() const; int soul_aura_radius2() const; + int nihilism_radius2() const; int heat_radius2() const; bool glows_naturally() const; bool petrifying() const; diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index bb05412..e82c82b 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -968,6 +968,86 @@ string get_god_dislikes(god_type which_god, bool /*verbose*/) return text; } +static bool _need_water_walking() +{ + return (you.ground_level() && you.species != SP_MERFOLK + && grd(you.pos()) == DNGN_DEEP_WATER); +} + +// Cancels certain abilities that require god support to be maintained. +void nihilism_cancel_god_effects() +{ + you.duration[DUR_SCRYING] = 0; + you.duration[DUR_JELLY_PRAYER] = 0; + you.duration[DUR_SLIMIFY] = 0; + you.duration[DUR_LIFESAVING] = 0; + you.duration[DUR_HEROISM] = 0; + you.duration[DUR_FINESSE] = 0; + you.duration[DUR_MIRROR_DAMAGE] = 0; + + switch (you.religion) + { + case GOD_BEOGH: + { + // You might have lost water walking at a bad time... + if (_need_water_walking()) + fall_into_a_pool(you.pos(), true, grd(you.pos())); + break; + } + + case GOD_CHEIBRIADOS: + { + notify_stat_change("losing Cheibriados' support"); + break; + } + + case GOD_ELYVILON: + { + if (you.duration[DUR_DIVINE_VIGOUR]) + elyvilon_remove_divine_vigour(); + break; + } + + case GOD_TROG: + { + if (you.attribute[ATTR_DIVINE_REGENERATION]) + remove_regen(true); + break; + } + + case GOD_SHINING_ONE: + { + if (you.duration[DUR_DIVINE_SHIELD]) + tso_remove_divine_shield(); + + invalidate_agrid(); + break; + } + + case GOD_YREDELEMNUL: + { + if (query_da_counter(DACT_ALLY_YRED_SLAVE)) + { + mpr("Your undead slaves have temporarily become hostile!"); + add_daction(DACT_ALLY_YRED_SLAVE_RECLAIMABLE); + } + } + + case GOD_ZIN: + { + if (you.duration[DUR_DIVINE_STAMINA]) + zin_remove_divine_stamina(); + + if (env.sanctuary_time) + remove_sanctuary(); + break; + } + + default: + break; + } +} + void dec_penance(god_type god, int val) { if (val <= 0 || you.penance[god] <= 0) @@ -1055,12 +1135,6 @@ void dec_penance(int val) dec_penance(you.religion, val); } -static bool _need_water_walking() -{ - return (you.ground_level() && you.species != SP_MERFOLK - && grd(you.pos()) == DNGN_DEEP_WATER); -} - bool jiyva_is_dead() { return (you.royal_jelly_dead @@ -2091,6 +2165,9 @@ bool do_god_gift(bool forced) { ASSERT(you.religion != GOD_NO_GOD); + if (you.nihilist()) + return false; + god_acting gdact; #if defined(DEBUG_DIAGNOSTICS) || defined(DEBUG_GIFTS) @@ -2624,6 +2701,9 @@ void gain_piety(int original_gain, int denominator, bool force, bool should_scal if (you.religion == GOD_NO_GOD || you.religion == GOD_XOM) return; + if (!force && you.nihilist()) + return; + int pgn = should_scale_piety? piety_scale(original_gain) : original_gain; if (crawl_state.game_is_sprint() && should_scale_piety) @@ -3924,6 +4004,8 @@ bool god_loathes_spell(spell_type spell, god_type god) bool god_can_protect_from_harm(god_type god) { + if (you.nihilist()) + return false; switch (god) { case GOD_BEOGH: diff --git a/crawl-ref/source/religion.h b/crawl-ref/source/religion.h index 75aabb2..3ccf74d 100644 --- a/crawl-ref/source/religion.h +++ b/crawl-ref/source/religion.h @@ -39,6 +39,8 @@ string get_god_powers(god_type which_god); string get_god_likes(god_type which_god, bool verbose = false); string get_god_dislikes(god_type which_god, bool verbose = false); +void nihilism_cancel_god_effects(); + void dec_penance(int val); void dec_penance(god_type god, int val); diff --git a/crawl-ref/source/rltiles/dc-feat.txt b/crawl-ref/source/rltiles/dc-feat.txt index d8ee583..9cdc5ed 100644 --- a/crawl-ref/source/rltiles/dc-feat.txt +++ b/crawl-ref/source/rltiles/dc-feat.txt @@ -740,6 +740,7 @@ mold_glowing3 mold_glowing4 effect/silenced SILENCED effect/suppressed SUPPRESSED +effect/nihilism NIHILISM %shrink 0 %sdir mon/tentacles/kraken_corners kraken_corner_NW KRAKEN_OVERLAY_NW diff --git a/crawl-ref/source/show.cc b/crawl-ref/source/show.cc index 6059732..4eb2efb 100644 --- a/crawl-ref/source/show.cc +++ b/crawl-ref/source/show.cc @@ -134,6 +134,9 @@ static void _update_feat_at(const coord_def &gp) if (suppressed(gp)) env.map_knowledge(gp).flags |= MAP_SUPPRESSED; + if (nihilism(gp)) + env.map_knowledge(gp).flags |= MAP_NIHILISM; + if (silenced(gp)) env.map_knowledge(gp).flags |= MAP_SILENCED; diff --git a/crawl-ref/source/showsymb.cc b/crawl-ref/source/showsymb.cc index a1a2d34..605248e 100644 --- a/crawl-ref/source/showsymb.cc +++ b/crawl-ref/source/showsymb.cc @@ -135,6 +135,8 @@ unsigned short _cell_feat_show_colour(const map_cell& cell, colour = ETC_DISJUNCTION; else if (cell.flags & MAP_SUPPRESSED) colour = LIGHTGREEN; + else if (cell.flags & MAP_NIHILISM) + colour = WHITE; else if (cell.flags & MAP_HOT) colour = ETC_FIRE; } diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc index e763cc4..1f22ca6 100644 --- a/crawl-ref/source/spl-cast.cc +++ b/crawl-ref/source/spl-cast.cc @@ -283,7 +283,9 @@ static int _apply_spellcasting_success_boosts(spell_type spell, int chance) int wiz_factor = 87; if (you.religion == GOD_VEHUMET - && !player_under_penance() && you.piety >= piety_breakpoint(2) + && !player_under_penance() + && !you.nihilist() + && you.piety >= piety_breakpoint(2) && vehumet_supports_spell(spell)) { // [dshaligram] Fail rate multiplier used to be .5, scaled @@ -1307,6 +1309,7 @@ spret_type your_spells(spell_type spell, int powc, if (you.religion == GOD_SIF_MUNA && !player_under_penance() + && !you.nihilist() && you.piety >= 100 && x_chance_in_y(you.piety + 1, 150)) { canned_msg(MSG_NOTHING_HAPPENS); diff --git a/crawl-ref/source/spl-goditem.cc b/crawl-ref/source/spl-goditem.cc index 6e3501c..40b6d13 100644 --- a/crawl-ref/source/spl-goditem.cc +++ b/crawl-ref/source/spl-goditem.cc @@ -136,7 +136,7 @@ static bool _mons_hostile(const monster* mon) // Returns 0, if it's possible to pacify this monster. int is_pacifiable(const monster* mon) { - if (you.religion != GOD_ELYVILON) + if (you.religion != GOD_ELYVILON || you.nihilist()) return -1; // I was thinking of jellies when I wrote this, but maybe we shouldn't @@ -241,7 +241,8 @@ static int _healing_spell(int healed, int max_healed, bool divine_ability, { spd.isValid = spell_direction(spd, beam, DIR_TARGET, mode != TARG_NUM_MODES ? mode : - you.religion == GOD_ELYVILON ? + you.religion == GOD_ELYVILON + && !you.nihilist() ? TARG_ANY : TARG_FRIEND, LOS_RADIUS, false, true, true, "Heal", NULL, false, NULL, _desc_mindless); @@ -283,6 +284,7 @@ static int _healing_spell(int healed, int max_healed, bool divine_ability, // Don't divinely heal a monster you can't pacify. if (divine_ability && is_hostile && you.religion == GOD_ELYVILON + && !you.nihilist() && can_pacify <= 0) { if (can_pacify == 0) @@ -319,6 +321,7 @@ static int _healing_spell(int healed, int max_healed, bool divine_ability, bool did_something = false; if (you.religion == GOD_ELYVILON + && !you.nihilist() && can_pacify == 1 && is_hostile) { @@ -484,7 +487,8 @@ int detect_items(int pow) map_radius = 8 + random2(8) + pow; else { - if (you.religion == GOD_ASHENZARI) + if (you.religion == GOD_ASHENZARI + && !you.nihilist()) { map_radius = min(you.piety / 20, LOS_RADIUS); if (map_radius <= 0) diff --git a/crawl-ref/source/spl-miscast.cc b/crawl-ref/source/spl-miscast.cc index d67d42d..3f00d4a 100644 --- a/crawl-ref/source/spl-miscast.cc +++ b/crawl-ref/source/spl-miscast.cc @@ -1605,8 +1605,11 @@ void MiscastEffect::_divination_mon(int severity) void MiscastEffect::_necromancy(int severity) { - if (target->is_player() && you.religion == GOD_KIKUBAAQUDGHA - && !player_under_penance() && you.piety >= piety_breakpoint(1)) + if (target->is_player() + && you.religion == GOD_KIKUBAAQUDGHA + && !player_under_penance() + && !you.nihilist() + && you.piety >= piety_breakpoint(1)) { const bool death_curse = (cause.find("death curse") != string::npos); diff --git a/crawl-ref/source/spl-selfench.cc b/crawl-ref/source/spl-selfench.cc index df9d4f4..d108fc6 100644 --- a/crawl-ref/source/spl-selfench.cc +++ b/crawl-ref/source/spl-selfench.cc @@ -28,8 +28,12 @@ int allowed_deaths_door_hp(void) { int hp = you.skill(SK_NECROMANCY) / 2; - if (you.religion == GOD_KIKUBAAQUDGHA && !player_under_penance()) + if (you.religion == GOD_KIKUBAAQUDGHA + && !player_under_penance() + && !you.nihilist()) + { hp += you.piety / 15; + } return max(hp, 1); } diff --git a/crawl-ref/source/spl-summoning.cc b/crawl-ref/source/spl-summoning.cc index b28c41d..acfa818 100644 --- a/crawl-ref/source/spl-summoning.cc +++ b/crawl-ref/source/spl-summoning.cc @@ -2347,7 +2347,9 @@ spret_type cast_haunt(int pow, const coord_def& where, god_type god, bool fail) //jmf: Kiku sometimes deflects this if (you.religion != GOD_KIKUBAAQUDGHA - || player_under_penance() || you.piety < piety_breakpoint(3) + || player_under_penance() + || you.nihilist() + || you.piety < piety_breakpoint(3) || !x_chance_in_y(you.piety, MAX_PIETY)) { you.sicken(25 + random2(50)); @@ -2374,7 +2376,7 @@ static int _abjuration(int pow, monster *mon) bool shielded = false; // TSO and Trog's abjuration protection. - if (mons_is_god_gift(mon, GOD_SHINING_ONE)) + if (mons_is_god_gift(mon, GOD_SHINING_ONE) && !you.nihilist()) { sockage = sockage * (30 - mon->hit_dice) / 45; if (sockage < duration) @@ -2384,7 +2386,7 @@ static int _abjuration(int pow, monster *mon) shielded = true; } } - else if (mons_is_god_gift(mon, GOD_TROG)) + else if (mons_is_god_gift(mon, GOD_TROG) && !you.nihilist()) { sockage = sockage * 8 / 15; if (sockage < duration) diff --git a/crawl-ref/source/spl-util.cc b/crawl-ref/source/spl-util.cc index 92fc712..6126826 100644 --- a/crawl-ref/source/spl-util.cc +++ b/crawl-ref/source/spl-util.cc @@ -959,6 +959,7 @@ int spell_range(spell_type spell, int pow, bool player_spell) && spell != SPELL_STICKY_FLAME && spell != SPELL_FREEZE && !player_under_penance() + && !you.nihilist() && you.piety >= piety_breakpoint(3)) { maxrange++; diff --git a/crawl-ref/source/status.cc b/crawl-ref/source/status.cc index 529e5c2..7734e92 100644 --- a/crawl-ref/source/status.cc +++ b/crawl-ref/source/status.cc @@ -340,6 +340,16 @@ bool fill_status_info(int status, status_info* inf) } break; + case STATUS_NIHILISM: + if (you.nihilist()) + { + inf->light_colour = LIGHTGREY; + inf->light_text = "Nihilist"; + inf->short_text = "nihilistic"; + inf->long_text = "You are surrounded by nihilism."; + } + break; + case STATUS_NET: if (you.attribute[ATTR_HELD]) { diff --git a/crawl-ref/source/status.h b/crawl-ref/source/status.h index 4f66e46..a52b3bb 100644 --- a/crawl-ref/source/status.h +++ b/crawl-ref/source/status.h @@ -38,7 +38,8 @@ enum status_type STATUS_BEOGH, STATUS_RECALL, STATUS_LIQUEFIED, - STATUS_LAST_STATUS = STATUS_LIQUEFIED + STATUS_NIHILISM, + STATUS_LAST_STATUS = STATUS_NIHILISM }; struct status_info diff --git a/crawl-ref/source/tilecell.cc b/crawl-ref/source/tilecell.cc index 7fd0385..d545410 100644 --- a/crawl-ref/source/tilecell.cc +++ b/crawl-ref/source/tilecell.cc @@ -27,6 +27,7 @@ void packed_cell::clear() is_bloody = false; is_silenced = false; is_suppressed = false; + is_nihilism = false; halo = HALO_NONE; is_moldy = false; glowing_mold = false; @@ -51,6 +52,7 @@ bool packed_cell::operator ==(const packed_cell &other) const if (is_bloody != other.is_bloody) return false; if (is_silenced != other.is_silenced) return false; if (is_suppressed != other.is_suppressed) return false; + if (is_nihilism != other.is_nihilism) return false; if (halo != other.halo) return false; if (is_moldy != other.is_moldy) return false; if (glowing_mold != other.glowing_mold) return false; diff --git a/crawl-ref/source/tilecell.h b/crawl-ref/source/tilecell.h index 94a2698..a6ced82 100644 --- a/crawl-ref/source/tilecell.h +++ b/crawl-ref/source/tilecell.h @@ -26,6 +26,7 @@ struct packed_cell bool is_bloody; bool is_silenced; bool is_suppressed; + bool is_nihilism; char halo; bool is_moldy; bool glowing_mold; diff --git a/crawl-ref/source/tiledgnbuf.cc b/crawl-ref/source/tiledgnbuf.cc index cf4483f..31e446e 100644 --- a/crawl-ref/source/tiledgnbuf.cc +++ b/crawl-ref/source/tiledgnbuf.cc @@ -264,6 +264,8 @@ void DungeonCellBuffer::pack_background(int x, int y, const packed_cell &cell) m_buf_feat.add(TILE_SILENCED, x, y); if (cell.is_suppressed) m_buf_feat.add(TILE_SUPPRESSED, x, y); + if (cell.is_nihilism) + m_buf_feat.add(TILE_NIHILISM, x, y); if (cell.halo == HALO_RANGE) m_buf_feat.add(TILE_HALO_RANGE, x, y); if (cell.halo == HALO_UMBRA) diff --git a/crawl-ref/source/tileview.cc b/crawl-ref/source/tileview.cc index 7262f81..cb98801 100644 --- a/crawl-ref/source/tileview.cc +++ b/crawl-ref/source/tileview.cc @@ -1337,6 +1337,9 @@ void tile_apply_properties(const coord_def &gc, packed_cell &cell) if (mc.flags & MAP_SUPPRESSED) cell.is_suppressed = true; + if (mc.flags & MAP_NIHILISM) + cell.is_nihilism = true; + if (feat == DNGN_MANGROVE) cell.mangrove_water = true; diff --git a/crawl-ref/source/tileweb.cc b/crawl-ref/source/tileweb.cc index 96df11b..cb09802 100644 --- a/crawl-ref/source/tileweb.cc +++ b/crawl-ref/source/tileweb.cc @@ -1066,6 +1066,9 @@ void TilesFramework::_send_cell(const coord_def &gc, if (next_pc.is_suppressed != current_pc.is_suppressed) json_write_bool("suppressed", next_pc.is_suppressed); + if (next_pc.is_nihilism != current_pc.is_nihilism) + json_write_bool("nihilism", next_pc.is_nihilism); + if (next_pc.halo != current_pc.halo) json_write_int("halo", next_pc.halo); diff --git a/crawl-ref/source/transform.cc b/crawl-ref/source/transform.cc index aeb15dc..2b37b91 100644 --- a/crawl-ref/source/transform.cc +++ b/crawl-ref/source/transform.cc @@ -1037,8 +1037,12 @@ bool transform(int pow, transformation_type which_trans, bool force, break; case TRAN_TREE: - if (you.religion == GOD_FEDHAS && !player_under_penance()) + if (you.religion == GOD_FEDHAS + && !player_under_penance() + && !you.nihilist()) + { simple_god_message(" makes you hardy against extreme temperatures."); + } // ignore hunger_state (but don't reset hunger) you.hunger_state = HS_SATIATED; set_redraw_status(REDRAW_HUNGER); diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc index 521e37a..c892b2e 100644 --- a/crawl-ref/source/view.cc +++ b/crawl-ref/source/view.cc @@ -145,7 +145,6 @@ void seen_monsters_react() good_god_follower_attitude_change(*mi); beogh_follower_convert(*mi); - slime_convert(*mi); // XXX: Hack for triggering Duvessa's going berserk. if (mi->props.exists("duvessa_berserk")) -- 1.8.2.3 |
||||||||||||
|
Mantis 1.1.8[^] Copyright © 2000 - 2009 Mantis Group |