This commit is contained in:
SandPoot
2024-01-06 17:36:02 -03:00
parent cb2251ea37
commit 76e7ffc80d
10 changed files with 53 additions and 54 deletions
@@ -217,6 +217,7 @@
/obj/item/stack/medical/gauze/cyborg /obj/item/stack/medical/gauze/cyborg
custom_materials = null custom_materials = null
is_cyborg = TRUE is_cyborg = TRUE
source = /datum/robot_energy_storage/medical
cost = 250 cost = 250
/obj/item/stack/medical/suture /obj/item/stack/medical/suture
@@ -441,6 +442,7 @@
/obj/item/stack/medical/bone_gel/cyborg /obj/item/stack/medical/bone_gel/cyborg
custom_materials = null custom_materials = null
is_cyborg = TRUE is_cyborg = TRUE
source = /datum/robot_energy_storage/medical
cost = 250 cost = 250
/obj/item/stack/medical/aloe /obj/item/stack/medical/aloe
+3 -6
View File
@@ -39,7 +39,7 @@ GLOBAL_LIST_INIT(rod_recipes, list ( \
/obj/item/stack/rods/update_icon_state() /obj/item/stack/rods/update_icon_state()
var/amount = get_amount() var/amount = get_amount()
if(amount <= 5) if(amount <= 5 && amount >= 1)
icon_state = "rods-[amount]" icon_state = "rods-[amount]"
else else
icon_state = "rods" icon_state = "rods"
@@ -77,11 +77,8 @@ GLOBAL_LIST_INIT(rod_recipes, list ( \
/obj/item/stack/rods/cyborg /obj/item/stack/rods/cyborg
custom_materials = null custom_materials = null
is_cyborg = TRUE is_cyborg = TRUE
cost = 250 source = /datum/robot_energy_storage/medical
cost = MINERAL_MATERIAL_AMOUNT * 0.125
/obj/item/stack/rods/cyborg/ComponentInitialize()
. = ..()
AddElement(/datum/element/update_icon_blocker)
/obj/item/stack/rods/ten /obj/item/stack/rods/ten
amount = 10 amount = 10
+13 -4
View File
@@ -52,7 +52,8 @@ GLOBAL_LIST_INIT(glass_recipes, list ( \
/obj/item/stack/sheet/glass/cyborg /obj/item/stack/sheet/glass/cyborg
custom_materials = null custom_materials = null
is_cyborg = TRUE is_cyborg = TRUE
cost = 500 source = /datum/robot_energy_storage/glass
cost = MINERAL_MATERIAL_AMOUNT * 0.25
/obj/item/stack/sheet/glass/fifty /obj/item/stack/sheet/glass/fifty
amount = 50 amount = 50
@@ -179,9 +180,15 @@ GLOBAL_LIST_INIT(reinforced_glass_recipes, list ( \
/obj/item/stack/sheet/rglass/cyborg /obj/item/stack/sheet/rglass/cyborg
custom_materials = null custom_materials = null
is_cyborg = TRUE is_cyborg = TRUE
var/datum/robot_energy_storage/glasource source = /datum/robot_energy_storage/metal
var/metcost = 250 var/datum/robot_energy_storage/glasource = /datum/robot_energy_storage/glass
var/glacost = 500 var/metcost = MINERAL_MATERIAL_AMOUNT * 0.125
var/glacost = MINERAL_MATERIAL_AMOUNT * 0.25
/obj/item/stack/sheet/rglass/cyborg/prepare_estorage(obj/item/robot_module/module)
. = ..()
if(glasource)
glasource = module.get_or_create_estorage(glasource)
/obj/item/stack/sheet/rglass/cyborg/get_amount() /obj/item/stack/sheet/rglass/cyborg/get_amount()
return min(round(source.energy / metcost), round(glasource.energy / glacost)) return min(round(source.energy / metcost), round(glasource.energy / glacost))
@@ -189,10 +196,12 @@ GLOBAL_LIST_INIT(reinforced_glass_recipes, list ( \
/obj/item/stack/sheet/rglass/cyborg/use(used, transfer = FALSE) // Requires special checks, because it uses two storages /obj/item/stack/sheet/rglass/cyborg/use(used, transfer = FALSE) // Requires special checks, because it uses two storages
source.use_charge(used * metcost) source.use_charge(used * metcost)
glasource.use_charge(used * glacost) glasource.use_charge(used * glacost)
update_icon()
/obj/item/stack/sheet/rglass/cyborg/add(amount) /obj/item/stack/sheet/rglass/cyborg/add(amount)
source.add_charge(amount * metcost) source.add_charge(amount * metcost)
glasource.add_charge(amount * glacost) glasource.add_charge(amount * glacost)
update_icon()
/obj/item/stack/sheet/rglass/get_main_recipes() /obj/item/stack/sheet/rglass/get_main_recipes()
. = ..() . = ..()
@@ -164,7 +164,8 @@ GLOBAL_LIST_INIT(metal_recipes, list ( \
/obj/item/stack/sheet/metal/cyborg /obj/item/stack/sheet/metal/cyborg
custom_materials = null custom_materials = null
is_cyborg = TRUE is_cyborg = TRUE
cost = 500 source = /datum/robot_energy_storage/metal
cost = MINERAL_MATERIAL_AMOUNT * 0.25
/obj/item/stack/sheet/metal/get_main_recipes() /obj/item/stack/sheet/metal/get_main_recipes()
. = ..() . = ..()
+10 -1
View File
@@ -42,6 +42,9 @@
var/matter_amount = 0 var/matter_amount = 0
/obj/item/stack/Initialize(mapload, new_amount, merge = TRUE) /obj/item/stack/Initialize(mapload, new_amount, merge = TRUE)
if(is_cyborg && istype(loc, /obj/item/robot_module))
prepare_estorage(loc)
if(new_amount != null) if(new_amount != null)
amount = new_amount amount = new_amount
while(amount > max_amount) while(amount > max_amount)
@@ -383,7 +386,9 @@
if(check && zero_amount()) if(check && zero_amount())
return FALSE return FALSE
if (is_cyborg) if (is_cyborg)
return source.use_charge(used * cost) . = source.use_charge(used * cost)
update_icon()
return
if (amount < used) if (amount < used)
return FALSE return FALSE
amount -= used amount -= used
@@ -539,3 +544,7 @@
/obj/item/stack/microwave_act(obj/machinery/microwave/M) /obj/item/stack/microwave_act(obj/machinery/microwave/M)
if(istype(M) && M.dirty < 100) if(istype(M) && M.dirty < 100)
M.dirty += amount M.dirty += amount
/obj/item/stack/proc/prepare_estorage(obj/item/robot_module/module)
if(source)
source = module.get_or_create_estorage(source)
@@ -536,7 +536,8 @@
/obj/item/stack/tile/plasteel/cyborg /obj/item/stack/tile/plasteel/cyborg
custom_materials = null // All other Borg versions of items have no Metal or Glass - RR custom_materials = null // All other Borg versions of items have no Metal or Glass - RR
is_cyborg = TRUE is_cyborg = TRUE
cost = 125 source = /datum/robot_energy_storage/metal
cost = MINERAL_MATERIAL_AMOUNT * 0.0625
/obj/item/stack/tile/material /obj/item/stack/tile/material
name = "floor tile" name = "floor tile"
+6
View File
@@ -40,6 +40,12 @@
resistance_flags = FLAMMABLE resistance_flags = FLAMMABLE
grind_results = list(/datum/reagent/cellulose = 5) grind_results = list(/datum/reagent/cellulose = 5)
/obj/item/stack/packageWrap/cyborg
custom_materials = null
is_cyborg = TRUE
source = /datum/robot_energy_storage/wrapping_paper
cost = 1
/obj/item/stack/packageWrap/suicide_act(mob/living/user) /obj/item/stack/packageWrap/suicide_act(mob/living/user)
user.visible_message("<span class='suicide'>[user] begins wrapping [user.p_them()]self in \the [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>") user.visible_message("<span class='suicide'>[user] begins wrapping [user.p_them()]self in \the [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
if(use(3)) if(use(3))
@@ -31,6 +31,12 @@ GLOBAL_LIST_INIT(marker_beacon_colors, list(
/obj/item/stack/marker_beacon/thirty //and they're bought in stacks of 1, 10, or 30 /obj/item/stack/marker_beacon/thirty //and they're bought in stacks of 1, 10, or 30
amount = 30 amount = 30
/obj/item/stack/marker_beacon/cyborg
is_cyborg = TRUE
custom_materials = null
source = /datum/robot_energy_storage/beacon
cost = 1
/obj/item/stack/marker_beacon/Initialize(mapload) /obj/item/stack/marker_beacon/Initialize(mapload)
. = ..() . = ..()
update_icon() update_icon()
@@ -86,7 +86,7 @@
if(!(m in R.held_items)) if(!(m in R.held_items))
. += m . += m
/obj/item/robot_module/proc/get_or_create_estorage(var/storage_type) /obj/item/robot_module/proc/get_or_create_estorage(storage_type)
for(var/datum/robot_energy_storage/S in storages) for(var/datum/robot_energy_storage/S in storages)
if(istype(S, storage_type)) if(istype(S, storage_type))
return S return S
@@ -95,42 +95,9 @@
/obj/item/robot_module/proc/add_module(obj/item/I, nonstandard, requires_rebuild) /obj/item/robot_module/proc/add_module(obj/item/I, nonstandard, requires_rebuild)
rad_flags |= RAD_NO_CONTAMINATE rad_flags |= RAD_NO_CONTAMINATE
if(istype(I, /obj/item/stack)) var/obj/item/stack/S = I
var/obj/item/stack/S = I if(istype(I, /obj/item/stack) && !S.is_cyborg) // Now handled in the type itself
stack_trace("Non-cyborg variant of /obj/item/stack added to a cyborg's modules.")
if(is_type_in_list(S, list(/obj/item/stack/sheet/metal, /obj/item/stack/rods, /obj/item/stack/tile/plasteel)))
if(S.custom_materials?.len && S.custom_materials[SSmaterials.GetMaterialRef(/datum/material/iron)])
S.cost = S.custom_materials[SSmaterials.GetMaterialRef(/datum/material/iron)] * 0.25
S.source = get_or_create_estorage(/datum/robot_energy_storage/metal)
else if(istype(S, /obj/item/stack/sheet/glass))
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)
else if(istype(S, /obj/item/stack/cable_coil))
S.cost = 1
S.source = get_or_create_estorage(/datum/robot_energy_storage/wire)
else if(istype(S, /obj/item/stack/marker_beacon))
S.cost = 1
S.source = get_or_create_estorage(/datum/robot_energy_storage/beacon)
else if(istype(S, /obj/item/stack/packageWrap))
S.cost = 1
S.source = get_or_create_estorage(/datum/robot_energy_storage/wrapping_paper)
if(S && S.source)
S.set_custom_materials(null)
S.is_cyborg = 1
if(I.loc != src) if(I.loc != src)
I.forceMove(src) I.forceMove(src)
@@ -935,9 +902,9 @@
/obj/item/gps/cyborg, /obj/item/gps/cyborg,
/obj/item/gripper/mining, /obj/item/gripper/mining,
/obj/item/cyborg_clamp, /obj/item/cyborg_clamp,
/obj/item/stack/marker_beacon, /obj/item/stack/marker_beacon/cyborg,
/obj/item/destTagger, /obj/item/destTagger,
/obj/item/stack/packageWrap, /obj/item/stack/packageWrap/cyborg,
/obj/item/card/id/miningborg) /obj/item/card/id/miningborg)
emag_modules = list(/obj/item/borg/stun) emag_modules = list(/obj/item/borg/stun)
ratvar_modules = list( ratvar_modules = list(
@@ -1056,7 +1023,7 @@
/obj/item/surgicaldrill, /obj/item/surgicaldrill,
/obj/item/scalpel, /obj/item/scalpel,
/obj/item/bonesetter, /obj/item/bonesetter,
/obj/item/stack/medical/bone_gel, /obj/item/stack/medical/bone_gel/cyborg,
/obj/item/melee/transforming/energy/sword/cyborg/saw, /obj/item/melee/transforming/energy/sword/cyborg/saw,
/obj/item/roller/robo, /obj/item/roller/robo,
/obj/item/card/emag, /obj/item/card/emag,
@@ -1191,7 +1158,7 @@
/obj/item/surgicaldrill, /obj/item/surgicaldrill,
/obj/item/scalpel, /obj/item/scalpel,
/obj/item/bonesetter, /obj/item/bonesetter,
/obj/item/stack/medical/bone_gel, /obj/item/stack/medical/bone_gel/cyborg,
/obj/item/melee/transforming/energy/sword/cyborg/saw, /obj/item/melee/transforming/energy/sword/cyborg/saw,
/obj/item/roller/robo, /obj/item/roller/robo,
/obj/item/stack/medical/gauze/cyborg, /obj/item/stack/medical/gauze/cyborg,
+1
View File
@@ -517,6 +517,7 @@ By design, d1 is the smallest direction and d2 is the highest
/obj/item/stack/cable_coil/cyborg /obj/item/stack/cable_coil/cyborg
is_cyborg = TRUE is_cyborg = TRUE
custom_materials = null custom_materials = null
source = /datum/robot_energy_storage/wire
cost = 1 cost = 1
/obj/item/stack/cable_coil/cyborg/attack_self(mob/user) /obj/item/stack/cable_coil/cyborg/attack_self(mob/user)