function roll() { $result = 0; for ($i = 0; $i < $this->numberOfDices; $i++) { $result += RandomNumber::get() % $this->numberOfDots + 1; } return $result + $this->adjustment; }