var
list
GuildKeys[0]
area
inside
GuildDoor
icon = 'Guild Stuff.dmi'
icon_state = "Area"
var
guildid = ""
gtag
Enter(mob/M)
if(istype(M,/mob/Player))
if(src.guildid)
if(src.guildid != M.guildid)
if(!M.toldctf)
M << output("This house belongs to a different guild", "notices")
M.toldctf = 1
spawn(30)
M.toldctf = 0
return
else
return..()
else
return ..()
if(istype(M,/obj/projectile))
del M
..()
Guild1
gtag = 1
Guild2
gtag = 2
Guild3
gtag = 3
obj
Guildkey
icon = 'Guild Stuff.dmi'
icon_state = "Key"
var
guildid = ""
gtag
accesslevel = 4
access = 1
price = 0
LeftClick()
if(get_dist(src,usr) > 1)
return
if(usr.alertopen)
return
if(src.guildid)
if(usr.guildid == src.guildid)
if(usr.guildlevel >= accesslevel)
usr.alertopen = 1
var/choice = alert(usr, "What do you want to do?","Guild House","Nothing","Change Access","Disown")
if(choice == "Nothing")
usr.alertopen = 0
return
if(choice == "Change Access")
var/check = alert(usr,"Do you want to toggle the house access?","Current Access Status: [src.access ? "Private" : "Public"]","No","Yes")
if(check == "No")
usr.alertopen = 0
return
else
if(src.access)
src.access = 0
else
src.access = 1
usr << output("<Font Color = Gray>Guild House access is now [src.access ? "Private" : "Public"]","notices")
if(choice == "Disown")
var/confirm = alert(usr,"Are you sure you want to disown this location","Guild House","No","Yes")
if(confirm == "No")
usr.alertopen = 0
return
else
GuildKeys -= src
for(var/area/inside/GuildDoor/G in world)
if(G.gtag == src.gtag)
G.guildid = ""
usr.alertopen = 0
usr << output("<Font Color = Gray><i>Guild House has been vacated</i>","notices")
usr.alertopen = 0
else
usr.alertopen = 1
var/q = alert(usr,"Do you want to buy this Guild House?","Guild House Cost: [src.price]","Yes","No")
if(q == "No")
usr.alertopen = 0
return
else
src.guildid = usr.guildid
GuildKeys += src
for(var/area/inside/GuildDoor/G in world)
if(G.gtag == src.gtag)
G.guildid = usr.guildid
usr << output("<Font Color = Teal>This Guild House has been aquired for your guild.","notices")
for(var/mob/Player/M in world)
if(M.guildid == usr.guildid)
M << output("<Font Color = Teal>A Guild House has been aquired for the guild at [src.x],[src.y].")
usr.alertopen = 0
Guild1
gtag = 1
Guild2
gtag = 2
Guild3
gtag = 3
Problem description:
I know this has been asked before but I haven't seen any example that looked like it would be helpful so I'm asking for help with my take on guild houses. I'm trying to save the which guilds own which house by using a guild id var that belongs to the area the house is in and a keypad obj that would have the same id but when i try to add the obj to the world list GuildKeys I get a mismatch type error. Can someone help me fix this or advise me on how to make a better system.