mob
var
bagopened = 1
verb/bagopen()
if(bagopened==1)
bagopened = 0
winshow(src,"inventory",1)
else if(bagopened==0)
bagopened = 1
winshow(src, "inventory",0)
else
src<<"Unknown bag opening error bagopen !=1/0"
proc
equipstuff()
usr << output(usr.legs, "inventory.legs")
usr << output(usr.shoulder, "inventory.shoulder")
usr << output(usr.face, "inventory.face")
usr << output(usr.feet, "inventory.feet")
usr << output(usr.head, "inventory.head")
usr << output(usr.back, "inventory.back")
usr << output(usr.mainhand, "inventory.mainhand")
usr << output(usr.offhand, "inventory.offhand")
usr << output(usr.glove, "inventory.glove")
usr << output(usr.chest, "inventory.chest")
InvLayer()
mob
var
chest
legs
shoulder
face
feet
head
back
mainhand
offhand
glove
list/hiddenlist = list()
Entered(obj/Armor/A)
..()
if(istype(A))
var/obj/Armor/X=locate(A.type) in src.contents-A
if(X)
A.amount+=X.amount
del X
Inventory()
Exited()
..()
Inventory()
proc/Inventory()
var/i=1
winset(src,"inventory.invent",{"cells="2x[contents.len+1]""})
src<<output("<b>Item</b>","inventory.invent:1,1")
src<<output("<b>Amount</b>","inventory.invent:2,1")
for(var/obj/Armor/I in contents)
src<<output(I,"inventory.invent:1,[++i]")
src<<output(I.amount,"inventory.invent:2,[i]")
MouseDrag(src_object,over_object,src_location,over_location,src_control,over_control,params)
if(!(src in usr.contents)) return
proc/InvLayer()
var/list/new_overlays = list()
for(var/slot in list("legs","feet","chest","glove","back","offhand","mainhand","shoulder","face","head"))
var/obj/Armor/A = vars[slot]
if(A) new_overlays += A.overlay_icon
overlays = new_overlays
atom/proc/Bumped(atom/A) return 1
obj/Armor
MouseDrop(over_object=src,src_location,over_location,src_control,over_control,params)
if(src in usr.contents)
if(findtextEx(over_control,"inventory.")==1)
if(over_control == "inventory.[equiptype]")
Equip(usr)
else
usr << output(null,"inventory.about")
usr << output(equiptype ? "That doesn't go there!" : "That isn't an equippable item!", "inventory.about")
else if(over_control == "inventory.invent")
Unequip(usr)
density = 1
var/amount = 1
verb/Pickup()
set src in oview(1)
Pickup_proc(usr)
proc/Pickup_proc(mob/M)
if(!(M in oview(1,src))) return
.=Move(M)
M << "[(.)?"\green":"\red"] You[(.)?"":" did not"] pick up [src.name]."
var/equiptype
var/overlay_icon
obj/Armor/proc/Equip(mob/M)
var/obj/Armor/old = M.vars[equiptype]
if(old && old != src) old.Unequip(M, 1)
M << "Equipped [name]"
M << output(null,"inventory.about")
M << output("Equipped [name]","inventory.about")
M.vars[equiptype] = src
loc = M.hiddenlist
M << output(src, "inventory.[equiptype]")
overlay_icon = icon
M.InvLayer()
M.Inventory()
obj/Armor/proc/Unequip(mob/M, auto)
if(M.vars[equiptype] != src) return
M << "Removed [name]"
M << output(null,"inventory.about")
M << output("Removed [name]","inventory.about")
M.vars[equiptype] = null
loc = M
if(!auto)
M << output(null, "inventory.[equiptype]")
M.InvLayer()
M.Inventory()
mob
var
hairr
hairg
hairb
const/HAIR_LAYER = FLOAT_LAYER-3
haircolor
eyecolor
newHair
loadHair
loadEyes
verb
Hairemo1()
if(gnder==1 || gnder==2)
usr.overlays -= Hair
newHair = 'hair_emo.dmi'
haircolor = input("Please select your hair color") as color
newHair += haircolor
Hair = newHair
var/Hairred=4
var/Hairgreen=4
var/Hairblue=5
Hair += rgb(Hairred,Hairgreen,Hairblue)
HairR=Hairred
HairG=Hairgreen
HairB=Hairblue
whichair = 1
overlays += Hair
Problem description: For some reason when I equip anything, the hair goes -poof-. It just disappears o.o
In InvLayer(), you're setting the overlays to a new list, so the hair appearance you added gets overwritten.