Merge pull request #5872 from Sharkmare/Gargoyle-abstraction

Gargoyle Custimization round 1
This commit is contained in:
Nadyr
2023-03-09 20:48:55 -05:00
committed by GitHub
3 changed files with 104 additions and 10 deletions

View File

@@ -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

View File

@@ -8,6 +8,12 @@
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"
var/tint = rgb(255,255,255)
/datum/component/gargoyle/Initialize()
if (!ishuman(parent))
return COMPONENT_INCOMPATIBLE
@@ -15,6 +21,11 @@
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
gargoyle.verbs += /mob/living/carbon/human/proc/gargoyle_verbColor
START_PROCESSING(SSprocessing, src)
/datum/component/gargoyle/process()
@@ -59,7 +70,7 @@
var/datum/component/gargoyle/comp = GetComponent(/datum/component/gargoyle)
if (comp)
if (comp.energy <= 0 && isturf(loc))
to_chat(src, "<span class='danger'>You suddenly turn into a statue as you run out of energy!</span>")
to_chat(src, "<span class='danger'>You suddenly turn into a [comp.identifier] as you run out of energy!</span>")
else if (comp.cooldown > world.time)
var/time_to_wait = (comp.cooldown - world.time) / (1 SECONDS)
to_chat(src, "<span class='warning'>You can't transform just yet again! Wait for another [round(time_to_wait,0.1)] seconds!</span>")
@@ -93,3 +104,55 @@
var/datum/component/gargoyle/comp = GetComponent(/datum/component/gargoyle)
if (comp)
to_chat(src, "<span class='notice'>You have [round(comp.energy,0.01)] energy remaining. It is currently [comp.paused ? "stable" : (comp.transformed ? "increasing" : "decreasing")].</span>")
/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 comp.tint = namer
//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_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"
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_verbColor()
set name = "Gargoyle - Recolor"
set category = "Abilities"
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,4)

View File

@@ -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)
. = ..()
@@ -23,18 +25,22 @@
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
comp.transformed = TRUE
comp.paused = FALSE
identifier = comp.identifier
material = comp.material
tint = comp.tint
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()
@@ -42,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
@@ -61,7 +92,7 @@
flapping = H.flapping
H.toggle_tail(FALSE, FALSE)
H.toggle_wing(FALSE, FALSE)
H.visible_message("<span class='warning'>[H]'s skin rapidly turns to stone!</span>", "<span class='warning'>Your skin abruptly hardens as you turn to stone!</span>")
H.visible_message("<span class='warning'>[H]'s skin rapidly turns to [material]!</span>", "<span class='warning'>Your skin abruptly [comp.adjective] as you turn to [material]!</span>")
H.forceMove(src)
H.SetBlinded(0)
H.SetSleeping(0)
@@ -87,7 +118,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 +152,10 @@
var/f = (original_int - obj_integrity) / 10
for (var/x in 1 to 10)
gargoyle.adjustBruteLoss(f)
hurtmessage = " <b>You feel your body take the damage that was dealt while being stone!</b>"
hurtmessage = " <b>You feel your body take the damage that was dealt while being [material]!</b>"
gargoyle.updatehealth()
alpha = 0
gargoyle.visible_message("<span class='warning'>[gargoyle]'s skin rapidly softens, returning them to normal!</span>", "<span class='warning'>Your skin softens, freeing your movement once more![hurtmessage]</span>")
gargoyle.visible_message("<span class='warning'>[gargoyle]'s skin rapidly reverts, returning them to normal!</span>", "<span class='warning'>Your skin reverts, freeing your movement once more![hurtmessage]</span>")
/obj/structure/gargoyle/return_air()
return return_air_for_internal_lifeform()