From b89ec41c3ad92c37ece18f91478ee7a2bc0952a1 Mon Sep 17 00:00:00 2001 From: Jack Edge Date: Wed, 9 Jan 2019 22:50:52 +0000 Subject: [PATCH] Changes the type pathing of some "random" items :cl: coiax code: Randomly coloured gloves and randomly coloured glowsticks now have slightly different typepaths, but otherwise function the same. /:cl: Essentially, these items just acted AS spawners by qdeling in Initialize (or at least hinting) and spawning a new totally seperate item. There is nothing that uses the auto-equipping of random gloves, so I removed it. --- _maps/map_files/Donutstation/Donutstation.dmm | 4 ++-- _maps/map_files/PubbyStation/PubbyStation.dmm | 2 +- code/_globalvars/lists/maintenance_loot.dm | 5 ++--- code/game/objects/items/devices/flashlight.dm | 12 +++++------- code/modules/clothing/gloves/_gloves.dm | 2 +- code/modules/clothing/gloves/color.dm | 18 +++--------------- 6 files changed, 14 insertions(+), 29 deletions(-) diff --git a/_maps/map_files/Donutstation/Donutstation.dmm b/_maps/map_files/Donutstation/Donutstation.dmm index 8739ed0b0d4e..25e8e3e41e21 100644 --- a/_maps/map_files/Donutstation/Donutstation.dmm +++ b/_maps/map_files/Donutstation/Donutstation.dmm @@ -19861,8 +19861,8 @@ /area/quartermaster/storage) "aQq" = ( /obj/structure/rack, -/obj/item/flashlight/glowstick/random, -/obj/item/flashlight/glowstick/random, +/obj/effect/spawner/lootdrop/glowstick, +/obj/effect/spawner/lootdrop/glowstick, /obj/item/crowbar, /obj/item/flashlight, /obj/item/coin/silver, diff --git a/_maps/map_files/PubbyStation/PubbyStation.dmm b/_maps/map_files/PubbyStation/PubbyStation.dmm index 221f170be6c8..465da15af7ea 100644 --- a/_maps/map_files/PubbyStation/PubbyStation.dmm +++ b/_maps/map_files/PubbyStation/PubbyStation.dmm @@ -17313,7 +17313,7 @@ "aPC" = ( /obj/structure/rack, /obj/effect/spawner/lootdrop/maintenance/two, -/obj/item/clothing/gloves/color/random, +/obj/effect/spawner/lootdrop/gloves, /turf/open/floor/plating, /area/maintenance/department/crew_quarters/bar) "aPD" = ( diff --git a/code/_globalvars/lists/maintenance_loot.dm b/code/_globalvars/lists/maintenance_loot.dm index a06e03324685..b0b8d09c2713 100644 --- a/code/_globalvars/lists/maintenance_loot.dm +++ b/code/_globalvars/lists/maintenance_loot.dm @@ -42,7 +42,7 @@ GLOBAL_LIST_INIT(maintenance_loot, list( /obj/item/assembly/timer = 3, /obj/item/flashlight = 4, /obj/item/flashlight/pen = 1, - /obj/item/flashlight/glowstick/random = 4, + /obj/effect/spawner/lootdrop/glowstick = 4, /obj/item/multitool = 2, /obj/item/radio/off = 2, /obj/item/t_scanner = 5, @@ -67,7 +67,6 @@ GLOBAL_LIST_INIT(maintenance_loot, list( /obj/item/crowbar = 1, /obj/item/crowbar/red = 1, /obj/item/extinguisher = 11, - //obj/item/gun/ballistic/revolver/russian = 1, //disabled until lootdrop is a proper world proc. /obj/item/hand_labeler = 1, /obj/item/paper/crumpled = 1, /obj/item/pen = 1, @@ -100,7 +99,7 @@ GLOBAL_LIST_INIT(maintenance_loot, list( /obj/item/assembly/signaler = 2, /obj/item/assembly/mousetrap = 2, /obj/item/reagent_containers/syringe = 2, - /obj/item/clothing/gloves/color/random = 8, + /obj/effect/spawner/lootdrop/gloves = 8, /obj/item/clothing/shoes/laceup = 1, /obj/item/storage/secure/briefcase = 3, /obj/item/storage/toolbox/artistic = 2, diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm index 585ff1e446f6..7b4948196431 100644 --- a/code/game/objects/items/devices/flashlight.dm +++ b/code/game/objects/items/devices/flashlight.dm @@ -518,16 +518,14 @@ name = "pink glowstick" color = LIGHT_COLOR_PINK -/obj/item/flashlight/glowstick/random +/obj/effect/spawner/lootdrop/glowstick name = "random colored glowstick" + icon = 'icons/obj/lighting.dmi' icon_state = "random_glowstick" - color = null -/obj/item/flashlight/glowstick/random/Initialize() - ..() - var/T = pick(typesof(/obj/item/flashlight/glowstick) - /obj/item/flashlight/glowstick/random) - new T(loc) - return INITIALIZE_HINT_QDEL +/obj/effect/spawner/lootdrop/glowstick/Initialize() + loot = typesof(/obj/item/flashlight/glowstick) + . = ..() /obj/item/flashlight/spotlight //invisible lighting source name = "disco light" diff --git a/code/modules/clothing/gloves/_gloves.dm b/code/modules/clothing/gloves/_gloves.dm index 817fe59dcd02..d2860219b707 100644 --- a/code/modules/clothing/gloves/_gloves.dm +++ b/code/modules/clothing/gloves/_gloves.dm @@ -40,4 +40,4 @@ // Called just before an attack_hand(), in mob/UnarmedAttack() /obj/item/clothing/gloves/proc/Touch(atom/A, proximity) - return 0 // return 1 to cancel attack_hand() \ No newline at end of file + return 0 // return 1 to cancel attack_hand() diff --git a/code/modules/clothing/gloves/color.dm b/code/modules/clothing/gloves/color.dm index c6fa3fff6a6a..35594b87f93a 100644 --- a/code/modules/clothing/gloves/color.dm +++ b/code/modules/clothing/gloves/color.dm @@ -185,16 +185,12 @@ /obj/item/clothing/gloves/color/white/redcoat item_color = "redcoat" //Exists for washing machines. Is not different from white gloves in any way. -/obj/item/clothing/gloves/color/random +/obj/effect/spawner/lootdrop/gloves name = "random gloves" desc = "These gloves are supposed to be a random color..." + icon = 'icons/obj/clothing/gloves.dmi' icon_state = "random_gloves" - item_state = "wgloves" - item_color = "mime" - -/obj/item/clothing/gloves/color/random/Initialize() - ..() - var/list/gloves = list( + loot = list( /obj/item/clothing/gloves/color/orange = 1, /obj/item/clothing/gloves/color/red = 1, /obj/item/clothing/gloves/color/blue = 1, @@ -205,11 +201,3 @@ /obj/item/clothing/gloves/color/brown = 1, /obj/item/clothing/gloves/color/white = 1, /obj/item/clothing/gloves/color/rainbow = 1) - - var/obj/item/clothing/gloves/color/selected = pick(gloves) - if(ishuman(loc)) - var/mob/living/carbon/human/H = loc - H.equip_to_slot_or_del(new selected(H), SLOT_GLOVES) - else - new selected(loc) - return INITIALIZE_HINT_QDEL