Skip to content

Commit

Permalink
some code polish
Browse files Browse the repository at this point in the history
  • Loading branch information
FuzzyFuzlet committed Jul 16, 2023
1 parent 857a31f commit bdcbacf
Show file tree
Hide file tree
Showing 4 changed files with 182 additions and 45 deletions.
1 change: 1 addition & 0 deletions code/__DEFINES/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@

// item traits
#define TRAIT_NODROP "nodrop"
#define TRAIT_PENANCE "penance"
/// Dont put it in storage things, simple as
#define TRAIT_NO_STORAGE_INSERT "no_storage_insert"
/// Can't leave a storage!
Expand Down
220 changes: 176 additions & 44 deletions code/game/objects/items/artifacts.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
icon = 'icons/obj/artifacts.dmi'
icon_state = "battery"
w_class = WEIGHT_CLASS_SMALL
resistance_flags = FIRE_PROOF

var/buff_type
var/buff_strength
Expand Down Expand Up @@ -39,7 +40,7 @@
//on add
add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/artifact, TRUE, -buff_strength/100)
//on remove
remove_movespeed_modifier(/datum/movespeed_modifier/artifact)
remove_movespeed_modifier(/datum/movespeed_modifier/artifact) //gotta make sure these can stack I think...
if(7) //blood
if(M.get_blood(TRUE) < (BLOOD_VOLUME_NORMAL*M.blood_ratio && M.get_blood(TRUE) > 250))
M.blood_volume += buff_strength/100
Expand Down Expand Up @@ -82,8 +83,10 @@
*/
/obj/item/artifact/examine(mob/user)
.=..()
.+= "[buff_text]"
.+= "[debuff_text]"
if(buff_text)
.+= "[buff_text]"
if(debuff_text)
.+= "[debuff_text]"



Expand All @@ -103,69 +106,69 @@
if(1) //brute
name_suffix = "stone flower" //adv is beads/mamini_busi
icon_state = "stoneflower"
buff_text = "Provides .[buff_strength] brute regeneration"
buff_text = "Provides [buff_strength/100] brute regeneration"
if(2) //burn
name_suffix = "jellyfish" //adv is fireball
icon_state = "meduza"
buff_text = "Provides .[buff_strength] burn regeneration"
buff_text = "Provides [buff_strength/100] burn regeneration"
if(3) //toxin
name_suffix = "thorn" //adv is urchin/ezh
icon_state = "koluchka"
buff_text = "Provides .[buff_strength] toxin regeneration"
buff_text = "Provides [buff_strength/100] toxin regeneration"
if(4) //health
name_suffix = "stone blood" //adv is soul
icon_state = "stone_blood"
buff_text = "Provides [buff_strength/5] health"
if(5) //stamina
name_suffix = "moonlight" //adv is night star
icon_state = "moonlight"
buff_text = "Provides .[buff_strength] stamina regeneration"
buff_text = "Provides [buff_strength/100] stamina regeneration"
if(6) //speed
name_suffix = "mica" //adv is firefly
icon_state = "mica"
buff_text = "Provides .[buff_strength] movement speed"
buff_text = "Provides [buff_strength/100] movement speed"
if(7) //blood
name_suffix = "slime" //adv is slug/sliznyak
icon_state = "sliz"
buff_text = "Provides .[buff_strength] blood regeneration"
buff_text = "Provides [buff_strength/100] blood regeneration"
if(8) //radiation
name_suffix = "droplet" //adv is crystal
icon_state = "droplet"
buff_text = "Provides .[buff_strength] radiation regeneration"
buff_text = "Provides [buff_strength/100] radiation regeneration"

