Skip to content

Commit

Permalink
Merge pull request #10 from Vect0r2/material-borg
Browse files Browse the repository at this point in the history
Material borg upgrade
  • Loading branch information
Constellado authored Oct 6, 2024
2 parents 5d62deb + c1c9e57 commit b778d82
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 25 deletions.
34 changes: 34 additions & 0 deletions code/game/objects/items/robot/robot_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -894,6 +894,40 @@
RegisterSignal(stored, COMSIG_ATOM_UPDATE_ICON, TYPE_PROC_REF(/atom, update_icon))
update_appearance()

///Apparatus to allow Engineering/Sabo borgs to manipulate any material sheets.
/obj/item/borg/apparatus/sheet_manipulator
name = "material manipulation apparatus"
desc = "An apparatus for carrying, deploying, and manipulating sheets of material. The device can also carry custom floor tiles."
icon_state = "borg_stack_apparatus"
storable = list(/obj/item/stack/sheet,
/obj/item/stack/tile)

/obj/item/borg/apparatus/sheet_manipulator/Initialize(mapload)
update_appearance()
return ..()

/obj/item/borg/apparatus/sheet_manipulator/update_overlays()
. = ..()
var/mutable_appearance/arm = mutable_appearance(icon, "borg_stack_apparatus_arm1")
if(stored)
stored.pixel_x = 0
stored.pixel_y = 0
arm.icon_state = "borg_stack_apparatus_arm2"
var/mutable_appearance/stored_copy = new /mutable_appearance(stored)
var/underscore = findtext(stored_copy.icon_state, "_")
if(underscore)
stored_copy.icon_state = initial(stored.icon_state) //how we use the icon_state of single sheets, even with full stacks
stored_copy.layer = FLOAT_LAYER
stored_copy.plane = FLOAT_PLANE
. += stored_copy
. += arm

/obj/item/borg/apparatus/sheet_manipulator/examine()
. = ..()
if(stored)
. += "The apparatus currently has [stored] secured."
. += span_notice(" <i>Right click/i> has an option to drop the stored sheets. ")

////////////////////
//engi part holder//
////////////////////
Expand Down
19 changes: 1 addition & 18 deletions code/game/objects/items/stacks/sheets/glass.dm
Original file line number Diff line number Diff line change
Expand Up @@ -165,24 +165,7 @@ GLOBAL_LIST_INIT(reinforced_glass_recipes, list ( \
add_fingerprint(user)
..()

/obj/item/stack/sheet/rglass/cyborg
custom_materials = null
var/datum/robot_energy_storage/glasource
var/metcost = 250
var/glacost = 500

/obj/item/stack/sheet/rglass/cyborg/get_amount()
return min(round(source.energy / metcost), round(glasource.energy / glacost))

/obj/item/stack/sheet/rglass/cyborg/use(used, transfer = FALSE, check = TRUE) // Requires special checks, because it uses two storages
if(get_amount(used)) //ensure we still have enough energy if called in a do_after chain
source.use_charge(used * metcost)
glasource.use_charge(used * glacost)
return TRUE

/obj/item/stack/sheet/rglass/cyborg/add(amount)
source.add_charge(amount * metcost)
glasource.add_charge(amount * glacost)


/obj/item/stack/sheet/rglass/get_main_recipes()
. = ..()
Expand Down
2 changes: 2 additions & 0 deletions code/modules/mob/living/silicon/robot/inventory.dm
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@
/mob/living/silicon/robot/proc/activated(obj/item/O)
if(O in held_items)
return TRUE
if(O.loc in held_items) //Apparatus check
return TRUE
return FALSE

//Helper procs for cyborg modules on the UI.
Expand Down
9 changes: 2 additions & 7 deletions code/modules/mob/living/silicon/robot/robot_modules.dm
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,6 @@
S.cost = 500
S.source = get_or_create_estorage(/datum/robot_energy_storage/glass)

else if(istype(S, /obj/item/stack/sheet/rglass/cyborg))
var/obj/item/stack/sheet/rglass/cyborg/G = S
G.source = get_or_create_estorage(/datum/robot_energy_storage/metal)
G.glasource = get_or_create_estorage(/datum/robot_energy_storage/glass)

else if(istype(S, /obj/item/stack/medical))
S.cost = 250
S.source = get_or_create_estorage(/datum/robot_energy_storage/medical)
Expand Down Expand Up @@ -446,7 +441,7 @@
/obj/item/electroadaptive_pseudocircuit,
/obj/item/stack/sheet/metal/cyborg,
/obj/item/stack/sheet/glass/cyborg,
/obj/item/stack/sheet/rglass/cyborg,
/obj/item/borg/apparatus/sheet_manipulator,
/obj/item/stack/rods/cyborg,
/obj/item/stack/tile/plasteel/cyborg,
/obj/item/stack/cable_coil/cyborg)
Expand Down Expand Up @@ -1073,7 +1068,7 @@
/obj/item/multitool/cyborg,
/obj/item/stack/sheet/metal/cyborg,
/obj/item/stack/sheet/glass/cyborg,
/obj/item/stack/sheet/rglass/cyborg,
/obj/item/borg/apparatus/sheet_manipulator,
/obj/item/stack/rods/cyborg,
/obj/item/stack/tile/plasteel/cyborg,
/obj/item/destTagger/borg,
Expand Down
4 changes: 4 additions & 0 deletions html/changelogs/AutoChangeLog-pr-74297.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
author: "zxaber"
delete-after: True
changes:
- balance: "Engineer Borgs now have a tool to manipulate material stacks (and also tile stacks). This replaces the R-Glass tool."
Binary file modified icons/mob/robot_items.dmi
Binary file not shown.

0 comments on commit b778d82

Please sign in to comment.