Ejemplo n.º 1
0
 private void GameEvents_UpdateTick(object sender, EventArgs e)
 {
     if (Game1.player.isMoving() == true && hasLoadedTerrainList == false)
     {
         Lists.loadAllListsAfterMovement();
         Util.WaterAllCropsInAllLocations();
     }
     WeatherDebrisSystem.update();
 }
Ejemplo n.º 2
0
        public void newDebris()
        {
            //  Game1.debrisWeather.Add(new WeatherDebris(new Vector2((float)Game1.random.Next(0, Game1.graphics.GraphicsDevice.Viewport.Width), (float)Game1.random.Next(0, Game1.graphics.GraphicsDevice.Viewport.Height)), 0, (float)Game1.random.Next(15) / 500f, (float)Game1.random.Next(-10, 0) / 50f, (float)Game1.random.Next(10) / 50f));
            //  Game1.debrisWeather.Add(new WeatherDebrisPlus(new Vector2((float)Game1.random.Next(0, Game1.graphics.GraphicsDevice.Viewport.Width), (float)Game1.random.Next(0, Game1.graphics.GraphicsDevice.Viewport.Height)), new Rectangle(338, 400, 8, 8),0,999, (float)Game1.random.Next(15) / 500f, (float)Game1.random.Next(-10, 0) / 50f, (float)Game1.random.Next(10) / 50f));
            //  WeatherDebris w = new WeatherDebris();
            //   Game1.debrisWeather.Add(new WeatherDebris(new Vector2((float)Game1.random.Next(0, Game1.graphics.GraphicsDevice.Viewport.Width), (float)Game1.random.Next(0, Game1.graphics.GraphicsDevice.Viewport.Height)), 0, (float)Game1.random.Next(15) / 500f, (float)Game1.random.Next(-10, 0) / 50f, (float)Game1.random.Next(10) / 50f));
            // WeatherDebris w = new WeatherDebris(new Vector2((float)Game1.random.Next(0, Game1.graphics.GraphicsDevice.Viewport.Width), (float)Game1.random.Next(0, Game1.graphics.GraphicsDevice.Viewport.Height)), 0, (float)Game1.random.Next(15) / 500f, (float)Game1.random.Next(-10, 0) / 50f, (float)Game1.random.Next(10) / 50f);
            WeatherDebrisPlus w = new WeatherDebrisPlus(new Vector2((float)Game1.random.Next(0, Game1.graphics.GraphicsDevice.Viewport.Width), (float)Game1.random.Next(0, Game1.graphics.GraphicsDevice.Viewport.Height)), new Rectangle(338, 400, 8, 8), 0, 4, (float)Game1.random.Next(15) / 500f, (float)Game1.random.Next(-10, 0) / 50f, (float)Game1.random.Next(10) / 50f);

            WeatherDebrisSystem.addMultipleDebrisFromSingleType(new weatherNode(w, 20));
            Game1.isDebrisWeather = true;
        }
Ejemplo n.º 3
0
        private void GameEvents_UpdateTick(object sender, EventArgs e)
        {
            if (Game1.activeClickableMenu != null)
            {
                Monitor.Log(Game1.activeClickableMenu.ToString());
            }
            if (Game1.player.isMoving() == true && hasLoadedTerrainList == false)
            {
                Lists.loadAllListsAfterMovement();
                Util.WaterAllCropsInAllLocations();
            }

            // this.checkForCollision();
            WeatherDebrisSystem.update();

            if (Utilities.MapUtilities.isEditingMap == true)
            {
                Utilities.MapUtilities.moveViewPort();
            }
        }
