Files
CHOMPStation2/code/_helpers/sorts/comparators.dm
Rykka 940aaec9c8 WIP Aurora Cooking Port
This ports Aurora Cooking, sometimes called Nanako Cooking, from CitRP, who got it from Aurora originally. 

https://github.com/Citadel-Station-13/Citadel-Station-13-RP/pull/608

Pulled from here with updates to to_chat()

Ovens and fryers now work like the microwave, but also have special trays/baskets that can be inserted and removed with things on them. There's also a crapton of new recipes. Note that you can still use the oven to just bake things, or produce variable food items, to my knowledge. This was specifically kept in when it was originally implemented, IIRC.

- Cooking now uses several machines to make recipes. Microwave, oven, deep fryer.
- Recipes have been redone to reflect this.
- Adds a reagent called Space Spice (used in Synnono's food recipes mostly, prevents recipe conflicts)
- New foods! Lots of them.
- You can cook using held mobs. Also, mouse/ratburgers.
I can dump the recipes if you'd like.

https://user-images.githubusercontent.com/40557659/52112070-10165a80-25cb-11e9-9a72-2c919f0033dd.png (From their PR, may not be accurate).

This is WIP, and will not compile just yet.
2020-07-14 17:04:52 -04:00

64 lines
2.5 KiB
Plaintext

//
// Comparators for use with /datum/sortInstance (or wherever you want)
// They should return negative, zero, or positive numbers for a < b, a == b, and a > b respectively.
//
// Sorts numeric ascending
/proc/cmp_numeric_asc(a,b)
return a - b
// Sorts subsystems alphabetically
/proc/cmp_subsystem_display(datum/controller/subsystem/a, datum/controller/subsystem/b)
return sorttext(b.name, a.name)
// Sorts subsystems by init_order
/proc/cmp_subsystem_init(datum/controller/subsystem/a, datum/controller/subsystem/b)
return initial(b.init_order) - initial(a.init_order) //uses initial() so it can be used on types
// Sorts subsystems by priority
/proc/cmp_subsystem_priority(datum/controller/subsystem/a, datum/controller/subsystem/b)
return a.priority - b.priority
/proc/cmp_timer(datum/timedevent/a, datum/timedevent/b)
return a.timeToRun - b.timeToRun
// Sorts qdel statistics recorsd by time and count
/proc/cmp_qdel_item_time(datum/qdel_item/A, datum/qdel_item/B)
. = B.hard_delete_time - A.hard_delete_time
if (!.)
. = B.destroy_time - A.destroy_time
if (!.)
. = B.failures - A.failures
if (!.)
. = B.qdels - A.qdels
// Sorts jobs by department, and then by flag within department
/proc/cmp_job_datums(var/datum/job/a, var/datum/job/b)
. = 0
if( LAZYLEN(a.departments) && LAZYLEN(b.departments) )
var/list/common_departments = a.departments & b.departments // Makes a list that contains only departments that were in both.
if(!common_departments.len)
. = sorttext(b.departments[1], a.departments[1])
if(. == 0) //Same department, push up if they're a head
. = b.sorting_order - a.sorting_order
if(. == 0) //Already in same sorting order, sort by name
. = sorttext(b.title, a.title)
/proc/cmp_department_datums(var/datum/department/a, var/datum/department/b)
. = b.sorting_order - a.sorting_order // First, sort by the sorting order vars.
if(. == 0) // If they have the same var, then sort by name.
. = sorttext(b.name, a.name)
// Sorts entries in a performance stats list.
/proc/cmp_generic_stat_item_time(list/A, list/B)
. = B[STAT_ENTRY_TIME] - A[STAT_ENTRY_TIME]
if (!.)
. = B[STAT_ENTRY_COUNT] - A[STAT_ENTRY_COUNT]
// Compares complexity of recipes for use in cooking, etc. This is for telling which recipe to make, not for showing things to the player.
/proc/cmp_recipe_complexity_dsc(datum/recipe/A, datum/recipe/B)
var/a_score = LAZYLEN(A.items) + LAZYLEN(A.reagents) + LAZYLEN(A.fruit)
var/b_score = LAZYLEN(B.items) + LAZYLEN(B.reagents) + LAZYLEN(B.fruit)
return b_score - a_score