# atak
if $ARGS[0] = 'player':
cla
!!!!!!!
set tip = 0
!!!!!!!
set strenA = stren
set speedA = speed
set agilA = agil
set vitalA = vital
!Навыки
set boxingA = boxing
!Параметры
set healthA = health
set BonusA = BonusAtak
!!!!!!!!!
set strenD = strenV
set speedD = speedV
set agilD = agilV
set vitalD = vitalV
!Навыки
set boxingD = boxingV
!Параметры
set healthD = healthV
set initBonusA = initBonus
set initBonus = 0
set initBonusV = 0
set BonusD = BonusDefV
	if stunV <= 0:
	xgt 'atak','popad'
	end
	if stunV > 0:
	'<B><font color = green><<$nameV>> can not move a critical hit</font></B>'
	xgt 'atak','uronKrit'
	end
end

if $ARGS[0] = 'enemy':
cla
!!!!!!!
set tip = 1
!!!!!!!
set strenA = strenV
set speedA = speedV
set agilA = agilV
set vitalA = vitalV
!Навыки
set boxingA = boxingV
!Параметры
set healthA = healthV
set BonusA = BonusAtakV
!!!!!!!!!!!!!!
set strenD = stren
set speedD = speed
set agilD = agil
set vitalD = vital
!Навыки
set boxingD = boxing
!Параметры
set healthD = health
set BonusD = BonusDef
set initBonusA = initBonusV
set initBonus = 0
set initBonusV = 0
	if stun <= 0:
	xgt 'atak','popad'
	end
	if stun > 0:
	'<B><font color = red>You can not move a critical hit</font></B>'
	xgt 'atak','uronKritV'
	end
end

if $ARGS[0] = 'popad':
cla
!расчет попадания уворота
set poSp = speedA * 20/100
set uvAg = agilD * 20/100
set poBox = boxingA * 20/100
set uvBox = boxingD * 20/100
set popad = RAND(boxingA - poBox, boxingA + poBox) + RAND(speedA-poSp, speedA + poSp) + BonusA + initBonusA
set uvorot = RAND(boxingD - uvBox, boxingD + uvBox) + RAND(agilD-uvAg, agilD + uvAg) + BonusD
set uvorKoef = uvorot * 50/100
set popKoef = popad * 50/100
	if popad > uvorot:
		if popad >= uvorot + uvorKoef:
		!крит, очень точное попадание
			if tip = 0:
			!атаковал игрок
			'<B><font color = green>critical hits</font></B>'
			xgt 'atak','uronKrit'
			end
			if tip = 1:
			!атаковал противник
			'<B><font color = red>critical hits</font></B>'
			xgt 'atak','uronKritV'
			end
		end
		if popad < uvorot+uvorKoef:
		!нормальное попадание
			if tip = 0:
			!атаковал игрок
			'<B><font color = green>Contact</font></B>'
			xgt 'atak','uron'
			end
			if tip = 1:
			!атаковал противник
			'<B><font color = red>Contact</font></B>'
			xgt 'atak','uronV'
			end
		end
	end
	if popad <= uvorot:
		if popad+popKoef <= uvorot:
		!критический промах
			if tip = 0:
			!атаковал игрок
			'<B><font color = red>CRITICAL SLIP</font></B>'
			xgt 'atak','uronKritV'
			end
			if tip = 1:
			!атаковал противник
			'<B><font color = green>CRITICAL SLIP</font></B>'
			xgt 'atak','uronKrit'
			end
		end
		if popad+popKoef > uvorot:
		!промах
			if tip = 0:
			!атаковал игрок
			'<B><font color = red>is washed</font></B>'
			xgt 'fight','sta'
			end
			if tip = 1:
			!атаковал противник
			'<B><font color = green>is washed</font></B>'
			xgt 'fight','sta'
			end
		end
	end
end

