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 00000000000..ef367f50a41 Binary files /dev/null and b/crawl-ref/source/rltiles/gui/invocations/fedhas_wall_of_briars.png differ diff --git a/crawl-ref/source/spl-summoning.cc b/crawl-ref/source/spl-summoning.cc index 5518d9096cd..cbc347eff98 100644 --- a/crawl-ref/source/spl-summoning.cc +++ b/crawl-ref/source/spl-summoning.cc @@ -3473,3 +3473,54 @@ int count_summons(const actor *summoner, spell_type spell) return count; } + +static bool _create_briar_patch(coord_def& target) +{ + mgen_data mgen = mgen_data(MONS_BRIAR_PATCH, BEH_FRIENDLY, target, + MHITNOT, MG_FORCE_PLACE, GOD_FEDHAS); + mgen.hd = mons_class_hit_dice(MONS_BRIAR_PATCH) + + you.skill_rdiv(SK_INVOCATIONS); + mgen.set_summoned(&you, 3 + you.skill_rdiv(SK_INVOCATIONS, 1, 6), + SPELL_NO_SPELL); + + if (create_monster(mgen)) + { + mpr("A briar patch grows up from the ground."); + return true; + } + + return false; +} + +bool fedhas_wall_of_briars() +{ + // How many adjacent open spaces are there? + vector 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: