Example #1
0
        public void DecideChanceCard(MonopolyEmpires Me)
        {
            MethodInfo method       = null;
            object     o_ChanceCard = null;

            int    cardNum         = NextChanceCard();
            string ChanceCardName  = lst_ChanceCard_Sequence[cardNum - 1];
            Type   type_ChanceCard = Type.GetType("Empire_Monopoly.Cards.Chance_Cards." + ChanceCardName);

            //Type type_ChanceCard = Type.GetType("Empire_Monopoly.Cards.Chance_Cards.EmpireBDay");

            MessageBox.Show("Selected Chance Card is:" + ChanceCardName);
            o_ChanceCard = Activator.CreateInstance(type_ChanceCard);

            method = type_ChanceCard.GetMethod("Action");


            if (o_ChanceCard.ToString().Contains("GetOutOfJailFree"))
            {
                Me.currentPlayer.lst_ChanceCardName.Add("GetOutOfJailFree");
            }
            else
            {
                method.Invoke(o_ChanceCard, new object[] { Me });
            }
        }
Example #2
0
 public void Action(MonopolyEmpires Me)
 {
     Me.currentPlayer.amount += 50;
     if (Me.userTurn == 1)
     {
         Me.comp1.amount -= 50;
     }
     else if (Me.userTurn == 2)
     {
         Me.human.amount -= 50;
     }
 }
Example #3
0
        public void PlayEmpireCard(MonopolyEmpires Me, string empireCardName)
        {
            MethodInfo method          = null;
            object     o_EmpireCard    = null;
            Type       type_EmpireCard = Type.GetType("Empire_Monopoly.Cards.Empire_Cards." + empireCardName);

            o_EmpireCard = Activator.CreateInstance(type_EmpireCard);

            method = type_EmpireCard.GetMethod("Action");

            Me.currentPlayer.lst_EmpireCardName.Remove(empireCardName);
            method.Invoke(o_EmpireCard, new object[] { Me });
        }
        public void Action(MonopolyEmpires Me)
        {
            int a = 0;

            if (Me.human.amount >= Me.comp1.amount)
            {
                a = Me.human.amount;
            }
            else
            {
                a = Me.comp1.amount;
            }
            Me.currentPlayer.amount += a;
        }
Example #5
0
        public void DecideEmpireCard(MonopolyEmpires Me)
        {
            int    cardNum         = NextEmpireCard();
            string EmpireCardName  = lst_EmpireCard_Sequence[cardNum - 1];
            Type   type_EmpireCard = Type.GetType("Empire_Monopoly.Cards.Empire_Cards." + EmpireCardName);

            //o_EmpireCard = Activator.CreateInstance(type_EmpireCard);

            //method = type_EmpireCard.GetMethod("Action");

            MessageBox.Show("Selected Empire Card is:" + EmpireCardName);

            Me.currentPlayer.lst_EmpireCardName.Add(EmpireCardName);
        }
