Skip to content

Instantly share code, notes, and snippets.

@brine
brine / brineshuffle.txt
Created March 14, 2012 22:51
brine's quantum shuffling
OK so as discussed in the chat, this is a rather unconventional "shuffle" method based on the classic
"marbles in a bag" mathematics problem. I'm not a pro at cardidentity and the various card model types so
you'll need to fill in the blanks on that aspect :)
All card piles in OCTGN will consist of two components: an empty ordered list I'll dub 'the Pile' and an
unordered group consisting of all the cards in the deck which I'll call 'the Bag'.
When you load your deck, OCTGN assigns its identity/model/whatever to all cards in the deck (as normal),
then dumps the cards into the bag. The Pile starts out as an empty list with an index equal to the number
of cards you loaded. The empty objects in the Pile represent individual cards whose identity is unknown to
@brine
brine / tags.xml
Created April 17, 2012 00:26
MTG autoscript tag submit form
<?xml version="1.0" encoding="utf-8"?>
<tags>
<classes>
<class name="initcast">
<action name="cost" />
<action name="token" />
<action name="marker" />
<action name="smartmarker" />
<action name="highlight" />
<action name="tapped" />
@brine
brine / welcome.html
Created May 10, 2013 21:21
Games Feed Welcome Page
<div id="accordion">
<h3>Section 1</h3>
<div>
<p>
Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer
ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit
amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut
odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.
Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer
ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit
@brine
brine / gist:5679952
Last active December 17, 2015 22:09
1. paste this def below in the dev console
def setup(group):
starting = group[0]._id
count = 0
group.shuffle()
for c in group:
c.moveToTable(c.width()*(c._id - starting), c.height()*count)
count += 1
@brine
brine / gist:5861740
Created June 25, 2013 19:46
bunch of quick stuff to fix
918 player summary tab hard to read
113 hide marker count when n = 1
021 right-click menu accessible in pile view windows
??? figure out why shuffling takes so freakin long after viewing the pile
631 allow players to add more packs to a sealed pool
??? allow players to choose different sealed packs than other players
114 rapidly clicking on counters or manipulating markers suffers from lag
143 allow game def to assign card/group functions to cards you dont control
159 manually edit number of markers on a card via clicking the number
919 sealed editor - hide sets that dont have sealed packs
@brine
brine / gist:5864619
Created June 26, 2013 03:47
save states
def saveState():
mute()
playerList = []
for p in players:
playerList.append(p.name)
saveState = "|".join(playerList) + "\n"
counterList = []
for counter in me.counters:
counterList.append(str(me.counters[counter].value))
saveState += "|".join(counterList) + "\n"
@brine
brine / gist:6428912
Last active December 22, 2015 06:09
mechanical shuffles
def riffleShuffle(group, x = 0, y = 0):
mute()
deck = []
for c in group:
deck.append(c) ##loads the deck contents into a list
topChunk = deck[:len(deck)/2] ##Grabs the top half of the deck
bottomChunk = deck[len(deck)/2:] ##Grabs the bottom half of the deck
deck = [] #This'll be the new deck stack
while len(bottomChunk) > 0: ##keep looping as long as there's still cards
deck.insert(0, bottomChunk.pop()) ##The bottom of the chunk gets added to the top of the deck
@brine
brine / scry hard
Last active December 25, 2015 03:58
scry hard 2: scry harder
def scry(group = me.Library, x = 0, y = 0, count = None):
mute()
if count == None:
count = askInteger("Scry how many cards?", 1)
topCards = group.top(count)
buttons = [] ## This list stores all the card objects for manipulations.
for c in topCards:
c.peek() ## Reveal the scryed cards to python
buttons.append(c)
topList = [] ## This will store the cards selected for the top of the pile
@brine
brine / UFS
Created December 5, 2013 07:06
UFS updated proxygen
<?xml version="1.0" encoding="utf-8" ?>
<templates>
<blocks>
<block type="overlay" id="backAction" src="proxy/backAction.png">
<location x="0" y="0" />
</block>
<block type="overlay" id="backAsset" src="proxy/backAsset.png">
<location x="0" y="0" />
</block>
<block type="overlay" id="backAttack" src="proxy/backAttack.png">
@brine
brine / gist:8967794
Created February 13, 2014 01:05
octgn updates
Update Release Notes
Spectator Support
- Players can join in-progress games as a spectator
- As a spectator, you can see everything that is visible by everyone, any hidden information will be kept hidden
- Players can be set as a spectator in the pre-game lobby
- Spectators may participate in the game chat
- The host player can mute spectators.
Host Options