diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index d0dc91c830e..19d3fe0f3ba 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -22,6 +22,7 @@ var/s_tone = 0.0 var/age = 30.0 var/used_skillpoints = 0 + var/skill_specialization = null var/list/skills = null // var/b_type diff --git a/code/modules/mob/new_player/preferences.dm b/code/modules/mob/new_player/preferences.dm index ba6b5dd97d8..09b86aab34a 100644 --- a/code/modules/mob/new_player/preferences.dm +++ b/code/modules/mob/new_player/preferences.dm @@ -116,6 +116,7 @@ datum/preferences disabilities = 0 used_skillpoints = 0 + skill_specialization = null list/skills = list() // skills can range from 0 to 3 New() @@ -129,6 +130,22 @@ datum/preferences if(!skills.Find(S.ID) || forced) skills[S.ID] = SKILL_NONE + proc/CalculateSkillPoints() + used_skillpoints = 0 + for(var/V in SKILLS) for(var/datum/skill/S in SKILLS[V]) + var/multiplier = 2 + if(skill_specialization == S.field || S.field == "Misc") + multiplier = 1 + switch(skills[S.ID]) + if(SKILL_NONE) + used_skillpoints += 0 * multiplier + if(SKILL_BASIC) + used_skillpoints += 1 * multiplier + if(SKILL_ADEPT) + used_skillpoints += 3 * multiplier + if(SKILL_EXPERT) + used_skillpoints += 8 * multiplier + proc/GetSkillClass(points) // skill classes describe how your character compares in total points switch(points) @@ -136,19 +153,19 @@ datum/preferences return "Unconfigured" if(1 to 3) return "Talentless" - if(4 to 6) + if(3 to 6) return "Below Average" - if(7 to 9) + if(7 to 10) return "Average" - if(10 to 12) + if(11 to 12) return "Talented" if(13 to 15) return "Extremely Talented" if(16 to 18) return "Genius" - if(19 to 21) + if(19 to 20) return "True Genius" - if(22 to 1000) + if(21 to 1000) return "God" proc/SetSkills(mob/user) @@ -165,7 +182,8 @@ datum/preferences HTML += "Use preconfigured skillset
" HTML += "" for(var/V in SKILLS) - HTML += "" + HTML += "" for(var/datum/skill/S in SKILLS[V]) var/level = skills[S.ID] HTML += "" @@ -507,9 +525,8 @@ datum/preferences else if(link_tags["setskill"]) var/datum/skill/S = locate(link_tags["setskill"]) var/value = text2num(link_tags["newvalue"]) - var/current_value = skills[S.ID] - used_skillpoints += value - current_value skills[S.ID] = value + CalculateSkillPoints() SetSkills(user) else if(link_tags["preconfigured"]) var/selected = input(user, "Select a skillset", "Skillset") as null|anything in SKILL_PRE @@ -517,10 +534,16 @@ datum/preferences ZeroSkills(1) for(var/V in SKILL_PRE[selected]) + if(V == "field") + skill_specialization = SKILL_PRE[selected]["field"] + continue skills[V] = SKILL_PRE[selected][V] - used_skillpoints = 0 - for(var/V in skills) used_skillpoints += skills[V] + CalculateSkillPoints() + SetSkills(user) + else if(link_tags["setspecialization"]) + skill_specialization = link_tags["setspecialization"] + CalculateSkillPoints() SetSkills(user) else SetSkills(user) @@ -869,6 +892,7 @@ datum/preferences character.underwear = underwear == 1 ? pick(1,2,3,4,5) : 0 character.used_skillpoints = used_skillpoints + character.skill_specialization = skill_specialization character.skills = skills character.update_face() diff --git a/code/modules/mob/new_player/savefile.dm b/code/modules/mob/new_player/savefile.dm index 15e0a018c57..f5656d8fba2 100644 --- a/code/modules/mob/new_player/savefile.dm +++ b/code/modules/mob/new_player/savefile.dm @@ -143,6 +143,7 @@ datum/preferences/proc/savefile_save(mob/user, slot) F["used_skillpoints"] << src.used_skillpoints F["skills"] << src.skills + F["skill_specialization"] << src.skill_specialization return 1 @@ -217,6 +218,7 @@ datum/preferences/proc/savefile_load(mob/user, slot) F["used_skillpoints"] >> src.used_skillpoints F["skills"] >> src.skills + F["skill_specialization"] >> src.skill_specialization if(!src.skills) src.skills = list() if(!src.used_skillpoints) src.used_skillpoints= 0 diff --git a/code/modules/mob/new_player/skill.dm b/code/modules/mob/new_player/skill.dm index 8cbfec6fe7d..fafdf41eba5 100644 --- a/code/modules/mob/new_player/skill.dm +++ b/code/modules/mob/new_player/skill.dm @@ -1,8 +1,8 @@ var/global/const SKILL_NONE = 0 SKILL_BASIC = 1 - SKILL_ADEPT = 3 - SKILL_EXPERT = 6 + SKILL_ADEPT = 2 + SKILL_EXPERT = 3 datum/skill/var ID = "none" // ID of the skill, used in code @@ -11,10 +11,10 @@ datum/skill/var field = "Misc" // the field under which the skill will be listed var/global/list/SKILLS = null -var/list/SKILL_ENGINEER = list("EVA" = SKILL_BASIC, "construction" = SKILL_ADEPT, "electrical" = SKILL_BASIC, "engines" = SKILL_ADEPT) -var/list/SKILL_ROBOTICIST = list("devices" = SKILL_ADEPT, "electrical" = SKILL_BASIC, "computer" = SKILL_ADEPT, "anatomy" = SKILL_BASIC) -var/list/SKILL_SECURITY_OFFICER = list("combat" = SKILL_BASIC, "weapons" = SKILL_ADEPT, "law" = SKILL_ADEPT, "forensics" = SKILL_BASIC) -var/list/SKILL_CHEMIST = list("chemistry" = SKILL_ADEPT, "science" = SKILL_ADEPT, "medical" = SKILL_BASIC, "devices" = SKILL_BASIC) +var/list/SKILL_ENGINEER = list("field" = "Engineering", "EVA" = SKILL_BASIC, "construction" = SKILL_ADEPT, "electrical" = SKILL_BASIC, "engines" = SKILL_ADEPT) +var/list/SKILL_ROBOTICIST = list("field" = "Science", "devices" = SKILL_ADEPT, "electrical" = SKILL_BASIC, "computer" = SKILL_ADEPT, "anatomy" = SKILL_BASIC) +var/list/SKILL_SECURITY_OFFICER = list("field" = "Security", "combat" = SKILL_BASIC, "weapons" = SKILL_ADEPT, "law" = SKILL_ADEPT, "forensics" = SKILL_BASIC) +var/list/SKILL_CHEMIST = list("field" = "Science", "chemistry" = SKILL_ADEPT, "science" = SKILL_ADEPT, "medical" = SKILL_BASIC, "devices" = SKILL_BASIC) var/global/list/SKILL_PRE = list("Engineer" = SKILL_ENGINEER, "Roboticist" = SKILL_ROBOTICIST, "Security Officer" = SKILL_SECURITY_OFFICER, "Chemist" = SKILL_CHEMIST) datum/skill/management @@ -106,24 +106,24 @@ datum/skill/pilot datum/skill/medical ID = "medical" - name = "Medical" + name = "Medicine" desc = "Covers an understanding of the human body and medicine. At a low level, this skill is vital to perform basic first aid, such as CPR or applying bandages. At a high level, this skill implies a good understanding of the various medicines that can be found on a space station." - field = "Science" + field = "Medical" datum/skill/anatomy ID = "anatomy" name = "Anatomy" desc = "Gives you a detailed insight of the human body. A high skill in this is required to perform surgery.This skill may also help in examining alien biology." - field = "Science" + field = "Medical" datum/skill/virology ID = "virology" name = "Virology" desc = "This skill implies an understanding of microorganisms and their effects on humans." - field = "Science" + field = "Medical" datum/skill/genetics - ID = "genaetics" + ID = "genetics" name = "Genetics" desc = "Implies an understanding of how DNA works and the structure of the human DNA." field = "Science"
[V]
[V]" + HTML += "