Adds Soghun/Tajaran whitelisting. Stick key and race into alienwhitelist.txt like so 'byondguy - Soghun' to allow soghun, etc.

This commit is contained in:
Erthilo
2012-05-20 20:51:38 +01:00
parent 0cebc4d1f2
commit 56db1fdff8
13 changed files with 77 additions and 2715 deletions
@@ -20,6 +20,7 @@
var/g_eyes = 0.0
var/b_eyes = 0.0
var/s_tone = 0.0
var/species = "Human"
age = 30.0
var/used_skillpoints = 0
var/skill_specialization = null
+8 -3
View File
@@ -392,7 +392,11 @@
proc/create_character()
spawning = 1
var/mob/living/carbon/human/new_character = new(loc)
var/mob/living/carbon/human/new_character // var/path/to/object/varname
if(preferences.species == "Tajaran")
new_character = new /mob/living/carbon/human/tajaran(loc) // varname = new /path/to/object(location_to_spawn_at)
else
new_character = new /mob/living/carbon/human(loc)
new_character.lastarea = get_area(loc)
close_spawn_windows()
@@ -403,8 +407,9 @@
preferences.randomize_appearance_for(new_character)
else
preferences.copy_to(new_character)
src << sound(null, repeat = 0, wait = 0, volume = 85, channel = 1) // MAD JAMS cant last forever yo
if(preferences.species == "Soghun") //This probably shouldn't be here, but I can't think of any other way
new_character.mutantrace = "lizard"
src << sound(null, repeat = 0, wait = 0, volume = 85, channel = 1)
new_character.dna.ready_dna(new_character)
preferences.copydisabilities(new_character)
+30 -3
View File
@@ -90,6 +90,9 @@ datum/preferences
g_facial = 0
b_facial = 0
//Species
species = "Human"
//Skin color
s_tone = 0
@@ -281,6 +284,7 @@ datum/preferences
dat += "<hr><table><tr><td><b>Body</b> "
dat += "(<a href=\"byond://?src=\ref[user];preferences=1;s_tone=random;underwear=random;backbag_type=random;age=random;b_type=random;hair=random;h_style=random;facial=random;f_style=random;eyes=random\">&reg;</A>)" // Random look
dat += "<br>"
dat += "Species: <a href='byond://?src=\ref[user];preferences=1;species=input'>[species]</a><br>"
dat += "Blood Type: <a href='byond://?src=\ref[user];preferences=1;b_type=input'>[b_type]</a><br>"
dat += "Skin Tone: <a href='byond://?src=\ref[user];preferences=1;s_tone=input'>[-s_tone + 35]/220<br></a>"
@@ -696,6 +700,23 @@ datum/preferences
if("random")
b_type = pickweight ( list ("A+" = 31, "A-" = 7, "B+" = 8, "B-" = 2, "AB+" = 2, "AB-" = 1, "O+" = 40, "O-" = 9))
if(link_tags["species"])
switch(link_tags["species"])
if("input")
var/list/new_species = list("Human")
if(config.usealienwhitelist) //If we're using the whitelist, make sure to check it!
if((is_alien_whitelisted(user, "Soghun")) || ((user.client) && (user.client.holder) && (user.client.holder.level) && (user.client.holder.level >= 5))) //Check for Soghun and admins
new_species += "Soghun"
if((is_alien_whitelisted(user, "Tajaran")) || ((user.client) && (user.client.holder) && (user.client.holder.level) && (user.client.holder.level >= 5))) //Check for Tajaran
new_species += "Tajaran"
else //Not using the whitelist? Aliens for everyone!
new_species += "Tajaran"
new_species += "Soghun"
species = input("Please select a species", "Character Generation", null) in new_species
h_style = "Bald" //Try not to carry face/head hair over.
hair_style = "Bald"
f_style = "Shaved"
facial_hair_style = "Shaved"
if(link_tags["hair"])
switch(link_tags["hair"])
@@ -735,14 +756,18 @@ datum/preferences
if("random")
randomize_skin_tone()
if("input")
var/new_tone = input(user, "Please select skin tone level: 1-220 (1=albino, 35=caucasian, 150=black, 220='very' black)", "Character Generation") as text
var/new_tone = input(user, "Please select skin tone level: 1-220 (1=albino, 35=caucasian, 150=black, 220='very' black) or 20-70 for Tajarans", "Character Generation") as text
if(new_tone)
s_tone = max(min(round(text2num(new_tone)), 220), 1)
if(species == "Tajaran")
s_tone = max(min(round(text2num(new_tone)), 70), 20)
else
s_tone = max(min(round(text2num(new_tone)), 220), 1)
s_tone = -s_tone + 35
if(link_tags["h_style"])
if(species != "Human")
return
switch(link_tags["h_style"])
// New and improved hair selection code, by Doohl
if("random") // random hair selection
@@ -785,6 +810,8 @@ datum/preferences
src.ooccolor = ooccolor
if(link_tags["f_style"])
if(species != "Human") //Tajarans and Soghuns don't have hair stuff yet.
return
switch(link_tags["f_style"])
// see above for commentation. This is just a slight modification of the hair code for facial hairs
@@ -209,7 +209,15 @@ datum/preferences
else if (gender == FEMALE)
g = "f"
preview_icon = new /icon('human.dmi', "body_[g]_s", "dir" = preview_dir)
if(species == "Tajaran")
preview_icon = new /icon('tajaran.dmi', "body_[g]_s", "dir" = preview_dir)
else if(species == "Soghun")
if(g == "m")
preview_icon = new /icon('genetics.dmi', "lizard_male_s", "dir" = preview_dir)
else if(g == "f")
preview_icon = new /icon('genetics.dmi', "lizard_female_s", "dir" = preview_dir)
else
preview_icon = new /icon('human.dmi', "body_[g]_s", "dir" = preview_dir)
// Skin tone
if (s_tone >= 0)
+3
View File
@@ -131,6 +131,7 @@ datum/preferences/proc/savefile_save(mob/user, slot)
F["eyes_green"] << src.g_eyes
F["eyes_blue"] << src.b_eyes
F["blood_type"] << src.b_type
F["species"] << src.species
F["underwear"] << src.underwear
F["backbag"] << src.backbag
F["backbag"] << src.backbag
@@ -206,6 +207,8 @@ datum/preferences/proc/savefile_load(mob/user, slot)
F["eyes_green"] >> src.g_eyes
F["eyes_blue"] >> src.b_eyes
F["blood_type"] >> src.b_type
F["species"] >> src.species
if(isnull(species)) species = "Human"
F["underwear"] >> src.underwear
if(underwear == 0) underwear = 6 //For old players who have 0 in their savefile
F["backbag"] >> src.backbag