/// <summary> /// Called by the player observing their projectile making contact with this character to inflict /// damage to this character. This must never be called from an RPC. /// </summary> /// <param name='damager'> /// An interface to the object dealing the damage. /// </param> void IDamageTaker.TakeDamage(IDamageDealer damageDealer) { if (!IsDying) { float damage = damageDealer.GetDamage(); // Tell the master client that this character is taking damage photonView.RPC("RPCBoss3TakeDamage", PhotonTargets.All, damage, (damageDealer.IsOwnedByPlayer() ? damageDealer.GetOwningPlayer() : null) ); } else { // Ignore if the character is already dying } }
/// <summary> /// Called by the player observing their projectile making contact with this character to inflict /// damage to this character. This must never be called from an RPC. /// </summary> /// <param name='damager'> /// An interface to the object dealing the damage. /// </param> void IDamageTaker.TakeDamage(IDamageDealer damageDealer) { if (!IsDying) { float damage = damageDealer.GetDamage(); // Tell the master client that this character is taking damage photonView.RPC("RPCBoss2TakeDamage", PhotonTargets.All, damage, (damageDealer.IsOwnedByPlayer() ? damageDealer.GetOwningPlayer() : null) ); // If we clearly doomed the character, begin its VISIBLE death sequence here. The master // client will eventually destroy it from the game. if (hitPoints - damage < MinHitpointsBeforeFrag) { BeginDying(); // This will flag the character as dying } } else { // Ignore if the character is already dying } }