Ok, I have been trying for weeks now to have a working smithing system. It was alot harder to delete more than one item for osme reason, idk maybe im stupid. But lets get over that now and go to the helping..
turf/obj/anvil icon = 'OBJ.dmi' icon_state = "anvil" layer=4 density=1 verb Smith() set src in oview(1) if(!(locate(/obj/Items/Smith/Hammer) in usr.contents)) usr << "<font size=1><font color=yellow>You need a hammer to start smithing!" return else var/smithing = input("What would you like to create?","SMITH MENU")in list("Iron Sword","Cancel") if(smithing == "Iron Sword") var/Iron_Bar = 0 for(var/obj/Items/Smith/I in usr.contents) if(istype(I,ironitemType)) Iron_Bar++ if(Iron_Bar>=5) for( var/i = 0; i < 6; i++ ) var/obj/Items/Smith/B = locate() in usr.contents if(istype(B,ironitemType)) if( istype( B, ironitemType ) ) del(B) usr.contents+=new/obj/Items/equipment/arms/right/Iron_Sword usr << "<font size=1><font color=green>You smith an Iron Sword!" return else usr << "<font size=1><font color=yellow>You need 5 iron bars to make an Iron Sword!" return
|
This is my smithing code, it compiles cleanly.
Here is what I want it to do...
*locate 5 iron ore and delete to make an iron sword from inventory.
Here is what it is doing...
*deletes 4 ores and gives the iron sword. But next time you try smithing it doesnt delete any and gives you the sword.
So, what I'm really asking is if you can help fix this code up or, show me a cleaner system that isn't crazy.
higher than high. drakiel.
I did this cuz I know you were trying... I think ;x read the comments about what was changed <.<
BTW: Tested and works, now go learn >.> Young whippershnapers
- GhostAnime
PPS: Tell me if it worked okay or not... you're lucky I didn't feel like being mean and addin problems in it... though because I did this when I was tired, I am not liable for any mistakes <.<