From 36a785a3fc36a660554ffcedfc01f0327e126d0d Mon Sep 17 00:00:00 2001 From: Sharkmare <34294231+Sharkmare@users.noreply.github.com> Date: Fri, 5 Mar 2021 08:51:20 +0100 Subject: [PATCH 1/9] Carbon shadekin Content update Adds Shadekin species specific traits to change their eye color adaptation. Reworks phasing to take into account liight condition and observers Adds a new attack to shadekin that allows them to drain energy from carbons via attacking (this is for the aggressive boyos) Each eye type has their own stats just like the mob versions had. Essentially this update makes carbon shadekin be on par and even better than mob shadekin for most purposes. As well as giving counterplay to phaseshifting. --- .../carbon/human/species/shadekin/_defines.dm | 11 +- .../species/shadekin/shadekin_abilities.dm | 4 +- .../human/species/shadekin/shadekin_zz_ch.dm | 168 ++++++++++++++++++ .../human/species/station/station_ch.dm | 2 +- vorestation.dme | 3 +- 5 files changed, 184 insertions(+), 4 deletions(-) create mode 100644 code/modules/mob/living/carbon/human/species/shadekin/shadekin_zz_ch.dm diff --git a/code/modules/mob/living/carbon/human/species/shadekin/_defines.dm b/code/modules/mob/living/carbon/human/species/shadekin/_defines.dm index f24544e0b2..ab5695ca46 100644 --- a/code/modules/mob/living/carbon/human/species/shadekin/_defines.dm +++ b/code/modules/mob/living/carbon/human/species/shadekin/_defines.dm @@ -3,4 +3,13 @@ #define SHIFTED_OR_NOT 3 #define AB_PHASE_SHIFTED 0x1 -#define AB_SHADE_REGEN 0x2 \ No newline at end of file +#define AB_SHADE_REGEN 0x2 + +//CHOMPADDITION: KIN TYPES +#define BLUE_EYES 1 +#define RED_EYES 2 +#define PURPLE_EYES 3 +#define YELLOW_EYES 4 +#define GREEN_EYES 5 +#define ORANGE_EYES 6 +//CHOPADITION END \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/species/shadekin/shadekin_abilities.dm b/code/modules/mob/living/carbon/human/species/shadekin/shadekin_abilities.dm index c1c9ad064b..e8967c3600 100644 --- a/code/modules/mob/living/carbon/human/species/shadekin/shadekin_abilities.dm +++ b/code/modules/mob/living/carbon/human/species/shadekin/shadekin_abilities.dm @@ -33,6 +33,7 @@ var/ability_cost = 100 + var/datum/species/shadekin/SK = species if(!istype(SK)) to_chat(src, "Only a shadekin can use that!") @@ -40,6 +41,7 @@ else if(stat) to_chat(src, "Can't use that ability in your state!") return FALSE + else if(shadekin_get_energy() < ability_cost && !(ability_flags & AB_PHASE_SHIFTED)) to_chat(src, "Not enough energy for that ability!") return FALSE @@ -48,7 +50,7 @@ shadekin_adjust_energy(-ability_cost) playsound(src, 'sound/effects/stealthoff.ogg', 75, 1) - var/turf/T = get_turf(src) + //var/turf/T = get_turf(src) //CHOMPREMOVAL: This is done earlier since we need it to get lighting if(!T.CanPass(src,T) || loc != T) to_chat(src,"You can't use that here!") return FALSE diff --git a/code/modules/mob/living/carbon/human/species/shadekin/shadekin_zz_ch.dm b/code/modules/mob/living/carbon/human/species/shadekin/shadekin_zz_ch.dm new file mode 100644 index 0000000000..2c4145ee6a --- /dev/null +++ b/code/modules/mob/living/carbon/human/species/shadekin/shadekin_zz_ch.dm @@ -0,0 +1,168 @@ +/datum/species/shadekin + siemens_coefficient = 1 + //SHADEKIN-UNIQUE STUFF GOES HERE + shadekin_abilities = list(/datum/power/shadekin/phase_shift, + /datum/power/shadekin/regenerate_other, + /datum/power/shadekin/create_shade) + shadekin_ability_datums = list() + var/kin_type + +/datum/species/shadekin/handle_shade(var/mob/living/carbon/human/H) + //Shifted kin don't gain/lose energy (and save time if we're at the cap) + var/darkness = 1 + var/dark_gains = 0 + + var/turf/T = get_turf(H) + if(!T) + dark_gains = 0 + return + + var/brightness = T.get_lumcount() //Brightness in 0.0 to 1.0 + darkness = 1-brightness //Invert + var/is_dark = (darkness >= 0.5) + + if(H.ability_flags & AB_PHASE_SHIFTED) + dark_gains = 0 + else + //Heal (very) slowly in good darkness + if(is_dark) + H.adjustFireLoss((-0.10)*darkness) + H.adjustBruteLoss((-0.10)*darkness) + H.adjustToxLoss((-0.10)*darkness) + dark_gains = 0.75 + else + dark_gains = 0.25 + +//HANDLING FOR KIN EYE TRAITS + if(kin_type) + switch(kin_type) + if(BLUE_EYES) + dark_gains = 0.5 + if(RED_EYES) + if(is_dark) + dark_gains = 0.1 + else + dark_gains = -1 + if(PURPLE_EYES) + if(is_dark) + dark_gains = 1 + else + dark_gains = -0.5 + if(YELLOW_EYES) + if(is_dark) + dark_gains = 3 + else + dark_gains = -2 + if(GREEN_EYES) + if(is_dark) + dark_gains = 2 + else + dark_gains = 0.125 + if(ORANGE_EYES) + if(is_dark) + dark_gains = 0.25 + else + dark_gains = -0.5 +//These are balanced around their playstyles and 2 planned new aggressive abilities + + set_energy(H, get_energy(H) + dark_gains) + + //Update huds + update_shadekin_hud(H) + +/datum/trait/kintype + banned_species = list( SPECIES_AKULA, + SPECIES_ALRAUNE, + SPECIES_NEVREAN, + SPECIES_PROTEAN, + SPECIES_RAPALA, + SPECIES_SERGAL, + SPECIES_SHADEKIN_CREW, + SPECIES_VASILISSAN, + SPECIES_VULPKANIN, + SPECIES_XENOCHIMERA, + SPECIES_ZORREN_HIGH, + SPECIES_CUSTOM, + SPECIES_WEREBEAST, + SPECIES_FENNEC, + SPECIES_XENOHYBRID, + SPECIES_VOX, + SPECIES_ZADDAT, + SPECIES_PROMETHEAN) + var/color = "Blue" + desc = "Makes your shadekin adapted as a Blue eyed kin! This gives you decreased energy regeneration in darkness, decreased regeneration in the light amd unchanged health!" + cost = 0 + var_changes = list( "total_health" = 100, + "unarmed_types" = list(/datum/unarmed_attack/stomp, /datum/unarmed_attack/kick,/datum/unarmed_attack/shadekinharmbap)) + custom_only = FALSE + +/datum/trait/kintype/New() + ..() + name = "Shadekin [color] Adaption" //This works but desc can not be changed here sadly. + +/datum/trait/kintype/red + color = "Red" + desc = "Makes your shadekin adapted as a Red eyed kin! This gives you minimal energy regeneration in darkness, moderate regeneration in the light amd increased health!" + var_changes = list( "total_health" = 200, + "unarmed_types" = list(/datum/unarmed_attack/stomp, /datum/unarmed_attack/kick,/datum/unarmed_attack/shadekinharmbap)) +/datum/trait/kintype/purple + color = "Purple" + desc = "Makes your shadekin adapted as a Purple eyed kin! This gives you moderate energy regeneration in darkness, minor degeneration in the light amd increased health!" + var_changes = list( "total_health" = 150, + "unarmed_types" = list(/datum/unarmed_attack/stomp, /datum/unarmed_attack/kick,/datum/unarmed_attack/shadekinharmbap)) + +/datum/trait/kintype/yellow + color = "Yellow" + desc = "Makes your shadekin adapted as a Yellow eyed kin! This gives you the highest energy regeneration in darkness, high degeneration in the light amd unchanged health!" + var_changes = list( "total_health" = 100, + "unarmed_types" = list(/datum/unarmed_attack/stomp, /datum/unarmed_attack/kick,/datum/unarmed_attack/shadekinharmbap)) + +/datum/trait/kintype/green + color = "Green" + desc = "Makes your shadekin adapted as a Green eyed kin! This gives you high energy regeneration in darkness, minor regeneration in the light amd unchanged health!" + var_changes = list( "total_health" = 100, + "unarmed_types" = list(/datum/unarmed_attack/stomp, /datum/unarmed_attack/kick,/datum/unarmed_attack/shadekinharmbap)) + +/datum/trait/kintype/orange + color = "Orange" + desc = "Makes your shadekin adapted as a Orange eyed kin! This gives you minor energy regeneration in darkness, modeate degeneration in the light amd increased health!" + var_changes = list( "total_health" = 175, + "unarmed_types" = list(/datum/unarmed_attack/stomp, /datum/unarmed_attack/kick,/datum/unarmed_attack/shadekinharmbap)) + +/datum/trait/kintype/apply(var/datum/species/shadekin/S,var/mob/living/carbon/human/H) + switch(color) + if("Blue") + H.shapeshifter_set_eye_color("0000FF") + S.kin_type = BLUE_EYES + if("Red") + H.shapeshifter_set_eye_color("FF0000") + S.kin_type = RED_EYES + if("Green") + H.shapeshifter_set_eye_color("00FF00") + S.kin_type = GREEN_EYES + if("Purple") + H.shapeshifter_set_eye_color("FF00FF") + S.kin_type = PURPLE_EYES + if("Yellow") + H.shapeshifter_set_eye_color("FFFF00") + S.kin_type = YELLOW_EYES + if("Orange") + H.shapeshifter_set_eye_color("FFA500") + S.kin_type = ORANGE_EYES + + +/datum/unarmed_attack/shadekinharmbap + attack_name = "syphon strike" + attack_verb = list("hit", "clawed", "slashed", "scratched") + attack_sound = 'sound/weapons/slice.ogg' + miss_sound = 'sound/weapons/slashmiss.ogg' + shredding = 0 + +/datum/unarmed_attack/shadekinharmbap/apply_effects(var/mob/living/carbon/human/shadekin/user,var/mob/living/carbon/human/target,var/armour,var/attack_damage,var/zone) + ..() + if(user == target) //Prevent self attack to gain energy + return + var/obj/item/organ/internal/brain/shadekin/shade_organ = user.internal_organs_by_name[O_BRAIN] + if(!istype(shade_organ)) + return + shade_organ.dark_energy = CLAMP(shade_organ.dark_energy + attack_damage,0,shade_organ.max_dark_energy) //Convert Damage done to Energy Gained \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/species/station/station_ch.dm b/code/modules/mob/living/carbon/human/species/station/station_ch.dm index 95970a1a64..77e80b2be9 100644 --- a/code/modules/mob/living/carbon/human/species/station/station_ch.dm +++ b/code/modules/mob/living/carbon/human/species/station/station_ch.dm @@ -23,7 +23,7 @@ spawn_flags = SPECIES_IS_RESTRICTED /datum/species/shadekin - spawn_flags = SPECIES_IS_RESTRICTED + //spawn_flags = SPECIES_IS_RESTRICTED //datum/species/protean // spawn_flags = SPECIES_IS_RESTRICTED diff --git a/vorestation.dme b/vorestation.dme index 65717ed22d..2002226894 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -1377,8 +1377,8 @@ #include "code\game\objects\items\weapons\grenades\spawnergrenade_vr.dm" #include "code\game\objects\items\weapons\grenades\supermatter.dm" #include "code\game\objects\items\weapons\id cards\cards.dm" -#include "code\game\objects\items\weapons\id cards\CH_ids.dm" #include "code\game\objects\items\weapons\id cards\cards_vr.dm" +#include "code\game\objects\items\weapons\id cards\CH_ids.dm" #include "code\game\objects\items\weapons\id cards\station_ids.dm" #include "code\game\objects\items\weapons\id cards\station_ids_vr.dm" #include "code\game\objects\items\weapons\id cards\syndicate_ids.dm" @@ -2791,6 +2791,7 @@ #include "code\modules\mob\living\carbon\human\species\shadekin\shadekin.dm" #include "code\modules\mob\living\carbon\human\species\shadekin\shadekin_abilities.dm" #include "code\modules\mob\living\carbon\human\species\shadekin\shadekin_hud.dm" +#include "code\modules\mob\living\carbon\human\species\shadekin\shadekin_zz_ch.dm" #include "code\modules\mob\living\carbon\human\species\station\alraune.dm" #include "code\modules\mob\living\carbon\human\species\station\blank_vr.dm" #include "code\modules\mob\living\carbon\human\species\station\golem.dm" From 01da72ac5d48814f4381fdbcb4b41297d9ae4c37 Mon Sep 17 00:00:00 2001 From: Sharkmare <34294231+Sharkmare@users.noreply.github.com> Date: Fri, 5 Mar 2021 08:51:58 +0100 Subject: [PATCH 2/9] Accidentally didnt push this change --- .../species/shadekin/shadekin_abilities.dm | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/code/modules/mob/living/carbon/human/species/shadekin/shadekin_abilities.dm b/code/modules/mob/living/carbon/human/species/shadekin/shadekin_abilities.dm index e8967c3600..389a160e27 100644 --- a/code/modules/mob/living/carbon/human/species/shadekin/shadekin_abilities.dm +++ b/code/modules/mob/living/carbon/human/species/shadekin/shadekin_abilities.dm @@ -33,6 +33,26 @@ var/ability_cost = 100 +//CHOMADDITION Conditional shifting ased on observers and darkness + var/darkness = 1 + var/turf/T = get_turf(src) + if(!T) + to_chat(src,"You can't use that here!") + return FALSE + + var/brightness = T.get_lumcount() //Brightness in 0.0 to 1.0 + darkness = 1-brightness //Invert + + var/watcher =-1 + for(var/mob/living/carbon/human/watchers in view_or_range(7,get_turf(src),"range" )) + watcher++ + + ability_cost = CLAMP(ability_cost/(0.01+darkness*2),50, 80)//This allows for 1 watcher in full light + if(watcher>0) + ability_cost = ability_cost + ( 15 * watcher ) + if(!(ability_flags & AB_PHASE_SHIFTED)) + log_debug("[src] attempted to shift with [watcher] visible Carbons and it cost [ability_cost] in a darkness level of [darkness]") +//CHOMADDITION END var/datum/species/shadekin/SK = species if(!istype(SK)) From 06d969a96792142c6dad58203f52468accf3571b Mon Sep 17 00:00:00 2001 From: Sharkmare <34294231+Sharkmare@users.noreply.github.com> Date: Sat, 6 Mar 2021 17:23:41 +0100 Subject: [PATCH 3/9] Species whitelist for traits Tunes up the trait system to have a whitelist AND a blacklist so you can choose whichever makes you have to write the lowest amount of code --- .../client/preference_setup/vore/07_traits.dm | 8 ++++---- .../human/species/shadekin/shadekin_zz_ch.dm | 19 +------------------ .../species/station/traits_vr/trait_ch.dm | 1 + 3 files changed, 6 insertions(+), 22 deletions(-) diff --git a/code/modules/client/preference_setup/vore/07_traits.dm b/code/modules/client/preference_setup/vore/07_traits.dm index 04ee5a32ed..503727ee6f 100644 --- a/code/modules/client/preference_setup/vore/07_traits.dm +++ b/code/modules/client/preference_setup/vore/07_traits.dm @@ -41,7 +41,7 @@ S["traits_cheating"] >> pref.traits_cheating S["max_traits"] >> pref.max_traits S["trait_points"] >> pref.starting_trait_points - + S["custom_say"] >> pref.custom_say S["custom_whisper"] >> pref.custom_whisper S["custom_ask"] >> pref.custom_ask @@ -58,7 +58,7 @@ S["traits_cheating"] << pref.traits_cheating S["max_traits"] << pref.max_traits S["trait_points"] << pref.starting_trait_points - + S["custom_say"] << pref.custom_say S["custom_whisper"] << pref.custom_whisper S["custom_ask"] << pref.custom_ask @@ -179,7 +179,7 @@ . += "Set Color" . += "R
" . += "
" - + . += "Custom Say: " . += "Set Say Verb
" . += "Custom Whisper: " @@ -345,7 +345,7 @@ pref.gross_meatbag = 0 //Just to be sure return TOPIC_REFRESH - if(pref.species in instance.banned_species) + if(pref.species in instance.banned_species || (LAZYLEN(instance.allowed_species) && !(pref.species in instance.allowed_species))) //CHOMPEDIT: Whitelising! alert("The trait you've selected cannot be taken by the species you've chosen!","Error") return TOPIC_REFRESH diff --git a/code/modules/mob/living/carbon/human/species/shadekin/shadekin_zz_ch.dm b/code/modules/mob/living/carbon/human/species/shadekin/shadekin_zz_ch.dm index 2c4145ee6a..bf6c3cd249 100644 --- a/code/modules/mob/living/carbon/human/species/shadekin/shadekin_zz_ch.dm +++ b/code/modules/mob/living/carbon/human/species/shadekin/shadekin_zz_ch.dm @@ -71,24 +71,7 @@ update_shadekin_hud(H) /datum/trait/kintype - banned_species = list( SPECIES_AKULA, - SPECIES_ALRAUNE, - SPECIES_NEVREAN, - SPECIES_PROTEAN, - SPECIES_RAPALA, - SPECIES_SERGAL, - SPECIES_SHADEKIN_CREW, - SPECIES_VASILISSAN, - SPECIES_VULPKANIN, - SPECIES_XENOCHIMERA, - SPECIES_ZORREN_HIGH, - SPECIES_CUSTOM, - SPECIES_WEREBEAST, - SPECIES_FENNEC, - SPECIES_XENOHYBRID, - SPECIES_VOX, - SPECIES_ZADDAT, - SPECIES_PROMETHEAN) + allowed_species = list(SPECIES_SHADEKIN) var/color = "Blue" desc = "Makes your shadekin adapted as a Blue eyed kin! This gives you decreased energy regeneration in darkness, decreased regeneration in the light amd unchanged health!" cost = 0 diff --git a/code/modules/mob/living/carbon/human/species/station/traits_vr/trait_ch.dm b/code/modules/mob/living/carbon/human/species/station/traits_vr/trait_ch.dm index 662d3ebdc0..fd1f15ccdd 100644 --- a/code/modules/mob/living/carbon/human/species/station/traits_vr/trait_ch.dm +++ b/code/modules/mob/living/carbon/human/species/station/traits_vr/trait_ch.dm @@ -1,5 +1,6 @@ /datum/trait var/special_env = FALSE + var/list/allowed_species // A list of species that CAN take this trait, use this if only 1 species can use it. -shark /datum/trait/proc/handle_environment_special(var/mob/living/carbon/human/H) return From 70299a10462d3d681052092225342306c397d799 Mon Sep 17 00:00:00 2001 From: Sharkmare <34294231+Sharkmare@users.noreply.github.com> Date: Sat, 6 Mar 2021 17:41:21 +0100 Subject: [PATCH 4/9] Unifying how to check for kin type Was checking a string before with color,, now instead we are checking against the ints that are associated with specific vvariables. --- .../human/species/shadekin/shadekin_zz_ch.dm | 55 +++++++++---------- 1 file changed, 26 insertions(+), 29 deletions(-) diff --git a/code/modules/mob/living/carbon/human/species/shadekin/shadekin_zz_ch.dm b/code/modules/mob/living/carbon/human/species/shadekin/shadekin_zz_ch.dm index bf6c3cd249..3df0468bf7 100644 --- a/code/modules/mob/living/carbon/human/species/shadekin/shadekin_zz_ch.dm +++ b/code/modules/mob/living/carbon/human/species/shadekin/shadekin_zz_ch.dm @@ -72,66 +72,63 @@ /datum/trait/kintype allowed_species = list(SPECIES_SHADEKIN) - var/color = "Blue" + var/color = BLUE_EYES desc = "Makes your shadekin adapted as a Blue eyed kin! This gives you decreased energy regeneration in darkness, decreased regeneration in the light amd unchanged health!" cost = 0 var_changes = list( "total_health" = 100, "unarmed_types" = list(/datum/unarmed_attack/stomp, /datum/unarmed_attack/kick,/datum/unarmed_attack/shadekinharmbap)) custom_only = FALSE -/datum/trait/kintype/New() - ..() - name = "Shadekin [color] Adaption" //This works but desc can not be changed here sadly. - /datum/trait/kintype/red - color = "Red" + name = "Shadekin Red Adaption" + color = RED_EYES desc = "Makes your shadekin adapted as a Red eyed kin! This gives you minimal energy regeneration in darkness, moderate regeneration in the light amd increased health!" var_changes = list( "total_health" = 200, "unarmed_types" = list(/datum/unarmed_attack/stomp, /datum/unarmed_attack/kick,/datum/unarmed_attack/shadekinharmbap)) /datum/trait/kintype/purple - color = "Purple" + name = "Shadekin Purple Adaption" + color = PURPLE_EYES desc = "Makes your shadekin adapted as a Purple eyed kin! This gives you moderate energy regeneration in darkness, minor degeneration in the light amd increased health!" var_changes = list( "total_health" = 150, "unarmed_types" = list(/datum/unarmed_attack/stomp, /datum/unarmed_attack/kick,/datum/unarmed_attack/shadekinharmbap)) /datum/trait/kintype/yellow - color = "Yellow" + name = "Shadekin Yellow Adaption" + color = YELLOW_EYES desc = "Makes your shadekin adapted as a Yellow eyed kin! This gives you the highest energy regeneration in darkness, high degeneration in the light amd unchanged health!" var_changes = list( "total_health" = 100, "unarmed_types" = list(/datum/unarmed_attack/stomp, /datum/unarmed_attack/kick,/datum/unarmed_attack/shadekinharmbap)) /datum/trait/kintype/green - color = "Green" + name = "Shadekin Green Adaption" + color = GREEN_EYES desc = "Makes your shadekin adapted as a Green eyed kin! This gives you high energy regeneration in darkness, minor regeneration in the light amd unchanged health!" var_changes = list( "total_health" = 100, "unarmed_types" = list(/datum/unarmed_attack/stomp, /datum/unarmed_attack/kick,/datum/unarmed_attack/shadekinharmbap)) /datum/trait/kintype/orange - color = "Orange" + name = "Shadekin Orange Adaption" + color = ORANGE_EYES desc = "Makes your shadekin adapted as a Orange eyed kin! This gives you minor energy regeneration in darkness, modeate degeneration in the light amd increased health!" var_changes = list( "total_health" = 175, "unarmed_types" = list(/datum/unarmed_attack/stomp, /datum/unarmed_attack/kick,/datum/unarmed_attack/shadekinharmbap)) /datum/trait/kintype/apply(var/datum/species/shadekin/S,var/mob/living/carbon/human/H) - switch(color) - if("Blue") - H.shapeshifter_set_eye_color("0000FF") - S.kin_type = BLUE_EYES - if("Red") - H.shapeshifter_set_eye_color("FF0000") - S.kin_type = RED_EYES - if("Green") - H.shapeshifter_set_eye_color("00FF00") - S.kin_type = GREEN_EYES - if("Purple") - H.shapeshifter_set_eye_color("FF00FF") - S.kin_type = PURPLE_EYES - if("Yellow") - H.shapeshifter_set_eye_color("FFFF00") - S.kin_type = YELLOW_EYES - if("Orange") - H.shapeshifter_set_eye_color("FFA500") - S.kin_type = ORANGE_EYES + if(color) + S.kin_type = color + switch(color) + if(BLUE_EYES) + H.shapeshifter_set_eye_color("0000FF") + if(RED_EYES) + H.shapeshifter_set_eye_color("FF0000") + if(GREEN_EYES) + H.shapeshifter_set_eye_color("00FF00") + if(PURPLE_EYES) + H.shapeshifter_set_eye_color("FF00FF") + if(YELLOW_EYES) + H.shapeshifter_set_eye_color("FFFF00") + if(ORANGE_EYES) + H.shapeshifter_set_eye_color("FFA500") /datum/unarmed_attack/shadekinharmbap From 546b39a39544bae4e9a0aef2c7c446cc0353210e Mon Sep 17 00:00:00 2001 From: Sharkmare <34294231+Sharkmare@users.noreply.github.com> Date: Sat, 6 Mar 2021 17:54:16 +0100 Subject: [PATCH 5/9] Putting whitie and black togehter apparently breaks So its a code block of its own --- code/modules/client/preference_setup/vore/07_traits.dm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/code/modules/client/preference_setup/vore/07_traits.dm b/code/modules/client/preference_setup/vore/07_traits.dm index 503727ee6f..3f5a27bd30 100644 --- a/code/modules/client/preference_setup/vore/07_traits.dm +++ b/code/modules/client/preference_setup/vore/07_traits.dm @@ -345,10 +345,16 @@ pref.gross_meatbag = 0 //Just to be sure return TOPIC_REFRESH - if(pref.species in instance.banned_species || (LAZYLEN(instance.allowed_species) && !(pref.species in instance.allowed_species))) //CHOMPEDIT: Whitelising! + if(pref.species in instance.banned_species) alert("The trait you've selected cannot be taken by the species you've chosen!","Error") return TOPIC_REFRESH + //CHOMPADDITION START Adding whitelist for traits + if( LAZYLEN(instance.allowed_species) && !(pref.species in instance.allowed_species)) //Adding white list handling -shark + alert("The trait you've selected cannot be taken by the species you've chosen!","Error") + return TOPIC_REFRESH + //CHOMPADDITION END + if(trait_choice in pref.pos_traits + pref.neu_traits + pref.neg_traits) conflict = instance.name From 9562bb7b1774c3125800be4d1ee4ab1c65f6972c Mon Sep 17 00:00:00 2001 From: cadyn Date: Sat, 6 Mar 2021 10:17:54 -0800 Subject: [PATCH 6/9] Quick fixes + Cleanliness Got rid of the nasty switch block in the handle_shade and replaced it with two variables set by the traits. Fixed spelling, added ..() to the apply for the shadekin traits so they apply properly. Added a check to make sure players don't spawn with traits their species shouldn't have. --- .../human/species/shadekin/shadekin_zz_ch.dm | 66 ++++++++----------- code/modules/mob/new_player/new_player_vr.dm | 12 ++++ 2 files changed, 38 insertions(+), 40 deletions(-) diff --git a/code/modules/mob/living/carbon/human/species/shadekin/shadekin_zz_ch.dm b/code/modules/mob/living/carbon/human/species/shadekin/shadekin_zz_ch.dm index 3df0468bf7..46ac0e9197 100644 --- a/code/modules/mob/living/carbon/human/species/shadekin/shadekin_zz_ch.dm +++ b/code/modules/mob/living/carbon/human/species/shadekin/shadekin_zz_ch.dm @@ -6,6 +6,8 @@ /datum/power/shadekin/create_shade) shadekin_ability_datums = list() var/kin_type + var/energy_light = 0.25 + var/energy_dark = 0.75 /datum/species/shadekin/handle_shade(var/mob/living/carbon/human/H) //Shifted kin don't gain/lose energy (and save time if we're at the cap) @@ -29,41 +31,11 @@ H.adjustFireLoss((-0.10)*darkness) H.adjustBruteLoss((-0.10)*darkness) H.adjustToxLoss((-0.10)*darkness) - dark_gains = 0.75 + //energy_dark and energy_light are set by the shadekin eye traits. + //These are balanced around their playstyles and 2 planned new aggressive abilities + dark_gains = energy_dark else - dark_gains = 0.25 - -//HANDLING FOR KIN EYE TRAITS - if(kin_type) - switch(kin_type) - if(BLUE_EYES) - dark_gains = 0.5 - if(RED_EYES) - if(is_dark) - dark_gains = 0.1 - else - dark_gains = -1 - if(PURPLE_EYES) - if(is_dark) - dark_gains = 1 - else - dark_gains = -0.5 - if(YELLOW_EYES) - if(is_dark) - dark_gains = 3 - else - dark_gains = -2 - if(GREEN_EYES) - if(is_dark) - dark_gains = 2 - else - dark_gains = 0.125 - if(ORANGE_EYES) - if(is_dark) - dark_gains = 0.25 - else - dark_gains = -0.5 -//These are balanced around their playstyles and 2 planned new aggressive abilities + dark_gains = energy_light set_energy(H, get_energy(H) + dark_gains) @@ -73,49 +45,63 @@ /datum/trait/kintype allowed_species = list(SPECIES_SHADEKIN) var/color = BLUE_EYES + name = "Shadekin Blue Adaptation" desc = "Makes your shadekin adapted as a Blue eyed kin! This gives you decreased energy regeneration in darkness, decreased regeneration in the light amd unchanged health!" cost = 0 var_changes = list( "total_health" = 100, + "energy_light" = 0.5, + "energy_dark" = 0.5, "unarmed_types" = list(/datum/unarmed_attack/stomp, /datum/unarmed_attack/kick,/datum/unarmed_attack/shadekinharmbap)) custom_only = FALSE /datum/trait/kintype/red - name = "Shadekin Red Adaption" + name = "Shadekin Red Adaptation" color = RED_EYES desc = "Makes your shadekin adapted as a Red eyed kin! This gives you minimal energy regeneration in darkness, moderate regeneration in the light amd increased health!" var_changes = list( "total_health" = 200, + "energy_light" = -1, + "energy_dark" = 0.1, "unarmed_types" = list(/datum/unarmed_attack/stomp, /datum/unarmed_attack/kick,/datum/unarmed_attack/shadekinharmbap)) /datum/trait/kintype/purple - name = "Shadekin Purple Adaption" + name = "Shadekin Purple Adaptation" color = PURPLE_EYES desc = "Makes your shadekin adapted as a Purple eyed kin! This gives you moderate energy regeneration in darkness, minor degeneration in the light amd increased health!" var_changes = list( "total_health" = 150, + "energy_light" = 1, + "energy_dark" = -0.5, "unarmed_types" = list(/datum/unarmed_attack/stomp, /datum/unarmed_attack/kick,/datum/unarmed_attack/shadekinharmbap)) /datum/trait/kintype/yellow - name = "Shadekin Yellow Adaption" + name = "Shadekin Yellow Adaptation" color = YELLOW_EYES desc = "Makes your shadekin adapted as a Yellow eyed kin! This gives you the highest energy regeneration in darkness, high degeneration in the light amd unchanged health!" var_changes = list( "total_health" = 100, + "energy_light" = 3, + "energy_dark" = -2, "unarmed_types" = list(/datum/unarmed_attack/stomp, /datum/unarmed_attack/kick,/datum/unarmed_attack/shadekinharmbap)) /datum/trait/kintype/green - name = "Shadekin Green Adaption" + name = "Shadekin Green Adaptation" color = GREEN_EYES desc = "Makes your shadekin adapted as a Green eyed kin! This gives you high energy regeneration in darkness, minor regeneration in the light amd unchanged health!" var_changes = list( "total_health" = 100, + "energy_light" = 2, + "energy_dark" = 0.125, "unarmed_types" = list(/datum/unarmed_attack/stomp, /datum/unarmed_attack/kick,/datum/unarmed_attack/shadekinharmbap)) /datum/trait/kintype/orange - name = "Shadekin Orange Adaption" + name = "Shadekin Orange Adaptation" color = ORANGE_EYES desc = "Makes your shadekin adapted as a Orange eyed kin! This gives you minor energy regeneration in darkness, modeate degeneration in the light amd increased health!" var_changes = list( "total_health" = 175, + "energy_light" = 0.25, + "energy_dark" = -0.5, "unarmed_types" = list(/datum/unarmed_attack/stomp, /datum/unarmed_attack/kick,/datum/unarmed_attack/shadekinharmbap)) /datum/trait/kintype/apply(var/datum/species/shadekin/S,var/mob/living/carbon/human/H) - if(color) + if(color && istype(S)) //Sanity check to see if they're actually a shadekin, otherwise just don't do anything. They shouldn't be able to spawn with the trait. S.kin_type = color + ..(S,H) switch(color) if(BLUE_EYES) H.shapeshifter_set_eye_color("0000FF") diff --git a/code/modules/mob/new_player/new_player_vr.dm b/code/modules/mob/new_player/new_player_vr.dm index a317e9a0d9..640e0df388 100644 --- a/code/modules/mob/new_player/new_player_vr.dm +++ b/code/modules/mob/new_player/new_player_vr.dm @@ -62,6 +62,18 @@ pass = FALSE to_chat(src,"Your custom species is not playable. Reconfigure your traits on the VORE tab.") + //CHOMP Addition Begin + if(client?.prefs?.neu_traits) + for(var/T in client.prefs.neu_traits) + var/datum/trait/instance = all_traits[T] + if(client.prefs.species in instance.banned_species) + pass = FALSE + to_chat(src,"One of your traits, [instance.name], is not available for your species! Please fix this conflict and then try again.") + else if(LAZYLEN(instance.allowed_species) && !(client.prefs.species in instance.allowed_species)) //We use else if here, so as to prevent getting two errors for one trait. + pass = FALSE + to_chat(src,"One of your traits, [instance.name], is not available for your species! Please fix this conflict and then try again.") + //CHOMP Addition End + //Final popup notice if (!pass) spawn() From 400a89c5e7e0d28585d404d8826c499eab4d8321 Mon Sep 17 00:00:00 2001 From: cadyn Date: Sat, 6 Mar 2021 10:22:02 -0800 Subject: [PATCH 7/9] HTML tag fix --- code/modules/mob/new_player/new_player_vr.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/new_player/new_player_vr.dm b/code/modules/mob/new_player/new_player_vr.dm index 640e0df388..2c48e766f5 100644 --- a/code/modules/mob/new_player/new_player_vr.dm +++ b/code/modules/mob/new_player/new_player_vr.dm @@ -68,10 +68,10 @@ var/datum/trait/instance = all_traits[T] if(client.prefs.species in instance.banned_species) pass = FALSE - to_chat(src,"One of your traits, [instance.name], is not available for your species! Please fix this conflict and then try again.") + to_chat(src,"One of your traits, [instance.name], is not available for your species! Please fix this conflict and then try again.") else if(LAZYLEN(instance.allowed_species) && !(client.prefs.species in instance.allowed_species)) //We use else if here, so as to prevent getting two errors for one trait. pass = FALSE - to_chat(src,"One of your traits, [instance.name], is not available for your species! Please fix this conflict and then try again.") + to_chat(src,"One of your traits, [instance.name], is not available for your species! Please fix this conflict and then try again.") //CHOMP Addition End //Final popup notice From 0ce76c2737ab43448d2412770b32c7abd7758ee3 Mon Sep 17 00:00:00 2001 From: Sharkmare <34294231+Sharkmare@users.noreply.github.com> Date: Sun, 7 Mar 2021 05:22:52 +0100 Subject: [PATCH 8/9] typo --- .../mob/living/carbon/human/species/shadekin/_defines.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/living/carbon/human/species/shadekin/_defines.dm b/code/modules/mob/living/carbon/human/species/shadekin/_defines.dm index ab5695ca46..ac5ffdb997 100644 --- a/code/modules/mob/living/carbon/human/species/shadekin/_defines.dm +++ b/code/modules/mob/living/carbon/human/species/shadekin/_defines.dm @@ -12,4 +12,4 @@ #define YELLOW_EYES 4 #define GREEN_EYES 5 #define ORANGE_EYES 6 -//CHOPADITION END \ No newline at end of file +//CHOMPADDITION END From b208ab4862173b185fa59a819e69afabe94a462f Mon Sep 17 00:00:00 2001 From: Sharkmare <34294231+Sharkmare@users.noreply.github.com> Date: Sun, 7 Mar 2021 05:23:20 +0100 Subject: [PATCH 9/9] typo --- .../carbon/human/species/shadekin/shadekin_abilities.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/modules/mob/living/carbon/human/species/shadekin/shadekin_abilities.dm b/code/modules/mob/living/carbon/human/species/shadekin/shadekin_abilities.dm index 389a160e27..5a3a18a8b7 100644 --- a/code/modules/mob/living/carbon/human/species/shadekin/shadekin_abilities.dm +++ b/code/modules/mob/living/carbon/human/species/shadekin/shadekin_abilities.dm @@ -33,7 +33,7 @@ var/ability_cost = 100 -//CHOMADDITION Conditional shifting ased on observers and darkness +//CHOMPADDITION Conditional shifting ased on observers and darkness var/darkness = 1 var/turf/T = get_turf(src) if(!T) @@ -52,7 +52,7 @@ ability_cost = ability_cost + ( 15 * watcher ) if(!(ability_flags & AB_PHASE_SHIFTED)) log_debug("[src] attempted to shift with [watcher] visible Carbons and it cost [ability_cost] in a darkness level of [darkness]") -//CHOMADDITION END +//CHOMPADDITION END var/datum/species/shadekin/SK = species if(!istype(SK)) @@ -292,4 +292,4 @@ holder.glow_intensity = initial(holder.glow_intensity) holder.glow_color = initial(holder.glow_color) holder.set_light(0) - my_kin = null \ No newline at end of file + my_kin = null