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


C# Entities.RemoveFlag1方法代码示例

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


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

示例1: Delete

        public void Delete(Entities.GameClient client, Packets.TeamActionPacket packet)
        {
            if (!client.Alive)
                return;
            if (Leader != client.EntityUID)
                return;

            client.RemoveFlag1(Enums.Effect1.TeamLeader);
            foreach (Entities.GameClient member in Members.Values)
            {
                member.Team = null;
                member.Send(packet);
            }

            Members.Clear();
            Leader = 0;
        }
开发者ID:kenlacoste843,项目名称:ProjectXV3,代码行数:17,代码来源:Team.cs

示例2: Handle

        public static bool Handle(Entities.GameClient client, UseSpellPacket usespell)
        {
            if (!client.Equipments.Contains(Enums.ItemLocation.Steed))
                return false;

            if (client.ContainsFlag1(Enums.Effect1.Riding))
                client.RemoveFlag1(Enums.Effect1.Riding);
            else if (client.Stamina < 100)
                return false;
            else
                client.AddStatusEffect1(Enums.Effect1.Riding);

            using (var vigor = new Packets.SteedVigorPacket())
            {
                vigor.Type = 2;
                vigor.Amount = 9001;
                client.Send(vigor);
            }

            usespell.AddTarget(client.EntityUID, 0);
            return true;
        }
开发者ID:kenlacoste843,项目名称:ProjectXV3,代码行数:22,代码来源:MountSkill.cs

