diff --git a/_maps/RandomRuins/LavaRuins/lavaland_surface_animal_hospital.dmm b/_maps/RandomRuins/LavaRuins/lavaland_surface_animal_hospital.dmm index 5ed42e89228..214ff213c8c 100644 --- a/_maps/RandomRuins/LavaRuins/lavaland_surface_animal_hospital.dmm +++ b/_maps/RandomRuins/LavaRuins/lavaland_surface_animal_hospital.dmm @@ -47,7 +47,7 @@ /area/ruin/powered/animal_hospital) "al" = ( /obj/structure/table/wood, -/obj/item/toy/carpplushie, +/obj/item/toy/plush/carpplushie, /turf/open/floor/plasteel/cmo, /area/ruin/powered/animal_hospital) "am" = ( diff --git a/_maps/map_files/Deltastation/DeltaStation2.dmm b/_maps/map_files/Deltastation/DeltaStation2.dmm index 805e5b0427e..93de5c8c215 100644 --- a/_maps/map_files/Deltastation/DeltaStation2.dmm +++ b/_maps/map_files/Deltastation/DeltaStation2.dmm @@ -5118,7 +5118,7 @@ /area/maintenance/starboard/fore) "alA" = ( /obj/structure/table/wood, -/obj/item/toy/carpplushie, +/obj/item/toy/plush/carpplushie, /obj/effect/decal/cleanable/cobweb, /turf/open/floor/plasteel/vault{ dir = 8 diff --git a/_maps/map_files/MetaStation/MetaStation.dmm b/_maps/map_files/MetaStation/MetaStation.dmm index 3ec84488681..46b17ab2603 100644 --- a/_maps/map_files/MetaStation/MetaStation.dmm +++ b/_maps/map_files/MetaStation/MetaStation.dmm @@ -49068,7 +49068,7 @@ /area/bridge/showroom/corporate) "bQl" = ( /obj/structure/table/wood, -/obj/item/toy/carpplushie{ +/obj/item/toy/plush/carpplushie{ color = "red"; name = "Nanotrasen wildlife department space carp plushie" }, diff --git a/_maps/map_files/generic/CentCom.dmm b/_maps/map_files/generic/CentCom.dmm index ec91d0e5d4d..2debe2fa2b9 100644 --- a/_maps/map_files/generic/CentCom.dmm +++ b/_maps/map_files/generic/CentCom.dmm @@ -6423,7 +6423,7 @@ "qX" = ( /obj/structure/table, /obj/item/toy/katana, -/obj/item/toy/carpplushie, +/obj/item/toy/plush/carpplushie, /obj/effect/turf_decal/stripes/line{ dir = 1 }, diff --git a/code/__DEFINES/components.dm b/code/__DEFINES/components.dm index 641454a799b..94b9c84fb02 100644 --- a/code/__DEFINES/components.dm +++ b/code/__DEFINES/components.dm @@ -39,6 +39,14 @@ #define COMSIG_MOVABLE_COLLIDE "movable_collide" //from base of atom/movable/Collide(): (atom) #define COMSIG_MOVABLE_IMPACT "movable_impact" //from base of atom/movable/throw_impact(): (atom, throwingdatum) +// /obj/item signals +#define COMSIG_ITEM_ATTACK "item_attack" //from base of obj/item/attack(): (mob/living/target, mob/living/user) +#define COMSIG_ITEM_ATTACK_SELF "item_attack_self" //from base of obj/item/attack_self(): (mob) +#define COMSIG_ITEM_ATTACK_OBJ "item_attack_obj" //from base of obj/item/attack_obj(): (obj, mob) + +// /obj/item/clothing signals +#define COMSIG_SHOES_STEP_ACTION "shoes_step_action" //from base of obj/item/clothing/shoes/proc/step_action(): () + // /obj/machinery signals #define COMSIG_MACHINE_PROCESS "machine_process" //from machinery subsystem fire(): () #define COMSIG_MACHINE_PROCESS_ATMOS "machine_process_atmos" //from air subsystem process_atmos_machinery(): () \ No newline at end of file diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index 87e75f99105..987818924f6 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -9,7 +9,8 @@ // Called when the item is in the active hand, and clicked; alternately, there is an 'activate held object' verb or you can hit pagedown. /obj/item/proc/attack_self(mob/user) - return + SendSignal(COMSIG_ITEM_ATTACK_SELF, user) + interact(user) /obj/item/proc/pre_attackby(atom/A, mob/living/user, params) //do stuff before attackby! return TRUE //return FALSE to avoid calling attackby after this proc does stuff @@ -35,6 +36,7 @@ /obj/item/proc/attack(mob/living/M, mob/living/user) + SendSignal(COMSIG_ITEM_ATTACK, M, user) if(flags_1 & NOBLUDGEON_1) return if(!force) @@ -54,6 +56,7 @@ //the equivalent of the standard version of attack() but for object targets. /obj/item/proc/attack_obj(obj/O, mob/living/user) + SendSignal(COMSIG_ITEM_ATTACK_OBJ, O, user) if(flags_1 & NOBLUDGEON_1) return user.changeNext_move(CLICK_CD_MELEE) diff --git a/code/datums/components/squeek.dm b/code/datums/components/squeek.dm new file mode 100644 index 00000000000..40fd0af598c --- /dev/null +++ b/code/datums/components/squeek.dm @@ -0,0 +1,61 @@ +/datum/component/squeak + var/static/list/default_squeak_sounds = list('sound/items/toysqueak1.ogg'=1, 'sound/items/toysqueak2.ogg'=1, 'sound/items/toysqueak3.ogg'=1) + var/list/override_squeak_sounds + var/squeak_chance = 100 + var/volume = 30 + + // This is so shoes don't squeak every step + var/steps = 0 + var/step_delay = 1 + + // This is to stop squeak spam from inhand usage + var/last_use = 0 + var/use_delay = 20 + +/datum/component/squeak/Initialize(custom_sounds, volume_override, chance_override, step_delay_override, use_delay_override) + if(custom_sounds) + override_squeak_sounds = custom_sounds + if(chance_override) + squeak_chance = chance_override + if(volume_override) + volume = volume_override + if(step_delay_override) + step_delay = step_delay_override + if(use_delay_override) + use_delay = use_delay_override + + if(istype(parent, /atom)) + RegisterSignal(COMSIG_ATOM_BLOB_ACT, .proc/play_squeak) + RegisterSignal(COMSIG_ATOM_HULK_ATTACK, .proc/play_squeak) + RegisterSignal(COMSIG_PARENT_ATTACKBY, .proc/play_squeak) + if(istype(parent, /atom/movable)) + RegisterSignal(COMSIG_MOVABLE_CROSSED, .proc/play_squeak) + RegisterSignal(COMSIG_MOVABLE_COLLIDE, .proc/play_squeak) + RegisterSignal(COMSIG_MOVABLE_IMPACT, .proc/play_squeak) + if(istype(parent, /obj/item)) + RegisterSignal(COMSIG_ITEM_ATTACK, .proc/play_squeak) + RegisterSignal(COMSIG_ITEM_ATTACK_SELF, .proc/use_squeak) + RegisterSignal(COMSIG_ITEM_ATTACK_OBJ, .proc/play_squeak) + if(istype(parent, /obj/item/clothing/shoes)) + RegisterSignal(COMSIG_SHOES_STEP_ACTION, .proc/step_squeak) + else + RegisterSignal(COMSIG_ATOM_ENTERED, .proc/play_squeak) + +/datum/component/squeak/proc/play_squeak() + if(prob(squeak_chance)) + if(!override_squeak_sounds) + playsound(parent, pickweight(default_squeak_sounds), volume, 1, -1) + else + playsound(parent, pickweight(override_squeak_sounds), volume, 1, -1) + +/datum/component/squeak/proc/step_squeak() + if(steps > step_delay) + play_squeak() + steps = 0 + else + steps++ + +/datum/component/squeak/proc/use_squeak() + if(last_use + use_delay < world.time) + last_use = world.time + play_squeak() \ No newline at end of file diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index f640e0f90b7..d1d1c459e1a 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -216,9 +216,6 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE) /obj/item/proc/speechModification(message) //For speech modification by mask slot items. return message -/obj/item/attack_self(mob/user) - interact(user) - /obj/item/interact(mob/user) add_fingerprint(user) if(hidden_uplink && hidden_uplink.active) diff --git a/code/game/objects/items/clown_items.dm b/code/game/objects/items/clown_items.dm index 1c3c712db6e..aae4aad91d3 100644 --- a/code/game/objects/items/clown_items.dm +++ b/code/game/objects/items/clown_items.dm @@ -107,39 +107,26 @@ throw_speed = 3 throw_range = 7 attack_verb = list("HONKED") - var/next_usable = 0 - var/honksound = 'sound/items/bikehorn.ogg' - var/cooldowntime = 20 + +/obj/item/bikehorn/Initialize() + . = ..() + AddComponent(/datum/component/squeak, list('sound/items/bikehorn.ogg'=1), 50) /obj/item/bikehorn/suicide_act(mob/user) user.visible_message("[user] solemnly points the horn at [user.p_their()] temple! It looks like [user.p_theyre()] trying to commit suicide!") - playsound(src.loc, honksound, 50, 1) + playsound(src, 'sound/items/bikehorn.ogg', 50, 1) return (BRUTELOSS) -/obj/item/bikehorn/attack(mob/living/carbon/M, mob/living/carbon/user) - if(!(next_usable > world.time)) - playsound(loc, honksound, 50, 1, -1) //plays instead of tap.ogg! - return ..() - -/obj/item/bikehorn/attack_self(mob/user) - if(!(next_usable > world.time)) - next_usable = world.time + cooldowntime - playsound(src.loc, honksound, 50, 1) - src.add_fingerprint(user) - -/obj/item/bikehorn/Crossed(mob/living/L) - if(isliving(L)) - playsound(loc, honksound, 50, 1, -1) - ..() - /obj/item/bikehorn/airhorn name = "air horn" desc = "Damn son, where'd you find this?" icon_state = "air_horn" - honksound = 'sound/items/airhorn2.ogg' - cooldowntime = 50 origin_tech = "materials=4;engineering=4" +/obj/item/bikehorn/airhorn/Initialize() + . = ..() + AddComponent(/datum/component/squeak, list('sound/items/airhorn2.ogg'=1), 50) + /obj/item/bikehorn/golden name = "golden bike horn" desc = "Golden? Clearly, it's made with bananium! Honk!" @@ -155,14 +142,13 @@ ..() /obj/item/bikehorn/golden/proc/flip_mobs(mob/living/carbon/M, mob/user) - if(!(next_usable > world.time)) - var/turf/T = get_turf(src) - for(M in ohearers(7, T)) - if(ishuman(M) && M.can_hear()) - var/mob/living/carbon/human/H = M - if(istype(H.ears, /obj/item/clothing/ears/earmuffs)) - continue - M.emote("flip") + var/turf/T = get_turf(src) + for(M in ohearers(7, T)) + if(ishuman(M) && M.can_hear()) + var/mob/living/carbon/human/H = M + if(istype(H.ears, /obj/item/clothing/ears/earmuffs)) + continue + M.emote("flip") /obj/item/reagent_containers/food/drinks/soda_cans/canned_laughter name = "Canned Laughter" diff --git a/code/game/objects/items/dehy_carp.dm b/code/game/objects/items/dehy_carp.dm index 9432a434f01..649efc0802a 100644 --- a/code/game/objects/items/dehy_carp.dm +++ b/code/game/objects/items/dehy_carp.dm @@ -4,13 +4,13 @@ */ //Child of carpplushie because this should do everything the toy does and more -/obj/item/toy/carpplushie/dehy_carp +/obj/item/toy/plush/carpplushie/dehy_carp var/mob/owner = null //Carp doesn't attack owner, set when using in hand var/owned = 0 //Boolean, no owner to begin with var/mobtype = /mob/living/simple_animal/hostile/carp //So admins can change what mob spawns via var fuckery //Attack self -/obj/item/toy/carpplushie/dehy_carp/attack_self(mob/user) +/obj/item/toy/plush/carpplushie/dehy_carp/attack_self(mob/user) src.add_fingerprint(user) //Anyone can add their fingerprints to it with this if(!owned) to_chat(user, "You pet [src]. You swear it looks up at you.") @@ -18,7 +18,7 @@ owned = 1 else return ..() -/obj/item/toy/carpplushie/dehy_carp/proc/Swell() +/obj/item/toy/plush/carpplushie/dehy_carp/proc/Swell() desc = "It's growing!" visible_message("[src] swells up!") diff --git a/code/game/objects/items/plushes.dm b/code/game/objects/items/plushes.dm new file mode 100644 index 00000000000..778655d4b0e --- /dev/null +++ b/code/game/objects/items/plushes.dm @@ -0,0 +1,42 @@ +/obj/item/toy/plush + name = "plush" + desc = "this is the special coder plush, do not steal" + icon = 'icons/obj/plushes.dmi' + icon_state = "debug" + attack_verb = list("thumped", "whomped", "bumped") + w_class = WEIGHT_CLASS_SMALL + resistance_flags = FLAMMABLE + var/list/squeak_override //Weighted list; If you want your plush to have different squeak sounds use this + +/obj/item/toy/plush/Initialize() + . = ..() + AddComponent(/datum/component/squeak, squeak_override) + +/obj/item/toy/plush/attack_self(mob/user) + . = ..() + to_chat(user, "You pet [src]. D'awww.") + +/obj/item/toy/plush/carpplushie + name = "space carp plushie" + desc = "An adorable stuffed toy that resembles a space carp." + icon_state = "carpplush" + item_state = "carp_plushie" + attack_verb = list("bitten", "eaten", "fin slapped") + squeak_override = list('sound/weapons/bite.ogg'=1) + +/obj/item/toy/plush/bubbleplush + name = "bubblegum plushie" + desc = "The friendly red demon that gives good miners gifts." + icon_state = "bubbleplush" + attack_verb = list("rends") + squeak_override = list('sound/magic/demon_attack1.ogg'=1) + +/obj/item/toy/plush/plushvar + name = "ratvar plushie" + desc = "An adorable plushie of the clockwork justiciar himself with new and improved spring arm action." + icon_state = "plushvar" + +/obj/item/toy/plush/narplush + name = "nar'sie plushie" + desc = "A small stuffed doll of the elder god nar'sie. Who thought this was a good children's toy?" + icon_state = "narplush" \ No newline at end of file diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index 87ff199dfe1..a918fe494ac 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -14,7 +14,6 @@ * Cards * Toy nuke * Fake meteor - * Carp plushie * Foam armblade * Toy big red button * Beach ball @@ -987,32 +986,6 @@ shake_camera(M, 3, 1) qdel(src) -/* - * Carp plushie - */ - -/obj/item/toy/carpplushie - name = "space carp plushie" - desc = "An adorable stuffed toy that resembles a space carp." - icon = 'icons/obj/toy.dmi' - icon_state = "carpplushie" - item_state = "carp_plushie" - w_class = WEIGHT_CLASS_SMALL - attack_verb = list("bitten", "eaten", "fin slapped") - resistance_flags = FLAMMABLE - var/bitesound = 'sound/weapons/bite.ogg' - -//Attack mob -/obj/item/toy/carpplushie/attack(mob/M, mob/user) - playsound(loc, bitesound, 20, 1) //Play bite sound in local area - return ..() - -//Attack self -/obj/item/toy/carpplushie/attack_self(mob/user) - playsound(src.loc, bitesound, 20, 1) - to_chat(user, "You pet [src]. D'awww.") - return ..() - /* * Toy big red button */ diff --git a/code/modules/cargo/packs.dm b/code/modules/cargo/packs.dm index ba536acdac9..bfe0c8e7761 100644 --- a/code/modules/cargo/packs.dm +++ b/code/modules/cargo/packs.dm @@ -1643,7 +1643,7 @@ /obj/item/toy/talking/griffin, /obj/item/toy/nuke, /obj/item/toy/minimeteor, - /obj/item/toy/carpplushie, + /obj/item/toy/plush/carpplushie, /obj/item/coin/antagtoken, /obj/item/stack/tile/fakespace/loaded, /obj/item/gun/ballistic/shotgun/toy/crossbow, diff --git a/code/modules/clothing/shoes/bananashoes.dm b/code/modules/clothing/shoes/bananashoes.dm index adaa7b49270..bf3a1f28e0d 100644 --- a/code/modules/clothing/shoes/bananashoes.dm +++ b/code/modules/clothing/shoes/bananashoes.dm @@ -10,15 +10,11 @@ /obj/item/clothing/shoes/clown_shoes/banana_shoes/Initialize() . = ..() AddComponent(/datum/component/material_container, list(MAT_BANANIUM), 200000, TRUE) + AddComponent(/datum/component/squeak, list('sound/items/bikehorn.ogg'=1), 75) /obj/item/clothing/shoes/clown_shoes/banana_shoes/step_action() + . = ..() if(on) - if(footstep > 1)//honks when its on - playsound(src, 'sound/items/bikehorn.ogg', 75, 1) - footstep = 0 - else - footstep++ - new/obj/item/grown/bananapeel/specialpeel(get_step(src,turn(usr.dir, 180))) //honk GET_COMPONENT(bananium, /datum/component/material_container) bananium.use_amount_type(100, MAT_BANANIUM) @@ -27,8 +23,6 @@ flags_1 &= ~NOSLIP_1 update_icon() to_chat(loc, "You ran out of bananium!") - else - ..() /obj/item/clothing/shoes/clown_shoes/banana_shoes/attack_self(mob/user) GET_COMPONENT(bananium, /datum/component/material_container) diff --git a/code/modules/clothing/shoes/miscellaneous.dm b/code/modules/clothing/shoes/miscellaneous.dm index c0ac24c1cc3..081362ee9d6 100644 --- a/code/modules/clothing/shoes/miscellaneous.dm +++ b/code/modules/clothing/shoes/miscellaneous.dm @@ -1,4 +1,5 @@ /obj/item/clothing/shoes/proc/step_action() //this was made to rewrite clown shoes squeaking + SendSignal(COMSIG_SHOES_STEP_ACTION) /obj/item/clothing/shoes/suicide_act(mob/user) user.visible_message("[user] is bashing [user.p_their()] own head in with [src]! Ain't that a kick in the head?") @@ -79,15 +80,11 @@ item_state = "clown_shoes" slowdown = SHOES_SLOWDOWN+1 item_color = "clown" - var/footstep = 1 //used for squeeks whilst walking pockets = /obj/item/storage/internal/pocket/shoes/clown -/obj/item/clothing/shoes/clown_shoes/step_action() - if(footstep > 1) - playsound(src, "clownstep", 50, 1) - footstep = 0 - else - footstep++ +/obj/item/clothing/shoes/clown_shoes/Initialize() + . = ..() + AddComponent(/datum/component/squeak, list('sound/effects/clownstep1.ogg'=1,'sound/effects/clownstep2.ogg'=1), 50) /obj/item/clothing/shoes/clown_shoes/jester name = "jester shoes" diff --git a/code/modules/holiday/easter.dm b/code/modules/holiday/easter.dm index 2415f08d6db..71ff26a17e5 100644 --- a/code/modules/holiday/easter.dm +++ b/code/modules/holiday/easter.dm @@ -126,7 +126,7 @@ /obj/item/toy/foamblade, /obj/item/toy/prize/ripley, /obj/item/toy/prize/honk, - /obj/item/toy/carpplushie, + /obj/item/toy/plush/carpplushie, /obj/item/toy/redbutton, /obj/item/clothing/head/collectable/rabbitears) new won(where) diff --git a/code/modules/mob/living/simple_animal/friendly/mouse.dm b/code/modules/mob/living/simple_animal/friendly/mouse.dm index db3778d1860..1ca032f94ce 100644 --- a/code/modules/mob/living/simple_animal/friendly/mouse.dm +++ b/code/modules/mob/living/simple_animal/friendly/mouse.dm @@ -27,6 +27,7 @@ /mob/living/simple_animal/mouse/Initialize() . = ..() + AddComponent(/datum/component/squeak, list('sound/effects/mousesqueek.ogg'=1), 100) if(!body_color) body_color = pick( list("brown","gray","white") ) icon_state = "mouse_[body_color]" @@ -57,7 +58,6 @@ if(!stat) var/mob/M = AM to_chat(M, "[icon2html(src, M)] Squeek!") - playsound(src, 'sound/effects/mousesqueek.ogg', 100, 1) ..() /mob/living/simple_animal/mouse/handle_automated_action() diff --git a/code/modules/reagents/chemistry/reagents/other_reagents.dm b/code/modules/reagents/chemistry/reagents/other_reagents.dm index a370ce2de9c..b11abe451f0 100644 --- a/code/modules/reagents/chemistry/reagents/other_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/other_reagents.dm @@ -160,8 +160,8 @@ cube.Expand() // Dehydrated carp - else if(istype(O, /obj/item/toy/carpplushie/dehy_carp)) - var/obj/item/toy/carpplushie/dehy_carp/dehy = O + else if(istype(O, /obj/item/toy/plush/carpplushie/dehy_carp)) + var/obj/item/toy/plush/carpplushie/dehy_carp/dehy = O dehy.Swell() // Makes a carp else if(istype(O, /obj/item/stack/sheet/hairlesshide)) diff --git a/code/modules/uplink/uplink_item.dm b/code/modules/uplink/uplink_item.dm index 3399a23d663..d7546ba99df 100644 --- a/code/modules/uplink/uplink_item.dm +++ b/code/modules/uplink/uplink_item.dm @@ -698,7 +698,7 @@ GLOBAL_LIST_EMPTY(uplink_items) // Global list so we only initialize this once. name = "Dehydrated Space Carp" desc = "Looks like a plush toy carp, but just add water and it becomes a real-life space carp! Activate in \ your hand before use so it knows not to kill you." - item = /obj/item/toy/carpplushie/dehy_carp + item = /obj/item/toy/plush/carpplushie/dehy_carp cost = 1 /datum/uplink_item/stealthy_weapons/soap_clusterbang diff --git a/icons/obj/plushes.dmi b/icons/obj/plushes.dmi new file mode 100644 index 00000000000..6a7b21efec0 Binary files /dev/null and b/icons/obj/plushes.dmi differ diff --git a/icons/obj/toy.dmi b/icons/obj/toy.dmi index f2176c395d7..d5cae1db931 100644 Binary files a/icons/obj/toy.dmi and b/icons/obj/toy.dmi differ diff --git a/sound/items/toysqueak1.ogg b/sound/items/toysqueak1.ogg new file mode 100644 index 00000000000..e64a6fb179d Binary files /dev/null and b/sound/items/toysqueak1.ogg differ diff --git a/sound/items/toysqueak2.ogg b/sound/items/toysqueak2.ogg new file mode 100644 index 00000000000..fddf1edfb92 Binary files /dev/null and b/sound/items/toysqueak2.ogg differ diff --git a/sound/items/toysqueak3.ogg b/sound/items/toysqueak3.ogg new file mode 100644 index 00000000000..338f4d8aa90 Binary files /dev/null and b/sound/items/toysqueak3.ogg differ diff --git a/tgstation.dme b/tgstation.dme index aca3ff00f0d..0b5ef44a9f8 100755 --- a/tgstation.dme +++ b/tgstation.dme @@ -255,6 +255,7 @@ #include "code\datums\components\component.dm" #include "code\datums\components\material_container.dm" #include "code\datums\components\slippery.dm" +#include "code\datums\components\squeek.dm" #include "code\datums\diseases\_disease.dm" #include "code\datums\diseases\_MobProcs.dm" #include "code\datums\diseases\anxiety.dm" @@ -754,6 +755,7 @@ #include "code\game\objects\items\paint.dm" #include "code\game\objects\items\paiwire.dm" #include "code\game\objects\items\pinpointer.dm" +#include "code\game\objects\items\plushes.dm" #include "code\game\objects\items\pneumaticCannon.dm" #include "code\game\objects\items\powerfist.dm" #include "code\game\objects\items\RCD.dm"