Ejemplo n.º 1
0
        public void RefreshData(bool statChange, Overseer os = null)
        {
            SpellType[] sts = new SpellType[] { SpellType.Ressurect, SpellType.DrainEssence, SpellType.DeadAgain, SpellType.RestoreEssence, SpellType.ClearDead };

            foreach (SpellType st in sts)
            {
                spell_data[st] = new Spell_Stats(spell_data[st]);
                spell_data[st].Info.Picture = spell_types[st].Texture;

                if (statChange && st != SpellType.ClearDead)
                {
                    var uspell = new Spell_Stats(spell_data[st]);
                    var nspell = Spell_Stats.Empty();
                    nspell.Cost    = spell_data[st].OriginalCost + (float)((os.Zombies.Count * (spell_data[st].OriginalCost * 0.05)));
                    uspell         = Spell_Stats.SetCost(uspell, nspell);
                    spell_data[st] = new Spell_Stats(uspell);
                }
            }
        }
Ejemplo n.º 2
0
        void ApplyStat(SpellType st, Researchables stat, float percent)
        {
            var temp_stat = Spell_Stats.Empty();

            switch (stat)
            {
            case Researchables.SPower:
                var mod = Extensions.Extensions.PercentT(spell_data[st].Damage, percent);
                temp_stat.Damage += mod;
                spell_data[st]   += temp_stat;
                break;

            case Researchables.SCost:
                temp_stat.Cost += Extensions.Extensions.PercentT(spell_data[st].Cost, percent);
                spell_data[st] -= temp_stat;
                break;

            case Researchables.SLength:
                temp_stat.Duration += (int)Extensions.Extensions.PercentT(spell_data[st].Duration, percent);
                spell_data[st]     += temp_stat;
                break;
            }
        }