if $ARGS[0] = 'uronKrit':
cla
set damage = RAND(stren, stren * 2) + weapbonus + magweapbonus
	if knife > 0:
	set knibon = knife + 1
	set knife = 0
	set damage = damage * knibon
	set knibon = 0
	'<B><font color = green>your opponent flies throwing knife</font></B>'
	end
	if defenceV <= 0 and klonV <= 0 and unmaterialV <= 0 and barierV <= 0:
	if dospehV > 0: set damage -= dospehDefV & set dospehEnV -= 1
	if damage < 0: set damage = 0
	Set healthV -= damage
		if weaponTipe = 1: set bloodV += RAND(weapon/4, weapon/2)
		if weaponTipe = 2: set stun += RAND(1,2)
		if weaponTipe = 3: set bloodV += RAND(weapon/4, weapon/2)
		if stunner > 0:
		set stunner = 0
		set stunV = RAND(3,6)
		'<B><font color = green>You are paralyzed the enemy <<stunV>> moves.</font></B>'
		end
	'<B><font color = green>Apply Done <<damage>> units</font></B>'
		if zerkaloV > 0:
		set zerkaloV -= 1
		set health -= damage
		'<B><font color = red><<$nameV>> reflected the damage and you got <<damage>> points of damage</font></B>'
		end
	xgt 'fight','sta'
	end
	if defenceV > 0 and klonV <= 0 and unmaterialV <= 0:
	Set defenceV -= damage
	'<B><font color = green>Protection of the enemy harmed <<damage>> units</font></B>'
	xgt 'fight','sta'
	end
	if klonV > 0 and unmaterialV <= 0:
	set klonV -= 1
	'<B><font color = green>Destroyed clone enemy, he still had <<KlonV>> clones</font></B>'
	xgt 'fight','sta'
	end
	if unmaterialV > 0:
	set unmaterialV -= 1
	'<B><font color = red>Your shot went straight through the opponent´s body. <<$nameV>> is not material</font></B>'
	xgt 'fight','sta'
	end
	if barierV > 0:
	!барьер именитета для урона
		if barierV >= damage:
		'<B><font color = red><<$nameV>> easily withstood your butt</font></B>'
		xgt 'fight','sta'
		end
		if barierV < damage:
		Set healthV -= damage
		if weaponTipe = 1: set bloodV += RAND(weapon/4, weapon/2)
		if weaponTipe = 2: set stun += RAND(1,2)
		if weaponTipe = 3: set bloodV += RAND(weapon/4, weapon/2)
		if stunner > 0:
		set stunV = RAND(3,6)
		'<B><font color = green>You are paralyzed the enemy <<stunV>> moves.</font></B>'
		end
		'<B><font color = green>Apply Done <<damage>> units</font></B>'
			if zerkaloV > 0:
			set zerkaloV -= 1
			set health -= damage
			'<B><font color = red><<$nameV>> reflected the damage and you got <<damage>> points of damage</font></B>'
			end
		end
	xgt 'fight','sta'
	end

end


if $ARGS[0] = 'uron':
cla
set stKo = stren * 20/100
set damage = RAND(stren - stKo, stren + stKo) + weapbonus + magweapbonus
	if knife > 0:
	set knibon = knife + 1
	set knife = 0
	set damage = damage * knibon
	set knibon = 0
	'<B><font color = green>your opponent flies throwing knife</font></B>'
	end
	if defenceV <= 0 and klonV <= 0 and unmaterialV <= 0 and barierV <= 0:
	if dospehV > 0: set damage -= dospehDefV & set dospehEnV -= 1
	if damage < 0: set damage = 0
	Set healthV -= damage
		if stunner > 0:
		set stunner = 0
		set stunV = RAND(1,3)
		'<B><font color = green>You are paralyzed the enemy <<stunV>> moves.</font></B>'
		end
	'<B><font color = green>Apply Done <<damage>> units</font></B>'
		if zerkaloV > 0:
		set zerkaloV -= 1
		set health -= damage
		'<B><font color = red><<$nameV>> reflected the damage and you got <<damage>> points of damage</font></B>'
		end
	xgt 'fight','sta'
	end
	if defenceV > 0 and klonV <= 0 and unmaterialV <= 0:
	Set defenceV -= damage
	'<B><font color = green>Protection of the enemy harmed <<damage>> units</font></B>'
	xgt 'fight','sta'
	end
	if klonV > 0 and unmaterialV <= 0:
	set klonV -= 1
	'<B><font color = green>Destroyed clone enemy, he still had <<KlonV>> clones</font></B>'
	xgt 'fight','sta'
	end
	if unmaterialV > 0:
	set unmaterialV -= 1
	'<B><font color = red>Your shot went straight through the opponent´s body. <<$nameV>> is not material</font></B>'
	xgt 'fight','sta'
	end
	if barierV > 0:
	!барьер именитета для урона
		if barierV >= damage:
		'<B><font color = red><<$nameV>> easily withstood your butt</font></B>'
		xgt 'fight','sta'
		end
		if barierV < damage:
		Set healthV -= damage
		if stunner > 0:
		set stunV = RAND(1,3)
		'<B><font color = green>You are paralyzed the enemy <<stunV>> moves.</font></B>'
		end
		'<B><font color = green>Apply Done <<damage>> units</font></B>'
			if zerkaloV > 0:
			set zerkaloV -= 1
			set health -= damage
			'<B><font color = red><<$nameV>> reflected the damage and you got <<damage>> points of damage</font></B>'
			end
		end
	xgt 'fight','sta'
	end

end



