obj/Build
DblClick()
if(src.owner == "")
usr << "[src] has no owner"
else
usr << "[src] was built by [src.owner]"
Click()
if(!(src in usr)) return
var/obj/Build/a = new src.type
a.loc=usr.loc
a.owner="[usr.key]"
if(istype(a,/obj/Build/Sign))
a:msg = input("What should the sign say?","Creating sign")as text
if(a:msg == "")
a:name = "Sign"
else
a:name = "[a:msg]"
if(istype(a,/obj/Build/Door))
a.owned = "[usr.key]"
switch(alert(usr,"What direction will it open?","Door","Horizontal","Vertical"))
if("Horizontal")
a:dir = SOUTH
else
a:dir = NORTH
switch(alert("See through?","Door","No","Yes"))
if("Yes")
a:see = 0
a:opacity = 0
else
a:see = 1
a:opacity = 1
switch(alert(usr,"Would you like to set a password?","Door","Yes","No"))
if("Yes")
a:pword = input("What should it's password be?","Enter the password")as text
if(a:pword == "")
a:pword = "none"
else
a:pword = "none"
Sign
var/msg
icon = 'stuff.dmi'
icon_state = "sign"
density = 1
Door
var/open = 0
var/see
var/pword = ""
icon = 'door.dmi'
icon_state = "doorshut"
name = "Door"
density = 1
opacity = 0
proc/tryit(var/mob/m)
set background = 1
if(src.open == 1)
return 0
if(src.owner == "[m.name]")
if(src.pword != "none")
m << "Remember, the password for your door is [src.pword]"
src.open()
return 0
if(src.pword == "none"||src.pword == "")
src.open()
return 0
if(m.gmno == 1)
m << "[src.pword]"
m.choice = input("What is the password?","Door")as text
if(m.choice == src.pword)
src.open()
return 0
else
m << "<I><B>INCORRECT PASSWORD!</I>"
return 0
proc/open()
set background = 1
src.density = 0
src.opacity = 0
src.open = 1
flick("opening",src)
src.icon_state = "dooropen"
sleep(40)
src.density = 1
if(src.see == 0)
src.opacity = 0
else
src.opacity = 1
src.open = 0
flick("closing",src)
src.icon_state = "doorshut"
mob
Bump(atom/O)
if(istype(O,/obj/Build/Door))
O:tryit(usr)
if(istype(O,/obj/Build/Sign))
usr << "<center>[O:name]"
usr << "<center>[O:owner]"
Problem description:
the door + sign wont work!