(function () { 'use strict'; class GameConfig { constructor() { } static init() { var reg = Laya.ClassUtils.regClass; } } GameConfig.width = 1334; GameConfig.height = 750; GameConfig.scaleMode = "fixedheight"; GameConfig.screenMode = "horizontal"; GameConfig.alignV = "top"; GameConfig.alignH = "left"; GameConfig.startScene = ""; GameConfig.sceneRoot = ""; GameConfig.debug = false; GameConfig.stat = false; GameConfig.physicsDebug = false; GameConfig.exportSceneToJson = true; GameConfig.init(); let fguiRes = { game: "asset/fgui/game", loading: "fgui/loading" }; let ballCamp = { full: "full", flower: "flower" }; let FoulType = { "timeOut": "1", "notTouch": "2", "wrongTouch": "3", "wrongHole": "4", "rootHole": "5", }; let ALL_BALL_STOP = "ALL_BALL_STOP"; let WAIT_SHOOT = "WAIT_SHOOT"; let D3RES_LOADED = "D3RES_LOADED"; let BALL_SHOOT = "BALL_SHOOT"; let FIRST_BALL_HOLE = "FIRST_BALL_HOLE"; let RESET_GAME = "RESET_GAME"; let COIN_CHANGE = "COIN_CHANGE"; let DIAMOND_CHANGE = "DIAMOND_CHANGE"; let RESTART_GAME = "RESTART_GAME"; let GET_USER_INFO = "GET_USER_INFO"; let CHANGE_SECRETARY = "CHANGE_SECRETARY"; let POWER_CHANGE = "POWER_CHANGE"; let POWER_TIME = "POWER_TIME"; let keyForLoginInfo = "userInfo"; let baseHeadUrl = "https://mygame1.tangro.cn/headimg/"; let poolKey = { inHoleEft: "inHoleEft", d3ball: "d3ball", iceEft: "iceEft", hitEft: "hitEft", fireworksEft: "fireworksEft", }; var GameMode; (function (GameMode) { GameMode[GameMode["classic"] = 0] = "classic"; GameMode[GameMode["bigMove"] = 1] = "bigMove"; GameMode[GameMode["placeBall"] = 2] = "placeBall"; })(GameMode || (GameMode = {})); var SkillType; (function (SkillType) { SkillType[SkillType["highSpace"] = 0] = "highSpace"; SkillType[SkillType["breakArmy"] = 1] = "breakArmy"; SkillType[SkillType["ice"] = 2] = "ice"; SkillType[SkillType["fireworks"] = 3] = "fireworks"; SkillType[SkillType["GuanYu"] = 4] = "GuanYu"; })(SkillType || (SkillType = {})); var ClassicWordsType; (function (ClassicWordsType) { ClassicWordsType[ClassicWordsType["directShoot"] = 0] = "directShoot"; ClassicWordsType[ClassicWordsType["bigPower"] = 1] = "bigPower"; ClassicWordsType[ClassicWordsType["anotherShoot"] = 2] = "anotherShoot"; ClassicWordsType[ClassicWordsType["perfectShow"] = 3] = "perfectShow"; ClassicWordsType[ClassicWordsType["hardShoot"] = 4] = "hardShoot"; })(ClassicWordsType || (ClassicWordsType = {})); var PressType; (function (PressType) { PressType[PressType["powerNode"] = 0] = "powerNode"; PressType[PressType["d2Root"] = 1] = "d2Root"; PressType[PressType["moveNode"] = 2] = "moveNode"; PressType[PressType["rulerNode"] = 3] = "rulerNode"; })(PressType || (PressType = {})); var PlaceBallType; (function (PlaceBallType) { PlaceBallType[PlaceBallType["normal"] = 0] = "normal"; PlaceBallType[PlaceBallType["challenge"] = 1] = "challenge"; })(PlaceBallType || (PlaceBallType = {})); var EAdType; (function (EAdType) { EAdType[EAdType["upSkill"] = 0] = "upSkill"; EAdType[EAdType["addDiamond"] = 1] = "addDiamond"; EAdType[EAdType["placeBallNextLevel"] = 2] = "placeBallNextLevel"; EAdType[EAdType["regretBall"] = 3] = "regretBall"; EAdType[EAdType["longHelpLine"] = 4] = "longHelpLine"; EAdType[EAdType["addFailCoin"] = 5] = "addFailCoin"; EAdType[EAdType["sign"] = 6] = "sign"; EAdType[EAdType["draw"] = 7] = "draw"; EAdType[EAdType["triple"] = 8] = "triple"; EAdType[EAdType["randomDiamond"] = 9] = "randomDiamond"; EAdType[EAdType["getPower"] = 10] = "getPower"; EAdType[EAdType["box"] = 11] = "box"; EAdType[EAdType["try"] = 12] = "try"; EAdType[EAdType["againSign"] = 13] = "againSign"; EAdType[EAdType["addCoin"] = 14] = "addCoin"; })(EAdType || (EAdType = {})); var Prop; (function (Prop) { Prop[Prop["diamond"] = 1] = "diamond"; Prop[Prop["coin"] = 2] = "coin"; Prop[Prop["gan1"] = 3] = "gan1"; Prop[Prop["gan2"] = 4] = "gan2"; Prop[Prop["gan3"] = 5] = "gan3"; Prop[Prop["gan4"] = 6] = "gan4"; })(Prop || (Prop = {})); var TipsType; (function (TipsType) { TipsType[TipsType["exitGame"] = 0] = "exitGame"; TipsType[TipsType["foul"] = 1] = "foul"; })(TipsType || (TipsType = {})); class AwardType { constructor(type, num) { this.type = type; this.num = num; } } var define = /*#__PURE__*/Object.freeze({ fguiRes: fguiRes, ballCamp: ballCamp, FoulType: FoulType, ALL_BALL_STOP: ALL_BALL_STOP, WAIT_SHOOT: WAIT_SHOOT, D3RES_LOADED: D3RES_LOADED, BALL_SHOOT: BALL_SHOOT, FIRST_BALL_HOLE: FIRST_BALL_HOLE, RESET_GAME: RESET_GAME, COIN_CHANGE: COIN_CHANGE, DIAMOND_CHANGE: DIAMOND_CHANGE, RESTART_GAME: RESTART_GAME, GET_USER_INFO: GET_USER_INFO, CHANGE_SECRETARY: CHANGE_SECRETARY, POWER_CHANGE: POWER_CHANGE, POWER_TIME: POWER_TIME, keyForLoginInfo: keyForLoginInfo, baseHeadUrl: baseHeadUrl, poolKey: poolKey, get GameMode () { return GameMode; }, get SkillType () { return SkillType; }, get ClassicWordsType () { return ClassicWordsType; }, get PressType () { return PressType; }, get PlaceBallType () { return PlaceBallType; }, get EAdType () { return EAdType; }, get Prop () { return Prop; }, get TipsType () { return TipsType; }, AwardType: AwardType }); class CContext { constructor() { this.winSize = { width: 0, height: 0 }; this.notchHeight = 0; this.bannerHeight = 0; } init(resList, callback) { this.winSize = { width: Laya.Browser.clientWidth, height: Laya.Browser.clientHeight }; this.notchHeight = this.getNotchHeight(); this.bannerHeight = this.getBannerHeight(); Laya.loader.load(resList, Laya.Handler.create(this, () => { callback && callback(); })); } getNotchHeight() { let notchHeight = 50; if (Laya.Browser.onMiniGame) { let deviceInfo = wx.getSystemInfoSync(); if (Laya.Browser.onIOS) { if (deviceInfo.model.search('iPhone X') != -1) { notchHeight = deviceInfo.statusBarHeight - 10; } else { if ((deviceInfo.screenWidth == 375 && deviceInfo.screenHeight == 812) || (deviceInfo.screenWidth == 414 && deviceInfo.screenHeight == 896)) { notchHeight = deviceInfo.statusBarHeight - 10; } } } else if (Laya.Browser.onAndroid) { if (deviceInfo.screenWidth / deviceInfo.screenHeight < (9 / 16)) { notchHeight = deviceInfo.statusBarHeight; } } } return notchHeight; } getBannerHeight() { return 0; } } let context = new CContext(); var Handler = Laya.Handler; var Tween = Laya.Tween; function playClickEffect(btn) { if (!btn) return; Laya.Tween.to(btn, { scaleX: 1.05, scaleY: 1.05 }, 20, null, Laya.Handler.create(null, () => { if (!btn) return; Laya.Tween.to(btn, { scaleX: 0.96, scaleY: 0.96 }, 30, null, Laya.Handler.create(null, () => { if (!btn) return; Laya.Tween.to(btn, { scaleX: 1, scaleY: 1 }, 20, null, null, 0, true); }), 0, true); }), 0, true); } function getNumList(strList) { let dataList = []; if (strList) { let list = strList; let array = list.split(','); for (var v in array) { dataList.push(Number(array[v])); } } return dataList; } function getStrList(strList) { let dataList = []; if (strList) { let list = strList; let array = list.split('|'); for (var v in array) { dataList.push(String(array[v])); } } return dataList; } function getRandStr(len) { let list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']; let str = ""; for (let i = 0; i < len; i++) { let rand = random(0, list.length); str += list[rand]; } return str; } function getUserId() { let str = getRandStr(12) + Laya.timer.currTimer % 1000000; return str; } function formatPos(pos, len = 2) { let v = Math.pow(10, len); pos.x = Math.floor(pos.x * v) / v; pos.y = Math.floor(pos.y * v) / v; if (pos.z) pos.z = Math.floor(pos.z * v) / v; return pos; } function setPosInt(pos) { pos.x = pos.x > 0 ? Math.ceil(pos.x) : Math.floor(pos.x); pos.y = pos.y > 0 ? Math.ceil(pos.y) : Math.floor(pos.y); pos.z = pos.z > 0 ? Math.ceil(pos.z) : Math.floor(pos.z); return pos; } function random(min, max) { var rang = max - min; var rand = Math.random() * rang; return Math.floor(rand) + min; } function randomList(list, num) { if (list.length <= num) return list; let arry = []; list.forEach(item => { arry.push(item); }); let nums = []; for (let i = 0; i < num; i++) { let rand = random(0, arry.length); let v = arry[rand]; nums.push(v); arry.splice(rand, 1); } return nums; } function worldToScreen(camera, point, pos) { camera.viewport.project(point, camera.projectionViewMatrix, pos); pos.x = pos.x / Laya.stage.clientScaleX; pos.y = pos.y / Laya.stage.clientScaleY; } function getStringLenght(str) { return str.replace(/[\u4e00-\u9fa5]/g, "xx").length; } function reviseString(str, len) { let ld = str.replace(/[\u4e00-\u9fa5]/g, "xx").length; if (ld > len) { let sl = Math.floor(len / 2); let rs = str.substring(0, sl); let d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length; while (d + 2 < len) { sl++; rs = str.substring(0, sl); d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length; } return rs + "..."; } return str; } function getCoinString(coin) { if (coin < 10000) return coin.toString(); else if (coin < 1000000) { let vh = Math.ceil(coin / 100); return (vh / 10) + "k"; } else if (coin < 1000000000) { var vh = Math.ceil(coin / 100000); return (vh / 10) + "m"; } else if (coin < 1000000000000) { var vh = Math.ceil(coin / 100000000); return (vh / 10) + "b"; } else if (coin < 1000000000000000) { var vh = Math.ceil(coin / 100000000000); return (vh / 10) + "t"; } } function getV3Dest(pos, dir, dis, dest) { dir.x *= dis; dir.y *= dis; dir.z *= dis; Laya.Vector3.add(pos, dir, dest); return dest; } function getV2Dest(x1, y1, dir, dis, dest) { dest.x = x1 + dir.x * dis; dest.y = y1 + dir.y * dis; return dest; } function getV2Dir(x1, y1, x2, y2, dir) { dir.x = x2 - x1; dir.y = y2 - y1; Laya.Vector2.normalize(dir, dir); return dir; } function getV3Dir(p1, p2, dir) { Laya.Vector3.subtract(p1, p2, dir); Laya.Vector3.normalize(dir, dir); return dir; } function copyPos(ip, op) { op.x = ip.x; op.y = ip.y; if (ip.z) op.z = ip.z; return op; } function getScreenImg() { let gl = Laya.WebGLContext.mainContext; let pixels = new Uint8Array(gl.drawingBufferWidth * gl.drawingBufferHeight * 4); gl.readPixels(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight, gl.RGBA, gl.UNSIGNED_BYTE, pixels); let w = gl.drawingBufferWidth; let h = gl.drawingBufferHeight; let texture2d = new Laya.Texture2D(w, h, Laya.TextureFormat.R8G8B8A8, false, false); texture2d.setPixels(pixels); return new Laya.Texture(texture2d); } function playMoveByPositions(sp, positions, v, completeCallback) { let p; let play = () => { if (positions.length == 0) { completeCallback(); return; } p = positions[0]; positions.splice(0, 1); Laya.Tween.to(sp, { x: p.x, y: p.y }, getDistance(sp.x, sp.y, p.x, p.y) / v * 1000, null, Handler.create(this, () => { play(); })); }; play(); } function setStarPos(node, num, max) { for (let i = 1; i <= 5; i++) { let img = node.getChildAt(i - 1); img.width = img.height = 30; img.pivotX = img.pivotY = 0.5; img.gray = i > num; img.visible = i <= max; if (max == 3) { img.x = node.width / 2 + (i - 2) * 30 - 15; img.y = node.height - 40; if (i == 2) img.y = node.height - 30; } else if (max == 5) { let ly = Math.abs(i - 3); img.x = node.width / 2 + (i - 3) * 20 - 15; img.y = node.height - ly * 8 - 30; } } } function playLoopAnimRotate(sp, time, clockwise = true) { let rotation; sp.rotation = sp.rotation % 360; if (clockwise) { rotation = -360; } else { rotation = 360; } Tween.to(sp, { rotation: rotation }, time, null, Handler.create(this, () => { this.playLoopAnimRotate(sp, time, clockwise); })); } function playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, isBig = true) { let x, y; if (isBig) { x = valueXMin; y = valueYMin; } else { x = valueXMax; y = valueYMax; } Tween.to(sp, { x: x, y: y }, time, null, Handler.create(this, () => { this.playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, !isBig); })); } function playLoopAnimScale(sp, valueMin, valueMax, time, isBig = true) { let scale; if (isBig) { scale = valueMin; } else { scale = valueMax; } Tween.to(sp, { scaleX: scale, scaleY: scale }, time, null, Handler.create(this, () => { playLoopAnimScale(sp, valueMin, valueMax, time, !isBig); })); } function playLoopAnimRotation(sp, valueMin, valueMax, time, isBig = true, count = 8) { let value; if (isBig) { value = valueMin; } else { value = valueMax; } if (count) { count--; Tween.to(sp, { rotation: value }, time, null, Handler.create(this, () => { playLoopAnimRotation(sp, valueMin, valueMax, time, !isBig, count); })); } else { sp.rotation = 0; } } function inRect(rect, p) { if (p.x >= rect.x && p.x <= rect.x + rect.w) { if (p.y >= rect.y && p.y <= rect.y + rect.h) { return true; } } return false; } function getNumberK(number) { if (number < 1000) { return number.toString(); } else { return (number / 1000).toFixed(1) + "k"; } } function pointInsideCircle(point, circle, r) { if (r === 0) return false; var dx = circle.x - point.x; var dy = circle.y - point.y; return dx * dx + dy * dy <= r * r; } function formatString(str, data) { if (!str || data == undefined) { return str; } if (typeof data === "object") { for (var key in data) { if (data.hasOwnProperty(key)) { str = str.replace(new RegExp("\{" + key + "\}", "g"), data[key]); } } } else { var args = arguments, reg = new RegExp("\{([0-" + (args.length - 1) + "])\}", "g"); return str.replace(reg, function (match, index) { return args[index - (-1)]; }); } return str; } function getIntersection(a, b) { let t = []; for (var i = 0; i < a.length; i++) { for (var j = 0; j < b.length; j++) { if (a[i] == b[j]) { t.push(a[i]); } } } return t; } function getComplement(a, b) { let t = []; let count = false; for (var i = 0; i < a.length; i++) { count = false; for (var j = 0; j < b.length; j++) { if (a[i] == b[j]) { count = true; break; } } if (!count) { t.push(a[i]); } } return t; } function geSpriteStageRect(sp) { var point = sp.localToGlobal(Laya.Point.TEMP.setTo(0, 0)); let rect = { x: point.x, y: point.y, width: sp.width * sp.globalScaleX, height: sp.height * sp.globalScaleY }; return rect; } function touchButton(button) { let event = new Laya.Event(); button.event(Laya.Event.CLICK, event.setTo(Laya.Event.CLICK, button, button)); } function setColor(sprite, r, g, b) { var redMat = [ r / 255, 0, 0, 0, 0, g / 255, 0, 0, 0, 0, b / 255, 0, 0, 0, 0, 0, 0, 0, 1, 0, ]; var filter = new Laya.ColorFilter(redMat); sprite.filters = [filter]; } function clone(obj, newobj = {}) { for (var attr in obj) { if (typeof obj[attr] == "object") { newobj[attr] = clone(obj[attr], newobj[attr]); } else { newobj[attr] = obj[attr]; } } return newobj; } function _ms(arr, compare, begin, end) { const size = end - begin; if (size <= 1) { return; } const middle = (end + begin) >> 1; _ms(arr, compare, begin, middle); _ms(arr, compare, middle, end); if (compare(arr[middle - 1], arr[middle]) <= 0) { return; } const merged = []; let leftIndex = begin, rightIndex = middle; while (merged.length < size) { if (leftIndex === middle) { merged.push(arr[rightIndex++]); } else if (rightIndex === end) { merged.push(arr[leftIndex++]); } else { const c = compare(arr[leftIndex], arr[rightIndex]); if (c <= 0) { merged.push(arr[leftIndex++]); } else { merged.push(arr[rightIndex++]); } } } arr.splice(begin, size, ...merged); } function sort(arr, compare) { if (!Array.isArray(arr)) { throw new Error('sort的参数必须为数组'); } _ms(arr, compare, 0, arr.length); return arr; } function getLanguage(id) { } function getLanguageByTip(id) { } function toWeights(array) { let max = 0; for (var i = 0; i < array.length; i++) { max = max + array[i]; if (array[i] == 0) { array[i] = 0; } else { array[i] = max; } } return array; } function unique(array) { var n = {}, r = [], len = array.length, val, type; for (var i = 0; i < array.length; i++) { val = array[i]; type = typeof val; if (!n[val]) { n[val] = [type]; r.push(val); } else if (n[val].indexOf(type) < 0) { n[val].push(type); r.push(val); } } return r; } function unique1(array) { var r = []; for (var i = 0, l = array.length; i < l; i++) { for (var j = i + 1; j < l; j++) if (array[i] == array[j]) j == ++i; r.push(array[i]); } return r; } function getDistance(x1, y1, x2, y2) { return Math.pow(((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)), 0.5); } function getV2Dis(pos1, pos2) { return Math.pow(((pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y)), 0.5); } function getV2SqDis(pos1, pos2) { return (pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y); } function getDis(x1, y1, x2, y2) { return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2); } function getDeltaxy(x1, y1, x2, y2) { return Math.abs(x1 - x2) + Math.abs(y1 - y2); } function getSymbolNumber(num) { if (num > 0) { return "+" + num; } else if (num < 0) { return num.toString(); } return num.toString(); } function fixNumber(num, length) { return ('' + num).length < length ? ((new Array(length + 1)).join('0') + num).slice(-length) : '' + num; } function toThousands(num) { return num.replace(/(\d)(?=(?:\d{3})+$)/g, '$1,'); } let moneyUnitStr = ["", "K", "M", "B", "T", "AK", "AM", "AB", "AT", "BK", "BM", "BB", "BT", "CK", "CM", "CB", "CT"]; function fmtMoney(money) { money = toThousands(money.replace(/^0+/, '')); if (money.length == 0) { money = "0"; } let unit = 0; for (var i = 0; i < money.length; i++) { if (money.charAt(i) == ",") { unit++; } } if (unit == 0) { return money; } else { let idx = money.indexOf(","); if (idx) { money = money.slice(0, idx + 2) + moneyUnitStr[unit]; } return money.replace(",", "."); } } function flatten(arr) { while (arr.some(item => Array.isArray(item))) { arr = [].concat(...arr); } return arr; } function getDistanceByPoint(p1, p2) { return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2)); } function getAngleByPoint(p1, p2) { return Math.atan2((p2.y - p1.y), (p2.x - p1.x)) * (180 / Math.PI); } function toIntByArray(array) { for (var index = 0; index < array.length; index++) { array[index] = parseInt(array[index]); } return array; } function getAngle0To360(angle) { while (angle < 0) { angle += 360; } while (angle >= 360) { angle -= 360; } return angle; } function toAngle(radian) { return radian * 180 / Math.PI; } function toRadian(angle) { return angle * Math.PI / 180; } function getArrayValueRandom(array) { return array[random(0, array.length - 1)]; } function promptByTip(tipId, color = "#FFFFFF", strokeColor = null, time = 1000, fontSize = 35, opacity = 1) { } function promptByErrorCode(id, color = "#FFFFFF", strokeColor = "#FF8B00", time = 1000, fontSize = 35, opacity = 1) { } function fmtTimeMMSS(time) { if (time < 0) { time = 0; } else time = Math.floor(time); return fixNumber(Math.floor(time / 60), 2) + ":" + fixNumber(time % 60, 2); } function fmtTimeMS(time) { if (time < 0) { time = 0; } return fixNumber(Math.floor(time / 60), 2) + "m" + fixNumber(time % 60, 2) + "s"; } function fmtTimeHHMM(time) { if (time < 0) { time = 0; } time = Math.floor(time / 1000); return fixNumber(Math.floor(time / 3600), 2) + ":" + fixNumber(Math.floor((time % 3600) / 60), 2) + ":" + fixNumber(Math.floor(time % 60), 2); } let severTime = 0; function getServerTime() { return new Date(new Date().getTime() - severTime); } function setServerTime(data) { severTime = (new Date().getTime() - data); } var tools = /*#__PURE__*/Object.freeze({ playClickEffect: playClickEffect, getNumList: getNumList, getStrList: getStrList, getRandStr: getRandStr, getUserId: getUserId, formatPos: formatPos, setPosInt: setPosInt, random: random, randomList: randomList, worldToScreen: worldToScreen, getStringLenght: getStringLenght, reviseString: reviseString, getCoinString: getCoinString, getV3Dest: getV3Dest, getV2Dest: getV2Dest, getV2Dir: getV2Dir, getV3Dir: getV3Dir, copyPos: copyPos, getScreenImg: getScreenImg, playMoveByPositions: playMoveByPositions, setStarPos: setStarPos, playLoopAnimRotate: playLoopAnimRotate, playLoopAnimPosition: playLoopAnimPosition, playLoopAnimScale: playLoopAnimScale, playLoopAnimRotation: playLoopAnimRotation, inRect: inRect, getNumberK: getNumberK, pointInsideCircle: pointInsideCircle, formatString: formatString, getIntersection: getIntersection, getComplement: getComplement, geSpriteStageRect: geSpriteStageRect, touchButton: touchButton, setColor: setColor, clone: clone, sort: sort, getLanguage: getLanguage, getLanguageByTip: getLanguageByTip, toWeights: toWeights, unique: unique, unique1: unique1, getDistance: getDistance, getV2Dis: getV2Dis, getV2SqDis: getV2SqDis, getDis: getDis, getDeltaxy: getDeltaxy, getSymbolNumber: getSymbolNumber, fixNumber: fixNumber, toThousands: toThousands, fmtMoney: fmtMoney, flatten: flatten, getDistanceByPoint: getDistanceByPoint, getAngleByPoint: getAngleByPoint, toIntByArray: toIntByArray, getAngle0To360: getAngle0To360, toAngle: toAngle, toRadian: toRadian, getArrayValueRandom: getArrayValueRandom, promptByTip: promptByTip, promptByErrorCode: promptByErrorCode, fmtTimeMMSS: fmtTimeMMSS, fmtTimeMS: fmtTimeMS, fmtTimeHHMM: fmtTimeHHMM, getServerTime: getServerTime, setServerTime: setServerTime }); class HttpMgr { constructor() { HttpMgr._instance = this; } static getInstance() { if (!this._instance) { this._instance = new HttpMgr(); } return this._instance; } sendPost(url, data, call) { let httpObj = new Laya.HttpRequest(); httpObj.http.timeout = 5000; httpObj.once(Laya.Event.COMPLETE, this, completeHandler); httpObj.once(Laya.Event.ERROR, this, errorHandler); httpObj.send(url, data, 'post', 'text', ["Content-Type", "application/json; charset=UTF-8"]); function errorHandler(error) { console.log("errorHandler:" + error); alert("Please check your network connection."); } function completeHandler(data) { if (data && data.length > 0) { let jsonData = JSON.parse(data); if (call) call(jsonData); } } } sendPost2025(reqUrl, data, call) { let isDev = false; let urlTop = "https://api.kessongame.site/"; let urlMid = urlTop + "prod-api/api/game/"; if (isDev) { urlTop = "http://192.168.1.13:8090/"; urlMid = urlTop + "api/game/"; } let url = urlMid + reqUrl; if (reqUrl == "registerForApp" || reqUrl == "loginForApp") { if (isDev) { url = urlTop + reqUrl; } else { url = urlTop + "prod-api/" + reqUrl; } } let httpObj = new Laya.HttpRequest(); httpObj.http.timeout = 5000; httpObj.once(Laya.Event.COMPLETE, this, completeHandler); httpObj.once(Laya.Event.ERROR, this, errorHandler); httpObj.send(url, data, 'post', 'text', ["Content-Type", "application/json; charset=UTF-8"]); function errorHandler(error) { if (call) { call("{'msg':'Network exception','code':500}"); } else { alert("Tip:Please check your network connection."); } } function completeHandler(data) { if (data && data.length > 0) { let jsonData = JSON.parse(data); if (call) call(jsonData); } } } sendGet(url, call) { let httpObj = new Laya.HttpRequest(); httpObj.http.timeout = 5000; httpObj.once(Laya.Event.COMPLETE, this, completeHandler); httpObj.once(Laya.Event.ERROR, this, errorHandler); httpObj.send(url, '', 'get'); function errorHandler(error) { console.log("errorHandler:" + error); } function completeHandler(data) { if (data && data.length > 0) { if (call) call(data); } } } } HttpMgr._instance = null; class LightShader extends Laya.Sprite { constructor() { super(); this._time = 0; this._sin = 0; this.initShader(); } initShader() { var vs = ` #define FSHIGHPRECISION attribute vec4 posuv; uniform vec2 size; varying vec4 v_texcoord; void main() { vec4 pos = vec4(posuv.xy,0.,1.); vec4 pos1 =vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,0.,1.0); gl_Position=pos1; v_texcoord.xy = posuv.xy; } `; var ps = ` #define FSHIGHPRECISION precision highp float; varying vec4 v_texcoord; uniform vec2 size; uniform sampler2D texture; uniform float u_Time; void main() { vec4 color= texture2D(texture, v_texcoord.xy); float width = 0.2; float start = u_Time; float offset = 1.0; vec2 myuv = vec2(v_texcoord.x/size.x,v_texcoord.y/size.y); if( myuv.x < (start - offset * myuv.y) && myuv.x > (start - offset * myuv.y - width)) { color.r=1.1; color.g=1.1; color.b=1.1; gl_FragColor = color; } else { gl_FragColor = color; } } `; this.shaderValue = new Laya.Value2D(LightShader.DissolveSurfaceSaveName, LightShader.DissolveSurfaceSaveName); this.customRenderEnable = true; this.shaderValue.shader = new Laya.Shader2X(vs, ps, LightShader.DissolveSurfaceSaveName); } customRender(context, x, y) { this.onUpdate(); if (!this.texture) return; let xx = x - this.pivotX; let yy = y - this.pivotY; context.drawTarget(this.texture, xx, yy, this.width, this.height, null, this.shaderValue); } onUpdate() { this._time += 2 * Laya.timer.delta * 0.001; this._sin = Math.sin(this._time); if (this._sin > 0.99) { this._sin = 0; this._time = 0; } this.shaderValue['u_Time'] = this._sin; } } LightShader.DissolveSurfaceSaveName = 9997; class UIBase extends fairygui.Window { constructor() { super(); this.isEject = true; this.isHide = true; this.showbanner = true; this.className = ""; this.isMuti = false; this.showbanner = false; this.onConstructor(); } checkActive(show) { } getUIName() { return UIBase.uiName; } onConstructor() { } onInit() { if (!!this.contentPane) { this.contentPane.setSize(fairygui.GRoot.inst.width, fairygui.GRoot.inst.height); } this.setPivot(0.5, 0.5, false); } doShowAnimation() { if (!this.isEject) return; super.doShowAnimation(); Laya.Tween.clearTween(this); this.scaleX = this.scaleY = 0.8; let tweenFunc1 = (func) => { Laya.Tween.to(this, { scaleX: 1.1, scaleY: 1.1 }, 100, Laya.Ease.linearIn, Laya.Handler.create(this, func)); }; let tweenFunc2 = (func) => { Laya.Tween.to(this, { scaleX: 1, scaleY: 1 }, 60, Laya.Ease.linearOut, Laya.Handler.create(this, this.refresh)); }; tweenFunc1(tweenFunc2); } show(...args) { super.show(); this._openParam = args; this.isHide = false; xGame.uiMgr.checkUIState(); } moveBannerButton() { } showBannerButton() { this.bannerButton.visible = true; Laya.Tween.to(this.bannerButton, { alpha: 1 }, 500, Laya.Ease.linearOut, Laya.Handler.create(this, () => { this.bannerButton.touchable = true; })); } hide() { super.hide(); this.isHide = true; xGame.uiMgr.checkUIState(); } Dispose() { super.dispose(); } myUpdate(delay) { } refresh() { } addUIClick(obj, func, arr = null) { obj.onClick(this, func, arr); obj.onClick(this, this.playBtnSound); } offUIClick(obj, func) { obj.offClick(this, func); } playBtnSound() { xGame.soundMgr.playSound(xGame.common.btnClickStr); } } UIBase.lastShowBanner = 0; UIBase.showBannerNum = 0; UIBase.uiName = ""; class ui_UIDraw extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "UIDraw")); } onConstruct() { this.n1 = (this.getChild("n1")); this.extraNode = (this.getChild("extraNode")); this.myNode = (this.getChild("myNode")); this.closeNode = (this.getChild("closeNode")); this.moneyNode = (this.getChild("moneyNode")); this.n38 = (this.getChild("n38")); this.secretary = (this.getChild("secretary")); this.drawBtn = (this.getChild("drawBtn")); this.talkNode = (this.getChild("talkNode")); this.t0 = this.getTransition("t0"); } } ui_UIDraw.URL = "ui://isxx5ak7wcn5v4ke"; class ui_UIBox extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "UIBox")); } onConstruct() { this.n0 = (this.getChild("n0")); this.n12 = (this.getChild("n12")); this.n1 = (this.getChild("n1")); this.n2 = (this.getChild("n2")); this.bar = (this.getChild("bar")); this.closeBtn = (this.getChild("closeBtn")); this.openBtn = (this.getChild("openBtn")); this.t0 = this.getTransition("t0"); this.t1 = this.getTransition("t1"); } } ui_UIBox.URL = "ui://isxx5ak7erstv4nm"; class GlobalManager { constructor() { } registerMethod(name, method) { console.log('zh: 注册全局方法', name); this[name] = method; } callMethod(name, ...args) { console.log('zh: 调用全局方法', name); if (this[name]) { return this[name](...args); } else { console.error(`zh: 全局方法 Method ${name} not found`); } } } GlobalManager.instance = new GlobalManager(); class JSBridgeUtils { constructor() { } static get instance() { if (!this._instance) { this._instance = new JSBridgeUtils(); } return this._instance; } initBridge() { if (!Laya.Browser.onAndroid) { console.log('zh:非android dev'); return; } let cfg = window['conchConfig']; if (cfg) { var os = cfg.getOS(); if (os == "Conch-android") { this.bridge = window['PlatformClass'].createClass("demo.JSBridge"); if (this.bridge) { return true; } else { return false; } } else { return false; } } else { return false; } } testAd1() { if (!Laya.Browser.onAndroid) { console.log('zh:非android dev'); return; } if (!this.initBridge()) { return; } let rs = this.bridge.call("testString", "hello"); console.log('zh:testString rs=' + rs); } testAdCallBack() { if (!this.initBridge()) { return; } console.log("zh:testAdCallBack start"); const defaultObj = { code: 200, msg: "req update Ui" }; const reqObj = { code: 300, msg: "hello java ui" }; this.bridge.callWithBack((rsStr) => { const rsObj = JSON.parse(rsStr); console.log(`zh:testAsyncCallback js收到java返回值=${rsStr}`); }, "testAsyncCallback", JSON.stringify(reqObj)); } showInternAd(mark) { console.log('zh:showInternAd start'); if (!Laya.Browser.onAndroid) { console.log('zh:showInternAd 非android dev'); return false; } if (!this.initBridge()) { return false; } let rs = this.bridge.call("showInternAd", mark); try { const result = JSON.parse(rs); if (result.code === 200) { console.log("zh:showInternAd OK"); return true; } else { console.warn("zh:showInternAd FAILL:", result.msg); return false; } } catch (e) { console.error("zh:解析桥接返回值失败:", e); return false; } } exitAndCloseGame() { if (!Laya.Browser.onAndroid) { console.log('zh:非android dev'); return; } if (!this.initBridge()) { return; } console.log('zh:开始关闭游戏-'); this.bridge.call("exitAndCloseGame"); } showRewardAd(mark) { if (!Laya.Browser.onAndroid) { console.log('zh:非android dev'); return false; } if (!this.initBridge()) { return false; } let rs = this.bridge.call("showRewardAd", mark); console.log('zh:showRewardAd rs= ' + rs + ' ,mark=' + mark); try { const result = JSON.parse(rs); if (result.code === 200) { console.log("zh:广告显示成功"); return true; } else { console.warn("zh:广告显示失败:", result.msg); return false; } } catch (e) { console.error("zh:解析桥接返回值失败:", e); return false; } } logEventForAdNoParams(eventName) { console.log("zh:logEventForAdNoParams eventName1=" + eventName); if (!Laya.Browser.onAndroid) { console.log('zh:非android dev'); return; } if (!this.initBridge()) { return; } console.log("zh:call logEventForAdNoParams eventName2=" + eventName); this.bridge.call("logEventForAdNoParams", eventName); } logEventForAdHaveParams(eventName, jsonStr) { console.log("zh:ts logEventForAdHaveParams eventName1=" + eventName); if (!Laya.Browser.onAndroid) { console.log('zh:非android dev'); return; } if (!this.initBridge()) { return; } console.log("zh:call logEventForAdHaveParams eventName2=" + eventName); console.log("zh:logEventForAdHaveParams req = json=" + jsonStr); this.bridge.call("logEventForAdHaveParams", eventName, jsonStr); } logEventForFirebase(eventName, jsonStr) { console.log("zh:ts logEventForFirebase eventName1=" + eventName); if (!Laya.Browser.onAndroid) { console.log('zh:非android dev'); return; } if (!this.initBridge()) { return; } console.log("zh:call logEventForFirebase eventName2=" + eventName); console.log("zh:logEventForFirebase req = json=" + jsonStr); this.bridge.call("logEventForFirebase", eventName, jsonStr); } nativeCallJs(msg) { console.log("zh:nativeCallJs received data: 1111", msg); if (msg === 'Ad1') { GlobalManager.instance.callMethod('Ad1'); console.log("zh: Ad1 奖励发送成功"); } else if (msg === 'Ad2') { GlobalManager.instance.callMethod('Ad2'); console.log("zh: Ad2 奖励发送成功"); } else if (msg === 'Ad3') { GlobalManager.instance.callMethod('Ad3'); console.log("zh: Ad3 奖励发送成功"); } else if (msg === 'Ad4') { GlobalManager.instance.callMethod('Ad4'); console.log("zh: Ad4 奖励发送成功"); } else if (msg === 'Ad5') { console.log("zh: Ad5 奖励发送成功"); GlobalManager.instance.callMethod('Ad5'); } } } class UIBox extends UIBase { constructor() { super(); this.boxNum = 0; this.boxMax = 10; this.inAd = false; this.isClose = false; } onConstructor() { this.ui = ui_UIBox.createInstance(); this.contentPane = this.ui; this.isEject = false; this.addUIClick(this.ui.closeBtn, this.onCloseBox); this.addUIClick(this.ui.openBtn, this.onOpenBox); Laya.timer.loop(1000, this, this.update); } update() { if (this.boxNum > 0 && this.boxNum < this.boxMax) { this.boxNum -= 1; this.upBar(); } } upBar() { if (this.boxNum > this.boxMax) this.boxNum = this.boxMax; this.ui.bar.value = this.boxNum * 10; } show() { super.show(); this.isClose = false; this.boxNum = 0; this.inAd = false; this.upBar(); this.ui.t0.play(); this.ui.closeBtn.visible = false; Laya.timer.once(3000, this, () => { this.ui.closeBtn.visible = true; this.ui.bar.alpha = 1; }); Laya.timer.once(500, this, () => { this.ui.t1.play(); }); } hide() { Laya.timer.clearAll(this); Moyu.showBannerAd(false); super.hide(); } onOpenBox() { this.boxNum++; if (this.boxNum < this.boxMax) { if (PlatMgr.getRand() < PlatMgr.boxInsertRate) { JSBridgeUtils.instance.showInternAd('uivideoshare_show'); } } else if (this.boxNum == this.boxMax) { if (PlatMgr.getRand() < PlatMgr.boxVideoRate) { this.ui.openBtn.c1.selectedIndex = 13; this.inAd = true; } else this.getAward(); } else if (this.inAd) { console.log('zh:qjff_AD_for_UIBOX_onOpenBox'); if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) { } else { console.log('zh:AD 失败,直接发放奖励'); this.qjff_AD_for_UIBOX_onOpenBox(); } } this.upBar(); } qjff_AD_for_UIBOX_onOpenBox() { this.getAward(); } onCloseBox() { if (this.isClose) this.hide(); else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) { this.isClose = true; PlatMgr.showBanner(true, 0, 3000); } else this.hide(); } getAward() { let str = ""; if (Math.random() < 0.5) { let max = Moyu.isLegal ? 500 : 2500; let num = xGame.tools.random(max, 500 + max); DataMgr.setCoin(num); str = "金币x" + num; } else { let max = Moyu.isLegal ? 10 : 30; let num = xGame.tools.random(max, 30 + max); DataMgr.setDiamond(num); str = "钻石x" + num; } xGame.showTip("恭喜获得-" + str); this.hide(); } } UIBox.uiName = "UIBox"; class ui_UITry extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "UITry")); } onConstruct() { this.n11 = (this.getChild("n11")); this.myNode = (this.getChild("myNode")); this.t0 = this.getTransition("t0"); } } ui_UITry.URL = "ui://isxx5ak7cj92v4o4"; class UITry extends UIBase { constructor() { super(); this.closeTime = 0; this.closeNum = 0; this.skillUrl = xGame.common.skillIconList; } onConstructor() { this.ui = ui_UITry.createInstance(); this.contentPane = this.ui; this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel); this.addUIClick(this.ui.myNode.videoBtn, this.onTry); } show() { super.show(); this.closeNum = 0; this.closeTime = 15; this.ui.t0.play(); PlatMgr.showRateBanner(); this.ui.myNode.txtTime.text = this.closeTime.toString(); Laya.timer.loop(1000, this, this.updateTime); let iconStr = this.skillUrl[xGame.common.curPlayerSkillType]; this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr); xGame.common.gameMgr.gamePause = true; } updateTime() { if (this.closeTime > 1) { this.closeTime--; this.ui.myNode.txtTime.text = this.closeTime.toString(); } else this.hide(); } hide() { Laya.timer.clearAll(this); Moyu.showBannerAd(false); super.hide(); xGame.common.gameMgr.gamePause = false; } onTry() { console.log('zh:qjff_AD_for_uitry'); if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) { } else { console.log('zh:AD 失败,直接发放奖励'); this.qjff_AD_for_uitry(); } } qjff_AD_for_uitry() { let select = xGame.common.curPlayerSkillType; DataMgr.gameData.trySkill = select; DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000; DataMgr.saveGameData(); DataMgr.setBigSkill(select, 1); xGame.showTip("Trial Successful"); this.hide(); } onCancel() { if (this.closeNum > 0) { this.closeNum--; if (this.closeNum < 2) this.hide(); return; } else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) { this.onTry(); } else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) { this.closeNum = 3; } else this.hide(); } } UITry.uiName = "UITry"; class PlatMgr { static initConfig() { this.lastVt = 0; if (!Moyu.platConfig) return; for (let k in Moyu.platConfig) { let pd = this[k]; let pc = Moyu.platConfig[k]; if (pd != undefined && pc != undefined) this[k] = pc; } Moyu.setBannerPos(0.5, 1); } static rand100(num) { return xGame.tools.random(0, 100) < num; } static isMisVideo() { let dt = Laya.timer.currTimer - this.lastVt; if (dt > this.forceVideoGap && this.rand100(this.forceVideoRate)) { this.lastVt = Laya.timer.currTimer; return true; } else { if (this.rand100(this.fullVideoRate)) { console.log('zh:插屏 ad start'); JSBridgeUtils.instance.showInternAd('platMgr'); } return false; } } static showVideo(call, type) { Moyu.showVideoAd(() => { this.lastVt = Laya.timer.currTimer; call && call(); }, type); } static showInsert(delay = false) { if (this.getRand() < this.insertRate) { let dt = delay ? this.insertDelay : 0; console.log('zh:插屏 ad start'); JSBridgeUtils.instance.showInternAd('gameInsert'); } } static gameInsert() { let t = this.getRand(); let r = this.gameInsertRate; if (t < r) { console.log('zh:插屏 ad start 游戏中每回合开始插屏 t: %d, r: %d', t, r); } } static showRateBanner() { if (this.getRand() < this.bannerRate) this.showBanner(true, this.bannerDelay, 3000); } static showBanner(show, delay = 0, hide = 0) { if (2 > 1) { console.log('zh:显示showBanner广告 直接返回'); return; } if (!show) Moyu.showBannerAd(false); else { Laya.timer.clear(this, this.bannerShow); if (delay > 0) Laya.timer.once(delay, this, this.bannerShow, [true]); else this.bannerShow(true); if (hide > 0) Laya.timer.once(hide, this, this.bannerShow, [false]); } } static bannerShow(show) { if (2 > 1) { console.log('zh:显示showBanner广告 直接返回'); return; } Moyu.showBannerAd(show); console.log("showBanner" + show); } static getRand() { return xGame.tools.random(0, 100); } static openBox() { if (this.getRand() < this.boxRate) xGame.uiMgr.Show(UIBox); } static openTry() { if (Laya.timer.currTimer < DataMgr.gameData.tryTime) return; if (this.getRand() < this.tryRate) xGame.uiMgr.Show(UITry); else if (DataMgr.gameData.gameCount == 1) xGame.uiMgr.Show(UITry); } } PlatMgr.forceShare = 0; PlatMgr.signAdRate = 0; PlatMgr.forceVideoRate = 0; PlatMgr.forceVideoGap = 0; PlatMgr.fullVideoRate = 0; PlatMgr.gameInsertRate = 0; PlatMgr.insertGap = 0; PlatMgr.insertDelay = 0; PlatMgr.insertRate = 0; PlatMgr.boxRate = 0; PlatMgr.boxVideoRate = 0; PlatMgr.boxInsertRate = 0; PlatMgr.boxBannerRate = 0; PlatMgr.tryRate = 0; PlatMgr.tryClose3Rate = 0; PlatMgr.tryVideoRate = 0; PlatMgr.bannerRate = 0; PlatMgr.lastVt = 0; class ui_UIAddProp extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "UIAddProp")); } onConstruct() { this.n11 = (this.getChild("n11")); this.myNode = (this.getChild("myNode")); this.closeBtn = (this.getChild("closeBtn")); this.t0 = this.getTransition("t0"); } } ui_UIAddProp.URL = "ui://isxx5ak7p4tr42k"; class SpineMgr { constructor(name, loadCb = null) { this.loaded = false; this.spineName = ''; this.loadedCallback = loadCb; this.templet = new Laya.Templet(); this.templet.on(Laya.Event.COMPLETE, this, this.parseComplete); this.templet.on(Laya.Event.ERROR, this, this.onError); if (name === 'mishu') { this.templet.loadAni('spine/nvmishu.sk'); } else { this.templet.loadAni(`spine/${name}.sk`); } this.templet.lock = true; this.spineName = name; } onError() { console.log("zh:spine加载出错"); } parseComplete() { this.loaded = true; this.loadedCallback && this.loadedCallback(); } dispose() { if (this.templet && !this.templet.destroyed) { this.templet.destroy(); } this.templet = null; } play(data, aniIndex, isLoop = true, parent, callback, mySpine = null) { if (!this.loaded) { return; } let spine; if (mySpine) { spine = mySpine; } else { spine = this.createSpine(data, parent); } spine.play(aniIndex, isLoop, true, 0, 0, true); if (!isLoop) { spine.on(Laya.Event.STOPPED, this, () => { spine.offAll(Laya.Event.STOPPED); callback && callback(spine); }); } return spine; } createSpine(data, parent, type = 1) { let spine; spine = this.templet.buildArmature(type); spine.showSkinByIndex(0); parent.addChild(spine); spine.pos(data.x, data.y); spine.scale(data.scaleX, data.scaleY, true); return spine; } } var AIState; (function (AIState) { AIState[AIState["none"] = 0] = "none"; AIState[AIState["idle"] = 1] = "idle"; AIState[AIState["reset"] = 2] = "reset"; AIState[AIState["move"] = 3] = "move"; AIState[AIState["wait"] = 4] = "wait"; AIState[AIState["select"] = 5] = "select"; AIState[AIState["turn"] = 6] = "turn"; AIState[AIState["shoot"] = 7] = "shoot"; AIState[AIState["leave"] = 8] = "leave"; })(AIState || (AIState = {})); class AIPlayer { constructor() { this.dtime = 30; this.awayTime = 0; this.awayNum = 0; this.hideTime = 0; this.rootMoveTime = 0; this.isGuide = false; this.state = AIState.none; this.waitTime = 0; this.forceNum = 0; this.forceMax = 0; this.ballSize = 33; this.selectNum = 0; this.destRot = 0; this.aiLv = 10; this.kickBall = []; this.lineBall = []; this.scoreBall = []; this.holeBall = []; this.turnNum = 0; this.setNum = 0; this.setMax = 0; this.setRate = 0; this.rectL = 0; this.rectR = 0; this.rectT = 0; this.rectB = 0; this.rootPos = { x: 0, y: 0 }; this.bestForce = 0; this.bestAngle = 180; this.bestPos = { x: 0, y: 0 }; this.bestKick = { x: 0, y: 0 }; this.posList = []; this.posIdx = 0; this.chatTime = 3000; this.tempDir1 = new Laya.Vector2(); this.tempDir2 = new Laya.Vector2(); this.tempDir3 = new Laya.Vector2(); Laya.timer.loop(this.dtime, this, this.onUpdate); xGame.eventMgr.off(RESET_GAME, this, this.resetAI); xGame.eventMgr.on(RESET_GAME, this, this.resetAI); this.gameSrc = xGame.common.gameUI; this.hideTime = Laya.timer.currTimer; Moyu.setOnTipCall((id) => { if (id == 20012) this.hideTime = Laya.timer.currTimer; else (id == 20011); { let dt = Laya.timer.currTimer - this.hideTime; console.log("onshow" + dt); if (dt > 30000 && this.state > AIState.none) xGame.common.gameMgr.aiGameEnd(false); } }, this); } init() { this.isGuide = DataMgr.getSkillGuide() < 1 || DataMgr.gameData.gameCount < 1; this.awayTime = xGame.tools.random(5000, 10000); this.awayNum = 0; this.hideTime = Laya.timer.currTimer; let rect = xGame.common.d2World.borderRect; this.rectL = Math.ceil(rect.x) + 17; this.rectT = Math.ceil(rect.y) + 17; this.rectR = Math.floor(rect.x + rect.width) - 17; this.rectB = Math.floor(rect.y + rect.height) - 17; this.wBall = xGame.common.d2World.rootBall; this.ballSize = this.wBall.gameObj.width - 1; if (this.posList.length < 1) { let dp = 40; for (let i = this.rectL; i < this.rectR + dp; i = i + dp) { for (let j = this.rectT; j < this.rectB + dp; j = j + dp) { let dx = i < this.rectR ? i : this.rectR; let dy = j < this.rectB ? j : this.rectB; let order = xGame.tools.random(0, 1000); this.posList.push({ x: dx, y: dy, order: order }); } } this.posList.sort(function (a, b) { return a.order - b.order; }); this.setMax = this.posList.length; } this.state = AIState.idle; } setAiLevel(num) { this.aiLv = num; } initBall() { this.rootPos.x = this.wBall.gameObj.x; this.rootPos.y = this.wBall.gameObj.y; this.initHoleBall(); } initHoleBall() { this.kickBall = []; this.lineBall = []; this.scoreBall = []; this.holeBall = []; this.selectNum = 0; this.forceNum = 0; this.forceMax = 0; this.turnNum = 0; let list = xGame.common.d2World.ballArr; if (list.length < 20 && !this.isGuide) { let holes = xGame.common.gameMgr.holePosList; for (let i = 0; i < list.length; i++) { let obj = list[i]; if (!obj) continue; obj.kickPos.x = 0; obj.kickPos.y = 0; obj.poleAngle = 0; obj.hard = 0; obj.borderDis = 0; obj.kickAngle = 180; if (obj.number == 0) continue; if (obj.ballType == xGame.common.gameMgr.selfCamp) continue; if (obj.number == 8 && xGame.common.gameMode == 0) { if (xGame.common.gameMgr.aiBallArr.length > 0 || !xGame.common.gameMgr.ensureBallType) continue; } let b = obj.gameObj; let wbp = this.rootPos; let bx = wbp.x - b.x; let by = wbp.y - b.y; obj.borderDis = xGame.tools.random(0, 100); this.kickBall.push(obj); if (!this.isLine(wbp, obj)) continue; obj.kickAngle = xGame.tools.random(90, 180); obj.kickPos.x = b.x; obj.kickPos.y = b.y; this.lineBall.push(obj); let minDis = 999999; let hole = false; for (let j = 0; j < holes.length; j++) { let hp = holes[j]; if (bx >= 0 && hp.x > b.x + 100) continue; if (bx <= 0 && hp.x < b.x - 100) continue; if (by < -10 && hp.y < wbp.y) continue; if (by > 10 && hp.y > wbp.y) continue; if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) { let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y); if (dis < minDis) { let dx = b.x - this.tempDir1.x * this.ballSize; let dy = b.y - this.tempDir1.y * this.ballSize; this.tempDir3.x = this.tempDir1.x; this.tempDir3.y = this.tempDir1.y; if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) { obj.kickPos.x = dx; obj.kickPos.y = dy; let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3); if (num > 1) num = 1; obj.kickAngle = Math.acos(num) * 57.3; if (b.x < this.rectL + 2 || b.x > this.rectR - 2 || b.y < this.rectT + 2 || b.y > this.rectB - 2) dis = dis * 2; if (Math.abs(hp.x - 600) < 100) dis += 50; obj.hard = dis + obj.kickAngle * 3; hole = true; } } } } if (hole) { this.scoreBall.push(obj); this.holeBall.push(obj); } } this.scoreBall.sort(function (a, b) { return a.hard - b.hard; }); this.holeBall.sort(function (a, b) { return a.kickAngle - b.kickAngle; }); this.kickBall.sort(function (a, b) { return a.borderDis - b.borderDis; }); } else { let max = list.length - 1; let i = xGame.tools.random(0, max); for (i; i <= max; i++) { let idx = i >= max ? i -= max : i; let obj = list[idx]; if (obj && obj.number != 0) { obj.kickAngle = xGame.tools.random(90, 180); obj.kickPos.x = obj.gameObj.x + xGame.tools.random(-10, 10); obj.kickPos.y = obj.gameObj.y + xGame.tools.random(-10, 10); this.lineBall.push(obj); break; } } } } selectBall() { let ball = null; this.destRot = 0; let max = this.isGuide ? 1 : 3 - Math.ceil(this.aiLv / 4) + xGame.tools.random(0, 2); let ai = 110 - this.aiLv * 10; let mis = xGame.tools.random(-ai, ai) * 0.005; let score = false; if (this.scoreBall.length < 1) { if (this.lineBall.length < 1) { for (let i = 0; i < this.kickBall.length; i++) { let list = []; let bo = this.kickBall[i]; let bobj = bo.gameObj; let rect = xGame.common.d2World.borderRect; let mobj = this.wBall.gameObj; let minb = bobj.y - rect.y - 20; let minw = mobj.y - rect.y - 50; if (minb > 0 && minw > 0) { let dlenx = 0; let dleny = mobj.y - rect.y; let spx = mobj.x; let spy = rect.y - dleny; list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny }); } minb = rect.y + rect.height - bobj.y - 20; minw = rect.y + rect.height - mobj.y - 50; if (minb > 0 && minw > 0) { let dlenx = 0; let dleny = rect.y + rect.height - mobj.y; let spx = mobj.x; let spy = rect.y + rect.height + dleny; list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny }); } minb = bobj.x - rect.x - 20; minw = mobj.x - rect.x - 50; if (minb > 0 && minw > 0) { let dlenx = mobj.x - rect.x; let dleny = 0; let spx = rect.x - dlenx; let spy = mobj.y; list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny }); } minb = rect.x + rect.width - bobj.x - 20; minw = rect.x + rect.width - mobj.x - 50; if (minb > 0 && minw > 0) { let dlenx = rect.x + rect.width - mobj.x; let dleny = 0; let spx = rect.x + rect.width + dlenx; let spy = mobj.y; list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny }); } list.sort(function (a, b) { return a.order - b.order; }); for (let i = 0; i < list.length; i++) { let data = list[i]; let mx = mobj.x - bobj.x; let my = mobj.y - bobj.y; xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1); xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2); let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2); if (num > 1) num = 1; let cos = Math.acos(num); if (cos > 1.57) cos = 1.57; else if (cos < 0.01) cos = 0.01; let tan = Math.tan(cos); let dx = tan * data.dleny; let dy = tan * data.dlenx; let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx)); if (Math.abs(bx - 667) < 40) continue; let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy)); if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) { let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y); this.forceMax = dis * 0.08; this.destRot += mis * 0.1; this.setKick(bx, by); return true; } } } } else { ball = xGame.common.getRandArrEle(this.lineBall); } } else { for (let i = 0; i < this.scoreBall.length; i++) { if (i < this.scoreBall.length - 1) { let rand = 70 + this.aiLv * 10 + i * 10; if (xGame.tools.random(0, 100) < rand) { ball = this.scoreBall[i]; break; } } else { ball = this.scoreBall[i]; break; } } score = true; this.selectNum++; } if (!ball) ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr); if (this.selectNum >= max) { let dx = ball.gameObj.x; let dy = ball.gameObj.y; let kickAngle = 0; if (score) { dx = ball.kickPos.x; dy = ball.kickPos.y; this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2); this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3); let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2); if (adot > 1) adot = 1; kickAngle = Math.acos(adot) * 57.3; if (kickAngle > 45) { let kdx = ball.kickPos.x - ball.gameObj.x; let kdy = ball.kickPos.y - ball.gameObj.y; dx = ball.kickPos.x - kdx * mis * 0.3; dy = ball.kickPos.y - kdy * mis * 0.3; } else this.destRot += mis; } else if (ball.poleAngle != 0) { this.destRot += ball.poleAngle; } if (xGame.common.gameMode == 0) { let af = kickAngle * 0.08; this.forceMax = ball.hard * 0.1 + af * af; } this.setKick(dx, dy); } else { let rand = this.aiLv * 5 + 40; if (xGame.tools.random(0, 100) < rand && this.scoreBall.length > 0) ball = xGame.common.getRandArrEle(this.scoreBall); else ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr); rand = this.aiLv * 3 + 40 + this.selectNum * 20; if (xGame.tools.random(0, 100) > rand) { this.selectNum = max; } this.setState(AIState.select, xGame.tools.random(500, 1000)); this.selectNum++; } ball.onClick(0, true); } isBlock(bn, bx, by, hx, hy, dn = -1) { this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1); let balls = xGame.common.d2World.ballArr; let max = xGame.tools.getDis(hx, hy, bx, by); for (let index = 0; index < balls.length; index++) { let obj = balls[index]; if (obj.number == 0) continue; if (obj.number == bn || obj.number == dn) continue; let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by); if (dis * dis > max) continue; this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2); let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2); if (num > 1) num = 1; if (num < 0) continue; let gap = Math.sin(Math.acos(num)) * dis; if (gap < this.ballSize) return true; } return false; } isLine(xy, ball) { let bx = xy.x; let by = xy.y; if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) { let dis = ball.getDestDis(xy); let angle = Math.asin((ball.gameObj.width - 3) / dis); let sin = Math.sin(angle); let cos = Math.cos(angle); this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3); this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin; this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos; let dx = bx + this.tempDir2.x * dis; let dy = by + this.tempDir2.y * dis; let isr = this.isBlock(0, bx, by, dx, dy, ball.number); sin = Math.sin(-angle); cos = Math.cos(-angle); this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin; this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos; dx = bx + this.tempDir2.x * dis; dy = by + this.tempDir2.y * dis; let isl = this.isBlock(0, bx, by, dx, dy, ball.number); if (isr && isl) return false; ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3; } return true; } turnPole() { this.turnNum++; let rot = xGame.common.d2World.d2Gan.ui.rotation % 360; let dr = rot - this.destRot; let abs = Math.abs(dr) % 360; if (abs > 180) { if (rot > 180) rot -= 360; if (this.destRot > 180) this.destRot -= 360; } let max = this.turnNum * 5 + this.aiLv * 5; if (abs < 0.2 && xGame.tools.random(0, 100) < max) { xGame.common.d2World.d2Gan.rotDest(this.destRot); let at = xGame.tools.random(1000, 2000); if (!this.onAway(3)) at += xGame.tools.random(10000, 15000); this.setState(AIState.shoot, at); } else { let mr = 0; if (abs > 3) mr = 1 + xGame.tools.random(2, 6) * abs * 0.01; else if (Math.random() > 0.6) mr = xGame.tools.random(1, 10) * 0.1; mr = dr > 0 ? -mr : mr; xGame.common.d2World.d2Gan.rotDest(rot + mr); } } setKick(dx, dy) { this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1; this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2); this.tempDir1.x = 0; this.tempDir1.y = 1; this.tempDir2.y = -this.tempDir2.y; let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2); if (num > 1) num = 1; let rot = Math.acos(num) * 57.3; if (this.tempDir2.x < 0) rot = 360 - rot; this.destRot += rot; if (!xGame.common.gameMgr.finishOneShoot) { this.forceMax += xGame.tools.random(10, 50); this.forceMax -= this.aiLv * 2; if (this.forceMax < 20) this.forceMax = 20; } if (this.forceMax > 100) this.forceMax = 101; else if (this.forceMax < 10) this.forceMax += xGame.tools.random(0, 10); if (xGame.common.gameMode == 1) this.forceMax = xGame.tools.random(80, 100); else this.forceMax = xGame.tools.random(this.forceMax * 0.5, this.forceMax); let max = 2000 - this.aiLv * 100; if (Math.random() > 0.8) max += xGame.tools.random(100, 2000); this.setState(AIState.turn, xGame.tools.random(500, max)); } shoot() { if (this.waitTime < 0 && Math.abs(this.forceNum - this.forceMax) < 4) { if (Math.random() > 0.8) { this.gameSrc.aiForce(1); this.setState(AIState.wait); } } else { let df = xGame.tools.random(3, 8); if (this.forceNum < this.forceMax) this.forceNum += df; else this.forceNum -= df; let startY = this.gameSrc.ui.powerNode.y; let height = this.gameSrc.ui.powerNode.height; let force = startY + height * this.forceNum * 0.01; this.gameSrc.aiForce(2, force); } } reset() { for (let i = 0; i < 4; i++) { this.setRate--; this.setNum++; let pos = this.posList[this.posIdx]; this.rootPos.x = pos.x + xGame.tools.random(-20, 20); this.rootPos.y = pos.y + xGame.tools.random(-20, 20); if (!xGame.common.gameMgr.isTouchedBall && this.rootPos.x > 387) this.rootPos.x = 387; if (this.rootPos.x < this.rectL) this.rootPos.x = this.rectL; else if (this.rootPos.x > this.rectR) this.rootPos.x = this.rectR; if (this.rootPos.y < this.rectT) this.rootPos.y = this.rectT; else if (this.rootPos.y > this.rectB) this.rootPos.y = this.rectB; this.posIdx++; let max = this.posList.length; if (this.posIdx >= max) this.posIdx -= max; this.initHoleBall(); let ball = null; if (this.scoreBall.length > 0) ball = this.scoreBall[0]; else if (this.lineBall.length > 0) ball = xGame.common.getRandArrEle(this.lineBall); if (ball && ball.kickAngle < this.bestAngle) { this.bestAngle = ball.kickAngle; this.bestKick.x = ball.kickPos.x; this.bestKick.y = ball.kickPos.y; this.bestPos.x = this.rootPos.x; this.bestPos.y = this.rootPos.y; this.bestForce = ball.hard * 0.08; } } if (this.setNum >= this.setMax) this.setMax = 0; if (this.setRate < 1) { this.setState(AIState.move, 0); this.rootMoveTime = Laya.timer.currTimer; this.gameSrc.aiRootMove(true); } } delayLine() { this.gameSrc.aiRootMove(false); } move() { if (this.bestPos.x < 1) this.bestPos = this.rootPos; let wObj = this.wBall.gameObj; let destx = wObj.x; let desty = wObj.y; let dx = Math.abs(destx - this.bestPos.x); let dy = Math.abs(desty - this.bestPos.y); let mx = 3 + dx * 0.03; let my = 3 + dy * 0.03; if (dx < 4 && dy < 4) { let dt = Laya.timer.currTimer - this.rootMoveTime; dt = dt < 1000 ? 1000 - dt : 0; if (this.setMax > 0) { let min = this.setMax * 0.3 + this.aiLv * 5; this.setRate = xGame.tools.random(min, this.setMax); this.setState(AIState.reset, 0); } else { this.destRot = 0; this.forceMax = this.bestForce; this.setKick(this.bestKick.x, this.bestKick.y); } if (dt > 100) { Laya.timer.clear(this, this.delayLine); Laya.timer.once(dt, this, this.delayLine); } else this.gameSrc.aiRootMove(false); } else { if (dx > 4) destx = wObj.x < this.bestPos.x ? wObj.x + mx : wObj.x - mx; if (dy > 4) desty = wObj.y < this.bestPos.y ? wObj.y + my : wObj.y - my; this.gameSrc.onRootMove({ x: destx, y: desty }); } } resetRoot() { this.bestAngle = 180; this.bestForce = 0; this.setMax = this.posList.length; this.posIdx = xGame.tools.random(0, this.setMax); let min = this.setMax * 0.3 + this.aiLv * 5; this.setRate = xGame.tools.random(min, this.setMax); let max = 2000 - this.aiLv * 100; if (Math.random() > 0.8) max += xGame.tools.random(100, 1000); if (this.isGuide) this.setState(AIState.select, 500); else if (this.onAway(2)) this.setState(AIState.reset, xGame.tools.random(400, max)); else this.setState(AIState.none); if (xGame.common.gameMgr.finishOneShoot) this.chat(); } runAI() { if (this.state > AIState.idle) return; this.initBall(); this.onGame(2500); if (Math.random() > 0.6) this.chat(); } stopRun() { this.setState(AIState.idle); } onGame(base) { let max = base - this.aiLv * 100; if (Math.random() > 0.8) max += xGame.tools.random(100, 1000); if (this.onAway(2)) this.setState(AIState.select, xGame.tools.random(500, max)); else this.setState(AIState.none); } setState(sta, wt = 0) { if (this.state == AIState.none) return; this.state = sta; this.waitTime = wt; } onUpdate() { if (this.state == AIState.none) return; this.awayTime -= this.dtime; if (this.awayTime < 1) { this.awayTime = xGame.tools.random(6000, 10000); this.awayNum += (11 - this.aiLv); this.onAway(1); } if (this.waitTime >= 0) { this.waitTime -= this.dtime; return; } switch (this.state) { case AIState.idle: this.chat(); break; case AIState.reset: this.reset(); break; case AIState.move: this.move(); break; case AIState.leave: this.state = AIState.none; xGame.common.gameMgr.aiGameEnd(true); break; case AIState.select: this.selectBall(); break; case AIState.turn: this.turnPole(); break; case AIState.shoot: this.shoot(); break; } } onAway(type) { if (type == 1) { let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length; let num = this.awayNum + db * 20; if (db > 0 && num > 0 && xGame.tools.random(0, 10000) < num && this.state == AIState.idle) { xGame.common.gameMgr.aiLeave(); this.setState(AIState.leave, 6666); } } else if (type == 2) { let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length; let num = this.awayNum + db * 30; if (xGame.tools.random(0, 10000) < num) return false; } else if (type == 3) { let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length; let num = this.awayNum + db * 10; if (xGame.tools.random(0, 4000) < num) return false; } return true; } chat() { if (this.chatTime > 0) { this.chatTime -= this.dtime; return; } this.chatTime = xGame.tools.random(2000, 10000); let rand = xGame.tools.random(0, 100); if (rand < 15) this.talk(); else if (rand < 35) this.emotion(); } talk() { xGame.common.talkMgr.showAITalk(0); } emotion() { xGame.common.talkMgr.showAIEmotion(0); } resetAI() { this.stopRun(); this.state = AIState.none; } } class Partical extends Laya.Script3D { constructor() { super(); this.duration = 2000; } ; onAwake() { this.gameObj = this.owner; } onEnable() { this.openTimer(); } openTimer() { Laya.timer.once(this.duration, this, this.disappear); } setCallback(obj, callback) { this.obj = obj; this.callback = callback; Laya.timer.clearAll(this); Laya.timer.once(this.duration, this, this.disappear); } disappear() { xGame.poolD3Mgr.putItem(this.gameObj.name, this.gameObj); this.callback && this.callback(this.obj); } } class Ball extends Laya.Script3D { constructor() { super(); this.posV3 = new Laya.Vector3(); this.rotRate = 2.1; this.rotSpeed = new Laya.Vector3(); this.myIndex = 0; } onAwake() { this.gameObj = this.owner; this.transform = this.gameObj.transform; this.ballNode = this.gameObj.getChildByName("Ball"); this.shadowNode = this.gameObj.getChildByName("shadow"); } initSelf(index, x, y, owner) { this.d2BallSrc = owner; this.myIndex = index; this.setAlbedoTexture(); this.setTransPos(x, y); this.setScale(); this.ballNode.transform.localRotationEulerX = 90; if (index == 0) { } } setAlbedoTexture(isIce = false) { let url; if (isIce) { url = `res/d3Res/ballTexture/ice.jpg`; } else { url = `res/d3Res/ballTexture/ball${this.myIndex}.png`; } Laya.Texture2D.load(url, Laya.Handler.create(this, (tex) => { this.ballNode.meshRenderer.material["albedoTexture"] = tex; })); } runFireworks(obj, delay, callback) { Laya.timer.clearAll(this); Laya.timer.once(delay + 1, this, () => { let fire = xGame.poolD3Mgr.getItem(poolKey.fireworksEft); fire.transform.localPositionX = this.transform.localPositionX; fire.transform.localPositionY = this.transform.localPositionY; fire.transform.localPositionZ = this.transform.localPositionZ; let src = fire.getComponent(Partical); src.duration = 1000; src.setCallback(obj, callback); let eft = xGame.poolD3Mgr.getItem(poolKey.hitEft); eft.transform.localPositionX = this.transform.localPositionX; eft.transform.localPositionY = this.transform.localPositionY; eft.transform.localPositionZ = this.transform.localPositionZ; }); } setTransPos(x, y) { this.setRotation(); xGame.common.pos2to3Convert(x, y, this.posV3); this.transform.localPositionX = this.posV3.x; this.transform.localPositionY = 0; this.transform.localPositionZ = this.posV3.z; this.transform.localRotationEulerX = 0; this.transform.localRotationEulerY = 0; this.transform.localRotationEulerZ = 0; this.shadowNode.transform.localPositionX = this.posV3.x / 30; this.shadowNode.transform.localPositionY = 0.1; this.shadowNode.transform.localPositionZ = this.posV3.z / 30; } setRotation() { if (this.d2BallSrc.canRot) { let speed = this.d2BallSrc.rigy.linearVelocity; this.rotSpeed.x = speed.x * this.rotRate; this.rotSpeed.z = speed.y * this.rotRate; this.rotSpeed.y = this.d2BallSrc.rotY; this.ballNode.transform.rotate(this.rotSpeed, false, false); } else if (Math.abs(this.d2BallSrc.rotY) > 0.1) { this.rotSpeed.x = this.rotSpeed.y = 0; this.rotSpeed.y = this.d2BallSrc.rotY; this.ballNode.transform.rotate(this.rotSpeed, false, false); } } setScale() { let radius = xGame.common.d2World.rootBall.ui.width; let scale = xGame.common.scale2to3Convert(radius); this.transform.localScaleX = scale; this.transform.localScaleY = scale; this.transform.localScaleZ = scale; } playInHoleEft() { let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft); eft.transform.position = this.transform.position; } playIceEft() { let eft = xGame.poolD3Mgr.getItem(poolKey.iceEft); eft.transform.position = this.transform.position; } get scaleXYZ() { return this.transform.localScaleX; } set scaleXYZ(val) { this.transform.localScaleX = val; this.transform.localScaleY = val; this.transform.localScaleZ = val; } get posX() { return this.transform.localPositionX; } set posX(val) { this.transform.localPositionX = val; } get posY() { return this.transform.localPositionY; } set posY(val) { this.transform.localPositionY = val; } get posZ() { return this.transform.localPositionZ; } set posZ(val) { this.transform.localPositionZ = val; } destroySelf() { this.posV3 = null; this.rotSpeed = null; this.d2BallSrc = null; this.ballNode = null; this.gameObj.destroy(true); this.transform = null; this.destroy(); } } class ui_D2Ball extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "D2Ball")); } onConstruct() { this.myIcon = (this.getChild("myIcon")); this.inner = (this.getChild("inner")); this.n8 = (this.getChild("n8")); this.n4 = (this.getChild("n4")); this.wrongTips = (this.getChild("wrongTips")); this.rightTips = (this.getChild("rightTips")); this.breathAni = this.getTransition("breathAni"); } } ui_D2Ball.URL = "ui://isxx5ak7kt443qi"; class D2BallSrc extends Laya.Script { constructor() { super(); this.number = 0; this.startX = 0; this.startY = 0; this.angleV2 = new Laya.Vector2(); this.isRootBall = false; this.isBlackBall = false; this.ballType = ""; this.canRot = true; this.rotY = 0; this.poleAngle = 0; this.kickPos = { x: 0, y: 0 }; this.hard = 0; this.kickAngle = 0; this.borderDis = 0; this.speedP10 = 5.6; this.lastSpeed = { x: 0, y: 0 }; this.stillSpeed = 0.12; this.ballFunc = "normal"; this.isRunSkillAni = false; this.isInHole = false; this.iceOwner = ""; this.forceRun = false; this.myUNID = ""; this.rectL = 0; this.rectR = 0; this.rectT = 0; this.rectB = 0; this.forceVec = new Laya.Vector2(); this.lastDis = 0; this.helpOut = { type: "", x: 0, y: 0 }; } initSelf(number, x, y, d3Ball) { if (!this.gameObj) this.gameObj = this.owner; this.number = number; this.startX = x; this.startY = y; this.d3Ball = d3Ball; this.isRootBall = false; this.isBlackBall = false; this.ballType = ""; if (number == 0) { this.isRootBall = true; } else if (number == 8) { this.isBlackBall = true; } else { if (number <= 7) { this.ballType = ballCamp.full; } else { this.ballType = ballCamp.flower; } } this.setInfo(); this.setD3Ball(); this.owner["mySrc"] = this; this.rigy.linearDamping = 1; D2BallSrc._unid++; this.myUNID = "d2ball" + D2BallSrc._unid; let rect = xGame.common.d2World.borderRect; this.rectL = Math.ceil(rect.x) + 20; this.rectT = Math.ceil(rect.y) + 20; this.rectR = Math.floor(rect.x + rect.width) - 20; this.rectB = Math.floor(rect.y + rect.height) - 20; } setInfo() { this.gameObj.x = this.startX; this.gameObj.y = this.startY; let radius = this.ui.width / 2; this.gameObj.width = radius * 2; this.gameObj.height = radius * 2; if (xGame.common.showDebug) { this.ui.myIcon.alpha = 1; this.ui.inner.alpha = 1; } else { this.ui.myIcon.alpha = 0; this.ui.inner.alpha = 0; } } setD3Ball() { this.d3Ball = this.d3Ball; this.d3BallSrc = this.d3Ball.getComponent(Ball); this.d3BallSrc.initSelf(this.number, this.startX, this.startY, this); } onUpdate() { if (xGame.common.gameMgr.gamePause) return; if (this.isInHole) return; if (!xGame.common.d2World.openCheckStill) return; this.runBall(); } runBall() { this.lastSpeed.x = this.rigy.linearVelocity.x; this.lastSpeed.y = this.rigy.linearVelocity.y; this.d3BallSrc.setTransPos(this.gameObj.x, this.gameObj.y); this.judgeBorder(); } getDestDis(dest) { return xGame.tools.getDistance(dest.x, dest.y, this.gameObj.x, this.gameObj.y); } setmyXY(x, y) { this.d3BallSrc.setTransPos(x, y); } getSpeed() { let speed = this.rigy.linearVelocity; return speed.x * speed.x + speed.y * speed.y; } onTriggerEnter(collider) { if (!collider || !collider.owner) return; let coll = "collide"; let speed = this.getSpeed(); let sv2 = this.speedP10 * this.speedP10; if (collider.label == "ball") { if (speed < 9 && this.number != 0) coll = ""; else if (speed < sv2) coll = "collide_4"; else if (speed < sv2 * 6.2) coll = "collide_3"; else if (speed < sv2 * 25) coll = "collide_2"; else if (speed < sv2 * 56) coll = "collide_1"; xGame.soundMgr.playSound(coll); if (this.gameObj.x < this.rectL || this.gameObj.x > this.rectR || this.gameObj.y < this.rectT || this.gameObj.y > this.rectB) { if (collider.owner) { let rig = collider.owner.getComponent(D2BallSrc); if (Math.abs(rig.rigy.linearVelocity.x) > 0) rig.lastSpeed.x = rig.rigy.linearVelocity.x; if (Math.abs(rig.rigy.linearVelocity.y) > 0) rig.lastSpeed.y = rig.rigy.linearVelocity.y; let vx = Math.abs(rig.lastSpeed.x * 0.4); let vy = Math.abs(rig.lastSpeed.y * 0.5); let rx = 0; let ry = 0; if (this.gameObj.x < this.rectL) rx = vx; else if (this.gameObj.x > this.rectR) rx = -vx; else if (this.gameObj.y < this.rectT) ry = vy; else if (this.gameObj.y > this.rectB) ry = -vy; this.rigy.applyLinearImpulseToCenter({ x: rx, y: ry }); } } if (this.number != 0) { return; } else { if (this.forceRun) { console.log("randon force"); this.applyForce(collider); } } if (xGame.common.d2World.isOnSameLine) { xGame.common.d2World.isOnSameLine = false; this.rigy.linearVelocity = { x: 0, y: 0 }; } if (xGame.common.gameMgr.firstColliObj == null) { xGame.common.gameMgr.firstColliObj = collider.owner["mySrc"].number; xGame.common.gameMgr.isTouchedBall = true; } } else { xGame.common.recoverCameraView(); let wallStr = ""; if (speed < 9) { } else if (speed < sv2) { } else if (speed < sv2 * 6.2) wallStr = "wall_30"; else if (speed < sv2 * 25) wallStr = "wall_50"; else if (speed < sv2 * 56) wallStr = "wall_80"; xGame.soundMgr.playSound(wallStr); } } applyForce(collider) { let src = collider.owner.mySrc; this.forceVec.x = src.gameObj.x - this.gameObj.x; this.forceVec.y = src.gameObj.y - this.gameObj.y; Laya.Vector2.normalize(this.forceVec, this.forceVec); Laya.Vector2.scale(this.forceVec, 50, this.forceVec); src.rigy.applyLinearImpulseToCenter({ x: this.forceVec.x, y: this.forceVec.y }); } checkWrongBall(playEft = true) { if (this.isInHole) return; xGame.common.gameMgr.inHoleBalls.push(this.number); if (this.number != 0 && playEft) this.d3BallSrc.playInHoleEft(); let coll = "inpocket_1"; let speed = this.getSpeed(); let sv2 = this.speedP10 * this.speedP10 * 0.8; if (speed < 9 && this.number != 0) coll = ""; else if (speed < sv2 * 6.2) coll = "inpocket_4"; else if (speed < sv2 * 25) coll = "collide_3"; else if (speed < sv2 * 56) coll = "collide_2"; xGame.soundMgr.playSound(coll); this.isInHole = true; if (this.number == 0) { console.log("白球进了。。"); this.reset(); this.rigy.linearVelocity = { x: 0, y: 0 }; this.hideSelf(); xGame.common.gameUI.ui.whiteAni.visible = true; xGame.common.gameUI.ui.whiteAni.t0.play(Laya.Handler.create(this, () => { xGame.common.gameUI.ui.whiteAni.visible = false; })); } else { xGame.common.playClassicEmotion(this.number, this.gameObj.x, this.gameObj.y); xGame.common.d2World.removeOneBall(this); this.destroySelf(); xGame.common.playHappySound(this.number); this.runFlyEft(); } } runFlyEft() { if (xGame.common.gameMode == GameMode.placeBall && xGame.common.gameMgr.placeBallData.type == PlaceBallType.challenge) { xGame.common.playAwardSpine(this.gameObj.x + 100, this.gameObj.y - 100); } } hideSelf() { if (this.d3Ball) this.d3Ball.active = false; } showSelf() { this.isInHole = false; if (this.d3Ball && !this.d3Ball.active) this.d3Ball.active = true; } isStill() { let speed = this.rigy.linearVelocity; if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed) { this.rigy.linearVelocity = { x: 0, y: 0 }; return true; } return false; } reset() { } destroySelf() { this.d3BallSrc.destroySelf(); if (!this.ui.isDisposed) { this.ui.removeFromParent(); this.ui.dispose(); this.ui = null; } this.outColli = null; this.innerColli = null; this.rigy = null; this.d3Ball = null; this.d3BallSrc = null; this.angleV2 = null; this.gameObj.destroy(true); this.destroy(); } judgeBorder() { if (this.forceRun && this.owner == xGame.common.d2World.rootBall.owner) { return; } if (this.destroyed) return; if (xGame.common.gameMode == GameMode.classic) return; let isOver = xGame.common.checkBallOverBorder(this.gameObj.x, this.gameObj.y); if (isOver) { this.checkWrongBall(); } } onClick(e, force = false) { if (this.number == 0) return; if (force) { } else { if (xGame.common.d2World.openCheckStill) return; if (!xGame.common.gameMgr.selfTurn) { return; } } if (!xGame.common.gameMgr.finishOneShoot) return; let root = xGame.common.d2World.rootBall.gameObj; let x = this.gameObj.x - root.x; let y = this.gameObj.y - root.y; let angle = xGame.common.getfguiRotation(x, y); xGame.common.d2World.d2Gan.ui.rotation = angle; xGame.common.d2World.getHelpLine(); xGame.common.clickedBall = true; this.checkGuide(); } checkGuide() { let guide = DataMgr.getSkillGuide(); if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) { xGame.common.guideStep++; xGame.common.gameUI.ui.guide1.visible = false; xGame.common.gameUI.ui.guide2.visible = true; } } checkDistance(disX, disY, angle) { let diameter = this.gameObj.width - 1; let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2); if (!this.lastDis) this.lastDis = dis; else { if (dis > this.lastDis) { this.helpOut.type = "remove"; return this.helpOut; } } if (dis <= Math.pow(diameter, 2)) { let del = 0.01; let offest = 0; let realX = disX - this.gameObj.x; let realY = disY - this.gameObj.y; while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) { offest += del; realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180); realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180); } this.helpOut.type = "ok"; this.helpOut.x = realX + this.gameObj.x; this.helpOut.y = realY + this.gameObj.y; return this.helpOut; } else { this.helpOut.type = "no"; return this.helpOut; } } clearBallEft() { this.clearBallRightEft(); this.clearBallWrongEft(); } clearBallRightEft() { this.ui.breathAni.stop(); this.ui.rightTips.visible = false; } clearBallWrongEft() { this.ui.wrongTips.visible = false; } showWrongEft() { if (!xGame.common.gameMgr.selfTurn) return; this.ui.wrongTips.visible = true; } showRightEft() { if (!xGame.common.gameMgr.selfTurn) return; this.ui.rightTips.visible = true; this.ui.rightTips.scaleX = 1; this.ui.rightTips.scaleY = 1; this.ui.breathAni.play(); } setBallFunc(type, owner) { if (type == "ice") { this.ballFunc = type; this.d3BallSrc.setAlbedoTexture(true); this.rigy.type = "static"; this.iceOwner = owner; } else { if (owner == this.iceOwner) { this.ballFunc = type; this.d3BallSrc.setAlbedoTexture(false); this.rigy.type = "dynamic"; } } } } D2BallSrc._unid = 0; class D2RootBallSrc extends D2BallSrc { constructor() { super(); this.maxSpeed = 0; this.classicMaxSpeed = 2.2; this.bigSkillMaxSpeed = 4; this.angle = 0; this.allPercent = 0; this.linearPercent = 0; this.anglePercent = 0; this.maxAngleRate = 0.6; this.baseRot = 7; this.angleMax = 0; this.speed = new Laya.Vector2(); this.rotSpeed = new Laya.Vector2(); } isStill() { let speed = this.rigy.linearVelocity; if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) { if (this.anglePercent <= 0.1) { this.rigy.linearVelocity = { x: 0, y: 0 }; return true; } } return false; } reset() { this.linearPercent = 0; this.anglePercent = 0; } setSpeed(percent, angle) { this.allPercent = percent; this.angle = angle; this.setAngleSpeed(); this.setLinearSpeed(); let hit = "hit"; if (percent < 25) hit = "hit03"; else if (percent < 50) hit = "hit02"; else if (percent < 75) hit = "hit01"; xGame.soundMgr.playSound(hit); } setAngleSpeed() { let offest = xGame.common.rodOffest; let radius = 82; let rate = Math.abs(offest.y / radius) * 0.5; if (offest.y > 0) this.angleMax = -this.baseRot * 2; else this.angleMax = this.baseRot; this.rotY = -offest.x / radius * 100; this.anglePercent = this.maxAngleRate * rate * this.allPercent; this.linearPercent = this.allPercent - this.anglePercent; } setLinearSpeed() { if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) { if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) { if (!xGame.common.longHelpLine) { let offset = -150 + xGame.common.randomNum(0, 300); offset /= 100; this.angle += offset; } } } let sin = Math.sin(this.angle * Math.PI / 180); let cos = Math.cos(this.angle * Math.PI / 180); switch (xGame.common.gameMode) { case GameMode.classic: this.maxSpeed = this.classicMaxSpeed; break; case GameMode.bigMove: this.maxSpeed = this.bigSkillMaxSpeed; break; case GameMode.placeBall: let data = cfgTable.placeballData[xGame.common.placeBallCurLevel]; if (data.type == 1) { this.maxSpeed = this.bigSkillMaxSpeed; } else { this.maxSpeed = this.classicMaxSpeed; } break; default: break; } this.speed.x = this.maxSpeed * this.linearPercent * sin; this.speed.y = -this.maxSpeed * this.linearPercent * cos; this.rotSpeed.x = -this.angleMax * sin * this.anglePercent; this.rotSpeed.y = this.angleMax * cos * this.anglePercent; this.rigy.applyLinearImpulseToCenter(this.speed); } onUpdate() { if (this.anglePercent > 0.1) { this.anglePercent *= 0.97; this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent; this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent; this.rigy.applyForceToCenter(this.rotSpeed); Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed); Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed); let num = Laya.Vector2.dot(this.speed, this.rotSpeed); if (num > 0.9) this.canRot = true; } else this.canRot = true; if (Math.abs(this.rotY) > 0.1) this.rotY *= 0.98; super.onUpdate(); } destroySelf() { super.destroySelf(); this.speed = null; } } class D2Ball extends Laya.Sprite { constructor(isRootBall = false) { super(); this.ui = ui_D2Ball.createInstance(); this.pivotX = this.ui.width / 2; this.pivotY = this.ui.width / 2; this.x = 0; this.y = 0; this.addChild(this.ui.displayObject); this.ui.displayObject.x += this.ui.width / 2; this.ui.displayObject.y += this.ui.width / 2; if (isRootBall) { this.d2Src = this.addComponent(D2RootBallSrc); } else { this.d2Src = this.addComponent(D2BallSrc); } this.d2Src.ui = this.ui; this.addCircleCollider(); this.addInnerCircleCollider(); this.addRigyBody(); } addCircleCollider() { let colli = xGame.common.getCollider("circle"); colli.radius = this.ui.width / 2; this.addComponentIntance(colli); this.d2Src.outColli = colli; colli.label = "ball"; } addInnerCircleCollider() { let colli = xGame.common.getCollider("circle"); colli.radius = this.ui.inner.width / 2; colli.x = (this.ui.width - this.ui.inner.width) / 2; colli.y = (this.ui.width - this.ui.inner.width) / 2; this.addComponentIntance(colli); this.d2Src.innerColli = colli; colli.label = "inner"; } addRigyBody() { let rigy = xGame.common.getRigbody(); rigy.type = "dynamic"; this.addComponentIntance(rigy); this.d2Src.rigy = rigy; } disposeSelf() { if (!this.ui.isDisposed) { this.ui.dispose(); this.ui.removeFromParent(); this.ui = null; } } } class ui_D2Gan extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "D2Gan")); } onConstruct() { this.myIcon = (this.getChild("myIcon")); this.selfRodIcon = (this.getChild("selfRodIcon")); this.selfEftRoot = (this.getChild("selfEftRoot")); this.self = (this.getChild("self")); this.aiRodIcon = (this.getChild("aiRodIcon")); this.aiEftRoot = (this.getChild("aiEftRoot")); this.ai = (this.getChild("ai")); } } ui_D2Gan.URL = "ui://isxx5ak7sdh33qp"; class D2Gan { constructor() { this.offset = 0.15; this.cell = 1.5; this.onBallCell = 0.4; this.lastInfo = { x: 0, y: 0, rotation: 0 }; this.moveNum = 70; this.rulerRate = 0.1; this.ui = ui_D2Gan.createInstance(); this.changeSelfRod(); this.changeAIRod(); } changeSelfRod() { let index = DataMgr.getCurBallRod(); let data = cfgTable.ballrodData[index + 1]; this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren(); this.selfMySpine && this.selfMySpine.dispose(); this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img); if (data.spine) { this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img); this.selfMySpine = new SpineMgr(data.spine, () => { let xx = this.ui.selfEftRoot.width / 2; let yy = this.ui.selfEftRoot.height / 2; let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 }; let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject); outSpine.rotation = -90; }); } } changeAIRod() { let length = Object.keys(cfgTable.ballrodData).length; let rand = Math.floor(length * Math.random()) + 1; let data = cfgTable.ballrodData[rand]; this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren(); this.aiMySpine && this.aiMySpine.dispose(); this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img); if (data.spine) { this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img); this.aiMySpine = new SpineMgr(data.spine, () => { let xx = this.ui.aiEftRoot.width / 2; let yy = this.ui.aiEftRoot.height / 2; let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 }; let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject); outSpine.rotation = -90; }); } } setGanLastInfo() { this.lastInfo.rotation = this.ui.rotation; this.lastInfo.x = this.ui.x; this.lastInfo.y = this.ui.y; } rotateSelf(flag, isRuler = false) { let angle; flag = flag * this.offset; if (xGame.common.d2World.isHelpLineOnBall) { angle = flag * this.onBallCell; } else { angle = flag * this.cell; } if (isRuler) { angle *= this.rulerRate; } this.ui.rotation += angle; xGame.common.d2World.getHelpLine(); } checkDistance() { let target = xGame.common.d2World.targetBall; let root = xGame.common.d2World.rootBall; if (target == null) { return 1; } let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2); if (dis <= 2500) { return 5; } return 1; } rotDest(rot) { this.ui.rotation = rot; xGame.common.d2World.getHelpLine(); } storagePower(powerNum) { let pos = (powerNum / 100) * this.moveNum; let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos; let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos; this.ui.x = this.lastInfo.x + xx; this.ui.y = this.lastInfo.y + yy; } shoot() { this.storagePower(0); this.ui.visible = false; } destroySelf() { this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren(); this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren(); this.selfMySpine && this.selfMySpine.dispose(); this.aiMySpine && this.aiMySpine.dispose(); this.lastInfo = null; if (!this.ui.isDisposed) { this.ui.removeFromParent(); this.ui.dispose(); } } } class ui_HelpLine extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "HelpLine")); } onConstruct() { this.n10 = (this.getChild("n10")); this.rect = (this.getChild("rect")); this.dir11 = (this.getChild("dir11")); this.dir = (this.getChild("dir")); this.rootDir = (this.getChild("rootDir")); this.dirDot = (this.getChild("dirDot")); } } ui_HelpLine.URL = "ui://isxx5ak7sdh33qs"; class D2HelpLine { constructor() { this.starX = 0; this.starY = 0; this.ui = ui_HelpLine.createInstance(); xGame.common.gameUI.ui.ballNode.addChild(this.ui); this.starX = this.ui.rect.x; this.starY = this.ui.rect.y; } shoot() { this.ui.visible = false; } destroySelf() { if (this.ui.isDisposed) { this.ui.removeFromParent(); this.ui.dispose(); } } } class D2World extends Laya.Script { constructor() { super(); this.ballArr = []; this.openCheckStill = false; this.checkArr = []; this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 }; this.isHelpLineOnBall = false; this.isOnSameLine = false; this.reflectAngle = 0; this.powerPercent = 0; this.inHolesSpeed = []; this.outDir = new Laya.Vector2(); this.rootDir = new Laya.Vector2(); this.aiLv = 0; this.rootPos = new Laya.Vector2(); this.tempDir1 = new Laya.Vector2(); this.tempDir2 = new Laya.Vector2(); this.tempDir3 = new Laya.Vector2(); this.ballSize = 33; this.destRot = 0; } initSelf() { this.createBalls(); xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop); xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop); xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot); xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot); xGame.eventMgr.on(RESET_GAME, this, this.resetGame); } setBorderRect() { let ui = xGame.common.gameUI.ui; let starX = ui.border.bar5.x + ui.border.bar5.width / 2; let starY = ui.border.bar1.y + ui.border.bar1.height / 2; let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width); let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height); this.borderRect.x = starX; this.borderRect.y = starY; this.borderRect.width = width; this.borderRect.height = height; } resetGame() { this.openCheckStill = false; let temp; for (let index = 0; index < this.ballArr.length; index++) { temp = this.ballArr[index]; temp.destroySelf(); } xGame.common.d3World.ballRoot.destroyChildren(); xGame.common.gameUI.ui.ballNode.removeChildren(); console.log("进入摧毁逻辑"); this.d2Gan.destroySelf(); this.d2HelpLine.destroySelf(); this.ballArr = []; } setD2Gan() { let ballNode = this.rootBall.ui; let d2Gan = new D2Gan(); this.d2Gan = d2Gan; let ganNode = d2Gan.ui; ballNode.addChild(ganNode); ganNode.pivotX = ganNode.pivotX; ganNode.pivotY = ganNode.pivotY; ganNode.x = ganNode.myIcon.width / 2; ganNode.y = this.rootBall.gameObj.width; d2Gan.setGanLastInfo(); } setHelpLine() { let d2Help = new D2HelpLine(); this.d2HelpLine = d2Help; } createBalls() { let cfg; switch (xGame.common.gameMode) { case GameMode.classic: cfg = xGame.cfgMgr.getRandomClassicLevel(); break; case GameMode.bigMove: cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex); break; case GameMode.placeBall: cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel); break; default: break; } cfg = JSON.parse(JSON.stringify(cfg)); for (const key in cfg) { if (cfg[key].value == 0) { this.createRootBall(cfg[key]); delete cfg[key]; break; } } this.createOtherBalls(cfg); } createRootBall(data) { let root = new D2Ball(true); xGame.common.gameUI.ui.ballNode.displayObject.addChild(root); this.rootBall = root.d2Src; let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball); let d3BallSrc = d3Ball.getComponent(Ball); xGame.common.d3World.rootBall = d3Ball; xGame.common.d3World.rootBallSrc = d3BallSrc; let xx = data.x; let yy = data.y; let numer = data.value; xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy); this.rootBall.initSelf(numer, xx, yy, d3Ball); this.ballArr.push(this.rootBall); this.setD2Gan(); this.setHelpLine(); } createOtherBalls(cfg) { let temp; let src; let data; for (const key in cfg) { data = cfg[key]; temp = new D2Ball(); xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp); src = temp.d2Src; let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball); src.initSelf(data.value, data.x, data.y, d3Ball); this.ballArr.push(src); } } shoot(percent) { this.powerPercent = percent; this.openCheckStill = true; let d2Angle = this.d2Gan.ui.rotation; this.rootBall.setSpeed(percent, d2Angle); this.clearBallAllEft(); this.changePlayerView(); } onUpdate() { if (!this.openCheckStill) return; this.checkStill(); } checkStill() { for (let index = 0; index < this.ballArr.length; index++) { if (!this.ballArr[index].isStill()) { return; } } xGame.eventMgr.event(ALL_BALL_STOP); } allBallStop() { this.openCheckStill = false; xGame.common.recoverCameraView(); } waitShoot() { if (!this.d2Gan.ui.isDisposed) { this.d2Gan.ui.visible = true; } if (!this.d2HelpLine.ui.isDisposed) { this.d2HelpLine.ui.visible = true; } this.clearBallAllEft(); this.showBallRightEft(); this.getHelpLine(); this.inHolesSpeed = []; this.selectOneBall(); } _getAllBallArr() { let arr = this.ballArr; let outArr = []; for (let index = 0; index < arr.length; index++) { if (arr[index] instanceof D2RootBallSrc) continue; if (arr[index].ballFunc == "ice") continue; if (arr[index].destroyed) continue; outArr.push(arr[index]); } return outArr; } _getBlackObj() { let arr = this.ballArr; for (let index = 0; index < arr.length; index++) { if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) { return arr[index]; } } } selectOneBall() { let all = this._getAllBallArr(); let target; switch (xGame.common.gameMode) { case GameMode.classic: if (xGame.common.gameMgr.selfTurn) { let self = xGame.common.gameMgr.selfBallArr; let black = this._getBlackObj(); if (xGame.common.gameMgr.ensureBallType) { if (self.length > 0) { let out = []; for (let j = 0; j < all.length; j++) { if (self.indexOf(all[j].number) > -1) { out.push(all[j]); } } target = this.selectBestEnterOne(out); } else { target = this.selectBestEnterOne([black]); } } else { target = this.selectBestEnterOne(all); } } else { target = this.selectBestEnterOne(all); } break; case GameMode.bigMove: target = this.selectBestEnterOne(all); break; case GameMode.placeBall: if (all.length > 0) { target = this.selectBestEnterOne(all); } break; default: break; } if (target && !target.destroyed && target.onClick) { target.onClick(0, true); let num = -200 + xGame.common.randomNum(0, 400); num /= 150; if (xGame.common.longHelpLine) { num = 0; } this.destRot += num; xGame.common.d2World.d2Gan.rotDest(this.destRot); } } removeOneBall(ball) { for (let index = 0; index < this.ballArr.length; index++) { if (this.ballArr[index].id == ball.id) { this.ballArr.splice(index, 1); break; } } } getHelpLine() { this.d2HelpLine.ui.dirDot.visible = false; this.isOnSameLine = false; let startX = this.rootBall.gameObj.x; let startY = this.rootBall.gameObj.y; let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation); if (dis == null) { this.d2HelpLine.ui.visible = false; console.error("辅助线异常"); return; } this.d2HelpLine.ui.visible = true; let angle = this.d2Gan.ui.rotation; let radius = 16.5; let disX = startX + dis * Math.sin(angle * Math.PI / 180); let disY = startY + dis * -Math.cos(angle * Math.PI / 180); let colliObj = xGame.common.isBlock(startX, startY, disX, disY); if (colliObj == null) { this.getColliPos(disX, disY, radius, angle); xGame.common.d2World.isHelpLineOnBall = false; this.targetBall = null; this.reflectAngle = 0; this.showBallWrongEft(); } else { let target = colliObj.src; let radius = 16.5; let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer; dis1 = Math.sqrt(dis1); let realDis = colliObj.disHon - dis1; let dir = colliObj.dir; let xx = startX + dir.x * realDis; let yy = startY + dir.y * realDis; this.getColliPos(xx, yy, radius, angle); let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180; if (Math.abs(reflectAngle - angle) <= 0.02) { let offset = xGame.common.rodOffest; if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1) this.isOnSameLine = true; } this.getRootDirLine(reflectAngle, angle, xx, yy, target); xGame.common.d2World.isHelpLineOnBall = true; this.targetBall = target; this.reflectAngle = reflectAngle; this.showBallWrongEft(); if (xGame.common.longHelpLine) { this.delayReflectLine(target, reflectAngle); } } } getBorderDot(startX, startY, angle) { let radius = 17; let distance; let isDone; distance = -(this.borderRect.y - startY + radius) / Math.cos(angle * Math.PI / 180); isDone = this.judgeUpDown(distance, angle, startX); if (isDone != null) { return isDone; } distance = -(this.borderRect.y + this.borderRect.height - startY - radius) / Math.cos(angle * Math.PI / 180); isDone = this.judgeUpDown(distance, angle, startX); if (isDone != null) { return isDone; } distance = (this.borderRect.x - startX + radius) / Math.sin(angle * Math.PI / 180); isDone = this.judgeLeftRight(distance, angle, startY); if (isDone != null) { return isDone; } distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180); isDone = this.judgeLeftRight(distance, angle, startY); if (isDone != null) { return isDone; } } judgeUpDown(distance, angle, startX) { let flag = Math.sin(angle * Math.PI / 180); let temp = startX + distance * Math.sin(angle * Math.PI / 180); if (distance >= 0) { if (flag > 0) { if (temp < this.borderRect.x + this.borderRect.width) { return distance; } } else { if (temp > this.borderRect.x) { return distance; } } } } judgeLeftRight(distance, angle, starY) { let flag = -Math.cos(angle * Math.PI / 180); let temp = starY + distance * -Math.cos(angle * Math.PI / 180); if (distance >= 0) { if (flag > 0) { if (temp < this.borderRect.y + this.borderRect.height) { return distance; } } else { if (temp > this.borderRect.y) { return distance; } } } } clearBallAllEft() { let temp; for (let index = 0; index < this.ballArr.length; index++) { temp = this.ballArr[index]; temp.clearBallEft(); } } showBallRightEft() { let gameMgr = xGame.common.gameMgr; let temp; let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr; if (targetArr.length <= 0) return; for (let index = 0; index < this.ballArr.length; index++) { temp = this.ballArr[index]; if (targetArr.indexOf(temp.number) > -1) { temp.showRightEft(); } } } showBallWrongEft() { let gameMgr = xGame.common.gameMgr; let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr; if (targetArr.length <= 0) return; let temp; for (let index = 0; index < this.ballArr.length; index++) { temp = this.ballArr[index]; if (this.targetBall && this.targetBall.number == temp.number) { if (targetArr.indexOf(temp.number) <= -1) { temp.showWrongEft(); } else { temp.clearBallWrongEft(); } } else { temp.clearBallWrongEft(); } } } getColliPos(x, y, radius, angle) { this.d2HelpLine.ui.x = x; this.d2HelpLine.ui.y = y; let dirX = x - this.rootBall.gameObj.x; let dirY = y - this.rootBall.gameObj.y; let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5); if (rectH <= 0) rectH = 0; this.d2HelpLine.ui.rect.height = 0; this.d2HelpLine.ui.rect.height = rectH; this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY); if (rectH < this.rootBall.gameObj.width) { this.d2HelpLine.ui.rect.visible = false; } else { this.d2HelpLine.ui.rect.visible = true; } this.d2HelpLine.ui.dir.visible = false; this.d2HelpLine.ui.rootDir.visible = false; } getReflectLine(x, y, radius, target) { this.d2HelpLine.ui.dir.visible = true; let dirX = target.x - x; let dirY = target.y - y; let angle = xGame.common.getfguiRotation(dirX, dirY) + 180; this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX; this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY; this.d2HelpLine.ui.dir.height = 48; this.d2HelpLine.ui.dir.rotation = angle; this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180); this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180); return angle; } getRootDirLine(angle, rodAngle, xx, yy, target) { let rtX = xGame.common.d2World.rootBall.gameObj.x; let rtY = xGame.common.d2World.rootBall.gameObj.y; let targetX = target.gameObj.x; let targetY = target.gameObj.y; this.outDir.setValue(targetX - xx, targetY - yy); this.rootDir.setValue(rtX - xx, rtY - yy); let ver = Math.PI / 2; let sin = Math.sin(ver); let cos = Math.cos(ver); let outX = this.outDir.x * cos - this.outDir.y * sin; let outY = this.outDir.x * sin + this.outDir.y * cos; this.outDir.setValue(outX, outY); Laya.Vector2.normalize(this.rootDir, this.rootDir); Laya.Vector2.normalize(this.outDir, this.outDir); let result = Laya.Vector2.dot(this.rootDir, this.outDir); if (Math.abs(result) <= 0.08) { this.d2HelpLine.ui.rootDir.visible = false; return; } if (result > 0) { angle += 90; } else if (result < 0) { angle -= 90; } this.d2HelpLine.ui.rootDir.visible = true; this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX; this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY; this.d2HelpLine.ui.rootDir.rotation = angle; } delayReflectLine(obj, angle) { if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) { return; } this.isOnSameLine = false; let startX = obj.gameObj.x; let startY = obj.gameObj.y; let dis = this.getBorderDot(startX, startY, angle); if (dis == null) { this.d2HelpLine.ui.dirDot.visible = false; return; } this.d2HelpLine.ui.visible = true; let disX = startX + dis * Math.sin(angle * Math.PI / 180); let disY = startY + dis * -Math.cos(angle * Math.PI / 180); let colliObj = xGame.common.isBlock(startX, startY, disX, disY, obj); if (colliObj == null) { this.setDelayLine(disX, disY, obj, angle); } else { let radius = 16; let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer; dis1 = Math.sqrt(dis1); let realDis = colliObj.disHon - dis1; let dir = colliObj.dir; let xx = startX + dir.x * realDis; let yy = startY + dir.y * realDis; this.setDelayLine(xx, yy, obj, angle); } } setDelayLine(x, y, obj, angle) { let dirX = x - obj.gameObj.x; let dirY = y - obj.gameObj.y; let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5); if (rectH <= 0) rectH = 0; this.d2HelpLine.ui.dir.height = rectH; this.d2HelpLine.ui.dirDot.visible = true; this.d2HelpLine.ui.dirDot.x = 17; this.d2HelpLine.ui.dirDot.y = 17; this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180); ; this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180); } changePlayerView() { if (Math.random() >= 0.7) return; if (!this.targetBall) { return; } if (!xGame.common.gameMgr.selfTurn) return; switch (xGame.common.gameMode) { case GameMode.classic: if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) { if (this.targetBall.number != 8) { return; } } break; case GameMode.bigMove: return; case GameMode.placeBall: break; default: break; } let startX = this.targetBall.gameObj.x; let startY = this.targetBall.gameObj.y; let angle = this.reflectAngle; let dis = this.getBorderDot(startX, startY, angle); let disX = startX + dis * Math.sin(angle * Math.PI / 180); let disY = startY + dis * -Math.cos(angle * Math.PI / 180); let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall); if (colliObj) { return; } let offset = 40; let posObj = xGame.common.gameMgr.posObj; let temp; let radius; let tarX, tarY; for (const key in posObj) { temp = posObj[key]; radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5); tarX = startX + radius * Math.sin(angle * Math.PI / 180); tarY = startY + radius * -Math.cos(angle * Math.PI / 180); if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) { xGame.common.showOneCamera("angle" + key); xGame.common.gameUI.ui.d2Node.alpha = 0; Laya.physicsTimer.scale = 0.7; break; } } } selectBestEnterOne(arr) { this.aiLv = xGame.tools.random(1, 11); this.aiLv = 10; this.wBall = xGame.common.d2World.rootBall; this.rootPos.x = this.wBall.gameObj.x; this.rootPos.y = this.wBall.gameObj.y; this.initHoleBall(arr); return this.selectBall(); } selectBall() { let ball = null; this.destRot = 0; let ai = 110 - this.aiLv * 10; let mis = xGame.tools.random(-ai, ai) * 0.005; let score = false; if (this.scoreBall.length < 1) { if (this.lineBall.length < 1) { for (let i = 0; i < this.kickBall.length; i++) { let list = []; let bo = this.kickBall[i]; let bobj = bo.gameObj; let rect = xGame.common.d2World.borderRect; let mobj = this.wBall.gameObj; let minb = bobj.y - rect.y - 20; let minw = mobj.y - rect.y - 50; if (minb > 0 && minw > 0) { let dlenx = 0; let dleny = mobj.y - rect.y; let spx = mobj.x; let spy = rect.y - dleny; list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny }); } minb = rect.y + rect.height - bobj.y - 20; minw = rect.y + rect.height - mobj.y - 50; if (minb > 0 && minw > 0) { let dlenx = 0; let dleny = rect.y + rect.height - mobj.y; let spx = mobj.x; let spy = rect.y + rect.height + dleny; list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny }); } minb = bobj.x - rect.x - 20; minw = mobj.x - rect.x - 50; if (minb > 0 && minw > 0) { let dlenx = mobj.x - rect.x; let dleny = 0; let spx = rect.x - dlenx; let spy = mobj.y; list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny }); } minb = rect.x + rect.width - bobj.x - 20; minw = rect.x + rect.width - mobj.x - 50; if (minb > 0 && minw > 0) { let dlenx = rect.x + rect.width - mobj.x; let dleny = 0; let spx = rect.x + rect.width + dlenx; let spy = mobj.y; list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny }); } list.sort(function (a, b) { return a.order - b.order; }); for (let i = 0; i < list.length; i++) { let data = list[i]; let mx = mobj.x - bobj.x; let my = mobj.y - bobj.y; xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1); xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2); let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2); if (num > 1) num = 1; let cos = Math.acos(num); if (cos > 1.57) cos = 1.57; else if (cos < 0.01) cos = 0.01; let tan = Math.tan(cos); let dx = tan * data.dleny; let dy = tan * data.dlenx; let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx)); if (Math.abs(bx - 667) < 40) continue; let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy)); if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) { let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y); this.forceMax = dis * 0.08; this.destRot += mis * 0.1; this.setKick(bx, by); return true; } } } } else { ball = xGame.common.getRandArrEle(this.lineBall); } } else { for (let i = 0; i < this.scoreBall.length; i++) { if (i < this.scoreBall.length - 1) { let rand = 70 + this.aiLv * 10 + i * 10; if (xGame.tools.random(0, 100) < rand) { ball = this.scoreBall[i]; break; } } else { ball = this.scoreBall[i]; break; } } score = true; this.selectNum++; } if (!ball) ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr); let dx = ball.gameObj.x; let dy = ball.gameObj.y; let kickAngle = 0; if (score) { dx = ball.kickPos.x; dy = ball.kickPos.y; this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2); this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3); let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2); if (adot > 1) adot = 1; kickAngle = Math.acos(adot) * 57.3; if (kickAngle > 45) { let kdx = ball.kickPos.x - ball.gameObj.x; let kdy = ball.kickPos.y - ball.gameObj.y; dx = ball.kickPos.x - kdx * mis * 0.3; dy = ball.kickPos.y - kdy * mis * 0.3; } else this.destRot += mis; } else if (ball.poleAngle != 0) { this.destRot += ball.poleAngle; } if (xGame.common.gameMode == 0) { let af = kickAngle * 0.08; this.forceMax = ball.hard * 0.1 + af * af; } this.setKick(dx, dy); return ball; } initHoleBall(arr) { this.kickBall = []; this.lineBall = []; this.scoreBall = []; this.holeBall = []; this.selectNum = 0; this.forceNum = 0; this.forceMax = 0; this.turnNum = 0; let list = arr; let holes = xGame.common.gameMgr.holePosList; let self = xGame.common.aiPlayer; for (let i = 0; i < list.length; i++) { let obj = list[i]; if (!obj) continue; obj.kickPos.x = 0; obj.kickPos.y = 0; obj.poleAngle = 0; obj.hard = 0; obj.borderDis = 0; obj.kickAngle = 180; let b = obj.gameObj; let wbp = this.rootPos; let bx = wbp.x - b.x; let by = wbp.y - b.y; obj.borderDis = xGame.tools.random(0, 100); this.kickBall.push(obj); if (!this.isLine(wbp, obj)) continue; obj.kickAngle = xGame.tools.random(90, 180); obj.kickPos.x = b.x; obj.kickPos.y = b.y; this.lineBall.push(obj); let minDis = 999999; let hole = false; for (let j = 0; j < holes.length; j++) { let hp = holes[j]; if (bx >= 0 && hp.x > b.x + 100) continue; if (bx <= 0 && hp.x < b.x - 100) continue; if (by < -10 && hp.y < wbp.y) continue; if (by > 10 && hp.y > wbp.y) continue; if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) { let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y); if (dis < minDis) { let dx = b.x - this.tempDir1.x * this.ballSize; let dy = b.y - this.tempDir1.y * this.ballSize; this.tempDir3.x = this.tempDir1.x; this.tempDir3.y = this.tempDir1.y; if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) { obj.kickPos.x = dx; obj.kickPos.y = dy; let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3); if (num > 1) num = 1; obj.kickAngle = Math.acos(num) * 57.3; if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2) dis = dis * 2; if (Math.abs(hp.x - 600) < 100) dis += 50; obj.hard = dis + obj.kickAngle * 3; hole = true; } } } } if (hole) { this.scoreBall.push(obj); this.holeBall.push(obj); } } this.scoreBall.sort(function (a, b) { return a.hard - b.hard; }); this.holeBall.sort(function (a, b) { return a.kickAngle - b.kickAngle; }); this.kickBall.sort(function (a, b) { return a.borderDis - b.borderDis; }); } isBlock(bn, bx, by, hx, hy, dn = -1) { this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1); let balls = xGame.common.d2World.ballArr; let max = xGame.tools.getDis(hx, hy, bx, by); for (let index = 0; index < balls.length; index++) { let obj = balls[index]; if (obj.number == 0) continue; if (obj.number == bn || obj.number == dn) continue; let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by); if (dis * dis > max) continue; this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2); let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2); if (num > 1) num = 1; if (num < 0) continue; let gap = Math.sin(Math.acos(num)) * dis; if (gap < this.ballSize) return true; } return false; } isLine(xy, ball) { let bx = xy.x; let by = xy.y; if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) { let dis = ball.getDestDis(xy); let angle = Math.asin((ball.gameObj.width - 3) / dis); let sin = Math.sin(angle); let cos = Math.cos(angle); this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3); this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin; this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos; let dx = bx + this.tempDir2.x * dis; let dy = by + this.tempDir2.y * dis; let isr = this.isBlock(0, bx, by, dx, dy, ball.number); sin = Math.sin(-angle); cos = Math.cos(-angle); this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin; this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos; dx = bx + this.tempDir2.x * dis; dy = by + this.tempDir2.y * dis; let isl = this.isBlock(0, bx, by, dx, dy, ball.number); if (isr && isl) return false; ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3; } return true; } setKick(dx, dy) { this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1; this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2); this.tempDir1.x = 0; this.tempDir1.y = 1; this.tempDir2.y = -this.tempDir2.y; let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2); if (num > 1) num = 1; let rot = Math.acos(num) * 57.3; if (this.tempDir2.x < 0) rot = 360 - rot; this.destRot += rot; } } class ui_UIGame extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "UIGame")); } onConstruct() { this.c1 = this.getController("c1"); this.d3Root = (this.getChild("d3Root")); this.clickNode = (this.getChild("clickNode")); this.d2Root = (this.getChild("d2Root")); this.topNode = (this.getChild("topNode")); this.n72 = (this.getChild("n72")); this.n40 = (this.getChild("n40")); this.rulerNode = (this.getChild("rulerNode")); this.rulerClickNode = (this.getChild("rulerClickNode")); this.n50 = (this.getChild("n50")); this.keduNode = (this.getChild("keduNode")); this.powerTxt = (this.getChild("powerTxt")); this.powerNode = (this.getChild("powerNode")); this.colorNode = (this.getChild("colorNode")); this.powerEft = (this.getChild("powerEft")); this.myPowerNode = (this.getChild("myPowerNode")); this.ganNode = (this.getChild("ganNode")); this.rodMethodNode = (this.getChild("rodMethodNode")); this.placeChallengeNode = (this.getChild("placeChallengeNode")); this.placeNormalNode = (this.getChild("placeNormalNode")); this.skillRod = (this.getChild("skillRod")); this.border = (this.getChild("border")); this.bigSkillNode = (this.getChild("bigSkillNode")); this.classicWorldsNode = (this.getChild("classicWorldsNode")); this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode")); this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode")); this.awardSpineNode = (this.getChild("awardSpineNode")); this.guanyuNode = (this.getChild("guanyuNode")); this.helpBtn = (this.getChild("helpBtn")); this.wordsBtn = (this.getChild("wordsBtn")); this.aiWordsBtn = (this.getChild("aiWordsBtn")); this.returnBtn = (this.getChild("returnBtn")); this.ballNode = (this.getChild("ballNode")); this.whiteAni = (this.getChild("whiteAni")); this.blackAni = (this.getChild("blackAni")); this.selfTurn = (this.getChild("selfTurn")); this.aiTurn = (this.getChild("aiTurn")); this.deskNode = (this.getChild("deskNode")); this.moveNode = (this.getChild("moveNode")); this.selfTalk = (this.getChild("selfTalk")); this.aiTalk = (this.getChild("aiTalk")); this.d2Node = (this.getChild("d2Node")); this.snowNode = (this.getChild("snowNode")); this.guide2 = (this.getChild("guide2")); this.guide1 = (this.getChild("guide1")); this.guide3 = (this.getChild("guide3")); this.guideNode = (this.getChild("guideNode")); } } ui_UIGame.URL = "ui://isxx5ak7kt443qg"; class ui_UIGameEnd extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "UIGameEnd")); } onConstruct() { this.c1 = this.getController("c1"); this.n22 = (this.getChild("n22")); this.n2 = (this.getChild("n2")); this.n52 = (this.getChild("n52")); this.n53 = (this.getChild("n53")); this.coinNode = (this.getChild("coinNode")); this.closeNode = (this.getChild("closeNode")); this.moneyNode = (this.getChild("moneyNode")); this.secretary = (this.getChild("secretary")); this.n27 = (this.getChild("n27")); this.n29 = (this.getChild("n29")); this.talkNode = (this.getChild("talkNode")); this.n38 = (this.getChild("n38")); this.n39 = (this.getChild("n39")); this.n40 = (this.getChild("n40")); this.awardNode = (this.getChild("awardNode")); this.starNumNode = (this.getChild("starNumNode")); this.n47 = (this.getChild("n47")); this.conditionNode = (this.getChild("conditionNode")); this.isGetAward = (this.getChild("isGetAward")); this.leftBtn = (this.getChild("leftBtn")); this.rightBtn = (this.getChild("rightBtn")); this.btnNode = (this.getChild("btnNode")); } } ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3"; class ui_UIAddCoin extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "UIAddCoin")); } onConstruct() { this.n11 = (this.getChild("n11")); this.myNode = (this.getChild("myNode")); this.t0 = this.getTransition("t0"); } } ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs"; class UIAddCoin extends UIBase { constructor() { super(); this.coinNum = 2000; } onConstructor() { this.ui = ui_UIAddCoin.createInstance(); this.contentPane = this.ui; this.isEject = false; this.addUIClick(this.ui.myNode.cancelBtn, this.hide); this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin); } show() { super.show(); this.ui.t0.play(); } videoAddCoin() { console.log('zh:qjff_AD_for_UIAddCoin'); if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) { } else { console.log('zh:AD 失败,直接发放奖励'); this.qjff_AD_for_UIAddCoin(); } } qjff_AD_for_UIAddCoin() { xGame.common.playObjFlyAnim(this.coinNum, Prop.coin); this.hide(); } } UIAddCoin.uiName = "UIAddCoin"; class ui_UIInvitation extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "UIInvitation")); } onConstruct() { this.n14 = (this.getChild("n14")); this.myNode = (this.getChild("myNode")); this.t0 = this.getTransition("t0"); } } ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r"; class UIInvitation extends UIBase { constructor() { super(); } onConstructor() { this.ui = ui_UIInvitation.createInstance(); this.contentPane = this.ui; this.isEject = false; this.addUIClick(this.ui.myNode.enterBtn, this.enterGame); } show() { super.show(); } enterGame() { xGame.common.gameMode = GameMode.classic; DataMgr.setChallengeTimes(1); xGame.common.passAwardCoin = 2000; let need = xGame.common.classicNiceNeddCoin; if (DataMgr.coinEnough(need)) { DataMgr.setCoin(-need); xGame.eventMgr.event(RESTART_GAME, true); Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode }); } else { xGame.eventMgr.event(RESTART_GAME, true); } this.hide(); } hide() { super.hide(); } } UIInvitation.uiName = "UIInvitation"; class ui_UIMain extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "UIMain")); } onConstruct() { this.n47 = (this.getChild("n47")); this.n10 = (this.getChild("n10")); this.secretary = (this.getChild("secretary")); this.shopBtn = (this.getChild("shopBtn")); this.moneyNode = (this.getChild("moneyNode")); this.headNode = (this.getChild("headNode")); this.bigMoveBtn = (this.getChild("bigMoveBtn")); this.placeBallBtn = (this.getChild("placeBallBtn")); this.classicBtn = (this.getChild("classicBtn")); this.globalBtn = (this.getChild("globalBtn")); this.n44 = (this.getChild("n44")); this.signBtn = (this.getChild("signBtn")); this.drawBtn = (this.getChild("drawBtn")); this.settingNode = (this.getChild("settingNode")); this.n45 = (this.getChild("n45")); this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn")); this.secretaryBtn = (this.getChild("secretaryBtn")); this.rankBtn = (this.getChild("rankBtn")); this.n46 = (this.getChild("n46")); this.liucheng1 = (this.getChild("liucheng1")); this.rightBtn = (this.getChild("rightBtn")); this.n75 = (this.getChild("n75")); this.secretaryGuide = (this.getChild("secretaryGuide")); this.liucheng2 = (this.getChild("liucheng2")); this.guideBtn = (this.getChild("guideBtn")); this.n73 = (this.getChild("n73")); this.wordsNode = (this.getChild("wordsNode")); this.enterGuide = (this.getChild("enterGuide")); this.talkNode = (this.getChild("talkNode")); this.n83 = (this.getChild("n83")); this.n84 = (this.getChild("n84")); this.n_Logout = (this.getChild("n_Logout")); this.n_zhuCe = (this.getChild("n_zhuCe")); this.n_dengLu = (this.getChild("n_dengLu")); } } ui_UIMain.URL = "ui://isxx5ak7kt443qc"; class ui_UIMoyu extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("loading", "UIMoyu")); } onConstruct() { this.ageTip = (this.getChild("ageTip")); this.mainBg = (this.getChild("mainBg")); this.xyNode = (this.getChild("xyNode")); this.rnNode = (this.getChild("rnNode")); this.fcmNode = (this.getChild("fcmNode")); this.ageNode = (this.getChild("ageNode")); this.tipNode = (this.getChild("tipNode")); this.msgNode = (this.getChild("msgNode")); } } ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea"; class MoyuMgr { static initMoyu() { this.moyuView = new MoyuView(); Laya.stage.addChild(this.moyuView.ui.displayObject); this.moyuView.ui.x = (Laya.stage.width - 1334) / 2; this.moyuView.ui.displayObject.zOrder = 1000; this.moyuView.init(); this.moyuView.showTip(true); this.moyuView.showAge(true, 0, Laya.stage.height - 320); window['XApk'] = this; } static showAge(show) { if (this.moyuView) this.moyuView.showAge(show); } static onPlatMsg(idx) { if (!MoyuMgr.moyuView) return; if (idx == '0') { MoyuMgr.moyuView.showTip(false); } } static showAgree(call) { if (this.moyuView) this.moyuView.showAgree(call); else call && call(); } static showXy(type = 1) { if (this.moyuView) this.moyuView.showXy(type); } } MoyuMgr.isAdvise = false; class MoyuView { constructor() { this.ysxyNum = 1; this.ysJson = null; this.ui = ui_UIMoyu.createInstance(); } init() { this.ui.mainBg.visible = false; this.ui.xyNode.visible = false; this.ui.ageNode.visible = false; this.ui.tipNode.visible = false; this.ui.rnNode.visible = false; this.ui.fcmNode.visible = false; this.ui.ageTip.visible = false; this.ui.msgNode.visible = false; this.ui.visible = false; this.ui.xyNode.xyList.setVirtual(); this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false); this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]); this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]); this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]); this.ui.xyNode.btnKnown.visible = false; this.ui.xyNode.xy1.visible = false; this.ui.xyNode.xy2.visible = false; this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false; this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false; this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]); this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]); this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]); this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]); this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]); this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]); this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]); this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]); this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]); this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]); this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]); this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]); if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) { this.ysxyNum = 2; } } onClick(obj) { xGame.soundMgr.playSound(xGame.common.btnClickStr); switch (obj) { case this.ui.ageTip: if (Moyu.isTTApk) { this.ui.ageNode.visible = true; this.ui.mainBg.visible = true; } break; case this.ui.tipNode: this.showTip(false); break; case this.ui.ageNode.btnAge: this.ui.ageNode.visible = false; this.ui.mainBg.visible = false; if (!this.ui.xyNode.visible && !this.ui.rnNode.visible) this.ui.visible = false; break; case this.ui.xyNode.btnXy3: case this.ui.xyNode.btnXy1: this.loadXy(1); break; case this.ui.xyNode.btnXy2: this.loadXy(2); break; case this.ui.xyNode.btnBack: this.ui.xyNode.xy1.visible = true; this.ui.xyNode.xy2.visible = false; break; case this.ui.xyNode.btnKnown: this.ui.xyNode.visible = false; this.ui.mainBg.visible = false; this.ui.visible = false; break; case this.ui.rnNode.btnCheck: this.check(); break; case this.ui.rnNode.btnExit: case this.ui.xyNode.btnNo: this.ysxyNum--; if (this.ysxyNum > 0) this.showMsg("Refuse to quit the game once again"); else { Moyu.userAgree(false); Moyu.exit(); } break; case this.ui.xyNode.btnSure: case this.ui.xyNode.btnYes: DataMgr.userData.isAgree = true; DataMgr.saveUserData(); this.onAgree(); break; case this.ui.rnNode.btnDone: this.ui.rnNode.visible = false; this.ui.visible = false; break; case this.ui.fcmNode.btnRn: this.showRn(); break; } } showTip(show) { if (!Moyu.isVVApk && !Moyu.isOPApk) return; if (show) { MoyuMgr.isAdvise = true; this.ui.visible = true; this.ui.tipNode.visible = true; this.ui.tipNode.alpha = 1; Laya.timer.once(1000, this, this.showTip, [false]); } else { this.ui.tipNode.alpha = 1; this.ui.tipNode.visible = true; Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => { this.ui.tipNode.visible = false; MoyuMgr.isAdvise = false; }), 1000); } } showAge(show, px = 0, py = 0) { if (Moyu.platType > 10 && !Moyu.isIos) { this.ui.ageTip.x = px; this.ui.ageTip.y = py; this.ui.ageTip.visible = show; if (show) this.ui.visible = true; } } showAgree(call) { this.agreeCall = call; this.onAgree(); return; if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) { this.showXy(0); } else this.onAgree(); } onAgree() { if (!this.ui.ageNode.visible) this.ui.visible = false; this.ui.xyNode.visible = false; Moyu.userAgree(true); this.showAge(false); this.agreeCall && this.agreeCall(); this.showRn(); } showMsg(txt) { this.ui.msgNode.txtMsg.text = txt; this.ui.msgNode.visible = true; this.ui.msgNode.alpha = 1; this.ui.visible = true; Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => { this.ui.msgNode.visible = false; }), 2500, true); } showRn() { if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) { if (!Moyu.isRealName || Moyu.gameTime < 999) { this.ui.rnNode.rn1.visible = true; this.ui.rnNode.rn2.visible = false; this.ui.rnNode.rn3.visible = false; this.ui.rnNode.rn4.visible = false; this.ui.rnNode.visible = true; this.ui.mainBg.visible = true; this.ui.rnNode.btnDone.visible = false; this.ui.rnNode.btnExit.visible = true; this.ui.rnNode.btnCheck.visible = true; this.ui.fcmNode.visible = false; this.ui.visible = true; return; } } this.showFcm(); } showFcm() { if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) { Moyu.initFCM(true); if (Moyu.gameTime < 1) this.fcmLoop(); else if (Moyu.gameTime < 999) Laya.timer.loop(10000, this.ui, this.fcmLoop); } } fcmLoop() { if (Moyu.gameTime < 1) { this.ui.rnNode.visible = false; this.ui.fcmNode.visible = true; this.ui.mainBg.visible = true; this.ui.visible = true; this.ui.fcmNode.btnRn.visible = !Moyu.isLegal; Laya.timer.clear(this.ui, this.fcmLoop); } } check() { if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) { this.ui.rnNode.rn1.visible = false; this.ui.rnNode.rn2.visible = false; this.ui.rnNode.rn4.visible = true; } else if (this.ui.rnNode.rn4.visible) { let name = this.ui.rnNode.inputName.text; let code = this.ui.rnNode.inputCode.text; if (code && code.length == 18) { this.ui.rnNode.rn1.visible = false; this.ui.rnNode.rn4.visible = false; Moyu.authenticate(name, code, (res) => { this.ui.rnNode.rn2.visible = !res; this.ui.rnNode.rn3.visible = res; this.ui.rnNode.btnDone.visible = res; this.ui.rnNode.btnExit.visible = !res; this.ui.rnNode.btnCheck.visible = !res; if (res) this.showFcm(); }); } else this.showMsg("信息填写不完整"); } } loadXy(type = 0) { this.ui.xyNode.xy1.visible = false; this.ui.xyNode.xy2.visible = true; this.ui.xyNode.xyList.scrollToView(0); if (type == 1) { Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY)); } else if (type == 2) { Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY)); } } showXy(type = 0) { this.xyBtn(); if (type == 0) { if (Moyu.isPlat(MoyuPlat.f399Apk)) { this.ui.xyNode.btnSure.visible = true; } else { this.ui.xyNode.btnYes.visible = true; this.ui.xyNode.btnNo.visible = true; } } else { this.ui.xyNode.btnKnown.visible = true; this.ui.mainBg.visible = true; } this.ui.xyNode.xy1.visible = true; this.ui.xyNode.xy2.visible = false; this.ui.xyNode.visible = true; this.ui.visible = true; } xyBtn() { this.ui.xyNode.btnSure.visible = false; this.ui.xyNode.btnYes.visible = false; this.ui.xyNode.btnNo.visible = false; this.ui.xyNode.btnKnown.visible = false; { this.ui.xyNode.btnXy3.visible = false; this.ui.xyNode.btnXy2.visible = true; this.ui.xyNode.btnXy1.visible = true; this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》"; } } createXY(json) { this.ysJson = json.content; this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury"); this.ui.xyNode.xyList.numItems = this.ysJson.length; this.ui.xyNode.xy2.visible = true; } renderListItem(idx, cell) { let xy = this.ysJson[idx]; cell.height = xy.line * 30; cell.xyItem.text = xy.text; } onDestroy() { this.agreeCall = null; } } class SettingNode { constructor(ui) { this.showSetting = false; this.openSound = true; this.openShake = true; this.ui = ui; this.ui.soundBtn.onClick(this, this.switchSound); this.ui.shakeBtn.onClick(this, this.switchShake); this.ui.xyBtn.onClick(this, this.onXy); this.ui.clickNode.onClick(this, this.changeSetting); this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk; this.ui.xyBtn.visible = false; this.ui.shakeBtn.visible = false; } changeSetting() { xGame.soundMgr.playSound(xGame.common.btnClickStr); this.showSetting = !this.showSetting; this.ui.c1.selectedIndex = this.showSetting ? 1 : 0; } switchSound() { xGame.soundMgr.playSound(xGame.common.btnClickStr); this.openSound = !this.openSound; Moyu.onSetting(this.openSound, this.openShake); xGame.soundMgr.onSetting(this.openSound); this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1; } switchShake() { xGame.soundMgr.playSound(xGame.common.btnClickStr); this.openShake = !this.openShake; Moyu.onSetting(this.openSound, this.openShake); this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1; } onXy() { xGame.soundMgr.playSound(xGame.common.btnClickStr); MoyuMgr.showXy(1); } } class ui_UILevelDisplay extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "UILevelDisplay")); } onConstruct() { this.n9 = (this.getChild("n9")); this.myNode = (this.getChild("myNode")); this.closeNode = (this.getChild("closeNode")); } } ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o"; class ui_UILevelProp extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "UILevelProp")); } onConstruct() { this.n16 = (this.getChild("n16")); this.myNode = (this.getChild("myNode")); this.closeBtn = (this.getChild("closeBtn")); this.moneyNode = (this.getChild("moneyNode")); this.t1 = this.getTransition("t1"); } } ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l"; class ui_ShowItem extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "ShowItem")); } onConstruct() { this.myImg = (this.getChild("myImg")); } } ui_ShowItem.URL = "ui://isxx5ak710hfv49o"; class ShowItem { constructor() { this.ui = ui_ShowItem.createInstance(); } destroySelf() { if (!this.ui.isDisposed) { this.ui.removeFromParent(); this.ui.dispose(); } } setParent(parent) { parent.addChild(this.ui); } setPos(x, y) { this.ui.x = x; this.ui.y = y; } setUrl(index) { this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index); } } class ui_UIPower extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "UIPower")); } onConstruct() { this.n11 = (this.getChild("n11")); this.myNode = (this.getChild("myNode")); this.t0 = this.getTransition("t0"); } } ui_UIPower.URL = "ui://isxx5ak7jpszv4n1"; class UIPower extends UIBase { constructor() { super(); } onConstructor() { this.ui = ui_UIPower.createInstance(); this.contentPane = this.ui; this.isEject = false; this.addUIClick(this.ui.myNode.cancelBtn, this.hide); this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower); } show() { super.show(); this.ui.t0.play(); } videoGetPower() { console.log('zh:qjff_AD_for_uipower'); if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) { } else { console.log('zh:AD 失败,直接发放奖励'); this.qjff_AD_for_uipower(); } } qjff_AD_for_uipower() { DataMgr.setPower(xGame.common.videoPower, true); xGame.eventMgr.event(POWER_TIME); this.hide(); } } UIPower.uiName = "UIPower"; class LocalStorageManager { test1() { LocalStorageManager.setItem("playerName", "Tom"); LocalStorageManager.setItem("playerLevel", 5); LocalStorageManager.setItem("playerData", { score: 100, level: 3 }); const name = LocalStorageManager.getItem("playerName"); const level = LocalStorageManager.getItem("playerLevel"); const data = LocalStorageManager.getItem("playerData"); console.log(name); console.log(level); console.log(data); LocalStorageManager.removeItem("playerLevel"); } static setItem(key, value) { Laya.LocalStorage.setItem(key, JSON.stringify(value)); } static getItem(key) { const data = Laya.LocalStorage.getItem(key); if (data === null) return null; try { return JSON.parse(data); } catch (e) { return data; } } static removeItem(key) { Laya.LocalStorage.removeItem(key); } static clear() { Laya.LocalStorage.clear(); } static hasJosnKey(key) { var value = Laya.LocalStorage.getJSON(key); if (value != null) { return true; } else { return false; } } static hasKey(key) { return Laya.LocalStorage.getItem(key) !== null; } } class UILevelProp extends UIBase { constructor() { super(); this.firstPos = 385; this.secondPos = 467; this.showItemArr = []; } onFontLoaded() { try { this.ui.myNode.conditionTxt.font = "arial"; console.log("zh: onFontLoaded 设置arial字体成功"); } catch (error) { console.log("zh: constructor onFontLoaded加载arial字体失败"); } } onConstructor() { this.ui = ui_UILevelProp.createInstance(); this.contentPane = this.ui; this.isEject = false; this.addUIClick(this.ui.closeBtn, this.hide); this.moneyNode = new MoneyNode(this.ui.moneyNode); this.addUIClick(this.ui.myNode.startBtn, this.startGame); } show(level) { super.show(); this.ui.t1.play(); this.level = level; this.data = cfgTable.placeballData[this.level]; this.updateSelf(); this.showPreView(); this.moneyNode.ui.c1.selectedIndex = 2; this.moneyNode.checkPowerTime(); this.moneyNode.powerChange(); } showPreView() { let item; let data; for (let index = 0; index < this.showItemArr.length; index++) { item = this.showItemArr[index]; item.destroySelf(); } this.showItemArr = []; let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level); for (const key in cfgData) { data = cfgData[key]; item = new ShowItem(); item.setParent(this.ui.myNode.displayRoot); item.setPos(data.x, data.y); item.setUrl(data.value); this.showItemArr.push(item); } } updateSelf() { this.ui.myNode.levelTxt.text = `Level ${this.level}`; this.ui.myNode.modeNode.c1.selectedIndex = this.data.type; if (this.data.ball == -1) { this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table"; } else { this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`; } let localData = DataMgr.getPlaceBallLevel(this.level); let getAward = localData.getAward; let cfg = cfgTable.placeballData[this.level]; let coin = this.data.award[0]; let diamond = this.data.award[1]; if (cfg.type == PlaceBallType.challenge) { diamond = 0; coin = 100; } this.ui.myNode.coinNode.visible = coin == 0 ? false : true; this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true; this.ui.myNode.coinNode.numTxt.text = coin + ""; if (cfg.type == PlaceBallType.challenge) { this.ui.myNode.coinNode.numTxt.text = ""; } this.ui.myNode.diamondNode.numTxt.text = diamond + ""; if (coin > 0 && diamond > 0) { this.ui.myNode.diamondNode.x = 385; this.ui.myNode.coinNode.x = 467; } else { this.ui.myNode.diamondNode.x = 385; this.ui.myNode.coinNode.x = 385; } if (!getAward) { this.ui.myNode.coinNode.c1.selectedIndex = 0; this.ui.myNode.diamondNode.c1.selectedIndex = 0; } else { this.ui.myNode.diamondNode.c1.selectedIndex = 1; this.ui.myNode.coinNode.c1.selectedIndex = 1; } } startGame() { if (DataMgr.powerEnough()) { console.log('zh:powerEnough =' + DataMgr.powerEnough()); this.ui.myNode.startBtn.touchable = false; this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => { console.log('zh:startGame '); this.ui.myNode.startBtn.touchable = true; DataMgr.setPower(-1); xGame.eventMgr.event(POWER_TIME); xGame.common.gameMode = GameMode.placeBall; xGame.common.placeBallCurLevel = this.level; xGame.uiMgr.Show(UIGame); this.logEventForChallenge_level_start(this.level); xGame.uiMgr.Hide(UILevelDisplay); xGame.uiMgr.Hide(UIMain); this.hide(); })); } else { console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough()); xGame.uiMgr.Show(UIPower); } } logEventForChallenge_level_start(level) { let keyStr = 'sjmd_challenge_level_start'; let jsonStr = { "count": 1, "gold_balance ": DataMgr.getCoin(), "level": level, "diamond_balance ": DataMgr.getDiamond() }; if (LocalStorageManager.hasJosnKey(keyStr)) { const d = LocalStorageManager.getItem(keyStr); if (level > d.level) { jsonStr.count = d.count + 1; LocalStorageManager.setItem(keyStr, jsonStr); } else { } } else { LocalStorageManager.setItem(keyStr, jsonStr); } const reqStr = JSON.stringify(jsonStr); JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr); } hide() { super.hide(); } } UILevelProp.uiName = "UILevelProp"; class PutBallLevelDisplay { constructor(ui, index) { this.index = 0; this.ui = ui; this.index = index; this.ui.onClick(this, this.clickSelf); this.updateSelf(); this.ui.levelTxt.text = (this.index + 1) + ""; this.ui.challenge.levelTxt.text = (this.index + 1) + ""; this.ui.special.levelTxt.text = (this.index + 1) + ""; } updateSelf() { let level = this.index + 1; this.data = DataMgr.getPlaceBallLevel(level); this.ui.starNode.c1.selectedIndex = this.data.star; let isChallenge = cfgTable.placeballData[level].type; if (this.data.isCur) { if (isChallenge) { this.ui.c1.selectedIndex = 5; } else { this.ui.c1.selectedIndex = 2; } } else { if (this.data.play) { if (this.data.star == 3) { this.ui.c1.selectedIndex = 0; } else { this.ui.c1.selectedIndex = 1; } } else { if (isChallenge) { this.ui.c1.selectedIndex = 4; } else { this.ui.c1.selectedIndex = 3; } } } } clickSelf() { if (!this.data.play) return; xGame.soundMgr.playSound(xGame.common.btnClickStr); xGame.uiMgr.Show(UILevelProp, this.index + 1); } } class UILevelDisplay extends UIBase { constructor() { super(); } onConstructor() { this.ui = ui_UILevelDisplay.createInstance(); this.contentPane = this.ui; this.isEject = false; this.myList = this.ui.myNode.myList; this.addUIClick(this.ui.closeNode.closeBtn, this.hide); this.levelItemArr = []; let levelNum = xGame.cfgMgr.getMaxPlaceBall(); this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false); this.myList.numItems = levelNum; if (Moyu.isKs) this.ui.closeNode.closeBtn.x += 100; } levelItemRender(index, target) { let item = new PutBallLevelDisplay(target, index); this.levelItemArr.push(item); } show() { super.show(); this.updateLevel(); this.scrollToPlace(); } updateLevel() { let temp; for (let index = 0; index < this.levelItemArr.length; index++) { temp = this.levelItemArr[index]; temp.updateSelf(); } } scrollToPlace() { let maxNum = xGame.cfgMgr.getMaxPlaceBall(); let passArr = DataMgr.getPlaceBallLevelList(); let offest = passArr.length; if (offest >= maxNum - 1) offest = maxNum - 1; this.myList.scrollToView(offest, true, true); } hide() { super.hide(); } } UILevelDisplay.uiName = "UILevelDisplay"; class ui_UIMatching extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "UIMatching")); } onConstruct() { this.n5 = (this.getChild("n5")); this.n49 = (this.getChild("n49")); this.n51 = (this.getChild("n51")); this.n64 = (this.getChild("n64")); this.n2 = (this.getChild("n2")); this.n53 = (this.getChild("n53")); this.n54 = (this.getChild("n54")); this.n56 = (this.getChild("n56")); this.n58 = (this.getChild("n58")); this.n59 = (this.getChild("n59")); this.n57 = (this.getChild("n57")); this.n60 = (this.getChild("n60")); this.n62 = (this.getChild("n62")); this.awardTxt = (this.getChild("awardTxt")); this.n61 = (this.getChild("n61")); this.selfHead = (this.getChild("selfHead")); this.aiHead = (this.getChild("aiHead")); this.n82 = (this.getChild("n82")); this.n84 = (this.getChild("n84")); this.n83 = (this.getChild("n83")); this.t1 = this.getTransition("t1"); this.t2 = this.getTransition("t2"); this.t3 = this.getTransition("t3"); this.t4 = this.getTransition("t4"); } } ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2"; class UIMatching extends UIBase { constructor() { super(); } onConstructor() { this.ui = ui_UIMatching.createInstance(); this.contentPane = this.ui; this.isEject = false; } show(callback) { super.show(); PlatMgr.showBanner(true); this.callback = callback; let user = Moyu.getUserInfo(); if (!this.selfPot) { this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y); } if (!this.aiPot) { this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y); } this.ui.awardTxt.text = xGame.common.passAwardCoin + ""; this.ui.selfHead.nameTxt.text = user.nickName; xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon); this.ui.aiHead.nameTxt.text = "???"; this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx"); this.ui.selfHead.c1.selectedIndex = 0; this.ui.aiHead.c1.selectedIndex = 0; this.ui.selfHead.x = this.selfPot.x; this.ui.selfHead.y = this.selfPot.y; this.ui.aiHead.x = this.aiPot.x; this.ui.aiHead.y = this.aiPot.y; switch (xGame.common.gameMode) { case GameMode.classic: break; case GameMode.bigMove: this.initSkillData(); break; default: break; } this.ui.t1.play(Laya.Handler.create(this, () => { this.ui.t2.play(Laya.Handler.create(this, () => { switch (xGame.common.gameMode) { case GameMode.classic: this.waitingPeople(); break; case GameMode.bigMove: this.skillSelectFinish(xGame.common.curPlayerSkillType); break; default: break; } })); })); } initSkillData() { this.skillSelectData = []; let skillUrl = xGame.common.skillIconList; let skillName = xGame.common.skillNameList; let skillLevel = DataMgr.getBigSkillList(); let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu]; for (let index = 0; index < 5; index++) { let obj = {}; obj.skillImg = skillUrl[index]; obj.skillName = skillName[index]; obj.skillType = skillType[index]; obj.skillLevel = skillLevel[index]; this.skillSelectData.push(obj); } } getAISkillLevel(myLevel) { let video = xGame.common.upSkillLevel; let aiLevel; let temp; if (video) { temp = xGame.common.randomNum(-2, -1); } else { if (myLevel <= 5) { temp = xGame.common.randomNum(1, 3); } else if (myLevel <= 9) { temp = xGame.common.randomNum(-2, 1); } else { temp = xGame.common.randomNum(-4, 0); } } aiLevel = temp + myLevel; if (aiLevel <= 1) aiLevel = 1; if (aiLevel >= 10) aiLevel = 10; return aiLevel; } getAISkillType() { return xGame.common.randomNum(1, 4); let successTimes = DataMgr.getSkillSuccessTimes(); let info = cfgTable.aiskillData[successTimes]; if (!info) { let max = Object.keys(cfgTable.aiskillData).length - 1; info = cfgTable.aiskillData[max]; } let dataArr = info.skillselect; let myCfg = {}; for (let index = 0; index < dataArr.length; index++) { let temp = dataArr[index].split('-'); myCfg[temp[0]] = {}; myCfg[temp[0]].id = parseInt(temp[0]); myCfg[temp[0]].weight = parseInt(temp[1]); } let aiCfg = xGame.common.initWeight(myCfg); let curData = xGame.common.getRandomWeightData(aiCfg); return parseInt(curData.id); } getAISkillData(index) { let myLevel = this.skillSelectData[index].skillLevel; let aiLevel = this.getAISkillLevel(myLevel); let aiType = this.getAISkillType() - 1; return { aiLevel, aiType } = { aiLevel, aiType }; } skillSelectFinish(index) { let aiInfo = this.getAISkillData(index); xGame.common.gameMgr.selfCurSkill = index; xGame.common.gameMgr.aiCurSkill = aiInfo.aiType; xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel; this.ui.selfHead.c1.selectedIndex = 1; this.ui.aiHead.c1.selectedIndex = 1; let myData = this.skillSelectData[index]; this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg); let guide = DataMgr.getSkillGuide(); if (guide == 0) { this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level"; } else { this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel; } let aiData = this.skillSelectData[aiInfo.aiType]; this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg); this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel; this.waitingPeople(); } waitingPeople() { let time = xGame.common.randomNum(1000, 3000); time += 1000; Laya.timer.once(time, this, () => { this.matchingSuccess(); }); } matchingSuccess() { let gameUI = xGame.common.gameUI; let name = gameUI.ui.topNode.aiNameTxt.text; let url = gameUI.ui.topNode.aiHeadLoader.url; this.ui.aiHead.nameTxt.text = name; this.ui.aiHead.headImg.url = url; name = gameUI.ui.topNode.selfNameTxt.text; url = gameUI.ui.topNode.selfHeadLoader.url; this.ui.selfHead.nameTxt.text = name; this.ui.selfHead.headImg.url = url; this.ui.t3.play(Laya.Handler.create(this, () => { this.callback && this.callback(); this.ui.t4.play(Laya.Handler.create(this, () => { this.destroySelf(); })); })); } destroySelf() { this.callback = null; this.skillSelectData = null; this.selfPot = null; this.aiPot = null; if (!this.ui.isDisposed) { this.ui.removeFromParent(); this.ui.dispose(); } xGame.uiMgr.destroyUI(this); } } UIMatching.uiName = "UIMatching"; class ui_UIRanking extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "UIRanking")); } onConstruct() { this.n26 = (this.getChild("n26")); this.myNode = (this.getChild("myNode")); } } ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8"; class UIRanking extends UIBase { constructor() { super(); this.showSelf = true; this.rankType = 1; this.rankList = []; this.topX = 10; this.myIndex = this.topX + 1; this.myStar = 0; } onConstructor() { this.ui = ui_UIRanking.createInstance(); this.contentPane = this.ui; this.isEject = false; this.addUIClick(this.ui.myNode.closeBtn, this.hide); this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode); this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]); this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]); this.ui.myNode.myList.setVirtual(); this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false); } show() { super.show(); this.getPaiHangBangDataFormJosnFile(); this.updateSelf(); let self = Moyu.getUserInfo(); if (!self.isAuth) { Moyu.initUser(this, () => { DataMgr.upRankData(); }); } } getPaiHangBangDataFormJosnFile() { const rankingList = cfgTable.paiHangBangData.list; this.updateItemData(rankingList); } updateSelfItem() { console.log('zh:Moyu.platType =' + Moyu.platType); let self = Moyu.getUserInfo(); this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3; this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString(); if (this.myIndex > this.topX) { this.ui.myNode.selfNode.rankTxt.fontSize = 36; } else { this.ui.myNode.selfNode.rankTxt.fontSize = 30; } this.ui.myNode.selfNode.valueTxt.text = this.myStar + ""; this.ui.myNode.selfNode.nameTxt.text = 'myself'; xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon); } updateItemData(data) { this.myStar = xGame.common.getAllStarNum(); if (this.rankList.length < 2) { this.rankList = data; let self = Moyu.getUserInfo(); console.log('zh:myself iuserinfo = ' + JSON.stringify(self)); self.headIcon = self.headIcon; for (let i = 0; i < data.length; i++) { let data = this.rankList[i]; if (data.userId == self.userId) { this.rankList.splice(i, 1); break; } } for (let i = 0; i < data.length; i++) { let data = this.rankList[i]; if (data.rankScore < this.myStar && this.myIndex > this.topX) { this.myIndex = i + 1; let user = { headIcon: self.headIcon, nickName: "myself" }; let ud = { user: user, data: {} }; let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) }; console.log('zh:Moyu.platType = ' + Moyu.platType); if (Moyu.platType < 11) { user.headIcon = self.headIcon; user.nickName = self.nickName; } this.rankList.splice(i, 0, md); break; } } } this.updateSelfItem(); this.ui.myNode.myList.numItems = this.rankList.length; } updateItemUI(index, obj) { let data = this.rankList[index]; let userData = JSON.parse(data.userData).user; obj.nameTxt.text = userData.nickName.toString(); obj.valueTxt.text = data.rankScore; xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80); obj.rankTxt.text = index + 1; switch (index) { case 0: this.setImg(obj, 1, 0, 0); obj.rankTxt.color = "#FFC047"; break; case 1: this.setImg(obj, 0, 1, 0); obj.rankTxt.color = "#ACACAC"; break; case 2: this.setImg(obj, 0, 0, 1); obj.rankTxt.color = "#D09672"; break; default: this.setImg(obj, 0, 0, 0); obj.rankTxt.color = "#496FAB"; break; } } setImg(obj, a, b, c) { obj.img1.visible = a ? true : false; obj.img2.visible = b ? true : false; obj.img3.visible = c ? true : false; } changeList(type) { this.rankType = type; this.updateSelf(); } changeSelfNode() { this.showSelf = !this.showSelf; this.updateSelf(); } updateSelf() { this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1; this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1; this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1; this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0; this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1; } } UIRanking.uiName = "UIRanking"; class ui_UISecretary extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "UISecretary")); } onConstruct() { this.n0 = (this.getChild("n0")); this.myNode = (this.getChild("myNode")); this.closeBtn = (this.getChild("closeBtn")); this.t0 = this.getTransition("t0"); } } ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1"; class UISecretary extends UIBase { constructor() { super(); this.curIndex = 1; } onConstructor() { this.ui = ui_UISecretary.createInstance(); this.contentPane = this.ui; this.isEject = false; this.addUIClick(this.ui.closeBtn, this.closeSelf); this.nodeObj = { left: null, right: null, cur: null }; this.nodeObj.cur = this.ui.myNode.gameNode3; } show() { super.show(); this.ui.t0.play(); this.updateData(); } addSecretarySpine(node, spineName) { if (spineName == "mishu") { if (this.secretarySpine1) { node.displayObject.destroyChildren(); this.playWoman(this.secretarySpine1, node.displayObject); } else { let spine1 = new SpineMgr("mishu", () => { this.secretarySpine1 = spine1; this.playWoman(this.secretarySpine1, node.displayObject); }); } } else { if (this.secretarySpine2) { node.displayObject.destroyChildren(); this.playWoman(this.secretarySpine2, node.displayObject); } else { let spine2 = new SpineMgr("xiaomishu2", () => { this.secretarySpine2 = spine2; this.playWoman(this.secretarySpine2, node.displayObject); }); } } } playWoman(node, parent) { let xx = this.ui.myNode.gameNode3.secretary.width / 2; let yy = this.ui.myNode.gameNode3.secretary.height; let scale = 1.5; if (node == this.secretarySpine2) { scale = 1.2; } let data = { x: xx, y: yy, scaleX: scale, scaleY: scale }; node.play(data, 0, true, parent); } turnLeft() { this.curIndex--; if (this.curIndex < 1) { this.curIndex = 2; } let left = this.nodeObj.left; let right = this.nodeObj.right; let cur = this.nodeObj.cur; Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500); Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500); Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => { this.updateData(); })); this.ui.myNode.setChildIndex(right, 2); this.nodeObj.left = cur; this.nodeObj.right = left; this.nodeObj.cur = right; } turnRight() { this.curIndex++; if (this.curIndex > 2) { this.curIndex = 1; } let left = this.nodeObj.left; let right = this.nodeObj.right; let cur = this.nodeObj.cur; Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500); Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500); Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => { this.updateData(); })); this.ui.myNode.setChildIndex(left, 2); this.nodeObj.left = right; this.nodeObj.right = cur; this.nodeObj.cur = left; } updateData() { console.log('zh: updateData FFFFFFFFFF'); let data = cfgTable.secretaryshopData; let children = this.ui.myNode._children; let temp; let curData; for (let index = 0; index < children.length; index++) { temp = children[index]; curData = data[1]; temp.heightTxt.text = curData.height; temp.foodTxt.text = curData.food; temp.historyTxt.text = curData.history; temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg); this.addSecretarySpine(temp.secretary, curData.spine); let womanIndex = curData.id - 1; let getWoman = DataMgr.getSecretary(womanIndex); let curUse = DataMgr.getCurSecretary(); if (getWoman) { if (curUse == womanIndex) { temp.purchaseBtn.c1.selectedIndex = 1; } else { temp.purchaseBtn.c1.selectedIndex = 2; } } else { temp.purchaseBtn.c1.selectedIndex = 0; temp.purchaseBtn.diamondTxt.text = curData.price + ""; } temp.purchaseBtn.visible = false; } } clickSecretary(getWoman, curUse, womanIndex, needDiamond) { console.log('zh: 点击了clickSecretary '); xGame.soundMgr.playSound(xGame.common.btnClickStr); if (getWoman) { if (curUse != womanIndex) { console.log(); DataMgr.setCurSecretary(womanIndex); this.updateData(); } } else { console.log('zh:点击购买了'); let need = needDiamond; if (DataMgr.diamondEnough(need)) { DataMgr.setDiamond(-need); DataMgr.setSecretary(womanIndex, 1); DataMgr.setCurSecretary(womanIndex); this.updateData(); } else { xGame.uiMgr.Show(UIAddProp, 1); } } } closeSelf() { this.hide(); } } UISecretary.uiName = "UISecretary"; class ui_UIShop extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "UIShop")); } onConstruct() { this.n48 = (this.getChild("n48")); this.n0 = (this.getChild("n0")); this.secretary = (this.getChild("secretary")); this.talkNode = (this.getChild("talkNode")); this.closeNode = (this.getChild("closeNode")); this.moneyNode = (this.getChild("moneyNode")); this.myNode = (this.getChild("myNode")); } } ui_UIShop.URL = "ui://isxx5ak7g1giv4ep"; class BallRodDisplay { constructor(ui, index) { this.index = 0; this.uiIndex = 0; this.ui = ui; this.index = index; this.initData(); } initData() { this.ui.purchaseBtn.onClick(this, this.buyBallRod); let data = cfgTable.ballrodData[this.index + 1]; this.ui.nameTxt.text = data.name; this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img); this.ui.levelNode.c1.selectedIndex = data.quality; this.ui.purchaseBtn.diamondTxt.text = data.price + ""; if (data.spine) { this.mySpine = new SpineMgr(data.spine, () => { let xx = 150; let yy = 70; let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 }; this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject); }); } } updateSelf() { console.log('zh:updateSelf -------------- '); let get = DataMgr.getBallRod(this.index); if (get == null) get = 1; let curUse = DataMgr.getCurBallRod(); console.log('zh:updateSelf 选择的球杆 = ' + curUse); if (get) { if (curUse == this.index) { this.ui.purchaseBtn.c1.selectedIndex = 0; } else { this.ui.purchaseBtn.c1.selectedIndex = 1; } } else { this.ui.purchaseBtn.c1.selectedIndex = 2; } } buyBallRod() { xGame.soundMgr.playSound(xGame.common.btnClickStr); let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex; switch (selectedIndex) { case 0: break; case 1: console.log('zh:点击了 USE THIS'); DataMgr.setCurBallRod(this.index); let curUse = DataMgr.getCurBallRod(); console.log('zh:updateSelf 选择的球杆 = ' + curUse); let ui = xGame.uiMgr.getUI(UIShop); ui.updateBallRod(); break; case 2: let data = cfgTable.ballrodData[this.index + 1]; let need = data.price; if (DataMgr.diamondEnough(need)) { DataMgr.setDiamond(-need); DataMgr.setBallRod(this.index, 1); DataMgr.setCurBallRod(this.index); let ui = xGame.uiMgr.getUI(UIShop); ui.updateBallRod(); this.logEventForGouMaiGan(selectedIndex + '-' + data.name); } else { xGame.uiMgr.Show(UIAddProp, 1); } break; default: break; } } logEventForGouMaiGan(qiuGanName) { const ev = { value: qiuGanName }; const jsonStr = JSON.stringify(ev); console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr); JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr); } } class UIShop extends UIBase { constructor() { super(); this.itemNums = 0; this.curType = ""; } onConstructor() { this.ui = ui_UIShop.createInstance(); this.contentPane = this.ui; this.isEject = false; this.moneyNode = new MoneyNode(this.ui.moneyNode); this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf); this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan")); this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju")); this.addUIClick(this.ui, this.interuptSecretary); console.log('zh:this.renderBallRodthis.renderBallRodthis.renderBallRodthis.renderBallRod = ' + this.renderBallRod); this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false); this.ballRodArr = []; this.itemNums = Object.keys(cfgTable.ballrodData).length; this.ui.myNode.myList.numItems = this.itemNums; } show(type) { super.show(); console.log('zh:show type = ' + type); this.curType = type == 0 ? "qiugan" : "daoju"; this.switchBtn("qiugan"); this.playSecretaryIdle(); this.updateBallRod(); } test123() { console.log('zh:test123 '); } switchBtn(type) { console.log('zh:1111切換 sel type=' + type); if (type == "") { type = this.curType; } else { if (this.curType == type) { return; } else { this.curType = type; } } if (type == "qiugan") { console.log('zh:qg sel'); this.ui.myNode.n_qiuGan.c1.selectedIndex = 0; this.ui.myNode.n_daoju.c1.selectedIndex = 1; this.ui.myNode.myList.visible = true; this.ui.myNode.djList.visible = false; } else { console.log('zh:dj sel'); this.ui.myNode.n_qiuGan.c1.selectedIndex = 1; this.ui.myNode.n_daoju.c1.selectedIndex = 0; this.ui.myNode.myList.visible = false; this.ui.myNode.djList.visible = true; } } updateBallRod() { for (let index = 0; index < this.ballRodArr.length; index++) { this.ballRodArr[index].updateSelf(); } } renderBallRod(sort, obj) { let index = this.getIndexBySort(sort + 1) - 1; let ballRod = new BallRodDisplay(obj, index); this.ballRodArr.push(ballRod); } getIndexBySort(sort) { let object = cfgTable.ballrodData; for (const key in object) { if (object[key].sort == sort) { return parseInt(key); } } } playSecretaryIdle() { let parent = this.ui.secretary.displayObject; parent.destroyChildren(); let xx = this.ui.secretary.width / 2; let yy = this.ui.secretary.height; let scale = xGame.common.getSecretaryScale(); let data = { x: xx, y: yy, scaleX: scale, scaleY: scale }; xGame.common.secretary.play(data, 0, true, parent); } interuptSecretary() { Laya.timer.clearAll(this); this.playSecretaryRandomSound(); } playSecretaryRandomSound() { if (this.isHide) return; let time = xGame.common.randomNum(45000, 60000); Laya.timer.once(time, this, () => { if (this.isHide) return; let index = xGame.common.randomNum(4, 7); xGame.soundMgr.playSound("s_main0" + index); let words = 1; switch (index) { case 4: words = 5; break; case 5: words = 3; break; case 6: words = 6; break; case 7: words = 7; break; default: break; } xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt); this.playSecretaryRandomSound(); }); } closeSelf() { this.hide(); } } UIShop.uiName = "UIShop"; class ui_UISign extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "UISign")); } onConstruct() { this.n6 = (this.getChild("n6")); this.closeNode = (this.getChild("closeNode")); this.myNode = (this.getChild("myNode")); this.moneyNode = (this.getChild("moneyNode")); this.secretary = (this.getChild("secretary")); this.talkNode = (this.getChild("talkNode")); this.tripleBtn = (this.getChild("tripleBtn")); this.normalBtn = (this.getChild("normalBtn")); this.tipsNode = (this.getChild("tipsNode")); this.againBtn = (this.getChild("againBtn")); this.t0 = this.getTransition("t0"); } } ui_UISign.URL = "ui://isxx5ak7bf9jv4jj"; class SignMax { constructor(ui) { this.ui = ui; } updateSelf(index, sameDay, curDayIndex) { let data = cfgTable.signData[index + 1]; this.ui.titleTxt.text = data.title; let arr1 = data.award[0].split('-'); let arr2 = data.award[1].split('-'); let num1 = parseInt(arr1[1]); let num2 = parseInt(arr2[1]); this.ui.numTxt1.text = num1 + ""; this.ui.numTxt2.text = num2 + ""; this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]); this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]); if (xGame.common.signAwardContainsRod([data.award[0]])) { this.ui.numTxt1.visible = false; } else { this.ui.numTxt1.visible = true; } if (xGame.common.signAwardContainsRod([data.award[1]])) { this.ui.numTxt2.visible = false; } else { this.ui.numTxt2.visible = true; } if (index < curDayIndex) { this.ui.c1.selectedIndex = 1; } else if (index == curDayIndex) { if (sameDay) { this.ui.c1.selectedIndex = 2; } else { this.ui.c1.selectedIndex = 2; } } else { this.ui.c1.selectedIndex = 0; } } } class SignNormal { constructor(ui) { this.ui = ui; } updateSelf(index, sameDay, curDayIndex) { let data = cfgTable.signData[index + 1]; this.ui.titleTxt.text = data.title; let arr = data.award[0].split('-'); let type = parseInt(arr[0]); let num = parseInt(arr[1]); this.ui.numTxt.text = num + ""; if (type > 2) { this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]); this.ui.myIcon.rotation = 0; } else { this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]); this.ui.myIcon.rotation = 0; } if (xGame.common.signAwardContainsRod(data.award)) { this.ui.numTxt.visible = false; } else { this.ui.numTxt.visible = true; } if (index < curDayIndex) { this.ui.c1.selectedIndex = 1; } else if (index == curDayIndex) { if (sameDay) { this.ui.c1.selectedIndex = 2; } else { this.ui.c1.selectedIndex = 2; } } else { this.ui.c1.selectedIndex = 0; } } } class UISign extends UIBase { constructor() { super(); this.curDayIndex = 0; this.starX = 0; } onConstructor() { this.ui = ui_UISign.createInstance(); this.contentPane = this.ui; this.isEject = false; this.moneyNode = new MoneyNode(this.ui.moneyNode); this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf); this.initSignItem(); this.addUIClick(this.ui.normalBtn, this.normalGetAward); this.addUIClick(this.ui.againBtn, this.againGetAward); } show() { super.show(); this.ui.t0.play(); this.playSecretaryIdle(); this.updateSign(); } initSignItem() { this.signArr = []; for (let index = 0; index < 6; index++) { let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]); this.signArr.push(temp); } this.signMax = new SignMax(this.ui.myNode.day7); if (Moyu.isKs) this.ui.closeNode.closeBtn.x += 100; } updateSign() { let sameDay = xGame.common.judgeSameDay(); let max = 7; this.curDayIndex = DataMgr.getSignData(); if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay)) this.curDayIndex = 0; if (!sameDay) { this.ui.normalBtn.visible = true; this.ui.tipsNode.visible = false; this.ui.againBtn.visible = false; } else { this.ui.normalBtn.visible = false; let again = DataMgr.getExtraSign(); let isCurrency = false; let index = this.curDayIndex; if (index == 0) index = 7; let award = cfgTable.signData[index].award; let num = award[0].split("-")[0]; if (num == "1" || num == "2") isCurrency = true; let showAgain = again == 0 && isCurrency; this.ui.againBtn.visible = showAgain; this.ui.tipsNode.visible = !showAgain; } for (let index = 0; index < this.signArr.length; index++) { this.signArr[index].updateSelf(index, sameDay, this.curDayIndex); } this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex); } playSecretaryIdle() { let parent = this.ui.secretary.displayObject; parent.destroyChildren(); let xx = this.ui.secretary.width / 2; let yy = this.ui.secretary.height; let scale = xGame.common.getSecretaryScale(); let data = { x: xx, y: yy, scaleX: scale, scaleY: scale }; xGame.common.secretary.play(data, 0, true, parent); } closeSelf() { this.hide(); } normalGetAward() { let sameDay = xGame.common.judgeSameDay(); if (!sameDay) { let award = cfgTable.signData[this.curDayIndex + 1].award; let temp; let type; let num; let arr = []; for (let index = 0; index < award.length; index++) { temp = award[index].split("-"); type = parseInt(temp[0]); num = parseInt(temp[1]); let awardType = new AwardType(); awardType.num = num; awardType.type = type; arr.push(awardType); } xGame.common.getAward(arr, (watchVideo) => { this.curDayIndex++; if (this.curDayIndex > 7) this.curDayIndex = 0; DataMgr.setSignData(this.curDayIndex); DataMgr.setSignTime(new Date().getTime()); if (watchVideo) { DataMgr.setExtraSign(1); Moyu.sendDataEvent("signIn1"); } this.updateSign(); }); } } againGetAward() { Moyu.sendDataEvent("signIn2"); console.log('zh:qjff_AD_for_uisign'); if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) { } else { console.log('zh:AD 失败,直接发放奖励'); this.qjff_AD_for_uisign(); } } qjff_AD_for_uisign() { let index = this.curDayIndex; if (index == 0) index = 7; let award = cfgTable.signData[index].award; let temp; let type; let num; for (let index = 0; index < award.length; index++) { temp = award[index].split("-"); type = parseInt(temp[0]); num = parseInt(temp[1]) * 3; xGame.common.playObjFlyAnim(num, type); } DataMgr.setExtraSign(1); this.updateSign(); } } UISign.uiName = "UISign"; class ui_UISkill extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "UISkill")); } onConstruct() { this.n48 = (this.getChild("n48")); this.n0 = (this.getChild("n0")); this.secretary = (this.getChild("secretary")); this.talkNode = (this.getChild("talkNode")); this.closeNode = (this.getChild("closeNode")); this.moneyNode = (this.getChild("moneyNode")); this.skillNode = (this.getChild("skillNode")); this.guideNode = (this.getChild("guideNode")); } } ui_UISkill.URL = "ui://isxx5ak7j69a40z"; class SkillDisplay { constructor(ui, data, uiIndex) { this.starX = 0; this.starY = 0; this.index = 0; this.ui = ui; this.data = data; this.index = uiIndex; this.initSelf(); console.log('zh:SkillDisplay constructor this.skillData=', data); } initSelf() { this.ui.normalBtn.onClick(this, this.clickAddLevel); this.ui.nameTxt.text = this.data.name; this.ui.describeTxt.text = this.data.describe; this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon); this.ui.startBtn.onClick(this, this.startGame); this.updateSelf(); } updateSelf() { this.checkTry(); let level = DataMgr.getBigSkillByIndex(this.index); this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0; } checkTry() { let index = this.index; let level = DataMgr.getBigSkillByIndex(index); if (level == null) { DataMgr.setBigSkill(index, 1, false); level = 1; } this.ui.levelTxt.text = "LV." + level; if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) this.ui.tryNode.visible = true; else this.ui.tryNode.visible = false; } clickAddLevel() { xGame.soundMgr.playSound(xGame.common.btnClickStr); Moyu.sendDataEvent("UpSkill", { id: this.data.index }); console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel'); if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) { this.qjff_AD_for_skilldisplay_clickAddLevel(); } else { console.log('zh:AD 失败,直接发放奖励'); this.qjff_AD_for_skilldisplay_clickAddLevel(); } } qjff_AD_for_skilldisplay_clickAddLevel() { DataMgr.setBigSkill(this.data.index, 1); this.updateSelf(); xGame.common.upSkillLevel = true; } startGame() { console.log('zh:rod skill startgame'); if (this.data.index == 3) { alert('Coming soon!'); return; } xGame.soundMgr.playSound(xGame.common.btnClickStr); let needCoin = xGame.common.bigMoveNeedCoin; xGame.common.passAwardCoin = 2000; let guide = DataMgr.getSkillGuide(); console.log('zh:startGame guide=' + guide); xGame.common.temSelfLevel = 0; if (guide == 0) { needCoin = 0; xGame.common.temSelfLevel = 100; } if (DataMgr.coinEnough(needCoin)) { DataMgr.setCoin(-needCoin); xGame.common.curPlayerSkillType = this.index; if (guide == 0) xGame.common.curPlayerSkillType = 0; console.log('zh: skilldisplay 1'); xGame.uiMgr.Show(UIGame); xGame.uiMgr.Hide(UIMain); xGame.uiMgr.Show(UIMatching, () => { xGame.common.gameUI.ui.alpha = 1; xGame.common.gameUI.startGame(); xGame.uiMgr.Hide(UISkill); }); this.logEventForRod_start(); } else { console.log('zh: skilldisplay 2'); xGame.uiMgr.Show(UIAddProp, 0); Moyu.sendDataEvent("AddCoinVideo"); } } logEventForRod_start() { let gfmsIdx = xGame.common.curPlayerSkillType; console.log('zh:选择的技能=' + gfmsIdx); let gfmc = 'Skyfall Shot'; if (gfmsIdx == 0) { gfmc = 'Skyfall Shot'; } if (gfmsIdx == 1) { gfmc = 'Surging break'; } if (gfmsIdx == 2) { gfmc = 'Frost Lock'; } let keyStr = 'sjmd_rod_start_' + gfmsIdx; let jsonStr = { "count": 0, "name": gfmc }; if (LocalStorageManager.hasJosnKey(keyStr)) { const d = LocalStorageManager.getItem(keyStr); jsonStr.count = d.count + 1; LocalStorageManager.setItem(keyStr, jsonStr); } else { LocalStorageManager.setItem(keyStr, jsonStr); } const reqStr = JSON.stringify(jsonStr); JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr); } } class UISkill extends UIBase { constructor() { super(); this.skillData = []; } onConstructor() { this.ui = ui_UISkill.createInstance(); this.contentPane = this.ui; this.isEject = false; this.moneyNode = new MoneyNode(this.ui.moneyNode); this.initSkillData(); console.log('zh:aaaaaa1111111111'); this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain); this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false); console.log('zh:aaaaaa22222222'); this.displayList = []; this.ui.skillNode.skillList.numItems = 3; this.addUIClick(this.ui, this.interuptSecretary); this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel); this.ui.talkNode.visible = false; if (Moyu.isKs) this.ui.closeNode.closeBtn.x += 100; } show() { super.show(); this.playSecretaryIdle(); this.moneyNode.ui.c1.selectedIndex = 1; Laya.timer.clearAll(this); xGame.soundMgr.playSound("s_start"); xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt); let guide = DataMgr.getSkillGuide(); this.ui.guideNode.visible = guide == 0; let item = this.getSkillItemByUIIndex(0); if (guide == 0) { item.ui.c1.selectedIndex = 1; } else { item.ui.c1.selectedIndex = 0; } this.ui.guideNode.guideBtn.visible = guide == 0; for (let index = 0; index < this.displayList.length; index++) { this.displayList[index].checkTry(); } } getSkillItemByUIIndex(cur) { for (let index = 0; index < this.displayList.length; index++) { if (this.displayList[index].index == cur) { return this.displayList[index]; } } } enterGuideLevel() { let item = this.getSkillItemByUIIndex(0); item.startGame(); if (DataMgr.getNewUser()) Moyu.sendDataEvent("gameStart1"); } initSkillData() { this.skillData = []; let nameList = xGame.common.skillNameList; let iconList = xGame.common.skillIconList; let describeList = [ "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ", "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!", "The power of frost descends—freezing the flow and taking full control of the game!" ]; console.log('zh:initSkillData 111111111'); let data; for (let index = 0; index < nameList.length; index++) { data = {}; data.name = nameList[index]; data.icon = iconList[index]; data.describe = describeList[index]; data.index = index; this.skillData.push(data); } } updateSkillItem(index, target) { if (this.displayList[index] == null) { let uiIndex; switch (index) { case 0: uiIndex = 1; break; case 1: uiIndex = 0; break; case 2: uiIndex = 2; break; case 3: uiIndex = 3; break; default: break; } let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex); this.displayList.push(temp); } } playSecretaryIdle() { let parent = this.ui.secretary.displayObject; parent.destroyChildren(); let xx = this.ui.secretary.width / 2; let yy = this.ui.secretary.height; let scale = xGame.common.getSecretaryScale(); let data = { x: xx, y: yy, scaleX: scale, scaleY: scale }; xGame.common.secretary.play(data, 0, true, parent); } returnUIMain() { this.hide(); xGame.common.stopGirlPop(this.ui.talkNode); xGame.uiMgr.Show(UIMain); } interuptSecretary() { Laya.timer.clearAll(this); this.playSecretaryRandomSound(); } playSecretaryRandomSound() { if (this.isHide) return; let time = xGame.common.randomNum(45000, 60000); Laya.timer.once(time, this, () => { if (this.isHide) return; let index = xGame.common.randomNum(4, 7); xGame.soundMgr.playSound("s_main0" + index); let words = 1; switch (index) { case 4: words = 5; break; case 5: words = 3; break; case 6: words = 6; break; case 7: words = 7; break; default: break; } xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt); this.playSecretaryRandomSound(); }); } } UISkill.uiName = "UISkill"; class ui_UIMsg extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "UIMsg")); } onConstruct() { this.tipsNode = (this.getChild("tipsNode")); } } ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt"; class UIMsg extends UIBase { constructor() { super(); } onConstructor() { this.ui = ui_UIMsg.createInstance(); this.contentPane = this.ui; this.isEject = false; this.isMuti = true; } show(msg, callback) { super.show(); this.ui.tipsNode.msgTxt.text = msg; this.ui.alpha = 1; Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => { this.hide(); callback && callback(); }), 1000); } } UIMsg.uiName = "UIMsg"; class ui_UIModeSelection extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "UIModeSelection")); } onConstruct() { this.n19 = (this.getChild("n19")); this.closeBtn = (this.getChild("closeBtn")); this.myNode = (this.getChild("myNode")); this.t0 = this.getTransition("t0"); } } ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458"; class UIModeSelection extends UIBase { constructor() { super(); } onConstructor() { this.ui = ui_UIModeSelection.createInstance(); this.contentPane = this.ui; this.isEject = false; this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]); this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]); this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]); this.addUIClick(this.ui.closeBtn, this.hide); this.peopleArr = [65, 990, 580]; this.peopleOffest = [5, 10, 10]; } show(callback) { this.updateSelf(); super.show(); this.ui.t0.play(); this.callback = callback; } updateSelf() { let cfg = cfgTable.modeselectData; for (let index = 1; index <= 3; index++) { let node = this.ui.myNode["type" + index]; node.need.text = cfg[index].need; node.tipsTxt.text = `Min ${cfg[index].need} Eligible`; node.peopleTxt.text = this.getRandPeople(index - 1); } } enterGame(type) { console.log('zh: 进入经典模式 type: ' + type); xGame.common.classicRoomType = type; let cfg = cfgTable.modeselectData[type]; let need = cfg.need; xGame.common.passAwardCoin = cfg.award; if (DataMgr.coinEnough(need)) { DataMgr.setCoin(-need); this.ui.myNode["type" + type].t0.play(); Laya.timer.once(200, this, () => { this.callback && this.callback(); }); this.logEventForClassic_start(); } else { Moyu.sendDataEvent("AddCoinVideo"); xGame.uiMgr.Show(UIAddProp, 0); } } getRandPeople(index) { let rand = this.peopleOffest[index]; return this.peopleArr[index] + xGame.common.randomNum(-rand, rand); } logEventForClassic_start() { let rtype = xGame.common.classicRoomType; let msmc = ''; if (rtype == 1) { msmc = 'beginner'; } if (rtype == 2) { msmc = 'expert'; } if (rtype == 3) { msmc = 'master'; } let keyStr = 'sjmd_classic_start_' + rtype; let jsonStr = { "difficulty": msmc, "classic_count": 1, "difficulty_count": 1 }; if (LocalStorageManager.hasJosnKey(keyStr)) { const d = LocalStorageManager.getItem(keyStr); jsonStr.classic_count = d.classic_count + 1; jsonStr.difficulty_count = d.difficulty_count + 1; LocalStorageManager.setItem(keyStr, jsonStr); } else { LocalStorageManager.setItem(keyStr, jsonStr); } const reqStr = JSON.stringify(jsonStr); JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr); } } UIModeSelection.uiName = "UIModeSelection"; class ui_UIReg extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "UIReg")); } onConstruct() { this.n38 = (this.getChild("n38")); this.n9 = (this.getChild("n9")); this.n14 = (this.getChild("n14")); this.n15 = (this.getChild("n15")); this.n34 = (this.getChild("n34")); this.closeBtn = (this.getChild("closeBtn")); this.n39 = (this.getChild("n39")); this.lab_tip = (this.getChild("lab_tip")); this.n43 = (this.getChild("n43")); this.txt_ua = (this.getChild("txt_ua")); this.n44 = (this.getChild("n44")); this.txt_up1 = (this.getChild("txt_up1")); this.n45 = (this.getChild("n45")); this.txt_up2 = (this.getChild("txt_up2")); this.btn_gotoLogin = (this.getChild("btn_gotoLogin")); this.btn_reg = (this.getChild("btn_reg")); } } ui_UIReg.URL = "ui://isxx5ak7bobav57v"; class ui_UILogin extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "UILogin")); } onConstruct() { this.c1 = this.getController("c1"); this.n18 = (this.getChild("n18")); this.n7 = (this.getChild("n7")); this.n5 = (this.getChild("n5")); this.n6 = (this.getChild("n6")); this.closeBtn = (this.getChild("closeBtn")); this.btn_gotoReg = (this.getChild("btn_gotoReg")); this.btn_login = (this.getChild("btn_login")); this.n30 = (this.getChild("n30")); this.n31 = (this.getChild("n31")); this.txt_up = (this.getChild("txt_up")); this.n32 = (this.getChild("n32")); this.txt_ua = (this.getChild("txt_ua")); } } ui_UILogin.URL = "ui://isxx5ak7bobav57u"; class UILogin extends UIBase { constructor() { super(); } onConstructor() { this.ui = ui_UILogin.createInstance(); this.contentPane = this.ui; this.isEject = false; this.addUIClick(this.ui.closeBtn, this.closeSelf); this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage); this.addUIClick(this.ui.btn_login, this.userLogin); } show() { super.show(); this.x = (Laya.stage.width - this.width) / 2; this.y = (Laya.stage.height - this.height) / 2; } closeSelf() { this.hide(); } userLogin() { let ua = this.ui.txt_ua.text; let up = this.ui.txt_up.text; if (ua && up) { xGame.uiMgr.Show(UIMsg, "Request in progress.."); let reqData = JSON.stringify({ username: ua.trim(), password: up.trim(), fromMark: 'app_game' }); xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => { try { console.log('zh:res = ' + JSON.stringify(res)); let code = res.code; let msg = res.msg; xGame.uiMgr.Show(UIMsg, msg); if (code == 200) { let keyStr = 'userInfo'; let jsonStr = { "username": res.username, "token": res.token }; LocalStorageManager.setItem(keyStr, jsonStr); } else { } } catch (error) { console.log('error=' + error); alert(error); } finally { } }); } else { xGame.uiMgr.Show(UIMsg, "Missing information!"); } } gotoRegPage() { this.closeSelf(); xGame.uiMgr.Show(UIReg); } } UILogin.uiName = "UILogin"; class UIReg extends UIBase { constructor() { super(); } onConstructor() { this.ui = ui_UIReg.createInstance(); this.contentPane = this.ui; this.isEject = false; this.addUIClick(this.ui.closeBtn, this.closeSelf); this.addUIClick(this.ui.btn_reg, this.regUser); this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin); } show() { super.show(); this.x = (Laya.stage.width - this.width) / 2; this.y = (Laya.stage.height - this.height) / 2; } closeSelf() { this.hide(); } regUser() { this.ui.lab_tip.visible = false; let ua = this.ui.txt_ua.text; let up1 = this.ui.txt_up1.text; let up2 = this.ui.txt_up2.text; if (ua && up1 && up2 && up1 == up2) { xGame.uiMgr.Show(UIMsg, "Request in progress.."); let reqData = JSON.stringify({ username: ua.trim(), password: up1.trim(), fromMark: 'app_game' }); xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => { try { this.ui.lab_tip.visible = true; console.log('zh:res = ' + JSON.stringify(res)); let code = res.code; let msg = res.msg; this.ui.lab_tip.text = msg; xGame.uiMgr.Show(UIMsg, msg); if (code == 200) { this.ui.lab_tip.color = "#FFFFFF"; } else { this.ui.lab_tip.color = "#FF0000"; } } catch (error) { console.log('error=' + error); alert(error); } finally { } }); } else { if (up1 != up2) { xGame.uiMgr.Show(UIMsg, "Password mismatch!"); } else { xGame.uiMgr.Show(UIMsg, "Missing information!"); } } } gotoLogin() { this.closeSelf(); xGame.uiMgr.Show(UILogin); } } UIReg.uiName = "UIReg"; class ui_UIGetAward extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "UIGetAward")); } onConstruct() { this.n4 = (this.getChild("n4")); this.n0 = (this.getChild("n0")); this.myList = (this.getChild("myList")); this.n1 = (this.getChild("n1")); this.eftNode = (this.getChild("eftNode")); this.btnNode = (this.getChild("btnNode")); this.t0 = this.getTransition("t0"); } } ui_UIGetAward.URL = "ui://isxx5ak7p4tr426"; class UIGetAward extends UIBase { constructor() { super(); this.showTriple = true; } onConstructor() { this.ui = ui_UIGetAward.createInstance(); this.contentPane = this.ui; this.isEject = false; this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward); this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward); this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false); } show(arr, showTriple, callback) { super.show(); this.ui.t0.play(); this.ui.eftNode.visible = true; this.ui.eftNode.t0.play(Laya.Handler.create(this, () => { this.ui.eftNode.visible = false; }), 1, 0, 0, 0.9); this.awardArr = arr; this.showTriple = showTriple; this.callback = callback; this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1; this.ui.myList.numItems = arr.length; xGame.soundMgr.playSound("getaward"); } updateSelf(index, obj) { let temp = this.awardArr[index]; let icon = this.getIcon(temp.type); let str = icon; if (temp.type > 2) { str = "s" + icon; } obj.myIcon.url = xGame.common.getGameIconUrl(str); obj.myIcon.rotation = 0; obj.numTxt.text = temp.num + ""; obj.numTxt.visible = temp.type > 2 ? false : true; obj.nameTxt.text = this.getNameStr(temp.type); } renderItem(index, obj) { this.updateSelf(index, obj); } tripleGetAward() { console.log('zh:qjff_AD_for_uigetAward'); if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) { } else { console.log('zh:AD 失败,直接发放奖励'); this.qjff_AD_for_uigetAward(); } } qjff_AD_for_uigetAward() { this.getAward(3); } normalGetAward() { if (PlatMgr.isMisVideo()) this.tripleGetAward(); else this.getAward(); } getAward(times = 1) { this.hide(); for (let index = 0; index < this.awardArr.length; index++) { this.awardArr[index].num *= times; } this.callback && this.callback(times != 1); } getIcon(type) { switch (type) { case Prop.diamond: return "ty_zs"; case Prop.coin: return "ty_jb"; case Prop.gan1: return "qg1"; case Prop.gan2: return "qg2"; case Prop.gan3: return "qg3"; case Prop.gan4: return "qg4"; default: break; } } getNameStr(type) { switch (type) { case Prop.diamond: return "Diamond"; case Prop.coin: return "Coins"; case Prop.gan1: case Prop.gan2: case Prop.gan3: case Prop.gan4: return cfgTable.ballrodData[type - 1].name; default: break; } } } UIGetAward.uiName = "UIGetAward"; class ui_UIRepentProp extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "UIRepentProp")); } onConstruct() { this.c1 = this.getController("c1"); this.n11 = (this.getChild("n11")); this.regretNode = (this.getChild("regretNode")); this.helpLineNode = (this.getChild("helpLineNode")); this.t0 = this.getTransition("t0"); } } ui_UIRepentProp.URL = "ui://isxx5ak7trk948v"; class UIRepentProp extends UIBase { constructor() { super(); this.viewType = 0; this.regretType = 0; } onConstructor() { this.ui = ui_UIRepentProp.createInstance(); this.contentPane = this.ui; this.isEject = false; this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf); this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret); this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf); this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine); } show(viewType, regretType, callback) { PlatMgr.showInsert(true); this.viewType = viewType; this.regretType = regretType; this.callback = callback; super.show(); this.ui.t0.play(); this.ui.c1.selectedIndex = this.viewType; this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!"; if (this.viewType == 0) { let guide = DataMgr.getGuideHelpLine(); this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0; this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0; } xGame.common.gameMgr.gamePause = true; } hideSelf() { xGame.common.gameMgr.gamePause = false; this.callback && this.callback(false); this.hide(); } videoRegret() { console.log('zh:qjff_AD_for_UIrepentProp_videoRegret'); if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) { } else { console.log('zh:AD 失败,直接发放奖励'); this.qjff_AD_for_UIrepentProp_videoRegret(); } } qjff_AD_for_UIrepentProp_videoRegret() { this.callback && this.callback(true); this.hideSelf(); } videoAddHelpLine() { let guide = DataMgr.getGuideHelpLine(); if (guide == 0) { this.callback && this.callback(true); this.hideSelf(); DataMgr.setGuideHelpLine(); xGame.common.gameUI.ui.guideNode.visible = false; } else { console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine'); if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) { } else { console.log('zh:AD 失败,直接发放奖励'); this.qjff_AD_for_UIrepentProp_videoAddHelpLine(); } } } qjff_AD_for_UIrepentProp_videoAddHelpLine() { this.callback && this.callback(true); this.hideSelf(); } } UIRepentProp.uiName = "UIRepentProp"; class UIMain extends UIBase { constructor() { super(); this.firstEnter = true; } nativeCallJs(msg) { let t = msg; console.log("zh: nativeCallJs 奖励开始发放:", t); switch (t) { case 'qjff_chouJiang': let dui = xGame.uiMgr.getUI(UIDraw); dui.qjff_chouJiang(); break; case 'qjff_AD_for_uisign': let dui2 = xGame.uiMgr.getUI(UISign); dui2.qjff_AD_for_uisign(); break; case 'qjff_AD_for_uitry': let dui3 = xGame.uiMgr.getUI(UITry); dui3.qjff_AD_for_uitry(); break; case 'qjff_AD_for_uipower': let dui4 = xGame.uiMgr.getUI(UIPower); dui4.qjff_AD_for_uipower(); break; case 'qjff_AD_for_uigetAward': let dui5 = xGame.uiMgr.getUI(UIGetAward); dui5.qjff_AD_for_uigetAward(); break; case 'qjff_AD_for_uiGameEnd': let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level'); let dui6 = xGame.uiMgr.getUI(UIGameEnd); dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level)); break; case 'qjff_AD_for_uiAddProp_videoGetDiamond': let dui7 = xGame.uiMgr.getUI(UIAddProp); dui7.qjff_AD_for_uiAddProp_videoGetDiamond(); break; case 'qjff_AD_for_uiAddProp_videoGetCoin': let dui8 = xGame.uiMgr.getUI(UIAddProp); dui8.qjff_AD_for_uiAddProp_videoGetCoin(); break; case 'qjff_AD_for_UIrepentProp_videoRegret': let dui9 = xGame.uiMgr.getUI(UIRepentProp); dui9.qjff_AD_for_UIrepentProp_videoRegret(); break; case 'qjff_AD_for_UIrepentProp_videoAddHelpLine': let dui10 = xGame.uiMgr.getUI(UIRepentProp); dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine(); break; case 'qjff_AD_for_UIBOX_onOpenBox': let dui11 = xGame.uiMgr.getUI(UIBox); dui11.qjff_AD_for_UIBOX_onOpenBox(); break; case 'qjff_AD_for_UIAddCoin': let dui12 = xGame.uiMgr.getUI(UIAddCoin); dui12.qjff_AD_for_UIAddCoin(); break; case '111a': let dui14 = xGame.uiMgr.getUI(UISign); dui14.qjff_AD_for_uisign(); break; case '222a': let dui15 = xGame.uiMgr.getUI(UISign); dui15.qjff_AD_for_uisign(); break; case '333a': let dui16 = xGame.uiMgr.getUI(UISign); dui16.qjff_AD_for_uisign(); break; default: console.log('zh:未知的方法名字' + t); break; } } onConstructor() { console.log('zh: UIMain onConstructor'); this.ui = ui_UIMain.createInstance(); this.contentPane = this.ui; this.isEject = false; this.addEvent(); this.addClickSpine(); this.settingNode = new SettingNode(this.ui.settingNode); this.moneyNode = new MoneyNode(this.ui.moneyNode); xGame.eventMgr.on(RESTART_GAME, this, this.beginGame); xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo); xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary); let curUse = DataMgr.getCurSecretary(); this.changeSecretary(curUse); this.ui.talkNode.visible = false; let guide = DataMgr.getSkillGuide(); if (xGame.common.isNewDay && guide == 1) { xGame.common.isNewDay = false; xGame.soundMgr.playSound("s_main01"); xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt); console.log("zh:播放小秘书每天语音"); } this.onGetUserInfo(); this.ui.n83.visible = false; if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) { const d = LocalStorageManager.getItem(keyForLoginInfo); let ua = d.username; this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16); } this.c_btn_for_user(); window['nativeCallJs'] = this.nativeCallJs.bind(this); } Logout() { if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) { LocalStorageManager.removeItem(keyForLoginInfo); this.freshUser(); } } gotoLogin() { xGame.uiMgr.Show(UILogin); } gotoRegUser() { xGame.uiMgr.Show(UIReg); } c_btn_for_user() { this.ui.n_Logout.visible = false; this.ui.n_dengLu.visible = false; this.ui.n_zhuCe.visible = false; if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) { this.ui.n_Logout.visible = true; } else { this.ui.n_dengLu.visible = true; } } changeSecretary(curUse) { let name = cfgTable.secretaryshopData[curUse + 1].spine; xGame.common.secretary && xGame.common.secretary.dispose(); this.addSecretarySpine(name); } addSecretarySpine(name) { let spine = new SpineMgr(name, () => { this.playSecretaryIdle(); }); xGame.common.secretary = spine; } addClickSpine() { let clickSpine = new SpineMgr("dianji", () => { Laya.stage.on(Laya.Event.CLICK, this, (e) => { let parent = Laya.stage; let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 }; clickSpine.play(data, 0, false, parent, (spine) => { spine.destroy(true); }); }); }); } addEvent() { this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]); this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]); this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]); this.addUIClick(this.ui.globalBtn, this.startGlobal); this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall); this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]); this.addUIClick(this.ui, this.interuptSecretary); this.addUIClick(this.ui.rightBtn, this.ensureSecretary); this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]); this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView); this.addUIClick(this.ui.shopBtn, this.openShopView); this.addUIClick(this.ui.signBtn, this.openSignView); this.addUIClick(this.ui.drawBtn, this.openDrawView); this.addUIClick(this.ui.rankBtn, this.openRanking); this.addUIClick(this.ui.n_Logout, this.Logout); this.addUIClick(this.ui.n_dengLu, this.gotoLogin); this.addUIClick(this.ui.n_zhuCe, this.gotoRegUser); } show(showFailWords) { super.show(); this.moneyNode.ui.c1.selectedIndex = 1; this.playSecretaryIdle(); xGame.soundMgr.playMusic("caromhall01", 0); Laya.timer.clearAll(this); this.playSecretaryRandomSound(); console.log('zh:uimain.ts show show FailWords=', showFailWords); if (showFailWords) { console.log('zh:uimain.ts '); setTimeout(() => { let str = Math.random() <= 0.5 ? "s_main02" : "s_main03"; let words = -1; if (str == "s_main02") { words = 2; } else { words = 3; } xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt); xGame.soundMgr.playSound(str); }, 300); } this.showGuide(); this.ui.guideBtn.x = this.ui.liucheng2.myMask.x; this.ui.guideBtn.y = this.ui.liucheng2.myMask.y; let guide = DataMgr.getSkillGuide(); if (guide == 1) { let randTime = xGame.common.randomNum(300, 800); if (this.firstEnter) { console.log("zh: firstEnter"); this.firstEnter = false; randTime += 900; } else { console.log("zh: no firstEnter"); } Laya.timer.once(randTime, this, () => { xGame.common.autoPopUIView(); }); } } checkActive(show) { } showGuide() { let guide = DataMgr.getSkillGuide(); this.ui.guideBtn.visible = guide == 0; this.ui.enterGuide.visible = false; this.ui.secretaryGuide.visible = guide == 0; if (guide == 0) { console.log("zh:显示引导"); xGame.soundMgr.playSound("s_guide"); xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt); } else { console.log("zh:不需要显示引导"); } } ensureSecretary() { console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary'); this.ui.secretaryGuide.visible = false; this.ui.enterGuide.visible = true; this.ui.wordsNode.t0.play(); if (DataMgr.getNewUser()) Moyu.sendDataEvent("gameReady"); } playSecretaryIdle() { let parent = this.ui.secretary.displayObject; parent.destroyChildren(); let xx = this.ui.secretary.width / 2; let yy = this.ui.secretary.height; let scale = xGame.common.getSecretaryScale(); let data = { x: xx, y: yy, scaleX: scale, scaleY: scale }; console.log("zh:playSecretaryIdle", data); xGame.common.secretary.play(data, 0, true, parent); } startGame(type) { xGame.common.gameMode = type; Moyu.sendDataEvent("PlayGame", { type: type }); console.log('zh:进入游戏gameMode =' + xGame.common.gameMode); switch (xGame.common.gameMode) { case GameMode.classic: console.log('zh:进入经典模式111111111'); if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) { let db_over_lev = DataMgr.getChallengeMode_overLev(); console.log('zh:classic db_over_lev=', db_over_lev); if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) { console.log('zh:判断是否可以玩该模式classic =NO'); let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.'; xGame.uiMgr.Show(UIMsg, tipStr); return; } else { console.log('zh:可以玩该模式classic 66666666666666'); this.beginGame(); } } else { console.log('zh:不需要判断是否可以玩该classic'); let challengeTimes = DataMgr.getChallengeTimes(); if (challengeTimes == 0) { xGame.uiMgr.Show(UIInvitation); } else { this.beginGame(); } break; } case GameMode.bigMove: console.error('zh:bigMove check'); let guide = DataMgr.getSkillGuide(); if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) { let db_over_lev = DataMgr.getChallengeMode_overLev(); console.log('zh:bigMove db_over_lev=', db_over_lev); if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) { let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode'; xGame.uiMgr.Show(UIMsg, tipStr); return; } else { console.log('zh:可以玩该模式 bigMove'); this.beginGame(); if (DataMgr.getNewUser()) Moyu.sendDataEvent("gameStart0"); } } else { this.beginGame(); if (DataMgr.getNewUser()) Moyu.sendDataEvent("gameStart0"); } break; default: console.error('zh:未知错误!!!!'); break; } } beginGame(isNice = false) { console.log('zh:beginGame '); let guide = DataMgr.getSkillGuide(); if (guide == 1) { console.log('zh:非新手引导,showInternAd '); JSBridgeUtils.instance.showInternAd('beginGame'); } else { console.log('zh:新手引导,不显示AD '); } console.log('zh:beginGame 2 go'); if (xGame.common.gameMode == GameMode.classic) { if (isNice) { this.enterClassic(); } else { xGame.uiMgr.Show(UIModeSelection, () => { console.log('zh:BBBBBBBBBBBBBBB'); this.enterClassic(); }); } } else if (xGame.common.gameMode == GameMode.bigMove) { this.ui.enterGuide.visible = false; xGame.uiMgr.Show(UISkill); } } enterClassic() { xGame.uiMgr.Show(UIGame); xGame.uiMgr.Show(UIMatching, () => { if (!this.isHide) this.hide(); xGame.common.gameUI.ui.alpha = 1; xGame.common.gameUI.startGame(); xGame.uiMgr.Hide(UIGameEnd); }); } startGlobal() { xGame.uiMgr.Show(UIMsg, "Coming Soon"); } startWeekly() { xGame.uiMgr.Show(UIMsg, "Coming Soon"); } zhouSaiMonth() { console.log('zh: zhouSaiMonth 被调用'); } startPlaceBall() { xGame.uiMgr.Show(UILevelDisplay); } hide() { console.log('zh:uimain hide ...'); super.hide(); xGame.common.stopGirlPop(this.ui.talkNode); } onGetUserInfo(force = false) { if (Moyu.isWx) { let info = Moyu.getSystemInfo(); if (info) Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser); } else { Moyu.initUser(this, this.freshUser, force); } this.freshUser(); } freshUser() { let user = Moyu.getUserInfo(); if (!user.isAuth) { user.headIcon = 'res/ty_touxiang.png'; } else { DataMgr.upRankData(); } this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16); xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon); let keyStr = keyForLoginInfo; if (LocalStorageManager.hasJosnKey(keyStr)) { const d = LocalStorageManager.getItem(keyStr); let ua = d.username; this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16); } else { } this.c_btn_for_user(); } interuptSecretary() { Laya.timer.clearAll(this); this.playSecretaryRandomSound(); } playSecretaryRandomSound() { if (this.isHide) return; let time = xGame.common.randomNum(45000, 60000); Laya.timer.once(time, this, () => { if (this.isHide) return; let index = xGame.common.randomNum(4, 7); xGame.soundMgr.playSound("s_main0" + index); let words = 1; switch (index) { case 4: words = 5; break; case 5: words = 3; break; case 6: words = 6; break; case 7: words = 7; break; default: break; } xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt); this.playSecretaryRandomSound(); }); } openSecretaryView() { xGame.uiMgr.Show(UISecretary); Moyu.sendDataEvent("secretary"); } openShopView() { xGame.uiMgr.Show(UIShop, 0); } openSignView() { xGame.uiMgr.Show(UISign); } openDrawView() { xGame.uiMgr.Show(UIDraw); } openRanking() { console.log('zh:phb openRanking'); xGame.uiMgr.Show(UIRanking); Moyu.sendDataEvent("rankingList"); } } UIMain.uiName = "UIMain"; class UIGameEnd extends UIBase { constructor() { super(); this.success = false; this.awardCoinNum = 1000; this.awardDiamondNum = 10; } onConstructor() { this.ui = ui_UIGameEnd.createInstance(); this.contentPane = this.ui; this.addUIClick(this.ui.leftBtn, this.clickLeftBtn); this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome); this.addUIClick(this.ui.rightBtn, this.clickRightBtn); this.moneyNode = new MoneyNode(this.ui.moneyNode); this.ui.talkNode.visible = false; if (Moyu.isKs) this.ui.closeNode.closeBtn.x += 100; } updateType() { switch (xGame.common.gameMode) { case GameMode.classic: this.ui.c1.selectedIndex = this.success ? 0 : 1; this.ui.coinNode.visible = this.success; if (!this.success) { Laya.timer.once(500, this, () => { xGame.uiMgr.Show(UIAddCoin); }); } else { this.logEventForClassic_win(); } this.logEventForClassic_complete(); this.ui.isGetAward.visible = false; this.ui.leftBtn.c1.selectedIndex = 3; this.ui.rightBtn.c1.selectedIndex = 0; this.moneyNode.ui.c1.selectedIndex = 1; break; case GameMode.bigMove: console.log('zh:招法模式 aaaaaa bigMove'); this.ui.c1.selectedIndex = this.success ? 0 : 1; this.ui.coinNode.visible = this.success; if (xGame.common.gameMode == GameMode.bigMove) { if (this.success) { DataMgr.setSkillSuccessTimes(1, true); DataMgr.setSkillAccTimes(1); } else { DataMgr.setSkillSuccessTimes(0, false); } } this.logEventForRod_complete_N(); if (!this.success) { Laya.timer.once(500, this, () => { xGame.uiMgr.Show(UIAddCoin); }); } else { this.logEventForRod_win(); } this.ui.isGetAward.visible = false; this.ui.leftBtn.c1.selectedIndex = 3; this.ui.rightBtn.c1.selectedIndex = 0; this.moneyNode.ui.c1.selectedIndex = 1; break; case GameMode.placeBall: this.ui.coinNode.visible = false; if (this.success) { if (xGame.common.placeBallStarNum == 3) { this.ui.c1.selectedIndex = 2; } else { this.ui.c1.selectedIndex = 3; } let level = xGame.common.placeBallCurLevel; if (level > 59) { this.logEventForChallenge_level_complete(level); } else { this.logEventForChallenge_level_N(level); } } else { this.ui.c1.selectedIndex = 4; } let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel]; if (cfg.type == PlaceBallType.challenge) { this.ui.c1.selectedIndex = 2; } this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `; this.updatePlaceBallBtn(); this.updatePlaceBallStarNum(); this.updatePlaceBallAwardState(); this.moneyNode.ui.c1.selectedIndex = 2; this.moneyNode.checkPowerTime(); this.moneyNode.powerChange(); DataMgr.upRankData(); break; default: break; } } logEventForRod_complete_N() { let gfmsIdx = xGame.common.curPlayerSkillType; console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx); let gfmc = 'Skyfall Shot'; if (gfmsIdx == 0) { gfmc = 'Skyfall Shot'; } if (gfmsIdx == 1) { gfmc = 'Surging break'; } if (gfmsIdx == 2) { gfmc = 'Frost Lock'; } let level = DataMgr.getBigSkillByIndex(gfmsIdx); console.log('zh:logEventForRod_complete_N level = ' + level); let keyStr = 'sjmd_rod_start_' + gfmsIdx; let jsonStr = { "count": 0, "name": gfmc }; if (LocalStorageManager.hasJosnKey(keyStr)) { const d = LocalStorageManager.getItem(keyStr); jsonStr.count = d.count + 1; LocalStorageManager.setItem(keyStr, jsonStr); } else { LocalStorageManager.setItem(keyStr, jsonStr); } const d2 = LocalStorageManager.getItem(keyStr); let count = d2.count; console.log('zh:logEventForRod_complete_N count = ' + count); if (count % 5 == 0) { const reqStr = JSON.stringify(jsonStr); JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr); JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr); } } logEventForRod_win() { console.log('zh:logEventForRod_win,胜利'); let gfmsIdx = xGame.common.curPlayerSkillType; console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx); let gfmc = 'Skyfall Shot'; if (gfmsIdx == 0) { gfmc = 'Skyfall Shot'; } if (gfmsIdx == 1) { gfmc = 'Surging break'; } if (gfmsIdx == 2) { gfmc = 'Frost Lock'; } let level = DataMgr.getBigSkillByIndex(gfmsIdx); console.log('zh:logEventForRod_win level = ' + level); let keyStr = 'sjmd_rod_win_' + gfmsIdx; let jsonStr = { "count": 1, "name": gfmc + ' Lev' + level }; if (LocalStorageManager.hasJosnKey(keyStr)) { const d = LocalStorageManager.getItem(keyStr); jsonStr.count = d.count + 1; LocalStorageManager.setItem(keyStr, jsonStr); } else { LocalStorageManager.setItem(keyStr, jsonStr); } const reqStr = JSON.stringify(jsonStr); JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr); } logEventForClassic_win() { console.log('zh:logEventForClassic_win,胜利'); let rtype = xGame.common.classicRoomType; let msmc = ''; if (rtype == 1) { msmc = 'beginner'; } if (rtype == 2) { msmc = 'expert'; } if (rtype == 3) { msmc = 'master'; } let keyStr = 'sjmd_classic_win_' + rtype; let jsonStr = { "difficulty": msmc, "classic_count": 1, "difficulty_count": 1 }; if (LocalStorageManager.hasJosnKey(keyStr)) { const d = LocalStorageManager.getItem(keyStr); jsonStr.classic_count = d.classic_count + 1; jsonStr.difficulty_count = d.difficulty_count + 1; LocalStorageManager.setItem(keyStr, jsonStr); } else { LocalStorageManager.setItem(keyStr, jsonStr); } const reqStr = JSON.stringify(jsonStr); JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr); } logEventForClassic_complete() { console.log('zh:logEventForClassic_complete,胜利'); let rtype = xGame.common.classicRoomType; let msmc = ''; if (rtype == 1) { msmc = 'beginner'; } if (rtype == 2) { msmc = 'expert'; } if (rtype == 3) { msmc = 'master'; } let keyStr = 'sjmd_classic_complete_' + rtype; let jsonStr = { "msmc": msmc, "count": 0 }; if (LocalStorageManager.hasJosnKey(keyStr)) { const d = LocalStorageManager.getItem(keyStr); jsonStr.count = d.count + 1; LocalStorageManager.setItem(keyStr, jsonStr); } else { LocalStorageManager.setItem(keyStr, jsonStr); } if (jsonStr.count % 5 == 0) { const reqStr = JSON.stringify(jsonStr); JSBridgeUtils.instance.logEventForAdNoParams('classic_complete'); JSBridgeUtils.instance.logEventForFirebase('classic_complete', null); } } updatePlaceBallBtn() { this.ui.leftBtn.c1.selectedIndex = 5; if (this.success) { this.ui.rightBtn.c1.selectedIndex = 14; } else { if (xGame.common.placeBallStarNum == 3) { this.ui.rightBtn.c1.selectedIndex = 14; } else { this.ui.rightBtn.c1.selectedIndex = 1; } } } updatePlaceBallStarNum() { let starNum = xGame.common.placeBallStarNum; if (starNum == 0) this.ui.starNumNode.c1.selectedIndex = 3; else { this.ui.starNumNode.c1.selectedIndex = starNum - 1; } } updatePlaceBallAwardState() { let level = xGame.common.placeBallCurLevel; let starNum = xGame.common.placeBallStarNum; let getAward = DataMgr.getPlaceBallLevel(level).getAward; let data = cfgTable.placeballData[level].award; let cfg = cfgTable.placeballData[level]; this.awardDiamondNum = data[1]; this.awardCoinNum = data[0]; if (cfg.type == PlaceBallType.challenge) { this.awardDiamondNum = 0; this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100; } this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0; this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0; if (cfg.type == PlaceBallType.challenge) { this.ui.awardNode.coinNode.visible = true; } if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) { this.ui.awardNode.diamondNode.x = 265; this.ui.awardNode.coinNode.x = 354; } else { this.ui.awardNode.diamondNode.x = 291; this.ui.awardNode.coinNode.x = 291; } this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + ""; this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + ""; if (this.awardCoinNum == 0) { this.ui.awardNode.coinNode.numTxt.text = ""; } if (getAward) { this.ui.isGetAward.visible = true; this.ui.awardNode.diamondNode.c1.selectedIndex = 2; this.ui.awardNode.coinNode.c1.selectedIndex = 2; } else { this.ui.isGetAward.visible = false; if (starNum == 3 && cfg.type == PlaceBallType.challenge) { this.ui.awardNode.diamondNode.c1.selectedIndex = 0; this.ui.awardNode.coinNode.c1.selectedIndex = 0; } else { this.ui.awardNode.diamondNode.c1.selectedIndex = 1; this.ui.awardNode.coinNode.c1.selectedIndex = 1; } } } show(success) { super.show(); xGame.eventMgr.event(RESET_GAME); this.success = success; Laya.timer.clearAll(this); this.playSecretaryAni(); Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 }); let offsetTime = new Date().getTime() - xGame.common.gameStartTime; offsetTime = Math.floor(offsetTime / 1000); Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode }); this.updateType(); Laya.timer.once(200, this, () => { this.addAward(() => { this.updateType(); Laya.timer.once(500, this, () => { this.showChallengeLevel(); }); }); }); if (this.success) { JSBridgeUtils.instance.showInternAd('gameend_success'); console.log('zh:game end 成功'); xGame.soundMgr.playSound('slots_roll01'); xGame.soundMgr.playSound("s_win"); xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt); this.diyGameDataUtilForGameWin(); } else { JSBridgeUtils.instance.showInternAd('gameend_faill'); console.log('zh:game end失败'); xGame.soundMgr.playSound('matchwin01'); xGame.soundMgr.playSound("s_lose"); xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt); } let challengeNum = DataMgr.getChallengeTimes(); if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) { DataMgr.setChallengeTimes(1); } if (this.success && xGame.common.gameMode == GameMode.classic) { DataMgr.setClassicTimes(); } } diyGameDataUtilForGameWin() { console.log('zh: DiyGameDataUtilForGameWin diy '); switch (xGame.common.gameMode) { case GameMode.classic: console.log('zh:DiyGameDataUtilForGameWin 111'); case GameMode.bigMove: console.log('zh:DiyGameDataUtilForGameWin 222'); this.restartGame(); break; case GameMode.placeBall: console.log('zh:DiyGameDataUtilForGameWin 333'); var level = xGame.common.placeBallCurLevel; console.log('zh:练习模式 联系了多少LEV=' + level); let db_over_lev = DataMgr.getChallengeMode_overLev(); if (level > db_over_lev) { DataMgr.setChallengeMode_overLev(level); } break; default: console.log('zh:DiyGameDataUtilForGameWin 444'); break; } } showChallengeLevel() { if (DataMgr.getChallengeTimes() != 0) return; let skill = DataMgr.getSkillAccTimes(); let put = DataMgr.getPlaceBallLevelList().length; if (skill >= 3 || put >= 5) { xGame.uiMgr.Show(UIInvitation); this.hide(); } } addAward(callback) { if (!this.success) { callback && callback(); return; } switch (xGame.common.gameMode) { case GameMode.classic: this.awardCoinNum = xGame.common.passAwardCoin; this.awardDiamondNum = 0; xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin); break; case GameMode.bigMove: this.awardCoinNum = xGame.common.passAwardCoin; this.awardDiamondNum = 0; xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin); callback && callback(); break; case GameMode.placeBall: let level = xGame.common.placeBallCurLevel; Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 }); if (xGame.common.placeBallStarNum != 3) { callback && callback(); return; } else { let getAward = DataMgr.getPlaceBallLevel(level).getAward; if (getAward) { callback && callback(); return; } } let cfg = cfgTable.placeballData[level]; let data = cfgTable.placeballData[level].award; this.awardCoinNum = data[0]; this.awardDiamondNum = data[1]; if (cfg.type == PlaceBallType.challenge) { this.awardDiamondNum = 0; this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100; } let coinAward = new AwardType(Prop.coin, this.awardCoinNum); let diamondAward; if (this.awardDiamondNum > 0) { diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum); xGame.common.getAward([diamondAward, coinAward], callback); } else { xGame.common.getAward([coinAward], callback); } if (cfg.type == PlaceBallType.normal) { DataMgr.setPlaceBallAward(level); } break; default: break; } } playSecretaryAni_old() { let parent = this.ui.secretary.displayObject; parent.destroyChildren(); let xx = this.ui.secretary.width / 2; let yy = this.ui.secretary.height; let scale = xGame.common.getSecretaryScale(); let data = { x: xx, y: yy, scaleX: scale, scaleY: scale }; if (this.success) { let rand = Math.random() <= 0.5 ? 2 : 3; xGame.common.secretary.play(data, rand, false, parent, () => { xGame.common.secretary.play(data, 1, true, parent); }); } else { xGame.common.secretary.play(data, 0, true, parent); } } playSecretaryAni() { let parent = this.ui.secretary.displayObject; parent.destroyChildren(); let xx = this.ui.secretary.width / 2; let yy = this.ui.secretary.height; let scale = xGame.common.getSecretaryScale(); let data = { x: xx, y: yy, scaleX: scale, scaleY: scale }; if (this.success) { let rand = 0; xGame.common.secretary.play(data, 0, true, parent); } else { xGame.common.secretary.play(data, 0, true, parent); } } restartGame() { switch (xGame.common.gameMode) { case GameMode.classic: xGame.eventMgr.event(RESTART_GAME); Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode }); break; case GameMode.bigMove: this.hide(); xGame.eventMgr.event(RESTART_GAME); Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode }); break; default: break; } } hide() { super.hide(); xGame.common.stopGirlPop(this.ui.talkNode); PlatMgr.showBanner(false); } returnHome() { this.hide(); let showFailWords = !this.success; xGame.uiMgr.Show(UIMain, showFailWords); } clickLeftBtn() { switch (xGame.common.gameMode) { case GameMode.classic: case GameMode.bigMove: this.returnHome(); break; case GameMode.placeBall: let level = xGame.common.placeBallCurLevel; this.powerStartPlaceBallLevel(level, this.ui.leftBtn); Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode }); break; default: break; } } powerStartPlaceBallLevel(level, btn) { if (DataMgr.powerEnough()) { btn.touchable = false; btn.powerEft.t0.play(Laya.Handler.create(this, () => { btn.touchable = true; DataMgr.setPower(-1); xGame.eventMgr.event(POWER_TIME); this.startPlaceBallLevel(level); this.logEventForChallenge_level_start(level); })); } else { xGame.uiMgr.Show(UIPower, 0); } } clickRightBtn() { switch (xGame.common.gameMode) { case GameMode.classic: console.log('zh:clickRightBtn 111'); case GameMode.bigMove: console.log('zh:clickRightBtn 222'); this.restartGame(); break; case GameMode.placeBall: console.log('zh:clickRightBtn 333'); let level = xGame.common.placeBallCurLevel; let data = DataMgr.getPlaceBallLevel(level); let curPss = data.play && !data.isCur; if (curPss) { console.log('zh:clickRightBtn 333-111'); console.log('zh:当前LV=' + level); if (level == 60) { xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels."); Laya.timer.once(3000, this, () => { this.returnHome(); }); } else { let lev = level + 1; this.powerStartPlaceBallLevel(lev, this.ui.rightBtn); } } else { console.log('zh:clickRightBtn 333-000'); Moyu.sendDataEvent("placeBallNextLevel"); console.log('zh:qjff_AD_for_uiGameEnd'); Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + ''); if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) { } else { console.log('zh:AD 失败,直接发放奖励'); this.qjff_AD_for_uiGameEnd(level); } } break; default: console.log('zh:clickRightBtn 444'); break; } } logEventForChallenge_level_start(level) { let keyStr = 'sjmd_challenge_level_start'; let jsonStr = { "count": 0, "gold_balance ": DataMgr.getCoin(), "level": level, "diamond_balance ": DataMgr.getDiamond() }; if (LocalStorageManager.hasJosnKey(keyStr)) { const d = LocalStorageManager.getItem(keyStr); if (level > d.level) { jsonStr.count = d.count + 1; LocalStorageManager.setItem(keyStr, jsonStr); } else { } } else { LocalStorageManager.setItem(keyStr, jsonStr); } const reqStr = JSON.stringify(jsonStr); JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr); } qjff_AD_for_uiGameEnd(level) { DataMgr.setPlaceBallLevel(level, 1); this.startPlaceBallLevel(level + 1); } startPlaceBallLevel(level) { xGame.common.gameMode = GameMode.placeBall; xGame.common.placeBallCurLevel = level; xGame.uiMgr.Show(UIGame); this.hide(); } logEventForChallenge_level_complete(level) { let keyStr = 'sjmd_challenge_level_complete'; let jsonStr = { "count": 1, "gold_balance ": DataMgr.getCoin(), "level": level, "diamond_balance ": DataMgr.getDiamond() }; if (LocalStorageManager.hasJosnKey(keyStr)) { const d = LocalStorageManager.getItem(keyStr); jsonStr.count = d.count + 1; LocalStorageManager.setItem(keyStr, jsonStr); } else { LocalStorageManager.setItem(keyStr, jsonStr); } const reqStr = JSON.stringify(jsonStr); JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr); } logEventForChallenge_level_N(level) { console.log('zh:logEventForChallenge_level_N ' + level); let keyStr = 'sjmd_challenge_level_N'; if (LocalStorageManager.hasKey(keyStr)) { let lev = LocalStorageManager.getItem(keyStr); if (level > lev) { LocalStorageManager.setItem(keyStr, level); } if ((level) % 5 == 0) { console.log('zh:每5关上报1次'); let sjmc = 'challenge_level_' + level; JSBridgeUtils.instance.logEventForAdNoParams(sjmc); let sjmcForFirebase = 'challenge_level_' + level; JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null); } else { console.log('zh:5 no 上报'); } } else { LocalStorageManager.setItem(keyStr, level); } } } UIGameEnd.uiName = "UIGameEnd"; class ui_UIVideoShare extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "UIVideoShare")); } onConstruct() { this.n10 = (this.getChild("n10")); this.myNode = (this.getChild("myNode")); this.t0 = this.getTransition("t0"); } } ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj"; class UIVideoShare extends UIBase { constructor() { super(); this.success = false; this.awardNum = 0; this.isShared = true; } onConstructor() { this.ui = ui_UIVideoShare.createInstance(); this.contentPane = this.ui; this.isEject = false; this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf); this.addUIClick(this.ui.myNode.shareBtn, this.videoShare); this.addUIClick(this.ui.myNode.share2Btn, this.shareGame); this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare); } show(success) { super.show(); this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg; this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1; this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5; this.success = success; let time = xGame.common.randomNum(600, 1500); JSBridgeUtils.instance.showInternAd('uivideoshare_show'); if (success) xGame.soundMgr.playSound("applause"); this.ui.t0.play(); this.checkShareState(); let times = DataMgr.getDailyVideoShareTimes(); this.awardNum = times == 0 ? 2000 : 200; this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + ""; } checkShareState() { if (PlatMgr.forceShare == 0) { this.ui.myNode.closeBtn.visible = true; this.ui.myNode.tipsNode.visible = false; this.ui.myNode.closeBtn.x = 90; this.ui.myNode.shareBtn.x = 342; } else if (PlatMgr.forceShare == 1) { this.ui.myNode.closeBtn.visible = false; this.ui.myNode.tipsNode.visible = true; this.ui.myNode.shareBtn.x = 218; this.isShared = true; this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1; } } checkForceShare() { this.isShared = !this.isShared; this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1; } videoShare() { if (PlatMgr.forceShare == 1) { if (this.isShared) { this.shareGame(); } else { this.hideSelf(); } } else { this.shareGame(); } } shareGame() { Moyu.sendDataEvent("VideoShare"); if (Moyu.canShare() > 100) { Moyu.shareGame((success) => { if (success) { DataMgr.setDailyVideoShareTimes(1); DataMgr.setCoin(this.awardNum); } this.hideSelf(); }, this); } else { xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败"); this.hideSelf(); } } hideSelf() { this.hide(); xGame.uiMgr.Show(UIGameEnd, this.success); if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) { xGame.common.screenImg.destroy(); xGame.common.screenImg = null; } } } UIVideoShare.uiName = "UIVideoShare"; class ui_UITips extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "UITips")); } onConstruct() { this.n0 = (this.getChild("n0")); this.myNode = (this.getChild("myNode")); this.t0 = this.getTransition("t0"); } } ui_UITips.URL = "ui://isxx5ak7mnrs42z"; class UITips extends UIBase { constructor() { super(); this.type = 0; } onConstructor() { this.ui = ui_UITips.createInstance(); this.contentPane = this.ui; this.isEject = false; this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn); this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn); } show(tipsTxt, womanTxt, type) { super.show(); this.ui.t0.play(); this.ui.myNode.tipsTxt.text = tipsTxt; this.ui.myNode.womanTxt.text = womanTxt; PlatMgr.showInsert(true); this.ui.myNode.c1.selectedIndex = type; this.type = type; switch (this.type) { case TipsType.exitGame: xGame.common.gameMgr.gamePause = true; break; case TipsType.foul: Laya.timer.once(200, this, () => { xGame.common.gameMgr.gamePause = true; }); break; default: break; } } clickLeftBtn() { this.hide(); xGame.common.gameMgr.gamePause = false; switch (this.type) { case TipsType.exitGame: break; case TipsType.foul: break; default: break; } } clickRightBtn() { this.hide(); switch (this.type) { case TipsType.exitGame: xGame.eventMgr.event(RESET_GAME); xGame.uiMgr.Show(UIMain); Moyu.recordEnd(this, null); xGame.common.longHelpLine = false; break; case TipsType.foul: xGame.common.gameMgr.gamePause = false; Laya.timer.clearAll(this); break; default: break; } } } UITips.uiName = "UITips"; class GameMgr { constructor() { this.selfCamp = ""; this.selfFoulNum = 0; this.selfBallArr = []; this.selfTimer = 0; this.selfScore = 0; this.aiCamp = ""; this.aiFoulNum = 0; this.aiBallArr = []; this.aiTimer = 0; this.aiScore = 0; this.aiSkillLevelNum = 1; this.targertScore = 0; this.setTime = 30; this.selfTurnRate = 0.5; this.accTime = 0; this.curFoul = ""; this.maxFoulTimes = 3; this.isFirstInGame = true; this.firstColliObj = null; this.inHoleBalls = []; this.blackNum = 8; this.success = false; this.holePosList = []; this.posObj = {}; this._selfTurn = false; this.lastRootBallPos = new Laya.Vector2(311, 430); this.ensureBallType = false; this.isOpenBall = true; this.finishOneShoot = true; this.isEnd = false; this.isChangeTurn = false; this.isInterrupt = false; this.aiPlayedBreakArmy = false; this.isTouchedBall = false; this.finishBalls = 0; this.needBalls = 0; this.allBallNum = 0; this.placeBallPosData = {}; this.curHP = 0; this.showLongView = false; this.firstShoot = true; this._gamePause = false; this.trunCount = 0; this.isBlackInHole = false; this.isEnter = true; xGame.eventMgr.offAll(ALL_BALL_STOP); xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun); xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot); xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot); xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp); xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp); xGame.eventMgr.off(RESET_GAME, this, this.resetGame); xGame.eventMgr.on(RESET_GAME, this, this.resetGame); } get gamePause() { return this._gamePause; } set gamePause(v) { if (v) { Laya.physicsTimer.pause(); } else { Laya.physicsTimer.resume(); } this._gamePause = v; } get selfTurn() { return this._selfTurn; } set selfTurn(val) { this.trunCount++; this._selfTurn = val; if (val) { xGame.common.d2World.d2Gan.ui.self.visible = true; xGame.common.d2World.d2Gan.ui.ai.visible = false; } else { xGame.common.d2World.d2Gan.ui.self.visible = false; xGame.common.d2World.d2Gan.ui.ai.visible = true; if (this.trunCount > 1) PlatMgr.openBox(); } } resetGame() { this.inHoleBalls = []; this.isFirstInGame = true; this.firstColliObj = null; this.aiCamp = ""; this.selfCamp = ""; this.aiFoulNum = 0; this.selfFoulNum = 0; this.selfBallArr = []; this.aiBallArr = []; this.gamePause = false; this.ensureBallType = false; this.isInterrupt = false; this.updateLeftBall(); this.clearTime(); this.aiPlayedBreakArmy = false; this.isBlackInHole = false; this.placeBallPosData = {}; if (xGame.common.d3World.knifeRoot) { xGame.common.d3World.knifeRoot.destroyChildren(); } } gameReady() { this.trunCount = 0; this.firstColliObj = null; this.isFirstInGame = true; this.selfTurn = Math.random() <= this.selfTurnRate; let challengeNum = DataMgr.getChallengeTimes(); if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) { this.selfTurn = true; } if (xGame.common.gameMode == GameMode.placeBall) this.selfTurn = true; if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) { this.selfTurn = true; } xGame.common.gameUI.setTurnAlpha(this.selfTurn); this.checkGuide(); if (xGame.common.uiRodMethod) xGame.common.uiRodMethod.resetRod(); xGame.common.d2World.getHelpLine(); this.isOpenBall = true; this.isTouchedBall = false; xGame.common.aiPlayer.stopRun(); this.setTime = 30; let ui = xGame.common.gameUI.ui; switch (xGame.common.gameMode) { case GameMode.classic: xGame.common.aiPlayer.init(); this.blackNum = 8; this.placeRootBall(); this.peoplePlay(9, 10); ui.wordsBtn.visible = true; ui.aiWordsBtn.visible = true; xGame.common.talkMgr.changeAIState(true); DataMgr.gameData.gameCount++; DataMgr.saveGameData(); break; case GameMode.bigMove: this.blackNum = -1; this.selfScore = 0; this.aiScore = 0; xGame.common.aiPlayer.init(); this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target; this.updateSelfScore(); this.updateAIScore(); this.updateTargetSroce(); this.placeRootBall(); this.peoplePlay(9, 10); ui.wordsBtn.visible = true; ui.aiWordsBtn.visible = true; xGame.common.talkMgr.changeAIState(true); if (DataMgr.getSkillGuide() < 1) DataMgr.gameData.gameCount = 0; else { DataMgr.gameData.gameCount++; DataMgr.saveGameData(); PlatMgr.openTry(); } if (xGame.common.d3World.knifeRoot) { xGame.common.d3World.knifeRoot.destroyChildren(); } break; case GameMode.placeBall: this.blackNum = -1; this.selfTurn = true; this.setTime = 10000; this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel]; this.curHP = this.placeBallData.hp; if (this.placeBallData.ball == -1) this.needBalls = xGame.common.d2World.ballArr.length - 1; else this.needBalls = this.placeBallData.ball; console.log("需要的进球数目", this.needBalls); this.allBallNum = xGame.common.d2World.ballArr.length - 1; this.finishBalls = 0; this.placeBallPosData = {}; this.updatePlaceBallPos(); this.updatePlaceBallState(); this.finishOneShoot = true; xGame.common.gameUI.ui.moveNode.visible = false; this.isOpenBall = false; xGame.common.d2World.d2Gan.ui.ai.visible = false; ui.wordsBtn.visible = false; ui.aiWordsBtn.visible = false; xGame.common.talkMgr.changeAIState(false); Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => { PlatMgr.openBox(); }); break; default: break; } this.showLongView = false; xGame.common.wordsMgr.comboTimes = 1; let guide = DataMgr.getSkillGuide(); if (guide) xGame.eventMgr.event(WAIT_SHOOT); xGame.common.upSkillLevel = false; xGame.common.gameStartTime = new Date().getTime(); this.firstShoot = true; } checkGuide() { let guide = DataMgr.getSkillGuide(); let gameUI = xGame.common.gameUI.ui; gameUI.guide1.visible = false; gameUI.guide2.visible = false; gameUI.guide3.visible = false; if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) { this.selfTurn = true; } else { return; } let oneBall = this.getOneBall(); gameUI.guide1.visible = true; gameUI.guide1.fingerNode.x = oneBall.gameObj.x; gameUI.guide1.fingerNode.y = oneBall.gameObj.y; } getOneBall() { let arr = xGame.common.d2World.ballArr; for (let index = 0; index < arr.length; index++) { if (arr[index].number == 0) continue; return arr[index]; } } updateSelfScore() { let ui = xGame.common.gameUI.ui.topNode; ui.selfScoreTxt.text = this.selfScore + ""; } updateAIScore() { let ui = xGame.common.gameUI.ui.topNode; ui.aiScoreTxt.text = this.aiScore + ""; } updateTargetSroce() { let ui = xGame.common.gameUI.ui.topNode; ui.middleNode.targetScoreTxt.text = this.targertScore + ""; } updateLeftBall() { let topUI = xGame.common.gameUI.ui.topNode; topUI.selfBallList.numItems = this.selfBallArr.length; topUI.aiBallList.numItems = this.aiBallArr.length; } ballShoot() { this.clearTime(); this.finishOneShoot = false; xGame.common.gameUI.ui.moveNode.visible = false; if (xGame.common.gameUI.ui.guideNode.visible) { xGame.common.gameUI.ui.guideNode.visible = false; } if (this.firstShoot) { this.firstShoot = false; Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`); } } ensureCamp(number) { this.ensureBallType = true; this.isOpenBall = false; if (xGame.common.gameMode != GameMode.classic) return; let full = [1, 2, 3, 4, 5, 6, 7]; let flower = [9, 10, 11, 12, 13, 14, 15]; let sayWords = ""; if (this.selfTurn) { if (number <= 7) { this.selfCamp = ballCamp.full; this.selfBallArr = full; this.aiCamp = ballCamp.flower; this.aiBallArr = flower; sayWords = cfgTable.wordsData[3].msg; } else { this.selfCamp = ballCamp.flower; this.selfBallArr = flower; this.aiCamp = ballCamp.full; this.aiBallArr = full; sayWords = cfgTable.wordsData[4].msg; } } else { if (number <= 7) { this.selfCamp = ballCamp.flower; this.selfBallArr = flower; this.aiCamp = ballCamp.full; this.aiBallArr = full; sayWords = cfgTable.wordsData[2].msg; } else { this.selfCamp = ballCamp.full; this.selfBallArr = full; this.aiCamp = ballCamp.flower; this.aiBallArr = flower; sayWords = cfgTable.wordsData[1].msg; } } this.updateLeftBall(); xGame.uiMgr.Show(UIMsg, sayWords); } updatePlaceBallState() { let ui = xGame.common.gameUI.ui; switch (this.placeBallData.type) { case PlaceBallType.normal: let normal = ui.placeNormalNode; normal.hpTxt.text = this.curHP + ""; this.updatePlaceBallStar(normal); normal.ballTxt.text = this.finishBalls + "/" + this.needBalls; normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`; break; case PlaceBallType.challenge: let challenge = ui.placeChallengeNode; challenge.hpTxt.text = "Shots:" + this.curHP; challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum; challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`; challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `; break; default: break; } } playSubHpAni() { let ui = xGame.common.gameUI.ui; switch (this.placeBallData.type) { case PlaceBallType.normal: let normal = ui.placeNormalNode; normal.hpTxt.visible = false; normal.starAni.c1.selectedIndex = 1; normal.starAni.t0.play(Laya.Handler.create(this, () => { normal.hpTxt.visible = true; normal.starAni.c1.selectedIndex = 0; })); break; default: break; } } getEndStarNum() { let num; let level = xGame.common.placeBallCurLevel; if (this.curHP == this.placeBallData.hp) { num = 3; } else if (this.curHP <= 1) { num = 1; } else { num = 2; } if (!this.success) { num = 0; } else { DataMgr.setPlaceBallLevel(level, num); } let myType = cfgTable.placeballData[level].type; if (this.success && myType == 1) { num = 3; } xGame.common.placeBallStarNum = num; } updatePlaceBallStar(node) { let star = 0; if (this.curHP == this.placeBallData.hp) { star = 3; } else if (this.curHP >= 2) { star = 2; } else if (this.curHP == 1) { star = 1; } else { star = 0; } let temp; for (let index = 1; index <= 3; index++) { temp = node["star" + index]; temp.c1.selectedIndex = star >= index ? 1 : 0; } node.myProgress.value = (star / 3) * 100; } openRegretView(isFoul, GoalNum, challenge = false) { let regretType = -1; if (isFoul) { regretType = 1; } else { if (GoalNum <= 0) { regretType = 0; } } if (challenge) { regretType = 1; } if (regretType != -1) { xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => { if (success) { this.curHP++; this.updatePlaceBallState(); this.setPlaceBallAllPos(); xGame.common.gameUI.ui.moveNode.visible = false; } else { if (this.curHP <= 0) { this.success = false; this.gameEnd(); } this.playSubHpAni(); } this.updatePlaceBallState(); this.updatePlaceBallPos(); }); } } setPlaceBallAllPos() { let allBall = xGame.common.d2World.ballArr; let cfgArr = this.placeBallPosData; let temp; let obj; for (let index = 0; index < allBall.length; index++) { temp = allBall[index]; if (temp.destroyed) continue; obj = cfgArr[temp.myUNID]; if (obj && obj.src && !obj.src.destroyed) { temp.gameObj.x = obj.posX; temp.gameObj.y = obj.posY; temp.d3BallSrc.setTransPos(obj.posX, obj.posY); } } xGame.common.d2World.getHelpLine(); } updatePlaceBallPos() { let arr = xGame.common.d2World.ballArr; let temp; for (let index = 0; index < arr.length; index++) { temp = arr[index]; if (!this.placeBallPosData[temp.myUNID]) { this.placeBallPosData[temp.myUNID] = { src: temp, posX: temp.gameObj.x, posY: temp.gameObj.y }; } else { this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x; this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y; } } let check; for (const key in this.placeBallPosData) { check = this.placeBallPosData[key]; if (check.src.destroyed) { delete this.placeBallPosData[key]; } } } gameRun(type) { if (this.gamePause) return; this.curFoul = this.getFoulType(); if (type) { xGame.common.d2World.d2Gan.shoot(); xGame.common.gameUI.forceCancel(); this.curFoul = type; } this.isEnd = false; this.isChangeTurn = true; if (xGame.common.gameMode == GameMode.classic) { this.judgeClassic(this.curFoul); this.checkClassicWords(() => { xGame.common.destroyClassicEmotion(); if (this.isEnd) { if (this.isBlackInHole) { xGame.common.gameUI.ui.blackAni.visible = true; xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => { xGame.common.gameUI.ui.blackAni.visible = false; this.gameEnd(); })); } else { this.gameEnd(); } } else { this.waitShoot(); xGame.eventMgr.event(WAIT_SHOOT); } }); } else if (xGame.common.gameMode == GameMode.bigMove) { xGame.common.aiPlayer.stopRun(); let scoreArr = this.getScore(this.curFoul); if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) { this.isEnd = true; } this.checkBigSkillWords(() => { if (this.isEnd) { this.gameEnd(); } else { this.waitShoot(); xGame.eventMgr.event(WAIT_SHOOT); } }); } else if (xGame.common.gameMode == GameMode.placeBall) { xGame.common.destroyAwardSpine(); let isFoul = this.curFoul == FoulType.rootHole; let GoalNum = this.inHoleBalls.length; if (this.inHoleBalls.indexOf(0) > -1) GoalNum -= 1; if (isFoul) { this.placeRootBall(); } console.log("neeballs", this.needBalls); console.log("当前完成的goalNum", GoalNum); this.finishBalls += GoalNum; console.log("当前完成的finishballs", this.finishBalls); let need = this.needBalls; if (this.placeBallData.type == PlaceBallType.challenge) { need += 100; } if (this.finishBalls >= need) { this.success = true; this.gameEnd(); } else { switch (this.placeBallData.type) { case PlaceBallType.normal: if (!isFoul && GoalNum > 0) { this.updatePlaceBallPos(); this.updatePlaceBallState(); } else { this.curHP--; this.openRegretView(isFoul, GoalNum); } this.waitShoot(); xGame.eventMgr.event(WAIT_SHOOT); break; case PlaceBallType.challenge: this.curHP--; this.updatePlaceBallState(); if (isFoul) { this.openRegretView(isFoul, GoalNum, true); } else { this.updatePlaceBallPos(); if (this.curHP <= 0) { this.success = true; this.gameEnd(); } } this.waitShoot(); xGame.eventMgr.event(WAIT_SHOOT); break; default: break; } } } } checkClassicWords(callback) { xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn); let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch); let type = this.getClassicWordsType(); if (condition && type != -1) { let str = Math.random() <= 0.5 ? "hint01" : "hint02"; xGame.soundMgr.playSound(str); xGame.common.wordsMgr.playClassicWords(type, callback); } else { Laya.timer.once(300, this, () => { callback && callback(); }); } } getClassicWordsType() { let d2world = xGame.common.d2World; let type = -1; if (!this.isInterrupt && this.judgeNormalSuccess()) { type = ClassicWordsType.perfectShow; return type; } if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) { type = ClassicWordsType.directShoot; return type; } if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) { type = ClassicWordsType.anotherShoot; return type; } if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) { type = ClassicWordsType.bigPower; return type; } let minSpeed = 1; if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) { type = ClassicWordsType.hardShoot; return type; } if (this.inHoleBalls.length > 0) { type = ClassicWordsType.directShoot; return type; } return type; } checkBigSkillWords(callback) { if (this.curFoul == FoulType.timeOut) { callback && callback(); } else { let playSkill = false; if (this.selfTurn) { playSkill = true; } else { if (!this.aiPlayedBreakArmy) { this.aiPlayedBreakArmy = true; playSkill = true; } if (this.aiCurSkill != SkillType.breakArmy) { playSkill = true; } } if (xGame.common.skillMgr.playedLastSkill) { xGame.common.skillMgr.playedLastSkill = false; playSkill = false; } if (playSkill) { xGame.common.skillMgr.runBigSkill((extraScore) => { let selfExtra = 0; let aiExtra = 0; if (this.selfTurn) selfExtra += extraScore; else aiExtra += extraScore; if (this.judgeScoreEnd(selfExtra, aiExtra)) { this.isEnd = true; } this.playBigSkillTimes(callback); }); } else { this.playBigSkillTimes(callback); } } } playBigSkillTimes(callback) { let length = this.inHoleBalls.length; if (this.inHoleBalls.indexOf(0) > -1) { length = this.inHoleBalls.length - 1; } if (length <= 0) { callback && callback(); return; } xGame.common.wordsMgr.playBigSkillTimes(length, () => { callback && callback(); }); } playSkillTips() { let levelNum = 0; let curType; if (this.selfTurn) { levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill); curType = this.selfCurSkill; if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) { levelNum += 5; } } else { levelNum = this.aiSkillLevelNum; curType = this.aiCurSkill; } let str = ``; switch (curType) { case SkillType.highSpace: str = `An extra ${xGame.common.extraMoveNum} balls were moved`; break; case SkillType.breakArmy: str = `You pocketed ${levelNum} extra balls`; break; case SkillType.ice: str = `${levelNum * 2} extra balls were frozen`; break; case SkillType.fireworks: str = `${levelNum} extra balls exploded `; break; case SkillType.GuanYu: str = `There were ${xGame.common.extraMoveNum} displacement movements`; break; default: break; } xGame.uiMgr.Show(UIMsg, str); } getFoulType() { let foulType = ""; if (this.firstColliObj == null) { if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) { return FoulType.rootHole; } return FoulType.notTouch; } else { if (this.selfTurn) { if (this.selfBallArr.length > 0) { if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) { foulType = FoulType.wrongTouch; } } else { if (this.ensureBallType) { } else { if (this.firstColliObj == this.blackNum) { foulType = FoulType.wrongTouch; } } } } else { if (this.aiBallArr.length > 0) { if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) { foulType = FoulType.wrongTouch; } } else { if (this.ensureBallType) { } else { if (this.firstColliObj == this.blackNum) { foulType = FoulType.wrongTouch; } } } } if (this.inHoleBalls.length <= 0) { return foulType; } let temp; if (this.inHoleBalls.indexOf(0) > -1) { foulType = FoulType.rootHole; } else { for (let index = 0; index < this.inHoleBalls.length; index++) { temp = this.inHoleBalls[index]; if (this.selfTurn) { if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) { foulType = FoulType.wrongHole; break; } } else { if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) { foulType = FoulType.wrongHole; break; } } } } let foo; for (let index = 0; index < this.inHoleBalls.length; index++) { temp = this.inHoleBalls[index]; foo = this.selfBallArr.indexOf(temp); if (foo > -1) { this.selfBallArr.splice(foo, 1); } foo = this.aiBallArr.indexOf(temp); if (foo > -1) { this.aiBallArr.splice(foo, 1); } } this.updateLeftBall(); } return foulType; } judgeGameEndByBlack(arr) { if (this.selfTurn) { if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) { this.selfFoulNum = this.maxFoulTimes; return true; } } else { if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) { this.aiFoulNum = this.maxFoulTimes; return true; } } } judgeClassic(type) { this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls); xGame.common.aiPlayer.stopRun(); if (this.judgeNormalSuccess()) { this.isEnd = true; return; } let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole); if (this.selfTurn) { if (isFoul) { this.selfFoulNum++; } if (this.selfFoulNum >= this.maxFoulTimes) { this.success = false; this.isEnd = true; return; } } else { if (isFoul) this.aiFoulNum++; if (this.aiFoulNum >= this.maxFoulTimes) { this.success = true; this.isEnd = true; return; } } if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) { this.isChangeTurn = false; } else { this.isInterrupt = true; } } waitShoot() { if (xGame.common.gameMode == GameMode.classic) { switch (this.curFoul) { case FoulType.timeOut: case FoulType.rootHole: this.selfTurn = !this.selfTurn; this.peoplePlay(5, 6, true); break; case FoulType.notTouch: this.selfTurn = !this.selfTurn; this.peoplePlay(7, 7); break; case FoulType.wrongHole: this.selfTurn = !this.selfTurn; this.peoplePlay(11, 11); break; default: if (this.inHoleBalls.length > 0) { this.peoplePlay(0, 0, false, false); } else { this.selfTurn = !this.selfTurn; this.peoplePlay(7, 7); } break; } } else if (xGame.common.gameMode == GameMode.bigMove) { if (this.curFoul == FoulType.timeOut) { this.selfTurn = !this.selfTurn; this.peoplePlay(14, 15); this.placeRootBall(); } else { this.selfTurn = !this.selfTurn; if (this.curFoul == FoulType.rootHole) { this.peoplePlay(12, 13); this.placeRootBall(); } else { this.peoplePlay(0, 0, false, false); } } } else if (xGame.common.gameMode == GameMode.placeBall) { this.finishOneShoot = true; } this.gameResult(); } gameResult() { this.firstColliObj = null; this.inHoleBalls = []; let curX = xGame.common.d2World.rootBall.gameObj.x; let curY = xGame.common.d2World.rootBall.gameObj.y; xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY); if (xGame.common.uiRodMethod) xGame.common.uiRodMethod.resetRod(); xGame.common.d2World.rootBall.showSelf(); this.clearIceSkill(); if (this.selfTurn) { PlatMgr.gameInsert(); } xGame.common.d3World.knifeRoot.destroyChildren(); if (this.selfTurn) { xGame.common.gameUI.showHelpLineGuide(); xGame.common.gameUI.setTurnAlpha(true); } else { xGame.common.gameUI.setTurnAlpha(false); } } getScore(type) { let selfAdd = 0; let aiAdd = 0; if (type == FoulType.timeOut) { if (this.selfTurn) aiAdd += 3; else selfAdd += 3; } else { if (this.inHoleBalls.length > 0) { if (this.selfTurn) { if (type == FoulType.rootHole) { aiAdd += 3; if (this.inHoleBalls.length - 1 > 0) { selfAdd += this.inHoleBalls.length - 1; } } else { selfAdd += this.inHoleBalls.length; } } else { if (type == FoulType.rootHole) { selfAdd += 3; if (this.inHoleBalls.length - 1 > 0) { aiAdd += this.inHoleBalls.length - 1; } } else { aiAdd += this.inHoleBalls.length; } } } } return [selfAdd, aiAdd]; } judgeScoreEnd(selfAdd, aiAdd) { this.selfScore += selfAdd; this.aiScore += aiAdd; this.updateAIScore(); this.updateSelfScore(); if (this.selfScore >= this.targertScore) { this.success = true; return true; } if (this.aiScore >= this.targertScore) { this.success = false; return true; } let ballArr = xGame.common.d2World.ballArr; if (ballArr.length == 1 && ballArr[0].number == 0) { if (this.selfScore > this.aiScore) { this.success = true; return true; } else if (this.selfScore < this.aiScore) { this.success = false; return true; } else { if (this.selfTurn) { this.success = false; } else { this.success = true; } return true; } } } clearIceSkill() { let arr = xGame.common.d2World.ballArr; let temp; if (this.selfTurn) { if (this.selfCurSkill == SkillType.ice) { for (let index = 0; index < arr.length; index++) { temp = arr[index]; if (temp.ballFunc == "ice") { temp.setBallFunc("normal", "self"); } } } } else { if (this.aiCurSkill == SkillType.ice) { for (let index = 0; index < arr.length; index++) { temp = arr[index]; if (temp.ballFunc == "ice") { temp.setBallFunc("normal", "ai"); } } } } } judgeNormalSuccess() { if (this.selfTurn) { if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) { this.success = true; return true; } } else { if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) { this.success = false; return true; } } } gameEnd() { if (Moyu.isTT) { xGame.common.screenImg = getScreenImg(); } console.log("游戏结束", this.success); xGame.common.aiPlayer.stopRun(); if (xGame.common.gameMode == GameMode.placeBall) { this.getEndStarNum(); this.updatePlaceBallState(); } this.isEnter = false; Moyu.recordEnd(this, () => { if (this.isEnter) return; this.isEnter = true; console.log("进入录结束回调"); this.enterNext(); }); Laya.timer.once(1000, this, () => { if (this.isEnter) return; this.isEnter = true; this.enterNext(); }); xGame.common.longHelpLine = false; } enterNext() { Laya.timer.clearAll(this); if (Moyu.canShare() > 100 || Moyu.isKs) { xGame.uiMgr.Show(UIVideoShare, this.success); } else { xGame.uiMgr.Show(UIGameEnd, this.success); } } aiLeave() { let ui = xGame.common.gameUI.ui; ui.topNode.aiNameTxt.text = "offline"; } aiGameEnd(suc) { this.success = suc; xGame.common.aiPlayer.stopRun(); if (this.success) { xGame.uiMgr.Show(UIMsg, "The opponent has fled"); Laya.timer.once(1000, this, () => { this.clearTime(); this.gameEnd(); }); } } openTimer() { let src = xGame.common.gameUI; if (this.selfTurn) { src.ui.topNode.selfProgress.visible = true; src.ui.topNode.aiProgress.visible = false; this.curTimer = src.ui.topNode.selfProgress; } else { src.ui.topNode.selfProgress.visible = false; src.ui.topNode.aiProgress.visible = true; this.curTimer = src.ui.topNode.aiProgress; } this.accTime = 0; Laya.timer.clearAll(this); Laya.timer.loop(20, this, this.updateTime, [0.02]); this.curTimer.value = 100; } updateTime(dt) { if (this.gamePause) return; this.accTime += dt; this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime; if (this.accTime >= this.setTime) { this.clearTime(); console.log("时钟进入了gameRun"); this.gameRun(FoulType.timeOut); } } clearTime() { let src = xGame.common.gameUI; src.ui.topNode.selfProgress.visible = false; src.ui.topNode.aiProgress.visible = false; Laya.timer.clearAll(this); } peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) { let ui = xGame.common.gameUI.ui; let selfMsg, aiMsg; if (sayWords) { selfMsg = cfgTable.wordsData[selfIndex].msg; aiMsg = cfgTable.wordsData[aiIndex].msg; if (Foul) { selfMsg = selfMsg.replace("$", this.aiFoulNum + ""); aiMsg = aiMsg.replace("$", this.selfFoulNum + ""); this.placeRootBall(); if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) { if (this.curFoul == FoulType.rootHole) { if (!DataMgr.getRootBallFoul()) { DataMgr.setRootBallFoul(); aiMsg = ""; let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game"; let woman = "Boss, pay attention next time~"; xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul); } } else if (this.curFoul == FoulType.timeOut) { if (!DataMgr.getTimeoutFoul()) { DataMgr.setTimeoutFoul(); aiMsg = ""; let tips = "Game timeout, 3 fouls, this game failed."; let woman = "Boss, pay attention to the timeline~"; xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul); } } } } } if (this.selfTurn) { if (sayWords) { xGame.uiMgr.Show(UIMsg, selfMsg, () => { ui.selfTurn.visible = true; ui.aiTurn.visible = false; ui.selfTurn.t0.play(); Moyu.vibration(); }); } } else { let aiNum = xGame.tools.random(1, 11); let challengeNum = DataMgr.getChallengeTimes(); let delay = false; if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) { aiNum = 9; if (this.aiBallArr.length <= 2 && this.ensureBallType) { aiNum = 3; if (challengeNum == 3) { if (!this.showLongView) { this.showLongView = true; delay = true; } } } } if (delay) { xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => { if (success) { xGame.common.longHelpLine = true; xGame.common.d2World.getHelpLine(); } else { aiNum = 10; } xGame.common.aiPlayer.setAiLevel(aiNum); if (sayWords) { xGame.uiMgr.Show(UIMsg, aiMsg, () => { xGame.common.aiPlayer.runAI(); ui.selfTurn.visible = false; ui.aiTurn.visible = true; ui.aiTurn.t0.play(); }); } else { xGame.common.aiPlayer.runAI(); } this.openTimer(); this.finishOneShoot = true; if (this.selfTurn) { ui.topNode.selfKuang.visible = true; ui.topNode.aiKuang.visible = false; ui.topNode.selfTips.visible = true; ui.topNode.aiTips.visible = false; } else { ui.topNode.selfKuang.visible = false; ui.topNode.aiKuang.visible = true; ui.topNode.selfTips.visible = false; ui.topNode.aiTips.visible = true; } }); return; } if (xGame.common.gameMode == GameMode.classic) { let cfg = cfgTable.modeselectData[xGame.common.classicRoomType]; if (cfg) { let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]); aiNum = aiLevel; } } xGame.common.aiPlayer.setAiLevel(aiNum); if (sayWords) { xGame.uiMgr.Show(UIMsg, aiMsg, () => { xGame.common.aiPlayer.runAI(); ui.selfTurn.visible = false; ui.aiTurn.visible = true; ui.aiTurn.t0.play(); }); } else { xGame.common.aiPlayer.runAI(); } } this.openTimer(); this.finishOneShoot = true; if (this.selfTurn) { ui.topNode.selfKuang.visible = true; ui.topNode.aiKuang.visible = false; ui.topNode.selfTips.visible = true; ui.topNode.aiTips.visible = false; } else { ui.topNode.selfKuang.visible = false; ui.topNode.aiKuang.visible = true; ui.topNode.selfTips.visible = false; ui.topNode.aiTips.visible = true; } } placeRootBall() { let rootBall = xGame.common.d2World.rootBall; if (!rootBall) return; rootBall.gameObj.x = this.lastRootBallPos.x; rootBall.gameObj.y = this.lastRootBallPos.y; rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y); let moveNode = xGame.common.gameUI.ui.moveNode; moveNode.visible = true; moveNode.x = this.lastRootBallPos.x; moveNode.y = this.lastRootBallPos.y; if (!this.selfTurn) { xGame.common.aiPlayer.resetRoot(); } } } class ui_guanyuAni extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "guanyuAni")); } onConstruct() { this.n0 = (this.getChild("n0")); } } ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u"; class UIFireworks extends UIBase { constructor() { super(); } onConstructor() { this.isEject = false; } show(callback) { super.show(); } } UIFireworks.uiName = "UIFireworks"; class ui_UIGuanYu extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "UIGuanYu")); } onConstruct() { this.n2 = (this.getChild("n2")); this.n1 = (this.getChild("n1")); this.n3 = (this.getChild("n3")); this.n4 = (this.getChild("n4")); this.n5 = (this.getChild("n5")); this.n6 = (this.getChild("n6")); this.n8 = (this.getChild("n8")); this.n7 = (this.getChild("n7")); this.t0 = this.getTransition("t0"); } } ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc"; class UIGuanYu extends UIBase { constructor() { super(); } onConstructor() { this.ui = ui_UIGuanYu.createInstance(); this.contentPane = this.ui; this.isEject = false; } show(callback) { super.show(); this.ui.t0.play(Laya.Handler.create(this, () => { callback && callback(); this.hide(); })); } } UIGuanYu.uiName = "UIGuanYu"; class SkillMgr { constructor() { this.leveNum = 0; this.extraScore = 0; this.selfTurn = false; this.playedLastSkill = false; this.tweenArr = []; this._finishNum = 0; this._curFinish = 0; this._rootX = 0; this._rootY = 0; this.knifeTimes = 0; this.knifeV2 = new Laya.Vector2(); this.knifeV3 = new Laya.Vector3(); this.rtStarX = 0; this.rtStarY = 0; this.addBigSkillSpine(); xGame.eventMgr.on(RESET_GAME, this, this.resetGame); } addBigSkillSpine() { this.skillSpine2 = new SpineMgr("yxz_dazhao", () => { console.log("extra2 success"); }); } runBigSkill(callback) { this.tweenArr = []; this.callback = callback; this.judgeSkill(); this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill); let guide = DataMgr.getSkillGuide(); if (!xGame.common.gameMgr.selfTurn) { this.leveNum = xGame.common.gameMgr.aiSkillLevelNum; } else { if (xGame.common.temSelfLevel != 0) { this.leveNum = xGame.common.temSelfLevel; } if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) { this.leveNum += 5; } } if (guide == 0) { DataMgr.setSkillGuide(1); if (DataMgr.getNewUser()) { Moyu.sendDataEvent("gameFirstPlay"); DataMgr.setNewUser(); } } this.playSpineAni(() => { switch (this.curSkill) { case SkillType.highSpace: this.runHighSpace(); break; case SkillType.breakArmy: this.runBreakArmy(); break; case SkillType.ice: this.runIce(); break; case SkillType.fireworks: this.runFireworks(); break; case SkillType.GuanYu: this.runGuanYu(); break; default: break; } }); } judgeSkill() { let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu]; let gameMgr = xGame.common.gameMgr; let type; for (let index = 0; index < typeArr.length; index++) { type = typeArr[index]; if (gameMgr.selfTurn) { if (gameMgr.selfCurSkill == type) { this.selfTurn = true; this.curSkill = type; return; } } else { if (gameMgr.aiCurSkill == type) { this.selfTurn = false; this.curSkill = type; return; } } } } playSpineAni(callback) { let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 }; let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject; parent.destroyChildren(); let aniIndex = 0; let skillSpine; switch (this.curSkill) { case SkillType.highSpace: aniIndex = 1; xGame.soundMgr.playSound("skill01"); skillSpine = this.skillSpine2; data.scaleX = 0.5; data.scaleY = 0.5; skillSpine.play(data, 1, false, parent, () => { callback && callback(); }); break; case SkillType.breakArmy: aniIndex = 2; xGame.soundMgr.playSound("skill02"); skillSpine = this.skillSpine2; data.scaleX = 0.5; data.scaleY = 0.5; skillSpine.play(data, 2, false, parent, () => { callback && callback(); }); break; case SkillType.ice: aniIndex = 0; xGame.soundMgr.playSound("skill03"); skillSpine = this.skillSpine2; data.scaleX = 0.5; data.scaleY = 0.5; skillSpine.play(data, 0, false, parent, () => { callback && callback(); }); break; case SkillType.fireworks: xGame.soundMgr.playSound("skill_04_01"); xGame.soundMgr.playSound("skill04"); xGame.uiMgr.Show(UIFireworks, callback); break; case SkillType.GuanYu: xGame.soundMgr.playSound("skill05_1"); xGame.soundMgr.playSound("skill05"); xGame.uiMgr.Show(UIGuanYu, callback); break; default: break; } } getAllBallArr() { let arr = xGame.common.d2World.ballArr; let outArr = []; for (let index = 0; index < arr.length; index++) { if (arr[index] instanceof D2RootBallSrc) continue; if (arr[index].ballFunc == "ice") continue; if (arr[index].destroyed) continue; outArr.push(arr[index]); } return outArr; } getOneArr(deletObj) { let allArr = this.getAllBallArr(); let temp; for (let index = 0; index < allArr.length; index++) { temp = allArr[index]; if (temp.id == deletObj.id) { allArr.splice(index, 1); break; } } return allArr; } getNearBallBag(ball) { let ui = xGame.common.gameUI.ui; let circleArr = []; for (let index = 1; index <= 6; index++) { circleArr.push(ui.border["circle" + index]); } let outIndex = 0; let temp; let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2); ; let dis = 0; for (let index = 1; index < circleArr.length; index++) { temp = circleArr[index]; dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2); if (dis < min) { min = dis; outIndex = index; } } return [circleArr[outIndex], outIndex]; } ballFlyToBag(ballArr, time = 300) { let temp; let hole; this._finishNum = ballArr.length; this._curFinish = 0; let holeObj = {}; let holeCfg = { "1": 0, "2": 0, "3": 0, "4": 0, "5": 0, "6": 0 }; for (let index = 0; index < ballArr.length; index++) { temp = ballArr[index]; temp.outColli.isSensor = true; temp.innerColli.isSensor = true; temp.isRunSkillAni = true; let holeArr = this.getNearBallBag(temp); hole = holeArr[0]; holeObj[index] = holeArr[1]; temp.d3BallSrc.scaleXYZ = 0.5; this.tweenArr.push(temp.d3BallSrc, temp); Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => { Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn); })); Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => { let mIndex = holeObj[this._curFinish]; let isDone = holeCfg[mIndex]; if (isDone) { ballArr[this._curFinish].checkWrongBall(false); } else { holeCfg[mIndex] = 1; ballArr[this._curFinish].checkWrongBall(); } this._curFinish++; if (this._curFinish >= this._finishNum) { if (this.curSkill == SkillType.highSpace) { } else if (this.curSkill == SkillType.breakArmy) { let rootBall = xGame.common.d2World.rootBall; rootBall.gameObj.x = this._rootX; rootBall.gameObj.y = this._rootY; rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY); xGame.common.d2World.d2Gan.ui.visible = true; xGame.common.d2World.d2HelpLine.ui.visible = true; xGame.common.d2World.getHelpLine(); this.callback && this.callback(this.extraScore); } } })); } } runHighSpace() { let rootBall = xGame.common.d2World.rootBall; rootBall.showSelf(); let d3Src = rootBall.d3BallSrc; let allArr = this.getAllBallArr(); if (allArr.length <= 0) { this.callback && this.callback(0); return; } let selectBall = xGame.common.d2World.targetBall; let wrong = selectBall && selectBall.destroyed; if (!selectBall || wrong || selectBall.ballFunc == "ice") { selectBall = xGame.common.getRandArrEle(allArr); } let targetD3Src = selectBall.d3BallSrc; xGame.common.d2World.d2Gan.ui.visible = false; xGame.common.d2World.d2HelpLine.ui.visible = false; d3Src.scaleXYZ = 0.5; this.tweenArr.push(d3Src); Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => { Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => { let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft); hitEft.transform.localPositionX = d3Src.transform.localPositionX; hitEft.transform.localPositionY = d3Src.transform.localPositionY; hitEft.transform.localPositionZ = d3Src.transform.localPositionZ; let outArr = [selectBall]; let other = this.leveNum - 1; if (other > 0) { let nearArr = this.getOneArr(selectBall); if (nearArr.length > 0) { xGame.common.botherArr(nearArr); if (other >= nearArr.length) other = nearArr.length; for (let index = 0; index < other; index++) { outArr.push(nearArr[index]); } } } xGame.common.extraMoveNum = other + 1; this.extraScore = other + 1; this._rootX = selectBall.gameObj.x; this._rootY = selectBall.gameObj.y; rootBall.gameObj.x = this._rootX; rootBall.gameObj.y = this._rootY; rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY); Laya.Tween.clearAll(d3Src); this.addRandomForce(outArr); })); })); } addRandomForce(outArr) { if (outArr.length > 0) { xGame.common.d2World.openCheckStill = true; this.playedLastSkill = true; } let temp; for (let index = 0; index < outArr.length; index++) { let angle = xGame.common.randomNum(0, 360); let linearPercent = xGame.common.randomNum(65, 100); temp = outArr[index]; this.setLinearSpeed(angle, temp.rigy, linearPercent); } } setLinearSpeed(angle, rigy, linearPercent) { let sin = Math.sin(angle * Math.PI / 180); let cos = Math.cos(angle * Math.PI / 180); let maxSpeed = 4; let speed = new Laya.Vector2(); speed.x = maxSpeed * linearPercent * sin; speed.y = -maxSpeed * linearPercent * cos; rigy.applyLinearImpulseToCenter(speed); } runBreakArmy() { xGame.common.d2World.d2Gan.ui.visible = false; xGame.common.d2World.d2HelpLine.ui.visible = false; let gameUI = xGame.common.gameUI.ui; gameUI.skillRod.visible = true; gameUI.skillRod.rotation = 110; let outArr = this.getAllBallArr(); if (outArr.length <= 0) { gameUI.skillRod.visible = false; this.callback && this.callback(0); return; } xGame.common.botherArr(outArr); if (this.leveNum >= outArr.length) this.leveNum = outArr.length; let deleteNum = outArr.length - this.leveNum; outArr.splice(0, deleteNum); this.extraScore = this.leveNum; let potX = gameUI.skillRod.x; let potY = gameUI.skillRod.y; this._rootX = xGame.common.d2World.rootBall.gameObj.x; this._rootY = xGame.common.d2World.rootBall.gameObj.y; let disArr = []; for (let index = 0; index < outArr.length; index++) { let obj = outArr[index]; let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2); dis = Math.pow(dis, 0.5); disArr.push(dis); } this.tweenArr.push(gameUI.skillRod); Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => { })).update = Laya.Handler.create(this, (e, t, c) => { let angle = gameUI.skillRod.rotation; let xx; let yy; let temp; for (let index = 0; index < outArr.length; index++) { temp = outArr[index]; xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180); yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180); yy -= 20; temp.gameObj.x = xx; temp.gameObj.y = yy; temp.d3BallSrc.setTransPos(xx, yy); } if (angle <= 60) { Laya.Tween.clearAll(gameUI.skillRod); this.ballFlyToBag(outArr, 150); gameUI.skillRod.visible = false; } }, null, false); } runIce() { let ballArr = xGame.common.d2World.ballArr; this.leveNum *= 2; if (this.leveNum >= ballArr.length - 1) this.leveNum = ballArr.length - 1; let tempArr = []; let outArr = []; for (let index = 0; index < ballArr.length; index++) { if (ballArr[index] instanceof D2RootBallSrc) continue; tempArr.push(ballArr[index]); } if (tempArr.length <= 0) { this.callback && this.callback(0); return; } xGame.common.botherArr(tempArr); for (let index = 0; index < this.leveNum; index++) { outArr.push(tempArr[index]); } this.extraScore = this.leveNum; let temp; for (let index = 0; index < outArr.length; index++) { temp = outArr[index]; temp.d3BallSrc.playIceEft(); } Laya.timer.once(2000, this, () => { for (let index = 0; index < outArr.length; index++) { temp = outArr[index]; let str = xGame.common.gameMgr.selfTurn ? "self" : "ai"; temp.setBallFunc("ice", str); } this.callback && this.callback(0); }); } runFireworks() { let allArr = this.getAllBallArr(); if (allArr.length <= 0) { this.callback && this.callback(0); return; } xGame.common.d2World.d2Gan.ui.visible = false; xGame.common.d2World.d2HelpLine.ui.visible = false; let outArr = []; let other = this.leveNum; if (other > 0) { if (allArr.length > 0) { xGame.common.botherArr(allArr); if (other >= allArr.length) other = allArr.length; for (let index = 0; index < other; index++) { outArr.push(allArr[index]); } } } xGame.common.extraMoveNum = other; this.extraScore = other; this.addRandmomFireworks(outArr); } addRandmomFireworks(outArr) { Laya.timer.once(1100, this, () => { if (outArr.length > 0) { xGame.common.d2World.openCheckStill = true; this.playedLastSkill = true; } }); xGame.soundMgr.playSound("skill_04_02"); let temp; let delay = -200; for (let index = 0; index < outArr.length; index++) { temp = outArr[index]; delay += 200; temp.d3BallSrc.runFireworks(temp, delay, (obj) => { let angle = xGame.common.randomNum(0, 360); angle = this.getFireworksAngle(obj); let linearPercent = xGame.common.randomNum(45, 80); if (!obj.destroyed) this.setLinearSpeed(angle, obj.rigy, linearPercent); }); } } getFireworksAngle(obj) { let rootBall = xGame.common.d2World.rootBall; return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y); } resetGame() { Laya.timer.clearAll(this); if (this.tweenArr) { for (let index = 0; index < this.tweenArr.length; index++) { Laya.Tween.clearAll(this.tweenArr[index]); } } this.tweenArr = null; } runGuanYu() { xGame.common.d2World.d2Gan.ui.visible = false; xGame.common.d2World.d2HelpLine.ui.visible = false; let rootBall = xGame.common.d2World.rootBall; if (rootBall.isInHole) { rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x; rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y; rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y); rootBall.showSelf(); } this.rtStarX = rootBall.gameObj.x; this.rtStarY = rootBall.gameObj.y; this.knifeTimes = 0; this.playedLastSkill = true; rootBall.forceRun = true; rootBall.rigy.type = "static"; xGame.common.d2World.openCheckStill = true; this.guanyuRandomKnife(); } guanyuRandomKnife() { let rootBall = xGame.common.d2World.rootBall; let dir = this.getRandDir(); let angle = xGame.common.getfguiRotation(dir.x, dir.y); console.log("当前angle", angle); this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle); this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle); let dis = 324; let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180); let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180); Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => { this.rtStarX = rootBall.gameObj.x; this.rtStarY = rootBall.gameObj.y; this.knifeTimes++; let skillLevel; if (xGame.common.gameMgr.selfTurn) { skillLevel = DataMgr.getBigSkillByIndex(4); } else { skillLevel = xGame.common.gameMgr.aiSkillLevelNum; } if (!skillLevel) skillLevel = 1; skillLevel += 2; if (this.knifeTimes < skillLevel) { Laya.timer.once(400, this, () => { this.guanyuRandomKnife(); }); } else { rootBall.forceRun = false; rootBall.rigy.type = "dynamic"; xGame.common.extraMoveNum = skillLevel; } })); } getRandDir() { let rootBall = xGame.common.d2World.rootBall; let allBall = this.getAllBallArr(); let target = xGame.common.getRandArrEle(allBall); this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y); return this.knifeV2; } cloneKnife(x, y, rotation) { let parent = xGame.common.d3World.knifeRoot; let prefab = xGame.common.d3World.knife; let clone = prefab.clone(); parent.addChild(clone); xGame.common.pos2to3Convert(x, y, this.knifeV3); clone.transform.localPositionX = this.knifeV3.x; clone.transform.localPositionY = 0; clone.transform.localPositionZ = this.knifeV3.z; clone.transform.localRotationEulerX = 0; clone.transform.localRotationEulerY = rotation; clone.transform.localRotationEulerZ = 0; clone.active = true; return clone; } cloneGuanYuEft(x, y, angle) { return; let parent = xGame.common.gameUI.ui.guanyuNode; let eft = new ui_guanyuAni(); eft.parent = parent; eft.x = x; eft.y = y; eft.rotation = angle; } } class ui_UIWordsList extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "UIWordsList")); } onConstruct() { this.c1 = this.getController("c1"); this.n74 = (this.getChild("n74")); this.clickNode = (this.getChild("clickNode")); this.myNode = (this.getChild("myNode")); this.n68 = (this.getChild("n68")); this.n66 = (this.getChild("n66")); this.n55 = (this.getChild("n55")); this.wordsBtn = (this.getChild("wordsBtn")); this.emotionBtn = (this.getChild("emotionBtn")); this.mybggg = (this.getChild("mybggg")); this.wordsList = (this.getChild("wordsList")); this.emotionList = (this.getChild("emotionList")); this.myRoot = (this.getChild("myRoot")); } } ui_UIWordsList.URL = "ui://isxx5ak7i4k243i"; class EmotionDisplay { constructor(index, ui) { this.ui = ui; this.index = index; this.ui.onClick(this, this.clickSelf); this.updateSelf(); } updateSelf() { let data = cfgTable.emotionData[this.index + 1]; this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon); } clickSelf() { xGame.soundMgr.playSound(xGame.common.btnClickStr); xGame.common.talkMgr.showSelfEmotion(this.index + 1); xGame.common.talkMgr.closeTalkView(); } } class WordsDisplay { constructor(index, ui) { this.ui = ui; this.index = index; this.ui.onClick(this, this.clickSelf); this.updateSelf(); } updateSelf() { let data = cfgTable.talkwordsData[this.index + 1]; this.ui.txt.text = data.msg; } clickSelf() { xGame.soundMgr.playSound(xGame.common.btnClickStr); xGame.common.talkMgr.showSelfTalk(this.index + 1); xGame.common.talkMgr.closeTalkView(); } } class UIWordsList extends UIBase { constructor() { super(); } onConstructor() { this.ui = ui_UIWordsList.createInstance(); this.contentPane = this.ui; this.isEject = false; this.addUIClick(this.ui.wordsBtn, this.openTalkList); this.addUIClick(this.ui.emotionBtn, this.openEmotionList); this.addUIClick(this.ui.clickNode, this.hide); this.initTalkList(); this.initEmotionList(); } show() { super.show(); } initTalkList() { this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false); let data = cfgTable.talkwordsData; let length = Object.keys(data).length; this.ui.wordsList.numItems = length; } initEmotionList() { this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false); let data = cfgTable.emotionData; let length = Object.keys(data).length; this.ui.emotionList.numItems = length; } renderTalkItem(index, obj) { let temp = new WordsDisplay(index, obj); } renderEmotionItem(index, obj) { let temp = new EmotionDisplay(index, obj); } openTalkList() { this.ui.c1.selectedIndex = 0; } openEmotionList() { this.ui.c1.selectedIndex = 1; } } UIWordsList.uiName = "UIWordsList"; class TalkMgr { constructor() { this.aiSpeak = true; this.emotionList = []; this.talkList = []; this.addEvent(); xGame.eventMgr.on(RESET_GAME, this, this.resetGame); this.emotionList = []; this.talkList = []; for (let k in cfgTable.emotionData) { this.emotionList.push(cfgTable.emotionData[k].id); } for (let k in cfgTable.talkwordsData) { this.talkList.push(cfgTable.talkwordsData[k].id); } } addEvent() { let ui = xGame.common.gameUI.ui; ui.wordsBtn.visible = true; ui.wordsBtn.onClick(this, this.openTalkView); ui.aiWordsBtn.visible = true; ui.aiWordsBtn.onClick(this, this.clickAIState); } openTalkView() { xGame.soundMgr.playSound(xGame.common.btnClickStr); xGame.uiMgr.Show(UIWordsList); } closeTalkView() { xGame.uiMgr.Hide(UIWordsList); } clickAIState() { xGame.soundMgr.playSound(xGame.common.btnClickStr); this.aiSpeak = !this.aiSpeak; this.changeAIState(this.aiSpeak); } changeAIState(speak) { this.aiSpeak = speak; let btn = xGame.common.gameUI.ui.aiWordsBtn; if (speak) { btn.c1.selectedIndex = 0; } else { btn.c1.selectedIndex = 1; } } showSelfTalk(wordsId) { let ui = xGame.common.gameUI.ui; ui.selfTalk.visible = true; ui.selfTalk.myNode.c1.selectedIndex = 1; ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg; ui.selfTalk.t0.play(); } showSelfEmotion(emotionId) { let ui = xGame.common.gameUI.ui; ui.selfTalk.visible = true; ui.selfTalk.myNode.c1.selectedIndex = 0; this.selfSpine && this.selfSpine.dispose(); ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren(); let spineData = cfgTable.emotionData[emotionId].spine; this.selfSpine = new SpineMgr(spineData, () => { let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2; let yy = ui.selfTalk.myNode.spineRoot.height / 2; let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 }; this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject); }); ui.selfTalk.t0.play(); } showAITalk(wordsId) { if (!this.aiSpeak) return; if (DataMgr.gameData.gameCount < 2) return; if (wordsId < 1) wordsId = this.getRandTalk(); let ui = xGame.common.gameUI.ui; ui.aiTalk.visible = true; ui.aiTalk.myNode.c1.selectedIndex = 1; ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg; ui.aiTalk.t0.play(); } getRandTalk() { let rand = xGame.tools.random(0, this.talkList.length); return this.emotionList[rand]; } getRandEmotion() { let rand = xGame.tools.random(0, this.emotionList.length); return this.emotionList[rand]; } showAIEmotion(emotionId) { if (!this.aiSpeak) return; if (DataMgr.gameData.gameCount < 2) return; if (emotionId < 1) emotionId = this.getRandEmotion(); let ui = xGame.common.gameUI.ui; ui.aiTalk.visible = true; ui.aiTalk.myNode.c1.selectedIndex = 0; this.aiSpine && this.aiSpine.dispose(); ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren(); let spineData = cfgTable.emotionData[emotionId].spine; this.aiSpine = new SpineMgr(spineData, () => { let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2; let yy = ui.aiTalk.myNode.spineRoot.height / 2; let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 }; this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject); }); ui.aiTalk.t0.play(); } resetGame() { let ui = xGame.common.gameUI.ui; ui.aiTalk.visible = false; ui.selfTalk.visible = false; this.aiSpine && this.aiSpine.dispose(); this.selfSpine && this.selfSpine.dispose(); ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren(); ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren(); this.closeTalkView(); } } class WordsMgr { constructor() { this.comboTimes = 1; this.skillTimes = 0; this.wordsSpine = new SpineMgr("yxz_jingqiu"); this.comboSpine = new SpineMgr("yxz_liangan"); this.skillSpine = new SpineMgr("yiganxqiu"); this.scoreSpine = new SpineMgr("defen"); } setClassicCombo(isInterrupt) { if (isInterrupt) { this.comboTimes = 0; } } playClassicWords(type, callback) { this.callback = callback; let aniIndex = type; let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 }; let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject; let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => { mySpine.destroy(true); this.playClassicTimes(); }); } playClassicTimes() { this.comboTimes++; if (this.comboTimes <= 1) { this.callback && this.callback(); } else { let aniIndex = this.comboTimes - 1; let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 }; let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject; let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => { mySpine.destroy(true); this.callback && this.callback(); }); } } playBigSkillTimes(times, callback) { if (times <= 0) { callback && callback(); return; } this.callback = callback; let pre = "sz_0"; let aniIndex = 0; this.getWordsImg(times, pre, () => { let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 }; let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject; let mySpine = this.skillSpine.createSpine(data, parent, 1); let r1 = ``; let r2 = ``; if (times <= 9) { r1 = `res/d2Res/${pre}${times}.png`; mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1)); aniIndex = 0; } else { r1 = `res/d2Res/${pre}${times % 10}.png`; r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`; mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1)); mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2)); aniIndex = 1; } this.skillSpine.play(data, aniIndex, false, parent, () => { mySpine.destroy(true); xGame.common.gameMgr.playSkillTips(); this.playScore(times); xGame.common.playRandomMutiBallBigSkillSound(); }, mySpine); }); } playScore(score) { let pre = "sz_"; let aniIndex = 0; this.getWordsImg(score, pre, () => { let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 }; let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject; let mySpine = this.scoreSpine.createSpine(data, parent, 1); let r1 = ``; let r2 = ``; if (score <= 9) { r1 = `res/d2Res/${pre}${score}.png`; mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1)); aniIndex = 0; } else { r1 = `res/d2Res/${pre}${score % 10}.png`; r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`; mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1)); mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2)); aniIndex = 1; } this.scoreSpine.play(data, aniIndex, false, parent, () => { mySpine.destroy(true); this.callback && this.callback(); }, mySpine); }); } getWordsImg(number, pre = "", callback) { let arr = []; if (number <= 9) { arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE }); } else { arr.push({ url: `res/d2Res/${pre}${number % 10}.png`, type: Laya.Loader.IMAGE }, { url: `res/d2Res/${pre}${Math.floor(number / 10)}.png`, type: Laya.Loader.IMAGE }); } Laya.loader.load(arr, Laya.Handler.create(this, () => { callback && callback(); })); } } class ui_UIRodMethod extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "UIRodMethod")); } onConstruct() { this.n24 = (this.getChild("n24")); this.white = (this.getChild("white")); this.dot = (this.getChild("dot")); this.sureBtn = (this.getChild("sureBtn")); this.n20 = (this.getChild("n20")); this.n21 = (this.getChild("n21")); this.n22 = (this.getChild("n22")); this.n23 = (this.getChild("n23")); this.n5 = (this.getChild("n5")); this.n14 = (this.getChild("n14")); this.t0 = this.getTransition("t0"); } } ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv"; class UIRodMethod extends UIBase { constructor() { super(); this.isPressd = false; } onConstructor() { this.ui = ui_UIRodMethod.createInstance(); this.contentPane = this.ui; this.addUIClick(this.ui.sureBtn, this.closeSelf); this.moveDir = new Laya.Vector2(); this.moveDest = new Laya.Vector2(); this.centerPos = new Laya.Vector2(); xGame.common.uiRodMethod = this; } show() { super.show(); xGame.common.gameMgr.gamePause = true; this.openPressDotEvent(); this.gameRod = xGame.common.gameUI.ui.rodMethodNode; this.centerPos.x = this.ui.white.x; this.centerPos.y = this.ui.white.y; this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x; this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y; this.setDot(); } setDot() { this.ui.dot.x = this.moveDest.x; this.ui.dot.y = this.moveDest.y; } closeSelf() { xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x; xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y; this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x; this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y; xGame.common.gameMgr.gamePause = false; this.hide(); } openPressDotEvent() { this.closePressDotEvent(); this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown); this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown); this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown); this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown); this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown); this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown); } closePressDotEvent() { this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown); this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown); this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown); this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown); this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown); this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown); } onDown(e) { if (e.type == Laya.Event.MOUSE_DOWN) this.isPressd = true; else if (e.type == Laya.Event.MOUSE_UP && this.isPressd) this.isPressd = false; if (!this.isPressd) return; this.moveDest.x = e.stageX; this.moveDest.y = e.stageY; let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos); if (dis > 6724) { this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir); this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest); } this.setDot(); } resetRod() { this.ui.dot.x = this.ui.white.x; this.ui.dot.y = this.ui.white.y; this.gameRod.dot.x = this.gameRod.bg.x; this.gameRod.dot.y = this.gameRod.bg.y; xGame.common.rodOffest.x = 0; xGame.common.rodOffest.y = 0; } } UIRodMethod.uiName = "UIRodMethod"; class UIGame extends UIBase { constructor() { super(); this.powerNum = 0; this.isD3Inited = false; this.isPrePlay = false; this.isMoveRod = false; this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 }; this.rulerDis = 20; this.rulerOffset = 0; } onConstructor() { this.ui = ui_UIGame.createInstance(); this.contentPane = this.ui; this.ui.x += xGame.common.sysOffestNum; this.ui.border.alpha = xGame.common.showDebug ? 1 : 0; this.isEject = false; xGame.common.gameUI = this; this.initSelf(); } isTurnSelf() { if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) { return true; } } initSelf() { let topUI = this.ui.topNode; topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false); topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false); this.barInfo = {}; this.barInfo.curY = 0; this.barInfo.height = this.ui.powerNode.height; this.barInfo.showStarY = this.ui.powerNode.showImg.y; this.barInfo.powerStartY = this.ui.powerNode.y; xGame.common.aiPlayer = new AIPlayer(); xGame.common.gameMgr = new GameMgr(); xGame.common.skillMgr = new SkillMgr(); xGame.common.wordsMgr = new WordsMgr(); xGame.common.talkMgr = new TalkMgr(); xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => { console.log("加载经典模式表情文件chenggon !"); }); xGame.common.awardSpine = new SpineMgr("jinbi", () => { console.log("挑战模式奖励模式spine加载成功!"); }); xGame.eventMgr.off(RESET_GAME, this, this.resetGame); xGame.eventMgr.on(RESET_GAME, this, this.resetGame); this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick); this.addUIClick(this.ui.returnBtn, this.returnHome); this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn); this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn); this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn); } getGanZiImg() { let index = DataMgr.getCurBallRod(); let data = cfgTable.ballrodData[index + 1]; let gan_url = xGame.common.getGameIconUrl(data.img); console.log('zh:getGanZiImg gan_url==' + gan_url); this.ui.powerNode.showImg.url = gan_url; console.log('zh:修改杆子图标O K'); } returnHome() { let tips = "Are you sure to exit the game?"; let woman = "Boss, why don't you play for a while longer?"; xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame); } addRodMethodClick() { if (this.isTurnSelf()) { xGame.uiMgr.Show(UIRodMethod); } } clickHelpLineBtn(force = false) { if (!this.isTurnSelf()) return; xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => { if (success) { xGame.common.longHelpLine = true; xGame.common.d2World.getHelpLine(); Moyu.sendDataEvent("guideNum"); } else { } }); } renderSelfDisplayBalls(index, target) { let str = "q" + xGame.common.gameMgr.selfBallArr[index]; target.myImg.url = xGame.common.getGameIconUrl(str); } renderAIDisplayBalls(index, target) { let str = "q" + xGame.common.gameMgr.aiBallArr[index]; target.myImg.url = xGame.common.getGameIconUrl(str); ; } updateMode() { if (xGame.common.gameMode == GameMode.classic) { this.ui.topNode.scoreNode.visible = false; } else if (xGame.common.gameMode == GameMode.bigMove) { this.ui.topNode.scoreNode.visible = true; } } show() { super.show(); console.log("zh:uigame show AADD"); this.ui.alpha = 0; this.updateSelf(); xGame.common.gameMgr.gamePause = false; xGame.common.gameUI.ui.blackAni.visible = false; xGame.common.gameUI.ui.whiteAni.visible = false; this.ui.powerEft.visible = false; this.ui.colorNode.visible = false; this.updateHead(); let curUse = DataMgr.getCurBallRod(); console.log('zh:UIGame 选择的球杆234 = ' + curUse); this.getGanZiImg(); } updateSelf() { if (xGame.common.gameMode == GameMode.classic) { this.ui.c1.selectedIndex = 0; this.ui.topNode.middleNode.c1.selectedIndex = 0; this.ui.topNode.middleNode.visible = true; this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + ""; } else if (xGame.common.gameMode == GameMode.bigMove) { this.ui.c1.selectedIndex = 0; this.ui.topNode.middleNode.c1.selectedIndex = 1; this.ui.topNode.middleNode.visible = false; let max = xGame.cfgMgr.getMaxBigMoveLength(); let rand = xGame.common.randomNum(1, max); let guide = DataMgr.getSkillGuide(); if (guide == 0) rand = 1; xGame.common.bigMoveLevelIndex = rand; } else if (xGame.common.gameMode == GameMode.placeBall) { let data = cfgTable.placeballData[xGame.common.placeBallCurLevel]; this.ui.c1.selectedIndex = 1 + data.type; this.ui.alpha = 1; this.startGame(); } this.updateMode(); this.initD3world(); this.initD2world(); } startGame() { this.ui.snowNode.visible = Math.random() <= 0.1; this.ui.d2Node.visible = false; xGame.common.d3World.d3Hand.gameObj.active = false; xGame.common.d3World.tableSrc.init(); xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06; this.cameraViewChange(() => { xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0; switch (xGame.common.gameMode) { case GameMode.classic: xGame.common.d3World.d3Hand.gameObj.active = true; this.playPutBallD3Ani(); break; case GameMode.bigMove: this.enterGame(); Laya.timer.once(500, this, () => { this.ui.topNode.middleNode.visible = true; this.ui.topNode.middleNode.t0.play(); }); break; case GameMode.placeBall: this.enterGame(); break; default: break; } }); PlatMgr.showBanner(false); } enterGame() { this.ui.d2Node.visible = true; xGame.common.d3World.d3Hand.gameObj.active = false; xGame.common.showOneCamera("mainCamera"); Moyu.recordGame(30, true); if (!this.isPrePlay) { this.isPrePlay = true; xGame.common.d3World.prePlayEft(); } xGame.common.gameMgr.gameReady(); this.openAllEvent(); this.ui.snowNode.visible = false; let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1; this.ui.helpBtn.visible = condition; } showHelpLineGuide() { let longGuide = DataMgr.getGuideHelpLine(); if (xGame.common.gameMode == GameMode.classic && longGuide == 0) { this.ui.helpBtn.visible = true; this.ui.guideNode.visible = true; } } setTurnAlpha(alpha) { this.ui.keduNode.alpha = alpha; this.ui.ganNode.alpha = alpha; this.ui.rodMethodNode.alpha = alpha; this.ui.helpBtn.alpha = alpha ? 1 : 0; } cameraViewChange(callback) { xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06; let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform; xGame.common.showOneCamera("visitAngle"); cameraSrc.localRotationEulerY = 180; cameraSrc.localRotationEulerZ = 0; Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => { Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => { callback && callback(); })); })); } playPutBallD3Ani() { xGame.common.showOneCamera("mainCamera"); let handSrc = xGame.common.d3World.d3Hand; handSrc.gameObj.active = true; handSrc.transform.localPositionZ = 3; Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => { Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => { handSrc.gameObj.active = false; this.enterGame(); }), 400); })); } updateHead() { let user = Moyu.getUserInfo(); this.ui.topNode.selfNameTxt.text = user.nickName; xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80); let aiData = xGame.cfgMgr.getRandomUserInfo(); if (DataMgr.getSkillGuide() < 1) { this.ui.topNode.aiNameTxt.text = 'billiards'; this.ui.topNode.aiHeadLoader.url = 'res/icon.png'; } else { this.ui.topNode.aiNameTxt.text = aiData.name; let randNo = Math.floor(Math.random() * 10) + 1; this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png'; } } initD2world() { let node = this.ui.d2Root.displayObject; let src = node.getComponent(D2World); if (!src) { xGame.common.d2World = node.addComponent(D2World); } xGame.common.d2World.initSelf(); } initD3world() { if (this.isD3Inited) return; this.isD3Inited = true; let scene3D = xGame.common.d3Scene; this.ui.d3Root.displayObject.addChild(scene3D); scene3D.active = true; xGame.common.d3World.tableSrc.setBorderPos(); } onRootMove(e) { let rootBall = xGame.common.d2World.rootBall; this.ui.moveNode.x = e.x; this.ui.moveNode.y = e.y; rootBall.gameObj.x = e.x; rootBall.gameObj.y = e.y; rootBall.d3BallSrc.setTransPos(e.x, e.y); } aiRootMove(move) { if (move) this.hideBallUI(); else { this.showBallUI(); xGame.common.d2World.getHelpLine(); } } aiForce(type, force = 0) { this.pressTarget = PressType.powerNode; if (type == 1) this.onEventUp({ force: true }); else if (type == 2) this.onEventMove({ stageY: force, force: true }); } onEventPress(e) { if (e.stopPropagation) e.stopPropagation(); if (!this.isTurnSelf()) return; let target = e.target; switch (target) { case this.ui.myPowerNode.displayObject: this.pressTarget = PressType.powerNode; this.barInfo.curY = e.stageY; this.updateBarInfo(); break; case this.ui.moveNode.displayObject: this.pressTarget = PressType.moveNode; this.hideBallUI(); this.eventObj.curX = this.ui.moveNode.x; this.eventObj.curY = this.ui.moveNode.y; this.ui.moveNode.finger.visible = false; this.eventObj.lastX = e.stageX; this.eventObj.lastY = e.stageY; break; case this.ui.rulerClickNode.displayObject: this.pressTarget = PressType.rulerNode; this.eventObj.lastY = e.stageY; break; case this.ui.d2Root.displayObject: this.pressTarget = PressType.d2Root; this.eventObj.lastX = e.stageX; this.eventObj.lastY = e.stageY; this.eventObj.starX = e.stageX; this.eventObj.starY = e.stageY; this.eventObj.curX = 0; this.eventObj.curY = 0; xGame.common.d2World.d2Gan.setGanLastInfo(); this.rulerOffset = 0; break; default: break; } } onEventMove(e) { if (e.stopPropagation) e.stopPropagation(); if (e && e.force) { } else { if (!this.isTurnSelf()) return; } switch (this.pressTarget) { case PressType.powerNode: this.barInfo.curY = e.stageY; this.updateBarInfo(); this.isMoveRod = true; break; case PressType.moveNode: let rootBall = xGame.common.d2World.rootBall; let radius = rootBall.gameObj.width / 2; let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX; let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY; let border = xGame.common.d2World.borderRect; if (curX <= border.x + radius) curX = border.x + radius; else if (curX >= border.x + border.width - radius) curX = border.x + border.width - radius; if (curY <= border.y + radius) curY = border.y + radius; else if (curY >= border.y + border.height - radius) curY = border.y + border.height - radius; if (xGame.common.gameMgr.isOpenBall) { if (curX >= border.x + border.openBallW - radius) curX = border.x + border.openBallW - radius; } this.ui.moveNode.x = curX; this.ui.moveNode.y = curY; rootBall.gameObj.x = curX; rootBall.gameObj.y = curY; rootBall.d3BallSrc.setTransPos(curX, curY); this.isMoveRod = true; break; case PressType.rulerNode: let yy = e.stageY - this.eventObj.lastY; this.eventObj.lastY = e.stageY; let ruler1 = this.ui.rulerNode.img1; let ruler2 = this.ui.rulerNode.img2; ruler1.y += yy; ruler2.y += yy; this.rulerOffset += yy; if (Math.abs(this.rulerOffset) >= this.rulerDis) { this.rulerOffset = 0; xGame.soundMgr.playSound("inch", 1, 10); } xGame.common.d2World.d2Gan.rotateSelf(yy, true); let h = ruler1.height; this.checkGuide(); this.isMoveRod = true; if (ruler1.y >= h) { ruler1.y = -h; ruler2.y = 0; return; } else if (ruler1.y <= -h) { ruler1.y = h; ruler2.y = 0; return; } if (ruler2.y >= h) { ruler2.y = -h; ruler1.y = 0; return; } else if (ruler2.y <= -h) { ruler2.y = h; ruler1.y = 0; return; } break; case PressType.d2Root: this.eventObj.curX = e.stageX; this.eventObj.curY = e.stageY; let offset = this.checkRodMoveDir(); xGame.common.d2World.d2Gan.rotateSelf(offset); this.eventObj.lastX = e.stageX; this.eventObj.lastY = e.stageY; break; default: break; } } onEventUp(e) { if (e.stopPropagation) e.stopPropagation(); if (e && e.force) { } else { if (!this.isTurnSelf()) return; } switch (this.pressTarget) { case PressType.powerNode: this.ui.powerNode.value = 0; this.ui.powerNode.showImg.y = this.barInfo.showStarY; this.ui.powerTxt.text = ""; if (this.powerNum > 0) { xGame.eventMgr.event(BALL_SHOOT); xGame.common.d2World.shoot(this.powerNum); xGame.common.d2World.d2Gan.shoot(); xGame.common.d2World.d2HelpLine.shoot(); this.finishGuide(); this.ui.powerEft.visible = false; this.ui.colorNode.visible = false; let ganStr = ""; if (this.powerNum <= 30) { ganStr = "gan_30"; } else if (this.powerNum <= 60) { ganStr = "gan_50"; } else { ganStr = "gan_80"; } xGame.soundMgr.playSound(ganStr); } break; case PressType.moveNode: let rootBall = xGame.common.d2World.rootBall; let lastX = xGame.common.gameMgr.lastRootBallPos.x; let lastY = xGame.common.gameMgr.lastRootBallPos.y; let isIntersect = this.judgeBallIntersect(); if (isIntersect) { this.ui.moveNode.x = lastX; this.ui.moveNode.y = lastY; rootBall.gameObj.x = lastX; rootBall.gameObj.y = lastY; rootBall.d3BallSrc.setTransPos(lastX, lastY); xGame.uiMgr.Show(UIMsg, "Incorrect placement position"); } else { xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x; xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y; } this.showBallUI(); this.ui.moveNode.finger.visible = true; xGame.common.d2World.getHelpLine(); break; case PressType.rulerNode: break; case PressType.d2Root: let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2); if (dis <= 25) { this.moveToClickDot(e); } break; default: break; } this.pressTarget = -1; } checkGuide() { let guide = DataMgr.getSkillGuide(); if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) { xGame.common.guideStep++; xGame.common.gameUI.ui.guide2.visible = false; xGame.common.gameUI.ui.guide3.visible = true; } } finishGuide() { let guide = DataMgr.getSkillGuide(); if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) { xGame.common.guideStep = 10; this.closeAllGuide(); console.log('zh: 新手引导完毕'); JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete"); } } closeAllGuide() { xGame.common.gameUI.ui.guide1.visible = false; xGame.common.gameUI.ui.guide2.visible = false; xGame.common.gameUI.ui.guide3.visible = false; } updateBarInfo() { let star = this.ui.powerNode.y; let rate = (this.barInfo.curY - star) / this.barInfo.height; if (rate >= 1) rate = 1; if (rate <= 0) rate = 0; this.powerNum = Math.ceil(rate * 100); this.ui.powerNode.value = this.powerNum; this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height; this.ui.colorNode.value = this.powerNum; this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height; this.ui.powerEft.visible = this.powerNum != 0; this.ui.colorNode.visible = this.powerNum != 0; this.ui.powerTxt.text = this.powerNum + ""; xGame.common.d2World.d2Gan.storagePower(this.powerNum); } forceCancel() { this.ui.powerNode.value = 0; this.ui.powerNode.showImg.y = this.barInfo.showStarY; this.ui.powerTxt.text = ""; } checkRodMoveDir() { let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x; let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y; if (tempX >= 0 && tempY <= 0) { return this.checkDir(); } else if (tempX < 0 && tempY < 0) { return this.checkDir(1, -1); } else if (tempX < 0 && tempY > 0) { return this.checkDir(-1, -1); } else { return this.checkDir(-1, 1); } } checkDir(flagX = 1, flagY = 1) { let offsetX = this.eventObj.curX - this.eventObj.lastX; let offsetY = this.eventObj.curY - this.eventObj.lastY; if (offsetY == 0) { return offsetX * flagX; } if (offsetX == 0) { return offsetY * flagY; } let angle = offsetY / offsetX; if (Math.abs(angle) >= 1) { return offsetY * flagY; } else { return offsetX * flagX; } } judgeBallIntersect() { let rootBall = xGame.common.d2World.rootBall; let ballArr = xGame.common.d2World.ballArr; let radius = rootBall.gameObj.width / 2; let temp; let isIntersect = false; for (let index = 0; index < ballArr.length; index++) { temp = ballArr[index]; if (temp.number == rootBall.number) continue; isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius; if (isIntersect) { break; } } return isIntersect; } hideBallUI() { let d2Gan = xGame.common.d2World.d2Gan; if (!d2Gan.ui.isDisposed) d2Gan.ui.visible = false; let d2Help = xGame.common.d2World.d2HelpLine; if (!d2Help.ui.isDisposed) d2Help.ui.visible = false; let rootBall = xGame.common.d2World.rootBall; if (!rootBall.destroyed) { rootBall.gameObj.active = false; } } showBallUI() { let d2Gan = xGame.common.d2World.d2Gan; if (!d2Gan.ui.isDisposed) d2Gan.ui.visible = true; let d2Help = xGame.common.d2World.d2HelpLine; if (!d2Help.ui.isDisposed) d2Help.ui.visible = true; let rootBall = xGame.common.d2World.rootBall; if (!rootBall.destroyed) { rootBall.gameObj.active = true; } } moveToClickDot(e) { if (!this.isMoveRod && !xGame.common.clickedBall) { let root = xGame.common.d2World.rootBall.gameObj; let xx = e.stageX - xGame.common.sysOffestNum; let yy = e.stageY; let x = xx - root.x; let y = yy - root.y; let angle = xGame.common.getfguiRotation(x, y); xGame.common.d2World.d2Gan.ui.rotation = angle; xGame.common.d2World.getHelpLine(); } this.isMoveRod = false; xGame.common.clickedBall = false; } openAllEvent() { this.closeAllEvent(); this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress); this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress); this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress); this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress); this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove); this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp); this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp); } closeAllEvent() { this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress); this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress); this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress); this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress); this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove); this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp); this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp); } resetGame() { this.closeAllEvent(); this.hideBallUI(); xGame.common.gameMgr.gamePause = true; } } UIGame.uiName = "UIGame"; class UIAddProp extends UIBase { constructor() { super(); this.curType = ""; } onConstructor() { this.ui = ui_UIAddProp.createInstance(); this.contentPane = this.ui; this.isEject = false; this.addUIClick(this.ui.closeBtn, this.closeSelf); this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]); this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]); this.updateUI(); this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond); this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond); this.addUIClick(this.ui.myNode.node6, this.openPutBallView); this.addUIClick(this.ui.myNode.node3, this.videoGetCoin); this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]); this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]); } show(type) { super.show(); this.curType = type == 0 ? "coin" : "diamond"; this.switchBtn(""); this.ui.t0.play(); this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1; PlatMgr.showInsert(true); } closeSelf() { this.hide(); } updateUI() { let data = cfgTable.moneyData; let temp; let obj; for (const key in data) { temp = data[key]; obj = this.ui.myNode["node" + key]; if (parseInt(key) <= 2) { obj.diamondTxt.text = "+" + temp.num; } else { obj.coinTxt.text = temp.num; obj.diamondTxt.text = temp.get.split('_')[1]; } } this.updateDiamondShare(); } updateDiamondShare() { let data = DataMgr.getShareDiamondTimes(); if (data >= xGame.common.maxShareDiamondTimes) { this.ui.myNode.node1.shareTxt.text = "Available Tomorrow"; this.ui.myNode.node1.touchable = false; xGame.uiMgr.Show(UIMsg, "Come back tomorrow"); } else { this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`; this.ui.myNode.node1.touchable = true; } } switchBtn(type) { if (type == "") type = this.curType; else { if (this.curType == type) { return; } else { this.curType = type; } } if (type == "coin") { this.ui.myNode.coinBtn.c1.selectedIndex = 0; this.ui.myNode.diamondBtn.c1.selectedIndex = 1; this.ui.myNode.coinBtn.displayObject.zOrder = 10; this.ui.myNode.diamondBtn.displayObject.zOrder = 9; this.ui.myNode.c1.selectedIndex = 0; } else { this.ui.myNode.coinBtn.c1.selectedIndex = 1; this.ui.myNode.diamondBtn.c1.selectedIndex = 0; this.ui.myNode.coinBtn.displayObject.zOrder = 9; this.ui.myNode.diamondBtn.displayObject.zOrder = 10; this.ui.myNode.c1.selectedIndex = 1; } } convertCoin(index) { let data = cfgTable.moneyData[index]; let coinNum = data.num; let str = data.get.split('_')[1]; let needDiamond = parseInt(str); if (DataMgr.diamondEnough(needDiamond)) { DataMgr.setDiamond(-needDiamond); xGame.common.playObjFlyAnim(coinNum, Prop.coin); xGame.uiMgr.Show(UIMsg, "Exchange successful!"); } else { xGame.uiMgr.Show(UIMsg, "Diamond shortage"); this.switchBtn("diamond"); } } videoGetDiamond() { console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond'); if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) { } else { console.log('zh:AD 失败,直接发放奖励'); this.qjff_AD_for_uiAddProp_videoGetDiamond(); } } qjff_AD_for_uiAddProp_videoGetDiamond() { let num = cfgTable.moneyData[2].num; xGame.common.playObjFlyAnim(num, Prop.diamond); this.closeSelf(); } videoGetCoin() { console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin'); if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) { } else { console.log('zh:AD 失败,直接发放奖励'); this.qjff_AD_for_uiAddProp_videoGetCoin(); } } qjff_AD_for_uiAddProp_videoGetCoin() { xGame.common.playObjFlyAnim(2000, Prop.coin); this.closeSelf(); } shareGetDiamond() { let times = DataMgr.getShareDiamondTimes(); if (times >= xGame.common.maxShareDiamondTimes) { console.log('zh: 233333333333 maxShareDiamondTimes'); xGame.uiMgr.Show(UIMsg, "Come back tomorrow"); } else { console.log('zh:33333333333333ad'); console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond'); if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) { } else { console.log('zh:AD 失败,直接发放奖励'); this.qjff_AD_for_uiAddProp_shareGetDiamond(); } } } qjff_AD_for_uiAddProp_shareGetDiamond() { let diamond = xGame.common.randomNum(50, 100); xGame.common.playObjFlyAnim(diamond, Prop.diamond); DataMgr.setShareDiamondTimes(1); this.updateDiamondShare(); } openPutBallView() { let end = xGame.uiMgr.getUI(UIGameEnd); let skill = xGame.uiMgr.getUI(UISkill); let level = xGame.uiMgr.getUI(UILevelDisplay); let uigame = xGame.uiMgr.getUI(UIGame); if (end && !end.isHide) { xGame.uiMgr.Hide(UIGameEnd); xGame.uiMgr.Show(UIMain); } if (skill && !skill.isHide) xGame.uiMgr.Hide(UISkill); if (uigame && !uigame.isHide) xGame.uiMgr.Hide(UIGame); if (level && !level.isHide) { } else { xGame.uiMgr.Show(UILevelDisplay); } this.closeSelf(); } } UIAddProp.uiName = "UIAddProp"; class MoneyNode { constructor(ui) { this.leftTime = 0; this.ui = ui; this.ui.addCoinBtn.onClick(this, this.addCoin); this.ui.addDiamondBtn.onClick(this, this.addDiamond); this.ui.addPowerBtn.onClick(this, this.addPower); this.ui.c1.selectedIndex = 1; xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange); xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange); xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange); xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime); this.coinChange(); this.diamondChange(); this.powerChange(); } addPower() { xGame.soundMgr.playSound(xGame.common.btnClickStr); xGame.uiMgr.Show(UIPower); } powerChange() { let powerNum = DataMgr.getPower(); this.ui.powerTxt.text = powerNum + ""; } checkPowerTime() { let cur = new Date().getTime(); let last = DataMgr.getPowerTime(); if (last == 0) { last = cur; DataMgr.setPowerTime(cur); } let power = DataMgr.getPower(); let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000)); Laya.timer.clearAll(this); if (power >= xGame.common.natureMaxPower) { this.ui.powerTimeTxt.text = ""; DataMgr.setPowerTime(cur); return; } if (power + offset >= xGame.common.natureMaxPower) { DataMgr.setPower(xGame.common.natureMaxPower, false); this.ui.powerTimeTxt.text = ""; DataMgr.setPowerTime(cur); } else { if (offset > 0) { DataMgr.setPower(offset); DataMgr.setPowerTime(cur); } let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000); this.leftTime = xGame.common.powerRecoverNum - time; if (this.leftTime <= 0) this.leftTime = 0; this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime); Laya.timer.loop(1000, this, this.updatePowerTime); } } updatePowerTime() { this.leftTime -= 1; this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime); if (this.leftTime <= 0) { this.checkPowerTime(); } } coinChange() { this.ui.coinTxt.text = DataMgr.getCoin() + ""; } diamondChange() { this.ui.diamondTxt.text = DataMgr.getDiamond() + ""; } addCoin() { xGame.soundMgr.playSound(xGame.common.btnClickStr); Moyu.sendDataEvent("AddCoinBtn"); xGame.uiMgr.Show(UIAddProp, 0); } addDiamond() { xGame.soundMgr.playSound(xGame.common.btnClickStr); Moyu.sendDataEvent("AddDiamondBtn"); xGame.uiMgr.Show(UIAddProp, 1); } } class UIDraw extends UIBase { constructor() { super(); this.curKey = 0; } onConstructor() { this.ui = ui_UIDraw.createInstance(); this.contentPane = this.ui; this.isEject = false; this.moneyNode = new MoneyNode(this.ui.moneyNode); this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf); this.addUIClick(this.ui.drawBtn, this.startDraw); this.initDraw(); this.initUI(); this.ui.myNode.flashNode.c1.selectedIndex = 1; if (Moyu.isKs) this.ui.closeNode.closeBtn.x += 100; } show() { super.show(); this.ui.t0.play(); this.playSecretaryIdle(); this.updateDraw(); this.checkFree(); if (PlatMgr.bannerDelay > 0) { this.ui.closeNode.closeBtn.visible = false; Laya.timer.once(PlatMgr.bannerDelay, this, () => { this.ui.closeNode.closeBtn.visible = true; }); } PlatMgr.showRateBanner(); } hide() { Laya.timer.clearAll(this); super.hide(); } checkFree() { let isFree = DataMgr.getDailyfreeDrawTimes(); this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1; } initDraw() { this.drawObj = []; let data = cfgTable.drawData; let temp; let weight = 0; for (const key in data) { temp = data[key]; weight += temp.weight; this.drawObj.push(weight); } this.allWeight = weight; } initUI() { let data = cfgTable.drawData; let temp; let img; let txt; for (const key in data) { temp = data[key]; img = this.ui.myNode.rotNode["img" + key]; txt = this.ui.myNode.rotNode["txt" + key]; img.url = xGame.common.getGameIconUrl(temp.icon); txt.visible = true; if (temp.award > 2) { img.rotation = 0; txt.text = cfgTable.ballrodData[temp.award - 1].name; } else { img.rotation = temp.rotation; txt.text = temp.num; } } } getCurkey() { let rand = Math.random() * this.allWeight; let temp; for (let index = 0; index < this.drawObj.length - 1; index++) { temp = this.drawObj[index]; if (index == 0) { if (rand < temp) { return index + 1; } } else { if (rand >= temp && rand < this.drawObj[index + 1]) { return index + 1; } } } return 2; } startDraw() { let freeTimes = DataMgr.getDailyfreeDrawTimes(); if (freeTimes > 0) { this.beginDraw(); DataMgr.setDailyfreeDrawTimes(0); this.checkFree(); } else { if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) { } else { console.log('zh:AD 失败,直接发放奖励'); this.qjff_chouJiang(); } } } qjff_chouJiang() { this.beginDraw(); } beginDraw() { this.ui.myNode.flashNode.c1.selectedIndex = 0; this.ui.drawBtn.touchable = false; this.curKey = this.getCurkey(); console.log("当前key", this.curKey); let cell = 60; let lap = 3; let angle = cell * (this.curKey - 1) + lap * 360; let target = this.ui.myNode.rotNode; target.rotation = 0; Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => { console.log("旋转完成"); this.ui.drawBtn.touchable = true; this.getAward(); })); } getAward() { let data = cfgTable.drawData[this.curKey]; let temp = new AwardType(); temp.type = data.award; temp.num = data.num; xGame.common.getAward([temp], () => { DataMgr.setDrawTimes(1); this.updateDraw(); this.ui.myNode.flashNode.c1.selectedIndex = 1; }); } updateDraw() { let drawTimes = DataMgr.getDrawTimes(); let awardTimes = DataMgr.getDrawAwardTimes(); if (Math.floor(drawTimes / 3) > awardTimes) { this.ui.extraNode.boxBtn.t0.play(null, -1); this.ui.extraNode.boxBtn.touchable = true; this.ui.extraNode.tipsTxt.text = "3/3"; this.ui.extraNode.barNode.width = 265; this.getExtraAward(); } else { this.ui.extraNode.boxBtn.t0.stop(); this.ui.extraNode.boxBtn.touchable = false; this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`; this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3; } let data = cfgTable.drawData[1]; if (awardTimes == 0) { this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon); this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name; this.ui.myNode.rotNode.img1.rotation = 0; } else { let award = data.nextid; this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]); this.ui.myNode.rotNode.txt1.text = award[1]; this.ui.myNode.rotNode.img1.rotation = 0; } } getExtraAward() { let drawTimes = DataMgr.getDrawTimes(); let awardTimes = DataMgr.getDrawAwardTimes(); let data = cfgTable.drawData[1]; let award = new AwardType(); if (awardTimes == 0) { award.num = data.num; award.type = data.award; xGame.common.getAward([award], () => { let all = Math.floor(drawTimes / 3); DataMgr.setDrawAwardTimes(all); this.updateDraw(); }); } else { award.num = parseInt(data.nextid[1]); award.type = parseInt(data.nextid[0]); xGame.common.getAward([award], () => { let all = Math.floor(drawTimes / 3); DataMgr.setDrawAwardTimes(all); this.updateDraw(); }); } } closeSelf() { this.hide(); } playSecretaryIdle() { let parent = this.ui.secretary.displayObject; parent.destroyChildren(); let xx = this.ui.secretary.width / 2; let yy = this.ui.secretary.height; let scale = xGame.common.getSecretaryScale(); let data = { x: xx, y: yy, scaleX: scale, scaleY: scale }; xGame.common.secretary.play(data, 0, true, parent); } } UIDraw.uiName = "UIDraw"; class ui_UIFlyEft extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "UIFlyEft")); } onConstruct() { this.n0 = (this.getChild("n0")); this.n1 = (this.getChild("n1")); this.n2 = (this.getChild("n2")); this.n3 = (this.getChild("n3")); this.n4 = (this.getChild("n4")); this.n5 = (this.getChild("n5")); this.n6 = (this.getChild("n6")); this.n7 = (this.getChild("n7")); this.iconNode = (this.getChild("iconNode")); this.txt = (this.getChild("txt")); this.txtNode = (this.getChild("txtNode")); } } ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf"; class UIFlyEft extends UIBase { constructor() { super(); this.max = 8; this.delay = 0; } onConstructor() { this.ui = ui_UIFlyEft.createInstance(); this.contentPane = this.ui; this.isEject = false; this.isMuti = true; this.ui.x += xGame.common.sysOffestNum; } getArrPos() { if (this.iconPos && this.iconPos.length > 0) return; this.iconPos = []; let temp; for (let index = 0; index < this.max; index++) { temp = this.ui["n" + index]; this.iconPos.push([temp.x, temp.y]); } } show(stPos, edPos, num, type, callback) { super.show(); this.parent.setChildIndex(this, this.parent.numChildren - 1); this.getArrPos(); this.updateUI(type); this.updatePos(); this.runFly(edPos, callback); this.runWorlds(stPos, num); } updateUI(type) { let temp; let str; for (let index = 0; index < this.max; index++) { temp = this.ui["n" + index]; str = this.getIconStr(type); temp.url = xGame.common.getGameIconUrl(str); } } getIconStr(type) { switch (type) { case Prop.diamond: return "ty_zs"; case Prop.coin: return "ty_jb"; default: break; } } updatePos() { let temp; for (let index = 0; index < this.max; index++) { temp = this.ui["n" + index]; temp.x = this.iconPos[index][0]; temp.y = this.iconPos[index][1]; } } runFly(endPos, callback) { let all = 0; let temp; for (let index = 0; index < this.max; index++) { temp = this.ui["n" + index]; temp.visible = true; Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => { temp.visible = false; all++; if (all >= this.max) { callback && callback(); } }), 20 * index); } } runWorlds(stPos, num) { let str = "+" + num; this.ui.txt.text = str; let starX = stPos.x; let starY = stPos.y + 50; this.ui.txt.x = starX; this.ui.txt.y = starY; this.ui.txt.visible = true; this.ui.txt.alpha = 1; Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => { Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => { this.ui.txt.visible = false; this.hide(); })); })); } } UIFlyEft.uiName = "UIFlyEft"; class Common { constructor() { this.convertNum = 0.025; this.VectorUp = new Laya.Vector3(0, 1, 0); this.scaleV3One = new Laya.Vector3(); this.scaleV3Two = new Laya.Vector3(); this.posV4 = new Laya.Vector4(); this.showDebug = false; this.openGuide = true; this.rodOffest = new Laya.Vector2(0, 0); this.rodAngle = 0; this.gameMode = GameMode.classic; this.bigMoveLevelIndex = 1; this.bigMoveNeedCoin = 1000; this.classicNiceNeddCoin = 1000; this.passAwardCoin = 2000; this.classicRoomType = 1; this.maxPower = 20; this.natureMaxPower = 5; this.videoPower = 2; this.powerRecoverNum = 900; this.curPlayerSkillType = 0; this.isNewDay = false; this.clickedBall = false; this.placeBallCurLevel = 0; this.placeBallStarNum = 0; this.longHelpLine = false; this.maxShareDiamondTimes = 3; this.guideStep = 0; this.temSelfLevel = 0; this.extraMoveNum = 0; this.curRankID = 0; this.rankID = { normalStar: 12000, wxStar: 12001 }; this.skillNameList = ["Surging Break", "Skyfall Shot", "Frost Lock"]; this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"]; this.btnClickStr = "buttonclick"; this.maxSkillLevel = 10; this.upSkillLevel = false; this.gameStartTime = 0; this._sysOffestNum = 0; this.angleV2 = new Laya.Vector2(); this.rootV = new Laya.Vector2(0, 1); this.tempDir1 = new Laya.Vector2(); this.tempDir2 = new Laya.Vector2(); this.ballSize = 33; this.stPos = new Laya.Point(); this.edPos = new Laya.Point(); Common._instance = this; window["common"] = this; } static getInstance() { if (!this._instance) { this._instance = new Common(); } return this._instance; } get sysOffestNum() { if (this._sysOffestNum == 0) { this._sysOffestNum = (Laya.stage.width - 1334) / 2; } return this._sysOffestNum; } testShader() { let test = new LightShader(); test.texture = "res/d3Res/ballTexture/ball1.png"; Laya.stage.addChild(test); } playScale(node) { Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => { Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => { })); })); } setGroup(colli, ...group) { let out = 0; for (let index = 0; index < group.length; index++) { if (index == 0) { out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`]; } else { out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`]; } } colli.collisionGroup = out; } setCanGroupWith(colli, ...group) { let out = 0; for (let index = 0; index < group.length; index++) { if (index == 0) { out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`]; } else { out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`]; } } colli.canCollideWith = out; } loadPrefab(name, callback) { Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => { let prefab = new Laya.Prefab(); prefab.json = obj; let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab); callback && callback(img); })); } pos2to3Convert(x, y, d3Pos) { x = x + this.sysOffestNum; d3Pos.setValue(x, y, 0); let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos); if (success) { } else { console.error("转换出错了。。。。。。。。"); } } scale2to3Convert(num) { this.scaleV3One.setValue(0, 0, 0); this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One); this.scaleV3Two.setValue(0, num, 0); this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two); let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x); return outNum; } pos3to2Convert(d3Pos) { this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4); d3Pos.x = this.posV4.x / Laya.stage.clientScaleX; d3Pos.y = this.posV4.y / Laya.stage.clientScaleY; d3Pos.x -= this.sysOffestNum; } scale3to2Convert(num) { let scale = this.scale2to3Convert(1); let d2Out = num / scale; return d2Out; } getCollider(type, restitution = 0.9, density = 10) { let colli; if (type == "box") colli = new Laya.BoxCollider(); else colli = new Laya.CircleCollider(); colli.friction = 0; colli.restitution = restitution; colli.density = density; return colli; } getRigbody() { let rigy = new Laya.RigidBody(); rigy.bullet = true; rigy.allowRotation = false; rigy.allowSleep = false; rigy.gravityScale = 0; return rigy; } getfguiRotation(x, y) { this.angleV2.setValue(x, y); Laya.Vector2.normalize(this.angleV2, this.angleV2); let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI; if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) { angle = -angle; } return 180 + angle; } getAngle(x, y) { this.angleV2.setValue(x, y); Laya.Vector2.normalize(this.angleV2, this.angleV2); let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI; return angle; } randomNum(a, b) { return a + Math.floor((b - a + 1) * Math.random()); } getRandArrEle(arr) { return arr[Math.floor(arr.length * Math.random())]; } getSign(val) { return val >= 0 ? 1 : -1; } botherArr(arr) { let times = arr.length + 2; let length = arr.length; let a; let b; let temp; for (let index = 0; index < times; index++) { a = Math.floor(Math.random() * length); b = Math.floor(Math.random() * length); temp = arr[a]; arr[a] = arr[b]; arr[b] = temp; } } getGameIconUrl(id) { return "ui://game/" + id; } getComponentUrl(id) { return "ui://game/" + id; } getAnimation() { } judgeSkillType(type = SkillType.highSpace) { if (this.gameMode == GameMode.classic) return; let gameMgr = this.gameMgr; if (gameMgr.selfTurn) { if (gameMgr.selfCurSkill == type) { return true; } } else { if (gameMgr.aiCurSkill == type) { return true; } } } ballColliHole(collider) { if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) { xGame.common.gameMgr.isFirstInGame = false; xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number); } collider.owner.mySrc.checkWrongBall(); } getArrMaxEle(arr) { let max = -Infinity; for (let index = 0; index < arr.length; index++) { max = Math.max(arr[index], max); } return max; } getArrMinEle(arr) { let min = Infinity; for (let index = 0; index < arr.length; index++) { min = Math.min(arr[index], min); } return min; } playRandomMutiBallBigSkillSound() { if (Math.random() <= 0.5) return; let rand = this.randomNum(1, 6); let str = "ganfa0" + rand; xGame.soundMgr.playSound(str); } showOneCamera(type) { let object = xGame.common.d3World.cameraObj; for (const key in object) { if (Object.prototype.hasOwnProperty.call(object, key)) { object[key].init(); object[key].owner.active = key == type; } } } checkBallOverBorder(x, y) { let radius = 17; let condition = this._checkBorder(x + radius, y) || this._checkBorder(x - radius, y) || this._checkBorder(x, y + radius) || this._checkBorder(x, y - radius); if (condition) { return true; } } _checkBorder(x, y) { let borderRect = this.d2World.borderRect; let xOffest = 20; let yOffest = 20; if (y <= borderRect.y - yOffest) { return true; } if (y >= borderRect.y + borderRect.height + yOffest) { return true; } if (x <= borderRect.x - xOffest) { return true; } if (x >= borderRect.x + borderRect.width + xOffest) { return true; } } initWeight(cfg) { let allCfgData = { data: {}, allWeightNum: 0 }; let weightCfg = allCfgData.data; let weight = 0; for (const key in cfg) { weightCfg[key] = {}; weightCfg[key].id = cfg[key].id; weightCfg[key].minWeight = weight; weight += cfg[key].weight; weightCfg[key].maxWeight = weight; } allCfgData.allWeightNum = weight; return allCfgData; } getRandomWeightData(cfg) { let weightCfg = cfg.data; let allWeightNum = cfg.allWeightNum; let rand = Math.floor(Math.random() * allWeightNum); for (const key in weightCfg) { if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) { return weightCfg[key]; } } return weightCfg[1]; } showGirlTalkPop(wordsIndex, node, msgNode) { node.visible = true; msgNode.text = cfgTable.secretaryData[wordsIndex].msg; node.t0.play(Laya.Handler.create(this, () => { node.visible = false; })); } stopGirlPop(node) { node.t0.stop(); node.visible = false; } createHead(loader, url, size = 107) { if (Laya.Browser.name == "Browser") { loader.url = url; return; } else { console.log('zh:url=', url); loader.url = url; } } addTestCoin(num) { DataMgr.setCoin(num); } addTestDiamond(num) { DataMgr.setDiamond(num); } addTestSkill() { DataMgr.setBigSkill(0, 99); DataMgr.setBigSkill(1, 99); DataMgr.setBigSkill(2, 99); } playClassicEmotion(number, x, y) { if (this.gameMode == GameMode.bigMove) return; let randIndex = this.randomNum(0, 2); let data = { x: x, y: y, scaleX: 1, scaleY: 1 }; let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject; if (this.gameMgr.selfTurn) { if (this.gameMgr.selfBallArr.indexOf(number) > -1) { this.classicEmotionSpine.play(data, randIndex, false, parent); } else { if (this.gameMgr.aiBallArr.indexOf(number) > -1) { } else { if (number == this.gameMgr.blackNum) { if (this.gameMgr.selfBallArr.length == 0) { this.classicEmotionSpine.play(data, randIndex, false, parent); } else { } } else { this.classicEmotionSpine.play(data, randIndex, false, parent); } } } } else { if (this.gameMgr.aiBallArr.indexOf(number) > -1) { this.classicEmotionSpine.play(data, randIndex, false, parent); } else { if (this.gameMgr.selfBallArr.indexOf(number) > -1) { } else { if (number == this.gameMgr.blackNum) { if (this.gameMgr.aiBallArr.length == 0) { this.classicEmotionSpine.play(data, randIndex, false, parent); } else { } } else { this.classicEmotionSpine.play(data, randIndex, false, parent); } } } } } playHappySound(number) { if (this.gameMode != GameMode.classic) return; if (number == 8) return; let play = false; if (this.gameMgr.selfTurn) { if (this.gameMgr.ensureBallType) { if (this.gameMgr.selfBallArr.indexOf(number) > -1) { play = true; } } else { play = true; } } else { if (this.gameMgr.ensureBallType) { if (this.gameMgr.aiBallArr.indexOf(number) > -1) { play = true; } } else { play = true; } } if (play) xGame.soundMgr.playSound("applause"); } destroyClassicEmotion() { if (this.gameMode == GameMode.bigMove) return; let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject; parent.destroyChildren(); } playAwardSpine(x, y) { let data = { x: x, y: y, scaleX: 1, scaleY: 1 }; let parent = this.gameUI.ui.awardSpineNode.displayObject; this.awardSpine.play(data, 0, false, parent); } destroyAwardSpine() { let parent = this.gameUI.ui.awardSpineNode.displayObject; parent.destroyChildren(); } isBlock(bx, by, hx, hy, except = null) { this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1); let balls = xGame.common.d2World.ballArr; let outArr = []; for (let index = 0; index < balls.length; index++) { let obj = balls[index]; if (obj.number == 0) continue; if (obj == except) continue; let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by); this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2); let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2); if (num >= 1) num = 1; if (num < 0) continue; let gap = Math.sin(Math.acos(num)) * dis; if (gap < this.ballSize) { outArr.push({ dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y), disHon: Math.cos(Math.acos(num)) * dis, disVer: Math.sin(Math.acos(num)) * dis, src: balls[index], dir: this.tempDir1 }); } } if (outArr.length > 0) { outArr.sort((a, b) => { return a.dis - b.dis; }); return outArr[0]; } } AngleBetween(vector1, vector2) { let rad = Math.acos(Laya.Vector2.dot(vector1, vector2)); return rad * (180 / Math.PI); } getSecretaryScale() { if (this.secretary.spineName == "mishu") { return 1.28; } else { return 1.024; } } signAwardContainsRod(arr) { let temp; for (let index = 0; index < arr.length; index++) { temp = arr[index].split('-')[0]; if (parseInt(temp) > 2) { return true; } } } judgeSameDay() { let lastTime = DataMgr.getSignTime(); let curTime = new Date().getTime(); if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) { return true; } return false; } getAward(arr, callback) { let showTriple = arr[0].type <= 2; xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => { let temp; for (let index = 0; index < arr.length; index++) { temp = arr[index]; switch (temp.type) { case 1: this.playObjFlyAnim(temp.num, temp.type); break; case 2: this.playObjFlyAnim(temp.num, temp.type); break; case 3: case 4: case 5: case 6: DataMgr.setBallRod(temp.type - 2, 1); DataMgr.setCurBallRod(temp.type - 2); break; default: break; } } callback && callback(watchVideo); }); } getMoneyNode() { let moneyNode; let sign = xGame.uiMgr.getUI(UISign); let draw = xGame.uiMgr.getUI(UIDraw); let end = xGame.uiMgr.getUI(UIGameEnd); let skill = xGame.uiMgr.getUI(UISkill); if (sign && !sign.isHide) moneyNode = sign.ui.moneyNode; if (draw && !draw.isHide) moneyNode = draw.ui.moneyNode; if (end && !end.isHide) moneyNode = end.ui.moneyNode; if (skill && !skill.isHide) moneyNode = skill.ui.moneyNode; let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide); let main = xGame.uiMgr.getUI(UIMain); if (condition1 && main && !main.isHide) { moneyNode = main.ui.moneyNode; } return moneyNode; } playObjFlyAnim(num, type, callback = null) { this.stPos.x = Laya.stage.width / 2; this.stPos.y = Laya.stage.height / 2; let moneyNode = this.getMoneyNode(); switch (type) { case Prop.diamond: this.edPos.x = moneyNode.x + moneyNode.diamondImg.x; this.edPos.y = moneyNode.y + moneyNode.diamondImg.y; moneyNode.diamondImg.displayObject.localToGlobal(this.edPos); this.edPos.x /= 2; this.edPos.y /= 2; break; case Prop.coin: this.edPos.x = moneyNode.x + moneyNode.coinImg.x; this.edPos.y = moneyNode.y + moneyNode.coinImg.y; moneyNode.coinImg.displayObject.localToGlobal(this.edPos); this.edPos.x /= 2; this.edPos.y /= 2; break; default: break; } xGame.soundMgr.playSound("coinbag"); xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => { switch (type) { case Prop.diamond: DataMgr.setDiamond(num); break; case Prop.coin: DataMgr.setCoin(num); break; default: break; } callback && callback(); }); } autoPopUIView() { let arr = []; let sign = this.judgeSameDay() ? false : true; if (sign) arr.push("sign"); let draw = DataMgr.getDailyfreeDrawTimes() > 0; if (draw) arr.push("draw"); if (arr.length <= 0) return; let str = this.getRandArrEle(arr); switch (str) { case "sign": xGame.uiMgr.Show(UISign); break; case "draw": xGame.uiMgr.Show(UIDraw); break; default: break; } } getMSTime(time) { let min = Math.floor(time / 60); let sec = Math.floor((time - min * 60)); if (sec < 10) sec = "0" + sec; if (min < 10) min = "0" + min; return `${min}:${sec}`; } testPower() { DataMgr.setPower(0, false); } getAllStarNum() { let data = DataMgr.getPlaceBallLevelList(); let out = 0; for (let index = 0; index < data.length; index++) { out += data[index].star; } return out; } recoverCameraView() { Laya.timer.once(900, this, () => { xGame.common.showOneCamera("mainCamera"); if (xGame.common.gameUI.ui.d2Node.alpha == 0) { xGame.common.gameUI.ui.d2Node.alpha = 1; xGame.common.gameUI.ui.border.alpha = 0; if (Laya.physicsTimer.scale < 1) { Laya.physicsTimer.scale = 1; } } }); } getClassicLevel() { let successTimes = DataMgr.getClassicTimes(); let needKey = ""; let lastKey = ""; let cfg = cfgTable.classictimesData; let data; for (const key in cfg) { data = cfg[key]; if (successTimes <= data.times) { needKey = key; } lastKey = key; } if (needKey == "") needKey = lastKey; return cfg[needKey]; } } Common._instance = null; class ui_Component92 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component92")); } onConstruct() { this.n0 = (this.getChild("n0")); } } ui_Component92.URL = "ui://isxx5ak710hfv49p"; class ui_Component129 extends fgui.GProgressBar { static createInstance() { return (fgui.UIPackage.createObject("game", "Component129")); } onConstruct() { this.bar_v = (this.getChild("bar_v")); this.n84 = (this.getChild("n84")); } } ui_Component129.URL = "ui://isxx5ak7748uv4mp"; class ui_Component130 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component130")); } onConstruct() { this.ani = (this.getChild("ani")); this.t0 = this.getTransition("t0"); } } ui_Component130.URL = "ui://isxx5ak7748uv4mq"; class ui_powerEft extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "powerEft")); } onConstruct() { this.ani = (this.getChild("ani")); this.n88 = (this.getChild("n88")); this.n89 = (this.getChild("n89")); } } ui_powerEft.URL = "ui://isxx5ak79u9xv4mr"; class ui_PutBallLevelDisplay extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay")); } onConstruct() { this.c1 = this.getController("c1"); this.n2 = (this.getChild("n2")); this.n22 = (this.getChild("n22")); this.n23 = (this.getChild("n23")); this.n15 = (this.getChild("n15")); this.challenge = (this.getChild("challenge")); this.n17 = (this.getChild("n17")); this.n3 = (this.getChild("n3")); this.starNode = (this.getChild("starNode")); this.levelTxt = (this.getChild("levelTxt")); this.n14 = (this.getChild("n14")); this.n19 = (this.getChild("n19")); this.n20 = (this.getChild("n20")); this.n21 = (this.getChild("n21")); this.special = (this.getChild("special")); } } ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476"; class ui_Component79 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component79")); } onConstruct() { this.c1 = this.getController("c1"); this.n7 = (this.getChild("n7")); this.n8 = (this.getChild("n8")); this.n9 = (this.getChild("n9")); this.n10 = (this.getChild("n10")); this.n11 = (this.getChild("n11")); this.n12 = (this.getChild("n12")); } } ui_Component79.URL = "ui://isxx5ak7avag477"; class ui_Component80 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component80")); } onConstruct() { this.n0 = (this.getChild("n0")); this.n1 = (this.getChild("n1")); this.myList = (this.getChild("myList")); this.t0 = this.getTransition("t0"); } } ui_Component80.URL = "ui://isxx5ak7avag47b"; class ui_SignNormal extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "SignNormal")); } onConstruct() { this.c1 = this.getController("c1"); this.n7 = (this.getChild("n7")); this.n15 = (this.getChild("n15")); this.titleTxt = (this.getChild("titleTxt")); this.n8 = (this.getChild("n8")); this.myIcon = (this.getChild("myIcon")); this.numTxt = (this.getChild("numTxt")); this.n12 = (this.getChild("n12")); this.n13 = (this.getChild("n13")); this.n17 = (this.getChild("n17")); this.n14 = (this.getChild("n14")); } } ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv"; class ui_Button_reg extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "Button_reg")); } onConstruct() { this.button = this.getController("button"); this.n6 = (this.getChild("n6")); this.n4 = (this.getChild("n4")); } } ui_Button_reg.URL = "ui://isxx5ak7bobav57y"; class ui_screenNode extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "screenNode")); } onConstruct() { this.n9 = (this.getChild("n9")); this.screenImg = (this.getChild("screenImg")); } } ui_screenNode.URL = "ui://isxx5ak7brgy3ux"; class ui_GetAwrad_com1 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "GetAwrad_com1")); } onConstruct() { this.n38 = (this.getChild("n38")); this.n39 = (this.getChild("n39")); this.n40 = (this.getChild("n40")); this.t0 = this.getTransition("t0"); this.t1 = this.getTransition("t1"); } } ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh"; class ui_GetAwrad_com2 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "GetAwrad_com2")); } onConstruct() { this.n39 = (this.getChild("n39")); this.n40 = (this.getChild("n40")); this.t0 = this.getTransition("t0"); } } ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj"; class ui_Component128 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component128")); } onConstruct() { this.n38 = (this.getChild("n38")); this.n40 = (this.getChild("n40")); } } ui_Component128.URL = "ui://isxx5ak7brwtv4mk"; class ui_Component100_1 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component100_1")); } onConstruct() { this.myNode = (this.getChild("myNode")); this.t0 = this.getTransition("t0"); } } ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml"; class ui_Component142 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component142")); } onConstruct() { this.n41 = (this.getChild("n41")); this.n42 = (this.getChild("n42")); } } ui_Component142.URL = "ui://isxx5ak7c50vv4y6"; class ui_main_guang extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "main_guang")); } onConstruct() { this.n1 = (this.getChild("n1")); this.n2 = (this.getChild("n2")); this.n3 = (this.getChild("n3")); this.n4 = (this.getChild("n4")); this.n5 = (this.getChild("n5")); this.n6 = (this.getChild("n6")); this.n8 = (this.getChild("n8")); this.t0 = this.getTransition("t0"); } } ui_main_guang.URL = "ui://isxx5ak7cj92v4o3"; class ui_try_com1 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "try_com1")); } onConstruct() { this.c1 = this.getController("c1"); this.n0 = (this.getChild("n0")); this.n2 = (this.getChild("n2")); this.cancelBtn = (this.getChild("cancelBtn")); this.videoBtn = (this.getChild("videoBtn")); this.n9 = (this.getChild("n9")); this.n24 = (this.getChild("n24")); this.titleTxt = (this.getChild("titleTxt")); this.n32 = (this.getChild("n32")); this.n29 = (this.getChild("n29")); this.n36 = (this.getChild("n36")); this.txtTime = (this.getChild("txtTime")); this.t0 = this.getTransition("t0"); } } ui_try_com1.URL = "ui://isxx5ak7cj92v4o5"; class ui_try_com2 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "try_com2")); } onConstruct() { this.skillicon = (this.getChild("skillicon")); this.n35 = (this.getChild("n35")); this.n31 = (this.getChild("n31")); this.n32 = (this.getChild("n32")); this.n33 = (this.getChild("n33")); this.n34 = (this.getChild("n34")); } } ui_try_com2.URL = "ui://isxx5ak7cj92v4o6"; class ui_try_com3 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "try_com3")); } onConstruct() { this.n33 = (this.getChild("n33")); this.n34 = (this.getChild("n34")); this.n35 = (this.getChild("n35")); this.t0 = this.getTransition("t0"); } } ui_try_com3.URL = "ui://isxx5ak7cj92v4o9"; class ui_huihe1 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "huihe1")); } onConstruct() { this.n0 = (this.getChild("n0")); this.n1 = (this.getChild("n1")); this.t0 = this.getTransition("t0"); } } ui_huihe1.URL = "ui://isxx5ak7d1pb47h"; class ui_huihe2 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "huihe2")); } onConstruct() { this.n0 = (this.getChild("n0")); this.n1 = (this.getChild("n1")); this.t0 = this.getTransition("t0"); } } ui_huihe2.URL = "ui://isxx5ak7d1pb47k"; class ui_Component143 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component143")); } onConstruct() { this.n3 = (this.getChild("n3")); this.n4 = (this.getChild("n4")); this.n5 = (this.getChild("n5")); this.n6 = (this.getChild("n6")); this.n7 = (this.getChild("n7")); this.n8 = (this.getChild("n8")); this.n9 = (this.getChild("n9")); this.n10 = (this.getChild("n10")); this.t0 = this.getTransition("t0"); } } ui_Component143.URL = "ui://isxx5ak7dt0av4yn"; class ui_dh_jingbi2 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "dh_jingbi2")); } onConstruct() { this.n0 = (this.getChild("n0")); this.n1 = (this.getChild("n1")); this.n2 = (this.getChild("n2")); this.n3 = (this.getChild("n3")); this.n4 = (this.getChild("n4")); this.n5 = (this.getChild("n5")); this.n6 = (this.getChild("n6")); this.n8 = (this.getChild("n8")); this.n10 = (this.getChild("n10")); this.t0 = this.getTransition("t0"); } } ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0"; class ui_dh_jingbi2_1 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "dh_jingbi2_1")); } onConstruct() { this.n1 = (this.getChild("n1")); this.n4 = (this.getChild("n4")); this.t0 = this.getTransition("t0"); } } ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1"; class ui_dh_jingbi3 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "dh_jingbi3")); } onConstruct() { this.n0 = (this.getChild("n0")); this.n1 = (this.getChild("n1")); this.n2 = (this.getChild("n2")); this.n3 = (this.getChild("n3")); this.n4 = (this.getChild("n4")); this.n5 = (this.getChild("n5")); this.n6 = (this.getChild("n6")); this.n8 = (this.getChild("n8")); this.n10 = (this.getChild("n10")); this.t0 = this.getTransition("t0"); } } ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2"; class ui_dh_jingbi3_1 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "dh_jingbi3_1")); } onConstruct() { this.n3 = (this.getChild("n3")); this.n1 = (this.getChild("n1")); this.t0 = this.getTransition("t0"); } } ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3"; class ui_hb_jinbi1 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "hb_jinbi1")); } onConstruct() { this.n20 = (this.getChild("n20")); this.n25 = (this.getChild("n25")); this.coinTxt = (this.getChild("coinTxt")); this.n28 = (this.getChild("n28")); this.n32 = (this.getChild("n32")); this.n38 = (this.getChild("n38")); this.n45 = (this.getChild("n45")); this.getTips = (this.getChild("getTips")); this.n39 = (this.getChild("n39")); this.diamondTxt = (this.getChild("diamondTxt")); this.n41 = (this.getChild("n41")); this.n42 = (this.getChild("n42")); this.n46 = (this.getChild("n46")); this.n47 = (this.getChild("n47")); this.n48 = (this.getChild("n48")); this.t0 = this.getTransition("t0"); } } ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd"; class ui_hb_jinbi2 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "hb_jinbi2")); } onConstruct() { this.n20 = (this.getChild("n20")); this.n25 = (this.getChild("n25")); this.coinTxt = (this.getChild("coinTxt")); this.n28 = (this.getChild("n28")); this.n32 = (this.getChild("n32")); this.n38 = (this.getChild("n38")); this.n39 = (this.getChild("n39")); this.diamondTxt = (this.getChild("diamondTxt")); this.n41 = (this.getChild("n41")); this.n42 = (this.getChild("n42")); this.n43 = (this.getChild("n43")); this.n44 = (this.getChild("n44")); this.n45 = (this.getChild("n45")); this.t0 = this.getTransition("t0"); } } ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge"; class ui_hb_jinbi3 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "hb_jinbi3")); } onConstruct() { this.n20 = (this.getChild("n20")); this.n25 = (this.getChild("n25")); this.coinTxt = (this.getChild("coinTxt")); this.n28 = (this.getChild("n28")); this.n32 = (this.getChild("n32")); this.n38 = (this.getChild("n38")); this.n39 = (this.getChild("n39")); this.diamondTxt = (this.getChild("diamondTxt")); this.n41 = (this.getChild("n41")); this.n42 = (this.getChild("n42")); this.n43 = (this.getChild("n43")); this.n44 = (this.getChild("n44")); this.n45 = (this.getChild("n45")); this.t0 = this.getTransition("t0"); } } ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf"; class ui_Component104 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component104")); } onConstruct() { this.c1 = this.getController("c1"); this.n12 = (this.getChild("n12")); this.coinBtn = (this.getChild("coinBtn")); this.diamondBtn = (this.getChild("diamondBtn")); this.node3 = (this.getChild("node3")); this.node4 = (this.getChild("node4")); this.node5 = (this.getChild("node5")); this.node1 = (this.getChild("node1")); this.node2 = (this.getChild("node2")); this.node6 = (this.getChild("node6")); this.t0 = this.getTransition("t0"); } } ui_Component104.URL = "ui://isxx5ak7ehtov4gg"; class ui_Component105 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "Component105")); } onConstruct() { this.c1 = this.getController("c1"); this.n49 = (this.getChild("n49")); this.n18 = (this.getChild("n18")); this.n46 = (this.getChild("n46")); this.n48 = (this.getChild("n48")); } } ui_Component105.URL = "ui://isxx5ak7ehtov4gh"; class ui_Component106 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "Component106")); } onConstruct() { this.c1 = this.getController("c1"); this.n49 = (this.getChild("n49")); this.n18 = (this.getChild("n18")); this.n46 = (this.getChild("n46")); this.n48 = (this.getChild("n48")); } } ui_Component106.URL = "ui://isxx5ak7ehtov4gj"; class ui_hb_zs1 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "hb_zs1")); } onConstruct() { this.c1 = this.getController("c1"); this.n20 = (this.getChild("n20")); this.n21 = (this.getChild("n21")); this.n26 = (this.getChild("n26")); this.n27 = (this.getChild("n27")); this.shareTxt = (this.getChild("shareTxt")); this.n32 = (this.getChild("n32")); this.n38 = (this.getChild("n38")); this.n39 = (this.getChild("n39")); this.n44 = (this.getChild("n44")); this.diamondTxt = (this.getChild("diamondTxt")); this.n41 = (this.getChild("n41")); this.n45 = (this.getChild("n45")); this.n47 = (this.getChild("n47")); this.n48 = (this.getChild("n48")); this.randTxt = (this.getChild("randTxt")); this.n50 = (this.getChild("n50")); this.t0 = this.getTransition("t0"); } } ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk"; class ui_dh_zs1 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "dh_zs1")); } onConstruct() { this.n10 = (this.getChild("n10")); this.n9 = (this.getChild("n9")); this.n1 = (this.getChild("n1")); this.n2 = (this.getChild("n2")); this.n3 = (this.getChild("n3")); this.n4 = (this.getChild("n4")); this.n5 = (this.getChild("n5")); this.n6 = (this.getChild("n6")); this.n8 = (this.getChild("n8")); this.n11 = (this.getChild("n11")); this.t0 = this.getTransition("t0"); } } ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm"; class ui_dh_zs1_1 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "dh_zs1_1")); } onConstruct() { this.n3 = (this.getChild("n3")); this.n1 = (this.getChild("n1")); this.t0 = this.getTransition("t0"); } } ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn"; class ui_hb_zs2 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "hb_zs2")); } onConstruct() { this.n20 = (this.getChild("n20")); this.n21 = (this.getChild("n21")); this.n26 = (this.getChild("n26")); this.n27 = (this.getChild("n27")); this.n32 = (this.getChild("n32")); this.n38 = (this.getChild("n38")); this.n39 = (this.getChild("n39")); this.n44 = (this.getChild("n44")); this.diamondTxt = (this.getChild("diamondTxt")); this.n41 = (this.getChild("n41")); this.n45 = (this.getChild("n45")); this.t0 = this.getTransition("t0"); } } ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu"; class ui_hb_zs3 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "hb_zs3")); } onConstruct() { this.n20 = (this.getChild("n20")); this.n21 = (this.getChild("n21")); this.n26 = (this.getChild("n26")); this.n27 = (this.getChild("n27")); this.n32 = (this.getChild("n32")); this.n38 = (this.getChild("n38")); this.n47 = (this.getChild("n47")); this.t0 = this.getTransition("t0"); } } ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv"; class ui_dh_zs2 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "dh_zs2")); } onConstruct() { this.n10 = (this.getChild("n10")); this.n9 = (this.getChild("n9")); this.n1 = (this.getChild("n1")); this.n2 = (this.getChild("n2")); this.n3 = (this.getChild("n3")); this.n4 = (this.getChild("n4")); this.n5 = (this.getChild("n5")); this.n6 = (this.getChild("n6")); this.n8 = (this.getChild("n8")); this.n11 = (this.getChild("n11")); this.t0 = this.getTransition("t0"); } } ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw"; class ui_dh_zs2_1 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "dh_zs2_1")); } onConstruct() { this.n3 = (this.getChild("n3")); this.n1 = (this.getChild("n1")); this.t0 = this.getTransition("t0"); } } ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx"; class ui_dh_zs3 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "dh_zs3")); } onConstruct() { this.n10 = (this.getChild("n10")); this.n9 = (this.getChild("n9")); this.n1 = (this.getChild("n1")); this.n2 = (this.getChild("n2")); this.n3 = (this.getChild("n3")); this.n4 = (this.getChild("n4")); this.n5 = (this.getChild("n5")); this.n6 = (this.getChild("n6")); this.n8 = (this.getChild("n8")); this.n11 = (this.getChild("n11")); this.t0 = this.getTransition("t0"); } } ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy"; class ui_dh_zs3_1 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "dh_zs3_1")); } onConstruct() { this.n3 = (this.getChild("n3")); this.n1 = (this.getChild("n1")); this.t0 = this.getTransition("t0"); } } ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz"; class ui_Component107 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component107")); } onConstruct() { this.n18 = (this.getChild("n18")); this.n19 = (this.getChild("n19")); this.n20 = (this.getChild("n20")); this.n21 = (this.getChild("n21")); this.n22 = (this.getChild("n22")); this.levelTxt = (this.getChild("levelTxt")); this.t0 = this.getTransition("t0"); } } ui_Component107.URL = "ui://isxx5ak7ehtov4h0"; class ui_box_com1 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "box_com1")); } onConstruct() { this.n14 = (this.getChild("n14")); this.n6 = (this.getChild("n6")); this.t0 = this.getTransition("t0"); } } ui_box_com1.URL = "ui://isxx5ak7erstv4nl"; class ui_box_com2 extends fgui.GProgressBar { static createInstance() { return (fgui.UIPackage.createObject("game", "box_com2")); } onConstruct() { this.bg0 = (this.getChild("bg0")); this.bg = (this.getChild("bg")); this.bar = (this.getChild("bar")); this.n7 = (this.getChild("n7")); this.n8 = (this.getChild("n8")); this.n10 = (this.getChild("n10")); this.n11 = (this.getChild("n11")); this.n12 = (this.getChild("n12")); } } ui_box_com2.URL = "ui://isxx5ak7erstv4nt"; class ui_box_com4 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "box_com4")); } onConstruct() { this.n8 = (this.getChild("n8")); this.t0 = this.getTransition("t0"); } } ui_box_com4.URL = "ui://isxx5ak7erstv4nx"; class ui_box_com3 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "box_com3")); } onConstruct() { this.n2 = (this.getChild("n2")); this.n3 = (this.getChild("n3")); this.n4 = (this.getChild("n4")); this.n5 = (this.getChild("n5")); this.t0 = this.getTransition("t0"); this.t1 = this.getTransition("t1"); } } ui_box_com3.URL = "ui://isxx5ak7erstv4ny"; class ui_Component97 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component97")); } onConstruct() { this.c1 = this.getController("c1"); this.n46 = (this.getChild("n46")); this.diamondNode = (this.getChild("diamondNode")); this.coinNode = (this.getChild("coinNode")); this.t0 = this.getTransition("t0"); } } ui_Component97.URL = "ui://isxx5ak7g1giv4eb"; class ui_Component98 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "Component98")); } onConstruct() { this.n8 = (this.getChild("n8")); this.n40 = (this.getChild("n40")); } } ui_Component98.URL = "ui://isxx5ak7g1giv4ed"; class ui_Component28_11 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "Component28_11")); } onConstruct() { this.c1 = this.getController("c1"); this.n12 = (this.getChild("n12")); this.n17 = (this.getChild("n17")); this.n13 = (this.getChild("n13")); this.diamondTxt = (this.getChild("diamondTxt")); this.n15 = (this.getChild("n15")); this.n16 = (this.getChild("n16")); } } ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh"; class ui_Component58_11 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component58_11")); } onConstruct() { this.c1 = this.getController("c1"); this.n23 = (this.getChild("n23")); this.n41 = (this.getChild("n41")); this.myList = (this.getChild("myList")); this.n_qiuGan = (this.getChild("n_qiuGan")); this.n_daoju = (this.getChild("n_daoju")); this.djList = (this.getChild("djList")); this.t0 = this.getTransition("t0"); } } ui_Component58_11.URL = "ui://isxx5ak7g1giv4el"; class ui_Component100 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component100")); } onConstruct() { this.c1 = this.getController("c1"); this.n75 = (this.getChild("n75")); this.n76 = (this.getChild("n76")); this.n80 = (this.getChild("n80")); this.txt = (this.getChild("txt")); this.spineRoot = (this.getChild("spineRoot")); } } ui_Component100.URL = "ui://isxx5ak7g1giv4ex"; class ui_Component101 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component101")); } onConstruct() { this.c1 = this.getController("c1"); this.n36 = (this.getChild("n36")); this.n35 = (this.getChild("n35")); this.n33 = (this.getChild("n33")); this.n34 = (this.getChild("n34")); } } ui_Component101.URL = "ui://isxx5ak7g1giv4ey"; class ui_Component53 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component53")); } onConstruct() { this.n0 = (this.getChild("n0")); this.n1 = (this.getChild("n1")); this.n2 = (this.getChild("n2")); this.n3 = (this.getChild("n3")); this.n4 = (this.getChild("n4")); this.n5 = (this.getChild("n5")); this.n6 = (this.getChild("n6")); this.n7 = (this.getChild("n7")); this.n8 = (this.getChild("n8")); this.n9 = (this.getChild("n9")); this.n10 = (this.getChild("n10")); this.n11 = (this.getChild("n11")); this.n12 = (this.getChild("n12")); this.n13 = (this.getChild("n13")); this.n14 = (this.getChild("n14")); this.n15 = (this.getChild("n15")); this.n16 = (this.getChild("n16")); this.n19 = (this.getChild("n19")); this.n20 = (this.getChild("n20")); this.n21 = (this.getChild("n21")); this.n22 = (this.getChild("n22")); this.n23 = (this.getChild("n23")); this.n24 = (this.getChild("n24")); this.n25 = (this.getChild("n25")); this.n26 = (this.getChild("n26")); this.n27 = (this.getChild("n27")); this.n28 = (this.getChild("n28")); this.n29 = (this.getChild("n29")); this.n30 = (this.getChild("n30")); this.n31 = (this.getChild("n31")); this.n32 = (this.getChild("n32")); this.n33 = (this.getChild("n33")); this.n34 = (this.getChild("n34")); this.n35 = (this.getChild("n35")); this.t0 = this.getTransition("t0"); } } ui_Component53.URL = "ui://isxx5ak7g1ie43u"; class ui_Component58 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component58")); } onConstruct() { this.n23 = (this.getChild("n23")); this.n41 = (this.getChild("n41")); this.n8 = (this.getChild("n8")); this.skillList = (this.getChild("skillList")); this.t0 = this.getTransition("t0"); } } ui_Component58.URL = "ui://isxx5ak7gg0z445"; class ui_Component59 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component59")); } onConstruct() { this.n3 = (this.getChild("n3")); this.msgTxt = (this.getChild("msgTxt")); this.t0 = this.getTransition("t0"); } } ui_Component59.URL = "ui://isxx5ak7gg0z446"; class ui_RulerNode extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "RulerNode")); } onConstruct() { this.n6 = (this.getChild("n6")); this.n4 = (this.getChild("n4")); this.img1 = (this.getChild("img1")); this.img2 = (this.getChild("img2")); } } ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8"; class ui_Component108 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component108")); } onConstruct() { this.n19 = (this.getChild("n19")); this.t0 = this.getTransition("t0"); } } ui_Component108.URL = "ui://isxx5ak7gpvxv4ha"; class ui_Component63 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component63")); } onConstruct() { this.n66 = (this.getChild("n66")); this.n56 = (this.getChild("n56")); this.n63 = (this.getChild("n63")); this.n65 = (this.getChild("n65")); this.t0 = this.getTransition("t0"); } } ui_Component63.URL = "ui://isxx5ak7h657452"; class ui_topNode extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "topNode")); } onConstruct() { this.selfProgress = (this.getChild("selfProgress")); this.aiProgress = (this.getChild("aiProgress")); this.selfKuang = (this.getChild("selfKuang")); this.aiKuang = (this.getChild("aiKuang")); this.selfHeadLoader = (this.getChild("selfHeadLoader")); this.aiHeadLoader = (this.getChild("aiHeadLoader")); this.n33 = (this.getChild("n33")); this.n34 = (this.getChild("n34")); this.selfNameTxt = (this.getChild("selfNameTxt")); this.aiNameTxt = (this.getChild("aiNameTxt")); this.selfBallList = (this.getChild("selfBallList")); this.aiBallList = (this.getChild("aiBallList")); this.middleNode = (this.getChild("middleNode")); this.selfScoreTxt = (this.getChild("selfScoreTxt")); this.aiScoreTxt = (this.getChild("aiScoreTxt")); this.scoreNode = (this.getChild("scoreNode")); this.selfTips = (this.getChild("selfTips")); this.aiTips = (this.getChild("aiTips")); } } ui_topNode.URL = "ui://isxx5ak7hkrz3qu"; class ui_selfProgress extends fgui.GProgressBar { static createInstance() { return (fgui.UIPackage.createObject("game", "selfProgress")); } onConstruct() { this.n3 = (this.getChild("n3")); this.bar = (this.getChild("bar")); } } ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf"; class ui_aiProgress extends fgui.GProgressBar { static createInstance() { return (fgui.UIPackage.createObject("game", "aiProgress")); } onConstruct() { this.n3 = (this.getChild("n3")); this.bar = (this.getChild("bar")); } } ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh"; class ui_ballDisplay extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "ballDisplay")); } onConstruct() { this.myImg = (this.getChild("myImg")); } } ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk"; class ui_moveNode extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "moveNode")); } onConstruct() { this.n8 = (this.getChild("n8")); this.finger = (this.getChild("finger")); } } ui_moveNode.URL = "ui://isxx5ak7hkrz3t9"; class ui_cancelBtn extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "cancelBtn")); } onConstruct() { this.c1 = this.getController("c1"); this.n0 = (this.getChild("n0")); this.n1 = (this.getChild("n1")); } } ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm"; class ui_shareBtn extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "shareBtn")); } onConstruct() { this.c1 = this.getController("c1"); this.n2 = (this.getChild("n2")); this.n1 = (this.getChild("n1")); this.n3 = (this.getChild("n3")); this.n4 = (this.getChild("n4")); this.n5 = (this.getChild("n5")); this.n6 = (this.getChild("n6")); } } ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn"; class ui_share2Btn extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "share2Btn")); } onConstruct() { this.n3 = (this.getChild("n3")); } } ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr"; class ui_rodMethodNode extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "rodMethodNode")); } onConstruct() { this.bg = (this.getChild("bg")); this.dot = (this.getChild("dot")); } } ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1"; class ui_sureBtn extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "sureBtn")); } onConstruct() { this.n2 = (this.getChild("n2")); this.n1 = (this.getChild("n1")); } } ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2"; class ui_Component18 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component18")); } onConstruct() { this.c1 = this.getController("c1"); this.nameTxt = (this.getChild("nameTxt")); this.headImg = (this.getChild("headImg")); this.n24 = (this.getChild("n24")); this.skillImg = (this.getChild("skillImg")); this.skillTxt = (this.getChild("skillTxt")); } } ui_Component18.URL = "ui://isxx5ak7hxtr3yv"; class ui_Component45 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component45")); } onConstruct() { this.c1 = this.getController("c1"); this.n40 = (this.getChild("n40")); this.n41 = (this.getChild("n41")); this.targetScoreTxt = (this.getChild("targetScoreTxt")); this.n42 = (this.getChild("n42")); this.awardTxt = (this.getChild("awardTxt")); this.n44 = (this.getChild("n44")); this.t0 = this.getTransition("t0"); } } ui_Component45.URL = "ui://isxx5ak7i4k2438"; class ui_emotionDisplay extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "emotionDisplay")); } onConstruct() { this.myIcon = (this.getChild("myIcon")); } } ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h"; class ui_Component49 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "Component49")); } onConstruct() { this.n69 = (this.getChild("n69")); this.n56 = (this.getChild("n56")); } } ui_Component49.URL = "ui://isxx5ak7i4k243n"; class ui_Component50 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "Component50")); } onConstruct() { this.n54 = (this.getChild("n54")); this.n65 = (this.getChild("n65")); } } ui_Component50.URL = "ui://isxx5ak7i4k243o"; class ui_Component51 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "Component51")); } onConstruct() { this.c1 = this.getController("c1"); this.n51 = (this.getChild("n51")); this.n54 = (this.getChild("n54")); } } ui_Component51.URL = "ui://isxx5ak7i4k243p"; class ui_Button5 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "Button5")); } onConstruct() { this.c1 = this.getController("c1"); this.n0 = (this.getChild("n0")); this.n2 = (this.getChild("n2")); } } ui_Button5.URL = "ui://isxx5ak7i7rdv4jg"; class ui_Component124 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component124")); } onConstruct() { this.n22 = (this.getChild("n22")); this.shareNode = (this.getChild("shareNode")); } } ui_Component124.URL = "ui://isxx5ak7i7rdv4jh"; class ui_Component125 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component125")); } onConstruct() { this.n29 = (this.getChild("n29")); this.coinTxt = (this.getChild("coinTxt")); } } ui_Component125.URL = "ui://isxx5ak7i7rdv4ji"; class ui_Component52 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "Component52")); } onConstruct() { this.n35 = (this.getChild("n35")); this.n36 = (this.getChild("n36")); } } ui_Component52.URL = "ui://isxx5ak7ihpy43t"; class ui_drawBtn extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "drawBtn")); } onConstruct() { this.c1 = this.getController("c1"); this.n2 = (this.getChild("n2")); this.n1 = (this.getChild("n1")); this.n5 = (this.getChild("n5")); } } ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt"; class ui_Component43 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "Component43")); } onConstruct() { this.n49 = (this.getChild("n49")); } } ui_Component43.URL = "ui://isxx5ak7iveg434"; class ui_wordsDisplay extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "wordsDisplay")); } onConstruct() { this.txt = (this.getChild("txt")); this.n63 = (this.getChild("n63")); } } ui_wordsDisplay.URL = "ui://isxx5ak7iveg436"; class ui_Component_phb extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component_phb")); } onConstruct() { this.n3 = (this.getChild("n3")); this.n4 = (this.getChild("n4")); } } ui_Component_phb.URL = "ui://isxx5ak7ixgmv57c"; class ui_Component3 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component3")); } onConstruct() { this.n26 = (this.getChild("n26")); this.n24 = (this.getChild("n24")); this.nameTxt = (this.getChild("nameTxt")); this.headRoot = (this.getChild("headRoot")); } } ui_Component3.URL = "ui://isxx5ak7ixm43xh"; class ui_Component4 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component4")); } onConstruct() { this.headImg = (this.getChild("headImg")); } } ui_Component4.URL = "ui://isxx5ak7ixm43xi"; class ui_Component7 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "Component7")); } onConstruct() { this.n17 = (this.getChild("n17")); } } ui_Component7.URL = "ui://isxx5ak7ixm43xq"; class ui_Component8 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "Component8")); } onConstruct() { this.n19 = (this.getChild("n19")); } } ui_Component8.URL = "ui://isxx5ak7ixm43xr"; class ui_Component10 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "Component10")); } onConstruct() { this.c1 = this.getController("c1"); this.n40 = (this.getChild("n40")); } } ui_Component10.URL = "ui://isxx5ak7ixm43xt"; class ui_Component11 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "Component11")); } onConstruct() { this.n34 = (this.getChild("n34")); } } ui_Component11.URL = "ui://isxx5ak7ixm43xu"; class ui_Component12 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "Component12")); } onConstruct() { this.n35 = (this.getChild("n35")); } } ui_Component12.URL = "ui://isxx5ak7ixm43xv"; class ui_Component13 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "Component13")); } onConstruct() { this.n27 = (this.getChild("n27")); this.n36 = (this.getChild("n36")); } } ui_Component13.URL = "ui://isxx5ak7ixm43xw"; class ui_dh_js_tuowei extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "dh_js_tuowei")); } onConstruct() { this.n19 = (this.getChild("n19")); this.n18 = (this.getChild("n18")); this.n0 = (this.getChild("n0")); this.n3 = (this.getChild("n3")); this.n4 = (this.getChild("n4")); this.n5 = (this.getChild("n5")); this.n6 = (this.getChild("n6")); this.n8 = (this.getChild("n8")); this.n9 = (this.getChild("n9")); this.n10 = (this.getChild("n10")); this.n11 = (this.getChild("n11")); this.n12 = (this.getChild("n12")); this.n13 = (this.getChild("n13")); this.n14 = (this.getChild("n14")); this.n15 = (this.getChild("n15")); this.n20 = (this.getChild("n20")); this.t0 = this.getTransition("t0"); this.t1 = this.getTransition("t1"); } } ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n"; class ui_dh_js_tw_g extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "dh_js_tw_g")); } onConstruct() { this.n0 = (this.getChild("n0")); this.n1 = (this.getChild("n1")); this.t0 = this.getTransition("t0"); } } ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o"; class ui_dh_js_xingxing extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "dh_js_xingxing")); } onConstruct() { this.n1 = (this.getChild("n1")); this.n2 = (this.getChild("n2")); this.n3 = (this.getChild("n3")); this.n4 = (this.getChild("n4")); this.n0 = (this.getChild("n0")); this.t2 = this.getTransition("t2"); this.t1 = this.getTransition("t1"); } } ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p"; class ui_dh_zy_jiazai extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "dh_zy_jiazai")); } onConstruct() { this.c1 = this.getController("c1"); this.n0 = (this.getChild("n0")); this.n1 = (this.getChild("n1")); this.n2 = (this.getChild("n2")); this.n4 = (this.getChild("n4")); this.n5 = (this.getChild("n5")); this.n6 = (this.getChild("n6")); this.n8 = (this.getChild("n8")); this.n7 = (this.getChild("n7")); this.t0 = this.getTransition("t0"); } } ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q"; class ui_dh_js_xingxing2 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "dh_js_xingxing2")); } onConstruct() { this.c1 = this.getController("c1"); this.n3 = (this.getChild("n3")); this.n5 = (this.getChild("n5")); this.n4 = (this.getChild("n4")); this.n0 = (this.getChild("n0")); this.n1 = (this.getChild("n1")); this.n2 = (this.getChild("n2")); } } ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r"; class ui_dh_js_tuowei2 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "dh_js_tuowei2")); } onConstruct() { this.n19 = (this.getChild("n19")); this.n21 = (this.getChild("n21")); this.n0 = (this.getChild("n0")); this.n3 = (this.getChild("n3")); this.n4 = (this.getChild("n4")); this.n5 = (this.getChild("n5")); this.n6 = (this.getChild("n6")); this.n8 = (this.getChild("n8")); this.n9 = (this.getChild("n9")); this.n10 = (this.getChild("n10")); this.n11 = (this.getChild("n11")); this.n12 = (this.getChild("n12")); this.n13 = (this.getChild("n13")); this.n14 = (this.getChild("n14")); this.n15 = (this.getChild("n15")); this.n23 = (this.getChild("n23")); this.t0 = this.getTransition("t0"); this.t1 = this.getTransition("t1"); } } ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s"; class ui_dh_js_tw_g_1 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1")); } onConstruct() { this.n1 = (this.getChild("n1")); this.n2 = (this.getChild("n2")); this.t0 = this.getTransition("t0"); } } ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t"; class ui_dh_js_shibai_1 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "dh_js_shibai_1")); } onConstruct() { this.n4 = (this.getChild("n4")); this.n2 = (this.getChild("n2")); this.n3 = (this.getChild("n3")); this.idle = this.getTransition("idle"); this.attack = this.getTransition("attack"); } } ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w"; class ui_special extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "special")); } onConstruct() { this.n18 = (this.getChild("n18")); this.n19 = (this.getChild("n19")); this.n20 = (this.getChild("n20")); this.n21 = (this.getChild("n21")); this.n22 = (this.getChild("n22")); this.levelTxt = (this.getChild("levelTxt")); this.n24 = (this.getChild("n24")); this.n25 = (this.getChild("n25")); this.t0 = this.getTransition("t0"); } } ui_special.URL = "ui://isxx5ak7j979v4i6"; class ui_Component145 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component145")); } onConstruct() { this.guanyuNode = (this.getChild("guanyuNode")); } } ui_Component145.URL = "ui://isxx5ak7jaakv51f"; class ui_longBtn extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "longBtn")); } onConstruct() { this.c1 = this.getController("c1"); this.n2 = (this.getChild("n2")); this.n1 = (this.getChild("n1")); this.n4 = (this.getChild("n4")); } } ui_longBtn.URL = "ui://isxx5ak7jaakv55v"; class ui_Component146 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component146")); } onConstruct() { this.n89 = (this.getChild("n89")); this.n90 = (this.getChild("n90")); this.guideBtn = (this.getChild("guideBtn")); } } ui_Component146.URL = "ui://isxx5ak7jaakv55w"; class ui_Component146_11 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component146_11")); } onConstruct() { this.n89 = (this.getChild("n89")); this.n90 = (this.getChild("n90")); this.guideBtn = (this.getChild("guideBtn")); } } ui_Component146_11.URL = "ui://isxx5ak7jaakv55x"; class ui_Component111_1 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component111_1")); } onConstruct() { this.n68 = (this.getChild("n68")); this.myMask = (this.getChild("myMask")); } } ui_Component111_1.URL = "ui://isxx5ak7jaakv55y"; class ui_Component64_1 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component64_1")); } onConstruct() { this.n57 = (this.getChild("n57")); this.n54 = (this.getChild("n54")); this.n55 = (this.getChild("n55")); this.n56 = (this.getChild("n56")); this.t1 = this.getTransition("t1"); } } ui_Component64_1.URL = "ui://isxx5ak7jaakv55z"; class ui_ModeSelection_com123 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "ModeSelection_com123")); } onConstruct() { this.type1 = (this.getChild("type1")); this.type2 = (this.getChild("type2")); this.type3 = (this.getChild("type3")); this.n38 = (this.getChild("n38")); this.t0 = this.getTransition("t0"); } } ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561"; class ui_Component132_2 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component132_2")); } onConstruct() { this.n25 = (this.getChild("n25")); this.n26 = (this.getChild("n26")); this.n27 = (this.getChild("n27")); this.t0 = this.getTransition("t0"); } } ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw"; class ui_UIPower$1 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "UIPower")); } onConstruct() { this.n11 = (this.getChild("n11")); this.myNode = (this.getChild("myNode")); this.t0 = this.getTransition("t0"); } } ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1"; class ui_Component133 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component133")); } onConstruct() { this.n29 = (this.getChild("n29")); this.n30 = (this.getChild("n30")); } } ui_Component133.URL = "ui://isxx5ak7jpszv4n3"; class ui_Component134 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component134")); } onConstruct() { this.n30 = (this.getChild("n30")); this.n31 = (this.getChild("n31")); this.t0 = this.getTransition("t0"); } } ui_Component134.URL = "ui://isxx5ak7jpszv4n4"; class ui_Component135 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component135")); } onConstruct() { this.n30 = (this.getChild("n30")); this.t0 = this.getTransition("t0"); } } ui_Component135.URL = "ui://isxx5ak7jpszv4n6"; class ui_Component137 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component137")); } onConstruct() { this.n28 = (this.getChild("n28")); this.n29 = (this.getChild("n29")); this.n30 = (this.getChild("n30")); this.n32 = (this.getChild("n32")); } } ui_Component137.URL = "ui://isxx5ak7jpszv4n8"; class ui_dh_zuanshi extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "dh_zuanshi")); } onConstruct() { this.n1 = (this.getChild("n1")); this.n2 = (this.getChild("n2")); this.n0 = (this.getChild("n0")); this.n3 = (this.getChild("n3")); this.n4 = (this.getChild("n4")); } } ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9"; class ui_Component138 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component138")); } onConstruct() { this.n1 = (this.getChild("n1")); this.n2 = (this.getChild("n2")); this.t0 = this.getTransition("t0"); } } ui_Component138.URL = "ui://isxx5ak7jpszv4nf"; class ui_Component139 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component139")); } onConstruct() { this.n0 = (this.getChild("n0")); this.t0 = this.getTransition("t0"); } } ui_Component139.URL = "ui://isxx5ak7jpszv4ng"; class ui_Component140 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component140")); } onConstruct() { this.n2 = (this.getChild("n2")); this.n3 = (this.getChild("n3")); this.t0 = this.getTransition("t0"); } } ui_Component140.URL = "ui://isxx5ak7jpszv4nh"; class ui_Component141 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component141")); } onConstruct() { this.n0 = (this.getChild("n0")); this.t0 = this.getTransition("t0"); } } ui_Component141.URL = "ui://isxx5ak7jpszv4ni"; class ui_powerNode extends fgui.GProgressBar { static createInstance() { return (fgui.UIPackage.createObject("game", "powerNode")); } onConstruct() { this.n2 = (this.getChild("n2")); this.bar_v = (this.getChild("bar_v")); this.showImg = (this.getChild("showImg")); this.n12 = (this.getChild("n12")); } } ui_powerNode.URL = "ui://isxx5ak7kt443qh"; class ui_dh_jingbi1 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "dh_jingbi1")); } onConstruct() { this.n0 = (this.getChild("n0")); this.n1 = (this.getChild("n1")); this.n2 = (this.getChild("n2")); this.n3 = (this.getChild("n3")); this.n4 = (this.getChild("n4")); this.n5 = (this.getChild("n5")); this.n6 = (this.getChild("n6")); this.n8 = (this.getChild("n8")); this.t0 = this.getTransition("t0"); } } ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e"; class ui_Component94 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "Component94")); } onConstruct() { this.n77 = (this.getChild("n77")); } } ui_Component94.URL = "ui://isxx5ak7l1574b6"; class ui_Component95 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "Component95")); } onConstruct() { this.n77 = (this.getChild("n77")); } } ui_Component95.URL = "ui://isxx5ak7l1574b7"; class ui_Component126 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component126")); } onConstruct() { this.c1 = this.getController("c1"); this.normalBtn = (this.getChild("normalBtn")); this.tripleBtn = (this.getChild("tripleBtn")); } } ui_Component126.URL = "ui://isxx5ak7lhrrv4lg"; class ui_Component60 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component60")); } onConstruct() { this.c1 = this.getController("c1"); this.n48 = (this.getChild("n48")); this.womanTxt = (this.getChild("womanTxt")); this.t0 = this.getTransition("t0"); } } ui_Component60.URL = "ui://isxx5ak7llhd44g"; class ui_Component98_3 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "Component98_3")); } onConstruct() { this.c1 = this.getController("c1"); this.n8 = (this.getChild("n8")); this.n41 = (this.getChild("n41")); this.n40 = (this.getChild("n40")); } } ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2"; class ui_ModeSelection_com1 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "ModeSelection_com1")); } onConstruct() { this.n34 = (this.getChild("n34")); this.n36 = (this.getChild("n36")); this.n22 = (this.getChild("n22")); this.n20 = (this.getChild("n20")); this.n23 = (this.getChild("n23")); this.n24 = (this.getChild("n24")); this.n26 = (this.getChild("n26")); this.n33 = (this.getChild("n33")); this.coinImg = (this.getChild("coinImg")); this.need = (this.getChild("need")); this.n35 = (this.getChild("n35")); this.n29 = (this.getChild("n29")); this.tipsTxt = (this.getChild("tipsTxt")); this.n30 = (this.getChild("n30")); this.peopleTxt = (this.getChild("peopleTxt")); this.t0 = this.getTransition("t0"); } } ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m"; class ui_ModeSelection_com2 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "ModeSelection_com2")); } onConstruct() { this.n36 = (this.getChild("n36")); this.n34 = (this.getChild("n34")); this.n22 = (this.getChild("n22")); this.n20 = (this.getChild("n20")); this.n23 = (this.getChild("n23")); this.n24 = (this.getChild("n24")); this.n26 = (this.getChild("n26")); this.n33 = (this.getChild("n33")); this.coinImg = (this.getChild("coinImg")); this.need = (this.getChild("need")); this.n35 = (this.getChild("n35")); this.n29 = (this.getChild("n29")); this.tipsTxt = (this.getChild("tipsTxt")); this.n30 = (this.getChild("n30")); this.peopleTxt = (this.getChild("peopleTxt")); this.t0 = this.getTransition("t0"); } } ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n"; class ui_ModeSelection_com3 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "ModeSelection_com3")); } onConstruct() { this.n34 = (this.getChild("n34")); this.n36 = (this.getChild("n36")); this.n22 = (this.getChild("n22")); this.n20 = (this.getChild("n20")); this.n23 = (this.getChild("n23")); this.n24 = (this.getChild("n24")); this.n26 = (this.getChild("n26")); this.n33 = (this.getChild("n33")); this.coinImg = (this.getChild("coinImg")); this.need = (this.getChild("need")); this.n35 = (this.getChild("n35")); this.n29 = (this.getChild("n29")); this.tipsTxt = (this.getChild("tipsTxt")); this.n30 = (this.getChild("n30")); this.peopleTxt = (this.getChild("peopleTxt")); this.t0 = this.getTransition("t0"); } } ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o"; class ui_Invitation_com1 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Invitation_com1")); } onConstruct() { this.n14 = (this.getChild("n14")); this.n13 = (this.getChild("n13")); this.n3 = (this.getChild("n3")); this.n1 = (this.getChild("n1")); this.n6 = (this.getChild("n6")); this.n7 = (this.getChild("n7")); this.enterBtn = (this.getChild("enterBtn")); this.n11 = (this.getChild("n11")); this.n12 = (this.getChild("n12")); this.n15 = (this.getChild("n15")); this.t0 = this.getTransition("t0"); this.t1 = this.getTransition("t1"); } } ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513"; class ui_Component87_1 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component87_1")); } onConstruct() { this.n74 = (this.getChild("n74")); this.n73 = (this.getChild("n73")); this.ballTxt = (this.getChild("ballTxt")); this.n76 = (this.getChild("n76")); this.helpLineBtn = (this.getChild("helpLineBtn")); this.levelTxt = (this.getChild("levelTxt")); this.n87 = (this.getChild("n87")); this.n84 = (this.getChild("n84")); this.hpTxt = (this.getChild("hpTxt")); this.n89 = (this.getChild("n89")); this.tipsTxt = (this.getChild("tipsTxt")); } } ui_Component87_1.URL = "ui://isxx5ak7luq648t"; class ui_sqg1 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "sqg1")); } onConstruct() { this.n1 = (this.getChild("n1")); this.n0 = (this.getChild("n0")); } } ui_sqg1.URL = "ui://isxx5ak7mif8v4ma"; class ui_sqg2 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "sqg2")); } onConstruct() { this.n1 = (this.getChild("n1")); this.n0 = (this.getChild("n0")); } } ui_sqg2.URL = "ui://isxx5ak7mif8v4mb"; class ui_sqg3 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "sqg3")); } onConstruct() { this.n1 = (this.getChild("n1")); this.n0 = (this.getChild("n0")); } } ui_sqg3.URL = "ui://isxx5ak7mif8v4mc"; class ui_sqg4 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "sqg4")); } onConstruct() { this.n1 = (this.getChild("n1")); this.n0 = (this.getChild("n0")); } } ui_sqg4.URL = "ui://isxx5ak7mif8v4md"; class ui_Component36 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "Component36")); } onConstruct() { this.c1 = this.getController("c1"); this.n53 = (this.getChild("n53")); this.n56 = (this.getChild("n56")); } } ui_Component36.URL = "ui://isxx5ak7mnrs42r"; class ui_Component37 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "Component37")); } onConstruct() { this.c1 = this.getController("c1"); this.n52 = (this.getChild("n52")); this.n54 = (this.getChild("n54")); } } ui_Component37.URL = "ui://isxx5ak7mnrs42s"; class ui_UISetting extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "UISetting")); } onConstruct() { this.c1 = this.getController("c1"); this.n4 = (this.getChild("n4")); this.soundBtn = (this.getChild("soundBtn")); this.shakeBtn = (this.getChild("shakeBtn")); this.clickNode = (this.getChild("clickNode")); this.xyBtn = (this.getChild("xyBtn")); } } ui_UISetting.URL = "ui://isxx5ak7mnrs42t"; class ui_Component39 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component39")); } onConstruct() { this.n5 = (this.getChild("n5")); this.n6 = (this.getChild("n6")); this.n7 = (this.getChild("n7")); this.t0 = this.getTransition("t0"); } } ui_Component39.URL = "ui://isxx5ak7mnrs42v"; class ui_Component40 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "Component40")); } onConstruct() { this.n46 = (this.getChild("n46")); this.n47 = (this.getChild("n47")); } } ui_Component40.URL = "ui://isxx5ak7mnrs42y"; class ui_Component41 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component41")); } onConstruct() { this.c1 = this.getController("c1"); this.n0 = (this.getChild("n0")); this.titleTxt = (this.getChild("titleTxt")); this.n2 = (this.getChild("n2")); this.msgTips = (this.getChild("msgTips")); this.numTxt = (this.getChild("numTxt")); this.n18 = (this.getChild("n18")); this.cancelBtn = (this.getChild("cancelBtn")); this.videoBtn = (this.getChild("videoBtn")); this.n10 = (this.getChild("n10")); } } ui_Component41.URL = "ui://isxx5ak7mnrs430"; class ui_Component42 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component42")); } onConstruct() { this.c1 = this.getController("c1"); this.n1 = (this.getChild("n1")); this.n2 = (this.getChild("n2")); this.n3 = (this.getChild("n3")); this.tipsTxt = (this.getChild("tipsTxt")); this.cancelBtn = (this.getChild("cancelBtn")); this.sureBtn = (this.getChild("sureBtn")); this.n11 = (this.getChild("n11")); this.n13 = (this.getChild("n13")); this.n14 = (this.getChild("n14")); this.womanTxt = (this.getChild("womanTxt")); this.t0 = this.getTransition("t0"); } } ui_Component42.URL = "ui://isxx5ak7mnrs431"; class ui_dh_js_shengli extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "dh_js_shengli")); } onConstruct() { this.n3 = (this.getChild("n3")); this.n4 = (this.getChild("n4")); this.n1 = (this.getChild("n1")); this.n2 = (this.getChild("n2")); this.n5 = (this.getChild("n5")); this.n6 = (this.getChild("n6")); this.n7 = (this.getChild("n7")); this.n8 = (this.getChild("n8")); this.attack = this.getTransition("attack"); this.idle = this.getTransition("idle"); } } ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0"; class ui_dh_js_shengli_g extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "dh_js_shengli_g")); } onConstruct() { this.n3 = (this.getChild("n3")); this.n1 = (this.getChild("n1")); this.t0 = this.getTransition("t0"); } } ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1"; class ui_dh_js_shibai extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "dh_js_shibai")); } onConstruct() { this.n0 = (this.getChild("n0")); this.n1 = (this.getChild("n1")); this.n2 = (this.getChild("n2")); this.n3 = (this.getChild("n3")); this.idle = this.getTransition("idle"); this.attack = this.getTransition("attack"); } } ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2"; class ui_dh_zy_ganfa extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "dh_zy_ganfa")); } onConstruct() { this.n0 = (this.getChild("n0")); } } ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl"; class ui_dh_zy_sc_guang extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang")); } onConstruct() { this.n0 = (this.getChild("n0")); this.n2 = (this.getChild("n2")); } } ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn"; class ui_dh_zy_shangcheng extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng")); } onConstruct() { this.n0 = (this.getChild("n0")); this.n3 = (this.getChild("n3")); this.t0 = this.getTransition("t0"); } } ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo"; class ui_dh_zy_wanfa extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "dh_zy_wanfa")); } onConstruct() { this.n0 = (this.getChild("n0")); } } ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp"; class ui_Button_login extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "Button_login")); } onConstruct() { this.button = this.getController("button"); this.n5 = (this.getChild("n5")); this.n3 = (this.getChild("n3")); } } ui_Button_login.URL = "ui://isxx5ak7nnz5v587"; class ui_Component53_1 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component53_1")); } onConstruct() { this.n0 = (this.getChild("n0")); this.n1 = (this.getChild("n1")); this.n2 = (this.getChild("n2")); this.n3 = (this.getChild("n3")); this.n4 = (this.getChild("n4")); this.n5 = (this.getChild("n5")); this.n6 = (this.getChild("n6")); this.n7 = (this.getChild("n7")); this.n8 = (this.getChild("n8")); this.n9 = (this.getChild("n9")); this.n10 = (this.getChild("n10")); this.n11 = (this.getChild("n11")); this.n12 = (this.getChild("n12")); this.n13 = (this.getChild("n13")); this.n14 = (this.getChild("n14")); this.n15 = (this.getChild("n15")); this.n16 = (this.getChild("n16")); this.n19 = (this.getChild("n19")); this.n20 = (this.getChild("n20")); this.n21 = (this.getChild("n21")); this.n22 = (this.getChild("n22")); this.n23 = (this.getChild("n23")); this.n24 = (this.getChild("n24")); this.n25 = (this.getChild("n25")); this.n26 = (this.getChild("n26")); this.n27 = (this.getChild("n27")); this.n28 = (this.getChild("n28")); this.n29 = (this.getChild("n29")); this.n30 = (this.getChild("n30")); this.n31 = (this.getChild("n31")); this.n32 = (this.getChild("n32")); this.n33 = (this.getChild("n33")); this.n34 = (this.getChild("n34")); this.n35 = (this.getChild("n35")); this.t0 = this.getTransition("t0"); } } ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4"; class ui_Component30 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component30")); } onConstruct() { this.c1 = this.getController("c1"); this.n46 = (this.getChild("n46")); this.n47 = (this.getChild("n47")); this.numTxt = (this.getChild("numTxt")); this.n50 = (this.getChild("n50")); this.n53 = (this.getChild("n53")); this.n54 = (this.getChild("n54")); this.n55 = (this.getChild("n55")); this.n56 = (this.getChild("n56")); } } ui_Component30.URL = "ui://isxx5ak7p4tr41y"; class ui_Component30_1 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component30_1")); } onConstruct() { this.c1 = this.getController("c1"); this.n46 = (this.getChild("n46")); this.n47 = (this.getChild("n47")); this.numTxt = (this.getChild("numTxt")); this.n50 = (this.getChild("n50")); this.n51 = (this.getChild("n51")); this.n52 = (this.getChild("n52")); this.n53 = (this.getChild("n53")); this.n54 = (this.getChild("n54")); } } ui_Component30_1.URL = "ui://isxx5ak7p4tr41z"; class ui_Component31 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component31")); } onConstruct() { this.n55 = (this.getChild("n55")); this.n54 = (this.getChild("n54")); this.conditionTxt = (this.getChild("conditionTxt")); this.n57 = (this.getChild("n57")); this.t0 = this.getTransition("t0"); } } ui_Component31.URL = "ui://isxx5ak7p4tr423"; class ui_Component32 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component32")); } onConstruct() { this.n5 = (this.getChild("n5")); this.n6 = (this.getChild("n6")); this.n7 = (this.getChild("n7")); this.t0 = this.getTransition("t0"); } } ui_Component32.URL = "ui://isxx5ak7p4tr42f"; class ui_AwardItem extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "AwardItem")); } onConstruct() { this.n9 = (this.getChild("n9")); this.myIcon = (this.getChild("myIcon")); this.numTxt = (this.getChild("numTxt")); this.nameTxt = (this.getChild("nameTxt")); this.n16 = (this.getChild("n16")); this.n17 = (this.getChild("n17")); } } ui_AwardItem.URL = "ui://isxx5ak7p4tr42h"; class ui_ranking_com1 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "ranking_com1")); } onConstruct() { this.c1 = this.getController("c1"); this.n49 = (this.getChild("n49")); this.n18 = (this.getChild("n18")); this.n46 = (this.getChild("n46")); this.n48 = (this.getChild("n48")); this.n50 = (this.getChild("n50")); } } ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr"; class ui_ranking_com2 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "ranking_com2")); } onConstruct() { this.c1 = this.getController("c1"); this.n49 = (this.getChild("n49")); this.n18 = (this.getChild("n18")); this.n46 = (this.getChild("n46")); this.n48 = (this.getChild("n48")); this.n50 = (this.getChild("n50")); } } ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps"; class ui_ranking_com3 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "ranking_com3")); } onConstruct() { this.n17 = (this.getChild("n17")); this.myIcon = (this.getChild("myIcon")); } } ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw"; class ui_ranking_com4 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "ranking_com4")); } onConstruct() { this.n16 = (this.getChild("n16")); this.head = (this.getChild("head")); } } ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px"; class ui_ranking_com5 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "ranking_com5")); } onConstruct() { this.c1 = this.getController("c1"); this.c2 = this.getController("c2"); this.n2 = (this.getChild("n2")); this.n3 = (this.getChild("n3")); this.levelBtn = (this.getChild("levelBtn")); this.starBtn = (this.getChild("starBtn")); this.n23 = (this.getChild("n23")); this.n24 = (this.getChild("n24")); this.n25 = (this.getChild("n25")); this.myList = (this.getChild("myList")); this.selfNode = (this.getChild("selfNode")); this.n9 = (this.getChild("n9")); this.n12 = (this.getChild("n12")); this.n13 = (this.getChild("n13")); this.n14 = (this.getChild("n14")); this.n39 = (this.getChild("n39")); this.n41 = (this.getChild("n41")); this.n42 = (this.getChild("n42")); this.n45 = (this.getChild("n45")); this.changeBtn = (this.getChild("changeBtn")); this.closeBtn = (this.getChild("closeBtn")); this.t0 = this.getTransition("t0"); } } ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz"; class ui_RankItem extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "RankItem")); } onConstruct() { this.n10 = (this.getChild("n10")); this.n11 = (this.getChild("n11")); this.rankTxt = (this.getChild("rankTxt")); this.headNode = (this.getChild("headNode")); this.nameTxt = (this.getChild("nameTxt")); this.n19 = (this.getChild("n19")); this.valueTxt = (this.getChild("valueTxt")); this.img1 = (this.getChild("img1")); this.img2 = (this.getChild("img2")); this.img3 = (this.getChild("img3")); } } ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1"; class ui_ranking_com9 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "ranking_com9")); } onConstruct() { this.c1 = this.getController("c1"); this.n27 = (this.getChild("n27")); this.n28 = (this.getChild("n28")); this.headNode = (this.getChild("headNode")); this.rankTxt = (this.getChild("rankTxt")); this.nameTxt = (this.getChild("nameTxt")); this.n34 = (this.getChild("n34")); this.valueTxt = (this.getChild("valueTxt")); this.n36 = (this.getChild("n36")); this.n37 = (this.getChild("n37")); this.n38 = (this.getChild("n38")); this.n39 = (this.getChild("n39")); this.n40 = (this.getChild("n40")); } } ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3"; class ui_ranking_com10 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "ranking_com10")); } onConstruct() { this.n23 = (this.getChild("n23")); this.n24 = (this.getChild("n24")); } } ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4"; class ui_ranking_com11 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "ranking_com11")); } onConstruct() { this.n24 = (this.getChild("n24")); this.n25 = (this.getChild("n25")); this.t0 = this.getTransition("t0"); } } ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5"; class ui_ranking_com13 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "ranking_com13")); } onConstruct() { this.c1 = this.getController("c1"); this.n44 = (this.getChild("n44")); this.n45 = (this.getChild("n45")); this.n46 = (this.getChild("n46")); } } ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa"; class ui_Component_dl_zc extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "Component_dl_zc")); } onConstruct() { this.c1 = this.getController("c1"); this.n0 = (this.getChild("n0")); } } ui_Component_dl_zc.URL = "ui://isxx5ak7p8p3v58c"; class ui_Component122 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component122")); } onConstruct() { this.gameNode3 = (this.getChild("gameNode3")); } } ui_Component122.URL = "ui://isxx5ak7pf2sv4ic"; class ui_skillItem extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "skillItem")); } onConstruct() { this.c1 = this.getController("c1"); this.n31 = (this.getChild("n31")); this.n6 = (this.getChild("n6")); this.skillImg = (this.getChild("skillImg")); this.nameTxt = (this.getChild("nameTxt")); this.levelTxt = (this.getChild("levelTxt")); this.n28 = (this.getChild("n28")); this.describeTxt = (this.getChild("describeTxt")); this.n32 = (this.getChild("n32")); this.mutiBtn = (this.getChild("mutiBtn")); this.tryNode = (this.getChild("tryNode")); this.normalBtn = (this.getChild("normalBtn")); this.startBtn = (this.getChild("startBtn")); this.n42 = (this.getChild("n42")); this.n43 = (this.getChild("n43")); this.n44 = (this.getChild("n44")); } } ui_skillItem.URL = "ui://isxx5ak7qlo041q"; class ui_Component26 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "Component26")); } onConstruct() { this.n11 = (this.getChild("n11")); this.n30 = (this.getChild("n30")); this.n34 = (this.getChild("n34")); } } ui_Component26.URL = "ui://isxx5ak7qlo041r"; class ui_Component28 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "Component28")); } onConstruct() { this.n12 = (this.getChild("n12")); this.n31 = (this.getChild("n31")); this.curTxt = (this.getChild("curTxt")); this.n33 = (this.getChild("n33")); } } ui_Component28.URL = "ui://isxx5ak7qlo041t"; class ui_Component1302 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component1302")); } onConstruct() { this.n2 = (this.getChild("n2")); this.n3 = (this.getChild("n3")); } } ui_Component1302.URL = "ui://isxx5ak7r4l5v577"; class ui_Component113 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component113")); } onConstruct() { this.n85 = (this.getChild("n85")); this.n86 = (this.getChild("n86")); this.n77 = (this.getChild("n77")); this.n79 = (this.getChild("n79")); this.n80 = (this.getChild("n80")); this.n81 = (this.getChild("n81")); this.n82 = (this.getChild("n82")); this.n84 = (this.getChild("n84")); this.n87 = (this.getChild("n87")); this.t0 = this.getTransition("t0"); } } ui_Component113.URL = "ui://isxx5ak7r5f8v4hv"; class ui_Component114 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component114")); } onConstruct() { this.n77 = (this.getChild("n77")); this.t0 = this.getTransition("t0"); } } ui_Component114.URL = "ui://isxx5ak7r5f8v4hw"; class ui_Component115 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component115")); } onConstruct() { this.n83 = (this.getChild("n83")); this.fingerNode = (this.getChild("fingerNode")); this.n84 = (this.getChild("n84")); } } ui_Component115.URL = "ui://isxx5ak7r5f8v4hx"; class ui_Component117 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component117")); } onConstruct() { this.n87 = (this.getChild("n87")); this.n88 = (this.getChild("n88")); this.n84 = (this.getChild("n84")); this.n85 = (this.getChild("n85")); this.n86 = (this.getChild("n86")); this.t0 = this.getTransition("t0"); } } ui_Component117.URL = "ui://isxx5ak7r5f8v4hz"; class ui_Component98_1 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "Component98_1")); } onConstruct() { this.c1 = this.getController("c1"); this.n8 = (this.getChild("n8")); this.n41 = (this.getChild("n41")); this.n40 = (this.getChild("n40")); } } ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0"; class ui_Component61 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component61")); } onConstruct() { this.n14 = (this.getChild("n14")); this.n6 = (this.getChild("n6")); this.t0 = this.getTransition("t0"); } } ui_Component61.URL = "ui://isxx5ak7s8sz44h"; class ui_Component62 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component62")); } onConstruct() { this.n66 = (this.getChild("n66")); this.n56 = (this.getChild("n56")); this.n63 = (this.getChild("n63")); this.n65 = (this.getChild("n65")); this.t0 = this.getTransition("t0"); } } ui_Component62.URL = "ui://isxx5ak7s8sz44u"; class ui_d3Root extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "d3Root")); } onConstruct() { } } ui_d3Root.URL = "ui://isxx5ak7sdh33ql"; class ui_d2Root extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "d2Root")); } onConstruct() { } } ui_d2Root.URL = "ui://isxx5ak7sdh33qm"; class ui_ballNode extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "ballNode")); } onConstruct() { } } ui_ballNode.URL = "ui://isxx5ak7sdh33qn"; class ui_border extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "border")); } onConstruct() { this.bar1 = (this.getChild("bar1")); this.bar2 = (this.getChild("bar2")); this.bar3 = (this.getChild("bar3")); this.bar4 = (this.getChild("bar4")); this.bar5 = (this.getChild("bar5")); this.bar6 = (this.getChild("bar6")); this.circle1 = (this.getChild("circle1")); this.circle2 = (this.getChild("circle2")); this.circle3 = (this.getChild("circle3")); this.circle4 = (this.getChild("circle4")); this.circle5 = (this.getChild("circle5")); this.circle6 = (this.getChild("circle6")); this.n28 = (this.getChild("n28")); } } ui_border.URL = "ui://isxx5ak7sdh33qq"; class ui_Component41_2 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component41_2")); } onConstruct() { this.c1 = this.getController("c1"); this.n0 = (this.getChild("n0")); this.n2 = (this.getChild("n2")); this.n19 = (this.getChild("n19")); this.cancelBtn = (this.getChild("cancelBtn")); this.videoBtn = (this.getChild("videoBtn")); this.n9 = (this.getChild("n9")); this.n22 = (this.getChild("n22")); this.tipsTxt = (this.getChild("tipsTxt")); this.n23 = (this.getChild("n23")); this.n24 = (this.getChild("n24")); this.n26 = (this.getChild("n26")); this.n27 = (this.getChild("n27")); this.titleTxt = (this.getChild("titleTxt")); } } ui_Component41_2.URL = "ui://isxx5ak7trk948w"; class ui_Component41_1 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component41_1")); } onConstruct() { this.c1 = this.getController("c1"); this.n0 = (this.getChild("n0")); this.n2 = (this.getChild("n2")); this.cancelBtn = (this.getChild("cancelBtn")); this.videoBtn = (this.getChild("videoBtn")); this.n27 = (this.getChild("n27")); this.n30 = (this.getChild("n30")); this.n31 = (this.getChild("n31")); this.n32 = (this.getChild("n32")); this.n33 = (this.getChild("n33")); this.n34 = (this.getChild("n34")); this.n35 = (this.getChild("n35")); this.n36 = (this.getChild("n36")); this.n1 = (this.getChild("n1")); this.n37 = (this.getChild("n37")); this.t0 = this.getTransition("t0"); this.t1 = this.getTransition("t1"); this.t2 = this.getTransition("t2"); this.t3 = this.getTransition("t3"); } } ui_Component41_1.URL = "ui://isxx5ak7trk9491"; class ui_againBtn extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "againBtn")); } onConstruct() { this.n2 = (this.getChild("n2")); this.n1 = (this.getChild("n1")); this.n5 = (this.getChild("n5")); } } ui_againBtn.URL = "ui://isxx5ak7u58xv509"; class ui_Component118 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "Component118")); } onConstruct() { this.c1 = this.getController("c1"); this.n14 = (this.getChild("n14")); this.n9 = (this.getChild("n9")); this.n10 = (this.getChild("n10")); this.diamondTxt = (this.getChild("diamondTxt")); this.n13 = (this.getChild("n13")); this.n15 = (this.getChild("n15")); } } ui_Component118.URL = "ui://isxx5ak7u8eiv4i2"; class ui_Component119 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component119")); } onConstruct() { this.n1 = (this.getChild("n1")); this.n2 = (this.getChild("n2")); this.n13 = (this.getChild("n13")); this.n6 = (this.getChild("n6")); this.screenNode = (this.getChild("screenNode")); this.n15 = (this.getChild("n15")); this.closeBtn = (this.getChild("closeBtn")); this.share2Btn = (this.getChild("share2Btn")); this.shareBtn = (this.getChild("shareBtn")); this.tipsNode = (this.getChild("tipsNode")); this.awardNode = (this.getChild("awardNode")); } } ui_Component119.URL = "ui://isxx5ak7u8eiv4i3"; class ui_daoJuDisplay extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "daoJuDisplay")); } onConstruct() { this.n1 = (this.getChild("n1")); this.n0 = (this.getChild("n0")); } } ui_daoJuDisplay.URL = "ui://isxx5ak7uel8v58m"; class ui_Component132_1 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component132_1")); } onConstruct() { this.n25 = (this.getChild("n25")); this.n26 = (this.getChild("n26")); this.n27 = (this.getChild("n27")); this.t0 = this.getTransition("t0"); } } ui_Component132_1.URL = "ui://isxx5ak7uih8v568"; class ui_SecretaryDisplay extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "SecretaryDisplay")); } onConstruct() { this.n2 = (this.getChild("n2")); this.levelTxt = (this.getChild("levelTxt")); this.n4 = (this.getChild("n4")); this.secretary = (this.getChild("secretary")); this.purchaseBtn = (this.getChild("purchaseBtn")); this.n16 = (this.getChild("n16")); this.n37 = (this.getChild("n37")); this.n41 = (this.getChild("n41")); this.n14 = (this.getChild("n14")); this.n17 = (this.getChild("n17")); this.heightTxt = (this.getChild("heightTxt")); this.n46 = (this.getChild("n46")); this.n36 = (this.getChild("n36")); this.n38 = (this.getChild("n38")); this.foodTxt = (this.getChild("foodTxt")); this.n47 = (this.getChild("n47")); this.n40 = (this.getChild("n40")); this.n42 = (this.getChild("n42")); this.historyTxt = (this.getChild("historyTxt")); this.n48 = (this.getChild("n48")); this.nameImg = (this.getChild("nameImg")); this.n12 = (this.getChild("n12")); this.n49 = (this.getChild("n49")); this.t0 = this.getTransition("t0"); } } ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo"; class ui_BallRodDisplay extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "BallRodDisplay")); } onConstruct() { this.c1 = this.getController("c1"); this.n31 = (this.getChild("n31")); this.n6 = (this.getChild("n6")); this.nameTxt = (this.getChild("nameTxt")); this.rodImg = (this.getChild("rodImg")); this.levelNode = (this.getChild("levelNode")); this.eftRod = (this.getChild("eftRod")); this.purchaseBtn = (this.getChild("purchaseBtn")); } } ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr"; class ui_Component111_11 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component111_11")); } onConstruct() { this.n68 = (this.getChild("n68")); this.n69 = (this.getChild("n69")); } } ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk"; class ui_Component112 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component112")); } onConstruct() { this.n68 = (this.getChild("n68")); this.n70 = (this.getChild("n70")); this.myMask = (this.getChild("myMask")); } } ui_Component112.URL = "ui://isxx5ak7vhzhv4ho"; class ui_Component111 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component111")); } onConstruct() { this.n68 = (this.getChild("n68")); this.myMask = (this.getChild("myMask")); } } ui_Component111.URL = "ui://isxx5ak7vhzhv4hq"; class ui_Component144 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "Component144")); } onConstruct() { this.n8 = (this.getChild("n8")); } } ui_Component144.URL = "ui://isxx5ak7vv6av515"; class ui_Sign_com2 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Sign_com2")); } onConstruct() { this.n0 = (this.getChild("n0")); this.n1 = (this.getChild("n1")); this.t0 = this.getTransition("t0"); } } ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1"; class ui_Sign_guang extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Sign_guang")); } onConstruct() { this.n1 = (this.getChild("n1")); this.n2 = (this.getChild("n2")); this.n3 = (this.getChild("n3")); this.n4 = (this.getChild("n4")); this.n5 = (this.getChild("n5")); this.n6 = (this.getChild("n6")); this.n8 = (this.getChild("n8")); } } ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4"; class ui_SignMax extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "SignMax")); } onConstruct() { this.c1 = this.getController("c1"); this.n7 = (this.getChild("n7")); this.n15 = (this.getChild("n15")); this.n8 = (this.getChild("n8")); this.titleTxt = (this.getChild("titleTxt")); this.myIcon1 = (this.getChild("myIcon1")); this.numTxt1 = (this.getChild("numTxt1")); this.myIcon2 = (this.getChild("myIcon2")); this.n20 = (this.getChild("n20")); this.n17 = (this.getChild("n17")); this.numTxt2 = (this.getChild("numTxt2")); this.n12 = (this.getChild("n12")); this.n13 = (this.getChild("n13")); this.n21 = (this.getChild("n21")); this.n14 = (this.getChild("n14")); } } ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6"; class ui_Sign_com2_1 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Sign_com2_1")); } onConstruct() { this.n0 = (this.getChild("n0")); this.n1 = (this.getChild("n1")); this.t0 = this.getTransition("t0"); } } ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7"; class ui_Sign_com5 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Sign_com5")); } onConstruct() { this.n3 = (this.getChild("n3")); this.n29 = (this.getChild("n29")); this.n4 = (this.getChild("n4")); this.day1 = (this.getChild("day1")); this.day2 = (this.getChild("day2")); this.day3 = (this.getChild("day3")); this.day4 = (this.getChild("day4")); this.day5 = (this.getChild("day5")); this.day6 = (this.getChild("day6")); this.day7 = (this.getChild("day7")); this.t0 = this.getTransition("t0"); } } ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9"; class ui_Sign_com8 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Sign_com8")); } onConstruct() { this.n48 = (this.getChild("n48")); this.womanTxt = (this.getChild("womanTxt")); this.t0 = this.getTransition("t0"); } } ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka"; class ui_Sign_com6 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Sign_com6")); } onConstruct() { this.n2 = (this.getChild("n2")); this.n3 = (this.getChild("n3")); this.t0 = this.getTransition("t0"); } } ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb"; class ui_Sign_com7 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Sign_com7")); } onConstruct() { this.n29 = (this.getChild("n29")); this.n2 = (this.getChild("n2")); } } ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd"; class ui_UITurntable_com1_2 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "UITurntable_com1_2")); } onConstruct() { this.n5 = (this.getChild("n5")); this.n4 = (this.getChild("n4")); this.t0 = this.getTransition("t0"); } } ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr"; class ui_UITurntable_com2 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "UITurntable_com2")); } onConstruct() { this.c1 = this.getController("c1"); this.n4 = (this.getChild("n4")); this.n6 = (this.getChild("n6")); this.n10 = (this.getChild("n10")); this.n11 = (this.getChild("n11")); this.n12 = (this.getChild("n12")); this.n13 = (this.getChild("n13")); this.n14 = (this.getChild("n14")); this.n15 = (this.getChild("n15")); this.n16 = (this.getChild("n16")); this.n17 = (this.getChild("n17")); this.n18 = (this.getChild("n18")); this.n19 = (this.getChild("n19")); this.n20 = (this.getChild("n20")); this.n21 = (this.getChild("n21")); this.n22 = (this.getChild("n22")); this.n23 = (this.getChild("n23")); this.n24 = (this.getChild("n24")); this.n25 = (this.getChild("n25")); this.n26 = (this.getChild("n26")); this.n27 = (this.getChild("n27")); this.n28 = (this.getChild("n28")); this.n29 = (this.getChild("n29")); this.n30 = (this.getChild("n30")); this.n31 = (this.getChild("n31")); this.n32 = (this.getChild("n32")); this.n33 = (this.getChild("n33")); } } ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks"; class ui_UITurntable_com1_1 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "UITurntable_com1_1")); } onConstruct() { this.n5 = (this.getChild("n5")); this.n4 = (this.getChild("n4")); this.t0 = this.getTransition("t0"); } } ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt"; class ui_UITurntable_com5 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "UITurntable_com5")); } onConstruct() { this.flashNode = (this.getChild("flashNode")); this.rotNode = (this.getChild("rotNode")); this.n3 = (this.getChild("n3")); this.n21 = (this.getChild("n21")); this.t0 = this.getTransition("t0"); } } ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz"; class ui_UITurntable_com7 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "UITurntable_com7")); } onConstruct() { this.n2 = (this.getChild("n2")); this.n35 = (this.getChild("n35")); this.img1 = (this.getChild("img1")); this.img2 = (this.getChild("img2")); this.img3 = (this.getChild("img3")); this.img4 = (this.getChild("img4")); this.img6 = (this.getChild("img6")); this.img5 = (this.getChild("img5")); this.txt1 = (this.getChild("txt1")); this.txt2 = (this.getChild("txt2")); this.txt3 = (this.getChild("txt3")); this.txt4 = (this.getChild("txt4")); this.txt5 = (this.getChild("txt5")); this.txt6 = (this.getChild("txt6")); } } ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1"; class ui_UITurntable_com9 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "UITurntable_com9")); } onConstruct() { this.n38 = (this.getChild("n38")); this.n39 = (this.getChild("n39")); } } ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8"; class ui_UITurntable_com10 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "UITurntable_com10")); } onConstruct() { this.n39 = (this.getChild("n39")); this.n40 = (this.getChild("n40")); this.t0 = this.getTransition("t0"); } } ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9"; class ui_UITurntable_com11 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "UITurntable_com11")); } onConstruct() { this.n38 = (this.getChild("n38")); this.n39 = (this.getChild("n39")); this.n40 = (this.getChild("n40")); this.t0 = this.getTransition("t0"); } } ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la"; class ui_UITurntable_com12 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "UITurntable_com12")); } onConstruct() { this.n43 = (this.getChild("n43")); this.barNode = (this.getChild("barNode")); this.tipsTxt = (this.getChild("tipsTxt")); this.n45 = (this.getChild("n45")); this.boxBtn = (this.getChild("boxBtn")); } } ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb"; class ui_UITurntable_com1 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "UITurntable_com1")); } onConstruct() { this.n41 = (this.getChild("n41")); this.n42 = (this.getChild("n42")); this.t0 = this.getTransition("t0"); } } ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc"; class ui_UITurntable_com3 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "UITurntable_com3")); } onConstruct() { this.n48 = (this.getChild("n48")); this.womanTxt = (this.getChild("womanTxt")); this.t0 = this.getTransition("t0"); } } ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld"; class ui_cancelBtn2 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "cancelBtn2")); } onConstruct() { this.c1 = this.getController("c1"); this.n0 = (this.getChild("n0")); this.n1 = (this.getChild("n1")); this.n2 = (this.getChild("n2")); this.n3 = (this.getChild("n3")); this.n4 = (this.getChild("n4")); this.n5 = (this.getChild("n5")); this.n6 = (this.getChild("n6")); this.n7 = (this.getChild("n7")); this.n8 = (this.getChild("n8")); this.powerEft = (this.getChild("powerEft")); } } ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue"; class ui_shareBtn2 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "shareBtn2")); } onConstruct() { this.c1 = this.getController("c1"); this.n2 = (this.getChild("n2")); this.n24 = (this.getChild("n24")); this.n1 = (this.getChild("n1")); this.n3 = (this.getChild("n3")); this.n23 = (this.getChild("n23")); this.n4 = (this.getChild("n4")); this.n5 = (this.getChild("n5")); this.n6 = (this.getChild("n6")); this.n20 = (this.getChild("n20")); this.n21 = (this.getChild("n21")); this.n22 = (this.getChild("n22")); this.powerEft = (this.getChild("powerEft")); } } ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf"; class ui_UIMoney extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "UIMoney")); } onConstruct() { this.c1 = this.getController("c1"); this.n4 = (this.getChild("n4")); this.coinImg = (this.getChild("coinImg")); this.addCoinBtn = (this.getChild("addCoinBtn")); this.coinTxt = (this.getChild("coinTxt")); this.n7 = (this.getChild("n7")); this.addDiamondBtn = (this.getChild("addDiamondBtn")); this.diamondTxt = (this.getChild("diamondTxt")); this.diamondImg = (this.getChild("diamondImg")); this.n12 = (this.getChild("n12")); this.powerImg = (this.getChild("powerImg")); this.addPowerBtn = (this.getChild("addPowerBtn")); this.powerTxt = (this.getChild("powerTxt")); this.powerTimeTxt = (this.getChild("powerTimeTxt")); } } ui_UIMoney.URL = "ui://isxx5ak7wehi3ug"; class ui_backBtn extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "backBtn")); } onConstruct() { this.n0 = (this.getChild("n0")); this.t0 = this.getTransition("t0"); this.t1 = this.getTransition("t1"); } } ui_backBtn.URL = "ui://isxx5ak7wehi3ul"; class ui_MoneyBtn extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "MoneyBtn")); } onConstruct() { this.button = this.getController("button"); this.n0 = (this.getChild("n0")); } } ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un"; class ui_UIMoneyBtn extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "UIMoneyBtn")); } onConstruct() { this.n1 = (this.getChild("n1")); this.closeBtn = (this.getChild("closeBtn")); } } ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up"; class ui_Component64 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component64")); } onConstruct() { this.n57 = (this.getChild("n57")); this.n54 = (this.getChild("n54")); this.n55 = (this.getChild("n55")); this.n56 = (this.getChild("n56")); this.t1 = this.getTransition("t1"); } } ui_Component64.URL = "ui://isxx5ak7wp26456"; class ui_Component41_3 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component41_3")); } onConstruct() { this.c1 = this.getController("c1"); this.n0 = (this.getChild("n0")); this.n2 = (this.getChild("n2")); this.cancelBtn = (this.getChild("cancelBtn")); this.videoBtn = (this.getChild("videoBtn")); this.n9 = (this.getChild("n9")); this.n24 = (this.getChild("n24")); this.n27 = (this.getChild("n27")); this.titleTxt = (this.getChild("titleTxt")); this.n28 = (this.getChild("n28")); this.t0 = this.getTransition("t0"); } } ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1"; class ui_dh_zs_4 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "dh_zs_4")); } onConstruct() { this.n1 = (this.getChild("n1")); this.n2 = (this.getChild("n2")); this.n3 = (this.getChild("n3")); this.n4 = (this.getChild("n4")); this.n5 = (this.getChild("n5")); this.n6 = (this.getChild("n6")); this.n8 = (this.getChild("n8")); this.t0 = this.getTransition("t0"); } } ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2"; class ui_Component71_1 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "Component71_1")); } onConstruct() { this.n17 = (this.getChild("n17")); this.t0 = this.getTransition("t0"); } } ui_Component71_1.URL = "ui://isxx5ak7xs1r47w"; class ui_Component83 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component83")); } onConstruct() { this.c1 = this.getController("c1"); this.n17 = (this.getChild("n17")); this.n19 = (this.getChild("n19")); this.n20 = (this.getChild("n20")); } } ui_Component83.URL = "ui://isxx5ak7xs1r47z"; class ui_Component84 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component84")); } onConstruct() { this.c1 = this.getController("c1"); this.n4 = (this.getChild("n4")); this.n22 = (this.getChild("n22")); this.n23 = (this.getChild("n23")); this.numTxt = (this.getChild("numTxt")); this.n25 = (this.getChild("n25")); this.n26 = (this.getChild("n26")); } } ui_Component84.URL = "ui://isxx5ak7xs1r480"; class ui_Component84_1 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component84_1")); } onConstruct() { this.c1 = this.getController("c1"); this.n4 = (this.getChild("n4")); this.n22 = (this.getChild("n22")); this.n23 = (this.getChild("n23")); this.numTxt = (this.getChild("numTxt")); this.n25 = (this.getChild("n25")); this.n26 = (this.getChild("n26")); } } ui_Component84_1.URL = "ui://isxx5ak7xs1r481"; class ui_Component85 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component85")); } onConstruct() { this.n1 = (this.getChild("n1")); this.n6 = (this.getChild("n6")); this.n2 = (this.getChild("n2")); this.n3 = (this.getChild("n3")); this.levelTxt = (this.getChild("levelTxt")); this.n10 = (this.getChild("n10")); this.n11 = (this.getChild("n11")); this.n12 = (this.getChild("n12")); this.n13 = (this.getChild("n13")); this.n14 = (this.getChild("n14")); this.modeNode = (this.getChild("modeNode")); this.n18 = (this.getChild("n18")); this.conditionTxt = (this.getChild("conditionTxt")); this.diamondNode = (this.getChild("diamondNode")); this.coinNode = (this.getChild("coinNode")); this.startBtn = (this.getChild("startBtn")); this.n28 = (this.getChild("n28")); this.displayRoot = (this.getChild("displayRoot")); this.t0 = this.getTransition("t0"); } } ui_Component85.URL = "ui://isxx5ak7xs1r482"; class ui_Component86 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "Component86")); } onConstruct() { this.n15 = (this.getChild("n15")); this.t0 = this.getTransition("t0"); } } ui_Component86.URL = "ui://isxx5ak7xs1r483"; class ui_Component87 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component87")); } onConstruct() { this.n66 = (this.getChild("n66")); this.myProgress = (this.getChild("myProgress")); this.starAni = (this.getChild("starAni")); this.hpTxt = (this.getChild("hpTxt")); this.n74 = (this.getChild("n74")); this.n73 = (this.getChild("n73")); this.ballTxt = (this.getChild("ballTxt")); this.n76 = (this.getChild("n76")); this.helpLineBtn = (this.getChild("helpLineBtn")); this.levelTxt = (this.getChild("levelTxt")); this.star1 = (this.getChild("star1")); this.star2 = (this.getChild("star2")); this.star3 = (this.getChild("star3")); } } ui_Component87.URL = "ui://isxx5ak7xs1r48m"; class ui_Component88 extends fgui.GProgressBar { static createInstance() { return (fgui.UIPackage.createObject("game", "Component88")); } onConstruct() { this.n68 = (this.getChild("n68")); this.bar = (this.getChild("bar")); } } ui_Component88.URL = "ui://isxx5ak7xs1r48n"; class ui_Component89 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component89")); } onConstruct() { this.c1 = this.getController("c1"); this.n71 = (this.getChild("n71")); this.n72 = (this.getChild("n72")); } } ui_Component89.URL = "ui://isxx5ak7xs1r48o"; class ui_Component90 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("game", "Component90")); } onConstruct() { this.c1 = this.getController("c1"); this.n64 = (this.getChild("n64")); this.n65 = (this.getChild("n65")); this.n66 = (this.getChild("n66")); this.t0 = this.getTransition("t0"); } } ui_Component90.URL = "ui://isxx5ak7xs1r48p"; class ui_Component127 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("game", "Component127")); } onConstruct() { this.n5 = (this.getChild("n5")); } } ui_Component127.URL = "ui://isxx5ak7yjr4v4m6"; class gameBinder { static bindAll() { fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem); fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92); fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129); fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130); fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft); fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay); fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay); fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79); fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80); fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign); fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal); fgui.UIObjectFactory.setExtension(ui_UILogin.URL, ui_UILogin); fgui.UIObjectFactory.setExtension(ui_UIReg.URL, ui_UIReg); fgui.UIObjectFactory.setExtension(ui_Button_reg.URL, ui_Button_reg); fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode); fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1); fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2); fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128); fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1); fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142); fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang); fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry); fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1); fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2); fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3); fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1); fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2); fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu); fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143); fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2); fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1); fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3); fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1); fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1); fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2); fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3); fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104); fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105); fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106); fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1); fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1); fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1); fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2); fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3); fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2); fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1); fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3); fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1); fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107); fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1); fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox); fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2); fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4); fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3); fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97); fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98); fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11); fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11); fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop); fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100); fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101); fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53); fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58); fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59); fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode); fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108); fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63); fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg); fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode); fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress); fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress); fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay); fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode); fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare); fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn); fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn); fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn); fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod); fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode); fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn); fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd); fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18); fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45); fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay); fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList); fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49); fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50); fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51); fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5); fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124); fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125); fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52); fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn); fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43); fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay); fgui.UIObjectFactory.setExtension(ui_Component_phb.URL, ui_Component_phb); fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3); fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4); fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7); fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8); fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10); fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11); fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12); fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13); fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei); fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g); fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing); fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai); fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2); fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2); fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1); fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1); fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill); fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special); fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145); fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni); fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn); fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146); fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11); fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1); fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1); fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123); fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2); fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1); fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133); fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134); fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135); fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137); fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi); fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138); fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139); fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140); fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141); fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain); fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame); fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode); fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball); fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1); fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94); fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95); fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126); fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft); fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60); fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3); fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1); fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2); fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3); fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation); fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1); fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1); fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1); fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2); fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3); fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4); fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36); fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37); fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting); fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39); fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40); fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips); fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41); fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42); fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching); fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli); fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g); fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai); fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa); fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang); fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng); fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa); fgui.UIObjectFactory.setExtension(ui_Button_login.URL, ui_Button_login); fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1); fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30); fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1); fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31); fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward); fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32); fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem); fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp); fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking); fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1); fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2); fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3); fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4); fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5); fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem); fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9); fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10); fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11); fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13); fgui.UIObjectFactory.setExtension(ui_Component_dl_zc.URL, ui_Component_dl_zc); fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122); fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem); fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26); fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28); fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302); fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113); fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114); fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115); fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117); fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection); fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1); fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary); fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61); fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62); fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root); fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root); fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode); fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan); fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border); fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine); fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp); fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2); fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1); fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn); fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118); fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119); fgui.UIObjectFactory.setExtension(ui_daoJuDisplay.URL, ui_daoJuDisplay); fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1); fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay); fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay); fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin); fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11); fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112); fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111); fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144); fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2); fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang); fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax); fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1); fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5); fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8); fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6); fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7); fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw); fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2); fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2); fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1); fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5); fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7); fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9); fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10); fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11); fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12); fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1); fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3); fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2); fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2); fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney); fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn); fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn); fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn); fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64); fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3); fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4); fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp); fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1); fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83); fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84); fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1); fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85); fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86); fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87); fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88); fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89); fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90); fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127); } } class ui_btn6 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("loading", "btn6")); } onConstruct() { this.n6 = (this.getChild("n6")); this.n1 = (this.getChild("n1")); } } ui_btn6.URL = "ui://37nctnhwc6l6v4em"; class ui_xyItem extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("loading", "xyItem")); } onConstruct() { this.xyItem = (this.getChild("xyItem")); } } ui_xyItem.URL = "ui://37nctnhwcpayv4el"; class ui_loadinfo extends fgui.GProgressBar { static createInstance() { return (fgui.UIPackage.createObject("loading", "loadinfo")); } onConstruct() { this.bg = (this.getChild("bg")); this.bar = (this.getChild("bar")); this.title = (this.getChild("title")); this.ani = (this.getChild("ani")); } } ui_loadinfo.URL = "ui://37nctnhwis36c"; class ui_xyNode extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("loading", "xyNode")); } onConstruct() { this.n0 = (this.getChild("n0")); this.btnYes = (this.getChild("btnYes")); this.btnNo = (this.getChild("btnNo")); this.btnKnown = (this.getChild("btnKnown")); this.btnSure = (this.getChild("btnSure")); this.txtWelcom = (this.getChild("txtWelcom")); this.txtXy = (this.getChild("txtXy")); this.n75 = (this.getChild("n75")); this.btnXy1 = (this.getChild("btnXy1")); this.btnXy3 = (this.getChild("btnXy3")); this.btnXy2 = (this.getChild("btnXy2")); this.n74 = (this.getChild("n74")); this.xy1 = (this.getChild("xy1")); this.txtTitle = (this.getChild("txtTitle")); this.btnBack = (this.getChild("btnBack")); this.xyList = (this.getChild("xyList")); this.xy2 = (this.getChild("xy2")); this.xyNode = (this.getChild("xyNode")); } } ui_xyNode.URL = "ui://37nctnhwjvenv4ee"; class ui_ageNode extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("loading", "ageNode")); } onConstruct() { this.n3 = (this.getChild("n3")); this.n7 = (this.getChild("n7")); this.n4 = (this.getChild("n4")); this.btnAge = (this.getChild("btnAge")); this.ageNode = (this.getChild("ageNode")); } } ui_ageNode.URL = "ui://37nctnhwjvenv4ef"; class ui_rnNode extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("loading", "rnNode")); } onConstruct() { this.n28 = (this.getChild("n28")); this.n30 = (this.getChild("n30")); this.n33 = (this.getChild("n33")); this.rn1 = (this.getChild("rn1")); this.n40 = (this.getChild("n40")); this.n41 = (this.getChild("n41")); this.rn3 = (this.getChild("rn3")); this.n37 = (this.getChild("n37")); this.n39 = (this.getChild("n39")); this.rn2 = (this.getChild("rn2")); this.n47 = (this.getChild("n47")); this.n49 = (this.getChild("n49")); this.n44 = (this.getChild("n44")); this.inputCode = (this.getChild("inputCode")); this.inputName = (this.getChild("inputName")); this.n48 = (this.getChild("n48")); this.n50 = (this.getChild("n50")); this.rn4 = (this.getChild("rn4")); this.btnCheck = (this.getChild("btnCheck")); this.btnExit = (this.getChild("btnExit")); this.btnDone = (this.getChild("btnDone")); this.rnNode = (this.getChild("rnNode")); } } ui_rnNode.URL = "ui://37nctnhwjvenv4eg"; class ui_tipNode extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("loading", "tipNode")); } onConstruct() { this.bg = (this.getChild("bg")); this.n55 = (this.getChild("n55")); this.n56 = (this.getChild("n56")); this.tipNode = (this.getChild("tipNode")); } } ui_tipNode.URL = "ui://37nctnhwjvenv4eh"; class ui_fcmNode extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("loading", "fcmNode")); } onConstruct() { this.n63 = (this.getChild("n63")); this.n62 = (this.getChild("n62")); this.btnRn = (this.getChild("btnRn")); this.n61 = (this.getChild("n61")); this.n58 = (this.getChild("n58")); this.fcmNode = (this.getChild("fcmNode")); } } ui_fcmNode.URL = "ui://37nctnhwjvenv4ei"; class ui_msgNode extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("loading", "msgNode")); } onConstruct() { this.n69 = (this.getChild("n69")); this.txtMsg = (this.getChild("txtMsg")); this.msgNode = (this.getChild("msgNode")); } } ui_msgNode.URL = "ui://37nctnhwjvenv4ek"; class ui_dh_zy_ganfa$1 extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa")); } onConstruct() { this.n1 = (this.getChild("n1")); this.n13 = (this.getChild("n13")); this.n14 = (this.getChild("n14")); this.n15 = (this.getChild("n15")); this.n3 = (this.getChild("n3")); this.n4 = (this.getChild("n4")); this.n5 = (this.getChild("n5")); this.n6 = (this.getChild("n6")); this.n7 = (this.getChild("n7")); this.n8 = (this.getChild("n8")); this.n9 = (this.getChild("n9")); this.n10 = (this.getChild("n10")); this.n12 = (this.getChild("n12")); this.n11 = (this.getChild("n11")); this.n16 = (this.getChild("n16")); this.n17 = (this.getChild("n17")); this.n18 = (this.getChild("n18")); this.n20 = (this.getChild("n20")); this.n21 = (this.getChild("n21")); this.t0 = this.getTransition("t0"); } } ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u"; class ui_btn5 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("loading", "btn5")); } onConstruct() { this.n9 = (this.getChild("n9")); this.n1 = (this.getChild("n1")); } } ui_btn5.URL = "ui://37nctnhwm0q7v4ed"; class ui_UILoading extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("loading", "UILoading")); } onConstruct() { this.n12 = (this.getChild("n12")); this.loadinfo = (this.getChild("loadinfo")); this.n13 = (this.getChild("n13")); this.txtLoad = (this.getChild("txtLoad")); this.n18 = (this.getChild("n18")); } } ui_UILoading.URL = "ui://37nctnhwphc33"; class ui_AgeItem extends fgui.GComponent { static createInstance() { return (fgui.UIPackage.createObject("loading", "AgeItem")); } onConstruct() { this.txtAge = (this.getChild("txtAge")); } } ui_AgeItem.URL = "ui://37nctnhwxe622n"; class ui_btn1 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("loading", "btn1")); } onConstruct() { this.n6 = (this.getChild("n6")); this.n1 = (this.getChild("n1")); } } ui_btn1.URL = "ui://37nctnhwxe622p"; class ui_btn3 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("loading", "btn3")); } onConstruct() { this.n9 = (this.getChild("n9")); this.n1 = (this.getChild("n1")); } } ui_btn3.URL = "ui://37nctnhwxe622s"; class ui_btn2 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("loading", "btn2")); } onConstruct() { this.n6 = (this.getChild("n6")); this.n1 = (this.getChild("n1")); } } ui_btn2.URL = "ui://37nctnhwxe622t"; class ui_btnBack extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("loading", "btnBack")); } onConstruct() { this.n6 = (this.getChild("n6")); this.n7 = (this.getChild("n7")); } } ui_btnBack.URL = "ui://37nctnhwxe622u"; class ui_btnXy1 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("loading", "btnXy1")); } onConstruct() { this.n1 = (this.getChild("n1")); } } ui_btnXy1.URL = "ui://37nctnhwxe622w"; class ui_btnXy2 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("loading", "btnXy2")); } onConstruct() { this.n1 = (this.getChild("n1")); } } ui_btnXy2.URL = "ui://37nctnhwxe622x"; class ui_btnXy3 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("loading", "btnXy3")); } onConstruct() { this.n1 = (this.getChild("n1")); } } ui_btnXy3.URL = "ui://37nctnhwxe622y"; class ui_btn4 extends fgui.GButton { static createInstance() { return (fgui.UIPackage.createObject("loading", "btn4")); } onConstruct() { this.n9 = (this.getChild("n9")); this.n1 = (this.getChild("n1")); } } ui_btn4.URL = "ui://37nctnhwxe622z"; class loadingBinder { static bindAll() { fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6); fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem); fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo); fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode); fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode); fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode); fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode); fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode); fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode); fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1); fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5); fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading); fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem); fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1); fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3); fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2); fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack); fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1); fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2); fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3); fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4); fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu); } } class UIMgr { constructor() { this._stage = null; this._uiList = []; this._showList = []; this._bindPkgList = []; this.uiIndex = 0; } static get inst() { if (UIMgr._inst == null) { UIMgr._inst = new UIMgr(); } return UIMgr._inst; } setStage(s) { if (this._stage) { console.log("ViewMgr::Stage->舞台不可赋值两次"); return; } this._stage = s; } clearTempData() { console.log('zh:clearTempData start'); Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level'); console.log('zh:clearTempData end'); } init() { this.setStage(Laya.stage); fairygui.UIConfig.defaultFont = "微软雅黑"; fairygui.UIConfig.modalLayerColor = "rgba(0,0,0,0.9)"; fairygui.UIConfig.packageFileExtension = "obj"; fairygui.UIConfig.bringWindowToFrontOnClick = false; Laya.stage.addChild(fairygui.GRoot.inst.displayObject); fairygui.GRoot.inst.width = Laya.stage.width; fairygui.GRoot.inst.height = Laya.stage.height; Laya.timer.frameLoop(1, this, this.addAllUpdate); } addAllUpdate() { this.uiIndex = 0; for (; this.uiIndex < this._uiList.length; this.uiIndex++) { if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) { this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001); } } } bindFUI(pkgname) { if (this._bindPkgList.indexOf(pkgname) >= 0) { return; } switch (pkgname) { case fguiRes.loading: fairygui.UIPackage.addPackage(pkgname); loadingBinder.bindAll(); this._bindPkgList.push(pkgname); break; case fguiRes.game: fairygui.UIPackage.addPackage(pkgname); gameBinder.bindAll(); this._bindPkgList.push(pkgname); break; default: break; } } Show(cls, ...param) { let nameStr = cls.uiName; for (let i = this._uiList.length - 1; i >= 0; i--) { let temp = this._uiList[i]; let str = temp.className; if (str == nameStr) { if (temp.isMuti) { if (temp.isHide) { temp.show(...param); this._uiList.splice(i, 1); this._uiList.push(temp); return temp; } } else { temp.show(...param); this._uiList.splice(i, 1); this._uiList.push(temp); return temp; } } } let ui = new cls(); ui.className = nameStr; this._showUI(ui, param); return ui; } destroyUI(ui) { for (let i = this._uiList.length - 1; i >= 0; i--) { let temp = this._uiList[i].className; if (temp == ui.className) { this._uiList.splice(i, 1); break; } } this.checkUIState(); } _showUI(ui, param) { this._uiList.push(ui); ui.show(...param); } Hide(uiClass) { let ui = this.getUI(uiClass); if (ui && !ui.isHide) { ui.hide(); } } getUI(ui) { let nameStr = ui.uiName; for (let index = 0; index < this._uiList.length; index++) { let temp = this._uiList[index]; if (temp.className == nameStr) { return temp; } } return null; } isShow(cls) { for (var i of this._uiList) { if (i instanceof cls) { return i.isShowing; } } return false; } showUINum() { let num = 0; for (var i of this._uiList) { if (i.isShowing) { num++; } } return num; } checkUIState() { Laya.timer.clear(this, this._uiCheck); Laya.timer.once(400, this, this._uiCheck); } _uiCheck() { let showList = []; for (var i of this._uiList) { if (!i.isHide) { showList.push(i); } } for (let index = 0; index < showList.length; index++) { if (index == showList.length - 1) { showList[index].checkActive(true); } else { showList[index].checkActive(false); } } } showTip(msg, time = 600, size = 30) { } } class UIShowList { } class SoundMgr { constructor() { this.soundMax = 4; this.isLoad = false; this.soundMap = {}; this.isSound = true; this.openShake = true; SoundMgr._instance = this; } static getInstance() { if (!this._instance) { this._instance = new SoundMgr(); } return this._instance; } init() { console.log('zh:sm init 1'); Laya.SoundManager.autoReleaseSound = true; Laya.SoundManager.autoStopMusic = true; Laya.SoundManager.musicVolume = 0.3; Laya.SoundManager.soundVolume = 0.5; this.musicPlayed = false; this.audioUrl = "asset/sound/ogg/"; console.log('zh:sm init 2'); console.log('zh:dev type '); if (Laya.Browser.onAndroid) { console.log('zh:dev type android'); this.audioUrl = "asset/sound/ogg/"; this.isLoad = true; } else { console.log('zh:dev type not android'); this.audioUrl = "asset/sound/mp3/"; this.isLoad = true; } } onSetting(isS) { this.isSound = isS; this.mute(!this.isSound); } clearCount() { for (var key in this.soundMap) { delete this.soundMap[key]; } } playMusic(path, loop = 0) { console.log('zh:playMusic 1 PATH=' + path); this.musicPath = path; if (!this.isLoad) { return; } if (!path || path == "") { return; } if (!this.isSound) { return; } this.musicPlayed = true; let url = this.getUrl(path); if (!Laya.Browser.onAndroid) { Laya.loader.load(url, Laya.Handler.create(this, () => { this.play(url, loop); })); } else { this.play(url, loop); } } play(url, loop) { Laya.SoundManager.playMusic(url, loop); } getUrl(path) { let url = this.audioUrl + path; if (Laya.Browser.onAndroid) { url += ".ogg"; } else { url += ".mp3"; } return url; } pauseMusic(pause) { if (pause) { this.mute(true); } else if (this.isSound) this.mute(false); } stopMusic() { Laya.SoundManager.stopMusic(); if (Moyu.isNeedPlatAudio) { Moyu.stopMusic(); } } mute(mute) { if (Moyu.isNeedPlatAudio) { Moyu.pauseMusic(mute); } else { Laya.SoundManager.musicMuted = mute; if (!mute && !this.musicPlayed && this.musicPath) { this.playMusic(this.musicPath); } } } stopSound(path) { let url = this.getUrl(path); Laya.SoundManager.stopSound(url); } playSound(path, loop = 1, soundMax = this.soundMax) { if (!this.isLoad) return; if (!this.isSound) return; if (!path || path == "") return; let url = this.getUrl(path); if (Moyu.isNeedPlatAudio) { Moyu.playSound(path, loop == 0); } else { let count = 1; if (this.soundMap[path]) count = this.soundMap[path] + 1; if (count > soundMax) return; this.soundMap[path] = count; Laya.SoundManager.playSound(url, loop); Laya.timer.once(500 * loop, this, this.removePath, [path], false); } } removePath(path) { if (this.soundMap[path]) { let count = this.soundMap[path]; count--; if (count < 1) delete this.soundMap[path]; else this.soundMap[path] = count; } } playBtnSound() { this.playSound("btn"); } playGetSound() { } playCloseUISound() { } } SoundMgr._instance = null; var Handler$1 = Laya.Handler; var EResType; (function (EResType) { EResType[EResType["none"] = 0] = "none"; EResType[EResType["nromal"] = 1] = "nromal"; EResType[EResType["td"] = 2] = "td"; EResType[EResType["sk"] = 3] = "sk"; })(EResType || (EResType = {})); class CResLoader { constructor(doneCall, proCall) { this.completrCall = doneCall; this.progressCall = proCall; this.progressHander = new Handler$1(this, this.onProgress); this.tdResMap = {}; } load(resList) { this.resCount = 0; this.loadCount = 0; for (let i = 0; i < resList.length; i++) { let path = resList[i]; if (!path) continue; this.resCount++; let type = this.getResType(path); if (type == EResType.nromal) this.loadNromal(path); else if (type == EResType.td) this.loadTd(path); } } getRes(path) { let type = this.getResType(path); if (type == EResType.nromal) return Laya.loader.getRes(path); else if (type == EResType.td) { let res = this.tdResMap[path]; if (res) return res.clone(); return null; } } destroy() { this.progressHander.clear(); this.progressHander = null; } clearRes(path) { let type = this.getResType(path); if (type == EResType.nromal) Laya.loader.clearRes(path); else if (type == EResType.td) { let obj = this.tdResMap[path]; if (obj) obj.destroy(); delete this.tdResMap[path]; } } getResType(path) { let exs = this.getExtension(path); if (exs == "sk") return EResType.sk; if (exs == "ls" || exs == "lh" || exs == "lm") return EResType.td; else return EResType.nromal; } getExtension(res) { var index = res.lastIndexOf("."); return res.substr(index + 1); } loadNromal(path) { Laya.loader.load(path, Laya.Handler.create(this, (res) => { if (res) { this.onLoad(); } else console.log("load res fail:" + path); }), this.progressHander); } loadSk() { } loadTd(path) { if (this.tdResMap[path]) { this.onLoad(); return; } Laya.Sprite3D.load(path, Handler$1.create(this, (res) => { if (res) { this.tdResMap[path] = res; this.onLoad(); } else console.log("load res fail:" + path); })); } onLoad() { this.loadCount++; this.onProgress(1); if (this.loadCount >= this.resCount) { this.completrCall.run(); } } onProgress(pro) { let progress = (this.loadCount + pro) / this.resCount; this.progressCall.runWith(progress); } } var Handler$2 = Laya.Handler; class ResInfo { constructor() { this.index = 0; } } class ResMgr { constructor() { this.resList = []; this.doneList = []; this.resMap = {}; this.currentLoad = null; this.completeHandler = new Handler$2(this, this.onComplete); this.progressHandler = new Handler$2(this, this.onProgress); this.loader = new CResLoader(this.completeHandler, this.progressHandler); } static getInstance() { if (ResMgr._instance == null) { ResMgr._instance = new ResMgr(); } return ResMgr._instance; } loadList(list, completeHandler, progressHandler) { if (list.length < 1) { completeHandler.run(); return; } let info = this.getResInfo(); info.resList = list; info.completeHandler = completeHandler; info.progressHandler = progressHandler; this.resList.push(info); this.startLoad(); } loadFguiRes(list, completeHandler, progressHandler) { Laya.loader.load(list, completeHandler, progressHandler); } loadAny(list, completeHandler, progressHandler) { Laya.loader.load(list, completeHandler, progressHandler); } load(path, completeHandler, progressHandler) { let count = this.resMap[path]; if (count && count > 0) { if (completeHandler) completeHandler.run(); } else this.loadList([path], completeHandler, progressHandler); } getRes(path) { let res = this.resMap[path]; if (!res) this.showLog("资源不存在:" + path); else return this.loader.getRes(path); } clearList(list, force = false) { if (!list || list.length < 1) return; let cr = () => { for (const k in list) { let v = list[k]; if (!v) continue; if (force) { this.loader.clearRes(v); delete this.resMap[v]; } else { let count = this.resMap[v]; if (count && count > 1) { count--; this.resMap[v] = count; } else { this.loader.clearRes(v); delete this.resMap[v]; } } } if (!window.hasOwnProperty("ks")) Laya.Resource.destroyUnusedResources(); }; Laya.timer.clearAll(this); Laya.timer.once(2000, this, cr); } clear3D() { for (const k in this.loader.tdResMap) { this.loader.clearRes(k); if (this.resMap[k]) delete this.resMap[k]; } if (!window.hasOwnProperty("ks")) Laya.Resource.destroyUnusedResources(); } clear(path, force = false) { this.clearList([path], force); } getResInfo() { if (this.doneList.length > 0) return this.doneList.pop(); else return new ResInfo(); } startLoad() { if (this.currentLoad) return; this.currentLoad = this.resList.pop(); if (this.currentLoad) { this.loader.load(this.currentLoad.resList); } } onComplete() { if (!this.currentLoad) return; for (const k in this.currentLoad.resList) { let v = this.currentLoad.resList[k]; let count = this.resMap[v]; if (count) count++; else count = 1; this.resMap[v] = count; } if (this.currentLoad.completeHandler) this.currentLoad.completeHandler.run(); this.doneList.push(this.currentLoad); this.currentLoad = null; this.startLoad(); } onProgress(pro) { if (!this.currentLoad) return; if (this.currentLoad.progressHandler) this.currentLoad.progressHandler.runWith(pro); } showLog(str, ...args) { console.log("[ResLoader] " + str); } } ResMgr._instance = null; class EventMgr extends Laya.EventDispatcher { } let eventMgr = new EventMgr(); /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ /* global Reflect, Promise */ var extendStatics = function(d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; function __extends(d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); } var __assign = function() { __assign = Object.assign || function __assign(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; function __rest(s, e) { var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) t[p[i]] = s[p[i]]; return t; } function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; } function __param(paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } } function __metadata(metadataKey, metadataValue) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); } function __awaiter(thisArg, _arguments, P, generator) { return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); } function __generator(thisArg, body) { var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); while (_) try { if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; if (y = 0, t) op = [op[0] & 2, t.value]; switch (op[0]) { case 0: case 1: t = op; break; case 4: _.label++; return { value: op[1], done: false }; case 5: _.label++; y = op[1]; op = [0]; continue; case 7: op = _.ops.pop(); _.trys.pop(); continue; default: if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } if (t[2]) _.ops.pop(); _.trys.pop(); continue; } op = body.call(thisArg, _); } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } } function __exportStar(m, exports) { for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; } function __values(o) { var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; if (m) return m.call(o); return { next: function () { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; } function __read(o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; } function __spread() { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); return ar; } function __await(v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } function __asyncGenerator(thisArg, _arguments, generator) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var g = generator.apply(thisArg, _arguments || []), i, q = []; return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } function fulfill(value) { resume("next", value); } function reject(value) { resume("throw", value); } function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } } function __asyncDelegator(o) { var i, p; return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } } function __asyncValues(o) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var m = o[Symbol.asyncIterator], i; return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } } function __makeTemplateObject(cooked, raw) { if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } return cooked; }; function __importStar(mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result.default = mod; return result; } function __importDefault(mod) { return (mod && mod.__esModule) ? mod : { default: mod }; } class CustomAlert { static show(title, content, buttons) { if (!Laya.Box || !Laya.Label || !Laya.Button) { console.error("UI模块未加载!请检查laya.ui.js是否引入"); return; } const bg = new Laya.Box(); bg.alpha = 0; bg.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height, "#000000AA"); Laya.stage.addChild(bg); Laya.Tween.to(bg, { alpha: 1 }, 200); const panel = new Laya.Box(); panel.graphics.drawRect(0, 0, 400, 250, "#cccccc"); panel.pos((Laya.stage.width - 400) / 2, (Laya.stage.height - 250) / 2); bg.addChild(panel); const titleText = new Laya.Text(); titleText.text = title; titleText.fontSize = 32; titleText.color = "#333333"; titleText.bold = true; titleText.pos(20, 20); titleText.width = 360; titleText.align = "center"; panel.addChild(titleText); const contentText = new Laya.Text(); contentText.text = content; contentText.fontSize = 21; contentText.color = "#555555"; contentText.pos(20, 70); contentText.width = 360; contentText.wordWrap = true; contentText.align = "center"; panel.addChild(contentText); const buttonContainer = new Laya.Box(); buttonContainer.pos(20, 160); panel.addChild(buttonContainer); const btnWidth = 120; const spacing = 30; const totalWidth = buttons.length * btnWidth + (buttons.length - 1) * spacing; buttons.forEach((btn, index) => { const button = new Laya.Button(); button.label = btn.label; button.size(btnWidth, 40); button.labelSize = 22; button.pos(index * (btnWidth + spacing), 0); button.labelColors = "#FFFFFF,#FFFFFF,#FFFFFF"; button.graphics.drawRect(0, 0, btnWidth, 40, "#4A90E2"); button.on(Laya.Event.MOUSE_OVER, this, () => { button.alpha = 0.9; }); button.on(Laya.Event.MOUSE_OUT, this, () => { button.alpha = 1; }); button.on(Laya.Event.CLICK, this, () => { btn.handler(); Laya.Tween.to(bg, { alpha: 0 }, 200, null, Laya.Handler.create(this, () => { bg.removeSelf(); })); }); buttonContainer.addChild(button); }); buttonContainer.x = (panel.width - totalWidth) / 2; } } class ConfigMgr { constructor() { this.httpReqCount = 4; this.httpReqOkCount = 0; this.getConfigFromServer = () => __awaiter(this, void 0, void 0, function* () { try { this.httpReqOkCount = 0; let reqData = JSON.stringify({ gameName: "TQ", gameUserName: "zhangSan" }); console.log('zh:第1个请求'); const classicCfg = yield this.sendPostAsync('getClassicCfg', reqData); this.classicCfg = classicCfg; this.httpReqOkCount++; console.log('zh:第2个请求'); const levelCfg = yield this.sendPostAsync('getLevelCfg', reqData); this.levelCfg = levelCfg; this.httpReqOkCount++; console.log('zh:第3个请求'); const placeBallCfg = yield this.sendPostAsync('getPlaceBallCfg', reqData); this.placeBallCfg = placeBallCfg; this.httpReqOkCount++; console.log('zh:第4个请求npc'); const npc = yield this.sendPostAsync('getNpc', reqData); this.npcJson = npc.Data; this.httpReqOkCount++; console.log('zh:所有配置加载完成'); } catch (error) { console.error('请求失败:', error); } finally { if (this.httpReqCount > this.httpReqOkCount) { CustomAlert.show("Prompt", "Failed to load resources. Check your network and restart the game.", [ { label: "Okay", handler: () => { console.log("zh:好的知道了"); JSBridgeUtils.instance.exitAndCloseGame(); } } ]); } } }); this.sendPostAsync = (action, reqData) => { return new Promise((resolve, reject) => { xGame.httpMgr.sendPost2025(action, reqData, (res) => { try { let code = res.code; if (code == 200) { const parsedData = JSON.parse(res.msg); resolve(parsedData); } else { console.log(`zh:res = ${JSON.stringify(res)}`); reject(new Error(`Request failed with code: ${code}`)); } } catch (error) { console.error(`error=${error}`); alert("Please check your network connection."); reject(error); } finally { console.log(`zh:${action}`); } }); }); }; } static getInstance() { if (!this._instance) { this._instance = new ConfigMgr(); } return this._instance; } init() { this.getConfigFromServer(); } test() { let reqData = JSON.stringify({ gameName: "TQ", gameUserName: "zhangSan" }); xGame.httpMgr.sendPost2025('getClassicCfg', reqData, (res) => { console.log('zh:1s'); try { let code = res.code; let data = res.data; if (code == 200) { const parsedData = JSON.parse(data); this.classicCfg = parsedData; } else { console.log('zh:res = ' + JSON.stringify(res)); } } catch (error) { console.log('error=' + error); alert("Please check your network connection."); } finally { console.log('zh:1'); } }); } getUserInfoByIndex(index) { return this.npcJson[index]; } getRandomUserInfo() { let index = xGame.tools.random(0, this.npcJson.length); let rs = this.npcJson[index]; return rs; } getMaxBigMoveLength() { return Object.keys(this.levelCfg).length; } getBigMoveLevelByIndex(index) { let cfg = this.levelCfg; cfg = cfg[index]; return cfg; } getRandomClassicLevel() { let cfg = this.classicCfg; let num = Object.keys(cfg).length; let rand = xGame.common.randomNum(1, num); return cfg[rand]; } getPlaceBallByLevel(level) { return this.placeBallCfg[level]; } getMaxPlaceBall() { return Object.keys(this.placeBallCfg).length; } } class PoolD3Mgr { constructor() { this.pool = {}; } static get ins() { return this._ins || (this._ins = new PoolD3Mgr); } createList(key, prefab, parent) { if (!this.pool[key]) { this.pool[key] = {}; this.pool[key].prefab = prefab; this.pool[key].list = []; this.pool[key].parent = parent; } } getItem(key) { if (!this.pool[key]) { return; } let temp; if (this.pool[key].list.length > 0) { temp = this.pool[key].list.pop(); } else { temp = this.pool[key].prefab.clone(); if (this.pool[key].parent) { this.pool[key].parent.addChild(temp); } } temp.active = true; return temp; } putItem(key, obj) { if (!this.pool[key]) { return; } obj.active = false; this.pool[key].list.push(obj); } } let context$1 = context; let uiMgr = UIMgr.inst; let soundMgr = SoundMgr.getInstance(); let resMgr = ResMgr.getInstance(); let httpMgr = HttpMgr.getInstance(); let common = Common.getInstance(); let cfgMgr = ConfigMgr.getInstance(); let poolD3Mgr = PoolD3Mgr.ins; let d3TexUrl = "res/d3Res/"; let d3ModeUrl = "res/unityRes/"; function setStageSize(view) { if (view.width) { view.width = Laya.stage.width; view.height = Laya.stage.height; } } function filledBg(view) { let wh = Laya.stage.height / Laya.stage.width; if (wh > 16 / 9) { view.height = Laya.stage.height; view.width = Laya.stage.height / 1334 * 750; } else { view.width = Laya.stage.width; view.height = Laya.stage.width / 750 * 1334; } } function setNotch(view) { if (view.height) { view.y += context$1.notchHeight; } } function showTip(str) { uiMgr.Show(UIMsg, str); } function log(...args) { console.log(args); } let xGame = { context: context$1, eventMgr, resMgr, uiMgr, soundMgr, define, tools, httpMgr, d3TexUrl, d3ModeUrl, common, cfgMgr, poolD3Mgr, setStageSize, filledBg, setNotch, showTip, log, }; window["xGame"] = xGame; let dataName = 'tBall_'; class UserData { constructor() { this.userId = ""; this.isAgree = false; this.coinNum = 0; this.gemNum = 0; this.sound = true; this.vibration = true; this.currentDate = 0; this.createTime = 0; this.awardTime = 0; this.roleId = 1; this.roleList = []; this.roleAds = []; this.dressId = 101; this.itemId = 201; this.bigSkills = [1, 1, 1, 1, 1]; this.coin = 4000; this.diamond = 0; this.skillSuccessTimes = 0; this.skillGuide = 0; this.skillAccTimes = 0; this.placeBallData = []; this.shareDiamondTimes = 0; this.dailyVideoShareTimes = 0; this.secretary = [1, 0]; this.curSecretary = 0; this.ballRod = [1, 0, 0, 0, 0, 1]; this.curBallRod = 5; this.signData = 0; this.signTime = 0; this.drawTimes = 0; this.drawAwardTimes = 0; this.dailyfreeDrawTimes = 1; this.power = 5; this.powerTime = 0; this.challengeTimes = 0; this.extraSign = 0; this.classicTimes = 0; this.guideHelpLine = 0; this.newUser = true; this.rootBallFoul = 0; this.timeoutFoul = 0; this.roleList = [1]; } saveData() { let data = {}; for (let k in this) { data[k.toString()] = this[k]; } Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data)); } getData() { let ld = Laya.LocalStorage.getItem(dataName + "userdata"); if (ld) { let localData = JSON.parse(ld); if (localData) { for (let k in this) { let key = k.toString(); let data = localData[key]; if (data != undefined) { this[k] = data; } } } } } } class ItemData { constructor() { this.itemList = {}; this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true }; this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true }; } saveData() { Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList)); } getData() { let ld = Laya.LocalStorage.getItem(dataName + "itemdata"); if (ld) { let localData = JSON.parse(ld); if (localData) { this.itemList = localData; } } } } class GameData { constructor() { this.curLevel = 0; this.gameType = 1; this.signIdx = 0; this.signMax = 0; this.rotaryTime = 0; this.rotaryCount = 0; this.rotaryList = []; this.diyCount = 3; this.awardIdx = 0; this.shareNum = 2; this.rankWeek = 0; this.rankScore = 0; this.gameCount = 0; this.trySkill = -1; this.tryTime = 0; } saveData() { let data = {}; for (let k in this) { data[k.toString()] = this[k]; } Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data)); } getData() { let ld = Laya.LocalStorage.getItem(dataName + "gamedata"); if (ld) { let localData = JSON.parse(ld); if (localData) { for (let k in this) { let key = k.toString(); let data = localData[key]; if (data != undefined) { this[k] = data; } } } } } } class Diy2025GameData { constructor() { this.challengeMode_overLev = 0; this.xszyForClassic = false; this.xszyForChallenge = false; } saveData() { let data = {}; for (let k in this) { data[k.toString()] = this[k]; } Laya.LocalStorage.setItem(dataName + "diydata", JSON.stringify(data)); } getData() { let ld = Laya.LocalStorage.getItem(dataName + "diydata"); if (ld) { let localData = JSON.parse(ld); if (localData) { for (let k in this) { let key = k.toString(); let data = localData[key]; if (data != undefined) { this[k] = data; } } } } } } class DataMgr { static Init() { this.userData = new UserData(); this.gameData = new GameData(); this.itemData = new ItemData(); this.diyGameData = new Diy2025GameData(); this.userData.getData(); this.gameData.getData(); this.itemData.getData(); this.diyGameData.getData(); this.roleId = this.userData.roleId; this.resetUse(); } static isNewDay() { Moyu.isNewDay(this, (isnew) => { xGame.common.isNewDay = isnew; if (!isnew) return; DataMgr.setShareDiamondTimes(0, false); DataMgr.setDailyVideoShareTimes(0, false); DataMgr.setDailyfreeDrawTimes(1); DataMgr.setExtraSign(0); }); } static deletData() { Laya.LocalStorage.clear(); } static upRankData() { let num = xGame.common.getAllStarNum(); if (num > 0) Moyu.upRankData(xGame.common.curRankID, num); } static addItem(id, count = 1) { let v = this.itemData.itemList[id]; if (!v) v = { id: id, count: count, adnum: 0, active: true }; else { if (v.active) { v.count += count; } else { v.count = count; v.active = true; } } this.itemData.itemList[id] = v; xGame.soundMgr.playGetSound(); this.saveItemData(); } static hasItem(id) { let v = this.itemData.itemList[id]; if (v && v.active) return true; return false; } static getItem(id) { let v = this.itemData.itemList[id]; return v; } static getItemCount(id) { let v = this.itemData.itemList[id]; if (v && v.active) return v.count; return 0; } static getItemAd(id) { let v = this.itemData.itemList[id]; if (v) { return v.adnum; } return 0; } static onItemAd(id, num = 1) { let v = this.itemData.itemList[id]; if (!v) v = { id: id, count: 1, adnum: num, active: false }; else v.adnum += num; this.itemData.itemList[id] = v; this.saveItemData(); } static costItem(id, count) { let v = this.itemData.itemList[id]; if (v && v.active) { if (v.count < count) return false; else { v.count -= count; this.itemData.itemList[id] = v; return true; } } return false; } static resetUse() { this.dressId = this.userData.dressId; this.itemId = this.userData.itemId; } static passLevel() { if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel) this.gameData.curLevel++; this.curLevel = this.gameData.curLevel; this.saveGameData(); } static useRole(id) { this.roleId = id; if (this.hasRole(id)) { this.userData.roleId = id; this.saveUserData(); } } static addRole(id) { if (this.hasRole(id)) return; this.userData.roleList.push(id); this.saveUserData(); } static hasRole(id) { return this.userData.roleList.indexOf(id) >= 0; } static gemEnough(num) { return this.userData.gemNum >= num; } static roleHasAd(id) { let count = this.userData.roleAds[id]; if (count != undefined && count >= 0) return true; else return false; } static saveUserData(time = 500, event, arg) { if (this.userSaving) return; this.userSaving = true; Laya.timer.once(time, this, () => { this.userSaving = false; this.userData.saveData(); if (event) xGame.eventMgr.event(event, arg); }); } static saveGameData() { if (this.gameSaving) return; this.gameSaving = true; Laya.timer.once(1000, this, () => { this.gameSaving = false; this.gameData.saveData(); }); } static saveItemData() { let fun = () => { this.itemData.saveData(); }; Laya.timer.clear(this, fun); Laya.timer.once(500, this, fun); } static saveData() { this.saveUserData(); this.saveGameData(); } static getBigSkillList() { return this.userData.bigSkills; } static getBigSkillByIndex(index) { return this.userData.bigSkills[index]; } static setBigSkill(index, val, addUp = true) { if (addUp) { this.userData.bigSkills[index] += val; } else { this.userData.bigSkills[index] = val; } this.saveUserData(); } static coinEnough(need) { if (typeof need != "number") { console.error("金币格式错误"); return; } return this.userData.coin >= need; } static setCoin(val) { if (typeof val != "number") { return; } this.userData.coin += val; this.saveUserData(); xGame.eventMgr.event(COIN_CHANGE); } static getCoin() { return this.userData.coin; } static diamondEnough(need) { if (typeof need != "number") { console.error("金币格式错误"); return; } return this.userData.diamond >= need; } static setDiamond(val) { if (typeof val != "number") { return; } this.userData.diamond += val; this.saveUserData(); xGame.eventMgr.event(DIAMOND_CHANGE); } static getDiamond() { return this.userData.diamond; } static getSkillSuccessTimes() { return this.userData.skillSuccessTimes; } static setSkillSuccessTimes(val, addUp = true) { if (addUp) this.userData.skillSuccessTimes += val; else this.userData.skillSuccessTimes = val; this.saveUserData(); } static getSkillAccTimes() { return this.userData.skillAccTimes; } static setSkillAccTimes(val) { this.userData.skillAccTimes += val; this.saveUserData(); } static getSkillGuide() { if (!xGame.common.openGuide) { return 1; } return this.userData.skillGuide; } static setSkillGuide(val) { this.userData.skillGuide = val; this.saveUserData(); } static getPlaceBallLevelList() { return this.userData.placeBallData; } static getPlaceBallLevel(level) { let arr = this.userData.placeBallData; let index = level - 1; let out; if (arr[index]) { out = arr[index]; } else { let max = arr.length; if (max == index) { out = { star: 0, play: true, isCur: true, getAward: false }; } else { out = { star: 0, play: false, getAward: false }; } } return out; } static setPlaceBallLevel(level, star) { let arr = this.userData.placeBallData; let index = level - 1; if (arr[index]) { arr[index].star = Math.max(arr[index].star, star); } else { let max = arr.length; if (max == index) { arr.push({ star: star, play: true, getAward: false }); } else { console.error("关卡存储出错"); } } this.saveUserData(); } static setPlaceBallAward(level) { let arr = this.userData.placeBallData; let index = level - 1; if (arr[index]) { arr[index].getAward = true; } this.saveUserData(); } static getShareDiamondTimes() { return this.userData.shareDiamondTimes; } static setShareDiamondTimes(val, addUp = true) { if (addUp) { this.userData.shareDiamondTimes += val; } else { this.userData.shareDiamondTimes = val; } this.saveUserData(); } static getDailyVideoShareTimes() { return this.userData.dailyVideoShareTimes; } static setDailyVideoShareTimes(val, addUp = true) { if (addUp) { this.userData.dailyVideoShareTimes += val; } else { this.userData.dailyVideoShareTimes = val; } this.saveUserData(); } static getSecretary(index) { return this.userData.secretary[index]; } static setSecretary(index, val) { this.userData.secretary[index] = val; this.saveUserData(); } static getCurSecretary() { return this.userData.curSecretary; } static setCurSecretary(index) { this.userData.curSecretary = index; this.saveUserData(); xGame.eventMgr.event(CHANGE_SECRETARY, index); } static getBallRod(index) { return this.userData.ballRod[index]; } static setBallRod(index, val) { this.userData.ballRod[index] = val; this.saveUserData(); } static getCurBallRod() { return this.userData.curBallRod; } static setCurBallRod(index) { this.userData.curBallRod = index; this.saveUserData(); } static setSignData(val) { this.userData.signData = val; this.saveUserData(); } static getSignData() { return this.userData.signData; } static setSignTime(val) { this.userData.signTime = val; this.saveUserData(); } static getSignTime() { return this.userData.signTime; } static getDrawTimes() { return this.userData.drawTimes; } static setDrawTimes(val, addUp = true) { if (addUp) { this.userData.drawTimes += val; } else { this.userData.drawTimes = val; } this.saveUserData(); } static getDrawAwardTimes() { return this.userData.drawAwardTimes; } static setDrawAwardTimes(val) { this.userData.drawAwardTimes = val; this.saveUserData(); } static getDailyfreeDrawTimes() { return this.userData.dailyfreeDrawTimes; } static setDailyfreeDrawTimes(val) { this.userData.dailyfreeDrawTimes = val; this.saveUserData(); } static setPower(val, addUp = true) { if (addUp) this.userData.power += val; else this.userData.power = val; if (this.userData.power >= xGame.common.maxPower) { this.userData.power = xGame.common.maxPower; } xGame.eventMgr.event(POWER_CHANGE, val); this.saveUserData(); } static getPower() { return this.userData.power; } static setPowerTime(val) { this.userData.powerTime = val; this.saveUserData(); } static getPowerTime() { return this.userData.powerTime; } static powerEnough() { return this.getPower() > 0; } static getChallengeTimes() { return this.userData.challengeTimes; } static setChallengeTimes(val) { this.userData.challengeTimes += val; this.saveUserData(); } static getExtraSign() { return this.userData.extraSign; } static setExtraSign(val) { this.userData.extraSign = val; this.saveUserData(); } static getClassicTimes() { return this.userData.classicTimes; } static setClassicTimes() { this.userData.classicTimes += 1; this.saveUserData(); } static getGuideHelpLine() { return this.userData.guideHelpLine; } static setGuideHelpLine() { this.userData.guideHelpLine = 1; this.saveUserData(); } static getNewUser() { return this.userData.newUser; } static setNewUser() { this.userData.newUser = false; this.saveUserData(); } static getRootBallFoul() { return this.userData.rootBallFoul; } static setRootBallFoul() { this.userData.rootBallFoul = 1; this.saveUserData(); } static getTimeoutFoul() { return this.userData.timeoutFoul; } static setTimeoutFoul() { this.userData.timeoutFoul = 1; this.saveUserData(); } static saveDiyGameData() { if (this.diyGameSaving) return; this.diyGameSaving = true; Laya.timer.once(500, this, () => { this.diyGameSaving = false; this.diyGameData.saveData(); }); } static getChallengeMode_overLev() { this.challengeMode_overLev = this.diyGameData.challengeMode_overLev; return this.challengeMode_overLev; } static setChallengeMode_overLev(levNum) { this.diyGameData.challengeMode_overLev = levNum; this.saveDiyGameData(); } } DataMgr.isNewUser = false; DataMgr.fristEnter = true; DataMgr.levelType = 0; DataMgr.DIY_challengeMode_overLev_jieSuo_mark = true; DataMgr.DIY_challengeMode_overLev_jieSuo_Classic = 2; DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod = 4; DataMgr.challengeMode_overLev = 0; DataMgr.xszyForClassic = false; DataMgr.xszyForChallenge = false; DataMgr.awardId = 0; DataMgr.awardCoin = 0; DataMgr.sceneId = -1; DataMgr.tryId = 0; DataMgr.curLevel = 1; DataMgr.vipLevel = 0; DataMgr.maxLevel = 0; DataMgr.awardRatio = 1; DataMgr.gameList = []; DataMgr.rankList = []; DataMgr.recoverTime = 480000; DataMgr.minScore = 0; DataMgr.rankDis = 0; DataMgr.userSaving = false; DataMgr.gameSaving = false; DataMgr.diyGameSaving = false; class D3Tween extends Laya.Script3D { constructor() { super(); this.isInited = false; } ; init() { if (this.isInited) return; this.isInited = true; this.gameObj = this.owner; this.transform = this.gameObj.transform; } get rotX() { return this.transform.localRotationEulerX; } set rotX(v) { this.transform.localRotationEulerX = v; } get rotY() { return this.transform.localRotationEulerY; } set rotY(v) { this.transform.localRotationEulerY = v; } get rotZ() { return this.transform.localRotationEulerZ; } set rotZ(v) { this.transform.localRotationEulerZ = v; } get posX() { return this.transform.localPositionX; } set posX(v) { this.transform.localPositionX = v; } get posY() { return this.transform.localPositionY; } set posY(v) { this.transform.localPositionY = v; } get posZ() { return this.transform.localPositionZ; } set posZ(v) { this.transform.localPositionZ = v; } get rotation() { return this.transform.localRotation; } set rotation(v) { this.transform.localRotation = v; } } class D2Hole extends Laya.Script { constructor() { super(); } onTriggerEnter(collider) { if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) { return; } if (collider.label == "inner" && xGame.common.d2World.openCheckStill) { if (collider.owner["mySrc"].isRunSkillAni) { return; } if (collider.owner["mySrc"].number != 0) { xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed); } xGame.common.ballColliHole(collider); xGame.common.recoverCameraView(); } } } class Table extends Laya.Script3D { constructor() { super(); this.isSetBorder = false; this.inited = false; } ; onAwake() { this.init(); } init() { if (this.inited) return; this.inited = true; this.gameObj = this.owner; this.border = this.gameObj.getChildByName("border"); } setBorderPos() { if (this.isSetBorder) return; this.isSetBorder = true; let ui = xGame.common.gameUI.ui; let bar1 = this.border.getChildByName("bar1"); let bar2 = this.border.getChildByName("bar2"); let bar3 = this.border.getChildByName("bar3"); let bar4 = this.border.getChildByName("bar4"); let bar5 = this.border.getChildByName("bar5"); let bar6 = this.border.getChildByName("bar6"); this.setInfo(bar1, ui.border.bar1, "box"); this.setInfo(bar2, ui.border.bar2, "box"); this.setInfo(bar3, ui.border.bar3, "box"); this.setInfo(bar4, ui.border.bar4, "box"); this.setInfo(bar5, ui.border.bar5, "box"); this.setInfo(bar6, ui.border.bar6, "box"); let circle1 = this.border.getChildByName("circle1"); let circle2 = this.border.getChildByName("circle2"); let circle3 = this.border.getChildByName("circle3"); let circle4 = this.border.getChildByName("circle4"); let circle5 = this.border.getChildByName("circle5"); let circle6 = this.border.getChildByName("circle6"); this.setInfo(circle1, ui.border.circle1, "circle"); this.setInfo(circle2, ui.border.circle2, "circle"); this.setInfo(circle3, ui.border.circle3, "circle"); this.setInfo(circle4, ui.border.circle4, "circle"); this.setInfo(circle5, ui.border.circle5, "circle"); this.setInfo(circle6, ui.border.circle6, "circle"); this.initHolePos(ui.border.circle1.x, ui.border.circle1.y); this.initHolePos(ui.border.circle2.x, ui.border.circle2.y); this.initHolePos(ui.border.circle3.x, ui.border.circle3.y); this.initHolePos(ui.border.circle4.x, ui.border.circle4.y); this.initHolePos(ui.border.circle5.x, ui.border.circle5.y); this.initHolePos(ui.border.circle6.x, ui.border.circle6.y); let arr = xGame.common.gameMgr.holePosList; xGame.common.gameMgr.posObj = { "1": arr[0], "3": arr[2], "4": arr[3], "6": arr[5] }; } initHolePos(x, y) { if (x < 300) x += 25; else if (x > 1000) x -= 25; else if (y > 200) y -= 10; else y += 10; if (y < 200) y += 30; else if (y > 500) y -= 30; xGame.common.gameMgr.holePosList.push({ x: x, y: y }); } setInfo(d3Obj, d2Obj, type) { let ui = xGame.common.gameUI.ui; let sprite = new Laya.Sprite(); ui.border.displayObject.addChild(sprite); let colli = xGame.common.getCollider(type); sprite.addComponentIntance(colli); let rigy = xGame.common.getRigbody(); rigy.type = "static"; sprite.addComponentIntance(rigy); let d3Pos = d3Obj.transform.position; xGame.common.pos3to2Convert(d3Pos); let scaleX = d3Obj.transform.localScaleX; let scaleZ = d3Obj.transform.localScaleZ; let width = xGame.common.scale3to2Convert(scaleZ); let height = xGame.common.scale3to2Convert(scaleX); sprite.pivotX = width / 2; sprite.pivotY = height / 2; sprite.x = d3Pos.x; sprite.y = d3Pos.y; sprite.width = width; sprite.height = height; d2Obj.x = d3Pos.x; d2Obj.y = d3Pos.y; d2Obj.width = width; d2Obj.height = height; if (type == "box") { colli.width = width; colli.height = height; colli.isSensor = false; colli.label = "border"; } else { colli.radius = width / 2; colli.isSensor = true; colli.label = "hole"; sprite.addComponent(D2Hole); } } } class D3World extends Laya.Script3D { constructor() { super(); this.loadNum = 0; this.setLoadNum = 7; this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 }; } onAwake() { } loadScene() { this.scene = this.owner; let url = `res/unityRes/root.lh`; Laya.loader.create(url, Laya.Handler.create(this, (prefab) => { this.scene.addChild(prefab); this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera"); this.putCameraInfo(); this.camera.enableHDR = false; this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot"); this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot"); this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot"); this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot"); this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot"); this.knife = this.scene.getChildByName("root").getChildByName("knife"); this.knife.active = false; this.loadD3Obj(); })); } putCameraInfo() { let root = this.scene.getChildByName("root").getChildByName("cameraRoot"); this.cameraObj = new cameraType(); this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween); this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween); this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween); this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween); this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween); this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween); this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween); this.visitAngleChild.init(); this.visitRootObj.posX = this.visitAngleChild.posX; this.visitRootObj.posY = this.visitAngleChild.posY; this.visitRootObj.posZ = this.visitAngleChild.posZ; this.visitRootObj.rotX = this.visitAngleChild.rotX; this.visitRootObj.rotY = this.visitAngleChild.rotY; this.visitRootObj.rotZ = this.visitAngleChild.rotZ; this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween); xGame.common.showOneCamera("mainCamera"); } loadD3Obj() { this.loadTable(); this.loadRoom(); this.loadInHoleParticial(); this.loadIceParticial(); this.loadHitParticial(); this.loadFireworksParticial(); this.loadBall(); } loadInHoleParticial() { this.loadD3Res("inHoleEft", "", (prefab) => { prefab.addComponent(Partical); xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot); }); } loadIceParticial() { this.loadD3Res("iceEft", "", (prefab) => { prefab.addComponent(Partical); xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot); }); } loadHitParticial() { this.loadD3Res("hitEft", "", (prefab) => { prefab.addComponent(Partical); xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot); }); } loadFireworksParticial() { this.loadD3Res("fireworksEft", "", (prefab) => { prefab.addComponent(Partical); xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot); }); } loadBall(index = 1) { this.loadD3Res("ball", index, (prefab) => { this.ballPrefab = prefab; this.ballPrefab.addComponent(Ball); xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot); }); } loadTable(index = 1) { this.loadD3Res("table", index, (prefab) => { this.tableSrc = prefab.addComponent(Table); this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween); this.d3Hand.init(); this.tableRoot.addChild(prefab); }); } loadRoom(index = 1) { this.loadD3Res("room", index, (prefab) => { this.roomRoot.addChild(prefab); }); } loadD3Res(type, index, callback) { let url = `res/unityRes/${type}${index}.lh`; Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => { callback && callback(prefab); this.checkResLoad(); })); } checkResLoad() { this.loadNum++; if (this.loadNum >= this.setLoadNum) { xGame.eventMgr.event(D3RES_LOADED); } } prePlayEft() { let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft); eft.transform.localPositionX = 0; eft.transform.localPositionY = -5; eft.transform.localPositionZ = 0; eft.active = true; let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft); ice.transform.localPositionX = 0; ice.transform.localPositionY = -5; ice.transform.localPositionZ = 0; ice.active = true; let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft); hit.transform.localPositionX = 0; hit.transform.localPositionY = -5; hit.transform.localPositionZ = 0; hit.active = true; let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft); fireworks.transform.localPositionX = 0; fireworks.transform.localPositionY = -5; fireworks.transform.localPositionZ = 0; fireworks.active = true; } } class cameraType { } class MoyuMgr$1 { static initMoyu() { this.moyuView = new MoyuView$1(); Laya.stage.addChild(this.moyuView.ui.displayObject); this.moyuView.ui.x = (Laya.stage.width - 1334) / 2; this.moyuView.ui.displayObject.zOrder = 1000; this.moyuView.init(); this.moyuView.showTip(true); this.moyuView.showAge(true, 0, Laya.stage.height - 320); window['XApk'] = this; } static showAge(show) { if (this.moyuView) this.moyuView.showAge(show); } static onPlatMsg(idx) { if (!MoyuMgr$1.moyuView) return; if (idx == '0') { MoyuMgr$1.moyuView.showTip(false); } } static showAgree(call) { if (this.moyuView) this.moyuView.showAgree(call); else call && call(); } static showXy(type = 1) { if (this.moyuView) this.moyuView.showXy(type); } } MoyuMgr$1.isAdvise = false; class MoyuView$1 { constructor() { this.ysxyNum = 1; this.ysJson = null; this.ui = ui_UIMoyu.createInstance(); } init() { this.ui.mainBg.visible = false; this.ui.xyNode.visible = false; this.ui.ageNode.visible = false; this.ui.tipNode.visible = false; this.ui.rnNode.visible = false; this.ui.fcmNode.visible = false; this.ui.ageTip.visible = false; this.ui.msgNode.visible = false; this.ui.visible = false; this.ui.xyNode.xyList.setVirtual(); this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false); this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]); this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]); this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]); this.ui.xyNode.btnKnown.visible = false; this.ui.xyNode.xy1.visible = false; this.ui.xyNode.xy2.visible = false; this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false; this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false; this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]); this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]); this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]); this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]); this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]); this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]); this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]); this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]); this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]); this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]); this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]); this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]); if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) { this.ysxyNum = 2; } } onClick(obj) { xGame.soundMgr.playSound(xGame.common.btnClickStr); switch (obj) { case this.ui.ageTip: if (Moyu.isTTApk) { this.ui.ageNode.visible = true; this.ui.mainBg.visible = true; } break; case this.ui.tipNode: this.showTip(false); break; case this.ui.ageNode.btnAge: this.ui.ageNode.visible = false; this.ui.mainBg.visible = false; if (!this.ui.xyNode.visible && !this.ui.rnNode.visible) this.ui.visible = false; break; case this.ui.xyNode.btnXy3: case this.ui.xyNode.btnXy1: this.loadXy(1); break; case this.ui.xyNode.btnXy2: this.loadXy(2); break; case this.ui.xyNode.btnBack: this.ui.xyNode.xy1.visible = true; this.ui.xyNode.xy2.visible = false; break; case this.ui.xyNode.btnKnown: this.ui.xyNode.visible = false; this.ui.mainBg.visible = false; this.ui.visible = false; break; case this.ui.rnNode.btnCheck: this.check(); break; case this.ui.rnNode.btnExit: case this.ui.xyNode.btnNo: this.ysxyNum--; if (this.ysxyNum > 0) this.showMsg("Refuse to quit the game once again"); else { Moyu.userAgree(false); Moyu.exit(); } break; case this.ui.xyNode.btnSure: case this.ui.xyNode.btnYes: DataMgr.userData.isAgree = true; DataMgr.saveUserData(); this.onAgree(); break; case this.ui.rnNode.btnDone: this.ui.rnNode.visible = false; this.ui.visible = false; break; case this.ui.fcmNode.btnRn: this.showRn(); break; } } showTip(show) { if (!Moyu.isVVApk && !Moyu.isOPApk) return; if (show) { MoyuMgr$1.isAdvise = true; this.ui.visible = true; this.ui.tipNode.visible = true; this.ui.tipNode.alpha = 1; Laya.timer.once(1000, this, this.showTip, [false]); } else { this.ui.tipNode.alpha = 1; this.ui.tipNode.visible = true; Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => { this.ui.tipNode.visible = false; MoyuMgr$1.isAdvise = false; }), 1000); } } showAge(show, px = 0, py = 0) { if (Moyu.platType > 10 && !Moyu.isIos) { this.ui.ageTip.x = px; this.ui.ageTip.y = py; this.ui.ageTip.visible = show; if (show) this.ui.visible = true; } } showAgree(call) { this.agreeCall = call; this.onAgree(); return; if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) { this.showXy(0); } else this.onAgree(); } onAgree() { if (!this.ui.ageNode.visible) this.ui.visible = false; this.ui.xyNode.visible = false; Moyu.userAgree(true); this.showAge(false); this.agreeCall && this.agreeCall(); this.showRn(); } showMsg(txt) { this.ui.msgNode.txtMsg.text = txt; this.ui.msgNode.visible = true; this.ui.msgNode.alpha = 1; this.ui.visible = true; Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => { this.ui.msgNode.visible = false; }), 2500, true); } showRn() { if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) { if (!Moyu.isRealName || Moyu.gameTime < 999) { this.ui.rnNode.rn1.visible = true; this.ui.rnNode.rn2.visible = false; this.ui.rnNode.rn3.visible = false; this.ui.rnNode.rn4.visible = false; this.ui.rnNode.visible = true; this.ui.mainBg.visible = true; this.ui.rnNode.btnDone.visible = false; this.ui.rnNode.btnExit.visible = true; this.ui.rnNode.btnCheck.visible = true; this.ui.fcmNode.visible = false; this.ui.visible = true; return; } } this.showFcm(); } showFcm() { if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) { Moyu.initFCM(true); if (Moyu.gameTime < 1) this.fcmLoop(); else if (Moyu.gameTime < 999) Laya.timer.loop(10000, this.ui, this.fcmLoop); } } fcmLoop() { if (Moyu.gameTime < 1) { this.ui.rnNode.visible = false; this.ui.fcmNode.visible = true; this.ui.mainBg.visible = true; this.ui.visible = true; this.ui.fcmNode.btnRn.visible = !Moyu.isLegal; Laya.timer.clear(this.ui, this.fcmLoop); } } check() { if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) { this.ui.rnNode.rn1.visible = false; this.ui.rnNode.rn2.visible = false; this.ui.rnNode.rn4.visible = true; } else if (this.ui.rnNode.rn4.visible) { let name = this.ui.rnNode.inputName.text; let code = this.ui.rnNode.inputCode.text; if (code && code.length == 18) { this.ui.rnNode.rn1.visible = false; this.ui.rnNode.rn4.visible = false; Moyu.authenticate(name, code, (res) => { this.ui.rnNode.rn2.visible = !res; this.ui.rnNode.rn3.visible = res; this.ui.rnNode.btnDone.visible = res; this.ui.rnNode.btnExit.visible = !res; this.ui.rnNode.btnCheck.visible = !res; if (res) this.showFcm(); }); } else this.showMsg("信息填写不完整"); } } loadXy(type = 0) { this.ui.xyNode.xy1.visible = false; this.ui.xyNode.xy2.visible = true; this.ui.xyNode.xyList.scrollToView(0); if (type == 1) { Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY)); } else if (type == 2) { Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY)); } } showXy(type = 0) { this.xyBtn(); if (type == 0) { if (Moyu.isPlat(MoyuPlat.f399Apk)) { this.ui.xyNode.btnSure.visible = true; } else { this.ui.xyNode.btnYes.visible = true; this.ui.xyNode.btnNo.visible = true; } } else { this.ui.xyNode.btnKnown.visible = true; this.ui.mainBg.visible = true; } this.ui.xyNode.xy1.visible = true; this.ui.xyNode.xy2.visible = false; this.ui.xyNode.visible = true; this.ui.visible = true; } xyBtn() { this.ui.xyNode.btnSure.visible = false; this.ui.xyNode.btnYes.visible = false; this.ui.xyNode.btnNo.visible = false; this.ui.xyNode.btnKnown.visible = false; { this.ui.xyNode.btnXy3.visible = false; this.ui.xyNode.btnXy2.visible = true; this.ui.xyNode.btnXy1.visible = true; this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》"; } } createXY(json) { this.ysJson = json.content; this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury"); this.ui.xyNode.xyList.numItems = this.ysJson.length; this.ui.xyNode.xy2.visible = true; } renderListItem(idx, cell) { let xy = this.ysJson[idx]; cell.height = xy.line * 30; cell.xyItem.text = xy.text; } onDestroy() { this.agreeCall = null; } } class UILoading extends UIBase { constructor() { super(); this.accTime = 0; this.curNum = 0; this.rate = 1; this.loadSubOk = false; this.loadResOK = false; this.openLoading = true; this.beginLoadRes = false; this.finishD2 = false; this.finishD3 = false; } onConstructor() { this.ui = ui_UILoading.createInstance(); this.contentPane = this.ui; this.isEject = false; this._initUI(); this._addEvent(); } _initUI() { MoyuMgr$1.initMoyu(); } _addEvent() { xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish); xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish); } show() { super.show(); console.log('zh:加载分包资源'); loadSubRes(this.subResProgress.bind(this)); this.ui.txtLoad.text = "Loading..."; } subResProgress(pro, finish) { this.curNum = pro; if (finish) { this.curNum = 1; this.loadSubOk = true; } } laodD3Res() { let scene3D = new Laya.Scene3D(); xGame.common.d3Scene = scene3D; xGame.common.d3World = scene3D.addComponent(D3World); xGame.common.d3World.loadScene(); } loadD2Res() { Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => { this.finishD2 = true; this.checkLoadAll(); this.curNum = 1; }), Laya.Handler.create(this, (pro) => { this.curNum = pro; }, null, false)); } d3ResFinish() { this.finishD3 = true; this.checkLoadAll(); } checkLoadAll() { if (this.finishD2 && this.finishD3) { this.loadResOK = true; } } loadRes() { this.laodD3Res(); this.loadD2Res(); } myUpdate(dt) { if (!this.openLoading) return; this.accTime += dt * this.rate; if (this.accTime >= this.curNum) this.accTime = this.curNum; this.ui.loadinfo.value = this.accTime * 100; if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) { if (!this.beginLoadRes) { this.beginLoadRes = true; this.ui.txtLoad.text = "Loading..."; this.curNum = 0; this.accTime = 0; this.loadRes(); } if (this.loadResOK) { this.openLoading = false; Laya.timer.once(300, this, () => { xGame.common.d3Scene.active = false; MoyuMgr$1.showAgree(enterGame); }); } } } release() { } hide() { super.hide(); this.release(); } onClose() { this.hide(); } } UILoading.uiName = "UILoading"; class UIRepentProp$1 extends UIBase { constructor() { super(); this.viewType = 0; this.regretType = 0; } onConstructor() { this.ui = ui_UIRepentProp.createInstance(); this.contentPane = this.ui; this.isEject = false; this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf); this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret); this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf); this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine); } show(viewType, regretType, callback) { PlatMgr.showInsert(true); this.viewType = viewType; this.regretType = regretType; this.callback = callback; super.show(); this.ui.t0.play(); this.ui.c1.selectedIndex = this.viewType; this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!"; if (this.viewType == 0) { let guide = DataMgr.getGuideHelpLine(); this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0; this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0; } xGame.common.gameMgr.gamePause = true; } hideSelf() { xGame.common.gameMgr.gamePause = false; this.callback && this.callback(false); this.hide(); } videoRegret() { console.log('zh:qjff_AD_for_UIrepentProp_videoRegret'); if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) { } else { console.log('zh:AD 失败,直接发放奖励'); this.qjff_AD_for_UIrepentProp_videoRegret(); } } qjff_AD_for_UIrepentProp_videoRegret() { this.callback && this.callback(true); this.hideSelf(); } videoAddHelpLine() { let guide = DataMgr.getGuideHelpLine(); if (guide == 0) { this.callback && this.callback(true); this.hideSelf(); DataMgr.setGuideHelpLine(); xGame.common.gameUI.ui.guideNode.visible = false; } else { console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine'); if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) { } else { console.log('zh:AD 失败,直接发放奖励'); this.qjff_AD_for_UIrepentProp_videoAddHelpLine(); } } } qjff_AD_for_UIrepentProp_videoAddHelpLine() { this.callback && this.callback(true); this.hideSelf(); } } UIRepentProp$1.uiName = "UIRepentProp"; class UIRodMethod$1 extends UIBase { constructor() { super(); this.isPressd = false; } onConstructor() { this.ui = ui_UIRodMethod.createInstance(); this.contentPane = this.ui; this.addUIClick(this.ui.sureBtn, this.closeSelf); this.moveDir = new Laya.Vector2(); this.moveDest = new Laya.Vector2(); this.centerPos = new Laya.Vector2(); xGame.common.uiRodMethod = this; } show() { super.show(); xGame.common.gameMgr.gamePause = true; this.openPressDotEvent(); this.gameRod = xGame.common.gameUI.ui.rodMethodNode; this.centerPos.x = this.ui.white.x; this.centerPos.y = this.ui.white.y; this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x; this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y; this.setDot(); } setDot() { this.ui.dot.x = this.moveDest.x; this.ui.dot.y = this.moveDest.y; } closeSelf() { xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x; xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y; this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x; this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y; xGame.common.gameMgr.gamePause = false; this.hide(); } openPressDotEvent() { this.closePressDotEvent(); this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown); this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown); this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown); this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown); this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown); this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown); } closePressDotEvent() { this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown); this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown); this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown); this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown); this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown); this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown); } onDown(e) { if (e.type == Laya.Event.MOUSE_DOWN) this.isPressd = true; else if (e.type == Laya.Event.MOUSE_UP && this.isPressd) this.isPressd = false; if (!this.isPressd) return; this.moveDest.x = e.stageX; this.moveDest.y = e.stageY; let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos); if (dis > 6724) { this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir); this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest); } this.setDot(); } resetRod() { this.ui.dot.x = this.ui.white.x; this.ui.dot.y = this.ui.white.y; this.gameRod.dot.x = this.gameRod.bg.x; this.gameRod.dot.y = this.gameRod.bg.y; xGame.common.rodOffest.x = 0; xGame.common.rodOffest.y = 0; } } UIRodMethod$1.uiName = "UIRodMethod"; class UIMsg$1 extends UIBase { constructor() { super(); } onConstructor() { this.ui = ui_UIMsg.createInstance(); this.contentPane = this.ui; this.isEject = false; this.isMuti = true; } show(msg, callback) { super.show(); this.ui.tipsNode.msgTxt.text = msg; this.ui.alpha = 1; Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => { this.hide(); callback && callback(); }), 1000); } } UIMsg$1.uiName = "UIMsg"; class UITips$1 extends UIBase { constructor() { super(); this.type = 0; } onConstructor() { this.ui = ui_UITips.createInstance(); this.contentPane = this.ui; this.isEject = false; this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn); this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn); } show(tipsTxt, womanTxt, type) { super.show(); this.ui.t0.play(); this.ui.myNode.tipsTxt.text = tipsTxt; this.ui.myNode.womanTxt.text = womanTxt; PlatMgr.showInsert(true); this.ui.myNode.c1.selectedIndex = type; this.type = type; switch (this.type) { case TipsType.exitGame: xGame.common.gameMgr.gamePause = true; break; case TipsType.foul: Laya.timer.once(200, this, () => { xGame.common.gameMgr.gamePause = true; }); break; default: break; } } clickLeftBtn() { this.hide(); xGame.common.gameMgr.gamePause = false; switch (this.type) { case TipsType.exitGame: break; case TipsType.foul: break; default: break; } } clickRightBtn() { this.hide(); switch (this.type) { case TipsType.exitGame: xGame.eventMgr.event(RESET_GAME); xGame.uiMgr.Show(UIMain$1); Moyu.recordEnd(this, null); xGame.common.longHelpLine = false; break; case TipsType.foul: xGame.common.gameMgr.gamePause = false; Laya.timer.clearAll(this); break; default: break; } } } UITips$1.uiName = "UITips"; class UIGame$1 extends UIBase { constructor() { super(); this.powerNum = 0; this.isD3Inited = false; this.isPrePlay = false; this.isMoveRod = false; this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 }; this.rulerDis = 20; this.rulerOffset = 0; } onConstructor() { this.ui = ui_UIGame.createInstance(); this.contentPane = this.ui; this.ui.x += xGame.common.sysOffestNum; this.ui.border.alpha = xGame.common.showDebug ? 1 : 0; this.isEject = false; xGame.common.gameUI = this; this.initSelf(); } isTurnSelf() { if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) { return true; } } initSelf() { let topUI = this.ui.topNode; topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false); topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false); this.barInfo = {}; this.barInfo.curY = 0; this.barInfo.height = this.ui.powerNode.height; this.barInfo.showStarY = this.ui.powerNode.showImg.y; this.barInfo.powerStartY = this.ui.powerNode.y; xGame.common.aiPlayer = new AIPlayer(); xGame.common.gameMgr = new GameMgr(); xGame.common.skillMgr = new SkillMgr(); xGame.common.wordsMgr = new WordsMgr(); xGame.common.talkMgr = new TalkMgr(); xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => { console.log("加载经典模式表情文件chenggon !"); }); xGame.common.awardSpine = new SpineMgr("jinbi", () => { console.log("挑战模式奖励模式spine加载成功!"); }); xGame.eventMgr.off(RESET_GAME, this, this.resetGame); xGame.eventMgr.on(RESET_GAME, this, this.resetGame); this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick); this.addUIClick(this.ui.returnBtn, this.returnHome); this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn); this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn); this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn); } getGanZiImg() { let index = DataMgr.getCurBallRod(); let data = cfgTable.ballrodData[index + 1]; let gan_url = xGame.common.getGameIconUrl(data.img); console.log('zh:getGanZiImg gan_url==' + gan_url); this.ui.powerNode.showImg.url = gan_url; console.log('zh:修改杆子图标O K'); } returnHome() { let tips = "Are you sure to exit the game?"; let woman = "Boss, why don't you play for a while longer?"; xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame); } addRodMethodClick() { if (this.isTurnSelf()) { xGame.uiMgr.Show(UIRodMethod$1); } } clickHelpLineBtn(force = false) { if (!this.isTurnSelf()) return; xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => { if (success) { xGame.common.longHelpLine = true; xGame.common.d2World.getHelpLine(); Moyu.sendDataEvent("guideNum"); } else { } }); } renderSelfDisplayBalls(index, target) { let str = "q" + xGame.common.gameMgr.selfBallArr[index]; target.myImg.url = xGame.common.getGameIconUrl(str); } renderAIDisplayBalls(index, target) { let str = "q" + xGame.common.gameMgr.aiBallArr[index]; target.myImg.url = xGame.common.getGameIconUrl(str); ; } updateMode() { if (xGame.common.gameMode == GameMode.classic) { this.ui.topNode.scoreNode.visible = false; } else if (xGame.common.gameMode == GameMode.bigMove) { this.ui.topNode.scoreNode.visible = true; } } show() { super.show(); console.log("zh:uigame show AADD"); this.ui.alpha = 0; this.updateSelf(); xGame.common.gameMgr.gamePause = false; xGame.common.gameUI.ui.blackAni.visible = false; xGame.common.gameUI.ui.whiteAni.visible = false; this.ui.powerEft.visible = false; this.ui.colorNode.visible = false; this.updateHead(); let curUse = DataMgr.getCurBallRod(); console.log('zh:UIGame 选择的球杆234 = ' + curUse); this.getGanZiImg(); } updateSelf() { if (xGame.common.gameMode == GameMode.classic) { this.ui.c1.selectedIndex = 0; this.ui.topNode.middleNode.c1.selectedIndex = 0; this.ui.topNode.middleNode.visible = true; this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + ""; } else if (xGame.common.gameMode == GameMode.bigMove) { this.ui.c1.selectedIndex = 0; this.ui.topNode.middleNode.c1.selectedIndex = 1; this.ui.topNode.middleNode.visible = false; let max = xGame.cfgMgr.getMaxBigMoveLength(); let rand = xGame.common.randomNum(1, max); let guide = DataMgr.getSkillGuide(); if (guide == 0) rand = 1; xGame.common.bigMoveLevelIndex = rand; } else if (xGame.common.gameMode == GameMode.placeBall) { let data = cfgTable.placeballData[xGame.common.placeBallCurLevel]; this.ui.c1.selectedIndex = 1 + data.type; this.ui.alpha = 1; this.startGame(); } this.updateMode(); this.initD3world(); this.initD2world(); } startGame() { this.ui.snowNode.visible = Math.random() <= 0.1; this.ui.d2Node.visible = false; xGame.common.d3World.d3Hand.gameObj.active = false; xGame.common.d3World.tableSrc.init(); xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06; this.cameraViewChange(() => { xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0; switch (xGame.common.gameMode) { case GameMode.classic: xGame.common.d3World.d3Hand.gameObj.active = true; this.playPutBallD3Ani(); break; case GameMode.bigMove: this.enterGame(); Laya.timer.once(500, this, () => { this.ui.topNode.middleNode.visible = true; this.ui.topNode.middleNode.t0.play(); }); break; case GameMode.placeBall: this.enterGame(); break; default: break; } }); PlatMgr.showBanner(false); } enterGame() { this.ui.d2Node.visible = true; xGame.common.d3World.d3Hand.gameObj.active = false; xGame.common.showOneCamera("mainCamera"); Moyu.recordGame(30, true); if (!this.isPrePlay) { this.isPrePlay = true; xGame.common.d3World.prePlayEft(); } xGame.common.gameMgr.gameReady(); this.openAllEvent(); this.ui.snowNode.visible = false; let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1; this.ui.helpBtn.visible = condition; } showHelpLineGuide() { let longGuide = DataMgr.getGuideHelpLine(); if (xGame.common.gameMode == GameMode.classic && longGuide == 0) { this.ui.helpBtn.visible = true; this.ui.guideNode.visible = true; } } setTurnAlpha(alpha) { this.ui.keduNode.alpha = alpha; this.ui.ganNode.alpha = alpha; this.ui.rodMethodNode.alpha = alpha; this.ui.helpBtn.alpha = alpha ? 1 : 0; } cameraViewChange(callback) { xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06; let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform; xGame.common.showOneCamera("visitAngle"); cameraSrc.localRotationEulerY = 180; cameraSrc.localRotationEulerZ = 0; Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => { Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => { callback && callback(); })); })); } playPutBallD3Ani() { xGame.common.showOneCamera("mainCamera"); let handSrc = xGame.common.d3World.d3Hand; handSrc.gameObj.active = true; handSrc.transform.localPositionZ = 3; Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => { Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => { handSrc.gameObj.active = false; this.enterGame(); }), 400); })); } updateHead() { let user = Moyu.getUserInfo(); this.ui.topNode.selfNameTxt.text = user.nickName; xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80); let aiData = xGame.cfgMgr.getRandomUserInfo(); if (DataMgr.getSkillGuide() < 1) { this.ui.topNode.aiNameTxt.text = 'billiards'; this.ui.topNode.aiHeadLoader.url = 'res/icon.png'; } else { this.ui.topNode.aiNameTxt.text = aiData.name; let randNo = Math.floor(Math.random() * 10) + 1; this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png'; } } initD2world() { let node = this.ui.d2Root.displayObject; let src = node.getComponent(D2World); if (!src) { xGame.common.d2World = node.addComponent(D2World); } xGame.common.d2World.initSelf(); } initD3world() { if (this.isD3Inited) return; this.isD3Inited = true; let scene3D = xGame.common.d3Scene; this.ui.d3Root.displayObject.addChild(scene3D); scene3D.active = true; xGame.common.d3World.tableSrc.setBorderPos(); } onRootMove(e) { let rootBall = xGame.common.d2World.rootBall; this.ui.moveNode.x = e.x; this.ui.moveNode.y = e.y; rootBall.gameObj.x = e.x; rootBall.gameObj.y = e.y; rootBall.d3BallSrc.setTransPos(e.x, e.y); } aiRootMove(move) { if (move) this.hideBallUI(); else { this.showBallUI(); xGame.common.d2World.getHelpLine(); } } aiForce(type, force = 0) { this.pressTarget = PressType.powerNode; if (type == 1) this.onEventUp({ force: true }); else if (type == 2) this.onEventMove({ stageY: force, force: true }); } onEventPress(e) { if (e.stopPropagation) e.stopPropagation(); if (!this.isTurnSelf()) return; let target = e.target; switch (target) { case this.ui.myPowerNode.displayObject: this.pressTarget = PressType.powerNode; this.barInfo.curY = e.stageY; this.updateBarInfo(); break; case this.ui.moveNode.displayObject: this.pressTarget = PressType.moveNode; this.hideBallUI(); this.eventObj.curX = this.ui.moveNode.x; this.eventObj.curY = this.ui.moveNode.y; this.ui.moveNode.finger.visible = false; this.eventObj.lastX = e.stageX; this.eventObj.lastY = e.stageY; break; case this.ui.rulerClickNode.displayObject: this.pressTarget = PressType.rulerNode; this.eventObj.lastY = e.stageY; break; case this.ui.d2Root.displayObject: this.pressTarget = PressType.d2Root; this.eventObj.lastX = e.stageX; this.eventObj.lastY = e.stageY; this.eventObj.starX = e.stageX; this.eventObj.starY = e.stageY; this.eventObj.curX = 0; this.eventObj.curY = 0; xGame.common.d2World.d2Gan.setGanLastInfo(); this.rulerOffset = 0; break; default: break; } } onEventMove(e) { if (e.stopPropagation) e.stopPropagation(); if (e && e.force) { } else { if (!this.isTurnSelf()) return; } switch (this.pressTarget) { case PressType.powerNode: this.barInfo.curY = e.stageY; this.updateBarInfo(); this.isMoveRod = true; break; case PressType.moveNode: let rootBall = xGame.common.d2World.rootBall; let radius = rootBall.gameObj.width / 2; let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX; let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY; let border = xGame.common.d2World.borderRect; if (curX <= border.x + radius) curX = border.x + radius; else if (curX >= border.x + border.width - radius) curX = border.x + border.width - radius; if (curY <= border.y + radius) curY = border.y + radius; else if (curY >= border.y + border.height - radius) curY = border.y + border.height - radius; if (xGame.common.gameMgr.isOpenBall) { if (curX >= border.x + border.openBallW - radius) curX = border.x + border.openBallW - radius; } this.ui.moveNode.x = curX; this.ui.moveNode.y = curY; rootBall.gameObj.x = curX; rootBall.gameObj.y = curY; rootBall.d3BallSrc.setTransPos(curX, curY); this.isMoveRod = true; break; case PressType.rulerNode: let yy = e.stageY - this.eventObj.lastY; this.eventObj.lastY = e.stageY; let ruler1 = this.ui.rulerNode.img1; let ruler2 = this.ui.rulerNode.img2; ruler1.y += yy; ruler2.y += yy; this.rulerOffset += yy; if (Math.abs(this.rulerOffset) >= this.rulerDis) { this.rulerOffset = 0; xGame.soundMgr.playSound("inch", 1, 10); } xGame.common.d2World.d2Gan.rotateSelf(yy, true); let h = ruler1.height; this.checkGuide(); this.isMoveRod = true; if (ruler1.y >= h) { ruler1.y = -h; ruler2.y = 0; return; } else if (ruler1.y <= -h) { ruler1.y = h; ruler2.y = 0; return; } if (ruler2.y >= h) { ruler2.y = -h; ruler1.y = 0; return; } else if (ruler2.y <= -h) { ruler2.y = h; ruler1.y = 0; return; } break; case PressType.d2Root: this.eventObj.curX = e.stageX; this.eventObj.curY = e.stageY; let offset = this.checkRodMoveDir(); xGame.common.d2World.d2Gan.rotateSelf(offset); this.eventObj.lastX = e.stageX; this.eventObj.lastY = e.stageY; break; default: break; } } onEventUp(e) { if (e.stopPropagation) e.stopPropagation(); if (e && e.force) { } else { if (!this.isTurnSelf()) return; } switch (this.pressTarget) { case PressType.powerNode: this.ui.powerNode.value = 0; this.ui.powerNode.showImg.y = this.barInfo.showStarY; this.ui.powerTxt.text = ""; if (this.powerNum > 0) { xGame.eventMgr.event(BALL_SHOOT); xGame.common.d2World.shoot(this.powerNum); xGame.common.d2World.d2Gan.shoot(); xGame.common.d2World.d2HelpLine.shoot(); this.finishGuide(); this.ui.powerEft.visible = false; this.ui.colorNode.visible = false; let ganStr = ""; if (this.powerNum <= 30) { ganStr = "gan_30"; } else if (this.powerNum <= 60) { ganStr = "gan_50"; } else { ganStr = "gan_80"; } xGame.soundMgr.playSound(ganStr); } break; case PressType.moveNode: let rootBall = xGame.common.d2World.rootBall; let lastX = xGame.common.gameMgr.lastRootBallPos.x; let lastY = xGame.common.gameMgr.lastRootBallPos.y; let isIntersect = this.judgeBallIntersect(); if (isIntersect) { this.ui.moveNode.x = lastX; this.ui.moveNode.y = lastY; rootBall.gameObj.x = lastX; rootBall.gameObj.y = lastY; rootBall.d3BallSrc.setTransPos(lastX, lastY); xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position"); } else { xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x; xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y; } this.showBallUI(); this.ui.moveNode.finger.visible = true; xGame.common.d2World.getHelpLine(); break; case PressType.rulerNode: break; case PressType.d2Root: let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2); if (dis <= 25) { this.moveToClickDot(e); } break; default: break; } this.pressTarget = -1; } checkGuide() { let guide = DataMgr.getSkillGuide(); if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) { xGame.common.guideStep++; xGame.common.gameUI.ui.guide2.visible = false; xGame.common.gameUI.ui.guide3.visible = true; } } finishGuide() { let guide = DataMgr.getSkillGuide(); if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) { xGame.common.guideStep = 10; this.closeAllGuide(); console.log('zh: 新手引导完毕'); JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete"); } } closeAllGuide() { xGame.common.gameUI.ui.guide1.visible = false; xGame.common.gameUI.ui.guide2.visible = false; xGame.common.gameUI.ui.guide3.visible = false; } updateBarInfo() { let star = this.ui.powerNode.y; let rate = (this.barInfo.curY - star) / this.barInfo.height; if (rate >= 1) rate = 1; if (rate <= 0) rate = 0; this.powerNum = Math.ceil(rate * 100); this.ui.powerNode.value = this.powerNum; this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height; this.ui.colorNode.value = this.powerNum; this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height; this.ui.powerEft.visible = this.powerNum != 0; this.ui.colorNode.visible = this.powerNum != 0; this.ui.powerTxt.text = this.powerNum + ""; xGame.common.d2World.d2Gan.storagePower(this.powerNum); } forceCancel() { this.ui.powerNode.value = 0; this.ui.powerNode.showImg.y = this.barInfo.showStarY; this.ui.powerTxt.text = ""; } checkRodMoveDir() { let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x; let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y; if (tempX >= 0 && tempY <= 0) { return this.checkDir(); } else if (tempX < 0 && tempY < 0) { return this.checkDir(1, -1); } else if (tempX < 0 && tempY > 0) { return this.checkDir(-1, -1); } else { return this.checkDir(-1, 1); } } checkDir(flagX = 1, flagY = 1) { let offsetX = this.eventObj.curX - this.eventObj.lastX; let offsetY = this.eventObj.curY - this.eventObj.lastY; if (offsetY == 0) { return offsetX * flagX; } if (offsetX == 0) { return offsetY * flagY; } let angle = offsetY / offsetX; if (Math.abs(angle) >= 1) { return offsetY * flagY; } else { return offsetX * flagX; } } judgeBallIntersect() { let rootBall = xGame.common.d2World.rootBall; let ballArr = xGame.common.d2World.ballArr; let radius = rootBall.gameObj.width / 2; let temp; let isIntersect = false; for (let index = 0; index < ballArr.length; index++) { temp = ballArr[index]; if (temp.number == rootBall.number) continue; isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius; if (isIntersect) { break; } } return isIntersect; } hideBallUI() { let d2Gan = xGame.common.d2World.d2Gan; if (!d2Gan.ui.isDisposed) d2Gan.ui.visible = false; let d2Help = xGame.common.d2World.d2HelpLine; if (!d2Help.ui.isDisposed) d2Help.ui.visible = false; let rootBall = xGame.common.d2World.rootBall; if (!rootBall.destroyed) { rootBall.gameObj.active = false; } } showBallUI() { let d2Gan = xGame.common.d2World.d2Gan; if (!d2Gan.ui.isDisposed) d2Gan.ui.visible = true; let d2Help = xGame.common.d2World.d2HelpLine; if (!d2Help.ui.isDisposed) d2Help.ui.visible = true; let rootBall = xGame.common.d2World.rootBall; if (!rootBall.destroyed) { rootBall.gameObj.active = true; } } moveToClickDot(e) { if (!this.isMoveRod && !xGame.common.clickedBall) { let root = xGame.common.d2World.rootBall.gameObj; let xx = e.stageX - xGame.common.sysOffestNum; let yy = e.stageY; let x = xx - root.x; let y = yy - root.y; let angle = xGame.common.getfguiRotation(x, y); xGame.common.d2World.d2Gan.ui.rotation = angle; xGame.common.d2World.getHelpLine(); } this.isMoveRod = false; xGame.common.clickedBall = false; } openAllEvent() { this.closeAllEvent(); this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress); this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress); this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress); this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress); this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove); this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp); this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp); } closeAllEvent() { this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress); this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress); this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress); this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress); this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove); this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp); this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp); } resetGame() { this.closeAllEvent(); this.hideBallUI(); xGame.common.gameMgr.gamePause = true; } } UIGame$1.uiName = "UIGame"; class UIAddCoin$1 extends UIBase { constructor() { super(); this.coinNum = 2000; } onConstructor() { this.ui = ui_UIAddCoin.createInstance(); this.contentPane = this.ui; this.isEject = false; this.addUIClick(this.ui.myNode.cancelBtn, this.hide); this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin); } show() { super.show(); this.ui.t0.play(); } videoAddCoin() { console.log('zh:qjff_AD_for_UIAddCoin'); if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) { } else { console.log('zh:AD 失败,直接发放奖励'); this.qjff_AD_for_UIAddCoin(); } } qjff_AD_for_UIAddCoin() { xGame.common.playObjFlyAnim(this.coinNum, Prop.coin); this.hide(); } } UIAddCoin$1.uiName = "UIAddCoin"; class UIInvitation$1 extends UIBase { constructor() { super(); } onConstructor() { this.ui = ui_UIInvitation.createInstance(); this.contentPane = this.ui; this.isEject = false; this.addUIClick(this.ui.myNode.enterBtn, this.enterGame); } show() { super.show(); } enterGame() { xGame.common.gameMode = GameMode.classic; DataMgr.setChallengeTimes(1); xGame.common.passAwardCoin = 2000; let need = xGame.common.classicNiceNeddCoin; if (DataMgr.coinEnough(need)) { DataMgr.setCoin(-need); xGame.eventMgr.event(RESTART_GAME, true); Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode }); } else { xGame.eventMgr.event(RESTART_GAME, true); } this.hide(); } hide() { super.hide(); } } UIInvitation$1.uiName = "UIInvitation"; class UIPower$1 extends UIBase { constructor() { super(); } onConstructor() { this.ui = ui_UIPower.createInstance(); this.contentPane = this.ui; this.isEject = false; this.addUIClick(this.ui.myNode.cancelBtn, this.hide); this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower); } show() { super.show(); this.ui.t0.play(); } videoGetPower() { console.log('zh:qjff_AD_for_uipower'); if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) { } else { console.log('zh:AD 失败,直接发放奖励'); this.qjff_AD_for_uipower(); } } qjff_AD_for_uipower() { DataMgr.setPower(xGame.common.videoPower, true); xGame.eventMgr.event(POWER_TIME); this.hide(); } } UIPower$1.uiName = "UIPower"; class UIGameEnd$1 extends UIBase { constructor() { super(); this.success = false; this.awardCoinNum = 1000; this.awardDiamondNum = 10; } onConstructor() { this.ui = ui_UIGameEnd.createInstance(); this.contentPane = this.ui; this.addUIClick(this.ui.leftBtn, this.clickLeftBtn); this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome); this.addUIClick(this.ui.rightBtn, this.clickRightBtn); this.moneyNode = new MoneyNode$1(this.ui.moneyNode); this.ui.talkNode.visible = false; if (Moyu.isKs) this.ui.closeNode.closeBtn.x += 100; } updateType() { switch (xGame.common.gameMode) { case GameMode.classic: this.ui.c1.selectedIndex = this.success ? 0 : 1; this.ui.coinNode.visible = this.success; if (!this.success) { Laya.timer.once(500, this, () => { xGame.uiMgr.Show(UIAddCoin$1); }); } else { this.logEventForClassic_win(); } this.logEventForClassic_complete(); this.ui.isGetAward.visible = false; this.ui.leftBtn.c1.selectedIndex = 3; this.ui.rightBtn.c1.selectedIndex = 0; this.moneyNode.ui.c1.selectedIndex = 1; break; case GameMode.bigMove: console.log('zh:招法模式 aaaaaa bigMove'); this.ui.c1.selectedIndex = this.success ? 0 : 1; this.ui.coinNode.visible = this.success; if (xGame.common.gameMode == GameMode.bigMove) { if (this.success) { DataMgr.setSkillSuccessTimes(1, true); DataMgr.setSkillAccTimes(1); } else { DataMgr.setSkillSuccessTimes(0, false); } } this.logEventForRod_complete_N(); if (!this.success) { Laya.timer.once(500, this, () => { xGame.uiMgr.Show(UIAddCoin$1); }); } else { this.logEventForRod_win(); } this.ui.isGetAward.visible = false; this.ui.leftBtn.c1.selectedIndex = 3; this.ui.rightBtn.c1.selectedIndex = 0; this.moneyNode.ui.c1.selectedIndex = 1; break; case GameMode.placeBall: this.ui.coinNode.visible = false; if (this.success) { if (xGame.common.placeBallStarNum == 3) { this.ui.c1.selectedIndex = 2; } else { this.ui.c1.selectedIndex = 3; } let level = xGame.common.placeBallCurLevel; if (level > 59) { this.logEventForChallenge_level_complete(level); } else { this.logEventForChallenge_level_N(level); } } else { this.ui.c1.selectedIndex = 4; } let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel]; if (cfg.type == PlaceBallType.challenge) { this.ui.c1.selectedIndex = 2; } this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `; this.updatePlaceBallBtn(); this.updatePlaceBallStarNum(); this.updatePlaceBallAwardState(); this.moneyNode.ui.c1.selectedIndex = 2; this.moneyNode.checkPowerTime(); this.moneyNode.powerChange(); DataMgr.upRankData(); break; default: break; } } logEventForRod_complete_N() { let gfmsIdx = xGame.common.curPlayerSkillType; console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx); let gfmc = 'Skyfall Shot'; if (gfmsIdx == 0) { gfmc = 'Skyfall Shot'; } if (gfmsIdx == 1) { gfmc = 'Surging break'; } if (gfmsIdx == 2) { gfmc = 'Frost Lock'; } let level = DataMgr.getBigSkillByIndex(gfmsIdx); console.log('zh:logEventForRod_complete_N level = ' + level); let keyStr = 'sjmd_rod_start_' + gfmsIdx; let jsonStr = { "count": 0, "name": gfmc }; if (LocalStorageManager.hasJosnKey(keyStr)) { const d = LocalStorageManager.getItem(keyStr); jsonStr.count = d.count + 1; LocalStorageManager.setItem(keyStr, jsonStr); } else { LocalStorageManager.setItem(keyStr, jsonStr); } const d2 = LocalStorageManager.getItem(keyStr); let count = d2.count; console.log('zh:logEventForRod_complete_N count = ' + count); if (count % 5 == 0) { const reqStr = JSON.stringify(jsonStr); JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr); JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr); } } logEventForRod_win() { console.log('zh:logEventForRod_win,胜利'); let gfmsIdx = xGame.common.curPlayerSkillType; console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx); let gfmc = 'Skyfall Shot'; if (gfmsIdx == 0) { gfmc = 'Skyfall Shot'; } if (gfmsIdx == 1) { gfmc = 'Surging break'; } if (gfmsIdx == 2) { gfmc = 'Frost Lock'; } let level = DataMgr.getBigSkillByIndex(gfmsIdx); console.log('zh:logEventForRod_win level = ' + level); let keyStr = 'sjmd_rod_win_' + gfmsIdx; let jsonStr = { "count": 1, "name": gfmc + ' Lev' + level }; if (LocalStorageManager.hasJosnKey(keyStr)) { const d = LocalStorageManager.getItem(keyStr); jsonStr.count = d.count + 1; LocalStorageManager.setItem(keyStr, jsonStr); } else { LocalStorageManager.setItem(keyStr, jsonStr); } const reqStr = JSON.stringify(jsonStr); JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr); } logEventForClassic_win() { console.log('zh:logEventForClassic_win,胜利'); let rtype = xGame.common.classicRoomType; let msmc = ''; if (rtype == 1) { msmc = 'beginner'; } if (rtype == 2) { msmc = 'expert'; } if (rtype == 3) { msmc = 'master'; } let keyStr = 'sjmd_classic_win_' + rtype; let jsonStr = { "difficulty": msmc, "classic_count": 1, "difficulty_count": 1 }; if (LocalStorageManager.hasJosnKey(keyStr)) { const d = LocalStorageManager.getItem(keyStr); jsonStr.classic_count = d.classic_count + 1; jsonStr.difficulty_count = d.difficulty_count + 1; LocalStorageManager.setItem(keyStr, jsonStr); } else { LocalStorageManager.setItem(keyStr, jsonStr); } const reqStr = JSON.stringify(jsonStr); JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr); } logEventForClassic_complete() { console.log('zh:logEventForClassic_complete,胜利'); let rtype = xGame.common.classicRoomType; let msmc = ''; if (rtype == 1) { msmc = 'beginner'; } if (rtype == 2) { msmc = 'expert'; } if (rtype == 3) { msmc = 'master'; } let keyStr = 'sjmd_classic_complete_' + rtype; let jsonStr = { "msmc": msmc, "count": 0 }; if (LocalStorageManager.hasJosnKey(keyStr)) { const d = LocalStorageManager.getItem(keyStr); jsonStr.count = d.count + 1; LocalStorageManager.setItem(keyStr, jsonStr); } else { LocalStorageManager.setItem(keyStr, jsonStr); } if (jsonStr.count % 5 == 0) { const reqStr = JSON.stringify(jsonStr); JSBridgeUtils.instance.logEventForAdNoParams('classic_complete'); JSBridgeUtils.instance.logEventForFirebase('classic_complete', null); } } updatePlaceBallBtn() { this.ui.leftBtn.c1.selectedIndex = 5; if (this.success) { this.ui.rightBtn.c1.selectedIndex = 14; } else { if (xGame.common.placeBallStarNum == 3) { this.ui.rightBtn.c1.selectedIndex = 14; } else { this.ui.rightBtn.c1.selectedIndex = 1; } } } updatePlaceBallStarNum() { let starNum = xGame.common.placeBallStarNum; if (starNum == 0) this.ui.starNumNode.c1.selectedIndex = 3; else { this.ui.starNumNode.c1.selectedIndex = starNum - 1; } } updatePlaceBallAwardState() { let level = xGame.common.placeBallCurLevel; let starNum = xGame.common.placeBallStarNum; let getAward = DataMgr.getPlaceBallLevel(level).getAward; let data = cfgTable.placeballData[level].award; let cfg = cfgTable.placeballData[level]; this.awardDiamondNum = data[1]; this.awardCoinNum = data[0]; if (cfg.type == PlaceBallType.challenge) { this.awardDiamondNum = 0; this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100; } this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0; this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0; if (cfg.type == PlaceBallType.challenge) { this.ui.awardNode.coinNode.visible = true; } if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) { this.ui.awardNode.diamondNode.x = 265; this.ui.awardNode.coinNode.x = 354; } else { this.ui.awardNode.diamondNode.x = 291; this.ui.awardNode.coinNode.x = 291; } this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + ""; this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + ""; if (this.awardCoinNum == 0) { this.ui.awardNode.coinNode.numTxt.text = ""; } if (getAward) { this.ui.isGetAward.visible = true; this.ui.awardNode.diamondNode.c1.selectedIndex = 2; this.ui.awardNode.coinNode.c1.selectedIndex = 2; } else { this.ui.isGetAward.visible = false; if (starNum == 3 && cfg.type == PlaceBallType.challenge) { this.ui.awardNode.diamondNode.c1.selectedIndex = 0; this.ui.awardNode.coinNode.c1.selectedIndex = 0; } else { this.ui.awardNode.diamondNode.c1.selectedIndex = 1; this.ui.awardNode.coinNode.c1.selectedIndex = 1; } } } show(success) { super.show(); xGame.eventMgr.event(RESET_GAME); this.success = success; Laya.timer.clearAll(this); this.playSecretaryAni(); Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 }); let offsetTime = new Date().getTime() - xGame.common.gameStartTime; offsetTime = Math.floor(offsetTime / 1000); Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode }); this.updateType(); Laya.timer.once(200, this, () => { this.addAward(() => { this.updateType(); Laya.timer.once(500, this, () => { this.showChallengeLevel(); }); }); }); if (this.success) { JSBridgeUtils.instance.showInternAd('gameend_success'); console.log('zh:game end 成功'); xGame.soundMgr.playSound('slots_roll01'); xGame.soundMgr.playSound("s_win"); xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt); this.diyGameDataUtilForGameWin(); } else { JSBridgeUtils.instance.showInternAd('gameend_faill'); console.log('zh:game end失败'); xGame.soundMgr.playSound('matchwin01'); xGame.soundMgr.playSound("s_lose"); xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt); } let challengeNum = DataMgr.getChallengeTimes(); if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) { DataMgr.setChallengeTimes(1); } if (this.success && xGame.common.gameMode == GameMode.classic) { DataMgr.setClassicTimes(); } } diyGameDataUtilForGameWin() { console.log('zh: DiyGameDataUtilForGameWin diy '); switch (xGame.common.gameMode) { case GameMode.classic: console.log('zh:DiyGameDataUtilForGameWin 111'); case GameMode.bigMove: console.log('zh:DiyGameDataUtilForGameWin 222'); this.restartGame(); break; case GameMode.placeBall: console.log('zh:DiyGameDataUtilForGameWin 333'); var level = xGame.common.placeBallCurLevel; console.log('zh:练习模式 联系了多少LEV=' + level); let db_over_lev = DataMgr.getChallengeMode_overLev(); if (level > db_over_lev) { DataMgr.setChallengeMode_overLev(level); } break; default: console.log('zh:DiyGameDataUtilForGameWin 444'); break; } } showChallengeLevel() { if (DataMgr.getChallengeTimes() != 0) return; let skill = DataMgr.getSkillAccTimes(); let put = DataMgr.getPlaceBallLevelList().length; if (skill >= 3 || put >= 5) { xGame.uiMgr.Show(UIInvitation$1); this.hide(); } } addAward(callback) { if (!this.success) { callback && callback(); return; } switch (xGame.common.gameMode) { case GameMode.classic: this.awardCoinNum = xGame.common.passAwardCoin; this.awardDiamondNum = 0; xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin); break; case GameMode.bigMove: this.awardCoinNum = xGame.common.passAwardCoin; this.awardDiamondNum = 0; xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin); callback && callback(); break; case GameMode.placeBall: let level = xGame.common.placeBallCurLevel; Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 }); if (xGame.common.placeBallStarNum != 3) { callback && callback(); return; } else { let getAward = DataMgr.getPlaceBallLevel(level).getAward; if (getAward) { callback && callback(); return; } } let cfg = cfgTable.placeballData[level]; let data = cfgTable.placeballData[level].award; this.awardCoinNum = data[0]; this.awardDiamondNum = data[1]; if (cfg.type == PlaceBallType.challenge) { this.awardDiamondNum = 0; this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100; } let coinAward = new AwardType(Prop.coin, this.awardCoinNum); let diamondAward; if (this.awardDiamondNum > 0) { diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum); xGame.common.getAward([diamondAward, coinAward], callback); } else { xGame.common.getAward([coinAward], callback); } if (cfg.type == PlaceBallType.normal) { DataMgr.setPlaceBallAward(level); } break; default: break; } } playSecretaryAni_old() { let parent = this.ui.secretary.displayObject; parent.destroyChildren(); let xx = this.ui.secretary.width / 2; let yy = this.ui.secretary.height; let scale = xGame.common.getSecretaryScale(); let data = { x: xx, y: yy, scaleX: scale, scaleY: scale }; if (this.success) { let rand = Math.random() <= 0.5 ? 2 : 3; xGame.common.secretary.play(data, rand, false, parent, () => { xGame.common.secretary.play(data, 1, true, parent); }); } else { xGame.common.secretary.play(data, 0, true, parent); } } playSecretaryAni() { let parent = this.ui.secretary.displayObject; parent.destroyChildren(); let xx = this.ui.secretary.width / 2; let yy = this.ui.secretary.height; let scale = xGame.common.getSecretaryScale(); let data = { x: xx, y: yy, scaleX: scale, scaleY: scale }; if (this.success) { let rand = 0; xGame.common.secretary.play(data, 0, true, parent); } else { xGame.common.secretary.play(data, 0, true, parent); } } restartGame() { switch (xGame.common.gameMode) { case GameMode.classic: xGame.eventMgr.event(RESTART_GAME); Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode }); break; case GameMode.bigMove: this.hide(); xGame.eventMgr.event(RESTART_GAME); Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode }); break; default: break; } } hide() { super.hide(); xGame.common.stopGirlPop(this.ui.talkNode); PlatMgr.showBanner(false); } returnHome() { this.hide(); let showFailWords = !this.success; xGame.uiMgr.Show(UIMain$1, showFailWords); } clickLeftBtn() { switch (xGame.common.gameMode) { case GameMode.classic: case GameMode.bigMove: this.returnHome(); break; case GameMode.placeBall: let level = xGame.common.placeBallCurLevel; this.powerStartPlaceBallLevel(level, this.ui.leftBtn); Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode }); break; default: break; } } powerStartPlaceBallLevel(level, btn) { if (DataMgr.powerEnough()) { btn.touchable = false; btn.powerEft.t0.play(Laya.Handler.create(this, () => { btn.touchable = true; DataMgr.setPower(-1); xGame.eventMgr.event(POWER_TIME); this.startPlaceBallLevel(level); this.logEventForChallenge_level_start(level); })); } else { xGame.uiMgr.Show(UIPower$1, 0); } } clickRightBtn() { switch (xGame.common.gameMode) { case GameMode.classic: console.log('zh:clickRightBtn 111'); case GameMode.bigMove: console.log('zh:clickRightBtn 222'); this.restartGame(); break; case GameMode.placeBall: console.log('zh:clickRightBtn 333'); let level = xGame.common.placeBallCurLevel; let data = DataMgr.getPlaceBallLevel(level); let curPss = data.play && !data.isCur; if (curPss) { console.log('zh:clickRightBtn 333-111'); console.log('zh:当前LV=' + level); if (level == 60) { xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels."); Laya.timer.once(3000, this, () => { this.returnHome(); }); } else { let lev = level + 1; this.powerStartPlaceBallLevel(lev, this.ui.rightBtn); } } else { console.log('zh:clickRightBtn 333-000'); Moyu.sendDataEvent("placeBallNextLevel"); console.log('zh:qjff_AD_for_uiGameEnd'); Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + ''); if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) { } else { console.log('zh:AD 失败,直接发放奖励'); this.qjff_AD_for_uiGameEnd(level); } } break; default: console.log('zh:clickRightBtn 444'); break; } } logEventForChallenge_level_start(level) { let keyStr = 'sjmd_challenge_level_start'; let jsonStr = { "count": 0, "gold_balance ": DataMgr.getCoin(), "level": level, "diamond_balance ": DataMgr.getDiamond() }; if (LocalStorageManager.hasJosnKey(keyStr)) { const d = LocalStorageManager.getItem(keyStr); if (level > d.level) { jsonStr.count = d.count + 1; LocalStorageManager.setItem(keyStr, jsonStr); } else { } } else { LocalStorageManager.setItem(keyStr, jsonStr); } const reqStr = JSON.stringify(jsonStr); JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr); } qjff_AD_for_uiGameEnd(level) { DataMgr.setPlaceBallLevel(level, 1); this.startPlaceBallLevel(level + 1); } startPlaceBallLevel(level) { xGame.common.gameMode = GameMode.placeBall; xGame.common.placeBallCurLevel = level; xGame.uiMgr.Show(UIGame$1); this.hide(); } logEventForChallenge_level_complete(level) { let keyStr = 'sjmd_challenge_level_complete'; let jsonStr = { "count": 1, "gold_balance ": DataMgr.getCoin(), "level": level, "diamond_balance ": DataMgr.getDiamond() }; if (LocalStorageManager.hasJosnKey(keyStr)) { const d = LocalStorageManager.getItem(keyStr); jsonStr.count = d.count + 1; LocalStorageManager.setItem(keyStr, jsonStr); } else { LocalStorageManager.setItem(keyStr, jsonStr); } const reqStr = JSON.stringify(jsonStr); JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr); } logEventForChallenge_level_N(level) { console.log('zh:logEventForChallenge_level_N ' + level); let keyStr = 'sjmd_challenge_level_N'; if (LocalStorageManager.hasKey(keyStr)) { let lev = LocalStorageManager.getItem(keyStr); if (level > lev) { LocalStorageManager.setItem(keyStr, level); } if ((level) % 5 == 0) { console.log('zh:每5关上报1次'); let sjmc = 'challenge_level_' + level; JSBridgeUtils.instance.logEventForAdNoParams(sjmc); let sjmcForFirebase = 'challenge_level_' + level; JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null); } else { console.log('zh:5 no 上报'); } } else { LocalStorageManager.setItem(keyStr, level); } } } UIGameEnd$1.uiName = "UIGameEnd"; class ShowItem$1 { constructor() { this.ui = ui_ShowItem.createInstance(); } destroySelf() { if (!this.ui.isDisposed) { this.ui.removeFromParent(); this.ui.dispose(); } } setParent(parent) { parent.addChild(this.ui); } setPos(x, y) { this.ui.x = x; this.ui.y = y; } setUrl(index) { this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index); } } class UILevelProp$1 extends UIBase { constructor() { super(); this.firstPos = 385; this.secondPos = 467; this.showItemArr = []; } onFontLoaded() { try { this.ui.myNode.conditionTxt.font = "arial"; console.log("zh: onFontLoaded 设置arial字体成功"); } catch (error) { console.log("zh: constructor onFontLoaded加载arial字体失败"); } } onConstructor() { this.ui = ui_UILevelProp.createInstance(); this.contentPane = this.ui; this.isEject = false; this.addUIClick(this.ui.closeBtn, this.hide); this.moneyNode = new MoneyNode$1(this.ui.moneyNode); this.addUIClick(this.ui.myNode.startBtn, this.startGame); } show(level) { super.show(); this.ui.t1.play(); this.level = level; this.data = cfgTable.placeballData[this.level]; this.updateSelf(); this.showPreView(); this.moneyNode.ui.c1.selectedIndex = 2; this.moneyNode.checkPowerTime(); this.moneyNode.powerChange(); } showPreView() { let item; let data; for (let index = 0; index < this.showItemArr.length; index++) { item = this.showItemArr[index]; item.destroySelf(); } this.showItemArr = []; let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level); for (const key in cfgData) { data = cfgData[key]; item = new ShowItem$1(); item.setParent(this.ui.myNode.displayRoot); item.setPos(data.x, data.y); item.setUrl(data.value); this.showItemArr.push(item); } } updateSelf() { this.ui.myNode.levelTxt.text = `Level ${this.level}`; this.ui.myNode.modeNode.c1.selectedIndex = this.data.type; if (this.data.ball == -1) { this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table"; } else { this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`; } let localData = DataMgr.getPlaceBallLevel(this.level); let getAward = localData.getAward; let cfg = cfgTable.placeballData[this.level]; let coin = this.data.award[0]; let diamond = this.data.award[1]; if (cfg.type == PlaceBallType.challenge) { diamond = 0; coin = 100; } this.ui.myNode.coinNode.visible = coin == 0 ? false : true; this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true; this.ui.myNode.coinNode.numTxt.text = coin + ""; if (cfg.type == PlaceBallType.challenge) { this.ui.myNode.coinNode.numTxt.text = ""; } this.ui.myNode.diamondNode.numTxt.text = diamond + ""; if (coin > 0 && diamond > 0) { this.ui.myNode.diamondNode.x = 385; this.ui.myNode.coinNode.x = 467; } else { this.ui.myNode.diamondNode.x = 385; this.ui.myNode.coinNode.x = 385; } if (!getAward) { this.ui.myNode.coinNode.c1.selectedIndex = 0; this.ui.myNode.diamondNode.c1.selectedIndex = 0; } else { this.ui.myNode.diamondNode.c1.selectedIndex = 1; this.ui.myNode.coinNode.c1.selectedIndex = 1; } } startGame() { if (DataMgr.powerEnough()) { console.log('zh:powerEnough =' + DataMgr.powerEnough()); this.ui.myNode.startBtn.touchable = false; this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => { console.log('zh:startGame '); this.ui.myNode.startBtn.touchable = true; DataMgr.setPower(-1); xGame.eventMgr.event(POWER_TIME); xGame.common.gameMode = GameMode.placeBall; xGame.common.placeBallCurLevel = this.level; xGame.uiMgr.Show(UIGame$1); this.logEventForChallenge_level_start(this.level); xGame.uiMgr.Hide(UILevelDisplay$1); xGame.uiMgr.Hide(UIMain$1); this.hide(); })); } else { console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough()); xGame.uiMgr.Show(UIPower$1); } } logEventForChallenge_level_start(level) { let keyStr = 'sjmd_challenge_level_start'; let jsonStr = { "count": 1, "gold_balance ": DataMgr.getCoin(), "level": level, "diamond_balance ": DataMgr.getDiamond() }; if (LocalStorageManager.hasJosnKey(keyStr)) { const d = LocalStorageManager.getItem(keyStr); if (level > d.level) { jsonStr.count = d.count + 1; LocalStorageManager.setItem(keyStr, jsonStr); } else { } } else { LocalStorageManager.setItem(keyStr, jsonStr); } const reqStr = JSON.stringify(jsonStr); JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr); } hide() { super.hide(); } } UILevelProp$1.uiName = "UILevelProp"; class PutBallLevelDisplay$1 { constructor(ui, index) { this.index = 0; this.ui = ui; this.index = index; this.ui.onClick(this, this.clickSelf); this.updateSelf(); this.ui.levelTxt.text = (this.index + 1) + ""; this.ui.challenge.levelTxt.text = (this.index + 1) + ""; this.ui.special.levelTxt.text = (this.index + 1) + ""; } updateSelf() { let level = this.index + 1; this.data = DataMgr.getPlaceBallLevel(level); this.ui.starNode.c1.selectedIndex = this.data.star; let isChallenge = cfgTable.placeballData[level].type; if (this.data.isCur) { if (isChallenge) { this.ui.c1.selectedIndex = 5; } else { this.ui.c1.selectedIndex = 2; } } else { if (this.data.play) { if (this.data.star == 3) { this.ui.c1.selectedIndex = 0; } else { this.ui.c1.selectedIndex = 1; } } else { if (isChallenge) { this.ui.c1.selectedIndex = 4; } else { this.ui.c1.selectedIndex = 3; } } } } clickSelf() { if (!this.data.play) return; xGame.soundMgr.playSound(xGame.common.btnClickStr); xGame.uiMgr.Show(UILevelProp$1, this.index + 1); } } class UILevelDisplay$1 extends UIBase { constructor() { super(); } onConstructor() { this.ui = ui_UILevelDisplay.createInstance(); this.contentPane = this.ui; this.isEject = false; this.myList = this.ui.myNode.myList; this.addUIClick(this.ui.closeNode.closeBtn, this.hide); this.levelItemArr = []; let levelNum = xGame.cfgMgr.getMaxPlaceBall(); this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false); this.myList.numItems = levelNum; if (Moyu.isKs) this.ui.closeNode.closeBtn.x += 100; } levelItemRender(index, target) { let item = new PutBallLevelDisplay$1(target, index); this.levelItemArr.push(item); } show() { super.show(); this.updateLevel(); this.scrollToPlace(); } updateLevel() { let temp; for (let index = 0; index < this.levelItemArr.length; index++) { temp = this.levelItemArr[index]; temp.updateSelf(); } } scrollToPlace() { let maxNum = xGame.cfgMgr.getMaxPlaceBall(); let passArr = DataMgr.getPlaceBallLevelList(); let offest = passArr.length; if (offest >= maxNum - 1) offest = maxNum - 1; this.myList.scrollToView(offest, true, true); } hide() { super.hide(); } } UILevelDisplay$1.uiName = "UILevelDisplay"; class UIMatching$1 extends UIBase { constructor() { super(); } onConstructor() { this.ui = ui_UIMatching.createInstance(); this.contentPane = this.ui; this.isEject = false; } show(callback) { super.show(); PlatMgr.showBanner(true); this.callback = callback; let user = Moyu.getUserInfo(); if (!this.selfPot) { this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y); } if (!this.aiPot) { this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y); } this.ui.awardTxt.text = xGame.common.passAwardCoin + ""; this.ui.selfHead.nameTxt.text = user.nickName; xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon); this.ui.aiHead.nameTxt.text = "???"; this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx"); this.ui.selfHead.c1.selectedIndex = 0; this.ui.aiHead.c1.selectedIndex = 0; this.ui.selfHead.x = this.selfPot.x; this.ui.selfHead.y = this.selfPot.y; this.ui.aiHead.x = this.aiPot.x; this.ui.aiHead.y = this.aiPot.y; switch (xGame.common.gameMode) { case GameMode.classic: break; case GameMode.bigMove: this.initSkillData(); break; default: break; } this.ui.t1.play(Laya.Handler.create(this, () => { this.ui.t2.play(Laya.Handler.create(this, () => { switch (xGame.common.gameMode) { case GameMode.classic: this.waitingPeople(); break; case GameMode.bigMove: this.skillSelectFinish(xGame.common.curPlayerSkillType); break; default: break; } })); })); } initSkillData() { this.skillSelectData = []; let skillUrl = xGame.common.skillIconList; let skillName = xGame.common.skillNameList; let skillLevel = DataMgr.getBigSkillList(); let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu]; for (let index = 0; index < 5; index++) { let obj = {}; obj.skillImg = skillUrl[index]; obj.skillName = skillName[index]; obj.skillType = skillType[index]; obj.skillLevel = skillLevel[index]; this.skillSelectData.push(obj); } } getAISkillLevel(myLevel) { let video = xGame.common.upSkillLevel; let aiLevel; let temp; if (video) { temp = xGame.common.randomNum(-2, -1); } else { if (myLevel <= 5) { temp = xGame.common.randomNum(1, 3); } else if (myLevel <= 9) { temp = xGame.common.randomNum(-2, 1); } else { temp = xGame.common.randomNum(-4, 0); } } aiLevel = temp + myLevel; if (aiLevel <= 1) aiLevel = 1; if (aiLevel >= 10) aiLevel = 10; return aiLevel; } getAISkillType() { return xGame.common.randomNum(1, 4); let successTimes = DataMgr.getSkillSuccessTimes(); let info = cfgTable.aiskillData[successTimes]; if (!info) { let max = Object.keys(cfgTable.aiskillData).length - 1; info = cfgTable.aiskillData[max]; } let dataArr = info.skillselect; let myCfg = {}; for (let index = 0; index < dataArr.length; index++) { let temp = dataArr[index].split('-'); myCfg[temp[0]] = {}; myCfg[temp[0]].id = parseInt(temp[0]); myCfg[temp[0]].weight = parseInt(temp[1]); } let aiCfg = xGame.common.initWeight(myCfg); let curData = xGame.common.getRandomWeightData(aiCfg); return parseInt(curData.id); } getAISkillData(index) { let myLevel = this.skillSelectData[index].skillLevel; let aiLevel = this.getAISkillLevel(myLevel); let aiType = this.getAISkillType() - 1; return { aiLevel, aiType } = { aiLevel, aiType }; } skillSelectFinish(index) { let aiInfo = this.getAISkillData(index); xGame.common.gameMgr.selfCurSkill = index; xGame.common.gameMgr.aiCurSkill = aiInfo.aiType; xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel; this.ui.selfHead.c1.selectedIndex = 1; this.ui.aiHead.c1.selectedIndex = 1; let myData = this.skillSelectData[index]; this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg); let guide = DataMgr.getSkillGuide(); if (guide == 0) { this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level"; } else { this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel; } let aiData = this.skillSelectData[aiInfo.aiType]; this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg); this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel; this.waitingPeople(); } waitingPeople() { let time = xGame.common.randomNum(1000, 3000); time += 1000; Laya.timer.once(time, this, () => { this.matchingSuccess(); }); } matchingSuccess() { let gameUI = xGame.common.gameUI; let name = gameUI.ui.topNode.aiNameTxt.text; let url = gameUI.ui.topNode.aiHeadLoader.url; this.ui.aiHead.nameTxt.text = name; this.ui.aiHead.headImg.url = url; name = gameUI.ui.topNode.selfNameTxt.text; url = gameUI.ui.topNode.selfHeadLoader.url; this.ui.selfHead.nameTxt.text = name; this.ui.selfHead.headImg.url = url; this.ui.t3.play(Laya.Handler.create(this, () => { this.callback && this.callback(); this.ui.t4.play(Laya.Handler.create(this, () => { this.destroySelf(); })); })); } destroySelf() { this.callback = null; this.skillSelectData = null; this.selfPot = null; this.aiPot = null; if (!this.ui.isDisposed) { this.ui.removeFromParent(); this.ui.dispose(); } xGame.uiMgr.destroyUI(this); } } UIMatching$1.uiName = "UIMatching"; class SkillDisplay$1 { constructor(ui, data, uiIndex) { this.starX = 0; this.starY = 0; this.index = 0; this.ui = ui; this.data = data; this.index = uiIndex; this.initSelf(); console.log('zh:SkillDisplay constructor this.skillData=', data); } initSelf() { this.ui.normalBtn.onClick(this, this.clickAddLevel); this.ui.nameTxt.text = this.data.name; this.ui.describeTxt.text = this.data.describe; this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon); this.ui.startBtn.onClick(this, this.startGame); this.updateSelf(); } updateSelf() { this.checkTry(); let level = DataMgr.getBigSkillByIndex(this.index); this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0; } checkTry() { let index = this.index; let level = DataMgr.getBigSkillByIndex(index); if (level == null) { DataMgr.setBigSkill(index, 1, false); level = 1; } this.ui.levelTxt.text = "LV." + level; if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) this.ui.tryNode.visible = true; else this.ui.tryNode.visible = false; } clickAddLevel() { xGame.soundMgr.playSound(xGame.common.btnClickStr); Moyu.sendDataEvent("UpSkill", { id: this.data.index }); console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel'); if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) { this.qjff_AD_for_skilldisplay_clickAddLevel(); } else { console.log('zh:AD 失败,直接发放奖励'); this.qjff_AD_for_skilldisplay_clickAddLevel(); } } qjff_AD_for_skilldisplay_clickAddLevel() { DataMgr.setBigSkill(this.data.index, 1); this.updateSelf(); xGame.common.upSkillLevel = true; } startGame() { console.log('zh:rod skill startgame'); if (this.data.index == 3) { alert('Coming soon!'); return; } xGame.soundMgr.playSound(xGame.common.btnClickStr); let needCoin = xGame.common.bigMoveNeedCoin; xGame.common.passAwardCoin = 2000; let guide = DataMgr.getSkillGuide(); console.log('zh:startGame guide=' + guide); xGame.common.temSelfLevel = 0; if (guide == 0) { needCoin = 0; xGame.common.temSelfLevel = 100; } if (DataMgr.coinEnough(needCoin)) { DataMgr.setCoin(-needCoin); xGame.common.curPlayerSkillType = this.index; if (guide == 0) xGame.common.curPlayerSkillType = 0; console.log('zh: skilldisplay 1'); xGame.uiMgr.Show(UIGame$1); xGame.uiMgr.Hide(UIMain$1); xGame.uiMgr.Show(UIMatching$1, () => { xGame.common.gameUI.ui.alpha = 1; xGame.common.gameUI.startGame(); xGame.uiMgr.Hide(UISkill$1); }); this.logEventForRod_start(); } else { console.log('zh: skilldisplay 2'); xGame.uiMgr.Show(UIAddProp$1, 0); Moyu.sendDataEvent("AddCoinVideo"); } } logEventForRod_start() { let gfmsIdx = xGame.common.curPlayerSkillType; console.log('zh:选择的技能=' + gfmsIdx); let gfmc = 'Skyfall Shot'; if (gfmsIdx == 0) { gfmc = 'Skyfall Shot'; } if (gfmsIdx == 1) { gfmc = 'Surging break'; } if (gfmsIdx == 2) { gfmc = 'Frost Lock'; } let keyStr = 'sjmd_rod_start_' + gfmsIdx; let jsonStr = { "count": 0, "name": gfmc }; if (LocalStorageManager.hasJosnKey(keyStr)) { const d = LocalStorageManager.getItem(keyStr); jsonStr.count = d.count + 1; LocalStorageManager.setItem(keyStr, jsonStr); } else { LocalStorageManager.setItem(keyStr, jsonStr); } const reqStr = JSON.stringify(jsonStr); JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr); } } class UISkill$1 extends UIBase { constructor() { super(); this.skillData = []; } onConstructor() { this.ui = ui_UISkill.createInstance(); this.contentPane = this.ui; this.isEject = false; this.moneyNode = new MoneyNode$1(this.ui.moneyNode); this.initSkillData(); console.log('zh:aaaaaa1111111111'); this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain); this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false); console.log('zh:aaaaaa22222222'); this.displayList = []; this.ui.skillNode.skillList.numItems = 3; this.addUIClick(this.ui, this.interuptSecretary); this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel); this.ui.talkNode.visible = false; if (Moyu.isKs) this.ui.closeNode.closeBtn.x += 100; } show() { super.show(); this.playSecretaryIdle(); this.moneyNode.ui.c1.selectedIndex = 1; Laya.timer.clearAll(this); xGame.soundMgr.playSound("s_start"); xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt); let guide = DataMgr.getSkillGuide(); this.ui.guideNode.visible = guide == 0; let item = this.getSkillItemByUIIndex(0); if (guide == 0) { item.ui.c1.selectedIndex = 1; } else { item.ui.c1.selectedIndex = 0; } this.ui.guideNode.guideBtn.visible = guide == 0; for (let index = 0; index < this.displayList.length; index++) { this.displayList[index].checkTry(); } } getSkillItemByUIIndex(cur) { for (let index = 0; index < this.displayList.length; index++) { if (this.displayList[index].index == cur) { return this.displayList[index]; } } } enterGuideLevel() { let item = this.getSkillItemByUIIndex(0); item.startGame(); if (DataMgr.getNewUser()) Moyu.sendDataEvent("gameStart1"); } initSkillData() { this.skillData = []; let nameList = xGame.common.skillNameList; let iconList = xGame.common.skillIconList; let describeList = [ "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ", "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!", "The power of frost descends—freezing the flow and taking full control of the game!" ]; console.log('zh:initSkillData 111111111'); let data; for (let index = 0; index < nameList.length; index++) { data = {}; data.name = nameList[index]; data.icon = iconList[index]; data.describe = describeList[index]; data.index = index; this.skillData.push(data); } } updateSkillItem(index, target) { if (this.displayList[index] == null) { let uiIndex; switch (index) { case 0: uiIndex = 1; break; case 1: uiIndex = 0; break; case 2: uiIndex = 2; break; case 3: uiIndex = 3; break; default: break; } let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex); this.displayList.push(temp); } } playSecretaryIdle() { let parent = this.ui.secretary.displayObject; parent.destroyChildren(); let xx = this.ui.secretary.width / 2; let yy = this.ui.secretary.height; let scale = xGame.common.getSecretaryScale(); let data = { x: xx, y: yy, scaleX: scale, scaleY: scale }; xGame.common.secretary.play(data, 0, true, parent); } returnUIMain() { this.hide(); xGame.common.stopGirlPop(this.ui.talkNode); xGame.uiMgr.Show(UIMain$1); } interuptSecretary() { Laya.timer.clearAll(this); this.playSecretaryRandomSound(); } playSecretaryRandomSound() { if (this.isHide) return; let time = xGame.common.randomNum(45000, 60000); Laya.timer.once(time, this, () => { if (this.isHide) return; let index = xGame.common.randomNum(4, 7); xGame.soundMgr.playSound("s_main0" + index); let words = 1; switch (index) { case 4: words = 5; break; case 5: words = 3; break; case 6: words = 6; break; case 7: words = 7; break; default: break; } xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt); this.playSecretaryRandomSound(); }); } } UISkill$1.uiName = "UISkill"; class UIAddProp$1 extends UIBase { constructor() { super(); this.curType = ""; } onConstructor() { this.ui = ui_UIAddProp.createInstance(); this.contentPane = this.ui; this.isEject = false; this.addUIClick(this.ui.closeBtn, this.closeSelf); this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]); this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]); this.updateUI(); this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond); this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond); this.addUIClick(this.ui.myNode.node6, this.openPutBallView); this.addUIClick(this.ui.myNode.node3, this.videoGetCoin); this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]); this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]); } show(type) { super.show(); this.curType = type == 0 ? "coin" : "diamond"; this.switchBtn(""); this.ui.t0.play(); this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1; PlatMgr.showInsert(true); } closeSelf() { this.hide(); } updateUI() { let data = cfgTable.moneyData; let temp; let obj; for (const key in data) { temp = data[key]; obj = this.ui.myNode["node" + key]; if (parseInt(key) <= 2) { obj.diamondTxt.text = "+" + temp.num; } else { obj.coinTxt.text = temp.num; obj.diamondTxt.text = temp.get.split('_')[1]; } } this.updateDiamondShare(); } updateDiamondShare() { let data = DataMgr.getShareDiamondTimes(); if (data >= xGame.common.maxShareDiamondTimes) { this.ui.myNode.node1.shareTxt.text = "Available Tomorrow"; this.ui.myNode.node1.touchable = false; xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow"); } else { this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`; this.ui.myNode.node1.touchable = true; } } switchBtn(type) { if (type == "") type = this.curType; else { if (this.curType == type) { return; } else { this.curType = type; } } if (type == "coin") { this.ui.myNode.coinBtn.c1.selectedIndex = 0; this.ui.myNode.diamondBtn.c1.selectedIndex = 1; this.ui.myNode.coinBtn.displayObject.zOrder = 10; this.ui.myNode.diamondBtn.displayObject.zOrder = 9; this.ui.myNode.c1.selectedIndex = 0; } else { this.ui.myNode.coinBtn.c1.selectedIndex = 1; this.ui.myNode.diamondBtn.c1.selectedIndex = 0; this.ui.myNode.coinBtn.displayObject.zOrder = 9; this.ui.myNode.diamondBtn.displayObject.zOrder = 10; this.ui.myNode.c1.selectedIndex = 1; } } convertCoin(index) { let data = cfgTable.moneyData[index]; let coinNum = data.num; let str = data.get.split('_')[1]; let needDiamond = parseInt(str); if (DataMgr.diamondEnough(needDiamond)) { DataMgr.setDiamond(-needDiamond); xGame.common.playObjFlyAnim(coinNum, Prop.coin); xGame.uiMgr.Show(UIMsg$1, "Exchange successful!"); } else { xGame.uiMgr.Show(UIMsg$1, "Diamond shortage"); this.switchBtn("diamond"); } } videoGetDiamond() { console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond'); if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) { } else { console.log('zh:AD 失败,直接发放奖励'); this.qjff_AD_for_uiAddProp_videoGetDiamond(); } } qjff_AD_for_uiAddProp_videoGetDiamond() { let num = cfgTable.moneyData[2].num; xGame.common.playObjFlyAnim(num, Prop.diamond); this.closeSelf(); } videoGetCoin() { console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin'); if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) { } else { console.log('zh:AD 失败,直接发放奖励'); this.qjff_AD_for_uiAddProp_videoGetCoin(); } } qjff_AD_for_uiAddProp_videoGetCoin() { xGame.common.playObjFlyAnim(2000, Prop.coin); this.closeSelf(); } shareGetDiamond() { let times = DataMgr.getShareDiamondTimes(); if (times >= xGame.common.maxShareDiamondTimes) { console.log('zh: 233333333333 maxShareDiamondTimes'); xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow"); } else { console.log('zh:33333333333333ad'); console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond'); if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) { } else { console.log('zh:AD 失败,直接发放奖励'); this.qjff_AD_for_uiAddProp_shareGetDiamond(); } } } qjff_AD_for_uiAddProp_shareGetDiamond() { let diamond = xGame.common.randomNum(50, 100); xGame.common.playObjFlyAnim(diamond, Prop.diamond); DataMgr.setShareDiamondTimes(1); this.updateDiamondShare(); } openPutBallView() { let end = xGame.uiMgr.getUI(UIGameEnd$1); let skill = xGame.uiMgr.getUI(UISkill$1); let level = xGame.uiMgr.getUI(UILevelDisplay$1); let uigame = xGame.uiMgr.getUI(UIGame$1); if (end && !end.isHide) { xGame.uiMgr.Hide(UIGameEnd$1); xGame.uiMgr.Show(UIMain$1); } if (skill && !skill.isHide) xGame.uiMgr.Hide(UISkill$1); if (uigame && !uigame.isHide) xGame.uiMgr.Hide(UIGame$1); if (level && !level.isHide) { } else { xGame.uiMgr.Show(UILevelDisplay$1); } this.closeSelf(); } } UIAddProp$1.uiName = "UIAddProp"; class MoneyNode$1 { constructor(ui) { this.leftTime = 0; this.ui = ui; this.ui.addCoinBtn.onClick(this, this.addCoin); this.ui.addDiamondBtn.onClick(this, this.addDiamond); this.ui.addPowerBtn.onClick(this, this.addPower); this.ui.c1.selectedIndex = 1; xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange); xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange); xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange); xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime); this.coinChange(); this.diamondChange(); this.powerChange(); } addPower() { xGame.soundMgr.playSound(xGame.common.btnClickStr); xGame.uiMgr.Show(UIPower$1); } powerChange() { let powerNum = DataMgr.getPower(); this.ui.powerTxt.text = powerNum + ""; } checkPowerTime() { let cur = new Date().getTime(); let last = DataMgr.getPowerTime(); if (last == 0) { last = cur; DataMgr.setPowerTime(cur); } let power = DataMgr.getPower(); let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000)); Laya.timer.clearAll(this); if (power >= xGame.common.natureMaxPower) { this.ui.powerTimeTxt.text = ""; DataMgr.setPowerTime(cur); return; } if (power + offset >= xGame.common.natureMaxPower) { DataMgr.setPower(xGame.common.natureMaxPower, false); this.ui.powerTimeTxt.text = ""; DataMgr.setPowerTime(cur); } else { if (offset > 0) { DataMgr.setPower(offset); DataMgr.setPowerTime(cur); } let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000); this.leftTime = xGame.common.powerRecoverNum - time; if (this.leftTime <= 0) this.leftTime = 0; this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime); Laya.timer.loop(1000, this, this.updatePowerTime); } } updatePowerTime() { this.leftTime -= 1; this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime); if (this.leftTime <= 0) { this.checkPowerTime(); } } coinChange() { this.ui.coinTxt.text = DataMgr.getCoin() + ""; } diamondChange() { this.ui.diamondTxt.text = DataMgr.getDiamond() + ""; } addCoin() { xGame.soundMgr.playSound(xGame.common.btnClickStr); Moyu.sendDataEvent("AddCoinBtn"); xGame.uiMgr.Show(UIAddProp$1, 0); } addDiamond() { xGame.soundMgr.playSound(xGame.common.btnClickStr); Moyu.sendDataEvent("AddDiamondBtn"); xGame.uiMgr.Show(UIAddProp$1, 1); } } class SettingNode$1 { constructor(ui) { this.showSetting = false; this.openSound = true; this.openShake = true; this.ui = ui; this.ui.soundBtn.onClick(this, this.switchSound); this.ui.shakeBtn.onClick(this, this.switchShake); this.ui.xyBtn.onClick(this, this.onXy); this.ui.clickNode.onClick(this, this.changeSetting); this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk; this.ui.xyBtn.visible = false; this.ui.shakeBtn.visible = false; } changeSetting() { xGame.soundMgr.playSound(xGame.common.btnClickStr); this.showSetting = !this.showSetting; this.ui.c1.selectedIndex = this.showSetting ? 1 : 0; } switchSound() { xGame.soundMgr.playSound(xGame.common.btnClickStr); this.openSound = !this.openSound; Moyu.onSetting(this.openSound, this.openShake); xGame.soundMgr.onSetting(this.openSound); this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1; } switchShake() { xGame.soundMgr.playSound(xGame.common.btnClickStr); this.openShake = !this.openShake; Moyu.onSetting(this.openSound, this.openShake); this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1; } onXy() { xGame.soundMgr.playSound(xGame.common.btnClickStr); MoyuMgr$1.showXy(1); } } class UIDraw$1 extends UIBase { constructor() { super(); this.curKey = 0; } onConstructor() { this.ui = ui_UIDraw.createInstance(); this.contentPane = this.ui; this.isEject = false; this.moneyNode = new MoneyNode$1(this.ui.moneyNode); this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf); this.addUIClick(this.ui.drawBtn, this.startDraw); this.initDraw(); this.initUI(); this.ui.myNode.flashNode.c1.selectedIndex = 1; if (Moyu.isKs) this.ui.closeNode.closeBtn.x += 100; } show() { super.show(); this.ui.t0.play(); this.playSecretaryIdle(); this.updateDraw(); this.checkFree(); if (PlatMgr.bannerDelay > 0) { this.ui.closeNode.closeBtn.visible = false; Laya.timer.once(PlatMgr.bannerDelay, this, () => { this.ui.closeNode.closeBtn.visible = true; }); } PlatMgr.showRateBanner(); } hide() { Laya.timer.clearAll(this); super.hide(); } checkFree() { let isFree = DataMgr.getDailyfreeDrawTimes(); this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1; } initDraw() { this.drawObj = []; let data = cfgTable.drawData; let temp; let weight = 0; for (const key in data) { temp = data[key]; weight += temp.weight; this.drawObj.push(weight); } this.allWeight = weight; } initUI() { let data = cfgTable.drawData; let temp; let img; let txt; for (const key in data) { temp = data[key]; img = this.ui.myNode.rotNode["img" + key]; txt = this.ui.myNode.rotNode["txt" + key]; img.url = xGame.common.getGameIconUrl(temp.icon); txt.visible = true; if (temp.award > 2) { img.rotation = 0; txt.text = cfgTable.ballrodData[temp.award - 1].name; } else { img.rotation = temp.rotation; txt.text = temp.num; } } } getCurkey() { let rand = Math.random() * this.allWeight; let temp; for (let index = 0; index < this.drawObj.length - 1; index++) { temp = this.drawObj[index]; if (index == 0) { if (rand < temp) { return index + 1; } } else { if (rand >= temp && rand < this.drawObj[index + 1]) { return index + 1; } } } return 2; } startDraw() { let freeTimes = DataMgr.getDailyfreeDrawTimes(); if (freeTimes > 0) { this.beginDraw(); DataMgr.setDailyfreeDrawTimes(0); this.checkFree(); } else { if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) { } else { console.log('zh:AD 失败,直接发放奖励'); this.qjff_chouJiang(); } } } qjff_chouJiang() { this.beginDraw(); } beginDraw() { this.ui.myNode.flashNode.c1.selectedIndex = 0; this.ui.drawBtn.touchable = false; this.curKey = this.getCurkey(); console.log("当前key", this.curKey); let cell = 60; let lap = 3; let angle = cell * (this.curKey - 1) + lap * 360; let target = this.ui.myNode.rotNode; target.rotation = 0; Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => { console.log("旋转完成"); this.ui.drawBtn.touchable = true; this.getAward(); })); } getAward() { let data = cfgTable.drawData[this.curKey]; let temp = new AwardType(); temp.type = data.award; temp.num = data.num; xGame.common.getAward([temp], () => { DataMgr.setDrawTimes(1); this.updateDraw(); this.ui.myNode.flashNode.c1.selectedIndex = 1; }); } updateDraw() { let drawTimes = DataMgr.getDrawTimes(); let awardTimes = DataMgr.getDrawAwardTimes(); if (Math.floor(drawTimes / 3) > awardTimes) { this.ui.extraNode.boxBtn.t0.play(null, -1); this.ui.extraNode.boxBtn.touchable = true; this.ui.extraNode.tipsTxt.text = "3/3"; this.ui.extraNode.barNode.width = 265; this.getExtraAward(); } else { this.ui.extraNode.boxBtn.t0.stop(); this.ui.extraNode.boxBtn.touchable = false; this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`; this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3; } let data = cfgTable.drawData[1]; if (awardTimes == 0) { this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon); this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name; this.ui.myNode.rotNode.img1.rotation = 0; } else { let award = data.nextid; this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]); this.ui.myNode.rotNode.txt1.text = award[1]; this.ui.myNode.rotNode.img1.rotation = 0; } } getExtraAward() { let drawTimes = DataMgr.getDrawTimes(); let awardTimes = DataMgr.getDrawAwardTimes(); let data = cfgTable.drawData[1]; let award = new AwardType(); if (awardTimes == 0) { award.num = data.num; award.type = data.award; xGame.common.getAward([award], () => { let all = Math.floor(drawTimes / 3); DataMgr.setDrawAwardTimes(all); this.updateDraw(); }); } else { award.num = parseInt(data.nextid[1]); award.type = parseInt(data.nextid[0]); xGame.common.getAward([award], () => { let all = Math.floor(drawTimes / 3); DataMgr.setDrawAwardTimes(all); this.updateDraw(); }); } } closeSelf() { this.hide(); } playSecretaryIdle() { let parent = this.ui.secretary.displayObject; parent.destroyChildren(); let xx = this.ui.secretary.width / 2; let yy = this.ui.secretary.height; let scale = xGame.common.getSecretaryScale(); let data = { x: xx, y: yy, scaleX: scale, scaleY: scale }; xGame.common.secretary.play(data, 0, true, parent); } } UIDraw$1.uiName = "UIDraw"; class UIRanking$1 extends UIBase { constructor() { super(); this.showSelf = true; this.rankType = 1; this.rankList = []; this.topX = 10; this.myIndex = this.topX + 1; this.myStar = 0; } onConstructor() { this.ui = ui_UIRanking.createInstance(); this.contentPane = this.ui; this.isEject = false; this.addUIClick(this.ui.myNode.closeBtn, this.hide); this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode); this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]); this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]); this.ui.myNode.myList.setVirtual(); this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false); } show() { super.show(); this.getPaiHangBangDataFormJosnFile(); this.updateSelf(); let self = Moyu.getUserInfo(); if (!self.isAuth) { Moyu.initUser(this, () => { DataMgr.upRankData(); }); } } getPaiHangBangDataFormJosnFile() { const rankingList = cfgTable.paiHangBangData.list; this.updateItemData(rankingList); } updateSelfItem() { console.log('zh:Moyu.platType =' + Moyu.platType); let self = Moyu.getUserInfo(); this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3; this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString(); if (this.myIndex > this.topX) { this.ui.myNode.selfNode.rankTxt.fontSize = 36; } else { this.ui.myNode.selfNode.rankTxt.fontSize = 30; } this.ui.myNode.selfNode.valueTxt.text = this.myStar + ""; this.ui.myNode.selfNode.nameTxt.text = 'myself'; xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon); } updateItemData(data) { this.myStar = xGame.common.getAllStarNum(); if (this.rankList.length < 2) { this.rankList = data; let self = Moyu.getUserInfo(); console.log('zh:myself iuserinfo = ' + JSON.stringify(self)); self.headIcon = self.headIcon; for (let i = 0; i < data.length; i++) { let data = this.rankList[i]; if (data.userId == self.userId) { this.rankList.splice(i, 1); break; } } for (let i = 0; i < data.length; i++) { let data = this.rankList[i]; if (data.rankScore < this.myStar && this.myIndex > this.topX) { this.myIndex = i + 1; let user = { headIcon: self.headIcon, nickName: "myself" }; let ud = { user: user, data: {} }; let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) }; console.log('zh:Moyu.platType = ' + Moyu.platType); if (Moyu.platType < 11) { user.headIcon = self.headIcon; user.nickName = self.nickName; } this.rankList.splice(i, 0, md); break; } } } this.updateSelfItem(); this.ui.myNode.myList.numItems = this.rankList.length; } updateItemUI(index, obj) { let data = this.rankList[index]; let userData = JSON.parse(data.userData).user; obj.nameTxt.text = userData.nickName.toString(); obj.valueTxt.text = data.rankScore; xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80); obj.rankTxt.text = index + 1; switch (index) { case 0: this.setImg(obj, 1, 0, 0); obj.rankTxt.color = "#FFC047"; break; case 1: this.setImg(obj, 0, 1, 0); obj.rankTxt.color = "#ACACAC"; break; case 2: this.setImg(obj, 0, 0, 1); obj.rankTxt.color = "#D09672"; break; default: this.setImg(obj, 0, 0, 0); obj.rankTxt.color = "#496FAB"; break; } } setImg(obj, a, b, c) { obj.img1.visible = a ? true : false; obj.img2.visible = b ? true : false; obj.img3.visible = c ? true : false; } changeList(type) { this.rankType = type; this.updateSelf(); } changeSelfNode() { this.showSelf = !this.showSelf; this.updateSelf(); } updateSelf() { this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1; this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1; this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1; this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0; this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1; } } UIRanking$1.uiName = "UIRanking"; class UISecretary$1 extends UIBase { constructor() { super(); this.curIndex = 1; } onConstructor() { this.ui = ui_UISecretary.createInstance(); this.contentPane = this.ui; this.isEject = false; this.addUIClick(this.ui.closeBtn, this.closeSelf); this.nodeObj = { left: null, right: null, cur: null }; this.nodeObj.cur = this.ui.myNode.gameNode3; } show() { super.show(); this.ui.t0.play(); this.updateData(); } addSecretarySpine(node, spineName) { if (spineName == "mishu") { if (this.secretarySpine1) { node.displayObject.destroyChildren(); this.playWoman(this.secretarySpine1, node.displayObject); } else { let spine1 = new SpineMgr("mishu", () => { this.secretarySpine1 = spine1; this.playWoman(this.secretarySpine1, node.displayObject); }); } } else { if (this.secretarySpine2) { node.displayObject.destroyChildren(); this.playWoman(this.secretarySpine2, node.displayObject); } else { let spine2 = new SpineMgr("xiaomishu2", () => { this.secretarySpine2 = spine2; this.playWoman(this.secretarySpine2, node.displayObject); }); } } } playWoman(node, parent) { let xx = this.ui.myNode.gameNode3.secretary.width / 2; let yy = this.ui.myNode.gameNode3.secretary.height; let scale = 1.5; if (node == this.secretarySpine2) { scale = 1.2; } let data = { x: xx, y: yy, scaleX: scale, scaleY: scale }; node.play(data, 0, true, parent); } turnLeft() { this.curIndex--; if (this.curIndex < 1) { this.curIndex = 2; } let left = this.nodeObj.left; let right = this.nodeObj.right; let cur = this.nodeObj.cur; Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500); Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500); Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => { this.updateData(); })); this.ui.myNode.setChildIndex(right, 2); this.nodeObj.left = cur; this.nodeObj.right = left; this.nodeObj.cur = right; } turnRight() { this.curIndex++; if (this.curIndex > 2) { this.curIndex = 1; } let left = this.nodeObj.left; let right = this.nodeObj.right; let cur = this.nodeObj.cur; Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500); Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500); Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => { this.updateData(); })); this.ui.myNode.setChildIndex(left, 2); this.nodeObj.left = right; this.nodeObj.right = cur; this.nodeObj.cur = left; } updateData() { console.log('zh: updateData FFFFFFFFFF'); let data = cfgTable.secretaryshopData; let children = this.ui.myNode._children; let temp; let curData; for (let index = 0; index < children.length; index++) { temp = children[index]; curData = data[1]; temp.heightTxt.text = curData.height; temp.foodTxt.text = curData.food; temp.historyTxt.text = curData.history; temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg); this.addSecretarySpine(temp.secretary, curData.spine); let womanIndex = curData.id - 1; let getWoman = DataMgr.getSecretary(womanIndex); let curUse = DataMgr.getCurSecretary(); if (getWoman) { if (curUse == womanIndex) { temp.purchaseBtn.c1.selectedIndex = 1; } else { temp.purchaseBtn.c1.selectedIndex = 2; } } else { temp.purchaseBtn.c1.selectedIndex = 0; temp.purchaseBtn.diamondTxt.text = curData.price + ""; } temp.purchaseBtn.visible = false; } } clickSecretary(getWoman, curUse, womanIndex, needDiamond) { console.log('zh: 点击了clickSecretary '); xGame.soundMgr.playSound(xGame.common.btnClickStr); if (getWoman) { if (curUse != womanIndex) { console.log(); DataMgr.setCurSecretary(womanIndex); this.updateData(); } } else { console.log('zh:点击购买了'); let need = needDiamond; if (DataMgr.diamondEnough(need)) { DataMgr.setDiamond(-need); DataMgr.setSecretary(womanIndex, 1); DataMgr.setCurSecretary(womanIndex); this.updateData(); } else { xGame.uiMgr.Show(UIAddProp$1, 1); } } } closeSelf() { this.hide(); } } UISecretary$1.uiName = "UISecretary"; class BallRodDisplay$1 { constructor(ui, index) { this.index = 0; this.uiIndex = 0; this.ui = ui; this.index = index; this.initData(); } initData() { this.ui.purchaseBtn.onClick(this, this.buyBallRod); let data = cfgTable.ballrodData[this.index + 1]; this.ui.nameTxt.text = data.name; this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img); this.ui.levelNode.c1.selectedIndex = data.quality; this.ui.purchaseBtn.diamondTxt.text = data.price + ""; if (data.spine) { this.mySpine = new SpineMgr(data.spine, () => { let xx = 150; let yy = 70; let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 }; this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject); }); } } updateSelf() { console.log('zh:updateSelf -------------- '); let get = DataMgr.getBallRod(this.index); if (get == null) get = 1; let curUse = DataMgr.getCurBallRod(); console.log('zh:updateSelf 选择的球杆 = ' + curUse); if (get) { if (curUse == this.index) { this.ui.purchaseBtn.c1.selectedIndex = 0; } else { this.ui.purchaseBtn.c1.selectedIndex = 1; } } else { this.ui.purchaseBtn.c1.selectedIndex = 2; } } buyBallRod() { xGame.soundMgr.playSound(xGame.common.btnClickStr); let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex; switch (selectedIndex) { case 0: break; case 1: console.log('zh:点击了 USE THIS'); DataMgr.setCurBallRod(this.index); let curUse = DataMgr.getCurBallRod(); console.log('zh:updateSelf 选择的球杆 = ' + curUse); let ui = xGame.uiMgr.getUI(UIShop$1); ui.updateBallRod(); break; case 2: let data = cfgTable.ballrodData[this.index + 1]; let need = data.price; if (DataMgr.diamondEnough(need)) { DataMgr.setDiamond(-need); DataMgr.setBallRod(this.index, 1); DataMgr.setCurBallRod(this.index); let ui = xGame.uiMgr.getUI(UIShop$1); ui.updateBallRod(); this.logEventForGouMaiGan(selectedIndex + '-' + data.name); } else { xGame.uiMgr.Show(UIAddProp$1, 1); } break; default: break; } } logEventForGouMaiGan(qiuGanName) { const ev = { value: qiuGanName }; const jsonStr = JSON.stringify(ev); console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr); JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr); } } class UIShop$1 extends UIBase { constructor() { super(); this.itemNums = 0; this.curType = ""; } onConstructor() { this.ui = ui_UIShop.createInstance(); this.contentPane = this.ui; this.isEject = false; this.moneyNode = new MoneyNode$1(this.ui.moneyNode); this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf); this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan")); this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju")); this.addUIClick(this.ui, this.interuptSecretary); console.log('zh:this.renderBallRodthis.renderBallRodthis.renderBallRodthis.renderBallRod = ' + this.renderBallRod); this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false); this.ballRodArr = []; this.itemNums = Object.keys(cfgTable.ballrodData).length; this.ui.myNode.myList.numItems = this.itemNums; } show(type) { super.show(); console.log('zh:show type = ' + type); this.curType = type == 0 ? "qiugan" : "daoju"; this.switchBtn("qiugan"); this.playSecretaryIdle(); this.updateBallRod(); } test123() { console.log('zh:test123 '); } switchBtn(type) { console.log('zh:1111切換 sel type=' + type); if (type == "") { type = this.curType; } else { if (this.curType == type) { return; } else { this.curType = type; } } if (type == "qiugan") { console.log('zh:qg sel'); this.ui.myNode.n_qiuGan.c1.selectedIndex = 0; this.ui.myNode.n_daoju.c1.selectedIndex = 1; this.ui.myNode.myList.visible = true; this.ui.myNode.djList.visible = false; } else { console.log('zh:dj sel'); this.ui.myNode.n_qiuGan.c1.selectedIndex = 1; this.ui.myNode.n_daoju.c1.selectedIndex = 0; this.ui.myNode.myList.visible = false; this.ui.myNode.djList.visible = true; } } updateBallRod() { for (let index = 0; index < this.ballRodArr.length; index++) { this.ballRodArr[index].updateSelf(); } } renderBallRod(sort, obj) { let index = this.getIndexBySort(sort + 1) - 1; let ballRod = new BallRodDisplay$1(obj, index); this.ballRodArr.push(ballRod); } getIndexBySort(sort) { let object = cfgTable.ballrodData; for (const key in object) { if (object[key].sort == sort) { return parseInt(key); } } } playSecretaryIdle() { let parent = this.ui.secretary.displayObject; parent.destroyChildren(); let xx = this.ui.secretary.width / 2; let yy = this.ui.secretary.height; let scale = xGame.common.getSecretaryScale(); let data = { x: xx, y: yy, scaleX: scale, scaleY: scale }; xGame.common.secretary.play(data, 0, true, parent); } interuptSecretary() { Laya.timer.clearAll(this); this.playSecretaryRandomSound(); } playSecretaryRandomSound() { if (this.isHide) return; let time = xGame.common.randomNum(45000, 60000); Laya.timer.once(time, this, () => { if (this.isHide) return; let index = xGame.common.randomNum(4, 7); xGame.soundMgr.playSound("s_main0" + index); let words = 1; switch (index) { case 4: words = 5; break; case 5: words = 3; break; case 6: words = 6; break; case 7: words = 7; break; default: break; } xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt); this.playSecretaryRandomSound(); }); } closeSelf() { this.hide(); } } UIShop$1.uiName = "UIShop"; class SignMax$1 { constructor(ui) { this.ui = ui; } updateSelf(index, sameDay, curDayIndex) { let data = cfgTable.signData[index + 1]; this.ui.titleTxt.text = data.title; let arr1 = data.award[0].split('-'); let arr2 = data.award[1].split('-'); let num1 = parseInt(arr1[1]); let num2 = parseInt(arr2[1]); this.ui.numTxt1.text = num1 + ""; this.ui.numTxt2.text = num2 + ""; this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]); this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]); if (xGame.common.signAwardContainsRod([data.award[0]])) { this.ui.numTxt1.visible = false; } else { this.ui.numTxt1.visible = true; } if (xGame.common.signAwardContainsRod([data.award[1]])) { this.ui.numTxt2.visible = false; } else { this.ui.numTxt2.visible = true; } if (index < curDayIndex) { this.ui.c1.selectedIndex = 1; } else if (index == curDayIndex) { if (sameDay) { this.ui.c1.selectedIndex = 2; } else { this.ui.c1.selectedIndex = 2; } } else { this.ui.c1.selectedIndex = 0; } } } class SignNormal$1 { constructor(ui) { this.ui = ui; } updateSelf(index, sameDay, curDayIndex) { let data = cfgTable.signData[index + 1]; this.ui.titleTxt.text = data.title; let arr = data.award[0].split('-'); let type = parseInt(arr[0]); let num = parseInt(arr[1]); this.ui.numTxt.text = num + ""; if (type > 2) { this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]); this.ui.myIcon.rotation = 0; } else { this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]); this.ui.myIcon.rotation = 0; } if (xGame.common.signAwardContainsRod(data.award)) { this.ui.numTxt.visible = false; } else { this.ui.numTxt.visible = true; } if (index < curDayIndex) { this.ui.c1.selectedIndex = 1; } else if (index == curDayIndex) { if (sameDay) { this.ui.c1.selectedIndex = 2; } else { this.ui.c1.selectedIndex = 2; } } else { this.ui.c1.selectedIndex = 0; } } } class UISign$1 extends UIBase { constructor() { super(); this.curDayIndex = 0; this.starX = 0; } onConstructor() { this.ui = ui_UISign.createInstance(); this.contentPane = this.ui; this.isEject = false; this.moneyNode = new MoneyNode$1(this.ui.moneyNode); this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf); this.initSignItem(); this.addUIClick(this.ui.normalBtn, this.normalGetAward); this.addUIClick(this.ui.againBtn, this.againGetAward); } show() { super.show(); this.ui.t0.play(); this.playSecretaryIdle(); this.updateSign(); } initSignItem() { this.signArr = []; for (let index = 0; index < 6; index++) { let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]); this.signArr.push(temp); } this.signMax = new SignMax$1(this.ui.myNode.day7); if (Moyu.isKs) this.ui.closeNode.closeBtn.x += 100; } updateSign() { let sameDay = xGame.common.judgeSameDay(); let max = 7; this.curDayIndex = DataMgr.getSignData(); if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay)) this.curDayIndex = 0; if (!sameDay) { this.ui.normalBtn.visible = true; this.ui.tipsNode.visible = false; this.ui.againBtn.visible = false; } else { this.ui.normalBtn.visible = false; let again = DataMgr.getExtraSign(); let isCurrency = false; let index = this.curDayIndex; if (index == 0) index = 7; let award = cfgTable.signData[index].award; let num = award[0].split("-")[0]; if (num == "1" || num == "2") isCurrency = true; let showAgain = again == 0 && isCurrency; this.ui.againBtn.visible = showAgain; this.ui.tipsNode.visible = !showAgain; } for (let index = 0; index < this.signArr.length; index++) { this.signArr[index].updateSelf(index, sameDay, this.curDayIndex); } this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex); } playSecretaryIdle() { let parent = this.ui.secretary.displayObject; parent.destroyChildren(); let xx = this.ui.secretary.width / 2; let yy = this.ui.secretary.height; let scale = xGame.common.getSecretaryScale(); let data = { x: xx, y: yy, scaleX: scale, scaleY: scale }; xGame.common.secretary.play(data, 0, true, parent); } closeSelf() { this.hide(); } normalGetAward() { let sameDay = xGame.common.judgeSameDay(); if (!sameDay) { let award = cfgTable.signData[this.curDayIndex + 1].award; let temp; let type; let num; let arr = []; for (let index = 0; index < award.length; index++) { temp = award[index].split("-"); type = parseInt(temp[0]); num = parseInt(temp[1]); let awardType = new AwardType(); awardType.num = num; awardType.type = type; arr.push(awardType); } xGame.common.getAward(arr, (watchVideo) => { this.curDayIndex++; if (this.curDayIndex > 7) this.curDayIndex = 0; DataMgr.setSignData(this.curDayIndex); DataMgr.setSignTime(new Date().getTime()); if (watchVideo) { DataMgr.setExtraSign(1); Moyu.sendDataEvent("signIn1"); } this.updateSign(); }); } } againGetAward() { Moyu.sendDataEvent("signIn2"); console.log('zh:qjff_AD_for_uisign'); if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) { } else { console.log('zh:AD 失败,直接发放奖励'); this.qjff_AD_for_uisign(); } } qjff_AD_for_uisign() { let index = this.curDayIndex; if (index == 0) index = 7; let award = cfgTable.signData[index].award; let temp; let type; let num; for (let index = 0; index < award.length; index++) { temp = award[index].split("-"); type = parseInt(temp[0]); num = parseInt(temp[1]) * 3; xGame.common.playObjFlyAnim(num, type); } DataMgr.setExtraSign(1); this.updateSign(); } } UISign$1.uiName = "UISign"; class UIModeSelection$1 extends UIBase { constructor() { super(); } onConstructor() { this.ui = ui_UIModeSelection.createInstance(); this.contentPane = this.ui; this.isEject = false; this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]); this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]); this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]); this.addUIClick(this.ui.closeBtn, this.hide); this.peopleArr = [65, 990, 580]; this.peopleOffest = [5, 10, 10]; } show(callback) { this.updateSelf(); super.show(); this.ui.t0.play(); this.callback = callback; } updateSelf() { let cfg = cfgTable.modeselectData; for (let index = 1; index <= 3; index++) { let node = this.ui.myNode["type" + index]; node.need.text = cfg[index].need; node.tipsTxt.text = `Min ${cfg[index].need} Eligible`; node.peopleTxt.text = this.getRandPeople(index - 1); } } enterGame(type) { console.log('zh: 进入经典模式 type: ' + type); xGame.common.classicRoomType = type; let cfg = cfgTable.modeselectData[type]; let need = cfg.need; xGame.common.passAwardCoin = cfg.award; if (DataMgr.coinEnough(need)) { DataMgr.setCoin(-need); this.ui.myNode["type" + type].t0.play(); Laya.timer.once(200, this, () => { this.callback && this.callback(); }); this.logEventForClassic_start(); } else { Moyu.sendDataEvent("AddCoinVideo"); xGame.uiMgr.Show(UIAddProp$1, 0); } } getRandPeople(index) { let rand = this.peopleOffest[index]; return this.peopleArr[index] + xGame.common.randomNum(-rand, rand); } logEventForClassic_start() { let rtype = xGame.common.classicRoomType; let msmc = ''; if (rtype == 1) { msmc = 'beginner'; } if (rtype == 2) { msmc = 'expert'; } if (rtype == 3) { msmc = 'master'; } let keyStr = 'sjmd_classic_start_' + rtype; let jsonStr = { "difficulty": msmc, "classic_count": 1, "difficulty_count": 1 }; if (LocalStorageManager.hasJosnKey(keyStr)) { const d = LocalStorageManager.getItem(keyStr); jsonStr.classic_count = d.classic_count + 1; jsonStr.difficulty_count = d.difficulty_count + 1; LocalStorageManager.setItem(keyStr, jsonStr); } else { LocalStorageManager.setItem(keyStr, jsonStr); } const reqStr = JSON.stringify(jsonStr); JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr); } } UIModeSelection$1.uiName = "UIModeSelection"; class UILogin$1 extends UIBase { constructor() { super(); } onConstructor() { this.ui = ui_UILogin.createInstance(); this.contentPane = this.ui; this.isEject = false; this.addUIClick(this.ui.closeBtn, this.closeSelf); this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage); this.addUIClick(this.ui.btn_login, this.userLogin); } show() { super.show(); this.x = (Laya.stage.width - this.width) / 2; this.y = (Laya.stage.height - this.height) / 2; } closeSelf() { this.hide(); } userLogin() { let ua = this.ui.txt_ua.text; let up = this.ui.txt_up.text; if (ua && up) { xGame.uiMgr.Show(UIMsg$1, "Request in progress.."); let reqData = JSON.stringify({ username: ua.trim(), password: up.trim(), fromMark: 'app_game' }); xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => { try { console.log('zh:res = ' + JSON.stringify(res)); let code = res.code; let msg = res.msg; xGame.uiMgr.Show(UIMsg$1, msg); if (code == 200) { let keyStr = 'userInfo'; let jsonStr = { "username": res.username, "token": res.token }; LocalStorageManager.setItem(keyStr, jsonStr); } else { } } catch (error) { console.log('error=' + error); alert(error); } finally { } }); } else { xGame.uiMgr.Show(UIMsg$1, "Missing information!"); } } gotoRegPage() { this.closeSelf(); xGame.uiMgr.Show(UIReg$1); } } UILogin$1.uiName = "UILogin"; class UIReg$1 extends UIBase { constructor() { super(); } onConstructor() { this.ui = ui_UIReg.createInstance(); this.contentPane = this.ui; this.isEject = false; this.addUIClick(this.ui.closeBtn, this.closeSelf); this.addUIClick(this.ui.btn_reg, this.regUser); this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin); } show() { super.show(); this.x = (Laya.stage.width - this.width) / 2; this.y = (Laya.stage.height - this.height) / 2; } closeSelf() { this.hide(); } regUser() { this.ui.lab_tip.visible = false; let ua = this.ui.txt_ua.text; let up1 = this.ui.txt_up1.text; let up2 = this.ui.txt_up2.text; if (ua && up1 && up2 && up1 == up2) { xGame.uiMgr.Show(UIMsg$1, "Request in progress.."); let reqData = JSON.stringify({ username: ua.trim(), password: up1.trim(), fromMark: 'app_game' }); xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => { try { this.ui.lab_tip.visible = true; console.log('zh:res = ' + JSON.stringify(res)); let code = res.code; let msg = res.msg; this.ui.lab_tip.text = msg; xGame.uiMgr.Show(UIMsg$1, msg); if (code == 200) { this.ui.lab_tip.color = "#FFFFFF"; } else { this.ui.lab_tip.color = "#FF0000"; } } catch (error) { console.log('error=' + error); alert(error); } finally { } }); } else { if (up1 != up2) { xGame.uiMgr.Show(UIMsg$1, "Password mismatch!"); } else { xGame.uiMgr.Show(UIMsg$1, "Missing information!"); } } } gotoLogin() { this.closeSelf(); xGame.uiMgr.Show(UILogin$1); } } UIReg$1.uiName = "UIReg"; class UITry$1 extends UIBase { constructor() { super(); this.closeTime = 0; this.closeNum = 0; this.skillUrl = xGame.common.skillIconList; } onConstructor() { this.ui = ui_UITry.createInstance(); this.contentPane = this.ui; this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel); this.addUIClick(this.ui.myNode.videoBtn, this.onTry); } show() { super.show(); this.closeNum = 0; this.closeTime = 15; this.ui.t0.play(); PlatMgr.showRateBanner(); this.ui.myNode.txtTime.text = this.closeTime.toString(); Laya.timer.loop(1000, this, this.updateTime); let iconStr = this.skillUrl[xGame.common.curPlayerSkillType]; this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr); xGame.common.gameMgr.gamePause = true; } updateTime() { if (this.closeTime > 1) { this.closeTime--; this.ui.myNode.txtTime.text = this.closeTime.toString(); } else this.hide(); } hide() { Laya.timer.clearAll(this); Moyu.showBannerAd(false); super.hide(); xGame.common.gameMgr.gamePause = false; } onTry() { console.log('zh:qjff_AD_for_uitry'); if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) { } else { console.log('zh:AD 失败,直接发放奖励'); this.qjff_AD_for_uitry(); } } qjff_AD_for_uitry() { let select = xGame.common.curPlayerSkillType; DataMgr.gameData.trySkill = select; DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000; DataMgr.saveGameData(); DataMgr.setBigSkill(select, 1); xGame.showTip("Trial Successful"); this.hide(); } onCancel() { if (this.closeNum > 0) { this.closeNum--; if (this.closeNum < 2) this.hide(); return; } else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) { this.onTry(); } else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) { this.closeNum = 3; } else this.hide(); } } UITry$1.uiName = "UITry"; class UIGetAward$1 extends UIBase { constructor() { super(); this.showTriple = true; } onConstructor() { this.ui = ui_UIGetAward.createInstance(); this.contentPane = this.ui; this.isEject = false; this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward); this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward); this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false); } show(arr, showTriple, callback) { super.show(); this.ui.t0.play(); this.ui.eftNode.visible = true; this.ui.eftNode.t0.play(Laya.Handler.create(this, () => { this.ui.eftNode.visible = false; }), 1, 0, 0, 0.9); this.awardArr = arr; this.showTriple = showTriple; this.callback = callback; this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1; this.ui.myList.numItems = arr.length; xGame.soundMgr.playSound("getaward"); } updateSelf(index, obj) { let temp = this.awardArr[index]; let icon = this.getIcon(temp.type); let str = icon; if (temp.type > 2) { str = "s" + icon; } obj.myIcon.url = xGame.common.getGameIconUrl(str); obj.myIcon.rotation = 0; obj.numTxt.text = temp.num + ""; obj.numTxt.visible = temp.type > 2 ? false : true; obj.nameTxt.text = this.getNameStr(temp.type); } renderItem(index, obj) { this.updateSelf(index, obj); } tripleGetAward() { console.log('zh:qjff_AD_for_uigetAward'); if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) { } else { console.log('zh:AD 失败,直接发放奖励'); this.qjff_AD_for_uigetAward(); } } qjff_AD_for_uigetAward() { this.getAward(3); } normalGetAward() { if (PlatMgr.isMisVideo()) this.tripleGetAward(); else this.getAward(); } getAward(times = 1) { this.hide(); for (let index = 0; index < this.awardArr.length; index++) { this.awardArr[index].num *= times; } this.callback && this.callback(times != 1); } getIcon(type) { switch (type) { case Prop.diamond: return "ty_zs"; case Prop.coin: return "ty_jb"; case Prop.gan1: return "qg1"; case Prop.gan2: return "qg2"; case Prop.gan3: return "qg3"; case Prop.gan4: return "qg4"; default: break; } } getNameStr(type) { switch (type) { case Prop.diamond: return "Diamond"; case Prop.coin: return "Coins"; case Prop.gan1: case Prop.gan2: case Prop.gan3: case Prop.gan4: return cfgTable.ballrodData[type - 1].name; default: break; } } } UIGetAward$1.uiName = "UIGetAward"; class UIBox$1 extends UIBase { constructor() { super(); this.boxNum = 0; this.boxMax = 10; this.inAd = false; this.isClose = false; } onConstructor() { this.ui = ui_UIBox.createInstance(); this.contentPane = this.ui; this.isEject = false; this.addUIClick(this.ui.closeBtn, this.onCloseBox); this.addUIClick(this.ui.openBtn, this.onOpenBox); Laya.timer.loop(1000, this, this.update); } update() { if (this.boxNum > 0 && this.boxNum < this.boxMax) { this.boxNum -= 1; this.upBar(); } } upBar() { if (this.boxNum > this.boxMax) this.boxNum = this.boxMax; this.ui.bar.value = this.boxNum * 10; } show() { super.show(); this.isClose = false; this.boxNum = 0; this.inAd = false; this.upBar(); this.ui.t0.play(); this.ui.closeBtn.visible = false; Laya.timer.once(3000, this, () => { this.ui.closeBtn.visible = true; this.ui.bar.alpha = 1; }); Laya.timer.once(500, this, () => { this.ui.t1.play(); }); } hide() { Laya.timer.clearAll(this); Moyu.showBannerAd(false); super.hide(); } onOpenBox() { this.boxNum++; if (this.boxNum < this.boxMax) { if (PlatMgr.getRand() < PlatMgr.boxInsertRate) { JSBridgeUtils.instance.showInternAd('uivideoshare_show'); } } else if (this.boxNum == this.boxMax) { if (PlatMgr.getRand() < PlatMgr.boxVideoRate) { this.ui.openBtn.c1.selectedIndex = 13; this.inAd = true; } else this.getAward(); } else if (this.inAd) { console.log('zh:qjff_AD_for_UIBOX_onOpenBox'); if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) { } else { console.log('zh:AD 失败,直接发放奖励'); this.qjff_AD_for_UIBOX_onOpenBox(); } } this.upBar(); } qjff_AD_for_UIBOX_onOpenBox() { this.getAward(); } onCloseBox() { if (this.isClose) this.hide(); else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) { this.isClose = true; PlatMgr.showBanner(true, 0, 3000); } else this.hide(); } getAward() { let str = ""; if (Math.random() < 0.5) { let max = Moyu.isLegal ? 500 : 2500; let num = xGame.tools.random(max, 500 + max); DataMgr.setCoin(num); str = "金币x" + num; } else { let max = Moyu.isLegal ? 10 : 30; let num = xGame.tools.random(max, 30 + max); DataMgr.setDiamond(num); str = "钻石x" + num; } xGame.showTip("恭喜获得-" + str); this.hide(); } } UIBox$1.uiName = "UIBox"; class UIMain$1 extends UIBase { constructor() { super(); this.firstEnter = true; } nativeCallJs(msg) { let t = msg; console.log("zh: nativeCallJs 奖励开始发放:", t); switch (t) { case 'qjff_chouJiang': let dui = xGame.uiMgr.getUI(UIDraw$1); dui.qjff_chouJiang(); break; case 'qjff_AD_for_uisign': let dui2 = xGame.uiMgr.getUI(UISign$1); dui2.qjff_AD_for_uisign(); break; case 'qjff_AD_for_uitry': let dui3 = xGame.uiMgr.getUI(UITry$1); dui3.qjff_AD_for_uitry(); break; case 'qjff_AD_for_uipower': let dui4 = xGame.uiMgr.getUI(UIPower$1); dui4.qjff_AD_for_uipower(); break; case 'qjff_AD_for_uigetAward': let dui5 = xGame.uiMgr.getUI(UIGetAward$1); dui5.qjff_AD_for_uigetAward(); break; case 'qjff_AD_for_uiGameEnd': let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level'); let dui6 = xGame.uiMgr.getUI(UIGameEnd$1); dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level)); break; case 'qjff_AD_for_uiAddProp_videoGetDiamond': let dui7 = xGame.uiMgr.getUI(UIAddProp$1); dui7.qjff_AD_for_uiAddProp_videoGetDiamond(); break; case 'qjff_AD_for_uiAddProp_videoGetCoin': let dui8 = xGame.uiMgr.getUI(UIAddProp$1); dui8.qjff_AD_for_uiAddProp_videoGetCoin(); break; case 'qjff_AD_for_UIrepentProp_videoRegret': let dui9 = xGame.uiMgr.getUI(UIRepentProp$1); dui9.qjff_AD_for_UIrepentProp_videoRegret(); break; case 'qjff_AD_for_UIrepentProp_videoAddHelpLine': let dui10 = xGame.uiMgr.getUI(UIRepentProp$1); dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine(); break; case 'qjff_AD_for_UIBOX_onOpenBox': let dui11 = xGame.uiMgr.getUI(UIBox$1); dui11.qjff_AD_for_UIBOX_onOpenBox(); break; case 'qjff_AD_for_UIAddCoin': let dui12 = xGame.uiMgr.getUI(UIAddCoin$1); dui12.qjff_AD_for_UIAddCoin(); break; case '111a': let dui14 = xGame.uiMgr.getUI(UISign$1); dui14.qjff_AD_for_uisign(); break; case '222a': let dui15 = xGame.uiMgr.getUI(UISign$1); dui15.qjff_AD_for_uisign(); break; case '333a': let dui16 = xGame.uiMgr.getUI(UISign$1); dui16.qjff_AD_for_uisign(); break; default: console.log('zh:未知的方法名字' + t); break; } } onConstructor() { console.log('zh: UIMain onConstructor'); this.ui = ui_UIMain.createInstance(); this.contentPane = this.ui; this.isEject = false; this.addEvent(); this.addClickSpine(); this.settingNode = new SettingNode$1(this.ui.settingNode); this.moneyNode = new MoneyNode$1(this.ui.moneyNode); xGame.eventMgr.on(RESTART_GAME, this, this.beginGame); xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo); xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary); let curUse = DataMgr.getCurSecretary(); this.changeSecretary(curUse); this.ui.talkNode.visible = false; let guide = DataMgr.getSkillGuide(); if (xGame.common.isNewDay && guide == 1) { xGame.common.isNewDay = false; xGame.soundMgr.playSound("s_main01"); xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt); console.log("zh:播放小秘书每天语音"); } this.onGetUserInfo(); this.ui.n83.visible = false; if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) { const d = LocalStorageManager.getItem(keyForLoginInfo); let ua = d.username; this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16); } this.c_btn_for_user(); window['nativeCallJs'] = this.nativeCallJs.bind(this); } Logout() { if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) { LocalStorageManager.removeItem(keyForLoginInfo); this.freshUser(); } } gotoLogin() { xGame.uiMgr.Show(UILogin$1); } gotoRegUser() { xGame.uiMgr.Show(UIReg$1); } c_btn_for_user() { this.ui.n_Logout.visible = false; this.ui.n_dengLu.visible = false; this.ui.n_zhuCe.visible = false; if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) { this.ui.n_Logout.visible = true; } else { this.ui.n_dengLu.visible = true; } } changeSecretary(curUse) { let name = cfgTable.secretaryshopData[curUse + 1].spine; xGame.common.secretary && xGame.common.secretary.dispose(); this.addSecretarySpine(name); } addSecretarySpine(name) { let spine = new SpineMgr(name, () => { this.playSecretaryIdle(); }); xGame.common.secretary = spine; } addClickSpine() { let clickSpine = new SpineMgr("dianji", () => { Laya.stage.on(Laya.Event.CLICK, this, (e) => { let parent = Laya.stage; let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 }; clickSpine.play(data, 0, false, parent, (spine) => { spine.destroy(true); }); }); }); } addEvent() { this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]); this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]); this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]); this.addUIClick(this.ui.globalBtn, this.startGlobal); this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall); this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]); this.addUIClick(this.ui, this.interuptSecretary); this.addUIClick(this.ui.rightBtn, this.ensureSecretary); this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]); this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView); this.addUIClick(this.ui.shopBtn, this.openShopView); this.addUIClick(this.ui.signBtn, this.openSignView); this.addUIClick(this.ui.drawBtn, this.openDrawView); this.addUIClick(this.ui.rankBtn, this.openRanking); this.addUIClick(this.ui.n_Logout, this.Logout); this.addUIClick(this.ui.n_dengLu, this.gotoLogin); this.addUIClick(this.ui.n_zhuCe, this.gotoRegUser); } show(showFailWords) { super.show(); this.moneyNode.ui.c1.selectedIndex = 1; this.playSecretaryIdle(); xGame.soundMgr.playMusic("caromhall01", 0); Laya.timer.clearAll(this); this.playSecretaryRandomSound(); console.log('zh:uimain.ts show show FailWords=', showFailWords); if (showFailWords) { console.log('zh:uimain.ts '); setTimeout(() => { let str = Math.random() <= 0.5 ? "s_main02" : "s_main03"; let words = -1; if (str == "s_main02") { words = 2; } else { words = 3; } xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt); xGame.soundMgr.playSound(str); }, 300); } this.showGuide(); this.ui.guideBtn.x = this.ui.liucheng2.myMask.x; this.ui.guideBtn.y = this.ui.liucheng2.myMask.y; let guide = DataMgr.getSkillGuide(); if (guide == 1) { let randTime = xGame.common.randomNum(300, 800); if (this.firstEnter) { console.log("zh: firstEnter"); this.firstEnter = false; randTime += 900; } else { console.log("zh: no firstEnter"); } Laya.timer.once(randTime, this, () => { xGame.common.autoPopUIView(); }); } } checkActive(show) { } showGuide() { let guide = DataMgr.getSkillGuide(); this.ui.guideBtn.visible = guide == 0; this.ui.enterGuide.visible = false; this.ui.secretaryGuide.visible = guide == 0; if (guide == 0) { console.log("zh:显示引导"); xGame.soundMgr.playSound("s_guide"); xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt); } else { console.log("zh:不需要显示引导"); } } ensureSecretary() { console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary'); this.ui.secretaryGuide.visible = false; this.ui.enterGuide.visible = true; this.ui.wordsNode.t0.play(); if (DataMgr.getNewUser()) Moyu.sendDataEvent("gameReady"); } playSecretaryIdle() { let parent = this.ui.secretary.displayObject; parent.destroyChildren(); let xx = this.ui.secretary.width / 2; let yy = this.ui.secretary.height; let scale = xGame.common.getSecretaryScale(); let data = { x: xx, y: yy, scaleX: scale, scaleY: scale }; console.log("zh:playSecretaryIdle", data); xGame.common.secretary.play(data, 0, true, parent); } startGame(type) { xGame.common.gameMode = type; Moyu.sendDataEvent("PlayGame", { type: type }); console.log('zh:进入游戏gameMode =' + xGame.common.gameMode); switch (xGame.common.gameMode) { case GameMode.classic: console.log('zh:进入经典模式111111111'); if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) { let db_over_lev = DataMgr.getChallengeMode_overLev(); console.log('zh:classic db_over_lev=', db_over_lev); if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) { console.log('zh:判断是否可以玩该模式classic =NO'); let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.'; xGame.uiMgr.Show(UIMsg$1, tipStr); return; } else { console.log('zh:可以玩该模式classic 66666666666666'); this.beginGame(); } } else { console.log('zh:不需要判断是否可以玩该classic'); let challengeTimes = DataMgr.getChallengeTimes(); if (challengeTimes == 0) { xGame.uiMgr.Show(UIInvitation$1); } else { this.beginGame(); } break; } case GameMode.bigMove: console.error('zh:bigMove check'); let guide = DataMgr.getSkillGuide(); if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) { let db_over_lev = DataMgr.getChallengeMode_overLev(); console.log('zh:bigMove db_over_lev=', db_over_lev); if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) { let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode'; xGame.uiMgr.Show(UIMsg$1, tipStr); return; } else { console.log('zh:可以玩该模式 bigMove'); this.beginGame(); if (DataMgr.getNewUser()) Moyu.sendDataEvent("gameStart0"); } } else { this.beginGame(); if (DataMgr.getNewUser()) Moyu.sendDataEvent("gameStart0"); } break; default: console.error('zh:未知错误!!!!'); break; } } beginGame(isNice = false) { console.log('zh:beginGame '); let guide = DataMgr.getSkillGuide(); if (guide == 1) { console.log('zh:非新手引导,showInternAd '); JSBridgeUtils.instance.showInternAd('beginGame'); } else { console.log('zh:新手引导,不显示AD '); } console.log('zh:beginGame 2 go'); if (xGame.common.gameMode == GameMode.classic) { if (isNice) { this.enterClassic(); } else { xGame.uiMgr.Show(UIModeSelection$1, () => { console.log('zh:BBBBBBBBBBBBBBB'); this.enterClassic(); }); } } else if (xGame.common.gameMode == GameMode.bigMove) { this.ui.enterGuide.visible = false; xGame.uiMgr.Show(UISkill$1); } } enterClassic() { xGame.uiMgr.Show(UIGame$1); xGame.uiMgr.Show(UIMatching$1, () => { if (!this.isHide) this.hide(); xGame.common.gameUI.ui.alpha = 1; xGame.common.gameUI.startGame(); xGame.uiMgr.Hide(UIGameEnd$1); }); } startGlobal() { xGame.uiMgr.Show(UIMsg$1, "Coming Soon"); } startWeekly() { xGame.uiMgr.Show(UIMsg$1, "Coming Soon"); } zhouSaiMonth() { console.log('zh: zhouSaiMonth 被调用'); } startPlaceBall() { xGame.uiMgr.Show(UILevelDisplay$1); } hide() { console.log('zh:uimain hide ...'); super.hide(); xGame.common.stopGirlPop(this.ui.talkNode); } onGetUserInfo(force = false) { if (Moyu.isWx) { let info = Moyu.getSystemInfo(); if (info) Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser); } else { Moyu.initUser(this, this.freshUser, force); } this.freshUser(); } freshUser() { let user = Moyu.getUserInfo(); if (!user.isAuth) { user.headIcon = 'res/ty_touxiang.png'; } else { DataMgr.upRankData(); } this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16); xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon); let keyStr = keyForLoginInfo; if (LocalStorageManager.hasJosnKey(keyStr)) { const d = LocalStorageManager.getItem(keyStr); let ua = d.username; this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16); } else { } this.c_btn_for_user(); } interuptSecretary() { Laya.timer.clearAll(this); this.playSecretaryRandomSound(); } playSecretaryRandomSound() { if (this.isHide) return; let time = xGame.common.randomNum(45000, 60000); Laya.timer.once(time, this, () => { if (this.isHide) return; let index = xGame.common.randomNum(4, 7); xGame.soundMgr.playSound("s_main0" + index); let words = 1; switch (index) { case 4: words = 5; break; case 5: words = 3; break; case 6: words = 6; break; case 7: words = 7; break; default: break; } xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt); this.playSecretaryRandomSound(); }); } openSecretaryView() { xGame.uiMgr.Show(UISecretary$1); Moyu.sendDataEvent("secretary"); } openShopView() { xGame.uiMgr.Show(UIShop$1, 0); } openSignView() { xGame.uiMgr.Show(UISign$1); } openDrawView() { xGame.uiMgr.Show(UIDraw$1); } openRanking() { console.log('zh:phb openRanking'); xGame.uiMgr.Show(UIRanking$1); Moyu.sendDataEvent("rankingList"); } } UIMain$1.uiName = "UIMain"; function InitShader() { } function appInit() { xGame.context.init(getLoadingResList(), initCallback); } function getLoadingResList() { return [ { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE }, { url: "fgui/loading.obj", type: Laya.Loader.BUFFER } ]; } function getGameResList() { return [ { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER }, { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE }, { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE }, { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE }, { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE }, { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE }, { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE }, { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE }, { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE }, { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE }, { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE }, { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE }, { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE }, { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE }, { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE }, { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE }, { url: "res/font/arial.ttf", type: Laya.Loader.FONT }, ]; } function initCallback() { window["DataMgr"] = DataMgr; DataMgr.Init(); Moyu.init(getPlat(), this, () => { DataMgr.isNewDay(); PlatMgr.initConfig(); xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar; }, true); console.log('zh:开始sm init1 start'); xGame.soundMgr.init(); console.log('zh:开始sm init1 end'); xGame.uiMgr.init(); xGame.uiMgr.clearTempData(); xGame.uiMgr.bindFUI(fguiRes.loading); xGame.uiMgr.Show(UILoading); } function loadSubRes(callback) { var tab = ["asset", "res", "spine"]; let subDone = 0; for (var i = 0; i < tab.length; i++) { let sub = tab[i]; Moyu.loadSubRes(sub, (pro) => { callback && callback(pro, false); }).then(() => { subDone++; if (subDone >= tab.length) callback && callback(1, true); }); } } function enterGame() { xGame.cfgMgr.init(); xGame.soundMgr.onSetting(DataMgr.userData.sound); Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration); xGame.uiMgr.Hide(UILoading); fgui.UIPackage.removePackage(fguiRes.loading); xGame.uiMgr.bindFUI(fguiRes.game); xGame.uiMgr.Show(UIMain$1); if (DataMgr.getNewUser()) Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() }); } function getPlat() { let cfg = new MoyuCfg(); cfg.plat = MoyuPlat.web; cfg.myId = 180; cfg.myKey = '8848a885774230a4'; cfg.version = 0; if (window.hasOwnProperty("gamebox")) { cfg.plat = MoyuPlat.f399; cfg.version = 0; } else if (window.hasOwnProperty("ks")) { cfg.plat = MoyuPlat.ks; cfg.version = 0; cfg.ads.ksVideoId = '2300002254_01'; cfg.ads.ksInsertId = '2300002254_02'; } else if (Laya.Browser.onTTMiniGame) { cfg.plat = MoyuPlat.tt; cfg.version = 0; cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01'; cfg.ads.ttInsertId = '163l1f09abb0fm5l05'; cfg.ads.ttBannerId = "349ld7libg2l5h9a3l"; } else if (Laya.Browser.onMiniGame) { cfg.plat = MoyuPlat.wx; cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c'; cfg.ads.wxInsertId = 'adunit-1c0437c20853677c'; cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01'; } else if (Laya.Browser.onQQMiniGame) { cfg.plat = MoyuPlat.qq; } else if (Laya.Browser.onQGMiniGame) { cfg.plat = MoyuPlat.op; cfg.ads.opVideoId = '455502'; cfg.ads.opBannerId = '455507'; } else if (Laya.Browser.onVVMiniGame) { cfg.plat = MoyuPlat.vv; cfg.version = 0; cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45'; cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0'; cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1'; } else if (Laya.Browser.onHWMiniGame) { cfg.plat = MoyuPlat.hw; } else if (window["mz"]) { cfg.plat = MoyuPlat.mz; } else { let cfg = window['conchConfig']; if (cfg) { var os = cfg.getOS(); if (os == "Conch-ios") { cfg.plat = MoyuPlat.ios; } else if (os == "Conch-android") { } } } return cfg; } class Main { constructor() { if (window["Laya3D"]) Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain)); else { Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]); this.initMain(); } } initMain() { Laya["Physics"] && Laya["Physics"].enable(); Laya["DebugPanel"] && Laya["DebugPanel"].enable(); Laya.stage.scaleMode = GameConfig.scaleMode; Laya.stage.screenMode = GameConfig.screenMode; Laya.stage.alignV = GameConfig.alignV; Laya.stage.alignH = GameConfig.alignH; Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson; if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true") Laya.enableDebugPanel(); if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"]) Laya["PhysicsDebugDraw"].enable(); if (GameConfig.stat) Laya.Stat.show(); Laya.alertGlobalError(true); Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION); } onVersionLoaded() { appInit(); } } new Main(); }()); //# sourceMappingURL=bundle.js.map