ID:2082502
 
Code:
world/mob = /mob/Player

var
preset_stat = list(
"Homo Sapiens Sapiens" = list(
"height" = 175,
"stamina" = list("max" = 100, "max exp" = 1000),
"upper body" = list(
"strength" = list("max" = 10, "max exp" = 100))
"lower body" = list(
"strength" = list("max" = 10, "max exp" = 100),
"endurance" = list("max" = 10, "max exp" = 100))))

mob/Login()
set_stats(preset_stat["Homo Sapiens Sapiens"])


or

mob/Login()
switch(input("Select race/species", "Race/Species") in list("Homo Sapiens Sapiens", "Homo Sapiens Idaltu", "Homo Neanderthalis"))
if ("Homo Sapiens Sapiens")
var/mob/HSS/H = new
H.key = src.key
if ("Homo Sapiens Idaltu")
else if ("Homo Neanderthalis")

mob
HSS
height = 175
stamina = list("max" = 100, "max exp" = 1000),
upper body = list(
"strength" = list("max" = 10, "max exp" = 100))
lower body = list(
"strength" = list("max" = 10, "max exp" = 100),
"endurance" = list("max" = 10, "max exp" = 100))


Problem description:
Which one is more efficient?

Is it better to turn a player mob into a HSS mob, or have the existing mob take in stats from a list?

As you can see, the plan is to have options for different races or species.

Alternative methods would be greatly appreciated (still a beginner on this language).


Thanks
Using a separate type for each race is generally ideal, it's a lot cleaner to read and saves a lot of processing to load the data in manually.
Using a separate type for each race is generally ideal

I generally prefer something more along the lines of:

var/list/races
var/race_manager/race_manager = new()

race_manager
New()
races = list()
for(var/v in typesof(/race)-/race)
races[v] = new v()

race
var
icon
list/passives
str = 10
agi = 10
vit = 10
int = 10
wis = 10
cha = 10
proc
assign(mob/combatant/c)
c.icon = icon
charcreated(mob/combatant/c)
assign(c)
c.passives += passives
human
icon = 'human.dmi'
passives = newlist(/passive/human_experience_boost)
elf
icon = 'elf.dmi'
vit = 8
wis = 12
passives = newlist(/passive/elf_mana_regen)


Then you can just reference the global race object and store the type in the player rather than the object itself.