Recolorable Petrification code

This commit is contained in:
Sharkmare
2023-03-08 22:04:47 +01:00
parent 4a2b06e0cf
commit 5eec328c8c
2 changed files with 45 additions and 7 deletions

View File

@@ -12,6 +12,7 @@
var/identifier = "statue" var/identifier = "statue"
var/adjective = "hardens" var/adjective = "hardens"
var/material = "stone" var/material = "stone"
var/tint = rgb(255,255,255)
/datum/component/gargoyle/Initialize() /datum/component/gargoyle/Initialize()
if (!ishuman(parent)) if (!ishuman(parent))
@@ -23,6 +24,7 @@
gargoyle.verbs += /mob/living/carbon/human/proc/gargoyle_verbAdjective 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_verbIdentifier
gargoyle.verbs += /mob/living/carbon/human/proc/gargoyle_verbMaterial gargoyle.verbs += /mob/living/carbon/human/proc/gargoyle_verbMaterial
gargoyle.verbs += /mob/living/carbon/human/proc/gargoyle_verbColor
START_PROCESSING(SSprocessing, src) START_PROCESSING(SSprocessing, src)
@@ -113,7 +115,7 @@
if(type==3) if(type==3)
return comp.adjective = namer return comp.adjective = namer
if(type==4) if(type==4)
return return comp.tint = namer
//Add color code here in the future //Add color code here in the future
if(type==5) if(type==5)
return return
@@ -128,6 +130,15 @@
return return
Gargoyle_Customizer(user_input,1) 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() /mob/living/carbon/human/proc/gargoyle_verbAdjective()
set name = "Gargoyle - Name Adjective" set name = "Gargoyle - Name Adjective"
set category = "Abilities" set category = "Abilities"
@@ -137,11 +148,11 @@
return return
Gargoyle_Customizer(user_input,3) Gargoyle_Customizer(user_input,3)
/mob/living/carbon/human/proc/gargoyle_verbMaterial() /mob/living/carbon/human/proc/gargoyle_verbColor()
set name = "Gargoyle - Name Material" set name = "Gargoyle - Recolor"
set category = "Abilities" set category = "Abilities"
set desc = "Renames your statues material to something of your choosing. by default it is (stone)." set desc = "Recolor your statue to something of your choosing. by default it is grey."
var/user_input = input("Enter your petrification material") var/user_input = input(src, "Choose a tint color!") as color|null
if(!user_input) if(!user_input)
return return
Gargoyle_Customizer(user_input,2) Gargoyle_Customizer(user_input,4)

View File

@@ -25,6 +25,7 @@
if (!istype(H) || !isturf(H.loc)) if (!istype(H) || !isturf(H.loc))
return return
var/datum/component/gargoyle/comp = H.GetComponent(/datum/component/gargoyle) var/datum/component/gargoyle/comp = H.GetComponent(/datum/component/gargoyle)
var/tint = rgb(255,255,255)
if (comp) if (comp)
comp.cooldown = world.time + (15 SECONDS) comp.cooldown = world.time + (15 SECONDS)
comp.statue = src comp.statue = src
@@ -32,6 +33,7 @@
comp.paused = FALSE comp.paused = FALSE
identifier = comp.identifier identifier = comp.identifier
material = comp.material material = comp.material
tint = comp.tint
gargoyle = H gargoyle = H
max_integrity = H.getMaxHealth() + 100 max_integrity = H.getMaxHealth() + 100
@@ -46,7 +48,32 @@
H.buckled.unbuckle_mob(H, TRUE) H.buckled.unbuckle_mob(H, TRUE)
icon = H.icon icon = H.icon
copy_overlays(H) 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_sleep = H.sleeping
initial_blind = H.eye_blind initial_blind = H.eye_blind
initial_is_shifted = H.is_shifted initial_is_shifted = H.is_shifted