IPC battery rework, ion rifle nerf, surge damage. (#10245)

- EMPs no longer deal permanent damage. Instead, they deal a temporary kind of damage called surge damage, that lasts for 10 seconds at maximum.
  - Surge damage makes mechanical or assisted limbs count as broken and nonfunctional.
  - Surge damage has special interactions with the mechanical heart and eyes.
  - EMP damage is no longer randomized. It is now much more consistent.
  - IPC battery is no longer represented as nutrition. Instead, the microbattery organ contains a super-capacity cell that is used for all their actions. This is represented with a new HUD icon.
  - Hardsuits can now be charged in robot chargers if you are wearing them.
  - Ion bolts now have a hit sound.
  - Removed the ion rifle lethal mode.
  - The ion rifle now has four shots.
This commit is contained in:
Matt Atlas
2020-12-19 01:34:40 +01:00
committed by GitHub
parent a61e0e7047
commit 8007ccd2ea
44 changed files with 396 additions and 284 deletions

View File

@@ -246,11 +246,6 @@
action_button_name = ""
verbs -= /obj/item/gun/verb/wield_gun
/obj/item/gun/emp_act(severity)
for(var/obj/O in contents)
O.emp_act(severity)
/obj/item/gun/afterattack(atom/A, mob/living/user, adjacent, params)
if(adjacent) return //A is adjacent, is the user, or is on the user's person

View File

@@ -43,10 +43,29 @@
if(.)
update_icon()
/obj/item/gun/energy/emp_act(severity)
/obj/item/gun/energy/emp_act(var/severity)
..()
disable_cell_temp(severity)
queue_icon_update()
/obj/item/gun/energy/proc/disable_cell_temp(var/severity)
set waitfor = FALSE
if(!power_supply)
return
var/mob/M
if(ismob(loc))
M = loc
to_chat(M, SPAN_DANGER("[src] locks up!"))
playsound(M, 'sound/weapons/smg_empty_alarm.ogg', 30)
var/initial_charge = power_supply.charge
power_supply.charge = 0
sleep(severity * 20)
power_supply.give(initial_charge)
update_maptext()
update_icon()
if(M && loc == M)
playsound(M, 'sound/weapons/laser_safetyoff.ogg', 30)
/obj/item/gun/energy/get_cell()
return power_supply

View File

@@ -1,6 +1,6 @@
/obj/item/gun/energy/rifle/ionrifle
name = "ion rifle"
desc = "The NT Mk70 EW Halicon is a man portable anti-armor weapon designed to disable mechanical threats, produced by NT. Has two settings: Stun and Lethal."
desc = "The NT Mk70 EW Halicon is a man portable anti-armor weapon designed to disable mechanical threats, produced by Nanotrasen."
icon = 'icons/obj/guns/ionrifle.dmi'
icon_state = "ionriflestun100"
item_state = "ionriflestun100" // so the human update icon uses the icon_state instead.
@@ -14,17 +14,10 @@
flags = CONDUCT
slot_flags = SLOT_BACK
charge_cost = 300
max_shots = 10
secondary_projectile_type = /obj/item/projectile/ion
secondary_fire_sound = 'sound/weapons/laser1.ogg'
max_shots = 4
can_turret = 1
can_switch_modes = 1
turret_sprite_set = "ion"
firemodes = list(
list(mode_name="stun", projectile_type=/obj/item/projectile/ion/stun, modifystate="ionriflestun", fire_sound='sound/weapons/laser1.ogg', charge_cost = 300),
list(mode_name="lethal", projectile_type=/obj/item/projectile/ion, modifystate="ionriflekill", fire_sound='sound/weapons/laser1.ogg', charge_cost = 450)
)
firemodes = list()
/obj/item/gun/energy/rifle/ionrifle/emp_act(severity)
..(max(severity, 2)) //so it doesn't EMP itself, I guess
@@ -39,12 +32,8 @@
else
ratio = max(round(ratio, 0.25) * 100, 25)
if(modifystate)
icon_state = "[modifystate][ratio]"
item_state = "[modifystate][ratio]"
else
icon_state = "[initial(icon_state)][ratio]"
item_state = "[initial(icon_state)][ratio]"
icon_state = "[modifystate][ratio]"
item_state = "[modifystate][ratio]"
update_held_icon()
/obj/item/gun/energy/rifle/ionrifle/mounted

View File

@@ -3,14 +3,12 @@
icon_state = "ion"
damage = 0
damage_type = BURN
nodamage = 1
impact_sounds = list(BULLET_IMPACT_MEAT = SOUNDS_ION_ANY, BULLET_IMPACT_METAL = SOUNDS_ION_ANY)
check_armor = "energy"
var/pulse_range = 1
/obj/item/projectile/ion/on_impact(var/atom/A)
empulse(A, pulse_range, pulse_range)
return 1
/obj/item/projectile/ion/stun/on_impact(var/atom/A)
if(isipc(A))
@@ -26,12 +24,10 @@
s.broken = 1
s.icon_state = "surge_ipc_broken"
to_chat(H, "<span class='warning'>Warning: EMP detected, integrated surge prevention module activated. The surge prevention module is fried, replacement recommended.</span>")
return 1
return
else
to_chat(src, "<span class='danger'>Warning: EMP detected, integrated surge prevention module is fried and unable to protect from EMP. Replacement recommended.</span>")
H.Weaken(5)
to_chat(H, "<span class='danger'>ERROR: detected low setting EMP, acutators experience temporary power loss. Attempting to restore power.</span>")
else if (isrobot(A))
if (isrobot(A))
var/mob/living/silicon/robot/R = A
var/datum/robot_component/surge/C = R.components["surge"]
if(C && C.installed)
@@ -50,8 +46,8 @@
R.emp_act(2) // Borgs emp_act is 1-2
else
A.emp_act(3) // Deals less EMP damage then lethal setting, and not areal pulse
return 1
A.emp_act(3)
return
/obj/item/projectile/ion/small
name = "ion pulse"