From 2a497e709b34792a1815926b3a30fd4cf94bb0b6 Mon Sep 17 00:00:00 2001 From: SpoodyTheOne Date: Fri, 9 Feb 2024 09:23:58 +0100 Subject: [PATCH] Tweaked upgrade prices and fixed horrendous Upgrader.cs keyboard port :skull: --- Assets/Scenes/GameScene.unity | 20 ++++++++ Assets/Scripts/Upgrader.cs | 90 +++++++++++++---------------------- 2 files changed, 54 insertions(+), 56 deletions(-) diff --git a/Assets/Scenes/GameScene.unity b/Assets/Scenes/GameScene.unity index 10b81d0..b524e5e 100644 --- a/Assets/Scenes/GameScene.unity +++ b/Assets/Scenes/GameScene.unity @@ -4156,10 +4156,30 @@ PrefabInstance: propertyPath: bloodManager value: objectReference: {fileID: 640312359} + - target: {fileID: 2458716502903188221, guid: 48e0e53445d42474895d37a321c39d1c, type: 3} + propertyPath: reelIncrease + value: 1.2 + objectReference: {fileID: 0} - target: {fileID: 2458716502903188221, guid: 48e0e53445d42474895d37a321c39d1c, type: 3} propertyPath: ropeIncrease value: 1.1 objectReference: {fileID: 0} + - target: {fileID: 2458716502903188221, guid: 48e0e53445d42474895d37a321c39d1c, type: 3} + propertyPath: bloodIncrease + value: 1.15 + objectReference: {fileID: 0} + - target: {fileID: 2458716502903188221, guid: 48e0e53445d42474895d37a321c39d1c, type: 3} + propertyPath: damageIncrease + value: 1.5 + objectReference: {fileID: 0} + - target: {fileID: 2458716502903188221, guid: 48e0e53445d42474895d37a321c39d1c, type: 3} + propertyPath: healthIncrease + value: 1.25 + objectReference: {fileID: 0} + - target: {fileID: 2458716502903188221, guid: 48e0e53445d42474895d37a321c39d1c, type: 3} + propertyPath: mopSizeIncrease + value: 1.5 + objectReference: {fileID: 0} - target: {fileID: 2603779566095873902, guid: 48e0e53445d42474895d37a321c39d1c, type: 3} propertyPath: m_Pivot.x value: 0 diff --git a/Assets/Scripts/Upgrader.cs b/Assets/Scripts/Upgrader.cs index 6e9a9bf..8c1c6cb 100644 --- a/Assets/Scripts/Upgrader.cs +++ b/Assets/Scripts/Upgrader.cs @@ -115,62 +115,6 @@ public class Upgrader : MonoBehaviour if (canUpgrade()) { - //keyboard upgrade - if (Input.GetKeyUp(KeyCode.Alpha1)) - { - bloodManager.score -= upgradeCost; - upgradeCost = (int)(upgradeCost * 1.2f); - UpgradeMopSize(); - } - else if (Input.GetKeyUp(KeyCode.Alpha2)) - { - - bloodManager.score -= upgradeCost; - upgradeCost = (int)(upgradeCost * 1.2f); - UpgradeSpeed(); - } - else if (Input.GetKeyUp(KeyCode.Alpha3)) - { - - bloodManager.score -= upgradeCost; - upgradeCost = (int)(upgradeCost * 1.2f); - RopeUpgrade(); - } - else if (Input.GetKeyUp(KeyCode.Alpha4)) - { - - bloodManager.score -= upgradeCost; - upgradeCost = (int)(upgradeCost * 1.2f); - HealthUpgrade(); - } - else if (Input.GetKeyUp(KeyCode.Alpha5)) - { - - bloodManager.score -= upgradeCost; - upgradeCost = (int)(upgradeCost * 1.2f); - DamageUpgrade(); - } - else if (Input.GetKeyUp(KeyCode.Alpha6)) - { - - bloodManager.score -= upgradeCost; - upgradeCost = (int)(upgradeCost * 1.2f); - BloodUpgrade(); - } - else if (Input.GetKeyUp(KeyCode.Alpha7)) - { - - bloodManager.score -= upgradeCost; - upgradeCost = (int)(upgradeCost * 1.2f); - ReelUpgrade(); - } - else if (Input.GetKeyUp(KeyCode.Alpha8)) - { - ReviveUpgrade(); - bloodManager.score -= upgradeCost; - upgradeCost = (int)(upgradeCost * 1.2f); - - } if (!prevCouldUpgrade) { @@ -187,6 +131,40 @@ public class Upgrader : MonoBehaviour int p1a = getRegion(Player1Input.look.x, Player1Input.look.y, 8); int p2a = getRegion(Player2Input.look.x, Player2Input.look.y, 8); + //keyboard upgrade + if (Input.GetKey(KeyCode.Alpha1)) + { + p1a = p2a = 0; + } + else if (Input.GetKey(KeyCode.Alpha2)) + { + p1a = p2a = 1; + } + else if (Input.GetKey(KeyCode.Alpha3)) + { + p1a = p2a = 2; + } + else if (Input.GetKey(KeyCode.Alpha4)) + { + p1a = p2a = 3; + } + else if (Input.GetKey(KeyCode.Alpha5)) + { + p1a = p2a = 4; + } + else if (Input.GetKey(KeyCode.Alpha6)) + { + p1a = p2a = 5; + } + else if (Input.GetKey(KeyCode.Alpha7)) + { + p1a = p2a = 6; + } + else if (Input.GetKey(KeyCode.Alpha8)) + { + p1a = p2a = 7; + } + if (p1a != -1 && p2a == p1a) { if (acceptTime > 2f)