diff --git a/aurorastation.dme b/aurorastation.dme index 6f9bfe94771..b9a6d9d4518 100644 --- a/aurorastation.dme +++ b/aurorastation.dme @@ -883,6 +883,7 @@ #include "code\game\objects\items\shooting_range.dm" #include "code\game\objects\items\skrell.dm" #include "code\game\objects\items\spirit_board.dm" +#include "code\game\objects\items\sticker.dm" #include "code\game\objects\items\tajara.dm" #include "code\game\objects\items\toys.dm" #include "code\game\objects\items\trash.dm" diff --git a/code/__defines/_macros.dm b/code/__defines/_macros.dm index 7a35338a68d..9bc1b5ef92e 100644 --- a/code/__defines/_macros.dm +++ b/code/__defines/_macros.dm @@ -65,6 +65,8 @@ #define ispAI(A) istype(A, /mob/living/silicon/pai) +#define isbot(A) istype(A, /mob/living/bot) + #define isrobot(A) istype(A, /mob/living/silicon/robot) #define issilicon(A) istype(A, /mob/living/silicon) diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index 6c4b5b282cb..bf534e43b02 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -222,9 +222,10 @@ animals lunging, etc. */ /mob/proc/RangedAttack(var/atom/A, var/params) - if(!mutations.len) return - if((LASER_EYES in mutations) && a_intent == I_HURT) + if(length(mutations) && (LASER_EYES in mutations) && a_intent == I_HURT) LaserEyes(A, params) // moved into a proc below + return + A.attack_ranged(src, params) /* Restrained ClickOn diff --git a/code/_onclick/other_mobs.dm b/code/_onclick/other_mobs.dm index 4e3f7b801c6..2f27b4aeb76 100644 --- a/code/_onclick/other_mobs.dm +++ b/code/_onclick/other_mobs.dm @@ -30,7 +30,10 @@ A.attack_hand(src) -/atom/proc/attack_hand(mob/user as mob) +/atom/proc/attack_hand(mob/user) + return + +/atom/proc/attack_ranged(mob/user, params) return /mob/proc/attack_empty_hand(var/bp_hand) diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index dda7e2de625..a6b1c94973d 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -426,3 +426,6 @@ /atom/movable/proc/get_floating_chat_x_offset() return 0 + +/atom/movable/proc/can_attach_sticker(var/mob/user, var/obj/item/sticker/S) + return TRUE \ No newline at end of file diff --git a/code/game/machinery/computer/computer.dm b/code/game/machinery/computer/computer.dm index d08487cebbe..22a9b943959 100644 --- a/code/game/machinery/computer/computer.dm +++ b/code/game/machinery/computer/computer.dm @@ -138,3 +138,8 @@ //Animals can run under them, lots of empty space return 1 return ..() + +// screens have a layer above, so we can't attach here +/obj/machinery/computer/can_attach_sticker(var/mob/user, var/obj/item/sticker/S) + to_chat(user, SPAN_WARNING("\The [src]'s non-stick surface prevents you from attaching a sticker to it!")) + return FALSE \ No newline at end of file diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm index 8816dc87a15..c01e2a014ed 100644 --- a/code/game/machinery/vending.dm +++ b/code/game/machinery/vending.dm @@ -833,4 +833,9 @@ throw_item.vendor_action(src) INVOKE_ASYNC(throw_item, /atom/movable.proc/throw_at, target, rand(3, 10), rand(1, 3), src) src.visible_message("[src] launches [throw_item.name] at [target.name]!") - return 1 \ No newline at end of file + return 1 + +// screens go over the lighting layer, so googly eyes go under them +/obj/machinery/vending/can_attach_sticker(var/mob/user, var/obj/item/sticker/S) + to_chat(user, SPAN_WARNING("\The [src]'s non-stick surface prevents you from attaching a sticker to it!")) + return FALSE \ No newline at end of file diff --git a/code/game/objects/items/sticker.dm b/code/game/objects/items/sticker.dm new file mode 100644 index 00000000000..355fa0fcf76 --- /dev/null +++ b/code/game/objects/items/sticker.dm @@ -0,0 +1,88 @@ +/obj/item/sticker + name = "sticker" + desc = "It's a sticker." + icon = 'icons/obj/sticker.dmi' + icon_state = "sticker" + flags = NOBLUDGEON + w_class = ITEMSIZE_TINY + vis_flags = VIS_INHERIT_LAYER | VIS_INHERIT_DIR + + var/datum/weakref/attached + var/list/rand_icons + +/obj/item/sticker/Initialize() + . = ..() + if(LAZYLEN(rand_icons)) + icon_state = pick(rand_icons) + +/obj/item/sticker/attack_hand(mob/user) + if(!attached) + return ..() + + if(user.a_intent == I_HELP) + remove_sticker(user) + return + + var/atom/movable/attached_atom = attached.resolve() + if(attached_atom) + attached_atom.attack_hand(user) // don't allow people to make sticker armor + +/obj/item/sticker/attack_ranged(mob/user) + if(!attached) + return + + var/atom/movable/attached_atom = attached.resolve() + if(attached_atom && user.Adjacent(attached_atom)) + attack_hand(user) + +/obj/item/sticker/attackby(obj/item/I, mob/user) + if(!attached) + return ..() + + var/atom/movable/attached_atom = attached.resolve() + if(attached_atom) + attached_atom.attackby(I, user) // don't allow people to make sticker armor + +/obj/item/sticker/afterattack(atom/movable/target, mob/user, proximity_flag, click_parameters) + if(!proximity_flag) + return + if(!istype(target) || (ismob(target) && !isbot(target))) + return + if(!target.can_attach_sticker(user, src)) + return + + var/list/mouse_control = mouse_safe_xy(click_parameters) + pixel_x = mouse_control["icon-x"] - 16 + pixel_y = mouse_control["icon-y"] - 16 + + attach_to(user, target) + +/obj/item/sticker/proc/attach_to(var/mob/user, var/atom/movable/A) + to_chat(user, SPAN_NOTICE("You attach \the [src] to \the [A].")) + user.drop_from_inventory(src, A) + attached = WEAKREF(A) + A.vis_contents += src + A.verbs += /atom/movable/proc/take_off_sticker + +/obj/item/sticker/proc/remove_sticker(var/mob/user) + user.put_in_hands(src) + var/atom/movable/attached_atom = attached.resolve() + if(attached_atom) + to_chat(user, SPAN_NOTICE("You remove \the [src] from \the [attached_atom].")) + attached_atom.vis_contents -= src + attached_atom.verbs -= /atom/movable/proc/take_off_sticker + attached = null + +/obj/item/sticker/googly_eye + name = "googly eye" + desc = "A large googly eye sticker." + rand_icons = list("googly", "googly1", "googly2") + + +/atom/movable/proc/take_off_sticker() + set name = "Remove Sticker" + set src in view(1) + + var/obj/item/sticker/S = locate() in src + if(S) + S.remove_sticker(usr) \ No newline at end of file diff --git a/code/game/objects/items/weapons/storage/boxes.dm b/code/game/objects/items/weapons/storage/boxes.dm index 90e451929a5..2233eaf5098 100644 --- a/code/game/objects/items/weapons/storage/boxes.dm +++ b/code/game/objects/items/weapons/storage/boxes.dm @@ -902,3 +902,8 @@ var/obj/item/closet_teleporter/CT_2 = new /obj/item/closet_teleporter(src) CT_1.linked_teleporter = CT_2 CT_2.linked_teleporter = CT_1 + +/obj/item/storage/box/googly + name = "googly eye box" + desc = "A box containing googly eyes." + starts_with = list(/obj/item/sticker/googly_eye = 8) \ No newline at end of file diff --git a/code/game/objects/items/weapons/storage/storage.dm b/code/game/objects/items/weapons/storage/storage.dm index 2d2b0feb5a1..4c60bf196e6 100644 --- a/code/game/objects/items/weapons/storage/storage.dm +++ b/code/game/objects/items/weapons/storage/storage.dm @@ -704,6 +704,9 @@ remove_from_storage(O, T) O.tumble(2) +// putting a sticker on something puts it in its contents, storage items use their contents to store their items +/obj/item/storage/can_attach_sticker(var/mob/user, var/obj/item/sticker/S) + return FALSE //Returns the storage depth of an atom. This is the number of storage items the atom is contained in before reaching toplevel (the area). //Returns -1 if the atom was not found on container. @@ -770,4 +773,4 @@ //return 2**(w_class-1) //1,2,4,8,16,... -#undef STORAGE_SPACE_CAP +#undef STORAGE_SPACE_CAP \ No newline at end of file diff --git a/code/modules/cargo/random_stock/t2_uncommon.dm b/code/modules/cargo/random_stock/t2_uncommon.dm index 5026172e827..7bf5daada68 100644 --- a/code/modules/cargo/random_stock/t2_uncommon.dm +++ b/code/modules/cargo/random_stock/t2_uncommon.dm @@ -396,5 +396,8 @@ STOCK_ITEM_UNCOMMON(alt_glasses, 1) STOCK_ITEM_UNCOMMON(gumballs, 3) new /obj/item/glass_jar/gumball(L) +STOCK_ITEM_UNCOMMON(googly, 0.75) + new /obj/item/storage/box/googly(L) + STOCK_ITEM_UNCOMMON(nothing, 0) // no-op diff --git a/html/changelogs/geeves-thanks_goon.yml b/html/changelogs/geeves-thanks_goon.yml new file mode 100644 index 00000000000..f6691550353 --- /dev/null +++ b/html/changelogs/geeves-thanks_goon.yml @@ -0,0 +1,6 @@ +author: Geeves + +delete-after: True + +changes: + - rscadd: "Boxes of googly eyes can now spawn in cargo." \ No newline at end of file diff --git a/icons/obj/sticker.dmi b/icons/obj/sticker.dmi new file mode 100644 index 00000000000..d81ffc19248 Binary files /dev/null and b/icons/obj/sticker.dmi differ