Skip to content

Commit

Permalink
Fedhas rework part X: vines passive (disabled)
Browse files Browse the repository at this point in the history
This is a (currently disabled) implementation of a passive halo that's
somewhat similar to Ledas' Liquefaction. It increases movement energy
costs by 3 for all monsters in the halo. It's themed as vines that
hinder the movement of all substantial, non-flying monsters. If enabled,
it would start with radius 1 at 1* piety, increasing by 2 (for
non-barachi) until reaching LOS radius at 4* piety.

This type of passive likely won't make it into the final rework since
the idea has a lot of problems. It increases kiting and directly
counteracts the movement limitations of slow species. Directly
counteracting signification species limitations is something we do with
other gods, but that's not to say we should increase this. Still, the
basic halo implementation might be useful if we do find a good passive,
and if not, this commit can easilly be rebased out.

The halo overlay in tiles is a transparent green overlay, and in console
it colors the floor lightgreen. The lightgreen floor color is used only
in Snake Pits, so it might be good to change the floor color in that
branch if this halo makes it in.
  • Loading branch information
gammafunk committed Sep 14, 2019
1 parent 441fe51 commit 489c770
Show file tree
Hide file tree
Showing 23 changed files with 134 additions and 9 deletions.
3 changes: 3 additions & 0 deletions crawl-ref/source/actor.h
Original file line number Diff line number Diff line change
Expand Up @@ -367,13 +367,16 @@ class actor
virtual bool haloed() const;
// Within an umbra?
virtual bool umbraed() const;
// Within vines?
virtual bool vined() const;
// Halo radius.
virtual int halo_radius() const = 0;
// Silence radius.
virtual int silence_radius() const = 0;
// Liquefying radius.
virtual int liquefying_radius() const = 0;
virtual int umbra_radius() const = 0;
virtual int vines_radius() const = 0;

virtual bool petrifying() const = 0;
virtual bool petrified() const = 0;
Expand Down
55 changes: 54 additions & 1 deletion crawl-ref/source/areas.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ enum class areaprop
quad = (1 << 8),
disjunction = (1 << 9),
soul_aura = (1 << 10),
vines = (1 << 11),
};
DEF_BITFIELD(areaprops, areaprop);

Expand Down Expand Up @@ -82,7 +83,8 @@ void areas_actor_moved(const actor* act, const coord_def& oldpos)
if (act->alive() &&
(you.entering_level
|| act->halo_radius() > -1 || act->silence_radius() > -1
|| act->liquefying_radius() > -1 || act->umbra_radius() > -1))
|| act->liquefying_radius() > -1 || act->umbra_radius() > -1
|| act->vines_radius() > -1))
{
// Not necessarily new, but certainly potentially interesting.
invalidate_agrid(true);
Expand Down Expand Up @@ -135,6 +137,15 @@ static void _actor_areas(actor *a)
_set_agrid_flag(*ri, areaprop::umbra);
no_areas = false;
}

if ((r = a->vines_radius()) >= 0)
{
_agrid_centres.emplace_back(area_centre_type::vines, a->pos(), r);

for (radius_iterator ri(a->pos(), r, C_SQUARE, LOS_DEFAULT); ri; ++ri)
_set_agrid_flag(*ri, areaprop::vines);
no_areas = false;
}
}

