Exemplo n.º 1
0
 public void Sell(playerToken p)
 {
     this.Owned          = false;
     this.pOwning.money += this.price;
     this.pOwning.places.Remove(this);
     this.pOwning = null;
 }
Exemplo n.º 2
0
 public override void Sold()
 {
     this.Owned          = false;
     this.pOwning.money += this.price;
     this.pOwning        = null;
     this.Level          = 1;
 }
Exemplo n.º 3
0
 public void Buy(playerToken p)
 {
     p.money -= this.price;
     p.places.Add(this);
     this.pOwning = p;
     this.Owned   = true;
 }
Exemplo n.º 4
0
 public override void Effect(playerToken p)
 {
     //Console.WriteLine("You arrive at {0}.", this.Name);
     //Random r = new Random();
     //int index = r.Next(1, this.Cards.Count);
     //Console.WriteLine("{0}", this.Cards[index].Description);
     //p.Money += this.Cards[index].Price;
     //throw new NotImplementedException();
 }
Exemplo n.º 5
0
 public void Sell(playerToken p)
 {
     this.upgradeFlag    = true;
     this.Level          = 1;
     this.Owned          = false;
     this.pOwning.money += this.price;
     this.pOwning.places.Remove(this);
     this.pOwning = null;
 }
Exemplo n.º 6
0
    //check chest
    bool chestMenu(chest currentPlace, playerToken currentPlayer)
    {
        //pay or gain
        int tempNum = currentPlace.RentPrice();

        if (tempNum < 0)
        {
            //PAY
            if (currentPlayer.money > (tempNum * -1))
            {
                desc = "PAY " + tempNum;
                if (GUI.Button(new Rect(Screen.width * .03f, Screen.height * .1f, Screen.width * .3f, Screen.height * .1f), "PAY"))
                {
                    VariableManager.tax -= tempNum;
                    currentPlayer.money += tempNum;
                    return(true);

                    VariableManager.turn = 2;
                }
            }
            //sell
            if (currentPlayer.places.Count > 0)
            {
                if (GUI.Button(new Rect(Screen.width * .03f, Screen.height * .4f, Screen.width * .2f, Screen.height * .1f), "SELL"))
                {
                    this.yourArray       = new List <bool> (currentPlayer.places.Count);
                    this.offSet          = 0;
                    VariableManager.turn = 5;
                }
            }
            //surrender
            if (GUI.Button(new Rect(Screen.width * .03f, Screen.height * .5f, Screen.width * .2f, Screen.height * .1f), "SURRENDER"))
            {
                currentPlayer.surrender();
                VariableManager.turn = 0;
            }
        }
        else
        {
            //GAIN
            currentPlayer.money += tempNum;
            desc = "GAIN " + tempNum;
            VariableManager.turn = 2;
            return(true);
        }
        return(false);
        //end turn
    }
Exemplo n.º 7
0
    //menu airport
    void airportMenu(airport currentPlace, playerToken currentPlayer)
    {
        //buy
        if (currentPlace.Owned == false && currentPlayer.money >= currentPlace.price)
        {
            if (GUI.Button(new Rect(Screen.width * .03f, Screen.height * .2f, Screen.width * .2f, Screen.height * .1f), "BUY"))
            {
                currentPlace.Buy(currentPlayer);
                VariableManager.turn = 2;
            }
        }

        //sell
        if (currentPlayer.places.Count > 0)
        {
            if (GUI.Button(new Rect(Screen.width * .03f, Screen.height * .4f, Screen.width * .2f, Screen.height * .1f), "SELL"))
            {
                this.yourArray       = new List <bool>(currentPlayer.places.Count);
                this.offSet          = 0;
                VariableManager.turn = 5;
            }
        }
        //surrender
        if (GUI.Button(new Rect(Screen.width * .03f, Screen.height * .5f, Screen.width * .2f, Screen.height * .1f), "SURRENDER"))
        {
            currentPlayer.surrender();
        }
        //end turn
        if (VariableManager.turn == 2)
        {
            if (GUI.Button(new Rect(Screen.width * .03f, Screen.height * .6f, Screen.width * .2f, Screen.height * .1f), "END TURN"))
            {
                VariableManager.state++;
                if (VariableManager.state == VariableManager.jumlahPlayer)
                {
                    VariableManager.state = 0;
                }
                VariableManager.turn = 0;
            }
        }
    }
