diff --git a/Revitalize/Revitalize/Revitalize/Aesthetics/WeatherDebrisPlus.cs b/Revitalize/Revitalize/Revitalize/Aesthetics/WeatherDebris/WeatherDebrisPlus.cs similarity index 92% rename from Revitalize/Revitalize/Revitalize/Aesthetics/WeatherDebrisPlus.cs rename to Revitalize/Revitalize/Revitalize/Aesthetics/WeatherDebris/WeatherDebrisPlus.cs index 297731dd..e0e91033 100644 --- a/Revitalize/Revitalize/Revitalize/Aesthetics/WeatherDebrisPlus.cs +++ b/Revitalize/Revitalize/Revitalize/Aesthetics/WeatherDebris/WeatherDebrisPlus.cs @@ -5,7 +5,7 @@ using StardewValley; using System; using System.Collections.Generic; -namespace Revitalize.Aesthetics +namespace Revitalize.Aesthetics.WeatherDebris { @@ -18,11 +18,16 @@ namespace Revitalize.Aesthetics public Rectangle sourceRect; public bool blowing; - private Vector2 position; - private int which; - private float dx; - private float dy; - private int animationIntervalOffset; + public Vector2 position; + public int which; + public float dx; + public float dy; + public int animationIntervalOffset; + + public WeatherDebrisPlus() + { + + } public WeatherDebrisPlus(Vector2 position,Rectangle SourceRect, int animationOffset, int which, float rotationVelocity, float dx, float dy) { @@ -34,7 +39,7 @@ namespace Revitalize.Aesthetics animationIntervalOffset = animationOffset; } - public WeatherDebrisPlus(Vector2 position, Rectangle SourceRect, int animationOffset, int which, float rotationVelocity, float dx, float dy,bool yup) + public WeatherDebrisPlus(Vector2 position, Rectangle SourceRect, int animationOffset, int which, float rotationVelocity, float dx, float dy,bool specificSetUp) { this.position = position; this.which = which; @@ -79,7 +84,7 @@ namespace Revitalize.Aesthetics public new void update(bool slow) { - this.position.X = this.position.X + (this.dx + (slow ? 0f : WeatherDebris.globalWind)); + this.position.X = this.position.X + (this.dx + (slow ? 0f :StardewValley.WeatherDebris.globalWind)); this.position.Y = this.position.Y + (this.dy - (slow ? 0f : -0.5f)); if (this.dy < 0f && !this.blowing) { diff --git a/Revitalize/Revitalize/Revitalize/Aesthetics/WeatherDebris/WeatherDebrisSystem.cs b/Revitalize/Revitalize/Revitalize/Aesthetics/WeatherDebris/WeatherDebrisSystem.cs new file mode 100644 index 00000000..fb225493 --- /dev/null +++ b/Revitalize/Revitalize/Revitalize/Aesthetics/WeatherDebris/WeatherDebrisSystem.cs @@ -0,0 +1,76 @@ +using Microsoft.Xna.Framework; +using StardewValley; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Revitalize.Aesthetics.WeatherDebris +{ + + public class weatherNode + { + public WeatherDebrisPlus weatherDebris; + public int TimesToAdd; + + public weatherNode(WeatherDebrisPlus w, int addThisMany) + { + weatherDebris = w; + TimesToAdd = addThisMany; + } + } + + class WeatherDebrisSystem + { + public static List thisWeatherDebris; + public static void update() + { + foreach (WeatherDebrisPlus w in WeatherDebrisSystem.thisWeatherDebris) + { + // Log.AsyncM("COUNT" + Lists.thisWeatherDebris.Count); + w.update(); + } + } + + public static void draw() + { + if (Game1.player.currentLocation.ignoreDebrisWeather == false) + { + foreach (WeatherDebrisPlus w in WeatherDebrisSystem.thisWeatherDebris) + { + w.draw(Game1.spriteBatch); + } + } + + } + + public static void cleanWeatherDebris() + { + thisWeatherDebris.Clear(); + } + + public static void addMultipleDebrisWithVaryingCounts(List listToAdd) + { + foreach(var v in listToAdd) + { + if (v.TimesToAdd == 0 || v.weatherDebris==null) continue; + for(int i=1; i <= v.TimesToAdd; i++) + { + thisWeatherDebris.Add(v.weatherDebris); + } + } + } + + public static void addMultipleDebrisFromSingleType(weatherNode w) + { + if (w.TimesToAdd == 0 || w.weatherDebris == null) return; + for(int i = 1; i <= w.TimesToAdd; i++) + { + var v= new WeatherDebrisPlus(new Vector2((float)Game1.random.Next(0, Game1.graphics.GraphicsDevice.Viewport.Width), (float)Game1.random.Next(0, Game1.graphics.GraphicsDevice.Viewport.Height)), w.weatherDebris.sourceRect, w.weatherDebris.animationIntervalOffset, w.weatherDebris.which, (float)Game1.random.Next(15) / 500f, (float)Game1.random.Next(-10, 0) / 50f, (float)Game1.random.Next(10) / 50f, true); + thisWeatherDebris.Add(v); + } + } + + } +} diff --git a/Revitalize/Revitalize/Revitalize/Class1.cs b/Revitalize/Revitalize/Revitalize/Class1.cs index 09c12167..37341e79 100644 --- a/Revitalize/Revitalize/Revitalize/Class1.cs +++ b/Revitalize/Revitalize/Revitalize/Class1.cs @@ -26,6 +26,7 @@ using xTile; using Revitalize.Persistance; using Revitalize.Draw; using Revitalize.Aesthetics; +using Revitalize.Aesthetics.WeatherDebris; namespace Revitalize { @@ -94,10 +95,7 @@ namespace Revitalize private void draw(object sender, EventArgs e) { - foreach(WeatherDebrisPlus w in Lists.thisWeatherDebris) - { - w.draw(Game1.spriteBatch); - } + WeatherDebrisSystem.draw(); } private void GraphicsEvents_OnPreRenderHudEvent(object sender, EventArgs e) @@ -141,11 +139,7 @@ namespace Revitalize Lists.loadAllLists(); Util.WaterAllCropsInAllLocations(); } - foreach(WeatherDebrisPlus w in Lists.thisWeatherDebris) - { - // Log.AsyncM("COUNT" + Lists.thisWeatherDebris.Count); - w.update(); - } + WeatherDebrisSystem.update(); } @@ -368,8 +362,8 @@ namespace Revitalize // 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,true); - - Lists.thisWeatherDebris.Add(w); + WeatherDebrisSystem.addMultipleDebrisFromSingleType(new weatherNode(w, 20)); + // WeatherDebrisSystem.thisWeatherDebris.Add(w); Game1.isDebrisWeather = true; // Game1.updateDebrisWeatherForMovement(Game1.debrisWeather); diff --git a/Revitalize/Revitalize/Revitalize/Resources/Lists.cs b/Revitalize/Revitalize/Revitalize/Resources/Lists.cs index e25bcf2f..79b7fdb7 100644 --- a/Revitalize/Revitalize/Revitalize/Resources/Lists.cs +++ b/Revitalize/Revitalize/Revitalize/Resources/Lists.cs @@ -1,4 +1,5 @@ using Revitalize.Aesthetics; +using Revitalize.Aesthetics.WeatherDebris; using StardewModdingAPI; using System; using System.Collections.Generic; @@ -16,14 +17,14 @@ namespace Revitalize.Resources public static List trackedObjectList; - public static List thisWeatherDebris; + public static void initializeAllLists() { trackedTerrainFeatures = new List(); trackedTerrainFeaturesDummyList = new List(); trackedObjectList = new List(); - thisWeatherDebris = new List(); + WeatherDebrisSystem.thisWeatherDebris = new List(); } public static void loadAllLists() diff --git a/Revitalize/Revitalize/Revitalize/Revitalize.csproj b/Revitalize/Revitalize/Revitalize/Revitalize.csproj index eca21afc..b1574197 100644 --- a/Revitalize/Revitalize/Revitalize/Revitalize.csproj +++ b/Revitalize/Revitalize/Revitalize/Revitalize.csproj @@ -50,7 +50,8 @@ - + + diff --git a/Revitalize/Revitalize/Revitalize/bin/Debug/Revitalize.dll b/Revitalize/Revitalize/Revitalize/bin/Debug/Revitalize.dll index 613eb745..909d9873 100644 Binary files a/Revitalize/Revitalize/Revitalize/bin/Debug/Revitalize.dll and b/Revitalize/Revitalize/Revitalize/bin/Debug/Revitalize.dll differ diff --git a/Revitalize/Revitalize/Revitalize/obj/Debug/Revitalize.dll b/Revitalize/Revitalize/Revitalize/obj/Debug/Revitalize.dll index 613eb745..909d9873 100644 Binary files a/Revitalize/Revitalize/Revitalize/obj/Debug/Revitalize.dll and b/Revitalize/Revitalize/Revitalize/obj/Debug/Revitalize.dll differ diff --git a/Stardew_Valley_Mods/AutoSpeed/AutoSpeed.zip b/Stardew_Valley_Mods/AutoSpeed/AutoSpeed.zip index 2683e498..4d6179e6 100644 Binary files a/Stardew_Valley_Mods/AutoSpeed/AutoSpeed.zip and b/Stardew_Valley_Mods/AutoSpeed/AutoSpeed.zip differ diff --git a/Stardew_Valley_Mods/Billboard_Anywhere/BillboardAnywhere.zip b/Stardew_Valley_Mods/Billboard_Anywhere/BillboardAnywhere.zip index f7ba2a6d..1c0521dd 100644 Binary files a/Stardew_Valley_Mods/Billboard_Anywhere/BillboardAnywhere.zip and b/Stardew_Valley_Mods/Billboard_Anywhere/BillboardAnywhere.zip differ diff --git a/Stardew_Valley_Mods/BuildEndurance/BuildEndurance.zip b/Stardew_Valley_Mods/BuildEndurance/BuildEndurance.zip index 9f2aee83..051a0968 100644 Binary files a/Stardew_Valley_Mods/BuildEndurance/BuildEndurance.zip and b/Stardew_Valley_Mods/BuildEndurance/BuildEndurance.zip differ diff --git a/Stardew_Valley_Mods/BuildEndurance/SMAPI_BuildEndurance-Source/SMAPI_BuildEndurance/bin/Debug/SMAPI_BuildEndurance.dll b/Stardew_Valley_Mods/BuildEndurance/SMAPI_BuildEndurance-Source/SMAPI_BuildEndurance/bin/Debug/SMAPI_BuildEndurance.dll index c95523d5..a2d41fe2 100644 Binary files a/Stardew_Valley_Mods/BuildEndurance/SMAPI_BuildEndurance-Source/SMAPI_BuildEndurance/bin/Debug/SMAPI_BuildEndurance.dll and b/Stardew_Valley_Mods/BuildEndurance/SMAPI_BuildEndurance-Source/SMAPI_BuildEndurance/bin/Debug/SMAPI_BuildEndurance.dll differ diff --git a/Stardew_Valley_Mods/BuildEndurance/SMAPI_BuildEndurance-Source/SMAPI_BuildEndurance/bin/Debug/SMAPI_BuildEndurance.pdb b/Stardew_Valley_Mods/BuildEndurance/SMAPI_BuildEndurance-Source/SMAPI_BuildEndurance/bin/Debug/SMAPI_BuildEndurance.pdb index f7512ee6..007f457c 100644 Binary files a/Stardew_Valley_Mods/BuildEndurance/SMAPI_BuildEndurance-Source/SMAPI_BuildEndurance/bin/Debug/SMAPI_BuildEndurance.pdb and b/Stardew_Valley_Mods/BuildEndurance/SMAPI_BuildEndurance-Source/SMAPI_BuildEndurance/bin/Debug/SMAPI_BuildEndurance.pdb differ diff --git a/Stardew_Valley_Mods/BuildEndurance/SMAPI_BuildEndurance-Source/SMAPI_BuildEndurance/obj/Debug/SMAPI_BuildEndurance.dll b/Stardew_Valley_Mods/BuildEndurance/SMAPI_BuildEndurance-Source/SMAPI_BuildEndurance/obj/Debug/SMAPI_BuildEndurance.dll index c95523d5..a2d41fe2 100644 Binary files a/Stardew_Valley_Mods/BuildEndurance/SMAPI_BuildEndurance-Source/SMAPI_BuildEndurance/obj/Debug/SMAPI_BuildEndurance.dll and b/Stardew_Valley_Mods/BuildEndurance/SMAPI_BuildEndurance-Source/SMAPI_BuildEndurance/obj/Debug/SMAPI_BuildEndurance.dll differ diff --git a/Stardew_Valley_Mods/BuildEndurance/SMAPI_BuildEndurance-Source/SMAPI_BuildEndurance/obj/Debug/SMAPI_BuildEndurance.pdb b/Stardew_Valley_Mods/BuildEndurance/SMAPI_BuildEndurance-Source/SMAPI_BuildEndurance/obj/Debug/SMAPI_BuildEndurance.pdb index f7512ee6..007f457c 100644 Binary files a/Stardew_Valley_Mods/BuildEndurance/SMAPI_BuildEndurance-Source/SMAPI_BuildEndurance/obj/Debug/SMAPI_BuildEndurance.pdb and b/Stardew_Valley_Mods/BuildEndurance/SMAPI_BuildEndurance-Source/SMAPI_BuildEndurance/obj/Debug/SMAPI_BuildEndurance.pdb differ diff --git a/Stardew_Valley_Mods/BuildHealth/BuildHealth.zip b/Stardew_Valley_Mods/BuildHealth/BuildHealth.zip index 1cad144b..ad112bff 100644 Binary files a/Stardew_Valley_Mods/BuildHealth/BuildHealth.zip and b/Stardew_Valley_Mods/BuildHealth/BuildHealth.zip differ diff --git a/Stardew_Valley_Mods/BuyBackCollectables/BuyBackCollectables.zip b/Stardew_Valley_Mods/BuyBackCollectables/BuyBackCollectables.zip index 4e6c422a..5abc1d07 100644 Binary files a/Stardew_Valley_Mods/BuyBackCollectables/BuyBackCollectables.zip and b/Stardew_Valley_Mods/BuyBackCollectables/BuyBackCollectables.zip differ diff --git a/Stardew_Valley_Mods/CurrentLocationPopUp/CurrentLocationPopUp.zip b/Stardew_Valley_Mods/CurrentLocationPopUp/CurrentLocationPopUp.zip index 95480217..39567f8e 100644 Binary files a/Stardew_Valley_Mods/CurrentLocationPopUp/CurrentLocationPopUp.zip and b/Stardew_Valley_Mods/CurrentLocationPopUp/CurrentLocationPopUp.zip differ diff --git a/Stardew_Valley_Mods/DailyQuest_Anywhere/DailyQuest_Anywhere.zip b/Stardew_Valley_Mods/DailyQuest_Anywhere/DailyQuest_Anywhere.zip index b350a41b..b1470be5 100644 Binary files a/Stardew_Valley_Mods/DailyQuest_Anywhere/DailyQuest_Anywhere.zip and b/Stardew_Valley_Mods/DailyQuest_Anywhere/DailyQuest_Anywhere.zip differ diff --git a/Stardew_Valley_Mods/Fall_28_Snow_Day/Fall28SnowDay.zip b/Stardew_Valley_Mods/Fall_28_Snow_Day/Fall28SnowDay.zip index 15fc7741..1ee737b0 100644 Binary files a/Stardew_Valley_Mods/Fall_28_Snow_Day/Fall28SnowDay.zip and b/Stardew_Valley_Mods/Fall_28_Snow_Day/Fall28SnowDay.zip differ diff --git a/Stardew_Valley_Mods/HappyBirthday/HappyBirthday.zip b/Stardew_Valley_Mods/HappyBirthday/HappyBirthday.zip index c4dd32ab..18a8da43 100644 Binary files a/Stardew_Valley_Mods/HappyBirthday/HappyBirthday.zip and b/Stardew_Valley_Mods/HappyBirthday/HappyBirthday.zip differ diff --git a/Stardew_Valley_Mods/MoreRain/MoreRain.zip b/Stardew_Valley_Mods/MoreRain/MoreRain.zip index 641662b3..db77e73e 100644 Binary files a/Stardew_Valley_Mods/MoreRain/MoreRain.zip and b/Stardew_Valley_Mods/MoreRain/MoreRain.zip differ diff --git a/Stardew_Valley_Mods/Museum_Rearrange/Museum_Rearranger.zip b/Stardew_Valley_Mods/Museum_Rearrange/Museum_Rearranger.zip index e8f3d42c..6600e0c0 100644 Binary files a/Stardew_Valley_Mods/Museum_Rearrange/Museum_Rearranger.zip and b/Stardew_Valley_Mods/Museum_Rearrange/Museum_Rearranger.zip differ diff --git a/Stardew_Valley_Mods/NightOwl/NightOwl.zip b/Stardew_Valley_Mods/NightOwl/NightOwl.zip index 4667bd27..9004f36b 100644 Binary files a/Stardew_Valley_Mods/NightOwl/NightOwl.zip and b/Stardew_Valley_Mods/NightOwl/NightOwl.zip differ diff --git a/Stardew_Valley_Mods/NoMorePets/NoMorePets.zip b/Stardew_Valley_Mods/NoMorePets/NoMorePets.zip index 10548f37..743b635b 100644 Binary files a/Stardew_Valley_Mods/NoMorePets/NoMorePets.zip and b/Stardew_Valley_Mods/NoMorePets/NoMorePets.zip differ diff --git a/Stardew_Valley_Mods/SDVMusicNameSeeker/MusicNameSeeker.zip b/Stardew_Valley_Mods/SDVMusicNameSeeker/MusicNameSeeker.zip index fc0d4b56..402ae818 100644 Binary files a/Stardew_Valley_Mods/SDVMusicNameSeeker/MusicNameSeeker.zip and b/Stardew_Valley_Mods/SDVMusicNameSeeker/MusicNameSeeker.zip differ diff --git a/Stardew_Valley_Mods/Save_Anywhere_V2/Save_Anywhere_V2.zip b/Stardew_Valley_Mods/Save_Anywhere_V2/Save_Anywhere_V2.zip index deddc9b6..c842d6d0 100644 Binary files a/Stardew_Valley_Mods/Save_Anywhere_V2/Save_Anywhere_V2.zip and b/Stardew_Valley_Mods/Save_Anywhere_V2/Save_Anywhere_V2.zip differ diff --git a/Stardew_Valley_Mods/Save_Anywhere_V2/Save_Anywhere_V2/bin/Debug/Save_Anywhere_V2.dll b/Stardew_Valley_Mods/Save_Anywhere_V2/Save_Anywhere_V2/bin/Debug/Save_Anywhere_V2.dll index 26ae3972..ad1c7021 100644 Binary files a/Stardew_Valley_Mods/Save_Anywhere_V2/Save_Anywhere_V2/bin/Debug/Save_Anywhere_V2.dll and b/Stardew_Valley_Mods/Save_Anywhere_V2/Save_Anywhere_V2/bin/Debug/Save_Anywhere_V2.dll differ diff --git a/Stardew_Valley_Mods/Save_Anywhere_V2/Save_Anywhere_V2/bin/Debug/Save_Anywhere_V2.pdb b/Stardew_Valley_Mods/Save_Anywhere_V2/Save_Anywhere_V2/bin/Debug/Save_Anywhere_V2.pdb index d2655bf9..4acae08d 100644 Binary files a/Stardew_Valley_Mods/Save_Anywhere_V2/Save_Anywhere_V2/bin/Debug/Save_Anywhere_V2.pdb and b/Stardew_Valley_Mods/Save_Anywhere_V2/Save_Anywhere_V2/bin/Debug/Save_Anywhere_V2.pdb differ diff --git a/Stardew_Valley_Mods/Save_Anywhere_V2/Save_Anywhere_V2/obj/Debug/Save_Anywhere_V2.dll b/Stardew_Valley_Mods/Save_Anywhere_V2/Save_Anywhere_V2/obj/Debug/Save_Anywhere_V2.dll index 26ae3972..ad1c7021 100644 Binary files a/Stardew_Valley_Mods/Save_Anywhere_V2/Save_Anywhere_V2/obj/Debug/Save_Anywhere_V2.dll and b/Stardew_Valley_Mods/Save_Anywhere_V2/Save_Anywhere_V2/obj/Debug/Save_Anywhere_V2.dll differ diff --git a/Stardew_Valley_Mods/Save_Anywhere_V2/Save_Anywhere_V2/obj/Debug/Save_Anywhere_V2.pdb b/Stardew_Valley_Mods/Save_Anywhere_V2/Save_Anywhere_V2/obj/Debug/Save_Anywhere_V2.pdb index d2655bf9..4acae08d 100644 Binary files a/Stardew_Valley_Mods/Save_Anywhere_V2/Save_Anywhere_V2/obj/Debug/Save_Anywhere_V2.pdb and b/Stardew_Valley_Mods/Save_Anywhere_V2/Save_Anywhere_V2/obj/Debug/Save_Anywhere_V2.pdb differ diff --git a/Stardew_Valley_Mods/StardewSymphony/StardewSymphony.zip b/Stardew_Valley_Mods/StardewSymphony/StardewSymphony.zip index 6bedfabe..5116bc51 100644 Binary files a/Stardew_Valley_Mods/StardewSymphony/StardewSymphony.zip and b/Stardew_Valley_Mods/StardewSymphony/StardewSymphony.zip differ diff --git a/Stardew_Valley_Mods/Stardew_Save_Backup/StardewSaveBackup.zip b/Stardew_Valley_Mods/Stardew_Save_Backup/StardewSaveBackup.zip index a05f7c28..a9f1e313 100644 Binary files a/Stardew_Valley_Mods/Stardew_Save_Backup/StardewSaveBackup.zip and b/Stardew_Valley_Mods/Stardew_Save_Backup/StardewSaveBackup.zip differ