This commit is contained in:
r4d6
2019-12-23 13:30:42 -05:00
parent 54b3e3603e
commit e17d32199d
908 changed files with 6472 additions and 17340 deletions
+58 -36
View File
@@ -14,7 +14,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
//doohickeys for savefiles
var/path
var/default_slot = 1 //Holder so it doesn't default to slot 1, rather the last one used
var/max_save_slots = 16
var/max_save_slots = 8
//non-preference stuff
var/muted = 0
@@ -170,8 +170,12 @@ GLOBAL_LIST_EMPTY(preferences_datums)
var/prefered_security_department = SEC_DEPT_RANDOM
var/custom_species = null
//Quirk list
//Quirk list
var/list/positive_quirks = list()
var/list/negative_quirks = list()
var/list/neutral_quirks = list()
var/list/all_quirks = list()
var/list/character_quirks = list()
//Job preferences 2.0 - indexed by job title , no key or value implies never
var/list/job_preferences = list()
@@ -217,7 +221,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
load_path(C.ckey)
unlock_content = C.IsByondMember()
if(unlock_content)
max_save_slots = 24
max_save_slots = 16
var/loaded_preferences_successfully = load_preferences()
if(loaded_preferences_successfully)
if(load_character())
@@ -237,7 +241,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
/datum/preferences/proc/ShowChoices(mob/user)
if(!user || !user.client)
return
update_preview_icon(current_tab != 2)
update_preview_icon()
var/list/dat = list("<center>")
dat += "<a href='?_src_=prefs;preference=tab;tab=0' [current_tab == 0 ? "class='linkOn'" : ""]>Character Settings</a>"
@@ -329,6 +333,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
dat += "<a style='white-space:nowrap;' href='?_src_=prefs;preference=changeslot;num=[i];' [i == default_slot ? "class='linkOn'" : ""]>[name]</a> "
dat += "</center>"
update_preview_icon()
dat += "<table><tr><td width='340px' height='300px' valign='top'>"
dat += "<h2>Flavor Text</h2>"
dat += "<a href='?_src_=prefs;preference=flavor_text;task=input'><b>Set Examine Text</b></a><br>"
@@ -1196,7 +1201,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
dat += "<center><a href='?_src_=prefs;preference=trait;task=close'>Done</a></center>"
dat += "<hr>"
dat += "<center><b>Current quirks:</b> [all_quirks.len ? all_quirks.Join(", ") : "None"]</center>"
dat += "<center>[GetPositiveQuirkCount()] / [MAX_QUIRKS] max positive quirks<br>\
dat += "<center>[positive_quirks.len] / [MAX_QUIRKS] max positive quirks<br>\
<b>Quirk balance remaining:</b> [GetQuirkBalance()]</center><br>"
for(var/V in SSquirks.quirks)
var/datum/quirk/T = SSquirks.quirks[V]
@@ -1227,12 +1232,12 @@ GLOBAL_LIST_EMPTY(preferences_datums)
<font color='red'><b>LOCKED: [lock_reason]</b></font><br>"
else
if(has_quirk)
dat += "<a href='?_src_=prefs;preference=trait;task=update;trait=[quirk_name]'>[has_quirk ? "Remove" : "Take"] ([quirk_cost] pts.)</a> \
<b><font color='[font_color]'>[quirk_name]</font></b> - [initial(T.desc)]<br>"
dat += "<b><font color='[font_color]'>[quirk_name]</font></b> - [initial(T.desc)] \
<a href='?_src_=prefs;preference=trait;task=update;trait=[quirk_name]'>[has_quirk ? "Lose" : "Take"] ([quirk_cost] pts.)</a><br>"
else
dat += "<a href='?_src_=prefs;preference=trait;task=update;trait=[quirk_name]'>[has_quirk ? "Remove" : "Take"] ([quirk_cost] pts.)</a> \
<font color='[font_color]'>[quirk_name]</font> - [initial(T.desc)]<br>"
dat += "<br><center><a href='?_src_=prefs;preference=trait;task=reset'>Reset Quirks</a></center>"
dat += "<font color='[font_color]'>[quirk_name]</font> - [initial(T.desc)] \
<a href='?_src_=prefs;preference=trait;task=update;trait=[quirk_name]'>[has_quirk ? "Lose" : "Take"] ([quirk_cost] pts.)</a><br>"
dat += "<br><center><a href='?_src_=prefs;preference=trait;task=reset'>Reset Traits</a></center>"
var/datum/browser/popup = new(user, "mob_occupation", "<div align='center'>Quirk Preferences</div>", 900, 600) //no reason not to reuse the occupation window, as it's cleaner that way
popup.set_window_options("can_close=0")
@@ -1246,12 +1251,6 @@ GLOBAL_LIST_EMPTY(preferences_datums)
bal -= initial(T.value)
return bal
/datum/preferences/proc/GetPositiveQuirkCount()
. = 0
for(var/q in all_quirks)
if(SSquirks.quirk_points[q] > 0)
.++
/datum/preferences/Topic(href, href_list, hsrc) //yeah, gotta do this I guess..
. = ..()
if(href_list["close"])
@@ -1317,30 +1316,43 @@ GLOBAL_LIST_EMPTY(preferences_datums)
var/quirk = href_list["trait"]
if(!SSquirks.quirks[quirk])
return
for(var/V in SSquirks.quirk_blacklist) //V is a list
var/list/L = V
for(var/Q in all_quirks)
if((quirk in L) && (Q in L) && !(Q == quirk)) //two quirks have lined up in the list of the list of quirks that conflict with each other, so return (see quirks.dm for more details)
to_chat(user, "<span class='danger'>[quirk] is incompatible with [Q].</span>")
return
var/value = SSquirks.quirk_points[quirk]
var/balance = GetQuirkBalance()
if(quirk in all_quirks)
if(balance + value < 0)
to_chat(user, "<span class='warning'>Refunding this would cause you to go below your balance!</span>")
return
all_quirks -= quirk
if(value == 0)
if(quirk in neutral_quirks)
neutral_quirks -= quirk
all_quirks -= quirk
else
neutral_quirks += quirk
all_quirks += quirk
else
if(GetPositiveQuirkCount() >= MAX_QUIRKS)
to_chat(user, "<span class='warning'>You can't have more than [MAX_QUIRKS] positive quirks!</span>")
return
if(balance - value < 0)
to_chat(user, "<span class='warning'>You don't have enough balance to gain this quirk!</span>")
return
all_quirks += quirk
var/balance = GetQuirkBalance()
if(quirk in positive_quirks)
positive_quirks -= quirk
all_quirks -= quirk
else if(quirk in negative_quirks)
if(balance + value < 0)
to_chat(user, "<span class='warning'>Refunding this would cause you to go below your balance!</span>")
return
negative_quirks -= quirk
all_quirks -= quirk
else if(value > 0)
if(positive_quirks.len >= MAX_QUIRKS)
to_chat(user, "<span class='warning'>You can't have more than [MAX_QUIRKS] positive quirks!</span>")
return
if(balance - value < 0)
to_chat(user, "<span class='warning'>You don't have enough balance to gain this quirk!</span>")
return
positive_quirks += quirk
all_quirks += quirk
else
negative_quirks += quirk
all_quirks += quirk
SetQuirks(user)
if("reset")
all_quirks = list()
positive_quirks = list()
negative_quirks = list()
neutral_quirks = list()
SetQuirks(user)
else
SetQuirks(user)
@@ -1553,8 +1565,10 @@ GLOBAL_LIST_EMPTY(preferences_datums)
var/temp_hsv = RGBtoHSV(new_mutantcolor)
if(new_mutantcolor == "#000000")
features["mcolor"] = pref_species.default_color
update_preview_icon()
else if((MUTCOLORS_PARTSONLY in pref_species.species_traits) || ReadHSV(temp_hsv)[3] >= ReadHSV("#202020")[3]) // mutantcolors must be bright, but only if they affect the skin
features["mcolor"] = sanitize_hexcolor(new_mutantcolor)
update_preview_icon()
else
to_chat(user, "<span class='danger'>Invalid color. Your color is not bright enough.</span>")
@@ -1564,8 +1578,10 @@ GLOBAL_LIST_EMPTY(preferences_datums)
var/temp_hsv = RGBtoHSV(new_mutantcolor)
if(new_mutantcolor == "#000000")
features["mcolor2"] = pref_species.default_color
update_preview_icon()
else if((MUTCOLORS_PARTSONLY in pref_species.species_traits) || ReadHSV(temp_hsv)[3] >= ReadHSV("#202020")[3]) // mutantcolors must be bright, but only if they affect the skin
features["mcolor2"] = sanitize_hexcolor(new_mutantcolor)
update_preview_icon()
else
to_chat(user, "<span class='danger'>Invalid color. Your color is not bright enough.</span>")
@@ -1575,8 +1591,10 @@ GLOBAL_LIST_EMPTY(preferences_datums)
var/temp_hsv = RGBtoHSV(new_mutantcolor)
if(new_mutantcolor == "#000000")
features["mcolor3"] = pref_species.default_color
update_preview_icon()
else if((MUTCOLORS_PARTSONLY in pref_species.species_traits) || ReadHSV(temp_hsv)[3] >= ReadHSV("#202020")[3]) // mutantcolors must be bright, but only if they affect the skin
features["mcolor3"] = sanitize_hexcolor(new_mutantcolor)
update_preview_icon()
else
to_chat(user, "<span class='danger'>Invalid color. Your color is not bright enough.</span>")
@@ -1718,12 +1736,14 @@ GLOBAL_LIST_EMPTY(preferences_datums)
features["body_markings"] = new_body_markings
if(new_body_markings != "None")
features["mam_body_markings"] = "None"
update_preview_icon()
if("legs")
var/new_legs
new_legs = input(user, "Choose your character's legs:", "Character Preference") as null|anything in GLOB.legs_list
if(new_legs)
features["legs"] = new_legs
update_preview_icon()
if("insect_wings")
var/new_insect_wings
@@ -1809,6 +1829,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
else if(new_mam_body_markings == "None")
features["mam_body_markings"] = "Plain"
features["body_markings"] = "None"
update_preview_icon()
//Xeno Bodyparts
if("xenohead")//Head or caste type
@@ -2286,8 +2307,8 @@ GLOBAL_LIST_EMPTY(preferences_datums)
pref_species = new /datum/species/human
save_character()
character.dna.features = features.Copy()
character.set_species(chosen_species, icon_update = FALSE, pref_load = TRUE)
character.dna.features = features.Copy()
character.dna.real_name = character.real_name
character.dna.nameless = character.nameless
character.dna.custom_species = character.custom_species
@@ -2316,6 +2337,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
if(icon_updates)
character.update_body()
character.update_hair()
character.update_body_parts()
/datum/preferences/proc/get_default_name(name_id)
switch(name_id)
@@ -112,6 +112,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
if(current_version < 24 && S["feature_exhibitionist"])
var/datum/quirk/exhibitionism/E
var/quirk_name = initial(E.name)
neutral_quirks += quirk_name
all_quirks += quirk_name
/datum/preferences/proc/load_path(ckey,filename="preferences.sav")
@@ -385,6 +386,9 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
//Quirks
S["all_quirks"] >> all_quirks
S["positive_quirks"] >> positive_quirks
S["negative_quirks"] >> negative_quirks
S["neutral_quirks"] >> neutral_quirks
//Citadel code
S["feature_genitals_use_skintone"] >> features["genitals_use_skintone"]
@@ -515,6 +519,10 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
all_quirks = SANITIZE_LIST(all_quirks)
positive_quirks = SANITIZE_LIST(positive_quirks)
negative_quirks = SANITIZE_LIST(negative_quirks)
neutral_quirks = SANITIZE_LIST(neutral_quirks)
cit_character_pref_load(S)
return 1
@@ -590,6 +598,9 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
//Quirks
WRITE_FILE(S["all_quirks"] , all_quirks)
WRITE_FILE(S["positive_quirks"] , positive_quirks)
WRITE_FILE(S["negative_quirks"] , negative_quirks)
WRITE_FILE(S["neutral_quirks"] , neutral_quirks)
cit_character_pref_save(S)
+1 -1
View File
@@ -116,7 +116,7 @@ GLOBAL_VAR_INIT(normal_aooc_colour, "#ce254f")
antaglisting |= M.current.client
for(var/mob/M in GLOB.player_list)
if(M.client && (M.stat == DEAD || M.client.holder || is_special_character(M)))
if(M.client && (M.stat == DEAD || M.client.holder))
antaglisting |= M.client
for(var/client/C in antaglisting)