From abefe71bba529752ee02b7c68d696d5003f189e6 Mon Sep 17 00:00:00 2001 From: Tastyfish Date: Thu, 12 Jan 2012 01:47:15 -0500 Subject: [PATCH 1/3] fixed derpy bug in spawning right dismembered foot --- code/modules/mob/organ/organ.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/organ/organ.dm b/code/modules/mob/organ/organ.dm index c2370b5b10e..85f14473c2b 100644 --- a/code/modules/mob/organ/organ.dm +++ b/code/modules/mob/organ/organ.dm @@ -233,7 +233,7 @@ if(owner:organs["r_foot"]) var/datum/organ/external/S = owner:organs["r_foot"] if(!S.destroyed) - var/obj/item/weapon/organ/l_foot/X = new(owner.loc, owner) + var/obj/item/weapon/organ/r_foot/X = new(owner.loc, owner) for(var/mob/M in viewers(owner)) M.show_message("\red [owner.name]'s [X.name] flies off flies off in arc.") var/lol2 = pick(cardinal) From e5abd35dae3ab9f82bb5be95fa07782efb1cf225 Mon Sep 17 00:00:00 2001 From: Tastyfish Date: Thu, 12 Jan 2012 01:47:55 -0500 Subject: [PATCH 2/3] made custom items read from a config file --- code/WorkInProgress/Mini/customitems.dm | 51 +++++++++++++++---------- 1 file changed, 30 insertions(+), 21 deletions(-) diff --git a/code/WorkInProgress/Mini/customitems.dm b/code/WorkInProgress/Mini/customitems.dm index 3e8c025e27c..bc5909ee913 100644 --- a/code/WorkInProgress/Mini/customitems.dm +++ b/code/WorkInProgress/Mini/customitems.dm @@ -3,29 +3,38 @@ //gives item to specific people when they join if it can //for multiple items just add mutliple entries, unless i change it to be a listlistlist //yes, it has to be an item, you can't pick up nonitems -var/list/CustomItemList = list( - // ckey real_name item path - list("skymarshal", "Phillip Oswald", /obj/item/weapon/coin/silver), //Phillip likes to chew on cigars. Just unlit cigars, don't ask me why. Must be a clone thing. (Cigarette machines dispense cigars if they have a coin in them) --SkyMarshal - list("spaceman96", "Trenna Seber", /obj/item/weapon/pen/multi), //For Spesss. - list("asanadas", "Book Berner", /obj/item/clothing/under/chameleon/psyche) - ) /proc/EquipCustomItems(mob/living/carbon/human/M) - for(var/list/Entry in CustomItemList) + // load lines + var/file = file2text("config/custom_items.txt") + var/lines = dd_text2list(file, "\n") + + for(var/line in lines) + // split & clean up + var/list/Entry = dd_text2list(line, ":") + for(var/i = 1 to parts.len) + Entry[i] = trim(Entry[i]) + + if(Entry.len < 3) + continue; + if(Entry[1] == M.ckey && Entry[2] == M.real_name) - var/ok = 0 // 1 if the item was placed successfully - var/path = Entry[3] - var/obj/item/Item = new path() + var/list/Paths = dd_text2list(Entry[3], ",") + for(P in Paths) + var/ok = 0 // 1 if the item was placed successfully + P = trim(P) + var/path = text2path(P) + var/obj/item/Item = new path() - if(istype(M.back,/obj/item/weapon/storage) && M.back:contents.len < M.back:storage_slots) // Try to place it in something on the mob's back first - Item.loc = M.back - ok = 1 - else - for(var/obj/item/weapon/storage/S in M.contents) // Try to place it in any item that can store stuff, on the mob. - if (S:len < S:storage_slots) - Item.loc = S - ok = 1 - break + if(istype(M.back,/obj/item/weapon/storage) && M.back:contents.len < M.back:storage_slots) // Try to place it in something on the mob's back first + Item.loc = M.back + ok = 1 + else + for(var/obj/item/weapon/storage/S in M.contents) // Try to place it in any item that can store stuff, on the mob. + if (S:len < S:storage_slots) + Item.loc = S + ok = 1 + break - if (ok == 0) // Finally, since everything else failed, place it on the ground - Item.loc = get_turf(M.loc) \ No newline at end of file + if (ok == 0) // Finally, since everything else failed, place it on the ground + Item.loc = get_turf(M.loc) \ No newline at end of file From 9e5925b1f9f2fa4761a9477ab2a373a936e70871 Mon Sep 17 00:00:00 2001 From: Tastyfish Date: Thu, 12 Jan 2012 01:54:27 -0500 Subject: [PATCH 3/3] fixed custom items loaded and custom_items.txt --- code/WorkInProgress/Mini/customitems.dm | 6 +++--- config/custom_items.txt | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 config/custom_items.txt diff --git a/code/WorkInProgress/Mini/customitems.dm b/code/WorkInProgress/Mini/customitems.dm index 4a5a4391673..c24dfc91f03 100644 --- a/code/WorkInProgress/Mini/customitems.dm +++ b/code/WorkInProgress/Mini/customitems.dm @@ -12,7 +12,7 @@ for(var/line in lines) // split & clean up var/list/Entry = dd_text2list(line, ":") - for(var/i = 1 to parts.len) + for(var/i = 1 to Entry.len) Entry[i] = trim(Entry[i]) if(Entry.len < 3) @@ -20,7 +20,7 @@ if(Entry[1] == M.ckey && Entry[2] == M.real_name) var/list/Paths = dd_text2list(Entry[3], ",") - for(P in Paths) + for(var/P in Paths) var/ok = 0 // 1 if the item was placed successfully P = trim(P) var/path = text2path(P) @@ -37,4 +37,4 @@ break if (ok == 0) // Finally, since everything else failed, place it on the ground - Item.loc = get_turf(M.loc) + Item.loc = get_turf(M.loc) \ No newline at end of file diff --git a/config/custom_items.txt b/config/custom_items.txt new file mode 100644 index 00000000000..aa9d2d0ddde --- /dev/null +++ b/config/custom_items.txt @@ -0,0 +1,4 @@ +skymarshal: Phillip Oswald: /obj/item/weapon/coin/silver +spaceman96: Trenna Seber: /obj/item/weapon/pen/multi, /obj/item/clothing/suit/storage/labcoat/pink +asanadas: Book Berner: /obj/item/clothing/under/chameleon/psyche +tastyfish: Cindy Robertson: /obj/item/weapon/paper \ No newline at end of file