Exemplo n.º 8
0
 public override void Effect(playerToken p)
 {    /*
       * Console.WriteLine("You arrive at {0}.", this.Name);
       * //throw new NotImplementedException();
       * if (p.Owned(this) == false && this.Owned == false)// airport tidak ada yang punya
       * {
       *     int cost = this.Price * 8;
       *     char ans;
       *     while (true && p.Money >= cost)
       *     {
       *             Console.WriteLine("This Airport cost {0}. Do you want to buy {1} ??(y/n)", cost, this.Name);
       *             ans = Convert.ToChar(Console.ReadLine());
       *             if (ans == 'y')
       *             {
       *                     p.Money -= cost;
       *                     this.Owned = true;
       *                     p.PlaceIndex++;
       *                     p.AddPlace(this);
       *                     this.Player = p;
       *                     Console.WriteLine("{0} just buy {1} for ${2}", p.Name, this.Name, cost);
       *                     break;
       *             }
       *             else if (ans == 'n')
       *             {
       *                     Console.WriteLine("You either CHEAP or POOR BASTARD!!!");
       *                     break;
       *             }
       *             else Console.WriteLine("ARE YOU RETARDED?? CUZ YOU JUST PUT THE WRONG INPUT");
       *     }
       * }
       * else if (p.Owned(this) == false && this.Owned == true)// airport ada yang punya dan bukan player yng memiliki
       * {
       *     Console.WriteLine("({0})You gotta pay buddy!!", p.Name);
       *     int cost = this.Price * 5;
       *     p.Money -= cost;
       *     this.Player.Money += cost;
       *     Console.WriteLine("{0} pay {1} to {2}", p.Name, cost, Player.Name);
       * }*/
 }
Exemplo n.º 9
0
 //pay check
 bool countryPayCheck(country currentPlace, playerToken currentPlayer)
 {
     if (currentPlace.Owned == false)
     {
         return(true);
     }
     else
     {
         //pay
         if (currentPlayer.money > currentPlace.RentPrice())
         {
             desc = "PAY " + currentPlace.RentPrice();
             if (GUI.Button(new Rect(Screen.width * .03f, Screen.height * .1f, Screen.width * .3f, Screen.height * .1f), "PAY"))
             {
                 currentPlace.Pay(currentPlayer);
                 VariableManager.turn = 2;
             }
         }
         //sell
         if (currentPlayer.places.Count > 0)
         {
             if (GUI.Button(new Rect(Screen.width * .03f, Screen.height * .4f, Screen.width * .3f, Screen.height * .1f), "SELL"))
             {
                 this.yourArray       = new List <bool>(currentPlayer.places.Count);
                 this.offSet          = 0;
                 VariableManager.turn = 5;
             }
         }
         //surrender
         if (currentPlayer.money < currentPlace.RentPrice())
         {
             if (GUI.Button(new Rect(Screen.width * .03f, Screen.height * .5f, Screen.width * .2f, Screen.height * .1f), "SURRENDER"))
             {
                 currentPlayer.surrender();
             }
         }
     }
     return(false);
 }
Exemplo n.º 10
0
 public override void Effect(playerToken p)
 {
     //Console.WriteLine("You arrive at {0}.", this.Name);
     //p.Position = 8;
     //Console.WriteLine("{0} go to Jail", p.Name);
     p.arrest = 3;
     if (VariableManager.state == 0)
     {
         p.transform.position = new Vector2(-1.95f, -1.55f);
     }
     else if (VariableManager.state == 1)
     {
         p.transform.position = new Vector2(-1.55f, -1.55f);
     }
     else if (VariableManager.state == 2)
     {
         p.transform.position = new Vector2(-1.95f, -1.95f);
     }
     else
     {
         p.transform.position = new Vector2(-1.55f, -1.95f);
     }
 }
Exemplo n.º 11
0
 public void Upgrade(playerToken p)
 {
     p.money -= this.upgradePrice;
     this.Level++;
 }
Exemplo n.º 12
0
 public override void Effect(playerToken p)
 {
     //Console.WriteLine("You arrive at {0}.", this.Name);
     p.money += this.price;
     //Console.WriteLine("{0} just get {1}.", p.Name, this.Price);
 }
