Race Object

This object was originally conceived to handle random scores for the Weyr Games, but it has many other uses.

@create Race Object=10

@Desc Race Object=A course has been laid out for a race.%r%r+------------------------------------------------------------------------------+%rTo join the race, type '+join'. Each round type '+move'. A randomizer will @pemit you the value of your movement (between 1 and 10) and store it in the object for officiating use. +clear can be used to clear the list of participants and +remove <participant> can be used to remove a particular participant.%r+------------------------------------------------------------------------------+

&CMD_JOIN Race Object=$+join:&[name(edit(%#,%b,-))] #11663=0;&playerlist #11663=cat(v(playerlist),[name(edit(%#,%b,-))]);@emit [name(edit(%#,%b,-))] has joined the race.

&CMD_MOVE Race Object=$+move:&last_roll #11663=[add(1,[rand(9)])];&[name(edit(%#,%b,-))] #11663=[add([u([name(edit(%#,%b,-))])],[u(last_roll)])];@emit [name(edit(%#,%b,-))] moves foreward [u(last_roll)] meters;@pemit #5830=[name(edit(%#,%b,-))] is now at [u([name(edit(%#,%b,-))])]

&CLEAR_CMD Race Object=$+clear:&last_roll #11663=;&playerlist #11663=

&REMOVE_CMD Race Object=$+remove *:&%0 #11663=;@pemit %0=You have been removed from the race;@pemit %#=%0 has been removed from the race

@set Race Object=OPAQUE

@set Race Object=COMMANDS

ryni

Page tags: code
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License