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


C# BattleMap.endUnitWalking方法代码示例

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


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

示例1: updateAINormal

        // Updates the ai normally
        public virtual void updateAINormal(Unit unit, BattleMap map)
        {
            // Variables
            int[]	spot;
            int[]	target=	map.getClosestEnemy(unit.mapPos[0], unit.mapPos[1], map.getTeamID(unit.mapPos));
            AttackInfo	info=	AttackInfo.createBasicAttack(map.getFullUnitID(unit.mapPos), target, ref map);
            int	heuristic;

            // Get Target
            info.range=	new int[] {1, 1};

            map.aiSearch(unit.mapPos[0], unit.mapPos[1], unit.move, info.range[1], false, map.getTeamID(unit.mapPos), info, target);

            spot=	map.findAISpot(unit.mapPos[0], unit.mapPos[1], info.range, map.aggressiveAI);

            if(!unit.isWalkingDone)
            {
                ai_moveUnit(unit, map, spot, false);

                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, false);

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

                if(unit.isTurnEnded)
                    return;
            }
        }
开发者ID:pgonzbecer,项目名称:Conquest,代码行数:40,代码来源:Profession.cs

示例2: attackUnit


//.........这里部分代码省略.........
                    for(int i= 0; i< allies.size; i++)
                    {
                        map.teams.items[allies.items[i][0]].units.items[allies.items[i][1]].heal(
                            map.teams.items[allies.items[i][0]].units.items[allies.items[i][1]].originalHealth,
                            ref unit,
                            ref map
                        );
                    }

                    unit.addStatEffect(
                        new StatEffect(
                            EffectType.Debuff,
                            "Humility",
                            "-75% to all stats",
                            healingPrayerSE,
                            2
                        ),
                        ref map
                    );

                    if(unit.isAlive && !unit.isAI)
                        unit.gainExp(256*allies.size, ref map);
                };break;

                case "mend":	{
                    if(victim== null)
                        return false;
                    victim.heal(-1*info.damage, ref unit, ref map);

                    if(unit.isAlive && !unit.isAI)
                        unit.gainExp(ref victim, ref map);
                };break;

                case "prophetic_reap":	{
                    if(activatedPropheticReap)
                        return false;

                    activatedPropheticReap=	true;
                    unit.addStatEffect(
                        new StatEffect(
                            EffectType.Buff,
                            "Prophetic Prayer",
                            "Deal "+((float)(unit.magic)/7f)+" damage to all enemies once dissipated",
                            propheticReapSE,
                            3
                        ),
                        ref map
                    );
                };break;

                case "banish_spirits":	{
                    if(victim== null)
                        return false;

                    victim.addStatEffect(
                        new StatEffect(
                            EffectType.Buff,
                            "Banish Spirits",
                            "+10% Atk",
                            positiveBanishSpiritsSE,
                            3
                        ),
                        ref map
                    );
                    victim.addStatEffect(
                        new StatEffect(
                            EffectType.Debuff,
                            "Banish Spirits",
                            "-15% Def and Res",
                            negativeBanishSpiritsSE,
                            3
                        ),
                        ref map
                    );
                    victim.addStatEffect(
                        StatEffect.create(StatusEffect.Enraged, 3),
                        ref map
                    );
                };break;

                case "rest_in_god":	{
                    if(victim== null)
                        return false;

                    victim.addStatEffect(
                        new StatEffect(
                            EffectType.Buff,
                            "God\'s Blessing",
                            "+20 to all stats",
                            restInGodSE,
                            1
                        ),
                        ref map
                    );
                    map.endUnitWalking(map.getFullUnitID(unit.mapPos));
                };break;
            }

            return true;
        }
开发者ID:pgonzbecer,项目名称:Conquest,代码行数:101,代码来源:Cardinal.cs


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