mirror of
https://github.com/Citadel-Station-13/Citadel-Station-13-RP.git
synced 2026-08-23 16:37:00 +01:00
[MDB IGNORE] [IDB IGNORE] atom damage (#5235)
## About The Pull Request adds generic system for atom health / integrity / damage everything that isn't flagged with not-bludgeonable can, well, now be bludgeoned. ## Why It's Good For The Game more interactive game world through the means of making people able to break Everything. ## Changelog 🆑 add: atom damage - (almost) everything is now breakable. refactor: new /atom level materials system refactor: a lot of the combat system / click code refactor: melee attack styles /🆑 --------- Co-authored-by: silicons <no@you.cat>
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
else if(damage)
|
||||
. += "It is damaged."
|
||||
|
||||
/obj/item/modular_computer/proc/break_apart()
|
||||
/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))
|
||||
@@ -13,10 +13,10 @@
|
||||
uninstall_component(null, H)
|
||||
H.forceMove(newloc)
|
||||
if(prob(25))
|
||||
H.take_damage(rand(10,30))
|
||||
H.take_damage_legacy(rand(10,30))
|
||||
qdel()
|
||||
|
||||
/obj/item/modular_computer/take_damage(amount, component_probability, damage_casing = TRUE, randomize = TRUE)
|
||||
/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)
|
||||
@@ -28,21 +28,23 @@
|
||||
if(component_probability)
|
||||
for(var/obj/item/computer_hardware/H in get_all_components())
|
||||
if(prob(component_probability))
|
||||
H.take_damage(round(amount / 2))
|
||||
H.take_damage_legacy(round(amount / 2))
|
||||
|
||||
if(damage >= max_damage)
|
||||
break_apart()
|
||||
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(rand(100,200) / severity, 30 / 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)
|
||||
take_damage(rand(100,200) / severity, 50 / severity, 0)
|
||||
. = ..()
|
||||
take_damage_legacy(rand(100,200) / severity, 50 / severity, 0)
|
||||
|
||||
/**
|
||||
* "Stun" weapons can cause minor damage to components (short-circuits?)
|
||||
@@ -50,10 +52,11 @@
|
||||
* "Brute" damage mostly damages the casing.
|
||||
*/
|
||||
/obj/item/modular_computer/bullet_act(obj/projectile/Proj)
|
||||
. = ..()
|
||||
switch(Proj.damage_type)
|
||||
if(BRUTE)
|
||||
take_damage(Proj.damage, Proj.damage / 2)
|
||||
take_damage_legacy(Proj.damage, Proj.damage / 2)
|
||||
if(HALLOSS)
|
||||
take_damage(Proj.damage, Proj.damage / 3, 0)
|
||||
take_damage_legacy(Proj.damage, Proj.damage / 3, 0)
|
||||
if(BURN)
|
||||
take_damage(Proj.damage, Proj.damage / 1.5)
|
||||
take_damage_legacy(Proj.damage, Proj.damage / 1.5)
|
||||
|
||||
Reference in New Issue
Block a user