breadcounter
name="counter"
density=1
icon_state="bread counter"
Interact()
var/knife
var/ham
var/cheese
var/turkey
var/bread
var/list/sandwich=new()
var/obj/food/bread/A
var/obj/food/ham/B
var/obj/food/cheese/C
var/obj/food/turkey/D
var/num=0
for(A in usr)
bread++
for(B in usr)
ham=1
for(C in usr)
cheese=1
for(D in usr)
turkey=1
if(bread<2)
usr<<"You need 2 slices of bread to make a sandwich."
return 0
if(!ham&&!cheese&&!turkey)
usr<<"You need at least one food to go in the sandwich of the following:"
usr<<" \icon[icon('obj.dmi',"dot")] Ham"
usr<<" \icon[icon('obj.dmi',"dot")] Cheese"
usr<<" \icon[icon('obj.dmi',"dot")] Turkey"
return 0
if(ham)
sandwich.Add("Ham sandwich")
if(cheese)
sandwich.Add("Cheese sandwich")
if(turkey)
sandwich.Add("Turkey sandwich")
if(ham&&cheese)
sandwich.Add("Ham and cheese sandwich")
if(ham&&turkey)
sandwich.Add("Ham and turkey sandwich")
if(cheese&&turkey)
sandwich.Add("Turkey and cheese sandwich")
if(ham&&cheese&&turkey)
sandwich.Add("Ham, turkey, and cheese sandwich")
num=0
switch(input("What kind of sandwich would you like?") in sandwich)
if("Ham sandwich")
for(A in usr)
if(num==2) break
usr.contents-=A
num++
num=0
for(B in usr)
if(num) break
usr.contents-=B
num++
var/obj/food/sandwich/b=new()
usr.contents+=b
b.suffix="Ham"
if(knife) usr.CutCrust(b,usr)
if("Cheese sandwich")
for(A in usr)
if(num==2) break
usr.contents-=A
num++
num=0
for(C in usr)
if(num) break
usr.contents-=C
num++
var/obj/food/sandwich/b=new()
usr.contents+=b
b.suffix="Cheese"
if(knife) usr.CutCrust(b,usr)
if("Turkey sandwich")
for(A in usr)
if(num==2) break
usr.contents-=A
num++
num=0
for(D in usr)
if(num) break
usr.contents-=D
num++
var/obj/food/sandwich/b=new()
usr.contents+=b
b.suffix="Turkey"
if(knife) usr.CutCrust(b,usr)
if("Ham and cheese sandwich")
for(A in usr)
if(num==2) break
usr.contents-=A
num++
num=0
for(B in usr)
if(num) break
usr.contents-=B
num++
num=0
for(C in usr)
if(num) break
usr.contents-=C
num++
var/obj/food/sandwich/b=new()
usr.contents+=b
b.suffix="Ham/Cheese"
if(knife) usr.CutCrust(b,usr)
if("Turkey and cheese sandwich")
for(A in usr)
if(num==2) break
usr.contents-=A
num++
num=0
for(D in usr)
if(num) break
usr.contents-=D
num++
num=0
for(C in usr)
if(num) break
usr.contents-=C
num++
var/obj/food/sandwich/b=new()
usr.contents+=b
b.suffix="Turkey/Cheese"
if(knife) usr.CutCrust(b,usr)
if("Ham, turkey, and cheese sandwich")
for(A in usr)
if(num==2) break
usr.contents-=A
num++
num=0
for(B in usr)
if(num) break
usr.contents-=B
num++
num=0
for(C in usr)
if(num) break
usr.contents-=C
num++
num=0
for(D in usr)
if(num) break
usr.contents-=D
num++
var/obj/food/sandwich/b=new()
usr.contents+=b
b.suffix="Ham/Cheese/Turkey"
if(knife) usr.CutCrust(b,usr)
yeah, big...and to the user, it's only a simple popup box...if only they knew...any comments? ideas? ways to make it shorter?