My problem is when i try group my items, when there is a group of the same item it works fine, but when there are 2 different groups it adds the new group to the old group giving me 4 of the same item when i should have 2 of each below is the code im using to group
obj/ITEMS
item = 1
blueunder
name = "Blue Underclothing"
icon = 'clothes-blueunder.dmi'
worn = 0
amt = 0
var/src = /obj/ITEMS/blueunder
verb
Wear()
if(usr.fusedpartner == 1)
usr << "Not while fused."
else
if(src.worn == 1)
src.worn = 0
usr.overlays -= 'clothes-blueunder.dmi'
usr << "You remove the [src.name]."
else
src.worn = 1
usr.overlays += 'clothes-blueunder.dmi'
usr << "You wear the [src.name]."
Drop()
if(src.worn == 1)
if(src.amt >= 2)
src.amt = (src.amt - 1)
if(src.amt >= 2)
src.suffix = "x[src.amt]"
else
src.suffix = ""
new src(locate(usr.x,usr.y+1,usr.z))
else
usr << "Not while its being worn."
if(src.worn == 0)
if(src.amt >= 2)
src.amt = (src.amt - 1)
if(src.amt >= 2)
src.suffix = "x[src.amt]"
else
src.suffix = ""
new src(locate(usr.x,usr.y+1,usr.z))
else
src.amt = 0
src.suffix = ""
src.loc=locate(usr.x,usr.y+1,usr.z)
Get()
set category = "Commands"
set src in oview(1)
src.loc = usr
for(var/obj/ITEMS/O in usr.contents)
if(O.amt >= 1)
O.amt = (O.amt + 1)
O.suffix = "x[O.amt]"
del(src)
else
src.amt = 1
src.suffix = ""
obj/ITEMS
custom_armor
name = "Custom Armor"
icon = 'saiyanarmor2.dmi'
worn = 0
amt = 0
var/src = /obj/ITEMS/custom_armor
verb
Wear()
if(usr.fusedpartner == 1)
usr << "Not while fused."
else
if(src.worn == 1)
src.worn = 0
usr.overlays -= 'saiyanarmor2.dmi'
usr << "You remove the [src.name]."
else
src.worn = 1
usr.overlays += 'saiyanarmor2.dmi'
usr << "You wear the [src.name]."
Drop()
if(src.worn == 1)
if(src.amt >= 2)
src.amt = (src.amt - 1)
if(src.amt >= 2)
src.suffix = "x[src.amt]"
else
src.suffix = ""
new src(locate(usr.x,usr.y+1,usr.z))
else
usr << "Not while its being worn."
if(src.worn == 0)
if(src.amt >= 2)
src.amt = (src.amt - 1)
if(src.amt >= 2)
src.suffix = "x[src.amt]"
else
src.suffix = ""
new src(locate(usr.x,usr.y+1,usr.z))
else
src.amt = 0
src.suffix = ""
src.loc=locate(usr.x,usr.y+1,usr.z)
Get()
set category = "Commands"
set src in oview(1)
src.loc = usr
for(var/obj/ITEMS/O in usr.contents)
if(O.amt >= 1)
O.amt = (O.amt + 1)
O.suffix = "x[O.amt]"
del(src)
else
src.amt = 1
src.suffix = ""
ID:261864
Nov 1 2003, 7:42 am
|
|
In response to WTS_Leader
|
|
Please take advantage of the nifty "edit" button instead of wasting space.
|
obj/ITEMS
custom_armor
that was a typo in my previous post