Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 26th, 2012  |  syntax: None  |  size: 0.76 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. function Card(cardName, cardType) {
  2.     this.cardName = cardName;
  3.     this.cardType = cardType;
  4.     this.manaCost = new Mana();
  5.     this.tapped = false;
  6.     this.summonSickness = false;
  7.     this.power = 0;
  8.     this.toughness = 0;
  9.     this.owner = null;
  10.     this.player = null;
  11.     this.abilities = [];
  12. }
  13.  
  14. Card.prototype.tap = function() {
  15.     this.tapped = true;
  16. };
  17.  
  18. Card.prototype.untap = function() {
  19.     this.tapped = false;
  20. };
  21.  
  22. Card.prototype.convertedManaCost = function() {
  23.     return this.manaCost.total();
  24. };
  25.  
  26. function Swamp() {
  27.     Card.apply(this, 'Swamp', 'Land');    
  28. }
  29.  
  30. Swamp.prototype.tap = function() {
  31.     this.tapped = true;
  32.     this.player.manaPool.black++;
  33. };
  34.  
  35. Swamp.prototype.untap = function() {
  36.     this.tapped = false;
  37.     this.player.manaPool.black--;
  38. };