public void TakeDamage(vDamage damage) { if (!ragdoll) { return; } if (!ragdoll.iChar.isDead) { inAddDamage = true; if (overrideReactionID) { damage.reaction_id = reactionID; } ragdoll.ApplyDamage(damage); Invoke("ResetAddDamage", 0.1f); } }
public void TakeDamage(vDamage damage) { if (!ragdoll) { return; } if (!ragdoll.iChar.isDead) { inAddDamage = true; float multiplier = (useRandomValues && !fixedValues) ? Random.Range(minDamageMultiplier, maxDamageMultiplier) : (useRandomValues && fixedValues) ? randomChange ? maxDamageMultiplier:minDamageMultiplier :damageMultiplier; if (overrideReactionID) { if (useRandomValues && !fixedValues) { damage.reaction_id = Random.Range(minReactionID, maxReactionID); } else if (useRandomValues && fixedValues) { damage.reaction_id = randomChange ? maxReactionID:minReactionID; } else { damage.reaction_id = reactionID; } } var _damage = new vDamage(damage); var value = (float)_damage.damageValue; _damage.damageValue = (int)(value * multiplier); if (multiplier == maxDamageMultiplier) { OnGetMaxValue.Invoke(); } ragdoll.ApplyDamage(damage); onReceiveDamage.Invoke(_damage); Invoke("ResetAddDamage", 0.1f); } }
public void TakeDamage(vDamage damage) { if (!ragdoll) { return; } if (!ragdoll.iChar.isDead) { inAddDamage = true; if (overrideReactionID) { damage.reaction_id = reactionID; } var _damage = new vDamage(damage); var value = (float)_damage.damageValue; _damage.damageValue = (int)(value * damageMultiplier); ragdoll.ApplyDamage(damage); Invoke("ResetAddDamage", 0.1f); } }