Robot_module and cyborg stack refactor (#13527)

* robot_module refactor

* some fixes

1. adds medical stacks of 25 for the syndi medical borg
2. fixes various construction steps that weren't using `use()` or `get_amount()`

* review tweaks + other stuff

1. Makes a bunch of for loops into istypeless loops
2. Adds a readout of the current out of stacks a borg has, in the status panel
3. Slightly reorganizes the medical, syndi medical, engineering and syndi engineering cyborgs items

* fixes after upstream merge

* blank line for travis

* fixes and improvements

1. Fixed welder icon's not updating periodically if you were charging in a borg recharger
2. Fixes solar panels dropping /cyborg type glass when they were deconstructed.
3. Band-aid fix (incase #2 doesn't fix this) for cyborg stack's `source` var being null which resulted in tons of "cannot read null.energy" runtimes

* more fixes + constructable frame runtime fix

* removes toy sword placeholder

remove comment

* remove these as well

* .amount to .get_amount(), really should have done this before

* refactors robot_upgrades to work with the new system

- more cleanup
- adds documentation
- fixed a bug I made where you could delete your robot stack via crafting

* moves some unemag logic to the module file, makes more loops typless

* farie review

* fox review

* affected review and more TM bugfixes

* fixes comment

Co-authored-by: SteelSlayer <SteelSlayer@users.noreply.github.com>
This commit is contained in:
SteelSlayer
2021-05-24 16:24:25 +01:00
committed by GitHub
co-authored by SteelSlayer
parent 663eff7b5e
commit e4bbd94d6a
46 changed files with 1057 additions and 914 deletions
+10 -6
View File
@@ -40,6 +40,8 @@ GLOBAL_LIST_INIT(glass_recipes, list ( \
amount = 50
/obj/item/stack/sheet/glass/cyborg
energy_type = /datum/robot_energy_storage/glass
is_cyborg = TRUE
materials = list()
/obj/item/stack/sheet/glass/New(loc, amount)
@@ -48,15 +50,15 @@ GLOBAL_LIST_INIT(glass_recipes, list ( \
/obj/item/stack/sheet/glass/attackby(obj/item/W, mob/user, params)
..()
if(istype(W,/obj/item/stack/cable_coil))
if(istype(W, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/CC = W
if(CC.amount < 5)
if(CC.get_amount() < 5)
to_chat(user, "<b>There is not enough wire in this coil. You need 5 lengths.</b>")
return
CC.use(5)
to_chat(user, "<span class='notice'>You attach wire to the [name].</span>")
new /obj/item/stack/light_w(user.loc)
src.use(1)
use(1)
else if( istype(W, /obj/item/stack/rods) )
var/obj/item/stack/rods/V = W
var/obj/item/stack/sheet/rglass/RG = new (user.loc)
@@ -97,9 +99,6 @@ GLOBAL_LIST_INIT(reinforced_glass_recipes, list ( \
merge_type = /obj/item/stack/sheet/rglass
point_value = 4
/obj/item/stack/sheet/rglass/cyborg
materials = list()
/obj/item/stack/sheet/rglass/New(loc, amount)
recipes = GLOB.reinforced_glass_recipes
..()
@@ -109,6 +108,11 @@ GLOBAL_LIST_INIT(pglass_recipes, list ( \
new/datum/stack_recipe/window("fulltile window", /obj/structure/window/full/plasmabasic, 2, time = 0, on_floor = TRUE, window_checks = TRUE) \
))
/obj/item/stack/sheet/rglass/cyborg
energy_type = /datum/robot_energy_storage/rglass
is_cyborg = TRUE
materials = list()
/obj/item/stack/sheet/plasmaglass
name = "plasma glass"
desc = "A very strong and very resistant sheet of a plasma-glass alloy."
+9 -18
View File
@@ -13,25 +13,16 @@
flags = CONDUCT
max_amount = 60
/obj/item/stack/light_w/attackby(obj/item/O as obj, mob/user as mob, params)
/obj/item/stack/light_w/attackby(obj/item/I, mob/user, params)
..()
if(istype(O,/obj/item/wirecutters))
var/obj/item/stack/cable_coil/CC = new/obj/item/stack/cable_coil(user.loc)
if(istype(I, /obj/item/wirecutters))
var/obj/item/stack/cable_coil/CC = new(user.loc)
CC.amount = 5
amount--
new/obj/item/stack/sheet/glass(user.loc)
if(amount <= 0)
user.unEquip(src, 1)
qdel(src)
use(1)
if(istype(O,/obj/item/stack/sheet/metal))
var/obj/item/stack/sheet/metal/M = O
M.amount--
if(M.amount <= 0)
user.unEquip(src, 1)
qdel(M)
amount--
new/obj/item/stack/tile/light(user.loc)
if(amount <= 0)
user.unEquip(src, 1)
qdel(src)
if(istype(I, /obj/item/stack/sheet/metal))
var/obj/item/stack/sheet/metal/M = I
M.use(1)
new /obj/item/stack/tile/light(user.loc)
use(1)
@@ -110,6 +110,8 @@ GLOBAL_LIST_INIT(metal_recipes, list(
point_value = 2
/obj/item/stack/sheet/metal/cyborg
energy_type = /datum/robot_energy_storage/metal
is_cyborg = TRUE
materials = list()
/obj/item/stack/sheet/metal/fifty
@@ -162,6 +164,10 @@ GLOBAL_LIST_INIT(plasteel_recipes, list(
recipes = GLOB.plasteel_recipes
return ..()
/obj/item/stack/sheet/wood/cyborg
energy_type = /datum/robot_energy_storage/wood
is_cyborg = TRUE
/*
* Wood
*/