Files
Bubberstation/code/modules/research/part_replacer.dm
Aliceee2ch 0918437d53 BORGENING! Borg changes and QOLs (#92303)
## About The Pull Request

Adds a few new items and upgrades for different cyborg modules or
reworks some of them.

<p align="center">
<img width="608" height="199" alt="image"
src="https://github.com/user-attachments/assets/ba44742f-984b-4988-af4d-e06cf66d3296"
/>
</p>
pic unrelated :)

### Main changes:

### Medical model
**Medical cyborg** gets chembag by default and a new bluespace syringe
upgrade!
<p align="center">
<img width="267" height="83" alt="image"
src="https://github.com/user-attachments/assets/4636688f-a3bf-4db8-b0c7-75089aeb4f54"
/>
</p>

### Engineering model
**Engineering cyborg** recieved a few new features. Now you can put your
regular RPED inside of a cyborg, but mind that it has way less storage,
than RPED upgrade from robotics. Robotics RPED upgrade were renamed into
expanded RPED and now cost the same amount of material to produce it as
BS RPED.
<p align="center">
<img width="198" height="117" alt="image"
src="https://github.com/user-attachments/assets/e614a9b0-41ad-4815-8eb6-f627c2bf77cc"
/>
</p>

Worth to mention adding decal painter with own sprite (yes it uses cell
instead of regular toner)
<p align="center">
<img width="827" height="498" alt="image"
src="https://github.com/user-attachments/assets/2eb36651-0ee2-4c9b-81ef-f8c3a96966a8"
/>
</p>

<p align="left">
Circuit manipulator was renamed to engineering apparatus, as its can no
longer hold only circuits. Additionally, it can also hold tubes/bulbs
now.
</p>

### Mining model
**Mining cyborg** now has mesons removed and remade into a new toggle
button, you dont need to use one of your modules just to be able to see
through darkness of lavaland caves.
<p align="center">
<img width="248" height="173" alt="image"
src="https://github.com/user-attachments/assets/e85a00ec-f373-43d0-9ce9-7ec573029af3"
/>
</p>

