示例#1
0
 IEnumerator ani_CC()
 {
     if (CCnumber == 1)
     {
         cc_Animator.SetTrigger("refreshed");
         cc_Animator.SetInteger("pointer", 1);
         CCnumber = 0;
         monopolyGame.getWallet(currentPlayer).addMoney(100);
         monopolyGame.consoleText = currentPlayer.getName() + " you inheirted $100";
     }
     if (CCnumber == 2)
     {
         cc_Animator.SetTrigger("refreshed");
         cc_Animator.SetInteger("pointer", 2);
         CCnumber = 0;
         monopolyGame.getWallet(currentPlayer).addMoney(200);
         monopolyGame.consoleText = currentPlayer.getName() + " bank error in favor, collect $200";
     }
     if (CCnumber == 3)
     {
         cc_Animator.SetTrigger("refreshed");
         cc_Animator.SetInteger("pointer", 3);
         CCnumber = 0;
         monopolyGame.getWallet(currentPlayer).subtractMoney(100);
         monopolyGame.consoleText = currentPlayer.getName() + " paid hospital $100";
     }
     if (CCnumber == 4)
     {
         cc_Animator.SetTrigger("refreshed");
         cc_Animator.SetInteger("pointer", 4);
         CCnumber = 0;
         currentPlayer.forceNewLocation(40);
         monopolyGame.consoleText = currentPlayer.getName() + " is going to jail";
     }
     if (CCnumber == 5)
     {
         cc_Animator.SetTrigger("refreshed");
         cc_Animator.SetInteger("pointer", 5);
         CCnumber = 0;
         monopolyGame.getWallet(currentPlayer).addMoney(10);
         monopolyGame.consoleText = currentPlayer.getName() + " won beauty contest, collect $10";
     }
     if (CCnumber == 6)
     {
         cc_Animator.SetTrigger("refreshed");
         cc_Animator.SetInteger("pointer", 6);
         CCnumber = 0;
         var player_W  = (PlayerWallet)monopolyGame.getWallet(currentPlayer);
         var incomeTax = (int)(player_W.getWalletAmount() * 0.15);
         monopolyGame.getWallet(currentPlayer).addMoney(incomeTax);
         monopolyGame.consoleText = currentPlayer.getName() + " income tax refund";
     }
     if (Input.GetKeyDown(KeyCode.Delete))
     {
         cc_Animator.SetTrigger("next");
     }
     yield return(new WaitForEndOfFrame());
 }
示例#2
0
 IEnumerator ani()
 {
     if (ChanceNumber == 1)
     {
         chance_Animator.SetTrigger("refreshed");
         chance_Animator.SetInteger("pointer", 1);
         ChanceNumber = 0;
         monopolyGame.getWallet(actingPlayer).subtractMoney(15);
         monopolyGame.updateCV_money(15);
         monopolyGame.consoleText = actingPlayer.getName() + "paid $15 poor tax";
     }
     if (ChanceNumber == 2)
     {
         chance_Animator.SetTrigger("refreshed");
         chance_Animator.SetInteger("pointer", 2);
         ChanceNumber = 0;
         actingPlayer.forceNewLocation(0);
         monopolyGame.getWallet(actingPlayer).addMoney(200);
         monopolyGame.consoleText = actingPlayer.getName() + " adv. to GO with $200";
     }
     if (ChanceNumber == 3)
     {
         chance_Animator.SetTrigger("refreshed");
         chance_Animator.SetInteger("pointer", 3);
         ChanceNumber = 0;
         var nLoc = actingPlayer.currentSpaceNum - 3;
         if (nLoc < 0)
         {
             nLoc = 40 + nLoc;
         }
         actingPlayer.forceNewLocation(nLoc);
         monopolyGame.consoleText = actingPlayer.getName() + " went back 3 spaces";
     }
     if (ChanceNumber == 4)
     {
         chance_Animator.SetTrigger("refreshed");
         chance_Animator.SetInteger("pointer", 4);
         ChanceNumber = 0;
         var otherPlayer = new PlayMoving();
         for (int i = 1; i < monopolyGame.GetPlayerList().Count; i++)
         {
             otherPlayer = (PlayMoving)monopolyGame.GetPlayerList()[i];
             monopolyGame.getWallet(otherPlayer).addMoney(50);
             monopolyGame.getWallet(actingPlayer).subtractMoney(50);
         }
         monopolyGame.consoleText = actingPlayer.getName() + " became chairman, paid $50 to ea. player";
     }
     if (ChanceNumber == 5)
     {
         chance_Animator.SetTrigger("refreshed");
         chance_Animator.SetInteger("pointer", 5);
         ChanceNumber = 0;
         actingPlayer.forceNewLocation(40);
         monopolyGame.consoleText = actingPlayer.getName() + " is going to jail!";
     }
     if (ChanceNumber == 6)
     {
         chance_Animator.SetTrigger("refreshed");
         chance_Animator.SetInteger("pointer", 6);
         ChanceNumber = 0;
         monopolyGame.getWallet(actingPlayer).addMoney(150);
         monopolyGame.consoleText = actingPlayer.getName() + " building and loan matures, collect $150";
     }
     if (Input.GetKeyDown(KeyCode.Delete))
     {
         chance_Animator.SetTrigger("next");
         monopolyGame.consoleText = "debug, Chance_next pressed";
     }
     yield return(new WaitForEndOfFrame());
 }
