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

View File

@@ -20,7 +20,7 @@
//For custom species
#define STARTING_SPECIES_POINTS 1
#define MAX_SPECIES_TRAITS 5
#define MAX_SPECIES_TRAITS 8 //CHOMPEdit
// Xenochimera thing mostly
#define REVIVING_NOW -1

View File

@@ -82,6 +82,7 @@
return
if (istype(A,/mob/living))
var/dirtslip = FALSE //CHOMPEdit
var/mob/living/M = A
if(M.lying || M.flying) //VOREStation Edit
return ..()
@@ -92,6 +93,7 @@
if(istype(M, /mob/living/carbon/human))
var/mob/living/carbon/human/H = M
dirtslip = H.species.dirtslip //CHOMPEdit
// Tracking blood
var/list/bloodDNA = null
var/bloodcolor=""
@@ -117,7 +119,7 @@
bloodDNA = null
if(src.wet)
if(src.wet || (dirtslip && (dirt > 50 || outdoors))) //CHOMPEdit
if(M.buckled || (src.wet == 1 && M.m_intent == "walk"))
return
@@ -125,7 +127,14 @@
var/slip_dist = 1
var/slip_stun = 6
var/floor_type = "wet"
//CHOMPEdit Begin
if(dirtslip)
slip_stun = 10
if(dirt > 50)
floor_type = "dirty"
else if(outdoors)
floor_type = "uneven"
//CHOMPEdit End
switch(src.wet)
if(2) // Lube
floor_type = "slippery"

View File

@@ -6,6 +6,14 @@
/datum/category_item/player_setup_item/general/language/load_character(var/savefile/S)
S["language"] >> pref.alternate_languages
S["language_prefixes"] >> pref.language_prefixes
//CHOMPEdit Begin
S["pos_traits"] >> pref.pos_traits
var/morelang = 0
for(var/trait in pref.pos_traits)
if(trait==/datum/trait/linguist)
morelang = 1
pref.num_languages = morelang * 12
//CHOMPEdit End
/datum/category_item/player_setup_item/general/language/save_character(var/savefile/S)
S["language"] << pref.alternate_languages
@@ -15,8 +23,8 @@
if(!islist(pref.alternate_languages)) pref.alternate_languages = list()
if(pref.species)
var/datum/species/S = GLOB.all_species[pref.species]
if(S && pref.alternate_languages.len > S.num_alternate_languages)
pref.alternate_languages.len = S.num_alternate_languages // Truncate to allowed length
if(S && pref.alternate_languages.len > pref.numlanguage()) //CHOMPEdit
pref.alternate_languages.len = pref.numlanguage() // Truncate to allowed length CHOMPEdit
if(isnull(pref.language_prefixes) || !pref.language_prefixes.len)
pref.language_prefixes = config.language_prefixes.Copy()
for(var/prefix in pref.language_prefixes)
@@ -30,14 +38,14 @@
. += "- [S.language]<br>"
if(S.default_language && S.default_language != S.language)
. += "- [S.default_language]<br>"
if(S.num_alternate_languages)
if(pref.numlanguage()) //CHOMPEdit
if(pref.alternate_languages.len)
for(var/i = 1 to pref.alternate_languages.len)
var/lang = pref.alternate_languages[i]
. += "- [lang] - <a href='?src=\ref[src];remove_language=[i]'>remove</a><br>"
if(pref.alternate_languages.len < S.num_alternate_languages)
. += "- <a href='?src=\ref[src];add_language=1'>add</a> ([S.num_alternate_languages - pref.alternate_languages.len] remaining)<br>"
if(pref.alternate_languages.len < pref.numlanguage()) //CHOMPEdit
. += "- <a href='?src=\ref[src];add_language=1'>add</a> ([pref.numlanguage() - pref.alternate_languages.len] remaining)<br>" //CHOMPEdit
else
. += "- [pref.species] cannot choose secondary languages.<br>"
@@ -51,7 +59,7 @@
return TOPIC_REFRESH
else if(href_list["add_language"])
var/datum/species/S = GLOB.all_species[pref.species]
if(pref.alternate_languages.len >= S.num_alternate_languages)
if(pref.alternate_languages.len >= pref.numlanguage()) //CHOMPEdit
alert(user, "You have already selected the maximum number of alternate languages for this species!")
else
var/list/available_languages = S.secondary_langs.Copy()
@@ -69,7 +77,7 @@
alert(user, "There are no additional languages available to select.")
else
var/new_lang = input(user, "Select an additional language", "Character Generation", null) as null|anything in available_languages
if(new_lang && pref.alternate_languages.len < S.num_alternate_languages)
if(new_lang && pref.alternate_languages.len < pref.numlanguage()) //CHOMPEdit
pref.alternate_languages |= new_lang
return TOPIC_REFRESH

