<commit_before>package main

import (
	"math/rand"
)

type statistic float64

type damage struct {
	performer            *unit
	receiver             *unit
	amount               statistic
	name                 string
	criticalStrikeChance statistic
	criticalStrikeFactor statistic
}

type healing struct {
	performer            *unit
	receiver             *unit
	amount               statistic
	name                 string
	criticalStrikeChance statistic
	criticalStrikeFactor statistic
}

// damageReductionFactor calculates a damage reduction factor on armor or magic resistance
func damageReductionFactor(damageReduction statistic) statistic {
	return statistic(1 / (1 + float64(damageReduction)/100))
}

// applyCriticalStrike judges whether critical strike happens or not and returns amount of damage / healing that affected by critical strike
func applyCriticalStrike(base, criticalStrikeChance, criticalStrikeFactor statistic) (amount statistic, critical bool) {
	amount = base
	critical = rand.Float64() < float64(criticalStrikeChance)
	if critical {
		amount += base * criticalStrikeFactor
	}
	return
}

// diceCritical dices whether critical strike is happening or not
func diceCritical(performer *unit) bool {
	return rand.Float64() < float64(performer.criticalStrikeChance())
}

// newPhysicalDamage returns a damage affected by armor of the receiver
func newPhysicalDamage(performer, receiver *unit, baseDamage statistic, name string) *damage {
	return newTrueDamage(
		performer,
		receiver,
		baseDamage*receiver.physicalDamageReductionFactor(),
		name,<commit_msg>Change the parameter names<commit_after>package main

import (
	"math/rand"
)

type statistic float64

type damage struct {
	performer            *unit
	receiver             *unit
	amount               statistic
	name                 string
	criticalStrikeChance statistic
	criticalStrikeFactor statistic
}

type healing struct {
	performer            *unit
	receiver             *unit
	amount               statistic
	name                 string
	criticalStrikeChance statistic
	criticalStrikeFactor statistic
}

// damageReductionFactor calculates a damage reduction factor on armor or magic resistance
func damageReductionFactor(damageReduction statistic) statistic {
	return statistic(1 / (1 + float64(damageReduction)/100))
}

// applyCriticalStrike judges whether critical strike happens or not and returns amount of damage / healing that affected by critical strike
func applyCriticalStrike(base, chance, factor statistic) (amount statistic, critical bool) {
	amount = base
	critical = rand.Float64() < float64(chance)
	if critical {
		amount += base * factor
	}
	return
}

// diceCritical dices whether critical strike is happening or not
func diceCritical(performer *unit) bool {
	return rand.Float64() < float64(performer.criticalStrikeChance())
}

// newPhysicalDamage returns a damage affected by armor of the receiver
func newPhysicalDamage(performer, receiver *unit, baseDamage statistic, name string) *damage {
	return newTrueDamage(
		performer,
		receiver,
		baseDamage*receiver.physicalDamageReductionFactor(),
		name,
{'fraction_non_alphanumeric': 0.058426966292134834, 'fraction_numerical': 0.010914927768860353, 'mean_word_length': 3.7791411042944785, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2792202', 'n_tokens_mistral': 896, 'n_tokens_neox': 810, 'n_words': 274}