[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
+11 -2
View File
@@ -5,7 +5,7 @@
icon_state = "stunbaton"
item_state = "baton"
slot_flags = SLOT_BELT
force = 15
force = 5
sharp = 0
edge = 0
throwforce = 7
@@ -18,6 +18,7 @@
var/obj/item/weapon/cell/bcell
var/hitcost = 1000 //oh god why do power cells carry so much charge? We probably need to make a distinction between "industrial" sized power cells for APCs and power cells for everything else.
var/baton_color = "#FF6A00"
var/sheathed = 1 //electrocutes only on harm intent
/obj/item/weapon/melee/baton/Initialize()
. = ..()
@@ -125,6 +126,10 @@
stun *= 0.5
if(status) //Checks to see if the stunbaton is on.
agony *= 0.5 //whacking someone causes a much poorer contact than prodding them.
if(sheathed) //however breaking the skin results in a more potent electric shock or some bullshit. im a coder, not a doctor
L.electrocute_act(force * 2, src, def_zone = target_zone)
else
L.electrocute_act(force * 2, src, ground_zero = target_zone)
else
agony = 0
//we can't really extract the actual hit zone from ..(), unfortunately. Just act like they attacked the area they intended to.
@@ -151,6 +156,7 @@
return 1
else
H.visible_message("<span class='danger'>[L] has been prodded in the [affecting.name] with [src] by [user]!</span>")
H.electrocute_act(force * 2, src, ground_zero = target_zone)
else
if(!status)
L.visible_message("<span class='warning'>[L] has been prodded with [src] by [user]. Luckily it was off.</span>")
@@ -221,6 +227,7 @@
attack_verb = list("poked")
slot_flags = null
baton_color = "#FFDF00"
sheathed = 0
/obj/item/weapon/melee/baton/stunrod
name = "stunrod"
@@ -228,10 +235,11 @@
icon = 'icons/obj/stunrod.dmi'
icon_state = "stunrod"
item_state = "stunrod"
force = 20
force = 7
baton_color = "#75ACFF"
origin_tech = list(TECH_COMBAT = 4, TECH_ILLEGAL = 2)
contained_sprite = 1
sheathed = 0
/obj/item/weapon/melee/baton/stunrod/Initialize()
bcell = new/obj/item/weapon/cell/high(src)
@@ -262,6 +270,7 @@
stunforce = 1
origin_tech = list(TECH_COMBAT = 1)
contained_sprite = 1
sheathed = 0
/obj/item/weapon/melee/baton/slime/Initialize()
bcell = new/obj/item/weapon/cell/high(src)
@@ -31,9 +31,14 @@
if(rigged && locate(/obj/item/device/radio/electropack) in src)
if(isliving(usr))
var/mob/living/L = usr
if(L.electrocute_act(17, src))
var/touchy_hand
if(L.hand)
touchy_hand = "r_hand"
else
touchy_hand = "l_hand"
if(L.electrocute_act(17, src, ground_zero = touchy_hand))
spark(src, 5, alldirs)
if(usr.stunned)
if(L.stunned)
return 2
playsound(loc, 'sound/machines/click.ogg', 15, 1, -3)
+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")
+1 -2
View File
@@ -283,13 +283,12 @@
/obj/item/organ/emp_act(severity)
if(!(status & ORGAN_ROBOT))
return
switch (severity)
if (1.0)
take_damage(rand(7,20) * emp_coeff)
return
if (2.0)
take_damage(rand(3,7) * emp_coeff)
return
if(3.0)
take_damage(rand(3) * emp_coeff)
+12
View File
@@ -65,11 +65,23 @@
organ_tag = "cell"
parent_organ = "chest"
vital = 1
var/emp_counter = 0
/obj/item/organ/cell/Initialize()
robotize()
. = ..()
/obj/item/organ/cell/process()
..()
if(emp_counter)
emp_counter--
/obj/item/organ/cell/emp_act(severity)
emp_counter += 30/severity
if(emp_counter >= 30)
owner.Paralyse(emp_counter/6)
owner << "<span class='danger'>%#/ERR: Power leak detected!$%^/</span>"
/obj/item/organ/cell/replaced()
. = ..()
// This is very ghetto way of rebooting an IPC. TODO better way.
+6 -1
View File
@@ -383,7 +383,12 @@
else
power_source = cell
shock_damage = cell_damage
var/drained_hp = M.electrocute_act(shock_damage, source, siemens_coeff) //zzzzzzap!
var/touchy_hand
if(M.hand)
touchy_hand = "r_hand"
else
touchy_hand = "l_hand"
var/drained_hp = M.electrocute_act(shock_damage, source, siemens_coeff, ground_zero = touchy_hand) //zzzzzzap!
var/drained_energy = drained_hp*20
if (source_area)
+40
View File
@@ -0,0 +1,40 @@
################################
# 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
# rscadd (general adding of nice things)
# rscdel (general deleting of nice things)
# imageadd
# imagedel
# maptweak
# spellcheck (typo fixes)
# experiment
# balance
#################################
# Your name.
author: LordFowl
# 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.
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
# SCREW THIS UP AND IT WON'T WORK.
# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
changes:
- tweak: "Batons will now deal both brute and shock damage."
- tweak: "Electricity system modified to be more realistic in its arcing and damage,"
- tweak: "Electricity can now cause electronic damage."
- rscadd: "IPCs will now be paralysed by cattleprods, stunrods, and harmbatons targeted at the chest."