mirror of
https://github.com/Gurge44/EndlessHostRoles.git
synced 2026-10-20 01:46:25 +00:00
New Option: Snowball Size (#647)
* snowball size * snowball size option * decrease threshold * increase range in case snowball too smol
This commit is contained in:
1 parent
212515dc52
commit
fb7f7caa07
3 files changed
+16
-4
No files matched your search
+13
-2
@@ -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)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user