Makes borgs require to refill their metal, glass and reinforced glass manually instead of automatically from a cyborg recharger (#23944)

* Makes some borg sheet types require manual refilling

* Oopsie

* Fixes ORM deductions + Reverts changes for drones

* Contra review

* Fixes module logic

* Update code/modules/mining/machine_redemption.dm

Co-authored-by: Farie82 <farie82@users.noreply.github.com>

* Update code/modules/mining/machine_redemption.dm

Co-authored-by: Farie82 <farie82@users.noreply.github.com>

* Update code/game/objects/items/stacks/sheets/sheet_types.dm

* Farie review

* Update code/modules/mining/machine_redemption.dm

Co-authored-by: Farie82 <farie82@users.noreply.github.com>

* Update code/modules/mining/machine_redemption.dm

Co-authored-by: Farie82 <farie82@users.noreply.github.com>

* Farie review

* I am an idiot

* Fixes a comment

* Update code/modules/mining/machine_redemption.dm

Co-authored-by: Farie82 <farie82@users.noreply.github.com>

* Farie Review

---------

Co-authored-by: Farie82 <farie82@users.noreply.github.com>
This commit is contained in:
DGamerL
2024-03-14 18:46:30 +00:00
committed by GitHub
co-authored by Farie82
parent e4cd4f1a1f
commit c4412be390
11 changed files with 180 additions and 86 deletions
@@ -192,11 +192,11 @@
dynamic_icon_state = FALSE
/obj/item/stack/medical/bruise_pack/advanced/cyborg
energy_type = /datum/robot_energy_storage/medical/adv_brute_kit
energy_type = /datum/robot_storage/energy/medical/adv_brute_kit
is_cyborg = TRUE
/obj/item/stack/medical/bruise_pack/advanced/cyborg/syndicate
energy_type = /datum/robot_energy_storage/medical/adv_brute_kit/syndicate
energy_type = /datum/robot_storage/energy/medical/adv_brute_kit/syndicate
//Ointment//
@@ -260,11 +260,11 @@
dynamic_icon_state = FALSE
/obj/item/stack/medical/ointment/advanced/cyborg
energy_type = /datum/robot_energy_storage/medical/adv_burn_kit
energy_type = /datum/robot_storage/energy/medical/adv_burn_kit
is_cyborg = TRUE
/obj/item/stack/medical/ointment/advanced/cyborg/syndicate
energy_type = /datum/robot_energy_storage/medical/adv_burn_kit/syndicate
energy_type = /datum/robot_storage/energy/medical/adv_burn_kit/syndicate
//Medical Herbs//
/obj/item/stack/medical/bruise_pack/comfrey
@@ -345,11 +345,11 @@
use(1)
/obj/item/stack/medical/splint/cyborg
energy_type = /datum/robot_energy_storage/medical/splint
energy_type = /datum/robot_storage/energy/medical/splint
is_cyborg = TRUE
/obj/item/stack/medical/splint/cyborg/syndicate
energy_type = /datum/robot_energy_storage/medical/splint/syndicate
energy_type = /datum/robot_storage/energy/medical/splint/syndicate
/obj/item/stack/medical/splint/tribal
name = "tribal splints"
+2 -2
View File
@@ -67,7 +67,7 @@
H.bleed_rate = 0
/obj/item/stack/nanopaste/cyborg
energy_type = /datum/robot_energy_storage/medical/nanopaste
energy_type = /datum/robot_storage/energy/medical/nanopaste
is_cyborg = TRUE
/obj/item/stack/nanopaste/cyborg/attack(mob/living/M, mob/user)
@@ -77,4 +77,4 @@
return ..()
/obj/item/stack/nanopaste/cyborg/syndicate
energy_type = /datum/robot_energy_storage/medical/nanopaste/syndicate
energy_type = /datum/robot_storage/energy/medical/nanopaste/syndicate
+1 -1
View File
@@ -47,7 +47,7 @@ GLOBAL_LIST_INIT(rod_recipes, list (
/obj/item/stack/rods/cyborg
energy_type = /datum/robot_energy_storage/rods
energy_type = /datum/robot_storage/energy/rods
is_cyborg = TRUE
materials = list()
+13 -4
View File
@@ -49,14 +49,18 @@ GLOBAL_LIST_INIT(glass_recipes, list (
amount = 50
/obj/item/stack/sheet/glass/cyborg
energy_type = /datum/robot_energy_storage/glass
energy_type = /datum/robot_storage/material/glass
is_cyborg = TRUE
materials = list()
/obj/item/stack/sheet/glass/cyborg/examine(mob/user)
. = ..()
. += "<span class='notice'>As a synthetic, you can regain sheets of glass by recharging in a <b>cyborg recharger</b>.</span>"
var/mob/living/silicon/robot/robot = user
if(!istype(robot.module, /obj/item/robot_module/drone))
. += "<span class='notice'>You can refill your glass by using your <b>magnetic gripper</b> on the Ore Redemption machine, or by picking it up from the ground.</span>"
/obj/item/stack/sheet/glass/cyborg/drone
energy_type = /datum/robot_storage/energy/glass
/obj/item/stack/sheet/glass/New(loc, amount)
recipes = GLOB.glass_recipes
@@ -136,13 +140,18 @@ GLOBAL_LIST_INIT(pglass_recipes, list (
))
/obj/item/stack/sheet/rglass/cyborg
energy_type = /datum/robot_energy_storage/rglass
energy_type = /datum/robot_storage/material/rglass
is_cyborg = TRUE
materials = list()
/obj/item/stack/sheet/rglass/cyborg/examine(mob/user)
. = ..()
. += "<span class='notice'>As a synthetic, you can regain sheets of reinforced glass by recharging in a <b>cyborg recharger</b>.</span>"
var/mob/living/silicon/robot/robot = user
if(!istype(robot.module, /obj/item/robot_module/drone))
. += "<span class='notice'>You can refill your reinforced glass by picking it up from the ground.</span>"
/obj/item/stack/sheet/rglass/cyborg/drone
energy_type = /datum/robot_storage/energy/rglass
/obj/item/stack/sheet/plasmaglass
name = "plasma glass"
@@ -136,13 +136,18 @@ GLOBAL_LIST_INIT(metal_recipes, list(
. += "<span class='notice'>Metal is used in various different construction sequences.</span>"
/obj/item/stack/sheet/metal/cyborg
energy_type = /datum/robot_energy_storage/metal
energy_type = /datum/robot_storage/material/metal
is_cyborg = TRUE
materials = list()
/obj/item/stack/sheet/metal/cyborg/examine(mob/user)
. = ..()
. += "<span class='notice'>As a synthetic, you can regain sheets of reinforced glass by recharging in a <b>cyborg recharger</b>.</span>"
var/mob/living/silicon/robot/robot = user
if(!istype(robot.module, /obj/item/robot_module/drone))
. += "<span class='notice'>You can refill your metal by using your <b>magnetic gripper</b> on the Ore Redemption machine, or by picking it up from the ground.</span>"
/obj/item/stack/sheet/metal/cyborg/drone
energy_type = /datum/robot_storage/energy/metal
/obj/item/stack/sheet/metal/fifty
amount = 50
@@ -196,7 +201,7 @@ GLOBAL_LIST_INIT(plasteel_recipes, list(
return ..()
/obj/item/stack/sheet/wood/cyborg
energy_type = /datum/robot_energy_storage/wood
energy_type = /datum/robot_storage/energy/wood
is_cyborg = TRUE
/*
+6 -6
View File
@@ -12,8 +12,8 @@
origin_tech = "materials=1"
/// Whether this stack is a `/cyborg` subtype or not.
var/is_cyborg = FALSE
/// The energy storage datum that will be used with this stack. Used only with `/cyborg` type stacks.
var/datum/robot_energy_storage/source
/// The storage datum that will be used with this stack. Used only with `/cyborg` type stacks.
var/datum/robot_storage/source
/// Which `robot_energy_storage` to choose when this stack is created in cyborgs. Used only with `/cyborg` type stacks.
var/energy_type
/// How much energy using 1 sheet from the stack costs. Used only with `/cyborg` type stacks.
@@ -250,8 +250,8 @@
return amount
if(!source) // The energy source has not yet been initializied
return 0
return round(source.energy / cost)
return FALSE
return round(source.amount / cost)
/obj/item/stack/proc/get_max_amount()
return max_amount
@@ -321,7 +321,7 @@
// Also qdels the stack gracefully if it is.
/obj/item/stack/proc/zero_amount()
if(is_cyborg)
return source.energy < cost
return source.amount < cost
if(amount < 1)
if(ismob(loc))
var/mob/living/L = loc // At this stage, stack code is so horrible and atrocious, I wouldn't be all surprised ghosts can somehow have stacks. If this happens, then the world deserves to burn.
@@ -339,7 +339,7 @@
return FALSE
var/transfer = get_amount()
if(S.is_cyborg)
transfer = min(transfer, round((S.source.max_energy - S.source.energy) / S.cost))
transfer = min(transfer, round((S.source.max_amount - S.source.amount) / S.cost))
else
transfer = min(transfer, S.max_amount - S.amount)
if(transfer <= 0)
@@ -65,7 +65,7 @@
resistance_flags = FLAMMABLE
/obj/item/stack/tile/wood/cyborg
energy_type = /datum/robot_energy_storage/wood_tile
energy_type = /datum/robot_storage/energy/wood_tile
is_cyborg = TRUE
//Carpets
@@ -186,7 +186,7 @@
resistance_flags = FIRE_PROOF
/obj/item/stack/tile/plasteel/cyborg
energy_type = /datum/robot_energy_storage/metal_tile
energy_type = /datum/robot_storage/energy/metal_tile
is_cyborg = TRUE
//Light
@@ -290,5 +290,5 @@
resistance_flags = FIRE_PROOF
/obj/item/stack/tile/catwalk/cyborg
energy_type = /datum/robot_energy_storage/catwalk
energy_type = /datum/robot_storage/energy/catwalk
is_cyborg = TRUE