Merges taser and stun baton effects

Makes the code for handling stun weapon effects much cleaner.
Moves electrocute_act and emp_act from living.dm into living_defense.dm

Conflicts:
	code/game/objects/items/weapons/stunbaton.dm
	code/modules/mob/living/carbon/human/human_defense.dm
	code/modules/mob/living/living.dm
This commit is contained in:
mwerezak
2014-08-03 15:59:21 -04:00
committed by ZomgPonies
parent 64638987dc
commit f43a3ead70
6 changed files with 58 additions and 59 deletions
@@ -61,18 +61,7 @@ emp_act
//BEGIN BOOK'S TASER NERF.
if(istype(P, /obj/item/projectile/beam/stun))
var/datum/organ/external/select_area = get_organ(def_zone) // We're checking the outside, buddy!
var/list/clothing_items = list(head, wear_mask, wear_suit, w_uniform, gloves, shoes) // What all are we checking?
for(var/obj/item/clothing/CL in clothing_items) //Make an unregulated var to pass around.
if(!istype(CL)) //This isn't necessary, is it?
continue
if(CL.body_parts_covered & select_area.body_part) // Is that body part being targeted covered by CL?
P.agony *= CL.siemens_coefficient
//blocked = 0 here as we've already adjused based on siemens_coefficient.
apply_effect(P.agony,AGONY,0)
flash_pain()
stun_effect_act(0, P.agony, def_zone)
src <<"\red You have been hit by [P]!"
del P
@@ -91,6 +80,19 @@ emp_act
return (..(P , def_zone))
/mob/living/carbon/human/stun_effect_act(var/stun_amount, var/agony_amount, var/def_zone)
switch (def_zone)
if("head")
agony_amount *= 1.25
//if("l_hand", "r_hand") //TODO
//if("l_foot", "r_foot") //TODO
var/datum/organ/external/affected = get_organ(check_zone(def_zone))
var/siemens_coeff = get_siemens_coefficient_organ(affected)
stun_amount *= siemens_coeff
agony_amount *= siemens_coeff
..(stun_amount, agony_amount, def_zone)
/mob/living/carbon/human/getarmor(var/def_zone, var/type)
var/armorval = 0
+2 -8
View File
@@ -227,14 +227,8 @@
return 0
/mob/living/proc/electrocute_act(var/shock_damage, var/obj/source, var/siemens_coeff = 1.0)
return 0 //only carbon liveforms have this proc
/mob/living/emp_act(severity)
var/list/L = src.get_contents()
for(var/obj/O in L)
O.emp_act(severity)
..()
/mob/living/proc/can_inject()
return 1
/mob/living/proc/get_organ_target()
var/mob/shooter = src
+24
View File
@@ -68,6 +68,30 @@
src.dust()
return absorb
//Handles the effects of "stun" weapons
/mob/living/proc/stun_effect_act(var/stun_amount, var/agony_amount, var/def_zone)
flash_pain()
if (stun_amount)
Stun(stun_amount)
Weaken(stun_amount)
apply_effect(STUTTER, stun_amount)
apply_effect(EYE_BLUR, stun_amount)
if (agony_amount)
apply_effect(agony_amount, AGONY,0)
apply_effect(STUTTER, agony_amount/10)
apply_effect(EYE_BLUR, agony_amount/10)
/mob/living/proc/electrocute_act(var/shock_damage, var/obj/source, var/siemens_coeff = 1.0)
return 0 //only carbon liveforms have this proc
/mob/living/emp_act(severity)
var/list/L = src.get_contents()
for(var/obj/O in L)
O.emp_act(severity)
..()
//this proc handles being hit by a thrown atom
/mob/living/hitby(atom/movable/AM as mob|obj,var/speed = 5)//Standardization and logging -Sieve
if(istype(AM,/obj/))
@@ -107,6 +107,9 @@
src << "\red Warning: Electromagnetic pulse detected."
..()
/mob/living/silicon/stun_effect_act(var/stun_amount, var/agony_amount)
return //immune
/mob/living/silicon/proc/damage_mob(var/brute = 0, var/fire = 0, var/tox = 0)
return
-11
View File
@@ -165,17 +165,6 @@ proc/hasorgans(A)
zone = "head"
if("mouth")
zone = "head"
/* if("l_hand")
zone = "l_arm"
if("r_hand")
zone = "r_arm"
if("l_foot")
zone = "l_leg"
if("r_foot")
zone = "r_leg"
if("groin")
zone = "chest"
*/
return zone
// Returns zone with a certain probability.