Merge pull request #8318 from mwerezak/hardsuit-emp

Hardsuit fixes, tweaks, EMP effects
This commit is contained in:
Snapshot
2015-02-28 20:16:36 -08:00
14 changed files with 136 additions and 44 deletions

View File

@@ -151,7 +151,7 @@
selectable = 1
toggleable = 1
use_power_cost = 50
active_power_cost = 5
active_power_cost = 10
passive_power_cost = 0
gun_type = /obj/item/weapon/gun/energy/crossbow/ninja

View File

@@ -441,4 +441,32 @@
drain_loc = null
interfaced_with = null
total_power_drained = 0
total_power_drained = 0
/*
//Maybe make this use power when active or something
/obj/item/rig_module/emp_shielding
name = "\improper EMP dissipation module"
desc = "A bewilderingly complex bundle of fiber optics and chips."
toggleable = 1
usable = 0
activate_string = "Enable active EMP shielding"
deactivate_string = "Disable active EMP shielding"
interface_name = "active EMP shielding system"
interface_desc = "A highly experimental system that augments the hardsuit's existing EM shielding."
var/protection_amount = 20
/obj/item/rig_module/emp_shielding/activate()
if(!..())
return
holder.emp_protection += protection_amount
/obj/item/rig_module/emp_shielding/deactivate()
if(!..())
return
holder.emp_protection = max(0,(holder.emp_protection - protection_amount))
*/

View File

@@ -138,6 +138,7 @@
if(damage >= 2)
usr << "<span class='warning'>The [interface_name] is damaged beyond use!</span>"
return 0
if(world.time < next_use)
usr << "<span class='warning'>You cannot use the [interface_name] again so soon.</span>"
@@ -147,7 +148,7 @@
usr << "<span class='warning'>The suit is not initialized.</span>"
return 0
if(usr.lying || usr.stat || usr.stunned || usr.paralysis)
if(usr.lying || usr.stat || usr.stunned || usr.paralysis || usr.weakened)
usr << "<span class='warning'>You cannot use the suit in this state.</span>"
return 0
@@ -157,7 +158,7 @@
if(holder.security_check_enabled && !holder.check_suit_access(usr))
usr << "<span class='danger'>Access denied.</span>"
return
return 0
if(!holder.check_power_cost(usr, use_power_cost, 0, src, (istype(usr,/mob/living/silicon ? 1 : 0) ) ) )
return 0

View File