示例3: Handle

        /// <summary>
        /// Handling the combat of the interact packet.
        /// </summary>
        /// <param name="client">The client.</param>
        /// <param name="interact">The interact packet.</param>
        public static void Handle(Entities.GameClient client, InteractionPacket interact)
        {
            if (interact == null)
                return;

            if (!client.Alive)
                return;

            if (client.Paralyzed)
                return;

            if (!client.CanAttack)
                return;

            if (!(DateTime.Now >= client.LoginProtection.AddSeconds(10)))
            {
                using (var fmsg = Packets.Message.MessageCore.CreateSystem2(client.Name, Core.MessageConst.REST))
                    client.Send(fmsg);
                return;
            }
            if (!(DateTime.Now >= client.ReviveProtection.AddSeconds(5)))
            {
                using (var fmsg = Packets.Message.MessageCore.CreateSystem2(client.Name, Core.MessageConst.REST))
                    client.Send(fmsg);
                return;
            }

            if (!(DateTime.Now >= client.LastAttack.AddMilliseconds(Core.TimeIntervals.AttackInterval)) && client.AttackPacket == null)
            {
                using (var fmsg = Packets.Message.MessageCore.CreateSystem2(client.Name, Core.MessageConst.REST))
                    client.Send(fmsg);
                return;
            }

            if (client.Battle != null)
            {
                if (!client.Battle.HandleBeginAttack(client))
                {
                    using (var fmsg = Packets.Message.MessageCore.CreateSystem2(client.Name, Core.MessageConst.REST))
                        client.Send(fmsg);
                    return;
                }
            }
            client.LastAttack = DateTime.Now;
            //client.AutoAttacking = false;
            switch (interact.Action)
            {
                case Enums.InteractAction.MagicAttack:
                    {
                        #region TemporaryDecryption
                        if (!interact.UnPacked)
                        {
                            interact.UnPacked = true;

                            byte[] packet = interact.Copy();
                            ushort SkillId = Convert.ToUInt16(((long)packet[24] & 0xFF) | (((long)packet[25] & 0xFF) << 8));
                            SkillId ^= (ushort)0x915d;
                            SkillId ^= (ushort)client.EntityUID;
                            SkillId = (ushort)(SkillId << 0x3 | SkillId >> 0xd);
                            SkillId -= 0xeb42;

                            uint Target = ((uint)packet[12] & 0xFF) | (((uint)packet[13] & 0xFF) << 8) | (((uint)packet[14] & 0xFF) << 16) | (((uint)packet[15] & 0xFF) << 24);
                            Target = ((((Target & 0xffffe000) >> 13) | ((Target & 0x1fff) << 19)) ^ 0x5F2D2463 ^ client.EntityUID) - 0x746F4AE6;

                            ushort TargetX = 0;
                            ushort TargetY = 0;
                            long xx = (packet[16] & 0xFF) | ((packet[17] & 0xFF) << 8);
                            long yy = (packet[18] & 0xFF) | ((packet[19] & 0xFF) << 8);
                            xx = xx ^ (client.EntityUID & 0xffff) ^ 0x2ed6;
                            xx = ((xx << 1) | ((xx & 0x8000) >> 15)) & 0xffff;
                            xx |= 0xffff0000;
                            xx -= 0xffff22ee;
                            yy = yy ^ (client.EntityUID & 0xffff) ^ 0xb99b;
                            yy = ((yy << 5) | ((yy & 0xF800) >> 11)) & 0xffff;
                            yy |= 0xffff0000;
                            yy -= 0xffff8922;
                            TargetX = Convert.ToUInt16(xx);
                            TargetY = Convert.ToUInt16(yy);

                            interact.TargetUID = Target;
                            interact.MagicType = SkillId;
                            interact.X = TargetX;
                            interact.Y = TargetY;
                        }
                        #endregion

                        if (client.ContainsFlag1(Enums.Effect1.Riding) && interact.MagicType != 7001)
                        {
                            if (client.Stamina >= 100)
                            {
                                client.Stamina = 0;
                                client.RemoveFlag1(Enums.Effect1.Riding);
                            }
                            return;
                        }
//.........这里部分代码省略.........
开发者ID:kenlacoste843,项目名称:ProjectXV3,代码行数:101,代码来源:Combat.cs

示例4: Regular

        void Regular(Entities.Monster mob)
        {
            #region Poison
            if (mob.ContainsFlag1(Enums.Effect1.Poisoned))
            {
                if (DateTime.Now >= mob.LastPoison.AddMilliseconds(3000))
                {
                    mob.LastPoison = DateTime.Now;
                    if (mob.PoisonEffect > 0)
                    {
                        uint damage = (uint)((mob.HP / 100) * mob.PoisonEffect);
                        if (mob.HP > damage)
                        {
                            Packets.Interaction.Battle.Combat.HitDamage(null, mob, damage);
                            using (var interact = new Packets.InteractionPacket())
                            {
                                interact.Action = Enums.InteractAction.Attack;
                                interact.EntityUID = mob.EntityUID;
                                interact.TargetUID = mob.EntityUID;
                                interact.UnPacked = true;
                                interact.X = mob.X;
                                interact.Y = mob.Y;
                                interact.Data = damage;
                                mob.Screen.UpdateScreen(interact, false);
                            }
                        }
                        else
                            mob.RemoveFlag1(Enums.Effect1.Poisoned);
                    }
                }
            }
            #endregion

            if (mob.Target != null)
            {
                if (mob.Target.Alive)
                {
                    if (mob.Screen.MapObjects.ContainsKey(mob.Target.EntityUID))
                    {
                        if (Core.Screen.GetDistance(mob.X, mob.Y, mob.Target.X, mob.Target.Y) <= mob.AttackRange &&
                            DateTime.Now >= mob.AttackTime)
                        {
                            mob.AttackTime = DateTime.Now.AddMilliseconds(
                                ProjectX_V3_Lib.ThreadSafe.RandomGenerator.Generator.Next(
                                    mob.AttackSpeed, mob.AttackSpeed * 3));

                            #region physical attack
                            using (var interact = new Packets.InteractionPacket())
                            {
                                interact.Action = Enums.InteractAction.Attack;
                                interact.EntityUID = mob.EntityUID;
                                interact.TargetUID = mob.Target.EntityUID;
                                interact.UnPacked = true;
                                interact.X = mob.Target.X;
                                interact.Y = mob.Target.Y;
                                Packets.Interaction.Battle.Physical.Handle(mob, interact);
                            }
                            #endregion

                            return;
                        }
                    }
                }
            }

            mob.Target = null;
            foreach (Maps.IMapObject obj in mob.Screen.MapObjects.Values)
            {
                if (obj is Entities.GameClient)
                {
                    if ((obj as Entities.GameClient).ContainsFlag1(Enums.Effect1.PartiallyInvisible))
                    {
                        continue;
                    }
                    mob.Target = obj as Entities.IEntity;
                    if (!mob.Target.Alive)
                    {
                        mob.Target = null;
                        continue;
                    }
                    break;
                }
            }
        }
开发者ID:kenlacoste843,项目名称:ProjectXV3,代码行数:84,代码来源:MonsterThread.cs

示例5: Handle

 public static void Handle(Entities.GameClient client, GeneralDataPacket General)
 {
     client.RemoveFlag1(Enums.Effect1.Fly);
 }
开发者ID:kenlacoste843,项目名称:ProjectXV3,代码行数:4,代码来源:EndFly.cs


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