private void GrantEffects(Player target, ThrowSettings settings, bool isFriendly) { EffectSettings[] effectSettings = isFriendly ? settings.FriendlySettings.EffectSettings : settings.EnemySettings.EffectSettings; if (effectSettings != null && effectSettings.Length > 0) { foreach (var effectSetting in effectSettings) { Log.Debug($"Effect granted to {target.Nickname}.\nEffect:{effectSetting.EffectType}\nIntensity:{effectSetting.Intensity}\nDuration:{effectSetting.Duration}", logDebug); target.ChangeEffectIntensity(effectSetting.EffectType.ToString(), effectSetting.Intensity); target.EnableEffect(effectSetting.EffectType, effectSetting.Duration); } } }
private void Friendly_DoAhpHealing(Player target, ThrowSettings throwSettings) { if (throwSettings.FriendlySettings.AhpHeal == null) { return; } var ahpAmount = Random.Range(throwSettings.FriendlySettings.AhpHeal.Minimum, throwSettings.FriendlySettings.AhpHeal.Maximum); var updatedAhpAmount = GetHealAmount(ahpAmount, target.ArtificialHealth, target.MaxArtificialHealth); if (updatedAhpAmount > 0) { target.ArtificialHealth += updatedAhpAmount; Log.Debug($"Healed {target.Nickname} for {updatedAhpAmount} Ahp.", logDebug); } }
private void Enemy_DoHealing(Player target, ThrowSettings throwSettings) { if (throwSettings.EnemySettings.Heal == null) { return; } var healAmount = Random.Range(throwSettings.EnemySettings.Heal.Minimum, throwSettings.EnemySettings.Heal.Maximum); var updatedHealAmount = GetHealAmount(healAmount, target.Health, target.MaxHealth); if (updatedHealAmount > 0) { target.Health += updatedHealAmount; Log.Debug($"Healed {target.Nickname} for {updatedHealAmount} health.", logDebug); } }
private void Friendly_DealDamage(Player target, ThrowSettings throwSettings) { if (throwSettings.FriendlySettings.Damage == null) { return; } var amount = Random.Range(throwSettings.FriendlySettings.Damage.Minimum, throwSettings.FriendlySettings.Damage.Maximum); if (amount > 0) { target.ReferenceHub.falldamage.RpcDoSound(); CheckForRagdoll(target, amount); thrower.GameObject.GetComponent <Scp049_2PlayerScript>().TargetHitMarker(thrower.Connection); Log.Debug($"Dealt {amount} damage to {target.Nickname}", logDebug); } }