示例#1
0
            public InternalBuyInfo()
            {
                Add(new GenericBuyInfo("Bolt of Cloth", typeof(BoltOfCloth), Bandage.GetSBPurchaseValue(), 50, 0xf95, 0));

                Add(new GenericBuyInfo("Scissors", typeof(Scissors), Scissors.GetSBPurchaseValue(), 25, 0xF9F, 0));
                Add(new GenericBuyInfo("Sewing Kit", typeof(SewingKit), SewingKit.GetSBPurchaseValue(), 50, 0xF9D, 0));
                Add(new GenericBuyInfo("Dyes", typeof(Dyes), Dyes.GetSBPurchaseValue(), 25, 0xFA9, 0));
                Add(new GenericBuyInfo("Dye Tub", typeof(DyeTub), DyeTub.GetSBPurchaseValue(), 25, 0xFAB, 0));
            }
示例#2
0
            public InternalSellInfo()
            {
                Add(typeof(BoltOfCloth), BoltOfCloth.GetSBSellValue());

                Add(typeof(Scissors), Scissors.GetSBSellValue());
                Add(typeof(SewingKit), SewingKit.GetSBSellValue());
                Add(typeof(Dyes), Dyes.GetSBSellValue());
                Add(typeof(DyeTub), DyeTub.GetSBSellValue());
            }
示例#3
0
 public LogPacket(string text, Dyes dye, bool isBold, bool isFixed, bool isLineBreak)
 {
     Timestamp   = DateTime.Now;
     Dye         = dye;
     Text        = text;
     IsBold      = isBold;
     IsFixed     = isFixed;
     IsLineBreak = isLineBreak;
 }
