Пример #1
0
        public Spell_Stats(Spell_Stats ss)
        {
            this.type      = ss.type;
            this.name      = ss.name;
            this.range     = ss.range;
            this.duration  = ss.duration;
            this.cost      = ss.cost;
            this.size      = ss.size;
            this.tick      = ss.tick;
            this.speed     = ss.speed;
            this.damage    = ss.damage;
            this.id        = Guid.NewGuid();
            this.descr     = ss.descr;
            this.orig_cost = ss.orig_cost;
            Dictionary <Text, Text> items = new Dictionary <Text, Text>();

            items.Add(new Text(Vector2.Zero, "", Color.White),
                      new Text(Vector2.Zero, this.name.ToString(), Color.White));
            items.Add(new Text(Vector2.Zero, "Cost per Tick: ", Color.White),
                      new Text(Vector2.Zero, this.cost.ToString() + " (" + ((this.duration / this.tick) * cost).ToString() + " total)", Color.White));
            items.Add(new Text(Vector2.Zero, "Damage: ", Color.White), new Text(Vector2.Zero, this.damage.ToString(), Color.White));
            items.Add(new Text(Vector2.Zero, "Descr: ", Color.White), new Text(Vector2.Zero, this.descr, Color.White));

            this.info = new InfoPanel(items, null, Vector2.Zero);
        }
Пример #2
0
 public Spell(Vector2 position, Spell_Stats stats, Type_Data <SpellType> data)
     : base(position, stats.Size, data.Texture, stats.Speed, data.Animations, true)
 {
     this.stats   = stats;
     this.data    = data;
     state        = Spell_States.Alive;
     CurrentState = "Main";
 }
Пример #3
0
        public static Spell_Stats Empty()
        {
            var b = new Spell_Stats();

            b.cost     = 0;
            b.damage   = 0;
            b.duration = 0;

            return(b);
        }
Пример #4
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);
                }
            }
        }
Пример #5
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;
            }
        }
Пример #6
0
        static public Spell_Stats SetCost(Spell_Stats first, Spell_Stats second)
        {
            first.cost = second.cost;

            return(first);
        }