/**
Expand Down Expand Up @@ -715,3 +726,45 @@ int monster::umbra_radius() const
return -1;
}
}

/////////////
// Vines
//

bool vined(const coord_def& p)
{
if (!map_bounds(p))
return false;
if (!_agrid_valid)
_update_agrid();

return _check_agrid_flag(p, areaprop::vines);
}

// Whether actor is in the middle of vines.
bool actor::vined() const
{
return ::vined(pos())
&& ground_level() && !is_insubstantial()
&& !is_stationary();
}


int monster::vines_radius() const
{
return -1;
}

int player::vines_radius() const
{
int size = -1;

if (have_passive(passive_t::vines))
{
// The cap is reached at piety 100 = ****..
size = min((int)piety, piety_breakpoint(3)) * you.normal_vision
/ piety_breakpoint(3);
}

return size;
}
4 changes: 4 additions & 0 deletions crawl-ref/source/areas.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ enum class area_centre_type
#if TAG_MAJOR_VERSION == 34
hot,
#endif
vines,
};

void invalidate_agrid(bool recheck_new = false);
Expand Down Expand Up @@ -48,6 +49,9 @@ bool disjunction_haloed(const coord_def& p);
// ...or endarkened by an umbra?
bool umbraed(const coord_def& p);

// ...or covered in vines?
bool vined(const coord_def& p);

#if TAG_MAJOR_VERSION == 34
// ...or is the area hot?
bool heated(const coord_def& p);
Expand Down
5 changes: 5 additions & 0 deletions crawl-ref/source/directn.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3144,6 +3144,9 @@ static vector<string> _get_monster_desc_vector(const monster_info& mi)
if (mi.is(MB_UMBRAED))
descs.emplace_back("umbra");

if (mi.is(MB_VINED))
descs.emplace_back("slowed by vines");

if (mi.is(MB_POSSESSABLE))
descs.emplace_back("possessable"); // FIXME: better adjective
else if (mi.is(MB_ENSLAVED))
Expand Down Expand Up @@ -3497,6 +3500,8 @@ static bool _print_cloud_desc(const coord_def where)
areas.emplace_back("is covered in magical glow");
if (disjunction_haloed(where))
areas.emplace_back("is bathed in translocational energy");
if (vined(where))
areas.emplace_back("is covered in vines");
if (!areas.empty())
{
mprf("This square %s.",
Expand Down
2 changes: 2 additions & 0 deletions crawl-ref/source/god-passive.cc
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,8 @@ static const vector<god_passive> god_passives[] =
"can NOW safely fire through allied plants" },
{ 0, passive_t::friendly_plants,
"Allied plants are NOW friendly towards you" },
// XXX: Disabled until we can work out an acceptable design.
//{ 0, passive_t::vines, "are NOW surrounded by vines" },
},

// Cheibriados
Expand Down
3 changes: 3 additions & 0 deletions crawl-ref/source/god-passive.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,9 @@ enum class passive_t
wu_jian_lunge,
wu_jian_whirlwind,
wu_jian_wall_jump,

/// Fedhas vines
vines,
};

enum ru_interference
Expand Down
1 change: 1 addition & 0 deletions crawl-ref/source/map-cell.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#if TAG_MAJOR_VERSION == 34
#define MAP_HOT 0x10000000
#endif
#define MAP_VINES 0x20000000

struct cloud_info
{
Expand Down
6 changes: 3 additions & 3 deletions crawl-ref/source/mon-act.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1160,7 +1160,7 @@ bool handle_throw(monster* mons, bolt & beem, bool teleport, bool check_only)

const bool archer = mons_class_flag(mons->type, M_DONT_MELEE);

const bool liquefied = mons->liquefied_ground();
const bool ground_slow = mons->liquefied_ground() || mons->vined();

// Don't allow offscreen throwing for now.
if (mons->foe == MHITYOU && !you.see_cell(mons->pos()))
Expand All @@ -1175,8 +1175,8 @@ bool handle_throw(monster* mons, bolt & beem, bool teleport, bool check_only)
// If adjacent, archers should always shoot (otherwise they would
// try to melee). Hence the else if below.
}
else if (!teleport && ((liquefied && !archer && one_chance_in(9))
|| (!liquefied && one_chance_in(archer ? 9 : 5))))
else if (!teleport && ((ground_slow && !archer && one_chance_in(9))
|| (!ground_slow && one_chance_in(archer ? 9 : 5))))
{
// Highly-specialised archers are more likely to shoot than talk.
// If we're standing on liquefied ground, try to stand and fire!
Expand Down
2 changes: 2 additions & 0 deletions crawl-ref/source/mon-info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,8 @@ monster_info::monster_info(const monster* m, int milev)
mb.set(MB_HALOED);
if (!m->haloed() && m->umbraed())
mb.set(MB_UMBRAED);
if (m->vined())
mb.set(MB_VINED);
if (mons_looks_stabbable(*m))
mb.set(MB_STABBABLE);
if (mons_looks_distracted(*m))
Expand Down
1 change: 1 addition & 0 deletions crawl-ref/source/mon-info.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ enum monster_info_flags
MB_PINNED,
MB_VILE_CLUTCH,
MB_HIGHLIGHTED_SUMMONER,
MB_VINED,
NUM_MB_FLAGS
};

Expand Down
3 changes: 3 additions & 0 deletions crawl-ref/source/monster.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5723,6 +5723,9 @@ int monster::action_energy(energy_use_type et) const
if (floundering())
move_cost += 6;

if (vined())
move_cost += 4;

// Never reduce the cost to zero
return max(move_cost, 1);
}
Expand Down
1 change: 1 addition & 0 deletions crawl-ref/source/monster.h
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ class monster : public actor
int silence_radius() const override;
int liquefying_radius() const override;
int umbra_radius() const override;
int vines_radius() const override;
bool petrified() const override;
bool petrifying() const override;
bool liquefied_ground() const override;
Expand Down
1 change: 1 addition & 0 deletions crawl-ref/source/player.h
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,7 @@ class player : public actor
int silence_radius() const override;
int liquefying_radius() const override;
int umbra_radius() const override;
int vines_radius() const override;
bool petrifying() const override;
bool petrified() const override;
bool liquefied_ground() const override;
Expand Down
31 changes: 27 additions & 4 deletions crawl-ref/source/religion.cc
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,7 @@ void dec_penance(god_type god, int val)
{
const bool had_halo = have_passive(passive_t::halo);
const bool had_umbra = have_passive(passive_t::umbra);
const bool had_vines = have_passive(passive_t::vines);

you.penance[god] = 0;

Expand Down Expand Up @@ -623,6 +624,11 @@ void dec_penance(god_type god, int val)
mprf(MSGCH_GOD, "Your aura of darkness returns!");
invalidate_agrid(true);
}
if (!had_vines && have_passive(passive_t::vines))
{
mprf(MSGCH_GOD, "Your vines return!");
invalidate_agrid(true);
}
if (have_passive(passive_t::sinv))
{
mprf(MSGCH_GOD, "Your vision regains its divine sight.");
Expand Down Expand Up @@ -745,6 +751,7 @@ static void _inc_penance(god_type god, int val)

const bool had_halo = have_passive(passive_t::halo);
const bool had_umbra = have_passive(passive_t::umbra);
const bool had_vines = have_passive(passive_t::vines);

you.penance[god] += val;
you.penance[god] = min((uint8_t)MAX_PENANCE, you.penance[god]);
Expand All @@ -759,6 +766,11 @@ static void _inc_penance(god_type god, int val)
mprf(MSGCH_GOD, god, "Your aura of darkness fades away.");
invalidate_agrid();
}
if (had_vines && !have_passive(passive_t::vines))
{
mprf(MSGCH_GOD, god, "Your vines recede.");
invalidate_agrid();
}

if (will_have_passive(passive_t::water_walk)
&& _need_water_walking() && !have_passive(passive_t::water_walk))
Expand Down Expand Up @@ -2401,6 +2413,8 @@ static void _gain_piety_point()
mprf(MSGCH_GOD, "A divine halo surrounds you!");
if (rank == rank_for_passive(passive_t::umbra))
mprf(MSGCH_GOD, "You are shrouded in an aura of darkness!");
if (rank == rank_for_passive(passive_t::vines))
mprf(MSGCH_GOD, "You are surrounded by vines!");
if (rank == rank_for_passive(passive_t::sinv))
autotoggle_autopickup(false);
if (rank == rank_for_passive(passive_t::clarity))
Expand Down Expand Up @@ -2455,9 +2469,11 @@ static void _gain_piety_point()
you.redraw_armour_class = true;
}

if (have_passive(passive_t::halo) || have_passive(passive_t::umbra))
if (have_passive(passive_t::halo)
|| have_passive(passive_t::umbra)
|| have_passive(passive_t::vines))
{
// Piety change affects halo / umbra radius.
// Piety change affects halo/umbra/vines radius.
invalidate_agrid(true);
}

Expand Down Expand Up @@ -2604,9 +2620,10 @@ void lose_piety(int pgn)
}

if (will_have_passive(passive_t::halo)
|| will_have_passive(passive_t::umbra))
|| will_have_passive(passive_t::umbra)
|| will_have_passive(passive_t::vines))
{
// Piety change affects halo / umbra radius.
// Piety change affects halo/umbra/vines radius.
invalidate_agrid(true);
}
}
Expand Down Expand Up @@ -2709,6 +2726,7 @@ void excommunication(bool voluntary, god_type new_god)

const bool had_halo = have_passive(passive_t::halo);
const bool had_umbra = have_passive(passive_t::umbra);
const bool had_vines = have_passive(passive_t::vines);
const bool had_water_walk = have_passive(passive_t::water_walk);
const bool had_stat_boost = have_passive(passive_t::stat_boost);
const int old_piety = you.piety;
Expand Down Expand Up @@ -2780,6 +2798,11 @@ void excommunication(bool voluntary, god_type new_god)
mprf(MSGCH_GOD, old_god, "Your aura of darkness fades away.");
invalidate_agrid(true);
}
if (had_vines)
{
mprf(MSGCH_GOD, old_god, "Your vines recede.");
invalidate_agrid(true);
}
// You might have lost water walking at a bad time...
if (had_water_walk && _need_water_walking())
_grant_temporary_waterwalk();
Expand Down
1 change: 1 addition & 0 deletions crawl-ref/source/rltiles/dc-feat.txt
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,7 @@ effect/umbra0 UMBRA
effect/umbra1
effect/umbra2
effect/umbra3
effect/vines VINES
effect/orb_glow0 ORB_GLOW
effect/orb_glow1
effect/quad_glow QUAD_GLOW
Expand Down
Binary file added crawl-ref/source/rltiles/effect/vines.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions crawl-ref/source/show.cc
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ static void _update_feat_at(const coord_def &gp)
if (disjunction_haloed(gp))
env.map_knowledge(gp).flags |= MAP_DISJUNCT;

if (vined(gp))
env.map_knowledge(gp).flags |= MAP_VINES;

if (is_sanctuary(gp))
{
if (testbits(env.pgrid(gp), FPROP_SANCTUARY_1))
Expand Down
13 changes: 12 additions & 1 deletion crawl-ref/source/showsymb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -117,18 +117,29 @@ static unsigned short _cell_feat_show_colour(const map_cell& cell,
colour = LIGHTCYAN;
else if (cell.flags & MAP_UMBRAED)
colour = fdef.colour(); // Cancels out!
else if (cell.flags & MAP_VINES)
colour = RED;
else
colour = YELLOW;
}
else if (cell.flags & MAP_UMBRAED)
{
if (cell.flags & MAP_SILENCED)
colour = BLUE; // Silence gets darker
else if (cell.flags & MAP_VINES)
colour = GREEN; // Vines get darker
else
colour = MAGENTA; // If no holy or silence
}
else if (cell.flags & MAP_VINES)
{
if (cell.flags & MAP_SILENCED)
colour = LIGHTBLUE;
else
colour = LIGHTGREEN;
}
else if (cell.flags & MAP_SILENCED)
colour = CYAN; // Silence but no holy/unholy
colour = CYAN; // Silence but no holy/unholy/vines
else if (cell.flags & MAP_ORB_HALOED)
colour = ETC_ORB_GLOW;
else if (cell.flags & MAP_QUAD_HALOED)
Expand Down
1 change: 1 addition & 0 deletions crawl-ref/source/tilecell.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ enum halo_type
HALO_NONE = 0,
HALO_RANGE = 1,
HALO_UMBRA = 2,
HALO_VINES = 3,
};

struct packed_cell
Expand Down
2 changes: 2 additions & 0 deletions crawl-ref/source/tiledgnbuf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,8 @@ void DungeonCellBuffer::pack_background(int x, int y, const packed_cell &cell)
m_buf_feat.add(TILE_HALO_RANGE, x, y);
if (cell.halo == HALO_UMBRA)
m_buf_feat.add(TILE_UMBRA + random2(4), x, y);
if (cell.vines == HALO_VINES)
m_buf_feat.add(TILE_VINES, x, y);

if (cell.orb_glow)
m_buf_feat.add(TILE_ORB_GLOW + cell.orb_glow - 1, x, y);
Expand Down
2 changes: 2 additions & 0 deletions crawl-ref/source/tileview.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1422,6 +1422,8 @@ void tile_apply_properties(const coord_def &gc, packed_cell &cell)
cell.halo = HALO_UMBRA;
else if (mc.flags & MAP_HALOED)
cell.halo = HALO_RANGE;
else if (mc.flags & MAP_VINES)
cell.halo = HALO_VINES;
else
cell.halo = HALO_NONE;

Expand Down

0 comments on commit 489c770

Please sign in to comment.