sync dice
dice synced for noplayableplayers
This commit is contained in:
+3
-7
@@ -3,15 +3,10 @@
|
|||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="f0abe486-ee58-49bd-ad63-04a8b3fc78ec" name="Changes" comment="">
|
<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$/.idea/.idea.FlufflParty/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.FlufflParty/.idea/workspace.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/Assets/Scenes/WesternMap.unity" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scenes/WesternMap.unity" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/Assets/Scripts/Client.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/Client.cs" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/Assets/Scripts/Client.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/Client.cs" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/Assets/Scripts/Players/NoPlayablePlayer.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/Players/NoPlayablePlayer.cs" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/Assets/Scripts/Players/NoPlayablePlayer.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/Players/NoPlayablePlayer.cs" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/Assets/Scripts/Players/PlayablePlayer.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/Players/PlayablePlayer.cs" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/Assets/Scripts/Players/PlayablePlayer.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/Players/PlayablePlayer.cs" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/Assets/Scripts/Players/Player.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/Players/Player.cs" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/Assets/Scripts/UIHandler.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/UIHandler.cs" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/Packages/packages-lock.json" beforeDir="false" afterPath="$PROJECT_DIR$/Packages/packages-lock.json" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/ProjectSettings/ProjectSettings.asset" beforeDir="false" afterPath="$PROJECT_DIR$/ProjectSettings/ProjectSettings.asset" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/ProjectSettings/ProjectVersion.txt" beforeDir="false" afterPath="$PROJECT_DIR$/ProjectSettings/ProjectVersion.txt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/UserSettings/EditorUserSettings.asset" beforeDir="false" afterPath="$PROJECT_DIR$/UserSettings/EditorUserSettings.asset" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/UserSettings/Layouts/default-2021.dwlt" beforeDir="false" afterPath="$PROJECT_DIR$/UserSettings/Layouts/default-2021.dwlt" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/UserSettings/Layouts/default-2021.dwlt" beforeDir="false" afterPath="$PROJECT_DIR$/UserSettings/Layouts/default-2021.dwlt" afterDir="false" />
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
@@ -147,7 +142,8 @@
|
|||||||
<workItem from="1677881158579" duration="8577000" />
|
<workItem from="1677881158579" duration="8577000" />
|
||||||
<workItem from="1678046412549" duration="3738000" />
|
<workItem from="1678046412549" duration="3738000" />
|
||||||
<workItem from="1679426348887" duration="3549000" />
|
<workItem from="1679426348887" duration="3549000" />
|
||||||
<workItem from="1679597961773" duration="4070000" />
|
<workItem from="1679597961773" duration="4891000" />
|
||||||
|
<workItem from="1680022152724" duration="2273000" />
|
||||||
</task>
|
</task>
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
|
|||||||
@@ -225,6 +225,9 @@ public class Client : MonoBehaviour
|
|||||||
players[job.data[1]].AddCoins(-items[job.data[3]].Cost);
|
players[job.data[1]].AddCoins(-items[job.data[3]].Cost);
|
||||||
players[job.data[1]].AddItem(items[job.data[3]]);
|
players[job.data[1]].AddItem(items[job.data[3]]);
|
||||||
break;
|
break;
|
||||||
|
case 10:
|
||||||
|
players[job.data[1]].ActivateItem(job.data[2]);
|
||||||
|
break;
|
||||||
case 126:
|
case 126:
|
||||||
stream.Write(new byte[]{126, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 0, 10);
|
stream.Write(new byte[]{126, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 0, 10);
|
||||||
break;
|
break;
|
||||||
@@ -310,4 +313,9 @@ public class Client : MonoBehaviour
|
|||||||
{
|
{
|
||||||
stream.Write(new byte[] { 9, (byte)item.type, 0, 0, 0, 0, 0, 0, 0, 0 });
|
stream.Write(new byte[] { 9, (byte)item.type, 0, 0, 0, 0, 0, 0, 0, 0 });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SendActiveItem(byte index)
|
||||||
|
{
|
||||||
|
stream.Write(new byte[]{10, index, 0, 0, 0, 0, 0, 0, 0, 0});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -22,8 +22,9 @@ public class NoPlayablePlayer : Player
|
|||||||
private float timeSinceWurfeln = 0;
|
private float timeSinceWurfeln = 0;
|
||||||
|
|
||||||
private Vector3 useLess = new Vector3();
|
private Vector3 useLess = new Vector3();
|
||||||
|
|
||||||
|
private bool checkDoubleDice = false;
|
||||||
|
|
||||||
|
|
||||||
public override void Init()
|
public override void Init()
|
||||||
{
|
{
|
||||||
@@ -59,11 +60,11 @@ public class NoPlayablePlayer : Player
|
|||||||
{
|
{
|
||||||
wurfelt = true;
|
wurfelt = true;
|
||||||
this.wurfelZahl = wurfelZahl;
|
this.wurfelZahl = wurfelZahl;
|
||||||
|
|
||||||
if (activeItem == Item.Type.Mushroom)
|
switch (activeItem)
|
||||||
{
|
{
|
||||||
wurfelZahl += 3;
|
case Item.Type.Mushroom: wurfelZahl += 3; activeItem = Item.Type.None; break;
|
||||||
activeItem = Item.Type.None;
|
case Item.Type.DoubleDice: checkDoubleDice = true; activeItem = Item.Type.None; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//nächstes Feld anvisieren
|
//nächstes Feld anvisieren
|
||||||
@@ -125,9 +126,18 @@ public class NoPlayablePlayer : Player
|
|||||||
if (!wurfelt)
|
if (!wurfelt)
|
||||||
{
|
{
|
||||||
StartDice();
|
StartDice();
|
||||||
}else if (activated)
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
StartDice();
|
if (!checkDoubleDice)
|
||||||
|
{
|
||||||
|
activated = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
checkDoubleDice = false;
|
||||||
|
wurfelt = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ public class PlayablePlayer : Player
|
|||||||
switch (activeItem)
|
switch (activeItem)
|
||||||
{
|
{
|
||||||
case Item.Type.Mushroom: wurfelZahl += 3; activeItem = Item.Type.None; break;
|
case Item.Type.Mushroom: wurfelZahl += 3; activeItem = Item.Type.None; break;
|
||||||
case Item.Type.DoubleDice: checkDoubleDice = true; break;
|
case Item.Type.DoubleDice: checkDoubleDice = true; activeItem = Item.Type.None; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -300,4 +300,11 @@ public class PlayablePlayer : Player
|
|||||||
transform.position + Vector3.up * 2, ref useLess, 0.2f);
|
transform.position + Vector3.up * 2, ref useLess, 0.2f);
|
||||||
diceScript.StartRandom();
|
diceScript.StartRandom();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
public void ActivateItem(int index)
|
||||||
|
{
|
||||||
|
activeItem = items[index].type;
|
||||||
|
items[index] = null;
|
||||||
|
client.SendActiveItem((byte)index);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -167,7 +167,8 @@ public class UIHandler : MonoBehaviour
|
|||||||
|
|
||||||
public void ButtonSelectItem(int index)
|
public void ButtonSelectItem(int index)
|
||||||
{
|
{
|
||||||
currentPlayer.ActivateItem(index);
|
((PlayablePlayer)currentPlayer).ActivateItem(index);
|
||||||
ActivateLayout1();
|
ActivateLayout1();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ MonoBehaviour:
|
|||||||
width: 1536
|
width: 1536
|
||||||
height: 772.8
|
height: 772.8
|
||||||
m_ShowMode: 4
|
m_ShowMode: 4
|
||||||
m_Title: Inspector
|
m_Title: Game
|
||||||
m_RootView: {fileID: 7}
|
m_RootView: {fileID: 7}
|
||||||
m_MinSize: {x: 875, y: 300}
|
m_MinSize: {x: 875, y: 300}
|
||||||
m_MaxSize: {x: 10000, y: 10000}
|
m_MaxSize: {x: 10000, y: 10000}
|
||||||
@@ -47,7 +47,7 @@ MonoBehaviour:
|
|||||||
m_MinSize: {x: 300, y: 200}
|
m_MinSize: {x: 300, y: 200}
|
||||||
m_MaxSize: {x: 24288, y: 16192}
|
m_MaxSize: {x: 24288, y: 16192}
|
||||||
vertical: 1
|
vertical: 1
|
||||||
controlID: 114
|
controlID: 109
|
||||||
--- !u!114 &3
|
--- !u!114 &3
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 52
|
m_ObjectHideFlags: 52
|
||||||
@@ -72,7 +72,7 @@ MonoBehaviour:
|
|||||||
m_MinSize: {x: 300, y: 200}
|
m_MinSize: {x: 300, y: 200}
|
||||||
m_MaxSize: {x: 24288, y: 16192}
|
m_MaxSize: {x: 24288, y: 16192}
|
||||||
vertical: 0
|
vertical: 0
|
||||||
controlID: 115
|
controlID: 110
|
||||||
--- !u!114 &4
|
--- !u!114 &4
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 52
|
m_ObjectHideFlags: 52
|
||||||
@@ -119,8 +119,8 @@ MonoBehaviour:
|
|||||||
y: 0
|
y: 0
|
||||||
width: 225.6
|
width: 225.6
|
||||||
height: 471.2
|
height: 471.2
|
||||||
m_MinSize: {x: 200, y: 200}
|
m_MinSize: {x: 201, y: 221}
|
||||||
m_MaxSize: {x: 4000, y: 4000}
|
m_MaxSize: {x: 4001, y: 4021}
|
||||||
m_ActualView: {fileID: 19}
|
m_ActualView: {fileID: 19}
|
||||||
m_Panes:
|
m_Panes:
|
||||||
- {fileID: 19}
|
- {fileID: 19}
|
||||||
@@ -248,7 +248,7 @@ MonoBehaviour:
|
|||||||
m_MinSize: {x: 200, y: 200}
|
m_MinSize: {x: 200, y: 200}
|
||||||
m_MaxSize: {x: 16192, y: 16192}
|
m_MaxSize: {x: 16192, y: 16192}
|
||||||
vertical: 1
|
vertical: 1
|
||||||
controlID: 53
|
controlID: 52
|
||||||
--- !u!114 &11
|
--- !u!114 &11
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 52
|
m_ObjectHideFlags: 52
|
||||||
@@ -273,7 +273,7 @@ MonoBehaviour:
|
|||||||
m_MinSize: {x: 200, y: 100}
|
m_MinSize: {x: 200, y: 100}
|
||||||
m_MaxSize: {x: 16192, y: 8096}
|
m_MaxSize: {x: 16192, y: 8096}
|
||||||
vertical: 0
|
vertical: 0
|
||||||
controlID: 54
|
controlID: 53
|
||||||
--- !u!114 &12
|
--- !u!114 &12
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 52
|
m_ObjectHideFlags: 52
|
||||||
@@ -725,7 +725,7 @@ MonoBehaviour:
|
|||||||
m_FarClip: 10000
|
m_FarClip: 10000
|
||||||
m_DynamicClip: 1
|
m_DynamicClip: 1
|
||||||
m_OcclusionCulling: 0
|
m_OcclusionCulling: 0
|
||||||
m_LastSceneViewRotation: {x: -0.017479911, y: 0.9293452, z: -0.3661485, w: -0.044362627}
|
m_LastSceneViewRotation: {x: -0.08717229, y: 0.89959055, z: -0.21045254, w: -0.3726226}
|
||||||
m_LastSceneViewOrtho: 0
|
m_LastSceneViewOrtho: 0
|
||||||
m_ReplacementShader: {fileID: 0}
|
m_ReplacementShader: {fileID: 0}
|
||||||
m_ReplacementString:
|
m_ReplacementString:
|
||||||
@@ -928,10 +928,10 @@ MonoBehaviour:
|
|||||||
m_LockTracker:
|
m_LockTracker:
|
||||||
m_IsLocked: 0
|
m_IsLocked: 0
|
||||||
m_FolderTreeState:
|
m_FolderTreeState:
|
||||||
scrollPos: {x: 0, y: 0}
|
scrollPos: {x: 0, y: 188.39972}
|
||||||
m_SelectedIDs: 7a670000
|
m_SelectedIDs: 7a620000
|
||||||
m_LastClickedID: 26490
|
m_LastClickedID: 25210
|
||||||
m_ExpandedIDs: 0000000076670000786700007a67000000ca9a3b
|
m_ExpandedIDs: 0000000076620000786200007a62000000ca9a3bffffff7f
|
||||||
m_RenameOverlay:
|
m_RenameOverlay:
|
||||||
m_UserAcceptedRename: 0
|
m_UserAcceptedRename: 0
|
||||||
m_Name:
|
m_Name:
|
||||||
@@ -959,7 +959,7 @@ MonoBehaviour:
|
|||||||
scrollPos: {x: 0, y: 0}
|
scrollPos: {x: 0, y: 0}
|
||||||
m_SelectedIDs:
|
m_SelectedIDs:
|
||||||
m_LastClickedID: 0
|
m_LastClickedID: 0
|
||||||
m_ExpandedIDs: 0000000076670000786700007a670000
|
m_ExpandedIDs: 0000000076620000786200007a620000
|
||||||
m_RenameOverlay:
|
m_RenameOverlay:
|
||||||
m_UserAcceptedRename: 0
|
m_UserAcceptedRename: 0
|
||||||
m_Name:
|
m_Name:
|
||||||
@@ -1087,23 +1087,23 @@ MonoBehaviour:
|
|||||||
m_SceneHierarchy:
|
m_SceneHierarchy:
|
||||||
m_TreeViewState:
|
m_TreeViewState:
|
||||||
scrollPos: {x: 0, y: 0}
|
scrollPos: {x: 0, y: 0}
|
||||||
m_SelectedIDs:
|
m_SelectedIDs: ba620000
|
||||||
m_LastClickedID: 0
|
m_LastClickedID: 0
|
||||||
m_ExpandedIDs: 36bbffffeacfffff4cd8ffff02dbffff94e4ffff6af1fffffef9ffff6c8600008c86000090860000fc8600004087000044870000808800008e8900007a8a0000168b000020a200004ca200006ca2000070a2000090a20000dca2000020a3000024a3000070a300008aa300000ca400001aa400002aa4000040a400003ea5000094a500001aa60000aea60000
|
m_ExpandedIDs: 06fbffff
|
||||||
m_RenameOverlay:
|
m_RenameOverlay:
|
||||||
m_UserAcceptedRename: 0
|
m_UserAcceptedRename: 0
|
||||||
m_Name: Canvas
|
m_Name:
|
||||||
m_OriginalName: Canvas
|
m_OriginalName:
|
||||||
m_EditFieldRect:
|
m_EditFieldRect:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
x: 0
|
x: 0
|
||||||
y: 0
|
y: 0
|
||||||
width: 0
|
width: 0
|
||||||
height: 0
|
height: 0
|
||||||
m_UserData: 41584
|
m_UserData: 0
|
||||||
m_IsWaitingForDelay: 0
|
m_IsWaitingForDelay: 0
|
||||||
m_IsRenaming: 0
|
m_IsRenaming: 0
|
||||||
m_OriginalEventType: 0
|
m_OriginalEventType: 11
|
||||||
m_IsRenamingFilename: 0
|
m_IsRenamingFilename: 0
|
||||||
m_ClientGUIView: {fileID: 5}
|
m_ClientGUIView: {fileID: 5}
|
||||||
m_SearchString:
|
m_SearchString:
|
||||||
|
|||||||
Reference in New Issue
Block a user