První 3 monstra z plánovaných pěti. Kompletní pathfinding i zrcadlení do clienta. Útoky implementované nejsou. Lurk a Neko jsou hardcoded aby útočili na P1.
This commit is contained in:
parent
4484b127c5
commit
9bfe63a166
27 changed files with 772 additions and 47 deletions
|
|
@ -3,19 +3,22 @@ using LiteNetLib.Utils;
|
|||
|
||||
namespace PacketLib;
|
||||
|
||||
public struct PlayerState : INetSerializable {
|
||||
public struct PlayerState : INetSerializable { // TODO: separate mutable and immutable data
|
||||
public int pid;
|
||||
public int camera;
|
||||
public bool monitorUp;
|
||||
|
||||
public int officeTileId;
|
||||
public bool[] doorStates;
|
||||
|
||||
public int[] neighbouringTiles; // the indexes should correspond in both arrays
|
||||
|
||||
public void Serialize(NetDataWriter writer) {
|
||||
writer.Put(pid);
|
||||
writer.Put(camera);
|
||||
writer.Put(monitorUp);
|
||||
writer.PutArray(doorStates);
|
||||
writer.Put(officeTileId);
|
||||
writer.PutArray(neighbouringTiles);
|
||||
}
|
||||
|
||||
public void Deserialize(NetDataReader reader) {
|
||||
|
|
@ -23,6 +26,8 @@ public struct PlayerState : INetSerializable {
|
|||
camera = reader.GetInt();
|
||||
monitorUp = reader.GetBool();
|
||||
doorStates = reader.GetBoolArray();
|
||||
officeTileId = reader.GetInt();
|
||||
neighbouringTiles = reader.GetIntArray();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue