Esempio n. 1
0
 private void updatePlayerStats()
 {
     //PlayerStatusGUI.text
     PlayerStatus.text = "Shoe: $" + ShoeWallet.getWalletAmount() + "\nTopHat: $" + TopHatWallet.getWalletAmount()
                         + "\nThimble: $" + ThimbleWallet.getWalletAmount() + "\nBattleship: $" + BattleshipWallet.getWalletAmount();
 }
Esempio n. 2
0
    public void specialLandProcess(PlayMoving thePlayer, PlayerWallet theWallet, ArrayList spLand)
    {
        var tempCounter = 0;

        //railroads
        if (((int)spLand [1] == 5) || ((int)spLand [1] == 15) || ((int)spLand [1] == 25) || ((int)spLand [1] == 35))
        {
            var tempOwner = getOwner(spLand);              //checks if the railroad is owned
            if (tempOwner != null)
            {
                for (int i = 0; i < theWallet.myLandList.Count - 1; i++)
                {
                    var tempArr = (ArrayList)theWallet.myLandList [i];
                    if (tempArr [3].ToString() == "r")
                    {
                        tempCounter++;
                    }
                }
                getOwner(spLand).addMoney(tempCounter * 75);                  //probalby need to fix these lines for datastructures
                theWallet.subtractMoney(tempCounter * 75);
                print("railroad rent paid");
            }
            else if (theWallet.getWalletAmount() > 200)
            {
                monopolyGame.LocationLibrary.getLand(thePlayer.currentSpaceNum).Add(theWallet);
                theWallet.subtractMoney(200);
                print(thePlayer.getName() + "bought railroad");
            }
            else
            {
                print("player doesnt have enough money to buy railroad");
            }
        }

        //utility
        else if (((int)spLand [1] == 12) || ((int)spLand [1] == 28))
        {
            var tempOwner = getOwner(spLand);              //checks if the railroad is owned
            if (tempOwner != null)
            {
                for (int i = 0; i < theWallet.myLandList.Count - 1; i++)
                {
                    var tempArr = (ArrayList)theWallet.myLandList [i];
                    if (tempArr [3].ToString() == "u")
                    {
                        tempCounter++;
                    }
                }
                var number = Random.Range(2, 12);
                getOwner(spLand).addMoney(tempCounter * 4 * number);                  //probalby need to fix these lines for datastructures
                theWallet.subtractMoney(tempCounter * 4 * number);
                print("utilities paid");
            }
            else if (theWallet.getWalletAmount() > 150)
            {
                monopolyGame.LocationLibrary.getLand(thePlayer.currentSpaceNum).Add(theWallet);
                theWallet.subtractMoney(150);
                print(thePlayer.getName() + "bought utility");
            }
            else
            {
                print("player doesnt have enough money to buy utility");
            }
        }

        //income tax --addmoney to communityvault
        else if ((int)spLand [1] == 4)
        {
            var tempMoney = (int)(theWallet.getWalletAmount() * 0.15);
            theWallet.subtractMoney(tempMoney);
            monopolyGame.updateCV_money(tempMoney);
            print("taxes paid");
            monopolyGame.consoleText = thePlayer.getName() + " has paid taxes!";
        }

        //luxury tax
        else if ((int)spLand [1] == 38)
        {
            theWallet.subtractMoney(75);
            print("luxury tax paid");
        }

        //community chest
        else if (((int)spLand [1] == 2) || ((int)spLand [1] == 17) || ((int)spLand [1] == 33))
        {
            CCdeck.CCnumber = Random.Range(1, 7);
        }

        //chance
        else if (((int)spLand [1] == 7) || ((int)spLand [1] == 22) || ((int)spLand [1] == 36))
        {
            chanceDeck.ChanceNumber = Random.Range(1, 7);
        }
        else if ((int)spLand [1] == 20)            //landed on free parking
        {
            theWallet.addMoney(monopolyGame.getCV_money());
            monopolyGame.updateCV_money(-monopolyGame.getCV_money());
            print("player cleared the community vault");
            monopolyGame.consoleText = "Community Vault has been emptied by: " + thePlayer.getName();
        }
        else if (((int)spLand [1] == 0))
        {
            monopolyGame.consoleText = thePlayer.getName() + " is on GO! ";
            thePlayer.passedGO       = true;
        }
        else
        {
            print("merp, nothing special");
            //monopolyGame.consoleText = "Not a special place";
        }
    }