diff --git a/code/datums/looping_sounds/item_sounds.dm b/code/datums/looping_sounds/item_sounds.dm index 93de93ec94b..d396d8e292e 100644 --- a/code/datums/looping_sounds/item_sounds.dm +++ b/code/datums/looping_sounds/item_sounds.dm @@ -26,3 +26,13 @@ falloff_exponent = 10 falloff_distance = 1 volume = 5 + +/datum/looping_sound/chainsaw + start_sound = list('sound/weapons/chainsaw_start.ogg' = 1) + start_length = 0.85 SECONDS + mid_sounds = list('sound/weapons/chainsaw_loop.ogg' = 1) + mid_length = 0.85 SECONDS + end_sound = list('sound/weapons/chainsaw_stop.ogg' = 1) + end_volume = 35 + volume = 40 + ignore_walls = FALSE diff --git a/code/game/objects/items/chainsaw.dm b/code/game/objects/items/chainsaw.dm index 95e52f27b64..e94657c3457 100644 --- a/code/game/objects/items/chainsaw.dm +++ b/code/game/objects/items/chainsaw.dm @@ -23,17 +23,13 @@ tool_behaviour = TOOL_SAW toolspeed = 1.5 //Turn it on first you dork var/on = FALSE + ///The looping sound for our chainsaw when running + var/datum/looping_sound/chainsaw/chainsaw_loop /obj/item/chainsaw/Initialize(mapload) . = ..() - AddComponent(/datum/component/butchering, \ - speed = 3 SECONDS, \ - effectiveness = 100, \ - bonus_modifier = 0, \ - butcher_sound = 'sound/weapons/chainsawhit.ogg', \ - disabled = TRUE, \ - ) - AddComponent(/datum/component/two_handed, require_twohands=TRUE) + chainsaw_loop = new(src) + apply_components() /obj/item/chainsaw/suicide_act(mob/living/carbon/user) if(on) @@ -58,14 +54,32 @@ if(on) hitsound = 'sound/weapons/chainsawhit.ogg' + chainsaw_loop.start() else hitsound = SFX_SWING_HIT + chainsaw_loop.stop() toolspeed = on ? 0.5 : initial(toolspeed) //Turning it on halves the speed if(src == user.get_active_held_item()) //update inhands user.update_held_items() update_item_action_buttons() +/** + * Handles adding components to the chainsaw. Added in Initialize() + * + * Applies components to the chainsaw. Added as a seperate proc to allow for + * variance between subtypes + */ +/obj/item/chainsaw/proc/apply_components() + AddComponent(/datum/component/butchering, \ + speed = 3 SECONDS, \ + effectiveness = 100, \ + bonus_modifier = 0, \ + butcher_sound = 'sound/weapons/chainsawhit.ogg', \ + disabled = TRUE, \ + ) + AddComponent(/datum/component/two_handed, require_twohands=TRUE) + /obj/item/chainsaw/doomslayer name = "THE GREAT COMMUNICATOR" desc = "VRRRRRRR!!!" @@ -79,5 +93,40 @@ return TRUE return FALSE +/obj/item/chainsaw/mounted_chainsaw + name = "mounted chainsaw" + desc = "A chainsaw that has replaced your arm." + inhand_icon_state = "mounted_chainsaw" + item_flags = ABSTRACT | DROPDEL + throwforce = 0 + throw_range = 0 + throw_speed = 0 + toolspeed = 1 + +/obj/item/chainsaw/mounted_chainsaw/Initialize(mapload) + . = ..() + ADD_TRAIT(src, TRAIT_NODROP, HAND_REPLACEMENT_TRAIT) + +/obj/item/chainsaw/mounted_chainsaw/Destroy() + var/obj/item/bodypart/part + new /obj/item/chainsaw(get_turf(src)) + if(iscarbon(loc)) + var/mob/living/carbon/holder = loc + var/index = holder.get_held_index_of_item(src) + if(index) + part = holder.hand_bodyparts[index] + . = ..() + if(part) + part.drop_limb() + +/obj/item/chainsaw/mounted_chainsaw/apply_components() + AddComponent(/datum/component/butchering, \ + speed = 3 SECONDS, \ + effectiveness = 100, \ + bonus_modifier = 0, \ + butcher_sound = 'sound/weapons/chainsawhit.ogg', \ + disabled = TRUE, \ + ) + /datum/action/item_action/startchainsaw name = "Pull The Starting Cord" diff --git a/code/game/objects/items/weaponry.dm b/code/game/objects/items/weaponry.dm index c54b405f842..6140be05a0e 100644 --- a/code/game/objects/items/weaponry.dm +++ b/code/game/objects/items/weaponry.dm @@ -575,43 +575,6 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301 /obj/item/ectoplasm/mystic icon_state = "mysticplasm" - -/obj/item/mounted_chainsaw - name = "mounted chainsaw" - desc = "A chainsaw that has replaced your arm." - icon_state = "chainsaw_on" - inhand_icon_state = "mounted_chainsaw" - lefthand_file = 'icons/mob/inhands/weapons/chainsaw_lefthand.dmi' - righthand_file = 'icons/mob/inhands/weapons/chainsaw_righthand.dmi' - item_flags = ABSTRACT | DROPDEL - w_class = WEIGHT_CLASS_HUGE - force = 24 - throwforce = 0 - throw_range = 0 - throw_speed = 0 - sharpness = SHARP_EDGED - attack_verb_continuous = list("saws", "tears", "lacerates", "cuts", "chops", "dices") - attack_verb_simple = list("saw", "tear", "lacerate", "cut", "chop", "dice") - hitsound = 'sound/weapons/chainsawhit.ogg' - tool_behaviour = TOOL_SAW - toolspeed = 1 - -/obj/item/mounted_chainsaw/Initialize(mapload) - . = ..() - ADD_TRAIT(src, TRAIT_NODROP, HAND_REPLACEMENT_TRAIT) - -/obj/item/mounted_chainsaw/Destroy() - var/obj/item/bodypart/part - new /obj/item/chainsaw(get_turf(src)) - if(iscarbon(loc)) - var/mob/living/carbon/holder = loc - var/index = holder.get_held_index_of_item(src) - if(index) - part = holder.hand_bodyparts[index] - . = ..() - if(part) - part.drop_limb() - /obj/item/statuebust name = "bust" desc = "A priceless ancient marble bust, the kind that belongs in a museum." //or you can hit people with it diff --git a/code/modules/surgery/prosthetic_replacement.dm b/code/modules/surgery/prosthetic_replacement.dm index 2bdcf7c415b..e0043afc33f 100644 --- a/code/modules/surgery/prosthetic_replacement.dm +++ b/code/modules/surgery/prosthetic_replacement.dm @@ -122,7 +122,7 @@ display_pain(target, "You feel a strange sensation from your new [parse_zone(target_zone)].", TRUE) qdel(tool) if(istype(tool, /obj/item/chainsaw)) - var/obj/item/mounted_chainsaw/new_arm = new(target) + var/obj/item/chainsaw/mounted_chainsaw/new_arm = new(target) target_zone == BODY_ZONE_R_ARM ? target.put_in_r_hand(new_arm) : target.put_in_l_hand(new_arm) return else if(istype(tool, /obj/item/melee/synthetic_arm_blade)) diff --git a/sound/attributions.txt b/sound/attributions.txt index 40b6e931d01..fde05e90b53 100644 --- a/sound/attributions.txt +++ b/sound/attributions.txt @@ -37,3 +37,12 @@ alien_explode.ogg is adapted from zimbot's Frozen Lettuce upload https://freesou alien_organ_cut.ogg is adapted from some CC 0 flesh sound, lesaucisson's swoosh https://freesound.org/people/lesaucisson/sounds/585256/, and a snippet of EminYILDIRIM's tree cutting clip https://freesound.org/people/EminYILDIRIM/sounds/608343/ standard_stamp.ogg is adapted from tom_woysky's "Stamp.wav" https://freesound.org/people/tom_woysky/sounds/348316/ + +chainsaw_loop.ogg is adapted from Audionautics "Chainsaw Idle Loops", which is licensed under CC Attribution 3.0 +https://freesound.org/people/Audionautics/sounds/171652/ +chainsaw_start.ogg is adapted from 8 Chainsaw Pulls.wav by Stefan021 +https://freesound.org/s/431740/ (CC 0) +chainsaw_stop.ogg is adapted from kyles "chainsaw sawing short cuts +stop.flac" (CC 0) +https://freesound.org/people/kyles/sounds/453256/ + + diff --git a/sound/weapons/chainsaw_loop.ogg b/sound/weapons/chainsaw_loop.ogg new file mode 100644 index 00000000000..c3b1ee1e50c Binary files /dev/null and b/sound/weapons/chainsaw_loop.ogg differ diff --git a/sound/weapons/chainsaw_start.ogg b/sound/weapons/chainsaw_start.ogg new file mode 100644 index 00000000000..12bfa1f1204 Binary files /dev/null and b/sound/weapons/chainsaw_start.ogg differ diff --git a/sound/weapons/chainsaw_stop.ogg b/sound/weapons/chainsaw_stop.ogg new file mode 100644 index 00000000000..f7baf3240d5 Binary files /dev/null and b/sound/weapons/chainsaw_stop.ogg differ diff --git a/tools/UpdatePaths/Scripts/73996_mounted_chainsaw_subtype.txt b/tools/UpdatePaths/Scripts/73996_mounted_chainsaw_subtype.txt new file mode 100644 index 00000000000..ae48aa9342d --- /dev/null +++ b/tools/UpdatePaths/Scripts/73996_mounted_chainsaw_subtype.txt @@ -0,0 +1,3 @@ +# moves arm-mounted abstract chainsaw to a chainsaw subtype + +/obj/item/mounted_chainsaw : /obj/item/chainsaw/mounted_chainsaw{@OLD}