Merge pull request #8469 from mwerezak/robot-emp

Reduces the effect of EMP on robot power cells, some other things
This commit is contained in:
Zuhayr
2015-03-26 19:00:39 +10:30
10 changed files with 23 additions and 16 deletions

View File

@@ -721,7 +721,7 @@
else
//Want this to be roughly independant of the number of modules, meaning that X emp hits will disable Y% of the suit's modules on average.
//that way people designing hardsuits don't have to worry (as much) about how adding that extra module will affect emp resiliance by 'soaking' hits for other modules
chance = max(0, damage - emp_protection)*min(installed_modules.len/15, 1)
chance = 2*max(0, damage - emp_protection)*min(installed_modules.len/15, 1)
if(!prob(chance))
return

View File

@@ -39,9 +39,9 @@
flags_inv = HIDEJUMPSUIT|HIDETAIL
flags = STOPPRESSUREDAMAGE | THICKMATERIAL | AIRTIGHT
slowdown = 0
//will reach 10 breach damage after 18 laser carbine blasts, or 7 revolver hits. Completely immune to smg hits.
breach_threshold = 28
resilience = 0.05
//will reach 10 breach damage after 25 laser carbine blasts, 3 revolver hits, or ~1 PTR hit. Completely immune to smg or sts hits.
breach_threshold = 38
resilience = 0.2
can_breach = 1
sprite_sheets = list("Tajara" = 'icons/mob/species/tajaran/suit.dmi',"Unathi" = 'icons/mob/species/unathi/suit.dmi')
supporting_limbs = list()

View File

@@ -20,7 +20,6 @@
/obj/item/clothing/suit/space/rig/light
name = "suit"
breach_threshold = 18 //comparable to voidsuits
resilience = 0.2
/obj/item/clothing/gloves/rig/light
name = "gloves"
@@ -82,8 +81,7 @@
..()
/obj/item/clothing/suit/space/rig/light/ninja
breach_threshold = 28 //comparable to regular hardsuits
resilience = 0.05
breach_threshold = 38 //comparable to regular hardsuits
/obj/item/weapon/rig/light/stealth
name = "stealth suit control module"

View File

@@ -241,7 +241,7 @@
src.updatehealth()
// damage ONE external organ, organ gets randomly selected from damaged ones.
/mob/living/proc/take_organ_damage(var/brute, var/burn)
/mob/living/proc/take_organ_damage(var/brute, var/burn, var/emp=0)
if(status_flags & GODMODE) return 0 //godmode
adjustBruteLoss(brute)
adjustFireLoss(burn)

View File

@@ -5,6 +5,7 @@
icon_state = "repairbot"
maxHealth = 35
health = 35
cell_emp_mult = 1
universal_speak = 0
universal_understand = 1
gender = NEUTER

View File

@@ -11,7 +11,7 @@
if(bruteloss<0) bruteloss = 0
if(fireloss<0) fireloss = 0
/mob/living/silicon/robot/drone/take_organ_damage(var/brute = 0, var/burn = 0, var/sharp = 0)
/mob/living/silicon/robot/drone/take_organ_damage(var/brute = 0, var/burn = 0, var/sharp = 0, var/emp = 0)
take_overall_damage(brute,burn)
/mob/living/silicon/robot/drone/heal_organ_damage(var/brute, var/burn)

View File

@@ -50,6 +50,8 @@ var/list/robot_verbs_default = list(
var/obj/item/weapon/cell/cell = null
var/obj/machinery/camera/camera = null
var/cell_emp_mult = 2
// Components are basically robot organs.
var/list/components = list()

View File

@@ -62,7 +62,7 @@
var/datum/robot_component/picked = pick(parts)
picked.heal_damage(brute,burn)
/mob/living/silicon/robot/take_organ_damage(var/brute = 0, var/burn = 0, var/sharp = 0, var/edge = 0)
/mob/living/silicon/robot/take_organ_damage(var/brute = 0, var/burn = 0, var/sharp = 0, var/edge = 0, var/emp = 0)
var/list/components = get_damageable_components()
if(!components.len)
return
@@ -84,10 +84,11 @@
burn -= absorb_burn
src << "\red Your shield absorbs some of the impact!"
var/datum/robot_component/armour/A = get_armour()
if(A)
A.take_damage(brute,burn,sharp,edge)
return
if(!emp)
var/datum/robot_component/armour/A = get_armour()
if(A)
A.take_damage(brute,burn,sharp,edge)
return
var/datum/robot_component/C = pick(components)
C.take_damage(brute,burn,sharp,edge)

View File

@@ -56,10 +56,10 @@
/mob/living/silicon/emp_act(severity)
switch(severity)
if(1)
src.take_organ_damage(20)
src.take_organ_damage(0,20,emp=1)
Stun(rand(5,10))
if(2)
src.take_organ_damage(10)
src.take_organ_damage(0,10,emp=1)
Stun(rand(1,5))
flick("noise", src:flash)
src << "\red <B>*BZZZT*</B>"

View File

@@ -128,6 +128,11 @@
rigged = 1 //broken batterys are dangerous
/obj/item/weapon/cell/emp_act(severity)
//remove this once emp changes on dev are merged in
if(isrobot(loc))
var/mob/living/silicon/robot/R = loc
severity *= R.cell_emp_mult
charge -= maxcharge / severity
if (charge < 0)
charge = 0