//   FILE: Original Tetris v7.2DP.tws
// SOURCE: Original Tetris v7.2DP
//   DATE: Wed, Oct 31, 2001  12:37:05 PM


GeneralInfo
{
	PlayfieldColumns 10
	PlayfieldRows 20
	MaxMovementsPerSecond 10
	MaxRotationsPerSecond 5
	GameType Marathon
	RemoveFromBagAfterUse
	NextPieceQueueSize 8
}

MinoSticky
{
	NotStickyBetweenPieces
	1: 1
	2: 2
	3: 3
	4: 4
	5: 5
	6: 6
	7: 7
}

Mino
{
	Name "Brackets"
	Tags 0,1
}

Tetramino
{
	Name "T Tetrimino"
	NumberInBag 1
	ID 1
	MinoList
	{
		"Brackets" (-1,0)
		"Brackets" (0,0)
		"Brackets" (1,0)
		"Brackets" (0,-1)
	}
	Rot0CWOffsetList (0,0)
	Rot90CWOffsetList (0,0)
	Rot180CWOffsetList (0,0)
	Rot270CWOffsetList (0,0)
}

Tetramino
{
	Name "J Tetrimino"
	NumberInBag 1
	ID 2
	MinoList
	{
		"Brackets" (-1,0)
		"Brackets" (0,0)
		"Brackets" (1,0)
		"Brackets" (1,-1)
	}
	Rot0CWOffsetList (0,0)
	Rot90CWOffsetList (0,0)
	Rot180CWOffsetList (0,0)
	Rot270CWOffsetList (0,0)
}

Tetramino
{
	Name "L Tetrimino"
	NumberInBag 1
	ID 3
	MinoList
	{
		"Brackets" (-1,0)
		"Brackets" (0,0)
		"Brackets" (1,0)
		"Brackets" (-1,-1)
	}
	Rot0CWOffsetList (0,0)
	Rot90CWOffsetList (0,0)
	Rot180CWOffsetList (0,0)
	Rot270CWOffsetList (0,0)
}

Tetramino
{
	Name "S Tetrimino"
	NumberInBag 1
	ID 4
	MinoList
	{
		"Brackets" (0,1)
		"Brackets" (1,1)
		"Brackets" (-1,0)
		"Brackets" (0,0)
	}
	Rot0CWOffsetList (0,1)
	Rot90CWOffsetList (1,0)
	Rot180CWOffsetList (0,0)
	Rot270CWOffsetList (0,0)
}

Tetramino
{
	Name "Z Tetrimino"
	NumberInBag 1
	ID 5
	MinoList
	{
		"Brackets" (-1,1)
		"Brackets" (0,1)
		"Brackets" (0,0)
		"Brackets" (1,0)
	}
	Rot0CWOffsetList (0,1)
	Rot90CWOffsetList (0,0)
	Rot180CWOffsetList (0,0)
	Rot270CWOffsetList (-1,0)
}

Tetramino
{
	Name "I Tetrimino"
	NumberInBag 1
	ID 6
	MinoList
	{
		"Brackets" (-1,0)
		"Brackets" (0,0)
		"Brackets" (1,0)
		"Brackets" (2,0)
	}
	Rot0CWOffsetList (0,0)
	Rot90CWOffsetList (0,0)
	Rot180CWOffsetList (0,0)
	Rot270CWOffsetList (0,0)
}

Tetramino
{
	Name "O Tetrimino"
	NumberInBag 1
	ID 7
	MinoList
	{
		"Brackets" (0,0)
		"Brackets" (1,0)
		"Brackets" (0,-1)
		"Brackets" (1,-1)
	}
	Rot0CWOffsetList (0,0)
	Rot90CWOffsetList (-1,0)
	Rot180CWOffsetList (-1,1)
	Rot270CWOffsetList (0,1)
}

Pattern
{
	Name "Line clear"
	Tags 0
	Method Search
	SearchType Horizontal
	SearchCount 10
	PatternMinoScript
	{
		kill mino
	}
}

Level
{
	Name "Level #1"
}

Level
{
	Name "Level #2"
}

Level
{
	Name "Level #3"
}

Level
{
	Name "Level #4"
}

Level
{
	Name "Level #5"
}

Level
{
	Name "Level #6"
}

Level
{
	Name "Level #7"
}

Level
{
	Name "Level #8"
}

Level
{
	Name "Level #9"
}

Level
{
	Name "Level #10"
}

Level
{
	Name "Level #11"
}

Level
{
	Name "Level #12"
}

Level
{
	Name "Level #13"
}

Level
{
	Name "Level #14"
}

Level
{
	Name "Level #15"
}

GenerationPhase
{
	GenerationTime 0.22 - (level-1) *.017
	PieceStartingLocation (4,0)
	GenerationBeginScript
	{
		set pf.d0 to 24 + (level -1) * 3
	}
	GenerationEndScript
	{
		set st0.d4 to st0.d4 + 1
	}
}

FallingPhase
{
	FallSpeed 0.22 - (level-1) *.017
	SoftDropSpeed 0
	HardDropSpeed 0.0001
	MoveTolerance 1
}

LockPhase
{
	Duration .5
}

PatternPhase
{
}

IteratePhase
{
}

EliminatePhase
{
	FallSpeed 0
	LineCollapsedScript
	{
		set ph.d0 to ph.d0 + 1
	}
	EliminateEndScript
	{
		if ph.d0 = 1
			set st0.d0 to st0.d0 + 1
		end
		if ph.d0 = 2
			set st0.d1 to st0.d1 + 1
		end
		if ph.d0 = 3
			set st0.d2 to st0.d2 + 1
		end
		if ph.d0 = 4
			set st0.d3 to st0.d3 + 1
		end
	}
}

SolidifyPhase
{
}

GravityPhase
{
	FallSpeed 0
}

CompletionPhase
{
	CompletionBeginScript
	{
		score pf.d0
		if lines >= goal
			next level
		end
	}
	CompletionEndScript
	{
		set st0.d6 to score
	}
}

EventScripts
{
	GameStartScript
	{
		set st0.d0 to 0
		set st0.d1 to 0
		set st0.d2 to 0
		set st0.d3 to 0
		set st0.d4 to 0
		set st0.d5 to 0
		set st0.d6 to 0
		set st0.d8 to 0
	}
	LevelStartScript
	{
		set pf.d3 to 0
		set goal to goal + 10
	}
	LevelEndScript
	{
		if level >= 11
		 win
		end
	}
	MoveSuccessfulScript
	{
		set st0.d5 to st0.d5 + 1
	}
	MoveFailedScript
	{
		set st0.d5 to st0.d5 + 1
	}
	RotateSuccessfulScript
	{
		set st0.d5 to st0.d5 + 1
	}
	RotateFailedScript
	{
		set st0.d5 to st0.d5 + 1
	}
	HardDropStartScript
	{
		set st0.d5 to st0.d5 + 1
	}
	SoftDropStepScript
	{
		set st0.d5 to st0.d5 + 1
	}
	FallStepScript
	{
		set pf.d0 to pf.d0 - 1
	}
	GameSecondScript
	{
		set st0.d8 to game time
	}
}
