Skip to content

Commit

Permalink
Adds mutant races to the character preferences. It can only choose be…
Browse files Browse the repository at this point in the history
…tween lizard and human right now.

Adds a new server configuration to toggle on and off the mutant races preferences. If it's off, everyone will be human.
  • Loading branch information
Aranclanos committed Apr 12, 2014
1 parent 556d137 commit 2da47fb
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 5 deletions.
5 changes: 5 additions & 0 deletions code/__HELPERS/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ var/list/skin_tones = list(
"african2"
)

var/list/mutant_races = list(
"human",
"lizard",
)

proc/age2agedescription(age)
switch(age)
if(0 to 1) return "infant"
Expand Down
3 changes: 3 additions & 0 deletions code/controllers/configuration.dm
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
var/continuous_round_wiz = 0
var/continuous_round_malf = 0
var/show_game_type_odds = 0 //if set this allows players to see the odds of each roundtype on the get revision screen
var/mutant_races = 0 //players can choose their mutant race before joining the game

var/alert_desc_green = "All threats to the station have passed. Security may not have weapons visible, privacy laws are once again fully enforced."
var/alert_desc_blue_upto = "The station has received reliable information about possible hostile activity on the station. Security staff may have weapons visible, random searches are permitted."
Expand Down Expand Up @@ -375,6 +376,8 @@
config.sandbox_autoclose = 1
if("default_laws")
config.default_laws = text2num(value)
if("join_with_mutant_race")
config.mutant_races = 1
else
diary << "Unknown setting in configuration: '[name]'"

Expand Down
10 changes: 5 additions & 5 deletions code/game/dna.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@
var/mutantrace = null //The type of mutant race the player is if applicable (i.e. potato-man)
var/real_name //Stores the real name of the person who originally got this dna datum. Used primarely for changelings,

/datum/dna/New()
if(!blood_type) blood_type = random_blood_type()

/datum/dna/proc/generate_uni_identity(mob/living/carbon/character)
. = ""
var/list/L = new /list(DNA_UNI_IDENTITY_BLOCKS)
Expand Down Expand Up @@ -69,7 +66,7 @@
if(!istype(owner, /mob/living/carbon/monkey) && !istype(owner, /mob/living/carbon/human))
return
if(!owner.dna)
owner.dna = new /datum/dna()
create_dna(owner)

if(real_name)
owner.real_name = real_name
Expand Down Expand Up @@ -116,7 +113,7 @@
if(!istype(character, /mob/living/carbon/monkey) && !istype(character, /mob/living/carbon/human))
return
if(!character.dna)
character.dna = new /datum/dna()
create_dna(character)
if(blood_type)
character.dna.blood_type = blood_type
character.dna.real_name = character.real_name
Expand All @@ -125,6 +122,9 @@
character.dna.unique_enzymes = character.dna.generate_unique_enzymes(character)
return character.dna

/proc/create_dna(mob/living/carbon/C) //don't use this unless you're about to use hardset_dna or ready_dna
C.dna = new /datum/dna()

/////////////////////////// DNA DATUM

/////////////////////////// DNA HELPER-PROCS
Expand Down
12 changes: 12 additions & 0 deletions code/modules/client/preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ datum/preferences
var/facial_hair_color = "000" //Facial hair color
var/skin_tone = "caucasian1" //Skin color
var/eye_color = "000" //Eye color
var/mutant_race = "human" //Mutant race

//Mob preview
var/icon/preview_icon_front = null
Expand Down Expand Up @@ -163,6 +164,10 @@ datum/preferences

dat += "<table width='100%'><tr><td width='24%' valign='top'>"

if(config.mutant_races)
dat += "<b>Mutant Race:</b><BR><a href='?_src_=prefs;preference=mutant_race;task=input'>[mutant_race]</a><BR>"
else
dat += "<b>Mutant Race:</b> human<BR>"
dat += "<b>Blood Type:</b> [blood_type]<BR>"
dat += "<b>Skin Tone:</b><BR><a href='?_src_=prefs;preference=s_tone;task=input'>[skin_tone]</a><BR>"
dat += "<b>Underwear:</b><BR><a href ='?_src_=prefs;preference=underwear;task=input'>[underwear]</a><BR>"
Expand Down Expand Up @@ -612,6 +617,11 @@ datum/preferences
if(new_eyes)
eye_color = sanitize_hexcolor(new_eyes)

if("mutant_race")
var/new_mutant_race = input(user, "Choose your character's mutant race:", "Character Preference") as null|anything in mutant_races
if(new_mutant_race)
mutant_race = new_mutant_race

if("s_tone")
var/new_s_tone = input(user, "Choose your character's skin-tone:", "Character Preference") as null|anything in skin_tones
if(new_s_tone)
Expand Down Expand Up @@ -712,6 +722,8 @@ datum/preferences
character.name = character.real_name
if(character.dna)
character.dna.real_name = character.real_name
if(mutant_race != "human" && config.mutant_races)
character.dna.mutantrace = mutant_race

character.gender = gender
character.age = age
Expand Down
3 changes: 3 additions & 0 deletions code/modules/client/preferences_savefile.dm
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
S["facial_style_name"] >> facial_hair_style
S["underwear"] >> underwear
S["backbag"] >> backbag
S["mutant_race"] >> mutant_race

//Jobs
S["userandomjob"] >> userandomjob
Expand Down Expand Up @@ -202,6 +203,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
eye_color = sanitize_hexcolor(eye_color, 3, 0)
skin_tone = sanitize_inlist(skin_tone, skin_tones)
backbag = sanitize_integer(backbag, 1, backbaglist.len, initial(backbag))
mutant_race = sanitize_text(mutant_race, initial(mutant_race))

userandomjob = sanitize_integer(userandomjob, 0, 1, initial(userandomjob))
job_civilian_high = sanitize_integer(job_civilian_high, 0, 65535, initial(job_civilian_high))
Expand Down Expand Up @@ -238,6 +240,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
S["facial_style_name"] << facial_hair_style
S["underwear"] << underwear
S["backbag"] << backbag
S["mutant_race"] << mutant_race

//Jobs
S["userandomjob"] << userandomjob
Expand Down
2 changes: 2 additions & 0 deletions code/modules/mob/new_player/new_player.dm
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,8 @@
var/mob/living/carbon/human/new_character = new(loc)
new_character.lastarea = get_area(loc)

create_dna(new_character)

if(config.force_random_names || appearance_isbanned(src))
client.prefs.random_character()
client.prefs.real_name = random_name(gender)
Expand Down
3 changes: 3 additions & 0 deletions config/game_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -184,3 +184,6 @@ SEC_START_BRIG
## Set to 1 for "custom", silicons will start with the custom laws defined in silicon_laws.txt. (If silicon_laws.txt is empty, the AI will spawn with asimov and Custom boards will auto-delete.)
## Set to 2 for "random", silicons will start with a random lawset picked from (at the time of writing): P.A.L.A.D.I.N., Corporate, Asimov. More can be added by changing the law datum paths in ai_laws.dm.
DEFAULT_LAWS 1

## Uncoment to give players the choice of their mutantrace before they join the game
#JOIN_WITH_MUTANT_RACE

0 comments on commit 2da47fb

Please sign in to comment.