switch(debuff_type)
if(1) //brute
name_prefix = "aching" //adv is stinging
name_prefix = "stinging"
color = COLOR_PALE_RED_GRAY
debuff_text = "Causes .[debuff_strength] brute drain"
debuff_text = "Causes [debuff_strength/100] brute drain"
if(2) //burn
name_prefix = "smoldering" //adv is searing
name_prefix = "smoldering"
color = COLOR_PALE_ORANGE
debuff_text = "Causes .[debuff_strength] burn drain"
debuff_text = "Causes [debuff_strength/100] burn drain"
if(3) //toxin
name_prefix = "nauseating" //adv is sickening
name_prefix = "emetic"
color = COLOR_PALE_GREEN_GRAY
debuff_text = "Causes .[debuff_strength] toxin drain"
debuff_text = "Causes [debuff_strength/100] toxin drain"
if(4) //health
name_prefix = "enfeebling" //adv is debilitating
name_prefix = "frail"
color = null
debuff_text = "Causes [debuff_strength/5] lower health"
if(5) //stamina
name_prefix = "weakening" //adv is exhausting
name_prefix = "soporific"
color = COLOR_PALE_BLUE_GRAY
debuff_text = "Causes .[debuff_strength] stamina drain"
debuff_text = "Causes [debuff_strength/100] stamina drain"
if(6) //speed
name_prefix = "slowing" //adv is dragging
name_prefix = "lethargic"
color = COLOR_PALE_PURPLE_GRAY
debuff_text = "Causes .[debuff_strength] less movement speed"
debuff_text = "Causes [debuff_strength/100] less movement speed"
if(7) //blood
name_prefix = "dripping" //adv is exsanguinating
name_prefix = "bloody"
color = COLOR_RED_GRAY
debuff_text = "Causes .[debuff_strength] blood drain"
debuff_text = "Causes [debuff_strength/100] blood drain"
if(8) //radiation
name_prefix = "glowing" //adv is discharging
name_prefix = "glowing"
color = COLOR_GREEN_GRAY
debuff_text = "Causes .[debuff_strength] radiation buildup"
debuff_text = "Causes [debuff_strength/100] radiation buildup"

name = "[name_prefix] [name_suffix]"
..()
Expand All @@ -188,69 +191,69 @@
if(1) //brute
name_suffix = "beads"
icon_state = "mamini_busi"
buff_text = "Provides .[buff_strength] brute regeneration"
buff_text = "Provides [buff_strength/100] brute regeneration"
if(2) //burn
name_suffix = "fireball"
icon_state = "fireball"
buff_text = "Provides .[buff_strength] burn regeneration"
buff_text = "Provides [buff_strength/100] burn regeneration"
if(3) //toxin
name_suffix = "urchin"
icon_state = "ezh"
buff_text = "Provides .[buff_strength] toxin regeneration"
buff_text = "Provides [buff_strength/100] toxin regeneration"
if(4) //health
name_suffix = "soul"
icon_state = "soul"
buff_text = "Provides [buff_strength/5] health"
if(5) //stamina
name_suffix = "night star"
icon_state = "nightstar"
buff_text = "Provides .[buff_strength] stamina regeneration"
buff_text = "Provides [buff_strength/100] stamina regeneration"
if(6) //speed
name_suffix = "firefly"
icon_state = "firefly"
buff_text = "Provides .[buff_strength] movement speed"
buff_text = "Provides [buff_strength/100] movement speed"
if(7) //blood
name_suffix = "slug"
icon_state = "sliznyak"
buff_text = "Provides .[buff_strength] blood regeneration"
buff_text = "Provides [buff_strength/100] blood regeneration"
if(8) //radiation
name_suffix = "crystal"
icon_state = "crystal"
buff_text = "Provides .[buff_strength] radiation regeneration"
buff_text = "Provides [buff_strength/100] radiation regeneration"