示例#4
0
            public InternalBuyInfo()
            {
                Add(new GenericBuyInfo("Bolt of Cloth", typeof(BoltOfCloth), BoltOfCloth.GetSBPurchaseValue(), 50, 0xf95, 0));

                Add(new GenericBuyInfo("Scissors", typeof(Scissors), Scissors.GetSBPurchaseValue(), 25, 0xF9F, 0));
                Add(new GenericBuyInfo("Sewing Kit", typeof(SewingKit), SewingKit.GetSBPurchaseValue(), 50, 0xF9D, 0));
                Add(new GenericBuyInfo("Dyes", typeof(Dyes), Dyes.GetSBPurchaseValue(), 25, 0xFA9, 0));
                Add(new GenericBuyInfo("Dye Tub", typeof(DyeTub), DyeTub.GetSBPurchaseValue(), 25, 0xFAB, 0));

                //Hats
                Add(new GenericBuyInfo("Skull Cap", typeof(SkullCap), SkullCap.GetSBPurchaseValue(), 25, 0x1544, 0));
                Add(new GenericBuyInfo("Bandana", typeof(Bandana), Bandana.GetSBPurchaseValue(), 25, 0x1540, 0));
                Add(new GenericBuyInfo("Floppy Hat", typeof(FloppyHat), FloppyHat.GetSBPurchaseValue(), 25, 0x1713, 0));
                Add(new GenericBuyInfo("Cap", typeof(Cap), Cap.GetSBPurchaseValue(), 25, 0x1715, 0));
                Add(new GenericBuyInfo("Wide Brim Hat", typeof(WideBrimHat), WideBrimHat.GetSBPurchaseValue(), 25, 0x1714, 0));
                Add(new GenericBuyInfo("Tall Straw Hat", typeof(TallStrawHat), TallStrawHat.GetSBPurchaseValue(), 25, 0x1716, 0));
                Add(new GenericBuyInfo("Bonnet", typeof(Bonnet), Bonnet.GetSBPurchaseValue(), 25, 0x1719, 0));
                Add(new GenericBuyInfo("Feathered Hat", typeof(FeatheredHat), FeatheredHat.GetSBPurchaseValue(), 25, 0x171A, 0));
                Add(new GenericBuyInfo("Tricorne Hat", typeof(TricorneHat), TricorneHat.GetSBPurchaseValue(), 25, 0x171B, 0));
                Add(new GenericBuyInfo("Jester Hat", typeof(JesterHat), JesterHat.GetSBPurchaseValue(), 25, 0x171C, 0));
                Add(new GenericBuyInfo("Wizards Hat", typeof(WizardsHat), WizardsHat.GetSBPurchaseValue(), 25, 0x1718, 0));

                //Shirts
                Add(new GenericBuyInfo("Doublet", typeof(Doublet), Doublet.GetSBPurchaseValue(), 25, 0x1F7B, 0));
                Add(new GenericBuyInfo("Shirt", typeof(Shirt), Shirt.GetSBPurchaseValue(), 25, 0x1517, 0));
                Add(new GenericBuyInfo("Fancy Shirt", typeof(FancyShirt), FancyShirt.GetSBPurchaseValue(), 25, 0x1EFD, 0));
                Add(new GenericBuyInfo("Tunic", typeof(Tunic), Tunic.GetSBPurchaseValue(), 25, 0x1FA1, 0));
                Add(new GenericBuyInfo("Surcoat", typeof(Surcoat), Surcoat.GetSBPurchaseValue(), 25, 0x1FFD, 0));
                Add(new GenericBuyInfo("Jester Suit", typeof(JesterSuit), JesterSuit.GetSBPurchaseValue(), 25, 0x1F9F, 0));
                Add(new GenericBuyInfo("Plain Dress", typeof(PlainDress), PlainDress.GetSBPurchaseValue(), 25, 0x1F01, 0));
                Add(new GenericBuyInfo("Fancy Dress", typeof(FancyDress), FancyDress.GetSBPurchaseValue(), 25, 0x1EFF, 0));
                Add(new GenericBuyInfo("Robe", typeof(Robe), Robe.GetSBPurchaseValue(), 25, 0x1F03, 0));

                //Pants
                Add(new GenericBuyInfo("Short Pants", typeof(ShortPants), ShortPants.GetSBPurchaseValue(), 25, 0x152E, 0));
                Add(new GenericBuyInfo("Long Pants", typeof(LongPants), LongPants.GetSBPurchaseValue(), 25, 0x1539, 0));
                Add(new GenericBuyInfo("Kilt", typeof(Kilt), Kilt.GetSBPurchaseValue(), 25, 0x1537, 0));
                Add(new GenericBuyInfo("Skirt", typeof(Skirt), Skirt.GetSBPurchaseValue(), 25, 0x1516, 0));

                Add(new GenericBuyInfo("Cloak", typeof(Cloak), Cloak.GetSBPurchaseValue(), 25, 0x1515, 0));
                Add(new GenericBuyInfo("Body Sash", typeof(BodySash), BodySash.GetSBPurchaseValue(), 25, 0x1541, 0));
                Add(new GenericBuyInfo("Half Apron", typeof(HalfApron), HalfApron.GetSBPurchaseValue(), 25, 0x153b, 0));
                Add(new GenericBuyInfo("Full Apron", typeof(FullApron), FullApron.GetSBPurchaseValue(), 25, 0x153d, 0));

                //Shoes
                Add(new GenericBuyInfo("Sandals", typeof(Sandals), Sandals.GetSBPurchaseValue(), 25, 0x170D, 0));
                Add(new GenericBuyInfo("Shoes", typeof(Shoes), Shoes.GetSBPurchaseValue(), 25, 0x170F, 0));
                Add(new GenericBuyInfo("Boots", typeof(Boots), Boots.GetSBPurchaseValue(), 25, 0x170B, 0));
                Add(new GenericBuyInfo("Thigh Boots", typeof(ThighBoots), ThighBoots.GetSBPurchaseValue(), 25, 0x1711, 0));

                //TEST: FIX
                //Add( new GenericBuyInfo( typeof( SpoolOfThread ), 18, 20, 0xFA0, 0 ) );
                //Add( new GenericBuyInfo( typeof( Flax ), 156, 20, 0x1A9C, 0 ) );
                //Add( new GenericBuyInfo( typeof( Cotton ), 156, 20, 0xDF9, 0 ) );
                //Add( new GenericBuyInfo( typeof( Wool ), 78, 20, 0xDF8, 0 ) );
            }
