summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-08-11 21:14:12 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-08-11 21:14:12 +0000
commita42060983aa972a68cfc8feb6d135b44d7f2ba83 (patch)
treee0d8849452b28513f9530f5e4eccea0f6195e4e7 /crawl-ref
parente9e1be789c12cdbaaaeb048251dae0dc22a320ba (diff)
downloadcrawl-ref-a42060983aa972a68cfc8feb6d135b44d7f2ba83.tar.gz
crawl-ref-a42060983aa972a68cfc8feb6d135b44d7f2ba83.zip
Fixed tracers to handle neutrals.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1991 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/beam.cc12
-rw-r--r--crawl-ref/source/externs.h2
2 files changed, 7 insertions, 7 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index 17b4da20a9..df3c1dd027 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -2168,7 +2168,7 @@ void fire_tracer(const monsters *monster, bolt &pbolt)
pbolt.can_see_invis = (mons_see_invis(monster) != 0);
pbolt.smart_monster = (mons_intel(monster->type) == I_HIGH ||
mons_intel(monster->type) == I_NORMAL);
- pbolt.is_friendly = mons_friendly(monster);
+ pbolt.attitude = mons_attitude(monster);
// init tracer variables
pbolt.foe_count = pbolt.fr_count = 0;
@@ -2178,7 +2178,7 @@ void fire_tracer(const monsters *monster, bolt &pbolt)
// foe ratio for summon gtr. demons & undead -- they may be
// summoned, but they're hostile and would love nothing better
// than to nuke the player and his minions
- if (pbolt.is_friendly && monster->attitude != ATT_FRIENDLY)
+ if (pbolt.attitude == ATT_FRIENDLY && monster->attitude != ATT_FRIENDLY)
pbolt.foe_ratio = 25;
// fire!
@@ -3006,7 +3006,7 @@ static int affect_player( bolt &beam )
if (beam.can_see_invis || !you.invisible()
|| fuzz_invis_tracer(beam))
{
- if (beam.is_friendly)
+ if (beam.attitude != ATT_HOSTILE)
{
beam.fr_count += 1;
beam.fr_power += you.experience_level;
@@ -3474,7 +3474,7 @@ static int affect_monster(bolt &beam, monsters *mon)
if (beam.is_tracer)
{
// enchant case -- enchantments always hit, so update target immed.
- if (beam.is_friendly != mons_friendly(mon))
+ if (beam.attitude != mons_attitude(mon))
{
beam.foe_count += 1;
beam.foe_power += mons_power(mons_type);
@@ -3614,7 +3614,7 @@ static int affect_monster(bolt &beam, monsters *mon)
// fireball at another fire giant, and it only took
// 1/3 damage, then power of 5 would be applied to
// foe_power or fr_power.
- if (beam.is_friendly != mons_friendly(mon))
+ if (beam.attitude != mons_attitude(mon))
{
beam.foe_count += 1;
beam.foe_power += 2 * hurt_final * mons_power(mons_type) / hurt;
@@ -4479,7 +4479,7 @@ bolt::bolt() : range(0), rangeMax(0), type(SYM_ZAP), colour(BLACK),
fr_power(0), foe_power(0), is_tracer(false),
aimed_at_feet(false), msg_generated(false),
in_explosion_phase(false), smart_monster(false),
- can_see_invis(false), is_friendly(false), foe_ratio(0),
+ can_see_invis(false), attitude(ATT_HOSTILE), foe_ratio(0),
chose_ray(false)
{ }
diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h
index 5998a02a42..48a84d885b 100644
--- a/crawl-ref/source/externs.h
+++ b/crawl-ref/source/externs.h
@@ -446,7 +446,7 @@ struct bolt
bool in_explosion_phase; // explosion phase (as opposed to beam phase)
bool smart_monster; // tracer firer can guess at other mons. resists?
bool can_see_invis; // tracer firer can see invisible?
- bool is_friendly; // tracer firer is enslaved or pet
+ mon_attitude_type attitude; // attitude of whoever fired tracer
int foe_ratio; // 100* foe ratio (see mons_should_fire())
bool chose_ray; // do we want a specific ray?
ray_def ray; // shoot on this specific ray