public Form1() { InitializeComponent(); JsonData = @"{ ""parties"": [ { ""id"":0, ""name"":""SPD"", ""longname"":""Sozialdemokratische Partei Deutschlands""}, { ""id"":1, ""name"":""CDU"", ""longname"":""Christlich Demokratische Union Deutschlands""}, { ""id"":2, ""name"":""GRÜNE"", ""longname"":""BÜNDNIS 90/DIE GRÜNEN""}, { ""id"":3, ""name"":""FDP"", ""longname"":""Freie Demokratische Partei""}, { ""id"":4, ""name"":""DIE LINKE"", ""longname"":""DIE LINKE""}, { ""id"":5, ""name"":""PIRATEN"", ""longname"":""Piratenpartei Deutschland""}, { ""id"":6, ""name"":""NPD"", ""longname"":""Nationaldemokratische Partei Deutschlands""}, { ""id"":7, ""name"":""Die PARTEI"", ""longname"":""Partei für Arbeit, Rechtsstaat, Tierschutz, Elitenförderung und basisdemokratische Initiative""}, { ""id"":8, ""name"":""RENTNER"", ""longname"":""RENTNER Partei Deutschland""}, { ""id"":9, ""name"":""ÖDP"", ""longname"":""Ökologisch-Demokratische Partei""}, { ""id"":10, ""name"":""AfD"", ""longname"":""Alternative für Deutschland""}, { ""id"":11, ""name"":""HHBL"", ""longname"":""Hamburger Bürger-Liste""}, { ""id"":12, ""name"":""Liberale"", ""longname"":""Neue Liberale""} ] }"; PartyList jsonPartyList = JsonConvert.DeserializeObject <PartyList>(JsonData); JsonParties = jsonPartyList.getParties(); partyCtr = new PartyController(); parties = partyCtr.GetParties(); }
public override bool OnTick() { base.OnTick(); if (m_NextHeal > DateTime.UtcNow) { return(false); } PartyList.IterateReverse(m => { if (CheckPartyEffects(m, true)) { int healRange = (int)((BaseSkillBonus * 2) + CollectiveBonus); // 4 - 16 (22) if (m.Hits < m.HitsMax) { m.Heal(Utility.RandomMinMax(healRange - 2, healRange + 2)); m.FixedParticles(0x376A, 9, 32, 5005, EffectLayer.Waist); m.PlaySound(0x1F2); } } else { RemovePartyMember(m); } }); m_NextHeal = DateTime.UtcNow + TimeSpan.FromSeconds(4); return(true); }
public void UpdateParty(bool playersOnly) { var p = Party.Get(Caster); if (PartyList == null) { PartyList = new List <Mobile>(); } if (p != null) { foreach (var m in p.Members.Select(x => x.Mobile)) { if (!PartyList.Contains(m) && (!playersOnly || m is PlayerMobile) && ValidPartyMember(m)) { AddPartyMember(m); } else if (PartyList.Contains(m) && !ValidPartyMember(m)) { RemovePartyMember(m); } else { UpdatePets(m); } } } else if (!PartyList.Contains(Caster)) { AddPartyMember(Caster); } }
public PartyList List() { var list = new PartyList(); list.AddRange(this.ListHandler()); return(list); }
/// <summary> /// Gets dynamic enumeration of party members and pets withing party range /// </summary> /// <returns></returns> public IEnumerable <Mobile> GetParty() { if (!PartyEffects) { yield break; } Party p = Party.Get(Caster); if (p != null) { IPooledEnumerable eable = Caster.Map.GetMobilesInRange(Caster.Location, PartyRange); foreach (Mobile mob in eable) { if (mob == Caster) { yield return(mob); } Mobile check = mob; if (mob is BaseCreature && (((BaseCreature)mob).Summoned || ((BaseCreature)mob).Controlled)) { check = ((BaseCreature)mob).GetMaster(); } if (check != null && p.Contains(check)) { if (PartyList == null) { PartyList = new List <Mobile>(); } if (!PartyList.Contains(mob)) { PartyList.Add(mob); } yield return(mob); } } eable.Free(); } else { if (Caster is PlayerMobile) { foreach (var m in ((PlayerMobile)Caster).AllFollowers.Where(x => Caster.InRange(x.Location, PartyRange))) { yield return(m); } } yield return(Caster); } }
public void RemoveFromParty(Mobile m) { if (PartyList != null && PartyList.Contains(m)) { PartyList.Remove(m); RemovePartyEffects(m); } }
public void PartySetting(int iIndex) { if (iIndex < m_CompanionList.Count) { CharPartyData Node = new CharPartyData(); PartySetting(Node, iIndex); PartyList.Add(Node); } }
/** Removes parties with 0 characters. */ public static void CleanParties() { for (int lp = PartyList.Count - 1; lp >= 0; lp--) { if (PartyList[lp].MemberCount == 0) { PartyList.Remove(lp); } } }
public PartyList GetSum() { var getData = PartyScoreCollection.Find(it => true).ToList(); var gt = new PartyList(); gt.TotalScore = getData.Sum(it => it.TotalScore); gt.AreaScore = getData.Sum(it => it.AreaScore); gt.PercentScore = getData.Sum(it => it.PercentScore); return(gt); }
private void UpdatePets(Mobile m) { if (m is PlayerMobile) { foreach (var pet in ((PlayerMobile)m).AllFollowers.Where(p => !PartyList.Contains(p) && ValidPartyMember(p))) { AddPartyMember(pet); } } }
private async Task ExecuteLoadDataCommand() { if (IsBusy) { return; } IsBusy = true; try { Dataset.Clear(); DatasetParty.Clear(); var dataset = await DataStore.GetAllAsync_Character(true); dataset = dataset .OrderBy(a => a.Level) .ThenBy(a => a.Name) .ThenBy(a => a.Speed) .ThenByDescending(a => a.MaximumHealth) .ToList(); // var datasett = await DataStore.GetPartyAsync_Character(true); foreach (var data in dataset) { Dataset.Add(data); } Dataset = new ObservableCollection <Character>(Dataset.OrderBy(a => a.Level) .ThenBy(a => a.Name) .ThenBy(a => a.Speed) .ThenByDescending(a => a.MaximumHealth) .ToList()); foreach (var data in dataset) { if (PartyList.Contains(data.Id)) { DatasetParty.Add(data); } //DatasetParty = new ObservableCollection<Character>(DatasetParty.OrderBy(a => a.Level) //.ThenBy(a => a.Name) //.ThenBy(a => a.Speed) //.ThenByDescending(a => a.MaximumHealth) //.ToList()); } } catch (Exception ex) { Debug.WriteLine(ex); } finally { IsBusy = false; } }
public void requestPartyList() { PartyList request = new PartyList(); request.type = (int)CommandType.PARTY_LIST; request.player = curPlayer; string jsonCmd = JsonUtility.ToJson(request); currentSocket.Send(jsonCmd); }
private void LoadButton_Click(object sender, EventArgs e) { if (MessageBox.Show("Processing...", "Save Quest?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { SaveButton.Click += SaveButton_Click; } PartyList Load = new PartyList(); Load.Show(); this.Close(); }
public CorpPostTagUser(int tagId, IEnumerable <string> userList, IEnumerable <int> partyList) : this(tagId) { if (userList != null) { UserList.AddRange(userList); } if (partyList != null) { PartyList.AddRange(partyList); } }
//remove from party public async Task <bool> RemoveFromParty(Character character) { var myData = DatasetParty.FirstOrDefault(arg => arg.Id == character.Id); if (myData == null) { return(false); } PartyList.Remove(character.Id); DatasetParty.Remove(character); _needsRefresh = true; return(true); }
protected void AddPartyMember(Mobile m) { PartyList.Add(m); AddPartyEffects(m); if (m is PlayerMobile) { foreach (var pet in ((PlayerMobile)m).AllFollowers.Where(p => !PartyList.Contains(p) && ValidPartyMember(p))) { AddPartyMember(pet); } } }
protected void RemovePartyMember(Mobile m) { PartyList.Remove(m); RemovePartyEffects(m); if (m is PlayerMobile) { foreach (var pet in ((PlayerMobile)m).AllFollowers.Where(p => PartyList.Contains(p))) { RemovePartyMember(pet); } } }
private void UpdatePets(Mobile m) { if (m is PlayerMobile pm) { foreach (Mobile pet in pm.AllFollowers) { if (!PartyList.Contains(pet) && ValidPartyMember(pet)) { AddPartyMember(pet); } } } }
private void Popup_Show(object sender, EventArgs e) { string tagname = Convert.ToString((sender as ToolStripMenuItem).Tag); if (tagname == "") { return; } Form winform = new Form(); switch (tagname) { case "Party List": winform = new PartyList(); break; case "List Challan": winform = new ChallanList(); break; case "List Bill": winform = new frmBillList(); break; case "List LR Note": winform = new frmLRNoteList(); break; case "List MR Note": winform = new MRNoteList(); break; case "Account List": winform = new frmAccountList(); break; case "Transaction List": winform = new frmTransactionList(); break; } bool flag = false; foreach (Form form in Application.OpenForms) { if (tagname == Convert.ToString(form.Tag)) { flag = true; form.Focus(); break; } flag = false; } if (flag == false) { winform.ShowInTaskbar = false; winform.MdiParent = this; winform.StartPosition = FormStartPosition.CenterScreen; winform.Text = tagname; winform.WindowState = FormWindowState.Normal; winform.Show(); winform = null; } }
public List <Mobile> GetParty() { if (!PartyEffects) { return(null); } Party p = Party.Get(Caster); List <Mobile> list = new List <Mobile>(); if (p != null) { IPooledEnumerable eable = Caster.Map.GetMobilesInRange(Caster.Location, PartyRange); foreach (Mobile mob in eable) { Mobile check = mob; if (mob is BaseCreature && (((BaseCreature)mob).Summoned || ((BaseCreature)mob).Controlled)) { check = ((BaseCreature)mob).GetMaster(); } if (check != null && p.Contains(check)) { list.Add(mob); if (PartyList == null) { PartyList = new List <Mobile>(); } if (!PartyList.Contains(mob)) { PartyList.Add(mob); } } } eable.Free(); } if (!list.Contains(Caster)) { list.Add(Caster); } return(list); }
private void UpdatePets(Mobile m) { if (m is PlayerMobile pm) { for (var index = 0; index < pm.AllFollowers.Count; index++) { Mobile pet = pm.AllFollowers[index]; if (!PartyList.Contains(pet) && ValidPartyMember(pet)) { AddPartyMember(pet); } } } }
protected void RemovePartyMember(Mobile m) { PartyList.Remove(m); RemovePartyEffects(m); if (m is PlayerMobile pm) { foreach (Mobile pet in pm.AllFollowers) { if (PartyList.Contains(pet)) { RemovePartyMember(pet); } } } }
protected void AddPartyMember(Mobile m) { PartyList.Add(m); AddPartyEffects(m); if (m is PlayerMobile pm) { foreach (Mobile pet in pm.AllFollowers) { if (!PartyList.Contains(pet) && ValidPartyMember(pet)) { AddPartyMember(pet); } } } }
public PartyList CheckSumPartyScore() { var getData = PartyScoreCollection.Find(it => true).ToList(); var sumHaveScore = getData.Sum(it => it.TotalScore); var sumAreaScore = getData.Sum(it => it.AreaScore); var sumPartyListScore = getData.Sum(it => it.NameListScore); var sumPercentScore = getData.Sum(it => it.PercentScore); var partyScore = new PartyList { TotalScore = sumHaveScore, AreaScore = sumAreaScore, NameListScore = sumPartyListScore, PercentScore = sumPercentScore }; return(partyScore); }
//__________________PARTY LOGIC_______________________________________________________ //add to party public async Task <bool> AddToParty(Character character) { var myData = Dataset.FirstOrDefault(arg => arg.Id == character.Id); if (myData == null) { return(false); } if (PartyList.Count < 6) { PartyList.Add(character.Id); DatasetParty.Add(character); _needsRefresh = true; return(true); } return(false); }
protected void AddPartyMember(Mobile m) { PartyList.Add(m); AddPartyEffects(m); if (m is PlayerMobile pm) { for (var index = 0; index < pm.AllFollowers.Count; index++) { Mobile pet = pm.AllFollowers[index]; if (!PartyList.Contains(pet) && ValidPartyMember(pet)) { AddPartyMember(pet); } } } }
protected void RemovePartyMember(Mobile m) { PartyList.Remove(m); RemovePartyEffects(m); if (m is PlayerMobile pm) { for (var index = 0; index < pm.AllFollowers.Count; index++) { Mobile pet = pm.AllFollowers[index]; if (PartyList.Contains(pet)) { RemovePartyMember(pet); } } } }
public (long candies, long people) CalculateAverageCandies(PartyList partyLists) { var groups = partyLists.List.GroupBy(element => element).ToDictionary(g => g.Key, g => g.Count()); var highestGroup = groups.Keys.Max(); long listRepetitions = 1; for (var i = 0; i < groups.Count; i++) { listRepetitions = Maths.CalculateLeastCommonMultiple(listRepetitions, groups.Keys.ToList()[i]); } long candies = groups.Sum(g => listRepetitions * g.Value); long people = groups.Sum(g => (listRepetitions * g.Value) / g.Key); return(Maths.ReduceFraction(candies, people)); }
public override void EndEffects() { if (PartyList != null) { PartyList.ForEach(m => { BuffInfo.RemoveBuff(m, BuffIcon.PlayingTheOdds); }); } BaseWeapon wep = GetWeapon(); if (wep != null) { wep.InvalidateProperties(); } BuffInfo.RemoveBuff(Caster, BuffIcon.PlayingTheOddsDebuff); Caster.SendLocalizedMessage(1156092); // Your bow range has returned to normal. }
public virtual void Expire(bool disrupt = false) { if (Timer != null) { Timer.Stop(); Timer = null; } if (disrupt && DisruptMessage > 0) { Caster.SendLocalizedMessage(DisruptMessage); } RemoveFromTable(); RemoveStatMods(); EndEffects(); Caster.Delta(MobileDelta.WeaponDamage); if (Target != null) { Target.Delta(MobileDelta.WeaponDamage); } if (PartyList != null) { foreach (Mobile m in PartyList) { m.Delta(MobileDelta.WeaponDamage); } PartyList.Clear(); PartyList.TrimExcess(); } OnExpire(); }