示例#5
0
            public InternalSellInfo()
            {
                Add(typeof(BoltOfCloth), BoltOfCloth.GetSBSellValue());

                Add(typeof(Scissors), Scissors.GetSBSellValue());
                Add(typeof(SewingKit), SewingKit.GetSBSellValue());
                Add(typeof(Dyes), Dyes.GetSBSellValue());
                Add(typeof(DyeTub), DyeTub.GetSBSellValue());

                Add(typeof(SkullCap), SkullCap.GetSBSellValue());
                Add(typeof(Bandana), Bandana.GetSBSellValue());
                Add(typeof(FloppyHat), FloppyHat.GetSBSellValue());
                Add(typeof(Cap), Cap.GetSBSellValue());
                Add(typeof(WideBrimHat), WideBrimHat.GetSBSellValue());
                Add(typeof(TallStrawHat), TallStrawHat.GetSBSellValue());
                Add(typeof(Bonnet), Bonnet.GetSBSellValue());
                Add(typeof(FeatheredHat), FeatheredHat.GetSBSellValue());
                Add(typeof(TricorneHat), TricorneHat.GetSBSellValue());
                Add(typeof(JesterHat), JesterHat.GetSBSellValue());
                Add(typeof(WizardsHat), WizardsHat.GetSBSellValue());

                Add(typeof(Doublet), Doublet.GetSBSellValue());
                Add(typeof(Shirt), Shirt.GetSBSellValue());
                Add(typeof(FancyShirt), FancyShirt.GetSBSellValue());
                Add(typeof(Tunic), Tunic.GetSBSellValue());
                Add(typeof(Surcoat), Surcoat.GetSBSellValue());
                Add(typeof(JesterSuit), JesterSuit.GetSBSellValue());
                Add(typeof(PlainDress), PlainDress.GetSBSellValue());
                Add(typeof(FancyDress), FancyDress.GetSBSellValue());
                Add(typeof(Robe), Robe.GetSBSellValue());

                Add(typeof(ShortPants), ShortPants.GetSBSellValue());
                Add(typeof(LongPants), LongPants.GetSBSellValue());
                Add(typeof(Kilt), Kilt.GetSBSellValue());
                Add(typeof(Skirt), Skirt.GetSBSellValue());

                Add(typeof(Cloak), Cloak.GetSBSellValue());
                Add(typeof(BodySash), BodySash.GetSBSellValue());
                Add(typeof(HalfApron), HalfApron.GetSBSellValue());
                Add(typeof(FullApron), FullApron.GetSBSellValue());

                Add(typeof(Sandals), Sandals.GetSBSellValue());
                Add(typeof(Shoes), Shoes.GetSBSellValue());
                Add(typeof(Boots), Boots.GetSBSellValue());
                Add(typeof(ThighBoots), ThighBoots.GetSBSellValue());
            }
