From 57dc0ddd50e751c9f7b29697fb166432a8dbfa04 Mon Sep 17 00:00:00 2001 From: Rob Nelson Date: Mon, 20 Jan 2014 23:13:46 -0800 Subject: [PATCH] Implement toxic farts. Conflicts: code/game/objects/effects/effect_system.dm code/modules/mob/living/carbon/human/human_defines.dm --- code/game/objects/effects/effect_system.dm | 30 +++++++++++++++++-- code/modules/mob/living/carbon/human/emote.dm | 26 ++++++++++++++++ .../mob/living/carbon/human/human_defines.dm | 2 ++ 3 files changed, 56 insertions(+), 2 deletions(-) diff --git a/code/game/objects/effects/effect_system.dm b/code/game/objects/effects/effect_system.dm index 1b367d5fc6c..38fcb5e88ed 100644 --- a/code/game/objects/effects/effect_system.dm +++ b/code/game/objects/effects/effect_system.dm @@ -514,6 +514,33 @@ steam.start() -- spawns the effect if(smoke) smoke.delete() src.total_smoke-- +// Goon compat. +/datum/effect/effect/system/chem_smoke_spread/fart + + set_up(var/mob/M, n = 5, c = 0, loca, direct) + if(n > 20) + n = 20 + number = n + cardinals = c + + chemholder.reagents.add_reagent("mercury", 50) + + if(istype(loca, /turf/)) + location = loca + else + location = get_turf(loca) + if(direct) + direction = direct + + var/contained = "\[[chemholder.reagents.get_reagent_ids()]\]" + var/area/A = get_area(location) + + var/where = "[A.name] | [location.x], [location.y]" + var/whereLink=formatJumpTo(location,where) + + var/more = "(?)" + message_admins("[M][more] produced a toxic fart in ([whereLink])[contained].", 0, 1) + log_game("[M][more] produced a toxic fart in ([where])[contained].") ///////////////////////////////////////////// @@ -696,7 +723,6 @@ steam.start() -- spawns the effect src.total_smoke-- - ///////////////////////////////////////////// //////// Attach an Ion trail to any object, that spawns when it moves (like for the jetpack) /// just pass in the object to attach it to in set_up @@ -1198,4 +1224,4 @@ steam.start() -- spawns the effect step(sparks,direction) spawn(20) del(sparks) - src.total_sparks-- + src.total_sparks-- diff --git a/code/modules/mob/living/carbon/human/emote.dm b/code/modules/mob/living/carbon/human/emote.dm index d97c68d5376..2a4d1b79d54 100644 --- a/code/modules/mob/living/carbon/human/emote.dm +++ b/code/modules/mob/living/carbon/human/emote.dm @@ -543,6 +543,32 @@ message = "[src] makes a very loud noise." m_type = 2 + // Needed for M_TOXIC_FART + if("fart") + if(world.time-lastFart >= 600) + message = "[src] [pick("passes wind","farts")]." + m_type = 2 + var/location = get_turf(src) + playsound(location, 'sound/effects/smoke.ogg', 50, 1, -3) + if(M_TOXIC_FARTS in mutations) + if(wear_suit && wear_suit.body_parts_covered & LOWER_TORSO) + if (internal != null && wear_mask && (wear_mask.flags & MASKINTERNALS)) + return + src << "\red You gas yourself!" + reagents.add_reagent("mercury", rand(10,20)) + return + var/datum/effect/effect/system/chem_smoke_spread/fart/S = new /datum/effect/effect/system/chem_smoke_spread/fart + S.attach(location) + S.set_up(src, 10, 0, location) + spawn(0) + S.start() + sleep(10) + S.start() + lastFart=world.time + else + message = "[src] strains, and nothing happens." + m_type = 1 + if ("help") src << "blink, blink_r, blush, bow-(none)/mob, burp, choke, chuckle, clap, collapse, cough,\ncry, custom, deathgasp, drool, eyebrow, frown, gasp, giggle, groan, grumble, handshake, hug-(none)/mob, glare-(none)/mob,\ngrin, laugh, look-(none)/mob, moan, mumble, nod, pale, point-atom, raise, salute, shake, shiver, shrug,\nsigh, signal-#1-10, smile, sneeze, sniff, snore, stare-(none)/mob, tremble, twitch, twitch_s, whimper,\nwink, yawn" diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm index a1cc0d905f6..e18c6df5d49 100644 --- a/code/modules/mob/living/carbon/human/human_defines.dm +++ b/code/modules/mob/living/carbon/human/human_defines.dm @@ -60,3 +60,5 @@ var/check_mutations=0 // Check mutations on next life tick + var/lastFart = 0 // Toxic fart cooldown. +