[CF-Devel] rodlike and wandlike items

Mark Wedel mwedel at sonic.net
Sun Jul 14 17:20:34 CDT 2002


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.

  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.



    
    


More information about the crossfire mailing list