<?php



class param{                














public function udar($sila, $brony,$crit,$up)




    { 


$bb = mt_rand(1,100);
$crit = ($bb<=$crit) ? true : false;


$bbb = mt_rand(1,100);
$sok = ($bbb<=30) ? true : false;





if($sok==1){ $takt= $sila * $up / 100; $takt = ceil($takt); $sila = $sila +$takt;}





if($crit == 1){ $sila = $sila  * 1.5; $sila = ceil($sila); }













$sila=$sila-$brony;


$total = ($sila <=0 ? mt_rand(1,2) : $sila);








return array ($total,$crit,$sok);


}



















public function hill($sila, $myhp,$max,$vampir,$pet) {


$bui = mt_rand(1,100);
$rand_vamp = ($bui<=30) ? true : false;

$buii = mt_rand(1,100);
$rand_pet = ($buii<=40) ? true : false;




$hill = $sila * $vampir / 100; $hill = ceil($hill);


$hill = ($rand_vamp==1) ? $hill : 0;







$last_pet = ($rand_pet==1) ? $pet : 0;


$conf=$hill+$last_pet;



$conf=$conf+$myhp; 


$itog = ($conf>=$max) ? $max : $conf;



return array ($itog,$hill,$last_pet,$rand_pet,$rand_vamp);




}
}
?>