Example #6
0
        public void PlayChanceCard(MonopolyEmpires Me, string chanceCardName)
        {
            MethodInfo method = null;


            int    cardNum         = NextChanceCard();
            string ChnaceCardName  = lst_ChanceCard_Sequence[cardNum - 1];
            Type   type_ChanceCard = Type.GetType("Empire_Monopoly.Cards.Chance_Cards." + ChnaceCardName);

            //o_EmpireCard = Activator.CreateInstance(type_EmpireCard);

            method = type_ChanceCard.GetMethod("Action");

            Me.currentPlayer.lst_ChanceCardName.Remove(ChnaceCardName);
        }
 public void Action(MonopolyEmpires Me)
 {
     Me.currentPlayer.Current_Pos += 5;
     if (Me.currentPlayer.Current_Pos == 36)
     {
         Me.currentPlayer.Current_Pos = 0;
         Me.currentPlayer.amount     += Me.currentPlayer.topMostBillBoardValue;
     }
     else if (Me.currentPlayer.Current_Pos > 35)
     {
         Me.currentPlayer.Current_Pos -= 36;
         Me.AddGoSpaceAmount();
     }
     Me.SetTokenPossition(Me.currentPlayer.Current_Pos);
 }
 public void Action(MonopolyEmpires Me)
 {
     if (Me.userTurn == 1)
     {
         if (Me.comp1.t.towerBillBoard.Count > 0)
         {
             Me.human.amount += 400;
             Me.comp1.amount -= 400;
         }
     }
     else if (Me.userTurn == 2)
     {
         if (Me.human.t.towerBillBoard.Count > 0)
         {
             Me.comp1.amount += 400;
             Me.human.amount -= 400;
         }
     }
 }
        public void Action(MonopolyEmpires Me)
        {
            Type   type_Space = Type.GetType("Empire_Monopoly.Spaces.WaterWorks");
            object o          = Activator.CreateInstance(type_Space);

            FieldInfo F_Count = type_Space.GetField("count");
            int       count   = 0;

            if (F_Count != null)
            {
                count = (int)F_Count.GetValue(o);
            }


            if (count > 0)
            {
                FieldInfo f   = type_Space.GetField("img");
                Image     img = null;
                if (f != null)
                {
                    img = f.GetValue(null) as Image;
                }

                FieldInfo F_Size        = type_Space.GetField("size");
                int       billBoardSize = 0;
                if (F_Size != null)
                {
                    billBoardSize = (int)F_Size.GetValue(o);
                }

                FieldInfo F_Price = type_Space.GetField("price");
                int       price   = 0;
                if (F_Price != null)
                {
                    price = (int)F_Price.GetValue(o);
                }

                Me.BuyBrandForChanceCard(billBoardSize, price, img, "WaterWorks.cs", true);
            }

            F_Count.SetValue(o, count--);
        }
Example #10
0
 public void CheckGetOutOfJail(ref Label lblMsg, MonopolyEmpires Me)
 {
     if (isInJail)
     {
         if (lst_ChanceCardName.Contains("GetOutOfJailFree"))
         {
             if (MessageBox.Show("Would you like to use Chance Card to get out of jail...??", "Get out Of jail", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
             {
                 Me.card.PlayChanceCard(Me, "GetOutOfJailFree");
                 Me.NextTurn();
                 return;
             }
         }
         if (lst_EmpireCardName.Contains("GetOutOfJailForFree"))
         {
             if (MessageBox.Show("Would you like to use Empire Card to get out of jail...??", "Get out Of jail", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
             {
                 Me.card.PlayEmpireCard(Me, "GetOutOfJailForFree");
                 Me.NextTurn();
                 return;
             }
         }
         if (MessageBox.Show("Would you like to pay $100 to bank to get out of jail...??", "Get out Of jail", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
         {
             amount  -= 100;
             isInJail = false;
             Me.NextTurn();
             return;
         }
         if (MessageBox.Show("Want to roll dice to get out of jail...??", "Get out of jail", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
         {
             lblMsg.Text    = "Roll Double (user has three chance to roll the dice)";
             lblMsg.Visible = true;
         }
     }
 }
Example #11
0
 public void Action(MonopolyEmpires Me)
 {
 }
Example #12
0
 public void Action(MonopolyEmpires Me)
 {
     Me.NextTurn();
 }
Example #13
0
 public void Action(MonopolyEmpires Me)
 {
     Me.isCasinoNightCardUse = true;
     Me.SetLabelMessage("Roll dice to play CasinoNight Card...");
     //Me.UseDice();
 }
 public void Action(MonopolyEmpires Me)
 {
     Me.isMoveToAnySpaceOnTheBoardCardUse = true;
     Me.SetLabelMessage("Double click on the brand on which you want to move...");
 }
Example #15
0
 public void Action(MonopolyEmpires Me)
 {
     Me.GoToJail();
 }
 public void Action(MonopolyEmpires Me)
 {
     Me.StockMarketCrash();
 }
 public void Action(MonopolyEmpires Me)
 {
     Me.currentPlayer.amount += 100;
 }
Example #18
0
 public void Action(MonopolyEmpires Me)
 {
     Me.AddGoSpaceAmount();
 }
 public void Action(MonopolyEmpires Me)
 {
     Me.currentPlayer.isInJail = false;
 }