MArcomage

Free multiplayer on-line fantasy card game

Please log in

Keywords > Far sight

Icon

Far sight

Effect

If matching card in opponent's hand is revealed, effect based on matching card cost and played card rarity (bricks only cost - raise tower (C - 2, U - 6, R - 18), gems only cost - raise lowest token counter (C - 10, U - 30, R - 90), recruits only cost - raise wall (C - 3, U - 9, R - 27), mixed cost - raise stock (C - 1, U - 3, R - 9), zero cost - no effect). After optional effect opponent's cards are revealed based on played card rarity (C - matching card and its adjacent cards, U - matching card and its adjacent cards and their adjacent cards, R - whole hand). Optional effect will always trigger in a game with disabled Hidden cards mode.

Lore

Scouting is extremely important in any battle. Creatures blessed with much better sight than others are highly valued even if their combat capabilities are poor. Acting as veteran scouts in army ranks, they are used to spot incoming threat and even exploit opponent's weaknesses.

Code

    if (!$t->hiddenCards() || isset($t->hisData()->Revealed[$t->cardPos()])) {
      // bonus effect
      $cur_card = $this->getCard($t->hisData()->Hand[$t->cardPos()]);
      $bricks = $cur_card->getResources('Bricks');
      $gems = $cur_card->getResources('Gems');
      $recruits = $cur_card->getResources('Recruits');
      $rarities = ['Common' => 1, 'Uncommon' => 3, 'Rare' => 9];
      $factor = $rarities[$t->card()->getRarity()];
      
      if ($bricks > 0 && $gems == 0 && $recruits == 0) {
        $t->myData()->addTower(2 * $factor);
      }
      elseif ($bricks == 0 && $gems > 0 && $recruits == 0) {
        // remove inactive token counters
        $my_tokens = array_diff($t->myData()->TokenNames, ['none']);

        // raise lowest token counter
        if (count($my_tokens) > 0) {
          $min = 1000;
          $chosen = array();
          foreach ($my_tokens as $i => $token_name) {
            $min = min($min, $t->myData()->TokenValues[$i]);
          }
          foreach ($my_tokens as $i => $token_name) {
            if ($t->myData()->TokenValues[$i] == $min) {
              $chosen[] = $i;
            }
          }
          $chosen_index = $chosen[array_rand($chosen)];
          $t->myData()->TokenValues[$chosen_index]+= 10 * $factor;
        }
      }
      elseif ($bricks == 0 && $gems == 0 && $recruits > 0) {
        $t->myData()->addWall(3 * $factor);
      }
      elseif ($bricks == 0 && $gems == 0 && $recruits == 0) {
        // no effect
      }
      else {
        $t->myData()->addStock($factor);// raise stock
      }
    }
    
    // reveal opponent's cards based on played card rarity
    $offsets = ['Common' => 1, 'Uncommon' => 2, 'Rare' => 8];
    $offset = $offsets[$t->card()->getRarity()];
    $start = max($t->cardPos() - $offset, 1);
    $finish = min($t->cardPos() + $offset, 8);
    
    for ($i = $start; $i <= $finish; $i++) {
      $this->revealCard('his', $i);
    }