Skip to content

Commit

Permalink
[WIP] Newfood: Part 1 of 4 (#8748)
Browse files Browse the repository at this point in the history
* tgstation/tgstation#49192

* https://github.com/tgstation/tgstation/pull/53047/files

* fixerino

* food_storage component

* tgstation/tgstation#53316

* tgstation/tgstation#53225

* tgstation/tgstation#53574

* 515 compat

* fix maps

* tgstation/tgstation#69095

* bread slicing

* tgstation/tgstation#71449

* fixes

* finger food & edible fixes

* tgstation/tgstation#66257

* FIX THIS SHIT

* accidental_consumption

* fix trash runtime

* fixes some runtimes

* microwavable

* tgstation/tgstation#55150

* 515 compat

* Revert "515 compat"

This reverts commit 5681ca6cf6f8bcc187ceb4c263407631b461659b.

* Revert "tgstation/tgstation#55150"

This reverts commit aadbe1c392ade3caa4f1bcaf56abd8ea51dbd12d.

* Revert "microwavable"

This reverts commit 3b2f465d2cb79675e49dde08f45dcc694be29595.

* fix exploit with pasta
  • Loading branch information
Tsar-Salat authored and thgvr committed Mar 11, 2024
1 parent 7ac478c commit a3096ac
Show file tree
Hide file tree
Showing 59 changed files with 2,625 additions and 1,424 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@
/area/ruin/unpowered)
"F" = (
/obj/structure/table/wood,
/obj/item/reagent_containers/food/snacks/store/cake/birthday,
/obj/item/food/cake/birthday,
/turf/open/floor/wood{
initial_gas_mix = "o2=14;n2=5;co2=13;TEMP=300"
},
Expand Down
22 changes: 22 additions & 0 deletions _maps/map_files/generic/CentCom.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -11634,6 +11634,28 @@
/obj/effect/turf_decal/corner/transparent/neutral{
dir = 8
},
/obj/merge_conflict_marker{

Check failure on line 11637 in _maps/map_files/generic/CentCom.dmm

View workflow job for this annotation

GitHub Actions / Run Linters

DMM Linter

(in pop miR) (at (162, 61, 1)) Typepath /obj/merge_conflict_marker is banned.
name = "---Merge Conflict Marker---",desc = "A best-effort merge was performed. You must resolve this conflict yourself (manually) and remove this object once complete."
},
/obj/structure/closet/secure_closet/freezer/meat/open,

Check failure on line 11640 in _maps/map_files/generic/CentCom.dmm

View workflow job for this annotation

GitHub Actions / Run Linters

DMM Linter

(in pop miR) (at (162, 61, 1)) Typepath /obj/structure/closet/secure_closet/freezer/meat/open has a banned neighbor: /obj/structure/closet/secure_closet/freezer/meat/open
/obj/item/reagent_containers/food/snacks/meat/slab/bear,
/obj/item/reagent_containers/food/snacks/meat/slab/bear,
/obj/item/reagent_containers/food/snacks/meat/slab/bear,
/obj/item/reagent_containers/food/snacks/meat/slab/bear,
/obj/item/reagent_containers/food/snacks/meat/slab/goliath,
/obj/item/reagent_containers/food/snacks/meat/slab/goliath,
/obj/item/reagent_containers/food/snacks/meat/slab/goliath,
/obj/item/reagent_containers/food/snacks/meat/slab/goliath,
/obj/item/reagent_containers/food/snacks/meat/slab/xeno,
/obj/item/reagent_containers/food/snacks/meat/slab/xeno,
/obj/item/reagent_containers/food/snacks/meat/slab/xeno,
/obj/item/reagent_containers/food/snacks/meat/slab/xeno,
/obj/item/food/spaghetti/raw,
/obj/item/food/spaghetti/raw,
/obj/item/reagent_containers/food/snacks/meat/rawcutlet,
/obj/item/reagent_containers/food/snacks/meat/rawcutlet,
/obj/item/reagent_containers/food/snacks/meat/rawcutlet,
/obj/effect/turf_decal/tile/neutral/fourcorners/contrasted,
/turf/open/floor/plasteel/dark,
/area/tdome/tdomeobserve)
"miW" = (
Expand Down
79 changes: 30 additions & 49 deletions code/__DEFINES/food.dm
Original file line number Diff line number Diff line change
@@ -1,54 +1,35 @@
#define MEAT (1<<0)
#define VEGETABLES (1<<1)
#define RAW (1<<2)
#define JUNKFOOD (1<<3)
#define GRAIN (1<<4)
#define FRUIT (1<<5)
#define DAIRY (1<<6)
#define FRIED (1<<7)
#define ALCOHOL (1<<8)
#define SUGAR (1<<9)
#define GROSS (1<<10)
#define TOXIC (1<<11)
#define PINEAPPLE (1<<12)
#define BREAKFAST (1<<13)
#define CLOTH (1<<14)
#define GRILLED (1<<15)
/*#define NUTS (1<<16)
#define SEAFOOD (1<<17)
#define ORANGES (1<<18)
#define BUGS (1<<19)*/
#define GORE (1<<20)
#define MEAT (1<<0)
#define VEGETABLES (1<<1)
#define RAW (1<<2)
#define JUNKFOOD (1<<3)
#define GRAIN (1<<4)
#define FRUIT (1<<5)
#define DAIRY (1<<6)
#define FRIED (1<<7)
#define ALCOHOL (1<<8)
#define SUGAR (1<<9)
#define GROSS (1<<10)
#define TOXIC (1<<11)
#define PINEAPPLE (1<<12)
#define BREAKFAST (1<<13)
#define CLOTH (1<<14)

/// IC meaning (more or less) for food flags
#define FOOD_FLAGS_IC list( \
"Meat", \
"Vegetables", \
"Raw food", \
"Junk food", \
"Grain", \
"Fruits", \
"Dairy products", \
"Fried food", \
"Alcohol", \
"Sugary food", \
"Gross food", \
"Toxic food", \
"Pineapples", \
"Breakfast food", \
"Clothing", \
"Nuts", \
"Seafood", \
"Oranges", \
"Bugs", \
)

