mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-01-06 07:22:42 +00:00
Added dynamic flavour text, where covered bodyparts' flavour isn't displayed
This commit is contained in:
@@ -107,7 +107,8 @@ datum/preferences
|
||||
var/list/organ_data = list()
|
||||
var/list/player_alt_titles = new() // the default name of a job like "Medical Doctor"
|
||||
|
||||
var/flavor_text = ""
|
||||
var/list/flavor_texts = list()
|
||||
|
||||
var/med_record = ""
|
||||
var/sec_record = ""
|
||||
var/gen_record = ""
|
||||
@@ -386,14 +387,7 @@ datum/preferences
|
||||
|
||||
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=input'><b>Set Flavor Text</b></a><br>"
|
||||
if(lentext(flavor_text) <= 40)
|
||||
if(!lentext(flavor_text))
|
||||
dat += "\[...\]"
|
||||
else
|
||||
dat += "[flavor_text]"
|
||||
else
|
||||
dat += "[copytext(flavor_text, 1, 37)]...<br>"
|
||||
dat += "<a href='byond://?src=\ref[user];preference=flavor_text;task=open'><b>Set Flavor Text</b></a><br>"
|
||||
dat += "<br>"
|
||||
|
||||
dat += "<br><b>Hair</b><br>"
|
||||
@@ -558,24 +552,15 @@ datum/preferences
|
||||
|
||||
HTML += "<a href=\"byond://?src=\ref[user];preference=records;task=med_record\">Medical Records</a><br>"
|
||||
|
||||
if(lentext(med_record) <= 40)
|
||||
HTML += "[med_record]"
|
||||
else
|
||||
HTML += "[copytext(med_record, 1, 37)]..."
|
||||
HTML += TextPreview(med_record,40)
|
||||
|
||||
HTML += "<br><br><a href=\"byond://?src=\ref[user];preference=records;task=gen_record\">Employment Records</a><br>"
|
||||
|
||||
if(lentext(gen_record) <= 40)
|
||||
HTML += "[gen_record]"
|
||||
else
|
||||
HTML += "[copytext(gen_record, 1, 37)]..."
|
||||
HTML += TextPreview(gen_record,40)
|
||||
|
||||
HTML += "<br><br><a href=\"byond://?src=\ref[user];preference=records;task=sec_record\">Security Records</a><br>"
|
||||
|
||||
if(lentext(sec_record) <= 40)
|
||||
HTML += "[sec_record]<br>"
|
||||
else
|
||||
HTML += "[copytext(sec_record, 1, 37)]...<br>"
|
||||
HTML += TextPreview(sec_record,40)
|
||||
|
||||
HTML += "<br>"
|
||||
HTML += "<a href=\"byond://?src=\ref[user];preference=records;records=-1\">\[Done\]</a>"
|
||||
@@ -603,7 +588,44 @@ datum/preferences
|
||||
user << browse(HTML, "window=antagoptions")
|
||||
return
|
||||
|
||||
|
||||
proc/SetFlavorText(mob/user)
|
||||
var/HTML = "<body>"
|
||||
HTML += "<tt><center>"
|
||||
HTML += "<b>Set Flavour Text</b> <hr />"
|
||||
HTML += "<br></center>"
|
||||
HTML += "<a href='byond://?src=\ref[user];preference=flavor_text;task=general'>General:</a> "
|
||||
HTML += TextPreview(flavor_texts["general"])
|
||||
HTML += "<br>"
|
||||
HTML += "<a href='byond://?src=\ref[user];preference=flavor_text;task=head'>Head:</a> "
|
||||
HTML += TextPreview(flavor_texts["head"])
|
||||
HTML += "<br>"
|
||||
HTML += "<a href='byond://?src=\ref[user];preference=flavor_text;task=face'>Face:</a> "
|
||||
HTML += TextPreview(flavor_texts["face"])
|
||||
HTML += "<br>"
|
||||
HTML += "<a href='byond://?src=\ref[user];preference=flavor_text;task=eyes'>Eyes:</a> "
|
||||
HTML += TextPreview(flavor_texts["eyes"])
|
||||
HTML += "<br>"
|
||||
HTML += "<a href='byond://?src=\ref[user];preference=flavor_text;task=torso'>Body:</a> "
|
||||
HTML += TextPreview(flavor_texts["torso"])
|
||||
HTML += "<br>"
|
||||
HTML += "<a href='byond://?src=\ref[user];preference=flavor_text;task=arms'>Arms:</a> "
|
||||
HTML += TextPreview(flavor_texts["arms"])
|
||||
HTML += "<br>"
|
||||
HTML += "<a href='byond://?src=\ref[user];preference=flavor_text;task=hands'>Hands:</a> "
|
||||
HTML += TextPreview(flavor_texts["hands"])
|
||||
HTML += "<br>"
|
||||
HTML += "<a href='byond://?src=\ref[user];preference=flavor_text;task=legs'>Legs:</a> "
|
||||
HTML += TextPreview(flavor_texts["legs"])
|
||||
HTML += "<br>"
|
||||
HTML += "<a href='byond://?src=\ref[user];preference=flavor_text;task=feet'>Feet:</a> "
|
||||
HTML += TextPreview(flavor_texts["feet"])
|
||||
HTML += "<br>"
|
||||
HTML += "<hr />"
|
||||
HTML +="<a href='?src=\ref[user];preference=flavor_text;task=done'>\[Done\]</a>"
|
||||
HTML += "<tt>"
|
||||
user << browse(null, "window=preferences")
|
||||
user << browse(HTML, "window=flavor_text;size=430x300")
|
||||
return
|
||||
|
||||
proc/GetPlayerAltTitle(datum/job/job)
|
||||
return player_alt_titles.Find(job.title) > 0 \
|
||||
@@ -805,6 +827,72 @@ datum/preferences
|
||||
SetSkills(user)
|
||||
return 1
|
||||
|
||||
else if (href_list["preference"] == "loadout")
|
||||
|
||||
if(href_list["task"] == "input")
|
||||
|
||||
var/list/valid_gear_choices = list()
|
||||
|
||||
for(var/gear_name in gear_datums)
|
||||
var/datum/gear/G = gear_datums[gear_name]
|
||||
if(G.whitelisted && !is_alien_whitelisted(user, G.whitelisted))
|
||||
continue
|
||||
valid_gear_choices += gear_name
|
||||
|
||||
var/choice = input(user, "Select gear to add: ") as null|anything in valid_gear_choices
|
||||
|
||||
if(choice && gear_datums[choice])
|
||||
|
||||
var/total_cost = 0
|
||||
|
||||
if(isnull(gear) || !islist(gear)) gear = list()
|
||||
|
||||
if(gear && gear.len)
|
||||
for(var/gear_name in gear)
|
||||
if(gear_datums[gear_name])
|
||||
var/datum/gear/G = gear_datums[gear_name]
|
||||
total_cost += G.cost
|
||||
|
||||
var/datum/gear/C = gear_datums[choice]
|
||||
total_cost += C.cost
|
||||
if(C && total_cost <= MAX_GEAR_COST)
|
||||
gear += choice
|
||||
user << "\blue Added [choice] for [C.cost] points ([MAX_GEAR_COST - total_cost] points remaining)."
|
||||
else
|
||||
user << "\red That item will exceed the maximum loadout cost of [MAX_GEAR_COST] points."
|
||||
|
||||
else if(href_list["task"] == "remove")
|
||||
var/to_remove = href_list["gear"]
|
||||
if(!to_remove) return
|
||||
for(var/gear_name in gear)
|
||||
if(gear_name == to_remove)
|
||||
gear -= gear_name
|
||||
break
|
||||
|
||||
else if(href_list["preference"] == "flavor_text")
|
||||
switch(href_list["task"])
|
||||
if("open")
|
||||
SetFlavorText(user)
|
||||
return
|
||||
if("done")
|
||||
user << browse(null, "window=flavor_text")
|
||||
ShowChoices(user)
|
||||
return
|
||||
if("general")
|
||||
var/msg = input(usr,"Give a general description of your character. This will be shown regardless of clothing, and may include OOC notes and preferences.","Flavor Text",html_decode(flavor_texts[href_list["task"]])) as message
|
||||
if(msg != null)
|
||||
msg = copytext(msg, 1, MAX_MESSAGE_LEN)
|
||||
msg = html_encode(msg)
|
||||
flavor_texts[href_list["task"]] = msg
|
||||
else
|
||||
var/msg = input(usr,"Set the flavor text for your [href_list["task"]].","Flavor Text",html_decode(flavor_texts[href_list["task"]])) as message
|
||||
if(msg != null)
|
||||
msg = copytext(msg, 1, MAX_MESSAGE_LEN)
|
||||
msg = html_encode(msg)
|
||||
flavor_texts[href_list["task"]] = msg
|
||||
SetFlavorText(user)
|
||||
return
|
||||
|
||||
else if(href_list["preference"] == "records")
|
||||
if(text2num(href_list["record"]) >= 1)
|
||||
SetRecords(user)
|
||||
@@ -857,48 +945,6 @@ datum/preferences
|
||||
ShowChoices(user)
|
||||
return 1
|
||||
|
||||
else if (href_list["preference"] == "loadout")
|
||||
|
||||
if(href_list["task"] == "input")
|
||||
|
||||
var/list/valid_gear_choices = list()
|
||||
|
||||
for(var/gear_name in gear_datums)
|
||||
var/datum/gear/G = gear_datums[gear_name]
|
||||
if(G.whitelisted && !is_alien_whitelisted(user, G.whitelisted))
|
||||
continue
|
||||
valid_gear_choices += gear_name
|
||||
|
||||
var/choice = input(user, "Select gear to add: ") as null|anything in valid_gear_choices
|
||||
|
||||
if(choice && gear_datums[choice])
|
||||
|
||||
var/total_cost = 0
|
||||
|
||||
if(isnull(gear) || !islist(gear)) gear = list()
|
||||
|
||||
if(gear && gear.len)
|
||||
for(var/gear_name in gear)
|
||||
if(gear_datums[gear_name])
|
||||
var/datum/gear/G = gear_datums[gear_name]
|
||||
total_cost += G.cost
|
||||
|
||||
var/datum/gear/C = gear_datums[choice]
|
||||
total_cost += C.cost
|
||||
if(C && total_cost <= MAX_GEAR_COST)
|
||||
gear += choice
|
||||
user << "\blue Added [choice] for [C.cost] points ([MAX_GEAR_COST - total_cost] points remaining)."
|
||||
else
|
||||
user << "\red That item will exceed the maximum loadout cost of [MAX_GEAR_COST] points."
|
||||
|
||||
else if(href_list["task"] == "remove")
|
||||
var/to_remove = href_list["gear"]
|
||||
if(!to_remove) return
|
||||
for(var/gear_name in gear)
|
||||
if(gear_name == to_remove)
|
||||
gear -= gear_name
|
||||
break
|
||||
|
||||
switch(href_list["task"])
|
||||
if("random")
|
||||
switch(href_list["preference"])
|
||||
@@ -1159,15 +1205,6 @@ datum/preferences
|
||||
if(new_relation)
|
||||
nanotrasen_relation = new_relation
|
||||
|
||||
if("flavor_text")
|
||||
var/msg = input(usr,"Set the flavor text in your 'examine' verb. This can also be used for OOC notes and preferences!","Flavor Text",html_decode(flavor_text)) as message
|
||||
|
||||
if(msg != null)
|
||||
msg = copytext(msg, 1, MAX_MESSAGE_LEN)
|
||||
msg = html_encode(msg)
|
||||
|
||||
flavor_text = msg
|
||||
|
||||
if("disabilities")
|
||||
if(text2num(href_list["disabilities"]) >= -1)
|
||||
if(text2num(href_list["disabilities"]) >= 0)
|
||||
@@ -1363,7 +1400,16 @@ datum/preferences
|
||||
if(character.dna)
|
||||
character.dna.real_name = character.real_name
|
||||
|
||||
character.flavor_text = flavor_text
|
||||
character.flavor_texts["general"] = flavor_texts["general"]
|
||||
character.flavor_texts["head"] = flavor_texts["head"]
|
||||
character.flavor_texts["face"] = flavor_texts["face"]
|
||||
character.flavor_texts["eyes"] = flavor_texts["eyes"]
|
||||
character.flavor_texts["torso"] = flavor_texts["torso"]
|
||||
character.flavor_texts["arms"] = flavor_texts["arms"]
|
||||
character.flavor_texts["hands"] = flavor_texts["hands"]
|
||||
character.flavor_texts["legs"] = flavor_texts["legs"]
|
||||
character.flavor_texts["feet"] = flavor_texts["feet"]
|
||||
|
||||
character.med_record = med_record
|
||||
character.sec_record = sec_record
|
||||
character.gen_record = gen_record
|
||||
|
||||
@@ -144,7 +144,7 @@
|
||||
S["job_engsec_low"] >> job_engsec_low
|
||||
|
||||
//Miscellaneous
|
||||
S["flavor_text"] >> flavor_text
|
||||
S["flavor_texts"] >> flavor_texts
|
||||
S["med_record"] >> med_record
|
||||
S["sec_record"] >> sec_record
|
||||
S["gen_record"] >> gen_record
|
||||
@@ -265,7 +265,7 @@
|
||||
S["job_engsec_low"] << job_engsec_low
|
||||
|
||||
//Miscellaneous
|
||||
S["flavor_text"] << flavor_text
|
||||
S["flavor_texts"] << flavor_texts
|
||||
S["med_record"] << med_record
|
||||
S["sec_record"] << sec_record
|
||||
S["gen_record"] << gen_record
|
||||
|
||||
@@ -584,4 +584,38 @@
|
||||
set desc = "Sets an extended description of your character's features."
|
||||
set category = "IC"
|
||||
|
||||
flavor_text = copytext(sanitize(input(usr, "Please enter your new flavour text.", "Flavour text", null) as text), 1)
|
||||
var/HTML = "<body>"
|
||||
HTML += "<tt><center>"
|
||||
HTML += "<b>Update Flavour Text</b> <hr />"
|
||||
HTML += "<br></center>"
|
||||
HTML += "<a href='byond://?src=\ref[src];flavor_change=general'>General:</a> "
|
||||
HTML += TextPreview(flavor_texts["general"])
|
||||
HTML += "<br>"
|
||||
HTML += "<a href='byond://?src=\ref[src];flavor_change=head'>Head:</a> "
|
||||
HTML += TextPreview(flavor_texts["head"])
|
||||
HTML += "<br>"
|
||||
HTML += "<a href='byond://?src=\ref[src];flavor_change=face'>Face:</a> "
|
||||
HTML += TextPreview(flavor_texts["face"])
|
||||
HTML += "<br>"
|
||||
HTML += "<a href='byond://?src=\ref[src];flavor_change=eyes'>Eyes:</a> "
|
||||
HTML += TextPreview(flavor_texts["eyes"])
|
||||
HTML += "<br>"
|
||||
HTML += "<a href='byond://?src=\ref[src];flavor_change=torso'>Body:</a> "
|
||||
HTML += TextPreview(flavor_texts["torso"])
|
||||
HTML += "<br>"
|
||||
HTML += "<a href='byond://?src=\ref[src];flavor_change=arms'>Arms:</a> "
|
||||
HTML += TextPreview(flavor_texts["arms"])
|
||||
HTML += "<br>"
|
||||
HTML += "<a href='byond://?src=\ref[src];flavor_change=hands'>Hands:</a> "
|
||||
HTML += TextPreview(flavor_texts["hands"])
|
||||
HTML += "<br>"
|
||||
HTML += "<a href='byond://?src=\ref[src];flavor_change=legs'>Legs:</a> "
|
||||
HTML += TextPreview(flavor_texts["legs"])
|
||||
HTML += "<br>"
|
||||
HTML += "<a href='byond://?src=\ref[src];flavor_change=feet'>Feet:</a> "
|
||||
HTML += TextPreview(flavor_texts["feet"])
|
||||
HTML += "<br>"
|
||||
HTML += "<hr />"
|
||||
HTML +="<a href='?src=\ref[src];flavor_change=done'>\[Done\]</a>"
|
||||
HTML += "<tt>"
|
||||
src << browse(HTML, "window=flavor_changes;size=430x300")
|
||||
@@ -74,6 +74,18 @@
|
||||
prev_gender = gender // Debug for plural genders
|
||||
make_blood()
|
||||
|
||||
/*
|
||||
flavor_texts["general"] = flavor_general
|
||||
flavor_texts["head"] = flavor_head
|
||||
flavor_texts["face"] = flavor_face
|
||||
flavor_texts["eyes"] = flavor_eyes
|
||||
flavor_texts["torso"] = flavor_torso
|
||||
flavor_texts["arms"] = flavor_arms
|
||||
flavor_texts["hands"] = flavor_hands
|
||||
flavor_texts["legs"] = flavor_legs
|
||||
flavor_texts["feet"] = flavor_feet*/
|
||||
|
||||
|
||||
/mob/living/carbon/human/Bump(atom/movable/AM as mob|obj, yes)
|
||||
if ((!( yes ) || now_pushing))
|
||||
return
|
||||
@@ -827,6 +839,27 @@
|
||||
if (href_list["lookmob"])
|
||||
var/mob/M = locate(href_list["lookmob"])
|
||||
M.examine()
|
||||
|
||||
if (href_list["flavor_change"])
|
||||
switch(href_list["flavor_change"])
|
||||
if("done")
|
||||
src << browse(null, "window=flavor_changes")
|
||||
return
|
||||
if("general")
|
||||
var/msg = input(usr,"Update the general description of your character. This will be shown regardless of clothing, and may include OOC notes and preferences.","Flavor Text",html_decode(flavor_texts[href_list["flavor_change"]])) as message
|
||||
if(msg != null)
|
||||
msg = copytext(msg, 1, MAX_MESSAGE_LEN)
|
||||
msg = html_encode(msg)
|
||||
flavor_texts[href_list["flavor_change"]] = msg
|
||||
return
|
||||
else
|
||||
var/msg = input(usr,"Update the flavor text for your [href_list["flavor_change"]].","Flavor Text",html_decode(flavor_texts[href_list["flavor_change"]])) as message
|
||||
if(msg != null)
|
||||
msg = copytext(msg, 1, MAX_MESSAGE_LEN)
|
||||
msg = html_encode(msg)
|
||||
flavor_texts[href_list["flavor_change"]] = msg
|
||||
set_flavor()
|
||||
return
|
||||
..()
|
||||
return
|
||||
|
||||
@@ -1503,3 +1536,41 @@
|
||||
return
|
||||
H << "\red Your nose begins to bleed..."
|
||||
H.drip(1)
|
||||
|
||||
/mob/living/carbon/human/print_flavor_text()
|
||||
var/list/equipment = list(src.head,src.wear_mask,src.glasses,src.w_uniform,src.wear_suit,src.gloves,src.shoes)
|
||||
var/head_exposed = 1
|
||||
var/face_exposed = 1
|
||||
var/eyes_exposed = 1
|
||||
var/torso_exposed = 1
|
||||
var/arms_exposed = 1
|
||||
var/legs_exposed = 1
|
||||
var/hands_exposed = 1
|
||||
var/feet_exposed = 1
|
||||
|
||||
for(var/obj/item/clothing/C in equipment)
|
||||
if(C.body_parts_covered & HEAD)
|
||||
head_exposed = 0
|
||||
if(C.body_parts_covered & FACE)
|
||||
face_exposed = 0
|
||||
if(C.body_parts_covered & EYES)
|
||||
eyes_exposed = 0
|
||||
if(C.body_parts_covered & UPPER_TORSO)
|
||||
torso_exposed = 0
|
||||
if(C.body_parts_covered & ARMS)
|
||||
arms_exposed = 0
|
||||
if(C.body_parts_covered & HANDS)
|
||||
hands_exposed = 0
|
||||
if(C.body_parts_covered & LEGS)
|
||||
legs_exposed = 0
|
||||
if(C.body_parts_covered & FEET)
|
||||
feet_exposed = 0
|
||||
|
||||
flavor_text = flavor_texts["general"]
|
||||
flavor_text += "\n\n"
|
||||
for (var/T in flavor_texts)
|
||||
if(flavor_texts[T] != "")
|
||||
if((T == "head" && head_exposed) || (T == "face" && face_exposed) || (T == "eyes" && eyes_exposed) || (T == "torso" && torso_exposed) || (T == "arms" && arms_exposed) || (T == "hands" && hands_exposed) || (T == "legs" && legs_exposed) || (T == "feet" && feet_exposed))
|
||||
flavor_text += flavor_texts[T]
|
||||
flavor_text += "\n\n"
|
||||
return ..()
|
||||
@@ -70,3 +70,5 @@
|
||||
|
||||
var/mob/remoteview_target = null
|
||||
var/hand_blood_color
|
||||
|
||||
var/list/flavor_texts = list()
|
||||
Reference in New Issue
Block a user