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); }
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"; }
public static Spell_Stats Empty() { var b = new Spell_Stats(); b.cost = 0; b.damage = 0; b.duration = 0; return(b); }
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); } } }
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; } }
static public Spell_Stats SetCost(Spell_Stats first, Spell_Stats second) { first.cost = second.cost; return(first); }