public void ClientHealthChange(float amount, GameObject attacker) { float health = base.health; base.AdjustClientSideHealth(amount); float num2 = amount; float num3 = Mathf.Abs((float)(num2 - health)); bool flag = amount < health; float healthFraction = base.healthFraction; if (base.localControlled && (num3 >= 1f)) { base.GetComponent <LocalDamageDisplay>().SetNewHealthPercent(healthFraction, attacker); } if ((((attacker != null) && flag) && (num3 >= 1f)) && ((hudDamagePrefab != null) || Bundling.Load <HUDDirectionalDamage>("content/hud/DirectionalDamage", out hudDamagePrefab))) { Vector3 vector; Character character; if (IDBase.GetMain <Character>(attacker, out character)) { vector = base.eyesOrigin - character.eyesOrigin; } else { vector = base.origin - attacker.transform.position; } HUDDirectionalDamage.CreateIndicator(vector, (double)amount, NetCull.time, 1.6000000238418579, hudDamagePrefab); } RPOS.HealthUpdate(amount); }
public void ClientHealthChange(float amount, GameObject attacker) { Vector3 vector3; Character character; float single = base.health; base.AdjustClientSideHealth(amount); float single1 = Mathf.Abs(amount - single); bool flag = amount < single; float single2 = base.healthFraction; if (base.localControlled && single1 >= 1f) { base.GetComponent <LocalDamageDisplay>().SetNewHealthPercent(single2, attacker); } if (attacker && flag && single1 >= 1f && (ClientVitalsSync.hudDamagePrefab || Bundling.Load <HUDDirectionalDamage>("content/hud/DirectionalDamage", out ClientVitalsSync.hudDamagePrefab))) { vector3 = (!IDBase.GetMain <Character>(attacker, out character) ? base.origin - attacker.transform.position : base.eyesOrigin - character.eyesOrigin); HUDDirectionalDamage.CreateIndicator(vector3, (double)amount, NetCull.time, 1.60000002384186, ClientVitalsSync.hudDamagePrefab); } RPOS.HealthUpdate(amount); }