diff --git a/code/modules/clothing/spacesuits/rig/modules/combat.dm b/code/modules/clothing/spacesuits/rig/modules/combat.dm
index 605bff6be80..b106e412554 100644
--- a/code/modules/clothing/spacesuits/rig/modules/combat.dm
+++ b/code/modules/clothing/spacesuits/rig/modules/combat.dm
@@ -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
diff --git a/code/modules/clothing/spacesuits/rig/modules/computer.dm b/code/modules/clothing/spacesuits/rig/modules/computer.dm
index 3d66c646029..a6c549b6663 100644
--- a/code/modules/clothing/spacesuits/rig/modules/computer.dm
+++ b/code/modules/clothing/spacesuits/rig/modules/computer.dm
@@ -441,4 +441,32 @@
drain_loc = null
interfaced_with = null
- total_power_drained = 0
\ No newline at end of file
+ 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))
+*/
diff --git a/code/modules/clothing/spacesuits/rig/modules/modules.dm b/code/modules/clothing/spacesuits/rig/modules/modules.dm
index 830e0d784ce..17498a31b23 100644
--- a/code/modules/clothing/spacesuits/rig/modules/modules.dm
+++ b/code/modules/clothing/spacesuits/rig/modules/modules.dm
@@ -138,6 +138,7 @@
if(damage >= 2)
usr << "The [interface_name] is damaged beyond use!"
+ return 0
if(world.time < next_use)
usr << "You cannot use the [interface_name] again so soon."
@@ -147,7 +148,7 @@
usr << "The suit is not initialized."
return 0
- if(usr.lying || usr.stat || usr.stunned || usr.paralysis)
+ if(usr.lying || usr.stat || usr.stunned || usr.paralysis || usr.weakened)
usr << "You cannot use the suit in this state."
return 0
@@ -157,7 +158,7 @@
if(holder.security_check_enabled && !holder.check_suit_access(usr))
usr << "Access denied."
- return
+ return 0
if(!holder.check_power_cost(usr, use_power_cost, 0, src, (istype(usr,/mob/living/silicon ? 1 : 0) ) ) )
return 0
diff --git a/code/modules/clothing/spacesuits/rig/rig.dm b/code/modules/clothing/spacesuits/rig/rig.dm
index cc6776865a5..d003d64d599 100644
--- a/code/modules/clothing/spacesuits/rig/rig.dm
+++ b/code/modules/clothing/spacesuits/rig/rig.dm
@@ -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 << "Your suit beeps stridently, and suddenly goes dead."
else
- wearer << "Your suit beeps stridently, and suddenly you're wearing a leaden mass of metal and plastic instead of a powered suit."
+ wearer << "Your suit beeps stridently, and suddenly you're wearing a leaden mass of metal and plastic composites instead of a powered suit."
if(offline_vision_restriction == 1)
wearer << "The suit optics flicker and die, leaving you with restricted vision."
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 << "The [source] has [dam_module.damage >= 2 ? "destroyed" : "damaged"] your [dam_module.interface_name]!"
+ if(wearer)
+ if(dam_module.damage >= 2)
+ wearer << "The [source] has disabled your [dam_module.interface_name]!"
+ else
+ wearer << "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 << "The suit is completely unresponsive."
+ else
+ user << "ERROR: Hardware fault. Rebooting interface..."
+ return 1
+ return 0
+
/*/obj/item/weapon/rig/proc/forced_move(dir)
if(locked_down)
return 0
diff --git a/code/modules/clothing/spacesuits/rig/rig_pieces.dm b/code/modules/clothing/spacesuits/rig/rig_pieces.dm
index 2de6b34a84d..7f0291c0383 100644
--- a/code/modules/clothing/spacesuits/rig/rig_pieces.dm
+++ b/code/modules/clothing/spacesuits/rig/rig_pieces.dm
@@ -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()
diff --git a/code/modules/clothing/spacesuits/rig/rig_verbs.dm b/code/modules/clothing/spacesuits/rig/rig_verbs.dm
index ce20244734a..09db9b03252 100644
--- a/code/modules/clothing/spacesuits/rig/rig_verbs.dm
+++ b/code/modules/clothing/spacesuits/rig/rig_verbs.dm
@@ -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 << "The suit is not active."
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 << "The suit is not active."
return
diff --git a/code/modules/clothing/spacesuits/rig/suits/alien.dm b/code/modules/clothing/spacesuits/rig/suits/alien.dm
index 5b35d6a139f..cb64d2be448 100644
--- a/code/modules/clothing/spacesuits/rig/suits/alien.dm
+++ b/code/modules/clothing/spacesuits/rig/suits/alien.dm
@@ -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
\ No newline at end of file
+ slowdown = 4
diff --git a/code/modules/clothing/spacesuits/rig/suits/combat.dm b/code/modules/clothing/spacesuits/rig/suits/combat.dm
index 55716179c6a..9be2576838b 100644
--- a/code/modules/clothing/spacesuits/rig/suits/combat.dm
+++ b/code/modules/clothing/spacesuits/rig/suits/combat.dm
@@ -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
diff --git a/code/modules/clothing/spacesuits/rig/suits/ert.dm b/code/modules/clothing/spacesuits/rig/suits/ert.dm
index d3db4baf84e..feec1f58103 100644
--- a/code/modules/clothing/spacesuits/rig/suits/ert.dm
+++ b/code/modules/clothing/spacesuits/rig/suits/ert.dm
@@ -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."
diff --git a/code/modules/clothing/spacesuits/rig/suits/light.dm b/code/modules/clothing/spacesuits/rig/suits/light.dm
index 0a18f3c640d..55442c0a02b 100644
--- a/code/modules/clothing/spacesuits/rig/suits/light.dm
+++ b/code/modules/clothing/spacesuits/rig/suits/light.dm
@@ -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"
diff --git a/code/modules/clothing/spacesuits/rig/suits/merc.dm b/code/modules/clothing/spacesuits/rig/suits/merc.dm
index 22add920141..8e7b70d5f2b 100644
--- a/code/modules/clothing/spacesuits/rig/suits/merc.dm
+++ b/code/modules/clothing/spacesuits/rig/suits/merc.dm
@@ -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
diff --git a/code/modules/clothing/spacesuits/rig/suits/station.dm b/code/modules/clothing/spacesuits/rig/suits/station.dm
index 44959068eb4..74fd7a16fe6 100644
--- a/code/modules/clothing/spacesuits/rig/suits/station.dm
+++ b/code/modules/clothing/spacesuits/rig/suits/station.dm
@@ -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
diff --git a/code/modules/projectiles/guns/energy/laser.dm b/code/modules/projectiles/guns/energy/laser.dm
index eb6e73ec2eb..2bc36508d81 100644
--- a/code/modules/projectiles/guns/energy/laser.dm
+++ b/code/modules/projectiles/guns/energy/laser.dm
@@ -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"
diff --git a/code/modules/projectiles/guns/energy/special.dm b/code/modules/projectiles/guns/energy/special.dm
index 76bcebac3c2..31480de9c8b 100644
--- a/code/modules/projectiles/guns/energy/special.dm
+++ b/code/modules/projectiles/guns/energy/special.dm
@@ -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()
..()