Exemplo n.º 13
0
    public override void Effect(playerToken p)
    {
        //throw new NotImplementedException();
        //Console.WriteLine("You arrive at {0}.", this.Name);

        /*if (this.Owned == false)
         * {
         *      int cost = this.price;
         *      char ans;
         *      while (true && p.money >= cost)// country tidak ada yang punya
         *      {
         *              //Console.WriteLine("This country cost {0}. Do you want to buy this country ??(y/n)", cost);
         *              //ans = Convert.ToChar(Console.ReadLine());
         *              if (ans == 'y')
         *              {
         *                      p.Money -= cost;
         *                      this.Owned = true;
         *                      p.PlaceIndex++;
         *                      p.AddPlace(this);
         *                      this.Player = p;
         *                      Console.WriteLine("{0} just buy {1} for ${2}", p.Name, this.Name, cost);
         *                      break;
         *              }
         *              else if (ans == 'n')
         *              {
         *                      Console.WriteLine("You either CHEAP or POOR BASTARD!!!");
         *                      break;
         *              }
         *              else Console.WriteLine("ARE YOU RETARDED?? CUZ YOU JUST PUT THE WRONG INPUT");
         *      }
         * }
         * else if (p.Owned(this) == false && this.Owned == true)// country ada yang punya cmn bukan player
         * {
         *      Console.WriteLine("({0})You gotta pay buddy!!", p.Name);
         *      int cost = this.Price * (this.Level * 4);
         *      p.Money -= cost;
         *      this.Player.Money += cost;
         *      Console.WriteLine("{0} pay {1} to {2}", p.Name, cost, Player.Name);
         * }
         * else if(p.Owned(this) == true && this.Level < this.MaxLevel) // country pny player
         * {
         *      while (true)
         *      {
         *              char ans;
         *              Console.WriteLine("You want to improve your country ??(y/n)");
         *              ans = Convert.ToChar(Console.ReadLine());
         *              if (ans == 'y')
         *              {
         *                      int cost = this.Price * (this.Level * 5);
         *                      this.Level++;
         *                      p.Money -= cost;
         *                      Console.WriteLine("You just improve this country. Cost {0}.", cost);
         *                      break;
         *              }
         *              else if (ans == 'n')
         *              {
         *                      Console.WriteLine("You want to lose?? cuz thats how you lose in this game!!");
         *                      break;
         *              }
         *              else Console.WriteLine("ARE YOU RETARDED?? CUZ YOU JUST PUT THE WRONG INPUT");
         *      }
         * }*/
    }
Exemplo n.º 14
0
    //public abstract void Buy(playerToken p);

    public abstract void Effect(playerToken p);
Exemplo n.º 15
0
 public override void Effect(playerToken p)
 {
     //Console.WriteLine("You arrive at {0}.", this.Name);
     //throw new NotImplementedException();
 }
Exemplo n.º 16
0
 public void Pay(playerToken p)
 {
     p.money            -= this.RentPrice();
     this.pOwning.money += this.RentPrice();
 }
Exemplo n.º 17
0
    //menu country
    void countryMenu(country currentPlace, playerToken currentPlayer)
    {
        //buy

        if (currentPlace.Owned == false && currentPlayer.money >= currentPlace.price)
        {
            //Debug.Log("test3");
            if (GUI.Button(new Rect(Screen.width * .03f, Screen.height * .2f, Screen.width * .2f, Screen.height * .1f), "BUY"))
            {
                currentPlace.upgradeFlag = false;
                currentPlace.Buy(currentPlayer);
                VariableManager.turn = 2;
            }
        }
        //upgrade
        if (currentPlace.upgradeFlag == true &&
            currentPlace.Owned == true &&
            currentPlace.pOwning.name == currentPlayer.name &&
            currentPlace.Level < currentPlace.MaxLevel &&
            currentPlayer.money >= currentPlace.upgradePrice)
        {
            if (GUI.Button(new Rect(Screen.width * .03f, Screen.height * .3f, Screen.width * .2f, Screen.height * .1f), "UPGRADE"))
            {
                currentPlace.Upgrade(currentPlayer);

                /*currentPlayer.money -= currentPlace.upgradePrice;
                 * currentPlace.Level++;*/

                VariableManager.turn = 2;
            }
        }
        //sell
        if (currentPlayer.places.Count > 0)
        {
            if (GUI.Button(new Rect(Screen.width * .03f, Screen.height * .4f, Screen.width * .2f, Screen.height * .1f), "SELL"))
            {
                this.yourArray       = new List <bool>(currentPlayer.places.Count);
                this.offSet          = 0;
                VariableManager.turn = 5;
            }
        }
        //surrender
        if (GUI.Button(new Rect(Screen.width * .03f, Screen.height * .5f, Screen.width * .2f, Screen.height * .1f), "SURRENDER"))
        {
            currentPlayer.surrender();

            /*foreach(place pl in currentPlayer.places){
             *      if(pl.GetType() == typeof(country)){
             *              //pl = (country)pl;
             *              country temp = GameObject.Find(pl.name);
             *              temp.Owned = false;
             *      }
             * }*/
        }
        //end turn
        if (VariableManager.turn == 2)
        {
            if (GUI.Button(new Rect(Screen.width * .03f, Screen.height * .6f, Screen.width * .2f, Screen.height * .1f), "END TURN"))
            {
                currentPlace.upgradeFlag = true;
                VariableManager.state++;
                if (VariableManager.state == VariableManager.jumlahPlayer)
                {
                    VariableManager.state = 0;
                }
                VariableManager.turn = 0;
                //Debug.Log(VariableManager.turn + " " + VariableManager.state);
            }
        }
    }
Exemplo n.º 18
0
 public override void Sold()
 {
     this.Owned   = false;
     this.pOwning = null;
 }
Exemplo n.º 19
0
 public override void Effect(playerToken p)
 {
     //Console.WriteLine("You arrive at {0}.", this.Name);
 }