Exemple #1
0
    void OnDamageAccounted(DamageAccountedMessageData data)
    {
        if (data.NewHealth <= 0 && data.OldHealth > 0)
        {
            TurnManager.Singleton.RequestFinishCurrentTurn(PlayerOwnedObject, 0);
            TurnManager.Singleton.DrawAttention(gameObject, AttentionPriority.Death);
        }

        CameraEvents.HealthAccounted.Restart();
    }
Exemple #2
0
    void OnDamageAccounted(DamageAccountedMessageData data)
    {
        if (!enabled || !float.IsNaN(detonationMessageTimestamp) || IsDetonated)
        {
            return;
        }

        if (data.NewHealth <= 0 && data.OldHealth > 0)
        {
            detonationMessageTimestamp = Time.fixedTime;
            ProcessDetonationDelay();
        }
    }
Exemple #3
0
    private void ProcessQueueItem(DamageMessageData damageData)
    {
        float oldHealth = Health;

        Health -= damageData.Damage;
        TotalDamageReceived += damageData.Damage;

        if (!AllowNegativeValues && Health < 0)
        {
            Health = 0;
        }

        var messageData = new DamageAccountedMessageData(damageData, oldHealth, Health);

        SendMessage(DamageAccountedMessageData.MessageName, messageData, SendMessageOptions.DontRequireReceiver);
    }