mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-22 12:29:46 +01:00
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:
@@ -121,6 +121,7 @@
|
||||
if(istype(owner) && (toxin_type in owner.chem_effects))
|
||||
take_damage(owner.chem_effects[toxin_type] * 0.1 * PROCESS_ACCURACY, prob(1))
|
||||
handle_regeneration()
|
||||
tick_surge_damage() //Yes, this is intentional.
|
||||
|
||||
/obj/item/organ/internal/proc/handle_regeneration()
|
||||
if(!damage || BP_IS_ROBOTIC(src) || !owner || owner.chem_effects[CE_TOXIN] || owner.is_asystole())
|
||||
|
||||
@@ -54,6 +54,12 @@
|
||||
if(is_broken())
|
||||
owner.eye_blind = 20
|
||||
|
||||
/obj/item/organ/internal/eyes/do_surge_effects()
|
||||
owner.overlay_fullscreen("noise", /obj/screen/fullscreen/flash/noise)
|
||||
|
||||
/obj/item/organ/internal/eyes/clear_surge_effects()
|
||||
owner.clear_fullscreen("noise")
|
||||
|
||||
/obj/item/organ/internal/eyes/robotize()
|
||||
..()
|
||||
verbs |= /obj/item/organ/internal/eyes/proc/change_eye_color
|
||||
|
||||
@@ -194,6 +194,12 @@
|
||||
|
||||
return pulse > PULSE_NONE || BP_IS_ROBOTIC(src) || (owner.status_flags & FAKEDEATH)
|
||||
|
||||
/obj/item/organ/internal/heart/do_surge_effects()
|
||||
var/obj/item/organ/external/E = owner.organs_by_name[parent_organ]
|
||||
if(prob(surge_damage))
|
||||
owner.custom_pain(SPAN_DANGER("Your [E.name] stings horribly!"), 15, FALSE, E)
|
||||
sound_to(owner, sound('sound/effects/singlebeat.ogg', 0, 0, 0, 100))
|
||||
|
||||
/obj/item/organ/internal/heart/listen()
|
||||
if(BP_IS_ROBOTIC(src) && is_working())
|
||||
if(is_bruised())
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
/obj/item/organ/internal/lungs/process()
|
||||
..()
|
||||
|
||||
if(!owner)
|
||||
if(!owner || owner.stat == DEAD)
|
||||
return
|
||||
|
||||
if(germ_level > INFECTION_LEVEL_ONE)
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
//Organ damage stats.
|
||||
var/damage = 0 // amount of damage to the organ
|
||||
var/surge_damage = 0 // EMP damage counter.
|
||||
var/surge_time = 0
|
||||
var/min_broken_damage = 30
|
||||
var/min_bruised_damage = 10 // Damage before considered bruised
|
||||
var/max_damage = 30
|
||||
@@ -113,6 +115,7 @@
|
||||
blood_DNA[dna.unique_enzymes] = dna.b_type
|
||||
if(internal)
|
||||
holder.internal_organs |= src
|
||||
START_PROCESSING(SSprocessing, src)
|
||||
|
||||
/obj/item/organ/proc/set_dna(var/datum/dna/new_dna)
|
||||
if(new_dna)
|
||||
@@ -142,7 +145,6 @@
|
||||
return max_damage > 0
|
||||
|
||||
/obj/item/organ/process()
|
||||
|
||||
if(loc != owner)
|
||||
owner = null
|
||||
|
||||
@@ -164,6 +166,9 @@
|
||||
germ_level = 0
|
||||
return
|
||||
|
||||
if((status & ORGAN_ASSISTED) && surge_damage)
|
||||
tick_surge_damage()
|
||||
|
||||
if(!owner)
|
||||
if (QDELETED(reagents))
|
||||
log_debug("Organ [DEBUG_REF(src)] had QDELETED reagents! Regenerating.")
|
||||
@@ -194,6 +199,22 @@
|
||||
if(damage >= max_damage)
|
||||
die()
|
||||
|
||||
/obj/item/organ/proc/tick_surge_damage()
|
||||
if(surge_damage)
|
||||
do_surge_effects()
|
||||
if(surge_time + 1 SECOND < world.time)
|
||||
surge_damage = max(0, surge_damage - 10)
|
||||
surge_time = world.time
|
||||
if(!surge_damage)
|
||||
surge_time = 0
|
||||
clear_surge_effects()
|
||||
|
||||
/obj/item/organ/proc/do_surge_effects()
|
||||
return
|
||||
|
||||
/obj/item/organ/proc/clear_surge_effects()
|
||||
return
|
||||
|
||||
/obj/item/organ/examine(mob/user)
|
||||
..(user)
|
||||
if(status & ORGAN_DEAD)
|
||||
@@ -307,7 +328,7 @@
|
||||
owner.custom_pain("Something inside your [parent.name] hurts a lot.", 1)
|
||||
|
||||
/obj/item/organ/proc/robotize() //Being used to make robutt hearts, etc
|
||||
robotic = 2
|
||||
robotic = ROBOTIC_MECHANICAL
|
||||
status = ORGAN_ROBOT
|
||||
status |= ORGAN_ASSISTED
|
||||
if(robotic_name)
|
||||
@@ -323,7 +344,7 @@
|
||||
name = initial(name)
|
||||
icon_state = initial(icon_state)
|
||||
|
||||
/obj/item/organ/emp_act(severity)
|
||||
/obj/item/organ/emp_act(var/severity)
|
||||
if(!(status & ORGAN_ASSISTED))
|
||||
return
|
||||
|
||||
@@ -334,14 +355,23 @@
|
||||
|
||||
switch (severity)
|
||||
if (1.0)
|
||||
take_damage(rand(7,20) * emp_coeff * organ_fragility)
|
||||
take_surge_damage(15 * emp_coeff * organ_fragility)
|
||||
if (2.0)
|
||||
take_damage(rand(3,7) * emp_coeff * organ_fragility)
|
||||
take_surge_damage(8 * emp_coeff * organ_fragility)
|
||||
if(3.0)
|
||||
take_damage(rand(3) * emp_coeff * organ_fragility)
|
||||
take_surge_damage(4 * emp_coeff * organ_fragility)
|
||||
|
||||
return TRUE
|
||||
|
||||
#define MAXIMUM_SURGE_DAMAGE 100
|
||||
/obj/item/organ/proc/take_surge_damage(var/surge)
|
||||
if(!(status & ORGAN_ASSISTED))
|
||||
return //We check earlier, but just to make sure.
|
||||
|
||||
surge_damage = Clamp(0, surge + surge_damage, MAXIMUM_SURGE_DAMAGE) //We want X seconds at most of hampered movement or what have you.
|
||||
surge_time = world.time
|
||||
|
||||
/obj/item/organ/proc/removed(var/mob/living/carbon/human/target,var/mob/living/user)
|
||||
|
||||
if(!istype(owner))
|
||||
return
|
||||
|
||||
|
||||
@@ -329,12 +329,8 @@
|
||||
|
||||
var/damage_amt = brute
|
||||
var/cur_damage = brute_dam
|
||||
var/laser = (damage_flags & DAM_LASER)
|
||||
var/sharp = (damage_flags & DAM_SHARP)
|
||||
|
||||
if(laser)
|
||||
return FALSE
|
||||
|
||||
if(BP_IS_ROBOTIC(src))
|
||||
damage_amt += burn
|
||||
cur_damage += burn_dam
|
||||
@@ -536,26 +532,22 @@ This function completely restores a damaged organ to perfect condition.
|
||||
//Determines if we even need to process this organ.
|
||||
/obj/item/organ/external/proc/need_process()
|
||||
if(status & (ORGAN_CUT_AWAY|ORGAN_BLEEDING|ORGAN_BROKEN|ORGAN_DESTROYED|ORGAN_SPLINTED|ORGAN_DEAD|ORGAN_MUTATED))
|
||||
return 1
|
||||
return TRUE
|
||||
if(surge_damage)
|
||||
return TRUE
|
||||
if(brute_dam || burn_dam)
|
||||
return 1
|
||||
return TRUE
|
||||
if(last_dam != brute_dam + burn_dam) // Process when we are fully healed up.
|
||||
last_dam = brute_dam + burn_dam
|
||||
return 1
|
||||
return TRUE
|
||||
else
|
||||
last_dam = brute_dam + burn_dam
|
||||
if(germ_level)
|
||||
return 1
|
||||
return 0
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/item/organ/external/process()
|
||||
if(owner)
|
||||
//Dismemberment
|
||||
//if(parent && parent.is_stump()) //should never happen
|
||||
// warning("\The [src] ([src.type]) belonging to [owner] ([owner.type]) was attached to a stump")
|
||||
// remove()
|
||||
// return
|
||||
|
||||
// Process wounds, doing healing etc. Only do this every few ticks to save processing power
|
||||
if(owner.life_tick % wound_update_accuracy == 0)
|
||||
update_wounds()
|
||||
@@ -570,6 +562,9 @@ This function completely restores a damaged organ to perfect condition.
|
||||
if(!(status & ORGAN_BROKEN))
|
||||
perma_injury = 0
|
||||
|
||||
if(surge_damage && (status & ORGAN_ASSISTED))
|
||||
tick_surge_damage() //Yes, this being here is intentional since this proc does not call ..() unless the owner is null.
|
||||
|
||||
//Infections
|
||||
update_germs()
|
||||
|
||||
@@ -578,6 +573,10 @@ This function completely restores a damaged organ to perfect condition.
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/organ/external/do_surge_effects()
|
||||
if(prob(surge_damage))
|
||||
owner.custom_pain("The artificial nerves in your [name] scream out in pain!", surge_damage/6)
|
||||
|
||||
/obj/item/organ/external/proc/check_rigsplints()
|
||||
if((status & ORGAN_BROKEN) && !(status & ORGAN_SPLINTED))
|
||||
if(istype(owner,/mob/living/carbon/human))
|
||||
@@ -590,7 +589,7 @@ This function completely restores a damaged organ to perfect condition.
|
||||
var/obj/item/clothing/suit/space/suit = H.wear_suit
|
||||
if(isnull(suit.supporting_limbs))
|
||||
return
|
||||
to_chat(owner, "You feel \the [suit] constrict about your [name], supporting it.")
|
||||
to_chat(owner, SPAN_WARNING("You feel \the [suit] constrict about your [name], supporting it."))
|
||||
status |= ORGAN_SPLINTED
|
||||
suit.supporting_limbs |= src
|
||||
owner.update_hud_hands()
|
||||
@@ -932,7 +931,7 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
****************************************************/
|
||||
|
||||
/obj/item/organ/external/proc/is_stump()
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
/obj/item/organ/external/proc/release_restraints(var/mob/living/carbon/human/holder)
|
||||
if(!holder)
|
||||
@@ -1118,7 +1117,7 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
return ..()
|
||||
|
||||
/obj/item/organ/external/proc/is_malfunctioning()
|
||||
if(BP_IS_ROBOTIC(src) && (brute_ratio + burn_ratio) >= 0.3 && prob(brute_dam + burn_dam))
|
||||
if(BP_IS_ROBOTIC(src) && (brute_ratio + burn_ratio) >= 0.3 && prob(brute_dam + burn_dam) || (surge_damage > (MAXIMUM_SURGE_DAMAGE * 0.25)))
|
||||
return TRUE
|
||||
if(robotize_type)
|
||||
var/datum/robolimb/R = all_robolimbs[robotize_type]
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
icon_state = "augment"
|
||||
parent_organ = BP_CHEST
|
||||
organ_tag = "augment"
|
||||
robotic = 2
|
||||
robotic = ROBOTIC_MECHANICAL
|
||||
emp_coeff = 2
|
||||
is_augment = TRUE
|
||||
species_restricted = list(SPECIES_HUMAN,SPECIES_HUMAN_OFFWORLD,
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
icon_state = "anchor"
|
||||
organ_tag = "anchor"
|
||||
parent_organ = BP_HEAD
|
||||
robotic = 2
|
||||
robotic = ROBOTIC_MECHANICAL
|
||||
var/suffered_revelation = FALSE
|
||||
|
||||
/obj/item/organ/internal/anchor/Initialize()
|
||||
|
||||
@@ -62,26 +62,92 @@
|
||||
desc = "A small, powerful cell for use in fully prosthetic bodies."
|
||||
icon = 'icons/obj/power.dmi'
|
||||
icon_state = "scell"
|
||||
organ_tag = "cell"
|
||||
organ_tag = BP_CELL
|
||||
parent_organ = BP_CHEST
|
||||
vital = 1
|
||||
var/emp_counter = 0
|
||||
vital = TRUE
|
||||
max_damage = 80
|
||||
relative_size = 80
|
||||
var/open = FALSE
|
||||
var/obj/item/cell/cell = /obj/item/cell/super
|
||||
//at 0.8 completely depleted after 60ish minutes of constant walking or 130 minutes of standing still
|
||||
var/servo_cost = 0.8
|
||||
|
||||
/obj/item/organ/internal/cell/Initialize()
|
||||
robotize()
|
||||
cell = new cell(src)
|
||||
. = ..()
|
||||
|
||||
/obj/item/organ/internal/cell/proc/percent()
|
||||
if(!cell)
|
||||
return 0
|
||||
return get_charge()/cell.maxcharge * 100
|
||||
|
||||
/obj/item/organ/internal/cell/proc/get_charge()
|
||||
if(!cell)
|
||||
return 0
|
||||
if(status & ORGAN_DEAD)
|
||||
return 0
|
||||
return round(cell.charge*(1 - damage/max_damage))
|
||||
|
||||
/obj/item/organ/internal/cell/proc/checked_use(var/amount)
|
||||
if(!is_usable() || !cell)
|
||||
return FALSE
|
||||
return cell.checked_use(amount)
|
||||
|
||||
/obj/item/organ/internal/cell/proc/use(var/amount)
|
||||
if(!is_usable() || !cell)
|
||||
return
|
||||
return cell.use(amount)
|
||||
|
||||
/obj/item/organ/internal/cell/process()
|
||||
..()
|
||||
if(emp_counter)
|
||||
emp_counter--
|
||||
if(!owner)
|
||||
return
|
||||
if(owner.stat == DEAD) //not a drain anymore
|
||||
return
|
||||
var/cost = get_power_drain()
|
||||
if(world.time - owner.l_move_time < 15)
|
||||
cost *= 2
|
||||
if(!checked_use(cost) && owner.isSynthetic())
|
||||
if(!owner.lying && !owner.buckled)
|
||||
to_chat(owner, "<span class='warning'>You don't have enough energy to function!</span>")
|
||||
owner.Paralyse(3)
|
||||
|
||||
/obj/item/organ/internal/cell/proc/get_power_drain()
|
||||
return servo_cost
|
||||
|
||||
/obj/item/organ/internal/cell/emp_act(severity)
|
||||
emp_counter += 30/severity
|
||||
if(emp_counter >= 30)
|
||||
owner.Paralyse(emp_counter/6)
|
||||
to_chat(owner, "<span class='danger'>%#/ERR: Power leak detected!$%^/</span>")
|
||||
..()
|
||||
if(cell)
|
||||
cell.emp_act(severity)
|
||||
|
||||
/obj/item/organ/internal/cell/attackby(obj/item/W, mob/user)
|
||||
if(isscrewdriver(W))
|
||||
if(open)
|
||||
open = FALSE
|
||||
to_chat(user, SPAN_NOTICE("You screw the battery panel in place."))
|
||||
else
|
||||
open = TRUE
|
||||
to_chat(user, SPAN_NOTICE("You unscrew the battery panel."))
|
||||
|
||||
if(iscrowbar(W))
|
||||
if(open)
|
||||
if(cell)
|
||||
user.put_in_hands(cell)
|
||||
to_chat(user, SPAN_NOTICE("You remove \the [cell] from \the [src]."))
|
||||
cell = null
|
||||
|
||||
if (istype(W, /obj/item/cell))
|
||||
if(open)
|
||||
if(cell)
|
||||
to_chat(user, SPAN_WARNING("There is a power cell already installed."))
|
||||
else if(user.unEquip(W, src))
|
||||
cell = W
|
||||
to_chat(user, SPAN_NOTICE("You insert \the [cell]."))
|
||||
|
||||
/obj/item/organ/internal/cell/listen()
|
||||
if(get_charge())
|
||||
return "faint hum of the power bank"
|
||||
|
||||
/obj/item/organ/internal/surge
|
||||
name = "surge preventor"
|
||||
@@ -125,7 +191,7 @@
|
||||
/obj/item/organ/internal/eyes/optical_sensor
|
||||
name = "optical sensor"
|
||||
singular_name = "optical sensor"
|
||||
organ_tag = "optics"
|
||||
organ_tag = BP_EYES
|
||||
icon = 'icons/obj/robot_component.dmi'
|
||||
icon_state = "camera"
|
||||
dead_icon = "camera_broken"
|
||||
@@ -136,7 +202,7 @@
|
||||
|
||||
/obj/item/organ/internal/ipc_tag
|
||||
name = "identification tag"
|
||||
organ_tag = "ipc tag"
|
||||
organ_tag = BP_IPCTAG
|
||||
parent_organ = BP_HEAD
|
||||
icon = 'icons/obj/ipc_utilities.dmi'
|
||||
icon_state = "ipc_tag"
|
||||
@@ -211,7 +277,7 @@
|
||||
name = "brain"
|
||||
organ_tag = BP_BRAIN
|
||||
parent_organ = BP_HEAD
|
||||
vital = 1
|
||||
vital = TRUE
|
||||
var/obj/item/device/mmi/stored_mmi
|
||||
|
||||
/obj/item/organ/internal/mmi_holder/proc/update_from_mmi()
|
||||
@@ -299,7 +365,7 @@
|
||||
icon_state = "scell"
|
||||
organ_tag = "shielded cell"
|
||||
parent_organ = BP_CHEST
|
||||
vital = 1
|
||||
vital = TRUE
|
||||
emp_coeff = 0.1
|
||||
|
||||
/obj/item/organ/internal/cell/Initialize()
|
||||
|
||||
@@ -15,14 +15,14 @@
|
||||
/obj/item/organ/internal/kidneys/vaurca/robo
|
||||
icon_state = "kidney_vaurca"
|
||||
organ_tag = BP_VAURCA_KIDNEYS
|
||||
robotic = 2
|
||||
robotic = ROBOTIC_MECHANICAL
|
||||
robotic_name = null
|
||||
robotic_sprite = null
|
||||
|
||||
/obj/item/organ/internal/liver/vaurca/robo
|
||||
icon_state = "liver_vaurca"
|
||||
organ_tag = BP_VAURCA_LIVER
|
||||
robotic = 2
|
||||
robotic = ROBOTIC_MECHANICAL
|
||||
robotic_name = null
|
||||
robotic_sprite = null
|
||||
|
||||
@@ -37,21 +37,21 @@
|
||||
organ_tag = BP_PHORON_RESERVOIR
|
||||
parent_organ = BP_CHEST
|
||||
icon_state = "phoron_reservoir"
|
||||
robotic = 1
|
||||
robotic = ROBOTIC_ASSISTED
|
||||
|
||||
/obj/item/organ/vaurca/filtrationbit
|
||||
name = BP_FILTRATION_BIT
|
||||
organ_tag = BP_FILTRATION_BIT
|
||||
parent_organ = BP_HEAD
|
||||
icon_state = "filter"
|
||||
robotic = 2
|
||||
robotic = ROBOTIC_MECHANICAL
|
||||
|
||||
/obj/item/organ/vaurca/neuralsocket
|
||||
name = BP_NEURAL_SOCKET
|
||||
organ_tag = BP_NEURAL_SOCKET
|
||||
icon_state = "neural_socket"
|
||||
parent_organ = BP_HEAD
|
||||
robotic = 2
|
||||
robotic = ROBOTIC_MECHANICAL
|
||||
|
||||
obj/item/organ/vaurca/neuralsocket/process()
|
||||
if (is_broken())
|
||||
@@ -81,7 +81,7 @@ obj/item/organ/vaurca/neuralsocket/process()
|
||||
organ_tag = BP_PHORON_RESERVE
|
||||
parent_organ = BP_CHEST
|
||||
icon_state = "breathing_app"
|
||||
robotic = 1
|
||||
robotic = ROBOTIC_ASSISTED
|
||||
var/datum/gas_mixture/air_contents = null
|
||||
var/distribute_pressure = ((2*ONE_ATMOSPHERE)*O2STANDARD)
|
||||
var/volume = 50
|
||||
|
||||
Reference in New Issue
Block a user