当前位置: 首页>>代码示例>>C#>>正文


C# Container.Move方法代码示例

本文整理汇总了C#中Container.Move方法的典型用法代码示例。如果您正苦于以下问题:C# Container.Move方法的具体用法?C# Container.Move怎么用?C# Container.Move使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Container的用法示例。


在下文中一共展示了Container.Move方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DropBag

        public void DropBag(Item i)
        {
            short bagId = 0x0500;
            var soulbound = false;
            if (i.Soulbound)
            {
                bagId = 0x0503;
                soulbound = true;
            }
            else if (i.Undead)
            {
                bagId = 0xffe;
                soulbound = true;
            }
            else if (i.SUndead)
            {
                bagId = 0xfff;
                soulbound = true;
            }
            else if (i.PUndead)
            {
                bagId = 0xffd;
            }

            var container = new Container(bagId, 1000*60, true);
            if (soulbound)
                container.BagOwner = AccountId;
            container.Inventory[0] = i;
            container.Move(X + (float) ((invRand.NextDouble()*2 - 1)*0.5),
                Y + (float) ((invRand.NextDouble()*2 - 1)*0.5));
            container.Size = 75;
            Owner.EnterWorld(container);

            if (Owner is Vault)
                if ((Owner as Vault).psr.Account.Name == psr.Account.Name)
                    return;

            const string dir = @"logs";
            if (!Directory.Exists(dir))
            {
                Directory.CreateDirectory(dir);
            }
            using (var writer = new StreamWriter(@"logs\DropLog.log", true))
            {
                writer.WriteLine(Name + " dropped a " + i.ObjectId + (soulbound ? " (Soulbound)" : ""));
            }
        }
开发者ID:RiiggedMPGH,项目名称:Owl-Realms-Source,代码行数:47,代码来源:Player.Inventory.cs

示例2: DropBag

        public void DropBag(Item i)
        {
            ushort bagId = 0x0500;
            var soulbound = false;
            if (i.Soulbound)
            {
                bagId = 0x0503;
                soulbound = true;
            }

            var container = new Container(Manager, bagId, 1000*60, true);
            if (soulbound)
                container.BagOwners = new [] { AccountId };
            container.Inventory[0] = i;
            container.Move(X + (float) ((invRand.NextDouble()*2 - 1)*0.5),
                Y + (float) ((invRand.NextDouble()*2 - 1)*0.5));
            container.Size = 75;
            Owner.EnterWorld(container);
        }
开发者ID:SirAnuse,项目名称:fabiano-swagger-of-doom,代码行数:19,代码来源:Player.Inventory.cs

示例3: TextBoxButton


//.........这里部分代码省略.........
            if (type == "SlotMachine1")
            {
                if (pkt.Button == 1)
                {
                    if (Client.Account.Stats.Fame >= 10)
                    {
                        using (var db = new Database())
                        {
                            db.UpdateFame(psr.Account, -10);
                            db.Dispose();
                        }
                    var weaponsT5 = TierLoot.WeaponItems[5].ToList();
                    var weaponsT6 = TierLoot.WeaponItems[6].ToList();
                    var weaponsT7 = TierLoot.WeaponItems[7].ToList();
                    var abilitiesT3 = TierLoot.AbilityItems[2].ToList();
                    var ringsT3 = TierLoot.RingItems[3].ToList();
                    var armorT6 = TierLoot.ArmorItems[6].ToList();
                    var armorT7 = TierLoot.ArmorItems[7].ToList();
                    var armorT8 = TierLoot.ArmorItems[8].ToList();

                    var calculator = Random.Next(1, 1000);
                    if (calculator <= 600)
                    {
                        SendHelp("Better luck next time!");
                    }
                    else if (calculator <= 700 && calculator > 600)
                    {
                        SendHelp("Congratulations! You won a T5 Weapon!");

                        weaponsT5.Shuffle();

                        var container = new Container(0x0507, 1000*60, true) {BagOwner = psr.Account.AccountId};
                        container.Inventory[0] = weaponsT5[0];
                        container.Move(X + (float) ((invRand.NextDouble()*2 - 1)*0.5),
                            Y + (float) ((invRand.NextDouble()*2 - 1)*0.5));
                        container.Size = 75;
                        Owner.EnterWorld(container);
                    }
                    else if (calculator <= 750 && calculator > 700)
                    {
                        SendHelp("Congratulations! You won a T6 Weapon!");

                        weaponsT6.Shuffle();

                        var container = new Container(0x0507, 1000*60, true) {BagOwner = psr.Account.AccountId};
                        container.Inventory[0] = weaponsT6[0];
                        container.Move(X + (float) ((invRand.NextDouble()*2 - 1)*0.5),
                            Y + (float) ((invRand.NextDouble()*2 - 1)*0.5));
                        container.Size = 75;
                        Owner.EnterWorld(container);
                    }
                    else if (calculator <= 787.5 && calculator > 775)
                    {
                        SendHelp("Congratulations! You won a T7 Weapon!");

                        weaponsT7.Shuffle();

                        var container = new Container(0x0507, 1000*60, true) {BagOwner = psr.Account.AccountId};
                        container.Inventory[0] = weaponsT7[0];
                        container.Move(X + (float) ((invRand.NextDouble()*2 - 1)*0.5),
                            Y + (float) ((invRand.NextDouble()*2 - 1)*0.5));
                        container.Size = 75;
                        Owner.EnterWorld(container);
                    }
                    else if (calculator <= 800 && calculator > 787.5)
                    {
开发者ID:RiiggedMPGH,项目名称:Owl-Realms-Source,代码行数:67,代码来源:Player.Button.cs


注:本文中的Container.Move方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。