Skip to content

Commit

Permalink
Fix trader herbs/plants not giving extractable reagents (goonstation#…
Browse files Browse the repository at this point in the history
  • Loading branch information
pgmzeta authored Dec 23, 2024
1 parent 9727252 commit cdb6257
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 59 deletions.
69 changes: 51 additions & 18 deletions code/modules/economy/commodity.dm
Original file line number Diff line number Diff line change
Expand Up @@ -425,83 +425,116 @@
desc = "Illegal drugs."
onmarket = 0

/// these are things that you can sell to the traders
// these have two separate subtypes because herbs need separate spawnable types for reagents

/datum/commodity/drugs/poppies
// traders buy these from players

/datum/commodity/drugs/buy/poppies
comname = "Poppies"
comtype = /obj/item/plant/herb/poppy
price = PAY_UNTRAINED

/datum/commodity/drugs/shrooms
/datum/commodity/drugs/buy/shrooms
comname = "Psilocybin"
comtype = /obj/item/reagent_containers/food/snacks/mushroom/psilocybin
price = PAY_UNTRAINED

/datum/commodity/drugs/cannabis
/datum/commodity/drugs/buy/cannabis
comname = "Cannabis"
comtype = /obj/item/plant/herb/cannabis
price = PAY_UNTRAINED/2

/datum/commodity/drugs/cannabis_mega
/datum/commodity/drugs/buy/cannabis_mega
comname = "Rainbow Cannabis"
comtype = /obj/item/plant/herb/cannabis/mega
price = PAY_UNTRAINED

/datum/commodity/drugs/cannabis_white
/datum/commodity/drugs/buy/cannabis_white
comname = "White Cannabis"
comtype = /obj/item/plant/herb/cannabis/white
price = PAY_UNTRAINED

/datum/commodity/drugs/cannabis_omega
/datum/commodity/drugs/buy/cannabis_omega
comname = "Omega Cannabis"
comtype = /obj/item/plant/herb/cannabis/omega
price = PAY_TRADESMAN

///// things you can buy from the traders
// traders sell these to players


/datum/commodity/drugs/sell/cannabis_omega
comname = "Omega Cannabis"
comtype = /obj/item/plant/herb/cannabis/omega/spawnable
price = PAY_TRADESMAN

datum/commodity/drugs/sell/poppies
comname = "Poppies"
comtype = /obj/item/plant/herb/poppy/spawnable
price = PAY_UNTRAINED

/datum/commodity/drugs/sell/shrooms
comname = "Psilocybin"
comtype = /obj/item/reagent_containers/food/snacks/mushroom/psilocybin/spawnable
price = PAY_UNTRAINED

/datum/commodity/drugs/methamphetamine
/datum/commodity/drugs/sell/cannabis
comname = "Cannabis"
comtype = /obj/item/plant/herb/cannabis/spawnable
price = PAY_UNTRAINED/2

/datum/commodity/drugs/sell/cannabis_mega
comname = "Rainbow Cannabis"
comtype = /obj/item/plant/herb/cannabis/mega/spawnable
price = PAY_UNTRAINED

/datum/commodity/drugs/sell/cannabis_white
comname = "White Cannabis"
comtype = /obj/item/plant/herb/cannabis/white/spawnable
price = PAY_UNTRAINED

/datum/commodity/drugs/sell/methamphetamine
comname = "Methamphetamine (5x pills)"
comtype = /obj/item/storage/pill_bottle/methamphetamine
desc = "Methamphetamine is a highly effective and dangerous stimulant drug."
price = PAY_DOCTORATE*2

/datum/commodity/drugs/crank
/datum/commodity/drugs/sell/crank
comname = "Crank (5x pills)"
comtype = /obj/item/storage/pill_bottle/crank
desc = "A cheap and dirty stimulant drug, commonly used by space biker gangs."
price = PAY_DOCTORATE

/datum/commodity/drugs/bathsalts
/datum/commodity/drugs/sell/bathsalts
comname = "Bath Salts (5x pills)"
comtype = /obj/item/storage/pill_bottle/bathsalts
desc = "Sometimes packaged as a refreshing bathwater additive, these crystals are definitely not for human consumption."
price = PAY_EXECUTIVE*2

/datum/commodity/drugs/catdrugs
/datum/commodity/drugs/sell/catdrugs
comname = "Cat Drugs (5x pills)"
comtype = /obj/item/storage/pill_bottle/catdrugs
desc = "Uhh..."
price = PAY_DOCTORATE

/datum/commodity/drugs/morphine
/datum/commodity/drugs/sell/morphine
comname = "Morphine (1x syringe)"
comtype = /obj/item/reagent_containers/syringe/morphine
desc = "A strong but highly addictive opiate painkiller with sedative side effects."
price = PAY_DOCTORATE

/datum/commodity/drugs/krokodil
/datum/commodity/drugs/sell/krokodil
comname = "Krokodil (1x syringe)"
comtype = /obj/item/reagent_containers/syringe/krokodil
desc = "A sketchy homemade opiate often used by disgruntled Cosmonauts."
price = PAY_UNTRAINED

/datum/commodity/drugs/lsd
/datum/commodity/drugs/sell/lsd
comname = "LSD (1x patch)"
comtype = /obj/item/reagent_containers/patch/LSD
desc = "A highly potent hallucinogenic substance. Far out, maaaan."
price = PAY_UNTRAINED

/datum/commodity/drug/lsd_bee
/datum/commodity/drugs/sell/lsd_bee
comname = "LSBee (1x patch)"
comtype = /obj/item/reagent_containers/patch/lsd_bee
desc = "A highly potent hallucinogenic substance. It smells like honey."
Expand All @@ -513,7 +546,7 @@
desc = "A nugget of weapons grade uranium. Label says it's roughly 'size 5'."
price = PAY_IMPORTANT

/datum/commodity/drugs/cyberpunk
/datum/commodity/drugs/sell/cyberpunk
comname = "Designer Drugs (5x pills)"
comtype = /obj/item/storage/pill_bottle/cyberpunk
desc = "Who knows what you might get."
Expand Down Expand Up @@ -1950,7 +1983,7 @@
/datum/commodity/drugs/poppies/greg
comname = "Poppies"
desc = "In respect of those lost during the colonization of the frontier, we are now offering poppies."
comtype = /obj/item/plant/herb/poppy
comtype = /obj/item/plant/herb/poppy/spawnable
onmarket = 0
price = PAY_UNTRAINED

Expand Down
2 changes: 1 addition & 1 deletion code/modules/economy/requisition/rc_civilian.dm
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ ABSTRACT_TYPE(/datum/rc_entry/reagent/caterdrink)

/datum/rc_entry/item/cannabis
name = "cannabis"
commodity = /datum/commodity/drugs/cannabis
commodity = /datum/commodity/drugs/buy/cannabis
feemod = 420

/datum/rc_entry/reagent/glitter
Expand Down
26 changes: 13 additions & 13 deletions code/modules/economy/shady_robot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -66,22 +66,22 @@
/datum/commodity/contraband/ntso_uniform,
/datum/commodity/contraband/ntso_vest,
/datum/commodity/contraband/ntso_beret,
/datum/commodity/drugs/methamphetamine,
/datum/commodity/drugs/crank,
/datum/commodity/drugs/catdrugs,
/datum/commodity/drugs/morphine,
/datum/commodity/drugs/krokodil,
/datum/commodity/drugs/lsd,
/datum/commodity/drug/lsd_bee,
/datum/commodity/drugs/shrooms,
/datum/commodity/drugs/cannabis,
/datum/commodity/drugs/cannabis_mega,
/datum/commodity/drugs/cannabis_white,
/datum/commodity/drugs/cannabis_omega,
/datum/commodity/drugs/sell/methamphetamine,
/datum/commodity/drugs/sell/crank,
/datum/commodity/drugs/sell/catdrugs,
/datum/commodity/drugs/sell/morphine,
/datum/commodity/drugs/sell/krokodil,
/datum/commodity/drugs/sell/lsd,
/datum/commodity/drugs/sell/lsd_bee,
/datum/commodity/drugs/sell/shrooms,
/datum/commodity/drugs/sell/cannabis,
/datum/commodity/drugs/sell/cannabis_mega,
/datum/commodity/drugs/sell/cannabis_white,
/datum/commodity/drugs/sell/cannabis_omega,
/datum/commodity/produce/special/ghostchili,
/datum/commodity/contraband/secheadset,
/datum/commodity/medical/strange_reagent,
/datum/commodity/drugs/cyberpunk,
/datum/commodity/drugs/sell/cyberpunk,
/datum/commodity/contraband/swatmask,
/datum/commodity/contraband/briefcase,
/datum/commodity/bodyparts/heart,
Expand Down
61 changes: 34 additions & 27 deletions code/modules/economy/trader.dm
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,12 @@ ABSTRACT_TYPE(/obj/npc/trader/random)
picture = "generic.png"
angrynope = "Not right now..."
whotext = ""
///What base type do they buy/sell?
var/commercetype = null
///What do they buy (overrides commercetype)
var/buy_commercetype_override = null
///What do they sell (overrides commercetype)
var/sell_commercetype_override = null
var/list/possible_icon_states = list("welder")
var/list/descriptions = list("Broken", "ohgodwhy", "1800-coder")

Expand Down Expand Up @@ -729,8 +734,8 @@ ABSTRACT_TYPE(/obj/npc/trader/random)
var/items_for_sale = rand(5,8)
var/items_wanted = rand(2,5)

var/list/selltypes = typesof(commercetype)
var/list/buytypes = typesof(commercetype)
var/list/selltypes = typesof(sell_commercetype_override ? sell_commercetype_override : commercetype)
var/list/buytypes = typesof(buy_commercetype_override ? buy_commercetype_override : commercetype)

while(length(selltypes) > 0 && length(src.goods_sell) < items_for_sale)
var/pickedselltype = pick(selltypes)
Expand Down Expand Up @@ -774,6 +779,8 @@ ABSTRACT_TYPE(/obj/npc/trader/random)

/obj/npc/trader/random/drugs
commercetype = /datum/commodity/drugs
buy_commercetype_override = /datum/commodity/drugs/buy
sell_commercetype_override = /datum/commodity/drugs/sell
possible_icon_states = list("petbee","possum","bumblespider")
descriptions = list("off-brand pharmaceutical", "recreational chemicals")

Expand Down Expand Up @@ -1085,21 +1092,21 @@ ABSTRACT_TYPE(/obj/npc/trader/robot/robuddy)
src.goods_sell += new /datum/commodity/contraband/ntso_beret(src)
src.goods_sell += new /datum/commodity/contraband/ntso_vest(src)
src.goods_sell += new /datum/commodity/contraband/swatmask/NT(src)
src.goods_sell += new /datum/commodity/drugs/methamphetamine(src)
src.goods_sell += new /datum/commodity/drugs/crank(src)
src.goods_sell += new /datum/commodity/drugs/catdrugs(src)
src.goods_sell += new /datum/commodity/drugs/morphine(src)
src.goods_sell += new /datum/commodity/drugs/krokodil(src)
src.goods_sell += new /datum/commodity/drugs/lsd(src)
src.goods_sell += new /datum/commodity/drug/lsd_bee(src)
src.goods_sell += new /datum/commodity/drugs/sell/methamphetamine(src)
src.goods_sell += new /datum/commodity/drugs/sell/crank(src)
src.goods_sell += new /datum/commodity/drugs/sell/catdrugs(src)
src.goods_sell += new /datum/commodity/drugs/sell/morphine(src)
src.goods_sell += new /datum/commodity/drugs/sell/krokodil(src)
src.goods_sell += new /datum/commodity/drugs/sell/lsd(src)
src.goods_sell += new /datum/commodity/drugs/sell/lsd_bee(src)
src.goods_sell += new /datum/commodity/relics/bootlegfirework(src)
src.goods_sell += new /datum/commodity/pills/uranium(src)

src.goods_buy += new /datum/commodity/drugs/shrooms(src)
src.goods_buy += new /datum/commodity/drugs/cannabis(src)
src.goods_buy += new /datum/commodity/drugs/cannabis_mega(src)
src.goods_buy += new /datum/commodity/drugs/cannabis_white(src)
src.goods_buy += new /datum/commodity/drugs/cannabis_omega(src)
src.goods_buy += new /datum/commodity/drugs/buy/shrooms(src)
src.goods_buy += new /datum/commodity/drugs/buy/cannabis(src)
src.goods_buy += new /datum/commodity/drugs/buy/cannabis_mega(src)
src.goods_buy += new /datum/commodity/drugs/buy/cannabis_white(src)
src.goods_buy += new /datum/commodity/drugs/buy/cannabis_omega(src)

/obj/npc/trader/robot/robuddy/diner
name = "B.I.F.F."
Expand Down Expand Up @@ -1431,13 +1438,13 @@ ABSTRACT_TYPE(/obj/npc/trader/robot/robuddy)
//// sell list //////////////////////////////////////////
/////////////////////////////////////////////////////////
src.goods_sell += new /datum/commodity/pills/uranium(src)
src.goods_sell += new /datum/commodity/drugs/methamphetamine(src)
src.goods_sell += new /datum/commodity/drugs/crank(src)
src.goods_sell += new /datum/commodity/drugs/catdrugs(src)
src.goods_sell += new /datum/commodity/drugs/morphine(src)
src.goods_sell += new /datum/commodity/drugs/krokodil(src)
src.goods_sell += new /datum/commodity/drugs/lsd(src)
src.goods_sell += new /datum/commodity/drug/lsd_bee(src)
src.goods_sell += new /datum/commodity/drugs/sell/methamphetamine(src)
src.goods_sell += new /datum/commodity/drugs/sell/crank(src)
src.goods_sell += new /datum/commodity/drugs/sell/catdrugs(src)
src.goods_sell += new /datum/commodity/drugs/sell/morphine(src)
src.goods_sell += new /datum/commodity/drugs/sell/krokodil(src)
src.goods_sell += new /datum/commodity/drugs/sell/lsd(src)
src.goods_sell += new /datum/commodity/drugs/sell/lsd_bee(src)
src.goods_sell += new /datum/commodity/medical/ether(src)
src.goods_sell += new /datum/commodity/medical/toxin(src)
src.goods_sell += new /datum/commodity/medical/cyanide(src)
Expand All @@ -1447,12 +1454,12 @@ ABSTRACT_TYPE(/obj/npc/trader/robot/robuddy)
/////////////////////////////////////////////////////////
//// buy list ///////////////////////////////////////////
/////////////////////////////////////////////////////////
src.goods_buy += new /datum/commodity/drugs/poppies(src)
src.goods_buy += new /datum/commodity/drugs/shrooms(src)
src.goods_buy += new /datum/commodity/drugs/cannabis(src)
src.goods_buy += new /datum/commodity/drugs/cannabis_mega(src)
src.goods_buy += new /datum/commodity/drugs/cannabis_white(src)
src.goods_buy += new /datum/commodity/drugs/cannabis_omega(src)
src.goods_buy += new /datum/commodity/drugs/buy/poppies(src)
src.goods_buy += new /datum/commodity/drugs/buy/shrooms(src)
src.goods_buy += new /datum/commodity/drugs/buy/cannabis(src)
src.goods_buy += new /datum/commodity/drugs/buy/cannabis_mega(src)
src.goods_buy += new /datum/commodity/drugs/buy/cannabis_white(src)
src.goods_buy += new /datum/commodity/drugs/buy/cannabis_omega(src)
/////////////////////////////////////////////////////////

greeting= {"<i>A hand sticking out from a toilet waves in your direction.</i>"}
Expand Down
3 changes: 3 additions & 0 deletions code/modules/food_and_drink/snacks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1394,6 +1394,9 @@ ABSTRACT_TYPE(/obj/item/reagent_containers/food/snacks/soup)
food_color = "#A76933"
heal_amt = 1

/obj/item/reagent_containers/food/snacks/mushroom/psilocybin/spawnable
initial_reagents = list("psilocybin" = 40)

/obj/item/reagent_containers/food/snacks/mushroom/cloak
name = "space mushroom"
desc = "A mushroom cap of Space Fungus. It doesn't smell of anything."
Expand Down
5 changes: 5 additions & 0 deletions code/obj/item/plants.dm
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,11 @@ ABSTRACT_TYPE(/obj/item/plant/herb)
desc = "A distinctive red flower."
icon_state = "poppy"

/obj/item/plant/herb/poppy/spawnable
make_reagents()
src.create_reagents(85)
reagents.add_reagent("morphine", 40)

/obj/item/plant/herb/tea
name = "tea leaves"
crop_suffix = " leaves"
Expand Down

0 comments on commit cdb6257

Please sign in to comment.