working on enemies

This commit is contained in:
2025-08-20 05:06:00 +02:00
parent f6a4db7b4d
commit fb1c3f8290
619 changed files with 46709 additions and 668 deletions

View File

@@ -0,0 +1,50 @@
using RebootKit.Engine.Network;
using RebootKit.Engine.Simulation;
using RebootReality.jelycho.Enemies;
using UnityEngine;
namespace RebootReality.jelycho.Beacons {
public class MotherActorData : IActorData {
public ulong Health;
public float HungerLevel;
public int GetMaxBytes() {
return sizeof(ulong) +
sizeof(float);
}
public void Serialize(NetworkBufferWriter writer) {
writer.Write(Health);
writer.Write(HungerLevel);
}
public void Deserialize(NetworkBufferReader reader) {
reader.Read(out Health);
reader.Read(out HungerLevel);
}
}
public class MotherActor : Actor, IKillable {
MotherActorData m_ActorData = new MotherActorData();
[field: SerializeField] public Transform GutConnector { get; private set; }
//
// @MARK: Actor
//
protected override IActorData CreateActorData() {
return m_ActorData;
}
//
// @MARK: IKillable
//
public bool IsAlive() {
return m_ActorData.Health > 0;
}
public ulong OnHit(Actor attacker, ulong damage) {
return damage;
}
}
}