public ActionResult SaveEdiEditDPS(DPS m, List <int> userType, string areaNums) { var areaList = areaNums.Split(',').ToList(); var loginUser = (UserInfo)ViewBag.User; Guid managerId = (Guid)ViewBag.ManagerId; m.CreateTime = DateTime.Now; m.CreateUserId = managerId; var goodsItem = _good.GetGoodsByNum(m.GoodsNum, managerId); var sendGoodsItem = _good.GetGoodsByNum(m.SendGoodsNum, managerId); if (goodsItem != null) { m.GoodsId = goodsItem.Id; m.GoodsName = goodsItem.GoodsTittle; } if (sendGoodsItem != null) { m.SendGoodsId = sendGoodsItem.Id; m.SendGoodsName = sendGoodsItem.GoodsTittle; } string userTypes = ""; userType.ForEach(x => { userTypes += x; userTypes += ","; }); m.UserTypes = userTypes; _active.SaveDPS(m, areaList); Response.Redirect("DPSList"); return(View()); }
public LM(string craftDirectory, DVector2 position, DVector2 velocity, double propellantMass = 10920) : base(craftDirectory, position, velocity, 0, propellantMass, "Saturn/LM.png") { StageOffset = new DVector2(0, 10); Engines = new IEngine[1]; var offset = new DVector2(0.0, Height * 0.48); Engines[0] = new DPS(0, this, offset); }
public override void Trigger(Unit target) { // Downcast to DPS DPS dpsCaster = caster.GetComponent <DPS>(); Error.DebugAssert(ref dpsCaster, "Attack spell called from non-DPS class"); // Target will receive damage from the dps caster target.ReceiveDamage(dpsCaster.GetDamage()); }
private static void TakeInfoForPartAndPerson(GERB gerbb, BSP bspp, DPS dpss, KauzaRz kauzaa, Free freee, ReformBlog reformBlogg, string[] toName, Dictionary <string, List <string> > delegateByPoliticians, int person) { if (gerbb.ListCol().Contains(toName[person])) { if (!delegateByPoliticians.ContainsKey("ГЕРБ")) { delegateByPoliticians.Add("ГЕРБ", new List <string>()); } delegateByPoliticians["ГЕРБ"].Add(toName[person]); } else if (dpss.ListCol().Contains(toName[person])) { if (!delegateByPoliticians.ContainsKey("Движение за права и свободи")) { delegateByPoliticians.Add("Движение за права и свободи", new List <string>()); } delegateByPoliticians["Движение за права и свободи"].Add(toName[person]); } else if (bspp.ListCol().Contains(toName[person])) { if (!delegateByPoliticians.ContainsKey("Българска социалистическа партия")) { delegateByPoliticians.Add("Българска социалистическа партия", new List <string>()); } delegateByPoliticians["Българска социалистическа партия"].Add(toName[person]); } else if (reformBlogg.ListCol().Contains(toName[person])) { if (!delegateByPoliticians.ContainsKey("Реформаторски блок")) { delegateByPoliticians.Add("Реформаторски блок", new List <string>()); } delegateByPoliticians["Реформаторски блок"].Add(toName[person]); } else if (kauzaa.ListCol().Contains(toName[person])) { if (!delegateByPoliticians.ContainsKey("Кауза Разград")) { delegateByPoliticians.Add("Кауза Разград", new List <string>()); } delegateByPoliticians["Кауза Разград"].Add(toName[person]); } else if (freee.ListCol().Contains(toName[person])) { if (!delegateByPoliticians.ContainsKey("Независим общински съветник")) { delegateByPoliticians.Add("Независим общински съветник", new List <string>()); } delegateByPoliticians["Независим общински съветник"].Add(toName[person]); } }
public Dictionary <string, string> PersonalInfo() { var temp = new Dictionary <string, string>(); DPS n = new DPS(); var listCouncils = n.ListCol(); temp.Add(listCouncils[0], fileWorkedPlace[0]); temp.Add(listCouncils[1], fileWorkedPlace[1]); temp.Add(listCouncils[2], fileWorkedPlace[2]); temp.Add(listCouncils[3], fileWorkedPlace[3]); temp.Add(listCouncils[4], fileWorkedPlace[4]); temp.Add(listCouncils[5], fileWorkedPlace[5]); return(temp); }
protected override void OnTriggerEnter2D(Collider2D other) { base.OnTriggerEnter2D(other); //string otherType = other.gameObject.GetType().ToString(); //Debug.Log(otherType); DPS dps = other.gameObject.GetComponent <DPS>(); if (dps != null) { dps.SetCurrentAmmo(ammo); dps.EquipGun(rifleAbility); } else { } }
void BasicCombat() { // DPS stage // Boss applies AoE damage within 5-20 to the dps and healer players boss.ApplyAoE(nonTanks); totalDamageDoneToParty += boss.GetLastAoEDealt(); // log aoe damage dealt to players // Boss deals regular damage within 45-55 to the tank boss.AttackTarget(warrior); totalDamageDoneToParty += boss.GetLastDamageDealt(); // log damage dealt to tank foreach (Unit player in players) { // DPS players and tank all damage boss if (player.CanAttack()) { DPS dps = player.GetComponent <DPS>(); dps.AttackTarget(boss); totalDamageDoneToBoss += dps.GetLastDamageDealt(); // log damage dealt to boss } } // Healing stage { Healer priestHealer = priest.GetComponent <Healer>(); // Cast BigHeal on the tank priestHealer.BigHeal(warrior); float rand = Random.value; if (rand <= 0.2) // priest has 20% chance of casting small heal on itself { priestHealer.SmallHeal(priest); } else if (rand <= 0.3) // priest has 10% chance of casting small heal on others { // Randomly select non-tank player int index = Random.Range(0, 4); // Then cast small heal on them priestHealer.SmallHeal(nonTanks[index]); } } // The priest regenerates 2 mana per second priest.RegenerateMana(2); }
/// <summary> /// 创建单品送 /// </summary> /// <param name="model"></param> /// <param name="areNum"></param> /// <returns></returns> public ResponseModel CreateDPS(DPS model, List <string> areNum) { List <ManToArea> list = new List <ManToArea>(); areNum.ForEach(x => { var area = _context.Areas.FirstOrDefault(c => c.Num == x); if (area != null) { var newArea = new ManToArea(); newArea.ActiveId = model.Id; newArea.ActiveName = string.Empty; newArea.AreaNum = area.Num; newArea.AreaName = area.Name; list.Add(newArea); } }); _context.ManToAreas.AddRange(list); _context.DPSes.Add(model); _response.Stutas = _context.SaveChanges() > 0; return(_response); }
public ResponseModel SaveDPS(DPS model, List <string> areNum) { List <ManToArea> list = new List <ManToArea>(); var areaHis = _context.ManToAreas.Where(x => x.ActiveId == model.Id); areNum.ForEach(x => { var area = _context.Areas.FirstOrDefault(c => c.Num == x); if (area != null) { var newArea = new ManToArea(); newArea.ActiveId = model.Id; newArea.ActiveName = model.GoodsName; newArea.AreaNum = area.Num; newArea.AreaName = area.Name; list.Add(newArea); } }); var modelHis = _context.DPSes.FirstOrDefault(x => x.Id == model.Id); modelHis.StartTime = model.StartTime; modelHis.EndTime = model.EndTime; modelHis.GoodsId = model.GoodsId; modelHis.GoodsName = model.GoodsName; modelHis.GoodsNum = model.GoodsNum; modelHis.SendGoodsId = model.SendGoodsId; modelHis.SendGoodsNum = model.SendGoodsNum; modelHis.SendGoodsName = model.SendGoodsName; modelHis.Count = model.Count; modelHis.SendCount = model.SendCount; modelHis.IsOnly = model.IsOnly; modelHis.IsRepeat = model.IsRepeat; modelHis.UserTypes = model.UserTypes; _context.ManToAreas.RemoveRange(areaHis); _context.ManToAreas.AddRange(list); _response.Stutas = _context.SaveChanges() > 0; return(_response); }
public void AddHit(LogHitEvent hit, int interval = -1) { if (FirstAction == null) { FirstAction = hit.Timestamp; } LastAction = hit.Timestamp; if (hit.Source == Name) { OutboundHitCount += 1; OutboundHitSum += hit.Amount; if (hit.Spell != null) { //OutboundSpellCount += 1; //OutboundSpellSum += hit.Amount; var spell = AddSpell(hit.Spell, "hit"); spell.HitCount += 1; spell.HitSum += hit.Amount; if (hit.Amount > spell.HitMax) { spell.HitMax = hit.Amount; } if (hit.Mod.HasFlag(LogEventMod.Critical)) { spell.CritCount += 1; spell.CritSum += hit.Amount; } if (hit.Mod.HasFlag(LogEventMod.Twincast)) { spell.TwinCount += 1; //spell.TwinSum += hit.Amount; } } else { //if (hit.Amount > OutboundMaxHit) //{ // OutboundMaxHit = hit.Amount; //} //OutboundMeleeCount += 1; //OutboundMeleeSum += hit.Amount; } var type = hit.Type; // alter the attack type on some special hits if (hit.Mod.HasFlag(LogEventMod.Finishing_Blow)) { type = "finishing"; } else if (hit.Mod.HasFlag(LogEventMod.Headshot)) { type = "headshot"; } else if (hit.Mod.HasFlag(LogEventMod.Assassinate)) { type = "assassinate"; } else if (hit.Mod.HasFlag(LogEventMod.Decapitate)) { type = "decapitate"; } else if (hit.Mod.HasFlag(LogEventMod.Slay_Undead)) { type = "slay"; } //else if (hit.Mod.HasFlag(LogEventMod.Special)) // type += ":special"; else if (hit.Mod.HasFlag(LogEventMod.Riposte)) { type = "riposte"; } var at = AddAttack(type); at.HitCount += 1; at.HitSum += hit.Amount; if (hit.Amount > at.HitMax) { at.HitMax = hit.Amount; } if (hit.Mod.HasFlag(LogEventMod.Critical)) { at.CritCount += 1; at.CritSum += hit.Amount; } if (hit.Mod.HasFlag(LogEventMod.Strikethrough)) { OutboundStrikeCount += 1; } if (interval >= 0) { while (DPS.Count <= interval) { DPS.Add(0); } DPS[interval] += hit.Amount; } } else if (hit.Target == Name) { InboundHitCount += 1; InboundHitSum += hit.Amount; if (hit.Spell != null) { //InboundSpellSum += hit.Amount; } else { InboundMeleeCount += 1; InboundMeleeSum += hit.Amount; if (interval >= 0) { while (TankDPS.Count <= interval) { TankDPS.Add(0); } TankDPS[interval] += hit.Amount; } //TankHits.TryGetValue(hit.Amount, out int count); //TankHits[hit.Amount] = count + 1; } if (hit.Mod.HasFlag(LogEventMod.Riposte)) { InboundRiposteSum += hit.Amount; } if (hit.Mod.HasFlag(LogEventMod.Strikethrough)) { InboundStrikeCount += 1; // strikethroughs are reported on hits and riposte, but other defenses do get not reported on a strikethrough // in order to properly count these defenses we should log a mystery defense that was never reported // i.e. for riposte the log will show this: // [Wed Jan 19 20:54:58 2022] A shadowbone tries to bash YOU, but YOU riposte!(Strikethrough) // [Wed Jan 19 20:54:58 2022] A shadowbone bashes YOU for 5625 points of damage. (Riposte Strikethrough) // but for dodge/parry/etc.. it will only show this: // [Wed Jan 19 20:54:58 2022] A shadowbone bashes YOU for 5625 points of damage. (Strikethrough) if (!hit.Mod.HasFlag(LogEventMod.Riposte)) { AddMiss(new LogMissEvent { Timestamp = hit.Timestamp, Source = hit.Source, Target = hit.Target, Type = "unknown" }); } } } }
private List <DPS> BuscarDPS(int codigoProduto, int cdconseg, Emissao emissao) { var lista = new List <DPS>(); using (var db = new SqlConnection(ConfigurationManager.ConnectionStrings["kitDigitalJson"].ConnectionString)) { var listaOrdemPerguntaDps = db.Query <OrdemPerguntaDps>("PR_BuscarOrdemPerguntaDpsKitDigital", new { codigoProduto = codigoProduto, dtcotpps = emissao.dtcotpps }, commandType: CommandType.StoredProcedure).ToList(); if (listaOrdemPerguntaDps.Count() > 0) { var listaResposta = db.Query <PerguntaRespostaDPS>("PR_BuscarPerguntaRespostaDpsKitDigital", new { codigoProduto = codigoProduto, dtcotpps = emissao.dtcotpps, cdconseg = cdconseg, cdemi = emissao.cdemi }, commandType: CommandType.StoredProcedure).ToList(); var listaPrincipal = listaOrdemPerguntaDps.Where(x => x.tipoSegurado.Equals("P")).OrderBy(x => x.numeroPergunta).ToList(); var listaConjuge = listaOrdemPerguntaDps.Where(x => x.tipoSegurado.Equals("C")).OrderBy(x => x.numeroPergunta).ToList(); if (listaPrincipal.Count() > 0) { DPS dps = new DPS(); if (listaResposta.Count() > 0) { dps.perguntaRespostaDPS = new List <PerguntaRespostaDPS>(); foreach (var i in listaPrincipal) { PerguntaRespostaDPS perguntaRespostaDPS = listaResposta.Where(x => x.codigoPergunta == i.codigoPergunta).Select(x => new PerguntaRespostaDPS() { resposta = x.resposta.TrimEnd(), codigoPergunta = i.numeroPergunta }).FirstOrDefault(); if (perguntaRespostaDPS != null) { dps.tipoSegurado = "Principal"; dps.perguntaRespostaDPS.Add(perguntaRespostaDPS); } } } lista.Add(dps); } //Verifica se o Titular tem Conjuge, senão não vem DPS if (VerificaExisteConjuge(cdconseg, emissao.cdemi) > 0) { if (listaConjuge.Count() > 0) { DPS dps = new DPS(); if (listaResposta.Count() > 0) { dps.perguntaRespostaDPS = new List <PerguntaRespostaDPS>(); foreach (var i in listaConjuge) { PerguntaRespostaDPS perguntaRespostaDPS = listaResposta.Where(x => x.codigoPergunta == i.codigoPergunta).Select(x => new PerguntaRespostaDPS() { resposta = x.resposta.TrimEnd(), codigoPergunta = i.numeroPergunta }).FirstOrDefault(); if (perguntaRespostaDPS != null) { dps.tipoSegurado = "Cônjuge"; dps.perguntaRespostaDPS.Add(perguntaRespostaDPS); } } } lista.Add(dps); } } } } return(lista); }
public override Dictionary <string, string> GetCharacterDisplayCalculationValues() { Dictionary <string, string> dict = new Dictionary <string, string>(); dict["Miss"] = Miss.ToString("P2") + "*" + SEStats.Miss.ToString("P2") + " after special effects"; dict["Dodge"] = Dodge.ToString("P2") + " : " + BasicStats.DodgeRating.ToString("F0") + "*" + SEStats.DodgeRating.ToString("F0") + " Rating - " + SEStats.Dodge.ToString("P2") + " after special effects"; dict["Parry"] = Parry.ToString("P2") + " : " + BasicStats.ParryRating.ToString("F0") + "*" + SEStats.ParryRating.ToString("F0") + " Rating - " + SEStats.Parry.ToString("P2") + " after special effects"; dict["Armor Damage Reduction"] = ArmorDamageReduction.ToString("P2"); dict["Magic Damage Reduction"] = MagicDamageReduction.ToString("P2") + string.Format("*Arcane: {0:0}\r\n", BasicStats.ArcaneResistance) + string.Format("Fire: {0:0}\r\n", BasicStats.FireResistance) + string.Format("Frost: {0:0}\r\n", BasicStats.FrostResistance) + string.Format("Nature: {0:0}\r\n", BasicStats.NatureResistance) + string.Format("Shadow: {0:0}", BasicStats.ShadowResistance); dict["Total Avoidance"] = (Miss + Parry + Dodge).ToString("P2"); // Another duplicate math location. dict["Health"] = BasicStats.Health.ToString("F0") + "*" + SEStats.Health.ToString("F0") + " after special effects"; dict["Armor"] = BasicStats.Armor.ToString("F0") + "*" + SEStats.Armor.ToString("F0") + " after special effects"; dict["Strength"] = BasicStats.Strength.ToString("F0") + "*" + SEStats.Strength.ToString("F0") + " after special effects"; dict["Agility"] = BasicStats.Agility.ToString("F0") + "*" + SEStats.Agility.ToString("F0") + " after special effects"; dict["Stamina"] = BasicStats.Stamina.ToString("F0") + "*" + SEStats.Stamina.ToString("F0") + " after special effects"; dict["Hit Rating"] = BasicStats.HitRating.ToString("F0") + "*" + SEStats.HitRating.ToString("F0") + " after special effects"; dict["Haste Rating"] = BasicStats.HasteRating.ToString("F0") + "*" + SEStats.HasteRating.ToString("F0") + " after special effects"; dict["Crit Rating"] = BasicStats.CritRating.ToString("F0") + "*" + SEStats.CritRating.ToString("F0") + " after special effects"; dict["Physical Crit"] = BasicStats.PhysicalCrit.ToString("P2") + "*" + SEStats.PhysicalCrit.ToString("F0") + " after special effects"; dict["Expertise"] = Expertise.ToString("F0") + "*" + SEStats.Expertise.ToString("F0") + " after special effects"; dict["Attack Power"] = BasicStats.AttackPower.ToString("F0") + "*" + SEStats.AttackPower.ToString("F0") + " after special effects including Vengeance"; dict["Mastery"] = BasicStats.Mastery.ToString("F2") + String.Format(" ({0:0.00} %)*", (BasicStats.Mastery * 6.25f)) + BasicStats.MasteryRating.ToString("F0") + " Rating - " + SEStats.MasteryRating.ToString("F0") + " after special effects"; dict["DPS"] = DPS.ToString("F0") + "* At Max Vengeance"; dict["Rotation Time"] = String.Format("{0:0.00} sec", RotationTime); dict["Total Threat"] = TotalThreat.ToString("F0"); #region Ability Costs dict["Blood"] = Blood.ToString("F0"); dict["Frost"] = Frost.ToString("F0"); dict["Unholy"] = Unholy.ToString("F0"); dict["Death"] = Death.ToString("F0"); dict["Runic Power"] = RP.ToString("F0"); dict["RE Runes"] = FreeRERunes.ToString("F0"); #endregion dict["Overall Points"] = OverallPoints.ToString("F1"); dict["Mitigation Points"] = String.Format("{0:0.0}*" + "{1:000000.0} Crit Mitigation" + "\r\n{2:000000.0} Avoidance Mitigation" + "\r\n{3:000000.0} Armor Mitigation" + "\r\n{4:000000.0} Damage Taken Mitigation" + "\r\n{5:000000.0} Impedence Mitigation" + "\r\n{6:000000.0} Health Restoration Mitigation", Mitigation, CritMitigation, AvoidanceMitigation, ArmorMitigation, DamageTakenMitigation, ImpedenceMitigation, HealsMitigation); dict["Survival Points"] = String.Format("{0:0.0}*" + "{1:000000.0} Physical Survival" + "\r\n{2:000000.0} Bleed Survival" + "\r\n{3:000000.0} Magic Survival", Survivability, PhysicalSurvival, BleedSurvival, MagicSurvival); dict["Burst Points"] = String.Format("{0:0.0}", Burst * BurstWeight); // Modified Burst dict["Recovery Points"] = String.Format("{0:0.0}", Recovery * RecoveryWeight); // Modified Burst dict["Threat Points"] = String.Format("{0:0.0}", Threat * ThreatWeight); // Modified Threat dict["Target Miss"] = (TargetMiss).ToString("P1"); dict["Target Dodge"] = (TargetDodge).ToString("P1"); dict["Target Parry"] = (TargetParry).ToString("P1"); dict["DTPS"] = DTPS.ToString("F2"); dict["HPS"] = HPS.ToString("F2"); dict["DPS Avoided"] = AvoidanceMitigation.ToString("F0"); dict["DPS Reduced By Armor"] = ArmorMitigation.ToString("F0"); dict["Death Strike"] = TotalDShealed.ToString("F0") + "*" + DSCount.ToString("F0") + " Death Strikes Healing for " + DSHeal.ToString("F0") + " avg " + DSOverHeal.ToString("F0") + " avg Overheal"; dict["Blood Shield"] = TotalBShield.ToString("F0") + "*" + BShield.ToString("F0") + " average shield size"; return(dict); }
static void Main(string[] args) { politicanGroup.Add("ГЕРБ"); politicanGroup.Add("БСП"); politicanGroup.Add("ДПС"); politicanGroup.Add("Реформаторкси блоk"); politicanGroup.Add("Кауза Разград"); politicanGroup.Add("Независими съветници"); // GERB gerbb = new GERB(); BSP bspp = new BSP(); DPS dpss = new DPS(); KauzaRz kauzaa = new KauzaRz(); Free freee = new Free(); ReformBlog reformBlogg = new ReformBlog(); // Labelnfo1(); var enter = Console.ReadLine(); if (enter == "0") { PrintInfoForProgram(); var allCouncilMan = gerbb.ListCol().Concat(bspp.ListCol().Concat(dpss.ListCol().Concat(kauzaa.ListCol().Concat(freee.ListCol().Concat(reformBlogg.ListCol()))))); string[] allCouncilArr = allCouncilMan.ToArray(); // string[] toName = allCouncilArr; List <string> take = toName.ToList(); // var gerb = gerbb.ListCol(); var bsp = bspp.ListCol(); var dps = dpss.ListCol(); var reforma = reformBlogg.ListCol(); var nezavisim = freee.ListCol(); var kauza = kauzaa.ListCol(); byte count = 0; //Kvorum => string za potvyrjdenie => Tuk for (int person = 0; person < all; person++) { Console.Write(toName[person] + " => "); var checking = Console.ReadLine(); Console.WriteLine(checking); File.AppendAllText(path, "Кворум:"); if (checking == "tuk") { count++; kvorum.Add($"{toName[person]}"); File.AppendAllText(path, toName[person]); take.Remove(toName[person]); GetValueOfCalculate(toName, gerb, person, gerbB); GetValueOfCalculate(toName, bsp, person, bspB); GetValueOfCalculate(toName, dps, person, dpsB); GetValueOfCalculate(toName, reforma, person, reformB); GetValueOfCalculate(toName, nezavisim, person, freeB); GetValueOfCalculate(toName, kauza, person, kauzaB); } } var result = kvorum.Count >= 16 ? "Има кворум" : $"Няма кворум, нужни са още/поне {16 - kvorum.Count} гласа!"; File.AppendAllText(path, result); Console.WriteLine(label); Console.WriteLine("Присъстват по партийни групи:"); File.AppendAllText(path, "Присъстват по партийни групи:"); var message = "Няма регистрирани съветници"; Console.WriteLine(politicanGroup[0]); Console.WriteLine(gerbB.Count > 0? string.Join("=>\n", gerbB):message); Console.WriteLine(politicanGroup[1]); Console.WriteLine(bspB.Count > 0? string.Join("=>\n", bspB):message); Console.WriteLine(politicanGroup[2]); Console.WriteLine(dpsB.Count > 0? string.Join("=>\n", dpsB): message); Console.WriteLine(politicanGroup[3]); Console.WriteLine(reformB.Count > 0? string.Join("=>\n", reformB):message); Console.WriteLine(politicanGroup[4]); Console.WriteLine(kauzaB.Count > 0? string.Join("=>\n", kauzaB):message); Console.WriteLine(politicanGroup[5]); Console.WriteLine(freeB.Count > 0? string.Join("=>\n", freeB):message); Console.WriteLine(label); Console.WriteLine($"Гласували общо: {count}"); File.AppendAllText(path, $"Гласували общо: {count}" + "\n"); Console.WriteLine($"{result}"); File.AppendAllText(path, $"{result}" + "\n"); Console.WriteLine($"Присъстват следните съветници: " + kvorum.Count + " => Общ брой на регистрираните"); for (int i = 0; i < kvorum.Count; i++) { Console.WriteLine($"{i} => {kvorum[i]}"); } File.AppendAllText(path, $"Присъстват следните съветници => \n" + string.Join($"\n=>", kvorum)); Console.WriteLine($"Отсъстват следните съветници => " + take.Count + " => Общ брой на отсъстващите"); File.AppendAllText(path, $"Отсъстват следните съветници => " + take.Count); for (int i = 0; i < take.Count; i++) { Console.WriteLine($"{i} => {take[i]}"); File.AppendAllText(path, $"{i} => {take[i]}" + "\n"); } Console.WriteLine(label); Dictionary <byte, string> positive = new Dictionary <byte, string>(); Dictionary <byte, string> negative = new Dictionary <byte, string>(); Dictionary <byte, string> neutral = new Dictionary <byte, string>(); byte a = 1; byte b = 1; byte c = 1;; if (kvorum.Count > 16) { Console.WriteLine("Заседанието има кворум и докладните могат да се гласуват!"); File.AppendAllText(path, "Заседанието има кворум и докладните могат да се гласуват!" + "\n"); //работи се с лист от кворума => приема се до доказване на противното, //че за да се приеме докладна трябва да има >50% от гласовете на делегатите. Console.WriteLine("Желате ли да започнете гласуването? Yes/No" + $"\nИмате кворум от => {kvorum.Count} делегата!"); File.AppendAllText(path, "Желате ли да започнете гласуването? Yes/No" + $"\nИмате кворум от => {kvorum.Count} делегата!" + "\n"); var askAction = Console.ReadLine(); var gerbCountN = new byte[3] { 0, 0, 0 }; var bspCountN = new byte[3] { 0, 0, 0 }; var dpsCountN = new byte[3] { 0, 0, 0 }; var reformaCountN = new byte[3] { 0, 0, 0 }; var kauzaCountN = new byte[3] { 0, 0, 0 }; var freeCountN = new byte[3] { 0, 0, 0 }; while (askAction != "No") { Documents doc = new Documents(); doc.Count(); var pcDoc = doc.Counter(); while (pcDoc > 0) { Console.WriteLine("Doklad => " + pcDoc); for (int i = 0; i < kvorum.Count; i++) { Console.Write(kvorum[i] + " => "); var voting = Console.ReadLine(); Console.WriteLine(voting); byte n = 0; if (voting == "z") { positive.Add(a, kvorum[i]); GetV(kvorum, gerb, gerbCountN, i); GetV(kvorum, bsp, bspCountN, i); GetV(kvorum, dps, dpsCountN, i); GetV(kvorum, reforma, reformaCountN, i); GetV(kvorum, nezavisim, freeCountN, i); GetV(kvorum, kauza, kauzaCountN, i); a++; } if (voting == "p") { negative.Add(b, kvorum[i]); GetV2(kvorum, gerb, gerbCountN, i); GetV2(kvorum, bsp, bspCountN, i); GetV2(kvorum, dps, dpsCountN, i); GetV2(kvorum, nezavisim, freeCountN, i); GetV2(kvorum, reforma, reformaCountN, i); GetV2(kvorum, kauza, kauzaCountN, i); b++; } if (voting == "v") { neutral.Add(c, kvorum[i]); GetV3(kvorum, gerb, gerbCountN, i); GetV3(kvorum, bsp, bspCountN, i); GetV3(kvorum, dps, dpsCountN, i); GetV3(kvorum, nezavisim, freeCountN, i); GetV3(kvorum, reforma, reformaCountN, i); GetV3(kvorum, kauza, kauzaCountN, i); c++; } else { continue; } } Console.WriteLine(label); Console.WriteLine("Резултат от гласуването =>"); Console.WriteLine("За"); File.AppendAllText(path, "За" + "\n"); if (positive.Count() != 0) { foreach (var za in positive) { Console.Write($"{za.Key} => "); foreach (var item in za.Value) { Console.Write($"{item}"); File.AppendAllText(path, $"{item}"); } Console.WriteLine(); } } else { Console.Write(" => " + 0); } Console.WriteLine("Против"); File.AppendAllText(path, "Против" + "\n"); if (negative.Count() != 0) { foreach (var protiv in negative) { Console.Write($"{protiv.Key} => "); foreach (var item in protiv.Value) { Console.Write(item); File.AppendAllText(path, item.ToString()); } Console.WriteLine(); } } else { Console.Write(" => " + 0); } Console.WriteLine("Въздържал се"); File.AppendAllText(path, "Въздържал се" + "\n"); if (neutral.Count() != 0) { foreach (var pass in neutral) { Console.Write($"{pass.Key} => "); foreach (var item in pass.Value) { Console.Write(item); File.AppendAllText(path, item.ToString()); } Console.WriteLine(); } } else { Console.Write(" => " + 0); } Console.WriteLine(label); var isOk = positive.Count() > kvorum.Count / 2; var p = positive.Count() == 0 ? 0 : positive.Count(); var nega = negative.Count() == 0 ? 0 : negative.Count(); var neutr = neutral.Count() == 0 ? 0 : neutral.Count(); Console.WriteLine(label); if (isOk) { Console.WriteLine("Докладната се приема!"); File.AppendAllText(path, "Докладната се приема!"); VotingRezult(p, nega, neutr); } else { Console.WriteLine("Докладната се отхвърля!"); File.AppendAllText(path, "Докладната се отхвърля!\n"); VotingRezult(p, nega, neutr); } Console.WriteLine(label); Console.WriteLine("По политически групи:"); File.AppendAllText(path, "По политически групи:\n"); Console.WriteLine(label); Console.WriteLine("За"); File.AppendAllText(path, "За\n"); Print(gerbCountN[0], bspCountN[0], dpsCountN[0], reformaCountN[0], kauzaCountN[0], freeCountN[0]); AddToArchive(gerbCountN[0], bspCountN[0], dpsCountN[0], reformaCountN[0], kauzaCountN[0], freeCountN[0]); // Console.WriteLine("Против"); File.AppendAllText(path, "Против"); Print(gerbCountN[1], bspCountN[1], dpsCountN[1], reformaCountN[1], kauzaCountN[1], freeCountN[1]); AddToArchive(gerbCountN[1], bspCountN[1], dpsCountN[1], reformaCountN[1], kauzaCountN[1], freeCountN[1]); // Console.WriteLine("Въздържал се:"); File.AppendAllText(path, "Въздържал се:"); Print(gerbCountN[2], bspCountN[2], dpsCountN[2], reformaCountN[2], kauzaCountN[2], freeCountN[2]); AddToArchive(gerbCountN[2], bspCountN[2], dpsCountN[2], reformaCountN[2], kauzaCountN[2], freeCountN[2]); Console.WriteLine(label); File.AppendAllText(path, DateTime.Now.ToString() + "\n"); Console.ReadKey(); Console.WriteLine("Желате ли да започнете ново гласуване ? Yes/No"); //зануляване на стойностите. positive.Clear(); neutral.Clear(); negative.Clear(); for (int i = 0; i < gerbCountN.Length; i++) { gerbCountN[i] = 0; } for (int i = 0; i < bspCountN.Length; i++) { bspCountN[i] = 0; } for (int i = 0; i < dpsCountN.Length; i++) { dpsCountN[i] = 0; } for (int i = 0; i < reformaCountN.Length; i++) { reformaCountN[i] = 0; } for (int i = 0; i < kauzaCountN.Length; i++) { kauzaCountN[i] = 0; } for (int i = 0; i < freeCountN.Length; i++) { freeCountN[i] = 0; } askAction = Console.ReadLine(); pcDoc--; if (pcDoc <= 0) { Console.WriteLine("Документите свършиха!"); return; } } } } Console.ReadKey(); } if (enter == "1") { PrintAddInfoForProgram(); } if (enter == "2") { Console.WriteLine(text); Console.WriteLine(string.Join("\n", politicanGroup)); var input = Console.ReadLine(); if (input == politicanGroup[0]) { GERB personal = new GERB(); var infoToChoose = personal.PersonalInfo(); Console.WriteLine(text1); Console.WriteLine(string.Join("\n", infoToChoose.Keys)); GetPersonalInfo(infoToChoose); return; } if (input == politicanGroup[1]) { BSP personal = new BSP(); var infoToChoose = personal.PersonalInfo(); Console.WriteLine(text1); Console.WriteLine(string.Join("\n", infoToChoose.Keys)); GetPersonalInfo(infoToChoose); return; } if (input == politicanGroup[2]) { DPS personal = new DPS(); var infoToChoose = personal.PersonalInfo(); Console.WriteLine(text1); Console.WriteLine(string.Join("\n", infoToChoose.Keys)); GetPersonalInfo(infoToChoose); return; } if (input == politicanGroup[4]) { KauzaRz personal = new KauzaRz(); var infoToChoose = personal.PersonalInfo(); Console.WriteLine(text1); Console.WriteLine(string.Join("\n", infoToChoose.Keys)); GetPersonalInfo(infoToChoose); return; } if (input == politicanGroup[5]) { Free personal = new Free(); var infoToChoose = personal.PersonalInfo(); Console.WriteLine(text1); Console.WriteLine(string.Join("\n", infoToChoose.Keys)); GetPersonalInfo(infoToChoose); return; } if (input == politicanGroup[3]) { ReformBlog personal = new ReformBlog(); var infoToChoose = personal.PersonalInfo(); Console.WriteLine(text1); Console.WriteLine(string.Join("\n", infoToChoose.Keys)); GetPersonalInfo(infoToChoose); return; } } if (enter == "3") { Console.WriteLine("Благодарим Ви, че използвате Системата!"); } }
static void Main(string[] args) { GERB gerbb = new GERB(); BSP bspp = new BSP(); DPS dpss = new DPS(); KauzaRz kauzaa = new KauzaRz(); Free freee = new Free(); ReformBlog reformBlogg = new ReformBlog(); // Console.WriteLine("Искате ли да започнете работа със Системата?"); Console.WriteLine("за да започнете работа натиснете => 0"); Console.WriteLine("за повече информация натиснете => 1 "); Console.WriteLine("за изход от Системата натиснете => 2 "); var enter = Console.ReadLine(); if (enter == "0") { PrintInfoForProgram(); var allCouncilMan = gerbb.ListCol().Concat(bspp.ListCol().Concat(dpss.ListCol().Concat(kauzaa.ListCol().Concat(freee.ListCol().Concat(reformBlogg.ListCol()))))); string[] allCouncilArr = allCouncilMan.ToArray(); // List <string> kvorum = new List <string>(); string[] toName = allCouncilArr; List <string> take = toName.ToList(); // var gerb = gerbb.ListCol(); var bsp = bspp.ListCol(); var dps = dpss.ListCol(); var reforma = reformBlogg.ListCol(); var nezavisim = freee.ListCol(); var kauza = kauzaa.ListCol(); Dictionary <string, List <string> > delegateByPoliticians = new Dictionary <string, List <string> >(); byte count = 0; //Kvorum => string za potvyrjdenie => Tuk for (int person = 0; person < all; person++) { Console.Write(toName[person] + " => "); var checking = Console.ReadLine(); Console.WriteLine(checking); File.AppendAllText(path, "Кворум:"); if (checking == "tuk") { count++; kvorum.Add($"{toName[person]}"); File.AppendAllText(path, toName[person]); take.Remove(toName[person]); // TakeInfoForPartAndPerson(gerbb, bspp, dpss, kauzaa, freee, reformBlogg, toName, delegateByPoliticians, person); } } var result = kvorum.Count > 16 ? "Има кворум" : $"Няма кворум, нужни са още/поне {16 - kvorum.Count} гласа!"; File.AppendAllText(path, result); Console.WriteLine(".................................................."); Console.WriteLine("Присъстват по партийни групи:"); File.AppendAllText(path, "Присъстват по партийни групи:"); var tempC = 0; foreach (var party in delegateByPoliticians) { Console.WriteLine(party.Key); File.AppendAllText(path, party.Key); foreach (var person in party.Value) { tempC++; Console.WriteLine($"{tempC}. " + person); File.AppendAllText(path, $"{tempC}. " + person + "\n"); } Console.WriteLine(); } Console.WriteLine(".................................................."); Console.WriteLine($"Гласували общо: {count}"); File.AppendAllText(path, $"Гласували общо: {count}" + "\n"); Console.WriteLine($"{result}"); File.AppendAllText(path, $"{result}" + "\n"); Console.WriteLine($"Присъстват следните съветници:"); for (int i = 0; i < kvorum.Count; i++) { Console.WriteLine($"{i} => {kvorum[i]}"); } File.AppendAllText(path, $"Присъстват следните съветници => \n" + string.Join($"\n=>", kvorum)); Console.WriteLine($"Отсъстват следните съветници =>"); File.AppendAllText(path, $"Отсъстват следните съветници =>"); var countMising = 1; for (int i = 0; i < take.Count; i++) { Console.WriteLine($"{countMising++} => {take[i]}"); File.AppendAllText(path, $"{countMising++} => {take[i]}" + "\n"); } Console.WriteLine(".................................................."); Dictionary <byte, string> positive = new Dictionary <byte, string>(); Dictionary <byte, string> negative = new Dictionary <byte, string>(); Dictionary <byte, string> neutral = new Dictionary <byte, string>(); byte a = 1; byte b = 1; byte c = 1;; if (kvorum.Count > 16) { Console.WriteLine("Заседанието има кворум и докладните могат да се гласуват!"); File.AppendAllText(path, "Заседанието има кворум и докладните могат да се гласуват!" + "\n"); //работи се с лист от кворума => приема се до доказване на противното, //че за да се приеме докладна трябва да има >50% от гласовете на делегатите. Console.WriteLine("Желате ли да започнете гласуването? Yes/No" + $"\nИмате кворум от => {kvorum.Count} делегата!"); File.AppendAllText(path, "Желате ли да започнете гласуването? Yes/No" + $"\nИмате кворум от => {kvorum.Count} делегата!" + "\n"); var askAction = Console.ReadLine(); var gerbCountN = new byte[3] { 0, 0, 0 }; var bspCountN = new byte[3] { 0, 0, 0 }; var dpsCountN = new byte[3] { 0, 0, 0 }; var reformaCountN = new byte[3] { 0, 0, 0 }; var kauzaCountN = new byte[3] { 0, 0, 0 }; var freeCountN = new byte[3] { 0, 0, 0 }; while (askAction != "No") { for (int i = 0; i < kvorum.Count; i++) { Console.Write(kvorum[i] + " => "); var voting = Console.ReadLine(); Console.WriteLine(voting); byte n = 0; if (voting == "z") { positive.Add(a, kvorum[i]); GetV(kvorum, gerb, gerbCountN, i); GetV(kvorum, bsp, bspCountN, i); GetV(kvorum, dps, dpsCountN, i); GetV(kvorum, reforma, reformaCountN, i); GetV(kvorum, nezavisim, freeCountN, i); GetV(kvorum, kauza, kauzaCountN, i); a++; } if (voting == "p") { negative.Add(b, kvorum[i]); GetV2(kvorum, gerb, gerbCountN, i); GetV2(kvorum, bsp, bspCountN, i); GetV2(kvorum, dps, dpsCountN, i); GetV2(kvorum, nezavisim, freeCountN, i); GetV2(kvorum, reforma, reformaCountN, i); GetV2(kvorum, kauza, kauzaCountN, i); b++; } if (voting == "v") { neutral.Add(c, kvorum[i]); GetV3(kvorum, gerb, gerbCountN, i); GetV3(kvorum, bsp, bspCountN, i); GetV3(kvorum, dps, dpsCountN, i); GetV3(kvorum, nezavisim, freeCountN, i); GetV3(kvorum, reforma, reformaCountN, i); GetV3(kvorum, kauza, kauzaCountN, i); c++; } else { continue; } } Console.WriteLine(".................................................."); Console.WriteLine("Резултат от гласуването =>"); Console.WriteLine("За"); File.AppendAllText(path, "За" + "\n"); if (positive.Count() != 0) { foreach (var za in positive) { Console.Write($"{za.Key} поредност на вота => "); foreach (var item in za.Value) { Console.Write($"{item}"); File.AppendAllText(path, $"{item}"); } Console.WriteLine(); } } else { Console.Write(" => " + 0); } Console.WriteLine("Против"); File.AppendAllText(path, "Против" + "\n"); if (negative.Count() != 0) { foreach (var protiv in negative) { Console.Write($"{protiv.Key} поредност на вота => "); foreach (var item in protiv.Value) { Console.Write(item); File.AppendAllText(path, item.ToString()); } Console.WriteLine(); } } else { Console.Write(" => " + 0); } Console.WriteLine("Въздържал се"); File.AppendAllText(path, "Въздържал се" + "\n"); if (neutral.Count() != 0) { foreach (var pass in neutral) { Console.Write($"{pass.Key} поредност на вота => "); foreach (var item in pass.Value) { Console.Write(item); File.AppendAllText(path, item.ToString()); } Console.WriteLine(); } } else { Console.Write(" => " + 0); } Console.WriteLine(".................................................."); var isOk = positive.Count() > kvorum.Count / 2; var p = positive.Count() == 0 ? 0 : positive.Count(); var nega = negative.Count() == 0 ? 0 : negative.Count(); var neutr = neutral.Count() == 0 ? 0 : neutral.Count(); Console.WriteLine(".................................................."); if (isOk) { Console.WriteLine("Докладната се приема!"); File.AppendAllText(path, "Докладната се приема!"); Console.WriteLine(p + " ЗА"); File.AppendAllText(path, p + " ЗА\n"); Console.WriteLine(nega + " Против"); File.AppendAllText(path, nega + " Против\n"); Console.WriteLine(neutr + " Въздържал се"); File.AppendAllText(path, neutr + " Въздържал се\n"); } else { Console.WriteLine("Докладната се отхвърля!"); File.AppendAllText(path, "Докладната се отхвърля!\n"); Console.WriteLine(p + " ЗА"); File.AppendAllText(path, p + " ЗА\n"); Console.WriteLine(nega + " Против"); File.AppendAllText(path, nega + " Против\n"); Console.WriteLine(neutr + " Въздържал се"); File.AppendAllText(path, neutr + " Въздържал се\n"); } Console.WriteLine(".................................................."); Console.WriteLine("По политически групи:"); File.AppendAllText(path, "По политически групи:\n"); Console.WriteLine(".................................................."); Console.WriteLine("За"); File.AppendAllText(path, "За\n"); Print(gerbCountN[0], bspCountN[0], dpsCountN[0], reformaCountN[0], kauzaCountN[0], freeCountN[0]); File.AppendAllText(path, "GERB => " + gerbCountN[0] + "\n"); File.AppendAllText(path, "BSP => " + bspCountN[0] + "\n"); File.AppendAllText(path, "DPS => " + dpsCountN[0] + "\n"); File.AppendAllText(path, "Reforma => " + reformaCountN[0] + "\n"); File.AppendAllText(path, "Kauza => " + kauzaCountN[0] + "\n"); File.AppendAllText(path, "Free => " + freeCountN[0] + "\n"); // Console.WriteLine("Против"); File.AppendAllText(path, "Против"); Print(gerbCountN[1], bspCountN[0], dpsCountN[1], reformaCountN[1], kauzaCountN[1], freeCountN[1]); File.AppendAllText(path, "GERB => " + gerbCountN[1] + "\n"); File.AppendAllText(path, "BSP => " + bspCountN[1] + "\n"); File.AppendAllText(path, "DPS => " + dpsCountN[1] + "\n"); File.AppendAllText(path, "Reforma => " + reformaCountN[1] + "\n"); File.AppendAllText(path, "Kauza => " + kauzaCountN[1] + "\n"); File.AppendAllText(path, "Free => " + freeCountN[1] + "\n"); // Console.WriteLine("Въздържал се:"); File.AppendAllText(path, "Въздържал се:"); Print(gerbCountN[2], bspCountN[2], dpsCountN[2], reformaCountN[2], kauzaCountN[2], freeCountN[2]); File.AppendAllText(path, "GERB => " + gerbCountN[2] + "\n"); File.AppendAllText(path, "BSP => " + bspCountN[2] + "\n"); File.AppendAllText(path, "DPS => " + dpsCountN[2] + "\n"); File.AppendAllText(path, "Reforma => " + reformaCountN[2] + "\n"); File.AppendAllText(path, "Kauza => " + kauzaCountN[2] + "\n"); File.AppendAllText(path, "Free => " + freeCountN[2] + "\n"); Console.WriteLine(".................................................."); File.AppendAllText(path, DateTime.Now.ToString() + "\n"); Console.ReadKey(); Console.WriteLine("Желате ли да започнете ново гласуване ? Yes/No"); //зануляване на стойностите. positive.Clear(); neutral.Clear(); negative.Clear(); for (int i = 0; i < gerbCountN.Length; i++) { gerbCountN[i] = 0; } for (int i = 0; i < bspCountN.Length; i++) { bspCountN[i] = 0; } for (int i = 0; i < dpsCountN.Length; i++) { dpsCountN[i] = 0; } for (int i = 0; i < reformaCountN.Length; i++) { reformaCountN[i] = 0; } for (int i = 0; i < kauzaCountN.Length; i++) { kauzaCountN[i] = 0; } for (int i = 0; i < freeCountN.Length; i++) { freeCountN[i] = 0; } askAction = Console.ReadLine(); } } Console.ReadKey(); } if (enter == "1") { PrintAddInfoForProgram(); } if (enter == "2") { Console.WriteLine("Благодарим Ви, че използвате Системата!"); } }
/// <summary> /// Merge data from another participant into this participant. /// </summary> public void Merge(FightParticipant p, int intervalOffset = 0, int timeOffset = 0) { OutboundMissCount += p.OutboundMissCount; OutboundHitCount += p.OutboundHitCount; OutboundHitSum += p.OutboundHitSum; OutboundStrikeCount += p.OutboundStrikeCount; InboundMissCount += p.InboundMissCount; InboundHitCount += p.InboundHitCount; InboundHitSum += p.InboundHitSum; InboundMeleeCount += p.InboundMeleeCount; InboundMeleeSum += p.InboundMeleeSum; InboundRiposteSum += p.InboundRiposteSum; //InboundSpellCount += p.InboundSpellCount; //InboundSpellSum += p.InboundSpellSum; InboundStrikeCount += p.InboundStrikeCount; OutboundHealSum += p.OutboundHealSum; InboundHealSum += p.InboundHealSum; InboundFullHealSum += p.InboundFullHealSum; DeathCount += p.DeathCount; // merge intervals starting at 'intervalOffset' base for (var i = 0; i < p.DPS.Count; i++) { while (DPS.Count <= intervalOffset + i) { DPS.Add(0); } DPS[intervalOffset + i] += p.DPS[i]; } for (var i = 0; i < p.TankDPS.Count; i++) { while (TankDPS.Count <= intervalOffset + i) { TankDPS.Add(0); } TankDPS[intervalOffset + i] += p.TankDPS[i]; } for (var i = 0; i < p.HPS.Count; i++) { while (HPS.Count <= intervalOffset + i) { HPS.Add(0); } HPS[intervalOffset + i] += p.HPS[i]; } for (var i = 0; i < p.InboundHPS.Count; i++) { while (InboundHPS.Count <= intervalOffset + i) { InboundHPS.Add(0); } InboundHPS[intervalOffset + i] += p.InboundHPS[i]; } foreach (var at in p.AttackTypes) { var _at = AttackTypes.FirstOrDefault(x => x.Type == at.Type); if (_at == null) { _at = new FightHit(); _at.Type = at.Type; AttackTypes.Add(_at); } _at.Merge(at); } foreach (var dt in p.DefenseTypes) { var _dt = DefenseTypes.FirstOrDefault(x => x.Type == dt.Type); if (_dt == null) { _dt = new FightMiss(); _dt.Type = dt.Type; DefenseTypes.Add(_dt); } _dt.Merge(dt); } foreach (var h in p.Heals) { var _h = Heals.FirstOrDefault(x => x.Target == h.Target); if (_h == null) { _h = new FightHeal(); _h.Target = h.Target; Heals.Add(_h); } _h.Merge(h); } foreach (var s in p.Spells) { var _s = Spells.FirstOrDefault(x => x.Name == s.Name && x.Type == s.Type); if (_s == null) { _s = new FightSpell(); _s.Type = s.Type; _s.Name = s.Name; //_s.Times = // todo Spells.Add(_s); } _s.Merge(s); } // disabled - merging buffs will create duplicates if fights overlap and include the same buff // it would be better to recreate buffs after merging p.Buffs.Clear(); // >= 0 avoids any pre fight buffs //foreach (var b in p.Buffs.Where(x => x.Time >= 0)) //{ // if (timeOffset == 0) // Buffs.Add(b); // else // Buffs.Add(new FightBuff { Name = b.Name, Time = b.Time + timeOffset }); //} }
/// <summary> /// Merges damage, heals and spells from a pet into this participant. /// Tanking is not merged. /// All data will be prefixed with "pet:" to distinguish it from the owner. e.g. "pet:slash" vs "slash" /// </summary> public void MergePet(FightParticipant pet) { foreach (var at in pet.AttackTypes) { at.Type = "pet:" + at.Type; //owner.AttackTypes.Add(hit); var match = AttackTypes.FirstOrDefault(x => x.Type == at.Type); if (match != null) { match.Merge(at); } else { AttackTypes.Add(at); } } foreach (var spell in pet.Spells.Where(x => x.Type == "hit")) { spell.Name = "pet:" + spell.Name; var match = Spells.FirstOrDefault(x => x.Type == spell.Type && x.Name == spell.Name); if (match != null) { match.Merge(spell); } else { Spells.Add(spell); } } OutboundHitCount += pet.OutboundHitCount; OutboundHitSum += pet.OutboundHitSum; OutboundMissCount += pet.OutboundMissCount; // merges DPS and HPS intervals (but not TankDPS or InboundHPS) for (var i = 0; i < pet.DPS.Count; i++) { while (DPS.Count <= i) { DPS.Add(0); } DPS[i] += pet.DPS[i]; } for (var i = 0; i < pet.HPS.Count; i++) { while (HPS.Count <= i) { HPS.Add(0); } HPS[i] += pet.HPS[i]; } // removing the pet has the downside of hiding pet tanking //Participants.Remove(pet); // clear the damage on the pet but keep it for tanking stats pet.OutboundHitCount = 0; pet.OutboundHitSum = 0; pet.OutboundMissCount = 0; pet.AttackTypes.Clear(); //pet.Spells.Clear(); pet.Spells.RemoveAll(x => x.Type == "hit"); // leave heals on pet so it shows on the healer list pet.DPS.Clear(); pet.HPS.Clear(); }
void Awake() { Global = this; }
public override Dictionary <string, string> GetCharacterDisplayCalculationValues() { Dictionary <string, string> dictValues = new Dictionary <string, string>(); dictValues.Add("DPS Points", DPS.ToString("F2", CultureInfo.InvariantCulture)); dictValues.Add("Survivability Points", Survivability.ToString("F2", CultureInfo.InvariantCulture)); dictValues.Add("Overall Points", OverallPoints.ToString("F2", CultureInfo.InvariantCulture)); dictValues.Add("Health", BasicStats.Health.ToString("F0", CultureInfo.InvariantCulture)); dictValues.Add("Mana", BasicStats.Mana.ToString("F0", CultureInfo.InvariantCulture)); dictValues.Add("Strength", String.Format("{0}*Increases Attack Power by {1}", BasicStats.Strength.ToString("F0", CultureInfo.InvariantCulture), (BasicStats.Strength - 10f).ToString("F0", CultureInfo.InvariantCulture))); dictValues.Add("Agility", String.Format("{0}*Increases Attack Power by {1}\r\nIncreases Critical Hit chance by {2}%", BasicStats.Agility.ToString("F0", CultureInfo.InvariantCulture), ((BasicStats.Agility * 2f) - 20f).ToString("F0", CultureInfo.InvariantCulture), (StatConversion.GetCritFromAgility(BasicStats.Agility, CharacterClass.Shaman) * 100f).ToString("F2", CultureInfo.InvariantCulture))); dictValues.Add("Stamina", String.Format("{0}*Increase Health by {1}", BasicStats.Stamina.ToString("F0", CultureInfo.InvariantCulture), (StatConversion.GetHealthFromStamina(BasicStats.Stamina)).ToString("F0", CultureInfo.InvariantCulture))); dictValues.Add("Intellect", String.Format("{0}*Increases Mana by {1}\r\nIncreases Spell Power by {2}\r\nIncreases Spell Critical Hit chance by {3}%", BasicStats.Intellect.ToString("F0", CultureInfo.InvariantCulture), (StatConversion.GetManaFromIntellect(BasicStats.Intellect)).ToString("F0", CultureInfo.InvariantCulture), (BasicStats.Intellect - 10f).ToString("F0", CultureInfo.InvariantCulture), (StatConversion.GetSpellCritFromIntellect(BasicStats.Intellect, CharacterClass.Shaman) * 100f).ToString("F2", CultureInfo.InvariantCulture))); dictValues.Add("Spirit", String.Format("{0}*Increases mana regeneration by {1} every 5 seconds while not casting", BasicStats.Spirit.ToString("F0", CultureInfo.InvariantCulture), (StatConversion.GetSpiritRegenSec(BasicStats.Spirit, BasicStats.Intellect) * 5f).ToString("F0", CultureInfo.InvariantCulture))); dictValues.Add("Mastery", String.Format("{0}*Mastery rating of {1} adds {2} Mastery\r\nIncreases all Fire, Frost, and Nature Damage by {3}%.", (8f + StatConversion.GetMasteryFromRating(BasicStats.MasteryRating)).ToString("F2", CultureInfo.InvariantCulture), BasicStats.MasteryRating.ToString("F0", CultureInfo.InvariantCulture), (StatConversion.GetMasteryFromRating(BasicStats.MasteryRating)).ToString("F2", CultureInfo.InvariantCulture), ((8f + StatConversion.GetMasteryFromRating(BasicStats.MasteryRating)) * 2.5f).ToString("F2", CultureInfo.InvariantCulture))); //dictValues.Add("Damage" //dictValues.Add("DPS" dictValues.Add("Attack Power", BasicStats.AttackPower.ToString("F0", CultureInfo.InvariantCulture)); //dictValues.Add("Speed" dictValues.Add("Melee Haste", String.Format("{0}%*Haste Rating of {1} adds {2}% Haste", (StatConversion.GetHasteFromRating(BasicStats.HasteRating, CharacterClass.Shaman) * 100f).ToString("F2", CultureInfo.InvariantCulture), BasicStats.HasteRating.ToString("F0", CultureInfo.InvariantCulture), (StatConversion.GetHasteFromRating(BasicStats.HasteRating, CharacterClass.Shaman) * 100f).ToString("F2", CultureInfo.InvariantCulture))); dictValues.Add("Melee Hit", String.Format("{0}%*Hit Rating of {1} adds {2}% Hit chance\r\n{3}% Draenei Hit Bonus", (StatConversion.GetHitFromRating(BasicStats.HitRating) * 100f + DraeneiHitBonus * 100f).ToString("F2", CultureInfo.InvariantCulture), BasicStats.HitRating.ToString("F0", CultureInfo.InvariantCulture), (StatConversion.GetHitFromRating(BasicStats.HitRating) * 100f).ToString("F2", CultureInfo.InvariantCulture), DraeneiHitBonus * 100f)); dictValues.Add("Melee Crit", String.Format("{0}%*Crit Rating of {1} adds {2}% Crit chance", ((StatConversion.GetCritFromRating(BasicStats.CritRating, CharacterClass.Shaman) * 100f) + (StatConversion.GetCritFromAgility(BasicStats.Agility, CharacterClass.Shaman) * 100f)).ToString("F2", CultureInfo.InvariantCulture), BasicStats.CritRating.ToString("F0", CultureInfo.InvariantCulture), (StatConversion.GetCritFromRating(BasicStats.CritRating, CharacterClass.Shaman) * 100f).ToString("F2", CultureInfo.InvariantCulture))); dictValues.Add("Expertise", getExpertiseString());// String.Format("{0} / {1}*Reduces chance to be dodged or parried by {2}% / {3}%\r\nExpertise Rating of {4} adds {5} Expertise", dictValues.Add("Spell Power", BasicStats.SpellPower.ToString("F0", CultureInfo.InvariantCulture)); dictValues.Add("Spell Haste", String.Format("{0}%*Haste Rating of {1} adds {2}% Haste", (StatConversion.GetSpellHasteFromRating(BasicStats.HasteRating, CharacterClass.Shaman) * 100f).ToString("F2", CultureInfo.InvariantCulture), BasicStats.HasteRating.ToString("F0", CultureInfo.InvariantCulture), (StatConversion.GetSpellHasteFromRating(BasicStats.HasteRating, CharacterClass.Shaman) * 100f).ToString("F2", CultureInfo.InvariantCulture))); dictValues.Add("Spell Hit", String.Format("{0}%*Hit Rating of {1} adds {2}% Hit chance\r\n{3}% Draenei Hit Bonus", (StatConversion.GetSpellHitFromRating(BasicStats.HitRating + ElemPrecMod) * 100f + DraeneiHitBonus * 100f).ToString("F2", CultureInfo.InvariantCulture), (BasicStats.HitRating + ElemPrecMod).ToString("F0", CultureInfo.InvariantCulture), (StatConversion.GetSpellHitFromRating(BasicStats.HitRating + ElemPrecMod) * 100f).ToString("F2", CultureInfo.InvariantCulture), DraeneiHitBonus * 100f)); dictValues.Add("Spell Crit", String.Format("{0}%*Crit Rating of {1} adds {2}% Crit chance", ((StatConversion.GetSpellCritFromRating(BasicStats.CritRating, CharacterClass.Shaman) * 100f) + (StatConversion.GetSpellCritFromIntellect(BasicStats.Intellect, CharacterClass.Shaman) * 100f)).ToString("F2", CultureInfo.InvariantCulture), BasicStats.CritRating.ToString("F0", CultureInfo.InvariantCulture), (StatConversion.GetSpellCritFromRating(BasicStats.CritRating, CharacterClass.Shaman) * 100f).ToString("F2", CultureInfo.InvariantCulture))); dictValues.Add("Combat Regen", String.Format("{0}*{0} mana regenerated every 5 seconds while in combat", BaseRegen.ToString("F0", CultureInfo.InvariantCulture))); //dictValues.Add("Avg Agility", _attackPower.ToString("F0", CultureInfo.InvariantCulture)); //dictValues.Add("Avg Intellect" //dictValues.Add("Avg Mastery" //dictValues.Add("Avg Attack Power" dictValues.Add("Avg Speed", String.Format("{0} / {1}", AvMHSpeed.ToString("F2", CultureInfo.InvariantCulture), AvOHSpeed.ToString("F2", CultureInfo.InvariantCulture))); //dictValues.Add("Avg Melee Haste" //dictValues.Add("Avg Melee Hit" //dictValues.Add("Avg Melee Crit" //dictValues.Add("Avg Expertise" //dictValues.Add("Avg Spell Power" //dictValues.Add("Avg Spell Haste" //dictValues.Add("Avg Spell Hit" //dictValues.Add("Avg Spell Crit" dictValues.Add("Avg Combat Regen", ManaRegen.ToString("F0", CultureInfo.InvariantCulture)); /*dictValues.Add("White Hit", WhiteHit.ToString("F2", CultureInfo.InvariantCulture) + "%"); * if (YellowHit < 100f && TotalExpertiseMH < 26) * { * float ratingRequired = (float)Math.Ceiling(4f * StatConversion.GetRatingFromExpertise(100f - YellowHit)); * dictValues.Add("Yellow Hit", String.Format("{0}% (Under Cap)*You need {1} more expertise to cap specials (WF,SS)", * YellowHit.ToString("F2", CultureInfo.InvariantCulture), * ratingRequired.ToString("F0", CultureInfo.InvariantCulture))); * } * else * { * if (ParriedAttacks > 0) * { * float ratingRequired = (float)Math.Ceiling(4f * StatConversion.GetRatingFromExpertise(100f - YellowHit)); * dictValues.Add("Yellow Hit", String.Format("{0}%*Being in front of boss allows your attacks to be parried\r\nYou would need {1} more expertise to cap specials (WF,SS)", * YellowHit.ToString("F2", CultureInfo.InvariantCulture), * ratingRequired.ToString("F0", CultureInfo.InvariantCulture))); * } * else * dictValues.Add("Yellow Hit", YellowHit.ToString("F2", CultureInfo.InvariantCulture) + "%"); * } * if (OverSpellHitCap > 0.38f) // only warn if more than .38% over cap (equivalent to 10 hit rating) * dictValues.Add("Spell Hit", String.Format("{0}% (Over Cap)*Over Spell Hit Cap by {1}%", * SpellHit.ToString("F2", CultureInfo.InvariantCulture), * OverSpellHitCap.ToString("F2", CultureInfo.InvariantCulture))); * else * { * if (SpellHit < 100f) * { * float ratingRequired = (float)Math.Ceiling(StatConversion.GetRatingFromSpellHit(1f - SpellHit/100f)); * dictValues.Add("Spell Hit", String.Format("{0}% (Under Cap)*You need {1} more hit rating to cap spells (ES, LB etc)", * SpellHit.ToString("F2", CultureInfo.InvariantCulture), * ratingRequired.ToString("F0", CultureInfo.InvariantCulture))); * } * else * dictValues.Add("Spell Hit", SpellHit.ToString("F2", CultureInfo.InvariantCulture) + "%"); * }*/ /*if (OverMeleeCritCap > 0.21f) // only warn if more than .21% over cap (equivalent to 10 crit rating) * dictValues.Add("Melee Crit", String.Format("{0} (Over Cap)*Crit Rating {1} (+{2}% crit chance)\r\nOver Soft Cap by {3}%", * MeleeCrit.ToString("F2", CultureInfo.InvariantCulture) + "%", * BasicStats.CritRating.ToString("F0", CultureInfo.InvariantCulture), * (StatConversion.GetCritFromRating(BasicStats.CritRating) * 100f).ToString("F2", CultureInfo.InvariantCulture), * OverMeleeCritCap.ToString("F2", CultureInfo.InvariantCulture))); * else * dictValues.Add("Melee Crit", String.Format("{0}*Crit Rating {1} (+{2}% crit chance)", * MeleeCrit.ToString("F2", CultureInfo.InvariantCulture) + "%", * BasicStats.CritRating.ToString("F0", CultureInfo.InvariantCulture), * (StatConversion.GetCritFromRating(BasicStats.CritRating) * 100f).ToString("F2", CultureInfo.InvariantCulture))); * * dictValues.Add("Spell Crit", String.Format("{0}*Crit Rating {1} (+{2}% crit chance)", * SpellCrit.ToString("F2", CultureInfo.InvariantCulture) + "%", * BasicStats.CritRating.ToString("F0", CultureInfo.InvariantCulture), * (StatConversion.GetSpellCritFromRating(BasicStats.CritRating) * 100f).ToString("F2", CultureInfo.InvariantCulture)));*/ float spellMiss = 100 - SpellHit; dictValues.Add("Avoided Attacks", String.Format("{0}%*{1}% Boss Dodged\r\n{2}% Boss Parried\r\n{3}% Spell Misses\r\n{4}% White Misses", AvoidedAttacks.ToString("F2", CultureInfo.InvariantCulture), DodgedAttacks.ToString("F2", CultureInfo.InvariantCulture), ParriedAttacks.ToString("F2", CultureInfo.InvariantCulture), spellMiss.ToString("F2", CultureInfo.InvariantCulture), MissedAttacks.ToString("F2", CultureInfo.InvariantCulture))); dictValues.Add("Armor Mitigation", ArmorMitigation.ToString("F2", CultureInfo.InvariantCulture) + "%*Amount of physical damage lost due to boss armor"); dictValues.Add("ED Uptime", String.Format("{0}%*{1}% ED Bonus Crit", EDUptime.ToString("F2", CultureInfo.InvariantCulture), EDBonusCrit.ToString("F2", CultureInfo.InvariantCulture))); dictValues.Add("Flurry Uptime", FlurryUptime.ToString("F2", CultureInfo.InvariantCulture) + "%"); dictValues.Add("Avg Time to 5 Stack", String.Format("{0} sec*{1} PPM", SecondsTo5Stack.ToString("F2", CultureInfo.InvariantCulture), _MWPPM.ToString("F2", CultureInfo.InvariantCulture))); dictValues.Add("MH Enchant Uptime", MHEnchantUptime.ToString("F2", CultureInfo.InvariantCulture) + "%"); dictValues.Add("OH Enchant Uptime", OHEnchantUptime.ToString("F2", CultureInfo.InvariantCulture) + "%"); dictValues.Add("Trinket 1 Uptime", Trinket1Uptime.ToString("F2", CultureInfo.InvariantCulture) + "%"); dictValues.Add("Trinket 2 Uptime", Trinket2Uptime.ToString("F2", CultureInfo.InvariantCulture) + "%"); dictValues.Add("Fire Totem Uptime", FireTotemUptime.ToString("F2", CultureInfo.InvariantCulture) + "%"); dictValues.Add("White Damage", dpsOutputFormat(SwingDamage, DPS, true)); dictValues.Add("Windfury Attack", dpsOutputFormat(WindfuryAttack, DPS, true)); dictValues.Add("Flametongue Attack", dpsOutputFormat(FlameTongueAttack, DPS, true)); dictValues.Add("Stormstrike", dpsOutputFormat(Stormstrike, DPS, true)); dictValues.Add("Lava Lash", dpsOutputFormat(LavaLash, DPS, true)); dictValues.Add("Searing/Magma Totem", dpsOutputFormat(SearingMagma, DPS, false)); dictValues.Add("Earth Shock", dpsOutputFormat(EarthShock, DPS, false)); dictValues.Add("Flame Shock", dpsOutputFormat(FlameShock, DPS, false)); dictValues.Add("Lightning Bolt", dpsOutputFormat(LightningBolt, DPS, false)); dictValues.Add("Unleash Wind", dpsOutputFormat(UnleashWind, DPS, true)); dictValues.Add("Unleash Flame", dpsOutputFormat(UnleashFlame, DPS, false)); dictValues.Add("Lightning Shield", dpsOutputFormat(LightningShield, DPS, false)); dictValues.Add("Chain Lightning", dpsOutputFormat(ChainLightning, DPS, false)); dictValues.Add("Fire Nova", dpsOutputFormat(FireNova, DPS, false)); dictValues.Add("Fire Elemental", FireElemental.getDPSOutput()); dictValues.Add("Spirit Wolf", dpsOutputFormat(SpiritWolf, DPS, true)); dictValues.Add("Other", dpsOutputFormat(Other, DPS, false)); dictValues.Add("Total DPS", DPS.ToString("F2", CultureInfo.InvariantCulture)); /*dictValues.Add("Status", String.Format("Enhance Model : DPS Points {0}, Survivability Points {1}, Overall Points {2}", * DPS.ToString("F2", CultureInfo.InvariantCulture), * Survivability.ToString("F2", CultureInfo.InvariantCulture), * OverallPoints.ToString("F2", CultureInfo.InvariantCulture)));*/ return(dictValues); }
public override Dictionary <string, string> GetCharacterDisplayCalculationValues() { Dictionary <string, string> dict = new Dictionary <string, string>(); dict["Miss"] = Miss.ToString("F2") + "%"; dict["Dodge"] = Dodge.ToString("F2") + "%"; dict["Parry"] = Parry.ToString("F2") + "%"; dict["Armor Damage Reduction"] = (ArmorDamageReduction * 100.0f).ToString("F2") + "%"; dict["Magic Damage Reduction"] = (MagicDamageReduction * 100.0f).ToString("F2") + "%" + string.Format("*Arcane: {0:0}\n", BasicStats.ArcaneResistance) + string.Format("Fire: {0:0}\n", BasicStats.FireResistance) + string.Format("Frost: {0:0}\n", BasicStats.FrostResistance) + string.Format("Nature: {0:0}\n", BasicStats.NatureResistance) + string.Format("Shadow: {0:0}", BasicStats.ShadowResistance); dict["Total Avoidance"] = (Miss + Parry + Dodge).ToString("F2") + "%"; // Another duplicate math location. dict["Burst Time"] = String.Format("{0:0.0} sec", BurstTime); dict["Reaction Time"] = String.Format("{0:0.0} sec", ReactionTime); dict["Health"] = BasicStats.Health.ToString("F0"); dict["Armor"] = BasicStats.Armor.ToString("F0"); dict["Strength"] = BasicStats.Strength.ToString("F0"); dict["Agility"] = BasicStats.Agility.ToString("F0"); dict["Stamina"] = BasicStats.Stamina.ToString("F0"); dict["Hit Rating"] = BasicStats.HitRating.ToString("F0"); dict["Haste Rating"] = BasicStats.HasteRating.ToString("F0"); dict["Crit Rating"] = BasicStats.CritRating.ToString("F0"); dict["Physical Crit"] = (BasicStats.PhysicalCrit * 100f).ToString("F2"); dict["Expertise"] = Expertise.ToString("F0"); dict["Attack Power"] = BasicStats.AttackPower.ToString("F0"); dict["Armor Penetration"] = (BasicStats.ArmorPenetration * 100f).ToString("F2") + "%"; dict["Armor Penetration Rating"] = BasicStats.ArmorPenetrationRating.ToString("F0"); dict["DPS"] = DPS.ToString("F0"); dict["Rotation Time"] = String.Format("{0:0.00} sec", (RotationTime / 1000)); dict["Total Threat"] = TotalThreat.ToString("F0"); #region Rune Strike Limit dict["RS Limited"] = ""; if (RSLimit == (int)RSState.Good) { dict["RS Limited"] = "none"; } else { if (1 == (RSLimit & (int)RSState.TimeStarved)) { dict["RS Limited"] += "Swing Starved "; } if (1 == (RSLimit & (int)RSState.RPStarved)) { dict["RS Limited"] += "RP Starved "; } } #endregion #region Ability Costs dict["Blood"] = Blood.ToString("F0"); dict["Frost"] = Frost.ToString("F0"); dict["Unholy"] = Unholy.ToString("F0"); dict["Death"] = Death.ToString("F0"); dict["Runic Power"] = RP.ToString("F0"); #endregion dict["Overall Points"] = OverallPoints.ToString("F1"); dict["Mitigation Points"] = String.Format("{0:0.0}", (Mitigation * MitigationWeight)); // Modified Mitigation. dict["Survival Points"] = String.Format("{0:0.0}", (Survival * SurvivalWeight)) + string.Format("*Physical:{0:0.0}\n", (PhysicalSurvival * SurvivalWeight)) + string.Format("Bleed:{0:0.0}\n", (BleedSurvival * SurvivalWeight)) + string.Format("Magic:{0:0.0}", (MagicSurvival * SurvivalWeight)); // Modified Survival dict["Threat Points"] = String.Format("{0:0.0}", (Threat * ThreatWeight)); // Modified Threat dict["Crit"] = Crit.ToString("F2"); dict["Defense"] = Defense.ToString("F0"); dict["Resilience"] = Resilience.ToString("F0"); dict["Defense Rating"] = DefenseRating.ToString("F0"); dict["Defense Rating needed"] = DefenseRatingNeeded.ToString("F0"); dict["Target Miss"] = (TargetMiss * 100.0f).ToString("F1") + "%"; dict["Target Dodge"] = (TargetDodge * 100.0f).ToString("F1") + "%"; dict["Target Parry"] = (TargetParry * 100.0f).ToString("F1") + "%"; return(dict); }