From 3298f659b5065cfe80a6a2be4ac0aad1a3317dc6 Mon Sep 17 00:00:00 2001
From: eyespy <104491498+eyespy2222@users.noreply.github.com>
Date: Sun, 19 Feb 2023 15:45:03 +1100
Subject: [PATCH 1/2] finishing what i started (and cake people!))
hopefully this fixes some bugs that were made present due to a botched PR I did a few days ago, as well as properly implementing craftable cake people (or cake golems, if you wanna call them that). sadly the code that was present when i tried to make my modifications for some reason does not give the person attempting to eat the cake person any nutriment or vitamins, so i would appreciate it if a more experienced coder gave me a hint on how to fix this, or just fixed it themselves.
---
.../recipes/tablecraft/recipes_cake.dm | 8 +--
.../simple_animal/friendly/cakegolem.dm | 50 +++++++++++++++++++
code/modules/projectiles/projectile/magic.dm | 2 +-
tgstation.dme | 2 +
4 files changed, 57 insertions(+), 5 deletions(-)
create mode 100644 code/modules/mob/living/simple_animal/friendly/cakegolem.dm
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 02af84d9..275b5b3d 100644
--- a/code/modules/food_and_drinks/recipes/tablecraft/recipes_cake.dm
+++ b/code/modules/food_and_drinks/recipes/tablecraft/recipes_cake.dm
@@ -190,16 +190,16 @@
result = /obj/item/reagent_containers/food/snacks/store/cake/trumpet
subcategory = CAT_CAKE
-/datum/crafting_recipe/food/cak
+/datum/crafting_recipe/food/cakeperson
name = "Living cake person"
reqs = list(
/obj/item/organ/brain = 1,
/obj/item/organ/heart = 1,
- /obj/item/reagent_containers/food/snacks/store/cake/birthday = 3, //the cake person is quite fat, so more cake is needed. good thing b-day cakes are in mealvendors
+ /obj/item/reagent_containers/food/snacks/store/cake/birthday = 1,
/obj/item/reagent_containers/food/snacks/meat/slab = 3,
/datum/reagent/blood = 30,
/datum/reagent/consumable/sprinkles = 5,
/datum/reagent/teslium = 1 //To shock the whole thing into life
)
- // result = /mob/living/simple_animal/cakegolem
- // subcategory = CAT_CAKE //Cat! Haha, get it? CAT? GET IT? We get it - Love Catpeople
+ result = /mob/living/simple_animal/friendly/cakegolem
+ subcategory = CAT_CAKE //Cat! Haha, get it? CAT? GET IT? We get it - Love Catpeople
diff --git a/code/modules/mob/living/simple_animal/friendly/cakegolem.dm b/code/modules/mob/living/simple_animal/friendly/cakegolem.dm
new file mode 100644
index 00000000..8d91e787
--- /dev/null
+++ b/code/modules/mob/living/simple_animal/friendly/cakegolem.dm
@@ -0,0 +1,50 @@
+/mob/living/simple_animal/friendly/cakegolem //I told you I'd do it, Remie //sorry Remie -Eye
+ name = "Puffball"
+ desc = "It's a person made out of cake."
+ icon = 'GainStation13/icons/mob/cakegolem.dmi'
+ icon_state = "cakegolem"
+ icon_living = "cakegolem"
+ icon_dead = "cakegolem_dead"
+ health = 200
+ maxHealth = 200 //health buffed because you all know how people get here -Eye
+ gender = FEMALE
+ harm_intent_damage = 10
+ butcher_results = list(/obj/item/organ/brain = 1, /obj/item/organ/heart = 1, /obj/item/reagent_containers/food/snacks/cakeslice/birthday = 9, \
+ /obj/item/reagent_containers/food/snacks/meat/slab = 2)
+ response_harm = "takes a bite out of"
+ attacked_sound = 'sound/items/eatfood.ogg'
+ deathmessage = "loses its false life and collapses!"
+ death_sound = "bodyfall"
+ //held_icon = "cakegolem"
+
+/mob/living/simple_animal/friendly/cakegolem/CheckParts(list/parts)
+ ..()
+ var/obj/item/organ/brain/B = locate(/obj/item/organ/brain) in contents
+ if(!B || !B.brainmob || !B.brainmob.mind)
+ return
+ B.brainmob.mind.transfer_to(src)
+ to_chat(src, "You are a cake person! You're a harmless cake/person hybrid that everyone loves. People can take bites out of you if they're hungry, but there is plenty of you to go around, and you regenerate health \
+ so quickly that it generally doesn't matter. You're remarkably resilient to any damage besides this and it's hard for you to really die at all. You should go around and bring happiness and \
+ free cake to the station!")
+ var/new_name = stripped_input(src, "Enter your name, or press \"Cancel\" to stick with Puffball.", "Name Change")
+ if(new_name)
+ to_chat(src, "Your name is now \"new_name\"!")
+ name = new_name
+
+/mob/living/simple_animal/friendly/cakegolem/Life()
+ ..()
+ if(stat)
+ return
+ if(health < maxHealth)
+ adjustBruteLoss(-8) //Fast life regen
+ for(var/obj/item/reagent_containers/food/snacks/donut/D in range(1, src)) //Frosts nearby donuts!
+ if(!D.is_decorated)
+ D.decorate_donut()
+
+/mob/living/simple_animal/friendly/cakegolem/attack_hand(mob/living/L)
+ . = ..()
+ if(.) //the attack was blocked
+ return
+ if(L.a_intent == INTENT_HARM && L.reagents && !stat)
+ L.reagents.add_reagent(/datum/reagent/consumable/nutriment, 0.4)
+ L.reagents.add_reagent(/datum/reagent/consumable/nutriment/vitamin, 0.4)
\ No newline at end of file
diff --git a/code/modules/projectiles/projectile/magic.dm b/code/modules/projectiles/projectile/magic.dm
index 4970b2ef..a2d3ae8a 100644
--- a/code/modules/projectiles/projectile/magic.dm
+++ b/code/modules/projectiles/projectile/magic.dm
@@ -209,7 +209,7 @@
/mob/living/simple_animal/hostile/lizard,
/mob/living/simple_animal/pet/fox,
/mob/living/simple_animal/butterfly,
- // /mob/living/simple_animal/cakegolem //pet/cat/cak,
+ /mob/living/simple_animal/friendly/cakegolem //pet/cat/cak,
/mob/living/simple_animal/chick)
new_mob = new path(M.loc)
diff --git a/tgstation.dme b/tgstation.dme
index 19e46c4d..ca49bf17 100644
--- a/tgstation.dme
+++ b/tgstation.dme
@@ -13,6 +13,7 @@
// END_PREFERENCES
// BEGIN_INCLUDE
+#include "cakegolem.dm"
#include "_maps\_basemap.dm"
#include "_maps\map_files\generic\CentCom.dmm"
#include "code\_compile_options.dm"
@@ -2286,6 +2287,7 @@
#include "code\modules\mob\living\simple_animal\bot\secbot.dm"
#include "code\modules\mob\living\simple_animal\bot\SuperBeepsky.dm"
#include "code\modules\mob\living\simple_animal\friendly\butterfly.dm"
+#include "code\modules\mob\living\simple_animal\friendly\cakegolem.dm"
#include "code\modules\mob\living\simple_animal\friendly\cat.dm"
#include "code\modules\mob\living\simple_animal\friendly\cockroach.dm"
#include "code\modules\mob\living\simple_animal\friendly\crab.dm"
From e6c9a14282a46460945df9aef47946999286410b Mon Sep 17 00:00:00 2001
From: eyespy <104491498+eyespy2222@users.noreply.github.com>
Date: Sun, 19 Feb 2023 21:01:36 +1100
Subject: [PATCH 2/2] moving code around for convenience
---
.../friendly => GainStation13/code/mobs}/cakegolem.dm | 0
tgstation.dme | 3 +--
2 files changed, 1 insertion(+), 2 deletions(-)
rename {code/modules/mob/living/simple_animal/friendly => GainStation13/code/mobs}/cakegolem.dm (100%)
diff --git a/code/modules/mob/living/simple_animal/friendly/cakegolem.dm b/GainStation13/code/mobs/cakegolem.dm
similarity index 100%
rename from code/modules/mob/living/simple_animal/friendly/cakegolem.dm
rename to GainStation13/code/mobs/cakegolem.dm
diff --git a/tgstation.dme b/tgstation.dme
index ca49bf17..6c2ab638 100644
--- a/tgstation.dme
+++ b/tgstation.dme
@@ -13,7 +13,6 @@
// END_PREFERENCES
// BEGIN_INCLUDE
-#include "cakegolem.dm"
#include "_maps\_basemap.dm"
#include "_maps\map_files\generic\CentCom.dmm"
#include "code\_compile_options.dm"
@@ -2287,7 +2286,6 @@
#include "code\modules\mob\living\simple_animal\bot\secbot.dm"
#include "code\modules\mob\living\simple_animal\bot\SuperBeepsky.dm"
#include "code\modules\mob\living\simple_animal\friendly\butterfly.dm"
-#include "code\modules\mob\living\simple_animal\friendly\cakegolem.dm"
#include "code\modules\mob\living\simple_animal\friendly\cat.dm"
#include "code\modules\mob\living\simple_animal\friendly\cockroach.dm"
#include "code\modules\mob\living\simple_animal\friendly\crab.dm"
@@ -3077,6 +3075,7 @@
#include "GainStation13\code\machinery\feeding_tube.dm"
#include "GainStation13\code\mechanics\fatness.dm"
#include "GainStation13\code\mechanics\spells.dm"
+#include "GainStation13\code\mobs\cakegolem.dm"
#include "GainStation13\code\modules\client\preferences\preferences.dm"
#include "GainStation13\code\modules\mob\living\emote.dm"
#include "GainStation13\code\modules\reagents\chemistry\reagents\consumable_reagents.dm"