In Magic The Gathering cards cost mana to play, which can be drawn from "land" cards (Swamps, Mountains, Forests, Islands, Plains). Some cards require specific land cards only, specific lands and colorless, or simply colorless. Colorless means you can use any type of land. For instance, if you need 1 Mountain and 1 Colorless, you must tap at least 1 Mountain, and 1 of any other type of land (including Mountains!) to play the card.
How would I go about coding this in BYOND, preferably the most easiest and noob-programmer friendly way? The way I was going to code it is varibles such as mob/var/swamplands, etc, etc, with mob/var/landtotals and subtracting the swamplands.. and then checking to see if landtotals are positive, etc, etc, but that is WAY too amatuer.
ID:161869
Mar 22 2008, 1:23 pm
|
|
In response to SeijiTataki
|
|
What I have so far:
mob Let's say they need 1 mountain to play the card: mob Let's say you need 2 mountains and 1 colorless: play_card_two_mountain_one_colorless() And perhaps for mana burn: proc I figured I'd post it for someone who actually does code. Thank you for the suggestions, they've made it clear how I could code this. :) Let's use a card for example: Play_Sage_Owl() Works for me! I've tried no lands, two swamps, different lands and it works as expected and according to rule. Mana burn works properly; I don't see any problems I might run in to, do you? I might need to transfer legimate spent mana to another variable so the player can only use the tapped mana once. :P |
In response to Siientxx
|
|
In terms of magic the gathering, mana burn doesn't take effect unless you've ended your turn with extra mana in the pool.
As a result of this, you should actually check for mana burn when the player ends their turn, instead of each casting. Because, for example, a strategic advantage of magic can be tapping more lands than is needed for a particular spell - that way your opponent doesn't know exactly how much mana your spell that's being cost actually costs. You're also not tracking the mana used, which is why you've some concern about using a land more than once. Though, how you'd like to check for that is dependant on how you're setting up the actual card useage interface. |
In response to Siientxx
|
|
Thats a very bad way to go about it. Make cards into datums, give them a costs list of some sort, and then make procedures to both count the amount of mana a player has and tap a specific amount of mana.
|
You'd be looking for some kind of action to tap the lands, first.
Input: Either Click Event or a Verb
Casting a Spell:
Player Has paid mana, and wishes to finalize the spell cast. Click a prompt to attempt to cast:
End Phase
So in this case, you'd need the following values tracked:
blackmana
redmana
greenmana
bluemana
whitemana
This tracks your current mana values, and will go up/down as you track mana taps and costs.
Then, for spell casting:
blackcost
redcost
greencost
bluecost
whitecost
colorlesscost
blackused
redused
greenused
blueused
whiteused
This tracks the cost value of the spell queried for cost, and then the amount you're allocating. You'd just do a check of mana used, versus mana cost to confirm the spell requirements are met - and then again compare used to available totals, to make sure you have that much mana to begin with.
Then when you have X cost spells, you'd use the colorless cost.