Linked Rotator with Pink Field

This commit is contained in:
brausjonas
2023-04-14 17:16:41 +02:00
parent 9e709c03bd
commit 0742ff15b4
16 changed files with 281 additions and 103 deletions
+4 -2
View File
@@ -43,6 +43,8 @@
"RunOnceActivity.OpenProjectViewOnStart": "true", "RunOnceActivity.OpenProjectViewOnStart": "true",
"RunOnceActivity.ShowReadmeOnStart": "true", "RunOnceActivity.ShowReadmeOnStart": "true",
"WebServerToolWindowFactoryState": "false", "WebServerToolWindowFactoryState": "false",
"node.js.detected.package.eslint": "true",
"node.js.selected.package.eslint": "(autodetect)",
"node.js.selected.package.tslint": "(autodetect)", "node.js.selected.package.tslint": "(autodetect)",
"vue.rearranger.settings.migration": "true" "vue.rearranger.settings.migration": "true"
}, },
@@ -56,7 +58,7 @@
}]]></component> }]]></component>
<component name="RunManager" selected="Attach to Unity Editor.Attach to Unity Editor"> <component name="RunManager" selected="Attach to Unity Editor.Attach to Unity Editor">
<configuration name="Standalone Player" type="RunUnityExe" factoryName="Unity Executable"> <configuration name="Standalone Player" type="RunUnityExe" factoryName="Unity Executable">
<option name="EXE_PATH" value="$USER_HOME$/Desktop/Build\FlufflParty.exe" /> <option name="EXE_PATH" value="$USER_HOME$/Desktop/Build/FlufflParty.exe" />
<option name="PROGRAM_PARAMETERS" value="" /> <option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="C:\Users\braus\OneDrive\Desktop\FlufflPartyTestBuild" /> <option name="WORKING_DIRECTORY" value="C:\Users\braus\OneDrive\Desktop\FlufflPartyTestBuild" />
<option name="PASS_PARENT_ENVS" value="1" /> <option name="PASS_PARENT_ENVS" value="1" />
@@ -163,7 +165,7 @@
<workItem from="1680813239896" duration="4155000" /> <workItem from="1680813239896" duration="4155000" />
<workItem from="1681056387914" duration="882000" /> <workItem from="1681056387914" duration="882000" />
<workItem from="1681415672515" duration="5000" /> <workItem from="1681415672515" duration="5000" />
<workItem from="1681479671396" duration="265000" /> <workItem from="1681479671396" duration="5656000" />
</task> </task>
<servers /> <servers />
</component> </component>
@@ -13,7 +13,7 @@ GameObject:
- component: {fileID: 7556365767940820385} - component: {fileID: 7556365767940820385}
- component: {fileID: 8043942569442897806} - component: {fileID: 8043942569442897806}
m_Layer: 0 m_Layer: 0
m_Name: ItemMushroom m_Name: Mushroom
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
+76 -37
View File
@@ -5071,13 +5071,13 @@ Transform:
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 12397521} m_GameObject: {fileID: 12397521}
m_LocalRotation: {x: -0.7071068, y: 0, z: 0, w: 0.7071068} m_LocalRotation: {x: -0.7071068, y: -0, z: -0, w: 0.7071068}
m_LocalPosition: {x: 104.92, y: 3.74, z: 108.24} m_LocalPosition: {x: 16.086388, y: -4.5710506, z: -9.919952}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 532108336}
m_RootOrder: 22 m_RootOrder: 3
m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0} m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0}
--- !u!1 &24235161 --- !u!1 &24235161
GameObject: GameObject:
@@ -5162,7 +5162,7 @@ Transform:
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 17 m_RootOrder: 18
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &34779300 --- !u!1 &34779300
GameObject: GameObject:
@@ -5441,7 +5441,7 @@ Transform:
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 18 m_RootOrder: 19
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &47812148 --- !u!114 &47812148
MonoBehaviour: MonoBehaviour:
@@ -5533,6 +5533,7 @@ MonoBehaviour:
layoutItemShop: {fileID: 1235522788} layoutItemShop: {fileID: 1235522788}
layoutSelectItem: {fileID: 1370614407} layoutSelectItem: {fileID: 1370614407}
layoutOptions: {fileID: 1903920335} layoutOptions: {fileID: 1903920335}
rotator: {fileID: 132120855}
--- !u!1 &52894754 --- !u!1 &52894754
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -6678,6 +6679,7 @@ MonoBehaviour:
- {fileID: 479644163} - {fileID: 479644163}
- {fileID: 1187141365} - {fileID: 1187141365}
- {fileID: 516946749} - {fileID: 516946749}
uiHandler: {fileID: 47812149}
--- !u!1 &163128932 --- !u!1 &163128932
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -11626,13 +11628,13 @@ Transform:
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 167147445} m_GameObject: {fileID: 167147445}
m_LocalRotation: {x: -0.7071068, y: 0, z: 0, w: 0.7071068} m_LocalRotation: {x: -0.7071068, y: -0, z: -0, w: 0.7071068}
m_LocalPosition: {x: 104.92, y: 3.74, z: 127.64} m_LocalPosition: {x: 16.086388, y: -4.5710506, z: 9.480049}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 532108336}
m_RootOrder: 23 m_RootOrder: 4
m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0} m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0}
--- !u!1 &174015781 --- !u!1 &174015781
GameObject: GameObject:
@@ -11784,7 +11786,7 @@ Transform:
- {fileID: 1736008288} - {fileID: 1736008288}
- {fileID: 1406090858} - {fileID: 1406090858}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 8 m_RootOrder: 9
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &179390189 --- !u!1 &179390189
GameObject: GameObject:
@@ -11892,7 +11894,7 @@ Transform:
m_Children: m_Children:
- {fileID: 1202275724} - {fileID: 1202275724}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 15 m_RootOrder: 16
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!43 &191235143 --- !u!43 &191235143
Mesh: Mesh:
@@ -12897,7 +12899,7 @@ Transform:
- {fileID: 52894757} - {fileID: 52894757}
- {fileID: 314972567} - {fileID: 314972567}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 12 m_RootOrder: 13
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &250767830 --- !u!1 &250767830
GameObject: GameObject:
@@ -13962,7 +13964,7 @@ RectTransform:
- {fileID: 1903920336} - {fileID: 1903920336}
- {fileID: 132120856} - {fileID: 132120856}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 13 m_RootOrder: 14
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0}
@@ -19474,13 +19476,13 @@ Transform:
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 434658651} m_GameObject: {fileID: 434658651}
m_LocalRotation: {x: -0.7071068, y: 0, z: 0, w: 0.7071068} m_LocalRotation: {x: -0.7071068, y: -0, z: -0, w: 0.7071068}
m_LocalPosition: {x: 104.92, y: 3.74, z: 89.42} m_LocalPosition: {x: 16.086388, y: -4.5710506, z: -28.739952}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 532108336}
m_RootOrder: 24 m_RootOrder: 5
m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0} m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0}
--- !u!1001 &437347124 --- !u!1001 &437347124
PrefabInstance: PrefabInstance:
@@ -21005,6 +21007,43 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 531419859} m_GameObject: {fileID: 531419859}
m_CullTransparentMesh: 1 m_CullTransparentMesh: 1
--- !u!1 &532108335
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 532108336}
m_Layer: 0
m_Name: Particles
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &532108336
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 532108335}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 88.83361, y: 8.31105, z: 118.15995}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1964684155}
- {fileID: 1229194791}
- {fileID: 1691493601}
- {fileID: 12397524}
- {fileID: 167147448}
- {fileID: 434658654}
m_Father: {fileID: 0}
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &582840967 --- !u!1001 &582840967
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -22309,7 +22348,7 @@ Transform:
- {fileID: 1017709783} - {fileID: 1017709783}
- {fileID: 2106570837} - {fileID: 2106570837}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 14 m_RootOrder: 15
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &675727855 --- !u!114 &675727855
MonoBehaviour: MonoBehaviour:
@@ -23303,7 +23342,7 @@ Transform:
- {fileID: 431546227} - {fileID: 431546227}
- {fileID: 1740517987} - {fileID: 1740517987}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 16 m_RootOrder: 17
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &782948711 --- !u!1 &782948711
GameObject: GameObject:
@@ -26537,7 +26576,7 @@ Transform:
- {fileID: 657595552} - {fileID: 657595552}
- {fileID: 253183257} - {fileID: 253183257}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 7 m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1108023622 --- !u!1 &1108023622
GameObject: GameObject:
@@ -32757,13 +32796,13 @@ Transform:
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1229194788} m_GameObject: {fileID: 1229194788}
m_LocalRotation: {x: -0.7071068, y: 0, z: 0, w: 0.7071068} m_LocalRotation: {x: -0.7071068, y: -0, z: -0, w: 0.7071068}
m_LocalPosition: {x: 87.63, y: 3.74, z: 127.64} m_LocalPosition: {x: -1.2036133, y: -4.5710506, z: 9.480049}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 532108336}
m_RootOrder: 20 m_RootOrder: 1
m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0} m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0}
--- !u!1 &1235522788 --- !u!1 &1235522788
GameObject: GameObject:
@@ -33871,7 +33910,7 @@ Transform:
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 10 m_RootOrder: 11
m_LocalEulerAnglesHint: {x: 50.61, y: 151.873, z: 2.915} m_LocalEulerAnglesHint: {x: 50.61, y: 151.873, z: 2.915}
--- !u!114 &1328561028 --- !u!114 &1328561028
MonoBehaviour: MonoBehaviour:
@@ -35523,7 +35562,7 @@ Transform:
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 6 m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1547369677 --- !u!1 &1547369677
GameObject: GameObject:
@@ -35701,7 +35740,7 @@ Transform:
- {fileID: 203184820} - {fileID: 203184820}
- {fileID: 1357405425} - {fileID: 1357405425}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 9 m_RootOrder: 10
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1585901470 --- !u!1001 &1585901470
PrefabInstance: PrefabInstance:
@@ -42729,13 +42768,13 @@ Transform:
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1691493598} m_GameObject: {fileID: 1691493598}
m_LocalRotation: {x: -0.7071068, y: 0, z: 0, w: 0.7071068} m_LocalRotation: {x: -0.7071068, y: -0, z: -0, w: 0.7071068}
m_LocalPosition: {x: 87.63, y: 3.74, z: 89.42} m_LocalPosition: {x: -1.2036133, y: -4.5710506, z: -28.739952}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 532108336}
m_RootOrder: 21 m_RootOrder: 2
m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0} m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0}
--- !u!1001 &1704529805 --- !u!1001 &1704529805
PrefabInstance: PrefabInstance:
@@ -43871,7 +43910,7 @@ Transform:
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 11 m_RootOrder: 12
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1805722634 --- !u!1 &1805722634
GameObject: GameObject:
@@ -50236,13 +50275,13 @@ Transform:
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1964684152} m_GameObject: {fileID: 1964684152}
m_LocalRotation: {x: -0.7071068, y: 0, z: 0, w: 0.7071068} m_LocalRotation: {x: -0.7071068, y: -0, z: -0, w: 0.7071068}
m_LocalPosition: {x: 87.63, y: 3.74, z: 108.24} m_LocalPosition: {x: -1.2036133, y: -4.5710506, z: -9.919952}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 532108336}
m_RootOrder: 19 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0} m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0}
--- !u!1 &1965297689 --- !u!1 &1965297689
GameObject: GameObject:
+20
View File
@@ -282,6 +282,14 @@ public class Client : MonoBehaviour
case 12: case 12:
((NoPlayablePlayer)players[job.data[1]]).pinkFieldLostItem(job.data[2]); ((NoPlayablePlayer)players[job.data[1]]).pinkFieldLostItem(job.data[2]);
break; break;
case 13:
int amount = job.data[2];
if (job.data[1] == 0)
{
amount *= -1;
}
players[job.data[3]].AddCoins(amount);
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;
@@ -387,4 +395,16 @@ public class Client : MonoBehaviour
{ {
stream.Write(new byte[]{12, index, 0, 0, 0, 0, 0, 0, 0, 0}); stream.Write(new byte[]{12, index, 0, 0, 0, 0, 0, 0, 0, 0});
} }
public void SendCoins(int amount)
{
byte isPositive = 1;
if (amount < 0)
{
isPositive = 0;
}
stream.Write(new byte[]{13, isPositive, (byte)amount, 0, 0, 0, 0, 0, 0, 0});
}
} }
@@ -190,6 +190,7 @@ public class NoPlayablePlayer : Player
currentRotation.y = -34; currentRotation.y = -34;
transform.rotation = Quaternion.Euler(currentRotation); transform.rotation = Quaternion.Euler(currentRotation);
if (!wurfelt) if (!wurfelt)
{ {
StartDice(); StartDice();
@@ -19,6 +19,8 @@ public class PlayablePlayer : Player
private float interPol = 0; private float interPol = 0;
private int wurfelZahl = 0; private int wurfelZahl = 0;
private bool checkDoubleDice = false; private bool checkDoubleDice = false;
private RandomRotator rotator;
private int rotatorStopIndex = 0;
private bool wait = false; private bool wait = false;
@@ -49,10 +51,6 @@ public class PlayablePlayer : Player
diceScript = dice.GetComponent<Dice>(); diceScript = dice.GetComponent<Dice>();
instance = this; instance = this;
AddItem(client.items[1]);
AddItem(client.items[0]);
AddItem(client.items[2]);
} }
public static PlayablePlayer GetCurrentInstance() public static PlayablePlayer GetCurrentInstance()
@@ -112,7 +110,7 @@ public class PlayablePlayer : Player
jumpRequest = true; jumpRequest = true;
wurfelt = true; wurfelt = true;
wurfelZahl = Random.Range(1, 7); wurfelZahl = Random.Range(4, 5);
switch (activeItem) switch (activeItem)
{ {
@@ -198,10 +196,15 @@ public class PlayablePlayer : Player
currentRotation.y = -34; currentRotation.y = -34;
transform.rotation = Quaternion.Euler(currentRotation); 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 //TODO: temp spieler finsihed erst, wenn field action ausgeführt wurde
if (wurfelt) if (wurfelt)
{ {
int fieldReturnStatus = currentField.Action(index);
switch (fieldReturnStatus) switch (fieldReturnStatus)
{ {
@@ -213,49 +216,96 @@ public class PlayablePlayer : Player
client.SendCoinFieldAction(1); client.SendCoinFieldAction(1);
AddCoins(-3); AddCoins(-3);
break; break;
case 2: //pinkes Feld // case 2: //pinkes Feld
int randyPinkField = Random.Range(4, 4); // int randyPinkField = Random.Range(4, 4);
int tempCurrentItems = -1; // int tempCurrentItems = -1;
switch (randyPinkField) // 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, 12);
int randCoins2 = Random.Range(5, 10);
int randCoins3 = Random.Range(-6, 0);
RandomRotator rotator = uiHandler.rotator.GetComponent<RandomRotator>();
this.rotator = rotator;
uiHandler.ActivateRotator();
rotator.SetOptionsText(0, randCoins1 + " Coins");
rotator.SetOptionsText(1, randCoins2 + " Coins");
rotator.SetOptionsText(2, randCoins3 + " Coins");
rotator.SetOptionsText(3, "Random Item");
rotator.StartRandom();
int randomOption = Random.Range(0, 4);
switch (randomOption)
{ {
case 0:
AddCoins(randCoins1);
client.SendCoins(randCoins1);
break;
case 1: case 1:
client.SendCoinFieldAction(0); AddCoins(randCoins2);
int tempAddCoins = Random.Range(3, 6); client.SendCoins(randCoins2);
AddCoins(tempAddCoins);
break; break;
case 2: case 2:
client.SendCoinFieldAction(1); AddCoins(randCoins3);
int tempLoseCoins = Random.Range(-3, -6); client.SendCoins(randCoins3);
AddCoins(tempLoseCoins);
break; break;
case 3: case 3:
int tempAddItem = Random.Range(0, 2); int randomItem = Random.Range(0, 3);
AddItem(client.items[tempAddItem]); AddItem(client.items[randomItem]);
break; break;
case 4:
for (int i = 0; i < items.Length; i++)
{
if (items[i] != null)
{
tempCurrentItems++;
}
} }
if (tempCurrentItems >= 0) rotatorStopIndex = randomOption;
{ Invoke("StopRotator", 4);
int pickRandomItem = Random.Range(0, tempCurrentItems); Invoke("ActivateLayout1", 7.5f);
client.items[pickRandomItem] = null;
itemInfoImages[pickRandomItem].color = new Color(0, 0, 0, 0);
client.SendLostItem((byte)pickRandomItem);
}
break;
}
break; break;
} }
if (!checkDoubleDice) if (!checkDoubleDice)
{
if(fieldReturnStatus != 2)
{ {
Invoke("Finish", 2); Invoke("Finish", 2);
}
activated = false; activated = false;
} }
else else
@@ -430,4 +480,15 @@ public class PlayablePlayer : Player
} }
items[index] = null; items[index] = null;
} }
private void ActivateLayout1()
{
uiHandler.ActivateLayout1();
Finish();
}
private void StopRotator()
{
rotator.Stop(rotatorStopIndex);
}
} }
+21 -7
View File
@@ -13,17 +13,13 @@ public class RandomRotator : MonoBehaviour
private int currentIndex = 0; private int currentIndex = 0;
private float lastTimeSwitched = 0; private float lastTimeSwitched = 0;
private int stopIndex = 0; private int stopIndex = 0;
public UIHandler uiHandler;
public void SetOptionsText(int index, string text) public void SetOptionsText(int index, string text)
{ {
textOptions[index].text = text; textOptions[index].text = text;
} }
private void Start()
{
StartRandom();
}
private void ColorOption(int index) private void ColorOption(int index)
{ {
for (int i = 0; i < options.Length; i++) for (int i = 0; i < options.Length; i++)
@@ -39,16 +35,33 @@ public class RandomRotator : MonoBehaviour
} }
} }
private float slowDown = 0.5f;
private void Update() private void Update()
{ {
if (started) if (started)
{ {
if (Time.time - lastTimeSwitched > 0.1f) if (Time.time - lastTimeSwitched > 0.2f)
{ {
lastTimeSwitched = Time.time; lastTimeSwitched = Time.time;
ColorOption(currentIndex); ColorOption(currentIndex);
currentIndex++; currentIndex++;
if (currentIndex > options.Length - 1) if (currentIndex > options.Length)
{
currentIndex = 0;
}
}
}
else
{
if (currentIndex != stopIndex)
{
if (Time.time - lastTimeSwitched > slowDown)
{
slowDown += 0.2f;
lastTimeSwitched = Time.time;
ColorOption(currentIndex);
currentIndex++;
if (currentIndex > options.Length)
{ {
currentIndex = 0; currentIndex = 0;
} }
@@ -59,6 +72,7 @@ public class RandomRotator : MonoBehaviour
ColorOption(stopIndex); ColorOption(stopIndex);
} }
} }
}
public void StartRandom() public void StartRandom()
{ {
+22
View File
@@ -13,6 +13,7 @@ public class UIHandler : MonoBehaviour
[SerializeField] private GameObject layoutItemShop; [SerializeField] private GameObject layoutItemShop;
[SerializeField] private GameObject layoutSelectItem; [SerializeField] private GameObject layoutSelectItem;
[SerializeField] private GameObject layoutOptions; [SerializeField] private GameObject layoutOptions;
[SerializeField] public GameObject rotator;
private static UIHandler currentInstance; private static UIHandler currentInstance;
@@ -45,6 +46,7 @@ public class UIHandler : MonoBehaviour
layoutItemShop.SetActive(false); layoutItemShop.SetActive(false);
layoutSelectItem.SetActive(false); layoutSelectItem.SetActive(false);
layoutOptions.SetActive(false); layoutOptions.SetActive(false);
rotator.SetActive(false);
currentInstance = this; currentInstance = this;
} }
@@ -59,6 +61,7 @@ public class UIHandler : MonoBehaviour
layoutItemShop.SetActive(false); layoutItemShop.SetActive(false);
layoutSelectItem.SetActive(false); layoutSelectItem.SetActive(false);
layoutOptions.SetActive(false); layoutOptions.SetActive(false);
rotator.SetActive(false);
} }
public void ActivateLayoutMiniMap() public void ActivateLayoutMiniMap()
@@ -83,6 +86,7 @@ public class UIHandler : MonoBehaviour
layoutItemShop.SetActive(false); layoutItemShop.SetActive(false);
layoutSelectItem.SetActive(false); layoutSelectItem.SetActive(false);
layoutOptions.SetActive(false); layoutOptions.SetActive(false);
rotator.SetActive(false);
LayoutBuyStarController controller = layoutBuyStar.GetComponent<LayoutBuyStarController>(); LayoutBuyStarController controller = layoutBuyStar.GetComponent<LayoutBuyStarController>();
@@ -110,6 +114,7 @@ public class UIHandler : MonoBehaviour
layoutItemShop.SetActive(false); layoutItemShop.SetActive(false);
layoutSelectItem.SetActive(false); layoutSelectItem.SetActive(false);
layoutOptions.SetActive(false); layoutOptions.SetActive(false);
rotator.SetActive(false);
} }
public void ActivateLayoutItemShop() public void ActivateLayoutItemShop()
@@ -123,6 +128,7 @@ public class UIHandler : MonoBehaviour
layoutItemShop.GetComponent<ItemShop>().Init(currentPlayer); layoutItemShop.GetComponent<ItemShop>().Init(currentPlayer);
layoutSelectItem.SetActive(false); layoutSelectItem.SetActive(false);
layoutOptions.SetActive(false); layoutOptions.SetActive(false);
rotator.SetActive(false);
} }
@@ -140,6 +146,7 @@ public class UIHandler : MonoBehaviour
layout2.SetActive(false); layout2.SetActive(false);
layoutItemShop.SetActive(false); layoutItemShop.SetActive(false);
layoutOptions.SetActive(false); layoutOptions.SetActive(false);
rotator.SetActive(false);
layoutSelectItem.GetComponent<ItemSelector>().Init(currentPlayer.items); layoutSelectItem.GetComponent<ItemSelector>().Init(currentPlayer.items);
@@ -157,6 +164,21 @@ public class UIHandler : MonoBehaviour
layoutItemShop.SetActive(false); layoutItemShop.SetActive(false);
layoutSelectItem.SetActive(false); layoutSelectItem.SetActive(false);
layoutOptions.SetActive(true); layoutOptions.SetActive(true);
rotator.SetActive(false);
}
public void ActivateRotator()
{
rotator.GetComponent<RandomRotator>().uiHandler = this;
layout0.SetActive(false);
layout1.SetActive(false);
layoutMiniMap.SetActive(false);
layoutBuyStar.SetActive(false);
layout2.SetActive(false);
layoutItemShop.SetActive(false);
layoutSelectItem.SetActive(false);
layoutOptions.SetActive(false);
rotator.SetActive(true);
} }
public void ButtonBuyStar() public void ButtonBuyStar()
@@ -137,7 +137,9 @@ PlayerSettings:
16:9: 1 16:9: 1
Others: 1 Others: 1
bundleVersion: 0.14 bundleVersion: 0.14
preloadedAssets: [] preloadedAssets:
- {fileID: -6230802382160794249, guid: 90cd1b71078984c4980fcd1aa03eaaa3, type: 2}
- {fileID: 11400000, guid: 48bf7376b3770c44cbfe3f40e77359ab, type: 2}
metroInputSource: 0 metroInputSource: 0
wsaTransparentSwapchain: 0 wsaTransparentSwapchain: 0
m_HolographicPauseOnTrackingLoss: 1 m_HolographicPauseOnTrackingLoss: 1
+8
View File
@@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
+17 -18
View File
@@ -9,9 +9,7 @@
<option name="autoReloadType" value="SELECTIVE" /> <option name="autoReloadType" value="SELECTIVE" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="6d89163f-4054-4765-8ee3-ac6da16b6997" name="Changes" comment=""> <list default="true" id="6d89163f-4054-4765-8ee3-ac6da16b6997" name="Changes" comment="" />
<change beforePath="$PROJECT_DIR$/out/artifacts/Server_jar/Server.jar" beforeDir="false" afterPath="$PROJECT_DIR$/out/artifacts/Server_jar/Server.jar" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
@@ -35,22 +33,22 @@
<option name="hideEmptyMiddlePackages" value="true" /> <option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" /> <option name="showLibraryContents" value="true" />
</component> </component>
<component name="PropertiesComponent">{ <component name="PropertiesComponent"><![CDATA[{
&quot;keyToString&quot;: { "keyToString": {
&quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;, "RunOnceActivity.OpenProjectViewOnStart": "true",
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;, "RunOnceActivity.ShowReadmeOnStart": "true",
&quot;WebServerToolWindowFactoryState&quot;: &quot;false&quot;, "WebServerToolWindowFactoryState": "false",
&quot;last_opened_file_path&quot;: &quot;/media/jonas/Data/Unity/flufflparty/Server&quot;, "last_opened_file_path": "D:/Unity/flufflparty/Server",
&quot;node.js.detected.package.eslint&quot;: &quot;true&quot;, "node.js.detected.package.eslint": "true",
&quot;node.js.detected.package.tslint&quot;: &quot;true&quot;, "node.js.detected.package.tslint": "true",
&quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;, "node.js.selected.package.eslint": "(autodetect)",
&quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;, "node.js.selected.package.tslint": "(autodetect)",
&quot;project.structure.last.edited&quot;: &quot;Artifacts&quot;, "project.structure.last.edited": "Artifacts",
&quot;project.structure.proportion&quot;: &quot;0.0&quot;, "project.structure.proportion": "0.0",
&quot;project.structure.side.proportion&quot;: &quot;0.2&quot;, "project.structure.side.proportion": "0.2",
&quot;vue.rearranger.settings.migration&quot;: &quot;true&quot; "vue.rearranger.settings.migration": "true"
} }
}</component> }]]></component>
<component name="RunManager"> <component name="RunManager">
<configuration name="Main" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true"> <configuration name="Main" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="Main" /> <option name="MAIN_CLASS_NAME" value="Main" />
@@ -103,6 +101,7 @@
<workItem from="1681130452664" duration="6192000" /> <workItem from="1681130452664" duration="6192000" />
<workItem from="1681217780586" duration="94000" /> <workItem from="1681217780586" duration="94000" />
<workItem from="1681218296017" duration="162000" /> <workItem from="1681218296017" duration="162000" />
<workItem from="1681481242206" duration="1671000" />
</task> </task>
<servers /> <servers />
</component> </component>
Binary file not shown.
Binary file not shown.
Binary file not shown.
+10
View File
@@ -257,6 +257,16 @@ public class Room
} }
} }
break; break;
case 13:
for (int i = 0; i < players.length; i++)
{
//Sync to OTHER players
if (i != player)
{
players[i].output.write(new byte[]{13, readData[1], readData[2], (byte)player, 0, 0, 0, 0, 0, 0});
}
}
break;
case 126: case 126:
server.deleteRoom(roomCode); server.deleteRoom(roomCode);
break; break;