[CF-Devel] rodlike and wandlike items

Todd Mitchell temitchell at sympatico.ca
Sun Jul 14 21:01:41 CDT 2002


----- Original Message -----
From: "Mark Wedel" <
     
     mwedel at sonic.net
     
     >
To: <
     
     crossfire-devel at lists.real-time.com
     
     >
Sent: Sunday, July 14, 2002 6:20 PM
Subject: Re: [CF-Devel] rodlike and wandlike items


>
     
      Todd Mitchell wrote:
     
     >
     
      > I was checking out the code that returns messages for rods and wands and
     
     >
     
      > horns (in player.c) because I wanted to make an item that recharged like
     
     >
     
      > a rod.  Looking at the code the messages for ranged attacks are hard
     
     >
     
      > coded and there are case statements to spit them out depending on the
     
     >
     
      > item type.
     
     >
     
      > looks like this:
     
     >
     
     
     >
     
        The question is what are you trying to do?
     
     >
     
     
     >
     
      > It would allow for a whole bunch of new special items to be made which
     
     >
     
      > would be fun if not functionally too different.How about a magic stone
     
     >
     
      > of summoning or a teakettle of steambolt, or what I was trying to make
     
     >
     
      > 'Lythander's pipe of wonder' and 'Lythander's pipe of mass confusion'
     
     >
     
     
     >
     
        Note that just because an object is called 'rod' doesn't mean it has to
     
     look
>
     
      like a rod.  You could have a magic stone of summoning, whose type is rod.
     
     In
>
     
      that way, it behaves exactly like a rod.
     
     
Since the messages were hardcoded and type specific I was proposing a (I
thought) trivial change to address them.
I had no problem making items based on the rod or wand type, but the
messages were type specific
(the pipe of mass wonder was based on the horn and would say "no matter how
hard you try you can't get another note out" when it was out of power.)  I
was proposing a change to leave the type specific messages but have a
generic instance for other items based on the type but not of the same
appearance.  You don't want your 'jewel of summoning' to say "the wand says
poof" when it is out of charges or your 'snail idol of slow' to say "The rod
whines for a while, but nothing happens."

>
     
        Same can be true for wands (note staves are also of type wand).
     
     >
     
     
     >
     
        Note that with the new equipment change, rods/wands/horns all use the
     
     same
>
     
      range slot.  I've made a trivial change so that if a wand or rod is out of
     
     >
     
      charges, it is now like:
     
     >
     
     
     >
     
                   new_draw_info_format(NDI_UNIQUE, 0,op,"The %s says poof.",
     
     >
     
      query_base_name(item, 0));
     
     >
     
                 new_draw_info_format(NDI_UNIQUE, 0,op,
     
     >
     
                                    "The %s whines for a while, but nothing
     
     happens.",
>
     
      query_base_name(item,0))
     
     >
     
     
     >
     
        Horns is still a hard coded case in which it says you can't get another
     
     note
>
     
      out.  It should be mentioned except for that one message, horns and rods
     
     are
>
     
      pretty much functionally equivalant.
     
     >
     
     
     >
     
        So for what you want to do (lythanders pipe), probably just make them of
     
     type
>
     
      horn (I'm presuming they are things you blow through), and everything else
     
     >
     
      should work - no other code change necessary.
     
     
No the pipe was the smoking kind.  I knew you were changing the ranged code
so though I should bring this up. If you have modified the code to make
these messages more generic already then great.




    
    


More information about the crossfire mailing list