Swapped languages and datums over to global lists. Updated verbs.

This commit is contained in:
Zuhayr
2013-08-05 20:34:38 -07:00
parent dcad0bc6b4
commit 98bbb095ad
11 changed files with 86 additions and 63 deletions

View File

@@ -17,6 +17,10 @@ var/global/list/landmarks_list = list() //list of all landmarks created
var/global/list/surgery_steps = list() //list of all surgery steps |BS12 var/global/list/surgery_steps = list() //list of all surgery steps |BS12
var/global/list/mechas_list = list() //list of all mechs. Used by hostile mobs target tracking. var/global/list/mechas_list = list() //list of all mechs. Used by hostile mobs target tracking.
//Languages/species
var/global/list/all_species[0]
var/global/list/all_languages[0]
//Preferences stuff //Preferences stuff
//Hairstyles //Hairstyles
var/global/list/hair_styles_list = list() //stores /datum/sprite_accessory/hair indexed by name var/global/list/hair_styles_list = list() //stores /datum/sprite_accessory/hair indexed by name
@@ -69,6 +73,18 @@ var/global/list/backbaglist = list("Nothing", "Backpack", "Satchel", "Satchel Al
var/datum/surgery_step/S = new T var/datum/surgery_step/S = new T
surgery_steps += S surgery_steps += S
sort_surgeries() sort_surgeries()
//Languages and species.
paths = typesof(/datum/language)-/datum/language
for(var/T in paths)
var/datum/language/L = new T
all_languages[L.name] = L
paths = typesof(/datum/species)-/datum/species
for(var/T in paths)
var/datum/species/S = new T
all_species[S.name] = S
/* // Uncomment to debug chemical reaction list. /* // Uncomment to debug chemical reaction list.
/client/verb/debug_chemical_list() /client/verb/debug_chemical_list()

View File

@@ -754,13 +754,13 @@ client
usr << "This can only be done to instances of type /mob/living/carbon/human" usr << "This can only be done to instances of type /mob/living/carbon/human"
return return
var/datum/species/new_species = input("Please choose a new species.","Species",null) as null|anything in (typesof(/datum/species)-/datum/species) var/new_species = input("Please choose a new species.","Species",null) as null|anything in all_species
if(!H) if(!H)
usr << "Mob doesn't exist anymore" usr << "Mob doesn't exist anymore"
return return
if(H.set_species(new new_species)) if(H.set_species(new_species))
usr << "Set species of [H] to [H.species]." usr << "Set species of [H] to [H.species]."
else else
usr << "Failed! Something went wrong." usr << "Failed! Something went wrong."
@@ -773,13 +773,13 @@ client
usr << "This can only be done to instances of type /mob" usr << "This can only be done to instances of type /mob"
return return
var/datum/language/new_language = input("Please choose a language to add.","Language",null) as null|anything in (typesof(/datum/language)-/datum/language) var/new_language = input("Please choose a language to add.","Language",null) as null|anything in all_languages
if(!H) if(!H)
usr << "Mob doesn't exist anymore" usr << "Mob doesn't exist anymore"
return return
if(H.add_language(new new_language)) if(H.add_language(new_language))
usr << "Added [new_language] to [H]." usr << "Added [new_language] to [H]."
else else
usr << "Mob already knows that language." usr << "Mob already knows that language."
@@ -792,13 +792,17 @@ client
usr << "This can only be done to instances of type /mob" usr << "This can only be done to instances of type /mob"
return return
if(!H.languages.len)
usr << "This mob knows no languages."
return
var/datum/language/rem_language = input("Please choose a language to remove.","Language",null) as null|anything in H.languages var/datum/language/rem_language = input("Please choose a language to remove.","Language",null) as null|anything in H.languages
if(!H) if(!H)
usr << "Mob doesn't exist anymore" usr << "Mob doesn't exist anymore"
return return
if(H.remove_language(rem_language)) if(H.remove_language(rem_language.name))
usr << "Removed [rem_language] from [H]." usr << "Removed [rem_language] from [H]."
else else
usr << "Mob doesn't know that language." usr << "Mob doesn't know that language."

View File

@@ -95,12 +95,12 @@ var/global/vox_kills = 0 //Used to check the Inviolate.
var/mob/living/carbon/human/vox = raider.current var/mob/living/carbon/human/vox = raider.current
vox.languages += new /datum/language/vox
vox.real_name = capitalize(newname) vox.real_name = capitalize(newname)
vox.name = vox.real_name vox.name = vox.real_name
vox.age = rand(12,20) vox.age = rand(12,20)
vox.set_species(new /datum/species/vox)
vox.dna.mutantrace = "vox" vox.dna.mutantrace = "vox"
vox.set_species("Vox")
vox.add_language("Vox-pidgin")
vox.h_style = "Short Vox Quills" vox.h_style = "Short Vox Quills"
vox.equip_vox_raider() vox.equip_vox_raider()
vox.regenerate_icons() vox.regenerate_icons()

View File

@@ -117,7 +117,7 @@ Growing it to term with nothing injected will grab a ghost from the observers. *
podman.gender = NEUTER podman.gender = NEUTER
podman.dna = new /datum/dna() podman.dna = new /datum/dna()
podman.dna.real_name = podman.real_name podman.dna.real_name = podman.real_name
podman.set_species(new /datum/species/diona) podman.set_species("Diona")
podman.dna.mutantrace = "plant" podman.dna.mutantrace = "plant"
podman.update_mutantrace() podman.update_mutantrace()

View File

@@ -507,13 +507,14 @@ client/proc/one_click_antag()
i++ i++
newname += pick(list("ti","hi","ki","ya","ta","ha","ka","ya","chi","cha","kah")) newname += pick(list("ti","hi","ki","ya","ta","ha","ka","ya","chi","cha","kah"))
new_vox.languages += new /datum/language/vox
new_vox.real_name = capitalize(newname) new_vox.real_name = capitalize(newname)
new_vox.name = new_vox.real_name new_vox.name = new_vox.real_name
new_vox.age = rand(12,20) new_vox.age = rand(12,20)
new_vox.dna.ready_dna(new_vox) // Creates DNA. new_vox.dna.ready_dna(new_vox) // Creates DNA.
new_vox.set_species(new /datum/species/vox) // Actually makes the vox! How about that. new_vox.dna.mutantrace = "vox"
new_vox.set_species("Vox") // Actually makes the vox! How about that.
new_vox.add_language("Vox-pidgin")
new_vox.mind_initialize() new_vox.mind_initialize()
new_vox.mind.assigned_role = "MODE" new_vox.mind.assigned_role = "MODE"
new_vox.mind.special_role = "Vox Raider" new_vox.mind.special_role = "Vox Raider"

View File

@@ -30,4 +30,29 @@
name = "Vox-pidgin" name = "Vox-pidgin"
speech_verb = "shrieks" speech_verb = "shrieks"
colour = "vox" colour = "vox"
key = "v" key = "v"
// Language handling.
/mob/proc/add_language(var/language)
var/datum/language/new_language = all_languages[language]
if(!istype(new_language,/datum/language))
return
for(var/datum/language/L in languages)
if(L && L.name == new_language)
return 0
languages += new_language
return 1
/mob/proc/remove_language(var/rem_language)
for(var/datum/language/L in languages)
if(L && L.name == rem_language)
languages -= L
return 1
return 0

View File

@@ -13,22 +13,22 @@
/mob/living/carbon/human/skrell/New() /mob/living/carbon/human/skrell/New()
h_style = "Skrell Male Tentacles" h_style = "Skrell Male Tentacles"
set_species(new /datum/species/skrell(src)) set_species("Skrell")
..() ..()
/mob/living/carbon/human/tajaran/New() /mob/living/carbon/human/tajaran/New()
h_style = "Tajaran Ears" h_style = "Tajaran Ears"
set_species(new /datum/species/tajaran(src)) set_species("Tajara")
..() ..()
/mob/living/carbon/human/unathi/New() /mob/living/carbon/human/unathi/New()
h_style = "Unathi Horns" h_style = "Unathi Horns"
set_species(new /datum/species/unathi(src)) set_species("Unathi")
..() ..()
/mob/living/carbon/human/vox/New() /mob/living/carbon/human/vox/New()
h_style = "Short Vox Quills" h_style = "Short Vox Quills"
species = new /datum/species/vox(src) set_species("Vox")
..() ..()
/mob/living/carbon/human/diona/New() /mob/living/carbon/human/diona/New()
@@ -41,7 +41,9 @@
set_species() set_species()
if(species.language) if(species.language)
languages += species.language var/datum/language/L = all_languages[species.language]
if(L)
languages += L
var/datum/reagents/R = new/datum/reagents(1000) var/datum/reagents/R = new/datum/reagents(1000)
reagents = R reagents = R
@@ -1260,21 +1262,15 @@ mob/living/carbon/human/yank_out_object()
else else
usr << "\blue [self ? "Your" : "[src]'s"] pulse is [src.get_pulse(GETPULSE_HAND)]." usr << "\blue [self ? "Your" : "[src]'s"] pulse is [src.get_pulse(GETPULSE_HAND)]."
/mob/living/carbon/human/proc/set_species(var/datum/species/new_species) /mob/living/carbon/human/proc/set_species(var/new_species)
if(!new_species) if(!new_species)
new_species = new /datum/species/human new_species = "Human"
if(species) if(species && (species.name && species.name == new_species))
return
if(species.name == new_species.name) species = all_species[new_species]
return
var/temp = species
species = new_species
del(temp)
else
species = new_species
spawn(0) spawn(0)
update_icons() update_icons()

View File

@@ -25,7 +25,7 @@
var/tail // Name of tail image in species effects icon file. var/tail // Name of tail image in species effects icon file.
var/primitive // Lesser form, if any (ie. monkey for humans) var/primitive // Lesser form, if any (ie. monkey for humans)
var/datum/language/language // Default racial language, if any. var/language // Default racial language, if any.
var/attack_verb = "punch" // Empty hand hurt intent verb. var/attack_verb = "punch" // Empty hand hurt intent verb.
var/breath_type // Non-oxygen gas breathed, if any. var/breath_type // Non-oxygen gas breathed, if any.
@@ -56,7 +56,7 @@
name = "Unathi" name = "Unathi"
icobase = 'icons/mob/human_races/r_lizard.dmi' icobase = 'icons/mob/human_races/r_lizard.dmi'
deform = 'icons/mob/human_races/r_def_lizard.dmi' deform = 'icons/mob/human_races/r_def_lizard.dmi'
language = new /datum/language/unathi language = "Sinta'unathi"
tail = "sogtail" tail = "sogtail"
attack_verb = "scratch" attack_verb = "scratch"
@@ -66,7 +66,7 @@
name = "Tajara" name = "Tajara"
icobase = 'icons/mob/human_races/r_tajaran.dmi' icobase = 'icons/mob/human_races/r_tajaran.dmi'
deform = 'icons/mob/human_races/r_def_tajaran.dmi' deform = 'icons/mob/human_races/r_def_tajaran.dmi'
language = new /datum/language/tajaran language = "Siik'mas"
tail = "tajtail" tail = "tajtail"
attack_verb = "scratch" attack_verb = "scratch"
@@ -76,7 +76,7 @@
name = "Skrell" name = "Skrell"
icobase = 'icons/mob/human_races/r_skrell.dmi' icobase = 'icons/mob/human_races/r_skrell.dmi'
deform = 'icons/mob/human_races/r_def_skrell.dmi' deform = 'icons/mob/human_races/r_def_skrell.dmi'
language = new /datum/language/skrell language = "Skrellian"
flags = WHITELISTED | HAS_LIPS | HAS_UNDERWEAR flags = WHITELISTED | HAS_LIPS | HAS_UNDERWEAR
@@ -84,7 +84,7 @@
name = "Vox" name = "Vox"
icobase = 'icons/mob/human_races/r_vox.dmi' icobase = 'icons/mob/human_races/r_vox.dmi'
deform = 'icons/mob/human_races/r_def_vox.dmi' deform = 'icons/mob/human_races/r_def_vox.dmi'
language = new /datum/language/vox language = "Vox-pidgin"
eyes = "vox_eyes_s" eyes = "vox_eyes_s"
breath_type = "nitrogen" breath_type = "nitrogen"

View File

@@ -955,23 +955,4 @@ mob/verb/yank_out_object()
pinned -= O pinned -= O
if(!pinned.len) if(!pinned.len)
anchored = 0 anchored = 0
return 1 return 1
// Language handling.
/mob/proc/add_language(var/datum/language/new_language)
for(var/datum/language/L in languages)
if(L && L.name == new_language.name)
return 0
languages += new_language
return 1
/mob/proc/remove_language(var/datum/language/rem_language)
for(var/datum/language/L in languages)
if(L && L.name == rem_language.name)
languages -= L
return 1
return 0

View File

@@ -349,26 +349,26 @@
if(client.prefs.species == "Tajaran") //This is like the worst, but it works, so meh. - Erthilo if(client.prefs.species == "Tajaran") //This is like the worst, but it works, so meh. - Erthilo
if(is_alien_whitelisted(src, "Tajaran") || !config.usealienwhitelist) if(is_alien_whitelisted(src, "Tajaran") || !config.usealienwhitelist)
new_character.set_species(new /datum/species/tajaran) new_character.set_species("Tajara")
new_character.languages += new /datum/language/tajaran new_character.add_language("Siik'mas")
if(client.prefs.species == "Unathi") if(client.prefs.species == "Unathi")
if(is_alien_whitelisted(src, "Soghun") || !config.usealienwhitelist) if(is_alien_whitelisted(src, "Soghun") || !config.usealienwhitelist)
new_character.set_species(new /datum/species/unathi) new_character.set_species("Unathi")
new_character.languages += new /datum/language/unathi new_character.add_language("Sinta'unathi")
if(client.prefs.species == "Skrell") if(client.prefs.species == "Skrell")
if(is_alien_whitelisted(src, "Skrell") || !config.usealienwhitelist) if(is_alien_whitelisted(src, "Skrell") || !config.usealienwhitelist)
new_character.set_species(new /datum/species/skrell) new_character.set_species("Skrell")
new_character.languages += new /datum/language/skrell new_character.add_language("Skrellian")
if(client.prefs.language == "Tajaran") if(client.prefs.language == "Tajaran")
if(is_alien_whitelisted(src, "Language_Tajaran") || !config.usealienwhitelist) if(is_alien_whitelisted(src, "Language_Tajaran") || !config.usealienwhitelist)
new_character.languages += new /datum/language/tajaran new_character.add_language("Siik'mas")
if(client.prefs.language == "Unathi") if(client.prefs.language == "Unathi")
if(is_alien_whitelisted(src, "Language_Soghun") || !config.usealienwhitelist) if(is_alien_whitelisted(src, "Language_Soghun") || !config.usealienwhitelist)
new_character.languages += new /datum/language/unathi new_character.add_language("Sinta'unathi")
if(client.prefs.language == "Skrell") if(client.prefs.language == "Skrell")
if(is_alien_whitelisted(src, "Language_Skrell") || !config.usealienwhitelist) if(is_alien_whitelisted(src, "Language_Skrell") || !config.usealienwhitelist)
new_character.languages += new /datum/language/skrell new_character.add_language("Skrellian")
if(ticker.random_players) if(ticker.random_players)
new_character.gender = pick(MALE, FEMALE) new_character.gender = pick(MALE, FEMALE)

View File

@@ -73,8 +73,8 @@
A.randomize_appearance_for(new_mob) A.randomize_appearance_for(new_mob)
var/mob/living/carbon/human/H = new_mob var/mob/living/carbon/human/H = new_mob
var/newspecies = pick(typesof(/datum/species)-/datum/species) var/datum/species/newspecies = pick(all_species)
H.set_species(new newspecies) H.set_species(newspecies.name)
else else
return return