From 02586511ee12f76046b80d3b47179b1c46de3d17 Mon Sep 17 00:00:00 2001 From: gammafunk Date: Mon, 9 Sep 2019 00:30:55 -0500 Subject: [PATCH] Fedhas rework part 2: Wall of Briars ability A 2* ability that encircles the player with summoned briar patches. The player can fire through these plants, and the briars damage monsters that attack them. Monster AI is changed so that hostile monsters always try to attack briars that are friendly to the player. Only floor or shallow water tiles that have no monsters are viable summon locations. The briar patches' HP scale with Invocations by adding 1 HD with each level of this skill. --- crawl-ref/source/ability-type.h | 1 + crawl-ref/source/ability.cc | 8 +++ crawl-ref/source/dat/descript/ability.txt | 5 ++ crawl-ref/source/mon-act.cc | 1 + crawl-ref/source/religion.cc | 1 + crawl-ref/source/rltiles/dc-invocations.txt | 1 + .../gui/invocations/fedhas_wall_of_briars.png | Bin 0 -> 329 bytes crawl-ref/source/spl-summoning.cc | 51 ++++++++++++++++++ crawl-ref/source/spl-summoning.h | 2 + crawl-ref/source/tilepick.cc | 2 + 10 files changed, 72 insertions(+) create mode 100644 crawl-ref/source/rltiles/gui/invocations/fedhas_wall_of_briars.png diff --git a/crawl-ref/source/ability-type.h b/crawl-ref/source/ability-type.h index 1b46b002f92..116fe7be98f 100644 --- a/crawl-ref/source/ability-type.h +++ b/crawl-ref/source/ability-type.h @@ -178,6 +178,7 @@ enum ability_type ABIL_FEDHAS_PLANT_RING, ABIL_FEDHAS_SPAWN_SPORES, ABIL_FEDHAS_EVOLUTION, + ABIL_FEDHAS_WALL_OF_BRIARS, // Cheibriados ABIL_CHEIBRIADOS_TIME_STEP = 1151, ABIL_CHEIBRIADOS_TIME_BEND, diff --git a/crawl-ref/source/ability.cc b/crawl-ref/source/ability.cc index f41911efe7d..ea38d018525 100644 --- a/crawl-ref/source/ability.cc +++ b/crawl-ref/source/ability.cc @@ -524,6 +524,8 @@ static const ability_def Ability_List[] = 4, 0, 100, 1, {fail_basis::invo, 60, 4, 25}, abflag::none }, { ABIL_FEDHAS_RAIN, "Rain", 4, 0, 150, 4, {fail_basis::invo, 70, 4, 25}, abflag::none }, + { ABIL_FEDHAS_WALL_OF_BRIARS, "Wall of Briars", + 3, 0, 50, 2, {fail_basis::invo, 30, 6, 20}, abflag::none}, // Cheibriados { ABIL_CHEIBRIADOS_TIME_BEND, "Bend Time", @@ -2871,6 +2873,12 @@ static spret _do_ability(const ability_def& abil, bool fail) return spret::abort; break; + case ABIL_FEDHAS_WALL_OF_BRIARS: + fail_check(); + if (!fedhas_wall_of_briars()) + return spret::abort; + break; + case ABIL_FEDHAS_RAIN: fail_check(); if (!fedhas_rain(you.pos())) diff --git a/crawl-ref/source/dat/descript/ability.txt b/crawl-ref/source/dat/descript/ability.txt index 584089fff82..d285b42fc1e 100644 --- a/crawl-ref/source/dat/descript/ability.txt +++ b/crawl-ref/source/dat/descript/ability.txt @@ -481,6 +481,11 @@ Bring an orc corpse back to life. The orc will be an ally, even if it was not already one before it died. %%%% # Fedhas +Wall of Briars ability + +Grow short-lived briar patches around you. Monsters attacking these briars will +be damaged by sharp thorns. Invocations skill increases the briars' health. +%%%% Sunlight ability Calls sunlight down over a small area of the dungeon. Monsters illuminated by diff --git a/crawl-ref/source/mon-act.cc b/crawl-ref/source/mon-act.cc index 0b9915c93d0..bded8b1ebb6 100644 --- a/crawl-ref/source/mon-act.cc +++ b/crawl-ref/source/mon-act.cc @@ -2990,6 +2990,7 @@ static bool _may_cutdown(monster* mons, monster* targ) // (but don't try to attack briars unless their damage will be insignificant) return mons_is_firewood(*targ) && (targ->type != MONS_BRIAR_PATCH + || (targ->friendly() && !mons_aligned(mons, targ)) || mons->type == MONS_THORN_HUNTER || mons->armour_class() * mons->hit_points >= 400); } diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index d7797687cce..53452c356cc 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -264,6 +264,7 @@ const vector god_powers[NUM_GODS] = // Fedhas { { 1, ABIL_FEDHAS_SUNLIGHT, "call sunshine" }, + { 2, ABIL_FEDHAS_WALL_OF_BRIARS, "encircle yourself with summoned briar patches"}, { 2, ABIL_FEDHAS_EVOLUTION, "induce evolution" }, { 3, ABIL_FEDHAS_PLANT_RING, "cause a ring of plants to grow" }, { 4, ABIL_FEDHAS_SPAWN_SPORES, "spawn explosive spores" }, diff --git a/crawl-ref/source/rltiles/dc-invocations.txt b/crawl-ref/source/rltiles/dc-invocations.txt index 1c7a2f187ca..dfef4a21b58 100644 --- a/crawl-ref/source/rltiles/dc-invocations.txt +++ b/crawl-ref/source/rltiles/dc-invocations.txt @@ -25,6 +25,7 @@ fedhas_plant_ring ABILITY_FEDHAS_PLANT_RING fedhas_rain ABILITY_FEDHAS_RAIN fedhas_spawn_spores ABILITY_FEDHAS_SPAWN_SPORES fedhas_sunlight ABILITY_FEDHAS_SUNLIGHT +fedhas_wall_of_briars ABILITY_FEDHAS_WALL_OF_BRIARS gozag_potion_petition ABILITY_GOZAG_POTION_PETITION gozag_call_merchant ABILITY_GOZAG_CALL_MERCHANT gozag_bribe_branch ABILITY_GOZAG_BRIBE_BRANCH diff --git a/crawl-ref/source/rltiles/gui/invocations/fedhas_wall_of_briars.png b/crawl-ref/source/rltiles/gui/invocations/fedhas_wall_of_briars.png new file mode 100644 index 0000000000000000000000000000000000000000..ef367f50a4110b1884c2e4fdad66580eea7f6f36 GIT binary patch literal 329 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dyiUB?$u0R?Hcua+4(nJgl3>+LB z61w;%Oqj6kr0`^|3cYKixm_3g25?K`XY4mno;c(-g9TD6~J5zGApGgl=Q?_?C+ z+#spYvLrFz!N)%-Kw2T-t74c>HA7@@l59xRlZuIJm{|5OvBicb6xK(s-8?nH)8;oz zhu4G!%RQa0JFHN adjacent; + for (adjacent_iterator adj_it(you.pos()); adj_it; ++adj_it) + { + if (monster_habitable_grid(MONS_BRIAR_PATCH, env.grid(*adj_it)) + && !actor_at(*adj_it)) + { + adjacent.push_back(*adj_it); + } + } + + // Don't prompt if we can't do anything. + if (adjacent.empty()) + { + mpr("No empty adjacent squares."); + return false; + } + + int created_count = 0; + for (auto p : adjacent) + { + if (_create_briar_patch(p)) + created_count++; + } + + if (!created_count) + canned_msg(MSG_NOTHING_HAPPENS); + + return created_count; +} diff --git a/crawl-ref/source/spl-summoning.h b/crawl-ref/source/spl-summoning.h index 4adf0329a20..f9d0c9b8c06 100644 --- a/crawl-ref/source/spl-summoning.h +++ b/crawl-ref/source/spl-summoning.h @@ -125,3 +125,5 @@ void summoned_monster(const monster* mons, const actor* caster, bool summons_are_capped(spell_type spell); int summons_limit(spell_type spell); int count_summons(const actor *summoner, spell_type spell); + +bool fedhas_wall_of_briars(); diff --git a/crawl-ref/source/tilepick.cc b/crawl-ref/source/tilepick.cc index f3c2c2a55e9..d919b49c738 100644 --- a/crawl-ref/source/tilepick.cc +++ b/crawl-ref/source/tilepick.cc @@ -3513,6 +3513,8 @@ tileidx_t tileidx_ability(const ability_type ability) case ABIL_JIYVA_CURE_BAD_MUTATION: return TILEG_ABILITY_JIYVA_CURE_BAD_MUTATIONS; // Fedhas + case ABIL_FEDHAS_WALL_OF_BRIARS: + return TILEG_ABILITY_FEDHAS_WALL_OF_BRIARS; case ABIL_FEDHAS_SUNLIGHT: return TILEG_ABILITY_FEDHAS_SUNLIGHT; case ABIL_FEDHAS_RAIN: