diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-11-24 21:43:51 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-11-24 21:43:51 +0000 |
commit | 1c5dd2f5fa1e94a5f6017f391e4b1d192b7d706c (patch) | |
tree | be0c9c397bb4428abc4aa148c687db16d14d8b5b | |
parent | 0e3ada71c222f6905af710f63177bbee83bd409b (diff) | |
download | crawl-ref-1c5dd2f5fa1e94a5f6017f391e4b1d192b7d706c.tar.gz crawl-ref-1c5dd2f5fa1e94a5f6017f391e4b1d192b7d706c.zip |
Clean up ability handling to display costs for prayer-activated
abilities (Zin's sustenance and Yred's injury mirror) in a less hackish
way.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7593 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r-- | crawl-ref/source/abl-show.cc | 102 | ||||
-rw-r--r-- | crawl-ref/source/abl-show.h | 2 | ||||
-rw-r--r-- | crawl-ref/source/describe.cc | 74 | ||||
-rw-r--r-- | crawl-ref/source/enum.h | 28 | ||||
-rw-r--r-- | crawl-ref/source/religion.cc | 14 | ||||
-rw-r--r-- | crawl-ref/source/religion.h | 2 |
6 files changed, 124 insertions, 98 deletions
diff --git a/crawl-ref/source/abl-show.cc b/crawl-ref/source/abl-show.cc index 5327b69350..4be1d186dc 100644 --- a/crawl-ref/source/abl-show.cc +++ b/crawl-ref/source/abl-show.cc @@ -68,11 +68,12 @@ enum ability_flag_type ABFLAG_BREATH = 0x00000001, // ability uses DUR_BREATH_WEAPON ABFLAG_DELAY = 0x00000002, // ability has its own delay (ie recite) ABFLAG_PAIN = 0x00000004, // ability must hurt player (ie torment) - ABFLAG_EXHAUSTION = 0x00000008, // fails if you.exhausted - ABFLAG_INSTANT = 0x00000010, // doesn't take time to use - ABFLAG_PERMANENT_HP = 0x00000020, // costs permanent HPs - ABFLAG_PERMANENT_MP = 0x00000040, // costs permanent MPs - ABFLAG_CONF_OK = 0x00000080 // can use even if confused + ABFLAG_PIETY = 0x00000008, // ability has its own piety cost + ABFLAG_EXHAUSTION = 0x00000010, // fails if you.exhausted + ABFLAG_INSTANT = 0x00000020, // doesn't take time to use + ABFLAG_PERMANENT_HP = 0x00000040, // costs permanent HPs + ABFLAG_PERMANENT_MP = 0x00000080, // costs permanent MPs + ABFLAG_CONF_OK = 0x00000100 // can use even if confused }; static void _lugonu_bends_space(); @@ -95,8 +96,8 @@ static std::string _describe_talent(const talent& tal); ability_type god_abilities[MAX_NUM_GODS][MAX_GOD_ABILITIES] = { // no god - { ABIL_NON_ABILITY, ABIL_NON_ABILITY, ABIL_NON_ABILITY, - ABIL_NON_ABILITY, ABIL_NON_ABILITY }, + { ABIL_NON_ABILITY, ABIL_NON_ABILITY, ABIL_NON_ABILITY, ABIL_NON_ABILITY, + ABIL_NON_ABILITY }, // Zin { ABIL_ZIN_RECITE, ABIL_ZIN_VITALISATION, ABIL_NON_ABILITY, ABIL_NON_ABILITY, ABIL_ZIN_SANCTUARY }, @@ -105,49 +106,42 @@ ability_type god_abilities[MAX_NUM_GODS][MAX_GOD_ABILITIES] = ABIL_TSO_CLEANSING_FLAME, ABIL_TSO_SUMMON_DIVINE_WARRIOR }, // Kikubaaqudgha { ABIL_KIKU_RECALL_UNDEAD_SLAVES, ABIL_NON_ABILITY, - ABIL_KIKU_ENSLAVE_UNDEAD, ABIL_NON_ABILITY, - ABIL_KIKU_INVOKE_DEATH }, + ABIL_KIKU_ENSLAVE_UNDEAD, ABIL_NON_ABILITY, ABIL_KIKU_INVOKE_DEATH }, // Yredelemnul { ABIL_YRED_ANIMATE_REMAINS, ABIL_YRED_RECALL_UNDEAD, - ABIL_YRED_ANIMATE_DEAD, ABIL_YRED_DRAIN_LIFE, - ABIL_YRED_ENSLAVE_SOUL }, + ABIL_YRED_ANIMATE_DEAD, ABIL_YRED_DRAIN_LIFE, ABIL_YRED_ENSLAVE_SOUL }, // Xom - { ABIL_NON_ABILITY, ABIL_NON_ABILITY, ABIL_NON_ABILITY, - ABIL_NON_ABILITY, ABIL_NON_ABILITY }, + { ABIL_NON_ABILITY, ABIL_NON_ABILITY, ABIL_NON_ABILITY, ABIL_NON_ABILITY, + ABIL_NON_ABILITY }, // Vehumet - { ABIL_NON_ABILITY, ABIL_NON_ABILITY, ABIL_NON_ABILITY, - ABIL_NON_ABILITY, ABIL_NON_ABILITY }, + { ABIL_NON_ABILITY, ABIL_NON_ABILITY, ABIL_NON_ABILITY, ABIL_NON_ABILITY, + ABIL_NON_ABILITY }, // Okawaru - { ABIL_OKAWARU_MIGHT, ABIL_NON_ABILITY, ABIL_NON_ABILITY, - ABIL_NON_ABILITY, ABIL_OKAWARU_HASTE }, + { ABIL_OKAWARU_MIGHT, ABIL_NON_ABILITY, ABIL_NON_ABILITY, ABIL_NON_ABILITY, + ABIL_OKAWARU_HASTE }, // Makhleb { ABIL_NON_ABILITY, ABIL_MAKHLEB_MINOR_DESTRUCTION, - ABIL_MAKHLEB_LESSER_SERVANT_OF_MAKHLEB, - ABIL_MAKHLEB_MAJOR_DESTRUCTION, + ABIL_MAKHLEB_LESSER_SERVANT_OF_MAKHLEB, ABIL_MAKHLEB_MAJOR_DESTRUCTION, ABIL_MAKHLEB_GREATER_SERVANT_OF_MAKHLEB }, // Sif Muna - { ABIL_SIF_MUNA_CHANNEL_ENERGY, - ABIL_SIF_MUNA_FORGET_SPELL, ABIL_NON_ABILITY, - ABIL_NON_ABILITY, ABIL_NON_ABILITY }, + { ABIL_SIF_MUNA_CHANNEL_ENERGY, ABIL_SIF_MUNA_FORGET_SPELL, + ABIL_NON_ABILITY, ABIL_NON_ABILITY, ABIL_NON_ABILITY }, // Trog { ABIL_TROG_BERSERK, ABIL_TROG_REGENERATION, ABIL_NON_ABILITY, ABIL_TROG_BROTHERS_IN_ARMS, ABIL_NON_ABILITY }, // Nemelex - { ABIL_NEMELEX_DRAW_ONE, ABIL_NEMELEX_PEEK_TWO, - ABIL_NEMELEX_TRIPLE_DRAW, ABIL_NEMELEX_MARK_FOUR, - ABIL_NEMELEX_STACK_FIVE }, + { ABIL_NEMELEX_DRAW_ONE, ABIL_NEMELEX_PEEK_TWO, ABIL_NEMELEX_TRIPLE_DRAW, + ABIL_NEMELEX_MARK_FOUR, ABIL_NEMELEX_STACK_FIVE }, // Elyvilon { ABIL_ELYVILON_LESSER_HEALING, ABIL_ELYVILON_PURIFICATION, ABIL_ELYVILON_GREATER_HEALING, ABIL_ELYVILON_RESTORATION, ABIL_ELYVILON_DIVINE_VIGOUR }, // Lugonu - { ABIL_LUGONU_ABYSS_EXIT, ABIL_LUGONU_BEND_SPACE, - ABIL_LUGONU_BANISH, ABIL_LUGONU_CORRUPT, - ABIL_LUGONU_ABYSS_ENTER }, + { ABIL_LUGONU_ABYSS_EXIT, ABIL_LUGONU_BEND_SPACE, ABIL_LUGONU_BANISH, + ABIL_LUGONU_CORRUPT, ABIL_LUGONU_ABYSS_ENTER }, // Beogh - { ABIL_NON_ABILITY, ABIL_BEOGH_SMITING, - ABIL_NON_ABILITY, ABIL_BEOGH_RECALL_ORCISH_FOLLOWERS, - ABIL_NON_ABILITY } + { ABIL_NON_ABILITY, ABIL_BEOGH_SMITING, ABIL_NON_ABILITY, + ABIL_BEOGH_RECALL_ORCISH_FOLLOWERS, ABIL_NON_ABILITY } }; // The description screen was way out of date with the actual costs. @@ -219,6 +213,7 @@ static const ability_def Ability_List[] = // INVOCATIONS: // Zin + { ABIL_ZIN_SUSTENANCE, "Sustenance", 0, 0, 0, 0, ABFLAG_PIETY }, { ABIL_ZIN_RECITE, "Recite", 3, 0, 120, 0, ABFLAG_DELAY }, { ABIL_ZIN_VITALISATION, "Vitalisation", 0, 0, 100, 2, ABFLAG_CONF_OK }, { ABIL_ZIN_SANCTUARY, "Sanctuary", 7, 0, 150, 15, ABFLAG_NONE }, @@ -234,6 +229,7 @@ static const ability_def Ability_List[] = { ABIL_KIKU_INVOKE_DEATH, "Invoke Death", 4, 0, 250, 3, ABFLAG_NONE }, // Yredelemnul + { ABIL_YRED_INJURY_MIRROR, "Injury Mirror", 0, 0, 0, 0, ABFLAG_PIETY }, { ABIL_YRED_ANIMATE_REMAINS, "Animate Remains", 1, 0, 100, 0, ABFLAG_NONE }, { ABIL_YRED_RECALL_UNDEAD, "Recall Undead Slaves", 2, 0, 50, 0, ABFLAG_NONE }, { ABIL_YRED_ANIMATE_DEAD, "Animate Dead", 3, 0, 100, 1, ABFLAG_NONE }, @@ -256,7 +252,7 @@ static const ability_def Ability_List[] = { ABIL_SIF_MUNA_FORGET_SPELL, "Forget Spell", 5, 0, 0, 8, ABFLAG_NONE }, // Trog - { ABIL_TROG_BURN_BOOKS, "Burn Books", 0, 0, 10, 0, ABFLAG_NONE }, + { ABIL_TROG_BURN_SPELLBOOKS, "Burn Spellbooks", 0, 0, 10, 0, ABFLAG_NONE }, { ABIL_TROG_BERSERK, "Berserk", 0, 0, 200, 0, ABFLAG_NONE }, { ABIL_TROG_REGENERATION, "Trog's Hand", 0, 0, 50, 1, ABFLAG_NONE }, { ABIL_TROG_BROTHERS_IN_ARMS, "Brothers in Arms", @@ -341,7 +337,7 @@ std::string print_abilities() return text; } -const std::string make_cost_description( ability_type ability ) +const std::string make_cost_description(ability_type ability) { const ability_def& abil = get_ability_def(ability); std::ostringstream ret; @@ -405,6 +401,14 @@ const std::string make_cost_description( ability_type ability ) ret << "Pain"; } + if (abil.flags & ABFLAG_PIETY) + { + if (!ret.str().empty()) + ret << ", "; + + ret << "Piety"; + } + if (abil.flags & ABFLAG_EXHAUSTION) { if (!ret.str().empty()) @@ -633,7 +637,7 @@ static talent _get_talent(ability_type ability, bool check_confused) failure = 0; break; - case ABIL_TROG_BURN_BOOKS: + case ABIL_TROG_BURN_SPELLBOOKS: invoc = true; failure = 0; break; @@ -1419,6 +1423,10 @@ static bool _do_ability(const ability_def& abil) // INVOCATIONS: + case ABIL_ZIN_SUSTENANCE: + // Activated via prayer elsewhere. + break; + case ABIL_ZIN_RECITE: { int result = check_recital_audience(); @@ -1501,6 +1509,10 @@ static bool _do_ability(const ability_def& abil) exercise(SK_INVOCATIONS, 10 + random2(14)); break; + case ABIL_YRED_INJURY_MIRROR: + // Activated via prayer elsewhere. + break; + case ABIL_YRED_ANIMATE_REMAINS: mpr("You call on the dead to walk for you..."); animate_remains(you.pos(), CORPSE_BODY, BEH_FRIENDLY, you.pet_target, @@ -1647,8 +1659,8 @@ static bool _do_ability(const ability_def& abil) exercise(SK_INVOCATIONS, 6 + random2(6)); break; - case ABIL_TROG_BURN_BOOKS: - if (!trog_burn_books()) + case ABIL_TROG_BURN_SPELLBOOKS: + if (!trog_burn_spellbooks()) return (false); break; @@ -1900,15 +1912,14 @@ static bool _do_ability(const ability_def& abil) excommunication(); } else - { canned_msg(MSG_OK); - } break; case ABIL_NON_ABILITY: mpr("Sorry, you can't do that."); break; } + return (true); } @@ -2152,7 +2163,7 @@ std::vector<talent> your_talents( bool check_confused ) if (you.religion == GOD_ELYVILON) _add_talent(talents, ABIL_ELYVILON_DESTROY_WEAPONS, check_confused ); else if (you.religion == GOD_TROG) - _add_talent(talents, ABIL_TROG_BURN_BOOKS, check_confused ); + _add_talent(talents, ABIL_TROG_BURN_SPELLBOOKS, check_confused ); // Gods take abilities away until penance completed. -- bwr // God abilities generally don't work while silenced (they require @@ -2298,7 +2309,7 @@ static void _set_god_ability_helper( ability_type abil, char letter ) } // Return GOD_NO_GOD if it isn't a god ability, otherwise return -// the index of the god.. +// the index of the god. static int _is_god_ability(int abil) { if (abil == ABIL_NON_ABILITY) @@ -2308,19 +2319,19 @@ static int _is_god_ability(int abil) for (int j = 0; j < MAX_GOD_ABILITIES; ++j) { if (god_abilities[i][j] == abil) - return i; + return (i); } - return GOD_NO_GOD; + return (GOD_NO_GOD); } -void set_god_ability_slots( void ) +void set_god_ability_slots(void) { - ASSERT( you.religion != GOD_NO_GOD ); + ASSERT(you.religion != GOD_NO_GOD); int i; - _set_god_ability_helper( ABIL_RENOUNCE_RELIGION, 'X' ); + _set_god_ability_helper(ABIL_RENOUNCE_RELIGION, 'X'); // Clear out other god invocations. for (i = 0; i < 52; i++) @@ -2342,7 +2353,6 @@ void set_god_ability_slots( void ) } } - // Returns an index (0-51) if successful, -1 if you should // just use the next one. static int _find_ability_slot( ability_type which_ability ) diff --git a/crawl-ref/source/abl-show.h b/crawl-ref/source/abl-show.h index 84aab23d3c..e3d2610e4a 100644 --- a/crawl-ref/source/abl-show.h +++ b/crawl-ref/source/abl-show.h @@ -64,7 +64,7 @@ struct talent const struct ability_def & get_ability_def( ability_type abil ); const char* ability_name(ability_type ability); -const std::string make_cost_description( ability_type ability ); +const std::string make_cost_description(ability_type ability); std::vector<const char*> get_ability_names(); int choose_ability_menu(const std::vector<talent>& talents, bool describe = false); diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc index 5805aa6113..3340fbeaf3 100644 --- a/crawl-ref/source/describe.cc +++ b/crawl-ref/source/describe.cc @@ -365,7 +365,7 @@ static std::vector<std::string> _randart_propnames( const item_def& item ) } std::ostringstream work; - switch ( propanns[i].spell_out ) + switch (propanns[i].spell_out) { case 0: // e.g. AC+4 work << std::showpos << propanns[i].name << val; @@ -2640,7 +2640,25 @@ std::string get_ghost_description(const monsters &mons, bool concise) extern ability_type god_abilities[MAX_NUM_GODS][MAX_GOD_ABILITIES]; -static bool _print_god_abil_desc( int god, int numpower ) +static bool _print_final_god_abil_desc(int god, const std::string &final_msg, + const ability_type abil) +{ + // If no message or ability then no power. + if (!final_msg[0] || abil == ABIL_NON_ABILITY) + return (false); + + std::ostringstream buf; + buf << final_msg; + const int spacesleft = 79 - buf.str().length(); + const std::string cost = "(" + make_cost_description(abil) + ")"; + buf << std::setw(spacesleft) << cost; + + cprintf("%s\n", buf.str().c_str()); + + return (true); +} + +static bool _print_god_abil_desc(int god, int numpower) { const char* pmsg = god_gain_power_messages[god][numpower]; @@ -2648,24 +2666,20 @@ static bool _print_god_abil_desc( int god, int numpower ) if (!pmsg[0]) return (false); - std::ostringstream buf; - + std::string buf; if (isupper(pmsg[0])) - buf << pmsg; // Complete sentence given. + buf = pmsg; // Complete sentence given. else - buf << "You can " << pmsg << "."; + { + buf = "You can "; + buf += pmsg; + buf += "."; + } // This might be ABIL_NON_ABILITY for passive abilities. const ability_type abil = god_abilities[god][numpower]; + _print_final_god_abil_desc(god, buf, abil); - if (abil != ABIL_NON_ABILITY) - { - const int spacesleft = 79 - buf.str().length(); - const std::string cost = "(" + make_cost_description(abil) + ")"; - buf << std::setw(spacesleft) << cost; - } - - cprintf( "%s\n", buf.str().c_str() ); return (true); } @@ -3105,8 +3119,11 @@ void describe_god( god_type which_god, bool give_title ) if (zin_sustenance(false)) { have_any = true; - cprintf("Praying to %s will provide sustenance if starving." - EOL, god_name(which_god).c_str()); + std::string buf = "Praying to "; + buf += god_name(which_god); + buf += " will provide sustenance if starving."; + _print_final_god_abil_desc(which_god, buf, + ABIL_ZIN_SUSTENANCE); } const char *how = (you.piety >= 150) ? "carefully" : // res mut. 3 (you.piety >= 100) ? "often" : @@ -3130,30 +3147,27 @@ void describe_god( god_type which_god, bool give_title ) else if (which_god == GOD_TROG) { have_any = true; - // XXX Mega-hack. Duplicates code in _print_god_abil_desc(). - // FIXME. - std::ostringstream buf; - buf << "You can call upon " << god_name(which_god) - << " to burn books in your surroundings."; - const int spacesleft = 79 - buf.str().length(); - const std::string cost = "(" + make_cost_description( - ABIL_TROG_BURN_BOOKS) + ")"; - buf << std::setw(spacesleft) << cost; - cprintf("%s" EOL, buf.str().c_str()); + std::string buf = "You can call upon "; + buf += god_name(which_god); + buf += " to burn spellbooks in your surroundings."; + _print_final_god_abil_desc(which_god, buf, + ABIL_TROG_BURN_SPELLBOOKS); } else if (which_god == GOD_ELYVILON) { have_any = true; - cprintf("You can call upon %s to destroy weapons " - "lying on the ground." EOL, god_name(which_god).c_str()); + cprintf("You can call upon %s to destroy weapons lying on the " + "ground." EOL, god_name(which_god).c_str()); } else if (which_god == GOD_YREDELEMNUL) { if (yred_injury_mirror(false)) { have_any = true; - cprintf("%s mirrors your injuries on your foes " - "during prayer." EOL, god_name(which_god).c_str()); + std::string buf = god_name(which_god); + buf += " mirrors your injuries on your foes during prayer."; + _print_final_god_abil_desc(which_god, buf, + ABIL_YRED_INJURY_MIRROR); } } diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h index c8d8a95ba4..2d1d42a688 100644 --- a/crawl-ref/source/enum.h +++ b/crawl-ref/source/enum.h @@ -53,40 +53,42 @@ enum ability_type ABIL_END_TRANSFORMATION, // 55 // Divine abilities - ABIL_ZIN_RECITE = 110, // 110 + ABIL_ZIN_SUSTENANCE = 109, // 109 + ABIL_ZIN_RECITE, ABIL_ZIN_VITALISATION, ABIL_ZIN_SANCTUARY, ABIL_TSO_DIVINE_SHIELD = 120, // 120 ABIL_TSO_CLEANSING_FLAME, - ABIL_TSO_SUMMON_DIVINE_WARRIOR, // 122 + ABIL_TSO_SUMMON_DIVINE_WARRIOR, ABIL_KIKU_RECALL_UNDEAD_SLAVES = 130, // 130 - ABIL_KIKU_ENSLAVE_UNDEAD = 132, // 132 - ABIL_KIKU_INVOKE_DEATH, // 133 - ABIL_YRED_ANIMATE_REMAINS = 140, // 140 + ABIL_KIKU_ENSLAVE_UNDEAD = 132, + ABIL_KIKU_INVOKE_DEATH, + ABIL_YRED_INJURY_MIRROR = 139, + ABIL_YRED_ANIMATE_REMAINS, // 140 ABIL_YRED_RECALL_UNDEAD, ABIL_YRED_ANIMATE_DEAD, ABIL_YRED_DRAIN_LIFE, - ABIL_YRED_ENSLAVE_SOUL, // 144 + ABIL_YRED_ENSLAVE_SOUL, // 160 - reserved for Vehumet ABIL_OKAWARU_MIGHT = 170, // 170 // Okawaru no longer heals (JPEG) - ABIL_OKAWARU_HASTE = 172, // 172 + ABIL_OKAWARU_HASTE = 172, ABIL_MAKHLEB_MINOR_DESTRUCTION = 180, // 180 ABIL_MAKHLEB_LESSER_SERVANT_OF_MAKHLEB, ABIL_MAKHLEB_MAJOR_DESTRUCTION, - ABIL_MAKHLEB_GREATER_SERVANT_OF_MAKHLEB,// 183 + ABIL_MAKHLEB_GREATER_SERVANT_OF_MAKHLEB, ABIL_SIF_MUNA_CHANNEL_ENERGY = 190, // 190 ABIL_SIF_MUNA_FORGET_SPELL, - ABIL_TROG_BURN_BOOKS = 199, + ABIL_TROG_BURN_SPELLBOOKS = 199, ABIL_TROG_BERSERK = 200, // 200 ABIL_TROG_REGENERATION, - ABIL_TROG_BROTHERS_IN_ARMS, // 202 + ABIL_TROG_BROTHERS_IN_ARMS, ABIL_ELYVILON_DESTROY_WEAPONS = 219, ABIL_ELYVILON_LESSER_HEALING = 220, // 220 ABIL_ELYVILON_PURIFICATION, ABIL_ELYVILON_GREATER_HEALING, ABIL_ELYVILON_RESTORATION, - ABIL_ELYVILON_DIVINE_VIGOUR, // 224 + ABIL_ELYVILON_DIVINE_VIGOUR, ABIL_LUGONU_ABYSS_EXIT, // 225 ABIL_LUGONU_BEND_SPACE, ABIL_LUGONU_BANISH, @@ -100,12 +102,12 @@ enum ability_type ABIL_BEOGH_SMITING, // 235 ABIL_BEOGH_RECALL_ORCISH_FOLLOWERS, - ABIL_CHARM_SNAKE, // 237 + ABIL_CHARM_SNAKE, // 237 ABIL_TRAN_SERPENT_OF_HELL, ABIL_ROTTING, ABIL_TORMENT_II, ABIL_TRAN_BAT, - ABIL_RENOUNCE_RELIGION = 250 // 250 + ABIL_RENOUNCE_RELIGION = 250 // 250 }; enum activity_interrupt_type diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index c77c50abb9..49f9f8b5a3 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -3474,7 +3474,7 @@ bool ely_destroy_weapons() GOD_ELYVILON); } - destroy_item( si.link() ); + destroy_item(si.link()); success = true; } @@ -3484,8 +3484,8 @@ bool ely_destroy_weapons() return (success); } -// Returns false if the invocation fails (no books in sight etc.). -bool trog_burn_books() +// Returns false if the invocation fails (no spellbooks in sight, etc.). +bool trog_burn_spellbooks() { if (you.religion != GOD_TROG) return (false); @@ -3534,7 +3534,7 @@ bool trog_burn_books() continue; } - rarity += book_rarity( si->sub_type ); + rarity += book_rarity(si->sub_type); // Piety increases by 2 for books never cracked open, else 1. // Conversely, rarity influences the duration of the pyre. if (!item_type_known(*si)) @@ -3554,8 +3554,8 @@ bool trog_burn_books() if (cloud != EMPTY_CLOUD) { // Reinforce the cloud. - mpr( "The fire roars with new energy!" ); - const int extra_dur = count + random2(rarity/2); + mpr("The fire roars with new energy!"); + const int extra_dur = count + random2(rarity / 2); env.cloud[cloud].decay += extra_dur * 5; env.cloud[cloud].set_whose(KC_YOU); continue; @@ -3566,7 +3566,7 @@ bool trog_burn_books() if (durat > 23) durat = 23; - place_cloud( CLOUD_FIRE, *ri, durat, KC_YOU ); + place_cloud(CLOUD_FIRE, *ri, durat, KC_YOU); mpr(count == 1 ? "The book bursts into flames." : "The books burst into flames.", MSGCH_GOD); diff --git a/crawl-ref/source/religion.h b/crawl-ref/source/religion.h index 25cdf3103f..dd72be5c46 100644 --- a/crawl-ref/source/religion.h +++ b/crawl-ref/source/religion.h @@ -107,8 +107,8 @@ bool is_holy_item(const item_def& item); bool is_evil_item(const item_def& item); bool good_god_dislikes_item_handling(const item_def &item); bool god_dislikes_item_handling(const item_def &item); +bool trog_burn_spellbooks(); bool ely_destroy_weapons(); -bool trog_burn_books(); bool tso_unchivalric_attack_safe_monster(const monsters *mon); void mons_make_god_gift(monsters *mon, god_type god = you.religion); |