Re: Kick

From: John Evans (evansj@HI-LINE.NET)
Date: 10/27/97


On Mon, 27 Oct 1997, Master's Realm wrote:

> Ok I've added a new class called Dark Warriors and I want them to be able
> to use kick I've added a thing where it says (GET_CLASS(ch) !=
> CLASS_DWARRIOR) in the beginning of do_kick and they still can't kick??
>
> Should I gust remove it so any class can kick?

I removed all checks on all classes on all skills. What I did was check
to make sure they have the skill. If they have the skill, then they can
try to kick. If they don't, then they can't even try.... Here's the code:

ACMD(do_kick)
{
  struct char_data *vict;

  if (!GET_SKILL(ch, SKILL_KICK)) {
    send_to_char("You'd better keep both feet on the ground.\r\n", ch);
    return;
  }

  [rest of function here]
}

All (well.. most) commands that rely upon a skill look like that at the
top. That way I can add a new class later on, or give a skill to a class
that didn't have that skill before and I don't have to change the code
for the skill to accomodate for the new class that has it.

The reason most skills are like that is because some races naturally have
the ability to do somethings even though their skill doesn't allow it.
Like gobins have a 10% chance of hiding while indoors even if they are a
barbarian or warrior.


John Evans <evansj@hi-line.net>

May the source be with you.


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



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