Beispiel #1
0
    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);
    }
Beispiel #2
0
 protected override void OnControlEnter()
 {
     base.OnControlEnter();
     if (base.localControlled)
     {
         this.clientVitalsSync = base.AddAddon <ClientVitalsSync>();
         ImageEffectManager.GetInstance <GameFullscreen>().fadeColor = Color.black;
         ImageEffectManager.GetInstance <GameFullscreen>().tintColor = Color.white;
         RPOS.DoFade(2f, 2.5f, Color.clear);
         RPOS.SetCurrentFade(Color.black);
         RPOS.HealthUpdate(base.health);
         RPOS.ObservedPlayer = base.controllable;
     }
 }
Beispiel #3
0
    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);
    }