Created
January 16, 2012 02:59
-
-
Save anonymous/1618812 to your computer and use it in GitHub Desktop.
grom358 - MtG
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Card(cardName, cardType) { | |
| this.cardName = cardName; | |
| this.cardType = cardType; | |
| this.manaCost = new Mana(); | |
| this.tapped = false; | |
| this.summonSickness = false; | |
| this.power = 0; | |
| this.toughness = 0; | |
| this.owner = null; | |
| this.player = null; | |
| this.abilities = []; | |
| } | |
| Card.prototype.tap = function() { | |
| this.tapped = true; | |
| }; | |
| Card.prototype.untap = function() { | |
| this.tapped = false; | |
| }; | |
| Card.prototype.convertedManaCost = function() { | |
| return this.manaCost.total(); | |
| }; | |
| function Swamp() { | |
| Card.apply(this, 'Swamp', 'Land'); | |
| } | |
| Swamp.prototype.tap = function() { | |
| this.tapped = true; | |
| this.player.manaPool.black++; | |
| }; | |
| Swamp.prototype.untap = function() { | |
| this.tapped = false; | |
| this.player.manaPool.black--; | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment