void AddSkillPoint(DFCareer.Skills skill, LeftRightSpinner spinner) { // Bonus point pool cannot fall below zero int workingValue = workingSkills.GetPermanentSkillValue(skill); if (spinner.Value == 0) { return; } // Remove a point from pool and assign to skill spinner.Value -= 1; workingSkills.SetPermanentSkillValue(skill, (short)(workingValue + 1)); UpdateSkillValueLabels(); }
public void Reroll() { // Set skills to all defaults startingSkills.SetDefaults(); // Roll primary skills for (int i = 0; i < DaggerfallSkills.PrimarySkillsCount; i++) { int value = minPrimarySkill + UnityEngine.Random.Range(minPrimaryBonusRoll, maxPrimaryBonusRoll + 1); startingSkills.SetPermanentSkillValue(primarySkills[i], (short)value); } // Roll major skills for (int i = 0; i < DaggerfallSkills.MajorSkillsCount; i++) { int value = minMajorSkill + UnityEngine.Random.Range(minMajorBonusRoll, maxMajorBonusRoll + 1); startingSkills.SetPermanentSkillValue(majorSkills[i], (short)value); } // Roll minor skills for (int i = 0; i < DaggerfallSkills.MinorSkillsCount; i++) { int value = minMinorSkill + UnityEngine.Random.Range(minMinorBonusRoll, maxMinorBonusRoll + 1); startingSkills.SetPermanentSkillValue(minorSkills[i], (short)value); } // Copy to working skills workingSkills.Copy(startingSkills); // Reset bonus pool values primarySkillSpinner.Value = bonusPoolPerSkillGroup; majorSkillSpinner.Value = bonusPoolPerSkillGroup; minorSkillSpinner.Value = bonusPoolPerSkillGroup; // Update value labels UpdateSkillValueLabels(); }
DaggerfallSkills ReadSkills(BinaryReader reader, out Int16[] skillUses) { DaggerfallSkills skills = new DaggerfallSkills(); skillUses = new Int16[DaggerfallSkills.Count]; for (int i = 0; i < DaggerfallSkills.Count; i++) { Int16 skillValue = reader.ReadInt16(); Int16 skillCounterValue = reader.ReadInt16(); reader.ReadInt16(); // Seems to always be 00 skills.SetPermanentSkillValue(i, skillValue); skillUses[i] = skillCounterValue; } return skills; }