コード例 #1
0
ファイル: GameManager.cs プロジェクト: Bjeck/Medieval-Shuffle
    public void StartTargetAction(TargetReason r)
    {
        if (cm.hasDuelledthisTurn)
        {
            AddMessageToLog("Can only perform an action once per day");
            return;
        }
        if (inDuel != true)
        {
            if (state != State.Choose)
            {
                return;
            }
            if (!playur.playerCard.isInHand)
            {
                AddMessageToLog("Cannot do that when you are away.");
                return;
            }
            theButton.interactable = false;
            if (r == TargetReason.Bribe)
            {
                if (playur.playerCard.wealth <= 0)
                {
                    AddMessageToLog("Cannot bribe without money.");
                    return;
                }
                else
                {
                    targetReason = TargetReason.Bribe;
                    inDuel       = true;
                }
            }
            else if (r == TargetReason.Threaten)
            {
                targetReason = TargetReason.Threaten;
                inDuel       = true;
            }
            else if (r == TargetReason.Steal)
            {
                targetReason = TargetReason.Steal;
                inDuel       = true;
            }

            cm.duelPanel.SetActive(true);
            playur.playerCard.transform.SetParent(cm.duelPanel.transform); playur.playerCard.transform.SetAsLastSibling();
            playur.playerCard.transform.position = cm.card1.transform.position;
        }
        else
        {
            cm.CancelDuel();
        }
    }