Unfortunately, that didn't work because ROM doesn't define punches as
TYPE_HIT. So what I did is:
/*
* Figure out the type of damage message.
*/
wield = get_eq_char (ch, WEAR_WIELD);
if (dt == TYPE_UNDEFINED)
{
dt = TYPE_HIT;
if (wield != NULL && wield->item_type == ITEM_WEAPON)
dt += wield->value[3];
else
/* dt += ch->dam_type; This is the line that used to be here, I
replaced it with the following*/
switch(ch->race)
{
default: dt += ch->dam_type; break; /*normal*/
case 4: dt += 8; break; /*Giant*/
case 5: dt += 10; break; /* Canine */
case 6: dt += 5; break; /* Feline */
/* Rest ch->dam_type by default */
}
}
Works great.
Thanks for your help; without it, I never would have thought of the above.
----- Original Message -----
From: "Jeremy Hill" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Monday, March 11, 2002 3:53 AM
Subject: Re: QuickMUD, plus a question.
> Oh my, that would work marvelously, wouldn't it?. How excellent. Thank
you
> for your assistance--I'll let you know how it turns out. I'm going to use
> the first demonstration, because I have others coders working on the same
> source, so if they decided to add a race and forgot to add the .vs and
.vp,
> well.. yeah. Using the switch case, if they forgot, the race would just
> punch.
>
> Again, thank you for your help.
>
> Jeremy Hill
>
> ----- Original Message -----
> From: "Michael Pittaway" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, March 11, 2002 12:30 AM
> Subject: Re: QuickMUD, plus a question.
>
>
> > Now, I'm not quite sure I understood what you wanted to do, but this is
> what
> > I would do.
> >
> > In fight.c, after all the other dam messages are assigned, there is a
line
> > that looks like this:
> >
> > punct = (dam <= 24) ? '.' : '!';
> >
> > Right before this line, I would put:
> >
> > if (get_eq_char(ch, WEAR_WIELD) == NULL)
> > {
> > switch(ch->race)
> > {
> > default: vs = "punch"; vp = "punches"; break;
> > case 0: vs = "claw"; vp = "claws"; break; /* Race 0 */
> > case 1: vs = "kick"; vp = "kicks"; break; /* Race 1 */
> > /* Etc. Etc. Etc. Keep adding for all your races. */
> > }
> > }
> >
> > Or, as an alternative, you could add two new items to the pc_race_table,
> one
> > being "claw", the other being "claws" or whatever it would be for each
> race,
> > and then instead of the previous code, make it:
> >
> > if (get_eq_char(ch, WEAR_WIELD) == NULL)
> > {
> > vs = str_dup(race_table[ch->race].vs);
> > vp = str_dup(race_table[ch->race].vp);
> > }
> >
> > I hope that's what you wanted to accomplish. If not, give me another
> example
> > and I can try to help you.
> >
> > _________________________________________________________________
> > Send and receive Hotmail on your mobile device: http://mobile.msn.com
> >
>
>
> --
> ROM mailing list
> [email protected]
> http://www.rom.org/cgi-bin/mailman/listinfo/rom
>