예제 #1
0
    /// <summary>
    ///
    /// Initialises a status effect indicator on a unit counter
    ///
    /// </summary>
    public void InitIndicator(TileStatuses _tileStatus, int sourcePlayerId)
    {
        tileStatus = _tileStatus;

        statusColour.color    = GameManager.instance.colourManager.GetTileStatusColour(tileStatus);
        sourcePlayerText.text = sourcePlayerId.ToString();
    }
예제 #2
0
    public void AddTileStatus(TileStatuses tileStatus, int sourcePlayerId)
    {
        if (!cellTileStatuses.Any(x => x.Key == tileStatus && x.Value == sourcePlayerId))
        {
            cellTileStatuses.Add(new KeyValuePair <TileStatuses, int>(tileStatus, sourcePlayerId));

            RefreshTileStatus();

            switch (tileStatus)
            {
            case TileStatuses.Survey:
                if (occupantCounter != null)
                {
                    occupantCounter.Unit.Unstealth();
                }
                GameManager.instance.CheckWarden();
                break;

            case TileStatuses.Earthquake:
                if (occupantCounter != null)
                {
                    occupantCounter.Unit.DamageUnit(GameManager.instance.GetPlayer(sourcePlayerId), EARTHQUAKE_DAMAGE);
                }
                //Need to add movement cost modifier in here
                break;

            case TileStatuses.WallOfFire:
                if (occupantCounter != null)
                {
                    occupantCounter.Unit.DamageUnit(GameManager.instance.GetPlayer(sourcePlayerId), WALL_OF_FIRE_DAMAGE);
                }
                break;

            case TileStatuses.Sanctuary:
                if (occupantCounter != null)
                {
                    if (occupantCounter.Unit.Owner.Id == sourcePlayerId)
                    {
                        occupantCounter.Unit.HealUnit(SANCTUARY_HEAL);
                    }
                }
                break;

            case TileStatuses.Consecrate:
                if (occupantCounter != null)
                {
                    if (occupantCounter.Unit.Owner.Id != sourcePlayerId)
                    {
                        occupantCounter.Unit.DamageUnit(GameManager.instance.GetPlayer(sourcePlayerId), CONSECREATE_DAMAGE);
                    }
                }
                break;
            }
        }
    }
예제 #3
0
    /// <summary>
    ///
    /// Obtain a particular tile status colour
    ///
    /// </summary>
    public Color GetTileStatusColour(TileStatuses tileStatus)
    {
        var tileStatusColour = new Color();

        tileStatusColour = tileStatusColours.FirstOrDefault(x => x.tileStatus == tileStatus).statusColour;
        if (tileStatusColour == null)
        {
            tileStatusColour = new Color();
        }
        return(tileStatusColour);
    }
예제 #4
0
 public void SetTileStatusMode(TileStatuses tileStatus)
 {
     ActiveEffect       = ActiveEffectTypes.TileStatus;
     SelectedTileStatus = tileStatus;
 }