New Option: Snowball Size (#647)

* snowball size

* snowball size option

* decrease threshold

* increase range in case snowball too smol
This commit is contained in:
Newchan authored and GitHub committed 2026-07-09 12:44:41 +02:00
1 parent 212515dc52
commit fb7f7caa07
3 files changed
+16 -4

No files matched your search

+13 -2
View File
@@ -17,6 +17,7 @@ public static class Snowdown
public static float SnowballThrowSpeed = 4f;
private static int SnowballGainFrequency = 5;
private static int MaxSnowballsInHand = 5;
public static float SnowballSize = 1f;
private static int MaxCoinsInHand = 10;
private static bool GameEndsAfterTime = true;
private static int GameEndTime = 300;
@@ -37,6 +38,7 @@ public static class Snowdown
private static OptionItem GameEndTimeOption;
private static OptionItem GameEndsWhenPointsReachedOption;
private static OptionItem PointsToReachOption;
private static OptionItem SnowballSizeOption;
private static Dictionary<PowerUp, OptionItem> PowerUpPriceOptions = [];
private static readonly PowerUp[] AllPowerUp = Enum.GetValues<PowerUp>();
@@ -94,13 +96,19 @@ public static class Snowdown
GameEndsWhenPointsReachedOption = new BooleanOptionItem(id++, "Snowdown.GameEndsWhenPointsReachedOption", true, tab)
.SetColor(color)
.SetGameMode(gameMode);
PointsToReachOption = new IntegerOptionItem(id++, "Snowdown.PointsToReachOption", new(1, 100, 1), 5, tab)
.SetColor(color)
.SetGameMode(gameMode)
.SetParent(GameEndsWhenPointsReachedOption)
.SetValueFormat(OptionFormat.Pieces);
SnowballSizeOption = new FloatOptionItem(id++, "Snowdown.SnowballSizeOption", new(0.1f, 2f, 0.1f), 1f, tab)
.SetHeader(true)
.SetColor(color)
.SetGameMode(gameMode)
.SetValueFormat(OptionFormat.Multiplier);
PowerUpPriceOptions = AllPowerUp.ToDictionary(x => x, x => new IntegerOptionItem(id++, "Snowdown.PowerUpPriceOption", new(1, 20, 1), PowerUpPrices[x], tab)
.SetColor(color)
.SetGameMode(gameMode)
@@ -218,6 +226,7 @@ public static class Snowdown
GameEndTime = GameEndTimeOption.GetInt();
GameEndsWhenPointsReached = GameEndsWhenPointsReachedOption.GetBool();
PointsToReach = PointsToReachOption.GetInt();
SnowballSize = SnowballSizeOption.GetFloat();
PowerUpPrices = PowerUpPriceOptions.ToDictionary(x => x.Key, x => x.Value.GetInt());
Data = Main.EnumeratePlayerControls().ToDictionary(x => x.PlayerId, _ => new PlayerData());
@@ -260,7 +269,9 @@ public static class Snowdown
long now = Utils.TimeStamp;
Vector2 pos = __instance.Pos();
Snowball touchingSnowball = Snowballs.Find(x => x.Active && x.Thrower != __instance && FastVector2.DistanceWithinRange(x.Position, pos, 1.5f));
var snowballRange = Mathf.Max(0.5f, 1.5f * SnowballSize);
Snowball touchingSnowball = Snowballs.Find(x => x.Active && x.Thrower != __instance && FastVector2.DistanceWithinRange(x.Position, pos, snowballRange));
if (touchingSnowball != null)
{
+2 -2
View File
@@ -949,7 +949,7 @@ namespace EHR
{
Thrower = thrower;
Direction = direction;
CreateNetObject("<line-height=97%><cspace=0.16em><#0000>W</color><mark=#e4fdff>WWWW</mark><#0000>W</color>\n<mark=#e4fdff>WWWWWW</mark>\n<mark=#e4fdff>WWWWWW</mark>\n<mark=#e4fdff>WWWWWW</mark>\n<mark=#e4fdff>WWWWWW</mark>\n<#0000>W</color><mark=#e4fdff>WWWW</mark><#0000>W", from);
CreateNetObject($"<size={Snowdown.SnowballSize * 100}%><line-height=97%><cspace=0.16em><#0000>W</color><mark=#e4fdff>WWWW</mark><#0000>W</color>\n<mark=#e4fdff>WWWWWW</mark>\n<mark=#e4fdff>WWWWWW</mark>\n<mark=#e4fdff>WWWWWW</mark>\n<mark=#e4fdff>WWWWWW</mark>\n<#0000>W</color><mark=#e4fdff>WWWW</mark><#0000>W", from);
Active = true;
}
@@ -961,7 +961,7 @@ namespace EHR
Vector2 newPos = Position + Direction * Time.fixedDeltaTime * Snowdown.SnowballThrowSpeed;
if ((PhysicsHelpers.AnythingBetween(Position, newPos, Constants.ShipOnlyMask, false)) ||
if (PhysicsHelpers.AnythingBetween(Position, newPos, Constants.ShipOnlyMask, false) ||
newPos.x < Snowdown.MapBounds.X.Left || newPos.x > Snowdown.MapBounds.X.Right || newPos.y < Snowdown.MapBounds.Y.Bottom || newPos.y > Snowdown.MapBounds.Y.Top)
{
SetInactive();
+1
View File
@@ -8140,6 +8140,7 @@
"Snowdown.PowerUpPriceOption": "{powerup} Powerup Price (Coins)",
"Snowdown.ShopHelp": "Vanish: Cycle between powerups | Pet: Buy selected powerup | Sabotage: Exit shop",
"Snowdown.SnowballGainFrequencyOption": "Initial Snowball Gaining Frequency",
"Snowdown.SnowballSizeOption": "Snowball Size",
"Snowdown.SnowballThrowSpeedOption": "Snowball Throwing Speed",
"SnowdownButtonText": "THROW",
"DoomTag": "DOOM TAG",