-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathNavigation System - NAVI.txt
More file actions
65 lines (42 loc) · 6.01 KB
/
Navigation System - NAVI.txt
File metadata and controls
65 lines (42 loc) · 6.01 KB
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
@@ DEPENDENCIES: Core, Grid Manager
th u(NEWCOBJ,Navigation System <NAVI>,navi,,,,WIZARD SAFE !NO_COMMAND,INHERIT SIDEFX SAFE)
&CMD`+GOHOME [u(cobj,navi)]=$+gohome:@attach %!/INC`MSG=Just use [ansi(h,home)] silly!
&CMD`+SETHOME [u(cobj,navi)]=$+sethome:@stop u(isguest,%#)=@attach %!/INC`MSG=ERROR: Permission denied.;@check elock(%l/link,%#)=@attach %!/INC`MSG=You do not pass the link lock for this room.;@link %#=%l;@attach %!/INC`MSG=Home set to your current location.
&FUN`TELDISTS [u(cobj,navi)]=squish(iter(u(u(cobj,grid)/FUN`LISTDISTRICTS,u(strfirstof,%0,u(cobj,district))),if(elock(%i0/[u(choosegame,Teleport,Use)],u(strfirstof,%1,%#)),%i0)))
&FIL`CANTELEPORT`PENNMUSH [u(cobj,navi)]=elock(%0/teleport,%#)
&FIL`CANTELEPORT`RHOSTMUSH [u(cobj,navi)]=elock(%0/tport,%#)
&FUN`FINDROOM [u(cobj,navi)]=u(sortname,u(FUN`FINDROOM`%va,%0))
&FUN`FINDROOM`PENNMUSH [u(cobj,navi)]=u(filter,CANTELEPORT`%va,setunion(lsearch(all,type,room,name,%0,elock,D`GRID:1),lsearch(all,type,thing,name,%0,elock,PORT:>0)))
&FUN`FINDROOM`RHOSTMUSH [u(cobj,navi)]=u(filter,CANTELEPORT`%va,setunion(search(EROOM=\[cand(get(##/D`GRID),strmatch(name(##),*%0*))\]),search(ETHING=\[cand(get(##/PORT),strmatch(name(NAME),*%0*))\])))
&FUN`LISTROOMS [u(cobj,navi)]=squish(iter(u(FUN`TELDISTS,,%1),u(FUN`LISTDISTROOMS,%i0))%B[u(FUN`LISTTHINGS)])
&FUN`LISTDISTROOMS [u(cobj,navi)]=u(sortname,u(u(cobj,grid)/filter,NOTDIST,children(%0)))
&FUN`LISTTHINGS [u(cobj,navi)]=squish(iter(u(FUN`FINDTHINGS`%va),if(cor(elock(%i0/[u(choosegame,Teleport,Tport)],u(strfirstof,%1,%#)),u(isadmin,u(strfirstof,%1,%#))),%i0)))
&FUN`FINDTHINGS`PENNMUSH [u(cobj,navi)]=lsearch(all,type,thing,elock,PORT:>0)
&FUN`FINDTHINGS`RHOSTMUSH [u(cobj,navi)]=search(ETHING=\[get(##/PORT)\])
&FUN`LISTALLDISTS [u(cobj,navi)]=u(choosegame,lsearch(all,type,thing,elock,D`DISTRICT:>0),search(ETHING=\[get(##/D`DISTRICT)\]))
&CMD`+NAVI`PENNMUSH [u(cobj,navi)]=$^(?\:\+)(go|roomlist|port)(?\:/(\S+)?)?(?\: +(.+?))?(?\:=(.*))?$:@attach %!/CMD`+NAVI`MAIN
@set [u(cobj,navi)]/CMD`+NAVI`PENNMUSH=regexp
&CMD`+NAVI`RHOSTMUSH [u(cobj,navi)]=$^(?\:\+)(go|roomlist|port)(?\:/(\\S+)?)?(?\: +(.+?))?(?\:=(.*))?$:@attach %!/CMD`+NAVI`MAIN
@set [u(cobj,navi)]/CMD`+NAVI`RHOSTMUSH=regexp
&CMD`+NAVI`MAIN [u(cobj,navi)]=@attach %!/INC`GETSWITCH=%2;@select/inline %q<switch>=CONFIG,{@attach %!/INC`CONFIG=%3,%4},{@attach %!/%1`[u(strfirstof,%q<switch>,MAIN)]=%3,%4}
@set [u(cobj,navi)]/CMD`+NAVI`[u(choosegame,RHOSTMUSH,PENNMUSH)]=no_command
&SYSTEM`NAME [u(cobj,navi)]=NAVI
&SWITCHES`ADMIN [u(Cobj,navi)]=CONFIG
&CONFIG`OPTIONS [u(cobj,navi)]=IC_NEXUS|OOC_NEXUS
&CONFIG`IC_NEXUS [u(cobj,navi)]=What room to use for the IC Nexus?
&CONFIG`IC_NEXUS`DEFAULT [u(cobj,navi)]=
&CONFIG`IC_NEXUS`VALID [u(cobj,navi)]=DBREF
&CONFIG`OOC_NEXUS [u(cobj,navi)]=What room to use for the IC Nexus?
&CONFIG`OOC_NEXUS`DEFAULT [u(cobj,navi)]=
&CONFIG`OOC_NEXUS`VALID [u(cobj,navi)]=DBREF
&PORT`MAIN [u(cobj,navi)]=@check strlen(%0)=@attach %!/INC`MSG=ERROR: Where will you go?;@stop u(isguest,%#)=@attach %!/INC`MSG=ERROR: Permission denied.;@select/inline isdbref(%0)=1,{th u(setq,dest,%0)},0,{@check words(u(setr,dest,u(FUN`FINDROOM,%0)))=@attach %!/INC`MSG=Nothing matches '%0'.;@stop gt(words(%q<dest>),1)={@attach %!/INC`MSG=Multiple Matches;@dolist/inline %q<dest>=@pemit %#=u(pueblize,ansi(hx,%i0) - [ansi(c,name(%i0))]%B\([u(u(cobj,grid)/FUN`CHAIN,%i0)]\),+port %i0)}};@stop strmatch(%l,%q<dest>)=@attach %!/INC`MSG=You are already there.;@attach %!/INC`CANRELOCATE=%#,%q<dest>;@attach %!/INC`RELOCATE=%#,%q<dest>
&ROOMLIST`RECURSE [u(Cobj,navi)]=@dolist/inline u(FUN`TELDISTS,%0)={@select/inline words(u(setr,rooms,u(FUN`LISTDISTROOMS,u(setr,target,u(choosegame,%i0,%d0)))))=>0,{@pemit %#=u(SEPARATOR,u(u(cobj,grid)/FUN`CHAIN,%q<target>));th step(FUN`ROOMLIST,%q<rooms>,30)};@attach %!/ROOMLIST`RECURSE=%q<target>}
&ROOMLIST`MAIN [u(cobj,navi)]=@select/inline strlen(%0)=>0,{think u(setq,rooms,u(FUN`FINDROOM)); @check strlen(u(setr,foundrooms,strfirstof(grab(%q<rooms>,%0),u(namegraball,%q<rooms>,%0))))=@pemit %#=Nothing matches '%0'.;@pemit %#=u(header,'%0');th step(FUN`ROOMLIST,%q<foundrooms>,10);@pemit %#=u(footer)},0,{@pemit %#=u(header,mudname() Grid Rooms);@attach %!/ROOMLIST`RECURSE=null();@select/inline words(u(setr,things,u(FUN`LISTTHINGS)))=>0,{@pemit %#=u(SEPARATOR,Player Things);th step(FUN`ROOMLIST,%q<things>,10)};@pemit %#=u(footer)}
&FUN`ROOMLIST [u(cobj,navi)]=pemit(%#,u(table,iter(lnum(0,sub(%+,1)),ljust(ansi(c,u(pueblize,v(%i0),+port [v(%i0)])),6) [ansi(hx,u(pueblize,name(v(%i0)),+port [v(%i0)]))],%b,|),38,u(width,%#),|))
&GO`MAIN [u(cobj,navi)]=@check strlen(%0)=@attach %!/INC`MSG=ERROR: Will you go OOC or IC?;@attach %!/INC`PARTIAL=%0,IC|OOC,|,choice;@attach %!/%q<choice>`MAIN
&IC`MAIN [u(cobj,navi)]=@check isdbref(u(setr,dest,u(conf,IC_NEXUS)))=@attach %!/INC`MSG=ERROR: The IC Nexus is not configured.;@attach %!/PORT`MAIN=%q<dest>
&OOC`MAIN [u(cobj,navi)]=@check isdbref(u(setr,dest,u(conf,OOC_NEXUS)))=@attach %!/INC`MSG=ERROR: The OOC Nexus is not configured.;@attach %!/PORT`MAIN=%q<dest>
&ROOMLIST`CONFIG [u(cobj,navi)]=@attach %!/INC`CONFIG
&PORT`CONFIG [u(cobj,navi)]=@attach %!/INC`CONFIG
&HLP`NAVI [u(cobj,navi)]=The Grid system is a series of commands that make it easy to navigate the IC rooms, or 'Grid.'%R%R[ansi(hc,Commands)]%R[align(5 [sub(u(width,%#),6)],,[ansi(h,+roomlist)] - List all IC rooms in the game that you can +port to.%R[ansi(h,+roomlist <search>)] - List all rooms partially matching the entered text.%R[ansi(h,+port <name or dbref>)] - Teleport to a room.%R[ansi(h,+sethome)] - Set the current location as your 'home.'%R[ansi(h,+gohome)] or [ansi(h,home)] - Teleport to your home.%R%R[ansi(h,+go ooc)] - Teleport to the OOC nexus.%R[ansi(h,+go ic)] - Teleport to the IC nexus.)]%R%RPlayers using THINGS as hangouts can make that object a valid +port destination by setting its PORT attribute to 1. use &PORT here=1 while within the object to set it.[u(choosegame,%RPENNMUSH: You must also set @lock/teleport here=#TRUE - Penn users can use @lock/teleport to restrict who can access the object with +port.)]
+help/add Navigation/+port=[u(cobj,navi)]/HLP`NAVI