@@ -68,10 +68,12 @@
var/sealing // Keeps track of seal status independantly of canremove.
var/offline = 1 // Should we be applying suit maluses?
var/offline_slowdown = 10 // If the suit is deployed and unpowered, it sets slowdown to this.
var/offline_slowdown = 3 // If the suit is deployed and unpowered, it sets slowdown to this.
var/vision_restriction
var/offline_vision_restriction = 1 // 0 - none, 1 - welder vision, 2 - blind. Maybe move this to helmets.
var/emp_protection = 0
// Wiring! How exciting.
var/datum/wires/rig/wires
var/datum/effect/effect/system/spark_spread/spark_system
@@ -311,7 +313,7 @@
if(!istype(wearer) || loc != wearer || wearer.back != src || canremove || !cell || cell.charge <= 0)
if(!cell || cell.charge <= 0)
if(electrified >0)
if(electrified > 0)
electrified = 0
if(!offline)
if(istype(wearer))
@@ -319,7 +321,7 @@
if (offline_slowdown < 3)
wearer << "<span class='danger'>Your suit beeps stridently, and suddenly goes dead.</span>"
else
wearer << "<span class='danger'>Your suit beeps stridently, and suddenly you're wearing a leaden mass of metal and plastic instead of a powered suit.</span>"
wearer << "<span class='danger'>Your suit beeps stridently, and suddenly you're wearing a leaden mass of metal and plastic composites instead of a powered suit.</span>"
if(offline_vision_restriction == 1)
wearer << "<span class='danger'>The suit optics flicker and die, leaving you with restricted vision.</span>"
else if(offline_vision_restriction == 2)
@@ -406,7 +408,7 @@
data["boots"] = (boots ? "[boots.name]" : "None.")
data["chest"] = (chest ? "[chest.name]" : "None.")
data["charge"] = cell ? cell.charge : 0
data["charge"] = cell ? round(cell.charge,1) : 0
data["maxcharge"] = cell ? cell.maxcharge : 0
data["chargestatus"] = cell ? Floor((cell.charge/cell.maxcharge)*50) : 0
@@ -416,7 +418,7 @@
data["aicontrol"] = control_overridden
data["aioverride"] = ai_override_enabled
data["securitycheck"] = security_check_enabled
data["malf"] = malfunctioning
data["malf"] = malfunction_delay
var/list/module_list = list()
@@ -493,6 +495,8 @@
return 1
if(istype(user))
if(malfunction_check(user))
return 0
if(user.back != src)
return 0
if(locked_dna)
@@ -509,10 +513,10 @@
return 1
//TODO: Fix Topic vulnerabilities for malfunction and AI override.
/obj/item/weapon/rig/Topic(href,href_list)
if(!check_suit_access(usr))
return
return 0
if(href_list["toggle_piece"])
if(ishuman(usr) && (usr.stat || usr.stunned || usr.lying))
@@ -545,7 +549,7 @@
usr.set_machine(src)
src.add_fingerprint(usr)
return 1
return 0
/obj/item/weapon/rig/proc/notify_ai(var/message)
if(!message || !installed_modules || !installed_modules.len)
@@ -684,49 +688,82 @@
//Todo
/obj/item/weapon/rig/proc/malfunction()
return 0
return 0
/obj/item/weapon/rig/emp_act(severity_class)
//class 1 severity is the most severe, not least.
malfunctioning += round(30/severity_class)
if(malfunction_delay <= 0)
malfunction_delay = 20
take_hit(round(30/severity_class),"electrical pulse")
//set malfunctioning
if(emp_protection < 30) //for ninjas, really.
malfunctioning += 10
if(malfunction_delay <= 0)
malfunction_delay = max(malfunction_delay, round(30/severity_class))
//drain some charge
if(cell) cell.emp_act(severity_class + 15)
//possibly damage some modules
take_hit((100/severity_class), "electrical pulse", 1)
/obj/item/weapon/rig/proc/shock(mob/user)
if (electrocute_mob(user, cell, src))
spark_system.start()
return 1
return 0
/obj/item/weapon/rig/proc/take_hit(damage, source, is_emp=0)
/obj/item/weapon/rig/proc/take_hit(damage,source)
if(!installed_modules.len)
return
//given that module damage is spread out across all modules, even this is probably not enough for emp to affect rigs much.
if(source != "electrical pulse")
var/protection = chest? chest.breach_threshold : 0
if(!prob(max(0, damage - protection)))
return
var/chance
if(!is_emp)
chance = 2*max(0, damage - (chest? chest.breach_threshold : 0))
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)
if(!prob(chance))
return
//deal addition damage to already damaged module first.
//This way the chances of a module being disabled aren't so remote.
var/list/valid_modules = list()
var/list/damaged_modules = list()
for(var/obj/item/rig_module/module in installed_modules)
if(module.damage < 2)
valid_modules |= module
if(module.damage > 0)
damaged_modules |= module
if(!valid_modules.len)
return
var/obj/item/rig_module/dam_module = null
if(damaged_modules.len)
dam_module = pick(damaged_modules)
else if(valid_modules.len)
dam_module = pick(valid_modules)
if(!dam_module) return
var/obj/item/rig_module/dam_module = pick(valid_modules)
dam_module.damage++
if(!source)
source = "hit"
if(wearer)
wearer << "<span class='danger'>The [source] has [dam_module.damage >= 2 ? "destroyed" : "damaged"] your [dam_module.interface_name]!"
if(wearer)
if(dam_module.damage >= 2)
wearer << "<span class='danger'>The [source] has disabled your [dam_module.interface_name]!"
else
wearer << "<span class='warning'>The [source] has damaged your [dam_module.interface_name]!"
dam_module.deactivate()
/obj/item/weapon/rig/proc/malfunction_check(var/mob/living/carbon/human/user)
if(malfunction_delay)
if(offline)
user << "<span class='danger'>The suit is completely unresponsive.</span>"
else
user << "<span class='danger'>ERROR: Hardware fault. Rebooting interface...</span>"
return 1
return 0
/*/obj/item/weapon/rig/proc/forced_move(dir)
if(locked_down)
return 0

View File

@@ -39,9 +39,9 @@
flags_inv = HIDEJUMPSUIT|HIDETAIL
flags = STOPPRESSUREDAMAGE | THICKMATERIAL | AIRTIGHT
slowdown = 0
//With 0.2 resiliance, will reach 10 breach damage after 9 laser carbine blasts. Completely immune to smg hits.
//will reach 10 breach damage after 18 laser carbine blasts, or 7 revolver hits. Completely immune to smg hits.
breach_threshold = 28
resilience = 0.1
resilience = 0.05
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

@@ -141,6 +141,9 @@
set category = "Hardsuit"
set src = usr.contents
if(malfunction_check(usr))
return
if(!check_power_cost(usr, 0, 0, 0, 0))
return
@@ -168,6 +171,9 @@
set category = "Hardsuit"
set src = usr.contents
if(malfunction_check(usr))
return
if(canremove)
usr << "<span class='warning'>The suit is not active.</span>"
return
@@ -189,6 +195,9 @@
set category = "Hardsuit"
set src = usr.contents
if(malfunction_check(usr))
return
if(!check_power_cost(usr, 0, 0, 0, 0))
return
@@ -222,6 +231,9 @@
set category = "Hardsuit"
set src = usr.contents
if(malfunction_check(usr))
return
if(!check_power_cost(usr, 0, 0, 0, 0))
return
@@ -257,6 +269,9 @@
set category = "Hardsuit"
set src = usr.contents
if(malfunction_check(usr))
return
if(canremove)
usr << "<span class='warning'>The suit is not active.</span>"
return

View File

@@ -4,6 +4,7 @@
suit_type = "NT breacher"
icon_state = "breacher_rig_cheap"
armor = list(melee = 60, bullet = 60, laser = 60, energy = 60, bomb = 70, bio = 100, rad = 50)
emp_protection = -20
slowdown = 6
offline_slowdown = 10
vision_restriction = 1
@@ -16,4 +17,4 @@
icon_state = "breacher_rig"
armor = list(melee = 90, bullet = 90, laser = 90, energy = 90, bomb = 90, bio = 100, rad = 80)
vision_restriction = 0
slowdown = 4
slowdown = 4

View File

@@ -8,7 +8,6 @@
suit_type = "combat hardsuit"
armor = list(melee = 80, bullet = 65, laser = 50, energy = 15, bomb = 80, bio = 100, rad = 60)
slowdown = 1
offline_slowdown = 3
offline_vision_restriction = 1
helm_type = /obj/item/clothing/head/helmet/space/rig/combat

View File

@@ -7,13 +7,12 @@
desc = "A suit worn by the commander of a NanoTrasen Emergency Response Team. Has blue highlights. Armoured and space ready."
suit_type = "ERT commander"
icon_state = "ert_commander_rig"
offline_slowdown = 3
helm_type = /obj/item/clothing/head/helmet/space/rig/ert
req_access = list(access_cent_specops)
armor = list(melee = 60, bullet = 50, laser = 30,energy = 15, bomb = 30, bio = 100, rad = 100)
armor = list(melee = 60, bullet = 50, laser = 30,energy = 15, bomb = 30, bio = 100, rad = 60)
allowed = list(/obj/item/device/flashlight, /obj/item/weapon/tank, /obj/item/device/t_scanner, /obj/item/weapon/rcd, /obj/item/weapon/crowbar, \
/obj/item/weapon/screwdriver, /obj/item/weapon/weldingtool, /obj/item/weapon/wirecutters, /obj/item/weapon/wrench, /obj/item/device/multitool, \
/obj/item/device/radio, /obj/item/device/analyzer, /obj/item/weapon/gun/energy/laser, /obj/item/weapon/gun/energy/pulse_rifle, \
@@ -30,6 +29,9 @@
desc = "A suit worn by the engineering division of a NanoTrasen Emergency Response Team. Has orange highlights. Armoured and space ready."
suit_type = "ERT engineer"
icon_state = "ert_engineer_rig"
armor = list(melee = 60, bullet = 50, laser = 30,energy = 15, bomb = 30, bio = 100, rad = 100)
glove_type = /obj/item/clothing/gloves/rig/ert_engineer
initial_modules = list(
/obj/item/rig_module/ai_container,
@@ -38,6 +40,10 @@
/obj/item/rig_module/device/rcd
)
/obj/item/clothing/gloves/rig/ert_engineer
name = "insulated gauntlets"
siemens_coefficient = 0
/obj/item/weapon/rig/ert/medical
name = "ERT-M suit control module"
desc = "A suit worn by the medical division of a NanoTrasen Emergency Response Team. Has white highlights. Armoured and space ready."

View File

@@ -6,6 +6,7 @@
suit_type = "light suit"
allowed = list(/obj/item/weapon/gun,/obj/item/ammo_magazine,/obj/item/ammo_casing,/obj/item/weapon/melee/baton,/obj/item/weapon/handcuffs,/obj/item/weapon/tank,/obj/item/device/suit_cooling_unit,/obj/item/weapon/cell)
armor = list(melee = 50, bullet = 15, laser = 50, energy = 10, bomb = 25, bio = 0, rad = 0)
emp_protection = 10
slowdown = 0
flags = STOPPRESSUREDAMAGE | THICKMATERIAL
offline_slowdown = 0
@@ -18,6 +19,8 @@
/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"
@@ -54,8 +57,11 @@
desc = "A unique, vaccum-proof suit of nano-enhanced armor designed specifically for Spider Clan assassins."
icon_state = "ninja_rig"
armor = list(melee = 60, bullet = 50, laser = 30,energy = 15, bomb = 30, bio = 30, rad = 30)
emp_protection = 40 //change this to 30 if too high.
slowdown = 0
chest_type = /obj/item/clothing/suit/space/rig/light/ninja
req_access = list(access_syndicate)
initial_modules = list(
@@ -75,6 +81,10 @@
..()
/obj/item/clothing/suit/space/rig/light/ninja
breach_threshold = 28 //comparable to regular hardsuits
resilience = 0.05
/obj/item/weapon/rig/light/stealth
name = "stealth suit control module"
suit_type = "stealth"

View File

@@ -9,7 +9,6 @@
suit_type = "crimson hardsuit"
armor = list(melee = 80, bullet = 65, laser = 50, energy = 15, bomb = 80, bio = 100, rad = 60)
slowdown = 1
offline_slowdown = 3
offline_vision_restriction = 1
helm_type = /obj/item/clothing/head/helmet/space/rig/merc

View File

@@ -7,6 +7,7 @@
slowdown = 3
offline_slowdown = 10
offline_vision_restriction = 2
emp_protection = -20
allowed = list(/obj/item/device/flashlight,/obj/item/weapon/tank,/obj/item/device/suit_cooling_unit,/obj/item/weapon/storage/bag/ore,/obj/item/device/t_scanner,/obj/item/weapon/pickaxe, /obj/item/weapon/rcd)
@@ -56,7 +57,6 @@
icon_state = "science_rig"
armor = list(melee = 15, bullet = 15, laser = 80, energy = 80, bomb = 60, bio = 100, rad = 100)
slowdown = 1
offline_slowdown = 3
offline_vision_restriction = 1
helm_type = /obj/item/clothing/head/helmet/space/rig/ert
@@ -79,7 +79,6 @@
icon_state = "medical_rig"
armor = list(melee = 30, bullet = 15, laser = 20, energy = 60, bomb = 30, bio = 100, rad = 100)
slowdown = 1
offline_slowdown = 3
offline_vision_restriction = 1
allowed = list(/obj/item/device/flashlight,/obj/item/weapon/tank,/obj/item/device/suit_cooling_unit,/obj/item/weapon/storage/firstaid,/obj/item/device/healthanalyzer,/obj/item/stack/medical,/obj/item/roller )
@@ -100,7 +99,6 @@
icon_state = "hazard_rig"
armor = list(melee = 60, bullet = 10, laser = 30, energy = 5, bomb = 45, bio = 100, rad = 10)
slowdown = 1
offline_slowdown = 3
offline_vision_restriction = 1
helm_type = /obj/item/clothing/head/helmet/space/rig/ert

View File

@@ -59,7 +59,7 @@ obj/item/weapon/gun/energy/retro
/obj/item/weapon/gun/energy/lasercannon/mounted
self_recharge = 1
use_external_power = 1
recharge_time = 25
recharge_time = 10
/obj/item/weapon/gun/energy/xray
name = "xray laser gun"

View File

@@ -13,9 +13,7 @@
projectile_type = /obj/item/projectile/ion
/obj/item/weapon/gun/energy/ionrifle/emp_act(severity)
if(severity > 2)
return //so it doesn't EMP itself, I guess
..()
..(max(severity, 2)) //so it doesn't EMP itself, I guess
/obj/item/weapon/gun/energy/ionrifle/update_icon()
..()