/** * Takes a tile and returns the damage caused * @param Card $tile * @return int */ public function getHuntTileDamage(Card $tile) { $base = $tile->getCorruption(); if ($base == 'd') { $corruption = Dice::roll(1)->results[1]; } elseif ($base == 'e') { if ($this->getFellowship()->isInMordor()) { $corruption = $this->getHuntDicePool()->count(); } else { $corruption = $this->getCurrentAction()->getData()['success']; } } else { $corruption = $base; } return $corruption; }
public function getRandomCompanion() { $companions = $this->getCharacters()->filter(function ($c) { return $c->getLevel() > 0; }); $dice = Dice::roll(1, $companions->count()); $companion = $companions->get($companions->getKeys()[$dice->results[1] - 1]); return $companion; }