示例#1
0
        public bool Move(Vector2 targetBoardLocation)
        {
            if (BattleBoard.GetBoardTile((int)targetBoardLocation.X, (int)targetBoardLocation.Y) == null)
            {
                return(false);
            }
            if (BattleBoard.GetBoardTile((int)targetBoardLocation.X, (int)targetBoardLocation.Y).occupyingDiceman != null)
            {
                return(false);
            }
            if (BoardLocation.X != -1 && BoardLocation.Y != -1)
            {
                BattleBoard.board[BoardLocX, BoardLocY].occupyingDiceman = null;
            }
            else
            {
                isOnBoard = true;
            }
            Vector2 tempLoc = BoardLocation;

            BoardLocation = targetBoardLocation;
            if (BattleBoard.GetBoardTile(BoardLocX, BoardLocY) != null)
            {
                BattleBoard.board[BoardLocX, BoardLocY].occupyingDiceman = this;
            }
            else
            {
                BoardLocation = tempLoc;
                return(false);
            }
            return(true);
        }
示例#2
0
 public override void Use(Diceman user, Diceman target, Vector2 firedBoardLocation)
 {
     foreach (Effect debuff in user.activeEffects)
     {
         if (!debuff.AllowedDiceAbilities()[2])
         {
             usageDescription = user.ownedByPlayer.playerName + "'s " + user.name + " is disabled!";
             return;
         }
     }
     for (int i = -range; i <= range; i++)
     {
         for (int j = -range; j <= range; j++)
         {
             if (BattleBoard.GetBoardTile(user.BoardLocX + i, user.BoardLocY + j) != null)
             {
                 target = BattleBoard.GetBoardTile(user.BoardLocX + i, user.BoardLocY + j).occupyingDiceman;
                 if (target != null && target.isAlive && target.ownedByPlayer != user.ownedByPlayer)
                 {
                     float damageDealt = user.strength * damage;
                     usageDescription = target.DamageDice(damageDealt);
                     user.Move(firedBoardLocation);
                     usageDescription += " and \n" + user.ownedByPlayer.playerName + "'s " + user.name + " vaulted away.";
                     return;
                 }
             }
         }
     }
     usageDescription = name + " failed as no enemies \nwere in range.";
 }
        public override void Use(Diceman user, Diceman target, Vector2 firedBoardLocation)
        {
            foreach (Effect debuff in user.activeEffects)
            {
                if (!debuff.AllowedDiceAbilities()[2])
                {
                    usageDescription = user.ownedByPlayer.playerName + "'s " + user.name + " is disabled!";
                    return;
                }
            }
            int            hitsCount = Constant.a_multishotHits;
            List <Diceman> diceHit   = new List <Diceman>();

            if (target.isAlive && BattleBoard.GetBlockDistanceBetweenDice(user, target) <= range)
            {
                float damageDealt = user.strength * damage;
                usageDescription = target.DamageDice(damageDealt);
                hitsCount--;
                diceHit.Add(target);
            }
            for (int i = -range; i <= range; i++)
            {
                for (int j = -range; j <= range; j++)
                {
                    if (BattleBoard.GetBoardTile(user.BoardLocX + i, user.BoardLocY + j) != null && hitsCount > 0)
                    {
                        target = BattleBoard.GetBoardTile(user.BoardLocX + i, user.BoardLocY + j).occupyingDiceman;
                        foreach (Diceman dice in diceHit)
                        {
                            if (dice == target)
                            {
                                target = null;
                            }
                        }
                        if (target != null && target.isAlive && target.ownedByPlayer != user.ownedByPlayer &&
                            BattleBoard.GetBlockDistanceBetweenDice(user, target) <= range)
                        {
                            float damageDealt = user.strength * damage;
                            if (hitsCount == Constant.a_multishotHits)
                            {
                                usageDescription = "";
                            }
                            usageDescription += target.DamageDice(damageDealt);
                            hitsCount--;
                        }
                    }
                }
            }
            if (hitsCount == Constant.a_multishotHits)
            {
                usageDescription = name + " failed as no enemies \nwere in range.";
            }
            else
            {
                usageDescription += ".";
            }
        }
示例#4
0
        public override bool Target(Diceman user, Diceman target, Vector2 firedBoardLocation)
        {
            if (BattleBoard.GetBoardTile(firedBoardLocation) != null &&
                BattleBoard.GetBoardTile(firedBoardLocation).occupyingDiceman == null &&
                user.isAlive)
            {
                return(true);
            }
            String failString = "";

            if (user.isAlive == false)
            {
                failString = " as " + user.name + " is dead.";
            }
            else if (BattleBoard.GetBoardTile(firedBoardLocation).occupyingDiceman != null)
            {
                failString = " as position is occupied.";
            }
            usageDescription = name + " failed" + failString;
            return(false);
        }