MArcomage

Free multiplayer on-line fantasy card game

Please log in


5 C
Cleansing
Cleansing

Holy

Replace up to N common non-Holy keyword cards in opponent's hand with common Holy
N = #Holy in hand (max 4)

Id
325
Name
Cleansing
Rarity
Common
Keywords
Cost (B / G / R)
0 / 5 / 0
Modes
0
Level
9
Created
25. Nov, 2007
Modified
3. Oct, 2010
Played
3096 / 15618
Discarded
2275 / 8996
Drawn
6903 / 32367

BB code

Effect

Replace up to N common non-Holy keyword cards in opponent's hand with common Holy
N = #Holy in hand (max 4)

Code

    $count = min(4, $t->keywordCount($t->myData()->Hand, 'Holy'));
    $storage = array();
    for ($i = 1; $i <= $t->handSize(); $i++) {
      $cur_card = $t->getCard($t->hisData()->Hand[$i]);
      if ($cur_card->hasKeyword('any') && !$cur_card->hasKeyword('Holy') && $cur_card->getRarity() == 'Common') {
        $storage[] = $i;
      }
    }
    if (count($storage) > 0) {
      shuffle($storage);
      for ($i = 0; ($i < count($storage)) && ($i < $count); $i++) {
        $cur_pos = $storage[$i];
        $t->setCard('his', $cur_pos, $t->drawCard($t->getList(['rarity'=>'Common', 'keyword'=>'Holy']), $t->hisData()->Hand, $cur_pos, 'drawCardList'));
      }
    }