<?

class combat{
	public $db;
	function __construct($db){
		$this->db=$db;
	}

	function damage($of,$def){
		$cof=rand(2,5);
		$damage=floor(($of['str']-round($def['def']/100*64))/$cof);
		if($damage<=0){$damage=rand(1,round($of['str']/10));}
		return $damage;
	}
}