Skip to content

Commit

Permalink
add: (added) pet bowl and feed (#4592)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rerik007 authored Apr 11, 2024
1 parent 5302b93 commit 97d959b
Show file tree
Hide file tree
Showing 9 changed files with 108 additions and 16 deletions.
4 changes: 4 additions & 0 deletions code/game/machinery/vending.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2298,6 +2298,8 @@
/obj/item/toy/pet_rock = 5,
/obj/item/pet_carrier/normal = 3,
/obj/item/pet_carrier = 5,
/obj/item/reagent_containers/food/condiment/animalfeed = 5,
/obj/item/reagent_containers/glass/pet_bowl = 3,
)

prices = list(
Expand All @@ -2316,6 +2318,8 @@
/obj/item/toy/pet_rock = 100,
/obj/item/pet_carrier/normal = 250,
/obj/item/pet_carrier = 100,
/obj/item/reagent_containers/food/condiment/animalfeed = 100,
/obj/item/reagent_containers/glass/pet_bowl = 50,
)

contraband = list(/obj/item/fish_eggs/babycarp = 5)
Expand Down
13 changes: 0 additions & 13 deletions code/modules/events/false_alarm.dm
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
/datum/event/falsealarm
announceWhen = 0
endWhen = 1

/datum/event/falsealarm/announce()
var/weight = pickweight(list(EVENT_LEVEL_MUNDANE = 60, EVENT_LEVEL_MODERATE = 30, EVENT_LEVEL_MAJOR = 10))
var/datum/event_container/container = SSevents.event_containers[weight]
var/datum/event/E = container.acquire_event()
var/datum/event/Event = new E
message_admins("False Alarm: [Event]")
Event.announce() //just announce it like it's happening
Event.kill() //do not process this event - no starts, no ticks, no ends

/datum/event/falsealarm
announceWhen = 0
endWhen = 1
Expand Down
11 changes: 11 additions & 0 deletions code/modules/food_and_drinks/food/condiment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -346,3 +346,14 @@
name = "hotsauce pack"
originalname = "hotsauce"
list_reagents = list("capsaicin" = 10)

/obj/item/reagent_containers/food/condiment/animalfeed
name = "pet food package"
desc = "Корм для домашних животных. Вы же точно не хотите это пробовать?.."
icon = 'icons/obj/pet_bowl.dmi'
icon_state = "pet_food"
volume = 80
list_reagents = list("afeed" = 80)

/obj/item/reagent_containers/food/condiment/animalfeed/on_reagent_change()
return
21 changes: 20 additions & 1 deletion code/modules/reagents/chemistry/reagents/food.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1118,5 +1118,24 @@
update_flags |= M.adjustFireLoss(-0.5, FALSE)
return ..() | update_flags

/datum/reagent/consumable/animal_feed
name = "Animal Feed"
id = "afeed"
description = "Food that pets are fed."
color = "#ac3308"
nutriment_factor = 2 * REAGENTS_METABOLISM
taste_description = "animal feed"


/datum/reagent/consumable/animal_feed/on_mob_life(mob/living/M)
var/update_flags = STATUS_UPDATE_NONE
if(isvulpkanin(M) || istajaran(M))
update_flags |= M.adjustBruteLoss(-0.25, FALSE)
update_flags |= M.adjustFireLoss(-0.25, FALSE)
M.AdjustDisgust(-5 SECONDS)
if(prob(2))
to_chat(M, span_notice("You feel delicious yummy snack taste!"))
else
M.AdjustDisgust(5 SECONDS)
if(prob(2))
to_chat(M, span_warning("Yuack! What a terrible taste!"))
return ..() | update_flags
63 changes: 63 additions & 0 deletions code/modules/reagents/reagent_containers/glass_containers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -420,3 +420,66 @@

/obj/item/reagent_containers/glass/beaker/waterbottle/large/empty
list_reagents = list()

/obj/item/reagent_containers/glass/pet_bowl
name = "pet bowl"
desc = "Миска под еду для любимых домашних животных!"
icon = 'icons/obj/pet_bowl.dmi'
icon_state = "petbowl"
item_state = "petbowl"
materials = list(MAT_METAL = 100, MAT_GLASS = 100)
w_class = WEIGHT_CLASS_NORMAL
amount_per_transfer_from_this = 15
possible_transfer_amounts = null
volume = 15
resistance_flags = FLAMMABLE
blocks_emissive = EMISSIVE_BLOCK_GENERIC
color = "#0085E5"

