コード例 #1
0
 // Token: 0x0600051A RID: 1306
 public void OnMenuItemPressed()
 {
     if (this.CurrentSkillItem == null)
     {
         return;
     }
     if (this.CurrentSkillItem.HasSkillItem)
     {
         if (this.OnAlreadyEarnedAbility)
         {
             this.RequirementsLineAShake.Restart();
             this.OnAlreadyEarnedAbility.Perform(null);
         }
         return;
     }
     if (this.CurrentSkillItem.CanEarnSkill)
     {
         this.CurrentSkillItem.HasSkillItem = true;
         Characters.Sein.PlayerAbilities.SetAbility(this.CurrentSkillItem.Ability, true);
         Characters.Sein.PlayerAbilities.GainAbilityAction = this.CurrentSkillItem.GainSkillSequence;
         InstantiateUtility.Instantiate(this.GainSkillEffect, this.CurrentSkillItem.transform.position, Quaternion.identity);
         RandomizerBonus.SpentAP(this.CurrentSkillItem.ActualRequiredSkillPoints);
         BingoController.OnGainAbility(this.CurrentSkillItem.Ability);
         Characters.Sein.Level.SkillPoints -= this.CurrentSkillItem.ActualRequiredSkillPoints;
         if (this.OnGainAbility)
         {
             this.OnGainAbility.Perform(null);
         }
         SeinLevel.HasSpentSkillPoint = true;
         AchievementsController.AwardAchievement(this.SpentFirstSkillPointAchievement);
         GameController.Instance.CreateCheckpoint();
         RandomizerStatsManager.OnSave(false);
         GameController.Instance.SaveGameController.PerformSave();
         this.UpdateRequirementsText();
         return;
     }
     if (!this.CurrentSkillItem.SoulRequirementMet)
     {
         if (this.CurrentSkillItem.RequiresAbilitiesOrItems)
         {
             this.RequirementsLineAShake.Restart();
         }
         else
         {
             this.RequirementsLineAShake.Restart();
         }
     }
     if (!this.CurrentSkillItem.AbilitiesRequirementMet)
     {
         this.RequirementsLineAShake.Restart();
     }
     if (this.OnCantEarnSkill)
     {
         this.OnCantEarnSkill.Perform(null);
     }
 }