diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-09-10 14:34:45 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-09-10 14:34:45 +0000 |
commit | 9dc1f94fe89c3f426921ac5e32eb4cd79f8b73e2 (patch) | |
tree | d3b99cfb5490ea662767c700a70da86e7c83a7aa | |
parent | bad0d9c9cf87b6abf72e7c894f37b07de0fadb4b (diff) | |
download | crawl-ref-9dc1f94fe89c3f426921ac5e32eb4cd79f8b73e2.tar.gz crawl-ref-9dc1f94fe89c3f426921ac5e32eb4cd79f8b73e2.zip |
Modified wand effects, so that
- you cannot enslave already friendly monsters (1789757)
- good gods don't mind inadvertent use of draining
(first part of 1789189)
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2066 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r-- | crawl-ref/source/beam.cc | 24 | ||||
-rw-r--r-- | crawl-ref/source/externs.h | 15 | ||||
-rw-r--r-- | crawl-ref/source/item_use.cc | 4 | ||||
-rw-r--r-- | crawl-ref/source/religion.cc | 2 |
4 files changed, 33 insertions, 12 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index de7c3b96d9..8c4041e754 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -794,7 +794,6 @@ static void zappy( zap_type z_type, int power, bolt &pbolt ) pbolt.type = SYM_ZAP; pbolt.flavour = BEAM_NEG; // drains levels - pbolt.obvious_effect = true; pbolt.is_beam = true; break; @@ -1416,7 +1415,10 @@ void fire_beam( bolt &pbolt, item_def *item ) rangeRemaining -= affect(pbolt, tx, ty); if (random_beam) + { pbolt.flavour = BEAM_RANDOM; + pbolt.effect_known = false; + } } // always decrease range by 1 @@ -1654,9 +1656,14 @@ int mons_adjust_flavoured( monsters *monster, bolt &pbolt, return (hurted); simple_monster_message(monster, " is drained."); + pbolt.obvious_effect = true; if (YOU_KILL(pbolt.thrower)) - did_god_conduct(DID_NECROMANCY, 2 + random2(3)); + { + // currently no gods who enjoy use of necromancy + if (pbolt.effect_known) + did_god_conduct(DID_NECROMANCY, 2 + random2(3)); + } if (one_chance_in(5)) monster->hit_dice--; @@ -3917,6 +3924,9 @@ static int affect_monster_enchantment(bolt &beam, monsters *mon) "HD: %d; pow: %d", mon->hit_dice, beam.ench_power ); #endif + if (mon->attitude == ATT_FRIENDLY) + return (MON_UNAFFECTED); + if (check_mons_resist_magic( mon, beam.ench_power )) return mons_immune_magic(mon) ? MON_UNAFFECTED : MON_RESIST; @@ -3942,6 +3952,10 @@ static int affect_monster_enchantment(bolt &beam, monsters *mon) return (MON_RESIST); } + // already friendly + if (mon->attitude == ATT_FRIENDLY) + return (MON_UNAFFECTED); + simple_monster_message(mon, " is enslaved."); beam.obvious_effect = true; @@ -4596,9 +4610,9 @@ bolt::bolt() : range(0), rangeMax(0), type(SYM_ZAP), colour(BLACK), is_beam(false), is_explosion(false), is_big_cloud(false), is_enchant(false), is_energy(false), is_launched(false), is_thrown(false), target_first(false), aimed_at_spot(false), - aux_source(), obvious_effect(false), fr_count(0), foe_count(0), - fr_power(0), foe_power(0), is_tracer(false), - aimed_at_feet(false), msg_generated(false), + aux_source(), obvious_effect(false), effect_known(true), + fr_count(0), foe_count(0), 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), attitude(ATT_HOSTILE), foe_ratio(0), chose_ray(false) diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h index 287552ed8c..f326a6a251 100644 --- a/crawl-ref/source/externs.h +++ b/crawl-ref/source/externs.h @@ -437,21 +437,22 @@ struct bolt std::string aux_source; // source of KILL_MISC beams // OUTPUT parameters (tracing, ID) - bool obvious_effect; // did an 'obvious' effect happen? + bool obvious_effect; // did an 'obvious' effect happen? + bool effect_known; // did we _know_ this would happen? int fr_count, foe_count; // # of times a friend/foe is "hit" int fr_power, foe_power; // total levels/hit dice affected // INTERNAL use - should not usually be set outside of beam.cc - bool is_tracer; // is this a tracer? + bool is_tracer; // is this a tracer? bool aimed_at_feet; // this was aimed at self! - bool msg_generated; // an appropriate msg was already mpr'd + bool msg_generated; // an appropriate msg was already mpr'd bool in_explosion_phase; // explosion phase (as opposed to beam phase) - bool smart_monster; // tracer firer can guess at other mons. resists? + bool smart_monster; // tracer firer can guess at other mons. resists? bool can_see_invis; // tracer firer can see invisible? 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 + 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 public: // A constructor to try and fix some of the bugs that occur because diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index 7a25308c5b..a16b8c6e88 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -2790,6 +2790,9 @@ void zap_wand(void) } const bool alreadyknown = item_type_known(wand); + if (!alreadyknown) + beam.effect_known = false; + const bool dangerous = player_in_a_dangerous_place(); if (alreadyknown) { @@ -2842,6 +2845,7 @@ void zap_wand(void) if (type_zapped == WAND_RANDOM_EFFECTS) { type_zapped = random2(16); + beam.effect_known = false; if (one_chance_in(20)) type_zapped = ZAP_NEGATIVE_ENERGY; if (one_chance_in(17)) diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index db752f011d..24078c4c8f 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -1003,6 +1003,8 @@ bool did_god_conduct( conduct_type thing_done, int level ) } break; + // If you make some god like these acts, modify did_god_conduct call + // in beam.cc with god_likes_necromancy check or something similar case DID_NECROMANCY: case DID_UNHOLY: case DID_ATTACK_HOLY: |