Skip to content

Commit

Permalink
Fedhas rework part 2: Wall of Briars ability
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
gammafunk committed Sep 14, 2019
1 parent 0bcac68 commit 0258651
Show file tree
Hide file tree
Showing 10 changed files with 72 additions and 0 deletions.
1 change: 1 addition & 0 deletions crawl-ref/source/ability-type.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 8 additions & 0 deletions crawl-ref/source/ability.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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()))
Expand Down
5 changes: 5 additions & 0 deletions crawl-ref/source/dat/descript/ability.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions crawl-ref/source/mon-act.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
1 change: 1 addition & 0 deletions crawl-ref/source/religion.cc
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ const vector<god_power> 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" },
Expand Down
1 change: 1 addition & 0 deletions crawl-ref/source/rltiles/dc-invocations.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 51 additions & 0 deletions crawl-ref/source/spl-summoning.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<coord_def> 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;
}
2 changes: 2 additions & 0 deletions crawl-ref/source/spl-summoning.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
2 changes: 2 additions & 0 deletions crawl-ref/source/tilepick.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 0258651

Please sign in to comment.