示例#6
0
        public void RedrawBitmap()
        {
            bitmap = null;

            if (artData != null)
            {
                if (!stocked)
                {
                    bitmap = artData[dataIndex];
                }
                else
                {
                    Bitmap art = artData[dataIndex];

                    // Offset 5,5 is client-hardcoded
                    // Note: PixelFormat is NEEDED!
                    bitmap = new Bitmap(art.Width + 5, art.Height + 5, System.Drawing.Imaging.PixelFormat.Format32bppArgb);

                    // Draw second image over the first one
                    using (Graphics g = Graphics.FromImage(bitmap)) {
                        g.DrawImageUnscaled(art, 0, 0);
                        g.DrawImageUnscaled(art, 5, 5);
                    }
                }

                if (useHue && hues != null)
                {
                    HueEntry entry = hues[hueIndex];
                    if (entry != null)
                    {
                        Dyes.RecolorFull(entry, bitmap);
                    }
                }
            }

            Invalidate();
        }
            public InternalSellInfo()
            {
                Add(typeof(Arrow), Arrow.GetSBSellValue());
                Add(typeof(Bolt), Bolt.GetSBSellValue());
                Add(typeof(Bandage), Bandage.GetSBSellValue());

                Add(typeof(Scissors), Scissors.GetSBSellValue());
                Add(typeof(SewingKit), SewingKit.GetSBSellValue());
                Add(typeof(Dyes), Dyes.GetSBSellValue());
                Add(typeof(DyeTub), DyeTub.GetSBSellValue());

                Add(typeof(Lockpick), Lockpick.GetSBSellValue());
                Add(typeof(Skillet), Skillet.GetSBSellValue());
                Add(typeof(Dagger), Dagger.GetSBSellValue());

                Add(typeof(Lantern), Lantern.GetSBSellValue());
                Add(typeof(Torch), Torch.GetSBSellValue());
                Add(typeof(Candle), Candle.GetSBSellValue());
                Add(typeof(Bedroll), Bedroll.GetSBSellValue());
                Add(typeof(Backpack), Backpack.GetSBSellValue());
                Add(typeof(Bag), Bag.GetSBSellValue());
                Add(typeof(Pouch), Pouch.GetSBSellValue());
                Add(typeof(WoodenBox), WoodenBox.GetSBSellValue());
            }
            public InternalBuyInfo()
            {
                Add(new GenericBuyInfo("Arrow", typeof(Arrow), Arrow.GetSBPurchaseValue(), 500, 0xF3F, 0));
                Add(new GenericBuyInfo("Bolt", typeof(Bolt), Bolt.GetSBPurchaseValue(), 500, 0x1BFB, 0));
                Add(new GenericBuyInfo("Bandage", typeof(Bandage), Bandage.GetSBPurchaseValue(), 250, 0xE21, 0));

                Add(new GenericBuyInfo("Scissors", typeof(Scissors), Scissors.GetSBPurchaseValue(), 25, 0xF9F, 0));
                Add(new GenericBuyInfo("Sewing Kit", typeof(SewingKit), SewingKit.GetSBPurchaseValue(), 50, 0xF9D, 0));
                Add(new GenericBuyInfo("Dyes", typeof(Dyes), Dyes.GetSBPurchaseValue(), 25, 0xFA9, 0));
                Add(new GenericBuyInfo("Dye Tub", typeof(DyeTub), DyeTub.GetSBPurchaseValue(), 25, 0xFAB, 0));

                Add(new GenericBuyInfo("Lockpick", typeof(Lockpick), Lockpick.GetSBPurchaseValue(), 100, 0x14FC, 0));
                Add(new GenericBuyInfo("Skillet", typeof(Skillet), Skillet.GetSBPurchaseValue(), 50, 0x97F, 0));
                Add(new GenericBuyInfo("Dagger", typeof(Dagger), Dagger.GetSBPurchaseValue(), 25, 0xF52, 0));

                Add(new GenericBuyInfo("Lantern", typeof(Lantern), Lantern.GetSBPurchaseValue(), 25, 0xA25, 0));
                Add(new GenericBuyInfo("Torch", typeof(Torch), Torch.GetSBPurchaseValue(), 25, 0xF6B, 0));
                Add(new GenericBuyInfo("Candle", typeof(Candle), Candle.GetSBPurchaseValue(), 25, 0xA28, 0));
                Add(new GenericBuyInfo("Bedroll", typeof(Bedroll), Bedroll.GetSBPurchaseValue(), 25, 0xA57, 0));
                Add(new GenericBuyInfo("Backpack", typeof(Backpack), Backpack.GetSBPurchaseValue(), 25, 0x9B2, 0));
                Add(new GenericBuyInfo("Bag", typeof(Bag), Bag.GetSBPurchaseValue(), 25, 0xE76, 0));
                Add(new GenericBuyInfo("Pouch", typeof(Pouch), Pouch.GetSBPurchaseValue(), 25, 0xE79, 0));
                Add(new GenericBuyInfo("Wooden Box", typeof(WoodenBox), WoodenBox.GetSBPurchaseValue(), 25, 0xE7D, 0));
            }
