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
+20
View File
@@ -282,6 +282,14 @@ public class Client : MonoBehaviour
case 12:
((NoPlayablePlayer)players[job.data[1]]).pinkFieldLostItem(job.data[2]);
break;
case 13:
int amount = job.data[2];
if (job.data[1] == 0)
{
amount *= -1;
}
players[job.data[3]].AddCoins(amount);
break;
case 126:
stream.Write(new byte[]{126, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 0, 10);
break;
@@ -387,4 +395,16 @@ public class Client : MonoBehaviour
{
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});
}
}