public IActionResult LevelUp([FromBody] SkillDTO data) { // Setup var id = data.Id; var level = data.Level; var sd = data.SkillData.PowerData; var scs = new SkillCostStat(sd); if (level == 0) { level++; } sd.Level = level; sd.Tier = data.Tier; var su = data.SkillData.PowerUp; // su.CD = scs.CD; // su.Cost = scs.Cost; // su.Charges = scs.Charges; su.Level = level + 1; su.Tier = data.Tier; // Modify data.SkillData.PowerData = new DamageSkillStat(level == _MAX ? sd : su); var newUp = new DamageSkillStat(su.CalculateSkillPower(su.Level + 1).CalculateSkillCosts(su.Level + 1)); data.SkillData.PowerUp = level == _MAX ? sd : newUp; data.Level = level; return(Ok(data)); }
public SkillDamageAffixData(ISkillDamageStat sd, ISkillDamageStat su, ISkillCostStat cs = null, ISkillCostStat ucs = null) { this.PowerData = new DamageSkillStat(sd, cs); if (cs != null && ucs == null) { var dsup = (sd as DamageSkillStat).CalculateSkillCosts(sd.Level + 1); ucs = new SkillCostStat(dsup); } this.PowerUp = new DamageSkillStat(su, ucs); }
public Skill(int id, SkillDTO data, ISkillCostStat cs) { this.Id = data.Id; this.Name = data.Name; this.Description = data.Description; this.Tier = data.Tier; this.Level = data.Level; var ds = data.SkillData.PowerData; ds.Cost = cs.Cost; ds.CD = cs.CD; ds.Charges = cs.Charges; var dsUp = new DamageSkillStat(ds); dsUp.Cost = cs.Cost; dsUp.CD = cs.CD; dsUp.Charges = cs.Charges; dsUp = dsUp.CalculateSkillPower(ds.Level + 1).CalculateSkillCosts(ds.Level + 1); // var sdad = new SkillDamageAffixData(ds, dsUp, cs); data.SkillData.PowerUp = dsUp; this.Data = data; }
public SimpleSkillDamageAffixData() { this.PowerData = new DamageSkillStat(); this.PowerUp = new DamageSkillStat(); }