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


C# Unit.hasStatEffect方法代码示例

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


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

示例1: updateAI

        // Updates the ai, broad spectrum
        public virtual void updateAI(Unit unit, BattleMap map)
        {
            if(updatingAI)
                return;

            if(unit.hasStatEffect("Enrage"))
                updateAIEnrage(unit, map);
            else
                updateAINormal(unit, map);
            /*
            // Variables
            int[]	target;
            int[]	spotToMoveTo;
            AttackInfo	info;
            int	heuristic;
            bool	isUncontrollable=	unit.hasStatEffect("Enrage");

            updatingAI=	true;

            ai_getTarget(unit, map, isUncontrollable, out target, out spotToMoveTo, out info);
            map.destroyPaths();

            if(target== null || target[0]== -1)
            {
                map.endUnitTurn(map.getFullUnitID(unit.mapPos));

                return;
            }

            heuristic=	map.getHeuristic(unit.mapPos, map.getUnitXY(target));

            if(!unit.isAttackingDone && heuristic>= info.range[0] && heuristic<= info.range[1])
            {
                ai_attackUnit(unit, map, info, isUncontrollable);

                map.destroyPaths();
                map.endUnitAttacking(map.getFullUnitID(unit.mapPos));

                if(unit.isTurnEnded)
                {
                    return;
                }
            }

            if(!unit.isWalkingDone)
            {
                if(!movesByProximity() || map.isEnemyWithinProximity(unit.mapPos[0], unit.mapPos[1], unit.move, map.getTeamID(unit.mapPos), target))
                    ai_moveUnit(unit, map, spotToMoveTo, isUncontrollable);

                map.destroyPaths();
                map.endUnitWalking(map.getFullUnitID(unit.mapPos));

                if(unit.isTurnEnded)
                {
                    return;
                }
            }

            heuristic=	map.getHeuristic(unit.mapPos, map.getUnitXY(target));

            if(!unit.isAttackingDone && heuristic>= info.range[0] && heuristic<= info.range[1])
            {
                ai_attackUnit(unit, map, info, isUncontrollable);

                map.destroyPaths();
                map.endUnitAttacking(map.getFullUnitID(unit.mapPos));

                if(unit.isTurnEnded)
                {
                    return;
                }
            }

            map.destroyPaths();
            map.endUnitTurn(map.getFullUnitID(unit.mapPos));*/
        }
开发者ID:pgonzbecer,项目名称:Conquest,代码行数:77,代码来源:Profession.cs

示例2: onMissedAttack

 // Called when the unit's attack has missed
 public override void onMissedAttack(Profession prof, ref Unit unit, int amount, ref Unit victim, ref BattleMap map)
 {
     if(!unit.hasStatEffect("Enraged"))
         return;
     if(Start.rng.Next(0, 10)< 3)
         victim.addStatEffect(StatEffect.create(StatusEffect.Enraged, 3), ref map);
 }
开发者ID:pgonzbecer,项目名称:Conquest,代码行数:8,代码来源:Berserker.cs

示例3: onTakeDamage

            // --- Inherited Methods ---
            // Called when the unit has taken damage
            public override int onTakeDamage(Profession prof, ref Unit unit, int oldHealth, int newHealth, int amount, ref Unit instigator, ref BattleMap map)
            {
                if(!unit.hasStatEffect("Enraged"))
                    return amount;
                if(Start.rng.Next(0, 10)< 3)
                    instigator.addStatEffect(StatEffect.create(StatusEffect.Enraged, 3), ref map);

                return amount;
            }
开发者ID:pgonzbecer,项目名称:Conquest,代码行数:11,代码来源:Berserker.cs

示例4: onDealtDamage

            // Called when the unit is about to deal damage
            public override int onDealtDamage(Profession prof, ref Unit unit, int victimHP, int amount, ref Unit victim, ref BattleMap map)
            {
                if(!unit.hasStatEffect("Enraged"))
                    return amount;
                if(Start.rng.Next(0, 10)< 3)
                    victim.addStatEffect(StatEffect.create(StatusEffect.Enraged, 3), ref map);

                return amount;
            }
开发者ID:pgonzbecer,项目名称:Conquest,代码行数:10,代码来源:Berserker.cs


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