Skip to content

Instantly share code, notes, and snippets.

@tomspilman
Created January 12, 2013 00:08
Show Gist options
  • Save tomspilman/4515095 to your computer and use it in GitHub Desktop.
Save tomspilman/4515095 to your computer and use it in GitHub Desktop.
_root = new Sequence
{
Call.Void( () => { Program.MineCycles++; Say("Walking to the mine!"); } ),
Wait.Seconds( 2 ),
Call.Void(() => Say("Entering the mine!")),
Wait.Seconds( 1 ),
new While( IsNotFatigued )
{
Wait.Seconds( 3 ),
Call.Void(() => ++_fatigue),
new If(() => _injector.Resolve<Random>().NextDouble() < 0.2)
{
Call.Void( () => ++_goldCarried ),
Call.Void( () => Say("Got {0} nuggets!", _goldCarried) ),
}
},
Call.Void( () => Say("Exiting the mine with {0} nuggets!", _goldCarried) ),
Wait.Seconds( 1 ),
Call.Void( () => Say("Walking home!") ),
Wait.Seconds( 3 ),
Call.Void( () => Say("Back at the shack!") ),
Wait.Seconds( 2 ),
Call.Void( () => Say("Dumping {0} nuggets!", _goldCarried) ),
Wait.Seconds( 1 ),
Call.Void( () => _goldCarried = 0 ),
// Tired?
new If( NeedsSleep )
{
Call.Void( () => Say("Going to sleep!") ),
Wait.Seconds( 2 ),
// Sleeping!
new While( NeedsSleep )
{
Call.Void( () => Say("ZZZZZZZ...") ),
Wait.Seconds( 1 ),
Call.Void( () => _fatigue-- ),
},
Call.Void( () => Say("Waking up!") ),
},
Call.Void( () => Say("Getting ready to mine!") ),
Wait.Seconds( 2 ),
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment