From a037bbefdb288b0f8c142489a81568509e5e41c2 Mon Sep 17 00:00:00 2001 From: Tigercat2000 Date: Sun, 1 Nov 2015 19:56:24 -0800 Subject: [PATCH] Stepsound "BALANCING" Changes: Humans now use the following ranges: - range(6) for running + shoes - range(5) for running OR shoes - range(4) for not running AND no shoes Humans use the following volumes: - 13 for running + shoes - 9 for running OR shoes - 5 for not running AND no shoes Humans have special modifiers on steps: - Shoes being 'silent' = Silent - Noslip shoes are silent by default. - You can make any shoe silent by tablecrafting shoe wraps with 10 ducttape and a wirecutter at a table. - Species being 'silent' = Silent - Currently, shadowlings use this. - Buckled, lying, or being thrown = Silent - No feet = Silent - No gravity = Footsteps every 3 turfs instead of every 2. Xenomorphs now use the following ranges: - range(4) at all times. Xenomorphs use the following volumes: - 5 at all times. Xenomorphs have special modifiers on steps: - Walking = Silent - Buckled, lying, being thrown = Silent - No gravity = Footsteps every 3 turfs instead of every 2. --- code/game/gamemodes/shadowling/shadowling.dm | 2 + code/game/objects/items/weapons/misc.dm | 1 + code/modules/clothing/clothing.dm | 1 + code/modules/clothing/shoes/miscellaneous.dm | 23 ++++++++++ code/modules/mob/living/carbon/alien/alien.dm | 20 +++++++-- .../mob/living/carbon/human/human_movement.dm | 45 ++++++++++++++++--- .../living/carbon/human/species/species.dm | 1 + 7 files changed, 84 insertions(+), 9 deletions(-) diff --git a/code/game/gamemodes/shadowling/shadowling.dm b/code/game/gamemodes/shadowling/shadowling.dm index 05d778c8b5a..5c9b3252b84 100644 --- a/code/game/gamemodes/shadowling/shadowling.dm +++ b/code/game/gamemodes/shadowling/shadowling.dm @@ -307,6 +307,8 @@ Made by Xhuis flags = NO_BLOOD | NO_BREATHE | NO_SCAN | NO_INTORGANS burn_mod = 1.5 //1.5x burn damage, 2x is excessive + silent_steps = 1 + /datum/game_mode/proc/update_shadow_icons_added(datum/mind/shadow_mind) spawn(0) for(var/datum/mind/shadowling in shadows) diff --git a/code/game/objects/items/weapons/misc.dm b/code/game/objects/items/weapons/misc.dm index 90191efbf70..c4675fb814d 100644 --- a/code/game/objects/items/weapons/misc.dm +++ b/code/game/objects/items/weapons/misc.dm @@ -13,6 +13,7 @@ Newton Cradle PAI cable Red Phone + Shoe Silencer */ /obj/item/weapon/balltoy diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index a642bb0e823..504ae451799 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -304,6 +304,7 @@ BLIND // can't see anything body_parts_covered = FEET slot_flags = SLOT_FEET + var/silence_steps = 0 permeability_coefficient = 0.50 slowdown = SHOES_SLOWDOWN diff --git a/code/modules/clothing/shoes/miscellaneous.dm b/code/modules/clothing/shoes/miscellaneous.dm index 46df4374a99..2c7dd1eeccc 100644 --- a/code/modules/clothing/shoes/miscellaneous.dm +++ b/code/modules/clothing/shoes/miscellaneous.dm @@ -11,6 +11,7 @@ var/list/clothing_choices = list() siemens_coefficient = 0.8 species_restricted = null + silence_steps = 1 /obj/item/clothing/shoes/mime name = "mime shoes" @@ -165,3 +166,25 @@ icon_state = "noble_boot" item_color = "noble_boot" item_state = "noble_boot" + + +/obj/item/clothing/shoes/attackby(obj/item/I, mob/user, params) + if(istype(I, /obj/item/shoe_silencer)) + silence_steps = 1 + user.unEquip(I) + qdel(I) + else . = ..() + +/obj/item/shoe_silencer + name = "shoe rags" + desc = "Looks sneaky." + icon_state = "sheet-cloth" + +/datum/table_recipe/shoe_rags + name = "Shoe Rags" + + result = /obj/item/shoe_silencer + reqs = list(/obj/item/stack/tape_roll = 10) + tools = list(/obj/item/weapon/wirecutters) + + time = 40 \ No newline at end of file diff --git a/code/modules/mob/living/carbon/alien/alien.dm b/code/modules/mob/living/carbon/alien/alien.dm index 9ea86bcdd46..b281fcfe519 100644 --- a/code/modules/mob/living/carbon/alien/alien.dm +++ b/code/modules/mob/living/carbon/alien/alien.dm @@ -304,7 +304,21 @@ Des: Removes all infected images from the alien. if(m_intent == "run") if(!(step_count % 2)) //every other turf makes a sound return 0 - if(leaping) - return 0 - playsound(T, S, 6, 1, -(world.view/2)) //xenos are quiet fuckers + + var/range = -(world.view - 2) + range -= 0.666 //-(7 - 2) = (-5) = -5 | -5 - (0.666) = -5.666 | (7 + -5.666) = 1.334 | 1.334 * 3 = 4.002 | range(4.002) = range(4) + var/volume = 5 + + if(m_intent == "walk") + return 0 //silent when walking + + if(buckled || lying || throwing) + return 0 //people flying, lying down or sitting do not step + + if(!has_gravity(src)) + if(step_count % 3) //this basically says, every three moves make a noise + return 0 //1st - none, 1%3==1, 2nd - none, 2%3==2, 3rd - noise, 3%3==0 + + playsound(T, S, volume, 1, range) + return 1 return 0 \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/human_movement.dm b/code/modules/mob/living/carbon/human/human_movement.dm index 3dd146bf0bf..1c458b6638e 100644 --- a/code/modules/mob/living/carbon/human/human_movement.dm +++ b/code/modules/mob/living/carbon/human/human_movement.dm @@ -91,12 +91,45 @@ if(m_intent == "run") if(!(step_count % 2)) //every other turf makes a sound return 0 - playsound(T, S, shoes ? 15 : 7, 1, shoes ? 0 : -(world.view/2)) - //this looks insane but it actually is quite simple - //play sound at turf T, using sound S - //volume = 15 w/ shoes, volume = 7 w/o shoes - //do use vary - //add negative world.view/2 if not wearing shoes + + var/range = -(world.view - 2) + if(m_intent == "walk") + range -= 0.333 + if(!shoes) + range -= 0.333 + + //shoes + running + //-(7 - 2) = -(5) = -5 | -5 - 0 = -5 | (7 + -5) = 2 | 2 * 3 = 6 | range(6) = range(6) + //running OR shoes + //-(7 - 2) = (-5) = -5 | -5 - 0.333 = -5.333 | (7 + -5.333) = 1.667 | 1.667 * 3 = 5.001 | range(5.001) = range(5) + //walking AND no shoes + //-(7 - 2) = (-5) = -5 | -5 - (0.333 * 2) = -5.666 | (7 + -5.666) = 1.334 | 1.334 * 3 = 4.002 | range(4.002) = range(4) + + var/volume = 13 + if(m_intent == "walk") + volume -= 4 + if(!shoes) + volume -= 4 + + if(istype(shoes, /obj/item/clothing/shoes)) + var/obj/item/clothing/shoes/shooess = shoes + if(shooess.silence_steps) + return 0 //silent + + if(!has_organ("l_foot") && !has_organ("r_foot")) + return 0 //no feet no footsteps + + if(buckled || lying || throwing) + return 0 //people flying, lying down or sitting do not step + + if(!has_gravity(src)) + if(step_count % 3) //this basically says, every three moves make a noise + return 0 //1st - none, 1%3==1, 2nd - none, 2%3==2, 3rd - noise, 3%3==0 + + if(species.silent_steps) + return 0 //species is silent + + playsound(T, S, volume, 1, range) return 1 return 0 \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index 1ed4360db60..18a9fa264ef 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -23,6 +23,7 @@ var/unarmed //For empty hand harm-intent attack var/unarmed_type = /datum/unarmed_attack var/slowdown = 0 // Passive movement speed malus (or boost, if negative) + var/silent_steps = 0 // Stops step noises var/breath_type = "oxygen" // Non-oxygen gas breathed, if any. var/poison_type = "plasma" // Poisonous air.