Files
Bubberstation/code/game/objects/items/devices/pressureplates.dm
T
Andrew 0818d6ae4c Crafting/Cooking menu update (#71779)
## About The Pull Request

Updated crafting menu, adding a lot of new functions and recipes that
were not in the crafting menu before.

<img alt="cult"
src="https://user-images.githubusercontent.com/3625094/206009533-aec3a1dd-cbe5-45eb-8515-1b75fabb65c5.PNG">

<img alt="nH77dLyyGx"
src="https://user-images.githubusercontent.com/3625094/206009786-b6706f70-0599-40bf-b051-8f499de43abd.png">


![image](https://user-images.githubusercontent.com/3625094/206623881-12d8abfc-de5e-458e-a01c-3daac8dbe9bd.png)


https://user-images.githubusercontent.com/3625094/206009841-738e4a03-0660-45b7-8d83-15eeb6501967.mp4

## Why It's Good For The Game

It is easier to use, and it has a lot of recipes that were spread
throughout the game, some of which weren't even on the wiki.
Crafting and cooking now count about 1200 recipes in total, including
conditionally available ones.

## Changelog

🆑
qol: Rewrote the crafting/cooking menu UI
qol: Split crafting and cooking menus in two different menus
qol: Crafting is no longer blocking the entire UI, only the "Make"
buttons are disabled
qol: Added stack crafting recipes to the crafting menu
qol: Added cooking recipes that were absent in the crafting menu before
(tool recipes, machine recipes, reactions)
qol: Added option to search recipes by title
qol: Added option to filter recipes by required materials/ingredients
qol: Added food types to the cooking menu, highlighting diet of your
species (liked, disliked foods)
qol: Added total nutrition value of the result to the cooking menu
qol: Added option to filter cooking recipes by the food type of the
resulting food
qol: Added "Can make" category that lists all currently craftable
recipes throughout all categories
refactor: changed categories and reshuffled some items in them
code: Reagents now have default container to get an icon from the
reagent datum
code: Objects now have `desc_controls` var for OOC information about
mouse controls that are visible on examine, but not in the description
fix: Fixed alignment on many food icons
fix: Fixed missing icon for beef stroganoff
/🆑

Co-authored-by: tattle <66640614+dragomagol@users.noreply.github.com>
2022-12-25 12:27:49 -08:00

94 lines
3.1 KiB
Plaintext

/obj/item/pressure_plate
name = "pressure plate"
desc = "An electronic device that triggers when stepped on."
desc_controls = "Ctrl-Click to toggle the pressure plate off and on."
icon = 'icons/obj/puzzle_small.dmi'
inhand_icon_state = "flashtool"
lefthand_file = 'icons/mob/inhands/equipment/security_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/security_righthand.dmi'
icon_state = "pressureplate"
layer = LOW_OBJ_LAYER
var/trigger_mob = TRUE
var/trigger_item = FALSE
var/specific_item = null
var/trigger_silent = FALSE
var/sound/trigger_sound = 'sound/effects/pressureplate.ogg'
var/obj/item/assembly/signaler/sigdev = null
var/roundstart_signaller = FALSE
var/roundstart_signaller_freq = FREQ_PRESSURE_PLATE
var/roundstart_signaller_code = 30
var/roundstart_hide = FALSE
var/removable_signaller = TRUE
var/active = FALSE
var/image/tile_overlay = null
var/can_trigger = TRUE
var/trigger_delay = 10
var/protected = FALSE
var/undertile_pressureplate = TRUE
/obj/item/pressure_plate/Initialize(mapload)
. = ..()
tile_overlay = image(icon = 'icons/turf/floors.dmi', icon_state = "pp_overlay")
if(roundstart_signaller)
sigdev = new
sigdev.code = roundstart_signaller_code
sigdev.set_frequency(roundstart_signaller_freq)
if(undertile_pressureplate)
AddElement(/datum/element/undertile, tile_overlay = tile_overlay, use_anchor = TRUE)
RegisterSignal(src, COMSIG_OBJ_HIDE, PROC_REF(ToggleActive))
var/static/list/loc_connections = list(
COMSIG_ATOM_ENTERED = PROC_REF(on_entered),
)
AddElement(/datum/element/connect_loc, loc_connections)
/obj/item/pressure_plate/proc/on_entered(datum/source, atom/movable/AM)
SIGNAL_HANDLER
if(!can_trigger || !active)
return
if(trigger_item && !istype(AM, specific_item))
return
if(trigger_mob && isliving(AM))
var/mob/living/L = AM
to_chat(L, span_warning("You feel something click beneath you!"))
else if(!trigger_item)
return
can_trigger = FALSE
addtimer(CALLBACK(src, PROC_REF(trigger)), trigger_delay)
/obj/item/pressure_plate/proc/trigger()
can_trigger = TRUE
if(istype(sigdev))
sigdev.signal()
/obj/item/pressure_plate/attackby(obj/item/I, mob/living/L)
if(issignaler(I) && !istype(sigdev) && removable_signaller && L.transferItemToLoc(I, src))
sigdev = I
to_chat(L, span_notice("You attach [I] to [src]!"))
return ..()
/obj/item/pressure_plate/attack_self(mob/living/L)
if(removable_signaller && istype(sigdev))
to_chat(L, span_notice("You remove [sigdev] from [src]."))
if(!L.put_in_hands(sigdev))
sigdev.forceMove(get_turf(src))
sigdev = null
return ..()
/obj/item/pressure_plate/CtrlClick(mob/user)
if(protected)
to_chat(user, span_warning("You can't quite seem to turn this pressure plate off..."))
return
active = !active
if (active == TRUE)
to_chat(user, span_notice("You turn [src] on."))
else
to_chat(user, span_notice("You turn [src] off."))
///Called from COMSIG_OBJ_HIDE to toggle the active part, because yeah im not making a special exception on the element to support it
/obj/item/pressure_plate/proc/ToggleActive(datum/source, underfloor_accessibility)
SIGNAL_HANDLER
active = underfloor_accessibility < UNDERFLOOR_VISIBLE