diff --git a/code/game/objects/items/glassjar.dm b/code/game/objects/items/glassjar.dm index 7b9290f7ac9..4b573720438 100644 --- a/code/game/objects/items/glassjar.dm +++ b/code/game/objects/items/glassjar.dm @@ -1,7 +1,14 @@ -#define JAR_NOTHING 0 -#define JAR_MONEY 1 -#define JAR_ANIMAL 2 -#define JAR_SPIDERLING 3 +#define JAR_NOTHING 0 +#define JAR_MONEY 1 +#define JAR_ANIMAL 2 +#define JAR_SPIDERLING 3 +#define JAR_GUMBALL 4 + +// All of these defines below are to assist with gumball-related mechanics except for the contain define + +#define GUMBALL_MAX 15 +#define GUMBALL_MEDIUM 10 +#define GUMBALL_MIN 5 /obj/item/glass_jar name = "glass jar" @@ -12,7 +19,8 @@ matter = list(MATERIAL_GLASS = 200) recyclable = TRUE flags = NOBLUDGEON - var/contains = JAR_NOTHING // 0 = nothing, 1 = money, 2 = animal, 3 = spiderling + var/contains = JAR_NOTHING // 0 = nothing, 1 = money, 2 = animal, 3 = spiderling, 4 = gumballs + var/list/gumballs_contained = list() drop_sound = 'sound/items/drop/glass.ogg' pickup_sound = 'sound/items/pickup/glass.ogg' @@ -20,6 +28,11 @@ ..() update_icon() +/obj/item/glass_jar/MouseDrop(atom/target) + if(ishuman(target) || issmall(target) && target == usr && use_check_and_message(usr) && Adjacent(usr)) + if(contains == JAR_GUMBALL) + handle_gumball_removal(usr) + /obj/item/glass_jar/afterattack(var/atom/A, var/mob/user, var/proximity) if(!proximity || contains) return @@ -84,6 +97,9 @@ user.visible_message(SPAN_NOTICE("\The [user] puts [S.worth] [S.worth > 1 ? "credits" : "credit"] into \the [src].")) user.drop_from_inventory(S,src) update_icon() + + if(istype(A, /obj/item/clothing/mask/chewable/candy/gum/gumball)) + handle_gumball_addition(user, A) /obj/item/glass_jar/update_icon() // Also updates name and desc underlays.Cut() @@ -120,8 +136,56 @@ underlays += victim name = "glass jar with [S]" desc = "A small jar with [S] inside." + if(JAR_GUMBALL) + name = "gumball jar" + desc = "A jar containing gumballs with varying colours." + var/image/gumballs_overlay = image(icon) + switch(length(gumballs_contained)) + if(1 to GUMBALL_MIN) + gumballs_overlay.icon_state = "gumball_min" + if(6 to GUMBALL_MEDIUM) + gumballs_overlay.icon_state = "gumball_min" + if(11 to GUMBALL_MAX) + gumballs_overlay.icon_state = "gumball_max" + underlays += gumballs_overlay + return +/obj/item/glass_jar/proc/handle_gumball_addition(mob/user, var/obj/item/clothing/mask/chewable/candy/gum/gumball/G) // handles the entire gumbball addition process + if(length(gumballs_contained) < GUMBALL_MAX) + gumballs_contained += G + user.drop_from_inventory(G) + G.forceMove(src) + if(!contains) + contains = JAR_GUMBALL + user.visible_message("[user] puts a gumball in \the [src].", SPAN_NOTICE("You put a gumball in \the [src].")) + handle_gumball_underlays() + else + to_chat(user, SPAN_WARNING("\The [name] is full!")) + +/obj/item/glass_jar/proc/handle_gumball_removal(mob/user) // same as the addition proc but we're removing gum instead + if(length(gumballs_contained)) + user.put_in_hands(gumballs_contained[1]) + gumballs_contained -= gumballs_contained[1] + user.visible_message("[user] takes a gumball from \the [src].", SPAN_NOTICE("You take a gumball from \the [src].")) + if(length(gumballs_contained) == 0) + contains = JAR_NOTHING + handle_gumball_underlays() + +/obj/item/glass_jar/proc/handle_gumball_underlays() // gumball overlays + underlays.Cut() + if(length(gumballs_contained)) + var/image/gumballs_overlay = image(icon) + switch(length(gumballs_contained)) + if(1 to GUMBALL_MIN) + gumballs_overlay.icon_state = "gumball_min" + if(6 to GUMBALL_MEDIUM) + gumballs_overlay.icon_state = "gumball_medium" + if(11 to GUMBALL_MAX) + gumballs_overlay.icon_state = "gumball_max" + underlays += gumballs_overlay + + /obj/item/glass_jar/peter/ name = "Peter's Jar" @@ -135,7 +199,31 @@ STOP_PROCESSING(SSprocessing, S) update_icon() +/obj/item/glass_jar/gumball + contains = JAR_GUMBALL + +/obj/item/glass_jar/gumball/Initialize() + ..() + for(var/i = 1 to GUMBALL_MAX) + var/obj/item/clothing/mask/chewable/candy/gum/gumball/G = new(src) + gumballs_contained += G + + return INITIALIZE_HINT_LATELOAD + +/obj/item/glass_jar/gumball/LateInitialize() + update_icon() + +/obj/item/glass_jar/gumball/medical/Initialize() + for(var/i = 1 to GUMBALL_MAX) + var/obj/item/clothing/mask/chewable/candy/gum/gumball/medical/G = new(src) + gumballs_contained += G + #undef JAR_NOTHING #undef JAR_MONEY #undef JAR_ANIMAL #undef JAR_SPIDERLING +#undef JAR_GUMBALL + +#undef GUMBALL_MAX +#undef GUMBALL_MEDIUM +#undef GUMBALL_MIN diff --git a/code/game/objects/items/weapons/chewables.dm b/code/game/objects/items/weapons/chewables.dm index 71c1002c216..fa35b05607c 100644 --- a/code/game/objects/items/weapons/chewables.dm +++ b/code/game/objects/items/weapons/chewables.dm @@ -6,6 +6,8 @@ pickup_sound = 'sound/items/pickup/food.ogg' body_parts_covered = 0 + var/damage_per_crunch // if set to a number, chewing something will cause this amount of damage in brute and half of it in pain. + var/crunching = FALSE var/type_butt = null var/chem_volume = 0 var/chewtime = 0 @@ -59,13 +61,24 @@ obj/item/clothing/mask/chewable/Destroy() var/mob/living/carbon/human/C = loc if (src == C.wear_mask && C.check_has_mouth()) reagents.trans_to_mob(C, REM, CHEM_INGEST, 0.2) + if(isnum(damage_per_crunch && !crunching)) + addtimer(CALLBACK(src, .proc/damagecrunch, C), 50, TIMER_UNIQUE) + crunching = TRUE else STOP_PROCESSING(SSprocessing, src) +/obj/item/clothing/mask/chewable/proc/damagecrunch(mob/living/carbon/human/user) + if(src == user.wear_mask) // are we still chewing the gum? + user.apply_damage(damage_per_crunch, BRUTE, BP_HEAD) + user.apply_damage(damage_per_crunch/2, PAIN, BP_HEAD) + to_chat(user, SPAN_DANGER("You bite down hard on \the [name]!")) + crunching = FALSE + /obj/item/clothing/mask/chewable/process() chew() if(chewtime < 1) spitout() + /obj/item/clothing/mask/chewable/tobacco name = "wad" @@ -167,6 +180,18 @@ obj/item/clothing/mask/chewable/Destroy() color = reagents.get_color() update_icon() +/obj/item/clothing/mask/chewable/candy/gum/gumball + name = "gumball" + desc = "A gumball, created and patented by Chip Getmore. Known to contain a hard shell and a reagent interior!" + icon_state = "gumball" + item_state = null + wrapped = FALSE + +/obj/item/clothing/mask/chewable/candy/gum/gumball/medical/Initialize() + . = ..() + reagents.add_reagent(/datum/reagent/tricordrazine, 5) + + /obj/item/storage/box/fancy/gum name = "\improper Chewy Fruit flavored gum" desc = "A small pack of chewing gum in various flavors." diff --git a/code/modules/cargo/random_stock/t2_uncommon.dm b/code/modules/cargo/random_stock/t2_uncommon.dm index b9e7144f58a..8b65e5cd179 100644 --- a/code/modules/cargo/random_stock/t2_uncommon.dm +++ b/code/modules/cargo/random_stock/t2_uncommon.dm @@ -400,5 +400,8 @@ STOCK_ITEM_UNCOMMON(alt_glasses, 1) var/type = pick(glasses) new type(L) +STOCK_ITEM_UNCOMMON(gumballs, 3) + new /obj/item/glass_jar/gumball(L) + STOCK_ITEM_UNCOMMON(nothing, 0) // no-op \ No newline at end of file diff --git a/html/changelogs/hockaa-tricordgumballs.yml b/html/changelogs/hockaa-tricordgumballs.yml new file mode 100644 index 00000000000..84c126e7f67 --- /dev/null +++ b/html/changelogs/hockaa-tricordgumballs.yml @@ -0,0 +1,7 @@ +author: Hocka + +delete-after: True + +changes: + - rscadd: "Added medical gumballs - gumballs that spawn with tricordrazine." + - rscadd: "Added a medical and normal variant of gumball jars. The medical gumball jar spawns on a table in the medical lobby every round and normal gumball jars can spawn in cargo." diff --git a/icons/obj/clothing/masks.dmi b/icons/obj/clothing/masks.dmi index 06f536cd08c..e3f6c344b3b 100644 Binary files a/icons/obj/clothing/masks.dmi and b/icons/obj/clothing/masks.dmi differ diff --git a/icons/obj/drinks.dmi b/icons/obj/drinks.dmi index d223fe2066d..c20e31ffb98 100644 Binary files a/icons/obj/drinks.dmi and b/icons/obj/drinks.dmi differ diff --git a/maps/aurora/aurora-4_mainlevel.dmm b/maps/aurora/aurora-4_mainlevel.dmm index f0c4108f724..7f87baddbdc 100644 --- a/maps/aurora/aurora-4_mainlevel.dmm +++ b/maps/aurora/aurora-4_mainlevel.dmm @@ -41819,9 +41819,8 @@ /obj/machinery/light{ icon_state = "tube1" }, -/obj/structure/bed/chair/plastic{ - dir = 1 - }, +/obj/structure/table/standard, +/obj/item/glass_jar/gumball/medical, /turf/simulated/floor/tiled/white, /area/medical/reception) "bvj" = (