Skip to content

Instantly share code, notes, and snippets.

import random
import copy
#vars
INITIAL_DEPTH = 0
ITERATIONS = 100
#functions
$(document).ready(function() {
$(document).keyup(function(event) {
// check if we're in any sort of text-entry or other modal context
if ($('.sm_alert').css('display') == 'block')
return;
if ($('.sm_markerPanel').css('display') == 'block')
return;
if ($('input,textarea').is(':focus'))
return
// we're good!
@zephjc
zephjc / gist:6357499
Last active December 21, 2015 19:58
cross-location property access

Overview:

Add cross-location property access with a wrapper around the "setfocus" function with new global function "realmfocus", which takes two arguments: the other location's key, and the key for the text property to setfocus.

This is a handy way of being able to compartmentalize descriptions by effectively namespacing them.

The actual copied value is set as a player attribute to avoid multiple users overwriting each others' current setfocus string.

Usage:

@zephjc
zephjc / gist:6349198
Last active December 21, 2015 18:39
Faked Intra-location moving/state
desc - Text
[[conditional_desc()]]
===
counter - Value
0
===
conditional_desc - Code
if counter == 0:
return text(desc_off)
elif counter == 1:
@zephjc
zephjc / CharacterMotorC.cs
Created May 24, 2013 05:58
Fixed C# replacements of CharacterMotor.js and FPSInputController.js via http://forum.unity3d.com/threads/93527-FPSInputController-and-CharacterMotor-in-Csharp Changes from above link: FPSInputController: Removed "Event.laddertrigger" code which is not part of the original JS file CharacterMotor: Lets the various inner properties classes show up…
using UnityEngine;
using System.Collections;
//#pragma strict
//#pragma implicit
//#pragma downcast
// Require a character controller to be attached to the same game object
// I had to initally comment out the following RequireComponent
// line to make it compile and allow attaching to my Main Camera;
@zephjc
zephjc / mtg-alt-styles
Created February 28, 2013 06:19
Magic: The Gathering - alternate play styles
+---------------------------------------------------------------------------+
| Magic: The Gathering - Alternate Play Styles |
+---------------------------------------------------------------------------+
The purpose of these two alternate styles is to create a more interactive and
less cut-throat game that all players can play until the end of the game.
+---------------------------------------------------------------------------+
| RACE TO THE TOP |
+---------------------------------------------------------------------------+