private void updateUI() { if (PushQueue == true) { int ran = Random.Range(1, 4); //if (ran == 3) // ran = 100; AttackQueue.Enqueue(ran); PushQueue = false; } if (PopQueue == true) { AttackQueue.Dequeue(); PopQueue = false; } if (AttackQueue.Count <= 0) { return; } int headCase = AttackQueue.Peek(); HeroCase = headCase; }
void Start() { enemy_queue = new AttackQueue(); player_queue = new AttackQueue(); }
private void SetEphemeralValues() { ObjectDescriptionFlags |= ObjectDescriptionFlag.Player; // This is the default send upon log in and the most common. Anything with a velocity will need to add that flag. // This should be handled automatically... //PositionFlags |= PositionFlags.OrientationHasNoX | PositionFlags.OrientationHasNoY | PositionFlags.IsGrounded | PositionFlags.HasPlacementID; FirstEnterWorldDone = false; SetStance(MotionStance.NonCombat, false); // radius for object updates ListeningRadius = 5f; if (Session != null && Common.ConfigManager.Config.Server.Accounts.OverrideCharacterPermissions) { if (Session.AccessLevel == AccessLevel.Admin) { IsAdmin = true; } if (Session.AccessLevel == AccessLevel.Developer) { IsArch = true; } if (Session.AccessLevel == AccessLevel.Envoy || Session.AccessLevel == AccessLevel.Sentinel) { IsSentinel = true; } if (Session.AccessLevel == AccessLevel.Advocate) { IsAdvocate = true; } } ContainerCapacity = (byte)(7 + AugmentationExtraPackSlot); if (Session != null && AdvocateQuest && IsAdvocate) // Advocate permissions are per character regardless of override { if (Session.AccessLevel == AccessLevel.Player) { Session.SetAccessLevel(AccessLevel.Advocate); // Elevate to Advocate permissions } if (AdvocateLevel > 4) { IsPsr = true; // Enable AdvocateTeleport via MapClick } } CombatTable = DatManager.PortalDat.ReadFromDat <CombatManeuverTable>(CombatTableDID.Value); _questManager = new QuestManager(this); ContractManager = new ContractManager(this); ConfirmationManager = new ConfirmationManager(this); LootPermission = new Dictionary <ObjectGuid, DateTime>(); SquelchManager = new SquelchManager(this); MagicState = new MagicState(this); RecordCast = new RecordCast(this); AttackQueue = new AttackQueue(this); return; // todo // ======================================= // This code was taken from the old Load() // ======================================= /*AceCharacter character; * * if (Common.ConfigManager.Config.Server.Accounts.OverrideCharacterPermissions) * { * if (Session.AccessLevel == AccessLevel.Admin) * character.IsAdmin = true; * if (Session.AccessLevel == AccessLevel.Developer) * character.IsArch = true; * if (Session.AccessLevel == AccessLevel.Envoy) * character.IsEnvoy = true; * // TODO: Need to setup and account properly for IsSentinel and IsAdvocate. * // if (Session.AccessLevel == AccessLevel.Sentinel) * // character.IsSentinel = true; * // if (Session.AccessLevel == AccessLevel.Advocate) * // character.IsAdvocate= true; * }*/ // FirstEnterWorldDone = false; // IsAlive = true; }
private void button1_Click(object sender, EventArgs e) { // 解析攻击目标的坐标 if (this.txtX.Text == "" && this.txtY.Text == "" && this.textCoord.Text == "") { return; } else if (this.txtX.Text != "" || this.txtY.Text != "") { // 单目标情况 int x = 0, y = 0; Int32.TryParse(this.txtX.Text, out x); Int32.TryParse(this.txtY.Text, out y); var aTargets = new TPoint(x, y); iTargets.Add(aTargets); } else { // 多目标情况,格式:"xxx|yyy,xxx|yyy" if (!this.textCoord.Text.Contains(",")) { return; } string[] multipletargets = this.textCoord.Text.Split(','); for (int i = 0; i < multipletargets.Length; i++) { if (!multipletargets[i].Contains("|")) { continue; } string[] id = multipletargets[i].Split('|'); int x1 = 0, y1 = 0; Int32.TryParse(id[0], out x1); Int32.TryParse(id[1], out y1); TPoint tid = new TPoint(x1, y1); if (!tid.IsEmpty) { iTargets.Add(tid); } } } // 检查部队设置的数量是否超过现有的数量 for (int i = 0; i < 11; i++) { int totalattack = Convert.ToInt32(this.numericUpDown1.Value) * iTargets.Count; int[] totalraidtroops = new int[11]; int totaltroops = 0; int[] raidtroops = new int[11]; for (int j = 0; j < 5; j++) { int wv = Convert.ToInt32(Waves[j].Value); raidtroops[i] = Convert.ToInt32(Nums[j, i].Value); totaltroops = totaltroops + (raidtroops[i] * wv); } totalraidtroops[i] = totaltroops; if (totalraidtroops[i] * totalattack > Troops[i]) { var Nt = MessageBox.Show("No Enough Troop"); return; } } for (int j = 0; j < 5; j++) { int wv = Convert.ToInt32(Waves[j].Value); int[] raidtroops = new int[11]; int totaltroops = 0; for (int i = 0; i < 11; i++) { raidtroops[i] = Convert.ToInt32(Nums[j, i].Value); totaltroops = totaltroops + raidtroops[i]; } if (wv != 0 && totaltroops != 0) { TTInfo mTargets = new TTInfo { Troops = raidtroops }; nWaves.Add(wv); nTargets.Add(mTargets); } } if (nWaves.Count == 0 || nTargets.Count == 0 || iTargets.Count == 0) { if (!this.checkBox2.Checked) { return; } } Return = new AttackQueue { Raidtype = this.checkBox2.Checked ? 1 : this.comboBox3.SelectedIndex + 2, Targets = iTargets, wTroops = nTargets, wWaves = nWaves, VillageID = VillageID, kata = this.comboBox1.SelectedIndex, kata2 = this.comboBox2.SelectedIndex, Settlers = this.checkBox2.Checked, MinimumInterval = minimumInterval, NextExec = actionAt, }; }