From 4a2b06e0cf340c64af59f5a3c4d49869b9e2075b Mon Sep 17 00:00:00 2001 From: Sharkmare <34294231+Sharkmare@users.noreply.github.com> Date: Wed, 8 Mar 2023 17:38:36 +0100 Subject: [PATCH 1/2] Gargoyle Custimization round 1 "statue of name" now allows to change the statue part "your skin hardens" now allows to change the hardens part "you turn to stone" now allows to change the stone part "your skin softens" modified to "your skin reverts" so we dont need a negative adjective --- .../species/station/traits_vr/neutral_ch.dm | 4 +- .../code/datums/components/gargoyle.dm | 54 ++++++++++++++++++- .../code/game/objects/structures/gargoyle.dm | 16 +++--- 3 files changed, 65 insertions(+), 9 deletions(-) diff --git a/code/modules/mob/living/carbon/human/species/station/traits_vr/neutral_ch.dm b/code/modules/mob/living/carbon/human/species/station/traits_vr/neutral_ch.dm index 29dba9e4dd..67d36ef9ec 100644 --- a/code/modules/mob/living/carbon/human/species/station/traits_vr/neutral_ch.dm +++ b/code/modules/mob/living/carbon/human/species/station/traits_vr/neutral_ch.dm @@ -81,8 +81,8 @@ excludes = list(/datum/trait/neutral/autohiss_tajaran, /datum/trait/neutral/autohiss_unathi) /datum/trait/neutral/gargoyle - name = "Gargoyle" - desc = "You turn into a statue at will, but also whenever you run out of energy. Being a statue replenishes your energy slowly." + name = "Gargoyle (adjustable)" + desc = "You turn into a statue (or similiar) at will, but also whenever you run out of energy. Being a statue replenishes your energy slowly." cost = 0 custom_only = FALSE //slimes, xenochimera, diona, proteans, etc, basically anything but custom doesn't make sense (as much as I wanna play a petrifying slime) //Nah makes perfect sense, they could just be gene modded, not to mention we can expand this to have the statue and description of it renameable as well as color adjustable, to support general petrification diff --git a/modular_chomp/code/datums/components/gargoyle.dm b/modular_chomp/code/datums/components/gargoyle.dm index 8d8f699255..5711bc7db5 100644 --- a/modular_chomp/code/datums/components/gargoyle.dm +++ b/modular_chomp/code/datums/components/gargoyle.dm @@ -8,6 +8,11 @@ var/mob/living/carbon/human/gargoyle //easy reference var/obj/structure/gargoyle/statue //another easy ref + //Adjustable mod + var/identifier = "statue" + var/adjective = "hardens" + var/material = "stone" + /datum/component/gargoyle/Initialize() if (!ishuman(parent)) return COMPONENT_INCOMPATIBLE @@ -15,6 +20,10 @@ gargoyle.verbs += /mob/living/carbon/human/proc/gargoyle_transformation gargoyle.verbs += /mob/living/carbon/human/proc/gargoyle_pause gargoyle.verbs += /mob/living/carbon/human/proc/gargoyle_checkenergy + gargoyle.verbs += /mob/living/carbon/human/proc/gargoyle_verbAdjective + gargoyle.verbs += /mob/living/carbon/human/proc/gargoyle_verbIdentifier + gargoyle.verbs += /mob/living/carbon/human/proc/gargoyle_verbMaterial + START_PROCESSING(SSprocessing, src) /datum/component/gargoyle/process() @@ -59,7 +68,7 @@ var/datum/component/gargoyle/comp = GetComponent(/datum/component/gargoyle) if (comp) if (comp.energy <= 0 && isturf(loc)) - to_chat(src, "You suddenly turn into a statue as you run out of energy!") + to_chat(src, "You suddenly turn into a [comp.identifier] as you run out of energy!") else if (comp.cooldown > world.time) var/time_to_wait = (comp.cooldown - world.time) / (1 SECONDS) to_chat(src, "You can't transform just yet again! Wait for another [round(time_to_wait,0.1)] seconds!") @@ -93,3 +102,46 @@ var/datum/component/gargoyle/comp = GetComponent(/datum/component/gargoyle) if (comp) to_chat(src, "You have [round(comp.energy,0.01)] energy remaining. It is currently [comp.paused ? "stable" : (comp.transformed ? "increasing" : "decreasing")].") + +/mob/living/carbon/human/proc/Gargoyle_Customizer(var/namer,var/type) + var/datum/component/gargoyle/comp = GetComponent(/datum/component/gargoyle) + if (comp) + if(type==1) + return comp.identifier = namer + if(type==2) + return comp.material = namer + if(type==3) + return comp.adjective = namer + if(type==4) + return + //Add color code here in the future + if(type==5) + return + //Placeholder for being able to pick up statues + +/mob/living/carbon/human/proc/gargoyle_verbIdentifier() + set name = "Gargoyle - Name Identifier" + set category = "Abilities" + set desc = "Renames your statue to something of your choosing but only the statue part of the name." + var/user_input = input("Enter your statue identifier") + if(!user_input) + return + Gargoyle_Customizer(user_input,1) + +/mob/living/carbon/human/proc/gargoyle_verbAdjective() + set name = "Gargoyle - Name Adjective" + set category = "Abilities" + set desc = "Renames your petrification adjective to something of your choosing. by default it is (hardens)." + var/user_input = input("Enter your petrification adjective") + if(!user_input) + return + Gargoyle_Customizer(user_input,3) + +/mob/living/carbon/human/proc/gargoyle_verbMaterial() + set name = "Gargoyle - Name Material" + set category = "Abilities" + set desc = "Renames your statues material to something of your choosing. by default it is (stone)." + var/user_input = input("Enter your petrification material") + if(!user_input) + return + Gargoyle_Customizer(user_input,2) diff --git a/modular_chomp/code/game/objects/structures/gargoyle.dm b/modular_chomp/code/game/objects/structures/gargoyle.dm index b92801b217..0d22f993ba 100644 --- a/modular_chomp/code/game/objects/structures/gargoyle.dm +++ b/modular_chomp/code/game/objects/structures/gargoyle.dm @@ -15,6 +15,8 @@ var/original_int = 100 var/max_integrity = 100 var/stored_examine + var/identifier = "statue" + var/material = "stone" /obj/structure/gargoyle/Initialize(mapload, var/mob/living/carbon/human/H) . = ..() @@ -28,13 +30,15 @@ comp.statue = src comp.transformed = TRUE comp.paused = FALSE + identifier = comp.identifier + material = comp.material gargoyle = H max_integrity = H.getMaxHealth() + 100 obj_integrity = H.health + 100 original_int = obj_integrity - name = "statue of [H.name]" - desc = "A very lifelike statue." + name = "[identifier] of [H.name]" + desc = "A very lifelike [identifier]." stored_examine = H.examine() description_fluff = H.get_description_fluff() @@ -61,7 +65,7 @@ flapping = H.flapping H.toggle_tail(FALSE, FALSE) H.toggle_wing(FALSE, FALSE) - H.visible_message("[H]'s skin rapidly turns to stone!", "Your skin abruptly hardens as you turn to stone!") + H.visible_message("[H]'s skin rapidly turns to [material]!", "Your skin abruptly [comp.adjective] as you turn to [material]!") H.forceMove(src) H.SetBlinded(0) H.SetSleeping(0) @@ -87,7 +91,7 @@ /obj/structure/gargoyle/examine(mob/user) . = ..() if (gargoyle && stored_examine) - . += "The statue seems to have a bit more to them..." + . += "The [identifier] seems to have a bit more to them..." . += stored_examine return @@ -121,10 +125,10 @@ var/f = (original_int - obj_integrity) / 10 for (var/x in 1 to 10) gargoyle.adjustBruteLoss(f) - hurtmessage = " You feel your body take the damage that was dealt while being stone!" + hurtmessage = " You feel your body take the damage that was dealt while being [material]!" gargoyle.updatehealth() alpha = 0 - gargoyle.visible_message("[gargoyle]'s skin rapidly softens, returning them to normal!", "Your skin softens, freeing your movement once more![hurtmessage]") + gargoyle.visible_message("[gargoyle]'s skin rapidly reverts, returning them to normal!", "Your skin reverts, freeing your movement once more![hurtmessage]") /obj/structure/gargoyle/return_air() return return_air_for_internal_lifeform() From 5eec328c8cc5908d654d476e12c540e335e7565f Mon Sep 17 00:00:00 2001 From: Sharkmare <34294231+Sharkmare@users.noreply.github.com> Date: Wed, 8 Mar 2023 22:04:47 +0100 Subject: [PATCH 2/2] Recolorable Petrification code --- .../code/datums/components/gargoyle.dm | 23 +++++++++++---- .../code/game/objects/structures/gargoyle.dm | 29 ++++++++++++++++++- 2 files changed, 45 insertions(+), 7 deletions(-) diff --git a/modular_chomp/code/datums/components/gargoyle.dm b/modular_chomp/code/datums/components/gargoyle.dm index 5711bc7db5..33ca4e1b64 100644 --- a/modular_chomp/code/datums/components/gargoyle.dm +++ b/modular_chomp/code/datums/components/gargoyle.dm @@ -12,6 +12,7 @@ var/identifier = "statue" var/adjective = "hardens" var/material = "stone" + var/tint = rgb(255,255,255) /datum/component/gargoyle/Initialize() if (!ishuman(parent)) @@ -23,6 +24,7 @@ gargoyle.verbs += /mob/living/carbon/human/proc/gargoyle_verbAdjective gargoyle.verbs += /mob/living/carbon/human/proc/gargoyle_verbIdentifier gargoyle.verbs += /mob/living/carbon/human/proc/gargoyle_verbMaterial + gargoyle.verbs += /mob/living/carbon/human/proc/gargoyle_verbColor START_PROCESSING(SSprocessing, src) @@ -113,7 +115,7 @@ if(type==3) return comp.adjective = namer if(type==4) - return + return comp.tint = namer //Add color code here in the future if(type==5) return @@ -128,6 +130,15 @@ return Gargoyle_Customizer(user_input,1) +/mob/living/carbon/human/proc/gargoyle_verbMaterial() + set name = "Gargoyle - Name Material" + set category = "Abilities" + set desc = "Renames your statues material to something of your choosing. by default it is (stone)." + var/user_input = input("Enter your petrification material") + if(!user_input) + return + Gargoyle_Customizer(user_input,2) + /mob/living/carbon/human/proc/gargoyle_verbAdjective() set name = "Gargoyle - Name Adjective" set category = "Abilities" @@ -137,11 +148,11 @@ return Gargoyle_Customizer(user_input,3) -/mob/living/carbon/human/proc/gargoyle_verbMaterial() - set name = "Gargoyle - Name Material" +/mob/living/carbon/human/proc/gargoyle_verbColor() + set name = "Gargoyle - Recolor" set category = "Abilities" - set desc = "Renames your statues material to something of your choosing. by default it is (stone)." - var/user_input = input("Enter your petrification material") + set desc = "Recolor your statue to something of your choosing. by default it is grey." + var/user_input = input(src, "Choose a tint color!") as color|null if(!user_input) return - Gargoyle_Customizer(user_input,2) + Gargoyle_Customizer(user_input,4) diff --git a/modular_chomp/code/game/objects/structures/gargoyle.dm b/modular_chomp/code/game/objects/structures/gargoyle.dm index 0d22f993ba..6cd3caadfc 100644 --- a/modular_chomp/code/game/objects/structures/gargoyle.dm +++ b/modular_chomp/code/game/objects/structures/gargoyle.dm @@ -25,6 +25,7 @@ if (!istype(H) || !isturf(H.loc)) return var/datum/component/gargoyle/comp = H.GetComponent(/datum/component/gargoyle) + var/tint = rgb(255,255,255) if (comp) comp.cooldown = world.time + (15 SECONDS) comp.statue = src @@ -32,6 +33,7 @@ comp.paused = FALSE identifier = comp.identifier material = comp.material + tint = comp.tint gargoyle = H max_integrity = H.getMaxHealth() + 100 @@ -46,7 +48,32 @@ H.buckled.unbuckle_mob(H, TRUE) icon = H.icon copy_overlays(H) - color = list(rgb(77,77,77), rgb(150,150,150), rgb(28,28,28), rgb(0,0,0)) + + //calculate our tints + + var/list/RGB = list( hex2num( "[tint[2]][tint[3]]" ), + hex2num( "[tint[4]][tint[5]]" ), + hex2num( "[tint[6]][tint[7]]" ) + ) + + var/colora = rgb( RGB[1]*0.299, + RGB[2]*0.299, + RGB[3]*0.299 + ) + + var/colorb = rgb( RGB[1]*0.587, + RGB[2]*0.587, + RGB[3]*0.587 + ) + + var/colorc = rgb( RGB[1]*0.114, + RGB[2]*0.114, + RGB[3]*0.114 + ) + + color = list( colora, colorb , colorc, rgb(0,0,0)) + + initial_sleep = H.sleeping initial_blind = H.eye_blind initial_is_shifted = H.is_shifted