Ejemplo n.º 1
0
        private void MenuEvents_MenuChanged(object sender, EventArgsClickableMenuChanged e)
        {
            if (Game1.player.hat is SpeedsterMask && SpeedsterMask.hyperdrive)
            {
                int index = (Game1.player.hat as SpeedsterMask).index;
                SpeedsterMask.hyperdrive = false;
                SpeedsterMask.takeOffCostume();
                SpeedsterMask.putOnCostume(index);
            }

            if (Game1.activeClickableMenu is ShopMenu)
            {
                ShopMenu shop = (ShopMenu)Game1.activeClickableMenu;
                Dictionary <Item, int[]> items = Helper.Reflection.GetPrivateValue <Dictionary <Item, int[]> >(shop, "itemPriceAndStock");
                List <Item> selling            = Helper.Reflection.GetPrivateValue <List <Item> >(shop, "forSale");

                if (items.Keys.FirstOrDefault <Item>() is Hat)
                {
                    Dictionary <Item, int> newItemsToSell = new Dictionary <Item, int>();

                    newItemsToSell.Add(new SpeedsterMask(0), 10000);
                    newItemsToSell.Add(new SpeedsterMask(1), 20000);

                    foreach (Item item in newItemsToSell.Keys)
                    {
                        items.Add(item, new int[] { newItemsToSell[item], int.MaxValue });
                        selling.Add(item);
                    }
                }
            }
        }
Ejemplo n.º 2
0
 private void GameEvents_FourthUpdateTick(object sender, EventArgs e)
 {
     if (Game1.player.hat != null && Game1.player.hat is SpeedsterMask)
     {
         SpeedsterMask.putOnCostume((Game1.player.hat as SpeedsterMask).index);
     }
     else
     {
         SpeedsterMask.takeOffCostume();
     }
 }
Ejemplo n.º 3
0
 private void OnUpdateTicked(object sender, UpdateTickedEventArgs e)
 {
     if (e.IsMultipleOf(4))
     {
         if (Game1.player.hat != null && Game1.player.hat is SpeedsterMask)
         {
             SpeedsterMask.putOnCostume((Game1.player.hat as SpeedsterMask).index);
         }
         else
         {
             SpeedsterMask.takeOffCostume();
         }
     }
 }
Ejemplo n.º 4
0
        private void speedUp()
        {
            if (SpeedsterMask.hyperdrive)
            {
                SpeedsterMask.hyperdrive = false;
            }
            else
            {
                SpeedsterMask.hyperdrive = true;
            }

            if (Game1.player.hat is SpeedsterMask)
            {
                int index = (Game1.player.hat as SpeedsterMask).index;
                SpeedsterMask.takeOffCostume();
                SpeedsterMask.putOnCostume(index);
            }
        }