From 09368bdee93d7cfeef2f2f6483a3d301239a6bff Mon Sep 17 00:00:00 2001 From: dshaligram Date: Mon, 19 Mar 2007 16:27:53 +0000 Subject: Added an invocable power to train Invocations for Lugonu (previously the first power that could train Invocations was the 7mp demon summon). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1061 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/abl-show.cc | 63 +++++++++++++++++++++++++++++++++++++++++++- crawl-ref/source/enum.h | 1 + crawl-ref/source/religion.cc | 4 +-- crawl-ref/source/spells1.cc | 5 ++-- crawl-ref/source/spells1.h | 2 +- 5 files changed, 69 insertions(+), 6 deletions(-) diff --git a/crawl-ref/source/abl-show.cc b/crawl-ref/source/abl-show.cc index 0b0bb889a6..90c9dead7a 100644 --- a/crawl-ref/source/abl-show.cc +++ b/crawl-ref/source/abl-show.cc @@ -41,8 +41,11 @@ #include "macro.h" #include "message.h" #include "misc.h" +#include "mon-util.h" #include "monplace.h" +#include "monstuff.h" #include "notes.h" +#include "ouch.h" #include "player.h" #include "religion.h" #include "skills.h" @@ -80,6 +83,7 @@ struct talent static FixedVector< talent, 52 > Curr_abil; static bool insert_ability( int which_ability ); +static void lugonu_bends_space(); // declaring this const messes up externs later, so don't do it ability_type god_abilities[MAX_NUM_GODS][MAX_GOD_ABILITIES] = @@ -130,7 +134,7 @@ ability_type god_abilities[MAX_NUM_GODS][MAX_GOD_ABILITIES] = ABIL_ELYVILON_HEALING, ABIL_ELYVILON_RESTORATION, ABIL_ELYVILON_GREATER_HEALING }, // Lucy - { ABIL_LUGONU_ABYSS_EXIT, ABIL_NON_ABILITY, + { ABIL_LUGONU_ABYSS_EXIT, ABIL_LUGONU_BEND_SPACE, ABIL_LUGONU_SUMMON_DEMONS, ABIL_NON_ABILITY, ABIL_LUGONU_ABYSS_ENTER } }; @@ -258,6 +262,7 @@ static const struct ability_def Ability_List[] = // Lucy { ABIL_LUGONU_ABYSS_EXIT, "Depart the Abyss", 0, 0, 100, 10, ABFLAG_PAIN }, + { ABIL_LUGONU_BEND_SPACE, "Bend Space", 1, 0, 50, 0, ABFLAG_PAIN }, { ABIL_LUGONU_SUMMON_DEMONS, "Summon Abyssal Servants", 7, 0, 100, 5, ABFLAG_NONE }, { ABIL_LUGONU_ABYSS_ENTER, "Enter the Abyss", 9, 0, 200, 40, ABFLAG_NONE }, @@ -1231,6 +1236,11 @@ bool activate_ability(void) set_mp(random2(you.magic_points), false); break; + case ABIL_LUGONU_BEND_SPACE: + lugonu_bends_space(); + exercise(SK_INVOCATIONS, 2 + random2(3)); + break; + case ABIL_LUGONU_SUMMON_DEMONS: { int ndemons = 1 + you.skills[SK_INVOCATIONS] / 4; @@ -2122,3 +2132,54 @@ static bool insert_ability( int which_ability ) return (true); } // end insert_ability() + +//////////////////////////////////////////////////////////////////////////// + +static int lugonu_warp_monster(int x, int y, int pow, int) +{ + if (!in_bounds(x, y) || mgrd[x][y] == NON_MONSTER) + return (0); + + monsters &mon = menv[ mgrd[x][y] ]; + + if (!mons_friendly(&mon)) + behaviour_event( &mon, ME_ANNOY, MHITYOU ); + + if (check_mons_resist_magic(&mon, pow * 2)) + { + mprf("%s resists.", mon.name(DESC_CAP_THE).c_str()); + return (1); + } + + if (!check_mons_resist_magic(&mon, pow)) + { + mon.hurt(&you, 1 + random2(pow / 6)); + if (!mon.alive()) + return (1); + } + + mon.blink(); + + return (1); +} + +static void lugonu_warp_area(int pow) +{ + apply_area_around_square( lugonu_warp_monster, you.x_pos, you.y_pos, pow ); +} + +static void lugonu_bends_space() +{ + const int pow = 4 + skill_bump(SK_INVOCATIONS); + const bool area_warp = random2(pow) > 9; + + mprf("Space bends %saround you!", area_warp? "sharply " : ""); + + if (area_warp) + lugonu_warp_area(pow); + + random_blink(false, true); + + const int damage = roll_dice(1, 4); + ouch(damage, 0, KILLED_BY_WILD_MAGIC, "a spatial distortion"); +} diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h index 39c350a333..d85a07b8ef 100644 --- a/crawl-ref/source/enum.h +++ b/crawl-ref/source/enum.h @@ -110,6 +110,7 @@ enum ability_type ABIL_ELYVILON_RESTORATION, ABIL_ELYVILON_GREATER_HEALING, // 224 ABIL_LUGONU_ABYSS_EXIT, + ABIL_LUGONU_BEND_SPACE, ABIL_LUGONU_SUMMON_DEMONS, ABIL_LUGONU_ABYSS_ENTER, diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index 38964319ef..1efcb2b1d1 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -162,7 +162,7 @@ const char* god_gain_power_messages[MAX_NUM_GODS][MAX_GOD_ABILITIES] = "call upon Elyvilon for incredible healing" }, // Lugonu { "depart the Abyss - at a permanent cost", - "", + "bend space around yourself", "summon the demons of the Abyss to your aid", "", "gate yourself to the Abyss" } @@ -238,7 +238,7 @@ const char* god_lose_power_messages[MAX_NUM_GODS][MAX_GOD_ABILITIES] = "call upon Elyvilon for incredible healing" }, // Lugonu { "depart the Abyss at will", - "", + "bend space around yourself", "summon the demons of the Abyss to your aid", "", "gate yourself to the Abyss" } diff --git a/crawl-ref/source/spells1.cc b/crawl-ref/source/spells1.cc index ae7546c451..81abfc781b 100644 --- a/crawl-ref/source/spells1.cc +++ b/crawl-ref/source/spells1.cc @@ -121,14 +121,15 @@ int blink(void) return (1); } // end blink() -void random_blink(bool allow_partial_control) +void random_blink(bool allow_partial_control, bool override_abyss) { int tx, ty; bool succ = false; if (scan_randarts(RAP_PREVENT_TELEPORTATION)) mpr("You feel a weird sense of stasis."); - else if (you.level_type == LEVEL_ABYSS && !one_chance_in(3)) + else if (you.level_type == LEVEL_ABYSS + && !override_abyss && !one_chance_in(3)) { mpr("The power of the Abyss keeps you in your place!"); } diff --git a/crawl-ref/source/spells1.h b/crawl-ref/source/spells1.h index 1f684139c4..c29a535221 100644 --- a/crawl-ref/source/spells1.h +++ b/crawl-ref/source/spells1.h @@ -136,7 +136,7 @@ void purification(void); /* *********************************************************************** * called from: ability - decks - fight - spell - spells - spells1 * *********************************************************************** */ -void random_blink(bool); +void random_blink(bool, bool override_abyss = false); #endif -- cgit v1.2.3-54-g00ecf