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


C# Maps.BattleMap类代码示例

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


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

示例1: updateNTCD

        // Updates the stat effect without messing the turn countdown thing
        public void updateNTCD(Unit unit, ref BattleMap map)
        {
            if(effectEvent== null)
                return;

            effectEvent(ref unit, ref map);
        }
开发者ID:pgonzbecer,项目名称:Conquest,代码行数:8,代码来源:StatEffect.cs

示例2: AttackDecisionGui

        // --- Constructors ---
        public AttackDecisionGui(GSGameplay pmGState, ref GameExt pmGame, ref BattleMap pmMap)
        {
            gstate=	pmGState;
            game=	pmGame;
            map=	pmMap;

            background=	new Control(game);
            leftPanel=	new Control(game);
            rightPanel=	new Control(game);
            lpName=	new Label(game);
            lpStats=	new Label[8];
            for(int i= 0; i< lpStats.Length; i++)
                lpStats[i]=	new Label(game);
            rpName=	new Label(game);
            rpStats=	new Label[8];
            for(int i= 0; i< rpStats.Length; i++)
                rpStats[i]=	new Label(game);
            accuracyLbl=	new Label(game);
            accuracy=	new Label(game);
            critLbl=	new Label(game);
            crit=	new Label(game);
            dmgLbl=	new Label(game);
            dmg=	new Label(game);
            commit=	new Button(game);
            cancel=	new Button(game);
        }
开发者ID:pgonzbecer,项目名称:Conquest,代码行数:27,代码来源:AttackDecisionGui.cs

示例3: SkillsGui

 // --- Constructors ---
 public SkillsGui(GSGameplay pmGState, ref GameExt pmGame, ref BattleMap pmMap)
 {
     gstate=	pmGState;
     game=	pmGame;
     map=	pmMap;
     tick=	0;
     set=	new Control(game);
 }
开发者ID:pgonzbecer,项目名称:Conquest,代码行数:9,代码来源:SkillsGui.cs

示例4: weakShock

 // Deals a weak shock to the unit
 public static bool weakShock(ref Unit unit, int x, int y, Trap trap, ref BattleMap map, ref Unit parent)
 {
     if(unit== null)
         return false;
     unit.health-=	8;
     Console.WriteLine("Dealt 8 damage, Unit's hp: "+unit.health);
     return true;
 }
开发者ID:pgonzbecer,项目名称:Conquest,代码行数:9,代码来源:Trap.cs

示例5: activate

        // --- Methods ---
        // Activates the trap on the given victim. Returns if actually activated or not
        public bool activate(ref Unit victim, ref BattleMap map)
        {
            if(teamID== map.getTeamID(victim.mapPos))
                return false;
            if(trapEvent== null)
                return false;

            return trapEvent(ref victim, victim.mapPos[0], victim.mapPos[1], this, ref map, ref parent);
        }
开发者ID:pgonzbecer,项目名称:Conquest,代码行数:11,代码来源:Trap.cs

示例6: calculateAccuracy

        // Calculates the accuracy between the two units
        public static float calculateAccuracy(ref Unit attacker, ref Unit defender, ref BattleMap map)
        {
            // Variables
            int	adjacentAlliesAttacker=	map.findAllies(defender.mapPos[0], defender.mapPos[1], 1, 1, map.getTeamID(attacker.mapPos)).size;
            int	adjacentAlliesDefender=	map.findAllies(attacker.mapPos[0], attacker.mapPos[1], 1, 1, map.getTeamID(defender.mapPos)).size;
            int	distance=	(defender.level-attacker.level);

            return MathHelper.Clamp((100f-2f*distance-4*adjacentAlliesDefender+4*adjacentAlliesAttacker)/100f, 0f, 1f);
        }
开发者ID:pgonzbecer,项目名称:Conquest,代码行数:10,代码来源:AttackInfo.cs

示例7: ai_attackUnit

 // Attacks the unit
 public virtual void ai_attackUnit(Unit unit, BattleMap map, AttackInfo info, bool isUncontrollable)
 {
     map.attackSearch(unit.mapPos[0], unit.mapPos[1], info.range[0], info.range[1]);
     System.Threading.Thread.Sleep(1000);
     map.gstate.attackDecisionGui.open(ref info);
     System.Threading.Thread.Sleep(2500);
     game.gui.close("attack_decision");
     map.gstate.stage=	0;
     map.makeUnitAttack(map.getFullUnitID(unit.mapPos), map.getUnitX(info.defenderID), map.getUnitY(info.defenderID), ref info);
 }
开发者ID:pgonzbecer,项目名称:Conquest,代码行数:11,代码来源:Profession.cs

示例8: EnemyUnitGui

 // --- Constructors ---
 public EnemyUnitGui(GSGameplay pmGState, ref GameExt pmGame, ref BattleMap pmMap)
 {
     gstate=	pmGState;
     game=	pmGame;
     map=	pmMap;
     set=	new Control(game);
     skills=	new Button(game);
     stats=	new Button(game);
     exit=	new Button(game);
     tick=	0;
 }
开发者ID:pgonzbecer,项目名称:Conquest,代码行数:12,代码来源:EnemyUnitGui.cs

示例9: ai_getTarget

        // Gets the target
        public virtual void ai_getTarget(Unit unit, BattleMap map, bool isUncontrollable, out int[] target, out int[] spotToMoveTo, out AttackInfo info)
        {
            info=	new AttackInfo();
            info.range=	new int[] {1, 1};

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

            spotToMoveTo=	map.findAISpot(unit.mapPos[0], unit.mapPos[1], info.range, map.aggressiveAI);
            target=	map.tiles.items[spotToMoveTo[0], spotToMoveTo[1]].t;
            info=	AttackInfo.createBasicAttack(map.getFullUnitID(unit.mapPos), target, ref map);
        }
