public static void MakeBody(string buildCode) { buildCode = buildCode.ToLower(); BuildTemplate = new CharacterTemplate(); string bodyObject = "Humanoid"; string genotype = GetGenotype(buildCode); string subtype = GetSubtype(buildCode, genotype); if (!string.IsNullOrEmpty(genotype)) { GenotypeEntry gEntry = GenotypeFactory.GenotypesByName[genotype]; if (gEntry != null && !string.IsNullOrEmpty(gEntry.BodyObject)) { bodyObject = GenotypeFactory.GenotypesByName[genotype].BodyObject; } } if (!string.IsNullOrEmpty(subtype)) { SubtypeEntry sEntry = SubtypeFactory.SubtypesByName[subtype]; if (sEntry != null && !string.IsNullOrEmpty(sEntry.BodyObject)) { bodyObject = SubtypeFactory.SubtypesByName[subtype].BodyObject; } } BuildTemplate.Genotype = genotype; BuildTemplate.Subtype = subtype; BuildTemplate.BodyForm = bodyObject; BuildTemplate.PlayerBody = GameObject.create(bodyObject); BuildTemplate.PlayerStats = GameObject.create("Creature"); foreach (Statistic value in BuildTemplate.PlayerStats.Statistics.Values) { BuildTemplate.PlayerBody.Statistics[value.Name] = new Statistic(value); BuildTemplate.PlayerBody.Statistics[value.Name].Owner = BuildTemplate.PlayerBody; } BuildTemplate.PlayerBody.Statistics["Strength"].BaseValue = buildCode[2] - 97 + 6; BuildTemplate.PlayerBody.Statistics["Agility"].BaseValue = buildCode[3] - 97 + 6; BuildTemplate.PlayerBody.Statistics["Toughness"].BaseValue = buildCode[4] - 97 + 6; BuildTemplate.PlayerBody.Statistics["Intelligence"].BaseValue = buildCode[5] - 97 + 6; BuildTemplate.PlayerBody.Statistics["Willpower"].BaseValue = buildCode[6] - 97 + 6; BuildTemplate.PlayerBody.Statistics["Ego"].BaseValue = buildCode[7] - 97 + 6; CreateCharacter.Template = BuildTemplate; CreateCharacter.InitCybernetics(); ApplyCybernetics(BuildTemplate, buildCode); ValidateAttributes(BuildTemplate.PlayerBody); ApplyAttributeModifiers(); List <MLNode> mutationNodes = GetMLNodes(); SelectBuildMLNodes(buildCode, mutationNodes); ApplyMutations(BuildTemplate, mutationNodes); BuildTemplate.PlayerBody.Property.Add("MutationLevel", BuildTemplate.MutationLevel); BuildTemplate.PlayerBody.Property.Add("BodyForm", BuildTemplate.BodyForm); BuildTemplate.PlayerBody.Property.Add("Genotype", BuildTemplate.Genotype); BuildTemplate.PlayerBody.Property.Add("Subtype", BuildTemplate.Subtype); BuildTemplate.PlayerBody.Statistics["XP"].BaseValue = 0; BuildTemplate.PlayerBody.Statistics["Hitpoints"].BaseValue = BuildTemplate.PlayerBody.Stat("Toughness"); ApplyCyberneticsStatMods(); }