private void RewardAttacker(GameObject attacker) { EntityStats attackerStats = attacker.GetComponent <EntityStats>(); int attackerLevel = attackerStats.GetLevel(); float nerfValue = 0.16f; int levelsDifference = Mathf.Abs(attackerLevel - level); int levelDiffMultiplier = levelsDifference <= 2 ? 0 : levelsDifference - 2; int finalExp = (int)(baseExp * Mathf.Clamp01(1f - levelDiffMultiplier * nerfValue)); attackerStats.AddExperience(finalExp); }