示例#9
0
        public void RedrawBitmap()
        {
            bitmap = null;

            if (artData != null)
            {
                this.BackColor = Color.Black;
                Bitmap art = artData[dataIndex];

                if (useHue && hues != null)
                {
                    try
                    {
                        HueEntry entry = hues[hueIndex];
                        if (entry != null)
                        {
                            Dyes.RecolorFull(entry, art);
                        }
                    }
                    catch { }
                }

                if (!stocked)
                {
                    bitmap = art;
                }
                else
                {
                    bitmap = new Bitmap(art.Width + 5, art.Height + 5, System.Drawing.Imaging.PixelFormat.Format32bppArgb);

                    int minX = 0;
                    int minY = 0;
                    int maxX = 0;
                    int maxY = 0;

                    for (int x = 0; x < art.Width; x++)
                    {
                        for (int y = 0; y < art.Height; y++)
                        {
                            Color c = art.GetPixel(x, y);
                            if (c.IsEmpty || (c.R + c.G + c.G < 12))
                            {
                            }                             //Odstin moc blizky cerne { }
                            else
                            {
                                if (minX == 0 || x < minX)
                                {
                                    minX = x;
                                }

                                if (minY == 0 || y < minY)
                                {
                                    minY = y;
                                }

                                if (x > maxX)
                                {
                                    maxX = x;
                                }

                                if (y > maxY)
                                {
                                    maxY = y;
                                }
                            }
                        }
                    }

                    Color borderColor = Color.LightGray;
                    if (Selection)
                    {
                        borderColor = Color.Yellow;
                    }
                    else if (Selected)
                    {
                        borderColor = Color.DeepSkyBlue;
                    }

                    Color markColor = borderColor;//Color.Crimson;
                    if (this.Mark1)
                    {
                        markColor = Color.Crimson;
                    }


                    for (int x = minX; x < maxX; x++)
                    {
                        art.SetPixel(x, minY, markColor);

                        art.SetPixel(x, maxY - 1, borderColor);
                        art.SetPixel(x, maxY, borderColor);
                    }

                    for (int y = minY; y < maxY; y++)
                    {
                        art.SetPixel(minX, y, borderColor);

                        art.SetPixel(maxX - 1, y, markColor);
                        art.SetPixel(maxX, y, markColor);
                    }

                    if (Grayscale)
                    {
                        int x, y;
                        for (x = 0; x < art.Width; x++)
                        {
                            for (y = 0; y < art.Height; y++)
                            {
                                Color pixelColor = art.GetPixel(x, y);
                                Color newColor   = Color.FromArgb(pixelColor.R, 0, 0);
                                art.SetPixel(x, y, newColor); // Now greyscale
                            }
                        }
                    }

                    using (Graphics g = Graphics.FromImage(bitmap))
                    {
                        g.DrawImage(art, new Rectangle(0, 0, this.Width, this.Height), new Rectangle(minX, minY, maxX - minX, maxY - minY), GraphicsUnit.Pixel);
                        if (this.counter.HasValue)
                        {
                            g.FillRectangle(Brushes.Black, 0, 0, 12, 12);
                            g.DrawString(String.Format("{0}", this.counter), new Font("Arial", CounterTextFontSize), CounterBrush, 0, 1);
                        }
                    }
                }
            }
            else
            {
                this.BackColor = Color.LightGray;
            }

            Invalidate();
        }
