protected function add_card($rarity) { if ($rarity == 3 && mt_rand(0, 8) < 1) { $rarity = 4; } parent::add_card($rarity); }
public function generate() { $shifted_ids = array_keys(Database::get_vector('card', 'id', Database::array_in('name', $this->shifted), $this->shifted)); foreach ($this->pool as $rarity => &$cards) { $this->shifted_pool[$rarity] = array(); foreach ($cards as $key => $card) { if (in_array($card, $shifted_ids)) { unset($cards[$key]); $this->shifted_pool[$rarity][] = $card; } } $cards = array_values($cards); } unset($cards); parent::generate(); $this->is_foil = false; $this->land = 0; $this->common = 3; if (mt_rand(0, 4) < 1) { $this->uncommon = 0; $this->rare = 1; } else { $this->uncommon = 1; $this->rare = 0; } $this->pool = $this->shifted_pool; parent::generate(); return $this->ids; }
public function __construct($id) { parent::__construct($id); $this->is_foil = true; }
public function generate() { parent::generate(); $shifted = Booster::get_cards('TST'); if (empty($shifted)) { Grabber::get_set('TST', true); $shifted = Booster::get_cards('TST'); } $shifted = current($shifted); $key = array_rand($shifted); $id = $shifted[$key]; $this->insert_card($id); $this->ids[] = $id; return $this->ids; }