[Ready for Review] Nerfs IPCs Part 1/1,034 (#4229)

Refactors electrocute_act slightly. Electricity will now only start in your hands if ground_zero is explicitly set to l_hand or r_hand. All instances where electrocute_act is called because you touched something (IE opening a crate, touching the powergrid) have been set so that ground_zero is your currently active hand.

Otherwise, ground_zero will be randomly selected from available organs.

This is important because it is the siemens_coefficient of ground_zero only that affects electrical conductivity. EG if you get tesla_zapped in the chest you will not be saved by wearing insulated gloves. Once the electricity is in your body it does not matter.

Sufficiently powerful electricity (shock_damage >= 6) will induce an EMP in the relevant contact zones. This EMP will affect all items in the relevant organ only. Shock damage will still become reduced as the arc propagates through your body, and the EMP's produced will be updated accordingly.

The IPC power cell organ will now produce effects when EMP'd based on the current damage value of the organ pre-decrement, ranging from stuttering and blurriness to unconsciousness. Other special EMP effects for other IPC organs are pending, but I am thinking of holding it off for Part 2/1,034

Baton class weapons have been modified. Their raw force damage has been reduced, but they will now deal shock damage to a roughly equivalent value.

Harmbatons will deal 5 brute and 10 shock, and their electrocute_act will have a defined def zone (e.g it is a localized shock and there will be no arcs)

Cattleprods will deal 3 brute and 6 shock on both harm and help intents, and their electrocute_act is non-localized and will cause arcing.

Stunrods will deal 7 brute and 14 shock on both harm and help intents, and their electrocute_act is non-localized and will cause arcing.

(For clarification, cattleprods and stunrods currently still deal no brute on help intent, but will cause shock damage)

Fixes an issue with electrocute_act where if def_zone is called would not actually do anything.
This commit is contained in:
LordFowl
2018-03-10 17:18:27 +02:00
committed by Erki
parent cad0bb1584
commit e2e798382c
8 changed files with 137 additions and 32 deletions
+59 -24
View File
@@ -404,8 +404,9 @@
if(wear_id)
return wear_id.GetID()
/mob/living/carbon/human/electrocute_act(var/shock_damage, var/obj/source, var/base_siemens_coeff = 1.0, var/def_zone = null, var/tesla_shock = 0)
/mob/living/carbon/human/electrocute_act(var/shock_damage, var/obj/source, var/base_siemens_coeff = 1.0, var/def_zone = null, var/tesla_shock = 0, var/ground_zero)
var/hairvar = 0
var/list/damage_areas = list()
if(status_flags & GODMODE) return 0 //godmode
if (!tesla_shock)
@@ -414,7 +415,7 @@
return 0
if(!def_zone)
var/list/damage_areas = list() //The way this works is by damaging multiple areas in an "Arc" if no def_zone is provided. should be pretty easy to add more arcs if it's needed. though I can't imangine a situation that can apply.
//The way this works is by damaging multiple areas in an "Arc" if no def_zone is provided. should be pretty easy to add more arcs if it's needed. though I can't imangine a situation that can apply.
if(istype(user, /mob/living/carbon/human))
if(h_style == "Floorlength Braid" || h_style == "Very Long Hair")
hairvar = 1
@@ -423,7 +424,7 @@
if(1)
damage_areas = list("l_hand", "l_arm", "chest", "r_arm", "r_hand")
if(2)
damage_areas = list("r_hand", "r_arm", "chest", "l_arm", "L_hand")
damage_areas = list("r_hand", "r_arm", "chest", "l_arm", "l_hand")
if(3)
damage_areas = list("l_hand", "l_arm", "chest", "groin", "l_leg", "l_foot")
if(4)
@@ -437,31 +438,65 @@
h_style = "skinhead"
visible_message("<span class='warning'>[src]'s hair gets a burst of electricty through it, burning and turning to dust!</span>", "<span class='danger'>your hair burns as the current flows through it, turning to dust!</span>", "<span class='notice'>You hear a crackling sound, and smell burned hair!.</span>")
update_hair()
if(gloves)
shock_damage *= gloves.siemens_coefficient
else
damage_areas = list(def_zone)
for (var/area in damage_areas)
apply_damage(shock_damage, BURN, area, used_weapon="Electrocution")
shock_damage *= 0.4
playsound(loc, "sparks", 50, 1, -1)
if(!ground_zero)
ground_zero = pick(damage_areas)
if (shock_damage > 15 || tesla_shock)
visible_message(
"<span class='warning'>[src] was shocked by the [source]!</span>",
"<span class='danger'>You feel a powerful shock course through your body!</span>",
"<span class='warning'>You hear a heavy electrical crack.</span>"
)
Stun(10)//This should work for now, more is really silly and makes you lay there forever
Weaken(10)
if(!(ground_zero in damage_areas))
damage_areas.Add(ground_zero) //sucks to suck, get more zappy time bitch
else
visible_message(
"<span class='warning'>[src] was mildly shocked by the [source].</span>",
"<span class='warning'>You feel a mild shock course through your body.</span>",
"<span class='warning'>You hear a light zapping.</span>"
)
var/obj/item/organ/external/contact = get_organ(check_zone(ground_zero))
shock_damage *= get_siemens_coefficient_organ(contact)
spark(loc, 5, alldirs)
var/obj/item/organ/external/affecting
for (var/area in damage_areas)
affecting = get_organ(check_zone(area))
var/emp_damage
switch(shock_damage)
if(-INFINITY to 5)
emp_damage = 0
if(6 to 19)
emp_damage = 3
if(20 to 49)
emp_damage = 2
else
emp_damage = 1
if(emp_damage)
for(var/obj/item/organ/O in affecting.internal_organs)
O.emp_act(emp_damage)
emp_damage *= 0.4
for(var/obj/item/I in affecting.implants)
I.emp_act(emp_damage)
emp_damage *= 0.4
for(var/obj/item/I in affecting)
I.emp_act(emp_damage)
emp_damage *= 0.4
apply_damage(shock_damage, BURN, area, used_weapon="Electrocution")
shock_damage *= 0.4
playsound(loc, "sparks", 50, 1, -1)
if (shock_damage > 15 || tesla_shock)
visible_message(
"<span class='warning'>[src] was shocked by the [source]!</span>",
"<span class='danger'>You feel a powerful shock course through your body!</span>",
"<span class='warning'>You hear a heavy electrical crack.</span>"
)
Stun(10)//This should work for now, more is really silly and makes you lay there forever
Weaken(10)
else
visible_message(
"<span class='warning'>[src] was mildly shocked by the [source].</span>",
"<span class='warning'>You feel a mild shock course through your body.</span>",
"<span class='warning'>You hear a light zapping.</span>"
)
spark(loc, 5, alldirs)
return shock_damage
+1 -1
View File
@@ -128,7 +128,7 @@
return target_zone
//Called when the mob is hit with an item in combat. Returns the blocked result
/mob/living/proc/hit_with_weapon(obj/item/I, mob/living/user, var/effective_force, var/hit_zone)
/mob/living/proc/hit_with_weapon(obj/item/I, mob/living/user, var/effective_force, var/hit_zone, var/ground_zero)
visible_message("<span class='danger'>[src] has been [LAZYPICK(I.attack_verb,"attacked")] with [I] by [user]!</span>")
var/blocked = run_armor_check(hit_zone, "melee")