#define DRINK_NICE 1
#define DRINK_GOOD 2
#define DRINK_VERYGOOD 3
#define DRINK_FANTASTIC 4
#define FOOD_AMAZING 5
#define DRINK_BAD 1
#define DRINK_NICE 2
#define DRINK_GOOD 3
#define DRINK_VERYGOOD 4
#define DRINK_FANTASTIC 5

/// Food is "in a container", not in a code sense, but in a literal sense (canned foods)
#define FOOD_IN_CONTAINER (1<<0)
/// Finger food can be eaten while walking / running around
#define FOOD_FINGER_FOOD (1<<1)

#define STOP_SERVING_BREAKFAST (15 MINUTES)

///Amount of reagents you start with on crafted food excluding the used parts
#define CRAFTED_FOOD_BASE_REAGENT_MODIFIER 0.7
///Modifier of reagents you get when crafting food from the parts used
#define CRAFTED_FOOD_INGREDIENT_REAGENT_MODIFIER 0.5

#define IS_EDIBLE(O) (O.GetComponent(/datum/component/edible))
5 changes: 5 additions & 0 deletions code/__DEFINES/is_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,11 @@ GLOBAL_LIST_INIT(glass_sheet_types, typecacheof(list(

#define isshuttleturf(T) (length(T.baseturfs) && (/turf/baseturf_skipover/shuttle in T.baseturfs))

/// isnum() returns TRUE for NaN. Also, NaN != NaN. Checkmate, BYOND.
#define isnan(x) ( (x) != (x) )

#define isinf(x) (isnum((x)) && (((x) == SYSTEM_TYPE_INFINITY) || ((x) == -SYSTEM_TYPE_INFINITY)))

#define isProbablyWallMounted(O) (O.pixel_x > 20 || O.pixel_x < -20 || O.pixel_y > 20 || O.pixel_y < -20)

#define isbook(O) (is_type_in_typecache(O, GLOB.book_types))
Expand Down
3 changes: 3 additions & 0 deletions code/__DEFINES/processing.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#define TOOL_PROCESSING_RESULT "result"
#define TOOL_PROCESSING_AMOUNT "amount"
#define TOOL_PROCESSING_TIME "time"
22 changes: 12 additions & 10 deletions code/__DEFINES/reagents.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@
#define LIQUID 2
#define GAS 3

#define INJECTABLE (1<<0) // Makes it possible to add reagents through droppers and syringes.
#define DRAWABLE (1<<1) // Makes it possible to remove reagents through syringes.
#define INJECTABLE (1<<0) // Makes it possible to add reagents through droppers and syringes.
#define DRAWABLE (1<<1) // Makes it possible to remove reagents through syringes.

#define REFILLABLE (1<<2) // Makes it possible to add reagents through any reagent container.
#define DRAINABLE (1<<3) // Makes it possible to remove reagents through any reagent container.
#define DUNKABLE (1<<4) // Allows items to be dunked into this container for transfering reagents. Used in conjunction with the dunkable component.
#define REFILLABLE (1<<2) // Makes it possible to add reagents through any reagent container.
#define DRAINABLE (1<<3) // Makes it possible to remove reagents through any reagent container.
#define DUNKABLE (1<<4) // Allows items to be dunked into this container for transfering reagents. Used in conjunction with the dunkable component.

#define TRANSPARENT (1<<5) // Used on containers which you want to be able to see the reagents off.
#define AMOUNT_VISIBLE (1<<6) // For non-transparent containers that still have the general amount of reagents in them visible.
#define NO_REACT (1<<7) // Applied to a reagent holder, the contents will not react with each other.
#define TRANSPARENT (1<<5) // Used on containers which you want to be able to see the reagents off.
#define AMOUNT_VISIBLE (1<<6) // For non-transparent containers that still have the general amount of reagents in them visible.
#define NO_REACT (1<<7) // Applied to a reagent holder, the contents will not react with each other.

// Is an open container for all intents and purposes.
#define OPENCONTAINER (REFILLABLE | DRAINABLE | TRANSPARENT)
#define ABSOLUTELY_GRINDABLE (1<<8) //! used in 'All-In-One Grinder' that it can grind anything if it has this bitflag

/// Is an open container for all intents and purposes.
#define OPENCONTAINER (REFILLABLE | DRAINABLE | TRANSPARENT)


#define TOUCH 1 // splashing
Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#define TOOL_DRILL "drill"
#define TOOL_SCALPEL "scalpel"
#define TOOL_SAW "saw"
#define TOOL_KNIFE "knife"

// If delay between the start and the end of tool operation is less than MIN_TOOL_SOUND_DELAY,
// tool sound is only played when op is started. If not, it's played twice.
Expand Down
21 changes: 11 additions & 10 deletions code/__HELPERS/string_assoc_lists.dm
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
GLOBAL_LIST_EMPTY(string_assoc_lists)


/**
* Caches associative lists with non-numeric stringify-able index keys and stringify-able values (text/typepath -> text/path/number).
*/
* Caches associative lists with non-numeric stringify-able index keys and stringify-able values (text/typepath -> text/path/number).
*/
/datum/proc/string_assoc_list(list/values)
var/list/string_id = list()
for(var/val in values)
string_id += "[val]_[values[val]]"
string_id = string_id.Join("-")
var/list/string_id = list()
for(var/val in values)
string_id += "[val]_[values[val]]"
string_id.Join("-")

. = GLOB.string_assoc_lists[string_id]
. = GLOB.string_assoc_lists[string_id]

if(.)
return
if(.)
return

return GLOB.string_assoc_lists[string_id] = values
return GLOB.string_assoc_lists[string_id] = values
14 changes: 14 additions & 0 deletions code/__HELPERS/string_lists.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
GLOBAL_LIST_EMPTY(string_lists)

/**
* Caches lists with non-numeric stringify-able values (text or typepath).
*/
/datum/proc/string_list(list/values)
var/string_id = values.Join("-")

. = GLOB.string_lists[string_id]

if(.)
return

return GLOB.string_lists[string_id] = values
GLOBAL_LIST_EMPTY(string_lists)

/**
* Caches lists with non-numeric stringify-able values (text or typepath).
*/
Expand Down
Loading

0 comments on commit a3096ac

Please sign in to comment.