index.html 239 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972
  1. <!DOCTYPE html>
  2. <html class="SG-game-show" style="background:none;background-color:transparent; width:100%;" >
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  5. <meta charset="UTF-8">
  6. <meta http-equiv="Content-Type" content="text/html"><meta name="apple-mobile-web-app-capable" content="yes">
  7. <meta name="robots" content="index,follow">
  8. <meta name="apple-touch-fullscreen" content="yes">
  9. <meta property="og:title" content="麻将连连看">
  10. <meta property="og:description" content="麻将连连看,超好玩的消除类游戏">
  11. <meta property="og:type" content="game">
  12. <meta property="fb:app_id" content="">
  13. <meta name="description" content="麻将连连看,超好玩的消除类游戏">
  14. <title>麻将连连看</title>
  15. <meta name="viewport" content="width=device-width,maximum-scale=1.0, initial-scale=1.0, user-scalable=no"><meta name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=no;">
  16. <script type="text/javascript" async src="js/ga.js"></script>
  17. <!--Google Analytics-->
  18. </head>
  19. <body style="margin:0px;padding:0px;-webkit-user-select: none;background: #000;" class="game-show">
  20. <div id="play68-root"><iframe id="play68-iframe" style="display: none; "></iframe></div>
  21. <script type="text/javascript" charset="UTF-8">
  22. //<![CDATA[
  23. (function () {
  24. FZ = {
  25. newClass: function (a, b) {
  26. a === undefined && (a = {});
  27. var c = function () {};
  28. typeof b == "function" && b.hasOwnProperty("prototype") ? c.prototype = b.prototype : typeof b == "object" && (c.prototype = b);
  29. var d = function () {};
  30. if (a.hasOwnProperty("init") || "init" in c.prototype) d = function () {
  31. this.init.apply(this, arguments)
  32. };
  33. d.prototype = new c, d.prototype.constructor = d;
  34. for (var e in a) d.prototype[e] = a[e];
  35. return d
  36. },
  37. $: function (a) {
  38. return document.getElementById(a)
  39. },
  40. Tools: {
  41. splat: function (a) {
  42. if (!a) return [];
  43. return a instanceof Array || typeof a == "object" && typeof a.length == "number" && a.callee ? a : [a]
  44. },
  45. bind: function (a, b, c) {
  46. return function () {
  47. return b.apply(a, FZ.Tools.splat(c))
  48. }
  49. },
  50. bindWithEvent: function (a, b, c) {
  51. return function (d) {
  52. var e = [d];
  53. Array.prototype.push.apply(e, FZ.Tools.splat(c));
  54. return b.apply(a, e)
  55. }
  56. },
  57. trim: function (a) {
  58. return a.replace(/^\s+|\s+$/g, "")
  59. },
  60. extend: function (a, b) {
  61. for (var c in b) a[c] = b[c]
  62. }
  63. },
  64. EngineOptions: {
  65. DebugLevel: "error"
  66. },
  67. _trace: function (a) {
  68. FZ.EngineOptions.DebugLevel === "info" && console.log(a)
  69. },
  70. _assert: function (a, b) {
  71. (FZ.EngineOptions.DebugLevel === "error" || FZ.EngineOptions.DebugLevel === "info") && !a && alert(b)
  72. }
  73. }
  74. })(),
  75. function () {
  76. FZ.ResourceManager = {
  77. __ResourceCount: 0,
  78. __ResourceLoaded: 0,
  79. __GeneralCallback: null,
  80. __GeneralCallbackObj: null,
  81. ResourceLib: {},
  82. isResourceLoaded: function () {
  83. return this.__ResourceCount === this.__ResourceLoaded
  84. },
  85. addResource: function (a) {
  86. if (this.ResourceFactory.hasOwnProperty(a.Type)) {
  87. this.__ResourceCount++;
  88. var b = {
  89. Resource: null,
  90. Loaded: !1
  91. };
  92. this.ResourceLib[a.Name] = b, FZ._trace("Add/load resource[" + a.Name + "] : " + a.URL);
  93. var c = new this.ResourceFactory[a.Type](a.URL, b);
  94. c.setCallback(function () {
  95. b.Loaded = !0, FZ.ResourceManager.__ResourceLoaded++, a.callback && a.callback(b.Resource), FZ.ResourceManager.__GeneralCallback && FZ.ResourceManager.__GeneralCallback.call()
  96. }), c.load()
  97. } else Throw("Error: Do not suppport Resourcetype:" + a.Type)
  98. },
  99. setCallback: function (a) {
  100. this.__GeneralCallback = a
  101. },
  102. getLoadingRatio: function () {
  103. if (this.__ResourceCount === 0) return 1;
  104. return this.__ResourceLoaded / this.__ResourceCount
  105. },
  106. ResourceFactory: {},
  107. registerResourceType: function (a, b) {
  108. this.ResourceFactory[a] = b
  109. }
  110. }, FZ.Class_Resource = {
  111. callback: function () {},
  112. init: function (a, b) {
  113. this.URL = a, this.target = b
  114. },
  115. setCallback: function (a) {
  116. this.callback = a
  117. }
  118. }
  119. }(),
  120. function () {
  121. var a = FZ.newClass({
  122. load: function () {
  123. var a = new Audio;
  124. a.src = this.URL, a.load(), a.play(), a.pause(), this.callback(), this.target.Resource = a
  125. }
  126. }, FZ.Class_Resource);
  127. FZ.ResourceManager.registerResourceType("Audio", a)
  128. }(),
  129. function () {
  130. var a = FZ.newClass({
  131. load: function () {
  132. this.target.Resource = document.createElement("script"), this.target.Resource.addEventListener("load", this.callback, !1), this.target.Resource.src = this.URL, document.body.appendChild(this.target.Resource)
  133. }
  134. }, FZ.Class_Resource);
  135. FZ.ResourceManager.registerResourceType("Js", a)
  136. }(),
  137. function () {
  138. var a = FZ.newClass({
  139. load: function () {
  140. this.target.Resource = new Image, this.target.Resource.addEventListener("load", this.callback, !1), this.target.Resource.addEventListener("error", function () {
  141. //alert(this.URL)
  142. }, !1), this.target.Resource.src = this.URL
  143. }
  144. }, FZ.Class_Resource);
  145. FZ.ResourceManager.registerResourceType("Image", a)
  146. }(),
  147. function () {
  148. FZ.stateStatus = {}, FZ.stateStatus.INIT = 0, FZ.stateStatus.NORMAL = 5, FZ.stateStatus.HIDENOTIFY = 15, FZ.stateStatus.HIDELOGIC = 20, FZ.stateStatus.DONOTHING = 30, FZ.GameStateBase = FZ.newClass({
  149. StateName: "GameStateBase",
  150. m_status: FZ.stateStatus.NORMAL,
  151. init: function () {
  152. FZ.GameBase.registerState(this.StateName, this)
  153. },
  154. pause: function () {
  155. this.m_status = FZ.stateStatus.HIDENOTIFY
  156. },
  157. resume: function () {
  158. this.m_status = FZ.stateStatus.NORMAL
  159. },
  160. preProcess: function () {},
  161. postProcess: function () {},
  162. AIUpdate: function (a) {},
  163. visualUpdate: function () {}
  164. }), FZ.GameBase = {
  165. Time: (new Date).getTime(),
  166. FrameNum: 0,
  167. Fps: 0,
  168. Fps_lastTime: 0,
  169. Fps_lastFrame: 0,
  170. DefaultFPS: 30,
  171. CurrentState: null,
  172. __StateLib: {},
  173. __stateStack: [],
  174. Width: 640,
  175. Height: 480,
  176. MainCanvas: null,
  177. MainContext: null,
  178. Name: "",
  179. SaveObject: {},
  180. init: function (a) {
  181. this.MainCanvas = document.createElement("canvas"), this.MainCanvas.width = this.Width, this.MainCanvas.height = this.Height, this.MainContext = this.MainCanvas.getContext("2d"), this.MainCanvas.addEventListener("mousemove", FZ.Tools.bindWithEvent(FZ.ControlManager, FZ.ControlManager.MouseMove), !1), this.MainCanvas.addEventListener("mousedown", FZ.Tools.bindWithEvent(FZ.ControlManager, FZ.ControlManager.MouseDown), !1), this.MainCanvas.addEventListener("mouseup", FZ.Tools.bindWithEvent(FZ.ControlManager, FZ.ControlManager.MouseUp), !1), this.theInterval = setInterval(FZ.Tools.bind(this, this.update), 1e3 / this.DefaultFPS), a.appendChild(this.MainCanvas)
  182. },
  183. update: function () {
  184. var a = 0,
  185. b = null;
  186. this.FrameNum++;
  187. var c = (new Date).getTime(),
  188. d = (c - this.Time) / 1e3;
  189. this.Time = c, this.time - this.Fps_lastTime > 1e3 && (this.Fps = Math.round(10 * (this.FrameNum - this.Fps_lastFrame) / ((this.Time - this.Fps_lastTime) / 1e3)) / 10, this.Fps_lastTime = this.Time, this.Fps_lastFrame = this.FrameNum);
  190. for (a = 0; a < this.__stateStack.length; a++) b = this.__stateStack[a], b && b !== this.CurrentState && (FZ.stateStatus.NORMAL === b.m_status ? (b.AIUpdate(d), b.visualUpdate()) : FZ.stateStatus.HIDENOTIFY === b.m_status ? b.visualUpdate() : FZ.stateStatus.HIDELOGIC === b.m_status ? b.AIUpdate(d) : FZ.stateStatus.DONOTHING !== b.m_status);
  191. null !== this.CurrentState && (this.CurrentState.AIUpdate(d), this.CurrentState.visualUpdate())
  192. },
  193. saveGame: function () {
  194. FZ._assert(this.Name != "", "Please set the name of the game first"), localStorage["FZ.Game." + this.Name] = FZ.JSON.stringify(this.SaveObject)
  195. },
  196. loadGame: function () {
  197. FZ._assert(this.Name != "", "Please set the name of the game first");
  198. if (this.Name == "") return !1;
  199. if (!localStorage.hasOwnProperty("FZ.Game." + this.Name)) {
  200. this.SaveObject = {};
  201. return !1
  202. }
  203. this.SaveObject = FZ.JSON.parse(localStorage["FZ.Game." + this.Name]);
  204. return !0
  205. },
  206. registerState: function (a, b) {
  207. this.__StateLib[a] = b
  208. },
  209. getState: function (a) {
  210. return this.__StateLib[a]
  211. },
  212. switchToState: function (a) {
  213. var b = this.CurrentState.StateName,
  214. c = [b];
  215. Array.prototype.push.apply(c, arguments), this.CurrentState.postProcess(), this.CurrentState = this.__StateLib[a], this.CurrentState.preProcess.apply(this.CurrentState, c), FZ.PrintLog("switchToState")
  216. },
  217. resetAllState: function () {
  218. var a = 0;
  219. a = this.__stateStack.length, this.__stateStack.splice(0, a)
  220. },
  221. pushState: function (a) {
  222. this.__stateStack.push(this.__StateLib[a])
  223. },
  224. popState: function () {
  225. this.CurrentState = this.__stateStack.pop(), undefined !== this.CurrentState && null !== this.CurrentState && this.CurrentState.resume && this.CurrentState.resume.apply(this.CurrentState, arguments)
  226. }
  227. }, FZ.GameBase.CurrentState = new FZ.GameStateBase
  228. }(),
  229. function () {
  230. FZ.Sprite = FZ.newClass({
  231. __currentIdx: 0,
  232. __currentFrameTime: 0,
  233. __matrixDirty: !0,
  234. __inverseMatrixDirty: !0,
  235. init: function (a, b) {
  236. this.__theImages = [], this.__children = [], this.__localMatrix = new FZ.Math.Matrix3, this.__worldMatrix = new FZ.Math.Matrix3, this.__inverseMatrix = new FZ.Math.Matrix3, this.__parentSprite = undefined, this.__playing = Boolean(b);
  237. if (!a || a.length === 0) this.__currentIdx = -1;
  238. else
  239. for (var c = 0, d = a.length; c < d; ++c) a[c] instanceof Array ? this.__theImages.push([a[c][0], a[c][1] ? a[c][1] : .033]) : this.__theImages.push([a[c], .033])
  240. },
  241. clone: function () {
  242. var a = new FZ.Sprite;
  243. a.__theImages = this.__theImages, a.__localMatrix = this.__localMatrix.clone(), a.__currentIdx = this.__theImages.length === 0 ? -1 : 0;
  244. for (var b = 0, c = this.__children.length; b < c; ++b) a.addChild(this.__children[b].clone());
  245. return a
  246. },
  247. setFrameTime: function (a) {
  248. if (typeof a == "number")
  249. for (var b = 0, c = this.__theImages.length; b < c; ++b) this.__theImages[b][1] = a;
  250. else
  251. for (var b = 0; b < a.length && b < __theImages.length; ++b) this.__theImages[b][1] = a[b]
  252. },
  253. addChild: function (a) {
  254. this.__children.push(a), a.__parentSprite = this
  255. },
  256. update: function (a) {
  257. if ( !! this.__playing) {
  258. for (var b = 0, c = this.__children.length; b < c; ++b) this.__children[b].update(a);
  259. if (this.__currentIdx === -1) return;
  260. this.__currentFrameTime += a;
  261. while (this.__currentFrameTime > this.__theImages[this.__currentIdx][1]) this.__currentFrameTime -= this.__theImages[this.__currentIdx][1], this.__currentIdx++, this.__currentIdx === this.__theImages.length && (this.__currentIdx = 0)
  262. }
  263. },
  264. setFrame: function (a) {
  265. this.__currentIdx = FZ.Math.clamp(a, 0, this.__theImages.length - 1)
  266. },
  267. stop: function () {
  268. this.__playing = !1
  269. },
  270. play: function () {
  271. this.__playing = !0
  272. },
  273. getPosition: function () {
  274. this.__DirtyMatrixProcess();
  275. var a = new FZ.Math.Vector2(0, 0);
  276. return a.applyTransform(this.__worldMatrix, a)
  277. },
  278. localToWorld: function (a) {
  279. this.__DirtyMatrixProcess();
  280. return a.applyTransform(this.__worldMatrix)
  281. },
  282. worldToLocal: function (a) {
  283. this.__DirtyInverseMatrixProcess();
  284. return a.applyTransform(this.__inverseMatrix)
  285. },
  286. __markMatrixDirty: function () {
  287. if (!this.__matrixDirty) {
  288. this.__matrixDirty = !0, this.__inverseMatrixDirty = !0;
  289. for (var a = 0, b = this.__children.length; a < b; ++a) this.__children[a].__markMatrixDirty()
  290. }
  291. },
  292. __DirtyInverseMatrixProcess: function () {
  293. this.__DirtyMatrixProcess(), this.__inverseMatrixDirty && (this.__worldMatrix.inverseAffine(this.__inverseMatrix), this.__inverseMatrixDirty = !1)
  294. },
  295. __DirtyMatrixProcess: function () {
  296. this.__matrixDirty && (this.__parentSprite ? this.__parentSprite.__worldMatrix.mul(this.__localMatrix, this.__worldMatrix) : this.__worldMatrix = this.__localMatrix, this.__matrixDirty = !1)
  297. },
  298. draw: function (a) {
  299. this.__DirtyMatrixProcess();
  300. for (var b = 0, c = this.__children.length; b < c; ++b) this.__children[b].draw(a);
  301. this.__currentIdx !== -1 && (a.setTransform(this.__worldMatrix.m11, this.__worldMatrix.m12, this.__worldMatrix.m21, this.__worldMatrix.m22, this.__worldMatrix.dx, this.__worldMatrix.dy), a.drawImage(this.__theImages[this.__currentIdx][0], 0, 0))
  302. },
  303. translate: function (a, b) {
  304. this.__localMatrix.translate(a, b), this.__markMatrixDirty()
  305. },
  306. rotate: function (a) {
  307. this.__localMatrix.rotate(a), this.__markMatrixDirty()
  308. },
  309. scale1: function (a) {
  310. this.__localMatrix.scale1(a), this.__markMatrixDirty()
  311. },
  312. scale2: function (a, b) {
  313. this.__localMatrix.scale2(a, b), this.__markMatrixDirty()
  314. },
  315. makeTranslate: function (a, b) {
  316. this.__localMatrix.makeTranslate(a, b), this.__markMatrixDirty()
  317. },
  318. makeRotate: function (a) {
  319. this.__localMatrix.makeRotate(a), this.__markMatrixDirty()
  320. },
  321. makeScale1: function (a) {
  322. this.__localMatrix.makeScale1(a), this.__markMatrixDirty()
  323. },
  324. makeScale2: function (a, b) {
  325. this.__localMatrix.makeScale2(a, b), this.__markMatrixDirty()
  326. },
  327. resetMatrix: function () {
  328. this.__localMatrix.identity(), this.__markMatrixDirty()
  329. }
  330. }), FZ.spriteManager = {
  331. __sprites: {},
  332. addResource: function (a, b, c, d, e, f) {
  333. FZ.ResourceManager.addResource({
  334. Name: a,
  335. Type: "Image",
  336. URL: c,
  337. callback: function (b) {
  338. if (f === 1) FZ.spriteManager.__sprites[a] = new FZ.Sprite([b]);
  339. else {
  340. var c = [];
  341. for (var g = 0; g < f; ++g) {
  342. var h = document.createElement("canvas");
  343. h.width = b.width / f, h.height = b.height, h.getContext("2d").drawImage(b, b.width / f * g, 0, b.width / f, b.height, 0, 0, b.width / f, b.height), c.push([h])
  344. }
  345. FZ.spriteManager.__sprites[a] = new FZ.Sprite(c)
  346. }
  347. FZ.spriteManager.__sprites[a].makeTranslate(d, e)
  348. }
  349. })
  350. },
  351. getSprite: function (a) {
  352. return this.__sprites[a]
  353. }
  354. }
  355. }(),
  356. function () {
  357. FZ.Math = {
  358. lerp: function (a, b, c) {
  359. a = a < 0 ? 0 : a > 1 ? 1 : a;
  360. return c * a + (1 - a) * b
  361. },
  362. random: function (a, b) {
  363. return FZ.Math.lerp(Math.random(), a, b)
  364. },
  365. clamp: function (a, b, c) {
  366. return a < b ? b : a > c ? c : a
  367. },
  368. round: function (a, b) {
  369. b = Math.pow(10, b || 0);
  370. return Math.round(a * b) / b
  371. },
  372. Vector2: FZ.newClass({
  373. x: 0,
  374. y: 0,
  375. init: function (a, b) {
  376. b !== undefined && (this.x = a ? a : 0, this.y = b ? b : 0)
  377. },
  378. clone: function () {
  379. return new FZ.Math.Vector2(this.x, this.y)
  380. },
  381. add: function (a, b) {
  382. b === undefined && (b = new FZ.Math.Vector2), b.x = this.x + a.x, b.y = this.y + a.y;
  383. return b
  384. },
  385. sub: function (a, b) {
  386. b === undefined && (b = new FZ.Math.Vector2), b.x = this.x - a.x, b.y = this.y - a.y;
  387. return b
  388. },
  389. normalize: function (a) {
  390. a === undefined && (a = new FZ.Math.Vector2);
  391. var b = 1 / this.length();
  392. a.x = this.x * b, a.y = this.y * b;
  393. return a
  394. },
  395. scale: function (a, b) {
  396. b === undefined && (b = new FZ.Math.Vector2), b.x = this.x * a, b.y = this.y * a;
  397. return b
  398. },
  399. applyTransform: function (a, b) {
  400. b === undefined && (b = new FZ.Math.Vector2), tx = a.m11 * this.x + a.m21 * this.y + a.dx, ty = a.m12 * this.x + a.m22 * this.y + a.dy, b.x = tx, b.y = ty;
  401. return b
  402. },
  403. dot: function (a) {
  404. return this.x * a.x + this.y * a.y
  405. },
  406. length: function () {
  407. return Math.sqrt(this.x * this.x + this.y * this.y)
  408. },
  409. lengthSquared: function () {
  410. return this.x * this.x + this.y * this.y
  411. }
  412. }),
  413. Matrix3: FZ.newClass({
  414. m11: 1,
  415. m21: 0,
  416. dx: 0,
  417. m12: 0,
  418. m22: 1,
  419. dy: 0,
  420. set: function (a, b, c, d, e, f) {
  421. this.m11 = a, this.m21 = c, this.dx = e, this.m12 = b, this.m22 = d, this.dy = f;
  422. return this
  423. },
  424. clone: function () {
  425. var a = new FZ.Math.Matrix3;
  426. a.m11 = this.m11, a.m21 = this.m21, a.m12 = this.m12, a.m22 = this.m22, a.dx = this.dx, a.dy = this.dy;
  427. return a
  428. },
  429. identity: function () {
  430. this.m11 = 1, this.m21 = 0, this.dx = 0, this.m12 = 0, this.m22 = 1, this.dy = 0;
  431. return this
  432. },
  433. mul: function (a, b) {
  434. b === undefined && (b = new FZ.Math.Matrix3);
  435. var c = this.m11 * a.m11 + this.m21 * a.m12,
  436. d = this.m11 * a.m21 + this.m21 * a.m22,
  437. e = this.m12 * a.m11 + this.m22 * a.m12,
  438. f = this.m12 * a.m21 + this.m22 * a.m22,
  439. g = this.dx + this.m11 * a.dx + this.m21 * a.dx,
  440. h = this.dy + this.m12 * a.dx + this.m22 * a.dy;
  441. b.m11 = c, b.m21 = d, b.m12 = e, b.m22 = f, b.dx = g, b.dy = h;
  442. return b
  443. },
  444. makeRotate: function (a) {
  445. var b = Math.sin(a),
  446. c = Math.cos(a);
  447. this.m11 = c, this.m21 = -b, this.m12 = b, this.m22 = c;
  448. return this
  449. },
  450. rotate: function (a) {
  451. var b = Math.sin(a),
  452. c = Math.cos(a),
  453. d = this.m11 * c + this.m21 * b,
  454. e = -this.m11 * b + this.m21 * c,
  455. f = this.m12 * c + this.m22 * b,
  456. g = -this.m12 * b + this.m22 * c;
  457. this.m11 = d, this.m21 = e, this.m12 = f, this.m22 = g;
  458. return this
  459. },
  460. makeScale1: function (a) {
  461. return this.makeScale2(a, a)
  462. },
  463. scale1: function (a) {
  464. return this.scale2(a, a)
  465. },
  466. makeScale2: function (a, b) {
  467. this.m11 = a, this.m22 = b, this.m12 = 0, this.m21 = 0;
  468. return this
  469. },
  470. scale2: function (a, b) {
  471. this.m11 *= a, this.m21 *= b, this.m12 *= a, this.m22 *= b;
  472. return this
  473. },
  474. makeTranslate: function (a, b) {
  475. this.dx = a, this.dy = b;
  476. return this
  477. },
  478. translate: function (a, b) {
  479. this.dx += this.m11 * a + this.m21 * b, this.dy += this.m12 * a + this.m22 * b;
  480. return this
  481. },
  482. inverseAffine: function (a) {
  483. a === undefined && (a = new FZ.Math.Matrix3);
  484. var b = 1 / (this.m11 * this.m22 - this.m21 * this.m12),
  485. c = this.m22 * b,
  486. d = this.m12 * b,
  487. e = this.m21 * b,
  488. f = this.m11 * b,
  489. g = -(c * this.dx + d * this.dy),
  490. h = -(e * this.dx + f * this.dy);
  491. a.m11 = c, a.m21 = d, a.m12 = e, a.m22 = f, a.dx = g, a.dy = h;
  492. return a
  493. }
  494. })
  495. }
  496. }(),
  497. function () {
  498. function f(a) {
  499. return a < 10 ? "0" + a : a
  500. }
  501. function str(a, b) {
  502. var c, d, e, f, g = gap,
  503. h, i = b[a];
  504. i && typeof i == "object" && typeof i.toJSON == "function" && (i = i.toJSON(a)), typeof rep == "function" && (i = rep.call(b, a, i));
  505. switch (typeof i) {
  506. case "string":
  507. return quote(i);
  508. case "number":
  509. return isFinite(i) ? String(i) : "null";
  510. case "boolean":
  511. case "null":
  512. return String(i);
  513. case "object":
  514. if (!i) return "null";
  515. gap += indent, h = [];
  516. if (Object.prototype.toString.apply(i) === "[object Array]") {
  517. f = i.length;
  518. for (c = 0; c < f; c += 1) h[c] = str(c, i) || "null";
  519. e = h.length === 0 ? "[]" : gap ? "[\n" + gap + h.join(",\n" + gap) + "\n" + g + "]" : "[" + h.join(",") + "]", gap = g;
  520. return e
  521. }
  522. if (rep && typeof rep == "object") {
  523. f = rep.length;
  524. for (c = 0; c < f; c += 1) d = rep[c], typeof d == "string" && (e = str(d, i), e && h.push(quote(d) + (gap ? ": " : ":") + e))
  525. } else
  526. for (d in i) Object.hasOwnProperty.call(i, d) && (e = str(d, i), e && h.push(quote(d) + (gap ? ": " : ":") + e));
  527. e = h.length === 0 ? "{}" : gap ? "{\n" + gap + h.join(",\n" + gap) + "\n" + g + "}" : "{" + h.join(",") + "}", gap = g;
  528. return e
  529. }
  530. }
  531. function quote(a) {
  532. escapable.lastIndex = 0;
  533. return escapable.test(a) ? '"' + a.replace(escapable, function (a) {
  534. var b = meta[a];
  535. return typeof b == "string" ? b : "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4)
  536. }) + '"' : '"' + a + '"'
  537. }
  538. FZ.JSON = {
  539. parse: function (text, reviver) {
  540. function walk(a, b) {
  541. var c, d, e = a[b];
  542. if (e && typeof e == "object")
  543. for (c in e) Object.hasOwnProperty.call(e, c) && (d = walk(e, c), d !== undefined ? e[c] = d : delete e[c]);
  544. return reviver.call(a, b, e)
  545. }
  546. var j;
  547. text = String(text), cx.lastIndex = 0, cx.test(text) && (text = text.replace(cx, function (a) {
  548. return "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4)
  549. }));
  550. if (/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) {
  551. j = eval("(" + text + ")");
  552. return typeof reviver == "function" ? walk({
  553. "": j
  554. }, "") : j
  555. }
  556. throw new SyntaxError("JSON.parse")
  557. },
  558. stringify: function (a, b, c) {
  559. var d;
  560. gap = "", indent = "";
  561. if (typeof c == "number")
  562. for (d = 0; d < c; d += 1) indent += " ";
  563. else typeof c == "string" && (indent = c);
  564. rep = b;
  565. if (b && typeof b != "function" && (typeof b != "object" || typeof b.length != "number")) throw new Error("JSON.stringify");
  566. return str("", {
  567. "": a
  568. })
  569. }
  570. };
  571. var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
  572. escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
  573. gap, indent, meta = {
  574. "\b": "\\b",
  575. "\t": "\\t",
  576. "\n": "\\n",
  577. "\f": "\\f",
  578. "\r": "\\r",
  579. '"': '\\"',
  580. "\\": "\\\\"
  581. }, rep;
  582. typeof Date.prototype.toJSON != "function" && (Date.prototype.toJSON = function (a) {
  583. return isFinite(this.valueOf()) ? this.getUTCFullYear() + "-" + f(this.getUTCMonth() + 1) + "-" + f(this.getUTCDate()) + "T" + f(this.getUTCHours()) + ":" + f(this.getUTCMinutes()) + ":" + f(this.getUTCSeconds()) + "Z" : null
  584. }, String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function (a) {
  585. return this.valueOf()
  586. })
  587. }(),
  588. function () {
  589. FZ.ArrayIndexof = function (a, b) {
  590. var c = 0;
  591. for (c = 0; c < a.length; c++)
  592. if (b === a[c]) return c;
  593. return -1
  594. }, FZ.ControlManager = {
  595. m_monitor_list: [],
  596. Mouse: {
  597. x: 0,
  598. y: 0,
  599. leftKey: !1,
  600. middleKey: !1,
  601. rightKey: !1
  602. },
  603. MouseMove: function (a) {
  604. a.offsetX ? (this.Mouse.x = a.offsetX, this.Mouse.y = a.offsetY) : a.layerX && (this.Mouse.x = a.layerX - FZ.GameBase.MainCanvas.offsetLeft, this.Mouse.y = a.layerY - FZ.GameBase.MainCanvas.offsetTop)
  605. },
  606. MouseUp: function (a) {
  607. if (a.button === 0) {
  608. this.Mouse.leftKey = !1;
  609. for (var b = 0; b < this.m_monitor_list.length; b++) {
  610. var c = this.m_monitor_list[b];
  611. c && c.CustomMouseUp && c.CustomMouseUp(this.Mouse)
  612. }
  613. }
  614. },
  615. MouseDown: function (a) {
  616. if (a.button === 0) {
  617. this.Mouse.leftKey = !0;
  618. for (var b = 0; b < this.m_monitor_list.length; b++) {
  619. var c = this.m_monitor_list[b];
  620. c && c.CustomMouseDown && c.CustomMouseDown(this.Mouse)
  621. }
  622. }
  623. },
  624. addMonitor: function (a) {
  625. var b = FZ.ArrayIndexof(this.m_monitor_list, a); - 1 === b && this.m_monitor_list.push(a)
  626. },
  627. removeMonitor: function (a) {
  628. var b = FZ.ArrayIndexof(this.m_monitor_list, a); - 1 !== b && this.m_monitor_list.splice(b, 1)
  629. },
  630. clearMonitor: function () {
  631. while (this.m_monitor_list.length > 0) this.m_monitor_list.pop()
  632. }
  633. }
  634. }(),
  635. function () {
  636. FZ.Music = {
  637. theAudio: null,
  638. theIntervalId: 0,
  639. isMute: !1,
  640. set: function (a, b) {
  641. this.loop = Boolean(b), this.theAudio = a, a.loop = b
  642. },
  643. setMute: function (a) {
  644. this.isMute = a, this.isMute ? this.stop() : this.play()
  645. },
  646. play: function () {
  647. this.isMute || (this.stop(), this.theAudio.play(), this.theAudio.duration && (this.loop ? this.theIntervalId = window.setInterval(this.replay, Math.floor(this.theAudio.duration * 1e3) - 1e3) : window.setTimeout(function () {
  648. this.theAudio.pause();
  649. try {
  650. this.theAudio.currentTime = 0
  651. } catch (a) {}
  652. }, Math.floor(this.theAudio.duration * 1e3) - 1e3)))
  653. },
  654. stop: function () {
  655. if ( !! this.theAudio) {
  656. this.theAudio.pause();
  657. try {
  658. this.theAudio.currentTime = 0
  659. } catch (a) {}
  660. window.clearInterval(this.theIntervalId)
  661. }
  662. },
  663. replay: function () {
  664. FZ.Music.stop(), FZ.Music.play()
  665. },
  666. pageHide: function (a) {
  667. FZ.Music.theAudio && FZ.Music.stop()
  668. },
  669. pageShow: function (a) {
  670. FZ.Music.theAudio && FZ.Music.play()
  671. }
  672. }, window.addEventListener("pagehide", FZ.Music.pageHide, !1), window.addEventListener("pageshow", FZ.Music.pageShow, !1)
  673. }(),
  674. function () {
  675. FZ.StateDefs = {
  676. STATE_UNKNOW: -1,
  677. STATE_INIT: 5,
  678. STATE_LOAD: 10,
  679. STATE_NORMAL: 15,
  680. STATE_HIDE: 20,
  681. STATE_SHOW_NO_LOGIC: 25,
  682. STATE_UNLOAD: 30,
  683. STATE_DESTROY: 35,
  684. GAME_STATE_UNKNOW: "",
  685. GAME_STATE_PRELOADING: "gamepreloading",
  686. GAME_STATE_LOADING: "gameloading",
  687. GAME_STATE_LOGO: "gamelogo",
  688. GAME_STATE_MAINMEN: "gamemainmenu",
  689. GAME_STATE_GAME_IN: "gamein",
  690. GAME_STATE_GAME_CLEAR: "gameclear",
  691. GAME_STATE_OVER: "gameover",
  692. GAME_STATE_RESET: "gamereset",
  693. GAME_STATE_NEXT_LEVEL: "gamenextlevel",
  694. GAME_STATE_GAME_WIN: "gamewin",
  695. GAME_STATE_CREDITS: "gamecredits",
  696. GAME_STATE_HELP: "gamehelp"
  697. }
  698. }(),
  699. function () {
  700. FZ.IphoneMusic = ["res/music/htmlMahjong.mp3"], FZ.IphoneUI = [{
  701. name: "ARROW_CENTER",
  702. zOrder: 3,
  703. fileURL: "ARROW_CENTER.png",
  704. x: 0,
  705. y: 0,
  706. w: 149,
  707. h: 156,
  708. tags: ["GameIn"],
  709. cols: 1
  710. }, {
  711. name: "ARROW_DOWN",
  712. zOrder: 3,
  713. fileURL: "ARROW_DOWN.png",
  714. x: 137,
  715. y: 112,
  716. w: 43,
  717. h: 258,
  718. tags: ["GameIn"],
  719. cols: 1
  720. }, {
  721. name: "ARROW_LEFT",
  722. zOrder: 3,
  723. fileURL: "ARROW_LEFT.png",
  724. x: 64,
  725. y: 214,
  726. w: 188,
  727. h: 43,
  728. tags: ["GameIn"],
  729. cols: 1
  730. }, {
  731. name: "ARROW_LEFT_RIGHT",
  732. zOrder: 3,
  733. fileURL: "ARROW_LEFT_RIGHT.png",
  734. x: 64,
  735. y: 213,
  736. w: 191,
  737. h: 43,
  738. tags: ["GameIn"],
  739. cols: 1
  740. }, {
  741. name: "ARROW_RIGHT",
  742. zOrder: 3,
  743. fileURL: "ARROW_RIGHT.png",
  744. x: 68,
  745. y: 214,
  746. w: 188,
  747. h: 43,
  748. tags: ["GameIn"],
  749. cols: 1
  750. }, {
  751. name: "ARROW_UP",
  752. zOrder: 3,
  753. fileURL: "ARROW_UP.png",
  754. x: 136,
  755. y: 113,
  756. w: 44,
  757. h: 258,
  758. tags: ["GameIn"],
  759. cols: 1
  760. }, {
  761. name: "ARROW_UP_DOWN",
  762. zOrder: 3,
  763. fileURL: "ARROW_UP_DOWN.png",
  764. x: 137,
  765. y: 121,
  766. w: 43,
  767. h: 241,
  768. tags: ["GameIn"],
  769. cols: 1
  770. }, {
  771. name: "BTN_GAME_NO",
  772. zOrder: 4,
  773. fileURL: "BTN_GAME_NO.png",
  774. x: 84,
  775. y: 258,
  776. w: 158,
  777. h: 45,
  778. tags: ["quit"],
  779. cols: 1
  780. }, {
  781. name: "BTN_CLEAR_GAME_NO",
  782. zOrder: 4,
  783. fileURL: "BTN_GAME_NO.png",
  784. x: 84,
  785. y: 331,
  786. w: 158,
  787. h: 45,
  788. tags: ["ClearGame"],
  789. cols: 1
  790. }, {
  791. name: "BTN_GAME_NO_TOUCH",
  792. zOrder: 4,
  793. fileURL: "BTN_GAME_NO_TOUCH.png",
  794. x: 84,
  795. y: 258,
  796. w: 158,
  797. h: 45,
  798. tags: ["quit"],
  799. cols: 1
  800. }, {
  801. name: "BTN_CLEAR_GAME_NO_TOUCH",
  802. zOrder: 4,
  803. fileURL: "BTN_GAME_NO_TOUCH.png",
  804. x: 84,
  805. y: 331,
  806. w: 158,
  807. h: 45,
  808. tags: ["ClearGame"],
  809. cols: 1
  810. }, {
  811. name: "BTN_GAME_YES",
  812. zOrder: 4,
  813. fileURL: "BTN_GAME_YES.png",
  814. x: 84,
  815. y: 208,
  816. w: 158,
  817. h: 46,
  818. tags: ["quit"],
  819. cols: 1
  820. }, {
  821. name: "BTN_CLEAR_GAME_YES",
  822. zOrder: 4,
  823. fileURL: "BTN_GAME_YES.png",
  824. x: 84,
  825. y: 281,
  826. w: 158,
  827. h: 46,
  828. tags: ["ClearGame"],
  829. cols: 1
  830. }, {
  831. name: "BTN_GAME_YES_TOUCH",
  832. zOrder: 0,
  833. fileURL: "BTN_GAME_YES_TOUCH.png",
  834. x: 84,
  835. y: 208,
  836. w: 158,
  837. h: 46,
  838. tags: ["quit"],
  839. cols: 1
  840. }, {
  841. name: "BTN_CLEAR_GAME_YES_TOUCH",
  842. zOrder: 4,
  843. fileURL: "BTN_GAME_YES_TOUCH.png",
  844. x: 83,
  845. y: 281,
  846. w: 158,
  847. h: 46,
  848. tags: ["ClearGame"],
  849. cols: 1
  850. }, {
  851. name: "BTN_HINT",
  852. zOrder: 3,
  853. fileURL: "BTN_HINT.png",
  854. x: 218,
  855. y: 31,
  856. w: 39,
  857. h: 40,
  858. tags: ["GameIn"],
  859. cols: 1
  860. }, {
  861. name: "BTN_HINT_GREY",
  862. zOrder: 2,
  863. fileURL: "BTN_HINT_GREY.png",
  864. x: 218,
  865. y: 31,
  866. w: 39,
  867. h: 40,
  868. tags: ["GameIn"],
  869. cols: 1
  870. }, {
  871. name: "BTN_HINT_TOUCH",
  872. zOrder: 2,
  873. fileURL: "BTN_HINT_TOUCH.png",
  874. x: 218,
  875. y: 31,
  876. w: 39,
  877. h: 40,
  878. tags: ["GameIn"],
  879. cols: 1
  880. }, {
  881. name: "BTN_MAIN_MENU",
  882. zOrder: 4,
  883. fileURL: "BTN_MAIN_MENU.png",
  884. x: 85,
  885. y: 360,
  886. w: 160,
  887. h: 45,
  888. tags: ["win"],
  889. cols: 1
  890. }, {
  891. name: "BTN_MAIN_MENU_ICON",
  892. zOrder: 2,
  893. fileURL: "BTN_MAIN_MENU_ICON.png",
  894. x: 212,
  895. y: 34,
  896. w: 41,
  897. h: 38,
  898. tags: ["GameIn"],
  899. cols: 1
  900. }, {
  901. name: "BTN_MAIN_MENU_TOUCH",
  902. zOrder: 4,
  903. fileURL: "BTN_MAIN_MENU_TOUCH.png",
  904. x: 85,
  905. y: 360,
  906. w: 160,
  907. h: 45,
  908. tags: ["win"],
  909. cols: 1
  910. }, {
  911. name: "BTN_MAIN_MENU_ICON_TOUCH",
  912. zOrder: 2,
  913. fileURL: "BTN_MAIN_MENU_ICON_TOUCH.png",
  914. x: 212,
  915. y: 34,
  916. w: 41,
  917. h: 38,
  918. tags: ["GameIn"],
  919. cols: 1
  920. }, {
  921. name: "BTN_NEXT_LEVEL",
  922. zOrder: 4,
  923. fileURL: "BTN_NEXT_LEVEL.png",
  924. x: 79,
  925. y: 272,
  926. w: 158,
  927. h: 45,
  928. tags: ["NextLevel"],
  929. cols: 1
  930. }, {
  931. name: "BTN_NEXT_LEVEL_TOUCH",
  932. zOrder: 4,
  933. fileURL: "BTN_NEXT_LEVEL_TOUCH.png",
  934. x: 79,
  935. y: 272,
  936. w: 158,
  937. h: 45,
  938. tags: ["NextLevel"],
  939. cols: 1
  940. }, {
  941. name: "BTN_PAUSE",
  942. zOrder: 2,
  943. fileURL: "BTN_PAUSE.png",
  944. x: 268,
  945. y: 33,
  946. w: 39,
  947. h: 39,
  948. tags: ["GameIn"],
  949. cols: 1
  950. }, {
  951. name: "BTN_START",
  952. zOrder: 2,
  953. fileURL: "BTN_PAUSE_START.png",
  954. x: 268,
  955. y: 33,
  956. w: 39,
  957. h: 39,
  958. tags: ["GameIn"],
  959. cols: 1
  960. }, {
  961. name: "BTN_START_TOUCH",
  962. zOrder: 2,
  963. fileURL: "BTN_PAUSE_START_TOUCH.png",
  964. x: 268,
  965. y: 33,
  966. w: 39,
  967. h: 39,
  968. tags: ["GameIn"],
  969. cols: 1
  970. }, {
  971. name: "BTN_PAUSE_TOUCH",
  972. zOrder: 2,
  973. fileURL: "BTN_PAUSE_TOUCH.png",
  974. x: 268,
  975. y: 33,
  976. w: 39,
  977. h: 39,
  978. tags: ["GameIn"],
  979. cols: 1
  980. }, {
  981. name: "BTN_RETRY",
  982. zOrder: 4,
  983. fileURL: "BTN_RETRY.png",
  984. x: 90,
  985. y: 267,
  986. w: 158,
  987. h: 45,
  988. tags: ["over"],
  989. cols: 1
  990. }, {
  991. name: "BTN_RETRY_TOUCH",
  992. zOrder: 4,
  993. fileURL: "BTN_RETRY_TOUCH.png",
  994. x: 90,
  995. y: 267,
  996. w: 158,
  997. h: 45,
  998. tags: ["over"],
  999. cols: 1
  1000. }, {
  1001. name: "BTN_SOUND",
  1002. zOrder: 2,
  1003. fileURL: "BTN_SOUND.png",
  1004. x: 177,
  1005. y: 33,
  1006. w: 42,
  1007. h: 35,
  1008. tags: ["GameIn"],
  1009. cols: 1
  1010. }, {
  1011. name: "BTN_MENU_SOUND",
  1012. zOrder: 2,
  1013. fileURL: "BTN_SOUND.png",
  1014. x: 259,
  1015. y: 22,
  1016. w: 42,
  1017. h: 35,
  1018. tags: ["MainMenu"],
  1019. cols: 1
  1020. }, {
  1021. name: "BTN_SOUND_OFF",
  1022. zOrder: 2,
  1023. fileURL: "BTN_SOUND_OFF.png",
  1024. x: 177,
  1025. y: 33,
  1026. w: 42,
  1027. h: 35,
  1028. tags: ["GameIn"],
  1029. cols: 1
  1030. }, {
  1031. name: "BTN_MENU_SOUND_OFF",
  1032. zOrder: 2,
  1033. fileURL: "BTN_SOUND_OFF.png",
  1034. x: 259,
  1035. y: 22,
  1036. w: 42,
  1037. h: 35,
  1038. tags: ["MainMenu"],
  1039. cols: 1
  1040. }, {
  1041. name: "BTN_SOUND_OFF_TOUCH",
  1042. zOrder: 2,
  1043. fileURL: "BTN_SOUND_OFF_TOUCH.png",
  1044. x: 177,
  1045. y: 33,
  1046. w: 42,
  1047. h: 35,
  1048. tags: ["GameIn"],
  1049. cols: 1
  1050. }, {
  1051. name: "BTN_MENU_SOUND_OFF_TOUCH",
  1052. zOrder: 2,
  1053. fileURL: "BTN_SOUND_OFF_TOUCH.png",
  1054. x: 259,
  1055. y: 22,
  1056. w: 42,
  1057. h: 35,
  1058. tags: ["MainMenu"],
  1059. cols: 1
  1060. }, {
  1061. name: "BTN_SOUND_TOUCH",
  1062. zOrder: 2,
  1063. fileURL: "BTN_SOUND_TOUCH.png",
  1064. x: 177,
  1065. y: 33,
  1066. w: 42,
  1067. h: 35,
  1068. tags: ["GameIn"],
  1069. cols: 1
  1070. }, {
  1071. name: "BTN_MENU_SOUND_TOUCH",
  1072. zOrder: 2,
  1073. fileURL: "BTN_SOUND_TOUCH.png",
  1074. x: 259,
  1075. y: 22,
  1076. w: 42,
  1077. h: 35,
  1078. tags: ["MainMenu"],
  1079. cols: 1
  1080. }, {
  1081. name: "BTN_GAME_START",
  1082. zOrder: 2,
  1083. fileURL: "BTN_START.png",
  1084. x: 93,
  1085. y: 264,
  1086. w: 149,
  1087. h: 63,
  1088. tags: ["MainMenu"],
  1089. cols: 1
  1090. }, {
  1091. name: "BTN_GAME_START_TOUCH",
  1092. zOrder: 2,
  1093. fileURL: "BTN_START_TOUCH.png",
  1094. x: 93,
  1095. y: 264,
  1096. w: 149,
  1097. h: 63,
  1098. tags: ["MainMenu"],
  1099. cols: 1
  1100. }, {
  1101. name: "BTN_GAME_CONTINUE",
  1102. zOrder: 2,
  1103. fileURL: "BTN_CONTINUE.png",
  1104. x: 95,
  1105. y: 330,
  1106. w: 149,
  1107. h: 63,
  1108. tags: ["MainMenu"],
  1109. cols: 1
  1110. }, {
  1111. name: "BTN_GAME_CONTINUE_TOUCH",
  1112. zOrder: 2,
  1113. fileURL: "BTN_CONTINUE_TOUCH.png",
  1114. x: 95,
  1115. y: 330,
  1116. w: 149,
  1117. h: 63,
  1118. tags: ["MainMenu"],
  1119. cols: 1
  1120. }, {
  1121. name: "game_in_BG",
  1122. zOrder: 1,
  1123. fileURL: "game_in_BG.png",
  1124. x: 0,
  1125. y: 0,
  1126. w: 321,
  1127. h: 479,
  1128. tags: ["GameIn"],
  1129. cols: 1
  1130. }, {
  1131. name: "loading_empty",
  1132. zOrder: 2,
  1133. fileURL: "loading_empty.png",
  1134. x: 26,
  1135. y: 286,
  1136. w: 270,
  1137. h: 46,
  1138. tags: ["Loading"],
  1139. cols: 1
  1140. }, {
  1141. name: "loading_full",
  1142. zOrder: 3,
  1143. fileURL: "loading_full.png",
  1144. x: 26,
  1145. y: 286,
  1146. w: 270,
  1147. h: 46,
  1148. tags: ["Loading"],
  1149. cols: 1
  1150. }, {
  1151. name: "LOADING_BG",
  1152. zOrder: 2,
  1153. fileURL: "MAIN_MENU_AND_LOADING_BG.png",
  1154. x: 0,
  1155. y: 0,
  1156. w: 318,
  1157. h: 426,
  1158. tags: ["Loading"],
  1159. cols: 1
  1160. }, {
  1161. name: "MAIN_MENU_BG",
  1162. zOrder: 1,
  1163. fileURL: "MAIN_MENU_AND_LOADING_BG.png",
  1164. x: 0,
  1165. y: 0,
  1166. w: 318,
  1167. h: 426,
  1168. tags: ["MainMenu"],
  1169. cols: 1
  1170. }, {
  1171. name: "majong_BG",
  1172. zOrder: 0,
  1173. fileURL: "majong_BG.png",
  1174. x: 0,
  1175. y: 0,
  1176. w: 320,
  1177. h: 480,
  1178. tags: ["Loading"],
  1179. cols: 1
  1180. }, {
  1181. name: "majong_BG_GAME",
  1182. zOrder: 0,
  1183. fileURL: "majong_BG.png",
  1184. x: 0,
  1185. y: 0,
  1186. w: 320,
  1187. h: 480,
  1188. tags: ["GameIn"],
  1189. cols: 1
  1190. }, {
  1191. name: "majong_BG_MAINMENU",
  1192. zOrder: 0,
  1193. fileURL: "majong_BG.png",
  1194. x: 0,
  1195. y: 0,
  1196. w: 320,
  1197. h: 480,
  1198. tags: ["MainMenu"],
  1199. cols: 1
  1200. }, {
  1201. name: "NEXT_LEVEL_BG",
  1202. zOrder: 3,
  1203. fileURL: "NEXT_LEVEL_BG.png",
  1204. x: 3,
  1205. y: 107,
  1206. w: 314,
  1207. h: 228,
  1208. tags: ["NextLevel", "over", "quit"],
  1209. cols: 1
  1210. }, {
  1211. name: "DIALOG_BG_CLEAR_GAME",
  1212. zOrder: 3,
  1213. fileURL: "NEXT_LEVEL_BG.png",
  1214. x: 3,
  1215. y: 170,
  1216. w: 314,
  1217. h: 228,
  1218. tags: ["ClearGame"],
  1219. cols: 1
  1220. }, {
  1221. name: "NO_MORE_MATCHS",
  1222. zOrder: 5,
  1223. fileURL: "NO_MORE_MATCHS.png",
  1224. x: 27,
  1225. y: 188,
  1226. w: 272,
  1227. h: 99,
  1228. tags: ["GameIn"],
  1229. cols: 1
  1230. }, {
  1231. name: "NUM_STAGE_1",
  1232. zOrder: 4,
  1233. fileURL: "NUM_0.png",
  1234. x: 138,
  1235. y: 206,
  1236. w: 18,
  1237. h: 22,
  1238. tags: ["NextLevel"],
  1239. cols: 1
  1240. }, {
  1241. name: "NUM_STAGE_WIN_1",
  1242. zOrder: 4,
  1243. fileURL: "NUM_0.png",
  1244. x: 138,
  1245. y: 206,
  1246. w: 18,
  1247. h: 22,
  1248. tags: ["win"],
  1249. cols: 1
  1250. }, {
  1251. name: "NUM_STAGE_2",
  1252. zOrder: 4,
  1253. fileURL: "NUM_0.png",
  1254. x: 149,
  1255. y: 206,
  1256. w: 18,
  1257. h: 22,
  1258. tags: ["NextLevel"],
  1259. cols: 1
  1260. }, {
  1261. name: "NUM_STAGE_WIN_2",
  1262. zOrder: 4,
  1263. fileURL: "NUM_0.png",
  1264. x: 149,
  1265. y: 206,
  1266. w: 18,
  1267. h: 22,
  1268. tags: ["win"],
  1269. cols: 1
  1270. }, {
  1271. name: "NUM_STAGE_3",
  1272. zOrder: 4,
  1273. fileURL: "NUM_0.png",
  1274. x: 160,
  1275. y: 206,
  1276. w: 18,
  1277. h: 22,
  1278. tags: ["NextLevel"],
  1279. cols: 1
  1280. }, {
  1281. name: "NUM_STAGE_WIN_3",
  1282. zOrder: 4,
  1283. fileURL: "NUM_0.png",
  1284. x: 160,
  1285. y: 206,
  1286. w: 18,
  1287. h: 22,
  1288. tags: ["win"],
  1289. cols: 1
  1290. }, {
  1291. name: "NUM_STAGE_4",
  1292. zOrder: 4,
  1293. fileURL: "NUM_0.png",
  1294. x: 171,
  1295. y: 206,
  1296. w: 18,
  1297. h: 22,
  1298. tags: ["NextLevel"],
  1299. cols: 1
  1300. }, {
  1301. name: "NUM_STAGE_WIN_4",
  1302. zOrder: 4,
  1303. fileURL: "NUM_0.png",
  1304. x: 171,
  1305. y: 206,
  1306. w: 18,
  1307. h: 22,
  1308. tags: ["win"],
  1309. cols: 1
  1310. }, {
  1311. name: "NUM_STAGE_TOTAL_1",
  1312. zOrder: 4,
  1313. fileURL: "NUM_0.png",
  1314. x: 132,
  1315. y: 254,
  1316. w: 18,
  1317. h: 22,
  1318. tags: ["NextLevel"],
  1319. cols: 1
  1320. }, {
  1321. name: "NUM_STAGE_OVER_TOTAL_1",
  1322. zOrder: 4,
  1323. fileURL: "NUM_0.png",
  1324. x: 132,
  1325. y: 234,
  1326. w: 18,
  1327. h: 22,
  1328. tags: ["over"],
  1329. cols: 1
  1330. }, {
  1331. name: "NUM_STAGE_WIN_TOTAL_1",
  1332. zOrder: 4,
  1333. fileURL: "NUM_0.png",
  1334. x: 132,
  1335. y: 257,
  1336. w: 18,
  1337. h: 22,
  1338. tags: ["win"],
  1339. cols: 1
  1340. }, {
  1341. name: "NUM_STAGE_TOTAL_2",
  1342. zOrder: 4,
  1343. fileURL: "NUM_0.png",
  1344. x: 143,
  1345. y: 254,
  1346. w: 18,
  1347. h: 22,
  1348. tags: ["NextLevel"],
  1349. cols: 1
  1350. }, {
  1351. name: "NUM_STAGE_OVER_TOTAL_2",
  1352. zOrder: 4,
  1353. fileURL: "NUM_0.png",
  1354. x: 143,
  1355. y: 234,
  1356. w: 18,
  1357. h: 22,
  1358. tags: ["over"],
  1359. cols: 1
  1360. }, {
  1361. name: "NUM_STAGE_WIN_TOTAL_2",
  1362. zOrder: 4,
  1363. fileURL: "NUM_0.png",
  1364. x: 143,
  1365. y: 257,
  1366. w: 18,
  1367. h: 22,
  1368. tags: ["win"],
  1369. cols: 1
  1370. }, {
  1371. name: "NUM_STAGE_TOTAL_3",
  1372. zOrder: 4,
  1373. fileURL: "NUM_0.png",
  1374. x: 154,
  1375. y: 254,
  1376. w: 18,
  1377. h: 22,
  1378. tags: ["NextLevel"],
  1379. cols: 1
  1380. }, {
  1381. name: "NUM_STAGE_OVER_TOTAL_3",
  1382. zOrder: 4,
  1383. fileURL: "NUM_0.png",
  1384. x: 154,
  1385. y: 234,
  1386. w: 18,
  1387. h: 22,
  1388. tags: ["over"],
  1389. cols: 1
  1390. }, {
  1391. name: "NUM_STAGE_WIN_TOTAL_3",
  1392. zOrder: 4,
  1393. fileURL: "NUM_0.png",
  1394. x: 154,
  1395. y: 257,
  1396. w: 18,
  1397. h: 22,
  1398. tags: ["win"],
  1399. cols: 1
  1400. }, {
  1401. name: "NUM_STAGE_TOTAL_4",
  1402. zOrder: 4,
  1403. fileURL: "NUM_0.png",
  1404. x: 165,
  1405. y: 254,
  1406. w: 18,
  1407. h: 22,
  1408. tags: ["NextLevel"],
  1409. cols: 1
  1410. }, {
  1411. name: "NUM_STAGE_WIN_TOTAL_4",
  1412. zOrder: 4,
  1413. fileURL: "NUM_0.png",
  1414. x: 165,
  1415. y: 257,
  1416. w: 18,
  1417. h: 22,
  1418. tags: ["win"],
  1419. cols: 1
  1420. }, {
  1421. name: "NUM_STAGE_OVER_TOTAL_4",
  1422. zOrder: 4,
  1423. fileURL: "NUM_0.png",
  1424. x: 165,
  1425. y: 234,
  1426. w: 18,
  1427. h: 22,
  1428. tags: ["over"],
  1429. cols: 1
  1430. }, {
  1431. name: "NUM_STAGE_TOTAL_5",
  1432. zOrder: 4,
  1433. fileURL: "NUM_0.png",
  1434. x: 176,
  1435. y: 254,
  1436. w: 18,
  1437. h: 22,
  1438. tags: ["NextLevel"],
  1439. cols: 1
  1440. }, {
  1441. name: "NUM_STAGE_WIN_TOTAL_5",
  1442. zOrder: 4,
  1443. fileURL: "NUM_0.png",
  1444. x: 176,
  1445. y: 257,
  1446. w: 18,
  1447. h: 22,
  1448. tags: ["win"],
  1449. cols: 1
  1450. }, {
  1451. name: "NUM_STAGE_OVER_TOTAL_5",
  1452. zOrder: 4,
  1453. fileURL: "NUM_0.png",
  1454. x: 176,
  1455. y: 234,
  1456. w: 18,
  1457. h: 22,
  1458. tags: ["over"],
  1459. cols: 1
  1460. }, {
  1461. name: "NUM_1",
  1462. zOrder: 4,
  1463. fileURL: "NUM_1.png",
  1464. x: 0,
  1465. y: 0,
  1466. w: 18,
  1467. h: 22,
  1468. tags: ["NextLevel"],
  1469. cols: 1
  1470. }, {
  1471. name: "NUM_2",
  1472. zOrder: 4,
  1473. fileURL: "NUM_2.png",
  1474. x: 0,
  1475. y: 0,
  1476. w: 18,
  1477. h: 22,
  1478. tags: ["NextLevel"],
  1479. cols: 1
  1480. }, {
  1481. name: "NUM_3",
  1482. zOrder: 4,
  1483. fileURL: "NUM_3.png",
  1484. x: 0,
  1485. y: 0,
  1486. w: 18,
  1487. h: 22,
  1488. tags: ["NextLevel"],
  1489. cols: 1
  1490. }, {
  1491. name: "NUM_4",
  1492. zOrder: 4,
  1493. fileURL: "NUM_4.png",
  1494. x: 0,
  1495. y: 0,
  1496. w: 18,
  1497. h: 22,
  1498. tags: ["NextLevel"],
  1499. cols: 1
  1500. }, {
  1501. name: "NUM_5",
  1502. zOrder: 4,
  1503. fileURL: "NUM_5.png",
  1504. x: 0,
  1505. y: 0,
  1506. w: 18,
  1507. h: 22,
  1508. tags: ["NextLevel"],
  1509. cols: 1
  1510. }, {
  1511. name: "NUM_6",
  1512. zOrder: 4,
  1513. fileURL: "NUM_6.png",
  1514. x: 0,
  1515. y: 0,
  1516. w: 18,
  1517. h: 22,
  1518. tags: ["NextLevel"],
  1519. cols: 1
  1520. }, {
  1521. name: "NUM_7",
  1522. zOrder: 4,
  1523. fileURL: "NUM_7.png",
  1524. x: 0,
  1525. y: 0,
  1526. w: 18,
  1527. h: 22,
  1528. tags: ["NextLevel"],
  1529. cols: 1
  1530. }, {
  1531. name: "NUM_8",
  1532. zOrder: 4,
  1533. fileURL: "NUM_8.png",
  1534. x: 0,
  1535. y: 0,
  1536. w: 18,
  1537. h: 22,
  1538. tags: ["NextLevel"],
  1539. cols: 1
  1540. }, {
  1541. name: "NUM_9",
  1542. zOrder: 4,
  1543. fileURL: "NUM_9.png",
  1544. x: 0,
  1545. y: 0,
  1546. w: 18,
  1547. h: 22,
  1548. tags: ["NextLevel"],
  1549. cols: 1
  1550. }, {
  1551. name: "NUM_LEVEL_0",
  1552. zOrder: 3,
  1553. fileURL: "NUM_LEVEL_0.png",
  1554. x: 73,
  1555. y: 32,
  1556. w: 13,
  1557. h: 14,
  1558. tags: ["GameIn"],
  1559. cols: 1
  1560. }, {
  1561. name: "number_score_1",
  1562. zOrder: 3,
  1563. fileURL: "NUM_LEVEL_0.png",
  1564. x: 110,
  1565. y: 31,
  1566. w: 13,
  1567. h: 14,
  1568. tags: ["GameIn"],
  1569. cols: 1
  1570. }, {
  1571. name: "number_score_2",
  1572. zOrder: 3,
  1573. fileURL: "NUM_LEVEL_0.png",
  1574. x: 121,
  1575. y: 31,
  1576. w: 13,
  1577. h: 14,
  1578. tags: ["GameIn"],
  1579. cols: 1
  1580. }, {
  1581. name: "number_score_3",
  1582. zOrder: 3,
  1583. fileURL: "NUM_LEVEL_0.png",
  1584. x: 132,
  1585. y: 31,
  1586. w: 13,
  1587. h: 14,
  1588. tags: ["GameIn"],
  1589. cols: 1
  1590. }, {
  1591. name: "number_score_4",
  1592. zOrder: 3,
  1593. fileURL: "NUM_LEVEL_0.png",
  1594. x: 143,
  1595. y: 31,
  1596. w: 13,
  1597. h: 14,
  1598. tags: ["GameIn"],
  1599. cols: 1
  1600. }, {
  1601. name: "number_score_5",
  1602. zOrder: 3,
  1603. fileURL: "NUM_LEVEL_0.png",
  1604. x: 154,
  1605. y: 31,
  1606. w: 13,
  1607. h: 14,
  1608. tags: ["GameIn"],
  1609. cols: 1
  1610. }, {
  1611. name: "number_hint_0",
  1612. zOrder: 3,
  1613. fileURL: "NUM_LEVEL_0.png",
  1614. x: 256,
  1615. y: 57,
  1616. w: 13,
  1617. h: 14,
  1618. tags: ["GameIn"],
  1619. cols: 1
  1620. }, {
  1621. name: "number_hint_1",
  1622. zOrder: 3,
  1623. fileURL: "NUM_LEVEL_1.png",
  1624. x: 256,
  1625. y: 57,
  1626. w: 13,
  1627. h: 14,
  1628. tags: ["GameIn"],
  1629. cols: 1
  1630. }, {
  1631. name: "number_hint_2",
  1632. zOrder: 3,
  1633. fileURL: "NUM_LEVEL_2.png",
  1634. x: 256,
  1635. y: 57,
  1636. w: 13,
  1637. h: 14,
  1638. tags: ["GameIn"],
  1639. cols: 1
  1640. }, {
  1641. name: "number_hint_3",
  1642. zOrder: 3,
  1643. fileURL: "NUM_LEVEL_3.png",
  1644. x: 256,
  1645. y: 57,
  1646. w: 13,
  1647. h: 14,
  1648. tags: ["GameIn"],
  1649. cols: 1
  1650. }, {
  1651. name: "number_hint_4",
  1652. zOrder: 3,
  1653. fileURL: "NUM_LEVEL_4.png",
  1654. x: 256,
  1655. y: 57,
  1656. w: 13,
  1657. h: 14,
  1658. tags: ["GameIn"],
  1659. cols: 1
  1660. }, {
  1661. name: "number_hint_5",
  1662. zOrder: 3,
  1663. fileURL: "NUM_LEVEL_5.png",
  1664. x: 256,
  1665. y: 57,
  1666. w: 13,
  1667. h: 14,
  1668. tags: ["GameIn"],
  1669. cols: 1
  1670. }, {
  1671. name: "number_hint_6",
  1672. zOrder: 3,
  1673. fileURL: "NUM_LEVEL_6.png",
  1674. x: 256,
  1675. y: 57,
  1676. w: 13,
  1677. h: 14,
  1678. tags: ["GameIn"],
  1679. cols: 1
  1680. }, {
  1681. name: "number_hint_7",
  1682. zOrder: 3,
  1683. fileURL: "NUM_LEVEL_7.png",
  1684. x: 256,
  1685. y: 57,
  1686. w: 13,
  1687. h: 14,
  1688. tags: ["GameIn"],
  1689. cols: 1
  1690. }, {
  1691. name: "number_hint_8",
  1692. zOrder: 3,
  1693. fileURL: "NUM_LEVEL_8.png",
  1694. x: 256,
  1695. y: 57,
  1696. w: 13,
  1697. h: 14,
  1698. tags: ["GameIn"],
  1699. cols: 1
  1700. }, {
  1701. name: "number_hint_9",
  1702. zOrder: 3,
  1703. fileURL: "NUM_LEVEL_9.png",
  1704. x: 256,
  1705. y: 57,
  1706. w: 13,
  1707. h: 14,
  1708. tags: ["GameIn"],
  1709. cols: 1
  1710. }, {
  1711. name: "number_hint_clone_0",
  1712. zOrder: 3,
  1713. fileURL: "NUM_LEVEL_0.png",
  1714. x: 246,
  1715. y: 57,
  1716. w: 13,
  1717. h: 14,
  1718. tags: ["GameIn"],
  1719. cols: 1
  1720. }, {
  1721. name: "number_hint_clone_1",
  1722. zOrder: 3,
  1723. fileURL: "NUM_LEVEL_1.png",
  1724. x: 246,
  1725. y: 57,
  1726. w: 13,
  1727. h: 14,
  1728. tags: ["GameIn"],
  1729. cols: 1
  1730. }, {
  1731. name: "number_hint_clone_2",
  1732. zOrder: 3,
  1733. fileURL: "NUM_LEVEL_2.png",
  1734. x: 246,
  1735. y: 57,
  1736. w: 13,
  1737. h: 14,
  1738. tags: ["GameIn"],
  1739. cols: 1
  1740. }, {
  1741. name: "number_hint_clone_3",
  1742. zOrder: 3,
  1743. fileURL: "NUM_LEVEL_3.png",
  1744. x: 246,
  1745. y: 57,
  1746. w: 13,
  1747. h: 14,
  1748. tags: ["GameIn"],
  1749. cols: 1
  1750. }, {
  1751. name: "number_hint_clone_4",
  1752. zOrder: 3,
  1753. fileURL: "NUM_LEVEL_4.png",
  1754. x: 246,
  1755. y: 57,
  1756. w: 13,
  1757. h: 14,
  1758. tags: ["GameIn"],
  1759. cols: 1
  1760. }, {
  1761. name: "number_hint_clone_5",
  1762. zOrder: 3,
  1763. fileURL: "NUM_LEVEL_5.png",
  1764. x: 246,
  1765. y: 57,
  1766. w: 13,
  1767. h: 14,
  1768. tags: ["GameIn"],
  1769. cols: 1
  1770. }, {
  1771. name: "number_hint_clone_6",
  1772. zOrder: 3,
  1773. fileURL: "NUM_LEVEL_6.png",
  1774. x: 246,
  1775. y: 57,
  1776. w: 13,
  1777. h: 14,
  1778. tags: ["GameIn"],
  1779. cols: 1
  1780. }, {
  1781. name: "number_hint_clone_7",
  1782. zOrder: 3,
  1783. fileURL: "NUM_LEVEL_7.png",
  1784. x: 246,
  1785. y: 57,
  1786. w: 13,
  1787. h: 14,
  1788. tags: ["GameIn"],
  1789. cols: 1
  1790. }, {
  1791. name: "number_hint_clone_8",
  1792. zOrder: 3,
  1793. fileURL: "NUM_LEVEL_8.png",
  1794. x: 246,
  1795. y: 57,
  1796. w: 13,
  1797. h: 14,
  1798. tags: ["GameIn"],
  1799. cols: 1
  1800. }, {
  1801. name: "number_hint_clone_9",
  1802. zOrder: 3,
  1803. fileURL: "NUM_LEVEL_9.png",
  1804. x: 246,
  1805. y: 57,
  1806. w: 13,
  1807. h: 14,
  1808. tags: ["GameIn"],
  1809. cols: 1
  1810. }, {
  1811. name: "NUM_LEVEL_1",
  1812. zOrder: 0,
  1813. fileURL: "NUM_LEVEL_1.png",
  1814. x: 0,
  1815. y: 0,
  1816. w: 13,
  1817. h: 14,
  1818. tags: ["GameIn"],
  1819. cols: 1
  1820. }, {
  1821. name: "NUM_LEVEL_2",
  1822. zOrder: 0,
  1823. fileURL: "NUM_LEVEL_2.png",
  1824. x: 0,
  1825. y: 0,
  1826. w: 13,
  1827. h: 14,
  1828. tags: ["GameIn"],
  1829. cols: 1
  1830. }, {
  1831. name: "NUM_LEVEL_3",
  1832. zOrder: 0,
  1833. fileURL: "NUM_LEVEL_3.png",
  1834. x: 0,
  1835. y: 0,
  1836. w: 13,
  1837. h: 14,
  1838. tags: ["GameIn"],
  1839. cols: 1
  1840. }, {
  1841. name: "NUM_LEVEL_4",
  1842. zOrder: 0,
  1843. fileURL: "NUM_LEVEL_4.png",
  1844. x: 0,
  1845. y: 0,
  1846. w: 13,
  1847. h: 14,
  1848. tags: ["GameIn"],
  1849. cols: 1
  1850. }, {
  1851. name: "NUM_LEVEL_5",
  1852. zOrder: 0,
  1853. fileURL: "NUM_LEVEL_5.png",
  1854. x: 0,
  1855. y: 0,
  1856. w: 13,
  1857. h: 14,
  1858. tags: ["GameIn"],
  1859. cols: 1
  1860. }, {
  1861. name: "NUM_LEVEL_6",
  1862. zOrder: 0,
  1863. fileURL: "NUM_LEVEL_6.png",
  1864. x: 0,
  1865. y: 0,
  1866. w: 13,
  1867. h: 14,
  1868. tags: ["GameIn"],
  1869. cols: 1
  1870. }, {
  1871. name: "NUM_LEVEL_7",
  1872. zOrder: 0,
  1873. fileURL: "NUM_LEVEL_7.png",
  1874. x: 0,
  1875. y: 0,
  1876. w: 13,
  1877. h: 14,
  1878. tags: ["GameIn"],
  1879. cols: 1
  1880. }, {
  1881. name: "NUM_LEVEL_8",
  1882. zOrder: 0,
  1883. fileURL: "NUM_LEVEL_8.png",
  1884. x: 0,
  1885. y: 0,
  1886. w: 13,
  1887. h: 14,
  1888. tags: ["GameIn"],
  1889. cols: 1
  1890. }, {
  1891. name: "NUM_LEVEL_9",
  1892. zOrder: 0,
  1893. fileURL: "NUM_LEVEL_9.png",
  1894. x: 0,
  1895. y: 0,
  1896. w: 13,
  1897. h: 14,
  1898. tags: ["GameIn"],
  1899. cols: 1
  1900. }, {
  1901. name: "OrientationWarning",
  1902. zOrder: 0,
  1903. fileURL: "OrientationWarning.png",
  1904. x: 0,
  1905. y: 3,
  1906. w: 250,
  1907. h: 250,
  1908. tags: [],
  1909. cols: 1
  1910. }, {
  1911. name: "PAUSE_BG",
  1912. zOrder: 3,
  1913. fileURL: "PAUSE_BG.png",
  1914. x: 13,
  1915. y: 78,
  1916. w: 290,
  1917. h: 354,
  1918. tags: ["GameIn"],
  1919. cols: 1
  1920. }, {
  1921. name: "splash",
  1922. zOrder: 0,
  1923. fileURL: "splash.png",
  1924. x: 0,
  1925. y: 48,
  1926. w: 320,
  1927. h: 320,
  1928. tags: ["Logo"],
  1929. cols: 1
  1930. }, {
  1931. name: "TIME_EMPTY",
  1932. zOrder: 2,
  1933. fileURL: "TIME_EMPTY.png",
  1934. x: 35,
  1935. y: 53,
  1936. w: 137,
  1937. h: 18,
  1938. tags: ["GameIn"],
  1939. cols: 1
  1940. }, {
  1941. name: "TIME__FULL",
  1942. zOrder: 2,
  1943. fileURL: "TIME__FULL.png",
  1944. x: 35,
  1945. y: 53,
  1946. w: 137,
  1947. h: 18,
  1948. tags: ["GameIn"],
  1949. cols: 1
  1950. }, {
  1951. name: "TXT_ARE_YOU_SURE",
  1952. zOrder: 4,
  1953. fileURL: "TXT_ARE_YOU_SURE.png",
  1954. x: 46,
  1955. y: 142,
  1956. w: 229,
  1957. h: 57,
  1958. tags: ["quit"],
  1959. cols: 1
  1960. }, {
  1961. name: "STR_SURE_CLEAR_GAME",
  1962. zOrder: 3,
  1963. fileURL: "TXT_CLEAR_THE_DATE.png",
  1964. x: 37,
  1965. y: 198,
  1966. w: 246,
  1967. h: 77,
  1968. tags: ["ClearGame"],
  1969. cols: 1
  1970. }, {
  1971. name: "TXT_GAME_OVER",
  1972. zOrder: 4,
  1973. fileURL: "TXT_GAME_OVER.png",
  1974. x: 62,
  1975. y: 150,
  1976. w: 196,
  1977. h: 33,
  1978. tags: ["over"],
  1979. cols: 1
  1980. }, {
  1981. name: "TXT_LEVEL_CLEAR",
  1982. zOrder: 4,
  1983. fileURL: "TXT_LEVEL_CLEAR.png",
  1984. x: 52,
  1985. y: 141,
  1986. w: 220,
  1987. h: 33,
  1988. tags: ["NextLevel"],
  1989. cols: 1
  1990. }, {
  1991. name: "TXT_STAGE_SCORE",
  1992. zOrder: 4,
  1993. fileURL: "TXT_STAGE_SCORE.png",
  1994. x: 82,
  1995. y: 179,
  1996. w: 150,
  1997. h: 26,
  1998. tags: ["NextLevel"],
  1999. cols: 1
  2000. }, {
  2001. name: "TXT_TOTAL_SCORE",
  2002. zOrder: 4,
  2003. fileURL: "TXT_TOTAL_SCORE.png",
  2004. x: 83,
  2005. y: 229,
  2006. w: 149,
  2007. h: 26,
  2008. tags: ["NextLevel"],
  2009. cols: 1
  2010. }, {
  2011. name: "TXT_WIN_STAGE_SCORE",
  2012. zOrder: 4,
  2013. fileURL: "TXT_STAGE_SCORE.png",
  2014. x: 82,
  2015. y: 179,
  2016. w: 150,
  2017. h: 26,
  2018. tags: ["win"],
  2019. cols: 1
  2020. }, {
  2021. name: "TXT_WIN_TOTAL_SCORE",
  2022. zOrder: 4,
  2023. fileURL: "TXT_TOTAL_SCORE.png",
  2024. x: 83,
  2025. y: 229,
  2026. w: 149,
  2027. h: 26,
  2028. tags: ["win"],
  2029. cols: 1
  2030. }, {
  2031. name: "TXT_TOTAL_OVER_SCORE",
  2032. zOrder: 4,
  2033. fileURL: "TXT_TOTAL_SCORE.png",
  2034. x: 88,
  2035. y: 196,
  2036. w: 149,
  2037. h: 26,
  2038. tags: ["over"],
  2039. cols: 1
  2040. }, {
  2041. name: "TXT_YOUR_TOTAL_SCORE",
  2042. zOrder: 0,
  2043. fileURL: "TXT_YOUR_TOTAL_SCORE.png",
  2044. x: 0,
  2045. y: 0,
  2046. w: 200,
  2047. h: 26,
  2048. tags: [],
  2049. cols: 1
  2050. }, {
  2051. name: "YOU_WIN_BG",
  2052. zOrder: 3,
  2053. fileURL: "YOU_WIN_BG.png",
  2054. x: 5,
  2055. y: 82,
  2056. w: 310,
  2057. h: 249,
  2058. tags: ["win"],
  2059. cols: 1
  2060. }, {
  2061. name: "majong_1",
  2062. zOrder: 0,
  2063. fileURL: "majong/1.png",
  2064. x: 0,
  2065. y: 0,
  2066. w: 38,
  2067. h: 44,
  2068. tags: [],
  2069. cols: 1
  2070. }, {
  2071. name: "majong_10",
  2072. zOrder: 0,
  2073. fileURL: "majong/10.png",
  2074. x: 0,
  2075. y: 0,
  2076. w: 38,
  2077. h: 46,
  2078. tags: [],
  2079. cols: 1
  2080. }, {
  2081. name: "majong_11",
  2082. zOrder: 0,
  2083. fileURL: "majong/11.png",
  2084. x: 0,
  2085. y: 0,
  2086. w: 38,
  2087. h: 46,
  2088. tags: [],
  2089. cols: 1
  2090. }, {
  2091. name: "majong_12",
  2092. zOrder: 0,
  2093. fileURL: "majong/12.png",
  2094. x: 0,
  2095. y: 0,
  2096. w: 38,
  2097. h: 46,
  2098. tags: [],
  2099. cols: 1
  2100. }, {
  2101. name: "majong_13",
  2102. zOrder: 0,
  2103. fileURL: "majong/13.png",
  2104. x: 0,
  2105. y: 0,
  2106. w: 38,
  2107. h: 46,
  2108. tags: [],
  2109. cols: 1
  2110. }, {
  2111. name: "majong_14",
  2112. zOrder: 0,
  2113. fileURL: "majong/14.png",
  2114. x: 0,
  2115. y: 0,
  2116. w: 38,
  2117. h: 46,
  2118. tags: [],
  2119. cols: 1
  2120. }, {
  2121. name: "majong_15",
  2122. zOrder: 0,
  2123. fileURL: "majong/15.png",
  2124. x: 0,
  2125. y: 0,
  2126. w: 38,
  2127. h: 46,
  2128. tags: [],
  2129. cols: 1
  2130. }, {
  2131. name: "majong_16",
  2132. zOrder: 0,
  2133. fileURL: "majong/16.png",
  2134. x: 0,
  2135. y: 0,
  2136. w: 38,
  2137. h: 46,
  2138. tags: [],
  2139. cols: 1
  2140. }, {
  2141. name: "majong_17",
  2142. zOrder: 0,
  2143. fileURL: "majong/17.png",
  2144. x: 0,
  2145. y: 0,
  2146. w: 38,
  2147. h: 46,
  2148. tags: [],
  2149. cols: 1
  2150. }, {
  2151. name: "majong_18",
  2152. zOrder: 0,
  2153. fileURL: "majong/18.png",
  2154. x: 0,
  2155. y: 0,
  2156. w: 38,
  2157. h: 46,
  2158. tags: [],
  2159. cols: 1
  2160. }, {
  2161. name: "majong_19",
  2162. zOrder: 0,
  2163. fileURL: "majong/19.png",
  2164. x: 0,
  2165. y: 0,
  2166. w: 38,
  2167. h: 46,
  2168. tags: [],
  2169. cols: 1
  2170. }, {
  2171. name: "majong_2",
  2172. zOrder: 0,
  2173. fileURL: "majong/2.png",
  2174. x: 0,
  2175. y: 0,
  2176. w: 38,
  2177. h: 46,
  2178. tags: [],
  2179. cols: 1
  2180. }, {
  2181. name: "majong_20",
  2182. zOrder: 0,
  2183. fileURL: "majong/20.png",
  2184. x: 0,
  2185. y: 0,
  2186. w: 38,
  2187. h: 46,
  2188. tags: [],
  2189. cols: 1
  2190. }, {
  2191. name: "majong_21",
  2192. zOrder: 0,
  2193. fileURL: "majong/21.png",
  2194. x: 0,
  2195. y: 0,
  2196. w: 38,
  2197. h: 46,
  2198. tags: [],
  2199. cols: 1
  2200. }, {
  2201. name: "majong_22",
  2202. zOrder: 0,
  2203. fileURL: "majong/22.png",
  2204. x: 0,
  2205. y: 0,
  2206. w: 38,
  2207. h: 46,
  2208. tags: [],
  2209. cols: 1
  2210. }, {
  2211. name: "majong_23",
  2212. zOrder: 0,
  2213. fileURL: "majong/23.png",
  2214. x: 0,
  2215. y: 0,
  2216. w: 38,
  2217. h: 46,
  2218. tags: [],
  2219. cols: 1
  2220. }, {
  2221. name: "majong_24",
  2222. zOrder: 0,
  2223. fileURL: "majong/24.png",
  2224. x: 0,
  2225. y: 0,
  2226. w: 38,
  2227. h: 46,
  2228. tags: [],
  2229. cols: 1
  2230. }, {
  2231. name: "majong_25",
  2232. zOrder: 0,
  2233. fileURL: "majong/25.png",
  2234. x: 0,
  2235. y: 0,
  2236. w: 38,
  2237. h: 46,
  2238. tags: [],
  2239. cols: 1
  2240. }, {
  2241. name: "majong_26",
  2242. zOrder: 0,
  2243. fileURL: "majong/26.png",
  2244. x: 0,
  2245. y: 0,
  2246. w: 38,
  2247. h: 46,
  2248. tags: [],
  2249. cols: 1
  2250. }, {
  2251. name: "majong_27",
  2252. zOrder: 0,
  2253. fileURL: "majong/27.png",
  2254. x: 0,
  2255. y: 0,
  2256. w: 38,
  2257. h: 46,
  2258. tags: [],
  2259. cols: 1
  2260. }, {
  2261. name: "majong_28",
  2262. zOrder: 0,
  2263. fileURL: "majong/28.png",
  2264. x: 0,
  2265. y: 0,
  2266. w: 38,
  2267. h: 46,
  2268. tags: [],
  2269. cols: 1
  2270. }, {
  2271. name: "majong_29",
  2272. zOrder: 0,
  2273. fileURL: "majong/29.png",
  2274. x: 0,
  2275. y: 0,
  2276. w: 38,
  2277. h: 46,
  2278. tags: [],
  2279. cols: 1
  2280. }, {
  2281. name: "majong_3",
  2282. zOrder: 0,
  2283. fileURL: "majong/3.png",
  2284. x: 0,
  2285. y: 0,
  2286. w: 38,
  2287. h: 46,
  2288. tags: [],
  2289. cols: 1
  2290. }, {
  2291. name: "majong_30",
  2292. zOrder: 0,
  2293. fileURL: "majong/30.png",
  2294. x: 0,
  2295. y: 0,
  2296. w: 38,
  2297. h: 46,
  2298. tags: [],
  2299. cols: 1
  2300. }, {
  2301. name: "majong_31",
  2302. zOrder: 0,
  2303. fileURL: "majong/31.png",
  2304. x: 0,
  2305. y: 0,
  2306. w: 38,
  2307. h: 46,
  2308. tags: [],
  2309. cols: 1
  2310. }, {
  2311. name: "majong_4",
  2312. zOrder: 0,
  2313. fileURL: "majong/4.png",
  2314. x: 0,
  2315. y: 0,
  2316. w: 38,
  2317. h: 46,
  2318. tags: [],
  2319. cols: 1
  2320. }, {
  2321. name: "majong_5",
  2322. zOrder: 0,
  2323. fileURL: "majong/5.png",
  2324. x: 0,
  2325. y: 0,
  2326. w: 38,
  2327. h: 46,
  2328. tags: [],
  2329. cols: 1
  2330. }, {
  2331. name: "majong_6",
  2332. zOrder: 0,
  2333. fileURL: "majong/6.png",
  2334. x: 0,
  2335. y: 0,
  2336. w: 38,
  2337. h: 46,
  2338. tags: [],
  2339. cols: 1
  2340. }, {
  2341. name: "majong_7",
  2342. zOrder: 0,
  2343. fileURL: "majong/7.png",
  2344. x: 0,
  2345. y: 0,
  2346. w: 38,
  2347. h: 46,
  2348. tags: [],
  2349. cols: 1
  2350. }, {
  2351. name: "majong_8",
  2352. zOrder: 0,
  2353. fileURL: "majong/8.png",
  2354. x: 0,
  2355. y: 0,
  2356. w: 38,
  2357. h: 46,
  2358. tags: [],
  2359. cols: 1
  2360. }, {
  2361. name: "majong_9",
  2362. zOrder: 0,
  2363. fileURL: "majong/9.png",
  2364. x: 0,
  2365. y: 0,
  2366. w: 38,
  2367. h: 46,
  2368. tags: [],
  2369. cols: 1
  2370. }, {
  2371. name: "PET_FOCUS",
  2372. zOrder: 0,
  2373. fileURL: "MAJONG_FOCUS.png",
  2374. x: 0,
  2375. y: 0,
  2376. w: 34,
  2377. h: 42,
  2378. tags: [],
  2379. cols: 1
  2380. }, {
  2381. name: "PET_FOCUS_HINT",
  2382. zOrder: 0,
  2383. fileURL: "MAJONG_FOCUS_HINT.png",
  2384. x: 0,
  2385. y: 0,
  2386. w: 34,
  2387. h: 42,
  2388. tags: [],
  2389. cols: 1
  2390. }], FZ.getImgInfo = function (a) {
  2391. var b = 0,
  2392. c = null;
  2393. for (b = 0; b < FZ.IphoneUI.length; b++) {
  2394. c = FZ.IphoneUI[b];
  2395. if (a === c.name) return c
  2396. }
  2397. return null
  2398. }
  2399. }(),
  2400. function () {
  2401. FZ.GameDefs = {
  2402. STATS_FONT_SIZE: 16,
  2403. SCREEN_W: 320,
  2404. SCREEN_H: 480,
  2405. SCREEN_BOTTOM_H: 44,
  2406. SCREEN_TOP_H: 20,
  2407. TIME_RATE: 8,
  2408. HALF_ACCELERATION_OF_GRAVITY: 5,
  2409. FLASH_COUNT: 0,
  2410. FLASH_FOCUS_COUNT: 1,
  2411. DIAMOND_SPEED_X: 6,
  2412. DIAMOND_SPEED_Y: 6,
  2413. FALLING_SPEED_X: 4,
  2414. FALLING_SPEED_Y: -4,
  2415. DIAMOND_RORATE_NONE: 0,
  2416. DIAMOND_RORATE_LEFT: 1,
  2417. DIAMOND_RORATE_RIGHT: 2,
  2418. DIAMOND_RORATE_RATE: 20,
  2419. GAME_STATE_UNKNOW: -1,
  2420. GAME_STATE_LOADING: 0,
  2421. GAME_STATE_INIT: 1,
  2422. GAME_STATE_GAME: 2,
  2423. PET_FLICKER_TIME: 100,
  2424. PET_FLICKER_FOCUS_TIME: 50,
  2425. PET_TYPE_0: 0,
  2426. PET_TYPE_1: 1,
  2427. PET_TYPE_2: 2,
  2428. PET_TYPE_3: 3,
  2429. PET_TYPE_4: 4,
  2430. PET_TYPE_5: 5,
  2431. PET_TYPE_6: 6,
  2432. PET_TYPE_7: 7,
  2433. PET_TYPE_8: 8,
  2434. PET_TYPE_9: 9,
  2435. PET_TYPE_10: 10,
  2436. PET_TYPE_11: 11,
  2437. PET_TYPE_12: 12,
  2438. PET_TYPE_13: 13,
  2439. PET_TYPE_14: 14,
  2440. PET_TYPE_15: 15,
  2441. PET_TYPE_16: 16,
  2442. PET_TYPE_17: 17,
  2443. PET_TYPE_18: 18,
  2444. PET_TYPE_19: 19,
  2445. PET_TYPE_20: 20,
  2446. PET_TYPE_21: 21,
  2447. PET_TYPE_22: 22,
  2448. PET_TYPE_23: 23,
  2449. PET_TYPE_24: 24,
  2450. PET_TYPE_25: 25,
  2451. PET_TYPE_26: 26,
  2452. PET_TYPE_27: 27,
  2453. PET_TYPE_28: 28,
  2454. PET_TYPE_29: 29,
  2455. PET_TYPE_30: 30,
  2456. PET_TYPE_31: 31,
  2457. PET_TYPE_32: 32,
  2458. PET_TYPE_33: 33,
  2459. PET_TYPE_34: 34,
  2460. PET_TYPE_35: 35,
  2461. PET_TYPE_36: 36,
  2462. PET_TYPE_37: 37,
  2463. PET_TYPE_38: 38,
  2464. PET_TYPE_39: 39,
  2465. DIAMOND_TYPES: 31,
  2466. DREAMPET_NUM_LINE_HALF: 4,
  2467. DREAMPET_NUM_COL_HALF: 4,
  2468. DREAMPET_NUM_COL: 8,
  2469. DREAMPET_NUM_LINE: 8,
  2470. ALL_PET_NUM: 64,
  2471. ALL_GENERAL: 100,
  2472. ALL_GENERAL_HALF: 50,
  2473. DRAW_LINE_TIME: 6,
  2474. PET_FLASH_TIME: 20,
  2475. GRID_WIDTH: 36,
  2476. GRID_WIDTH_HALF: 18,
  2477. GRID_HEIGHT: 44,
  2478. GRID_HEIGHT_HALF: 22,
  2479. OFFSET_X: 16,
  2480. OFFSET_Y: 80,
  2481. DREAMPET_OFFSET_X: -20,
  2482. DREAMPET_OFFSET_Y: 36,
  2483. SEARCH_NONE: 0,
  2484. SEARCH_INIT: 1,
  2485. SEARCH_ING: 2,
  2486. SEARCH_FINISHED: 3,
  2487. GAME_CLEAR_TIME: 1500,
  2488. DREAMPET_REMOVE: -1,
  2489. DREAMPET_INIT: 0,
  2490. DREAMPET_FOCUS: 1,
  2491. DREAMPET_FLASH: 2,
  2492. DREAMPET_FLASH_HINT: 3,
  2493. DREAMPET_MOVING: 4,
  2494. LEVEL_HINT_NUMBER: [0, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6],
  2495. MAX_LEVEL_RANK: 9,
  2496. LEVEL_TIME: [0, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180],
  2497. LEVEL_PET_KIND: [5, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31],
  2498. PET_1: 0,
  2499. PET_2: 1,
  2500. PET_3: 2,
  2501. PET_4: 3,
  2502. PET_5: 4,
  2503. PET_6: 5,
  2504. PET_7: 6,
  2505. PET_8: 7,
  2506. PET_9: 8,
  2507. PET_10: 9,
  2508. PET_11: 10,
  2509. PET_12: 11,
  2510. PET_13: 12,
  2511. PET_14: 13,
  2512. PET_15: 14,
  2513. PET_16: 15,
  2514. PET_17: 16,
  2515. PET_18: 17,
  2516. PET_19: 18,
  2517. PET_20: 19,
  2518. PET_21: 20,
  2519. PET_22: 21,
  2520. PET_23: 22,
  2521. PET_24: 23,
  2522. PET_25: 24,
  2523. PET_26: 25,
  2524. PET_27: 26,
  2525. PET_28: 27,
  2526. PET_29: 28,
  2527. PET_30: 29,
  2528. PET_31: 30,
  2529. PET_32: 31,
  2530. PET_33: 32,
  2531. PET_34: 33,
  2532. PET_35: 34,
  2533. PET_36: 35,
  2534. PET_37: 36,
  2535. PET_38: 37,
  2536. PET_39: 38,
  2537. PET_40: 39
  2538. }
  2539. }(),
  2540. function () {
  2541. var a = -1,
  2542. b = 0,
  2543. c = 1,
  2544. d = 0,
  2545. e = 0,
  2546. f = null,
  2547. g = null,
  2548. h = function () {
  2549. if (null === g) g = g || [];
  2550. else
  2551. while (g.length > 0) g.pop()
  2552. }, i = function (a, b, c, d) {
  2553. var e = 0;
  2554. e = Math.abs(a - c) + Math.abs(b - d);
  2555. return e
  2556. }, j = function (a, b, c, d) {
  2557. var g = null,
  2558. h = b * e + a;
  2559. if (a !== c && b !== d) return !1;
  2560. var i = 0,
  2561. j = 0,
  2562. k = 0,
  2563. l = 0;
  2564. if (a === c) {
  2565. i = a, j = b, k = c, l = d, b > d && (j = d, l = b);
  2566. for (h = (j + 1) * e + i; h < l * e + k; h += e) {
  2567. g = f[h];
  2568. if (FZ.GameDefs.DREAMPET_REMOVE !== g.m_state) return !1
  2569. }
  2570. } else if (b === d) {
  2571. i = a, j = b, k = c, l = d, a > c && (i = c, k = a);
  2572. for (h = j * e + i + 1; h < l * e + k; h++) {
  2573. g = f[h];
  2574. if (FZ.GameDefs.DREAMPET_REMOVE !== g.m_state) return !1
  2575. }
  2576. }
  2577. return !0
  2578. }, k = function (a, b, c, d) {
  2579. var h = 0,
  2580. i = 0,
  2581. k = 0,
  2582. l = !1,
  2583. m = null;
  2584. h = c, i = b, m = f[i * e + h];
  2585. if (FZ.GameDefs.DREAMPET_REMOVE === m.m_state) {
  2586. l = j(a, b, h, i);
  2587. if (l) {
  2588. l = j(h, i, c, d);
  2589. if (l) {
  2590. g.push([h, i]);
  2591. return !0
  2592. }
  2593. }
  2594. }
  2595. h = a, i = d, m = f[i * e + h];
  2596. if (FZ.GameDefs.DREAMPET_REMOVE === m.m_state) {
  2597. l = j(a, b, h, i);
  2598. if (l) {
  2599. l = j(h, i, c, d);
  2600. if (l) {
  2601. g.push([h, i]);
  2602. return !0
  2603. }
  2604. }
  2605. }
  2606. return !1
  2607. }, l = function (a, b, c, i) {
  2608. var j = 0,
  2609. l = 0,
  2610. m = 0,
  2611. n = 0,
  2612. o = 0,
  2613. p = 0,
  2614. q = 0,
  2615. r = 0,
  2616. s = null;
  2617. a < c ? (l = a, m = b, p = c, q = i) : (l = c, m = i, p = a, q = b), n = l, o = m;
  2618. for (n = n + 1; n < e; n++) {
  2619. s = f[o * e + n];
  2620. if (FZ.GameDefs.DREAMPET_REMOVE !== s.m_state) break;
  2621. h(), g.push([l, m]), g.push([n, o]);
  2622. if (k(n, o, p, q)) {
  2623. g.push([p, q]);
  2624. return !0
  2625. }
  2626. }
  2627. b < i ? (l = a, m = b, p = c, q = i) : (l = c, m = i, p = a, q = b), n = l, o = m;
  2628. for (o = o + 1; o < d; o++) {
  2629. s = f[o * e + n];
  2630. if (FZ.GameDefs.DREAMPET_REMOVE !== s.m_state) break;
  2631. h(), g.push([l, m]), g.push([n, o]);
  2632. if (k(n, o, p, q)) {
  2633. g.push([p, q]);
  2634. return !0
  2635. }
  2636. }
  2637. a < c ? (l = a, m = b, p = c, q = i) : (l = c, m = i, p = a, q = b), n = l, o = m;
  2638. for (n = n - 1; n >= 0; n--) {
  2639. s = f[o * e + n];
  2640. if (FZ.GameDefs.DREAMPET_REMOVE !== s.m_state) break;
  2641. h(), g.push([l, m]), g.push([n, o]);
  2642. if (k(n, o, p, q)) {
  2643. g.push([p, q]);
  2644. return !0
  2645. }
  2646. }
  2647. b < i ? (l = a, m = b, p = c, q = i) : (l = c, m = i, p = a, q = b), n = l, o = m;
  2648. for (o = o - 1; o >= 0; o--) {
  2649. s = f[o * e + n];
  2650. if (FZ.GameDefs.DREAMPET_REMOVE !== s.m_state) break;
  2651. h(), g.push([l, m]), g.push([n, o]);
  2652. if (k(n, o, p, q)) {
  2653. g.push([p, q]);
  2654. return !0
  2655. }
  2656. }
  2657. };
  2658. FZ.AG = {}, FZ.AG.SearchSpecialPath = {
  2659. getPath: function (a, b, c, i, m, n, o) {
  2660. if (undefined === a) return null;
  2661. if (a.length < b * c) return null;
  2662. var p = 0;
  2663. f = a, d = b, e = c, h(), g.push([i, m]);
  2664. if (j(i, m, n, o)) {
  2665. g.push([n, o]);
  2666. return g
  2667. }
  2668. h(), g.push([i, m]);
  2669. if (k(i, m, n, o)) {
  2670. g.push([n, o]);
  2671. return g
  2672. }
  2673. h();
  2674. if (l(i, m, n, o)) return g;
  2675. return null
  2676. },
  2677. drawNum: function (a, b, c, d, e) {
  2678. var f = b,
  2679. g = 0;
  2680. if (f === 0) a.setFrame(0), a.draw(FZ.GameBase.MainContext);
  2681. else {
  2682. a.resetMatrix(), a.makeTranslate(c, d);
  2683. for (var h = 0; f !== 0; h++) g = Math.floor(f % 10), a.setFrame(g), a.draw(FZ.GameBase.MainContext), a.translate(-e, 0), f = Math.floor(f / 10);
  2684. a.setFrame(0), a.makeTranslate(c, d)
  2685. }
  2686. },
  2687. setNumDiv: function (a, b) {
  2688. var c = b,
  2689. d = 0,
  2690. e = null,
  2691. f = 0,
  2692. g = null;
  2693. if (c === 0) {
  2694. a[0] = document.createElement("div"), a[0].style.zIndex = 202, e = FZ.getImgInfo("number_hint_0"), FZ.GameBase.setCss(a[0], e);
  2695. return 1
  2696. }
  2697. if (c > 10) {
  2698. d = Math.floor(c % 10), g = document.createElement("div"), g.style.zIndex = 202, e = FZ.getImgInfo("number_hint_" + d), FZ.GameBase.setCss(g, e), a.push(g), d = Math.floor(c / 10), g = document.createElement("div"), g.style.zIndex = 205, e = FZ.getImgInfo("number_hint_clone_" + d), FZ.GameBase.setCss(g, e), a.push(g);
  2699. return 2
  2700. }
  2701. d = Math.floor(c % 10), g = document.createElement("div"), g.style.zIndex = 202, e = FZ.getImgInfo("number_hint_" + d), FZ.GameBase.setCss(g, e), a.push(g), d = Math.floor(c / 10), g = document.createElement("div"), g.style.zIndex = 205, e = FZ.getImgInfo("number_hint_clone_" + d), FZ.GameBase.setCss(g, e), g.style.visibility = "hidden", a.push(g);
  2702. return 2
  2703. },
  2704. setScoreNum: function (a) {
  2705. var b = a,
  2706. c = 0,
  2707. d = [];
  2708. while (b > 0) c = Math.floor(b % 10), d.push(c), b = Math.floor(b / 10);
  2709. return d
  2710. },
  2711. getPolygonVertex: function (a, b, c, d) {
  2712. if (d < 3) return null;
  2713. var e = [],
  2714. f = 0,
  2715. g = 2 * Math.PI / d;
  2716. for (var h = 0; h < d; h++) {
  2717. var i = [];
  2718. i.push(a + Math.floor(c * Math.sin(f))), i.push(b + Math.floor(c * Math.cos(f))), f += g, e.push(i)
  2719. }
  2720. return e
  2721. }
  2722. }
  2723. }(),
  2724. function () {
  2725. var a = function (a, b) {
  2726. var c = 0;
  2727. for (c = 0; c < a.length; c++)
  2728. if (b === a[c]) return c;
  2729. return -1
  2730. };
  2731. FZ.DivManager = {
  2732. m_init: !1,
  2733. m_parentContainer: null,
  2734. m_display_list: null,
  2735. offsetLeft: 0,
  2736. offsetTop: 0,
  2737. init: function () {
  2738. this.m_init || (this.m_init = !0, this.m_parentContainer = null, this.m_display_list = this.m_display_list || [])
  2739. },
  2740. setSize: function (a, b) {
  2741. null !== this.m_parentContainer && (this.m_parentContainer.style.width = a + "px", this.m_parentContainer.style.height = b + "px")
  2742. },
  2743. setParent: function (a) {
  2744. this.m_parentContainer = a, this.m_parentContainer.style.position = "absolute", this.m_parentContainer.style.overflow = "hidden", this.offsetLeft = this.m_parentContainer.offsetLeft, this.offsetTop = this.m_parentContainer.offsetTop
  2745. },
  2746. setOffset: function (a, b) {
  2747. this.offsetLeft = a, this.offsetTop = b
  2748. },
  2749. getOffsetX: function () {
  2750. this.offsetLeft = this.m_parentContainer.offsetLeft;
  2751. return this.offsetLeft
  2752. },
  2753. getOffsetY: function () {
  2754. this.offsetTop = this.m_parentContainer.offsetTop;
  2755. return this.offsetTop
  2756. },
  2757. setOverflow: function (a) {
  2758. this.m_parentContainer && (this.m_parentContainer.style.overflow = a)
  2759. },
  2760. onmousemove: function (a) {
  2761. var b = 0;
  2762. b = 5
  2763. },
  2764. addChild: function (a) {
  2765. this.m_parentContainer.appendChild(a), this.m_display_list.push(a)
  2766. },
  2767. removeChild: function (b) {
  2768. var c = -1;
  2769. for (c = 0; c < this.m_parentContainer.childNodes.length; c++)
  2770. if (b == this.m_parentContainer.childNodes[c]) {
  2771. this.m_parentContainer.removeChild(b);
  2772. break
  2773. }
  2774. c = a(this.m_display_list, b), -1 !== c && this.m_display_list.splice(c, 1)
  2775. },
  2776. removeAllChild: function () {
  2777. var a = null;
  2778. while (this.m_display_list.length > 0) a = this.m_display_list.pop(), this.m_parentContainer.contains(a) && this.m_parentContainer.removeChild(a)
  2779. }
  2780. }
  2781. }(),
  2782. function () {
  2783. FZ.stateStatus = {}, FZ.stateStatus.INIT = 0, FZ.stateStatus.NORMAL = 5, FZ.stateStatus.HIDENOTIFY = 15, FZ.stateStatus.HIDELOGIC = 20, FZ.stateStatus.DONOTHING = 30, FZ.BaseState = FZ.newClass({
  2784. StateName: "GameStateBase",
  2785. m_status: FZ.stateStatus.NORMAL,
  2786. m_timer: null,
  2787. m_main_div: null,
  2788. m_main_div_clone: null,
  2789. m_ui_list: null,
  2790. m_btn_list: null,
  2791. init: function () {
  2792. FZ.GameBase.registerState(this.StateName, this), this.m_main_div = document.createElement("div"), this.m_main_div_clone = document.createElement("div"), this.m_ui_list = [], this.m_btn_list = []
  2793. },
  2794. pause: function () {},
  2795. resume: function () {},
  2796. createUIs: function (a) {
  2797. var b = 0,
  2798. c = null,
  2799. d = null;
  2800. for (b = 0; b < a.length; b++) c = FZ.getImgInfo(a[b]), d = document.createElement("div"), FZ.GameBase.setCss(d, c), this.m_ui_list.push(d), this.m_main_div.appendChild(d)
  2801. },
  2802. createBtns: function (a, b) {
  2803. var c = 0,
  2804. d = null,
  2805. e = null;
  2806. for (c = 0; c < a.length; c++) d = FZ.getImgInfo(a[c][0]), e = FZ.getImgInfo(a[c][1]), btn = new FZ.UIButton(d.w, d.h, d.cols, d.fileURL, e.fileURL), btn.setPos(d.x, d.y), btn.addMonitor(this), this.m_btn_list.push(btn), b && this.m_main_div.appendChild(btn.m_div)
  2807. },
  2808. resetTranslate: function (a) {
  2809. this.m_remove_div = !1, this.m_main_div.style.display = "inline", this.m_main_div.style.zIndex = 0, this.m_main_div.style.webkitTransitionDuration = "0s", this.m_main_div.style.opacity = a, this.m_main_div.style.webkitTransform = "translate(0px, 0px) rotate(0deg)"
  2810. },
  2811. fade_in: function (a, b) {
  2812. var c = this;
  2813. this.m_remove_div = !1, this.m_main_div.style.webkitTransitionDuration = a + "ms", this.m_main_div.style.opacity = b, this.m_main_div.style.webkitTransform = "translate(0px, 0px) rotate(0deg)"
  2814. },
  2815. fade_out: function (a, b, c) {
  2816. var d = this,
  2817. e = FZ.GameDefs.SCREEN_W,
  2818. f = 0;
  2819. this.m_remove_div = !0, this.m_main_div.style.webkitTransitionDuration = a + "ms", setTimeout(function () {
  2820. d.m_main_div.style.opacity = b, d.m_main_div.style.webkitTransform = "translate(" + e + "px, " + f + "0px) rotate(" + c + "deg)"
  2821. }, 1), setTimeout(function () {
  2822. d.m_remove_div && (d.m_main_div.style.display = "none")
  2823. }, a)
  2824. },
  2825. preProcess: function () {},
  2826. postProcess: function () {},
  2827. AIUpdate: function (a) {},
  2828. pushState: function (a) {
  2829. this.__stateStack.push(this.__StateLib[a])
  2830. },
  2831. popState: function () {
  2832. this.CurrentState = this.__stateStack.pop(), undefined !== this.CurrentState && null !== this.CurrentState && this.CurrentState.resume && this.CurrentState.resume.apply(this.CurrentState, arguments)
  2833. }
  2834. })
  2835. }(),
  2836. function () {
  2837. FZ.Game = {}, FZ.Game.checkButtun = function (a) {
  2838. var b = a.getPosition();
  2839. if (FZ.ControlManager.Mouse.x > b.x && FZ.ControlManager.Mouse.y > b.y && FZ.ControlManager.Mouse.x < b.x + a.__theImages[0][0].width && FZ.ControlManager.Mouse.y < b.y + a.__theImages[0][0].height) {
  2840. a.setFrame(1 + (FZ.ControlManager.Mouse.leftKey ? 1 : 0));
  2841. return !0
  2842. }
  2843. a.setFrame(0);
  2844. return !1
  2845. }, FZ.Game.PreLoadingState = new(FZ.newClass({
  2846. StateName: FZ.StateDefs.GAME_STATE_PRELOADING,
  2847. m_test_timer: 0,
  2848. preProcess: function () {
  2849. FZ.spriteManager.addResource("LOADING_BG", 0, "res/images/MAIN_MENU_AND_LOADING_BG.png", 0, 0, 1), FZ.spriteManager.addResource("majong_BG", 0, "res/images/majong_BG.png", 0, 0, 1), FZ.spriteManager.addResource("loading_empty", 0, "res/images/loading_empty.png", 0, 0, 1), FZ.spriteManager.addResource("loading_full", 0, "res/images/loading_full.png", 0, 0, 1), FZ.spriteManager.addResource("splash", 0, "res/images/splash.png", 0, 0, 1), this.m_timer = setTimeout(FZ.Tools.bind(this, this.AIUpdate), 500)
  2850. },
  2851. postProcess: function () {},
  2852. AIUpdate: function () {
  2853. FZ.PrintLog("" + this.m_test_timer), FZ.ResourceManager.isResourceLoaded() ? FZ.GameBase.switchToState(FZ.StateDefs.GAME_STATE_LOGO) : this.m_timer = setTimeout(FZ.Tools.bind(this, this.AIUpdate), 200)
  2854. }
  2855. }, FZ.BaseState))
  2856. }(), FZ.Diamond = FZ.newClass({
  2857. BLOCK_SPR_LIST: ["majong_1", "majong_2", "majong_3", "majong_4", "majong_5", "majong_6", "majong_7", "majong_8", "majong_9", "majong_10", "majong_11", "majong_12", "majong_13", "majong_14", "majong_15", "majong_16", "majong_17", "majong_18", "majong_19", "majong_20", "majong_21", "majong_22", "majong_23", "majong_24", "majong_25", "majong_26", "majong_27", "majong_28", "majong_29", "majong_30", "majong_31"],
  2858. m_state: FZ.GameDefs.DREAMPET_INIT,
  2859. m_search_flag: FZ.GameDefs.SEARCH_NONE,
  2860. m_style: -1,
  2861. m_module: -1,
  2862. m_line: 0,
  2863. m_col: 0,
  2864. m_x: 0,
  2865. m_y: 0,
  2866. m_dest_x: 0,
  2867. m_dest_y: 0,
  2868. m_fall_time: 0,
  2869. m_fall_speed_x: 0,
  2870. m_fall_speed_y: 0,
  2871. m_fall_x: 0,
  2872. m_fall_y: 0,
  2873. m_turn: FZ.GameDefs.DIAMOND_RORATE_NONE,
  2874. m_angle: 0,
  2875. m_spr: null,
  2876. m_flashTime: 0,
  2877. m_worldMatrix: null,
  2878. m_back_list: null,
  2879. m_div: null,
  2880. m_div_focus: null,
  2881. m_div_hint: null,
  2882. m_callback: null,
  2883. m_anim_callback: null,
  2884. m_flash_count: FZ.GameDefs.FLASH_COUNT,
  2885. init: function (a, b, c, d) {
  2886. this.m_search_flag = FZ.GameDefs.SEARCH_NONE, this.m_line = a, this.m_col = b, this.m_x = this.m_col * FZ.GameDefs.GRID_WIDTH + FZ.GameDefs.DREAMPET_OFFSET_X, this.m_y = this.m_line * FZ.GameDefs.GRID_HEIGHT + FZ.GameDefs.DREAMPET_OFFSET_Y, this.m_dest_x = this.m_x, this.m_dest_y = this.m_y, this.m_fall_time = 0, this.m_fall_speed_x = 0, this.m_fall_speed_y = 0, this.m_fall_x = this.m_x, this.m_fall_y = this.m_y, this.m_turn = FZ.GameDefs.DIAMOND_RORATE_NONE, this.m_style = Math.floor(c), this.m_state = Math.floor(d), this.m_flashTime = 0, this.m_worldMatrix = new FZ.Math.Matrix3, this.m_worldMatrix.identity();
  2887. switch (this.m_style) {
  2888. case FZ.GameDefs.PET_TYPE_0:
  2889. this.m_module = FZ.GameDefs.PET_1;
  2890. break;
  2891. case FZ.GameDefs.PET_TYPE_1:
  2892. this.m_module = FZ.GameDefs.PET_2;
  2893. break;
  2894. case FZ.GameDefs.PET_TYPE_2:
  2895. this.m_module = FZ.GameDefs.PET_3;
  2896. break;
  2897. case FZ.GameDefs.PET_TYPE_3:
  2898. this.m_module = FZ.GameDefs.PET_4;
  2899. break;
  2900. case FZ.GameDefs.PET_TYPE_4:
  2901. this.m_module = FZ.GameDefs.PET_5;
  2902. break;
  2903. case FZ.GameDefs.PET_TYPE_5:
  2904. this.m_module = FZ.GameDefs.PET_6;
  2905. break;
  2906. case FZ.GameDefs.PET_TYPE_6:
  2907. this.m_module = FZ.GameDefs.PET_7;
  2908. break;
  2909. case FZ.GameDefs.PET_TYPE_7:
  2910. this.m_module = FZ.GameDefs.PET_8;
  2911. break;
  2912. case FZ.GameDefs.PET_TYPE_8:
  2913. this.m_module = FZ.GameDefs.PET_9;
  2914. break;
  2915. case FZ.GameDefs.PET_TYPE_9:
  2916. this.m_module = FZ.GameDefs.PET_10;
  2917. break;
  2918. case FZ.GameDefs.PET_TYPE_10:
  2919. this.m_module = FZ.GameDefs.PET_11;
  2920. break;
  2921. case FZ.GameDefs.PET_TYPE_11:
  2922. this.m_module = FZ.GameDefs.PET_12;
  2923. break;
  2924. case FZ.GameDefs.PET_TYPE_12:
  2925. this.m_module = FZ.GameDefs.PET_13;
  2926. break;
  2927. case FZ.GameDefs.PET_TYPE_13:
  2928. this.m_module = FZ.GameDefs.PET_14;
  2929. break;
  2930. case FZ.GameDefs.PET_TYPE_14:
  2931. this.m_module = FZ.GameDefs.PET_15;
  2932. break;
  2933. case FZ.GameDefs.PET_TYPE_15:
  2934. this.m_module = FZ.GameDefs.PET_16;
  2935. break;
  2936. case FZ.GameDefs.PET_TYPE_16:
  2937. this.m_module = FZ.GameDefs.PET_17;
  2938. break;
  2939. case FZ.GameDefs.PET_TYPE_17:
  2940. this.m_module = FZ.GameDefs.PET_18;
  2941. break;
  2942. case FZ.GameDefs.PET_TYPE_18:
  2943. this.m_module = FZ.GameDefs.PET_19;
  2944. break;
  2945. case FZ.GameDefs.PET_TYPE_19:
  2946. this.m_module = FZ.GameDefs.PET_20;
  2947. break;
  2948. case FZ.GameDefs.PET_TYPE_20:
  2949. this.m_module = FZ.GameDefs.PET_21;
  2950. break;
  2951. case FZ.GameDefs.PET_TYPE_21:
  2952. this.m_module = FZ.GameDefs.PET_22;
  2953. break;
  2954. case FZ.GameDefs.PET_TYPE_22:
  2955. this.m_module = FZ.GameDefs.PET_23;
  2956. break;
  2957. case FZ.GameDefs.PET_TYPE_23:
  2958. this.m_module = FZ.GameDefs.PET_24;
  2959. break;
  2960. case FZ.GameDefs.PET_TYPE_24:
  2961. this.m_module = FZ.GameDefs.PET_25;
  2962. break;
  2963. case FZ.GameDefs.PET_TYPE_25:
  2964. this.m_module = FZ.GameDefs.PET_26;
  2965. break;
  2966. case FZ.GameDefs.PET_TYPE_26:
  2967. this.m_module = FZ.GameDefs.PET_27;
  2968. break;
  2969. case FZ.GameDefs.PET_TYPE_27:
  2970. this.m_module = FZ.GameDefs.PET_28;
  2971. break;
  2972. case FZ.GameDefs.PET_TYPE_28:
  2973. this.m_module = FZ.GameDefs.PET_29;
  2974. break;
  2975. case FZ.GameDefs.PET_TYPE_29:
  2976. this.m_module = FZ.GameDefs.PET_30;
  2977. break;
  2978. case FZ.GameDefs.PET_TYPE_30:
  2979. this.m_module = FZ.GameDefs.PET_31;
  2980. break;
  2981. case FZ.GameDefs.PET_TYPE_31:
  2982. this.m_module = FZ.GameDefs.PET_32;
  2983. break;
  2984. case FZ.GameDefs.PET_TYPE_32:
  2985. this.m_module = FZ.GameDefs.PET_33;
  2986. break;
  2987. case FZ.GameDefs.PET_TYPE_33:
  2988. this.m_module = FZ.GameDefs.PET_34;
  2989. break;
  2990. case FZ.GameDefs.PET_TYPE_34:
  2991. this.m_module = FZ.GameDefs.PET_35;
  2992. break;
  2993. case FZ.GameDefs.PET_TYPE_35:
  2994. this.m_module = FZ.GameDefs.PET_36;
  2995. break;
  2996. case FZ.GameDefs.PET_TYPE_36:
  2997. this.m_module = FZ.GameDefs.PET_37;
  2998. break;
  2999. case FZ.GameDefs.PET_TYPE_37:
  3000. this.m_module = FZ.GameDefs.PET_38;
  3001. break;
  3002. case FZ.GameDefs.PET_TYPE_38:
  3003. this.m_module = FZ.GameDefs.PET_39;
  3004. break;
  3005. case FZ.GameDefs.PET_TYPE_39:
  3006. this.m_module = FZ.GameDefs.PET_40;
  3007. break;
  3008. default:
  3009. this.m_module = FZ.GameDefs.PET_1
  3010. }
  3011. var e = null,
  3012. f = null;
  3013. this.m_back_list = [], f = FZ.getImgInfo(this.BLOCK_SPR_LIST[this.m_module]), e = "url(res/images/" + f.fileURL + ")", this.m_back_list.push(e), this.m_callback = null;
  3014. FZ.GameDefs.DREAMPET_REMOVE === d ? (this.m_div = document.createElement("div"), this.m_div_focus = document.createElement("div"), this.m_div_hint = document.createElement("div")) : (this.setCss(), this.m_div_focus = document.createElement("div"), this.m_div_focus.style.width = FZ.GameDefs.GRID_WIDTH + "px", this.m_div_focus.style.height = FZ.GameDefs.GRID_HEIGHT + "px", this.m_div_focus.style.position = "absolute", this.m_div_focus.style.backgroundRepeat = "no-repeat", this.m_div_focus.style.backgroundImage = "url(res/images/MAJONG_FOCUS.png)", this.hidden(), this.m_div_focus.style.webkitTransition = "opacity, translate", this.m_div.appendChild(this.m_div_focus), this.m_div_hint = document.createElement("div"), this.m_div_hint.style.width = FZ.GameDefs.GRID_WIDTH + "px", this.m_div_hint.style.height = FZ.GameDefs.GRID_HEIGHT + "px", this.m_div_hint.style.position = "absolute", this.m_div_hint.style.backgroundRepeat = "no-repeat", this.m_div_hint.style.backgroundImage = "url(res/images/MAJONG_FOCUS_HINT.png)", this.hiddenHint(), this.m_div_hint.style.webkitTransition = "opacity, translate", this.m_div.appendChild(this.m_div_hint), this.setPetFocus())
  3015. },
  3016. setCss: function () {
  3017. this.m_div = document.createElement("div"), this.m_div.style.width = FZ.GameDefs.GRID_WIDTH + 2 + "px", this.m_div.style.height = FZ.GameDefs.GRID_HEIGHT + 2 + "px", this.m_div.style.position = "absolute", this.m_div.style.webkitTransition = "opacity, left, top, translate", this.m_div.style.webkitTransition = "opacity, translate", this.m_div.style.backgroundRepeat = "no-repeat", this.m_div.style.left = this.m_x + "px", this.m_div.style.top = this.m_y + "px"
  3018. },
  3019. fade_in: function () {
  3020. this.m_div.style.webkitTransitionDuration = FZ.GameDefs.PET_FLICKER_TIME + "ms", this.m_div.style.opacity = 1, this.m_timer = setTimeout(FZ.Tools.bind(this, this.fade_out), FZ.GameDefs.PET_FLICKER_TIME)
  3021. },
  3022. flash: function () {
  3023. this.m_flash_count > 0 && (this.m_div_focus.style.webkitTransitionDuration = FZ.GameDefs.PET_FLICKER_FOCUS_TIME + "ms", this.m_div_focus.style.opacity = 0, this.m_flash_count--, this.m_timer = setTimeout(FZ.Tools.bind(this, this.flash_again), FZ.GameDefs.PET_FLICKER_FOCUS_TIME))
  3024. },
  3025. flash_again: function () {
  3026. this.m_div_focus.style.webkitTransitionDuration = FZ.GameDefs.PET_FLICKER_FOCUS_TIME + "ms", this.m_div_focus.style.opacity = 1, this.m_timer = setTimeout(FZ.Tools.bind(this, this.flash), FZ.GameDefs.PET_FLICKER_FOCUS_TIME)
  3027. },
  3028. fade_out: function () {
  3029. this.m_flash_count > 0 ? (this.m_div.style.webkitTransitionDuration = FZ.GameDefs.PET_FLICKER_TIME + "ms", this.m_div.style.opacity = 0, this.m_flash_count--, this.m_timer = setTimeout(FZ.Tools.bind(this, this.fade_in), FZ.GameDefs.PET_FLICKER_TIME)) : FZ.GameDefs.DREAMPET_FLASH_HINT === this.m_state && (this.setState(FZ.GameDefs.DREAMPET_INIT), this.hiddenHint())
  3030. },
  3031. fadeOut: function () {
  3032. this.m_div.style.webkitTransitionDuration = "500ms", this.m_div.style.opacity = 0, this.m_timer = setTimeout(FZ.Tools.bind(this, this.fadeEnd), 500)
  3033. },
  3034. fadeEnd: function () {
  3035. this.setState(FZ.GameDefs.DREAMPET_REMOVE), this.m_div.style.visibility = "hidden"
  3036. },
  3037. setPetFocus: function () {
  3038. FZ.GameDefs.DREAMPET_FLASH === this.m_state ? (this.m_div.style.backgroundImage = this.m_back_list[0], this.m_div.style.opacity = 1, this.fadeOut()) : FZ.GameDefs.DREAMPET_FLASH_HINT === this.m_state ? (this.m_div.style.backgroundImage = this.m_back_list[0], this.showHint(), this.m_timer = setTimeout(FZ.Tools.bind(this, function () {
  3039. FZ.GameDefs.DREAMPET_FLASH_HINT === this.m_state ? (this.setState(FZ.GameDefs.DREAMPET_INIT), this.hiddenHint()) : this.m_state === FZ.GameDefs.DREAMPET_FOCUS && this.hiddenHint()
  3040. }), 1500)) : this.m_state === FZ.GameDefs.DREAMPET_INIT ? this.m_div.style.backgroundImage = this.m_back_list[0] : this.m_state === FZ.GameDefs.DREAMPET_FOCUS ? (this.m_div.style.backgroundImage = this.m_back_list[0], this.m_div_focus.style.visibility = "visible", this.m_div_focus.style.webkitTransitionDuration = FZ.GameDefs.PET_FLICKER_FOCUS_TIME + "ms", this.m_div_focus.style.opacity = 1, this.m_flash_count = FZ.GameDefs.FLASH_FOCUS_COUNT) : this.m_state === FZ.GameDefs.DREAMPET_REMOVE && (this.m_div.style.visibility = "hidden")
  3041. },
  3042. show: function () {
  3043. this.m_div_focus.style.visibility = "visible"
  3044. },
  3045. hidden: function () {
  3046. this.m_div_focus.style.visibility = "hidden"
  3047. },
  3048. showHint: function () {
  3049. this.m_div_hint.style.visibility = "visible"
  3050. },
  3051. hiddenHint: function () {
  3052. this.m_div_hint.style.visibility = "hidden"
  3053. },
  3054. destroy: function () {
  3055. this.m_div && this.m_div.parentNode && this.m_div.parentNode.removeChild(this.m_div)
  3056. },
  3057. getLine: function () {
  3058. return this.m_line
  3059. },
  3060. getCol: function () {
  3061. return this.m_col
  3062. },
  3063. setLine: function (a) {
  3064. this.m_line = a
  3065. },
  3066. setCol: function (a) {
  3067. this.m_col = a
  3068. },
  3069. getStyle: function () {
  3070. return this.m_style
  3071. },
  3072. getState: function () {
  3073. return this.m_state
  3074. },
  3075. setStyle: function (a) {
  3076. this.m_style = a
  3077. },
  3078. setState: function (a) {
  3079. this.m_state = a
  3080. },
  3081. getSearchFlag: function () {
  3082. return this.m_search_flag
  3083. },
  3084. setSearchFlag: function (a) {
  3085. this.m_search_flag = a
  3086. },
  3087. updatePos: function () {
  3088. !this.m_div || (this.m_x = FZ.GameDefs.DREAMPET_OFFSET_X + FZ.GameDefs.GRID_WIDTH * this.m_col, this.m_y = FZ.GameDefs.DREAMPET_OFFSET_Y + FZ.GameDefs.GRID_HEIGHT * this.m_line, this.m_div.style.backgroundImage = this.m_back_list[0], this.m_div.style.left = this.m_x + "px", this.m_div.style.top = this.m_y + "px")
  3089. }
  3090. }), FZ.GRID_COOR = FZ.newClass({
  3091. line: 0,
  3092. col: 0,
  3093. init: function () {
  3094. this.line = 0, this.col = 0
  3095. }
  3096. }), FZ.DiamondManager = FZ.newClass({
  3097. EVT_MOUSE_OVER: "mouseover",
  3098. EVT_MOUSE_MOVE: "mousemove",
  3099. EVT_MOUSE_OUT: "mouseout",
  3100. EVT_MOUSE_CLICK: "click",
  3101. m_hintX: 0,
  3102. m_hintY: 0,
  3103. m_hintScore: null,
  3104. m_last_selected: -1,
  3105. m_dialog: !1,
  3106. m_leftNum: -1,
  3107. m_allPets: null,
  3108. m_missDiamonds: null,
  3109. m_hintCount: 0,
  3110. m_bonus_time: 0,
  3111. m_firstPet: null,
  3112. m_secondPet: null,
  3113. m_PetFirstIndex: 0,
  3114. m_PetSecondIndex: 0,
  3115. m_drawLineTime: 0,
  3116. m_left_pet: 0,
  3117. m_ctx: null,
  3118. m_level: 0,
  3119. m_displayPetsIndex: null,
  3120. m_reset_finished: !0,
  3121. m_parent: null,
  3122. m_observer: null,
  3123. m_stop_bubble: !1,
  3124. m_call_mOver: null,
  3125. m_call_mOut: null,
  3126. m_call_mMove: null,
  3127. m_call_mClick: null,
  3128. m_call_tStart: null,
  3129. m_call_tMove: null,
  3130. m_call_tEnd: null,
  3131. m_div_line: [],
  3132. isDebug: !1,
  3133. m_debug_div: null,
  3134. init: function () {
  3135. this.m_hintX = 0, this.m_hintY = 0, this.m_hintScore = "", this.m_last_selected = -1, this.m_dialog = !1, this.m_leftNum = -1, this.m_allPets = this.m_allPets || [], this.m_missDiamonds = this.m_missDiamonds || [], this.m_hintCount = 0, this.m_firstPet = null, this.m_secondPet = null, this.m_PetFirstIndex = 0, this.m_PetSecondIndex = 0, this.m_drawLineTime = 0, this.m_left_pet = FZ.GameDefs.ALL_PET_NUM;
  3136. for (var a = 0; a < 3; ++a) this.m_div_line[a] = document.createElement("div"), this.m_div_line[a].style.position = "absolute", this.m_div_line[a].style.backgroundRepeat = "no-repeat", this.m_div_line[a].style.backgroundColor = "#ffff00", this.m_div_line[a].style.visibility = "hidden", FZ.DivManager.addChild(this.m_div_line[a]);
  3137. this.isDebug && (this.m_debug_div = document.createElement("div"), this.m_debug_div.style.zIndex = 500, this.m_debug_div.style.width = "320px", this.m_debug_div.style.height = "40px", this.m_debug_div.style.left = "0px", this.m_debug_div.style.top = "438px", this.m_debug_div.style.position = "absolute", this.m_debug_div.style.color = "#ff0", this.m_debug_div.style.fontSize = FZ.GameDefs.STATS_FONT_SIZE + "px", this.m_debug_div.style.fontFamily = "Arial", this.m_debug_div.style.lineHeight = "40px", this.m_debug_div.style.textAlign = "center", this.m_debug_div.style.innerHTML = "", FZ.DivManager.addChild(this.m_debug_div))
  3138. },
  3139. removeEvent: function () {
  3140. !this.m_parent || (FZ.TARGET_DEF.MOBILE === FZ.TargetPort ? (FZ.EventRemove(this, this.m_parent, FZ.EVENT_DEF.T_START, this.m_call_tStart), this.m_call_tStart = null, FZ.EventRemove(this, this.m_parent, FZ.EVENT_DEF.T_MOVE, this.m_call_tMove), this.m_call_tMove = null, FZ.EventRemove(this, this.m_parent, FZ.EVENT_DEF.T_END, this.m_call_tEnd), this.m_call_tEnd = null) : (FZ.EventRemove(this, this.m_parent, FZ.EVENT_DEF.M_OVER, this.m_call_mOver), this.m_call_mOver = null, FZ.EventRemove(this, this.m_parent, FZ.EVENT_DEF.M_OUT, this.m_call_mOut), this.m_call_mOut = null, FZ.EventRemove(this, this.m_parent, FZ.EVENT_DEF.M_MOVE, this.m_call_mMove), this.m_call_mMove = null, FZ.EventRemove(this, this.m_parent, FZ.EVENT_DEF.M_CLICK, this.m_call_mClick), this.m_call_mClick = null))
  3141. },
  3142. setParent: function (a) {
  3143. a ? (this.m_parent = a, FZ.TARGET_DEF.MOBILE === FZ.TargetPort ? (FZ.EventHandler(this, this.m_parent, FZ.EVENT_DEF.T_START, this.mouseHandler), FZ.EventHandler(this, this.m_parent, FZ.EVENT_DEF.T_MOVE, this.mouseHandler), FZ.EventHandler(this, this.m_parent, FZ.EVENT_DEF.T_END, this.mouseHandler)) : (FZ.EventHandler(this, this.m_parent, FZ.EVENT_DEF.M_OVER, this.mouseHandler), FZ.EventHandler(this, this.m_parent, FZ.EVENT_DEF.M_MOVE, this.mouseHandler), FZ.EventHandler(this, this.m_parent, FZ.EVENT_DEF.M_OUT, this.mouseHandler), FZ.EventHandler(this, this.m_parent, FZ.EVENT_DEF.M_CLICK, this.mouseHandler))) : this.m_parent && (FZ.TARGET_DEF.MOBILE === FZ.TargetPort ? (FZ.EventRemove(this, this.m_parent, FZ.EVENT_DEF.T_START, this.m_call_tStart), this.m_call_tStart = null, FZ.EventRemove(this, this.m_parent, FZ.EVENT_DEF.T_MOVE, this.m_call_tMove), this.m_call_tMove = null, FZ.EventRemove(this, this.m_parent, FZ.EVENT_DEF.T_END, this.m_call_tEnd), this.m_call_tEnd = null) : (FZ.EventRemove(this, this.m_parent, FZ.EVENT_DEF.M_OVER, this.m_call_mOver), this.m_call_mOver = null, FZ.EventRemove(this, this.m_parent, FZ.EVENT_DEF.M_OUT, this.m_call_mOut), this.m_call_mOut = null, FZ.EventRemove(this, this.m_parent, FZ.EVENT_DEF.M_MOVE, this.m_call_mMove), this.m_call_mMove = null, FZ.EventRemove(this, this.m_parent, FZ.EVENT_DEF.M_CLICK, this.m_call_mClick), this.m_call_mClick = null))
  3144. },
  3145. setBubble: function (a) {
  3146. this.m_stop_bubble = a
  3147. },
  3148. setObserver: function (a) {
  3149. this.m_observer = a
  3150. },
  3151. setCtx: function (a) {
  3152. this.m_ctx = a
  3153. },
  3154. setASprite: function (a) {
  3155. this.m_spr = a
  3156. },
  3157. clearAllPets: function () {
  3158. var a = null;
  3159. while (this.m_allPets.length > 0) a = this.m_allPets.pop(), a && a.destroy()
  3160. },
  3161. getTouchPetIndex: function (a, b) {
  3162. var c = 0;
  3163. if (a < FZ.GameDefs.DREAMPET_OFFSET_X || a > FZ.GameDefs.DREAMPET_OFFSET_X + (FZ.GameDefs.DREAMPET_NUM_COL + 1) * FZ.GameDefs.GRID_WIDTH || b < FZ.GameDefs.DREAMPET_OFFSET_Y || b > FZ.GameDefs.DREAMPET_OFFSET_Y + (FZ.GameDefs.DREAMPET_NUM_LINE + 1) * FZ.GameDefs.GRID_HEIGHT) return -1;
  3164. var d = (b - FZ.GameDefs.DREAMPET_OFFSET_Y) / FZ.GameDefs.GRID_HEIGHT,
  3165. e = (a - FZ.GameDefs.DREAMPET_OFFSET_X) / FZ.GameDefs.GRID_WIDTH;
  3166. c = d * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + e, c >= (FZ.GameDefs.DREAMPET_NUM_LINE + 2) * (FZ.GameDefs.DREAMPET_NUM_COL + 2) && (c = -1);
  3167. return c
  3168. },
  3169. checkFocus: function () {
  3170. var a = 0;
  3171. for (a = 0; a < FZ.GameDefs.ALL_GENERAL; a++) {
  3172. var b = this.m_allPets[a].getState();
  3173. if (b === FZ.GameDefs.DREAMPET_FOCUS) return !0
  3174. }
  3175. return !1
  3176. },
  3177. searchHint: function () {
  3178. var a = new FZ.GRID_COOR,
  3179. b = new FZ.GRID_COOR,
  3180. c = Math.floor(FZ.Math.random(0, FZ.GameDefs.ALL_GENERAL - 1));
  3181. for (var d = c; d < FZ.GameDefs.ALL_GENERAL; d++) {
  3182. if (this.m_allPets[d].getState() === FZ.GameDefs.DREAMPET_REMOVE) continue;
  3183. a.col = this.m_allPets[d].getCol(), a.line = this.m_allPets[d].getLine();
  3184. for (var e = d + 1; e < FZ.GameDefs.ALL_GENERAL; e++) {
  3185. if (this.m_allPets[e].getState() === FZ.GameDefs.DREAMPET_REMOVE) continue;
  3186. if (this.m_allPets[d].getStyle() !== this.m_allPets[e].getStyle()) continue;
  3187. b.col = this.m_allPets[e].getCol(), b.line = this.m_allPets[e].getLine();
  3188. if (FZ.AG.SearchSpecialPath.getPath(this.m_allPets, FZ.GameDefs.DREAMPET_NUM_LINE + 2, FZ.GameDefs.DREAMPET_NUM_COL + 2, a.col, a.line, b.col, b.line) !== null) {
  3189. this.m_allPets[d].setState(FZ.GameDefs.DREAMPET_FLASH_HINT), this.m_allPets[d].setPetFocus(), this.m_allPets[e].setState(FZ.GameDefs.DREAMPET_FLASH_HINT), this.m_allPets[e].setPetFocus(), this.m_hintCount--;
  3190. return !0
  3191. }
  3192. }
  3193. }
  3194. for (var d = 0; d < c; d++) {
  3195. if (this.m_allPets[d].getState() === FZ.GameDefs.DREAMPET_REMOVE) continue;
  3196. a.col = this.m_allPets[d].getCol(), a.line = this.m_allPets[d].getLine();
  3197. for (var e = d + 1; e < FZ.GameDefs.ALL_GENERAL; e++) {
  3198. if (this.m_allPets[e].getState() === FZ.GameDefs.DREAMPET_REMOVE) continue;
  3199. if (this.m_allPets[d].getStyle() !== this.m_allPets[e].getStyle()) continue;
  3200. b.col = this.m_allPets[e].getCol(), b.line = this.m_allPets[e].getLine();
  3201. if (FZ.AG.SearchSpecialPath.getPath(this.m_allPets, FZ.GameDefs.DREAMPET_NUM_LINE + 2, FZ.GameDefs.DREAMPET_NUM_COL + 2, a.col, a.line, b.col, b.line) !== null) {
  3202. this.m_allPets[d].setState(FZ.GameDefs.DREAMPET_FLASH_HINT), this.m_allPets[d].setPetFocus(), this.m_allPets[e].setState(FZ.GameDefs.DREAMPET_FLASH_HINT), this.m_allPets[e].setPetFocus(), this.m_hintCount--;
  3203. return !0
  3204. }
  3205. }
  3206. }
  3207. return !1
  3208. },
  3209. searchHasMatch: function () {
  3210. var a = new FZ.GRID_COOR,
  3211. b = new FZ.GRID_COOR,
  3212. c = this.m_PointPath;
  3213. for (var d = 0; d < FZ.GameDefs.ALL_GENERAL; d++) {
  3214. if (this.m_allPets[d].getState() === FZ.GameDefs.DREAMPET_REMOVE) continue;
  3215. a.col = this.m_allPets[d].getCol();
  3216. if (a.col < 0) continue;
  3217. a.line = this.m_allPets[d].getLine();
  3218. if (a.line < 0) continue;
  3219. for (var e = d + 1; e < FZ.GameDefs.ALL_GENERAL; e++) {
  3220. if (this.m_allPets[e].getState() === FZ.GameDefs.DREAMPET_REMOVE) continue;
  3221. if (this.m_allPets[d].getStyle() !== this.m_allPets[e].getStyle()) continue;
  3222. b.col = this.m_allPets[e].getCol();
  3223. if (b.col < 0) continue;
  3224. b.line = this.m_allPets[e].getLine();
  3225. if (b.line < 0) continue;
  3226. if (FZ.AG.SearchSpecialPath.getPath(this.m_allPets, FZ.GameDefs.DREAMPET_NUM_LINE + 2, FZ.GameDefs.DREAMPET_NUM_COL + 2, a.col, a.line, b.col, b.line) !== null) {
  3227. this.m_PointPath = c;
  3228. return !0
  3229. }
  3230. }
  3231. }
  3232. this.isDebug && (this.m_debug_div.style.backgroundColor = "#000"), this.m_PointPath = c;
  3233. return !1
  3234. },
  3235. ResetPosition: function () {
  3236. var a, b, c = null;
  3237. this.getDisplayPet(), c = this.m_displayPetsIndex;
  3238. var d = c.length,
  3239. e = 0;
  3240. if (d === 4) this.exchagePet(c[0], c[1]);
  3241. else {
  3242. e = Math.floor(FZ.Math.random(1, d - 2));
  3243. for (var f = 0; f < e - 1; f++) a = c[f], b = c[f + 1], this.exchagePet(a, b);
  3244. for (var f = e; f < d - 2; f++) a = c[f], b = c[f + 1], this.exchagePet(a, b)
  3245. }
  3246. },
  3247. ResetTwoPosition: function () {
  3248. var a, b, c = null;
  3249. this.getDisplayPet(), c = this.m_displayPetsIndex;
  3250. var d = c.length;
  3251. a = c[0];
  3252. for (var e = 1; e < d - 1; e++) {
  3253. b = c[e];
  3254. if (this.m_allPets[a].getStyle() !== this.m_allPets[b].getStyle()) continue;
  3255. this.exchagePet(c[1], b);
  3256. break
  3257. }
  3258. },
  3259. resetPetPosEffect: function () {
  3260. if (this.m_PetFirstIndex > 0) {
  3261. var a = FZ.GameBase.SaveObject.m_cur_level;
  3262. switch (a) {
  3263. case 1:
  3264. break;
  3265. case 2:
  3266. break;
  3267. case 3:
  3268. this.updownReset(this.m_PetFirstIndex, this.m_PetSecondIndex);
  3269. break;
  3270. case 4:
  3271. break;
  3272. case 5:
  3273. this.leftrightReset(this.m_PetFirstIndex, this.m_PetSecondIndex);
  3274. break;
  3275. case 6:
  3276. this.downReset(this.m_PetFirstIndex, this.m_PetSecondIndex);
  3277. break;
  3278. case 7:
  3279. this.rightReset(this.m_PetFirstIndex, this.m_PetSecondIndex);
  3280. break;
  3281. case 8:
  3282. this.leftReset(this.m_PetFirstIndex, this.m_PetSecondIndex);
  3283. break;
  3284. case 9:
  3285. this.upReset(this.m_PetFirstIndex, this.m_PetSecondIndex);
  3286. break;
  3287. default:
  3288. }
  3289. this.m_PetFirstIndex = 0
  3290. }
  3291. },
  3292. getDisplayPet: function () {
  3293. var a = 0;
  3294. this.m_displayPetsIndex = [];
  3295. for (var b = 0; b < FZ.GameDefs.ALL_GENERAL; b++) {
  3296. var c = this.m_allPets[b].getState();
  3297. c !== FZ.GameDefs.DREAMPET_REMOVE && (a++, this.m_displayPetsIndex.push(b))
  3298. }
  3299. return a
  3300. },
  3301. isGreat: function (a, b) {
  3302. return a >= b ? !0 : !1
  3303. },
  3304. setPetDisappear: function (a, b) {
  3305. var c = 0,
  3306. d = [];
  3307. if (a < FZ.GameDefs.DREAMPET_OFFSET_X || a > FZ.GameDefs.DREAMPET_OFFSET_X + (FZ.GameDefs.DREAMPET_NUM_COL + 1) * FZ.GameDefs.GRID_WIDTH || b < FZ.GameDefs.DREAMPET_OFFSET_Y || b > FZ.GameDefs.DREAMPET_OFFSET_Y + (FZ.GameDefs.DREAMPET_NUM_LINE + 1) * FZ.GameDefs.GRID_HEIGHT) return !1;
  3308. var e = Math.floor((b - FZ.GameDefs.DREAMPET_OFFSET_Y) / FZ.GameDefs.GRID_HEIGHT),
  3309. f = Math.floor((a - FZ.GameDefs.DREAMPET_OFFSET_X) / FZ.GameDefs.GRID_WIDTH);
  3310. c = e * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + f, c >= (FZ.GameDefs.DREAMPET_NUM_LINE + 2) * (FZ.GameDefs.DREAMPET_NUM_COL + 2) && (c = -1);
  3311. if (c < 0) return !1;
  3312. var g = this.m_allPets[c];
  3313. if (null === g || undefined ===
  3314. g) return !1;
  3315. if (g.getState() === FZ.GameDefs.DREAMPET_FOCUS || g.getState() === FZ.GameDefs.DREAMPET_REMOVE) return !1;
  3316. if (!1 === this.checkFocus()) {
  3317. this.m_allPets[c].setState(FZ.GameDefs.DREAMPET_FOCUS), this.m_allPets[c].show(), this.m_firstPet = this.m_allPets[c];
  3318. return !1
  3319. }
  3320. this.m_secondPet = g, p1 = new FZ.GRID_COOR, p1.line = this.m_firstPet.getLine(), p1.col = this.m_firstPet.getCol(), p2 = new FZ.GRID_COOR, p2.line = this.m_secondPet.getLine(), p2.col = this.m_secondPet.getCol();
  3321. if (this.m_firstPet.getStyle() !== this.m_secondPet.getStyle()) {
  3322. this.m_allPets[c].setState(FZ.GameDefs.DREAMPET_FOCUS), this.m_allPets[c].show(), this.m_firstPet.setState(FZ.GameDefs.DREAMPET_INIT), this.m_firstPet.hidden(), this.m_firstPet = this.m_secondPet;
  3323. return !1
  3324. }
  3325. if ((d = FZ.AG.SearchSpecialPath.getPath(this.m_allPets, FZ.GameDefs.DREAMPET_NUM_LINE + 2, FZ.GameDefs.DREAMPET_NUM_COL + 2, p1.col, p1.line, p2.col, p2.line)) !== null) {
  3326. this.m_PointPath = d, this.m_allPets[(FZ.GameDefs.DREAMPET_NUM_COL + 2) * p1.line + p1.col].setState(FZ.GameDefs.DREAMPET_FLASH), this.m_allPets[(FZ.GameDefs.DREAMPET_NUM_COL + 2) * p2.line + p2.col].setState(FZ.GameDefs.DREAMPET_FLASH), this.m_PetFirstIndex = (FZ.GameDefs.DREAMPET_NUM_COL + 2) * p1.line + p1.col, this.m_allPets[this.m_PetFirstIndex].hidden(), this.m_PetSecondIndex = (FZ.GameDefs.DREAMPET_NUM_COL + 2) * p2.line + p2.col, this.m_allPets[this.m_PetFirstIndex].setPetFocus(), this.m_allPets[this.m_PetSecondIndex].setPetFocus(), this.m_score += 100, this.m_bonus_time += 5;
  3327. var h = this.m_PointPath.length,
  3328. i = [];
  3329. for (var j = 0; j < h - 1; ++j) {
  3330. i[1] = this.m_PointPath[j + 1][1], i[0] = this.m_PointPath[j + 1][0];
  3331. var k, l, m = this.ABS(FZ.GameDefs.DREAMPET_OFFSET_X + FZ.GameDefs.GRID_WIDTH * i[0] + FZ.GameDefs.GRID_WIDTH_HALF, FZ.GameDefs.DREAMPET_OFFSET_X + FZ.GameDefs.GRID_WIDTH * this.m_PointPath[j][0] + FZ.GameDefs.GRID_WIDTH_HALF),
  3332. n = this.ABS(FZ.GameDefs.DREAMPET_OFFSET_Y + FZ.GameDefs.GRID_HEIGHT * i[1] + FZ.GameDefs.GRID_HEIGHT_HALF, FZ.GameDefs.DREAMPET_OFFSET_Y + FZ.GameDefs.GRID_HEIGHT * this.m_PointPath[j][1] + FZ.GameDefs.GRID_HEIGHT_HALF),
  3333. o, p;
  3334. 0 === Math.floor(m) && (m = 3), 0 === Math.floor(n) && (n = 3), m === 3 && (k = this.isGreat(FZ.GameDefs.DREAMPET_OFFSET_Y + FZ.GameDefs.GRID_HEIGHT * i[1] + FZ.GameDefs.GRID_HEIGHT_HALF, FZ.GameDefs.DREAMPET_OFFSET_Y + FZ.GameDefs.GRID_HEIGHT * this.m_PointPath[j][1] + FZ.GameDefs.GRID_HEIGHT_HALF), k ? (o = FZ.GameDefs.DREAMPET_OFFSET_X + FZ.GameDefs.GRID_WIDTH * this.m_PointPath[j][0] + FZ.GameDefs.GRID_WIDTH_HALF, p = FZ.GameDefs.DREAMPET_OFFSET_Y + FZ.GameDefs.GRID_HEIGHT * this.m_PointPath[j][1] + FZ.GameDefs.GRID_HEIGHT_HALF) : (o = FZ.GameDefs.DREAMPET_OFFSET_X + FZ.GameDefs.GRID_WIDTH * this.m_PointPath[j][0] + FZ.GameDefs.GRID_WIDTH_HALF, p = FZ.GameDefs.DREAMPET_OFFSET_Y + FZ.GameDefs.GRID_HEIGHT * i[1] + FZ.GameDefs.GRID_HEIGHT_HALF, n += 3)), n === 3 && (l = this.isGreat(FZ.GameDefs.DREAMPET_OFFSET_X + FZ.GameDefs.GRID_WIDTH * i[0] + FZ.GameDefs.GRID_WIDTH_HALF, FZ.GameDefs.DREAMPET_OFFSET_X + FZ.GameDefs.GRID_WIDTH * this.m_PointPath[j][0] + FZ.GameDefs.GRID_WIDTH_HALF), l ? (o = FZ.GameDefs.DREAMPET_OFFSET_X + FZ.GameDefs.GRID_WIDTH * this.m_PointPath[j][0] + FZ.GameDefs.GRID_WIDTH_HALF, p = FZ.GameDefs.DREAMPET_OFFSET_Y + FZ.GameDefs.GRID_HEIGHT * this.m_PointPath[j][1] + FZ.GameDefs.GRID_HEIGHT_HALF) : (o = FZ.GameDefs.DREAMPET_OFFSET_X + FZ.GameDefs.GRID_WIDTH * i[0] + FZ.GameDefs.GRID_WIDTH_HALF, p = FZ.GameDefs.DREAMPET_OFFSET_Y + FZ.GameDefs.GRID_HEIGHT * this.m_PointPath[j][1] + FZ.GameDefs.GRID_HEIGHT_HALF, m += 3)), o < FZ.GameDefs.OFFSET_X ? (this.m_div_line[j].style.left = "5px", m > 3 && (m -= 24)) : o + m > FZ.GameDefs.SCREEN_W && m > 3 ? (m = 315 - o, this.m_div_line[j].style.left = o + "px") : o > FZ.GameDefs.SCREEN_W ? this.m_div_line[j].style.left = "312px" : this.m_div_line[j].style.left = o + "px", p < FZ.GameDefs.OFFSET_Y ? this.m_div_line[j].style.top = "70px" : p + n > FZ.GameDefs.SCREEN_H - FZ.GameDefs.SCREEN_BOTTOM_H && n > 3 ? (n = FZ.GameDefs.SCREEN_H - FZ.GameDefs.SCREEN_BOTTOM_H - 5 - p, this.m_div_line[j].style.top = p + "px") : p > FZ.GameDefs.SCREEN_H - FZ.GameDefs.SCREEN_BOTTOM_H ? (this.m_div_line[j].style.top = FZ.GameDefs.SCREEN_H - FZ.GameDefs.SCREEN_BOTTOM_H - 5 + "px", l === !0 && (m += 3)) : this.m_div_line[j].style.top = p + "px", this.m_div_line[j].style.width = m + "px", this.m_div_line[j].style.height = n + "px", this.m_div_line[j].style.zIndex = 100, this.m_div_line[j].style.visibility = "visible"
  3335. }
  3336. var q = this;
  3337. q.m_reset_finished = !1, setTimeout(function () {
  3338. for (var a = 0; a < h - 1; ++a) q.m_div_line[a].style.visibility = "hidden"
  3339. }, 400), setTimeout(function () {
  3340. q.resetPetPosEffect(), q.getLeftPet() !== 0 && q.searchHasMatch() === !1 && (FZ.Game.GameState.m_isNoMatch = !0, FZ.Game.GameState.levelCurrentTime = (new Date).getTime()), q.m_reset_finished = !0
  3341. }, 600), this.m_left_pet -= 2;
  3342. return !0
  3343. }
  3344. this.m_allPets[c].setState(FZ.GameDefs.DREAMPET_FOCUS), this.m_firstPet && (this.m_firstPet.setState(FZ.GameDefs.DREAMPET_INIT), this.m_firstPet.hidden(), this.m_secondPet && (this.m_secondPet.setState(FZ.GameDefs.DREAMPET_FOCUS), this.m_secondPet.show(), this.m_firstPet = this.m_secondPet));
  3345. return !1
  3346. },
  3347. ABS: function (a, b) {
  3348. return a > b ? a - b : b - a
  3349. },
  3350. updownReset: function (a, b) {
  3351. var c = 0,
  3352. d = 0;
  3353. a > b ? (c = a, d = b) : (c = b, d = a);
  3354. if (d > (FZ.GameDefs.DREAMPET_NUM_LINE_HALF + 1) * (FZ.GameDefs.DREAMPET_NUM_COL + 2)) {
  3355. for (var e = d; e > (FZ.GameDefs.DREAMPET_NUM_LINE_HALF + 2) * (FZ.GameDefs.DREAMPET_NUM_COL + 2); e = e - (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(e, e - (FZ.GameDefs.DREAMPET_NUM_COL + 2));
  3356. for (var e = c; e > (FZ.GameDefs.DREAMPET_NUM_LINE_HALF + 2) * (FZ.GameDefs.DREAMPET_NUM_COL + 2); e = e - (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(e, e - (FZ.GameDefs.DREAMPET_NUM_COL + 2))
  3357. } else if (c > (FZ.GameDefs.DREAMPET_NUM_LINE_HALF + 1) * (FZ.GameDefs.DREAMPET_NUM_COL + 2) && d < (FZ.GameDefs.DREAMPET_NUM_LINE_HALF + 1) * (FZ.GameDefs.DREAMPET_NUM_COL + 2)) {
  3358. for (var e = d; e < FZ.GameDefs.DREAMPET_NUM_LINE_HALF * (FZ.GameDefs.DREAMPET_NUM_COL + 2); e = e + (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(e, e + (FZ.GameDefs.DREAMPET_NUM_COL + 2));
  3359. for (var e = c; e > (FZ.GameDefs.DREAMPET_NUM_LINE_HALF + 2) * (FZ.GameDefs.DREAMPET_NUM_COL + 2); e = e - (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(e, e - (FZ.GameDefs.DREAMPET_NUM_COL + 2))
  3360. } else {
  3361. for (var e = c; e < FZ.GameDefs.DREAMPET_NUM_LINE_HALF * (FZ.GameDefs.DREAMPET_NUM_COL + 2); e = e + (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(e, e + (FZ.GameDefs.DREAMPET_NUM_COL + 2));
  3362. for (var e = d; e < FZ.GameDefs.DREAMPET_NUM_LINE_HALF * (FZ.GameDefs.DREAMPET_NUM_COL + 2); e = e + (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(e, e + (FZ.GameDefs.DREAMPET_NUM_COL + 2))
  3363. }
  3364. },
  3365. leftrightReset: function (a, b) {
  3366. var c = 0,
  3367. d = 0;
  3368. a > b ? (c = a, d = b) : (c = b, d = a);
  3369. var e = this.m_allPets[c].getLine(),
  3370. f = this.m_allPets[c].getCol(),
  3371. g = this.m_allPets[d].getLine(),
  3372. h = this.m_allPets[d].getCol();
  3373. if (f <= FZ.GameDefs.DREAMPET_NUM_COL_HALF && h <= FZ.GameDefs.DREAMPET_NUM_COL_HALF) {
  3374. for (var i = f; i < FZ.GameDefs.DREAMPET_NUM_COL_HALF; i++) this.exchagePet(e * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + i, e * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + i + 1);
  3375. for (var i = h; i < FZ.GameDefs.DREAMPET_NUM_COL_HALF; i++) this.exchagePet(g * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + i, g * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + i + 1)
  3376. } else if (h > FZ.GameDefs.DREAMPET_NUM_COL_HALF && f > FZ.GameDefs.DREAMPET_NUM_COL_HALF) {
  3377. for (var i = h; i > FZ.GameDefs.DREAMPET_NUM_COL_HALF + 1; i--) this.exchagePet(g * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + i, g * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + i - 1);
  3378. for (var i = f; i > FZ.GameDefs.DREAMPET_NUM_COL_HALF + 1; i--) this.exchagePet(e * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + i, e * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + i - 1)
  3379. } else if (h <= FZ.GameDefs.DREAMPET_NUM_COL_HALF && f > FZ.GameDefs.DREAMPET_NUM_COL_HALF) {
  3380. for (var i = h; i < FZ.GameDefs.DREAMPET_NUM_COL_HALF; i++) this.exchagePet(g * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + i, g * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + i + 1);
  3381. for (var i = f; i > FZ.GameDefs.DREAMPET_NUM_COL_HALF + 1; i--) this.exchagePet(e * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + i, e * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + i - 1)
  3382. } else {
  3383. for (var i = h; i > FZ.GameDefs.DREAMPET_NUM_COL_HALF + 1; i--) this.exchagePet(g * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + i, g * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + i - 1);
  3384. for (var i = f; i < FZ.GameDefs.DREAMPET_NUM_COL_HALF; i++) this.exchagePet(e * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + i, e * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + i + 1)
  3385. }
  3386. },
  3387. leftReset: function (a, b) {
  3388. var c = 0,
  3389. d = 0;
  3390. b > a ? (c = a, d = b) : (c = b, d = a);
  3391. var e = this.m_allPets[c].getLine(),
  3392. f = this.m_allPets[c].getCol(),
  3393. g = this.m_allPets[d].getLine(),
  3394. h = this.m_allPets[d].getCol();
  3395. for (var i = h; i < FZ.GameDefs.DREAMPET_NUM_COL; i++) this.exchagePet(g * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + i, g * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + i + 1);
  3396. for (var i = f; i < FZ.GameDefs.DREAMPET_NUM_COL; i++) this.exchagePet(e * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + i, e * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + i + 1)
  3397. },
  3398. rightReset: function (a, b) {
  3399. var c = 0,
  3400. d = 0;
  3401. a > b ? (c = a, d = b) : (c = b, d = a);
  3402. var e = this.m_allPets[c].getLine(),
  3403. f = this.m_allPets[c].getCol(),
  3404. g = this.m_allPets[d].getLine(),
  3405. h = this.m_allPets[d].getCol();
  3406. for (var i = h; i > 0; i--) {
  3407. if (i === 1) break;
  3408. this.exchagePet(g * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + i, g * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + i - 1)
  3409. }
  3410. for (var i = f; i > 0; i--) {
  3411. if (i === 1) break;
  3412. this.exchagePet(e * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + i, e * (FZ.GameDefs.DREAMPET_NUM_COL + 2) + i - 1)
  3413. }
  3414. },
  3415. downReset: function (a, b) {
  3416. var c = 0,
  3417. d = 0,
  3418. e = 0;
  3419. a > b ? (d = a, e = b) : (d = b, e = a);
  3420. if (!(d - (FZ.GameDefs.DREAMPET_NUM_COL + 2) < FZ.GameDefs.DREAMPET_NUM_COL + 2))
  3421. if (e - (FZ.GameDefs.DREAMPET_NUM_COL + 2) > FZ.GameDefs.DREAMPET_NUM_COL + 2 && (e - d) % (FZ.GameDefs.DREAMPET_NUM_COL + 2) == 0) {
  3422. for (var f = e - (FZ.GameDefs.DREAMPET_NUM_COL + 2); f > FZ.GameDefs.DREAMPET_NUM_COL + 2; f = f - (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(f + (FZ.GameDefs.DREAMPET_NUM_COL + 2), f), c = f;
  3423. for (var f = d - (FZ.GameDefs.DREAMPET_NUM_COL + 2); f >= c; f = f - (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(f + (FZ.GameDefs.DREAMPET_NUM_COL + 2), f)
  3424. } else {
  3425. for (var f = d - (FZ.GameDefs.DREAMPET_NUM_COL + 2); f > FZ.GameDefs.DREAMPET_NUM_COL + 2; f = f - (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(f + (FZ.GameDefs.DREAMPET_NUM_COL + 2), f);
  3426. for (var f = e - (FZ.GameDefs.DREAMPET_NUM_COL + 2); f > FZ.GameDefs.DREAMPET_NUM_COL + 2; f = f - (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(f + (FZ.GameDefs.DREAMPET_NUM_COL + 2), f)
  3427. }
  3428. },
  3429. upReset: function (a, b) {
  3430. var c = 0,
  3431. d, e;
  3432. a > b ? (d = a, e = b) : (d = b, e = a);
  3433. if (!(FZ.GameDefs.ALL_GENERAL - e - (FZ.GameDefs.DREAMPET_NUM_COL + 2) < FZ.GameDefs.DREAMPET_NUM_COL + 2)) {
  3434. for (var f = d; f + (FZ.GameDefs.DREAMPET_NUM_COL + 2) < FZ.GameDefs.ALL_GENERAL - (FZ.GameDefs.DREAMPET_NUM_COL + 2); f = f + (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(f, f + (FZ.GameDefs.DREAMPET_NUM_COL + 2));
  3435. for (var f = e; f + (FZ.GameDefs.DREAMPET_NUM_COL + 2) < FZ.GameDefs.ALL_GENERAL - (FZ.GameDefs.DREAMPET_NUM_COL + 2); f = f + (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(f + (FZ.GameDefs.DREAMPET_NUM_COL + 2), f)
  3436. }
  3437. },
  3438. centerReset: function (a, b) {
  3439. var c = 0,
  3440. d, e;
  3441. b > a ? (d = a, e = b) : (d = b, e = a);
  3442. var f = this.m_allPets[d].getLine(),
  3443. g = this.m_allPets[d].getCol(),
  3444. h = this.m_allPets[e].getLine(),
  3445. i = this.m_allPets[e].getCol();
  3446. if (g <= FZ.GameDefs.DREAMPET_NUM_COL_HALF && f > FZ.GameDefs.DREAMPET_NUM_LINE_HALF) {
  3447. if (i <= FZ.GameDefs.DREAMPET_NUM_COL_HALF && h > FZ.GameDefs.DREAMPET_NUM_LINE_HALF && Math.floor((e - d) % (FZ.GameDefs.DREAMPET_NUM_COL + 2)) === 0) {
  3448. c = e;
  3449. for (var j = e; j > 0; j--) {
  3450. if (this.m_allPets[j - 1].getState() === FZ.GameDefs.DREAMPET_REMOVE) {
  3451. c = j;
  3452. break
  3453. }
  3454. this.exchagePet(j, j - 1)
  3455. }
  3456. for (var j = c; j < FZ.GameDefs.ALL_GENERAL - (FZ.GameDefs.DREAMPET_NUM_COL + 2); j = j + (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(j, j + (FZ.GameDefs.DREAMPET_NUM_COL + 2));
  3457. c = d;
  3458. for (var j = d; j > 0; j--) {
  3459. if (this.m_allPets[j - 1].getState() === FZ.GameDefs.DREAMPET_REMOVE) {
  3460. c = j;
  3461. break
  3462. }
  3463. this.exchagePet(j, j - 1)
  3464. }
  3465. for (var j = c; j < FZ.GameDefs.ALL_GENERAL - (FZ.GameDefs.DREAMPET_NUM_COL + 2); j = j + (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(j, j + (FZ.GameDefs.DREAMPET_NUM_COL + 2));
  3466. return
  3467. }
  3468. if (i <= FZ.GameDefs.DREAMPET_NUM_COL_HALF && h > FZ.GameDefs.DREAMPET_NUM_LINE_HALF && Math.floor((e - d) % (FZ.GameDefs.DREAMPET_NUM_COL + 2)) === 0) {
  3469. c = e;
  3470. for (var j = e; j > 0; j--) {
  3471. if (this.m_allPets[j - 1].getState() === FZ.GameDefs.DREAMPET_REMOVE) {
  3472. c = j;
  3473. break
  3474. }
  3475. this.exchagePet(j, j - 1)
  3476. }
  3477. for (var j = c; j < FZ.GameDefs.ALL_GENERAL - (FZ.GameDefs.DREAMPET_NUM_COL + 2); j = j + (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(j, j + (FZ.GameDefs.DREAMPET_NUM_COL + 2));
  3478. c = d;
  3479. for (var j = d; j > 0; j--) {
  3480. if (this.m_allPets[j - 1].getState() === FZ.GameDefs.DREAMPET_REMOVE) {
  3481. c = j;
  3482. break
  3483. }
  3484. this.exchagePet(j, j - 1)
  3485. }
  3486. for (var j = c; j < FZ.GameDefs.ALL_GENERAL - (FZ.GameDefs.DREAMPET_NUM_COL + 2); j = j + (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(j, j + (FZ.GameDefs.DREAMPET_NUM_COL + 2));
  3487. return
  3488. }
  3489. }
  3490. if (g > FZ.GameDefs.DREAMPET_NUM_COL_HALF && f <= FZ.GameDefs.DREAMPET_NUM_LINE_HALF && i > FZ.GameDefs.DREAMPET_NUM_COL_HALF && h <= FZ.GameDefs.DREAMPET_NUM_LINE_HALF && e - d < FZ.GameDefs.DREAMPET_NUM_COL_HALF) {
  3491. c = e;
  3492. for (var j = e; j < (h + 1) * (FZ.GameDefs.DREAMPET_NUM_COL + 2); j++) {
  3493. if (this.m_allPets[j + 1].getState() === FZ.GameDefs.DREAMPET_REMOVE) {
  3494. c = j;
  3495. break
  3496. }
  3497. this.exchagePet(j, j + 1)
  3498. }
  3499. for (var j = c; j > FZ.GameDefs.DREAMPET_NUM_COL + 2; j = j - (FZ.GameDefs.DREAMPET_NUM_COL + 2)) {
  3500. if (this.m_allPets[j].getState() === FZ.GameDefs.DREAMPET_REMOVE && this.m_allPets[j - (FZ.GameDefs.DREAMPET_NUM_COL + 2)].getState() === FZ.GameDefs.DREAMPET_REMOVE) {
  3501. c = j;
  3502. break
  3503. }
  3504. this.exchagePet(j, j - (FZ.GameDefs.DREAMPET_NUM_COL + 2))
  3505. }
  3506. c = d;
  3507. for (var j = d; j < (f + 1) * (FZ.GameDefs.DREAMPET_NUM_COL + 2); j++) {
  3508. if (this.m_allPets[j + 1].getState() === FZ.GameDefs.DREAMPET_REMOVE) {
  3509. c = j;
  3510. break
  3511. }
  3512. this.exchagePet(j, j + 1)
  3513. }
  3514. for (var j = c; j > FZ.GameDefs.DREAMPET_NUM_COL + 2; j = j - (FZ.GameDefs.DREAMPET_NUM_COL + 2)) {
  3515. if (this.m_allPets[j].getState() === FZ.GameDefs.DREAMPET_REMOVE && this.m_allPets[j - (FZ.GameDefs.DREAMPET_NUM_COL + 2)].getState() === FZ.GameDefs.DREAMPET_REMOVE) {
  3516. c = j;
  3517. break
  3518. }
  3519. this.exchagePet(j, j - (FZ.GameDefs.DREAMPET_NUM_COL + 2))
  3520. }
  3521. } else {
  3522. if (g > FZ.GameDefs.DREAMPET_NUM_COL_HALF && f > FZ.GameDefs.DREAMPET_NUM_LINE_HALF) {
  3523. if (i > FZ.GameDefs.DREAMPET_NUM_COL_HALF && h > FZ.GameDefs.DREAMPET_NUM_LINE_HALF && (Math.floor((e - d) % (FZ.GameDefs.DREAMPET_NUM_COL + 2)) === 0 || e - d < FZ.GameDefs.DREAMPET_NUM_COL_HALF)) {
  3524. c = e;
  3525. for (var j = e; j < (h + 1) * (FZ.GameDefs.DREAMPET_NUM_COL + 2); j++) {
  3526. if (this.m_allPets[j + 1].getState() === FZ.GameDefs.DREAMPET_REMOVE) {
  3527. c = j;
  3528. break
  3529. }
  3530. this.exchagePet(j, j + 1)
  3531. }
  3532. for (var j = c; j < FZ.GameDefs.ALL_GENERAL - (FZ.GameDefs.DREAMPET_NUM_COL + 2); j = j + (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(j, j + (FZ.GameDefs.DREAMPET_NUM_COL + 2));
  3533. c = d;
  3534. for (var j = d; j < (f + 1) * (FZ.GameDefs.DREAMPET_NUM_COL + 2); j++) {
  3535. if (this.m_allPets[j + 1].getState() === FZ.GameDefs.DREAMPET_REMOVE) {
  3536. c = j;
  3537. break
  3538. }
  3539. this.exchagePet(j, j + 1)
  3540. }
  3541. for (var j = c; j < FZ.GameDefs.ALL_GENERAL - (FZ.GameDefs.DREAMPET_NUM_COL + 2); j = j + (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(j, j + (FZ.GameDefs.DREAMPET_NUM_COL + 2));
  3542. return
  3543. }
  3544. if (i > FZ.GameDefs.DREAMPET_NUM_COL_HALF && h > FZ.GameDefs.DREAMPET_NUM_LINE_HALF && Math.floor((e - d) % (FZ.GameDefs.DREAMPET_NUM_COL + 2)) !== 0) {
  3545. c = d;
  3546. for (var j = d; j < (f + 1) * (FZ.GameDefs.DREAMPET_NUM_COL + 2); j++) {
  3547. if (this.m_allPets[j + 1].getState() === FZ.GameDefs.DREAMPET_REMOVE) {
  3548. c = j;
  3549. break
  3550. }
  3551. this.exchagePet(j, j + 1)
  3552. }
  3553. for (var j = c; j < FZ.GameDefs.ALL_GENERAL - (FZ.GameDefs.DREAMPET_NUM_COL + 2); j = j + (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(j, j + (FZ.GameDefs.DREAMPET_NUM_COL + 2));
  3554. c = e;
  3555. for (var j = e; j < (h + 1) * (FZ.GameDefs.DREAMPET_NUM_COL + 2); j++) {
  3556. if (this.m_allPets[j + 1].getState() === FZ.GameDefs.DREAMPET_REMOVE) {
  3557. c = j;
  3558. break
  3559. }
  3560. this.exchagePet(j, j + 1)
  3561. }
  3562. for (var j = c; j < FZ.GameDefs.ALL_GENERAL - (FZ.GameDefs.DREAMPET_NUM_COL + 2); j = j + (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(j, j + (FZ.GameDefs.DREAMPET_NUM_COL + 2));
  3563. return
  3564. }
  3565. }
  3566. c = d;
  3567. if (g <= FZ.GameDefs.DREAMPET_NUM_COL_HALF && f <= FZ.GameDefs.DREAMPET_NUM_LINE_HALF) {
  3568. for (var j = d; j > 0; j--) {
  3569. if (this.m_allPets[j - 1].getState() === FZ.GameDefs.DREAMPET_REMOVE) {
  3570. c = j;
  3571. break
  3572. }
  3573. this.exchagePet(j, j - 1)
  3574. }
  3575. for (var j = c; j > FZ.GameDefs.DREAMPET_NUM_COL + 2; j = j - (FZ.GameDefs.DREAMPET_NUM_COL + 2)) {
  3576. if (this.m_allPets[j].getState() === FZ.GameDefs.DREAMPET_REMOVE && this.m_allPets[j - (FZ.GameDefs.DREAMPET_NUM_COL + 2)].getState() === FZ.GameDefs.DREAMPET_REMOVE) {
  3577. c = j;
  3578. break
  3579. }
  3580. this.exchagePet(j, j - (FZ.GameDefs.DREAMPET_NUM_COL + 2))
  3581. }
  3582. } else if (g <= FZ.GameDefs.DREAMPET_NUM_COL_HALF && f > FZ.GameDefs.DREAMPET_NUM_LINE_HALF) {
  3583. for (var j = d; j > 0; j--) {
  3584. if (this.m_allPets[j - 1].getState() === FZ.GameDefs.DREAMPET_REMOVE) {
  3585. c = j;
  3586. break
  3587. }
  3588. this.exchagePet(j, j - 1)
  3589. }
  3590. for (var j = c; j < FZ.GameDefs.ALL_GENERAL - (FZ.GameDefs.DREAMPET_NUM_COL + 2); j = j + (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(j, j + (FZ.GameDefs.DREAMPET_NUM_COL + 2))
  3591. } else if (g > FZ.GameDefs.DREAMPET_NUM_COL_HALF && f > FZ.GameDefs.DREAMPET_NUM_LINE_HALF) {
  3592. for (var j = d; j < (f + 1) * (FZ.GameDefs.DREAMPET_NUM_COL + 2); j++) {
  3593. if (this.m_allPets[j + 1].getState() === FZ.GameDefs.DREAMPET_REMOVE) {
  3594. c = j;
  3595. break
  3596. }
  3597. this.exchagePet(j, j + 1)
  3598. }
  3599. for (var j = c; j < FZ.GameDefs.ALL_GENERAL - (FZ.GameDefs.DREAMPET_NUM_COL + 2); j = j + (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(j, j + (FZ.GameDefs.DREAMPET_NUM_COL + 2))
  3600. } else if (g > FZ.GameDefs.DREAMPET_NUM_COL_HALF && f <= FZ.GameDefs.DREAMPET_NUM_LINE_HALF) {
  3601. for (var j = d; j < (f + 1) * (FZ.GameDefs.DREAMPET_NUM_COL + 2); j++) {
  3602. if (this.m_allPets[j + 1].getState() === FZ.GameDefs.DREAMPET_REMOVE) {
  3603. c = j;
  3604. break
  3605. }
  3606. this.exchagePet(j, j + 1)
  3607. }
  3608. for (var j = c; j > FZ.GameDefs.DREAMPET_NUM_COL + 2; j = j - (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(j, j - (FZ.GameDefs.DREAMPET_NUM_COL + 2))
  3609. }
  3610. c = e;
  3611. if (i <= FZ.GameDefs.DREAMPET_NUM_COL_HALF && h <= FZ.GameDefs.DREAMPET_NUM_LINE_HALF) {
  3612. for (var j = e; j > 0; j--) {
  3613. if (this.m_allPets[j - 1].getState() === FZ.GameDefs.DREAMPET_REMOVE) {
  3614. c = j;
  3615. break
  3616. }
  3617. this.exchagePet(j, j - 1)
  3618. }
  3619. for (var j = c; j > FZ.GameDefs.DREAMPET_NUM_COL + 2; j = j - (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(j, j - (FZ.GameDefs.DREAMPET_NUM_COL + 2))
  3620. } else if (i <= FZ.GameDefs.DREAMPET_NUM_COL_HALF && h > FZ.GameDefs.DREAMPET_NUM_LINE_HALF) {
  3621. for (var j = e; j > 0; j--) {
  3622. if (this.m_allPets[j - 1].getState() === FZ.GameDefs.DREAMPET_REMOVE) {
  3623. c = j;
  3624. break
  3625. }
  3626. this.exchagePet(j, j - 1)
  3627. }
  3628. for (var j = c; j < FZ.GameDefs.ALL_GENERAL - (FZ.GameDefs.DREAMPET_NUM_COL + 2); j = j + (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(j, j + (FZ.GameDefs.DREAMPET_NUM_COL + 2))
  3629. } else if (i > FZ.GameDefs.DREAMPET_NUM_COL_HALF && h > FZ.GameDefs.DREAMPET_NUM_LINE_HALF) {
  3630. for (var j = e; j < (h + 1) * (FZ.GameDefs.DREAMPET_NUM_COL + 2); j++) {
  3631. if (this.m_allPets[j + 1].getState() === FZ.GameDefs.DREAMPET_REMOVE) {
  3632. c = j;
  3633. break
  3634. }
  3635. this.exchagePet(j, j + 1)
  3636. }
  3637. for (var j = c; j < FZ.GameDefs.ALL_GENERAL - (FZ.GameDefs.DREAMPET_NUM_COL + 2); j = j + (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(j, j + (FZ.GameDefs.DREAMPET_NUM_COL + 2))
  3638. } else if (i > FZ.GameDefs.DREAMPET_NUM_COL_HALF && h <= FZ.GameDefs.DREAMPET_NUM_LINE_HALF) {
  3639. for (var j = e; j < (h + 1) * (FZ.GameDefs.DREAMPET_NUM_COL + 2); j++) {
  3640. if (this.m_allPets[j + 1].getState() === FZ.GameDefs.DREAMPET_REMOVE) {
  3641. c = j;
  3642. break
  3643. }
  3644. this.exchagePet(j, j + 1)
  3645. }
  3646. for (var j = c; j > FZ.GameDefs.DREAMPET_NUM_COL + 2; j = j - (FZ.GameDefs.DREAMPET_NUM_COL + 2)) this.exchagePet(j, j - (FZ.GameDefs.DREAMPET_NUM_COL + 2))
  3647. }
  3648. }
  3649. },
  3650. exchagePet: function (a, b) {
  3651. var c = this.m_allPets[a].getCol(),
  3652. d = this.m_allPets[a].getLine(),
  3653. e = this.m_allPets[b].getCol(),
  3654. f = this.m_allPets[b].getLine(),
  3655. g = null;
  3656. g = this.m_allPets[a], this.m_allPets[a] = this.m_allPets[b], this.m_allPets[a].setCol(c), this.m_allPets[a].setLine(d), this.m_allPets[a].updatePos(), this.m_allPets[b] = g, this.m_allPets[b].setCol(e), this.m_allPets[b].setLine(f), this.m_allPets[b].updatePos(), this.m_allPets[a].setPetFocus(), this.m_allPets[b].setPetFocus()
  3657. },
  3658. getLeftPet: function () {
  3659. return this.m_left_pet
  3660. },
  3661. getScore: function () {
  3662. return this.m_score
  3663. },
  3664. setScore: function (a) {
  3665. this.m_score = a
  3666. },
  3667. getBonusTime: function () {
  3668. return this.m_bonus_time
  3669. },
  3670. setBonusTime: function (a) {
  3671. this.m_bonus_time = a
  3672. },
  3673. onDrawPathLine: function () {
  3674. FZ.GameBase.MainContext.strokeStyle = "#ff0", FZ.GameBase.MainContext.lineWidth = 3;
  3675. var a = 0,
  3676. b = [];
  3677. for (var c = 0; c < this.m_PointPath.length - 1; ++c) b[1] = this.m_PointPath[c + 1][1], b[0] = this.m_PointPath[c + 1][0], FZ.GameBase.MainContext.setTransform(this.m_worldMatrix.m11, this.m_worldMatrix.m12, this.m_worldMatrix.m21, this.m_worldMatrix.m22, this.m_worldMatrix.dx, this.m_worldMatrix.dy), FZ.GameBase.MainContext.beginPath(), FZ.GameBase.MainContext.moveTo(FZ.GameDefs.DREAMPET_OFFSET_X + FZ.GameDefs.GRID_WIDTH * this.m_PointPath[c][0] + FZ.GameDefs.GRID_WIDTH_HALF, FZ.GameDefs.DREAMPET_OFFSET_Y + FZ.GameDefs.GRID_HEIGHT * this.m_PointPath[c][1] + FZ.GameDefs.GRID_HEIGHT_HALF), FZ.GameBase.MainContext.lineTo(FZ.GameDefs.DREAMPET_OFFSET_X + FZ.GameDefs.GRID_WIDTH * b[0] + FZ.GameDefs.GRID_WIDTH_HALF, FZ.GameDefs.DREAMPET_OFFSET_Y + FZ.GameDefs.GRID_HEIGHT * b[1] + FZ.GameDefs.GRID_HEIGHT_HALF), FZ.GameBase.MainContext.closePath(), FZ.GameBase.MainContext.stroke()
  3678. },
  3679. showPets: function () {
  3680. var a = null;
  3681. for (var b = 0; b < FZ.GameDefs.ALL_GENERAL; b++) a = this.m_allPets[b], a.m_div && (a.m_div.style.visibility = "visible")
  3682. },
  3683. hidePets: function () {
  3684. var a = null;
  3685. for (var b = 0; b < FZ.GameDefs.ALL_GENERAL; b++) a = this.m_allPets[b], a.m_div && (a.m_div.style.visibility = "hidden")
  3686. },
  3687. resumeLevel: function () {
  3688. this.m_score = FZ.GameBase.SaveObject.m_cur_score, this.m_hintCount = FZ.GameBase.SaveObject.m_cur_hintCount, this.m_left_pet = FZ.GameBase.SaveObject.m_cur_left_pet, this.m_level = FZ.GameBase.SaveObject.m_cur_level;
  3689. var a, b = null,
  3690. c = null;
  3691. c = [];
  3692. var d = 0,
  3693. e = 0,
  3694. f = 0,
  3695. g = FZ.GameDefs.DREAMPET_INIT;
  3696. this.clearAllPets();
  3697. for (a = 0; a < FZ.GameDefs.ALL_GENERAL; a++) g = FZ.GameBase.SaveObject.m_data[a].state, f = FZ.GameBase.SaveObject.m_data[a].style, d = Math.floor(a / (FZ.GameDefs.DREAMPET_NUM_COL + 2)), e = a % (FZ.GameDefs.DREAMPET_NUM_COL + 2), b = null, b = new FZ.Diamond(d, e, f, g), this.m_allPets.push(b), FZ.GameDefs.DREAMPET_REMOVE !== g && this.m_parent.appendChild(b.m_div), FZ.GameDefs.DREAMPET_FOCUS === g && (this.m_firstPet = b)
  3698. },
  3699. saveLevel: function () {
  3700. FZ.GameBase.SaveObject.m_gamein = !0, FZ.GameBase.SaveObject.m_cur_score = this.m_score, FZ.GameBase.SaveObject.m_cur_hintCount = this.m_hintCount, FZ.GameBase.SaveObject.m_cur_left_pet = this.m_left_pet, FZ.GameBase.SaveObject.m_level_usedTime = FZ.Game.GameState.m_level_usedTime, FZ.TargetMobile !== FZ.TARGET_DEF.ANDRIOD && (FZ.GameBase.SaveObject.m_sound = FZ.Game.GameState.m_sound);
  3701. var a, b = null,
  3702. c = null;
  3703. c = FZ.GameBase.SaveObject.m_data;
  3704. for (a = 0; a < FZ.GameDefs.ALL_GENERAL; a++) c[a].style = this.m_allPets[a].m_style, c[a].state = this.m_allPets[a].m_state;
  3705. FZ.GameBase.saveGame()
  3706. },
  3707. initAllPets: function (a) {
  3708. var b = 0,
  3709. c = 0,
  3710. d = 0,
  3711. e = FZ.GameDefs.DREAMPET_INIT,
  3712. f = 0,
  3713. g = null,
  3714. h = null;
  3715. h = h || [], this.m_bonus_time = 0, this.m_score = 0, this.m_hintCount = FZ.GameDefs.LEVEL_HINT_NUMBER[this.getLevel()], this.clearAllPets(), this.m_left_pet = FZ.GameDefs.ALL_PET_NUM;
  3716. var i = 0,
  3717. j = 0;
  3718. i = FZ.Math.random(0, FZ.GameDefs.DIAMOND_TYPES - FZ.GameDefs.LEVEL_PET_KIND[FZ.GameBase.SaveObject.m_cur_level]), i < 0 && (i = 0), j = i + FZ.GameDefs.LEVEL_PET_KIND[FZ.GameBase.SaveObject.m_cur_level];
  3719. for (f = 0; f < FZ.GameDefs.ALL_GENERAL_HALF; f++) {
  3720. d = FZ.Math.random(i, j), e = FZ.GameDefs.DREAMPET_INIT, b = Math.floor(f / (FZ.GameDefs.DREAMPET_NUM_COL + 2)), c = f % (FZ.GameDefs.DREAMPET_NUM_COL + 2);
  3721. if (b === 0 || b === FZ.GameDefs.DREAMPET_NUM_LINE + 1 || c === 0 || c === FZ.GameDefs.DREAMPET_NUM_COL + 1) e = FZ.GameDefs.DREAMPET_REMOVE, d = -1;
  3722. g = null, g = new FZ.Diamond(b, c, d, e), this.m_allPets.push(g), FZ.GameDefs.DREAMPET_REMOVE !== e && this.m_parent.appendChild(g.m_div), h.push(g)
  3723. }
  3724. var k = null,
  3725. l;
  3726. for (f = FZ.GameDefs.ALL_GENERAL_HALF; f < FZ.GameDefs.ALL_GENERAL; f++) {
  3727. l = Math.floor(FZ.Math.random(0, h.length)), e = FZ.GameDefs.DREAMPET_INIT, d = h[l].getStyle(), b = Math.floor(f / (FZ.GameDefs.DREAMPET_NUM_COL + 2)), c = f % (FZ.GameDefs.DREAMPET_NUM_COL + 2);
  3728. if (-1 === d)
  3729. if (b !== 0 && b !== FZ.GameDefs.DREAMPET_NUM_LINE + 1 && c !== 0 && c !== FZ.GameDefs.DREAMPET_NUM_COL + 1) {
  3730. l = Math.floor(FZ.Math.random(0, h.length)), d = h[l].getStyle();
  3731. while (-1 === d) l = Math.floor(FZ.Math.random(0, h.length)), d = h[l].getStyle()
  3732. } else e = FZ.GameDefs.DREAMPET_REMOVE, d = -1;
  3733. else if (b === 0 || b === FZ.GameDefs.DREAMPET_NUM_LINE + 1 || c === 0 || c === FZ.GameDefs.DREAMPET_NUM_COL + 1) {
  3734. l = Math.floor(FZ.Math.random(0, h.length)), d = h[l].getStyle();
  3735. while (-1 !== d) l = Math.floor(FZ.Math.random(0, h.length)), d = h[l].getStyle();
  3736. e = FZ.GameDefs.DREAMPET_REMOVE
  3737. }
  3738. h.splice(l, 1), g = null, g = new FZ.Diamond(b, c, d, e), this.m_allPets.push(g), FZ.GameDefs.DREAMPET_REMOVE !== e && this.m_parent.appendChild(g.m_div)
  3739. }
  3740. this.m_leftNum = -1, this.m_dialog = !1
  3741. },
  3742. debugAllPetsType: function () {
  3743. var a = 0;
  3744. debug_data = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, -1, -1, 2, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, 1, -1, -1, -1, -1, -1, -1, 1, 1, 1, -1, -1, 1, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1];
  3745. for (a = 0; a < FZ.GameDefs.ALL_GENERAL; a++) - 1 !== debug_data[a] && (this.m_allPets[a].m_module = debug_data[a], this.m_allPets[a].m_style = debug_data[a]), this.m_allPets[a].setModule(), -1 === debug_data[a] ? this.m_allPets[a].m_state = -1 : this.m_allPets[a].m_state = 0
  3746. },
  3747. getDiamondNumber: function (a) {
  3748. var b = 0,
  3749. c = 0,
  3750. d = null;
  3751. for (c = a; c < FZ.GameDefs.ALL_GENERAL; c += FZ.GameDefs.DIAMOND_COL_NUM) d = this.m_allPets[c], null !== d && b++;
  3752. return b
  3753. },
  3754. getLeftDiamonds: function () {
  3755. var a = null,
  3756. b = 0,
  3757. c = 0;
  3758. for (b = 0; b < FZ.GameDefs.ALL_GENERAL; b++) {
  3759. a = this.m_allPets[b];
  3760. if (!a) continue;
  3761. c++
  3762. }
  3763. return c
  3764. },
  3765. getLevel: function () {
  3766. return this.m_level
  3767. },
  3768. setLevel: function (a) {
  3769. this.m_level = a
  3770. },
  3771. getHintCount: function () {
  3772. return this.m_hintCount
  3773. },
  3774. setHintCount: function (a) {
  3775. this.m_hintCount = a;
  3776. },
  3777. mouseHandler: function (a) {
  3778. //a.preventDefault();
  3779. var b = !1,
  3780. c = "",
  3781. d = 0,
  3782. e = 0;
  3783. if ( !! this.m_reset_finished) {
  3784. FZ.TARGET_DEF.MOBILE === FZ.TargetPort ? FZ.EVENT_DEF.T_START === a.type ? (c = FZ.EVENT_DEF.M_MOVE, d = a.touches[0].pageX - FZ.DivManager.getOffsetX(), e = a.touches[0].pageY - FZ.DivManager.getOffsetY(), this.m_last_x = d, this.m_last_y = e) : FZ.EVENT_DEF.T_MOVE === a.type ? (c = FZ.EVENT_DEF.M_MOVE, d = a.touches[0].pageX - FZ.DivManager.getOffsetX(), e = a.touches[0].pageY - FZ.DivManager.getOffsetY(), this.m_last_x = d, this.m_last_y = e) : FZ.EVENT_DEF.T_END === a.type && (c = FZ.EVENT_DEF.M_CLICK, d = this.m_last_x, e = this.m_last_y, this.m_last_x = 0, this.m_last_y = 0) : (d = a.pageX - FZ.DivManager.getOffsetX(), e = a.pageY - FZ.DivManager.getOffsetY(), c = a.type);
  3785. if (FZ.EVENT_DEF.M_MOVE !== c && FZ.EVENT_DEF.M_CLICK === c) {
  3786. b = this.setPetDisappear(d, e);
  3787. if (b === !1) return;
  3788. this.m_observer && this.m_observer.checkWin && this.m_observer.checkWin()
  3789. }
  3790. return !1
  3791. }
  3792. }
  3793. }),
  3794. function () {
  3795. FZ.UIButton = FZ.newClass({
  3796. SWITCH_ON: 0,
  3797. SWITCH_OFF: 1,
  3798. m_w: 0,
  3799. m_h: 0,
  3800. m_col: 1,
  3801. m_div: null,
  3802. m_img_list: null,
  3803. m_call_mOver: null,
  3804. m_call_mOut: null,
  3805. m_call_mMove: null,
  3806. m_call_mClick: null,
  3807. m_call_tStart: null,
  3808. m_call_tMove: null,
  3809. m_call_tEnd: null,
  3810. m_is_switch: !1,
  3811. m_btn_state: 0,
  3812. m_observer: null,
  3813. m_enable: !0,
  3814. init: function (a, b, c, d, e) {
  3815. this.m_col = c, this.m_w = a, this.m_h = b, this.m_div = document.createElement("div"), this.m_div.style.position = "absolute", this.m_div.style.width = this.m_w + "px", this.m_div.style.height = this.m_h + "px", this.m_img_list = [], this.m_img_list.push(d), this.m_img_list.push(e), this.m_div.style.backgroundRepeat = "no-repeat", this.m_div.style.backgroundImage = "url(res/images/" + this.m_img_list[0] + ")", this.m_div.style.backgroundPosition = "0px 0px", this.m_enable = !0, this.m_is_switch = !1, this.setEnable(this.m_enable)
  3816. },
  3817. setSwitchButton: function (a, b) {
  3818. this.m_is_switch = !0, this.m_btn_state = this.SWITCH_ON, this.m_img_list.push(a), this.m_img_list.push(b)
  3819. },
  3820. setSwitchState: function (a) {
  3821. var b = 0;
  3822. this.m_btn_state = a, this.SWITCH_OFF === this.m_btn_state && (b = 2), this.m_div.style.backgroundImage = "url(res/images/" + this.m_img_list[b + 0] + ")"
  3823. },
  3824. setEnable: function (a) {
  3825. this.m_enable = a, this.m_enable ? this.addEvent() : this.removeEvent()
  3826. },
  3827. setPos: function (a, b) {
  3828. this.m_div.style.left = a + "px", this.m_div.style.top = b + "px"
  3829. },
  3830. addEvent: function () {
  3831. this.removeEvent(), FZ.TARGET_DEF.MOBILE === FZ.TargetPort ? (FZ.EventHandler(this, this.m_div, FZ.EVENT_DEF.T_START, this.mouseHandler), FZ.EventHandler(this, this.m_div, FZ.EVENT_DEF.T_MOVE, this.mouseHandler), FZ.EventHandler(this, this.m_div, FZ.EVENT_DEF.T_END, this.mouseHandler)) : (FZ.EventHandler(this, this.m_div, FZ.EVENT_DEF.M_OVER, this.mouseHandler), FZ.EventHandler(this, this.m_div, FZ.EVENT_DEF.M_MOVE, this.mouseHandler), FZ.EventHandler(this, this.m_div, FZ.EVENT_DEF.M_OUT, this.mouseHandler), FZ.EventHandler(this, this.m_div, FZ.EVENT_DEF.M_CLICK, this.mouseHandler))
  3832. },
  3833. removeEvent: function () {
  3834. FZ.TARGET_DEF.MOBILE === FZ.TargetPort ? (FZ.EventRemove(this, this.m_div, FZ.EVENT_DEF.T_START, this.m_call_tStart), this.m_call_tStart = null, FZ.EventRemove(this, this.m_div, FZ.EVENT_DEF.T_MOVE, this.m_call_tMove), this.m_call_tMove = null, FZ.EventRemove(this, this.m_div, FZ.EVENT_DEF.T_END, this.m_call_tEnd), this.m_call_tEnd = null) : (FZ.EventRemove(this, this.m_div, FZ.EVENT_DEF.M_OVER, this.m_call_mOver), this.m_call_mOver = null, FZ.EventRemove(this, this.m_div, FZ.EVENT_DEF.M_OUT, this.m_call_mOut), this.m_call_mOut = null, FZ.EventRemove(this, this.m_div, FZ.EVENT_DEF.M_MOVE, this.m_call_mMove), this.m_call_mMove = null, FZ.EventRemove(this, this.m_div, FZ.EVENT_DEF.M_CLICK, this.m_call_mClick), this.m_call_mClick = null)
  3835. },
  3836. addMonitor: function (a) {
  3837. this.m_observer = a
  3838. },
  3839. removeMonitor: function () {
  3840. this.m_observer = null
  3841. },
  3842. mouseHandler: function (a) {
  3843. var b = "",
  3844. c = 0;
  3845. a.stopPropagation(), null, this.m_is_switch && this.SWITCH_OFF === this.m_btn_state && (c = 2), FZ.TARGET_DEF.MOBILE === FZ.TargetPort ? (FZ.EVENT_DEF.T_START === a.type && (b = FZ.EVENT_DEF.M_OVER), FZ.EVENT_DEF.T_END === a.type && (b = FZ.EVENT_DEF.M_CLICK)) : b = a.type, FZ.EVENT_DEF.M_OVER === b ? FZ.Game.GameState.m_gamePause === !0 ? this === FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_HOME_INDEX] ? this.m_div.style.backgroundImage = "url(res/images/BTN_MAIN_MENU_ICON_TOUCH.png)" : this === FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_HINT_INDEX] ? this.m_div.style.backgroundImage = "url(res/images/BTN_HINT_GREY.png)" : this === FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_PAUSE_INDEX] ? this.m_div.style.backgroundImage = "url(res/images/" + this.m_img_list[c + 1] + ")" : FZ.Game.GameState.BTN_SOUND_INDEX !== undefined && (this.SWITCH_OFF === this.m_btn_state && this === FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_SOUND_INDEX] && (this.m_div.style.backgroundImage = "url(res/images/BTN_SOUND_OFF_GREY.png)"), this.SWITCH_ON === this.m_btn_state && this === FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_SOUND_INDEX] && (this.m_div.style.backgroundImage = "url(res/images/BTN_SOUND_GREY.png)")) : this.m_div.style.backgroundImage = "url(res/images/" + this.m_img_list[c + 1] + ")" : FZ.EVENT_DEF.M_OUT === b ? FZ.Game.GameState.m_gamePause === !0 ? this === FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_HOME_INDEX] ? this.m_div.style.backgroundImage = "url(res/images/BTN_MAIN_MENU_ICON.png)" : this === FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_HINT_INDEX] ? this.m_div.style.backgroundImage = "url(res/images/BTN_HINT_GREY.png)" : this === FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_PAUSE_INDEX] ? this.m_div.style.backgroundImage = "url(res/images/" + this.m_img_list[c + 0] + ")" : FZ.Game.GameState.BTN_SOUND_INDEX !== undefined && (this.SWITCH_OFF === this.m_btn_state && this === FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_SOUND_INDEX] && (this.m_div.style.backgroundImage = "url(res/images/BTN_SOUND_OFF_GREY.png)"), this.SWITCH_ON === this.m_btn_state && this === FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_SOUND_INDEX] && (this.m_div.style.backgroundImage = "url(res/images/BTN_SOUND_GREY.png)")) : this.m_div.style.backgroundImage = "url(res/images/" + this.m_img_list[c + 0] + ")" : FZ.EVENT_DEF.M_CLICK === b && (FZ.Game.GameState.m_gamePause === !0 ? this === FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_HOME_INDEX] ? this.m_div.style.backgroundImage = "url(res/images/BTN_MAIN_MENU_ICON.png)" : this === FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_HINT_INDEX] ? this.m_div.style.backgroundImage = "url(res/images/BTN_HINT_GREY.png)" : this === FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_PAUSE_INDEX] ? this.m_div.style.backgroundImage = "url(res/images/" + this.m_img_list[c + 0] + ")" : FZ.Game.GameState.BTN_SOUND_INDEX !== undefined && (this.SWITCH_OFF === this.m_btn_state && this === FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_SOUND_INDEX] && (this.m_div.style.backgroundImage = "url(res/images/BTN_SOUND_OFF_GREY.png)"), this.SWITCH_ON === this.m_btn_state && this === FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_SOUND_INDEX] && (this.m_div.style.backgroundImage = "url(res/images/BTN_SOUND_GREY.png)")) : this.m_div.style.backgroundImage = "url(res/images/" + this.m_img_list[c + 0] + ")", null !== this.m_observer && this.m_observer.buttonClick && this.m_observer.buttonClick(this));
  3846. return !1
  3847. }
  3848. })
  3849. }(),
  3850. function () {
  3851. FZ.UIMenu = FZ.newClass({
  3852. MENU_SHOW: 0,
  3853. MENU_HIDE: 1,
  3854. m_div: null,
  3855. m_back_div: null,
  3856. m_btn_list: null,
  3857. m_back_w: 0,
  3858. m_back_h: 0,
  3859. m_observer: null,
  3860. m_state: 0,
  3861. m_show_x: 0,
  3862. m_show_y: 0,
  3863. m_hide_x: 0,
  3864. m_hide_y: 0,
  3865. m_btn_enable: null,
  3866. init: function () {
  3867. this.m_div = document.createElement("div"), this.m_div.style.position = "absolute", this.m_div.style.webkitTransition = "translate", this.m_btn_list = [], this.m_back_div = document.createElement("div"), this.setState(this.MENU_SHOW, 0)
  3868. },
  3869. setBackImage: function (a, b, c) {
  3870. var d = null;
  3871. undefined !== b && (this.m_back_w = b), undefined !== c && (this.m_back_h = c), this.m_div.style.width = this.m_back_w + "px", this.m_div.style.height = this.m_back_h + "px", this.m_back_div.style.width = this.m_back_w + "px", this.m_back_div.style.height = this.m_back_h + "px", this.m_back_div.style.position = "absolute", this.m_back_div.style.backgroundRepeat = "no-repeat", this.m_back_div.style.backgroundImage = "url(res/images/" + a + ")", this.m_back_div.style.backgroundPosition = "0px; 0px", this.m_div.appendChild(this.m_back_div)
  3872. },
  3873. setzIndex: function (a) {
  3874. this.m_div.style.zIndex = a
  3875. },
  3876. setPos: function (a, b) {
  3877. this.m_div.style.webkitTransitionDuration = "0.2s", this.m_div.style.webkitTransform = "translate(" + a + "px, " + b + "px)"
  3878. },
  3879. setShowPos: function (a, b) {
  3880. this.m_show_x = a, this.m_show_y = b
  3881. },
  3882. setHidePos: function (a, b) {
  3883. this.m_hide_x = a, this.m_hide_y = b
  3884. },
  3885. addMonitor: function (a) {
  3886. this.m_observer = a
  3887. },
  3888. removeMonitor: function () {
  3889. this.m_observer = null
  3890. },
  3891. setEnableBtn: function (a) {
  3892. this.m_btn_enable = a, a.m_div.style.zIndex = 1
  3893. },
  3894. addButton: function (a) {
  3895. this.m_div.appendChild(a.m_div), this.m_btn_list.push(a)
  3896. },
  3897. addEnableBtn: function () {
  3898. switch (this.m_state) {
  3899. case this.MENU_SHOW:
  3900. this.m_btn_enable && this.m_btn_enable.setSwitchState(this.m_btn_enable.SWITCH_OFF);
  3901. break;
  3902. case this.MENU_HIDE:
  3903. this.m_btn_enable && this.m_btn_enable.setSwitchState(this.m_btn_enable.SWITCH_ON);
  3904. break;
  3905. default:
  3906. }
  3907. },
  3908. setState: function (a, b) {
  3909. this.m_state = a;
  3910. switch (this.m_state) {
  3911. case this.MENU_SHOW:
  3912. this.setPos(this.m_show_x, this.m_show_y);
  3913. break;
  3914. case this.MENU_HIDE:
  3915. this.setPos(this.m_hide_x, this.m_hide_y);
  3916. break;
  3917. default:
  3918. }
  3919. this.addEnableBtn()
  3920. },
  3921. removeButton: function (a) {
  3922. var b = -1,
  3923. c = 0;
  3924. for (c = 0; c < this.m_btn_list.length; c++)
  3925. if (a === this.m_btn_list[c]) {
  3926. b = c;
  3927. break
  3928. } - 1 !== b && (a.removeEvent(), a.removeMonitor(), this.m_btn_list.splice(b, 1))
  3929. },
  3930. addEvent: function () {
  3931. var a = 0,
  3932. b = null;
  3933. for (a = 0; a < this.m_btn_list.length; a++) b = this.m_btn_list[a], b.addMonitor(this), b.setEnable(!0)
  3934. },
  3935. removeEvent: function (a) {
  3936. var b = 0,
  3937. c = null;
  3938. for (b = 0; b < this.m_btn_list.length; b++) c = this.m_btn_list[b], c.removeMonitor(), c.setEnable(!1)
  3939. },
  3940. buttonClick: function (a) {
  3941. null !== this.m_observer && this.m_observer.menuItemClick && this.m_observer.menuItemClick(a)
  3942. }
  3943. })
  3944. }(), FZ.Game.LogoState = new(FZ.newClass({
  3945. StateName: FZ.StateDefs.GAME_STATE_LOGO,
  3946. CUR_UI_DEFS: ["splash"],
  3947. m_test_timer: 0,
  3948. preProcess: function () {
  3949. this.m_main_div.style.webkitTransition = "opacity", this.m_main_div.style.backgroundColor = "#fff", this.m_main_div.style.width = FZ.GameDefs.SCREEN_W + "px", this.m_main_div.style.height = FZ.GameDefs.SCREEN_H + "px", this.m_main_div.style.webkitTransitionDuration = "0s", this.m_main_div.style.opacity = 0, FZ.DivManager.addChild(this.m_main_div), this.m_timer = setTimeout(FZ.Tools.bind(this, this.fade_in), 10)
  3950. },
  3951. postProcess: function () {
  3952. FZ.DivManager.removeChild(this.m_main_div), clearTimeout(this.m_timer)
  3953. },
  3954. fade_in: function () {
  3955. this.m_main_div.style.webkitTransitionDuration = "10ms", this.m_main_div.style.opacity = 1, this.m_timer = setTimeout(FZ.Tools.bind(this, this.fade_out), 10)
  3956. },
  3957. fade_out: function () {
  3958. this.m_main_div.style.webkitTransitionDuration = "10ms", this.m_main_div.style.opacity = 0, this.m_timer = setTimeout(FZ.Tools.bind(this, this.fade_end), 10)
  3959. },
  3960. fade_end: function () {
  3961. FZ.GameBase.switchToState(FZ.StateDefs.GAME_STATE_LOADING)
  3962. },
  3963. AIUpdate: function (a) {}
  3964. }, FZ.BaseState)), FZ.Game.LoadingState = new(FZ.newClass({
  3965. StateName: FZ.StateDefs.GAME_STATE_LOADING,
  3966. CUR_UI_DEFS: ["majong_BG", "LOADING_BG", "loading_empty", "loading_full"],
  3967. m_test_timer: 0,
  3968. m_bar_w: 0,
  3969. m_bar_div: null,
  3970. preProcess: function () {
  3971. var a = null,
  3972. b = this,
  3973. c = 0,
  3974. d = null;
  3975. this.createUIs(this.CUR_UI_DEFS), d = FZ.getImgInfo(this.CUR_UI_DEFS[3]), this.m_bar_w = d.w, this.m_bar_div = this.m_ui_list[3], this.m_bar_div.style.overflow = "hidden", this.m_bar_div.style.display = "none";
  3976. for (c = 0; c < FZ.IphoneUI.length; c++) d = FZ.IphoneUI[c], FZ.spriteManager.addResource(d.name, d.zOrder, "res/images/" + d.fileURL, d.x, d.y, d.cols);
  3977. FZ.ResourceManager.addResource({
  3978. Name: "BGMusic",
  3979. Type: "Audio",
  3980. URL: FZ.IphoneMusic[0]
  3981. }), FZ.DivManager.addChild(this.m_main_div), this.resetTranslate(0), setTimeout(function () {
  3982. b.fade_in.call(b, 2e3, 1)
  3983. }, 10), this.m_timer = setTimeout(FZ.Tools.bind(this, this.AIUpdate), 100)
  3984. },
  3985. postProcess: function () {
  3986. FZ.DivManager.removeChild(this.m_main_div), clearTimeout(this.m_timer)
  3987. },
  3988. AIUpdate: function (a) {
  3989. var b = 0;
  3990. this.m_timer = setTimeout(FZ.Tools.bind(this, this.AIUpdate), 200), 0 !== FZ.ResourceManager.__ResourceCount && (b = this.m_bar_w * FZ.ResourceManager.__ResourceLoaded / FZ.ResourceManager.__ResourceCount), this.m_bar_div.style.width = "" + b + "px", this.m_bar_div.style.display = "inline";
  3991. if (FZ.ResourceManager.isResourceLoaded()) {
  3992. var c = FZ.ResourceManager.ResourceLib.BGMusic.Resource;
  3993. FZ.Music.set(c, !0), FZ.GameBase.switchToState(FZ.StateDefs.GAME_STATE_MAINMEN)
  3994. }
  3995. }
  3996. }, FZ.BaseState)), FZ.Game.MainmenuState = new(FZ.newClass({
  3997. StateName: FZ.StateDefs.GAME_STATE_MAINMEN,
  3998. CUR_UI_DEFS: ["majong_BG_MAINMENU", "MAIN_MENU_BG"],
  3999. BTN_PLAY_INDEX: 0,
  4000. CUR_BTN_ANDROID_DEFS: [
  4001. ["BTN_GAME_START", "BTN_GAME_START_TOUCH"],
  4002. ["BTN_GAME_CONTINUE", "BTN_GAME_CONTINUE_TOUCH"]
  4003. ],
  4004. CUR_BTN_DEFS: [
  4005. ["BTN_GAME_START", "BTN_GAME_START_TOUCH"],
  4006. ["BTN_GAME_CONTINUE", "BTN_GAME_CONTINUE_TOUCH"],
  4007. ["BTN_MENU_SOUND", "BTN_MENU_SOUND_TOUCH"]
  4008. ],
  4009. SOUND_SWITCH_DEFS: ["BTN_MENU_SOUND_OFF", "BTN_MENU_SOUND_OFF_TOUCH"],
  4010. BTN_NEW_GAME_INDEX: 0,
  4011. BTN_SOUND_INDEX: 2,
  4012. BTN_CONTINUE_INDEX: 1,
  4013. m_load_ui: !1,
  4014. m_next_state: "",
  4015. preProcess: function () {
  4016. var a = 0,
  4017. b = null,
  4018. c = null,
  4019. d = null,
  4020. e = null,
  4021. f = this;
  4022. //屏蔽音乐按钮
  4023. this.m_load_ui || (this.createUIs(this.CUR_UI_DEFS), FZ.TargetMobile !== FZ.TARGET_DEF.ANDRIOD ? this.createBtns(this.CUR_BTN_DEFS, !0) : this.createBtns(this.CUR_BTN_ANDROID_DEFS, !0), FZ.TargetMobile !== FZ.TARGET_DEF.ANDRIOD && (c = FZ.getImgInfo(this.SOUND_SWITCH_DEFS[0]), cloneInfo = FZ.getImgInfo(this.SOUND_SWITCH_DEFS[1]), this.m_btn_list[this.BTN_SOUND_INDEX].setSwitchButton(c.fileURL, cloneInfo.fileURL)), FZ.DivManager.addChild(this.m_main_div), FZ.TargetMobile !== FZ.TARGET_DEF.ANDRIOD && (this.m_sound = FZ.GameBase.SaveObject.m_sound, FZ.Music.setMute(!this.m_sound)), this.m_load_ui = !0);
  4024. //this.m_load_ui || (this.createUIs(this.CUR_UI_DEFS), FZ.TargetMobile == null ? this.createBtns(this.CUR_BTN_DEFS, !0) : this.createBtns(this.CUR_BTN_ANDROID_DEFS, !0), FZ.TargetMobile == null && (c = FZ.getImgInfo(this.SOUND_SWITCH_DEFS[0]), cloneInfo = FZ.getImgInfo(this.SOUND_SWITCH_DEFS[1]), this.m_btn_list[this.BTN_SOUND_INDEX].setSwitchButton(c.fileURL, cloneInfo.fileURL)), FZ.DivManager.addChild(this.m_main_div), FZ.TargetMobile == null && (this.m_sound = FZ.GameBase.SaveObject.m_sound, FZ.Music.setMute(!this.m_sound)), this.m_load_ui = !0);
  4025. if (FZ.TargetMobile !== FZ.TARGET_DEF.ANDRIOD) {
  4026. this.m_sound = FZ.GameBase.SaveObject.m_sound;
  4027. var b = this.m_btn_list[this.BTN_SOUND_INDEX];
  4028. this.m_sound === !0 ? b.setSwitchState(b.SWITCH_ON) : b.setSwitchState(b.SWITCH_OFF)
  4029. }
  4030. FZ.GameBase.SaveObject.m_cur_level === 0 ? (this.m_btn_list[this.BTN_PLAY_INDEX].setEnable(!0), this.m_btn_list[this.BTN_PLAY_INDEX].m_div.style.display = "inline", this.m_btn_list[this.BTN_CONTINUE_INDEX].setEnable(!1), this.m_btn_list[this.BTN_CONTINUE_INDEX].m_div.style.display = "none") : FZ.GameBase.SaveObject.pass ? (this.m_btn_list[this.BTN_PLAY_INDEX].setEnable(!0), this.m_btn_list[this.BTN_PLAY_INDEX].m_div.style.display = "inline", this.m_btn_list[this.BTN_CONTINUE_INDEX].setEnable(!1), this.m_btn_list[this.BTN_CONTINUE_INDEX].m_div.style.display = "none", FZ.GameBase.SaveObject.m_cur_level = 0, FZ.GameBase.SaveObject.pass = !1, FZ.GameBase.SaveObject.score = 0, FZ.GameBase.SaveObject.m_hint = FZ.GameDefs.LEVEL_HINT_NUMBER[1], FZ.GameBase.SaveObject.m_gamein = !1, FZ.GameBase.saveGame()) : (this.m_btn_list[this.BTN_PLAY_INDEX].setEnable(!0), this.m_btn_list[this.BTN_PLAY_INDEX].m_div.style.display = "inline", this.m_btn_list[this.BTN_CONTINUE_INDEX].setEnable(!0), this.m_btn_list[this.BTN_CONTINUE_INDEX].m_div.style.display = "inline"), this.m_main_div.style.display = "inline", this.resetTranslate(.5), setTimeout(function () {
  4031. f.fade_in.call(f, 2e3, 1)
  4032. }, 10)
  4033. },
  4034. postProcess: function () {
  4035. this.m_next_state !== FZ.StateDefs.GAME_STATE_GAME_CLEAR && this.fade_out(2e3, 0, 0)
  4036. },
  4037. pause: function () {
  4038. clearTimeout(this.m_timer)
  4039. },
  4040. resume: function () {
  4041. arguments.length > 0 && (statename = arguments[0]);
  4042. if (arguments.length > 1) {
  4043. if (arguments[1] === "yes") {
  4044. FZ.GameBase.SaveObject.m_cur_level = 0, FZ.GameBase.SaveObject.pass = !1, FZ.GameBase.SaveObject.score = 0, FZ.GameBase.SaveObject.m_hint = FZ.GameDefs.LEVEL_HINT_NUMBER[1], FZ.GameBase.SaveObject.m_gamein = !1, FZ.GameBase.saveGame(), FZ.GameBase.switchToState(FZ.StateDefs.GAME_STATE_GAME_IN);
  4045. return
  4046. }
  4047. this.m_next_state = FZ.StateDefs.GAME_STATE_MAINMEN
  4048. }
  4049. },
  4050. buttonClick: function (a) {
  4051. this.m_btn_list[this.BTN_PLAY_INDEX] === a ? FZ.GameBase.SaveObject.m_cur_level === 0 ? FZ.GameBase.switchToState(FZ.StateDefs.GAME_STATE_GAME_IN) : (this.m_next_state = FZ.StateDefs.GAME_STATE_GAME_CLEAR, this.pause(), FZ.GameBase.pushState(this.StateName), FZ.GameBase.switchToState(FZ.StateDefs.GAME_STATE_GAME_CLEAR)) : this.m_btn_list[this.BTN_SOUND_INDEX] === a ? (this.m_sound = !this.m_sound, FZ.Music.setMute(!this.m_sound), this.m_sound ? a.setSwitchState(a.SWITCH_ON) : a.setSwitchState(a.SWITCH_OFF), FZ.GameBase.SaveObject.m_sound = this.m_sound, FZ.GameBase.saveGame()) : this.m_btn_list[this.BTN_CONTINUE_INDEX] === a && FZ.GameBase.switchToState(FZ.StateDefs.GAME_STATE_GAME_IN)
  4052. }
  4053. }, FZ.BaseState)), FZ.Game.ResetState = new(FZ.newClass({
  4054. StateName: FZ.StateDefs.GAME_STATE_RESET,
  4055. CUR_UI_DEFS: ["NEXT_LEVEL_BG", "TXT_ARE_YOU_SURE"],
  4056. BTN_YES_INDEX: 0,
  4057. BTN_NO_INDEX: 1,
  4058. CUR_BTN_DEFS: [
  4059. ["BTN_GAME_YES", "BTN_GAME_YES_TOUCH"],
  4060. ["BTN_GAME_NO", "BTN_GAME_NO_TOUCH"]
  4061. ],
  4062. m_ui_list: null,
  4063. m_btn_list: null,
  4064. popState: !1,
  4065. m_load_ui: !1,
  4066. preProcess: function () {
  4067. var a = null,
  4068. b = null,
  4069. c = null,
  4070. d = 0,
  4071. e = this;
  4072. this.m_load_ui ? this.m_main_div.style.display = "inline" : (this.createUIs(this.CUR_UI_DEFS), this.createBtns(this.CUR_BTN_DEFS, !0), FZ.DivManager.addChild(this.m_main_div), this.m_load_ui = !0), this.popState = !1, setTimeout(function () {
  4073. e.fade_in.call(e, 2e3, 1)
  4074. }, 10)
  4075. },
  4076. postProcess: function () {
  4077. this.m_main_div.style.display = "none"
  4078. },
  4079. buttonClick: function (a) {
  4080. if (!this.popState) {
  4081. var b = null;
  4082. this.m_btn_list[this.BTN_YES_INDEX] === a ? (this.postProcess(), this.popState = !0, FZ.GameBase.popState(this.StateName, "yes")) : this.m_btn_list[this.BTN_NO_INDEX] === a && (this.postProcess(), this.popState = !0, FZ.GameBase.popState(this.StateName, "no"))
  4083. }
  4084. }
  4085. }, FZ.BaseState)),
  4086. function () {
  4087. var a = !1,
  4088. b = null;
  4089. FZ.Game.GameState = new(FZ.newClass({
  4090. StateName: FZ.StateDefs.GAME_STATE_GAME_IN,
  4091. CUR_UI_DEFS: ["majong_BG_GAME", "game_in_BG", "TIME_EMPTY", "TIME__FULL", "NUM_LEVEL_0", "ARROW_UP_DOWN", "ARROW_LEFT_RIGHT", "ARROW_DOWN", "ARROW_RIGHT", "ARROW_LEFT", "ARROW_UP", "number_score_1", "number_score_2", "number_score_3", "number_score_4", "number_score_5"],
  4092. UI_ARROW_START_INDEX: 5,
  4093. UI_ARROW_KINDS: 6,
  4094. UI_SCORE_START_INDEX: 11,
  4095. UI_TIME_BAR_INDEX: 3,
  4096. UI_LEVEL_NUM_INDEX: 4,
  4097. BTN_HOME_INDEX: 0,
  4098. BTN_HINT_INDEX: 1,
  4099. BTN_PAUSE_INDEX: 2,
  4100. BTN_START_INDEX: 3,
  4101. BTN_SOUND_INDEX: 3,
  4102. CUR_BTN_DEFS: [
  4103. ["BTN_MAIN_MENU_ICON", "BTN_MAIN_MENU_ICON_TOUCH"],
  4104. ["BTN_HINT", "BTN_HINT_TOUCH"],
  4105. ["BTN_PAUSE", "BTN_PAUSE_TOUCH"],
  4106. ["BTN_SOUND", "BTN_SOUND_TOUCH"]
  4107. ],
  4108. CUR_BTN_ANDROID_DEFS: [
  4109. ["BTN_MAIN_MENU_ICON", "BTN_MAIN_MENU_ICON_TOUCH"],
  4110. ["BTN_HINT", "BTN_HINT_TOUCH"],
  4111. ["BTN_PAUSE", "BTN_PAUSE_TOUCH"]
  4112. ],
  4113. CUR_SWITCH_DEFS: ["BTN_START", "BTN_START_TOUCH"],
  4114. SOUND_SWITCH_DEFS: ["BTN_SOUND_OFF", "BTN_SOUND_OFF_TOUCH"],
  4115. m_isNoMatch: !1,
  4116. m_label_list: null,
  4117. m_levelStart: !1,
  4118. m_diamondMgr: null,
  4119. m_load_ui: !1,
  4120. m_curLevel_div: null,
  4121. m_next_state: "",
  4122. m_slide_menu: null,
  4123. m_hint_num_div: null,
  4124. m_pause_div: null,
  4125. m_str_nomatch_div: null,
  4126. m_time_bar_div: null,
  4127. m_time_bar_w: 0,
  4128. m_call_tStart: null,
  4129. m_call_mClick: null,
  4130. m_call_time: null,
  4131. m_level_usedTime: 0,
  4132. levelStartTime: 0,
  4133. levelCurrentTime: 0,
  4134. levelPauseStartTime: 0,
  4135. levelPauseEndTime: 0,
  4136. levelPauseTime: 0,
  4137. curLevelUsedTime: 0,
  4138. m_gamePause: !1,
  4139. pageHiddin: !1,
  4140. STR_SCORE_RECT: [120, 28, 50, 20],
  4141. STR_TIME_RECT: [120, 48, 50, 20],
  4142. createStrDiv: function (a) {
  4143. var b = document.createElement("div");
  4144. b.style.position = "absolute", b.style.width = a[2] + "px", b.style.height = a[3] + "px", b.style.left = a[0] + "px", b.style.top = a[1] + "px", b.style.color = "#fff", b.style.fontSize = FZ.GameDefs.STATS_FONT_SIZE + "px", b.style.fontFamily = "Arial", b.style.lineHeight = a[3] + "px", b.style.textAlign = "left", this.m_main_div.appendChild(b);
  4145. return b
  4146. },
  4147. pause: function () {
  4148. clearTimeout(this.m_timer)
  4149. },
  4150. resume: function () {
  4151. var a = null;
  4152. arguments.length > 0 && (a = arguments[0]);
  4153. if (null !== this.m_diamondMgr) {
  4154. this.m_time_bar_div.style.display = "inline";
  4155. if (FZ.StateDefs.GAME_STATE_OVER == a) {
  4156. this.m_time_bar_div.style.width = this.m_time_bar_w + "px", this.m_btn_list[this.BTN_HINT_INDEX].setEnable(!0), this.m_diamondMgr.initAllPets(!0), this.m_diamondMgr.showPets(), this.levelStartTime = (new Date).getTime(), this.levelCurrentTime = this.levelStartTime, this.levelPauseStartTime = this.levelStartTime, this.levelPauseEndTime = this.levelStartTime, this.levelPauseTime = 0, this.curLevelUsedTime = 0, this.m_btn_list[this.BTN_HINT_INDEX].m_div.style.backgroundImage = "url(res/images/" + this.m_btn_list[this.BTN_HINT_INDEX].m_img_list[0] + ")", this.m_game_bg_div = this.m_ui_list[1], this.m_diamondMgr.setHintCount(FZ.GameBase.SaveObject.m_hint), this.m_diamondMgr.setLevel(FZ.GameBase.SaveObject.m_cur_level);
  4157. var b = this.m_diamondMgr.getHintCount();
  4158. this.m_hint_num_div[0].style.visibility = "visible", this.m_hint_num_div[1].style.visibility = "visible";
  4159. if (b >= 10) {
  4160. var c = Math.floor(b % 10);
  4161. this.m_hint_num_div[0].style.backgroundImage = "url(res/images/NUM_LEVEL_" + c + ".png )", c = Math.floor(b / 10), this.m_hint_num_div[1].style.backgroundImage = "url(res/images/NUM_LEVEL_" + c + ".png )"
  4162. } else b === 0 ? (this.m_hint_num_div[0].style.visibility = "hidden", this.m_hint_num_div[1].style.visibility = "hidden") : (this.m_hint_num_div[1].style.visibility = "hidden", this.m_hint_num_div[0].style.backgroundImage = "url(res/images/NUM_LEVEL_" + b + ".png )");
  4163. var d = this.m_diamondMgr.getLevel(),
  4164. e = null;
  4165. e = FZ.getImgInfo("NUM_LEVEL_" + d), this.m_curLevel_div.style.backgroundImage = "url(res/images/" + e.fileURL + ")", this.m_diamondMgr.setParent(this.m_main_div)
  4166. } else if (FZ.StateDefs.GAME_STATE_NEXT_LEVEL == a) {
  4167. this.m_btn_list[this.BTN_HINT_INDEX].m_div.style.backgroundImage = "url(res/images/" + this.m_btn_list[this.BTN_HINT_INDEX].m_img_list[0] + ")", this.m_time_bar_div.style.width = this.m_time_bar_w + "px", this.m_btn_list[this.BTN_HINT_INDEX].setEnable(!0), this.m_diamondMgr.initAllPets(!0), this.m_diamondMgr.hidePets(), this.levelStartTime = (new Date).getTime(), this.levelCurrentTime = this.levelStartTime, this.levelPauseStartTime = this.levelStartTime, this.levelPauseEndTime = this.levelStartTime, this.levelPauseTime = 0, this.curLevelUsedTime = 0, this.m_hint_num_div[0].style.visibility = "visible", this.m_hint_num_div[1].style.visibility = "visible";
  4168. var b = FZ.GameBase.SaveObject.m_hint;
  4169. if (b >= 10) {
  4170. var c = Math.floor(b % 10);
  4171. this.m_hint_num_div[0].style.backgroundImage = "url(res/images/NUM_LEVEL_" + c + ".png )", c = Math.floor(b / 10), this.m_hint_num_div[1].style.backgroundImage = "url(res/images/NUM_LEVEL_" + c + ".png )"
  4172. } else b === 0 ? (this.m_hint_num_div[0].style.visibility = "hidden", this.m_hint_num_div[1].style.visibility = "hidden") : (this.m_hint_num_div[1].style.visibility = "hidden", this.m_hint_num_div[0].style.backgroundImage = "url(res/images/NUM_LEVEL_" + b + ".png )");
  4173. this.m_diamondMgr.setLevel(FZ.GameBase.SaveObject.m_cur_level), this.m_diamondMgr.setHintCount(FZ.GameBase.SaveObject.m_hint);
  4174. var d = this.m_diamondMgr.getLevel();
  4175. switch (d) {
  4176. case 1:
  4177. case 2:
  4178. case 4:
  4179. this.m_levelStart = !0, this.m_diamondMgr.showPets();
  4180. for (var f = 0; f < this.UI_ARROW_KINDS; f++) this.m_ui_list[this.UI_ARROW_START_INDEX + f].style.display = "none";
  4181. this.m_diamondMgr.setParent(this.m_main_div);
  4182. break;
  4183. case 3:
  4184. this.m_levelStart = !1, this.m_diamondMgr.hidePets(), this.m_ui_list[this.UI_ARROW_START_INDEX].style.display = "inline";
  4185. break;
  4186. case 5:
  4187. this.m_levelStart = !1, this.m_diamondMgr.hidePets(), this.m_ui_list[this.UI_ARROW_START_INDEX + 1].style.display = "inline";
  4188. break;
  4189. case 6:
  4190. this.m_levelStart = !1, this.m_diamondMgr.hidePets(), this.m_ui_list[this.UI_ARROW_START_INDEX + 2].style.display = "inline";
  4191. break;
  4192. case 7:
  4193. this.m_levelStart = !1, this.m_diamondMgr.hidePets(), this.m_ui_list[this.UI_ARROW_START_INDEX + 3].style.display = "inline";
  4194. break;
  4195. case 8:
  4196. this.m_levelStart = !1, this.m_diamondMgr.hidePets(), this.m_ui_list[this.UI_ARROW_START_INDEX + 4].style.display = "inline";
  4197. break;
  4198. case 9:
  4199. this.m_levelStart = !1, this.m_diamondMgr.hidePets(), this.m_ui_list[this.UI_ARROW_START_INDEX + 5].style.display = "inline";
  4200. break;
  4201. default:
  4202. }
  4203. var e = null;
  4204. e = FZ.getImgInfo("NUM_LEVEL_" + d), this.m_curLevel_div.style.backgroundImage = "url(res/images/" + e.fileURL + ")", this.m_curLevel_div.style.display = "inline"
  4205. } else if (FZ.StateDefs.GAME_STATE_RESET == a && arguments.length > 1) {
  4206. if (arguments[1] === "yes") {
  4207. this.m_next_state = FZ.StateDefs.GAME_STATE_MAINMEN, this.m_diamondMgr.saveLevel(), setTimeout(function () {
  4208. FZ.GameBase.switchToState(FZ.StateDefs.GAME_STATE_MAINMEN)
  4209. }, 100);
  4210. return
  4211. }
  4212. this.levelPauseEndTime = (new Date).getTime(), this.levelPauseTime += this.levelPauseEndTime - this.levelPauseStartTime, this.m_diamondMgr.setParent(this.m_main_div)
  4213. }
  4214. }
  4215. this.m_status = FZ.stateStatus.NORMAL, this.m_timer = setTimeout(FZ.Tools.bind(this, this.checkOver), 0)
  4216. },
  4217. setText: function (a, b) {
  4218. a.innerHTML = "" + b
  4219. },
  4220. preProcess: function (b) {
  4221. j = this;
  4222. var c = 0,
  4223. d = null,
  4224. e = null,
  4225. f = null,
  4226. g = null,
  4227. h = null,
  4228. i = FZ.GameBase.SaveObject.m_cur_level,
  4229. j = this;
  4230. if (i === undefined || 0 === i) FZ.GameBase.SaveObject.m_cur_level = 1, FZ.GameBase.saveGame();
  4231. if (!this.m_load_ui) {
  4232. this.m_pause_div = document.createElement("div"), this.m_pause_div.style.zIndex = 200, f = FZ.getImgInfo("PAUSE_BG"), FZ.GameBase.setCss(this.m_pause_div, f), this.m_main_div.appendChild(this.m_pause_div), this.m_pause_div.style.display = "none", this.m_str_nomatch_div = document.createElement("div"), this.m_str_nomatch_div.style.zIndex = 202, f = FZ.getImgInfo("NO_MORE_MATCHS"), FZ.GameBase.setCss(this.m_str_nomatch_div, f), this.m_main_div.appendChild(this.m_str_nomatch_div), this.m_str_nomatch_div.style.display = "none";
  4233. var k = FZ.GameBase.SaveObject.m_hint;
  4234. this.m_hint_num_div = [];
  4235. var l = FZ.AG.SearchSpecialPath.setNumDiv(this.m_hint_num_div, k);
  4236. while (l > 0) this.m_main_div.appendChild(this.m_hint_num_div[l - 1]), l--;
  4237. this.createUIs(this.CUR_UI_DEFS);
  4238. for (var c = 0; c < this.UI_ARROW_KINDS; c++) this.m_ui_list[this.UI_ARROW_START_INDEX + c].style.display = "none";
  4239. FZ.TargetMobile !== FZ.TARGET_DEF.ANDRIOD ? this.createBtns(this.CUR_BTN_DEFS, !0) : this.createBtns(this.CUR_BTN_ANDROID_DEFS, !0), f = FZ.getImgInfo(this.CUR_SWITCH_DEFS[0]), g = FZ.getImgInfo(this.CUR_SWITCH_DEFS[1]), this.m_btn_list[this.BTN_PAUSE_INDEX].setSwitchButton(f.fileURL, g.fileURL), FZ.TargetMobile !== FZ.TARGET_DEF.ANDRIOD && (f = FZ.getImgInfo(this.SOUND_SWITCH_DEFS[0]), g = FZ.getImgInfo(this.SOUND_SWITCH_DEFS[1]), this.m_btn_list[this.BTN_SOUND_INDEX].setSwitchButton(f.fileURL, g.fileURL)), this.m_diamondMgr = new FZ.DiamondManager, this.m_diamondMgr.m_parent = this.m_main_div, this.m_diamondMgr.setBubble(!1), FZ.DivManager.addChild(this.m_main_div), this.m_load_ui = !0
  4240. //FZ.TargetMobile == null ? this.createBtns(this.CUR_BTN_DEFS, !0) : this.createBtns(this.CUR_BTN_ANDROID_DEFS, !0), f = FZ.getImgInfo(this.CUR_SWITCH_DEFS[0]), g = FZ.getImgInfo(this.CUR_SWITCH_DEFS[1]), this.m_btn_list[this.BTN_PAUSE_INDEX].setSwitchButton(f.fileURL, g.fileURL), FZ.TargetMobile == null && (f = FZ.getImgInfo(this.SOUND_SWITCH_DEFS[0]), g = FZ.getImgInfo(this.SOUND_SWITCH_DEFS[1]), this.m_btn_list[this.BTN_SOUND_INDEX].setSwitchButton(f.fileURL, g.fileURL)), this.m_diamondMgr = new FZ.DiamondManager, this.m_diamondMgr.m_parent = this.m_main_div, this.m_diamondMgr.setBubble(!1), FZ.DivManager.addChild(this.m_main_div), this.m_load_ui = !0
  4241. } else this.m_diamondMgr.setBubble(!1), this.m_main_div.style.display = "inline";
  4242. this.m_curLevel_div = this.m_ui_list[this.UI_LEVEL_NUM_INDEX], this.m_time_bar_div = this.m_ui_list[this.UI_TIME_BAR_INDEX], f = FZ.getImgInfo(this.CUR_UI_DEFS[this.UI_TIME_BAR_INDEX]), this.m_time_bar_w = f.w, this.m_time_bar_div.style.width = this.m_time_bar_w + "px", this.m_diamondMgr.setObserver(this);
  4243. if (FZ.StateDefs.GAME_STATE_MAINMEN === b || FZ.StateDefs.GAME_STATE_OVER === b || FZ.StateDefs.GAME_STATE_HELP === b) {
  4244. if (FZ.GameBase.SaveObject.m_gamein === !0) {
  4245. this.m_diamondMgr.resumeLevel();
  4246. var m = FZ.GameBase.SaveObject.m_cur_hintCount
  4247. } else {
  4248. this.m_diamondMgr.initAllPets(!0);
  4249. var m = FZ.GameBase.SaveObject.m_hint
  4250. }
  4251. this.m_diamondMgr.setHintCount(m), this.m_btn_list[this.BTN_HINT_INDEX].setEnable(!0), this.m_btn_list[this.BTN_HINT_INDEX].m_div.style.backgroundImage = "url(res/images/BTN_HINT.png )", this.m_hint_num_div[0].style.visibility = "visible", this.m_hint_num_div[1].style.visibility = "visible";
  4252. if (m >= 10) {
  4253. var n = Math.floor(m % 10);
  4254. this.m_hint_num_div[0].style.backgroundImage = "url(res/images/NUM_LEVEL_" + n + ".png )", n = Math.floor(m / 10), this.m_hint_num_div[1].style.backgroundImage = "url(res/images/NUM_LEVEL_" + n + ".png )"
  4255. } else m === 0 ? (this.m_btn_list[this.BTN_HINT_INDEX].m_div.style.backgroundImage = "url(res/images/BTN_HINT_GREY.png )", this.m_btn_list[this.BTN_HINT_INDEX].setEnable(!1), this.m_hint_num_div[0].style.visibility = "hidden", this.m_hint_num_div[1].style.visibility = "hidden") : (this.m_hint_num_div[1].style.visibility = "hidden", this.m_hint_num_div[0].style.backgroundImage = "url(res/images/NUM_LEVEL_" + m + ".png )");
  4256. this.m_diamondMgr.hidePets()
  4257. }
  4258. f = FZ.getImgInfo("NUM_LEVEL_" + FZ.GameBase.SaveObject.m_cur_level), this.m_curLevel_div.style.backgroundImage = "url(res/images/" + f.fileURL + ")";
  4259. if (FZ.GameBase.SaveObject.m_gamein === !0) {
  4260. this.m_levelStart = !0, this.curLevelUsedTime = FZ.GameBase.SaveObject.m_level_usedTime, this.m_diamondMgr.showPets();
  4261. for (var c = 0; c < this.UI_ARROW_KINDS; c++) this.m_ui_list[this.UI_ARROW_START_INDEX + c].style.display = "none";
  4262. this.m_diamondMgr.setParent(this.m_main_div)
  4263. } else {
  4264. this.curLevelUsedTime = 0, this.m_diamondMgr.setLevel(FZ.GameBase.SaveObject.m_cur_level), i = this.m_diamondMgr.getLevel();
  4265. switch (i) {
  4266. case 1:
  4267. case 2:
  4268. case 4:
  4269. this.m_levelStart = !0, this.m_diamondMgr.showPets();
  4270. for (var c = 0; c < this.UI_ARROW_KINDS; c++) this.m_ui_list[this.UI_ARROW_START_INDEX + c].style.display = "none";
  4271. this.m_diamondMgr.setParent(this.m_main_div);
  4272. break;
  4273. case 3:
  4274. this.m_levelStart = !1, this.m_diamondMgr.hidePets(), this.m_ui_list[this.UI_ARROW_START_INDEX].style.display = "inline";
  4275. break;
  4276. case 5:
  4277. this.m_levelStart = !1, this.m_diamondMgr.hidePets(), this.m_ui_list[this.UI_ARROW_START_INDEX + 1].style.display = "inline";
  4278. break;
  4279. case 6:
  4280. this.m_levelStart = !1, this.m_diamondMgr.hidePets(), this.m_ui_list[this.UI_ARROW_START_INDEX + 2].style.display = "inline";
  4281. break;
  4282. case 7:
  4283. this.m_levelStart = !1, this.m_diamondMgr.hidePets(), this.m_ui_list[this.UI_ARROW_START_INDEX + 3].style.display = "inline";
  4284. break;
  4285. case 8:
  4286. this.m_levelStart = !1, this.m_diamondMgr.hidePets(), this.m_ui_list[this.UI_ARROW_START_INDEX + 4].style.display = "inline";
  4287. break;
  4288. case 9:
  4289. this.m_levelStart = !1, this.m_diamondMgr.hidePets(), this.m_ui_list[this.UI_ARROW_START_INDEX + 5].style.display = "inline";
  4290. break;
  4291. default:
  4292. }
  4293. }
  4294. this.levelStartTime = (new Date).getTime(), this.levelCurrentTime = this.levelStartTime, this.levelPauseStartTime = this.levelStartTime, this.levelPauseEndTime = this.levelStartTime, this.levelPauseTime = 0, this.resetTranslate(0), FZ.TargetMobile !== FZ.TARGET_DEF.ANDRIOD && (this.m_sound = FZ.GameBase.SaveObject.m_sound, this.m_sound === !0 ? this.m_btn_list[this.BTN_SOUND_INDEX].setSwitchState(this.m_btn_list[this.BTN_SOUND_INDEX].SWITCH_ON) : this.m_btn_list[this.BTN_SOUND_INDEX].setSwitchState(this.m_btn_list[this.BTN_SOUND_INDEX].SWITCH_OFF)), this.m_btn_list[this.BTN_HOME_INDEX].m_div.style.display = "none", this.m_diamondMgr.setBonusTime(0), a && document.addEventListener("keyup", FZ.Tools.bindWithEvent(this, this.debugLevel), !1), setTimeout(function () {
  4295. //this.levelStartTime = (new Date).getTime(), this.levelCurrentTime = this.levelStartTime, this.levelPauseStartTime = this.levelStartTime, this.levelPauseEndTime = this.levelStartTime, this.levelPauseTime = 0, this.resetTranslate(0), FZ.TargetMobile == null && (this.m_sound = FZ.GameBase.SaveObject.m_sound, this.m_sound === !0 ? this.m_btn_list[this.BTN_SOUND_INDEX].setSwitchState(this.m_btn_list[this.BTN_SOUND_INDEX].SWITCH_ON) : this.m_btn_list[this.BTN_SOUND_INDEX].setSwitchState(this.m_btn_list[this.BTN_SOUND_INDEX].SWITCH_OFF)), this.m_btn_list[this.BTN_HOME_INDEX].m_div.style.display = "none", this.m_diamondMgr.setBonusTime(0), a && document.addEventListener("keyup", FZ.Tools.bindWithEvent(this, this.debugLevel), !1), setTimeout(function () {
  4296. j.fade_in.call(j, 2e3, 1)
  4297. }, 10), this.m_timer = setTimeout(FZ.Tools.bind(this, this.checkOver), 0), this.m_call_time = FZ.Tools.bind(this, this.checkOver)
  4298. },
  4299. postProcess: function () {
  4300. this.m_diamondMgr.removeEvent(), this.m_next_state === FZ.StateDefs.GAME_STATE_OVER || this.m_next_state === FZ.StateDefs.GAME_STATE_RESET || this.m_next_state === FZ.StateDefs.GAME_STATE_NEXT_LEVEL || this.m_next_state === FZ.StateDefs.GAME_STATE_GAME_WIN ? this.m_main_div.style.display = "inline" : (this.m_main_div.style.display = "none", this.fade_out(2e3, 0, 0))
  4301. },
  4302. mouseHandler: function (a) {
  4303. null, FZ.EventRemove(this, this.m_main_div, FZ.EVENT_DEF.T_START, this.m_call_tStart), FZ.EventRemove(this, this.m_main_div, FZ.EVENT_DEF.M_CLICK, this.m_call_mClick), this.m_levelStart = !0, this.m_diamondMgr.showPets();
  4304. for (var b = 0; b < this.UI_ARROW_KINDS; b++) this.m_ui_list[this.UI_ARROW_START_INDEX + b].style.display = "none";
  4305. this.levelStartTime = (new Date).getTime(), this.levelCurrentTime = this.levelStartTime, this.levelPauseStartTime = this.levelStartTime, this.levelPauseEndTime = this.levelStartTime, this.levelPauseTime = 0, this.m_levelLeftTime = 0, this.m_diamondMgr.setParent(this.m_main_div)
  4306. },
  4307. checkOver: function () {
  4308. var a = this;
  4309. if (undefined !== FZ.GameBase.CurrentState) {
  4310. if (FZ.StateDefs.GAME_STATE_GAME_IN !== FZ.GameBase.CurrentState.StateName) {
  4311. clearTimeout(this.m_timer);
  4312. return
  4313. }
  4314. var b = 0,
  4315. c = this.m_diamondMgr.getLevel();
  4316. if (!this.m_levelStart) {
  4317. var d = Math.floor((new Date).getTime() - this.levelCurrentTime) / 1e3,
  4318. e = !1,
  4319. f = FZ.AG.SearchSpecialPath.setScoreNum(FZ.GameBase.SaveObject.score + this.m_diamondMgr.getScore());
  4320. for (var b = 0; b < f.length; b++) this.m_ui_list[this.UI_SCORE_START_INDEX + 5 - f.length + b].style.backgroundImage = "url(res/images/NUM_LEVEL_" + f[f.length - 1 - b] + ".png)";
  4321. if (f.length < 5)
  4322. for (var b = 0; b < 5 - f.length; b++) this.m_ui_list[this.UI_SCORE_START_INDEX + b].style.backgroundImage = "url(res/images/NUM_LEVEL_0.png)";
  4323. switch (c) {
  4324. case 3:
  4325. this.m_levelStart = !1, this.m_diamondMgr.hidePets(), this.m_ui_list[this.UI_ARROW_START_INDEX].style.display = "inline";
  4326. break;
  4327. case 5:
  4328. this.m_levelStart = !1, this.m_diamondMgr.hidePets(), this.m_ui_list[this.UI_ARROW_START_INDEX + 1].style.display = "inline";
  4329. break;
  4330. case 6:
  4331. this.m_levelStart = !1, this.m_diamondMgr.hidePets(), this.m_ui_list[this.UI_ARROW_START_INDEX + 2].style.display = "inline";
  4332. break;
  4333. case 7:
  4334. this.m_levelStart = !1, this.m_diamondMgr.hidePets(), this.m_ui_list[this.UI_ARROW_START_INDEX + 3].style.display = "inline";
  4335. break;
  4336. case 8:
  4337. this.m_levelStart = !1, this.m_diamondMgr.hidePets(), this.m_ui_list[this.UI_ARROW_START_INDEX + 4].style.display = "inline";
  4338. break;
  4339. case 9:
  4340. this.m_levelStart = !1, this.m_diamondMgr.hidePets(), this.m_ui_list[this.UI_ARROW_START_INDEX + 5].style.display = "inline";
  4341. break;
  4342. default:
  4343. }
  4344. FZ.TARGET_DEF.MOBILE === FZ.TargetPort ? null === this.m_call_tStart && FZ.EventHandler(this, this.m_main_div, FZ.EVENT_DEF.T_START, this.mouseHandler) : null === this.m_call_mClick && FZ.EventHandler(this, this.m_main_div, FZ.EVENT_DEF.M_CLICK, this.mouseHandler);
  4345. if (d > 3) {
  4346. this.m_levelStart = !0, this.m_diamondMgr.showPets();
  4347. for (var b = 0; b < this.UI_ARROW_KINDS; b++) this.m_ui_list[this.UI_ARROW_START_INDEX + b].style.display = "none";
  4348. this.levelStartTime = (new Date).getTime(), this.levelCurrentTime = this.levelStartTime, this.levelPauseStartTime = this.levelStartTime, this.levelPauseEndTime = this.levelStartTime, this.levelPauseTime = 0, this.m_levelLeftTime = 0, this.m_diamondMgr.setParent(this.m_main_div)
  4349. }
  4350. this.m_timer = setTimeout(a.m_call_time, 200), this.m_diamondMgr.setBubble(!0);
  4351. return
  4352. }
  4353. if (this.m_isNoMatch === !0) {
  4354. this.m_str_nomatch_div.style.display = "inline", (new Date).getTime() - this.levelCurrentTime > 2e3 && (this.m_diamondMgr.ResetPosition(), this.m_diamondMgr.searchHasMatch() || this.m_diamondMgr.ResetTwoPosition(), this.m_isNoMatch = !1, this.levelPauseTime += 2200, this.m_str_nomatch_div.style.display = "none"), this.m_timer = setTimeout(a.m_call_time, 200);
  4355. return
  4356. }
  4357. if (this.m_gamePause || this.pageHiddin) {
  4358. this.m_timer = setTimeout(FZ.Tools.bind(this, this.checkOver), 100);
  4359. return
  4360. }
  4361. c = FZ.GameBase.SaveObject.m_cur_level;
  4362. var d = Math.floor(((new Date).getTime() - this.levelPauseTime - this.levelStartTime) / 1e3 + this.curLevelUsedTime),
  4363. g = this.m_time_bar_w / FZ.GameDefs.LEVEL_TIME[FZ.GameBase.SaveObject.m_cur_level];
  4364. d -= this.m_diamondMgr.getBonusTime(), d >= FZ.GameDefs.LEVEL_TIME[FZ.GameBase.SaveObject.m_cur_level] ? d = FZ.GameDefs.LEVEL_TIME[FZ.GameBase.SaveObject.m_cur_level] : d < 0 && (d = 0);
  4365. var h = (FZ.GameDefs.LEVEL_TIME[c] - d) * g;
  4366. this.m_time_bar_div.style.width = h + "px", !(FZ.GameDefs.LEVEL_TIME[c] - d > 0);
  4367. var f = FZ.AG.SearchSpecialPath.setScoreNum(FZ.GameBase.SaveObject.score + this.m_diamondMgr.getScore());
  4368. for (var b = f.length - 1; b >= 0; b--) this.m_ui_list[this.UI_SCORE_START_INDEX + 5 - f.length + b].style.backgroundImage = "url(res/images/NUM_LEVEL_" + f[f.length - 1 - b] + ".png)";
  4369. if (f.length < 5)
  4370. for (var b = 0; b < 5 - f.length; b++) this.m_ui_list[this.UI_SCORE_START_INDEX + b].style.backgroundImage = "url(res/images/NUM_LEVEL_0.png)";
  4371. this.m_level_usedTime = d;
  4372. if (FZ.GameDefs.LEVEL_TIME[c] <= d) {
  4373. this.m_timer = setTimeout(FZ.Tools.bind(this, this.setGameOver), 0), this.m_diamondMgr.setBubble(!0);
  4374. return
  4375. }
  4376. this.m_timer = setTimeout(a.m_call_time, 1500), this.m_diamondMgr.saveLevel()
  4377. }
  4378. },
  4379. checkWin: function () {
  4380. var a = this.m_diamondMgr.getLevel(),
  4381. b = ((new Date).getTime() - this.levelPauseTime - this.levelStartTime) / 1e3 + this.curLevelUsedTime;
  4382. if (this.m_diamondMgr.getLeftPet() === 0) {
  4383. var c = FZ.GameBase.SaveObject.score,
  4384. d = this.m_diamondMgr.getScore() + (FZ.GameDefs.LEVEL_TIME[a] - this.m_level_usedTime) * 30,
  4385. e = FZ.AG.SearchSpecialPath.setScoreNum(FZ.GameBase.SaveObject.score + d);
  4386. for (var f = e.length - 1; f >= 0; f--) this.m_ui_list[this.UI_SCORE_START_INDEX + 5 - e.length + f].style.backgroundImage = "url(res/images/NUM_LEVEL_" + e[e.length - 1 - f] + ".png)";
  4387. if (e.length < 5)
  4388. for (var f = 0; f < 5 - e.length; f++) this.m_ui_list[this.UI_SCORE_START_INDEX + f].style.backgroundImage = "url(res/images/NUM_LEVEL_0.png)";
  4389. if (a === FZ.GameDefs.MAX_LEVEL_RANK) {
  4390. clearTimeout(this.m_timer), this.m_diamondMgr.setBubble(!1), this.m_next_state = FZ.StateDefs.GAME_STATE_GAME_WIN, this.pause(), FZ.GameBase.switchToState(FZ.StateDefs.GAME_STATE_GAME_WIN, d + c, d), FZ.GameBase.SaveObject.pass = !0, FZ.GameBase.SaveObject.score += d, FZ.GameBase.SaveObject.m_hint = this.m_diamondMgr.getHintCount() + FZ.GameDefs.LEVEL_HINT_NUMBER[a], FZ.GameBase.saveGame();
  4391. return
  4392. }
  4393. clearTimeout(this.m_timer), this.m_diamondMgr.setBubble(!1), this.m_next_state = FZ.StateDefs.GAME_STATE_NEXT_LEVEL, this.pause(), FZ.GameBase.pushState(this.StateName), FZ.GameBase.switchToState(FZ.StateDefs.GAME_STATE_NEXT_LEVEL, d + c, d), FZ.GameBase.SaveObject.score += d, FZ.GameBase.SaveObject.m_cur_level = a + 1, FZ.GameBase.SaveObject.m_hint = this.m_diamondMgr.getHintCount() + FZ.GameDefs.LEVEL_HINT_NUMBER[a + 1], FZ.GameBase.saveGame()
  4394. play68_submitScore(FZ.GameBase.SaveObject.score);Play68.setRankingScoreDesc(FZ.GameBase.SaveObject.score);
  4395. }
  4396. },
  4397. checkNoMatch: function () {
  4398. this.m_diamondMgr.searchHasMatch() || (this.m_isNoMatch = !0), this.m_isNoMatch && (this.levelCurrentTime = (new Date).getTime())
  4399. },
  4400. setGameOver: function () {
  4401. this.m_diamondMgr.setBubble(!1), clearTimeout(this.m_timer), this.m_next_state = FZ.StateDefs.GAME_STATE_OVER, this.pause();
  4402. var a = this.m_diamondMgr.getScore(),
  4403. b = FZ.GameBase.SaveObject.score;
  4404. FZ.GameBase.pushState(this.StateName), FZ.GameBase.switchToState(FZ.StateDefs.GAME_STATE_OVER, a + b), FZ.GameBase.SaveObject.score = 0, FZ.GameBase.SaveObject.m_cur_level = 1, FZ.GameBase.SaveObject.m_hint = FZ.GameDefs.LEVEL_HINT_NUMBER[1], FZ.GameBase.SaveObject.m_gamein = !1, FZ.GameBase.SaveObject.m_cur_score = 0, FZ.GameBase.SaveObject.m_cur_hintCount = FZ.GameDefs.LEVEL_HINT_NUMBER[1], FZ.GameBase.SaveObject.m_cur_left_pet = FZ.GameDefs.ALL_PET_NUM, FZ.GameBase.SaveObject.m_level_usedTime = 0, FZ.GameBase.saveGame()
  4405. play68_submitScore(FZ.GameBase.SaveObject.score);
  4406. },
  4407. setNextLevel: function (a, b) {
  4408. clearTimeout(this.m_timer), this.m_diamondMgr.setBubble(!1), this.m_next_state = FZ.StateDefs.GAME_STATE_NEXT_LEVEL, this.pause(), FZ.GameBase.pushState(this.StateName), FZ.GameBase.switchToState(FZ.StateDefs.GAME_STATE_NEXT_LEVEL, a, b)
  4409. },
  4410. setGameWin: function (a, b) {
  4411. clearTimeout(this.m_timer), this.m_diamondMgr.setBubble(!1), this.m_next_state = FZ.StateDefs.GAME_STATE_GAME_WIN, this.pause(), FZ.GameBase.pushState(this.StateName), FZ.GameBase.switchToState(FZ.StateDefs.GAME_STATE_GAME_WIN, a, b)
  4412. },
  4413. buttonClick: function (a) {
  4414. if (undefined !== FZ.GameBase.CurrentState) {
  4415. if (FZ.StateDefs.GAME_STATE_GAME_IN !== FZ.GameBase.CurrentState.StateName) return;
  4416. if (this.m_isNoMatch === !0) return;
  4417. if (this.m_btn_list[this.BTN_HOME_INDEX] === a) {
  4418. this.m_gamePause = !this.m_gamePause, this.m_btn_list[this.BTN_HOME_INDEX].m_div.style.display = "none", this.m_btn_list[this.BTN_HINT_INDEX].m_div.style.display = "inline";
  4419. var b = this.m_diamondMgr.getHintCount();
  4420. b > 10 ? (this.m_hint_num_div[0].style.visibility = "visible", this.m_hint_num_div[1].style.visibility = "visible") : b === 0 ? (this.m_hint_num_div[0].style.visibility = "hidden", this.m_hint_num_div[1].style.visibility = "hidden") : (this.m_hint_num_div[0].style.visibility = "visible", this.m_hint_num_div[1].style.visibility = "hidden"), FZ.TargetMobile !== FZ.TARGET_DEF.ANDRIOD && (this.m_btn_list[this.BTN_SOUND_INDEX].m_div.style.display = "inline"), this.m_pause_div.style.display = "none", this.m_diamondMgr.m_reset_finished = !0, FZ.TargetMobile !== FZ.TARGET_DEF.ANDRIOD && (FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_SOUND_INDEX].SWITCH_OFF === FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_SOUND_INDEX].m_btn_state && (FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_SOUND_INDEX].m_div.style.backgroundImage = "url(res/images/BTN_SOUND_OFF.png)"), FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_SOUND_INDEX].SWITCH_ON === FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_SOUND_INDEX].m_btn_state && (FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_SOUND_INDEX].m_div.style.backgroundImage = "url(res/images/BTN_SOUND.png)")), this.m_btn_list[this.BTN_PAUSE_INDEX].setSwitchState(this.m_btn_list[this.BTN_PAUSE_INDEX].SWITCH_ON), this.levelPauseEndTime = (new Date).getTime(), this.levelPauseTime += this.levelPauseEndTime - this.levelPauseStartTime, this.m_next_state = FZ.StateDefs.GAME_STATE_RESET, this.m_diamondMgr.setBubble(!1), this.levelPauseStartTime = (new Date).getTime(), this.pause(), FZ.GameBase.pushState(this.StateName), FZ.GameBase.switchToState(FZ.StateDefs.GAME_STATE_RESET)
  4421. } else if (this.m_btn_list[this.BTN_HINT_INDEX] === a) {
  4422. this.m_diamondMgr.setBubble(!1);
  4423. if (this.m_gamePause) return;
  4424. if (this.m_diamondMgr.getHintCount() > 0 && !1 !== this.m_diamondMgr.searchHint()) {
  4425. var c = this.m_diamondMgr.getHintCount();
  4426. this.m_hint_num_div[0].style.visibility = "visible", this.m_hint_num_div[1].style.visibility = "visible";
  4427. if (c >= 10) {
  4428. var d = Math.floor(c % 10);
  4429. this.m_hint_num_div[0].style.backgroundImage = "url(res/images/NUM_LEVEL_" + d + ".png )";
  4430. var d = Math.floor(c / 10);
  4431. this.m_hint_num_div[1].style.backgroundImage = "url(res/images/NUM_LEVEL_" + d + ".png )"
  4432. } else this.m_hint_num_div[1].style.visibility = "hidden", this.m_hint_num_div[0].style.backgroundImage = "url(res/images/NUM_LEVEL_" + c + ".png )"
  4433. }
  4434. this.m_diamondMgr.getHintCount() === 0 && (a.setEnable(!1), a.m_div.style.backgroundImage = "url(res/images/BTN_HINT_GREY.png )", this.m_hint_num_div[0].style.visibility = "hidden", this.m_hint_num_div[1].style.visibility = "hidden")
  4435. } else if (this.m_btn_list[this.BTN_PAUSE_INDEX] === a) {
  4436. this.m_gamePause = !this.m_gamePause;
  4437. if (this.m_gamePause === !0) this.m_btn_list[this.BTN_HOME_INDEX].m_div.style.display = "inline", this.m_btn_list[this.BTN_HINT_INDEX].m_div.style.display = "none", this.m_hint_num_div[0].style.visibility = "hidden", this.m_hint_num_div[1].style.visibility = "hidden", FZ.TargetMobile !== FZ.TARGET_DEF.ANDRIOD && (this.m_btn_list[this.BTN_SOUND_INDEX].m_div.style.display = "none"), this.levelPauseStartTime = (new Date).getTime(), this.m_pause_div.style.display = "inline", a.setSwitchState(a.SWITCH_OFF), this.m_diamondMgr.m_reset_finished = !1, this.m_diamondMgr.setBubble(!1);
  4438. else {
  4439. this.m_btn_list[this.BTN_HOME_INDEX].m_div.style.display = "none", this.m_btn_list[this.BTN_HINT_INDEX].m_div.style.display = "inline";
  4440. var b = this.m_diamondMgr.getHintCount();
  4441. b > 10 ? (this.m_hint_num_div[0].style.visibility = "visible", this.m_hint_num_div[1].style.visibility = "visible") : b === 0 ? (this.m_hint_num_div[0].style.visibility = "hidden", this.m_hint_num_div[1].style.visibility = "hidden") : (this.m_hint_num_div[0].style.visibility = "visible", this.m_hint_num_div[1].style.visibility = "hidden"), FZ.TargetMobile !== FZ.TARGET_DEF.ANDRIOD && (this.m_btn_list[this.BTN_SOUND_INDEX].m_div.style.display = "inline"), this.m_pause_div.style.display = "none", this.m_diamondMgr.m_reset_finished = !0, this.m_diamondMgr.getHintCount() !== 0 && (FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_HINT_INDEX].m_div.style.backgroundImage = "url(res/images/BTN_HINT.png)"), FZ.Game.GameState.BTN_SOUND_INDEX !== undefined && (FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_SOUND_INDEX].SWITCH_OFF === FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_SOUND_INDEX].m_btn_state && (FZ.Game.GameState
  4442. .m_btn_list[FZ.Game.GameState.BTN_SOUND_INDEX].m_div.style.backgroundImage = "url(res/images/BTN_SOUND_OFF.png)"), FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_SOUND_INDEX].SWITCH_ON === FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_SOUND_INDEX].m_btn_state && (FZ.Game.GameState.m_btn_list[FZ.Game.GameState.BTN_SOUND_INDEX].m_div.style.backgroundImage = "url(res/images/BTN_SOUND.png)")), a.setSwitchState(a.SWITCH_ON), this.levelPauseEndTime = (new Date).getTime(), this.levelPauseTime += this.levelPauseEndTime - this.levelPauseStartTime
  4443. }
  4444. this.m_diamondMgr.saveLevel()
  4445. } else if (this.m_btn_list[this.BTN_SOUND_INDEX] !== undefined && this.m_btn_list[this.BTN_SOUND_INDEX] === a) {
  4446. if (this.m_gamePause) return;
  4447. this.m_sound = !this.m_sound, this.m_sound ? (a.setSwitchState(a.SWITCH_ON), FZ.Music.setMute(!1)) : (a.setSwitchState(a.SWITCH_OFF), FZ.Music.setMute(!0)), FZ.GameBase.SaveObject.m_sound = this.m_sound, FZ.GameBase.saveGame()
  4448. }
  4449. }
  4450. },
  4451. debugLevel: function () {
  4452. var a = this.m_diamondMgr.getLevel(),
  4453. b = this.m_diamondMgr.getScore() + this.m_levelLeftTime * 20;
  4454. a < 9 && (FZ.GameBase.SaveObject.m_cur_level = a + 1);
  4455. if (a === 9) clearTimeout(this.m_timer), this.m_diamondMgr.setBubble(!1), this.m_next_state = FZ.StateDefs.GAME_STATE_GAME_WIN, this.pause(), FZ.GameBase.pushState(this.StateName), FZ.GameBase.switchToState(FZ.StateDefs.GAME_STATE_GAME_WIN, this.m_levelLeftTime, b);
  4456. else {
  4457. clearTimeout(this.m_timer), this.m_diamondMgr.setBubble(!1), this.m_next_state = FZ.StateDefs.GAME_STATE_NEXT_LEVEL, this.pause(), FZ.GameBase.pushState(this.StateName), FZ.GameBase.switchToState(FZ.StateDefs.GAME_STATE_NEXT_LEVEL, this.m_levelLeftTime, b);
  4458. return
  4459. }
  4460. },
  4461. pageHide: function (a) {
  4462. FZ.Game.GameState.m_diamondMgr !== null && (FZ.Game.GameState.m_diamondMgr.m_reset_finished = !1, FZ.Game.GameState.m_diamondMgr.setBubble(!1), FZ.Game.GameState.levelPauseStartTime = (new Date).getTime(), FZ.Game.GameState.pageHiddin = !0)
  4463. },
  4464. pageShow: function (a) {
  4465. FZ.Game.GameState.m_diamondMgr !== null && (FZ.Game.GameState.m_diamondMgr.m_reset_finished = !0, FZ.Game.GameState.levelPauseEndTime = (new Date).getTime(), FZ.Game.GameState.levelPauseTime += FZ.Game.GameState.levelPauseEndTime - FZ.Game.GameState.levelPauseStartTime, FZ.Game.GameState.pageHiddin = !1)
  4466. }
  4467. }, FZ.BaseState)), window.addEventListener("pagehide", FZ.Game.GameState.pageHide, !1), window.addEventListener("pageshow", FZ.Game.GameState.pageShow, !1)
  4468. }(), FZ.Game.GameOverState = new(FZ.newClass({
  4469. StateName: FZ.StateDefs.GAME_STATE_OVER,
  4470. CUR_UI_DEFS: ["NEXT_LEVEL_BG", "TXT_GAME_OVER", "TXT_TOTAL_OVER_SCORE", "NUM_STAGE_OVER_TOTAL_1", "NUM_STAGE_OVER_TOTAL_2", "NUM_STAGE_OVER_TOTAL_3", "NUM_STAGE_OVER_TOTAL_4", "NUM_STAGE_OVER_TOTAL_5"],
  4471. UI_SCORE_START_INDEX: 3,
  4472. TOTAL_SCORE: 5,
  4473. BTN_REPLAY_INDEX: 0,
  4474. CUR_BTN_DEFS: [
  4475. ["BTN_RETRY", "BTN_RETRY_TOUCH"]
  4476. ],
  4477. STR_RECT: [173, 280, 138, 36],
  4478. m_load_ui: !1,
  4479. popState: !1,
  4480. preProcess: function (a, b, c) {
  4481. var d = 0,
  4482. e = null,
  4483. f = null,
  4484. g = null,
  4485. h = null;
  4486. this.m_load_ui ? this.m_main_div.style.display = "inline" : (this.createUIs(this.CUR_UI_DEFS), this.createBtns(this.CUR_BTN_DEFS, !0), FZ.DivManager.addChild(this.m_main_div), this.m_load_ui = !0);
  4487. var i = FZ.AG.SearchSpecialPath.setScoreNum(c);
  4488. for (var d = 0; d < i.length; d++) this.m_ui_list[this.UI_SCORE_START_INDEX + this.TOTAL_SCORE - i.length + d].style.backgroundImage = "url(res/images/NUM_LEVEL_" + i[i.length - 1 - d] + ".png)";
  4489. if (i.length < this.TOTAL_SCORE)
  4490. for (var d = 0; d < this.TOTAL_SCORE - i.length; d++) this.m_ui_list[this.UI_SCORE_START_INDEX + d].style.backgroundImage = "url(res/images/NUM_LEVEL_0.png)";
  4491. this.popState = !1
  4492. },
  4493. postProcess: function () {
  4494. this.m_main_div.style.display = "none"
  4495. },
  4496. createStrScoreDiv: function () {
  4497. this.m_last_score_div = document.createElement("div"), this.m_last_score_div.style.position = "absolute", this.m_last_score_div.style.width = this.STR_RECT[2] + "px", this.m_last_score_div.style.height = this.STR_RECT[3] + "px", this.m_last_score_div.style.left = this.STR_RECT[0] + "px", this.m_last_score_div.style.top = this.STR_RECT[1] + "px", this.m_last_score_div.style.color = "#fff", this.m_last_score_div.style.fontSize = FZ.GameDefs.STATS_FONT_SIZE + "px", this.m_last_score_div.style.fontFamily = "Arial", this.m_last_score_div.style.lineHeight = this.STR_RECT[3] + "px", this.m_last_score_div.style.textAlign = "left", this.m_main_div.appendChild(this.m_last_score_div)
  4498. },
  4499. buttonClick: function (a) {
  4500. if (!this.popState) {
  4501. var b = null;
  4502. this.m_btn_list[this.BTN_REPLAY_INDEX] === a && (this.postProcess(), this.popState = !0, FZ.GameBase.popState(this.StateName))
  4503. }
  4504. }
  4505. }, FZ.BaseState)), FZ.Game.nextLevelState = new(FZ.newClass({
  4506. StateName: FZ.StateDefs.GAME_STATE_NEXT_LEVEL,
  4507. CUR_UI_DEFS: ["NEXT_LEVEL_BG", "TXT_LEVEL_CLEAR", "TXT_STAGE_SCORE", "TXT_TOTAL_SCORE", "NUM_STAGE_TOTAL_1", "NUM_STAGE_TOTAL_2", "NUM_STAGE_TOTAL_3", "NUM_STAGE_TOTAL_4", "NUM_STAGE_TOTAL_5", "NUM_STAGE_1", "NUM_STAGE_2", "NUM_STAGE_3", "NUM_STAGE_4"],
  4508. UI_TOTAL_SCORE_START_INDEX: 4,
  4509. UI_STAGE_SCORE_START_INDEX: 9,
  4510. BTN_NEXT_LEVEL_INDEX: 0,
  4511. TOTAL_SCORE: 5,
  4512. STAGE_SCORE: 4,
  4513. CUR_BTN_DEFS: [
  4514. ["BTN_NEXT_LEVEL", "BTN_NEXT_LEVEL_TOUCH"]
  4515. ],
  4516. m_load_ui: !1,
  4517. popState: !1,
  4518. preProcess: function (a, b, c, d) {
  4519. var e = 0,
  4520. f = null,
  4521. g = null,
  4522. h = null,
  4523. i = this,
  4524. j = null;
  4525. this.m_load_ui ? this.m_main_div.style.display = "inline" : (this.createUIs(this.CUR_UI_DEFS), this.createBtns(this.CUR_BTN_DEFS, !0), FZ.DivManager.addChild(this.m_main_div), this.m_load_ui = !0);
  4526. var k = FZ.AG.SearchSpecialPath.setScoreNum(c);
  4527. for (var e = 0; e < k.length; e++) this.m_ui_list[this.UI_TOTAL_SCORE_START_INDEX + this.TOTAL_SCORE - k.length + e].style.backgroundImage = "url(res/images/NUM_LEVEL_" + k[k.length - 1 - e] + ".png)";
  4528. if (k.length < this.TOTAL_SCORE)
  4529. for (var e = 0; e < this.TOTAL_SCORE - k.length; e++) this.m_ui_list[this.UI_TOTAL_SCORE_START_INDEX + e].style.backgroundImage = "url(res/images/NUM_LEVEL_0.png)";
  4530. k = FZ.AG.SearchSpecialPath.setScoreNum(d);
  4531. for (var e = 0; e < k.length; e++) this.m_ui_list[this.UI_STAGE_SCORE_START_INDEX + this.STAGE_SCORE - k.length + e].style.backgroundImage = "url(res/images/NUM_LEVEL_" + k[k.length - 1 - e] + ".png)";
  4532. if (k.length < this.STAGE_SCORE)
  4533. for (var e = 0; e < this.STAGE_SCORE - k.length; e++) this.m_ui_list[this.UI_STAGE_SCORE_START_INDEX + e].style.backgroundImage = "url(res/images/NUM_LEVEL_0.png)";
  4534. this.popState = !1, setTimeout(function () {
  4535. i.fade_in.call(i, 2e3, 1)
  4536. }, 10), FZ.GameBase.SaveObject.m_gamein = !1, FZ.GameBase.saveGame()
  4537. },
  4538. createStrLeftTimeDiv: function () {
  4539. this.m_last_left_time_div = document.createElement("div"), this.m_last_left_time_div.style.position = "absolute", this.m_last_left_time_div.style.width = this.STR_LEFT_TIME_RECT[2] + "px", this.m_last_left_time_div.style.height = this.STR_LEFT_TIME_RECT[3] + "px", this.m_last_left_time_div.style.left = this.STR_LEFT_TIME_RECT[0] + "px", this.m_last_left_time_div.style.top = this.STR_LEFT_TIME_RECT[1] + "px", this.m_last_left_time_div.style.color = "#fff", this.m_last_left_time_div.style.fontSize = FZ.GameDefs.STATS_FONT_SIZE + "px", this.m_last_left_time_div.style.fontFamily = "Arial", this.m_last_left_time_div.style.lineHeight = this.STR_LEFT_TIME_RECT[3] + "px", this.m_last_left_time_div.style.textAlign = "left", this.m_main_div.appendChild(this.m_last_left_time_div)
  4540. },
  4541. createStrScoreDiv: function () {
  4542. this.m_last_score_div = document.createElement("div"), this.m_last_score_div.style.position = "absolute", this.m_last_score_div.style.width = this.STR_SCORE_RECT[2] + "px", this.m_last_score_div.style.height = this.STR_SCORE_RECT[3] + "px", this.m_last_score_div.style.left = this.STR_SCORE_RECT[0] + "px", this.m_last_score_div.style.top = this.STR_SCORE_RECT[1] + "px", this.m_last_score_div.style.color = "#fff", this.m_last_score_div.style.fontSize = FZ.GameDefs.STATS_FONT_SIZE + "px", this.m_last_score_div.style.fontFamily = "Arial", this.m_last_score_div.style.lineHeight = this.STR_SCORE_RECT[3] + "px", this.m_last_score_div.style.textAlign = "left", this.m_main_div.appendChild(this.m_last_score_div)
  4543. },
  4544. postProcess: function () {
  4545. this.fade_out(2e3, 0, 0)
  4546. },
  4547. buttonClick: function (a) {
  4548. if (!this.popState) {
  4549. var b = null;
  4550. this.m_btn_list[this.BTN_NEXT_LEVEL_INDEX] === a && (this.postProcess(), this.popState = !0, FZ.GameBase.popState(this.StateName))
  4551. }
  4552. }
  4553. }, FZ.BaseState)), FZ.Game.winState = new(FZ.newClass({
  4554. StateName: FZ.StateDefs.GAME_STATE_GAME_WIN,
  4555. CUR_UI_DEFS: ["YOU_WIN_BG", "TXT_WIN_STAGE_SCORE", "TXT_WIN_TOTAL_SCORE", "NUM_STAGE_WIN_TOTAL_1", "NUM_STAGE_WIN_TOTAL_2", "NUM_STAGE_WIN_TOTAL_3", "NUM_STAGE_WIN_TOTAL_4", "NUM_STAGE_WIN_TOTAL_5", "NUM_STAGE_WIN_1", "NUM_STAGE_WIN_2", "NUM_STAGE_WIN_3", "NUM_STAGE_WIN_4"],
  4556. UI_TOTAL_SCORE_START_INDEX: 3,
  4557. UI_STAGE_SCORE_START_INDEX: 8,
  4558. TOTAL_SCORE: 5,
  4559. STAGE_SCORE: 4,
  4560. BTN_MAIN_MENU_IDNEX: 0,
  4561. CUR_BTN_DEFS: [
  4562. ["BTN_MAIN_MENU", "BTN_MAIN_MENU_TOUCH"]
  4563. ],
  4564. STR_LEFT_TIME_RECT: [100, 215, 50, 36],
  4565. STR_LEFT_TIME_BONUS_RECT: [203, 215, 30, 36],
  4566. STR_SCORE_RECT: [160, 277, 138, 36],
  4567. m_load_ui: !1,
  4568. preProcess: function (a, b, c, d) {
  4569. var e = 0,
  4570. f = null,
  4571. g = null,
  4572. h = null,
  4573. i = null,
  4574. j = this;
  4575. this.m_load_ui ? this.m_main_div.style.display = "inline" : (this.createUIs(this.CUR_UI_DEFS), this.createBtns(this.CUR_BTN_DEFS, !0), FZ.DivManager.addChild(this.m_main_div), this.m_load_ui = !0);
  4576. var k = FZ.AG.SearchSpecialPath.setScoreNum(c);
  4577. for (var e = 0; e < k.length; e++) this.m_ui_list[this.UI_TOTAL_SCORE_START_INDEX + this.TOTAL_SCORE - k.length + e].style.backgroundImage = "url(res/images/NUM_LEVEL_" + k[k.length - 1 - e] + ".png)";
  4578. if (k.length < this.TOTAL_SCORE)
  4579. for (var e = 0; e < this.TOTAL_SCORE - k.length; e++) this.m_ui_list[this.UI_TOTAL_SCORE_START_INDEX + e].style.backgroundImage = "url(res/images/NUM_LEVEL_0.png)";
  4580. k = FZ.AG.SearchSpecialPath.setScoreNum(d);
  4581. for (var e = 0; e < k.length; e++) this.m_ui_list[this.UI_STAGE_SCORE_START_INDEX + this.STAGE_SCORE - k.length + e].style.backgroundImage = "url(res/images/NUM_LEVEL_" + k[k.length - 1 - e] + ".png)";
  4582. if (k.length < this.STAGE_SCORE)
  4583. for (var e = 0; e < this.STAGE_SCORE - k.length; e++) this.m_ui_list[this.UI_STAGE_SCORE_START_INDEX + e].style.backgroundImage = "url(res/images/NUM_LEVEL_0.png)";
  4584. setTimeout(function () {
  4585. j.fade_in.call(j, 2e3, 1)
  4586. }, 10), FZ.GameBase.SaveObject.m_gamein = !1, FZ.GameBase.saveGame()
  4587. },
  4588. createStrLeftTimeDiv: function () {
  4589. this.m_last_left_time_div = document.createElement("div"), this.m_last_left_time_div.style.position = "absolute", this.m_last_left_time_div.style.width = this.STR_LEFT_TIME_RECT[2] + "px", this.m_last_left_time_div.style.height = this.STR_LEFT_TIME_RECT[3] + "px", this.m_last_left_time_div.style.left = this.STR_LEFT_TIME_RECT[0] + "px", this.m_last_left_time_div.style.top = this.STR_LEFT_TIME_RECT[1] + "px", this.m_last_left_time_div.style.color = "#fff", this.m_last_left_time_div.style.fontSize = FZ.GameDefs.STATS_FONT_SIZE + "px", this.m_last_left_time_div.style.fontFamily = "Arial", this.m_last_left_time_div.style.lineHeight = this.STR_LEFT_TIME_RECT[3] + "px", this.m_last_left_time_div.style.textAlign = "left", this.m_main_div.appendChild(this.m_last_left_time_div)
  4590. },
  4591. createStrScoreDiv: function () {
  4592. this.m_last_score_div = document.createElement("div"), this.m_last_score_div.style.position = "absolute", this.m_last_score_div.style.width = this.STR_SCORE_RECT[2] + "px", this.m_last_score_div.style.height = this.STR_SCORE_RECT[3] + "px", this.m_last_score_div.style.left = this.STR_SCORE_RECT[0] + "px", this.m_last_score_div.style.top = this.STR_SCORE_RECT[1] + "px", this.m_last_score_div.style.color = "#fff", this.m_last_score_div.style.fontSize = FZ.GameDefs.STATS_FONT_SIZE + "px", this.m_last_score_div.style.fontFamily = "Arial", this.m_last_score_div.style.lineHeight = this.STR_SCORE_RECT[3] + "px", this.m_last_score_div.style.textAlign = "left", this.m_main_div.appendChild(this.m_last_score_div)
  4593. },
  4594. postProcess: function () {
  4595. this.fade_out(2e3, 0, 0)
  4596. },
  4597. buttonClick: function (a) {
  4598. this.m_btn_list[this.BTN_MAIN_MENU_IDNEX] === a && (FZ.GameBase.switchToState(FZ.StateDefs.GAME_STATE_MAINMEN), FZ.Game.GameState.m_main_div.style.display = "none", FZ.Game.GameState.fade_out(2e3, 0, 0))
  4599. }
  4600. }, FZ.BaseState)), FZ.Game.ClearState = new(FZ.newClass({
  4601. StateName: FZ.StateDefs.GAME_STATE_GAME_CLEAR,
  4602. CUR_UI_DEFS: ["DIALOG_BG_CLEAR_GAME", "STR_SURE_CLEAR_GAME"],
  4603. BTN_YES_INDEX: 0,
  4604. BTN_NO_INDEX: 1,
  4605. CUR_BTN_DEFS: [
  4606. ["BTN_CLEAR_GAME_YES", "BTN_CLEAR_GAME_YES_TOUCH"],
  4607. ["BTN_CLEAR_GAME_NO", "BTN_CLEAR_GAME_NO_TOUCH"]
  4608. ],
  4609. m_ui_list: null,
  4610. m_btn_list: null,
  4611. popState: !1,
  4612. m_load_ui: !1,
  4613. preProcess: function () {
  4614. var a = null,
  4615. b = null,
  4616. c = null,
  4617. d = 0,
  4618. e = this;
  4619. this.m_load_ui ? this.m_main_div.style.display = "inline" : (this.createUIs(this.CUR_UI_DEFS), this.createBtns(this.CUR_BTN_DEFS, !0), FZ.DivManager.addChild(this.m_main_div), this.m_load_ui = !0), this.popState = !1, setTimeout(function () {
  4620. e.fade_in.call(e, 2e3, 1)
  4621. }, 10)
  4622. },
  4623. postProcess: function () {
  4624. this.m_main_div.style.display = "none"
  4625. },
  4626. buttonClick: function (a) {
  4627. if (!this.popState) {
  4628. var b = null;
  4629. this.m_btn_list[this.BTN_YES_INDEX] === a ? (this.postProcess(), this.popState = !0, FZ.GameBase.popState(this.StateName, "yes")) : this.m_btn_list[this.BTN_NO_INDEX] === a && (this.postProcess(), this.popState = !0, FZ.GameBase.popState(this.StateName, "no"))
  4630. }
  4631. }
  4632. }, FZ.BaseState)),
  4633. function () {
  4634. var a = !1,
  4635. b = null,
  4636. c = null,
  4637. d = null;
  4638. FZ.GameBase.MOBILE_IPAD = 10, FZ.GameBase.MOBILE_IPHONE = 20, FZ.GameBase.Width = 700, FZ.GameBase.Height = 500, FZ.GameBase.Name = "DreamPetLinkHtml5", FZ.TARGET_DEF = {}, FZ.TARGET_DEF.PC = "pc", FZ.TARGET_DEF.MOBILE = "mobile", FZ.TARGET_DEF.IPHONE = "iPhone", FZ.TARGET_DEF.IPAD = "iPad", FZ.TARGET_DEF.ANDRIOD = "Android", FZ.TargetPort = FZ.TARGET_DEF.PC, FZ.TargetMobile = FZ.TARGET_DEF.IPHONE, FZ.EVENT_DEF = {}, FZ.EVENT_DEF.M_OVER = "mouseover", FZ.EVENT_DEF.M_OUT = "mouseout", FZ.EVENT_DEF.M_MOVE = "mousemove", FZ.EVENT_DEF.M_CLICK = "click", FZ.EVENT_DEF.T_START = "touchstart", FZ.EVENT_DEF.T_MOVE = "touchmove", FZ.EVENT_DEF.T_END = "touchend", FZ.GameBase.setCss = function (a, b) {
  4639. a.style.width = b.w + "px", a.style.height = b.h + "px", a.style.left = b.x + "px", a.style.top = b.y + "px", a.style.position = "absolute", a.style.backgroundRepeat = "no-repeat", a.style.backgroundImage = "url(res/images/" + b.fileURL + ")"
  4640. }, FZ.PrintLog = function (a) {};
  4641. var e = function () {
  4642. var d = null;
  4643. if (a) return !0;
  4644. d = FZ.ResourceManager.ResourceLib.OrientationWarning;
  4645. if (!d) return !1;
  4646. b = FZ.getImgInfo("OrientationWarning"), c.style.backgroundRepeat = "no-repeat", c.style.backgroundImage = "url(res/images/" + b.fileURL + ")", c.style.backgroundPositionX = "50%", c.style.backgroundColor = "#fff", a = !0;
  4647. return !0
  4648. }, f = function () {
  4649. 90 === window.orientation || -90 === window.orientation ? (d.style.display = "none", c.style.display = "inline", FZ.Game.GameState.pageHide()) : 0 === window.orientation && (d.style.display = "inline", c.style.display = "none", FZ.Game.GameState.pageShow());
  4650. var a = 0,
  4651. b = 0;
  4652. FZ.TARGET_DEF.ANDRIOD === FZ.TargetMobile && (b = 1), setTimeout(function () {
  4653. window.scrollTo(a, b)
  4654. }, 10)
  4655. }, g = function () {
  4656. var a = 0,
  4657. b = 0;
  4658. FZ.TARGET_DEF.ANDRIOD === FZ.TargetMobile && (b = 1), setTimeout(function () {
  4659. window.scrollTo(a, b)
  4660. }, 1e3)
  4661. }, h = function (a) {
  4662. a.stopPropagation();
  4663. return !1
  4664. }, i = function () {
  4665. var a = null,
  4666. b = null;
  4667. FZ.GameBase.loadGame();
  4668. if (undefined === FZ.GameBase.SaveObject.m_cur_level) {
  4669. FZ.GameBase.SaveObject.m_cur_level = 0, FZ.GameBase.SaveObject.pass = !1, FZ.GameBase.SaveObject.score = 0, FZ.GameBase.SaveObject.m_hint = FZ.GameDefs.LEVEL_HINT_NUMBER[1], FZ.GameBase.SaveObject.m_gamein = !1, FZ.GameBase.SaveObject.m_cur_score = 0, FZ.GameBase.SaveObject.m_cur_hintCount = FZ.GameDefs.LEVEL_HINT_NUMBER[1], FZ.GameBase.SaveObject.m_cur_left_pet = FZ.GameDefs.ALL_PET_NUM, FZ.GameBase.SaveObject.m_level_usedTime = 0, FZ.TargetMobile !== FZ.TARGET_DEF.ANDRIOD && (FZ.GameBase.SaveObject.m_sound = !0);
  4670. var e = 0,
  4671. i = null,
  4672. j = null;
  4673. j = [];
  4674. for (e = 0; e < FZ.GameDefs.ALL_GENERAL; e++) i = {}, i.style = -1, i.state = FZ.GameDefs.DREAMPET_INIT, j.push(i);
  4675. FZ.GameBase.SaveObject.m_data = j, FZ.GameBase.saveGame()
  4676. }
  4677. d = FZ.$("mainDiv"), c = FZ.$("orientationDiv"), FZ.GameBase.animDiv = FZ.$("animDiv"), c.style.display = "none", /(iPhone|iPad|iPod|Android)/i.test(window.navigator.appVersion) && (FZ.TargetPort = FZ.TARGET_DEF.MOBILE, FZ.TargetMobile = FZ.TARGET_DEF.IPHONE, -1 !== navigator.userAgent.indexOf("iPad") ? FZ.TargetMobile = FZ.TARGET_DEF.IPAD : -1 !== navigator.userAgent.indexOf("Android") && (FZ.TargetMobile = FZ.TARGET_DEF.ANDRIOD)), a = document.createElement("meta"), b = document.getElementsByTagName("head"), FZ.TARGET_DEF.IPAD === FZ.TargetMobile ? (a.setAttribute("name", "viewport"), a.setAttribute("content", "width=320; initial-scale=2.0; maximum-scale=2.0; user-scalable=no;"), b[0].appendChild(a)) : (a.setAttribute("name", "viewport"), a.setAttribute("content", "width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=no;"), b[0].appendChild(a)), window.scrollTo(0, 0), FZ.DivManager.init(), FZ.DivManager.setParent(d), FZ.DivManager.setSize(FZ.GameDefs.SCREEN_W, FZ.GameDefs.SCREEN_H), FZ.DivManager.setOffset(d.offsetLeft, d.offsetTop), FZ.GameBase.switchToState(FZ.StateDefs.GAME_STATE_PRELOADING), FZ.TARGET_DEF.MOBILE === FZ.TargetPort && (window.onscroll = g, window.addEventListener("orientationchange", f, !1)), document.addEventListener("touchstart", h, !1), f(), FZ.PrintLog("test log")
  4678. };
  4679. FZ.GameBase.ArrayIndexof = function (a, b) {
  4680. var c = 0;
  4681. for (c = 0; c < a.length; c++)
  4682. if (b === a[c]) return c;
  4683. return -1
  4684. }, window.addEventListener("load", i, !1), FZ.EventHandler = function (a, b, c, d) {
  4685. if ( !! b) switch (c) {
  4686. case FZ.EVENT_DEF.M_OVER:
  4687. b.addEventListener(FZ.EVENT_DEF.M_OVER, a.m_call_mOver = function (b) {
  4688. d.call(a, b)
  4689. }, !1);
  4690. break;
  4691. case FZ.EVENT_DEF.M_OUT:
  4692. b.addEventListener(FZ.EVENT_DEF.M_OUT, a.m_call_mOut = function (b) {
  4693. d.call(a, b)
  4694. }, !1);
  4695. break;
  4696. case FZ.EVENT_DEF.M_MOVE:
  4697. b.addEventListener(FZ.EVENT_DEF.M_MOVE, a.m_call_mMove = function (b) {
  4698. d.call(a, b)
  4699. }, !1);
  4700. break;
  4701. case FZ.EVENT_DEF.M_CLICK:
  4702. b.addEventListener(FZ.EVENT_DEF.M_CLICK, a.m_call_mClick = function (b) {
  4703. d.call(a, b)
  4704. }, !1);
  4705. break;
  4706. case FZ.EVENT_DEF.T_START:
  4707. b.addEventListener(FZ.EVENT_DEF.T_START, a.m_call_tStart = function (b) {
  4708. d.call(a, b)
  4709. }, !1);
  4710. break;
  4711. case FZ.EVENT_DEF.T_MOVE:
  4712. b.addEventListener(FZ.EVENT_DEF.T_MOVE, a.m_call_tMove = function (b) {
  4713. d.call(a, b)
  4714. }, !1);
  4715. break;
  4716. case FZ.EVENT_DEF.T_END:
  4717. b.addEventListener(FZ.EVENT_DEF.T_END, a.m_call_tEnd = function (b) {
  4718. d.call(a, b)
  4719. }, !1);
  4720. break;
  4721. default:
  4722. }
  4723. }, FZ.EventRemove = function (a, b, c, d) {
  4724. if ( !! b && !! d) switch (c) {
  4725. case FZ.EVENT_DEF.M_OVER:
  4726. b.removeEventListener(FZ.EVENT_DEF.M_OVER, d, !1), a.m_call_mOver = null;
  4727. break;
  4728. case FZ.EVENT_DEF.M_OUT:
  4729. b.removeEventListener(FZ.EVENT_DEF.M_OUT, d, !1), a.m_call_mOut = null;
  4730. break;
  4731. case FZ.EVENT_DEF.M_MOVE:
  4732. b.removeEventListener(FZ.EVENT_DEF.M_MOVE, d, !1), a.m_call_mMove = null;
  4733. break;
  4734. case FZ.EVENT_DEF.M_CLICK:
  4735. b.removeEventListener(FZ.EVENT_DEF.M_CLICK, d, !1), a.m_call_mClick = null;
  4736. break;
  4737. case FZ.EVENT_DEF.T_START:
  4738. b.removeEventListener(FZ.EVENT_DEF.T_START, d, !1), a.m_call_tStart = null;
  4739. break;
  4740. case FZ.EVENT_DEF.T_MOVE:
  4741. b.removeEventListener(FZ.EVENT_DEF.T_MOVE, d, !1), a.m_call_tMove = null;
  4742. break;
  4743. case FZ.EVENT_DEF.T_END:
  4744. b.removeEventListener(FZ.EVENT_DEF.T_END, d, !1), a.m_call_tEnd = null;
  4745. break;
  4746. default:
  4747. }
  4748. }
  4749. }() //]]>
  4750. </script>
  4751. <script type="text/javascript">
  4752. setTimeout(function(){var a=document,b=a.getElementsByTagName("head")[0],c=a.createElement("meta"),d=b.getElementsByTagName('meta'),e=d.length;while(e--){if(d[e].name=="viewport"){
  4753. return true;}
  4754. }
  4755. c.name="viewport";
  4756. var density = '';
  4757. if(play68.Settings.get('currentGameInfo') && play68.Settings.get('currentGameInfo').targetdensity == 1){
  4758. density = ", target-densityDpi=device-dpi";
  4759. }c.content="width=device-width,maximum-scale=1.0, initial-scale=1.0, user-scalable=no"+density;b.appendChild(c);},25);
  4760. function insertGameplay(){if(play68.Auth.getAuthState()=="AUTHENTICATED"){play68.Gameplay.insert({onsuccess:function(a){},onfailure:function(a){}})}play68._Gameplay.insert({gameInfo:play68.Settings.get("currentGameInfo")})};
  4761. </script>
  4762. <script type="text/javascript">
  4763. (function() {
  4764. window._gaPageType = window._gaPageType || 'homepage';
  4765. window._ttIdle = 600000;
  4766. window._unbounceIntervalTime = 300000;
  4767. window._gaq = window._gaq || [];
  4768. window.spilAjaxPageView = function(pageType) {
  4769. window._gaPageType = pageType || 'homepage';
  4770. sendPageviewToAllTrackers();
  4771. }
  4772. window.spilLocationEvent = function(category, action, label, value, location){ spilLocationEvent(category, action, label, value, location);}
  4773. var gaTrackers = [];
  4774. function readCookie(name) {
  4775. var nameEQ = name + "=";
  4776. var ca = document.cookie.split(';');
  4777. var caLength = ca.length;
  4778. for ( var i = caLength; i--;) {
  4779. var c = ca[i];
  4780. while (c.charAt(0) == ' ')
  4781. c = c.substring(1, c.length);
  4782. if (c.indexOf(nameEQ) == 0)
  4783. return c.substring(nameEQ.length, c.length);
  4784. }
  4785. return null;
  4786. }
  4787. function contains(a, obj) {
  4788. for (var i = 0; i < a.length; i++) {
  4789. if (a[i] === obj) {
  4790. return true;
  4791. }
  4792. }
  4793. return false;
  4794. }
  4795. function spilTracker(name, ua, domain) {
  4796. if (name != "") {
  4797. name = name + ".";
  4798. }
  4799. if(!contains(gaTrackers,name))
  4800. gaTrackers.push(name);
  4801. _gaq.push(
  4802. [name + '_setAccount', ua],
  4803. [name + '_setAllowAnchor', true],
  4804. [name + '_setAllowLinker', true],
  4805. [name + '_setDomainName', domain],
  4806. [name + '_setSiteSpeedSampleRate', 10]
  4807. );
  4808. var customVarCookie = readCookie('_spilGacv');
  4809. if ('string' === typeof (customVarCookie)) {
  4810. var customVarData = unescape(customVarCookie).split('|');
  4811. }
  4812. var Profile = (customVarData ? 'true' : 'false');
  4813. var Username = (customVarData && 'Registered' !== customVarData[0] ? true : false);
  4814. _gaq.push([name + '_setCustomVar', 1, "Registered", Profile, 1]);
  4815. _gaq.push([name + '_setCustomVar', 2, "Login", Username, 1]);
  4816. _gaq.push( [ name + '_setCustomVar', 5, "Page", window._gaPageType, 3]);
  4817. if (window.location.pathname.substr(-4) != 'html' && window._gaPageType != 'homepage') {
  4818. if (window._gaPageType.substring(0, 1) != 'http://game.play68.com/') {
  4819. _gaq.push( [ name + '_trackPageview', '/' + window._gaPageType ]);
  4820. } else {
  4821. _gaq.push( [ name + '_trackPageview', window._gaPageType ]);
  4822. }
  4823. } else {
  4824. _gaq.push( [ name + '_trackPageview']);
  4825. }
  4826. }
  4827. function spilEvent(category, action, label, value) {
  4828. var totalTrackers = gaTrackers.length;
  4829. for ( var i = totalTrackers; i--;) {
  4830. _gaq.push( [ gaTrackers[i] + '_trackEvent', category, action, label,
  4831. value ]);
  4832. }
  4833. }
  4834. function spilEcommerceTrans(ID, aff, total, tax, shipping)
  4835. {
  4836. for (var i = 0; i < gaTrackers.length; i++)
  4837. {
  4838. _gaq.push([gaTrackers[i] + '_addTrans', ID, aff, total, tax, shipping, '', '', '']);
  4839. }
  4840. }
  4841. function spilEcommerceItem(ID, SKU, product, category, price, quantity)
  4842. {
  4843. for (var i = 0; i < gaTrackers.length; i++)
  4844. {
  4845. _gaq.push([gaTrackers[i] + '_addItem', ID, SKU, product, category, price, quantity]);
  4846. }
  4847. }
  4848. function spilEcommerceTrackTrans()
  4849. {
  4850. for (var i = 0; i < gaTrackers.length; i++)
  4851. {
  4852. _gaq.push([gaTrackers[i] + '_trackTrans']);
  4853. }
  4854. }
  4855. function spilLocationEvent(category, action, label, value, location) {
  4856. var totalTrackers = gaTrackers.length;
  4857. for ( var i = totalTrackers; i--;) {
  4858. _gaq.push( [ gaTrackers[i] + '_trackEvent', category, action, label, value]);
  4859. }
  4860. setTimeout('document.location = "' + location + '"', 100);
  4861. }
  4862. function sendPageviewToAllTrackers() {
  4863. spilTracker('', 'UA-18031455-1', '.gamesgames.com');
  4864. spilTracker('aggregated', 'UA-8223336-1', '.gamesgames.com'); // aggregated account should match the domain name
  4865. }
  4866. sendPageviewToAllTrackers();
  4867. (function() {
  4868. })();
  4869. //
  4870. // new
  4871. //
  4872. var PageMonitor = (function() {
  4873. var idleSince = (+new Date()),
  4874. timeForNewPageView = 30*60*1000, /* 30 minutes */
  4875. keepAliveCounter = 0,
  4876. keepAliveTimerId = -1,
  4877. keepAliveInterval = 60*1000,
  4878. maximumKeepAlive = 3*60*1000;
  4879. var notIdleAnymore = function() {
  4880. newPageView();
  4881. idleSince = (+new Date());
  4882. keepAliveTimerId < 0 && active();
  4883. }
  4884. document.addEventListener('click', notIdleAnymore);
  4885. document.addEventListener('touchstart', notIdleAnymore);
  4886. var idle = function() {
  4887. idleSince = (+new Date());
  4888. keepAliveTimerId = -1;
  4889. };
  4890. var active = function() {
  4891. keepAliveTimerId = setTimeout(keepAlive, keepAliveInterval);
  4892. };
  4893. var keepAlive = function() {
  4894. spilEvent('unbounce', 'each [x] minutes', '' + keepAliveCounter);
  4895. keepAliveCounter++;
  4896. if(idleTime() < maximumKeepAlive)
  4897. keepAliveTimerId = setTimeout(keepAlive, keepAliveInterval);
  4898. else {
  4899. idle();
  4900. }
  4901. };
  4902. var newPageView = function() {
  4903. if (idleTime() >= timeForNewPageView) {
  4904. sendPageviewToAllTrackers();
  4905. }
  4906. };
  4907. var idleTime = function() {
  4908. return ((+new Date()) - idleSince);
  4909. }
  4910. active();
  4911. })();
  4912. })();
  4913. </script>
  4914. <div id="mainDiv" style="left: 50%; top: -20px; margin-left: -160px; z-index: 20; position: absolute; overflow: hidden; width: 320px; height: 480px; ">
  4915. <div style="display: inline; z-index: 0; -webkit-transition: 2000ms; opacity: 1; -webkit-transform: translate(0px, 0px) rotate(0deg); ">
  4916. <div style="width: 320px; height: 480px; left: 0px; top: 0px; position: absolute; background-image: url(res/images/majong_BG.png); background-repeat: no-repeat no-repeat; "></div>
  4917. <div style="width: 318px; height: 426px; left: 0px; top: 0px; position: absolute; background-image: url(res/images/MAIN_MENU_AND_LOADING_BG.png); background-repeat: no-repeat no-repeat; "></div>
  4918. <div style="position: absolute; width: 149px; height: 63px; background-image: url(res/images/BTN_START.png); left: 93px; top: 264px; display: none; background-position: 0px 0px; background-repeat: no-repeat no-repeat; "></div>
  4919. <div style="position: absolute; width: 149px; height: 63px; background-image: url(res/images/BTN_CONTINUE.png); left: 95px; top: 330px; display: none; background-position: 0px 0px; background-repeat: no-repeat no-repeat; "></div>
  4920. </div>
  4921. </div>
  4922. <div id="orientationDiv" style="background-image: url(res/images/OrientationWarning.png); position: absolute; width: 480px; height: 320px; display: none; background-position: 50% 50%; background-repeat: no-repeat no-repeat; "> </div>
  4923. </body></html>