Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

YANI: Divination through Crystal Ball

20 views
Skip to first unread message

Kenneth Call

unread,
Nov 13, 2003, 10:22:03 PM11/13/03
to
A while back I had the idea that a PC could increase their divination
spellcasting by wielding a crystal ball while casting the spell. A
small patch I created to implete this idea simply adds a skill level
to their divination spellcasting ability. This doesn't seem
unbalancing as the PC would have to carry the (heavy) crystal ball to
what ever place they want to cast the spell. This most likely
objection may be to making it possible to cast the identify spell more
easily. In the games I have played with it I have not noticed it to be
unbalancing.

Even though this is a small patch, there are some obvious kludges. For
example I compare the spellskill type to
spell_skilltype(SPE_DETECT_FOOD) and I use pline instead of a you
function. Chalk that up to unfamiliarity with the source. If anyone
can improve this it would be great. I would like to hear what people
think of this idea, how it plays, and how the idea could be refined.

diff -n nethack-3.4.2/src/spell.c nethack-3.4.2-diff/src/spell.c
d806 1
a806 5
u.uen -= energy;
#ifdef WIELDBALL
if((uwep->otyp == CRYSTAL_BALL) && (spell_skilltype(spellid(spell))
== spell_skilltype(SPE_DETECT_FOOD)))
pline("You feel your mind expand as you focus on the crystal
ball.");
#endif
d1187 1
a1187 9
skill = P_SKILL(spell_skilltype(spellid(spell)));

#ifdef WIELDBALL
/* A player may focus through a crystal ball to increase their
chances
on a divination spell */
if((uwep->otyp == CRYSTAL_BALL) && (spell_skilltype(spellid(spell))
== spell_skilltype(SPE_DETECT_FOOD)))
skill += 1; /* make it as if they are more skilled */
#endif

Dylan O'Donnell

unread,
Nov 14, 2003, 5:17:47 AM11/14/03
to
arepa...@hotmail.com (Kenneth Call) writes:
> Even though this is a small patch, there are some obvious kludges. For
> example I compare the spellskill type to
> spell_skilltype(SPE_DETECT_FOOD)

Why not just check whether it's P_DIVINATION_SPELL directly?

> and I use pline instead of a you function.

You_feel("your mind expand as you focus on the crystal ball.");

> Chalk that up to unfamiliarity with the source. If anyone
> can improve this it would be great. I would like to hear what people
> think of this idea, how it plays, and how the idea could be refined.

The thing that I immediately spot it that you want to change your
uwep checks to 'if (uwep && uwep->otyp == ...'; otherwise you're likely
to have unpredictable results when casting spells barehanded.

(Also, do you want to make a check that you can see the crystal ball?
Use a specific naming function in case it's a "glass orb" to you, or
named? Have a cursed crystal ball _decrease_ your skill? Even have a
cross-classed Quest Artifact crystal ball blast you?)

--
: Dylan O'Donnell http://www.spod-central.org/~psmith/ :
: "Its habit of getting up late you'll agree / That it carries too far, :
: when I say / That it frequently breakfasts at five-o'clock tea / And :
: dines on the following day." -- Lewis Carroll, The Hunting of the Snark :

SmileyByte

unread,
Nov 14, 2003, 7:24:25 AM11/14/03
to
arepa...@hotmail.com (Kenneth Call) wrote in message news:<f8ce4eb9.03111...@posting.google.com>...

> A while back I had the idea that a PC could increase their divination
> spellcasting by wielding a crystal ball while casting the spell. A
> small patch I created to implete this idea simply adds a skill level
> to their divination spellcasting ability. This doesn't seem
> unbalancing as the PC would have to carry the (heavy) crystal ball to
> what ever place they want to cast the spell. This most likely
> objection may be to making it possible to cast the identify spell more
> easily. In the games I have played with it I have not noticed it to be
> unbalancing.

Very nice idea.

> Even though this is a small patch, there are some obvious kludges. For
> example I compare the spellskill type to
> spell_skilltype(SPE_DETECT_FOOD) and I use pline instead of a you
> function. Chalk that up to unfamiliarity with the source. If anyone
> can improve this it would be great. I would like to hear what people
> think of this idea, how it plays, and how the idea could be refined.

[snipped]
> (spell_skilltype(spellid(spell)) == spell_skilltype(SPE_DETECT_FOOD))

You can write this as:

(spell_skilltype(spellid(spell)) == P_DIVINATION_SPELL)


--
SmileyByte

Tars_Tarkas

unread,
Nov 14, 2003, 7:33:27 AM11/14/03
to
Kenneth Call wrote:
> A while back I had the idea that a PC could increase their divination
> spellcasting by wielding a crystal ball while casting the spell. A
> small patch I created to implete this idea simply adds a skill level
> to their divination spellcasting ability. This doesn't seem
> unbalancing as the PC would have to carry the (heavy) crystal ball to
> what ever place they want to cast the spell. This most likely
> objection may be to making it possible to cast the identify spell more
> easily. In the games I have played with it I have not noticed it to be
> unbalancing.

If anybody does find it unbalancing, you could just decrease the
probability of crystal balls... (Not that they're terribly common anyway).
--
GP_Spukgestalt, dwarvish Valkyrie, petrified by touching a cockatrice
corpse with her barehands.

David Damerell

unread,
Nov 14, 2003, 8:40:32 AM11/14/03
to
Dylan O'Donnell <psm...@spod-central.org> wrote:
>(Also, do you want to make a check that you can see the crystal ball?
>Use a specific naming function in case it's a "glass orb" to you, or
>named? Have a cursed crystal ball _decrease_ your skill? Even have a
>cross-classed Quest Artifact crystal ball blast you?)

Check if the crystal ball is charged, too. I wouldn't have it drain
charges because then this becomes basically useless, but an already
drained ball should not be useful.
--
David Damerell <dame...@chiark.greenend.org.uk> Kill the tomato!

Eric Wright

unread,
Nov 14, 2003, 8:59:03 AM11/14/03
to
arepa...@hotmail.com (Kenneth Call) wrote in message news:<f8ce4eb9.03111...@posting.google.com>...


Not commenting at all on game play issues, I have a few suggestions.
Originally, the variable skill corresponds to the class of spell, not
the caster's level of expertise. That's stored in role_skill. By
changing what is stored in skill (and removing role_skill) you open
yourself to incompatibilities with other parts of the code.

Also, you can just compare the skilltype with the predefined variable
P_DIVINATION_SPELL instead of comparing it to skilltype of Detect
food.

Look at these lines:

skill = spell_skilltype(pseudo->otyp);
role_skill = P_SKILL(skill);

The first calls spell_skilltype for the spell you want to cast.

int
spell_skilltype(booktype)
int booktype;
{
return (objects[booktype].oc_skill);
}

Checking objects.c, we see that the oc_skill field is populated with
constants like P_MATTER_SPELL, P_DIVINATION_SPELL, etc. This is then
passed into the next line P_SKILL(skill) which gets the player's skill
level for that class of spells. This is the variable we now want to
increment.

I'd suggest restoring the original lines setting skill and role_skill,
then using the following conditional:

if (uwep->otyp == CRYSTAL_BALL
&& skill == P_DIVINATION_SPELL
&& role_skill < P_EXPERT) role_skill +=1;

Here, the second check is a modification of your second check, while
the third one makes sure we don't have to worry about what casting
spells at P_MASTER skill would do. This way, role_skill holds the
modified skill level, and skill still holds the value for the class of
spell being cast.

Also, you can change the pline("You feel your mind...") to
You_feel("your mind...") to be more consistent with the rest of the
code.

As a fly in the ointment, have you changed the code that displays
spell failure rates to reflect the added bonus when wielding a crystal
ball?

Good luck!
E

Dylan O'Donnell

unread,
Nov 14, 2003, 9:36:17 AM11/14/03
to
ewr...@nc.rr.com (Eric Wright) writes:

[crystal ball divination spell boost patch]

> Not commenting at all on game play issues, I have a few suggestions.
> Originally, the variable skill corresponds to the class of spell, not
> the caster's level of expertise. That's stored in role_skill. By
> changing what is stored in skill (and removing role_skill) you open
> yourself to incompatibilities with other parts of the code.

The change to the 'skill' variable is being made to percent_success(),
where it means something different to the similarly-named variable
used in spelleffects().

(The patch may well be extended to change role_skill in the latter
function, as you outlined, so you get the skilled effect of a spell
(generally corresponding to a blessed potion/scroll) as well as just
the lowered failure rate; but it doesn't at present.)

Kenneth Call

unread,
Nov 14, 2003, 12:07:22 PM11/14/03
to
Thank you Dylan for pointing out the the means to fix the kludges.
This updated patch does the following:

If the crystal ball is cursed, the spell is blocked entirely and your
wisdom is abused.

If the crystal ball is an artifact that likes to blast you, it will
blast you when you use it.

You must not be blind or must be telepathic in order to receive the
bonus from the crystal ball.

Even though you must have enough energy to cast the spell, if you use
a blessed crystal ball, the actual engery used is reduced by a third.

diff --normal nethack-3.4.2/src/spell.c nethack-3.4.2-diff/src/spell.c
799c799,809
< if (confused || (rnd(100) > chance)) {
---
> #ifdef WIELDBALL
> /* if the crystal ball is cursed, then we block the divination spell completely; however
> * we do not tell the player this */
> if (confused || (rnd(100) > chance) || (uwep && uwep->otyp == CRYSTAL_BALL && uwep->cursed && spell_skilltype(spellid(spell)) == P_DIVINATION_SPELL)) {
> if(uwep && uwep->otyp == CRYSTAL_BALL && uwep->cursed && spell_skilltype(spellid(spell)) == P_DIVINATION_SPELL) {
> You_feel("your concentration break.");
> exercise(A_WIS, FALSE);
> }
> #else
> if (confused || (rnd(100) > chance)) {
> #endif
806c816,825
< u.uen -= energy;
---
>
> #ifdef WIELDBALL
> if((uwep && uwep->otyp == CRYSTAL_BALL) && (spell_skilltype(spellid(spell)) == P_DIVINATION_SPELL)) {
> You_feel("your mind expand as you focus on %s.",yname(uwep));
> touch_artifact(uwep,&youmonst); /* just get the blast effects */
> if(uwep->blessed)
> energy = (energy * 2) / 3; /* Using a blessed crystal ball you recoup 1/3 of your energy */
> }
> #endif
> u.uen -= energy;
1187c1206,1216
< skill = P_SKILL(spell_skilltype(spellid(spell)));
---


> skill = P_SKILL(spell_skilltype(spellid(spell)));
>
> #ifdef WIELDBALL
> /* A player may focus through a crystal ball to increase their chances
> on a divination spell */

> if((uwep && uwep->otyp == CRYSTAL_BALL) && (spell_skilltype(spellid(spell)) == P_DIVINATION_SPELL))
> if(!Blind || Blind_telepat || Unblind_telepat) /* The player must not be blinded or have
> * telepathy in order to use the crystal ball */

Kenneth Call

unread,
Nov 14, 2003, 1:34:37 PM11/14/03
to
psmit...@spod-central.org (Dylan O'Donnell) wrote in message news:<86isln3...@strackenz.spod-central.org>...

> ewr...@nc.rr.com (Eric Wright) writes:
>
> [crystal ball divination spell boost patch]
>
> > Not commenting at all on game play issues, I have a few suggestions.
> > Originally, the variable skill corresponds to the class of spell, not
> > the caster's level of expertise. That's stored in role_skill. By
> > changing what is stored in skill (and removing role_skill) you open
> > yourself to incompatibilities with other parts of the code.
>
> The change to the 'skill' variable is being made to percent_success(),
> where it means something different to the similarly-named variable
> used in spelleffects().
>
> (The patch may well be extended to change role_skill in the latter
> function, as you outlined, so you get the skilled effect of a spell
> (generally corresponding to a blessed potion/scroll) as well as just
> the lowered failure rate; but it doesn't at present.)


As I first conceived this a crystal ball enhances your ability to cast
a divination spell. Making the change in percent_success() works very
nicely; you can even see the changes reflected in the Zap menu.

Should a player be able to cast the skilled effect of a spell using a
crystal ball? Role-playing wise I can see it both ways. On the one
hand, wielding a crystal ball doesn't actually improve your skill, it
only aids in the casting. On the other hand, making the spell easier
to cast may open up possiblities to lesser skilled players. I am
disinclined to believe a crystal ball will allow you to cast skilled
effect spells when you other could not.

This does not really make musch difference. There are two spells in
the divination family that have skilled effects -- detect food and
detect monsters. The skilled effects in certain circumstances could be
useful; they have effects that extend beyond one turn. It may be
worthwhile to have a crystal ball aid in making skilled effects, but
from a roleplaying point of view, I would require that the crystal
ball must be continuously wielded. Once the ball is unwielded the
continued effect is lost. Coding that would probably be more involved.

Kenneth Call

0 new messages