mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-09 07:08:03 +01:00
21b4095dfd
Upstream 04/17/2026 fixes https://github.com/Bubberstation/Bubberstation/issues/5549 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: tgstation-ci[bot] <179393467+tgstation-ci[bot]@users.noreply.github.com> Co-authored-by: ArcaneMusic <41715314+ArcaneMusic@users.noreply.github.com> Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com> Co-authored-by: Rhials <28870487+Rhials@users.noreply.github.com> Co-authored-by: rageguy505 <54517726+rageguy505@users.noreply.github.com> Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com> Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com> Co-authored-by: Aliceee2ch <160794176+Aliceee2ch@users.noreply.github.com> Co-authored-by: Time-Green <7501474+Time-Green@users.noreply.github.com> Co-authored-by: Tsar-Salat <62388554+Tsar-Salat@users.noreply.github.com> Co-authored-by: SmArtKar <44720187+SmArtKar@users.noreply.github.com> Co-authored-by: Maxipat <108554989+Maxipat112@users.noreply.github.com> Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com> Co-authored-by: deltanedas <39013340+deltanedas@users.noreply.github.com> Co-authored-by: SimplyLogan <47579821+loganuk@users.noreply.github.com> Co-authored-by: loganuk <fakeemail123@aol.com> Co-authored-by: Leland Kemble <70413276+lelandkemble@users.noreply.github.com> Co-authored-by: FalloutFalcon <86381784+FalloutFalcon@users.noreply.github.com> Co-authored-by: Roxy <75404941+TealSeer@users.noreply.github.com> Co-authored-by: Lucy <lucy@absolucy.moe> Co-authored-by: siliconOpossum <138069572+siliconOpossum@users.noreply.github.com> Co-authored-by: Isratosh <Isratosh@hotmail.com> Co-authored-by: TheRyeGuyWhoWillNowDie <70169560+TheRyeGuyWhoWillNowDie@users.noreply.github.com> Co-authored-by: Neocloudy <88008002+Neocloudy@users.noreply.github.com> Co-authored-by: Alexander V. <volas@ya.ru> Co-authored-by: ElGitificador <168473461+ElGitificador@users.noreply.github.com> Co-authored-by: Twaticus <46540570+Twaticus@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com> Co-authored-by: Cameron Lennox <killer65311@gmail.com> Co-authored-by: Tim <timothymtorres@gmail.com> Co-authored-by: Iamgoofball <iamgoofball@gmail.com> Co-authored-by: Layzu666 <121319428+Layzu666@users.noreply.github.com> Co-authored-by: Arturlang <24881678+Arturlang@users.noreply.github.com> Co-authored-by: _0Steven <42909981+00-Steven@users.noreply.github.com> Co-authored-by: mrmanlikesbt <99309552+mrmanlikesbt@users.noreply.github.com> Co-authored-by: Ben10Omintrix <138636438+Ben10Omintrix@users.noreply.github.com> Co-authored-by: John F. Kennedy <54908920+MacaroniCritter@users.noreply.github.com> Co-authored-by: Cursor <102828457+theselfish@users.noreply.github.com> Co-authored-by: Josh <josh.adam.powell@gmail.com> Co-authored-by: Josh Powell <josh.powell@softwire.com> Co-authored-by: Yobrocharlie <Charliemiller5617@gmail.com> Co-authored-by: Hardly3D <66234359+Hardly3D@users.noreply.github.com> Co-authored-by: shayoki <96078776+shayoki@users.noreply.github.com> Co-authored-by: LT3 <83487515+lessthnthree@users.noreply.github.com>
259 lines
8.2 KiB
Plaintext
259 lines
8.2 KiB
Plaintext
|
|
|
|
/*
|
|
* Wrapping Paper
|
|
*/
|
|
|
|
/obj/item/stack/wrapping_paper
|
|
name = "wrapping paper"
|
|
desc = "Wrap packages with this festive paper to make gifts."
|
|
icon = 'icons/obj/stack_objects.dmi'
|
|
icon_state = "wrap_paper"
|
|
inhand_icon_state = "wrap_paper"
|
|
greyscale_config = /datum/greyscale_config/wrap_paper
|
|
amount = 25
|
|
max_amount = 25
|
|
resistance_flags = FLAMMABLE
|
|
merge_type = /obj/item/stack/wrapping_paper
|
|
singular_name = "wrapping paper"
|
|
throwforce = 0
|
|
w_class = WEIGHT_CLASS_TINY
|
|
throw_speed = 3
|
|
throw_range = 5
|
|
hitsound = 'sound/effects/bonk.ogg'
|
|
|
|
/obj/item/stack/wrapping_paper/Initialize(mapload)
|
|
. = ..()
|
|
ADD_TRAIT(src, TRAIT_CUSTOM_TAP_SOUND, INNATE_TRAIT)
|
|
|
|
/obj/item/stack/wrapping_paper/attack(mob/living/target_mob, mob/living/user, list/modifiers, list/attack_modifiers)
|
|
. = ..()
|
|
user.visible_message(
|
|
span_warning("[user] baps [target_mob] on the head with [src]!"),
|
|
span_warning("You bap [target_mob] on the head with [src]!"),
|
|
)
|
|
target_mob.add_mood_event("roll", /datum/mood_event/bapped)
|
|
|
|
/obj/item/stack/wrapping_paper/Initialize(mapload)
|
|
. = ..()
|
|
if(!greyscale_colors)
|
|
//Generate random valid colors for paper and ribbon
|
|
var/generated_base_color = "#" + random_color()
|
|
var/generated_ribbon_color = "#" + random_color()
|
|
var/list/base_hsv = rgb2hsv(generated_base_color)
|
|
var/list/ribbon_hsv = rgb2hsv(generated_ribbon_color)
|
|
|
|
//If colors are too dark, set to original colors
|
|
if(base_hsv[3] < 50)
|
|
generated_base_color = COLOR_VIBRANT_LIME
|
|
if(ribbon_hsv[3] < 50)
|
|
generated_ribbon_color = COLOR_RED
|
|
|
|
//Set layers to these colors, base then ribbon
|
|
set_greyscale(colors = list(generated_base_color, generated_ribbon_color))
|
|
|
|
/obj/item/stack/wrapping_paper/click_alt(mob/user)
|
|
var/new_base = tgui_color_picker(user, "", "Select a base color", color)
|
|
var/new_ribbon = tgui_color_picker(user, "", "Select a ribbon color", color)
|
|
if(!new_base || !new_ribbon)
|
|
return CLICK_ACTION_BLOCKING
|
|
|
|
set_greyscale(colors = list(new_base, new_ribbon))
|
|
return CLICK_ACTION_SUCCESS
|
|
|
|
//preset wrapping paper meant to fill the original color configuration
|
|
/obj/item/stack/wrapping_paper/xmas
|
|
icon = 'icons/map_icons/items/_item.dmi'
|
|
icon_state = "/obj/item/stack/wrapping_paper/xmas"
|
|
post_init_icon_state = "wrap_paper"
|
|
greyscale_colors = "#00FF00#FF0000"
|
|
|
|
/obj/item/stack/wrapping_paper/use(used, transfer, check = TRUE)
|
|
var/turf/T = get_turf(src)
|
|
. = ..()
|
|
if(QDELETED(src) && !transfer)
|
|
new /obj/item/c_tube(T)
|
|
|
|
/obj/item/stack/wrapping_paper/small
|
|
desc = "Wrap packages with this festive paper to make gifts. This roll looks a bit skimpy."
|
|
amount = 10
|
|
merge_type = /obj/item/stack/wrapping_paper/small
|
|
|
|
/*
|
|
* Package Wrap
|
|
*/
|
|
|
|
/obj/item/stack/package_wrap
|
|
name = "package wrapper"
|
|
singular_name = "wrapping sheet"
|
|
desc = "You can use this to wrap items in."
|
|
icon = 'icons/obj/stack_objects.dmi'
|
|
icon_state = "deliveryPaper"
|
|
item_flags = NOBLUDGEON
|
|
amount = 25
|
|
max_amount = 25
|
|
resistance_flags = FLAMMABLE
|
|
merge_type = /obj/item/stack/package_wrap
|
|
|
|
/obj/item/stack/package_wrap/grind_results()
|
|
return list(/datum/reagent/cellulose = 5)
|
|
|
|
/obj/item/stack/package_wrap/suicide_act(mob/living/user)
|
|
user.visible_message(span_suicide("[user] begins wrapping [user.p_them()]self in \the [src]! It looks like [user.p_theyre()] trying to commit suicide!"))
|
|
if(use(3))
|
|
var/obj/item/delivery/big/parcel = new(get_turf(user.loc))
|
|
parcel.base_icon_state = "deliverypackage5"
|
|
parcel.update_icon()
|
|
user.forceMove(parcel)
|
|
parcel.contains_mobs = TRUE // SKYRAT EDIT - CARGO BORGS
|
|
parcel.add_fingerprint(user)
|
|
return OXYLOSS
|
|
else
|
|
balloon_alert(user, "not enough paper!")
|
|
return SHAME
|
|
|
|
/obj/item/proc/can_be_package_wrapped() //can the item be wrapped with package wrapper into a delivery package
|
|
return TRUE
|
|
|
|
/obj/item/storage/can_be_package_wrapped()
|
|
return FALSE
|
|
|
|
/obj/item/storage/box/can_be_package_wrapped()
|
|
return TRUE
|
|
|
|
/obj/item/delivery/can_be_package_wrapped()
|
|
return FALSE
|
|
|
|
/obj/item/stack/package_wrap/interact_with_atom(obj/interacting_with, mob/living/user, list/modifiers)
|
|
if(!isobj(interacting_with))
|
|
return NONE
|
|
if(interacting_with.anchored)
|
|
return NONE
|
|
// SKYRAT EDIT START - Cargo borgs
|
|
if(!amount)
|
|
return
|
|
// SKYRAT EDIT END
|
|
|
|
if(isitem(interacting_with))
|
|
var/obj/item/item = interacting_with
|
|
if(!item.can_be_package_wrapped())
|
|
if(SHOULD_SKIP_INTERACTION(interacting_with, src, user))
|
|
return NONE // put it in the bag instead of yelling
|
|
balloon_alert(user, "can't be wrapped!")
|
|
return ITEM_INTERACT_BLOCKING
|
|
if(user.is_holding(item))
|
|
if(!user.dropItemToGround(item))
|
|
return ITEM_INTERACT_BLOCKING
|
|
else if(!isturf(item.loc))
|
|
return ITEM_INTERACT_BLOCKING
|
|
if(use(1))
|
|
var/obj/item/delivery/small/parcel = new(get_turf(item.loc))
|
|
if(user.Adjacent(item))
|
|
parcel.add_fingerprint(user)
|
|
item.add_fingerprint(user)
|
|
user.put_in_hands(parcel)
|
|
item.forceMove(parcel)
|
|
var/size = round(item.w_class)
|
|
if(istype(item, /obj/item/disk))
|
|
parcel.base_icon_state = "deliveryfloppy"
|
|
parcel.name = "floppy disk parcel"
|
|
else
|
|
parcel.base_icon_state = "deliverypackage[size]"
|
|
parcel.name = "[weight_class_to_text(size)] parcel"
|
|
parcel.update_weight_class(size)
|
|
size = min(size, 5)
|
|
parcel.update_icon()
|
|
else
|
|
return ITEM_INTERACT_BLOCKING
|
|
|
|
else if(istype(interacting_with, /obj/structure/closet))
|
|
var/obj/structure/closet/closet = interacting_with
|
|
if(closet.opened)
|
|
balloon_alert(user, "can't wrap while open!")
|
|
return ITEM_INTERACT_BLOCKING
|
|
if(!closet.delivery_icon) //no delivery icon means unwrappable closet (e.g. body bags)
|
|
balloon_alert(user, "can't wrap!")
|
|
return ITEM_INTERACT_BLOCKING
|
|
if(use(3))
|
|
var/obj/item/delivery/big/parcel = new(get_turf(closet.loc))
|
|
var/mob/being_pulled_by = closet.pulledby
|
|
being_pulled_by?.start_pulling(parcel)
|
|
parcel.base_icon_state = closet.delivery_icon
|
|
parcel.update_icon()
|
|
parcel.drag_slowdown = closet.drag_slowdown
|
|
closet.forceMove(parcel)
|
|
parcel.add_fingerprint(user)
|
|
closet.add_fingerprint(user)
|
|
// SKYRAT EDIT START - CARGO BORGS
|
|
for(var/item in closet.get_all_contents())
|
|
if(istype(item, /mob))
|
|
parcel.contains_mobs = TRUE
|
|
break
|
|
// SKYRAT EDIT END
|
|
else
|
|
balloon_alert(user, "not enough paper!")
|
|
return ITEM_INTERACT_BLOCKING
|
|
else if(istype(interacting_with, /obj/machinery/portable_atmospherics))
|
|
var/obj/machinery/portable_atmospherics/portable_atmospherics = interacting_with
|
|
if(portable_atmospherics.anchored)
|
|
balloon_alert(user, "can't wrap while anchored!")
|
|
return ITEM_INTERACT_BLOCKING
|
|
if(use(3))
|
|
var/obj/item/delivery/big/parcel = new(get_turf(portable_atmospherics.loc))
|
|
parcel.base_icon_state = "deliverybox"
|
|
parcel.update_icon()
|
|
parcel.drag_slowdown = portable_atmospherics.drag_slowdown
|
|
portable_atmospherics.forceMove(parcel)
|
|
parcel.add_fingerprint(user)
|
|
portable_atmospherics.add_fingerprint(user)
|
|
else
|
|
balloon_alert(user, "not enough paper!")
|
|
return ITEM_INTERACT_BLOCKING
|
|
|
|
else
|
|
balloon_alert(user, "can't wrap!")
|
|
return ITEM_INTERACT_BLOCKING
|
|
|
|
user.visible_message(span_notice("[user] wraps [interacting_with]."))
|
|
user.log_message("has used [name] on [key_name(interacting_with)]", LOG_ATTACK, color="blue")
|
|
return ITEM_INTERACT_SUCCESS
|
|
|
|
/obj/item/stack/package_wrap/use(used, transfer = FALSE, check = TRUE)
|
|
var/turf/T = get_turf(src)
|
|
. = ..()
|
|
if(QDELETED(src) && !transfer)
|
|
new /obj/item/c_tube(T)
|
|
|
|
/obj/item/stack/package_wrap/small
|
|
desc = "You can use this to wrap items in. This roll looks a bit skimpy."
|
|
w_class = WEIGHT_CLASS_SMALL
|
|
amount = 5
|
|
merge_type = /obj/item/stack/package_wrap/small
|
|
|
|
/obj/item/stack/package_wrap/one
|
|
amount = 1
|
|
|
|
/obj/item/c_tube
|
|
name = "cardboard tube"
|
|
desc = "A tube... of cardboard."
|
|
icon = 'icons/obj/stack_objects.dmi'
|
|
icon_state = "c_tube"
|
|
inhand_icon_state = "c_tube"
|
|
throwforce = 0
|
|
w_class = WEIGHT_CLASS_TINY
|
|
throw_speed = 3
|
|
throw_range = 5
|
|
hitsound = 'sound/effects/bonk.ogg'
|
|
|
|
/obj/item/c_tube/Initialize(mapload)
|
|
. = ..()
|
|
ADD_TRAIT(src, TRAIT_CUSTOM_TAP_SOUND, INNATE_TRAIT)
|
|
|
|
/obj/item/c_tube/attack(mob/living/target_mob, mob/living/user, list/modifiers, list/attack_modifiers)
|
|
. = ..()
|
|
user.visible_message(
|
|
span_warning("[user] baps [target_mob] on the head with [src]!"),
|
|
span_warning("You bap [target_mob] on the head with [src]!"),
|
|
)
|
|
target_mob.add_mood_event("roll", /datum/mood_event/bapped)
|