Пример #1
0
    public PlayerScript Draw(bool destroyOnFailure = true)
    //	If no space in hand,
    //		trigger removal effect
    //		destroy card if specified
    {
        CardScript drawCardScript = myDeckScript.RemoveCard();

        if (null != drawCardScript)
        {
            /*myFrameData.myDraws++;
             * myTurnData.myFrameData.myDraws++;
             * myMatchData.myTurnData.myFrameData.myDraws++;
             *
             * GlobalScript.ourPlayerFrameData.myDraws++;
             * GlobalScript.ourPlayerTurnData.myFrameData.myDraws++;
             * GlobalScript.ourPlayerMatchData.myTurnData.myFrameData.myDraws++;*/

            //	If false, then hand was over capacity,
            //	But the removal effect for the card should go off
            if (false == myHandScript.InsertCard(drawCardScript))
            {
                EffectScript.AffectsList(drawCardScript.myRemoveEffects, ToMessage());

                //failed to draw card so destroy if specified
                if (destroyOnFailure)
                {
                    Destroy(drawCardScript.gameObject);
                }
            }
        }

        return(this);
    }