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


C# Entities.AddStatusEffect1方法代码示例

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


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

示例1: Create

        public static void Create(Entities.GameClient client, Packets.TeamActionPacket packet)
        {
            if (packet.EntityUID != client.EntityUID)
                return;
            if (client.Team != null)
                return;

            client.Team = new Team();
            client.Team.Leader = client.EntityUID;
            if (client.Team.Members.TryAdd(client.EntityUID, client))
            {
                using (var create = new Packets.TeamActionPacket())
                {
                    create.EntityUID = client.EntityUID;
                    create.Action = Enums.TeamAction.Leader;
                    client.Send(create);
                    create.Action = Enums.TeamAction.Create;
                    client.Send(create);
                }
                client.AddStatusEffect1(Enums.Effect1.TeamLeader, 0);
            }
            else
            {
                client.Team = null;
            }
        }
开发者ID:kenlacoste843,项目名称:ProjectXV3,代码行数:26,代码来源: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: Attack

        public bool Attack(Entities.BattlePet opponent, Entities.BattlePet target, bool ForceDamage = false, double FDamage = 0)
        {
            if (ForceDamage)
            {
                if (FDamage < 1)
                    FDamage = 1;
                target.HP -= (int)FDamage;

                opponent.Battle.UpdateScreen();
                Send(target, (uint)FDamage);

                if (target.HP < 0)
                {
                    opponent.Battle.Finish(opponent);
                    return false;
                }
                return true;
            }

            double Evolve = (double)(opponent.EvolveState + 1);
            double SkillPower = (double)this.Power;
            double Power = (double)opponent.Power;
            double Level = (double)opponent.Level;
            double Damage = (Evolve * (Power + (SkillPower + ((SkillPower / 100) * Level))));

            double TEvolve = (double)(target.EvolveState + 1);
            double TPower = (double)target.Power;
            double TLevel = (double)target.Level;
            double Defense = (TEvolve * (TPower + ((TPower / 100) * TLevel)));

            if (State == Enums.PetState.ChanceDoubleDamage ||
                State == Enums.PetState.TurnAttack ||
                State == Enums.PetState.TurnDoubleAttack ||
                State != Enums.PetState.ChanceDoubleDamage &&
                State != Enums.PetState.TurnAttack &&
                State != Enums.PetState.TurnDoubleAttack &&
                State != Enums.PetState.None &&
                Calculations.BasicCalculations.ChanceSuccess(StateChance))
            {
                switch (State)
                {
                    case Enums.PetState.Absorb:
                        {
                            Defense = 0;
                            Damage = ((target.HP / 100) * SkillPower);
                            opponent.HP += (int)Damage;
                            break;
                        }
                    case Enums.PetState.ChanceDoubleDamage:
                        {
                            byte HitCount = 0;
                            int Chance = (int)StateChance;
                                Damage -= Defense;
                                if (Damage < 1)
                                    Damage = 1;
                            while (Calculations.BasicCalculations.ChanceSuccess(Chance) && HitCount < 2)
                            {
                                target.HP -= (int)Damage;

                                opponent.Battle.UpdateScreen();
                                Send(target, (uint)Damage);

                                if (target.HP < 0)
                                {
                                    opponent.Battle.Finish(opponent);
                                    return false;
                                }
                                HitCount++;
                                Chance /= 2;
                            }
                            return true;
                        }
                    case Enums.PetState.Sleep:
                        {
                            if (target.State != Enums.PetState.None)
                                return false;
                            target.State = State;
                            target.AddStatusEffect1(Enums.Effect1.PartiallyInvisible);
                            opponent.Battle.UpdateScreen();
                            return false;
                        }
                    case Enums.PetState.Reflect:
                        {
                            double ReturnDamage = ((Damage / 100) * SkillPower);
                            if (!Attack(target, opponent, true, ReturnDamage))
                                return false;
                            break;
                        }
                    case Enums.PetState.Confuse:
                        {
                            if (target.State != Enums.PetState.None)
                                return false;
                            target.State = State;
                            target.AddStatusEffect1(Enums.Effect1.Confused);
                            opponent.Battle.UpdateScreen();
                            break;
                        }
                    case Enums.PetState.Freezing:
                        {
                            if (target.State != Enums.PetState.None)
//.........这里部分代码省略.........
开发者ID:kenlacoste843,项目名称:ProjectXV3,代码行数:101,代码来源:BattleMonsterSkill.cs

示例4: Use2

        public void Use2(Entities.BossMonster boss, Entities.GameClient target)
        {
            if (!target.Alive)
                return;

            #region SkillAnimation + Power
            if (RealSkill != -1)
            {
                var usespell = new Packets.UseSpellPacket();

                usespell.EntityUID = boss.EntityUID;
                usespell.SpellID = (ushort)RealSkill;
                usespell.SpellX = boss.X;
                usespell.SpellY = boss.Y;
                usespell.SpellLevel = RealSkilllevel;

                if (PercentTageEffect != -1)
                {
                    int damage = (target.HP / PercentTageEffect);
                    usespell.AddTarget(target.EntityUID, (uint)damage);
                    target.HP -= damage;
                    if (target.HP <= 0)
                    {
                        Packets.Interaction.Battle.Combat.Kill(boss, target, (uint)damage);
                    }
                }
                else if (DamageEffect > 0)
                {
                    int damage = ProjectX_V3_Lib.ThreadSafe.RandomGenerator.Generator.Next(DamageEffect / 2, DamageEffect);
                    usespell.AddTarget(target.EntityUID, (uint)damage);
                    target.HP -= damage;
                    if (target.HP <= 0)
                    {
                        Packets.Interaction.Battle.Combat.Kill(boss, target, (uint)damage);
                    }
                }
                else
                    usespell.AddTarget(target.EntityUID, 0);

                boss.Screen.UpdateScreen(usespell);
            }
            else
            {
                using (var interact = new Packets.InteractionPacket())
                {
                    interact.Action = Enums.InteractAction.Attack;
                    interact.EntityUID = boss.EntityUID;
                    interact.TargetUID = target.EntityUID;
                    interact.UnPacked = true;
                    interact.X = target.X;
                    interact.Y = target.Y;
                    if (PercentTageEffect != -1)
                    {
                        int damage = (target.HP / PercentTageEffect);
                        interact.Data = (uint)damage;

                        target.HP -= damage;
                        if (target.HP <= 0)
                        {
                            Packets.Interaction.Battle.Combat.Kill(boss, target, (uint)damage);
                        }
                    }
                    else if (DamageEffect > 0)
                    {
                        int damage = ProjectX_V3_Lib.ThreadSafe.RandomGenerator.Generator.Next(DamageEffect / 2, DamageEffect);
                        interact.Data = (uint)damage;

                        target.HP -= damage;
                        if (target.HP <= 0)
                        {
                            Packets.Interaction.Battle.Combat.Kill(boss, target, (uint)damage);
                        }
                    }
                    else
                        interact.Data = 0;
                    boss.Screen.UpdateScreen(interact);
                }
            }
            #endregion

            #region Freeze
            if (Freeze)
            {
                target.AddStatusEffect1(Enums.Effect1.IceBlock, FreezeTime);
            }
            #endregion

            #region Paralyze
            if (Paralyzed)
            {
                target.ParalyzeClient(ParalyzeTime);
            }
            #endregion
        }
开发者ID:kenlacoste843,项目名称:ProjectXV3,代码行数:94,代码来源:AdvancedSkill.cs


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