Standardize CLUMSY

Conflicts:
	code/game/jobs/job/civilian.dm
	code/game/objects/items/weapons/defib.dm
	code/game/objects/items/weapons/stunbaton.dm
	code/modules/mob/living/silicon/robot/component.dm
	code/modules/reagents/reagent_containers/syringes.dm
This commit is contained in:
Rob Nelson
2014-01-21 13:53:13 -08:00
committed by ZomgPonies
parent 22a2df1115
commit d49e6d3bf4
34 changed files with 370 additions and 211 deletions
+2 -2
View File
@@ -102,7 +102,7 @@
if(5.0)
size = "huge"
else
//if ((CLUMSY in usr.mutations) && prob(50)) t = "funny-looking"
//if ((M_CLUMSY in usr.mutations) && prob(50)) t = "funny-looking"
usr << "This is a [src.blood_DNA ? "bloody " : ""]\icon[src][src.name]. It is a [size] item."
if(src.desc)
usr << src.desc
@@ -548,7 +548,7 @@
M.LAssailant = user
src.add_fingerprint(user)
//if((CLUMSY in user.mutations) && prob(50))
//if((M_CLUMSY in user.mutations) && prob(50))
// M = user
/*
M << "\red You stab yourself in the eye."
+1 -1
View File
@@ -15,7 +15,7 @@
var/last_used = 0 //last world.time it was used.
/obj/item/device/flash/proc/clown_check(var/mob/user)
if(user && (CLUMSY in user.mutations) && prob(50))
if(user && (M_CLUMSY in user.mutations) && prob(50))
user << "\red \The [src] slips out of your hand."
user.drop_item()
return 0
@@ -49,7 +49,7 @@
add_fingerprint(user)
if(on && user.zone_sel.selecting == "eyes")
if(((CLUMSY in user.mutations) || user.getBrainLoss() >= 60) && prob(50)) //too dumb to use flashlight properly
if(((M_CLUMSY in user.mutations) || user.getBrainLoss() >= 60) && prob(50)) //too dumb to use flashlight properly
return ..() //just hit them in the head
if(!(istype(user, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey") //don't have dexterity
+1 -1
View File
@@ -77,7 +77,7 @@ REAGENT SCANNER
/obj/item/device/healthanalyzer/attack(mob/living/M as mob, mob/living/user as mob)
if (( (CLUMSY in user.mutations) || user.getBrainLoss() >= 60) && prob(50))
if (( (M_CLUMSY in user.mutations) || user.getBrainLoss() >= 60) && prob(50))
user << text("\red You try to analyze the floor's vitals!")
for(var/mob/O in viewers(M, null))
O.show_message(text("\red [user] has analyzed the floor's vitals!"), 1)
+159
View File
@@ -0,0 +1,159 @@
/obj/item/weapon/melee/defibrilator
name = "emergency defibrilator"
desc = "A handheld emergency defibrilator, used to bring people back from the brink of death or put them there."
icon_state = "defib_full"
item_state = "defib"
flags = FPRINT | TABLEPASS
slot_flags = SLOT_BELT
force = 5
throwforce = 5
w_class = 3
var/emagged = 0
var/charges = 10
var/status = 0
var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread
origin_tech = "biotech=3"
suicide_act(mob/user)
viewers(user) << "\red <b>[user] is putting the live paddles on \his chest! It looks like \he's trying to commit suicide.</b>"
return (OXYLOSS)
/obj/item/weapon/melee/defibrilator/update_icon()
if(!status)
if(charges >= 7)
icon_state = "defib_full"
if(charges <= 6 && charges >= 4)
icon_state = "defib_half"
if(charges <= 3 && charges >= 1)
icon_state = "defib_low"
if(charges <= 0)
icon_state = "defib_empty"
else
if(charges >= 7)
icon_state = "defibpaddleout_full"
if(charges <= 6 && charges >= 4)
icon_state = "defibpaddleout_half"
if(charges <= 3 && charges >= 1)
icon_state = "defibpaddleout_low"
/obj/item/weapon/melee/defibrilator/attack_self(mob/user as mob)
if(status && (M_CLUMSY in user.mutations) && prob(50))
spark_system.attach(user)
spark_system.set_up(5, 0, src)
spark_system.start()
user << "\red You touch the paddles together shorting the device."
user.Weaken(5)
charges--
if(charges < 1)
status = 0
update_icon()
return
if(charges > 0)
status = !status
user << "<span class='notice'>\The [src] is now [status ? "on" : "off"].</span>"
playsound(get_turf(src), "sparks", 75, 1, -1)
update_icon()
else
status = 0
user << "<span class='warning'>\The [src] is out of charge.</span>"
add_fingerprint(user)
/obj/item/weapon/melee/defibrilator/attackby(obj/item/weapon/W as obj, mob/user as mob)
..()
if(istype(W, /obj/item/weapon/card/emag))
var/image/I = image("icon" = "icons/obj/weapons.dmi", "icon_state" = "defib_emag")
if(emagged == 0)
emagged = 1
usr << "\red [W] unlocks [src]'s safety protocols"
overlays += I
else
emagged = 0
usr << "\blue [W] sets [src]'s safety protocols"
overlays -= I
/obj/item/weapon/melee/defibrilator/attack(mob/M as mob, mob/user as mob)
var/tobehealed
var/threshhold = -config.health_threshold_dead
var/mob/living/carbon/human/H = M
if(!ishuman(M))
..()
return
if(status)
if(user.a_intent == "hurt" && emagged)
H.visible_message("<span class='danger'>[M.name] has been touched by the defibrilator paddles by [user]!</span>")
if(charges >= 2)
H.Weaken(10)
H.adjustOxyLoss(10)
else
H.Weaken(5)
H.adjustOxyLoss(5)
H.updatehealth() //forces health update before next life tick
spark_system.attach(M)
spark_system.set_up(5, 0, M)
spark_system.start()
charges -= 2
if(charges < 0)
charges = 0
if(!charges)
status = 0
update_icon()
playsound(get_turf(src), 'sound/weapons/Egloves.ogg', 50, 1, -1)
user.attack_log += "\[[time_stamp()]\]<font color='red'> Defibrilated [H.name] ([H.ckey]) with [src.name]</font>"
H.attack_log += "\[[time_stamp()]\]<font color='orange'> Defibrilated by [user.name] ([user.ckey]) with [src.name]</font>"
log_attack("<font color='red'>[user.name] ([user.ckey]) defibrilated [H.name] ([H.ckey]) with [src.name]</font>" )
if(!iscarbon(user))
M.LAssailant = null
else
M.LAssailant = user
return
H.visible_message("\blue [user] places the defibrilator paddles on [M.name]'s chest.", "\blue You place the defibrilator paddles on [M.name]'s chest.")
if(do_after(user, 10))
if(H.stat == 2 || H.stat == DEAD)
var/uni = 0
var/armor = 0
var/health = H.health
for(var/obj/item/carried_item in H.contents)
if(istype(carried_item, /obj/item/clothing/under))
uni = 1
if(istype(carried_item, /obj/item/clothing/suit/armor))
armor = 1
if(uni && armor)
if(prob(30))
spark_system.attach(M)
spark_system.start()
if(prob(30))
tobehealed = health + threshhold
tobehealed -= 5 //They get 5 health in crit to heal the person or inject stabalizers
H.adjustOxyLoss(tobehealed)
else if(uni || armor)
if(prob(30))
spark_system.attach(M)
spark_system.start()
if(prob(60))
tobehealed = health + threshhold
tobehealed -= 5 //They get 5 health in crit to heal the person or inject stabalizers
H.adjustOxyLoss(tobehealed)
else
if(prob(90))
tobehealed = health + threshhold
tobehealed -= 5 //They get 5 health in crit to heal the person or inject stabalizers
H.adjustOxyLoss(tobehealed)
H.updatehealth() //forces a health update, otherwise the oxyloss adjustment wouldnt do anything
M.visible_message("\red [M]'s body convulses a bit.")
var/datum/organ/external/temp = H.get_organ("head")
if(H.health > -100 && !(temp.status & ORGAN_DESTROYED) && !(NOCLONE in H.mutations) && !H.suiciding)
viewers(M) << "\blue [src] beeps: Resuscitation successful."
spawn(0)
H.stat = 1
dead_mob_list -= H
living_mob_list |= H
H.emote("gasp")
else
viewers(M) << "\blue [src] beeps: Resuscitation failed."
charges--
if(charges < 1)
charges = 0
status = 0
update_icon()
else
user.visible_message("\blue [src] beeps: Patient is not in a valid state.")
@@ -13,7 +13,7 @@
var/det_time = 50
/obj/item/weapon/grenade/proc/clown_check(var/mob/living/user)
if((CLUMSY in user.mutations) && prob(50))
if((M_CLUMSY in user.mutations) && prob(50))
user << "<span class='warning'>Huh? How does this thing work?</span>"
active = 1
icon_state = initial(icon_state) + "_active"
+1 -1
View File
@@ -30,7 +30,7 @@
C.update_inv_handcuffed()
else
if ((CLUMSY in usr.mutations) && prob(50))
if ((M_CLUMSY in usr.mutations) && prob(50))
usr << "\red Uh ... how do those things work?!"
if (istype(C, /mob/living/carbon/human))
if(!C.handcuffed)
+6 -6
View File
@@ -73,7 +73,7 @@
src.icon_state = "fork"
return
else
if((CLUMSY in user.mutations) && prob(50))
if((M_CLUMSY in user.mutations) && prob(50))
M = user
return eyestab(M,user)
@@ -101,7 +101,7 @@
src.icon_state = "fork"
return
else
if((CLUMSY in user.mutations) && prob(50))
if((M_CLUMSY in user.mutations) && prob(50))
M = user
return eyestab(M,user)
@@ -122,7 +122,7 @@
return (BRUTELOSS)
/obj/item/weapon/kitchen/utensil/knife/attack(target as mob, mob/living/user as mob)
if ((CLUMSY in user.mutations) && prob(50))
if ((M_CLUMSY in user.mutations) && prob(50))
user << "\red You accidentally cut yourself with the [src]."
user.take_organ_damage(20)
return
@@ -137,7 +137,7 @@
throwforce = 10.0
/obj/item/weapon/kitchen/utensil/knife/attack(target as mob, mob/living/user as mob)
if ((CLUMSY in user.mutations) && prob(50))
if ((M_CLUMSY in user.mutations) && prob(50))
user << "\red You somehow managed to cut yourself with the [src]."
user.take_organ_damage(20)
return
@@ -220,7 +220,7 @@
attack_verb = list("bashed", "battered", "bludgeoned", "thrashed", "whacked") //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 ((CLUMSY in user.mutations) && prob(50))
if ((M_CLUMSY in user.mutations) && prob(50))
user << "\red The [src] slips out of your hand and hits your head."
user.take_organ_damage(10)
user.Paralyse(2)
@@ -307,7 +307,7 @@
sleep(rand(2,4))
if((CLUMSY in user.mutations) && prob(50)) //What if he's a clown?
if((M_CLUMSY in user.mutations) && prob(50)) //What if he's a clown?
M << "\red You accidentally slam yourself with the [src]!"
M.Weaken(1)
user.take_organ_damage(2)
@@ -56,7 +56,7 @@
user.take_organ_damage(0,10)
return
if ((CLUMSY in user.mutations) && prob(50))
if ((M_CLUMSY in user.mutations) && prob(50))
user << "\red The [src] slips out of your hand and hits your head."
user.take_organ_damage(10)
user.Paralyse(20)
@@ -16,7 +16,7 @@
/obj/item/weapon/storage/briefcase/attack(mob/living/M as mob, mob/living/user as mob)
//..()
if ((CLUMSY in user.mutations) && prob(50))
if ((M_CLUMSY in user.mutations) && prob(50))
user << "\red The [src] slips out of your hand and hits your head."
user.take_organ_damage(10)
user.Paralyse(2)
@@ -176,7 +176,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 ((CLUMSY in user.mutations) && prob(50))
if ((M_CLUMSY in user.mutations) && prob(50))
user << "\red The [src] slips out of your hand and hits your head."
user.take_organ_damage(10)
user.Paralyse(2)
+5 -5
View File
@@ -77,8 +77,8 @@
..()
return
/obj/item/weapon/melee/baton/attack_self(mob/user as mob)
if(status && (CLUMSY in user.mutations) && prob(50))
/obj/item/weapon/melee/baton/attack_self(mob/user)
if(status && (M_CLUMSY in user.mutations) && prob(50))
user << "\red You grab the [src] on the wrong side."
user.Weaken(stunforce*3)
deductcharge(hitcost)
@@ -100,9 +100,9 @@
user << "<span class='warning'>[src] is out of charge.</span>"
add_fingerprint(user)
/obj/item/weapon/melee/baton/attack(mob/M as mob, mob/user as mob)
if(status && (CLUMSY in user.mutations) && prob(50))
user << "<span class='danger'>You accidentally hit yourself with the [src]!</span>"
/obj/item/weapon/melee/baton/attack(mob/M, mob/user)
if(status && (M_CLUMSY in user.mutations) && prob(50))
user << "<span class='danger'>You accidentally hit yourself with [src]!</span>"
user.Weaken(stunforce*3)
deductcharge(hitcost)
return
@@ -401,7 +401,7 @@ LOOK FOR SURGERY.DM*/
//if(M.mutations & HUSK) return ..()
if((CLUMSY in user.mutations) && prob(50))
if((M_CLUMSY in user.mutations) && prob(50))
M = user
return eyestab(M,user)
@@ -645,7 +645,7 @@ LOOK FOR SURGERY.DM*/
if(!istype(M))
return ..()
if((CLUMSY in user.mutations) && prob(50))
if((M_CLUMSY in user.mutations) && prob(50))
M = user
return eyestab(M,user)
@@ -27,7 +27,7 @@
_color = pick("red","blue","green","purple")
/obj/item/weapon/melee/energy/sword/attack_self(mob/living/user as mob)
if ((CLUMSY in user.mutations) && prob(50))
if ((M_CLUMSY in user.mutations) && prob(50))
user << "\red You accidentally cut yourself with [src]."
user.take_organ_damage(5,5)
active = !active
@@ -82,7 +82,7 @@
force = 10
/obj/item/weapon/melee/classic_baton/attack(mob/M as mob, mob/living/user as mob)
if ((CLUMSY in user.mutations) && prob(50))
if ((M_CLUMSY in user.mutations) && prob(50))
user << "\red You club yourself over the head."
user.Weaken(3 * force)
if(ishuman(user))
@@ -181,7 +181,7 @@
/obj/item/weapon/melee/telebaton/attack(mob/target as mob, mob/living/user as mob)
if(on)
if ((CLUMSY in user.mutations) && prob(50))
if ((M_CLUMSY in user.mutations) && prob(50))
user << "\red You club yourself over the head."
user.Weaken(3 * force)
if(ishuman(user))
@@ -272,7 +272,7 @@
return 0
/obj/item/weapon/shield/energy/attack_self(mob/living/user as mob)
if ((CLUMSY in user.mutations) && prob(50))
if ((M_CLUMSY in user.mutations) && prob(50))
user << "\red You beat yourself in the head with [src]."
user.take_organ_damage(5)
active = !active
+1 -1
View File
@@ -86,7 +86,7 @@
if(!istype(M)) return ..()
if(user.zone_sel.selecting != "eyes" && user.zone_sel.selecting != "head")
return ..()
if((CLUMSY in user.mutations) && prob(50))
if((M_CLUMSY in user.mutations) && prob(50))
M = user
return eyestab(M,user)
+1 -1
View File
@@ -161,7 +161,7 @@
/obj/item/weapon/twohanded/dualsaber/attack(target as mob, mob/living/user as mob)
..()
if((CLUMSY in user.mutations) && (wielded) &&prob(40))
if((M_CLUMSY in user.mutations) && (wielded) &&prob(40))
user << "\red You twirl around a bit before losing your balance and impaling yourself on the [src]."
user.take_organ_damage(20,25)
return
+1 -1
View File
@@ -49,7 +49,7 @@
user << "\red You don't have the dexterity to do this!"
return
if ((CLUMSY in user.mutations) && prob(50))
if ((M_CLUMSY in user.mutations) && prob(50))
user << "\red The rod slips out of your hand and hits your head."
user.take_organ_damage(10)
user.Paralyse(20)