11
inter/db/11 · 6.5 KB
From the archive interlude_1beta5.tar.gz
Download the archive « Back to the archive contents
10
name
"Generic builder"
/
clone-object-cmd
(method (inline)
(if (= player this)
(ignore E_PERM
(var ob
(if (set ob (std-match (index 2 inline)))
(if (set ob (ob:copy))
(tell (+ "Successfully cloned to make object "
(tostr ob) ": " (ob:get-name) "\n"))
(tell "That object refuses to be cloned\n"))
(tell "I don't see that here!\n"))))))
/
clone-syntax
(method (ignored)
(if (= player this)
(tell-line "Syntax: @clone <object>")))
/
exit-syntax
(method (inline)
(if (= player this)
(tell-line "Syntax: @exit <name> to <destination>")))
/
exit-cmd
(method (inline)
(if (= player this)
(var new-exit
(if (set new-exit ($exit:copy))
(begin
(new-exit:set-name (index 2 inline))
(if (new-exit:move-to location)
(var dest
(if (set dest (std-match (index 4 inline)))
(ignore E_PERM
(if (new-exit:link dest)
(tell "Exit created, linked\n")
(begin
(new-exit:destroy)
(tell "You can't link an exit to there\n"))))
(begin
(new-exit:destroy)
(tell "I don't see that destination\n"))))
(begin
(new-exit:destroy)
(tell "This room doesn't allow the new exit\n"))))
(tell "You cannot create a new exit\n")))))
/
dig-syntax
(method (inline)
(if (= player this)
(tell-line "Syntax: @dig <roomname>")))
/
dig-cmd
(method (inline)
(if (= player this)
(var new-room
(if (= (typeof (set new-room ($room:copy))) 'OBJECT)
(tell (+ "Room " (tostr new-room) " dug, named "
(new-room:set-name (index 2 inline)) "\n"))
(tell "Sorry, you can't create a new room\n")))))
/
rename-syntax
(method (ignored)
(if (= player this)
(tell-line "Syntax: @rename <object> to <name>")))
/
rename-cmd
(method (inline)
(if (= player this)
(var match
(if (set match (std-match (index 2 inline)))
(ignore E_PERM
(if (match:set-name (index 4 inline))
(tell "Name changed\n")
(tell "You cannot change that object\n")))
(tell "I don't see that here\n")))
(rename-syntax inline)))
/
set-name
(method (newname)
(if (std-match newname)
(begin
(player:tell-line "That name is already in use.")
'())
(pass newname)))
/
alias-syntax
(method (ignored)
(if (= player this)
(tell-line "Syntax: @alias <object> to <name>")))
/
alias-cmd
(method (inline)
(if (= player this)
(var match
(if (set match (std-match (index
(if (= (index 3 inline) "=") 4 2)
inline)))
(ignore E_PERM
(if (match:add-alias (index
(if (= (index 3 inline) "=") 2 4)
inline))
(tell "Alias added\n")
(tell "You cannot change that object\n")))
(tell "I don't see that here\n")))
(alias-syntax inline)))
/
rmalias-syntax
(method (ignored)
(if (= player this)
(tell-line "Syntax: @rmalias <name> on <object>")))
/
rmalias-cmd
(method (inline)
(if (= player this)
(var match
(if (set match (std-match (index
(if (= (index 3 inline) "=") 2 4)
inline)))
(ignore E_PERM
(if (match:rm-alias (index
(if (= (index 3 inline) "=") 4 2)
inline))
(tell-line "Alias removed")
(tell-line "You cannot change that object")))
(tell-line "I don't see that here")))
(rmalias-syntax inline)))
/
recycle-syntax
(method (ignored)
(if (= player this)
(tell-line "Syntax: @recycle <object>")))
/
recycle-cmd
(method (inline)
(if (= player this)
(var match
(if (set match (std-match (index 2 inline)))
(handle E_PERM
(method (en es)
(tell-line "You cannot recycle that object"))
(begin
(match:destroy)
(tell-line "Object recycled")))
(tell-line "I don't see that here")))))
/
list-helper
(method (objname pname)
(var on
(if (set on (std-match objname))
(tell-line (on:list-method (tosym pname)))
(tell "I don't see that here\n"))))
/
list-command
(method (inline)
(if (write-ok? caller)
(if (= (index 3 inline) "=")
(list-helper (index 2 inline) (index 4 inline))
(if (= (index 3 inline) "on")
(list-helper (index 4 inline) (index 2 inline))
(ignore E_VAR_NOT_FOUND
(if (eval (set inline (tosym (index 4 inline))))
(tell (list-method inline))
(tell "That variable does not exist on you.\n")))))))
/
list-syntax
(method (unused)
(if (= player this)
(tell "Syntax: @list <variable name> [on <object>]\n")))
/
show-syntax
(method (unused)
(if (= player this)
(tell "Syntax: @show <object>\n")))
/
show-command
(method (inline)
(if (= player this)
(var match
(if (set match (std-match (index 2 inline)))
(match:~show-this)
(tell "I don't see that here.\n")))))
/
/
'("@clone" SOME)
clone-object-cmd
'("@clone")
clone-syntax
'("@rename")
rename-syntax
'("@name")
rename-syntax
'("@rename" (or (before "=") (before " as ") (before " to ") WORD) (or "=" "as" "to" "") REST)
rename-cmd
'("@name" (or (before "=") (before " as ") (before " to ") WORD) (or "=" "as" "to" "") REST)
rename-cmd
'("@addalias")
alias-syntax
'("@addalias" (or (before "=") (before " to ") WORD) (or "=" "to" "") SOME)
alias-cmd
'("@alias")
alias-syntax
'("@alias" (or (before "=") (before " to ") WORD) (or "=" "to" "") SOME)
alias-cmd
'("@rmalias" (or (before "=") (before " on ") (before " from ") WORD) (or "=" "on" "from" "") SOME)
rmalias-cmd
'("@rmalias")
rmalias-syntax
'("@recycle")
recycle-syntax
'("@recycle" SOME)
recycle-cmd
'("@dig")
dig-syntax
'("@dig" SOME)
dig-cmd
'("@exit")
exit-syntax
'("@exit" (or (before "=") (before " to ")) (or "=" "to") SOME)
exit-cmd
'("@list")
list-syntax
'("@list" (or (before "=") (before " on ") "") (or "=" "on" "") SOME)
list-command
'("@show")
show-syntax
'("@show" REST)
show-command
/+++++++++ end of object #11 ... no lines after this ++++++++++