开发者ID:pgonzbecer,项目名称:Conquest,代码行数:12,代码来源:Profession.cs

示例10: update

        // --- Methods ---
        // Updates the stat effect, and returns if the effect should be destroyed or not
        public bool update(Unit unit, ref BattleMap map)
        {
            if(effectEvent== null)
                return true;

            effectEvent(ref unit, ref map);

            turnsLeft--;

            return (turnsLeft== 0);
        }
开发者ID:pgonzbecer,项目名称:Conquest,代码行数:13,代码来源:StatEffect.cs

示例11: PlayerUnitGui

 // --- Constructors ---
 public PlayerUnitGui(GSGameplay pmGState, ref GameExt pmGame, ref BattleMap pmMap)
 {
     gstate=	pmGState;
     game=	pmGame;
     map=	pmMap;
     set=	new Control(game);
     move=	new Button(game);
     skills=	new Button(game);
     stats=	new Button(game);
     end=	new Button(game);
     exit=	new Button(game);
     tick=	0;
     refd=	false;
 }
开发者ID:pgonzbecer,项目名称:Conquest,代码行数:15,代码来源:PlayerUnitGui.cs

示例12: Tile

 // --- Constructors ---
 public Tile(GameExt pmGame, Vector3 pmPos, ref BattleMap pmMap)
     : base(pmGame, pmGame.models.get("tile"), pmPos)
 {
     texture=	game.textures.get(getTextureName());
     unitID=	new int[]	{-1, -1};
     startZoneID=	-1;
     map=	pmMap;
     pos-=	new Vector3(-Tile.size/2f, 0f, Tile.size/2f);
     bounds=	new float[]	{
         pmPos.X, pmPos.X+Tile.size,
         pmPos.Z-Tile.size, pmPos.Z
     };
     trap=	null;
     color=	getNormalColor();
 }
开发者ID:pgonzbecer,项目名称:Conquest,代码行数:16,代码来源:Tile.cs

示例13: createFromBitmap

        // --- Static Methods ---
        // Creates a map from a bitmap
        public static BattleMap createFromBitmap(string filename, ref GameExt game, GSGameplay gstate)
        {
            // Variables
            Sdx.Bitmap	bitmap=	new Sdx.Bitmap(filename);
            BattleMap	map=	new BattleMap(ref game, gstate, bitmap.Width, bitmap.Height);

            for(int h= 0; h< map.width; h++)
            {
                for(int k= 0; k< map.height; k++)
                {
                    map.tiles.items[h, k].item=	Tile.getTileFromColor(bitmap.GetPixel(h, k), h, k, ref game, map);
                }
            }

            return map;
        }
开发者ID:pgonzbecer,项目名称:Conquest,代码行数:18,代码来源:BattleMap.cs

示例14: attackUnit

        // Makes the unit attack the given unit, given that unit's coords on the map, the name of the attack, and a reference to the map
        public override bool attackUnit(Unit unit, bool initiatedAttack, ref Unit victim, int x, int y, ref AttackInfo info, ref BattleMap map)
        {
            switch(info.skillID)
            {
                case "basic_attack":
                case "precise_strike":
                case "serpent\'s_sting":
                case "vigilant_strike":
                case "lethal_strike":
                {
                    if(victim== null)
                        break;

                    victim.takeDamage(ref info, ref unit, ref map);
                    unit.mana=	info.projAttackerStats[1];

                    if(!info.missed && unit.isAlive && !unit.isAI)
                        unit.gainExp(ref victim, ref map);
                };return true;

                case "meditation":	{
                    unit.health=	info.projAttackerStats[0];
                    unit.mana=	info.projAttackerStats[1];
                    unit.attack=	info.projAttackerStats[2];
                    unit.originalAttack=	info.projAttackerStats[2];
                };return true;

                case "hone_skill":	{
                    isSkillHoned=	true;
                };return true;

                case "sun\'s_might":	{
                    if(victim== null)
                        break;

                    victim.takeDamage(ref info, ref unit, ref map);
                    unit.health=	Math.Max((int)(unit.health+(0.15f*info.damage)), unit.originalHealth);
                    unit.mana=	Math.Max((int)(info.projAttackerStats[1]+(0.15f*info.damage)), unit.originalMana);

                    if(!info.missed && unit.isAlive && !unit.isAI)
                        unit.gainExp(ref victim, ref map);
                };return true;
            }

            return false;
        }
开发者ID:pgonzbecer,项目名称:Conquest,代码行数:47,代码来源:Samurai.cs

示例15: UnitLevelUpGui

        // --- Constructors ---
        public UnitLevelUpGui(ref GameExt pmGame, ref BattleMap pmMap)
        {
            game=	pmGame;
            map=	pmMap;

            background=	new Control(game);
            name=	new Label(game);
            level=	new Label(game);
            statsLbl=	new Label[8];
            stats=	new Button[8];
            for(int i= 0; i< statsLbl.Length; i++)
            {
                statsLbl[i]=	new Label(game);
                stats[i]=	new Button(game);
            }

            isOpened=	false;
            unit=	null;
        }
开发者ID:pgonzbecer,项目名称:Conquest,代码行数:20,代码来源:UnitLevelUpGui.cs


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