Пример #1
0
 public void HealRollCard(GameBoardPlayer player, Card card)
 {
     player.GetGameBoardManager().DiceShooter.Shoot(x =>
     {
         int sum = x.Select(a =>
         {
             if (a.Value == null)
             {
                 return(int.Parse(a.Key.ApproximateValue()));
             }
             else
             {
                 return(int.Parse(a.Value));
             }
         }).Sum();
         Debug.Log("Healing by " + sum);
         player.Health = Mathf.Min(100, player.Health + sum);
         foreach (var item in x.Keys)
         {
             Destroy(item.gameObject);
         }
     }, Resources.Load <Dice>("Dice/Dice4"),
                                                    Resources.Load <Dice>("Dice/Dice6"),
                                                    Resources.Load <Dice>("Dice/Dice8"),
                                                    Resources.Load <Dice>("Dice/Dice4"),
                                                    Resources.Load <Dice>("Dice/Dice4")
                                                    );
 }
        public void ElevatorLandEffect(GameBoardEntity entity, Vector3Int coordinates)
        {
            GameBoardPlayer  player    = entity.GetComponent <GameBoardPlayer>();
            GameBoardManager manager   = player.GetGameBoardManager();
            Vector3Int       newCoords = new Vector3Int(coordinates.x, coordinates.y == 0 ? 1 : 0, coordinates.z);

            if (manager.GetTile(newCoords).PathType != GameBoardPathType.BLOCKED)
            {
                player.GetComponent <GameBoardPlayer>().SetCoordinates(newCoords);
            }
        }