Files
kiwistation/code/game/objects/items/clown_items.dm
T
Qustinnus 74755a5a3a Audio falloff re-work, and increased audio range. (#54362)
imo; the ss13 audio-scape is quite barren, you can only hear most things if you can see them, which in my opinion doesn't make much sense. This changes that so you can hear further away, but falloff is much higher, so in reality you will only hear things relatively quietly when they're out of sight.

This PR increases the hearing distance of most sound by 9, excluding sounds such as antag items that are meant to be used stealthily

This PR also replaces Byond's inbuilt falloff system with something I made, (And thanks to potato for helping me throw together a formula for it). This fall-off system makes sound fall off more naturally, with sounds being full volume within a certain range, and then softly falling off until they are completely quiet. This makes for a smoother transition between "This sound is full volume" and "I dont hear this sound".

Co-authored-by: ff <ff>
2020-10-20 17:14:16 -07:00

249 lines
10 KiB
Plaintext

/* Clown Items
* Contains:
* Soap
* Bike Horns
* Air Horns
* Canned Laughter
*/
/*
* Soap
*/
/obj/item/soap
name = "soap"
desc = "A cheap bar of soap. Doesn't smell."
gender = PLURAL
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "soap"
lefthand_file = 'icons/mob/inhands/equipment/custodial_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/custodial_righthand.dmi'
w_class = WEIGHT_CLASS_TINY
item_flags = NOBLUDGEON
throwforce = 0
throw_speed = 3
throw_range = 7
grind_results = list(/datum/reagent/lye = 10)
var/cleanspeed = 35 //slower than mop
force_string = "robust... against germs"
var/uses = 100
/obj/item/soap/ComponentInitialize()
. = ..()
AddComponent(/datum/component/slippery, 80)
/obj/item/soap/examine(mob/user)
. = ..()
var/max_uses = initial(uses)
var/msg = "It looks like it just came out of the package."
if(uses != max_uses)
var/percentage_left = uses / max_uses
switch(percentage_left)
if(0 to 0.15)
msg = "There's just a tiny bit left of what it used to be, you're not sure it'll last much longer."
if(0.15 to 0.30)
msg = "It's dissolved quite a bit, but there's still some life to it."
if(0.30 to 0.50)
msg = "It's past its prime, but it's definitely still good."
if(0.50 to 0.75)
msg = "It's started to get a little smaller than it used to be, but it'll definitely still last for a while."
else
msg = "It's seen some light use, but it's still pretty fresh."
. += "<span class='notice'>[msg]</span>"
/obj/item/soap/nanotrasen
desc = "A heavy duty bar of Nanotrasen brand soap. Smells of plasma."
grind_results = list(/datum/reagent/toxin/plasma = 10, /datum/reagent/lye = 10)
icon_state = "soapnt"
cleanspeed = 28 //janitor gets this
uses = 300
/obj/item/soap/homemade
desc = "A homemade bar of soap. Smells of... well...."
icon_state = "soapgibs"
cleanspeed = 30 // faster to reward chemists for going to the effort
/obj/item/soap/deluxe
desc = "A deluxe Waffle Co. brand bar of soap. Smells of high-class luxury."
icon_state = "soapdeluxe"
cleanspeed = 20 //captain gets one of these
/obj/item/soap/syndie
desc = "An untrustworthy bar of soap made of strong chemical agents that dissolve blood faster."
icon_state = "soapsyndie"
cleanspeed = 5 //faster than mop so it is useful for traitors who want to clean crime scenes
/obj/item/soap/omega
name = "omega soap"
desc = "The most advanced soap known to mankind."
icon_state = "soapomega"
cleanspeed = 3 //Only the truest of mind soul and body get one of these
uses = 301
/obj/item/soap/omega/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is using [src] to scrub themselves from the timeline! It looks like [user.p_theyre()] trying to commit suicide!</span>")
new /obj/structure/chrono_field(user.loc, user)
return MANUAL_SUICIDE
/obj/item/paper/fluff/stations/soap
name = "ancient janitorial poem"
desc = "An old paper that has passed many hands."
info = "The legend of the omega soap</B><BR><BR> Essence of <B>potato</B>. Juice, not grind.<BR><BR> A <B>lizard's</B> tail, turned into <B>wine</B>.<BR><BR> <B>powder of monkey</B>, to help the workload.<BR><BR> Some <B>Krokodil</B>, because meth would explode.<BR><BR> <B>Nitric acid</B> and <B>Baldium</B>, for organic dissolving.<BR><BR> A cup filled with <B>Hooch</B>, for sinful absolving<BR><BR> Some <B>Bluespace Dust</B>, for removal of stains.<BR><BR> A syringe full of <B>Pump-up</B>, it's security's bane.<BR><BR> Add a can of <B>Space Cola</B>, because we've been paid.<BR><BR> <B>Heat</B> as hot as you can, let the soap be your blade.<BR><BR> <B>Ten units of each regent create a soap that could topple all others.</B>"
/obj/item/soap/suicide_act(mob/user)
user.say(";FFFFFFFFFFFFFFFFUUUUUUUDGE!!", forced="soap suicide")
user.visible_message("<span class='suicide'>[user] lifts [src] to [user.p_their()] mouth and gnaws on it furiously, producing a thick froth! [user.p_they(TRUE)]'ll never get that BB gun now!</span>")
new /obj/effect/particle_effect/foam(loc)
return (TOXLOSS)
/**
* Decrease the number of uses the bar of soap has.
*
* The higher the cleaning skill, the less likely the soap will lose a use.
* Arguments
* * user - The mob that is using the soap to clean.
*/
/obj/item/soap/proc/decreaseUses(mob/user)
var/skillcheck = 1
if(user?.mind)
skillcheck = user.mind.get_skill_modifier(/datum/skill/cleaning, SKILL_SPEED_MODIFIER)
if(prob(skillcheck*100)) //higher level = more uses assuming RNG is nice
uses--
if(uses <= 0)
to_chat(user, "<span class='warning'>[src] crumbles into tiny bits!</span>")
qdel(src)
/obj/item/soap/afterattack(atom/target, mob/user, proximity)
. = ..()
if(!proximity || !check_allowed_items(target))
return
var/clean_speedies = 1 * cleanspeed
if(user.mind)
clean_speedies = cleanspeed * min(user.mind.get_skill_modifier(/datum/skill/cleaning, SKILL_SPEED_MODIFIER)+0.1,1) //less scaling for soapies
//I couldn't feasibly fix the overlay bugs caused by cleaning items we are wearing.
//So this is a workaround. This also makes more sense from an IC standpoint. ~Carn
if(user.client && ((target in user.client.screen) && !user.is_holding(target)))
to_chat(user, "<span class='warning'>You need to take that [target.name] off before cleaning it!</span>")
else if(istype(target, /obj/effect/decal/cleanable))
user.visible_message("<span class='notice'>[user] begins to scrub \the [target.name] out with [src].</span>", "<span class='warning'>You begin to scrub \the [target.name] out with [src]...</span>")
if(do_after(user, clean_speedies, target = target))
to_chat(user, "<span class='notice'>You scrub \the [target.name] out.</span>")
var/obj/effect/decal/cleanable/cleanies = target
user.mind?.adjust_experience(/datum/skill/cleaning, max(round(cleanies.beauty/CLEAN_SKILL_BEAUTY_ADJUSTMENT),0)) //again, intentional that this does NOT round but mops do.
qdel(target)
decreaseUses(user)
else if(ishuman(target) && user.zone_selected == BODY_ZONE_PRECISE_MOUTH)
var/mob/living/carbon/human/human_user = user
user.visible_message("<span class='warning'>\the [user] washes \the [target]'s mouth out with [src.name]!</span>", "<span class='notice'>You wash \the [target]'s mouth out with [src.name]!</span>") //washes mouth out with soap sounds better than 'the soap' here if(user.zone_selected == "mouth")
if(human_user.lip_style)
user.mind?.adjust_experience(/datum/skill/cleaning, CLEAN_SKILL_GENERIC_WASH_XP)
human_user.lip_style = null //removes lipstick
human_user.update_body()
decreaseUses(user)
return
else if(istype(target, /obj/structure/window))
user.visible_message("<span class='notice'>[user] begins to clean \the [target.name] with [src]...</span>", "<span class='notice'>You begin to clean \the [target.name] with [src]...</span>")
if(do_after(user, clean_speedies, target = target))
to_chat(user, "<span class='notice'>You clean \the [target.name].</span>")
target.remove_atom_colour(WASHABLE_COLOUR_PRIORITY)
target.set_opacity(initial(target.opacity))
user.mind?.adjust_experience(/datum/skill/cleaning, CLEAN_SKILL_GENERIC_WASH_XP)
decreaseUses(user)
else
user.visible_message("<span class='notice'>[user] begins to clean \the [target.name] with [src]...</span>", "<span class='notice'>You begin to clean \the [target.name] with [src]...</span>")
if(do_after(user, clean_speedies, target = target))
to_chat(user, "<span class='notice'>You clean \the [target.name].</span>")
if(user && isturf(target))
for(var/obj/effect/decal/cleanable/cleanable_decal in target)
user.mind?.adjust_experience(/datum/skill/cleaning, round(cleanable_decal.beauty / CLEAN_SKILL_BEAUTY_ADJUSTMENT))
target.wash(CLEAN_SCRUB)
target.remove_atom_colour(WASHABLE_COLOUR_PRIORITY)
user.mind?.adjust_experience(/datum/skill/cleaning, CLEAN_SKILL_GENERIC_WASH_XP)
decreaseUses(user)
return
/*
* Bike Horns
*/
/obj/item/bikehorn
name = "bike horn"
desc = "A horn off of a bicycle."
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "bike_horn"
inhand_icon_state = "bike_horn"
worn_icon_state = "horn"
lefthand_file = 'icons/mob/inhands/equipment/horns_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/horns_righthand.dmi'
throwforce = 0
hitsound = null //To prevent tap.ogg playing, as the item lacks of force
w_class = WEIGHT_CLASS_TINY
slot_flags = ITEM_SLOT_BACK|ITEM_SLOT_BELT
throw_speed = 3
throw_range = 7
attack_verb_continuous = list("HONKS")
attack_verb_simple = list("HONK")
/obj/item/bikehorn/Initialize()
. = ..()
AddComponent(/datum/component/squeak, list('sound/items/bikehorn.ogg'=1), 50, falloff_exponent = 20) //die off quick please)
/obj/item/bikehorn/attack(mob/living/carbon/M, mob/living/carbon/user)
if(user != M && ishuman(user))
var/mob/living/carbon/human/H = user
if (HAS_TRAIT(H, TRAIT_CLUMSY)) //only clowns can unlock its true powers
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "honk", /datum/mood_event/honk)
return ..()
/obj/item/bikehorn/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] solemnly points [src] at [user.p_their()] temple! It looks like [user.p_theyre()] trying to commit suicide!</span>")
playsound(src, 'sound/items/bikehorn.ogg', 50, TRUE)
return (BRUTELOSS)
//air horn
/obj/item/bikehorn/airhorn
name = "air horn"
desc = "Damn son, where'd you find this?"
icon_state = "air_horn"
worn_icon_state = "horn_air"
/obj/item/bikehorn/airhorn/Initialize()
. = ..()
AddComponent(/datum/component/squeak, list('sound/items/airhorn2.ogg'=1), 50, falloff_exponent = 20) //die off quick please)
//golden bikehorn
/obj/item/bikehorn/golden
name = "golden bike horn"
desc = "Golden? Clearly, it's made with bananium! Honk!"
icon_state = "gold_horn"
inhand_icon_state = "gold_horn"
worn_icon_state = "horn_gold"
COOLDOWN_DECLARE(golden_horn_cooldown)
/obj/item/bikehorn/golden/attack()
flip_mobs()
return ..()
/obj/item/bikehorn/golden/attack_self(mob/user)
flip_mobs()
..()
/obj/item/bikehorn/golden/proc/flip_mobs(mob/living/carbon/M, mob/user)
if(!COOLDOWN_FINISHED(src, golden_horn_cooldown))
return
var/turf/T = get_turf(src)
for(M in ohearers(7, T))
if(M.can_hear())
M.emote("flip")
COOLDOWN_START(src, golden_horn_cooldown, 1 SECONDS)
//canned laughter
/obj/item/reagent_containers/food/drinks/soda_cans/canned_laughter
name = "Canned Laughter"
desc = "Just looking at this makes you want to giggle."
icon_state = "laughter"
list_reagents = list(/datum/reagent/consumable/laughter = 50)