switch(debuff_type)
if(1) //brute
name_prefix = "stinging"
name_prefix = "rending"
color = COLOR_PALE_RED_GRAY
debuff_text = "Causes .[debuff_strength] brute drain"
debuff_text = "Causes [debuff_strength/100] brute drain"
if(2) //burn
name_prefix = "searing"
color = COLOR_PALE_ORANGE
debuff_text = "Causes .[debuff_strength] burn drain"
debuff_text = "Causes [debuff_strength/100] burn drain"
if(3) //toxin
name_prefix = "sickening"
name_prefix = "bilious"
color = COLOR_PALE_GREEN_GRAY
debuff_text = "Causes .[debuff_strength] toxin drain"
debuff_text = "Causes [debuff_strength/100] toxin drain"
if(4) //health
name_prefix = "debilitating"
name_prefix = "evanescent"
color = null
debuff_text = "Causes [debuff_strength/5] lower health"
if(5) //stamina
name_prefix = "exhausting"
name_prefix = "exigent"
color = COLOR_PALE_BLUE_GRAY
debuff_text = "Causes .[debuff_strength] stamina drain"
debuff_text = "Causes [debuff_strength/100] stamina drain"
if(6) //speed
name_prefix = "dragging"
name_prefix = "torpid"
color = COLOR_PALE_PURPLE_GRAY
debuff_text = "Causes .[debuff_strength] less movement speed"
debuff_text = "Causes [debuff_strength/100] less movement speed"
if(7) //blood
name_prefix = "weeping"
color = COLOR_RED_GRAY
debuff_text = "Causes .[debuff_strength] blood drain"
debuff_text = "Causes [debuff_strength/100] blood drain"
if(8) //radiation
name_prefix = "discharging"
color = COLOR_GREEN_GRAY
debuff_text = "Causes .[debuff_strength] radiation buildup"
debuff_text = "Causes [debuff_strength/100] radiation buildup"

name = "[name_prefix] [name_suffix]"
..()
Expand All @@ -265,3 +268,132 @@
var/obj/item/artifact/H = AM
return (H.buff_strength*3 - H.debuff_strength)*10 //only change the last number to adjust value

//legendary artifacts don't get the normal initializes
/obj/item/artifact/legendary
name = "debug legendary artifact"
desc = "A bizarre relic with supernatual properties. It causes strange effects when fitted into your armor or jacket."
buff_type = 0 //legendaries use their own, so lay outside the bounds of the standardized switch statement
debuff_type = 0

buff_strength = 100 //maths out to a total value of 3000 per legendary
debuff_strength = 0

//apotheosis holds all possible positives at max value
//this exists as the be all, end all. it should not be found like...ever.
/obj/item/artifact/legendary/apotheosis
name = "Apotheosis"
icon_state = "pustishka"
buff_text = "Most artifacts are flawed in some way or another. This one is not only perfect, but reflects the boons of all lesser artifacts."
buff_strength = 200 //6000 credits
/*
if(M.health > 5)
M.adjustBruteLoss(-0.5, 0, include_roboparts = TRUE)
M.adjustFireLoss(-0.5, 0, include_roboparts = TRUE)
M.adjustToxLoss(-0.5, 0, TRUE)
M.adjustStaminaLoss(-0.5, 0)
if(M.get_blood(TRUE) < (BLOOD_VOLUME_NORMAL*M.blood_ratio && M.get_blood(TRUE) > 250))
M.blood_volume += 0.5
if(M.radiation > 0)
M.radiation -= min(M.radiation, 0.5)
//on add
M.maxHealth += 10
M.health += 10
add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/artifact, TRUE, -0.5)
//on remove
M.maxHealth -= 10
M.health = min(M.health - 10, M.maxHealth)
remove_movespeed_modifier(/datum/movespeed_modifier/artifact)
*/


//perfection holds one positive at max value.
//these should not be easy to get as they run contrary to the concept of artifacts having tradeoffs to balance
/obj/item/artifact/legendary/perfection
name = "Perfection"
icon_state = "pustishka_q"
buff_text = "Most artifacts are flawed in some way or another. This one is perfect."
debuff_type = 0
buff_strength = 50
debuff_strength = 0

/obj/item/artifact/legendary/perfection/Initialize()
buff_type = rand(1,8)

