private void MakeNewRaid() { IList<HardDrive> selectedHardDrives = new List<HardDrive>(); //IList<HardDrive> selectedHardDrives = (from object item in checkedListBoxOfHardDrives.CheckedItems select checkedListBoxOfHardDrives.Items.IndexOf(item) into i select SelectableHardDrives.ElementAt(i)).ToList(); foreach (object item in checkedListBoxOfHardDrives.CheckedItems) { int i = checkedListBoxOfHardDrives.Items.IndexOf(item); selectedHardDrives.Add(SelectableHardDrives.ElementAt(i)); } string HardOrSoft = RadioButtonListUtilities.ExtractTextFromRadioButtonGroup(groupBoxHardwareOrSoftware); RaidType raidType; if (HardOrSoft.ToUpper() == "HARDWARE") { raidType = RaidType.Hardware; } else { raidType = RaidType.Software; } NewRaid = new Raid { //raid information SoftwareOrHardware = raidType, RaidType = txtTypeofRaid.Text, RaidLevel = RadioButtonListUtilities.ExtractTextFromRadioButtonGroup(groupBoxRaidLevel), AssociatedHardDrives = selectedHardDrives }; selectedHardDrives.ToList().ForEach(hd => hd.ReferenceRaid = NewRaid); }
public async Task <IActionResult> OnGetAsync(int raidId, CancellationToken cancellationToken = default) { Raid = await myDbContext .Set <Raid>() .FindAsync(new object[] { raidId }, cancellationToken); if (Raid == null) { return(NotFound($"Raid {raidId} not found.")); } return(Page()); }
private async Task WriteToChat(string message, Raid raid) { DiscordServer server = _userService.GetServer(raid.GuildId); if (server.LogChannelId != 0) { SocketTextChannel channel = (SocketTextChannel)_client.GetChannel(server.LogChannelId); if (channel != null) { await channel.SendMessageAsync($"{raid.Title}: {message}"); } } }
// Use this for initialization void Start() { audiosource = GetComponent <AudioSource>(); audiosource.clip = bgm; audiosource.Play(); GameObject statusObj = GameObject.Find("Status"); guimanager = statusObj.GetComponent <GUIManager>(); raid = statusObj.GetComponent <Raid>(); PlayerInfoInit(); PlayerMoneyInit(); escapeObj.SetActive(false); }
public bool TryFindRaid(ulong GuildId, ulong ChannelId, ulong MessageId, out Raid raid) { foreach (var r in Raids) { if (r.Value.GuildId.Equals(GuildId) && r.Value.ChannelId.Equals(ChannelId) && r.Value.MessageId.Equals(MessageId)) { raid = r.Value; return(true); } } raid = null; return(false); }
public async Task <IActionResult> OnGetAsync(int raidId, CancellationToken cancellationToken = default) { Raid = await myDbContext .Set <Raid>() .Where(_ => _.Id == raidId) .FirstOrDefaultAsync(cancellationToken); if (Raid == null) { return(NotFound($"Raid {raidId} not found.")); } return(Page()); }
public void DestroyTimer(Raid raid) { Timer raidTimer; if (timers.TryGetValue(raid, out raidTimer)) { if (!raidTimer.Destroyed) { raidTimer.Destroy(); } timers.Remove(raid); } }
public Raid Create(string input, string discordId, string guildId) { var splitIndex = Helpers.FindBindingInString(input, '-'); var raidtitle = input.Substring(0, splitIndex).Trim(); input = input.Substring(splitIndex + 1, input.Length - splitIndex - 1).TrimStart(); var raidday = Convert.ToDateTime(input); var raid = new Raid { CreatedByUser = discordId, GuildId = guildId, RaidActive = true, RaidDay = raidday, RaidTitle = raidtitle }; db.Create(raid); return(raid); }
// GET: Raids/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Raid raid = db.Raid.Find(id); if (raid == null) { return(HttpNotFound()); } return(View("~/Views/Admin/Raids/Delete.cshtml", raid)); }
// GET: Raid/Delete public async Task <ActionResult> Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Raid raid = await db.Raid.FindAsync(id); if (raid == null) { return(HttpNotFound()); } return(View(raid)); }
public async Task <ActionResult> Create([Bind(Include = "Id,Nazwa,LokacjaId,TypId")] Raid raid) { if (ModelState.IsValid) { db.Raid.Add(raid); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.LokacjaId = new SelectList(db.Lokacja, "Id", "Nazwa", raid.LokacjaId); ViewBag.TypId = new SelectList(db.Typ, "Id", "Nazwa", raid.TypId); return(View(raid)); }
int CalculateDamageTaken(Raid r, bool isWin) { float percentHealth; if (isWin) { percentHealth = Random.Range(0f, 0.1f); } else { percentHealth = Random.Range(0.5f, 1f); } return(Mathf.RoundToInt(r.raider.currHealth * percentHealth)); }
int CalculateCrewLost(Raid r, bool isWin) { float percentCrewLost; if (isWin) { percentCrewLost = Random.Range(0f, 0.2f); } else { percentCrewLost = Random.Range(0.5f, 1f); } return(Mathf.RoundToInt(r.raider.currCrewCapacity * percentCrewLost)); }
private void AddRaidMarker(Raid r) { var mOps = new MarkerOptions(); mOps.SetPosition(r.Location); mOps.SetIcon(BitmapDescriptorFactory.FromBitmap(GetRaidMarker(r))); mOps.Anchor(0.5f, 0.5f); var marker = map.AddMarker(mOps); marker.Tag = $"raid:{r.id}"; r.RaidMarker = marker; raidsVisible.Add(r); }
private string getProgression(int raidNumber) { Raid raid = _character.progression.raids[raidNumber]; string mode = ""; int[] bossesKilled = { 0, 0, 0, 0 }; int returnBossesKilled = 0; for (int i = 0; i < raid.bosses.Length; i++) { if (raid.bosses[i].lfrKills > 0) { bossesKilled[0]++; } if (raid.bosses[i].normalKills > 0) { bossesKilled[1]++; } if (raid.bosses[i].heroicKills > 0) { bossesKilled[2]++; } if (raid.bosses[i].mythicKills > 0) { bossesKilled[3]++; } } for (int j = bossesKilled.Length - 1; j >= 0; j--) { if (bossesKilled[j] > 0) { switch (j) { case 1: mode = "N"; break; // Normal case 2: mode = "H"; break; // Heroic case 3: mode = "M"; break; // Mythic } returnBossesKilled = bossesKilled[j]; break; } } return(String.Format("{0}/{1}{2}", returnBossesKilled, raid.bosses.Length, mode)); }
// Use this for initialization void Start() { gm = GameObject.FindGameObjectWithTag("GameMaster").GetComponent <GameManagement>(); cc = GetComponent <CharacterController>(); // キャラクターコントローラーコンポーネントを取得 // ステータスオブジェクトの名前を参照し格納、CharactorStatusコンポーネントを取得 statusObj = GameObject.Find(statusName); raid = GameObject.Find("Status").GetComponent <Raid>(); charactorstatus = statusObj.GetComponent <CharactorStatus>(); guimanager = statusObj.GetComponent <GUIManager>(); rescueObj.SetActive(false); CharactorSetup(); // キャラクターステータスの初期設定 playerCam = GameObject.Find(camName).GetComponent <Camera>(); // カメラの情報を格納 originSpeed = charactorSpeed; // 元スピードは最初に取得したスピードに //} }
/// <summary> /// initialize service /// </summary> /// <param name="args">-D = debugging on</param> protected override void OnStart(string[] args) { Deltabyte.Info.Logger.log(this, string.Format("start {0} [{1}]", AppDomain.CurrentDomain.FriendlyName, System.Reflection.Assembly.GetEntryAssembly().GetName().Version)); if (args.Length > 0 && args[0] == "-D") { Logout = true; } raid = new Raid(Logout); Deltabyte.Info.Logger.log(this, "raid opened"); Periodic = new System.Timers.Timer(); Periodic.Interval = 10000; Periodic.Elapsed += new System.Timers.ElapsedEventHandler(this.OnTimer); Periodic.Start(); Deltabyte.Info.Logger.log(this, "timer started"); }
public async Task <ulong> RepostRaidMessage(Raid raid) { SocketTextChannel channel = (SocketTextChannel)_client.GetChannel(raid.ChannelId); if (channel != null) { IUserMessage userMessage = (IUserMessage)await channel.GetMessageAsync(raid.MessageId); if (userMessage != null) { await userMessage.DeleteAsync(); } } return(await PostRaidMessageAsync(channel, raid)); }
public bool AddRaids(Raid raid) { var raids = _raidFileService.GetRaidsFromFile(); if (raids.Any(a => a.Equals(raid))) { return(false); } else { raids.Add(raid); _raidFileService.PushRaidsToFile(raids); return(true); } }
public void SetAssemblingTrue(Raid raid) { if (raid.IsAssembling == true) { return; } raid.IsAssembling = true; Raids raids = mapperRaidToRaids.Map <Raid, Raids>(raid); files.Update <Raids>(raids, FileTypes.CurrentRaids); SendRaidTable(raid); }
public async Task <Encounter> AddEncounter(Raid raid, Boss boss) { Console.WriteLine("EncounterService::AddEncounter"); var jsonToPost = JsonConvert.SerializeObject(boss); var path = $"rest/raids/{raid.Id}/encounters"; Console.WriteLine($"POSTing to {path}"); var result = await httpClient.PostAsync(path, new StringContent(jsonToPost, Encoding.UTF8, "application/json")); result.EnsureSuccessStatusCode(); var json = await result.Content.ReadAsStringAsync(); return(JsonConvert.DeserializeObject <Encounter>(json)); }
public void BeginRaid(Capturable target) { int raidCount = unitCount / 2; if (raidCount > 0 && (target.owner != owner || target.unitCount < target.unitCap) && target != this) { unitCount -= raidCount; Vector3 targetVector = target.transform.position - transform.position; Raid raid = Instantiate(raidPrefab, transform.position, Quaternion.LookRotation(targetVector, Vector3.up)); raid.Init(owner, transform.parent, target, raidCount); unitIndicator.UpdateText(trainingID + ": (" + unitCount.ToString() + ")", owner); } }
public override Server CreateServer() { var ram = new Ram((int)RamType.GB8); var videoCard = new VideoCard(); var motherBoard = new Motherboard(ram, videoCard); var cpu = new AdvancedCpu(2, (int)ArchitectureType.Bits128, motherBoard); var hardDriveOne = new HardDrive(500); var hardDriveTwo = new HardDrive(500); var raid = new Raid(500); raid.Add(hardDriveOne); raid.Add(hardDriveTwo); var server = new Server(motherBoard, cpu, raid); return server; }
public void RaidTest() { Game game; if (Game.TryGetGame("Anarchy Online", out game)) { Community community; if (Community.TryFindCommunity("Iraid Test", game, out community)) { // Stopping any previously running raids. IEnumerable <Raid> Raids = community.RaidRunning(); foreach (var r in Raids.ToList()) { r.Stop(); } RaidInfo raid; if (community.TryFindRaid("Test Raid 1", out raid)) { Raid r = raid.Start(); r.UserJoin(Character.FindFirst(x => x.Nick == "Kitessolja")); r.UserLeave(Character.FindFirst(x => x.Nick == "Kitessolja")); r.LeaderAddMember(Character.FindFirst(x => x.Nick == "Kitessolja")); r.LeaderKickMember(Character.FindFirst(x => x.Nick == "Kitessolja")); Console.WriteLine("Raid Successfully started."); //r.Stop(); } else { throw new Exception("RaidInfo not found, not warmed up yet?"); } } else { throw new Exception("Community not found, not warmed up yet?"); } } else { throw new Exception("Game not found, not warmed up yet?"); } }
public bool ProcessVenue(Venue venue, Raid raid) { if (VenueTitleParser.Match(venue.Title) is var match && match.Success) { var pokemon = match.Groups["title"].Value; raid.Pokemon = myPokemonInfo.GetPokemonNumber(pokemon); raid.Name = pokemon; raid.RaidBossLevel = myPokemonInfo.GetRaidBossLevel(pokemon); ProcessMoves(venue.Address, raid); return(true); } return(false); }
private static void ShowCorrectPlayerUI(List <CheckPlayer> players, Raid raid, Action <Delegate> invoker) { Action a = () => { var ui = new GUIs.CorrectPlayer.CorrectPlayerUI(raid, players); ui.ShowDialog(); }; if (invoker == null) { a(); } else { invoker(a); } }
protected override void Handle(Client client, RaidMbfPacket packet) { if (client.Character == null || client.Character.Raid == null) { return; } Raid raid = client.Character.Raid; raid.ButtonLockerCurrent = packet.ButtonLockerCurrent; raid.ButtonLockerInitial = packet.ButtonLockerInitial; raid.MonsterLockerCurrent = packet.MonsterLockerCurrent; raid.MonsterLockerInitial = packet.MonsterLockerInitial; raid.CurrentLifes = packet.CurrentLifes; raid.InitialLifes = packet.InitialLifes; }
// GET: Raid/Edit public async Task <ActionResult> Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Raid raid = await db.Raid.FindAsync(id); if (raid == null) { return(HttpNotFound()); } ViewBag.LokacjaId = new SelectList(db.Lokacja, "Id", "Nazwa", raid.LokacjaId); ViewBag.TypId = new SelectList(db.Typ, "Id", "Nazwa", raid.TypId); return(View(raid)); }
/// <summary> /// creates a new <see cref="TwitchAccountChat"/> /// </summary> /// <param name="channel"></param> /// <param name="usermodule"></param> /// <param name="imagecache"></param> public TwitchAccountChat(ChatChannel channel, UserModule usermodule, ImageCacheModule imagecache) : base(channel, usermodule, imagecache) { channel.Raid += notice => Raid?.Invoke(this, new RaidInformation() { Service = TwitchConstants.ServiceKey, Login = notice.Login, DisplayName = notice.DisplayName, Color = notice.Color, Avatar = notice.Avatar, Channel = notice.Channel, RaiderCount = notice.RaiderCount, RoomID = notice.RoomID, SystemMessage = notice.SystemMessage }); }
public void StopRaid(Raid raid) { foreach (ulong part in raid.participants) { BasePlayer partPlayer = BasePlayer.FindByID(part); if (partPlayer != null && partPlayer.GetComponent <RaidBehavior>() != null) { GameObject.Destroy(partPlayer.GetComponent <RaidBehavior>()); } } DestroyTimer(raid); raid.end = DateTime.Now; raid.OnEnded(); }
void ReceiveRaidNotice(IrcMessage message) { RaidNotice raid = new RaidNotice(); foreach (IrcTag attribute in message.Tags) { if (string.IsNullOrEmpty(attribute.Value)) { continue; } switch (attribute.Key) { case "color": raid.Color = attribute.Value; break; case "msg-param-displayName": case "display-name": raid.DisplayName = attribute.Value; break; case "msg-param-login": case "login": raid.Login = attribute.Value; break; case "msg-param-profileImageURL": raid.Avatar = attribute.Value; break; case "msg-param-viewerCount": raid.RaiderCount = int.Parse(attribute.Value); break; case "room-id": raid.RoomID = attribute.Value; break; case "system-msg": raid.SystemMessage = attribute.Value; break; } } Raid?.Invoke(raid); }
private static string CreateFlexRoleMessage(Raid raid) { string sendMessage = "Pick a flex role("; bool start = true; foreach (Role role in raid.Roles) { if (!start) { sendMessage += ", "; } sendMessage += role.Name; start = false; } sendMessage += ") or type cancel to cancel role selection."; return(sendMessage); }
private void EnsureLoaded() { using (new ReaderLock(_lock)) { if (_loaded) return; using (new WriterLock(_lock)) { if (_loaded) return; Connection.ExecuteSql(new Query(RAID_SELECT), delegate(SqlDataReader reader) { while (reader.Read()) { if (null != _cache.Find(s => reader[0].ToString() == s.Name)) return; var newRaid = new Raid() { Name = reader[0].ToString(), Expansion = reader[1].ToString(), MaxPlayers = (int)reader[2], MinimumLevel = (int)reader[3], NumberOfBosses = (int)reader[4] }; _cache.Add(newRaid); } }); _loaded = true; } } }