示例#3
0
    //methods below are used to excute the Movement of a single Player.

    public void playerMove(PlayMoving myPlayer)
    {
        //make player roll dice
        var newDistance = stepsToTake();

        //generate random number, but also correspond to dice animation


        myPlayer.travelToNewLocation(newDistance);         //have player move to newlocation
        //^(imbeded within PlayMoving.cs)^check to see to see if player passed GO

        if (isGoingToJail())           //check to see if player is going to jail (various ways)
        {
            print("player is going to jail");
            myPlayer.forceNewLocation(40);
        }
        //monopolyGame.consoleText = "did not pass go";
        if (myPlayer.hasPassedGo())
        {
            //monopolyGame.consoleText = "has just passed GO! adding money...";
            monopolyGame.getWallet(myPlayer).getWalletAmount();
            monopolyGame.getWallet(myPlayer).addMoney(200);
            myPlayer.resetPassGo();
            print("money added. wallet: " + monopolyGame.getWallet(myPlayer).getWalletAmount());
        }

        var currentLand = (ArrayList)monopolyGame.LocationLibrary.getLand(myPlayer.currentSpaceNum);

        monopolyGame.consoleText = myPlayer.getName() + " traveling to : " + ((ArrayList)monopolyGame.LocationLibrary.getLand(myPlayer.targetSpaceNum))[0];
        if (monopolyGame.LocationLibrary.isSpecialLand(currentLand))
        {
            //	monopolyGame.consoleText =  "special land...";
            monopolyGame.LocationLibrary.specialLandProcess(myPlayer, monopolyGame.getWallet(myPlayer), monopolyGame.LocationLibrary.getLand(myPlayer.currentSpaceNum));
        }
        else if (hasBeenBought(currentLand))         //check to see if spot has been bought
        {
            var rentAmount = (int)monopolyGame.LocationLibrary.calculateRent(currentLand);
            //var landOwner = (PlayerWallet)monopolyGame.LocationLibrary.getOwner(currentLand);
            //var myPwallet = monopolyGame.getWallet(myPlayer);
            if (!(Object.Equals(monopolyGame.getWallet(myPlayer), monopolyGame.LocationLibrary.getOwner(currentLand))))
            {
                //rent paying still needs to be validated

                print("this amount being paid: " + rentAmount);
                monopolyGame.getWallet(myPlayer).subtractMoney(rentAmount);
                //myPwallet.subtractMoney(rentAmount);		//if bough, pay rent
                monopolyGame.LocationLibrary.getOwner(currentLand).addMoney(rentAmount);
                monopolyGame.consoleText = "rent paid";
            }
            else if (ReferenceEquals((PlayerWallet)monopolyGame.LocationLibrary.getOwner(currentLand), monopolyGame.getWallet(myPlayer)))            //checks to see if Owned land and builds house
            {
                print("attempting building house");
                //<<insert buildHouse function
                if (monopolyGame.LocationLibrary.buildHouse((ArrayList)monopolyGame.LocationLibrary.getLand(myPlayer.currentSpaceNum)))
                {
                    monopolyGame.getWallet(myPlayer).subtractMoney((int)currentLand[2]);
                }
            }
        }
        else
        {
            buyLand_AI(myPlayer);             //checks to see if theres enough money, buys if possible
        }
    }