• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Combatant类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: StartThreadToFindTilesInRange

 public void StartThreadToFindTilesInRange(Combatant combatant, MapManager map)
 {
     this.combatant = combatant;
     this.map = map;
     thread = new System.Threading.Thread(FindTilesInRange);
     thread.Start();
 }
开发者ID:Shnagenburg,项目名称:TacticsGame,代码行数:7,代码来源:ThreadedFindTiles.cs


示例2: AddCombatant

    public void AddCombatant(Combatant combatant)
    {
        List<SkillButton> buttons;
        _buttons.TryGetValue(combatant, out buttons);

        if (buttons == null) {
            buttons = new List<SkillButton>();

            foreach (ISkill skill in combatant.Skills) {
                SkillButton newButton = CreateButton(skill);
                buttons.Add(newButton);
            }

            _buttons[combatant] = buttons;
        } else {
            foreach (ISkill skill in combatant.Skills.Except(buttons.Select(b => b.Skill))) {
                SkillButton newButton = CreateButton(skill);
                buttons.Add(newButton);
            }
        }

        if (_combatant == null) {
            _combatant = combatant;
            _page = SetPage(0);
        }
    }
开发者ID:RolandMQuiros,项目名称:Lost-Generation,代码行数:26,代码来源:PlayerSkillTray.cs


示例3: CalcDamage

    double CalcDamage(Combatant attacker, Combatant defender, Attack attack)
    {
        System.Random gen = new System.Random();
        double crit = 1.0;
        double attackPower = 0.0;
        double defensePower = 0.0;

        //does hit
        if(gen.NextDouble() * 100 > (attack.accuracy + attacker.perception))
        {
            return 0.0;
        }
        //is crit

        if(gen.NextDouble()*100 < (0.05+0.02 * attacker.luck))
        {
            crit = 1.5;
        }
        //do damage
        attackPower = attack.power * attacker.strength;
        defensePower = defender.defense + defender.getArmorValue();

        //return

        return (attackPower / defensePower) * crit;
    }
开发者ID:uwgb-socsc,项目名称:FetchQuest,代码行数:26,代码来源:Combat.cs


示例4: ThreadedCalculateAIOrder

 public ThreadedCalculateAIOrder(Combatant combatant, MapManager map)
 {
     this.combatant = combatant;
     this.map = map;
     thread = new System.Threading.Thread(Calculate);
     thread.Start();
 }
开发者ID:Shnagenburg,项目名称:TacticsGame,代码行数:7,代码来源:ThreadedCalculateAIOrder.cs


示例5: OnSkillActivated

    private void OnSkillActivated(Combatant combatant, ISkill skill)
    {
        // Unbind delegates from old skill
        if (_ranged != null) {
            _ranged.TargetChanged -= OnTargetChanged;
        } else if (_directional != null) {
            _directional.DirectionChanged -= OnDirectionChanged;
        }

        // Figure out origin from ActionQueue
        PawnAction lastAction = _combatant.LastAction;
        _origin = (lastAction == null) ? _combatant.Position : lastAction.PostRunPosition;

        // Figure out what kind of skill it is
        _ranged = skill as RangedSkill;
        _directional = skill as DirectionalSkill;

        // Bind delegates to new skill
        if (_ranged != null) {
            _ranged.TargetChanged += OnTargetChanged;
            OnTargetChanged(_ranged.Target);
        } else if (_directional != null) {
            _directional.DirectionChanged += OnDirectionChanged;
            OnDirectionChanged(_directional.Direction);
        }
    }
开发者ID:RolandMQuiros,项目名称:Lost-Generation,代码行数:26,代码来源:SkillView.cs


示例6: ApplyCondition

    /*
    ============================================================================
    Condition functions
    ============================================================================
    */
    public void ApplyCondition(Combatant c)
    {
        if(DataHolder.BattleSystem().IsActiveTime())
        {
            c.timeBar = this.timebar;
            if(c.timeBar > DataHolder.BattleSystem().maxTimebar)
            {
                c.timeBar = DataHolder.BattleSystem().maxTimebar;
            }
        }

        for(int i=0; i<this.setStatus.Length; i++)
        {
            if(this.setStatus[i])
            {
                c.status[i].SetValue(this.status[i], true, false, false);
            }
        }

        for(int i=0; i<this.effect.Length; i++)
        {
            if(SkillEffect.ADD.Equals(this.effect[i]))
            {
                c.AddEffect(i, c);
            }
            else if(SkillEffect.REMOVE.Equals(this.effect[i]))
            {
                c.RemoveEffect(i);
            }
        }
    }
开发者ID:hughrogers,项目名称:RPGQuest,代码行数:36,代码来源:GroupCondition.cs


示例7: 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


示例8: OnSkillDeactivated

 private void OnSkillDeactivated(Combatant combatant, ISkill skill)
 {
     _gridField.ClearPoints();
     _gridField.RebuildMesh();
     _ranged = null;
     _directional = null;
 }
开发者ID:RolandMQuiros,项目名称:Lost-Generation,代码行数:7,代码来源:SkillView.cs


