Magic the Gathering PBEM system From: pmeyers@omnifest.uwm.edu (Philip G. Meyers) Date: Sun, 21 Apr 1996 00:00:00 +0000 A SYSTEM FOR PLAYING MAGIC BY EMAIL WITH NO REFEREE We've been running play by email games of Magic on our local system for about a year, but up to now one player has served as referee, sending the players their card draws. Here's a system for playing Magic or similar card games with a friend via internet without a referee. Each player comes up with a deck and runs it through a pair of simple computer programs. The first one randomizes the cards, assigns a number to each card, and prints out a card list by number. For example, you input a new deck by creating a plain/ascii text file in the form: *** 20 swamp 4 hypnotic spectre 4 dark ritual 4 sengir vampire 4 drain life 4 terror *** The first 2 characters for each card entry must be either numbers or spaces, and will be read in as the number of copies of that card in the deck. The card name then follows. Be sure to use ***'s before and after. The first program reads this text file in, shuffles it, and assigns a number to each card to create a text file such as follows: 40 Your key number is 3001 1 - swamp 2 - hypnotic spectre 3 - dark ritual 4 - swamp ... (etc. for 5 to 39) 40 - drain life The lead number is the number of cards, and the third entry is your key number. The second program reads in this file and codes it as a long column of numbers. The coding algorithm is a simple one that depends on the Qbasic randomize function, and will yield the same result between different PC's (conduct a compatibility trial using dummy decks before you start play if you wish.) It prints a text file of the card list in encrypted (coded)form using the key (random number seed) selected by the player. The player uploads and sends the coded card list to the opponent and tells the opponent the total number of cards in the deck, but does not give the opponent the key. The opponent does the same thing, so that the players have exchanged coded lists. Both players have the same coding and decoding programs. When it is player #1's turn to draw a card, player #2 tells player #1 which card number to draw. Thus, player 2 knows that player 1 has a 65 card deck, and tells player 1 that #1's opening hand is 2, 11, 20, 22, 40, 56, 62 and his first draw is 14. This prevents player 1 from knowing what he or she will draw in advance. As in a bingo game, each player must keep track of numbers already called. This can be done as part of the turn message as shown below. During play, requirements for reshuffling the deck are ignored. Likewise, cards that require altering the library directly may be troublesome and you may want to not use them. For the jester cards and feldon's cane, players may need to reexchange lists using altered decks to carry out the effects of the spell. For a card like demonic tutor, player #1 takes the selected card out of his or her deck and tells the opponent the card number so that it won't be called in future. In a jester's cap situation, the opponent gets to see the original list with the ***'s, edited by cards already in play, NOT the one where numbers have been assigned. When the game ends, the player's exchange keys and run the encoded lists they received at the start of the game through the decoding program. Any cheating that might have gone on is then revealed, and the apparent winner forfeits the game if cheating is detected. Hopefully this encourages players to be honest, and reassures a losing player that the opponent really was lucky enough to get a black lotus, sol ring and juzam djinn on the first turn. Players will need to maintain and send each other a status report showing what cards have been played. One player can do this for both/all by creating a summary that gets edited every time a card is played. Once created, it's pretty easy to alter and resend the summary using the email reply/resend/forward functions, getting rid of those >'s if necessary. Here is a sample turn summary: (Message Beast to Rogue:) You draw 19 GAME # 6 Round 6 Rogue's Turn ************************************************* PLAYER # 1 - Rogue Life = 20 CARDS IN HAND: 4 IN PLAY: Swamp-T Swamp-T Swamp-T Swamp Strip Mine Will O' The Wisp Hypnotic Spectre Royal Assassin GRAVEYARD: Vampire Bats OPPONENT NUMBERS CALLED: 1 5 11 12 19 21 26 32 35 40 41 44 56 ************************************************* PLAYER # 2 - Beast Life = 16 CARDS IN HAND: 2 IN PLAY: Scrubland Plain-T Swamp-T Swamp-T Plain-T Black Knight Order of Leitbur Black Knight Bad Moon Knight of Stromgald GRAVEYARD: Dark Ritual OPPONENT NUMBERS CALLED: 2 4 6 12 17 18 22 24 36 42 48 50 56 60 ************************************************* Use -T or brackets around the card name, if you prefer, to show a tapped card. Use notes in parentheses to show counters or enchantments on another card: Thallid (4 counters) Vampire Bats (Unholy Strength) RULES FOR MAGIC: THE GATHERING BY E-MAIL This allows you to play a game of Magic without having to be in the same place at the same time as your opponents, and without wear and tear on your cards. Except as listed below, the E-mail game uses the most recent rules in the Magic: The Gathering Pocket Players Guide. DECKS Type I or Type II tournament rules apply for kinds and numbers of cards. Players agree in advance whether they wish to play Type I or Type II rules. Obviously, there is no ante in PBEM games, and you don't need to own a card to use it, as long as you know its description. If a player will be gone for a while, he or she should let the opponent(s) know. Otherwise, if a player doesn't respond in 7 days, it will be assumed the player has resigned and the game goes on (if more than 1 player remains) or ends. STARTING THE GAME The game begins with each player exchanging coded decks and opening hand and draw numbers as described above. One player prepares the starting summary and sends it to the other. ORDER OF PLAY After each stage in the turn sequence players have the chance to use fast effects. For example: 1) Untap, upkeep and draw a card 2) You play a land card, and cast any sorceries, summons, enchantments or artifacts. You send this action to the other player(s). *FAST EFFECTS* 3) You announce your attack, assigning attacking creatures, and send message to other player(s). *FAST EFFECTS* 4) Opponent(s)assign blockers, respond by message back. *FAST EFFECTS* 5) Damage is declared by the attacker; this is tentative because fast effects can change the result. *FAST EFFECTS* 6) You cast post-attack sorceries, summons, enchantments or artifacts. *FAST EFFECTS* 7) Announce discard, if needed; announce your turn is over by a message to other player(s) saying "Done". Send draw number to other player. You can of course cast fast effects during any of the phases of your own turn, in addition to using them to counter what your opponent is doing in a *FAST EFFECTS* phase. FAST EFFECTS Whenever a fast effect is possible, other players may cast fast effects by the e nd of the next day following your message. In other words, if you announce your attack on 2/25/95, your opponent has until the end of 2/26/95 to respond with fast effects. If he does respond on 2/26, then you have until 2/27 to counter, and so on until no one responds; then that fast effects phase is over. One day is a short deadline, and players can agree on a longer deadline if they prefer. Apart from fast effects, each player otherwise has 7 days to make a response, but should try to respond within 3 days if possible. As a practical matter, there will be at least two days between each phase of your turn. In the event of time zone differences, the date of arrival controls. GENERALS RULES Six players, three per team. Each team is one general and two flanks. Generals start with 30 life, flanks with 20. The winning team is the first to eliminate the opposing general. At the start, direct creature attacks can only be made between flanks sitting next to each other: LF . RF G1 . G2 RF . LF Flanks are left vs. right, right vs. left. Generals cannot attack or be attacked by creatures until one or more flanks are eliminated. Once a flank is eliminated, the winning flank can then attack the enemy general directly, and the general can attack him. Circles of protection are not allowed due to the time these take. The general can look at the cards in the hands of his flanks and give advice on what to play, but one flank cannot see the other's cards. For convenience, each general can be the keeper of deck lists for all three players on that team, and sends card draws to his flanks when required based on numbers provided by the other general. This makes it easier for the general to keep track of the game. A general may take a turn for one of his flanks if the flank is absent or hasn't responded to mail within 3 days. A general can use a fast effect of one of his flanks within the time limit one of his flank's hasn't responded. When a player takes a turn, the message may be sent to all players, or just to the player's general, who then posts it to all players. This allows for most of the PBEM busy work to be done by the generals if the flanks are less experienced with e-mail. The general can pass a creature to a flank in lieu of attacking with that creature, and a flank can likewise send a creature back to the general. Passing does not tap the creature. The creature is remains under its owner's control. Listings of cardfile, coding and decoding programs in the Qbasic language (comes with MS-DOS) follow. The programs could be entered into Visual Basic with very few changes, and a list generated in Qbasic can be decoded using a Visual Basic program. However, it is essential that the three programs be kept separate and not combined into one, because the coding and decoding programs depend on synchronized random number sequences. HINTS FOR USING QBASIC Load this entire message into Qbasic (save it as a .BAS file first). Use shift-down arrow to highlight text, then [del] to block delete. By loading the message 3 times, you can then selectively delete at the clip here marks to save the three programs. You can also use Qbasic to create the deck file, but remember it will give it a .bas extension. If you use a word processing program to create the text file, remember to save as plain or ascii text. Please copy and edit these programs as needed; they are shareware. You might, for example, want to have several key numbers instead of one. **** CLIP HERE **** 'Qbasic cardshuffler - CARDFILE.BAS shareware by Phil Meyers DIM SHARED CENTRY(100) AS STRING 'text as entered in deck DIM SHARED CDS(120) AS STRING 'text as printed to card list CLS 'Read in deck information INPUT "Name of deck file"; NI$ OPEN NI$ FOR INPUT AS #1 DO INPUT #1, x$ LOOP UNTIL x$ = "***" DO INPUT #1, x$ CN = CN + 1 CENTRY(CN) = x$ LOOP UNTIL x$ = "***" CLOSE FOR x = 1 TO CN C$ = CENTRY(x) CNUM = VAL(LEFT$(C$, 2)) C$ = RIGHT$(C$, LEN(C$) - 2) C$ = LTRIM$(C$) C$ = RTRIM$(C$) FOR Y = 1 TO CNUM cdn = cdn + 1 CDS(cdn) = C$ PRINT CDS(cdn) NEXT NEXT PRINT cdn; "cards" 'Shuffle cards and assign numbers INPUT "Key number (1 to 32000)"; RN RANDOMIZE RN M = 17 * cdn FOR x = 1 TO M Q1 = INT(RND(RN) * cdn) + 1 Q2 = INT(RND(RN) * cdn) + 1 N$ = CDS(Q1) CDS(Q1) = CDS(Q2) CDS(Q2) = N$ NEXT 'show and save as text file CLS PRINT "Order of appearance:" OPEN "mycards.txt" FOR OUTPUT AS #1 PRINT #1, cdn PRINT #1, "Your key number is " PRINT #1, RN FOR x = 1 TO cdn PRINT x; " - "; CDS(x) PRINT #1, x; " - "; CDS(x) IF INT(x / 20) = x / 20 THEN DO x$ = INKEY$ LOOP UNTIL x$ <> "" END IF NEXT CLOSE END **** CLIP HERE **** 'Second program CODE.BAS - encodes deck file 'Shareware by Phil Meyers, 1996 DIM CENTRY(100) AS STRING 'text as entered in deck DIM CDS(120) AS STRING 'text as printed to card list OPEN "MYCARDS.TXT" FOR INPUT AS #1 OPEN "MYCARDS.COD" FOR OUTPUT AS #2 INPUT #1, cdn INPUT #1, D$ INPUT #1, D$ K = VAL(D$) RANDOMIZE K PRINT #2, cdn FOR x = 1 TO cdn INPUT #1, CDS(x) L = LEN(CDS(x)) w$ = "" FOR Y = 1 TO L R = INT(RND * 15) - 7 Z = ASC(MID$(CDS(x), Y, 1)) + R PRINT #2, Z PRINT Z; NEXT R = INT(RND * 15) - 7 PRINT #2, ASC(CHR$(13)) + R NEXT CLOSE PRINT "Coded deck saved as mycards.cod." END **** CLIP HERE **** 'Third program - decode a coded deck, if you know the key number 'Shareware by Phil Meyers DIM SHARED cdn AS INTEGER 'number of cards in current player deck DIM SHARED CENTRY(100) AS STRING 'text as entered in deck DIM SHARED CDS(120) AS STRING 'text as printed to card list CLS INPUT "Enter the name of the file to decode, or [ret] for mycards.cod"; f$ IF f$ = "" THEN f$ = "mycards.cod" OPEN f$ FOR INPUT AS #1 INPUT "Enter key for this file"; K RANDOMIZE K OPEN "UNCODE.TXT" FOR OUTPUT AS #2 INPUT #1, cdn PRINT cdn DO INPUT #1, CN R = INT(RND * 15) - 7 w$ = CHR$(CN - R) PRINT #2, w$; PRINT w$; LOOP UNTIL EOF(1) CLOSE PRINT PRINT "Done - decoded file has been printed to uncode.txt." DO LOOP UNTIL INKEY$ <> "" END **** CLIP HERE **** Copyright 1996 Philip Meyers. Permission given to copy and use for personal use only. Up