Skip to content

Commit

Permalink
Scrap documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Francis Veilleux-Gaboury committed Jul 23, 2015
1 parent 4903ff3 commit 74a412d
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions extra-resources/mods/scrap.groovy
Expand Up @@ -23,26 +23,30 @@ onCard('creature') {entity, args ->

rules {
action('Scrap') {
allowFor {
ownedBy 'active'
zone 'Battlefield'
allowFor { // allow only if...
ownedBy 'active' // ...card owned by active player
zone 'Battlefield' // ...card is present on Battlefield
}
requires {
require card.sickness == 0
require card.attack_available > 0
require card.scrap > 0
requires { // requiring...
require card.sickness == 0 // ...card not having sickness this turn
require card.attack_available > 0 // ...card having attack_available this turn
require card.scrap > 0 // ...card having a SCRAP value
}

perform {
card.owner.scrap += card.scrap
card.destroy()
perform { // perform upon Scrap action:
card.owner.scrap += card.scrap // add card's SCRAP value to the player's SCRAP stockpile
card.destroy() // destroy the scrapped card
}
}

// 1) this action costs SCRAP to play
// 2) the value it costs is equal to scrap_cost value of the card
// 3) card.owner indicates that the card's owner should pay this cost
action('Enchant') {
cost SCRAP value { card.scrap_cost } on { card.owner }
}

// 1) this action costs SCRAP to play
// 2) the value it costs is equal to scrap_cost value of the card
// 3) card.owner indicates that the card's owner should pay this cost
action('Use') {
cost SCRAP value { card.scrap_cost } on { card.owner }
}
Expand Down

0 comments on commit 74a412d

Please sign in to comment.