diff options
author | Jude Brown <bookofjude@users.sourceforge.net> | 2010-01-06 23:01:04 +1000 |
---|---|---|
committer | Jude Brown <bookofjude@users.sourceforge.net> | 2010-01-06 23:12:01 +1000 |
commit | 65df1b1f5ffe872e5baa3eb8611c0335f944b4cf (patch) | |
tree | 72f7025d9b382be265e9a67c189ec9847e673596 | |
parent | 2d0a1ea0721bc45e7d15b9c180b9c7af8ff629df (diff) | |
download | crawl-ref-65df1b1f5ffe872e5baa3eb8611c0335f944b4cf.tar.gz crawl-ref-65df1b1f5ffe872e5baa3eb8611c0335f944b4cf.zip |
Saving throws for new needle brands (syllogism, Twinge, others).
The current needle brands are overpowered in the fact that you can
practically paralyse or confuse anyone (including Cerebov) with little
or no effort.
Twinge has kindly provided a workable formula: it includes a 2% chance
of automatically applying the brand to monsters with less than 15 HD.
The raw formula is:
2 + random2(4 + throwing skill + blowgun to_hit) > monster HD.
Twinge also provided the following statistics of success: With no skill
you're still at 100% to proc on HD1 or HD2 (gnoll, D1 monsters), 75% on
HD3 (Sigmund), 50% on HD4 (Divessa), and 25% on HD5 (ogre). With say 4
skills as an early Assassin, you're up to 56% on an Ogre, or 33% on a
Yak.
We still may need to investigate the possibility of resistances; with
this code, there is still a chance of confusing or paralysing Cerebov,
but one would need a high Throwing skill and an extensively enchant
blowgun to achieve.
Eronarn has suggested re-using the multiple levels of resist poison, or
possibly using a new type of multi-level resistance to "organic
compounds".
Finally, descriptions will need to be updated somewhere to include
information about high skills and enchantments allowing you to overcome
monsters' resistances; this currently does not include poison or curare,
though.
-rw-r--r-- | crawl-ref/source/item_use.cc | 50 |
1 files changed, 49 insertions, 1 deletions
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index 18fd2cd266..221da69184 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -1890,7 +1890,7 @@ static bool _blessed_hit_victim(bolt &beam, actor* victim, int &dmg, int _blowgun_power_roll (bolt &beam) { actor* agent = beam.agent(); - int base_power = 1; + int base_power = 0; int blowgun_base = 0; if (agent->atype() == ACT_MONSTER) @@ -1908,12 +1908,45 @@ int _blowgun_power_roll (bolt &beam) return (base_power + blowgun_base); } +bool _blowgun_check (bolt &beam, actor* victim, bool message = true) +{ + actor* agent = beam.agent(); + + if (agent->atype() == ACT_MONSTER) + return (true); + + monsters* mons = static_cast<monsters*>(victim); + + int skill = you.skills[SK_THROWING]; + int enchantment = (you.weapon())->plus; + + // You have a really minor chance of hitting with no skills or good + // enchants. + if (mons->hit_dice < 15 && random2(100) <= 2) + return (true); + + int resist_roll = 2 + random2(4 + skill + enchantment); + + dprf("Brand rolled %d against monster HD: %d.", resist_roll, mons->hit_dice); + + if (resist_roll < mons->hit_dice) + { + simple_monster_message(mons, " resists!"); + return (false); + } + + return (true); +} + static bool _paralysis_hit_victim (bolt& beam, actor* victim, int dmg, int corpse) { if (beam.is_tracer) return (false); + if (!_blowgun_check(beam, victim)) + return (false); + int blowgun_power = _blowgun_power_roll(beam); victim->paralyse(beam.agent(), 5 + random2(blowgun_power)); return (true); @@ -1925,6 +1958,9 @@ static bool _sleep_hit_victim (bolt& beam, actor* victim, int dmg, if (beam.is_tracer) return (false); + if (!_blowgun_check(beam, victim)) + return (false); + int blowgun_power = _blowgun_power_roll(beam); victim->put_to_sleep(beam.agent(), 5 + random2(blowgun_power)); return (true); @@ -1936,6 +1972,9 @@ static bool _confusion_hit_victim (bolt &beam, actor* victim, int dmg, if (beam.is_tracer) return (false); + if (!_blowgun_check(beam, victim)) + return (false); + int blowgun_power = _blowgun_power_roll(beam); victim->confuse(beam.agent(), 5 + random2(blowgun_power)); return (true); @@ -1947,6 +1986,9 @@ static bool _slow_hit_victim (bolt &beam, actor* victim, int dmg, if (beam.is_tracer) return (false); + if (!_blowgun_check(beam, victim)) + return (false); + int blowgun_power = _blowgun_power_roll(beam); victim->slow_down(beam.agent(), 5 + random2(blowgun_power)); return (true); @@ -1958,6 +2000,9 @@ static bool _sickness_hit_victim (bolt &beam, actor* victim, int dmg, if (beam.is_tracer) return (false); + if (!_blowgun_check(beam, victim)) + return (false); + int blowgun_power = _blowgun_power_roll(beam); victim->sicken(40 + random2(blowgun_power)); return (true); @@ -1969,6 +2014,9 @@ static bool _rage_hit_victim (bolt &beam, actor* victim, int dmg, if (beam.is_tracer) return (false); + if (!_blowgun_check(beam, victim)) + return (false); + victim->go_berserk(false); return (true); } |