Item sounds

This commit is contained in:
QuoteFox
2021-03-28 22:05:25 +01:00
parent c2c03519d7
commit 58b12a8147
61 changed files with 91 additions and 23 deletions
+7 -1
View File
@@ -10,6 +10,7 @@
#define CHANNEL_BUZZ 1018
#define CHANNEL_BICYCLE 1017
//CIT CHANNELS - TRY NOT TO REGRESS
#define CHANNEL_PRED 1010
#define CHANNEL_DIGEST 1009
@@ -126,4 +127,9 @@
#define SOUND_AREA_WOODFLOOR SOUND_ENVIRONMENT_CITY
#define INTERACTION_SOUND_RANGE_MODIFIER -3
#define EQUIP_SOUND_VOLUME 30
#define EQUIP_SOUND_VOLUME 30
#define PICKUP_SOUND_VOLUME 40
#define DROP_SOUND_VOLUME 50
#define YEET_SOUND_VOLUME 90
@@ -134,7 +134,7 @@
if(ismob(parent.loc) && isitem(AM))
var/obj/item/I = AM
var/mob/M = parent.loc
I.dropped(M)
I.dropped(M, TRUE)
if(new_location)
//Reset the items values
_removal_reset(AM)
+29 -4
View File
@@ -32,7 +32,13 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
var/hitsound
var/usesound
var/throwhitsound
var/mob_throw_hit_sound
///Sound uses when picking the item up (into your hands)
var/pickup_sound
///Sound uses when dropping the item, or when its thrown.
var/drop_sound
///Sound used when equipping the item into a valid slot
var/equip_sound
@@ -376,7 +382,7 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
/obj/item/proc/talk_into(mob/M, input, channel, spans, datum/language/language)
return ITALICS | REDUCE_RANGE
/obj/item/proc/dropped(mob/user)
/obj/item/proc/dropped(mob/user, silent)
for(var/X in actions)
var/datum/action/A = X
A.Remove(user)
@@ -384,6 +390,8 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
qdel(src)
item_flags &= ~IN_INVENTORY
SEND_SIGNAL(src, COMSIG_ITEM_DROPPED,user)
if(!silent)
playsound(src, drop_sound, DROP_SOUND_VOLUME, ignore_walls = FALSE)
// called just as an item is picked up (loc is not yet changed)
/obj/item/proc/pickup(mob/user)
@@ -427,8 +435,10 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
A.Grant(user)
item_flags |= IN_INVENTORY
if(equip_sound && (slot_flags & slotdefine2slotbit(slot)))
if(equip_sound &&(slot_flags & slotdefine2slotbit(slot)))
playsound(src, equip_sound, EQUIP_SOUND_VOLUME, TRUE, ignore_walls = FALSE)
else if(slot == SLOT_HANDS)
playsound(src, pickup_sound, PICKUP_SOUND_VOLUME, ignore_walls = FALSE)
//sometimes we only want to grant the item's action if it's equipped in a specific slot.
/obj/item/proc/item_action_slot_check(slot, mob/user)
@@ -582,6 +592,21 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
var/itempush = 1
if(w_class < 4)
itempush = 0 //too light to push anything
if(istype(hit_atom, /mob/living)) //Living mobs handle hit sounds differently.
var/volume = get_volume_by_throwforce_and_or_w_class()
if (throwforce > 0)
if (mob_throw_hit_sound)
playsound(hit_atom, mob_throw_hit_sound, volume, TRUE, -1)
else if(hitsound)
playsound(hit_atom, hitsound, volume, TRUE, -1)
else
playsound(hit_atom, 'sound/weapons/genhit.ogg',volume, TRUE, -1)
else
playsound(hit_atom, 'sound/weapons/throwtap.ogg', 1, volume, -1)
else
playsound(src, drop_sound, YEET_SOUND_VOLUME, ignore_walls = FALSE)
return hit_atom.hitby(src, 0, itempush, throwingdatum=throwingdatum)
/obj/item/throw_at(atom/target, range, speed, mob/thrower, spin=1, diagonals_first = 0, datum/callback/callback, force, messy_throw = TRUE)
@@ -853,7 +878,7 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
layer = initial(layer)
plane = initial(plane)
appearance_flags &= ~NO_CLIENT_COLOR
dropped(M)
dropped(M, FALSE)
return ..()
/obj/item/throw_at(atom/target, range, speed, mob/thrower, spin=TRUE, diagonals_first = FALSE, var/datum/callback/callback)
@@ -32,6 +32,9 @@
var/datum/integrated_io/selected_io = null //functional for integrated circuits.
var/mode = 0
drop_sound = 'sound/items/handling/multitool_drop.ogg'
pickup_sound = 'sound/items/handling/multitool_pickup.ogg'
/obj/item/multitool/examine(mob/user)
. = ..()
if(selected_io)
@@ -355,6 +355,9 @@ GLOBAL_LIST_INIT(cloth_recipes, list ( \
merge_type = /obj/item/stack/sheet/cloth
grind_results = list(/datum/reagent/cellulose = 4)
drop_sound = 'sound/items/handling/cloth_drop.ogg'
pickup_sound = 'sound/items/handling/cloth_pickup.ogg'
/obj/item/stack/sheet/cloth/Initialize(mapload, new_amount, merge = TRUE)
recipes = GLOB.cloth_recipes
return ..()
@@ -400,6 +403,11 @@ GLOBAL_LIST_INIT(durathread_recipes, list ( \
merge_type = /obj/item/stack/sheet/durathread
grind_results = list(/datum/reagent/cellulose = 10)
drop_sound = 'sound/items/handling/cloth_drop.ogg'
pickup_sound = 'sound/items/handling/cloth_pickup.ogg'
/obj/item/stack/sheet/durathread/Initialize(mapload, new_amount, merge = TRUE)
recipes = GLOB.durathread_recipes
return ..()
+2
View File
@@ -12,6 +12,8 @@
var/content_overlays = FALSE //If this is true, the belt will gain overlays based on what it's holding
var/worn_overlays = FALSE //worn counterpart of the above.
equip_sound = 'sound/items/equip/toolbelt_equip.ogg'
drop_sound = 'sound/items/handling/toolbelt_drop.ogg'
pickup_sound = 'sound/items/handling/toolbelt_pickup.ogg'
/obj/item/storage/belt/suicide_act(mob/living/carbon/user)
user.visible_message("<span class='suicide'>[user] begins belting [user.p_them()]self with \the [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
+5
View File
@@ -35,6 +35,9 @@
var/illustration = "writing"
rad_flags = RAD_PROTECT_CONTENTS | RAD_NO_CONTAMINATE //exploits ahoy
drop_sound = 'sound/items/handling/cardboardbox_drop.ogg'
pickup_sound = 'sound/items/handling/cardboardbox_pickup.ogg'
/obj/item/storage/box/Initialize(mapload)
. = ..()
update_icon()
@@ -643,6 +646,8 @@
w_class = WEIGHT_CLASS_TINY
slot_flags = ITEM_SLOT_BELT
price = 2
drop_sound = 'sound/items/handling/matchbox_drop.ogg'
pickup_sound = 'sound/items/handling/matchbox_pickup.ogg'
/obj/item/storage/box/matches/ComponentInitialize()
. = ..()
@@ -16,6 +16,8 @@ GLOBAL_LIST_EMPTY(rubber_toolbox_icons)
materials = list(MAT_METAL = 500)
attack_verb = list("robusted")
hitsound = 'sound/weapons/smash.ogg'
drop_sound = 'sound/items/handling/toolbox_drop.ogg'
pickup_sound = 'sound/items/handling/toolbox_pickup.ogg'
var/latches = "single_latch"
var/has_latches = TRUE
var/can_rubberify = TRUE
+3
View File
@@ -13,6 +13,9 @@
w_class = WEIGHT_CLASS_SMALL
materials = list(MAT_METAL=50)
drop_sound = 'sound/items/handling/crowbar_drop.ogg'
pickup_sound = 'sound/items/handling/crowbar_pickup.ogg'
attack_verb = list("attacked", "bashed", "battered", "bludgeoned", "whacked")
tool_behaviour = TOOL_CROWBAR
toolspeed = 1
@@ -19,6 +19,8 @@
usesound = list('sound/items/screwdriver.ogg', 'sound/items/screwdriver2.ogg')
tool_behaviour = TOOL_SCREWDRIVER
toolspeed = 1
drop_sound = 'sound/items/handling/screwdriver_drop.ogg'
pickup_sound = 'sound/items/handling/screwdriver_pickup.ogg'
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 30)
var/random_color = TRUE //if the screwdriver uses random coloring
var/static/list/screwdriver_colors = list(
@@ -34,6 +34,9 @@
tool_behaviour = TOOL_WELDER
toolspeed = 1
drop_sound = 'sound/items/handling/weldingtool_drop.ogg'
pickup_sound = 'sound/items/handling/weldingtool_pickup.ogg'
/obj/item/weldingtool/Initialize()
. = ..()
create_reagents(max_fuel)
@@ -17,6 +17,9 @@
hitsound = 'sound/items/wirecutter.ogg'
usesound = 'sound/items/wirecutter.ogg'
drop_sound = 'sound/items/handling/wirecutter_drop.ogg'
pickup_sound = 'sound/items/handling/wirecutter_pickup.ogg'
tool_behaviour = TOOL_WIRECUTTER
toolspeed = 1
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 30)
+3
View File
@@ -13,6 +13,9 @@
usesound = 'sound/items/ratchet.ogg'
materials = list(MAT_METAL=150)
drop_sound = 'sound/items/handling/wrench_drop.ogg'
pickup_sound = 'sound/items/handling/wrench_pickup.ogg'
attack_verb = list("bashed", "battered", "bludgeoned", "whacked")
tool_behaviour = TOOL_WRENCH
toolspeed = 1
@@ -609,6 +609,8 @@ This is here to make the tiles around the station mininuke change when it's arme
lefthand_file = 'icons/mob/inhands/equipment/idcards_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/idcards_righthand.dmi'
icon_state = "datadisk0"
drop_sound = 'sound/items/handling/disk_drop.ogg'
pickup_sound = 'sound/items/handling/disk_pickup.ogg'
/obj/item/disk/nuclear
name = "nuclear authentication disk"
+2
View File
@@ -10,6 +10,8 @@
var/togglename = null
var/suittoggled = FALSE
drop_sound = 'sound/items/handling/cloth_drop.ogg'
pickup_sound = 'sound/items/handling/cloth_pickup.ogg'
var/adjusted = NORMAL_STYLE
mutantrace_variation = MUTANTRACE_VARIATION
var/tauric = FALSE //Citadel Add for tauric hardsuits
+3
View File
@@ -18,6 +18,9 @@
mutantrace_variation = MUTANTRACE_VARIATION //Are there special sprites for specific situations? Don't use this unless you need to.
equip_sound = 'sound/items/equip/jumpsuit_equip.ogg'
drop_sound = 'sound/items/handling/cloth_drop.ogg'
pickup_sound = 'sound/items/handling/cloth_pickup.ogg'
/obj/item/clothing/under/worn_overlays(isinhands = FALSE)
. = list()
if(!isinhands)
@@ -12,6 +12,9 @@
resistance_flags = ACID_PROOF
obj_flags = UNIQUE_RENAME
drop_sound = 'sound/items/handling/drinkglass_drop.ogg'
pickup_sound = 'sound/items/handling/drinkglass_pickup.ogg'
/obj/item/reagent_containers/food/drinks/drinkingglass/on_reagent_change(changetype)
cut_overlays()
if(reagents.reagent_list.len)
+2
View File
@@ -193,6 +193,8 @@
var/unique = 0 //0 - Normal book, 1 - Should not be treated as normal book, unable to be copied, unable to be modified
var/title //The real name of the book.
var/window_size = null // Specific window size for the book, i.e: "1920x1080", Size x Width
drop_sound = 'sound/items/handling/book_drop.ogg'
pickup_sound = 'sound/items/handling/book_pickup.ogg'
/obj/item/book/attack_self(mob/user)
if(is_blind(user))
+3 -15
View File
@@ -105,7 +105,7 @@
return
/mob/living/proc/can_embed(obj/item/I)
return FALSE
return FALSE
/mob/living/hitby(atom/movable/AM, skipcatch, hitpush = TRUE, blocked = FALSE, datum/thrownthing/throwingdatum)
var/obj/item/I
@@ -126,22 +126,10 @@
return TRUE
var/zone = ran_zone(BODY_ZONE_CHEST, 65)//Hits a random part of the body, geared towards the chest
var/dtype = BRUTE
var/volume = I.get_volume_by_throwforce_and_or_w_class()
SEND_SIGNAL(I, COMSIG_MOVABLE_IMPACT_ZONE, src, zone)
dtype = I.damtype
if (I.throwforce > 0) //If the weapon's throwforce is greater than zero...
if (I.throwhitsound) //...and throwhitsound is defined...
playsound(loc, I.throwhitsound, volume, 1, -1) //...play the weapon's throwhitsound.
else if(I.hitsound) //Otherwise, if the weapon's hitsound is defined...
playsound(loc, I.hitsound, volume, 1, -1) //...play the weapon's hitsound.
else if(!I.throwhitsound) //Otherwise, if throwhitsound isn't defined...
playsound(loc, 'sound/weapons/genhit.ogg',volume, 1, -1) //...play genhit.ogg.
else if(!I.throwhitsound && I.throwforce > 0) //Otherwise, if the item doesn't have a throwhitsound and has a throwforce greater than zero...
playsound(loc, 'sound/weapons/genhit.ogg', volume, 1, -1)//...play genhit.ogg
if(!I.throwforce)// Otherwise, if the item's throwforce is 0...
playsound(loc, 'sound/weapons/throwtap.ogg', 1, volume, -1)//...play throwtap.ogg.
if(!blocked)
visible_message("<span class='danger'>[src] has been hit by [I].</span>", \
"<span class='userdanger'>[src] has been hit by [I].</span>")
@@ -397,7 +385,7 @@
if (INTENT_GRAB)
grabbedby(M)
return FALSE
if(INTENT_HARM)
if(INTENT_HARM)
if(HAS_TRAIT(M, TRAIT_PACIFISM))
to_chat(M, "<span class='notice'>You don't want to hurt anyone!</span>")
return FALSE
+4
View File
@@ -23,6 +23,9 @@
dog_fashion = /datum/dog_fashion/head
grind_results = list(/datum/reagent/cellulose = 2)
drop_sound = 'sound/items/handling/paper_drop.ogg'
pickup_sound = 'sound/items/handling/paper_pickup.ogg'
var/info //What's actually written on the paper.
var/info_links //A different version of the paper which includes html links at fields and EOF
var/stamps //The (text for the) stamps on the paper.
@@ -143,6 +146,7 @@
var/locid = 0
var/laststart = 1
var/textindex = 1
playsound(src, 'sound/items/handling/writing.ogg', 50, 1, -1)
while(locid < 15) //hey whoever decided a while(1) was a good idea here, i hate you
var/istart = 0
if(links)
+1 -2
View File
@@ -238,7 +238,6 @@
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
hitsound = 'sound/weapons/circsawhit.ogg'
throwhitsound = 'sound/weapons/pierce.ogg'
item_flags = SURGICAL_TOOL
flags_1 = CONDUCT_1
force = 15
@@ -251,6 +250,7 @@
sharpness = IS_SHARP
tool_behaviour = TOOL_SAW
toolspeed = 1
mob_throw_hit_sound = 'sound/weapons/pierce.ogg'
/obj/item/circular_saw/Initialize()
. = ..()
@@ -263,7 +263,6 @@
icon = 'icons/obj/surgery.dmi'
icon_state = "saw"
hitsound = 'sound/weapons/circsawhit.ogg'
throwhitsound = 'sound/weapons/pierce.ogg'
flags_1 = CONDUCT_1
force = 10
w_class = WEIGHT_CLASS_SMALL