On Tue, 7 Apr 1998, Thomas Smith wrote:
> one_argument(argument, arg);
/* Make sure they typed something! */
if (!*arg) {
send_to_char("You can't give first aid to nobody!\r\n", ch);
return;
}
/* Make sure they have the skill */
if (!GET_SKILL(ch, SKILL_AID)) {
send_to_char("You don't know how to do that!\r\n", ch);
return;
}
> if (!(vict = get_char_room_vis(ch, arg))) {
> send_to_char("Administer first aid to whom?\r\n", ch);
> return;
> }
/* snip */
> percent = number(1, 101); /* 101% is a complete failure */
> prob = GET_SKILL(ch, SKILL_AID);
>
> if (percent > prob) {
/* Save some memory. Lose the variables */
/* Replace the above three lines with the following one. */
if (number(1, 101) > GET_SKILL(ch, SKILL_AID))
Your function looked great, but you asked on how we might improve
on it, so there are the improvements that I would have made if I were to
use the function. I'd use the function too, but I already have it coded
under the name do_bind. :)
John Evans <evansj@hi-line.net> -- http://www.hi-line.net/~evansj/
Any sufficiently advanced technology is indistinguishable from magic.
--Arthur C. Clarke
+------------------------------------------------------------+
| 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/15/00 PST