Skip to content

Commit

Permalink
Use have_passive for fedhas passive abilities
Browse files Browse the repository at this point in the history
  • Loading branch information
giann authored and amalloy committed Mar 11, 2016
1 parent 124ad16 commit 40744a8
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion crawl-ref/source/attitude-change.cc
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ void slime_convert(monster* mons)

void fedhas_neutralise(monster* mons)
{
if (in_good_standing(GOD_FEDHAS)
if (have_passive(passive_t::friendly_plants)
&& mons->attitude == ATT_HOSTILE
&& fedhas_neutralises(mons)
&& !testbits(mons->flags, MF_ATT_CHANGE_ATTEMPT))
Expand Down
2 changes: 1 addition & 1 deletion crawl-ref/source/beam.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6630,7 +6630,7 @@ bool shoot_through_monster(const bolt& beam, const monster* victim)
mon_attitude_type origin_attitude;
if (originator->is_player())
{
origin_worships_fedhas = you_worship(GOD_FEDHAS);
origin_worships_fedhas = have_passive(passive_t::shoot_through_plants);
origin_attitude = ATT_FRIENDLY;
}
else
Expand Down
3 changes: 2 additions & 1 deletion crawl-ref/source/godabil.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "godblessing.h"
#include "godcompanions.h"
#include "goditem.h"
#include "godpassive.h"
#include "hints.h"
#include "hiscores.h"
#include "invent.h"
Expand Down Expand Up @@ -2119,7 +2120,7 @@ bool kiku_gift_necronomicon()

bool fedhas_passthrough_class(const monster_type mc)
{
return you_worship(GOD_FEDHAS)
return have_passive(passive_t::pass_through_plants)
&& mons_class_is_plant(mc)
&& mons_class_is_stationary(mc)
&& mc != MONS_SNAPLASHER_VINE
Expand Down
6 changes: 5 additions & 1 deletion crawl-ref/source/godpassive.cc
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,11 @@ static const vector<god_passive> god_passives[NUM_GODS] =
{ },

// Fedhas
{ },
{
{ -1, passive_t::friendly_plants, "Allied plants are friendly towards you" },
{ -1, passive_t::pass_through_plants, "can walk through plants" },
{ -1, passive_t::shoot_through_plants, "can safely fire through allied plants" },
},

// Cheibriados
{
Expand Down
9 changes: 9 additions & 0 deletions crawl-ref/source/godpassive.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,15 @@ enum class passive_t

/// You detect the presence of gold. Gold is moved on top in stacks.
detect_gold,

/// Allied plants are friendly towards you
friendly_plants,

/// You can walk through plants
pass_through_plants,

/// You can fire through allied plants
shoot_through_plants,
};

enum ru_interference
Expand Down

0 comments on commit 40744a8

Please sign in to comment.