Exemplo n.º 1
0
    public void Move(int moves)
    {
        if (NoPlayTurns > 0)
        {
            this.AnimationActive = true;
            NoPlayTurns--;
            Menu.SetActive(true);
            bpm      = Menu.GetComponent <BuyPropertyMenu>();
            bpm.done = InJail;
            bpm.GenericMenu("You Are Still In Prison");
            if (NoPlayTurns == 0)
            {
                PropAction = Database.PROPERTY_ACTION.NONE;
            }
        }
        else
        {
            playerAnimations.setOnMove(moves);
            AnimationActive = true;
            playerInfo.Move(moves);
        }

        dice1.transform.localPosition = dice1.GetComponent <DiceScript>().initPosition;
        dice2.transform.localPosition = dice2.GetComponent <DiceScript>().initPosition;
    }
Exemplo n.º 2
0
    public void FinishedMovement()
    {
        // Just To be sure
        if (database == null)
        {
            GameRunner gr = Manager.GetComponent <GameRunner>();
            this.database = gr.database;
        }

        if (PropAction == Database.PROPERTY_ACTION.INJAIL)     // If he was supposed to go to jail, no action is needed
        {
            NoPlayTurns = 3;
            done();
            return;
        }


        // Get Property
        Property prop = database.GetProperty(playerInfo.x, playerInfo.y);

        PropAction = database.GetNextAction(prop, playerInfo);

        Menu.SetActive(true);

        bpm = Menu.GetComponent <BuyPropertyMenu>();
        bpm.PropertyArriveMessage(prop, playerInfo, database);
        bpm.done = MenuAnswer;
    }
Exemplo n.º 3
0
    public void MenuAnswer(bool answer)
    {
        if (answer)
        {
            switch (PropAction)
            {
            case Database.PROPERTY_ACTION.BUYPROPERTY:
                database.BuyProperty(playerInfo, playerInfo.x, playerInfo.y);
                PropAction = Database.PROPERTY_ACTION.WAITINGFORUSERTOGETPROPERTYCARD;

                showPickCardMenu();
                break;

            case Database.PROPERTY_ACTION.RENTPROPERTY:

                database.RentProperty(playerInfo);
                PropAction = Database.PROPERTY_ACTION.NONE;
                break;

            case Database.PROPERTY_ACTION.PAYTAXES:
                database.PayTaxes(playerInfo, database.GetProperty(playerInfo.x, playerInfo.y).value);
                PropAction = Database.PROPERTY_ACTION.NONE;
                break;

            case Database.PROPERTY_ACTION.READCHANCECARD:
                //PropAction = Database.PROPERTY_ACTION.CHANGECARD;
                PropAction = Database.PROPERTY_ACTION.NONE;
                break;

            case Database.PROPERTY_ACTION.GOTOJAIL:
                // GO TO JAIL

                playerAnimations.setOnMove(20);
                playerInfo.Move(20);
                PropAction = Database.PROPERTY_ACTION.INJAIL;
                break;

            case Database.PROPERTY_ACTION.RETRIEVECENTERMONEY:
                database.GiveCenterMoney2Player(playerInfo);
                PropAction = Database.PROPERTY_ACTION.NONE;
                break;

            case Database.PROPERTY_ACTION.VISITINGPROPERTY:
                PropAction = Database.PROPERTY_ACTION.NONE;
                break;
            }
        }
        else
        {
            PropAction           = Database.PROPERTY_ACTION.NONE;
            this.AnimationActive = false;
            this.active          = false;
        }

        Menu.SetActive(false);
        this.AnimationActive = false;
        this.active          = false;
        updateBalance();
        if (PropAction == Database.PROPERTY_ACTION.NONE)
        {
            done();
        }
    }