Dragon breath special procs (fwd)

From: Hades (tourach@cyber1.servtech.com)
Date: 12/04/95


Forwarded message:

Here's my suggestion as to how to change this and make it better.
Use a damage() call instead of call magic, that will automatically ignore
the no_magic zones.

> 	SPECIAL(dragon_fire)
> 	{
          struct char_data *dragon = (struct char_data *) me;
          /* this is so we can refrence the dragon */        

> 	  if (cmd || GET_POS(ch) != POS_FIGHTING)
> 	    return FALSE;
> 
> 	  /* Only breathe fire 20% of the time */
> 	  if (number(0, 4))
> 	    return FALSE; <- was TRUE.~
> 
> 	  /* We could actually pass GET_LEVEL(ch) instead of 0 for the level of the
> 	   * breath so we could have tougher dragons.  Right now, it does damage
> 	   * equal to a fireball in all cases.
> 	   */
>/* 	  call_magic(ch, NULL, NULL, SPELL_FIRE_BREATH, 0, CAST_BREATH); */
          damage(dragon, FIGHTING(dragon), <damage here>, 0);
> 	  return TRUE;
> 	}
> 


The damage() change above makes this portion of code unnecessary.
> --------------------------------------------------------------------------------
> spell_parser.c:
> 
>     I figured a dragon's breath is not a spell.  You may not have this opinion
>     so you're free to change it.
> 
>     Within call_magic(), replacing the ROOM_FLAGGED...ROOM_NOMAGIC code:
> 
> 	#ifdef	ORIGINAL
> 	  if (ROOM_FLAGGED(caster->in_room, ROOM_NOMAGIC)) {
> 	    send_to_char("Your magic fizzles out and dies.\r\n", caster);
> 	    act("$n's magic fizzles out and dies.", FALSE, caster, 0, 0, TO_ROOM);
> 	    return 0;
> 	  }
> 	#else
> 	  /* I want dragons to be able to breathe fire in NOMAGIC areas because it
> 	   * is more of an ability than a spell.  Note: if the person using the
> 	   * breath weapon is not an NPC, then the NOMAGIC affect still applies
> 	   * because I don't have any PC's with breath capabilities.
> 	   */
> 	  if (casttype != CAST_BREATH || (casttype == CAST_BREATH && !IS_NPC(caster))) {
> 	    if (ROOM_FLAGGED(caster->in_room, ROOM_NOMAGIC)) {
> 	      send_to_char("Your magic fizzles out and dies.\r\n", caster);
> 	      act("$n's magic fizzles out and dies.", FALSE, caster, 0, 0, TO_ROOM);
> 	      return 0;
> 	    }
> 	  }
> 	#endif
> 
>     Inside mag_assign_spells(), after SPELL_IDENTIFY:
> 
> 	#ifndef	ORIGINAL
> 	  /* Dragon breath */
> 	  spello(SPELL_FIRE_BREATH, 0, 0, 0, 0, 0, 0, 0,
> 		 POS_FIGHTING, TAR_IGNORE, TRUE, MAG_AREAS);
> 	  spello(SPELL_GAS_BREATH, 0, 0, 0, 0, 0, 0, 0,
> 		 POS_FIGHTING, TAR_IGNORE, TRUE, MAG_AREAS);
> 	  spello(SPELL_FROST_BREATH, 0, 0, 0, 0, 0, 0, 0,
> 		 POS_FIGHTING, TAR_IGNORE, TRUE, MAG_AREAS);
> 	  spello(SPELL_ACID_BREATH, 0, 0, 0, 0, 0, 0, 0,
> 		 POS_FIGHTING, TAR_IGNORE, TRUE, MAG_AREAS);
> 	  spello(SPELL_LIGHTNING_BREATH, 0, 0, 0, 0, 0, 0, 0,
> 		 POS_FIGHTING, TAR_IGNORE, TRUE, MAG_AREAS);
> 	#endif
> 
> 
> spells.h:
> 
>     In the CAST_* area:
> 
> 	#define CAST_UNDEFINED	-1
> 	#define CAST_SPELL	0
> 	#define CAST_POTION	1
> 	#define CAST_WAND	2
> 	#define CAST_STAFF	3
> 	#define CAST_SCROLL	4
> +	#ifndef	ORIGINAL
> +	#define CAST_BREATH	5
> +	#endif
> ================================================================================
> 
> A word (or words even) of warning: I would have to consider myself to be a
> novice CircleMUD programmer but in the same breath, I would have to say that
> I'm a very good C programmer (a decade of experience should allow me to say
> that in all modesty) so that might make up the difference.  Your opinion may
> differ after you've looked at my code. :)
> 
> All in all, I found this change to be rather easy.  I have to applaud
> Jeremy Elson for his code.  It was very nice to work with.  Nice internal
> documentation, easy to maintain, etc.
> 
> I think the Circle mailing list should attempt to finish off Jeremy's
> coding.doc file.  I think there should be enough knowledge here to allow us
> to do this.  And it would probably help a lot of newbie imps like myself to
> avoid introducing bugs into the code.
> 
> I hope this helps.
> 
> Keith Jones						keithjon@cuug.ab.ca
> 

Just my thoughts. Right now I'm trying to work on code that will allow you
to have dragons breathewithout the need for a spec_proc assignment for every
dragon. We have races on our mud, and one of the races is dragon (which is,
of course, assigned to the dragon mobs). My only problem is figuring out
which type of breath weapon the mud would determine it uses, without adding
another field to the mob memory structure. *shrug* I'm sure i'll get it
jammed out in an hour or so...

And if anyone out there remembers me asking for the code to make a tintin
type prompt (commands could be seperated by ;'s), I finished it in a few
hours after that because I got tired of not being able to do it. (Well...
*I* have tintin, but in my speaking mob code, I added fields to have the
mobs perform a command depending on certian things they said. If I wanted
them to perform more than one command, I needed to seperate it with ;'s
insetad of filling up memory with more linked lists.)

Hades of Ebon Mists



This archive was generated by hypermail 2b30 : 12/07/00 PST