mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-26 05:27:01 +01:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user