From 15b3c3fa8a08fa5c3d2b87f22fbac72fb1ac19e1 Mon Sep 17 00:00:00 2001 From: Geeves Date: Sun, 18 Apr 2021 23:46:04 +0200 Subject: [PATCH] Qoi Custom Item (#11668) --- code/game/sound.dm | 13 +- code/modules/customitems/item_defines.dm | 180 ++++++++++++++++++++++- icons/obj/custom_items/qoi_console.dmi | Bin 0 -> 2832 bytes 3 files changed, 191 insertions(+), 2 deletions(-) create mode 100644 icons/obj/custom_items/qoi_console.dmi diff --git a/code/game/sound.dm b/code/game/sound.dm index e77352430ae..213780926b8 100644 --- a/code/game/sound.dm +++ b/code/game/sound.dm @@ -676,4 +676,15 @@ 'sound/weapons/marauder.ogg', 'sound/weapons/laserdeep.ogg', 'sound/weapons/laserstrong.ogg' -) \ No newline at end of file +) + +/decl/sound_category/quick_arcade // quick punchy arcade sounds + sounds = list( + 'sound/arcade/get_fuel.ogg', + 'sound/arcade/heal.ogg', + 'sound/arcade/hit.ogg', + 'sound/arcade/kill_crew.ogg', + 'sound/arcade/lose_fuel.ogg', + 'sound/arcade/mana.ogg', + 'sound/arcade/steal.ogg' + ) \ No newline at end of file diff --git a/code/modules/customitems/item_defines.dm b/code/modules/customitems/item_defines.dm index 12c30f637fb..724c1dc2f6e 100644 --- a/code/modules/customitems/item_defines.dm +++ b/code/modules/customitems/item_defines.dm @@ -1991,4 +1991,182 @@ All custom items with worn sprites must follow the contained sprite system: http icon_state = "rajka_suit" item_state = "rajka_suit" contained_sprite = TRUE - species_restricted = list(BODYTYPE_TAJARA) \ No newline at end of file + species_restricted = list(BODYTYPE_TAJARA) + + +/obj/item/fluff/holoconsole // Holoconsole - Qoi Liuiq - shestrying + name = "holoconsole" + desc = "A game console capable of displaying a three-dimensional, holographic image of the player's game of choice. It's pink!" + icon = 'icons/obj/custom_items/qoi_console.dmi' + icon_state = "console" + + var/on = FALSE + var/obj/item/fluff/holoconsole_controller/left_controller + var/obj/item/fluff/holoconsole_controller/r/right_controller + var/mutable_appearance/screen + + var/sound_delay = 0.5 SECONDS // so we don't deafen everyone by spam clicking + var/last_sound = 0 + +/obj/item/fluff/holoconsole/Initialize() + . = ..() + left_controller = new /obj/item/fluff/holoconsole_controller(src) + right_controller = new /obj/item/fluff/holoconsole_controller/r(src) + verbs += /obj/item/fluff/holoconsole/proc/remove_left + verbs += /obj/item/fluff/holoconsole/proc/remove_right + screen = mutable_appearance(icon, "screen") + update_icon() + +/obj/item/fluff/holoconsole/Destroy() + QDEL_NULL(left_controller) + QDEL_NULL(right_controller) + return ..() + +/obj/item/fluff/holoconsole/update_icon() + icon_state = "console[left_controller ? "_l" : ""][right_controller ? "_r" : ""]" + +/obj/item/fluff/holoconsole/attack_self(mob/user) + if(on && !(world.time < last_sound + sound_delay)) + playsound(loc, /decl/sound_category/quick_arcade, 60) + last_sound = world.time + return + return ..() + +/obj/item/fluff/holoconsole/attackby(obj/item/I, mob/user) + switch(I.type) + if(/obj/item/fluff/holoconsole_controller) + if(left_controller) + to_chat(user, SPAN_WARNING("\The [src] already has its left controller connected!")) + return + user.visible_message("[user] slots \the [I] back into to \the [src].", SPAN_NOTICE("You slot \the [I] back into \the [src].")) + user.drop_from_inventory(I, src) + left_controller = I + left_controller.parent_console = null + verbs += /obj/item/fluff/holoconsole/proc/remove_left + update_icon() + return + if(/obj/item/fluff/holoconsole_controller/r) + if(right_controller) + to_chat(user, SPAN_WARNING("\The [src] already has its right controller connected!")) + return + user.visible_message("[user] slots \the [I] back into to \the [src].", SPAN_NOTICE("You slot \the [I] back into \the [src].")) + user.drop_from_inventory(I, src) + right_controller = I + right_controller.parent_console = null + verbs += /obj/item/fluff/holoconsole/proc/remove_right + update_icon() + return + return ..() + +/obj/item/fluff/holoconsole/verb/toggle_on() + set name = "Toggle On" + set category = "Object" + set src in view(1) + + on = !on + usr.visible_message("[usr] turns \the [src] [on ? "on" : "off"].", SPAN_NOTICE("You turn \the [src] [on ? "on" : "off"].")) + if(on) + playsound(loc, 'sound/machines/synth_yes.ogg', 50) + add_overlay(screen) + else + playsound(loc, 'sound/machines/synth_no.ogg', 50) + cut_overlay(screen) + update_icon() + +/obj/item/fluff/holoconsole/proc/remove_left() + set name = "Remove Left Controller" + set category = "Object" + set src in view(1) + + usr.visible_message("[usr] removes the left controller from \the [src], flicking it open.", SPAN_NOTICE("You remove the left controller from \the [src], flicking it open.")) + usr.put_in_hands(left_controller) + left_controller.parent_console = WEAKREF(src) + left_controller = null + verbs -= /obj/item/fluff/holoconsole/proc/remove_left + update_icon() + +/obj/item/fluff/holoconsole/proc/remove_right() + set name = "Remove Right Controller" + set category = "Object" + set src in view(1) + + usr.visible_message("[usr] removes the right controller from \the [src], flicking it open.", SPAN_NOTICE("You remove the right controller from \the [src], flicking it open.")) + usr.put_in_hands(right_controller) + right_controller.parent_console = WEAKREF(src) + right_controller = null + verbs -= /obj/item/fluff/holoconsole/proc/remove_right + update_icon() + +/obj/item/fluff/holoconsole_controller // Holoconsole - Qoi Liuiq - shestrying + name = "left holoconsole controller" + desc = "A controller for the Holoconsole, capable of folding in half and re-attaching to the machine. It's pink!" + icon = 'icons/obj/custom_items/qoi_console.dmi' + icon_state = "controller" + + var/datum/weakref/parent_console + var/sound_delay = 0.5 SECONDS // so we don't deafen everyone by spam clicking + var/last_sound = 0 + +/obj/item/fluff/holoconsole_controller/attack_self(mob/user) + if(world.time < last_sound + sound_delay) + return + + var/obj/item/fluff/holoconsole/H = parent_console.resolve() + if(H?.on) + playsound(H.loc, /decl/sound_category/quick_arcade, 60) + last_sound = world.time + +/obj/item/fluff/holoconsole_controller/r // Holoconsole - Qoi Liuiq - shestrying + name = "right holoconsole controller" + +/obj/item/fluff/holocase // Holoconsole Case - Qoi Liuiq - shestrying + name = "holoconsole case" + desc = "A case for the Holoconsole. This one is made of fabric, with various iron-on patches attached to it. It's pink!" + icon = 'icons/obj/custom_items/qoi_console.dmi' + icon_state = "case" + + var/spinned = FALSE + var/obj/item/fluff/holoconsole/contained_console + +/obj/item/fluff/holocase/Initialize() + . = ..() + contained_console = new /obj/item/fluff/holoconsole(src) + +/obj/item/fluff/holocase/Destroy() + QDEL_NULL(contained_console) + return ..() + +/obj/item/fluff/holocase/update_icon() + if(!contained_console) + icon_state = "case_o" + return + icon_state = spinned ? "case_b" : "case" + +/obj/item/fluff/holocase/attack_self(mob/user) + if(!contained_console) + to_chat(user, SPAN_WARNING("\The [src] doesn't have a console inside it! Insert it before trying to spin \the [src] around.")) + return + spinned = !spinned + user.visible_message("[usr] deftly spins \the [src], showing its [spinned ? "back" : "front"].", SPAN_NOTICE("You deftly spin \the [src], showing its [spinned ? "back" : "front"].")) + update_icon() + +/obj/item/fluff/holocase/attack_hand(mob/user) + if(contained_console && src == user.get_inactive_hand()) + user.visible_message("[usr] removes \the [contained_console] from \the [src].", SPAN_NOTICE("You remove \the [contained_console] from \the [src].")) + user.put_in_hands(contained_console) + contained_console = null + update_icon() + return + return ..() + +/obj/item/fluff/holocase/attackby(obj/item/I, mob/user) + if(istype(I, /obj/item/fluff/holoconsole)) + if(contained_console) + to_chat(user, SPAN_WARNING("\The [src] already contains a holoconsole!")) + return + user.drop_from_inventory(I, src) + contained_console = I + user.visible_message("[usr] puts \the [contained_console] into \the [src], zipping it back up.", SPAN_NOTICE("You put \the [contained_console] into \the [src], zipping it back up.")) + update_icon() + return + return ..() \ No newline at end of file diff --git a/icons/obj/custom_items/qoi_console.dmi b/icons/obj/custom_items/qoi_console.dmi new file mode 100644 index 0000000000000000000000000000000000000000..c17a553a0d1a3f8914246a93e079ea62dbd8cf1a GIT binary patch literal 2832 zcmaJ@do>F14A4TxZR!8zG*GT-#70a*2`q zr6Lg}Y$k?MPc4rj_hr9z&hK~5?>xVAe&>8XpVuF+&w0N;@AH10*XNz&>TItdhmZpR zK*7<$_P7{n;_VBT7N5gpvZEME$tT?-Yy&U(hvP#d@T7|X5R;cWP%YPK1ect&5S>8I zdcHug_YP{SbKUf+f3gxdxJ~BjG6VwA53*c^{Cxz;^*3XF#Wse))K0^{n|U3NHhUx` zO|~caMSBbyI6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