public void Run(User current, Door run) { if (Combatants.Count > 1) { current.Connection.SendMessage("You cannot abandon your allies!"); return; } if (run == null) { current.Connection.SendMessage("There is no escape!"); return; } current.Connection.SendMessage($"You manage to escape {run.Direction}!"); Combatants.Remove(current); current.Player.Combat = null; current.CurrRoomId = run.RoomsIConnect[1]; }
private (Gladiator, Gladiator) PickPair() { var r = new Random(); var eligible = EligibleToFight(Combatants); var first = eligible .OrderBy(x => r.NextDouble()) .First(); var second = eligible .Where(g => g != first) //.OrderBy(g => Math.Abs(g.Victories - first.Victories)) .OrderBy(x => r.NextDouble()) .First(); Combatants.Remove(first); Combatants.Remove(second); return(first, second); }
private void ACTExtension(bool isImport, LogLineEventArgs e) { string[] data = e.logLine.Split('|'); MessageType messageType = (MessageType)Convert.ToInt32(data[0]); switch (messageType) { case MessageType.LogLine: if (Convert.ToInt32(data[2], 16) == 56) { ReadFFxivEcho(data[4]); } break; case MessageType.ChangeZone: ChangeZoneEvent(data); break; case MessageType.ChangePrimaryPlayer: DetectMyName(data); break; case MessageType.AddCombatant: if (!Combatants.ContainsKey(data[2])) { CombatData cd = new CombatData(); cd.PlayerID = Convert.ToUInt32(data[2], 16); cd.PlayerJob = Convert.ToUInt32(data[4], 16); cd.PlayerName = data[3]; cd.MaxHP = cd.CurrentHP = Convert.ToInt64(data[5], 16); cd.MaxMP = cd.CurrentMP = Convert.ToInt64(data[6], 16); if (data[8] != "0") { cd.IsPet = true; cd.OwnerID = Convert.ToUInt32(data[8]); } Combatants.Add(data[2], cd); SendCombatantList(); } break; case MessageType.RemoveCombatant: if (Combatants.ContainsKey(data[2])) { Combatants.Remove(data[2]); SendCombatantList(); } break; case MessageType.PartyList: UpdatePartyList(data); break; case MessageType.NetworkStartsCasting: case MessageType.NetworkCancelAbility: case MessageType.NetworkDoT: case MessageType.NetworkDeath: case MessageType.NetworkBuff: case MessageType.NetworkTargetIcon: case MessageType.NetworkRaidMarker: case MessageType.NetworkTargetMarker: case MessageType.NetworkBuffRemove: break; case MessageType.NetworkAbility: case MessageType.NetworkAOEAbility: Ability(messageType, data); break; } }