diff --git a/baystation12.dme b/baystation12.dme index 52fe2da206f..d10ddba3e1d 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -179,6 +179,7 @@ #define FILE_DIR "icons/vending_icons" #define FILE_DIR "interface" #define FILE_DIR "maps" +#define FILE_DIR "maps/backup" #define FILE_DIR "sound" #define FILE_DIR "sound/ambience" #define FILE_DIR "sound/announcer" @@ -518,7 +519,7 @@ #include "code\game\machinery\computer\id.dm" #include "code\game\machinery\computer\lockdown.dm" #include "code\game\machinery\computer\medical.dm" -#include "code\game\machinery\computer\operating.dm" +#include "code\game\machinery\computer\Operating.dm" #include "code\game\machinery\computer\power.dm" #include "code\game\machinery\computer\robot.dm" #include "code\game\machinery\computer\security.dm" @@ -952,6 +953,7 @@ #include "code\modules\mob\new_player\preferences.dm" #include "code\modules\mob\new_player\preferences_setup.dm" #include "code\modules\mob\new_player\savefile.dm" +#include "code\modules\mob\new_player\skill.dm" #include "code\modules\mob\new_player\sprite_accessories.dm" #include "code\modules\mob\organ\organ.dm" #include "code\modules\mob\organ\organ_external.dm" @@ -1065,6 +1067,6 @@ #include "code\WorkInProgress\virus2\Prob.dm" #include "code\WorkInProgress\Wrongnumber\weldbackpack.dm" #include "interface\skin.dmf" -#include "maps\test.dmm" +#include "maps\tgstation.2.0.8.dmm" // END_INCLUDE diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index a856c59665f..62395c2f492 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -21,6 +21,8 @@ var/b_eyes = 0.0 var/s_tone = 0.0 var/age = 30.0 + var/used_skillpoints = 0 + var/skills = null // var/b_type var/obj/item/clothing/suit/wear_suit = null diff --git a/code/modules/mob/new_player/preferences.dm b/code/modules/mob/new_player/preferences.dm index 5468aa9c5d2..7230aa9196d 100644 --- a/code/modules/mob/new_player/preferences.dm +++ b/code/modules/mob/new_player/preferences.dm @@ -40,6 +40,7 @@ var/const BE_MONKEY =(1<<8) BE_PAI =(1<<9) + datum/preferences var real_name @@ -113,12 +114,81 @@ datum/preferences curslot = 0 disabilities = 0 + used_skillpoints = 0 + list/skills = list() // skills can range from 0 to 3 + New() hair_style = new/datum/sprite_accessory/hair/short facial_hair_style = new/datum/sprite_accessory/facial_hair/shaved randomize_name() ..() + proc/ZeroSkills() + for(var/V in SKILLS) for(var/datum/skill/S in SKILLS[V]) + if(!skills.Find(S.ID)) + skills[S.ID] = SKILL_NONE + + proc/GetSkillClass(points) + // skill classes describe how your character compares in total points + switch(points) + if(0) + return "Unconfigured" + if(1 to 3) + return "Talentless" + if(4 to 6) + return "Below Average" + if(7 to 9) + return "Average" + if(10 to 12) + return "Talented" + if(13 to 15) + return "Extremely Talented" + if(16 to 18) + return "Genius" + if(19 to 21) + return "True Genius" + if(22 to 1000) + return "God" + + proc/SetSkills(mob/user) + if(SKILLS == null) + SKILLS = list() + for(var/T in (typesof(/datum/skill)-/datum/skill)) + var/datum/skill/S = new T + if(S.ID != "none") + if(!SKILLS.Find(S.field)) + SKILLS[S.field] = list() + var/list/L = SKILLS[S.field] + L += S + + if(skills.len == 0) + ZeroSkills() + + + var/HTML = "" + HTML += "Select your Skills
" + HTML += "Current skill level: [GetSkillClass(used_skillpoints)] ([used_skillpoints])
" + HTML += "Use preconfigured skillset
" + HTML += "" + for(var/V in SKILLS) + HTML += "" + for(var/datum/skill/S in SKILLS[V]) + var/level = skills[S.ID] + HTML += "" + HTML += "" + HTML += "" + HTML += "" + HTML += "" + HTML += "" + HTML += "" + HTML += "
[V]
[S.name]\[None\]\[Basic\]\[Adept\]\[Expert\]
" + HTML += "\[Done\]" + + user << browse(null, "window=preferences") + user << browse(HTML, "window=show_skills;size=600x800") + return + + proc/ShowChoices(mob/user) update_preview_icon() @@ -145,6 +215,10 @@ datum/preferences dat += "
Occupation Choices
" dat += "\tSet Preferences
" + dat += "
Skill Choices
" + dat += "\t[GetSkillClass(used_skillpoints)] ([used_skillpoints])
" + dat += "\tSet Skills
" + dat += "
Body " dat += "(®)" // Random look dat += "
" @@ -419,6 +493,37 @@ datum/preferences return 1 + if(link_tags["skills"]) + if(link_tags["cancel"]) + user << browse(null, "window=show_skills") + SetSkills(user) + return + else if(link_tags["skillinfo"]) + var/datum/skill/S = locate(link_tags["skillinfo"]) + var/HTML = "[S.name]
[S.desc]" + user << browse(HTML, "window=\ref[user]skillinfo") + 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 + SetSkills(user) + else if(link_tags["preconfigured"]) + var/selected = input(user, "Select a skillset", "Skillset") as null|anything in SKILL_PRE + if(!selected) return + + skills = SKILL_PRE[selected] + ZeroSkills() + used_skillpoints = 0 + for(var/V in skills) used_skillpoints += skills[V] + + SetSkills(user) + else + SetSkills(user) + + return 1 + if(link_tags["alt_title"] && link_tags["job"]) var/datum/job/job = locate(link_tags["job"]) var/choices = list(job.title) + job.alt_titles @@ -759,6 +864,9 @@ datum/preferences character.underwear = underwear == 1 ? pick(1,2,3,4,5) : 0 + character.used_skillpoints = used_skillpoints + character.skills = skills + character.update_face() character.update_body() diff --git a/code/modules/mob/new_player/savefile.dm b/code/modules/mob/new_player/savefile.dm index b58b000ce75..15e0a018c57 100644 --- a/code/modules/mob/new_player/savefile.dm +++ b/code/modules/mob/new_player/savefile.dm @@ -141,6 +141,9 @@ datum/preferences/proc/savefile_save(mob/user, slot) F["lastchangelog"] << src.lastchangelog F["disabilities"] << src.disabilities + F["used_skillpoints"] << src.used_skillpoints + F["skills"] << src.skills + return 1 // loads the savefile corresponding to the mob's ckey @@ -211,6 +214,12 @@ datum/preferences/proc/savefile_load(mob/user, slot) F["job_medsci_med"] >> src.job_medsci_med F["job_medsci_low"] >> src.job_medsci_low + + F["used_skillpoints"] >> src.used_skillpoints + F["skills"] >> src.skills + if(!src.skills) src.skills = list() + if(!src.used_skillpoints) src.used_skillpoints= 0 + F["job_engsec_high"] >> src.job_engsec_high F["job_engsec_med"] >> src.job_engsec_med F["job_engsec_low"] >> src.job_engsec_low