/// <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 all players that this character is taking damage. Since we only support players damaging bosses, GetOwningPlayer should never be null. myNetworkView.RPC("RPCBoss3TakeDamage", uLink.RPCMode.All, damage, damageDealer.GetOwningPlayer() ); } 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("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 } }
/// <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 all players that this character is taking damage. Since we only support players damaging bosses, GetOwningPlayer should never be null. myNetworkView.RPC("RPCBoss2TakeDamage", uLink.RPCMode.All, damage, damageDealer.GetOwningPlayer() ); // 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 } }
/// <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 everybody that this barrel is taking damage uLink.NetworkView.Get(this).RPC("RPCBarrelTakeDamage", uLink.RPCMode.All, damage, damageDealer.GetOwningPlayer() ); } else { // Ignore if the character is already dying } }