public CharacterSheet(AbilityScores abilityScore, PersonalInformation personalInfo, CharacterProgress characterProg, CombatScores cScores, SkillScores sScores, CharacterColors characterColors, Character character, CharacterLoadout loadout) { abilityScores = abilityScore; personalInformation = personalInfo; characterProgress = characterProg; combatScores = cScores; skillScores = sScores; inventory = new Inventory(); inventory.character = character; this.characterColors = characterColors; characterLoadout = new CharacterLoadoutActual(loadout, character, characterColors); // Character Armor // Character Inventory }
private void assignStats() { AbilityScores characterStats = character.characterSheet.abilityScores; CombatScores statModifiers = character.characterSheet.combatScores; SkillScores characterSkillScores = character.characterSheet.skillScores; physique.sturdyAndMod.text = "Sturdy: " + characterStats.getSturdy() + "\nMod: " + statModifiers.getSturdyMod(); // characterStats.getSturdy(), // statModifiers.getSturdyMod()); physique.athleticsAndMelee.text = "Athletics: " + characterSkillScores.getScore(Skill.Athletics) + "\nMelee: " + characterSkillScores.getScore(Skill.Melee); prowess.perceptionAndMod.text = "Perception: " + characterStats.getPerception() + "\nMod: " + statModifiers.getPerceptionMod(); prowess.rangedAndStealth.text = "Ranged: " + characterSkillScores.getScore(Skill.Ranged) + "\nStealth: " + characterSkillScores.getScore(Skill.Stealth); mastery.techniqueAndMod.text = "Technique: " + characterStats.getTechnique() + "\nMod: " + statModifiers.getTechniqueMod(); mastery.mechanicalAndMedicinal.text = "Mechanical: " + characterSkillScores.getScore(Skill.Mechanical) + "\nMedicinal: " + characterSkillScores.getScore(Skill.Medicinal); knowledge.wellVersedAndMod.text = "Well-Versed: " + characterStats.getWellVersed() + "\nMod: " + statModifiers.getWellVersedMod(); knowledge.historicalAndPolitical.text = "Historical: " + characterSkillScores.getScore(Skill.Historical) + "\nPolitical: " + characterSkillScores.getScore(Skill.Political); }
public void loadCharacter(string firstName, string lastName, CharacterSex mCSex, CharacterRace mCRace, int age, CharacterBackground mCBackground, int height, int weight, CharacterClass mCClass, int mCSturdy, int mCPerception, int mCTechnique, int mCWellVersed, Color characterColor, Color headColor, Color primaryColor, Color secondaryColor, CharacterHairStyle hairStyle) { int heightRemainder = height % 12; height -= heightRemainder; personalInfo = new PersonalInformation(new CharacterName(firstName, lastName), mCSex, mCRace, mCBackground, new CharacterAge(age), new CharacterHeight(height, heightRemainder), new CharacterWeight(weight), hairStyle); characterProgress = new CharacterProgress(mCClass); abilityScores = new AbilityScores(mCSturdy, mCPerception, mCTechnique, mCWellVersed); combatScores = new CombatScores(abilityScores, personalInfo, characterProgress); skillScores = new SkillScores(combatScores, characterProgress); CharacterColors characterColors = new CharacterColors(characterColor, headColor, primaryColor, secondaryColor); characterSheet = new CharacterSheet(abilityScores, personalInfo, characterProgress, combatScores, skillScores, characterColors, this, characterLoadout); }
public void loadCharacterFromTextFile(string fileName) { // TextAsset text = Resources.Load<TextAsset>("Saves/" + fileName); // string data = text.text; string data = Saves.getCharactersString(fileName); string[] components = data.Split(new char[] { ';' }); int curr = 0; string firstName = components[curr++]; string lastName = components[curr++]; int sex = int.Parse(components[curr++]); CharacterSex sexC = (sex == 0 ? CharacterSex.Male : (sex == 1 ? CharacterSex.Female : CharacterSex.Other)); int race = int.Parse(components[curr++]); CharacterRace raceC = CharacterRace.getRace(race == 0 ? RaceName.Berrind : (race == 1 ? RaceName.Ashpian : RaceName.Rorrul)); int background = int.Parse(components[curr++]); CharacterBackground backgroundC = (background == 0 ? (race == 0 ? CharacterBackground.FallenNoble : (race == 1 ? CharacterBackground.Commoner : CharacterBackground.Servant)) : (race == 0 ? CharacterBackground.WhiteGem : (race == 1 ? CharacterBackground.Immigrant : CharacterBackground.Unknown))); int age = int.Parse(components[curr++]); int height = int.Parse(components[curr++]); int weight = int.Parse(components[curr++]); int class1 = int.Parse(components[curr++]); ClassName className = (class1 == 0 ? ClassName.ExSoldier : (class1 == 1 ? ClassName.Engineer : (class1 == 2 ? ClassName.Investigator : (class1 == 3 ? ClassName.Researcher : ClassName.Orator)))); int sturdy = int.Parse(components[curr++]); int perception = int.Parse(components[curr++]); int technique = int.Parse(components[curr++]); int wellVersed = int.Parse(components[curr++]); int athletics = int.Parse(components[curr++]); int melee = int.Parse(components[curr++]); int ranged = int.Parse(components[curr++]); int stealth = int.Parse(components[curr++]); int mechanical = int.Parse(components[curr++]); int medicinal = int.Parse(components[curr++]); int historical = int.Parse(components[curr++]); int political = int.Parse(components[curr++]); Color characterColor = new Color(int.Parse(components[curr++]) / 255.0f, int.Parse(components[curr++]) / 255.0f, int.Parse(components[curr++]) / 255.0f); Debug.Log(characterColor.r + " " + characterColor.g + " " + characterColor.b); Color headColor = new Color(int.Parse(components[curr++]) / 255.0f, int.Parse(components[curr++]) / 255.0f, int.Parse(components[curr++]) / 255.0f); Color primaryColor = new Color(int.Parse(components[curr++]) / 255.0f, int.Parse(components[curr++]) / 255.0f, int.Parse(components[curr++]) / 255.0f); Color secondaryColor = new Color(int.Parse(components[curr++]) / 255.0f, int.Parse(components[curr++]) / 255.0f, int.Parse(components[curr++]) / 255.0f); int hairStyle = 0; int level = 1; int experience = 0; if (curr < components.Length - 1) { hairStyle = int.Parse(components[curr++]); } if (curr < components.Length - 1) { level = int.Parse(components[curr++]); } if (curr < components.Length - 1) { experience = int.Parse(components[curr++]); } int money = 0; int health = 100000; int composure = 100000; int numFeatures = 0; int numItems = 0; int focus = 0; if (curr < components.Length - 1) { money = int.Parse(components[curr++]); } if (curr < components.Length - 1) { health = int.Parse(components[curr++]); } if (curr < components.Length - 1) { composure = int.Parse(components[curr++]); } if (curr < components.Length - 1) { numFeatures = int.Parse(components[curr++]); } int[] features = new int[numFeatures]; for (int n = 0; n < numFeatures; n++) { if (curr < components.Length - 1) { features[n] = int.Parse(components[curr++]); } } if (curr < components.Length - 1) { focus = int.Parse(components[curr++]); } if (curr < components.Length - 1) { numItems = int.Parse(components[curr++]); } personalInfo = new PersonalInformation(new CharacterName(firstName, lastName), sexC, raceC, backgroundC, new CharacterAge(age), new CharacterHeight(height), new CharacterWeight(weight), new CharacterHairStyle(hairStyle)); characterProgress = new CharacterProgress(CharacterClass.getClass(className)); abilityScores = new AbilityScores(sturdy, perception, technique, wellVersed); combatScores = new CombatScores(abilityScores, personalInfo, characterProgress); skillScores = new SkillScores(combatScores, characterProgress); CharacterColors characterColors = new CharacterColors(characterColor, headColor, primaryColor, secondaryColor); characterSheet = new CharacterSheet(abilityScores, personalInfo, characterProgress, combatScores, skillScores, characterColors, this, characterLoadout); skillScores.incrementScore(Skill.Athletics, athletics); skillScores.incrementScore(Skill.Melee, melee); skillScores.incrementScore(Skill.Ranged, ranged); skillScores.incrementScore(Skill.Stealth, stealth); skillScores.incrementScore(Skill.Mechanical, mechanical); skillScores.incrementScore(Skill.Medicinal, medicinal); skillScores.incrementScore(Skill.Historical, historical); skillScores.incrementScore(Skill.Political, political); characterProgress.setLevel(level); characterProgress.setExperience(experience); characterSheet.inventory.purse.receiveMoney(money); combatScores.setHealth(health); combatScores.setComposure(composure); characterProgress.getCharacterClass().chosenFeatures = features; characterProgress.setWeaponFocus(focus); Inventory inv = characterSheet.inventory; for (int n = 0; n < numItems; n++) { int slot = int.Parse(components[curr++]); ItemCode code = (ItemCode)int.Parse(components[curr++]); string itemData = components[curr++]; Item i = Item.deserializeItem(code, itemData); if (slot < 100) { if (inv.inventory[slot].item != null) { if (inv.itemCanStackWith(inv.inventory[slot].item, i)) { inv.inventory[slot].item.addToStack(i); } } else if (inv.canInsertItemInSlot(i, Inventory.getSlotForIndex(slot))) { inv.insertItemInSlot(i, Inventory.getSlotForIndex(slot)); } } else { characterSheet.characterLoadout.setItemInSlot(getArmorSlot(slot), i); } //Inventory stuff } //Right Weapon = 100; //Left Weapon = 110; //Head = 120; //Shoulder = 130; //Chest = 140; //Legs = 150; //Boots = 160; //Gloves = 170; if (curr < components.Length - 1) { characterProgress.setFavoredRace(int.Parse(components[curr++])); } }