if $ARGS[0] = 'uronKritV':
cla
set damage = RAND(strenV, strenV * 2) + weapbonusV + magweapbonusV
	if knifeV > 0:
	set knibonV = knifeV + 1
	set knifeV = 0
	set damage = damage * knibonV
	set knibonV = 0
	'<B><font color = red>you throwing knife flies</font></B>'
	end
	if defence <= 0 and klon <= 0 and unmaterial <= 0 and barier <= 0:
	if dospeh > 0: set damage -= dospehDef & set dospehEn -= 1
	if damage < 0: set damage = 0
	Set health -= damage
		if weaponTipeV = 1: set blood += RAND(weaponV/4, weaponV/2)
		if weaponTipeV = 2: set stunV += RAND(1,2)
		if weaponTipeV = 3: set blood += RAND(weaponV/4, weaponV/2)
		if stunnerV > 0:
		set stunnerV = 0
		set stun = RAND(3,6)
		'<B><font color = red><<$nameV>> paralyzed you to <<stun>> moves.</font></B>'
		end
	'<B><font color = red>You harmed <<damage>> units</font></B>'
		if zerkalo > 0:
		set zerkalo -= 1
		set healthV -= damage
		'<B><font color = green>You are repelled damage and <<$nameV>> to give <<damage>> points of damage</font></B>'
		end
	xgt 'fight','sta'
	end
	if defence > 0 and klon <= 0 and unmaterial <= 0:
	Set defence -= damage
	'<B><font color = red>Protection of your harmed <<damage>> units</font></B>'
	xgt 'fight','sta'
	end
	if klon > 0 and unmaterial <= 0:
	set klon -= 1
	'<B><font color = red>destroy your clone, you have more <<Klon>> clones</font></B>'
	xgt 'fight','sta'
	end
	if unmaterial > 0:
	set unmaterial -= 1
	'<B><font color = green>Strike the enemy flew right through your body. YOU is not material</font></B>'
	xgt 'fight','sta'
	end
	if barier > 0:
	!барьер именитета для урона
		if barier >= damage:
		'<B><font color = green>You can easily withstood the impact of the opponent</font></B>'
		xgt 'fight','sta'
		end
		if barier < damage:
		Set health -= damage
		if weaponTipeV = 1: set blood += RAND(weaponV/4, weaponV/2)
		if weaponTipeV = 2: set stunV += RAND(1,2)
		if weaponTipeV = 3: set blood += RAND(weaponV/4, weaponV/2)
		if stunnerV > 0:
		set stun = RAND(3,6)
		'<B><font color = red><<$nameV>> paralyzed you to <<stun>> moves.</font></B>'
		end
		'<B><font color = red>You harmed <<damage>> units</font></B>'
			if zerkalo > 0:
			set zerkalo -= 1
			set healthV -= damage
			'<B><font color = green>You are repelled damage and <<$nameV>> to give <<damage>> points of damage</font></B>'
			end
		end
	xgt 'fight','sta'
	end

end


if $ARGS[0] = 'uronV':
cla
set stKo = strenV * 20/100
set damage = RAND(strenV - stKo, strenV + stKo) + weapbonusV + magweapbonusV
	if knifeV > 0:
	set knibonV = knifeV + 1
	set knifeV = 0
	set damage = damage * knibonV
	set knibonV = 0
	'<B><font color = red>you throwing knife flies</font></B>'
	end
	if defence <= 0 and klon <= 0 and unmaterial <= 0 and barier <= 0:
	if dospeh > 0: set damage -= dospehDef & set dospehEn -= 1
	if damage < 0: set damage = 0
	Set health -= damage
		if stunnerV > 0:
		set stunnerV = 0
		set stun = RAND(3,6)
		'<B><font color = red><<$nameV>> paralyzed you to <<stun>> moves.</font></B>'
		end
	'<B><font color = red>You harmed <<damage>> units</font></B>'
		if zerkalo > 0:
		set zerkalo -= 1
		set healthV -= damage
		'<B><font color = green>You are repelled damage and <<$nameV>> to give <<damage>> points of damage</font></B>'
		end
	xgt 'fight','sta'
	end
	if defence > 0 and klon <= 0 and unmaterial <= 0:
	Set defence -= damage
	'<B><font color = red>Protection of your harmed <<damage>> units</font></B>'
	xgt 'fight','sta'
	end
	if klon > 0 and unmaterial <= 0:
	set klon -= 1
	'<B><font color = red>destroy your clone, you have more <<Klon>> clones</font></B>'
	xgt 'fight','sta'
	end
	if unmaterial > 0:
	set unmaterial -= 1
	'<B><font color = green>Strike the enemy flew right through your body. YOU is not material</font></B>'
	xgt 'fight','sta'
	end
	if barier > 0:
	!барьер именитета для урона
		if barier >= damage:
		'<B><font color = green>You can easily withstood the impact of the opponent</font></B>'
		xgt 'fight','sta'
		end
		if barier < damage:
		Set health -= damage
		if stunnerV > 0:
		set stun = RAND(3,6)
		'<B><font color = red><<$nameV>> paralyzed you to <<stun>> moves.</font></B>'
		end
		'<B><font color = red>You harmed <<damage>> units</font></B>'
			if zerkalo > 0:
			set zerkalo -= 1
			set healthV -= damage
			'<B><font color = green>You are repelled damage and <<$nameV>> to give <<damage>> points of damage</font></B>'
			end
		end
	xgt 'fight','sta'
	end

end
--- atak ---------------------------------

