From af52284c527d2676676b4004b7fc766ac9b713b8 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Thu, 18 Mar 2021 21:45:31 +0100 Subject: [PATCH] fixed being able to use the snow blower and watering can in a cutscene --- .config/dotnet-tools.json | 6 ++++++ GreatSpringGameJam/Player.cs | 26 ++++++++++++++------------ Publish.bat | 7 +++---- 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 7352bab..5203bd3 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -7,6 +7,12 @@ "commands": [ "gamebundle" ] + }, + "butlerdotnet": { + "version": "1.0.1", + "commands": [ + "dotnet-butler" + ] } } } \ No newline at end of file diff --git a/GreatSpringGameJam/Player.cs b/GreatSpringGameJam/Player.cs index 52dc91a..5508d75 100644 --- a/GreatSpringGameJam/Player.cs +++ b/GreatSpringGameJam/Player.cs @@ -128,19 +128,21 @@ namespace GreatSpringGameJam { // item usage HeldItem? usingItem = null; - var rot = this.GetHeldRotation(); - var rotVec = new Vector2(MathF.Cos(rot), MathF.Sin(rot)); - if (MlemGame.Input.IsDown(MouseButton.Left)) { - usingItem = this.heldItem = HeldItem.SnowBlower; - Random.NextUnitVector(out var vel); - vel = vel * 0.03F + rotVec * 0.13F; - this.Map.AddEntity(new SnowBlowerWind(this.Map, this.Position + Vector2.One / 2 + rotVec * 0.75F, vel)); - } else if (MlemGame.Input.IsDown(MouseButton.Right)) { - usingItem = this.heldItem = HeldItem.WateringCan; - if (Random.NextSingle() <= 0.45F) { + if (!GameImpl.Instance.IsInCutscene) { + var rot = this.GetHeldRotation(); + var rotVec = new Vector2(MathF.Cos(rot), MathF.Sin(rot)); + if (MlemGame.Input.IsDown(MouseButton.Left)) { + usingItem = this.heldItem = HeldItem.SnowBlower; Random.NextUnitVector(out var vel); - vel = vel * 0.015F + rotVec * 0.03F; - this.Map.AddEntity(new WaterDrop(this.Map, this.Position + Vector2.One / 2 + rotVec * 0.65F, vel)); + vel = vel * 0.03F + rotVec * 0.13F; + this.Map.AddEntity(new SnowBlowerWind(this.Map, this.Position + Vector2.One / 2 + rotVec * 0.75F, vel)); + } else if (MlemGame.Input.IsDown(MouseButton.Right)) { + usingItem = this.heldItem = HeldItem.WateringCan; + if (Random.NextSingle() <= 0.45F) { + Random.NextUnitVector(out var vel); + vel = vel * 0.015F + rotVec * 0.03F; + this.Map.AddEntity(new WaterDrop(this.Map, this.Position + Vector2.One / 2 + rotVec * 0.65F, vel)); + } } } for (var i = 0; i < HeldSounds.Length; i++) { diff --git a/Publish.bat b/Publish.bat index 0494a0a..5271807 100644 --- a/Publish.bat +++ b/Publish.bat @@ -1,6 +1,5 @@ cd GreatSpringGameJam dotnet gamebundle -wlm - -butler push bin/Bundled/win ellpeck/a-breath-of-spring-air:win --fix-permissions -butler push bin/Bundled/linux ellpeck/a-breath-of-spring-air:linux --fix-permissions -butler push bin/Bundled/mac ellpeck/a-breath-of-spring-air:mac --fix-permissions \ No newline at end of file +dotnet butler push bin/Bundled/win ellpeck/a-breath-of-spring-air:win --fix-permissions +dotnet butler push bin/Bundled/linux ellpeck/a-breath-of-spring-air:linux --fix-permissions +dotnet butler push bin/Bundled/mac ellpeck/a-breath-of-spring-air:mac --fix-permissions \ No newline at end of file