Files
silicons 16c07e9e61 Projectiles reorganization and cleanup, impact effects, subtle EMP tweaks (#6741)
No gameplay changes except for EMP rebalancing.

Emps are now deterministic
Ion rifles now always hit for strength 2 instead of a probability tree
of strengths
EMP damage slightly lessened as this makes a lot of things guaranteed to
hit with strength 2 instead of 3
2024-09-13 10:09:49 -06:00

64 lines
2.2 KiB
Plaintext

/obj/item/modular_computer/examine(mob/user, dist)
. = ..()
if(damage > broken_damage)
. += SPAN_DANGER("It is heavily damaged!")
else if(damage)
. += "It is damaged."
/obj/item/modular_computer/proc/legacy_break_apart()
visible_message("\The [src] breaks apart!")
var/turf/newloc = get_turf(src)
new /obj/item/stack/material/steel(newloc, round(steel_sheet_cost/2))
for(var/obj/item/computer_hardware/H in get_all_components())
uninstall_component(null, H)
H.forceMove(newloc)
if(prob(25))
H.take_damage_legacy(rand(10,30))
qdel()
/obj/item/modular_computer/proc/take_damage_legacy(amount, component_probability, damage_casing = TRUE, randomize = TRUE)
if(randomize)
// 75%-125%, rand() works with integers, apparently.
amount *= (rand(75, 125) / 100.0)
amount = round(amount)
if(damage_casing)
damage += amount
damage = clamp( damage, 0, max_damage)
if(component_probability)
for(var/obj/item/computer_hardware/H in get_all_components())
if(prob(component_probability))
H.take_damage_legacy(round(amount / 2))
if(damage >= max_damage)
legacy_break_apart()
/**
* Stronger explosions cause serious damage to internal components
* Minor explosions are mostly mitigitated by casing.
*/
/obj/item/modular_computer/legacy_ex_act(severity)
. = ..()
take_damage_legacy(rand(100,200) / severity, 30 / severity)
/// EMPs are similar to explosions, but don't cause physical damage to the casing. Instead they screw up the components
/obj/item/modular_computer/emp_act(severity)
. = ..()
spawn(-1)
take_damage_legacy(rand(100,200) / severity, 50 / severity, 0)
/**
* "Stun" weapons can cause minor damage to components (short-circuits?)
* "Burn" damage is equally strong against internal components and exterior casing
* "Brute" damage mostly damages the casing.
*/
/obj/item/modular_computer/on_bullet_act(obj/projectile/proj, impact_flags, list/bullet_act_args)
. = ..()
switch(proj.damage_type)
if(DAMAGE_TYPE_BRUTE)
take_damage_legacy(proj.damage_force, proj.damage_force / 2)
if(DAMAGE_TYPE_HALLOSS)
take_damage_legacy(proj.damage_force, proj.damage_force / 3, 0)
if(DAMAGE_TYPE_BURN)
take_damage_legacy(proj.damage_force, proj.damage_force / 1.5)