Beispiel #1
0
    public void HandleIncomingCombat(int theirID, int myID)
    {
        PlayableCard   myCard    = null;
        PlayableMinion theirCard = null;

        foreach (PlayableCard c in myPlayingFieldOrganizer.cards)
        {
            if (c.networkID == myID)
            {
                myCard = (PlayableMinion)c;
                continue;
            }
        }
        foreach (PlayableCard c in opponentFieldOrganizer.cards)
        {
            if (c.networkID == theirID)
            {
                theirCard = (PlayableMinion)c;
                continue;
            }
        }
        foreach (PlayableCard c in heroCards)
        {
            if (c.networkID == myID)
            {
                myCard = c;
                continue;
            }
        }
        if (myCard != null && theirCard != null)
        {
            myCard.RecieveAttack(theirCard);
            theirCard.RecieveAttack(myCard);
        }
    }
    void BeginAttack(PlayableCard card)
    {
        //LOTS OF PLACEHOLDER CODE HERE
        SetToReady(false);
        PlayableMinion me = GetComponent <PlayableMinion>();

        card.RecieveAttack(me);
        me.RecieveAttack(card);
        MatchMessageHandleCombat combat = new MatchMessageHandleCombat(me.networkID, card.networkID);

        MatchCommunicationManager.Instance.SendMatchStateMessage(MatchMessageType.UnitAttacked, combat);
    }