//
//  A T2 test game.
//

#include <adv.t>
#include <std.t>

startroom: room
   sdesc = "XTads T2 banner test"
   ldesc = "Should show a top banner that changes height:<br>
   			 1: unspecified (to-contents),<br>
   			 2: unspecified (to-contents),<br>
   			 3: previous,<br>
   			 4: previous,<br>
   			 5: unspecified (to-contents),<br>
   			 6: previous,<br>
   			 7: previous,<br>
   			 ..."
   turnCount = 0
   heights = [nil, nil, 'previous', 'previous', nil, 'previous', 'previous']
	statusLine =
		{
		local cycleCount;
		local height;
		local heightAttr;
		local i;
		local extraLines;
		
		turnCount += 1;
		cycleCount := ((turnCount - 1) % length(heights)) + 1;
		height := heights[cycleCount];
		if (height = nil) {
			heightAttr := '';
		} else {
			heightAttr := ('height=' + height);
		}
		
		"<banner id=custStatusLine align=top <<heightAttr>> border>
			banner text <<turnCount>>, <<heightAttr>>";
		extraLines := (turnCount - 1) % 5;
		for (i := 0; i < extraLines; i++) {
			"<br>
			line <<i+2>>";
		}
		"</banner>";
	}
;

replace commonInit: function
{
    // turn on html mode
    "\H+";
}