Ejemplo n.º 4
0
        private void ShopCall(object sender, StardewModdingAPI.Events.EventArgsKeyPressed e)
        {
            if (e.KeyPressed.ToString() == "J")
            {
                Log.AsyncC("Mouse Position " + Game1.getMousePosition());
            }

            if (e.KeyPressed.ToString() == "O")
            {
                Game1.activeClickableMenu = new Revitalize.Menus.CarpenterMenu(false);
            }

            // Game1.currentSeason = "spring";
            Game1.player.money = 9999;
            //  Log.AsyncG(Game1.tileSize);

            //Game1.timeOfDay = 2500;
            if (Game1.activeClickableMenu != null)
            {
                return;
            }
            if (e.KeyPressed.ToString() == key_binding)
            {
                List <Item> objShopList  = new List <Item>();
                List <Item> newInventory = new List <Item>();

                TextureDataNode font;
                Dictionaries.spriteFontList.TryGetValue("0", out font);
                objShopList.Add(new TestMachine(3, Vector2.Zero, Util.invertColor(LightColors.White), LightColors.White, false, 9, true));
                objShopList.Add(new SpriteFontObject(0, Vector2.Zero, font.path, Color.White));
                objShopList.Add(new Magic.Alchemy.Objects.BagofHolding(0, Vector2.Zero, new List <List <Item> >()
                {
                    new List <Item>()
                    {
                        Capacity = 6
                    },
                    new List <Item>()
                    {
                        Capacity = 10
                    },
                    new List <Item>()
                    {
                        Capacity = 15
                    }
                }, Color.White));
                //  objShopList.Add(new Spawner(3, Vector2.Zero, 9));
                objShopList.Add(new Light(0, Vector2.Zero, LightColors.Aquamarine, LightColors.Aquamarine, false));
                objShopList.Add(new Quarry(3, Vector2.Zero, 9, "copper"));
                objShopList.Add(new Quarry(3, Vector2.Zero, 9, "iron"));
                objShopList.Add(new Spawner(3, Vector2.Zero, 9));
                // objShopList.Add(new StardewValley.Tools.Raft());
                objShopList.Add(new Decoration(3, Vector2.Zero));
                objShopList.Add(new StardewValley.Object(495, 1));
                objShopList.Add(new StardewValley.Object(496, 1));
                objShopList.Add(new StardewValley.Object(497, 1));
                objShopList.Add(new StardewValley.Object(498, 1));
                objShopList.Add(new StardewValley.Object(770, 1));

                //objShopList.Add(Canvas.addCanvasWithCheck(0, Vector2.Zero, Canvas.blankTexture, null));

                objShopList.Add(new StardewValley.Object(475, 1));
                foreach (var v in objShopList)
                {
                    newInventory.Add(v);
                    //   Log.AsyncG("GRRR");
                }
                objShopList.Add(new GiftPackage(1, "Generic Gift Package", Vector2.Zero, newInventory, 1000, Util.invertColor(LightColors.Orange)));

                // my_shop_list.Add((new Decoration(1120, Vector2.Zero)));
                objShopList.Add(new ExtraSeeds(1, Vector2.Zero));
                objShopList.Add(new ExtraSeeds(2, Vector2.Zero));


                foreach (KeyValuePair <int, Spell> v in Dictionaries.spellList)
                {
                    objShopList.Add(v.Value);
                }

                List <StardewValley.Item> trash = new List <StardewValley.Item>();
                foreach (var v in objShopList)
                {
                    if (v == null)
                    {
                        trash.Add(v);
                    }
                }
                foreach (var v in trash)
                {
                    Log.AsyncC("TRASH");
                    objShopList.Remove(v);
                }

                Game1.activeClickableMenu = new StardewValley.Menus.ShopMenu(objShopList, 0, null);

                if (Game1.player == null)
                {
                    return;
                }
            }


            if (e.KeyPressed.ToString() == key_binding2)
            {
                gametick = true;
            }

            if (e.KeyPressed.ToString() == "J")
            {
                //if(Game1.activeclickablemenu is TitleMenu or CharacterCreationMenu
                if (Game1.player.currentLocation.name != "Farm")
                {
                    Game1.activeClickableMenu = new FarmOptionsMenu();
                }
                else
                {
                    Game1.showRedMessage("Can't change farm map here!");
                }
            }

            if (e.KeyPressed.ToString() == "V")
            {
                newDebris();
            }

            if (e.KeyPressed.ToString() == "U")
            {
                Serialize.cleanUpWorld();
            }

            if (e.KeyPressed.ToString() == "G")
            {
                WeatherDebrisSystem.speedUpWindAndClear(0.001f);
            }

            if (e.KeyPressed.ToString() == "J")
            {
                Log.AsyncC("Player Position " + Game1.player.getTileLocation());
                Log.AsyncC("Mouse Position " + Game1.currentCursorTile);
            }
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Draw my weather debris system.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void draw(object sender, EventArgs e)
 {
     WeatherDebrisSystem.draw();
 }