Beispiel #1
0
        public void Apply(AttributeLevels levels)
        {
            Attributes attributes = levels.GetAttributes();

            if (modifier != null)
            {
                attributes.Remove(modifier);
                modifier = null;
            }
            modifier = new AttributeModifier(attribute.Id, (float)GetLevel(), DUPLICANTS.MODIFIERS.SKILLLEVEL.NAME, false, false, true);
            attributes.Add(modifier);
        }
Beispiel #2
0
 public bool AddExperience(AttributeLevels levels, float experience)
 {
     if (level >= DUPLICANTSTATS.ATTRIBUTE_LEVELING.MAX_GAINED_ATTRIBUTE_LEVEL)
     {
         return(false);
     }
     this.experience += experience;
     this.experience  = Mathf.Max(0f, this.experience);
     if (this.experience >= GetExperienceForNextLevel())
     {
         LevelUp(levels);
         return(true);
     }
     return(false);
 }
Beispiel #3
0
 public void LevelUp(AttributeLevels levels)
 {
     level++;
     experience = 0f;
     Apply(levels);
     experience = 0f;
     if ((UnityEngine.Object)PopFXManager.Instance != (UnityEngine.Object)null)
     {
         PopFXManager.Instance.SpawnFX(PopFXManager.Instance.sprite_Plus, attribute.modifier.Name, levels.transform, new Vector3(0f, 0.5f, 0f), 1.5f, false, false);
     }
     levels.GetComponent <Notifier>().Add(notification, string.Format(MISC.NOTIFICATIONS.LEVELUP.SUFFIX, attribute.modifier.Name, level));
     StateMachine.Instance instance = new UpgradeFX.Instance(levels.GetComponent <KMonoBehaviour>(), new Vector3(0f, 0f, -0.1f));
     ReportManager.Instance.ReportValue(ReportManager.ReportType.LevelUp, 1f, levels.GetProperName(), null);
     instance.StartSM();
     levels.Trigger(-110704193, attribute.Id);
 }