diff options
Diffstat (limited to 'crawl-ref/source')
-rw-r--r-- | crawl-ref/source/enum.h | 3 | ||||
-rw-r--r-- | crawl-ref/source/fight.cc | 138 | ||||
-rw-r--r-- | crawl-ref/source/fight.h | 3 | ||||
-rw-r--r-- | crawl-ref/source/hiscores.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/mon-data.h | 2 | ||||
-rw-r--r-- | crawl-ref/source/religion.cc | 99 |
6 files changed, 146 insertions, 101 deletions
diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h index cfc2fbadad..624732ff40 100644 --- a/crawl-ref/source/enum.h +++ b/crawl-ref/source/enum.h @@ -2288,7 +2288,8 @@ enum mon_attack_flavour AF_POISON_STR, AF_ROT, AF_VAMPIRIC, - AF_KLOWN + AF_KLOWN, + AF_DISTORT }; enum mon_attitude_type diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index c2664ce6ba..ca1d3df729 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -1493,6 +1493,76 @@ void melee_attack::drain_monster() attacker->god_conduct(DID_NECROMANCY, 2); } +bool melee_attack::distortion_affects_defender() +{ + //jmf: blink frogs *like* distortion + // I think could be amended to let blink frogs "grow" like + // jellies do {dlb} + if (defender->id() == MONS_BLINK_FROG) + { + if (one_chance_in(5)) + { + emit_nodmg_hit_message(); + special_damage_message = + make_stringf("%s %s in the translocular energy.", + defender->name(DESC_CAP_THE).c_str(), + defender->conj_verb("bask").c_str()); + + defender->heal(1 + random2avg(7, 2), true); // heh heh + } + return (false); + } + + if (one_chance_in(3)) + { + special_damage_message = + make_stringf( + "Space bends around %s.", + defender->name(DESC_NOCAP_THE).c_str()); + special_damage += 1 + random2avg(7, 2); + return (false); + } + + if (one_chance_in(3)) + { + special_damage_message = + make_stringf( + "Space warps horribly around %s!", + defender->name(DESC_NOCAP_THE).c_str()); + + special_damage += 3 + random2avg(24, 2); + return (false); + } + + if (one_chance_in(3)) + { + emit_nodmg_hit_message(); + defender->blink(); + return (false); + } + + // Used to be coinflip() || coinflip() for players, just coinflip() + // for monsters; this is a compromise. Note that it makes banishment + // a touch more likely for players, and a shade less likely for + // monsters. + if (!one_chance_in(3)) + { + emit_nodmg_hit_message(); + defender->teleport(coinflip(), one_chance_in(5)); + return (false); + } + + if (you.level_type != LEVEL_ABYSS && coinflip()) + { + emit_nodmg_hit_message(); + defender->banish( atk? atk->name(DESC_PLAIN, true) + : attacker->name(DESC_PLAIN) ); + return (true); + } + + return (false); +} + bool melee_attack::apply_damage_brand() { // Monster resistance to the brand. @@ -1665,70 +1735,8 @@ bool melee_attack::apply_damage_brand() break; case SPWPN_DISTORTION: - //jmf: blink frogs *like* distortion - // I think could be amended to let blink frogs "grow" like - // jellies do {dlb} - if (defender->id() == MONS_BLINK_FROG) - { - if (one_chance_in(5)) - { - emit_nodmg_hit_message(); - special_damage_message = - make_stringf("%s %s in the translocular energy.", - defender->name(DESC_CAP_THE).c_str(), - defender->conj_verb("bask").c_str()); - - defender->heal(1 + random2avg(7, 2), true); // heh heh - } - break; - } - - if (one_chance_in(3)) - { - special_damage_message = - make_stringf( - "Space bends around %s.", - defender->name(DESC_NOCAP_THE).c_str()); - special_damage += 1 + random2avg(7, 2); - break; - } - - if (one_chance_in(3)) - { - special_damage_message = - make_stringf( - "Space warps horribly around %s!", - defender->name(DESC_NOCAP_THE).c_str()); - - special_damage += 3 + random2avg(24, 2); - break; - } - - if (one_chance_in(3)) - { - emit_nodmg_hit_message(); - defender->blink(); - break; - } - - // Used to be coinflip() || coinflip() for players, just coinflip() - // for monsters; this is a compromise. Note that it makes banishment - // a touch more likely for players, and a shade less likely for - // monsters. - if (!one_chance_in(3)) - { - emit_nodmg_hit_message(); - defender->teleport(coinflip(), one_chance_in(5)); - break; - } - - if (you.level_type != LEVEL_ABYSS && coinflip()) - { - emit_nodmg_hit_message(); - defender->banish( atk? atk->name(DESC_PLAIN, true) - : attacker->name(DESC_PLAIN) ); + if (distortion_affects_defender()) return (true); - } break; case SPWPN_CONFUSE: @@ -2865,6 +2873,10 @@ void melee_attack::mons_apply_attack_flavour(const mon_attack_def &attk) defender->poison( attacker, 2 + random2(4) ); splash_defender_with_acid(3); break; + + case AF_DISTORT: + distortion_affects_defender(); + break; } } diff --git a/crawl-ref/source/fight.h b/crawl-ref/source/fight.h index ed22a29180..48eb893dc1 100644 --- a/crawl-ref/source/fight.h +++ b/crawl-ref/source/fight.h @@ -150,6 +150,9 @@ private: void splash_defender_with_acid(int strength); void splash_monster_with_acid(int strength); + // Returns true if the defender is banished. + bool distortion_affects_defender(); + private: // Monster-attack specific stuff bool mons_attack_you(); diff --git a/crawl-ref/source/hiscores.cc b/crawl-ref/source/hiscores.cc index bd90c4204c..0efa5f171d 100644 --- a/crawl-ref/source/hiscores.cc +++ b/crawl-ref/source/hiscores.cc @@ -513,7 +513,7 @@ static const char *kill_method_names[] = "mon", "pois", "cloud", "beam", "deaths_door", "lava", "water", "stupidity", "weakness", "clumsiness", "trap", "leaving", "winning", "quitting", "draining", "starvation", "freezing", "burning", "wild_magic", - "xom", "statue", "rotting", "targetting", "spore", "tso_smiting", + "xom", "statue", "rotting", "targeting", "spore", "tso_smiting", "petrification", "unknown", "something", "falling_down_stairs", "acid", "curare", "melting", "bleeding", }; diff --git a/crawl-ref/source/mon-data.h b/crawl-ref/source/mon-data.h index 25643ffb05..31214f6f44 100644 --- a/crawl-ref/source/mon-data.h +++ b/crawl-ref/source/mon-data.h @@ -2565,7 +2565,7 @@ M_LEVITATE | M_CONFUSED, MR_RES_POISON | MR_RES_FIRE | MR_RES_COLD | MR_RES_ELEC, 0, 5, MONS_FIRE_VORTEX, MONS_SPATIAL_VORTEX, MH_NONLIVING, MAG_IMMUNE, - { {AT_HIT, AF_PLAIN, 50}, {AT_NONE, AF_PLAIN, 0}, {AT_NONE, AF_PLAIN, 0}, {AT_NONE, AF_PLAIN, 0} }, + { {AT_HIT, AF_DISTORT, 30}, {AT_NONE, AF_PLAIN, 0}, {AT_NONE, AF_PLAIN, 0}, {AT_NONE, AF_PLAIN, 0} }, { 6, 6, 6, 0 }, 0, 5, 15, 7, MST_NO_SPELLS, CE_NOCORPSE, Z_NOZOMBIE, S_SILENT, I_PLANT, MONUSE_NOTHING, SIZE_LARGE diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index 97eb0b3d41..0556b26ad1 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -1670,7 +1670,10 @@ void gain_piety(char pgn) // naturally slower as the player gains in spell skills. if ((you.piety > 199) || (you.piety > 150 && one_chance_in(5))) + { + do_god_gift(); return; + } } int old_piety = you.piety; @@ -1749,6 +1752,63 @@ void lose_piety(char pgn) } } +static void lugonu_retribution(int god) +{ + if (coinflip()) + { + simple_god_message("'s wrath finds you!", god); + miscast_effect( SPTYP_TRANSLOCATION, 9, 90, 100, "Lugonu's touch" ); + + // No return - Lugonu's touch is independent of other effects. + } + else if (coinflip()) + { + // Give extra opportunities for embarrassing teleports. + simple_god_message("'s wrath finds you!", god); + mpr("Space warps around you!"); + if (!one_chance_in(3)) + you_teleport2(false); + else + random_blink(false); + + // No return. + } + + // abyssal servant theme + if (random2(you.experience_level) > 7 && !one_chance_in(5)) + { + if (create_monster(MONS_GREEN_DEATH + random2(3), 0, + BEH_HOSTILE, you.x_pos, you.y_pos, + MHITYOU, 250) != -1) + { + simple_god_message(" sends a demon after you!", god); + } + else + { + simple_god_message("'s demon is unavoidably detained.", god); + } + } + else + { + bool success = false; + int how_many = 1 + (you.experience_level / 7); + + for (int loopy = 0; loopy < how_many; loopy++) + { + if (create_monster(MONS_NEQOXEC + random2(5), 0, BEH_HOSTILE, + you.x_pos, you.y_pos, MHITYOU, 250) != -1) + { + success = true; + } + } + + if (success) + simple_god_message(" sends minions to punish you.", god); + else + simple_god_message("'s minions fail to arrive.", god); + } +} + void divine_retribution( int god ) { ASSERT(god != GOD_NO_GOD); @@ -2210,39 +2270,7 @@ void divine_retribution( int god ) break; case GOD_LUGONU: - // abyssal servant theme - if (random2(you.experience_level) > 7 && !one_chance_in(5)) - { - if (create_monster(MONS_GREEN_DEATH + random2(3), 0, - BEH_HOSTILE, you.x_pos, you.y_pos, - MHITYOU, 250) != -1) - { - simple_god_message(" sends a demon after you!", god); - } - else - { - simple_god_message("'s demon is unavoidably detained.", god); - } - } - else - { - success = false; - how_many = 1 + (you.experience_level / 7); - - for (loopy = 0; loopy < how_many; loopy++) - { - if (create_monster(MONS_NEQOXEC + random2(5), 0, BEH_HOSTILE, - you.x_pos, you.y_pos, MHITYOU, 250) != -1) - { - success = true; - } - } - - if (success) - simple_god_message(" sends minions to punish you.", god); - else - simple_god_message("'s minions fail to arrive.", god); - } + lugonu_retribution(god); break; case GOD_ELYVILON: // Elyvilon doesn't seek revenge @@ -2253,7 +2281,8 @@ void divine_retribution( int god ) // Sometimes divine experiences are overwhelming... if (one_chance_in(5) && you.experience_level < random2(37)) { - if (coinflip()) { + if (coinflip()) + { mpr( "The divine experience confuses you!", MSGCH_WARN); confuse_player( 3 + random2(10) ); } @@ -2342,7 +2371,7 @@ void excommunication(void) if ( you.level_type == LEVEL_DUNGEON ) { simple_god_message(" casts you back into the Abyss!", old_god); - banished(DNGN_ENTER_ABYSS); + banished(DNGN_ENTER_ABYSS, "Lugonu's wrath"); } inc_penance(old_god, 50); break; |