/obj/item/reagent_containers/glass/pet_bowl/Initialize(mapload)
. = ..()
update_icon(UPDATE_OVERLAYS)

/obj/item/reagent_containers/glass/pet_bowl/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/toy/crayon/spraycan))
var/obj/item/toy/crayon/spraycan/can = I
if(!can.capped && Adjacent(can, 1))
color = can.colour
update_icon(UPDATE_OVERLAYS)
return

return ..()

/obj/item/reagent_containers/glass/pet_bowl/on_reagent_change()
update_icon(UPDATE_OVERLAYS)

/obj/item/reagent_containers/glass/pet_bowl/update_overlays()
. = ..()
var/mutable_appearance/bowl_mask = mutable_appearance(icon = 'icons/obj/pet_bowl.dmi', icon_state = "colorable_overlay")
. += bowl_mask
var/mutable_appearance/bowl_nc_mask = mutable_appearance(icon = 'icons/obj/pet_bowl.dmi', icon_state = "nc_petbowl", appearance_flags = RESET_COLOR)
. += bowl_nc_mask
if(reagents.total_volume)
var/datum/reagent/feed = reagents.has_reagent("afeed")
if(feed && (feed.volume >= (reagents.total_volume - feed.volume)))
var/image/feed_overlay = image(icon = 'icons/obj/pet_bowl.dmi', icon_state = "petfood_5", layer = FLOAT_LAYER)
feed_overlay.appearance_flags = RESET_COLOR
switch(feed.volume)
if(6 to 10)
feed_overlay.icon_state = "petfood_10"
if(11 to 15)
feed_overlay.icon_state = "petfood_15"
. += feed_overlay
else
. += mutable_appearance(icon, "liquid_overlay", color = mix_color_from_reagents(reagents.reagent_list), appearance_flags = RESET_COLOR)

/obj/item/reagent_containers/glass/pet_bowl/attack_animal(mob/living/simple_animal/pet)
if(!pet.client || !pet.safe_respawn(pet, check_station_level = FALSE) || !reagents.total_volume)
return ..()
if(reagents.has_reagent("afeed", 1))
pet.heal_organ_damage(5, 5)
reagents.remove_reagent("afeed", 1)
playsound(pet.loc, 'sound/items/eatfood.ogg', rand(10, 30), TRUE)
else
reagents.remove_any(1)
playsound(pet.loc, 'sound/items/drink.ogg', rand(10, 30), TRUE)
12 changes: 10 additions & 2 deletions code/modules/research/designs/autolathe_designs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -228,21 +228,29 @@
category = list("initial", "Miscellaneous")

/datum/design/floorpainter
name = "Floor painter"
name = "Floor Painter"
id = "floor_painter"
build_type = AUTOLATHE
materials = list(MAT_METAL = 150, MAT_GLASS = 125)
build_path = /obj/item/floor_painter
category = list("initial", "Miscellaneous")

/datum/design/airlock_painter
name = "Airlock painter"
name = "Airlock Painter"
id = "airlock_painter"
build_type = AUTOLATHE
materials = list(MAT_METAL = 3000, MAT_GLASS = 1000)
build_path = /obj/item/airlock_painter
category = list("initial", "Miscellaneous")

/datum/design/pet_bowl
name = "Pet Bowl"
id = "pet_bowl"
build_type = AUTOLATHE
materials = list(MAT_METAL = 500, MAT_GLASS = 500)
build_path = /obj/item/reagent_containers/glass/pet_bowl
category = list("initial", "Miscellaneous")

/datum/design/metal
name = "Metal"
id = "metal"
Expand Down
Binary file modified icons/mob/inhands/items_lefthand.dmi
Binary file not shown.
Binary file modified icons/mob/inhands/items_righthand.dmi
Binary file not shown.
Binary file added icons/obj/pet_bowl.dmi
Binary file not shown.

0 comments on commit 97d959b

Please sign in to comment.