View File

@@ -30,6 +30,7 @@ datum/preferences
var/tgui_lock = FALSE
//character preferences
var/num_languages = 0 //CHOMPEdit
var/real_name //our character's name
var/be_random_name = 0 //whether we are a random name every round
var/nickname //our character's nickname
@@ -154,8 +155,11 @@ datum/preferences
var/multilingual_mode = 0 // Default behaviour, delimiter-key-space, delimiter-key-delimiter, off
var/list/volume_channels = list()
//CHOMPEdit Begin
/datum/preferences/proc/numlanguage()
var/datum/species/S = GLOB.all_species[species]
return num_languages ? num_languages : S.num_alternate_languages
//CHOMPEdit End
/datum/preferences/New(client/C)
player_setup = new(src)
set_biological_gender(pick(MALE, FEMALE))

View File

@@ -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

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.

View File

@@ -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

View File

@@ -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

View File

@@ -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)

View File

@@ -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)

View File

@@ -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

View File

@@ -14,6 +14,7 @@
dir = SOUTH
organ_tag = "limb"
var/brokenpain = 50 //CHOMPEdit
// Strings
var/broken_description // fracture string if any.
var/damage_state = "00" // Modifier used for generating the on-mob damage overlay for this limb.
@@ -1053,10 +1054,12 @@ Note that amputating the affected organ does in fact remove the infection from t
return
if(owner)
owner.visible_message(\
//CHOMPEdit Begin
owner.custom_pain(pick(\
"<span class='danger'>You hear a loud cracking sound coming from \the [owner].</span>",\
"<span class='danger'>Something feels like it shattered in your [name]!</span>",\
"<span class='danger'>You hear a sickening crack.</span>")
"<span class='danger'>You hear a sickening crack.</span>"),brokenpain)
//CHOMPEdit End
jostle_bone()
if(organ_can_feel_pain() && !isbelly(owner.loc))
owner.emote("scream")

View File

@@ -2722,6 +2722,7 @@
#include "code\modules\mob\living\carbon\human\species\species.dm"
#include "code\modules\mob\living\carbon\human\species\species_attack.dm"
#include "code\modules\mob\living\carbon\human\species\species_attack_vr.dm"
#include "code\modules\mob\living\carbon\human\species\species_ch.dm"
#include "code\modules\mob\living\carbon\human\species\species_getters.dm"
#include "code\modules\mob\living\carbon\human\species\species_getters_vr.dm"
#include "code\modules\mob\living\carbon\human\species\species_helpers.dm"
@@ -2759,10 +2760,13 @@
#include "code\modules\mob\living\carbon\human\species\station\protean_vr\protean_powers.dm"
#include "code\modules\mob\living\carbon\human\species\station\protean_vr\protean_species.dm"
#include "code\modules\mob\living\carbon\human\species\station\traits_vr\negative.dm"
#include "code\modules\mob\living\carbon\human\species\station\traits_vr\negative_ch.dm"
#include "code\modules\mob\living\carbon\human\species\station\traits_vr\neutral.dm"
#include "code\modules\mob\living\carbon\human\species\station\traits_vr\neutral_ch.dm"
#include "code\modules\mob\living\carbon\human\species\station\traits_vr\positive.dm"
#include "code\modules\mob\living\carbon\human\species\station\traits_vr\positive_ch.dm"
#include "code\modules\mob\living\carbon\human\species\station\traits_vr\trait.dm"
#include "code\modules\mob\living\carbon\human\species\station\traits_vr\trait_ch.dm"
#include "code\modules\mob\living\carbon\human\species\virtual_reality\avatar.dm"
#include "code\modules\mob\living\carbon\human\species\virtual_reality\opaque_form.dm"
#include "code\modules\mob\living\carbon\human\species\xenomorphs\alien_powers.dm"