diff --git a/FlufflParty/.idea/.idea.FlufflParty/.idea/workspace.xml b/FlufflParty/.idea/.idea.FlufflParty/.idea/workspace.xml
index 9164de1..642bc01 100644
--- a/FlufflParty/.idea/.idea.FlufflParty/.idea/workspace.xml
+++ b/FlufflParty/.idea/.idea.FlufflParty/.idea/workspace.xml
@@ -4,10 +4,7 @@
-
-
-
-
+
@@ -56,9 +53,9 @@
},
"keyToStringList": {
"rider.external.source.directories": [
- "C:\\Users\\afist\\AppData\\Roaming\\JetBrains\\Rider2022.3\\resharper-host\\DecompilerCache",
- "C:\\Users\\afist\\AppData\\Roaming\\JetBrains\\Rider2022.3\\resharper-host\\SourcesCache",
- "C:\\Users\\afist\\AppData\\Local\\Symbols\\src"
+ "C:\\Users\\braus\\AppData\\Roaming\\JetBrains\\Rider2023.1\\resharper-host\\DecompilerCache",
+ "C:\\Users\\braus\\AppData\\Roaming\\JetBrains\\Rider2023.1\\resharper-host\\SourcesCache",
+ "C:\\Users\\braus\\AppData\\Local\\Symbols\\src"
]
}
}]]>
@@ -174,6 +171,7 @@
+
diff --git a/FlufflParty/Assets/Scripts/Client.cs b/FlufflParty/Assets/Scripts/Client.cs
index 9e06565..32d8132 100644
--- a/FlufflParty/Assets/Scripts/Client.cs
+++ b/FlufflParty/Assets/Scripts/Client.cs
@@ -405,6 +405,28 @@ public class Client : MonoBehaviour
}
}
+ break;
+
+ case 1:
+ for (int i = 0; i < 4; i++)
+ {
+ int option = job.data[i + 1];
+ int value = job.data[i + 5];
+
+ switch (option)
+ {
+ case 0:
+ rotator.SetOptionsText(i, "Mushroom");
+ break;
+ case 1:
+ rotator.SetOptionsText(i, "Doubledice");
+ break;
+ case 2:
+ rotator.SetOptionsText(i, "Trap");
+ break;
+ }
+ }
+
break;
}
@@ -551,6 +573,9 @@ public class Client : MonoBehaviour
}
/*
+ * TYPE:
+ * 0 = Pink Field!!!!
+ *
* OPT:
* 0 = Get Coins
* 1 = Loose Coins
@@ -560,8 +585,18 @@ public class Client : MonoBehaviour
* VAL:
* value of each option (not needed = 0)
*
+ *
* TYPE:
- * 0 = Pink Field
+ * 1 = Item Field!!!!
+ *
+ * OPT:
+ * 0 = Mushroom
+ * 1 = Double Dice
+ * 2 = Trap
+ * 3 = Trap
+ *
+ * VAL:
+ * value of each option (not needed = 0)
*/
public void SendStartRotator(int opt1, int opt2, int opt3, int opt4, int val1, int val2, int val3, int val4,
int type)
diff --git a/FlufflParty/Assets/Scripts/Players/PlayablePlayer.cs b/FlufflParty/Assets/Scripts/Players/PlayablePlayer.cs
index 0118138..6a75e0c 100644
--- a/FlufflParty/Assets/Scripts/Players/PlayablePlayer.cs
+++ b/FlufflParty/Assets/Scripts/Players/PlayablePlayer.cs
@@ -1,13 +1,5 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Net.Mail;
using TMPro;
-using Unity.VisualScripting;
-using UnityEditor;
-using UnityEditor.Timeline.Actions;
using UnityEngine;
-using UnityEngine.UI;
using Random = UnityEngine.Random;
public class PlayablePlayer : Player
@@ -36,7 +28,7 @@ public class PlayablePlayer : Player
private static PlayablePlayer instance;
-
+
//Animation:
private Vector3 lastPosAnim = Vector3.zero;
private Quaternion rotation = Quaternion.identity;
@@ -54,7 +46,7 @@ public class PlayablePlayer : Player
diceScript = dice.GetComponent();
instance = this;
-
+
nameSign = playerTexts[1].gameObject;
}
@@ -76,13 +68,13 @@ public class PlayablePlayer : Player
{
animator.SetInteger("value", 1);
}
- else if(jumpRequest)
+ else if (jumpRequest)
{
jumpRequest = false;
animator.SetInteger("value", 2);
lastTimeDoneIdleAction = Time.time;
}
- else if(Time.time - lastTimeDoneIdleAction > idleActionDelay)
+ else if (Time.time - lastTimeDoneIdleAction > idleActionDelay)
{
lastTimeDoneIdleAction = Time.time;
idleActionDelay = Random.Range(2f, 5f);
@@ -94,7 +86,7 @@ public class PlayablePlayer : Player
animator.SetInteger("value", 0);
}
//END
-
+
if (activated && !name.Equals(""))
{
//Generiere Würfelzahl von 1-6 wenn gerade gewürfelt werden darf
@@ -102,7 +94,7 @@ public class PlayablePlayer : Player
{
if (!Physics.Raycast(new Vector3(Input.mousePosition.x, Input.mousePosition.y, -200), Vector3.forward))
{
- DiceRollRoutine();
+ DiceRollRoutine();
}
}
}
@@ -113,11 +105,11 @@ public class PlayablePlayer : Player
private void DiceRollRoutine()
{
diceScript.SetMaterial(0);
-
+
jumpRequest = true;
-
+
wurfelt = true;
- wurfelZahl = Random.Range(1, 7);
+ wurfelZahl = Random.Range(2, 3);
switch (activeItem)
{
@@ -191,8 +183,8 @@ public class PlayablePlayer : Player
if (currentField.placedItem != null)
{
Trap t = currentField.placedItem.GetComponent();
-
- if(t.target.index != index)
+
+ if (t.target.index != index)
{
int coinsAmount = (int)(coins * 0.1f);
AddCoins(-coinsAmount);
@@ -202,20 +194,20 @@ public class PlayablePlayer : Player
}
}
}
+
Vector3 currentRotation = Quaternion.ToEulerAngles(transform.rotation);
currentRotation.y = -34;
transform.rotation = Quaternion.Euler(currentRotation);
-
+
int fieldReturnStatus = -1;
if (currentField != null)
{
fieldReturnStatus = currentField.Action(index);
}
-
+
//TODO: temp spieler finsihed erst, wenn field action ausgeführt wurde
if (wurfelt)
{
-
switch (fieldReturnStatus)
{
case 0: //Blaues Feld
@@ -226,44 +218,6 @@ public class PlayablePlayer : Player
client.SendCoinFieldAction(1);
AddCoins(-3);
break;
- // case 2: //pinkes Feld
- // int randyPinkField = Random.Range(4, 4);
- // int tempCurrentItems = -1;
- // switch (randyPinkField)
- // {
- // case 1:
- // client.SendCoinFieldAction(0);
- // int tempAddCoins = Random.Range(3, 6);
- // AddCoins(tempAddCoins);
- // break;
- // case 2:
- // client.SendCoinFieldAction(1);
- // int tempLoseCoins = Random.Range(-3, -6);
- // AddCoins(tempLoseCoins);
- // break;
- // case 3:
- // int tempAddItem = Random.Range(0, 3);
- // AddItem(client.items[tempAddItem]);
- // break;
- // case 4:
- // for (int i = 0; i < items.Length; i++)
- // {
- // if (items[i] != null)
- // {
- // tempCurrentItems++;
- // }
- // }
- //
- // if (tempCurrentItems >= 0)
- // {
- // int pickRandomItem = Random.Range(0, tempCurrentItems);
- // client.items[pickRandomItem] = null;
- // itemInfoImages[pickRandomItem].color = new Color(0, 0, 0, 0);
- // client.SendLostItem((byte)pickRandomItem);
- // }
- // break;
- // }
- // break;
case 2:
int randCoins1 = Random.Range(2, 6);
int randCoins2 = Random.Range(1, 4);
@@ -305,7 +259,7 @@ public class PlayablePlayer : Player
Invoke("StopRotator", 2);
Invoke("ActivateLayout1", 5.5f);
break;
-
+
case 3: //Item Field keine Ahnung ob das funktioniert XD muss man mal testen; Keine Ahnung was SendStartRotator an den Server weitersendet MUSS überarbeitet werden
RandomRotator rotatorItemField = uiHandler.rotator.GetComponent();
this.rotator = rotatorItemField;
@@ -313,13 +267,18 @@ public class PlayablePlayer : Player
rotatorItemField.SetOptionsText(0, "Mushroom");
rotatorItemField.SetOptionsText(1, "Double Dice");
rotatorItemField.SetOptionsText(2, "Trap");
+ rotatorItemField.SetOptionsText(3, "Trap");
rotatorItemField.StartRandom();
- //???client.SendStartRotator(0, 1, 2, randCoins1, randCoins2, -randCoins3, 0, 0);
+ client.SendStartRotator(0, 1, 2, 2, 0, 0, 0, 0, 1);
+
+ int randomItemField = Random.Range(0, 4);
- int randomItemField = Random.Range(0, 3);
- AddItem(client.items[randomItemField]);
rotatorStopIndex = randomItemField;
+
+ randomItemField = randomItemField == 3 ? randomItemField - 1 : randomItemField;
+ AddItem(client.items[randomItemField]);
+
Invoke("StopRotator", 2);
Invoke("ActivateLayout1", 5.5f);
break;
@@ -327,11 +286,11 @@ public class PlayablePlayer : Player
if (!checkDoubleDice)
{
- if(fieldReturnStatus != 2)
+ if (fieldReturnStatus != 2 && fieldReturnStatus != 3)
{
Invoke("Finish", 2);
}
-
+
activated = false;
}
else
@@ -396,7 +355,6 @@ public class PlayablePlayer : Player
{
wait = true;
}
-
}
//Bewegt den Player von einem Punkt(lastPos) zu einem anderen Punkt(moveTo) mit konstanter Geschwindigkeit
@@ -408,17 +366,17 @@ public class PlayablePlayer : Player
if (!eventstop)
{
nextPoint = Vector3.Lerp(lastPos, moveTo, interPol);
-
+
//Rotation in move direction
Vector3 lookPos = nextPoint - transform.position;
lookPos.y = 0;
- if(lookPos != Vector3.zero)
+ if (lookPos != Vector3.zero)
{
Quaternion rotation = Quaternion.LookRotation(lookPos);
transform.rotation = Quaternion.Slerp(transform.rotation, rotation, Time.deltaTime * rotationDamping);
}
//END
-
+
transform.position = new Vector3(nextPoint.x, transform.position.y, nextPoint.z);
interPol += (Time.deltaTime * speed) / Mathf.Abs(Vector3.Distance(moveTo, lastPos));
}
@@ -505,6 +463,7 @@ public class PlayablePlayer : Player
temp.transform.position = currentField.transform.position + (Vector3.up / 2);
activeItem = Item.Type.None;
}
+
items[index] = null;
}
@@ -513,7 +472,7 @@ public class PlayablePlayer : Player
uiHandler.ActivateLayout1();
Finish();
}
-
+
private void StopRotator()
{
client.SendStopRotator(rotatorStopIndex);
diff --git a/FlufflParty/UserSettings/Layouts/default-2021.dwlt b/FlufflParty/UserSettings/Layouts/default-2021.dwlt
index eb43382..d969466 100644
--- a/FlufflParty/UserSettings/Layouts/default-2021.dwlt
+++ b/FlufflParty/UserSettings/Layouts/default-2021.dwlt
@@ -19,7 +19,7 @@ MonoBehaviour:
width: 1920
height: 1117
m_ShowMode: 4
- m_Title: Project
+ m_Title: Scene
m_RootView: {fileID: 6}
m_MinSize: {x: 875, y: 300}
m_MaxSize: {x: 10000, y: 10000}
@@ -68,8 +68,8 @@ MonoBehaviour:
y: 0
width: 377
height: 1067
- m_MinSize: {x: 275, y: 50}
- m_MaxSize: {x: 4000, y: 4000}
+ m_MinSize: {x: 276, y: 71}
+ m_MaxSize: {x: 4001, y: 4021}
m_ActualView: {fileID: 16}
m_Panes:
- {fileID: 16}
@@ -453,9 +453,9 @@ MonoBehaviour:
m_IsLocked: 0
m_FolderTreeState:
scrollPos: {x: 0, y: 77}
- m_SelectedIDs: ae610000
- m_LastClickedID: 25006
- m_ExpandedIDs: 000000008461000086610000886100008a6100008c61000000ca9a3b
+ m_SelectedIDs: 1c6c0000
+ m_LastClickedID: 27676
+ m_ExpandedIDs: 00000000e86b0000ea6b0000ec6b0000ee6b0000f06b000000ca9a3b
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@@ -483,7 +483,7 @@ MonoBehaviour:
scrollPos: {x: 0, y: 0}
m_SelectedIDs:
m_LastClickedID: 0
- m_ExpandedIDs: 000000008461000086610000886100008a6100008c610000
+ m_ExpandedIDs: 00000000e86b0000ea6b0000ec6b0000ee6b0000f06b0000
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@@ -510,7 +510,7 @@ MonoBehaviour:
m_ListAreaState:
m_SelectedInstanceIDs:
m_LastClickedInstanceID: 0
- m_HadKeyboardFocusLastEvent: 1
+ m_HadKeyboardFocusLastEvent: 0
m_ExpandedInstanceIDs: c6230000f8650000a03e0500
m_RenameOverlay:
m_UserAcceptedRename: 0
@@ -611,9 +611,9 @@ MonoBehaviour:
m_SceneHierarchy:
m_TreeViewState:
scrollPos: {x: 0, y: 0}
- m_SelectedIDs: 56170000
+ m_SelectedIDs:
m_LastClickedID: 0
- m_ExpandedIDs: 04fbffff
+ m_ExpandedIDs: 00e8ffff50e8ffffbae9ffff4aecffff7aecffff0ef2ffff60f2ffffcaf3ffff5af6ffff8af6ffff06fbffff
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name: