Exemplo n.º 1
0
        private void listBox1_DrawItem(object sender, DrawItemEventArgs e)
        {
            e.DrawBackground();

            string name = (string)listBox1.Items[e.Index];

            if (rewardManager.HasReward(name))
            {
                Reward reward = rewardManager.GetReward(name);
                ZeldaOracle.Common.Graphics.Sprite sprite = null;

                Point2I position = (Point2I)e.Bounds.Location + new Point2I(2, 2);

                if (reward != null && reward.Animation != null)
                {
                    sprite = reward.Animation.Frames[0].Sprite;
                }
                if (sprite != null)
                {
                    EditorGraphics.DrawSprite(e.Graphics, sprite, position);
                }
            }

            int       x        = e.Bounds.Left + 20;
            int       y        = e.Bounds.Top;
            int       width    = e.Bounds.Right - x;
            int       height   = e.Bounds.Bottom - y;
            Rectangle textRect = new Rectangle(x, y, width, height);

            if (name == "")
            {
                name = "(none)";
            }

            Point2I      textPosition = (Point2I)e.Bounds.Location + new Point2I(24, 0);
            StringFormat stringFormat = new StringFormat();

            stringFormat.Alignment     = StringAlignment.Near;
            stringFormat.LineAlignment = StringAlignment.Center;
            e.Graphics.DrawString(name, textBox1.Font, new SolidBrush(System.Drawing.Color.Black), textRect, stringFormat);

            // Draw the focus rectangle if appropriate.
            e.DrawFocusRectangle();
        }
Exemplo n.º 2
0
        //-----------------------------------------------------------------------------
        // Drop Lists Loading
        //-----------------------------------------------------------------------------

        public static void LoadDrops(DropManager dropManager, RewardManager rewardManager)
        {
            DropList dropsRupees = dropManager.CreateDropList("rupees");

            dropsRupees.AddDrop(3, rewardManager.GetReward("rupees_1"));
            dropsRupees.AddDrop(1, rewardManager.GetReward("rupees_5"));

            DropList dropsHearts = dropManager.CreateDropList("hearts");

            dropsHearts.AddDrop(4, rewardManager.GetReward("hearts_1"));
            dropsHearts.AddDrop(1, typeof(CollectibleFairy));

            DropList dropsSeeds = dropManager.CreateDropList("seeds");

            dropsSeeds.AddDrop(1, rewardManager.GetReward("ammo_ember_seeds_5"));
            dropsSeeds.AddDrop(1, rewardManager.GetReward("ammo_scent_seeds_5"));
            dropsSeeds.AddDrop(1, rewardManager.GetReward("ammo_pegasus_seeds_5"));
            dropsSeeds.AddDrop(1, rewardManager.GetReward("ammo_gale_seeds_5"));
            dropsSeeds.AddDrop(1, rewardManager.GetReward("ammo_mystery_seeds_5"));

            DropList dropsAmmo = dropManager.CreateDropList("ammo");

            dropsAmmo.AddDrop(1, rewardManager.GetReward("ammo_bombs_5"));
            dropsAmmo.AddDrop(1, rewardManager.GetReward("ammo_arrows_5"));
            dropsAmmo.AddDrop(5, dropsSeeds);


            // Drops that are created by default for tiles.
            DropList dropsDefault = dropManager.CreateDropList("default", 1, 3);

            dropsDefault.AddDrop(50, dropsAmmo);
            dropsDefault.AddDrop(46, dropsRupees);
            dropsDefault.AddDrop(25, dropsHearts);

            // Drops that are created when a ground tile is dug up.
            DropList dropsDigRupees = new DropList();

            dropsDigRupees.AddDrop(25, dropsRupees);
            dropsDigRupees.AddDrop(1, rewardManager.GetReward("rupees_100"));
            DropList dropsDigMonsters = new DropList();

            dropsDigMonsters.AddDrop(5, typeof(MonsterBeetle));
            dropsDigMonsters.AddDrop(2, typeof(MonsterRope));
            DropList dropsDig = dropManager.CreateDropList("dig", 1, 4);

            dropsDig.AddDrop(46, dropsDigRupees);
            dropsDig.AddDrop(25, dropsHearts);
            dropsDig.AddDrop(7, dropsDigMonsters);

            //DropList dropsDig = dropManager.CreateDropList("dig", 1, 1);
            //dropsDig.AddDrop(1, typeof(MonsterRope));
            //dropsDig.AddDrop(1, typeof(MonsterBeetle));
            //dropsDig.AddDrop(1, typeof(MonsterLynel));
        }