mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-25 06:00:16 +01:00
[MIRROR] Adds proper sound effects to attacks against flora [MDB IGNORE] (#12305)
* Adds proper sound effects to attacks against flora (#65508) * Adds proper sound effects to attacking flora * Normalises all the sounds to make them as loud as possible and the same volume * named arguments * Adds proper sound effects to attacks against flora Co-authored-by: cacogen <25089914+cacogen@users.noreply.github.com>
This commit is contained in:
@@ -220,3 +220,6 @@ GLOBAL_LIST_INIT(announcer_keys, list(
|
||||
#define SFX_SWING_HIT "swing_hit"
|
||||
#define SFX_TERMINAL_TYPE "terminal_type"
|
||||
#define SFX_WARPSPEED "warpspeed"
|
||||
#define SFX_CRUNCHY_BUSH_WHACK "crunchy_bush_whack"
|
||||
#define SFX_TREE_CHOP "tree_chop"
|
||||
#define SFX_ROCK_TAP "rock_tap"
|
||||
|
||||
@@ -2,6 +2,22 @@
|
||||
resistance_flags = FLAMMABLE
|
||||
max_integrity = 150
|
||||
anchored = TRUE
|
||||
/// Play a foliage rustling sound when attacking it?
|
||||
var/herbage = FALSE
|
||||
/// Play a wooden chop sound when attacking it?
|
||||
var/wood = FALSE
|
||||
/// Play a rock tap sound when attacking it?
|
||||
var/rock = FALSE
|
||||
|
||||
/obj/structure/flora/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
|
||||
if(!wood && !herbage && !rock)
|
||||
return ..() //play generic metal thunk, tap or welder sound instead
|
||||
if(herbage)
|
||||
playsound(src, SFX_CRUNCHY_BUSH_WHACK, 50, vary = FALSE)
|
||||
if(wood)
|
||||
playsound(src, SFX_TREE_CHOP, 50, vary = FALSE)
|
||||
if(rock)
|
||||
playsound(src, SFX_ROCK_TAP, 50, vary = FALSE)
|
||||
|
||||
//trees
|
||||
/obj/structure/flora/tree
|
||||
@@ -12,24 +28,28 @@
|
||||
layer = FLY_LAYER
|
||||
plane = ABOVE_GAME_PLANE
|
||||
var/log_amount = 10
|
||||
herbage = TRUE
|
||||
wood = TRUE
|
||||
|
||||
/obj/structure/flora/tree/attackby(obj/item/W, mob/user, params)
|
||||
if(log_amount && (!(flags_1 & NODECONSTRUCT_1)))
|
||||
if(W.get_sharpness() && W.force > 0)
|
||||
if(W.hitsound)
|
||||
playsound(get_turf(src), W.hitsound, 100, FALSE, FALSE)
|
||||
user.visible_message(span_notice("[user] begins to cut down [src] with [W]."),span_notice("You begin to cut down [src] with [W]."), span_hear("You hear the sound of sawing."))
|
||||
if(do_after(user, 1000/W.force, target = src)) //5 seconds with 20 force, 8 seconds with a hatchet, 20 seconds with a shard.
|
||||
user.visible_message(span_notice("[user] fells [src] with the [W]."),span_notice("You fell [src] with the [W]."), span_hear("You hear the sound of a tree falling."))
|
||||
playsound(get_turf(src), 'sound/effects/meteorimpact.ogg', 100 , FALSE, FALSE)
|
||||
user.log_message("cut down [src] at [AREACOORD(src)]", LOG_ATTACK)
|
||||
for(var/i=1 to log_amount)
|
||||
new /obj/item/grown/log/tree(get_turf(src))
|
||||
var/obj/structure/flora/stump/S = new(loc)
|
||||
S.name = "[name] stump"
|
||||
qdel(src)
|
||||
else
|
||||
/obj/structure/flora/tree/attackby(obj/item/attacking_item, mob/user, params)
|
||||
if(!log_amount || flags_1 & NODECONSTRUCT_1)
|
||||
return ..()
|
||||
if(!attacking_item.get_sharpness() || attacking_item.force <= 0)
|
||||
return ..()
|
||||
var/my_turf = get_turf(src)
|
||||
if(attacking_item.hitsound)
|
||||
playsound(my_turf, attacking_item.hitsound, 100, FALSE, FALSE)
|
||||
user.visible_message(span_notice("[user] begins to cut down [src] with [attacking_item]."),span_notice("You begin to cut down [src] with [attacking_item]."), span_hear("You hear sawing."))
|
||||
if(!do_after(user, 1000/attacking_item.force, target = src)) //5 seconds with 20 force, 8 seconds with a hatchet, 20 seconds with a shard.
|
||||
return
|
||||
user.visible_message(span_notice("[user] fells [src] with [attacking_item]."),span_notice("You fell [src] with [attacking_item]."), span_hear("You hear the sound of a tree falling."))
|
||||
playsound(my_turf, 'sound/effects/meteorimpact.ogg', 100 , FALSE, FALSE)
|
||||
user.log_message("cut down [src] at [AREACOORD(src)]", LOG_ATTACK)
|
||||
for(var/i=1 to log_amount)
|
||||
new /obj/item/grown/log/tree(drop_location())
|
||||
var/obj/structure/flora/stump/new_stump = new(my_turf)
|
||||
new_stump.name = "[name] stump"
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/flora/stump
|
||||
name = "stump"
|
||||
@@ -38,6 +58,7 @@
|
||||
icon_state = "tree_stump"
|
||||
density = FALSE
|
||||
pixel_x = -16
|
||||
wood = TRUE
|
||||
|
||||
/obj/structure/flora/tree/pine
|
||||
name = "pine tree"
|
||||
@@ -97,6 +118,11 @@
|
||||
icon = 'icons/obj/flora/deadtrees.dmi'
|
||||
desc = "A dead tree. How it died, you know not."
|
||||
icon_state = "tree_1"
|
||||
herbage = FALSE
|
||||
|
||||
/obj/structure/flora/tree/dead/Initialize(mapload)
|
||||
icon_state = "tree_[rand(1, 6)]"
|
||||
return ..()
|
||||
|
||||
/obj/structure/flora/tree/palm
|
||||
icon = 'icons/misc/beach2.dmi'
|
||||
@@ -120,10 +146,6 @@
|
||||
icon_state = "anchored_rod"
|
||||
anchored = TRUE
|
||||
|
||||
/obj/structure/flora/tree/dead/Initialize(mapload)
|
||||
icon_state = "tree_[rand(1, 6)]"
|
||||
. = ..()
|
||||
|
||||
/obj/structure/flora/tree/jungle
|
||||
name = "tree"
|
||||
icon_state = "tree"
|
||||
@@ -147,6 +169,7 @@
|
||||
desc = "A patch of overgrown grass."
|
||||
icon = 'icons/obj/flora/snowflora.dmi'
|
||||
gender = PLURAL //"this is grass" not "this is a grass"
|
||||
herbage = TRUE
|
||||
|
||||
/obj/structure/flora/grass/brown
|
||||
icon_state = "snowgrass1bb"
|
||||
@@ -178,6 +201,7 @@
|
||||
icon = 'icons/obj/flora/snowflora.dmi'
|
||||
icon_state = "snowbush1"
|
||||
anchored = TRUE
|
||||
herbage = TRUE
|
||||
|
||||
/obj/structure/flora/bush/Initialize(mapload)
|
||||
icon_state = "snowbush[rand(1, 6)]"
|
||||
@@ -190,6 +214,7 @@
|
||||
desc = "Some kind of plant."
|
||||
icon = 'icons/obj/flora/ausflora.dmi'
|
||||
icon_state = "firstbush_1"
|
||||
herbage = TRUE
|
||||
|
||||
/obj/structure/flora/ausbushes/Initialize(mapload)
|
||||
if(icon_state == "firstbush_1")
|
||||
@@ -422,23 +447,25 @@
|
||||
var/obj/item/stack/mineResult = /obj/item/stack/ore/glass/basalt
|
||||
/// Amount of the itemstack to drop
|
||||
var/mineAmount = 20
|
||||
rock = TRUE
|
||||
|
||||
/obj/structure/flora/rock/Initialize(mapload)
|
||||
. = ..()
|
||||
icon_state = "[icon_state][rand(1,3)]"
|
||||
|
||||
/obj/structure/flora/rock/attackby(obj/item/W, mob/user, params)
|
||||
if(!mineResult || W.tool_behaviour != TOOL_MINING)
|
||||
/obj/structure/flora/rock/attackby(obj/item/attacking_item, mob/user, params)
|
||||
if(!mineResult || attacking_item.tool_behaviour != TOOL_MINING)
|
||||
return ..()
|
||||
if(flags_1 & NODECONSTRUCT_1)
|
||||
return ..()
|
||||
to_chat(user, span_notice("You start mining..."))
|
||||
if(W.use_tool(src, user, 40, volume=50))
|
||||
to_chat(user, span_notice("You finish mining the rock."))
|
||||
if(mineResult && mineAmount)
|
||||
new mineResult(loc, mineAmount)
|
||||
SSblackbox.record_feedback("tally", "pick_used_mining", 1, W.type)
|
||||
qdel(src)
|
||||
if(!attacking_item.use_tool(src, user, 40, volume=50))
|
||||
return
|
||||
to_chat(user, span_notice("You finish mining the rock."))
|
||||
if(mineResult && mineAmount)
|
||||
new mineResult(loc, mineAmount)
|
||||
SSblackbox.record_feedback("tally", "pick_used_mining", 1, attacking_item.type)
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/flora/rock/pile
|
||||
icon_state = "lavarocks"
|
||||
@@ -481,6 +508,7 @@
|
||||
desc = "A wild plant that is found in jungles."
|
||||
icon = 'icons/obj/flora/jungleflora.dmi'
|
||||
icon_state = "busha"
|
||||
herbage = TRUE
|
||||
|
||||
/obj/structure/flora/junglebush/Initialize(mapload)
|
||||
icon_state = "[icon_state][rand(1, 3)]"
|
||||
|
||||
@@ -269,4 +269,10 @@ distance_multiplier - Can be used to multiply the distance at which the sound is
|
||||
soundin = pick('sound/machines/sm/accent/normal/1.ogg', 'sound/machines/sm/accent/normal/2.ogg', 'sound/machines/sm/accent/normal/3.ogg', 'sound/machines/sm/accent/normal/4.ogg', 'sound/machines/sm/accent/normal/5.ogg', 'sound/machines/sm/accent/normal/6.ogg', 'sound/machines/sm/accent/normal/7.ogg', 'sound/machines/sm/accent/normal/8.ogg', 'sound/machines/sm/accent/normal/9.ogg', 'sound/machines/sm/accent/normal/10.ogg', 'sound/machines/sm/accent/normal/11.ogg', 'sound/machines/sm/accent/normal/12.ogg', 'sound/machines/sm/accent/normal/13.ogg', 'sound/machines/sm/accent/normal/14.ogg', 'sound/machines/sm/accent/normal/15.ogg', 'sound/machines/sm/accent/normal/16.ogg', 'sound/machines/sm/accent/normal/17.ogg', 'sound/machines/sm/accent/normal/18.ogg', 'sound/machines/sm/accent/normal/19.ogg', 'sound/machines/sm/accent/normal/20.ogg', 'sound/machines/sm/accent/normal/21.ogg', 'sound/machines/sm/accent/normal/22.ogg', 'sound/machines/sm/accent/normal/23.ogg', 'sound/machines/sm/accent/normal/24.ogg', 'sound/machines/sm/accent/normal/25.ogg', 'sound/machines/sm/accent/normal/26.ogg', 'sound/machines/sm/accent/normal/27.ogg', 'sound/machines/sm/accent/normal/28.ogg', 'sound/machines/sm/accent/normal/29.ogg', 'sound/machines/sm/accent/normal/30.ogg', 'sound/machines/sm/accent/normal/31.ogg', 'sound/machines/sm/accent/normal/32.ogg', 'sound/machines/sm/accent/normal/33.ogg')
|
||||
if(SFX_HYPERTORUS_MELTING)
|
||||
soundin = pick('sound/machines/sm/accent/delam/1.ogg', 'sound/machines/sm/accent/delam/2.ogg', 'sound/machines/sm/accent/delam/3.ogg', 'sound/machines/sm/accent/delam/4.ogg', 'sound/machines/sm/accent/delam/5.ogg', 'sound/machines/sm/accent/delam/6.ogg', 'sound/machines/sm/accent/delam/7.ogg', 'sound/machines/sm/accent/delam/8.ogg', 'sound/machines/sm/accent/delam/9.ogg', 'sound/machines/sm/accent/delam/10.ogg', 'sound/machines/sm/accent/delam/11.ogg', 'sound/machines/sm/accent/delam/12.ogg', 'sound/machines/sm/accent/delam/13.ogg', 'sound/machines/sm/accent/delam/14.ogg', 'sound/machines/sm/accent/delam/15.ogg', 'sound/machines/sm/accent/delam/16.ogg', 'sound/machines/sm/accent/delam/17.ogg', 'sound/machines/sm/accent/delam/18.ogg', 'sound/machines/sm/accent/delam/19.ogg', 'sound/machines/sm/accent/delam/20.ogg', 'sound/machines/sm/accent/delam/21.ogg', 'sound/machines/sm/accent/delam/22.ogg', 'sound/machines/sm/accent/delam/23.ogg', 'sound/machines/sm/accent/delam/24.ogg', 'sound/machines/sm/accent/delam/25.ogg', 'sound/machines/sm/accent/delam/26.ogg', 'sound/machines/sm/accent/delam/27.ogg', 'sound/machines/sm/accent/delam/28.ogg', 'sound/machines/sm/accent/delam/29.ogg', 'sound/machines/sm/accent/delam/30.ogg', 'sound/machines/sm/accent/delam/31.ogg', 'sound/machines/sm/accent/delam/32.ogg', 'sound/machines/sm/accent/delam/33.ogg')
|
||||
if(SFX_CRUNCHY_BUSH_WHACK)
|
||||
soundin = pick('sound/effects/crunchybushwhack1.ogg', 'sound/effects/crunchybushwhack2.ogg', 'sound/effects/crunchybushwhack3.ogg')
|
||||
if(SFX_TREE_CHOP)
|
||||
soundin = pick('sound/effects/treechop1.ogg', 'sound/effects/treechop2.ogg', 'sound/effects/treechop3.ogg')
|
||||
if(SFX_ROCK_TAP)
|
||||
soundin = pick('sound/effects/rocktap1.ogg', 'sound/effects/rocktap2.ogg', 'sound/effects/rocktap3.ogg')
|
||||
return soundin
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
icon_state = "l_mushroom"
|
||||
name = "large mushrooms"
|
||||
desc = "A number of large mushrooms, covered in a faint layer of ash and what can only be spores."
|
||||
herbage = TRUE //not really accurate but what sound do hit mushrooms make anyway
|
||||
var/harvested_name = "shortened mushrooms"
|
||||
var/harvested_desc = "Some quickly regrowing mushrooms, formerly known to be quite large."
|
||||
var/needs_sharp_harvest = TRUE
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user