Skip to content

Commit

Permalink
/obj/item/reagent_container is Initialize (ParadiseSS13#18555)
Browse files Browse the repository at this point in the history
  • Loading branch information
moxian authored Aug 5, 2022
1 parent bad1ec7 commit e639b8a
Show file tree
Hide file tree
Showing 24 changed files with 96 additions and 93 deletions.
4 changes: 2 additions & 2 deletions code/game/objects/items/contraband.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
name = "pill"
desc = "A cocktail of illicit designer drugs, who knows what might be in here."

/obj/item/reagent_containers/food/pill/random_drugs/New()
..()
/obj/item/reagent_containers/food/pill/random_drugs/Initialize(mapload)
. = ..()
icon_state = "pill" + pick("2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20")

name = "[pick_list("chemistry_tools.json", "CYBERPUNK_drug_prefixes")] [pick_list("chemistry_tools.json", "CYBERPUNK_drug_suffixes")]"
Expand Down
20 changes: 10 additions & 10 deletions code/game/objects/items/random_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
name = "unlabelled bottle"
// identify_probability = 0

/obj/item/reagent_containers/glass/bottle/random_reagent/New()
..()
/obj/item/reagent_containers/glass/bottle/random_reagent/Initialize(mapload)
. = ..()
var/list/possible_chems = GLOB.chemical_reagents_list.Copy()
possible_chems -= GLOB.blocked_chems.Copy()
var/datum/reagent/R = pick(possible_chems)
Expand All @@ -62,8 +62,8 @@
name = "unlabelled chemical bottle"
// identify_probability = 0

/obj/item/reagent_containers/glass/bottle/random_chem/New()
..()
/obj/item/reagent_containers/glass/bottle/random_chem/Initialize(mapload)
. = ..()
var/R = get_random_reagent_id()
if(GLOB.rare_chemicals.Find(R))
reagents.add_reagent(R, 10)
Expand All @@ -77,8 +77,8 @@
name = "unlabelled chemical bottle"
// identify_probability = 0

/obj/item/reagent_containers/glass/bottle/random_base_chem/New()
..()
/obj/item/reagent_containers/glass/bottle/random_base_chem/Initialize(mapload)
. = ..()
var/datum/reagent/R = pick(GLOB.base_chemicals)
reagents.add_reagent(R, rand(2, 6)*5)
name = "unlabelled bottle"
Expand All @@ -89,8 +89,8 @@
name = "unlabelled drink"
icon = 'icons/obj/drinks.dmi'

/obj/item/reagent_containers/food/drinks/bottle/random_drink/New()
..()
/obj/item/reagent_containers/food/drinks/bottle/random_drink/Initialize(mapload)
. = ..()
var/list/possible_drinks = GLOB.drinks.Copy()
if(prob(50))
possible_drinks += list("pancuronium","lsd","omnizine","blood")
Expand All @@ -106,8 +106,8 @@
name = "unlabelled drink?"
icon = 'icons/obj/drinks.dmi'

/obj/item/reagent_containers/food/drinks/bottle/random_reagent/New()
..()
/obj/item/reagent_containers/food/drinks/bottle/random_reagent/Initialize(mapload)
. = ..()

var/R = get_random_reagent_id()
if(GLOB.rare_chemicals.Find(R))
Expand Down
4 changes: 2 additions & 2 deletions code/modules/awaymissions/mission_code/UO71-terrorspiders.dm
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@
/obj/item/reagent_containers/glass/beaker/terror_black_toxin
name = "beaker 'Black Terror Venom'"

/obj/item/reagent_containers/glass/beaker/terror_black_toxin/New()
..()
/obj/item/reagent_containers/glass/beaker/terror_black_toxin/Initialize(mapload)
. = ..()
reagents.add_reagent("terror_black_toxin", 50)
update_icon()

Expand Down
22 changes: 11 additions & 11 deletions code/modules/fish/fish_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -80,24 +80,24 @@
icon = 'icons/obj/food/seafood.dmi'
icon_state = "shrimp_raw"
filling_color = "#FF1C1C"
bitesize = 1

/obj/item/reagent_containers/food/snacks/shrimp/New()
..()
/obj/item/reagent_containers/food/snacks/shrimp/Initialize(mapload)
. = ..()
desc = pick("Anyway, like I was sayin', shrimp is the fruit of the sea.", "You can barbecue it, boil it, broil it, bake it, saute it.")
reagents.add_reagent("protein", 1)
src.bitesize = 1

/obj/item/reagent_containers/food/snacks/feederfish
name = "feeder fish"
desc = "A tiny feeder fish. Sure doesn't look very filling..."
icon = 'icons/obj/food/seafood.dmi'
icon_state = "feederfish"
filling_color = "#FF1C1C"
bitesize = 1

/obj/item/reagent_containers/food/snacks/shrimp/New()
..()
/obj/item/reagent_containers/food/snacks/feederfish/Initialize(mapload)
. = ..()
reagents.add_reagent("protein", 1)
src.bitesize = 1

/obj/item/fish
name = "fish"
Expand All @@ -117,9 +117,9 @@
desc = "A small bio-luminescent fish. Not very bright, but at least it's pretty!"
icon_state = "glofish"

/obj/item/fish/glofish/New()
..()
set_light(2,1,"#99FF66")
/obj/item/fish/glofish/Initialize(mapload)
. = ..()
set_light(2, 1, "#99FF66")

/obj/item/fish/electric_eel
name = "electric eel"
Expand Down Expand Up @@ -157,8 +157,8 @@
throwforce = 5.0
materials = list()

/obj/item/shard/shark_teeth/New()
..()
/obj/item/shard/shark_teeth/Initialize(mapload)
. = ..()
src.pixel_x = rand(-5,5)
src.pixel_y = rand(-5,5)

Expand Down
12 changes: 6 additions & 6 deletions code/modules/food_and_drinks/drinks/drinks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
antable = FALSE
var/chugging = FALSE

/obj/item/reagent_containers/food/drinks/New()
..()
/obj/item/reagent_containers/food/drinks/Initialize(mapload)
. = ..()
pixel_x = rand(-5, 5)
pixel_y = rand(-5, 5)
bitesize = amount_per_transfer_from_this
Expand Down Expand Up @@ -191,8 +191,8 @@
item_state = "coffee"
list_reagents = list("tea" = 30)

/obj/item/reagent_containers/food/drinks/tea/New()
..()
/obj/item/reagent_containers/food/drinks/tea/Initialize(mapload)
. = ..()
if(prob(20))
reagents.add_reagent("mugwort", 3)

Expand Down Expand Up @@ -232,8 +232,8 @@
item_state = "ramen"
list_reagents = list("dry_ramen" = 30)

/obj/item/reagent_containers/food/drinks/dry_ramen/New()
..()
/obj/item/reagent_containers/food/drinks/dry_ramen/Initialize(mapload)
. = ..()
if(prob(20))
reagents.add_reagent("enzyme", 3)

Expand Down
4 changes: 2 additions & 2 deletions code/modules/food_and_drinks/drinks/drinks/mugs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@
description = "So mesmerizing!"
state = "mug_rainbow"

/obj/item/reagent_containers/food/drinks/mug/New()
..()
/obj/item/reagent_containers/food/drinks/mug/Initialize(mapload)
. = ..()
if(preset)
return
if(novelty)
Expand Down
20 changes: 10 additions & 10 deletions code/modules/food_and_drinks/food/foods/baked_goods.dm
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,8 @@
list_reagents = list("nutriment" = 10, "vitamin" = 2)
tastes = list("pie" = 1, "mushroom" = 1)

/obj/item/reagent_containers/food/snacks/plump_pie/New()
..()
/obj/item/reagent_containers/food/snacks/plump_pie/Initialize(mapload)
. = ..()
if(prob(10))
name = "exceptional plump pie"
desc = "Microwave is taken by a fey mood! It has cooked an exceptional plump pie!" // What
Expand Down Expand Up @@ -375,8 +375,8 @@
var/donut_sprite_type = DONUT_NORMAL
tastes = list("donut" = 1)

/obj/item/reagent_containers/food/snacks/donut/New()
..()
/obj/item/reagent_containers/food/snacks/donut/Initialize(mapload)
. = ..()
if(randomized_sprinkles && prob(30))
icon_state = "donut2"
name = "frosted donut"
Expand All @@ -398,8 +398,8 @@
bitesize = 10
tastes = list("donut" = 3, "chaos" = 1)

/obj/item/reagent_containers/food/snacks/donut/chaos/New()
..()
/obj/item/reagent_containers/food/snacks/donut/chaos/Initialize(mapload)
. = ..()
extra_reagent = pick("nutriment", "capsaicin", "frostoil", "krokodil", "plasma", "cocoa", "slimejelly", "banana", "berryjuice", "omnizine")
reagents.add_reagent("[extra_reagent]", 3)
if(prob(30))
Expand All @@ -415,8 +415,8 @@
extra_reagent = "berryjuice"
tastes = list("jelly" = 1, "donut" = 3)

/obj/item/reagent_containers/food/snacks/donut/jelly/New()
..()
/obj/item/reagent_containers/food/snacks/donut/jelly/Initialize(mapload)
. = ..()
if(extra_reagent)
reagents.add_reagent("[extra_reagent]", 3)
if(prob(30))
Expand Down Expand Up @@ -500,8 +500,8 @@
list_reagents = list("nutriment" = 5)
tastes = list("mushroom" = 1, "biscuit" = 1)

/obj/item/reagent_containers/food/snacks/plumphelmetbiscuit/New()
..()
/obj/item/reagent_containers/food/snacks/plumphelmetbiscuit/Initialize(mapload)
. = ..()
if(prob(10))
name = "exceptional plump helmet biscuit"
desc = "Microwave is taken by a fey mood! It has cooked an exceptional plump helmet biscuit!" // Is this a reference?
Expand Down
4 changes: 2 additions & 2 deletions code/modules/food_and_drinks/food/foods/candy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
filling_color = "#7D5F46"
list_reagents = list("nutriment" = 3, "sugar" = 3)

/obj/item/reagent_containers/food/snacks/candy/taffy/New()
..()
/obj/item/reagent_containers/food/snacks/candy/taffy/Initialize(mapload)
. = ..()
icon_state = pick("candy1", "candy2", "candy3", "candy4", "candy5")

/obj/item/reagent_containers/food/snacks/candy/fudge
Expand Down
4 changes: 2 additions & 2 deletions code/modules/food_and_drinks/food/foods/desserts.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
list_reagents = list("nutriment" = 1, "sugar" = 1)
tastes = list("ice cream" = 1)

/obj/item/reagent_containers/food/snacks/icecream/New()
..()
/obj/item/reagent_containers/food/snacks/icecream/Initialize(mapload)
. = ..()
update_icon(UPDATE_OVERLAYS)

/obj/item/reagent_containers/food/snacks/icecream/update_overlays()
Expand Down
12 changes: 8 additions & 4 deletions code/modules/food_and_drinks/food/foods/meat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,14 @@
list_reagents = list("nutriment" = 4, "porktonium" = 10)
tastes = list("bacon" = 1)

/obj/item/reagent_containers/food/snacks/telebacon/New()
..()
/obj/item/reagent_containers/food/snacks/telebacon/Initialize(mapload)
. = ..()
baconbeacon = new /obj/item/radio/beacon/bacon(src)

/obj/item/reagent_containers/food/snacks/telebacon/Destroy()
QDEL_NULL(baconbeacon)
return ..()

/obj/item/reagent_containers/food/snacks/telebacon/On_Consume(mob/M, mob/user)
if(!reagents.total_volume)
baconbeacon.forceMove(user)
Expand Down Expand Up @@ -408,8 +412,8 @@
/obj/item/reagent_containers/food/snacks/egg/gland
desc = "An egg! It looks weird..."

/obj/item/reagent_containers/food/snacks/egg/gland/New()
..()
/obj/item/reagent_containers/food/snacks/egg/gland/Initialize(mapload)
. = ..()
reagents.add_reagent(get_random_reagent_id(), 15)

var/reagent_color = mix_color_from_reagents(reagents.reagent_list)
Expand Down
4 changes: 2 additions & 2 deletions code/modules/food_and_drinks/food/foods/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@
list_reagents = list("nutriment" = 2)
tastes = list("popcorn" = 3, "butter" = 1)

/obj/item/reagent_containers/food/snacks/popcorn/New()
..()
/obj/item/reagent_containers/food/snacks/popcorn/Initialize(mapload)
. = ..()
unpopped = rand(1,10)

/obj/item/reagent_containers/food/snacks/popcorn/On_Consume(mob/M, mob/user)
Expand Down
12 changes: 6 additions & 6 deletions code/modules/food_and_drinks/food/foods/soups.dm
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@
list_reagents = list("nutriment" = 6)
tastes = list("chaos" = 1)

/obj/item/reagent_containers/food/snacks/soup/mysterysoup/New()
..()
/obj/item/reagent_containers/food/snacks/soup/mysterysoup/Initialize(mapload)
. = ..()
extra_reagent = pick("capsaicin", "frostoil", "omnizine", "banana", "blood", "slimejelly", "toxin", "banana", "carbon", "oculine")
reagents.add_reagent("[extra_reagent]", 5)

Expand All @@ -81,8 +81,8 @@
list_reagents = list("water" = 10)
tastes = list("wishes" = 1)

/obj/item/reagent_containers/food/snacks/soup/wishsoup/New()
..()
/obj/item/reagent_containers/food/snacks/soup/wishsoup/Initialize(mapload)
. = ..()
if(prob(25))
desc = "A wish come true!" // hue
reagents.add_reagent("nutriment", 9)
Expand Down Expand Up @@ -119,8 +119,8 @@
list_reagents = list("nutriment" = 7, "vitamin" = 2)
tastes = list("beet" = 1)

/obj/item/reagent_containers/food/snacks/soup/beetsoup/New()
..()
/obj/item/reagent_containers/food/snacks/soup/beetsoup/Initialize(mapload)
. = ..()
name = pick("borsch", "bortsch", "borstch", "borsh", "borshch", "borscht")


Expand Down
8 changes: 4 additions & 4 deletions code/modules/food_and_drinks/food/snacks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -275,11 +275,11 @@
filling_color = "#211F02"
list_reagents = list("????" = 30)

/obj/item/reagent_containers/food/snacks/badrecipe/New()
..()
/obj/item/reagent_containers/food/snacks/badrecipe/Initialize(mapload)
. = ..()
// it's burned! it should start off being classed as any cooktype that burns
cooktype["grilled"] = 1
cooktype["deep fried"] = 1
cooktype["grilled"] = TRUE
cooktype["deep fried"] = TRUE

// MISC

Expand Down
2 changes: 1 addition & 1 deletion code/modules/food_and_drinks/kitchen_machinery/cooker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
setRegents(I, newfood)
if(istype(I, /obj/item/reagent_containers/food/snacks))
setCooked(I, newfood)
newfood.cooktype[thiscooktype] = 1
newfood.cooktype[thiscooktype] = TRUE
turnoff(I)
//qdel(I)

Expand Down
4 changes: 2 additions & 2 deletions code/modules/hydroponics/beekeeping/honeycomb.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
list_reagents = list("honey" = 5)
var/honey_color = ""

/obj/item/reagent_containers/honeycomb/New()
..()
/obj/item/reagent_containers/honeycomb/Initialize(mapload)
. = ..()
pixel_x = rand(8,-8)
pixel_y = rand(8,-8)
update_icon(UPDATE_OVERLAYS)
Expand Down
6 changes: 3 additions & 3 deletions code/modules/hydroponics/grown.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
resistance_flags = FLAMMABLE
origin_tech = "biotech=1"

/obj/item/reagent_containers/food/snacks/grown/New(newloc, obj/item/seeds/new_seed = null)
..()
/obj/item/reagent_containers/food/snacks/grown/Initialize(mapload, obj/item/seeds/new_seed = null)
. = ..()
if(!tastes)
tastes = list("[name]" = 1)

Expand All @@ -38,7 +38,7 @@

if(seed)
for(var/datum/plant_gene/trait/T in seed.genes)
T.on_new(src, newloc)
T.on_new(src)
seed.prepare_result(src)
transform *= TRANSFORM_USING_VARIABLE(seed.potency, 100) + 0.5 //Makes the resulting produce's sprite larger or smaller based on potency!
add_juice()
Expand Down
Loading

0 comments on commit e639b8a

Please sign in to comment.