Riverdale's Tables

From Redwall MUCK Wiki

Tables by Riverdale

This MPI code allows a room to have a set of tables that beasts can sit at and speak to only the other beasts at the table. This code -may- be bugged in that it doesn't handle departures from the room without quitting the table first.

@act tables=here

@link tables=$nothing

@succ tables=

{null:{tell:You search the room for available tables:\r\r}}

{if:{subst:{listprops:tables/,here},tables/,},{null:{foreach:table,{subst:{listprops:tables/,here},tables/,},{null:{tell:{left:{&table},20}--  {count:{subst:{listprops:{&table}/,here},{&table}/,}}/{prop:tables/{&table},here}}}}},{center:-=No Tables available here=-}}

@act tables #add;table #add=here

@link tables #add=$nothing

@lock tables #add=me

@fail tables #add=Permission Denied.

@succ tables #add=

{with:tablename,{midstr:{&arg},1,{subt:{instr:{&arg},=},1}},{with:mxcap,{midstr:{&arg},{add:{instr:{&arg},=},1},-1},{if:{&arg},{if:{&tablename},{if:{&mxcap},{if:{isnum:{&mxcap}},{if:{ne:{lmember:{subst:{listprops:tables/,here},tables/,},{&tablename}},0},That is already a table here!,You add the table {&tablename} to this room with the maximum capacity of {abs:{&mxcap}}. {null:{store:{abs:{&mxcap}},tables/{&tablename},here}}},Please provide a numeric value for the maximum capacity of {&tablename}.},Please specify the maximum capacity of your table. ({&cmd} {&tablename}=)},Please provide a name for your table.},{toupper:{midstr:{&cmd},1}}{midstr:{&cmd},2,-1} (by Riverdale) - Syntax: {&cmd} =}}}

@act tables #remove;table #remove=here

@link tables #remove=$nothing

@lock table #remove=me

@fail table #remove=Permission Denied.

@succ table #remove=

{if:

 {&arg},

 {if:

  {ne:{lmember:{subst:{listprops:tables/,here},tables/,},{&arg}},0},

  {if:

   {ge:{count:{subst:{listprops:{&arg}/,here},{&arg}/,}},1},

   There are players sitting there!,

   You remove the table {&arg} from the room.{null:{delprop:tables/{&arg},here}}

  },

  That table is not here.

 },

 {toupper:{midstr:{&cmd},1}}{midstr:{&cmd},2,-1} - Syntax: {&cmd}

}

@act sit at=here

@link sit at=$nothing

@succ sit at=

{if:{&arg},{if:{ne:{lmember:{subst:{listprops:tables/,here},tables/,},{&arg}},0},{if:{ge:{count:{subst:{listprops:{&arg}/,here},{&arg}/,}},{prop:tables/{&arg},here}},That table is already full!,{if:{prop:sit/{name:me},here},You are already sitting at {prop:sit/{name:me},here}! You cannot sit at more than one table at a time.,You sit down at the {&arg}. {null:{store:{&arg},sit/{name:me},here},{otell:{name:me} sits down at {&arg}.},{foreach:var,{subst:{listprops:{&arg}/,here},{&arg}/,},{tell:{name:me} joins this table.,{&var}}},{store:yes,{&arg}/{name:me},here}}}},That is not a table here.},Sit at (by Riverdale) - Syntax: Sit at

}

@act stand up=here

@link stand up=$nothing

@succ stand up=

{if:{prop:sit/{name:me},here},You stand up from {prop:sit/{name:me},here}. {null:{foreach:var,{subst:{listprops:{prop:sit/{name:me},here}/,here},{prop:sit/{name:me},here}/,},{if:{ne:{&var},{name:me}},{tell:{name:me} stands up from this table.,{&var}}}},{otell:{name:me} stands up from {prop:sit/{name:me},here}.},{delprop:{prop:sit/{name:me}}/{name:me},here}{delprop:sit/{name:me},here}},You are not sitting down!}

@act tsay;tsa;ts;tt=here

@link tsay=$nothing

@succ tsay=

{if:{prop:sit/{name:me},here},You say "{&arg}" across the table. {null:{foreach:person,{subst:{listprops:{prop:sit/{name:me},here}/,here},{prop:sit/{name:me},here}/,},{if:{ne:{&person},{name:me}},{tell:{name:me} says\, "{&arg}" across the table.,{ref:{&person}}}}}},You are not sitting at a table!}

@act twho=here

@link twho=$nothing

@succ twho=

{if:{&arg},{if:{ne:{lmember:{subst:{listprops:tables/,here},tables/,},{&arg}},0},{null:{tell:You check to see who's sitting at {&arg}:\r\r}}{null:{foreach:person,{subst:{listprops:{&arg}/,here},{&arg}/,},{tell:{left:{&person},20}  --  {if:{ne:{idle:{&person}},-1},AWAKE,ASLEEP}}}},That is not a table here.},{if:{prop:sit/{name:me},here},{null:{tell:You check to see who's sitting at this table with you:\r\r}}{null:{foreach:person,{subst:{listprops:{prop:sit/{name:me},here}/,here},{prop:sit/{name:me},here}/,},{tell:{left:{&person},20}  -- {if:{ne:{idle:{&person}},-1},AWAKE,ASLEEP}}}},Which table do you wish to check?}}

@act tpose;tpos;tpo;tp=here

@link tpose=$nothing

@succ tpose=

{if:{prop:sit/{name:me},here},{null:{foreach:person,{subst:{listprops:{prop:sit/{name:me},here}/,here},{prop:sit/{name:me},here}/,},{tell:{name:me} {&arg} (across the table),{ref:{&person}}}}},You are not sitting at a table!}

@act twhisper=here

@link twhisper=$nothing

@succ twhisper=

{with:person,{midstr:{&arg},1,{subt:{instr:{&arg},=},1}},{with:message,{midstr:{&arg},{add:{instr:{&arg},=},1},-1},{if:{&arg},{if:{&person},{if:{&message},{if:{prop:sit/{name:me},here},{if:{ne:{lmember:{subst:{listprops:{prop:sit/{name:me},here}/,here},{prop:sit/{name:me},here}/,},{&person}},0},{if:{ne:{idle:{&person}},-1},You whisper to {name:{&person}} across the table\, "{&message}"{null:{tell:{name:me} whispers to you across the table\, "{&message}",{&person}},{foreach:var,{subst:{listprops:{prop:sit/{name:me},here}/,here},{prop:sit/{name:me},here}/,},{if:{and:{ne:{&person},{&var}},{ne:{&var},{name:me}}},{tell:{name:me} whispers something across the table to {&person},{&var}}}}},That person is not awake!},That person is not sitting at your table!},You are not sitting at a table!},What do you want to whisper?},To whom do you wish to whisper?},Twhisper (by Riverdale) - Syntax: twhisper =}}}

- Clears seats -

Exit success setting

@set #194413=_odepart:{if:{prop:sit/{name:me},here},<> You depart where you were sitting <> {delprop:{prop:sit/{name:me},here}/{name:me},here}{delprop:sit/{name:me},here},}

@set #194413=_depart:,#194413},<> You depart and leave your table. <> {delprop:{prop:sit/{name:me},#194413}/{name:me},#194413}{delprop:sit/{name:me},#194413},<> You depart the tavern. <>}

See Also