# beforeFW
$endurdin = {
	Ken = (musle / 100) * Kus / 100

	if ken <= 0:ken = 1

	Kene = (musle[i] / 100) * Kuse / 100

	if kene <= 0:kene = 1

	KoefUder = rand(Uder * 20 / 100, Uder)
	KoefUderE = rand(Udere * 20 / 100, Udere)
	KoefBros = rand(Brosok * 20 / 100, Brosok)
	KoefBrosE = rand(Brosoke * 20 / 100, Brosoke)
	KoefProt = rand(Zash * 20 / 100, Zash)
	KoefProtE = rand(Zashe*20 / 100, Zashe)
}

$uderdin = {
	Kus = 5
	Kuse = 10
	dynamic $endurdin
	endur -= ken
	endurE -= kene
	Aktiv = (strenw / 2) + agilw + rand(0, lustw) + KoefUder
	Aktiv = Aktiv * endur / endurMax
	Passiv = (((strenwE + (agilwE / 2)) * koefE) / 100) + rand(0, lustwE) + KoefProtE
	Passiv = Passiv * endurE / endurMaxE
}

$uderdinE = {
	Kus = 10
	Kuse = 5
	dynamic $endurdin
	endur -= ken
	endurE -= kene
	Aktiv = (strenwE / 2) + agilwE + rand(0, lustwE) + KoefUdere
	Aktiv = Aktiv * endurE / endurMaxE
	Passiv = (((strenw + (agilw / 2)) * koef) / 100) + rand(0, lustw) + KoefProt
	Passiv = Passiv * endur / endurMaxE
}

$brosdin = {
	Kus = 10
	Kuse = 10
	dynamic $endurdin
	endur -= ken
	endurE -= kene
	Aktiv = strenw + (agilw / 2) + rand(0, lustw) + KoefBros
	Aktiv = Aktiv * endur / endurMax
	Passiv = (((strenwE / 2) + agilwE) * koefE / 100) + rand(0, lustwE) + KoefProtE
	Passiv = Passiv * endurE / endurMaxE
}

$brosdinE = {
	Kus = 10
	Kuse = 10
	dynamic $endurdin
	endur -= ken
	endurE -= kene
	Aktiv = strenwE + (agilwE / 2) + rand(0, lustwE) + KoefBrosE
	Aktiv = Aktiv * endurE / endurMaxE
	Passiv = (((strenw / 2) + agilw) * koef / 100) + rand(0, lustw) + KoefProt
	Passiv = Passiv * endur / endurMax
}

!!power, throws
!!flexibility, protection,
!!speed, initiative
!!equipment,
!!endurance
a = 1
point = 0
pointE = 0
$pcs_firstnameE = $nikname[i]
$pcs_firstnameA = $nikname[a]
strenw = musle[1] / 10
strenwE = musle[i] / 10
agilw = flex[1] / 10
agilwE = flex[i] / 10
lustMax = wipo[1]
lustMaxE = wipo[i]
lustw = lustMax
lustwe = lustMaxe
Brosok = Bteh[1] / 10
BrosokE = Bteh[i] / 10
Uder = Uteh[1] / 10
Udere = Uteh[i] / 10
Zash = Zteh[1] / 10
Zashe = Zteh[i] / 10

resultFight = 0
endurMax = stamina[1] / 10
endurMaxE = stamina[i] / 10
endur = endurMax
endurE = endurMaxE
croonce = 0
round = 1
rMin = 8
stoper = 0
Ku = 0
Kb = 0
Kz = 0
KuE = 0
KbE = 0
KzE = 0
!!minus the endurance of fat
!!force depends on the endurance
!!speed depends on the endurance

if Formula = 0:Formula = 3

'<center><b>before round</b></center>'
'<center><img src="images/locations/city/citycenter/gym/kickboxing/bef.jpg"></center>'
'you and <<$pcs_firstnameE>> greeted each other.'
'Referee required to start a fight on his hands.'

act 'Fight on his hands':
	cls
	!!picture
	'<center><img src="images/locations/city/citycenter/gym/kickboxing/arm.jpg"></center>'

	if strenw > strenwE:
		point += 1
		lustw += 1
		crouch = 1
		$text = 'Stand your opponent on all fours, and you catch him from behind.'
		'You won the fight on his hands.'
	elseif strenw < strenwE:
		pointE += 1
		lustwE += 1
		crouch = 0
		$text = 'You get up on all fours, and your opponent to catch him from behind.'
		'You lost the battle on his hands.'
	elseif strenw = strenwE:
		varrand = rand(0, 1)

		if varrand = 0:crouch = 1 & $text = 'Stand your opponent on all fours, and you catch him from behind.'

		if varrand = 1:crouch = 0 & $text = 'You get up on all fours, and your opponent to catch him from behind.'
		'Quest on hand ended in a draw. The referee tossed the coin, that would determine the winner.'
	end

	'Referee stopped you and commanded <<$text>>'

	act 'Follow the instructions referees':gt 'FightCrouch'
end

--- beforeFW ---------------------------------

