Beispiel #1
0
 public UserAccount(bool newuser)
 {
     HasCharacter          = false;
     PromptState           = -1;
     ReactionMessages      = new Dictionary <ulong, int>();
     InviteMessages        = new Dictionary <ulong, ulong>();
     ExpectedInput         = -1;
     ExpectedInputLocation = 0;
     CombatLobby           = null;
 }
Beispiel #2
0
 public CombatCreationTool GetOrCreatePvPLobby(String type, ulong userid)
 {
     if (HasLobby())
     {
         return(CombatLobby);
     }
     else
     {
         CombatLobby = new CombatCreationTool("single", userid);
         CombatLobby.AddPlayer(this);
         return(CombatLobby);
     }
 }
        public static Bitmap PvPSoloLobby(CombatCreationTool tool)
        {
            Image back = Image.FromFile("C:\\Users\\lifei_jljypee\\Desktop\\Discomon Project\\DiscomonProject\\Assets\\UI Assets\\combatlobby.png");

            if (back == null)
            {
                throw new ArgumentNullException("background");
            }

            Image leader = Image.FromFile("C:\\Users\\lifei_jljypee\\Desktop\\Discomon Project\\DiscomonProject\\Assets\\UI Assets\\leader.png");

            if (leader == null)
            {
                throw new ArgumentNullException("leaderImage");
            }

            int    leaderWidth  = (int)(leader.Width * 0.2);
            int    leaderHeight = (int)(leader.Height * 0.2);
            Bitmap leaderImage  = new Bitmap(leaderWidth, leaderHeight, System.Drawing.Imaging.PixelFormat.Format32bppArgb);

            int    finalImageWidth  = back.Width;
            int    finalImageHeight = back.Height;
            Bitmap finalImage       = new Bitmap(finalImageWidth, finalImageHeight, System.Drawing.Imaging.PixelFormat.Format32bppArgb);

            using (Graphics graphics = Graphics.FromImage(finalImage))
            {
                graphics.DrawImage(back, new Rectangle(new Point(), back.Size),
                                   new Rectangle(new Point(), back.Size), GraphicsUnit.Pixel);

                Font electrolizeSmall = new Font("Electrolize", 56);
                Font electrolizeLarge = new Font("Electrolize", 66);

                int crownVal = 70;
                int xVal     = 180;
                foreach (Team t in tool.Teams)
                {
                    if (t.MemberIDs.Count != 0)
                    {
                        graphics.DrawString($"{UserHandler.GetUser(t.MemberIDs[0]).Char.Name}", electrolizeLarge, Brushes.White, new PointF(xVal, 260));
                        if (t.MemberIDs[0] == tool.PartyLeader)
                        {
                            graphics.DrawImage(leader, new Rectangle(crownVal, 250, 100, 100), new Rectangle(new Point(), leader.Size), GraphicsUnit.Pixel);
                        }
                    }
                    else
                    {
                        graphics.DrawString($"- - - -", electrolizeLarge, Brushes.White, new PointF(xVal, 260));
                    }

                    xVal     += 1170;
                    crownVal += 1170;
                }

                Brush selected    = new SolidBrush(Color.FromArgb(43, 121, 195));
                Brush nonselected = Brushes.Gray;

                Brush NatBrush      = selected;
                Brush CapBrush      = selected;
                Brush ItemsOnBrush  = selected;
                Brush ItemsOffBrush = selected;

                Brush OneBrush   = nonselected;
                Brush TwoBrush   = nonselected;
                Brush ThreeBrush = nonselected;
                Brush FourBrush  = nonselected;
                Brush FiveBrush  = nonselected;
                Brush SixBrush   = nonselected;

                if (tool.NaturalLevels)
                {
                    CapBrush = nonselected;
                }
                else
                {
                    NatBrush = nonselected;
                }

                if (tool.ItemsOn)
                {
                    ItemsOffBrush = nonselected;
                }
                else
                {
                    ItemsOnBrush = nonselected;
                }

                switch (tool.MonsPerTeam)
                {
                case 1:
                    OneBrush = selected;
                    break;

                case 2:
                    TwoBrush = selected;
                    break;

                case 3:
                    ThreeBrush = selected;
                    break;

                case 4:
                    FourBrush = selected;
                    break;

                case 5:
                    FiveBrush = selected;
                    break;

                case 6:
                    SixBrush = selected;
                    break;
                }

                graphics.DrawString($"Natural", electrolizeSmall, NatBrush, new PointF(415, 710));
                graphics.DrawString($"/", electrolizeSmall, Brushes.White, new PointF(700, 710));
                graphics.DrawString($"Capped", electrolizeSmall, CapBrush, new PointF(770, 710));

                graphics.DrawString($"On", electrolizeSmall, ItemsOnBrush, new PointF(415, 840));
                graphics.DrawString($"/", electrolizeSmall, Brushes.White, new PointF(540, 840));
                graphics.DrawString($"Off", electrolizeSmall, ItemsOffBrush, new PointF(600, 840));

                graphics.DrawString($"6", electrolizeSmall, SixBrush, new PointF(415, 970));
                graphics.DrawString($"/", electrolizeSmall, Brushes.White, new PointF(495, 970));
                graphics.DrawString($"5", electrolizeSmall, FiveBrush, new PointF(575, 970));
                graphics.DrawString($"/", electrolizeSmall, Brushes.White, new PointF(655, 970));
                graphics.DrawString($"4", electrolizeSmall, FourBrush, new PointF(735, 970));
                graphics.DrawString($"/", electrolizeSmall, Brushes.White, new PointF(815, 970));
                graphics.DrawString($"3", electrolizeSmall, ThreeBrush, new PointF(895, 970));
                graphics.DrawString($"/", electrolizeSmall, Brushes.White, new PointF(975, 970));
                graphics.DrawString($"2", electrolizeSmall, TwoBrush, new PointF(1055, 970));
                graphics.DrawString($"/", electrolizeSmall, Brushes.White, new PointF(1135, 970));
                graphics.DrawString($"1", electrolizeSmall, OneBrush, new PointF(1215, 970));
            }

            return(finalImage);
        }