Adds a proc for checking clumsy, fixes clumsy clowns cutting themselves with banana bunches (#13211)

* clumsy_check

* changelog
This commit is contained in:
Sprok0
2017-01-01 15:59:22 -05:00
committed by Exxion
parent 5ab390529b
commit 6e057df491
34 changed files with 86 additions and 50 deletions

View File

@@ -221,7 +221,7 @@
user.delayNextAttack(50)
if(do_after(user,src,50))
var/mob/living/M = user
if ((M_CLUMSY in M.mutations) && (prob(50)))
if (clumsy_check(M) && (prob(50)))
user.visible_message("<span class='danger'>[user] slides \his hands straight into \the [src]!</span>", "<span class='danger'>You accidentally slide your hands into \the [src]!</span>")
M.apply_damage(10,BURN,pick(LIMB_LEFT_HAND, LIMB_RIGHT_HAND))

View File

@@ -202,7 +202,7 @@
if(usr && !istype(thrown_from, /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/bolas)) //if there is a user, but not a mech
if(istype(usr, /mob/living/carbon/human)) //if the user is human
var/mob/living/carbon/human/H = usr
if((M_CLUMSY in H.mutations) && prob(50))
if(clumsy_check(H) && prob(50))
to_chat(H, "<span class='warning'>You smack yourself in the face while swinging the [src]!</span>")
H.Stun(2)
H.drop_item(src)

View File

@@ -160,7 +160,7 @@
size = "bulky"
if(5.0 to INFINITY)
size = "huge"
//if ((M_CLUMSY in usr.mutations) && prob(50)) t = "funny-looking"
//if (clumsy_check(usr) && prob(50)) t = "funny-looking"
var/pronoun
if (src.gender == PLURAL)
pronoun = "They are"
@@ -901,7 +901,7 @@
M.LAssailant = user
src.add_fingerprint(user)
//if((M_CLUMSY in user.mutations) && prob(50))
//if(clumsy_check(user) && prob(50))
// M = user
/*
to_chat(M, "<span class='warning'>You stab yourself in the eye.</span>")

View File

@@ -20,7 +20,7 @@
var/limited_conversions = 0 // for revsquad
/obj/item/device/flash/proc/clown_check(var/mob/user)
if(user && (M_CLUMSY in user.mutations) && prob(50))
if(user && clumsy_check(user) && prob(50))
to_chat(user, "<span class='warning'>\The [src] slips out of your hand.</span>")
user.drop_item()
return 0

View File

@@ -55,7 +55,7 @@
add_fingerprint(user)
if(on && user.zone_sel.selecting == "eyes")
if(((M_CLUMSY in user.mutations) || user.getBrainLoss() >= 60) && prob(50)) //too dumb to use flashlight properly
if((clumsy_check(user) || user.getBrainLoss() >= 60) && prob(50)) //too dumb to use flashlight properly
return ..() //just hit them in the head
if (!user.dexterity_check())

View File

@@ -47,7 +47,7 @@
/obj/item/weapon/melee/defibrillator/attack_self(mob/user)
if(charges || ready)
if((M_CLUMSY in user.mutations) && prob(50) && charges)
if(clumsy_check(user) && prob(50) && charges)
to_chat(user, "<span class='warning'>You touch the paddles together, shorting the device.</span>")
sparks.start()
playsound(get_turf(src),'sound/items/defib.ogg',50,1)

View File

@@ -14,7 +14,7 @@
var/det_time = 50
/obj/item/weapon/grenade/proc/clown_check(var/mob/living/user)
if((M_CLUMSY in user.mutations) && prob(50))
if(clumsy_check(user) && prob(50))
to_chat(user, "<span class='warning'>Huh? How does this thing work?</span>")
activate(user)

View File

@@ -29,7 +29,7 @@
to_chat(usr, "<span class='warning'>You don't have the dexterity to do this!</span>")
return
if((M_CLUMSY in user.mutations) && prob(50))
if(clumsy_check(user) && prob(50))
to_chat(usr, "<span class='warning'>Uh... how do these things work?!</span>")
handcuffs_apply(M, user, TRUE)
return

View File

@@ -97,7 +97,7 @@
feed_to(user, M)
return
else
if((M_CLUMSY in user.mutations) && prob(50))
if(clumsy_check(user) && prob(50))
return eyestab(user,user)
else
return eyestab(M, user)
@@ -170,7 +170,7 @@
return (BRUTELOSS)
/obj/item/weapon/kitchen/utensil/knife/attack(target as mob, mob/living/user as mob)
if ((M_CLUMSY in user.mutations) && prob(50))
if (clumsy_check(user) && prob(50))
to_chat(user, "<span class='warning'>You accidentally cut yourself with the [src].</span>")
user.take_organ_damage(20)
return
@@ -296,7 +296,7 @@
attack_verb = list("bashes", "batters", "bludgeons", "thrashes", "whacks") //I think the rollingpin attackby will end up ignoring this anyway.
/obj/item/weapon/kitchen/rollingpin/attack(mob/living/M as mob, mob/living/user as mob)
if ((M_CLUMSY in user.mutations) && prob(50))
if (clumsy_check(user) && prob(50))
to_chat(user, "<span class='warning'>The [src] slips out of your hand and hits your head.</span>")
user.take_organ_damage(10)
user.Paralyse(2)
@@ -368,7 +368,7 @@
// Drop all the things. All of them.
send_items_flying()
if((M_CLUMSY in user.mutations) && prob(50)) //What if he's a clown?
if(clumsy_check(user) && prob(50)) //What if he's a clown?
to_chat(M, "<span class='warning'>You accidentally slam yourself with the [src]!</span>")
M.Knockdown(1)
user.take_organ_damage(2)

View File

@@ -88,7 +88,7 @@
update_icon()
/obj/item/weapon/melee/energy/sword/attack_self(mob/living/user as mob)
if ((M_CLUMSY in user.mutations) && prob(50) && active) //only an on blade can cut
if (clumsy_check(user) && prob(50) && active) //only an on blade can cut
to_chat(user, "<span class='danger'>You accidentally cut yourself with [src].</span>")
user.take_organ_damage(5,5)
return
@@ -154,16 +154,6 @@
attack_verb = list("attacks", "slashes", "stabs", "slices", "tears", "rips", "dices", "cuts")
/obj/item/weapon/melee/energy/sword/bsword/IsShield()
if(active)
return 1
return 0
/obj/item/weapon/melee/energy/sword/bsword/attack_self(mob/living/user as mob)
toggleActive(user)
add_fingerprint(user)
return
/obj/item/weapon/melee/energy/sword/bsword/update_icon()
if(active)
icon_state = active_state
@@ -181,6 +171,9 @@
qdel(W)
qdel(src)
/obj/item/weapon/melee/energy/sword/bsword/clumsy_check(mob/living/user)
return 0
/obj/item/weapon/melee/energy/sword/pirate
name = "energy cutlass"
desc = "Arrrr matey."

View File

@@ -31,7 +31,7 @@
to_chat(user, "<span class='warning'>You don't have the dexterity to do this!</span>")
return
if((M_CLUMSY in user.mutations) && prob(50))
if(clumsy_check(user) && prob(50))
user.visible_message("<span class='warning'>\The [src] slips out of [user]'s hands and hits \his head.</span>",
"<span class='warning'>\The [src] slips out of your hands and hits your head.</span>")
user.apply_damage(10, BRUTE, LIMB_HEAD)

View File

@@ -109,7 +109,7 @@
return 0
/obj/item/weapon/shield/energy/attack_self(mob/living/user as mob)
if ((M_CLUMSY in user.mutations) && prob(50))
if (clumsy_check(user) && prob(50))
to_chat(user, "<span class='warning'>You beat yourself in the head with [src].</span>")
user.take_organ_damage(5)
active = !active

View File

@@ -71,7 +71,7 @@
..() //WHACK
return 1 //Non-chaplains can't use the holy book, at least not properly
if((M_CLUMSY in user.mutations) && prob(50)) //Using it while clumsy, let's have some fun
if(clumsy_check(user) && prob(50)) //Using it while clumsy, let's have some fun
user.visible_message("<span class='warning'>\The [src] slips out of [user]'s hands and hits \his head.</span>",
"<span class='warning'>\The [src] slips out of your hands and hits your head.</span>")
user.apply_damage(10, BRUTE, LIMB_HEAD)

View File

@@ -30,7 +30,7 @@
/obj/item/weapon/storage/briefcase/attack(mob/living/M as mob, mob/living/user as mob)
//..()
if ((M_CLUMSY in user.mutations) && prob(50))
if (clumsy_check(user) && prob(50))
to_chat(user, "<span class='warning'>The [src] slips out of your hand and hits your head.</span>")
user.take_organ_damage(10)
user.Paralyse(2)

View File

@@ -189,7 +189,7 @@
//I consider this worthless but it isn't my code so whatever. Remove or uncomment.
/*attack(mob/M as mob, mob/living/user as mob)
if ((M_CLUMSY in user.mutations) && prob(50))
if (clumsy_check(user) && prob(50))
to_chat(user, "<span class='warning'>The [src] slips out of your hand and hits your head.</span>")
user.take_organ_damage(10)
user.Paralyse(2)

View File

@@ -95,7 +95,7 @@
..()
/obj/item/weapon/melee/baton/attack_self(mob/user)
if(status && (M_CLUMSY in user.mutations) && prob(50))
if(status && clumsy_check(user) && prob(50))
user.simple_message("<span class='warning'>You grab the [src] on the wrong side.</span>",
"<span class='danger'>The [name] blasts you with its power!</span>")
user.Knockdown(stunforce*3)
@@ -120,7 +120,7 @@
add_fingerprint(user)
/obj/item/weapon/melee/baton/attack(mob/M, mob/user)
if(status && (M_CLUMSY in user.mutations) && prob(50))
if(status && clumsy_check(user) && prob(50))
user.simple_message("<span class='danger'>You accidentally hit yourself with [src]!</span>",
"<span class='danger'>The [name] goes mad!</span>")
user.Knockdown(stunforce*3)

View File

@@ -33,7 +33,7 @@
force = 10
/obj/item/weapon/melee/classic_baton/attack(mob/M as mob, mob/living/user as mob)
if ((M_CLUMSY in user.mutations) && prob(50))
if (clumsy_check(user) && prob(50))
to_chat(user, "<span class='warning'>You club yourself over the head.</span>")
user.Knockdown(3 * force)
if(ishuman(user))
@@ -141,7 +141,7 @@
/obj/item/weapon/melee/telebaton/attack(mob/target as mob, mob/living/user as mob)
if(on)
if ((M_CLUMSY in user.mutations) && prob(50))
if (clumsy_check(user) && prob(50))
user.simple_message("<span class='warning'>You club yourself over the head.</span>",
"<span class='danger'>The fishing rod goes mad!</span>")

View File

@@ -135,7 +135,7 @@
return ..()
if(user.zone_sel.selecting != "eyes" && user.zone_sel.selecting != LIMB_HEAD)
return ..()
if((M_CLUMSY in user.mutations) && prob(50))
if(clumsy_check(user) && prob(50))
M = user
return eyestab(M,user)

View File

@@ -129,7 +129,7 @@
/obj/item/weapon/dualsaber/attack(target as mob, mob/living/user as mob)
..()
if((M_CLUMSY in user.mutations) && (wielded) &&prob(40))
if(clumsy_check(user) && (wielded) &&prob(40))
to_chat(user, "<span class='warning'>You twirl around a bit before losing your balance and impaling yourself on the [src].</span>")
user.take_organ_damage(20,25)
return
@@ -195,6 +195,8 @@
M.simple_message("<span class='notice'>You slipped on [src]!</span>",
"<span class='userdanger'>Something is scratching at your feet! Oh god!</span>")
/obj/item/weapon/dualsaber/bananabunch/clumsy_check(mob/living/user)
return 0
/*
* High-Frequency Blade

View File

@@ -475,3 +475,8 @@ a {
if(!defective)
defective = 1
desc += "\nIt doesn't look to be in the best shape."
/obj/proc/clumsy_check(var/mob/living/user)
if(istype(user))
return (M_CLUMSY in user.mutations)
return 0

View File

@@ -52,7 +52,7 @@
if(clumsy_check)
if(istype(occupant, /mob/living))
var/mob/living/M = occupant
if(!(M_CLUMSY in M.mutations) && M.dizziness < 450)
if(!clumsy_check(M) && M.dizziness < 450)
return
occupant.Knockdown(2)
occupant.Stun(2)

View File

@@ -54,7 +54,7 @@
if(!armed)
to_chat(user, "<span class='notice'>You arm [src].</span>")
else
if(((user.getBrainLoss() >= 60 || (M_CLUMSY in user.mutations)) && prob(50)))
if(((user.getBrainLoss() >= 60 || clumsy_check(user)) && prob(50)))
var/datum/organ/external/OE = user.get_active_hand_organ()

View File

@@ -62,7 +62,7 @@
/mob/living/carbon/human/kick_act(mob/living/carbon/human/M)
M.delayNextAttack(20) //Kicks are slow
if((src == M) || ((M_CLUMSY in M.mutations) && prob(20))) //Kicking yourself (or being clumsy) = stun
if((src == M) || (M_CLUMSY in M.mutations) && prob(20)) //Kicking yourself (or being clumsy) = stun
M.visible_message("<span class='notice'>\The [M] trips while attempting to kick \the [src]!</span>", "<span class='userdanger'>While attempting to kick \the [src], you trip and fall!</span>")
M.Knockdown(rand(1,10))
return

View File

@@ -189,7 +189,7 @@
var/mode = 1;
/obj/item/device/robotanalyzer/attack(mob/living/M as mob, mob/living/user as mob)
if(( (M_CLUMSY in user.mutations) || user.getBrainLoss() >= 60) && prob(50))
if(( clumsy_check(user) || user.getBrainLoss() >= 60) && prob(50))
to_chat(user, text("<span class='warning'>You try to analyze the floor's vitals!</span>"))
for(var/mob/O in viewers(M, null))
O.show_message(text("<span class='warning'>[user] has analyzed the floor's vitals!</span>"), 1)

View File

@@ -29,7 +29,7 @@
set src in usr
// Didn't feel like this was appropriate for a paper that is made of plastic
//if((M_CLUMSY in usr.mutations) && prob(50))
//if(clumsy_check(usr) && prob(50))
// to_chat(usr, "<span class='warning'>You cut yourself on the paper.</span>")
// return

View File

@@ -85,7 +85,7 @@
set category = "Object"
set src in usr
if((M_CLUMSY in usr.mutations) && prob(50))
if(clumsy_check(usr) && prob(50))
to_chat(usr, "<span class='warning'>You cut yourself on [src].</span>")
return
var/n_name = copytext(sanitize(input(usr, "What would you like to label [src]?", "Paper Labelling", null) as text), 1, MAX_NAME_LEN)
@@ -352,7 +352,7 @@
var/obj/item/clothing/gloves/G = H.gloves
if(G.max_heat_protection_temperature)
prot = (G.max_heat_protection_temperature > src.autoignition_temperature)
if(!prot && (M_CLUMSY in H.mutations) && prob(50)) //only fail if human
if(!prot && clumsy_check(H) && prob(50)) //only fail if human
H.apply_damage(10,BURN,(pick(LIMB_LEFT_HAND, LIMB_RIGHT_HAND)))
user.drop_hands()
user.visible_message( \

View File

@@ -130,7 +130,7 @@
if(clumsy_check)
if(istype(user, /mob/living))
var/mob/living/M = user
if ((M_CLUMSY in M.mutations) && prob(50))
if (clumsy_check(M) && prob(50))
to_chat(M, "<span class='danger'>[src] blows up in your face.</span>")
M.take_organ_damage(0,20)
M.drop_item(src, force_drop = 1)

View File

@@ -121,7 +121,7 @@
if(M_HULK in M.mutations)
to_chat(M, "<span class='warning'>Your meaty finger is much too large for the trigger guard!</span>")
return 0
else if((M_CLUMSY in M.mutations) && prob(50))
else if(clumsy_check(M) && prob(50))
to_chat(M, "<span class='danger'>[src] blows up in your face!</span>")
target = M

View File

@@ -4166,7 +4166,7 @@
return 1
spawn(0)
if(((M_CLUMSY in H.mutations)) || prob(25))
if((clumsy_check(H)) || prob(25))
if(H.drop_item())
user.visible_message("<span class='warning'>[src] escapes from [H]'s hands!</span>","<span class='warning'>[src] escapes from your grasp!</span>")

View File

@@ -44,7 +44,7 @@
var/inject_message = "<span class='notice'>You inject [M] with [src].</span>"
if(M == user)
inject_message = "<span class='notice'>You inject yourself with [src].</span>"
else if((M_CLUMSY in user.mutations) && prob(50))
else if(clumsy_check(user) && prob(50))
inject_message = "<span class='notice'>Oops! You inject yourself with [src] by accident.</span>"
M = user

View File

@@ -84,7 +84,7 @@
return
if (user.a_intent == I_HURT && ismob(target))
if((M_CLUMSY in user.mutations) && prob(50))
if(clumsy_check(user) && prob(50))
target = user
if (target != user && !can_stab) // You still can stab yourself if you're clumsy, honk

View File

@@ -51,7 +51,7 @@
/obj/item/weapon/gun/syringe/Fire(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, params, reflex = 0, struggle = 0)
if(syringes.len)
if(M_CLUMSY in user.mutations)
if(clumsy_check(user))
if(prob(50))
to_chat(user, "<span class='warning'>You accidentally shoot yourself!</span>")
var/obj/item/weapon/reagent_containers/syringe/S = syringes[1]

View File

@@ -60,7 +60,7 @@
/obj/item/weapon/firbang/afterattack(atom/target as mob|obj|turf|area, mob/user as mob)
if (user.get_active_hand() == src)
if ((M_CLUMSY in usr.mutations) && prob(50))
if (clumsy_check(usr) && prob(50))
to_chat(user, "<span class='warning'>Huh? How does this thing work?!</span>")
src.state = 1
src.icon_state = "flashbang1"
@@ -108,7 +108,7 @@
/obj/item/weapon/firbang/attack_self(mob/user as mob)
if (!src.state)
if (M_CLUMSY in user.mutations)
if clumsy_check(user)
to_chat(user, "<span class='warning'>Huh? How does this thing work?!</span>")
spawn( 5 )
prime()

36
html/changelogs/Sprok.yml Normal file
View File

@@ -0,0 +1,36 @@
################################
# Example Changelog File
#
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
#
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
# When it is, any changes listed below will disappear.
#
# Valid Prefixes:
# bugfix
# wip (For works in progress)
# tweak
# soundadd
# sounddel
# rscdel (general deleting of nice things)
# rscadd (general adding of nice things)
# imageadd
# imagedel
# spellcheck (typo fixes)
# experiment
# tgs (TG-ported fixes?)
#################################
# Your name.
author: Sprok
# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
delete-after: True
# Any changes you've made. See valid prefix list above.
# There needs to be a space after the - and before the prefix. Don't use tabs anywhere in this file.
# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit.
# If you're using characters such as # ' : - or the like in your changelog, surround the entire change with quotes as shown in the second example. These quotes don't show up on the changelog once it's merged and prevent errors.
# SCREW ANY OF THIS UP AND IT WON'T WORK.
changes:
- bugfix: Clumsy clowns can now use banana bunches without killing themselves.