From fe220c4e4eb58171816243bc9f62ffd5ac15ebfc Mon Sep 17 00:00:00 2001 From: AliIbnAbiTalib Date: Thu, 6 Apr 2023 23:02:36 +0200 Subject: [PATCH] Miau --- FlufflParty/.idea/.idea.FlufflParty/.idea/workspace.xml | 6 ++---- FlufflParty/Assets/Scripts/Players/NoPlayablePlayer.cs | 8 ++++++++ FlufflParty/Assets/Scripts/Players/PlayablePlayer.cs | 8 ++++++++ 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/FlufflParty/.idea/.idea.FlufflParty/.idea/workspace.xml b/FlufflParty/.idea/.idea.FlufflParty/.idea/workspace.xml index 9886c16..9dd6760 100644 --- a/FlufflParty/.idea/.idea.FlufflParty/.idea/workspace.xml +++ b/FlufflParty/.idea/.idea.FlufflParty/.idea/workspace.xml @@ -3,10 +3,8 @@ - + - - diff --git a/FlufflParty/Assets/Scripts/Players/NoPlayablePlayer.cs b/FlufflParty/Assets/Scripts/Players/NoPlayablePlayer.cs index e02269d..9e231d7 100644 --- a/FlufflParty/Assets/Scripts/Players/NoPlayablePlayer.cs +++ b/FlufflParty/Assets/Scripts/Players/NoPlayablePlayer.cs @@ -169,6 +169,14 @@ public class NoPlayablePlayer : Player //Der Spieler steht gerade else { + 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 085975b..686d3fe 100644 --- a/FlufflParty/Assets/Scripts/Players/PlayablePlayer.cs +++ b/FlufflParty/Assets/Scripts/Players/PlayablePlayer.cs @@ -172,6 +172,14 @@ public class PlayablePlayer : Player //Der Spieler steht gerade else { + 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);