コード例 #1
0
        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);
        }
コード例 #2
0
        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());
        }
コード例 #3
0
        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}");
                }
            }
        }
コード例 #4
0
ファイル: GameManagement.cs プロジェクト: shooon3/20171019
    // 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);
    }
コード例 #5
0
ファイル: RaidService.cs プロジェクト: danifischer/raidbot
 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);
 }
コード例 #6
0
ファイル: Raid.cshtml.cs プロジェクト: BenneMe/RaidBattlesBot
        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());
        }
コード例 #7
0
        public void DestroyTimer(Raid raid)
        {
            Timer raidTimer;

            if (timers.TryGetValue(raid, out raidTimer))
            {
                if (!raidTimer.Destroyed)
                {
                    raidTimer.Destroy();
                }

                timers.Remove(raid);
            }
        }
コード例 #8
0
ファイル: RaidService.cs プロジェクト: nillertron/DiscordBot
        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);
        }
コード例 #9
0
        // 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));
        }
コード例 #10
0
ファイル: RaidController.cs プロジェクト: Strengol/ASP.NET-
        // 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));
        }
コード例 #11
0
ファイル: RaidController.cs プロジェクト: Strengol/ASP.NET-
        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));
        }
コード例 #12
0
    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));
    }
コード例 #13
0
    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));
    }
コード例 #14
0
        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);
        }
コード例 #15
0
        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));
        }
コード例 #16
0
ファイル: PlayerController.cs プロジェクト: shooon3/20171019
 // 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;                                   // 元スピードは最初に取得したスピードに
     //}
 }
コード例 #17
0
 /// <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");
 }
コード例 #18
0
        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));
        }
コード例 #19
0
ファイル: RaidService.cs プロジェクト: YossiMelcer/RaidBot
        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);
            }
        }
コード例 #20
0
        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);
        }
コード例 #21
0
        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));
        }
コード例 #22
0
ファイル: Capturable.cs プロジェクト: Emerax/TNM095
    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);
        }
    }
コード例 #23
0
        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;
        }
コード例 #24
0
        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?");
            }
        }
コード例 #25
0
        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);
        }
コード例 #26
0
        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);
            }
        }
コード例 #27
0
        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;
        }
コード例 #28
0
ファイル: RaidController.cs プロジェクト: Strengol/ASP.NET-
        // 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));
        }
コード例 #29
0
 /// <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
     });
 }
コード例 #30
0
        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();
        }
コード例 #31
0
        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);
        }
コード例 #32
0
ファイル: SignUpConversation.cs プロジェクト: Linaith/raidbot
        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);
        }
コード例 #33
0
ファイル: RaidStore.cs プロジェクト: anxkha/DRM
        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;
                }
            }
        }