Files
Bubberstation/code/game/objects/items/rcd/RSF.dm
T
Dawnseer 61a034bcd9 Service Borger Upri- Kitchen Upgrades (#74938)
## About The Pull Request
I decided that Service Borgs had been left in the dust for too long, and
that since they're named 'Service' cyborgs and not 'Bar' cyborgs I'd
give them upgrades to let them assist in the kitchen. To do this I've
made 4 upgrades.

First up, rolling table dock, to provide mobile service. Nothing worse
than offering someone a drink in a hallway and having to drag them to
the nearest table or having to drop it on the floor. That's poor
service.
Secondly there's a condiment synthesizer, which can produce solid
condiments like flour, cornmeal, salt, coco powder, etc.
Thirdly a kitchen toolset, a knife that can switch to a rolling pin. The
blade dulls when not used for cooking.
Fourthly, A service apparatus, which can pick up food, oven trays, soup
pots, plates, bowls and paper.

The upgrades are locked behind a new techweb node, Cyborg Upgrades:
Service.
This node is locked behind the same nodes as the janitorial cyborg
upgrade node.

And outside the upgrades, I've also given the cyborg a rag so it can
finally clean it's glasses and tables. I've also given it a money bag,
to store the profits. This gives cyborgs an opportunity to save up for
getting on the deluxe shuttle. Or giving people a new target to hold up
and shake down for their hard earned money. Please don't law 2 them into
giving you their lunch money. Or do.
I've also enabled the RSF to print a few more things. Plates, bowls,
plastic cutlery and paper cups.
I've also enabled borgs to open and close the oven. Alas, they still
can't pick up food or the oven trays from the oven, since the oven is
sticky in a manner.

I've also added a little bit more to the borgshaker, and moved sugar
from the borgshaker to the condiment synthesizer.

And not only the borgshaker, but the emagged shaker too. The emagged
shaker has been given blood and carpotoxin. And you may ask 'Why those
two ingredients?' Both can be used like fernet, both for nice things,
and harmful things, staying in line with fernet. Blood can be used to
mix drinks or be used for food, or for disease, since the borg or anyone
with access to milk and water can easily produce virus food. Meanwhile
carpotoxin is well, a rather weak toxin but can also be used to make
imitation carpmeat. This'l give more reason to also consider the borg
for emagging, or giving illegal tech, instead of just speedlining for
the nearest engineering borg or medical borg.

![image](https://user-images.githubusercontent.com/126404225/233840472-7665196c-1052-4e29-9749-6c2b99e5fa9e.png)

The Condiment Synthesizer uses the same UI as the medical hypo, due to
it's ingredient list being low in comparison to the shaker

![image](https://user-images.githubusercontent.com/126404225/235359571-48157d24-f3c8-448f-bb05-6f8842526aae.png)

I've been trying to figure out how to get an item to allow the borg to
open the cooking menu when used inhand/inmodule. But I can't figure that
one out, sadly. Nor how to let the Service Apparatus pick up trays from
the oven.
So for now, service borgs will have to settle for simply assisting in
the kitchen.

## Why It's Good For The Game
Allows Service Cyborgs the tools to help in the kitchen, and elsewhere
too.
## Changelog
🆑
add: Damp rag and Money bag to service borg
add: Service borg upgrades, with accompanying tech web node
add: Sprites for kitchen toolset, and service apparatus
balance: The RSF can print a few more things, paper cups, seaweed
sheets, plates, bowls, plastic cutlery and standard decks of cards.
balance: Sugar moved from borgshaker to condiment synthesizer. Berry
juice, cherry jelly and vinegar added to borgshaker. balance: Both
shaker and synthesizer can also be adjusted to give 1 unit at time, so
it goes 5, 10, 20 then 1, and back around.
balance: Adds blood and Carpotoxin to the emagged borgshaker.
fix: Money bag was missing a description, it now has one.
/🆑
2023-05-02 18:59:53 -06:00

207 lines
7.5 KiB
Plaintext

/*
CONTAINS:
RSF
*/
///Extracts the related object from an associated list of objects and values, or lists and objects.
#define OBJECT_OR_LIST_ELEMENT(from, input) (islist(input) ? from[input] : input)
/obj/item/rsf
name = "\improper Rapid-Service-Fabricator"
desc = "A device used to rapidly deploy service items."
icon = 'icons/obj/tools.dmi'
icon_state = "rsf"
inhand_icon_state = "rsf"
base_icon_state = "rsf"
///The icon state to revert to when the tool is empty
var/spent_icon_state = "rsf_empty"
lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi'
opacity = FALSE
density = FALSE
anchored = FALSE
item_flags = NOBLUDGEON
armor_type = /datum/armor/none
///The current matter count
var/matter = 0
///The max amount of matter in the device
var/max_matter = 30
///The type of the object we are going to dispense
var/to_dispense
///The cost of the object we are going to dispense
var/dispense_cost = 0
w_class = WEIGHT_CLASS_NORMAL
///An associated list of atoms and charge costs. This can contain a separate list, as long as it's associated item is an object
///The RSF item list below shows in the player facing ui in this order, this is why it isn't in alphabetical order, but instead sorted by category
var/list/cost_by_item = list(
/obj/item/reagent_containers/cup/glass/drinkingglass = 20,
/obj/item/reagent_containers/cup/glass/sillycup = 10,
/obj/item/plate = 70,
/obj/item/reagent_containers/cup/bowl = 70,
/obj/item/kitchen/fork/plastic = 30,
/obj/item/knife/plastic = 30,
/obj/item/kitchen/spoon/plastic = 30,
/obj/item/food/seaweedsheet = 30,
/obj/item/storage/dice = 200,
/obj/item/toy/cards/deck = 200,
/obj/item/paper = 10,
/obj/item/pen = 50,
/obj/item/clothing/mask/cigarette = 10,
)
///An associated list of fuel and it's value
var/list/matter_by_item = list(/obj/item/rcd_ammo = 10,)
///A list of surfaces that we are allowed to place things on.
var/list/allowed_surfaces = list(/turf/open/floor, /obj/structure/table)
///The unit of mesure of the matter, for use in text
var/discriptor = "fabrication-units"
///The verb that describes what we're doing, for use in text
var/action_type = "Dispensing"
///Holds a copy of world.time from the last time the synth was used.
var/cooldown = 0
///How long should the minimum period between this RSF's item dispensings be?
var/cooldowndelay = 0 SECONDS
/obj/item/rsf/Initialize(mapload)
. = ..()
to_dispense = cost_by_item[1]
dispense_cost = cost_by_item[to_dispense]
/obj/item/rsf/examine(mob/user)
. = ..()
. += span_notice("It currently holds [matter]/[max_matter] [discriptor].")
/obj/item/rsf/cyborg
matter = 30
/obj/item/rsf/attackby(obj/item/W, mob/user, params)
if(is_type_in_list(W,matter_by_item))//If the thing we got hit by is in our matter list
var/tempMatter = matter_by_item[W.type] + matter
if(tempMatter > max_matter)
to_chat(user, span_warning("\The [src] can't hold any more [discriptor]!"))
return
if(isstack(W))
var/obj/item/stack/stack = W
stack.use(1)
else
qdel(W)
matter = tempMatter //We add its value
playsound(src.loc, 'sound/machines/click.ogg', 10, TRUE)
to_chat(user, span_notice("\The [src] now holds [matter]/[max_matter] [discriptor]."))
icon_state = base_icon_state//and set the icon state to the base state
else
return ..()
/obj/item/rsf/attack_self(mob/user)
playsound(src.loc, 'sound/effects/pop.ogg', 50, FALSE)
var/target = cost_by_item
var/cost = 0
//Warning, prepare for bodgecode
while(islist(target))//While target is a list we continue the loop
var/picked = show_radial_menu(user, src, formRadial(target), custom_check = CALLBACK(src, PROC_REF(check_menu), user), require_near = TRUE)
if(!check_menu(user) || picked == null)
return
for(var/emem in target)//Back through target agian
var/atom/test = OBJECT_OR_LIST_ELEMENT(target, emem)
if(picked == initial(test.name))//We try and find the entry that matches the radial selection
cost = target[emem]//We cash the cost
target = emem
break
//If we found a list we start it all again, this time looking through its contents.
//This allows for sublists
to_dispense = target
dispense_cost = cost
// Change mode
///Forms a radial menu based off an object in a list, or a list's associated object
/obj/item/rsf/proc/formRadial(from)
var/list/radial_list = list()
for(var/meme in from)//We iterate through all of targets entrys
var/atom/temp = OBJECT_OR_LIST_ELEMENT(from, meme)
//We then add their data into the radial menu
radial_list[initial(temp.name)] = image(icon = initial(temp.icon), icon_state = initial(temp.icon_state))
return radial_list
/obj/item/rsf/proc/check_menu(mob/user)
if(user.incapacitated() || !user.Adjacent(src))
return FALSE
return TRUE
/obj/item/rsf/afterattack(atom/A, mob/user, proximity)
if(cooldown > world.time)
return
. = ..()
if(!proximity)
return .
. |= AFTERATTACK_PROCESSED_ITEM
if (!is_allowed(A))
return .
if(use_matter(dispense_cost, user))//If we can charge that amount of charge, we do so and return true
playsound(loc, 'sound/machines/click.ogg', 10, TRUE)
var/atom/meme = new to_dispense(get_turf(A))
to_chat(user, span_notice("[action_type] [meme.name]..."))
cooldown = world.time + cooldowndelay
return .
///A helper proc. checks to see if we can afford the amount of charge that is passed, and if we can docs the charge from our base, and returns TRUE. If we can't we return FALSE
/obj/item/rsf/proc/use_matter(charge, mob/user)
if(iscyborg(user))
var/mob/living/silicon/robot/R = user
var/end_charge = R.cell.charge - charge
if(end_charge < 0)
to_chat(user, span_warning("You do not have enough power to use [src]."))
icon_state = spent_icon_state
return FALSE
R.cell.charge = end_charge
return TRUE
else
if(matter - 1 < 0)
to_chat(user, span_warning("\The [src] doesn't have enough [discriptor] left."))
icon_state = spent_icon_state
return FALSE
matter--
to_chat(user, span_notice("\The [src] now holds [matter]/[max_matter] [discriptor]."))
return TRUE
///Helper proc that iterates through all the things we are allowed to spawn on, and sees if the passed atom is one of them
/obj/item/rsf/proc/is_allowed(atom/to_check)
for(var/sort in allowed_surfaces)
if(istype(to_check, sort))
return TRUE
return FALSE
/obj/item/rsf/cookiesynth
name = "Cookie Synthesizer"
desc = "A self-recharging device used to rapidly deploy cookies."
icon_state = "rcd"
base_icon_state = "rcd"
spent_icon_state = "rcd"
max_matter = 10
cost_by_item = list(/obj/item/food/cookie = 100)
dispense_cost = 100
discriptor = "cookie-units"
action_type = "Fabricates"
cooldowndelay = 10 SECONDS
///Tracks whether or not the cookiesynth is about to print a poisoned cookie
var/toxin = FALSE //This might be better suited to some initialize fuckery, but I don't have a good "poisoned" sprite
/obj/item/rsf/cookiesynth/emag_act(mob/user)
obj_flags ^= EMAGGED
if(obj_flags & EMAGGED)
to_chat(user, span_warning("You short out [src]'s reagent safety checker!"))
else
to_chat(user, span_warning("You reset [src]'s reagent safety checker!"))
/obj/item/rsf/cookiesynth/attack_self(mob/user)
var/mob/living/silicon/robot/P = null
if(iscyborg(user))
P = user
if(((obj_flags & EMAGGED) || (P?.emagged)) && !toxin)
toxin = TRUE
to_dispense = /obj/item/food/cookie/sleepy
to_chat(user, span_alert("Cookie Synthesizer hacked."))
else
toxin = FALSE
to_dispense = /obj/item/food/cookie
to_chat(user, span_notice("Cookie Synthesizer reset."))
#undef OBJECT_OR_LIST_ELEMENT