public void submitLevelUp() { return; int[] abilityScores = pointAllocationPanel.GetComponent <BasePointAllocation>().getScores(); int[] skillScores = pointAllocationPanel.GetComponent <BasePointAllocation>().getSkills(); levelUp = new LevelUpContainer() { newAbilityScores = abilityScores, newSkillScores = skillScores }; ClassFeature[] potentialFeatures = character.characterSheet.characterProgress.getCharacterClass().getPossibleFeatures(character.characterSheet.characterProgress.getCharacterLevel() + 1); //Debug.Log(potentialFeatures); if (potentialFeatures.Length > 0) { GameObject.Find("Base").GetComponent <BaseManager>().enableNewClassFeaturePrompt(potentialFeatures, this); } //saveCharacter(levelUp); //Debug.Log(ClassFeatures.getName(potentialFeatures[0]) + ((potentialFeatures[1] == null) ? "" : ClassFeatures.getName(potentialFeatures[1]))); }
private void saveCharacter(LevelUpContainer newStuff) { character.characterSheet.abilityScores.setScores(levelUp.newAbilityScores[0], levelUp.newAbilityScores[1], levelUp.newAbilityScores[2], levelUp.newAbilityScores[3]); character.characterSheet.skillScores.scores = levelUp.newSkillScores; // selectedFeature is the option (the first or second button) the user clicked while choosing between skills. int[] oldFeatures = character.characterSheet.characterProgress.getCharacterClass().chosenFeatures; int[] newFeatures = new int[oldFeatures.Length + 1]; for (int n = 0; n < oldFeatures.Length; n++) { newFeatures[n] = oldFeatures[n]; } newFeatures[newFeatures.Length - 1] = levelUp.selectedFeature; character.characterSheet.characterProgress.getCharacterClass().chosenFeatures = newFeatures; character.characterSheet.characterProgress.incrementLevel(); character.saveCharacter(); assignCharacter(character); //Debug.Log("Saving Character"); }