Fixed Item Field Rotator

This commit is contained in:
brausjonas
2023-04-16 18:13:18 +02:00
parent db5f7a5081
commit 6e642b511a
4 changed files with 81 additions and 89 deletions
+5 -7
View File
@@ -4,10 +4,7 @@
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="f0abe486-ee58-49bd-ad63-04a8b3fc78ec" name="Changes" comment="">
<change beforePath="$PROJECT_DIR$/.idea/.idea.FlufflParty/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.FlufflParty/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Scripts/Players/PlayablePlayer.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/Players/PlayablePlayer.cs" afterDir="false" />
</list>
<list default="true" id="f0abe486-ee58-49bd-ad63-04a8b3fc78ec" name="Changes" comment="" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
@@ -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"
]
}
}]]></component>
@@ -174,6 +171,7 @@
<workItem from="1681479671396" duration="22217000" />
<workItem from="1681565663292" duration="642000" />
<workItem from="1681648997302" duration="1618000" />
<workItem from="1681659517327" duration="1971000" />
</task>
<servers />
</component>
+36 -1
View File
@@ -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)
@@ -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
@@ -117,7 +109,7 @@ public class PlayablePlayer : Player
jumpRequest = true;
wurfelt = true;
wurfelZahl = Random.Range(1, 7);
wurfelZahl = Random.Range(2, 3);
switch (activeItem)
{
@@ -202,6 +194,7 @@ public class PlayablePlayer : Player
}
}
}
Vector3 currentRotation = Quaternion.ToEulerAngles(transform.rotation);
currentRotation.y = -34;
transform.rotation = Quaternion.Euler(currentRotation);
@@ -215,7 +208,6 @@ public class PlayablePlayer : Player
//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);
@@ -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,7 +286,7 @@ public class PlayablePlayer : Player
if (!checkDoubleDice)
{
if(fieldReturnStatus != 2)
if (fieldReturnStatus != 2 && fieldReturnStatus != 3)
{
Invoke("Finish", 2);
}
@@ -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
@@ -505,6 +463,7 @@ public class PlayablePlayer : Player
temp.transform.position = currentField.transform.position + (Vector3.up / 2);
activeItem = Item.Type.None;
}
items[index] = null;
}
@@ -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: