mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Fix issues with skill class procs
This commit is contained in:
12
code/modules/client/preferences.dm
Executable file → Normal file
12
code/modules/client/preferences.dm
Executable file → Normal file
@@ -171,16 +171,16 @@ datum/preferences
|
||||
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
|
||||
var/original_points = 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
|
||||
if(original_points > 0 && points <= 0) points = 1
|
||||
switch(points)
|
||||
if(0)
|
||||
return "Unconfigured"
|
||||
if(1 to 3)
|
||||
if(-1000 to 3)
|
||||
return "Terrifying"
|
||||
if(4 to 6)
|
||||
return "Below Average"
|
||||
@@ -395,7 +395,7 @@ datum/preferences
|
||||
|
||||
dat += "<b><a href=\"byond://?src=\ref[user];preference=antagoptions;active=0\">Set Antag Options</b></a><br>"
|
||||
|
||||
dat += "\t<a href=\"byond://?src=\ref[user];preference=skills\"><b>Set Skills</b> (<i>[GetSkillClass(used_skillpoints)][used_skillpoints > 0 ? " [used_skillpoints]" : "0"])</i></a><br>"
|
||||
dat += "\t<a href=\"byond://?src=\ref[user];preference=skills\"><b>Set Skills</b> (<i>[GetSkillClass(used_skillpoints)] [used_skillpoints > 0 ? "[used_skillpoints]" : "0"])</i></a><br>"
|
||||
|
||||
dat += "<a href='byond://?src=\ref[user];preference=flavor_text;task=open'><b>Set Flavor Text</b></a><br>"
|
||||
dat += "<a href='byond://?src=\ref[user];preference=flavour_text_robot;task=open'><b>Set Robot Flavour Text</b></a><br>"
|
||||
|
||||
@@ -168,30 +168,7 @@ proc/setup_skills()
|
||||
|
||||
|
||||
mob/living/carbon/human/proc/GetSkillClass(points)
|
||||
// skill classes describe how your character compares in total points
|
||||
var/original_points = 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
|
||||
if(original_points > 0 && points <= 0) points = 1
|
||||
switch(points)
|
||||
if(0)
|
||||
return "Unconfigured"
|
||||
if(1 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"
|
||||
|
||||
return CalculateSkillClass(points, age)
|
||||
|
||||
proc/show_skill_window(var/mob/user, var/mob/living/carbon/human/M)
|
||||
if(!istype(M)) return
|
||||
|
||||
Reference in New Issue
Block a user