diff --git a/code/game/dna/dna2_helpers.dm b/code/game/dna/dna2_helpers.dm index 8371c395a44..3d945e58167 100644 --- a/code/game/dna/dna2_helpers.dm +++ b/code/game/dna/dna2_helpers.dm @@ -260,6 +260,7 @@ /mob/living/carbon/human/proc/force_update_organs() for(var/obj/item/organ/O as anything in organs + internal_organs) O.species = species + species.post_spawn_special(src) //VOREStation Add End // Used below, simple injection modifier. diff --git a/code/modules/mob/living/carbon/human/species/shadekin/shadekin.dm b/code/modules/mob/living/carbon/human/species/shadekin/shadekin.dm index 37872564c3c..31ae6efa50f 100644 --- a/code/modules/mob/living/carbon/human/species/shadekin/shadekin.dm +++ b/code/modules/mob/living/carbon/human/species/shadekin/shadekin.dm @@ -253,4 +253,90 @@ e_icon = 4 H.shadekin_display.icon_state = "shadekin-[l_icon]-[e_icon]" - return \ No newline at end of file + return + +/datum/species/shadekin/proc/get_shadekin_eyecolor(var/mob/living/carbon/human/H) + var/eyecolor_rgb = rgb(H.r_eyes, H.g_eyes, H.b_eyes) + + var/eyecolor_hue = rgb2num(eyecolor_rgb, COLORSPACE_HSV)[1] + var/eyecolor_sat = rgb2num(eyecolor_rgb, COLORSPACE_HSV)[2] + var/eyecolor_val = rgb2num(eyecolor_rgb, COLORSPACE_HSV)[3] + + //First, clamp the saturation/value to prevent black/grey/white eyes + if(eyecolor_sat < 10) + eyecolor_sat = 10 + if(eyecolor_val < 40) + eyecolor_val = 40 + + eyecolor_rgb = rgb(eyecolor_hue, eyecolor_sat, eyecolor_val, COLORSPACE_HSV) + + H.r_eyes = rgb2num(eyecolor_rgb)[1] + H.g_eyes = rgb2num(eyecolor_rgb)[2] + H.b_eyes = rgb2num(eyecolor_rgb)[3] + + //Now determine what color we fall into. + var/eyecolor_type = BLUE_EYES + switch(eyecolor_hue) + if(0 to 20) + eyecolor_type = RED_EYES + if(21 to 50) + eyecolor_type = ORANGE_EYES + if(51 to 70) + eyecolor_type = YELLOW_EYES + if(71 to 160) + eyecolor_type = GREEN_EYES + if(161 to 260) + eyecolor_type = BLUE_EYES + if(261 to 340) + eyecolor_type = PURPLE_EYES + if(341 to 360) + eyecolor_type = RED_EYES + + return eyecolor_type + +/datum/species/shadekin/post_spawn_special(var/mob/living/carbon/human/H) + .=..() + + var/eyecolor_type = get_shadekin_eyecolor(H) + + switch(eyecolor_type) + if(BLUE_EYES) + total_health = 100 + energy_light = 0.5 + energy_dark = 0.5 + if(RED_EYES) + total_health = 200 + energy_light = -1 + energy_dark = 0.1 + if(PURPLE_EYES) + total_health = 150 + energy_light = -0.5 + energy_dark = 1 + if(YELLOW_EYES) + total_health = 100 + energy_light = -2 + energy_dark = 3 + if(GREEN_EYES) + total_health = 100 + energy_light = 0.125 + energy_dark = 2 + if(ORANGE_EYES) + total_health = 175 + energy_light = -0.5 + energy_dark = 0.25 + + H.maxHealth = total_health + + H.health = H.maxHealth + +/datum/species/shadekin/produceCopy(var/list/traits, var/mob/living/carbon/human/H, var/custom_base) + + var/datum/species/shadekin/new_copy = ..() + + new_copy.total_health = total_health + + new_copy.energy_light = energy_light + + new_copy.energy_dark = energy_dark + + return new_copy \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/species/shadekin/shadekin_trait.dm b/code/modules/mob/living/carbon/human/species/shadekin/shadekin_trait.dm deleted file mode 100644 index 5948fecc21c..00000000000 --- a/code/modules/mob/living/carbon/human/species/shadekin/shadekin_trait.dm +++ /dev/null @@ -1,92 +0,0 @@ -/datum/trait/kintype - sort = TRAIT_SORT_SPECIES - 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 and 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/claws/shadekin, /datum/unarmed_attack/bite/sharp/shadekin,/datum/unarmed_attack/shadekinharmbap)) - custom_only = FALSE - -/datum/trait/kintype/red - 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 degeneration in the light and 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/claws/shadekin, /datum/unarmed_attack/bite/sharp/shadekin,/datum/unarmed_attack/shadekinharmbap)) - -/datum/trait/kintype/purple - 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 and increased health!" - var_changes = list( "total_health" = 150, - "energy_light" = -0.5, - "energy_dark" = 1, - "unarmed_types" = list(/datum/unarmed_attack/stomp, /datum/unarmed_attack/kick, /datum/unarmed_attack/claws/shadekin, /datum/unarmed_attack/bite/sharp/shadekin,/datum/unarmed_attack/shadekinharmbap)) - -/datum/trait/kintype/yellow - 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 and unchanged health!" - var_changes = list( "total_health" = 100, - "energy_light" = -2, - "energy_dark" = 3, - "unarmed_types" = list(/datum/unarmed_attack/stomp, /datum/unarmed_attack/kick, /datum/unarmed_attack/claws/shadekin, /datum/unarmed_attack/bite/sharp/shadekin,/datum/unarmed_attack/shadekinharmbap)) - -/datum/trait/kintype/green - 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 and unchanged health!" - var_changes = list( "total_health" = 100, - "energy_light" = 0.125, - "energy_dark" = 2, - "unarmed_types" = list(/datum/unarmed_attack/stomp, /datum/unarmed_attack/kick, /datum/unarmed_attack/claws/shadekin, /datum/unarmed_attack/bite/sharp/shadekin,/datum/unarmed_attack/shadekinharmbap)) - -/datum/trait/kintype/orange - 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, moderate degeneration in the light and increased health!" - var_changes = list( "total_health" = 175, - "energy_light" = -0.5, - "energy_dark" = 0.25, - "unarmed_types" = list(/datum/unarmed_attack/stomp, /datum/unarmed_attack/kick, /datum/unarmed_attack/claws/shadekin, /datum/unarmed_attack/bite/sharp/shadekin,/datum/unarmed_attack/shadekinharmbap)) - -/datum/trait/kintype/apply(var/datum/species/shadekin/S,var/mob/living/carbon/human/H) - 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") - 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 - 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 diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index 459f90c5a5a..91bc81f2106 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -542,3 +542,7 @@ /datum/species/proc/handle_falling(mob/living/carbon/human/H, atom/hit_atom, damage_min, damage_max, silent, planetary) return FALSE + +/datum/species/proc/post_spawn_special(mob/living/carbon/human/H) + return + diff --git a/code/modules/mob/living/carbon/human/species/species_attack_vr.dm b/code/modules/mob/living/carbon/human/species/species_attack_vr.dm index 73bee4fa09d..9e2c720efa3 100644 --- a/code/modules/mob/living/carbon/human/species/species_attack_vr.dm +++ b/code/modules/mob/living/carbon/human/species/species_attack_vr.dm @@ -46,15 +46,15 @@ target.bloodstr.add_reagent("numbenzyme",attack_damage) /datum/unarmed_attack/claws/shadekin - var/energy_gain = 3 -/datum/unarmed_attack/claws/shadekin/show_attack(var/mob/living/carbon/human/user, var/mob/living/carbon/human/target, var/zone, var/attack_damage) +/datum/unarmed_attack/claws/shadekin/apply_effects(var/mob/living/carbon/human/user, var/mob/living/carbon/human/target, var/zone, var/attack_damage) ..() - user.shadekin_adjust_energy(energy_gain) + if(!(target == user)) + user.shadekin_adjust_energy(attack_damage) /datum/unarmed_attack/bite/sharp/shadekin - var/energy_gain = 3 -/datum/unarmed_attack/bite/sharp/shadekin/show_attack(var/mob/living/carbon/human/user, var/mob/living/carbon/human/target, var/zone, var/attack_damage) +/datum/unarmed_attack/bite/sharp/shadekin/apply_effects(var/mob/living/carbon/human/user, var/mob/living/carbon/human/target, var/zone, var/attack_damage) ..() - user.shadekin_adjust_energy(energy_gain) \ No newline at end of file + if(!(target == user)) + user.shadekin_adjust_energy(attack_damage) \ No newline at end of file diff --git a/vorestation.dme b/vorestation.dme index 3425cbcac26..265c8d386bf 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -2792,7 +2792,6 @@ #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_trait.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"