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


C# Combatant.AddSkill方法代码示例

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


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

示例1: StationaryMelee

        public void StationaryMelee()
        {
            Board board = new Board(BoardCommon.GRID_12X8);
            Combatant attacker = new Combatant("Attacker", board, new Point(5, 4));
            Combatant defender = new Combatant("Defender", board, new Point(7, 4));
            board.AddPawn(attacker);
            board.AddPawn(defender);

            attacker.Health = 10;
            defender.Health = 10;

            attacker.BaseStats = new Stats() {
                Attack = 10,
                Stamina = 10
            };

            MeleeAttackSkill attack = new MeleeAttackSkill(attacker, new Point[] { Point.Right, 2 * Point.Right }) {
                ActionPoints = 3
            };
            attack.SetDirection(CardinalDirection.East);

            attacker.AddSkill(attack);
            attack.Fire();

            board.BeginTurn();
            Assert.AreEqual(10, attacker.ActionPoints);

            board.Turn();
            Assert.AreEqual(0, defender.Health);
            Assert.AreEqual(7, attacker.ActionPoints);
        }
开发者ID:RolandMQuiros,项目名称:Lost-Generation,代码行数:31,代码来源:ApproachAndAttackTests.cs

示例2: ApproachMeleeRange

        public void ApproachMeleeRange()
        {
            Board board = new Board( new int[,] {
                { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
                { 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0 },
                { 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0 },
                { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 },
                { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 },
                { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 },
                { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 },
                { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 },
                { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
            });
            Combatant attacker = new Combatant("Attacker", board, new Point(1, 7));
            Combatant defender = new Combatant("Defender", board, new Point(10, 1));
            board.AddPawn(attacker);
            board.AddPawn(defender);

            attacker.Health = 10;
            defender.Health = 10;

            attacker.BaseStats = new Stats() {
                Attack = 10,
                Stamina = 25
            };

            attacker.AddPawnToView(defender);

            MeleeAttackSkill attack = new MeleeAttackSkill(attacker, new Point[] { Point.Right, 2 * Point.Right }) {
                ActionPoints = 3
            };
            attacker.AddSkill(attack);
            WalkSkill walk = new WalkSkill(attacker);
            attacker.AddSkill(walk);

            LostGen.Decision.ApproachMeleeRange approach = new LostGen.Decision.ApproachMeleeRange(attacker);
            approach.Target = defender;

            approach.Setup();
            approach.Run();

            board.BeginTurn();
            Assert.AreEqual(25, attacker.ActionPoints);

            board.Turn();
            Assert.AreEqual(new Point(10, 3), attacker.Position);
        }
开发者ID:RolandMQuiros,项目名称:Lost-Generation,代码行数:47,代码来源:ApproachAndAttackTests.cs

示例3: ArrangeBoard

        private void ArrangeBoard(int[,] grid, Point start, Point end, out Board board, out Combatant pawn)
        {
            board = new Board(grid);
            pawn = new Combatant("Walker", board, Point.One);

            Stats stats = new Stats() { Stamina = 100 };
            pawn.BaseStats = stats;

            board.AddPawn(pawn);

            WalkSkill walk = new WalkSkill(pawn);
            pawn.AddSkill(walk);

            walk.SetTarget(end);

            board.BeginTurn();
        }
开发者ID:RolandMQuiros,项目名称:Lost-Generation,代码行数:17,代码来源:Walk.cs

示例4: CreateCombatant

    public Combatant CreateCombatant(Board board, Point position)
    {
        string name;
        if (Nickname != null && Nickname.Length > 0) {
            name = Nickname;
        } else {
            name = FirstName + " " + LastName;
        }

        Combatant combatant = new Combatant(name, board, position);
        foreach (int skillID in _skills) {
            ISkill skill = _skillManager.GetSkill(skillID, combatant);
            combatant.AddSkill(skill);
        }

        combatant.BaseStats = BaseStats;

        return combatant;
    }
开发者ID:RolandMQuiros,项目名称:Lost-Generation,代码行数:19,代码来源:Character.cs


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