diff --git a/code/game/machinery/clawmachine.dm b/code/game/machinery/clawmachine.dm new file mode 100644 index 0000000000..b9ce0dd797 --- /dev/null +++ b/code/game/machinery/clawmachine.dm @@ -0,0 +1,214 @@ + +//Original Codebase created by Shadowfire117#1269 - Ported from CHOMPstation +//Modified by GhostActual#2055 to produce Claw Machine + +/* + * Space Crane + */ + +/obj/machinery/clawmachine + name = "Space Crane" + desc = "Try your luck at winning a cute plush toy! No refunds, and whining won't win you anything." + icon = 'icons/obj/computer.dmi' + icon_state = "clawmachine" + anchored = 1 + density = 1 + power_channel = EQUIP + use_power = USE_POWER_IDLE + idle_power_usage = 10 + active_power_usage = 100 + light_power = 0.9 + light_range = 2 + light_color = "#B1FBBFF" + var/isbroken = 0 //1 if someone banged it with something heavy + var/ispowered = 1 //starts powered, changes with power_change() + var/busy = 0 + var/symbol1 = null + var/symbol2 = null + var/symbol3 = null + var/list/prizes = list(/obj/random/carp_plushie, + /obj/item/toy/plushie/nymph, + /obj/item/toy/plushie/teshari, + /obj/item/toy/plushie/mouse, + /obj/item/toy/plushie/kitten, + /obj/item/toy/plushie/lizard, + /obj/item/toy/plushie/spider, + /obj/item/toy/plushie/farwa, + /obj/item/toy/plushie/corgi, + /obj/item/toy/plushie/girly_corgi, + /obj/item/toy/plushie/robo_corgi, + /obj/item/toy/plushie/octopus, + /obj/item/toy/plushie/face_hugger, + /obj/item/toy/plushie/red_fox, + /obj/item/toy/plushie/black_fox, + /obj/item/toy/plushie/marble_fox, + /obj/item/toy/plushie/blue_fox, + /obj/item/toy/plushie/orange_fox, + /obj/item/toy/plushie/coffee_fox, + /obj/item/toy/plushie/pink_fox, + /obj/item/toy/plushie/purple_fox, + /obj/item/toy/plushie/crimson_fox, + /obj/item/toy/plushie/deer, + /obj/item/toy/plushie/black_cat, + /obj/item/toy/plushie/grey_cat, + /obj/item/toy/plushie/white_cat, + /obj/item/toy/plushie/orange_cat, + /obj/item/toy/plushie/siamese_cat, + /obj/item/toy/plushie/tabby_cat, + /obj/item/toy/plushie/tuxedo_cat, + /obj/item/toy/plushie/borgplushie/medihound, + /obj/item/toy/plushie/borgplushie/scrubpuppy, + /obj/item/toy/plushie/borgplushie/drake/sec, + /obj/item/toy/plushie/borgplushie/drake/med, + /obj/item/toy/plushie/borgplushie/drake/sci, + /obj/item/toy/plushie/borgplushie/drake/eng, + /obj/item/toy/plushie/borgplushie/drake/mine, + /obj/item/toy/plushie/borgplushie/drake/jani, + /obj/item/toy/plushie/borgplushie/drake/trauma, + /obj/item/toy/plushie/otter + ) + +/obj/machinery/clawmachine/update_icon() + cut_overlays() + if(!ispowered || isbroken) + icon_state = "clawmachine_off" + if(isbroken) //If the thing is smashed, add crack overlay on top of the unpowered sprite. + add_overlay("clawmachine_broken") + set_light(0) + set_light_on(FALSE) + return + + icon_state = "clawmachine" + set_light(2) + set_light_on(TRUE) + return + +/obj/machinery/clawmachine/power_change() + if(isbroken) //Broken shit can't be powered. + return + ..() + if(!(stat & NOPOWER)) + ispowered = 1 + update_icon() + else + spawn(rand(0, 15)) + ispowered = 0 + update_icon() + +/obj/machinery/clawmachine/attackby(obj/item/weapon/W as obj, mob/user as mob) + if(busy) + to_chat(user,"The claw machine is currently running. ") + return + if(W.is_wrench()) + playsound(src, W.usesound, 100, 1) + if(anchored) + user.visible_message("[user] begins unsecuring \the [src] from the floor.", "You start unsecuring \the [src] from the floor.") + else + user.visible_message("[user] begins securing \the [src] to the floor.", "You start securing \the [src] to the floor.") + + if(do_after(user, 20 * W.toolspeed)) + if(!src) return + to_chat(user, "You [anchored? "un" : ""]secured \the [src]!") + anchored = !anchored + return + + if(!anchored) + to_chat(user," The machine isn't secured.") + return + + var/handled = 0 + var/paid = 0 + + if(istype(W, /obj/item/weapon/spacecash)) + var/obj/item/weapon/spacecash/C = W + paid = insert_cash(C, user) + handled = 1 + if(paid) + return + if(handled) + SStgui.update_uis(src) + return // don't smack that machine with your 2 chips + + else if(!(stat & NOPOWER)) + return + + else if(isbroken) + return + +/obj/machinery/clawmachine/proc/prizevend() + if(LAZYLEN(prizes)) + var/prizeselect = pickweight(prizes) + new prizeselect(src.loc) + +/obj/machinery/clawmachine/proc/insert_cash(var/obj/item/weapon/spacecash/cashmoney, mob/user) + if (ispowered == 0) + return + if (isbroken) + return + if(busy) + to_chat(user,"The claw machine is currently running. ") + return + if(cashmoney.worth < 5) + to_chat(user,"You dont have enough Thalers to play! ") + return + + to_chat(user,"You put 5 Thalers in the claw machine and press start.") + cashmoney.worth -= 5 + cashmoney.update_icon() + + if(cashmoney.worth <= 0) + usr.drop_from_inventory(cashmoney) + qdel(cashmoney) + cashmoney.update_icon() + + busy = 1 + icon_state = "clawmachine_play" + playsound(src.loc, 'sound/machines/clawmachine_play.ogg', 50, 0) + + var/slot1 = rand(0,4) + switch(slot1) + if(0 to 2) symbol1 = "one" + if(3 to 4) symbol1 = "two" + + var/slot2 = rand(0,4) + switch(slot2) + if(0 to 2) symbol2 = "one" + if(3 to 4) symbol2 = "two" + + var/slot3 = rand(0,4) + switch(slot3) + if(0 to 2) symbol3 = "one" + if(3 to 4) symbol3 = "two" + + var/output //Output variable to send out in chat after the large if statement. + var/winnings = 0 //If you win a toy or not + var/delaytime = 7 SECONDS + + spawn(delaytime) + to_chat(user,"The clam machine lights up and starts to play!") + + if (symbol1 == "one" && symbol2 == "one" && symbol3 == "one") + output = "Hooray! You Win!" + winnings = TRUE + + if (symbol1 == "two" && symbol2 == "two" && symbol3 == "two") + output = "Hooray! You Win!!" + winnings = TRUE + + icon_state = initial(icon_state) // Set it back to the original iconstate. + + if(!output) // Is there anything to output? If not, consider it a loss. + to_chat(user,"Better luck next time!") + busy = FALSE + return + + to_chat(user,output) //Output message + + if(winnings) //Did the person win? + icon_state = "clawmachine_win" + prizevend() + playsound(src.loc, 'sound/machines/clawmachine_win.ogg', 50, 0) + spawn(delaytime) + icon_state = "clawmachine" + + busy = FALSE \ No newline at end of file diff --git a/code/game/objects/items/toys/toys_vr.dm b/code/game/objects/items/toys/toys_vr.dm index d114b6e4ab..c55a6bf6e4 100644 --- a/code/game/objects/items/toys/toys_vr.dm +++ b/code/game/objects/items/toys/toys_vr.dm @@ -99,16 +99,55 @@ name = "janihound plushie" icon_state = "scrubpuppy" -/obj/item/toy/plushie/borgplushie/drakiesec - name = "security drake plushie" +/obj/item/toy/plushie/borgplushie/drake icon = 'icons/obj/drakietoy_vr.dmi' + var/lights_glowing = FALSE + +/obj/item/toy/plushie/borgplushie/drake/AltClick(mob/living/user) + . = ..() + var/turf/T = get_turf(src) + if(!T.AdjacentQuick(user)) // So people aren't messing with these from across the room + return FALSE + lights_glowing = !lights_glowing + to_chat(user, "You turn the [src]'s glow-fabric [lights_glowing ? "on" : "off"].") + update_icon() + +/obj/item/toy/plushie/borgplushie/drake/update_icon() + cut_overlays() + if (lights_glowing) + add_overlay(emissive_appearance(icon, "[icon_state]-lights")) + +/obj/item/toy/plushie/borgplushie/drake/get_description_info() + return "The lights on the plushie can be toggled [lights_glowing ? "off" : "on"] by alt-clicking on it." + +/obj/item/toy/plushie/borgplushie/drake/sec + name = "security drake plushie" icon_state = "secdrake" -/obj/item/toy/plushie/borgplushie/drakiemed +/obj/item/toy/plushie/borgplushie/drake/med name = "medical drake plushie" - icon = 'icons/obj/drakietoy_vr.dmi' icon_state = "meddrake" +/obj/item/toy/plushie/borgplushie/drake/sci + name = "science drake plushie" + icon_state = "scidrake" + +/obj/item/toy/plushie/borgplushie/drake/jani + name = "janitor drake plushie" + icon_state = "janidrake" + +/obj/item/toy/plushie/borgplushie/drake/eng + name = "engineering drake plushie" + icon_state = "engdrake" + +/obj/item/toy/plushie/borgplushie/drake/mine + name = "mining drake plushie" + icon_state = "minedrake" + +/obj/item/toy/plushie/borgplushie/drake/trauma + name = "trauma drake plushie" + icon_state = "traumadrake" + /obj/item/toy/plushie/foxbear name = "toy fox" desc = "Issa fox!" diff --git a/code/game/objects/random/misc.dm b/code/game/objects/random/misc.dm index 934d119d77..43136c4c58 100644 --- a/code/game/objects/random/misc.dm +++ b/code/game/objects/random/misc.dm @@ -753,8 +753,18 @@ /obj/item/toy/plushie/nukeplushie, /obj/item/toy/plushie/otter, /obj/item/toy/plushie/vox, +<<<<<<< HEAD /obj/item/toy/plushie/borgplushie/drakiesec, /obj/item/toy/plushie/borgplushie/drakiemed, +======= + pick(list(/obj/item/toy/plushie/borgplushie/drake/sec, + /obj/item/toy/plushie/borgplushie/drake/med, + /obj/item/toy/plushie/borgplushie/drake/sci, + /obj/item/toy/plushie/borgplushie/drake/jani, + /obj/item/toy/plushie/borgplushie/drake/eng, + /obj/item/toy/plushie/borgplushie/drake/mine, + /obj/item/toy/plushie/borgplushie/drake/trauma))) +>>>>>>> 922b787c46... Merge pull request #14568 from Seris02/janidrakeplush //VOREStation Add End //YawnWider Add Start /obj/item/toy/plushie/teshari/_yw, diff --git a/code/modules/client/preference_setup/loadout/loadout_general.dm b/code/modules/client/preference_setup/loadout/loadout_general.dm index 53caa5bc8b..8f48544039 100644 --- a/code/modules/client/preference_setup/loadout/loadout_general.dm +++ b/code/modules/client/preference_setup/loadout/loadout_general.dm @@ -57,6 +57,7 @@ // look if theres a better way to do this im all ears blacklisted_types += subtypesof(/obj/item/toy/plushie/therapy) blacklisted_types += subtypesof(/obj/item/toy/plushie/fluff) + blacklisted_types += /obj/item/toy/plushie/borgplushie/drake //VOREStation addition for(var/obj/item/toy/plushie/plushie_type as anything in subtypesof(/obj/item/toy/plushie) - blacklisted_types) plushies[initial(plushie_type.name)] = plushie_type gear_tweaks += new/datum/gear_tweak/path(sortAssoc(plushies)) diff --git a/icons/mob/drakeborg/Drakeborg-Licensing.txt b/icons/mob/drakeborg/Drakeborg-Licensing.txt index f2d3ca925c..013b2e8376 100644 --- a/icons/mob/drakeborg/Drakeborg-Licensing.txt +++ b/icons/mob/drakeborg/Drakeborg-Licensing.txt @@ -1,5 +1,8 @@ Drakeborg & drakeplushies are created by deviantart.com/mizartz +Drakeplushies science, engineering, mining, trauma and janitorial are Adaptations of the drakeplushies above, created by github.com/Seris02. +Drakeborg (science) in this codebase is an Adaptation of the science drakeborg (lights have been altered), altered by github.com/Seris02. + https://creativecommons.org/licenses/by-nc-sa/3.0/ Attribution-NonCommercial-ShareAlike 3.0 Unported diff --git a/icons/mob/drakeborg/drakeborg_vr.dmi b/icons/mob/drakeborg/drakeborg_vr.dmi index 56a79ce19c..2165e78525 100644 Binary files a/icons/mob/drakeborg/drakeborg_vr.dmi and b/icons/mob/drakeborg/drakeborg_vr.dmi differ diff --git a/icons/obj/drakietoy_vr.dmi b/icons/obj/drakietoy_vr.dmi index 34a4932513..5d85adac8c 100644 Binary files a/icons/obj/drakietoy_vr.dmi and b/icons/obj/drakietoy_vr.dmi differ