home *** CD-ROM | disk | FTP | other *** search
Text File | 2008-09-12 | 69.0 KB | 1,442 lines |
- package RES.OBJECTS
- {
- import ENGINE.CORE.OGlobal;
- import ENGINE.CORE.ORandomInt;
- import ENGINE.CORE.OSound;
- import ENGINE.CORE.OSystem;
- import ENGINE.CORE.OUtils;
- import ENGINE.DISPLAY.OSprite;
- import ENGINE.INTERFACE.OCounter;
- import ENGINE.SMARTFOX.OMultiplayer;
- import flash.display.*;
- import flash.events.*;
- import flash.geom.*;
- import flash.utils.getTimer;
-
- public class OField extends OSprite
- {
-
- public static const stGameOverShow:int = 10;
-
- private static const iInd:Array = [[-1,-1],[-1,0],[-1,1],[0,-1],[0,0],[0,1],[1,-1],[1,0],[1,1]];
-
- public static const stShowFBub:int = 2;
-
- public static const stInvisible:int = 0;
-
- public static const stAddNewBub:int = 6;
-
- public static const iFCols:int = 16;
-
- public static const stShuffle:int = 7;
-
- private static var iLevels:Array = [[[3,6,25],[0,1,2],[629157,857455,477020,372779,420140,235998,176169,300672,190670,269648],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,2,2,0,0,0,0,0,0,0,0,2,2,0,0],[0,0,3,0,3,0,0,0,3,0,0,0,3,0,3,0],[0,0,1,1,0,0,0,3,3,0,0,0,1,1,0,0],[0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0],[0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0],[0,0,0,8,0,0,3,0,2,0,3,0,0,8,0,0],[0,0,0,0,0,3,0,2,2,0,3,0,0,0,0,0],[0,0,0,0,0,0,3,0,2,0,3,0,0,0,0,0],[0,0,1,1,0,0,1,0,0,1,0,0,1,1,0,0],[0,0,3,0,3,0,0,1,0,1,0,0,3,0,3,0],[0,0,2,2,0,0,0,3,3,0,0,0,2,2,0,0],[0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0]],[[3,0,15],[3,4,5],[629157,857455,477020,372779,420140,235998,176169,300672,190670,269648],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0],[0,0,0,0,0,0,2,2,0,2,2,0,0,0,0,0],[0,0,0,0,0,0,0,3,3,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,8,2,3,1,1,3,2,8,0,0,0,0],[0,0,0,0,0,2,0,0,2,0,0,2,0,0,0,0],[0,0,0,0,0,3,0,3,3,0,3,0,0,0,0,0],[0,0,0,2,0,0,1,2,3,2,1,0,0,2,0,0],[0,0,0,2,3,0,1,0,0,1,0,3,2,0,0,0],[0,0,0,1,0,3,0,3,0,3,0,3,0,1,0,0],[0,0,0,1,2,0,0,2,2,0,0,2,1,0,0,0],[0,0,0,0,0,2,0,0,8,0,0,2,0,0,0,0]],[[3,0,15],[0,2,4],[629157,857455,477020,372779,420140,235998,176169,300672,190670,269648],[0,0,0,3,2,1,0,0,0,0,0,1,2,3,0,0],[0,0,0,0,0,2,0,0,0,0,2,0,0,0,0,0],[0,0,0,0,8,0,3,2,1,2,3,0,8,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,3,2,1,0,0,0,0,0,1,2,3,0,0],[0,0,0,0,0,2,0,0,0,0,2,0,0,0,0,0],[0,0,0,0,0,0,3,2,1,2,3,0,0,0,0,0],[0,0,0,0,0,2,0,0,0,0,2,0,0,0,0,0],[0,0,0,3,2,1,0,0,0,0,0,1,2,3,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,8,0,3,2,1,2,3,0,8,0,0,0],[0,0,0,0,0,2,0,0,0,0,2,0,0,0,0,0],[0,0,0,3,2,1,0,0,0,0,0,1,2,3,0,0]],[[3,0,15],[0,1,2],[629157,857455,477020,372779,420140,235998,176169,300672,190670,269648],[0,0,0,0,0,0,2,0,0,0,2,0,0,0,0,0],[0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0],[0,0,0,3,1,3,0,3,8,3,0,3,1,3,0,0],[0,0,2,0,0,2,0,1,1,0,2,0,0,2,0,0],[0,0,1,0,0,0,1,3,2,3,1,0,0,0,1,0],[0,3,0,8,0,0,0,1,3,0,0,0,8,0,3,0],[0,0,2,0,0,0,0,2,0,2,0,0,0,0,2,0],[0,0,1,0,0,0,0,1,3,0,0,0,0,1,0,0],[0,0,0,2,1,3,1,3,2,3,1,3,1,2,0,0],[0,0,3,0,0,0,0,1,3,0,0,0,0,3,0,0],[0,0,2,0,0,8,0,1,2,1,0,8,0,0,2,0],[0,0,1,0,0,0,3,0,0,3,0,0,0,1,0,0],[0,0,0,2,1,3,2,0,0,0,2,3,1,2,0,0]],[[3,0,15],[3,4,5],[629157,857455,477020,372779,420140,235998,176169,300672,190670,269648],[1,0,0,2,1,0,0,1,0,0,1,2,0,0,1,0],[2,0,3,0,3,0,3,3,0,3,0,3,0,2,0,0],[0,3,2,0,0,1,2,0,2,1,0,0,2,3,0,0],[0,0,0,2,8,0,0,0,0,8,2,0,0,0,0,0],[0,0,0,3,1,0,0,0,0,0,1,3,0,0,0,0],[0,0,1,2,0,0,0,0,0,0,2,1,0,0,0,0],[0,8,2,3,2,1,2,1,2,1,2,3,2,8,0,0],[3,2,1,0,0,0,3,3,0,0,0,1,2,3,0,0],[0,0,0,1,0,0,0,2,0,0,0,1,0,0,0,0],[0,0,2,8,0,0,3,3,0,0,8,2,0,0,0,0],[0,0,3,1,2,3,1,2,1,3,2,1,3,0,0,0],[2,1,0,0,0,2,3,3,2,0,0,0,1,2,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[3,0,15],[1,3,5],[629157,857455,477020,372779,420140,235998,176169,300672,190670,269648],[0,2,0,2,0,0,3,0,0,0,3,0,0,2,0,2],[0,3,1,0,0,2,0,0,0,0,2,0,0,3,1,0],[0,0,8,0,0,3,2,0,0,0,2,3,0,0,8,0],[0,3,0,0,2,0,1,0,0,1,0,2,0,0,3,0],[0,0,1,0,1,0,0,3,0,3,0,0,1,0,1,0],[0,0,2,3,0,0,0,2,2,0,0,0,3,2,0,0],[0,0,1,8,1,0,0,3,0,3,0,0,1,8,1,0],[0,3,0,0,2,0,1,0,0,1,0,2,0,0,3,0],[0,1,0,0,0,3,2,0,0,0,2,3,0,0,0,1],[3,0,0,0,3,8,3,0,0,3,8,3,0,0,0,3],[0,1,0,0,2,0,0,2,0,2,0,0,2,0,0,1],[0,2,0,1,0,0,0,1,1,0,0,0,1,0,2,0],[0,0,1,2,0,0,0,0,8,0,0,0,0,2,1,0]],[[3,0,15],[0,1,2],[629157,857455,477020,372779,420140,235998,176169,300672,190670,269648],[0,0,0,3,1,0,0,0,1,0,0,0,1,3,0,0],[0,0,2,0,0,0,0,2,2,0,0,0,0,2,0,0],[0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],[0,2,0,0,0,0,2,3,3,2,0,0,0,0,2,0],[0,3,1,2,3,0,1,0,8,0,1,0,3,2,1,3],[1,2,3,1,2,3,0,0,0,0,3,2,1,3,2,1],[0,0,8,2,8,0,1,0,2,0,1,0,8,2,8,0],[0,0,1,3,1,3,2,1,3,2,3,1,3,1,0,0],[0,0,3,0,0,0,0,0,2,0,0,0,0,0,3,0],[0,0,2,0,0,0,0,3,1,0,0,0,0,2,0,0],[0,0,0,3,0,0,3,1,2,3,0,0,0,3,0,0],[0,0,0,1,2,0,8,3,1,8,0,2,1,0,0,0],[0,0,0,0,2,3,2,1,8,1,2,3,2,0,0,0]],[[3,0,15],[3,4,5],[629157,857455,477020,372779,420140,235998,176169,300672,190670,269648],[0,2,1,0,0,2,0,0,0,0,0,2,0,0,1,2],[1,3,1,0,0,1,0,0,0,0,1,0,0,1,3,1],[0,2,2,0,0,0,3,0,0,0,3,0,0,0,2,2],[0,3,0,0,0,2,3,0,0,3,2,0,0,0,3,0],[0,8,8,0,1,3,1,3,8,3,1,3,1,0,8,8],[0,3,0,3,0,0,3,0,0,3,0,0,3,0,3,0],[0,0,1,0,0,0,0,2,0,2,0,0,0,0,1,0],[0,0,1,0,0,0,0,3,1,0,0,0,0,1,0,0],[0,0,0,8,2,3,3,2,0,2,3,3,2,8,0,0],[0,0,1,2,0,0,0,2,2,0,0,0,2,1,0,0],[0,3,3,0,2,0,0,3,0,3,0,0,2,0,3,3],[0,1,2,0,2,8,1,0,0,1,8,2,0,2,1,0],[0,0,0,0,0,1,1,3,3,3,1,1,0,0,0,0]],[[4,0,15],[1,2,3,4],[629157,857455,477020,372779,420140,235998,176169,300672,190670,269648],[0,0,4,4,0,0,0,0,0,0,0,0,0,4,4,0],[0,3,0,4,0,0,2,0,0,2,0,0,4,0,3,0],[0,3,0,0,4,3,2,0,0,0,2,3,4,0,0,3],[2,0,0,0,8,8,0,0,0,0,8,8,0,0,0,2],[0,0,0,0,9,1,0,0,0,0,0,1,9,0,0,0],[0,0,0,9,0,1,0,0,0,0,1,0,9,0,0,0],[0,1,1,9,0,0,2,0,0,0,2,0,0,9,0,0],[0,0,9,0,0,4,3,2,2,3,4,0,0,9,0,0],[0,8,8,1,1,4,0,2,1,2,0,4,1,1,8,8],[0,0,0,0,4,0,0,3,3,0,0,4,0,0,0,0],[0,0,0,0,1,0,0,0,8,0,0,0,1,0,0,0],[0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0],[0,2,3,3,0,0,0,0,0,0,0,0,0,3,3,2]],[[4,0,15],[0,1,2,3],[629157,857455,477020,372779,420140,235998,176169,300672,190670,269648],[1,2,3,4,1,0,0,0,0,0,0,1,4,3,2,1],[8,8,8,2,0,0,0,0,0,0,0,2,8,8,8,8],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,1,0,1,0,0,8,0,0,1,0,1,0,0],[0,0,0,2,1,0,0,0,0,0,0,1,2,0,0,0],[0,0,0,0,3,0,0,1,3,1,0,0,3,0,0,0],[0,0,4,4,8,0,0,2,2,0,0,8,4,4,0,0],[0,1,1,3,1,0,0,0,0,0,0,0,3,1,1,1],[0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0],[0,0,0,2,2,3,3,4,8,4,3,3,2,2,0,0],[0,0,0,3,0,0,0,0,0,0,0,0,3,0,0,0],[0,0,0,4,0,0,0,0,0,0,0,0,0,4,0,0]],[[4,0,15],[2,3,4,5],[629157,857455,477020,372779,420140,235998,176169,300672,190670,269648],[0,2,1,0,0,0,0,3,4,3,0,0,0,0,1,2],[0,0,2,3,0,1,2,0,0,2,1,0,3,2,0,0],[0,0,1,0,0,8,0,4,0,4,0,8,0,0,1,0],[0,2,0,0,8,0,0,3,3,0,0,8,0,0,2,0],[0,0,3,0,0,0,0,0,0,0,0,0,0,0,3,0],[0,0,8,1,1,2,0,8,8,0,2,1,1,8,0,0],[0,0,2,2,0,0,2,8,4,8,2,0,0,2,2,0],[0,3,0,0,0,2,3,3,3,3,2,0,0,0,3,0],[0,0,4,0,0,3,0,0,0,0,0,3,0,0,4,0],[0,0,3,0,2,1,0,0,0,0,1,2,0,3,0,0],[0,0,0,4,3,2,2,3,0,3,2,2,3,4,0,0],[0,0,0,8,4,4,0,0,0,0,4,4,8,0,0,0],[0,3,3,1,1,0,0,0,0,0,0,0,1,1,3,3]],[[4,0,15],[1,2,3,4],[629157,857455,477020,372779,420140,235998,176169,300672,190670,269648],[0,4,3,2,1,1,4,3,2,3,4,1,1,2,3,4],[0,3,0,2,4,0,0,0,0,0,0,4,2,0,3,0],[0,4,0,3,3,0,0,8,4,8,0,0,3,3,0,4],[2,2,0,2,0,0,8,2,2,8,0,0,2,0,2,2],[0,0,0,1,3,0,8,3,1,3,8,0,3,1,0,0],[0,0,2,0,1,8,0,0,0,0,8,1,0,2,0,0],[0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,3],[0,4,0,0,0,4,0,0,0,0,4,0,0,0,4,0],[0,1,0,0,2,0,1,0,8,0,1,0,2,0,0,1],[0,2,0,4,0,2,3,0,0,3,2,0,4,0,2,0],[0,0,1,3,3,4,3,0,0,0,3,4,3,3,1,0],[3,2,8,3,0,1,2,0,0,2,1,0,3,8,2,3],[0,2,8,0,0,0,1,2,4,2,1,0,0,0,8,2]],[[4,0,15],[0,1,2,3],[629157,857455,477020,372779,420140,235998,176169,300672,190670,269648],[0,0,0,0,0,0,4,3,4,3,4,0,0,0,0,0],[0,0,0,0,0,0,2,1,2,1,0,0,0,0,0,0],[0,0,2,0,0,0,0,8,8,8,0,0,0,0,2,0],[0,0,3,0,0,0,0,4,1,0,0,0,0,3,0,0],[0,0,0,4,1,2,3,3,1,2,3,2,1,4,0,0],[0,0,3,0,0,0,0,4,3,0,0,0,0,3,0,0],[0,0,2,0,8,8,0,0,0,0,0,8,8,0,2,0],[0,0,1,0,0,1,2,4,4,2,1,0,0,1,0,0],[0,0,0,2,0,2,0,0,1,0,0,2,0,2,0,0],[0,8,8,0,4,0,0,2,2,0,0,4,0,8,8,0],[0,0,3,0,0,3,0,8,1,8,0,3,0,0,3,0],[0,0,2,0,0,2,1,0,0,1,2,0,0,2,0,0],[0,1,2,1,2,3,0,0,8,0,0,3,2,1,2,1],[0,0,0,2,2,0,0,0,0,0,0,2,2,0,0,0]],[[4,0,15],[2,3,4,5],[629157,857455,477020,372779,420140,235998,176169,300672,190670,269648],[1,2,3,4,0,0,0,2,1,2,0,0,1,2,3,4],[8,8,0,0,0,0,0,8,8,0,0,0,0,8,8,8],[0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0],[0,2,3,4,2,1,0,0,0,0,1,2,4,3,2,0],[0,8,4,0,0,0,4,0,0,0,4,0,0,0,4,8],[1,2,3,4,0,0,3,0,0,3,0,0,4,3,2,1],[0,3,0,8,0,0,0,2,8,2,0,0,0,8,0,3],[4,0,0,0,0,0,1,0,0,1,0,0,0,0,0,4],[0,3,0,0,4,8,0,1,0,1,0,8,4,0,0,3],[0,2,0,3,2,0,2,0,0,2,0,2,3,0,2,0],[0,4,1,2,0,3,1,0,0,0,1,3,0,2,1,4],[0,1,0,0,0,0,4,0,0,4,0,0,0,0,1,0],[0,0,3,0,0,0,2,4,8,4,2,0,0,0,3,0],[0,1,1,3,3,2,0,0,0,0,2,3,3,1,1,0]],[[4,0,15],[1,2,3,4],[629157,857455,477020,372779,420140,235998,176169,300672,190670,269648],[0,0,0,3,0,0,4,3,3,3,4,0,0,3,0,0],[0,0,0,3,0,0,2,1,1,2,0,0,3,0,0,0],[0,0,0,0,2,2,8,8,8,8,8,2,2,0,0,0],[0,0,0,3,0,0,1,0,0,1,0,0,3,0,0,0],[0,0,0,3,0,0,2,0,0,0,2,0,0,3,0,0],[8,8,8,0,0,1,0,0,0,0,1,0,0,8,8,8],[0,0,0,4,0,0,2,0,0,0,2,0,0,4,0,0],[0,0,0,2,0,0,1,0,0,1,0,0,2,0,0,0],[0,0,0,0,4,8,8,1,1,1,8,8,4,0,0,0],[0,0,0,2,0,0,3,0,0,3,0,2,0,0,0,0],[0,0,0,4,0,0,0,1,0,1,0,0,4,0,0,0],[0,0,2,0,0,0,0,3,3,0,0,0,2,0,0,0],[0,0,4,0,0,0,0,0,8,0,0,0,0,4,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[4,0,15],[0,1,2,3],[629157,857455,477020,372779,420140,235998,176169,300672,190670,269648],[0,0,4,0,0,0,4,3,1,3,4,0,0,0,4,0],[0,0,3,0,0,0,0,2,2,0,0,0,0,3,0,0],[0,0,0,2,1,0,0,3,4,3,0,0,1,2,0,0],[0,0,0,8,2,0,0,1,1,0,0,2,8,0,0,0],[0,0,0,0,0,1,0,8,8,8,0,1,0,0,0,0],[8,8,0,0,1,1,0,2,2,0,1,1,0,0,8,8],[0,0,8,2,2,0,4,0,3,0,4,0,2,2,8,0],[0,0,8,0,0,0,4,0,0,4,0,0,0,8,0,0],[0,1,0,0,0,0,0,3,3,3,0,0,0,0,0,1],[0,4,0,0,0,0,4,0,0,4,0,0,0,0,4,0],[0,0,1,1,3,4,3,0,0,0,3,4,3,1,1,0],[0,0,3,0,3,1,1,0,0,1,1,3,0,3,0,0],[0,0,0,2,4,4,0,8,0,8,0,4,4,2,0,0],[3,3,2,0,0,0,0,8,8,0,0,0,0,2,3,3]],[[4,0,15],[2,3,4,5],[629157,857455,477020,372779,420140,235998,176169,300672,190670,269648],[1,1,1,0,0,0,4,2,3,1,4,0,0,4,4,4],[3,2,2,0,0,0,1,2,3,1,0,0,0,3,2,2],[0,3,0,0,0,0,0,4,3,4,0,0,0,0,1,0],[3,0,0,0,0,0,0,2,2,0,0,0,0,0,1,0],[4,1,0,0,0,8,8,0,1,8,8,0,0,0,1,4],[8,8,0,1,0,0,0,2,2,0,0,0,1,0,8,8],[0,3,0,2,0,0,3,4,3,4,3,0,0,2,0,3],[0,2,0,1,4,1,0,2,2,0,1,4,1,0,2,0],[0,0,8,0,2,8,0,0,0,0,0,8,2,0,8,0],[0,1,0,1,0,1,2,4,4,2,1,0,1,0,1,0],[0,1,0,0,0,0,0,2,0,2,0,0,0,0,0,1],[0,2,0,2,3,4,4,0,0,4,4,3,2,0,2,0],[0,0,3,3,1,1,0,0,0,0,0,1,1,3,3,0],[8,8,8,0,0,0,0,0,0,0,0,0,0,8,8,8]],[[4,0,15],[0,1,2,3,4],[629157,857455,477020,372779,420140,235998,176169,300672,190670,269648],[0,0,0,0,0,8,3,4,3,4,3,8,0,0,0,0],[0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0],[0,0,0,0,2,0,8,1,4,1,8,0,2,0,0,0],[0,0,0,2,0,4,0,0,0,0,4,0,2,0,0,0],[0,0,0,4,0,3,0,8,1,8,0,3,0,2,0,0],[0,0,4,0,5,0,4,2,3,1,0,1,0,2,0,0],[0,0,8,0,8,0,8,3,1,4,8,0,8,0,8,0],[0,0,3,0,2,0,3,4,3,2,0,2,0,1,0,0],[0,0,0,3,0,4,0,8,1,8,0,4,0,1,0,0],[0,0,0,2,0,2,0,0,0,0,2,0,2,0,0,0],[0,0,0,0,2,0,8,3,3,3,8,0,2,0,0,0],[0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0],[0,0,0,0,0,8,1,1,8,2,2,8,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[5,0,15],[1,2,3,4,5],[629157,857455,477020,372779,420140,235998,176169,300672,190670,269648],[0,0,0,2,1,2,3,1,0,1,3,2,1,3,0,0],[0,0,4,0,8,5,8,0,0,8,5,8,0,4,0,0],[0,0,2,0,0,8,8,4,5,4,8,8,0,0,3,0],[0,4,0,0,0,1,0,0,0,0,3,0,0,0,4,0],[0,1,0,0,0,5,2,0,0,0,2,3,0,0,0,1],[0,2,0,0,4,0,3,0,0,3,0,1,0,0,2,0],[0,0,5,0,3,0,0,4,0,4,0,0,4,0,3,0],[0,0,5,2,0,0,0,5,5,0,0,0,5,3,0,0],[0,0,8,1,8,1,2,3,4,3,2,1,8,5,8,0],[0,0,8,8,0,0,0,5,2,0,0,0,8,8,0,0],[0,0,0,0,1,0,0,0,1,0,0,0,4,0,0,0],[0,0,0,0,1,0,0,4,3,0,0,4,0,0,0,0],[0,0,0,0,0,2,2,8,1,8,3,3,0,0,0,0],[0,0,0,0,0,0,2,8,8,3,0,0,0,0,0,0]],[[5,0,15],[0,1,2,3,4],[629157,857455,477020,372779,420140,235998,176169,300672,190670,269648],[0,0,2,1,1,4,0,5,1,0,2,1,1,4,0,0],[0,9,9,9,9,9,1,2,3,9,9,9,9,9,0,0],[0,3,1,1,0,0,8,3,5,8,0,0,1,1,3,0],[0,3,0,0,0,0,8,8,8,0,0,0,0,3,0,0],[0,0,4,1,0,0,1,0,0,1,0,0,1,4,0,0],[0,0,4,0,0,5,0,0,0,5,0,0,4,0,0,0],[0,0,8,0,0,8,0,0,0,0,8,0,0,8,0,0],[0,0,8,0,5,8,0,0,0,8,5,0,8,0,0,0],[0,0,5,1,0,5,3,3,3,3,5,0,1,1,0,0],[0,5,0,1,2,0,0,4,0,0,2,1,0,1,0,0],[2,3,0,1,8,1,5,4,4,5,1,8,1,0,5,2],[2,3,1,0,8,2,3,0,2,3,8,0,1,5,2,0],[0,0,2,0,0,8,5,1,1,4,8,0,0,4,0,0],[0,0,2,3,2,8,5,1,4,8,2,3,4,0,0,0]],[[5,0,15],[1,2,3,4,5],[629157,857455,477020,372779,420140,235998,176169,300672,190670,269648],[9,0,0,9,0,4,5,1,2,3,4,0,9,0,0,9],[9,0,9,2,3,8,8,8,8,8,3,2,9,0,9,0],[0,9,9,1,0,1,2,3,4,5,1,0,1,9,9,0],[0,9,2,0,0,8,8,8,8,8,0,0,2,9,0,0],[0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0],[0,0,0,2,8,4,4,0,0,1,1,8,2,0,0,0],[0,0,1,0,0,0,5,0,0,0,5,0,0,0,0,0],[0,0,0,0,0,3,5,0,0,5,4,0,0,0,0,0],[0,8,0,0,0,0,3,0,8,0,4,0,0,0,8,0],[1,1,2,2,3,3,4,4,5,5,1,1,2,2,5,5],[0,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9],[0,1,0,0,5,0,0,3,3,0,0,0,4,0,1,0],[0,0,2,0,0,5,0,0,5,0,0,0,4,0,1,0],[0,8,8,0,0,3,0,8,8,0,0,3,0,8,8,0]],[[5,0,15],[0,1,2,3,4],[629157,857455,477020,372779,420140,235998,176169,300672,190670,269648],[0,0,0,0,0,0,9,9,9,9,9,0,0,0,0,0],[9,9,0,0,0,9,0,0,0,0,9,0,0,0,9,9],[8,8,9,0,0,9,0,0,0,0,0,9,0,0,8,8],[0,0,9,0,9,0,0,0,0,0,0,9,0,9,0,0],[0,0,0,9,8,9,9,9,8,9,9,9,8,9,0,0],[0,0,0,8,8,8,9,9,9,9,8,8,8,0,0,0],[0,0,0,1,9,9,8,9,9,9,8,9,9,4,0,0],[0,0,2,0,0,9,8,9,9,8,9,0,0,3,0,0],[0,0,2,0,1,0,9,0,0,0,9,0,1,0,3,0],[0,1,3,0,0,9,8,5,5,8,9,0,0,2,1,0],[0,1,5,3,2,0,0,4,4,4,0,0,1,2,0,1],[0,5,4,4,8,0,3,3,3,3,0,8,1,1,2,2],[0,0,0,0,8,0,0,0,0,0,0,0,8,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[5,0,15],[1,2,3,4,5],[629157,857455,477020,372779,420140,235998,176169,300672,190670,269648],[0,0,0,8,1,1,8,9,9,8,1,1,8,0,0,0],[0,0,8,2,2,8,9,9,9,8,2,2,8,0,0,0],[0,0,8,3,3,8,9,9,9,9,8,3,3,8,0,0],[0,0,8,4,4,8,9,9,9,8,4,4,8,0,0,0],[0,0,0,8,5,5,8,9,9,8,5,5,8,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,1,2,3,0,0,0,5,4,5,0,0,0,3,2,1],[1,0,0,3,2,1,0,0,0,0,1,2,3,0,0,1],[0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0],[0,4,3,0,0,0,0,3,3,0,0,0,0,3,4,0],[0,0,0,5,5,0,0,4,0,4,0,0,5,5,0,0],[0,0,3,8,0,0,8,0,0,8,0,0,8,3,0,0],[0,0,0,4,4,0,0,0,0,0,0,0,4,4,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[5,0,15],[0,1,2,3,4],[629157,857455,477020,372779,420140,235998,176169,300672,190670,269648],[0,0,9,0,0,0,9,9,9,9,9,0,0,0,9,0],[0,0,9,0,0,9,0,9,0,0,9,0,0,9,0,0],[0,0,0,9,9,9,0,3,1,5,0,9,9,9,0,0],[0,0,9,0,0,9,8,2,4,8,9,0,0,9,0,0],[0,9,9,0,0,0,9,8,8,8,9,0,0,0,9,9],[0,0,1,4,5,0,0,0,0,0,0,5,4,1,0,0],[0,8,2,3,8,4,0,0,0,0,3,8,2,3,8,0],[0,8,8,8,2,3,3,4,3,3,2,8,8,8,0,0],[0,2,2,4,5,5,0,3,3,0,0,2,4,5,1,0],[2,8,3,1,8,5,2,3,2,2,8,3,1,8,1,0],[2,2,8,8,8,0,0,0,0,0,0,8,8,8,5,5],[0,1,1,0,0,0,4,5,5,4,0,0,0,1,1,5],[0,0,0,2,0,0,4,0,0,0,4,0,0,2,0,0],[0,0,0,2,3,3,0,0,0,0,3,3,2,0,0,0]],[[5,0,15],[1,2,3,4,5],[629157,857455,477020,372779,420140,235998,176169,300672,190670,269648],[9,9,9,9,0,0,0,9,9,9,0,0,0,9,9,9],[9,9,8,0,0,0,8,9,9,8,0,0,0,8,9,9],[4,4,3,3,0,0,0,2,2,2,0,0,1,1,5,5],[0,0,8,0,2,2,8,0,0,8,1,1,0,8,0,0],[0,0,0,4,4,3,3,0,0,0,3,3,4,4,0,0],[0,0,8,0,5,5,8,0,0,8,1,1,0,8,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[2,2,8,0,0,0,8,5,4,8,0,0,0,8,1,1],[3,3,5,5,0,0,0,5,5,4,0,0,0,4,3,3],[1,1,8,0,0,0,8,3,3,8,0,0,0,8,2,2],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,8,0,0,0,8,0,0,8,0,0,8,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,8,0,0,0,0,0,0,0,8,0,0,0,0]],[[5,0,15],[0,1,2,3,4],[629157,857455,477020,372779,420140,235998,176169,300672,190670,269648],[0,4,5,0,0,0,0,0,0,0,0,0,0,1,2,0],[1,2,3,0,0,0,0,0,0,0,0,0,5,4,3,0],[8,8,8,9,0,0,8,9,9,8,0,0,9,8,8,8],[5,0,0,9,9,8,9,9,9,8,9,9,0,0,3,0],[5,4,0,9,0,8,9,9,9,9,8,0,9,0,0,3],[0,4,8,9,9,0,0,0,0,0,9,9,8,0,4,0],[0,4,8,0,0,0,0,0,0,0,0,0,0,8,4,0],[1,1,8,0,0,0,0,0,0,0,0,0,8,3,3,0],[2,0,0,5,1,1,4,4,5,5,3,3,4,0,0,5],[2,3,3,5,8,8,1,3,2,8,8,4,1,1,5,0],[0,0,0,0,0,8,1,3,3,2,8,0,0,0,0,0],[0,0,0,0,0,2,0,0,0,1,0,0,0,0,0,0],[0,0,0,0,0,0,2,0,0,1,0,0,0,0,0,0],[0,0,0,0,0,0,8,8,8,0,0,0,0,0,0,0]],[[5,0,15],[1,2,3,4,5],[629157,857455,477020,372779,420140,235998,176169,300672,190670,269648],[0,9,9,9,0,0,0,1,2,3,0,0,0,9,9,9],[0,9,9,3,0,0,8,8,8,8,0,0,3,9,9,0],[0,0,8,8,3,2,1,0,0,0,4,5,3,8,8,0],[0,0,0,0,2,1,0,0,0,0,4,5,0,0,0,0],[0,4,0,0,8,8,0,0,0,0,0,8,8,0,0,0],[4,2,0,0,4,0,0,0,0,0,0,5,0,2,5,5],[1,1,2,0,0,4,0,0,0,0,0,5,0,2,3,3],[8,8,0,0,0,8,8,1,1,8,8,0,0,0,8,8],[0,3,0,0,0,3,0,2,0,4,0,1,0,0,0,5],[0,3,0,0,3,0,2,0,0,4,0,1,0,0,5,0],[0,0,4,0,8,8,5,0,0,0,5,8,8,0,3,0],[0,0,4,2,1,5,2,3,3,4,5,1,4,3,0,0],[0,0,0,2,1,0,0,2,3,4,0,0,1,4,0,0],[0,0,8,8,0,0,0,0,0,0,0,0,8,8,0,0]],[[5,0,15],[0,1,2,3,4],[629157,857455,477020,372779,420140,235998,176169,300672,190670,269648],[9,9,9,0,0,0,5,4,3,2,0,0,0,0,9,9],[9,9,0,8,0,0,8,8,8,0,0,8,0,9,9,9],[9,9,9,0,0,0,0,0,0,0,0,0,0,0,9,9],[1,1,0,1,0,2,0,3,0,4,0,5,0,4,4,4],[8,8,8,0,0,0,0,0,0,0,0,0,0,8,8,8],[2,4,5,0,0,0,0,0,0,0,0,0,0,2,1,3],[8,8,8,0,0,1,2,2,5,4,4,0,0,8,8,8],[4,5,1,0,0,0,0,0,0,0,0,0,0,5,2,1],[4,5,1,0,0,0,0,0,0,0,0,0,0,5,2,1],[8,8,8,0,0,0,0,0,0,0,0,0,0,8,8,8],[1,2,3,0,0,0,0,0,0,0,0,0,0,3,4,5],[8,8,8,0,0,3,3,0,0,5,5,0,0,8,8,8],[1,1,4,4,2,2,0,0,0,0,1,1,5,5,3,3],[1,0,4,0,2,0,0,0,0,0,1,0,5,0,3,0]],[[6,0,15],[0,1,2,3,4,5],[629157,857455,477020,372779,420140,235998,176169,300672,190670,269648],[9,9,0,9,9,9,0,0,0,0,0,0,9,9,9,0],[9,9,9,0,0,9,9,0,0,0,9,9,0,0,9,0],[9,9,9,0,0,0,0,0,0,0,0,0,0,0,0,9],[0,0,9,8,8,8,8,8,0,8,8,8,8,8,9,0],[0,0,0,0,1,2,3,4,5,5,4,3,2,1,0,0],[0,0,0,0,8,8,8,8,6,8,8,8,8,0,0,0],[0,0,0,0,0,3,4,5,6,6,5,4,3,0,0,0],[0,6,5,4,1,8,8,8,0,8,8,8,1,2,3,6],[0,0,6,5,4,1,2,3,4,4,3,2,1,2,3,6],[0,0,0,0,0,0,8,8,0,8,8,0,0,0,0,0],[0,0,0,0,2,2,1,1,2,3,4,4,3,3,0,0],[0,3,0,3,0,0,0,8,0,8,0,0,0,4,0,4],[0,0,6,6,0,0,0,0,0,0,0,0,0,0,5,5],[0,0,1,0,0,0,0,0,0,0,0,0,0,0,6,0]],[[6,0,15],[0,1,2,3,4,5],[629157,857455,477020,372779,420140,235998,176169,300672,190670,269648],[0,1,9,9,2,2,2,0,0,6,9,9,2,2,9,0],[1,0,0,0,0,0,3,0,6,0,8,8,0,0,9,0],[9,0,8,8,8,0,0,3,2,0,8,1,8,0,0,4],[9,0,3,3,8,0,0,2,0,8,1,2,8,0,0,4],[2,0,0,2,2,8,0,0,0,8,3,3,2,8,0,9],[2,0,1,1,5,0,0,0,5,4,4,1,1,5,0,6],[9,0,8,8,8,5,0,0,5,6,6,2,3,6,5,6],[3,0,0,2,2,8,0,0,5,2,1,5,2,6,5,1],[3,0,0,0,6,6,8,0,0,5,3,3,3,4,5,1],[2,0,1,3,5,5,8,0,0,8,5,5,4,8,0,6],[2,0,1,3,4,4,8,6,6,3,8,6,6,8,0,6],[5,0,8,8,8,8,2,0,0,3,8,8,8,0,5,0],[0,5,0,0,0,4,2,0,0,0,2,0,0,1,5,0],[0,1,1,3,3,4,0,0,0,0,2,4,4,1,0,0]],[[6,0,15],[0,1,2,3,4,5],[629157,857455,477020,372779,420140,235998,176169,300672,190670,269648],[0,5,5,0,4,4,0,3,3,0,2,2,0,1,1,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,1,2,3,4,5,6,0,1,2,3,4,5,6,0],[0,0,8,8,8,8,8,0,0,8,8,8,8,8,0,0],[0,0,4,8,1,2,3,4,5,6,1,2,3,8,2,0],[0,4,0,8,1,2,3,4,5,6,1,2,8,0,2,0],[0,3,0,0,8,1,2,3,4,5,6,1,8,0,0,3],[0,3,0,0,0,0,0,0,0,0,0,0,0,0,3,0],[0,2,0,0,0,0,0,0,0,0,0,0,0,0,4,0],[2,0,0,0,8,8,0,0,0,0,8,8,0,0,4,0],[0,5,0,0,8,1,2,3,0,4,5,6,8,0,0,5],[0,5,0,8,1,2,3,0,0,4,5,6,8,0,5,0],[1,1,0,8,8,8,8,0,4,2,8,8,8,8,6,6],[6,6,5,5,4,4,3,3,4,2,3,3,2,2,1,1]],[[6,0,15],[0,1,2,3,4,5],[629157,857455,477020,372779,420140,235998,176169,300672,190670,269648],[0,0,9,9,9,9,9,1,2,9,9,9,9,9,9,0],[0,9,0,0,0,0,0,0,0,0,0,0,0,0,9,0],[0,9,0,0,0,0,0,0,8,0,0,0,0,0,0,9],[9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9],[0,4,0,0,8,8,8,0,0,0,8,8,8,0,6,6],[0,4,0,8,1,1,2,5,6,4,3,3,8,0,6,0],[0,0,3,8,8,8,2,5,6,6,4,8,8,8,1,0],[0,0,3,0,0,0,0,0,0,0,0,0,0,1,0,0],[0,0,2,0,0,0,0,0,0,0,0,0,0,0,2,0],[0,2,8,8,8,8,1,1,4,3,8,8,8,8,2,0],[0,1,0,8,1,3,3,2,4,5,3,4,4,8,0,5],[1,0,0,8,8,8,8,2,5,8,8,8,8,0,0,5],[1,2,2,3,3,4,4,6,5,1,4,2,3,3,6,6],[0,0,0,0,5,5,6,0,0,1,4,2,0,0,0,0]],[[6,0,15],[0,1,2,3,4,5],[629157,857455,477020,372779,420140,235998,176169,300672,190670,269648],[9,9,9,9,9,0,0,2,1,4,0,9,9,9,9,9],[0,0,8,9,0,8,0,2,4,0,8,0,9,8,0,0],[0,9,9,9,0,0,0,8,0,8,0,0,0,9,9,9],[9,8,0,4,8,2,6,0,0,2,4,8,1,0,8,9],[9,8,0,3,4,5,2,6,0,0,2,4,1,4,6,8],[0,0,8,3,0,5,8,0,0,8,6,6,4,8,6,0],[0,0,0,0,0,3,3,3,3,3,3,3,0,0,0,0],[0,8,9,9,8,2,0,0,0,0,3,8,9,9,8,0],[0,9,9,9,0,9,2,0,0,0,3,9,9,9,9,0],[0,8,9,8,0,9,8,0,0,8,9,0,8,9,8,0],[0,6,6,3,3,0,1,1,0,3,3,6,6,5,5,0],[0,8,4,4,8,1,2,2,4,4,3,8,1,1,8,0],[0,5,2,2,3,3,2,0,0,0,4,5,5,4,4,0],[0,5,8,1,1,8,0,0,0,0,8,6,6,8,0,0]],[[6,0,15],[0,1,2,3,4,5],[629157,857455,477020,372779,420140,235998,176169,300672,190670,269648],[0,0,9,9,9,9,0,0,0,0,9,9,9,9,0,0],[0,0,0,0,8,2,8,0,0,0,8,1,8,0,0,0],[0,0,0,0,0,8,8,0,0,0,0,8,8,0,0,0],[9,9,9,9,9,8,9,9,9,9,9,8,9,9,9,9],[0,0,0,0,0,6,0,0,0,0,0,0,4,0,0,0],[0,0,0,8,6,8,0,0,0,0,0,8,4,8,0,0],[0,0,0,0,8,8,5,0,0,0,0,5,8,8,0,0],[9,9,9,9,8,5,9,9,9,9,9,5,8,9,9,9],[0,0,0,0,1,2,0,0,0,0,0,0,4,3,0,0],[0,0,8,1,8,2,0,0,0,0,0,4,8,3,8,0],[0,0,3,8,8,0,0,0,0,0,0,0,0,8,8,6],[0,0,3,8,2,2,0,8,0,8,0,4,4,8,6,0],[0,0,0,0,0,0,1,1,8,8,5,5,0,0,0,0],[0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0]],[[6,0,15],[0,1,2,3,4,5],[629157,857455,477020,372779,420140,235998,176169,300672,190670,269648],[9,0,9,0,0,0,0,0,0,0,0,0,0,9,0,9],[9,9,0,0,9,6,5,4,3,2,9,0,0,9,9,0],[0,9,0,0,9,8,8,8,8,8,8,9,0,0,9,0],[0,0,0,9,1,2,3,4,5,6,0,9,0,0,0,0],[0,0,0,9,0,8,8,8,8,8,8,0,9,0,0,0],[0,0,9,0,0,6,5,4,3,2,1,0,9,0,0,0],[0,0,9,0,0,8,8,8,8,8,8,0,0,9,0,9],[9,9,0,0,1,2,3,4,5,6,0,0,0,1,1,0],[0,5,0,0,9,8,8,8,8,8,8,1,0,0,2,0],[6,5,0,4,6,5,4,3,2,1,0,3,0,2,9,0],[0,0,3,4,0,8,8,8,8,8,8,0,3,4,0,0],[0,0,3,0,1,2,3,4,5,6,0,0,4,0,0,0],[0,0,1,2,0,8,8,8,8,8,8,0,6,5,0,0],[0,1,0,2,0,0,0,0,0,0,0,6,0,5,0,0]],[[6,0,15],[0,1,2,3,4,5],[629157,857455,477020,372779,420140,235998,176169,300672,190670,269648],[0,0,0,0,0,5,3,1,1,2,4,0,0,0,0,0],[9,8,0,9,8,5,3,1,2,4,8,9,0,8,9,0],[0,9,8,0,9,8,5,6,6,6,8,9,0,8,9,0],[0,9,8,0,9,8,0,0,0,8,9,0,8,9,0,0],[0,0,0,0,0,0,3,0,0,4,0,0,0,0,0,0],[5,6,4,0,0,0,3,0,4,0,2,3,1,0,0,0],[0,5,6,4,0,0,0,2,2,0,0,2,3,1,0,0],[0,8,8,8,0,0,0,8,0,0,0,8,8,8,0,0],[4,4,3,3,0,0,0,0,0,0,0,0,3,3,4,4],[8,8,8,3,0,0,0,0,0,0,0,0,2,8,8,8],[3,3,6,0,3,1,1,0,0,0,6,6,2,0,5,4],[2,6,8,0,0,8,0,0,0,8,0,0,8,5,4,0],[2,1,8,2,3,8,4,5,6,5,8,4,3,8,2,1],[1,8,2,3,8,4,5,6,5,5,8,4,3,8,2,1]],[[6,0,15],[0,1,2,3,4,5],[629157,857455,477020,372779,420140,235998,176169,300672,190670,269648],[0,0,0,0,9,9,9,9,9,9,9,9,9,9,0,0],[0,0,0,9,0,0,0,0,0,0,0,0,0,9,0,0],[0,0,0,9,0,0,8,8,8,8,8,8,0,0,9,0],[0,0,9,0,0,6,6,5,5,4,4,0,0,0,9,0],[0,0,9,0,0,0,8,8,8,8,8,8,0,0,0,9],[0,9,0,0,0,1,1,2,2,3,3,0,0,0,0,9],[0,0,9,0,0,8,8,8,8,8,8,8,8,0,0,9],[0,0,9,0,0,6,6,5,5,4,4,0,0,0,9,0],[0,0,0,9,9,9,8,8,8,8,8,8,9,9,9,0],[0,0,9,0,0,1,1,2,2,3,3,0,0,0,9,0],[0,0,9,0,0,0,0,8,8,8,8,0,0,0,0,9],[0,0,9,0,0,0,0,8,8,8,0,0,0,0,9,0],[0,0,0,9,9,9,0,0,8,8,0,0,9,9,9,0],[0,0,0,0,0,9,9,9,8,9,9,9,0,0,0,0]],[[6,0,15],[0,1,2,3,4,5],[629157,857455,477020,372779,420140,235998,176169,300672,190670,269648],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,3,8,4,4,4,8,5,0,0,0,0,0],[0,0,0,0,1,8,5,0,0,2,8,6,0,0,0,0],[0,0,0,1,8,4,5,0,2,3,8,6,0,0,0,0],[0,0,0,2,8,3,4,8,8,3,4,8,5,0,0,0],[0,0,2,0,2,3,8,6,8,4,5,0,5,0,0,0],[0,0,3,8,1,2,8,6,1,8,5,6,8,4,0,0],[0,3,8,6,1,8,5,5,2,8,6,1,8,4,0,0],[0,0,8,5,6,8,4,5,2,3,8,1,2,8,0,0],[0,8,4,5,8,3,4,8,3,4,8,2,3,8,0,0],[0,0,0,4,8,2,3,8,8,4,5,8,3,0,0,0],[0,0,0,8,1,2,8,0,8,5,6,8,0,0,0,0],[0,0,0,0,0,1,8,0,0,8,6,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[6,0,15],[0,1,2,3,4,5],[629157,857455,477020,372779,420140,235998,176169,300672,190670,269648],[2,2,3,8,8,0,0,9,9,0,0,8,8,4,3,3],[1,1,6,8,0,0,9,9,9,0,0,8,5,4,2,2],[4,4,5,8,8,0,0,9,9,0,0,8,8,1,1,6],[2,2,3,8,0,0,0,6,0,0,0,8,4,5,5,6],[5,5,3,8,8,0,0,5,6,0,0,8,8,4,2,2],[1,1,2,0,0,0,5,3,4,0,0,0,1,1,3,3],[3,3,2,8,8,0,0,3,4,0,0,8,8,6,6,5],[6,6,5,8,0,0,0,2,0,0,0,8,3,4,4,5],[4,4,5,8,8,0,0,1,2,0,0,8,8,3,2,2],[1,3,3,0,0,0,0,1,0,0,0,0,6,6,1,1],[1,2,2,8,8,0,0,0,0,0,0,8,8,4,5,5],[6,5,4,8,0,0,0,0,0,0,0,8,4,1,3,2],[6,5,4,8,8,0,0,0,0,0,0,8,8,1,3,2],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[6,0,15],[0,1,2,3,4,5],[629157,857455,477020,372779,420140,235998,176169,300672,190670,269648],[8,2,2,1,1,0,0,0,0,0,0,5,5,4,4,8],[8,8,8,8,0,0,8,8,8,0,0,8,8,8,8,0],[0,0,0,0,2,0,0,8,8,0,0,4,0,0,0,5],[8,0,0,1,2,0,0,8,0,0,3,4,0,0,5,8],[1,0,0,8,1,8,9,9,9,9,8,3,8,0,0,3],[1,0,0,8,8,9,9,9,9,9,8,8,0,0,3,4],[2,2,0,0,0,0,6,6,8,8,2,2,4,0,0,4],[8,5,5,6,6,5,6,5,0,3,3,4,1,1,6,8],[3,3,0,0,4,8,8,5,6,8,8,1,0,0,0,6],[4,0,0,0,4,8,4,5,6,8,1,0,0,0,2,2],[4,0,0,0,3,0,4,3,3,2,5,0,0,0,0,1],[8,0,0,3,0,0,1,1,2,0,5,0,0,0,1,8],[0,0,0,2,0,0,0,8,8,0,0,6,0,0,0,0],[0,0,2,0,0,0,0,8,0,0,0,6,0,0,0,0]],[[6,0,15],[0,1,2,3,4,5],[629157,857455,477020,372779,420140,235998,176169,300672,190670,269648],[1,2,3,4,5,6,0,8,8,0,1,2,3,4,5,6],[1,2,3,4,5,6,8,8,8,1,2,3,4,5,6,0],[8,8,8,0,0,0,9,8,8,9,0,0,0,8,8,8],[0,0,8,0,4,4,0,8,0,3,3,0,8,0,0,0],[0,0,8,0,5,0,0,8,8,0,0,2,0,8,0,0],[0,8,0,0,5,0,0,0,0,0,2,0,0,8,0,0],[0,8,0,0,0,6,0,8,8,0,1,0,0,0,8,0],[8,0,0,0,0,6,0,0,0,1,0,0,0,0,8,0],[8,0,0,0,0,0,8,8,8,8,0,0,0,0,0,8],[4,3,1,0,0,8,1,1,1,8,0,0,0,4,3,2],[4,3,1,0,0,8,2,2,3,3,8,0,0,4,3,2],[0,0,0,0,8,4,4,6,5,5,8,0,0,0,0,0],[0,0,0,0,8,1,1,6,6,2,2,8,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[6,0,15],[0,1,2,3,4,5],[629157,857455,477020,372779,420140,235998,176169,300672,190670,269648],[0,0,6,8,0,8,0,0,0,2,2,8,0,8,5,0],[0,6,3,8,5,8,0,0,0,1,8,6,8,4,5,0],[0,0,0,3,8,5,8,0,8,1,8,6,8,4,0,0],[0,0,8,1,1,4,0,0,0,0,3,2,2,8,0,0],[0,0,0,8,5,8,4,8,0,8,3,8,6,8,0,0],[0,0,4,4,5,3,0,0,0,0,0,1,6,2,0,0],[0,0,0,2,8,3,8,0,0,0,8,1,8,2,0,0],[0,1,2,8,5,8,0,0,0,0,8,4,8,3,0,0],[0,0,1,3,5,0,0,6,0,4,0,0,4,3,0,0],[0,0,3,8,8,8,6,0,0,4,8,8,8,0,0,0],[0,0,0,6,6,5,5,0,0,0,1,1,2,2,0,0],[0,0,8,1,8,2,8,0,0,8,4,8,3,8,0,0],[0,0,5,5,1,2,0,0,0,0,4,6,6,3,0,0],[0,0,0,0,0,8,0,0,0,0,8,0,0,0,0,0]],[[6,0,15],[0,1,2,3,4,5],[629157,857455,477020,372779,420140,235998,176169,300672,190670,269648],[0,0,0,8,0,8,1,1,2,2,8,0,8,0,0,0],[0,0,2,8,0,8,4,0,3,8,0,8,0,0,0,0],[8,0,1,2,8,0,8,4,3,8,0,8,0,6,5,8],[8,1,0,3,3,5,5,6,6,0,0,0,6,5,8,0],[0,8,0,0,8,0,8,0,0,8,0,8,4,4,8,0],[1,8,8,0,0,0,0,0,0,0,0,0,8,8,6,0],[0,1,2,0,0,4,5,5,2,2,3,0,0,5,6,0],[0,0,2,8,4,8,1,6,6,8,3,8,5,0,0,0],[8,0,0,3,3,0,1,0,0,0,0,4,4,0,0,8],[8,1,2,3,4,8,5,6,2,8,1,6,5,4,8,0],[0,8,1,2,3,4,5,6,3,2,1,6,5,4,8,0],[0,8,8,0,0,0,8,3,8,0,0,0,8,8,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[6,0,15],[0,1,2,3,4,5],[629157,857455,477020,372779,420140,235998,176169,300672,190670,269648],[0,8,1,1,2,2,3,3,4,4,5,5,6,6,8,0],[2,2,0,8,0,8,0,0,0,8,0,8,5,5,3,0],[8,6,8,0,0,0,0,0,0,0,0,0,0,8,3,8],[6,4,8,0,0,0,0,0,0,0,0,0,8,1,1,0],[0,8,4,0,8,0,8,0,0,8,0,8,0,0,8,0],[0,0,8,0,0,6,6,0,0,0,4,0,8,0,0,0],[0,8,0,0,8,1,0,2,0,0,4,8,0,0,8,0],[0,0,0,8,1,0,0,2,3,3,5,8,0,0,0,0],[8,0,8,0,2,3,3,0,0,4,4,5,0,8,0,8],[4,4,5,2,1,0,0,0,0,0,6,6,0,2,1,1],[8,6,8,5,1,8,0,0,0,0,8,0,5,8,2,8],[6,8,0,0,0,0,0,0,0,0,0,0,5,8,3,3],[8,1,2,3,3,0,0,0,0,0,0,6,6,5,4,8],[8,1,2,8,0,0,0,8,0,0,0,8,5,4,8,0]],[[6,0,15],[0,1,2,3,4,5],[629157,857455,477020,372779,420140,235998,176169,300672,190670,269648],[0,0,0,0,0,1,2,3,4,5,6,0,0,0,0,0],[0,0,0,0,0,5,8,8,8,2,0,0,0,0,0,0],[0,0,0,0,0,0,5,6,1,2,0,0,0,0,0,0],[0,0,0,0,4,8,8,8,8,8,3,0,0,0,0,0],[0,0,0,0,0,4,5,6,1,2,3,0,0,0,0,0],[0,0,0,3,8,8,8,8,8,8,8,4,0,0,0,0],[0,0,0,0,3,4,5,6,1,2,3,4,0,0,0,0],[0,0,2,8,8,8,8,8,8,8,8,8,5,0,0,0],[0,0,0,2,3,4,5,6,1,2,3,4,5,0,0,0],[0,0,1,8,8,8,8,8,8,8,8,8,4,0,0,0],[0,0,0,1,2,3,4,5,6,1,2,3,4,0,0,0],[0,0,0,8,8,8,8,8,8,8,8,8,0,0,0,0],[0,0,0,0,2,2,3,3,6,6,5,5,0,0,0,0],[0,0,0,0,0,8,8,0,8,8,0,0,0,0,0,0]]];
-
- public static const stMoveFBub:int = 4;
-
- public static const stShowField:int = 1;
-
- public static const stGameOver:int = 11;
-
- public static const stNormal:int = 3;
-
- public static const stLevelCompShow:int = 8;
-
- public static const stCalcRemove:int = 5;
-
- public static const stLevelComplete:int = 9;
-
- public static const iFRows:int = 21;
-
-
- private var iDiameter:Number;
-
- private var iField:Array;
-
- private var iRecord:ORecord;
-
- private var iBorderCount:int;
-
- private var iRand:ORandomInt;
-
- private var iFBub:OBubble;
-
- private var iBang:OBang;
-
- private var iScorePurBubble:int = 10;
-
- private var iRadius:Number;
-
- private var iFBubP:Point;
-
- private var iRRect:Rectangle;
-
- private var iCIndexes:Array;
-
- private var iDY:Number;
-
- private var iNewField:Array;
-
- private var iTime:int;
-
- private var iFC:int;
-
- private var iLostShoot:Boolean;
-
- private var iFR:int;
-
- private var iCursor:OCursor;
-
- private var iNBub:OBubble;
-
- private var iColors:Array;
-
- private var iRandomP:int = 25;
-
- private var iBangCount:int;
-
- private var dTime:Number;
-
- private var iCounter:OCounter;
-
- private var iDir:Point;
-
- private var iBubbleFall:Boolean;
-
- private var iRTime:int;
-
- private var iMaxColors:int;
-
- private var iConnectDist2:Number;
-
- private var iState:int = 0;
-
- private var iBubbleCount:int;
-
- private var iRect:Rectangle;
-
- private var iMx:int;
-
- private var iMy:int;
-
- public function OField(param1:Number, param2:Number, param3:Number, param4:OCounter, param5:OBang, param6:int, param7:Rectangle)
- {
- iState = 0;
- iRandomP = 25;
- iScorePurBubble = 10;
- super();
- this.iBang = param5;
- this.iRadius = param1;
- this.iCounter = param4;
- this.iRRect = param7;
- this.iDiameter = this.iRadius * 2;
- this.iConnectDist2 = this.iDiameter * this.iDiameter * 0.66 * 0.66;
- this.iRTime = -1;
- this.iRand = new ORandomInt();
- this.iRand.SeedRand(param6);
- this.iRecord = new ORecord();
- this.iBubbleCount = 0;
- this.iBubbleFall = false;
- FieldInit();
- this.Pos(param2,param3);
- iDir = new Point();
- this.addEventListener(MouseEvent.MOUSE_DOWN,OnMouseDown);
- this.addEventListener(Event.ENTER_FRAME,OnEnterFrame);
- this.State = stInvisible;
- }
-
- public function get prGameIndex() : int
- {
- return (ClusterzL.iGAME.prGamesStartCount + ClusterzL.iGAME.prLevel + ClusterzL.iGAME.prRNDFactor) % 10;
- }
-
- private function Neighbours(param1:int, param2:int) : Array
- {
- var _loc3_:Array = null;
- var _loc4_:int = 0;
- _loc3_ = new Array();
- _loc4_ = 0;
- if(param1 % 2 == 0)
- {
- if(param1 > 0 && param2 > 0)
- {
- if((_loc4_ = ActiveCell(param1 - 1,param2 - 1)) > 0)
- {
- _loc3_.push(_loc4_ - 1);
- }
- }
- if(param1 > 0)
- {
- if((_loc4_ = ActiveCell(param1 - 1,param2)) > 0)
- {
- _loc3_.push(_loc4_ - 1);
- }
- }
- if(param2 > 0)
- {
- if((_loc4_ = ActiveCell(param1,param2 - 1)) > 0)
- {
- _loc3_.push(_loc4_ - 1);
- }
- }
- if(param2 < iFCols - 1)
- {
- if((_loc4_ = ActiveCell(param1,param2 + 1)) > 0)
- {
- _loc3_.push(_loc4_ - 1);
- }
- }
- if(param1 < iFRows - 1 && param2 > 0)
- {
- if((_loc4_ = ActiveCell(param1 + 1,param2 - 1)) > 0)
- {
- _loc3_.push(_loc4_ - 1);
- }
- }
- if(param1 < iFRows - 1)
- {
- if((_loc4_ = ActiveCell(param1 + 1,param2)) > 0)
- {
- _loc3_.push(_loc4_ - 1);
- }
- }
- }
- else
- {
- if(param1 > 0)
- {
- if((_loc4_ = ActiveCell(param1 - 1,param2)) > 0)
- {
- _loc3_.push(_loc4_ - 1);
- }
- }
- if(param2 < iFCols - 1 && param1 > 0)
- {
- if((_loc4_ = ActiveCell(param1 - 1,param2 + 1)) > 0)
- {
- _loc3_.push(_loc4_ - 1);
- }
- }
- if(param2 > 0)
- {
- if((_loc4_ = ActiveCell(param1,param2 - 1)) > 0)
- {
- _loc3_.push(_loc4_ - 1);
- }
- }
- if(param2 < iFCols - 1)
- {
- if((_loc4_ = ActiveCell(param1,param2 + 1)) > 0)
- {
- _loc3_.push(_loc4_ - 1);
- }
- }
- if(param1 < iFRows - 1)
- {
- if((_loc4_ = ActiveCell(param1 + 1,param2)) > 0)
- {
- _loc3_.push(_loc4_ - 1);
- }
- }
- if(param1 < iFRows - 1 && param2 < iFCols - 1)
- {
- if((_loc4_ = ActiveCell(param1 + 1,param2 + 1)) > 0)
- {
- _loc3_.push(_loc4_ - 1);
- }
- }
- }
- return _loc3_;
- }
-
- private function FieldBangBlackBub() : void
- {
- var _loc1_:int = 0;
- var _loc2_:int = 0;
- var _loc3_:int = 0;
- var _loc4_:OBubble = null;
- _loc1_ = 20;
- _loc2_ = 0;
- while(_loc2_ < OField.iFRows)
- {
- _loc3_ = 0;
- while(_loc3_ < OField.iFCols)
- {
- if((_loc4_ = this.iField[_loc2_][_loc3_]).prCInd >= OBubble.iColorsCount - 1)
- {
- _loc4_.prType = _loc1_;
- _loc1_ += 20;
- _loc4_.prDelta = _loc4_.prType;
- _loc4_.State = OBubble.stBeforeBang;
- }
- _loc3_++;
- }
- _loc2_++;
- }
- }
-
- private function get prNextColor() : int
- {
- return this.iColors[this.iRand.RandVal(this.iColors.length)];
- }
-
- private function FieldShowRemove() : Boolean
- {
- var _loc1_:Boolean = false;
- var _loc2_:int = 0;
- var _loc3_:int = 0;
- var _loc4_:OBubble = null;
- _loc1_ = false;
- _loc2_ = 0;
- while(_loc2_ < OField.iFRows)
- {
- _loc3_ = 0;
- while(_loc3_ < OField.iFCols)
- {
- if((_loc4_ = this.iField[_loc2_][_loc3_]).prType)
- {
- _loc4_.OnEnterFrame(null);
- if(_loc4_.State != OBubble.stInvisible)
- {
- _loc1_ = true;
- }
- if(_loc4_.State == OBubble.stBang)
- {
- if(this.iBang)
- {
- this.iBang.MakeFirework3(_loc4_,3);
- }
- _loc4_.prCInd = -1;
- }
- if(_loc4_.State == OBubble.stFlyOut)
- {
- _loc4_.prCInd = -1;
- }
- }
- _loc3_++;
- }
- _loc2_++;
- }
- return _loc1_;
- }
-
- public function get State() : int
- {
- return this.iState;
- }
-
- private function FieldCheckGameOver() : Boolean
- {
- var _loc1_:int = 0;
- _loc1_ = 0;
- while(_loc1_ < OField.iFCols)
- {
- if(this.iField[OField.iFRows - 1][_loc1_].prCInd >= 0)
- {
- return true;
- }
- _loc1_++;
- }
- return false;
- }
-
- private function FieldShowNewBub(param1:Array) : void
- {
- var _loc2_:int = 0;
- var _loc3_:int = 0;
- var _loc4_:int = 0;
- var _loc5_:OBubble = null;
- _loc2_ = 0;
- _loc3_ = 0;
- while(_loc3_ < OField.iFRows)
- {
- _loc4_ = 0;
- while(_loc4_ < OField.iFCols)
- {
- if(param1[_loc3_][_loc4_] >= 0)
- {
- _loc5_ = this.iField[_loc3_][_loc4_];
- this.iField[_loc3_][_loc4_].prCInd = param1[_loc3_][_loc4_];
- _loc5_.InitShow(2,4,this.iRadius,0,5);
- ++this.iBubbleCount;
- }
- _loc4_++;
- }
- _loc2_ += 1;
- _loc3_++;
- }
- }
-
- override public function Free() : void
- {
- this.removeEventListener(Event.ENTER_FRAME,OnEnterFrame);
- this.removeEventListener(MouseEvent.MOUSE_DOWN,OnMouseDown);
- this.iField = null;
- if(iCursor)
- {
- iCursor = null;
- }
- super.Free();
- }
-
- private function FieldCalcColors() : void
- {
- var _loc1_:int = 0;
- var _loc2_:int = 0;
- var _loc3_:int = 0;
- _loc1_ = 0;
- while(_loc1_ < 12)
- {
- this.iColors[_loc1_] = -1;
- _loc1_++;
- }
- _loc2_ = OField.iFRows - 1;
- while(_loc2_ >= 0)
- {
- _loc3_ = 0;
- while(_loc3_ < OField.iFCols)
- {
- if(ActiveCell(_loc2_,_loc3_) > 0)
- {
- this.iColors[this.iField[_loc2_][_loc3_].prCInd] = this.iField[_loc2_][_loc3_].prCInd;
- }
- _loc3_++;
- }
- _loc2_--;
- }
- _loc1_ = 0;
- while(_loc1_ < this.iColors.length)
- {
- if(this.iColors[_loc1_] < 0)
- {
- this.iColors.splice(_loc1_,1);
- }
- else
- {
- _loc1_++;
- }
- }
- }
-
- private function FieldOnEnterFrame() : void
- {
- var _loc1_:int = 0;
- var _loc2_:int = 0;
- var _loc3_:OBubble = null;
- _loc1_ = 0;
- while(_loc1_ < OField.iFRows)
- {
- _loc2_ = 0;
- while(_loc2_ < OField.iFCols)
- {
- _loc3_ = this.iField[_loc1_][_loc2_];
- if(_loc3_.prCInd >= 0)
- {
- _loc3_.OnEnterFrame(null);
- }
- _loc2_++;
- }
- _loc1_++;
- }
- }
-
- public function OnEnterFrame(param1:Event) : void
- {
- var _loc2_:Number = NaN;
- var _loc3_:int = 0;
- var _loc4_:Number = NaN;
- var _loc5_:Number = NaN;
- switch(this.iState)
- {
- case stShowField:
- this.FieldOnEnterFrame();
- if(this.FieldIsAllStates(OBubble.stNormal))
- {
- this.State = stShowFBub;
- }
- break;
- case stShowFBub:
- _loc2_ = -this.iRadius / 4;
- this.iFBub.Move(0,_loc2_);
- this.iNBub.Move(0,_loc2_);
- if(this.iFBub.prY == this.iFBubP.y)
- {
- this.State = stNormal;
- }
- break;
- case stNormal:
- if(!this.iBang)
- {
- _loc3_ = getTimer();
- if(iCursor != null)
- {
- iCursor.Move(iDir.x * (_loc3_ - dTime),iDir.y * (_loc3_ - dTime));
- dTime = getTimer();
- }
- if(this.iRTime >= 0 && _loc3_ - this.iTime >= this.iRTime)
- {
- this.EmulateMove(new Point(iMx,iMy),this.iRRect);
- this.iRTime = this.iRecord.ReadTime() * 200;
- iMx = this.iRecord.ReadCoord();
- iMy = this.iRecord.ReadCoord();
- if(iCursor)
- {
- _loc4_ = iMx * this.iRect.width / iRRect.width;
- _loc5_ = iMy * this.iRect.height / iRRect.height;
- iDir = new Point((this.prX + _loc4_ - iCursor.prX) / iRTime,(this.prY + _loc5_ - iCursor.prY) / iRTime);
- }
- this.iTime = _loc3_;
- this.State = stMoveFBub;
- }
- }
- break;
- case stMoveFBub:
- if(!this.MoveFBub())
- {
- if(this.iLostShoot)
- {
- this.State = stAddNewBub;
- }
- else
- {
- this.State = stCalcRemove;
- }
- }
- break;
- case stCalcRemove:
- if(!this.FieldShowRemove())
- {
- this.State = stAddNewBub;
- }
- break;
- case stAddNewBub:
- this.FieldOnEnterFrame();
- if(this.FieldIsAllStates(OBubble.stNormal))
- {
- this.State = stShuffle;
- }
- break;
- case stLevelCompShow:
- this.FieldOnEnterFrame();
- if(!this.FieldShowRemove())
- {
- if(!iBang)
- {
- this.State = stLevelComplete;
- }
- else if(iBang.numChildren == 0)
- {
- this.State = stLevelComplete;
- }
- }
- break;
- case stGameOverShow:
- this.FieldOnEnterFrame();
- if(this.FieldIsAllStates(OBubble.stInvisible))
- {
- this.State = stGameOver;
- }
- }
- }
-
- private function Shuffle() : void
- {
- var _loc1_:int = 0;
- var _loc2_:int = 0;
- _loc1_ = 0;
- while(_loc1_ < OField.iFRows)
- {
- _loc2_ = 0;
- while(_loc2_ < OField.iFCols)
- {
- if(ActiveCell(_loc1_,_loc2_) > 0)
- {
- this.iField[_loc1_][_loc2_].prCInd = this.iCIndexes[this.iRand.RandVal(this.iCIndexes.length)];
- }
- _loc2_++;
- }
- _loc1_++;
- }
- }
-
- public function set State(param1:int) : void
- {
- this.iState = param1;
- switch(this.iState)
- {
- case stInvisible:
- this.prVisible = false;
- case stShowField:
- this.prVisible = true;
- this.FieldInitShow();
- break;
- case stShowFBub:
- this.FieldCalcColors();
- if(this.FieldCheckLevComplete())
- {
- this.State = stLevelCompShow;
- break;
- }
- if(this.FieldCheckGameOver())
- {
- this.State = stGameOverShow;
- break;
- }
- this.iFBub.prCInd = this.iNBub.prCInd;
- if(!this.ColorPresent(this.iFBub.prCInd))
- {
- this.iFBub.prCInd = this.prNextColor;
- }
- this.iNBub.prCInd = this.prNextColor;
- this.iFBub.Pos(this.iFBubP.x,this.iFBubP.y + this.iDiameter);
- this.iFBub.prVisible = true;
- this.iNBub.Pos(this.iFBubP.x,this.iFBubP.y + this.iDiameter * 2);
- this.iNBub.prVisible = true;
- break;
- case stNormal:
- this.iTime = getTimer();
- this.dTime = getTimer();
- break;
- case stMoveFBub:
- this.iLostShoot = false;
- break;
- case stCalcRemove:
- if(!this.FieldCalcRemove())
- {
- this.State = stAddNewBub;
- }
- break;
- case stAddNewBub:
- if(this.iLostShoot)
- {
- this.FieldShowNewBub(this.FieldCalcAddNewBub());
- }
- else
- {
- this.State = stShuffle;
- }
- break;
- case stShuffle:
- if(this.iBubbleFall)
- {
- this.Shuffle();
- }
- this.State = stShowFBub;
- break;
- case stLevelCompShow:
- this.SendGameToServer();
- this.FieldBangBlackBub();
- this.iFBub.prVisible = false;
- this.iNBub.prVisible = false;
- break;
- case stGameOverShow:
- this.SendGameToServer();
- this.FieldInitHide();
- ClusterzL.iGAME.SetSaveGame(null);
- this.iFBub.prVisible = false;
- this.iNBub.prVisible = false;
- }
- }
-
- public function get prRecord() : String
- {
- return this.iRecord.prStr;
- }
-
- public function get prRect() : Rectangle
- {
- return this.iRect;
- }
-
- private function FieldInit() : void
- {
- var _loc1_:Sprite = null;
- var _loc2_:Number = NaN;
- var _loc3_:int = 0;
- var _loc4_:Number = NaN;
- var _loc5_:int = 0;
- this.iDY = Math.round(Math.sqrt(3) * this.iRadius);
- this.iRect = new Rectangle(0,0,this.iDiameter * OField.iFCols + this.iRadius,this.iDY * (OField.iFRows - 1) + this.iDiameter);
- _loc1_ = new Sprite();
- _loc1_.graphics.beginFill(0);
- _loc1_.graphics.drawRect(0,0,this.iRect.width * OGlobal.Scale,this.iRect.height * OGlobal.Scale);
- _loc1_.visible = false;
- this.addChild(_loc1_);
- this.hitArea = _loc1_;
- this.iField = new Array(OField.iFRows);
- _loc2_ = this.iRadius;
- _loc3_ = 0;
- while(_loc3_ < OField.iFRows)
- {
- this.iField[_loc3_] = new Array(OField.iFCols);
- _loc4_ = _loc3_ % 2 == 0 ? this.iRadius : this.iDiameter;
- _loc5_ = 0;
- while(_loc5_ < OField.iFCols)
- {
- this.iField[_loc3_][_loc5_] = new OBubble(this.iRadius,-1,_loc4_,_loc2_);
- this.addChild(this.iField[_loc3_][_loc5_]);
- _loc4_ += this.iDiameter;
- _loc5_++;
- }
- _loc2_ += this.iDY;
- _loc3_++;
- }
- this.iFBubP = new Point(Math.round((this.iDiameter * OField.iFCols + this.iRadius) / 2),_loc2_ - 2 * this.iDY + this.iDiameter);
- this.iFBub = new OBubble(this.iRadius,-1,this.iFBubP.x,this.iFBubP.y);
- this.addChild(this.iFBub);
- this.iNBub = new OBubble(this.iRadius,-1,this.iFBubP.x,this.iFBubP.y + this.iDiameter);
- this.addChild(this.iNBub);
- }
-
- private function NeighbourCount(param1:int, param2:int) : int
- {
- var _loc3_:int = 0;
- _loc3_ = 0;
- if(param1 % 2 == 0)
- {
- if(param1 > 0 && param2 > 0)
- {
- if(iNewField[param1 - 1][param2 - 1] >= 0 && iNewField[param1 - 1][param2 - 1] != OBubble.iColorsCount)
- {
- return 1;
- }
- }
- if(param1 > 0)
- {
- if(iNewField[param1 - 1][param2] >= 0 && iNewField[param1 - 1][param2] != OBubble.iColorsCount)
- {
- return 1;
- }
- }
- if(param2 > 0)
- {
- if(iNewField[param1][param2 - 1] >= 0 && iNewField[param1][param2 - 1] != OBubble.iColorsCount)
- {
- return 1;
- }
- }
- if(param2 < iFCols - 1)
- {
- if(iNewField[param1][param2 + 1] >= 0 && iNewField[param1][param2 + 1] != OBubble.iColorsCount)
- {
- return 1;
- }
- }
- if(param1 < iFRows - 1 && param2 > 0)
- {
- if(iNewField[param1 + 1][param2 - 1] >= 0 && iNewField[param1 + 1][param2 - 1] != OBubble.iColorsCount)
- {
- return 1;
- }
- }
- if(param1 < iFRows - 1)
- {
- if(iNewField[param1 + 1][param2] >= 0 && iNewField[param1 + 1][param2] != OBubble.iColorsCount)
- {
- return 1;
- }
- }
- }
- else
- {
- if(param1 > 0)
- {
- if(iNewField[param1 - 1][param2] >= 0 && iNewField[param1 - 1][param2] != OBubble.iColorsCount)
- {
- return 1;
- }
- }
- if(param2 < iFCols - 1 && param1 > 0)
- {
- if(iNewField[param1 - 1][param2 + 1] >= 0 && iNewField[param1 - 1][param2 + 1] != OBubble.iColorsCount)
- {
- return 1;
- }
- }
- if(param2 > 0)
- {
- if(iNewField[param1][param2 - 1] >= 0 && iNewField[param1][param2 - 1] != OBubble.iColorsCount)
- {
- return 1;
- }
- }
- if(param2 < iFCols - 1)
- {
- if(iNewField[param1][param2 + 1] >= 0 && iNewField[param1][param2 + 1] != OBubble.iColorsCount)
- {
- return 1;
- }
- }
- if(param1 < iFRows - 1)
- {
- if(iNewField[param1 + 1][param2] >= 0 && iNewField[param1 + 1][param2] != OBubble.iColorsCount)
- {
- return 1;
- }
- }
- if(param1 < iFRows - 1 && param2 < iFCols - 1)
- {
- if(iNewField[param1 + 1][param2 + 1] >= 0 && iNewField[param1 + 1][param2 + 1] != OBubble.iColorsCount)
- {
- return 1;
- }
- }
- }
- return _loc3_;
- }
-
- private function FieldCalcFreeBub() : void
- {
- var _loc1_:int = 0;
- var _loc2_:int = 0;
- var _loc3_:int = 0;
- var _loc4_:OBubble = null;
- _loc1_ = 0;
- _loc2_ = 0;
- while(_loc2_ < OField.iFRows)
- {
- _loc3_ = 0;
- while(_loc3_ < OField.iFCols)
- {
- if(!(iNewField[_loc2_][_loc3_] < 0 || iNewField[_loc2_][_loc3_] == OBubble.iColorsCount - 1))
- {
- _loc4_ = iField[_loc2_][_loc3_];
- if(NeighbourCount(_loc2_,_loc3_) == 0)
- {
- _loc4_.prType = this.iBangCount++ + 1;
- }
- }
- _loc3_++;
- }
- _loc2_++;
- }
- }
-
- private function FieldCalcAddNewBub() : Array
- {
- var _loc1_:Array = null;
- var _loc2_:int = 0;
- var _loc3_:int = 0;
- var _loc4_:Array = null;
- _loc1_ = new Array(OField.iFRows);
- _loc2_ = 0;
- while(_loc2_ < OField.iFRows)
- {
- _loc1_[_loc2_] = new Array();
- _loc3_ = 0;
- while(_loc3_ < OField.iFCols)
- {
- if(iField[_loc2_][_loc3_].prCInd >= 0)
- {
- _loc1_[_loc2_].push(-1);
- }
- else if((_loc4_ = this.Neighbours(_loc2_,_loc3_)).length > 0 && _loc4_.length < 4)
- {
- if(this.iRand.RandVal(100) < 100 - iRandomP)
- {
- _loc1_[_loc2_].push(_loc4_[this.iRand.RandVal(_loc4_.length)]);
- }
- else
- {
- _loc1_[_loc2_].push(prNextColor);
- }
- }
- else
- {
- _loc1_[_loc2_].push(-1);
- }
- _loc3_++;
- }
- _loc2_++;
- }
- return _loc1_;
- }
-
- private function Dist2(param1:int, param2:int, param3:Point) : Number
- {
- var _loc4_:Number = NaN;
- var _loc5_:Number = NaN;
- var _loc6_:Number = NaN;
- if(param1 < 0 || param1 >= OField.iFRows || param2 < 0 || param2 >= OField.iFCols)
- {
- return Number.MAX_VALUE;
- }
- _loc4_ = param3.x - this.iField[param1][param2].prX;
- _loc5_ = param3.y - this.iField[param1][param2].prY;
- _loc6_ = _loc4_ * _loc4_ + _loc5_ * _loc5_;
- return this.iField[param1][param2].prCInd < 0 ? -_loc6_ : _loc6_;
- }
-
- private function FieldInitShow() : void
- {
- var _loc1_:int = 0;
- var _loc2_:int = 0;
- var _loc3_:int = 0;
- var _loc4_:OBubble = null;
- _loc1_ = 0;
- _loc2_ = 0;
- while(_loc2_ < OField.iFRows)
- {
- _loc3_ = 0;
- while(_loc3_ < OField.iFCols)
- {
- if((_loc4_ = this.iField[_loc2_][_loc3_]).prCInd >= 0)
- {
- _loc4_.InitShow(_loc1_,4,this.iRadius,0,OUtils.Random(10,15));
- }
- _loc3_++;
- }
- _loc1_ += 5;
- _loc2_++;
- }
- this.iFBub.prVisible = false;
- this.iNBub.prVisible = false;
- }
-
- private function FieldCheckLevComplete() : Boolean
- {
- return this.iBubbleCount == 0;
- }
-
- public function EmulateMove(param1:Point, param2:Rectangle) : void
- {
- var _loc3_:Number = NaN;
- var _loc4_:Number = NaN;
- var _loc5_:Point = null;
- if(this.State != OField.stNormal)
- {
- return;
- }
- _loc3_ = param1.x * this.iRect.width / param2.width;
- _loc4_ = param1.y * this.iRect.height / param2.height;
- (_loc5_ = new Point(_loc3_ - this.iFBubP.x,_loc4_ - this.iFBubP.y)).normalize(this.iRadius);
- this.iFBub.prVel = _loc5_;
- this.iBorderCount = this.iRecord.ReadSmallInt();
- this.iBubbleFall = this.iRecord.ReadFall();
- this.iFR = this.iRecord.ReadSmallInt();
- this.iFC = this.iRecord.ReadSmallInt();
- if(iBubbleFall)
- {
- --this.iBubbleCount;
- }
- if(iCursor)
- {
- iCursor.Pos(this.prX + _loc3_,this.prY + _loc4_);
- iCursor.Blink();
- }
- }
-
- private function CalcFCell(param1:Number, param2:Number) : Boolean
- {
- var _loc3_:Boolean = false;
- var _loc4_:Point = null;
- var _loc5_:Point = null;
- var _loc6_:Point = null;
- var _loc7_:int = 0;
- var _loc8_:int = 0;
- var _loc9_:int = 0;
- var _loc10_:int = 0;
- var _loc11_:int = 0;
- var _loc12_:int = 0;
- var _loc13_:int = 0;
- var _loc14_:int = 0;
- var _loc15_:Number = NaN;
- var _loc16_:Number = NaN;
- var _loc17_:int = 0;
- var _loc18_:int = 0;
- var _loc19_:int = 0;
- var _loc20_:Number = NaN;
- _loc3_ = false;
- (_loc5_ = (_loc4_ = new Point(param1 - this.iFBubP.x,param2 - this.iFBubP.y)).clone()).normalize(0.2 * this.iRadius / 15);
- _loc6_ = this.iFBubP.clone();
- this.iBorderCount = 0;
- _loc7_ = -1;
- _loc8_ = -1;
- _loc9_ = -1;
- _loc10_ = -1;
- _loc11_ = -1;
- _loc12_ = -1;
- while(1)
- {
- if((_loc8_ = (_loc7_ = (_loc6_.y - this.iRadius) / this.iDY + 1) % 2 == 0 ? int(_loc6_.x / this.iDiameter) : int((_loc6_.x - this.iRadius) / this.iDiameter)) < 0)
- {
- _loc8_ = 0;
- }
- _loc15_ = Number.MAX_VALUE;
- _loc16_ = Number.MAX_VALUE;
- _loc17_ = 0;
- while(_loc17_ < 9)
- {
- _loc18_ = _loc7_ + OField.iInd[_loc17_][0];
- _loc19_ = _loc8_ + OField.iInd[_loc17_][1];
- if((_loc20_ = Dist2(_loc18_,_loc19_,_loc6_)) < 0)
- {
- if(Math.abs(_loc20_) < _loc16_)
- {
- _loc16_ = Math.abs(_loc20_);
- _loc11_ = _loc18_;
- _loc12_ = _loc19_;
- }
- }
- else if(_loc20_ < _loc15_)
- {
- _loc15_ = _loc20_;
- _loc9_ = _loc18_;
- _loc10_ = _loc19_;
- }
- _loc17_++;
- }
- _loc7_ = _loc11_;
- _loc8_ = _loc12_;
- if(_loc15_ <= this.iConnectDist2)
- {
- if(iBang)
- {
- ++this.iBubbleCount;
- }
- break;
- }
- if(_loc7_ > iFRows - 2 && _loc5_.y >= 0)
- {
- _loc3_ = true;
- break;
- }
- _loc6_.offset(_loc5_.x,_loc5_.y);
- if(_loc5_.x >= 0 && _loc6_.x + this.iRadius >= this.iRect.width || _loc5_.x < 0 && _loc6_.x - this.iRadius <= 0)
- {
- _loc5_.x = -_loc5_.x;
- ++this.iBorderCount;
- }
- if(_loc5_.y < 0 && _loc6_.y - this.iRadius <= 0)
- {
- _loc5_.y = -_loc5_.y;
- ++this.iBorderCount;
- }
- }
- this.iFR = _loc7_;
- this.iFC = _loc8_;
- if((_loc14_ = (_loc13_ = getTimer()) - this.iTime) >= 19999)
- {
- _loc14_ = 19999;
- }
- _loc14_ /= 200;
- if(this.iBang)
- {
- this.iRecord.WriteNode(param1,param2,_loc14_,iBorderCount,_loc3_,_loc7_,_loc8_);
- }
- this.iTime = _loc13_;
- OSystem.iUserText2 = param1.toString() + "x" + param2.toString() + "/" + this.iFR.toString() + "x" + this.iFC.toString();
- _loc4_.normalize(this.iRadius);
- this.iFBub.prVel = _loc4_;
- return _loc3_;
- }
-
- private function SendGameToServer() : void
- {
- if(this.iBang && this.iRecord.prStr && ClusterzL.iMP.State == OMultiplayer.stInZone)
- {
- ClusterzL.iMP.Turn(["wrl",ClusterzL.iGAME.prLevel,this.prGameIndex,ClusterzL.iGAME.prPlayerName,this.iRecord.prStr]);
- }
- }
-
- private function FieldInitHide() : void
- {
- var _loc1_:int = 0;
- var _loc2_:int = 0;
- var _loc3_:Boolean = false;
- var _loc4_:int = 0;
- var _loc5_:OBubble = null;
- _loc1_ = 90;
- _loc2_ = OField.iFRows - 1;
- while(_loc2_ >= 0)
- {
- _loc3_ = false;
- _loc4_ = 0;
- while(_loc4_ < OField.iFCols)
- {
- if((_loc5_ = this.iField[_loc2_][_loc4_]).prCInd >= 0)
- {
- _loc3_ = true;
- _loc5_.InitHide(_loc1_,this.iRadius,4,0,OUtils.Random(10,15));
- }
- _loc4_++;
- }
- if(_loc3_)
- {
- _loc1_ += 5;
- }
- _loc2_--;
- }
- this.iFBub.prVisible = false;
- this.iNBub.prVisible = false;
- }
-
- public function get prRTime() : int
- {
- return this.iRTime;
- }
-
- public function OnMouseDown(param1:MouseEvent) : void
- {
- var _loc2_:Number = NaN;
- var _loc3_:Number = NaN;
- if(this.iState == stNormal)
- {
- _loc2_ = Math.round(OGlobal.ToLocal(param1.stageX - OGlobal.ViewporRect.x) - this.prX);
- _loc3_ = Math.round(OGlobal.ToLocal(param1.stageY - OGlobal.ViewporRect.y) - this.prY);
- if(_loc3_ - this.iFBubP.y >= 0)
- {
- return;
- }
- this.iBubbleFall = this.CalcFCell(_loc2_,_loc3_);
- this.State = stMoveFBub;
- }
- }
-
- private function FieldCalcRemove() : Boolean
- {
- var _loc1_:int = 0;
- var _loc2_:int = 0;
- var _loc3_:Boolean = false;
- var _loc4_:Number = NaN;
- var _loc5_:int = 0;
- var _loc6_:int = 0;
- var _loc7_:int = 0;
- var _loc8_:OBubble = null;
- iNewField = new Array(OField.iFRows);
- _loc1_ = 0;
- while(_loc1_ < OField.iFRows)
- {
- iNewField[_loc1_] = new Array(OField.iFCols);
- _loc7_ = 0;
- while(_loc7_ < OField.iFCols)
- {
- this.iField[_loc1_][_loc7_].prType = 0;
- iNewField[_loc1_][_loc7_] = this.iField[_loc1_][_loc7_].prCInd;
- _loc7_++;
- }
- _loc1_++;
- }
- _loc2_ = int(this.iField[this.iFR][this.iFC].prCInd);
- this.iBangCount = 0;
- FieldCalcR(this.iFR,this.iFC,_loc2_);
- if(!iBubbleFall)
- {
- if(this.iBangCount < 3)
- {
- this.iBangCount = 0;
- this.iLostShoot = true;
- return false;
- }
- }
- if(this.iBangCount < 0)
- {
- this.iBangCount = 0;
- }
- this.FieldCalcFreeBub();
- _loc3_ = true;
- _loc4_ = 0;
- _loc5_ = 0;
- _loc6_ = 0;
- _loc1_ = 0;
- while(_loc1_ < OField.iFRows)
- {
- _loc7_ = 0;
- while(_loc7_ < OField.iFCols)
- {
- if((_loc8_ = this.iField[_loc1_][_loc7_]).prType)
- {
- _loc8_.prDelta = _loc8_.prType;
- _loc8_.State = OBubble.stBeforeBang;
- if(this.iBubbleFall && _loc1_ == iFR && _loc7_ == iFC)
- {
- _loc8_.State = OBubble.stFlyOut;
- }
- else
- {
- _loc6_++;
- --this.iBubbleCount;
- }
- _loc4_ += _loc7_;
- _loc5_++;
- }
- _loc7_++;
- }
- _loc1_++;
- }
- _loc4_ /= _loc5_ * OField.iFCols;
- if(this.iCounter)
- {
- this.iCounter.prValue += _loc6_ * this.iScorePurBubble;
- }
- OSound.PlaySoundRandom(_loc4_ * 2 - 1,ClusterzL.OSBubbleBangSInd + 1,ClusterzL.OSBubbleBangEInd);
- return true;
- }
-
- private function ActiveCell(param1:int, param2:int) : int
- {
- if(this.iField[param1][param2].prCInd < 0)
- {
- return -1;
- }
- if(this.iField[param1][param2].prCInd == OBubble.iColorsCount - 1)
- {
- return 0;
- }
- return this.iField[param1][param2].prCInd + 1;
- }
-
- private function MoveFBub() : Boolean
- {
- var _loc1_:Point = null;
- var _loc2_:OBubble = null;
- var _loc3_:Number = NaN;
- var _loc4_:Number = NaN;
- var _loc5_:Number = NaN;
- var _loc6_:Number = NaN;
- _loc1_ = this.iFBub.prVel;
- this.iFBub.Move(_loc1_.x,_loc1_.y);
- if(_loc1_.x >= 0 && this.iFBub.prX + this.iRadius >= this.iRect.width || _loc1_.x < 0 && this.iFBub.prX - this.iRadius <= 0)
- {
- _loc1_.x = -_loc1_.x;
- --this.iBorderCount;
- }
- if(_loc1_.y < 0 && this.iFBub.prY - this.iRadius <= 0)
- {
- _loc1_.y = -_loc1_.y;
- --this.iBorderCount;
- }
- _loc2_ = this.iField[this.iFR][this.iFC];
- _loc3_ = _loc2_.prX - this.iFBub.prX;
- _loc4_ = _loc2_.prY - this.iFBub.prY;
- _loc5_ = _loc3_ * _loc3_ + _loc4_ * _loc4_;
- if(iBubbleFall && this.iBorderCount == 0 || !iBubbleFall)
- {
- if(_loc5_ < this.iDiameter * this.iDiameter * 2)
- {
- if((_loc6_ = _loc1_.length * 0.8) < 1.5)
- {
- _loc6_ = 1.5;
- }
- _loc1_.x += _loc3_;
- _loc1_.y += _loc4_;
- _loc1_.normalize(_loc6_);
- if(_loc5_ <= _loc6_ * _loc6_ * 2)
- {
- this.iFBub.prVisible = false;
- if(!iBang)
- {
- ++this.iBubbleCount;
- }
- _loc2_.prCInd = iFBub.prCInd;
- return false;
- }
- }
- }
- return true;
- }
-
- private function FieldIsAllStates(param1:int) : Boolean
- {
- var _loc2_:int = 0;
- var _loc3_:int = 0;
- var _loc4_:OBubble = null;
- _loc2_ = 0;
- while(_loc2_ < OField.iFRows)
- {
- _loc3_ = 0;
- while(_loc3_ < OField.iFCols)
- {
- if((_loc4_ = this.iField[_loc2_][_loc3_]).prCInd >= 0)
- {
- if(_loc4_.State != param1)
- {
- return false;
- }
- }
- _loc3_++;
- }
- _loc2_++;
- }
- return true;
- }
-
- private function FieldCalcR(param1:int, param2:int, param3:int) : void
- {
- var _loc4_:OBubble = null;
- if(param1 < 0 || param1 >= OField.iFRows || param2 < 0 || param2 >= OField.iFCols)
- {
- return;
- }
- if((_loc4_ = this.iField[param1][param2]).prCInd != param3 || Boolean(_loc4_.prType))
- {
- return;
- }
- _loc4_.prType = this.iBangCount++ + 1;
- this.iNewField[param1][param2] = -1;
- if(param1 % 2 == 0)
- {
- FieldCalcR(param1 - 1,param2 - 1,param3);
- FieldCalcR(param1 - 1,param2,param3);
- FieldCalcR(param1,param2 - 1,param3);
- FieldCalcR(param1,param2 + 1,param3);
- FieldCalcR(param1 + 1,param2 - 1,param3);
- FieldCalcR(param1 + 1,param2,param3);
- }
- else
- {
- FieldCalcR(param1 - 1,param2,param3);
- FieldCalcR(param1 - 1,param2 + 1,param3);
- FieldCalcR(param1,param2 - 1,param3);
- FieldCalcR(param1,param2 + 1,param3);
- FieldCalcR(param1 + 1,param2,param3);
- FieldCalcR(param1 + 1,param2 + 1,param3);
- }
- }
-
- public function set prRecord(param1:String) : void
- {
- var _loc2_:Number = NaN;
- var _loc3_:Number = NaN;
- this.iRecord.prStr = param1;
- if(param1)
- {
- this.iRecord.ReadStart();
- this.iRTime = this.iRecord.ReadTime() * 200;
- iMx = this.iRecord.ReadCoord();
- iMy = this.iRecord.ReadCoord();
- if(iCursor != null)
- {
- _loc2_ = iMx * this.iRect.width / iRRect.width;
- _loc3_ = iMy * this.iRect.height / iRRect.height;
- iDir = new Point((this.prX + _loc2_ - iCursor.prX) / iRTime,(this.prY + _loc3_ - iCursor.prY) / iRTime);
- }
- }
- else
- {
- this.iRTime = -1;
- }
- }
-
- public function NewLevel(param1:int, param2:Array = null) : void
- {
- var _loc3_:int = 0;
- var _loc4_:Array = null;
- var _loc5_:int = 0;
- var _loc6_:int = 0;
- var _loc7_:int = 0;
- this.iBubbleCount = 0;
- _loc3_ = param1 < OField.iLevels.length ? param1 : int(param1 % OField.iLevels.length);
- if(_loc3_ >= 0)
- {
- _loc4_ = OField.iLevels[_loc3_];
- }
- else
- {
- _loc4_ = param2;
- }
- this.iMaxColors = _loc4_[0][0];
- if(_loc4_[0].length > 2 && _loc3_ >= 0)
- {
- this.iRandomP = _loc4_[0][2] + 5 * Math.floor(param1 / OField.iLevels.length);
- }
- else
- {
- this.iRandomP = _loc4_[0][2];
- }
- this.iCIndexes = _loc4_[1];
- this.iColors = new Array();
- _loc5_ = 0;
- while(_loc5_ < this.iMaxColors)
- {
- this.iColors[_loc5_] = this.iCIndexes[_loc5_];
- _loc5_++;
- }
- this.iScorePurBubble = (ClusterzL.iGAME.prLevel + 1) * 10;
- if(param2 == null)
- {
- this.iRand.SeedRand(_loc4_[2][this.prGameIndex]);
- }
- else
- {
- this.iRand.SeedRand(_loc4_[2][0]);
- }
- if(this.iBang)
- {
- this.iRecord.WriteStart();
- }
- _loc6_ = 0;
- _loc7_ = 0;
- _loc6_ = 0;
- while(_loc6_ < OField.iFRows)
- {
- _loc7_ = 0;
- while(_loc7_ < OField.iFCols)
- {
- this.iField[_loc6_][_loc7_].prCInd = -1;
- this.iField[_loc6_][_loc7_].prRadius = this.iRadius;
- _loc7_++;
- }
- _loc6_++;
- }
- _loc6_ = 3;
- while(_loc6_ < _loc4_.length)
- {
- _loc7_ = 0;
- while(_loc7_ < _loc4_[_loc6_].length)
- {
- switch(_loc4_[_loc6_][_loc7_])
- {
- case 9:
- this.iField[_loc6_ - 3][_loc7_].prCInd = this.prNextColor;
- ++this.iBubbleCount;
- break;
- case 0:
- break;
- case 8:
- this.iField[_loc6_ - 3][_loc7_].prCInd = OBubble.iColorsCount - 1;
- break;
- default:
- if(_loc4_[_loc6_][_loc7_] <= iColors.length)
- {
- this.iField[_loc6_ - 3][_loc7_].prCInd = this.iColors[_loc4_[_loc6_][_loc7_] - 1];
- ++this.iBubbleCount;
- }
- break;
- }
- _loc7_++;
- }
- _loc6_++;
- }
- this.iFBub.prCInd = this.prNextColor;
- this.iNBub.prCInd = this.prNextColor;
- this.iBangCount = 3;
- if(this.iCounter)
- {
- this.iCounter.prValue = 0;
- }
- this.State = stShowField;
- }
-
- public function set prCursor(param1:OCursor) : void
- {
- this.iCursor = param1;
- }
-
- private function ColorPresent(param1:int) : Boolean
- {
- var _loc2_:int = 0;
- _loc2_ = 0;
- while(_loc2_ < this.iColors.length)
- {
- if(this.iColors[_loc2_] == param1)
- {
- return true;
- }
- _loc2_++;
- }
- return false;
- }
- }
- }
-