public override void Process(CyclopsDamage packet) { SubRoot subRoot = GuidHelper.RequireObjectFrom(packet.Guid).GetComponent <SubRoot>(); using (packetSender.Suppress <CyclopsDamagePointRepaired>()) { SetActiveDamagePoints(subRoot, packet.DamagePointIndexes); } using (packetSender.Suppress <FireDoused>()) { SetActiveRoomFires(subRoot, packet.RoomFires); } LiveMixin subHealth = subRoot.gameObject.RequireComponent <LiveMixin>(); float oldHPPercent = (float)subRoot.ReflectionGet("oldHPPercent"); // Client side noises. Not necessary for keeping the health synced if (subHealth.GetHealthFraction() < 0.5f && oldHPPercent >= 0.5f) { subRoot.voiceNotificationManager.PlayVoiceNotification(subRoot.hullLowNotification, true, false); } else if (subHealth.GetHealthFraction() < 0.25f && oldHPPercent >= 0.25f) { subRoot.voiceNotificationManager.PlayVoiceNotification(subRoot.hullCriticalNotification, true, false); } using (packetSender.Suppress <CyclopsDamage>()) { // Not necessary, but used by above code whenever damage is done subRoot.ReflectionSet("oldHPPercent", subHealth.GetHealthFraction()); // Apply the actual health changes subRoot.gameObject.RequireComponent <LiveMixin>().health = packet.SubHealth; subRoot.gameObject.RequireComponentInChildren <CyclopsExternalDamageManager>().subLiveMixin.health = packet.DamageManagerHealth; subRoot.gameObject.RequireComponent <SubFire>().liveMixin.health = packet.SubFireHealth; } }