Файловый менеджер - Редактировать - /home/jogoso94/public_html/jogos/classic_backgammon/js/main.js
�азад
/* Platform.js <https://mths.be/platform> Copyright 2014-2018 Benjamin Tan <https://bnjmnt4n.now.sh/> Copyright 2011-2013 John-David Dalton Available under MIT license <https://mths.be/mit> */ var $jscomp = $jscomp || {}; $jscomp.scope = {}; $jscomp.arrayIteratorImpl = function(a) { var b = 0; return function() { return b < a.length ? { done: !1, value: a[b++] } : { done: !0 } } }; $jscomp.arrayIterator = function(a) { return { next: $jscomp.arrayIteratorImpl(a) } }; $jscomp.makeIterator = function(a) { var b = "undefined" != typeof Symbol && Symbol.iterator && a[Symbol.iterator]; if (b) return b.call(a); if ("number" == typeof a.length) return $jscomp.arrayIterator(a); throw Error(String(a) + " is not an iterable or ArrayLike"); }; $jscomp.arrayFromIterator = function(a) { for (var b, c = []; !(b = a.next()).done;) c.push(b.value); return c }; $jscomp.arrayFromIterable = function(a) { return a instanceof Array ? a : $jscomp.arrayFromIterator($jscomp.makeIterator(a)) }; (function() { function a(v) { v = String(v); return v.charAt(0).toUpperCase() + v.slice(1) } function b(v, K) { var G = -1, C = v ? v.length : 0; if ("number" == typeof C && -1 < C && C <= z) for (; ++G < C;) K(v[G], G, v); else d(v, K) } function c(v) { v = String(v).replace(/^ +| +$/g, ""); return /^(?:webOS|i(?:OS|P))/.test(v) ? v : a(v) } function d(v, K) { for (var G in v) H.call(v, G) && K(v[G], G, v) } function g(v) { return null == v ? a(v) : F.call(v).slice(8, -1) } function f(v, K) { var G = null != v ? typeof v[K] : "number"; return !/^(?:boolean|number|string|undefined)$/.test(G) && ("object" == G ? !!v[K] : !0) } function k(v) { return String(v).replace(/([ -])(?!$)/g, "$1?") } function m(v, K) { var G = null; b(v, function(C, r) { G = K(G, C, r, v) }); return G } function e(v) { function K(O) { return m(O, function(N, L) { var P = L.pattern || k(L); !N && (N = RegExp("\\b" + P + " *\\d+[.\\w_]*", "i").exec(v) || RegExp("\\b" + P + " *\\w+-[\\w]*", "i").exec(v) || RegExp("\\b" + P + "(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)", "i").exec(v)) && ((N = String(L.label && !RegExp(P, "i").test(L.label) ? L.label : N).split("/"))[1] && !/[\d.]+/.test(N[0]) && (N[0] += " " + N[1]), L = L.label || L, N = c(N[0].replace(RegExp(P, "i"), L).replace(RegExp("; *(?:" + L + "[_-])?", "i"), " ").replace(RegExp("(" + L + ")[-_.]?(\\w)", "i"), "$1 $2"))); return N }) } function G(O) { return m(O, function(N, L) { return N || (RegExp(L + "(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)", "i").exec(v) || 0)[1] || null }) } var C = D, r = v && "object" == typeof v && "String" != g(v); r && (C = v, v = null); var I = C.navigator || {}, E = I.userAgent || ""; v || (v = E); var R = r ? !!I.likeChrome : /\bChrome\b/.test(v) && !/internal|\n/i.test(F.toString()), W = r ? "Object" : "ScriptBridgingProxyObject", S = r ? "Object" : "Environment", T = r && C.java ? "JavaPackage" : g(C.java), aa = r ? "Object" : "RuntimeObject"; S = (T = /\bJava/.test(T) && C.java) && g(C.environment) == S; var X = T ? "a" : "\u03b1", Z = T ? "b" : "\u03b2", Y = C.document || {}, Q = C.operamini || C.opera, V = w.test(V = r && Q ? Q["[[Class]]"] : g(Q)) ? V : Q = null, q, M = v; r = []; var l = null, u = v == E; E = u && Q && "function" == typeof Q.version && Q.version(); var h = function(O) { return m(O, function(N, L) { return N || RegExp("\\b" + (L.pattern || k(L)) + "\\b", "i").exec(v) && (L.label || L) }) }([{ label: "EdgeHTML", pattern: "Edge" }, "Trident", { label: "WebKit", pattern: "AppleWebKit" }, "iCab", "Presto", "NetFront", "Tasman", "KHTML", "Gecko"]), p = function(O) { return m(O, function(N, L) { return N || RegExp("\\b" + (L.pattern || k(L)) + "\\b", "i").exec(v) && (L.label || L) }) }(["Adobe AIR", "Arora", "Avant Browser", "Breach", "Camino", "Electron", "Epiphany", "Fennec", "Flock", "Galeon", "GreenBrowser", "iCab", "Iceweasel", "K-Meleon", "Konqueror", "Lunascape", "Maxthon", { label: "Microsoft Edge", pattern: "Edge" }, "Midori", "Nook Browser", "PaleMoon", "PhantomJS", "Raven", "Rekonq", "RockMelt", { label: "Samsung Internet", pattern: "SamsungBrowser" }, "SeaMonkey", { label: "Silk", pattern: "(?:Cloud9|Silk-Accelerated)" }, "Sleipnir", "SlimBrowser", { label: "SRWare Iron", pattern: "Iron" }, "Sunrise", "Swiftfox", "Waterfox", "WebPositive", "Opera Mini", { label: "Opera Mini", pattern: "OPiOS" }, "Opera", { label: "Opera", pattern: "OPR" }, "Chrome", { label: "Chrome Mobile", pattern: "(?:CriOS|CrMo)" }, { label: "Firefox", pattern: "(?:Firefox|Minefield)" }, { label: "Firefox for iOS", pattern: "FxiOS" }, { label: "IE", pattern: "IEMobile" }, { label: "IE", pattern: "MSIE" }, "Safari" ]), x = K([{ label: "BlackBerry", pattern: "BB10" }, "BlackBerry", { label: "Galaxy S", pattern: "GT-I9000" }, { label: "Galaxy S2", pattern: "GT-I9100" }, { label: "Galaxy S3", pattern: "GT-I9300" }, { label: "Galaxy S4", pattern: "GT-I9500" }, { label: "Galaxy S5", pattern: "SM-G900" }, { label: "Galaxy S6", pattern: "SM-G920" }, { label: "Galaxy S6 Edge", pattern: "SM-G925" }, { label: "Galaxy S7", pattern: "SM-G930" }, { label: "Galaxy S7 Edge", pattern: "SM-G935" }, "Google TV", "Lumia", "iPad", "iPod", "iPhone", "Kindle", { label: "Kindle Fire", pattern: "(?:Cloud9|Silk-Accelerated)" }, "Nexus", "Nook", "PlayBook", "PlayStation Vita", "PlayStation", "TouchPad", "Transformer", { label: "Wii U", pattern: "WiiU" }, "Wii", "Xbox One", { label: "Xbox 360", pattern: "Xbox" }, "Xoom" ]), B = function(O) { return m(O, function(N, L, P) { return N || (L[x] || L[/^[a-z]+(?: +[a-z]+\b)*/i.exec(x)] || RegExp("\\b" + k(P) + "(?:\\b|\\w*\\d)", "i").exec(v)) && P }) }({ Apple: { iPad: 1, iPhone: 1, iPod: 1 }, Archos: {}, Amazon: { Kindle: 1, "Kindle Fire": 1 }, Asus: { Transformer: 1 }, "Barnes & Noble": { Nook: 1 }, BlackBerry: { PlayBook: 1 }, Google: { "Google TV": 1, Nexus: 1 }, HP: { TouchPad: 1 }, HTC: {}, LG: {}, Microsoft: { Xbox: 1, "Xbox One": 1 }, Motorola: { Xoom: 1 }, Nintendo: { "Wii U": 1, Wii: 1 }, Nokia: { Lumia: 1 }, Samsung: { "Galaxy S": 1, "Galaxy S2": 1, "Galaxy S3": 1, "Galaxy S4": 1 }, Sony: { PlayStation: 1, "PlayStation Vita": 1 } }), A = function(O) { return m(O, function(N, L) { var P = L.pattern || k(L); if (!N && (N = RegExp("\\b" + P + "(?:/[\\d.]+|[ \\w.]*)", "i").exec(v))) { var U = N, ca = L.label || L, da = { "10.0": "10", "6.4": "10 Technical Preview", "6.3": "8.1", "6.2": "8", "6.1": "Server 2008 R2 / 7", "6.0": "Server 2008 / Vista", "5.2": "Server 2003 / XP 64-bit", "5.1": "XP", "5.01": "2000 SP1", "5.0": "2000", "4.0": "NT", "4.90": "ME" }; P && ca && /^Win/i.test(U) && !/^Windows Phone /i.test(U) && (da = da[/[\d.]+$/.exec(U)]) && (U = "Windows " + da); U = String(U); P && ca && (U = U.replace(RegExp(P, "i"), ca)); N = U = c(U.replace(/ ce$/i, " CE").replace(/\bhpw/i, "web").replace(/\bMacintosh\b/, "Mac OS").replace(/_PowerPC\b/i, " OS").replace(/\b(OS X) [^ \d]+/i, "$1").replace(/\bMac (OS X)\b/, "$1").replace(/\/(\d)/, " $1").replace(/_/g, ".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i, "").replace(/\bx86\.64\b/gi, "x86_64").replace(/\b(Windows Phone) OS\b/, "$1").replace(/\b(Chrome OS \w+) [\d.]+\b/, "$1").split(" on ")[0]) } return N }) }(["Windows Phone", "Android", "CentOS", { label: "Chrome OS", pattern: "CrOS" }, "Debian", "Fedora", "FreeBSD", "Gentoo", "Haiku", "Kubuntu", "Linux Mint", "OpenBSD", "Red Hat", "SuSE", "Ubuntu", "Xubuntu", "Cygwin", "Symbian OS", "hpwOS", "webOS ", "webOS", "Tablet OS", "Tizen", "Linux", "Mac OS X", "Macintosh", "Mac", "Windows 98;", "Windows " ]); h && (h = [h]); B && !x && (x = K([B])); if (q = /\bGoogle TV\b/.exec(x)) x = q[0]; /\bSimulator\b/i.test(v) && (x = (x ? x + " " : "") + "Simulator"); "Opera Mini" == p && /\bOPiOS\b/.test(v) && r.push("running in Turbo/Uncompressed mode"); "IE" == p && /\blike iPhone OS\b/.test(v) ? (q = e(v.replace(/like iPhone OS/, "")), B = q.manufacturer, x = q.product) : /^iP/.test(x) ? (p || (p = "Safari"), A = "iOS" + ((q = / OS ([\d_]+)/i.exec(v)) ? " " + q[1].replace(/_/g, ".") : "")) : "Konqueror" != p || /buntu/i.test(A) ? B && "Google" != B && (/Chrome/.test(p) && !/\bMobile Safari\b/i.test(v) || /\bVita\b/.test(x)) || /\bAndroid\b/.test(A) && /^Chrome/.test(p) && /\bVersion\//i.test(v) ? (p = "Android Browser", A = /\bAndroid\b/.test(A) ? A : "Android") : "Silk" == p ? (/\bMobi/i.test(v) || (A = "Android", r.unshift("desktop mode")), /Accelerated *= *true/i.test(v) && r.unshift("accelerated")) : "PaleMoon" == p && (q = /\bFirefox\/([\d.]+)\b/.exec(v)) ? r.push("identifying as Firefox " + q[1]) : "Firefox" == p && (q = /\b(Mobile|Tablet|TV)\b/i.exec(v)) ? (A || (A = "Firefox OS"), x || (x = q[1])) : !p || (q = !/\bMinefield\b/i.test(v) && /\b(?:Firefox|Safari)\b/.exec(p)) ? (p && !x && /[\/,]|^[^(]+?\)/.test(v.slice(v.indexOf(q + "/") + 8)) && (p = null), (q = x || B || A) && (x || B || /\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(A)) && (p = /[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(A) ? A : q) + " Browser")) : "Electron" == p && (q = (/\bChrome\/([\d.]+)\b/.exec(v) || 0)[1]) && r.push("Chromium " + q) : A = "Kubuntu"; E || (E = G(["(?:Cloud9|CriOS|CrMo|Edge|FxiOS|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$))", "Version", k(p), "(?:Firefox|Minefield|NetFront)" ])); if (q = "iCab" == h && 3 < parseFloat(E) && "WebKit" || /\bOpera\b/.test(p) && (/\bOPR\b/.test(v) ? "Blink" : "Presto") || /\b(?:Midori|Nook|Safari)\b/i.test(v) && !/^(?:Trident|EdgeHTML)$/.test(h) && "WebKit" || !h && /\bMSIE\b/i.test(v) && ("Mac OS" == A ? "Tasman" : "Trident") || "WebKit" == h && /\bPlayStation\b(?! Vita\b)/i.test(p) && "NetFront") h = [q]; "IE" == p && (q = (/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(v) || 0)[1]) ? (p += " Mobile", A = "Windows Phone " + (/\+$/.test(q) ? q : q + ".x"), r.unshift("desktop mode")) : /\bWPDesktop\b/i.test(v) ? (p = "IE Mobile", A = "Windows Phone 8.x", r.unshift("desktop mode"), E || (E = (/\brv:([\d.]+)/.exec(v) || 0)[1])) : "IE" != p && "Trident" == h && (q = /\brv:([\d.]+)/.exec(v)) && (p && r.push("identifying as " + p + (E ? " " + E : "")), p = "IE", E = q[1]); if (u) { if (f(C, "global")) if (T && (q = T.lang.System, M = q.getProperty("os.arch"), A = A || q.getProperty("os.name") + " " + q.getProperty("os.version")), S) { try { E = C.require("ringo/engine").version.join("."), p = "RingoJS" } catch (O) { (q = C.system) && q.global.system == C.system && (p = "Narwhal", A || (A = q[0].os || null)) } p || (p = "Rhino") } else "object" == typeof C.process && !C.process.browser && (q = C.process) && ("object" == typeof q.versions && ("string" == typeof q.versions.electron ? (r.push("Node " + q.versions.node), p = "Electron", E = q.versions.electron) : "string" == typeof q.versions.nw && (r.push("Chromium " + E, "Node " + q.versions.node), p = "NW.js", E = q.versions.nw)), p || (p = "Node.js", M = q.arch, A = q.platform, E = (E = /[\d.]+/.exec(q.version)) ? E[0] : null)); else g(q = C.runtime) == W ? (p = "Adobe AIR", A = q.flash.system.Capabilities.os) : g(q = C.phantom) == aa ? (p = "PhantomJS", E = (q = q.version || null) && q.major + "." + q.minor + "." + q.patch) : "number" == typeof Y.documentMode && (q = /\bTrident\/(\d+)/i.exec(v)) ? (E = [E, Y.documentMode], (q = +q[1] + 4) != E[1] && (r.push("IE " + E[1] + " mode"), h && (h[1] = ""), E[1] = q), E = "IE" == p ? String(E[1].toFixed(1)) : E[0]) : "number" == typeof Y.documentMode && /^(?:Chrome|Firefox)\b/.test(p) && (r.push("masking as " + p + " " + E), p = "IE", E = "11.0", h = ["Trident"], A = "Windows"); A = A && c(A) } E && (q = /(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(E) || /(?:alpha|beta)(?: ?\d)?/i.exec(v + ";" + (u && I.appMinorVersion)) || /\bMinefield\b/i.test(v) && "a") && (l = /b/i.test(q) ? "beta" : "alpha", E = E.replace(RegExp(q + "\\+?$"), "") + ("beta" == l ? Z : X) + (/\d+\+?/.exec(q) || "")); if ("Fennec" == p || "Firefox" == p && /\b(?:Android|Firefox OS)\b/.test(A)) p = "Firefox Mobile"; else if ("Maxthon" == p && E) E = E.replace(/\.[\d.]+/, ".x"); else if (/\bXbox\b/i.test(x)) "Xbox 360" == x && (A = null), "Xbox 360" == x && /\bIEMobile\b/.test(v) && r.unshift("mobile mode"); else if (!/^(?:Chrome|IE|Opera)$/.test(p) && (!p || x || /Browser|Mobi/.test(p)) || "Windows CE" != A && !/Mobi/i.test(v)) if ("IE" == p && u) try { null === C.external && r.unshift("platform preview") } catch (O) { r.unshift("embedded") } else(/\bBlackBerry\b/.test(x) || /\bBB10\b/.test(v)) && (q = (RegExp(x.replace(/ +/g, " *") + "/([.\\d]+)", "i").exec(v) || 0)[1] || E) ? (q = [q, /BB10/.test(v)], A = (q[1] ? (x = null, B = "BlackBerry") : "Device Software") + " " + q[0], E = null) : this != d && "Wii" != x && (u && Q || /Opera/.test(p) && /\b(?:MSIE|Firefox)\b/i.test(v) || "Firefox" == p && /\bOS X (?:\d+\.){2,}/.test(A) || "IE" == p && (A && !/^Win/.test(A) && 5.5 < E || /\bWindows XP\b/.test(A) && 8 < E || 8 == E && !/\bTrident\b/.test(v))) && !w.test(q = e.call(d, v.replace(w, "") + ";")) && q.name && (q = "ing as " + q.name + ((q = q.version) ? " " + q : ""), w.test(p) ? (/\bIE\b/.test(q) && "Mac OS" == A && (A = null), q = "identify" + q) : (q = "mask" + q, p = V ? c(V.replace(/([a-z])([A-Z])/g, "$1 $2")) : "Opera", /\bIE\b/.test(q) && (A = null), u || (E = null)), h = ["Presto"], r.push(q)); else p += " Mobile"; if (q = (/\bAppleWebKit\/([\d.]+\+?)/i.exec(v) || 0)[1]) { q = [parseFloat(q.replace(/\.(\d)$/, ".0$1")), q]; if ("Safari" == p && "+" == q[1].slice(-1)) p = "WebKit Nightly", l = "alpha", E = q[1].slice(0, -1); else if (E == q[1] || E == (q[2] = (/\bSafari\/([\d.]+\+?)/i.exec(v) || 0)[1])) E = null; q[1] = (/\bChrome\/([\d.]+)/i.exec(v) || 0)[1]; 537.36 == q[0] && 537.36 == q[2] && 28 <= parseFloat(q[1]) && "WebKit" == h && (h = ["Blink"]); u && (R || q[1]) ? (h && (h[1] = "like Chrome"), q = q[1] || (q = q[0], 530 > q ? 1 : 532 > q ? 2 : 532.05 > q ? 3 : 533 > q ? 4 : 534.03 > q ? 5 : 534.07 > q ? 6 : 534.1 > q ? 7 : 534.13 > q ? 8 : 534.16 > q ? 9 : 534.24 > q ? 10 : 534.3 > q ? 11 : 535.01 > q ? 12 : 535.02 > q ? "13+" : 535.07 > q ? 15 : 535.11 > q ? 16 : 535.19 > q ? 17 : 536.05 > q ? 18 : 536.1 > q ? 19 : 537.01 > q ? 20 : 537.11 > q ? "21+" : 537.13 > q ? 23 : 537.18 > q ? 24 : 537.24 > q ? 25 : 537.36 > q ? 26 : "Blink" != h ? "27" : "28")) : (h && (h[1] = "like Safari"), q = (q = q[0], 400 > q ? 1 : 500 > q ? 2 : 526 > q ? 3 : 533 > q ? 4 : 534 > q ? "4+" : 535 > q ? 5 : 537 > q ? 6 : 538 > q ? 7 : 601 > q ? 8 : "8")); h && (h[1] += " " + (q += "number" == typeof q ? ".x" : /[.+]/.test(q) ? "" : "+")); "Safari" == p && (!E || 45 < parseInt(E)) && (E = q) } "Opera" == p && (q = /\bzbov|zvav$/.exec(A)) ? (p += " ", r.unshift("desktop mode"), "zvav" == q ? (p += "Mini", E = null) : p += "Mobile", A = A.replace(RegExp(" *" + q + "$"), "")) : "Safari" == p && /\bChrome\b/.exec(h && h[1]) && (r.unshift("desktop mode"), p = "Chrome Mobile", E = null, /\bOS X\b/.test(A) ? (B = "Apple", A = "iOS 4.3+") : A = null); E && 0 == E.indexOf(q = /[\d.]+$/.exec(A)) && -1 < v.indexOf("/" + q + "-") && (A = String(A.replace(q, "")).replace(/^ +| +$/g, "")); h && !/\b(?:Avant|Nook)\b/.test(p) && (/Browser|Lunascape|Maxthon/.test(p) || "Safari" != p && /^iOS/.test(A) && /\bSafari\b/.test(h[1]) || /^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|Web)/.test(p) && h[1]) && (q = h[h.length - 1]) && r.push(q); r.length && (r = ["(" + r.join("; ") + ")"]); B && x && 0 > x.indexOf(B) && r.push("on " + B); x && r.push((/^on /.test(r[r.length - 1]) ? "" : "on ") + x); if (A) { var ba = (q = / ([\d.+]+)$/.exec(A)) && "/" == A.charAt(A.length - q[0].length - 1); A = { architecture: 32, family: q && !ba ? A.replace(q[0], "") : A, version: q ? q[1] : null, toString: function() { var O = this.version; return this.family + (O && !ba ? " " + O : "") + (64 == this.architecture ? " 64-bit" : "") } } }(q = /\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(M)) && !/\bi686\b/i.test(M) ? (A && (A.architecture = 64, A.family = A.family.replace(RegExp(" *" + q), "")), p && (/\bWOW64\b/i.test(v) || u && /\w(?:86|32)$/.test(I.cpuClass || I.platform) && !/\bWin64; x64\b/i.test(v)) && r.unshift("32-bit")) : A && /^OS X/.test(A.family) && "Chrome" == p && 39 <= parseFloat(E) && (A.architecture = 64); v || (v = null); C = {}; C.description = v; C.layout = h && h[0]; C.manufacturer = B; C.name = p; C.prerelease = l; C.product = x; C.ua = v; C.version = p && E; C.os = A || { architecture: null, family: null, version: null, toString: function() { return "null" } }; C.parse = e; C.toString = function() { return this.description || "" }; C.version && r.unshift(E); C.name && r.unshift(p); A && p && (A != String(A).split(" ")[0] || A != p.split(" ")[0] && !x) && r.push(x ? "(" + A + ")" : "on " + A); r.length && (C.description = r.join(" ")); return C } var t = { "function": !0, object: !0 }, D = t[typeof window] && window || this, n = t[typeof exports] && exports; t = t[typeof module] && module && !module.nodeType && module; var y = n && t && "object" == typeof global && global; !y || y.global !== y && y.window !== y && y.self !== y || (D = y); var z = Math.pow(2, 53) - 1, w = /\bOpera/; y = Object.prototype; var H = y.hasOwnProperty, F = y.toString, J = e(); "function" == typeof define && "object" == typeof define.amd && define.amd ? (D.platform = J, define(function() { return J })) : n && t ? d(J, function(v, K) { n[K] = v }) : D.platform = J }).call(this); function buildIOSMeta() { for (var a = [{ name: "viewport", content: "width=device-width, height=device-height, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no" }, { name: "apple-mobile-web-app-capable", content: "yes" }, { name: "apple-mobile-web-app-status-bar-style", content: "black" }], b = 0; b < a.length; b++) { var c = document.createElement("meta"); c.name = a[b].name; c.content = a[b].content; var d = window.document.head.querySelector('meta[name="' + c.name + '"]'); d && d.parentNode.removeChild(d); window.document.head.appendChild(c) } } function hideIOSFullscreenPanel() { document.querySelector(".xxx-ios-fullscreen-message").style.display = "none"; document.querySelector(".xxx-ios-fullscreen-scroll").style.display = "none"; document.querySelector(".xxx-game-iframe-full").classList.remove("xxx-game-iframe-iphone-se") } function buildIOSFullscreenPanel() { document.body.insertAdjacentHTML("beforeend", '<div class="xxx-ios-fullscreen-message"><div class="xxx-ios-fullscreen-swipe"></div></div><div class="xxx-ios-fullscreen-scroll"></div>') } function showIOSFullscreenPanel() { document.querySelector(".xxx-ios-fullscreen-message").style.display = "none"; document.querySelector(".xxx-ios-fullscreen-scroll").style.display = "none" } function __iosResize() { window.scrollTo(0, 0); console.log(window.devicePixelRatio); console.log(window.innerWidth); console.log(window.innerHeight); if ("iPhone" === platform.product) switch (window.devicePixelRatio) { case 2: switch (window.innerWidth) { case 568: 320 !== window.innerHeight && document.querySelector(".xxx-game-iframe-full").classList.add("xxx-game-iframe-iphone-se"); break; case 667: 375 === window.innerHeight ? hideIOSFullscreenPanel() : showIOSFullscreenPanel(); break; case 808: 414 === window.innerHeight ? hideIOSFullscreenPanel() : showIOSFullscreenPanel(); break; default: hideIOSFullscreenPanel() } break; case 3: switch (window.innerWidth) { case 736: 414 === window.innerHeight ? hideIOSFullscreenPanel() : showIOSFullscreenPanel(); break; case 724: 375 === window.innerHeight ? hideIOSFullscreenPanel() : showIOSFullscreenPanel(); break; case 808: 414 === window.innerHeight ? hideIOSFullscreenPanel() : showIOSFullscreenPanel(); break; default: hideIOSFullscreenPanel() } break; default: hideIOSFullscreenPanel() } } function iosResize() { __iosResize(); setTimeout(function() { __iosResize() }, 500) } function iosInIframe() { try { return window.self !== window.top } catch (a) { return !0 } } function isIOSLessThen13() { var a = platform.os, b = a.family.toLowerCase(); a = parseFloat(a.version); return "ios" === b && 13 > a ? !0 : !1 } document.addEventListener("DOMContentLoaded", function() { platform && "iPhone" === platform.product && "safari" === platform.name.toLowerCase() && isIOSLessThen13() && !iosInIframe() && (buildIOSFullscreenPanel(), buildIOSMeta()) }); window.addEventListener("resize", function(a) { platform && "iPhone" === platform.product && "safari" === platform.name.toLowerCase() && isIOSLessThen13() && !iosInIframe() && iosResize() }); var s_iScaleFactor = 1, s_iOffsetX, s_iOffsetY, s_bIsIphone = !1, s_bIsRetina, pausedTweenObjs = [], s_bFocus = !0; (function(a) { (jQuery.browser = jQuery.browser || {}).mobile = /android|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(ad|hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|tablet|treo|up\.(browser|link)|vodafone|wap|webos|windows (ce|phone)|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|e\-|e\/|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(di|rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|xda(\-|2|g)|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4)) })(navigator.userAgent || navigator.vendor || window.opera); $(window).resize(function() { sizeHandler() }); function trace(a) { console.log(a) } function getSize(a) { var b = a.toLowerCase(), c = window.document, d = c.documentElement; if (void 0 === window["inner" + a]) a = d["client" + a]; else if (window["inner" + a] != d["client" + a]) { var g = c.createElement("body"); g.id = "vpw-test-b"; g.style.cssText = "overflow:scroll"; var f = c.createElement("div"); f.id = "vpw-test-d"; f.style.cssText = "position:absolute;top:-1000px"; f.innerHTML = "<style>@media(" + b + ":" + d["client" + a] + "px){body#vpw-test-b div#vpw-test-d{" + b + ":7px!important}}</style>"; g.appendChild(f); d.insertBefore(g, c.head); a = 7 == f["offset" + a] ? d["client" + a] : window["inner" + a]; d.removeChild(g) } else a = window["inner" + a]; return a } window.addEventListener("orientationchange", onOrientationChange); function onOrientationChange() { window.matchMedia("(orientation: portrait)").matches && sizeHandler(); window.matchMedia("(orientation: landscape)").matches && sizeHandler() } function isIpad() { var a = -1 !== navigator.userAgent.toLowerCase().indexOf("ipad"); return !a && navigator.userAgent.match(/Mac/) && navigator.maxTouchPoints && 2 < navigator.maxTouchPoints ? !0 : a } function isMobile() { return isIpad() ? !0 : navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i) || navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/BlackBerry/i) || navigator.userAgent.match(/Windows Phone/i) ? !0 : !1 } function getNearestNumber(a, b) { if (2 > (c = a.length)) return c - 1; for (var c, d = Math.abs(a[--c] - b); c-- && !(d < (d = Math.abs(a[c] - b)));); return c + 1 } function isChrome() { return /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor) } function isIOS() { if (isIpad()) return !0; for (var a = "iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";"); a.length;) if (navigator.platform === a.pop()) return s_bIsIphone = !0; return s_bIsIphone = !1 } function isRetina() { s_bIsRetina = matchMedia("(-webkit-min-device-pixel-ratio: 2), (min-device-pixel-ratio: 2), (min-resolution: 192dpi)").matches ? !0 : !1 } function getIOSWindowHeight() { return document.documentElement.clientWidth / window.innerWidth * window.innerHeight } function getHeightOfIOSToolbars() { var a = (0 === window.orientation ? screen.height : screen.width) - getIOSWindowHeight(); return 1 < a ? a : 0 } function sizeHandler() { window.scrollTo(0, 1); if ($("#canvas")) { var a = null !== platform.name && "safari" === platform.name.toLowerCase() ? getIOSWindowHeight() : getSize("Height"); var b = getSize("Width"); s_bFocus && _checkOrientation(b, a); var c = Math.min(a / CANVAS_HEIGHT, b / CANVAS_WIDTH), d = Math.round(CANVAS_WIDTH * c); c = Math.round(CANVAS_HEIGHT * c); if (c < a) { var g = a - c; c += g; d += CANVAS_WIDTH / CANVAS_HEIGHT * g } else d < b && (g = b - d, d += g, c += CANVAS_HEIGHT / CANVAS_WIDTH * g); g = a / 2 - c / 2; var f = b / 2 - d / 2, k = CANVAS_WIDTH / d; if (f * k < -EDGEBOARD_X || g * k < -EDGEBOARD_Y) c = Math.min(a / (CANVAS_HEIGHT - 2 * EDGEBOARD_Y), b / (CANVAS_WIDTH - 2 * EDGEBOARD_X)), d = Math.round(CANVAS_WIDTH * c), c = Math.round(CANVAS_HEIGHT * c), g = (a - c) / 2, f = (b - d) / 2, k = CANVAS_WIDTH / d; s_iOffsetX = -1 * f * k; s_iOffsetY = -1 * g * k; 0 <= g && (s_iOffsetY = 0); 0 <= f && (s_iOffsetX = 0); null !== s_oInterface && s_oInterface.refreshButtonPos(s_iOffsetX, s_iOffsetY); null !== s_oMenu && s_oMenu.refreshButtonPos(s_iOffsetX, s_iOffsetY); null !== s_oSelectPlayers && s_oSelectPlayers.refreshButtonPos(s_iOffsetX, s_iOffsetY); s_bIsIphone && s_oStage ? (canvas = document.getElementById("canvas"), s_oStage.canvas.width = 2 * d, s_oStage.canvas.height = 2 * c, canvas.style.width = d + "px", canvas.style.height = c + "px", b = Math.min(d / CANVAS_WIDTH, c / CANVAS_HEIGHT), s_iScaleFactor = 2 * b, s_oStage.scaleX = s_oStage.scaleY = 2 * b) : s_bMobile || isChrome() ? ($("#canvas").css("width", d + "px"), $("#canvas").css("height", c + "px")) : s_oStage && (s_oStage.canvas.width = d, s_oStage.canvas.height = c, s_iScaleFactor = Math.min(d / CANVAS_WIDTH, c / CANVAS_HEIGHT), s_oStage.scaleX = s_oStage.scaleY = s_iScaleFactor); 0 > g || (g = (a - c) / 2); $("#canvas").css("top", g + "px"); $("#canvas").css("left", f + "px"); fullscreenHandler() } } function _checkOrientation(a, b) { s_bMobile && ENABLE_CHECK_ORIENTATION && (a > b ? "landscape" === $(".orientation-msg-container").attr("data-orientation") ? ($(".orientation-msg-container").css("display", "none"), s_oMain.startUpdate()) : ($(".orientation-msg-container").css("display", "block"), s_oMain.stopUpdate()) : "portrait" === $(".orientation-msg-container").attr("data-orientation") ? ($(".orientation-msg-container").css("display", "none"), s_oMain.startUpdate()) : ($(".orientation-msg-container").css("display", "block"), s_oMain.stopUpdate())) } function playSound(a, b, c) { return !1 === DISABLE_SOUND_MOBILE || !1 === s_bMobile ? (s_aSounds[a].play(), s_aSounds[a].volume(b), s_aSounds[a].loop(c), s_aSounds[a]) : null } function stopSound(a) { !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || s_aSounds[a].stop() } function setVolume(a, b) { !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || s_aSounds[a].volume(b) } function setMute(a, b) { !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || s_aSounds[a].mute(b) } createjs.Tween.pauseAllTweens = function() { for (var a = 0, b = createjs.Tween._tweens.slice().reverse(), c; c = b[a++];) pausedTweenObjs.push(c), !1 === c.ignoreGlobalPause && c.setPaused(!0) }; createjs.Tween.resumeAllTweens = function() { for (var a = 0, b; b = pausedTweenObjs[a++];) b.setPaused(!1); pausedTweenObjs.length = 0 }; function setVolume(a, b) { if (!1 === DISABLE_SOUND_MOBILE || !1 === s_bMobile) a.volume = b } function setMute(a, b) { !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || a.setMute(b) } function createBitmap(a, b, c) { var d = new createjs.Bitmap(a), g = new createjs.Shape; b && c ? g.graphics.beginFill("#fff").drawRect(0, 0, b, c) : g.graphics.beginFill("#ff0").drawRect(0, 0, a.width, a.height); d.hitArea = g; return d } function createSprite(a, b, c, d, g, f) { a = null !== b ? new createjs.Sprite(a, b) : new createjs.Sprite(a); b = new createjs.Shape; b.graphics.beginFill("#000000").drawRect(-c, -d, g, f); a.hitArea = b; return a } function pad(a, b, c) { a += ""; return a.length >= b ? a : Array(b - a.length + 1).join(c || "0") + a } function randomSign() { return .5 >= Math.random() ? 1 : -1 } function randomFloatBetween(a, b, c) { "undefined" === typeof c && (c = 2); return parseFloat(Math.min(a + Math.random() * (b - a), b).toFixed(c)) } function randomIntBetween(a, b, c) { "undefined" === typeof c && (c = 2); return parseInt(Math.min(a + Math.random() * (b - a), b).toFixed(c)) } function rotateVector2D(a, b) { var c = b.getX() * Math.cos(a) + b.getY() * Math.sin(a), d = b.getX() * -Math.sin(a) + b.getY() * Math.cos(a); b.set(c, d) } function tweenVectorsOnX(a, b, c) { return a + c * (b - a) } function shuffle(a) { for (var b = a.length, c, d; 0 !== b;) d = Math.floor(Math.random() * b), --b, c = a[b], a[b] = a[d], a[d] = c; return a } function centerBetweenPointsV2(a, b) { var c = new CVector2; c.set(.5 * (a.getX() + b.getX()), .5 * (a.getY() + b.getY())); return c } function bubbleSort(a) { do { var b = !1; for (var c = 0; c < a.length - 1; c++) a[c] > a[c + 1] && (b = a[c], a[c] = a[c + 1], a[c + 1] = b, b = !0) } while (b) } function compare(a, b) { return a.index > b.index ? -1 : a.index < b.index ? 1 : 0 } function easeLinear(a, b, c, d) { return c * a / d + b } function easeInQuad(a, b, c, d) { return c * (a /= d) * a + b } function easeInSine(a, b, c, d) { return -c * Math.cos(a / d * (Math.PI / 2)) + c + b } function easeInCubic(a, b, c, d) { return c * (a /= d) * a * a + b } function getTrajectoryPoint(a, b) { var c = new createjs.Point, d = (1 - a) * (1 - a), g = a * a; c.x = d * b.start.x + 2 * (1 - a) * a * b.traj.x + g * b.end.x; c.y = d * b.start.y + 2 * (1 - a) * a * b.traj.y + g * b.end.y; return c } function formatTime(a) { a /= 1E3; var b = Math.floor(a / 60); a = parseFloat(a - 60 * b).toFixed(1); var c = ""; c = 10 > b ? c + ("0" + b + ":") : c + (b + ":"); return 10 > a ? c + ("0" + a) : c + a } function degreesToRadians(a) { return a * Math.PI / 180 } function checkRectCollision(a, b) { var c = getBounds(a, .9); var d = getBounds(b, .98); return calculateIntersection(c, d) } function calculateIntersection(a, b) { var c, d, g, f; var k = a.x + (c = a.width / 2); var m = a.y + (d = a.height / 2); var e = b.x + (g = b.width / 2); var t = b.y + (f = b.height / 2); k = Math.abs(k - e) - (c + g); m = Math.abs(m - t) - (d + f); return 0 > k && 0 > m ? (k = Math.min(Math.min(a.width, b.width), -k), m = Math.min(Math.min(a.height, b.height), -m), { x: Math.max(a.x, b.x), y: Math.max(a.y, b.y), width: k, height: m, rect1: a, rect2: b }) : null } function getBounds(a, b) { var c = { x: Infinity, y: Infinity, width: 0, height: 0 }; if (a instanceof createjs.Container) { c.x2 = -Infinity; c.y2 = -Infinity; var d = a.children, g = d.length, f; for (f = 0; f < g; f++) { var k = getBounds(d[f], 1); k.x < c.x && (c.x = k.x); k.y < c.y && (c.y = k.y); k.x + k.width > c.x2 && (c.x2 = k.x + k.width); k.y + k.height > c.y2 && (c.y2 = k.y + k.height) } Infinity == c.x && (c.x = 0); Infinity == c.y && (c.y = 0); Infinity == c.x2 && (c.x2 = 0); Infinity == c.y2 && (c.y2 = 0); c.width = c.x2 - c.x; c.height = c.y2 - c.y; delete c.x2; delete c.y2 } else { if (a instanceof createjs.Bitmap) { g = a.sourceRect || a.image; f = g.width * b; var m = g.height * b } else if (a instanceof createjs.Sprite) if (a.spriteSheet._frames && a.spriteSheet._frames[a.currentFrame] && a.spriteSheet._frames[a.currentFrame].image) { g = a.spriteSheet.getFrame(a.currentFrame); f = g.rect.width; m = g.rect.height; d = g.regX; var e = g.regY } else c.x = a.x || 0, c.y = a.y || 0; else c.x = a.x || 0, c.y = a.y || 0; d = d || 0; f = f || 0; e = e || 0; m = m || 0; c.regX = d; c.regY = e; g = a.localToGlobal(0 - d, 0 - e); k = a.localToGlobal(f - d, m - e); f = a.localToGlobal(f - d, 0 - e); d = a.localToGlobal(0 - d, m - e); c.x = Math.min(Math.min(Math.min(g.x, k.x), f.x), d.x); c.y = Math.min(Math.min(Math.min(g.y, k.y), f.y), d.y); c.width = Math.max(Math.max(Math.max(g.x, k.x), f.x), d.x) - c.x; c.height = Math.max(Math.max(Math.max(g.y, k.y), f.y), d.y) - c.y } return c } function NoClickDelay(a) { this.element = a; window.Touch && this.element.addEventListener("touchstart", this, !1) } function shuffle(a) { for (var b = a.length, c, d; 0 < b;) d = Math.floor(Math.random() * b), b--, c = a[b], a[b] = a[d], a[d] = c; return a } NoClickDelay.prototype = { handleEvent: function(a) { switch (a.type) { case "touchstart": this.onTouchStart(a); break; case "touchmove": this.onTouchMove(a); break; case "touchend": this.onTouchEnd(a) } }, onTouchStart: function(a) { a.preventDefault(); this.moved = !1; this.element.addEventListener("touchmove", this, !1); this.element.addEventListener("touchend", this, !1) }, onTouchMove: function(a) { this.moved = !0 }, onTouchEnd: function(a) { this.element.removeEventListener("touchmove", this, !1); this.element.removeEventListener("touchend", this, !1); if (!this.moved) { a = document.elementFromPoint(a.changedTouches[0].clientX, a.changedTouches[0].clientY); 3 == a.nodeType && (a = a.parentNode); var b = document.createEvent("MouseEvents"); b.initEvent("click", !0, !0); a.dispatchEvent(b) } } }; (function() { function a(c) { var d = { focus: "visible", focusin: "visible", pageshow: "visible", blur: "hidden", focusout: "hidden", pagehide: "hidden" }; c = c || window.event; c.type in d ? document.body.className = d[c.type] : (document.body.className = this[b] ? "hidden" : "visible", "hidden" === document.body.className ? (s_oMain.stopUpdate(), s_bFocus = !1) : (s_oMain.startUpdate(), s_bFocus = !0)) } var b = "hidden"; b in document ? document.addEventListener("visibilitychange", a) : (b = "mozHidden") in document ? document.addEventListener("mozvisibilitychange", a) : (b = "webkitHidden") in document ? document.addEventListener("webkitvisibilitychange", a) : (b = "msHidden") in document ? document.addEventListener("msvisibilitychange", a) : "onfocusin" in document ? document.onfocusin = document.onfocusout = a : window.onpageshow = window.onpagehide = window.onfocus = window.onblur = a })(); function ctlArcadeResume() { null !== s_oMain && s_oMain.startUpdate() } function ctlArcadePause() { null !== s_oMain && s_oMain.stopUpdate() } function getParamValue(a) { for (var b = window.location.search.substring(1).split("&"), c = 0; c < b.length; c++) { var d = b[c].split("="); if (d[0] == a) return d[1] } } String.prototype.format = function() { for (var a = this, b = arguments.length; b--;) a = a.replace(new RegExp("\\{" + b + "\\}", "gm"), arguments[b]); return a }; function radiansToDegree(a) { return 180 / Math.PI * a } function distance(a, b) { var c = a.getX() - b.getX(), d = a.getY() - b.getY(); return Math.sqrt(c * c + d * d) } function fixEnemyTremble(a, b) { var c = !1; distanceBetween2Points(b.m_pCenter().getX(), a.getY(), b.m_pCenter().getX(), b.m_pCenter().getY()) <= b.getLength() && (c = !0); return c } function distanceBetween2Points(a, b, c, d) { return Math.sqrt(Math.pow(c - a, 2) + Math.pow(d - b, 2)) } function collideEdgeWithCircle(a, b, c) { a = closestPointOnLine(a.getPointA(), a.getPointB(), b); b = distanceV2(b, a); return c < b ? null : { distance: b, closest_point: a } } function closestPointOnLine(a, b, c) { var d = new CVector2, g = new CVector2; d.setV(a); g.setV(b); var f = new CVector2; f.setV(c); f.subtract(a); c = new CVector2; c.setV(b); c.subtract(a); c.normalize(); f = dotProductV2(c, f); if (0 >= f) return d; if (f >= distanceV2(a, b)) return g; c.scalarProduct(f); c.addV(a); return c } function dotProductV2(a, b) { return a.getX() * b.getX() + a.getY() * b.getY() } function distanceV2(a, b) { return Math.sqrt((b.getX() - a.getX()) * (b.getX() - a.getX()) + (b.getY() - a.getY()) * (b.getY() - a.getY())) } function reflectVectorV2(a, b) { var c = dotProductV2(a, b); a.set(a.getX() - 2 * c * b.getX(), a.getY() - 2 * c * b.getY()); return a } function angleBetweenVectors(a, b) { var c = Math.acos(dotProductV2(a, b) / (a.length() * b.length())); return 1 == isNaN(c) ? 0 : c } function distanceV2WithoutSQRT(a, b) { return (b.getX() - a.getX()) * (b.getX() - a.getX()) + (b.getY() - a.getY()) * (b.getY() - a.getY()) } function classifySphere(a, b, c, d) { a = b.getX() * a.getX() + b.getY() * a.getY() + planeDistance(b, c); return Math.abs(a) < d ? 0 <= a ? "INTERSECT FRONT" : "INTERSECT BEHIND" : a >= d ? "FRONT" : "BEHIND" } function planeDistance(a, b) { return -(a.getX() * b.getX() + a.getY() * b.getY()) } function saveItem(a, b) { s_bStorageAvailable && localStorage.setItem(a, b) } function getItem(a) { return s_bStorageAvailable ? localStorage.getItem(a) : null } function fullscreenHandler() { ENABLE_FULLSCREEN && screenfull.isEnabled && (s_bFullscreen = screen.height < window.innerHeight + 3 && screen.height > window.innerHeight - 3 ? !0 : !1, null !== s_oInterface && s_oInterface.resetFullscreenBut(), null !== s_oMenu && s_oMenu.resetFullscreenBut(), null !== s_oSelectPlayers && s_oSelectPlayers.resetFullscreenBut()) } if (screenfull.isEnabled) screenfull.on("change", function() { s_bFullscreen = screenfull.isFullscreen; null !== s_oInterface && s_oInterface.resetFullscreenBut(); null !== s_oMenu && s_oMenu.resetFullscreenBut(); null !== s_oSelectPlayers && s_oSelectPlayers.resetFullscreenBut() }); function CSpriteLibrary() { var a = {}, b, c, d, g, f, k; this.init = function(m, e, t) { b = {}; d = c = 0; g = m; f = e; k = t }; this.addSprite = function(m, e) { if (!a.hasOwnProperty(m)) { var t = new Image; a[m] = b[m] = { szPath: e, oSprite: t, bLoaded: !1 }; c++ } }; this.getSprite = function(m) { return a.hasOwnProperty(m) ? a[m].oSprite : null }; this._onSpritesLoaded = function() { c = 0; f.call(k) }; this._onSpriteLoaded = function() { g.call(k); ++d === c && this._onSpritesLoaded() }; this.loadSprites = function() { for (var m in b) b[m].oSprite.oSpriteLibrary = this, b[m].oSprite.szKey = m, b[m].oSprite.onload = function() { this.oSpriteLibrary.setLoaded(this.szKey); this.oSpriteLibrary._onSpriteLoaded(this.szKey) }, b[m].oSprite.onerror = function(e) { var t = e.currentTarget; setTimeout(function() { b[t.szKey].oSprite.src = b[t.szKey].szPath }, 500) }, b[m].oSprite.src = b[m].szPath }; this.setLoaded = function(m) { a[m].bLoaded = !0 }; this.isLoaded = function(m) { return a[m].bLoaded }; this.getNumSprites = function() { return c } } var CANVAS_WIDTH = 1360, CANVAS_HEIGHT = 840, EDGEBOARD_X = 120, EDGEBOARD_Y = 122, PRIMARY_FONT = "flashrogersstraight", FPS = 30, FPS_TIME = 1E3 / FPS, DISABLE_SOUND_MOBILE = !1, s_b2Players, NUM_PIECES = 15, BLACK_PIECE = 0, WHITE_PIECE = 1, TRIANGLE_UP = 1, TRIANGLE_DOWN = -1, BAR_UP = 0, BAR_DOWN = 1, NUM_TRIANGLES = 24, FINAL_CELL_WHITE = 24, FINAL_CELL_BLACK = -1, WHITE_DICES = 0, RED_DICES = 1, X_TRIANGLE_LEFT = 290, X_TRIANGLE_RIGHT = 759, Y_TRIANGLE_UP = 128, Y_TRIANGLE_DOWN = 712, X_OFFBOARD = 1155, Y_OFFBOARD_DOWN = 458, Y_OFFBOARD_UP = 143, X_INTERFACE_PLAYER = 180, Y_INTERFACE_PLAYER_1 = 133, Y_INTERFACE_PLAYER_2 = 449, X_INTERFACE_PLAYER_END = CANVAS_WIDTH - 230, TIME_LOOP_WAIT = 1E3, MIN_TIME_THINK = 700, MAX_TIME_THINK = 2300, MS_DISTRIBUTION, CELL_0 = 0, CELL_1 = 1, CELL_2 = 2, CELL_3 = 3, CELL_4 = 4, CELL_5 = 5, CELL_6 = 6, CELL_7 = 7, CELL_8 = 8, CELL_9 = 9, CELL_10 = 10, CELL_11 = 11, CELL_12 = 12, CELL_13 = 13, CELL_14 = 14, CELL_15 = 15, CELL_16 = 16, CELL_17 = 17, CELL_18 = 18, CELL_19 = 19, CELL_20 = 20, CELL_21 = 21, CELL_22 = 22, CELL_23 = 23, MULTIPLIER_SCORE, STATE_LOADING = 0, STATE_MENU = 1, STATE_HELP = 1, STATE_GAME = 3, STATE_LEVEL_SELECTION = 4, ON_MOUSE_DOWN = 0, ON_MOUSE_UP = 1, ON_MOUSE_OVER = 2, ON_MOUSE_OUT = 3, ON_DRAG_START = 4, ON_DRAG_END = 5, MOVES_TYPE_FILL = "fill", MOVES_TYPE_ADD = "add", MOVES_TYPE_HIT = "hit", MOVES_TYPE_BEAR = "bear", MOVES_TYPE_EXTRABEAR = "extrabear", MOVES_TYPE_COLLISION = "collision", RULE_BROKEN_NONE = "none", RULE_BROKEN_HIGHER_DICE = "higher", RULE_BROKEN_BOTH_DICE = "bothdice", RULE_BROKEN_MOST_DICE = "most", SOUNDTRACK_VOLUME_IN_GAME = 1, ENABLE_FULLSCREEN, ENABLE_CHECK_ORIENTATION; function CPreloader() { var a, b, c, d, g, f, k, m, e; this._init = function() { s_oSpriteLibrary.init(this._onImagesLoaded, this._onAllImagesLoaded, this); s_oSpriteLibrary.addSprite("progress_bar", "./sprites/progress_bar.png"); s_oSpriteLibrary.addSprite("200x200", "./sprites/200x200.jpg"); s_oSpriteLibrary.loadSprites(); e = new createjs.Container; s_oStage.addChild(e) }; this.unload = function() { e.removeAllChildren() }; this._onImagesLoaded = function() {}; this._onAllImagesLoaded = function() { this.attachSprites(); s_oMain.preloaderReady() }; this.attachSprites = function() { var t = new createjs.Shape; t.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); e.addChild(t); t = s_oSpriteLibrary.getSprite("200x200"); k = createBitmap(t); k.regX = .5 * t.width; k.regY = .5 * t.height; k.x = CANVAS_WIDTH / 2; k.y = CANVAS_HEIGHT / 2 - 180; e.addChild(k); m = new createjs.Shape; m.graphics.beginFill("rgba(0,0,0,0.01)").drawRoundRect(k.x - 100, k.y - 100, 200, 200, 10); e.addChild(m); k.mask = m; t = s_oSpriteLibrary.getSprite("progress_bar"); d = createBitmap(t); d.x = CANVAS_WIDTH / 2 - t.width / 2; d.y = CANVAS_HEIGHT / 2 + 50; e.addChild(d); a = t.width; b = t.height; g = new createjs.Shape; g.graphics.beginFill("rgba(0,0,0,0.01)").drawRect(d.x, d.y, 1, b); e.addChild(g); d.mask = g; c = new createjs.Text("", "30px " + PRIMARY_FONT, "#fff"); c.x = CANVAS_WIDTH / 2; c.y = CANVAS_HEIGHT / 2 + 100; c.textBaseline = "alphabetic"; c.textAlign = "center"; e.addChild(c); f = new createjs.Shape; f.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); e.addChild(f); createjs.Tween.get(f).to({ alpha: 0 }, 500).call(function() { createjs.Tween.removeTweens(f); e.removeChild(f) }) }; this.refreshLoader = function(t) { c.text = t + "%"; 100 === t && (s_oMain._onRemovePreloader(), c.visible = !1, d.visible = !1); g.graphics.clear(); t = Math.floor(t * a / 100); g.graphics.beginFill("rgba(0,0,0,0.01)").drawRect(d.x, d.y, t, b) }; this._init() } function CMain(a) { var b, c = 0, d = 0, g = STATE_LOADING, f, k; this.initContainer = function() { s_oCanvas = document.getElementById("canvas"); s_oStage = new createjs.Stage(s_oCanvas); s_oStage.preventSelection = !0; createjs.Touch.enable(s_oStage, !0); s_bMobile = isMobile(); !1 === s_bMobile ? s_oStage.enableMouseOver(20) : createjs.Touch.enable(s_oStage, !0); s_iPrevTime = (new Date).getTime(); createjs.Ticker.addEventListener("tick", this._update); createjs.Ticker.framerate = FPS; navigator.userAgent.match(/Windows Phone/i) && (DISABLE_SOUND_MOBILE = !0); s_oSpriteLibrary = new CSpriteLibrary; f = new CPreloader; }; this.preloaderReady = function() { b = !0; s_oMain._loadImages(); !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || s_oMain._initSounds() }; this.soundLoaded = function() { c++; f.refreshLoader(Math.floor(c / d * 100)) }; this._initSounds = function() { Howler.mute(!s_bAudioActive); s_aSoundsInfo = []; s_aSoundsInfo.push({ path: "./sounds/", filename: "press_button", loop: !1, volume: 1, ingamename: "press_button" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "game_over", loop: !1, volume: 1, ingamename: "game_over" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "win", loop: !1, volume: 1, ingamename: "win" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "click_cell", loop: !1, volume: 1, ingamename: "click_cell" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "dices", loop: !1, volume: 1, ingamename: "dices" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "positive_beep", loop: !1, volume: 1, ingamename: "positive_beep" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "negative_beep", loop: !1, volume: 1, ingamename: "negative_beep" }); d += s_aSoundsInfo.length; s_aSounds = []; for (var e = 0; e < s_aSoundsInfo.length; e++) this.tryToLoadSound(s_aSoundsInfo[e], !1) }; this.tryToLoadSound = function(e, t) { setTimeout(function() { s_aSounds[e.ingamename] = new Howl({ src: [e.path + e.filename + ".mp3"], autoplay: !1, preload: !0, loop: e.loop, volume: e.volume, onload: s_oMain.soundLoaded, onloaderror: function(D, n) { for (var y = 0; y < s_aSoundsInfo.length; y++) if (D === s_aSounds[s_aSoundsInfo[y].ingamename]._sounds[0]._id) { s_oMain.tryToLoadSound(s_aSoundsInfo[y], !0); break } }, onplayerror: function(D) { for (var n = 0; n < s_aSoundsInfo.length; n++) if (0 < s_aSounds[s_aSoundsInfo[n].ingamename]._sounds.length && D === s_aSounds[s_aSoundsInfo[n].ingamename]._sounds[0]._id) { s_oMain.tryToLoadSound(s_aSoundsInfo[n], !0); break } else document.querySelector("#block_game").style.display = "none" } }) }, t ? 200 : 0) }; this._loadImages = function() { s_oSpriteLibrary.init(this._onImagesLoaded, this._onAllImagesLoaded, this); s_oSpriteLibrary.addSprite("msg_box", "./sprites/msg_box.png"); s_oSpriteLibrary.addSprite("alert_box", "./sprites/alert_box.png"); s_oSpriteLibrary.addSprite("ctl_logo", "./sprites/ctl_logo.png"); s_oSpriteLibrary.addSprite("but_info", "./sprites/but_info.png"); s_oSpriteLibrary.addSprite("but_yes_big", "./sprites/but_yes_big.png"); s_oSpriteLibrary.addSprite("bg_menu", "./sprites/bg_menu.jpg"); s_oSpriteLibrary.addSprite("bg_game", "./sprites/bg_game.jpg"); s_oSpriteLibrary.addSprite("but_exit", "./sprites/but_exit.png"); s_oSpriteLibrary.addSprite("audio_icon", "./sprites/audio_icon.png"); s_oSpriteLibrary.addSprite("but_fullscreen", "./sprites/but_fullscreen.png"); s_oSpriteLibrary.addSprite("but_p1", "./sprites/but_p1.png"); s_oSpriteLibrary.addSprite("but_p2", "./sprites/but_p2.png"); s_oSpriteLibrary.addSprite("but_play", "./sprites/but_play.png"); s_oSpriteLibrary.addSprite("but_restart", "./sprites/but_restart.png"); s_oSpriteLibrary.addSprite("but_home", "./sprites/but_home.png"); s_oSpriteLibrary.addSprite("but_speed", "./sprites/but_speed.png"); s_oSpriteLibrary.addSprite("white_piece", "./sprites/white_piece.png"); s_oSpriteLibrary.addSprite("red_piece", "./sprites/red_piece.png"); s_oSpriteLibrary.addSprite("highlight", "./sprites/highlight.png"); s_oSpriteLibrary.addSprite("triangle_white", "./sprites/triangle_white.png"); s_oSpriteLibrary.addSprite("triangle_red", "./sprites/triangle_red.png"); s_oSpriteLibrary.addSprite("but_dice", "./sprites/but_dice.png"); s_oSpriteLibrary.addSprite("launch_dices_white", "./sprites/launch_dices_white.png"); s_oSpriteLibrary.addSprite("launch_dices_red", "./sprites/launch_dices_red.png"); s_oSpriteLibrary.addSprite("but_no", "./sprites/but_no.png"); s_oSpriteLibrary.addSprite("turn_p1", "./sprites/turn_p1.png"); s_oSpriteLibrary.addSprite("turn_p2", "./sprites/turn_p2.png"); s_oSpriteLibrary.addSprite("turn_cpu", "./sprites/turn_cpu.png"); s_oSpriteLibrary.addSprite("light_turn", "./sprites/turn_selection.png"); s_oSpriteLibrary.addSprite("bg_select_mode", "./sprites/bg_select_mode.jpg"); s_oSpriteLibrary.addSprite("dice_white_a_1", "./sprites/dice_white_a_1.png"); s_oSpriteLibrary.addSprite("dice_white_a_2", "./sprites/dice_white_a_2.png"); s_oSpriteLibrary.addSprite("dice_white_a_3", "./sprites/dice_white_a_3.png"); s_oSpriteLibrary.addSprite("dice_white_a_4", "./sprites/dice_white_a_4.png"); s_oSpriteLibrary.addSprite("dice_white_a_5", "./sprites/dice_white_a_5.png"); s_oSpriteLibrary.addSprite("dice_white_a_6", "./sprites/dice_white_a_6.png"); s_oSpriteLibrary.addSprite("dice_white_b_1", "./sprites/dice_white_b_1.png"); s_oSpriteLibrary.addSprite("dice_white_b_2", "./sprites/dice_white_b_2.png"); s_oSpriteLibrary.addSprite("dice_white_b_3", "./sprites/dice_white_b_3.png"); s_oSpriteLibrary.addSprite("dice_white_b_4", "./sprites/dice_white_b_4.png"); s_oSpriteLibrary.addSprite("dice_white_b_5", "./sprites/dice_white_b_5.png"); s_oSpriteLibrary.addSprite("dice_white_b_6", "./sprites/dice_white_b_6.png"); s_oSpriteLibrary.addSprite("dice_red_a_1", "./sprites/dice_red_a_1.png"); s_oSpriteLibrary.addSprite("dice_red_a_2", "./sprites/dice_red_a_2.png"); s_oSpriteLibrary.addSprite("dice_red_a_3", "./sprites/dice_red_a_3.png"); s_oSpriteLibrary.addSprite("dice_red_a_4", "./sprites/dice_red_a_4.png"); s_oSpriteLibrary.addSprite("dice_red_a_5", "./sprites/dice_red_a_5.png"); s_oSpriteLibrary.addSprite("dice_red_a_6", "./sprites/dice_red_a_6.png"); s_oSpriteLibrary.addSprite("dice_red_b_1", "./sprites/dice_red_b_1.png"); s_oSpriteLibrary.addSprite("dice_red_b_2", "./sprites/dice_red_b_2.png"); s_oSpriteLibrary.addSprite("dice_red_b_3", "./sprites/dice_red_b_3.png"); s_oSpriteLibrary.addSprite("dice_red_b_4", "./sprites/dice_red_b_4.png"); s_oSpriteLibrary.addSprite("dice_red_b_5", "./sprites/dice_red_b_5.png"); s_oSpriteLibrary.addSprite("dice_red_b_6", "./sprites/dice_red_b_6.png"); d += s_oSpriteLibrary.getNumSprites(); s_oSpriteLibrary.loadSprites() }; this._onImagesLoaded = function() { c++; f.refreshLoader(Math.floor(c / d * 100)) }; this._onAllImagesLoaded = function() {}; this._onRemovePreloader = function() { f.unload(); this.gotoMenu() }; this.onAllPreloaderImagesLoaded = function() { this._loadImages() }; this.gotoMenu = function() { new CMenu; g = STATE_MENU }; this.gotoGame = function() { k = new CGame(m); g = STATE_GAME }; this.gotoSelectPlayers = function() { new CSelectPlayers }; this.gotoLevelMenu = function() { new CLevelMenu; g = STATE_LEVEL_SELECTION }; this.gotoSelectMode = function() { new CSelectMode }; this.gotoHelp = function() { new CHelp; g = STATE_HELP }; this.stopUpdate = function() { b = !1; createjs.Ticker.paused = !0; $("#block_game").css("display", "block"); !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || Howler.mute(!0) }; this.startUpdate = function() { s_iPrevTime = (new Date).getTime(); b = !0; createjs.Ticker.paused = !1; $("#block_game").css("display", "none"); (!1 === DISABLE_SOUND_MOBILE || !1 === s_bMobile) && s_bAudioActive && Howler.mute(!1) }; this._update = function(e) { if (!1 !== b) { var t = (new Date).getTime(); s_iTimeElaps = t - s_iPrevTime; s_iCntTime += s_iTimeElaps; s_iCntFps++; s_iPrevTime = t; 1E3 <= s_iCntTime && (s_iCurFps = s_iCntFps, s_iCntTime -= 1E3, s_iCntFps = 0); g === STATE_GAME && k.update(); s_oStage.update(e) } }; s_oMain = this; ENABLE_CHECK_ORIENTATION = a.check_orientation; ENABLE_FULLSCREEN = a.fullscreen; MULTIPLIER_SCORE = a.multiplier_score; s_bAudioActive = a.audio_enable_on_startup; var m = a; this.initContainer() } var s_bMobile, s_bAudioActive = !0, s_iCntTime = 0, s_iTimeElaps = 0, s_iPrevTime = 0, s_iCntFps = 0, s_iCurFps = 0, s_iLastLevel = 1, s_bFullscreen = !1, s_bStorageAvailable = !0, s_oDrawLayer, s_oStage, s_oMain, s_oSpriteLibrary, s_oCanvas, s_aSounds, s_aSoundsInfo; function CToggle(a, b, c, d, g) { var f, k, m, e, t, D, n; this._init = function(y, z, w, H, F) { t = []; D = []; var J = new createjs.SpriteSheet({ images: [w], frames: { width: w.width / 2, height: w.height, regX: w.width / 2 / 2, regY: w.height / 2 }, animations: { state_true: [0], state_false: [1] } }); f = H; n = createSprite(J, "state_" + f, w.width / 2 / 2, w.height / 2, w.width / 2, w.height); n.x = y; n.y = z; n.stop(); F.addChild(n); this._initListener() }; this.unload = function() { s_bMobile ? n.off("mousedown", k) : (n.off("mousedown", k), n.off("mouseover", e)); n.off("pressup", m); g.removeChild(n) }; this._initListener = function() { s_bMobile ? k = n.on("mousedown", this.buttonDown) : (k = n.on("mousedown", this.buttonDown), e = n.on("mouseover", this.buttonOver)); m = n.on("pressup", this.buttonRelease) }; this.addEventListener = function(y, z, w) { t[y] = z; D[y] = w }; this.setActive = function(y) { f = y; n.gotoAndStop("state_" + f) }; this.buttonRelease = function() { n.scaleX = 1; n.scaleY = 1; !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || playSound("press_button", 1, !1); f = !f; n.gotoAndStop("state_" + f); t[ON_MOUSE_UP] && t[ON_MOUSE_UP].call(D[ON_MOUSE_UP], f) }; this.buttonDown = function() { n.scaleX = .9; n.scaleY = .9; t[ON_MOUSE_DOWN] && t[ON_MOUSE_DOWN].call(D[ON_MOUSE_DOWN]) }; this.buttonOver = function(y) { s_bMobile || (y.target.cursor = "pointer") }; this.setPosition = function(y, z) { n.x = y; n.y = z }; this._init(a, b, c, d, g) } function CGfxButton(a, b, c, d) { var g, f, k, m, e, t, D, n, y; this._init = function(z, w, H, F) { y = g = !1; f = 1; t = []; D = []; n = createBitmap(H); n.x = z; n.y = w; n.scaleX = n.scaleY = f; n.regX = H.width / 2; n.regY = H.height / 2; F.addChild(n); this._initListener() }; this.unload = function() { s_bMobile ? n.off("mousedown", k) : (n.off("mousedown", k), n.off("mouseover", e)); n.off("pressup", m); d.removeChild(n) }; this.setVisible = function(z) { n.visible = z }; this.setClickable = function(z) { g = !z }; this._initListener = function() { s_bMobile ? k = n.on("mousedown", this.buttonDown) : (k = n.on("mousedown", this.buttonDown), e = n.on("mouseover", this.buttonOver)); m = n.on("pressup", this.buttonRelease) }; this.addEventListener = function(z, w, H) { t[z] = w; D[z] = H }; this.buttonRelease = function() { g || (n.scaleX = f, n.scaleY = f, t[ON_MOUSE_UP] && t[ON_MOUSE_UP].call(D[ON_MOUSE_UP])) }; this.buttonDown = function() { g || (n.scaleX = .9 * f, n.scaleY = .9 * f, y || playSound("press_button", 1, !1), t[ON_MOUSE_DOWN] && t[ON_MOUSE_DOWN].call(D[ON_MOUSE_DOWN])) }; this.buttonOver = function(z) { s_bMobile || g || (z.target.cursor = "pointer") }; this.pulseAnimation = function() { createjs.Tween.get(n, { loop: -1 }).to({ scaleX: .9 * f, scaleY: .9 * f }, 850, createjs.Ease.quadOut).to({ scaleX: f, scaleY: f }, 650, createjs.Ease.quadIn) }; this.setPosition = function(z, w) { n.x = z; n.y = w }; this.setX = function(z) { n.x = z }; this.setY = function(z) { n.y = z }; this.getButtonImage = function() { return n }; this.getX = function() { return n.x }; this.getY = function() { return n.y }; this.setMuted = function(z) { y = z }; this._init(a, b, c, d); return this } function CMenu() { var a, b, c, d, g, f, k, m, e, t, D, n, y, z, w = null, H = null; this._init = function() { s_b2Players = !1; e = createBitmap(s_oSpriteLibrary.getSprite("bg_menu")); s_oStage.addChild(e); var F = s_oSpriteLibrary.getSprite("but_play"); a = CANVAS_WIDTH / 2; b = CANVAS_HEIGHT - 80; t = new CGfxButton(a, b, F, s_oStage); t.pulseAnimation(); t.addEventListener(ON_MOUSE_DOWN, this._onButFriendlyRelease, this); F = s_oSpriteLibrary.getSprite("but_info"); k = F.width / 2 + 10; m = F.height / 2 + 10; y = new CGfxButton(CANVAS_WIDTH / 2, CANVAS_HEIGHT - 240, F, s_oStage); y.addEventListener(ON_MOUSE_UP, this._onCreditsBut, this); if (!1 === DISABLE_SOUND_MOBILE || !1 === s_bMobile) F = s_oSpriteLibrary.getSprite("audio_icon"), g = CANVAS_WIDTH - F.width / 4 - 10, f = F.height / 2 + 10, n = new CToggle(g, f, F, s_bAudioActive, s_oStage), n.addEventListener(ON_MOUSE_UP, this._onAudioToggle, this); F = window.document; var J = F.documentElement; w = J.requestFullscreen || J.mozRequestFullScreen || J.webkitRequestFullScreen || J.msRequestFullscreen; H = F.exitFullscreen || F.mozCancelFullScreen || F.webkitExitFullscreen || F.msExitFullscreen; !1 === ENABLE_FULLSCREEN && (w = !1); w && screenfull.isEnabled && (F = s_oSpriteLibrary.getSprite("but_fullscreen"), c = k + F.width / 2 + 5, d = F.height / 2 + 10, z = new CToggle(c, d, F, s_bFullscreen, s_oStage), z.addEventListener(ON_MOUSE_UP, this._onFullscreen, this)); D = new createjs.Shape; D.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); s_oStage.addChild(D); createjs.Tween.get(D).to({ alpha: 0 }, 1E3).call(function() { D.visible = !1 }); s_bStorageAvailable || new CMsgBox(TEXT_ERR_LS, s_oStage); this.refreshButtonPos(s_iOffsetX, s_iOffsetY) }; this.pulseTitle = function() { var F = this; (new createjs.Tween.get(void 0)).to({ scaleX: .9, scaleY: .9 }, 850, createjs.Ease.quadOut).to({ scaleX: 1, scaleY: 1 }, 650, createjs.Ease.quadIn).call(function() { F.pulseTitle() }) }; this.unload = function() { s_oStage.removeChild(void 0); t.unload(); t = null; D.visible = !1; y.unload(); if (!1 === DISABLE_SOUND_MOBILE || !1 === s_bMobile) n.unload(), n = null; w && screenfull.isEnabled && z.unload(); s_oStage.removeChild(e); s_oMenu = e = null }; this.refreshButtonPos = function(F, J) { t.setPosition(a, b - J); y.setPosition(k + F, J + m); !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || n.setPosition(g - F, J + f); w && screenfull.isEnabled && z.setPosition(c + F, d + J) }; this._onAudioToggle = function() { Howler.mute(s_bAudioActive); s_bAudioActive = !s_bAudioActive }; this._onCreditsBut = function() { new CCreditsPanel }; this.resetFullscreenBut = function() { z.setActive(s_bFullscreen) }; this._onFullscreen = function() { s_bFullscreen ? H.call(window.document) : w.call(window.document.documentElement); sizeHandler() }; this._onButFriendlyRelease = function() { this.unload(); $(s_oMain).trigger("start_session"); s_oMain.gotoSelectPlayers() }; s_oMenu = this; this._init() } var s_oMenu = null; function CGame(a) { var b, c, d, g, f = null, k, m, e, t, D, n, y, z, w, H, F, J, v, K, G, C, r, I, E, R, W, S, T, aa, X, Z = null, Y, Q, V, q; this._init = function() { MS_DISTRIBUTION = 300; Y = !1; aa = T = 0; k = !1; b = !0; v = D = d = 0; K = []; c = S = !1; var l = createBitmap(s_oSpriteLibrary.getSprite("bg_game")); s_oStage.addChild(l); w = z = 0; J = F = H = !1; m = new createjs.Container; s_oStage.addChild(m); r = []; C = new createjs.Container; s_oStage.addChild(C); r.push(new CBar(CANVAS_WIDTH / 2, CANVAS_HEIGHT / 2 - 265, BAR_UP, C)); r.push(new CBar(CANVAS_WIDTH / 2, CANVAS_HEIGHT / 2 + 265, BAR_DOWN, C)); e = []; e.push(new CTriangle(X_TRIANGLE_RIGHT + 310, Y_TRIANGLE_UP, m, CELL_0)); e.push(new CTriangle(X_TRIANGLE_RIGHT + 248, Y_TRIANGLE_UP, m, CELL_1)); e.push(new CTriangle(X_TRIANGLE_RIGHT + 186, Y_TRIANGLE_UP, m, CELL_2)); e.push(new CTriangle(X_TRIANGLE_RIGHT + 124, Y_TRIANGLE_UP, m, CELL_3)); e.push(new CTriangle(X_TRIANGLE_RIGHT + 62, Y_TRIANGLE_UP, m, CELL_4)); e.push(new CTriangle(X_TRIANGLE_RIGHT, Y_TRIANGLE_UP, m, CELL_5)); e.push(new CTriangle(X_TRIANGLE_LEFT + 310, Y_TRIANGLE_UP, m, CELL_6)); e.push(new CTriangle(X_TRIANGLE_LEFT + 248, Y_TRIANGLE_UP, m, CELL_7)); e.push(new CTriangle(X_TRIANGLE_LEFT + 186, Y_TRIANGLE_UP, m, CELL_8)); e.push(new CTriangle(X_TRIANGLE_LEFT + 124, Y_TRIANGLE_UP, m, CELL_9)); e.push(new CTriangle(X_TRIANGLE_LEFT + 62, Y_TRIANGLE_UP, m, CELL_10)); e.push(new CTriangle(X_TRIANGLE_LEFT, Y_TRIANGLE_UP, m, CELL_11)); e.push(new CTriangle(X_TRIANGLE_LEFT, Y_TRIANGLE_DOWN, m, CELL_12)); e.push(new CTriangle(X_TRIANGLE_LEFT + 62, Y_TRIANGLE_DOWN, m, CELL_13)); e.push(new CTriangle(X_TRIANGLE_LEFT + 124, Y_TRIANGLE_DOWN, m, CELL_14)); e.push(new CTriangle(X_TRIANGLE_LEFT + 186, Y_TRIANGLE_DOWN, m, CELL_15)); e.push(new CTriangle(X_TRIANGLE_LEFT + 248, Y_TRIANGLE_DOWN, m, CELL_16)); e.push(new CTriangle(X_TRIANGLE_LEFT + 310, Y_TRIANGLE_DOWN, m, CELL_17)); e.push(new CTriangle(X_TRIANGLE_RIGHT, Y_TRIANGLE_DOWN, m, CELL_18)); e.push(new CTriangle(X_TRIANGLE_RIGHT + 62, Y_TRIANGLE_DOWN, m, CELL_19)); e.push(new CTriangle(X_TRIANGLE_RIGHT + 124, Y_TRIANGLE_DOWN, m, CELL_20)); e.push(new CTriangle(X_TRIANGLE_RIGHT + 186, Y_TRIANGLE_DOWN, m, CELL_21)); e.push(new CTriangle(X_TRIANGLE_RIGHT + 248, Y_TRIANGLE_DOWN, m, CELL_22)); e.push(new CTriangle(X_TRIANGLE_RIGHT + 310, Y_TRIANGLE_DOWN, m, CELL_23)); t = new createjs.Container; s_oStage.addChild(t); n = [0, 0, 11, 11, 11, 11, 11, 16, 16, 16, 18, 18, 18, 18, 18, 23, 23, 12, 12, 12, 12, 12, 7, 7, 7, 5, 5, 5, 5, 5]; for (l = 0; l < NUM_PIECES; l++) K.push(new CPiece(X_OFFBOARD, Y_OFFBOARD_DOWN + 17 * l, WHITE_PIECE, t, l)); for (l = 0; l < NUM_PIECES; l++) K.push(new CPiece(X_OFFBOARD, Y_OFFBOARD_UP + 17 * l, BLACK_PIECE, t, l + NUM_PIECES)); R = new CDices(0); W = new CDices(1); X = new CAlertBox(s_oStage); l = s_oSpriteLibrary.getSprite("but_speed"); Q = new CGfxButton(CANVAS_WIDTH - 200, CANVAS_HEIGHT / 2, l, s_oStage); Q.addEventListener(ON_MOUSE_DOWN, this.onFastDistribution); g = new CInterface; this.initDistribution(); V = new CRuleFilter }; this.onFastDistribution = function() { Y = !0; (new createjs.Tween.get(Q.getButtonImage())).to({ x: CANVAS_WIDTH + 200 }, 300).call(Q.unload) }; this.initDistribution = function() { Y && (MS_DISTRIBUTION = 0); if (D < 2 * NUM_PIECES) { var l = K[D]; var u = n[D]; t.addChildAt(l.getPiece(), t.numChildren); l.movePieceDistribution(e[u].getX(), e[u].getY()); l.setTriangle(u); e[u].addPiece(l); D++ } else { y = 50 < randomFloatBetween(1, 100) ? !0 : !1; if (!Y) M.onFastDistribution(); g.onFocusTurn(y); (s_b2Players || y) && g.setVisibleButDice(!0); M.updateInput() } }; this.onClickedPiece = function(l) { if (!c) { playSound("click_cell", 1, !1); G = -1 !== l.getTriangle() && 24 !== l.getTriangle() ? e[l.getTriangle()].getLastPiece() : l.getColor() === WHITE_PIECE ? r[BAR_UP].getLastPiece() : r[BAR_DOWN].getLastPiece(); var u = G.getColor() === WHITE_PIECE ? BAR_UP : BAR_DOWN; if (0 < v) if (G.setOnTop(), !1 === k) { if (this.isPossibleMove(G)) { G.setClicked(!0); k = !0; var h = this.isPossibleMove(G); if (J) { if (0 < h[0].length) e[h[0][0].iFocusTriangle].onFocus(h[0][0]); if (1 < h[0].length && 2 > r[u].getNumPieces()) e[h[0][1].iFocusTriangle].onFocus(h[0][1]); if (2 < h[0].length && 2 > r[u].getNumPieces()) e[h[0][2].iFocusTriangle].onFocus(h[0][2]); if (3 < h[0].length && 2 > r[u].getNumPieces()) e[h[0][3].iFocusTriangle].onFocus(h[0][3]) } else { if (0 < h[0].length) e[h[0][0].iFocusTriangle].onFocus(h[0][0]); if (0 < h[1].length) e[h[1][0].iFocusTriangle].onFocus(h[1][0]); if (0 < h[2].length && 2 > r[u].getNumPieces()) e[h[2][0].iFocusTriangle].onFocus(h[2][0]) } 0 < h[3].length && (h[3][0].iFocusTriangle === FINAL_CELL_WHITE ? (l = s_oSpriteLibrary.getSprite("light_turn"), I = createBitmap(l, l.width, l.height), I.regX = 11, I.regY = 12, I.x = X_INTERFACE_PLAYER_END, I.y = Y_INTERFACE_PLAYER_2, I.on("mousedown", function() { M.onClickedTriangle(h[3][0]) }), I.on("rollover", function(B) { s_bMobile || (B.target.cursor = "pointer") }), I.on("rollout", function(B) { s_bMobile || (B.target.cursor = "default") }), s_oStage.addChild(I)) : (l = s_oSpriteLibrary.getSprite("light_turn"), E = createBitmap(l, l.width, l.height), E.regX = 11, E.regY = 12, E.x = X_INTERFACE_PLAYER_END, E.y = Y_INTERFACE_PLAYER_1, E.on("mousedown", function() { M.onClickedTriangle(h[3][0]) }), E.on("rollover", function(B) { s_bMobile || (B.target.cursor = "pointer") }), E.on("rollout", function(B) { s_bMobile || (B.target.cursor = "default") }), s_oStage.addChild(E))) } } else if (!0 === G.getStateClick()) { G.setClicked(!1); k = !1; s_oStage.removeChild(I); s_oStage.removeChild(E); for (var p = 0; p < e.length; p++) e[p].onIdle() } else { s_oStage.removeChild(I); s_oStage.removeChild(E); for (p = 0; p < e.length; p++) if (e[p].onIdle(), 0 < e[p].getNumPieces()) { u = e[p].getArrayPieces(); for (var x = 0; x < u.length; x++) u[x].setClicked(!1) } k = !1; this.onClickedPiece(l) } } }; this.isPossibleMove = function(l) { var u = l.getColor(); l = l.getTriangle(); if (u === WHITE_PIECE) { var h = 1; var p = FINAL_CELL_WHITE } else h = -1, p = FINAL_CELL_BLACK; var x = [ [], [], [], [] ], B; if (J)(B = e[l + z * h]) ? (1 >= B.getNumPieces() || B.getColor() === u) && x[0].push({ iFocusTriangle: l + z * h, cost: 1, aMoveTriangle: [l + z * h] }) : this.checkBearOff() && (l + z * h === p || this.checkPieceBefore(u, l)) && x[3].push({ iFocusTriangle: p, cost: 1, aMoveTriangle: [p] }), 0 < x[0].length && 1 < v && ((B = e[l + 2 * z * h]) ? (1 >= B.getNumPieces() || B.getColor() === u) && x[0].push({ iFocusTriangle: l + 2 * z * h, cost: 2, aMoveTriangle: [l + z * h, l + 2 * z * h] }) : this.checkBearOff() && (l + 2 * z * h === p || this.checkPieceBefore(u, l + z * h)) && x[3].push({ iFocusTriangle: p, cost: 2, aMoveTriangle: [l + z * h, p] })), 1 < x[0].length && 2 < v && ((B = e[l + 3 * z * h]) ? (1 >= B.getNumPieces() || B.getColor() === u) && x[0].push({ iFocusTriangle: l + 3 * z * h, cost: 3, aMoveTriangle: [l + z * h, l + 2 * z * h, l + 3 * z * h] }) : this.checkBearOff() && (l + 3 * z * h === p || this.checkPieceBefore(u, l + 2 * z * h)) && x[3].push({ iFocusTriangle: p, cost: 3, aMoveTriangle: [l + z * h, l + 2 * z * h, p] })), 2 < x[0].length && 3 < v && ((B = e[l + 4 * z * h]) ? (1 >= B.getNumPieces() || B.getColor() === u) && x[0].push({ iFocusTriangle: l + 4 * z * h, cost: 4, aMoveTriangle: [l + z * h, l + 2 * z * h, l + 3 * z * h, l + 4 * z * h] }) : this.checkBearOff() && (l + 4 * z * h === p || this.checkPieceBefore(u, l + 3 * z * h)) && x[3].push({ iFocusTriangle: p, cost: 4, aMoveTriangle: [l + z * h, l + 2 * z * h, l + 2 * z * h, p] })); else if ((B = e[l + z * h]) ? H && (1 >= B.getNumPieces() || B.getColor() === u) && x[0].push({ iFocusTriangle: l + z * h, cost: 1, aMoveTriangle: [l + z * h ], iDiceDisable: 0 }) : H && this.checkBearOff() && (l + z * h === p || this.checkPieceBefore(u, l)) && x[3].push({ iFocusTriangle: p, cost: 1, iDiceDisable: 0, aMoveTriangle: [p] }), (B = e[l + w * h]) ? F && (1 >= B.getNumPieces() || B.getColor() === u) && x[1].push({ iFocusTriangle: l + w * h, cost: 1, aMoveTriangle: [l + w * h], iDiceDisable: 1 }) : F && this.checkBearOff() && (l + w * h === p || this.checkPieceBefore(u, l)) && x[3].push({ iFocusTriangle: p, cost: 1, iDiceDisable: 1, aMoveTriangle: [p] }), 0 < x[0].length || 0 < x[1].length) { var A = 0 < x[0].length ? x[0][0].iFocusTriangle : x[1][0].iFocusTriangle; 0 < x[0].length && 1 === e[x[0][0].iFocusTriangle].getNumPieces() && (A = x[0][0].iFocusTriangle); 0 < x[1].length && 1 === e[x[1][0].iFocusTriangle].getNumPieces() && (A = x[1][0].iFocusTriangle); (B = e[l + (z + w) * h]) ? H && F && (1 >= B.getNumPieces() || B.getColor() === u) && x[2].push({ iFocusTriangle: l + (z + w) * h, cost: 2, aMoveTriangle: [A, l + (z + w) * h], iDiceDisable: 2 }): H && F && this.checkBearOff() && (l + (z + w) * h === p || this.checkPieceBefore(u, A)) && x[3].push({ iFocusTriangle: p, cost: 2, iDiceDisable: 2, aMoveTriangle: [A, p] }) } return 0 < x[0].length || 0 < x[1].length || 0 < x[3].length ? x : null }; this.checkPieceBefore = function(l, u) { var h = !0; if (l === WHITE_PIECE) for (var p = 0; p < u; p++) for (var x = 0; x < e[p].getArrayPieces().length; x++) { var B = e[p].getArrayPieces(); if (B[x].getColor() === WHITE_PIECE) { h = !1; break } } else for (p = 23; p > u; p--) for (x = 0; x < e[p].getArrayPieces().length; x++) if (B = e[p].getArrayPieces(), B[x].getColor() === BLACK_PIECE) { h = !1; break } return h }; this.checkBearOff = function() { var l = !0; if (y) for (var u = 0; u < e.length; u++) { var h = e[u].getArrayPieces(); for (var p = 0; p < h.length; p++) if (h[p].getColor() === WHITE_PIECE && (!0 === h[p].isOnBar() || 18 > h[p].getTriangle())) { l = !1; break } } else for (u = 0; u < e.length; u++) for (h = e[u].getArrayPieces(), p = 0; p < h.length; p++) if (h[p].getColor() === BLACK_PIECE && (!0 === h[p].isOnBar() || 5 < h[p].getTriangle())) { l = !1; break } return l }; this.checkAvaiableMove = function() { var l = !1; if (y) { var u = WHITE_PIECE; var h = BAR_UP } else u = BLACK_PIECE, h = BAR_DOWN; for (var p = 0; p < e.length; p++) { var x = e[p].getArrayPieces(); for (var B = 0; B < x.length; B++) if (x[B].getColor() === u && !0 === x[B].getStateListener() && this.isPossibleMove(x[B])) { l = !0; break } } x = r[h].getArrayPieces(); for (p = 0; p < r[h].getNumPieces(); p++) if (this.isPossibleMove(x[p])) { l = !0; break } return l }; this.updateInput = function() { for (var l, u = 0; u < e.length; u++) if (0 < e[u].getNumPieces()) { l = e[u].getArrayPieces(); for (var h = 0; h < l.length; h++) l[h].unloadListeners() } for (u = 0; u < r.length; u++) if (0 < r[u].getNumPieces()) for (l = r[u].getArrayPieces(), h = 0; h < l.length; h++) l[h].unloadListeners(); if (s_b2Players) if (y) if (0 === r[BAR_UP].getNumPieces()) for (u = 0; u < e.length; u++) { if (0 < e[u].getNumPieces() && (l = e[u].getArrayPieces(), e[u].getColor() === WHITE_PIECE)) for (h = 0; h < l.length; h++) l[h].initListeners() } else for (u = 0; u < r[0].getArrayPieces().length; u++) r[BAR_UP].getArrayPieces()[u].initListeners(); else if (0 === r[BAR_DOWN].getNumPieces()) for (u = 0; u < e.length; u++) { if (0 < e[u].getNumPieces() && (l = e[u].getArrayPieces(), e[u].getColor() === BLACK_PIECE)) for (h = 0; h < l.length; h++) l[h].initListeners() } else for (u = 0; u < r[1].getArrayPieces().length; u++) r[BAR_DOWN].getArrayPieces()[u].initListeners(); else if (y) if (0 === r[BAR_UP].getNumPieces()) for (u = 0; u < e.length; u++) { if (0 < e[u].getNumPieces() && (l = e[u].getArrayPieces(), e[u].getColor() === WHITE_PIECE)) for (h = 0; h < l.length; h++) l[h].initListeners() } else for (u = 0; u < r[0].getArrayPieces().length; u++) r[BAR_UP].getArrayPieces()[u].initListeners(); else { if (0 === r[BAR_DOWN].getNumPieces()) for (u = 0; u < e.length; u++) { if (0 < e[u].getNumPieces() && (l = e[u].getArrayPieces(), e[u].getColor() === BLACK_PIECE)) for (h = 0; h < l.length; h++) l[h].cpuInit() } else for (u = 0; u < r[1].getArrayPieces().length; u++) r[BAR_DOWN].getArrayPieces()[u].cpuInit(); !1 === S && (S = !0, this.rollDice()) } }; this.onClickedTriangle = function(l) { playSound("click_cell", 1, !1); var u = G.getTriangle(); switch (V.checkForbiddenMoveInList(l, u, q)) { case RULE_BROKEN_BOTH_DICE: X.show(TEXT_RULEBROKEN_BOTH); return; case RULE_BROKEN_HIGHER_DICE: X.show(TEXT_RULEBROKEN_HIGHER); return } var h; u = !1; var p = G.getColor() === WHITE_PIECE ? T : aa; for (var x = 0; x < e.length; x++) e[x].onIdle(); s_oStage.removeChild(I); s_oStage.removeChild(E); if (s_b2Players || y) G.setClicked(!1), k = !1; - 1 === l.iFocusTriangle || 24 === l.iFocusTriangle ? (u = !0, 1 < l.aMoveTriangle.length && (h = l.aMoveTriangle[0])) : h = l.aMoveTriangle[0]; if (e[h]) c = !0, e[h].getColor() !== G.getColor() && 1 === e[h].getNumPieces() && (e[h].getLastPiece().getColor() === WHITE_PIECE ? (e[h].getLastPiece().movePiece(r[BAR_UP].getX(), r[BAR_UP].getY()), e[h].getLastPiece().setTriangle(-1), e[h].getLastPiece().setBar(!0), r[BAR_UP].addPiece(e[h].removePiece())) : (e[h].getLastPiece().movePiece(r[BAR_DOWN].getX(), r[BAR_DOWN].getY()), e[h].getLastPiece().setTriangle(24), e[h].getLastPiece().setBar(!0), r[BAR_DOWN].addPiece(e[h].removePiece()))); else if (-1 === l.iFocusTriangle || 24 === l.iFocusTriangle) G.takeOutAnimation(), (new createjs.Tween.get(G.getPiece())).to({ x: G.getXOut(), y: G.getYOut(p) }, 300, createjs.Ease.cubicOut), G.getColor() === WHITE_PIECE ? T++ : aa++, e[G.getTriangle()].removePiece(), G.setTriangle(null), G.unloadListeners(); l.aMoveTriangle.shift(); 0 < l.aMoveTriangle.length ? (new createjs.Tween.get(G.getPiece())).to({ x: e[h].getX(), y: e[h].getY() }, 700, createjs.Ease.cubicOut).call(function() { M.onClickedTriangle(l) }) : (y || s_b2Players || (S = !0), v -= l.cost, J || (0 === l.iDiceDisable ? H = !1 : (1 !== l.iDiceDisable && (H = !1), F = !1)), u ? this.afterMove() : G.movePieceOnBoard(e[h].getX(), e[h].getY())); G.isOnBar() ? G.getColor() === WHITE_PIECE ? (r[BAR_UP].getLastPiece().setBar(!1), e[h].addPiece(r[BAR_UP].removePiece())) : (r[BAR_DOWN].getLastPiece().setBar(!1), e[h].addPiece(r[BAR_DOWN].removePiece())) : u || e[h].addPiece(e[G.getTriangle()].removePiece()); u || G.setTriangle(h) }; this.afterMove = function() { c = !1; M.checkGameOver(); 0 < v ? !0 === M.checkAvaiableMove() ? (M.updateInput(), s_b2Players || y || M.cpuThinkBeforeChoice()) : (X.show(TEXT_NO_MOVES_AVAILABLE), playSound("negative_beep", 1, !1), R.fadeOutTween(), W.fadeOutTween(), v = 0, F = H = J = !1, M.changeTurn(), s_b2Players || y ? g.setVisibleButDice(!0) : S = !1, M.updateInput()) : (J = !1, R.fadeOutTween(), M.checkGameOver(), M.changeTurn(), s_b2Players || y ? g.setVisibleButDice(!0) : S = !1, M.updateInput()) }; this.changeTurn = function() { y = y ? !1 : !0; g.onFocusTurn(y) }; this.rollDice = function() { R.fadeOutTween(); W.fadeOutTween(); y ? R.show() : b && W.show(); g.setVisibleButDice(!1) }; this.afterRollDice = function() { y ? (z = R.returnDiceResult1(), w = R.returnDiceResult2()) : (z = W.returnDiceResult1(), w = W.returnDiceResult2()); F = H = !0; z !== w ? v = 2 : (v = 4, X.show(TEXT_DOUBLE_DICES), playSound("positive_beep", 1, !1), J = !0); q = V.checkMovesAvailable(y); !1 === M.checkAvaiableMove() ? (J = F = H = !1, v = 0, M.changeTurn(), M.updateInput(), !s_b2Players && y && g.setVisibleButDice(!0), s_b2Players || y || (g.setVisibleButDice(!1), setTimeout(M.rollDice, 1E3)), s_b2Players && g.setVisibleButDice(!0), X.show(TEXT_NO_MOVES_AVAILABLE), playSound("negative_beep", 1, !1)) : (g.setVisibleButDice(!1), s_b2Players || !1 !== y || (new createjs.Tween.get(M)).to({}, 1500).call(M.cpuThinkBeforeChoice)) }; this.debug = function() { for (var l = 0; l < e.length; l++) 0 < e[l].getNumPieces() && e[l].getLastPiece().unloadListeners() }; this.unload = function() { b = !1; g.unload(); null !== f && f.unload(); createjs.Tween.removeAllTweens(); s_oStage.removeAllChildren() }; this.onExit = function() { $(s_oMain).trigger("end_session"); s_oGame.unload(); s_oMain.gotoMenu() }; this.gameOver = function(l) { f = new CEndPanel(s_oSpriteLibrary.getSprite("msg_box"), l); for (var u = 0, h = 0; h < e.length; h++) u += e[h].getNumPieces(); for (h = 0; h < r.length; h++) u += r[h].getNumPieces(); d = u * MULTIPLIER_SCORE; f.show(d, l) }; this.checkGameOver = function() { for (var l, u = 0, h = 0, p = 0; p < e.length; p++) { l = e[p].getArrayPieces(); for (var x = 0; x < l.length; x++) l[x].getColor() === WHITE_PIECE ? u++ : h++; u += r[BAR_UP].getNumPieces(); h += r[BAR_DOWN].getNumPieces() } 0 === u ? (b = !1, this.gameOver(0)) : 0 === h && (b = !1, this.gameOver(1)) }; this.cpuThinkBeforeChoice = function() { Z = new CThinking; var l = randomIntBetween(MIN_TIME_THINK, MAX_TIME_THINK); setTimeout(function() { Z.unload(); Z = null; M.cpuChoicePiece() }, l) }; this.cpuChoicePiece = function() { var l, u = [], h = 0; if (0 < r[BAR_DOWN].getNumPieces()) { var p = r[BAR_DOWN].getLastPiece(); if (l = M.isPossibleMove(p)) for (var x = 0; x < l.length - 1; x++) for (var B = 0; B < l[x].length; B++) h = 0, 1 === e[l[x][B].iFocusTriangle].getNumPieces() && e[l[x][B].iFocusTriangle].getColor() === BLACK_PIECE && h++, 13 > l[x][B].iFocusTriangle && h++, 13 < l[x][B].iFocusTriangle && 1 === e[l[x][B].iFocusTriangle].getNumPieces() && h++, 13 > l[x][B].iFocusTriangle && 1 === e[l[x][B].iFocusTriangle].getNumPieces() && h--, 1 === e[l[x][B].iFocusTriangle].getNumPieces() && 13 > l[x][B].iFocusTriangle && h++, u.push({ oMove: l[x][B], iPoints: h, oCurrentPiece: p }) } else for (x = 0; x < e.length; x++) if (0 < e[x].getNumPieces() && (p = e[x].getLastPiece(), p.getColor() === BLACK_PIECE && p.getStateListener() && (l = M.isPossibleMove(p)))) { for (var A = 0; A < l.length - 1; A++) for (B = 0; B < l[A].length; B++) h = 0, 3 > e[p.getTriangle()].getNumPieces() && (h -= 3), 1 === e[l[A][B].iFocusTriangle].getNumPieces() && e[l[A][B].iFocusTriangle].getColor() === BLACK_PIECE && (h += 3), 1 === e[l[A][B].iFocusTriangle].getNumPieces() && e[l[A][B].iFocusTriangle].getColor() === WHITE_PIECE && (h += 5), 13 > l[A][B].iFocusTriangle && h++, 13 < l[A][B].iFocusTriangle && h--, 11 < l[A][B].iFocusTriangle && 1 === e[l[A][B].iFocusTriangle].getNumPieces() && e[l[A][B].iFocusTriangle].getColor() === WHITE_PIECE && (h += 4), 11 > l[A][B].iFocusTriangle && 1 === e[l[A][B].iFocusTriangle].getNumPieces() && e[l[A][B].iFocusTriangle].getColor() === WHITE_PIECE && h--, 1 === e[p.getTriangle()].getNumPieces() && h++, 1 === e[l[A][B].iFocusTriangle].getNumPieces() && 13 > l[A][B].iFocusTriangle && h++, 5 < p.getTriangle() && 5 >= l[A][B].iFocusTriangle && (h += 5), 5 >= p.getTriangle() && 3 > e[p.getTriangle()].getNumPieces() && (h -= 10), 6 > l[A][B].iFocusTriangle && 0 === e[l[A][B].iFocusTriangle].getNumPieces() && (h -= 5), 5 >= p.getTriangle() && (h -= 4), u.push({ oMove: l[A][B], iPoints: h, oCurrentPiece: p }); for (B = 0; B < l[3].length; B++) u.push({ oMove: l[3][B], iPoints: 50, oCurrentPiece: p }) } u.sort(function(ba, O) { return parseFloat(O.iPoints) - parseFloat(ba.iPoints) }); u = this.cpuRemoveNotAllowedMoves(u); G = u[0].oCurrentPiece; G.setOnTop(); M.onClickedTriangle(u[0].oMove) }; this.cpuRemoveNotAllowedMoves = function(l) { for (var u = [], h = 0; h < l.length; h++) { var p = l[h].oCurrentPiece.getTriangle(); V.checkForbiddenMoveInList(l[h].oMove, p, q) === RULE_BROKEN_NONE && u.push(l[h]) } return u }; this.update = function() { null !== Z && Z.update() }; this.getTriangles = function() { return e }; this.getBars = function() { return r }; this.getDiceResult = function() { return { dice1: z, dice2: w } }; s_oGame = this; var M = this; this._init() } var s_oGame; function CInterface() { var a, b, c, d, g, f, k, m, e, t, D, n, y = null, z, w = null, H = null, F, J, v, K, G, C = this; this._init = function() { G = !0; D = new createjs.Container; z = !1; s_oStage.addChild(D); var r = s_oSpriteLibrary.getSprite("but_exit"); k = CANVAS_WIDTH - r.width / 2 - 10; m = r.height / 2 + 10; t = new CGfxButton(k, m, r, D); t.addEventListener(ON_MOUSE_UP, this._onExit, this); g = k - r.width - 5; f = r.height / 2 + 10; if (!1 === DISABLE_SOUND_MOBILE || !1 === s_bMobile) r = s_oSpriteLibrary.getSprite("audio_icon"), e = new CToggle(g, f, r, s_bAudioActive, D), e.addEventListener(ON_MOUSE_UP, this._onAudioToggle, this); r = window.document; var I = r.documentElement; w = I.requestFullscreen || I.mozRequestFullScreen || I.webkitRequestFullScreen || I.msRequestFullscreen; H = r.exitFullscreen || r.mozCancelFullScreen || r.webkitExitFullscreen || r.msExitFullscreen; !1 === ENABLE_FULLSCREEN && (w = !1); w && screenfull.isEnabled && (r = s_oSpriteLibrary.getSprite("but_fullscreen"), c = r.width / 4 + 10, d = r.height / 2 + 10, n = new CToggle(c, d, r, s_bFullscreen, D), n.addEventListener(ON_MOUSE_UP, this._onFullscreen, this)); r = s_oSpriteLibrary.getSprite("light_turn"); K = createBitmap(r, r.width, r.height); K.regX = 11; K.regY = 12; K.x = X_INTERFACE_PLAYER + 3; K.y = Y_INTERFACE_PLAYER_1; K.alpha = 0; D.addChild(K); r = s_oSpriteLibrary.getSprite("turn_p1"); J = createBitmap(r, r.width, r.height); J.x = X_INTERFACE_PLAYER; J.y = Y_INTERFACE_PLAYER_1; D.addChild(J); r = s_b2Players ? s_oSpriteLibrary.getSprite("turn_p2") : s_oSpriteLibrary.getSprite("turn_cpu"); v = createBitmap(r, r.width, r.height); v.x = X_INTERFACE_PLAYER; v.y = Y_INTERFACE_PLAYER_2; D.addChild(v); a = CANVAS_WIDTH - 200; b = CANVAS_HEIGHT / 2; r = s_oSpriteLibrary.getSprite("but_dice"); F = new CGfxButton(CANVAS_WIDTH + 200, b, r, D); F.addEventListener(ON_MOUSE_UP, s_oGame.rollDice, this); F.pulseAnimation(); this.refreshButtonPos(s_iOffsetX, s_iOffsetY) }; this.unload = function() { if (!1 === DISABLE_SOUND_MOBILE || !1 === s_bMobile) e.unload(), e = null; t.unload(); s_oStage.removeChild(D); w && screenfull.isEnabled && n.unload(); s_oInterface = null }; this.refreshPlayersScore = function(r, I) {}; this.refreshButtonPos = function(r, I) { t.setPosition(k - r, I + m); !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || e.setPosition(g - r, I + f); w && screenfull.isEnabled && n.setPosition(c + r, d + I); s_bMobile && z && (s_b2Players ? ((void 0).setPosition((void 0).x + r, (void 0).y - I), (void 0).setPosition((void 0).x + r, (void 0).y - I), (void 0).setPosition((void 0).x - r, (void 0).y - I), (void 0).setPosition((void 0).x - r, (void 0).y - I)) : ((void 0).setPosition((void 0).x + r, (void 0).y - I), (void 0).setPosition((void 0).x + r, (void 0).y - I))) }; this.onFocusTurn = function(r) { G && (G = !1, C.tweenFocusTurn()); K.y = r ? Y_INTERFACE_PLAYER_1 : Y_INTERFACE_PLAYER_2 }; this.tweenFocusTurn = function() { (new createjs.Tween.get(K)).to({ alpha: 1 }, 700).to({ alpha: 0 }, 700).call(C.tweenFocusTurn) }; this.setOnTop = function() { s_oStage.addChildAt(D, s_oStage.numChildren) }; this.setVisibleButDice = function(r) { !1 === r ? (F.setClickable(!1), (new createjs.Tween.get(F.getButtonImage())).to({ x: CANVAS_WIDTH + 200 }, 300, createjs.Ease.cubicIn)) : !0 === r && (F.setClickable(!0), (new createjs.Tween.get(F.getButtonImage())).to({ x: a }, 300, createjs.Ease.cubicOut)) }; this.refreshScore = function(r) {}; this._onButHelpRelease = function() { y = new CHelpPanel }; this.onExitFromHelp = function() { y.unload() }; this._onAudioToggle = function() { Howler.mute(s_bAudioActive); s_bAudioActive = !s_bAudioActive }; this._onExit = function() { new CAreYouSurePanel(s_oGame.onExit) }; this.resetFullscreenBut = function() { n.setActive(s_bFullscreen) }; this._onFullscreen = function() { s_bFullscreen ? H.call(window.document) : w.call(window.document.documentElement); sizeHandler() }; s_oInterface = this; this._init(); return this } var s_oInterface = null; function CCreditsPanel() { var a, b, c, d, g, f, k; this._init = function() { b = new createjs.Shape; b.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); b.alpha = 0; s_oStage.addChild(b); (new createjs.Tween.get(b)).to({ alpha: .7 }, 500); f = new createjs.Shape; f.graphics.beginFill("#0f0f0f").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); f.alpha = .01; k = f.on("click", this._onLogoButRelease); s_oStage.addChild(f); c = new createjs.Container; s_oStage.addChild(c); var m = s_oSpriteLibrary.getSprite("msg_box"), e = createBitmap(m); e.regX = m.width / 2; e.regY = m.height / 2; c.addChild(e); c.x = CANVAS_WIDTH / 2; c.y = CANVAS_HEIGHT + m.height / 2; a = c.y; (new createjs.Tween.get(c)).to({ y: CANVAS_HEIGHT / 2 - 40 }, 500, createjs.Ease.quartIn); e = new createjs.Text("DEVELOPED BY", " 40px " + PRIMARY_FONT, "#3c2200"); e.y = -m.height / 2 + 90; e.textAlign = "center"; e.textBaseline = "middle"; e.lineWidth = 300; c.addChild(e); m = new createjs.Text("www.codethislab.com", " 40px " + PRIMARY_FONT, "#3c2200"); m.y = 100; m.textAlign = "center"; m.textBaseline = "middle"; m.lineWidth = 300; c.addChild(m); m = s_oSpriteLibrary.getSprite("ctl_logo"); g = createBitmap(m); g.regX = m.width / 2; g.regY = m.height / 2; c.addChild(g); m = s_oSpriteLibrary.getSprite("but_exit"); d = new CGfxButton(217, -145, m, c); d.addEventListener(ON_MOUSE_UP, this.unload, this) }; this.changePointer = function(m) { !1 === s_bMobile && (m.target.cursor = "pointer") }; this.unload = function() { d.setClickable(!1); (new createjs.Tween.get(b)).to({ alpha: 0 }, 500); (new createjs.Tween.get(c)).to({ y: a }, 400, createjs.Ease.backIn).call(function() { s_oStage.removeChild(b); s_oStage.removeChild(c); d.unload() }); f.off("click", k); s_oStage.removeChild(f) }; this._onLogoButRelease = function() { window.open("https://www.codethislab.com/", "_blank") }; this._init() } function CAreYouSurePanel(a) { var b, c, d, g, f, k; this._init = function(e) { createjs.Tween.pauseAllTweens(); g = new createjs.Shape; g.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); g.alpha = 0; k = g.on("mousedown", function() {}); s_oStage.addChild(g); (new createjs.Tween.get(g)).to({ alpha: .7 }, 500); f = new createjs.Container; s_oStage.addChild(f); e = s_oSpriteLibrary.getSprite("msg_box"); var t = createBitmap(e); t.regX = e.width / 2; t.regY = e.height / 2; f.addChild(t); f.x = CANVAS_WIDTH / 2; f.y = CANVAS_HEIGHT + e.height / 2; b = f.y; (new createjs.Tween.get(f)).to({ y: CANVAS_HEIGHT / 2 - 40 }, 500, createjs.Ease.quartIn); new CTLText(f, -200, -e.height / 2 + 20, 400, 164, 54, "center", "#3c2200", PRIMARY_FONT, 1, 10, 0, TEXT_ARE_SURE, !0, !0, !0, !1); c = new CGfxButton(110, 80, s_oSpriteLibrary.getSprite("but_yes_big"), f); c.addEventListener(ON_MOUSE_UP, this._onButYes, this); d = new CGfxButton(-110, 80, s_oSpriteLibrary.getSprite("but_no"), f); d.addEventListener(ON_MOUSE_UP, this._onButNo, this); d.pulseAnimation() }; this._onButYes = function() { d.setClickable(!1); c.setClickable(!1); (new createjs.Tween.get(g)).to({ alpha: 0 }, 500); (new createjs.Tween.get(f)).to({ y: b }, 400, createjs.Ease.backIn).call(function() { m.unload(); a() }) }; this._onButNo = function() { d.setClickable(!1); c.setClickable(!1); (new createjs.Tween.get(g)).to({ alpha: 0 }, 500); (new createjs.Tween.get(f)).to({ y: b }, 400, createjs.Ease.backIn).call(function() { m.unload() }) }; this.unload = function() { d.unload(); c.unload(); s_oStage.removeChild(g); s_oStage.removeChild(f); g.off("mousedown", k); createjs.Tween.resumeAllTweens() }; var m = this; this._init(a) } function CEndPanel(a, b) { var c, d, g, f, k, m, e, t = null; this._init = function(D, n) { d = new createjs.Container; d.alpha = 0; d.visible = !1; s_oStage.addChild(d); var y = new createjs.Shape; y.graphics.beginFill("#000").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); y.alpha = .5; y.on("mousedown", this.onMouseDown, this); d.addChild(y); c = createBitmap(D); y = c.getBounds(); c.regX = y.width / 2; c.regY = y.height / 2; c.x = CANVAS_WIDTH / 2; c.y = CANVAS_HEIGHT / 2; d.addChild(c); g = new CTLText(d, CANVAS_WIDTH / 2 - 250, CANVAS_HEIGHT / 2 - 148, 500, 104, 52, "center", "#3c2200", PRIMARY_FONT, 1, 10, 0, " ", !0, !0, !0, !1); f = new CTLText(d, CANVAS_WIDTH / 2 - 250, CANVAS_HEIGHT / 2 - 30, 500, 37, 37, "center", "#3c2200", PRIMARY_FONT, 1, 10, 0, " ", !0, !0, !1, !1); y = s_oSpriteLibrary.getSprite("but_restart"); m = new CGfxButton(CANVAS_WIDTH / 2 + 100, CANVAS_HEIGHT / 2 + 110, y, d); y = s_oSpriteLibrary.getSprite("but_home"); e = new CGfxButton(CANVAS_WIDTH / 2 - 100, CANVAS_HEIGHT / 2 + 110, y, d) }; this.unload = function() {}; this.onMouseDown = function() {}; this._initListener = function() { e.addEventListener(ON_MOUSE_DOWN, this._onExit, this); m.addEventListener(ON_MOUSE_DOWN, this._onRestart, this) }; this.show = function(D, n) { t = 0 === n || s_b2Players ? playSound("win", 1, !1) : playSound("game_over", 1, !1); k = D; var y = n + 1; 0 === n ? g.refreshText(TEXT_GAMEOVER) : (k = 0, g.refreshText(TEXT_LOSE + y + TEXT_LOSE2)); !0 === s_b2Players ? g.refreshText(TEXT_WIN_2PLAYERS + y + TEXT_WIN_2PLAYERS_2) : f.refreshText(TEXT_SCORE + ": " + D); d.visible = !0; var z = this; createjs.Tween.get(d).to({ alpha: 1 }, 500).call(function() { z._initListener() }); $(s_oMain).trigger("save_score", [k, n]); $(s_oMain).trigger("show_interlevel_ad"); $(s_oMain).trigger("end_session") }; this._onExit = function() { null !== t && t.stop(); var D = "You collected <strong>" + k + " points</strong>!<br><br>Share your score with your friends!", n = "My score is " + k + " points! Can you do better?"; $(s_oMain).trigger("share_event", k, "200x200.jpg", "Congratulations!", D, n); s_oStage.removeChild(d); s_oGame.unload(); s_oMain.gotoMenu() }; this._onRestart = function() { $(s_oMain).trigger("show_interlevel_ad"); t.stop(); s_oGame.unload(); s_oMain.gotoGame(); s_oStage.removeChild(d) }; this._init(a, b); return this } function CSelectPlayers() { var a, b, c, d, g, f, k, m, e, t, D, n, y = null, z = null; this.init = function() { s_oSelectPlayers = this; k = new createjs.Container; s_oStage.addChild(k); var w = s_oSpriteLibrary.getSprite("bg_select_mode"); w = new createBitmap(w, w.width, w.height); k.addChild(w); w = s_oSpriteLibrary.getSprite("but_p1"); m = new CGfxButton(CANVAS_WIDTH / 2 - 225, CANVAS_HEIGHT / 2 + 50, w, k); m.addEventListener(ON_MOUSE_DOWN, function() { this.onSelectPlayer(!1) }, this); w = s_oSpriteLibrary.getSprite("but_p2"); e = new CGfxButton(CANVAS_WIDTH / 2 + 225, CANVAS_HEIGHT / 2 + 50, w, k); e.addEventListener(ON_MOUSE_DOWN, function() { this.onSelectPlayer(!0) }, this); new CTLText(k, CANVAS_WIDTH / 2 - 500, CANVAS_HEIGHT / 2 - 300, 1E3, 72, 72, "center", "#fff", PRIMARY_FONT, 1, 10, 0, TEXT_SELECT_PLAYERS_MENU, !0, !0, !1, !1); w = s_oSpriteLibrary.getSprite("but_exit"); g = CANVAS_WIDTH - w.width / 2 - 10; f = w.height / 2 + 10; t = new CGfxButton(g, f, w, k); t.addEventListener(ON_MOUSE_UP, this._onExit, this); if (!1 === DISABLE_SOUND_MOBILE || !1 === s_bMobile) c = t.getX() - w.width - 10, d = w.height / 2 + 10, D = new CToggle(c, d, s_oSpriteLibrary.getSprite("audio_icon"), s_bAudioActive, k), D.addEventListener(ON_MOUSE_UP, this._onAudioToggle, this); w = window.document; var H = w.documentElement; y = H.requestFullscreen || H.mozRequestFullScreen || H.webkitRequestFullScreen || H.msRequestFullscreen; z = w.exitFullscreen || w.mozCancelFullScreen || w.webkitExitFullscreen || w.msExitFullscreen; !1 === ENABLE_FULLSCREEN && (y = !1); y && screenfull.isEnabled && (w = s_oSpriteLibrary.getSprite("but_fullscreen"), a = w.width / 4 + 10, b = w.height / 2 + 10, n = new CToggle(a, b, w, s_bFullscreen, k), n.addEventListener(ON_MOUSE_UP, this._onFullscreenRelease, this)); this.refreshButtonPos(s_iOffsetX, s_iOffsetY) }; this.refreshButtonPos = function(w, H) { t.setPosition(g - w, f + H); !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || D.setPosition(c - w, H + d); y && screenfull.isEnabled && n.setPosition(a + w, b + H) }; this.onSelectPlayer = function(w) { s_b2Players = w; this.unload(); s_oMain.gotoGame() }; this.unload = function() { s_oStage.removeChild(k); s_oSelectPlayers }; this._onAudioToggle = function() { Howler.mute(s_bAudioActive); s_bAudioActive = !s_bAudioActive }; this.resetFullscreenBut = function() { n.setActive(s_bFullscreen) }; this._onFullscreenRelease = function() { s_bFullscreen ? z.call(window.document) : y.call(window.document.documentElement); sizeHandler() }; this._onExit = function() { this.unload(); s_oMain.gotoMenu() }; this.init() } var s_oSelectPlayers = null; function CAlertBox(a) { var b, c, d, g, f, k = this, m; this.init = function(e) { m = !0; c = e; b = new createjs.Container; b.x = CANVAS_WIDTH / 2; b.on("mousedown", this.onMouseDown); c.addChild(b); e = s_oSpriteLibrary.getSprite("alert_box"); d = createBitmap(e, e.width, e.height); d.regX = e.width / 2 - 3; d.regY = e.height / 2 - 8; b.addChild(d); var t = e.width - 50, D = e.height - 20; g = new CTLText(b, -(t / 2), 6 - D / 2, t, D, 38, "center", "#3c2200", PRIMARY_FONT, 1.1, 2, 2, " ", !0, !0, !0, !1); f = -e.height / 2 - 10; b.y = f }; this.show = function(e) { m = !1; g.refreshText(e); (new createjs.Tween.get(b)).to({ y: CANVAS_HEIGHT / 2 }, 500, createjs.Ease.cubicOut).wait(1600).call(function() { m || k.hide() }) }; this.hide = function() { m = !0; createjs.Tween.removeTweens(b); (new createjs.Tween.get(b)).to({ y: f }, 500, createjs.Ease.cubicIn) }; this.onMouseDown = function() { m || k.hide() }; this.init(a) } function CThinking() { var a, b, c, d, g, f; this._init = function() { a = !0; b = 0; c = new createjs.Container; s_oStage.addChild(c); var k = (new createjs.Graphics).beginFill("rgba(0,0,0,0.5)").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); g = new createjs.Shape(k); f = g.on("click", function() {}); c.addChild(g); d = new CTLText(c, .5 * CANVAS_WIDTH - 400, .5 * CANVAS_HEIGHT - 100, 800, 60, 60, "center", "#ffffff", PRIMARY_FONT, 1, 10, 0, TEXT_THINKING, !0, !0, !1, !1) }; this.unload = function() { a = !1; g.off("click", f); s_oStage.removeChild(c) }; this.update = function() { a && (b += s_iTimeElaps, 0 <= b && b < TIME_LOOP_WAIT / 4 ? d.refreshText(TEXT_THINKING) : b >= TIME_LOOP_WAIT / 4 && b < 2 * TIME_LOOP_WAIT / 4 ? d.refreshText(TEXT_THINKING + ".") : b >= 2 * TIME_LOOP_WAIT / 4 && b < 3 * TIME_LOOP_WAIT / 4 ? d.refreshText(TEXT_THINKING + "..") : b >= 3 * TIME_LOOP_WAIT / 4 && b < TIME_LOOP_WAIT ? d.refreshText(TEXT_THINKING + "...") : b = 0) }; this._init() } function CPiece(a, b, c, d, g) { var f, k, m, e, t, D, n, y, z, w, H, F, J, v, K, G; this.init = function(C, r, I, E, R) { e = new createjs.Container; f = C; k = r; m = I; z = E; z.addChild(e); e.x = f; e.y = k; n = this; w = R; v = null; G = K = !1; C = m === BLACK_PIECE ? s_oSpriteLibrary.getSprite("red_piece") : s_oSpriteLibrary.getSprite("white_piece"); C = new createjs.SpriteSheet({ images: [C], framerate: 30, frames: { width: 66, height: 58, regX: 31, regY: 29 }, animations: { out: { frames: [4], next: "out" }, idle: { frames: [0], next: "idle" }, takeIn: { frames: [4, 3, 2, 1], next: "idle" }, takeOut: { frames: [1, 2, 3, 4 ], next: "out" } } }); t = createSprite(C, "out", 31, 29, 66, 58); C = s_oSpriteLibrary.getSprite("highlight"); D = createBitmap(C, C.width, C.height); D.regX = C.width / 2; D.regY = C.height / 2; D.alpha = 0; y = !1; e.addChild(t, D) }; this.onOver = function(C) { s_bMobile || (C.target.cursor = "pointer") }; this.setClicked = function(C) { !0 === C ? (D.alpha = 1, y = !0) : (D.alpha = 0, y = !1) }; this.getStateClick = function() { return y }; this.getColor = function() { return m }; this.getPiece = function() { return e }; this.getIndex = function() { return w }; this.getXOut = function() { return f - 2 }; this.getYOut = function(C) { return m === WHITE_PIECE ? Y_OFFBOARD_DOWN + 238 - 17 * C : Y_OFFBOARD_UP + 17 * C }; this.takeInAnimation = function() { t.gotoAndPlay("takeIn") }; this.takeOutAnimation = function() { t.gotoAndPlay("takeOut") }; this.setTriangle = function(C) { v = C }; this.getTriangle = function() { return v }; this.setOnTop = function() { z.addChild(e) }; this.setBar = function(C) { K = C }; this.isOnBar = function() { return K }; this.movePieceDistribution = function(C, r) { this.takeInAnimation(); playSound("click_cell", 1, !1); (new createjs.Tween.get(e)).to({ x: C, y: r }, MS_DISTRIBUTION, createjs.Ease.cubicOut).call(s_oGame.initDistribution) }; this.movePieceOnBoard = function(C, r) { (new createjs.Tween.get(e)).to({ x: C, y: r }, 700, createjs.Ease.cubicOut).call(function() { s_oGame.updateInput(); s_oGame.afterMove() }) }; this.movePiece = function(C, r) { (new createjs.Tween.get(e)).to({ x: C, y: r }, 700, createjs.Ease.cubicOut) }; this.initListeners = function() { H = e.on("mousedown", function() { s_oGame.onClickedPiece(n) }); F = e.on("rollover", this.onOver); J = e.on("rollout", this.onMouseOut); G = !0 }; this.unloadListeners = function() { e.off("mousedown", H); e.off("rollover", F); e.off("rollout", J); G = !1 }; this.cpuInit = function() { G = !0 }; this.cpuUnload = function() { G = !1 }; this.getStateListener = function() { return G }; this.onMouseOut = function(C) { s_bMobile || (C.target.cursor = "default") }; this.init(a, b, c, d, g) } function CTriangle(a, b, c, d) { var g, f, k, m, e, t, D, n, y, z; this.init = function(w, H, F, J) { m = new createjs.Container; k = F; k.addChild(m); g = w; f = H; D = J; y = null; e = f === Y_TRIANGLE_UP ? TRIANGLE_UP : TRIANGLE_DOWN; n = []; w = 0 === D % 2 ? s_oSpriteLibrary.getSprite("triangle_red") : s_oSpriteLibrary.getSprite("triangle_white"); w = new createjs.SpriteSheet({ images: [w], frames: { width: 69, height: 256, regX: 34.5, regY: 0 }, animations: { idle: [0, 0, "idle"], focus: [1, 1, "focus"] } }); t = new createSprite(w, "idle", 34.5, 0, 69, 256); e === TRIANGLE_DOWN && (t.scaleY *= -1); t.x = g; t.y = f; m.addChild(t) }; this.reset = function() { n = [] }; this.getX = function() { return g }; this.getY = function() { if (e === TRIANGLE_UP) { if (5 > n.length) return f + 28 + 53 * n.length; if (9 > n.length) return f + 28 + 30 + 54 * (n.length - 5); if (12 > n.length) return f + 28 + 60 + 53 * (n.length - 9); if (14 > n.length) return f + 28 + 90 + 53 * (n.length - 12); if (14 === n.length) return f + 28 + 60 + 53 } else { if (5 > n.length) return f - 35 - 53 * n.length; if (9 > n.length) return f - 35 - 30 - 53 * (n.length - 5); if (12 > n.length) return f - 28 - 60 - 53 * (n.length - 9); if (14 > n.length) return f - 28 - 90 - 53 * (n.length - 12); if (14 === n.length) return f - 28 - 60 - 53 } }; this.getNumPieces = function() { return n.length }; this.addPiece = function(w) { n.push(w); y = w.getColor() }; this.isHerePiece = function(w) { for (var H = !1, F = 0; F < n.length; F++) w === n[F] && (H = !0); return H }; this.getColor = function() { return y }; this.getPieceByIndex = function(w) { return n[w] }; this.onFocus = function(w) { t.gotoAndStop("focus"); this.initShape(w) }; this.onOver = function(w) { s_bMobile || (w.target.cursor = "pointer") }; this.onIdle = function() { t.gotoAndStop("idle"); s_oStage.removeChild(z) }; this.getLastPiece = function() { return n[n.length - 1] }; this.getArrayPieces = function() { return n }; this.removePiece = function() { var w = n.pop(); 0 === n.length && (y = null); return w }; this.initShape = function(w) { z = new createjs.Shape; e === TRIANGLE_UP ? z.graphics.beginFill("#000000").drawRect(a - 31, b, 62, 283) : z.graphics.beginFill("#000000").drawRect(a - 31, b, 62, -283); z.alpha = .01; z.on("mousedown", function() { s_oGame.onClickedTriangle(w) }); z.on("mouseover", this.onOver); s_oStage.addChild(z) }; this.init(a, b, c, d) } function CBar(a, b, c, d) { var g, f, k, m, e, t, D, n; this.init = function(y, z, w, H) { m = new createjs.Container; k = H; k.addChild(m); g = y; f = z; D = null; t = []; e = w; n = new createjs.Shape; n.graphics.beginFill("#000000").drawRect(y, z, 62, 253); n.regX = 31; e === BAR_DOWN && (n.regY = 253); n.alpha = .01; m.addChild(n) }; this.getX = function() { return g }; this.getY = function() { if (e === BAR_UP) { if (5 > t.length) return f + 28 + 56 * t.length; if (9 > t.length) return f + 28 + 30 + 56 * (t.length - 5); if (12 > t.length) return f + 28 + 60 + 56 * (t.length - 9); if (14 > t.length) return f + 28 + 90 + 56 * (t.length - 12); if (14 === t.length) return f + 28 + 60 + 56 } else { if (5 > t.length) return f - 35 - 56 * t.length; if (9 > t.length) return f - 35 - 30 - 56 * (t.length - 5); if (12 > t.length) return f - 28 - 60 - 56 * (t.length - 9); if (14 > t.length) return f - 28 - 90 - 56 * (t.length - 12); if (14 === t.length) return f - 28 - 60 - 56 } }; this.getNumPieces = function() { return t.length }; this.addPiece = function(y) { t.push(y); D = y.getColor() }; this.isHerePiece = function(y) { for (var z = !1, w = 0; w < t.length; w++) y === t[w] && (z = !0); return z }; this.getColor = function() { return D }; this.getPieceByIndex = function(y) { return t[y] }; this.onOver = function(y) { s_bMobile || (y.target.cursor = "pointer") }; this.getLastPiece = function() { return t[t.length - 1] }; this.getArrayPieces = function() { return t }; this.removePiece = function() { return t.pop() }; this.init(a, b, c, d) } function CDices(a) { var b, c, d, g, f, k, m = !1, e, t, D = this; this._init = function(n) { e = !0; b = new createjs.Container; b.x = 0; b.y = 0; t = n; s_oStage.addChild(b); t === WHITE_DICES ? (n = { images: [s_oSpriteLibrary.getSprite("launch_dices_white")], framerate: 30, frames: { width: 398, height: 230, regX: 0, regY: 0 }, animations: { stop: [12, 12], idle: [0, 12, "stop"] } }, n = new createjs.SpriteSheet(n), k = createSprite(n, 0, 0, 0, 398, 230), k.x = CANVAS_WIDTH - 398, k.y = CANVAS_HEIGHT - 230, k.visible = !1, b.addChild(k), n = { images: [s_oSpriteLibrary.getSprite("dice_white_a_1"), s_oSpriteLibrary.getSprite("dice_white_a_2"), s_oSpriteLibrary.getSprite("dice_white_a_3"), s_oSpriteLibrary.getSprite("dice_white_a_4"), s_oSpriteLibrary.getSprite("dice_white_a_5"), s_oSpriteLibrary.getSprite("dice_white_a_6") ], framerate: 30, frames: { width: 240, height: 302, regX: 0, regY: 0 }, animations: { stop1: [10, 10], idle1: [0, 10, "stop1"], stop2: [22, 22], idle2: [12, 22, "stop2"], stop3: [34, 34], idle3: [24, 34, "stop3"], stop4: [46, 46], idle4: [36, 46, "stop4"], stop5: [58, 58], idle5: [48, 58, "stop5"], stop6: [70, 70], idle6: [60, 70, "stop6" ] } }, n = new createjs.SpriteSheet(n), g = createSprite(n, 0, 0, 0, 240, 302), g.x = 798, g.y = 383, g.visible = !1, b.addChild(g), n = { images: [s_oSpriteLibrary.getSprite("dice_white_b_1"), s_oSpriteLibrary.getSprite("dice_white_b_2"), s_oSpriteLibrary.getSprite("dice_white_b_3"), s_oSpriteLibrary.getSprite("dice_white_b_4"), s_oSpriteLibrary.getSprite("dice_white_b_5"), s_oSpriteLibrary.getSprite("dice_white_b_6")], framerate: 30, frames: { width: 246, height: 394, regX: 0, regY: 0 }, animations: { stop1: [15, 15], idle1: [0, 15, "stop1"], stop2: [31, 31], idle2: [16, 31, "stop2"], stop3: [47, 47], idle3: [32, 47, "stop3"], stop4: [63, 63], idle4: [48, 63, "stop4"], stop5: [79, 79], idle5: [64, 79, "stop5"], stop6: [95, 95], idle6: [80, 95, "stop6"] } }, n = new createjs.SpriteSheet(n), f = createSprite(n, 0, 0, 0, 246, 394), f.x = 975, f.y = 369) : (n = { images: [s_oSpriteLibrary.getSprite("launch_dices_red")], framerate: 24, frames: { width: 332, height: 370 }, animations: { stop: [10, 10], idle: [0, 10, "stop"] } }, n = new createjs.SpriteSheet(n), k = createSprite(n, 0, 0, 0, 332, 370), k.x = 0, k.y = 0, k.visible = !1, b.addChild(k), n = { images: [s_oSpriteLibrary.getSprite("dice_red_a_1"), s_oSpriteLibrary.getSprite("dice_red_a_2"), s_oSpriteLibrary.getSprite("dice_red_a_3"), s_oSpriteLibrary.getSprite("dice_red_a_4"), s_oSpriteLibrary.getSprite("dice_red_a_5"), s_oSpriteLibrary.getSprite("dice_red_a_6")], framerate: 24, frames: { width: 242, height: 208 }, animations: { stop1: [8, 8], idle1: [0, 8, "stop1"], stop2: [17, 17], idle2: [9, 17, "stop2"], stop3: [26, 26], idle3: [18, 26, "stop3"], stop4: [35, 35], idle4: [27, 35, "stop4"], stop5: [44, 44], idle5: [36, 44, "stop5"], stop6: [53, 53 ], idle6: [45, 53, "stop6"] } }, n = new createjs.SpriteSheet(n), g = createSprite(n, 0, 0, 0, 242, 208), g.x = 187, g.y = 274, g.visible = !1, b.addChild(g), n = { images: [s_oSpriteLibrary.getSprite("dice_red_b_1"), s_oSpriteLibrary.getSprite("dice_red_b_2"), s_oSpriteLibrary.getSprite("dice_red_b_3"), s_oSpriteLibrary.getSprite("dice_red_b_4"), s_oSpriteLibrary.getSprite("dice_red_b_5"), s_oSpriteLibrary.getSprite("dice_red_b_6")], framerate: 30, frames: { width: 324, height: 228, regX: 0, regY: 0 }, animations: { stop1: [13, 13], idle1: [0, 13, "stop1"], stop2: [27, 27], idle2: [14, 27, "stop2"], stop3: [41, 41], idle3: [28, 41, "stop3"], stop4: [55, 55], idle4: [42, 55, "stop4"], stop5: [69, 69], idle5: [56, 69, "stop5"], stop6: [83, 83], idle6: [70, 83, "stop6"] } }, n = new createjs.SpriteSheet(n), f = createSprite(n, 0, 0, 0, 324, 228), f.x = 258, f.y = 242); f.visible = !1; b.addChild(f) }; this.isAnimationOn = function() { return m }; this.show = function() { g.visible = f.visible = !1; c = Math.floor(6 * Math.random() + 1); d = Math.floor(6 * Math.random() + 1); m = !0; playSound("dices", 1, !1); k.visible = !0; k.gotoAndPlay("idle"); k.on("animationend", function() { k.visible && D.secondAnimation() }) }; this.secondAnimation = function() { k.visible = !1; g.alpha = f.alpha = 1; g.visible = f.visible = !0; g.gotoAndPlay("idle" + c); f.gotoAndPlay("idle" + d); m = !1; s_oGame.afterRollDice(c, d) }; this.movePlayer = function() { !1 === m && (m = !0, s_oGame.movePlayer(c + d)) }; this.fadeOutTween = function() { createjs.Tween.get(g, { loop: !1 }).to({ alpha: 0 }, 200); createjs.Tween.get(f, { loop: !1 }).to({ alpha: 0 }, 200).call(this.hide) }; this.returnDiceResult1 = function() { return c }; this.returnDiceResult2 = function() { return d }; this.hide = function() { g.visible = f.visible = !1 }; this.unload = function() { s_oDices = null }; this.isFirstLaunch = function() { return e }; this.setFirstLaunch = function(n) { e = n }; s_oDices = this; this._init(a) } CTLText.prototype = { constructor: CTLText, __autofit: function() { if (this._bFitText) { for (var a = this._iStartingFontSize; (this._oText.getBounds().height > this._iHeight - 2 * this._iPaddingV || this._oText.getBounds().width > this._iWidth - 2 * this._iPaddingH) && !(a--, this._oText.font = a + "px " + this._szFont, this._oText.lineHeight = Math.round(a * this._fLineHeightFactor), this.__updateY(), this.__verticalAlign(), 8 > a);); this._iFontSize = a } }, __verticalAlign: function() { if (this._bVerticalAlign) { var a = this._oText.getBounds().height; this._oText.y -= (a - this._iHeight) / 2 + this._iPaddingV } }, __updateY: function() { this._oText.y = this._y + this._iPaddingV; switch (this._oText.textBaseline) { case "middle": this._oText.y += this._oText.lineHeight / 2 + (this._iFontSize * this._fLineHeightFactor - this._iFontSize) } }, __createText: function(a) { this._bDebug && (this._oDebugShape = new createjs.Shape, this._oDebugShape.graphics.beginFill("rgba(255,0,0,0.5)").drawRect(this._x, this._y, this._iWidth, this._iHeight), this._oContainer.addChild(this._oDebugShape)); this._oText = new createjs.Text(a, this._iFontSize + "px " + this._szFont, this._szColor); this._oText.textBaseline = "middle"; this._oText.lineHeight = Math.round(this._iFontSize * this._fLineHeightFactor); this._oText.textAlign = this._szAlign; this._oText.lineWidth = this._bMultiline ? this._iWidth - 2 * this._iPaddingH : null; switch (this._szAlign) { case "center": this._oText.x = this._x + this._iWidth / 2; break; case "left": this._oText.x = this._x + this._iPaddingH; break; case "right": this._oText.x = this._x + this._iWidth - this._iPaddingH } this._oContainer.addChild(this._oText); this.refreshText(a) }, setVerticalAlign: function(a) { this._bVerticalAlign = a }, setX: function(a) { this._x = a; this._oText.x = a }, setY: function(a) { this._y = a; this._oText.y = a }, setOutline: function(a) { null !== this._oText && (this._oText.outline = a) }, setShadow: function(a, b, c, d) { null !== this._oText && (this._oText.shadow = new createjs.Shadow(a, b, c, d)) }, setColor: function(a) { this._oText.color = a }, setAlpha: function(a) { this._oText.alpha = a }, removeTweens: function() { createjs.Tween.removeTweens(this._oText) }, getText: function() { return this._oText }, getY: function() { return this._y }, getFontSize: function() { return this._iFontSize }, getBounds: function() { return this._oText.getBounds() }, refreshText: function(a) { "" === a && (a = " "); null === this._oText && this.__createText(a); this._oText.text = a; this._oText.font = this._iStartingFontSize + "px " + this._szFont; this._oText.lineHeight = Math.round(this._iStartingFontSize * this._fLineHeightFactor); this.__autofit(); this.__updateY(); this.__verticalAlign() } }; function CTLText(a, b, c, d, g, f, k, m, e, t, D, n, y, z, w, H, F) { this._oContainer = a; this._x = b; this._y = c; this._iWidth = d; this._iHeight = g; this._bMultiline = H; this._iFontSize = this._iStartingFontSize = f; this._szAlign = k; this._szColor = m; this._szFont = e; this._iPaddingH = D; this._iPaddingV = n; this._bVerticalAlign = w; this._bFitText = z; this._bDebug = F; this._oDebugShape = null; this._fLineHeightFactor = t; this._oText = null; y && this.__createText(y) } function CRuleFilter() { var a, b, c; this._init = function() { a = 24; b = 25 }; this.checkMovesAvailable = function(d) { var g = d ? WHITE_PIECE : BLACK_PIECE; d = this.getCurBoardStatus(); c = []; var f = this.getDiceState(); c[0] = f.dice1; c[1] = f.dice2; var k = []; if (c[0] === c[1]) return k; k = []; for (f = 0; f < c.length; f++) k[f] = this._getMovesList(g, d, c[f]), k[f] = this._removeAllMovesByType(MOVES_TYPE_COLLISION, k[f]); k = this._checkRulePlayBothDice(k, d); g = this._countAllowedMoves(k[0]); g += this._countAllowedMoves(k[1]); 0 === g && (this._resetAllRule(k[0]), this._resetAllRule(k[1]), k = this._checkRuleHigherDiceValue(k, d)); k = k[0].concat(k[1]); k.sort(function(m, e) { return m.src > e.src ? 1 : e.src > m.src ? -1 : 0 }); for (f = d = 0; f < k.length; f++) k[f].brokenrule !== RULE_BROKEN_NONE && d++; d === k.length && (k = []); return k }; this.reset = function() {}; this._checkRulePlayBothDice = function(d, g) { for (var f = 0; f < d.length; f++) for (var k = d[f], m = c[+!f], e = 0; e < k.length; e++) this._checkTheMoveAndMark(k[e], g, m, RULE_BROKEN_BOTH_DICE); return d }; this._checkRuleHigherDiceValue = function(d, g) { for (var f = c[c[0] > c[1] ? 0 : 1], k = d[c[0] < c[1] ? 0 : 1], m = 0; m < k.length; m++) this._checkTheMoveAndMark(k[m], g, f, RULE_BROKEN_HIGHER_DICE); return d }; this._checkRuleDoubleDicePlayMost = function() {}; this._checkTheMoveAndMark = function(d, g, f, k) { var m = g[d.src].color; g = this.getABoardCopy(g); this._doMove(d, g); f = this._getMovesList(m, g, f); f = this._removeAllMovesByType(MOVES_TYPE_COLLISION, f); d.brokenrule = 0 < f.length ? RULE_BROKEN_NONE : k }; this._doMove = function(d, g) { var f = d.src, k = d.dst, m = g[f].color; g[f].numpieces--; 0 === g[f].numpieces && (g[f].color = null); switch (d.type) { case MOVES_TYPE_HIT: g[k].color = m; g[k].numpieces = 1; break; case MOVES_TYPE_BEAR: break; case MOVES_TYPE_EXTRABEAR: break; default: g[k].color = m, g[k].numpieces++ } }; this.getCurBoardStatus = function() { for (var d = s_oGame.getTriangles(), g = [], f = 0; f < d.length; f++) { var k = d[f].getColor(), m = d[f].getNumPieces(); g[f] = { color: k, numpieces: m } } g[a] = this.getPlayersPieceListOnBar(WHITE_PIECE); g[b] = this.getPlayersPieceListOnBar(BLACK_PIECE); return g }; this.getABoardCopy = function(d) { return JSON.parse(JSON.stringify(d)) }; this.getPlayersPieceListPos = function(d, g) { for (var f = [], k = 0; k < g.length; k++) g[k].color === d && f.push(k); return f }; this.getPlayersPieceListOnBar = function(d) { var g = s_oGame.getBars(), f = null; d === WHITE_PIECE ? (d = g[BAR_UP].getNumPieces(), 0 < d && (f = WHITE_PIECE)) : (d = g[BAR_DOWN].getNumPieces(), 0 < d && (f = BLACK_PIECE)); return { color: f, numpieces: d } }; this.checkAndSetOnlyPieceFromBar = function(d) { var g = d, f = d.indexOf(a); - 1 !== f && (g = [], g.push(d[f])); f = d.indexOf(b); - 1 !== f && (g = [], g.push(d[f])); return g }; this._getMovesList = function(d, g, f) { var k = this.getPlayersPieceListPos(d, g); k = this.checkAndSetOnlyPieceFromBar(k); for (var m = this.playerCanBear(d, k), e = d === WHITE_PIECE ? 1 : -1, t = [], D = 0; D < k.length; D++) { var n = k[D], y = (k[D] < a ? n : d === WHITE_PIECE ? -1 : 24) + e * f, z = this.getMovesType(g, y, n, m); t.push({ src: n, dst: y, type: z, brokenrule: RULE_BROKEN_NONE }) } g = this._checkExtraBearMoves(d, k, f, m); d = d === WHITE_PIECE ? 24 : -1; null !== g && t.push({ src: g, dst: d, type: MOVES_TYPE_EXTRABEAR, brokenrule: RULE_BROKEN_NONE }); return t }; this.getMovesType = function(d, g, f, k) { f = d[f].color; var m = f === WHITE_PIECE ? 24 : -1; 24 <= g || 0 > g ? d = g === m && k ? MOVES_TYPE_BEAR : MOVES_TYPE_COLLISION : (d = d[g], d = d.color === f ? MOVES_TYPE_ADD : null === d.color ? MOVES_TYPE_FILL : 1 === d.numpieces ? MOVES_TYPE_HIT : MOVES_TYPE_COLLISION); return d }; this._checkExtraBearMoves = function(d, g, f, k) { var m = d === WHITE_PIECE ? 24 : -1, e = null; k && (d === WHITE_PIECE ? (d = Math.min.apply(Math, $jscomp.arrayFromIterable(g)), m -= d) : (d = Math.max.apply(Math, $jscomp.arrayFromIterable(g)), m = -(m - d)), f > m && (e = d)); return e }; this.playerCanBear = function(d, g) { if (d === WHITE_PIECE) for (var f = 0; f < g.length; f++) { if (18 > g[f] || g[f] === a) return !1 } else for (f = 0; f < g.length; f++) if (5 < g[f] || g[f] === b) return !1; return !0 }; this._removeAllMovesByType = function(d, g) { return g = g.filter(function(f) { return f.type !== d }) }; this.checkForbiddenMoveInList = function(d, g, f) { d = this._findMoveBySource(f, g, d.iFocusTriangle); return null === d || d.brokenrule === RULE_BROKEN_NONE ? RULE_BROKEN_NONE : d.brokenrule }; this._findMoveBySource = function(d, g, f) { -1 === g ? g = a : 24 === g && (g = b); for (var k = null, m = 0; m < d.length; m++) { var e = d[m]; e.src === g && e.dst === f && (k = e) } return k }; this._resetAllRule = function(d) { for (var g = 0; g < d.length; g++) d[g].brokenrule = RULE_BROKEN_NONE }; this._countAllowedMoves = function(d) { for (var g = 0, f = 0; f < d.length; f++) d[f].brokenrule === RULE_BROKEN_NONE && g++; return g }; this.getDiceState = function() { return s_oGame.getDiceResult() }; this.getOtherColor = function(d) { return d = d === BLACK_PIECE ? WHITE_PIECE : BLACK_PIECE }; this._init() } function extractHostname(a) { a = -1 < a.indexOf("://") ? a.split("/")[2] : a.split("/")[0]; a = a.split(":")[0]; return a = a.split("?")[0] } function extractRootDomain(a) { a = extractHostname(a); var b = a.split("."), c = b.length; 2 < c && (a = b[c - 2] + "." + b[c - 1]); return a } var getClosestTop = function() { var a = window, b = !1; try { for (; a.parent.document !== a.document;) if (a.parent.document) a = a.parent; else { b = !0; break } } catch (c) { b = !0 } return { topFrame: a, err: b } }, getBestPageUrl = function(a) { var b = a.topFrame, c = ""; if (a.err) try { try { c = window.top.location.href } catch (g) { var d = window.location.ancestorOrigins; c = d[d.length - 1] } } catch (g) { c = b.document.referrer } else c = b.location.href; return c }, TOPFRAMEOBJ = getClosestTop(), PAGE_URL = getBestPageUrl(TOPFRAMEOBJ); function seekAndDestroy() { for (var a = extractRootDomain(PAGE_URL), b = [String.fromCharCode(99, 111, 100, 101, 116, 104, 105, 115, 108, 97, 98, 46, 99, 111, 109), String.fromCharCode(101, 110, 118, 97, 116, 111, 46, 99, 111, 109), String.fromCharCode(99, 111, 100, 101, 99, 97, 110, 121, 111, 110, 46, 99, 111, 109), String.fromCharCode(99, 111, 100, 101, 99, 97, 110, 121, 111, 110, 46, 110, 101, 116)], c = 0; c < b.length; c++) if (b[c] === a) return !0; return !1 };
| ver. 1.4 |
Github
|
.
| PHP 8.2.29 | Генераци� �траницы: 0 |
proxy
|
phpinfo
|
�а�тройка