Skip to content

Commit

Permalink
Fedhas rework part 4: remove Growth
Browse files Browse the repository at this point in the history
Fedhas will use summons to create all allies instead of creating
permanent ones using actual plant monsters as intermediaries. Hence
Growth, also referred to as using the descriptor `RING_OF_PLANTS` in the
source, is no longer necessary.
  • Loading branch information
gammafunk committed Sep 14, 2019
1 parent 565790d commit f8721d8
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 163 deletions.
1 change: 0 additions & 1 deletion crawl-ref/source/ability-type.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ enum ability_type
// Fedhas
ABIL_FEDHAS_WALL_OF_BRIARS = 1140,
ABIL_FEDHAS_RAIN,
ABIL_FEDHAS_PLANT_RING,
ABIL_FEDHAS_SPAWN_SPORES,
ABIL_FEDHAS_EVOLUTION,
// Cheibriados
Expand Down
8 changes: 0 additions & 8 deletions crawl-ref/source/ability.cc
Original file line number Diff line number Diff line change
Expand Up @@ -516,8 +516,6 @@ static const ability_def Ability_List[] =
// Fedhas
{ ABIL_FEDHAS_EVOLUTION, "Evolution",
2, 0, 0, 0, {fail_basis::invo, 30, 6, 20}, abflag::rations_or_piety },
{ ABIL_FEDHAS_PLANT_RING, "Growth",
2, 0, 0, 0, {fail_basis::invo, 40, 5, 20}, abflag::rations },
{ ABIL_FEDHAS_SPAWN_SPORES, "Reproduction",
4, 0, 100, 1, {fail_basis::invo, 60, 4, 25}, abflag::none },
{ ABIL_FEDHAS_RAIN, "Rain",
Expand Down Expand Up @@ -2862,12 +2860,6 @@ static spret _do_ability(const ability_def& abil, bool fail)
end_recall();
break;

case ABIL_FEDHAS_PLANT_RING:
fail_check();
if (!fedhas_plant_ring_from_rations())
return spret::abort;
break;

case ABIL_FEDHAS_WALL_OF_BRIARS:
fail_check();
if (!fedhas_wall_of_briars())
Expand Down
7 changes: 0 additions & 7 deletions crawl-ref/source/dat/descript/ability.txt
Original file line number Diff line number Diff line change
Expand Up @@ -486,13 +486,6 @@ 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.
%%%%
Growth ability

Uses food to grow a ring of plants around yourself. If a complete ring cannot
be formed (because you do not have enough food), plants will grow on squares
adjacent to you that are close to monsters. The plants you create gain bonus
health proportional to your Invocations skill.
%%%%
Rain ability

Causes rain to fall around you, turning the dungeon floor into shallow water
Expand Down
142 changes: 0 additions & 142 deletions crawl-ref/source/god-abil.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2173,43 +2173,6 @@ void collect_radius_points(vector<vector<coord_def> > &radius_points,
}
}

static bool _create_plant(coord_def& target, int hp_adjust = 0)
{
if (actor_at(target) || !mons_class_can_pass(MONS_PLANT, grd(target)))
return 0;

if (monster *plant = create_monster(mgen_data(MONS_PLANT,
BEH_FRIENDLY,
target,
MHITNOT,
MG_FORCE_PLACE,
GOD_FEDHAS)
.set_summoned(&you, 0, 0)))
{
plant->flags |= MF_NO_REWARD;
plant->flags |= MF_ATT_CHANGE_ATTEMPT;

mons_make_god_gift(*plant, GOD_FEDHAS);

plant->max_hit_points += hp_adjust;
plant->hit_points += hp_adjust;

if (you.see_cell(target))
{
if (hp_adjust)
{
mprf("A plant, strengthened by %s, grows up from the ground.",
god_name(GOD_FEDHAS).c_str());
}
else
mpr("A plant grows up from the ground.");
}
return true;
}

return false;
}

template<typename T>
static bool less_second(const T & left, const T & right)
{
Expand Down Expand Up @@ -2416,111 +2379,6 @@ static void _decrease_amount(vector<pair<int, int> >& available, int amount)
mpr("A ration is consumed!");
}

// Create a ring or partial ring around the caster. The user is
// prompted to select a stack of rations, and then plants are placed on open
// squares adjacent to the user. Of course, two rations are
// consumed per plant, so a complete ring may not be formed.
bool fedhas_plant_ring_from_rations()
{
// How many rations is available?
vector<pair<int, int> > collected_rations;
int total_rations = _collect_rations(collected_rations);

// 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_PLANT, env.grid(*adj_it))
&& !actor_at(*adj_it))
{
adjacent.push_back(*adj_it);
}
}

const int max_use = min(total_rations/2, static_cast<int>(adjacent.size()));

