Cadyn's traits changes part 1

This commit is contained in:
Cadyn
2020-10-22 20:02:21 -07:00
parent bf35bc86d9
commit bd2e76e4e8
13 changed files with 249 additions and 17 deletions
@@ -1,2 +1,4 @@
/mob/living/carbon/human
var/gender_change_cooldown = 0 // A cooldown for gender and gender indentify changing procs to make it easy to avoid spam of gender change
var/gender_change_cooldown = 0 // A cooldown for gender and gender indentify changing procs to make it easy to avoid spam of gender change
var/loneliness_stage = 0
var/next_loneliness_time = 0
+13 -1
View File
@@ -950,7 +950,14 @@
take_overall_damage(1,1)
else //heal in the dark
heal_overall_damage(1,1)
//CHOMPEdit Begin
if(species.photosynthesizing && nutrition < 1000)
var/light_amount = 0
if(isturf(loc))
var/turf/T = loc
light_amount = T.get_lumcount() / 10
adjust_nutrition(light_amount)
//CHOMPEdit End
// nutrition decrease
if (nutrition > 0 && stat != DEAD)
var/nutrition_reduction = species.hunger_factor
@@ -958,6 +965,11 @@
for(var/datum/modifier/mod in modifiers)
if(!isnull(mod.metabolism_percent))
nutrition_reduction *= mod.metabolism_percent
//CHOMPEdit Begin
if(nutrition > 1000 && species.grows && size_multiplier < RESIZE_HUGE)
nutrition_reduction *= 5
resize(min(size_multiplier+0.004,RESIZE_HUGE))
//CHOMPEdit End
adjust_nutrition(-nutrition_reduction)
if(noisy == TRUE && nutrition < 250 && prob(10)) //VOREStation edit for hunger noises.
@@ -0,0 +1,10 @@
/datum/species
var/list/env_traits = list()
var/dirtslip = FALSE
var/photosynthesizing = FALSE
var/grows = FALSE
/datum/species/handle_environment_special(var/mob/living/carbon/human/H)
for(var/datum/trait/env_trait in env_traits)
env_trait.handle_environment_special(H)
return
@@ -0,0 +1,120 @@
/datum/trait/slipperydirt
name = "Dirt Vulnerability"
desc = "Even the tiniest particles of dirt give you uneasy footing, even through several layers of footwear."
cost = -5
var_changes = list("dirtslip" = TRUE)
/datum/trait/lonely
name = "Minor loneliness vulnerability"
desc = "You're very prone to loneliness! Being alone for extended periods of time causes adverse effects. Most mobs will cure this loneliness as long as they aren't hostile."
var/warning_cap = 400
var/only_people = FALSE
var/hallucination_cap = 25
var/escalation_speed = 0.8
cost = -2
special_env = TRUE
excludes = list(/datum/trait/lonely/major)
/datum/trait/lonely/major
name = "Major loneliness vulnerability"
desc = "You're extremely prone to loneliness! Being alone for extended periods of time causes adverse effects. Most mobs won't be enough to cure this loneliness, you need other social beings."
warning_cap = 300
hallucination_cap = 50
escalation_speed = 1.3
only_people = TRUE
cost = -5
special_env = TRUE
excludes = list(/datum/trait/lonely)
/datum/trait/lonely/proc/check_mob_company(var/mob/living/carbon/human/H,var/mob/living/M)
if(only_people && !istype(M, /mob/living/carbon) && !istype(M, /mob/living/silicon/robot))
return 0
if(M == H || M.stat == DEAD || M.invisibility > H.see_invisible)
return 0
if(only_people && !M.ckey)
return 0
if(M.faction == "neutral" || M.faction == H.faction)
if(H.loneliness_stage > 0)
H.loneliness_stage -= 4
if(H.loneliness_stage < 0)
H.loneliness_stage = 0
if(world.time >= H.next_loneliness_time)
to_chat(H, "The nearby company calms you down...")
H.next_loneliness_time = world.time+500
return 1
else
if(M.vore_organs)
for(var/obj/belly/B in M.vore_organs)
for(var/mob/living/content in B.contents)
if(istype(content))
check_mob_company(H,content)
return 0
/datum/trait/lonely/handle_environment_special(var/mob/living/carbon/human/H)
spawn(0)
// If they're dead or unconcious they're a bit beyond this kind of thing.
if(H.stat)
return
// No point processing if we're already stressing the hell out.
if(H.hallucination >= hallucination_cap && H.loneliness_stage >= warning_cap)
return
// Vored? Not gonna get frightened.
if(isbelly(H.loc))
if(H.loneliness_stage > 0)
H.loneliness_stage -= 4
return
if(istype(H.loc, /obj/item/weapon/holder))
if(H.loneliness_stage > 0)
H.loneliness_stage -= 4
return
// Check for company.
for(var/mob/living/M in viewers(H))
if(check_mob_company(H,M))
return
if(H.vore_organs)
for(var/obj/belly/B in H.vore_organs)
for(var/mob/living/content in B.contents)
if(istype(content))
if(check_mob_company(H,content))
return
for(var/obj/item/weapon/holder/micro/M in range(1, H))
if(H.loneliness_stage > 0)
H.loneliness_stage -= 4
if(H.loneliness_stage < 0)
H.loneliness_stage = 0
if(world.time >= H.next_loneliness_time)
to_chat(H, "[M] calms you down...")
H.next_loneliness_time = world.time+500
for(var/obj/effect/overlay/aiholo/A in range(5, H))
if(H.loneliness_stage > 0)
H.loneliness_stage -= 4
if(H.loneliness_stage < 0)
H.loneliness_stage = 0
if(world.time >= H.next_loneliness_time)
to_chat(H, "[A] calms you down...")
H.next_loneliness_time = world.time+500
// No company? Suffer :(
if(H.loneliness_stage < warning_cap)
H.loneliness_stage = min(warning_cap,H.loneliness_stage+escalation_speed)
handle_loneliness(H)
if(H.loneliness_stage >= warning_cap && H.hallucination < hallucination_cap)
H.hallucination = min(hallucination_cap,H.hallucination+2.5*escalation_speed)
/datum/trait/lonely/proc/handle_loneliness(var/mob/living/carbon/human/H)
var/ms = ""
if(H.loneliness_stage == escalation_speed)
ms = "Well.. No one is around you anymore..."
if(H.loneliness_stage >= 50)
ms = "You begin to feel alone..."
if(H.loneliness_stage >= 250)
ms = "[pick("You don't think you can last much longer without some visible company!", "You should go find someone!")]"
if(H.stuttering < hallucination_cap)
H.stuttering += 5
if(H.loneliness_stage >= warning_cap)
ms = "<span class='danger'><b>[pick("Where are the others?", "Please, there has to be someone nearby!", "I don't want to be alone!")]</b></span>"
if(world.time < H.next_loneliness_time)
return
if(ms != "")
to_chat(H, ms)
H.next_loneliness_time = world.time+500
@@ -14,4 +14,10 @@
/datum/trait/succubus_bite/apply(var/datum/species/S,var/mob/living/carbon/human/H)
..(S,H)
H.verbs |= /mob/living/proc/succubus_bite
H.verbs |= /mob/living/proc/succubus_bite
/datum/trait/nutritiongrow
name = "Growing"
desc = "After you consume enough nutrition, you start to slowly grow while metabolizing nutrition faster."
cost = 0
var_changes = list("grows" = TRUE)
@@ -0,0 +1,35 @@
/datum/trait/linguist
name = "Master Linguist"
desc = "You are a master of languages! For whatever reason you might have, you are able to learn many more languages than others."
cost = 2
var_changes = list("num_alternate_languages" = 12)
/datum/trait/densebones
name = "Dense bones"
desc = "Your bones are more dense then what is considered normal. It is much harder to fracture your bones, yet pain from fractures is much more intense."
cost = 2
/datum/trait/densebones/apply(var/datum/species/S,var/mob/living/carbon/human/H)
..(S,H)
for(var/obj/item/organ/external/organ in H.organs)
if(istype(organ))
organ.min_broken_damage *= 1.5
organ.brokenpain *= 2
/datum/trait/lowpressureres
name = "Low Pressure Resistance"
desc = "Your body is more resistant to low pressures. Pretty simple."
cost = 3
var_changes = list("hazard_low_pressure" = HAZARD_LOW_PRESSURE*0.66, "warning_low_pressure" = WARNING_LOW_PRESSURE*0.66, "minimum_breath_pressure" = 16*0.66)
/datum/trait/highpressureres
name = "High Pressure Resistance"
desc = "Your body is more resistant to high pressures. Pretty simple."
cost = 3
var_changes = list("hazard_high_pressure" = HAZARD_HIGH_PRESSURE*1.5, "warning_high_pressure" = WARNING_HIGH_PRESSURE*1.5)
/datum/trait/photosynth
name = "Photosynthesis"
desc = "Your body is able to produce nutrition from being in light."
cost = 3
var_changes = list("photosynthesizing" = TRUE)
@@ -0,0 +1,19 @@
/datum/trait
var/special_env = FALSE
/datum/trait/proc/handle_environment_special(var/mob/living/carbon/human/H)
return
/datum/trait/apply(var/datum/species/S,var/mob/living/carbon/human/H)
ASSERT(S)
if(var_changes)
for(var/V in var_changes)
S.vars[V] = var_changes[V]
if(special_env)
S.env_traits += src
return
/datum/trait/remove(var/datum/species/S)
ASSERT(S)
if(special_env)
S.env_traits -= src
return