Example #1
0
    public Zone GetZone(Zone.Types Type, bool CurrentPlayer = true)
    {
        //11 0 - p1
        //10 1 - p2
        //01 1 - p2
        //00 0 - p1
        BoardHalf half = (PlayerOnesTurn == CurrentPlayer) ? player1Half : player2Half;

        switch (Type)
        {
        case Zone.Types.Hand:
            return(half.Hand);

        case Zone.Types.Melee:
            return(half.Melee);

        case Zone.Types.Ranged:
            return(half.Ranged);

        case Zone.Types.Siege:
            return(half.Siege);

        case Zone.Types.Deck:
            return(half.Deck);

        case Zone.Types.Discard:
            return(half.Discard);

        case Zone.Types.Weather:
            return(weather);

        default:
            return(null);
        }
    }
Example #2
0
    private void InitialiseZone(BoardHalf b, bool player1)
    {
        Zone.IsVisibleTo visibleTo    = (player1) ? Zone.IsVisibleTo.Player1 : Zone.IsVisibleTo.Player2;
        Zone.IsVisibleTo notVisibleTo = (player1) ? Zone.IsVisibleTo.Player2 : Zone.IsVisibleTo.Player1;

        b.Hand.Type      = Zone.Types.Hand;
        b.Hand.VisibleTo = visibleTo;

        b.Deck.Type      = Zone.Types.Deck;
        b.Deck.VisibleTo = Zone.IsVisibleTo.None;

        b.Discard.Type      = Zone.Types.Discard;
        b.Discard.VisibleTo = visibleTo;

        b.Melee.Type      = Zone.Types.Melee;
        b.Melee.VisibleTo = Zone.IsVisibleTo.Both;

        b.Ranged.Type      = Zone.Types.Ranged;
        b.Ranged.VisibleTo = Zone.IsVisibleTo.Both;

        b.Siege.Type      = Zone.Types.Siege;
        b.Siege.VisibleTo = Zone.IsVisibleTo.Both;
    }
 // Start is called before the first frame update
 void Start()
 {
     myBoard = GetComponentInParent <BoardHalf>();
     myBoard.AddBlock(this.gameObject);
     myColor = GetComponent <Renderer>().material.color;
 }
Example #4
0
    public void HighlightNewZone(Card card, bool highlightPlayerOne)
    {
        //Unhighlight any previously highlighted zones
        UnHighlightZones();

        BoardHalf half = (highlightPlayerOne) ? player1Half : player2Half;

        if (card.Special)
        {
            switch (card.Ability)
            {
            case Card.Abilities.Decoy:
                //highlight cards in battlefield zones
                HighlightCardsInZone(half.Melee);
                HighlightCardsInZone(half.Ranged);
                HighlightCardsInZone(half.Siege);
                break;

            case Card.Abilities.Scorch:
                //highlight all 3 zones
                Highlight(half.Melee);
                Highlight(half.Ranged);
                Highlight(half.Siege);
                break;

            case Card.Abilities.Horn:
                //highlight the three horn zones
                if (half.Melee.ZoneHorn.SpecialHorn == null)
                {
                    Highlight(half.Melee.ZoneHorn);
                }
                if (half.Ranged.ZoneHorn.SpecialHorn == null)
                {
                    Highlight(half.Ranged.ZoneHorn);
                }
                if (half.Siege.ZoneHorn.SpecialHorn == null)
                {
                    Highlight(half.Siege.ZoneHorn);
                }
                break;
            }
            if (card.Ability == Card.Abilities.Decoy)
            {
            }
            else if (card.Ability == Card.Abilities.Horn)
            {
            }
        }
        else
        {
            UnitCard unitCard = (UnitCard)card;
            if (unitCard.Section == UnitCard.Sections.Melee)
            {
                //highlight melee
                Highlight(half.Melee);
            }
            else if (unitCard.Section == UnitCard.Sections.Ranged)
            {
                //ranged
                Highlight(half.Ranged);
            }
            else if (unitCard.Section == UnitCard.Sections.Siege)
            {
                //siege
                Highlight(half.Siege);
            }
            else //if (unitCard.Section == UnitCard.Sections.Agile)
            {
                //melee & ranged
                Highlight(half.Melee);
                Highlight(half.Ranged);
            }
        }
    }