Ejemplo n.º 1
0
        public override void NetReceive(BinaryReader reader)
        {
            Lives = reader.ReadInt32();

            var newBossState = reader.ReadBoolean();

            if (newBossState != IsBossActive)
            {
                BossActiveStateChanged?.Invoke(this, newBossState);
            }

            IsBossActive = newBossState;
        }
Ejemplo n.º 2
0
        public override void PostUpdate()
        {
            var anyBosses = IsAnyBossActive();

            if (anyBosses && !IsBossActive)
            {
                IsBossActive = true;
                Lives        = ModContent.GetInstance <BflServerConfig>().SharedLives;
                NetMessage.SendData(MessageID.WorldData);
                BossActiveStateChanged?.Invoke(this, IsBossActive);
            }
            else if (!anyBosses && IsBossActive)
            {
                IsBossActive = false;
                NetMessage.SendData(MessageID.WorldData);
                BossActiveStateChanged?.Invoke(this, IsBossActive);
            }
        }