mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-11 07:58:57 +01:00
8111a8489b
Many, many, many items have inhand sprites in their .dmis but for whatever reasons do not display them in-game. This PR: 1. Updates many item definitions to point to their already-existing inhands correctly. This consists largely of held tools, but also gas tanks and jetpacks mounted in the suit storage slot. 2. Adds a few codersprites made by me for objects with either missing inhands or poorly matching mishands (IE, the tape recorder, which has a black case, reused the white inhand sprites of the health analyzer). The new sprites are modified or recolored variations of other inhand sprites from our repo, except for circuitboards which are new. <img width="444" height="400" alt="image" src="https://github.com/user-attachments/assets/7f107b9a-fe24-4e31-8f16-4d34768ee117" /> 3. Adds inhand sprites for Inflatables and Inflatable Boxes made by Tomixcomics. <img width="424" height="101" alt="image" src="https://github.com/user-attachments/assets/434107c4-8577-49a2-a58e-d6b014c03933" /> 4. Ports inhand sprites for the Hydraulic Rescue Tool from tg's Jaws of Life. <img width="224" height="94" alt="Screenshot 2026-02-07 172931" src="https://github.com/user-attachments/assets/070c7956-f6a8-4fb5-870f-10c64afcc8b3" /> 5. Some additional cleanup while in the area. The 'analyzer' has been renamed the 'gas analyzer' to be consistent with the other analyzer objects, standardized icon_state naming conventions where I saw oddballs, updated code docs to use DMDocs when in the area, etc. ### Asset Licenses The following assets that **have not** been created by myself are included in this PR: | Path | Original Author | License | | --- | --- | --- | | icons/obj/item/hydraulic_rescue_tool.dmi | [SomeAngryMiner (bee station)](https://github.com/BeeStation/BeeStation-Hornet/pull/2487), [maxymax (/tg/station)](https://github.com/tgstation/tgstation/pull/58616) | CC-BY-SA | | icons/obj/item/inflatables.dmi | [Tomixcomics](https://github.com/tomixcomics) | CC-BY-SA |
122 lines
4.1 KiB
Plaintext
122 lines
4.1 KiB
Plaintext
/obj/item/computer_hardware
|
|
name = "Hardware"
|
|
desc = "Unknown Hardware."
|
|
icon = 'icons/obj/modular_computers/modular_components.dmi'
|
|
var/obj/item/modular_computer/parent_computer
|
|
/// If the hardware uses extra power, change this.
|
|
var/power_usage = 0
|
|
/// If the hardware is turned off set this to 0.
|
|
var/enabled = TRUE
|
|
/// Prevent disabling for important component, like the HDD.
|
|
var/critical = TRUE
|
|
/// Limits which devices can contain this component. 1: Tablets/Laptops/Consoles, 2: Laptops/Consoles, 3: Consoles only
|
|
var/hardware_size = 1
|
|
/// Current damage level
|
|
var/damage = 0
|
|
/// Maximal damage level.
|
|
var/max_damage = 100
|
|
/// "Malfunction" threshold. When damage exceeds this value the hardware piece will semi-randomly fail and do !!FUN!! things
|
|
var/damage_malfunction = 20
|
|
/// "Failure" threshold. When damage exceeds this value the hardware piece will not work at all.
|
|
var/damage_failure = 50
|
|
/// Chance of malfunction when the component is damaged
|
|
var/malfunction_probability = 10
|
|
|
|
/**
|
|
* Default handling of hardware enable/disable. Override for specific functionality.
|
|
*/
|
|
/obj/item/computer_hardware/proc/enable()
|
|
. = enabled = TRUE
|
|
|
|
/**
|
|
* Default handling of hardware enable/disable. Override for specific functionality.
|
|
*/
|
|
/obj/item/computer_hardware/proc/disable()
|
|
. = enabled = FALSE
|
|
|
|
/**
|
|
* Default handling of hardware enable/disable. Override for specific functionality.
|
|
*/
|
|
/obj/item/computer_hardware/proc/toggle()
|
|
if(enabled)
|
|
return disable()
|
|
return enable()
|
|
|
|
/obj/item/computer_hardware/attackby(obj/item/attacking_item, mob/user)
|
|
/// Multitool. Runs diagnostics
|
|
if(attacking_item.tool_behaviour == TOOL_MULTITOOL)
|
|
to_chat(user, SPAN_NOTICE("***** DIAGNOSTICS REPORT *****"))
|
|
diagnostics(user)
|
|
to_chat(user, SPAN_NOTICE("******************************"))
|
|
return 1
|
|
/// Nanopaste. Repair all damage if present for a single unit.
|
|
var/obj/item/stack/S = attacking_item
|
|
if(istype(S, /obj/item/stack/nanopaste))
|
|
if(!damage)
|
|
to_chat(user, SPAN_WARNING("\The [src] doesn't seem to require repairs."))
|
|
return TRUE
|
|
if(S.use(1))
|
|
to_chat(user, SPAN_NOTICE("You apply a bit of \the [attacking_item] to \the [src], repairing it fully."))
|
|
damage = 0
|
|
return TRUE
|
|
/// Cable coil. Works as repair method, but will probably require multiple applications and more cable.
|
|
if(S.tool_behaviour == TOOL_CABLECOIL)
|
|
if(!damage)
|
|
to_chat(user, SPAN_WARNING("\The [src] doesn't seem to require repairs."))
|
|
return TRUE
|
|
if(S.use(1))
|
|
to_chat(user, SPAN_NOTICE("You patch up \the [src] with a bit of \the [attacking_item]."))
|
|
take_damage(-10)
|
|
return TRUE
|
|
return ..()
|
|
|
|
/**
|
|
* Called on multitool click, prints diagnostic information to the user.
|
|
*/
|
|
/obj/item/computer_hardware/proc/diagnostics(var/mob/user)
|
|
to_chat(user, SPAN_NOTICE("Hardware Integrity Test... (Physical Damage: [damage]/[max_damage]) [damage > damage_failure ? "FAIL" : damage > damage_malfunction ? "WARN" : "PASS"]"))
|
|
|
|
/obj/item/computer_hardware/Initialize()
|
|
. = ..()
|
|
w_class = hardware_size
|
|
if(istype(loc, /obj/item/modular_computer))
|
|
parent_computer = loc
|
|
return .
|
|
|
|
/obj/item/computer_hardware/Destroy()
|
|
parent_computer = null
|
|
return ..()
|
|
|
|
/**
|
|
* Handles damage checks
|
|
*/
|
|
/obj/item/computer_hardware/proc/check_functionality()
|
|
/// Turned off
|
|
if(!enabled)
|
|
return FALSE
|
|
/// Too damaged to work at all.
|
|
if(damage > damage_failure)
|
|
return FALSE
|
|
/// Still working. Well, sometimes...
|
|
if(damage > damage_malfunction)
|
|
if(prob(malfunction_probability))
|
|
return FALSE
|
|
/// Good to go.
|
|
return TRUE
|
|
|
|
/obj/item/computer_hardware/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
|
|
. = ..()
|
|
if(damage > damage_failure)
|
|
. += SPAN_DANGER("It seems to be severely damaged!")
|
|
else if(damage > damage_malfunction)
|
|
. += SPAN_WARNING("It seems to be damaged!")
|
|
else if(damage)
|
|
. += SPAN_WARNING("It seems to be slightly damaged.")
|
|
|
|
/**
|
|
* Damages the component. Contains necessary checks. Negative damage "heals" the component.
|
|
*/
|
|
/obj/item/computer_hardware/proc/take_damage(var/amount)
|
|
damage += round(amount) /// We want nice rounded numbers here.
|
|
damage = between(0, damage, max_damage) /// Clamp the value.
|