Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Добавление напитка богов (кваса) в игру #1325

Merged
merged 6 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions modular_ss220/food/code/drinks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
icon = initial(icon)
return
var/datum/reagent/reagent = reagents.get_master_reagent()
if(!istype(reagent, /datum/reagent/consumable/ethanol))
if(!istype(reagent, /datum/reagent/consumable))
icon = initial(icon)
return
var/datum/reagent/consumable/ethanol/booze = reagent
icon = booze.drinking_glass_icon
else
var/datum/reagent/consumable/drink = reagent
icon = drink.drinking_glass_icon
if(!reagent.drink_icon)
icon_state = "glass_empty"

/datum/reagent/consumable/ethanol
/datum/reagent/consumable
var/drinking_glass_icon = 'icons/obj/drinks.dmi'

/obj/machinery/chem_dispenser/beer/Initialize(mapload)
Expand Down
63 changes: 63 additions & 0 deletions modular_ss220/kvass/kvass.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/datum/modpack/devices
name = "Kvass drinks"
desc = "Добавляет в игру 2 вида кваса и рецепт для их приготовления"
author = "ThaumicNik"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ты шо, шизик? Есть же уже модуль с напитками

/datum/reagent/consumable/ethanol/kvass
name = "Alcoholic Kvass"
id = "alco_kvass"
description = "Алкогольный напиток, полученный путём ферментации хлеба"
color = "#775a1c"
nutriment_factor = 1 * REAGENTS_METABOLISM
alcohol_perc = 0.3
drink_icon = "alco_kvass"
drinking_glass_icon = 'modular_ss220/kvass/kvass.dmi'
drink_name = "Стакан алкогольного кваса"
drink_desc = "Освежающий горьковато-сладкий напиток прямиком из СССП"
taste_description = "квас"

/datum/reagent/consumable/drink/kvass
name = "Kvass"
id = "kvass"
description = "Квас без алкоголя. Что отличает его от обычной газировки?"
color = "#574113"
adj_sleepy = -4 SECONDS
drink_icon = "kvass"
drinking_glass_icon = 'modular_ss220/kvass/kvass.dmi'
drink_name = "Стакан безалкогольного кваса"
drink_desc = "Квас без алкоголя. Освежает, но по вкусу как-то... блекло?"
harmless = FALSE
taste_description = "скучный квас"

/datum/chemical_reaction/kvass
name = "Kvass"
id = "kvass"
result = "kvass"
required_reagents = list("alco_kvass" = 5, "antihol" = 1)
result_amount = 5
mix_sound = 'sound/goonstation/misc/drinkfizz.ogg'

// fermenting_barrel don't have behavior for non-plant food, so we need some proc for bread
/obj/structure/fermenting_barrel/proc/make_drink(var/obj/item/I, var/drink_id, var/amount)

Check failure on line 41 in modular_ss220/kvass/kvass.dm

View workflow job for this annotation

GitHub Actions / Run Linters

Check Grep

modular_ss220/kvass/kvass.dm:41: Changed files contains a proc argument starting with 'var'.
reagents.add_reagent(drink_id, amount)
qdel(I)
playsound(src, 'sound/effects/bubbles.ogg', 50, TRUE)

/obj/structure/fermenting_barrel/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/food/snacks/sliceable/bread))
if(!user.drop_item())
to_chat(user, "<span class='warning'>[I] is stuck to your hand!</span>")
return FALSE
I.forceMove(src)
to_chat(user, "<span class='notice'>You place [I] into [src] to start the fermentation process.</span>")
addtimer(CALLBACK(src, PROC_REF(make_drink), I, "alco_kvass", 35), rand(80, 120) * speed_multiplier)
return
return ..()

/obj/machinery/chem_dispenser/soda/Initialize(mapload)
dispensable_reagents += "kvass"
return ..()

/obj/item/handheld_chem_dispenser/soda/Initialize(mapload)
dispensable_reagents += "kvass"
return ..()
1 change: 1 addition & 0 deletions modular_ss220/kvass/kvass.dme
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "kvass.dm"
Binary file added modular_ss220/kvass/kvass.dmi
Binary file not shown.
57 changes: 57 additions & 0 deletions modular_ss220/kvass/reagents.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/datum/reagent/consumable/ethanol/kvass
name = "Alcoholic Kvass"
id = "alco_kvass"
description = "Алкогольный напиток, полученный путём ферментации хлеба"
color = "#775a1c"
nutriment_factor = 1 * REAGENTS_METABOLISM
alcohol_perc = 0.3
drink_icon = "alco_kvass"
drinking_glass_icon = 'modular_ss220/kvass/kvass.dmi'
drink_name = "Стакан алкогольного кваса"
drink_desc = "Освежающий горьковато-сладкий напиток прямиком из СССП"
taste_description = "квас"

/datum/reagent/consumable/drink/kvass
name = "Kvass"
id = "kvass"
description = "Квас без алкоголя. Чем это отличает его от обычной газировки?"
color = "#574113"
adj_sleepy = -4 SECONDS
drink_icon = "kvass"
drinking_glass_icon = 'modular_ss220/kvass/kvass.dmi'
drink_name = "Стакан безалкогольного кваса"
drink_desc = "Квас без алкоголя. Освежает, но по вкусу как-то... блекло?"
harmless = FALSE
taste_description = "скучный квас"

/datum/chemical_reaction/kvass
name = "Kvass"
id = "kvass"
result = "kvass"
required_reagents = list("alco_kvass" = 5, "antihol" = 1)
result_amount = 5
mix_sound = 'sound/goonstation/misc/drinkfizz.ogg'

// fermenting_barrel don't have behavior for non-plant food, so we need some proc for bread
/obj/structure/fermenting_barrel/proc/make_drink(var/item/I, var/drink_id, var/amount)

Check failure on line 36 in modular_ss220/kvass/reagents.dm

View workflow job for this annotation

GitHub Actions / Run Linters

Check Grep

modular_ss220/kvass/reagents.dm:36: Changed files contains a proc argument starting with 'var'.
reagents.add_reagent(drink_id, amount)
qdel(I)
playsound(src, 'sound/effects/bubbles.ogg', 50, TRUE)

/obj/structure/fermenting_barrel/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/food/snacks/sliceable/bread))
if(!user.drop_item())
to_chat(user, "<span class='warning'>[I] is stuck to your hand!</span>")
return FALSE
G.forceMove(src)
to_chat(user, "<span class='notice'>You place [I] into [src] to start the fermentation process.</span>")
addtimer(CALLBACK(src, PROC_REF(make_drink), I, "alco_kvass", 35), rand(80, 120) * speed_multiplier)
return ..()

/obj/machinery/chem_dispenser/soda/Initialize(mapload)
dispensable_reagents += "kvass"
return ..()

/obj/item/handheld_chem_dispenser/soda/Initialize(mapload)
dispensable_reagents += "kvass"
return ..()
1 change: 1 addition & 0 deletions modular_ss220/modular_ss220.dme
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
#include "antagonists/_antagonists.dme"
#include "uplink_items/_uplink_items.dme"
#include "shuttles/_shuttles.dme"
#include "kvass/kvass.dme"

// --- PRIME --- //
// #define MODPACK_MAIN_ONLY
Expand Down
Loading