/// <summary> /// Do damage to multiple target fighters. /// </summary> /// <param name="targets">The target fighters to damage.</param> /// <param name="multiplier">The amount to multiply the damage by.</param> public void DoDamage(Fighter[] targets, float multiplier = 0.5f) { if (!IsAlive) { return; } OnDoDamage?.Invoke(this, EventArgs.Empty); foreach (Fighter target in targets) { int damage = Mathf.CeilToInt(CalculateDamage(target) * multiplier); target.TakeDamage(damage); } }
public static bool DoDamage(PlayerLife __instance, ref byte amount, // lgtm [cs/too-many-ref-parameters] ref EDeathCause newCause, ref ELimb newLimb, ref CSteamID newKiller, ref bool trackKill, ref Vector3 newRagdoll, ref ERagdollEffect newRagdollEffect, ref bool canCauseBleeding) { var cancel = false; OnDoDamage?.Invoke(__instance.player, ref amount, ref newCause, ref newLimb, ref newKiller, ref trackKill, ref newRagdoll, ref newRagdollEffect, ref canCauseBleeding, ref cancel); return(!cancel); }
private static bool DoDamage(PlayerLife __instance, ref byte amount, ref EDeathCause newCause, ref ELimb newLimb, ref CSteamID newKiller, ref bool trackKill, ref Vector3 newRagdoll, ref ERagdollEffect newRagdollEffect, ref bool canCauseBleeding) { bool cancel = false; OnDoDamage?.Invoke(__instance.player, ref amount, ref newCause, ref newLimb, ref newKiller, ref trackKill, ref newRagdoll, ref newRagdollEffect, ref canCauseBleeding, out cancel); return(!cancel); }
public void DoDamage(Hero attackerHero, Agent attackerAgent, Hero victimHero, Agent victimAgent, BLTHeroPowersMissionBehavior.RegisterBlowParams blowParams) => OnDoDamage?.Invoke(attackerHero, attackerAgent, victimHero, victimAgent, blowParams);
protected void InvokeOnDoDamage() => OnDoDamage?.Invoke(this, EventArgs.Empty);