After cloning the repository,
Right click project, and add reference. Then on the side select browse, and add the following dll. %ProgramFiles%\Microsoft Visual Studio 10.0\PreEmptive Solutions\Dotfuscator Community Edition\PreEmptive.Attributes.dll

Then General Information for the program can be found here. The general flow of the program can be found here. Below general variables and enumerations are listed and described.
Mana Format (ManaTypes):
/*Mana Array Aranged in the following Order:
* [Colorless,White,Blue,Black,Red,Green] */

Card Types (CardTypes):
/* Card Type int definitions:
* 0-Artifact
* 1-Creature
* 2-Enchantment
* 3-Instant
* 4-Land
* 5-Planeswalker
* 6-Sorcery
* 7-Tribal */

Players (Players):

Target Array (TargetLocations):
The target array for isPlayable is set up in the following way. The first entry shall specify the current location of the card. Then all target cards will be specified by there location first, then in the next entry their location in the array containing where in that location the card is. The card locations are defined as follows: (Current Player indicates the player who played the card, not whos turn it is).
0-The Stack
1-Current Player's Hand
2-Current Player's Field
3-Current Player's Graveyard
4-Current Player's Exiled
5-Opponent's Hand
6-Opponent's Field
7-Opponent's Graveyard
8-Opponent's Exiled
(Please note this means that the target array with allways have an odd number of entries.)

Pass Priority / Resolve Stack Button:
If a player passes priority, and the other permits then passes priority without playing a card the top card on the stack gets resolved.

Current Location (Current Locations):
(0-deck, 1-hand, 2-stack, 3-field, 4-graveyard, 5-exiled)

Special Effects:
Two list, a list of triggering abilities (run often), and a set of activated ability (user input needed, unless a triggering abilty trigger active ability). Note that card movement (except being placed on stack) is handled by triggering special effects. These will generally have the string Mov in them to indicate they move the card around.
Activating Special Effects:
The card will first be placed on stack! Then it is checked to see it can be placed on stack, and if not removed from the stack. This is done in the case that it can be done, but it does not use the stack, the card will return true from its special effect and have removed itself from the stack. (Must also update the stackE to know what ability went on stack).

Parts of a Turn:
Beginning Phase (3):
Untap Step
Upkeep Step
Draw Step
First Main Phase (1):
First Main Step
Combat Phase (5):
Beginning of Combat
Declare Attackers
Declare Blockers
Combat Damage
End of Combat
Second Main Phase (1):
Second Main Step
Ending Phase (2):
End Step
Clean Up Step

Longer Description for the parts of a Turn:
Beginning phase
The beginning phase is composed of three parts, or "steps." The first thing a player does is untap all cards he or she controls in the "untap step." Then, any abilities that trigger on the "upkeep step" happen. These often include cards that require mana payments every turn. Then the player draws a card in the "draw step." In two-player games, the player who takes the first turn does not draw a card for that turn.
No player receives priority during the untap step, meaning that no cards or abilities can be played at that time. During the upkeep and draw steps, however, players can cast instants and activate abilities as normal.
First main phase
Most of the game's actions happen during the main phase. With the exception of instants and creature cards with flash, most cards can only be played or cast during a player's main phase.
Combat phase
The combat phase is split into five steps. It represents a point in the magical duel where the active player sends his or her creatures to attack the opposing player, in the hopes of doing damage to the player or the player's creatures. Except for instants, players may not cast spells during combat. Instants and activated abilities, however, may be cast or activated during each step.
Beginning of combat
Nothing normally happens in the beginning of combat step: this step only exists to allow players to cast spells and activate abilities that may alter how combat progresses. For example, only untapped creatures may attack, so the defender might cast an instant or activate an ability that will tap a creature, preventing it from attacking.
Declare attackers
The player whose turn it is declares which creatures he or she controls will attack the opponent, and/or a planeswalker, directly. In most cases, creatures that are tapped, or that entered the battlefield this turn (have "summoning sickness") may not attack; attacking causes a creature to become tapped.
Declare blockers
Once the attacking player declares attackers, the defending player chooses which creatures he or she will block with. A creature must be untapped in order for it to block. Unlike attacking, the act of blocking does not cause the blocking creatures to tap, and creatures with summoning sickness can block. Each creature can only block a single attacker, although multiple creatures can be used to block a single attacking creature. In this case, the attacker orders the blocking creatures. The ordering becomes relevant in the combat damage step.
Combat damage
Attacking creatures that weren't blocked deal damage equal to their power to the player(s) or planeswalker(s) they attacked; the amount of damage dealt is deducted from the player's life total or the planeswalker's loyalty counters. Attacking creatures that were blocked deal damage equal to their power to the creature or creatures that blocked them, and blocking creatures deal damage equal to their power to the attacking creature they blocked. If a creature is blocked by multiple creatures, the player that controls the attacking creature must choose how he or she assigns the damage to the defending creatures. An attacker that is blocked, but whose blocker is removed from combat before this step, stays blocked and deals no combat damage. If a creature is dealt damage equal to or greater than its toughness, it is destroyed and is put into its owner's graveyard.
If creatures with first strike or double strike are involved in combat, an extra combat damage step is created, and their damage is dealt first. If a creature without first strike is destroyed by first strike damage, it will not deal combat damage afterward.
End of combat
Like the beginning of combat, nothing normally happens during this step. Players have a chance to cast instants and activate abilities after combat, but before the main part of the player's turn starts again.
Second main phase
After the combat phase there is another main phase, identical to the first.
Ending phase
The ending phase has two steps: "end step" and "cleanup". During the end step, abilities that trigger "at the beginning of the end step" go on the stack. This is normally the last chance players have to cast instants or activate abilities this turn.
Then, during the cleanup step, the player whose turn it is discards down to his or her maximum hand size, normally seven cards. Effects that last "until end of turn" or "this turn" wear off, and all damage is removed from creatures still on the battlefield.

Last edited Jun 22, 2012 at 4:32 AM by technaj, version 10


No comments yet.