-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathGrid Manager - GRID.txt
92 lines (54 loc) · 12.8 KB
/
Grid Manager - GRID.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
@@ DEPENDENCIES: Core, Ancestor Room
@@ @lock/enter is not inherited in Rhost. You'll need to set your @locks more carefully in Rhost.
th u(NEWCOBJ,Grid Manager <GRID>,grid,,,,WIZARD SAFE !NO_COMMAND,INHERIT SIDEFX SAFE)
th u(NEWCOBJ,District Parent <DISTRICT>,district,u(cobj,grid),u(cobj,ancestor_room),,WIZARD SAFE,INHERIT SIDEFX SAFE)
&D`GRID [u(cobj,district)]=1
@select/inline %va=PennMUSH,{@lock/enter [u(cobj,district)]=FUN`ENTER/1;@lset [u(cobj,district)]/enter=!no_inherit;@lock/teleport [u(cobj,district)]=FUN`TELEPORT/1;@lset [u(cobj,district)]/teleport=!no_inherit},RhostMUSH,{@lock/tport [u(cobj,district)]=FUN`TELEPORT/1}
&FUN`ENTER [u(cobj,district)]=[vol_approved(%#)]
&FUN`TELEPORT [u(cobj,district)]=[vol_approved(%#)]
&CMD`+GRID`PENNMUSH [u(cobj,grid)]=$^(?s)\+(grid|district)(?\:/(\S+)?)?(?\: +(.+?))?(?\:=(.*))?$:@attach %!/CMD`+GRID`MAIN
@set [u(cobj,grid)]/CMD`+GRID`PENNMUSH=regexp
&CMD`+GRID`RHOSTMUSH [u(cobj,grid)]=$^(?s)\+(grid|district)(?\:/(\\S+)?)?(?\: +(.+?))?(?\:=(.*))?$:@attach %!/CMD`+GRID`MAIN
@set [u(cobj,grid)]/CMD`+GRID`RHOSTMUSH=regexp
&CMD`+GRID`MAIN [u(cobj,grid)]=@attach %!/INC`GETSWITCH=%2;@attach %!/INC`[u(strfirstof,%q<switch>,MAIN)]=%3,%4
@set [u(cobj,grid)]/CMD`+GRID`[u(choosegame,RHOSTMUSH,PENNMUSH)]=no_command
&SWITCHES`PLAYER [u(cobj,grid)]=LOCK|UNLOCK|DESCRIBE|IC
&SWITCHES`ADMIN [u(cobj,grid)]=
&SWITCHES`WIZARD [u(cobj,grid)]=CREATE|DESTROY|MOVE|SUBCREATE|RENAME|ORDER|LOCK|RAWLOCK|UNLOCK|COLOR
&COLOROPTIONS [u(cobj,grid)]=EXITALIAS|EXITNAME|EXITWRAP|EXITDEST|BORDER|HEADER_STAR|HEADER_TEXT
&SYSTEM`SWITCHES [u(cobj,grid)]=setunion(setunion(v(SWITCHES`PLAYER),if(u(isadmin,%#),v(SWITCHES`ADMIN)),|,|),if(u(iswizard,%#),v(SWITCHES`WIZARD)),|,|)
&SYSTEM`NAME [u(cobj,grid)]=GRID
&FUN`LISTDISTRICTS [u(cobj,grid)]=u(sortname,u(filter,ISDIST,children(%0)))
&FUN`DIST_ANCESTORS [u(cobj,grid)]=u(filter,ISDIST,revwords(u(choosegame,lparent(%0),parents(%0))))
&FUN`CHAIN [u(cobj,grid)]=iter(u(FUN`DIST_ANCESTORS,%0) %0,u(getmoniker,%i0),%b,switch(%1,1,/,2,[chr(44)]%b,%b-%b))
&FIL`ISDIST [u(cobj,grid)]=cand(hastype(%0,THING),get(%0/D`DISTRICT))
&FIL`NOTDIST [u(cobj,grid)]=not(u(FIL`ISDIST,%0))
&INC`MAIN [u(cobj,grid)]=@select/inline strlen(%0)=>0,{@attach %!/INC`CHOOSE},{@attach %!/INC`LIST}
&INC`LIST [u(cobj,grid)]=@pemit %#=u(HEADER,mudname() District Parents);@pemit %#=ansi(u(color,%#,COLUMN_NAMES),align(5 2 26 9 33,DBREF,IC,Name,Rooms,Description));@pemit %#=u(SEPARATOR);@dolist/inline u(FUN`LISTDISTRICTS,u(cobj,district))={@attach %!/INC`DISTRICTLINE=##,0};@pemit %#=u(FOOTER)
&INC`DISTRICTLINE [u(cobj,grid)]=th [u(setq,subs,u(FUN`LISTDISTRICTS,%0))];@pemit %#=[align(5 2 26 9 33,u(pueblize,ansi(if(controls(%#,%0),hg,hr),num(%0)),+district [u(setr,distn,u(FUN`DISTNAME,%0))]),default(%0/D`IC,0),[if(%1,space(mul(%1,2))-%B)][u(pueblize,name(%0),+district %q<distn>)],sub(u(nchildren,%0),words(%q<subs>)),default(%0/DESCRIBE,???))];@dolist/inline %q<subs>=@attach %!/INC`DISTRICTLINE=u(choosegame,%i0,%d0),add(1,%1),words(%q<subs>)
&FUN`DISTRICTLINE [u(cobj,grid)]=[u(setq,subs,u(FUN`LISTDISTRICTS,%0))][align(5 2 26 9 33,u(pueblize,ansi(if(controls(%#,%0),hg,hr),num(%0)),+district [u(setr,distn,u(FUN`DISTNAME,%0))]),default(%0/D`IC,0),[if(%1,space(mul(%1,2))-%B)][u(pueblize,name(%0),+district %q<distn>)],sub(u(nchildren,%0),words(%q<subs>)),default(%0/DESCRIBE,???))][if(words(%q<subs>),%R[iter(%q<subs>,u(FUN`DISTRICTLINE,%i0,add(1,%1),words(%q<subs>)),%B,%R)])]
&FUN`DISTNAME [u(cobj,grid)]=iter(after(revwords(lparent(%0)),num(u(cobj,district))),name(%i0),%b,/)
&INC`CHOOSE [u(cobj,grid)]=@attach %!/INC`FINDDIST=%0;@check cor(u(isadmin,%#),controls(%#,%q<dist>))=@attach %!/INC`MSG=ERROR: Permission denied.;@attach %!/INC`MSG=Now managing district %q<distname>.;&D`DISTRICT %#=%q<dist>
&INC`CREATE [u(cobj,grid)]=@attach %!/INC`MAKEDISTRICT=%0,u(cobj,district);@attach %!/INC`MSG=District Created! You have been set to managing it.;&D`DISTRICT %#=%q<dist>;@attach %!/INC`MSG`CHAN={Created District %q<dist> '[name(%q<dist>)]'}
&INC`SUBCREATE [u(cobj,grid)]=@attach %!/INC`FINDDIST=%0,1;@attach %!/INC`MAKEDISTRICT=%1,%q<dist1>,2;@attach %!/INC`MSG=sub-District Created! You have been set to managing it.;&D`DISTRICT %#=%q<dist2>;@attach %!/INC`MSG`CHAN={Created sub-District %q<dist2> '[name(%q<dist2>)]' for %q<dist1> '[name(%q<dist1>)]'}
&INC`VALID`DISTRICT [u(cobj,grid)]=@check strlen(u(setr,value,trim(%0)))=@attach %!/INC`MSG=ERROR: District name empty.;@check valid(name,%q<value>)=@attach %!/INC`MSG=ERROR: '%0' is not a valid object name.;@stop strmatch(%q<value>,root)=@attach %!/INC`MSG=ERROR: "root" is not an acceptable district name.;@stop strmatch(%q<value>,*/*)=@attach %!/INC`MSG=ERROR: "/" is not allowed in district names.;@stop cand(u(setr,found,u(find_in,%1,%q<value>)),not(strmatch(%q<found>,%2)))=@attach %!/INC`MSG=ERROR: A same-level District already uses that name.
&INC`MAKEDISTRICT [u(cobj,grid)]=@attach %!/INC`VALID`DISTRICT=%0,%1;@check isdbref(u(setr,dist%2,create(%q<value>)))=@attach %!/INC`MSG=ERROR: Could not create district.;@tel r(dist%2)=%1;@parent r(dist%2)=%1;th u(attrib_set,r(dist%2),D`DISTRICT,1);@set r(dist%2)/D`DISTRICT=no_inherit
&INC`MOVE [u(cobj,grid)]=@attach %!/INC`FINDDIST=%0,1;@attach %!/INC`FINDDIST=%1,2;@attach %!/INC`VALID`DISTRICT=name(%q<dist1>),%q<dist2>;@parent %q<dist1>=%q<dist2>;@attach %!/INC`MSG=District %q<distname1> assigned to %q<distnames2>!;@attach %!/INC`MSG`CHAN=Assigned %q<distname1> to: %q<distnames2>
&INC`RENAME [u(cobj,grid)]=@attach %!/INC`FINDDIST=%0;@attach %!/INC`VALID`DISTRICT=%1,parent(%q<dist>);@attach %!/INC`MSG=District Renamed!;@attach %!/INC`MSG`CHAN={Renamed District %q<dist> '%q<distname>' to '%q<value>'};@name %q<dist>=%q<value>
&INC`DESCRIBE [u(cobj,grid)]=@attach %!/INC`FINDDIST=%0;@check cor(u(isadmin,%#),controls(%#,%q<dist>))=@attach %!/INC`MSG=ERROR: Permission denied.;@check strlen(%1)=@attach %!/INC`MSG=ERROR: Nothing entered for the description!;@attach %!/INC`MSG=Description set.;@describe %q<dist>=%1;@attach %!/INC`MSG`CHAN={Changed Description for %q<dist> '%q<distname>'}
&INC`COLOR [u(cobj,grid)]=@attach %!/INC`FINDDIST=%0;@check cor(u(isadmin,%#),controls(%#,%q<dist>))=@attach %!/INC`MSG=ERROR: Permission denied.;@attach %!/INC`PARTIAL=before(%1,\,),v(COLOROPTIONS),|,choice,Color Type;@attach %!/INC`VALID`COLOR=after(%1,\,);th u(attrib_set,%q<dist>,DISTCOLOR`%q<choice>,%q<value>);@attach %!/INC`MSG`CHAN={Changed Color/%q<choice> for %q<dist> to '%q<valueformat>'}
&INC`IC [u(cobj,grid)]=@attach %!/INC`FINDDIST=%0;@check cor(u(isadmin,%#),controls(%#,%q<dist>))=@attach %!/INC`MSG=ERROR: Permission denied.;@attach %!/INC`VALID`BOOL=%1;@attach %!/INC`MSG=IC value set.;&D`IC %q<dist>=%q<value>;@attach %!/INC`MSG`CHAN={Changed IC for %q<dist> to '%q<value>'}
&INC`ORDER [u(cobj,grid)]=@attach %!/INC`FINDDIST=%0;@check strlen(%1)=@attach %!/INC`MSG=ERROR: Order value empty.;@check valnum(%1)=@attach %!/INC`MSG=ERROR: Order values must be whole, positive numbers.;&ORDER %q<dist>=%1;@set %q<dist>/ORDER=no_inherit;@attach %!/INC`MSG=Order set.;@attach %!/INC`MSG`CHAN={Changed order for %q<dist> '%q<distname>'}
&INC`FINDDIST [u(cobj,grid)]=@check strlen(%0)=@attach %!/INC`MSG=ERROR: No District entered to check.;th u(setq,dist%1,u(cobj,district));@select/inline strlen(%0)=0,{@@ We're sticking with the root district!},{@dolist/inline/delimit / %0={th u(setq,dname,trim(u(choosegame,%i0,%d0)));@check words(u(setr,dist%1,u(namegraball,u(FUN`LISTDISTRICTS,r(dist%1)),%q<dname>)))=@attach %!/INC`MSG=ERROR: District '%q<dname>' not found.;@stop gt(words(r(dist%1)),1)=@attach %!/INC`MSG=ERROR: '%q<dname>' matched [u(itemize,iter(r(dist%1),u(pueblize,name(%i0),+district %i0),%b,|),|,and,\,)]. Please be more specific!;th u(setq,distname%1,name(r(dist%1)));th u(setq,alldists%1,);th u(setq,alldists%1,cat(r(alldists%1),r(dist%1)))}};th u(setq,distnames%1,iter(r(alldists%1),u(getmoniker,%i0),%b,ansi(hy,/)));
&INC`RAWLOCK [u(cobj,grid)]=@attach %!/INC`LOCK=%0,%1,1
&INC`LOCK [u(cobj,grid)]=@attach %!/INC`FINDDIST=%0;@check cor(u(isadmin,%#),controls(%#,%q<dist>))=@attach %!/INC`MSG=ERROR: Permission denied.;@attach %!/INC`VALID`[if(not(%2),GROUP)]LOCK=%1;@attach %!/INC`LOCK`[v(GAME)];@attach %!/INC`MSG=Locked %q<dist> '%q<distname>' Enter/Teleport To: %q<value> (MEANING: %q<valueformat>);@attach %!/INC`MSG`CHAN=Locked %q<dist> '%q<distname>' Enter/Teleport To: %q<value> (MEANING: %q<valueformat>)
&INC`LOCK`PENNMUSH [u(cobj,grid)]=@lock/enter %q<dist>=%q<value>;@lset %q<dist>/enter=!no_inherit visual;@lock/teleport %q<dist>=%q<value>;@lset %q<dist>/teleport=!no_inherit visual
&INC`LOCK`RHOSTMUSH [u(cobj,grid)]=@lock/enter %q<dist>=%q<value>;@lset %q<dist>/enter=!no_inherit visual;@lock/tport %q<dist>=%q<value>;@lset %q<dist>/tport=!no_inherit visual
&INC`UNLOCK [u(cobj,grid)]=@attach %!/INC`FINDDIST=%0;@check cor(u(isadmin,%#),controls(%#,%q<dist>))=@attach %!/INC`MSG=ERROR: Permission denied.;@attach %!/INC`UNLOCK`[v(GAME)];@attach %!/INC`MSG=Unlocked %q<dist> '%q<distname>' for all entrants.;@attach %!/INC`MSG`CHAN=Unlocked %q<dist> '%q<distname>' for all entrants.
&INC`UNLOCk`PENNMUSH [u(cobj,grid)]=@unlock/enter %q<dist>;@unlock/teleport %q<dist>
&INC`UNLOCk`RHOSTMUSH [u(cobj,grid)]=@unlock/enter %q<dist>;@unlock/tport %q<dist>
&INC`DISTCHECK [u(cobj,grid)]=@check strlen(u(setr,dist,get(%#/D`DISTRICT)))=@attach %!/INC`MSG=Please choose a District using +district <name>.;@check u(u(cobj,grid)/FIL`ISDIST,%q<dist>)=@attach %!/INC`MSG=ERROR: District no longer valid. Please choose a District using +district <name>.;@check cor(u(isadmin,%#),controls(%#,%q<dist>))=@attach %!/INC`MSG=ERROR: Permission denied.;th u(setq,distname,name(%q<dist>))
@startup [u(cobj,grid)]=@check strmatch(%va,RhostMUSH);@hook/after @dig;@hook/include @dig
&A_@DIG [u(cobj,ccp)]=@check isdbref(u(setr,last,lastcreate(%#,r)));@check strlen(u(setr,dist,get(%#/D`DISTRICT)))=@pemit %#=Please choose a District using +district <name>.;@check u(u(cobj,grid)/FIL`ISDIST,%q<dist>)=@pemit %#=ERROR: District no longer valid. Please choose a District using +district <name>.;@check cor(u(isadmin,%#),controls(%#,%q<dist>))=@attach %!/INC`MSG=ERROR: Permission denied.;th u(setq,distname,name(%q<dist>));@parent %q<last>=%q<dist>;@pemit %#=Added '[name(%q<last>)]' to the '[name(%q<dist>)]' District.
&SHLP`DISTRICT [u(cobj,grid)]=The +district system helps admin keep their Grid organized by breaking it up into any number of arbitrary 'districts' or 'regions'. Each 'District' is a THING that rooms can be @parent'd to. +district is the central management for +roomlist and +port, so set good locks![u(choosegame,,%RRHOSTMUSH: Please note that in Rhost the +roomlist and +port teleport checks key off of @lock/use as it is the only one that can be inherited by @parent. +district/lock is almost useless on RhostMUSH.)]%RThe DBREF of the District Parent is: [u(cobj,district)]%R%R[ansi(hc,Commands)]%R[align(5 [sub(u(width,%#),6)],,[ansi(h,+district)] - List all districts.%r[ansi(h,+district/create <name>)] - Create a new district.%R[ansi(h,+district/rename <district>=<newname>)] - Rename a district.%R[ansi(h,+district/order <name>=<#>)] - Change a +district's order on the list and +roomlist.%R[ansi(h,+district/color <district>=<type>\,<colorcode>)] - Sets a color override for room formatters for this district. <types> are [get(u(cobj,grid)/COLOROPTIONS)]%R[ansi(h,+district/lock <district>=<lockgen>)] - Sets a Group-Style lock onto to restrict access/teleporting. This is inherited by sub-districts by default. See +help Lockgen.%R[ansi(h,+district/rawlock <district>=<lockstring>)] - Use standard @lock strings. Inherited by default.%R[ansi(h,+district/unlock <district>)] - Remove restrictions on entrance.%R[ansi(h,+district/describe <name>=<text>)] - Set a +district's description.%R[ansi(h,+district/ic <name>=<#>)] - Decide whether a +District is an IC or OOC location. Set to 0 or 1!%R[ansi(h,+district/subcreate <district>=<new district name>)] - Creates a sub-district for a given District!%R[ansi(h,+district/move <district>=<new district parent>)] - Assign existing District to a new parent. @parent them to [u(cobj,district)] to undo.%R[ansi(h,+district <name>)] - Choose to manage a certain district. This works for...%R[ansi(h,+dig)]\, [ansi(h,+open)] - Builder commands. Works like @dig and @open but auto-@parents the created objects.%R[ansi(h,+convert)] - Converts the room you're currently in to your managed +district. Basically just changes the @parent.%R%RA Note on Districts and Sub-Districts:%RTo target a Sub-district\, you can nest them like you would folders. For example: +district/subcreate Admin/Electric=Boogaloo would create the sub-district 'Boogaloo' in Admin's Electric sub-district. Then you could +district/move Admin/Electric/Boogaloo=<something else>. These are really just fancy @parent objects. Use the @parent command to assign to 'District Parent' [u(cobj,district)] if you need to reset a district to top-level.)]
+shelp/add Building/+district=[u(cobj,grid)]/SHLP`DISTRICT