コード例 #1
0
 private void CharsheetView_SetActiveElements(On.CharsheetView.orig_SetActiveElements orig, CharsheetView self)
 {
     orig(self);
     if (self.sheetMode == CharSheetMode.CREATION_SKILLS)
     {
         self.xpPanel.gameObject.SetActive(true);
         self.skillPointField.gameObject.SetActive(true);
         self.doneButton.gameObject.SetActive(LiteSingleton <PlayerCharacter> .Singleton.SkillPoints < 1 || NoSkillUpgradable());
     }
 }
コード例 #2
0
 private void CharsheetView_RevertAbilities(On.CharsheetView.orig_RevertAbilities orig, CharsheetView self)
 {
     for (int i = 0; i < self.character.skills.Length; i++)
     {
         var modifier = self.character.skills[i].GetModifierOfType(ModifierType.CHARACTER_CREATION);
         if (modifier != null)
         {
             modifier.Amount = 1;
         }
     }
     LiteSingleton <PlayerCharacter> .Singleton.SkillPoints = StartingSkillPoints;
     orig(self);
 }
コード例 #3
0
        private void CharsheetView_InitCharacter(On.CharsheetView.orig_InitCharacter orig, CharsheetView self, bool forceInit)
        {
            if (_startingAbilityPoints == 8)
            {
                orig(self, forceInit);
            }
            else
            {
                if (!self.IsNewCharInitialized || forceInit)
                {
                    self.character = CharacterSheetFactory.GetOrCreateComponent(SingletonComponent <World> .Singleton.you.gameObject);
                    self.character.Clean();
                    self.unusedAbilityPool = _startingAbilityPoints;
                    self.usedAbilityPoints = 0;
                    self.usedSkillPoints   = 0;
                    if (self.abilityMethod == AbilityMethod.ROLL)
                    {
                        int allowedTotal = self.unusedAbilityPool + 4;
                        CharacterSheetFactory.RollAbilities(self.character, allowedTotal);
                        self.usedAbilityPoints = self.unusedAbilityPool;
                        self.unusedAbilityPool = 0;
                    }
                    else if (self.abilityMethod == AbilityMethod.POINTBUY)
                    {
                        CharacterSheetFactory.CleanAbilities(self.character);
                    }
                    else
                    {
                        Debug.LogError("We only roll for now");
                    }
                    SkillPortraitPanel.signatureSkill = SkillType.NONE;
                    self.character.Recalc();
                    self.NotifyActivation();
                    self.GetType().GetProperty("IsNewCharInitialized").GetSetMethod(true).Invoke(self, new object[] { true });
                }
            }

            LiteSingleton <PlayerCharacter> .Singleton.SkillPoints = StartingSkillPoints;
        }
コード例 #4
0
 private void CharsheetView_LevelingComplete(On.CharsheetView.orig_LevelingComplete orig, CharsheetView self)
 {
     if (self.sheetMode == CharSheetMode.CREATION_SKILLS)
     {
         var hasSavePointProperty = self.GetType().GetProperty("HasSavepoint");
         hasSavePointProperty.GetSetMethod(true).Invoke(self, new object[] { false });
     }
     orig(self);
     if (self.sheetMode == CharSheetMode.CREATION_SKILLS)
     {
         self.NotifyActivation();
     }
 }