From ef09b2770b044681e2ba6a601b3fbbcf4b6d4db7 Mon Sep 17 00:00:00 2001 From: AliIbnAbiTalib Date: Thu, 6 Apr 2023 23:16:05 +0200 Subject: [PATCH] Trap active Test 1 --- .../.idea.FlufflParty/.idea/workspace.xml | 2 +- .../Assets/Scripts/Players/NoPlayablePlayer.cs | 18 ++++++++++-------- .../Assets/Scripts/Players/PlayablePlayer.cs | 2 +- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/FlufflParty/.idea/.idea.FlufflParty/.idea/workspace.xml b/FlufflParty/.idea/.idea.FlufflParty/.idea/workspace.xml index b14ca7c..5077f5c 100644 --- a/FlufflParty/.idea/.idea.FlufflParty/.idea/workspace.xml +++ b/FlufflParty/.idea/.idea.FlufflParty/.idea/workspace.xml @@ -152,7 +152,7 @@ - + diff --git a/FlufflParty/Assets/Scripts/Players/NoPlayablePlayer.cs b/FlufflParty/Assets/Scripts/Players/NoPlayablePlayer.cs index 79744f1..e87c588 100644 --- a/FlufflParty/Assets/Scripts/Players/NoPlayablePlayer.cs +++ b/FlufflParty/Assets/Scripts/Players/NoPlayablePlayer.cs @@ -169,16 +169,18 @@ public class NoPlayablePlayer : Player //Der Spieler steht gerade else { - /* - if (currentField.placedItem != null) + if (currentField != null) { - Trap t = currentField.placedItem.GetComponent(); - AddCoins(-3); - t.target.AddCoins(3); - Destroy(t); - currentField.placedItem = null; + if (currentField.placedItem != null) + { + Trap t = currentField.placedItem.GetComponent(); + AddCoins(-3); + t.target.AddCoins(3); + Destroy(t); + currentField.placedItem = null; + } } - */ + Vector3 currentRotation = Quaternion.ToEulerAngles(transform.rotation); currentRotation.y = -34; transform.rotation = Quaternion.Euler(currentRotation); diff --git a/FlufflParty/Assets/Scripts/Players/PlayablePlayer.cs b/FlufflParty/Assets/Scripts/Players/PlayablePlayer.cs index 3194613..8de58d6 100644 --- a/FlufflParty/Assets/Scripts/Players/PlayablePlayer.cs +++ b/FlufflParty/Assets/Scripts/Players/PlayablePlayer.cs @@ -106,7 +106,7 @@ public class PlayablePlayer : Player jumpRequest = true; wurfelt = true; - wurfelZahl = Random.Range(1, 7); + wurfelZahl = Random.Range(3, 4); switch (activeItem) {