From dc76c98db2a1bcfb95e98d28957c84f2e31c963e Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Wed, 10 Feb 2021 12:55:43 +0100 Subject: [PATCH] [MIRROR] Changes to Regal Rats (#3253) * Changes to Regal Rats (#56145) Co-authored-by: Qustinnus Co-authored-by: Paul, Sendroiu * Changes to Regal Rats Co-authored-by: eeSPee Co-authored-by: Qustinnus Co-authored-by: Paul, Sendroiu --- code/__DEFINES/dcs/signals.dm | 2 + code/game/objects/items/food/misc.dm | 31 ++-- .../food_and_drinks/recipes/food_mixtures.dm | 2 +- .../recipes/tablecraft/recipes_bread.dm | 10 +- .../recipes/tablecraft/recipes_burger.dm | 12 +- .../recipes/tablecraft/recipes_cake.dm | 2 +- .../recipes/tablecraft/recipes_egg.dm | 2 +- .../recipes/tablecraft/recipes_meat.dm | 2 +- .../recipes/tablecraft/recipes_misc.dm | 20 +-- .../recipes/tablecraft/recipes_pastry.dm | 2 +- .../recipes/tablecraft/recipes_pizza.dm | 14 +- .../recipes/tablecraft/recipes_sandwich.dm | 4 +- .../recipes/tablecraft/recipes_soup.dm | 4 +- .../living/simple_animal/friendly/mouse.dm | 8 +- .../living/simple_animal/hostile/regalrat.dm | 140 ++++++++++-------- code/modules/power/cable.dm | 8 + code/modules/recycling/disposal/bin.dm | 27 ++++ 17 files changed, 181 insertions(+), 109 deletions(-) diff --git a/code/__DEFINES/dcs/signals.dm b/code/__DEFINES/dcs/signals.dm index 27b498a27bb..bf9252b6208 100644 --- a/code/__DEFINES/dcs/signals.dm +++ b/code/__DEFINES/dcs/signals.dm @@ -527,6 +527,8 @@ // /mob/living/simple_animal/hostile signals #define COMSIG_HOSTILE_ATTACKINGTARGET "hostile_attackingtarget" #define COMPONENT_HOSTILE_NO_ATTACK (1<<0) +///from base of mob/living/simple_animal/hostile/regalrat: (mob/living/simple_animal/hostile/regalrat/king) +#define COMSIG_RAT_INTERACT "rat_interaction" // /obj signals diff --git a/code/game/objects/items/food/misc.dm b/code/game/objects/items/food/misc.dm index f66fcb17733..c71de67a59a 100644 --- a/code/game/objects/items/food/misc.dm +++ b/code/game/objects/items/food/misc.dm @@ -1,32 +1,32 @@ ////////////////////////////////////////////OTHER//////////////////////////////////////////// -/obj/item/food/cheesewheel + +/obj/item/food/cheese/wheel name = "cheese wheel" desc = "A big wheel of delcious Cheddar." icon_state = "cheesewheel" food_reagents = list(/datum/reagent/consumable/nutriment = 10, /datum/reagent/consumable/nutriment/protein = 5, /datum/reagent/consumable/nutriment/vitamin = 5) //Hard cheeses contain about 25% protein w_class = WEIGHT_CLASS_NORMAL - tastes = list("cheese" = 1) - foodtypes = DAIRY + rat_heal = 35 -/obj/item/food/cheesewheel/Initialize() +/obj/item/food/cheese/wheel/Initialize() . = ..() AddComponent(/datum/component/food_storage) -/obj/item/food/cheesewheel/MakeProcessable() - AddElement(/datum/element/processable, TOOL_KNIFE, /obj/item/food/cheesewedge, 5, 30) +/obj/item/food/cheese/wheel/MakeProcessable() + AddElement(/datum/element/processable, TOOL_KNIFE, /obj/item/food/cheese, 5, 30) -/obj/item/food/royalcheese +/obj/item/food/cheese/royal name = "royal cheese" desc = "Ascend the throne. Consume the wheel. Feel the POWER." icon_state = "royalcheese" food_reagents = list(/datum/reagent/consumable/nutriment = 15, /datum/reagent/consumable/nutriment/vitamin = 5, /datum/reagent/gold = 20, /datum/reagent/toxin/mutagen = 5) w_class = WEIGHT_CLASS_BULKY - tastes = list("cheese" = 4, "royalty" = 1) - foodtypes = DAIRY + tastes = list("cheese" = 4, "royalty" = 1) + rat_heal = 70 -/obj/item/food/cheesewedge +/obj/item/food/cheese name = "cheese wedge" desc = "A wedge of delicious Cheddar. The cheese wheel it was cut from can't have gone far." icon_state = "cheesewedge" @@ -34,6 +34,17 @@ tastes = list("cheese" = 1) foodtypes = DAIRY w_class = WEIGHT_CLASS_SMALL + /// used to determine how much health rats/regal rats recover when they eat it. + var/rat_heal = 10 + +/obj/item/food/cheese/Initialize() + . = ..() + RegisterSignal(src, COMSIG_RAT_INTERACT, .proc/on_rat_eat) + +/obj/item/food/cheese/proc/on_rat_eat(mob/living/simple_animal/hostile/regalrat/king) + SIGNAL_HANDLER + + king.cheese_heal(src, rat_heal, "You eat [src], restoring some health.") /obj/item/food/watermelonslice name = "watermelon slice" diff --git a/code/modules/food_and_drinks/recipes/food_mixtures.dm b/code/modules/food_and_drinks/recipes/food_mixtures.dm index de0b313a3fb..b2aff2856ed 100644 --- a/code/modules/food_and_drinks/recipes/food_mixtures.dm +++ b/code/modules/food_and_drinks/recipes/food_mixtures.dm @@ -75,7 +75,7 @@ /datum/chemical_reaction/cheesewheel/on_reaction(datum/reagents/holder, created_volume) var/location = get_turf(holder.my_atom) for(var/i = 1, i <= created_volume, i++) - new /obj/item/food/cheesewheel(location) + new /obj/item/food/cheese/wheel(location) /datum/chemical_reaction/synthmeat required_reagents = list(/datum/reagent/blood = 5, /datum/reagent/medicine/cryoxadone = 1) diff --git a/code/modules/food_and_drinks/recipes/tablecraft/recipes_bread.dm b/code/modules/food_and_drinks/recipes/tablecraft/recipes_bread.dm index 6afa6919574..37d58749e1f 100644 --- a/code/modules/food_and_drinks/recipes/tablecraft/recipes_bread.dm +++ b/code/modules/food_and_drinks/recipes/tablecraft/recipes_bread.dm @@ -8,7 +8,7 @@ reqs = list( /obj/item/food/bread/plain = 1, /obj/item/food/meat/cutlet/plain = 3, - /obj/item/food/cheesewedge = 3 + /obj/item/food/cheese = 3 ) result = /obj/item/food/bread/meat subcategory = CAT_BREAD @@ -18,7 +18,7 @@ reqs = list( /obj/item/food/bread/plain = 1, /obj/item/food/meat/cutlet/xeno = 3, - /obj/item/food/cheesewedge = 3 + /obj/item/food/cheese = 3 ) result = /obj/item/food/bread/xenomeat subcategory = CAT_BREAD @@ -28,7 +28,7 @@ reqs = list( /obj/item/food/bread/plain = 1, /obj/item/food/meat/cutlet/spider = 3, - /obj/item/food/cheesewedge = 3 + /obj/item/food/cheese = 3 ) result = /obj/item/food/bread/spidermeat subcategory = CAT_BREAD @@ -49,7 +49,7 @@ reqs = list( /obj/item/food/bread/plain = 1, /obj/item/food/tofu = 3, - /obj/item/food/cheesewedge = 3 + /obj/item/food/cheese = 3 ) result = /obj/item/food/bread/tofu subcategory = CAT_BREAD @@ -59,7 +59,7 @@ reqs = list( /datum/reagent/consumable/milk = 5, /obj/item/food/bread/plain = 1, - /obj/item/food/cheesewedge = 2 + /obj/item/food/cheese = 2 ) result = /obj/item/food/bread/creamcheese subcategory = CAT_BREAD diff --git a/code/modules/food_and_drinks/recipes/tablecraft/recipes_burger.dm b/code/modules/food_and_drinks/recipes/tablecraft/recipes_burger.dm index d938013b713..dfffb5a68a3 100644 --- a/code/modules/food_and_drinks/recipes/tablecraft/recipes_burger.dm +++ b/code/modules/food_and_drinks/recipes/tablecraft/recipes_burger.dm @@ -77,7 +77,7 @@ reqs = list( /obj/item/food/fishmeat = 1, /obj/item/food/bun = 1, - /obj/item/food/cheesewedge = 1 + /obj/item/food/cheese = 1 ) result = /obj/item/food/burger/fish subcategory = CAT_BURGER @@ -222,7 +222,7 @@ reqs = list( /obj/item/food/patty/plain = 3, /obj/item/food/bun = 1, - /obj/item/food/cheesewedge = 2 + /obj/item/food/cheese = 2 ) result = /obj/item/food/burger/bigbite subcategory = CAT_BURGER @@ -234,7 +234,7 @@ /datum/reagent/consumable/blackpepper = 5, /obj/item/food/patty/plain = 5, /obj/item/food/grown/tomato = 4, - /obj/item/food/cheesewedge = 3, + /obj/item/food/cheese = 3, /obj/item/food/boiledegg = 1, /obj/item/food/meat/bacon = 1, /obj/item/food/bun = 1 @@ -324,7 +324,7 @@ reqs = list( /obj/item/food/patty/plain = 1, /obj/item/food/bun = 1, - /obj/item/food/cheesewedge = 1, + /obj/item/food/cheese = 1, ) result = /obj/item/food/burger/cheese subcategory = CAT_BURGER @@ -334,7 +334,7 @@ reqs = list( /obj/item/food/soylentgreen = 1, //two full meats worth. /obj/item/food/bun = 1, - /obj/item/food/cheesewedge = 2, + /obj/item/food/cheese = 2, ) result = /obj/item/food/burger/soylent subcategory = CAT_BURGER @@ -374,7 +374,7 @@ reqs = list( /obj/item/food/patty/plain = 2, /obj/item/food/bun = 1, - /obj/item/food/cheesewedge = 2, + /obj/item/food/cheese = 2, /obj/item/food/grown/chili = 1, /obj/item/food/grown/cabbage = 1, /obj/item/toy/crayon/green = 1, diff --git a/code/modules/food_and_drinks/recipes/tablecraft/recipes_cake.dm b/code/modules/food_and_drinks/recipes/tablecraft/recipes_cake.dm index 909a877de1f..d83f1b7526c 100644 --- a/code/modules/food_and_drinks/recipes/tablecraft/recipes_cake.dm +++ b/code/modules/food_and_drinks/recipes/tablecraft/recipes_cake.dm @@ -16,7 +16,7 @@ name = "Cheese cake" reqs = list( /obj/item/food/cake/plain = 1, - /obj/item/food/cheesewedge = 2 + /obj/item/food/cheese = 2 ) result = /obj/item/food/cake/cheese subcategory = CAT_CAKE diff --git a/code/modules/food_and_drinks/recipes/tablecraft/recipes_egg.dm b/code/modules/food_and_drinks/recipes/tablecraft/recipes_egg.dm index 3881d1aa47c..3a596fd777c 100644 --- a/code/modules/food_and_drinks/recipes/tablecraft/recipes_egg.dm +++ b/code/modules/food_and_drinks/recipes/tablecraft/recipes_egg.dm @@ -17,7 +17,7 @@ name = "Omelette" reqs = list( /obj/item/food/egg = 2, - /obj/item/food/cheesewedge = 2 + /obj/item/food/cheese = 2 ) result = /obj/item/food/omelette subcategory = CAT_EGG diff --git a/code/modules/food_and_drinks/recipes/tablecraft/recipes_meat.dm b/code/modules/food_and_drinks/recipes/tablecraft/recipes_meat.dm index 46301087907..e30bf757085 100644 --- a/code/modules/food_and_drinks/recipes/tablecraft/recipes_meat.dm +++ b/code/modules/food_and_drinks/recipes/tablecraft/recipes_meat.dm @@ -243,7 +243,7 @@ reqs = list( /obj/item/food/meat/cutlet = 2, /obj/item/food/grown/tomato = 1, - /obj/item/food/cheesewedge = 2, + /obj/item/food/cheese = 2, /obj/item/food/spaghetti = 1 ) result = /obj/item/food/lasagna diff --git a/code/modules/food_and_drinks/recipes/tablecraft/recipes_misc.dm b/code/modules/food_and_drinks/recipes/tablecraft/recipes_misc.dm index 7b6a73ebdb8..4d16537346c 100644 --- a/code/modules/food_and_drinks/recipes/tablecraft/recipes_misc.dm +++ b/code/modules/food_and_drinks/recipes/tablecraft/recipes_misc.dm @@ -54,7 +54,7 @@ time = 40 reqs = list( /obj/item/food/grown/potato = 1, - /obj/item/food/cheesewedge = 1 + /obj/item/food/cheese = 1 ) result = /obj/item/food/loadedbakedpotato subcategory = CAT_MISCFOOD @@ -63,7 +63,7 @@ name = "Cheesy fries" reqs = list( /obj/item/food/fries = 1, - /obj/item/food/cheesewedge = 1 + /obj/item/food/cheese = 1 ) result = /obj/item/food/cheesyfries subcategory = CAT_MISCFOOD @@ -89,7 +89,7 @@ /datum/crafting_recipe/food/eggplantparm name ="Eggplant parmigiana" reqs = list( - /obj/item/food/cheesewedge = 2, + /obj/item/food/cheese = 2, /obj/item/food/grown/eggplant = 1 ) result = /obj/item/food/eggplantparm @@ -155,7 +155,7 @@ /datum/crafting_recipe/food/cheesyburrito name ="Cheesy burrito" reqs = list( - /obj/item/food/cheesewedge = 2, + /obj/item/food/cheese = 2, /obj/item/food/tortilla = 1, /obj/item/food/grown/soybeans = 1 ) @@ -208,7 +208,7 @@ name ="Cheesy nachos" reqs = list( /datum/reagent/consumable/salt = 1, - /obj/item/food/cheesewedge = 1, + /obj/item/food/cheese = 1, /obj/item/food/tortilla = 1 ) result = /obj/item/food/cheesynachos @@ -274,7 +274,7 @@ name ="Classic Taco" reqs = list( /obj/item/food/tortilla = 1, - /obj/item/food/cheesewedge = 1, + /obj/item/food/cheese = 1, /obj/item/food/meat/cutlet = 1, /obj/item/food/grown/cabbage = 1, ) @@ -285,7 +285,7 @@ name ="Plain Taco" reqs = list( /obj/item/food/tortilla = 1, - /obj/item/food/cheesewedge = 1, + /obj/item/food/cheese = 1, /obj/item/food/meat/cutlet = 1, ) result = /obj/item/food/taco/plain @@ -328,7 +328,7 @@ reqs = list( /obj/item/food/doughslice = 1, /datum/reagent/consumable/cream = 5, - /obj/item/food/cheesewedge = 1, + /obj/item/food/cheese = 1, /obj/item/food/meat/rawcrab = 1 ) result = /obj/item/food/crab_rangoon @@ -337,10 +337,10 @@ /datum/crafting_recipe/food/royalcheese name = "Royal Cheese" reqs = list( - /obj/item/food/cheesewheel = 1, + /obj/item/food/cheese/wheel = 1, /obj/item/clothing/head/crown = 1, /datum/reagent/medicine/strange_reagent = 5, /datum/reagent/toxin/mutagen = 5 ) - result = /obj/item/food/royalcheese + result = /obj/item/food/cheese/royal subcategory = CAT_MISCFOOD diff --git a/code/modules/food_and_drinks/recipes/tablecraft/recipes_pastry.dm b/code/modules/food_and_drinks/recipes/tablecraft/recipes_pastry.dm index aab8a45528c..3494543fbb9 100644 --- a/code/modules/food_and_drinks/recipes/tablecraft/recipes_pastry.dm +++ b/code/modules/food_and_drinks/recipes/tablecraft/recipes_pastry.dm @@ -470,7 +470,7 @@ name = "Khachapuri" reqs = list( /datum/reagent/consumable/eggyolk = 5, - /obj/item/food/cheesewedge = 1, + /obj/item/food/cheese = 1, /obj/item/food/bread/plain = 1 ) result = /obj/item/food/khachapuri diff --git a/code/modules/food_and_drinks/recipes/tablecraft/recipes_pizza.dm b/code/modules/food_and_drinks/recipes/tablecraft/recipes_pizza.dm index 8a1f873b70a..13def8f7347 100644 --- a/code/modules/food_and_drinks/recipes/tablecraft/recipes_pizza.dm +++ b/code/modules/food_and_drinks/recipes/tablecraft/recipes_pizza.dm @@ -7,7 +7,7 @@ name = "Margherita pizza" reqs = list( /obj/item/food/pizzabread = 1, - /obj/item/food/cheesewedge = 4, + /obj/item/food/cheese = 4, /obj/item/food/grown/tomato = 1 ) result = /obj/item/food/pizza/margherita @@ -18,7 +18,7 @@ reqs = list( /obj/item/food/pizzabread = 1, /obj/item/food/meat/cutlet = 4, - /obj/item/food/cheesewedge = 1, + /obj/item/food/cheese = 1, /obj/item/food/grown/tomato = 1 ) result = /obj/item/food/pizza/meat @@ -30,7 +30,7 @@ /obj/item/food/pizzabread = 1, /obj/item/food/meat/cutlet = 3, /obj/item/ammo_casing/c9mm = 8, - /obj/item/food/cheesewedge = 1, + /obj/item/food/cheese = 1, /obj/item/food/grown/tomato = 1 ) result = /obj/item/food/pizza/arnold @@ -62,7 +62,7 @@ reqs = list( /obj/item/food/pizzabread = 1, /obj/item/food/donkpocket/warm = 3, - /obj/item/food/cheesewedge = 1, + /obj/item/food/cheese = 1, /obj/item/food/grown/tomato = 1 ) result = /obj/item/food/pizza/donkpocket @@ -73,7 +73,7 @@ reqs = list( /obj/item/food/pizzabread = 1, /obj/item/food/grown/ambrosia/vulgaris = 3, - /obj/item/food/cheesewedge = 1, + /obj/item/food/cheese = 1, /obj/item/food/grown/tomato = 1 ) result = /obj/item/food/pizza/dank @@ -84,7 +84,7 @@ reqs = list( /obj/item/food/pizzabread = 1, /obj/item/food/meatball = 3, - /obj/item/food/cheesewedge = 1, + /obj/item/food/cheese = 1, /obj/item/food/grown/tomato = 1 ) result = /obj/item/food/pizza/sassysage @@ -96,7 +96,7 @@ /obj/item/food/pizzabread = 1, /obj/item/food/meat/cutlet = 2, /obj/item/food/pineappleslice = 3, - /obj/item/food/cheesewedge = 1, + /obj/item/food/cheese = 1, /obj/item/food/grown/tomato = 1 ) result = /obj/item/food/pizza/pineapple diff --git a/code/modules/food_and_drinks/recipes/tablecraft/recipes_sandwich.dm b/code/modules/food_and_drinks/recipes/tablecraft/recipes_sandwich.dm index e069cffeea5..c88c6ca1ad3 100644 --- a/code/modules/food_and_drinks/recipes/tablecraft/recipes_sandwich.dm +++ b/code/modules/food_and_drinks/recipes/tablecraft/recipes_sandwich.dm @@ -11,7 +11,7 @@ reqs = list( /obj/item/food/breadslice/plain = 2, /obj/item/food/meat/steak = 1, - /obj/item/food/cheesewedge = 1 + /obj/item/food/cheese = 1 ) result = /obj/item/food/sandwich subcategory = CAT_SANDWICH @@ -20,7 +20,7 @@ name = "Cheese sandwich" reqs = list( /obj/item/food/breadslice/plain = 2, - /obj/item/food/cheesewedge = 2 + /obj/item/food/cheese = 2 ) result = /obj/item/food/grilledcheese subcategory = CAT_SANDWICH diff --git a/code/modules/food_and_drinks/recipes/tablecraft/recipes_soup.dm b/code/modules/food_and_drinks/recipes/tablecraft/recipes_soup.dm index 0dba5beb646..894ee5d8746 100644 --- a/code/modules/food_and_drinks/recipes/tablecraft/recipes_soup.dm +++ b/code/modules/food_and_drinks/recipes/tablecraft/recipes_soup.dm @@ -165,7 +165,7 @@ /obj/item/food/badrecipe = 1, /obj/item/food/tofu = 1, /obj/item/food/boiledegg = 1, - /obj/item/food/cheesewedge = 1, + /obj/item/food/cheese = 1, ) result = /obj/item/food/soup/mystery subcategory = CAT_SOUP @@ -255,7 +255,7 @@ /datum/reagent/water = 10, /obj/item/reagent_containers/glass/bowl = 1, /obj/item/food/grown/onion = 1, - /obj/item/food/cheesewedge = 1, + /obj/item/food/cheese = 1, ) result = /obj/item/food/soup/onion subcategory = CAT_SOUP diff --git a/code/modules/mob/living/simple_animal/friendly/mouse.dm b/code/modules/mob/living/simple_animal/friendly/mouse.dm index 013eea16405..84051c4436a 100644 --- a/code/modules/mob/living/simple_animal/friendly/mouse.dm +++ b/code/modules/mob/living/simple_animal/friendly/mouse.dm @@ -80,7 +80,7 @@ if(!stat) var/mob/M = AM to_chat(M, "[icon2html(src, M)] Squeak!") - if(istype(AM, /obj/item/food/royalcheese)) + if(istype(AM, /obj/item/food/cheese/royal)) evolve() qdel(AM) ..() @@ -102,12 +102,12 @@ if(powered) playsound(src, 'sound/effects/sparks2.ogg', 100, TRUE) - for(var/obj/item/food/cheesewedge/cheese in range(1, src)) + for(var/obj/item/food/cheese/cheese in range(1, src)) if(prob(10)) be_fruitful() qdel(cheese) return - for(var/obj/item/food/royalcheese/bigcheese in range(1, src)) + for(var/obj/item/food/cheese/royal/bigcheese in range(1, src)) qdel(bigcheese) evolve() return @@ -116,7 +116,7 @@ if(HAS_TRAIT(src, TRAIT_HANDS_BLOCKED)) return . = ..() - if(istype(A, /obj/item/food/cheesewedge) && canUseTopic(A, BE_CLOSE, NO_DEXTERITY)) + if(istype(A, /obj/item/food/cheese) && canUseTopic(A, BE_CLOSE, NO_DEXTERITY)) if(health == maxHealth) to_chat(src,"You don't need to eat or heal.") return diff --git a/code/modules/mob/living/simple_animal/hostile/regalrat.dm b/code/modules/mob/living/simple_animal/hostile/regalrat.dm index b43b9e31584..af00294a58a 100644 --- a/code/modules/mob/living/simple_animal/hostile/regalrat.dm +++ b/code/modules/mob/living/simple_animal/hostile/regalrat.dm @@ -1,7 +1,3 @@ -#define MINOR_HEAL 10 -#define MEDIUM_HEAL 35 -#define MAJOR_HEAL 70 - /mob/living/simple_animal/hostile/regalrat name = "feral regal rat" desc = "An evolved rat, created through some strange science. It leads nearby rats with deadly efficiency to protect its kingdom. Not technically a king." @@ -29,16 +25,16 @@ attack_sound = 'sound/weapons/punch1.ogg' unique_name = TRUE faction = list("rat") - ///The spell that the rat uses to scrounge up junk. - var/datum/action/cooldown/coffer + ///The spell that the rat uses to generate miasma + var/datum/action/cooldown/domain ///The Spell that the rat uses to recruit/convert more rats. var/datum/action/cooldown/riot /mob/living/simple_animal/hostile/regalrat/Initialize() . = ..() - coffer = new /datum/action/cooldown/coffer + domain = new /datum/action/cooldown/domain riot = new /datum/action/cooldown/riot - coffer.Grant(src) + domain.Grant(src) riot.Grant(src) AddElement(/datum/element/waddling) @@ -56,7 +52,7 @@ if(prob(20)) riot.Trigger() else if(prob(50)) - coffer.Trigger() + domain.Trigger() return ..() /mob/living/simple_animal/hostile/regalrat/CanAttack(atom/the_target) @@ -83,16 +79,25 @@ else if(user != src && istype(user,/mob/living/simple_animal/hostile/regalrat)) . += "Who is this foolish false king? This will not stand!" -/mob/living/simple_animal/hostile/regalrat/AttackingTarget() +/mob/living/simple_animal/hostile/regalrat/handle_environment(datum/gas_mixture/environment) . = ..() - if(istype(target, /obj/item/food/cheesewedge)) - cheese_heal(target, MINOR_HEAL, "You eat [target], restoring some health.") + if(stat == DEAD || !environment || !environment.gases[/datum/gas/miasma]) + return + var/miasma_percentage = environment.gases[/datum/gas/miasma][MOLES] / environment.total_moles() + if(miasma_percentage>=0.25) + heal_bodypart_damage(1) - else if(istype(target, /obj/item/food/cheesewheel)) - cheese_heal(target, MEDIUM_HEAL, "You eat [target], restoring some health.") - - else if(istype(target, /obj/item/food/royalcheese)) - cheese_heal(target, MAJOR_HEAL, "You eat [target], revitalizing your royal resolve completely.") +/mob/living/simple_animal/hostile/regalrat/AttackingTarget() + if (DOING_INTERACTION(src, "regalrat")) + return + . = ..() + if (target.reagents && target.is_injectable(src, allowmobs = TRUE)) + src.visible_message("[src] starts licking [target] passionately!","You start licking [target]...") + if (do_mob(src, target, 2 SECONDS, interaction_key = "regalrat")) + target.reagents.add_reagent(/datum/reagent/rat_spit,rand(1,3),no_react = TRUE) + to_chat(src, "You finish licking [target].") + else + SEND_SIGNAL(target, COMSIG_RAT_INTERACT, src) /** * Conditionally "eat" cheese object and heal, if injured. @@ -110,55 +115,38 @@ else to_chat(src, "You feel fine, no need to eat anything!") - -/mob/living/simple_animal/hostile/regalrat/controlled - name = "regal rat" - /mob/living/simple_animal/hostile/regalrat/controlled/Initialize() . = ..() INVOKE_ASYNC(src, .proc/get_player) + var/kingdom = pick("Plague","Miasma","Maintenance","Trash","Garbage","Rat","Vermin","Cheese") + var/title = pick("King","Lord","Prince","Emperor","Supreme","Overlord","Master","Shogun","Bojar","Tsar") + name = "[kingdom] [title]" /** - *This action creates trash, money, dirt, and cheese. + *Increase the rat king's domain */ -/datum/action/cooldown/coffer - name = "Fill Coffers" - desc = "Your newly granted regality and poise let you scavenge for lost junk, but more importantly, cheese." + +/datum/action/cooldown/domain + name = "Rat King's Domain" + desc = "Corrupts this area to be more suitable for your rat army." + cooldown_time = 60 icon_icon = 'icons/mob/actions/actions_animal.dmi' background_icon_state = "bg_clock" button_icon_state = "coffer" - cooldown_time = 50 -/datum/action/cooldown/coffer/Trigger() +/datum/action/cooldown/domain/Trigger() . = ..() - if(!.) - return var/turf/T = get_turf(owner) - var/loot = rand(1,100) - switch(loot) - if(1 to 5) - to_chat(owner, "Score! You find some cheese!") - new /obj/item/food/cheesewedge(T) - if(6 to 10) - var/pickedcoin = pick(GLOB.ratking_coins) - to_chat(owner, "You find some leftover coins. More for the royal treasury!") - for(var/i = 1 to rand(1,3)) - new pickedcoin(T) - if(11) - to_chat(owner, "You find a... Hunh. This coin doesn't look right.") - var/rarecoin = rand(1,2) - if (rarecoin == 1) - new /obj/item/coin/twoheaded(T) - else - new /obj/item/coin/antagtoken(T) - if(12 to 40) - var/pickedtrash = pick(GLOB.ratking_trash) - to_chat(owner, "You just find more garbage and dirt. Lovely, but beneath you now.") - new /obj/effect/decal/cleanable/dirt(T) - new pickedtrash(T) - if(41 to 100) - to_chat(owner, "Drat. Nothing.") + T.atmos_spawn_air("miasma=4;TEMP=[T20C]") + switch (rand(1,10)) + if (8) + new /obj/effect/decal/cleanable/vomit(T) + if (9) + new /obj/effect/decal/cleanable/vomit/old(T) + if (10) + new /obj/effect/decal/cleanable/oil/slippery(T) + else new /obj/effect/decal/cleanable/dirt(T) StartCooldown() @@ -305,14 +293,50 @@ /mob/living/simple_animal/hostile/rat/AttackingTarget() . = ..() - if(istype(target, /obj/item/food/cheesewedge)) + if(istype(target, /obj/item/food/cheese)) if (health >= maxHealth) to_chat(src, "You feel fine, no need to eat anything!") return to_chat(src, "You eat \the [src], restoring some health.") - heal_bodypart_damage(MINOR_HEAL) + heal_bodypart_damage(maxHealth) qdel(target) -#undef MINOR_HEAL -#undef MEDIUM_HEAL -#undef MAJOR_HEAL + +/** + *Spittle; harmless reagent that is added by rat king, and makes you disgusted. + */ + +/datum/reagent/rat_spit + name = "Rat Spit" + description = "Something coming from a rat. Dear god! Who knows where it's been!" + reagent_state = LIQUID + color = "#C8C8C8" + metabolization_rate = 0.03 * REAGENTS_METABOLISM + taste_description = "something funny" + overdose_threshold = 20 + +/datum/reagent/rat_spit/on_mob_metabolize(mob/living/L) + ..() + if(HAS_TRAIT(L, TRAIT_AGEUSIA)) + return + to_chat(L, "This food has a funny taste!") + +/datum/reagent/rat_spit/overdose_start(mob/living/M) + ..() + var/mob/living/carbon/victim = M + if (istype(victim)) + to_chat(victim, "With this last sip, you feel your body convulsing horribly from the contents you've ingested. As you contemplate your actions, you sense an awakened kinship with rat-kind and their newly risen leader!") + victim.faction |= "rat" + victim.vomit() + metabolization_rate = 10 * REAGENTS_METABOLISM + +/datum/reagent/rat_spit/on_mob_life(mob/living/carbon/C) + if(prob(15)) + to_chat(C, "You feel queasy!") + C.adjust_disgust(3) + else if(prob(10)) + to_chat(C, "That food does not sit up well!") + C.adjust_disgust(5) + else if(prob(5)) + C.vomit() + ..() diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index 7ee0ecd6f4c..db8c2956235 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -46,7 +46,15 @@ GLOBAL_LIST_INIT(wire_node_generating_types, typecacheof(list(/obj/structure/gri GLOB.cable_list += src //add it to the global cable list Connect_cable() AddElement(/datum/element/undertile, TRAIT_T_RAY_VISIBLE) + RegisterSignal(src, COMSIG_RAT_INTERACT, .proc/on_rat_eat) +/obj/structure/cable/proc/on_rat_eat(mob/living/simple_animal/hostile/regalrat/king) + SIGNAL_HANDLER + + if(avail()) + king.apply_damage(10) + playsound(king, 'sound/effects/sparks2.ogg', 100, TRUE) + deconstruct() ///Set the linked indicator bitflags /obj/structure/cable/proc/Connect_cable(clear_before_updating = FALSE) diff --git a/code/modules/recycling/disposal/bin.dm b/code/modules/recycling/disposal/bin.dm index f2b62091d65..ea422d9be24 100644 --- a/code/modules/recycling/disposal/bin.dm +++ b/code/modules/recycling/disposal/bin.dm @@ -41,6 +41,7 @@ air_contents = new /datum/gas_mixture() //gas.volume = 1.05 * CELLSTANDARD update_icon() + RegisterSignal(src, COMSIG_RAT_INTERACT, .proc/on_rat_rummage) return INITIALIZE_HINT_LATELOAD //we need turfs to have air @@ -107,6 +108,25 @@ else return ..() +/obj/machinery/disposal/proc/rat_rummage(mob/living/simple_animal/hostile/regalrat/king) + king.visible_message("[king] starts rummaging through [src].","You rummage through [src]...") + if (do_mob(king, src, 2 SECONDS, interaction_key = "regalrat")) + var/loot = rand(1,100) + switch(loot) + if(1 to 5) + to_chat(king, "You find some leftover coins. More for the royal treasury!") + var/pickedcoin = pick(GLOB.ratking_coins) + for(var/i = 1 to rand(1,3)) + new pickedcoin(get_turf(king)) + if(6 to 33) + say(pick("Treasure!","Our precious!","Cheese!")) + to_chat(king, "Score! You find some cheese!") + new /obj/item/food/cheese(get_turf(king)) + else + var/pickedtrash = pick(GLOB.ratking_trash) + to_chat(king, "You just find more garbage and dirt. Lovely, but beneath you now.") + new pickedtrash(get_turf(king)) + /obj/machinery/disposal/proc/place_item_in_disposal(obj/item/I, mob/user) I.forceMove(src) user.visible_message("[user.name] places \the [I] into \the [src].", "You place \the [I] into \the [src].") @@ -498,3 +518,10 @@ /obj/machinery/disposal/delivery_chute/newHolderDestination(obj/structure/disposalholder/H) H.destinationTag = 1 + + +/obj/machinery/disposal/proc/on_rat_rummage(mob/living/simple_animal/hostile/regalrat/king) + SIGNAL_HANDLER + + INVOKE_ASYNC(src, /obj/machinery/disposal/.proc/rat_rummage, king) +