My code:
turf/counter
icon = 'turfs.dmi'
icon_state = "counter"
density = 1
Enter(mob/M)
switch(alert(M,"This is a weapon shop.", "How may I help you?","Buy","Sell","Cancel"))
if("Buy")
var/list/store1 = list("Clothes","Leather Armor","Leather Shield")
var/store = input(M, "Here are my wares","Armor") in store1
switch(store)
if("Clothes")
if(M.gold >= 20)
M.gold -= 20
new /obj/armors/clothes (M)
else
M << "sorry, you don't have enough gold"
if("Leather Armor")
if(M.gold >= 150)
M.gold -= 150
new /obj/armors/leather_armor (M)
else
M << "sorry, you don't have enough gold"
if("Leather Shield")
if(M.gold >= 90)
M.gold -= 90
new /obj/shields/leather_shield (M)
else
M << "sorry, you don't have enough gold"
----> if("Sell")
var/list/sell1 = list("[src.contents]")
var/store = input(M, "What are you selling?") in sell1
switch(store)
if("Clothes")
M << "I'll give you 10 gold pieces for that, Deal?"
var/list/yesno = list("Yes","No")
var/agree = input(M,"", "Well") in yesno
if("Yes")
M.gold += 10
del /obj/armors/clothes (M)
else
return 1
Suggestions and Comments welcome.
-pman-