示例#10
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            if (m_Ticket.Deleted)
            {
                return;
            }

            var number = 0;

            Item item  = null;
            Item item2 = null;

            switch (info.ButtonID)
            {
            case 1:
            {
                item   = new Sextant();
                number = 1010494;
                break;         // A sextant has been placed in your backpack.
            }

            case 2:
            {
                item   = new HairRestylingDeed();
                number = 501933;
                break;         // A coupon for a free hair restyling has been placed in your backpack.
            }

            case 3:
            {
                item   = new Spellbook(0xFFFFFFFF);
                number = 1010495;
                break;         // A spellbook with all 1st to 4th circle spells has been placed in your backpack.
            }

            case 4:
            {
                item   = new FireworksWand();
                number = 501935;
                break;         // A wand of fireworks has been placed in your backpack.
            }

            case 5:
            {
                item   = new Spyglass();
                number = 501936;
                break;         // A spyglass has been placed in your backpack.
            }

            case 6:
            {
                item   = new DyeTub();
                item2  = new Dyes();
                number = 501937;
                break;         // The dyes and dye tub have been placed in your backpack.
            }
            }

            if (item != null)
            {
                m_Ticket.Delete();

                m_From.SendLocalizedMessage(number);
                m_From.AddToBackpack(item);

                if (item2 != null)
                {
                    m_From.AddToBackpack(item2);
                }
            }
        }
示例#11
0
        private void SetDefaultLogCallback()
        {
            LogCallback = (text, level, indentBefore, indentAfter) =>
            {
                Dyes dye    = Dyes.Black;
                bool isBold = false;
                switch (level)
                {
                case LogLevels.Title:
                    isBold = true;
                    break;

                case LogLevels.Error:
                case LogLevels.Fail:
                    dye    = Dyes.Red;
                    isBold = true;
                    break;

                case LogLevels.Done:
                case LogLevels.Ok:
                    dye    = Dyes.Green;
                    isBold = true;
                    break;

                case LogLevels.Warning:
                    dye = Dyes.DarkOrange;
                    break;
                }

                const int indentStep = 2;
                switch (indentBefore)
                {
                case LogIndents.None:
                    _currentIndent = "";
                    break;

                case LogIndents.Current:
                    break;

                case LogIndents.Increase:
                    _currentIndent = _currentIndent.PadRight(_currentIndent.Length + indentStep, ' ');
                    break;

                case LogIndents.Decrease:
                    if (_currentIndent.Length > indentStep)
                    {
                        _currentIndent = _currentIndent.Substring(0, _currentIndent.Length - indentStep);
                    }
                    else
                    {
                        _currentIndent = "";
                    }
                    break;
                }

                LogPacket lp = new LogPacket("{0}{1}".FormatStr((object)_currentIndent, text), dye, isBold, true, true);
                _logPacketsTotal.Enqueue(lp);
                LastLogPacket = lp;
                var actionLevels = new[] { LogLevels.Done, LogLevels.Ok, LogLevels.Fail };
                if (actionLevels.Contains(level))
                {
                    LastLogActionPacket = lp;
                }
                switch (indentAfter)
                {
                case LogIndents.None:
                    _currentIndent = "";
                    break;

                case LogIndents.Current:
                    break;

                case LogIndents.Increase:
                    _currentIndent = _currentIndent.PadRight(_currentIndent.Length + indentStep, ' ');
                    break;

                case LogIndents.Decrease:
                    if (_currentIndent.Length > indentStep)
                    {
                        _currentIndent = _currentIndent.Substring(0, _currentIndent.Length - indentStep);
                    }
                    else
                    {
                        _currentIndent = "";
                    }
                    break;
                }
            };
        }