Skip to content

Commit

Permalink
Egg Rebalance (discordia-space#8381)
Browse files Browse the repository at this point in the history
* all eggs fertile until limit met
can use light source to determine egg growth level

* flames now also work to reveal eggs

* adds chicken fertility formula

* Update code/modules/reagents/reagent_containers/food/snacks.dm

---------

Co-authored-by: hyperioo <[email protected]>
  • Loading branch information
vode-code and hyperioo authored Feb 2, 2024
1 parent 6c47e03 commit fe12eea
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@
qdel(src)

var/const/MAX_CHICKENS = 50
#define MEDIUM_CHICKENS 10
var/global/chicken_count = 0

/mob/living/simple_animal/chicken
Expand Down Expand Up @@ -247,8 +248,8 @@ var/global/chicken_count = 0
var/obj/item/reagent_containers/food/snacks/egg/E = new(get_turf(src))
E.pixel_x = rand(-6,6)
E.pixel_y = rand(-6,6)
if(chicken_count < MAX_CHICKENS && prob(10))
START_PROCESSING(SSobj, E)
if(chicken_count < MEDIUM_CHICKENS || prob(clamp((100/MAX_CHICKENS)*(MAX_CHICKENS-chicken_count), 0, 100)))
START_PROCESSING(SSobj, E) // chicken threshold, then chicken ratio, then number of chickens to create


/obj/item/reagent_containers/food/snacks/egg/var/amount_grown = 0
Expand Down
28 changes: 27 additions & 1 deletion code/modules/reagents/reagent_containers/food/snacks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,7 @@
center_of_mass = list("x"=16, "y"=13)
preloaded_reagents = list("egg" = 3)
price_tag = 5
description_info = "Can have a flashlight used on it to determine if there is a chick inside."

/obj/item/reagent_containers/food/snacks/egg/afterattack(obj/O as obj, mob/user as mob, proximity)
if(istype(O,/obj/machinery/microwave))
Expand Down Expand Up @@ -699,7 +700,32 @@
to_chat(user, SPAN_NOTICE("You color \the [src] [clr]"))
icon_state = "egg-[clr]"
else
..()
var/valid = FALSE
if (istype(W, /obj/item/device/lighting))
var/obj/item/device/lighting/light = W
if(!light.on)
to_chat(usr, SPAN_WARNING("[W] needs to be turned on to reveal the egg's insides."))
return
valid = TRUE

else if (istype(W, /obj/item/flame))
var/obj/item/flame/fire = W
if(!fire.lit)
to_chat(usr, SPAN_WARNING("[W] needs to be aflame to reveal the egg's insides."))
return
valid = TRUE
if(valid)
switch(amount_grown)
if(0 to 10)
to_chat(usr, SPAN_NOTICE("[src] appears to be a normal egg."))
if(10 to 50)
to_chat(usr, SPAN_NOTICE("[src] contains a spidery red mass."))
if(50 to 90)
to_chat(usr, SPAN_NOTICE("[src] contains a partially-grown chick."))
if(90 to 100)
to_chat(usr, SPAN_NOTICE("[src] contains a partially-grown chick.\nYou hear a faint tapping emanating from \the [src]."))
else
..()

/obj/item/reagent_containers/food/snacks/egg/blue
icon_state = "egg-blue"
Expand Down

0 comments on commit fe12eea

Please sign in to comment.