service borg cookin fixin update (#76590)

## About The Pull Request
PR done for bounty:
https://tgstation13.org/phpBB/viewtopic.php?f=5&t=33988
borgs can now turn on stoves and griddles
borg click code has been reworked a bit to be closer to base mob, you
are now able to click on stuff within reach rather than just Adjacent
(might be buggy to introduce this? hopefully not. if anything we can
testmerge this), which lets us make the apparatus work to pick up stoves
on the range and such
Adds the Codex Cibus Mechanicus as an upgrade you can research in RnD
with the other service borg ones. When you use it it shows you the
cooking menu!

![image](https://github.com/tgstation/tgstation/assets/23585223/5f881387-e0ba-4bb8-a9d6-ddc9d8fa9272)

## Why It's Good For The Game
The service borg has the tools to prepare ingredients, but it can't
actually do anything with them, which severely limits it, only being
able to do slapcrafted foods.
The apparatus not working on items that are on top of stoves/griddles
seems to be just a bug with how cyborg click code is handled.

## Changelog
🆑 Fikou
fix: service borg apparatus now works on stoves and griddles and ovens
qol: borgs can now activate stoves and griddles
add: rnd can research a cookbook for service borgs
/🆑
This commit is contained in:
Fikou
2023-07-09 15:17:39 +02:00
committed by GitHub
parent 69775ea1fe
commit 8ca2a0bb35
11 changed files with 155 additions and 64 deletions
+3 -2
View File
@@ -51,9 +51,10 @@
"scrambledcodes" = borg.scrambledcodes
)
.["upgrades"] = list()
for (var/upgradetype in subtypesof(/obj/item/borg/upgrade)-/obj/item/borg/upgrade/hypospray) //hypospray is a dummy parent for hypospray upgrades
var/static/list/not_shown_upgrades = list(/obj/item/borg/upgrade/hypospray)
for (var/upgradetype in subtypesof(/obj/item/borg/upgrade)-not_shown_upgrades) //hypospray is a dummy parent for hypospray upgrades
var/obj/item/borg/upgrade/upgrade = upgradetype
if (initial(upgrade.model_type) && !is_type_in_list(borg.model, initial(upgrade.model_type))) // Upgrade requires a different model
if (initial(upgrade.model_type) && !is_type_in_list(borg.model, initial(upgrade.model_type))) // Upgrade requires a different model //HEY ASSHOLE, INITIAL DOESNT WORK WITH LISTS
continue
var/installed = FALSE
if (locate(upgradetype) in borg)
@@ -83,6 +83,13 @@
/obj/machinery/griddle/attack_hand(mob/user, list/modifiers)
. = ..()
toggle_mode()
/obj/machinery/griddle/attack_robot(mob/user)
. = ..()
toggle_mode()
/obj/machinery/griddle/proc/toggle_mode()
on = !on
if(on)
begin_processing()
@@ -39,6 +39,7 @@
/datum/component/stove/RegisterWithParent()
RegisterSignal(parent, COMSIG_ATOM_ATTACKBY, PROC_REF(on_attackby))
RegisterSignal(parent, COMSIG_ATOM_ATTACK_HAND_SECONDARY, PROC_REF(on_attack_hand_secondary))
RegisterSignal(parent, COMSIG_ATOM_ATTACK_ROBOT_SECONDARY, PROC_REF(on_attack_robot_secondary))
RegisterSignal(parent, COMSIG_ATOM_EXITED, PROC_REF(on_exited))
RegisterSignal(parent, COMSIG_ATOM_UPDATE_OVERLAYS, PROC_REF(on_overlay_update))
RegisterSignal(parent, COMSIG_OBJ_DECONSTRUCT, PROC_REF(on_deconstructed))
@@ -97,13 +98,25 @@
/datum/component/stove/proc/on_attack_hand_secondary(obj/machinery/source)
SIGNAL_HANDLER
toggle_mode()
return COMPONENT_SECONDARY_CANCEL_ATTACK_CHAIN
/datum/component/stove/proc/on_attack_robot_secondary(obj/machinery/source)
SIGNAL_HANDLER
toggle_mode()
return COMPONENT_SECONDARY_CANCEL_ATTACK_CHAIN
/datum/component/stove/proc/toggle_mode()
var/obj/machinery/real_parent = parent
if(on)
turn_off()
else if(real_parent.machine_stat & (BROKEN|NOPOWER))
real_parent.balloon_alert_to_viewers("no power!")
return COMPONENT_SECONDARY_CANCEL_ATTACK_CHAIN
return
else
turn_on()
@@ -112,8 +125,6 @@
playsound(real_parent, 'sound/machines/click.ogg', 30, TRUE)
playsound(real_parent, on ? 'sound/items/welderactivate.ogg' : 'sound/items/welderdeactivate.ogg', 15, TRUE)
return COMPONENT_SECONDARY_CANCEL_ATTACK_CHAIN
/datum/component/stove/proc/on_attackby(obj/machinery/source, obj/item/attacking_item, mob/user, params)
SIGNAL_HANDLER
@@ -1171,7 +1171,7 @@
)
/datum/design/borg_upgrade_silicon_knife
name = "Kitchen toolset"
name = "Kitchen Toolset"
id = "borg_upgrade_silicon_knife"
build_type = MECHFAB
build_path = /obj/item/borg/upgrade/silicon_knife
@@ -1182,7 +1182,7 @@
)
/datum/design/borg_upgrade_service_apparatus
name = "Service apparatus"
name = "Service Apparatus"
id = "borg_upgrade_service_apparatus"
build_type = MECHFAB
build_path = /obj/item/borg/upgrade/service_apparatus
@@ -1192,6 +1192,17 @@
RND_CATEGORY_MECHFAB_CYBORG_MODULES + RND_SUBCATEGORY_MECHFAB_CYBORG_MODULES_SERVICE
)
/datum/design/borg_upgrade_service_cookbook
name = "Service Cookbook"
id = "borg_upgrade_service_cookbook"
build_type = MECHFAB
build_path = /obj/item/borg/upgrade/service_cookbook
materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT*7.5, /datum/material/diamond = HALF_SHEET_MATERIAL_AMOUNT)
construction_time = 4 SECONDS
category = list(
RND_CATEGORY_MECHFAB_CYBORG_MODULES + RND_SUBCATEGORY_MECHFAB_CYBORG_MODULES_SERVICE
)
/datum/design/borg_upgrade_expand
name = "Expand Module"
id = "borg_upgrade_expand"
@@ -960,6 +960,7 @@
"borg_upgrade_condiment_synthesizer",
"borg_upgrade_silicon_knife",
"borg_upgrade_service_apparatus",
"borg_upgrade_service_cookbook",
)
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2000)