// Don't prompt if we can't do anything (due to having no rations or
// no squares to place plants on).
if (max_use == 0)
{
if (adjacent.empty())
mpr("No empty adjacent squares.");
else
mpr("Not enough rations available.");

return false;
}

prioritise_adjacent(you.pos(), adjacent);

// Screwing around with display code I don't really understand. -cao
targeter_smite range(&you, 1);
range_view_annotator show_range(&range);

for (int i = 0; i < max_use; ++i)
{
#ifndef USE_TILE_LOCAL
coord_def temp = grid2view(adjacent[i]);
cgotoxy(temp.x, temp.y, GOTO_DNGN);
put_colour_ch(GREEN, '1' + i);
#endif
#ifdef USE_TILE
tiles.add_overlay(adjacent[i], TILE_INDICATOR + i);
#endif
}

// And how many plants does the user want to create?
int target_count;
if (!_prompt_amount(max_use, target_count,
"How many plants will you create?"))
{
// User cancelled at the prompt.
return false;
}

const int hp_adjust = you.skill(SK_INVOCATIONS, 10);

// The user entered a number, remove all number overlays which
// are higher than that number.
#ifndef USE_TILE_LOCAL
unsigned not_used = adjacent.size() - unsigned(target_count);
for (unsigned i = adjacent.size() - not_used; i < adjacent.size(); i++)
view_update_at(adjacent[i]);
#endif
#ifdef USE_TILE
// For tiles we have to clear all overlays and redraw the ones
// we want.
tiles.clear_overlays();
for (int i = 0; i < target_count; ++i)
tiles.add_overlay(adjacent[i], TILE_INDICATOR + i);
#endif

int created_count = 0;
for (int i = 0; i < target_count; ++i)
{
if (_create_plant(adjacent[i], hp_adjust))
created_count++;

// Clear the overlay and draw the plant we just placed.
// This is somewhat more complicated in tiles.
view_update_at(adjacent[i]);
#ifdef USE_TILE
tiles.clear_overlays();
for (int j = i + 1; j < target_count; ++j)
tiles.add_overlay(adjacent[j], TILE_INDICATOR + j);
viewwindow(false);
#endif
scaled_delay(200);
}

if (created_count)
_decrease_amount(collected_rations, 2 * created_count);
else
canned_msg(MSG_NOTHING_HAPPENS);

return created_count;
}

// Create a circle of water around the target, with a radius of
// approximately 2. This turns normal floor tiles into shallow water
// and turns (unoccupied) shallow water into deep water. There is a
Expand Down
1 change: 0 additions & 1 deletion crawl-ref/source/god-abil.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ int place_ring(vector<coord_def>& ring_points,
void collect_radius_points(vector<vector<coord_def> > &radius_points,
const coord_def &origin, los_type los);
bool prioritise_adjacent(const coord_def& target, vector<coord_def>& candidates);
bool fedhas_plant_ring_from_rations();
int fedhas_rain(const coord_def &target);
int count_corpses_in_los(vector<stack_iterator> *positions);
int fedhas_check_corpse_spores(bool quiet = false);
Expand Down
1 change: 0 additions & 1 deletion crawl-ref/source/religion.cc
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@ const vector<god_power> god_powers[NUM_GODS] =
{
{ 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" },
{ 5, ABIL_FEDHAS_RAIN, "control the weather" },
},
Expand Down
1 change: 0 additions & 1 deletion crawl-ref/source/rltiles/dc-invocations.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ elyvilon_lesser_healing ABILITY_ELYVILON_LESSER_HEALING
elyvilon_purification ABILITY_ELYVILON_PURIFICATION
elyvilon_heal_other ABILITY_ELYVILON_HEAL_OTHER
fedhas_evolution ABILITY_FEDHAS_EVOLUTION
fedhas_plant_ring ABILITY_FEDHAS_PLANT_RING
fedhas_rain ABILITY_FEDHAS_RAIN
fedhas_spawn_spores ABILITY_FEDHAS_SPAWN_SPORES
fedhas_wall_of_briars ABILITY_FEDHAS_WALL_OF_BRIARS
Expand Down
Binary file not shown.
2 changes: 0 additions & 2 deletions crawl-ref/source/tilepick.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3517,8 +3517,6 @@ tileidx_t tileidx_ability(const ability_type ability)
return TILEG_ABILITY_FEDHAS_WALL_OF_BRIARS;
case ABIL_FEDHAS_RAIN:
return TILEG_ABILITY_FEDHAS_RAIN;
case ABIL_FEDHAS_PLANT_RING:
return TILEG_ABILITY_FEDHAS_PLANT_RING;
case ABIL_FEDHAS_SPAWN_SPORES:
return TILEG_ABILITY_FEDHAS_SPAWN_SPORES;
case ABIL_FEDHAS_EVOLUTION:
Expand Down

0 comments on commit f8721d8

Please sign in to comment.