switch(buff_type)
if(1) //brute
name_prefix = "Salubrious"
color = COLOR_PALE_RED_GRAY
debuff_text = "Provides [buff_strength/100] brute regeneration" //uses debuff text because buff text is already in use
if(2) //burn
name_prefix = "Demulcent"
color = COLOR_PALE_ORANGE
debuff_text = "Provides [buff_strength/100] burn regeneration"
if(3) //toxin
name_prefix = "Pure"
color = COLOR_PALE_GREEN_GRAY
debuff_text = "Provides [buff_strength/100] toxin regeneration"
if(4) //health
name_prefix = "Stalwart"
color = null
debuff_text = "Provides [buff_strength/5] health"
if(5) //stamina
name_prefix = "Vigorous"
color = COLOR_PALE_BLUE_GRAY
debuff_text = "Provides [buff_strength/100] stamina regeneration"
if(6) //speed
name_prefix = "Dynamic"
color = COLOR_PALE_PURPLE_GRAY
debuff_text = "Provides [buff_strength/100] movement speed"
if(7) //blood
name_prefix = "Sanguine"
color = COLOR_RED_GRAY
debuff_text = "Provides [buff_strength/100] blood regeneration"
if(8) //radiation
name_prefix = "Luminescent"
color = COLOR_GREEN_GRAY
debuff_text = "Provides [buff_strength/100] radiation regeneration"
..()
//extremely debilitating artifact
/obj/item/artifact/legendary/penance
name = "Penance"
icon_state = "pustishka_old"
buff_text = "This artifact bears all the flaws of the world. May the gods have mercy on any who carry it."
buff_strength = 10 //worth zero
debuff_strength = 30

/*
if(M.health > 5)
M.adjustBruteLoss(0.5, 0, include_roboparts = TRUE)
M.adjustFireLoss(0.5, 0, include_roboparts = TRUE)
M.adjustToxLoss(0.5, 0, TRUE)
if(M.stamina > 100)
M.adjustStaminaLoss(0.5, 0)
if(M.get_blood(TRUE) > 250)
M.blood_volume -= 0.5
if(M.radiation < (RAD_BURN_THRESHOLD - 5))
M.radiation += 0.5
//on add
M.maxHealth -= 10 //dunno if these need switched so health moves then maxhealth
M.health = min(M.health - 10, M.maxHealth)
add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/artifact, TRUE, 0.5)
ADD_TRAIT(M.mind, TRAIT_PENANCE) //make sure putting a second penance in your inventory doesn't cause some weird trait duplication
//on remove
M.maxHealth += 10
M.health += 10
remove_movespeed_modifier(/datum/movespeed_modifier/artifact)
REMOVE_TRAIT(M.mind, TRAIT_PENANCE) //...probably needs a check to be sure it's the last penance in your coat
*/

/obj/item/artifact/legendary/bubble //luv u dan
name = "Bubble"
icon_state = "bubble"
buff_text = "Some call this artifact the Cornucopia."

/*
if(!HAS_TRAIT(M, TRAIT_NO_PROCESS_FOOD)) //this is copypasted, so not sure if it's all correct
current_cycle++
M.adjust_nutrition(1, max_nutrition) //a quarter the nutrient value of standard food, but persistent
M.CheckBloodsuckerEatFood(1)
*/
6 changes: 5 additions & 1 deletion code/modules/mob/living/death.dm
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@

var/turf/T = get_turf(src)
if(mind && mind.name && mind.active && !istype(T.loc, /area/ctf) && !(signal & COMPONENT_BLOCK_DEATH_BROADCAST))
var/rendered = "<span class='deadsay'><b>[mind.name]</b> has died at <b>[get_area_name(T)]</b>.</span>"
var/rendered
if(HAS_TRAIT(mind, TRAIT_PENANCE))
rendered = "<span class='deadsay'><b>[mind.name]</b> has died at <b>[get_area_name(T)]</b>. They bore their penance to the grave. Perhaps the Gods will have mercy on them.</span>"
else
rendered = "<span class='deadsay'><b>[mind.name]</b> has died at <b>[get_area_name(T)]</b>.</span>"
deadchat_broadcast(rendered, follow_target = src, turf_target = T, message_type=DEADCHAT_DEATHRATTLE)
if (client && client.prefs && client.prefs.auto_ooc)
if (!(client.prefs.chat_toggles & CHAT_OOC))
Expand Down
Binary file modified icons/obj/artifacts.dmi
Binary file not shown.

0 comments on commit bdcbacf

Please sign in to comment.