From 6392367df47825cf7bf88c99094d009033090ce6 Mon Sep 17 00:00:00 2001 From: Timothy Teakettle <59849408+timothyteakettle@users.noreply.github.com> Date: Tue, 18 Aug 2020 17:28:09 +0100 Subject: [PATCH 1/7] donator items --- code/__HELPERS/donator_groupings.dm | 10 +-- code/game/objects/items/miscellaneous.dm | 84 ++++++++++++++++--- code/game/objects/items/pet_carrier.dm | 3 + code/game/objects/structures/bedsheet_bin.dm | 16 +++- code/modules/client/preferences.dm | 4 +- .../code/modules/client/loadout/__donator.dm | 21 +++++ 6 files changed, 117 insertions(+), 21 deletions(-) diff --git a/code/__HELPERS/donator_groupings.dm b/code/__HELPERS/donator_groupings.dm index bdff20553a..4305fb1ed5 100644 --- a/code/__HELPERS/donator_groupings.dm +++ b/code/__HELPERS/donator_groupings.dm @@ -17,9 +17,9 @@ For fast lookups, this is generated using regenerate_donator_grouping_list() /proc/regenerate_donator_grouping_list() GLOB.donators_by_group = list() //reinit everything var/list/donator_list = GLOB.donators_by_group //cache - var/list/tier_1 = TIER_1_DONATORS - donator_list[DONATOR_GROUP_TIER_1] = tier_1.Copy() //The .Copy() is to "decouple"/make a new list, rather than letting the global list impact the config list. - var/list/tier_2 = tier_1 + TIER_2_DONATORS //Using + on lists implies making new lists, so we don't need to manually Copy(). + var/list/tier_3 = TIER_3_DONATORS + donator_list[DONATOR_GROUP_TIER_3] = tier_3.Copy() //The .Copy() is to "decouple"/make a new list, rather than letting the global list impact the config list. + var/list/tier_2 = tier_3 + TIER_2_DONATORS //Using + on lists implies making new lists, so we don't need to manually Copy(). donator_list[DONATOR_GROUP_TIER_2] = tier_2 - var/list/tier_3 = tier_2 + TIER_3_DONATORS - donator_list[DONATOR_GROUP_TIER_3] = tier_3 + var/list/tier_1 = tier_2 + TIER_1_DONATORS + donator_list[DONATOR_GROUP_TIER_1] = tier_1 diff --git a/code/game/objects/items/miscellaneous.dm b/code/game/objects/items/miscellaneous.dm index a7f7e3152c..735a425ff6 100644 --- a/code/game/objects/items/miscellaneous.dm +++ b/code/game/objects/items/miscellaneous.dm @@ -47,8 +47,11 @@ spawn_option(stored_options[choice],M) qdel(src) -/obj/item/choice_beacon/proc/spawn_option(obj/choice,mob/living/M) - var/obj/new_item = new choice() +/obj/item/choice_beacon/proc/create_choice_atom(atom/choice) + return new choice() + +/obj/item/choice_beacon/proc/spawn_option(atom/choice,mob/living/M) + var/obj/new_item = create_choice_atom(choice) var/obj/structure/closet/supplypod/bluespacepod/pod = new() pod.explosionSize = list(0,0,0,0) new_item.forceMove(pod) @@ -152,10 +155,44 @@ augment_list[initial(A.name)] = A return augment_list -/obj/item/choice_beacon/augments/spawn_option(obj/choice,mob/living/M) +/obj/item/choice_beacon/augments/spawn_option(atom/choice,mob/living/M) new choice(get_turf(M)) to_chat(M, "You hear something crackle from the beacon for a moment before a voice speaks. \"Please stand by for a message from S.E.L.F. Message as follows: Item request received. Your package has been transported, use the autosurgeon supplied to apply the upgrade. Message ends.\"") +/obj/item/choice_beacon/pet //donator beacon that summons a small friendly animal + name = "pet beacon" + desc = "Straight from the outerspace pet shop to your feet." + var/static/list/pets = list("Crab" = /mob/living/simple_animal/crab, + "Cat" = /mob/living/simple_animal/pet/cat, + "Space cat" = /mob/living/simple_animal/pet/cat/space, + "Kitten" = /mob/living/simple_animal/pet/cat/kitten, + "Dog" = /mob/living/simple_animal/pet/dog, + "Corgi" = /mob/living/simple_animal/pet/dog/corgi, + "Pug" = /mob/living/simple_animal/pet/dog/pug, + "Exotic Corgi" = /mob/living/simple_animal/pet/dog/corgi/exoticcorgi, + "Fox" = /mob/living/simple_animal/pet/fox, + "Red Panda" = /mob/living/simple_animal/pet/redpanda, + "Possum" = /mob/living/simple_animal/opossum) + var/pet_name + +/obj/item/choice_beacon/pet/generate_display_names() + return pets + +/obj/item/choice_beacon/pet/create_choice_atom(atom/choice) + var/mob/living/simple_animal/new_choice = new choice() + new_choice.butcher_results = null //please don't eat your pet, chef + var/obj/item/pet_carrier/donator/carrier = new() //a donator pet carrier is just a carrier that can't be shoved in an autolathe for metal + new_choice.forceMove(carrier) + new_choice.mob_size = MOB_SIZE_TINY //yeah we're not letting you use this roundstart pet to hurt people / knock them down + if(pet_name) + new_choice.name = pet_name + return carrier + +/obj/item/choice_beacon/pet/spawn_option(atom/choice,mob/living/M) + pet_name = input(M, "What would you like to name the pet? (leave blank for default name)", "Pet Name") + ..() + +//choice boxes (they just open in your hand instead of making a pod) /obj/item/choice_beacon/box name = "choice box (default)" desc = "Think really hard about what you want, and then rip it open!" @@ -163,21 +200,17 @@ icon_state = "deliverypackage3" item_state = "deliverypackage3" -/obj/item/choice_beacon/box/spawn_option(obj/choice,mob/living/M) - to_chat(M, "The box opens, revealing the [choice]!") +/obj/item/choice_beacon/box/spawn_option(atom/choice,mob/living/M) + var/choice_text = choice + if(ispath(choice_text)) + choice_text = initial(choice.name) + to_chat(M, "The box opens, revealing the [choice_text]!") playsound(src.loc, 'sound/items/poster_ripped.ogg', 50, 1) M.temporarilyRemoveItemFromInventory(src, TRUE) M.put_in_hands(new choice) qdel(src) -/obj/item/choice_beacon/box/plushie - name = "choice box (plushie)" - desc = "Using the power of quantum entanglement, this box contains every plush, until the moment it is opened!" - icon = 'icons/obj/plushes.dmi' - icon_state = "box" - item_state = "box" - -/obj/item/choice_beacon/box/spawn_option(choice,mob/living/M) +/obj/item/choice_beacon/box/plushie/spawn_option(choice,mob/living/M) if(ispath(choice, /obj/item/toy/plush)) ..() //regular plush, spawn it naturally else @@ -188,6 +221,31 @@ M.put_in_hands(new choice) qdel(src) +/obj/item/choice_beacon/box/carpet //donator carpet beacon + name = "choice box (carpet)" + desc = "Contains 50 of a selected carpet inside!" + var/static/list/carpet_list = list(/obj/item/stack/tile/carpet/black/fifty = "Black Carpet", + "Black & Red Carpet" = /obj/item/stack/tile/carpet/blackred/fifty, + "Monochrome Carpet" = /obj/item/stack/tile/carpet/monochrome/fifty, + "Blue Carpet" = /obj/item/stack/tile/carpet/blue/fifty, + "Cyan Carpet" = /obj/item/stack/tile/carpet/cyan/fifty, + "Green Carpet" = /obj/item/stack/tile/carpet/green/fifty, + "Orange Carpet" = /obj/item/stack/tile/carpet/orange/fifty, + "Purple Carpet" = /obj/item/stack/tile/carpet/purple/fifty, + "Red Carpet" = /obj/item/stack/tile/carpet/red/fifty, + "Royal Black Carpet" = /obj/item/stack/tile/carpet/royalblack/fifty, + "Royal Blue Carpet" = /obj/item/stack/tile/carpet/royalblue/fifty) + +/obj/item/choice_beacon/box/carpet/generate_display_names() + return carpet_list + +/obj/item/choice_beacon/box/plushie + name = "choice box (plushie)" + desc = "Using the power of quantum entanglement, this box contains every plush, until the moment it is opened!" + icon = 'icons/obj/plushes.dmi' + icon_state = "box" + item_state = "box" + /obj/item/choice_beacon/box/plushie/generate_display_names() var/list/plushie_list = list() //plushie set 1: just subtypes of /obj/item/toy/plush diff --git a/code/game/objects/items/pet_carrier.dm b/code/game/objects/items/pet_carrier.dm index a4b12dd629..ef2fb44d3d 100644 --- a/code/game/objects/items/pet_carrier.dm +++ b/code/game/objects/items/pet_carrier.dm @@ -29,6 +29,9 @@ var/has_lock_sprites = TRUE //whether to load the lock overlays or not var/allows_hostiles = FALSE //does the pet carrier allow hostile entities to be held within it? +/obj/item/pet_carrier/donator + custom_materials = null //you cant just use the loadout item to get free metal! + /obj/item/pet_carrier/Destroy() if(occupants.len) for(var/V in occupants) diff --git a/code/game/objects/structures/bedsheet_bin.dm b/code/game/objects/structures/bedsheet_bin.dm index 45cac650b8..c36fba96cb 100644 --- a/code/game/objects/structures/bedsheet_bin.dm +++ b/code/game/objects/structures/bedsheet_bin.dm @@ -243,10 +243,24 @@ LINEN BINS /obj/item/bedsheet/random/Initialize() ..() - var/type = pick(typesof(/obj/item/bedsheet) - /obj/item/bedsheet/random) + var/type = pick(typesof(/obj/item/bedsheet) - list(/obj/item/bedsheet/random, /obj/item/bedsheet/chameleon)) new type(loc) return INITIALIZE_HINT_QDEL +/obj/item/bedsheet/chameleon //donator chameleon bedsheet + name = "chameleon bedsheet" + desc = "Bedsheet technology has truly gone too far." + var/datum/action/item_action/chameleon/change/chameleon_action + +/obj/item/bedsheet/chameleon/New() + ..() + chameleon_action = new(src) + chameleon_action.chameleon_type = /obj/item/bedsheet + chameleon_action.chameleon_name = "Bedsheet" + chameleon_action.chameleon_blacklist = typecacheof(list(/obj/item/bedsheet/chameleon, /obj/item/bedsheet/random), only_root_path = TRUE) + chameleon_action.initialize_disguises() + +//bedsheet bin /obj/structure/bedsheetbin name = "linen bin" desc = "It looks rather cosy." diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 017a25db34..fddbb46847 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -791,9 +791,9 @@ GLOBAL_LIST_EMPTY(preferences_datums) dat += "" dat += "