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


C# Combat.GetTargets方法代码示例

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


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

示例1: Run

        public override void Run(Combat.Character character)
        {
            Int32 time = EvaluationHelper.AsInt32(character, Time, 1);
            Int32 target_id = EvaluationHelper.AsInt32(character, TargetId, Int32.MinValue);
            Vector2 offset = EvaluationHelper.AsVector2(character, Position, new Vector2(0, 0));

            foreach (Combat.Character target in character.GetTargets(target_id))
            {
                switch (BindPosition)
                {
                    case BindToTargetPostion.Mid:
                        offset += target.BasePlayer.Constants.Midposition;
                        break;

                    case BindToTargetPostion.Head:
                        offset += target.BasePlayer.Constants.Headposition;
                        break;

                    case BindToTargetPostion.None:
                    case BindToTargetPostion.Foot:
                    default:
                        break;
                }

                character.Bind.Set(target, offset, time, 0, false);
                break;
            }
        }
开发者ID:lodossDev,项目名称:xnamugen,代码行数:28,代码来源:BindToTarget.cs

示例2: Run

        public override void Run(Combat.Character character)
        {
            Int32 time = EvaluationHelper.AsInt32(character, Time, 1);
            Int32 target_id = EvaluationHelper.AsInt32(character, TargetId, Int32.MinValue);
            Vector2 position = EvaluationHelper.AsVector2(character, Position, new Vector2(0, 0));

            foreach (Combat.Character target in character.GetTargets(target_id))
            {
                target.Bind.Set(character, position, time, 0, true);
            }
        }
开发者ID:lodossDev,项目名称:xnamugen,代码行数:11,代码来源:TargetBind.cs

示例3: Run

        public override void Run(Combat.Character character)
        {
            Int32? amount = EvaluationHelper.AsInt32(character, Amount, null);
            Int32 target_id = EvaluationHelper.AsInt32(character, TargetId, Int32.MinValue);

            if (amount == null) return;

            foreach (Combat.Character target in character.GetTargets(target_id))
            {
                target.BasePlayer.Power += amount.Value;
            }
        }
开发者ID:lodossDev,项目名称:xnamugen,代码行数:12,代码来源:TargetPowerAdd.cs

示例4: Run

        public override void Run(Combat.Character character)
        {
            Int32? statenumber = EvaluationHelper.AsInt32(character, StateNumber, null);
            Int32 target_id = EvaluationHelper.AsInt32(character, TargetId, Int32.MinValue);

            if (statenumber == null) return;

            foreach (Combat.Character target in character.GetTargets(target_id))
            {
                target.StateManager.ForeignManager = character.StateManager;
                target.StateManager.ChangeState(statenumber.Value);
            }
        }
开发者ID:lodossDev,项目名称:xnamugen,代码行数:13,代码来源:TargetState.cs

示例5: Run

        public override void Run(Combat.Character character)
        {
            Single? x = EvaluationHelper.AsSingle(character, X, null);
            Single? y = EvaluationHelper.AsSingle(character, Y, null);
            Int32 target_id = EvaluationHelper.AsInt32(character, TargetId, Int32.MinValue);

            foreach (Combat.Character target in character.GetTargets(target_id))
            {
                Vector2 velocity = new Vector2(0, 0);

                if (x != null) velocity.X = x.Value;
                if (y != null) velocity.Y = y.Value;

                target.CurrentVelocity += velocity;
            }
        }
开发者ID:lodossDev,项目名称:xnamugen,代码行数:16,代码来源:TargetVelAdd.cs

示例6: Run

        public override void Run(Combat.Character character)
        {
            Int32 facing = EvaluationHelper.AsInt32(character, Facing, 0);
            Int32 target_id = EvaluationHelper.AsInt32(character, TargetId, Int32.MinValue);

            foreach (Combat.Character target in character.GetTargets(target_id))
            {
                if (facing > 0)
                {
                    target.CurrentFacing = character.CurrentFacing;
                }
                else if (facing < 0)
                {
                    target.CurrentFacing = Misc.FlipFacing(character.CurrentFacing);
                }
            }
        }
开发者ID:lodossDev,项目名称:xnamugen,代码行数:17,代码来源:TargetFacing.cs

示例7: Run

        public override void Run(Combat.Character character)
        {
            Int32? amount = EvaluationHelper.AsInt32(character, Amount, null);
            Int32 target_id = EvaluationHelper.AsInt32(character, TargetId, Int32.MinValue);
            Boolean cankill = EvaluationHelper.AsBoolean(character, CanKill, true);
            Boolean absolute = EvaluationHelper.AsBoolean(character, Absolute, false);

            if (amount == null) return;

            foreach (Combat.Character target in character.GetTargets(target_id))
            {
                Int32 newamount = amount.Value;

                if (absolute == false && newamount < 0)
                {
                    newamount = (Int32)(newamount * character.OffensiveInfo.AttackMultiplier);
                    newamount = (Int32)(newamount / target.DefensiveInfo.DefenseMultiplier);
                }

                target.Life += newamount;
                if (target.Life == 0 && cankill == false) target.Life = 1;
            }
        }
开发者ID:lodossDev,项目名称:xnamugen,代码行数:23,代码来源:TargetLifeAdd.cs

示例8: Run

        public override void Run(Combat.Character character)
        {
            Int32 exclude_id = EvaluationHelper.AsInt32(character, Id, -1);
            Boolean keepone = EvaluationHelper.AsBoolean(character, KeepOne, true);

            List<Combat.Character> removelist = new List<Combat.Character>();
            foreach (Combat.Character target in character.GetTargets(Int32.MinValue))
            {
                if (exclude_id != -1 && target.DefensiveInfo.HitDef.TargetId == exclude_id) continue;

                removelist.Add(target);
            }

            if (removelist.Count > 0 && keepone == true) removelist.RemoveAt(0);

            foreach (Combat.Character target in removelist) character.OffensiveInfo.TargetList.Remove(target);

            /*
            Boolean keptone = false;
            foreach (Combat.Entity entity in character.Engine.Entities)
            {
                Combat.Character target = character.FilterEntityAsTarget(entity, Int32.MinValue);
                if (target == null) continue;

                if (exclude_id != -1 && target.DefensiveInfo.HitDef.TargetId == exclude_id) continue;

                if (keptone == false)
                {
                    keptone = true;
                    continue;
                }

                character.OffensiveInfo.TargetList.Remove(target);
            }
            */
        }
开发者ID:lodossDev,项目名称:xnamugen,代码行数:36,代码来源:TargetDrop.cs


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