Esempio n. 1
0
 public int AddPassiveEffects(PassiveEffect pe)
 {
     for (int i = 0; i < ElementRates.Length; i++)
     {
         ElementRates[i] += pe.ElementRates[i];
     }
     for (int i = 0; i < StateRates.Length; i++)
     {
         StateRates[i] += pe.StateRates[i];
     }
     StatModifiers.Add(pe.StatModifiers);
     SPConsumeRate   += pe.SPConsumeRate;
     ComboDifficulty += pe.ComboDifficulty;
     Counter         += pe.Counter;
     Reflect         += pe.Reflect;
     ExtraTurns      += pe.ExtraTurns;
     if (pe.DisabledToolType1 > 0)
     {
         DisabledToolTypes.Add(pe.DisabledToolType1);
     }
     if (pe.DisabledToolType2 > 0)
     {
         DisabledToolTypes.Add(pe.DisabledToolType2);
     }
     if (pe.RemoveByHit > 0)
     {
         RemoveByHit.AddRange(new int[] { pe.Id, pe.RemoveByHit });
     }
     return(pe.Id);
 }
Esempio n. 2
0
        public void Awake()
        {
            InitConfig();

            ItemStatProvider.Init();
            StatModifiers.Init();
            Hooks.Init();
        }
Esempio n. 3
0
 //恢复
 public void Recover()
 {
     LastUseSkillID = -1;
     increase = new Increase();
     StatModifiers = new StatModifiers();
     SetAbnormalStateEnum(AbnormalStateEnum.Normal);
     ClearChangeStates();
     curHealth = Health;
     InitPokemonData();
     
 }
Esempio n. 4
0
        public void Awake()
        {
            InitConfig();

            ItemCatalog.availability.CallWhenAvailable(() =>
            {
                ItemStatProvider.Init();
                StatModifiers.Init();
                Hooks.Init();
            });
        }
Esempio n. 5
0
    public void AddStatModifier(Unit.StatTypes statType, StatModifierTypes modType, int value)
    {
        if (statType == Unit.StatTypes.Default || modType == StatModifierTypes.None)
        {
            throw new Exception("Not valid stat modifier inputs");
        }

        if (StatModifiers.Any(x => x.StatType == statType))
        {
            StatModifiers.RemoveAll(x => x.StatType == statType);
        }

        StatModifiers.Add(new StatModifier()
        {
            StatType = statType, ModType = modType, Value = value
        });
    }
Esempio n. 6
0
        public int RemovePassiveEffects(PassiveEffect pe)
        {
            for (int i = 0; i < ElementRates.Length; i++)
            {
                ElementRates[i] -= pe.ElementRates[i];
            }
            for (int i = 0; i < StateRates.Length; i++)
            {
                StateRates[i] -= pe.StateRates[i];
            }
            if (pe.StatModifiers != null)
            {
                StatModifiers.Subtract(pe.StatModifiers);
            }
            SPConsumeRate   -= pe.SPConsumeRate;
            ComboDifficulty -= pe.ComboDifficulty;
            Counter         -= pe.Counter;
            Reflect         -= pe.Reflect;
            ExtraTurns      -= pe.ExtraTurns;
            bool d1 = false;
            bool d2 = false;

            for (int i = 0; i < DisabledToolTypes.Count; i += 2)
            {
                if (pe.DisabledToolType1 == DisabledToolTypes[i] && !d1)
                {
                    DisabledToolTypes.RemoveAt(i); d1 = true;
                }
                if (pe.DisabledToolType2 == DisabledToolTypes[i] && !d2)
                {
                    DisabledToolTypes.RemoveAt(i); d2 = true;
                }
            }
            List <int> rbh = RemoveByHit;

            for (int i = 0; i < rbh.Count; i += 2)
            {
                if (pe.Id == rbh[i] && pe.RemoveByHit == rbh[i + 1])
                {
                    rbh.RemoveRange(i, 2);
                }
            }
            return(pe.Id);
        }
Esempio n. 7
0
 private static void RenderStatModifiers(StatModifiers stats)
 {
     if (stats.GlobalLearningFactor.HasValue)
     {
         CONS.WriteLine($"        GlobalLearningFactor: {stats.GlobalLearningFactor.Value}");
     }
     if (stats.MentalBreakThreshold.HasValue)
     {
         CONS.WriteLine($"        MentalBreakThreshold: {stats.MentalBreakThreshold.Value}");
     }
     if (stats.MeleeHitChance.HasValue)
     {
         CONS.WriteLine($"        MeleeHitChance: {stats.MeleeHitChance.Value}");
     }
     if (stats.MoveSpeed.HasValue)
     {
         CONS.WriteLine($"        MoveSpeed: {stats.MoveSpeed.Value}");
     }
     if (stats.WorkSpeedGlobal.HasValue)
     {
         CONS.WriteLine($"        WorkSpeedGlobal: {stats.WorkSpeedGlobal.Value}");
     }
     if (stats.PsychicSensitivity.HasValue)
     {
         CONS.WriteLine($"        PsychicSensitivity: {stats.PsychicSensitivity.Value}");
     }
     if (stats.ComfyTemperatureMin.HasValue)
     {
         CONS.WriteLine($"        ComfyTemperatureMin: {stats.ComfyTemperatureMin.Value}");
     }
     if (stats.ComfyTemperatureMax.HasValue)
     {
         CONS.WriteLine($"        ComfyTemperatureMax: {stats.ComfyTemperatureMax.Value}");
     }
     if (stats.AimingDelayFactor.HasValue)
     {
         CONS.WriteLine($"        AimingDelayFactor: {stats.AimingDelayFactor.Value}");
     }
     if (stats.ShootingAccuracy.HasValue)
     {
         CONS.WriteLine($"        ShootingAccuracy: {stats.ShootingAccuracy.Value}");
     }
 }
Esempio n. 8
0
 public void RemoveStatBonus(StatBonus statBonus)
 {
     this.StatModifiers.Remove(StatModifiers.Find(x => x.BonusValue == statBonus.BonusValue));
 }
Esempio n. 9
0
 public static List <IStatModifier> GetModifiersForItemDef(ItemStatDef itemStatDef)
 {
     return(StatModifiers.GetModifiersForItemDef(itemStatDef));
 }
Esempio n. 10
0
 public static List <IStatModifier> GetModifiersForItemIndex(ItemIndex index)
 {
     return(StatModifiers.GetModifiersForItemIndex(index));
 }
Esempio n. 11
0
 public static void AddStatModifier(AbstractStatModifier modifier)
 {
     StatModifiers.AddStatModifier(modifier);
 }
Esempio n. 12
0
 public static List <IStatModifier> GetStatModifiers(this ItemStatDef statDef)
 {
     return(StatModifiers.GetModifiersForItemDef(statDef));
 }