mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-09 00:13:55 +00:00
* Removes HDD's entirely HDDs have been removed, though the code for it is still currently lingering as it's required for portable disks. I'll have to find a solution to this one day, but as I am going to sleep, this is a problem for future me. * starts on removing SSD * updatepaths and kills off SSD * update path :D * Fixes to programs and icons * Ready for review now I read over everything I did and tried to fix anything I saw wasn't done right. Hopefully better comments now. * merge conflict fix * can't win them all * takes viruses into account in paths, fixes it in snowcabin * Renames the updatepaths * removes the qdel loop * accidentally new'ed programs twice * Fix program's computer var * destroy pen and disk, dont run kill program on something killed * more fixes for pens and idle threads * Fixes PDAs installing apps twice. * simplifies inserted disk & PDA disk * fuck's sake * Use istype instead * revert * Revert "revert" This reverts commit 9ede628c6fef9c7c86417234f6d8ada1ff9e2fef. * why did that happen * Update code/modules/modular_computers/computers/item/tablet.dm * MC_SSD added to master lol Co-authored-by: ShizCalev <ShizCalev@users.noreply.github.com>
33 lines
1.1 KiB
Plaintext
33 lines
1.1 KiB
Plaintext
/obj/item/modular_computer/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1)
|
|
. = ..()
|
|
var/component_probability = min(50, max(damage_amount*0.1, 1 - atom_integrity/max_integrity))
|
|
switch(damage_flag)
|
|
if(BULLET)
|
|
component_probability = damage_amount * 0.5
|
|
if(LASER)
|
|
component_probability = damage_amount * 0.66
|
|
if(component_probability)
|
|
for(var/I in all_components)
|
|
var/obj/item/computer_hardware/H = all_components[I]
|
|
if(prob(component_probability))
|
|
H.take_damage(round(damage_amount*0.5), damage_type, damage_flag, 0)
|
|
|
|
/obj/item/modular_computer/deconstruct(disassembled = TRUE)
|
|
break_apart()
|
|
return ..()
|
|
|
|
/obj/item/modular_computer/proc/break_apart()
|
|
if(!(flags_1 & NODECONSTRUCT_1))
|
|
physical.visible_message(span_notice("\The [src] breaks apart!"))
|
|
var/turf/newloc = get_turf(src)
|
|
new /obj/item/stack/sheet/iron(newloc, round(steel_sheet_cost/2))
|
|
for(var/C in all_components)
|
|
var/obj/item/computer_hardware/H = all_components[C]
|
|
if(QDELETED(H))
|
|
continue
|
|
uninstall_component(H)
|
|
H.forceMove(newloc)
|
|
if(prob(25))
|
|
H.take_damage(rand(10,30), BRUTE, 0, 0)
|
|
relay_qdel()
|