**Mining cyborg** got a new shield module. It helps you fighting
lavaland fauna (..or annoying humans, if youre evil) in low pressure by
absorbing 50% of incoming damage when activated. Takes some amount of
your charge per absorbed hit.
Example:
![2025-07-30
15-05-38](https://github.com/user-attachments/assets/0337a3b2-b9ef-4e27-a464-e3bc0a6a77d8)

## Why It's Good For The Game

I feel big lack of some cyborg modules or even features. This PR is
supposed to fix missing gap, aswell as rebalance some of existing
models.

## Changelog


🆑
qol: Added new helpful modules, such as decal painter for engineering
and chembag for medical borg.
add: Added miner cyborg shield module. In lavaland (low) pressure, it
protects you from 50% of incoming damage in exchange of your cell
charge.
add: Added BS syringe upgrade for medical cyborg.

/🆑
2025-09-16 04:12:27 -07:00

177 lines
7.6 KiB
Plaintext

///RPED. Allows installing & exchaging parts on machines
/obj/item/storage/part_replacer
name = "rapid part exchange device"
desc = "Special mechanical module made to store, sort, and apply standard machine parts."
icon_state = "RPED"
inhand_icon_state = "RPED"
worn_icon_state = "RPED"
lefthand_file = 'icons/mob/inhands/items/devices_lefthand.dmi'
righthand_file = 'icons/mob/inhands/items/devices_righthand.dmi'
w_class = WEIGHT_CLASS_HUGE
storage_type = /datum/storage/rped
/obj/item/storage/part_replacer/interact_with_atom(obj/attacked_object, mob/living/user, list/modifiers)
if(user.combat_mode)
return ITEM_INTERACT_SKIP_TO_ATTACK
//its very important to NOT block so frames can still interact with it
if(!ismachinery(attacked_object) || istype(attacked_object, /obj/machinery/computer))
return NONE
var/obj/machinery/attacked_machinery = attacked_object
if(!LAZYLEN(attacked_machinery.component_parts))
return ITEM_INTERACT_FAILURE
return attacked_machinery.exchange_parts(user, src) ? ITEM_INTERACT_SUCCESS : ITEM_INTERACT_FAILURE
///Plays the sound & flick animation for RPED exhanging or installing parts.
/obj/item/storage/part_replacer/proc/play_rped_effect()
playsound(src, 'sound/items/tools/rped.ogg', 40, TRUE)
flick("[icon_state]_active", src)
/**
* Gets parts sorted in order of their tier
* Arguments
*
* * ignore_stacks - should the final list contain stacks
*/
/obj/item/storage/part_replacer/proc/get_sorted_parts(ignore_stacks = FALSE)
RETURN_TYPE(/list/obj/item)
var/list/obj/item/part_list = list()
//Assemble a list of current parts, then sort them by their rating!
for(var/obj/item/component_part in contents)
//No need to put circuit boards in this list or stacks when exchanging parts
if(istype(component_part, /obj/item/circuitboard) || (ignore_stacks && istype(component_part, /obj/item/stack)))
continue
part_list += component_part
//Sort the parts. This ensures that higher tier items are applied first.
sortTim(part_list, GLOBAL_PROC_REF(cmp_rped_sort))
return part_list
///Bluespace RPED. Allows exchanging parts from a distance & through cameras
/obj/item/storage/part_replacer/bluespace
name = "bluespace rapid part exchange device"
desc = "A version of the RPED that allows for replacement of parts and scanning from a distance, along with higher capacity for parts."
icon_state = "BS_RPED"
inhand_icon_state = "BS_RPED"
w_class = WEIGHT_CLASS_NORMAL
storage_type = /datum/storage/rped/bluespace
/obj/item/storage/part_replacer/bluespace/Initialize(mapload)
. = ..()
RegisterSignal(src, COMSIG_ATOM_ENTERED, PROC_REF(on_part_entered))
RegisterSignal(src, COMSIG_ATOM_EXITED, PROC_REF(on_part_exited))
/obj/item/storage/part_replacer/bluespace/interact_with_atom(obj/attacked_object, mob/living/user, list/modifiers)
. = ..()
if(. & ITEM_INTERACT_ANY_BLOCKER)
user.Beam(attacked_object, icon_state = "rped_upgrade", time = 0.5 SECONDS)
/obj/item/storage/part_replacer/bluespace/ranged_interact_with_atom(atom/interacting_with, mob/living/user, list/modifiers)
return interact_with_atom(interacting_with, user, modifiers)
/obj/item/storage/part_replacer/bluespace/play_rped_effect()
if(prob(1))
playsound(src, 'sound/items/pshoom/pshoom_2.ogg', 40, TRUE)
else
playsound(src, 'sound/items/pshoom/pshoom.ogg', 40, TRUE)
flick("[icon_state]_active", src)
/**
* Signal handler for when a part has been inserted into the BRPED.
* If the inserted item is a rigged or corrupted cell, does some logging.
* We clear existing reagents & stop new ones from being added to prevent remote spam bombing
*/
/obj/item/storage/part_replacer/bluespace/proc/on_part_entered(datum/source, obj/item/inserted_component)
SIGNAL_HANDLER
if(istype(inserted_component, /obj/item/stock_parts/power_store))
var/obj/item/stock_parts/power_store/inserted_cell = inserted_component
if(inserted_cell.rigged || inserted_cell.corrupted)
message_admins("[ADMIN_LOOKUPFLW(usr)] has inserted rigged/corrupted [inserted_cell] into [src].")
usr.log_message("has inserted rigged/corrupted [inserted_cell] into [src].", LOG_GAME)
usr.log_message("inserted rigged/corrupted [inserted_cell] into [src]", LOG_ATTACK)
return
var/datum/reagents/target_holder = inserted_component.reagents
if(target_holder)
if(target_holder.total_volume)
target_holder.force_stop_reacting()
target_holder.clear_reagents()
to_chat(usr, span_notice("[src] churns as [inserted_component] has its reagents emptied into bluespace."))
target_holder.flags = target_holder.flags << 5 //masks all flags upto DUNKABLE(1<<5) i.e. removes all methods of transfering reagents to/from the object
/**
* Signal handler for a part is removed from the BRPED.
* Restores original reagents of the component part, if it has any.
*/
/obj/item/storage/part_replacer/bluespace/proc/on_part_exited(datum/source, obj/item/removed_component)
SIGNAL_HANDLER
var/datum/reagents/target_holder = removed_component.reagents
if(target_holder)
target_holder.flags = target_holder.flags >> 5 //restores all flags upto DUNKABLE(1<<5)
//RPED with tiered contents
/obj/item/storage/part_replacer/bluespace/tier1/PopulateContents()
for(var/i in 1 to 10)
new /obj/item/stock_parts/capacitor(src)
new /obj/item/stock_parts/scanning_module(src)
new /obj/item/stock_parts/servo(src)
new /obj/item/stock_parts/micro_laser(src)
new /obj/item/stock_parts/matter_bin(src)
new /obj/item/stock_parts/power_store/cell/high(src)
/obj/item/storage/part_replacer/bluespace/tier2/PopulateContents()
for(var/i in 1 to 10)
new /obj/item/stock_parts/capacitor/adv(src)
new /obj/item/stock_parts/scanning_module/adv(src)
new /obj/item/stock_parts/servo/nano(src)
new /obj/item/stock_parts/micro_laser/high(src)
new /obj/item/stock_parts/matter_bin/adv(src)
new /obj/item/stock_parts/power_store/cell/super(src)
/obj/item/storage/part_replacer/bluespace/tier3/PopulateContents()
for(var/i in 1 to 10)
new /obj/item/stock_parts/capacitor/super(src)
new /obj/item/stock_parts/scanning_module/phasic(src)
new /obj/item/stock_parts/servo/pico(src)
new /obj/item/stock_parts/micro_laser/ultra(src)
new /obj/item/stock_parts/matter_bin/super(src)
new /obj/item/stock_parts/power_store/cell/hyper(src)
/obj/item/storage/part_replacer/bluespace/tier4/PopulateContents()
for(var/i in 1 to 10)
new /obj/item/stock_parts/capacitor/quadratic(src)
new /obj/item/stock_parts/scanning_module/triphasic(src)
new /obj/item/stock_parts/servo/femto(src)
new /obj/item/stock_parts/micro_laser/quadultra(src)
new /obj/item/stock_parts/matter_bin/bluespace(src)
new /obj/item/stock_parts/power_store/cell/bluespace(src)
//used in a cargo crate
/obj/item/storage/part_replacer/cargo/PopulateContents()
for(var/i in 1 to 10)
new /obj/item/stock_parts/capacitor(src)
new /obj/item/stock_parts/scanning_module(src)
new /obj/item/stock_parts/servo(src)
new /obj/item/stock_parts/micro_laser(src)
new /obj/item/stock_parts/matter_bin(src)
///Cyborg variant
/obj/item/storage/part_replacer/cyborg
name = "rapid part exchange device"
desc = "Special mechanical module made to store, sort, and apply standard machine parts. This one has an extra large compartment for more parts."
icon_state = "borgrped"
inhand_icon_state = "RPED"
lefthand_file = 'icons/mob/inhands/items/devices_lefthand.dmi'
righthand_file = 'icons/mob/inhands/items/devices_righthand.dmi'
storage_type = /datum/storage/rped/bluespace
/obj/item/storage/part_replacer/cyborg/small
desc = "Special mechanical module made to store, sort, and apply standard machine parts. This one has as much space, as your regular RPED"
icon_state = "RPED"
storage_type = /datum/storage/rped