[MUD-Dev] Re: WIRED: Kilers have more fun

quzah quzah at geocities.com
Fri Jul 24 18:53:29 CEST 1998


-----Original Message-----
From: Caliban Tiresias Darklock <caliban at darklock.com>
To: mud-dev at kanga.nu <mud-dev at kanga.nu>
Date: Friday, July 24, 1998 3:59 PM
Subject: [MUD-Dev] Re: WIRED: Kilers have more fun

[cut a bit]

>Every player has a single rank point. Each player can at his option swear
>allegiance to another player. When he swears allegiance to another player,
>that player acts as though his current total is the sum of his own points
>plus the other players, so you have something like this: Bob, Jim, and Joe
>swear allegiance to Pete. Sam, Ed, and Warren swear allegiance to Bob. Pete
>swears allegiance to Max. So Pete has a total of four RPs (Bob + Jim + Joe
>+ Pete), and then when Sam, Ed, and Warren swear to Bob he also has four
>RPs. As a result, Pete's total goes up to seven, since Bob's has gone up by
>three. Max therefore has a total of eight RPs.
>
>Now what I haven't figured out yet is how to deal with it if Max swears
>allegiance to Joe. Joe's total goes to nine; Pete's goes to fifteen; Max's
>goes to sixteen. Max's total has gone up by eight, so Joe's total goes to
>seventeen, and Pete's goes to 23, and Max's to 24, and then Joe's to 25...
>I don't know right offhand how to stop this.
>
>I'll be thinking about this for quite some time. ;)

If I'm reading this correctly, you are trying to avoid this:
A swears_to-> B, B swears_to-> C, C swears_to-> D, D swears_to-> A.

Something like:

void do_swear( characterStuff *c, stringOfWords *argument ) {
   characterStuff toSwearTo;
   ...
   [determined that the argument is a person that's around,
    and that we want to swear to them.]
   if( toSwearTo == find_subordinates( toSwearTo )) {
      output_to_character( "You cannot swear to a subordinate." c );
   }
   ...
}

Now then, I'm not sure how you were  planning on storing your
information of who's sworn to who, but in this sample, my idea
is a linked list of your subordinates, and the function
"find_subordinates( characterStuff *subordinate )" would just
run the list and to see if the subordinate is in the list.

I'm sure there is an easier way to do it, but this is what came
to my feeble mind :)

-Q-






More information about the mud-dev-archive mailing list