diff --git a/FlufflParty/.idea/.idea.FlufflParty/.idea/workspace.xml b/FlufflParty/.idea/.idea.FlufflParty/.idea/workspace.xml index d078b85..b5e9d2e 100644 --- a/FlufflParty/.idea/.idea.FlufflParty/.idea/workspace.xml +++ b/FlufflParty/.idea/.idea.FlufflParty/.idea/workspace.xml @@ -1,19 +1,13 @@ - - - - - - + - diff --git a/FlufflParty/Assets/Scripts/Fields/Field.cs b/FlufflParty/Assets/Scripts/Fields/Field.cs index eb73dc8..a8bae49 100644 --- a/FlufflParty/Assets/Scripts/Fields/Field.cs +++ b/FlufflParty/Assets/Scripts/Fields/Field.cs @@ -7,7 +7,7 @@ public abstract class Field : MonoBehaviour //Liste der nächsten Feld, die auf das diesige Feld folgen [SerializeField] private Field[] target; [SerializeField] private Arrow[] directionalArrows; - public Item placedItem; + public GameObject placedItem; /* * Field Definition: diff --git a/FlufflParty/Assets/Scripts/Players/NoPlayablePlayer.cs b/FlufflParty/Assets/Scripts/Players/NoPlayablePlayer.cs index dd1fbf7..6098d6a 100644 --- a/FlufflParty/Assets/Scripts/Players/NoPlayablePlayer.cs +++ b/FlufflParty/Assets/Scripts/Players/NoPlayablePlayer.cs @@ -176,8 +176,8 @@ public class NoPlayablePlayer : Player Trap t = currentField.placedItem.GetComponent(); AddCoins(-3); t.target.AddCoins(3); - Destroy(t.gameObject); currentField.placedItem = null; + Destroy(t.gameObject); } } diff --git a/FlufflParty/Assets/Scripts/Players/PlayablePlayer.cs b/FlufflParty/Assets/Scripts/Players/PlayablePlayer.cs index 7db7bd1..207d468 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(3, 4); + wurfelZahl = Random.Range(6, 7); switch (activeItem) { @@ -180,8 +180,8 @@ public class PlayablePlayer : Player AddCoins(-3); Debug.Log(t.name); t.target.AddCoins(3); - Destroy(t.gameObject); currentField.placedItem = null; + Destroy(t.gameObject); } } Vector3 currentRotation = Quaternion.ToEulerAngles(transform.rotation); @@ -373,9 +373,9 @@ public class PlayablePlayer : Player client.SendActiveItem((byte)index); if (items[index].type == Item.Type.Trap) { - currentField.placedItem = items[index]; GameObject temp = Instantiate(items[index].gameObject); Trap t = temp.GetComponent(); + currentField.placedItem = t.gameObject; t.target = gameObject.GetComponent(); temp.transform.position = currentField.transform.position + (Vector3.up / 2); activeItem = Item.Type.None; diff --git a/FlufflParty/Assets/Scripts/Players/Player.cs b/FlufflParty/Assets/Scripts/Players/Player.cs index 54166af..bca0eb8 100644 --- a/FlufflParty/Assets/Scripts/Players/Player.cs +++ b/FlufflParty/Assets/Scripts/Players/Player.cs @@ -108,9 +108,9 @@ public abstract class Player : MonoBehaviour itemInfoImages[index].color = new Color(0, 0, 0, 0); if (items[index].type == Item.Type.Trap) { - currentField.placedItem = items[index]; GameObject temp = Instantiate(items[index].gameObject); Trap t = temp.GetComponent(); + currentField.placedItem = t.gameObject; t.target = gameObject.GetComponent(); temp.transform.position = currentField.transform.position + (Vector3.up / 2); activeItem = Item.Type.None;