mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-21 19:19:12 +01:00
Merge pull request #16588 from ShadowLarkens/merk_skills
Completely merk all traces of the skill system
This commit is contained in:
@@ -7,11 +7,6 @@
|
||||
sort_order = 1
|
||||
category_item_type = /datum/category_item/player_setup_item/general
|
||||
|
||||
/datum/category_group/player_setup_category/skill_preferences
|
||||
name = "Skills"
|
||||
sort_order = 2
|
||||
category_item_type = /datum/category_item/player_setup_item/skills
|
||||
|
||||
/datum/category_group/player_setup_category/occupation_preferences
|
||||
name = "Occupation"
|
||||
sort_order = 3
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
/datum/category_item/player_setup_item/skills
|
||||
name = "Skills"
|
||||
sort_order = 1
|
||||
|
||||
/datum/category_item/player_setup_item/skills/load_character(list/save_data)
|
||||
pref.skills = check_list_copy(save_data["skills"])
|
||||
pref.used_skillpoints = save_data["used_skillpoints"]
|
||||
pref.skill_specialization = save_data["skill_specialization"]
|
||||
|
||||
/datum/category_item/player_setup_item/skills/save_character(list/save_data)
|
||||
save_data["skills"] = check_list_copy(pref.skills)
|
||||
save_data["used_skillpoints"] = pref.used_skillpoints
|
||||
save_data["skill_specialization"] = pref.skill_specialization
|
||||
|
||||
/datum/category_item/player_setup_item/skills/sanitize_character()
|
||||
if(SKILLS == null) setup_skills()
|
||||
if(!pref.skills) pref.skills = list()
|
||||
if(!pref.skills.len) pref.ZeroSkills()
|
||||
if(pref.used_skillpoints < 0) pref.used_skillpoints = 0
|
||||
|
||||
// Moved from /datum/preferences/proc/copy_to()
|
||||
/datum/category_item/player_setup_item/skills/copy_to_mob(var/mob/living/carbon/human/character)
|
||||
character.skills = pref.skills
|
||||
character.used_skillpoints = pref.used_skillpoints
|
||||
|
||||
/datum/category_item/player_setup_item/skills/content()
|
||||
. = list()
|
||||
. += span_bold("Select your Skills") + "<br>"
|
||||
. += "Current skill level: <b>[pref.GetSkillClass(pref.used_skillpoints)]</b> ([pref.used_skillpoints])<br>"
|
||||
. += "<a href='?src=\ref[src];preconfigured=1'>Use preconfigured skillset</a><br>"
|
||||
. += "<table>"
|
||||
for(var/V in SKILLS)
|
||||
. += "<tr><th colspan = 5><b>[V]</b>"
|
||||
. += "</th></tr>"
|
||||
for(var/datum/skill/S in SKILLS[V])
|
||||
var/level = pref.skills[S.ID]
|
||||
. += "<tr style='text-align:left;'>"
|
||||
. += "<th><a href='?src=\ref[src];skillinfo=\ref[S]'>[S.name]</a></th>"
|
||||
. += skill_to_button(S, "Untrained", level, SKILL_NONE)
|
||||
// secondary skills don't have an amateur level
|
||||
if(S.secondary)
|
||||
. += "<th></th>"
|
||||
else
|
||||
. += skill_to_button(S, "Amateur", level, SKILL_BASIC)
|
||||
. += skill_to_button(S, "Trained", level, SKILL_ADEPT)
|
||||
. += skill_to_button(S, "Professional", level, SKILL_EXPERT)
|
||||
. += "</tr>"
|
||||
. += "</table>"
|
||||
. = jointext(.,null)
|
||||
|
||||
/datum/category_item/player_setup_item/proc/skill_to_button(var/skill, var/level_name, var/current_level, var/selection_level)
|
||||
if(current_level == selection_level)
|
||||
return "<th>" + span_linkOn("[level_name]") + "</th>"
|
||||
return "<th><a href='?src=\ref[src];setskill=\ref[skill];newvalue=[selection_level]'>[level_name]</a></th>"
|
||||
|
||||
/datum/category_item/player_setup_item/skills/OnTopic(href, href_list, user)
|
||||
if(href_list["skillinfo"])
|
||||
var/datum/skill/S = locate(href_list["skillinfo"])
|
||||
var/HTML = span_bold("[S.name]") + "<br>[S.desc]"
|
||||
user << browse(HTML, "window=\ref[user]skillinfo")
|
||||
return TOPIC_HANDLED
|
||||
|
||||
else if(href_list["setskill"])
|
||||
var/datum/skill/S = locate(href_list["setskill"])
|
||||
var/value = text2num(href_list["newvalue"])
|
||||
pref.skills[S.ID] = value
|
||||
pref.CalculateSkillPoints()
|
||||
return TOPIC_REFRESH
|
||||
|
||||
else if(href_list["preconfigured"])
|
||||
var/selected = tgui_input_list(user, "Select a skillset", "Skillset", SKILL_PRE)
|
||||
if(!selected || !CanUseTopic(user)) return
|
||||
|
||||
pref.ZeroSkills(1)
|
||||
for(var/V in SKILL_PRE[selected])
|
||||
if(V == "field")
|
||||
pref.skill_specialization = SKILL_PRE[selected]["field"]
|
||||
continue
|
||||
pref.skills[V] = SKILL_PRE[selected][V]
|
||||
pref.CalculateSkillPoints()
|
||||
|
||||
return TOPIC_REFRESH
|
||||
|
||||
else if(href_list["setspecialization"])
|
||||
pref.skill_specialization = href_list["setspecialization"]
|
||||
pref.CalculateSkillPoints()
|
||||
return TOPIC_REFRESH
|
||||
|
||||
return ..()
|
||||
@@ -122,10 +122,6 @@ var/list/preferences_datums = list()
|
||||
//Keeps track of preferrence for not getting any wanted jobs
|
||||
var/alternate_option = 1
|
||||
|
||||
var/used_skillpoints = 0
|
||||
var/skill_specialization = null
|
||||
var/list/skills = list() // skills can range from 0 to 3
|
||||
|
||||
// maps each organ to either null(intact), "cyborg" or "amputated"
|
||||
// will probably not be able to do this for head and torso ;)
|
||||
var/list/organ_data = list()
|
||||
@@ -233,58 +229,6 @@ var/list/preferences_datums = list()
|
||||
value_cache = null
|
||||
return ..()
|
||||
|
||||
/datum/preferences/proc/ZeroSkills(var/forced = 0)
|
||||
for(var/V in SKILLS) for(var/datum/skill/S in SKILLS[V])
|
||||
if(!skills.Find(S.ID) || forced)
|
||||
skills[S.ID] = SKILL_NONE
|
||||
|
||||
/datum/preferences/proc/CalculateSkillPoints()
|
||||
used_skillpoints = 0
|
||||
for(var/V in SKILLS) for(var/datum/skill/S in SKILLS[V])
|
||||
var/multiplier = 1
|
||||
switch(skills[S.ID])
|
||||
if(SKILL_NONE)
|
||||
used_skillpoints += 0 * multiplier
|
||||
if(SKILL_BASIC)
|
||||
used_skillpoints += 1 * multiplier
|
||||
if(SKILL_ADEPT)
|
||||
// secondary skills cost less
|
||||
if(S.secondary)
|
||||
used_skillpoints += 1 * multiplier
|
||||
else
|
||||
used_skillpoints += 3 * multiplier
|
||||
if(SKILL_EXPERT)
|
||||
// secondary skills cost less
|
||||
if(S.secondary)
|
||||
used_skillpoints += 3 * multiplier
|
||||
else
|
||||
used_skillpoints += 6 * multiplier
|
||||
|
||||
/datum/preferences/proc/GetSkillClass(points)
|
||||
return CalculateSkillClass(points, age)
|
||||
|
||||
/proc/CalculateSkillClass(points, age)
|
||||
if(points <= 0) return "Unconfigured"
|
||||
// skill classes describe how your character compares in total points
|
||||
points -= min(round((age - 20) / 2.5), 4) // every 2.5 years after 20, one extra skillpoint
|
||||
if(age > 30)
|
||||
points -= round((age - 30) / 5) // every 5 years after 30, one extra skillpoint
|
||||
switch(points)
|
||||
if(-1000 to 3)
|
||||
return "Terrifying"
|
||||
if(4 to 6)
|
||||
return "Below Average"
|
||||
if(7 to 10)
|
||||
return "Average"
|
||||
if(11 to 14)
|
||||
return "Above Average"
|
||||
if(15 to 18)
|
||||
return "Exceptional"
|
||||
if(19 to 24)
|
||||
return "Genius"
|
||||
if(24 to 1000)
|
||||
return "God"
|
||||
|
||||
/datum/preferences/proc/ShowChoices(mob/user)
|
||||
if(!user || !user.client) return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user