示例9: MeleeAttackSkill

        /// <summary>
        /// Contruct a new MeleeAttackSkill.
        /// </summary>
        /// <param name="attacker">Reference to Attacking Combatant</param>
        /// <param name="areaOfEffect">
        /// Collection of Point offsets indicating which tiles around the attacker are affected by the attack.
        /// These offsets are rotated based on this skill's Direction attribute, and are defined based on the
        /// attacker facing east.
        /// </param>
        public MeleeAttackSkill(Combatant attacker, IEnumerable<Point> areaOfEffect = null)
            : base(attacker, "Melee Attack", "Attack an adjacent space")
        {
            if (areaOfEffect == null) {
                _areaOfEffect = new List<Point>();
            } else {
                _areaOfEffect = new List<Point>(areaOfEffect);
            }

            for (CardinalDirection d = CardinalDirection.East; d < CardinalDirection.Count; d++) {
                _transforms[d] = new Point[_areaOfEffect.Count];
            }

            for (int i = 0; i < _areaOfEffect.Count; i++) {
                Point east = _areaOfEffect[i];
                Point south = new Point(-east.Y, east.X);
                Point west = new Point(-east.X, -east.Y);
                Point north = new Point(east.Y, -east.X);

                _transforms[CardinalDirection.East][i] = east;
                _transforms[CardinalDirection.South][i] = south;
                _transforms[CardinalDirection.West][i] = west;
                _transforms[CardinalDirection.North][i] = north;

                _fullAreaOfEffect.Add(east);
                _fullAreaOfEffect.Add(south);
                _fullAreaOfEffect.Add(west);
                _fullAreaOfEffect.Add(north);
            }
        }
开发者ID:RolandMQuiros,项目名称:Lost-Generation,代码行数:39,代码来源:MeleeAttackSkill.cs


示例10: MoveAction

 public MoveAction(Combatant owner, Point start, Point end, bool isContinuous)
     : base(owner)
 {
     _start = start;
     _end = end;
     _isContinuous = isContinuous;
 }
开发者ID:RolandMQuiros,项目名称:Lost-Generation,代码行数:7,代码来源:MoveAction.cs


示例11: SquadUnit

 public SquadUnit(Combatant unit)
 {
     Unit = unit;
     Goal = new StateOffset();
     IsManual = true;
     Planner = new Planner(StateOffset.Heuristic);
 }
开发者ID:RolandMQuiros,项目名称:Lost-Generation,代码行数:7,代码来源:PlayerSquadController.cs


示例12: SetCombatant

    public void SetCombatant(Combatant combatant)
    {
        this.combatant = combatant;

        leftPane = CharacterPane.FindLeftPane();
        EnablePane();
        CreateBattleOrder();
    }
开发者ID:Shnagenburg,项目名称:TacticsGame,代码行数:8,代码来源:AIDirector.cs


示例13: BattleAction

 public BattleAction(AttackSelection t, Combatant u, int tID, int id, int ul)
 {
     this.type = t;
     this.user = u;
     this.targetID = tID;
     this.useID = id;
     this.useLevel = ul;
 }
开发者ID:hughrogers,项目名称:RPGQuest,代码行数:8,代码来源:BattleAction.cs


示例14: CharacterController

 public CharacterController(Combatant owner)
 {
     _owner = owner;
     _approachDecision = new Decision.ApproachMeleeRange(_owner);
     _planner.AddDecision(_approachDecision);
     _attackDecision = new Decision.AttackWithMelee(_owner);
     _planner.AddDecision(_attackDecision);
 }
开发者ID:RolandMQuiros,项目名称:Lost-Generation,代码行数:8,代码来源:CharacterPlanner.cs


示例15: Initialize

    public void Initialize(Combatant combatant, BoardGridField gridField)
    {
        _combatant = combatant;
        _combatant.SkillActivated += OnSkillActivated;
        _combatant.SkillDeactivated += OnSkillDeactivated;

        _gridField = gridField;
    }
开发者ID:RolandMQuiros,项目名称:Lost-Generation,代码行数:8,代码来源:SkillView.cs


示例16: SetCombatant

    public void SetCombatant(Combatant combatant)
    {
        Debug.Log("setting combant -" + combatant + "-");
        this.combatant = combatant;

        leftPane = CharacterPane.FindLeftPane();
        EnablePane();
    }
开发者ID:Shnagenburg,项目名称:TacticsGame,代码行数:8,代码来源:Menu.cs


示例17: GetActions

 public override Queue<Action> GetActions(Combatant me, List<Combatant> allies, List<Combatant> enemies)
 {
     Queue<Action> actions = new Queue<Action>();
     actions.Enqueue(new ActionInfo(me.combatantName + " uses Taunt!"));
     actions.Enqueue(new ActionBuff(me,"Taunt", 1));
     actions.Enqueue(new ActionPauseForFrames(60));
     actions.Enqueue(new ActionHideInfo());
     return actions;
 }
开发者ID:RommelLayco,项目名称:pirate-game-project,代码行数:9,代码来源:AbilityTaunt.cs


示例18: pickUp

 public void pickUp(Combatant currentCombatant)
 {
     this.currentCombatant = currentCombatant;
     transform.rotation = currentCombatant.transform.rotation;
     rb.isKinematic = true;
     collider.enabled = false;
     pickedUp = true;
     onPickUp();
 }
开发者ID:krylorz,项目名称:New-Space-Scavs-Repo,代码行数:9,代码来源:Item.cs


示例19: PopulateOptions

    public void PopulateOptions(Combatant combatant)
    {
        //options = combatant.Options;
        string message = string.Join("\n", options.ToArray());
        headerText.text = combatant.gameObject.name;
        optionsText.text = message;

        currentSelection = options [0];
    }
开发者ID:Shnagenburg,项目名称:TacticsGame,代码行数:9,代码来源:BattleMenu.cs


示例20: StartCombat

    //Combatant player;
    //Combatant enemy;

    public void StartCombat(Combatant player, Combatant enemy)
    {
        /*
        this.player = player;
        this.enemy = enemy;
        player.Initialize();
        enemy.Initialize();
        */
    }
开发者ID:mfindlater,项目名称:GGJ2016,代码行数:12,代码来源:Combat.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# CombineMode类代码示例发布时间:2022-05-24
下一篇:
C# Combat类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap