1
0

bundle.js 916 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905
  1. (function () {
  2. 'use strict';
  3. class GameConfig {
  4. constructor() {
  5. }
  6. static init() {
  7. var reg = Laya.ClassUtils.regClass;
  8. }
  9. }
  10. GameConfig.width = 1334;
  11. GameConfig.height = 750;
  12. GameConfig.scaleMode = "fixedheight";
  13. GameConfig.screenMode = "horizontal";
  14. GameConfig.alignV = "top";
  15. GameConfig.alignH = "left";
  16. GameConfig.startScene = "";
  17. GameConfig.sceneRoot = "";
  18. GameConfig.debug = false;
  19. GameConfig.stat = false;
  20. GameConfig.physicsDebug = false;
  21. GameConfig.exportSceneToJson = true;
  22. GameConfig.init();
  23. let fguiRes = {
  24. game: "asset/fgui/game",
  25. loading: "fgui/loading"
  26. };
  27. let ballCamp = {
  28. full: "full",
  29. flower: "flower"
  30. };
  31. let FoulType = {
  32. "timeOut": "1",
  33. "notTouch": "2",
  34. "wrongTouch": "3",
  35. "wrongHole": "4",
  36. "rootHole": "5",
  37. };
  38. let ALL_BALL_STOP = "ALL_BALL_STOP";
  39. let WAIT_SHOOT = "WAIT_SHOOT";
  40. let D3RES_LOADED = "D3RES_LOADED";
  41. let BALL_SHOOT = "BALL_SHOOT";
  42. let FIRST_BALL_HOLE = "FIRST_BALL_HOLE";
  43. let RESET_GAME = "RESET_GAME";
  44. let COIN_CHANGE = "COIN_CHANGE";
  45. let DIAMOND_CHANGE = "DIAMOND_CHANGE";
  46. let RESTART_GAME = "RESTART_GAME";
  47. let GET_USER_INFO = "GET_USER_INFO";
  48. let CHANGE_SECRETARY = "CHANGE_SECRETARY";
  49. let POWER_CHANGE = "POWER_CHANGE";
  50. let POWER_TIME = "POWER_TIME";
  51. let keyForLoginInfo = "userInfo";
  52. let baseHeadUrl = "https://mygame1.tangro.cn/headimg/";
  53. let poolKey = {
  54. inHoleEft: "inHoleEft",
  55. d3ball: "d3ball",
  56. iceEft: "iceEft",
  57. hitEft: "hitEft",
  58. fireworksEft: "fireworksEft",
  59. };
  60. var GameMode;
  61. (function (GameMode) {
  62. GameMode[GameMode["classic"] = 0] = "classic";
  63. GameMode[GameMode["bigMove"] = 1] = "bigMove";
  64. GameMode[GameMode["placeBall"] = 2] = "placeBall";
  65. })(GameMode || (GameMode = {}));
  66. var SkillType;
  67. (function (SkillType) {
  68. SkillType[SkillType["highSpace"] = 0] = "highSpace";
  69. SkillType[SkillType["breakArmy"] = 1] = "breakArmy";
  70. SkillType[SkillType["ice"] = 2] = "ice";
  71. SkillType[SkillType["fireworks"] = 3] = "fireworks";
  72. SkillType[SkillType["GuanYu"] = 4] = "GuanYu";
  73. })(SkillType || (SkillType = {}));
  74. var ClassicWordsType;
  75. (function (ClassicWordsType) {
  76. ClassicWordsType[ClassicWordsType["directShoot"] = 0] = "directShoot";
  77. ClassicWordsType[ClassicWordsType["bigPower"] = 1] = "bigPower";
  78. ClassicWordsType[ClassicWordsType["anotherShoot"] = 2] = "anotherShoot";
  79. ClassicWordsType[ClassicWordsType["perfectShow"] = 3] = "perfectShow";
  80. ClassicWordsType[ClassicWordsType["hardShoot"] = 4] = "hardShoot";
  81. })(ClassicWordsType || (ClassicWordsType = {}));
  82. var PressType;
  83. (function (PressType) {
  84. PressType[PressType["powerNode"] = 0] = "powerNode";
  85. PressType[PressType["d2Root"] = 1] = "d2Root";
  86. PressType[PressType["moveNode"] = 2] = "moveNode";
  87. PressType[PressType["rulerNode"] = 3] = "rulerNode";
  88. })(PressType || (PressType = {}));
  89. var PlaceBallType;
  90. (function (PlaceBallType) {
  91. PlaceBallType[PlaceBallType["normal"] = 0] = "normal";
  92. PlaceBallType[PlaceBallType["challenge"] = 1] = "challenge";
  93. })(PlaceBallType || (PlaceBallType = {}));
  94. var EAdType;
  95. (function (EAdType) {
  96. EAdType[EAdType["upSkill"] = 0] = "upSkill";
  97. EAdType[EAdType["addDiamond"] = 1] = "addDiamond";
  98. EAdType[EAdType["placeBallNextLevel"] = 2] = "placeBallNextLevel";
  99. EAdType[EAdType["regretBall"] = 3] = "regretBall";
  100. EAdType[EAdType["longHelpLine"] = 4] = "longHelpLine";
  101. EAdType[EAdType["addFailCoin"] = 5] = "addFailCoin";
  102. EAdType[EAdType["sign"] = 6] = "sign";
  103. EAdType[EAdType["draw"] = 7] = "draw";
  104. EAdType[EAdType["triple"] = 8] = "triple";
  105. EAdType[EAdType["randomDiamond"] = 9] = "randomDiamond";
  106. EAdType[EAdType["getPower"] = 10] = "getPower";
  107. EAdType[EAdType["box"] = 11] = "box";
  108. EAdType[EAdType["try"] = 12] = "try";
  109. EAdType[EAdType["againSign"] = 13] = "againSign";
  110. EAdType[EAdType["addCoin"] = 14] = "addCoin";
  111. })(EAdType || (EAdType = {}));
  112. var Prop;
  113. (function (Prop) {
  114. Prop[Prop["diamond"] = 1] = "diamond";
  115. Prop[Prop["coin"] = 2] = "coin";
  116. Prop[Prop["gan1"] = 3] = "gan1";
  117. Prop[Prop["gan2"] = 4] = "gan2";
  118. Prop[Prop["gan3"] = 5] = "gan3";
  119. Prop[Prop["gan4"] = 6] = "gan4";
  120. })(Prop || (Prop = {}));
  121. var TipsType;
  122. (function (TipsType) {
  123. TipsType[TipsType["exitGame"] = 0] = "exitGame";
  124. TipsType[TipsType["foul"] = 1] = "foul";
  125. })(TipsType || (TipsType = {}));
  126. class AwardType {
  127. constructor(type, num) {
  128. this.type = type;
  129. this.num = num;
  130. }
  131. }
  132. var define = /*#__PURE__*/Object.freeze({
  133. fguiRes: fguiRes,
  134. ballCamp: ballCamp,
  135. FoulType: FoulType,
  136. ALL_BALL_STOP: ALL_BALL_STOP,
  137. WAIT_SHOOT: WAIT_SHOOT,
  138. D3RES_LOADED: D3RES_LOADED,
  139. BALL_SHOOT: BALL_SHOOT,
  140. FIRST_BALL_HOLE: FIRST_BALL_HOLE,
  141. RESET_GAME: RESET_GAME,
  142. COIN_CHANGE: COIN_CHANGE,
  143. DIAMOND_CHANGE: DIAMOND_CHANGE,
  144. RESTART_GAME: RESTART_GAME,
  145. GET_USER_INFO: GET_USER_INFO,
  146. CHANGE_SECRETARY: CHANGE_SECRETARY,
  147. POWER_CHANGE: POWER_CHANGE,
  148. POWER_TIME: POWER_TIME,
  149. keyForLoginInfo: keyForLoginInfo,
  150. baseHeadUrl: baseHeadUrl,
  151. poolKey: poolKey,
  152. get GameMode () { return GameMode; },
  153. get SkillType () { return SkillType; },
  154. get ClassicWordsType () { return ClassicWordsType; },
  155. get PressType () { return PressType; },
  156. get PlaceBallType () { return PlaceBallType; },
  157. get EAdType () { return EAdType; },
  158. get Prop () { return Prop; },
  159. get TipsType () { return TipsType; },
  160. AwardType: AwardType
  161. });
  162. class CContext {
  163. constructor() {
  164. this.winSize = { width: 0, height: 0 };
  165. this.notchHeight = 0;
  166. this.bannerHeight = 0;
  167. }
  168. init(resList, callback) {
  169. this.winSize = { width: Laya.Browser.clientWidth, height: Laya.Browser.clientHeight };
  170. this.notchHeight = this.getNotchHeight();
  171. this.bannerHeight = this.getBannerHeight();
  172. Laya.loader.load(resList, Laya.Handler.create(this, () => {
  173. callback && callback();
  174. }));
  175. }
  176. getNotchHeight() {
  177. let notchHeight = 50;
  178. if (Laya.Browser.onMiniGame) {
  179. let deviceInfo = wx.getSystemInfoSync();
  180. if (Laya.Browser.onIOS) {
  181. if (deviceInfo.model.search('iPhone X') != -1) {
  182. notchHeight = deviceInfo.statusBarHeight - 10;
  183. }
  184. else {
  185. if ((deviceInfo.screenWidth == 375 && deviceInfo.screenHeight == 812) ||
  186. (deviceInfo.screenWidth == 414 && deviceInfo.screenHeight == 896)) {
  187. notchHeight = deviceInfo.statusBarHeight - 10;
  188. }
  189. }
  190. }
  191. else if (Laya.Browser.onAndroid) {
  192. if (deviceInfo.screenWidth / deviceInfo.screenHeight < (9 / 16)) {
  193. notchHeight = deviceInfo.statusBarHeight;
  194. }
  195. }
  196. }
  197. return notchHeight;
  198. }
  199. getBannerHeight() {
  200. return 0;
  201. }
  202. }
  203. let context = new CContext();
  204. var Handler = Laya.Handler;
  205. var Tween = Laya.Tween;
  206. function playClickEffect(btn) {
  207. if (!btn)
  208. return;
  209. Laya.Tween.to(btn, { scaleX: 1.05, scaleY: 1.05 }, 20, null, Laya.Handler.create(null, () => {
  210. if (!btn)
  211. return;
  212. Laya.Tween.to(btn, { scaleX: 0.96, scaleY: 0.96 }, 30, null, Laya.Handler.create(null, () => {
  213. if (!btn)
  214. return;
  215. Laya.Tween.to(btn, { scaleX: 1, scaleY: 1 }, 20, null, null, 0, true);
  216. }), 0, true);
  217. }), 0, true);
  218. }
  219. function getNumList(strList) {
  220. let dataList = [];
  221. if (strList) {
  222. let list = strList;
  223. let array = list.split(',');
  224. for (var v in array) {
  225. dataList.push(Number(array[v]));
  226. }
  227. }
  228. return dataList;
  229. }
  230. function getStrList(strList) {
  231. let dataList = [];
  232. if (strList) {
  233. let list = strList;
  234. let array = list.split('|');
  235. for (var v in array) {
  236. dataList.push(String(array[v]));
  237. }
  238. }
  239. return dataList;
  240. }
  241. function getRandStr(len) {
  242. 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'];
  243. let str = "";
  244. for (let i = 0; i < len; i++) {
  245. let rand = random(0, list.length);
  246. str += list[rand];
  247. }
  248. return str;
  249. }
  250. function getUserId() {
  251. let str = getRandStr(12) + Laya.timer.currTimer % 1000000;
  252. return str;
  253. }
  254. function formatPos(pos, len = 2) {
  255. let v = Math.pow(10, len);
  256. pos.x = Math.floor(pos.x * v) / v;
  257. pos.y = Math.floor(pos.y * v) / v;
  258. if (pos.z)
  259. pos.z = Math.floor(pos.z * v) / v;
  260. return pos;
  261. }
  262. function setPosInt(pos) {
  263. pos.x = pos.x > 0 ? Math.ceil(pos.x) : Math.floor(pos.x);
  264. pos.y = pos.y > 0 ? Math.ceil(pos.y) : Math.floor(pos.y);
  265. pos.z = pos.z > 0 ? Math.ceil(pos.z) : Math.floor(pos.z);
  266. return pos;
  267. }
  268. function random(min, max) {
  269. var rang = max - min;
  270. var rand = Math.random() * rang;
  271. return Math.floor(rand) + min;
  272. }
  273. function randomList(list, num) {
  274. if (list.length <= num)
  275. return list;
  276. let arry = [];
  277. list.forEach(item => {
  278. arry.push(item);
  279. });
  280. let nums = [];
  281. for (let i = 0; i < num; i++) {
  282. let rand = random(0, arry.length);
  283. let v = arry[rand];
  284. nums.push(v);
  285. arry.splice(rand, 1);
  286. }
  287. return nums;
  288. }
  289. function worldToScreen(camera, point, pos) {
  290. camera.viewport.project(point, camera.projectionViewMatrix, pos);
  291. pos.x = pos.x / Laya.stage.clientScaleX;
  292. pos.y = pos.y / Laya.stage.clientScaleY;
  293. }
  294. function getStringLenght(str) {
  295. return str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  296. }
  297. function reviseString(str, len) {
  298. let ld = str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  299. if (ld > len) {
  300. let sl = Math.floor(len / 2);
  301. let rs = str.substring(0, sl);
  302. let d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  303. while (d + 2 < len) {
  304. sl++;
  305. rs = str.substring(0, sl);
  306. d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  307. }
  308. return rs + "...";
  309. }
  310. return str;
  311. }
  312. function getCoinString(coin) {
  313. if (coin < 10000)
  314. return coin.toString();
  315. else if (coin < 1000000) {
  316. let vh = Math.ceil(coin / 100);
  317. return (vh / 10) + "k";
  318. }
  319. else if (coin < 1000000000) {
  320. var vh = Math.ceil(coin / 100000);
  321. return (vh / 10) + "m";
  322. }
  323. else if (coin < 1000000000000) {
  324. var vh = Math.ceil(coin / 100000000);
  325. return (vh / 10) + "b";
  326. }
  327. else if (coin < 1000000000000000) {
  328. var vh = Math.ceil(coin / 100000000000);
  329. return (vh / 10) + "t";
  330. }
  331. }
  332. function getV3Dest(pos, dir, dis, dest) {
  333. dir.x *= dis;
  334. dir.y *= dis;
  335. dir.z *= dis;
  336. Laya.Vector3.add(pos, dir, dest);
  337. return dest;
  338. }
  339. function getV2Dest(x1, y1, dir, dis, dest) {
  340. dest.x = x1 + dir.x * dis;
  341. dest.y = y1 + dir.y * dis;
  342. return dest;
  343. }
  344. function getV2Dir(x1, y1, x2, y2, dir) {
  345. dir.x = x2 - x1;
  346. dir.y = y2 - y1;
  347. Laya.Vector2.normalize(dir, dir);
  348. return dir;
  349. }
  350. function getV3Dir(p1, p2, dir) {
  351. Laya.Vector3.subtract(p1, p2, dir);
  352. Laya.Vector3.normalize(dir, dir);
  353. return dir;
  354. }
  355. function copyPos(ip, op) {
  356. op.x = ip.x;
  357. op.y = ip.y;
  358. if (ip.z)
  359. op.z = ip.z;
  360. return op;
  361. }
  362. function getScreenImg() {
  363. let gl = Laya.WebGLContext.mainContext;
  364. let pixels = new Uint8Array(gl.drawingBufferWidth * gl.drawingBufferHeight * 4);
  365. gl.readPixels(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
  366. let w = gl.drawingBufferWidth;
  367. let h = gl.drawingBufferHeight;
  368. let texture2d = new Laya.Texture2D(w, h, Laya.TextureFormat.R8G8B8A8, false, false);
  369. texture2d.setPixels(pixels);
  370. return new Laya.Texture(texture2d);
  371. }
  372. function playMoveByPositions(sp, positions, v, completeCallback) {
  373. let p;
  374. let play = () => {
  375. if (positions.length == 0) {
  376. completeCallback();
  377. return;
  378. }
  379. p = positions[0];
  380. positions.splice(0, 1);
  381. 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, () => {
  382. play();
  383. }));
  384. };
  385. play();
  386. }
  387. function setStarPos(node, num, max) {
  388. for (let i = 1; i <= 5; i++) {
  389. let img = node.getChildAt(i - 1);
  390. img.width = img.height = 30;
  391. img.pivotX = img.pivotY = 0.5;
  392. img.gray = i > num;
  393. img.visible = i <= max;
  394. if (max == 3) {
  395. img.x = node.width / 2 + (i - 2) * 30 - 15;
  396. img.y = node.height - 40;
  397. if (i == 2)
  398. img.y = node.height - 30;
  399. }
  400. else if (max == 5) {
  401. let ly = Math.abs(i - 3);
  402. img.x = node.width / 2 + (i - 3) * 20 - 15;
  403. img.y = node.height - ly * 8 - 30;
  404. }
  405. }
  406. }
  407. function playLoopAnimRotate(sp, time, clockwise = true) {
  408. let rotation;
  409. sp.rotation = sp.rotation % 360;
  410. if (clockwise) {
  411. rotation = -360;
  412. }
  413. else {
  414. rotation = 360;
  415. }
  416. Tween.to(sp, { rotation: rotation }, time, null, Handler.create(this, () => {
  417. this.playLoopAnimRotate(sp, time, clockwise);
  418. }));
  419. }
  420. function playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, isBig = true) {
  421. let x, y;
  422. if (isBig) {
  423. x = valueXMin;
  424. y = valueYMin;
  425. }
  426. else {
  427. x = valueXMax;
  428. y = valueYMax;
  429. }
  430. Tween.to(sp, { x: x, y: y }, time, null, Handler.create(this, () => {
  431. this.playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, !isBig);
  432. }));
  433. }
  434. function playLoopAnimScale(sp, valueMin, valueMax, time, isBig = true) {
  435. let scale;
  436. if (isBig) {
  437. scale = valueMin;
  438. }
  439. else {
  440. scale = valueMax;
  441. }
  442. Tween.to(sp, { scaleX: scale, scaleY: scale }, time, null, Handler.create(this, () => {
  443. playLoopAnimScale(sp, valueMin, valueMax, time, !isBig);
  444. }));
  445. }
  446. function playLoopAnimRotation(sp, valueMin, valueMax, time, isBig = true, count = 8) {
  447. let value;
  448. if (isBig) {
  449. value = valueMin;
  450. }
  451. else {
  452. value = valueMax;
  453. }
  454. if (count) {
  455. count--;
  456. Tween.to(sp, { rotation: value }, time, null, Handler.create(this, () => {
  457. playLoopAnimRotation(sp, valueMin, valueMax, time, !isBig, count);
  458. }));
  459. }
  460. else {
  461. sp.rotation = 0;
  462. }
  463. }
  464. function inRect(rect, p) {
  465. if (p.x >= rect.x && p.x <= rect.x + rect.w) {
  466. if (p.y >= rect.y && p.y <= rect.y + rect.h) {
  467. return true;
  468. }
  469. }
  470. return false;
  471. }
  472. function getNumberK(number) {
  473. if (number < 1000) {
  474. return number.toString();
  475. }
  476. else {
  477. return (number / 1000).toFixed(1) + "k";
  478. }
  479. }
  480. function pointInsideCircle(point, circle, r) {
  481. if (r === 0)
  482. return false;
  483. var dx = circle.x - point.x;
  484. var dy = circle.y - point.y;
  485. return dx * dx + dy * dy <= r * r;
  486. }
  487. function formatString(str, data) {
  488. if (!str || data == undefined) {
  489. return str;
  490. }
  491. if (typeof data === "object") {
  492. for (var key in data) {
  493. if (data.hasOwnProperty(key)) {
  494. str = str.replace(new RegExp("\{" + key + "\}", "g"), data[key]);
  495. }
  496. }
  497. }
  498. else {
  499. var args = arguments, reg = new RegExp("\{([0-" + (args.length - 1) + "])\}", "g");
  500. return str.replace(reg, function (match, index) {
  501. return args[index - (-1)];
  502. });
  503. }
  504. return str;
  505. }
  506. function getIntersection(a, b) {
  507. let t = [];
  508. for (var i = 0; i < a.length; i++) {
  509. for (var j = 0; j < b.length; j++) {
  510. if (a[i] == b[j]) {
  511. t.push(a[i]);
  512. }
  513. }
  514. }
  515. return t;
  516. }
  517. function getComplement(a, b) {
  518. let t = [];
  519. let count = false;
  520. for (var i = 0; i < a.length; i++) {
  521. count = false;
  522. for (var j = 0; j < b.length; j++) {
  523. if (a[i] == b[j]) {
  524. count = true;
  525. break;
  526. }
  527. }
  528. if (!count) {
  529. t.push(a[i]);
  530. }
  531. }
  532. return t;
  533. }
  534. function geSpriteStageRect(sp) {
  535. var point = sp.localToGlobal(Laya.Point.TEMP.setTo(0, 0));
  536. let rect = {
  537. x: point.x,
  538. y: point.y,
  539. width: sp.width * sp.globalScaleX,
  540. height: sp.height * sp.globalScaleY
  541. };
  542. return rect;
  543. }
  544. function touchButton(button) {
  545. let event = new Laya.Event();
  546. button.event(Laya.Event.CLICK, event.setTo(Laya.Event.CLICK, button, button));
  547. }
  548. function setColor(sprite, r, g, b) {
  549. var redMat = [
  550. r / 255, 0, 0, 0, 0,
  551. g / 255, 0, 0, 0, 0,
  552. b / 255, 0, 0, 0, 0,
  553. 0, 0, 0, 1, 0,
  554. ];
  555. var filter = new Laya.ColorFilter(redMat);
  556. sprite.filters = [filter];
  557. }
  558. function clone(obj, newobj = {}) {
  559. for (var attr in obj) {
  560. if (typeof obj[attr] == "object") {
  561. newobj[attr] = clone(obj[attr], newobj[attr]);
  562. }
  563. else {
  564. newobj[attr] = obj[attr];
  565. }
  566. }
  567. return newobj;
  568. }
  569. function _ms(arr, compare, begin, end) {
  570. const size = end - begin;
  571. if (size <= 1) {
  572. return;
  573. }
  574. const middle = (end + begin) >> 1;
  575. _ms(arr, compare, begin, middle);
  576. _ms(arr, compare, middle, end);
  577. if (compare(arr[middle - 1], arr[middle]) <= 0) {
  578. return;
  579. }
  580. const merged = [];
  581. let leftIndex = begin, rightIndex = middle;
  582. while (merged.length < size) {
  583. if (leftIndex === middle) {
  584. merged.push(arr[rightIndex++]);
  585. }
  586. else if (rightIndex === end) {
  587. merged.push(arr[leftIndex++]);
  588. }
  589. else {
  590. const c = compare(arr[leftIndex], arr[rightIndex]);
  591. if (c <= 0) {
  592. merged.push(arr[leftIndex++]);
  593. }
  594. else {
  595. merged.push(arr[rightIndex++]);
  596. }
  597. }
  598. }
  599. arr.splice(begin, size, ...merged);
  600. }
  601. function sort(arr, compare) {
  602. if (!Array.isArray(arr)) {
  603. throw new Error('sort的参数必须为数组');
  604. }
  605. _ms(arr, compare, 0, arr.length);
  606. return arr;
  607. }
  608. function getLanguage(id) {
  609. }
  610. function getLanguageByTip(id) {
  611. }
  612. function toWeights(array) {
  613. let max = 0;
  614. for (var i = 0; i < array.length; i++) {
  615. max = max + array[i];
  616. if (array[i] == 0) {
  617. array[i] = 0;
  618. }
  619. else {
  620. array[i] = max;
  621. }
  622. }
  623. return array;
  624. }
  625. function unique(array) {
  626. var n = {}, r = [], len = array.length, val, type;
  627. for (var i = 0; i < array.length; i++) {
  628. val = array[i];
  629. type = typeof val;
  630. if (!n[val]) {
  631. n[val] = [type];
  632. r.push(val);
  633. }
  634. else if (n[val].indexOf(type) < 0) {
  635. n[val].push(type);
  636. r.push(val);
  637. }
  638. }
  639. return r;
  640. }
  641. function unique1(array) {
  642. var r = [];
  643. for (var i = 0, l = array.length; i < l; i++) {
  644. for (var j = i + 1; j < l; j++)
  645. if (array[i] == array[j])
  646. j == ++i;
  647. r.push(array[i]);
  648. }
  649. return r;
  650. }
  651. function getDistance(x1, y1, x2, y2) {
  652. return Math.pow(((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)), 0.5);
  653. }
  654. function getV2Dis(pos1, pos2) {
  655. return Math.pow(((pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y)), 0.5);
  656. }
  657. function getV2SqDis(pos1, pos2) {
  658. return (pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y);
  659. }
  660. function getDis(x1, y1, x2, y2) {
  661. return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
  662. }
  663. function getDeltaxy(x1, y1, x2, y2) {
  664. return Math.abs(x1 - x2) + Math.abs(y1 - y2);
  665. }
  666. function getSymbolNumber(num) {
  667. if (num > 0) {
  668. return "+" + num;
  669. }
  670. else if (num < 0) {
  671. return num.toString();
  672. }
  673. return num.toString();
  674. }
  675. function fixNumber(num, length) {
  676. return ('' + num).length < length ? ((new Array(length + 1)).join('0') + num).slice(-length) : '' + num;
  677. }
  678. function toThousands(num) {
  679. return num.replace(/(\d)(?=(?:\d{3})+$)/g, '$1,');
  680. }
  681. let moneyUnitStr = ["", "K", "M", "B", "T", "AK", "AM", "AB", "AT", "BK", "BM", "BB", "BT", "CK", "CM", "CB", "CT"];
  682. function fmtMoney(money) {
  683. money = toThousands(money.replace(/^0+/, ''));
  684. if (money.length == 0) {
  685. money = "0";
  686. }
  687. let unit = 0;
  688. for (var i = 0; i < money.length; i++) {
  689. if (money.charAt(i) == ",") {
  690. unit++;
  691. }
  692. }
  693. if (unit == 0) {
  694. return money;
  695. }
  696. else {
  697. let idx = money.indexOf(",");
  698. if (idx) {
  699. money = money.slice(0, idx + 2) + moneyUnitStr[unit];
  700. }
  701. return money.replace(",", ".");
  702. }
  703. }
  704. function flatten(arr) {
  705. while (arr.some(item => Array.isArray(item))) {
  706. arr = [].concat(...arr);
  707. }
  708. return arr;
  709. }
  710. function getDistanceByPoint(p1, p2) {
  711. return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
  712. }
  713. function getAngleByPoint(p1, p2) {
  714. return Math.atan2((p2.y - p1.y), (p2.x - p1.x)) * (180 / Math.PI);
  715. }
  716. function toIntByArray(array) {
  717. for (var index = 0; index < array.length; index++) {
  718. array[index] = parseInt(array[index]);
  719. }
  720. return array;
  721. }
  722. function getAngle0To360(angle) {
  723. while (angle < 0) {
  724. angle += 360;
  725. }
  726. while (angle >= 360) {
  727. angle -= 360;
  728. }
  729. return angle;
  730. }
  731. function toAngle(radian) {
  732. return radian * 180 / Math.PI;
  733. }
  734. function toRadian(angle) {
  735. return angle * Math.PI / 180;
  736. }
  737. function getArrayValueRandom(array) {
  738. return array[random(0, array.length - 1)];
  739. }
  740. function promptByTip(tipId, color = "#FFFFFF", strokeColor = null, time = 1000, fontSize = 35, opacity = 1) {
  741. }
  742. function promptByErrorCode(id, color = "#FFFFFF", strokeColor = "#FF8B00", time = 1000, fontSize = 35, opacity = 1) {
  743. }
  744. function fmtTimeMMSS(time) {
  745. if (time < 0) {
  746. time = 0;
  747. }
  748. else
  749. time = Math.floor(time);
  750. return fixNumber(Math.floor(time / 60), 2) + ":" + fixNumber(time % 60, 2);
  751. }
  752. function fmtTimeMS(time) {
  753. if (time < 0) {
  754. time = 0;
  755. }
  756. return fixNumber(Math.floor(time / 60), 2) + "m" + fixNumber(time % 60, 2) + "s";
  757. }
  758. function fmtTimeHHMM(time) {
  759. if (time < 0) {
  760. time = 0;
  761. }
  762. time = Math.floor(time / 1000);
  763. return fixNumber(Math.floor(time / 3600), 2) + ":" + fixNumber(Math.floor((time % 3600) / 60), 2) + ":" + fixNumber(Math.floor(time % 60), 2);
  764. }
  765. let severTime = 0;
  766. function getServerTime() {
  767. return new Date(new Date().getTime() - severTime);
  768. }
  769. function setServerTime(data) {
  770. severTime = (new Date().getTime() - data);
  771. }
  772. var tools = /*#__PURE__*/Object.freeze({
  773. playClickEffect: playClickEffect,
  774. getNumList: getNumList,
  775. getStrList: getStrList,
  776. getRandStr: getRandStr,
  777. getUserId: getUserId,
  778. formatPos: formatPos,
  779. setPosInt: setPosInt,
  780. random: random,
  781. randomList: randomList,
  782. worldToScreen: worldToScreen,
  783. getStringLenght: getStringLenght,
  784. reviseString: reviseString,
  785. getCoinString: getCoinString,
  786. getV3Dest: getV3Dest,
  787. getV2Dest: getV2Dest,
  788. getV2Dir: getV2Dir,
  789. getV3Dir: getV3Dir,
  790. copyPos: copyPos,
  791. getScreenImg: getScreenImg,
  792. playMoveByPositions: playMoveByPositions,
  793. setStarPos: setStarPos,
  794. playLoopAnimRotate: playLoopAnimRotate,
  795. playLoopAnimPosition: playLoopAnimPosition,
  796. playLoopAnimScale: playLoopAnimScale,
  797. playLoopAnimRotation: playLoopAnimRotation,
  798. inRect: inRect,
  799. getNumberK: getNumberK,
  800. pointInsideCircle: pointInsideCircle,
  801. formatString: formatString,
  802. getIntersection: getIntersection,
  803. getComplement: getComplement,
  804. geSpriteStageRect: geSpriteStageRect,
  805. touchButton: touchButton,
  806. setColor: setColor,
  807. clone: clone,
  808. sort: sort,
  809. getLanguage: getLanguage,
  810. getLanguageByTip: getLanguageByTip,
  811. toWeights: toWeights,
  812. unique: unique,
  813. unique1: unique1,
  814. getDistance: getDistance,
  815. getV2Dis: getV2Dis,
  816. getV2SqDis: getV2SqDis,
  817. getDis: getDis,
  818. getDeltaxy: getDeltaxy,
  819. getSymbolNumber: getSymbolNumber,
  820. fixNumber: fixNumber,
  821. toThousands: toThousands,
  822. fmtMoney: fmtMoney,
  823. flatten: flatten,
  824. getDistanceByPoint: getDistanceByPoint,
  825. getAngleByPoint: getAngleByPoint,
  826. toIntByArray: toIntByArray,
  827. getAngle0To360: getAngle0To360,
  828. toAngle: toAngle,
  829. toRadian: toRadian,
  830. getArrayValueRandom: getArrayValueRandom,
  831. promptByTip: promptByTip,
  832. promptByErrorCode: promptByErrorCode,
  833. fmtTimeMMSS: fmtTimeMMSS,
  834. fmtTimeMS: fmtTimeMS,
  835. fmtTimeHHMM: fmtTimeHHMM,
  836. getServerTime: getServerTime,
  837. setServerTime: setServerTime
  838. });
  839. class HttpMgr {
  840. constructor() {
  841. HttpMgr._instance = this;
  842. }
  843. static getInstance() {
  844. if (!this._instance) {
  845. this._instance = new HttpMgr();
  846. }
  847. return this._instance;
  848. }
  849. sendPost(url, data, call) {
  850. let httpObj = new Laya.HttpRequest();
  851. httpObj.http.timeout = 5000;
  852. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  853. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  854. httpObj.send(url, data, 'post', 'text', ["Content-Type", "application/json; charset=UTF-8"]);
  855. function errorHandler(error) {
  856. console.log("errorHandler:" + error);
  857. alert("Please check your network connection.");
  858. }
  859. function completeHandler(data) {
  860. if (data && data.length > 0) {
  861. let jsonData = JSON.parse(data);
  862. if (call)
  863. call(jsonData);
  864. }
  865. }
  866. }
  867. sendPost2025(reqUrl, data, call) {
  868. let isDev = false;
  869. let urlTop = "https://api.kessongame.site/";
  870. let urlMid = urlTop + "prod-api/api/game/";
  871. if (isDev) {
  872. urlTop = "http://192.168.1.13:8090/";
  873. urlMid = urlTop + "api/game/";
  874. }
  875. let url = urlMid + reqUrl;
  876. if (reqUrl == "registerForApp" || reqUrl == "loginForApp") {
  877. if (isDev) {
  878. url = urlTop + reqUrl;
  879. }
  880. else {
  881. url = urlTop + "prod-api/" + reqUrl;
  882. }
  883. }
  884. let httpObj = new Laya.HttpRequest();
  885. httpObj.http.timeout = 5000;
  886. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  887. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  888. httpObj.send(url, data, 'post', 'text', ["Content-Type", "application/json; charset=UTF-8"]);
  889. function errorHandler(error) {
  890. if (call) {
  891. call("{'msg':'Network exception','code':500}");
  892. }
  893. else {
  894. alert("Tip:Please check your network connection.");
  895. }
  896. }
  897. function completeHandler(data) {
  898. if (data && data.length > 0) {
  899. let jsonData = JSON.parse(data);
  900. if (call)
  901. call(jsonData);
  902. }
  903. }
  904. }
  905. sendGet(url, call) {
  906. let httpObj = new Laya.HttpRequest();
  907. httpObj.http.timeout = 5000;
  908. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  909. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  910. httpObj.send(url, '', 'get');
  911. function errorHandler(error) {
  912. console.log("errorHandler:" + error);
  913. }
  914. function completeHandler(data) {
  915. if (data && data.length > 0) {
  916. if (call)
  917. call(data);
  918. }
  919. }
  920. }
  921. }
  922. HttpMgr._instance = null;
  923. class LightShader extends Laya.Sprite {
  924. constructor() {
  925. super();
  926. this._time = 0;
  927. this._sin = 0;
  928. this.initShader();
  929. }
  930. initShader() {
  931. var vs = `
  932. #define FSHIGHPRECISION
  933. attribute vec4 posuv;
  934. uniform vec2 size;
  935. varying vec4 v_texcoord;
  936. void main() {
  937. vec4 pos = vec4(posuv.xy,0.,1.);
  938. vec4 pos1 =vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,0.,1.0);
  939. gl_Position=pos1;
  940. v_texcoord.xy = posuv.xy;
  941. }
  942. `;
  943. var ps = `
  944. #define FSHIGHPRECISION
  945. precision highp float;
  946. varying vec4 v_texcoord;
  947. uniform vec2 size;
  948. uniform sampler2D texture;
  949. uniform float u_Time;
  950. void main() {
  951. vec4 color= texture2D(texture, v_texcoord.xy);
  952. float width = 0.2;
  953. float start = u_Time;
  954. float offset = 1.0;
  955. vec2 myuv = vec2(v_texcoord.x/size.x,v_texcoord.y/size.y);
  956. if( myuv.x < (start - offset * myuv.y) && myuv.x > (start - offset * myuv.y - width))
  957. {
  958. color.r=1.1;
  959. color.g=1.1;
  960. color.b=1.1;
  961. gl_FragColor = color;
  962. } else {
  963. gl_FragColor = color;
  964. }
  965. }
  966. `;
  967. this.shaderValue = new Laya.Value2D(LightShader.DissolveSurfaceSaveName, LightShader.DissolveSurfaceSaveName);
  968. this.customRenderEnable = true;
  969. this.shaderValue.shader = new Laya.Shader2X(vs, ps, LightShader.DissolveSurfaceSaveName);
  970. }
  971. customRender(context, x, y) {
  972. this.onUpdate();
  973. if (!this.texture)
  974. return;
  975. let xx = x - this.pivotX;
  976. let yy = y - this.pivotY;
  977. context.drawTarget(this.texture, xx, yy, this.width, this.height, null, this.shaderValue);
  978. }
  979. onUpdate() {
  980. this._time += 2 * Laya.timer.delta * 0.001;
  981. this._sin = Math.sin(this._time);
  982. if (this._sin > 0.99) {
  983. this._sin = 0;
  984. this._time = 0;
  985. }
  986. this.shaderValue['u_Time'] = this._sin;
  987. }
  988. }
  989. LightShader.DissolveSurfaceSaveName = 9997;
  990. class UIBase extends fairygui.Window {
  991. constructor() {
  992. super();
  993. this.isEject = true;
  994. this.isHide = true;
  995. this.showbanner = true;
  996. this.className = "";
  997. this.isMuti = false;
  998. this.showbanner = false;
  999. this.onConstructor();
  1000. }
  1001. checkActive(show) {
  1002. }
  1003. getUIName() {
  1004. return UIBase.uiName;
  1005. }
  1006. onConstructor() {
  1007. }
  1008. onInit() {
  1009. if (!!this.contentPane) {
  1010. this.contentPane.setSize(fairygui.GRoot.inst.width, fairygui.GRoot.inst.height);
  1011. }
  1012. this.setPivot(0.5, 0.5, false);
  1013. }
  1014. doShowAnimation() {
  1015. if (!this.isEject)
  1016. return;
  1017. super.doShowAnimation();
  1018. Laya.Tween.clearTween(this);
  1019. this.scaleX = this.scaleY = 0.8;
  1020. let tweenFunc1 = (func) => {
  1021. Laya.Tween.to(this, { scaleX: 1.1, scaleY: 1.1 }, 100, Laya.Ease.linearIn, Laya.Handler.create(this, func));
  1022. };
  1023. let tweenFunc2 = (func) => {
  1024. Laya.Tween.to(this, { scaleX: 1, scaleY: 1 }, 60, Laya.Ease.linearOut, Laya.Handler.create(this, this.refresh));
  1025. };
  1026. tweenFunc1(tweenFunc2);
  1027. }
  1028. show(...args) {
  1029. super.show();
  1030. this._openParam = args;
  1031. this.isHide = false;
  1032. xGame.uiMgr.checkUIState();
  1033. }
  1034. moveBannerButton() {
  1035. }
  1036. showBannerButton() {
  1037. this.bannerButton.visible = true;
  1038. Laya.Tween.to(this.bannerButton, { alpha: 1 }, 500, Laya.Ease.linearOut, Laya.Handler.create(this, () => {
  1039. this.bannerButton.touchable = true;
  1040. }));
  1041. }
  1042. hide() {
  1043. super.hide();
  1044. this.isHide = true;
  1045. xGame.uiMgr.checkUIState();
  1046. }
  1047. Dispose() {
  1048. super.dispose();
  1049. }
  1050. myUpdate(delay) {
  1051. }
  1052. refresh() { }
  1053. addUIClick(obj, func, arr = null) {
  1054. obj.onClick(this, func, arr);
  1055. obj.onClick(this, this.playBtnSound);
  1056. }
  1057. offUIClick(obj, func) {
  1058. obj.offClick(this, func);
  1059. }
  1060. playBtnSound() {
  1061. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  1062. }
  1063. }
  1064. UIBase.lastShowBanner = 0;
  1065. UIBase.showBannerNum = 0;
  1066. UIBase.uiName = "";
  1067. class ui_UIDraw extends fgui.GComponent {
  1068. static createInstance() {
  1069. return (fgui.UIPackage.createObject("game", "UIDraw"));
  1070. }
  1071. onConstruct() {
  1072. this.n1 = (this.getChild("n1"));
  1073. this.extraNode = (this.getChild("extraNode"));
  1074. this.myNode = (this.getChild("myNode"));
  1075. this.closeNode = (this.getChild("closeNode"));
  1076. this.moneyNode = (this.getChild("moneyNode"));
  1077. this.n38 = (this.getChild("n38"));
  1078. this.secretary = (this.getChild("secretary"));
  1079. this.drawBtn = (this.getChild("drawBtn"));
  1080. this.talkNode = (this.getChild("talkNode"));
  1081. this.t0 = this.getTransition("t0");
  1082. }
  1083. }
  1084. ui_UIDraw.URL = "ui://isxx5ak7wcn5v4ke";
  1085. class ui_UIBox extends fgui.GComponent {
  1086. static createInstance() {
  1087. return (fgui.UIPackage.createObject("game", "UIBox"));
  1088. }
  1089. onConstruct() {
  1090. this.n0 = (this.getChild("n0"));
  1091. this.n12 = (this.getChild("n12"));
  1092. this.n1 = (this.getChild("n1"));
  1093. this.n2 = (this.getChild("n2"));
  1094. this.bar = (this.getChild("bar"));
  1095. this.closeBtn = (this.getChild("closeBtn"));
  1096. this.openBtn = (this.getChild("openBtn"));
  1097. this.t0 = this.getTransition("t0");
  1098. this.t1 = this.getTransition("t1");
  1099. }
  1100. }
  1101. ui_UIBox.URL = "ui://isxx5ak7erstv4nm";
  1102. class GlobalManager {
  1103. constructor() {
  1104. }
  1105. registerMethod(name, method) {
  1106. console.log('zh: 注册全局方法', name);
  1107. this[name] = method;
  1108. }
  1109. callMethod(name, ...args) {
  1110. console.log('zh: 调用全局方法', name);
  1111. if (this[name]) {
  1112. return this[name](...args);
  1113. }
  1114. else {
  1115. console.error(`zh: 全局方法 Method ${name} not found`);
  1116. }
  1117. }
  1118. }
  1119. GlobalManager.instance = new GlobalManager();
  1120. class JSBridgeUtils {
  1121. constructor() { }
  1122. static get instance() {
  1123. if (!this._instance) {
  1124. this._instance = new JSBridgeUtils();
  1125. }
  1126. return this._instance;
  1127. }
  1128. initBridge() {
  1129. if (!Laya.Browser.onAndroid) {
  1130. console.log('zh:非android dev');
  1131. return;
  1132. }
  1133. let cfg = window['conchConfig'];
  1134. if (cfg) {
  1135. var os = cfg.getOS();
  1136. if (os == "Conch-android") {
  1137. this.bridge = window['PlatformClass'].createClass("demo.JSBridge");
  1138. if (this.bridge) {
  1139. return true;
  1140. }
  1141. else {
  1142. return false;
  1143. }
  1144. }
  1145. else {
  1146. return false;
  1147. }
  1148. }
  1149. else {
  1150. return false;
  1151. }
  1152. }
  1153. testAd1() {
  1154. if (!Laya.Browser.onAndroid) {
  1155. console.log('zh:非android dev');
  1156. return;
  1157. }
  1158. if (!this.initBridge()) {
  1159. return;
  1160. }
  1161. let rs = this.bridge.call("testString", "hello");
  1162. console.log('zh:testString rs=' + rs);
  1163. }
  1164. testAdCallBack() {
  1165. if (!this.initBridge()) {
  1166. return;
  1167. }
  1168. console.log("zh:testAdCallBack start");
  1169. const defaultObj = { code: 200, msg: "req update Ui" };
  1170. const reqObj = { code: 300, msg: "hello java ui" };
  1171. this.bridge.callWithBack((rsStr) => {
  1172. const rsObj = JSON.parse(rsStr);
  1173. console.log(`zh:testAsyncCallback js收到java返回值=${rsStr}`);
  1174. }, "testAsyncCallback", JSON.stringify(reqObj));
  1175. }
  1176. showInternAd(mark) {
  1177. console.log('zh:showInternAd start');
  1178. if (!Laya.Browser.onAndroid) {
  1179. console.log('zh:showInternAd 非android dev');
  1180. return false;
  1181. }
  1182. if (!this.initBridge()) {
  1183. return false;
  1184. }
  1185. let rs = this.bridge.call("showInternAd", mark);
  1186. try {
  1187. const result = JSON.parse(rs);
  1188. if (result.code === 200) {
  1189. console.log("zh:showInternAd OK");
  1190. return true;
  1191. }
  1192. else {
  1193. console.warn("zh:showInternAd FAILL:", result.msg);
  1194. return false;
  1195. }
  1196. }
  1197. catch (e) {
  1198. console.error("zh:解析桥接返回值失败:", e);
  1199. return false;
  1200. }
  1201. }
  1202. exitAndCloseGame() {
  1203. if (!Laya.Browser.onAndroid) {
  1204. return;
  1205. }
  1206. if (!this.initBridge()) {
  1207. return;
  1208. }
  1209. console.log('zh:开始关闭游戏-');
  1210. this.bridge.call("exitAndCloseGame");
  1211. }
  1212. showRewardAd(mark) {
  1213. if (!Laya.Browser.onAndroid) {
  1214. return false;
  1215. }
  1216. if (!this.initBridge()) {
  1217. return false;
  1218. }
  1219. let rs = this.bridge.call("showRewardAd", mark);
  1220. console.log('zh:showRewardAd rs= ' + rs + ' ,mark=' + mark);
  1221. try {
  1222. const result = JSON.parse(rs);
  1223. if (result.code === 200) {
  1224. console.log("zh:广告显示成功");
  1225. return true;
  1226. }
  1227. else {
  1228. console.warn("zh:广告显示失败:", result.msg);
  1229. return false;
  1230. }
  1231. }
  1232. catch (e) {
  1233. console.error("zh:解析桥接返回值失败:", e);
  1234. return false;
  1235. }
  1236. }
  1237. logEventForAdNoParams(eventName) {
  1238. console.log("zh:logEventForAdNoParams eventName1=" + eventName);
  1239. if (!Laya.Browser.onAndroid) {
  1240. return;
  1241. }
  1242. if (!this.initBridge()) {
  1243. return;
  1244. }
  1245. console.log("zh:call logEventForAdNoParams eventName2=" + eventName);
  1246. this.bridge.call("logEventForAdNoParams", eventName);
  1247. }
  1248. logEventForAdHaveParams(eventName, jsonStr) {
  1249. console.log("zh:ts logEventForAdHaveParams eventName1=" + eventName);
  1250. if (!Laya.Browser.onAndroid) {
  1251. return;
  1252. }
  1253. if (!this.initBridge()) {
  1254. return;
  1255. }
  1256. console.log("zh:call logEventForAdHaveParams eventName2=" + eventName);
  1257. console.log("zh:logEventForAdHaveParams req = json=" + jsonStr);
  1258. this.bridge.call("logEventForAdHaveParams", eventName, jsonStr);
  1259. }
  1260. logEventForFirebase(eventName, jsonStr) {
  1261. console.log("zh:ts logEventForFirebase eventName1=" + eventName);
  1262. if (!Laya.Browser.onAndroid) {
  1263. return;
  1264. }
  1265. if (!this.initBridge()) {
  1266. return;
  1267. }
  1268. console.log("zh:call logEventForFirebase eventName2=" + eventName);
  1269. console.log("zh:logEventForFirebase req = json=" + jsonStr);
  1270. this.bridge.call("logEventForFirebase", eventName, jsonStr);
  1271. }
  1272. testNetTip() {
  1273. if (Laya.Browser.onAndroid) {
  1274. let boo = this.getNetworkAvailable();
  1275. this.showToast2("Network error, reward unavailable");
  1276. return;
  1277. }
  1278. }
  1279. getNetworkAvailable() {
  1280. if (!Laya.Browser.onAndroid) {
  1281. return;
  1282. }
  1283. if (!this.initBridge()) {
  1284. return;
  1285. }
  1286. let boo = this.bridge.call("getNetworkAvailable");
  1287. console.log("zh:getNetworkAvailable boo=" + boo);
  1288. return boo;
  1289. }
  1290. showToast2(msg) {
  1291. if (!Laya.Browser.onAndroid) {
  1292. return;
  1293. }
  1294. if (!this.initBridge()) {
  1295. return;
  1296. }
  1297. this.bridge.call("showToast2", msg);
  1298. }
  1299. nativeCallJs(msg) {
  1300. console.log("zh:nativeCallJs received data: 1111", msg);
  1301. if (msg === 'Ad1') {
  1302. GlobalManager.instance.callMethod('Ad1');
  1303. console.log("zh: Ad1 奖励发送成功");
  1304. }
  1305. else if (msg === 'Ad2') {
  1306. GlobalManager.instance.callMethod('Ad2');
  1307. console.log("zh: Ad2 奖励发送成功");
  1308. }
  1309. else if (msg === 'Ad3') {
  1310. GlobalManager.instance.callMethod('Ad3');
  1311. console.log("zh: Ad3 奖励发送成功");
  1312. }
  1313. else if (msg === 'Ad4') {
  1314. GlobalManager.instance.callMethod('Ad4');
  1315. console.log("zh: Ad4 奖励发送成功");
  1316. }
  1317. else if (msg === 'Ad5') {
  1318. console.log("zh: Ad5 奖励发送成功");
  1319. GlobalManager.instance.callMethod('Ad5');
  1320. }
  1321. }
  1322. }
  1323. class UIBox extends UIBase {
  1324. constructor() {
  1325. super();
  1326. this.boxNum = 0;
  1327. this.boxMax = 10;
  1328. this.inAd = false;
  1329. this.isClose = false;
  1330. }
  1331. onConstructor() {
  1332. this.ui = ui_UIBox.createInstance();
  1333. this.contentPane = this.ui;
  1334. this.isEject = false;
  1335. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  1336. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  1337. Laya.timer.loop(1000, this, this.update);
  1338. }
  1339. update() {
  1340. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  1341. this.boxNum -= 1;
  1342. this.upBar();
  1343. }
  1344. }
  1345. upBar() {
  1346. if (this.boxNum > this.boxMax)
  1347. this.boxNum = this.boxMax;
  1348. this.ui.bar.value = this.boxNum * 10;
  1349. }
  1350. show() {
  1351. super.show();
  1352. this.isClose = false;
  1353. this.boxNum = 0;
  1354. this.inAd = false;
  1355. this.upBar();
  1356. this.ui.t0.play();
  1357. this.ui.closeBtn.visible = false;
  1358. Laya.timer.once(3000, this, () => {
  1359. this.ui.closeBtn.visible = true;
  1360. this.ui.bar.alpha = 1;
  1361. });
  1362. Laya.timer.once(500, this, () => {
  1363. this.ui.t1.play();
  1364. });
  1365. }
  1366. hide() {
  1367. Laya.timer.clearAll(this);
  1368. Moyu.showBannerAd(false);
  1369. super.hide();
  1370. }
  1371. onOpenBox() {
  1372. this.boxNum++;
  1373. if (this.boxNum < this.boxMax) {
  1374. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  1375. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  1376. }
  1377. }
  1378. else if (this.boxNum == this.boxMax) {
  1379. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  1380. this.ui.openBtn.c1.selectedIndex = 13;
  1381. this.inAd = true;
  1382. }
  1383. else
  1384. this.getAward();
  1385. }
  1386. else if (this.inAd) {
  1387. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  1388. if (Laya.Browser.onAndroid) {
  1389. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  1390. if (!boo) {
  1391. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  1392. return;
  1393. }
  1394. }
  1395. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  1396. }
  1397. else {
  1398. console.log('zh:AD 失败,直接发放奖励');
  1399. this.qjff_AD_for_UIBOX_onOpenBox();
  1400. }
  1401. }
  1402. this.upBar();
  1403. }
  1404. qjff_AD_for_UIBOX_onOpenBox() {
  1405. this.getAward();
  1406. }
  1407. onCloseBox() {
  1408. if (this.isClose)
  1409. this.hide();
  1410. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  1411. this.isClose = true;
  1412. PlatMgr.showBanner(true, 0, 3000);
  1413. }
  1414. else
  1415. this.hide();
  1416. }
  1417. getAward() {
  1418. let str = "";
  1419. if (Math.random() < 0.5) {
  1420. let max = Moyu.isLegal ? 500 : 2500;
  1421. let num = xGame.tools.random(max, 500 + max);
  1422. DataMgr.setCoin(num);
  1423. str = "金币x" + num;
  1424. }
  1425. else {
  1426. let max = Moyu.isLegal ? 10 : 30;
  1427. let num = xGame.tools.random(max, 30 + max);
  1428. DataMgr.setDiamond(num);
  1429. str = "钻石x" + num;
  1430. }
  1431. xGame.showTip("恭喜获得-" + str);
  1432. this.hide();
  1433. }
  1434. }
  1435. UIBox.uiName = "UIBox";
  1436. class ui_UITry extends fgui.GComponent {
  1437. static createInstance() {
  1438. return (fgui.UIPackage.createObject("game", "UITry"));
  1439. }
  1440. onConstruct() {
  1441. this.n11 = (this.getChild("n11"));
  1442. this.myNode = (this.getChild("myNode"));
  1443. this.t0 = this.getTransition("t0");
  1444. }
  1445. }
  1446. ui_UITry.URL = "ui://isxx5ak7cj92v4o4";
  1447. class UITry extends UIBase {
  1448. constructor() {
  1449. super();
  1450. this.closeTime = 0;
  1451. this.closeNum = 0;
  1452. this.skillUrl = xGame.common.skillIconList;
  1453. }
  1454. onConstructor() {
  1455. this.ui = ui_UITry.createInstance();
  1456. this.contentPane = this.ui;
  1457. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  1458. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  1459. }
  1460. show() {
  1461. super.show();
  1462. this.closeNum = 0;
  1463. this.closeTime = 15;
  1464. this.ui.t0.play();
  1465. PlatMgr.showRateBanner();
  1466. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1467. Laya.timer.loop(1000, this, this.updateTime);
  1468. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  1469. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  1470. xGame.common.gameMgr.gamePause = true;
  1471. }
  1472. updateTime() {
  1473. if (this.closeTime > 1) {
  1474. this.closeTime--;
  1475. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1476. }
  1477. else
  1478. this.hide();
  1479. }
  1480. hide() {
  1481. Laya.timer.clearAll(this);
  1482. Moyu.showBannerAd(false);
  1483. super.hide();
  1484. xGame.common.gameMgr.gamePause = false;
  1485. }
  1486. onTry() {
  1487. console.log('zh:qjff_AD_for_uitry');
  1488. if (Laya.Browser.onAndroid) {
  1489. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  1490. if (!boo) {
  1491. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  1492. return;
  1493. }
  1494. }
  1495. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  1496. }
  1497. else {
  1498. console.log('zh:AD 失败,直接发放奖励');
  1499. this.qjff_AD_for_uitry();
  1500. }
  1501. }
  1502. qjff_AD_for_uitry() {
  1503. let select = xGame.common.curPlayerSkillType;
  1504. DataMgr.gameData.trySkill = select;
  1505. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  1506. DataMgr.saveGameData();
  1507. DataMgr.setBigSkill(select, 1);
  1508. xGame.showTip("Trial Successful");
  1509. this.hide();
  1510. }
  1511. onCancel() {
  1512. if (this.closeNum > 0) {
  1513. this.closeNum--;
  1514. if (this.closeNum < 2)
  1515. this.hide();
  1516. return;
  1517. }
  1518. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  1519. this.onTry();
  1520. }
  1521. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  1522. this.closeNum = 3;
  1523. }
  1524. else
  1525. this.hide();
  1526. }
  1527. }
  1528. UITry.uiName = "UITry";
  1529. class PlatMgr {
  1530. static initConfig() {
  1531. this.lastVt = 0;
  1532. if (!Moyu.platConfig)
  1533. return;
  1534. for (let k in Moyu.platConfig) {
  1535. let pd = this[k];
  1536. let pc = Moyu.platConfig[k];
  1537. if (pd != undefined && pc != undefined)
  1538. this[k] = pc;
  1539. }
  1540. Moyu.setBannerPos(0.5, 1);
  1541. }
  1542. static rand100(num) {
  1543. return xGame.tools.random(0, 100) < num;
  1544. }
  1545. static isMisVideo() {
  1546. let dt = Laya.timer.currTimer - this.lastVt;
  1547. if (dt > this.forceVideoGap && this.rand100(this.forceVideoRate)) {
  1548. this.lastVt = Laya.timer.currTimer;
  1549. return true;
  1550. }
  1551. else {
  1552. if (this.rand100(this.fullVideoRate)) {
  1553. console.log('zh:插屏 ad start');
  1554. JSBridgeUtils.instance.showInternAd('platMgr');
  1555. }
  1556. return false;
  1557. }
  1558. }
  1559. static showVideo(call, type) {
  1560. Moyu.showVideoAd(() => {
  1561. this.lastVt = Laya.timer.currTimer;
  1562. call && call();
  1563. }, type);
  1564. }
  1565. static showInsert(delay = false) {
  1566. if (this.getRand() < this.insertRate) {
  1567. let dt = delay ? this.insertDelay : 0;
  1568. console.log('zh:插屏 ad start');
  1569. JSBridgeUtils.instance.showInternAd('gameInsert');
  1570. }
  1571. }
  1572. static gameInsert() {
  1573. let t = this.getRand();
  1574. let r = this.gameInsertRate;
  1575. if (t < r) {
  1576. console.log('zh:插屏 ad start 游戏中每回合开始插屏 t: %d, r: %d', t, r);
  1577. }
  1578. }
  1579. static showRateBanner() {
  1580. if (this.getRand() < this.bannerRate)
  1581. this.showBanner(true, this.bannerDelay, 3000);
  1582. }
  1583. static showBanner(show, delay = 0, hide = 0) {
  1584. if (2 > 1) {
  1585. console.log('zh:显示showBanner广告 直接返回');
  1586. return;
  1587. }
  1588. if (!show)
  1589. Moyu.showBannerAd(false);
  1590. else {
  1591. Laya.timer.clear(this, this.bannerShow);
  1592. if (delay > 0)
  1593. Laya.timer.once(delay, this, this.bannerShow, [true]);
  1594. else
  1595. this.bannerShow(true);
  1596. if (hide > 0)
  1597. Laya.timer.once(hide, this, this.bannerShow, [false]);
  1598. }
  1599. }
  1600. static bannerShow(show) {
  1601. if (2 > 1) {
  1602. console.log('zh:显示showBanner广告 直接返回');
  1603. return;
  1604. }
  1605. Moyu.showBannerAd(show);
  1606. console.log("showBanner" + show);
  1607. }
  1608. static getRand() {
  1609. return xGame.tools.random(0, 100);
  1610. }
  1611. static openBox() {
  1612. if (this.getRand() < this.boxRate)
  1613. xGame.uiMgr.Show(UIBox);
  1614. }
  1615. static openTry() {
  1616. if (Laya.timer.currTimer < DataMgr.gameData.tryTime)
  1617. return;
  1618. if (this.getRand() < this.tryRate)
  1619. xGame.uiMgr.Show(UITry);
  1620. else if (DataMgr.gameData.gameCount == 1)
  1621. xGame.uiMgr.Show(UITry);
  1622. }
  1623. }
  1624. PlatMgr.forceShare = 0;
  1625. PlatMgr.signAdRate = 0;
  1626. PlatMgr.forceVideoRate = 0;
  1627. PlatMgr.forceVideoGap = 0;
  1628. PlatMgr.fullVideoRate = 0;
  1629. PlatMgr.gameInsertRate = 0;
  1630. PlatMgr.insertGap = 0;
  1631. PlatMgr.insertDelay = 0;
  1632. PlatMgr.insertRate = 0;
  1633. PlatMgr.boxRate = 0;
  1634. PlatMgr.boxVideoRate = 0;
  1635. PlatMgr.boxInsertRate = 0;
  1636. PlatMgr.boxBannerRate = 0;
  1637. PlatMgr.tryRate = 0;
  1638. PlatMgr.tryClose3Rate = 0;
  1639. PlatMgr.tryVideoRate = 0;
  1640. PlatMgr.bannerRate = 0;
  1641. PlatMgr.lastVt = 0;
  1642. class ui_UIAddProp extends fgui.GComponent {
  1643. static createInstance() {
  1644. return (fgui.UIPackage.createObject("game", "UIAddProp"));
  1645. }
  1646. onConstruct() {
  1647. this.n11 = (this.getChild("n11"));
  1648. this.myNode = (this.getChild("myNode"));
  1649. this.closeBtn = (this.getChild("closeBtn"));
  1650. this.t0 = this.getTransition("t0");
  1651. }
  1652. }
  1653. ui_UIAddProp.URL = "ui://isxx5ak7p4tr42k";
  1654. class SpineMgr {
  1655. constructor(name, loadCb = null) {
  1656. this.loaded = false;
  1657. this.spineName = '';
  1658. this.loadedCallback = loadCb;
  1659. this.templet = new Laya.Templet();
  1660. this.templet.on(Laya.Event.COMPLETE, this, this.parseComplete);
  1661. this.templet.on(Laya.Event.ERROR, this, this.onError);
  1662. if (name === 'mishu') {
  1663. this.templet.loadAni('spine/nvmishu.sk');
  1664. }
  1665. else {
  1666. this.templet.loadAni(`spine/${name}.sk`);
  1667. }
  1668. this.templet.lock = true;
  1669. this.spineName = name;
  1670. }
  1671. onError() {
  1672. console.log("zh:spine加载出错");
  1673. }
  1674. parseComplete() {
  1675. this.loaded = true;
  1676. this.loadedCallback && this.loadedCallback();
  1677. }
  1678. dispose() {
  1679. if (this.templet && !this.templet.destroyed) {
  1680. this.templet.destroy();
  1681. }
  1682. this.templet = null;
  1683. }
  1684. play(data, aniIndex, isLoop = true, parent, callback, mySpine = null) {
  1685. if (!this.loaded) {
  1686. return;
  1687. }
  1688. let spine;
  1689. if (mySpine) {
  1690. spine = mySpine;
  1691. }
  1692. else {
  1693. spine = this.createSpine(data, parent);
  1694. }
  1695. spine.play(aniIndex, isLoop, true, 0, 0, true);
  1696. if (!isLoop) {
  1697. spine.on(Laya.Event.STOPPED, this, () => {
  1698. spine.offAll(Laya.Event.STOPPED);
  1699. callback && callback(spine);
  1700. });
  1701. }
  1702. return spine;
  1703. }
  1704. createSpine(data, parent, type = 1) {
  1705. let spine;
  1706. spine = this.templet.buildArmature(type);
  1707. spine.showSkinByIndex(0);
  1708. parent.addChild(spine);
  1709. spine.pos(data.x, data.y);
  1710. spine.scale(data.scaleX, data.scaleY, true);
  1711. return spine;
  1712. }
  1713. }
  1714. var AIState;
  1715. (function (AIState) {
  1716. AIState[AIState["none"] = 0] = "none";
  1717. AIState[AIState["idle"] = 1] = "idle";
  1718. AIState[AIState["reset"] = 2] = "reset";
  1719. AIState[AIState["move"] = 3] = "move";
  1720. AIState[AIState["wait"] = 4] = "wait";
  1721. AIState[AIState["select"] = 5] = "select";
  1722. AIState[AIState["turn"] = 6] = "turn";
  1723. AIState[AIState["shoot"] = 7] = "shoot";
  1724. AIState[AIState["leave"] = 8] = "leave";
  1725. })(AIState || (AIState = {}));
  1726. class AIPlayer {
  1727. constructor() {
  1728. this.dtime = 30;
  1729. this.awayTime = 0;
  1730. this.awayNum = 0;
  1731. this.hideTime = 0;
  1732. this.rootMoveTime = 0;
  1733. this.isGuide = false;
  1734. this.state = AIState.none;
  1735. this.waitTime = 0;
  1736. this.forceNum = 0;
  1737. this.forceMax = 0;
  1738. this.ballSize = 33;
  1739. this.selectNum = 0;
  1740. this.destRot = 0;
  1741. this.aiLv = 10;
  1742. this.kickBall = [];
  1743. this.lineBall = [];
  1744. this.scoreBall = [];
  1745. this.holeBall = [];
  1746. this.turnNum = 0;
  1747. this.setNum = 0;
  1748. this.setMax = 0;
  1749. this.setRate = 0;
  1750. this.rectL = 0;
  1751. this.rectR = 0;
  1752. this.rectT = 0;
  1753. this.rectB = 0;
  1754. this.rootPos = { x: 0, y: 0 };
  1755. this.bestForce = 0;
  1756. this.bestAngle = 180;
  1757. this.bestPos = { x: 0, y: 0 };
  1758. this.bestKick = { x: 0, y: 0 };
  1759. this.posList = [];
  1760. this.posIdx = 0;
  1761. this.chatTime = 3000;
  1762. this.tempDir1 = new Laya.Vector2();
  1763. this.tempDir2 = new Laya.Vector2();
  1764. this.tempDir3 = new Laya.Vector2();
  1765. Laya.timer.loop(this.dtime, this, this.onUpdate);
  1766. xGame.eventMgr.off(RESET_GAME, this, this.resetAI);
  1767. xGame.eventMgr.on(RESET_GAME, this, this.resetAI);
  1768. this.gameSrc = xGame.common.gameUI;
  1769. this.hideTime = Laya.timer.currTimer;
  1770. Moyu.setOnTipCall((id) => {
  1771. if (id == 20012)
  1772. this.hideTime = Laya.timer.currTimer;
  1773. else
  1774. (id == 20011);
  1775. {
  1776. let dt = Laya.timer.currTimer - this.hideTime;
  1777. console.log("onshow" + dt);
  1778. if (dt > 30000 && this.state > AIState.none)
  1779. xGame.common.gameMgr.aiGameEnd(false);
  1780. }
  1781. }, this);
  1782. }
  1783. init() {
  1784. this.isGuide = DataMgr.getSkillGuide() < 1 || DataMgr.gameData.gameCount < 1;
  1785. this.awayTime = xGame.tools.random(5000, 10000);
  1786. this.awayNum = 0;
  1787. this.hideTime = Laya.timer.currTimer;
  1788. let rect = xGame.common.d2World.borderRect;
  1789. this.rectL = Math.ceil(rect.x) + 17;
  1790. this.rectT = Math.ceil(rect.y) + 17;
  1791. this.rectR = Math.floor(rect.x + rect.width) - 17;
  1792. this.rectB = Math.floor(rect.y + rect.height) - 17;
  1793. this.wBall = xGame.common.d2World.rootBall;
  1794. this.ballSize = this.wBall.gameObj.width - 1;
  1795. if (this.posList.length < 1) {
  1796. let dp = 40;
  1797. for (let i = this.rectL; i < this.rectR + dp; i = i + dp) {
  1798. for (let j = this.rectT; j < this.rectB + dp; j = j + dp) {
  1799. let dx = i < this.rectR ? i : this.rectR;
  1800. let dy = j < this.rectB ? j : this.rectB;
  1801. let order = xGame.tools.random(0, 1000);
  1802. this.posList.push({ x: dx, y: dy, order: order });
  1803. }
  1804. }
  1805. this.posList.sort(function (a, b) {
  1806. return a.order - b.order;
  1807. });
  1808. this.setMax = this.posList.length;
  1809. }
  1810. this.state = AIState.idle;
  1811. }
  1812. setAiLevel(num) {
  1813. this.aiLv = num;
  1814. }
  1815. initBall() {
  1816. this.rootPos.x = this.wBall.gameObj.x;
  1817. this.rootPos.y = this.wBall.gameObj.y;
  1818. this.initHoleBall();
  1819. }
  1820. initHoleBall() {
  1821. this.kickBall = [];
  1822. this.lineBall = [];
  1823. this.scoreBall = [];
  1824. this.holeBall = [];
  1825. this.selectNum = 0;
  1826. this.forceNum = 0;
  1827. this.forceMax = 0;
  1828. this.turnNum = 0;
  1829. let list = xGame.common.d2World.ballArr;
  1830. if (list.length < 20 && !this.isGuide) {
  1831. let holes = xGame.common.gameMgr.holePosList;
  1832. for (let i = 0; i < list.length; i++) {
  1833. let obj = list[i];
  1834. if (!obj)
  1835. continue;
  1836. obj.kickPos.x = 0;
  1837. obj.kickPos.y = 0;
  1838. obj.poleAngle = 0;
  1839. obj.hard = 0;
  1840. obj.borderDis = 0;
  1841. obj.kickAngle = 180;
  1842. if (obj.number == 0)
  1843. continue;
  1844. if (obj.ballType == xGame.common.gameMgr.selfCamp)
  1845. continue;
  1846. if (obj.number == 8 && xGame.common.gameMode == 0) {
  1847. if (xGame.common.gameMgr.aiBallArr.length > 0 || !xGame.common.gameMgr.ensureBallType)
  1848. continue;
  1849. }
  1850. let b = obj.gameObj;
  1851. let wbp = this.rootPos;
  1852. let bx = wbp.x - b.x;
  1853. let by = wbp.y - b.y;
  1854. obj.borderDis = xGame.tools.random(0, 100);
  1855. this.kickBall.push(obj);
  1856. if (!this.isLine(wbp, obj))
  1857. continue;
  1858. obj.kickAngle = xGame.tools.random(90, 180);
  1859. obj.kickPos.x = b.x;
  1860. obj.kickPos.y = b.y;
  1861. this.lineBall.push(obj);
  1862. let minDis = 999999;
  1863. let hole = false;
  1864. for (let j = 0; j < holes.length; j++) {
  1865. let hp = holes[j];
  1866. if (bx >= 0 && hp.x > b.x + 100)
  1867. continue;
  1868. if (bx <= 0 && hp.x < b.x - 100)
  1869. continue;
  1870. if (by < -10 && hp.y < wbp.y)
  1871. continue;
  1872. if (by > 10 && hp.y > wbp.y)
  1873. continue;
  1874. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  1875. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  1876. if (dis < minDis) {
  1877. let dx = b.x - this.tempDir1.x * this.ballSize;
  1878. let dy = b.y - this.tempDir1.y * this.ballSize;
  1879. this.tempDir3.x = this.tempDir1.x;
  1880. this.tempDir3.y = this.tempDir1.y;
  1881. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  1882. obj.kickPos.x = dx;
  1883. obj.kickPos.y = dy;
  1884. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  1885. if (num > 1)
  1886. num = 1;
  1887. obj.kickAngle = Math.acos(num) * 57.3;
  1888. if (b.x < this.rectL + 2 || b.x > this.rectR - 2 || b.y < this.rectT + 2 || b.y > this.rectB - 2)
  1889. dis = dis * 2;
  1890. if (Math.abs(hp.x - 600) < 100)
  1891. dis += 50;
  1892. obj.hard = dis + obj.kickAngle * 3;
  1893. hole = true;
  1894. }
  1895. }
  1896. }
  1897. }
  1898. if (hole) {
  1899. this.scoreBall.push(obj);
  1900. this.holeBall.push(obj);
  1901. }
  1902. }
  1903. this.scoreBall.sort(function (a, b) {
  1904. return a.hard - b.hard;
  1905. });
  1906. this.holeBall.sort(function (a, b) {
  1907. return a.kickAngle - b.kickAngle;
  1908. });
  1909. this.kickBall.sort(function (a, b) {
  1910. return a.borderDis - b.borderDis;
  1911. });
  1912. }
  1913. else {
  1914. let max = list.length - 1;
  1915. let i = xGame.tools.random(0, max);
  1916. for (i; i <= max; i++) {
  1917. let idx = i >= max ? i -= max : i;
  1918. let obj = list[idx];
  1919. if (obj && obj.number != 0) {
  1920. obj.kickAngle = xGame.tools.random(90, 180);
  1921. obj.kickPos.x = obj.gameObj.x + xGame.tools.random(-10, 10);
  1922. obj.kickPos.y = obj.gameObj.y + xGame.tools.random(-10, 10);
  1923. this.lineBall.push(obj);
  1924. break;
  1925. }
  1926. }
  1927. }
  1928. }
  1929. selectBall() {
  1930. let ball = null;
  1931. this.destRot = 0;
  1932. let max = this.isGuide ? 1 : 3 - Math.ceil(this.aiLv / 4) + xGame.tools.random(0, 2);
  1933. let ai = 110 - this.aiLv * 10;
  1934. let mis = xGame.tools.random(-ai, ai) * 0.005;
  1935. let score = false;
  1936. if (this.scoreBall.length < 1) {
  1937. if (this.lineBall.length < 1) {
  1938. for (let i = 0; i < this.kickBall.length; i++) {
  1939. let list = [];
  1940. let bo = this.kickBall[i];
  1941. let bobj = bo.gameObj;
  1942. let rect = xGame.common.d2World.borderRect;
  1943. let mobj = this.wBall.gameObj;
  1944. let minb = bobj.y - rect.y - 20;
  1945. let minw = mobj.y - rect.y - 50;
  1946. if (minb > 0 && minw > 0) {
  1947. let dlenx = 0;
  1948. let dleny = mobj.y - rect.y;
  1949. let spx = mobj.x;
  1950. let spy = rect.y - dleny;
  1951. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1952. }
  1953. minb = rect.y + rect.height - bobj.y - 20;
  1954. minw = rect.y + rect.height - mobj.y - 50;
  1955. if (minb > 0 && minw > 0) {
  1956. let dlenx = 0;
  1957. let dleny = rect.y + rect.height - mobj.y;
  1958. let spx = mobj.x;
  1959. let spy = rect.y + rect.height + dleny;
  1960. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1961. }
  1962. minb = bobj.x - rect.x - 20;
  1963. minw = mobj.x - rect.x - 50;
  1964. if (minb > 0 && minw > 0) {
  1965. let dlenx = mobj.x - rect.x;
  1966. let dleny = 0;
  1967. let spx = rect.x - dlenx;
  1968. let spy = mobj.y;
  1969. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1970. }
  1971. minb = rect.x + rect.width - bobj.x - 20;
  1972. minw = rect.x + rect.width - mobj.x - 50;
  1973. if (minb > 0 && minw > 0) {
  1974. let dlenx = rect.x + rect.width - mobj.x;
  1975. let dleny = 0;
  1976. let spx = rect.x + rect.width + dlenx;
  1977. let spy = mobj.y;
  1978. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1979. }
  1980. list.sort(function (a, b) {
  1981. return a.order - b.order;
  1982. });
  1983. for (let i = 0; i < list.length; i++) {
  1984. let data = list[i];
  1985. let mx = mobj.x - bobj.x;
  1986. let my = mobj.y - bobj.y;
  1987. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  1988. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  1989. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1990. if (num > 1)
  1991. num = 1;
  1992. let cos = Math.acos(num);
  1993. if (cos > 1.57)
  1994. cos = 1.57;
  1995. else if (cos < 0.01)
  1996. cos = 0.01;
  1997. let tan = Math.tan(cos);
  1998. let dx = tan * data.dleny;
  1999. let dy = tan * data.dlenx;
  2000. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  2001. if (Math.abs(bx - 667) < 40)
  2002. continue;
  2003. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  2004. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  2005. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  2006. this.forceMax = dis * 0.08;
  2007. this.destRot += mis * 0.1;
  2008. this.setKick(bx, by);
  2009. return true;
  2010. }
  2011. }
  2012. }
  2013. }
  2014. else {
  2015. ball = xGame.common.getRandArrEle(this.lineBall);
  2016. }
  2017. }
  2018. else {
  2019. for (let i = 0; i < this.scoreBall.length; i++) {
  2020. if (i < this.scoreBall.length - 1) {
  2021. let rand = 70 + this.aiLv * 10 + i * 10;
  2022. if (xGame.tools.random(0, 100) < rand) {
  2023. ball = this.scoreBall[i];
  2024. break;
  2025. }
  2026. }
  2027. else {
  2028. ball = this.scoreBall[i];
  2029. break;
  2030. }
  2031. }
  2032. score = true;
  2033. this.selectNum++;
  2034. }
  2035. if (!ball)
  2036. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2037. if (this.selectNum >= max) {
  2038. let dx = ball.gameObj.x;
  2039. let dy = ball.gameObj.y;
  2040. let kickAngle = 0;
  2041. if (score) {
  2042. dx = ball.kickPos.x;
  2043. dy = ball.kickPos.y;
  2044. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2045. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2046. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  2047. if (adot > 1)
  2048. adot = 1;
  2049. kickAngle = Math.acos(adot) * 57.3;
  2050. if (kickAngle > 45) {
  2051. let kdx = ball.kickPos.x - ball.gameObj.x;
  2052. let kdy = ball.kickPos.y - ball.gameObj.y;
  2053. dx = ball.kickPos.x - kdx * mis * 0.3;
  2054. dy = ball.kickPos.y - kdy * mis * 0.3;
  2055. }
  2056. else
  2057. this.destRot += mis;
  2058. }
  2059. else if (ball.poleAngle != 0) {
  2060. this.destRot += ball.poleAngle;
  2061. }
  2062. if (xGame.common.gameMode == 0) {
  2063. let af = kickAngle * 0.08;
  2064. this.forceMax = ball.hard * 0.1 + af * af;
  2065. }
  2066. this.setKick(dx, dy);
  2067. }
  2068. else {
  2069. let rand = this.aiLv * 5 + 40;
  2070. if (xGame.tools.random(0, 100) < rand && this.scoreBall.length > 0)
  2071. ball = xGame.common.getRandArrEle(this.scoreBall);
  2072. else
  2073. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2074. rand = this.aiLv * 3 + 40 + this.selectNum * 20;
  2075. if (xGame.tools.random(0, 100) > rand) {
  2076. this.selectNum = max;
  2077. }
  2078. this.setState(AIState.select, xGame.tools.random(500, 1000));
  2079. this.selectNum++;
  2080. }
  2081. ball.onClick(0, true);
  2082. }
  2083. isBlock(bn, bx, by, hx, hy, dn = -1) {
  2084. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  2085. let balls = xGame.common.d2World.ballArr;
  2086. let max = xGame.tools.getDis(hx, hy, bx, by);
  2087. for (let index = 0; index < balls.length; index++) {
  2088. let obj = balls[index];
  2089. if (obj.number == 0)
  2090. continue;
  2091. if (obj.number == bn || obj.number == dn)
  2092. continue;
  2093. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  2094. if (dis * dis > max)
  2095. continue;
  2096. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  2097. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2098. if (num > 1)
  2099. num = 1;
  2100. if (num < 0)
  2101. continue;
  2102. let gap = Math.sin(Math.acos(num)) * dis;
  2103. if (gap < this.ballSize)
  2104. return true;
  2105. }
  2106. return false;
  2107. }
  2108. isLine(xy, ball) {
  2109. let bx = xy.x;
  2110. let by = xy.y;
  2111. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  2112. let dis = ball.getDestDis(xy);
  2113. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  2114. let sin = Math.sin(angle);
  2115. let cos = Math.cos(angle);
  2116. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2117. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2118. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2119. let dx = bx + this.tempDir2.x * dis;
  2120. let dy = by + this.tempDir2.y * dis;
  2121. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  2122. sin = Math.sin(-angle);
  2123. cos = Math.cos(-angle);
  2124. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2125. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2126. dx = bx + this.tempDir2.x * dis;
  2127. dy = by + this.tempDir2.y * dis;
  2128. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  2129. if (isr && isl)
  2130. return false;
  2131. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  2132. }
  2133. return true;
  2134. }
  2135. turnPole() {
  2136. this.turnNum++;
  2137. let rot = xGame.common.d2World.d2Gan.ui.rotation % 360;
  2138. let dr = rot - this.destRot;
  2139. let abs = Math.abs(dr) % 360;
  2140. if (abs > 180) {
  2141. if (rot > 180)
  2142. rot -= 360;
  2143. if (this.destRot > 180)
  2144. this.destRot -= 360;
  2145. }
  2146. let max = this.turnNum * 5 + this.aiLv * 5;
  2147. if (abs < 0.2 && xGame.tools.random(0, 100) < max) {
  2148. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  2149. let at = xGame.tools.random(1000, 2000);
  2150. if (!this.onAway(3))
  2151. at += xGame.tools.random(10000, 15000);
  2152. this.setState(AIState.shoot, at);
  2153. }
  2154. else {
  2155. let mr = 0;
  2156. if (abs > 3)
  2157. mr = 1 + xGame.tools.random(2, 6) * abs * 0.01;
  2158. else if (Math.random() > 0.6)
  2159. mr = xGame.tools.random(1, 10) * 0.1;
  2160. mr = dr > 0 ? -mr : mr;
  2161. xGame.common.d2World.d2Gan.rotDest(rot + mr);
  2162. }
  2163. }
  2164. setKick(dx, dy) {
  2165. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  2166. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2167. this.tempDir1.x = 0;
  2168. this.tempDir1.y = 1;
  2169. this.tempDir2.y = -this.tempDir2.y;
  2170. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2171. if (num > 1)
  2172. num = 1;
  2173. let rot = Math.acos(num) * 57.3;
  2174. if (this.tempDir2.x < 0)
  2175. rot = 360 - rot;
  2176. this.destRot += rot;
  2177. if (!xGame.common.gameMgr.finishOneShoot) {
  2178. this.forceMax += xGame.tools.random(10, 50);
  2179. this.forceMax -= this.aiLv * 2;
  2180. if (this.forceMax < 20)
  2181. this.forceMax = 20;
  2182. }
  2183. if (this.forceMax > 100)
  2184. this.forceMax = 101;
  2185. else if (this.forceMax < 10)
  2186. this.forceMax += xGame.tools.random(0, 10);
  2187. if (xGame.common.gameMode == 1)
  2188. this.forceMax = xGame.tools.random(80, 100);
  2189. else
  2190. this.forceMax = xGame.tools.random(this.forceMax * 0.5, this.forceMax);
  2191. let max = 2000 - this.aiLv * 100;
  2192. if (Math.random() > 0.8)
  2193. max += xGame.tools.random(100, 2000);
  2194. this.setState(AIState.turn, xGame.tools.random(500, max));
  2195. }
  2196. shoot() {
  2197. if (this.waitTime < 0 && Math.abs(this.forceNum - this.forceMax) < 4) {
  2198. if (Math.random() > 0.8) {
  2199. this.gameSrc.aiForce(1);
  2200. this.setState(AIState.wait);
  2201. }
  2202. }
  2203. else {
  2204. let df = xGame.tools.random(3, 8);
  2205. if (this.forceNum < this.forceMax)
  2206. this.forceNum += df;
  2207. else
  2208. this.forceNum -= df;
  2209. let startY = this.gameSrc.ui.powerNode.y;
  2210. let height = this.gameSrc.ui.powerNode.height;
  2211. let force = startY + height * this.forceNum * 0.01;
  2212. this.gameSrc.aiForce(2, force);
  2213. }
  2214. }
  2215. reset() {
  2216. for (let i = 0; i < 4; i++) {
  2217. this.setRate--;
  2218. this.setNum++;
  2219. let pos = this.posList[this.posIdx];
  2220. this.rootPos.x = pos.x + xGame.tools.random(-20, 20);
  2221. this.rootPos.y = pos.y + xGame.tools.random(-20, 20);
  2222. if (!xGame.common.gameMgr.isTouchedBall && this.rootPos.x > 387)
  2223. this.rootPos.x = 387;
  2224. if (this.rootPos.x < this.rectL)
  2225. this.rootPos.x = this.rectL;
  2226. else if (this.rootPos.x > this.rectR)
  2227. this.rootPos.x = this.rectR;
  2228. if (this.rootPos.y < this.rectT)
  2229. this.rootPos.y = this.rectT;
  2230. else if (this.rootPos.y > this.rectB)
  2231. this.rootPos.y = this.rectB;
  2232. this.posIdx++;
  2233. let max = this.posList.length;
  2234. if (this.posIdx >= max)
  2235. this.posIdx -= max;
  2236. this.initHoleBall();
  2237. let ball = null;
  2238. if (this.scoreBall.length > 0)
  2239. ball = this.scoreBall[0];
  2240. else if (this.lineBall.length > 0)
  2241. ball = xGame.common.getRandArrEle(this.lineBall);
  2242. if (ball && ball.kickAngle < this.bestAngle) {
  2243. this.bestAngle = ball.kickAngle;
  2244. this.bestKick.x = ball.kickPos.x;
  2245. this.bestKick.y = ball.kickPos.y;
  2246. this.bestPos.x = this.rootPos.x;
  2247. this.bestPos.y = this.rootPos.y;
  2248. this.bestForce = ball.hard * 0.08;
  2249. }
  2250. }
  2251. if (this.setNum >= this.setMax)
  2252. this.setMax = 0;
  2253. if (this.setRate < 1) {
  2254. this.setState(AIState.move, 0);
  2255. this.rootMoveTime = Laya.timer.currTimer;
  2256. this.gameSrc.aiRootMove(true);
  2257. }
  2258. }
  2259. delayLine() {
  2260. this.gameSrc.aiRootMove(false);
  2261. }
  2262. move() {
  2263. if (this.bestPos.x < 1)
  2264. this.bestPos = this.rootPos;
  2265. let wObj = this.wBall.gameObj;
  2266. let destx = wObj.x;
  2267. let desty = wObj.y;
  2268. let dx = Math.abs(destx - this.bestPos.x);
  2269. let dy = Math.abs(desty - this.bestPos.y);
  2270. let mx = 3 + dx * 0.03;
  2271. let my = 3 + dy * 0.03;
  2272. if (dx < 4 && dy < 4) {
  2273. let dt = Laya.timer.currTimer - this.rootMoveTime;
  2274. dt = dt < 1000 ? 1000 - dt : 0;
  2275. if (this.setMax > 0) {
  2276. let min = this.setMax * 0.3 + this.aiLv * 5;
  2277. this.setRate = xGame.tools.random(min, this.setMax);
  2278. this.setState(AIState.reset, 0);
  2279. }
  2280. else {
  2281. this.destRot = 0;
  2282. this.forceMax = this.bestForce;
  2283. this.setKick(this.bestKick.x, this.bestKick.y);
  2284. }
  2285. if (dt > 100) {
  2286. Laya.timer.clear(this, this.delayLine);
  2287. Laya.timer.once(dt, this, this.delayLine);
  2288. }
  2289. else
  2290. this.gameSrc.aiRootMove(false);
  2291. }
  2292. else {
  2293. if (dx > 4)
  2294. destx = wObj.x < this.bestPos.x ? wObj.x + mx : wObj.x - mx;
  2295. if (dy > 4)
  2296. desty = wObj.y < this.bestPos.y ? wObj.y + my : wObj.y - my;
  2297. this.gameSrc.onRootMove({ x: destx, y: desty });
  2298. }
  2299. }
  2300. resetRoot() {
  2301. this.bestAngle = 180;
  2302. this.bestForce = 0;
  2303. this.setMax = this.posList.length;
  2304. this.posIdx = xGame.tools.random(0, this.setMax);
  2305. let min = this.setMax * 0.3 + this.aiLv * 5;
  2306. this.setRate = xGame.tools.random(min, this.setMax);
  2307. let max = 2000 - this.aiLv * 100;
  2308. if (Math.random() > 0.8)
  2309. max += xGame.tools.random(100, 1000);
  2310. if (this.isGuide)
  2311. this.setState(AIState.select, 500);
  2312. else if (this.onAway(2))
  2313. this.setState(AIState.reset, xGame.tools.random(400, max));
  2314. else
  2315. this.setState(AIState.none);
  2316. if (xGame.common.gameMgr.finishOneShoot)
  2317. this.chat();
  2318. }
  2319. runAI() {
  2320. if (this.state > AIState.idle)
  2321. return;
  2322. this.initBall();
  2323. this.onGame(2500);
  2324. if (Math.random() > 0.6)
  2325. this.chat();
  2326. }
  2327. stopRun() {
  2328. this.setState(AIState.idle);
  2329. }
  2330. onGame(base) {
  2331. let max = base - this.aiLv * 100;
  2332. if (Math.random() > 0.8)
  2333. max += xGame.tools.random(100, 1000);
  2334. if (this.onAway(2))
  2335. this.setState(AIState.select, xGame.tools.random(500, max));
  2336. else
  2337. this.setState(AIState.none);
  2338. }
  2339. setState(sta, wt = 0) {
  2340. if (this.state == AIState.none)
  2341. return;
  2342. this.state = sta;
  2343. this.waitTime = wt;
  2344. }
  2345. onUpdate() {
  2346. if (this.state == AIState.none)
  2347. return;
  2348. this.awayTime -= this.dtime;
  2349. if (this.awayTime < 1) {
  2350. this.awayTime = xGame.tools.random(6000, 10000);
  2351. this.awayNum += (11 - this.aiLv);
  2352. this.onAway(1);
  2353. }
  2354. if (this.waitTime >= 0) {
  2355. this.waitTime -= this.dtime;
  2356. return;
  2357. }
  2358. switch (this.state) {
  2359. case AIState.idle:
  2360. this.chat();
  2361. break;
  2362. case AIState.reset:
  2363. this.reset();
  2364. break;
  2365. case AIState.move:
  2366. this.move();
  2367. break;
  2368. case AIState.leave:
  2369. this.state = AIState.none;
  2370. xGame.common.gameMgr.aiGameEnd(true);
  2371. break;
  2372. case AIState.select:
  2373. this.selectBall();
  2374. break;
  2375. case AIState.turn:
  2376. this.turnPole();
  2377. break;
  2378. case AIState.shoot:
  2379. this.shoot();
  2380. break;
  2381. }
  2382. }
  2383. onAway(type) {
  2384. if (type == 1) {
  2385. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2386. let num = this.awayNum + db * 20;
  2387. if (db > 0 && num > 0 && xGame.tools.random(0, 10000) < num && this.state == AIState.idle) {
  2388. xGame.common.gameMgr.aiLeave();
  2389. this.setState(AIState.leave, 6666);
  2390. }
  2391. }
  2392. else if (type == 2) {
  2393. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2394. let num = this.awayNum + db * 30;
  2395. if (xGame.tools.random(0, 10000) < num)
  2396. return false;
  2397. }
  2398. else if (type == 3) {
  2399. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2400. let num = this.awayNum + db * 10;
  2401. if (xGame.tools.random(0, 4000) < num)
  2402. return false;
  2403. }
  2404. return true;
  2405. }
  2406. chat() {
  2407. if (this.chatTime > 0) {
  2408. this.chatTime -= this.dtime;
  2409. return;
  2410. }
  2411. this.chatTime = xGame.tools.random(2000, 10000);
  2412. let rand = xGame.tools.random(0, 100);
  2413. if (rand < 15)
  2414. this.talk();
  2415. else if (rand < 35)
  2416. this.emotion();
  2417. }
  2418. talk() {
  2419. xGame.common.talkMgr.showAITalk(0);
  2420. }
  2421. emotion() {
  2422. xGame.common.talkMgr.showAIEmotion(0);
  2423. }
  2424. resetAI() {
  2425. this.stopRun();
  2426. this.state = AIState.none;
  2427. }
  2428. }
  2429. class Partical extends Laya.Script3D {
  2430. constructor() {
  2431. super();
  2432. this.duration = 2000;
  2433. }
  2434. ;
  2435. onAwake() {
  2436. this.gameObj = this.owner;
  2437. }
  2438. onEnable() {
  2439. this.openTimer();
  2440. }
  2441. openTimer() {
  2442. Laya.timer.once(this.duration, this, this.disappear);
  2443. }
  2444. setCallback(obj, callback) {
  2445. this.obj = obj;
  2446. this.callback = callback;
  2447. Laya.timer.clearAll(this);
  2448. Laya.timer.once(this.duration, this, this.disappear);
  2449. }
  2450. disappear() {
  2451. xGame.poolD3Mgr.putItem(this.gameObj.name, this.gameObj);
  2452. this.callback && this.callback(this.obj);
  2453. }
  2454. }
  2455. class Ball extends Laya.Script3D {
  2456. constructor() {
  2457. super();
  2458. this.posV3 = new Laya.Vector3();
  2459. this.rotRate = 2.1;
  2460. this.rotSpeed = new Laya.Vector3();
  2461. this.myIndex = 0;
  2462. }
  2463. onAwake() {
  2464. this.gameObj = this.owner;
  2465. this.transform = this.gameObj.transform;
  2466. this.ballNode = this.gameObj.getChildByName("Ball");
  2467. this.shadowNode = this.gameObj.getChildByName("shadow");
  2468. }
  2469. initSelf(index, x, y, owner) {
  2470. this.d2BallSrc = owner;
  2471. this.myIndex = index;
  2472. this.setAlbedoTexture();
  2473. this.setTransPos(x, y);
  2474. this.setScale();
  2475. this.ballNode.transform.localRotationEulerX = 90;
  2476. if (index == 0) {
  2477. }
  2478. }
  2479. setAlbedoTexture(isIce = false) {
  2480. let url;
  2481. if (isIce) {
  2482. url = `res/d3Res/ballTexture/ice.jpg`;
  2483. }
  2484. else {
  2485. url = `res/d3Res/ballTexture/ball${this.myIndex}.png`;
  2486. }
  2487. Laya.Texture2D.load(url, Laya.Handler.create(this, (tex) => {
  2488. this.ballNode.meshRenderer.material["albedoTexture"] = tex;
  2489. }));
  2490. }
  2491. runFireworks(obj, delay, callback) {
  2492. Laya.timer.clearAll(this);
  2493. Laya.timer.once(delay + 1, this, () => {
  2494. let fire = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  2495. fire.transform.localPositionX = this.transform.localPositionX;
  2496. fire.transform.localPositionY = this.transform.localPositionY;
  2497. fire.transform.localPositionZ = this.transform.localPositionZ;
  2498. let src = fire.getComponent(Partical);
  2499. src.duration = 1000;
  2500. src.setCallback(obj, callback);
  2501. let eft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  2502. eft.transform.localPositionX = this.transform.localPositionX;
  2503. eft.transform.localPositionY = this.transform.localPositionY;
  2504. eft.transform.localPositionZ = this.transform.localPositionZ;
  2505. });
  2506. }
  2507. setTransPos(x, y) {
  2508. this.setRotation();
  2509. xGame.common.pos2to3Convert(x, y, this.posV3);
  2510. this.transform.localPositionX = this.posV3.x;
  2511. this.transform.localPositionY = 0;
  2512. this.transform.localPositionZ = this.posV3.z;
  2513. this.transform.localRotationEulerX = 0;
  2514. this.transform.localRotationEulerY = 0;
  2515. this.transform.localRotationEulerZ = 0;
  2516. this.shadowNode.transform.localPositionX = this.posV3.x / 30;
  2517. this.shadowNode.transform.localPositionY = 0.1;
  2518. this.shadowNode.transform.localPositionZ = this.posV3.z / 30;
  2519. }
  2520. setRotation() {
  2521. if (this.d2BallSrc.canRot) {
  2522. let speed = this.d2BallSrc.rigy.linearVelocity;
  2523. this.rotSpeed.x = speed.x * this.rotRate;
  2524. this.rotSpeed.z = speed.y * this.rotRate;
  2525. this.rotSpeed.y = this.d2BallSrc.rotY;
  2526. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2527. }
  2528. else if (Math.abs(this.d2BallSrc.rotY) > 0.1) {
  2529. this.rotSpeed.x = this.rotSpeed.y = 0;
  2530. this.rotSpeed.y = this.d2BallSrc.rotY;
  2531. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2532. }
  2533. }
  2534. setScale() {
  2535. let radius = xGame.common.d2World.rootBall.ui.width;
  2536. let scale = xGame.common.scale2to3Convert(radius);
  2537. this.transform.localScaleX = scale;
  2538. this.transform.localScaleY = scale;
  2539. this.transform.localScaleZ = scale;
  2540. }
  2541. playInHoleEft() {
  2542. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  2543. eft.transform.position = this.transform.position;
  2544. }
  2545. playIceEft() {
  2546. let eft = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  2547. eft.transform.position = this.transform.position;
  2548. }
  2549. get scaleXYZ() {
  2550. return this.transform.localScaleX;
  2551. }
  2552. set scaleXYZ(val) {
  2553. this.transform.localScaleX = val;
  2554. this.transform.localScaleY = val;
  2555. this.transform.localScaleZ = val;
  2556. }
  2557. get posX() {
  2558. return this.transform.localPositionX;
  2559. }
  2560. set posX(val) {
  2561. this.transform.localPositionX = val;
  2562. }
  2563. get posY() {
  2564. return this.transform.localPositionY;
  2565. }
  2566. set posY(val) {
  2567. this.transform.localPositionY = val;
  2568. }
  2569. get posZ() {
  2570. return this.transform.localPositionZ;
  2571. }
  2572. set posZ(val) {
  2573. this.transform.localPositionZ = val;
  2574. }
  2575. destroySelf() {
  2576. this.posV3 = null;
  2577. this.rotSpeed = null;
  2578. this.d2BallSrc = null;
  2579. this.ballNode = null;
  2580. this.gameObj.destroy(true);
  2581. this.transform = null;
  2582. this.destroy();
  2583. }
  2584. }
  2585. class ui_D2Ball extends fgui.GComponent {
  2586. static createInstance() {
  2587. return (fgui.UIPackage.createObject("game", "D2Ball"));
  2588. }
  2589. onConstruct() {
  2590. this.myIcon = (this.getChild("myIcon"));
  2591. this.inner = (this.getChild("inner"));
  2592. this.n8 = (this.getChild("n8"));
  2593. this.n4 = (this.getChild("n4"));
  2594. this.wrongTips = (this.getChild("wrongTips"));
  2595. this.rightTips = (this.getChild("rightTips"));
  2596. this.breathAni = this.getTransition("breathAni");
  2597. }
  2598. }
  2599. ui_D2Ball.URL = "ui://isxx5ak7kt443qi";
  2600. class D2BallSrc extends Laya.Script {
  2601. constructor() {
  2602. super();
  2603. this.number = 0;
  2604. this.startX = 0;
  2605. this.startY = 0;
  2606. this.angleV2 = new Laya.Vector2();
  2607. this.isRootBall = false;
  2608. this.isBlackBall = false;
  2609. this.ballType = "";
  2610. this.canRot = true;
  2611. this.rotY = 0;
  2612. this.poleAngle = 0;
  2613. this.kickPos = { x: 0, y: 0 };
  2614. this.hard = 0;
  2615. this.kickAngle = 0;
  2616. this.borderDis = 0;
  2617. this.speedP10 = 5.6;
  2618. this.lastSpeed = { x: 0, y: 0 };
  2619. this.stillSpeed = 0.12;
  2620. this.ballFunc = "normal";
  2621. this.isRunSkillAni = false;
  2622. this.isInHole = false;
  2623. this.iceOwner = "";
  2624. this.forceRun = false;
  2625. this.myUNID = "";
  2626. this.rectL = 0;
  2627. this.rectR = 0;
  2628. this.rectT = 0;
  2629. this.rectB = 0;
  2630. this.forceVec = new Laya.Vector2();
  2631. this.lastDis = 0;
  2632. this.helpOut = { type: "", x: 0, y: 0 };
  2633. }
  2634. initSelf(number, x, y, d3Ball) {
  2635. if (!this.gameObj)
  2636. this.gameObj = this.owner;
  2637. this.number = number;
  2638. this.startX = x;
  2639. this.startY = y;
  2640. this.d3Ball = d3Ball;
  2641. this.isRootBall = false;
  2642. this.isBlackBall = false;
  2643. this.ballType = "";
  2644. if (number == 0) {
  2645. this.isRootBall = true;
  2646. }
  2647. else if (number == 8) {
  2648. this.isBlackBall = true;
  2649. }
  2650. else {
  2651. if (number <= 7) {
  2652. this.ballType = ballCamp.full;
  2653. }
  2654. else {
  2655. this.ballType = ballCamp.flower;
  2656. }
  2657. }
  2658. this.setInfo();
  2659. this.setD3Ball();
  2660. this.owner["mySrc"] = this;
  2661. this.rigy.linearDamping = 1;
  2662. D2BallSrc._unid++;
  2663. this.myUNID = "d2ball" + D2BallSrc._unid;
  2664. let rect = xGame.common.d2World.borderRect;
  2665. this.rectL = Math.ceil(rect.x) + 20;
  2666. this.rectT = Math.ceil(rect.y) + 20;
  2667. this.rectR = Math.floor(rect.x + rect.width) - 20;
  2668. this.rectB = Math.floor(rect.y + rect.height) - 20;
  2669. }
  2670. setInfo() {
  2671. this.gameObj.x = this.startX;
  2672. this.gameObj.y = this.startY;
  2673. let radius = this.ui.width / 2;
  2674. this.gameObj.width = radius * 2;
  2675. this.gameObj.height = radius * 2;
  2676. if (xGame.common.showDebug) {
  2677. this.ui.myIcon.alpha = 1;
  2678. this.ui.inner.alpha = 1;
  2679. }
  2680. else {
  2681. this.ui.myIcon.alpha = 0;
  2682. this.ui.inner.alpha = 0;
  2683. }
  2684. }
  2685. setD3Ball() {
  2686. this.d3Ball = this.d3Ball;
  2687. this.d3BallSrc = this.d3Ball.getComponent(Ball);
  2688. this.d3BallSrc.initSelf(this.number, this.startX, this.startY, this);
  2689. }
  2690. onUpdate() {
  2691. if (xGame.common.gameMgr.gamePause)
  2692. return;
  2693. if (this.isInHole)
  2694. return;
  2695. if (!xGame.common.d2World.openCheckStill)
  2696. return;
  2697. this.runBall();
  2698. }
  2699. runBall() {
  2700. this.lastSpeed.x = this.rigy.linearVelocity.x;
  2701. this.lastSpeed.y = this.rigy.linearVelocity.y;
  2702. this.d3BallSrc.setTransPos(this.gameObj.x, this.gameObj.y);
  2703. this.judgeBorder();
  2704. }
  2705. getDestDis(dest) {
  2706. return xGame.tools.getDistance(dest.x, dest.y, this.gameObj.x, this.gameObj.y);
  2707. }
  2708. setmyXY(x, y) {
  2709. this.d3BallSrc.setTransPos(x, y);
  2710. }
  2711. getSpeed() {
  2712. let speed = this.rigy.linearVelocity;
  2713. return speed.x * speed.x + speed.y * speed.y;
  2714. }
  2715. onTriggerEnter(collider) {
  2716. if (!collider || !collider.owner)
  2717. return;
  2718. let coll = "collide";
  2719. let speed = this.getSpeed();
  2720. let sv2 = this.speedP10 * this.speedP10;
  2721. if (collider.label == "ball") {
  2722. if (speed < 9 && this.number != 0)
  2723. coll = "";
  2724. else if (speed < sv2)
  2725. coll = "collide_4";
  2726. else if (speed < sv2 * 6.2)
  2727. coll = "collide_3";
  2728. else if (speed < sv2 * 25)
  2729. coll = "collide_2";
  2730. else if (speed < sv2 * 56)
  2731. coll = "collide_1";
  2732. xGame.soundMgr.playSound(coll);
  2733. if (this.gameObj.x < this.rectL || this.gameObj.x > this.rectR || this.gameObj.y < this.rectT || this.gameObj.y > this.rectB) {
  2734. if (collider.owner) {
  2735. let rig = collider.owner.getComponent(D2BallSrc);
  2736. if (Math.abs(rig.rigy.linearVelocity.x) > 0)
  2737. rig.lastSpeed.x = rig.rigy.linearVelocity.x;
  2738. if (Math.abs(rig.rigy.linearVelocity.y) > 0)
  2739. rig.lastSpeed.y = rig.rigy.linearVelocity.y;
  2740. let vx = Math.abs(rig.lastSpeed.x * 0.4);
  2741. let vy = Math.abs(rig.lastSpeed.y * 0.5);
  2742. let rx = 0;
  2743. let ry = 0;
  2744. if (this.gameObj.x < this.rectL)
  2745. rx = vx;
  2746. else if (this.gameObj.x > this.rectR)
  2747. rx = -vx;
  2748. else if (this.gameObj.y < this.rectT)
  2749. ry = vy;
  2750. else if (this.gameObj.y > this.rectB)
  2751. ry = -vy;
  2752. this.rigy.applyLinearImpulseToCenter({ x: rx, y: ry });
  2753. }
  2754. }
  2755. if (this.number != 0) {
  2756. return;
  2757. }
  2758. else {
  2759. if (this.forceRun) {
  2760. console.log("randon force");
  2761. this.applyForce(collider);
  2762. }
  2763. }
  2764. if (xGame.common.d2World.isOnSameLine) {
  2765. xGame.common.d2World.isOnSameLine = false;
  2766. this.rigy.linearVelocity = { x: 0, y: 0 };
  2767. }
  2768. if (xGame.common.gameMgr.firstColliObj == null) {
  2769. xGame.common.gameMgr.firstColliObj = collider.owner["mySrc"].number;
  2770. xGame.common.gameMgr.isTouchedBall = true;
  2771. }
  2772. }
  2773. else {
  2774. xGame.common.recoverCameraView();
  2775. let wallStr = "";
  2776. if (speed < 9) { }
  2777. else if (speed < sv2) { }
  2778. else if (speed < sv2 * 6.2)
  2779. wallStr = "wall_30";
  2780. else if (speed < sv2 * 25)
  2781. wallStr = "wall_50";
  2782. else if (speed < sv2 * 56)
  2783. wallStr = "wall_80";
  2784. xGame.soundMgr.playSound(wallStr);
  2785. }
  2786. }
  2787. applyForce(collider) {
  2788. let src = collider.owner.mySrc;
  2789. this.forceVec.x = src.gameObj.x - this.gameObj.x;
  2790. this.forceVec.y = src.gameObj.y - this.gameObj.y;
  2791. Laya.Vector2.normalize(this.forceVec, this.forceVec);
  2792. Laya.Vector2.scale(this.forceVec, 50, this.forceVec);
  2793. src.rigy.applyLinearImpulseToCenter({ x: this.forceVec.x, y: this.forceVec.y });
  2794. }
  2795. checkWrongBall(playEft = true) {
  2796. if (this.isInHole)
  2797. return;
  2798. xGame.common.gameMgr.inHoleBalls.push(this.number);
  2799. if (this.number != 0 && playEft)
  2800. this.d3BallSrc.playInHoleEft();
  2801. let coll = "inpocket_1";
  2802. let speed = this.getSpeed();
  2803. let sv2 = this.speedP10 * this.speedP10 * 0.8;
  2804. if (speed < 9 && this.number != 0)
  2805. coll = "";
  2806. else if (speed < sv2 * 6.2)
  2807. coll = "inpocket_4";
  2808. else if (speed < sv2 * 25)
  2809. coll = "collide_3";
  2810. else if (speed < sv2 * 56)
  2811. coll = "collide_2";
  2812. xGame.soundMgr.playSound(coll);
  2813. this.isInHole = true;
  2814. if (this.number == 0) {
  2815. console.log("白球进了。。");
  2816. this.reset();
  2817. this.rigy.linearVelocity = { x: 0, y: 0 };
  2818. this.hideSelf();
  2819. xGame.common.gameUI.ui.whiteAni.visible = true;
  2820. xGame.common.gameUI.ui.whiteAni.t0.play(Laya.Handler.create(this, () => {
  2821. xGame.common.gameUI.ui.whiteAni.visible = false;
  2822. }));
  2823. }
  2824. else {
  2825. xGame.common.playClassicEmotion(this.number, this.gameObj.x, this.gameObj.y);
  2826. xGame.common.d2World.removeOneBall(this);
  2827. this.destroySelf();
  2828. xGame.common.playHappySound(this.number);
  2829. this.runFlyEft();
  2830. }
  2831. }
  2832. runFlyEft() {
  2833. if (xGame.common.gameMode == GameMode.placeBall && xGame.common.gameMgr.placeBallData.type == PlaceBallType.challenge) {
  2834. xGame.common.playAwardSpine(this.gameObj.x + 100, this.gameObj.y - 100);
  2835. }
  2836. }
  2837. hideSelf() {
  2838. if (this.d3Ball)
  2839. this.d3Ball.active = false;
  2840. }
  2841. showSelf() {
  2842. this.isInHole = false;
  2843. if (this.d3Ball && !this.d3Ball.active)
  2844. this.d3Ball.active = true;
  2845. }
  2846. isStill() {
  2847. let speed = this.rigy.linearVelocity;
  2848. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed) {
  2849. this.rigy.linearVelocity = { x: 0, y: 0 };
  2850. return true;
  2851. }
  2852. return false;
  2853. }
  2854. reset() {
  2855. }
  2856. destroySelf() {
  2857. this.d3BallSrc.destroySelf();
  2858. if (!this.ui.isDisposed) {
  2859. this.ui.removeFromParent();
  2860. this.ui.dispose();
  2861. this.ui = null;
  2862. }
  2863. this.outColli = null;
  2864. this.innerColli = null;
  2865. this.rigy = null;
  2866. this.d3Ball = null;
  2867. this.d3BallSrc = null;
  2868. this.angleV2 = null;
  2869. this.gameObj.destroy(true);
  2870. this.destroy();
  2871. }
  2872. judgeBorder() {
  2873. if (this.forceRun && this.owner == xGame.common.d2World.rootBall.owner) {
  2874. return;
  2875. }
  2876. if (this.destroyed)
  2877. return;
  2878. if (xGame.common.gameMode == GameMode.classic)
  2879. return;
  2880. let isOver = xGame.common.checkBallOverBorder(this.gameObj.x, this.gameObj.y);
  2881. if (isOver) {
  2882. this.checkWrongBall();
  2883. }
  2884. }
  2885. onClick(e, force = false) {
  2886. if (this.number == 0)
  2887. return;
  2888. if (force) {
  2889. }
  2890. else {
  2891. if (xGame.common.d2World.openCheckStill)
  2892. return;
  2893. if (!xGame.common.gameMgr.selfTurn) {
  2894. return;
  2895. }
  2896. }
  2897. if (!xGame.common.gameMgr.finishOneShoot)
  2898. return;
  2899. let root = xGame.common.d2World.rootBall.gameObj;
  2900. let x = this.gameObj.x - root.x;
  2901. let y = this.gameObj.y - root.y;
  2902. let angle = xGame.common.getfguiRotation(x, y);
  2903. xGame.common.d2World.d2Gan.ui.rotation = angle;
  2904. xGame.common.d2World.getHelpLine();
  2905. xGame.common.clickedBall = true;
  2906. this.checkGuide();
  2907. }
  2908. checkGuide() {
  2909. let guide = DataMgr.getSkillGuide();
  2910. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) {
  2911. xGame.common.guideStep++;
  2912. xGame.common.gameUI.ui.guide1.visible = false;
  2913. xGame.common.gameUI.ui.guide2.visible = true;
  2914. }
  2915. }
  2916. checkDistance(disX, disY, angle) {
  2917. let diameter = this.gameObj.width - 1;
  2918. let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2);
  2919. if (!this.lastDis)
  2920. this.lastDis = dis;
  2921. else {
  2922. if (dis > this.lastDis) {
  2923. this.helpOut.type = "remove";
  2924. return this.helpOut;
  2925. }
  2926. }
  2927. if (dis <= Math.pow(diameter, 2)) {
  2928. let del = 0.01;
  2929. let offest = 0;
  2930. let realX = disX - this.gameObj.x;
  2931. let realY = disY - this.gameObj.y;
  2932. while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) {
  2933. offest += del;
  2934. realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180);
  2935. realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180);
  2936. }
  2937. this.helpOut.type = "ok";
  2938. this.helpOut.x = realX + this.gameObj.x;
  2939. this.helpOut.y = realY + this.gameObj.y;
  2940. return this.helpOut;
  2941. }
  2942. else {
  2943. this.helpOut.type = "no";
  2944. return this.helpOut;
  2945. }
  2946. }
  2947. clearBallEft() {
  2948. this.clearBallRightEft();
  2949. this.clearBallWrongEft();
  2950. }
  2951. clearBallRightEft() {
  2952. this.ui.breathAni.stop();
  2953. this.ui.rightTips.visible = false;
  2954. }
  2955. clearBallWrongEft() {
  2956. this.ui.wrongTips.visible = false;
  2957. }
  2958. showWrongEft() {
  2959. if (!xGame.common.gameMgr.selfTurn)
  2960. return;
  2961. this.ui.wrongTips.visible = true;
  2962. }
  2963. showRightEft() {
  2964. if (!xGame.common.gameMgr.selfTurn)
  2965. return;
  2966. this.ui.rightTips.visible = true;
  2967. this.ui.rightTips.scaleX = 1;
  2968. this.ui.rightTips.scaleY = 1;
  2969. this.ui.breathAni.play();
  2970. }
  2971. setBallFunc(type, owner) {
  2972. if (type == "ice") {
  2973. this.ballFunc = type;
  2974. this.d3BallSrc.setAlbedoTexture(true);
  2975. this.rigy.type = "static";
  2976. this.iceOwner = owner;
  2977. }
  2978. else {
  2979. if (owner == this.iceOwner) {
  2980. this.ballFunc = type;
  2981. this.d3BallSrc.setAlbedoTexture(false);
  2982. this.rigy.type = "dynamic";
  2983. }
  2984. }
  2985. }
  2986. }
  2987. D2BallSrc._unid = 0;
  2988. class D2RootBallSrc extends D2BallSrc {
  2989. constructor() {
  2990. super();
  2991. this.maxSpeed = 0;
  2992. this.classicMaxSpeed = 2.2;
  2993. this.bigSkillMaxSpeed = 4;
  2994. this.angle = 0;
  2995. this.allPercent = 0;
  2996. this.linearPercent = 0;
  2997. this.anglePercent = 0;
  2998. this.maxAngleRate = 0.6;
  2999. this.baseRot = 7;
  3000. this.angleMax = 0;
  3001. this.speed = new Laya.Vector2();
  3002. this.rotSpeed = new Laya.Vector2();
  3003. }
  3004. isStill() {
  3005. let speed = this.rigy.linearVelocity;
  3006. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) {
  3007. if (this.anglePercent <= 0.1) {
  3008. this.rigy.linearVelocity = { x: 0, y: 0 };
  3009. return true;
  3010. }
  3011. }
  3012. return false;
  3013. }
  3014. reset() {
  3015. this.linearPercent = 0;
  3016. this.anglePercent = 0;
  3017. }
  3018. setSpeed(percent, angle) {
  3019. this.allPercent = percent;
  3020. this.angle = angle;
  3021. this.setAngleSpeed();
  3022. this.setLinearSpeed();
  3023. let hit = "hit";
  3024. if (percent < 25)
  3025. hit = "hit03";
  3026. else if (percent < 50)
  3027. hit = "hit02";
  3028. else if (percent < 75)
  3029. hit = "hit01";
  3030. xGame.soundMgr.playSound(hit);
  3031. }
  3032. setAngleSpeed() {
  3033. let offest = xGame.common.rodOffest;
  3034. let radius = 82;
  3035. let rate = Math.abs(offest.y / radius) * 0.5;
  3036. if (offest.y > 0)
  3037. this.angleMax = -this.baseRot * 2;
  3038. else
  3039. this.angleMax = this.baseRot;
  3040. this.rotY = -offest.x / radius * 100;
  3041. this.anglePercent = this.maxAngleRate * rate * this.allPercent;
  3042. this.linearPercent = this.allPercent - this.anglePercent;
  3043. }
  3044. setLinearSpeed() {
  3045. if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) {
  3046. if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) {
  3047. if (!xGame.common.longHelpLine) {
  3048. let offset = -150 + xGame.common.randomNum(0, 300);
  3049. offset /= 100;
  3050. this.angle += offset;
  3051. }
  3052. }
  3053. }
  3054. let sin = Math.sin(this.angle * Math.PI / 180);
  3055. let cos = Math.cos(this.angle * Math.PI / 180);
  3056. switch (xGame.common.gameMode) {
  3057. case GameMode.classic:
  3058. this.maxSpeed = this.classicMaxSpeed;
  3059. break;
  3060. case GameMode.bigMove:
  3061. this.maxSpeed = this.bigSkillMaxSpeed;
  3062. break;
  3063. case GameMode.placeBall:
  3064. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  3065. if (data.type == 1) {
  3066. this.maxSpeed = this.bigSkillMaxSpeed;
  3067. }
  3068. else {
  3069. this.maxSpeed = this.classicMaxSpeed;
  3070. }
  3071. break;
  3072. default:
  3073. break;
  3074. }
  3075. this.speed.x = this.maxSpeed * this.linearPercent * sin;
  3076. this.speed.y = -this.maxSpeed * this.linearPercent * cos;
  3077. this.rotSpeed.x = -this.angleMax * sin * this.anglePercent;
  3078. this.rotSpeed.y = this.angleMax * cos * this.anglePercent;
  3079. this.rigy.applyLinearImpulseToCenter(this.speed);
  3080. }
  3081. onUpdate() {
  3082. if (this.anglePercent > 0.1) {
  3083. this.anglePercent *= 0.97;
  3084. this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent;
  3085. this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent;
  3086. this.rigy.applyForceToCenter(this.rotSpeed);
  3087. Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed);
  3088. Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed);
  3089. let num = Laya.Vector2.dot(this.speed, this.rotSpeed);
  3090. if (num > 0.9)
  3091. this.canRot = true;
  3092. }
  3093. else
  3094. this.canRot = true;
  3095. if (Math.abs(this.rotY) > 0.1)
  3096. this.rotY *= 0.98;
  3097. super.onUpdate();
  3098. }
  3099. destroySelf() {
  3100. super.destroySelf();
  3101. this.speed = null;
  3102. }
  3103. }
  3104. class D2Ball extends Laya.Sprite {
  3105. constructor(isRootBall = false) {
  3106. super();
  3107. this.ui = ui_D2Ball.createInstance();
  3108. this.pivotX = this.ui.width / 2;
  3109. this.pivotY = this.ui.width / 2;
  3110. this.x = 0;
  3111. this.y = 0;
  3112. this.addChild(this.ui.displayObject);
  3113. this.ui.displayObject.x += this.ui.width / 2;
  3114. this.ui.displayObject.y += this.ui.width / 2;
  3115. if (isRootBall) {
  3116. this.d2Src = this.addComponent(D2RootBallSrc);
  3117. }
  3118. else {
  3119. this.d2Src = this.addComponent(D2BallSrc);
  3120. }
  3121. this.d2Src.ui = this.ui;
  3122. this.addCircleCollider();
  3123. this.addInnerCircleCollider();
  3124. this.addRigyBody();
  3125. }
  3126. addCircleCollider() {
  3127. let colli = xGame.common.getCollider("circle");
  3128. colli.radius = this.ui.width / 2;
  3129. this.addComponentIntance(colli);
  3130. this.d2Src.outColli = colli;
  3131. colli.label = "ball";
  3132. }
  3133. addInnerCircleCollider() {
  3134. let colli = xGame.common.getCollider("circle");
  3135. colli.radius = this.ui.inner.width / 2;
  3136. colli.x = (this.ui.width - this.ui.inner.width) / 2;
  3137. colli.y = (this.ui.width - this.ui.inner.width) / 2;
  3138. this.addComponentIntance(colli);
  3139. this.d2Src.innerColli = colli;
  3140. colli.label = "inner";
  3141. }
  3142. addRigyBody() {
  3143. let rigy = xGame.common.getRigbody();
  3144. rigy.type = "dynamic";
  3145. this.addComponentIntance(rigy);
  3146. this.d2Src.rigy = rigy;
  3147. }
  3148. disposeSelf() {
  3149. if (!this.ui.isDisposed) {
  3150. this.ui.dispose();
  3151. this.ui.removeFromParent();
  3152. this.ui = null;
  3153. }
  3154. }
  3155. }
  3156. class ui_D2Gan extends fgui.GComponent {
  3157. static createInstance() {
  3158. return (fgui.UIPackage.createObject("game", "D2Gan"));
  3159. }
  3160. onConstruct() {
  3161. this.myIcon = (this.getChild("myIcon"));
  3162. this.selfRodIcon = (this.getChild("selfRodIcon"));
  3163. this.selfEftRoot = (this.getChild("selfEftRoot"));
  3164. this.self = (this.getChild("self"));
  3165. this.aiRodIcon = (this.getChild("aiRodIcon"));
  3166. this.aiEftRoot = (this.getChild("aiEftRoot"));
  3167. this.ai = (this.getChild("ai"));
  3168. }
  3169. }
  3170. ui_D2Gan.URL = "ui://isxx5ak7sdh33qp";
  3171. class D2Gan {
  3172. constructor() {
  3173. this.offset = 0.15;
  3174. this.cell = 1.5;
  3175. this.onBallCell = 0.4;
  3176. this.lastInfo = { x: 0, y: 0, rotation: 0 };
  3177. this.moveNum = 70;
  3178. this.rulerRate = 0.1;
  3179. this.ui = ui_D2Gan.createInstance();
  3180. this.changeSelfRod();
  3181. this.changeAIRod();
  3182. }
  3183. changeSelfRod() {
  3184. let index = DataMgr.getCurBallRod();
  3185. let data = cfgTable.ballrodData[index + 1];
  3186. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3187. this.selfMySpine && this.selfMySpine.dispose();
  3188. this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3189. if (data.spine) {
  3190. this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3191. this.selfMySpine = new SpineMgr(data.spine, () => {
  3192. let xx = this.ui.selfEftRoot.width / 2;
  3193. let yy = this.ui.selfEftRoot.height / 2;
  3194. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3195. let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject);
  3196. outSpine.rotation = -90;
  3197. });
  3198. }
  3199. }
  3200. changeAIRod() {
  3201. let length = Object.keys(cfgTable.ballrodData).length;
  3202. let rand = Math.floor(length * Math.random()) + 1;
  3203. let data = cfgTable.ballrodData[rand];
  3204. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3205. this.aiMySpine && this.aiMySpine.dispose();
  3206. this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3207. if (data.spine) {
  3208. this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3209. this.aiMySpine = new SpineMgr(data.spine, () => {
  3210. let xx = this.ui.aiEftRoot.width / 2;
  3211. let yy = this.ui.aiEftRoot.height / 2;
  3212. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3213. let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject);
  3214. outSpine.rotation = -90;
  3215. });
  3216. }
  3217. }
  3218. setGanLastInfo() {
  3219. this.lastInfo.rotation = this.ui.rotation;
  3220. this.lastInfo.x = this.ui.x;
  3221. this.lastInfo.y = this.ui.y;
  3222. }
  3223. rotateSelf(flag, isRuler = false) {
  3224. let angle;
  3225. flag = flag * this.offset;
  3226. if (xGame.common.d2World.isHelpLineOnBall) {
  3227. angle = flag * this.onBallCell;
  3228. }
  3229. else {
  3230. angle = flag * this.cell;
  3231. }
  3232. if (isRuler) {
  3233. angle *= this.rulerRate;
  3234. }
  3235. this.ui.rotation += angle;
  3236. xGame.common.d2World.getHelpLine();
  3237. }
  3238. checkDistance() {
  3239. let target = xGame.common.d2World.targetBall;
  3240. let root = xGame.common.d2World.rootBall;
  3241. if (target == null) {
  3242. return 1;
  3243. }
  3244. let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2);
  3245. if (dis <= 2500) {
  3246. return 5;
  3247. }
  3248. return 1;
  3249. }
  3250. rotDest(rot) {
  3251. this.ui.rotation = rot;
  3252. xGame.common.d2World.getHelpLine();
  3253. }
  3254. storagePower(powerNum) {
  3255. let pos = (powerNum / 100) * this.moveNum;
  3256. let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos;
  3257. let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos;
  3258. this.ui.x = this.lastInfo.x + xx;
  3259. this.ui.y = this.lastInfo.y + yy;
  3260. }
  3261. shoot() {
  3262. this.storagePower(0);
  3263. this.ui.visible = false;
  3264. }
  3265. destroySelf() {
  3266. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3267. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3268. this.selfMySpine && this.selfMySpine.dispose();
  3269. this.aiMySpine && this.aiMySpine.dispose();
  3270. this.lastInfo = null;
  3271. if (!this.ui.isDisposed) {
  3272. this.ui.removeFromParent();
  3273. this.ui.dispose();
  3274. }
  3275. }
  3276. }
  3277. class ui_HelpLine extends fgui.GComponent {
  3278. static createInstance() {
  3279. return (fgui.UIPackage.createObject("game", "HelpLine"));
  3280. }
  3281. onConstruct() {
  3282. this.n10 = (this.getChild("n10"));
  3283. this.rect = (this.getChild("rect"));
  3284. this.dir11 = (this.getChild("dir11"));
  3285. this.dir = (this.getChild("dir"));
  3286. this.rootDir = (this.getChild("rootDir"));
  3287. this.dirDot = (this.getChild("dirDot"));
  3288. }
  3289. }
  3290. ui_HelpLine.URL = "ui://isxx5ak7sdh33qs";
  3291. class D2HelpLine {
  3292. constructor() {
  3293. this.starX = 0;
  3294. this.starY = 0;
  3295. this.ui = ui_HelpLine.createInstance();
  3296. xGame.common.gameUI.ui.ballNode.addChild(this.ui);
  3297. this.starX = this.ui.rect.x;
  3298. this.starY = this.ui.rect.y;
  3299. }
  3300. shoot() {
  3301. this.ui.visible = false;
  3302. }
  3303. destroySelf() {
  3304. if (this.ui.isDisposed) {
  3305. this.ui.removeFromParent();
  3306. this.ui.dispose();
  3307. }
  3308. }
  3309. }
  3310. class D2World extends Laya.Script {
  3311. constructor() {
  3312. super();
  3313. this.ballArr = [];
  3314. this.openCheckStill = false;
  3315. this.checkArr = [];
  3316. this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 };
  3317. this.isHelpLineOnBall = false;
  3318. this.isOnSameLine = false;
  3319. this.reflectAngle = 0;
  3320. this.powerPercent = 0;
  3321. this.inHolesSpeed = [];
  3322. this.outDir = new Laya.Vector2();
  3323. this.rootDir = new Laya.Vector2();
  3324. this.aiLv = 0;
  3325. this.rootPos = new Laya.Vector2();
  3326. this.tempDir1 = new Laya.Vector2();
  3327. this.tempDir2 = new Laya.Vector2();
  3328. this.tempDir3 = new Laya.Vector2();
  3329. this.ballSize = 33;
  3330. this.destRot = 0;
  3331. }
  3332. initSelf() {
  3333. this.createBalls();
  3334. xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop);
  3335. xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop);
  3336. xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot);
  3337. xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot);
  3338. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  3339. }
  3340. setBorderRect() {
  3341. let ui = xGame.common.gameUI.ui;
  3342. let starX = ui.border.bar5.x + ui.border.bar5.width / 2;
  3343. let starY = ui.border.bar1.y + ui.border.bar1.height / 2;
  3344. let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width);
  3345. let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height);
  3346. this.borderRect.x = starX;
  3347. this.borderRect.y = starY;
  3348. this.borderRect.width = width;
  3349. this.borderRect.height = height;
  3350. }
  3351. resetGame() {
  3352. this.openCheckStill = false;
  3353. let temp;
  3354. for (let index = 0; index < this.ballArr.length; index++) {
  3355. temp = this.ballArr[index];
  3356. temp.destroySelf();
  3357. }
  3358. xGame.common.d3World.ballRoot.destroyChildren();
  3359. xGame.common.gameUI.ui.ballNode.removeChildren();
  3360. console.log("进入摧毁逻辑");
  3361. this.d2Gan.destroySelf();
  3362. this.d2HelpLine.destroySelf();
  3363. this.ballArr = [];
  3364. }
  3365. setD2Gan() {
  3366. let ballNode = this.rootBall.ui;
  3367. let d2Gan = new D2Gan();
  3368. this.d2Gan = d2Gan;
  3369. let ganNode = d2Gan.ui;
  3370. ballNode.addChild(ganNode);
  3371. ganNode.pivotX = ganNode.pivotX;
  3372. ganNode.pivotY = ganNode.pivotY;
  3373. ganNode.x = ganNode.myIcon.width / 2;
  3374. ganNode.y = this.rootBall.gameObj.width;
  3375. d2Gan.setGanLastInfo();
  3376. }
  3377. setHelpLine() {
  3378. let d2Help = new D2HelpLine();
  3379. this.d2HelpLine = d2Help;
  3380. }
  3381. createBalls() {
  3382. let cfg;
  3383. switch (xGame.common.gameMode) {
  3384. case GameMode.classic:
  3385. cfg = xGame.cfgMgr.getRandomClassicLevel();
  3386. break;
  3387. case GameMode.bigMove:
  3388. cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex);
  3389. break;
  3390. case GameMode.placeBall:
  3391. cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel);
  3392. break;
  3393. default:
  3394. break;
  3395. }
  3396. cfg = JSON.parse(JSON.stringify(cfg));
  3397. for (const key in cfg) {
  3398. if (cfg[key].value == 0) {
  3399. this.createRootBall(cfg[key]);
  3400. delete cfg[key];
  3401. break;
  3402. }
  3403. }
  3404. this.createOtherBalls(cfg);
  3405. }
  3406. createRootBall(data) {
  3407. let root = new D2Ball(true);
  3408. xGame.common.gameUI.ui.ballNode.displayObject.addChild(root);
  3409. this.rootBall = root.d2Src;
  3410. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3411. let d3BallSrc = d3Ball.getComponent(Ball);
  3412. xGame.common.d3World.rootBall = d3Ball;
  3413. xGame.common.d3World.rootBallSrc = d3BallSrc;
  3414. let xx = data.x;
  3415. let yy = data.y;
  3416. let numer = data.value;
  3417. xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy);
  3418. this.rootBall.initSelf(numer, xx, yy, d3Ball);
  3419. this.ballArr.push(this.rootBall);
  3420. this.setD2Gan();
  3421. this.setHelpLine();
  3422. }
  3423. createOtherBalls(cfg) {
  3424. let temp;
  3425. let src;
  3426. let data;
  3427. for (const key in cfg) {
  3428. data = cfg[key];
  3429. temp = new D2Ball();
  3430. xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp);
  3431. src = temp.d2Src;
  3432. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3433. src.initSelf(data.value, data.x, data.y, d3Ball);
  3434. this.ballArr.push(src);
  3435. }
  3436. }
  3437. shoot(percent) {
  3438. this.powerPercent = percent;
  3439. this.openCheckStill = true;
  3440. let d2Angle = this.d2Gan.ui.rotation;
  3441. this.rootBall.setSpeed(percent, d2Angle);
  3442. this.clearBallAllEft();
  3443. this.changePlayerView();
  3444. }
  3445. onUpdate() {
  3446. if (!this.openCheckStill)
  3447. return;
  3448. this.checkStill();
  3449. }
  3450. checkStill() {
  3451. for (let index = 0; index < this.ballArr.length; index++) {
  3452. if (!this.ballArr[index].isStill()) {
  3453. return;
  3454. }
  3455. }
  3456. xGame.eventMgr.event(ALL_BALL_STOP);
  3457. }
  3458. allBallStop() {
  3459. this.openCheckStill = false;
  3460. xGame.common.recoverCameraView();
  3461. }
  3462. waitShoot() {
  3463. if (!this.d2Gan.ui.isDisposed) {
  3464. this.d2Gan.ui.visible = true;
  3465. }
  3466. if (!this.d2HelpLine.ui.isDisposed) {
  3467. this.d2HelpLine.ui.visible = true;
  3468. }
  3469. this.clearBallAllEft();
  3470. this.showBallRightEft();
  3471. this.getHelpLine();
  3472. this.inHolesSpeed = [];
  3473. this.selectOneBall();
  3474. }
  3475. _getAllBallArr() {
  3476. let arr = this.ballArr;
  3477. let outArr = [];
  3478. for (let index = 0; index < arr.length; index++) {
  3479. if (arr[index] instanceof D2RootBallSrc)
  3480. continue;
  3481. if (arr[index].ballFunc == "ice")
  3482. continue;
  3483. if (arr[index].destroyed)
  3484. continue;
  3485. outArr.push(arr[index]);
  3486. }
  3487. return outArr;
  3488. }
  3489. _getBlackObj() {
  3490. let arr = this.ballArr;
  3491. for (let index = 0; index < arr.length; index++) {
  3492. if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) {
  3493. return arr[index];
  3494. }
  3495. }
  3496. }
  3497. selectOneBall() {
  3498. let all = this._getAllBallArr();
  3499. let target;
  3500. switch (xGame.common.gameMode) {
  3501. case GameMode.classic:
  3502. if (xGame.common.gameMgr.selfTurn) {
  3503. let self = xGame.common.gameMgr.selfBallArr;
  3504. let black = this._getBlackObj();
  3505. if (xGame.common.gameMgr.ensureBallType) {
  3506. if (self.length > 0) {
  3507. let out = [];
  3508. for (let j = 0; j < all.length; j++) {
  3509. if (self.indexOf(all[j].number) > -1) {
  3510. out.push(all[j]);
  3511. }
  3512. }
  3513. target = this.selectBestEnterOne(out);
  3514. }
  3515. else {
  3516. target = this.selectBestEnterOne([black]);
  3517. }
  3518. }
  3519. else {
  3520. target = this.selectBestEnterOne(all);
  3521. }
  3522. }
  3523. else {
  3524. target = this.selectBestEnterOne(all);
  3525. }
  3526. break;
  3527. case GameMode.bigMove:
  3528. target = this.selectBestEnterOne(all);
  3529. break;
  3530. case GameMode.placeBall:
  3531. if (all.length > 0) {
  3532. target = this.selectBestEnterOne(all);
  3533. }
  3534. break;
  3535. default:
  3536. break;
  3537. }
  3538. if (target && !target.destroyed && target.onClick) {
  3539. target.onClick(0, true);
  3540. let num = -200 + xGame.common.randomNum(0, 400);
  3541. num /= 150;
  3542. if (xGame.common.longHelpLine) {
  3543. num = 0;
  3544. }
  3545. this.destRot += num;
  3546. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  3547. }
  3548. }
  3549. removeOneBall(ball) {
  3550. for (let index = 0; index < this.ballArr.length; index++) {
  3551. if (this.ballArr[index].id == ball.id) {
  3552. this.ballArr.splice(index, 1);
  3553. break;
  3554. }
  3555. }
  3556. }
  3557. getHelpLine() {
  3558. this.d2HelpLine.ui.dirDot.visible = false;
  3559. this.isOnSameLine = false;
  3560. let startX = this.rootBall.gameObj.x;
  3561. let startY = this.rootBall.gameObj.y;
  3562. let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation);
  3563. if (dis == null) {
  3564. this.d2HelpLine.ui.visible = false;
  3565. console.error("辅助线异常");
  3566. return;
  3567. }
  3568. this.d2HelpLine.ui.visible = true;
  3569. let angle = this.d2Gan.ui.rotation;
  3570. let radius = 16.5;
  3571. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3572. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3573. let colliObj = xGame.common.isBlock(startX, startY, disX, disY);
  3574. if (colliObj == null) {
  3575. this.getColliPos(disX, disY, radius, angle);
  3576. xGame.common.d2World.isHelpLineOnBall = false;
  3577. this.targetBall = null;
  3578. this.reflectAngle = 0;
  3579. this.showBallWrongEft();
  3580. }
  3581. else {
  3582. let target = colliObj.src;
  3583. let radius = 16.5;
  3584. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3585. dis1 = Math.sqrt(dis1);
  3586. let realDis = colliObj.disHon - dis1;
  3587. let dir = colliObj.dir;
  3588. let xx = startX + dir.x * realDis;
  3589. let yy = startY + dir.y * realDis;
  3590. this.getColliPos(xx, yy, radius, angle);
  3591. let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180;
  3592. if (Math.abs(reflectAngle - angle) <= 0.02) {
  3593. let offset = xGame.common.rodOffest;
  3594. if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1)
  3595. this.isOnSameLine = true;
  3596. }
  3597. this.getRootDirLine(reflectAngle, angle, xx, yy, target);
  3598. xGame.common.d2World.isHelpLineOnBall = true;
  3599. this.targetBall = target;
  3600. this.reflectAngle = reflectAngle;
  3601. this.showBallWrongEft();
  3602. if (xGame.common.longHelpLine) {
  3603. this.delayReflectLine(target, reflectAngle);
  3604. }
  3605. }
  3606. }
  3607. getBorderDot(startX, startY, angle) {
  3608. let radius = 17;
  3609. let distance;
  3610. let isDone;
  3611. distance = -(this.borderRect.y - startY + radius) / Math.cos(angle * Math.PI / 180);
  3612. isDone = this.judgeUpDown(distance, angle, startX);
  3613. if (isDone != null) {
  3614. return isDone;
  3615. }
  3616. distance = -(this.borderRect.y + this.borderRect.height - startY - radius) / Math.cos(angle * Math.PI / 180);
  3617. isDone = this.judgeUpDown(distance, angle, startX);
  3618. if (isDone != null) {
  3619. return isDone;
  3620. }
  3621. distance = (this.borderRect.x - startX + radius) / Math.sin(angle * Math.PI / 180);
  3622. isDone = this.judgeLeftRight(distance, angle, startY);
  3623. if (isDone != null) {
  3624. return isDone;
  3625. }
  3626. distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180);
  3627. isDone = this.judgeLeftRight(distance, angle, startY);
  3628. if (isDone != null) {
  3629. return isDone;
  3630. }
  3631. }
  3632. judgeUpDown(distance, angle, startX) {
  3633. let flag = Math.sin(angle * Math.PI / 180);
  3634. let temp = startX + distance * Math.sin(angle * Math.PI / 180);
  3635. if (distance >= 0) {
  3636. if (flag > 0) {
  3637. if (temp < this.borderRect.x + this.borderRect.width) {
  3638. return distance;
  3639. }
  3640. }
  3641. else {
  3642. if (temp > this.borderRect.x) {
  3643. return distance;
  3644. }
  3645. }
  3646. }
  3647. }
  3648. judgeLeftRight(distance, angle, starY) {
  3649. let flag = -Math.cos(angle * Math.PI / 180);
  3650. let temp = starY + distance * -Math.cos(angle * Math.PI / 180);
  3651. if (distance >= 0) {
  3652. if (flag > 0) {
  3653. if (temp < this.borderRect.y + this.borderRect.height) {
  3654. return distance;
  3655. }
  3656. }
  3657. else {
  3658. if (temp > this.borderRect.y) {
  3659. return distance;
  3660. }
  3661. }
  3662. }
  3663. }
  3664. clearBallAllEft() {
  3665. let temp;
  3666. for (let index = 0; index < this.ballArr.length; index++) {
  3667. temp = this.ballArr[index];
  3668. temp.clearBallEft();
  3669. }
  3670. }
  3671. showBallRightEft() {
  3672. let gameMgr = xGame.common.gameMgr;
  3673. let temp;
  3674. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3675. if (targetArr.length <= 0)
  3676. return;
  3677. for (let index = 0; index < this.ballArr.length; index++) {
  3678. temp = this.ballArr[index];
  3679. if (targetArr.indexOf(temp.number) > -1) {
  3680. temp.showRightEft();
  3681. }
  3682. }
  3683. }
  3684. showBallWrongEft() {
  3685. let gameMgr = xGame.common.gameMgr;
  3686. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3687. if (targetArr.length <= 0)
  3688. return;
  3689. let temp;
  3690. for (let index = 0; index < this.ballArr.length; index++) {
  3691. temp = this.ballArr[index];
  3692. if (this.targetBall && this.targetBall.number == temp.number) {
  3693. if (targetArr.indexOf(temp.number) <= -1) {
  3694. temp.showWrongEft();
  3695. }
  3696. else {
  3697. temp.clearBallWrongEft();
  3698. }
  3699. }
  3700. else {
  3701. temp.clearBallWrongEft();
  3702. }
  3703. }
  3704. }
  3705. getColliPos(x, y, radius, angle) {
  3706. this.d2HelpLine.ui.x = x;
  3707. this.d2HelpLine.ui.y = y;
  3708. let dirX = x - this.rootBall.gameObj.x;
  3709. let dirY = y - this.rootBall.gameObj.y;
  3710. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3711. if (rectH <= 0)
  3712. rectH = 0;
  3713. this.d2HelpLine.ui.rect.height = 0;
  3714. this.d2HelpLine.ui.rect.height = rectH;
  3715. this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY);
  3716. if (rectH < this.rootBall.gameObj.width) {
  3717. this.d2HelpLine.ui.rect.visible = false;
  3718. }
  3719. else {
  3720. this.d2HelpLine.ui.rect.visible = true;
  3721. }
  3722. this.d2HelpLine.ui.dir.visible = false;
  3723. this.d2HelpLine.ui.rootDir.visible = false;
  3724. }
  3725. getReflectLine(x, y, radius, target) {
  3726. this.d2HelpLine.ui.dir.visible = true;
  3727. let dirX = target.x - x;
  3728. let dirY = target.y - y;
  3729. let angle = xGame.common.getfguiRotation(dirX, dirY) + 180;
  3730. this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX;
  3731. this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY;
  3732. this.d2HelpLine.ui.dir.height = 48;
  3733. this.d2HelpLine.ui.dir.rotation = angle;
  3734. this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180);
  3735. this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180);
  3736. return angle;
  3737. }
  3738. getRootDirLine(angle, rodAngle, xx, yy, target) {
  3739. let rtX = xGame.common.d2World.rootBall.gameObj.x;
  3740. let rtY = xGame.common.d2World.rootBall.gameObj.y;
  3741. let targetX = target.gameObj.x;
  3742. let targetY = target.gameObj.y;
  3743. this.outDir.setValue(targetX - xx, targetY - yy);
  3744. this.rootDir.setValue(rtX - xx, rtY - yy);
  3745. let ver = Math.PI / 2;
  3746. let sin = Math.sin(ver);
  3747. let cos = Math.cos(ver);
  3748. let outX = this.outDir.x * cos - this.outDir.y * sin;
  3749. let outY = this.outDir.x * sin + this.outDir.y * cos;
  3750. this.outDir.setValue(outX, outY);
  3751. Laya.Vector2.normalize(this.rootDir, this.rootDir);
  3752. Laya.Vector2.normalize(this.outDir, this.outDir);
  3753. let result = Laya.Vector2.dot(this.rootDir, this.outDir);
  3754. if (Math.abs(result) <= 0.08) {
  3755. this.d2HelpLine.ui.rootDir.visible = false;
  3756. return;
  3757. }
  3758. if (result > 0) {
  3759. angle += 90;
  3760. }
  3761. else if (result < 0) {
  3762. angle -= 90;
  3763. }
  3764. this.d2HelpLine.ui.rootDir.visible = true;
  3765. this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX;
  3766. this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY;
  3767. this.d2HelpLine.ui.rootDir.rotation = angle;
  3768. }
  3769. delayReflectLine(obj, angle) {
  3770. if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) {
  3771. return;
  3772. }
  3773. this.isOnSameLine = false;
  3774. let startX = obj.gameObj.x;
  3775. let startY = obj.gameObj.y;
  3776. let dis = this.getBorderDot(startX, startY, angle);
  3777. if (dis == null) {
  3778. this.d2HelpLine.ui.dirDot.visible = false;
  3779. return;
  3780. }
  3781. this.d2HelpLine.ui.visible = true;
  3782. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3783. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3784. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, obj);
  3785. if (colliObj == null) {
  3786. this.setDelayLine(disX, disY, obj, angle);
  3787. }
  3788. else {
  3789. let radius = 16;
  3790. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3791. dis1 = Math.sqrt(dis1);
  3792. let realDis = colliObj.disHon - dis1;
  3793. let dir = colliObj.dir;
  3794. let xx = startX + dir.x * realDis;
  3795. let yy = startY + dir.y * realDis;
  3796. this.setDelayLine(xx, yy, obj, angle);
  3797. }
  3798. }
  3799. setDelayLine(x, y, obj, angle) {
  3800. let dirX = x - obj.gameObj.x;
  3801. let dirY = y - obj.gameObj.y;
  3802. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3803. if (rectH <= 0)
  3804. rectH = 0;
  3805. this.d2HelpLine.ui.dir.height = rectH;
  3806. this.d2HelpLine.ui.dirDot.visible = true;
  3807. this.d2HelpLine.ui.dirDot.x = 17;
  3808. this.d2HelpLine.ui.dirDot.y = 17;
  3809. this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180);
  3810. ;
  3811. this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180);
  3812. }
  3813. changePlayerView() {
  3814. if (Math.random() >= 0.7)
  3815. return;
  3816. if (!this.targetBall) {
  3817. return;
  3818. }
  3819. if (!xGame.common.gameMgr.selfTurn)
  3820. return;
  3821. switch (xGame.common.gameMode) {
  3822. case GameMode.classic:
  3823. if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) {
  3824. if (this.targetBall.number != 8) {
  3825. return;
  3826. }
  3827. }
  3828. break;
  3829. case GameMode.bigMove:
  3830. return;
  3831. case GameMode.placeBall:
  3832. break;
  3833. default:
  3834. break;
  3835. }
  3836. let startX = this.targetBall.gameObj.x;
  3837. let startY = this.targetBall.gameObj.y;
  3838. let angle = this.reflectAngle;
  3839. let dis = this.getBorderDot(startX, startY, angle);
  3840. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3841. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3842. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall);
  3843. if (colliObj) {
  3844. return;
  3845. }
  3846. let offset = 40;
  3847. let posObj = xGame.common.gameMgr.posObj;
  3848. let temp;
  3849. let radius;
  3850. let tarX, tarY;
  3851. for (const key in posObj) {
  3852. temp = posObj[key];
  3853. radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5);
  3854. tarX = startX + radius * Math.sin(angle * Math.PI / 180);
  3855. tarY = startY + radius * -Math.cos(angle * Math.PI / 180);
  3856. if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) {
  3857. xGame.common.showOneCamera("angle" + key);
  3858. xGame.common.gameUI.ui.d2Node.alpha = 0;
  3859. Laya.physicsTimer.scale = 0.7;
  3860. break;
  3861. }
  3862. }
  3863. }
  3864. selectBestEnterOne(arr) {
  3865. this.aiLv = xGame.tools.random(1, 11);
  3866. this.aiLv = 10;
  3867. this.wBall = xGame.common.d2World.rootBall;
  3868. this.rootPos.x = this.wBall.gameObj.x;
  3869. this.rootPos.y = this.wBall.gameObj.y;
  3870. this.initHoleBall(arr);
  3871. return this.selectBall();
  3872. }
  3873. selectBall() {
  3874. let ball = null;
  3875. this.destRot = 0;
  3876. let ai = 110 - this.aiLv * 10;
  3877. let mis = xGame.tools.random(-ai, ai) * 0.005;
  3878. let score = false;
  3879. if (this.scoreBall.length < 1) {
  3880. if (this.lineBall.length < 1) {
  3881. for (let i = 0; i < this.kickBall.length; i++) {
  3882. let list = [];
  3883. let bo = this.kickBall[i];
  3884. let bobj = bo.gameObj;
  3885. let rect = xGame.common.d2World.borderRect;
  3886. let mobj = this.wBall.gameObj;
  3887. let minb = bobj.y - rect.y - 20;
  3888. let minw = mobj.y - rect.y - 50;
  3889. if (minb > 0 && minw > 0) {
  3890. let dlenx = 0;
  3891. let dleny = mobj.y - rect.y;
  3892. let spx = mobj.x;
  3893. let spy = rect.y - dleny;
  3894. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3895. }
  3896. minb = rect.y + rect.height - bobj.y - 20;
  3897. minw = rect.y + rect.height - mobj.y - 50;
  3898. if (minb > 0 && minw > 0) {
  3899. let dlenx = 0;
  3900. let dleny = rect.y + rect.height - mobj.y;
  3901. let spx = mobj.x;
  3902. let spy = rect.y + rect.height + dleny;
  3903. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3904. }
  3905. minb = bobj.x - rect.x - 20;
  3906. minw = mobj.x - rect.x - 50;
  3907. if (minb > 0 && minw > 0) {
  3908. let dlenx = mobj.x - rect.x;
  3909. let dleny = 0;
  3910. let spx = rect.x - dlenx;
  3911. let spy = mobj.y;
  3912. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3913. }
  3914. minb = rect.x + rect.width - bobj.x - 20;
  3915. minw = rect.x + rect.width - mobj.x - 50;
  3916. if (minb > 0 && minw > 0) {
  3917. let dlenx = rect.x + rect.width - mobj.x;
  3918. let dleny = 0;
  3919. let spx = rect.x + rect.width + dlenx;
  3920. let spy = mobj.y;
  3921. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3922. }
  3923. list.sort(function (a, b) {
  3924. return a.order - b.order;
  3925. });
  3926. for (let i = 0; i < list.length; i++) {
  3927. let data = list[i];
  3928. let mx = mobj.x - bobj.x;
  3929. let my = mobj.y - bobj.y;
  3930. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  3931. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  3932. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3933. if (num > 1)
  3934. num = 1;
  3935. let cos = Math.acos(num);
  3936. if (cos > 1.57)
  3937. cos = 1.57;
  3938. else if (cos < 0.01)
  3939. cos = 0.01;
  3940. let tan = Math.tan(cos);
  3941. let dx = tan * data.dleny;
  3942. let dy = tan * data.dlenx;
  3943. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  3944. if (Math.abs(bx - 667) < 40)
  3945. continue;
  3946. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  3947. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  3948. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  3949. this.forceMax = dis * 0.08;
  3950. this.destRot += mis * 0.1;
  3951. this.setKick(bx, by);
  3952. return true;
  3953. }
  3954. }
  3955. }
  3956. }
  3957. else {
  3958. ball = xGame.common.getRandArrEle(this.lineBall);
  3959. }
  3960. }
  3961. else {
  3962. for (let i = 0; i < this.scoreBall.length; i++) {
  3963. if (i < this.scoreBall.length - 1) {
  3964. let rand = 70 + this.aiLv * 10 + i * 10;
  3965. if (xGame.tools.random(0, 100) < rand) {
  3966. ball = this.scoreBall[i];
  3967. break;
  3968. }
  3969. }
  3970. else {
  3971. ball = this.scoreBall[i];
  3972. break;
  3973. }
  3974. }
  3975. score = true;
  3976. this.selectNum++;
  3977. }
  3978. if (!ball)
  3979. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  3980. let dx = ball.gameObj.x;
  3981. let dy = ball.gameObj.y;
  3982. let kickAngle = 0;
  3983. if (score) {
  3984. dx = ball.kickPos.x;
  3985. dy = ball.kickPos.y;
  3986. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  3987. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  3988. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  3989. if (adot > 1)
  3990. adot = 1;
  3991. kickAngle = Math.acos(adot) * 57.3;
  3992. if (kickAngle > 45) {
  3993. let kdx = ball.kickPos.x - ball.gameObj.x;
  3994. let kdy = ball.kickPos.y - ball.gameObj.y;
  3995. dx = ball.kickPos.x - kdx * mis * 0.3;
  3996. dy = ball.kickPos.y - kdy * mis * 0.3;
  3997. }
  3998. else
  3999. this.destRot += mis;
  4000. }
  4001. else if (ball.poleAngle != 0) {
  4002. this.destRot += ball.poleAngle;
  4003. }
  4004. if (xGame.common.gameMode == 0) {
  4005. let af = kickAngle * 0.08;
  4006. this.forceMax = ball.hard * 0.1 + af * af;
  4007. }
  4008. this.setKick(dx, dy);
  4009. return ball;
  4010. }
  4011. initHoleBall(arr) {
  4012. this.kickBall = [];
  4013. this.lineBall = [];
  4014. this.scoreBall = [];
  4015. this.holeBall = [];
  4016. this.selectNum = 0;
  4017. this.forceNum = 0;
  4018. this.forceMax = 0;
  4019. this.turnNum = 0;
  4020. let list = arr;
  4021. let holes = xGame.common.gameMgr.holePosList;
  4022. let self = xGame.common.aiPlayer;
  4023. for (let i = 0; i < list.length; i++) {
  4024. let obj = list[i];
  4025. if (!obj)
  4026. continue;
  4027. obj.kickPos.x = 0;
  4028. obj.kickPos.y = 0;
  4029. obj.poleAngle = 0;
  4030. obj.hard = 0;
  4031. obj.borderDis = 0;
  4032. obj.kickAngle = 180;
  4033. let b = obj.gameObj;
  4034. let wbp = this.rootPos;
  4035. let bx = wbp.x - b.x;
  4036. let by = wbp.y - b.y;
  4037. obj.borderDis = xGame.tools.random(0, 100);
  4038. this.kickBall.push(obj);
  4039. if (!this.isLine(wbp, obj))
  4040. continue;
  4041. obj.kickAngle = xGame.tools.random(90, 180);
  4042. obj.kickPos.x = b.x;
  4043. obj.kickPos.y = b.y;
  4044. this.lineBall.push(obj);
  4045. let minDis = 999999;
  4046. let hole = false;
  4047. for (let j = 0; j < holes.length; j++) {
  4048. let hp = holes[j];
  4049. if (bx >= 0 && hp.x > b.x + 100)
  4050. continue;
  4051. if (bx <= 0 && hp.x < b.x - 100)
  4052. continue;
  4053. if (by < -10 && hp.y < wbp.y)
  4054. continue;
  4055. if (by > 10 && hp.y > wbp.y)
  4056. continue;
  4057. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  4058. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  4059. if (dis < minDis) {
  4060. let dx = b.x - this.tempDir1.x * this.ballSize;
  4061. let dy = b.y - this.tempDir1.y * this.ballSize;
  4062. this.tempDir3.x = this.tempDir1.x;
  4063. this.tempDir3.y = this.tempDir1.y;
  4064. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  4065. obj.kickPos.x = dx;
  4066. obj.kickPos.y = dy;
  4067. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  4068. if (num > 1)
  4069. num = 1;
  4070. obj.kickAngle = Math.acos(num) * 57.3;
  4071. if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2)
  4072. dis = dis * 2;
  4073. if (Math.abs(hp.x - 600) < 100)
  4074. dis += 50;
  4075. obj.hard = dis + obj.kickAngle * 3;
  4076. hole = true;
  4077. }
  4078. }
  4079. }
  4080. }
  4081. if (hole) {
  4082. this.scoreBall.push(obj);
  4083. this.holeBall.push(obj);
  4084. }
  4085. }
  4086. this.scoreBall.sort(function (a, b) {
  4087. return a.hard - b.hard;
  4088. });
  4089. this.holeBall.sort(function (a, b) {
  4090. return a.kickAngle - b.kickAngle;
  4091. });
  4092. this.kickBall.sort(function (a, b) {
  4093. return a.borderDis - b.borderDis;
  4094. });
  4095. }
  4096. isBlock(bn, bx, by, hx, hy, dn = -1) {
  4097. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  4098. let balls = xGame.common.d2World.ballArr;
  4099. let max = xGame.tools.getDis(hx, hy, bx, by);
  4100. for (let index = 0; index < balls.length; index++) {
  4101. let obj = balls[index];
  4102. if (obj.number == 0)
  4103. continue;
  4104. if (obj.number == bn || obj.number == dn)
  4105. continue;
  4106. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  4107. if (dis * dis > max)
  4108. continue;
  4109. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  4110. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4111. if (num > 1)
  4112. num = 1;
  4113. if (num < 0)
  4114. continue;
  4115. let gap = Math.sin(Math.acos(num)) * dis;
  4116. if (gap < this.ballSize)
  4117. return true;
  4118. }
  4119. return false;
  4120. }
  4121. isLine(xy, ball) {
  4122. let bx = xy.x;
  4123. let by = xy.y;
  4124. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  4125. let dis = ball.getDestDis(xy);
  4126. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  4127. let sin = Math.sin(angle);
  4128. let cos = Math.cos(angle);
  4129. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4130. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4131. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4132. let dx = bx + this.tempDir2.x * dis;
  4133. let dy = by + this.tempDir2.y * dis;
  4134. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  4135. sin = Math.sin(-angle);
  4136. cos = Math.cos(-angle);
  4137. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4138. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4139. dx = bx + this.tempDir2.x * dis;
  4140. dy = by + this.tempDir2.y * dis;
  4141. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  4142. if (isr && isl)
  4143. return false;
  4144. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  4145. }
  4146. return true;
  4147. }
  4148. setKick(dx, dy) {
  4149. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  4150. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4151. this.tempDir1.x = 0;
  4152. this.tempDir1.y = 1;
  4153. this.tempDir2.y = -this.tempDir2.y;
  4154. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4155. if (num > 1)
  4156. num = 1;
  4157. let rot = Math.acos(num) * 57.3;
  4158. if (this.tempDir2.x < 0)
  4159. rot = 360 - rot;
  4160. this.destRot += rot;
  4161. }
  4162. }
  4163. class ui_UIGame extends fgui.GComponent {
  4164. static createInstance() {
  4165. return (fgui.UIPackage.createObject("game", "UIGame"));
  4166. }
  4167. onConstruct() {
  4168. this.c1 = this.getController("c1");
  4169. this.d3Root = (this.getChild("d3Root"));
  4170. this.clickNode = (this.getChild("clickNode"));
  4171. this.d2Root = (this.getChild("d2Root"));
  4172. this.topNode = (this.getChild("topNode"));
  4173. this.n72 = (this.getChild("n72"));
  4174. this.n40 = (this.getChild("n40"));
  4175. this.rulerNode = (this.getChild("rulerNode"));
  4176. this.rulerClickNode = (this.getChild("rulerClickNode"));
  4177. this.n50 = (this.getChild("n50"));
  4178. this.keduNode = (this.getChild("keduNode"));
  4179. this.powerTxt = (this.getChild("powerTxt"));
  4180. this.powerNode = (this.getChild("powerNode"));
  4181. this.colorNode = (this.getChild("colorNode"));
  4182. this.powerEft = (this.getChild("powerEft"));
  4183. this.myPowerNode = (this.getChild("myPowerNode"));
  4184. this.ganNode = (this.getChild("ganNode"));
  4185. this.rodMethodNode = (this.getChild("rodMethodNode"));
  4186. this.placeChallengeNode = (this.getChild("placeChallengeNode"));
  4187. this.placeNormalNode = (this.getChild("placeNormalNode"));
  4188. this.skillRod = (this.getChild("skillRod"));
  4189. this.border = (this.getChild("border"));
  4190. this.bigSkillNode = (this.getChild("bigSkillNode"));
  4191. this.classicWorldsNode = (this.getChild("classicWorldsNode"));
  4192. this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode"));
  4193. this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode"));
  4194. this.awardSpineNode = (this.getChild("awardSpineNode"));
  4195. this.guanyuNode = (this.getChild("guanyuNode"));
  4196. this.helpBtn = (this.getChild("helpBtn"));
  4197. this.wordsBtn = (this.getChild("wordsBtn"));
  4198. this.aiWordsBtn = (this.getChild("aiWordsBtn"));
  4199. this.returnBtn = (this.getChild("returnBtn"));
  4200. this.ballNode = (this.getChild("ballNode"));
  4201. this.whiteAni = (this.getChild("whiteAni"));
  4202. this.blackAni = (this.getChild("blackAni"));
  4203. this.selfTurn = (this.getChild("selfTurn"));
  4204. this.aiTurn = (this.getChild("aiTurn"));
  4205. this.deskNode = (this.getChild("deskNode"));
  4206. this.moveNode = (this.getChild("moveNode"));
  4207. this.selfTalk = (this.getChild("selfTalk"));
  4208. this.aiTalk = (this.getChild("aiTalk"));
  4209. this.d2Node = (this.getChild("d2Node"));
  4210. this.snowNode = (this.getChild("snowNode"));
  4211. this.guide2 = (this.getChild("guide2"));
  4212. this.guide1 = (this.getChild("guide1"));
  4213. this.guide3 = (this.getChild("guide3"));
  4214. this.guideNode = (this.getChild("guideNode"));
  4215. }
  4216. }
  4217. ui_UIGame.URL = "ui://isxx5ak7kt443qg";
  4218. class ui_UIGameEnd extends fgui.GComponent {
  4219. static createInstance() {
  4220. return (fgui.UIPackage.createObject("game", "UIGameEnd"));
  4221. }
  4222. onConstruct() {
  4223. this.c1 = this.getController("c1");
  4224. this.n22 = (this.getChild("n22"));
  4225. this.n2 = (this.getChild("n2"));
  4226. this.n52 = (this.getChild("n52"));
  4227. this.n53 = (this.getChild("n53"));
  4228. this.coinNode = (this.getChild("coinNode"));
  4229. this.closeNode = (this.getChild("closeNode"));
  4230. this.moneyNode = (this.getChild("moneyNode"));
  4231. this.secretary = (this.getChild("secretary"));
  4232. this.n27 = (this.getChild("n27"));
  4233. this.n29 = (this.getChild("n29"));
  4234. this.talkNode = (this.getChild("talkNode"));
  4235. this.n38 = (this.getChild("n38"));
  4236. this.n39 = (this.getChild("n39"));
  4237. this.n40 = (this.getChild("n40"));
  4238. this.awardNode = (this.getChild("awardNode"));
  4239. this.starNumNode = (this.getChild("starNumNode"));
  4240. this.n47 = (this.getChild("n47"));
  4241. this.conditionNode = (this.getChild("conditionNode"));
  4242. this.isGetAward = (this.getChild("isGetAward"));
  4243. this.leftBtn = (this.getChild("leftBtn"));
  4244. this.rightBtn = (this.getChild("rightBtn"));
  4245. this.btnNode = (this.getChild("btnNode"));
  4246. }
  4247. }
  4248. ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3";
  4249. class ui_UIAddCoin extends fgui.GComponent {
  4250. static createInstance() {
  4251. return (fgui.UIPackage.createObject("game", "UIAddCoin"));
  4252. }
  4253. onConstruct() {
  4254. this.n11 = (this.getChild("n11"));
  4255. this.myNode = (this.getChild("myNode"));
  4256. this.t0 = this.getTransition("t0");
  4257. }
  4258. }
  4259. ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs";
  4260. class UIAddCoin extends UIBase {
  4261. constructor() {
  4262. super();
  4263. this.coinNum = 2000;
  4264. }
  4265. onConstructor() {
  4266. this.ui = ui_UIAddCoin.createInstance();
  4267. this.contentPane = this.ui;
  4268. this.isEject = false;
  4269. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4270. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  4271. }
  4272. show() {
  4273. super.show();
  4274. this.ui.t0.play();
  4275. }
  4276. videoAddCoin() {
  4277. console.log('zh:qjff_AD_for_UIAddCoin');
  4278. if (Laya.Browser.onAndroid) {
  4279. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  4280. if (!boo) {
  4281. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  4282. return;
  4283. }
  4284. }
  4285. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  4286. }
  4287. else {
  4288. console.log('zh:AD 失败,直接发放奖励');
  4289. this.qjff_AD_for_UIAddCoin();
  4290. }
  4291. }
  4292. qjff_AD_for_UIAddCoin() {
  4293. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  4294. this.hide();
  4295. }
  4296. }
  4297. UIAddCoin.uiName = "UIAddCoin";
  4298. class ui_UIInvitation extends fgui.GComponent {
  4299. static createInstance() {
  4300. return (fgui.UIPackage.createObject("game", "UIInvitation"));
  4301. }
  4302. onConstruct() {
  4303. this.n14 = (this.getChild("n14"));
  4304. this.myNode = (this.getChild("myNode"));
  4305. this.t0 = this.getTransition("t0");
  4306. }
  4307. }
  4308. ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r";
  4309. class UIInvitation extends UIBase {
  4310. constructor() {
  4311. super();
  4312. }
  4313. onConstructor() {
  4314. this.ui = ui_UIInvitation.createInstance();
  4315. this.contentPane = this.ui;
  4316. this.isEject = false;
  4317. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  4318. }
  4319. show() {
  4320. super.show();
  4321. }
  4322. enterGame() {
  4323. xGame.common.gameMode = GameMode.classic;
  4324. DataMgr.setChallengeTimes(1);
  4325. xGame.common.passAwardCoin = 2000;
  4326. let need = xGame.common.classicNiceNeddCoin;
  4327. if (DataMgr.coinEnough(need)) {
  4328. DataMgr.setCoin(-need);
  4329. xGame.eventMgr.event(RESTART_GAME, true);
  4330. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  4331. }
  4332. else {
  4333. xGame.eventMgr.event(RESTART_GAME, true);
  4334. }
  4335. this.hide();
  4336. }
  4337. hide() {
  4338. super.hide();
  4339. }
  4340. }
  4341. UIInvitation.uiName = "UIInvitation";
  4342. class ui_UIMain extends fgui.GComponent {
  4343. static createInstance() {
  4344. return (fgui.UIPackage.createObject("game", "UIMain"));
  4345. }
  4346. onConstruct() {
  4347. this.n47 = (this.getChild("n47"));
  4348. this.n10 = (this.getChild("n10"));
  4349. this.secretary = (this.getChild("secretary"));
  4350. this.shopBtn = (this.getChild("shopBtn"));
  4351. this.moneyNode = (this.getChild("moneyNode"));
  4352. this.headNode = (this.getChild("headNode"));
  4353. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4354. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4355. this.classicBtn = (this.getChild("classicBtn"));
  4356. this.globalBtn = (this.getChild("globalBtn"));
  4357. this.n44 = (this.getChild("n44"));
  4358. this.signBtn = (this.getChild("signBtn"));
  4359. this.drawBtn = (this.getChild("drawBtn"));
  4360. this.settingNode = (this.getChild("settingNode"));
  4361. this.n45 = (this.getChild("n45"));
  4362. this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
  4363. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4364. this.rankBtn = (this.getChild("rankBtn"));
  4365. this.n46 = (this.getChild("n46"));
  4366. this.liucheng1 = (this.getChild("liucheng1"));
  4367. this.rightBtn = (this.getChild("rightBtn"));
  4368. this.n75 = (this.getChild("n75"));
  4369. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4370. this.liucheng2 = (this.getChild("liucheng2"));
  4371. this.guideBtn = (this.getChild("guideBtn"));
  4372. this.n73 = (this.getChild("n73"));
  4373. this.wordsNode = (this.getChild("wordsNode"));
  4374. this.enterGuide = (this.getChild("enterGuide"));
  4375. this.talkNode = (this.getChild("talkNode"));
  4376. this.n83 = (this.getChild("n83"));
  4377. this.n84 = (this.getChild("n84"));
  4378. this.n_Logout = (this.getChild("n_Logout"));
  4379. this.n_zhuCe = (this.getChild("n_zhuCe"));
  4380. this.n_dengLu = (this.getChild("n_dengLu"));
  4381. }
  4382. }
  4383. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4384. class ui_UIMoyu extends fgui.GComponent {
  4385. static createInstance() {
  4386. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4387. }
  4388. onConstruct() {
  4389. this.ageTip = (this.getChild("ageTip"));
  4390. this.mainBg = (this.getChild("mainBg"));
  4391. this.xyNode = (this.getChild("xyNode"));
  4392. this.rnNode = (this.getChild("rnNode"));
  4393. this.fcmNode = (this.getChild("fcmNode"));
  4394. this.ageNode = (this.getChild("ageNode"));
  4395. this.tipNode = (this.getChild("tipNode"));
  4396. this.msgNode = (this.getChild("msgNode"));
  4397. }
  4398. }
  4399. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4400. class MoyuMgr {
  4401. static initMoyu() {
  4402. this.moyuView = new MoyuView();
  4403. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4404. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4405. this.moyuView.ui.displayObject.zOrder = 1000;
  4406. this.moyuView.init();
  4407. this.moyuView.showTip(true);
  4408. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4409. window['XApk'] = this;
  4410. }
  4411. static showAge(show) {
  4412. if (this.moyuView)
  4413. this.moyuView.showAge(show);
  4414. }
  4415. static onPlatMsg(idx) {
  4416. if (!MoyuMgr.moyuView)
  4417. return;
  4418. if (idx == '0') {
  4419. MoyuMgr.moyuView.showTip(false);
  4420. }
  4421. }
  4422. static showAgree(call) {
  4423. if (this.moyuView)
  4424. this.moyuView.showAgree(call);
  4425. else
  4426. call && call();
  4427. }
  4428. static showXy(type = 1) {
  4429. if (this.moyuView)
  4430. this.moyuView.showXy(type);
  4431. }
  4432. }
  4433. MoyuMgr.isAdvise = false;
  4434. class MoyuView {
  4435. constructor() {
  4436. this.ysxyNum = 1;
  4437. this.ysJson = null;
  4438. this.ui = ui_UIMoyu.createInstance();
  4439. }
  4440. init() {
  4441. this.ui.mainBg.visible = false;
  4442. this.ui.xyNode.visible = false;
  4443. this.ui.ageNode.visible = false;
  4444. this.ui.tipNode.visible = false;
  4445. this.ui.rnNode.visible = false;
  4446. this.ui.fcmNode.visible = false;
  4447. this.ui.ageTip.visible = false;
  4448. this.ui.msgNode.visible = false;
  4449. this.ui.visible = false;
  4450. this.ui.xyNode.xyList.setVirtual();
  4451. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4452. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4453. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4454. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4455. this.ui.xyNode.btnKnown.visible = false;
  4456. this.ui.xyNode.xy1.visible = false;
  4457. this.ui.xyNode.xy2.visible = false;
  4458. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4459. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4460. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4461. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4462. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4463. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4464. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4465. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4466. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4467. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4468. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4469. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4470. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4471. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4472. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4473. this.ysxyNum = 2;
  4474. }
  4475. }
  4476. onClick(obj) {
  4477. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4478. switch (obj) {
  4479. case this.ui.ageTip:
  4480. if (Moyu.isTTApk) {
  4481. this.ui.ageNode.visible = true;
  4482. this.ui.mainBg.visible = true;
  4483. }
  4484. break;
  4485. case this.ui.tipNode:
  4486. this.showTip(false);
  4487. break;
  4488. case this.ui.ageNode.btnAge:
  4489. this.ui.ageNode.visible = false;
  4490. this.ui.mainBg.visible = false;
  4491. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4492. this.ui.visible = false;
  4493. break;
  4494. case this.ui.xyNode.btnXy3:
  4495. case this.ui.xyNode.btnXy1:
  4496. this.loadXy(1);
  4497. break;
  4498. case this.ui.xyNode.btnXy2:
  4499. this.loadXy(2);
  4500. break;
  4501. case this.ui.xyNode.btnBack:
  4502. this.ui.xyNode.xy1.visible = true;
  4503. this.ui.xyNode.xy2.visible = false;
  4504. break;
  4505. case this.ui.xyNode.btnKnown:
  4506. this.ui.xyNode.visible = false;
  4507. this.ui.mainBg.visible = false;
  4508. this.ui.visible = false;
  4509. break;
  4510. case this.ui.rnNode.btnCheck:
  4511. this.check();
  4512. break;
  4513. case this.ui.rnNode.btnExit:
  4514. case this.ui.xyNode.btnNo:
  4515. this.ysxyNum--;
  4516. if (this.ysxyNum > 0)
  4517. this.showMsg("Refuse to quit the game once again");
  4518. else {
  4519. Moyu.userAgree(false);
  4520. Moyu.exit();
  4521. }
  4522. break;
  4523. case this.ui.xyNode.btnSure:
  4524. case this.ui.xyNode.btnYes:
  4525. DataMgr.userData.isAgree = true;
  4526. DataMgr.saveUserData();
  4527. this.onAgree();
  4528. break;
  4529. case this.ui.rnNode.btnDone:
  4530. this.ui.rnNode.visible = false;
  4531. this.ui.visible = false;
  4532. break;
  4533. case this.ui.fcmNode.btnRn:
  4534. this.showRn();
  4535. break;
  4536. }
  4537. }
  4538. showTip(show) {
  4539. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4540. return;
  4541. if (show) {
  4542. MoyuMgr.isAdvise = true;
  4543. this.ui.visible = true;
  4544. this.ui.tipNode.visible = true;
  4545. this.ui.tipNode.alpha = 1;
  4546. Laya.timer.once(1000, this, this.showTip, [false]);
  4547. }
  4548. else {
  4549. this.ui.tipNode.alpha = 1;
  4550. this.ui.tipNode.visible = true;
  4551. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4552. this.ui.tipNode.visible = false;
  4553. MoyuMgr.isAdvise = false;
  4554. }), 1000);
  4555. }
  4556. }
  4557. showAge(show, px = 0, py = 0) {
  4558. if (Moyu.platType > 10 && !Moyu.isIos) {
  4559. this.ui.ageTip.x = px;
  4560. this.ui.ageTip.y = py;
  4561. this.ui.ageTip.visible = show;
  4562. if (show)
  4563. this.ui.visible = true;
  4564. }
  4565. }
  4566. showAgree(call) {
  4567. this.agreeCall = call;
  4568. this.onAgree();
  4569. return;
  4570. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4571. this.showXy(0);
  4572. }
  4573. else
  4574. this.onAgree();
  4575. }
  4576. onAgree() {
  4577. if (!this.ui.ageNode.visible)
  4578. this.ui.visible = false;
  4579. this.ui.xyNode.visible = false;
  4580. Moyu.userAgree(true);
  4581. this.showAge(false);
  4582. this.agreeCall && this.agreeCall();
  4583. this.showRn();
  4584. }
  4585. showMsg(txt) {
  4586. this.ui.msgNode.txtMsg.text = txt;
  4587. this.ui.msgNode.visible = true;
  4588. this.ui.msgNode.alpha = 1;
  4589. this.ui.visible = true;
  4590. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4591. this.ui.msgNode.visible = false;
  4592. }), 2500, true);
  4593. }
  4594. showRn() {
  4595. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4596. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4597. this.ui.rnNode.rn1.visible = true;
  4598. this.ui.rnNode.rn2.visible = false;
  4599. this.ui.rnNode.rn3.visible = false;
  4600. this.ui.rnNode.rn4.visible = false;
  4601. this.ui.rnNode.visible = true;
  4602. this.ui.mainBg.visible = true;
  4603. this.ui.rnNode.btnDone.visible = false;
  4604. this.ui.rnNode.btnExit.visible = true;
  4605. this.ui.rnNode.btnCheck.visible = true;
  4606. this.ui.fcmNode.visible = false;
  4607. this.ui.visible = true;
  4608. return;
  4609. }
  4610. }
  4611. this.showFcm();
  4612. }
  4613. showFcm() {
  4614. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4615. Moyu.initFCM(true);
  4616. if (Moyu.gameTime < 1)
  4617. this.fcmLoop();
  4618. else if (Moyu.gameTime < 999)
  4619. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4620. }
  4621. }
  4622. fcmLoop() {
  4623. if (Moyu.gameTime < 1) {
  4624. this.ui.rnNode.visible = false;
  4625. this.ui.fcmNode.visible = true;
  4626. this.ui.mainBg.visible = true;
  4627. this.ui.visible = true;
  4628. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4629. Laya.timer.clear(this.ui, this.fcmLoop);
  4630. }
  4631. }
  4632. check() {
  4633. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4634. this.ui.rnNode.rn1.visible = false;
  4635. this.ui.rnNode.rn2.visible = false;
  4636. this.ui.rnNode.rn4.visible = true;
  4637. }
  4638. else if (this.ui.rnNode.rn4.visible) {
  4639. let name = this.ui.rnNode.inputName.text;
  4640. let code = this.ui.rnNode.inputCode.text;
  4641. if (code && code.length == 18) {
  4642. this.ui.rnNode.rn1.visible = false;
  4643. this.ui.rnNode.rn4.visible = false;
  4644. Moyu.authenticate(name, code, (res) => {
  4645. this.ui.rnNode.rn2.visible = !res;
  4646. this.ui.rnNode.rn3.visible = res;
  4647. this.ui.rnNode.btnDone.visible = res;
  4648. this.ui.rnNode.btnExit.visible = !res;
  4649. this.ui.rnNode.btnCheck.visible = !res;
  4650. if (res)
  4651. this.showFcm();
  4652. });
  4653. }
  4654. else
  4655. this.showMsg("信息填写不完整");
  4656. }
  4657. }
  4658. loadXy(type = 0) {
  4659. this.ui.xyNode.xy1.visible = false;
  4660. this.ui.xyNode.xy2.visible = true;
  4661. this.ui.xyNode.xyList.scrollToView(0);
  4662. if (type == 1) {
  4663. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4664. }
  4665. else if (type == 2) {
  4666. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4667. }
  4668. }
  4669. showXy(type = 0) {
  4670. this.xyBtn();
  4671. if (type == 0) {
  4672. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4673. this.ui.xyNode.btnSure.visible = true;
  4674. }
  4675. else {
  4676. this.ui.xyNode.btnYes.visible = true;
  4677. this.ui.xyNode.btnNo.visible = true;
  4678. }
  4679. }
  4680. else {
  4681. this.ui.xyNode.btnKnown.visible = true;
  4682. this.ui.mainBg.visible = true;
  4683. }
  4684. this.ui.xyNode.xy1.visible = true;
  4685. this.ui.xyNode.xy2.visible = false;
  4686. this.ui.xyNode.visible = true;
  4687. this.ui.visible = true;
  4688. }
  4689. xyBtn() {
  4690. this.ui.xyNode.btnSure.visible = false;
  4691. this.ui.xyNode.btnYes.visible = false;
  4692. this.ui.xyNode.btnNo.visible = false;
  4693. this.ui.xyNode.btnKnown.visible = false;
  4694. {
  4695. this.ui.xyNode.btnXy3.visible = false;
  4696. this.ui.xyNode.btnXy2.visible = true;
  4697. this.ui.xyNode.btnXy1.visible = true;
  4698. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4699. }
  4700. }
  4701. createXY(json) {
  4702. this.ysJson = json.content;
  4703. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4704. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4705. this.ui.xyNode.xy2.visible = true;
  4706. }
  4707. renderListItem(idx, cell) {
  4708. let xy = this.ysJson[idx];
  4709. cell.height = xy.line * 30;
  4710. cell.xyItem.text = xy.text;
  4711. }
  4712. onDestroy() {
  4713. this.agreeCall = null;
  4714. }
  4715. }
  4716. class SettingNode {
  4717. constructor(ui) {
  4718. this.showSetting = false;
  4719. this.openSound = true;
  4720. this.openShake = true;
  4721. this.ui = ui;
  4722. this.ui.soundBtn.onClick(this, this.switchSound);
  4723. this.ui.shakeBtn.onClick(this, this.switchShake);
  4724. this.ui.xyBtn.onClick(this, this.onXy);
  4725. this.ui.clickNode.onClick(this, this.changeSetting);
  4726. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4727. this.ui.xyBtn.visible = false;
  4728. this.ui.shakeBtn.visible = false;
  4729. }
  4730. changeSetting() {
  4731. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4732. this.showSetting = !this.showSetting;
  4733. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4734. }
  4735. switchSound() {
  4736. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4737. this.openSound = !this.openSound;
  4738. Moyu.onSetting(this.openSound, this.openShake);
  4739. xGame.soundMgr.onSetting(this.openSound);
  4740. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4741. }
  4742. switchShake() {
  4743. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4744. this.openShake = !this.openShake;
  4745. Moyu.onSetting(this.openSound, this.openShake);
  4746. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4747. }
  4748. onXy() {
  4749. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4750. MoyuMgr.showXy(1);
  4751. }
  4752. }
  4753. class ui_UILevelDisplay extends fgui.GComponent {
  4754. static createInstance() {
  4755. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4756. }
  4757. onConstruct() {
  4758. this.n9 = (this.getChild("n9"));
  4759. this.myNode = (this.getChild("myNode"));
  4760. this.closeNode = (this.getChild("closeNode"));
  4761. }
  4762. }
  4763. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4764. class ui_UILevelProp extends fgui.GComponent {
  4765. static createInstance() {
  4766. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4767. }
  4768. onConstruct() {
  4769. this.n16 = (this.getChild("n16"));
  4770. this.myNode = (this.getChild("myNode"));
  4771. this.closeBtn = (this.getChild("closeBtn"));
  4772. this.moneyNode = (this.getChild("moneyNode"));
  4773. this.t1 = this.getTransition("t1");
  4774. }
  4775. }
  4776. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  4777. class ui_ShowItem extends fgui.GComponent {
  4778. static createInstance() {
  4779. return (fgui.UIPackage.createObject("game", "ShowItem"));
  4780. }
  4781. onConstruct() {
  4782. this.myImg = (this.getChild("myImg"));
  4783. }
  4784. }
  4785. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  4786. class ShowItem {
  4787. constructor() {
  4788. this.ui = ui_ShowItem.createInstance();
  4789. }
  4790. destroySelf() {
  4791. if (!this.ui.isDisposed) {
  4792. this.ui.removeFromParent();
  4793. this.ui.dispose();
  4794. }
  4795. }
  4796. setParent(parent) {
  4797. parent.addChild(this.ui);
  4798. }
  4799. setPos(x, y) {
  4800. this.ui.x = x;
  4801. this.ui.y = y;
  4802. }
  4803. setUrl(index) {
  4804. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  4805. }
  4806. }
  4807. class ui_UIPower extends fgui.GComponent {
  4808. static createInstance() {
  4809. return (fgui.UIPackage.createObject("game", "UIPower"));
  4810. }
  4811. onConstruct() {
  4812. this.n11 = (this.getChild("n11"));
  4813. this.myNode = (this.getChild("myNode"));
  4814. this.t0 = this.getTransition("t0");
  4815. }
  4816. }
  4817. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  4818. class UIPower extends UIBase {
  4819. constructor() {
  4820. super();
  4821. }
  4822. onConstructor() {
  4823. this.ui = ui_UIPower.createInstance();
  4824. this.contentPane = this.ui;
  4825. this.isEject = false;
  4826. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4827. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  4828. }
  4829. show() {
  4830. super.show();
  4831. this.ui.t0.play();
  4832. }
  4833. videoGetPower() {
  4834. console.log('zh:qjff_AD_for_uipower');
  4835. if (Laya.Browser.onAndroid) {
  4836. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  4837. if (!boo) {
  4838. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  4839. return;
  4840. }
  4841. }
  4842. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  4843. }
  4844. else {
  4845. console.log('zh:AD 失败,直接发放奖励');
  4846. this.qjff_AD_for_uipower();
  4847. }
  4848. }
  4849. qjff_AD_for_uipower() {
  4850. DataMgr.setPower(xGame.common.videoPower, true);
  4851. xGame.eventMgr.event(POWER_TIME);
  4852. this.hide();
  4853. }
  4854. }
  4855. UIPower.uiName = "UIPower";
  4856. class LocalStorageManager {
  4857. test1() {
  4858. LocalStorageManager.setItem("playerName", "Tom");
  4859. LocalStorageManager.setItem("playerLevel", 5);
  4860. LocalStorageManager.setItem("playerData", { score: 100, level: 3 });
  4861. const name = LocalStorageManager.getItem("playerName");
  4862. const level = LocalStorageManager.getItem("playerLevel");
  4863. const data = LocalStorageManager.getItem("playerData");
  4864. console.log(name);
  4865. console.log(level);
  4866. console.log(data);
  4867. LocalStorageManager.removeItem("playerLevel");
  4868. }
  4869. static setItem(key, value) {
  4870. Laya.LocalStorage.setItem(key, JSON.stringify(value));
  4871. }
  4872. static getItem(key) {
  4873. const data = Laya.LocalStorage.getItem(key);
  4874. if (data === null)
  4875. return null;
  4876. try {
  4877. return JSON.parse(data);
  4878. }
  4879. catch (e) {
  4880. return data;
  4881. }
  4882. }
  4883. static removeItem(key) {
  4884. Laya.LocalStorage.removeItem(key);
  4885. }
  4886. static clear() {
  4887. Laya.LocalStorage.clear();
  4888. }
  4889. static hasJosnKey(key) {
  4890. var value = Laya.LocalStorage.getJSON(key);
  4891. if (value != null) {
  4892. return true;
  4893. }
  4894. else {
  4895. return false;
  4896. }
  4897. }
  4898. static hasKey(key) {
  4899. return Laya.LocalStorage.getItem(key) !== null;
  4900. }
  4901. }
  4902. class UILevelProp extends UIBase {
  4903. constructor() {
  4904. super();
  4905. this.firstPos = 385;
  4906. this.secondPos = 467;
  4907. this.showItemArr = [];
  4908. }
  4909. onFontLoaded() {
  4910. try {
  4911. this.ui.myNode.conditionTxt.font = "arial";
  4912. console.log("zh: onFontLoaded 设置arial字体成功");
  4913. }
  4914. catch (error) {
  4915. console.log("zh: constructor onFontLoaded加载arial字体失败");
  4916. }
  4917. }
  4918. onConstructor() {
  4919. this.ui = ui_UILevelProp.createInstance();
  4920. this.contentPane = this.ui;
  4921. this.isEject = false;
  4922. this.addUIClick(this.ui.closeBtn, this.hide);
  4923. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  4924. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  4925. }
  4926. show(level) {
  4927. super.show();
  4928. this.ui.t1.play();
  4929. this.level = level;
  4930. this.data = cfgTable.placeballData[this.level];
  4931. this.updateSelf();
  4932. this.showPreView();
  4933. this.moneyNode.ui.c1.selectedIndex = 2;
  4934. this.moneyNode.checkPowerTime();
  4935. this.moneyNode.powerChange();
  4936. }
  4937. showPreView() {
  4938. let item;
  4939. let data;
  4940. for (let index = 0; index < this.showItemArr.length; index++) {
  4941. item = this.showItemArr[index];
  4942. item.destroySelf();
  4943. }
  4944. this.showItemArr = [];
  4945. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  4946. for (const key in cfgData) {
  4947. data = cfgData[key];
  4948. item = new ShowItem();
  4949. item.setParent(this.ui.myNode.displayRoot);
  4950. item.setPos(data.x, data.y);
  4951. item.setUrl(data.value);
  4952. this.showItemArr.push(item);
  4953. }
  4954. }
  4955. updateSelf() {
  4956. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  4957. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  4958. if (this.data.ball == -1) {
  4959. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  4960. }
  4961. else {
  4962. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  4963. }
  4964. let localData = DataMgr.getPlaceBallLevel(this.level);
  4965. let getAward = localData.getAward;
  4966. let cfg = cfgTable.placeballData[this.level];
  4967. let coin = this.data.award[0];
  4968. let diamond = this.data.award[1];
  4969. if (cfg.type == PlaceBallType.challenge) {
  4970. diamond = 0;
  4971. coin = 100;
  4972. }
  4973. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  4974. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  4975. this.ui.myNode.coinNode.numTxt.text = coin + "";
  4976. if (cfg.type == PlaceBallType.challenge) {
  4977. this.ui.myNode.coinNode.numTxt.text = "";
  4978. }
  4979. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  4980. if (coin > 0 && diamond > 0) {
  4981. this.ui.myNode.diamondNode.x = 385;
  4982. this.ui.myNode.coinNode.x = 467;
  4983. }
  4984. else {
  4985. this.ui.myNode.diamondNode.x = 385;
  4986. this.ui.myNode.coinNode.x = 385;
  4987. }
  4988. if (!getAward) {
  4989. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  4990. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  4991. }
  4992. else {
  4993. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  4994. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  4995. }
  4996. }
  4997. startGame() {
  4998. if (DataMgr.powerEnough()) {
  4999. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  5000. this.ui.myNode.startBtn.touchable = false;
  5001. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  5002. console.log('zh:startGame ');
  5003. this.ui.myNode.startBtn.touchable = true;
  5004. DataMgr.setPower(-1);
  5005. xGame.eventMgr.event(POWER_TIME);
  5006. xGame.common.gameMode = GameMode.placeBall;
  5007. xGame.common.placeBallCurLevel = this.level;
  5008. xGame.uiMgr.Show(UIGame);
  5009. this.logEventForChallenge_level_start(this.level);
  5010. xGame.uiMgr.Hide(UILevelDisplay);
  5011. xGame.uiMgr.Hide(UIMain);
  5012. this.hide();
  5013. }));
  5014. }
  5015. else {
  5016. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  5017. xGame.uiMgr.Show(UIPower);
  5018. }
  5019. }
  5020. logEventForChallenge_level_start(level) {
  5021. let keyStr = 'sjmd_challenge_level_start';
  5022. let jsonStr = {
  5023. "count": 1,
  5024. "gold_balance ": DataMgr.getCoin(),
  5025. "level": level,
  5026. "diamond_balance ": DataMgr.getDiamond()
  5027. };
  5028. if (LocalStorageManager.hasJosnKey(keyStr)) {
  5029. const d = LocalStorageManager.getItem(keyStr);
  5030. if (level > d.level) {
  5031. jsonStr.count = d.count + 1;
  5032. LocalStorageManager.setItem(keyStr, jsonStr);
  5033. }
  5034. else {
  5035. }
  5036. }
  5037. else {
  5038. LocalStorageManager.setItem(keyStr, jsonStr);
  5039. }
  5040. const reqStr = JSON.stringify(jsonStr);
  5041. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  5042. }
  5043. hide() {
  5044. super.hide();
  5045. }
  5046. }
  5047. UILevelProp.uiName = "UILevelProp";
  5048. class PutBallLevelDisplay {
  5049. constructor(ui, index) {
  5050. this.index = 0;
  5051. this.ui = ui;
  5052. this.index = index;
  5053. this.ui.onClick(this, this.clickSelf);
  5054. this.updateSelf();
  5055. this.ui.levelTxt.text = (this.index + 1) + "";
  5056. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  5057. this.ui.special.levelTxt.text = (this.index + 1) + "";
  5058. }
  5059. updateSelf() {
  5060. let level = this.index + 1;
  5061. this.data = DataMgr.getPlaceBallLevel(level);
  5062. this.ui.starNode.c1.selectedIndex = this.data.star;
  5063. let isChallenge = cfgTable.placeballData[level].type;
  5064. if (this.data.isCur) {
  5065. if (isChallenge) {
  5066. this.ui.c1.selectedIndex = 5;
  5067. }
  5068. else {
  5069. this.ui.c1.selectedIndex = 2;
  5070. }
  5071. }
  5072. else {
  5073. if (this.data.play) {
  5074. if (this.data.star == 3) {
  5075. this.ui.c1.selectedIndex = 0;
  5076. }
  5077. else {
  5078. this.ui.c1.selectedIndex = 1;
  5079. }
  5080. }
  5081. else {
  5082. if (isChallenge) {
  5083. this.ui.c1.selectedIndex = 4;
  5084. }
  5085. else {
  5086. this.ui.c1.selectedIndex = 3;
  5087. }
  5088. }
  5089. }
  5090. }
  5091. clickSelf() {
  5092. if (!this.data.play)
  5093. return;
  5094. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5095. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  5096. }
  5097. }
  5098. class UILevelDisplay extends UIBase {
  5099. constructor() {
  5100. super();
  5101. }
  5102. onConstructor() {
  5103. this.ui = ui_UILevelDisplay.createInstance();
  5104. this.contentPane = this.ui;
  5105. this.isEject = false;
  5106. this.myList = this.ui.myNode.myList;
  5107. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  5108. this.levelItemArr = [];
  5109. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  5110. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  5111. this.myList.numItems = levelNum;
  5112. if (Moyu.isKs)
  5113. this.ui.closeNode.closeBtn.x += 100;
  5114. }
  5115. levelItemRender(index, target) {
  5116. let item = new PutBallLevelDisplay(target, index);
  5117. this.levelItemArr.push(item);
  5118. }
  5119. show() {
  5120. super.show();
  5121. this.updateLevel();
  5122. this.scrollToPlace();
  5123. }
  5124. updateLevel() {
  5125. let temp;
  5126. for (let index = 0; index < this.levelItemArr.length; index++) {
  5127. temp = this.levelItemArr[index];
  5128. temp.updateSelf();
  5129. }
  5130. }
  5131. scrollToPlace() {
  5132. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  5133. let passArr = DataMgr.getPlaceBallLevelList();
  5134. let offest = passArr.length;
  5135. if (offest >= maxNum - 1)
  5136. offest = maxNum - 1;
  5137. this.myList.scrollToView(offest, true, true);
  5138. }
  5139. hide() {
  5140. super.hide();
  5141. }
  5142. }
  5143. UILevelDisplay.uiName = "UILevelDisplay";
  5144. class ui_UIMatching extends fgui.GComponent {
  5145. static createInstance() {
  5146. return (fgui.UIPackage.createObject("game", "UIMatching"));
  5147. }
  5148. onConstruct() {
  5149. this.n5 = (this.getChild("n5"));
  5150. this.n49 = (this.getChild("n49"));
  5151. this.n51 = (this.getChild("n51"));
  5152. this.n64 = (this.getChild("n64"));
  5153. this.n2 = (this.getChild("n2"));
  5154. this.n53 = (this.getChild("n53"));
  5155. this.n54 = (this.getChild("n54"));
  5156. this.n56 = (this.getChild("n56"));
  5157. this.n58 = (this.getChild("n58"));
  5158. this.n59 = (this.getChild("n59"));
  5159. this.n57 = (this.getChild("n57"));
  5160. this.n60 = (this.getChild("n60"));
  5161. this.n62 = (this.getChild("n62"));
  5162. this.awardTxt = (this.getChild("awardTxt"));
  5163. this.n61 = (this.getChild("n61"));
  5164. this.selfHead = (this.getChild("selfHead"));
  5165. this.aiHead = (this.getChild("aiHead"));
  5166. this.n82 = (this.getChild("n82"));
  5167. this.n84 = (this.getChild("n84"));
  5168. this.n83 = (this.getChild("n83"));
  5169. this.t1 = this.getTransition("t1");
  5170. this.t2 = this.getTransition("t2");
  5171. this.t3 = this.getTransition("t3");
  5172. this.t4 = this.getTransition("t4");
  5173. }
  5174. }
  5175. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  5176. class UIMatching extends UIBase {
  5177. constructor() {
  5178. super();
  5179. }
  5180. onConstructor() {
  5181. this.ui = ui_UIMatching.createInstance();
  5182. this.contentPane = this.ui;
  5183. this.isEject = false;
  5184. }
  5185. show(callback) {
  5186. super.show();
  5187. PlatMgr.showBanner(true);
  5188. this.callback = callback;
  5189. let user = Moyu.getUserInfo();
  5190. if (!this.selfPot) {
  5191. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  5192. }
  5193. if (!this.aiPot) {
  5194. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  5195. }
  5196. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  5197. this.ui.selfHead.nameTxt.text = user.nickName;
  5198. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  5199. this.ui.aiHead.nameTxt.text = "???";
  5200. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  5201. this.ui.selfHead.c1.selectedIndex = 0;
  5202. this.ui.aiHead.c1.selectedIndex = 0;
  5203. this.ui.selfHead.x = this.selfPot.x;
  5204. this.ui.selfHead.y = this.selfPot.y;
  5205. this.ui.aiHead.x = this.aiPot.x;
  5206. this.ui.aiHead.y = this.aiPot.y;
  5207. switch (xGame.common.gameMode) {
  5208. case GameMode.classic:
  5209. break;
  5210. case GameMode.bigMove:
  5211. this.initSkillData();
  5212. break;
  5213. default:
  5214. break;
  5215. }
  5216. this.ui.t1.play(Laya.Handler.create(this, () => {
  5217. this.ui.t2.play(Laya.Handler.create(this, () => {
  5218. switch (xGame.common.gameMode) {
  5219. case GameMode.classic:
  5220. this.waitingPeople();
  5221. break;
  5222. case GameMode.bigMove:
  5223. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  5224. break;
  5225. default:
  5226. break;
  5227. }
  5228. }));
  5229. }));
  5230. }
  5231. initSkillData() {
  5232. this.skillSelectData = [];
  5233. let skillUrl = xGame.common.skillIconList;
  5234. let skillName = xGame.common.skillNameList;
  5235. let skillLevel = DataMgr.getBigSkillList();
  5236. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  5237. for (let index = 0; index < 5; index++) {
  5238. let obj = {};
  5239. obj.skillImg = skillUrl[index];
  5240. obj.skillName = skillName[index];
  5241. obj.skillType = skillType[index];
  5242. obj.skillLevel = skillLevel[index];
  5243. this.skillSelectData.push(obj);
  5244. }
  5245. }
  5246. getAISkillLevel(myLevel) {
  5247. let video = xGame.common.upSkillLevel;
  5248. let aiLevel;
  5249. let temp;
  5250. if (video) {
  5251. temp = xGame.common.randomNum(-2, -1);
  5252. }
  5253. else {
  5254. if (myLevel <= 5) {
  5255. temp = xGame.common.randomNum(1, 3);
  5256. }
  5257. else if (myLevel <= 9) {
  5258. temp = xGame.common.randomNum(-2, 1);
  5259. }
  5260. else {
  5261. temp = xGame.common.randomNum(-4, 0);
  5262. }
  5263. }
  5264. aiLevel = temp + myLevel;
  5265. if (aiLevel <= 1)
  5266. aiLevel = 1;
  5267. if (aiLevel >= 10)
  5268. aiLevel = 10;
  5269. return aiLevel;
  5270. }
  5271. getAISkillType() {
  5272. return xGame.common.randomNum(1, 4);
  5273. let successTimes = DataMgr.getSkillSuccessTimes();
  5274. let info = cfgTable.aiskillData[successTimes];
  5275. if (!info) {
  5276. let max = Object.keys(cfgTable.aiskillData).length - 1;
  5277. info = cfgTable.aiskillData[max];
  5278. }
  5279. let dataArr = info.skillselect;
  5280. let myCfg = {};
  5281. for (let index = 0; index < dataArr.length; index++) {
  5282. let temp = dataArr[index].split('-');
  5283. myCfg[temp[0]] = {};
  5284. myCfg[temp[0]].id = parseInt(temp[0]);
  5285. myCfg[temp[0]].weight = parseInt(temp[1]);
  5286. }
  5287. let aiCfg = xGame.common.initWeight(myCfg);
  5288. let curData = xGame.common.getRandomWeightData(aiCfg);
  5289. return parseInt(curData.id);
  5290. }
  5291. getAISkillData(index) {
  5292. let myLevel = this.skillSelectData[index].skillLevel;
  5293. let aiLevel = this.getAISkillLevel(myLevel);
  5294. let aiType = this.getAISkillType() - 1;
  5295. return { aiLevel, aiType } = { aiLevel, aiType };
  5296. }
  5297. skillSelectFinish(index) {
  5298. let aiInfo = this.getAISkillData(index);
  5299. xGame.common.gameMgr.selfCurSkill = index;
  5300. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  5301. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  5302. this.ui.selfHead.c1.selectedIndex = 1;
  5303. this.ui.aiHead.c1.selectedIndex = 1;
  5304. let myData = this.skillSelectData[index];
  5305. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  5306. let guide = DataMgr.getSkillGuide();
  5307. if (guide == 0) {
  5308. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  5309. }
  5310. else {
  5311. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  5312. }
  5313. let aiData = this.skillSelectData[aiInfo.aiType];
  5314. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  5315. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  5316. this.waitingPeople();
  5317. }
  5318. waitingPeople() {
  5319. let time = xGame.common.randomNum(1000, 3000);
  5320. time += 1000;
  5321. Laya.timer.once(time, this, () => {
  5322. this.matchingSuccess();
  5323. });
  5324. }
  5325. matchingSuccess() {
  5326. let gameUI = xGame.common.gameUI;
  5327. let name = gameUI.ui.topNode.aiNameTxt.text;
  5328. let url = gameUI.ui.topNode.aiHeadLoader.url;
  5329. this.ui.aiHead.nameTxt.text = name;
  5330. this.ui.aiHead.headImg.url = url;
  5331. name = gameUI.ui.topNode.selfNameTxt.text;
  5332. url = gameUI.ui.topNode.selfHeadLoader.url;
  5333. this.ui.selfHead.nameTxt.text = name;
  5334. this.ui.selfHead.headImg.url = url;
  5335. this.ui.t3.play(Laya.Handler.create(this, () => {
  5336. this.callback && this.callback();
  5337. this.ui.t4.play(Laya.Handler.create(this, () => {
  5338. this.destroySelf();
  5339. }));
  5340. }));
  5341. }
  5342. destroySelf() {
  5343. this.callback = null;
  5344. this.skillSelectData = null;
  5345. this.selfPot = null;
  5346. this.aiPot = null;
  5347. if (!this.ui.isDisposed) {
  5348. this.ui.removeFromParent();
  5349. this.ui.dispose();
  5350. }
  5351. xGame.uiMgr.destroyUI(this);
  5352. }
  5353. }
  5354. UIMatching.uiName = "UIMatching";
  5355. class ui_UIRanking extends fgui.GComponent {
  5356. static createInstance() {
  5357. return (fgui.UIPackage.createObject("game", "UIRanking"));
  5358. }
  5359. onConstruct() {
  5360. this.n26 = (this.getChild("n26"));
  5361. this.myNode = (this.getChild("myNode"));
  5362. }
  5363. }
  5364. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  5365. class UIRanking extends UIBase {
  5366. constructor() {
  5367. super();
  5368. this.showSelf = true;
  5369. this.rankType = 1;
  5370. this.rankList = [];
  5371. this.topX = 10;
  5372. this.myIndex = this.topX + 1;
  5373. this.myStar = 0;
  5374. }
  5375. onConstructor() {
  5376. this.ui = ui_UIRanking.createInstance();
  5377. this.contentPane = this.ui;
  5378. this.isEject = false;
  5379. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  5380. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  5381. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  5382. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  5383. this.ui.myNode.myList.setVirtual();
  5384. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  5385. }
  5386. show() {
  5387. super.show();
  5388. this.getPaiHangBangDataFormJosnFile();
  5389. this.updateSelf();
  5390. let self = Moyu.getUserInfo();
  5391. if (!self.isAuth) {
  5392. Moyu.initUser(this, () => {
  5393. DataMgr.upRankData();
  5394. });
  5395. }
  5396. }
  5397. getPaiHangBangDataFormJosnFile() {
  5398. const rankingList = cfgTable.paiHangBangData.list;
  5399. this.updateItemData(rankingList);
  5400. }
  5401. updateSelfItem() {
  5402. console.log('zh:Moyu.platType =' + Moyu.platType);
  5403. let self = Moyu.getUserInfo();
  5404. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  5405. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  5406. if (this.myIndex > this.topX) {
  5407. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  5408. }
  5409. else {
  5410. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  5411. }
  5412. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  5413. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  5414. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  5415. }
  5416. updateItemData(data) {
  5417. this.myStar = xGame.common.getAllStarNum();
  5418. if (this.rankList.length < 2) {
  5419. this.rankList = data;
  5420. let self = Moyu.getUserInfo();
  5421. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  5422. self.headIcon = self.headIcon;
  5423. for (let i = 0; i < data.length; i++) {
  5424. let data = this.rankList[i];
  5425. if (data.userId == self.userId) {
  5426. this.rankList.splice(i, 1);
  5427. break;
  5428. }
  5429. }
  5430. for (let i = 0; i < data.length; i++) {
  5431. let data = this.rankList[i];
  5432. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  5433. this.myIndex = i + 1;
  5434. let user = { headIcon: self.headIcon, nickName: "myself" };
  5435. let ud = { user: user, data: {} };
  5436. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5437. console.log('zh:Moyu.platType = ' + Moyu.platType);
  5438. if (Moyu.platType < 11) {
  5439. user.headIcon = self.headIcon;
  5440. user.nickName = self.nickName;
  5441. }
  5442. this.rankList.splice(i, 0, md);
  5443. break;
  5444. }
  5445. }
  5446. }
  5447. this.updateSelfItem();
  5448. this.ui.myNode.myList.numItems = this.rankList.length;
  5449. }
  5450. updateItemUI(index, obj) {
  5451. let data = this.rankList[index];
  5452. let userData = JSON.parse(data.userData).user;
  5453. obj.nameTxt.text = userData.nickName.toString();
  5454. obj.valueTxt.text = data.rankScore;
  5455. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5456. obj.rankTxt.text = index + 1;
  5457. switch (index) {
  5458. case 0:
  5459. this.setImg(obj, 1, 0, 0);
  5460. obj.rankTxt.color = "#FFC047";
  5461. break;
  5462. case 1:
  5463. this.setImg(obj, 0, 1, 0);
  5464. obj.rankTxt.color = "#ACACAC";
  5465. break;
  5466. case 2:
  5467. this.setImg(obj, 0, 0, 1);
  5468. obj.rankTxt.color = "#D09672";
  5469. break;
  5470. default:
  5471. this.setImg(obj, 0, 0, 0);
  5472. obj.rankTxt.color = "#496FAB";
  5473. break;
  5474. }
  5475. }
  5476. setImg(obj, a, b, c) {
  5477. obj.img1.visible = a ? true : false;
  5478. obj.img2.visible = b ? true : false;
  5479. obj.img3.visible = c ? true : false;
  5480. }
  5481. changeList(type) {
  5482. this.rankType = type;
  5483. this.updateSelf();
  5484. }
  5485. changeSelfNode() {
  5486. this.showSelf = !this.showSelf;
  5487. this.updateSelf();
  5488. }
  5489. updateSelf() {
  5490. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5491. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5492. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5493. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5494. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5495. }
  5496. }
  5497. UIRanking.uiName = "UIRanking";
  5498. class ui_UISecretary extends fgui.GComponent {
  5499. static createInstance() {
  5500. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5501. }
  5502. onConstruct() {
  5503. this.n0 = (this.getChild("n0"));
  5504. this.myNode = (this.getChild("myNode"));
  5505. this.closeBtn = (this.getChild("closeBtn"));
  5506. this.t0 = this.getTransition("t0");
  5507. }
  5508. }
  5509. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5510. class UISecretary extends UIBase {
  5511. constructor() {
  5512. super();
  5513. this.curIndex = 1;
  5514. }
  5515. onConstructor() {
  5516. this.ui = ui_UISecretary.createInstance();
  5517. this.contentPane = this.ui;
  5518. this.isEject = false;
  5519. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5520. this.nodeObj = { left: null, right: null, cur: null };
  5521. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5522. }
  5523. show() {
  5524. super.show();
  5525. this.ui.t0.play();
  5526. this.updateData();
  5527. }
  5528. addSecretarySpine(node, spineName) {
  5529. if (spineName == "mishu") {
  5530. if (this.secretarySpine1) {
  5531. node.displayObject.destroyChildren();
  5532. this.playWoman(this.secretarySpine1, node.displayObject);
  5533. }
  5534. else {
  5535. let spine1 = new SpineMgr("mishu", () => {
  5536. this.secretarySpine1 = spine1;
  5537. this.playWoman(this.secretarySpine1, node.displayObject);
  5538. });
  5539. }
  5540. }
  5541. else {
  5542. if (this.secretarySpine2) {
  5543. node.displayObject.destroyChildren();
  5544. this.playWoman(this.secretarySpine2, node.displayObject);
  5545. }
  5546. else {
  5547. let spine2 = new SpineMgr("xiaomishu2", () => {
  5548. this.secretarySpine2 = spine2;
  5549. this.playWoman(this.secretarySpine2, node.displayObject);
  5550. });
  5551. }
  5552. }
  5553. }
  5554. playWoman(node, parent) {
  5555. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  5556. let yy = this.ui.myNode.gameNode3.secretary.height;
  5557. let scale = 1.5;
  5558. if (node == this.secretarySpine2) {
  5559. scale = 1.2;
  5560. }
  5561. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5562. node.play(data, 0, true, parent);
  5563. }
  5564. turnLeft() {
  5565. this.curIndex--;
  5566. if (this.curIndex < 1) {
  5567. this.curIndex = 2;
  5568. }
  5569. let left = this.nodeObj.left;
  5570. let right = this.nodeObj.right;
  5571. let cur = this.nodeObj.cur;
  5572. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5573. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5574. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5575. this.updateData();
  5576. }));
  5577. this.ui.myNode.setChildIndex(right, 2);
  5578. this.nodeObj.left = cur;
  5579. this.nodeObj.right = left;
  5580. this.nodeObj.cur = right;
  5581. }
  5582. turnRight() {
  5583. this.curIndex++;
  5584. if (this.curIndex > 2) {
  5585. this.curIndex = 1;
  5586. }
  5587. let left = this.nodeObj.left;
  5588. let right = this.nodeObj.right;
  5589. let cur = this.nodeObj.cur;
  5590. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5591. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5592. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5593. this.updateData();
  5594. }));
  5595. this.ui.myNode.setChildIndex(left, 2);
  5596. this.nodeObj.left = right;
  5597. this.nodeObj.right = cur;
  5598. this.nodeObj.cur = left;
  5599. }
  5600. updateData() {
  5601. console.log('zh: updateData FFFFFFFFFF');
  5602. let data = cfgTable.secretaryshopData;
  5603. let children = this.ui.myNode._children;
  5604. let temp;
  5605. let curData;
  5606. for (let index = 0; index < children.length; index++) {
  5607. temp = children[index];
  5608. curData = data[1];
  5609. temp.heightTxt.text = curData.height;
  5610. temp.foodTxt.text = curData.food;
  5611. temp.historyTxt.text = curData.history;
  5612. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5613. this.addSecretarySpine(temp.secretary, curData.spine);
  5614. let womanIndex = curData.id - 1;
  5615. let getWoman = DataMgr.getSecretary(womanIndex);
  5616. let curUse = DataMgr.getCurSecretary();
  5617. if (getWoman) {
  5618. if (curUse == womanIndex) {
  5619. temp.purchaseBtn.c1.selectedIndex = 1;
  5620. }
  5621. else {
  5622. temp.purchaseBtn.c1.selectedIndex = 2;
  5623. }
  5624. }
  5625. else {
  5626. temp.purchaseBtn.c1.selectedIndex = 0;
  5627. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5628. }
  5629. temp.purchaseBtn.visible = false;
  5630. }
  5631. }
  5632. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5633. console.log('zh: 点击了clickSecretary ');
  5634. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5635. if (getWoman) {
  5636. if (curUse != womanIndex) {
  5637. console.log();
  5638. DataMgr.setCurSecretary(womanIndex);
  5639. this.updateData();
  5640. }
  5641. }
  5642. else {
  5643. console.log('zh:点击购买了');
  5644. let need = needDiamond;
  5645. if (DataMgr.diamondEnough(need)) {
  5646. DataMgr.setDiamond(-need);
  5647. DataMgr.setSecretary(womanIndex, 1);
  5648. DataMgr.setCurSecretary(womanIndex);
  5649. this.updateData();
  5650. }
  5651. else {
  5652. xGame.uiMgr.Show(UIAddProp, 1);
  5653. }
  5654. }
  5655. }
  5656. closeSelf() {
  5657. this.hide();
  5658. }
  5659. }
  5660. UISecretary.uiName = "UISecretary";
  5661. class ui_UIShop extends fgui.GComponent {
  5662. static createInstance() {
  5663. return (fgui.UIPackage.createObject("game", "UIShop"));
  5664. }
  5665. onConstruct() {
  5666. this.n48 = (this.getChild("n48"));
  5667. this.n0 = (this.getChild("n0"));
  5668. this.secretary = (this.getChild("secretary"));
  5669. this.talkNode = (this.getChild("talkNode"));
  5670. this.closeNode = (this.getChild("closeNode"));
  5671. this.moneyNode = (this.getChild("moneyNode"));
  5672. this.myNode = (this.getChild("myNode"));
  5673. }
  5674. }
  5675. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5676. class BallRodDisplay {
  5677. constructor(ui, index) {
  5678. this.index = 0;
  5679. this.uiIndex = 0;
  5680. this.ui = ui;
  5681. this.index = index;
  5682. this.initData();
  5683. }
  5684. initData() {
  5685. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5686. let data = cfgTable.ballrodData[this.index + 1];
  5687. this.ui.nameTxt.text = data.name;
  5688. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5689. this.ui.levelNode.c1.selectedIndex = data.quality;
  5690. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5691. if (data.spine) {
  5692. this.mySpine = new SpineMgr(data.spine, () => {
  5693. let xx = 150;
  5694. let yy = 70;
  5695. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5696. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5697. });
  5698. }
  5699. }
  5700. updateSelf() {
  5701. console.log('zh:updateSelf -------------- ');
  5702. let get = DataMgr.getBallRod(this.index);
  5703. if (get == null)
  5704. get = 1;
  5705. let curUse = DataMgr.getCurBallRod();
  5706. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5707. if (get) {
  5708. if (curUse == this.index) {
  5709. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5710. }
  5711. else {
  5712. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5713. }
  5714. }
  5715. else {
  5716. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5717. }
  5718. }
  5719. buyBallRod() {
  5720. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5721. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5722. switch (selectedIndex) {
  5723. case 0:
  5724. break;
  5725. case 1:
  5726. console.log('zh:点击了 USE THIS');
  5727. DataMgr.setCurBallRod(this.index);
  5728. let curUse = DataMgr.getCurBallRod();
  5729. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5730. let ui = xGame.uiMgr.getUI(UIShop);
  5731. ui.updateBallRod();
  5732. break;
  5733. case 2:
  5734. let data = cfgTable.ballrodData[this.index + 1];
  5735. let need = data.price;
  5736. if (DataMgr.diamondEnough(need)) {
  5737. DataMgr.setDiamond(-need);
  5738. DataMgr.setBallRod(this.index, 1);
  5739. DataMgr.setCurBallRod(this.index);
  5740. let ui = xGame.uiMgr.getUI(UIShop);
  5741. ui.updateBallRod();
  5742. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  5743. }
  5744. else {
  5745. xGame.uiMgr.Show(UIAddProp, 1);
  5746. }
  5747. break;
  5748. default:
  5749. break;
  5750. }
  5751. }
  5752. logEventForGouMaiGan(qiuGanName) {
  5753. const ev = {
  5754. value: qiuGanName
  5755. };
  5756. const jsonStr = JSON.stringify(ev);
  5757. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  5758. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  5759. }
  5760. }
  5761. class DaoJuDisplay {
  5762. constructor(ui, index) {
  5763. this.index = 0;
  5764. this.uiIndex = 0;
  5765. this.ui = ui;
  5766. this.index = index;
  5767. this.initData();
  5768. }
  5769. initData() {
  5770. this.ui.btn_buy.onClick(this, this.buyDj);
  5771. let data = cfgTable.daoJuData[this.index + 1];
  5772. console.log('zh:' + JSON.stringify(data));
  5773. this.ui.nameTxt.text = data.name;
  5774. this.ui.n_jiaGe.text = data.price + "";
  5775. this.ui.n_zuanShi.text = data.price + "";
  5776. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  5777. }
  5778. buyDj() {
  5779. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5780. }
  5781. buyBallRod() {
  5782. }
  5783. logEventForGouMaiGan(qiuGanName) {
  5784. const ev = {
  5785. value: qiuGanName
  5786. };
  5787. const jsonStr = JSON.stringify(ev);
  5788. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  5789. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  5790. }
  5791. }
  5792. class UIShop extends UIBase {
  5793. constructor() {
  5794. super();
  5795. this.itemNums = 0;
  5796. this.itemNumsForDj = 0;
  5797. this.curType = "";
  5798. }
  5799. onConstructor() {
  5800. this.ui = ui_UIShop.createInstance();
  5801. this.contentPane = this.ui;
  5802. this.isEject = false;
  5803. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5804. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5805. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  5806. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  5807. this.addUIClick(this.ui, this.interuptSecretary);
  5808. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  5809. this.ballRodArr = [];
  5810. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  5811. this.ui.myNode.myList.numItems = this.itemNums;
  5812. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  5813. this.daoJuArr = [];
  5814. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  5815. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  5816. }
  5817. show(type) {
  5818. super.show();
  5819. console.log('zh:show type = ' + type);
  5820. this.curType = type == 0 ? "qiugan" : "daoju";
  5821. this.switchBtn("qiugan");
  5822. this.playSecretaryIdle();
  5823. this.updateBallRod();
  5824. }
  5825. test123() {
  5826. console.log('zh:test123 ');
  5827. }
  5828. switchBtn(type) {
  5829. console.log('zh:1111切換 sel type=' + type);
  5830. if (type == "") {
  5831. type = this.curType;
  5832. }
  5833. else {
  5834. if (this.curType == type) {
  5835. return;
  5836. }
  5837. else {
  5838. this.curType = type;
  5839. }
  5840. }
  5841. if (type == "qiugan") {
  5842. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  5843. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  5844. this.ui.myNode.myList.visible = true;
  5845. this.ui.myNode.djList.visible = false;
  5846. }
  5847. else {
  5848. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  5849. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  5850. this.ui.myNode.myList.visible = false;
  5851. this.ui.myNode.djList.visible = true;
  5852. }
  5853. }
  5854. updateBallRod() {
  5855. for (let index = 0; index < this.ballRodArr.length; index++) {
  5856. this.ballRodArr[index].updateSelf();
  5857. }
  5858. }
  5859. renderBallRod(sort, obj) {
  5860. let index = this.getIndexBySort(sort + 1) - 1;
  5861. let ballRod = new BallRodDisplay(obj, index);
  5862. this.ballRodArr.push(ballRod);
  5863. }
  5864. renderDaoJu(sort, obj) {
  5865. let index = this.getIndexBySortForDj(sort + 1) - 1;
  5866. let b = new DaoJuDisplay(obj, index);
  5867. this.daoJuArr.push(b);
  5868. }
  5869. getIndexBySort(sort) {
  5870. let object = cfgTable.ballrodData;
  5871. for (const key in object) {
  5872. if (object[key].sort == sort) {
  5873. return parseInt(key);
  5874. }
  5875. }
  5876. }
  5877. getIndexBySortForDj(sort) {
  5878. let object = cfgTable.daoJuData;
  5879. for (const key in object) {
  5880. if (object[key].sort == sort) {
  5881. return parseInt(key);
  5882. }
  5883. }
  5884. }
  5885. playSecretaryIdle() {
  5886. let parent = this.ui.secretary.displayObject;
  5887. parent.destroyChildren();
  5888. let xx = this.ui.secretary.width / 2;
  5889. let yy = this.ui.secretary.height;
  5890. let scale = xGame.common.getSecretaryScale();
  5891. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5892. xGame.common.secretary.play(data, 0, true, parent);
  5893. }
  5894. interuptSecretary() {
  5895. Laya.timer.clearAll(this);
  5896. this.playSecretaryRandomSound();
  5897. }
  5898. playSecretaryRandomSound() {
  5899. if (this.isHide)
  5900. return;
  5901. let time = xGame.common.randomNum(45000, 60000);
  5902. Laya.timer.once(time, this, () => {
  5903. if (this.isHide)
  5904. return;
  5905. let index = xGame.common.randomNum(4, 7);
  5906. xGame.soundMgr.playSound("s_main0" + index);
  5907. let words = 1;
  5908. switch (index) {
  5909. case 4:
  5910. words = 5;
  5911. break;
  5912. case 5:
  5913. words = 3;
  5914. break;
  5915. case 6:
  5916. words = 6;
  5917. break;
  5918. case 7:
  5919. words = 7;
  5920. break;
  5921. default:
  5922. break;
  5923. }
  5924. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5925. this.playSecretaryRandomSound();
  5926. });
  5927. }
  5928. closeSelf() {
  5929. this.hide();
  5930. }
  5931. }
  5932. UIShop.uiName = "UIShop";
  5933. class ui_UISign extends fgui.GComponent {
  5934. static createInstance() {
  5935. return (fgui.UIPackage.createObject("game", "UISign"));
  5936. }
  5937. onConstruct() {
  5938. this.n6 = (this.getChild("n6"));
  5939. this.closeNode = (this.getChild("closeNode"));
  5940. this.myNode = (this.getChild("myNode"));
  5941. this.moneyNode = (this.getChild("moneyNode"));
  5942. this.secretary = (this.getChild("secretary"));
  5943. this.talkNode = (this.getChild("talkNode"));
  5944. this.tripleBtn = (this.getChild("tripleBtn"));
  5945. this.normalBtn = (this.getChild("normalBtn"));
  5946. this.tipsNode = (this.getChild("tipsNode"));
  5947. this.againBtn = (this.getChild("againBtn"));
  5948. this.t0 = this.getTransition("t0");
  5949. }
  5950. }
  5951. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  5952. class SignMax {
  5953. constructor(ui) {
  5954. this.ui = ui;
  5955. }
  5956. updateSelf(index, sameDay, curDayIndex) {
  5957. let data = cfgTable.signData[index + 1];
  5958. this.ui.titleTxt.text = data.title;
  5959. let arr1 = data.award[0].split('-');
  5960. let arr2 = data.award[1].split('-');
  5961. let num1 = parseInt(arr1[1]);
  5962. let num2 = parseInt(arr2[1]);
  5963. this.ui.numTxt1.text = num1 + "";
  5964. this.ui.numTxt2.text = num2 + "";
  5965. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  5966. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  5967. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  5968. this.ui.numTxt1.visible = false;
  5969. }
  5970. else {
  5971. this.ui.numTxt1.visible = true;
  5972. }
  5973. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  5974. this.ui.numTxt2.visible = false;
  5975. }
  5976. else {
  5977. this.ui.numTxt2.visible = true;
  5978. }
  5979. if (index < curDayIndex) {
  5980. this.ui.c1.selectedIndex = 1;
  5981. }
  5982. else if (index == curDayIndex) {
  5983. if (sameDay) {
  5984. this.ui.c1.selectedIndex = 2;
  5985. }
  5986. else {
  5987. this.ui.c1.selectedIndex = 2;
  5988. }
  5989. }
  5990. else {
  5991. this.ui.c1.selectedIndex = 0;
  5992. }
  5993. }
  5994. }
  5995. class SignNormal {
  5996. constructor(ui) {
  5997. this.ui = ui;
  5998. }
  5999. updateSelf(index, sameDay, curDayIndex) {
  6000. let data = cfgTable.signData[index + 1];
  6001. this.ui.titleTxt.text = data.title;
  6002. let arr = data.award[0].split('-');
  6003. let type = parseInt(arr[0]);
  6004. let num = parseInt(arr[1]);
  6005. this.ui.numTxt.text = num + "";
  6006. if (type > 2) {
  6007. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  6008. this.ui.myIcon.rotation = 0;
  6009. }
  6010. else {
  6011. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  6012. this.ui.myIcon.rotation = 0;
  6013. }
  6014. if (xGame.common.signAwardContainsRod(data.award)) {
  6015. this.ui.numTxt.visible = false;
  6016. }
  6017. else {
  6018. this.ui.numTxt.visible = true;
  6019. }
  6020. if (index < curDayIndex) {
  6021. this.ui.c1.selectedIndex = 1;
  6022. }
  6023. else if (index == curDayIndex) {
  6024. if (sameDay) {
  6025. this.ui.c1.selectedIndex = 2;
  6026. }
  6027. else {
  6028. this.ui.c1.selectedIndex = 2;
  6029. }
  6030. }
  6031. else {
  6032. this.ui.c1.selectedIndex = 0;
  6033. }
  6034. }
  6035. }
  6036. class UISign extends UIBase {
  6037. constructor() {
  6038. super();
  6039. this.curDayIndex = 0;
  6040. this.starX = 0;
  6041. }
  6042. onConstructor() {
  6043. this.ui = ui_UISign.createInstance();
  6044. this.contentPane = this.ui;
  6045. this.isEject = false;
  6046. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6047. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  6048. this.initSignItem();
  6049. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  6050. this.addUIClick(this.ui.againBtn, this.againGetAward);
  6051. }
  6052. show() {
  6053. super.show();
  6054. this.ui.t0.play();
  6055. this.playSecretaryIdle();
  6056. this.updateSign();
  6057. }
  6058. initSignItem() {
  6059. this.signArr = [];
  6060. for (let index = 0; index < 6; index++) {
  6061. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  6062. this.signArr.push(temp);
  6063. }
  6064. this.signMax = new SignMax(this.ui.myNode.day7);
  6065. if (Moyu.isKs)
  6066. this.ui.closeNode.closeBtn.x += 100;
  6067. }
  6068. updateSign() {
  6069. let sameDay = xGame.common.judgeSameDay();
  6070. let max = 7;
  6071. this.curDayIndex = DataMgr.getSignData();
  6072. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  6073. this.curDayIndex = 0;
  6074. if (!sameDay) {
  6075. this.ui.normalBtn.visible = true;
  6076. this.ui.tipsNode.visible = false;
  6077. this.ui.againBtn.visible = false;
  6078. }
  6079. else {
  6080. this.ui.normalBtn.visible = false;
  6081. let again = DataMgr.getExtraSign();
  6082. let isCurrency = false;
  6083. let index = this.curDayIndex;
  6084. if (index == 0)
  6085. index = 7;
  6086. let award = cfgTable.signData[index].award;
  6087. let num = award[0].split("-")[0];
  6088. if (num == "1" || num == "2")
  6089. isCurrency = true;
  6090. let showAgain = again == 0 && isCurrency;
  6091. this.ui.againBtn.visible = showAgain;
  6092. this.ui.tipsNode.visible = !showAgain;
  6093. }
  6094. for (let index = 0; index < this.signArr.length; index++) {
  6095. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  6096. }
  6097. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  6098. }
  6099. playSecretaryIdle() {
  6100. let parent = this.ui.secretary.displayObject;
  6101. parent.destroyChildren();
  6102. let xx = this.ui.secretary.width / 2;
  6103. let yy = this.ui.secretary.height;
  6104. let scale = xGame.common.getSecretaryScale();
  6105. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6106. xGame.common.secretary.play(data, 0, true, parent);
  6107. }
  6108. closeSelf() {
  6109. this.hide();
  6110. }
  6111. normalGetAward() {
  6112. let sameDay = xGame.common.judgeSameDay();
  6113. if (!sameDay) {
  6114. let award = cfgTable.signData[this.curDayIndex + 1].award;
  6115. let temp;
  6116. let type;
  6117. let num;
  6118. let arr = [];
  6119. for (let index = 0; index < award.length; index++) {
  6120. temp = award[index].split("-");
  6121. type = parseInt(temp[0]);
  6122. num = parseInt(temp[1]);
  6123. let awardType = new AwardType();
  6124. awardType.num = num;
  6125. awardType.type = type;
  6126. arr.push(awardType);
  6127. }
  6128. xGame.common.getAward(arr, (watchVideo) => {
  6129. this.curDayIndex++;
  6130. if (this.curDayIndex > 7)
  6131. this.curDayIndex = 0;
  6132. DataMgr.setSignData(this.curDayIndex);
  6133. DataMgr.setSignTime(new Date().getTime());
  6134. if (watchVideo) {
  6135. DataMgr.setExtraSign(1);
  6136. Moyu.sendDataEvent("signIn1");
  6137. }
  6138. this.updateSign();
  6139. });
  6140. }
  6141. }
  6142. againGetAward() {
  6143. Moyu.sendDataEvent("signIn2");
  6144. console.log('zh:qjff_AD_for_uisign');
  6145. if (Laya.Browser.onAndroid) {
  6146. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  6147. if (!boo) {
  6148. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  6149. return;
  6150. }
  6151. }
  6152. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  6153. }
  6154. else {
  6155. console.log('zh:AD 失败,直接发放奖励');
  6156. this.qjff_AD_for_uisign();
  6157. }
  6158. }
  6159. qjff_AD_for_uisign() {
  6160. let index = this.curDayIndex;
  6161. if (index == 0)
  6162. index = 7;
  6163. let award = cfgTable.signData[index].award;
  6164. let temp;
  6165. let type;
  6166. let num;
  6167. for (let index = 0; index < award.length; index++) {
  6168. temp = award[index].split("-");
  6169. type = parseInt(temp[0]);
  6170. num = parseInt(temp[1]) * 3;
  6171. xGame.common.playObjFlyAnim(num, type);
  6172. }
  6173. DataMgr.setExtraSign(1);
  6174. this.updateSign();
  6175. }
  6176. }
  6177. UISign.uiName = "UISign";
  6178. class ui_UISkill extends fgui.GComponent {
  6179. static createInstance() {
  6180. return (fgui.UIPackage.createObject("game", "UISkill"));
  6181. }
  6182. onConstruct() {
  6183. this.n48 = (this.getChild("n48"));
  6184. this.n0 = (this.getChild("n0"));
  6185. this.secretary = (this.getChild("secretary"));
  6186. this.talkNode = (this.getChild("talkNode"));
  6187. this.closeNode = (this.getChild("closeNode"));
  6188. this.moneyNode = (this.getChild("moneyNode"));
  6189. this.skillNode = (this.getChild("skillNode"));
  6190. this.guideNode = (this.getChild("guideNode"));
  6191. }
  6192. }
  6193. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  6194. class SkillDisplay {
  6195. constructor(ui, data, uiIndex) {
  6196. this.starX = 0;
  6197. this.starY = 0;
  6198. this.index = 0;
  6199. this.ui = ui;
  6200. this.data = data;
  6201. this.index = uiIndex;
  6202. this.initSelf();
  6203. console.log('zh:SkillDisplay constructor this.skillData=', data);
  6204. }
  6205. initSelf() {
  6206. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  6207. this.ui.nameTxt.text = this.data.name;
  6208. this.ui.describeTxt.text = this.data.describe;
  6209. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  6210. this.ui.startBtn.onClick(this, this.startGame);
  6211. this.updateSelf();
  6212. }
  6213. updateSelf() {
  6214. this.checkTry();
  6215. let level = DataMgr.getBigSkillByIndex(this.index);
  6216. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  6217. }
  6218. checkTry() {
  6219. let index = this.index;
  6220. let level = DataMgr.getBigSkillByIndex(index);
  6221. if (level == null) {
  6222. DataMgr.setBigSkill(index, 1, false);
  6223. level = 1;
  6224. }
  6225. this.ui.levelTxt.text = "LV." + level;
  6226. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  6227. this.ui.tryNode.visible = true;
  6228. else
  6229. this.ui.tryNode.visible = false;
  6230. }
  6231. clickAddLevel() {
  6232. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6233. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  6234. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  6235. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  6236. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6237. }
  6238. else {
  6239. console.log('zh:AD 失败,直接发放奖励');
  6240. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6241. }
  6242. }
  6243. qjff_AD_for_skilldisplay_clickAddLevel() {
  6244. DataMgr.setBigSkill(this.data.index, 1);
  6245. this.updateSelf();
  6246. xGame.common.upSkillLevel = true;
  6247. }
  6248. startGame() {
  6249. console.log('zh:rod skill startgame');
  6250. if (this.data.index == 3) {
  6251. alert('Coming soon!');
  6252. return;
  6253. }
  6254. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6255. let needCoin = xGame.common.bigMoveNeedCoin;
  6256. xGame.common.passAwardCoin = 2000;
  6257. let guide = DataMgr.getSkillGuide();
  6258. console.log('zh:startGame guide=' + guide);
  6259. xGame.common.temSelfLevel = 0;
  6260. if (guide == 0) {
  6261. needCoin = 0;
  6262. xGame.common.temSelfLevel = 100;
  6263. }
  6264. if (DataMgr.coinEnough(needCoin)) {
  6265. DataMgr.setCoin(-needCoin);
  6266. xGame.common.curPlayerSkillType = this.index;
  6267. if (guide == 0)
  6268. xGame.common.curPlayerSkillType = 0;
  6269. console.log('zh: skilldisplay 1');
  6270. xGame.uiMgr.Show(UIGame);
  6271. xGame.uiMgr.Hide(UIMain);
  6272. xGame.uiMgr.Show(UIMatching, () => {
  6273. xGame.common.gameUI.ui.alpha = 1;
  6274. xGame.common.gameUI.startGame();
  6275. xGame.uiMgr.Hide(UISkill);
  6276. });
  6277. this.logEventForRod_start();
  6278. }
  6279. else {
  6280. console.log('zh: skilldisplay 2');
  6281. xGame.uiMgr.Show(UIAddProp, 0);
  6282. Moyu.sendDataEvent("AddCoinVideo");
  6283. }
  6284. }
  6285. logEventForRod_start() {
  6286. let gfmsIdx = xGame.common.curPlayerSkillType;
  6287. console.log('zh:选择的技能=' + gfmsIdx);
  6288. let gfmc = 'Skyfall Shot';
  6289. if (gfmsIdx == 0) {
  6290. gfmc = 'Skyfall Shot';
  6291. }
  6292. if (gfmsIdx == 1) {
  6293. gfmc = 'Surging break';
  6294. }
  6295. if (gfmsIdx == 2) {
  6296. gfmc = 'Frost Lock';
  6297. }
  6298. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  6299. let jsonStr = {
  6300. "count": 0,
  6301. "name": gfmc
  6302. };
  6303. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6304. const d = LocalStorageManager.getItem(keyStr);
  6305. jsonStr.count = d.count + 1;
  6306. LocalStorageManager.setItem(keyStr, jsonStr);
  6307. }
  6308. else {
  6309. LocalStorageManager.setItem(keyStr, jsonStr);
  6310. }
  6311. const reqStr = JSON.stringify(jsonStr);
  6312. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  6313. }
  6314. }
  6315. class UISkill extends UIBase {
  6316. constructor() {
  6317. super();
  6318. this.skillData = [];
  6319. }
  6320. onConstructor() {
  6321. this.ui = ui_UISkill.createInstance();
  6322. this.contentPane = this.ui;
  6323. this.isEject = false;
  6324. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6325. this.initSkillData();
  6326. console.log('zh:aaaaaa1111111111');
  6327. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  6328. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  6329. console.log('zh:aaaaaa22222222');
  6330. this.displayList = [];
  6331. this.ui.skillNode.skillList.numItems = 3;
  6332. this.addUIClick(this.ui, this.interuptSecretary);
  6333. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  6334. this.ui.talkNode.visible = false;
  6335. if (Moyu.isKs)
  6336. this.ui.closeNode.closeBtn.x += 100;
  6337. }
  6338. show() {
  6339. super.show();
  6340. this.playSecretaryIdle();
  6341. this.moneyNode.ui.c1.selectedIndex = 1;
  6342. Laya.timer.clearAll(this);
  6343. xGame.soundMgr.playSound("s_start");
  6344. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6345. let guide = DataMgr.getSkillGuide();
  6346. this.ui.guideNode.visible = guide == 0;
  6347. let item = this.getSkillItemByUIIndex(0);
  6348. if (guide == 0) {
  6349. item.ui.c1.selectedIndex = 1;
  6350. }
  6351. else {
  6352. item.ui.c1.selectedIndex = 0;
  6353. }
  6354. this.ui.guideNode.guideBtn.visible = guide == 0;
  6355. for (let index = 0; index < this.displayList.length; index++) {
  6356. this.displayList[index].checkTry();
  6357. }
  6358. }
  6359. getSkillItemByUIIndex(cur) {
  6360. for (let index = 0; index < this.displayList.length; index++) {
  6361. if (this.displayList[index].index == cur) {
  6362. return this.displayList[index];
  6363. }
  6364. }
  6365. }
  6366. enterGuideLevel() {
  6367. let item = this.getSkillItemByUIIndex(0);
  6368. item.startGame();
  6369. if (DataMgr.getNewUser())
  6370. Moyu.sendDataEvent("gameStart1");
  6371. }
  6372. initSkillData() {
  6373. this.skillData = [];
  6374. let nameList = xGame.common.skillNameList;
  6375. let iconList = xGame.common.skillIconList;
  6376. let describeList = [
  6377. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  6378. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  6379. "The power of frost descends—freezing the flow and taking full control of the game!"
  6380. ];
  6381. console.log('zh:initSkillData 111111111');
  6382. let data;
  6383. for (let index = 0; index < nameList.length; index++) {
  6384. data = {};
  6385. data.name = nameList[index];
  6386. data.icon = iconList[index];
  6387. data.describe = describeList[index];
  6388. data.index = index;
  6389. this.skillData.push(data);
  6390. }
  6391. }
  6392. updateSkillItem(index, target) {
  6393. if (this.displayList[index] == null) {
  6394. let uiIndex;
  6395. switch (index) {
  6396. case 0:
  6397. uiIndex = 1;
  6398. break;
  6399. case 1:
  6400. uiIndex = 0;
  6401. break;
  6402. case 2:
  6403. uiIndex = 2;
  6404. break;
  6405. case 3:
  6406. uiIndex = 3;
  6407. break;
  6408. default:
  6409. break;
  6410. }
  6411. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  6412. this.displayList.push(temp);
  6413. }
  6414. }
  6415. playSecretaryIdle() {
  6416. let parent = this.ui.secretary.displayObject;
  6417. parent.destroyChildren();
  6418. let xx = this.ui.secretary.width / 2;
  6419. let yy = this.ui.secretary.height;
  6420. let scale = xGame.common.getSecretaryScale();
  6421. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6422. xGame.common.secretary.play(data, 0, true, parent);
  6423. }
  6424. returnUIMain() {
  6425. this.hide();
  6426. xGame.common.stopGirlPop(this.ui.talkNode);
  6427. xGame.uiMgr.Show(UIMain);
  6428. }
  6429. interuptSecretary() {
  6430. Laya.timer.clearAll(this);
  6431. this.playSecretaryRandomSound();
  6432. }
  6433. playSecretaryRandomSound() {
  6434. if (this.isHide)
  6435. return;
  6436. let time = xGame.common.randomNum(45000, 60000);
  6437. Laya.timer.once(time, this, () => {
  6438. if (this.isHide)
  6439. return;
  6440. let index = xGame.common.randomNum(4, 7);
  6441. xGame.soundMgr.playSound("s_main0" + index);
  6442. let words = 1;
  6443. switch (index) {
  6444. case 4:
  6445. words = 5;
  6446. break;
  6447. case 5:
  6448. words = 3;
  6449. break;
  6450. case 6:
  6451. words = 6;
  6452. break;
  6453. case 7:
  6454. words = 7;
  6455. break;
  6456. default:
  6457. break;
  6458. }
  6459. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6460. this.playSecretaryRandomSound();
  6461. });
  6462. }
  6463. }
  6464. UISkill.uiName = "UISkill";
  6465. class ui_UIMsg extends fgui.GComponent {
  6466. static createInstance() {
  6467. return (fgui.UIPackage.createObject("game", "UIMsg"));
  6468. }
  6469. onConstruct() {
  6470. this.tipsNode = (this.getChild("tipsNode"));
  6471. }
  6472. }
  6473. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  6474. class UIMsg extends UIBase {
  6475. constructor() {
  6476. super();
  6477. }
  6478. onConstructor() {
  6479. this.ui = ui_UIMsg.createInstance();
  6480. this.contentPane = this.ui;
  6481. this.isEject = false;
  6482. this.isMuti = true;
  6483. }
  6484. show(msg, callback) {
  6485. super.show();
  6486. this.ui.tipsNode.msgTxt.text = msg;
  6487. this.ui.alpha = 1;
  6488. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  6489. this.hide();
  6490. callback && callback();
  6491. }), 1000);
  6492. }
  6493. }
  6494. UIMsg.uiName = "UIMsg";
  6495. class ui_UIModeSelection extends fgui.GComponent {
  6496. static createInstance() {
  6497. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  6498. }
  6499. onConstruct() {
  6500. this.n19 = (this.getChild("n19"));
  6501. this.closeBtn = (this.getChild("closeBtn"));
  6502. this.myNode = (this.getChild("myNode"));
  6503. this.t0 = this.getTransition("t0");
  6504. }
  6505. }
  6506. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  6507. class UIModeSelection extends UIBase {
  6508. constructor() {
  6509. super();
  6510. }
  6511. onConstructor() {
  6512. this.ui = ui_UIModeSelection.createInstance();
  6513. this.contentPane = this.ui;
  6514. this.isEject = false;
  6515. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  6516. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  6517. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  6518. this.addUIClick(this.ui.closeBtn, this.hide);
  6519. this.peopleArr = [65, 990, 580];
  6520. this.peopleOffest = [5, 10, 10];
  6521. }
  6522. show(callback) {
  6523. this.updateSelf();
  6524. super.show();
  6525. this.ui.t0.play();
  6526. this.callback = callback;
  6527. }
  6528. updateSelf() {
  6529. let cfg = cfgTable.modeselectData;
  6530. for (let index = 1; index <= 3; index++) {
  6531. let node = this.ui.myNode["type" + index];
  6532. node.need.text = cfg[index].need;
  6533. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  6534. node.peopleTxt.text = this.getRandPeople(index - 1);
  6535. }
  6536. }
  6537. enterGame(type) {
  6538. console.log('zh: 进入经典模式 type: ' + type);
  6539. xGame.common.classicRoomType = type;
  6540. let cfg = cfgTable.modeselectData[type];
  6541. let need = cfg.need;
  6542. xGame.common.passAwardCoin = cfg.award;
  6543. if (DataMgr.coinEnough(need)) {
  6544. DataMgr.setCoin(-need);
  6545. this.ui.myNode["type" + type].t0.play();
  6546. Laya.timer.once(200, this, () => {
  6547. this.callback && this.callback();
  6548. });
  6549. this.logEventForClassic_start();
  6550. }
  6551. else {
  6552. Moyu.sendDataEvent("AddCoinVideo");
  6553. xGame.uiMgr.Show(UIAddProp, 0);
  6554. }
  6555. }
  6556. getRandPeople(index) {
  6557. let rand = this.peopleOffest[index];
  6558. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  6559. }
  6560. logEventForClassic_start() {
  6561. let rtype = xGame.common.classicRoomType;
  6562. let msmc = '';
  6563. if (rtype == 1) {
  6564. msmc = 'beginner';
  6565. }
  6566. if (rtype == 2) {
  6567. msmc = 'expert';
  6568. }
  6569. if (rtype == 3) {
  6570. msmc = 'master';
  6571. }
  6572. let keyStr = 'sjmd_classic_start_' + rtype;
  6573. let jsonStr = {
  6574. "difficulty": msmc,
  6575. "classic_count": 1,
  6576. "difficulty_count": 1
  6577. };
  6578. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6579. const d = LocalStorageManager.getItem(keyStr);
  6580. jsonStr.classic_count = d.classic_count + 1;
  6581. jsonStr.difficulty_count = d.difficulty_count + 1;
  6582. LocalStorageManager.setItem(keyStr, jsonStr);
  6583. }
  6584. else {
  6585. LocalStorageManager.setItem(keyStr, jsonStr);
  6586. }
  6587. const reqStr = JSON.stringify(jsonStr);
  6588. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  6589. }
  6590. }
  6591. UIModeSelection.uiName = "UIModeSelection";
  6592. class ui_UIReg extends fgui.GComponent {
  6593. static createInstance() {
  6594. return (fgui.UIPackage.createObject("game", "UIReg"));
  6595. }
  6596. onConstruct() {
  6597. this.n38 = (this.getChild("n38"));
  6598. this.n9 = (this.getChild("n9"));
  6599. this.n14 = (this.getChild("n14"));
  6600. this.n15 = (this.getChild("n15"));
  6601. this.n34 = (this.getChild("n34"));
  6602. this.closeBtn = (this.getChild("closeBtn"));
  6603. this.lab_tip = (this.getChild("lab_tip"));
  6604. this.n43 = (this.getChild("n43"));
  6605. this.txt_ua = (this.getChild("txt_ua"));
  6606. this.n44 = (this.getChild("n44"));
  6607. this.txt_up1 = (this.getChild("txt_up1"));
  6608. this.n45 = (this.getChild("n45"));
  6609. this.txt_up2 = (this.getChild("txt_up2"));
  6610. this.btn_gotoLogin = (this.getChild("btn_gotoLogin"));
  6611. this.btn_reg = (this.getChild("btn_reg"));
  6612. this.n50 = (this.getChild("n50"));
  6613. }
  6614. }
  6615. ui_UIReg.URL = "ui://isxx5ak7bobav57v";
  6616. class ui_UILogin extends fgui.GComponent {
  6617. static createInstance() {
  6618. return (fgui.UIPackage.createObject("game", "UILogin"));
  6619. }
  6620. onConstruct() {
  6621. this.c1 = this.getController("c1");
  6622. this.n18 = (this.getChild("n18"));
  6623. this.n7 = (this.getChild("n7"));
  6624. this.n5 = (this.getChild("n5"));
  6625. this.n6 = (this.getChild("n6"));
  6626. this.closeBtn = (this.getChild("closeBtn"));
  6627. this.btn_gotoReg = (this.getChild("btn_gotoReg"));
  6628. this.btn_login = (this.getChild("btn_login"));
  6629. this.n30 = (this.getChild("n30"));
  6630. this.n31 = (this.getChild("n31"));
  6631. this.txt_up = (this.getChild("txt_up"));
  6632. this.n32 = (this.getChild("n32"));
  6633. this.txt_ua = (this.getChild("txt_ua"));
  6634. }
  6635. }
  6636. ui_UILogin.URL = "ui://isxx5ak7bobav57u";
  6637. class UILogin extends UIBase {
  6638. constructor() {
  6639. super();
  6640. }
  6641. onConstructor() {
  6642. this.ui = ui_UILogin.createInstance();
  6643. this.contentPane = this.ui;
  6644. this.isEject = false;
  6645. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  6646. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  6647. this.addUIClick(this.ui.btn_login, this.userLogin);
  6648. }
  6649. show() {
  6650. super.show();
  6651. this.x = (Laya.stage.width - this.width) / 2;
  6652. this.y = (Laya.stage.height - this.height) / 2;
  6653. }
  6654. closeSelf() {
  6655. this.hide();
  6656. }
  6657. userLogin() {
  6658. let ua = this.ui.txt_ua.text;
  6659. let up = this.ui.txt_up.text;
  6660. if (ua && up) {
  6661. let reqData = JSON.stringify({
  6662. username: ua.trim(),
  6663. password: up.trim(),
  6664. fromMark: 'app_game'
  6665. });
  6666. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  6667. try {
  6668. console.log('zh:res = ' + JSON.stringify(res));
  6669. let code = res.code;
  6670. let msg = res.msg;
  6671. if (code == 200) {
  6672. let keyStr = 'userInfo';
  6673. let jsonStr = {
  6674. "username": res.username,
  6675. "token": res.token
  6676. };
  6677. LocalStorageManager.setItem(keyStr, jsonStr);
  6678. xGame.uiMgr.Show(UIMsg, msg);
  6679. this.closeSelf();
  6680. }
  6681. else {
  6682. xGame.uiMgr.Show(UIMsg, msg);
  6683. }
  6684. }
  6685. catch (error) {
  6686. console.log('error=' + error);
  6687. alert(error);
  6688. }
  6689. finally {
  6690. }
  6691. });
  6692. }
  6693. else {
  6694. xGame.uiMgr.Show(UIMsg, "Missing information!");
  6695. }
  6696. }
  6697. gotoRegPage() {
  6698. this.closeSelf();
  6699. xGame.uiMgr.Show(UIReg);
  6700. }
  6701. }
  6702. UILogin.uiName = "UILogin";
  6703. class UIReg extends UIBase {
  6704. constructor() {
  6705. super();
  6706. }
  6707. onConstructor() {
  6708. this.ui = ui_UIReg.createInstance();
  6709. this.contentPane = this.ui;
  6710. this.isEject = false;
  6711. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  6712. this.addUIClick(this.ui.btn_reg, this.regUser);
  6713. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  6714. }
  6715. show() {
  6716. super.show();
  6717. this.x = (Laya.stage.width - this.width) / 2;
  6718. this.y = (Laya.stage.height - this.height) / 2;
  6719. }
  6720. closeSelf() {
  6721. this.hide();
  6722. }
  6723. regUser() {
  6724. this.ui.lab_tip.visible = false;
  6725. let ua = this.ui.txt_ua.text;
  6726. let up1 = this.ui.txt_up1.text;
  6727. let up2 = this.ui.txt_up2.text;
  6728. if (ua && up1 && up2 && up1 == up2) {
  6729. let reqData = JSON.stringify({
  6730. username: ua.trim(),
  6731. password: up1.trim(),
  6732. fromMark: 'app_game'
  6733. });
  6734. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  6735. try {
  6736. console.log('zh:res = ' + JSON.stringify(res));
  6737. let code = res.code;
  6738. let msg = res.msg;
  6739. xGame.uiMgr.Show(UIMsg, msg);
  6740. if (code == 200) {
  6741. this.ui.lab_tip.color = "#FFFFFF";
  6742. xGame.uiMgr.Show(UIMsg, msg);
  6743. this.closeSelf();
  6744. }
  6745. else {
  6746. this.ui.lab_tip.color = "#FF0000";
  6747. xGame.uiMgr.Show(UIMsg, msg);
  6748. }
  6749. }
  6750. catch (error) {
  6751. console.log('error=' + error);
  6752. alert(error);
  6753. }
  6754. finally {
  6755. }
  6756. });
  6757. }
  6758. else {
  6759. if (up1 != up2) {
  6760. xGame.uiMgr.Show(UIMsg, "Password mismatch!");
  6761. }
  6762. else {
  6763. xGame.uiMgr.Show(UIMsg, "Missing information!");
  6764. }
  6765. }
  6766. }
  6767. gotoLogin() {
  6768. this.closeSelf();
  6769. xGame.uiMgr.Show(UILogin);
  6770. }
  6771. }
  6772. UIReg.uiName = "UIReg";
  6773. class ui_UIGetAward extends fgui.GComponent {
  6774. static createInstance() {
  6775. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  6776. }
  6777. onConstruct() {
  6778. this.n4 = (this.getChild("n4"));
  6779. this.n0 = (this.getChild("n0"));
  6780. this.myList = (this.getChild("myList"));
  6781. this.n1 = (this.getChild("n1"));
  6782. this.eftNode = (this.getChild("eftNode"));
  6783. this.btnNode = (this.getChild("btnNode"));
  6784. this.t0 = this.getTransition("t0");
  6785. }
  6786. }
  6787. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  6788. class UIGetAward extends UIBase {
  6789. constructor() {
  6790. super();
  6791. this.showTriple = true;
  6792. }
  6793. onConstructor() {
  6794. this.ui = ui_UIGetAward.createInstance();
  6795. this.contentPane = this.ui;
  6796. this.isEject = false;
  6797. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  6798. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  6799. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  6800. }
  6801. show(arr, showTriple, callback) {
  6802. super.show();
  6803. this.ui.t0.play();
  6804. this.ui.eftNode.visible = true;
  6805. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  6806. this.ui.eftNode.visible = false;
  6807. }), 1, 0, 0, 0.9);
  6808. this.awardArr = arr;
  6809. this.showTriple = showTriple;
  6810. this.callback = callback;
  6811. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  6812. this.ui.myList.numItems = arr.length;
  6813. xGame.soundMgr.playSound("getaward");
  6814. }
  6815. updateSelf(index, obj) {
  6816. let temp = this.awardArr[index];
  6817. let icon = this.getIcon(temp.type);
  6818. let str = icon;
  6819. if (temp.type > 2) {
  6820. str = "s" + icon;
  6821. }
  6822. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  6823. obj.myIcon.rotation = 0;
  6824. obj.numTxt.text = temp.num + "";
  6825. obj.numTxt.visible = temp.type > 2 ? false : true;
  6826. obj.nameTxt.text = this.getNameStr(temp.type);
  6827. }
  6828. renderItem(index, obj) {
  6829. this.updateSelf(index, obj);
  6830. }
  6831. tripleGetAward() {
  6832. console.log('zh:qjff_AD_for_uigetAward');
  6833. if (Laya.Browser.onAndroid) {
  6834. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  6835. if (!boo) {
  6836. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  6837. return;
  6838. }
  6839. }
  6840. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  6841. }
  6842. else {
  6843. console.log('zh:AD 失败,直接发放奖励');
  6844. this.qjff_AD_for_uigetAward();
  6845. }
  6846. }
  6847. qjff_AD_for_uigetAward() {
  6848. this.getAward(3);
  6849. }
  6850. normalGetAward() {
  6851. if (PlatMgr.isMisVideo())
  6852. this.tripleGetAward();
  6853. else
  6854. this.getAward();
  6855. }
  6856. getAward(times = 1) {
  6857. this.hide();
  6858. for (let index = 0; index < this.awardArr.length; index++) {
  6859. this.awardArr[index].num *= times;
  6860. }
  6861. this.callback && this.callback(times != 1);
  6862. }
  6863. getIcon(type) {
  6864. switch (type) {
  6865. case Prop.diamond:
  6866. return "ty_zs";
  6867. case Prop.coin:
  6868. return "ty_jb";
  6869. case Prop.gan1:
  6870. return "qg1";
  6871. case Prop.gan2:
  6872. return "qg2";
  6873. case Prop.gan3:
  6874. return "qg3";
  6875. case Prop.gan4:
  6876. return "qg4";
  6877. default:
  6878. break;
  6879. }
  6880. }
  6881. getNameStr(type) {
  6882. switch (type) {
  6883. case Prop.diamond:
  6884. return "Diamond";
  6885. case Prop.coin:
  6886. return "Coins";
  6887. case Prop.gan1:
  6888. case Prop.gan2:
  6889. case Prop.gan3:
  6890. case Prop.gan4:
  6891. return cfgTable.ballrodData[type - 1].name;
  6892. default:
  6893. break;
  6894. }
  6895. }
  6896. }
  6897. UIGetAward.uiName = "UIGetAward";
  6898. class ui_UIRepentProp extends fgui.GComponent {
  6899. static createInstance() {
  6900. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  6901. }
  6902. onConstruct() {
  6903. this.c1 = this.getController("c1");
  6904. this.n11 = (this.getChild("n11"));
  6905. this.regretNode = (this.getChild("regretNode"));
  6906. this.helpLineNode = (this.getChild("helpLineNode"));
  6907. this.t0 = this.getTransition("t0");
  6908. }
  6909. }
  6910. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  6911. class UIRepentProp extends UIBase {
  6912. constructor() {
  6913. super();
  6914. this.viewType = 0;
  6915. this.regretType = 0;
  6916. }
  6917. onConstructor() {
  6918. this.ui = ui_UIRepentProp.createInstance();
  6919. this.contentPane = this.ui;
  6920. this.isEject = false;
  6921. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  6922. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  6923. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  6924. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  6925. }
  6926. show(viewType, regretType, callback) {
  6927. PlatMgr.showInsert(true);
  6928. this.viewType = viewType;
  6929. this.regretType = regretType;
  6930. this.callback = callback;
  6931. super.show();
  6932. this.ui.t0.play();
  6933. this.ui.c1.selectedIndex = this.viewType;
  6934. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  6935. if (this.viewType == 0) {
  6936. let guide = DataMgr.getGuideHelpLine();
  6937. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  6938. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  6939. }
  6940. xGame.common.gameMgr.gamePause = true;
  6941. }
  6942. hideSelf() {
  6943. xGame.common.gameMgr.gamePause = false;
  6944. this.callback && this.callback(false);
  6945. this.hide();
  6946. }
  6947. videoRegret() {
  6948. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  6949. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  6950. }
  6951. else {
  6952. console.log('zh:AD 失败,直接发放奖励');
  6953. this.qjff_AD_for_UIrepentProp_videoRegret();
  6954. }
  6955. }
  6956. qjff_AD_for_UIrepentProp_videoRegret() {
  6957. this.callback && this.callback(true);
  6958. this.hideSelf();
  6959. }
  6960. videoAddHelpLine() {
  6961. let guide = DataMgr.getGuideHelpLine();
  6962. if (guide == 0) {
  6963. this.callback && this.callback(true);
  6964. this.hideSelf();
  6965. DataMgr.setGuideHelpLine();
  6966. xGame.common.gameUI.ui.guideNode.visible = false;
  6967. }
  6968. else {
  6969. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  6970. if (Laya.Browser.onAndroid) {
  6971. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  6972. if (!boo) {
  6973. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  6974. return;
  6975. }
  6976. }
  6977. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  6978. }
  6979. else {
  6980. console.log('zh:AD 失败,直接发放奖励');
  6981. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  6982. }
  6983. }
  6984. }
  6985. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  6986. this.callback && this.callback(true);
  6987. this.hideSelf();
  6988. }
  6989. }
  6990. UIRepentProp.uiName = "UIRepentProp";
  6991. class UIMain extends UIBase {
  6992. constructor() {
  6993. super();
  6994. this.firstEnter = true;
  6995. }
  6996. nativeCallJs(msg) {
  6997. let t = msg;
  6998. console.log("zh: nativeCallJs 奖励开始发放:", t);
  6999. switch (t) {
  7000. case 'qjff_chouJiang':
  7001. let dui = xGame.uiMgr.getUI(UIDraw);
  7002. dui.qjff_chouJiang();
  7003. break;
  7004. case 'qjff_AD_for_uisign':
  7005. let dui2 = xGame.uiMgr.getUI(UISign);
  7006. dui2.qjff_AD_for_uisign();
  7007. break;
  7008. case 'qjff_AD_for_uitry':
  7009. let dui3 = xGame.uiMgr.getUI(UITry);
  7010. dui3.qjff_AD_for_uitry();
  7011. break;
  7012. case 'qjff_AD_for_uipower':
  7013. let dui4 = xGame.uiMgr.getUI(UIPower);
  7014. dui4.qjff_AD_for_uipower();
  7015. break;
  7016. case 'qjff_AD_for_uigetAward':
  7017. let dui5 = xGame.uiMgr.getUI(UIGetAward);
  7018. dui5.qjff_AD_for_uigetAward();
  7019. break;
  7020. case 'qjff_AD_for_uiGameEnd':
  7021. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  7022. let dui6 = xGame.uiMgr.getUI(UIGameEnd);
  7023. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  7024. break;
  7025. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  7026. let dui7 = xGame.uiMgr.getUI(UIAddProp);
  7027. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  7028. break;
  7029. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  7030. let dui8 = xGame.uiMgr.getUI(UIAddProp);
  7031. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  7032. break;
  7033. case 'qjff_AD_for_UIrepentProp_videoRegret':
  7034. let dui9 = xGame.uiMgr.getUI(UIRepentProp);
  7035. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  7036. break;
  7037. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  7038. let dui10 = xGame.uiMgr.getUI(UIRepentProp);
  7039. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7040. break;
  7041. case 'qjff_AD_for_UIBOX_onOpenBox':
  7042. let dui11 = xGame.uiMgr.getUI(UIBox);
  7043. dui11.qjff_AD_for_UIBOX_onOpenBox();
  7044. break;
  7045. case 'qjff_AD_for_UIAddCoin':
  7046. let dui12 = xGame.uiMgr.getUI(UIAddCoin);
  7047. dui12.qjff_AD_for_UIAddCoin();
  7048. break;
  7049. case '111a':
  7050. let dui14 = xGame.uiMgr.getUI(UISign);
  7051. dui14.qjff_AD_for_uisign();
  7052. break;
  7053. case '222a':
  7054. let dui15 = xGame.uiMgr.getUI(UISign);
  7055. dui15.qjff_AD_for_uisign();
  7056. break;
  7057. case '333a':
  7058. let dui16 = xGame.uiMgr.getUI(UISign);
  7059. dui16.qjff_AD_for_uisign();
  7060. break;
  7061. default:
  7062. console.log('zh:未知的方法名字' + t);
  7063. break;
  7064. }
  7065. }
  7066. onConstructor() {
  7067. console.log('zh: UIMain onConstructor');
  7068. this.ui = ui_UIMain.createInstance();
  7069. this.contentPane = this.ui;
  7070. this.isEject = false;
  7071. this.addEvent();
  7072. this.addClickSpine();
  7073. this.settingNode = new SettingNode(this.ui.settingNode);
  7074. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  7075. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  7076. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  7077. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  7078. let curUse = DataMgr.getCurSecretary();
  7079. this.changeSecretary(curUse);
  7080. this.ui.talkNode.visible = false;
  7081. let guide = DataMgr.getSkillGuide();
  7082. if (xGame.common.isNewDay && guide == 1) {
  7083. xGame.common.isNewDay = false;
  7084. xGame.soundMgr.playSound("s_main01");
  7085. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7086. console.log("zh:播放小秘书每天语音");
  7087. }
  7088. this.onGetUserInfo();
  7089. this.ui.n83.visible = false;
  7090. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7091. const d = LocalStorageManager.getItem(keyForLoginInfo);
  7092. let ua = d.username;
  7093. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  7094. }
  7095. this.c_btn_for_user();
  7096. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  7097. }
  7098. Logout() {
  7099. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7100. LocalStorageManager.removeItem(keyForLoginInfo);
  7101. this.freshUser();
  7102. }
  7103. }
  7104. gotoLogin() {
  7105. xGame.uiMgr.Show(UILogin);
  7106. }
  7107. gotoRegUser() {
  7108. xGame.uiMgr.Show(UIReg);
  7109. }
  7110. c_btn_for_user() {
  7111. this.ui.n_Logout.visible = false;
  7112. this.ui.n_dengLu.visible = false;
  7113. this.ui.n_zhuCe.visible = false;
  7114. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7115. this.ui.n_Logout.visible = true;
  7116. }
  7117. else {
  7118. this.ui.n_dengLu.visible = true;
  7119. }
  7120. }
  7121. changeSecretary(curUse) {
  7122. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  7123. xGame.common.secretary && xGame.common.secretary.dispose();
  7124. this.addSecretarySpine(name);
  7125. }
  7126. addSecretarySpine(name) {
  7127. let spine = new SpineMgr(name, () => {
  7128. this.playSecretaryIdle();
  7129. });
  7130. xGame.common.secretary = spine;
  7131. }
  7132. addClickSpine() {
  7133. let clickSpine = new SpineMgr("dianji", () => {
  7134. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  7135. let parent = Laya.stage;
  7136. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  7137. clickSpine.play(data, 0, false, parent, (spine) => {
  7138. spine.destroy(true);
  7139. });
  7140. });
  7141. });
  7142. }
  7143. addEvent() {
  7144. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  7145. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  7146. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  7147. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  7148. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  7149. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  7150. this.addUIClick(this.ui, this.interuptSecretary);
  7151. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  7152. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  7153. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  7154. this.addUIClick(this.ui.shopBtn, this.openShopView);
  7155. this.addUIClick(this.ui.signBtn, this.openSignView);
  7156. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  7157. this.addUIClick(this.ui.rankBtn, this.openRanking);
  7158. this.addUIClick(this.ui.n_Logout, this.Logout);
  7159. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  7160. this.addUIClick(this.ui.n_zhuCe, this.gotoRegUser);
  7161. }
  7162. show(showFailWords) {
  7163. super.show();
  7164. this.moneyNode.ui.c1.selectedIndex = 1;
  7165. this.playSecretaryIdle();
  7166. xGame.soundMgr.playMusic("caromhall01", 0);
  7167. Laya.timer.clearAll(this);
  7168. this.playSecretaryRandomSound();
  7169. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  7170. if (showFailWords) {
  7171. console.log('zh:uimain.ts ');
  7172. setTimeout(() => {
  7173. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  7174. let words = -1;
  7175. if (str == "s_main02") {
  7176. words = 2;
  7177. }
  7178. else {
  7179. words = 3;
  7180. }
  7181. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7182. xGame.soundMgr.playSound(str);
  7183. }, 300);
  7184. }
  7185. this.showGuide();
  7186. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  7187. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  7188. let guide = DataMgr.getSkillGuide();
  7189. if (guide == 1) {
  7190. let randTime = xGame.common.randomNum(300, 800);
  7191. if (this.firstEnter) {
  7192. console.log("zh: firstEnter");
  7193. this.firstEnter = false;
  7194. randTime += 900;
  7195. }
  7196. else {
  7197. console.log("zh: no firstEnter");
  7198. }
  7199. Laya.timer.once(randTime, this, () => {
  7200. xGame.common.autoPopUIView();
  7201. });
  7202. }
  7203. }
  7204. checkActive(show) {
  7205. }
  7206. showGuide() {
  7207. let guide = DataMgr.getSkillGuide();
  7208. this.ui.guideBtn.visible = guide == 0;
  7209. this.ui.enterGuide.visible = false;
  7210. this.ui.secretaryGuide.visible = guide == 0;
  7211. if (guide == 0) {
  7212. console.log("zh:显示引导");
  7213. xGame.soundMgr.playSound("s_guide");
  7214. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7215. }
  7216. else {
  7217. console.log("zh:不需要显示引导");
  7218. }
  7219. }
  7220. ensureSecretary() {
  7221. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  7222. this.ui.secretaryGuide.visible = false;
  7223. this.ui.enterGuide.visible = true;
  7224. this.ui.wordsNode.t0.play();
  7225. if (DataMgr.getNewUser())
  7226. Moyu.sendDataEvent("gameReady");
  7227. }
  7228. playSecretaryIdle() {
  7229. let parent = this.ui.secretary.displayObject;
  7230. parent.destroyChildren();
  7231. let xx = this.ui.secretary.width / 2;
  7232. let yy = this.ui.secretary.height;
  7233. let scale = xGame.common.getSecretaryScale();
  7234. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7235. console.log("zh:playSecretaryIdle", data);
  7236. xGame.common.secretary.play(data, 0, true, parent);
  7237. }
  7238. startGame(type) {
  7239. xGame.common.gameMode = type;
  7240. Moyu.sendDataEvent("PlayGame", { type: type });
  7241. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  7242. switch (xGame.common.gameMode) {
  7243. case GameMode.classic:
  7244. console.log('zh:进入经典模式111111111');
  7245. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  7246. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7247. console.log('zh:classic db_over_lev=', db_over_lev);
  7248. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  7249. console.log('zh:判断是否可以玩该模式classic =NO');
  7250. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  7251. xGame.uiMgr.Show(UIMsg, tipStr);
  7252. return;
  7253. }
  7254. else {
  7255. console.log('zh:可以玩该模式classic 66666666666666');
  7256. this.beginGame();
  7257. }
  7258. }
  7259. else {
  7260. console.log('zh:不需要判断是否可以玩该classic');
  7261. let challengeTimes = DataMgr.getChallengeTimes();
  7262. if (challengeTimes == 0) {
  7263. xGame.uiMgr.Show(UIInvitation);
  7264. }
  7265. else {
  7266. this.beginGame();
  7267. }
  7268. break;
  7269. }
  7270. case GameMode.bigMove:
  7271. console.error('zh:bigMove check');
  7272. let guide = DataMgr.getSkillGuide();
  7273. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  7274. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7275. console.log('zh:bigMove db_over_lev=', db_over_lev);
  7276. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  7277. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  7278. xGame.uiMgr.Show(UIMsg, tipStr);
  7279. return;
  7280. }
  7281. else {
  7282. console.log('zh:可以玩该模式 bigMove');
  7283. this.beginGame();
  7284. if (DataMgr.getNewUser())
  7285. Moyu.sendDataEvent("gameStart0");
  7286. }
  7287. }
  7288. else {
  7289. this.beginGame();
  7290. if (DataMgr.getNewUser())
  7291. Moyu.sendDataEvent("gameStart0");
  7292. }
  7293. break;
  7294. default:
  7295. console.error('zh:未知错误!!!!');
  7296. break;
  7297. }
  7298. }
  7299. beginGame(isNice = false) {
  7300. console.log('zh:beginGame ');
  7301. let guide = DataMgr.getSkillGuide();
  7302. if (guide == 1) {
  7303. console.log('zh:非新手引导,showInternAd ');
  7304. JSBridgeUtils.instance.showInternAd('beginGame');
  7305. }
  7306. else {
  7307. console.log('zh:新手引导,不显示AD ');
  7308. }
  7309. console.log('zh:beginGame 2 go');
  7310. if (xGame.common.gameMode == GameMode.classic) {
  7311. if (isNice) {
  7312. this.enterClassic();
  7313. }
  7314. else {
  7315. xGame.uiMgr.Show(UIModeSelection, () => {
  7316. console.log('zh:BBBBBBBBBBBBBBB');
  7317. this.enterClassic();
  7318. });
  7319. }
  7320. }
  7321. else if (xGame.common.gameMode == GameMode.bigMove) {
  7322. this.ui.enterGuide.visible = false;
  7323. xGame.uiMgr.Show(UISkill);
  7324. }
  7325. }
  7326. enterClassic() {
  7327. xGame.uiMgr.Show(UIGame);
  7328. xGame.uiMgr.Show(UIMatching, () => {
  7329. if (!this.isHide)
  7330. this.hide();
  7331. xGame.common.gameUI.ui.alpha = 1;
  7332. xGame.common.gameUI.startGame();
  7333. xGame.uiMgr.Hide(UIGameEnd);
  7334. });
  7335. }
  7336. startGlobal() {
  7337. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  7338. }
  7339. startWeekly() {
  7340. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  7341. }
  7342. zhouSaiMonth() {
  7343. console.log('zh: zhouSaiMonth 被调用');
  7344. }
  7345. startPlaceBall() {
  7346. xGame.uiMgr.Show(UILevelDisplay);
  7347. }
  7348. hide() {
  7349. console.log('zh:uimain hide ...');
  7350. super.hide();
  7351. xGame.common.stopGirlPop(this.ui.talkNode);
  7352. }
  7353. onGetUserInfo(force = false) {
  7354. if (Moyu.isWx) {
  7355. let info = Moyu.getSystemInfo();
  7356. if (info)
  7357. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  7358. }
  7359. else {
  7360. Moyu.initUser(this, this.freshUser, force);
  7361. }
  7362. this.freshUser();
  7363. }
  7364. freshUser() {
  7365. let user = Moyu.getUserInfo();
  7366. if (!user.isAuth) {
  7367. user.headIcon = 'res/ty_touxiang.png';
  7368. }
  7369. else {
  7370. DataMgr.upRankData();
  7371. }
  7372. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  7373. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  7374. let keyStr = keyForLoginInfo;
  7375. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7376. const d = LocalStorageManager.getItem(keyStr);
  7377. let ua = d.username;
  7378. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  7379. }
  7380. else {
  7381. }
  7382. this.c_btn_for_user();
  7383. }
  7384. interuptSecretary() {
  7385. Laya.timer.clearAll(this);
  7386. this.playSecretaryRandomSound();
  7387. }
  7388. playSecretaryRandomSound() {
  7389. if (this.isHide)
  7390. return;
  7391. let time = xGame.common.randomNum(45000, 60000);
  7392. Laya.timer.once(time, this, () => {
  7393. if (this.isHide)
  7394. return;
  7395. let index = xGame.common.randomNum(4, 7);
  7396. xGame.soundMgr.playSound("s_main0" + index);
  7397. let words = 1;
  7398. switch (index) {
  7399. case 4:
  7400. words = 5;
  7401. break;
  7402. case 5:
  7403. words = 3;
  7404. break;
  7405. case 6:
  7406. words = 6;
  7407. break;
  7408. case 7:
  7409. words = 7;
  7410. break;
  7411. default:
  7412. break;
  7413. }
  7414. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7415. this.playSecretaryRandomSound();
  7416. });
  7417. }
  7418. openSecretaryView() {
  7419. xGame.uiMgr.Show(UISecretary);
  7420. Moyu.sendDataEvent("secretary");
  7421. }
  7422. openShopView() {
  7423. xGame.uiMgr.Show(UIShop, 0);
  7424. }
  7425. openSignView() {
  7426. xGame.uiMgr.Show(UISign);
  7427. }
  7428. openDrawView() {
  7429. xGame.uiMgr.Show(UIDraw);
  7430. }
  7431. openRanking() {
  7432. console.log('zh:phb openRanking');
  7433. xGame.uiMgr.Show(UIRanking);
  7434. Moyu.sendDataEvent("rankingList");
  7435. }
  7436. }
  7437. UIMain.uiName = "UIMain";
  7438. class UIGameEnd extends UIBase {
  7439. constructor() {
  7440. super();
  7441. this.success = false;
  7442. this.awardCoinNum = 1000;
  7443. this.awardDiamondNum = 10;
  7444. }
  7445. onConstructor() {
  7446. this.ui = ui_UIGameEnd.createInstance();
  7447. this.contentPane = this.ui;
  7448. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  7449. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  7450. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  7451. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  7452. this.ui.talkNode.visible = false;
  7453. if (Moyu.isKs)
  7454. this.ui.closeNode.closeBtn.x += 100;
  7455. }
  7456. updateType() {
  7457. switch (xGame.common.gameMode) {
  7458. case GameMode.classic:
  7459. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  7460. this.ui.coinNode.visible = this.success;
  7461. if (!this.success) {
  7462. Laya.timer.once(500, this, () => {
  7463. xGame.uiMgr.Show(UIAddCoin);
  7464. });
  7465. }
  7466. else {
  7467. this.logEventForClassic_win();
  7468. }
  7469. this.logEventForClassic_complete();
  7470. this.ui.isGetAward.visible = false;
  7471. this.ui.leftBtn.c1.selectedIndex = 3;
  7472. this.ui.rightBtn.c1.selectedIndex = 0;
  7473. this.moneyNode.ui.c1.selectedIndex = 1;
  7474. break;
  7475. case GameMode.bigMove:
  7476. console.log('zh:招法模式 aaaaaa bigMove');
  7477. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  7478. this.ui.coinNode.visible = this.success;
  7479. if (xGame.common.gameMode == GameMode.bigMove) {
  7480. if (this.success) {
  7481. DataMgr.setSkillSuccessTimes(1, true);
  7482. DataMgr.setSkillAccTimes(1);
  7483. }
  7484. else {
  7485. DataMgr.setSkillSuccessTimes(0, false);
  7486. }
  7487. }
  7488. this.logEventForRod_complete_N();
  7489. if (!this.success) {
  7490. Laya.timer.once(500, this, () => {
  7491. xGame.uiMgr.Show(UIAddCoin);
  7492. });
  7493. }
  7494. else {
  7495. this.logEventForRod_win();
  7496. }
  7497. this.ui.isGetAward.visible = false;
  7498. this.ui.leftBtn.c1.selectedIndex = 3;
  7499. this.ui.rightBtn.c1.selectedIndex = 0;
  7500. this.moneyNode.ui.c1.selectedIndex = 1;
  7501. break;
  7502. case GameMode.placeBall:
  7503. this.ui.coinNode.visible = false;
  7504. if (this.success) {
  7505. if (xGame.common.placeBallStarNum == 3) {
  7506. this.ui.c1.selectedIndex = 2;
  7507. }
  7508. else {
  7509. this.ui.c1.selectedIndex = 3;
  7510. }
  7511. let level = xGame.common.placeBallCurLevel;
  7512. if (level > 59) {
  7513. this.logEventForChallenge_level_complete(level);
  7514. }
  7515. else {
  7516. this.logEventForChallenge_level_N(level);
  7517. }
  7518. }
  7519. else {
  7520. this.ui.c1.selectedIndex = 4;
  7521. }
  7522. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  7523. if (cfg.type == PlaceBallType.challenge) {
  7524. this.ui.c1.selectedIndex = 2;
  7525. }
  7526. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  7527. this.updatePlaceBallBtn();
  7528. this.updatePlaceBallStarNum();
  7529. this.updatePlaceBallAwardState();
  7530. this.moneyNode.ui.c1.selectedIndex = 2;
  7531. this.moneyNode.checkPowerTime();
  7532. this.moneyNode.powerChange();
  7533. DataMgr.upRankData();
  7534. break;
  7535. default:
  7536. break;
  7537. }
  7538. }
  7539. logEventForRod_complete_N() {
  7540. let gfmsIdx = xGame.common.curPlayerSkillType;
  7541. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  7542. let gfmc = 'Skyfall Shot';
  7543. if (gfmsIdx == 0) {
  7544. gfmc = 'Skyfall Shot';
  7545. }
  7546. if (gfmsIdx == 1) {
  7547. gfmc = 'Surging break';
  7548. }
  7549. if (gfmsIdx == 2) {
  7550. gfmc = 'Frost Lock';
  7551. }
  7552. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  7553. console.log('zh:logEventForRod_complete_N level = ' + level);
  7554. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  7555. let jsonStr = {
  7556. "count": 0,
  7557. "name": gfmc
  7558. };
  7559. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7560. const d = LocalStorageManager.getItem(keyStr);
  7561. jsonStr.count = d.count + 1;
  7562. LocalStorageManager.setItem(keyStr, jsonStr);
  7563. }
  7564. else {
  7565. LocalStorageManager.setItem(keyStr, jsonStr);
  7566. }
  7567. const d2 = LocalStorageManager.getItem(keyStr);
  7568. let count = d2.count;
  7569. console.log('zh:logEventForRod_complete_N count = ' + count);
  7570. if (count % 5 == 0) {
  7571. const reqStr = JSON.stringify(jsonStr);
  7572. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  7573. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  7574. }
  7575. }
  7576. logEventForRod_win() {
  7577. console.log('zh:logEventForRod_win,胜利');
  7578. let gfmsIdx = xGame.common.curPlayerSkillType;
  7579. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  7580. let gfmc = 'Skyfall Shot';
  7581. if (gfmsIdx == 0) {
  7582. gfmc = 'Skyfall Shot';
  7583. }
  7584. if (gfmsIdx == 1) {
  7585. gfmc = 'Surging break';
  7586. }
  7587. if (gfmsIdx == 2) {
  7588. gfmc = 'Frost Lock';
  7589. }
  7590. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  7591. console.log('zh:logEventForRod_win level = ' + level);
  7592. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  7593. let jsonStr = {
  7594. "count": 1,
  7595. "name": gfmc + ' Lev' + level
  7596. };
  7597. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7598. const d = LocalStorageManager.getItem(keyStr);
  7599. jsonStr.count = d.count + 1;
  7600. LocalStorageManager.setItem(keyStr, jsonStr);
  7601. }
  7602. else {
  7603. LocalStorageManager.setItem(keyStr, jsonStr);
  7604. }
  7605. const reqStr = JSON.stringify(jsonStr);
  7606. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  7607. }
  7608. logEventForClassic_win() {
  7609. console.log('zh:logEventForClassic_win,胜利');
  7610. let rtype = xGame.common.classicRoomType;
  7611. let msmc = '';
  7612. if (rtype == 1) {
  7613. msmc = 'beginner';
  7614. }
  7615. if (rtype == 2) {
  7616. msmc = 'expert';
  7617. }
  7618. if (rtype == 3) {
  7619. msmc = 'master';
  7620. }
  7621. let keyStr = 'sjmd_classic_win_' + rtype;
  7622. let jsonStr = {
  7623. "difficulty": msmc,
  7624. "classic_count": 1,
  7625. "difficulty_count": 1
  7626. };
  7627. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7628. const d = LocalStorageManager.getItem(keyStr);
  7629. jsonStr.classic_count = d.classic_count + 1;
  7630. jsonStr.difficulty_count = d.difficulty_count + 1;
  7631. LocalStorageManager.setItem(keyStr, jsonStr);
  7632. }
  7633. else {
  7634. LocalStorageManager.setItem(keyStr, jsonStr);
  7635. }
  7636. const reqStr = JSON.stringify(jsonStr);
  7637. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  7638. }
  7639. logEventForClassic_complete() {
  7640. console.log('zh:logEventForClassic_complete,胜利');
  7641. let rtype = xGame.common.classicRoomType;
  7642. let msmc = '';
  7643. if (rtype == 1) {
  7644. msmc = 'beginner';
  7645. }
  7646. if (rtype == 2) {
  7647. msmc = 'expert';
  7648. }
  7649. if (rtype == 3) {
  7650. msmc = 'master';
  7651. }
  7652. let keyStr = 'sjmd_classic_complete_' + rtype;
  7653. let jsonStr = {
  7654. "msmc": msmc,
  7655. "count": 0
  7656. };
  7657. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7658. const d = LocalStorageManager.getItem(keyStr);
  7659. jsonStr.count = d.count + 1;
  7660. LocalStorageManager.setItem(keyStr, jsonStr);
  7661. }
  7662. else {
  7663. LocalStorageManager.setItem(keyStr, jsonStr);
  7664. }
  7665. if (jsonStr.count % 5 == 0) {
  7666. const reqStr = JSON.stringify(jsonStr);
  7667. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  7668. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  7669. }
  7670. }
  7671. updatePlaceBallBtn() {
  7672. this.ui.leftBtn.c1.selectedIndex = 5;
  7673. if (this.success) {
  7674. this.ui.rightBtn.c1.selectedIndex = 14;
  7675. }
  7676. else {
  7677. if (xGame.common.placeBallStarNum == 3) {
  7678. this.ui.rightBtn.c1.selectedIndex = 14;
  7679. }
  7680. else {
  7681. this.ui.rightBtn.c1.selectedIndex = 1;
  7682. }
  7683. }
  7684. }
  7685. updatePlaceBallStarNum() {
  7686. let starNum = xGame.common.placeBallStarNum;
  7687. if (starNum == 0)
  7688. this.ui.starNumNode.c1.selectedIndex = 3;
  7689. else {
  7690. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  7691. }
  7692. }
  7693. updatePlaceBallAwardState() {
  7694. let level = xGame.common.placeBallCurLevel;
  7695. let starNum = xGame.common.placeBallStarNum;
  7696. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  7697. let data = cfgTable.placeballData[level].award;
  7698. let cfg = cfgTable.placeballData[level];
  7699. this.awardDiamondNum = data[1];
  7700. this.awardCoinNum = data[0];
  7701. if (cfg.type == PlaceBallType.challenge) {
  7702. this.awardDiamondNum = 0;
  7703. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  7704. }
  7705. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  7706. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  7707. if (cfg.type == PlaceBallType.challenge) {
  7708. this.ui.awardNode.coinNode.visible = true;
  7709. }
  7710. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  7711. this.ui.awardNode.diamondNode.x = 265;
  7712. this.ui.awardNode.coinNode.x = 354;
  7713. }
  7714. else {
  7715. this.ui.awardNode.diamondNode.x = 291;
  7716. this.ui.awardNode.coinNode.x = 291;
  7717. }
  7718. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  7719. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  7720. if (this.awardCoinNum == 0) {
  7721. this.ui.awardNode.coinNode.numTxt.text = "";
  7722. }
  7723. if (getAward) {
  7724. this.ui.isGetAward.visible = true;
  7725. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  7726. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  7727. }
  7728. else {
  7729. this.ui.isGetAward.visible = false;
  7730. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  7731. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  7732. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  7733. }
  7734. else {
  7735. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  7736. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  7737. }
  7738. }
  7739. }
  7740. show(success) {
  7741. super.show();
  7742. xGame.eventMgr.event(RESET_GAME);
  7743. this.success = success;
  7744. Laya.timer.clearAll(this);
  7745. this.playSecretaryAni();
  7746. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  7747. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  7748. offsetTime = Math.floor(offsetTime / 1000);
  7749. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  7750. this.updateType();
  7751. Laya.timer.once(200, this, () => {
  7752. this.addAward(() => {
  7753. this.updateType();
  7754. Laya.timer.once(500, this, () => {
  7755. this.showChallengeLevel();
  7756. });
  7757. });
  7758. });
  7759. if (this.success) {
  7760. JSBridgeUtils.instance.showInternAd('gameend_success');
  7761. console.log('zh:game end 成功');
  7762. xGame.soundMgr.playSound('slots_roll01');
  7763. xGame.soundMgr.playSound("s_win");
  7764. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7765. this.diyGameDataUtilForGameWin();
  7766. }
  7767. else {
  7768. JSBridgeUtils.instance.showInternAd('gameend_faill');
  7769. console.log('zh:game end失败');
  7770. xGame.soundMgr.playSound('matchwin01');
  7771. xGame.soundMgr.playSound("s_lose");
  7772. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7773. }
  7774. let challengeNum = DataMgr.getChallengeTimes();
  7775. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  7776. DataMgr.setChallengeTimes(1);
  7777. }
  7778. if (this.success && xGame.common.gameMode == GameMode.classic) {
  7779. DataMgr.setClassicTimes();
  7780. }
  7781. }
  7782. diyGameDataUtilForGameWin() {
  7783. console.log('zh: DiyGameDataUtilForGameWin diy ');
  7784. switch (xGame.common.gameMode) {
  7785. case GameMode.classic:
  7786. console.log('zh:DiyGameDataUtilForGameWin 111');
  7787. case GameMode.bigMove:
  7788. console.log('zh:DiyGameDataUtilForGameWin 222');
  7789. this.restartGame();
  7790. break;
  7791. case GameMode.placeBall:
  7792. console.log('zh:DiyGameDataUtilForGameWin 333');
  7793. var level = xGame.common.placeBallCurLevel;
  7794. console.log('zh:练习模式 联系了多少LEV=' + level);
  7795. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7796. if (level > db_over_lev) {
  7797. DataMgr.setChallengeMode_overLev(level);
  7798. }
  7799. break;
  7800. default:
  7801. console.log('zh:DiyGameDataUtilForGameWin 444');
  7802. break;
  7803. }
  7804. }
  7805. showChallengeLevel() {
  7806. if (DataMgr.getChallengeTimes() != 0)
  7807. return;
  7808. let skill = DataMgr.getSkillAccTimes();
  7809. let put = DataMgr.getPlaceBallLevelList().length;
  7810. if (skill >= 3 || put >= 5) {
  7811. xGame.uiMgr.Show(UIInvitation);
  7812. this.hide();
  7813. }
  7814. }
  7815. addAward(callback) {
  7816. if (!this.success) {
  7817. callback && callback();
  7818. return;
  7819. }
  7820. switch (xGame.common.gameMode) {
  7821. case GameMode.classic:
  7822. this.awardCoinNum = xGame.common.passAwardCoin;
  7823. this.awardDiamondNum = 0;
  7824. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  7825. break;
  7826. case GameMode.bigMove:
  7827. this.awardCoinNum = xGame.common.passAwardCoin;
  7828. this.awardDiamondNum = 0;
  7829. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  7830. callback && callback();
  7831. break;
  7832. case GameMode.placeBall:
  7833. let level = xGame.common.placeBallCurLevel;
  7834. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  7835. if (xGame.common.placeBallStarNum != 3) {
  7836. callback && callback();
  7837. return;
  7838. }
  7839. else {
  7840. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  7841. if (getAward) {
  7842. callback && callback();
  7843. return;
  7844. }
  7845. }
  7846. let cfg = cfgTable.placeballData[level];
  7847. let data = cfgTable.placeballData[level].award;
  7848. this.awardCoinNum = data[0];
  7849. this.awardDiamondNum = data[1];
  7850. if (cfg.type == PlaceBallType.challenge) {
  7851. this.awardDiamondNum = 0;
  7852. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  7853. }
  7854. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  7855. let diamondAward;
  7856. if (this.awardDiamondNum > 0) {
  7857. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  7858. xGame.common.getAward([diamondAward, coinAward], callback);
  7859. }
  7860. else {
  7861. xGame.common.getAward([coinAward], callback);
  7862. }
  7863. if (cfg.type == PlaceBallType.normal) {
  7864. DataMgr.setPlaceBallAward(level);
  7865. }
  7866. break;
  7867. default:
  7868. break;
  7869. }
  7870. }
  7871. playSecretaryAni_old() {
  7872. let parent = this.ui.secretary.displayObject;
  7873. parent.destroyChildren();
  7874. let xx = this.ui.secretary.width / 2;
  7875. let yy = this.ui.secretary.height;
  7876. let scale = xGame.common.getSecretaryScale();
  7877. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7878. if (this.success) {
  7879. let rand = Math.random() <= 0.5 ? 2 : 3;
  7880. xGame.common.secretary.play(data, rand, false, parent, () => {
  7881. xGame.common.secretary.play(data, 1, true, parent);
  7882. });
  7883. }
  7884. else {
  7885. xGame.common.secretary.play(data, 0, true, parent);
  7886. }
  7887. }
  7888. playSecretaryAni() {
  7889. let parent = this.ui.secretary.displayObject;
  7890. parent.destroyChildren();
  7891. let xx = this.ui.secretary.width / 2;
  7892. let yy = this.ui.secretary.height;
  7893. let scale = xGame.common.getSecretaryScale();
  7894. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7895. if (this.success) {
  7896. let rand = 0;
  7897. xGame.common.secretary.play(data, 0, true, parent);
  7898. }
  7899. else {
  7900. xGame.common.secretary.play(data, 0, true, parent);
  7901. }
  7902. }
  7903. restartGame() {
  7904. switch (xGame.common.gameMode) {
  7905. case GameMode.classic:
  7906. xGame.eventMgr.event(RESTART_GAME);
  7907. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7908. break;
  7909. case GameMode.bigMove:
  7910. this.hide();
  7911. xGame.eventMgr.event(RESTART_GAME);
  7912. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7913. break;
  7914. default:
  7915. break;
  7916. }
  7917. }
  7918. hide() {
  7919. super.hide();
  7920. xGame.common.stopGirlPop(this.ui.talkNode);
  7921. PlatMgr.showBanner(false);
  7922. }
  7923. returnHome() {
  7924. this.hide();
  7925. let showFailWords = !this.success;
  7926. xGame.uiMgr.Show(UIMain, showFailWords);
  7927. }
  7928. clickLeftBtn() {
  7929. switch (xGame.common.gameMode) {
  7930. case GameMode.classic:
  7931. case GameMode.bigMove:
  7932. this.returnHome();
  7933. break;
  7934. case GameMode.placeBall:
  7935. let level = xGame.common.placeBallCurLevel;
  7936. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  7937. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7938. break;
  7939. default:
  7940. break;
  7941. }
  7942. }
  7943. powerStartPlaceBallLevel(level, btn) {
  7944. if (DataMgr.powerEnough()) {
  7945. btn.touchable = false;
  7946. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  7947. btn.touchable = true;
  7948. DataMgr.setPower(-1);
  7949. xGame.eventMgr.event(POWER_TIME);
  7950. this.startPlaceBallLevel(level);
  7951. this.logEventForChallenge_level_start(level);
  7952. }));
  7953. }
  7954. else {
  7955. xGame.uiMgr.Show(UIPower, 0);
  7956. }
  7957. }
  7958. clickRightBtn() {
  7959. switch (xGame.common.gameMode) {
  7960. case GameMode.classic:
  7961. console.log('zh:clickRightBtn 111');
  7962. case GameMode.bigMove:
  7963. console.log('zh:clickRightBtn 222');
  7964. this.restartGame();
  7965. break;
  7966. case GameMode.placeBall:
  7967. console.log('zh:clickRightBtn 333');
  7968. let level = xGame.common.placeBallCurLevel;
  7969. let data = DataMgr.getPlaceBallLevel(level);
  7970. let curPss = data.play && !data.isCur;
  7971. if (curPss) {
  7972. console.log('zh:clickRightBtn 333-111');
  7973. console.log('zh:当前LV=' + level);
  7974. if (level == 60) {
  7975. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  7976. Laya.timer.once(3000, this, () => {
  7977. this.returnHome();
  7978. });
  7979. }
  7980. else {
  7981. let lev = level + 1;
  7982. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  7983. }
  7984. }
  7985. else {
  7986. console.log('zh:clickRightBtn 333-000');
  7987. Moyu.sendDataEvent("placeBallNextLevel");
  7988. console.log('zh:qjff_AD_for_uiGameEnd');
  7989. if (Laya.Browser.onAndroid) {
  7990. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  7991. if (!boo) {
  7992. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  7993. return;
  7994. }
  7995. }
  7996. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  7997. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  7998. }
  7999. else {
  8000. console.log('zh:AD 失败,直接发放奖励');
  8001. this.qjff_AD_for_uiGameEnd(level);
  8002. }
  8003. }
  8004. break;
  8005. default:
  8006. console.log('zh:clickRightBtn 444');
  8007. break;
  8008. }
  8009. }
  8010. logEventForChallenge_level_start(level) {
  8011. let keyStr = 'sjmd_challenge_level_start';
  8012. let jsonStr = {
  8013. "count": 0,
  8014. "gold_balance ": DataMgr.getCoin(),
  8015. "level": level,
  8016. "diamond_balance ": DataMgr.getDiamond()
  8017. };
  8018. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8019. const d = LocalStorageManager.getItem(keyStr);
  8020. if (level > d.level) {
  8021. jsonStr.count = d.count + 1;
  8022. LocalStorageManager.setItem(keyStr, jsonStr);
  8023. }
  8024. else {
  8025. }
  8026. }
  8027. else {
  8028. LocalStorageManager.setItem(keyStr, jsonStr);
  8029. }
  8030. const reqStr = JSON.stringify(jsonStr);
  8031. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  8032. }
  8033. qjff_AD_for_uiGameEnd(level) {
  8034. DataMgr.setPlaceBallLevel(level, 1);
  8035. this.startPlaceBallLevel(level + 1);
  8036. }
  8037. startPlaceBallLevel(level) {
  8038. xGame.common.gameMode = GameMode.placeBall;
  8039. xGame.common.placeBallCurLevel = level;
  8040. xGame.uiMgr.Show(UIGame);
  8041. this.hide();
  8042. }
  8043. logEventForChallenge_level_complete(level) {
  8044. let keyStr = 'sjmd_challenge_level_complete';
  8045. let jsonStr = {
  8046. "count": 1,
  8047. "gold_balance ": DataMgr.getCoin(),
  8048. "level": level,
  8049. "diamond_balance ": DataMgr.getDiamond()
  8050. };
  8051. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8052. const d = LocalStorageManager.getItem(keyStr);
  8053. jsonStr.count = d.count + 1;
  8054. LocalStorageManager.setItem(keyStr, jsonStr);
  8055. }
  8056. else {
  8057. LocalStorageManager.setItem(keyStr, jsonStr);
  8058. }
  8059. const reqStr = JSON.stringify(jsonStr);
  8060. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  8061. }
  8062. logEventForChallenge_level_N(level) {
  8063. console.log('zh:logEventForChallenge_level_N ' + level);
  8064. let keyStr = 'sjmd_challenge_level_N';
  8065. if (LocalStorageManager.hasKey(keyStr)) {
  8066. let lev = LocalStorageManager.getItem(keyStr);
  8067. if (level > lev) {
  8068. LocalStorageManager.setItem(keyStr, level);
  8069. }
  8070. if ((level) % 5 == 0) {
  8071. console.log('zh:每5关上报1次');
  8072. let sjmc = 'challenge_level_' + level;
  8073. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  8074. let sjmcForFirebase = 'challenge_level_' + level;
  8075. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  8076. }
  8077. else {
  8078. console.log('zh:5 no 上报');
  8079. }
  8080. }
  8081. else {
  8082. LocalStorageManager.setItem(keyStr, level);
  8083. }
  8084. }
  8085. }
  8086. UIGameEnd.uiName = "UIGameEnd";
  8087. class ui_UIVideoShare extends fgui.GComponent {
  8088. static createInstance() {
  8089. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  8090. }
  8091. onConstruct() {
  8092. this.n10 = (this.getChild("n10"));
  8093. this.myNode = (this.getChild("myNode"));
  8094. this.t0 = this.getTransition("t0");
  8095. }
  8096. }
  8097. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  8098. class UIVideoShare extends UIBase {
  8099. constructor() {
  8100. super();
  8101. this.success = false;
  8102. this.awardNum = 0;
  8103. this.isShared = true;
  8104. }
  8105. onConstructor() {
  8106. this.ui = ui_UIVideoShare.createInstance();
  8107. this.contentPane = this.ui;
  8108. this.isEject = false;
  8109. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  8110. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  8111. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  8112. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  8113. }
  8114. show(success) {
  8115. super.show();
  8116. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  8117. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  8118. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  8119. this.success = success;
  8120. let time = xGame.common.randomNum(600, 1500);
  8121. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  8122. if (success)
  8123. xGame.soundMgr.playSound("applause");
  8124. this.ui.t0.play();
  8125. this.checkShareState();
  8126. let times = DataMgr.getDailyVideoShareTimes();
  8127. this.awardNum = times == 0 ? 2000 : 200;
  8128. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  8129. }
  8130. checkShareState() {
  8131. if (PlatMgr.forceShare == 0) {
  8132. this.ui.myNode.closeBtn.visible = true;
  8133. this.ui.myNode.tipsNode.visible = false;
  8134. this.ui.myNode.closeBtn.x = 90;
  8135. this.ui.myNode.shareBtn.x = 342;
  8136. }
  8137. else if (PlatMgr.forceShare == 1) {
  8138. this.ui.myNode.closeBtn.visible = false;
  8139. this.ui.myNode.tipsNode.visible = true;
  8140. this.ui.myNode.shareBtn.x = 218;
  8141. this.isShared = true;
  8142. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8143. }
  8144. }
  8145. checkForceShare() {
  8146. this.isShared = !this.isShared;
  8147. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8148. }
  8149. videoShare() {
  8150. if (PlatMgr.forceShare == 1) {
  8151. if (this.isShared) {
  8152. this.shareGame();
  8153. }
  8154. else {
  8155. this.hideSelf();
  8156. }
  8157. }
  8158. else {
  8159. this.shareGame();
  8160. }
  8161. }
  8162. shareGame() {
  8163. Moyu.sendDataEvent("VideoShare");
  8164. if (Moyu.canShare() > 100) {
  8165. Moyu.shareGame((success) => {
  8166. if (success) {
  8167. DataMgr.setDailyVideoShareTimes(1);
  8168. DataMgr.setCoin(this.awardNum);
  8169. }
  8170. this.hideSelf();
  8171. }, this);
  8172. }
  8173. else {
  8174. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  8175. this.hideSelf();
  8176. }
  8177. }
  8178. hideSelf() {
  8179. this.hide();
  8180. xGame.uiMgr.Show(UIGameEnd, this.success);
  8181. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  8182. xGame.common.screenImg.destroy();
  8183. xGame.common.screenImg = null;
  8184. }
  8185. }
  8186. }
  8187. UIVideoShare.uiName = "UIVideoShare";
  8188. class ui_UITips extends fgui.GComponent {
  8189. static createInstance() {
  8190. return (fgui.UIPackage.createObject("game", "UITips"));
  8191. }
  8192. onConstruct() {
  8193. this.n0 = (this.getChild("n0"));
  8194. this.myNode = (this.getChild("myNode"));
  8195. this.t0 = this.getTransition("t0");
  8196. }
  8197. }
  8198. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  8199. class UITips extends UIBase {
  8200. constructor() {
  8201. super();
  8202. this.type = 0;
  8203. }
  8204. onConstructor() {
  8205. this.ui = ui_UITips.createInstance();
  8206. this.contentPane = this.ui;
  8207. this.isEject = false;
  8208. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  8209. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  8210. }
  8211. show(tipsTxt, womanTxt, type) {
  8212. super.show();
  8213. this.ui.t0.play();
  8214. this.ui.myNode.tipsTxt.text = tipsTxt;
  8215. this.ui.myNode.womanTxt.text = womanTxt;
  8216. PlatMgr.showInsert(true);
  8217. this.ui.myNode.c1.selectedIndex = type;
  8218. this.type = type;
  8219. switch (this.type) {
  8220. case TipsType.exitGame:
  8221. xGame.common.gameMgr.gamePause = true;
  8222. break;
  8223. case TipsType.foul:
  8224. Laya.timer.once(200, this, () => {
  8225. xGame.common.gameMgr.gamePause = true;
  8226. });
  8227. break;
  8228. default:
  8229. break;
  8230. }
  8231. }
  8232. clickLeftBtn() {
  8233. this.hide();
  8234. xGame.common.gameMgr.gamePause = false;
  8235. switch (this.type) {
  8236. case TipsType.exitGame:
  8237. break;
  8238. case TipsType.foul:
  8239. break;
  8240. default:
  8241. break;
  8242. }
  8243. }
  8244. clickRightBtn() {
  8245. this.hide();
  8246. switch (this.type) {
  8247. case TipsType.exitGame:
  8248. xGame.eventMgr.event(RESET_GAME);
  8249. xGame.uiMgr.Show(UIMain);
  8250. Moyu.recordEnd(this, null);
  8251. xGame.common.longHelpLine = false;
  8252. break;
  8253. case TipsType.foul:
  8254. xGame.common.gameMgr.gamePause = false;
  8255. Laya.timer.clearAll(this);
  8256. break;
  8257. default:
  8258. break;
  8259. }
  8260. }
  8261. }
  8262. UITips.uiName = "UITips";
  8263. class GameMgr {
  8264. constructor() {
  8265. this.selfCamp = "";
  8266. this.selfFoulNum = 0;
  8267. this.selfBallArr = [];
  8268. this.selfTimer = 0;
  8269. this.selfScore = 0;
  8270. this.aiCamp = "";
  8271. this.aiFoulNum = 0;
  8272. this.aiBallArr = [];
  8273. this.aiTimer = 0;
  8274. this.aiScore = 0;
  8275. this.aiSkillLevelNum = 1;
  8276. this.targertScore = 0;
  8277. this.setTime = 30;
  8278. this.selfTurnRate = 0.5;
  8279. this.accTime = 0;
  8280. this.curFoul = "";
  8281. this.maxFoulTimes = 3;
  8282. this.isFirstInGame = true;
  8283. this.firstColliObj = null;
  8284. this.inHoleBalls = [];
  8285. this.blackNum = 8;
  8286. this.success = false;
  8287. this.holePosList = [];
  8288. this.posObj = {};
  8289. this._selfTurn = false;
  8290. this.lastRootBallPos = new Laya.Vector2(311, 430);
  8291. this.ensureBallType = false;
  8292. this.isOpenBall = true;
  8293. this.finishOneShoot = true;
  8294. this.isEnd = false;
  8295. this.isChangeTurn = false;
  8296. this.isInterrupt = false;
  8297. this.aiPlayedBreakArmy = false;
  8298. this.isTouchedBall = false;
  8299. this.finishBalls = 0;
  8300. this.needBalls = 0;
  8301. this.allBallNum = 0;
  8302. this.placeBallPosData = {};
  8303. this.curHP = 0;
  8304. this.showLongView = false;
  8305. this.firstShoot = true;
  8306. this._gamePause = false;
  8307. this.trunCount = 0;
  8308. this.isBlackInHole = false;
  8309. this.isEnter = true;
  8310. xGame.eventMgr.offAll(ALL_BALL_STOP);
  8311. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  8312. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  8313. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  8314. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  8315. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  8316. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  8317. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8318. }
  8319. get gamePause() {
  8320. return this._gamePause;
  8321. }
  8322. set gamePause(v) {
  8323. if (v) {
  8324. Laya.physicsTimer.pause();
  8325. }
  8326. else {
  8327. Laya.physicsTimer.resume();
  8328. }
  8329. this._gamePause = v;
  8330. }
  8331. get selfTurn() {
  8332. return this._selfTurn;
  8333. }
  8334. set selfTurn(val) {
  8335. this.trunCount++;
  8336. this._selfTurn = val;
  8337. if (val) {
  8338. xGame.common.d2World.d2Gan.ui.self.visible = true;
  8339. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  8340. }
  8341. else {
  8342. xGame.common.d2World.d2Gan.ui.self.visible = false;
  8343. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  8344. if (this.trunCount > 1)
  8345. PlatMgr.openBox();
  8346. }
  8347. }
  8348. resetGame() {
  8349. this.inHoleBalls = [];
  8350. this.isFirstInGame = true;
  8351. this.firstColliObj = null;
  8352. this.aiCamp = "";
  8353. this.selfCamp = "";
  8354. this.aiFoulNum = 0;
  8355. this.selfFoulNum = 0;
  8356. this.selfBallArr = [];
  8357. this.aiBallArr = [];
  8358. this.gamePause = false;
  8359. this.ensureBallType = false;
  8360. this.isInterrupt = false;
  8361. this.updateLeftBall();
  8362. this.clearTime();
  8363. this.aiPlayedBreakArmy = false;
  8364. this.isBlackInHole = false;
  8365. this.placeBallPosData = {};
  8366. if (xGame.common.d3World.knifeRoot) {
  8367. xGame.common.d3World.knifeRoot.destroyChildren();
  8368. }
  8369. }
  8370. gameReady() {
  8371. this.trunCount = 0;
  8372. this.firstColliObj = null;
  8373. this.isFirstInGame = true;
  8374. this.selfTurn = Math.random() <= this.selfTurnRate;
  8375. let challengeNum = DataMgr.getChallengeTimes();
  8376. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8377. this.selfTurn = true;
  8378. }
  8379. if (xGame.common.gameMode == GameMode.placeBall)
  8380. this.selfTurn = true;
  8381. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  8382. this.selfTurn = true;
  8383. }
  8384. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  8385. this.checkGuide();
  8386. if (xGame.common.uiRodMethod)
  8387. xGame.common.uiRodMethod.resetRod();
  8388. xGame.common.d2World.getHelpLine();
  8389. this.isOpenBall = true;
  8390. this.isTouchedBall = false;
  8391. xGame.common.aiPlayer.stopRun();
  8392. this.setTime = 30;
  8393. let ui = xGame.common.gameUI.ui;
  8394. switch (xGame.common.gameMode) {
  8395. case GameMode.classic:
  8396. xGame.common.aiPlayer.init();
  8397. this.blackNum = 8;
  8398. this.placeRootBall();
  8399. this.peoplePlay(9, 10);
  8400. ui.wordsBtn.visible = true;
  8401. ui.aiWordsBtn.visible = true;
  8402. xGame.common.talkMgr.changeAIState(true);
  8403. DataMgr.gameData.gameCount++;
  8404. DataMgr.saveGameData();
  8405. break;
  8406. case GameMode.bigMove:
  8407. this.blackNum = -1;
  8408. this.selfScore = 0;
  8409. this.aiScore = 0;
  8410. xGame.common.aiPlayer.init();
  8411. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  8412. this.updateSelfScore();
  8413. this.updateAIScore();
  8414. this.updateTargetSroce();
  8415. this.placeRootBall();
  8416. this.peoplePlay(9, 10);
  8417. ui.wordsBtn.visible = true;
  8418. ui.aiWordsBtn.visible = true;
  8419. xGame.common.talkMgr.changeAIState(true);
  8420. if (DataMgr.getSkillGuide() < 1)
  8421. DataMgr.gameData.gameCount = 0;
  8422. else {
  8423. DataMgr.gameData.gameCount++;
  8424. DataMgr.saveGameData();
  8425. PlatMgr.openTry();
  8426. }
  8427. if (xGame.common.d3World.knifeRoot) {
  8428. xGame.common.d3World.knifeRoot.destroyChildren();
  8429. }
  8430. break;
  8431. case GameMode.placeBall:
  8432. this.blackNum = -1;
  8433. this.selfTurn = true;
  8434. this.setTime = 10000;
  8435. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  8436. this.curHP = this.placeBallData.hp;
  8437. if (this.placeBallData.ball == -1)
  8438. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  8439. else
  8440. this.needBalls = this.placeBallData.ball;
  8441. console.log("需要的进球数目", this.needBalls);
  8442. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  8443. this.finishBalls = 0;
  8444. this.placeBallPosData = {};
  8445. this.updatePlaceBallPos();
  8446. this.updatePlaceBallState();
  8447. this.finishOneShoot = true;
  8448. xGame.common.gameUI.ui.moveNode.visible = false;
  8449. this.isOpenBall = false;
  8450. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  8451. ui.wordsBtn.visible = false;
  8452. ui.aiWordsBtn.visible = false;
  8453. xGame.common.talkMgr.changeAIState(false);
  8454. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  8455. PlatMgr.openBox();
  8456. });
  8457. break;
  8458. default:
  8459. break;
  8460. }
  8461. this.showLongView = false;
  8462. xGame.common.wordsMgr.comboTimes = 1;
  8463. let guide = DataMgr.getSkillGuide();
  8464. if (guide)
  8465. xGame.eventMgr.event(WAIT_SHOOT);
  8466. xGame.common.upSkillLevel = false;
  8467. xGame.common.gameStartTime = new Date().getTime();
  8468. this.firstShoot = true;
  8469. }
  8470. checkGuide() {
  8471. let guide = DataMgr.getSkillGuide();
  8472. let gameUI = xGame.common.gameUI.ui;
  8473. gameUI.guide1.visible = false;
  8474. gameUI.guide2.visible = false;
  8475. gameUI.guide3.visible = false;
  8476. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  8477. this.selfTurn = true;
  8478. }
  8479. else {
  8480. return;
  8481. }
  8482. let oneBall = this.getOneBall();
  8483. gameUI.guide1.visible = true;
  8484. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  8485. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  8486. }
  8487. getOneBall() {
  8488. let arr = xGame.common.d2World.ballArr;
  8489. for (let index = 0; index < arr.length; index++) {
  8490. if (arr[index].number == 0)
  8491. continue;
  8492. return arr[index];
  8493. }
  8494. }
  8495. updateSelfScore() {
  8496. let ui = xGame.common.gameUI.ui.topNode;
  8497. ui.selfScoreTxt.text = this.selfScore + "";
  8498. }
  8499. updateAIScore() {
  8500. let ui = xGame.common.gameUI.ui.topNode;
  8501. ui.aiScoreTxt.text = this.aiScore + "";
  8502. }
  8503. updateTargetSroce() {
  8504. let ui = xGame.common.gameUI.ui.topNode;
  8505. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  8506. }
  8507. updateLeftBall() {
  8508. let topUI = xGame.common.gameUI.ui.topNode;
  8509. topUI.selfBallList.numItems = this.selfBallArr.length;
  8510. topUI.aiBallList.numItems = this.aiBallArr.length;
  8511. }
  8512. ballShoot() {
  8513. this.clearTime();
  8514. this.finishOneShoot = false;
  8515. xGame.common.gameUI.ui.moveNode.visible = false;
  8516. if (xGame.common.gameUI.ui.guideNode.visible) {
  8517. xGame.common.gameUI.ui.guideNode.visible = false;
  8518. }
  8519. if (this.firstShoot) {
  8520. this.firstShoot = false;
  8521. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  8522. }
  8523. }
  8524. ensureCamp(number) {
  8525. this.ensureBallType = true;
  8526. this.isOpenBall = false;
  8527. if (xGame.common.gameMode != GameMode.classic)
  8528. return;
  8529. let full = [1, 2, 3, 4, 5, 6, 7];
  8530. let flower = [9, 10, 11, 12, 13, 14, 15];
  8531. let sayWords = "";
  8532. if (this.selfTurn) {
  8533. if (number <= 7) {
  8534. this.selfCamp = ballCamp.full;
  8535. this.selfBallArr = full;
  8536. this.aiCamp = ballCamp.flower;
  8537. this.aiBallArr = flower;
  8538. sayWords = cfgTable.wordsData[3].msg;
  8539. }
  8540. else {
  8541. this.selfCamp = ballCamp.flower;
  8542. this.selfBallArr = flower;
  8543. this.aiCamp = ballCamp.full;
  8544. this.aiBallArr = full;
  8545. sayWords = cfgTable.wordsData[4].msg;
  8546. }
  8547. }
  8548. else {
  8549. if (number <= 7) {
  8550. this.selfCamp = ballCamp.flower;
  8551. this.selfBallArr = flower;
  8552. this.aiCamp = ballCamp.full;
  8553. this.aiBallArr = full;
  8554. sayWords = cfgTable.wordsData[2].msg;
  8555. }
  8556. else {
  8557. this.selfCamp = ballCamp.full;
  8558. this.selfBallArr = full;
  8559. this.aiCamp = ballCamp.flower;
  8560. this.aiBallArr = flower;
  8561. sayWords = cfgTable.wordsData[1].msg;
  8562. }
  8563. }
  8564. this.updateLeftBall();
  8565. xGame.uiMgr.Show(UIMsg, sayWords);
  8566. }
  8567. updatePlaceBallState() {
  8568. let ui = xGame.common.gameUI.ui;
  8569. switch (this.placeBallData.type) {
  8570. case PlaceBallType.normal:
  8571. let normal = ui.placeNormalNode;
  8572. normal.hpTxt.text = this.curHP + "";
  8573. this.updatePlaceBallStar(normal);
  8574. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  8575. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  8576. break;
  8577. case PlaceBallType.challenge:
  8578. let challenge = ui.placeChallengeNode;
  8579. challenge.hpTxt.text = "Shots:" + this.curHP;
  8580. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  8581. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  8582. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  8583. break;
  8584. default:
  8585. break;
  8586. }
  8587. }
  8588. playSubHpAni() {
  8589. let ui = xGame.common.gameUI.ui;
  8590. switch (this.placeBallData.type) {
  8591. case PlaceBallType.normal:
  8592. let normal = ui.placeNormalNode;
  8593. normal.hpTxt.visible = false;
  8594. normal.starAni.c1.selectedIndex = 1;
  8595. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  8596. normal.hpTxt.visible = true;
  8597. normal.starAni.c1.selectedIndex = 0;
  8598. }));
  8599. break;
  8600. default:
  8601. break;
  8602. }
  8603. }
  8604. getEndStarNum() {
  8605. let num;
  8606. let level = xGame.common.placeBallCurLevel;
  8607. if (this.curHP == this.placeBallData.hp) {
  8608. num = 3;
  8609. }
  8610. else if (this.curHP <= 1) {
  8611. num = 1;
  8612. }
  8613. else {
  8614. num = 2;
  8615. }
  8616. if (!this.success) {
  8617. num = 0;
  8618. }
  8619. else {
  8620. DataMgr.setPlaceBallLevel(level, num);
  8621. }
  8622. let myType = cfgTable.placeballData[level].type;
  8623. if (this.success && myType == 1) {
  8624. num = 3;
  8625. }
  8626. xGame.common.placeBallStarNum = num;
  8627. }
  8628. updatePlaceBallStar(node) {
  8629. let star = 0;
  8630. if (this.curHP == this.placeBallData.hp) {
  8631. star = 3;
  8632. }
  8633. else if (this.curHP >= 2) {
  8634. star = 2;
  8635. }
  8636. else if (this.curHP == 1) {
  8637. star = 1;
  8638. }
  8639. else {
  8640. star = 0;
  8641. }
  8642. let temp;
  8643. for (let index = 1; index <= 3; index++) {
  8644. temp = node["star" + index];
  8645. temp.c1.selectedIndex = star >= index ? 1 : 0;
  8646. }
  8647. node.myProgress.value = (star / 3) * 100;
  8648. }
  8649. openRegretView(isFoul, GoalNum, challenge = false) {
  8650. let regretType = -1;
  8651. if (isFoul) {
  8652. regretType = 1;
  8653. }
  8654. else {
  8655. if (GoalNum <= 0) {
  8656. regretType = 0;
  8657. }
  8658. }
  8659. if (challenge) {
  8660. regretType = 1;
  8661. }
  8662. if (regretType != -1) {
  8663. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  8664. if (success) {
  8665. this.curHP++;
  8666. this.updatePlaceBallState();
  8667. this.setPlaceBallAllPos();
  8668. xGame.common.gameUI.ui.moveNode.visible = false;
  8669. }
  8670. else {
  8671. if (this.curHP <= 0) {
  8672. this.success = false;
  8673. this.gameEnd();
  8674. }
  8675. this.playSubHpAni();
  8676. }
  8677. this.updatePlaceBallState();
  8678. this.updatePlaceBallPos();
  8679. });
  8680. }
  8681. }
  8682. setPlaceBallAllPos() {
  8683. let allBall = xGame.common.d2World.ballArr;
  8684. let cfgArr = this.placeBallPosData;
  8685. let temp;
  8686. let obj;
  8687. for (let index = 0; index < allBall.length; index++) {
  8688. temp = allBall[index];
  8689. if (temp.destroyed)
  8690. continue;
  8691. obj = cfgArr[temp.myUNID];
  8692. if (obj && obj.src && !obj.src.destroyed) {
  8693. temp.gameObj.x = obj.posX;
  8694. temp.gameObj.y = obj.posY;
  8695. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  8696. }
  8697. }
  8698. xGame.common.d2World.getHelpLine();
  8699. }
  8700. updatePlaceBallPos() {
  8701. let arr = xGame.common.d2World.ballArr;
  8702. let temp;
  8703. for (let index = 0; index < arr.length; index++) {
  8704. temp = arr[index];
  8705. if (!this.placeBallPosData[temp.myUNID]) {
  8706. this.placeBallPosData[temp.myUNID] = {
  8707. src: temp,
  8708. posX: temp.gameObj.x,
  8709. posY: temp.gameObj.y
  8710. };
  8711. }
  8712. else {
  8713. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  8714. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  8715. }
  8716. }
  8717. let check;
  8718. for (const key in this.placeBallPosData) {
  8719. check = this.placeBallPosData[key];
  8720. if (check.src.destroyed) {
  8721. delete this.placeBallPosData[key];
  8722. }
  8723. }
  8724. }
  8725. gameRun(type) {
  8726. if (this.gamePause)
  8727. return;
  8728. this.curFoul = this.getFoulType();
  8729. if (type) {
  8730. xGame.common.d2World.d2Gan.shoot();
  8731. xGame.common.gameUI.forceCancel();
  8732. this.curFoul = type;
  8733. }
  8734. this.isEnd = false;
  8735. this.isChangeTurn = true;
  8736. if (xGame.common.gameMode == GameMode.classic) {
  8737. this.judgeClassic(this.curFoul);
  8738. this.checkClassicWords(() => {
  8739. xGame.common.destroyClassicEmotion();
  8740. if (this.isEnd) {
  8741. if (this.isBlackInHole) {
  8742. xGame.common.gameUI.ui.blackAni.visible = true;
  8743. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  8744. xGame.common.gameUI.ui.blackAni.visible = false;
  8745. this.gameEnd();
  8746. }));
  8747. }
  8748. else {
  8749. this.gameEnd();
  8750. }
  8751. }
  8752. else {
  8753. this.waitShoot();
  8754. xGame.eventMgr.event(WAIT_SHOOT);
  8755. }
  8756. });
  8757. }
  8758. else if (xGame.common.gameMode == GameMode.bigMove) {
  8759. xGame.common.aiPlayer.stopRun();
  8760. let scoreArr = this.getScore(this.curFoul);
  8761. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  8762. this.isEnd = true;
  8763. }
  8764. this.checkBigSkillWords(() => {
  8765. if (this.isEnd) {
  8766. this.gameEnd();
  8767. }
  8768. else {
  8769. this.waitShoot();
  8770. xGame.eventMgr.event(WAIT_SHOOT);
  8771. }
  8772. });
  8773. }
  8774. else if (xGame.common.gameMode == GameMode.placeBall) {
  8775. xGame.common.destroyAwardSpine();
  8776. let isFoul = this.curFoul == FoulType.rootHole;
  8777. let GoalNum = this.inHoleBalls.length;
  8778. if (this.inHoleBalls.indexOf(0) > -1)
  8779. GoalNum -= 1;
  8780. if (isFoul) {
  8781. this.placeRootBall();
  8782. }
  8783. console.log("neeballs", this.needBalls);
  8784. console.log("当前完成的goalNum", GoalNum);
  8785. this.finishBalls += GoalNum;
  8786. console.log("当前完成的finishballs", this.finishBalls);
  8787. let need = this.needBalls;
  8788. if (this.placeBallData.type == PlaceBallType.challenge) {
  8789. need += 100;
  8790. }
  8791. if (this.finishBalls >= need) {
  8792. this.success = true;
  8793. this.gameEnd();
  8794. }
  8795. else {
  8796. switch (this.placeBallData.type) {
  8797. case PlaceBallType.normal:
  8798. if (!isFoul && GoalNum > 0) {
  8799. this.updatePlaceBallPos();
  8800. this.updatePlaceBallState();
  8801. }
  8802. else {
  8803. this.curHP--;
  8804. this.openRegretView(isFoul, GoalNum);
  8805. }
  8806. this.waitShoot();
  8807. xGame.eventMgr.event(WAIT_SHOOT);
  8808. break;
  8809. case PlaceBallType.challenge:
  8810. this.curHP--;
  8811. this.updatePlaceBallState();
  8812. if (isFoul) {
  8813. this.openRegretView(isFoul, GoalNum, true);
  8814. }
  8815. else {
  8816. this.updatePlaceBallPos();
  8817. if (this.curHP <= 0) {
  8818. this.success = true;
  8819. this.gameEnd();
  8820. }
  8821. }
  8822. this.waitShoot();
  8823. xGame.eventMgr.event(WAIT_SHOOT);
  8824. break;
  8825. default:
  8826. break;
  8827. }
  8828. }
  8829. }
  8830. }
  8831. checkClassicWords(callback) {
  8832. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  8833. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  8834. let type = this.getClassicWordsType();
  8835. if (condition && type != -1) {
  8836. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  8837. xGame.soundMgr.playSound(str);
  8838. xGame.common.wordsMgr.playClassicWords(type, callback);
  8839. }
  8840. else {
  8841. Laya.timer.once(300, this, () => {
  8842. callback && callback();
  8843. });
  8844. }
  8845. }
  8846. getClassicWordsType() {
  8847. let d2world = xGame.common.d2World;
  8848. let type = -1;
  8849. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  8850. type = ClassicWordsType.perfectShow;
  8851. return type;
  8852. }
  8853. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  8854. type = ClassicWordsType.directShoot;
  8855. return type;
  8856. }
  8857. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  8858. type = ClassicWordsType.anotherShoot;
  8859. return type;
  8860. }
  8861. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  8862. type = ClassicWordsType.bigPower;
  8863. return type;
  8864. }
  8865. let minSpeed = 1;
  8866. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  8867. type = ClassicWordsType.hardShoot;
  8868. return type;
  8869. }
  8870. if (this.inHoleBalls.length > 0) {
  8871. type = ClassicWordsType.directShoot;
  8872. return type;
  8873. }
  8874. return type;
  8875. }
  8876. checkBigSkillWords(callback) {
  8877. if (this.curFoul == FoulType.timeOut) {
  8878. callback && callback();
  8879. }
  8880. else {
  8881. let playSkill = false;
  8882. if (this.selfTurn) {
  8883. playSkill = true;
  8884. }
  8885. else {
  8886. if (!this.aiPlayedBreakArmy) {
  8887. this.aiPlayedBreakArmy = true;
  8888. playSkill = true;
  8889. }
  8890. if (this.aiCurSkill != SkillType.breakArmy) {
  8891. playSkill = true;
  8892. }
  8893. }
  8894. if (xGame.common.skillMgr.playedLastSkill) {
  8895. xGame.common.skillMgr.playedLastSkill = false;
  8896. playSkill = false;
  8897. }
  8898. if (playSkill) {
  8899. xGame.common.skillMgr.runBigSkill((extraScore) => {
  8900. let selfExtra = 0;
  8901. let aiExtra = 0;
  8902. if (this.selfTurn)
  8903. selfExtra += extraScore;
  8904. else
  8905. aiExtra += extraScore;
  8906. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  8907. this.isEnd = true;
  8908. }
  8909. this.playBigSkillTimes(callback);
  8910. });
  8911. }
  8912. else {
  8913. this.playBigSkillTimes(callback);
  8914. }
  8915. }
  8916. }
  8917. playBigSkillTimes(callback) {
  8918. let length = this.inHoleBalls.length;
  8919. if (this.inHoleBalls.indexOf(0) > -1) {
  8920. length = this.inHoleBalls.length - 1;
  8921. }
  8922. if (length <= 0) {
  8923. callback && callback();
  8924. return;
  8925. }
  8926. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  8927. callback && callback();
  8928. });
  8929. }
  8930. playSkillTips() {
  8931. let levelNum = 0;
  8932. let curType;
  8933. if (this.selfTurn) {
  8934. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  8935. curType = this.selfCurSkill;
  8936. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  8937. levelNum += 5;
  8938. }
  8939. }
  8940. else {
  8941. levelNum = this.aiSkillLevelNum;
  8942. curType = this.aiCurSkill;
  8943. }
  8944. let str = ``;
  8945. switch (curType) {
  8946. case SkillType.highSpace:
  8947. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  8948. break;
  8949. case SkillType.breakArmy:
  8950. str = `You pocketed ${levelNum} extra balls`;
  8951. break;
  8952. case SkillType.ice:
  8953. str = `${levelNum * 2} extra balls were frozen`;
  8954. break;
  8955. case SkillType.fireworks:
  8956. str = `${levelNum} extra balls exploded `;
  8957. break;
  8958. case SkillType.GuanYu:
  8959. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  8960. break;
  8961. default:
  8962. break;
  8963. }
  8964. xGame.uiMgr.Show(UIMsg, str);
  8965. }
  8966. getFoulType() {
  8967. let foulType = "";
  8968. if (this.firstColliObj == null) {
  8969. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  8970. return FoulType.rootHole;
  8971. }
  8972. return FoulType.notTouch;
  8973. }
  8974. else {
  8975. if (this.selfTurn) {
  8976. if (this.selfBallArr.length > 0) {
  8977. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  8978. foulType = FoulType.wrongTouch;
  8979. }
  8980. }
  8981. else {
  8982. if (this.ensureBallType) {
  8983. }
  8984. else {
  8985. if (this.firstColliObj == this.blackNum) {
  8986. foulType = FoulType.wrongTouch;
  8987. }
  8988. }
  8989. }
  8990. }
  8991. else {
  8992. if (this.aiBallArr.length > 0) {
  8993. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  8994. foulType = FoulType.wrongTouch;
  8995. }
  8996. }
  8997. else {
  8998. if (this.ensureBallType) {
  8999. }
  9000. else {
  9001. if (this.firstColliObj == this.blackNum) {
  9002. foulType = FoulType.wrongTouch;
  9003. }
  9004. }
  9005. }
  9006. }
  9007. if (this.inHoleBalls.length <= 0) {
  9008. return foulType;
  9009. }
  9010. let temp;
  9011. if (this.inHoleBalls.indexOf(0) > -1) {
  9012. foulType = FoulType.rootHole;
  9013. }
  9014. else {
  9015. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9016. temp = this.inHoleBalls[index];
  9017. if (this.selfTurn) {
  9018. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9019. foulType = FoulType.wrongHole;
  9020. break;
  9021. }
  9022. }
  9023. else {
  9024. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9025. foulType = FoulType.wrongHole;
  9026. break;
  9027. }
  9028. }
  9029. }
  9030. }
  9031. let foo;
  9032. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9033. temp = this.inHoleBalls[index];
  9034. foo = this.selfBallArr.indexOf(temp);
  9035. if (foo > -1) {
  9036. this.selfBallArr.splice(foo, 1);
  9037. }
  9038. foo = this.aiBallArr.indexOf(temp);
  9039. if (foo > -1) {
  9040. this.aiBallArr.splice(foo, 1);
  9041. }
  9042. }
  9043. this.updateLeftBall();
  9044. }
  9045. return foulType;
  9046. }
  9047. judgeGameEndByBlack(arr) {
  9048. if (this.selfTurn) {
  9049. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9050. this.selfFoulNum = this.maxFoulTimes;
  9051. return true;
  9052. }
  9053. }
  9054. else {
  9055. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9056. this.aiFoulNum = this.maxFoulTimes;
  9057. return true;
  9058. }
  9059. }
  9060. }
  9061. judgeClassic(type) {
  9062. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  9063. xGame.common.aiPlayer.stopRun();
  9064. if (this.judgeNormalSuccess()) {
  9065. this.isEnd = true;
  9066. return;
  9067. }
  9068. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  9069. if (this.selfTurn) {
  9070. if (isFoul) {
  9071. this.selfFoulNum++;
  9072. }
  9073. if (this.selfFoulNum >= this.maxFoulTimes) {
  9074. this.success = false;
  9075. this.isEnd = true;
  9076. return;
  9077. }
  9078. }
  9079. else {
  9080. if (isFoul)
  9081. this.aiFoulNum++;
  9082. if (this.aiFoulNum >= this.maxFoulTimes) {
  9083. this.success = true;
  9084. this.isEnd = true;
  9085. return;
  9086. }
  9087. }
  9088. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  9089. this.isChangeTurn = false;
  9090. }
  9091. else {
  9092. this.isInterrupt = true;
  9093. }
  9094. }
  9095. waitShoot() {
  9096. if (xGame.common.gameMode == GameMode.classic) {
  9097. switch (this.curFoul) {
  9098. case FoulType.timeOut:
  9099. case FoulType.rootHole:
  9100. this.selfTurn = !this.selfTurn;
  9101. this.peoplePlay(5, 6, true);
  9102. break;
  9103. case FoulType.notTouch:
  9104. this.selfTurn = !this.selfTurn;
  9105. this.peoplePlay(7, 7);
  9106. break;
  9107. case FoulType.wrongHole:
  9108. this.selfTurn = !this.selfTurn;
  9109. this.peoplePlay(11, 11);
  9110. break;
  9111. default:
  9112. if (this.inHoleBalls.length > 0) {
  9113. this.peoplePlay(0, 0, false, false);
  9114. }
  9115. else {
  9116. this.selfTurn = !this.selfTurn;
  9117. this.peoplePlay(7, 7);
  9118. }
  9119. break;
  9120. }
  9121. }
  9122. else if (xGame.common.gameMode == GameMode.bigMove) {
  9123. if (this.curFoul == FoulType.timeOut) {
  9124. this.selfTurn = !this.selfTurn;
  9125. this.peoplePlay(14, 15);
  9126. this.placeRootBall();
  9127. }
  9128. else {
  9129. this.selfTurn = !this.selfTurn;
  9130. if (this.curFoul == FoulType.rootHole) {
  9131. this.peoplePlay(12, 13);
  9132. this.placeRootBall();
  9133. }
  9134. else {
  9135. this.peoplePlay(0, 0, false, false);
  9136. }
  9137. }
  9138. }
  9139. else if (xGame.common.gameMode == GameMode.placeBall) {
  9140. this.finishOneShoot = true;
  9141. }
  9142. this.gameResult();
  9143. }
  9144. gameResult() {
  9145. this.firstColliObj = null;
  9146. this.inHoleBalls = [];
  9147. let curX = xGame.common.d2World.rootBall.gameObj.x;
  9148. let curY = xGame.common.d2World.rootBall.gameObj.y;
  9149. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  9150. if (xGame.common.uiRodMethod)
  9151. xGame.common.uiRodMethod.resetRod();
  9152. xGame.common.d2World.rootBall.showSelf();
  9153. this.clearIceSkill();
  9154. if (this.selfTurn) {
  9155. PlatMgr.gameInsert();
  9156. }
  9157. xGame.common.d3World.knifeRoot.destroyChildren();
  9158. if (this.selfTurn) {
  9159. xGame.common.gameUI.showHelpLineGuide();
  9160. xGame.common.gameUI.setTurnAlpha(true);
  9161. }
  9162. else {
  9163. xGame.common.gameUI.setTurnAlpha(false);
  9164. }
  9165. }
  9166. getScore(type) {
  9167. let selfAdd = 0;
  9168. let aiAdd = 0;
  9169. if (type == FoulType.timeOut) {
  9170. if (this.selfTurn)
  9171. aiAdd += 3;
  9172. else
  9173. selfAdd += 3;
  9174. }
  9175. else {
  9176. if (this.inHoleBalls.length > 0) {
  9177. if (this.selfTurn) {
  9178. if (type == FoulType.rootHole) {
  9179. aiAdd += 3;
  9180. if (this.inHoleBalls.length - 1 > 0) {
  9181. selfAdd += this.inHoleBalls.length - 1;
  9182. }
  9183. }
  9184. else {
  9185. selfAdd += this.inHoleBalls.length;
  9186. }
  9187. }
  9188. else {
  9189. if (type == FoulType.rootHole) {
  9190. selfAdd += 3;
  9191. if (this.inHoleBalls.length - 1 > 0) {
  9192. aiAdd += this.inHoleBalls.length - 1;
  9193. }
  9194. }
  9195. else {
  9196. aiAdd += this.inHoleBalls.length;
  9197. }
  9198. }
  9199. }
  9200. }
  9201. return [selfAdd, aiAdd];
  9202. }
  9203. judgeScoreEnd(selfAdd, aiAdd) {
  9204. this.selfScore += selfAdd;
  9205. this.aiScore += aiAdd;
  9206. this.updateAIScore();
  9207. this.updateSelfScore();
  9208. if (this.selfScore >= this.targertScore) {
  9209. this.success = true;
  9210. return true;
  9211. }
  9212. if (this.aiScore >= this.targertScore) {
  9213. this.success = false;
  9214. return true;
  9215. }
  9216. let ballArr = xGame.common.d2World.ballArr;
  9217. if (ballArr.length == 1 && ballArr[0].number == 0) {
  9218. if (this.selfScore > this.aiScore) {
  9219. this.success = true;
  9220. return true;
  9221. }
  9222. else if (this.selfScore < this.aiScore) {
  9223. this.success = false;
  9224. return true;
  9225. }
  9226. else {
  9227. if (this.selfTurn) {
  9228. this.success = false;
  9229. }
  9230. else {
  9231. this.success = true;
  9232. }
  9233. return true;
  9234. }
  9235. }
  9236. }
  9237. clearIceSkill() {
  9238. let arr = xGame.common.d2World.ballArr;
  9239. let temp;
  9240. if (this.selfTurn) {
  9241. if (this.selfCurSkill == SkillType.ice) {
  9242. for (let index = 0; index < arr.length; index++) {
  9243. temp = arr[index];
  9244. if (temp.ballFunc == "ice") {
  9245. temp.setBallFunc("normal", "self");
  9246. }
  9247. }
  9248. }
  9249. }
  9250. else {
  9251. if (this.aiCurSkill == SkillType.ice) {
  9252. for (let index = 0; index < arr.length; index++) {
  9253. temp = arr[index];
  9254. if (temp.ballFunc == "ice") {
  9255. temp.setBallFunc("normal", "ai");
  9256. }
  9257. }
  9258. }
  9259. }
  9260. }
  9261. judgeNormalSuccess() {
  9262. if (this.selfTurn) {
  9263. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9264. this.success = true;
  9265. return true;
  9266. }
  9267. }
  9268. else {
  9269. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9270. this.success = false;
  9271. return true;
  9272. }
  9273. }
  9274. }
  9275. gameEnd() {
  9276. if (Moyu.isTT) {
  9277. xGame.common.screenImg = getScreenImg();
  9278. }
  9279. console.log("游戏结束", this.success);
  9280. xGame.common.aiPlayer.stopRun();
  9281. if (xGame.common.gameMode == GameMode.placeBall) {
  9282. this.getEndStarNum();
  9283. this.updatePlaceBallState();
  9284. }
  9285. this.isEnter = false;
  9286. Moyu.recordEnd(this, () => {
  9287. if (this.isEnter)
  9288. return;
  9289. this.isEnter = true;
  9290. console.log("进入录结束回调");
  9291. this.enterNext();
  9292. });
  9293. Laya.timer.once(1000, this, () => {
  9294. if (this.isEnter)
  9295. return;
  9296. this.isEnter = true;
  9297. this.enterNext();
  9298. });
  9299. xGame.common.longHelpLine = false;
  9300. }
  9301. enterNext() {
  9302. Laya.timer.clearAll(this);
  9303. if (Moyu.canShare() > 100 || Moyu.isKs) {
  9304. xGame.uiMgr.Show(UIVideoShare, this.success);
  9305. }
  9306. else {
  9307. xGame.uiMgr.Show(UIGameEnd, this.success);
  9308. }
  9309. }
  9310. aiLeave() {
  9311. let ui = xGame.common.gameUI.ui;
  9312. ui.topNode.aiNameTxt.text = "offline";
  9313. }
  9314. aiGameEnd(suc) {
  9315. this.success = suc;
  9316. xGame.common.aiPlayer.stopRun();
  9317. if (this.success) {
  9318. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  9319. Laya.timer.once(1000, this, () => {
  9320. this.clearTime();
  9321. this.gameEnd();
  9322. });
  9323. }
  9324. }
  9325. openTimer() {
  9326. let src = xGame.common.gameUI;
  9327. if (this.selfTurn) {
  9328. src.ui.topNode.selfProgress.visible = true;
  9329. src.ui.topNode.aiProgress.visible = false;
  9330. this.curTimer = src.ui.topNode.selfProgress;
  9331. }
  9332. else {
  9333. src.ui.topNode.selfProgress.visible = false;
  9334. src.ui.topNode.aiProgress.visible = true;
  9335. this.curTimer = src.ui.topNode.aiProgress;
  9336. }
  9337. this.accTime = 0;
  9338. Laya.timer.clearAll(this);
  9339. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  9340. this.curTimer.value = 100;
  9341. }
  9342. updateTime(dt) {
  9343. if (this.gamePause)
  9344. return;
  9345. this.accTime += dt;
  9346. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  9347. if (this.accTime >= this.setTime) {
  9348. this.clearTime();
  9349. console.log("时钟进入了gameRun");
  9350. this.gameRun(FoulType.timeOut);
  9351. }
  9352. }
  9353. clearTime() {
  9354. let src = xGame.common.gameUI;
  9355. src.ui.topNode.selfProgress.visible = false;
  9356. src.ui.topNode.aiProgress.visible = false;
  9357. Laya.timer.clearAll(this);
  9358. }
  9359. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  9360. let ui = xGame.common.gameUI.ui;
  9361. let selfMsg, aiMsg;
  9362. if (sayWords) {
  9363. selfMsg = cfgTable.wordsData[selfIndex].msg;
  9364. aiMsg = cfgTable.wordsData[aiIndex].msg;
  9365. if (Foul) {
  9366. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  9367. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  9368. this.placeRootBall();
  9369. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  9370. if (this.curFoul == FoulType.rootHole) {
  9371. if (!DataMgr.getRootBallFoul()) {
  9372. DataMgr.setRootBallFoul();
  9373. aiMsg = "";
  9374. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  9375. let woman = "Boss, pay attention next time~";
  9376. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  9377. }
  9378. }
  9379. else if (this.curFoul == FoulType.timeOut) {
  9380. if (!DataMgr.getTimeoutFoul()) {
  9381. DataMgr.setTimeoutFoul();
  9382. aiMsg = "";
  9383. let tips = "Game timeout, 3 fouls, this game failed.";
  9384. let woman = "Boss, pay attention to the timeline~";
  9385. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  9386. }
  9387. }
  9388. }
  9389. }
  9390. }
  9391. if (this.selfTurn) {
  9392. if (sayWords) {
  9393. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  9394. ui.selfTurn.visible = true;
  9395. ui.aiTurn.visible = false;
  9396. ui.selfTurn.t0.play();
  9397. Moyu.vibration();
  9398. });
  9399. }
  9400. }
  9401. else {
  9402. let aiNum = xGame.tools.random(1, 11);
  9403. let challengeNum = DataMgr.getChallengeTimes();
  9404. let delay = false;
  9405. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  9406. aiNum = 9;
  9407. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  9408. aiNum = 3;
  9409. if (challengeNum == 3) {
  9410. if (!this.showLongView) {
  9411. this.showLongView = true;
  9412. delay = true;
  9413. }
  9414. }
  9415. }
  9416. }
  9417. if (delay) {
  9418. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  9419. if (success) {
  9420. xGame.common.longHelpLine = true;
  9421. xGame.common.d2World.getHelpLine();
  9422. }
  9423. else {
  9424. aiNum = 10;
  9425. }
  9426. xGame.common.aiPlayer.setAiLevel(aiNum);
  9427. if (sayWords) {
  9428. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  9429. xGame.common.aiPlayer.runAI();
  9430. ui.selfTurn.visible = false;
  9431. ui.aiTurn.visible = true;
  9432. ui.aiTurn.t0.play();
  9433. });
  9434. }
  9435. else {
  9436. xGame.common.aiPlayer.runAI();
  9437. }
  9438. this.openTimer();
  9439. this.finishOneShoot = true;
  9440. if (this.selfTurn) {
  9441. ui.topNode.selfKuang.visible = true;
  9442. ui.topNode.aiKuang.visible = false;
  9443. ui.topNode.selfTips.visible = true;
  9444. ui.topNode.aiTips.visible = false;
  9445. }
  9446. else {
  9447. ui.topNode.selfKuang.visible = false;
  9448. ui.topNode.aiKuang.visible = true;
  9449. ui.topNode.selfTips.visible = false;
  9450. ui.topNode.aiTips.visible = true;
  9451. }
  9452. });
  9453. return;
  9454. }
  9455. if (xGame.common.gameMode == GameMode.classic) {
  9456. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  9457. if (cfg) {
  9458. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  9459. aiNum = aiLevel;
  9460. }
  9461. }
  9462. xGame.common.aiPlayer.setAiLevel(aiNum);
  9463. if (sayWords) {
  9464. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  9465. xGame.common.aiPlayer.runAI();
  9466. ui.selfTurn.visible = false;
  9467. ui.aiTurn.visible = true;
  9468. ui.aiTurn.t0.play();
  9469. });
  9470. }
  9471. else {
  9472. xGame.common.aiPlayer.runAI();
  9473. }
  9474. }
  9475. this.openTimer();
  9476. this.finishOneShoot = true;
  9477. if (this.selfTurn) {
  9478. ui.topNode.selfKuang.visible = true;
  9479. ui.topNode.aiKuang.visible = false;
  9480. ui.topNode.selfTips.visible = true;
  9481. ui.topNode.aiTips.visible = false;
  9482. }
  9483. else {
  9484. ui.topNode.selfKuang.visible = false;
  9485. ui.topNode.aiKuang.visible = true;
  9486. ui.topNode.selfTips.visible = false;
  9487. ui.topNode.aiTips.visible = true;
  9488. }
  9489. }
  9490. placeRootBall() {
  9491. let rootBall = xGame.common.d2World.rootBall;
  9492. if (!rootBall)
  9493. return;
  9494. rootBall.gameObj.x = this.lastRootBallPos.x;
  9495. rootBall.gameObj.y = this.lastRootBallPos.y;
  9496. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  9497. let moveNode = xGame.common.gameUI.ui.moveNode;
  9498. moveNode.visible = true;
  9499. moveNode.x = this.lastRootBallPos.x;
  9500. moveNode.y = this.lastRootBallPos.y;
  9501. if (!this.selfTurn) {
  9502. xGame.common.aiPlayer.resetRoot();
  9503. }
  9504. }
  9505. }
  9506. class ui_guanyuAni extends fgui.GComponent {
  9507. static createInstance() {
  9508. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  9509. }
  9510. onConstruct() {
  9511. this.n0 = (this.getChild("n0"));
  9512. }
  9513. }
  9514. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  9515. class UIFireworks extends UIBase {
  9516. constructor() {
  9517. super();
  9518. }
  9519. onConstructor() {
  9520. this.isEject = false;
  9521. }
  9522. show(callback) {
  9523. super.show();
  9524. }
  9525. }
  9526. UIFireworks.uiName = "UIFireworks";
  9527. class ui_UIGuanYu extends fgui.GComponent {
  9528. static createInstance() {
  9529. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  9530. }
  9531. onConstruct() {
  9532. this.n2 = (this.getChild("n2"));
  9533. this.n1 = (this.getChild("n1"));
  9534. this.n3 = (this.getChild("n3"));
  9535. this.n4 = (this.getChild("n4"));
  9536. this.n5 = (this.getChild("n5"));
  9537. this.n6 = (this.getChild("n6"));
  9538. this.n8 = (this.getChild("n8"));
  9539. this.n7 = (this.getChild("n7"));
  9540. this.t0 = this.getTransition("t0");
  9541. }
  9542. }
  9543. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  9544. class UIGuanYu extends UIBase {
  9545. constructor() {
  9546. super();
  9547. }
  9548. onConstructor() {
  9549. this.ui = ui_UIGuanYu.createInstance();
  9550. this.contentPane = this.ui;
  9551. this.isEject = false;
  9552. }
  9553. show(callback) {
  9554. super.show();
  9555. this.ui.t0.play(Laya.Handler.create(this, () => {
  9556. callback && callback();
  9557. this.hide();
  9558. }));
  9559. }
  9560. }
  9561. UIGuanYu.uiName = "UIGuanYu";
  9562. class SkillMgr {
  9563. constructor() {
  9564. this.leveNum = 0;
  9565. this.extraScore = 0;
  9566. this.selfTurn = false;
  9567. this.playedLastSkill = false;
  9568. this.tweenArr = [];
  9569. this._finishNum = 0;
  9570. this._curFinish = 0;
  9571. this._rootX = 0;
  9572. this._rootY = 0;
  9573. this.knifeTimes = 0;
  9574. this.knifeV2 = new Laya.Vector2();
  9575. this.knifeV3 = new Laya.Vector3();
  9576. this.rtStarX = 0;
  9577. this.rtStarY = 0;
  9578. this.addBigSkillSpine();
  9579. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9580. }
  9581. addBigSkillSpine() {
  9582. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  9583. console.log("extra2 success");
  9584. });
  9585. }
  9586. runBigSkill(callback) {
  9587. this.tweenArr = [];
  9588. this.callback = callback;
  9589. this.judgeSkill();
  9590. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  9591. let guide = DataMgr.getSkillGuide();
  9592. if (!xGame.common.gameMgr.selfTurn) {
  9593. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  9594. }
  9595. else {
  9596. if (xGame.common.temSelfLevel != 0) {
  9597. this.leveNum = xGame.common.temSelfLevel;
  9598. }
  9599. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  9600. this.leveNum += 5;
  9601. }
  9602. }
  9603. if (guide == 0) {
  9604. DataMgr.setSkillGuide(1);
  9605. if (DataMgr.getNewUser()) {
  9606. Moyu.sendDataEvent("gameFirstPlay");
  9607. DataMgr.setNewUser();
  9608. }
  9609. }
  9610. this.playSpineAni(() => {
  9611. switch (this.curSkill) {
  9612. case SkillType.highSpace:
  9613. this.runHighSpace();
  9614. break;
  9615. case SkillType.breakArmy:
  9616. this.runBreakArmy();
  9617. break;
  9618. case SkillType.ice:
  9619. this.runIce();
  9620. break;
  9621. case SkillType.fireworks:
  9622. this.runFireworks();
  9623. break;
  9624. case SkillType.GuanYu:
  9625. this.runGuanYu();
  9626. break;
  9627. default:
  9628. break;
  9629. }
  9630. });
  9631. }
  9632. judgeSkill() {
  9633. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  9634. let gameMgr = xGame.common.gameMgr;
  9635. let type;
  9636. for (let index = 0; index < typeArr.length; index++) {
  9637. type = typeArr[index];
  9638. if (gameMgr.selfTurn) {
  9639. if (gameMgr.selfCurSkill == type) {
  9640. this.selfTurn = true;
  9641. this.curSkill = type;
  9642. return;
  9643. }
  9644. }
  9645. else {
  9646. if (gameMgr.aiCurSkill == type) {
  9647. this.selfTurn = false;
  9648. this.curSkill = type;
  9649. return;
  9650. }
  9651. }
  9652. }
  9653. }
  9654. playSpineAni(callback) {
  9655. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  9656. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  9657. parent.destroyChildren();
  9658. let aniIndex = 0;
  9659. let skillSpine;
  9660. switch (this.curSkill) {
  9661. case SkillType.highSpace:
  9662. aniIndex = 1;
  9663. xGame.soundMgr.playSound("skill01");
  9664. skillSpine = this.skillSpine2;
  9665. data.scaleX = 0.5;
  9666. data.scaleY = 0.5;
  9667. skillSpine.play(data, 1, false, parent, () => {
  9668. callback && callback();
  9669. });
  9670. break;
  9671. case SkillType.breakArmy:
  9672. aniIndex = 2;
  9673. xGame.soundMgr.playSound("skill02");
  9674. skillSpine = this.skillSpine2;
  9675. data.scaleX = 0.5;
  9676. data.scaleY = 0.5;
  9677. skillSpine.play(data, 2, false, parent, () => {
  9678. callback && callback();
  9679. });
  9680. break;
  9681. case SkillType.ice:
  9682. aniIndex = 0;
  9683. xGame.soundMgr.playSound("skill03");
  9684. skillSpine = this.skillSpine2;
  9685. data.scaleX = 0.5;
  9686. data.scaleY = 0.5;
  9687. skillSpine.play(data, 0, false, parent, () => {
  9688. callback && callback();
  9689. });
  9690. break;
  9691. case SkillType.fireworks:
  9692. xGame.soundMgr.playSound("skill_04_01");
  9693. xGame.soundMgr.playSound("skill04");
  9694. xGame.uiMgr.Show(UIFireworks, callback);
  9695. break;
  9696. case SkillType.GuanYu:
  9697. xGame.soundMgr.playSound("skill05_1");
  9698. xGame.soundMgr.playSound("skill05");
  9699. xGame.uiMgr.Show(UIGuanYu, callback);
  9700. break;
  9701. default:
  9702. break;
  9703. }
  9704. }
  9705. getAllBallArr() {
  9706. let arr = xGame.common.d2World.ballArr;
  9707. let outArr = [];
  9708. for (let index = 0; index < arr.length; index++) {
  9709. if (arr[index] instanceof D2RootBallSrc)
  9710. continue;
  9711. if (arr[index].ballFunc == "ice")
  9712. continue;
  9713. if (arr[index].destroyed)
  9714. continue;
  9715. outArr.push(arr[index]);
  9716. }
  9717. return outArr;
  9718. }
  9719. getOneArr(deletObj) {
  9720. let allArr = this.getAllBallArr();
  9721. let temp;
  9722. for (let index = 0; index < allArr.length; index++) {
  9723. temp = allArr[index];
  9724. if (temp.id == deletObj.id) {
  9725. allArr.splice(index, 1);
  9726. break;
  9727. }
  9728. }
  9729. return allArr;
  9730. }
  9731. getNearBallBag(ball) {
  9732. let ui = xGame.common.gameUI.ui;
  9733. let circleArr = [];
  9734. for (let index = 1; index <= 6; index++) {
  9735. circleArr.push(ui.border["circle" + index]);
  9736. }
  9737. let outIndex = 0;
  9738. let temp;
  9739. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  9740. ;
  9741. let dis = 0;
  9742. for (let index = 1; index < circleArr.length; index++) {
  9743. temp = circleArr[index];
  9744. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  9745. if (dis < min) {
  9746. min = dis;
  9747. outIndex = index;
  9748. }
  9749. }
  9750. return [circleArr[outIndex], outIndex];
  9751. }
  9752. ballFlyToBag(ballArr, time = 300) {
  9753. let temp;
  9754. let hole;
  9755. this._finishNum = ballArr.length;
  9756. this._curFinish = 0;
  9757. let holeObj = {};
  9758. let holeCfg = {
  9759. "1": 0,
  9760. "2": 0,
  9761. "3": 0,
  9762. "4": 0,
  9763. "5": 0,
  9764. "6": 0
  9765. };
  9766. for (let index = 0; index < ballArr.length; index++) {
  9767. temp = ballArr[index];
  9768. temp.outColli.isSensor = true;
  9769. temp.innerColli.isSensor = true;
  9770. temp.isRunSkillAni = true;
  9771. let holeArr = this.getNearBallBag(temp);
  9772. hole = holeArr[0];
  9773. holeObj[index] = holeArr[1];
  9774. temp.d3BallSrc.scaleXYZ = 0.5;
  9775. this.tweenArr.push(temp.d3BallSrc, temp);
  9776. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  9777. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  9778. }));
  9779. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  9780. let mIndex = holeObj[this._curFinish];
  9781. let isDone = holeCfg[mIndex];
  9782. if (isDone) {
  9783. ballArr[this._curFinish].checkWrongBall(false);
  9784. }
  9785. else {
  9786. holeCfg[mIndex] = 1;
  9787. ballArr[this._curFinish].checkWrongBall();
  9788. }
  9789. this._curFinish++;
  9790. if (this._curFinish >= this._finishNum) {
  9791. if (this.curSkill == SkillType.highSpace) {
  9792. }
  9793. else if (this.curSkill == SkillType.breakArmy) {
  9794. let rootBall = xGame.common.d2World.rootBall;
  9795. rootBall.gameObj.x = this._rootX;
  9796. rootBall.gameObj.y = this._rootY;
  9797. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  9798. xGame.common.d2World.d2Gan.ui.visible = true;
  9799. xGame.common.d2World.d2HelpLine.ui.visible = true;
  9800. xGame.common.d2World.getHelpLine();
  9801. this.callback && this.callback(this.extraScore);
  9802. }
  9803. }
  9804. }));
  9805. }
  9806. }
  9807. runHighSpace() {
  9808. let rootBall = xGame.common.d2World.rootBall;
  9809. rootBall.showSelf();
  9810. let d3Src = rootBall.d3BallSrc;
  9811. let allArr = this.getAllBallArr();
  9812. if (allArr.length <= 0) {
  9813. this.callback && this.callback(0);
  9814. return;
  9815. }
  9816. let selectBall = xGame.common.d2World.targetBall;
  9817. let wrong = selectBall && selectBall.destroyed;
  9818. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  9819. selectBall = xGame.common.getRandArrEle(allArr);
  9820. }
  9821. let targetD3Src = selectBall.d3BallSrc;
  9822. xGame.common.d2World.d2Gan.ui.visible = false;
  9823. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9824. d3Src.scaleXYZ = 0.5;
  9825. this.tweenArr.push(d3Src);
  9826. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  9827. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9828. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  9829. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  9830. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  9831. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  9832. let outArr = [selectBall];
  9833. let other = this.leveNum - 1;
  9834. if (other > 0) {
  9835. let nearArr = this.getOneArr(selectBall);
  9836. if (nearArr.length > 0) {
  9837. xGame.common.botherArr(nearArr);
  9838. if (other >= nearArr.length)
  9839. other = nearArr.length;
  9840. for (let index = 0; index < other; index++) {
  9841. outArr.push(nearArr[index]);
  9842. }
  9843. }
  9844. }
  9845. xGame.common.extraMoveNum = other + 1;
  9846. this.extraScore = other + 1;
  9847. this._rootX = selectBall.gameObj.x;
  9848. this._rootY = selectBall.gameObj.y;
  9849. rootBall.gameObj.x = this._rootX;
  9850. rootBall.gameObj.y = this._rootY;
  9851. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  9852. Laya.Tween.clearAll(d3Src);
  9853. this.addRandomForce(outArr);
  9854. }));
  9855. }));
  9856. }
  9857. addRandomForce(outArr) {
  9858. if (outArr.length > 0) {
  9859. xGame.common.d2World.openCheckStill = true;
  9860. this.playedLastSkill = true;
  9861. }
  9862. let temp;
  9863. for (let index = 0; index < outArr.length; index++) {
  9864. let angle = xGame.common.randomNum(0, 360);
  9865. let linearPercent = xGame.common.randomNum(65, 100);
  9866. temp = outArr[index];
  9867. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  9868. }
  9869. }
  9870. setLinearSpeed(angle, rigy, linearPercent) {
  9871. let sin = Math.sin(angle * Math.PI / 180);
  9872. let cos = Math.cos(angle * Math.PI / 180);
  9873. let maxSpeed = 4;
  9874. let speed = new Laya.Vector2();
  9875. speed.x = maxSpeed * linearPercent * sin;
  9876. speed.y = -maxSpeed * linearPercent * cos;
  9877. rigy.applyLinearImpulseToCenter(speed);
  9878. }
  9879. runBreakArmy() {
  9880. xGame.common.d2World.d2Gan.ui.visible = false;
  9881. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9882. let gameUI = xGame.common.gameUI.ui;
  9883. gameUI.skillRod.visible = true;
  9884. gameUI.skillRod.rotation = 110;
  9885. let outArr = this.getAllBallArr();
  9886. if (outArr.length <= 0) {
  9887. gameUI.skillRod.visible = false;
  9888. this.callback && this.callback(0);
  9889. return;
  9890. }
  9891. xGame.common.botherArr(outArr);
  9892. if (this.leveNum >= outArr.length)
  9893. this.leveNum = outArr.length;
  9894. let deleteNum = outArr.length - this.leveNum;
  9895. outArr.splice(0, deleteNum);
  9896. this.extraScore = this.leveNum;
  9897. let potX = gameUI.skillRod.x;
  9898. let potY = gameUI.skillRod.y;
  9899. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  9900. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  9901. let disArr = [];
  9902. for (let index = 0; index < outArr.length; index++) {
  9903. let obj = outArr[index];
  9904. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  9905. dis = Math.pow(dis, 0.5);
  9906. disArr.push(dis);
  9907. }
  9908. this.tweenArr.push(gameUI.skillRod);
  9909. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9910. })).update = Laya.Handler.create(this, (e, t, c) => {
  9911. let angle = gameUI.skillRod.rotation;
  9912. let xx;
  9913. let yy;
  9914. let temp;
  9915. for (let index = 0; index < outArr.length; index++) {
  9916. temp = outArr[index];
  9917. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  9918. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  9919. yy -= 20;
  9920. temp.gameObj.x = xx;
  9921. temp.gameObj.y = yy;
  9922. temp.d3BallSrc.setTransPos(xx, yy);
  9923. }
  9924. if (angle <= 60) {
  9925. Laya.Tween.clearAll(gameUI.skillRod);
  9926. this.ballFlyToBag(outArr, 150);
  9927. gameUI.skillRod.visible = false;
  9928. }
  9929. }, null, false);
  9930. }
  9931. runIce() {
  9932. let ballArr = xGame.common.d2World.ballArr;
  9933. this.leveNum *= 2;
  9934. if (this.leveNum >= ballArr.length - 1)
  9935. this.leveNum = ballArr.length - 1;
  9936. let tempArr = [];
  9937. let outArr = [];
  9938. for (let index = 0; index < ballArr.length; index++) {
  9939. if (ballArr[index] instanceof D2RootBallSrc)
  9940. continue;
  9941. tempArr.push(ballArr[index]);
  9942. }
  9943. if (tempArr.length <= 0) {
  9944. this.callback && this.callback(0);
  9945. return;
  9946. }
  9947. xGame.common.botherArr(tempArr);
  9948. for (let index = 0; index < this.leveNum; index++) {
  9949. outArr.push(tempArr[index]);
  9950. }
  9951. this.extraScore = this.leveNum;
  9952. let temp;
  9953. for (let index = 0; index < outArr.length; index++) {
  9954. temp = outArr[index];
  9955. temp.d3BallSrc.playIceEft();
  9956. }
  9957. Laya.timer.once(2000, this, () => {
  9958. for (let index = 0; index < outArr.length; index++) {
  9959. temp = outArr[index];
  9960. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  9961. temp.setBallFunc("ice", str);
  9962. }
  9963. this.callback && this.callback(0);
  9964. });
  9965. }
  9966. runFireworks() {
  9967. let allArr = this.getAllBallArr();
  9968. if (allArr.length <= 0) {
  9969. this.callback && this.callback(0);
  9970. return;
  9971. }
  9972. xGame.common.d2World.d2Gan.ui.visible = false;
  9973. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9974. let outArr = [];
  9975. let other = this.leveNum;
  9976. if (other > 0) {
  9977. if (allArr.length > 0) {
  9978. xGame.common.botherArr(allArr);
  9979. if (other >= allArr.length)
  9980. other = allArr.length;
  9981. for (let index = 0; index < other; index++) {
  9982. outArr.push(allArr[index]);
  9983. }
  9984. }
  9985. }
  9986. xGame.common.extraMoveNum = other;
  9987. this.extraScore = other;
  9988. this.addRandmomFireworks(outArr);
  9989. }
  9990. addRandmomFireworks(outArr) {
  9991. Laya.timer.once(1100, this, () => {
  9992. if (outArr.length > 0) {
  9993. xGame.common.d2World.openCheckStill = true;
  9994. this.playedLastSkill = true;
  9995. }
  9996. });
  9997. xGame.soundMgr.playSound("skill_04_02");
  9998. let temp;
  9999. let delay = -200;
  10000. for (let index = 0; index < outArr.length; index++) {
  10001. temp = outArr[index];
  10002. delay += 200;
  10003. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  10004. let angle = xGame.common.randomNum(0, 360);
  10005. angle = this.getFireworksAngle(obj);
  10006. let linearPercent = xGame.common.randomNum(45, 80);
  10007. if (!obj.destroyed)
  10008. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  10009. });
  10010. }
  10011. }
  10012. getFireworksAngle(obj) {
  10013. let rootBall = xGame.common.d2World.rootBall;
  10014. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  10015. }
  10016. resetGame() {
  10017. Laya.timer.clearAll(this);
  10018. if (this.tweenArr) {
  10019. for (let index = 0; index < this.tweenArr.length; index++) {
  10020. Laya.Tween.clearAll(this.tweenArr[index]);
  10021. }
  10022. }
  10023. this.tweenArr = null;
  10024. }
  10025. runGuanYu() {
  10026. xGame.common.d2World.d2Gan.ui.visible = false;
  10027. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10028. let rootBall = xGame.common.d2World.rootBall;
  10029. if (rootBall.isInHole) {
  10030. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  10031. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  10032. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  10033. rootBall.showSelf();
  10034. }
  10035. this.rtStarX = rootBall.gameObj.x;
  10036. this.rtStarY = rootBall.gameObj.y;
  10037. this.knifeTimes = 0;
  10038. this.playedLastSkill = true;
  10039. rootBall.forceRun = true;
  10040. rootBall.rigy.type = "static";
  10041. xGame.common.d2World.openCheckStill = true;
  10042. this.guanyuRandomKnife();
  10043. }
  10044. guanyuRandomKnife() {
  10045. let rootBall = xGame.common.d2World.rootBall;
  10046. let dir = this.getRandDir();
  10047. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  10048. console.log("当前angle", angle);
  10049. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  10050. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  10051. let dis = 324;
  10052. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  10053. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  10054. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  10055. this.rtStarX = rootBall.gameObj.x;
  10056. this.rtStarY = rootBall.gameObj.y;
  10057. this.knifeTimes++;
  10058. let skillLevel;
  10059. if (xGame.common.gameMgr.selfTurn) {
  10060. skillLevel = DataMgr.getBigSkillByIndex(4);
  10061. }
  10062. else {
  10063. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  10064. }
  10065. if (!skillLevel)
  10066. skillLevel = 1;
  10067. skillLevel += 2;
  10068. if (this.knifeTimes < skillLevel) {
  10069. Laya.timer.once(400, this, () => {
  10070. this.guanyuRandomKnife();
  10071. });
  10072. }
  10073. else {
  10074. rootBall.forceRun = false;
  10075. rootBall.rigy.type = "dynamic";
  10076. xGame.common.extraMoveNum = skillLevel;
  10077. }
  10078. }));
  10079. }
  10080. getRandDir() {
  10081. let rootBall = xGame.common.d2World.rootBall;
  10082. let allBall = this.getAllBallArr();
  10083. let target = xGame.common.getRandArrEle(allBall);
  10084. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  10085. return this.knifeV2;
  10086. }
  10087. cloneKnife(x, y, rotation) {
  10088. let parent = xGame.common.d3World.knifeRoot;
  10089. let prefab = xGame.common.d3World.knife;
  10090. let clone = prefab.clone();
  10091. parent.addChild(clone);
  10092. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  10093. clone.transform.localPositionX = this.knifeV3.x;
  10094. clone.transform.localPositionY = 0;
  10095. clone.transform.localPositionZ = this.knifeV3.z;
  10096. clone.transform.localRotationEulerX = 0;
  10097. clone.transform.localRotationEulerY = rotation;
  10098. clone.transform.localRotationEulerZ = 0;
  10099. clone.active = true;
  10100. return clone;
  10101. }
  10102. cloneGuanYuEft(x, y, angle) {
  10103. return;
  10104. let parent = xGame.common.gameUI.ui.guanyuNode;
  10105. let eft = new ui_guanyuAni();
  10106. eft.parent = parent;
  10107. eft.x = x;
  10108. eft.y = y;
  10109. eft.rotation = angle;
  10110. }
  10111. }
  10112. class ui_UIWordsList extends fgui.GComponent {
  10113. static createInstance() {
  10114. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  10115. }
  10116. onConstruct() {
  10117. this.c1 = this.getController("c1");
  10118. this.n74 = (this.getChild("n74"));
  10119. this.clickNode = (this.getChild("clickNode"));
  10120. this.myNode = (this.getChild("myNode"));
  10121. this.n68 = (this.getChild("n68"));
  10122. this.n66 = (this.getChild("n66"));
  10123. this.n55 = (this.getChild("n55"));
  10124. this.wordsBtn = (this.getChild("wordsBtn"));
  10125. this.emotionBtn = (this.getChild("emotionBtn"));
  10126. this.mybggg = (this.getChild("mybggg"));
  10127. this.wordsList = (this.getChild("wordsList"));
  10128. this.emotionList = (this.getChild("emotionList"));
  10129. this.myRoot = (this.getChild("myRoot"));
  10130. }
  10131. }
  10132. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  10133. class EmotionDisplay {
  10134. constructor(index, ui) {
  10135. this.ui = ui;
  10136. this.index = index;
  10137. this.ui.onClick(this, this.clickSelf);
  10138. this.updateSelf();
  10139. }
  10140. updateSelf() {
  10141. let data = cfgTable.emotionData[this.index + 1];
  10142. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  10143. }
  10144. clickSelf() {
  10145. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10146. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  10147. xGame.common.talkMgr.closeTalkView();
  10148. }
  10149. }
  10150. class WordsDisplay {
  10151. constructor(index, ui) {
  10152. this.ui = ui;
  10153. this.index = index;
  10154. this.ui.onClick(this, this.clickSelf);
  10155. this.updateSelf();
  10156. }
  10157. updateSelf() {
  10158. let data = cfgTable.talkwordsData[this.index + 1];
  10159. this.ui.txt.text = data.msg;
  10160. }
  10161. clickSelf() {
  10162. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10163. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  10164. xGame.common.talkMgr.closeTalkView();
  10165. }
  10166. }
  10167. class UIWordsList extends UIBase {
  10168. constructor() {
  10169. super();
  10170. }
  10171. onConstructor() {
  10172. this.ui = ui_UIWordsList.createInstance();
  10173. this.contentPane = this.ui;
  10174. this.isEject = false;
  10175. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  10176. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  10177. this.addUIClick(this.ui.clickNode, this.hide);
  10178. this.initTalkList();
  10179. this.initEmotionList();
  10180. }
  10181. show() {
  10182. super.show();
  10183. }
  10184. initTalkList() {
  10185. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  10186. let data = cfgTable.talkwordsData;
  10187. let length = Object.keys(data).length;
  10188. this.ui.wordsList.numItems = length;
  10189. }
  10190. initEmotionList() {
  10191. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  10192. let data = cfgTable.emotionData;
  10193. let length = Object.keys(data).length;
  10194. this.ui.emotionList.numItems = length;
  10195. }
  10196. renderTalkItem(index, obj) {
  10197. let temp = new WordsDisplay(index, obj);
  10198. }
  10199. renderEmotionItem(index, obj) {
  10200. let temp = new EmotionDisplay(index, obj);
  10201. }
  10202. openTalkList() {
  10203. this.ui.c1.selectedIndex = 0;
  10204. }
  10205. openEmotionList() {
  10206. this.ui.c1.selectedIndex = 1;
  10207. }
  10208. }
  10209. UIWordsList.uiName = "UIWordsList";
  10210. class TalkMgr {
  10211. constructor() {
  10212. this.aiSpeak = true;
  10213. this.emotionList = [];
  10214. this.talkList = [];
  10215. this.addEvent();
  10216. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10217. this.emotionList = [];
  10218. this.talkList = [];
  10219. for (let k in cfgTable.emotionData) {
  10220. this.emotionList.push(cfgTable.emotionData[k].id);
  10221. }
  10222. for (let k in cfgTable.talkwordsData) {
  10223. this.talkList.push(cfgTable.talkwordsData[k].id);
  10224. }
  10225. }
  10226. addEvent() {
  10227. let ui = xGame.common.gameUI.ui;
  10228. ui.wordsBtn.visible = true;
  10229. ui.wordsBtn.onClick(this, this.openTalkView);
  10230. ui.aiWordsBtn.visible = true;
  10231. ui.aiWordsBtn.onClick(this, this.clickAIState);
  10232. }
  10233. openTalkView() {
  10234. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10235. xGame.uiMgr.Show(UIWordsList);
  10236. }
  10237. closeTalkView() {
  10238. xGame.uiMgr.Hide(UIWordsList);
  10239. }
  10240. clickAIState() {
  10241. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10242. this.aiSpeak = !this.aiSpeak;
  10243. this.changeAIState(this.aiSpeak);
  10244. }
  10245. changeAIState(speak) {
  10246. this.aiSpeak = speak;
  10247. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  10248. if (speak) {
  10249. btn.c1.selectedIndex = 0;
  10250. }
  10251. else {
  10252. btn.c1.selectedIndex = 1;
  10253. }
  10254. }
  10255. showSelfTalk(wordsId) {
  10256. let ui = xGame.common.gameUI.ui;
  10257. ui.selfTalk.visible = true;
  10258. ui.selfTalk.myNode.c1.selectedIndex = 1;
  10259. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10260. ui.selfTalk.t0.play();
  10261. }
  10262. showSelfEmotion(emotionId) {
  10263. let ui = xGame.common.gameUI.ui;
  10264. ui.selfTalk.visible = true;
  10265. ui.selfTalk.myNode.c1.selectedIndex = 0;
  10266. this.selfSpine && this.selfSpine.dispose();
  10267. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10268. let spineData = cfgTable.emotionData[emotionId].spine;
  10269. this.selfSpine = new SpineMgr(spineData, () => {
  10270. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  10271. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  10272. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  10273. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  10274. });
  10275. ui.selfTalk.t0.play();
  10276. }
  10277. showAITalk(wordsId) {
  10278. if (!this.aiSpeak)
  10279. return;
  10280. if (DataMgr.gameData.gameCount < 2)
  10281. return;
  10282. if (wordsId < 1)
  10283. wordsId = this.getRandTalk();
  10284. let ui = xGame.common.gameUI.ui;
  10285. ui.aiTalk.visible = true;
  10286. ui.aiTalk.myNode.c1.selectedIndex = 1;
  10287. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10288. ui.aiTalk.t0.play();
  10289. }
  10290. getRandTalk() {
  10291. let rand = xGame.tools.random(0, this.talkList.length);
  10292. return this.emotionList[rand];
  10293. }
  10294. getRandEmotion() {
  10295. let rand = xGame.tools.random(0, this.emotionList.length);
  10296. return this.emotionList[rand];
  10297. }
  10298. showAIEmotion(emotionId) {
  10299. if (!this.aiSpeak)
  10300. return;
  10301. if (DataMgr.gameData.gameCount < 2)
  10302. return;
  10303. if (emotionId < 1)
  10304. emotionId = this.getRandEmotion();
  10305. let ui = xGame.common.gameUI.ui;
  10306. ui.aiTalk.visible = true;
  10307. ui.aiTalk.myNode.c1.selectedIndex = 0;
  10308. this.aiSpine && this.aiSpine.dispose();
  10309. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  10310. let spineData = cfgTable.emotionData[emotionId].spine;
  10311. this.aiSpine = new SpineMgr(spineData, () => {
  10312. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  10313. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  10314. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  10315. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  10316. });
  10317. ui.aiTalk.t0.play();
  10318. }
  10319. resetGame() {
  10320. let ui = xGame.common.gameUI.ui;
  10321. ui.aiTalk.visible = false;
  10322. ui.selfTalk.visible = false;
  10323. this.aiSpine && this.aiSpine.dispose();
  10324. this.selfSpine && this.selfSpine.dispose();
  10325. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  10326. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10327. this.closeTalkView();
  10328. }
  10329. }
  10330. class WordsMgr {
  10331. constructor() {
  10332. this.comboTimes = 1;
  10333. this.skillTimes = 0;
  10334. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  10335. this.comboSpine = new SpineMgr("yxz_liangan");
  10336. this.skillSpine = new SpineMgr("yiganxqiu");
  10337. this.scoreSpine = new SpineMgr("defen");
  10338. }
  10339. setClassicCombo(isInterrupt) {
  10340. if (isInterrupt) {
  10341. this.comboTimes = 0;
  10342. }
  10343. }
  10344. playClassicWords(type, callback) {
  10345. this.callback = callback;
  10346. let aniIndex = type;
  10347. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10348. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  10349. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  10350. mySpine.destroy(true);
  10351. this.playClassicTimes();
  10352. });
  10353. }
  10354. playClassicTimes() {
  10355. this.comboTimes++;
  10356. if (this.comboTimes <= 1) {
  10357. this.callback && this.callback();
  10358. }
  10359. else {
  10360. let aniIndex = this.comboTimes - 1;
  10361. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10362. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  10363. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  10364. mySpine.destroy(true);
  10365. this.callback && this.callback();
  10366. });
  10367. }
  10368. }
  10369. playBigSkillTimes(times, callback) {
  10370. if (times <= 0) {
  10371. callback && callback();
  10372. return;
  10373. }
  10374. this.callback = callback;
  10375. let pre = "sz_0";
  10376. let aniIndex = 0;
  10377. this.getWordsImg(times, pre, () => {
  10378. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10379. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  10380. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  10381. let r1 = ``;
  10382. let r2 = ``;
  10383. if (times <= 9) {
  10384. r1 = `res/d2Res/${pre}${times}.png`;
  10385. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10386. aniIndex = 0;
  10387. }
  10388. else {
  10389. r1 = `res/d2Res/${pre}${times % 10}.png`;
  10390. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  10391. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  10392. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  10393. aniIndex = 1;
  10394. }
  10395. this.skillSpine.play(data, aniIndex, false, parent, () => {
  10396. mySpine.destroy(true);
  10397. xGame.common.gameMgr.playSkillTips();
  10398. this.playScore(times);
  10399. xGame.common.playRandomMutiBallBigSkillSound();
  10400. }, mySpine);
  10401. });
  10402. }
  10403. playScore(score) {
  10404. let pre = "sz_";
  10405. let aniIndex = 0;
  10406. this.getWordsImg(score, pre, () => {
  10407. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10408. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  10409. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  10410. let r1 = ``;
  10411. let r2 = ``;
  10412. if (score <= 9) {
  10413. r1 = `res/d2Res/${pre}${score}.png`;
  10414. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10415. aniIndex = 0;
  10416. }
  10417. else {
  10418. r1 = `res/d2Res/${pre}${score % 10}.png`;
  10419. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  10420. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10421. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  10422. aniIndex = 1;
  10423. }
  10424. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  10425. mySpine.destroy(true);
  10426. this.callback && this.callback();
  10427. }, mySpine);
  10428. });
  10429. }
  10430. getWordsImg(number, pre = "", callback) {
  10431. let arr = [];
  10432. if (number <= 9) {
  10433. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  10434. }
  10435. else {
  10436. 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 });
  10437. }
  10438. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  10439. callback && callback();
  10440. }));
  10441. }
  10442. }
  10443. class ui_UIRodMethod extends fgui.GComponent {
  10444. static createInstance() {
  10445. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  10446. }
  10447. onConstruct() {
  10448. this.n24 = (this.getChild("n24"));
  10449. this.white = (this.getChild("white"));
  10450. this.dot = (this.getChild("dot"));
  10451. this.sureBtn = (this.getChild("sureBtn"));
  10452. this.n20 = (this.getChild("n20"));
  10453. this.n21 = (this.getChild("n21"));
  10454. this.n22 = (this.getChild("n22"));
  10455. this.n23 = (this.getChild("n23"));
  10456. this.n5 = (this.getChild("n5"));
  10457. this.n14 = (this.getChild("n14"));
  10458. this.t0 = this.getTransition("t0");
  10459. }
  10460. }
  10461. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  10462. class UIRodMethod extends UIBase {
  10463. constructor() {
  10464. super();
  10465. this.isPressd = false;
  10466. }
  10467. onConstructor() {
  10468. this.ui = ui_UIRodMethod.createInstance();
  10469. this.contentPane = this.ui;
  10470. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  10471. this.moveDir = new Laya.Vector2();
  10472. this.moveDest = new Laya.Vector2();
  10473. this.centerPos = new Laya.Vector2();
  10474. xGame.common.uiRodMethod = this;
  10475. }
  10476. show() {
  10477. super.show();
  10478. xGame.common.gameMgr.gamePause = true;
  10479. this.openPressDotEvent();
  10480. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  10481. this.centerPos.x = this.ui.white.x;
  10482. this.centerPos.y = this.ui.white.y;
  10483. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  10484. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  10485. this.setDot();
  10486. }
  10487. setDot() {
  10488. this.ui.dot.x = this.moveDest.x;
  10489. this.ui.dot.y = this.moveDest.y;
  10490. }
  10491. closeSelf() {
  10492. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  10493. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  10494. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  10495. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  10496. xGame.common.gameMgr.gamePause = false;
  10497. this.hide();
  10498. }
  10499. openPressDotEvent() {
  10500. this.closePressDotEvent();
  10501. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10502. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  10503. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10504. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10505. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10506. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10507. }
  10508. closePressDotEvent() {
  10509. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10510. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  10511. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10512. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10513. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10514. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10515. }
  10516. onDown(e) {
  10517. if (e.type == Laya.Event.MOUSE_DOWN)
  10518. this.isPressd = true;
  10519. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  10520. this.isPressd = false;
  10521. if (!this.isPressd)
  10522. return;
  10523. this.moveDest.x = e.stageX;
  10524. this.moveDest.y = e.stageY;
  10525. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  10526. if (dis > 6724) {
  10527. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  10528. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  10529. }
  10530. this.setDot();
  10531. }
  10532. resetRod() {
  10533. this.ui.dot.x = this.ui.white.x;
  10534. this.ui.dot.y = this.ui.white.y;
  10535. this.gameRod.dot.x = this.gameRod.bg.x;
  10536. this.gameRod.dot.y = this.gameRod.bg.y;
  10537. xGame.common.rodOffest.x = 0;
  10538. xGame.common.rodOffest.y = 0;
  10539. }
  10540. }
  10541. UIRodMethod.uiName = "UIRodMethod";
  10542. class UIGame extends UIBase {
  10543. constructor() {
  10544. super();
  10545. this.powerNum = 0;
  10546. this.isD3Inited = false;
  10547. this.isPrePlay = false;
  10548. this.isMoveRod = false;
  10549. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  10550. this.rulerDis = 20;
  10551. this.rulerOffset = 0;
  10552. }
  10553. onConstructor() {
  10554. this.ui = ui_UIGame.createInstance();
  10555. this.contentPane = this.ui;
  10556. this.ui.x += xGame.common.sysOffestNum;
  10557. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  10558. this.isEject = false;
  10559. xGame.common.gameUI = this;
  10560. this.initSelf();
  10561. }
  10562. isTurnSelf() {
  10563. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  10564. return true;
  10565. }
  10566. }
  10567. initSelf() {
  10568. let topUI = this.ui.topNode;
  10569. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  10570. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  10571. this.barInfo = {};
  10572. this.barInfo.curY = 0;
  10573. this.barInfo.height = this.ui.powerNode.height;
  10574. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  10575. this.barInfo.powerStartY = this.ui.powerNode.y;
  10576. xGame.common.aiPlayer = new AIPlayer();
  10577. xGame.common.gameMgr = new GameMgr();
  10578. xGame.common.skillMgr = new SkillMgr();
  10579. xGame.common.wordsMgr = new WordsMgr();
  10580. xGame.common.talkMgr = new TalkMgr();
  10581. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  10582. console.log("加载经典模式表情文件chenggon !");
  10583. });
  10584. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  10585. console.log("挑战模式奖励模式spine加载成功!");
  10586. });
  10587. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  10588. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10589. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  10590. this.addUIClick(this.ui.returnBtn, this.returnHome);
  10591. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  10592. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  10593. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  10594. }
  10595. getGanZiImg() {
  10596. let index = DataMgr.getCurBallRod();
  10597. let data = cfgTable.ballrodData[index + 1];
  10598. let gan_url = xGame.common.getGameIconUrl(data.img);
  10599. console.log('zh:getGanZiImg gan_url==' + gan_url);
  10600. this.ui.powerNode.showImg.url = gan_url;
  10601. console.log('zh:修改杆子图标O K');
  10602. }
  10603. returnHome() {
  10604. let tips = "Are you sure to exit the game?";
  10605. let woman = "Boss, why don't you play for a while longer?";
  10606. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  10607. }
  10608. addRodMethodClick() {
  10609. if (this.isTurnSelf()) {
  10610. xGame.uiMgr.Show(UIRodMethod);
  10611. }
  10612. }
  10613. clickHelpLineBtn(force = false) {
  10614. if (!this.isTurnSelf())
  10615. return;
  10616. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  10617. if (success) {
  10618. xGame.common.longHelpLine = true;
  10619. xGame.common.d2World.getHelpLine();
  10620. Moyu.sendDataEvent("guideNum");
  10621. }
  10622. else {
  10623. }
  10624. });
  10625. }
  10626. renderSelfDisplayBalls(index, target) {
  10627. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  10628. target.myImg.url = xGame.common.getGameIconUrl(str);
  10629. }
  10630. renderAIDisplayBalls(index, target) {
  10631. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  10632. target.myImg.url = xGame.common.getGameIconUrl(str);
  10633. ;
  10634. }
  10635. updateMode() {
  10636. if (xGame.common.gameMode == GameMode.classic) {
  10637. this.ui.topNode.scoreNode.visible = false;
  10638. }
  10639. else if (xGame.common.gameMode == GameMode.bigMove) {
  10640. this.ui.topNode.scoreNode.visible = true;
  10641. }
  10642. }
  10643. show() {
  10644. super.show();
  10645. console.log("zh:uigame show AADD");
  10646. this.ui.alpha = 0;
  10647. this.updateSelf();
  10648. xGame.common.gameMgr.gamePause = false;
  10649. xGame.common.gameUI.ui.blackAni.visible = false;
  10650. xGame.common.gameUI.ui.whiteAni.visible = false;
  10651. this.ui.powerEft.visible = false;
  10652. this.ui.colorNode.visible = false;
  10653. this.updateHead();
  10654. let curUse = DataMgr.getCurBallRod();
  10655. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  10656. this.getGanZiImg();
  10657. }
  10658. updateSelf() {
  10659. if (xGame.common.gameMode == GameMode.classic) {
  10660. this.ui.c1.selectedIndex = 0;
  10661. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  10662. this.ui.topNode.middleNode.visible = true;
  10663. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  10664. }
  10665. else if (xGame.common.gameMode == GameMode.bigMove) {
  10666. this.ui.c1.selectedIndex = 0;
  10667. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  10668. this.ui.topNode.middleNode.visible = false;
  10669. let max = xGame.cfgMgr.getMaxBigMoveLength();
  10670. let rand = xGame.common.randomNum(1, max);
  10671. let guide = DataMgr.getSkillGuide();
  10672. if (guide == 0)
  10673. rand = 1;
  10674. xGame.common.bigMoveLevelIndex = rand;
  10675. }
  10676. else if (xGame.common.gameMode == GameMode.placeBall) {
  10677. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  10678. this.ui.c1.selectedIndex = 1 + data.type;
  10679. this.ui.alpha = 1;
  10680. this.startGame();
  10681. }
  10682. this.updateMode();
  10683. this.initD3world();
  10684. this.initD2world();
  10685. }
  10686. startGame() {
  10687. this.ui.snowNode.visible = Math.random() <= 0.1;
  10688. this.ui.d2Node.visible = false;
  10689. xGame.common.d3World.d3Hand.gameObj.active = false;
  10690. xGame.common.d3World.tableSrc.init();
  10691. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  10692. this.cameraViewChange(() => {
  10693. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  10694. switch (xGame.common.gameMode) {
  10695. case GameMode.classic:
  10696. xGame.common.d3World.d3Hand.gameObj.active = true;
  10697. this.playPutBallD3Ani();
  10698. break;
  10699. case GameMode.bigMove:
  10700. this.enterGame();
  10701. Laya.timer.once(500, this, () => {
  10702. this.ui.topNode.middleNode.visible = true;
  10703. this.ui.topNode.middleNode.t0.play();
  10704. });
  10705. break;
  10706. case GameMode.placeBall:
  10707. this.enterGame();
  10708. break;
  10709. default:
  10710. break;
  10711. }
  10712. });
  10713. PlatMgr.showBanner(false);
  10714. }
  10715. enterGame() {
  10716. this.ui.d2Node.visible = true;
  10717. xGame.common.d3World.d3Hand.gameObj.active = false;
  10718. xGame.common.showOneCamera("mainCamera");
  10719. Moyu.recordGame(30, true);
  10720. if (!this.isPrePlay) {
  10721. this.isPrePlay = true;
  10722. xGame.common.d3World.prePlayEft();
  10723. }
  10724. xGame.common.gameMgr.gameReady();
  10725. this.openAllEvent();
  10726. this.ui.snowNode.visible = false;
  10727. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  10728. this.ui.helpBtn.visible = condition;
  10729. }
  10730. showHelpLineGuide() {
  10731. let longGuide = DataMgr.getGuideHelpLine();
  10732. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  10733. this.ui.helpBtn.visible = true;
  10734. this.ui.guideNode.visible = true;
  10735. }
  10736. }
  10737. setTurnAlpha(alpha) {
  10738. this.ui.keduNode.alpha = alpha;
  10739. this.ui.ganNode.alpha = alpha;
  10740. this.ui.rodMethodNode.alpha = alpha;
  10741. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  10742. }
  10743. cameraViewChange(callback) {
  10744. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  10745. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  10746. xGame.common.showOneCamera("visitAngle");
  10747. cameraSrc.localRotationEulerY = 180;
  10748. cameraSrc.localRotationEulerZ = 0;
  10749. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  10750. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  10751. callback && callback();
  10752. }));
  10753. }));
  10754. }
  10755. playPutBallD3Ani() {
  10756. xGame.common.showOneCamera("mainCamera");
  10757. let handSrc = xGame.common.d3World.d3Hand;
  10758. handSrc.gameObj.active = true;
  10759. handSrc.transform.localPositionZ = 3;
  10760. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10761. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  10762. handSrc.gameObj.active = false;
  10763. this.enterGame();
  10764. }), 400);
  10765. }));
  10766. }
  10767. updateHead() {
  10768. let user = Moyu.getUserInfo();
  10769. this.ui.topNode.selfNameTxt.text = user.nickName;
  10770. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  10771. let aiData = xGame.cfgMgr.getRandomUserInfo();
  10772. if (DataMgr.getSkillGuide() < 1) {
  10773. this.ui.topNode.aiNameTxt.text = 'billiards';
  10774. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  10775. }
  10776. else {
  10777. this.ui.topNode.aiNameTxt.text = aiData.name;
  10778. let randNo = Math.floor(Math.random() * 10) + 1;
  10779. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  10780. }
  10781. }
  10782. initD2world() {
  10783. let node = this.ui.d2Root.displayObject;
  10784. let src = node.getComponent(D2World);
  10785. if (!src) {
  10786. xGame.common.d2World = node.addComponent(D2World);
  10787. }
  10788. xGame.common.d2World.initSelf();
  10789. }
  10790. initD3world() {
  10791. if (this.isD3Inited)
  10792. return;
  10793. this.isD3Inited = true;
  10794. let scene3D = xGame.common.d3Scene;
  10795. this.ui.d3Root.displayObject.addChild(scene3D);
  10796. scene3D.active = true;
  10797. xGame.common.d3World.tableSrc.setBorderPos();
  10798. }
  10799. onRootMove(e) {
  10800. let rootBall = xGame.common.d2World.rootBall;
  10801. this.ui.moveNode.x = e.x;
  10802. this.ui.moveNode.y = e.y;
  10803. rootBall.gameObj.x = e.x;
  10804. rootBall.gameObj.y = e.y;
  10805. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  10806. }
  10807. aiRootMove(move) {
  10808. if (move)
  10809. this.hideBallUI();
  10810. else {
  10811. this.showBallUI();
  10812. xGame.common.d2World.getHelpLine();
  10813. }
  10814. }
  10815. aiForce(type, force = 0) {
  10816. this.pressTarget = PressType.powerNode;
  10817. if (type == 1)
  10818. this.onEventUp({ force: true });
  10819. else if (type == 2)
  10820. this.onEventMove({ stageY: force, force: true });
  10821. }
  10822. onEventPress(e) {
  10823. if (e.stopPropagation)
  10824. e.stopPropagation();
  10825. if (!this.isTurnSelf())
  10826. return;
  10827. let target = e.target;
  10828. switch (target) {
  10829. case this.ui.myPowerNode.displayObject:
  10830. this.pressTarget = PressType.powerNode;
  10831. this.barInfo.curY = e.stageY;
  10832. this.updateBarInfo();
  10833. break;
  10834. case this.ui.moveNode.displayObject:
  10835. this.pressTarget = PressType.moveNode;
  10836. this.hideBallUI();
  10837. this.eventObj.curX = this.ui.moveNode.x;
  10838. this.eventObj.curY = this.ui.moveNode.y;
  10839. this.ui.moveNode.finger.visible = false;
  10840. this.eventObj.lastX = e.stageX;
  10841. this.eventObj.lastY = e.stageY;
  10842. break;
  10843. case this.ui.rulerClickNode.displayObject:
  10844. this.pressTarget = PressType.rulerNode;
  10845. this.eventObj.lastY = e.stageY;
  10846. break;
  10847. case this.ui.d2Root.displayObject:
  10848. this.pressTarget = PressType.d2Root;
  10849. this.eventObj.lastX = e.stageX;
  10850. this.eventObj.lastY = e.stageY;
  10851. this.eventObj.starX = e.stageX;
  10852. this.eventObj.starY = e.stageY;
  10853. this.eventObj.curX = 0;
  10854. this.eventObj.curY = 0;
  10855. xGame.common.d2World.d2Gan.setGanLastInfo();
  10856. this.rulerOffset = 0;
  10857. break;
  10858. default:
  10859. break;
  10860. }
  10861. }
  10862. onEventMove(e) {
  10863. if (e.stopPropagation)
  10864. e.stopPropagation();
  10865. if (e && e.force) {
  10866. }
  10867. else {
  10868. if (!this.isTurnSelf())
  10869. return;
  10870. }
  10871. switch (this.pressTarget) {
  10872. case PressType.powerNode:
  10873. this.barInfo.curY = e.stageY;
  10874. this.updateBarInfo();
  10875. this.isMoveRod = true;
  10876. break;
  10877. case PressType.moveNode:
  10878. let rootBall = xGame.common.d2World.rootBall;
  10879. let radius = rootBall.gameObj.width / 2;
  10880. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  10881. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  10882. let border = xGame.common.d2World.borderRect;
  10883. if (curX <= border.x + radius)
  10884. curX = border.x + radius;
  10885. else if (curX >= border.x + border.width - radius)
  10886. curX = border.x + border.width - radius;
  10887. if (curY <= border.y + radius)
  10888. curY = border.y + radius;
  10889. else if (curY >= border.y + border.height - radius)
  10890. curY = border.y + border.height - radius;
  10891. if (xGame.common.gameMgr.isOpenBall) {
  10892. if (curX >= border.x + border.openBallW - radius)
  10893. curX = border.x + border.openBallW - radius;
  10894. }
  10895. this.ui.moveNode.x = curX;
  10896. this.ui.moveNode.y = curY;
  10897. rootBall.gameObj.x = curX;
  10898. rootBall.gameObj.y = curY;
  10899. rootBall.d3BallSrc.setTransPos(curX, curY);
  10900. this.isMoveRod = true;
  10901. break;
  10902. case PressType.rulerNode:
  10903. let yy = e.stageY - this.eventObj.lastY;
  10904. this.eventObj.lastY = e.stageY;
  10905. let ruler1 = this.ui.rulerNode.img1;
  10906. let ruler2 = this.ui.rulerNode.img2;
  10907. ruler1.y += yy;
  10908. ruler2.y += yy;
  10909. this.rulerOffset += yy;
  10910. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  10911. this.rulerOffset = 0;
  10912. xGame.soundMgr.playSound("inch", 1, 10);
  10913. }
  10914. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  10915. let h = ruler1.height;
  10916. this.checkGuide();
  10917. this.isMoveRod = true;
  10918. if (ruler1.y >= h) {
  10919. ruler1.y = -h;
  10920. ruler2.y = 0;
  10921. return;
  10922. }
  10923. else if (ruler1.y <= -h) {
  10924. ruler1.y = h;
  10925. ruler2.y = 0;
  10926. return;
  10927. }
  10928. if (ruler2.y >= h) {
  10929. ruler2.y = -h;
  10930. ruler1.y = 0;
  10931. return;
  10932. }
  10933. else if (ruler2.y <= -h) {
  10934. ruler2.y = h;
  10935. ruler1.y = 0;
  10936. return;
  10937. }
  10938. break;
  10939. case PressType.d2Root:
  10940. this.eventObj.curX = e.stageX;
  10941. this.eventObj.curY = e.stageY;
  10942. let offset = this.checkRodMoveDir();
  10943. xGame.common.d2World.d2Gan.rotateSelf(offset);
  10944. this.eventObj.lastX = e.stageX;
  10945. this.eventObj.lastY = e.stageY;
  10946. break;
  10947. default:
  10948. break;
  10949. }
  10950. }
  10951. onEventUp(e) {
  10952. if (e.stopPropagation)
  10953. e.stopPropagation();
  10954. if (e && e.force) {
  10955. }
  10956. else {
  10957. if (!this.isTurnSelf())
  10958. return;
  10959. }
  10960. switch (this.pressTarget) {
  10961. case PressType.powerNode:
  10962. this.ui.powerNode.value = 0;
  10963. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  10964. this.ui.powerTxt.text = "";
  10965. if (this.powerNum > 0) {
  10966. xGame.eventMgr.event(BALL_SHOOT);
  10967. xGame.common.d2World.shoot(this.powerNum);
  10968. xGame.common.d2World.d2Gan.shoot();
  10969. xGame.common.d2World.d2HelpLine.shoot();
  10970. this.finishGuide();
  10971. this.ui.powerEft.visible = false;
  10972. this.ui.colorNode.visible = false;
  10973. let ganStr = "";
  10974. if (this.powerNum <= 30) {
  10975. ganStr = "gan_30";
  10976. }
  10977. else if (this.powerNum <= 60) {
  10978. ganStr = "gan_50";
  10979. }
  10980. else {
  10981. ganStr = "gan_80";
  10982. }
  10983. xGame.soundMgr.playSound(ganStr);
  10984. }
  10985. break;
  10986. case PressType.moveNode:
  10987. let rootBall = xGame.common.d2World.rootBall;
  10988. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  10989. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  10990. let isIntersect = this.judgeBallIntersect();
  10991. if (isIntersect) {
  10992. this.ui.moveNode.x = lastX;
  10993. this.ui.moveNode.y = lastY;
  10994. rootBall.gameObj.x = lastX;
  10995. rootBall.gameObj.y = lastY;
  10996. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  10997. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  10998. }
  10999. else {
  11000. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  11001. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  11002. }
  11003. this.showBallUI();
  11004. this.ui.moveNode.finger.visible = true;
  11005. xGame.common.d2World.getHelpLine();
  11006. break;
  11007. case PressType.rulerNode:
  11008. break;
  11009. case PressType.d2Root:
  11010. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  11011. if (dis <= 25) {
  11012. this.moveToClickDot(e);
  11013. }
  11014. break;
  11015. default:
  11016. break;
  11017. }
  11018. this.pressTarget = -1;
  11019. }
  11020. checkGuide() {
  11021. let guide = DataMgr.getSkillGuide();
  11022. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  11023. xGame.common.guideStep++;
  11024. xGame.common.gameUI.ui.guide2.visible = false;
  11025. xGame.common.gameUI.ui.guide3.visible = true;
  11026. }
  11027. }
  11028. finishGuide() {
  11029. let guide = DataMgr.getSkillGuide();
  11030. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  11031. xGame.common.guideStep = 10;
  11032. this.closeAllGuide();
  11033. console.log('zh: 新手引导完毕');
  11034. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  11035. }
  11036. }
  11037. closeAllGuide() {
  11038. xGame.common.gameUI.ui.guide1.visible = false;
  11039. xGame.common.gameUI.ui.guide2.visible = false;
  11040. xGame.common.gameUI.ui.guide3.visible = false;
  11041. }
  11042. updateBarInfo() {
  11043. let star = this.ui.powerNode.y;
  11044. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  11045. if (rate >= 1)
  11046. rate = 1;
  11047. if (rate <= 0)
  11048. rate = 0;
  11049. this.powerNum = Math.ceil(rate * 100);
  11050. this.ui.powerNode.value = this.powerNum;
  11051. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  11052. this.ui.colorNode.value = this.powerNum;
  11053. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  11054. this.ui.powerEft.visible = this.powerNum != 0;
  11055. this.ui.colorNode.visible = this.powerNum != 0;
  11056. this.ui.powerTxt.text = this.powerNum + "";
  11057. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  11058. }
  11059. forceCancel() {
  11060. this.ui.powerNode.value = 0;
  11061. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11062. this.ui.powerTxt.text = "";
  11063. }
  11064. checkRodMoveDir() {
  11065. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  11066. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  11067. if (tempX >= 0 && tempY <= 0) {
  11068. return this.checkDir();
  11069. }
  11070. else if (tempX < 0 && tempY < 0) {
  11071. return this.checkDir(1, -1);
  11072. }
  11073. else if (tempX < 0 && tempY > 0) {
  11074. return this.checkDir(-1, -1);
  11075. }
  11076. else {
  11077. return this.checkDir(-1, 1);
  11078. }
  11079. }
  11080. checkDir(flagX = 1, flagY = 1) {
  11081. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  11082. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  11083. if (offsetY == 0) {
  11084. return offsetX * flagX;
  11085. }
  11086. if (offsetX == 0) {
  11087. return offsetY * flagY;
  11088. }
  11089. let angle = offsetY / offsetX;
  11090. if (Math.abs(angle) >= 1) {
  11091. return offsetY * flagY;
  11092. }
  11093. else {
  11094. return offsetX * flagX;
  11095. }
  11096. }
  11097. judgeBallIntersect() {
  11098. let rootBall = xGame.common.d2World.rootBall;
  11099. let ballArr = xGame.common.d2World.ballArr;
  11100. let radius = rootBall.gameObj.width / 2;
  11101. let temp;
  11102. let isIntersect = false;
  11103. for (let index = 0; index < ballArr.length; index++) {
  11104. temp = ballArr[index];
  11105. if (temp.number == rootBall.number)
  11106. continue;
  11107. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  11108. if (isIntersect) {
  11109. break;
  11110. }
  11111. }
  11112. return isIntersect;
  11113. }
  11114. hideBallUI() {
  11115. let d2Gan = xGame.common.d2World.d2Gan;
  11116. if (!d2Gan.ui.isDisposed)
  11117. d2Gan.ui.visible = false;
  11118. let d2Help = xGame.common.d2World.d2HelpLine;
  11119. if (!d2Help.ui.isDisposed)
  11120. d2Help.ui.visible = false;
  11121. let rootBall = xGame.common.d2World.rootBall;
  11122. if (!rootBall.destroyed) {
  11123. rootBall.gameObj.active = false;
  11124. }
  11125. }
  11126. showBallUI() {
  11127. let d2Gan = xGame.common.d2World.d2Gan;
  11128. if (!d2Gan.ui.isDisposed)
  11129. d2Gan.ui.visible = true;
  11130. let d2Help = xGame.common.d2World.d2HelpLine;
  11131. if (!d2Help.ui.isDisposed)
  11132. d2Help.ui.visible = true;
  11133. let rootBall = xGame.common.d2World.rootBall;
  11134. if (!rootBall.destroyed) {
  11135. rootBall.gameObj.active = true;
  11136. }
  11137. }
  11138. moveToClickDot(e) {
  11139. if (!this.isMoveRod && !xGame.common.clickedBall) {
  11140. let root = xGame.common.d2World.rootBall.gameObj;
  11141. let xx = e.stageX - xGame.common.sysOffestNum;
  11142. let yy = e.stageY;
  11143. let x = xx - root.x;
  11144. let y = yy - root.y;
  11145. let angle = xGame.common.getfguiRotation(x, y);
  11146. xGame.common.d2World.d2Gan.ui.rotation = angle;
  11147. xGame.common.d2World.getHelpLine();
  11148. }
  11149. this.isMoveRod = false;
  11150. xGame.common.clickedBall = false;
  11151. }
  11152. openAllEvent() {
  11153. this.closeAllEvent();
  11154. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11155. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11156. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11157. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11158. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11159. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11160. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11161. }
  11162. closeAllEvent() {
  11163. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11164. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11165. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11166. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11167. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11168. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11169. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11170. }
  11171. resetGame() {
  11172. this.closeAllEvent();
  11173. this.hideBallUI();
  11174. xGame.common.gameMgr.gamePause = true;
  11175. }
  11176. }
  11177. UIGame.uiName = "UIGame";
  11178. class UIAddProp extends UIBase {
  11179. constructor() {
  11180. super();
  11181. this.curType = "";
  11182. }
  11183. onConstructor() {
  11184. this.ui = ui_UIAddProp.createInstance();
  11185. this.contentPane = this.ui;
  11186. this.isEject = false;
  11187. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  11188. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  11189. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  11190. this.updateUI();
  11191. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  11192. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  11193. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  11194. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  11195. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  11196. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  11197. }
  11198. show(type) {
  11199. super.show();
  11200. this.curType = type == 0 ? "coin" : "diamond";
  11201. this.switchBtn("");
  11202. this.ui.t0.play();
  11203. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  11204. PlatMgr.showInsert(true);
  11205. }
  11206. closeSelf() {
  11207. this.hide();
  11208. }
  11209. updateUI() {
  11210. let data = cfgTable.moneyData;
  11211. let temp;
  11212. let obj;
  11213. for (const key in data) {
  11214. temp = data[key];
  11215. obj = this.ui.myNode["node" + key];
  11216. if (parseInt(key) <= 2) {
  11217. obj.diamondTxt.text = "+" + temp.num;
  11218. }
  11219. else {
  11220. obj.coinTxt.text = temp.num;
  11221. obj.diamondTxt.text = temp.get.split('_')[1];
  11222. }
  11223. }
  11224. this.updateDiamondShare();
  11225. }
  11226. updateDiamondShare() {
  11227. let data = DataMgr.getShareDiamondTimes();
  11228. if (data >= xGame.common.maxShareDiamondTimes) {
  11229. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  11230. this.ui.myNode.node1.touchable = false;
  11231. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11232. }
  11233. else {
  11234. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  11235. this.ui.myNode.node1.touchable = true;
  11236. }
  11237. }
  11238. switchBtn(type) {
  11239. if (type == "")
  11240. type = this.curType;
  11241. else {
  11242. if (this.curType == type) {
  11243. return;
  11244. }
  11245. else {
  11246. this.curType = type;
  11247. }
  11248. }
  11249. if (type == "coin") {
  11250. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  11251. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  11252. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  11253. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  11254. this.ui.myNode.c1.selectedIndex = 0;
  11255. }
  11256. else {
  11257. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  11258. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  11259. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  11260. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  11261. this.ui.myNode.c1.selectedIndex = 1;
  11262. }
  11263. }
  11264. convertCoin(index) {
  11265. let data = cfgTable.moneyData[index];
  11266. let coinNum = data.num;
  11267. let str = data.get.split('_')[1];
  11268. let needDiamond = parseInt(str);
  11269. if (DataMgr.diamondEnough(needDiamond)) {
  11270. DataMgr.setDiamond(-needDiamond);
  11271. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  11272. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  11273. }
  11274. else {
  11275. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  11276. this.switchBtn("diamond");
  11277. }
  11278. }
  11279. videoGetDiamond() {
  11280. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  11281. if (Laya.Browser.onAndroid) {
  11282. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11283. if (!boo) {
  11284. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11285. return;
  11286. }
  11287. }
  11288. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  11289. }
  11290. else {
  11291. console.log('zh:AD 失败,直接发放奖励');
  11292. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  11293. }
  11294. }
  11295. qjff_AD_for_uiAddProp_videoGetDiamond() {
  11296. let num = cfgTable.moneyData[2].num;
  11297. xGame.common.playObjFlyAnim(num, Prop.diamond);
  11298. this.closeSelf();
  11299. }
  11300. videoGetCoin() {
  11301. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  11302. if (Laya.Browser.onAndroid) {
  11303. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11304. if (!boo) {
  11305. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11306. return;
  11307. }
  11308. }
  11309. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  11310. }
  11311. else {
  11312. console.log('zh:AD 失败,直接发放奖励');
  11313. this.qjff_AD_for_uiAddProp_videoGetCoin();
  11314. }
  11315. }
  11316. qjff_AD_for_uiAddProp_videoGetCoin() {
  11317. xGame.common.playObjFlyAnim(2000, Prop.coin);
  11318. this.closeSelf();
  11319. }
  11320. shareGetDiamond() {
  11321. let times = DataMgr.getShareDiamondTimes();
  11322. if (times >= xGame.common.maxShareDiamondTimes) {
  11323. console.log('zh: 233333333333 maxShareDiamondTimes');
  11324. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11325. }
  11326. else {
  11327. console.log('zh:33333333333333ad');
  11328. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  11329. if (Laya.Browser.onAndroid) {
  11330. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11331. if (!boo) {
  11332. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11333. return;
  11334. }
  11335. }
  11336. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  11337. }
  11338. else {
  11339. console.log('zh:AD 失败,直接发放奖励');
  11340. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  11341. }
  11342. }
  11343. }
  11344. qjff_AD_for_uiAddProp_shareGetDiamond() {
  11345. let diamond = xGame.common.randomNum(50, 100);
  11346. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  11347. DataMgr.setShareDiamondTimes(1);
  11348. this.updateDiamondShare();
  11349. }
  11350. openPutBallView() {
  11351. let end = xGame.uiMgr.getUI(UIGameEnd);
  11352. let skill = xGame.uiMgr.getUI(UISkill);
  11353. let level = xGame.uiMgr.getUI(UILevelDisplay);
  11354. let uigame = xGame.uiMgr.getUI(UIGame);
  11355. if (end && !end.isHide) {
  11356. xGame.uiMgr.Hide(UIGameEnd);
  11357. xGame.uiMgr.Show(UIMain);
  11358. }
  11359. if (skill && !skill.isHide)
  11360. xGame.uiMgr.Hide(UISkill);
  11361. if (uigame && !uigame.isHide)
  11362. xGame.uiMgr.Hide(UIGame);
  11363. if (level && !level.isHide) {
  11364. }
  11365. else {
  11366. xGame.uiMgr.Show(UILevelDisplay);
  11367. }
  11368. this.closeSelf();
  11369. }
  11370. }
  11371. UIAddProp.uiName = "UIAddProp";
  11372. class MoneyNode {
  11373. constructor(ui) {
  11374. this.leftTime = 0;
  11375. this.ui = ui;
  11376. this.ui.addCoinBtn.onClick(this, this.addCoin);
  11377. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  11378. this.ui.addPowerBtn.onClick(this, this.addPower);
  11379. this.ui.c1.selectedIndex = 1;
  11380. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  11381. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  11382. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  11383. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  11384. this.coinChange();
  11385. this.diamondChange();
  11386. this.powerChange();
  11387. }
  11388. addPower() {
  11389. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11390. xGame.uiMgr.Show(UIPower);
  11391. }
  11392. powerChange() {
  11393. let powerNum = DataMgr.getPower();
  11394. this.ui.powerTxt.text = powerNum + "";
  11395. }
  11396. checkPowerTime() {
  11397. let cur = new Date().getTime();
  11398. let last = DataMgr.getPowerTime();
  11399. if (last == 0) {
  11400. last = cur;
  11401. DataMgr.setPowerTime(cur);
  11402. }
  11403. let power = DataMgr.getPower();
  11404. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  11405. Laya.timer.clearAll(this);
  11406. if (power >= xGame.common.natureMaxPower) {
  11407. this.ui.powerTimeTxt.text = "";
  11408. DataMgr.setPowerTime(cur);
  11409. return;
  11410. }
  11411. if (power + offset >= xGame.common.natureMaxPower) {
  11412. DataMgr.setPower(xGame.common.natureMaxPower, false);
  11413. this.ui.powerTimeTxt.text = "";
  11414. DataMgr.setPowerTime(cur);
  11415. }
  11416. else {
  11417. if (offset > 0) {
  11418. DataMgr.setPower(offset);
  11419. DataMgr.setPowerTime(cur);
  11420. }
  11421. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  11422. this.leftTime = xGame.common.powerRecoverNum - time;
  11423. if (this.leftTime <= 0)
  11424. this.leftTime = 0;
  11425. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  11426. Laya.timer.loop(1000, this, this.updatePowerTime);
  11427. }
  11428. }
  11429. updatePowerTime() {
  11430. this.leftTime -= 1;
  11431. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  11432. if (this.leftTime <= 0) {
  11433. this.checkPowerTime();
  11434. }
  11435. }
  11436. coinChange() {
  11437. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  11438. }
  11439. diamondChange() {
  11440. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  11441. }
  11442. addCoin() {
  11443. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11444. Moyu.sendDataEvent("AddCoinBtn");
  11445. xGame.uiMgr.Show(UIAddProp, 0);
  11446. }
  11447. addDiamond() {
  11448. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11449. Moyu.sendDataEvent("AddDiamondBtn");
  11450. xGame.uiMgr.Show(UIAddProp, 1);
  11451. }
  11452. }
  11453. class UIDraw extends UIBase {
  11454. constructor() {
  11455. super();
  11456. this.curKey = 0;
  11457. }
  11458. onConstructor() {
  11459. this.ui = ui_UIDraw.createInstance();
  11460. this.contentPane = this.ui;
  11461. this.isEject = false;
  11462. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  11463. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  11464. this.addUIClick(this.ui.drawBtn, this.startDraw);
  11465. this.initDraw();
  11466. this.initUI();
  11467. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  11468. if (Moyu.isKs)
  11469. this.ui.closeNode.closeBtn.x += 100;
  11470. }
  11471. show() {
  11472. super.show();
  11473. this.ui.t0.play();
  11474. this.playSecretaryIdle();
  11475. this.updateDraw();
  11476. this.checkFree();
  11477. if (PlatMgr.bannerDelay > 0) {
  11478. this.ui.closeNode.closeBtn.visible = false;
  11479. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  11480. this.ui.closeNode.closeBtn.visible = true;
  11481. });
  11482. }
  11483. PlatMgr.showRateBanner();
  11484. }
  11485. hide() {
  11486. Laya.timer.clearAll(this);
  11487. super.hide();
  11488. }
  11489. checkFree() {
  11490. let isFree = DataMgr.getDailyfreeDrawTimes();
  11491. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  11492. }
  11493. initDraw() {
  11494. this.drawObj = [];
  11495. let data = cfgTable.drawData;
  11496. let temp;
  11497. let weight = 0;
  11498. for (const key in data) {
  11499. temp = data[key];
  11500. weight += temp.weight;
  11501. this.drawObj.push(weight);
  11502. }
  11503. this.allWeight = weight;
  11504. }
  11505. initUI() {
  11506. let data = cfgTable.drawData;
  11507. let temp;
  11508. let img;
  11509. let txt;
  11510. for (const key in data) {
  11511. temp = data[key];
  11512. img = this.ui.myNode.rotNode["img" + key];
  11513. txt = this.ui.myNode.rotNode["txt" + key];
  11514. img.url = xGame.common.getGameIconUrl(temp.icon);
  11515. txt.visible = true;
  11516. if (temp.award > 2) {
  11517. img.rotation = 0;
  11518. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  11519. }
  11520. else {
  11521. img.rotation = temp.rotation;
  11522. txt.text = temp.num;
  11523. }
  11524. }
  11525. }
  11526. getCurkey() {
  11527. let rand = Math.random() * this.allWeight;
  11528. let temp;
  11529. for (let index = 0; index < this.drawObj.length - 1; index++) {
  11530. temp = this.drawObj[index];
  11531. if (index == 0) {
  11532. if (rand < temp) {
  11533. return index + 1;
  11534. }
  11535. }
  11536. else {
  11537. if (rand >= temp && rand < this.drawObj[index + 1]) {
  11538. return index + 1;
  11539. }
  11540. }
  11541. }
  11542. return 2;
  11543. }
  11544. startDraw() {
  11545. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  11546. if (freeTimes > 0) {
  11547. this.beginDraw();
  11548. DataMgr.setDailyfreeDrawTimes(0);
  11549. this.checkFree();
  11550. }
  11551. else {
  11552. if (Laya.Browser.onAndroid) {
  11553. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11554. if (!boo) {
  11555. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11556. return;
  11557. }
  11558. }
  11559. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  11560. }
  11561. else {
  11562. console.log('zh:AD 失败,直接发放奖励');
  11563. this.qjff_chouJiang();
  11564. }
  11565. }
  11566. }
  11567. qjff_chouJiang() {
  11568. this.beginDraw();
  11569. }
  11570. beginDraw() {
  11571. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  11572. this.ui.drawBtn.touchable = false;
  11573. this.curKey = this.getCurkey();
  11574. console.log("当前key", this.curKey);
  11575. let cell = 60;
  11576. let lap = 3;
  11577. let angle = cell * (this.curKey - 1) + lap * 360;
  11578. let target = this.ui.myNode.rotNode;
  11579. target.rotation = 0;
  11580. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  11581. console.log("旋转完成");
  11582. this.ui.drawBtn.touchable = true;
  11583. this.getAward();
  11584. }));
  11585. }
  11586. getAward() {
  11587. let data = cfgTable.drawData[this.curKey];
  11588. let temp = new AwardType();
  11589. temp.type = data.award;
  11590. temp.num = data.num;
  11591. xGame.common.getAward([temp], () => {
  11592. DataMgr.setDrawTimes(1);
  11593. this.updateDraw();
  11594. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  11595. });
  11596. }
  11597. updateDraw() {
  11598. let drawTimes = DataMgr.getDrawTimes();
  11599. let awardTimes = DataMgr.getDrawAwardTimes();
  11600. if (Math.floor(drawTimes / 3) > awardTimes) {
  11601. this.ui.extraNode.boxBtn.t0.play(null, -1);
  11602. this.ui.extraNode.boxBtn.touchable = true;
  11603. this.ui.extraNode.tipsTxt.text = "3/3";
  11604. this.ui.extraNode.barNode.width = 265;
  11605. this.getExtraAward();
  11606. }
  11607. else {
  11608. this.ui.extraNode.boxBtn.t0.stop();
  11609. this.ui.extraNode.boxBtn.touchable = false;
  11610. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  11611. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  11612. }
  11613. let data = cfgTable.drawData[1];
  11614. if (awardTimes == 0) {
  11615. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  11616. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  11617. this.ui.myNode.rotNode.img1.rotation = 0;
  11618. }
  11619. else {
  11620. let award = data.nextid;
  11621. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  11622. this.ui.myNode.rotNode.txt1.text = award[1];
  11623. this.ui.myNode.rotNode.img1.rotation = 0;
  11624. }
  11625. }
  11626. getExtraAward() {
  11627. let drawTimes = DataMgr.getDrawTimes();
  11628. let awardTimes = DataMgr.getDrawAwardTimes();
  11629. let data = cfgTable.drawData[1];
  11630. let award = new AwardType();
  11631. if (awardTimes == 0) {
  11632. award.num = data.num;
  11633. award.type = data.award;
  11634. xGame.common.getAward([award], () => {
  11635. let all = Math.floor(drawTimes / 3);
  11636. DataMgr.setDrawAwardTimes(all);
  11637. this.updateDraw();
  11638. });
  11639. }
  11640. else {
  11641. award.num = parseInt(data.nextid[1]);
  11642. award.type = parseInt(data.nextid[0]);
  11643. xGame.common.getAward([award], () => {
  11644. let all = Math.floor(drawTimes / 3);
  11645. DataMgr.setDrawAwardTimes(all);
  11646. this.updateDraw();
  11647. });
  11648. }
  11649. }
  11650. closeSelf() {
  11651. this.hide();
  11652. }
  11653. playSecretaryIdle() {
  11654. let parent = this.ui.secretary.displayObject;
  11655. parent.destroyChildren();
  11656. let xx = this.ui.secretary.width / 2;
  11657. let yy = this.ui.secretary.height;
  11658. let scale = xGame.common.getSecretaryScale();
  11659. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  11660. xGame.common.secretary.play(data, 0, true, parent);
  11661. }
  11662. }
  11663. UIDraw.uiName = "UIDraw";
  11664. class ui_UIFlyEft extends fgui.GComponent {
  11665. static createInstance() {
  11666. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  11667. }
  11668. onConstruct() {
  11669. this.n0 = (this.getChild("n0"));
  11670. this.n1 = (this.getChild("n1"));
  11671. this.n2 = (this.getChild("n2"));
  11672. this.n3 = (this.getChild("n3"));
  11673. this.n4 = (this.getChild("n4"));
  11674. this.n5 = (this.getChild("n5"));
  11675. this.n6 = (this.getChild("n6"));
  11676. this.n7 = (this.getChild("n7"));
  11677. this.iconNode = (this.getChild("iconNode"));
  11678. this.txt = (this.getChild("txt"));
  11679. this.txtNode = (this.getChild("txtNode"));
  11680. }
  11681. }
  11682. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  11683. class UIFlyEft extends UIBase {
  11684. constructor() {
  11685. super();
  11686. this.max = 8;
  11687. this.delay = 0;
  11688. }
  11689. onConstructor() {
  11690. this.ui = ui_UIFlyEft.createInstance();
  11691. this.contentPane = this.ui;
  11692. this.isEject = false;
  11693. this.isMuti = true;
  11694. this.ui.x += xGame.common.sysOffestNum;
  11695. }
  11696. getArrPos() {
  11697. if (this.iconPos && this.iconPos.length > 0)
  11698. return;
  11699. this.iconPos = [];
  11700. let temp;
  11701. for (let index = 0; index < this.max; index++) {
  11702. temp = this.ui["n" + index];
  11703. this.iconPos.push([temp.x, temp.y]);
  11704. }
  11705. }
  11706. show(stPos, edPos, num, type, callback) {
  11707. super.show();
  11708. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  11709. this.getArrPos();
  11710. this.updateUI(type);
  11711. this.updatePos();
  11712. this.runFly(edPos, callback);
  11713. this.runWorlds(stPos, num);
  11714. }
  11715. updateUI(type) {
  11716. let temp;
  11717. let str;
  11718. for (let index = 0; index < this.max; index++) {
  11719. temp = this.ui["n" + index];
  11720. str = this.getIconStr(type);
  11721. temp.url = xGame.common.getGameIconUrl(str);
  11722. }
  11723. }
  11724. getIconStr(type) {
  11725. switch (type) {
  11726. case Prop.diamond:
  11727. return "ty_zs";
  11728. case Prop.coin:
  11729. return "ty_jb";
  11730. default:
  11731. break;
  11732. }
  11733. }
  11734. updatePos() {
  11735. let temp;
  11736. for (let index = 0; index < this.max; index++) {
  11737. temp = this.ui["n" + index];
  11738. temp.x = this.iconPos[index][0];
  11739. temp.y = this.iconPos[index][1];
  11740. }
  11741. }
  11742. runFly(endPos, callback) {
  11743. let all = 0;
  11744. let temp;
  11745. for (let index = 0; index < this.max; index++) {
  11746. temp = this.ui["n" + index];
  11747. temp.visible = true;
  11748. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  11749. temp.visible = false;
  11750. all++;
  11751. if (all >= this.max) {
  11752. callback && callback();
  11753. }
  11754. }), 20 * index);
  11755. }
  11756. }
  11757. runWorlds(stPos, num) {
  11758. let str = "+" + num;
  11759. this.ui.txt.text = str;
  11760. let starX = stPos.x;
  11761. let starY = stPos.y + 50;
  11762. this.ui.txt.x = starX;
  11763. this.ui.txt.y = starY;
  11764. this.ui.txt.visible = true;
  11765. this.ui.txt.alpha = 1;
  11766. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  11767. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  11768. this.ui.txt.visible = false;
  11769. this.hide();
  11770. }));
  11771. }));
  11772. }
  11773. }
  11774. UIFlyEft.uiName = "UIFlyEft";
  11775. class Common {
  11776. constructor() {
  11777. this.convertNum = 0.025;
  11778. this.VectorUp = new Laya.Vector3(0, 1, 0);
  11779. this.scaleV3One = new Laya.Vector3();
  11780. this.scaleV3Two = new Laya.Vector3();
  11781. this.posV4 = new Laya.Vector4();
  11782. this.showDebug = false;
  11783. this.openGuide = true;
  11784. this.rodOffest = new Laya.Vector2(0, 0);
  11785. this.rodAngle = 0;
  11786. this.gameMode = GameMode.classic;
  11787. this.bigMoveLevelIndex = 1;
  11788. this.bigMoveNeedCoin = 1000;
  11789. this.classicNiceNeddCoin = 1000;
  11790. this.passAwardCoin = 2000;
  11791. this.classicRoomType = 1;
  11792. this.maxPower = 20;
  11793. this.natureMaxPower = 5;
  11794. this.videoPower = 2;
  11795. this.powerRecoverNum = 900;
  11796. this.curPlayerSkillType = 0;
  11797. this.isNewDay = false;
  11798. this.clickedBall = false;
  11799. this.placeBallCurLevel = 0;
  11800. this.placeBallStarNum = 0;
  11801. this.longHelpLine = false;
  11802. this.maxShareDiamondTimes = 3;
  11803. this.guideStep = 0;
  11804. this.temSelfLevel = 0;
  11805. this.extraMoveNum = 0;
  11806. this.curRankID = 0;
  11807. this.rankID = {
  11808. normalStar: 12000,
  11809. wxStar: 12001
  11810. };
  11811. this.skillNameList = ["Surging Break", "Skyfall Shot", "Frost Lock"];
  11812. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  11813. this.btnClickStr = "buttonclick";
  11814. this.maxSkillLevel = 10;
  11815. this.upSkillLevel = false;
  11816. this.gameStartTime = 0;
  11817. this._sysOffestNum = 0;
  11818. this.angleV2 = new Laya.Vector2();
  11819. this.rootV = new Laya.Vector2(0, 1);
  11820. this.tempDir1 = new Laya.Vector2();
  11821. this.tempDir2 = new Laya.Vector2();
  11822. this.ballSize = 33;
  11823. this.stPos = new Laya.Point();
  11824. this.edPos = new Laya.Point();
  11825. Common._instance = this;
  11826. window["common"] = this;
  11827. }
  11828. static getInstance() {
  11829. if (!this._instance) {
  11830. this._instance = new Common();
  11831. }
  11832. return this._instance;
  11833. }
  11834. get sysOffestNum() {
  11835. if (this._sysOffestNum == 0) {
  11836. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  11837. }
  11838. return this._sysOffestNum;
  11839. }
  11840. testShader() {
  11841. let test = new LightShader();
  11842. test.texture = "res/d3Res/ballTexture/ball1.png";
  11843. Laya.stage.addChild(test);
  11844. }
  11845. playScale(node) {
  11846. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  11847. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  11848. }));
  11849. }));
  11850. }
  11851. setGroup(colli, ...group) {
  11852. let out = 0;
  11853. for (let index = 0; index < group.length; index++) {
  11854. if (index == 0) {
  11855. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11856. }
  11857. else {
  11858. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11859. }
  11860. }
  11861. colli.collisionGroup = out;
  11862. }
  11863. setCanGroupWith(colli, ...group) {
  11864. let out = 0;
  11865. for (let index = 0; index < group.length; index++) {
  11866. if (index == 0) {
  11867. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11868. }
  11869. else {
  11870. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11871. }
  11872. }
  11873. colli.canCollideWith = out;
  11874. }
  11875. loadPrefab(name, callback) {
  11876. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  11877. let prefab = new Laya.Prefab();
  11878. prefab.json = obj;
  11879. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  11880. callback && callback(img);
  11881. }));
  11882. }
  11883. pos2to3Convert(x, y, d3Pos) {
  11884. x = x + this.sysOffestNum;
  11885. d3Pos.setValue(x, y, 0);
  11886. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  11887. if (success) {
  11888. }
  11889. else {
  11890. console.error("转换出错了。。。。。。。。");
  11891. }
  11892. }
  11893. scale2to3Convert(num) {
  11894. this.scaleV3One.setValue(0, 0, 0);
  11895. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  11896. this.scaleV3Two.setValue(0, num, 0);
  11897. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  11898. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  11899. return outNum;
  11900. }
  11901. pos3to2Convert(d3Pos) {
  11902. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  11903. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  11904. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  11905. d3Pos.x -= this.sysOffestNum;
  11906. }
  11907. scale3to2Convert(num) {
  11908. let scale = this.scale2to3Convert(1);
  11909. let d2Out = num / scale;
  11910. return d2Out;
  11911. }
  11912. getCollider(type, restitution = 0.9, density = 10) {
  11913. let colli;
  11914. if (type == "box")
  11915. colli = new Laya.BoxCollider();
  11916. else
  11917. colli = new Laya.CircleCollider();
  11918. colli.friction = 0;
  11919. colli.restitution = restitution;
  11920. colli.density = density;
  11921. return colli;
  11922. }
  11923. getRigbody() {
  11924. let rigy = new Laya.RigidBody();
  11925. rigy.bullet = true;
  11926. rigy.allowRotation = false;
  11927. rigy.allowSleep = false;
  11928. rigy.gravityScale = 0;
  11929. return rigy;
  11930. }
  11931. getfguiRotation(x, y) {
  11932. this.angleV2.setValue(x, y);
  11933. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  11934. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  11935. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  11936. angle = -angle;
  11937. }
  11938. return 180 + angle;
  11939. }
  11940. getAngle(x, y) {
  11941. this.angleV2.setValue(x, y);
  11942. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  11943. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  11944. return angle;
  11945. }
  11946. randomNum(a, b) {
  11947. return a + Math.floor((b - a + 1) * Math.random());
  11948. }
  11949. getRandArrEle(arr) {
  11950. return arr[Math.floor(arr.length * Math.random())];
  11951. }
  11952. getSign(val) {
  11953. return val >= 0 ? 1 : -1;
  11954. }
  11955. botherArr(arr) {
  11956. let times = arr.length + 2;
  11957. let length = arr.length;
  11958. let a;
  11959. let b;
  11960. let temp;
  11961. for (let index = 0; index < times; index++) {
  11962. a = Math.floor(Math.random() * length);
  11963. b = Math.floor(Math.random() * length);
  11964. temp = arr[a];
  11965. arr[a] = arr[b];
  11966. arr[b] = temp;
  11967. }
  11968. }
  11969. getGameIconUrl(id) {
  11970. return "ui://game/" + id;
  11971. }
  11972. getComponentUrl(id) {
  11973. return "ui://game/" + id;
  11974. }
  11975. getAnimation() {
  11976. }
  11977. judgeSkillType(type = SkillType.highSpace) {
  11978. if (this.gameMode == GameMode.classic)
  11979. return;
  11980. let gameMgr = this.gameMgr;
  11981. if (gameMgr.selfTurn) {
  11982. if (gameMgr.selfCurSkill == type) {
  11983. return true;
  11984. }
  11985. }
  11986. else {
  11987. if (gameMgr.aiCurSkill == type) {
  11988. return true;
  11989. }
  11990. }
  11991. }
  11992. ballColliHole(collider) {
  11993. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  11994. xGame.common.gameMgr.isFirstInGame = false;
  11995. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  11996. }
  11997. collider.owner.mySrc.checkWrongBall();
  11998. }
  11999. getArrMaxEle(arr) {
  12000. let max = -Infinity;
  12001. for (let index = 0; index < arr.length; index++) {
  12002. max = Math.max(arr[index], max);
  12003. }
  12004. return max;
  12005. }
  12006. getArrMinEle(arr) {
  12007. let min = Infinity;
  12008. for (let index = 0; index < arr.length; index++) {
  12009. min = Math.min(arr[index], min);
  12010. }
  12011. return min;
  12012. }
  12013. playRandomMutiBallBigSkillSound() {
  12014. if (Math.random() <= 0.5)
  12015. return;
  12016. let rand = this.randomNum(1, 6);
  12017. let str = "ganfa0" + rand;
  12018. xGame.soundMgr.playSound(str);
  12019. }
  12020. showOneCamera(type) {
  12021. let object = xGame.common.d3World.cameraObj;
  12022. for (const key in object) {
  12023. if (Object.prototype.hasOwnProperty.call(object, key)) {
  12024. object[key].init();
  12025. object[key].owner.active = key == type;
  12026. }
  12027. }
  12028. }
  12029. checkBallOverBorder(x, y) {
  12030. let radius = 17;
  12031. let condition = this._checkBorder(x + radius, y) ||
  12032. this._checkBorder(x - radius, y) ||
  12033. this._checkBorder(x, y + radius) ||
  12034. this._checkBorder(x, y - radius);
  12035. if (condition) {
  12036. return true;
  12037. }
  12038. }
  12039. _checkBorder(x, y) {
  12040. let borderRect = this.d2World.borderRect;
  12041. let xOffest = 20;
  12042. let yOffest = 20;
  12043. if (y <= borderRect.y - yOffest) {
  12044. return true;
  12045. }
  12046. if (y >= borderRect.y + borderRect.height + yOffest) {
  12047. return true;
  12048. }
  12049. if (x <= borderRect.x - xOffest) {
  12050. return true;
  12051. }
  12052. if (x >= borderRect.x + borderRect.width + xOffest) {
  12053. return true;
  12054. }
  12055. }
  12056. initWeight(cfg) {
  12057. let allCfgData = { data: {}, allWeightNum: 0 };
  12058. let weightCfg = allCfgData.data;
  12059. let weight = 0;
  12060. for (const key in cfg) {
  12061. weightCfg[key] = {};
  12062. weightCfg[key].id = cfg[key].id;
  12063. weightCfg[key].minWeight = weight;
  12064. weight += cfg[key].weight;
  12065. weightCfg[key].maxWeight = weight;
  12066. }
  12067. allCfgData.allWeightNum = weight;
  12068. return allCfgData;
  12069. }
  12070. getRandomWeightData(cfg) {
  12071. let weightCfg = cfg.data;
  12072. let allWeightNum = cfg.allWeightNum;
  12073. let rand = Math.floor(Math.random() * allWeightNum);
  12074. for (const key in weightCfg) {
  12075. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  12076. return weightCfg[key];
  12077. }
  12078. }
  12079. return weightCfg[1];
  12080. }
  12081. showGirlTalkPop(wordsIndex, node, msgNode) {
  12082. node.visible = true;
  12083. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  12084. node.t0.play(Laya.Handler.create(this, () => {
  12085. node.visible = false;
  12086. }));
  12087. }
  12088. stopGirlPop(node) {
  12089. node.t0.stop();
  12090. node.visible = false;
  12091. }
  12092. createHead(loader, url, size = 107) {
  12093. if (Laya.Browser.name == "Browser") {
  12094. loader.url = url;
  12095. return;
  12096. }
  12097. else {
  12098. console.log('zh:url=', url);
  12099. loader.url = url;
  12100. }
  12101. }
  12102. addTestCoin(num) {
  12103. DataMgr.setCoin(num);
  12104. }
  12105. addTestDiamond(num) {
  12106. DataMgr.setDiamond(num);
  12107. }
  12108. addTestSkill() {
  12109. DataMgr.setBigSkill(0, 99);
  12110. DataMgr.setBigSkill(1, 99);
  12111. DataMgr.setBigSkill(2, 99);
  12112. }
  12113. playClassicEmotion(number, x, y) {
  12114. if (this.gameMode == GameMode.bigMove)
  12115. return;
  12116. let randIndex = this.randomNum(0, 2);
  12117. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12118. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12119. if (this.gameMgr.selfTurn) {
  12120. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12121. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12122. }
  12123. else {
  12124. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12125. }
  12126. else {
  12127. if (number == this.gameMgr.blackNum) {
  12128. if (this.gameMgr.selfBallArr.length == 0) {
  12129. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12130. }
  12131. else {
  12132. }
  12133. }
  12134. else {
  12135. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12136. }
  12137. }
  12138. }
  12139. }
  12140. else {
  12141. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12142. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12143. }
  12144. else {
  12145. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12146. }
  12147. else {
  12148. if (number == this.gameMgr.blackNum) {
  12149. if (this.gameMgr.aiBallArr.length == 0) {
  12150. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12151. }
  12152. else {
  12153. }
  12154. }
  12155. else {
  12156. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12157. }
  12158. }
  12159. }
  12160. }
  12161. }
  12162. playHappySound(number) {
  12163. if (this.gameMode != GameMode.classic)
  12164. return;
  12165. if (number == 8)
  12166. return;
  12167. let play = false;
  12168. if (this.gameMgr.selfTurn) {
  12169. if (this.gameMgr.ensureBallType) {
  12170. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12171. play = true;
  12172. }
  12173. }
  12174. else {
  12175. play = true;
  12176. }
  12177. }
  12178. else {
  12179. if (this.gameMgr.ensureBallType) {
  12180. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12181. play = true;
  12182. }
  12183. }
  12184. else {
  12185. play = true;
  12186. }
  12187. }
  12188. if (play)
  12189. xGame.soundMgr.playSound("applause");
  12190. }
  12191. destroyClassicEmotion() {
  12192. if (this.gameMode == GameMode.bigMove)
  12193. return;
  12194. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12195. parent.destroyChildren();
  12196. }
  12197. playAwardSpine(x, y) {
  12198. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12199. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12200. this.awardSpine.play(data, 0, false, parent);
  12201. }
  12202. destroyAwardSpine() {
  12203. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12204. parent.destroyChildren();
  12205. }
  12206. isBlock(bx, by, hx, hy, except = null) {
  12207. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  12208. let balls = xGame.common.d2World.ballArr;
  12209. let outArr = [];
  12210. for (let index = 0; index < balls.length; index++) {
  12211. let obj = balls[index];
  12212. if (obj.number == 0)
  12213. continue;
  12214. if (obj == except)
  12215. continue;
  12216. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  12217. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  12218. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  12219. if (num >= 1)
  12220. num = 1;
  12221. if (num < 0)
  12222. continue;
  12223. let gap = Math.sin(Math.acos(num)) * dis;
  12224. if (gap < this.ballSize) {
  12225. outArr.push({
  12226. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  12227. disHon: Math.cos(Math.acos(num)) * dis,
  12228. disVer: Math.sin(Math.acos(num)) * dis,
  12229. src: balls[index],
  12230. dir: this.tempDir1
  12231. });
  12232. }
  12233. }
  12234. if (outArr.length > 0) {
  12235. outArr.sort((a, b) => { return a.dis - b.dis; });
  12236. return outArr[0];
  12237. }
  12238. }
  12239. AngleBetween(vector1, vector2) {
  12240. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  12241. return rad * (180 / Math.PI);
  12242. }
  12243. getSecretaryScale() {
  12244. if (this.secretary.spineName == "mishu") {
  12245. return 1.28;
  12246. }
  12247. else {
  12248. return 1.024;
  12249. }
  12250. }
  12251. signAwardContainsRod(arr) {
  12252. let temp;
  12253. for (let index = 0; index < arr.length; index++) {
  12254. temp = arr[index].split('-')[0];
  12255. if (parseInt(temp) > 2) {
  12256. return true;
  12257. }
  12258. }
  12259. }
  12260. judgeSameDay() {
  12261. let lastTime = DataMgr.getSignTime();
  12262. let curTime = new Date().getTime();
  12263. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  12264. return true;
  12265. }
  12266. return false;
  12267. }
  12268. getAward(arr, callback) {
  12269. let showTriple = arr[0].type <= 2;
  12270. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  12271. let temp;
  12272. for (let index = 0; index < arr.length; index++) {
  12273. temp = arr[index];
  12274. switch (temp.type) {
  12275. case 1:
  12276. this.playObjFlyAnim(temp.num, temp.type);
  12277. break;
  12278. case 2:
  12279. this.playObjFlyAnim(temp.num, temp.type);
  12280. break;
  12281. case 3:
  12282. case 4:
  12283. case 5:
  12284. case 6:
  12285. DataMgr.setBallRod(temp.type - 2, 1);
  12286. DataMgr.setCurBallRod(temp.type - 2);
  12287. break;
  12288. default:
  12289. break;
  12290. }
  12291. }
  12292. callback && callback(watchVideo);
  12293. });
  12294. }
  12295. getMoneyNode() {
  12296. let moneyNode;
  12297. let sign = xGame.uiMgr.getUI(UISign);
  12298. let draw = xGame.uiMgr.getUI(UIDraw);
  12299. let end = xGame.uiMgr.getUI(UIGameEnd);
  12300. let skill = xGame.uiMgr.getUI(UISkill);
  12301. if (sign && !sign.isHide)
  12302. moneyNode = sign.ui.moneyNode;
  12303. if (draw && !draw.isHide)
  12304. moneyNode = draw.ui.moneyNode;
  12305. if (end && !end.isHide)
  12306. moneyNode = end.ui.moneyNode;
  12307. if (skill && !skill.isHide)
  12308. moneyNode = skill.ui.moneyNode;
  12309. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  12310. let main = xGame.uiMgr.getUI(UIMain);
  12311. if (condition1 && main && !main.isHide) {
  12312. moneyNode = main.ui.moneyNode;
  12313. }
  12314. return moneyNode;
  12315. }
  12316. playObjFlyAnim(num, type, callback = null) {
  12317. this.stPos.x = Laya.stage.width / 2;
  12318. this.stPos.y = Laya.stage.height / 2;
  12319. let moneyNode = this.getMoneyNode();
  12320. switch (type) {
  12321. case Prop.diamond:
  12322. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  12323. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  12324. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  12325. this.edPos.x /= 2;
  12326. this.edPos.y /= 2;
  12327. break;
  12328. case Prop.coin:
  12329. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  12330. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  12331. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  12332. this.edPos.x /= 2;
  12333. this.edPos.y /= 2;
  12334. break;
  12335. default:
  12336. break;
  12337. }
  12338. xGame.soundMgr.playSound("coinbag");
  12339. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  12340. switch (type) {
  12341. case Prop.diamond:
  12342. DataMgr.setDiamond(num);
  12343. break;
  12344. case Prop.coin:
  12345. DataMgr.setCoin(num);
  12346. break;
  12347. default:
  12348. break;
  12349. }
  12350. callback && callback();
  12351. });
  12352. }
  12353. autoPopUIView() {
  12354. let arr = [];
  12355. let sign = this.judgeSameDay() ? false : true;
  12356. if (sign)
  12357. arr.push("sign");
  12358. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  12359. if (draw)
  12360. arr.push("draw");
  12361. if (arr.length <= 0)
  12362. return;
  12363. let str = this.getRandArrEle(arr);
  12364. switch (str) {
  12365. case "sign":
  12366. xGame.uiMgr.Show(UISign);
  12367. break;
  12368. case "draw":
  12369. xGame.uiMgr.Show(UIDraw);
  12370. break;
  12371. default:
  12372. break;
  12373. }
  12374. }
  12375. getMSTime(time) {
  12376. let min = Math.floor(time / 60);
  12377. let sec = Math.floor((time - min * 60));
  12378. if (sec < 10)
  12379. sec = "0" + sec;
  12380. if (min < 10)
  12381. min = "0" + min;
  12382. return `${min}:${sec}`;
  12383. }
  12384. testPower() {
  12385. DataMgr.setPower(0, false);
  12386. }
  12387. getAllStarNum() {
  12388. let data = DataMgr.getPlaceBallLevelList();
  12389. let out = 0;
  12390. for (let index = 0; index < data.length; index++) {
  12391. out += data[index].star;
  12392. }
  12393. return out;
  12394. }
  12395. recoverCameraView() {
  12396. Laya.timer.once(900, this, () => {
  12397. xGame.common.showOneCamera("mainCamera");
  12398. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  12399. xGame.common.gameUI.ui.d2Node.alpha = 1;
  12400. xGame.common.gameUI.ui.border.alpha = 0;
  12401. if (Laya.physicsTimer.scale < 1) {
  12402. Laya.physicsTimer.scale = 1;
  12403. }
  12404. }
  12405. });
  12406. }
  12407. getClassicLevel() {
  12408. let successTimes = DataMgr.getClassicTimes();
  12409. let needKey = "";
  12410. let lastKey = "";
  12411. let cfg = cfgTable.classictimesData;
  12412. let data;
  12413. for (const key in cfg) {
  12414. data = cfg[key];
  12415. if (successTimes <= data.times) {
  12416. needKey = key;
  12417. }
  12418. lastKey = key;
  12419. }
  12420. if (needKey == "")
  12421. needKey = lastKey;
  12422. return cfg[needKey];
  12423. }
  12424. }
  12425. Common._instance = null;
  12426. class ui_Component92 extends fgui.GComponent {
  12427. static createInstance() {
  12428. return (fgui.UIPackage.createObject("game", "Component92"));
  12429. }
  12430. onConstruct() {
  12431. this.n0 = (this.getChild("n0"));
  12432. }
  12433. }
  12434. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  12435. class ui_Component129 extends fgui.GProgressBar {
  12436. static createInstance() {
  12437. return (fgui.UIPackage.createObject("game", "Component129"));
  12438. }
  12439. onConstruct() {
  12440. this.bar_v = (this.getChild("bar_v"));
  12441. this.n84 = (this.getChild("n84"));
  12442. }
  12443. }
  12444. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  12445. class ui_Component130 extends fgui.GComponent {
  12446. static createInstance() {
  12447. return (fgui.UIPackage.createObject("game", "Component130"));
  12448. }
  12449. onConstruct() {
  12450. this.ani = (this.getChild("ani"));
  12451. this.t0 = this.getTransition("t0");
  12452. }
  12453. }
  12454. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  12455. class ui_powerEft extends fgui.GComponent {
  12456. static createInstance() {
  12457. return (fgui.UIPackage.createObject("game", "powerEft"));
  12458. }
  12459. onConstruct() {
  12460. this.ani = (this.getChild("ani"));
  12461. this.n88 = (this.getChild("n88"));
  12462. this.n89 = (this.getChild("n89"));
  12463. }
  12464. }
  12465. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  12466. class ui_PutBallLevelDisplay extends fgui.GComponent {
  12467. static createInstance() {
  12468. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  12469. }
  12470. onConstruct() {
  12471. this.c1 = this.getController("c1");
  12472. this.n2 = (this.getChild("n2"));
  12473. this.n22 = (this.getChild("n22"));
  12474. this.n23 = (this.getChild("n23"));
  12475. this.n15 = (this.getChild("n15"));
  12476. this.challenge = (this.getChild("challenge"));
  12477. this.n17 = (this.getChild("n17"));
  12478. this.n3 = (this.getChild("n3"));
  12479. this.starNode = (this.getChild("starNode"));
  12480. this.levelTxt = (this.getChild("levelTxt"));
  12481. this.n14 = (this.getChild("n14"));
  12482. this.n19 = (this.getChild("n19"));
  12483. this.n20 = (this.getChild("n20"));
  12484. this.n21 = (this.getChild("n21"));
  12485. this.special = (this.getChild("special"));
  12486. }
  12487. }
  12488. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  12489. class ui_Component79 extends fgui.GComponent {
  12490. static createInstance() {
  12491. return (fgui.UIPackage.createObject("game", "Component79"));
  12492. }
  12493. onConstruct() {
  12494. this.c1 = this.getController("c1");
  12495. this.n7 = (this.getChild("n7"));
  12496. this.n8 = (this.getChild("n8"));
  12497. this.n9 = (this.getChild("n9"));
  12498. this.n10 = (this.getChild("n10"));
  12499. this.n11 = (this.getChild("n11"));
  12500. this.n12 = (this.getChild("n12"));
  12501. }
  12502. }
  12503. ui_Component79.URL = "ui://isxx5ak7avag477";
  12504. class ui_Component80 extends fgui.GComponent {
  12505. static createInstance() {
  12506. return (fgui.UIPackage.createObject("game", "Component80"));
  12507. }
  12508. onConstruct() {
  12509. this.n0 = (this.getChild("n0"));
  12510. this.n1 = (this.getChild("n1"));
  12511. this.myList = (this.getChild("myList"));
  12512. this.t0 = this.getTransition("t0");
  12513. }
  12514. }
  12515. ui_Component80.URL = "ui://isxx5ak7avag47b";
  12516. class ui_SignNormal extends fgui.GComponent {
  12517. static createInstance() {
  12518. return (fgui.UIPackage.createObject("game", "SignNormal"));
  12519. }
  12520. onConstruct() {
  12521. this.c1 = this.getController("c1");
  12522. this.n7 = (this.getChild("n7"));
  12523. this.n15 = (this.getChild("n15"));
  12524. this.titleTxt = (this.getChild("titleTxt"));
  12525. this.n8 = (this.getChild("n8"));
  12526. this.myIcon = (this.getChild("myIcon"));
  12527. this.numTxt = (this.getChild("numTxt"));
  12528. this.n12 = (this.getChild("n12"));
  12529. this.n13 = (this.getChild("n13"));
  12530. this.n17 = (this.getChild("n17"));
  12531. this.n14 = (this.getChild("n14"));
  12532. }
  12533. }
  12534. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  12535. class ui_Button_reg extends fgui.GButton {
  12536. static createInstance() {
  12537. return (fgui.UIPackage.createObject("game", "Button_reg"));
  12538. }
  12539. onConstruct() {
  12540. this.button = this.getController("button");
  12541. this.n6 = (this.getChild("n6"));
  12542. this.n4 = (this.getChild("n4"));
  12543. }
  12544. }
  12545. ui_Button_reg.URL = "ui://isxx5ak7bobav57y";
  12546. class ui_screenNode extends fgui.GComponent {
  12547. static createInstance() {
  12548. return (fgui.UIPackage.createObject("game", "screenNode"));
  12549. }
  12550. onConstruct() {
  12551. this.n9 = (this.getChild("n9"));
  12552. this.screenImg = (this.getChild("screenImg"));
  12553. }
  12554. }
  12555. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  12556. class ui_GetAwrad_com1 extends fgui.GComponent {
  12557. static createInstance() {
  12558. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  12559. }
  12560. onConstruct() {
  12561. this.n38 = (this.getChild("n38"));
  12562. this.n39 = (this.getChild("n39"));
  12563. this.n40 = (this.getChild("n40"));
  12564. this.t0 = this.getTransition("t0");
  12565. this.t1 = this.getTransition("t1");
  12566. }
  12567. }
  12568. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  12569. class ui_GetAwrad_com2 extends fgui.GComponent {
  12570. static createInstance() {
  12571. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  12572. }
  12573. onConstruct() {
  12574. this.n39 = (this.getChild("n39"));
  12575. this.n40 = (this.getChild("n40"));
  12576. this.t0 = this.getTransition("t0");
  12577. }
  12578. }
  12579. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  12580. class ui_Component128 extends fgui.GComponent {
  12581. static createInstance() {
  12582. return (fgui.UIPackage.createObject("game", "Component128"));
  12583. }
  12584. onConstruct() {
  12585. this.n38 = (this.getChild("n38"));
  12586. this.n40 = (this.getChild("n40"));
  12587. }
  12588. }
  12589. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  12590. class ui_Component100_1 extends fgui.GComponent {
  12591. static createInstance() {
  12592. return (fgui.UIPackage.createObject("game", "Component100_1"));
  12593. }
  12594. onConstruct() {
  12595. this.myNode = (this.getChild("myNode"));
  12596. this.t0 = this.getTransition("t0");
  12597. }
  12598. }
  12599. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  12600. class ui_Component142 extends fgui.GComponent {
  12601. static createInstance() {
  12602. return (fgui.UIPackage.createObject("game", "Component142"));
  12603. }
  12604. onConstruct() {
  12605. this.n41 = (this.getChild("n41"));
  12606. this.n42 = (this.getChild("n42"));
  12607. }
  12608. }
  12609. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  12610. class ui_main_guang extends fgui.GComponent {
  12611. static createInstance() {
  12612. return (fgui.UIPackage.createObject("game", "main_guang"));
  12613. }
  12614. onConstruct() {
  12615. this.n1 = (this.getChild("n1"));
  12616. this.n2 = (this.getChild("n2"));
  12617. this.n3 = (this.getChild("n3"));
  12618. this.n4 = (this.getChild("n4"));
  12619. this.n5 = (this.getChild("n5"));
  12620. this.n6 = (this.getChild("n6"));
  12621. this.n8 = (this.getChild("n8"));
  12622. this.t0 = this.getTransition("t0");
  12623. }
  12624. }
  12625. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  12626. class ui_try_com1 extends fgui.GComponent {
  12627. static createInstance() {
  12628. return (fgui.UIPackage.createObject("game", "try_com1"));
  12629. }
  12630. onConstruct() {
  12631. this.c1 = this.getController("c1");
  12632. this.n0 = (this.getChild("n0"));
  12633. this.n2 = (this.getChild("n2"));
  12634. this.cancelBtn = (this.getChild("cancelBtn"));
  12635. this.videoBtn = (this.getChild("videoBtn"));
  12636. this.n9 = (this.getChild("n9"));
  12637. this.n24 = (this.getChild("n24"));
  12638. this.titleTxt = (this.getChild("titleTxt"));
  12639. this.n32 = (this.getChild("n32"));
  12640. this.n29 = (this.getChild("n29"));
  12641. this.n36 = (this.getChild("n36"));
  12642. this.txtTime = (this.getChild("txtTime"));
  12643. this.t0 = this.getTransition("t0");
  12644. }
  12645. }
  12646. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  12647. class ui_try_com2 extends fgui.GComponent {
  12648. static createInstance() {
  12649. return (fgui.UIPackage.createObject("game", "try_com2"));
  12650. }
  12651. onConstruct() {
  12652. this.skillicon = (this.getChild("skillicon"));
  12653. this.n35 = (this.getChild("n35"));
  12654. this.n31 = (this.getChild("n31"));
  12655. this.n32 = (this.getChild("n32"));
  12656. this.n33 = (this.getChild("n33"));
  12657. this.n34 = (this.getChild("n34"));
  12658. }
  12659. }
  12660. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  12661. class ui_try_com3 extends fgui.GComponent {
  12662. static createInstance() {
  12663. return (fgui.UIPackage.createObject("game", "try_com3"));
  12664. }
  12665. onConstruct() {
  12666. this.n33 = (this.getChild("n33"));
  12667. this.n34 = (this.getChild("n34"));
  12668. this.n35 = (this.getChild("n35"));
  12669. this.t0 = this.getTransition("t0");
  12670. }
  12671. }
  12672. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  12673. class ui_huihe1 extends fgui.GComponent {
  12674. static createInstance() {
  12675. return (fgui.UIPackage.createObject("game", "huihe1"));
  12676. }
  12677. onConstruct() {
  12678. this.n0 = (this.getChild("n0"));
  12679. this.n1 = (this.getChild("n1"));
  12680. this.t0 = this.getTransition("t0");
  12681. }
  12682. }
  12683. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  12684. class ui_huihe2 extends fgui.GComponent {
  12685. static createInstance() {
  12686. return (fgui.UIPackage.createObject("game", "huihe2"));
  12687. }
  12688. onConstruct() {
  12689. this.n0 = (this.getChild("n0"));
  12690. this.n1 = (this.getChild("n1"));
  12691. this.t0 = this.getTransition("t0");
  12692. }
  12693. }
  12694. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  12695. class ui_Component143 extends fgui.GComponent {
  12696. static createInstance() {
  12697. return (fgui.UIPackage.createObject("game", "Component143"));
  12698. }
  12699. onConstruct() {
  12700. this.n3 = (this.getChild("n3"));
  12701. this.n4 = (this.getChild("n4"));
  12702. this.n5 = (this.getChild("n5"));
  12703. this.n6 = (this.getChild("n6"));
  12704. this.n7 = (this.getChild("n7"));
  12705. this.n8 = (this.getChild("n8"));
  12706. this.n9 = (this.getChild("n9"));
  12707. this.n10 = (this.getChild("n10"));
  12708. this.t0 = this.getTransition("t0");
  12709. }
  12710. }
  12711. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  12712. class ui_dh_jingbi2 extends fgui.GComponent {
  12713. static createInstance() {
  12714. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  12715. }
  12716. onConstruct() {
  12717. this.n0 = (this.getChild("n0"));
  12718. this.n1 = (this.getChild("n1"));
  12719. this.n2 = (this.getChild("n2"));
  12720. this.n3 = (this.getChild("n3"));
  12721. this.n4 = (this.getChild("n4"));
  12722. this.n5 = (this.getChild("n5"));
  12723. this.n6 = (this.getChild("n6"));
  12724. this.n8 = (this.getChild("n8"));
  12725. this.n10 = (this.getChild("n10"));
  12726. this.t0 = this.getTransition("t0");
  12727. }
  12728. }
  12729. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  12730. class ui_dh_jingbi2_1 extends fgui.GComponent {
  12731. static createInstance() {
  12732. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  12733. }
  12734. onConstruct() {
  12735. this.n1 = (this.getChild("n1"));
  12736. this.n4 = (this.getChild("n4"));
  12737. this.t0 = this.getTransition("t0");
  12738. }
  12739. }
  12740. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  12741. class ui_dh_jingbi3 extends fgui.GComponent {
  12742. static createInstance() {
  12743. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  12744. }
  12745. onConstruct() {
  12746. this.n0 = (this.getChild("n0"));
  12747. this.n1 = (this.getChild("n1"));
  12748. this.n2 = (this.getChild("n2"));
  12749. this.n3 = (this.getChild("n3"));
  12750. this.n4 = (this.getChild("n4"));
  12751. this.n5 = (this.getChild("n5"));
  12752. this.n6 = (this.getChild("n6"));
  12753. this.n8 = (this.getChild("n8"));
  12754. this.n10 = (this.getChild("n10"));
  12755. this.t0 = this.getTransition("t0");
  12756. }
  12757. }
  12758. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  12759. class ui_dh_jingbi3_1 extends fgui.GComponent {
  12760. static createInstance() {
  12761. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  12762. }
  12763. onConstruct() {
  12764. this.n3 = (this.getChild("n3"));
  12765. this.n1 = (this.getChild("n1"));
  12766. this.t0 = this.getTransition("t0");
  12767. }
  12768. }
  12769. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  12770. class ui_hb_jinbi1 extends fgui.GButton {
  12771. static createInstance() {
  12772. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  12773. }
  12774. onConstruct() {
  12775. this.n20 = (this.getChild("n20"));
  12776. this.n25 = (this.getChild("n25"));
  12777. this.coinTxt = (this.getChild("coinTxt"));
  12778. this.n28 = (this.getChild("n28"));
  12779. this.n32 = (this.getChild("n32"));
  12780. this.n38 = (this.getChild("n38"));
  12781. this.n45 = (this.getChild("n45"));
  12782. this.getTips = (this.getChild("getTips"));
  12783. this.n39 = (this.getChild("n39"));
  12784. this.diamondTxt = (this.getChild("diamondTxt"));
  12785. this.n41 = (this.getChild("n41"));
  12786. this.n42 = (this.getChild("n42"));
  12787. this.n46 = (this.getChild("n46"));
  12788. this.n47 = (this.getChild("n47"));
  12789. this.n48 = (this.getChild("n48"));
  12790. this.t0 = this.getTransition("t0");
  12791. }
  12792. }
  12793. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  12794. class ui_hb_jinbi2 extends fgui.GButton {
  12795. static createInstance() {
  12796. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  12797. }
  12798. onConstruct() {
  12799. this.n20 = (this.getChild("n20"));
  12800. this.n25 = (this.getChild("n25"));
  12801. this.coinTxt = (this.getChild("coinTxt"));
  12802. this.n28 = (this.getChild("n28"));
  12803. this.n32 = (this.getChild("n32"));
  12804. this.n38 = (this.getChild("n38"));
  12805. this.n39 = (this.getChild("n39"));
  12806. this.diamondTxt = (this.getChild("diamondTxt"));
  12807. this.n41 = (this.getChild("n41"));
  12808. this.n42 = (this.getChild("n42"));
  12809. this.n43 = (this.getChild("n43"));
  12810. this.n44 = (this.getChild("n44"));
  12811. this.n45 = (this.getChild("n45"));
  12812. this.t0 = this.getTransition("t0");
  12813. }
  12814. }
  12815. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  12816. class ui_hb_jinbi3 extends fgui.GButton {
  12817. static createInstance() {
  12818. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  12819. }
  12820. onConstruct() {
  12821. this.n20 = (this.getChild("n20"));
  12822. this.n25 = (this.getChild("n25"));
  12823. this.coinTxt = (this.getChild("coinTxt"));
  12824. this.n28 = (this.getChild("n28"));
  12825. this.n32 = (this.getChild("n32"));
  12826. this.n38 = (this.getChild("n38"));
  12827. this.n39 = (this.getChild("n39"));
  12828. this.diamondTxt = (this.getChild("diamondTxt"));
  12829. this.n41 = (this.getChild("n41"));
  12830. this.n42 = (this.getChild("n42"));
  12831. this.n43 = (this.getChild("n43"));
  12832. this.n44 = (this.getChild("n44"));
  12833. this.n45 = (this.getChild("n45"));
  12834. this.t0 = this.getTransition("t0");
  12835. }
  12836. }
  12837. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  12838. class ui_Component104 extends fgui.GComponent {
  12839. static createInstance() {
  12840. return (fgui.UIPackage.createObject("game", "Component104"));
  12841. }
  12842. onConstruct() {
  12843. this.c1 = this.getController("c1");
  12844. this.n12 = (this.getChild("n12"));
  12845. this.coinBtn = (this.getChild("coinBtn"));
  12846. this.diamondBtn = (this.getChild("diamondBtn"));
  12847. this.node3 = (this.getChild("node3"));
  12848. this.node4 = (this.getChild("node4"));
  12849. this.node5 = (this.getChild("node5"));
  12850. this.node1 = (this.getChild("node1"));
  12851. this.node2 = (this.getChild("node2"));
  12852. this.node6 = (this.getChild("node6"));
  12853. this.t0 = this.getTransition("t0");
  12854. }
  12855. }
  12856. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  12857. class ui_Component105 extends fgui.GButton {
  12858. static createInstance() {
  12859. return (fgui.UIPackage.createObject("game", "Component105"));
  12860. }
  12861. onConstruct() {
  12862. this.c1 = this.getController("c1");
  12863. this.n49 = (this.getChild("n49"));
  12864. this.n18 = (this.getChild("n18"));
  12865. this.n46 = (this.getChild("n46"));
  12866. this.n48 = (this.getChild("n48"));
  12867. }
  12868. }
  12869. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  12870. class ui_Component106 extends fgui.GButton {
  12871. static createInstance() {
  12872. return (fgui.UIPackage.createObject("game", "Component106"));
  12873. }
  12874. onConstruct() {
  12875. this.c1 = this.getController("c1");
  12876. this.n49 = (this.getChild("n49"));
  12877. this.n18 = (this.getChild("n18"));
  12878. this.n46 = (this.getChild("n46"));
  12879. this.n48 = (this.getChild("n48"));
  12880. }
  12881. }
  12882. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  12883. class ui_hb_zs1 extends fgui.GButton {
  12884. static createInstance() {
  12885. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  12886. }
  12887. onConstruct() {
  12888. this.c1 = this.getController("c1");
  12889. this.n20 = (this.getChild("n20"));
  12890. this.n21 = (this.getChild("n21"));
  12891. this.n26 = (this.getChild("n26"));
  12892. this.n27 = (this.getChild("n27"));
  12893. this.shareTxt = (this.getChild("shareTxt"));
  12894. this.n32 = (this.getChild("n32"));
  12895. this.n38 = (this.getChild("n38"));
  12896. this.n39 = (this.getChild("n39"));
  12897. this.n44 = (this.getChild("n44"));
  12898. this.diamondTxt = (this.getChild("diamondTxt"));
  12899. this.n41 = (this.getChild("n41"));
  12900. this.n45 = (this.getChild("n45"));
  12901. this.n47 = (this.getChild("n47"));
  12902. this.n48 = (this.getChild("n48"));
  12903. this.randTxt = (this.getChild("randTxt"));
  12904. this.n50 = (this.getChild("n50"));
  12905. this.t0 = this.getTransition("t0");
  12906. }
  12907. }
  12908. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  12909. class ui_dh_zs1 extends fgui.GComponent {
  12910. static createInstance() {
  12911. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  12912. }
  12913. onConstruct() {
  12914. this.n10 = (this.getChild("n10"));
  12915. this.n9 = (this.getChild("n9"));
  12916. this.n1 = (this.getChild("n1"));
  12917. this.n2 = (this.getChild("n2"));
  12918. this.n3 = (this.getChild("n3"));
  12919. this.n4 = (this.getChild("n4"));
  12920. this.n5 = (this.getChild("n5"));
  12921. this.n6 = (this.getChild("n6"));
  12922. this.n8 = (this.getChild("n8"));
  12923. this.n11 = (this.getChild("n11"));
  12924. this.t0 = this.getTransition("t0");
  12925. }
  12926. }
  12927. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  12928. class ui_dh_zs1_1 extends fgui.GComponent {
  12929. static createInstance() {
  12930. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  12931. }
  12932. onConstruct() {
  12933. this.n3 = (this.getChild("n3"));
  12934. this.n1 = (this.getChild("n1"));
  12935. this.t0 = this.getTransition("t0");
  12936. }
  12937. }
  12938. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  12939. class ui_hb_zs2 extends fgui.GButton {
  12940. static createInstance() {
  12941. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  12942. }
  12943. onConstruct() {
  12944. this.n20 = (this.getChild("n20"));
  12945. this.n21 = (this.getChild("n21"));
  12946. this.n26 = (this.getChild("n26"));
  12947. this.n27 = (this.getChild("n27"));
  12948. this.n32 = (this.getChild("n32"));
  12949. this.n38 = (this.getChild("n38"));
  12950. this.n39 = (this.getChild("n39"));
  12951. this.n44 = (this.getChild("n44"));
  12952. this.diamondTxt = (this.getChild("diamondTxt"));
  12953. this.n41 = (this.getChild("n41"));
  12954. this.n45 = (this.getChild("n45"));
  12955. this.t0 = this.getTransition("t0");
  12956. }
  12957. }
  12958. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  12959. class ui_hb_zs3 extends fgui.GButton {
  12960. static createInstance() {
  12961. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  12962. }
  12963. onConstruct() {
  12964. this.n20 = (this.getChild("n20"));
  12965. this.n21 = (this.getChild("n21"));
  12966. this.n26 = (this.getChild("n26"));
  12967. this.n27 = (this.getChild("n27"));
  12968. this.n32 = (this.getChild("n32"));
  12969. this.n38 = (this.getChild("n38"));
  12970. this.n47 = (this.getChild("n47"));
  12971. this.t0 = this.getTransition("t0");
  12972. }
  12973. }
  12974. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  12975. class ui_dh_zs2 extends fgui.GComponent {
  12976. static createInstance() {
  12977. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  12978. }
  12979. onConstruct() {
  12980. this.n10 = (this.getChild("n10"));
  12981. this.n9 = (this.getChild("n9"));
  12982. this.n1 = (this.getChild("n1"));
  12983. this.n2 = (this.getChild("n2"));
  12984. this.n3 = (this.getChild("n3"));
  12985. this.n4 = (this.getChild("n4"));
  12986. this.n5 = (this.getChild("n5"));
  12987. this.n6 = (this.getChild("n6"));
  12988. this.n8 = (this.getChild("n8"));
  12989. this.n11 = (this.getChild("n11"));
  12990. this.t0 = this.getTransition("t0");
  12991. }
  12992. }
  12993. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  12994. class ui_dh_zs2_1 extends fgui.GComponent {
  12995. static createInstance() {
  12996. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  12997. }
  12998. onConstruct() {
  12999. this.n3 = (this.getChild("n3"));
  13000. this.n1 = (this.getChild("n1"));
  13001. this.t0 = this.getTransition("t0");
  13002. }
  13003. }
  13004. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  13005. class ui_dh_zs3 extends fgui.GComponent {
  13006. static createInstance() {
  13007. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  13008. }
  13009. onConstruct() {
  13010. this.n10 = (this.getChild("n10"));
  13011. this.n9 = (this.getChild("n9"));
  13012. this.n1 = (this.getChild("n1"));
  13013. this.n2 = (this.getChild("n2"));
  13014. this.n3 = (this.getChild("n3"));
  13015. this.n4 = (this.getChild("n4"));
  13016. this.n5 = (this.getChild("n5"));
  13017. this.n6 = (this.getChild("n6"));
  13018. this.n8 = (this.getChild("n8"));
  13019. this.n11 = (this.getChild("n11"));
  13020. this.t0 = this.getTransition("t0");
  13021. }
  13022. }
  13023. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  13024. class ui_dh_zs3_1 extends fgui.GComponent {
  13025. static createInstance() {
  13026. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  13027. }
  13028. onConstruct() {
  13029. this.n3 = (this.getChild("n3"));
  13030. this.n1 = (this.getChild("n1"));
  13031. this.t0 = this.getTransition("t0");
  13032. }
  13033. }
  13034. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  13035. class ui_Component107 extends fgui.GComponent {
  13036. static createInstance() {
  13037. return (fgui.UIPackage.createObject("game", "Component107"));
  13038. }
  13039. onConstruct() {
  13040. this.n18 = (this.getChild("n18"));
  13041. this.n19 = (this.getChild("n19"));
  13042. this.n20 = (this.getChild("n20"));
  13043. this.n21 = (this.getChild("n21"));
  13044. this.n22 = (this.getChild("n22"));
  13045. this.levelTxt = (this.getChild("levelTxt"));
  13046. this.t0 = this.getTransition("t0");
  13047. }
  13048. }
  13049. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  13050. class ui_box_com1 extends fgui.GComponent {
  13051. static createInstance() {
  13052. return (fgui.UIPackage.createObject("game", "box_com1"));
  13053. }
  13054. onConstruct() {
  13055. this.n14 = (this.getChild("n14"));
  13056. this.n6 = (this.getChild("n6"));
  13057. this.t0 = this.getTransition("t0");
  13058. }
  13059. }
  13060. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  13061. class ui_box_com2 extends fgui.GProgressBar {
  13062. static createInstance() {
  13063. return (fgui.UIPackage.createObject("game", "box_com2"));
  13064. }
  13065. onConstruct() {
  13066. this.bg0 = (this.getChild("bg0"));
  13067. this.bg = (this.getChild("bg"));
  13068. this.bar = (this.getChild("bar"));
  13069. this.n7 = (this.getChild("n7"));
  13070. this.n8 = (this.getChild("n8"));
  13071. this.n10 = (this.getChild("n10"));
  13072. this.n11 = (this.getChild("n11"));
  13073. this.n12 = (this.getChild("n12"));
  13074. }
  13075. }
  13076. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  13077. class ui_box_com4 extends fgui.GComponent {
  13078. static createInstance() {
  13079. return (fgui.UIPackage.createObject("game", "box_com4"));
  13080. }
  13081. onConstruct() {
  13082. this.n8 = (this.getChild("n8"));
  13083. this.t0 = this.getTransition("t0");
  13084. }
  13085. }
  13086. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  13087. class ui_box_com3 extends fgui.GComponent {
  13088. static createInstance() {
  13089. return (fgui.UIPackage.createObject("game", "box_com3"));
  13090. }
  13091. onConstruct() {
  13092. this.n2 = (this.getChild("n2"));
  13093. this.n3 = (this.getChild("n3"));
  13094. this.n4 = (this.getChild("n4"));
  13095. this.n5 = (this.getChild("n5"));
  13096. this.t0 = this.getTransition("t0");
  13097. this.t1 = this.getTransition("t1");
  13098. }
  13099. }
  13100. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  13101. class ui_Component97 extends fgui.GComponent {
  13102. static createInstance() {
  13103. return (fgui.UIPackage.createObject("game", "Component97"));
  13104. }
  13105. onConstruct() {
  13106. this.c1 = this.getController("c1");
  13107. this.n46 = (this.getChild("n46"));
  13108. this.diamondNode = (this.getChild("diamondNode"));
  13109. this.coinNode = (this.getChild("coinNode"));
  13110. this.t0 = this.getTransition("t0");
  13111. }
  13112. }
  13113. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  13114. class ui_Component98 extends fgui.GButton {
  13115. static createInstance() {
  13116. return (fgui.UIPackage.createObject("game", "Component98"));
  13117. }
  13118. onConstruct() {
  13119. this.n8 = (this.getChild("n8"));
  13120. this.n40 = (this.getChild("n40"));
  13121. }
  13122. }
  13123. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  13124. class ui_Component28_11 extends fgui.GButton {
  13125. static createInstance() {
  13126. return (fgui.UIPackage.createObject("game", "Component28_11"));
  13127. }
  13128. onConstruct() {
  13129. this.c1 = this.getController("c1");
  13130. this.n12 = (this.getChild("n12"));
  13131. this.n17 = (this.getChild("n17"));
  13132. this.n13 = (this.getChild("n13"));
  13133. this.diamondTxt = (this.getChild("diamondTxt"));
  13134. this.n15 = (this.getChild("n15"));
  13135. this.n16 = (this.getChild("n16"));
  13136. }
  13137. }
  13138. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  13139. class ui_Component58_11 extends fgui.GComponent {
  13140. static createInstance() {
  13141. return (fgui.UIPackage.createObject("game", "Component58_11"));
  13142. }
  13143. onConstruct() {
  13144. this.c1 = this.getController("c1");
  13145. this.n23 = (this.getChild("n23"));
  13146. this.n41 = (this.getChild("n41"));
  13147. this.n_qiuGan = (this.getChild("n_qiuGan"));
  13148. this.n_daoju = (this.getChild("n_daoju"));
  13149. this.myList = (this.getChild("myList"));
  13150. this.djList = (this.getChild("djList"));
  13151. this.t0 = this.getTransition("t0");
  13152. }
  13153. }
  13154. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  13155. class ui_Component100 extends fgui.GComponent {
  13156. static createInstance() {
  13157. return (fgui.UIPackage.createObject("game", "Component100"));
  13158. }
  13159. onConstruct() {
  13160. this.c1 = this.getController("c1");
  13161. this.n75 = (this.getChild("n75"));
  13162. this.n76 = (this.getChild("n76"));
  13163. this.n80 = (this.getChild("n80"));
  13164. this.txt = (this.getChild("txt"));
  13165. this.spineRoot = (this.getChild("spineRoot"));
  13166. }
  13167. }
  13168. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  13169. class ui_Component101 extends fgui.GComponent {
  13170. static createInstance() {
  13171. return (fgui.UIPackage.createObject("game", "Component101"));
  13172. }
  13173. onConstruct() {
  13174. this.c1 = this.getController("c1");
  13175. this.n36 = (this.getChild("n36"));
  13176. this.n35 = (this.getChild("n35"));
  13177. this.n33 = (this.getChild("n33"));
  13178. this.n34 = (this.getChild("n34"));
  13179. }
  13180. }
  13181. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  13182. class ui_Component53 extends fgui.GComponent {
  13183. static createInstance() {
  13184. return (fgui.UIPackage.createObject("game", "Component53"));
  13185. }
  13186. onConstruct() {
  13187. this.n0 = (this.getChild("n0"));
  13188. this.n1 = (this.getChild("n1"));
  13189. this.n2 = (this.getChild("n2"));
  13190. this.n3 = (this.getChild("n3"));
  13191. this.n4 = (this.getChild("n4"));
  13192. this.n5 = (this.getChild("n5"));
  13193. this.n6 = (this.getChild("n6"));
  13194. this.n7 = (this.getChild("n7"));
  13195. this.n8 = (this.getChild("n8"));
  13196. this.n9 = (this.getChild("n9"));
  13197. this.n10 = (this.getChild("n10"));
  13198. this.n11 = (this.getChild("n11"));
  13199. this.n12 = (this.getChild("n12"));
  13200. this.n13 = (this.getChild("n13"));
  13201. this.n14 = (this.getChild("n14"));
  13202. this.n15 = (this.getChild("n15"));
  13203. this.n16 = (this.getChild("n16"));
  13204. this.n19 = (this.getChild("n19"));
  13205. this.n20 = (this.getChild("n20"));
  13206. this.n21 = (this.getChild("n21"));
  13207. this.n22 = (this.getChild("n22"));
  13208. this.n23 = (this.getChild("n23"));
  13209. this.n24 = (this.getChild("n24"));
  13210. this.n25 = (this.getChild("n25"));
  13211. this.n26 = (this.getChild("n26"));
  13212. this.n27 = (this.getChild("n27"));
  13213. this.n28 = (this.getChild("n28"));
  13214. this.n29 = (this.getChild("n29"));
  13215. this.n30 = (this.getChild("n30"));
  13216. this.n31 = (this.getChild("n31"));
  13217. this.n32 = (this.getChild("n32"));
  13218. this.n33 = (this.getChild("n33"));
  13219. this.n34 = (this.getChild("n34"));
  13220. this.n35 = (this.getChild("n35"));
  13221. this.t0 = this.getTransition("t0");
  13222. }
  13223. }
  13224. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  13225. class ui_Component58 extends fgui.GComponent {
  13226. static createInstance() {
  13227. return (fgui.UIPackage.createObject("game", "Component58"));
  13228. }
  13229. onConstruct() {
  13230. this.n23 = (this.getChild("n23"));
  13231. this.n41 = (this.getChild("n41"));
  13232. this.n8 = (this.getChild("n8"));
  13233. this.skillList = (this.getChild("skillList"));
  13234. this.t0 = this.getTransition("t0");
  13235. }
  13236. }
  13237. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  13238. class ui_Component59 extends fgui.GComponent {
  13239. static createInstance() {
  13240. return (fgui.UIPackage.createObject("game", "Component59"));
  13241. }
  13242. onConstruct() {
  13243. this.n3 = (this.getChild("n3"));
  13244. this.msgTxt = (this.getChild("msgTxt"));
  13245. this.t0 = this.getTransition("t0");
  13246. }
  13247. }
  13248. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  13249. class ui_RulerNode extends fgui.GComponent {
  13250. static createInstance() {
  13251. return (fgui.UIPackage.createObject("game", "RulerNode"));
  13252. }
  13253. onConstruct() {
  13254. this.n6 = (this.getChild("n6"));
  13255. this.n4 = (this.getChild("n4"));
  13256. this.img1 = (this.getChild("img1"));
  13257. this.img2 = (this.getChild("img2"));
  13258. }
  13259. }
  13260. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  13261. class ui_Component108 extends fgui.GComponent {
  13262. static createInstance() {
  13263. return (fgui.UIPackage.createObject("game", "Component108"));
  13264. }
  13265. onConstruct() {
  13266. this.n19 = (this.getChild("n19"));
  13267. this.t0 = this.getTransition("t0");
  13268. }
  13269. }
  13270. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  13271. class ui_Component63 extends fgui.GComponent {
  13272. static createInstance() {
  13273. return (fgui.UIPackage.createObject("game", "Component63"));
  13274. }
  13275. onConstruct() {
  13276. this.n66 = (this.getChild("n66"));
  13277. this.n56 = (this.getChild("n56"));
  13278. this.n63 = (this.getChild("n63"));
  13279. this.n65 = (this.getChild("n65"));
  13280. this.t0 = this.getTransition("t0");
  13281. }
  13282. }
  13283. ui_Component63.URL = "ui://isxx5ak7h657452";
  13284. class ui_topNode extends fgui.GComponent {
  13285. static createInstance() {
  13286. return (fgui.UIPackage.createObject("game", "topNode"));
  13287. }
  13288. onConstruct() {
  13289. this.selfProgress = (this.getChild("selfProgress"));
  13290. this.aiProgress = (this.getChild("aiProgress"));
  13291. this.selfKuang = (this.getChild("selfKuang"));
  13292. this.aiKuang = (this.getChild("aiKuang"));
  13293. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  13294. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  13295. this.n33 = (this.getChild("n33"));
  13296. this.n34 = (this.getChild("n34"));
  13297. this.selfNameTxt = (this.getChild("selfNameTxt"));
  13298. this.aiNameTxt = (this.getChild("aiNameTxt"));
  13299. this.selfBallList = (this.getChild("selfBallList"));
  13300. this.aiBallList = (this.getChild("aiBallList"));
  13301. this.middleNode = (this.getChild("middleNode"));
  13302. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  13303. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  13304. this.scoreNode = (this.getChild("scoreNode"));
  13305. this.selfTips = (this.getChild("selfTips"));
  13306. this.aiTips = (this.getChild("aiTips"));
  13307. }
  13308. }
  13309. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  13310. class ui_selfProgress extends fgui.GProgressBar {
  13311. static createInstance() {
  13312. return (fgui.UIPackage.createObject("game", "selfProgress"));
  13313. }
  13314. onConstruct() {
  13315. this.n3 = (this.getChild("n3"));
  13316. this.bar = (this.getChild("bar"));
  13317. }
  13318. }
  13319. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  13320. class ui_aiProgress extends fgui.GProgressBar {
  13321. static createInstance() {
  13322. return (fgui.UIPackage.createObject("game", "aiProgress"));
  13323. }
  13324. onConstruct() {
  13325. this.n3 = (this.getChild("n3"));
  13326. this.bar = (this.getChild("bar"));
  13327. }
  13328. }
  13329. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  13330. class ui_ballDisplay extends fgui.GComponent {
  13331. static createInstance() {
  13332. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  13333. }
  13334. onConstruct() {
  13335. this.myImg = (this.getChild("myImg"));
  13336. }
  13337. }
  13338. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  13339. class ui_moveNode extends fgui.GComponent {
  13340. static createInstance() {
  13341. return (fgui.UIPackage.createObject("game", "moveNode"));
  13342. }
  13343. onConstruct() {
  13344. this.n8 = (this.getChild("n8"));
  13345. this.finger = (this.getChild("finger"));
  13346. }
  13347. }
  13348. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  13349. class ui_cancelBtn extends fgui.GButton {
  13350. static createInstance() {
  13351. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  13352. }
  13353. onConstruct() {
  13354. this.c1 = this.getController("c1");
  13355. this.n0 = (this.getChild("n0"));
  13356. this.n1 = (this.getChild("n1"));
  13357. }
  13358. }
  13359. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  13360. class ui_shareBtn extends fgui.GButton {
  13361. static createInstance() {
  13362. return (fgui.UIPackage.createObject("game", "shareBtn"));
  13363. }
  13364. onConstruct() {
  13365. this.c1 = this.getController("c1");
  13366. this.n2 = (this.getChild("n2"));
  13367. this.n1 = (this.getChild("n1"));
  13368. this.n3 = (this.getChild("n3"));
  13369. this.n4 = (this.getChild("n4"));
  13370. this.n5 = (this.getChild("n5"));
  13371. this.n6 = (this.getChild("n6"));
  13372. }
  13373. }
  13374. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  13375. class ui_share2Btn extends fgui.GButton {
  13376. static createInstance() {
  13377. return (fgui.UIPackage.createObject("game", "share2Btn"));
  13378. }
  13379. onConstruct() {
  13380. this.n3 = (this.getChild("n3"));
  13381. }
  13382. }
  13383. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  13384. class ui_rodMethodNode extends fgui.GComponent {
  13385. static createInstance() {
  13386. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  13387. }
  13388. onConstruct() {
  13389. this.bg = (this.getChild("bg"));
  13390. this.dot = (this.getChild("dot"));
  13391. }
  13392. }
  13393. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  13394. class ui_sureBtn extends fgui.GButton {
  13395. static createInstance() {
  13396. return (fgui.UIPackage.createObject("game", "sureBtn"));
  13397. }
  13398. onConstruct() {
  13399. this.n2 = (this.getChild("n2"));
  13400. this.n1 = (this.getChild("n1"));
  13401. }
  13402. }
  13403. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  13404. class ui_Component18 extends fgui.GComponent {
  13405. static createInstance() {
  13406. return (fgui.UIPackage.createObject("game", "Component18"));
  13407. }
  13408. onConstruct() {
  13409. this.c1 = this.getController("c1");
  13410. this.nameTxt = (this.getChild("nameTxt"));
  13411. this.headImg = (this.getChild("headImg"));
  13412. this.n24 = (this.getChild("n24"));
  13413. this.skillImg = (this.getChild("skillImg"));
  13414. this.skillTxt = (this.getChild("skillTxt"));
  13415. }
  13416. }
  13417. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  13418. class ui_Component45 extends fgui.GComponent {
  13419. static createInstance() {
  13420. return (fgui.UIPackage.createObject("game", "Component45"));
  13421. }
  13422. onConstruct() {
  13423. this.c1 = this.getController("c1");
  13424. this.n40 = (this.getChild("n40"));
  13425. this.n41 = (this.getChild("n41"));
  13426. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  13427. this.n42 = (this.getChild("n42"));
  13428. this.awardTxt = (this.getChild("awardTxt"));
  13429. this.n44 = (this.getChild("n44"));
  13430. this.t0 = this.getTransition("t0");
  13431. }
  13432. }
  13433. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  13434. class ui_emotionDisplay extends fgui.GButton {
  13435. static createInstance() {
  13436. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  13437. }
  13438. onConstruct() {
  13439. this.myIcon = (this.getChild("myIcon"));
  13440. }
  13441. }
  13442. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  13443. class ui_Component49 extends fgui.GButton {
  13444. static createInstance() {
  13445. return (fgui.UIPackage.createObject("game", "Component49"));
  13446. }
  13447. onConstruct() {
  13448. this.n69 = (this.getChild("n69"));
  13449. this.n56 = (this.getChild("n56"));
  13450. }
  13451. }
  13452. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  13453. class ui_Component50 extends fgui.GButton {
  13454. static createInstance() {
  13455. return (fgui.UIPackage.createObject("game", "Component50"));
  13456. }
  13457. onConstruct() {
  13458. this.n54 = (this.getChild("n54"));
  13459. this.n65 = (this.getChild("n65"));
  13460. }
  13461. }
  13462. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  13463. class ui_Component51 extends fgui.GButton {
  13464. static createInstance() {
  13465. return (fgui.UIPackage.createObject("game", "Component51"));
  13466. }
  13467. onConstruct() {
  13468. this.c1 = this.getController("c1");
  13469. this.n51 = (this.getChild("n51"));
  13470. this.n54 = (this.getChild("n54"));
  13471. }
  13472. }
  13473. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  13474. class ui_Button5 extends fgui.GButton {
  13475. static createInstance() {
  13476. return (fgui.UIPackage.createObject("game", "Button5"));
  13477. }
  13478. onConstruct() {
  13479. this.c1 = this.getController("c1");
  13480. this.n0 = (this.getChild("n0"));
  13481. this.n2 = (this.getChild("n2"));
  13482. }
  13483. }
  13484. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  13485. class ui_Component124 extends fgui.GComponent {
  13486. static createInstance() {
  13487. return (fgui.UIPackage.createObject("game", "Component124"));
  13488. }
  13489. onConstruct() {
  13490. this.n22 = (this.getChild("n22"));
  13491. this.shareNode = (this.getChild("shareNode"));
  13492. }
  13493. }
  13494. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  13495. class ui_Component125 extends fgui.GComponent {
  13496. static createInstance() {
  13497. return (fgui.UIPackage.createObject("game", "Component125"));
  13498. }
  13499. onConstruct() {
  13500. this.n29 = (this.getChild("n29"));
  13501. this.coinTxt = (this.getChild("coinTxt"));
  13502. }
  13503. }
  13504. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  13505. class ui_Component52 extends fgui.GButton {
  13506. static createInstance() {
  13507. return (fgui.UIPackage.createObject("game", "Component52"));
  13508. }
  13509. onConstruct() {
  13510. this.n35 = (this.getChild("n35"));
  13511. this.n36 = (this.getChild("n36"));
  13512. }
  13513. }
  13514. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  13515. class ui_drawBtn extends fgui.GButton {
  13516. static createInstance() {
  13517. return (fgui.UIPackage.createObject("game", "drawBtn"));
  13518. }
  13519. onConstruct() {
  13520. this.c1 = this.getController("c1");
  13521. this.n2 = (this.getChild("n2"));
  13522. this.n1 = (this.getChild("n1"));
  13523. this.n5 = (this.getChild("n5"));
  13524. }
  13525. }
  13526. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  13527. class ui_Component43 extends fgui.GButton {
  13528. static createInstance() {
  13529. return (fgui.UIPackage.createObject("game", "Component43"));
  13530. }
  13531. onConstruct() {
  13532. this.n49 = (this.getChild("n49"));
  13533. }
  13534. }
  13535. ui_Component43.URL = "ui://isxx5ak7iveg434";
  13536. class ui_wordsDisplay extends fgui.GComponent {
  13537. static createInstance() {
  13538. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  13539. }
  13540. onConstruct() {
  13541. this.txt = (this.getChild("txt"));
  13542. this.n63 = (this.getChild("n63"));
  13543. }
  13544. }
  13545. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  13546. class ui_Component_phb extends fgui.GComponent {
  13547. static createInstance() {
  13548. return (fgui.UIPackage.createObject("game", "Component_phb"));
  13549. }
  13550. onConstruct() {
  13551. this.n3 = (this.getChild("n3"));
  13552. this.n4 = (this.getChild("n4"));
  13553. }
  13554. }
  13555. ui_Component_phb.URL = "ui://isxx5ak7ixgmv57c";
  13556. class ui_Component3 extends fgui.GComponent {
  13557. static createInstance() {
  13558. return (fgui.UIPackage.createObject("game", "Component3"));
  13559. }
  13560. onConstruct() {
  13561. this.n26 = (this.getChild("n26"));
  13562. this.n24 = (this.getChild("n24"));
  13563. this.nameTxt = (this.getChild("nameTxt"));
  13564. this.headRoot = (this.getChild("headRoot"));
  13565. }
  13566. }
  13567. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  13568. class ui_Component4 extends fgui.GComponent {
  13569. static createInstance() {
  13570. return (fgui.UIPackage.createObject("game", "Component4"));
  13571. }
  13572. onConstruct() {
  13573. this.headImg = (this.getChild("headImg"));
  13574. }
  13575. }
  13576. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  13577. class ui_Component7 extends fgui.GButton {
  13578. static createInstance() {
  13579. return (fgui.UIPackage.createObject("game", "Component7"));
  13580. }
  13581. onConstruct() {
  13582. this.n17 = (this.getChild("n17"));
  13583. }
  13584. }
  13585. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  13586. class ui_Component8 extends fgui.GButton {
  13587. static createInstance() {
  13588. return (fgui.UIPackage.createObject("game", "Component8"));
  13589. }
  13590. onConstruct() {
  13591. this.n19 = (this.getChild("n19"));
  13592. }
  13593. }
  13594. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  13595. class ui_Component10 extends fgui.GButton {
  13596. static createInstance() {
  13597. return (fgui.UIPackage.createObject("game", "Component10"));
  13598. }
  13599. onConstruct() {
  13600. this.c1 = this.getController("c1");
  13601. this.n40 = (this.getChild("n40"));
  13602. }
  13603. }
  13604. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  13605. class ui_Component11 extends fgui.GButton {
  13606. static createInstance() {
  13607. return (fgui.UIPackage.createObject("game", "Component11"));
  13608. }
  13609. onConstruct() {
  13610. this.n34 = (this.getChild("n34"));
  13611. }
  13612. }
  13613. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  13614. class ui_Component12 extends fgui.GButton {
  13615. static createInstance() {
  13616. return (fgui.UIPackage.createObject("game", "Component12"));
  13617. }
  13618. onConstruct() {
  13619. this.n35 = (this.getChild("n35"));
  13620. }
  13621. }
  13622. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  13623. class ui_Component13 extends fgui.GButton {
  13624. static createInstance() {
  13625. return (fgui.UIPackage.createObject("game", "Component13"));
  13626. }
  13627. onConstruct() {
  13628. this.n27 = (this.getChild("n27"));
  13629. this.n36 = (this.getChild("n36"));
  13630. }
  13631. }
  13632. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  13633. class ui_dh_js_tuowei extends fgui.GComponent {
  13634. static createInstance() {
  13635. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  13636. }
  13637. onConstruct() {
  13638. this.n19 = (this.getChild("n19"));
  13639. this.n18 = (this.getChild("n18"));
  13640. this.n0 = (this.getChild("n0"));
  13641. this.n3 = (this.getChild("n3"));
  13642. this.n4 = (this.getChild("n4"));
  13643. this.n5 = (this.getChild("n5"));
  13644. this.n6 = (this.getChild("n6"));
  13645. this.n8 = (this.getChild("n8"));
  13646. this.n9 = (this.getChild("n9"));
  13647. this.n10 = (this.getChild("n10"));
  13648. this.n11 = (this.getChild("n11"));
  13649. this.n12 = (this.getChild("n12"));
  13650. this.n13 = (this.getChild("n13"));
  13651. this.n14 = (this.getChild("n14"));
  13652. this.n15 = (this.getChild("n15"));
  13653. this.n20 = (this.getChild("n20"));
  13654. this.t0 = this.getTransition("t0");
  13655. this.t1 = this.getTransition("t1");
  13656. }
  13657. }
  13658. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  13659. class ui_dh_js_tw_g extends fgui.GComponent {
  13660. static createInstance() {
  13661. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  13662. }
  13663. onConstruct() {
  13664. this.n0 = (this.getChild("n0"));
  13665. this.n1 = (this.getChild("n1"));
  13666. this.t0 = this.getTransition("t0");
  13667. }
  13668. }
  13669. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  13670. class ui_dh_js_xingxing extends fgui.GComponent {
  13671. static createInstance() {
  13672. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  13673. }
  13674. onConstruct() {
  13675. this.n1 = (this.getChild("n1"));
  13676. this.n2 = (this.getChild("n2"));
  13677. this.n3 = (this.getChild("n3"));
  13678. this.n4 = (this.getChild("n4"));
  13679. this.n0 = (this.getChild("n0"));
  13680. this.t2 = this.getTransition("t2");
  13681. this.t1 = this.getTransition("t1");
  13682. }
  13683. }
  13684. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  13685. class ui_dh_zy_jiazai extends fgui.GComponent {
  13686. static createInstance() {
  13687. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  13688. }
  13689. onConstruct() {
  13690. this.c1 = this.getController("c1");
  13691. this.n0 = (this.getChild("n0"));
  13692. this.n1 = (this.getChild("n1"));
  13693. this.n2 = (this.getChild("n2"));
  13694. this.n4 = (this.getChild("n4"));
  13695. this.n5 = (this.getChild("n5"));
  13696. this.n6 = (this.getChild("n6"));
  13697. this.n8 = (this.getChild("n8"));
  13698. this.n7 = (this.getChild("n7"));
  13699. this.t0 = this.getTransition("t0");
  13700. }
  13701. }
  13702. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  13703. class ui_dh_js_xingxing2 extends fgui.GComponent {
  13704. static createInstance() {
  13705. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  13706. }
  13707. onConstruct() {
  13708. this.c1 = this.getController("c1");
  13709. this.n3 = (this.getChild("n3"));
  13710. this.n5 = (this.getChild("n5"));
  13711. this.n4 = (this.getChild("n4"));
  13712. this.n0 = (this.getChild("n0"));
  13713. this.n1 = (this.getChild("n1"));
  13714. this.n2 = (this.getChild("n2"));
  13715. }
  13716. }
  13717. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  13718. class ui_dh_js_tuowei2 extends fgui.GComponent {
  13719. static createInstance() {
  13720. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  13721. }
  13722. onConstruct() {
  13723. this.n19 = (this.getChild("n19"));
  13724. this.n21 = (this.getChild("n21"));
  13725. this.n0 = (this.getChild("n0"));
  13726. this.n3 = (this.getChild("n3"));
  13727. this.n4 = (this.getChild("n4"));
  13728. this.n5 = (this.getChild("n5"));
  13729. this.n6 = (this.getChild("n6"));
  13730. this.n8 = (this.getChild("n8"));
  13731. this.n9 = (this.getChild("n9"));
  13732. this.n10 = (this.getChild("n10"));
  13733. this.n11 = (this.getChild("n11"));
  13734. this.n12 = (this.getChild("n12"));
  13735. this.n13 = (this.getChild("n13"));
  13736. this.n14 = (this.getChild("n14"));
  13737. this.n15 = (this.getChild("n15"));
  13738. this.n23 = (this.getChild("n23"));
  13739. this.t0 = this.getTransition("t0");
  13740. this.t1 = this.getTransition("t1");
  13741. }
  13742. }
  13743. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  13744. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  13745. static createInstance() {
  13746. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  13747. }
  13748. onConstruct() {
  13749. this.n1 = (this.getChild("n1"));
  13750. this.n2 = (this.getChild("n2"));
  13751. this.t0 = this.getTransition("t0");
  13752. }
  13753. }
  13754. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  13755. class ui_dh_js_shibai_1 extends fgui.GComponent {
  13756. static createInstance() {
  13757. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  13758. }
  13759. onConstruct() {
  13760. this.n4 = (this.getChild("n4"));
  13761. this.n2 = (this.getChild("n2"));
  13762. this.n3 = (this.getChild("n3"));
  13763. this.idle = this.getTransition("idle");
  13764. this.attack = this.getTransition("attack");
  13765. }
  13766. }
  13767. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  13768. class ui_special extends fgui.GComponent {
  13769. static createInstance() {
  13770. return (fgui.UIPackage.createObject("game", "special"));
  13771. }
  13772. onConstruct() {
  13773. this.n18 = (this.getChild("n18"));
  13774. this.n19 = (this.getChild("n19"));
  13775. this.n20 = (this.getChild("n20"));
  13776. this.n21 = (this.getChild("n21"));
  13777. this.n22 = (this.getChild("n22"));
  13778. this.levelTxt = (this.getChild("levelTxt"));
  13779. this.n24 = (this.getChild("n24"));
  13780. this.n25 = (this.getChild("n25"));
  13781. this.t0 = this.getTransition("t0");
  13782. }
  13783. }
  13784. ui_special.URL = "ui://isxx5ak7j979v4i6";
  13785. class ui_Component145 extends fgui.GComponent {
  13786. static createInstance() {
  13787. return (fgui.UIPackage.createObject("game", "Component145"));
  13788. }
  13789. onConstruct() {
  13790. this.guanyuNode = (this.getChild("guanyuNode"));
  13791. }
  13792. }
  13793. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  13794. class ui_longBtn extends fgui.GButton {
  13795. static createInstance() {
  13796. return (fgui.UIPackage.createObject("game", "longBtn"));
  13797. }
  13798. onConstruct() {
  13799. this.c1 = this.getController("c1");
  13800. this.n2 = (this.getChild("n2"));
  13801. this.n1 = (this.getChild("n1"));
  13802. this.n4 = (this.getChild("n4"));
  13803. }
  13804. }
  13805. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  13806. class ui_Component146 extends fgui.GComponent {
  13807. static createInstance() {
  13808. return (fgui.UIPackage.createObject("game", "Component146"));
  13809. }
  13810. onConstruct() {
  13811. this.n89 = (this.getChild("n89"));
  13812. this.n90 = (this.getChild("n90"));
  13813. this.guideBtn = (this.getChild("guideBtn"));
  13814. }
  13815. }
  13816. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  13817. class ui_Component146_11 extends fgui.GComponent {
  13818. static createInstance() {
  13819. return (fgui.UIPackage.createObject("game", "Component146_11"));
  13820. }
  13821. onConstruct() {
  13822. this.n89 = (this.getChild("n89"));
  13823. this.n90 = (this.getChild("n90"));
  13824. this.guideBtn = (this.getChild("guideBtn"));
  13825. }
  13826. }
  13827. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  13828. class ui_Component111_1 extends fgui.GComponent {
  13829. static createInstance() {
  13830. return (fgui.UIPackage.createObject("game", "Component111_1"));
  13831. }
  13832. onConstruct() {
  13833. this.n68 = (this.getChild("n68"));
  13834. this.myMask = (this.getChild("myMask"));
  13835. }
  13836. }
  13837. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  13838. class ui_Component64_1 extends fgui.GComponent {
  13839. static createInstance() {
  13840. return (fgui.UIPackage.createObject("game", "Component64_1"));
  13841. }
  13842. onConstruct() {
  13843. this.n57 = (this.getChild("n57"));
  13844. this.n54 = (this.getChild("n54"));
  13845. this.n55 = (this.getChild("n55"));
  13846. this.n56 = (this.getChild("n56"));
  13847. this.t1 = this.getTransition("t1");
  13848. }
  13849. }
  13850. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  13851. class ui_ModeSelection_com123 extends fgui.GComponent {
  13852. static createInstance() {
  13853. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  13854. }
  13855. onConstruct() {
  13856. this.type1 = (this.getChild("type1"));
  13857. this.type2 = (this.getChild("type2"));
  13858. this.type3 = (this.getChild("type3"));
  13859. this.n38 = (this.getChild("n38"));
  13860. this.t0 = this.getTransition("t0");
  13861. }
  13862. }
  13863. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  13864. class ui_Component132_2 extends fgui.GComponent {
  13865. static createInstance() {
  13866. return (fgui.UIPackage.createObject("game", "Component132_2"));
  13867. }
  13868. onConstruct() {
  13869. this.n25 = (this.getChild("n25"));
  13870. this.n26 = (this.getChild("n26"));
  13871. this.n27 = (this.getChild("n27"));
  13872. this.t0 = this.getTransition("t0");
  13873. }
  13874. }
  13875. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  13876. class ui_UIPower$1 extends fgui.GComponent {
  13877. static createInstance() {
  13878. return (fgui.UIPackage.createObject("game", "UIPower"));
  13879. }
  13880. onConstruct() {
  13881. this.n11 = (this.getChild("n11"));
  13882. this.myNode = (this.getChild("myNode"));
  13883. this.t0 = this.getTransition("t0");
  13884. }
  13885. }
  13886. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  13887. class ui_Component133 extends fgui.GComponent {
  13888. static createInstance() {
  13889. return (fgui.UIPackage.createObject("game", "Component133"));
  13890. }
  13891. onConstruct() {
  13892. this.n29 = (this.getChild("n29"));
  13893. this.n30 = (this.getChild("n30"));
  13894. }
  13895. }
  13896. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  13897. class ui_Component134 extends fgui.GComponent {
  13898. static createInstance() {
  13899. return (fgui.UIPackage.createObject("game", "Component134"));
  13900. }
  13901. onConstruct() {
  13902. this.n30 = (this.getChild("n30"));
  13903. this.n31 = (this.getChild("n31"));
  13904. this.t0 = this.getTransition("t0");
  13905. }
  13906. }
  13907. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  13908. class ui_Component135 extends fgui.GComponent {
  13909. static createInstance() {
  13910. return (fgui.UIPackage.createObject("game", "Component135"));
  13911. }
  13912. onConstruct() {
  13913. this.n30 = (this.getChild("n30"));
  13914. this.t0 = this.getTransition("t0");
  13915. }
  13916. }
  13917. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  13918. class ui_Component137 extends fgui.GComponent {
  13919. static createInstance() {
  13920. return (fgui.UIPackage.createObject("game", "Component137"));
  13921. }
  13922. onConstruct() {
  13923. this.n28 = (this.getChild("n28"));
  13924. this.n29 = (this.getChild("n29"));
  13925. this.n30 = (this.getChild("n30"));
  13926. this.n32 = (this.getChild("n32"));
  13927. }
  13928. }
  13929. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  13930. class ui_dh_zuanshi extends fgui.GButton {
  13931. static createInstance() {
  13932. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  13933. }
  13934. onConstruct() {
  13935. this.n1 = (this.getChild("n1"));
  13936. this.n2 = (this.getChild("n2"));
  13937. this.n0 = (this.getChild("n0"));
  13938. this.n3 = (this.getChild("n3"));
  13939. this.n4 = (this.getChild("n4"));
  13940. }
  13941. }
  13942. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  13943. class ui_Component138 extends fgui.GComponent {
  13944. static createInstance() {
  13945. return (fgui.UIPackage.createObject("game", "Component138"));
  13946. }
  13947. onConstruct() {
  13948. this.n1 = (this.getChild("n1"));
  13949. this.n2 = (this.getChild("n2"));
  13950. this.t0 = this.getTransition("t0");
  13951. }
  13952. }
  13953. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  13954. class ui_Component139 extends fgui.GComponent {
  13955. static createInstance() {
  13956. return (fgui.UIPackage.createObject("game", "Component139"));
  13957. }
  13958. onConstruct() {
  13959. this.n0 = (this.getChild("n0"));
  13960. this.t0 = this.getTransition("t0");
  13961. }
  13962. }
  13963. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  13964. class ui_Component140 extends fgui.GComponent {
  13965. static createInstance() {
  13966. return (fgui.UIPackage.createObject("game", "Component140"));
  13967. }
  13968. onConstruct() {
  13969. this.n2 = (this.getChild("n2"));
  13970. this.n3 = (this.getChild("n3"));
  13971. this.t0 = this.getTransition("t0");
  13972. }
  13973. }
  13974. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  13975. class ui_Component141 extends fgui.GComponent {
  13976. static createInstance() {
  13977. return (fgui.UIPackage.createObject("game", "Component141"));
  13978. }
  13979. onConstruct() {
  13980. this.n0 = (this.getChild("n0"));
  13981. this.t0 = this.getTransition("t0");
  13982. }
  13983. }
  13984. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  13985. class ui_powerNode extends fgui.GProgressBar {
  13986. static createInstance() {
  13987. return (fgui.UIPackage.createObject("game", "powerNode"));
  13988. }
  13989. onConstruct() {
  13990. this.n2 = (this.getChild("n2"));
  13991. this.bar_v = (this.getChild("bar_v"));
  13992. this.showImg = (this.getChild("showImg"));
  13993. this.n12 = (this.getChild("n12"));
  13994. }
  13995. }
  13996. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  13997. class ui_dh_jingbi1 extends fgui.GComponent {
  13998. static createInstance() {
  13999. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  14000. }
  14001. onConstruct() {
  14002. this.n0 = (this.getChild("n0"));
  14003. this.n1 = (this.getChild("n1"));
  14004. this.n2 = (this.getChild("n2"));
  14005. this.n3 = (this.getChild("n3"));
  14006. this.n4 = (this.getChild("n4"));
  14007. this.n5 = (this.getChild("n5"));
  14008. this.n6 = (this.getChild("n6"));
  14009. this.n8 = (this.getChild("n8"));
  14010. this.t0 = this.getTransition("t0");
  14011. }
  14012. }
  14013. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  14014. class ui_Component94 extends fgui.GButton {
  14015. static createInstance() {
  14016. return (fgui.UIPackage.createObject("game", "Component94"));
  14017. }
  14018. onConstruct() {
  14019. this.n77 = (this.getChild("n77"));
  14020. }
  14021. }
  14022. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  14023. class ui_Component95 extends fgui.GButton {
  14024. static createInstance() {
  14025. return (fgui.UIPackage.createObject("game", "Component95"));
  14026. }
  14027. onConstruct() {
  14028. this.n77 = (this.getChild("n77"));
  14029. }
  14030. }
  14031. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  14032. class ui_Component126 extends fgui.GComponent {
  14033. static createInstance() {
  14034. return (fgui.UIPackage.createObject("game", "Component126"));
  14035. }
  14036. onConstruct() {
  14037. this.c1 = this.getController("c1");
  14038. this.normalBtn = (this.getChild("normalBtn"));
  14039. this.tripleBtn = (this.getChild("tripleBtn"));
  14040. }
  14041. }
  14042. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  14043. class ui_Component60 extends fgui.GComponent {
  14044. static createInstance() {
  14045. return (fgui.UIPackage.createObject("game", "Component60"));
  14046. }
  14047. onConstruct() {
  14048. this.c1 = this.getController("c1");
  14049. this.n48 = (this.getChild("n48"));
  14050. this.womanTxt = (this.getChild("womanTxt"));
  14051. this.t0 = this.getTransition("t0");
  14052. }
  14053. }
  14054. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  14055. class ui_Component98_3 extends fgui.GButton {
  14056. static createInstance() {
  14057. return (fgui.UIPackage.createObject("game", "Component98_3"));
  14058. }
  14059. onConstruct() {
  14060. this.c1 = this.getController("c1");
  14061. this.n8 = (this.getChild("n8"));
  14062. this.n41 = (this.getChild("n41"));
  14063. this.n40 = (this.getChild("n40"));
  14064. }
  14065. }
  14066. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  14067. class ui_ModeSelection_com1 extends fgui.GButton {
  14068. static createInstance() {
  14069. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  14070. }
  14071. onConstruct() {
  14072. this.n34 = (this.getChild("n34"));
  14073. this.n36 = (this.getChild("n36"));
  14074. this.n22 = (this.getChild("n22"));
  14075. this.n20 = (this.getChild("n20"));
  14076. this.n23 = (this.getChild("n23"));
  14077. this.n24 = (this.getChild("n24"));
  14078. this.n26 = (this.getChild("n26"));
  14079. this.n33 = (this.getChild("n33"));
  14080. this.coinImg = (this.getChild("coinImg"));
  14081. this.need = (this.getChild("need"));
  14082. this.n35 = (this.getChild("n35"));
  14083. this.n29 = (this.getChild("n29"));
  14084. this.tipsTxt = (this.getChild("tipsTxt"));
  14085. this.n30 = (this.getChild("n30"));
  14086. this.peopleTxt = (this.getChild("peopleTxt"));
  14087. this.t0 = this.getTransition("t0");
  14088. }
  14089. }
  14090. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  14091. class ui_ModeSelection_com2 extends fgui.GButton {
  14092. static createInstance() {
  14093. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  14094. }
  14095. onConstruct() {
  14096. this.n36 = (this.getChild("n36"));
  14097. this.n34 = (this.getChild("n34"));
  14098. this.n22 = (this.getChild("n22"));
  14099. this.n20 = (this.getChild("n20"));
  14100. this.n23 = (this.getChild("n23"));
  14101. this.n24 = (this.getChild("n24"));
  14102. this.n26 = (this.getChild("n26"));
  14103. this.n33 = (this.getChild("n33"));
  14104. this.coinImg = (this.getChild("coinImg"));
  14105. this.need = (this.getChild("need"));
  14106. this.n35 = (this.getChild("n35"));
  14107. this.n29 = (this.getChild("n29"));
  14108. this.tipsTxt = (this.getChild("tipsTxt"));
  14109. this.n30 = (this.getChild("n30"));
  14110. this.peopleTxt = (this.getChild("peopleTxt"));
  14111. this.t0 = this.getTransition("t0");
  14112. }
  14113. }
  14114. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  14115. class ui_ModeSelection_com3 extends fgui.GButton {
  14116. static createInstance() {
  14117. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  14118. }
  14119. onConstruct() {
  14120. this.n34 = (this.getChild("n34"));
  14121. this.n36 = (this.getChild("n36"));
  14122. this.n22 = (this.getChild("n22"));
  14123. this.n20 = (this.getChild("n20"));
  14124. this.n23 = (this.getChild("n23"));
  14125. this.n24 = (this.getChild("n24"));
  14126. this.n26 = (this.getChild("n26"));
  14127. this.n33 = (this.getChild("n33"));
  14128. this.coinImg = (this.getChild("coinImg"));
  14129. this.need = (this.getChild("need"));
  14130. this.n35 = (this.getChild("n35"));
  14131. this.n29 = (this.getChild("n29"));
  14132. this.tipsTxt = (this.getChild("tipsTxt"));
  14133. this.n30 = (this.getChild("n30"));
  14134. this.peopleTxt = (this.getChild("peopleTxt"));
  14135. this.t0 = this.getTransition("t0");
  14136. }
  14137. }
  14138. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  14139. class ui_Invitation_com1 extends fgui.GComponent {
  14140. static createInstance() {
  14141. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  14142. }
  14143. onConstruct() {
  14144. this.n14 = (this.getChild("n14"));
  14145. this.n13 = (this.getChild("n13"));
  14146. this.n3 = (this.getChild("n3"));
  14147. this.n1 = (this.getChild("n1"));
  14148. this.n6 = (this.getChild("n6"));
  14149. this.n7 = (this.getChild("n7"));
  14150. this.enterBtn = (this.getChild("enterBtn"));
  14151. this.n11 = (this.getChild("n11"));
  14152. this.n12 = (this.getChild("n12"));
  14153. this.n15 = (this.getChild("n15"));
  14154. this.t0 = this.getTransition("t0");
  14155. this.t1 = this.getTransition("t1");
  14156. }
  14157. }
  14158. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  14159. class ui_Component87_1 extends fgui.GComponent {
  14160. static createInstance() {
  14161. return (fgui.UIPackage.createObject("game", "Component87_1"));
  14162. }
  14163. onConstruct() {
  14164. this.n74 = (this.getChild("n74"));
  14165. this.n73 = (this.getChild("n73"));
  14166. this.ballTxt = (this.getChild("ballTxt"));
  14167. this.n76 = (this.getChild("n76"));
  14168. this.helpLineBtn = (this.getChild("helpLineBtn"));
  14169. this.levelTxt = (this.getChild("levelTxt"));
  14170. this.n87 = (this.getChild("n87"));
  14171. this.n84 = (this.getChild("n84"));
  14172. this.hpTxt = (this.getChild("hpTxt"));
  14173. this.n89 = (this.getChild("n89"));
  14174. this.tipsTxt = (this.getChild("tipsTxt"));
  14175. }
  14176. }
  14177. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  14178. class ui_sqg1 extends fgui.GComponent {
  14179. static createInstance() {
  14180. return (fgui.UIPackage.createObject("game", "sqg1"));
  14181. }
  14182. onConstruct() {
  14183. this.n1 = (this.getChild("n1"));
  14184. this.n0 = (this.getChild("n0"));
  14185. }
  14186. }
  14187. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  14188. class ui_sqg2 extends fgui.GComponent {
  14189. static createInstance() {
  14190. return (fgui.UIPackage.createObject("game", "sqg2"));
  14191. }
  14192. onConstruct() {
  14193. this.n1 = (this.getChild("n1"));
  14194. this.n0 = (this.getChild("n0"));
  14195. }
  14196. }
  14197. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  14198. class ui_sqg3 extends fgui.GComponent {
  14199. static createInstance() {
  14200. return (fgui.UIPackage.createObject("game", "sqg3"));
  14201. }
  14202. onConstruct() {
  14203. this.n1 = (this.getChild("n1"));
  14204. this.n0 = (this.getChild("n0"));
  14205. }
  14206. }
  14207. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  14208. class ui_sqg4 extends fgui.GComponent {
  14209. static createInstance() {
  14210. return (fgui.UIPackage.createObject("game", "sqg4"));
  14211. }
  14212. onConstruct() {
  14213. this.n1 = (this.getChild("n1"));
  14214. this.n0 = (this.getChild("n0"));
  14215. }
  14216. }
  14217. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  14218. class ui_Component36 extends fgui.GButton {
  14219. static createInstance() {
  14220. return (fgui.UIPackage.createObject("game", "Component36"));
  14221. }
  14222. onConstruct() {
  14223. this.c1 = this.getController("c1");
  14224. this.n53 = (this.getChild("n53"));
  14225. this.n56 = (this.getChild("n56"));
  14226. }
  14227. }
  14228. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  14229. class ui_Component37 extends fgui.GButton {
  14230. static createInstance() {
  14231. return (fgui.UIPackage.createObject("game", "Component37"));
  14232. }
  14233. onConstruct() {
  14234. this.c1 = this.getController("c1");
  14235. this.n52 = (this.getChild("n52"));
  14236. this.n54 = (this.getChild("n54"));
  14237. }
  14238. }
  14239. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  14240. class ui_UISetting extends fgui.GComponent {
  14241. static createInstance() {
  14242. return (fgui.UIPackage.createObject("game", "UISetting"));
  14243. }
  14244. onConstruct() {
  14245. this.c1 = this.getController("c1");
  14246. this.n4 = (this.getChild("n4"));
  14247. this.soundBtn = (this.getChild("soundBtn"));
  14248. this.shakeBtn = (this.getChild("shakeBtn"));
  14249. this.clickNode = (this.getChild("clickNode"));
  14250. this.xyBtn = (this.getChild("xyBtn"));
  14251. }
  14252. }
  14253. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  14254. class ui_Component39 extends fgui.GComponent {
  14255. static createInstance() {
  14256. return (fgui.UIPackage.createObject("game", "Component39"));
  14257. }
  14258. onConstruct() {
  14259. this.n5 = (this.getChild("n5"));
  14260. this.n6 = (this.getChild("n6"));
  14261. this.n7 = (this.getChild("n7"));
  14262. this.t0 = this.getTransition("t0");
  14263. }
  14264. }
  14265. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  14266. class ui_Component40 extends fgui.GButton {
  14267. static createInstance() {
  14268. return (fgui.UIPackage.createObject("game", "Component40"));
  14269. }
  14270. onConstruct() {
  14271. this.n46 = (this.getChild("n46"));
  14272. this.n47 = (this.getChild("n47"));
  14273. }
  14274. }
  14275. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  14276. class ui_Component41 extends fgui.GComponent {
  14277. static createInstance() {
  14278. return (fgui.UIPackage.createObject("game", "Component41"));
  14279. }
  14280. onConstruct() {
  14281. this.c1 = this.getController("c1");
  14282. this.n0 = (this.getChild("n0"));
  14283. this.titleTxt = (this.getChild("titleTxt"));
  14284. this.n2 = (this.getChild("n2"));
  14285. this.msgTips = (this.getChild("msgTips"));
  14286. this.numTxt = (this.getChild("numTxt"));
  14287. this.n18 = (this.getChild("n18"));
  14288. this.cancelBtn = (this.getChild("cancelBtn"));
  14289. this.videoBtn = (this.getChild("videoBtn"));
  14290. this.n10 = (this.getChild("n10"));
  14291. }
  14292. }
  14293. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  14294. class ui_Component42 extends fgui.GComponent {
  14295. static createInstance() {
  14296. return (fgui.UIPackage.createObject("game", "Component42"));
  14297. }
  14298. onConstruct() {
  14299. this.c1 = this.getController("c1");
  14300. this.n1 = (this.getChild("n1"));
  14301. this.n2 = (this.getChild("n2"));
  14302. this.n3 = (this.getChild("n3"));
  14303. this.tipsTxt = (this.getChild("tipsTxt"));
  14304. this.cancelBtn = (this.getChild("cancelBtn"));
  14305. this.sureBtn = (this.getChild("sureBtn"));
  14306. this.n11 = (this.getChild("n11"));
  14307. this.n13 = (this.getChild("n13"));
  14308. this.n14 = (this.getChild("n14"));
  14309. this.womanTxt = (this.getChild("womanTxt"));
  14310. this.t0 = this.getTransition("t0");
  14311. }
  14312. }
  14313. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  14314. class ui_dh_js_shengli extends fgui.GComponent {
  14315. static createInstance() {
  14316. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  14317. }
  14318. onConstruct() {
  14319. this.n3 = (this.getChild("n3"));
  14320. this.n4 = (this.getChild("n4"));
  14321. this.n1 = (this.getChild("n1"));
  14322. this.n2 = (this.getChild("n2"));
  14323. this.n5 = (this.getChild("n5"));
  14324. this.n6 = (this.getChild("n6"));
  14325. this.n7 = (this.getChild("n7"));
  14326. this.n8 = (this.getChild("n8"));
  14327. this.attack = this.getTransition("attack");
  14328. this.idle = this.getTransition("idle");
  14329. }
  14330. }
  14331. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  14332. class ui_dh_js_shengli_g extends fgui.GComponent {
  14333. static createInstance() {
  14334. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  14335. }
  14336. onConstruct() {
  14337. this.n3 = (this.getChild("n3"));
  14338. this.n1 = (this.getChild("n1"));
  14339. this.t0 = this.getTransition("t0");
  14340. }
  14341. }
  14342. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  14343. class ui_dh_js_shibai extends fgui.GComponent {
  14344. static createInstance() {
  14345. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  14346. }
  14347. onConstruct() {
  14348. this.n0 = (this.getChild("n0"));
  14349. this.n1 = (this.getChild("n1"));
  14350. this.n2 = (this.getChild("n2"));
  14351. this.n3 = (this.getChild("n3"));
  14352. this.idle = this.getTransition("idle");
  14353. this.attack = this.getTransition("attack");
  14354. }
  14355. }
  14356. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  14357. class ui_dh_zy_ganfa extends fgui.GButton {
  14358. static createInstance() {
  14359. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  14360. }
  14361. onConstruct() {
  14362. this.n0 = (this.getChild("n0"));
  14363. }
  14364. }
  14365. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  14366. class ui_dh_zy_sc_guang extends fgui.GButton {
  14367. static createInstance() {
  14368. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  14369. }
  14370. onConstruct() {
  14371. this.n0 = (this.getChild("n0"));
  14372. this.n2 = (this.getChild("n2"));
  14373. }
  14374. }
  14375. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  14376. class ui_dh_zy_shangcheng extends fgui.GComponent {
  14377. static createInstance() {
  14378. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  14379. }
  14380. onConstruct() {
  14381. this.n0 = (this.getChild("n0"));
  14382. this.n3 = (this.getChild("n3"));
  14383. this.t0 = this.getTransition("t0");
  14384. }
  14385. }
  14386. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  14387. class ui_dh_zy_wanfa extends fgui.GButton {
  14388. static createInstance() {
  14389. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  14390. }
  14391. onConstruct() {
  14392. this.n0 = (this.getChild("n0"));
  14393. }
  14394. }
  14395. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  14396. class ui_Button_login extends fgui.GButton {
  14397. static createInstance() {
  14398. return (fgui.UIPackage.createObject("game", "Button_login"));
  14399. }
  14400. onConstruct() {
  14401. this.button = this.getController("button");
  14402. this.n5 = (this.getChild("n5"));
  14403. this.n3 = (this.getChild("n3"));
  14404. }
  14405. }
  14406. ui_Button_login.URL = "ui://isxx5ak7nnz5v587";
  14407. class ui_Component53_1 extends fgui.GComponent {
  14408. static createInstance() {
  14409. return (fgui.UIPackage.createObject("game", "Component53_1"));
  14410. }
  14411. onConstruct() {
  14412. this.n0 = (this.getChild("n0"));
  14413. this.n1 = (this.getChild("n1"));
  14414. this.n2 = (this.getChild("n2"));
  14415. this.n3 = (this.getChild("n3"));
  14416. this.n4 = (this.getChild("n4"));
  14417. this.n5 = (this.getChild("n5"));
  14418. this.n6 = (this.getChild("n6"));
  14419. this.n7 = (this.getChild("n7"));
  14420. this.n8 = (this.getChild("n8"));
  14421. this.n9 = (this.getChild("n9"));
  14422. this.n10 = (this.getChild("n10"));
  14423. this.n11 = (this.getChild("n11"));
  14424. this.n12 = (this.getChild("n12"));
  14425. this.n13 = (this.getChild("n13"));
  14426. this.n14 = (this.getChild("n14"));
  14427. this.n15 = (this.getChild("n15"));
  14428. this.n16 = (this.getChild("n16"));
  14429. this.n19 = (this.getChild("n19"));
  14430. this.n20 = (this.getChild("n20"));
  14431. this.n21 = (this.getChild("n21"));
  14432. this.n22 = (this.getChild("n22"));
  14433. this.n23 = (this.getChild("n23"));
  14434. this.n24 = (this.getChild("n24"));
  14435. this.n25 = (this.getChild("n25"));
  14436. this.n26 = (this.getChild("n26"));
  14437. this.n27 = (this.getChild("n27"));
  14438. this.n28 = (this.getChild("n28"));
  14439. this.n29 = (this.getChild("n29"));
  14440. this.n30 = (this.getChild("n30"));
  14441. this.n31 = (this.getChild("n31"));
  14442. this.n32 = (this.getChild("n32"));
  14443. this.n33 = (this.getChild("n33"));
  14444. this.n34 = (this.getChild("n34"));
  14445. this.n35 = (this.getChild("n35"));
  14446. this.t0 = this.getTransition("t0");
  14447. }
  14448. }
  14449. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  14450. class ui_Component30 extends fgui.GComponent {
  14451. static createInstance() {
  14452. return (fgui.UIPackage.createObject("game", "Component30"));
  14453. }
  14454. onConstruct() {
  14455. this.c1 = this.getController("c1");
  14456. this.n46 = (this.getChild("n46"));
  14457. this.n47 = (this.getChild("n47"));
  14458. this.numTxt = (this.getChild("numTxt"));
  14459. this.n50 = (this.getChild("n50"));
  14460. this.n53 = (this.getChild("n53"));
  14461. this.n54 = (this.getChild("n54"));
  14462. this.n55 = (this.getChild("n55"));
  14463. this.n56 = (this.getChild("n56"));
  14464. }
  14465. }
  14466. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  14467. class ui_Component30_1 extends fgui.GComponent {
  14468. static createInstance() {
  14469. return (fgui.UIPackage.createObject("game", "Component30_1"));
  14470. }
  14471. onConstruct() {
  14472. this.c1 = this.getController("c1");
  14473. this.n46 = (this.getChild("n46"));
  14474. this.n47 = (this.getChild("n47"));
  14475. this.numTxt = (this.getChild("numTxt"));
  14476. this.n50 = (this.getChild("n50"));
  14477. this.n51 = (this.getChild("n51"));
  14478. this.n52 = (this.getChild("n52"));
  14479. this.n53 = (this.getChild("n53"));
  14480. this.n54 = (this.getChild("n54"));
  14481. }
  14482. }
  14483. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  14484. class ui_Component31 extends fgui.GComponent {
  14485. static createInstance() {
  14486. return (fgui.UIPackage.createObject("game", "Component31"));
  14487. }
  14488. onConstruct() {
  14489. this.n55 = (this.getChild("n55"));
  14490. this.n54 = (this.getChild("n54"));
  14491. this.conditionTxt = (this.getChild("conditionTxt"));
  14492. this.n57 = (this.getChild("n57"));
  14493. this.t0 = this.getTransition("t0");
  14494. }
  14495. }
  14496. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  14497. class ui_Component32 extends fgui.GComponent {
  14498. static createInstance() {
  14499. return (fgui.UIPackage.createObject("game", "Component32"));
  14500. }
  14501. onConstruct() {
  14502. this.n5 = (this.getChild("n5"));
  14503. this.n6 = (this.getChild("n6"));
  14504. this.n7 = (this.getChild("n7"));
  14505. this.t0 = this.getTransition("t0");
  14506. }
  14507. }
  14508. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  14509. class ui_AwardItem extends fgui.GComponent {
  14510. static createInstance() {
  14511. return (fgui.UIPackage.createObject("game", "AwardItem"));
  14512. }
  14513. onConstruct() {
  14514. this.n9 = (this.getChild("n9"));
  14515. this.myIcon = (this.getChild("myIcon"));
  14516. this.numTxt = (this.getChild("numTxt"));
  14517. this.nameTxt = (this.getChild("nameTxt"));
  14518. this.n16 = (this.getChild("n16"));
  14519. this.n17 = (this.getChild("n17"));
  14520. }
  14521. }
  14522. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  14523. class ui_ranking_com1 extends fgui.GButton {
  14524. static createInstance() {
  14525. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  14526. }
  14527. onConstruct() {
  14528. this.c1 = this.getController("c1");
  14529. this.n49 = (this.getChild("n49"));
  14530. this.n18 = (this.getChild("n18"));
  14531. this.n46 = (this.getChild("n46"));
  14532. this.n48 = (this.getChild("n48"));
  14533. this.n50 = (this.getChild("n50"));
  14534. }
  14535. }
  14536. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  14537. class ui_ranking_com2 extends fgui.GButton {
  14538. static createInstance() {
  14539. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  14540. }
  14541. onConstruct() {
  14542. this.c1 = this.getController("c1");
  14543. this.n49 = (this.getChild("n49"));
  14544. this.n18 = (this.getChild("n18"));
  14545. this.n46 = (this.getChild("n46"));
  14546. this.n48 = (this.getChild("n48"));
  14547. this.n50 = (this.getChild("n50"));
  14548. }
  14549. }
  14550. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  14551. class ui_ranking_com3 extends fgui.GComponent {
  14552. static createInstance() {
  14553. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  14554. }
  14555. onConstruct() {
  14556. this.n17 = (this.getChild("n17"));
  14557. this.myIcon = (this.getChild("myIcon"));
  14558. }
  14559. }
  14560. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  14561. class ui_ranking_com4 extends fgui.GComponent {
  14562. static createInstance() {
  14563. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  14564. }
  14565. onConstruct() {
  14566. this.n16 = (this.getChild("n16"));
  14567. this.head = (this.getChild("head"));
  14568. }
  14569. }
  14570. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  14571. class ui_ranking_com5 extends fgui.GComponent {
  14572. static createInstance() {
  14573. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  14574. }
  14575. onConstruct() {
  14576. this.c1 = this.getController("c1");
  14577. this.c2 = this.getController("c2");
  14578. this.n2 = (this.getChild("n2"));
  14579. this.n3 = (this.getChild("n3"));
  14580. this.levelBtn = (this.getChild("levelBtn"));
  14581. this.starBtn = (this.getChild("starBtn"));
  14582. this.n23 = (this.getChild("n23"));
  14583. this.n24 = (this.getChild("n24"));
  14584. this.n25 = (this.getChild("n25"));
  14585. this.myList = (this.getChild("myList"));
  14586. this.selfNode = (this.getChild("selfNode"));
  14587. this.n9 = (this.getChild("n9"));
  14588. this.n12 = (this.getChild("n12"));
  14589. this.n13 = (this.getChild("n13"));
  14590. this.n14 = (this.getChild("n14"));
  14591. this.n39 = (this.getChild("n39"));
  14592. this.n41 = (this.getChild("n41"));
  14593. this.n42 = (this.getChild("n42"));
  14594. this.n45 = (this.getChild("n45"));
  14595. this.changeBtn = (this.getChild("changeBtn"));
  14596. this.closeBtn = (this.getChild("closeBtn"));
  14597. this.t0 = this.getTransition("t0");
  14598. }
  14599. }
  14600. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  14601. class ui_RankItem extends fgui.GComponent {
  14602. static createInstance() {
  14603. return (fgui.UIPackage.createObject("game", "RankItem"));
  14604. }
  14605. onConstruct() {
  14606. this.n10 = (this.getChild("n10"));
  14607. this.n11 = (this.getChild("n11"));
  14608. this.rankTxt = (this.getChild("rankTxt"));
  14609. this.headNode = (this.getChild("headNode"));
  14610. this.nameTxt = (this.getChild("nameTxt"));
  14611. this.n19 = (this.getChild("n19"));
  14612. this.valueTxt = (this.getChild("valueTxt"));
  14613. this.img1 = (this.getChild("img1"));
  14614. this.img2 = (this.getChild("img2"));
  14615. this.img3 = (this.getChild("img3"));
  14616. }
  14617. }
  14618. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  14619. class ui_ranking_com9 extends fgui.GComponent {
  14620. static createInstance() {
  14621. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  14622. }
  14623. onConstruct() {
  14624. this.c1 = this.getController("c1");
  14625. this.n27 = (this.getChild("n27"));
  14626. this.n28 = (this.getChild("n28"));
  14627. this.headNode = (this.getChild("headNode"));
  14628. this.rankTxt = (this.getChild("rankTxt"));
  14629. this.nameTxt = (this.getChild("nameTxt"));
  14630. this.n34 = (this.getChild("n34"));
  14631. this.valueTxt = (this.getChild("valueTxt"));
  14632. this.n36 = (this.getChild("n36"));
  14633. this.n37 = (this.getChild("n37"));
  14634. this.n38 = (this.getChild("n38"));
  14635. this.n39 = (this.getChild("n39"));
  14636. this.n40 = (this.getChild("n40"));
  14637. }
  14638. }
  14639. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  14640. class ui_ranking_com10 extends fgui.GComponent {
  14641. static createInstance() {
  14642. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  14643. }
  14644. onConstruct() {
  14645. this.n23 = (this.getChild("n23"));
  14646. this.n24 = (this.getChild("n24"));
  14647. }
  14648. }
  14649. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  14650. class ui_ranking_com11 extends fgui.GComponent {
  14651. static createInstance() {
  14652. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  14653. }
  14654. onConstruct() {
  14655. this.n24 = (this.getChild("n24"));
  14656. this.n25 = (this.getChild("n25"));
  14657. this.t0 = this.getTransition("t0");
  14658. }
  14659. }
  14660. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  14661. class ui_ranking_com13 extends fgui.GButton {
  14662. static createInstance() {
  14663. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  14664. }
  14665. onConstruct() {
  14666. this.c1 = this.getController("c1");
  14667. this.n44 = (this.getChild("n44"));
  14668. this.n45 = (this.getChild("n45"));
  14669. this.n46 = (this.getChild("n46"));
  14670. }
  14671. }
  14672. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  14673. class ui_Component_dl_zc extends fgui.GButton {
  14674. static createInstance() {
  14675. return (fgui.UIPackage.createObject("game", "Component_dl_zc"));
  14676. }
  14677. onConstruct() {
  14678. this.c1 = this.getController("c1");
  14679. this.n0 = (this.getChild("n0"));
  14680. }
  14681. }
  14682. ui_Component_dl_zc.URL = "ui://isxx5ak7p8p3v58c";
  14683. class ui_Component122 extends fgui.GComponent {
  14684. static createInstance() {
  14685. return (fgui.UIPackage.createObject("game", "Component122"));
  14686. }
  14687. onConstruct() {
  14688. this.gameNode3 = (this.getChild("gameNode3"));
  14689. }
  14690. }
  14691. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  14692. class ui_skillItem extends fgui.GComponent {
  14693. static createInstance() {
  14694. return (fgui.UIPackage.createObject("game", "skillItem"));
  14695. }
  14696. onConstruct() {
  14697. this.c1 = this.getController("c1");
  14698. this.n31 = (this.getChild("n31"));
  14699. this.n6 = (this.getChild("n6"));
  14700. this.skillImg = (this.getChild("skillImg"));
  14701. this.nameTxt = (this.getChild("nameTxt"));
  14702. this.levelTxt = (this.getChild("levelTxt"));
  14703. this.n28 = (this.getChild("n28"));
  14704. this.describeTxt = (this.getChild("describeTxt"));
  14705. this.n32 = (this.getChild("n32"));
  14706. this.mutiBtn = (this.getChild("mutiBtn"));
  14707. this.tryNode = (this.getChild("tryNode"));
  14708. this.normalBtn = (this.getChild("normalBtn"));
  14709. this.startBtn = (this.getChild("startBtn"));
  14710. this.n42 = (this.getChild("n42"));
  14711. this.n43 = (this.getChild("n43"));
  14712. this.n44 = (this.getChild("n44"));
  14713. }
  14714. }
  14715. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  14716. class ui_Component26 extends fgui.GButton {
  14717. static createInstance() {
  14718. return (fgui.UIPackage.createObject("game", "Component26"));
  14719. }
  14720. onConstruct() {
  14721. this.n11 = (this.getChild("n11"));
  14722. this.n30 = (this.getChild("n30"));
  14723. this.n34 = (this.getChild("n34"));
  14724. }
  14725. }
  14726. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  14727. class ui_Component28 extends fgui.GButton {
  14728. static createInstance() {
  14729. return (fgui.UIPackage.createObject("game", "Component28"));
  14730. }
  14731. onConstruct() {
  14732. this.n12 = (this.getChild("n12"));
  14733. this.n31 = (this.getChild("n31"));
  14734. this.curTxt = (this.getChild("curTxt"));
  14735. this.n33 = (this.getChild("n33"));
  14736. }
  14737. }
  14738. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  14739. class ui_Component1302 extends fgui.GComponent {
  14740. static createInstance() {
  14741. return (fgui.UIPackage.createObject("game", "Component1302"));
  14742. }
  14743. onConstruct() {
  14744. this.n2 = (this.getChild("n2"));
  14745. this.n3 = (this.getChild("n3"));
  14746. }
  14747. }
  14748. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  14749. class ui_Component113 extends fgui.GComponent {
  14750. static createInstance() {
  14751. return (fgui.UIPackage.createObject("game", "Component113"));
  14752. }
  14753. onConstruct() {
  14754. this.n85 = (this.getChild("n85"));
  14755. this.n86 = (this.getChild("n86"));
  14756. this.n77 = (this.getChild("n77"));
  14757. this.n79 = (this.getChild("n79"));
  14758. this.n80 = (this.getChild("n80"));
  14759. this.n81 = (this.getChild("n81"));
  14760. this.n82 = (this.getChild("n82"));
  14761. this.n84 = (this.getChild("n84"));
  14762. this.n87 = (this.getChild("n87"));
  14763. this.t0 = this.getTransition("t0");
  14764. }
  14765. }
  14766. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  14767. class ui_Component114 extends fgui.GComponent {
  14768. static createInstance() {
  14769. return (fgui.UIPackage.createObject("game", "Component114"));
  14770. }
  14771. onConstruct() {
  14772. this.n77 = (this.getChild("n77"));
  14773. this.t0 = this.getTransition("t0");
  14774. }
  14775. }
  14776. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  14777. class ui_Component115 extends fgui.GComponent {
  14778. static createInstance() {
  14779. return (fgui.UIPackage.createObject("game", "Component115"));
  14780. }
  14781. onConstruct() {
  14782. this.n83 = (this.getChild("n83"));
  14783. this.fingerNode = (this.getChild("fingerNode"));
  14784. this.n84 = (this.getChild("n84"));
  14785. }
  14786. }
  14787. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  14788. class ui_Component117 extends fgui.GComponent {
  14789. static createInstance() {
  14790. return (fgui.UIPackage.createObject("game", "Component117"));
  14791. }
  14792. onConstruct() {
  14793. this.n87 = (this.getChild("n87"));
  14794. this.n88 = (this.getChild("n88"));
  14795. this.n84 = (this.getChild("n84"));
  14796. this.n85 = (this.getChild("n85"));
  14797. this.n86 = (this.getChild("n86"));
  14798. this.t0 = this.getTransition("t0");
  14799. }
  14800. }
  14801. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  14802. class ui_Component98_1 extends fgui.GButton {
  14803. static createInstance() {
  14804. return (fgui.UIPackage.createObject("game", "Component98_1"));
  14805. }
  14806. onConstruct() {
  14807. this.c1 = this.getController("c1");
  14808. this.n8 = (this.getChild("n8"));
  14809. this.n41 = (this.getChild("n41"));
  14810. this.n40 = (this.getChild("n40"));
  14811. }
  14812. }
  14813. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  14814. class ui_Component61 extends fgui.GComponent {
  14815. static createInstance() {
  14816. return (fgui.UIPackage.createObject("game", "Component61"));
  14817. }
  14818. onConstruct() {
  14819. this.n14 = (this.getChild("n14"));
  14820. this.n6 = (this.getChild("n6"));
  14821. this.t0 = this.getTransition("t0");
  14822. }
  14823. }
  14824. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  14825. class ui_Component62 extends fgui.GComponent {
  14826. static createInstance() {
  14827. return (fgui.UIPackage.createObject("game", "Component62"));
  14828. }
  14829. onConstruct() {
  14830. this.n66 = (this.getChild("n66"));
  14831. this.n56 = (this.getChild("n56"));
  14832. this.n63 = (this.getChild("n63"));
  14833. this.n65 = (this.getChild("n65"));
  14834. this.t0 = this.getTransition("t0");
  14835. }
  14836. }
  14837. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  14838. class ui_d3Root extends fgui.GComponent {
  14839. static createInstance() {
  14840. return (fgui.UIPackage.createObject("game", "d3Root"));
  14841. }
  14842. onConstruct() {
  14843. }
  14844. }
  14845. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  14846. class ui_d2Root extends fgui.GComponent {
  14847. static createInstance() {
  14848. return (fgui.UIPackage.createObject("game", "d2Root"));
  14849. }
  14850. onConstruct() {
  14851. }
  14852. }
  14853. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  14854. class ui_ballNode extends fgui.GComponent {
  14855. static createInstance() {
  14856. return (fgui.UIPackage.createObject("game", "ballNode"));
  14857. }
  14858. onConstruct() {
  14859. }
  14860. }
  14861. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  14862. class ui_border extends fgui.GComponent {
  14863. static createInstance() {
  14864. return (fgui.UIPackage.createObject("game", "border"));
  14865. }
  14866. onConstruct() {
  14867. this.bar1 = (this.getChild("bar1"));
  14868. this.bar2 = (this.getChild("bar2"));
  14869. this.bar3 = (this.getChild("bar3"));
  14870. this.bar4 = (this.getChild("bar4"));
  14871. this.bar5 = (this.getChild("bar5"));
  14872. this.bar6 = (this.getChild("bar6"));
  14873. this.circle1 = (this.getChild("circle1"));
  14874. this.circle2 = (this.getChild("circle2"));
  14875. this.circle3 = (this.getChild("circle3"));
  14876. this.circle4 = (this.getChild("circle4"));
  14877. this.circle5 = (this.getChild("circle5"));
  14878. this.circle6 = (this.getChild("circle6"));
  14879. this.n28 = (this.getChild("n28"));
  14880. }
  14881. }
  14882. ui_border.URL = "ui://isxx5ak7sdh33qq";
  14883. class ui_btn_buy extends fgui.GButton {
  14884. static createInstance() {
  14885. return (fgui.UIPackage.createObject("game", "btn_buy"));
  14886. }
  14887. onConstruct() {
  14888. this.button = this.getController("button");
  14889. this.n0 = (this.getChild("n0"));
  14890. this.n1 = (this.getChild("n1"));
  14891. this.n2 = (this.getChild("n2"));
  14892. }
  14893. }
  14894. ui_btn_buy.URL = "ui://isxx5ak7so7lv596";
  14895. class ui_Component41_2 extends fgui.GComponent {
  14896. static createInstance() {
  14897. return (fgui.UIPackage.createObject("game", "Component41_2"));
  14898. }
  14899. onConstruct() {
  14900. this.c1 = this.getController("c1");
  14901. this.n0 = (this.getChild("n0"));
  14902. this.n2 = (this.getChild("n2"));
  14903. this.n19 = (this.getChild("n19"));
  14904. this.cancelBtn = (this.getChild("cancelBtn"));
  14905. this.videoBtn = (this.getChild("videoBtn"));
  14906. this.n9 = (this.getChild("n9"));
  14907. this.n22 = (this.getChild("n22"));
  14908. this.tipsTxt = (this.getChild("tipsTxt"));
  14909. this.n23 = (this.getChild("n23"));
  14910. this.n24 = (this.getChild("n24"));
  14911. this.n26 = (this.getChild("n26"));
  14912. this.n27 = (this.getChild("n27"));
  14913. this.titleTxt = (this.getChild("titleTxt"));
  14914. }
  14915. }
  14916. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  14917. class ui_Component41_1 extends fgui.GComponent {
  14918. static createInstance() {
  14919. return (fgui.UIPackage.createObject("game", "Component41_1"));
  14920. }
  14921. onConstruct() {
  14922. this.c1 = this.getController("c1");
  14923. this.n0 = (this.getChild("n0"));
  14924. this.n2 = (this.getChild("n2"));
  14925. this.cancelBtn = (this.getChild("cancelBtn"));
  14926. this.videoBtn = (this.getChild("videoBtn"));
  14927. this.n27 = (this.getChild("n27"));
  14928. this.n30 = (this.getChild("n30"));
  14929. this.n31 = (this.getChild("n31"));
  14930. this.n32 = (this.getChild("n32"));
  14931. this.n33 = (this.getChild("n33"));
  14932. this.n34 = (this.getChild("n34"));
  14933. this.n35 = (this.getChild("n35"));
  14934. this.n36 = (this.getChild("n36"));
  14935. this.n1 = (this.getChild("n1"));
  14936. this.n37 = (this.getChild("n37"));
  14937. this.t0 = this.getTransition("t0");
  14938. this.t1 = this.getTransition("t1");
  14939. this.t2 = this.getTransition("t2");
  14940. this.t3 = this.getTransition("t3");
  14941. }
  14942. }
  14943. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  14944. class ui_againBtn extends fgui.GButton {
  14945. static createInstance() {
  14946. return (fgui.UIPackage.createObject("game", "againBtn"));
  14947. }
  14948. onConstruct() {
  14949. this.n2 = (this.getChild("n2"));
  14950. this.n1 = (this.getChild("n1"));
  14951. this.n5 = (this.getChild("n5"));
  14952. }
  14953. }
  14954. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  14955. class ui_Component118 extends fgui.GButton {
  14956. static createInstance() {
  14957. return (fgui.UIPackage.createObject("game", "Component118"));
  14958. }
  14959. onConstruct() {
  14960. this.c1 = this.getController("c1");
  14961. this.n14 = (this.getChild("n14"));
  14962. this.n9 = (this.getChild("n9"));
  14963. this.n10 = (this.getChild("n10"));
  14964. this.diamondTxt = (this.getChild("diamondTxt"));
  14965. this.n13 = (this.getChild("n13"));
  14966. this.n15 = (this.getChild("n15"));
  14967. }
  14968. }
  14969. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  14970. class ui_Component119 extends fgui.GComponent {
  14971. static createInstance() {
  14972. return (fgui.UIPackage.createObject("game", "Component119"));
  14973. }
  14974. onConstruct() {
  14975. this.n1 = (this.getChild("n1"));
  14976. this.n2 = (this.getChild("n2"));
  14977. this.n13 = (this.getChild("n13"));
  14978. this.n6 = (this.getChild("n6"));
  14979. this.screenNode = (this.getChild("screenNode"));
  14980. this.n15 = (this.getChild("n15"));
  14981. this.closeBtn = (this.getChild("closeBtn"));
  14982. this.share2Btn = (this.getChild("share2Btn"));
  14983. this.shareBtn = (this.getChild("shareBtn"));
  14984. this.tipsNode = (this.getChild("tipsNode"));
  14985. this.awardNode = (this.getChild("awardNode"));
  14986. }
  14987. }
  14988. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  14989. class ui_daoJuDisplay extends fgui.GComponent {
  14990. static createInstance() {
  14991. return (fgui.UIPackage.createObject("game", "daoJuDisplay"));
  14992. }
  14993. onConstruct() {
  14994. this.n6 = (this.getChild("n6"));
  14995. this.n_jiaGe = (this.getChild("n_jiaGe"));
  14996. this.n_zuanShi = (this.getChild("n_zuanShi"));
  14997. this.btn_buy = (this.getChild("btn_buy"));
  14998. this.nameTxt = (this.getChild("nameTxt"));
  14999. this.zsImg = (this.getChild("zsImg"));
  15000. }
  15001. }
  15002. ui_daoJuDisplay.URL = "ui://isxx5ak7uel8v58m";
  15003. class ui_Component132_1 extends fgui.GComponent {
  15004. static createInstance() {
  15005. return (fgui.UIPackage.createObject("game", "Component132_1"));
  15006. }
  15007. onConstruct() {
  15008. this.n25 = (this.getChild("n25"));
  15009. this.n26 = (this.getChild("n26"));
  15010. this.n27 = (this.getChild("n27"));
  15011. this.t0 = this.getTransition("t0");
  15012. }
  15013. }
  15014. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  15015. class ui_SecretaryDisplay extends fgui.GComponent {
  15016. static createInstance() {
  15017. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  15018. }
  15019. onConstruct() {
  15020. this.n2 = (this.getChild("n2"));
  15021. this.levelTxt = (this.getChild("levelTxt"));
  15022. this.n4 = (this.getChild("n4"));
  15023. this.secretary = (this.getChild("secretary"));
  15024. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15025. this.n16 = (this.getChild("n16"));
  15026. this.n37 = (this.getChild("n37"));
  15027. this.n41 = (this.getChild("n41"));
  15028. this.n14 = (this.getChild("n14"));
  15029. this.n17 = (this.getChild("n17"));
  15030. this.heightTxt = (this.getChild("heightTxt"));
  15031. this.n46 = (this.getChild("n46"));
  15032. this.n36 = (this.getChild("n36"));
  15033. this.n38 = (this.getChild("n38"));
  15034. this.foodTxt = (this.getChild("foodTxt"));
  15035. this.n47 = (this.getChild("n47"));
  15036. this.n40 = (this.getChild("n40"));
  15037. this.n42 = (this.getChild("n42"));
  15038. this.historyTxt = (this.getChild("historyTxt"));
  15039. this.n48 = (this.getChild("n48"));
  15040. this.nameImg = (this.getChild("nameImg"));
  15041. this.n12 = (this.getChild("n12"));
  15042. this.n49 = (this.getChild("n49"));
  15043. this.t0 = this.getTransition("t0");
  15044. }
  15045. }
  15046. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  15047. class ui_BallRodDisplay extends fgui.GComponent {
  15048. static createInstance() {
  15049. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  15050. }
  15051. onConstruct() {
  15052. this.c1 = this.getController("c1");
  15053. this.n31 = (this.getChild("n31"));
  15054. this.n6 = (this.getChild("n6"));
  15055. this.nameTxt = (this.getChild("nameTxt"));
  15056. this.rodImg = (this.getChild("rodImg"));
  15057. this.levelNode = (this.getChild("levelNode"));
  15058. this.eftRod = (this.getChild("eftRod"));
  15059. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15060. }
  15061. }
  15062. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  15063. class ui_Component111_11 extends fgui.GComponent {
  15064. static createInstance() {
  15065. return (fgui.UIPackage.createObject("game", "Component111_11"));
  15066. }
  15067. onConstruct() {
  15068. this.n68 = (this.getChild("n68"));
  15069. this.n69 = (this.getChild("n69"));
  15070. }
  15071. }
  15072. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  15073. class ui_Component112 extends fgui.GComponent {
  15074. static createInstance() {
  15075. return (fgui.UIPackage.createObject("game", "Component112"));
  15076. }
  15077. onConstruct() {
  15078. this.n68 = (this.getChild("n68"));
  15079. this.n70 = (this.getChild("n70"));
  15080. this.myMask = (this.getChild("myMask"));
  15081. }
  15082. }
  15083. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  15084. class ui_Component111 extends fgui.GComponent {
  15085. static createInstance() {
  15086. return (fgui.UIPackage.createObject("game", "Component111"));
  15087. }
  15088. onConstruct() {
  15089. this.n68 = (this.getChild("n68"));
  15090. this.myMask = (this.getChild("myMask"));
  15091. }
  15092. }
  15093. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  15094. class ui_Component144 extends fgui.GButton {
  15095. static createInstance() {
  15096. return (fgui.UIPackage.createObject("game", "Component144"));
  15097. }
  15098. onConstruct() {
  15099. this.n8 = (this.getChild("n8"));
  15100. }
  15101. }
  15102. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  15103. class ui_Sign_com2 extends fgui.GComponent {
  15104. static createInstance() {
  15105. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  15106. }
  15107. onConstruct() {
  15108. this.n0 = (this.getChild("n0"));
  15109. this.n1 = (this.getChild("n1"));
  15110. this.t0 = this.getTransition("t0");
  15111. }
  15112. }
  15113. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  15114. class ui_Sign_guang extends fgui.GComponent {
  15115. static createInstance() {
  15116. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  15117. }
  15118. onConstruct() {
  15119. this.n1 = (this.getChild("n1"));
  15120. this.n2 = (this.getChild("n2"));
  15121. this.n3 = (this.getChild("n3"));
  15122. this.n4 = (this.getChild("n4"));
  15123. this.n5 = (this.getChild("n5"));
  15124. this.n6 = (this.getChild("n6"));
  15125. this.n8 = (this.getChild("n8"));
  15126. }
  15127. }
  15128. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  15129. class ui_SignMax extends fgui.GComponent {
  15130. static createInstance() {
  15131. return (fgui.UIPackage.createObject("game", "SignMax"));
  15132. }
  15133. onConstruct() {
  15134. this.c1 = this.getController("c1");
  15135. this.n7 = (this.getChild("n7"));
  15136. this.n15 = (this.getChild("n15"));
  15137. this.n8 = (this.getChild("n8"));
  15138. this.titleTxt = (this.getChild("titleTxt"));
  15139. this.myIcon1 = (this.getChild("myIcon1"));
  15140. this.numTxt1 = (this.getChild("numTxt1"));
  15141. this.myIcon2 = (this.getChild("myIcon2"));
  15142. this.n20 = (this.getChild("n20"));
  15143. this.n17 = (this.getChild("n17"));
  15144. this.numTxt2 = (this.getChild("numTxt2"));
  15145. this.n12 = (this.getChild("n12"));
  15146. this.n13 = (this.getChild("n13"));
  15147. this.n21 = (this.getChild("n21"));
  15148. this.n14 = (this.getChild("n14"));
  15149. }
  15150. }
  15151. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  15152. class ui_Sign_com2_1 extends fgui.GComponent {
  15153. static createInstance() {
  15154. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  15155. }
  15156. onConstruct() {
  15157. this.n0 = (this.getChild("n0"));
  15158. this.n1 = (this.getChild("n1"));
  15159. this.t0 = this.getTransition("t0");
  15160. }
  15161. }
  15162. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  15163. class ui_Sign_com5 extends fgui.GComponent {
  15164. static createInstance() {
  15165. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  15166. }
  15167. onConstruct() {
  15168. this.n3 = (this.getChild("n3"));
  15169. this.n29 = (this.getChild("n29"));
  15170. this.n4 = (this.getChild("n4"));
  15171. this.day1 = (this.getChild("day1"));
  15172. this.day2 = (this.getChild("day2"));
  15173. this.day3 = (this.getChild("day3"));
  15174. this.day4 = (this.getChild("day4"));
  15175. this.day5 = (this.getChild("day5"));
  15176. this.day6 = (this.getChild("day6"));
  15177. this.day7 = (this.getChild("day7"));
  15178. this.t0 = this.getTransition("t0");
  15179. }
  15180. }
  15181. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  15182. class ui_Sign_com8 extends fgui.GComponent {
  15183. static createInstance() {
  15184. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  15185. }
  15186. onConstruct() {
  15187. this.n48 = (this.getChild("n48"));
  15188. this.womanTxt = (this.getChild("womanTxt"));
  15189. this.t0 = this.getTransition("t0");
  15190. }
  15191. }
  15192. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  15193. class ui_Sign_com6 extends fgui.GComponent {
  15194. static createInstance() {
  15195. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  15196. }
  15197. onConstruct() {
  15198. this.n2 = (this.getChild("n2"));
  15199. this.n3 = (this.getChild("n3"));
  15200. this.t0 = this.getTransition("t0");
  15201. }
  15202. }
  15203. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  15204. class ui_Sign_com7 extends fgui.GComponent {
  15205. static createInstance() {
  15206. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  15207. }
  15208. onConstruct() {
  15209. this.n29 = (this.getChild("n29"));
  15210. this.n2 = (this.getChild("n2"));
  15211. }
  15212. }
  15213. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  15214. class ui_UITurntable_com1_2 extends fgui.GComponent {
  15215. static createInstance() {
  15216. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  15217. }
  15218. onConstruct() {
  15219. this.n5 = (this.getChild("n5"));
  15220. this.n4 = (this.getChild("n4"));
  15221. this.t0 = this.getTransition("t0");
  15222. }
  15223. }
  15224. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  15225. class ui_UITurntable_com2 extends fgui.GComponent {
  15226. static createInstance() {
  15227. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  15228. }
  15229. onConstruct() {
  15230. this.c1 = this.getController("c1");
  15231. this.n4 = (this.getChild("n4"));
  15232. this.n6 = (this.getChild("n6"));
  15233. this.n10 = (this.getChild("n10"));
  15234. this.n11 = (this.getChild("n11"));
  15235. this.n12 = (this.getChild("n12"));
  15236. this.n13 = (this.getChild("n13"));
  15237. this.n14 = (this.getChild("n14"));
  15238. this.n15 = (this.getChild("n15"));
  15239. this.n16 = (this.getChild("n16"));
  15240. this.n17 = (this.getChild("n17"));
  15241. this.n18 = (this.getChild("n18"));
  15242. this.n19 = (this.getChild("n19"));
  15243. this.n20 = (this.getChild("n20"));
  15244. this.n21 = (this.getChild("n21"));
  15245. this.n22 = (this.getChild("n22"));
  15246. this.n23 = (this.getChild("n23"));
  15247. this.n24 = (this.getChild("n24"));
  15248. this.n25 = (this.getChild("n25"));
  15249. this.n26 = (this.getChild("n26"));
  15250. this.n27 = (this.getChild("n27"));
  15251. this.n28 = (this.getChild("n28"));
  15252. this.n29 = (this.getChild("n29"));
  15253. this.n30 = (this.getChild("n30"));
  15254. this.n31 = (this.getChild("n31"));
  15255. this.n32 = (this.getChild("n32"));
  15256. this.n33 = (this.getChild("n33"));
  15257. }
  15258. }
  15259. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  15260. class ui_UITurntable_com1_1 extends fgui.GComponent {
  15261. static createInstance() {
  15262. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  15263. }
  15264. onConstruct() {
  15265. this.n5 = (this.getChild("n5"));
  15266. this.n4 = (this.getChild("n4"));
  15267. this.t0 = this.getTransition("t0");
  15268. }
  15269. }
  15270. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  15271. class ui_UITurntable_com5 extends fgui.GComponent {
  15272. static createInstance() {
  15273. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  15274. }
  15275. onConstruct() {
  15276. this.flashNode = (this.getChild("flashNode"));
  15277. this.rotNode = (this.getChild("rotNode"));
  15278. this.n3 = (this.getChild("n3"));
  15279. this.n21 = (this.getChild("n21"));
  15280. this.t0 = this.getTransition("t0");
  15281. }
  15282. }
  15283. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  15284. class ui_UITurntable_com7 extends fgui.GComponent {
  15285. static createInstance() {
  15286. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  15287. }
  15288. onConstruct() {
  15289. this.n2 = (this.getChild("n2"));
  15290. this.n35 = (this.getChild("n35"));
  15291. this.img1 = (this.getChild("img1"));
  15292. this.img2 = (this.getChild("img2"));
  15293. this.img3 = (this.getChild("img3"));
  15294. this.img4 = (this.getChild("img4"));
  15295. this.img6 = (this.getChild("img6"));
  15296. this.img5 = (this.getChild("img5"));
  15297. this.txt1 = (this.getChild("txt1"));
  15298. this.txt2 = (this.getChild("txt2"));
  15299. this.txt3 = (this.getChild("txt3"));
  15300. this.txt4 = (this.getChild("txt4"));
  15301. this.txt5 = (this.getChild("txt5"));
  15302. this.txt6 = (this.getChild("txt6"));
  15303. }
  15304. }
  15305. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  15306. class ui_UITurntable_com9 extends fgui.GComponent {
  15307. static createInstance() {
  15308. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  15309. }
  15310. onConstruct() {
  15311. this.n38 = (this.getChild("n38"));
  15312. this.n39 = (this.getChild("n39"));
  15313. }
  15314. }
  15315. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  15316. class ui_UITurntable_com10 extends fgui.GComponent {
  15317. static createInstance() {
  15318. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  15319. }
  15320. onConstruct() {
  15321. this.n39 = (this.getChild("n39"));
  15322. this.n40 = (this.getChild("n40"));
  15323. this.t0 = this.getTransition("t0");
  15324. }
  15325. }
  15326. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  15327. class ui_UITurntable_com11 extends fgui.GComponent {
  15328. static createInstance() {
  15329. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  15330. }
  15331. onConstruct() {
  15332. this.n38 = (this.getChild("n38"));
  15333. this.n39 = (this.getChild("n39"));
  15334. this.n40 = (this.getChild("n40"));
  15335. this.t0 = this.getTransition("t0");
  15336. }
  15337. }
  15338. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  15339. class ui_UITurntable_com12 extends fgui.GComponent {
  15340. static createInstance() {
  15341. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  15342. }
  15343. onConstruct() {
  15344. this.n43 = (this.getChild("n43"));
  15345. this.barNode = (this.getChild("barNode"));
  15346. this.tipsTxt = (this.getChild("tipsTxt"));
  15347. this.n45 = (this.getChild("n45"));
  15348. this.boxBtn = (this.getChild("boxBtn"));
  15349. }
  15350. }
  15351. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  15352. class ui_UITurntable_com1 extends fgui.GButton {
  15353. static createInstance() {
  15354. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  15355. }
  15356. onConstruct() {
  15357. this.n41 = (this.getChild("n41"));
  15358. this.n42 = (this.getChild("n42"));
  15359. this.t0 = this.getTransition("t0");
  15360. }
  15361. }
  15362. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  15363. class ui_UITurntable_com3 extends fgui.GComponent {
  15364. static createInstance() {
  15365. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  15366. }
  15367. onConstruct() {
  15368. this.n48 = (this.getChild("n48"));
  15369. this.womanTxt = (this.getChild("womanTxt"));
  15370. this.t0 = this.getTransition("t0");
  15371. }
  15372. }
  15373. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  15374. class ui_cancelBtn2 extends fgui.GButton {
  15375. static createInstance() {
  15376. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  15377. }
  15378. onConstruct() {
  15379. this.c1 = this.getController("c1");
  15380. this.n0 = (this.getChild("n0"));
  15381. this.n1 = (this.getChild("n1"));
  15382. this.n2 = (this.getChild("n2"));
  15383. this.n3 = (this.getChild("n3"));
  15384. this.n4 = (this.getChild("n4"));
  15385. this.n5 = (this.getChild("n5"));
  15386. this.n6 = (this.getChild("n6"));
  15387. this.n7 = (this.getChild("n7"));
  15388. this.n8 = (this.getChild("n8"));
  15389. this.powerEft = (this.getChild("powerEft"));
  15390. }
  15391. }
  15392. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  15393. class ui_shareBtn2 extends fgui.GButton {
  15394. static createInstance() {
  15395. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  15396. }
  15397. onConstruct() {
  15398. this.c1 = this.getController("c1");
  15399. this.n2 = (this.getChild("n2"));
  15400. this.n24 = (this.getChild("n24"));
  15401. this.n1 = (this.getChild("n1"));
  15402. this.n3 = (this.getChild("n3"));
  15403. this.n23 = (this.getChild("n23"));
  15404. this.n4 = (this.getChild("n4"));
  15405. this.n5 = (this.getChild("n5"));
  15406. this.n6 = (this.getChild("n6"));
  15407. this.n20 = (this.getChild("n20"));
  15408. this.n21 = (this.getChild("n21"));
  15409. this.n22 = (this.getChild("n22"));
  15410. this.powerEft = (this.getChild("powerEft"));
  15411. }
  15412. }
  15413. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  15414. class ui_UIMoney extends fgui.GComponent {
  15415. static createInstance() {
  15416. return (fgui.UIPackage.createObject("game", "UIMoney"));
  15417. }
  15418. onConstruct() {
  15419. this.c1 = this.getController("c1");
  15420. this.n4 = (this.getChild("n4"));
  15421. this.coinImg = (this.getChild("coinImg"));
  15422. this.addCoinBtn = (this.getChild("addCoinBtn"));
  15423. this.coinTxt = (this.getChild("coinTxt"));
  15424. this.n7 = (this.getChild("n7"));
  15425. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  15426. this.diamondTxt = (this.getChild("diamondTxt"));
  15427. this.diamondImg = (this.getChild("diamondImg"));
  15428. this.n12 = (this.getChild("n12"));
  15429. this.powerImg = (this.getChild("powerImg"));
  15430. this.addPowerBtn = (this.getChild("addPowerBtn"));
  15431. this.powerTxt = (this.getChild("powerTxt"));
  15432. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  15433. }
  15434. }
  15435. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  15436. class ui_backBtn extends fgui.GButton {
  15437. static createInstance() {
  15438. return (fgui.UIPackage.createObject("game", "backBtn"));
  15439. }
  15440. onConstruct() {
  15441. this.n0 = (this.getChild("n0"));
  15442. this.t0 = this.getTransition("t0");
  15443. this.t1 = this.getTransition("t1");
  15444. }
  15445. }
  15446. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  15447. class ui_MoneyBtn extends fgui.GButton {
  15448. static createInstance() {
  15449. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  15450. }
  15451. onConstruct() {
  15452. this.button = this.getController("button");
  15453. this.n0 = (this.getChild("n0"));
  15454. }
  15455. }
  15456. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  15457. class ui_UIMoneyBtn extends fgui.GComponent {
  15458. static createInstance() {
  15459. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  15460. }
  15461. onConstruct() {
  15462. this.n1 = (this.getChild("n1"));
  15463. this.closeBtn = (this.getChild("closeBtn"));
  15464. }
  15465. }
  15466. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  15467. class ui_Component64 extends fgui.GComponent {
  15468. static createInstance() {
  15469. return (fgui.UIPackage.createObject("game", "Component64"));
  15470. }
  15471. onConstruct() {
  15472. this.n57 = (this.getChild("n57"));
  15473. this.n54 = (this.getChild("n54"));
  15474. this.n55 = (this.getChild("n55"));
  15475. this.n56 = (this.getChild("n56"));
  15476. this.t1 = this.getTransition("t1");
  15477. }
  15478. }
  15479. ui_Component64.URL = "ui://isxx5ak7wp26456";
  15480. class ui_Component41_3 extends fgui.GComponent {
  15481. static createInstance() {
  15482. return (fgui.UIPackage.createObject("game", "Component41_3"));
  15483. }
  15484. onConstruct() {
  15485. this.c1 = this.getController("c1");
  15486. this.n0 = (this.getChild("n0"));
  15487. this.n2 = (this.getChild("n2"));
  15488. this.cancelBtn = (this.getChild("cancelBtn"));
  15489. this.videoBtn = (this.getChild("videoBtn"));
  15490. this.n9 = (this.getChild("n9"));
  15491. this.n24 = (this.getChild("n24"));
  15492. this.n27 = (this.getChild("n27"));
  15493. this.titleTxt = (this.getChild("titleTxt"));
  15494. this.n28 = (this.getChild("n28"));
  15495. this.t0 = this.getTransition("t0");
  15496. }
  15497. }
  15498. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  15499. class ui_dh_zs_4 extends fgui.GComponent {
  15500. static createInstance() {
  15501. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  15502. }
  15503. onConstruct() {
  15504. this.n1 = (this.getChild("n1"));
  15505. this.n2 = (this.getChild("n2"));
  15506. this.n3 = (this.getChild("n3"));
  15507. this.n4 = (this.getChild("n4"));
  15508. this.n5 = (this.getChild("n5"));
  15509. this.n6 = (this.getChild("n6"));
  15510. this.n8 = (this.getChild("n8"));
  15511. this.t0 = this.getTransition("t0");
  15512. }
  15513. }
  15514. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  15515. class ui_Component71_1 extends fgui.GButton {
  15516. static createInstance() {
  15517. return (fgui.UIPackage.createObject("game", "Component71_1"));
  15518. }
  15519. onConstruct() {
  15520. this.n17 = (this.getChild("n17"));
  15521. this.t0 = this.getTransition("t0");
  15522. }
  15523. }
  15524. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  15525. class ui_Component83 extends fgui.GComponent {
  15526. static createInstance() {
  15527. return (fgui.UIPackage.createObject("game", "Component83"));
  15528. }
  15529. onConstruct() {
  15530. this.c1 = this.getController("c1");
  15531. this.n17 = (this.getChild("n17"));
  15532. this.n19 = (this.getChild("n19"));
  15533. this.n20 = (this.getChild("n20"));
  15534. }
  15535. }
  15536. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  15537. class ui_Component84 extends fgui.GComponent {
  15538. static createInstance() {
  15539. return (fgui.UIPackage.createObject("game", "Component84"));
  15540. }
  15541. onConstruct() {
  15542. this.c1 = this.getController("c1");
  15543. this.n4 = (this.getChild("n4"));
  15544. this.n22 = (this.getChild("n22"));
  15545. this.n23 = (this.getChild("n23"));
  15546. this.numTxt = (this.getChild("numTxt"));
  15547. this.n25 = (this.getChild("n25"));
  15548. this.n26 = (this.getChild("n26"));
  15549. }
  15550. }
  15551. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  15552. class ui_Component84_1 extends fgui.GComponent {
  15553. static createInstance() {
  15554. return (fgui.UIPackage.createObject("game", "Component84_1"));
  15555. }
  15556. onConstruct() {
  15557. this.c1 = this.getController("c1");
  15558. this.n4 = (this.getChild("n4"));
  15559. this.n22 = (this.getChild("n22"));
  15560. this.n23 = (this.getChild("n23"));
  15561. this.numTxt = (this.getChild("numTxt"));
  15562. this.n25 = (this.getChild("n25"));
  15563. this.n26 = (this.getChild("n26"));
  15564. }
  15565. }
  15566. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  15567. class ui_Component85 extends fgui.GComponent {
  15568. static createInstance() {
  15569. return (fgui.UIPackage.createObject("game", "Component85"));
  15570. }
  15571. onConstruct() {
  15572. this.n1 = (this.getChild("n1"));
  15573. this.n6 = (this.getChild("n6"));
  15574. this.n2 = (this.getChild("n2"));
  15575. this.n3 = (this.getChild("n3"));
  15576. this.levelTxt = (this.getChild("levelTxt"));
  15577. this.n10 = (this.getChild("n10"));
  15578. this.n11 = (this.getChild("n11"));
  15579. this.n12 = (this.getChild("n12"));
  15580. this.n13 = (this.getChild("n13"));
  15581. this.n14 = (this.getChild("n14"));
  15582. this.modeNode = (this.getChild("modeNode"));
  15583. this.n18 = (this.getChild("n18"));
  15584. this.conditionTxt = (this.getChild("conditionTxt"));
  15585. this.diamondNode = (this.getChild("diamondNode"));
  15586. this.coinNode = (this.getChild("coinNode"));
  15587. this.startBtn = (this.getChild("startBtn"));
  15588. this.n28 = (this.getChild("n28"));
  15589. this.displayRoot = (this.getChild("displayRoot"));
  15590. this.t0 = this.getTransition("t0");
  15591. }
  15592. }
  15593. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  15594. class ui_Component86 extends fgui.GButton {
  15595. static createInstance() {
  15596. return (fgui.UIPackage.createObject("game", "Component86"));
  15597. }
  15598. onConstruct() {
  15599. this.n15 = (this.getChild("n15"));
  15600. this.t0 = this.getTransition("t0");
  15601. }
  15602. }
  15603. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  15604. class ui_Component87 extends fgui.GComponent {
  15605. static createInstance() {
  15606. return (fgui.UIPackage.createObject("game", "Component87"));
  15607. }
  15608. onConstruct() {
  15609. this.n66 = (this.getChild("n66"));
  15610. this.myProgress = (this.getChild("myProgress"));
  15611. this.starAni = (this.getChild("starAni"));
  15612. this.hpTxt = (this.getChild("hpTxt"));
  15613. this.n74 = (this.getChild("n74"));
  15614. this.n73 = (this.getChild("n73"));
  15615. this.ballTxt = (this.getChild("ballTxt"));
  15616. this.n76 = (this.getChild("n76"));
  15617. this.helpLineBtn = (this.getChild("helpLineBtn"));
  15618. this.levelTxt = (this.getChild("levelTxt"));
  15619. this.star1 = (this.getChild("star1"));
  15620. this.star2 = (this.getChild("star2"));
  15621. this.star3 = (this.getChild("star3"));
  15622. }
  15623. }
  15624. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  15625. class ui_Component88 extends fgui.GProgressBar {
  15626. static createInstance() {
  15627. return (fgui.UIPackage.createObject("game", "Component88"));
  15628. }
  15629. onConstruct() {
  15630. this.n68 = (this.getChild("n68"));
  15631. this.bar = (this.getChild("bar"));
  15632. }
  15633. }
  15634. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  15635. class ui_Component89 extends fgui.GComponent {
  15636. static createInstance() {
  15637. return (fgui.UIPackage.createObject("game", "Component89"));
  15638. }
  15639. onConstruct() {
  15640. this.c1 = this.getController("c1");
  15641. this.n71 = (this.getChild("n71"));
  15642. this.n72 = (this.getChild("n72"));
  15643. }
  15644. }
  15645. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  15646. class ui_Component90 extends fgui.GComponent {
  15647. static createInstance() {
  15648. return (fgui.UIPackage.createObject("game", "Component90"));
  15649. }
  15650. onConstruct() {
  15651. this.c1 = this.getController("c1");
  15652. this.n64 = (this.getChild("n64"));
  15653. this.n65 = (this.getChild("n65"));
  15654. this.n66 = (this.getChild("n66"));
  15655. this.t0 = this.getTransition("t0");
  15656. }
  15657. }
  15658. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  15659. class ui_Component127 extends fgui.GButton {
  15660. static createInstance() {
  15661. return (fgui.UIPackage.createObject("game", "Component127"));
  15662. }
  15663. onConstruct() {
  15664. this.n5 = (this.getChild("n5"));
  15665. }
  15666. }
  15667. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  15668. class gameBinder {
  15669. static bindAll() {
  15670. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  15671. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  15672. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  15673. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  15674. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  15675. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  15676. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  15677. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  15678. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  15679. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  15680. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  15681. fgui.UIObjectFactory.setExtension(ui_UILogin.URL, ui_UILogin);
  15682. fgui.UIObjectFactory.setExtension(ui_UIReg.URL, ui_UIReg);
  15683. fgui.UIObjectFactory.setExtension(ui_Button_reg.URL, ui_Button_reg);
  15684. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  15685. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  15686. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  15687. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  15688. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  15689. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  15690. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  15691. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  15692. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  15693. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  15694. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  15695. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  15696. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  15697. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  15698. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  15699. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  15700. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  15701. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  15702. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  15703. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  15704. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  15705. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  15706. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  15707. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  15708. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  15709. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  15710. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  15711. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  15712. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  15713. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  15714. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  15715. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  15716. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  15717. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  15718. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  15719. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  15720. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  15721. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  15722. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  15723. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  15724. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  15725. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  15726. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  15727. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  15728. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  15729. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  15730. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  15731. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  15732. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  15733. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  15734. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  15735. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  15736. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  15737. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  15738. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  15739. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  15740. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  15741. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  15742. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  15743. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  15744. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  15745. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  15746. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  15747. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  15748. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  15749. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  15750. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  15751. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  15752. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  15753. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  15754. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  15755. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  15756. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  15757. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  15758. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  15759. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  15760. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  15761. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  15762. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  15763. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  15764. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  15765. fgui.UIObjectFactory.setExtension(ui_Component_phb.URL, ui_Component_phb);
  15766. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  15767. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  15768. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  15769. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  15770. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  15771. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  15772. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  15773. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  15774. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  15775. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  15776. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  15777. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  15778. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  15779. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  15780. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  15781. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  15782. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  15783. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  15784. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  15785. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  15786. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  15787. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  15788. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  15789. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  15790. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  15791. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  15792. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  15793. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  15794. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  15795. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  15796. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  15797. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  15798. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  15799. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  15800. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  15801. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  15802. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  15803. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  15804. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  15805. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  15806. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  15807. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  15808. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  15809. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  15810. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  15811. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  15812. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  15813. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  15814. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  15815. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  15816. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  15817. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  15818. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  15819. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  15820. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  15821. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  15822. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  15823. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  15824. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  15825. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  15826. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  15827. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  15828. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  15829. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  15830. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  15831. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  15832. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  15833. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  15834. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  15835. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  15836. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  15837. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  15838. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  15839. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  15840. fgui.UIObjectFactory.setExtension(ui_Button_login.URL, ui_Button_login);
  15841. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  15842. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  15843. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  15844. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  15845. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  15846. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  15847. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  15848. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  15849. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  15850. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  15851. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  15852. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  15853. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  15854. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  15855. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  15856. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  15857. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  15858. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  15859. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  15860. fgui.UIObjectFactory.setExtension(ui_Component_dl_zc.URL, ui_Component_dl_zc);
  15861. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  15862. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  15863. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  15864. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  15865. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  15866. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  15867. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  15868. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  15869. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  15870. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  15871. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  15872. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  15873. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  15874. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  15875. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  15876. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  15877. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  15878. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  15879. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  15880. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  15881. fgui.UIObjectFactory.setExtension(ui_btn_buy.URL, ui_btn_buy);
  15882. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  15883. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  15884. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  15885. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  15886. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  15887. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  15888. fgui.UIObjectFactory.setExtension(ui_daoJuDisplay.URL, ui_daoJuDisplay);
  15889. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  15890. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  15891. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  15892. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  15893. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  15894. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  15895. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  15896. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  15897. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  15898. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  15899. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  15900. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  15901. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  15902. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  15903. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  15904. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  15905. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  15906. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  15907. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  15908. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  15909. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  15910. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  15911. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  15912. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  15913. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  15914. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  15915. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  15916. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  15917. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  15918. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  15919. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  15920. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  15921. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  15922. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  15923. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  15924. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  15925. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  15926. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  15927. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  15928. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  15929. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  15930. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  15931. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  15932. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  15933. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  15934. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  15935. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  15936. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  15937. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  15938. }
  15939. }
  15940. class ui_btn6 extends fgui.GButton {
  15941. static createInstance() {
  15942. return (fgui.UIPackage.createObject("loading", "btn6"));
  15943. }
  15944. onConstruct() {
  15945. this.n6 = (this.getChild("n6"));
  15946. this.n1 = (this.getChild("n1"));
  15947. }
  15948. }
  15949. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  15950. class ui_xyItem extends fgui.GComponent {
  15951. static createInstance() {
  15952. return (fgui.UIPackage.createObject("loading", "xyItem"));
  15953. }
  15954. onConstruct() {
  15955. this.xyItem = (this.getChild("xyItem"));
  15956. }
  15957. }
  15958. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  15959. class ui_loadinfo extends fgui.GProgressBar {
  15960. static createInstance() {
  15961. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  15962. }
  15963. onConstruct() {
  15964. this.bg = (this.getChild("bg"));
  15965. this.bar = (this.getChild("bar"));
  15966. this.title = (this.getChild("title"));
  15967. this.ani = (this.getChild("ani"));
  15968. }
  15969. }
  15970. ui_loadinfo.URL = "ui://37nctnhwis36c";
  15971. class ui_xyNode extends fgui.GComponent {
  15972. static createInstance() {
  15973. return (fgui.UIPackage.createObject("loading", "xyNode"));
  15974. }
  15975. onConstruct() {
  15976. this.n0 = (this.getChild("n0"));
  15977. this.btnYes = (this.getChild("btnYes"));
  15978. this.btnNo = (this.getChild("btnNo"));
  15979. this.btnKnown = (this.getChild("btnKnown"));
  15980. this.btnSure = (this.getChild("btnSure"));
  15981. this.txtWelcom = (this.getChild("txtWelcom"));
  15982. this.txtXy = (this.getChild("txtXy"));
  15983. this.n75 = (this.getChild("n75"));
  15984. this.btnXy1 = (this.getChild("btnXy1"));
  15985. this.btnXy3 = (this.getChild("btnXy3"));
  15986. this.btnXy2 = (this.getChild("btnXy2"));
  15987. this.n74 = (this.getChild("n74"));
  15988. this.xy1 = (this.getChild("xy1"));
  15989. this.txtTitle = (this.getChild("txtTitle"));
  15990. this.btnBack = (this.getChild("btnBack"));
  15991. this.xyList = (this.getChild("xyList"));
  15992. this.xy2 = (this.getChild("xy2"));
  15993. this.xyNode = (this.getChild("xyNode"));
  15994. }
  15995. }
  15996. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  15997. class ui_ageNode extends fgui.GComponent {
  15998. static createInstance() {
  15999. return (fgui.UIPackage.createObject("loading", "ageNode"));
  16000. }
  16001. onConstruct() {
  16002. this.n3 = (this.getChild("n3"));
  16003. this.n7 = (this.getChild("n7"));
  16004. this.n4 = (this.getChild("n4"));
  16005. this.btnAge = (this.getChild("btnAge"));
  16006. this.ageNode = (this.getChild("ageNode"));
  16007. }
  16008. }
  16009. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  16010. class ui_rnNode extends fgui.GComponent {
  16011. static createInstance() {
  16012. return (fgui.UIPackage.createObject("loading", "rnNode"));
  16013. }
  16014. onConstruct() {
  16015. this.n28 = (this.getChild("n28"));
  16016. this.n30 = (this.getChild("n30"));
  16017. this.n33 = (this.getChild("n33"));
  16018. this.rn1 = (this.getChild("rn1"));
  16019. this.n40 = (this.getChild("n40"));
  16020. this.n41 = (this.getChild("n41"));
  16021. this.rn3 = (this.getChild("rn3"));
  16022. this.n37 = (this.getChild("n37"));
  16023. this.n39 = (this.getChild("n39"));
  16024. this.rn2 = (this.getChild("rn2"));
  16025. this.n47 = (this.getChild("n47"));
  16026. this.n49 = (this.getChild("n49"));
  16027. this.n44 = (this.getChild("n44"));
  16028. this.inputCode = (this.getChild("inputCode"));
  16029. this.inputName = (this.getChild("inputName"));
  16030. this.n48 = (this.getChild("n48"));
  16031. this.n50 = (this.getChild("n50"));
  16032. this.rn4 = (this.getChild("rn4"));
  16033. this.btnCheck = (this.getChild("btnCheck"));
  16034. this.btnExit = (this.getChild("btnExit"));
  16035. this.btnDone = (this.getChild("btnDone"));
  16036. this.rnNode = (this.getChild("rnNode"));
  16037. }
  16038. }
  16039. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  16040. class ui_tipNode extends fgui.GComponent {
  16041. static createInstance() {
  16042. return (fgui.UIPackage.createObject("loading", "tipNode"));
  16043. }
  16044. onConstruct() {
  16045. this.bg = (this.getChild("bg"));
  16046. this.n55 = (this.getChild("n55"));
  16047. this.n56 = (this.getChild("n56"));
  16048. this.tipNode = (this.getChild("tipNode"));
  16049. }
  16050. }
  16051. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  16052. class ui_fcmNode extends fgui.GComponent {
  16053. static createInstance() {
  16054. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  16055. }
  16056. onConstruct() {
  16057. this.n63 = (this.getChild("n63"));
  16058. this.n62 = (this.getChild("n62"));
  16059. this.btnRn = (this.getChild("btnRn"));
  16060. this.n61 = (this.getChild("n61"));
  16061. this.n58 = (this.getChild("n58"));
  16062. this.fcmNode = (this.getChild("fcmNode"));
  16063. }
  16064. }
  16065. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  16066. class ui_msgNode extends fgui.GComponent {
  16067. static createInstance() {
  16068. return (fgui.UIPackage.createObject("loading", "msgNode"));
  16069. }
  16070. onConstruct() {
  16071. this.n69 = (this.getChild("n69"));
  16072. this.txtMsg = (this.getChild("txtMsg"));
  16073. this.msgNode = (this.getChild("msgNode"));
  16074. }
  16075. }
  16076. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  16077. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  16078. static createInstance() {
  16079. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  16080. }
  16081. onConstruct() {
  16082. this.n1 = (this.getChild("n1"));
  16083. this.n13 = (this.getChild("n13"));
  16084. this.n14 = (this.getChild("n14"));
  16085. this.n15 = (this.getChild("n15"));
  16086. this.n3 = (this.getChild("n3"));
  16087. this.n4 = (this.getChild("n4"));
  16088. this.n5 = (this.getChild("n5"));
  16089. this.n6 = (this.getChild("n6"));
  16090. this.n7 = (this.getChild("n7"));
  16091. this.n8 = (this.getChild("n8"));
  16092. this.n9 = (this.getChild("n9"));
  16093. this.n10 = (this.getChild("n10"));
  16094. this.n12 = (this.getChild("n12"));
  16095. this.n11 = (this.getChild("n11"));
  16096. this.n16 = (this.getChild("n16"));
  16097. this.n17 = (this.getChild("n17"));
  16098. this.n18 = (this.getChild("n18"));
  16099. this.n20 = (this.getChild("n20"));
  16100. this.n21 = (this.getChild("n21"));
  16101. this.t0 = this.getTransition("t0");
  16102. }
  16103. }
  16104. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  16105. class ui_btn5 extends fgui.GButton {
  16106. static createInstance() {
  16107. return (fgui.UIPackage.createObject("loading", "btn5"));
  16108. }
  16109. onConstruct() {
  16110. this.n9 = (this.getChild("n9"));
  16111. this.n1 = (this.getChild("n1"));
  16112. }
  16113. }
  16114. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  16115. class ui_UILoading extends fgui.GComponent {
  16116. static createInstance() {
  16117. return (fgui.UIPackage.createObject("loading", "UILoading"));
  16118. }
  16119. onConstruct() {
  16120. this.n12 = (this.getChild("n12"));
  16121. this.loadinfo = (this.getChild("loadinfo"));
  16122. this.n13 = (this.getChild("n13"));
  16123. this.txtLoad = (this.getChild("txtLoad"));
  16124. this.n18 = (this.getChild("n18"));
  16125. }
  16126. }
  16127. ui_UILoading.URL = "ui://37nctnhwphc33";
  16128. class ui_AgeItem extends fgui.GComponent {
  16129. static createInstance() {
  16130. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  16131. }
  16132. onConstruct() {
  16133. this.txtAge = (this.getChild("txtAge"));
  16134. }
  16135. }
  16136. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  16137. class ui_btn1 extends fgui.GButton {
  16138. static createInstance() {
  16139. return (fgui.UIPackage.createObject("loading", "btn1"));
  16140. }
  16141. onConstruct() {
  16142. this.n6 = (this.getChild("n6"));
  16143. this.n1 = (this.getChild("n1"));
  16144. }
  16145. }
  16146. ui_btn1.URL = "ui://37nctnhwxe622p";
  16147. class ui_btn3 extends fgui.GButton {
  16148. static createInstance() {
  16149. return (fgui.UIPackage.createObject("loading", "btn3"));
  16150. }
  16151. onConstruct() {
  16152. this.n9 = (this.getChild("n9"));
  16153. this.n1 = (this.getChild("n1"));
  16154. }
  16155. }
  16156. ui_btn3.URL = "ui://37nctnhwxe622s";
  16157. class ui_btn2 extends fgui.GButton {
  16158. static createInstance() {
  16159. return (fgui.UIPackage.createObject("loading", "btn2"));
  16160. }
  16161. onConstruct() {
  16162. this.n6 = (this.getChild("n6"));
  16163. this.n1 = (this.getChild("n1"));
  16164. }
  16165. }
  16166. ui_btn2.URL = "ui://37nctnhwxe622t";
  16167. class ui_btnBack extends fgui.GButton {
  16168. static createInstance() {
  16169. return (fgui.UIPackage.createObject("loading", "btnBack"));
  16170. }
  16171. onConstruct() {
  16172. this.n6 = (this.getChild("n6"));
  16173. this.n7 = (this.getChild("n7"));
  16174. }
  16175. }
  16176. ui_btnBack.URL = "ui://37nctnhwxe622u";
  16177. class ui_btnXy1 extends fgui.GButton {
  16178. static createInstance() {
  16179. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  16180. }
  16181. onConstruct() {
  16182. this.n1 = (this.getChild("n1"));
  16183. }
  16184. }
  16185. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  16186. class ui_btnXy2 extends fgui.GButton {
  16187. static createInstance() {
  16188. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  16189. }
  16190. onConstruct() {
  16191. this.n1 = (this.getChild("n1"));
  16192. }
  16193. }
  16194. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  16195. class ui_btnXy3 extends fgui.GButton {
  16196. static createInstance() {
  16197. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  16198. }
  16199. onConstruct() {
  16200. this.n1 = (this.getChild("n1"));
  16201. }
  16202. }
  16203. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  16204. class ui_btn4 extends fgui.GButton {
  16205. static createInstance() {
  16206. return (fgui.UIPackage.createObject("loading", "btn4"));
  16207. }
  16208. onConstruct() {
  16209. this.n9 = (this.getChild("n9"));
  16210. this.n1 = (this.getChild("n1"));
  16211. }
  16212. }
  16213. ui_btn4.URL = "ui://37nctnhwxe622z";
  16214. class loadingBinder {
  16215. static bindAll() {
  16216. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  16217. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  16218. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  16219. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  16220. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  16221. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  16222. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  16223. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  16224. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  16225. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  16226. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  16227. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  16228. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  16229. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  16230. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  16231. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  16232. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  16233. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  16234. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  16235. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  16236. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  16237. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  16238. }
  16239. }
  16240. class UIMgr {
  16241. constructor() {
  16242. this._stage = null;
  16243. this._uiList = [];
  16244. this._showList = [];
  16245. this._bindPkgList = [];
  16246. this.uiIndex = 0;
  16247. }
  16248. static get inst() {
  16249. if (UIMgr._inst == null) {
  16250. UIMgr._inst = new UIMgr();
  16251. }
  16252. return UIMgr._inst;
  16253. }
  16254. setStage(s) {
  16255. if (this._stage) {
  16256. console.log("ViewMgr::Stage->舞台不可赋值两次");
  16257. return;
  16258. }
  16259. this._stage = s;
  16260. }
  16261. clearTempData() {
  16262. console.log('zh:clearTempData start');
  16263. Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level');
  16264. console.log('zh:clearTempData end');
  16265. }
  16266. init() {
  16267. this.setStage(Laya.stage);
  16268. fairygui.UIConfig.defaultFont = "微软雅黑";
  16269. fairygui.UIConfig.modalLayerColor = "rgba(0,0,0,0.9)";
  16270. fairygui.UIConfig.packageFileExtension = "obj";
  16271. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  16272. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  16273. fairygui.GRoot.inst.width = Laya.stage.width;
  16274. fairygui.GRoot.inst.height = Laya.stage.height;
  16275. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  16276. }
  16277. addAllUpdate() {
  16278. this.uiIndex = 0;
  16279. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  16280. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  16281. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  16282. }
  16283. }
  16284. }
  16285. bindFUI(pkgname) {
  16286. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  16287. return;
  16288. }
  16289. switch (pkgname) {
  16290. case fguiRes.loading:
  16291. fairygui.UIPackage.addPackage(pkgname);
  16292. loadingBinder.bindAll();
  16293. this._bindPkgList.push(pkgname);
  16294. break;
  16295. case fguiRes.game:
  16296. fairygui.UIPackage.addPackage(pkgname);
  16297. gameBinder.bindAll();
  16298. this._bindPkgList.push(pkgname);
  16299. break;
  16300. default:
  16301. break;
  16302. }
  16303. }
  16304. Show(cls, ...param) {
  16305. let nameStr = cls.uiName;
  16306. for (let i = this._uiList.length - 1; i >= 0; i--) {
  16307. let temp = this._uiList[i];
  16308. let str = temp.className;
  16309. if (str == nameStr) {
  16310. if (temp.isMuti) {
  16311. if (temp.isHide) {
  16312. temp.show(...param);
  16313. this._uiList.splice(i, 1);
  16314. this._uiList.push(temp);
  16315. return temp;
  16316. }
  16317. }
  16318. else {
  16319. temp.show(...param);
  16320. this._uiList.splice(i, 1);
  16321. this._uiList.push(temp);
  16322. return temp;
  16323. }
  16324. }
  16325. }
  16326. let ui = new cls();
  16327. ui.className = nameStr;
  16328. this._showUI(ui, param);
  16329. return ui;
  16330. }
  16331. destroyUI(ui) {
  16332. for (let i = this._uiList.length - 1; i >= 0; i--) {
  16333. let temp = this._uiList[i].className;
  16334. if (temp == ui.className) {
  16335. this._uiList.splice(i, 1);
  16336. break;
  16337. }
  16338. }
  16339. this.checkUIState();
  16340. }
  16341. _showUI(ui, param) {
  16342. this._uiList.push(ui);
  16343. ui.show(...param);
  16344. }
  16345. Hide(uiClass) {
  16346. let ui = this.getUI(uiClass);
  16347. if (ui && !ui.isHide) {
  16348. ui.hide();
  16349. }
  16350. }
  16351. getUI(ui) {
  16352. let nameStr = ui.uiName;
  16353. for (let index = 0; index < this._uiList.length; index++) {
  16354. let temp = this._uiList[index];
  16355. if (temp.className == nameStr) {
  16356. return temp;
  16357. }
  16358. }
  16359. return null;
  16360. }
  16361. isShow(cls) {
  16362. for (var i of this._uiList) {
  16363. if (i instanceof cls) {
  16364. return i.isShowing;
  16365. }
  16366. }
  16367. return false;
  16368. }
  16369. showUINum() {
  16370. let num = 0;
  16371. for (var i of this._uiList) {
  16372. if (i.isShowing) {
  16373. num++;
  16374. }
  16375. }
  16376. return num;
  16377. }
  16378. checkUIState() {
  16379. Laya.timer.clear(this, this._uiCheck);
  16380. Laya.timer.once(400, this, this._uiCheck);
  16381. }
  16382. _uiCheck() {
  16383. let showList = [];
  16384. for (var i of this._uiList) {
  16385. if (!i.isHide) {
  16386. showList.push(i);
  16387. }
  16388. }
  16389. for (let index = 0; index < showList.length; index++) {
  16390. if (index == showList.length - 1) {
  16391. showList[index].checkActive(true);
  16392. }
  16393. else {
  16394. showList[index].checkActive(false);
  16395. }
  16396. }
  16397. }
  16398. showTip(msg, time = 600, size = 30) {
  16399. }
  16400. }
  16401. class UIShowList {
  16402. }
  16403. class SoundMgr {
  16404. constructor() {
  16405. this.soundMax = 4;
  16406. this.isLoad = false;
  16407. this.soundMap = {};
  16408. this.isSound = true;
  16409. this.openShake = true;
  16410. SoundMgr._instance = this;
  16411. }
  16412. static getInstance() {
  16413. if (!this._instance) {
  16414. this._instance = new SoundMgr();
  16415. }
  16416. return this._instance;
  16417. }
  16418. init() {
  16419. console.log('zh:sm init 1');
  16420. Laya.SoundManager.autoReleaseSound = true;
  16421. Laya.SoundManager.autoStopMusic = true;
  16422. Laya.SoundManager.musicVolume = 0.3;
  16423. Laya.SoundManager.soundVolume = 0.5;
  16424. this.musicPlayed = false;
  16425. this.audioUrl = "asset/sound/ogg/";
  16426. console.log('zh:sm init 2');
  16427. console.log('zh:dev type ');
  16428. if (Laya.Browser.onAndroid) {
  16429. console.log('zh:dev type android');
  16430. this.audioUrl = "asset/sound/ogg/";
  16431. this.isLoad = true;
  16432. }
  16433. else {
  16434. console.log('zh:dev type not android');
  16435. this.audioUrl = "asset/sound/mp3/";
  16436. this.isLoad = true;
  16437. }
  16438. }
  16439. onSetting(isS) {
  16440. this.isSound = isS;
  16441. this.mute(!this.isSound);
  16442. }
  16443. clearCount() {
  16444. for (var key in this.soundMap) {
  16445. delete this.soundMap[key];
  16446. }
  16447. }
  16448. playMusic(path, loop = 0) {
  16449. console.log('zh:playMusic 1 PATH=' + path);
  16450. this.musicPath = path;
  16451. if (!this.isLoad) {
  16452. return;
  16453. }
  16454. if (!path || path == "") {
  16455. return;
  16456. }
  16457. if (!this.isSound) {
  16458. return;
  16459. }
  16460. this.musicPlayed = true;
  16461. let url = this.getUrl(path);
  16462. if (!Laya.Browser.onAndroid) {
  16463. Laya.loader.load(url, Laya.Handler.create(this, () => {
  16464. this.play(url, loop);
  16465. }));
  16466. }
  16467. else {
  16468. this.play(url, loop);
  16469. }
  16470. }
  16471. play(url, loop) {
  16472. Laya.SoundManager.playMusic(url, loop);
  16473. }
  16474. getUrl(path) {
  16475. let url = this.audioUrl + path;
  16476. if (Laya.Browser.onAndroid) {
  16477. url += ".ogg";
  16478. }
  16479. else {
  16480. url += ".mp3";
  16481. }
  16482. return url;
  16483. }
  16484. pauseMusic(pause) {
  16485. if (pause) {
  16486. this.mute(true);
  16487. }
  16488. else if (this.isSound)
  16489. this.mute(false);
  16490. }
  16491. stopMusic() {
  16492. Laya.SoundManager.stopMusic();
  16493. if (Moyu.isNeedPlatAudio) {
  16494. Moyu.stopMusic();
  16495. }
  16496. }
  16497. mute(mute) {
  16498. if (Moyu.isNeedPlatAudio) {
  16499. Moyu.pauseMusic(mute);
  16500. }
  16501. else {
  16502. Laya.SoundManager.musicMuted = mute;
  16503. if (!mute && !this.musicPlayed && this.musicPath) {
  16504. this.playMusic(this.musicPath);
  16505. }
  16506. }
  16507. }
  16508. stopSound(path) {
  16509. let url = this.getUrl(path);
  16510. Laya.SoundManager.stopSound(url);
  16511. }
  16512. playSound(path, loop = 1, soundMax = this.soundMax) {
  16513. if (!this.isLoad)
  16514. return;
  16515. if (!this.isSound)
  16516. return;
  16517. if (!path || path == "")
  16518. return;
  16519. let url = this.getUrl(path);
  16520. if (Moyu.isNeedPlatAudio) {
  16521. Moyu.playSound(path, loop == 0);
  16522. }
  16523. else {
  16524. let count = 1;
  16525. if (this.soundMap[path])
  16526. count = this.soundMap[path] + 1;
  16527. if (count > soundMax)
  16528. return;
  16529. this.soundMap[path] = count;
  16530. Laya.SoundManager.playSound(url, loop);
  16531. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  16532. }
  16533. }
  16534. removePath(path) {
  16535. if (this.soundMap[path]) {
  16536. let count = this.soundMap[path];
  16537. count--;
  16538. if (count < 1)
  16539. delete this.soundMap[path];
  16540. else
  16541. this.soundMap[path] = count;
  16542. }
  16543. }
  16544. playBtnSound() {
  16545. this.playSound("btn");
  16546. }
  16547. playGetSound() {
  16548. }
  16549. playCloseUISound() {
  16550. }
  16551. }
  16552. SoundMgr._instance = null;
  16553. var Handler$1 = Laya.Handler;
  16554. var EResType;
  16555. (function (EResType) {
  16556. EResType[EResType["none"] = 0] = "none";
  16557. EResType[EResType["nromal"] = 1] = "nromal";
  16558. EResType[EResType["td"] = 2] = "td";
  16559. EResType[EResType["sk"] = 3] = "sk";
  16560. })(EResType || (EResType = {}));
  16561. class CResLoader {
  16562. constructor(doneCall, proCall) {
  16563. this.completrCall = doneCall;
  16564. this.progressCall = proCall;
  16565. this.progressHander = new Handler$1(this, this.onProgress);
  16566. this.tdResMap = {};
  16567. }
  16568. load(resList) {
  16569. this.resCount = 0;
  16570. this.loadCount = 0;
  16571. for (let i = 0; i < resList.length; i++) {
  16572. let path = resList[i];
  16573. if (!path)
  16574. continue;
  16575. this.resCount++;
  16576. let type = this.getResType(path);
  16577. if (type == EResType.nromal)
  16578. this.loadNromal(path);
  16579. else if (type == EResType.td)
  16580. this.loadTd(path);
  16581. }
  16582. }
  16583. getRes(path) {
  16584. let type = this.getResType(path);
  16585. if (type == EResType.nromal)
  16586. return Laya.loader.getRes(path);
  16587. else if (type == EResType.td) {
  16588. let res = this.tdResMap[path];
  16589. if (res)
  16590. return res.clone();
  16591. return null;
  16592. }
  16593. }
  16594. destroy() {
  16595. this.progressHander.clear();
  16596. this.progressHander = null;
  16597. }
  16598. clearRes(path) {
  16599. let type = this.getResType(path);
  16600. if (type == EResType.nromal)
  16601. Laya.loader.clearRes(path);
  16602. else if (type == EResType.td) {
  16603. let obj = this.tdResMap[path];
  16604. if (obj)
  16605. obj.destroy();
  16606. delete this.tdResMap[path];
  16607. }
  16608. }
  16609. getResType(path) {
  16610. let exs = this.getExtension(path);
  16611. if (exs == "sk")
  16612. return EResType.sk;
  16613. if (exs == "ls" || exs == "lh" || exs == "lm")
  16614. return EResType.td;
  16615. else
  16616. return EResType.nromal;
  16617. }
  16618. getExtension(res) {
  16619. var index = res.lastIndexOf(".");
  16620. return res.substr(index + 1);
  16621. }
  16622. loadNromal(path) {
  16623. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  16624. if (res) {
  16625. this.onLoad();
  16626. }
  16627. else
  16628. console.log("load res fail:" + path);
  16629. }), this.progressHander);
  16630. }
  16631. loadSk() {
  16632. }
  16633. loadTd(path) {
  16634. if (this.tdResMap[path]) {
  16635. this.onLoad();
  16636. return;
  16637. }
  16638. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  16639. if (res) {
  16640. this.tdResMap[path] = res;
  16641. this.onLoad();
  16642. }
  16643. else
  16644. console.log("load res fail:" + path);
  16645. }));
  16646. }
  16647. onLoad() {
  16648. this.loadCount++;
  16649. this.onProgress(1);
  16650. if (this.loadCount >= this.resCount) {
  16651. this.completrCall.run();
  16652. }
  16653. }
  16654. onProgress(pro) {
  16655. let progress = (this.loadCount + pro) / this.resCount;
  16656. this.progressCall.runWith(progress);
  16657. }
  16658. }
  16659. var Handler$2 = Laya.Handler;
  16660. class ResInfo {
  16661. constructor() {
  16662. this.index = 0;
  16663. }
  16664. }
  16665. class ResMgr {
  16666. constructor() {
  16667. this.resList = [];
  16668. this.doneList = [];
  16669. this.resMap = {};
  16670. this.currentLoad = null;
  16671. this.completeHandler = new Handler$2(this, this.onComplete);
  16672. this.progressHandler = new Handler$2(this, this.onProgress);
  16673. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  16674. }
  16675. static getInstance() {
  16676. if (ResMgr._instance == null) {
  16677. ResMgr._instance = new ResMgr();
  16678. }
  16679. return ResMgr._instance;
  16680. }
  16681. loadList(list, completeHandler, progressHandler) {
  16682. if (list.length < 1) {
  16683. completeHandler.run();
  16684. return;
  16685. }
  16686. let info = this.getResInfo();
  16687. info.resList = list;
  16688. info.completeHandler = completeHandler;
  16689. info.progressHandler = progressHandler;
  16690. this.resList.push(info);
  16691. this.startLoad();
  16692. }
  16693. loadFguiRes(list, completeHandler, progressHandler) {
  16694. Laya.loader.load(list, completeHandler, progressHandler);
  16695. }
  16696. loadAny(list, completeHandler, progressHandler) {
  16697. Laya.loader.load(list, completeHandler, progressHandler);
  16698. }
  16699. load(path, completeHandler, progressHandler) {
  16700. let count = this.resMap[path];
  16701. if (count && count > 0) {
  16702. if (completeHandler)
  16703. completeHandler.run();
  16704. }
  16705. else
  16706. this.loadList([path], completeHandler, progressHandler);
  16707. }
  16708. getRes(path) {
  16709. let res = this.resMap[path];
  16710. if (!res)
  16711. this.showLog("资源不存在:" + path);
  16712. else
  16713. return this.loader.getRes(path);
  16714. }
  16715. clearList(list, force = false) {
  16716. if (!list || list.length < 1)
  16717. return;
  16718. let cr = () => {
  16719. for (const k in list) {
  16720. let v = list[k];
  16721. if (!v)
  16722. continue;
  16723. if (force) {
  16724. this.loader.clearRes(v);
  16725. delete this.resMap[v];
  16726. }
  16727. else {
  16728. let count = this.resMap[v];
  16729. if (count && count > 1) {
  16730. count--;
  16731. this.resMap[v] = count;
  16732. }
  16733. else {
  16734. this.loader.clearRes(v);
  16735. delete this.resMap[v];
  16736. }
  16737. }
  16738. }
  16739. if (!window.hasOwnProperty("ks"))
  16740. Laya.Resource.destroyUnusedResources();
  16741. };
  16742. Laya.timer.clearAll(this);
  16743. Laya.timer.once(2000, this, cr);
  16744. }
  16745. clear3D() {
  16746. for (const k in this.loader.tdResMap) {
  16747. this.loader.clearRes(k);
  16748. if (this.resMap[k])
  16749. delete this.resMap[k];
  16750. }
  16751. if (!window.hasOwnProperty("ks"))
  16752. Laya.Resource.destroyUnusedResources();
  16753. }
  16754. clear(path, force = false) {
  16755. this.clearList([path], force);
  16756. }
  16757. getResInfo() {
  16758. if (this.doneList.length > 0)
  16759. return this.doneList.pop();
  16760. else
  16761. return new ResInfo();
  16762. }
  16763. startLoad() {
  16764. if (this.currentLoad)
  16765. return;
  16766. this.currentLoad = this.resList.pop();
  16767. if (this.currentLoad) {
  16768. this.loader.load(this.currentLoad.resList);
  16769. }
  16770. }
  16771. onComplete() {
  16772. if (!this.currentLoad)
  16773. return;
  16774. for (const k in this.currentLoad.resList) {
  16775. let v = this.currentLoad.resList[k];
  16776. let count = this.resMap[v];
  16777. if (count)
  16778. count++;
  16779. else
  16780. count = 1;
  16781. this.resMap[v] = count;
  16782. }
  16783. if (this.currentLoad.completeHandler)
  16784. this.currentLoad.completeHandler.run();
  16785. this.doneList.push(this.currentLoad);
  16786. this.currentLoad = null;
  16787. this.startLoad();
  16788. }
  16789. onProgress(pro) {
  16790. if (!this.currentLoad)
  16791. return;
  16792. if (this.currentLoad.progressHandler)
  16793. this.currentLoad.progressHandler.runWith(pro);
  16794. }
  16795. showLog(str, ...args) {
  16796. console.log("[ResLoader] " + str);
  16797. }
  16798. }
  16799. ResMgr._instance = null;
  16800. class EventMgr extends Laya.EventDispatcher {
  16801. }
  16802. let eventMgr = new EventMgr();
  16803. /*! *****************************************************************************
  16804. Copyright (c) Microsoft Corporation. All rights reserved.
  16805. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  16806. this file except in compliance with the License. You may obtain a copy of the
  16807. License at http://www.apache.org/licenses/LICENSE-2.0
  16808. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  16809. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  16810. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  16811. MERCHANTABLITY OR NON-INFRINGEMENT.
  16812. See the Apache Version 2.0 License for specific language governing permissions
  16813. and limitations under the License.
  16814. ***************************************************************************** */
  16815. /* global Reflect, Promise */
  16816. var extendStatics = function(d, b) {
  16817. extendStatics = Object.setPrototypeOf ||
  16818. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  16819. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  16820. return extendStatics(d, b);
  16821. };
  16822. function __extends(d, b) {
  16823. extendStatics(d, b);
  16824. function __() { this.constructor = d; }
  16825. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  16826. }
  16827. var __assign = function() {
  16828. __assign = Object.assign || function __assign(t) {
  16829. for (var s, i = 1, n = arguments.length; i < n; i++) {
  16830. s = arguments[i];
  16831. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  16832. }
  16833. return t;
  16834. };
  16835. return __assign.apply(this, arguments);
  16836. };
  16837. function __rest(s, e) {
  16838. var t = {};
  16839. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  16840. t[p] = s[p];
  16841. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  16842. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
  16843. t[p[i]] = s[p[i]];
  16844. return t;
  16845. }
  16846. function __decorate(decorators, target, key, desc) {
  16847. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  16848. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  16849. 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;
  16850. return c > 3 && r && Object.defineProperty(target, key, r), r;
  16851. }
  16852. function __param(paramIndex, decorator) {
  16853. return function (target, key) { decorator(target, key, paramIndex); }
  16854. }
  16855. function __metadata(metadataKey, metadataValue) {
  16856. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  16857. }
  16858. function __awaiter(thisArg, _arguments, P, generator) {
  16859. return new (P || (P = Promise))(function (resolve, reject) {
  16860. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  16861. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  16862. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  16863. step((generator = generator.apply(thisArg, _arguments || [])).next());
  16864. });
  16865. }
  16866. function __generator(thisArg, body) {
  16867. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  16868. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  16869. function verb(n) { return function (v) { return step([n, v]); }; }
  16870. function step(op) {
  16871. if (f) throw new TypeError("Generator is already executing.");
  16872. while (_) try {
  16873. 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;
  16874. if (y = 0, t) op = [op[0] & 2, t.value];
  16875. switch (op[0]) {
  16876. case 0: case 1: t = op; break;
  16877. case 4: _.label++; return { value: op[1], done: false };
  16878. case 5: _.label++; y = op[1]; op = [0]; continue;
  16879. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  16880. default:
  16881. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  16882. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  16883. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  16884. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  16885. if (t[2]) _.ops.pop();
  16886. _.trys.pop(); continue;
  16887. }
  16888. op = body.call(thisArg, _);
  16889. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  16890. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  16891. }
  16892. }
  16893. function __exportStar(m, exports) {
  16894. for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  16895. }
  16896. function __values(o) {
  16897. var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
  16898. if (m) return m.call(o);
  16899. return {
  16900. next: function () {
  16901. if (o && i >= o.length) o = void 0;
  16902. return { value: o && o[i++], done: !o };
  16903. }
  16904. };
  16905. }
  16906. function __read(o, n) {
  16907. var m = typeof Symbol === "function" && o[Symbol.iterator];
  16908. if (!m) return o;
  16909. var i = m.call(o), r, ar = [], e;
  16910. try {
  16911. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  16912. }
  16913. catch (error) { e = { error: error }; }
  16914. finally {
  16915. try {
  16916. if (r && !r.done && (m = i["return"])) m.call(i);
  16917. }
  16918. finally { if (e) throw e.error; }
  16919. }
  16920. return ar;
  16921. }
  16922. function __spread() {
  16923. for (var ar = [], i = 0; i < arguments.length; i++)
  16924. ar = ar.concat(__read(arguments[i]));
  16925. return ar;
  16926. }
  16927. function __await(v) {
  16928. return this instanceof __await ? (this.v = v, this) : new __await(v);
  16929. }
  16930. function __asyncGenerator(thisArg, _arguments, generator) {
  16931. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  16932. var g = generator.apply(thisArg, _arguments || []), i, q = [];
  16933. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  16934. 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); }); }; }
  16935. function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  16936. function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  16937. function fulfill(value) { resume("next", value); }
  16938. function reject(value) { resume("throw", value); }
  16939. function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
  16940. }
  16941. function __asyncDelegator(o) {
  16942. var i, p;
  16943. return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  16944. 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; }
  16945. }
  16946. function __asyncValues(o) {
  16947. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  16948. var m = o[Symbol.asyncIterator], i;
  16949. 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);
  16950. 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); }); }; }
  16951. function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
  16952. }
  16953. function __makeTemplateObject(cooked, raw) {
  16954. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  16955. return cooked;
  16956. };
  16957. function __importStar(mod) {
  16958. if (mod && mod.__esModule) return mod;
  16959. var result = {};
  16960. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  16961. result.default = mod;
  16962. return result;
  16963. }
  16964. function __importDefault(mod) {
  16965. return (mod && mod.__esModule) ? mod : { default: mod };
  16966. }
  16967. class CustomAlert {
  16968. static show(title, content, buttons) {
  16969. if (!Laya.Box || !Laya.Label || !Laya.Button) {
  16970. console.error("UI模块未加载!请检查laya.ui.js是否引入");
  16971. return;
  16972. }
  16973. const bg = new Laya.Box();
  16974. bg.alpha = 0;
  16975. bg.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height, "#000000AA");
  16976. Laya.stage.addChild(bg);
  16977. Laya.Tween.to(bg, { alpha: 1 }, 200);
  16978. const panel = new Laya.Box();
  16979. panel.graphics.drawRect(0, 0, 400, 250, "#cccccc");
  16980. panel.pos((Laya.stage.width - 400) / 2, (Laya.stage.height - 250) / 2);
  16981. bg.addChild(panel);
  16982. const titleText = new Laya.Text();
  16983. titleText.text = title;
  16984. titleText.fontSize = 32;
  16985. titleText.color = "#333333";
  16986. titleText.bold = true;
  16987. titleText.pos(20, 20);
  16988. titleText.width = 360;
  16989. titleText.align = "center";
  16990. panel.addChild(titleText);
  16991. const contentText = new Laya.Text();
  16992. contentText.text = content;
  16993. contentText.fontSize = 21;
  16994. contentText.color = "#555555";
  16995. contentText.pos(20, 70);
  16996. contentText.width = 360;
  16997. contentText.wordWrap = true;
  16998. contentText.align = "center";
  16999. panel.addChild(contentText);
  17000. const buttonContainer = new Laya.Box();
  17001. buttonContainer.pos(20, 160);
  17002. panel.addChild(buttonContainer);
  17003. const btnWidth = 120;
  17004. const spacing = 30;
  17005. const totalWidth = buttons.length * btnWidth + (buttons.length - 1) * spacing;
  17006. buttons.forEach((btn, index) => {
  17007. const button = new Laya.Button();
  17008. button.label = btn.label;
  17009. button.size(btnWidth, 40);
  17010. button.labelSize = 22;
  17011. button.pos(index * (btnWidth + spacing), 0);
  17012. button.labelColors = "#FFFFFF,#FFFFFF,#FFFFFF";
  17013. button.graphics.drawRect(0, 0, btnWidth, 40, "#4A90E2");
  17014. button.on(Laya.Event.MOUSE_OVER, this, () => {
  17015. button.alpha = 0.9;
  17016. });
  17017. button.on(Laya.Event.MOUSE_OUT, this, () => {
  17018. button.alpha = 1;
  17019. });
  17020. button.on(Laya.Event.CLICK, this, () => {
  17021. btn.handler();
  17022. Laya.Tween.to(bg, { alpha: 0 }, 200, null, Laya.Handler.create(this, () => {
  17023. bg.removeSelf();
  17024. }));
  17025. });
  17026. buttonContainer.addChild(button);
  17027. });
  17028. buttonContainer.x = (panel.width - totalWidth) / 2;
  17029. }
  17030. }
  17031. class ConfigMgr {
  17032. constructor() {
  17033. this.httpReqCount = 4;
  17034. this.httpReqOkCount = 0;
  17035. this.getConfigFromServer = () => __awaiter(this, void 0, void 0, function* () {
  17036. try {
  17037. this.httpReqOkCount = 0;
  17038. let reqData = JSON.stringify({
  17039. gameName: "TQ",
  17040. gameUserName: "zhangSan"
  17041. });
  17042. console.log('zh:第1个请求');
  17043. const classicCfg = yield this.sendPostAsync('getClassicCfg', reqData);
  17044. this.classicCfg = classicCfg;
  17045. this.httpReqOkCount++;
  17046. console.log('zh:第2个请求');
  17047. const levelCfg = yield this.sendPostAsync('getLevelCfg', reqData);
  17048. this.levelCfg = levelCfg;
  17049. this.httpReqOkCount++;
  17050. console.log('zh:第3个请求');
  17051. const placeBallCfg = yield this.sendPostAsync('getPlaceBallCfg', reqData);
  17052. this.placeBallCfg = placeBallCfg;
  17053. this.httpReqOkCount++;
  17054. console.log('zh:第4个请求npc');
  17055. const npc = yield this.sendPostAsync('getNpc', reqData);
  17056. this.npcJson = npc.Data;
  17057. this.httpReqOkCount++;
  17058. console.log('zh:所有配置加载完成');
  17059. }
  17060. catch (error) {
  17061. console.error('请求失败:', error);
  17062. }
  17063. finally {
  17064. if (this.httpReqCount > this.httpReqOkCount) {
  17065. CustomAlert.show("Prompt", "Failed to load resources. Check your network and restart the game.", [
  17066. {
  17067. label: "Okay", handler: () => {
  17068. console.log("zh:好的知道了");
  17069. JSBridgeUtils.instance.exitAndCloseGame();
  17070. }
  17071. }
  17072. ]);
  17073. }
  17074. }
  17075. });
  17076. this.sendPostAsync = (action, reqData) => {
  17077. return new Promise((resolve, reject) => {
  17078. xGame.httpMgr.sendPost2025(action, reqData, (res) => {
  17079. try {
  17080. let code = res.code;
  17081. if (code == 200) {
  17082. const parsedData = JSON.parse(res.msg);
  17083. resolve(parsedData);
  17084. }
  17085. else {
  17086. console.log(`zh:res = ${JSON.stringify(res)}`);
  17087. reject(new Error(`Request failed with code: ${code}`));
  17088. }
  17089. }
  17090. catch (error) {
  17091. console.error(`error=${error}`);
  17092. alert("Please check your network connection.");
  17093. reject(error);
  17094. }
  17095. finally {
  17096. console.log(`zh:${action}`);
  17097. }
  17098. });
  17099. });
  17100. };
  17101. }
  17102. static getInstance() {
  17103. if (!this._instance) {
  17104. this._instance = new ConfigMgr();
  17105. }
  17106. return this._instance;
  17107. }
  17108. init() {
  17109. this.getConfigFromServer();
  17110. }
  17111. test() {
  17112. let reqData = JSON.stringify({
  17113. gameName: "TQ",
  17114. gameUserName: "zhangSan"
  17115. });
  17116. xGame.httpMgr.sendPost2025('getClassicCfg', reqData, (res) => {
  17117. console.log('zh:1s');
  17118. try {
  17119. let code = res.code;
  17120. let data = res.data;
  17121. if (code == 200) {
  17122. const parsedData = JSON.parse(data);
  17123. this.classicCfg = parsedData;
  17124. }
  17125. else {
  17126. console.log('zh:res = ' + JSON.stringify(res));
  17127. }
  17128. }
  17129. catch (error) {
  17130. console.log('error=' + error);
  17131. alert("Please check your network connection.");
  17132. }
  17133. finally {
  17134. console.log('zh:1');
  17135. }
  17136. });
  17137. }
  17138. getUserInfoByIndex(index) {
  17139. return this.npcJson[index];
  17140. }
  17141. getRandomUserInfo() {
  17142. let index = xGame.tools.random(0, this.npcJson.length);
  17143. let rs = this.npcJson[index];
  17144. return rs;
  17145. }
  17146. getMaxBigMoveLength() {
  17147. return Object.keys(this.levelCfg).length;
  17148. }
  17149. getBigMoveLevelByIndex(index) {
  17150. let cfg = this.levelCfg;
  17151. cfg = cfg[index];
  17152. return cfg;
  17153. }
  17154. getRandomClassicLevel() {
  17155. let cfg = this.classicCfg;
  17156. let num = Object.keys(cfg).length;
  17157. let rand = xGame.common.randomNum(1, num);
  17158. return cfg[rand];
  17159. }
  17160. getPlaceBallByLevel(level) {
  17161. return this.placeBallCfg[level];
  17162. }
  17163. getMaxPlaceBall() {
  17164. return Object.keys(this.placeBallCfg).length;
  17165. }
  17166. }
  17167. class PoolD3Mgr {
  17168. constructor() {
  17169. this.pool = {};
  17170. }
  17171. static get ins() {
  17172. return this._ins || (this._ins = new PoolD3Mgr);
  17173. }
  17174. createList(key, prefab, parent) {
  17175. if (!this.pool[key]) {
  17176. this.pool[key] = {};
  17177. this.pool[key].prefab = prefab;
  17178. this.pool[key].list = [];
  17179. this.pool[key].parent = parent;
  17180. }
  17181. }
  17182. getItem(key) {
  17183. if (!this.pool[key]) {
  17184. return;
  17185. }
  17186. let temp;
  17187. if (this.pool[key].list.length > 0) {
  17188. temp = this.pool[key].list.pop();
  17189. }
  17190. else {
  17191. temp = this.pool[key].prefab.clone();
  17192. if (this.pool[key].parent) {
  17193. this.pool[key].parent.addChild(temp);
  17194. }
  17195. }
  17196. temp.active = true;
  17197. return temp;
  17198. }
  17199. putItem(key, obj) {
  17200. if (!this.pool[key]) {
  17201. return;
  17202. }
  17203. obj.active = false;
  17204. this.pool[key].list.push(obj);
  17205. }
  17206. }
  17207. let context$1 = context;
  17208. let uiMgr = UIMgr.inst;
  17209. let soundMgr = SoundMgr.getInstance();
  17210. let resMgr = ResMgr.getInstance();
  17211. let httpMgr = HttpMgr.getInstance();
  17212. let common = Common.getInstance();
  17213. let cfgMgr = ConfigMgr.getInstance();
  17214. let poolD3Mgr = PoolD3Mgr.ins;
  17215. let d3TexUrl = "res/d3Res/";
  17216. let d3ModeUrl = "res/unityRes/";
  17217. function setStageSize(view) {
  17218. if (view.width) {
  17219. view.width = Laya.stage.width;
  17220. view.height = Laya.stage.height;
  17221. }
  17222. }
  17223. function filledBg(view) {
  17224. let wh = Laya.stage.height / Laya.stage.width;
  17225. if (wh > 16 / 9) {
  17226. view.height = Laya.stage.height;
  17227. view.width = Laya.stage.height / 1334 * 750;
  17228. }
  17229. else {
  17230. view.width = Laya.stage.width;
  17231. view.height = Laya.stage.width / 750 * 1334;
  17232. }
  17233. }
  17234. function setNotch(view) {
  17235. if (view.height) {
  17236. view.y += context$1.notchHeight;
  17237. }
  17238. }
  17239. function showTip(str) {
  17240. uiMgr.Show(UIMsg, str);
  17241. }
  17242. function log(...args) {
  17243. console.log(args);
  17244. }
  17245. let xGame = {
  17246. context: context$1,
  17247. eventMgr,
  17248. resMgr,
  17249. uiMgr,
  17250. soundMgr,
  17251. define,
  17252. tools,
  17253. httpMgr,
  17254. d3TexUrl,
  17255. d3ModeUrl,
  17256. common,
  17257. cfgMgr,
  17258. poolD3Mgr,
  17259. setStageSize,
  17260. filledBg,
  17261. setNotch,
  17262. showTip,
  17263. log,
  17264. };
  17265. window["xGame"] = xGame;
  17266. let dataName = 'tBall_';
  17267. class UserData {
  17268. constructor() {
  17269. this.userId = "";
  17270. this.isAgree = false;
  17271. this.coinNum = 0;
  17272. this.gemNum = 0;
  17273. this.sound = true;
  17274. this.vibration = true;
  17275. this.currentDate = 0;
  17276. this.createTime = 0;
  17277. this.awardTime = 0;
  17278. this.roleId = 1;
  17279. this.roleList = [];
  17280. this.roleAds = [];
  17281. this.dressId = 101;
  17282. this.itemId = 201;
  17283. this.bigSkills = [1, 1, 1, 1, 1];
  17284. this.coin = 4000;
  17285. this.diamond = 0;
  17286. this.skillSuccessTimes = 0;
  17287. this.skillGuide = 0;
  17288. this.skillAccTimes = 0;
  17289. this.placeBallData = [];
  17290. this.shareDiamondTimes = 0;
  17291. this.dailyVideoShareTimes = 0;
  17292. this.secretary = [1, 0];
  17293. this.curSecretary = 0;
  17294. this.ballRod = [1, 0, 0, 0, 0, 1];
  17295. this.curBallRod = 5;
  17296. this.signData = 0;
  17297. this.signTime = 0;
  17298. this.drawTimes = 0;
  17299. this.drawAwardTimes = 0;
  17300. this.dailyfreeDrawTimes = 1;
  17301. this.power = 5;
  17302. this.powerTime = 0;
  17303. this.challengeTimes = 0;
  17304. this.extraSign = 0;
  17305. this.classicTimes = 0;
  17306. this.guideHelpLine = 0;
  17307. this.newUser = true;
  17308. this.rootBallFoul = 0;
  17309. this.timeoutFoul = 0;
  17310. this.roleList = [1];
  17311. }
  17312. saveData() {
  17313. let data = {};
  17314. for (let k in this) {
  17315. data[k.toString()] = this[k];
  17316. }
  17317. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  17318. }
  17319. getData() {
  17320. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  17321. if (ld) {
  17322. let localData = JSON.parse(ld);
  17323. if (localData) {
  17324. for (let k in this) {
  17325. let key = k.toString();
  17326. let data = localData[key];
  17327. if (data != undefined) {
  17328. this[k] = data;
  17329. }
  17330. }
  17331. }
  17332. }
  17333. }
  17334. }
  17335. class ItemData {
  17336. constructor() {
  17337. this.itemList = {};
  17338. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  17339. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  17340. }
  17341. saveData() {
  17342. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  17343. }
  17344. getData() {
  17345. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  17346. if (ld) {
  17347. let localData = JSON.parse(ld);
  17348. if (localData) {
  17349. this.itemList = localData;
  17350. }
  17351. }
  17352. }
  17353. }
  17354. class GameData {
  17355. constructor() {
  17356. this.curLevel = 0;
  17357. this.gameType = 1;
  17358. this.signIdx = 0;
  17359. this.signMax = 0;
  17360. this.rotaryTime = 0;
  17361. this.rotaryCount = 0;
  17362. this.rotaryList = [];
  17363. this.diyCount = 3;
  17364. this.awardIdx = 0;
  17365. this.shareNum = 2;
  17366. this.rankWeek = 0;
  17367. this.rankScore = 0;
  17368. this.gameCount = 0;
  17369. this.trySkill = -1;
  17370. this.tryTime = 0;
  17371. }
  17372. saveData() {
  17373. let data = {};
  17374. for (let k in this) {
  17375. data[k.toString()] = this[k];
  17376. }
  17377. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  17378. }
  17379. getData() {
  17380. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  17381. if (ld) {
  17382. let localData = JSON.parse(ld);
  17383. if (localData) {
  17384. for (let k in this) {
  17385. let key = k.toString();
  17386. let data = localData[key];
  17387. if (data != undefined) {
  17388. this[k] = data;
  17389. }
  17390. }
  17391. }
  17392. }
  17393. }
  17394. }
  17395. class Diy2025GameData {
  17396. constructor() {
  17397. this.challengeMode_overLev = 0;
  17398. this.xszyForClassic = false;
  17399. this.xszyForChallenge = false;
  17400. }
  17401. saveData() {
  17402. let data = {};
  17403. for (let k in this) {
  17404. data[k.toString()] = this[k];
  17405. }
  17406. Laya.LocalStorage.setItem(dataName + "diydata", JSON.stringify(data));
  17407. }
  17408. getData() {
  17409. let ld = Laya.LocalStorage.getItem(dataName + "diydata");
  17410. if (ld) {
  17411. let localData = JSON.parse(ld);
  17412. if (localData) {
  17413. for (let k in this) {
  17414. let key = k.toString();
  17415. let data = localData[key];
  17416. if (data != undefined) {
  17417. this[k] = data;
  17418. }
  17419. }
  17420. }
  17421. }
  17422. }
  17423. }
  17424. class DataMgr {
  17425. static Init() {
  17426. this.userData = new UserData();
  17427. this.gameData = new GameData();
  17428. this.itemData = new ItemData();
  17429. this.diyGameData = new Diy2025GameData();
  17430. this.userData.getData();
  17431. this.gameData.getData();
  17432. this.itemData.getData();
  17433. this.diyGameData.getData();
  17434. this.roleId = this.userData.roleId;
  17435. this.resetUse();
  17436. }
  17437. static isNewDay() {
  17438. Moyu.isNewDay(this, (isnew) => {
  17439. xGame.common.isNewDay = isnew;
  17440. if (!isnew)
  17441. return;
  17442. DataMgr.setShareDiamondTimes(0, false);
  17443. DataMgr.setDailyVideoShareTimes(0, false);
  17444. DataMgr.setDailyfreeDrawTimes(1);
  17445. DataMgr.setExtraSign(0);
  17446. });
  17447. }
  17448. static deletData() {
  17449. Laya.LocalStorage.clear();
  17450. }
  17451. static upRankData() {
  17452. let num = xGame.common.getAllStarNum();
  17453. if (num > 0)
  17454. Moyu.upRankData(xGame.common.curRankID, num);
  17455. }
  17456. static addItem(id, count = 1) {
  17457. let v = this.itemData.itemList[id];
  17458. if (!v)
  17459. v = { id: id, count: count, adnum: 0, active: true };
  17460. else {
  17461. if (v.active) {
  17462. v.count += count;
  17463. }
  17464. else {
  17465. v.count = count;
  17466. v.active = true;
  17467. }
  17468. }
  17469. this.itemData.itemList[id] = v;
  17470. xGame.soundMgr.playGetSound();
  17471. this.saveItemData();
  17472. }
  17473. static hasItem(id) {
  17474. let v = this.itemData.itemList[id];
  17475. if (v && v.active)
  17476. return true;
  17477. return false;
  17478. }
  17479. static getItem(id) {
  17480. let v = this.itemData.itemList[id];
  17481. return v;
  17482. }
  17483. static getItemCount(id) {
  17484. let v = this.itemData.itemList[id];
  17485. if (v && v.active)
  17486. return v.count;
  17487. return 0;
  17488. }
  17489. static getItemAd(id) {
  17490. let v = this.itemData.itemList[id];
  17491. if (v) {
  17492. return v.adnum;
  17493. }
  17494. return 0;
  17495. }
  17496. static onItemAd(id, num = 1) {
  17497. let v = this.itemData.itemList[id];
  17498. if (!v)
  17499. v = { id: id, count: 1, adnum: num, active: false };
  17500. else
  17501. v.adnum += num;
  17502. this.itemData.itemList[id] = v;
  17503. this.saveItemData();
  17504. }
  17505. static costItem(id, count) {
  17506. let v = this.itemData.itemList[id];
  17507. if (v && v.active) {
  17508. if (v.count < count)
  17509. return false;
  17510. else {
  17511. v.count -= count;
  17512. this.itemData.itemList[id] = v;
  17513. return true;
  17514. }
  17515. }
  17516. return false;
  17517. }
  17518. static resetUse() {
  17519. this.dressId = this.userData.dressId;
  17520. this.itemId = this.userData.itemId;
  17521. }
  17522. static passLevel() {
  17523. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  17524. this.gameData.curLevel++;
  17525. this.curLevel = this.gameData.curLevel;
  17526. this.saveGameData();
  17527. }
  17528. static useRole(id) {
  17529. this.roleId = id;
  17530. if (this.hasRole(id)) {
  17531. this.userData.roleId = id;
  17532. this.saveUserData();
  17533. }
  17534. }
  17535. static addRole(id) {
  17536. if (this.hasRole(id))
  17537. return;
  17538. this.userData.roleList.push(id);
  17539. this.saveUserData();
  17540. }
  17541. static hasRole(id) {
  17542. return this.userData.roleList.indexOf(id) >= 0;
  17543. }
  17544. static gemEnough(num) {
  17545. return this.userData.gemNum >= num;
  17546. }
  17547. static roleHasAd(id) {
  17548. let count = this.userData.roleAds[id];
  17549. if (count != undefined && count >= 0)
  17550. return true;
  17551. else
  17552. return false;
  17553. }
  17554. static saveUserData(time = 500, event, arg) {
  17555. if (this.userSaving)
  17556. return;
  17557. this.userSaving = true;
  17558. Laya.timer.once(time, this, () => {
  17559. this.userSaving = false;
  17560. this.userData.saveData();
  17561. if (event)
  17562. xGame.eventMgr.event(event, arg);
  17563. });
  17564. }
  17565. static saveGameData() {
  17566. if (this.gameSaving)
  17567. return;
  17568. this.gameSaving = true;
  17569. Laya.timer.once(1000, this, () => {
  17570. this.gameSaving = false;
  17571. this.gameData.saveData();
  17572. });
  17573. }
  17574. static saveItemData() {
  17575. let fun = () => {
  17576. this.itemData.saveData();
  17577. };
  17578. Laya.timer.clear(this, fun);
  17579. Laya.timer.once(500, this, fun);
  17580. }
  17581. static saveData() {
  17582. this.saveUserData();
  17583. this.saveGameData();
  17584. }
  17585. static getBigSkillList() {
  17586. return this.userData.bigSkills;
  17587. }
  17588. static getBigSkillByIndex(index) {
  17589. return this.userData.bigSkills[index];
  17590. }
  17591. static setBigSkill(index, val, addUp = true) {
  17592. if (addUp) {
  17593. this.userData.bigSkills[index] += val;
  17594. }
  17595. else {
  17596. this.userData.bigSkills[index] = val;
  17597. }
  17598. this.saveUserData();
  17599. }
  17600. static coinEnough(need) {
  17601. if (typeof need != "number") {
  17602. console.error("金币格式错误");
  17603. return;
  17604. }
  17605. return this.userData.coin >= need;
  17606. }
  17607. static setCoin(val) {
  17608. if (typeof val != "number") {
  17609. return;
  17610. }
  17611. this.userData.coin += val;
  17612. this.saveUserData();
  17613. xGame.eventMgr.event(COIN_CHANGE);
  17614. }
  17615. static getCoin() {
  17616. return this.userData.coin;
  17617. }
  17618. static diamondEnough(need) {
  17619. if (typeof need != "number") {
  17620. console.error("金币格式错误");
  17621. return;
  17622. }
  17623. return this.userData.diamond >= need;
  17624. }
  17625. static setDiamond(val) {
  17626. if (typeof val != "number") {
  17627. return;
  17628. }
  17629. this.userData.diamond += val;
  17630. this.saveUserData();
  17631. xGame.eventMgr.event(DIAMOND_CHANGE);
  17632. }
  17633. static getDiamond() {
  17634. return this.userData.diamond;
  17635. }
  17636. static getSkillSuccessTimes() {
  17637. return this.userData.skillSuccessTimes;
  17638. }
  17639. static setSkillSuccessTimes(val, addUp = true) {
  17640. if (addUp)
  17641. this.userData.skillSuccessTimes += val;
  17642. else
  17643. this.userData.skillSuccessTimes = val;
  17644. this.saveUserData();
  17645. }
  17646. static getSkillAccTimes() {
  17647. return this.userData.skillAccTimes;
  17648. }
  17649. static setSkillAccTimes(val) {
  17650. this.userData.skillAccTimes += val;
  17651. this.saveUserData();
  17652. }
  17653. static getSkillGuide() {
  17654. if (!xGame.common.openGuide) {
  17655. return 1;
  17656. }
  17657. return this.userData.skillGuide;
  17658. }
  17659. static setSkillGuide(val) {
  17660. this.userData.skillGuide = val;
  17661. this.saveUserData();
  17662. }
  17663. static getPlaceBallLevelList() {
  17664. return this.userData.placeBallData;
  17665. }
  17666. static getPlaceBallLevel(level) {
  17667. let arr = this.userData.placeBallData;
  17668. let index = level - 1;
  17669. let out;
  17670. if (arr[index]) {
  17671. out = arr[index];
  17672. }
  17673. else {
  17674. let max = arr.length;
  17675. if (max == index) {
  17676. out = {
  17677. star: 0,
  17678. play: true,
  17679. isCur: true,
  17680. getAward: false
  17681. };
  17682. }
  17683. else {
  17684. out = {
  17685. star: 0,
  17686. play: false,
  17687. getAward: false
  17688. };
  17689. }
  17690. }
  17691. return out;
  17692. }
  17693. static setPlaceBallLevel(level, star) {
  17694. let arr = this.userData.placeBallData;
  17695. let index = level - 1;
  17696. if (arr[index]) {
  17697. arr[index].star = Math.max(arr[index].star, star);
  17698. }
  17699. else {
  17700. let max = arr.length;
  17701. if (max == index) {
  17702. arr.push({
  17703. star: star,
  17704. play: true,
  17705. getAward: false
  17706. });
  17707. }
  17708. else {
  17709. console.error("关卡存储出错");
  17710. }
  17711. }
  17712. this.saveUserData();
  17713. }
  17714. static setPlaceBallAward(level) {
  17715. let arr = this.userData.placeBallData;
  17716. let index = level - 1;
  17717. if (arr[index]) {
  17718. arr[index].getAward = true;
  17719. }
  17720. this.saveUserData();
  17721. }
  17722. static getShareDiamondTimes() {
  17723. return this.userData.shareDiamondTimes;
  17724. }
  17725. static setShareDiamondTimes(val, addUp = true) {
  17726. if (addUp) {
  17727. this.userData.shareDiamondTimes += val;
  17728. }
  17729. else {
  17730. this.userData.shareDiamondTimes = val;
  17731. }
  17732. this.saveUserData();
  17733. }
  17734. static getDailyVideoShareTimes() {
  17735. return this.userData.dailyVideoShareTimes;
  17736. }
  17737. static setDailyVideoShareTimes(val, addUp = true) {
  17738. if (addUp) {
  17739. this.userData.dailyVideoShareTimes += val;
  17740. }
  17741. else {
  17742. this.userData.dailyVideoShareTimes = val;
  17743. }
  17744. this.saveUserData();
  17745. }
  17746. static getSecretary(index) {
  17747. return this.userData.secretary[index];
  17748. }
  17749. static setSecretary(index, val) {
  17750. this.userData.secretary[index] = val;
  17751. this.saveUserData();
  17752. }
  17753. static getCurSecretary() {
  17754. return this.userData.curSecretary;
  17755. }
  17756. static setCurSecretary(index) {
  17757. this.userData.curSecretary = index;
  17758. this.saveUserData();
  17759. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  17760. }
  17761. static getBallRod(index) {
  17762. return this.userData.ballRod[index];
  17763. }
  17764. static setBallRod(index, val) {
  17765. this.userData.ballRod[index] = val;
  17766. this.saveUserData();
  17767. }
  17768. static getCurBallRod() {
  17769. return this.userData.curBallRod;
  17770. }
  17771. static setCurBallRod(index) {
  17772. this.userData.curBallRod = index;
  17773. this.saveUserData();
  17774. }
  17775. static setSignData(val) {
  17776. this.userData.signData = val;
  17777. this.saveUserData();
  17778. }
  17779. static getSignData() {
  17780. return this.userData.signData;
  17781. }
  17782. static setSignTime(val) {
  17783. this.userData.signTime = val;
  17784. this.saveUserData();
  17785. }
  17786. static getSignTime() {
  17787. return this.userData.signTime;
  17788. }
  17789. static getDrawTimes() {
  17790. return this.userData.drawTimes;
  17791. }
  17792. static setDrawTimes(val, addUp = true) {
  17793. if (addUp) {
  17794. this.userData.drawTimes += val;
  17795. }
  17796. else {
  17797. this.userData.drawTimes = val;
  17798. }
  17799. this.saveUserData();
  17800. }
  17801. static getDrawAwardTimes() {
  17802. return this.userData.drawAwardTimes;
  17803. }
  17804. static setDrawAwardTimes(val) {
  17805. this.userData.drawAwardTimes = val;
  17806. this.saveUserData();
  17807. }
  17808. static getDailyfreeDrawTimes() {
  17809. return this.userData.dailyfreeDrawTimes;
  17810. }
  17811. static setDailyfreeDrawTimes(val) {
  17812. this.userData.dailyfreeDrawTimes = val;
  17813. this.saveUserData();
  17814. }
  17815. static setPower(val, addUp = true) {
  17816. if (addUp)
  17817. this.userData.power += val;
  17818. else
  17819. this.userData.power = val;
  17820. if (this.userData.power >= xGame.common.maxPower) {
  17821. this.userData.power = xGame.common.maxPower;
  17822. }
  17823. xGame.eventMgr.event(POWER_CHANGE, val);
  17824. this.saveUserData();
  17825. }
  17826. static getPower() {
  17827. return this.userData.power;
  17828. }
  17829. static setPowerTime(val) {
  17830. this.userData.powerTime = val;
  17831. this.saveUserData();
  17832. }
  17833. static getPowerTime() {
  17834. return this.userData.powerTime;
  17835. }
  17836. static powerEnough() {
  17837. return this.getPower() > 0;
  17838. }
  17839. static getChallengeTimes() {
  17840. return this.userData.challengeTimes;
  17841. }
  17842. static setChallengeTimes(val) {
  17843. this.userData.challengeTimes += val;
  17844. this.saveUserData();
  17845. }
  17846. static getExtraSign() {
  17847. return this.userData.extraSign;
  17848. }
  17849. static setExtraSign(val) {
  17850. this.userData.extraSign = val;
  17851. this.saveUserData();
  17852. }
  17853. static getClassicTimes() {
  17854. return this.userData.classicTimes;
  17855. }
  17856. static setClassicTimes() {
  17857. this.userData.classicTimes += 1;
  17858. this.saveUserData();
  17859. }
  17860. static getGuideHelpLine() {
  17861. return this.userData.guideHelpLine;
  17862. }
  17863. static setGuideHelpLine() {
  17864. this.userData.guideHelpLine = 1;
  17865. this.saveUserData();
  17866. }
  17867. static getNewUser() {
  17868. return this.userData.newUser;
  17869. }
  17870. static setNewUser() {
  17871. this.userData.newUser = false;
  17872. this.saveUserData();
  17873. }
  17874. static getRootBallFoul() {
  17875. return this.userData.rootBallFoul;
  17876. }
  17877. static setRootBallFoul() {
  17878. this.userData.rootBallFoul = 1;
  17879. this.saveUserData();
  17880. }
  17881. static getTimeoutFoul() {
  17882. return this.userData.timeoutFoul;
  17883. }
  17884. static setTimeoutFoul() {
  17885. this.userData.timeoutFoul = 1;
  17886. this.saveUserData();
  17887. }
  17888. static saveDiyGameData() {
  17889. if (this.diyGameSaving)
  17890. return;
  17891. this.diyGameSaving = true;
  17892. Laya.timer.once(500, this, () => {
  17893. this.diyGameSaving = false;
  17894. this.diyGameData.saveData();
  17895. });
  17896. }
  17897. static getChallengeMode_overLev() {
  17898. this.challengeMode_overLev = this.diyGameData.challengeMode_overLev;
  17899. return this.challengeMode_overLev;
  17900. }
  17901. static setChallengeMode_overLev(levNum) {
  17902. this.diyGameData.challengeMode_overLev = levNum;
  17903. this.saveDiyGameData();
  17904. }
  17905. }
  17906. DataMgr.isNewUser = false;
  17907. DataMgr.fristEnter = true;
  17908. DataMgr.levelType = 0;
  17909. DataMgr.DIY_challengeMode_overLev_jieSuo_mark = true;
  17910. DataMgr.DIY_challengeMode_overLev_jieSuo_Classic = 2;
  17911. DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod = 4;
  17912. DataMgr.challengeMode_overLev = 0;
  17913. DataMgr.xszyForClassic = false;
  17914. DataMgr.xszyForChallenge = false;
  17915. DataMgr.awardId = 0;
  17916. DataMgr.awardCoin = 0;
  17917. DataMgr.sceneId = -1;
  17918. DataMgr.tryId = 0;
  17919. DataMgr.curLevel = 1;
  17920. DataMgr.vipLevel = 0;
  17921. DataMgr.maxLevel = 0;
  17922. DataMgr.awardRatio = 1;
  17923. DataMgr.gameList = [];
  17924. DataMgr.rankList = [];
  17925. DataMgr.recoverTime = 480000;
  17926. DataMgr.minScore = 0;
  17927. DataMgr.rankDis = 0;
  17928. DataMgr.userSaving = false;
  17929. DataMgr.gameSaving = false;
  17930. DataMgr.diyGameSaving = false;
  17931. class D3Tween extends Laya.Script3D {
  17932. constructor() {
  17933. super();
  17934. this.isInited = false;
  17935. }
  17936. ;
  17937. init() {
  17938. if (this.isInited)
  17939. return;
  17940. this.isInited = true;
  17941. this.gameObj = this.owner;
  17942. this.transform = this.gameObj.transform;
  17943. }
  17944. get rotX() {
  17945. return this.transform.localRotationEulerX;
  17946. }
  17947. set rotX(v) {
  17948. this.transform.localRotationEulerX = v;
  17949. }
  17950. get rotY() {
  17951. return this.transform.localRotationEulerY;
  17952. }
  17953. set rotY(v) {
  17954. this.transform.localRotationEulerY = v;
  17955. }
  17956. get rotZ() {
  17957. return this.transform.localRotationEulerZ;
  17958. }
  17959. set rotZ(v) {
  17960. this.transform.localRotationEulerZ = v;
  17961. }
  17962. get posX() {
  17963. return this.transform.localPositionX;
  17964. }
  17965. set posX(v) {
  17966. this.transform.localPositionX = v;
  17967. }
  17968. get posY() {
  17969. return this.transform.localPositionY;
  17970. }
  17971. set posY(v) {
  17972. this.transform.localPositionY = v;
  17973. }
  17974. get posZ() {
  17975. return this.transform.localPositionZ;
  17976. }
  17977. set posZ(v) {
  17978. this.transform.localPositionZ = v;
  17979. }
  17980. get rotation() {
  17981. return this.transform.localRotation;
  17982. }
  17983. set rotation(v) {
  17984. this.transform.localRotation = v;
  17985. }
  17986. }
  17987. class D2Hole extends Laya.Script {
  17988. constructor() { super(); }
  17989. onTriggerEnter(collider) {
  17990. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  17991. return;
  17992. }
  17993. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  17994. if (collider.owner["mySrc"].isRunSkillAni) {
  17995. return;
  17996. }
  17997. if (collider.owner["mySrc"].number != 0) {
  17998. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  17999. }
  18000. xGame.common.ballColliHole(collider);
  18001. xGame.common.recoverCameraView();
  18002. }
  18003. }
  18004. }
  18005. class Table extends Laya.Script3D {
  18006. constructor() {
  18007. super();
  18008. this.isSetBorder = false;
  18009. this.inited = false;
  18010. }
  18011. ;
  18012. onAwake() {
  18013. this.init();
  18014. }
  18015. init() {
  18016. if (this.inited)
  18017. return;
  18018. this.inited = true;
  18019. this.gameObj = this.owner;
  18020. this.border = this.gameObj.getChildByName("border");
  18021. }
  18022. setBorderPos() {
  18023. if (this.isSetBorder)
  18024. return;
  18025. this.isSetBorder = true;
  18026. let ui = xGame.common.gameUI.ui;
  18027. let bar1 = this.border.getChildByName("bar1");
  18028. let bar2 = this.border.getChildByName("bar2");
  18029. let bar3 = this.border.getChildByName("bar3");
  18030. let bar4 = this.border.getChildByName("bar4");
  18031. let bar5 = this.border.getChildByName("bar5");
  18032. let bar6 = this.border.getChildByName("bar6");
  18033. this.setInfo(bar1, ui.border.bar1, "box");
  18034. this.setInfo(bar2, ui.border.bar2, "box");
  18035. this.setInfo(bar3, ui.border.bar3, "box");
  18036. this.setInfo(bar4, ui.border.bar4, "box");
  18037. this.setInfo(bar5, ui.border.bar5, "box");
  18038. this.setInfo(bar6, ui.border.bar6, "box");
  18039. let circle1 = this.border.getChildByName("circle1");
  18040. let circle2 = this.border.getChildByName("circle2");
  18041. let circle3 = this.border.getChildByName("circle3");
  18042. let circle4 = this.border.getChildByName("circle4");
  18043. let circle5 = this.border.getChildByName("circle5");
  18044. let circle6 = this.border.getChildByName("circle6");
  18045. this.setInfo(circle1, ui.border.circle1, "circle");
  18046. this.setInfo(circle2, ui.border.circle2, "circle");
  18047. this.setInfo(circle3, ui.border.circle3, "circle");
  18048. this.setInfo(circle4, ui.border.circle4, "circle");
  18049. this.setInfo(circle5, ui.border.circle5, "circle");
  18050. this.setInfo(circle6, ui.border.circle6, "circle");
  18051. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  18052. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  18053. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  18054. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  18055. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  18056. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  18057. let arr = xGame.common.gameMgr.holePosList;
  18058. xGame.common.gameMgr.posObj = {
  18059. "1": arr[0],
  18060. "3": arr[2],
  18061. "4": arr[3],
  18062. "6": arr[5]
  18063. };
  18064. }
  18065. initHolePos(x, y) {
  18066. if (x < 300)
  18067. x += 25;
  18068. else if (x > 1000)
  18069. x -= 25;
  18070. else if (y > 200)
  18071. y -= 10;
  18072. else
  18073. y += 10;
  18074. if (y < 200)
  18075. y += 30;
  18076. else if (y > 500)
  18077. y -= 30;
  18078. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  18079. }
  18080. setInfo(d3Obj, d2Obj, type) {
  18081. let ui = xGame.common.gameUI.ui;
  18082. let sprite = new Laya.Sprite();
  18083. ui.border.displayObject.addChild(sprite);
  18084. let colli = xGame.common.getCollider(type);
  18085. sprite.addComponentIntance(colli);
  18086. let rigy = xGame.common.getRigbody();
  18087. rigy.type = "static";
  18088. sprite.addComponentIntance(rigy);
  18089. let d3Pos = d3Obj.transform.position;
  18090. xGame.common.pos3to2Convert(d3Pos);
  18091. let scaleX = d3Obj.transform.localScaleX;
  18092. let scaleZ = d3Obj.transform.localScaleZ;
  18093. let width = xGame.common.scale3to2Convert(scaleZ);
  18094. let height = xGame.common.scale3to2Convert(scaleX);
  18095. sprite.pivotX = width / 2;
  18096. sprite.pivotY = height / 2;
  18097. sprite.x = d3Pos.x;
  18098. sprite.y = d3Pos.y;
  18099. sprite.width = width;
  18100. sprite.height = height;
  18101. d2Obj.x = d3Pos.x;
  18102. d2Obj.y = d3Pos.y;
  18103. d2Obj.width = width;
  18104. d2Obj.height = height;
  18105. if (type == "box") {
  18106. colli.width = width;
  18107. colli.height = height;
  18108. colli.isSensor = false;
  18109. colli.label = "border";
  18110. }
  18111. else {
  18112. colli.radius = width / 2;
  18113. colli.isSensor = true;
  18114. colli.label = "hole";
  18115. sprite.addComponent(D2Hole);
  18116. }
  18117. }
  18118. }
  18119. class D3World extends Laya.Script3D {
  18120. constructor() {
  18121. super();
  18122. this.loadNum = 0;
  18123. this.setLoadNum = 7;
  18124. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  18125. }
  18126. onAwake() {
  18127. }
  18128. loadScene() {
  18129. this.scene = this.owner;
  18130. let url = `res/unityRes/root.lh`;
  18131. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  18132. this.scene.addChild(prefab);
  18133. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  18134. this.putCameraInfo();
  18135. this.camera.enableHDR = false;
  18136. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  18137. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  18138. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  18139. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  18140. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  18141. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  18142. this.knife.active = false;
  18143. this.loadD3Obj();
  18144. }));
  18145. }
  18146. putCameraInfo() {
  18147. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  18148. this.cameraObj = new cameraType();
  18149. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  18150. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  18151. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  18152. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  18153. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  18154. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  18155. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  18156. this.visitAngleChild.init();
  18157. this.visitRootObj.posX = this.visitAngleChild.posX;
  18158. this.visitRootObj.posY = this.visitAngleChild.posY;
  18159. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  18160. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  18161. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  18162. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  18163. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  18164. xGame.common.showOneCamera("mainCamera");
  18165. }
  18166. loadD3Obj() {
  18167. this.loadTable();
  18168. this.loadRoom();
  18169. this.loadInHoleParticial();
  18170. this.loadIceParticial();
  18171. this.loadHitParticial();
  18172. this.loadFireworksParticial();
  18173. this.loadBall();
  18174. }
  18175. loadInHoleParticial() {
  18176. this.loadD3Res("inHoleEft", "", (prefab) => {
  18177. prefab.addComponent(Partical);
  18178. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  18179. });
  18180. }
  18181. loadIceParticial() {
  18182. this.loadD3Res("iceEft", "", (prefab) => {
  18183. prefab.addComponent(Partical);
  18184. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  18185. });
  18186. }
  18187. loadHitParticial() {
  18188. this.loadD3Res("hitEft", "", (prefab) => {
  18189. prefab.addComponent(Partical);
  18190. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  18191. });
  18192. }
  18193. loadFireworksParticial() {
  18194. this.loadD3Res("fireworksEft", "", (prefab) => {
  18195. prefab.addComponent(Partical);
  18196. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  18197. });
  18198. }
  18199. loadBall(index = 1) {
  18200. this.loadD3Res("ball", index, (prefab) => {
  18201. this.ballPrefab = prefab;
  18202. this.ballPrefab.addComponent(Ball);
  18203. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  18204. });
  18205. }
  18206. loadTable(index = 1) {
  18207. this.loadD3Res("table", index, (prefab) => {
  18208. this.tableSrc = prefab.addComponent(Table);
  18209. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  18210. this.d3Hand.init();
  18211. this.tableRoot.addChild(prefab);
  18212. });
  18213. }
  18214. loadRoom(index = 1) {
  18215. this.loadD3Res("room", index, (prefab) => {
  18216. this.roomRoot.addChild(prefab);
  18217. });
  18218. }
  18219. loadD3Res(type, index, callback) {
  18220. let url = `res/unityRes/${type}${index}.lh`;
  18221. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  18222. callback && callback(prefab);
  18223. this.checkResLoad();
  18224. }));
  18225. }
  18226. checkResLoad() {
  18227. this.loadNum++;
  18228. if (this.loadNum >= this.setLoadNum) {
  18229. xGame.eventMgr.event(D3RES_LOADED);
  18230. }
  18231. }
  18232. prePlayEft() {
  18233. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  18234. eft.transform.localPositionX = 0;
  18235. eft.transform.localPositionY = -5;
  18236. eft.transform.localPositionZ = 0;
  18237. eft.active = true;
  18238. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  18239. ice.transform.localPositionX = 0;
  18240. ice.transform.localPositionY = -5;
  18241. ice.transform.localPositionZ = 0;
  18242. ice.active = true;
  18243. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  18244. hit.transform.localPositionX = 0;
  18245. hit.transform.localPositionY = -5;
  18246. hit.transform.localPositionZ = 0;
  18247. hit.active = true;
  18248. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  18249. fireworks.transform.localPositionX = 0;
  18250. fireworks.transform.localPositionY = -5;
  18251. fireworks.transform.localPositionZ = 0;
  18252. fireworks.active = true;
  18253. }
  18254. }
  18255. class cameraType {
  18256. }
  18257. class MoyuMgr$1 {
  18258. static initMoyu() {
  18259. this.moyuView = new MoyuView$1();
  18260. Laya.stage.addChild(this.moyuView.ui.displayObject);
  18261. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  18262. this.moyuView.ui.displayObject.zOrder = 1000;
  18263. this.moyuView.init();
  18264. this.moyuView.showTip(true);
  18265. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  18266. window['XApk'] = this;
  18267. }
  18268. static showAge(show) {
  18269. if (this.moyuView)
  18270. this.moyuView.showAge(show);
  18271. }
  18272. static onPlatMsg(idx) {
  18273. if (!MoyuMgr$1.moyuView)
  18274. return;
  18275. if (idx == '0') {
  18276. MoyuMgr$1.moyuView.showTip(false);
  18277. }
  18278. }
  18279. static showAgree(call) {
  18280. if (this.moyuView)
  18281. this.moyuView.showAgree(call);
  18282. else
  18283. call && call();
  18284. }
  18285. static showXy(type = 1) {
  18286. if (this.moyuView)
  18287. this.moyuView.showXy(type);
  18288. }
  18289. }
  18290. MoyuMgr$1.isAdvise = false;
  18291. class MoyuView$1 {
  18292. constructor() {
  18293. this.ysxyNum = 1;
  18294. this.ysJson = null;
  18295. this.ui = ui_UIMoyu.createInstance();
  18296. }
  18297. init() {
  18298. this.ui.mainBg.visible = false;
  18299. this.ui.xyNode.visible = false;
  18300. this.ui.ageNode.visible = false;
  18301. this.ui.tipNode.visible = false;
  18302. this.ui.rnNode.visible = false;
  18303. this.ui.fcmNode.visible = false;
  18304. this.ui.ageTip.visible = false;
  18305. this.ui.msgNode.visible = false;
  18306. this.ui.visible = false;
  18307. this.ui.xyNode.xyList.setVirtual();
  18308. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  18309. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  18310. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  18311. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  18312. this.ui.xyNode.btnKnown.visible = false;
  18313. this.ui.xyNode.xy1.visible = false;
  18314. this.ui.xyNode.xy2.visible = false;
  18315. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  18316. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  18317. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  18318. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  18319. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  18320. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  18321. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  18322. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  18323. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  18324. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  18325. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  18326. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  18327. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  18328. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  18329. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  18330. this.ysxyNum = 2;
  18331. }
  18332. }
  18333. onClick(obj) {
  18334. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18335. switch (obj) {
  18336. case this.ui.ageTip:
  18337. if (Moyu.isTTApk) {
  18338. this.ui.ageNode.visible = true;
  18339. this.ui.mainBg.visible = true;
  18340. }
  18341. break;
  18342. case this.ui.tipNode:
  18343. this.showTip(false);
  18344. break;
  18345. case this.ui.ageNode.btnAge:
  18346. this.ui.ageNode.visible = false;
  18347. this.ui.mainBg.visible = false;
  18348. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  18349. this.ui.visible = false;
  18350. break;
  18351. case this.ui.xyNode.btnXy3:
  18352. case this.ui.xyNode.btnXy1:
  18353. this.loadXy(1);
  18354. break;
  18355. case this.ui.xyNode.btnXy2:
  18356. this.loadXy(2);
  18357. break;
  18358. case this.ui.xyNode.btnBack:
  18359. this.ui.xyNode.xy1.visible = true;
  18360. this.ui.xyNode.xy2.visible = false;
  18361. break;
  18362. case this.ui.xyNode.btnKnown:
  18363. this.ui.xyNode.visible = false;
  18364. this.ui.mainBg.visible = false;
  18365. this.ui.visible = false;
  18366. break;
  18367. case this.ui.rnNode.btnCheck:
  18368. this.check();
  18369. break;
  18370. case this.ui.rnNode.btnExit:
  18371. case this.ui.xyNode.btnNo:
  18372. this.ysxyNum--;
  18373. if (this.ysxyNum > 0)
  18374. this.showMsg("Refuse to quit the game once again");
  18375. else {
  18376. Moyu.userAgree(false);
  18377. Moyu.exit();
  18378. }
  18379. break;
  18380. case this.ui.xyNode.btnSure:
  18381. case this.ui.xyNode.btnYes:
  18382. DataMgr.userData.isAgree = true;
  18383. DataMgr.saveUserData();
  18384. this.onAgree();
  18385. break;
  18386. case this.ui.rnNode.btnDone:
  18387. this.ui.rnNode.visible = false;
  18388. this.ui.visible = false;
  18389. break;
  18390. case this.ui.fcmNode.btnRn:
  18391. this.showRn();
  18392. break;
  18393. }
  18394. }
  18395. showTip(show) {
  18396. if (!Moyu.isVVApk && !Moyu.isOPApk)
  18397. return;
  18398. if (show) {
  18399. MoyuMgr$1.isAdvise = true;
  18400. this.ui.visible = true;
  18401. this.ui.tipNode.visible = true;
  18402. this.ui.tipNode.alpha = 1;
  18403. Laya.timer.once(1000, this, this.showTip, [false]);
  18404. }
  18405. else {
  18406. this.ui.tipNode.alpha = 1;
  18407. this.ui.tipNode.visible = true;
  18408. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  18409. this.ui.tipNode.visible = false;
  18410. MoyuMgr$1.isAdvise = false;
  18411. }), 1000);
  18412. }
  18413. }
  18414. showAge(show, px = 0, py = 0) {
  18415. if (Moyu.platType > 10 && !Moyu.isIos) {
  18416. this.ui.ageTip.x = px;
  18417. this.ui.ageTip.y = py;
  18418. this.ui.ageTip.visible = show;
  18419. if (show)
  18420. this.ui.visible = true;
  18421. }
  18422. }
  18423. showAgree(call) {
  18424. this.agreeCall = call;
  18425. this.onAgree();
  18426. return;
  18427. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  18428. this.showXy(0);
  18429. }
  18430. else
  18431. this.onAgree();
  18432. }
  18433. onAgree() {
  18434. if (!this.ui.ageNode.visible)
  18435. this.ui.visible = false;
  18436. this.ui.xyNode.visible = false;
  18437. Moyu.userAgree(true);
  18438. this.showAge(false);
  18439. this.agreeCall && this.agreeCall();
  18440. this.showRn();
  18441. }
  18442. showMsg(txt) {
  18443. this.ui.msgNode.txtMsg.text = txt;
  18444. this.ui.msgNode.visible = true;
  18445. this.ui.msgNode.alpha = 1;
  18446. this.ui.visible = true;
  18447. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  18448. this.ui.msgNode.visible = false;
  18449. }), 2500, true);
  18450. }
  18451. showRn() {
  18452. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  18453. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  18454. this.ui.rnNode.rn1.visible = true;
  18455. this.ui.rnNode.rn2.visible = false;
  18456. this.ui.rnNode.rn3.visible = false;
  18457. this.ui.rnNode.rn4.visible = false;
  18458. this.ui.rnNode.visible = true;
  18459. this.ui.mainBg.visible = true;
  18460. this.ui.rnNode.btnDone.visible = false;
  18461. this.ui.rnNode.btnExit.visible = true;
  18462. this.ui.rnNode.btnCheck.visible = true;
  18463. this.ui.fcmNode.visible = false;
  18464. this.ui.visible = true;
  18465. return;
  18466. }
  18467. }
  18468. this.showFcm();
  18469. }
  18470. showFcm() {
  18471. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  18472. Moyu.initFCM(true);
  18473. if (Moyu.gameTime < 1)
  18474. this.fcmLoop();
  18475. else if (Moyu.gameTime < 999)
  18476. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  18477. }
  18478. }
  18479. fcmLoop() {
  18480. if (Moyu.gameTime < 1) {
  18481. this.ui.rnNode.visible = false;
  18482. this.ui.fcmNode.visible = true;
  18483. this.ui.mainBg.visible = true;
  18484. this.ui.visible = true;
  18485. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  18486. Laya.timer.clear(this.ui, this.fcmLoop);
  18487. }
  18488. }
  18489. check() {
  18490. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  18491. this.ui.rnNode.rn1.visible = false;
  18492. this.ui.rnNode.rn2.visible = false;
  18493. this.ui.rnNode.rn4.visible = true;
  18494. }
  18495. else if (this.ui.rnNode.rn4.visible) {
  18496. let name = this.ui.rnNode.inputName.text;
  18497. let code = this.ui.rnNode.inputCode.text;
  18498. if (code && code.length == 18) {
  18499. this.ui.rnNode.rn1.visible = false;
  18500. this.ui.rnNode.rn4.visible = false;
  18501. Moyu.authenticate(name, code, (res) => {
  18502. this.ui.rnNode.rn2.visible = !res;
  18503. this.ui.rnNode.rn3.visible = res;
  18504. this.ui.rnNode.btnDone.visible = res;
  18505. this.ui.rnNode.btnExit.visible = !res;
  18506. this.ui.rnNode.btnCheck.visible = !res;
  18507. if (res)
  18508. this.showFcm();
  18509. });
  18510. }
  18511. else
  18512. this.showMsg("信息填写不完整");
  18513. }
  18514. }
  18515. loadXy(type = 0) {
  18516. this.ui.xyNode.xy1.visible = false;
  18517. this.ui.xyNode.xy2.visible = true;
  18518. this.ui.xyNode.xyList.scrollToView(0);
  18519. if (type == 1) {
  18520. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  18521. }
  18522. else if (type == 2) {
  18523. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  18524. }
  18525. }
  18526. showXy(type = 0) {
  18527. this.xyBtn();
  18528. if (type == 0) {
  18529. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  18530. this.ui.xyNode.btnSure.visible = true;
  18531. }
  18532. else {
  18533. this.ui.xyNode.btnYes.visible = true;
  18534. this.ui.xyNode.btnNo.visible = true;
  18535. }
  18536. }
  18537. else {
  18538. this.ui.xyNode.btnKnown.visible = true;
  18539. this.ui.mainBg.visible = true;
  18540. }
  18541. this.ui.xyNode.xy1.visible = true;
  18542. this.ui.xyNode.xy2.visible = false;
  18543. this.ui.xyNode.visible = true;
  18544. this.ui.visible = true;
  18545. }
  18546. xyBtn() {
  18547. this.ui.xyNode.btnSure.visible = false;
  18548. this.ui.xyNode.btnYes.visible = false;
  18549. this.ui.xyNode.btnNo.visible = false;
  18550. this.ui.xyNode.btnKnown.visible = false;
  18551. {
  18552. this.ui.xyNode.btnXy3.visible = false;
  18553. this.ui.xyNode.btnXy2.visible = true;
  18554. this.ui.xyNode.btnXy1.visible = true;
  18555. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  18556. }
  18557. }
  18558. createXY(json) {
  18559. this.ysJson = json.content;
  18560. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  18561. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  18562. this.ui.xyNode.xy2.visible = true;
  18563. }
  18564. renderListItem(idx, cell) {
  18565. let xy = this.ysJson[idx];
  18566. cell.height = xy.line * 30;
  18567. cell.xyItem.text = xy.text;
  18568. }
  18569. onDestroy() {
  18570. this.agreeCall = null;
  18571. }
  18572. }
  18573. class UILoading extends UIBase {
  18574. constructor() {
  18575. super();
  18576. this.accTime = 0;
  18577. this.curNum = 0;
  18578. this.rate = 1;
  18579. this.loadSubOk = false;
  18580. this.loadResOK = false;
  18581. this.openLoading = true;
  18582. this.beginLoadRes = false;
  18583. this.finishD2 = false;
  18584. this.finishD3 = false;
  18585. }
  18586. onConstructor() {
  18587. this.ui = ui_UILoading.createInstance();
  18588. this.contentPane = this.ui;
  18589. this.isEject = false;
  18590. this._initUI();
  18591. this._addEvent();
  18592. }
  18593. _initUI() {
  18594. MoyuMgr$1.initMoyu();
  18595. }
  18596. _addEvent() {
  18597. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  18598. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  18599. }
  18600. show() {
  18601. super.show();
  18602. console.log('zh:加载分包资源');
  18603. loadSubRes(this.subResProgress.bind(this));
  18604. this.ui.txtLoad.text = "Loading...";
  18605. }
  18606. subResProgress(pro, finish) {
  18607. this.curNum = pro;
  18608. if (finish) {
  18609. this.curNum = 1;
  18610. this.loadSubOk = true;
  18611. }
  18612. }
  18613. laodD3Res() {
  18614. let scene3D = new Laya.Scene3D();
  18615. xGame.common.d3Scene = scene3D;
  18616. xGame.common.d3World = scene3D.addComponent(D3World);
  18617. xGame.common.d3World.loadScene();
  18618. }
  18619. loadD2Res() {
  18620. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  18621. this.finishD2 = true;
  18622. this.checkLoadAll();
  18623. this.curNum = 1;
  18624. }), Laya.Handler.create(this, (pro) => {
  18625. this.curNum = pro;
  18626. }, null, false));
  18627. }
  18628. d3ResFinish() {
  18629. this.finishD3 = true;
  18630. this.checkLoadAll();
  18631. }
  18632. checkLoadAll() {
  18633. if (this.finishD2 && this.finishD3) {
  18634. this.loadResOK = true;
  18635. }
  18636. }
  18637. loadRes() {
  18638. this.laodD3Res();
  18639. this.loadD2Res();
  18640. }
  18641. myUpdate(dt) {
  18642. if (!this.openLoading)
  18643. return;
  18644. this.accTime += dt * this.rate;
  18645. if (this.accTime >= this.curNum)
  18646. this.accTime = this.curNum;
  18647. this.ui.loadinfo.value = this.accTime * 100;
  18648. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  18649. if (!this.beginLoadRes) {
  18650. this.beginLoadRes = true;
  18651. this.ui.txtLoad.text = "Loading...";
  18652. this.curNum = 0;
  18653. this.accTime = 0;
  18654. this.loadRes();
  18655. }
  18656. if (this.loadResOK) {
  18657. this.openLoading = false;
  18658. Laya.timer.once(300, this, () => {
  18659. xGame.common.d3Scene.active = false;
  18660. MoyuMgr$1.showAgree(enterGame);
  18661. });
  18662. }
  18663. }
  18664. }
  18665. release() {
  18666. }
  18667. hide() {
  18668. super.hide();
  18669. this.release();
  18670. }
  18671. onClose() {
  18672. this.hide();
  18673. }
  18674. }
  18675. UILoading.uiName = "UILoading";
  18676. class UIRepentProp$1 extends UIBase {
  18677. constructor() {
  18678. super();
  18679. this.viewType = 0;
  18680. this.regretType = 0;
  18681. }
  18682. onConstructor() {
  18683. this.ui = ui_UIRepentProp.createInstance();
  18684. this.contentPane = this.ui;
  18685. this.isEject = false;
  18686. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  18687. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  18688. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  18689. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  18690. }
  18691. show(viewType, regretType, callback) {
  18692. PlatMgr.showInsert(true);
  18693. this.viewType = viewType;
  18694. this.regretType = regretType;
  18695. this.callback = callback;
  18696. super.show();
  18697. this.ui.t0.play();
  18698. this.ui.c1.selectedIndex = this.viewType;
  18699. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  18700. if (this.viewType == 0) {
  18701. let guide = DataMgr.getGuideHelpLine();
  18702. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  18703. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  18704. }
  18705. xGame.common.gameMgr.gamePause = true;
  18706. }
  18707. hideSelf() {
  18708. xGame.common.gameMgr.gamePause = false;
  18709. this.callback && this.callback(false);
  18710. this.hide();
  18711. }
  18712. videoRegret() {
  18713. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  18714. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  18715. }
  18716. else {
  18717. console.log('zh:AD 失败,直接发放奖励');
  18718. this.qjff_AD_for_UIrepentProp_videoRegret();
  18719. }
  18720. }
  18721. qjff_AD_for_UIrepentProp_videoRegret() {
  18722. this.callback && this.callback(true);
  18723. this.hideSelf();
  18724. }
  18725. videoAddHelpLine() {
  18726. let guide = DataMgr.getGuideHelpLine();
  18727. if (guide == 0) {
  18728. this.callback && this.callback(true);
  18729. this.hideSelf();
  18730. DataMgr.setGuideHelpLine();
  18731. xGame.common.gameUI.ui.guideNode.visible = false;
  18732. }
  18733. else {
  18734. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  18735. if (Laya.Browser.onAndroid) {
  18736. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  18737. if (!boo) {
  18738. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  18739. return;
  18740. }
  18741. }
  18742. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  18743. }
  18744. else {
  18745. console.log('zh:AD 失败,直接发放奖励');
  18746. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  18747. }
  18748. }
  18749. }
  18750. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  18751. this.callback && this.callback(true);
  18752. this.hideSelf();
  18753. }
  18754. }
  18755. UIRepentProp$1.uiName = "UIRepentProp";
  18756. class UIRodMethod$1 extends UIBase {
  18757. constructor() {
  18758. super();
  18759. this.isPressd = false;
  18760. }
  18761. onConstructor() {
  18762. this.ui = ui_UIRodMethod.createInstance();
  18763. this.contentPane = this.ui;
  18764. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  18765. this.moveDir = new Laya.Vector2();
  18766. this.moveDest = new Laya.Vector2();
  18767. this.centerPos = new Laya.Vector2();
  18768. xGame.common.uiRodMethod = this;
  18769. }
  18770. show() {
  18771. super.show();
  18772. xGame.common.gameMgr.gamePause = true;
  18773. this.openPressDotEvent();
  18774. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  18775. this.centerPos.x = this.ui.white.x;
  18776. this.centerPos.y = this.ui.white.y;
  18777. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  18778. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  18779. this.setDot();
  18780. }
  18781. setDot() {
  18782. this.ui.dot.x = this.moveDest.x;
  18783. this.ui.dot.y = this.moveDest.y;
  18784. }
  18785. closeSelf() {
  18786. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  18787. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  18788. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  18789. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  18790. xGame.common.gameMgr.gamePause = false;
  18791. this.hide();
  18792. }
  18793. openPressDotEvent() {
  18794. this.closePressDotEvent();
  18795. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  18796. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  18797. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  18798. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  18799. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  18800. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  18801. }
  18802. closePressDotEvent() {
  18803. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  18804. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  18805. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  18806. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  18807. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  18808. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  18809. }
  18810. onDown(e) {
  18811. if (e.type == Laya.Event.MOUSE_DOWN)
  18812. this.isPressd = true;
  18813. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  18814. this.isPressd = false;
  18815. if (!this.isPressd)
  18816. return;
  18817. this.moveDest.x = e.stageX;
  18818. this.moveDest.y = e.stageY;
  18819. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  18820. if (dis > 6724) {
  18821. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  18822. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  18823. }
  18824. this.setDot();
  18825. }
  18826. resetRod() {
  18827. this.ui.dot.x = this.ui.white.x;
  18828. this.ui.dot.y = this.ui.white.y;
  18829. this.gameRod.dot.x = this.gameRod.bg.x;
  18830. this.gameRod.dot.y = this.gameRod.bg.y;
  18831. xGame.common.rodOffest.x = 0;
  18832. xGame.common.rodOffest.y = 0;
  18833. }
  18834. }
  18835. UIRodMethod$1.uiName = "UIRodMethod";
  18836. class UIMsg$1 extends UIBase {
  18837. constructor() {
  18838. super();
  18839. }
  18840. onConstructor() {
  18841. this.ui = ui_UIMsg.createInstance();
  18842. this.contentPane = this.ui;
  18843. this.isEject = false;
  18844. this.isMuti = true;
  18845. }
  18846. show(msg, callback) {
  18847. super.show();
  18848. this.ui.tipsNode.msgTxt.text = msg;
  18849. this.ui.alpha = 1;
  18850. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  18851. this.hide();
  18852. callback && callback();
  18853. }), 1000);
  18854. }
  18855. }
  18856. UIMsg$1.uiName = "UIMsg";
  18857. class UITips$1 extends UIBase {
  18858. constructor() {
  18859. super();
  18860. this.type = 0;
  18861. }
  18862. onConstructor() {
  18863. this.ui = ui_UITips.createInstance();
  18864. this.contentPane = this.ui;
  18865. this.isEject = false;
  18866. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  18867. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  18868. }
  18869. show(tipsTxt, womanTxt, type) {
  18870. super.show();
  18871. this.ui.t0.play();
  18872. this.ui.myNode.tipsTxt.text = tipsTxt;
  18873. this.ui.myNode.womanTxt.text = womanTxt;
  18874. PlatMgr.showInsert(true);
  18875. this.ui.myNode.c1.selectedIndex = type;
  18876. this.type = type;
  18877. switch (this.type) {
  18878. case TipsType.exitGame:
  18879. xGame.common.gameMgr.gamePause = true;
  18880. break;
  18881. case TipsType.foul:
  18882. Laya.timer.once(200, this, () => {
  18883. xGame.common.gameMgr.gamePause = true;
  18884. });
  18885. break;
  18886. default:
  18887. break;
  18888. }
  18889. }
  18890. clickLeftBtn() {
  18891. this.hide();
  18892. xGame.common.gameMgr.gamePause = false;
  18893. switch (this.type) {
  18894. case TipsType.exitGame:
  18895. break;
  18896. case TipsType.foul:
  18897. break;
  18898. default:
  18899. break;
  18900. }
  18901. }
  18902. clickRightBtn() {
  18903. this.hide();
  18904. switch (this.type) {
  18905. case TipsType.exitGame:
  18906. xGame.eventMgr.event(RESET_GAME);
  18907. xGame.uiMgr.Show(UIMain$1);
  18908. Moyu.recordEnd(this, null);
  18909. xGame.common.longHelpLine = false;
  18910. break;
  18911. case TipsType.foul:
  18912. xGame.common.gameMgr.gamePause = false;
  18913. Laya.timer.clearAll(this);
  18914. break;
  18915. default:
  18916. break;
  18917. }
  18918. }
  18919. }
  18920. UITips$1.uiName = "UITips";
  18921. class UIGame$1 extends UIBase {
  18922. constructor() {
  18923. super();
  18924. this.powerNum = 0;
  18925. this.isD3Inited = false;
  18926. this.isPrePlay = false;
  18927. this.isMoveRod = false;
  18928. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  18929. this.rulerDis = 20;
  18930. this.rulerOffset = 0;
  18931. }
  18932. onConstructor() {
  18933. this.ui = ui_UIGame.createInstance();
  18934. this.contentPane = this.ui;
  18935. this.ui.x += xGame.common.sysOffestNum;
  18936. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  18937. this.isEject = false;
  18938. xGame.common.gameUI = this;
  18939. this.initSelf();
  18940. }
  18941. isTurnSelf() {
  18942. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  18943. return true;
  18944. }
  18945. }
  18946. initSelf() {
  18947. let topUI = this.ui.topNode;
  18948. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  18949. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  18950. this.barInfo = {};
  18951. this.barInfo.curY = 0;
  18952. this.barInfo.height = this.ui.powerNode.height;
  18953. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  18954. this.barInfo.powerStartY = this.ui.powerNode.y;
  18955. xGame.common.aiPlayer = new AIPlayer();
  18956. xGame.common.gameMgr = new GameMgr();
  18957. xGame.common.skillMgr = new SkillMgr();
  18958. xGame.common.wordsMgr = new WordsMgr();
  18959. xGame.common.talkMgr = new TalkMgr();
  18960. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  18961. console.log("加载经典模式表情文件chenggon !");
  18962. });
  18963. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  18964. console.log("挑战模式奖励模式spine加载成功!");
  18965. });
  18966. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  18967. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  18968. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  18969. this.addUIClick(this.ui.returnBtn, this.returnHome);
  18970. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  18971. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  18972. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  18973. }
  18974. getGanZiImg() {
  18975. let index = DataMgr.getCurBallRod();
  18976. let data = cfgTable.ballrodData[index + 1];
  18977. let gan_url = xGame.common.getGameIconUrl(data.img);
  18978. console.log('zh:getGanZiImg gan_url==' + gan_url);
  18979. this.ui.powerNode.showImg.url = gan_url;
  18980. console.log('zh:修改杆子图标O K');
  18981. }
  18982. returnHome() {
  18983. let tips = "Are you sure to exit the game?";
  18984. let woman = "Boss, why don't you play for a while longer?";
  18985. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  18986. }
  18987. addRodMethodClick() {
  18988. if (this.isTurnSelf()) {
  18989. xGame.uiMgr.Show(UIRodMethod$1);
  18990. }
  18991. }
  18992. clickHelpLineBtn(force = false) {
  18993. if (!this.isTurnSelf())
  18994. return;
  18995. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  18996. if (success) {
  18997. xGame.common.longHelpLine = true;
  18998. xGame.common.d2World.getHelpLine();
  18999. Moyu.sendDataEvent("guideNum");
  19000. }
  19001. else {
  19002. }
  19003. });
  19004. }
  19005. renderSelfDisplayBalls(index, target) {
  19006. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  19007. target.myImg.url = xGame.common.getGameIconUrl(str);
  19008. }
  19009. renderAIDisplayBalls(index, target) {
  19010. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  19011. target.myImg.url = xGame.common.getGameIconUrl(str);
  19012. ;
  19013. }
  19014. updateMode() {
  19015. if (xGame.common.gameMode == GameMode.classic) {
  19016. this.ui.topNode.scoreNode.visible = false;
  19017. }
  19018. else if (xGame.common.gameMode == GameMode.bigMove) {
  19019. this.ui.topNode.scoreNode.visible = true;
  19020. }
  19021. }
  19022. show() {
  19023. super.show();
  19024. console.log("zh:uigame show AADD");
  19025. this.ui.alpha = 0;
  19026. this.updateSelf();
  19027. xGame.common.gameMgr.gamePause = false;
  19028. xGame.common.gameUI.ui.blackAni.visible = false;
  19029. xGame.common.gameUI.ui.whiteAni.visible = false;
  19030. this.ui.powerEft.visible = false;
  19031. this.ui.colorNode.visible = false;
  19032. this.updateHead();
  19033. let curUse = DataMgr.getCurBallRod();
  19034. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  19035. this.getGanZiImg();
  19036. }
  19037. updateSelf() {
  19038. if (xGame.common.gameMode == GameMode.classic) {
  19039. this.ui.c1.selectedIndex = 0;
  19040. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  19041. this.ui.topNode.middleNode.visible = true;
  19042. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  19043. }
  19044. else if (xGame.common.gameMode == GameMode.bigMove) {
  19045. this.ui.c1.selectedIndex = 0;
  19046. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  19047. this.ui.topNode.middleNode.visible = false;
  19048. let max = xGame.cfgMgr.getMaxBigMoveLength();
  19049. let rand = xGame.common.randomNum(1, max);
  19050. let guide = DataMgr.getSkillGuide();
  19051. if (guide == 0)
  19052. rand = 1;
  19053. xGame.common.bigMoveLevelIndex = rand;
  19054. }
  19055. else if (xGame.common.gameMode == GameMode.placeBall) {
  19056. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  19057. this.ui.c1.selectedIndex = 1 + data.type;
  19058. this.ui.alpha = 1;
  19059. this.startGame();
  19060. }
  19061. this.updateMode();
  19062. this.initD3world();
  19063. this.initD2world();
  19064. }
  19065. startGame() {
  19066. this.ui.snowNode.visible = Math.random() <= 0.1;
  19067. this.ui.d2Node.visible = false;
  19068. xGame.common.d3World.d3Hand.gameObj.active = false;
  19069. xGame.common.d3World.tableSrc.init();
  19070. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  19071. this.cameraViewChange(() => {
  19072. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  19073. switch (xGame.common.gameMode) {
  19074. case GameMode.classic:
  19075. xGame.common.d3World.d3Hand.gameObj.active = true;
  19076. this.playPutBallD3Ani();
  19077. break;
  19078. case GameMode.bigMove:
  19079. this.enterGame();
  19080. Laya.timer.once(500, this, () => {
  19081. this.ui.topNode.middleNode.visible = true;
  19082. this.ui.topNode.middleNode.t0.play();
  19083. });
  19084. break;
  19085. case GameMode.placeBall:
  19086. this.enterGame();
  19087. break;
  19088. default:
  19089. break;
  19090. }
  19091. });
  19092. PlatMgr.showBanner(false);
  19093. }
  19094. enterGame() {
  19095. this.ui.d2Node.visible = true;
  19096. xGame.common.d3World.d3Hand.gameObj.active = false;
  19097. xGame.common.showOneCamera("mainCamera");
  19098. Moyu.recordGame(30, true);
  19099. if (!this.isPrePlay) {
  19100. this.isPrePlay = true;
  19101. xGame.common.d3World.prePlayEft();
  19102. }
  19103. xGame.common.gameMgr.gameReady();
  19104. this.openAllEvent();
  19105. this.ui.snowNode.visible = false;
  19106. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  19107. this.ui.helpBtn.visible = condition;
  19108. }
  19109. showHelpLineGuide() {
  19110. let longGuide = DataMgr.getGuideHelpLine();
  19111. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  19112. this.ui.helpBtn.visible = true;
  19113. this.ui.guideNode.visible = true;
  19114. }
  19115. }
  19116. setTurnAlpha(alpha) {
  19117. this.ui.keduNode.alpha = alpha;
  19118. this.ui.ganNode.alpha = alpha;
  19119. this.ui.rodMethodNode.alpha = alpha;
  19120. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  19121. }
  19122. cameraViewChange(callback) {
  19123. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  19124. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  19125. xGame.common.showOneCamera("visitAngle");
  19126. cameraSrc.localRotationEulerY = 180;
  19127. cameraSrc.localRotationEulerZ = 0;
  19128. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  19129. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  19130. callback && callback();
  19131. }));
  19132. }));
  19133. }
  19134. playPutBallD3Ani() {
  19135. xGame.common.showOneCamera("mainCamera");
  19136. let handSrc = xGame.common.d3World.d3Hand;
  19137. handSrc.gameObj.active = true;
  19138. handSrc.transform.localPositionZ = 3;
  19139. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  19140. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  19141. handSrc.gameObj.active = false;
  19142. this.enterGame();
  19143. }), 400);
  19144. }));
  19145. }
  19146. updateHead() {
  19147. let user = Moyu.getUserInfo();
  19148. this.ui.topNode.selfNameTxt.text = user.nickName;
  19149. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  19150. let aiData = xGame.cfgMgr.getRandomUserInfo();
  19151. if (DataMgr.getSkillGuide() < 1) {
  19152. this.ui.topNode.aiNameTxt.text = 'billiards';
  19153. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  19154. }
  19155. else {
  19156. this.ui.topNode.aiNameTxt.text = aiData.name;
  19157. let randNo = Math.floor(Math.random() * 10) + 1;
  19158. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  19159. }
  19160. }
  19161. initD2world() {
  19162. let node = this.ui.d2Root.displayObject;
  19163. let src = node.getComponent(D2World);
  19164. if (!src) {
  19165. xGame.common.d2World = node.addComponent(D2World);
  19166. }
  19167. xGame.common.d2World.initSelf();
  19168. }
  19169. initD3world() {
  19170. if (this.isD3Inited)
  19171. return;
  19172. this.isD3Inited = true;
  19173. let scene3D = xGame.common.d3Scene;
  19174. this.ui.d3Root.displayObject.addChild(scene3D);
  19175. scene3D.active = true;
  19176. xGame.common.d3World.tableSrc.setBorderPos();
  19177. }
  19178. onRootMove(e) {
  19179. let rootBall = xGame.common.d2World.rootBall;
  19180. this.ui.moveNode.x = e.x;
  19181. this.ui.moveNode.y = e.y;
  19182. rootBall.gameObj.x = e.x;
  19183. rootBall.gameObj.y = e.y;
  19184. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  19185. }
  19186. aiRootMove(move) {
  19187. if (move)
  19188. this.hideBallUI();
  19189. else {
  19190. this.showBallUI();
  19191. xGame.common.d2World.getHelpLine();
  19192. }
  19193. }
  19194. aiForce(type, force = 0) {
  19195. this.pressTarget = PressType.powerNode;
  19196. if (type == 1)
  19197. this.onEventUp({ force: true });
  19198. else if (type == 2)
  19199. this.onEventMove({ stageY: force, force: true });
  19200. }
  19201. onEventPress(e) {
  19202. if (e.stopPropagation)
  19203. e.stopPropagation();
  19204. if (!this.isTurnSelf())
  19205. return;
  19206. let target = e.target;
  19207. switch (target) {
  19208. case this.ui.myPowerNode.displayObject:
  19209. this.pressTarget = PressType.powerNode;
  19210. this.barInfo.curY = e.stageY;
  19211. this.updateBarInfo();
  19212. break;
  19213. case this.ui.moveNode.displayObject:
  19214. this.pressTarget = PressType.moveNode;
  19215. this.hideBallUI();
  19216. this.eventObj.curX = this.ui.moveNode.x;
  19217. this.eventObj.curY = this.ui.moveNode.y;
  19218. this.ui.moveNode.finger.visible = false;
  19219. this.eventObj.lastX = e.stageX;
  19220. this.eventObj.lastY = e.stageY;
  19221. break;
  19222. case this.ui.rulerClickNode.displayObject:
  19223. this.pressTarget = PressType.rulerNode;
  19224. this.eventObj.lastY = e.stageY;
  19225. break;
  19226. case this.ui.d2Root.displayObject:
  19227. this.pressTarget = PressType.d2Root;
  19228. this.eventObj.lastX = e.stageX;
  19229. this.eventObj.lastY = e.stageY;
  19230. this.eventObj.starX = e.stageX;
  19231. this.eventObj.starY = e.stageY;
  19232. this.eventObj.curX = 0;
  19233. this.eventObj.curY = 0;
  19234. xGame.common.d2World.d2Gan.setGanLastInfo();
  19235. this.rulerOffset = 0;
  19236. break;
  19237. default:
  19238. break;
  19239. }
  19240. }
  19241. onEventMove(e) {
  19242. if (e.stopPropagation)
  19243. e.stopPropagation();
  19244. if (e && e.force) {
  19245. }
  19246. else {
  19247. if (!this.isTurnSelf())
  19248. return;
  19249. }
  19250. switch (this.pressTarget) {
  19251. case PressType.powerNode:
  19252. this.barInfo.curY = e.stageY;
  19253. this.updateBarInfo();
  19254. this.isMoveRod = true;
  19255. break;
  19256. case PressType.moveNode:
  19257. let rootBall = xGame.common.d2World.rootBall;
  19258. let radius = rootBall.gameObj.width / 2;
  19259. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  19260. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  19261. let border = xGame.common.d2World.borderRect;
  19262. if (curX <= border.x + radius)
  19263. curX = border.x + radius;
  19264. else if (curX >= border.x + border.width - radius)
  19265. curX = border.x + border.width - radius;
  19266. if (curY <= border.y + radius)
  19267. curY = border.y + radius;
  19268. else if (curY >= border.y + border.height - radius)
  19269. curY = border.y + border.height - radius;
  19270. if (xGame.common.gameMgr.isOpenBall) {
  19271. if (curX >= border.x + border.openBallW - radius)
  19272. curX = border.x + border.openBallW - radius;
  19273. }
  19274. this.ui.moveNode.x = curX;
  19275. this.ui.moveNode.y = curY;
  19276. rootBall.gameObj.x = curX;
  19277. rootBall.gameObj.y = curY;
  19278. rootBall.d3BallSrc.setTransPos(curX, curY);
  19279. this.isMoveRod = true;
  19280. break;
  19281. case PressType.rulerNode:
  19282. let yy = e.stageY - this.eventObj.lastY;
  19283. this.eventObj.lastY = e.stageY;
  19284. let ruler1 = this.ui.rulerNode.img1;
  19285. let ruler2 = this.ui.rulerNode.img2;
  19286. ruler1.y += yy;
  19287. ruler2.y += yy;
  19288. this.rulerOffset += yy;
  19289. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  19290. this.rulerOffset = 0;
  19291. xGame.soundMgr.playSound("inch", 1, 10);
  19292. }
  19293. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  19294. let h = ruler1.height;
  19295. this.checkGuide();
  19296. this.isMoveRod = true;
  19297. if (ruler1.y >= h) {
  19298. ruler1.y = -h;
  19299. ruler2.y = 0;
  19300. return;
  19301. }
  19302. else if (ruler1.y <= -h) {
  19303. ruler1.y = h;
  19304. ruler2.y = 0;
  19305. return;
  19306. }
  19307. if (ruler2.y >= h) {
  19308. ruler2.y = -h;
  19309. ruler1.y = 0;
  19310. return;
  19311. }
  19312. else if (ruler2.y <= -h) {
  19313. ruler2.y = h;
  19314. ruler1.y = 0;
  19315. return;
  19316. }
  19317. break;
  19318. case PressType.d2Root:
  19319. this.eventObj.curX = e.stageX;
  19320. this.eventObj.curY = e.stageY;
  19321. let offset = this.checkRodMoveDir();
  19322. xGame.common.d2World.d2Gan.rotateSelf(offset);
  19323. this.eventObj.lastX = e.stageX;
  19324. this.eventObj.lastY = e.stageY;
  19325. break;
  19326. default:
  19327. break;
  19328. }
  19329. }
  19330. onEventUp(e) {
  19331. if (e.stopPropagation)
  19332. e.stopPropagation();
  19333. if (e && e.force) {
  19334. }
  19335. else {
  19336. if (!this.isTurnSelf())
  19337. return;
  19338. }
  19339. switch (this.pressTarget) {
  19340. case PressType.powerNode:
  19341. this.ui.powerNode.value = 0;
  19342. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  19343. this.ui.powerTxt.text = "";
  19344. if (this.powerNum > 0) {
  19345. xGame.eventMgr.event(BALL_SHOOT);
  19346. xGame.common.d2World.shoot(this.powerNum);
  19347. xGame.common.d2World.d2Gan.shoot();
  19348. xGame.common.d2World.d2HelpLine.shoot();
  19349. this.finishGuide();
  19350. this.ui.powerEft.visible = false;
  19351. this.ui.colorNode.visible = false;
  19352. let ganStr = "";
  19353. if (this.powerNum <= 30) {
  19354. ganStr = "gan_30";
  19355. }
  19356. else if (this.powerNum <= 60) {
  19357. ganStr = "gan_50";
  19358. }
  19359. else {
  19360. ganStr = "gan_80";
  19361. }
  19362. xGame.soundMgr.playSound(ganStr);
  19363. }
  19364. break;
  19365. case PressType.moveNode:
  19366. let rootBall = xGame.common.d2World.rootBall;
  19367. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  19368. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  19369. let isIntersect = this.judgeBallIntersect();
  19370. if (isIntersect) {
  19371. this.ui.moveNode.x = lastX;
  19372. this.ui.moveNode.y = lastY;
  19373. rootBall.gameObj.x = lastX;
  19374. rootBall.gameObj.y = lastY;
  19375. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  19376. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  19377. }
  19378. else {
  19379. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  19380. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  19381. }
  19382. this.showBallUI();
  19383. this.ui.moveNode.finger.visible = true;
  19384. xGame.common.d2World.getHelpLine();
  19385. break;
  19386. case PressType.rulerNode:
  19387. break;
  19388. case PressType.d2Root:
  19389. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  19390. if (dis <= 25) {
  19391. this.moveToClickDot(e);
  19392. }
  19393. break;
  19394. default:
  19395. break;
  19396. }
  19397. this.pressTarget = -1;
  19398. }
  19399. checkGuide() {
  19400. let guide = DataMgr.getSkillGuide();
  19401. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  19402. xGame.common.guideStep++;
  19403. xGame.common.gameUI.ui.guide2.visible = false;
  19404. xGame.common.gameUI.ui.guide3.visible = true;
  19405. }
  19406. }
  19407. finishGuide() {
  19408. let guide = DataMgr.getSkillGuide();
  19409. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  19410. xGame.common.guideStep = 10;
  19411. this.closeAllGuide();
  19412. console.log('zh: 新手引导完毕');
  19413. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  19414. }
  19415. }
  19416. closeAllGuide() {
  19417. xGame.common.gameUI.ui.guide1.visible = false;
  19418. xGame.common.gameUI.ui.guide2.visible = false;
  19419. xGame.common.gameUI.ui.guide3.visible = false;
  19420. }
  19421. updateBarInfo() {
  19422. let star = this.ui.powerNode.y;
  19423. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  19424. if (rate >= 1)
  19425. rate = 1;
  19426. if (rate <= 0)
  19427. rate = 0;
  19428. this.powerNum = Math.ceil(rate * 100);
  19429. this.ui.powerNode.value = this.powerNum;
  19430. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  19431. this.ui.colorNode.value = this.powerNum;
  19432. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  19433. this.ui.powerEft.visible = this.powerNum != 0;
  19434. this.ui.colorNode.visible = this.powerNum != 0;
  19435. this.ui.powerTxt.text = this.powerNum + "";
  19436. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  19437. }
  19438. forceCancel() {
  19439. this.ui.powerNode.value = 0;
  19440. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  19441. this.ui.powerTxt.text = "";
  19442. }
  19443. checkRodMoveDir() {
  19444. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  19445. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  19446. if (tempX >= 0 && tempY <= 0) {
  19447. return this.checkDir();
  19448. }
  19449. else if (tempX < 0 && tempY < 0) {
  19450. return this.checkDir(1, -1);
  19451. }
  19452. else if (tempX < 0 && tempY > 0) {
  19453. return this.checkDir(-1, -1);
  19454. }
  19455. else {
  19456. return this.checkDir(-1, 1);
  19457. }
  19458. }
  19459. checkDir(flagX = 1, flagY = 1) {
  19460. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  19461. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  19462. if (offsetY == 0) {
  19463. return offsetX * flagX;
  19464. }
  19465. if (offsetX == 0) {
  19466. return offsetY * flagY;
  19467. }
  19468. let angle = offsetY / offsetX;
  19469. if (Math.abs(angle) >= 1) {
  19470. return offsetY * flagY;
  19471. }
  19472. else {
  19473. return offsetX * flagX;
  19474. }
  19475. }
  19476. judgeBallIntersect() {
  19477. let rootBall = xGame.common.d2World.rootBall;
  19478. let ballArr = xGame.common.d2World.ballArr;
  19479. let radius = rootBall.gameObj.width / 2;
  19480. let temp;
  19481. let isIntersect = false;
  19482. for (let index = 0; index < ballArr.length; index++) {
  19483. temp = ballArr[index];
  19484. if (temp.number == rootBall.number)
  19485. continue;
  19486. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  19487. if (isIntersect) {
  19488. break;
  19489. }
  19490. }
  19491. return isIntersect;
  19492. }
  19493. hideBallUI() {
  19494. let d2Gan = xGame.common.d2World.d2Gan;
  19495. if (!d2Gan.ui.isDisposed)
  19496. d2Gan.ui.visible = false;
  19497. let d2Help = xGame.common.d2World.d2HelpLine;
  19498. if (!d2Help.ui.isDisposed)
  19499. d2Help.ui.visible = false;
  19500. let rootBall = xGame.common.d2World.rootBall;
  19501. if (!rootBall.destroyed) {
  19502. rootBall.gameObj.active = false;
  19503. }
  19504. }
  19505. showBallUI() {
  19506. let d2Gan = xGame.common.d2World.d2Gan;
  19507. if (!d2Gan.ui.isDisposed)
  19508. d2Gan.ui.visible = true;
  19509. let d2Help = xGame.common.d2World.d2HelpLine;
  19510. if (!d2Help.ui.isDisposed)
  19511. d2Help.ui.visible = true;
  19512. let rootBall = xGame.common.d2World.rootBall;
  19513. if (!rootBall.destroyed) {
  19514. rootBall.gameObj.active = true;
  19515. }
  19516. }
  19517. moveToClickDot(e) {
  19518. if (!this.isMoveRod && !xGame.common.clickedBall) {
  19519. let root = xGame.common.d2World.rootBall.gameObj;
  19520. let xx = e.stageX - xGame.common.sysOffestNum;
  19521. let yy = e.stageY;
  19522. let x = xx - root.x;
  19523. let y = yy - root.y;
  19524. let angle = xGame.common.getfguiRotation(x, y);
  19525. xGame.common.d2World.d2Gan.ui.rotation = angle;
  19526. xGame.common.d2World.getHelpLine();
  19527. }
  19528. this.isMoveRod = false;
  19529. xGame.common.clickedBall = false;
  19530. }
  19531. openAllEvent() {
  19532. this.closeAllEvent();
  19533. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19534. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19535. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19536. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19537. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  19538. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  19539. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  19540. }
  19541. closeAllEvent() {
  19542. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19543. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19544. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19545. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19546. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  19547. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  19548. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  19549. }
  19550. resetGame() {
  19551. this.closeAllEvent();
  19552. this.hideBallUI();
  19553. xGame.common.gameMgr.gamePause = true;
  19554. }
  19555. }
  19556. UIGame$1.uiName = "UIGame";
  19557. class UIAddCoin$1 extends UIBase {
  19558. constructor() {
  19559. super();
  19560. this.coinNum = 2000;
  19561. }
  19562. onConstructor() {
  19563. this.ui = ui_UIAddCoin.createInstance();
  19564. this.contentPane = this.ui;
  19565. this.isEject = false;
  19566. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  19567. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  19568. }
  19569. show() {
  19570. super.show();
  19571. this.ui.t0.play();
  19572. }
  19573. videoAddCoin() {
  19574. console.log('zh:qjff_AD_for_UIAddCoin');
  19575. if (Laya.Browser.onAndroid) {
  19576. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  19577. if (!boo) {
  19578. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  19579. return;
  19580. }
  19581. }
  19582. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  19583. }
  19584. else {
  19585. console.log('zh:AD 失败,直接发放奖励');
  19586. this.qjff_AD_for_UIAddCoin();
  19587. }
  19588. }
  19589. qjff_AD_for_UIAddCoin() {
  19590. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  19591. this.hide();
  19592. }
  19593. }
  19594. UIAddCoin$1.uiName = "UIAddCoin";
  19595. class UIInvitation$1 extends UIBase {
  19596. constructor() {
  19597. super();
  19598. }
  19599. onConstructor() {
  19600. this.ui = ui_UIInvitation.createInstance();
  19601. this.contentPane = this.ui;
  19602. this.isEject = false;
  19603. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  19604. }
  19605. show() {
  19606. super.show();
  19607. }
  19608. enterGame() {
  19609. xGame.common.gameMode = GameMode.classic;
  19610. DataMgr.setChallengeTimes(1);
  19611. xGame.common.passAwardCoin = 2000;
  19612. let need = xGame.common.classicNiceNeddCoin;
  19613. if (DataMgr.coinEnough(need)) {
  19614. DataMgr.setCoin(-need);
  19615. xGame.eventMgr.event(RESTART_GAME, true);
  19616. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  19617. }
  19618. else {
  19619. xGame.eventMgr.event(RESTART_GAME, true);
  19620. }
  19621. this.hide();
  19622. }
  19623. hide() {
  19624. super.hide();
  19625. }
  19626. }
  19627. UIInvitation$1.uiName = "UIInvitation";
  19628. class UIPower$1 extends UIBase {
  19629. constructor() {
  19630. super();
  19631. }
  19632. onConstructor() {
  19633. this.ui = ui_UIPower.createInstance();
  19634. this.contentPane = this.ui;
  19635. this.isEject = false;
  19636. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  19637. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  19638. }
  19639. show() {
  19640. super.show();
  19641. this.ui.t0.play();
  19642. }
  19643. videoGetPower() {
  19644. console.log('zh:qjff_AD_for_uipower');
  19645. if (Laya.Browser.onAndroid) {
  19646. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  19647. if (!boo) {
  19648. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  19649. return;
  19650. }
  19651. }
  19652. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  19653. }
  19654. else {
  19655. console.log('zh:AD 失败,直接发放奖励');
  19656. this.qjff_AD_for_uipower();
  19657. }
  19658. }
  19659. qjff_AD_for_uipower() {
  19660. DataMgr.setPower(xGame.common.videoPower, true);
  19661. xGame.eventMgr.event(POWER_TIME);
  19662. this.hide();
  19663. }
  19664. }
  19665. UIPower$1.uiName = "UIPower";
  19666. class UIGameEnd$1 extends UIBase {
  19667. constructor() {
  19668. super();
  19669. this.success = false;
  19670. this.awardCoinNum = 1000;
  19671. this.awardDiamondNum = 10;
  19672. }
  19673. onConstructor() {
  19674. this.ui = ui_UIGameEnd.createInstance();
  19675. this.contentPane = this.ui;
  19676. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  19677. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  19678. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  19679. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19680. this.ui.talkNode.visible = false;
  19681. if (Moyu.isKs)
  19682. this.ui.closeNode.closeBtn.x += 100;
  19683. }
  19684. updateType() {
  19685. switch (xGame.common.gameMode) {
  19686. case GameMode.classic:
  19687. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  19688. this.ui.coinNode.visible = this.success;
  19689. if (!this.success) {
  19690. Laya.timer.once(500, this, () => {
  19691. xGame.uiMgr.Show(UIAddCoin$1);
  19692. });
  19693. }
  19694. else {
  19695. this.logEventForClassic_win();
  19696. }
  19697. this.logEventForClassic_complete();
  19698. this.ui.isGetAward.visible = false;
  19699. this.ui.leftBtn.c1.selectedIndex = 3;
  19700. this.ui.rightBtn.c1.selectedIndex = 0;
  19701. this.moneyNode.ui.c1.selectedIndex = 1;
  19702. break;
  19703. case GameMode.bigMove:
  19704. console.log('zh:招法模式 aaaaaa bigMove');
  19705. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  19706. this.ui.coinNode.visible = this.success;
  19707. if (xGame.common.gameMode == GameMode.bigMove) {
  19708. if (this.success) {
  19709. DataMgr.setSkillSuccessTimes(1, true);
  19710. DataMgr.setSkillAccTimes(1);
  19711. }
  19712. else {
  19713. DataMgr.setSkillSuccessTimes(0, false);
  19714. }
  19715. }
  19716. this.logEventForRod_complete_N();
  19717. if (!this.success) {
  19718. Laya.timer.once(500, this, () => {
  19719. xGame.uiMgr.Show(UIAddCoin$1);
  19720. });
  19721. }
  19722. else {
  19723. this.logEventForRod_win();
  19724. }
  19725. this.ui.isGetAward.visible = false;
  19726. this.ui.leftBtn.c1.selectedIndex = 3;
  19727. this.ui.rightBtn.c1.selectedIndex = 0;
  19728. this.moneyNode.ui.c1.selectedIndex = 1;
  19729. break;
  19730. case GameMode.placeBall:
  19731. this.ui.coinNode.visible = false;
  19732. if (this.success) {
  19733. if (xGame.common.placeBallStarNum == 3) {
  19734. this.ui.c1.selectedIndex = 2;
  19735. }
  19736. else {
  19737. this.ui.c1.selectedIndex = 3;
  19738. }
  19739. let level = xGame.common.placeBallCurLevel;
  19740. if (level > 59) {
  19741. this.logEventForChallenge_level_complete(level);
  19742. }
  19743. else {
  19744. this.logEventForChallenge_level_N(level);
  19745. }
  19746. }
  19747. else {
  19748. this.ui.c1.selectedIndex = 4;
  19749. }
  19750. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  19751. if (cfg.type == PlaceBallType.challenge) {
  19752. this.ui.c1.selectedIndex = 2;
  19753. }
  19754. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  19755. this.updatePlaceBallBtn();
  19756. this.updatePlaceBallStarNum();
  19757. this.updatePlaceBallAwardState();
  19758. this.moneyNode.ui.c1.selectedIndex = 2;
  19759. this.moneyNode.checkPowerTime();
  19760. this.moneyNode.powerChange();
  19761. DataMgr.upRankData();
  19762. break;
  19763. default:
  19764. break;
  19765. }
  19766. }
  19767. logEventForRod_complete_N() {
  19768. let gfmsIdx = xGame.common.curPlayerSkillType;
  19769. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  19770. let gfmc = 'Skyfall Shot';
  19771. if (gfmsIdx == 0) {
  19772. gfmc = 'Skyfall Shot';
  19773. }
  19774. if (gfmsIdx == 1) {
  19775. gfmc = 'Surging break';
  19776. }
  19777. if (gfmsIdx == 2) {
  19778. gfmc = 'Frost Lock';
  19779. }
  19780. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  19781. console.log('zh:logEventForRod_complete_N level = ' + level);
  19782. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  19783. let jsonStr = {
  19784. "count": 0,
  19785. "name": gfmc
  19786. };
  19787. if (LocalStorageManager.hasJosnKey(keyStr)) {
  19788. const d = LocalStorageManager.getItem(keyStr);
  19789. jsonStr.count = d.count + 1;
  19790. LocalStorageManager.setItem(keyStr, jsonStr);
  19791. }
  19792. else {
  19793. LocalStorageManager.setItem(keyStr, jsonStr);
  19794. }
  19795. const d2 = LocalStorageManager.getItem(keyStr);
  19796. let count = d2.count;
  19797. console.log('zh:logEventForRod_complete_N count = ' + count);
  19798. if (count % 5 == 0) {
  19799. const reqStr = JSON.stringify(jsonStr);
  19800. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  19801. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  19802. }
  19803. }
  19804. logEventForRod_win() {
  19805. console.log('zh:logEventForRod_win,胜利');
  19806. let gfmsIdx = xGame.common.curPlayerSkillType;
  19807. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  19808. let gfmc = 'Skyfall Shot';
  19809. if (gfmsIdx == 0) {
  19810. gfmc = 'Skyfall Shot';
  19811. }
  19812. if (gfmsIdx == 1) {
  19813. gfmc = 'Surging break';
  19814. }
  19815. if (gfmsIdx == 2) {
  19816. gfmc = 'Frost Lock';
  19817. }
  19818. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  19819. console.log('zh:logEventForRod_win level = ' + level);
  19820. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  19821. let jsonStr = {
  19822. "count": 1,
  19823. "name": gfmc + ' Lev' + level
  19824. };
  19825. if (LocalStorageManager.hasJosnKey(keyStr)) {
  19826. const d = LocalStorageManager.getItem(keyStr);
  19827. jsonStr.count = d.count + 1;
  19828. LocalStorageManager.setItem(keyStr, jsonStr);
  19829. }
  19830. else {
  19831. LocalStorageManager.setItem(keyStr, jsonStr);
  19832. }
  19833. const reqStr = JSON.stringify(jsonStr);
  19834. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  19835. }
  19836. logEventForClassic_win() {
  19837. console.log('zh:logEventForClassic_win,胜利');
  19838. let rtype = xGame.common.classicRoomType;
  19839. let msmc = '';
  19840. if (rtype == 1) {
  19841. msmc = 'beginner';
  19842. }
  19843. if (rtype == 2) {
  19844. msmc = 'expert';
  19845. }
  19846. if (rtype == 3) {
  19847. msmc = 'master';
  19848. }
  19849. let keyStr = 'sjmd_classic_win_' + rtype;
  19850. let jsonStr = {
  19851. "difficulty": msmc,
  19852. "classic_count": 1,
  19853. "difficulty_count": 1
  19854. };
  19855. if (LocalStorageManager.hasJosnKey(keyStr)) {
  19856. const d = LocalStorageManager.getItem(keyStr);
  19857. jsonStr.classic_count = d.classic_count + 1;
  19858. jsonStr.difficulty_count = d.difficulty_count + 1;
  19859. LocalStorageManager.setItem(keyStr, jsonStr);
  19860. }
  19861. else {
  19862. LocalStorageManager.setItem(keyStr, jsonStr);
  19863. }
  19864. const reqStr = JSON.stringify(jsonStr);
  19865. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  19866. }
  19867. logEventForClassic_complete() {
  19868. console.log('zh:logEventForClassic_complete,胜利');
  19869. let rtype = xGame.common.classicRoomType;
  19870. let msmc = '';
  19871. if (rtype == 1) {
  19872. msmc = 'beginner';
  19873. }
  19874. if (rtype == 2) {
  19875. msmc = 'expert';
  19876. }
  19877. if (rtype == 3) {
  19878. msmc = 'master';
  19879. }
  19880. let keyStr = 'sjmd_classic_complete_' + rtype;
  19881. let jsonStr = {
  19882. "msmc": msmc,
  19883. "count": 0
  19884. };
  19885. if (LocalStorageManager.hasJosnKey(keyStr)) {
  19886. const d = LocalStorageManager.getItem(keyStr);
  19887. jsonStr.count = d.count + 1;
  19888. LocalStorageManager.setItem(keyStr, jsonStr);
  19889. }
  19890. else {
  19891. LocalStorageManager.setItem(keyStr, jsonStr);
  19892. }
  19893. if (jsonStr.count % 5 == 0) {
  19894. const reqStr = JSON.stringify(jsonStr);
  19895. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  19896. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  19897. }
  19898. }
  19899. updatePlaceBallBtn() {
  19900. this.ui.leftBtn.c1.selectedIndex = 5;
  19901. if (this.success) {
  19902. this.ui.rightBtn.c1.selectedIndex = 14;
  19903. }
  19904. else {
  19905. if (xGame.common.placeBallStarNum == 3) {
  19906. this.ui.rightBtn.c1.selectedIndex = 14;
  19907. }
  19908. else {
  19909. this.ui.rightBtn.c1.selectedIndex = 1;
  19910. }
  19911. }
  19912. }
  19913. updatePlaceBallStarNum() {
  19914. let starNum = xGame.common.placeBallStarNum;
  19915. if (starNum == 0)
  19916. this.ui.starNumNode.c1.selectedIndex = 3;
  19917. else {
  19918. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  19919. }
  19920. }
  19921. updatePlaceBallAwardState() {
  19922. let level = xGame.common.placeBallCurLevel;
  19923. let starNum = xGame.common.placeBallStarNum;
  19924. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  19925. let data = cfgTable.placeballData[level].award;
  19926. let cfg = cfgTable.placeballData[level];
  19927. this.awardDiamondNum = data[1];
  19928. this.awardCoinNum = data[0];
  19929. if (cfg.type == PlaceBallType.challenge) {
  19930. this.awardDiamondNum = 0;
  19931. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  19932. }
  19933. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  19934. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  19935. if (cfg.type == PlaceBallType.challenge) {
  19936. this.ui.awardNode.coinNode.visible = true;
  19937. }
  19938. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  19939. this.ui.awardNode.diamondNode.x = 265;
  19940. this.ui.awardNode.coinNode.x = 354;
  19941. }
  19942. else {
  19943. this.ui.awardNode.diamondNode.x = 291;
  19944. this.ui.awardNode.coinNode.x = 291;
  19945. }
  19946. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  19947. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  19948. if (this.awardCoinNum == 0) {
  19949. this.ui.awardNode.coinNode.numTxt.text = "";
  19950. }
  19951. if (getAward) {
  19952. this.ui.isGetAward.visible = true;
  19953. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  19954. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  19955. }
  19956. else {
  19957. this.ui.isGetAward.visible = false;
  19958. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  19959. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  19960. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  19961. }
  19962. else {
  19963. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  19964. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  19965. }
  19966. }
  19967. }
  19968. show(success) {
  19969. super.show();
  19970. xGame.eventMgr.event(RESET_GAME);
  19971. this.success = success;
  19972. Laya.timer.clearAll(this);
  19973. this.playSecretaryAni();
  19974. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  19975. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  19976. offsetTime = Math.floor(offsetTime / 1000);
  19977. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  19978. this.updateType();
  19979. Laya.timer.once(200, this, () => {
  19980. this.addAward(() => {
  19981. this.updateType();
  19982. Laya.timer.once(500, this, () => {
  19983. this.showChallengeLevel();
  19984. });
  19985. });
  19986. });
  19987. if (this.success) {
  19988. JSBridgeUtils.instance.showInternAd('gameend_success');
  19989. console.log('zh:game end 成功');
  19990. xGame.soundMgr.playSound('slots_roll01');
  19991. xGame.soundMgr.playSound("s_win");
  19992. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19993. this.diyGameDataUtilForGameWin();
  19994. }
  19995. else {
  19996. JSBridgeUtils.instance.showInternAd('gameend_faill');
  19997. console.log('zh:game end失败');
  19998. xGame.soundMgr.playSound('matchwin01');
  19999. xGame.soundMgr.playSound("s_lose");
  20000. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20001. }
  20002. let challengeNum = DataMgr.getChallengeTimes();
  20003. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  20004. DataMgr.setChallengeTimes(1);
  20005. }
  20006. if (this.success && xGame.common.gameMode == GameMode.classic) {
  20007. DataMgr.setClassicTimes();
  20008. }
  20009. }
  20010. diyGameDataUtilForGameWin() {
  20011. console.log('zh: DiyGameDataUtilForGameWin diy ');
  20012. switch (xGame.common.gameMode) {
  20013. case GameMode.classic:
  20014. console.log('zh:DiyGameDataUtilForGameWin 111');
  20015. case GameMode.bigMove:
  20016. console.log('zh:DiyGameDataUtilForGameWin 222');
  20017. this.restartGame();
  20018. break;
  20019. case GameMode.placeBall:
  20020. console.log('zh:DiyGameDataUtilForGameWin 333');
  20021. var level = xGame.common.placeBallCurLevel;
  20022. console.log('zh:练习模式 联系了多少LEV=' + level);
  20023. let db_over_lev = DataMgr.getChallengeMode_overLev();
  20024. if (level > db_over_lev) {
  20025. DataMgr.setChallengeMode_overLev(level);
  20026. }
  20027. break;
  20028. default:
  20029. console.log('zh:DiyGameDataUtilForGameWin 444');
  20030. break;
  20031. }
  20032. }
  20033. showChallengeLevel() {
  20034. if (DataMgr.getChallengeTimes() != 0)
  20035. return;
  20036. let skill = DataMgr.getSkillAccTimes();
  20037. let put = DataMgr.getPlaceBallLevelList().length;
  20038. if (skill >= 3 || put >= 5) {
  20039. xGame.uiMgr.Show(UIInvitation$1);
  20040. this.hide();
  20041. }
  20042. }
  20043. addAward(callback) {
  20044. if (!this.success) {
  20045. callback && callback();
  20046. return;
  20047. }
  20048. switch (xGame.common.gameMode) {
  20049. case GameMode.classic:
  20050. this.awardCoinNum = xGame.common.passAwardCoin;
  20051. this.awardDiamondNum = 0;
  20052. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  20053. break;
  20054. case GameMode.bigMove:
  20055. this.awardCoinNum = xGame.common.passAwardCoin;
  20056. this.awardDiamondNum = 0;
  20057. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  20058. callback && callback();
  20059. break;
  20060. case GameMode.placeBall:
  20061. let level = xGame.common.placeBallCurLevel;
  20062. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  20063. if (xGame.common.placeBallStarNum != 3) {
  20064. callback && callback();
  20065. return;
  20066. }
  20067. else {
  20068. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  20069. if (getAward) {
  20070. callback && callback();
  20071. return;
  20072. }
  20073. }
  20074. let cfg = cfgTable.placeballData[level];
  20075. let data = cfgTable.placeballData[level].award;
  20076. this.awardCoinNum = data[0];
  20077. this.awardDiamondNum = data[1];
  20078. if (cfg.type == PlaceBallType.challenge) {
  20079. this.awardDiamondNum = 0;
  20080. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  20081. }
  20082. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  20083. let diamondAward;
  20084. if (this.awardDiamondNum > 0) {
  20085. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  20086. xGame.common.getAward([diamondAward, coinAward], callback);
  20087. }
  20088. else {
  20089. xGame.common.getAward([coinAward], callback);
  20090. }
  20091. if (cfg.type == PlaceBallType.normal) {
  20092. DataMgr.setPlaceBallAward(level);
  20093. }
  20094. break;
  20095. default:
  20096. break;
  20097. }
  20098. }
  20099. playSecretaryAni_old() {
  20100. let parent = this.ui.secretary.displayObject;
  20101. parent.destroyChildren();
  20102. let xx = this.ui.secretary.width / 2;
  20103. let yy = this.ui.secretary.height;
  20104. let scale = xGame.common.getSecretaryScale();
  20105. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20106. if (this.success) {
  20107. let rand = Math.random() <= 0.5 ? 2 : 3;
  20108. xGame.common.secretary.play(data, rand, false, parent, () => {
  20109. xGame.common.secretary.play(data, 1, true, parent);
  20110. });
  20111. }
  20112. else {
  20113. xGame.common.secretary.play(data, 0, true, parent);
  20114. }
  20115. }
  20116. playSecretaryAni() {
  20117. let parent = this.ui.secretary.displayObject;
  20118. parent.destroyChildren();
  20119. let xx = this.ui.secretary.width / 2;
  20120. let yy = this.ui.secretary.height;
  20121. let scale = xGame.common.getSecretaryScale();
  20122. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20123. if (this.success) {
  20124. let rand = 0;
  20125. xGame.common.secretary.play(data, 0, true, parent);
  20126. }
  20127. else {
  20128. xGame.common.secretary.play(data, 0, true, parent);
  20129. }
  20130. }
  20131. restartGame() {
  20132. switch (xGame.common.gameMode) {
  20133. case GameMode.classic:
  20134. xGame.eventMgr.event(RESTART_GAME);
  20135. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  20136. break;
  20137. case GameMode.bigMove:
  20138. this.hide();
  20139. xGame.eventMgr.event(RESTART_GAME);
  20140. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  20141. break;
  20142. default:
  20143. break;
  20144. }
  20145. }
  20146. hide() {
  20147. super.hide();
  20148. xGame.common.stopGirlPop(this.ui.talkNode);
  20149. PlatMgr.showBanner(false);
  20150. }
  20151. returnHome() {
  20152. this.hide();
  20153. let showFailWords = !this.success;
  20154. xGame.uiMgr.Show(UIMain$1, showFailWords);
  20155. }
  20156. clickLeftBtn() {
  20157. switch (xGame.common.gameMode) {
  20158. case GameMode.classic:
  20159. case GameMode.bigMove:
  20160. this.returnHome();
  20161. break;
  20162. case GameMode.placeBall:
  20163. let level = xGame.common.placeBallCurLevel;
  20164. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  20165. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  20166. break;
  20167. default:
  20168. break;
  20169. }
  20170. }
  20171. powerStartPlaceBallLevel(level, btn) {
  20172. if (DataMgr.powerEnough()) {
  20173. btn.touchable = false;
  20174. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  20175. btn.touchable = true;
  20176. DataMgr.setPower(-1);
  20177. xGame.eventMgr.event(POWER_TIME);
  20178. this.startPlaceBallLevel(level);
  20179. this.logEventForChallenge_level_start(level);
  20180. }));
  20181. }
  20182. else {
  20183. xGame.uiMgr.Show(UIPower$1, 0);
  20184. }
  20185. }
  20186. clickRightBtn() {
  20187. switch (xGame.common.gameMode) {
  20188. case GameMode.classic:
  20189. console.log('zh:clickRightBtn 111');
  20190. case GameMode.bigMove:
  20191. console.log('zh:clickRightBtn 222');
  20192. this.restartGame();
  20193. break;
  20194. case GameMode.placeBall:
  20195. console.log('zh:clickRightBtn 333');
  20196. let level = xGame.common.placeBallCurLevel;
  20197. let data = DataMgr.getPlaceBallLevel(level);
  20198. let curPss = data.play && !data.isCur;
  20199. if (curPss) {
  20200. console.log('zh:clickRightBtn 333-111');
  20201. console.log('zh:当前LV=' + level);
  20202. if (level == 60) {
  20203. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  20204. Laya.timer.once(3000, this, () => {
  20205. this.returnHome();
  20206. });
  20207. }
  20208. else {
  20209. let lev = level + 1;
  20210. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  20211. }
  20212. }
  20213. else {
  20214. console.log('zh:clickRightBtn 333-000');
  20215. Moyu.sendDataEvent("placeBallNextLevel");
  20216. console.log('zh:qjff_AD_for_uiGameEnd');
  20217. if (Laya.Browser.onAndroid) {
  20218. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20219. if (!boo) {
  20220. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20221. return;
  20222. }
  20223. }
  20224. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  20225. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  20226. }
  20227. else {
  20228. console.log('zh:AD 失败,直接发放奖励');
  20229. this.qjff_AD_for_uiGameEnd(level);
  20230. }
  20231. }
  20232. break;
  20233. default:
  20234. console.log('zh:clickRightBtn 444');
  20235. break;
  20236. }
  20237. }
  20238. logEventForChallenge_level_start(level) {
  20239. let keyStr = 'sjmd_challenge_level_start';
  20240. let jsonStr = {
  20241. "count": 0,
  20242. "gold_balance ": DataMgr.getCoin(),
  20243. "level": level,
  20244. "diamond_balance ": DataMgr.getDiamond()
  20245. };
  20246. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20247. const d = LocalStorageManager.getItem(keyStr);
  20248. if (level > d.level) {
  20249. jsonStr.count = d.count + 1;
  20250. LocalStorageManager.setItem(keyStr, jsonStr);
  20251. }
  20252. else {
  20253. }
  20254. }
  20255. else {
  20256. LocalStorageManager.setItem(keyStr, jsonStr);
  20257. }
  20258. const reqStr = JSON.stringify(jsonStr);
  20259. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  20260. }
  20261. qjff_AD_for_uiGameEnd(level) {
  20262. DataMgr.setPlaceBallLevel(level, 1);
  20263. this.startPlaceBallLevel(level + 1);
  20264. }
  20265. startPlaceBallLevel(level) {
  20266. xGame.common.gameMode = GameMode.placeBall;
  20267. xGame.common.placeBallCurLevel = level;
  20268. xGame.uiMgr.Show(UIGame$1);
  20269. this.hide();
  20270. }
  20271. logEventForChallenge_level_complete(level) {
  20272. let keyStr = 'sjmd_challenge_level_complete';
  20273. let jsonStr = {
  20274. "count": 1,
  20275. "gold_balance ": DataMgr.getCoin(),
  20276. "level": level,
  20277. "diamond_balance ": DataMgr.getDiamond()
  20278. };
  20279. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20280. const d = LocalStorageManager.getItem(keyStr);
  20281. jsonStr.count = d.count + 1;
  20282. LocalStorageManager.setItem(keyStr, jsonStr);
  20283. }
  20284. else {
  20285. LocalStorageManager.setItem(keyStr, jsonStr);
  20286. }
  20287. const reqStr = JSON.stringify(jsonStr);
  20288. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  20289. }
  20290. logEventForChallenge_level_N(level) {
  20291. console.log('zh:logEventForChallenge_level_N ' + level);
  20292. let keyStr = 'sjmd_challenge_level_N';
  20293. if (LocalStorageManager.hasKey(keyStr)) {
  20294. let lev = LocalStorageManager.getItem(keyStr);
  20295. if (level > lev) {
  20296. LocalStorageManager.setItem(keyStr, level);
  20297. }
  20298. if ((level) % 5 == 0) {
  20299. console.log('zh:每5关上报1次');
  20300. let sjmc = 'challenge_level_' + level;
  20301. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  20302. let sjmcForFirebase = 'challenge_level_' + level;
  20303. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  20304. }
  20305. else {
  20306. console.log('zh:5 no 上报');
  20307. }
  20308. }
  20309. else {
  20310. LocalStorageManager.setItem(keyStr, level);
  20311. }
  20312. }
  20313. }
  20314. UIGameEnd$1.uiName = "UIGameEnd";
  20315. class ShowItem$1 {
  20316. constructor() {
  20317. this.ui = ui_ShowItem.createInstance();
  20318. }
  20319. destroySelf() {
  20320. if (!this.ui.isDisposed) {
  20321. this.ui.removeFromParent();
  20322. this.ui.dispose();
  20323. }
  20324. }
  20325. setParent(parent) {
  20326. parent.addChild(this.ui);
  20327. }
  20328. setPos(x, y) {
  20329. this.ui.x = x;
  20330. this.ui.y = y;
  20331. }
  20332. setUrl(index) {
  20333. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  20334. }
  20335. }
  20336. class UILevelProp$1 extends UIBase {
  20337. constructor() {
  20338. super();
  20339. this.firstPos = 385;
  20340. this.secondPos = 467;
  20341. this.showItemArr = [];
  20342. }
  20343. onFontLoaded() {
  20344. try {
  20345. this.ui.myNode.conditionTxt.font = "arial";
  20346. console.log("zh: onFontLoaded 设置arial字体成功");
  20347. }
  20348. catch (error) {
  20349. console.log("zh: constructor onFontLoaded加载arial字体失败");
  20350. }
  20351. }
  20352. onConstructor() {
  20353. this.ui = ui_UILevelProp.createInstance();
  20354. this.contentPane = this.ui;
  20355. this.isEject = false;
  20356. this.addUIClick(this.ui.closeBtn, this.hide);
  20357. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20358. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  20359. }
  20360. show(level) {
  20361. super.show();
  20362. this.ui.t1.play();
  20363. this.level = level;
  20364. this.data = cfgTable.placeballData[this.level];
  20365. this.updateSelf();
  20366. this.showPreView();
  20367. this.moneyNode.ui.c1.selectedIndex = 2;
  20368. this.moneyNode.checkPowerTime();
  20369. this.moneyNode.powerChange();
  20370. }
  20371. showPreView() {
  20372. let item;
  20373. let data;
  20374. for (let index = 0; index < this.showItemArr.length; index++) {
  20375. item = this.showItemArr[index];
  20376. item.destroySelf();
  20377. }
  20378. this.showItemArr = [];
  20379. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  20380. for (const key in cfgData) {
  20381. data = cfgData[key];
  20382. item = new ShowItem$1();
  20383. item.setParent(this.ui.myNode.displayRoot);
  20384. item.setPos(data.x, data.y);
  20385. item.setUrl(data.value);
  20386. this.showItemArr.push(item);
  20387. }
  20388. }
  20389. updateSelf() {
  20390. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  20391. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  20392. if (this.data.ball == -1) {
  20393. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  20394. }
  20395. else {
  20396. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  20397. }
  20398. let localData = DataMgr.getPlaceBallLevel(this.level);
  20399. let getAward = localData.getAward;
  20400. let cfg = cfgTable.placeballData[this.level];
  20401. let coin = this.data.award[0];
  20402. let diamond = this.data.award[1];
  20403. if (cfg.type == PlaceBallType.challenge) {
  20404. diamond = 0;
  20405. coin = 100;
  20406. }
  20407. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  20408. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  20409. this.ui.myNode.coinNode.numTxt.text = coin + "";
  20410. if (cfg.type == PlaceBallType.challenge) {
  20411. this.ui.myNode.coinNode.numTxt.text = "";
  20412. }
  20413. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  20414. if (coin > 0 && diamond > 0) {
  20415. this.ui.myNode.diamondNode.x = 385;
  20416. this.ui.myNode.coinNode.x = 467;
  20417. }
  20418. else {
  20419. this.ui.myNode.diamondNode.x = 385;
  20420. this.ui.myNode.coinNode.x = 385;
  20421. }
  20422. if (!getAward) {
  20423. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  20424. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  20425. }
  20426. else {
  20427. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  20428. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  20429. }
  20430. }
  20431. startGame() {
  20432. if (DataMgr.powerEnough()) {
  20433. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  20434. this.ui.myNode.startBtn.touchable = false;
  20435. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  20436. console.log('zh:startGame ');
  20437. this.ui.myNode.startBtn.touchable = true;
  20438. DataMgr.setPower(-1);
  20439. xGame.eventMgr.event(POWER_TIME);
  20440. xGame.common.gameMode = GameMode.placeBall;
  20441. xGame.common.placeBallCurLevel = this.level;
  20442. xGame.uiMgr.Show(UIGame$1);
  20443. this.logEventForChallenge_level_start(this.level);
  20444. xGame.uiMgr.Hide(UILevelDisplay$1);
  20445. xGame.uiMgr.Hide(UIMain$1);
  20446. this.hide();
  20447. }));
  20448. }
  20449. else {
  20450. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  20451. xGame.uiMgr.Show(UIPower$1);
  20452. }
  20453. }
  20454. logEventForChallenge_level_start(level) {
  20455. let keyStr = 'sjmd_challenge_level_start';
  20456. let jsonStr = {
  20457. "count": 1,
  20458. "gold_balance ": DataMgr.getCoin(),
  20459. "level": level,
  20460. "diamond_balance ": DataMgr.getDiamond()
  20461. };
  20462. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20463. const d = LocalStorageManager.getItem(keyStr);
  20464. if (level > d.level) {
  20465. jsonStr.count = d.count + 1;
  20466. LocalStorageManager.setItem(keyStr, jsonStr);
  20467. }
  20468. else {
  20469. }
  20470. }
  20471. else {
  20472. LocalStorageManager.setItem(keyStr, jsonStr);
  20473. }
  20474. const reqStr = JSON.stringify(jsonStr);
  20475. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  20476. }
  20477. hide() {
  20478. super.hide();
  20479. }
  20480. }
  20481. UILevelProp$1.uiName = "UILevelProp";
  20482. class PutBallLevelDisplay$1 {
  20483. constructor(ui, index) {
  20484. this.index = 0;
  20485. this.ui = ui;
  20486. this.index = index;
  20487. this.ui.onClick(this, this.clickSelf);
  20488. this.updateSelf();
  20489. this.ui.levelTxt.text = (this.index + 1) + "";
  20490. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  20491. this.ui.special.levelTxt.text = (this.index + 1) + "";
  20492. }
  20493. updateSelf() {
  20494. let level = this.index + 1;
  20495. this.data = DataMgr.getPlaceBallLevel(level);
  20496. this.ui.starNode.c1.selectedIndex = this.data.star;
  20497. let isChallenge = cfgTable.placeballData[level].type;
  20498. if (this.data.isCur) {
  20499. if (isChallenge) {
  20500. this.ui.c1.selectedIndex = 5;
  20501. }
  20502. else {
  20503. this.ui.c1.selectedIndex = 2;
  20504. }
  20505. }
  20506. else {
  20507. if (this.data.play) {
  20508. if (this.data.star == 3) {
  20509. this.ui.c1.selectedIndex = 0;
  20510. }
  20511. else {
  20512. this.ui.c1.selectedIndex = 1;
  20513. }
  20514. }
  20515. else {
  20516. if (isChallenge) {
  20517. this.ui.c1.selectedIndex = 4;
  20518. }
  20519. else {
  20520. this.ui.c1.selectedIndex = 3;
  20521. }
  20522. }
  20523. }
  20524. }
  20525. clickSelf() {
  20526. if (!this.data.play)
  20527. return;
  20528. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20529. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  20530. }
  20531. }
  20532. class UILevelDisplay$1 extends UIBase {
  20533. constructor() {
  20534. super();
  20535. }
  20536. onConstructor() {
  20537. this.ui = ui_UILevelDisplay.createInstance();
  20538. this.contentPane = this.ui;
  20539. this.isEject = false;
  20540. this.myList = this.ui.myNode.myList;
  20541. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  20542. this.levelItemArr = [];
  20543. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  20544. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  20545. this.myList.numItems = levelNum;
  20546. if (Moyu.isKs)
  20547. this.ui.closeNode.closeBtn.x += 100;
  20548. }
  20549. levelItemRender(index, target) {
  20550. let item = new PutBallLevelDisplay$1(target, index);
  20551. this.levelItemArr.push(item);
  20552. }
  20553. show() {
  20554. super.show();
  20555. this.updateLevel();
  20556. this.scrollToPlace();
  20557. }
  20558. updateLevel() {
  20559. let temp;
  20560. for (let index = 0; index < this.levelItemArr.length; index++) {
  20561. temp = this.levelItemArr[index];
  20562. temp.updateSelf();
  20563. }
  20564. }
  20565. scrollToPlace() {
  20566. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  20567. let passArr = DataMgr.getPlaceBallLevelList();
  20568. let offest = passArr.length;
  20569. if (offest >= maxNum - 1)
  20570. offest = maxNum - 1;
  20571. this.myList.scrollToView(offest, true, true);
  20572. }
  20573. hide() {
  20574. super.hide();
  20575. }
  20576. }
  20577. UILevelDisplay$1.uiName = "UILevelDisplay";
  20578. class UIMatching$1 extends UIBase {
  20579. constructor() {
  20580. super();
  20581. }
  20582. onConstructor() {
  20583. this.ui = ui_UIMatching.createInstance();
  20584. this.contentPane = this.ui;
  20585. this.isEject = false;
  20586. }
  20587. show(callback) {
  20588. super.show();
  20589. PlatMgr.showBanner(true);
  20590. this.callback = callback;
  20591. let user = Moyu.getUserInfo();
  20592. if (!this.selfPot) {
  20593. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  20594. }
  20595. if (!this.aiPot) {
  20596. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  20597. }
  20598. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  20599. this.ui.selfHead.nameTxt.text = user.nickName;
  20600. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  20601. this.ui.aiHead.nameTxt.text = "???";
  20602. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  20603. this.ui.selfHead.c1.selectedIndex = 0;
  20604. this.ui.aiHead.c1.selectedIndex = 0;
  20605. this.ui.selfHead.x = this.selfPot.x;
  20606. this.ui.selfHead.y = this.selfPot.y;
  20607. this.ui.aiHead.x = this.aiPot.x;
  20608. this.ui.aiHead.y = this.aiPot.y;
  20609. switch (xGame.common.gameMode) {
  20610. case GameMode.classic:
  20611. break;
  20612. case GameMode.bigMove:
  20613. this.initSkillData();
  20614. break;
  20615. default:
  20616. break;
  20617. }
  20618. this.ui.t1.play(Laya.Handler.create(this, () => {
  20619. this.ui.t2.play(Laya.Handler.create(this, () => {
  20620. switch (xGame.common.gameMode) {
  20621. case GameMode.classic:
  20622. this.waitingPeople();
  20623. break;
  20624. case GameMode.bigMove:
  20625. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  20626. break;
  20627. default:
  20628. break;
  20629. }
  20630. }));
  20631. }));
  20632. }
  20633. initSkillData() {
  20634. this.skillSelectData = [];
  20635. let skillUrl = xGame.common.skillIconList;
  20636. let skillName = xGame.common.skillNameList;
  20637. let skillLevel = DataMgr.getBigSkillList();
  20638. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  20639. for (let index = 0; index < 5; index++) {
  20640. let obj = {};
  20641. obj.skillImg = skillUrl[index];
  20642. obj.skillName = skillName[index];
  20643. obj.skillType = skillType[index];
  20644. obj.skillLevel = skillLevel[index];
  20645. this.skillSelectData.push(obj);
  20646. }
  20647. }
  20648. getAISkillLevel(myLevel) {
  20649. let video = xGame.common.upSkillLevel;
  20650. let aiLevel;
  20651. let temp;
  20652. if (video) {
  20653. temp = xGame.common.randomNum(-2, -1);
  20654. }
  20655. else {
  20656. if (myLevel <= 5) {
  20657. temp = xGame.common.randomNum(1, 3);
  20658. }
  20659. else if (myLevel <= 9) {
  20660. temp = xGame.common.randomNum(-2, 1);
  20661. }
  20662. else {
  20663. temp = xGame.common.randomNum(-4, 0);
  20664. }
  20665. }
  20666. aiLevel = temp + myLevel;
  20667. if (aiLevel <= 1)
  20668. aiLevel = 1;
  20669. if (aiLevel >= 10)
  20670. aiLevel = 10;
  20671. return aiLevel;
  20672. }
  20673. getAISkillType() {
  20674. return xGame.common.randomNum(1, 4);
  20675. let successTimes = DataMgr.getSkillSuccessTimes();
  20676. let info = cfgTable.aiskillData[successTimes];
  20677. if (!info) {
  20678. let max = Object.keys(cfgTable.aiskillData).length - 1;
  20679. info = cfgTable.aiskillData[max];
  20680. }
  20681. let dataArr = info.skillselect;
  20682. let myCfg = {};
  20683. for (let index = 0; index < dataArr.length; index++) {
  20684. let temp = dataArr[index].split('-');
  20685. myCfg[temp[0]] = {};
  20686. myCfg[temp[0]].id = parseInt(temp[0]);
  20687. myCfg[temp[0]].weight = parseInt(temp[1]);
  20688. }
  20689. let aiCfg = xGame.common.initWeight(myCfg);
  20690. let curData = xGame.common.getRandomWeightData(aiCfg);
  20691. return parseInt(curData.id);
  20692. }
  20693. getAISkillData(index) {
  20694. let myLevel = this.skillSelectData[index].skillLevel;
  20695. let aiLevel = this.getAISkillLevel(myLevel);
  20696. let aiType = this.getAISkillType() - 1;
  20697. return { aiLevel, aiType } = { aiLevel, aiType };
  20698. }
  20699. skillSelectFinish(index) {
  20700. let aiInfo = this.getAISkillData(index);
  20701. xGame.common.gameMgr.selfCurSkill = index;
  20702. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  20703. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  20704. this.ui.selfHead.c1.selectedIndex = 1;
  20705. this.ui.aiHead.c1.selectedIndex = 1;
  20706. let myData = this.skillSelectData[index];
  20707. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  20708. let guide = DataMgr.getSkillGuide();
  20709. if (guide == 0) {
  20710. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  20711. }
  20712. else {
  20713. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  20714. }
  20715. let aiData = this.skillSelectData[aiInfo.aiType];
  20716. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  20717. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  20718. this.waitingPeople();
  20719. }
  20720. waitingPeople() {
  20721. let time = xGame.common.randomNum(1000, 3000);
  20722. time += 1000;
  20723. Laya.timer.once(time, this, () => {
  20724. this.matchingSuccess();
  20725. });
  20726. }
  20727. matchingSuccess() {
  20728. let gameUI = xGame.common.gameUI;
  20729. let name = gameUI.ui.topNode.aiNameTxt.text;
  20730. let url = gameUI.ui.topNode.aiHeadLoader.url;
  20731. this.ui.aiHead.nameTxt.text = name;
  20732. this.ui.aiHead.headImg.url = url;
  20733. name = gameUI.ui.topNode.selfNameTxt.text;
  20734. url = gameUI.ui.topNode.selfHeadLoader.url;
  20735. this.ui.selfHead.nameTxt.text = name;
  20736. this.ui.selfHead.headImg.url = url;
  20737. this.ui.t3.play(Laya.Handler.create(this, () => {
  20738. this.callback && this.callback();
  20739. this.ui.t4.play(Laya.Handler.create(this, () => {
  20740. this.destroySelf();
  20741. }));
  20742. }));
  20743. }
  20744. destroySelf() {
  20745. this.callback = null;
  20746. this.skillSelectData = null;
  20747. this.selfPot = null;
  20748. this.aiPot = null;
  20749. if (!this.ui.isDisposed) {
  20750. this.ui.removeFromParent();
  20751. this.ui.dispose();
  20752. }
  20753. xGame.uiMgr.destroyUI(this);
  20754. }
  20755. }
  20756. UIMatching$1.uiName = "UIMatching";
  20757. class SkillDisplay$1 {
  20758. constructor(ui, data, uiIndex) {
  20759. this.starX = 0;
  20760. this.starY = 0;
  20761. this.index = 0;
  20762. this.ui = ui;
  20763. this.data = data;
  20764. this.index = uiIndex;
  20765. this.initSelf();
  20766. console.log('zh:SkillDisplay constructor this.skillData=', data);
  20767. }
  20768. initSelf() {
  20769. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  20770. this.ui.nameTxt.text = this.data.name;
  20771. this.ui.describeTxt.text = this.data.describe;
  20772. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  20773. this.ui.startBtn.onClick(this, this.startGame);
  20774. this.updateSelf();
  20775. }
  20776. updateSelf() {
  20777. this.checkTry();
  20778. let level = DataMgr.getBigSkillByIndex(this.index);
  20779. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  20780. }
  20781. checkTry() {
  20782. let index = this.index;
  20783. let level = DataMgr.getBigSkillByIndex(index);
  20784. if (level == null) {
  20785. DataMgr.setBigSkill(index, 1, false);
  20786. level = 1;
  20787. }
  20788. this.ui.levelTxt.text = "LV." + level;
  20789. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  20790. this.ui.tryNode.visible = true;
  20791. else
  20792. this.ui.tryNode.visible = false;
  20793. }
  20794. clickAddLevel() {
  20795. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20796. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  20797. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  20798. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  20799. this.qjff_AD_for_skilldisplay_clickAddLevel();
  20800. }
  20801. else {
  20802. console.log('zh:AD 失败,直接发放奖励');
  20803. this.qjff_AD_for_skilldisplay_clickAddLevel();
  20804. }
  20805. }
  20806. qjff_AD_for_skilldisplay_clickAddLevel() {
  20807. DataMgr.setBigSkill(this.data.index, 1);
  20808. this.updateSelf();
  20809. xGame.common.upSkillLevel = true;
  20810. }
  20811. startGame() {
  20812. console.log('zh:rod skill startgame');
  20813. if (this.data.index == 3) {
  20814. alert('Coming soon!');
  20815. return;
  20816. }
  20817. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20818. let needCoin = xGame.common.bigMoveNeedCoin;
  20819. xGame.common.passAwardCoin = 2000;
  20820. let guide = DataMgr.getSkillGuide();
  20821. console.log('zh:startGame guide=' + guide);
  20822. xGame.common.temSelfLevel = 0;
  20823. if (guide == 0) {
  20824. needCoin = 0;
  20825. xGame.common.temSelfLevel = 100;
  20826. }
  20827. if (DataMgr.coinEnough(needCoin)) {
  20828. DataMgr.setCoin(-needCoin);
  20829. xGame.common.curPlayerSkillType = this.index;
  20830. if (guide == 0)
  20831. xGame.common.curPlayerSkillType = 0;
  20832. console.log('zh: skilldisplay 1');
  20833. xGame.uiMgr.Show(UIGame$1);
  20834. xGame.uiMgr.Hide(UIMain$1);
  20835. xGame.uiMgr.Show(UIMatching$1, () => {
  20836. xGame.common.gameUI.ui.alpha = 1;
  20837. xGame.common.gameUI.startGame();
  20838. xGame.uiMgr.Hide(UISkill$1);
  20839. });
  20840. this.logEventForRod_start();
  20841. }
  20842. else {
  20843. console.log('zh: skilldisplay 2');
  20844. xGame.uiMgr.Show(UIAddProp$1, 0);
  20845. Moyu.sendDataEvent("AddCoinVideo");
  20846. }
  20847. }
  20848. logEventForRod_start() {
  20849. let gfmsIdx = xGame.common.curPlayerSkillType;
  20850. console.log('zh:选择的技能=' + gfmsIdx);
  20851. let gfmc = 'Skyfall Shot';
  20852. if (gfmsIdx == 0) {
  20853. gfmc = 'Skyfall Shot';
  20854. }
  20855. if (gfmsIdx == 1) {
  20856. gfmc = 'Surging break';
  20857. }
  20858. if (gfmsIdx == 2) {
  20859. gfmc = 'Frost Lock';
  20860. }
  20861. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  20862. let jsonStr = {
  20863. "count": 0,
  20864. "name": gfmc
  20865. };
  20866. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20867. const d = LocalStorageManager.getItem(keyStr);
  20868. jsonStr.count = d.count + 1;
  20869. LocalStorageManager.setItem(keyStr, jsonStr);
  20870. }
  20871. else {
  20872. LocalStorageManager.setItem(keyStr, jsonStr);
  20873. }
  20874. const reqStr = JSON.stringify(jsonStr);
  20875. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  20876. }
  20877. }
  20878. class UISkill$1 extends UIBase {
  20879. constructor() {
  20880. super();
  20881. this.skillData = [];
  20882. }
  20883. onConstructor() {
  20884. this.ui = ui_UISkill.createInstance();
  20885. this.contentPane = this.ui;
  20886. this.isEject = false;
  20887. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20888. this.initSkillData();
  20889. console.log('zh:aaaaaa1111111111');
  20890. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  20891. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  20892. console.log('zh:aaaaaa22222222');
  20893. this.displayList = [];
  20894. this.ui.skillNode.skillList.numItems = 3;
  20895. this.addUIClick(this.ui, this.interuptSecretary);
  20896. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  20897. this.ui.talkNode.visible = false;
  20898. if (Moyu.isKs)
  20899. this.ui.closeNode.closeBtn.x += 100;
  20900. }
  20901. show() {
  20902. super.show();
  20903. this.playSecretaryIdle();
  20904. this.moneyNode.ui.c1.selectedIndex = 1;
  20905. Laya.timer.clearAll(this);
  20906. xGame.soundMgr.playSound("s_start");
  20907. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20908. let guide = DataMgr.getSkillGuide();
  20909. this.ui.guideNode.visible = guide == 0;
  20910. let item = this.getSkillItemByUIIndex(0);
  20911. if (guide == 0) {
  20912. item.ui.c1.selectedIndex = 1;
  20913. }
  20914. else {
  20915. item.ui.c1.selectedIndex = 0;
  20916. }
  20917. this.ui.guideNode.guideBtn.visible = guide == 0;
  20918. for (let index = 0; index < this.displayList.length; index++) {
  20919. this.displayList[index].checkTry();
  20920. }
  20921. }
  20922. getSkillItemByUIIndex(cur) {
  20923. for (let index = 0; index < this.displayList.length; index++) {
  20924. if (this.displayList[index].index == cur) {
  20925. return this.displayList[index];
  20926. }
  20927. }
  20928. }
  20929. enterGuideLevel() {
  20930. let item = this.getSkillItemByUIIndex(0);
  20931. item.startGame();
  20932. if (DataMgr.getNewUser())
  20933. Moyu.sendDataEvent("gameStart1");
  20934. }
  20935. initSkillData() {
  20936. this.skillData = [];
  20937. let nameList = xGame.common.skillNameList;
  20938. let iconList = xGame.common.skillIconList;
  20939. let describeList = [
  20940. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  20941. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  20942. "The power of frost descends—freezing the flow and taking full control of the game!"
  20943. ];
  20944. console.log('zh:initSkillData 111111111');
  20945. let data;
  20946. for (let index = 0; index < nameList.length; index++) {
  20947. data = {};
  20948. data.name = nameList[index];
  20949. data.icon = iconList[index];
  20950. data.describe = describeList[index];
  20951. data.index = index;
  20952. this.skillData.push(data);
  20953. }
  20954. }
  20955. updateSkillItem(index, target) {
  20956. if (this.displayList[index] == null) {
  20957. let uiIndex;
  20958. switch (index) {
  20959. case 0:
  20960. uiIndex = 1;
  20961. break;
  20962. case 1:
  20963. uiIndex = 0;
  20964. break;
  20965. case 2:
  20966. uiIndex = 2;
  20967. break;
  20968. case 3:
  20969. uiIndex = 3;
  20970. break;
  20971. default:
  20972. break;
  20973. }
  20974. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  20975. this.displayList.push(temp);
  20976. }
  20977. }
  20978. playSecretaryIdle() {
  20979. let parent = this.ui.secretary.displayObject;
  20980. parent.destroyChildren();
  20981. let xx = this.ui.secretary.width / 2;
  20982. let yy = this.ui.secretary.height;
  20983. let scale = xGame.common.getSecretaryScale();
  20984. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20985. xGame.common.secretary.play(data, 0, true, parent);
  20986. }
  20987. returnUIMain() {
  20988. this.hide();
  20989. xGame.common.stopGirlPop(this.ui.talkNode);
  20990. xGame.uiMgr.Show(UIMain$1);
  20991. }
  20992. interuptSecretary() {
  20993. Laya.timer.clearAll(this);
  20994. this.playSecretaryRandomSound();
  20995. }
  20996. playSecretaryRandomSound() {
  20997. if (this.isHide)
  20998. return;
  20999. let time = xGame.common.randomNum(45000, 60000);
  21000. Laya.timer.once(time, this, () => {
  21001. if (this.isHide)
  21002. return;
  21003. let index = xGame.common.randomNum(4, 7);
  21004. xGame.soundMgr.playSound("s_main0" + index);
  21005. let words = 1;
  21006. switch (index) {
  21007. case 4:
  21008. words = 5;
  21009. break;
  21010. case 5:
  21011. words = 3;
  21012. break;
  21013. case 6:
  21014. words = 6;
  21015. break;
  21016. case 7:
  21017. words = 7;
  21018. break;
  21019. default:
  21020. break;
  21021. }
  21022. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21023. this.playSecretaryRandomSound();
  21024. });
  21025. }
  21026. }
  21027. UISkill$1.uiName = "UISkill";
  21028. class UIAddProp$1 extends UIBase {
  21029. constructor() {
  21030. super();
  21031. this.curType = "";
  21032. }
  21033. onConstructor() {
  21034. this.ui = ui_UIAddProp.createInstance();
  21035. this.contentPane = this.ui;
  21036. this.isEject = false;
  21037. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  21038. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  21039. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  21040. this.updateUI();
  21041. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  21042. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  21043. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  21044. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  21045. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  21046. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  21047. }
  21048. show(type) {
  21049. super.show();
  21050. this.curType = type == 0 ? "coin" : "diamond";
  21051. this.switchBtn("");
  21052. this.ui.t0.play();
  21053. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  21054. PlatMgr.showInsert(true);
  21055. }
  21056. closeSelf() {
  21057. this.hide();
  21058. }
  21059. updateUI() {
  21060. let data = cfgTable.moneyData;
  21061. let temp;
  21062. let obj;
  21063. for (const key in data) {
  21064. temp = data[key];
  21065. obj = this.ui.myNode["node" + key];
  21066. if (parseInt(key) <= 2) {
  21067. obj.diamondTxt.text = "+" + temp.num;
  21068. }
  21069. else {
  21070. obj.coinTxt.text = temp.num;
  21071. obj.diamondTxt.text = temp.get.split('_')[1];
  21072. }
  21073. }
  21074. this.updateDiamondShare();
  21075. }
  21076. updateDiamondShare() {
  21077. let data = DataMgr.getShareDiamondTimes();
  21078. if (data >= xGame.common.maxShareDiamondTimes) {
  21079. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  21080. this.ui.myNode.node1.touchable = false;
  21081. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  21082. }
  21083. else {
  21084. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  21085. this.ui.myNode.node1.touchable = true;
  21086. }
  21087. }
  21088. switchBtn(type) {
  21089. if (type == "")
  21090. type = this.curType;
  21091. else {
  21092. if (this.curType == type) {
  21093. return;
  21094. }
  21095. else {
  21096. this.curType = type;
  21097. }
  21098. }
  21099. if (type == "coin") {
  21100. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  21101. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  21102. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  21103. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  21104. this.ui.myNode.c1.selectedIndex = 0;
  21105. }
  21106. else {
  21107. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  21108. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  21109. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  21110. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  21111. this.ui.myNode.c1.selectedIndex = 1;
  21112. }
  21113. }
  21114. convertCoin(index) {
  21115. let data = cfgTable.moneyData[index];
  21116. let coinNum = data.num;
  21117. let str = data.get.split('_')[1];
  21118. let needDiamond = parseInt(str);
  21119. if (DataMgr.diamondEnough(needDiamond)) {
  21120. DataMgr.setDiamond(-needDiamond);
  21121. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  21122. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  21123. }
  21124. else {
  21125. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  21126. this.switchBtn("diamond");
  21127. }
  21128. }
  21129. videoGetDiamond() {
  21130. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  21131. if (Laya.Browser.onAndroid) {
  21132. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21133. if (!boo) {
  21134. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21135. return;
  21136. }
  21137. }
  21138. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  21139. }
  21140. else {
  21141. console.log('zh:AD 失败,直接发放奖励');
  21142. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  21143. }
  21144. }
  21145. qjff_AD_for_uiAddProp_videoGetDiamond() {
  21146. let num = cfgTable.moneyData[2].num;
  21147. xGame.common.playObjFlyAnim(num, Prop.diamond);
  21148. this.closeSelf();
  21149. }
  21150. videoGetCoin() {
  21151. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  21152. if (Laya.Browser.onAndroid) {
  21153. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21154. if (!boo) {
  21155. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21156. return;
  21157. }
  21158. }
  21159. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  21160. }
  21161. else {
  21162. console.log('zh:AD 失败,直接发放奖励');
  21163. this.qjff_AD_for_uiAddProp_videoGetCoin();
  21164. }
  21165. }
  21166. qjff_AD_for_uiAddProp_videoGetCoin() {
  21167. xGame.common.playObjFlyAnim(2000, Prop.coin);
  21168. this.closeSelf();
  21169. }
  21170. shareGetDiamond() {
  21171. let times = DataMgr.getShareDiamondTimes();
  21172. if (times >= xGame.common.maxShareDiamondTimes) {
  21173. console.log('zh: 233333333333 maxShareDiamondTimes');
  21174. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  21175. }
  21176. else {
  21177. console.log('zh:33333333333333ad');
  21178. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  21179. if (Laya.Browser.onAndroid) {
  21180. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21181. if (!boo) {
  21182. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21183. return;
  21184. }
  21185. }
  21186. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  21187. }
  21188. else {
  21189. console.log('zh:AD 失败,直接发放奖励');
  21190. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  21191. }
  21192. }
  21193. }
  21194. qjff_AD_for_uiAddProp_shareGetDiamond() {
  21195. let diamond = xGame.common.randomNum(50, 100);
  21196. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  21197. DataMgr.setShareDiamondTimes(1);
  21198. this.updateDiamondShare();
  21199. }
  21200. openPutBallView() {
  21201. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  21202. let skill = xGame.uiMgr.getUI(UISkill$1);
  21203. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  21204. let uigame = xGame.uiMgr.getUI(UIGame$1);
  21205. if (end && !end.isHide) {
  21206. xGame.uiMgr.Hide(UIGameEnd$1);
  21207. xGame.uiMgr.Show(UIMain$1);
  21208. }
  21209. if (skill && !skill.isHide)
  21210. xGame.uiMgr.Hide(UISkill$1);
  21211. if (uigame && !uigame.isHide)
  21212. xGame.uiMgr.Hide(UIGame$1);
  21213. if (level && !level.isHide) {
  21214. }
  21215. else {
  21216. xGame.uiMgr.Show(UILevelDisplay$1);
  21217. }
  21218. this.closeSelf();
  21219. }
  21220. }
  21221. UIAddProp$1.uiName = "UIAddProp";
  21222. class MoneyNode$1 {
  21223. constructor(ui) {
  21224. this.leftTime = 0;
  21225. this.ui = ui;
  21226. this.ui.addCoinBtn.onClick(this, this.addCoin);
  21227. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  21228. this.ui.addPowerBtn.onClick(this, this.addPower);
  21229. this.ui.c1.selectedIndex = 1;
  21230. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  21231. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  21232. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  21233. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  21234. this.coinChange();
  21235. this.diamondChange();
  21236. this.powerChange();
  21237. }
  21238. addPower() {
  21239. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21240. xGame.uiMgr.Show(UIPower$1);
  21241. }
  21242. powerChange() {
  21243. let powerNum = DataMgr.getPower();
  21244. this.ui.powerTxt.text = powerNum + "";
  21245. }
  21246. checkPowerTime() {
  21247. let cur = new Date().getTime();
  21248. let last = DataMgr.getPowerTime();
  21249. if (last == 0) {
  21250. last = cur;
  21251. DataMgr.setPowerTime(cur);
  21252. }
  21253. let power = DataMgr.getPower();
  21254. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  21255. Laya.timer.clearAll(this);
  21256. if (power >= xGame.common.natureMaxPower) {
  21257. this.ui.powerTimeTxt.text = "";
  21258. DataMgr.setPowerTime(cur);
  21259. return;
  21260. }
  21261. if (power + offset >= xGame.common.natureMaxPower) {
  21262. DataMgr.setPower(xGame.common.natureMaxPower, false);
  21263. this.ui.powerTimeTxt.text = "";
  21264. DataMgr.setPowerTime(cur);
  21265. }
  21266. else {
  21267. if (offset > 0) {
  21268. DataMgr.setPower(offset);
  21269. DataMgr.setPowerTime(cur);
  21270. }
  21271. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  21272. this.leftTime = xGame.common.powerRecoverNum - time;
  21273. if (this.leftTime <= 0)
  21274. this.leftTime = 0;
  21275. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  21276. Laya.timer.loop(1000, this, this.updatePowerTime);
  21277. }
  21278. }
  21279. updatePowerTime() {
  21280. this.leftTime -= 1;
  21281. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  21282. if (this.leftTime <= 0) {
  21283. this.checkPowerTime();
  21284. }
  21285. }
  21286. coinChange() {
  21287. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  21288. }
  21289. diamondChange() {
  21290. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  21291. }
  21292. addCoin() {
  21293. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21294. Moyu.sendDataEvent("AddCoinBtn");
  21295. xGame.uiMgr.Show(UIAddProp$1, 0);
  21296. }
  21297. addDiamond() {
  21298. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21299. Moyu.sendDataEvent("AddDiamondBtn");
  21300. xGame.uiMgr.Show(UIAddProp$1, 1);
  21301. }
  21302. }
  21303. class SettingNode$1 {
  21304. constructor(ui) {
  21305. this.showSetting = false;
  21306. this.openSound = true;
  21307. this.openShake = true;
  21308. this.ui = ui;
  21309. this.ui.soundBtn.onClick(this, this.switchSound);
  21310. this.ui.shakeBtn.onClick(this, this.switchShake);
  21311. this.ui.xyBtn.onClick(this, this.onXy);
  21312. this.ui.clickNode.onClick(this, this.changeSetting);
  21313. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  21314. this.ui.xyBtn.visible = false;
  21315. this.ui.shakeBtn.visible = false;
  21316. }
  21317. changeSetting() {
  21318. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21319. this.showSetting = !this.showSetting;
  21320. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  21321. }
  21322. switchSound() {
  21323. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21324. this.openSound = !this.openSound;
  21325. Moyu.onSetting(this.openSound, this.openShake);
  21326. xGame.soundMgr.onSetting(this.openSound);
  21327. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  21328. }
  21329. switchShake() {
  21330. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21331. this.openShake = !this.openShake;
  21332. Moyu.onSetting(this.openSound, this.openShake);
  21333. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  21334. }
  21335. onXy() {
  21336. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21337. MoyuMgr$1.showXy(1);
  21338. }
  21339. }
  21340. class UIDraw$1 extends UIBase {
  21341. constructor() {
  21342. super();
  21343. this.curKey = 0;
  21344. }
  21345. onConstructor() {
  21346. this.ui = ui_UIDraw.createInstance();
  21347. this.contentPane = this.ui;
  21348. this.isEject = false;
  21349. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21350. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  21351. this.addUIClick(this.ui.drawBtn, this.startDraw);
  21352. this.initDraw();
  21353. this.initUI();
  21354. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  21355. if (Moyu.isKs)
  21356. this.ui.closeNode.closeBtn.x += 100;
  21357. }
  21358. show() {
  21359. super.show();
  21360. this.ui.t0.play();
  21361. this.playSecretaryIdle();
  21362. this.updateDraw();
  21363. this.checkFree();
  21364. if (PlatMgr.bannerDelay > 0) {
  21365. this.ui.closeNode.closeBtn.visible = false;
  21366. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  21367. this.ui.closeNode.closeBtn.visible = true;
  21368. });
  21369. }
  21370. PlatMgr.showRateBanner();
  21371. }
  21372. hide() {
  21373. Laya.timer.clearAll(this);
  21374. super.hide();
  21375. }
  21376. checkFree() {
  21377. let isFree = DataMgr.getDailyfreeDrawTimes();
  21378. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  21379. }
  21380. initDraw() {
  21381. this.drawObj = [];
  21382. let data = cfgTable.drawData;
  21383. let temp;
  21384. let weight = 0;
  21385. for (const key in data) {
  21386. temp = data[key];
  21387. weight += temp.weight;
  21388. this.drawObj.push(weight);
  21389. }
  21390. this.allWeight = weight;
  21391. }
  21392. initUI() {
  21393. let data = cfgTable.drawData;
  21394. let temp;
  21395. let img;
  21396. let txt;
  21397. for (const key in data) {
  21398. temp = data[key];
  21399. img = this.ui.myNode.rotNode["img" + key];
  21400. txt = this.ui.myNode.rotNode["txt" + key];
  21401. img.url = xGame.common.getGameIconUrl(temp.icon);
  21402. txt.visible = true;
  21403. if (temp.award > 2) {
  21404. img.rotation = 0;
  21405. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  21406. }
  21407. else {
  21408. img.rotation = temp.rotation;
  21409. txt.text = temp.num;
  21410. }
  21411. }
  21412. }
  21413. getCurkey() {
  21414. let rand = Math.random() * this.allWeight;
  21415. let temp;
  21416. for (let index = 0; index < this.drawObj.length - 1; index++) {
  21417. temp = this.drawObj[index];
  21418. if (index == 0) {
  21419. if (rand < temp) {
  21420. return index + 1;
  21421. }
  21422. }
  21423. else {
  21424. if (rand >= temp && rand < this.drawObj[index + 1]) {
  21425. return index + 1;
  21426. }
  21427. }
  21428. }
  21429. return 2;
  21430. }
  21431. startDraw() {
  21432. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  21433. if (freeTimes > 0) {
  21434. this.beginDraw();
  21435. DataMgr.setDailyfreeDrawTimes(0);
  21436. this.checkFree();
  21437. }
  21438. else {
  21439. if (Laya.Browser.onAndroid) {
  21440. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21441. if (!boo) {
  21442. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21443. return;
  21444. }
  21445. }
  21446. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  21447. }
  21448. else {
  21449. console.log('zh:AD 失败,直接发放奖励');
  21450. this.qjff_chouJiang();
  21451. }
  21452. }
  21453. }
  21454. qjff_chouJiang() {
  21455. this.beginDraw();
  21456. }
  21457. beginDraw() {
  21458. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  21459. this.ui.drawBtn.touchable = false;
  21460. this.curKey = this.getCurkey();
  21461. console.log("当前key", this.curKey);
  21462. let cell = 60;
  21463. let lap = 3;
  21464. let angle = cell * (this.curKey - 1) + lap * 360;
  21465. let target = this.ui.myNode.rotNode;
  21466. target.rotation = 0;
  21467. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  21468. console.log("旋转完成");
  21469. this.ui.drawBtn.touchable = true;
  21470. this.getAward();
  21471. }));
  21472. }
  21473. getAward() {
  21474. let data = cfgTable.drawData[this.curKey];
  21475. let temp = new AwardType();
  21476. temp.type = data.award;
  21477. temp.num = data.num;
  21478. xGame.common.getAward([temp], () => {
  21479. DataMgr.setDrawTimes(1);
  21480. this.updateDraw();
  21481. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  21482. });
  21483. }
  21484. updateDraw() {
  21485. let drawTimes = DataMgr.getDrawTimes();
  21486. let awardTimes = DataMgr.getDrawAwardTimes();
  21487. if (Math.floor(drawTimes / 3) > awardTimes) {
  21488. this.ui.extraNode.boxBtn.t0.play(null, -1);
  21489. this.ui.extraNode.boxBtn.touchable = true;
  21490. this.ui.extraNode.tipsTxt.text = "3/3";
  21491. this.ui.extraNode.barNode.width = 265;
  21492. this.getExtraAward();
  21493. }
  21494. else {
  21495. this.ui.extraNode.boxBtn.t0.stop();
  21496. this.ui.extraNode.boxBtn.touchable = false;
  21497. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  21498. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  21499. }
  21500. let data = cfgTable.drawData[1];
  21501. if (awardTimes == 0) {
  21502. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  21503. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  21504. this.ui.myNode.rotNode.img1.rotation = 0;
  21505. }
  21506. else {
  21507. let award = data.nextid;
  21508. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  21509. this.ui.myNode.rotNode.txt1.text = award[1];
  21510. this.ui.myNode.rotNode.img1.rotation = 0;
  21511. }
  21512. }
  21513. getExtraAward() {
  21514. let drawTimes = DataMgr.getDrawTimes();
  21515. let awardTimes = DataMgr.getDrawAwardTimes();
  21516. let data = cfgTable.drawData[1];
  21517. let award = new AwardType();
  21518. if (awardTimes == 0) {
  21519. award.num = data.num;
  21520. award.type = data.award;
  21521. xGame.common.getAward([award], () => {
  21522. let all = Math.floor(drawTimes / 3);
  21523. DataMgr.setDrawAwardTimes(all);
  21524. this.updateDraw();
  21525. });
  21526. }
  21527. else {
  21528. award.num = parseInt(data.nextid[1]);
  21529. award.type = parseInt(data.nextid[0]);
  21530. xGame.common.getAward([award], () => {
  21531. let all = Math.floor(drawTimes / 3);
  21532. DataMgr.setDrawAwardTimes(all);
  21533. this.updateDraw();
  21534. });
  21535. }
  21536. }
  21537. closeSelf() {
  21538. this.hide();
  21539. }
  21540. playSecretaryIdle() {
  21541. let parent = this.ui.secretary.displayObject;
  21542. parent.destroyChildren();
  21543. let xx = this.ui.secretary.width / 2;
  21544. let yy = this.ui.secretary.height;
  21545. let scale = xGame.common.getSecretaryScale();
  21546. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21547. xGame.common.secretary.play(data, 0, true, parent);
  21548. }
  21549. }
  21550. UIDraw$1.uiName = "UIDraw";
  21551. class UIRanking$1 extends UIBase {
  21552. constructor() {
  21553. super();
  21554. this.showSelf = true;
  21555. this.rankType = 1;
  21556. this.rankList = [];
  21557. this.topX = 10;
  21558. this.myIndex = this.topX + 1;
  21559. this.myStar = 0;
  21560. }
  21561. onConstructor() {
  21562. this.ui = ui_UIRanking.createInstance();
  21563. this.contentPane = this.ui;
  21564. this.isEject = false;
  21565. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  21566. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  21567. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  21568. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  21569. this.ui.myNode.myList.setVirtual();
  21570. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  21571. }
  21572. show() {
  21573. super.show();
  21574. this.getPaiHangBangDataFormJosnFile();
  21575. this.updateSelf();
  21576. let self = Moyu.getUserInfo();
  21577. if (!self.isAuth) {
  21578. Moyu.initUser(this, () => {
  21579. DataMgr.upRankData();
  21580. });
  21581. }
  21582. }
  21583. getPaiHangBangDataFormJosnFile() {
  21584. const rankingList = cfgTable.paiHangBangData.list;
  21585. this.updateItemData(rankingList);
  21586. }
  21587. updateSelfItem() {
  21588. console.log('zh:Moyu.platType =' + Moyu.platType);
  21589. let self = Moyu.getUserInfo();
  21590. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  21591. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  21592. if (this.myIndex > this.topX) {
  21593. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  21594. }
  21595. else {
  21596. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  21597. }
  21598. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  21599. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  21600. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  21601. }
  21602. updateItemData(data) {
  21603. this.myStar = xGame.common.getAllStarNum();
  21604. if (this.rankList.length < 2) {
  21605. this.rankList = data;
  21606. let self = Moyu.getUserInfo();
  21607. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  21608. self.headIcon = self.headIcon;
  21609. for (let i = 0; i < data.length; i++) {
  21610. let data = this.rankList[i];
  21611. if (data.userId == self.userId) {
  21612. this.rankList.splice(i, 1);
  21613. break;
  21614. }
  21615. }
  21616. for (let i = 0; i < data.length; i++) {
  21617. let data = this.rankList[i];
  21618. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  21619. this.myIndex = i + 1;
  21620. let user = { headIcon: self.headIcon, nickName: "myself" };
  21621. let ud = { user: user, data: {} };
  21622. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  21623. console.log('zh:Moyu.platType = ' + Moyu.platType);
  21624. if (Moyu.platType < 11) {
  21625. user.headIcon = self.headIcon;
  21626. user.nickName = self.nickName;
  21627. }
  21628. this.rankList.splice(i, 0, md);
  21629. break;
  21630. }
  21631. }
  21632. }
  21633. this.updateSelfItem();
  21634. this.ui.myNode.myList.numItems = this.rankList.length;
  21635. }
  21636. updateItemUI(index, obj) {
  21637. let data = this.rankList[index];
  21638. let userData = JSON.parse(data.userData).user;
  21639. obj.nameTxt.text = userData.nickName.toString();
  21640. obj.valueTxt.text = data.rankScore;
  21641. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  21642. obj.rankTxt.text = index + 1;
  21643. switch (index) {
  21644. case 0:
  21645. this.setImg(obj, 1, 0, 0);
  21646. obj.rankTxt.color = "#FFC047";
  21647. break;
  21648. case 1:
  21649. this.setImg(obj, 0, 1, 0);
  21650. obj.rankTxt.color = "#ACACAC";
  21651. break;
  21652. case 2:
  21653. this.setImg(obj, 0, 0, 1);
  21654. obj.rankTxt.color = "#D09672";
  21655. break;
  21656. default:
  21657. this.setImg(obj, 0, 0, 0);
  21658. obj.rankTxt.color = "#496FAB";
  21659. break;
  21660. }
  21661. }
  21662. setImg(obj, a, b, c) {
  21663. obj.img1.visible = a ? true : false;
  21664. obj.img2.visible = b ? true : false;
  21665. obj.img3.visible = c ? true : false;
  21666. }
  21667. changeList(type) {
  21668. this.rankType = type;
  21669. this.updateSelf();
  21670. }
  21671. changeSelfNode() {
  21672. this.showSelf = !this.showSelf;
  21673. this.updateSelf();
  21674. }
  21675. updateSelf() {
  21676. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  21677. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  21678. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  21679. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  21680. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  21681. }
  21682. }
  21683. UIRanking$1.uiName = "UIRanking";
  21684. class UISecretary$1 extends UIBase {
  21685. constructor() {
  21686. super();
  21687. this.curIndex = 1;
  21688. }
  21689. onConstructor() {
  21690. this.ui = ui_UISecretary.createInstance();
  21691. this.contentPane = this.ui;
  21692. this.isEject = false;
  21693. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  21694. this.nodeObj = { left: null, right: null, cur: null };
  21695. this.nodeObj.cur = this.ui.myNode.gameNode3;
  21696. }
  21697. show() {
  21698. super.show();
  21699. this.ui.t0.play();
  21700. this.updateData();
  21701. }
  21702. addSecretarySpine(node, spineName) {
  21703. if (spineName == "mishu") {
  21704. if (this.secretarySpine1) {
  21705. node.displayObject.destroyChildren();
  21706. this.playWoman(this.secretarySpine1, node.displayObject);
  21707. }
  21708. else {
  21709. let spine1 = new SpineMgr("mishu", () => {
  21710. this.secretarySpine1 = spine1;
  21711. this.playWoman(this.secretarySpine1, node.displayObject);
  21712. });
  21713. }
  21714. }
  21715. else {
  21716. if (this.secretarySpine2) {
  21717. node.displayObject.destroyChildren();
  21718. this.playWoman(this.secretarySpine2, node.displayObject);
  21719. }
  21720. else {
  21721. let spine2 = new SpineMgr("xiaomishu2", () => {
  21722. this.secretarySpine2 = spine2;
  21723. this.playWoman(this.secretarySpine2, node.displayObject);
  21724. });
  21725. }
  21726. }
  21727. }
  21728. playWoman(node, parent) {
  21729. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  21730. let yy = this.ui.myNode.gameNode3.secretary.height;
  21731. let scale = 1.5;
  21732. if (node == this.secretarySpine2) {
  21733. scale = 1.2;
  21734. }
  21735. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21736. node.play(data, 0, true, parent);
  21737. }
  21738. turnLeft() {
  21739. this.curIndex--;
  21740. if (this.curIndex < 1) {
  21741. this.curIndex = 2;
  21742. }
  21743. let left = this.nodeObj.left;
  21744. let right = this.nodeObj.right;
  21745. let cur = this.nodeObj.cur;
  21746. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  21747. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  21748. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  21749. this.updateData();
  21750. }));
  21751. this.ui.myNode.setChildIndex(right, 2);
  21752. this.nodeObj.left = cur;
  21753. this.nodeObj.right = left;
  21754. this.nodeObj.cur = right;
  21755. }
  21756. turnRight() {
  21757. this.curIndex++;
  21758. if (this.curIndex > 2) {
  21759. this.curIndex = 1;
  21760. }
  21761. let left = this.nodeObj.left;
  21762. let right = this.nodeObj.right;
  21763. let cur = this.nodeObj.cur;
  21764. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  21765. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  21766. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  21767. this.updateData();
  21768. }));
  21769. this.ui.myNode.setChildIndex(left, 2);
  21770. this.nodeObj.left = right;
  21771. this.nodeObj.right = cur;
  21772. this.nodeObj.cur = left;
  21773. }
  21774. updateData() {
  21775. console.log('zh: updateData FFFFFFFFFF');
  21776. let data = cfgTable.secretaryshopData;
  21777. let children = this.ui.myNode._children;
  21778. let temp;
  21779. let curData;
  21780. for (let index = 0; index < children.length; index++) {
  21781. temp = children[index];
  21782. curData = data[1];
  21783. temp.heightTxt.text = curData.height;
  21784. temp.foodTxt.text = curData.food;
  21785. temp.historyTxt.text = curData.history;
  21786. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  21787. this.addSecretarySpine(temp.secretary, curData.spine);
  21788. let womanIndex = curData.id - 1;
  21789. let getWoman = DataMgr.getSecretary(womanIndex);
  21790. let curUse = DataMgr.getCurSecretary();
  21791. if (getWoman) {
  21792. if (curUse == womanIndex) {
  21793. temp.purchaseBtn.c1.selectedIndex = 1;
  21794. }
  21795. else {
  21796. temp.purchaseBtn.c1.selectedIndex = 2;
  21797. }
  21798. }
  21799. else {
  21800. temp.purchaseBtn.c1.selectedIndex = 0;
  21801. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  21802. }
  21803. temp.purchaseBtn.visible = false;
  21804. }
  21805. }
  21806. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  21807. console.log('zh: 点击了clickSecretary ');
  21808. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21809. if (getWoman) {
  21810. if (curUse != womanIndex) {
  21811. console.log();
  21812. DataMgr.setCurSecretary(womanIndex);
  21813. this.updateData();
  21814. }
  21815. }
  21816. else {
  21817. console.log('zh:点击购买了');
  21818. let need = needDiamond;
  21819. if (DataMgr.diamondEnough(need)) {
  21820. DataMgr.setDiamond(-need);
  21821. DataMgr.setSecretary(womanIndex, 1);
  21822. DataMgr.setCurSecretary(womanIndex);
  21823. this.updateData();
  21824. }
  21825. else {
  21826. xGame.uiMgr.Show(UIAddProp$1, 1);
  21827. }
  21828. }
  21829. }
  21830. closeSelf() {
  21831. this.hide();
  21832. }
  21833. }
  21834. UISecretary$1.uiName = "UISecretary";
  21835. class BallRodDisplay$1 {
  21836. constructor(ui, index) {
  21837. this.index = 0;
  21838. this.uiIndex = 0;
  21839. this.ui = ui;
  21840. this.index = index;
  21841. this.initData();
  21842. }
  21843. initData() {
  21844. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  21845. let data = cfgTable.ballrodData[this.index + 1];
  21846. this.ui.nameTxt.text = data.name;
  21847. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  21848. this.ui.levelNode.c1.selectedIndex = data.quality;
  21849. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  21850. if (data.spine) {
  21851. this.mySpine = new SpineMgr(data.spine, () => {
  21852. let xx = 150;
  21853. let yy = 70;
  21854. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  21855. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  21856. });
  21857. }
  21858. }
  21859. updateSelf() {
  21860. console.log('zh:updateSelf -------------- ');
  21861. let get = DataMgr.getBallRod(this.index);
  21862. if (get == null)
  21863. get = 1;
  21864. let curUse = DataMgr.getCurBallRod();
  21865. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  21866. if (get) {
  21867. if (curUse == this.index) {
  21868. this.ui.purchaseBtn.c1.selectedIndex = 0;
  21869. }
  21870. else {
  21871. this.ui.purchaseBtn.c1.selectedIndex = 1;
  21872. }
  21873. }
  21874. else {
  21875. this.ui.purchaseBtn.c1.selectedIndex = 2;
  21876. }
  21877. }
  21878. buyBallRod() {
  21879. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21880. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  21881. switch (selectedIndex) {
  21882. case 0:
  21883. break;
  21884. case 1:
  21885. console.log('zh:点击了 USE THIS');
  21886. DataMgr.setCurBallRod(this.index);
  21887. let curUse = DataMgr.getCurBallRod();
  21888. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  21889. let ui = xGame.uiMgr.getUI(UIShop$1);
  21890. ui.updateBallRod();
  21891. break;
  21892. case 2:
  21893. let data = cfgTable.ballrodData[this.index + 1];
  21894. let need = data.price;
  21895. if (DataMgr.diamondEnough(need)) {
  21896. DataMgr.setDiamond(-need);
  21897. DataMgr.setBallRod(this.index, 1);
  21898. DataMgr.setCurBallRod(this.index);
  21899. let ui = xGame.uiMgr.getUI(UIShop$1);
  21900. ui.updateBallRod();
  21901. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  21902. }
  21903. else {
  21904. xGame.uiMgr.Show(UIAddProp$1, 1);
  21905. }
  21906. break;
  21907. default:
  21908. break;
  21909. }
  21910. }
  21911. logEventForGouMaiGan(qiuGanName) {
  21912. const ev = {
  21913. value: qiuGanName
  21914. };
  21915. const jsonStr = JSON.stringify(ev);
  21916. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  21917. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  21918. }
  21919. }
  21920. class DaoJuDisplay$1 {
  21921. constructor(ui, index) {
  21922. this.index = 0;
  21923. this.uiIndex = 0;
  21924. this.ui = ui;
  21925. this.index = index;
  21926. this.initData();
  21927. }
  21928. initData() {
  21929. this.ui.btn_buy.onClick(this, this.buyDj);
  21930. let data = cfgTable.daoJuData[this.index + 1];
  21931. console.log('zh:' + JSON.stringify(data));
  21932. this.ui.nameTxt.text = data.name;
  21933. this.ui.n_jiaGe.text = data.price + "";
  21934. this.ui.n_zuanShi.text = data.price + "";
  21935. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  21936. }
  21937. buyDj() {
  21938. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21939. }
  21940. buyBallRod() {
  21941. }
  21942. logEventForGouMaiGan(qiuGanName) {
  21943. const ev = {
  21944. value: qiuGanName
  21945. };
  21946. const jsonStr = JSON.stringify(ev);
  21947. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  21948. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  21949. }
  21950. }
  21951. class UIShop$1 extends UIBase {
  21952. constructor() {
  21953. super();
  21954. this.itemNums = 0;
  21955. this.itemNumsForDj = 0;
  21956. this.curType = "";
  21957. }
  21958. onConstructor() {
  21959. this.ui = ui_UIShop.createInstance();
  21960. this.contentPane = this.ui;
  21961. this.isEject = false;
  21962. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21963. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  21964. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  21965. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  21966. this.addUIClick(this.ui, this.interuptSecretary);
  21967. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  21968. this.ballRodArr = [];
  21969. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  21970. this.ui.myNode.myList.numItems = this.itemNums;
  21971. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  21972. this.daoJuArr = [];
  21973. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  21974. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  21975. }
  21976. show(type) {
  21977. super.show();
  21978. console.log('zh:show type = ' + type);
  21979. this.curType = type == 0 ? "qiugan" : "daoju";
  21980. this.switchBtn("qiugan");
  21981. this.playSecretaryIdle();
  21982. this.updateBallRod();
  21983. }
  21984. test123() {
  21985. console.log('zh:test123 ');
  21986. }
  21987. switchBtn(type) {
  21988. console.log('zh:1111切換 sel type=' + type);
  21989. if (type == "") {
  21990. type = this.curType;
  21991. }
  21992. else {
  21993. if (this.curType == type) {
  21994. return;
  21995. }
  21996. else {
  21997. this.curType = type;
  21998. }
  21999. }
  22000. if (type == "qiugan") {
  22001. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  22002. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  22003. this.ui.myNode.myList.visible = true;
  22004. this.ui.myNode.djList.visible = false;
  22005. }
  22006. else {
  22007. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  22008. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  22009. this.ui.myNode.myList.visible = false;
  22010. this.ui.myNode.djList.visible = true;
  22011. }
  22012. }
  22013. updateBallRod() {
  22014. for (let index = 0; index < this.ballRodArr.length; index++) {
  22015. this.ballRodArr[index].updateSelf();
  22016. }
  22017. }
  22018. renderBallRod(sort, obj) {
  22019. let index = this.getIndexBySort(sort + 1) - 1;
  22020. let ballRod = new BallRodDisplay$1(obj, index);
  22021. this.ballRodArr.push(ballRod);
  22022. }
  22023. renderDaoJu(sort, obj) {
  22024. let index = this.getIndexBySortForDj(sort + 1) - 1;
  22025. let b = new DaoJuDisplay$1(obj, index);
  22026. this.daoJuArr.push(b);
  22027. }
  22028. getIndexBySort(sort) {
  22029. let object = cfgTable.ballrodData;
  22030. for (const key in object) {
  22031. if (object[key].sort == sort) {
  22032. return parseInt(key);
  22033. }
  22034. }
  22035. }
  22036. getIndexBySortForDj(sort) {
  22037. let object = cfgTable.daoJuData;
  22038. for (const key in object) {
  22039. if (object[key].sort == sort) {
  22040. return parseInt(key);
  22041. }
  22042. }
  22043. }
  22044. playSecretaryIdle() {
  22045. let parent = this.ui.secretary.displayObject;
  22046. parent.destroyChildren();
  22047. let xx = this.ui.secretary.width / 2;
  22048. let yy = this.ui.secretary.height;
  22049. let scale = xGame.common.getSecretaryScale();
  22050. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22051. xGame.common.secretary.play(data, 0, true, parent);
  22052. }
  22053. interuptSecretary() {
  22054. Laya.timer.clearAll(this);
  22055. this.playSecretaryRandomSound();
  22056. }
  22057. playSecretaryRandomSound() {
  22058. if (this.isHide)
  22059. return;
  22060. let time = xGame.common.randomNum(45000, 60000);
  22061. Laya.timer.once(time, this, () => {
  22062. if (this.isHide)
  22063. return;
  22064. let index = xGame.common.randomNum(4, 7);
  22065. xGame.soundMgr.playSound("s_main0" + index);
  22066. let words = 1;
  22067. switch (index) {
  22068. case 4:
  22069. words = 5;
  22070. break;
  22071. case 5:
  22072. words = 3;
  22073. break;
  22074. case 6:
  22075. words = 6;
  22076. break;
  22077. case 7:
  22078. words = 7;
  22079. break;
  22080. default:
  22081. break;
  22082. }
  22083. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22084. this.playSecretaryRandomSound();
  22085. });
  22086. }
  22087. closeSelf() {
  22088. this.hide();
  22089. }
  22090. }
  22091. UIShop$1.uiName = "UIShop";
  22092. class SignMax$1 {
  22093. constructor(ui) {
  22094. this.ui = ui;
  22095. }
  22096. updateSelf(index, sameDay, curDayIndex) {
  22097. let data = cfgTable.signData[index + 1];
  22098. this.ui.titleTxt.text = data.title;
  22099. let arr1 = data.award[0].split('-');
  22100. let arr2 = data.award[1].split('-');
  22101. let num1 = parseInt(arr1[1]);
  22102. let num2 = parseInt(arr2[1]);
  22103. this.ui.numTxt1.text = num1 + "";
  22104. this.ui.numTxt2.text = num2 + "";
  22105. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  22106. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  22107. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  22108. this.ui.numTxt1.visible = false;
  22109. }
  22110. else {
  22111. this.ui.numTxt1.visible = true;
  22112. }
  22113. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  22114. this.ui.numTxt2.visible = false;
  22115. }
  22116. else {
  22117. this.ui.numTxt2.visible = true;
  22118. }
  22119. if (index < curDayIndex) {
  22120. this.ui.c1.selectedIndex = 1;
  22121. }
  22122. else if (index == curDayIndex) {
  22123. if (sameDay) {
  22124. this.ui.c1.selectedIndex = 2;
  22125. }
  22126. else {
  22127. this.ui.c1.selectedIndex = 2;
  22128. }
  22129. }
  22130. else {
  22131. this.ui.c1.selectedIndex = 0;
  22132. }
  22133. }
  22134. }
  22135. class SignNormal$1 {
  22136. constructor(ui) {
  22137. this.ui = ui;
  22138. }
  22139. updateSelf(index, sameDay, curDayIndex) {
  22140. let data = cfgTable.signData[index + 1];
  22141. this.ui.titleTxt.text = data.title;
  22142. let arr = data.award[0].split('-');
  22143. let type = parseInt(arr[0]);
  22144. let num = parseInt(arr[1]);
  22145. this.ui.numTxt.text = num + "";
  22146. if (type > 2) {
  22147. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  22148. this.ui.myIcon.rotation = 0;
  22149. }
  22150. else {
  22151. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  22152. this.ui.myIcon.rotation = 0;
  22153. }
  22154. if (xGame.common.signAwardContainsRod(data.award)) {
  22155. this.ui.numTxt.visible = false;
  22156. }
  22157. else {
  22158. this.ui.numTxt.visible = true;
  22159. }
  22160. if (index < curDayIndex) {
  22161. this.ui.c1.selectedIndex = 1;
  22162. }
  22163. else if (index == curDayIndex) {
  22164. if (sameDay) {
  22165. this.ui.c1.selectedIndex = 2;
  22166. }
  22167. else {
  22168. this.ui.c1.selectedIndex = 2;
  22169. }
  22170. }
  22171. else {
  22172. this.ui.c1.selectedIndex = 0;
  22173. }
  22174. }
  22175. }
  22176. class UISign$1 extends UIBase {
  22177. constructor() {
  22178. super();
  22179. this.curDayIndex = 0;
  22180. this.starX = 0;
  22181. }
  22182. onConstructor() {
  22183. this.ui = ui_UISign.createInstance();
  22184. this.contentPane = this.ui;
  22185. this.isEject = false;
  22186. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22187. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  22188. this.initSignItem();
  22189. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  22190. this.addUIClick(this.ui.againBtn, this.againGetAward);
  22191. }
  22192. show() {
  22193. super.show();
  22194. this.ui.t0.play();
  22195. this.playSecretaryIdle();
  22196. this.updateSign();
  22197. }
  22198. initSignItem() {
  22199. this.signArr = [];
  22200. for (let index = 0; index < 6; index++) {
  22201. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  22202. this.signArr.push(temp);
  22203. }
  22204. this.signMax = new SignMax$1(this.ui.myNode.day7);
  22205. if (Moyu.isKs)
  22206. this.ui.closeNode.closeBtn.x += 100;
  22207. }
  22208. updateSign() {
  22209. let sameDay = xGame.common.judgeSameDay();
  22210. let max = 7;
  22211. this.curDayIndex = DataMgr.getSignData();
  22212. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  22213. this.curDayIndex = 0;
  22214. if (!sameDay) {
  22215. this.ui.normalBtn.visible = true;
  22216. this.ui.tipsNode.visible = false;
  22217. this.ui.againBtn.visible = false;
  22218. }
  22219. else {
  22220. this.ui.normalBtn.visible = false;
  22221. let again = DataMgr.getExtraSign();
  22222. let isCurrency = false;
  22223. let index = this.curDayIndex;
  22224. if (index == 0)
  22225. index = 7;
  22226. let award = cfgTable.signData[index].award;
  22227. let num = award[0].split("-")[0];
  22228. if (num == "1" || num == "2")
  22229. isCurrency = true;
  22230. let showAgain = again == 0 && isCurrency;
  22231. this.ui.againBtn.visible = showAgain;
  22232. this.ui.tipsNode.visible = !showAgain;
  22233. }
  22234. for (let index = 0; index < this.signArr.length; index++) {
  22235. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  22236. }
  22237. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  22238. }
  22239. playSecretaryIdle() {
  22240. let parent = this.ui.secretary.displayObject;
  22241. parent.destroyChildren();
  22242. let xx = this.ui.secretary.width / 2;
  22243. let yy = this.ui.secretary.height;
  22244. let scale = xGame.common.getSecretaryScale();
  22245. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22246. xGame.common.secretary.play(data, 0, true, parent);
  22247. }
  22248. closeSelf() {
  22249. this.hide();
  22250. }
  22251. normalGetAward() {
  22252. let sameDay = xGame.common.judgeSameDay();
  22253. if (!sameDay) {
  22254. let award = cfgTable.signData[this.curDayIndex + 1].award;
  22255. let temp;
  22256. let type;
  22257. let num;
  22258. let arr = [];
  22259. for (let index = 0; index < award.length; index++) {
  22260. temp = award[index].split("-");
  22261. type = parseInt(temp[0]);
  22262. num = parseInt(temp[1]);
  22263. let awardType = new AwardType();
  22264. awardType.num = num;
  22265. awardType.type = type;
  22266. arr.push(awardType);
  22267. }
  22268. xGame.common.getAward(arr, (watchVideo) => {
  22269. this.curDayIndex++;
  22270. if (this.curDayIndex > 7)
  22271. this.curDayIndex = 0;
  22272. DataMgr.setSignData(this.curDayIndex);
  22273. DataMgr.setSignTime(new Date().getTime());
  22274. if (watchVideo) {
  22275. DataMgr.setExtraSign(1);
  22276. Moyu.sendDataEvent("signIn1");
  22277. }
  22278. this.updateSign();
  22279. });
  22280. }
  22281. }
  22282. againGetAward() {
  22283. Moyu.sendDataEvent("signIn2");
  22284. console.log('zh:qjff_AD_for_uisign');
  22285. if (Laya.Browser.onAndroid) {
  22286. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22287. if (!boo) {
  22288. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22289. return;
  22290. }
  22291. }
  22292. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  22293. }
  22294. else {
  22295. console.log('zh:AD 失败,直接发放奖励');
  22296. this.qjff_AD_for_uisign();
  22297. }
  22298. }
  22299. qjff_AD_for_uisign() {
  22300. let index = this.curDayIndex;
  22301. if (index == 0)
  22302. index = 7;
  22303. let award = cfgTable.signData[index].award;
  22304. let temp;
  22305. let type;
  22306. let num;
  22307. for (let index = 0; index < award.length; index++) {
  22308. temp = award[index].split("-");
  22309. type = parseInt(temp[0]);
  22310. num = parseInt(temp[1]) * 3;
  22311. xGame.common.playObjFlyAnim(num, type);
  22312. }
  22313. DataMgr.setExtraSign(1);
  22314. this.updateSign();
  22315. }
  22316. }
  22317. UISign$1.uiName = "UISign";
  22318. class UIModeSelection$1 extends UIBase {
  22319. constructor() {
  22320. super();
  22321. }
  22322. onConstructor() {
  22323. this.ui = ui_UIModeSelection.createInstance();
  22324. this.contentPane = this.ui;
  22325. this.isEject = false;
  22326. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  22327. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  22328. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  22329. this.addUIClick(this.ui.closeBtn, this.hide);
  22330. this.peopleArr = [65, 990, 580];
  22331. this.peopleOffest = [5, 10, 10];
  22332. }
  22333. show(callback) {
  22334. this.updateSelf();
  22335. super.show();
  22336. this.ui.t0.play();
  22337. this.callback = callback;
  22338. }
  22339. updateSelf() {
  22340. let cfg = cfgTable.modeselectData;
  22341. for (let index = 1; index <= 3; index++) {
  22342. let node = this.ui.myNode["type" + index];
  22343. node.need.text = cfg[index].need;
  22344. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  22345. node.peopleTxt.text = this.getRandPeople(index - 1);
  22346. }
  22347. }
  22348. enterGame(type) {
  22349. console.log('zh: 进入经典模式 type: ' + type);
  22350. xGame.common.classicRoomType = type;
  22351. let cfg = cfgTable.modeselectData[type];
  22352. let need = cfg.need;
  22353. xGame.common.passAwardCoin = cfg.award;
  22354. if (DataMgr.coinEnough(need)) {
  22355. DataMgr.setCoin(-need);
  22356. this.ui.myNode["type" + type].t0.play();
  22357. Laya.timer.once(200, this, () => {
  22358. this.callback && this.callback();
  22359. });
  22360. this.logEventForClassic_start();
  22361. }
  22362. else {
  22363. Moyu.sendDataEvent("AddCoinVideo");
  22364. xGame.uiMgr.Show(UIAddProp$1, 0);
  22365. }
  22366. }
  22367. getRandPeople(index) {
  22368. let rand = this.peopleOffest[index];
  22369. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  22370. }
  22371. logEventForClassic_start() {
  22372. let rtype = xGame.common.classicRoomType;
  22373. let msmc = '';
  22374. if (rtype == 1) {
  22375. msmc = 'beginner';
  22376. }
  22377. if (rtype == 2) {
  22378. msmc = 'expert';
  22379. }
  22380. if (rtype == 3) {
  22381. msmc = 'master';
  22382. }
  22383. let keyStr = 'sjmd_classic_start_' + rtype;
  22384. let jsonStr = {
  22385. "difficulty": msmc,
  22386. "classic_count": 1,
  22387. "difficulty_count": 1
  22388. };
  22389. if (LocalStorageManager.hasJosnKey(keyStr)) {
  22390. const d = LocalStorageManager.getItem(keyStr);
  22391. jsonStr.classic_count = d.classic_count + 1;
  22392. jsonStr.difficulty_count = d.difficulty_count + 1;
  22393. LocalStorageManager.setItem(keyStr, jsonStr);
  22394. }
  22395. else {
  22396. LocalStorageManager.setItem(keyStr, jsonStr);
  22397. }
  22398. const reqStr = JSON.stringify(jsonStr);
  22399. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  22400. }
  22401. }
  22402. UIModeSelection$1.uiName = "UIModeSelection";
  22403. class UILogin$1 extends UIBase {
  22404. constructor() {
  22405. super();
  22406. }
  22407. onConstructor() {
  22408. this.ui = ui_UILogin.createInstance();
  22409. this.contentPane = this.ui;
  22410. this.isEject = false;
  22411. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22412. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  22413. this.addUIClick(this.ui.btn_login, this.userLogin);
  22414. }
  22415. show() {
  22416. super.show();
  22417. this.x = (Laya.stage.width - this.width) / 2;
  22418. this.y = (Laya.stage.height - this.height) / 2;
  22419. }
  22420. closeSelf() {
  22421. this.hide();
  22422. }
  22423. userLogin() {
  22424. let ua = this.ui.txt_ua.text;
  22425. let up = this.ui.txt_up.text;
  22426. if (ua && up) {
  22427. let reqData = JSON.stringify({
  22428. username: ua.trim(),
  22429. password: up.trim(),
  22430. fromMark: 'app_game'
  22431. });
  22432. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  22433. try {
  22434. console.log('zh:res = ' + JSON.stringify(res));
  22435. let code = res.code;
  22436. let msg = res.msg;
  22437. if (code == 200) {
  22438. let keyStr = 'userInfo';
  22439. let jsonStr = {
  22440. "username": res.username,
  22441. "token": res.token
  22442. };
  22443. LocalStorageManager.setItem(keyStr, jsonStr);
  22444. xGame.uiMgr.Show(UIMsg$1, msg);
  22445. this.closeSelf();
  22446. }
  22447. else {
  22448. xGame.uiMgr.Show(UIMsg$1, msg);
  22449. }
  22450. }
  22451. catch (error) {
  22452. console.log('error=' + error);
  22453. alert(error);
  22454. }
  22455. finally {
  22456. }
  22457. });
  22458. }
  22459. else {
  22460. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  22461. }
  22462. }
  22463. gotoRegPage() {
  22464. this.closeSelf();
  22465. xGame.uiMgr.Show(UIReg$1);
  22466. }
  22467. }
  22468. UILogin$1.uiName = "UILogin";
  22469. class UIReg$1 extends UIBase {
  22470. constructor() {
  22471. super();
  22472. }
  22473. onConstructor() {
  22474. this.ui = ui_UIReg.createInstance();
  22475. this.contentPane = this.ui;
  22476. this.isEject = false;
  22477. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22478. this.addUIClick(this.ui.btn_reg, this.regUser);
  22479. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  22480. }
  22481. show() {
  22482. super.show();
  22483. this.x = (Laya.stage.width - this.width) / 2;
  22484. this.y = (Laya.stage.height - this.height) / 2;
  22485. }
  22486. closeSelf() {
  22487. this.hide();
  22488. }
  22489. regUser() {
  22490. this.ui.lab_tip.visible = false;
  22491. let ua = this.ui.txt_ua.text;
  22492. let up1 = this.ui.txt_up1.text;
  22493. let up2 = this.ui.txt_up2.text;
  22494. if (ua && up1 && up2 && up1 == up2) {
  22495. let reqData = JSON.stringify({
  22496. username: ua.trim(),
  22497. password: up1.trim(),
  22498. fromMark: 'app_game'
  22499. });
  22500. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  22501. try {
  22502. console.log('zh:res = ' + JSON.stringify(res));
  22503. let code = res.code;
  22504. let msg = res.msg;
  22505. xGame.uiMgr.Show(UIMsg$1, msg);
  22506. if (code == 200) {
  22507. this.ui.lab_tip.color = "#FFFFFF";
  22508. xGame.uiMgr.Show(UIMsg$1, msg);
  22509. this.closeSelf();
  22510. }
  22511. else {
  22512. this.ui.lab_tip.color = "#FF0000";
  22513. xGame.uiMgr.Show(UIMsg$1, msg);
  22514. }
  22515. }
  22516. catch (error) {
  22517. console.log('error=' + error);
  22518. alert(error);
  22519. }
  22520. finally {
  22521. }
  22522. });
  22523. }
  22524. else {
  22525. if (up1 != up2) {
  22526. xGame.uiMgr.Show(UIMsg$1, "Password mismatch!");
  22527. }
  22528. else {
  22529. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  22530. }
  22531. }
  22532. }
  22533. gotoLogin() {
  22534. this.closeSelf();
  22535. xGame.uiMgr.Show(UILogin$1);
  22536. }
  22537. }
  22538. UIReg$1.uiName = "UIReg";
  22539. class UITry$1 extends UIBase {
  22540. constructor() {
  22541. super();
  22542. this.closeTime = 0;
  22543. this.closeNum = 0;
  22544. this.skillUrl = xGame.common.skillIconList;
  22545. }
  22546. onConstructor() {
  22547. this.ui = ui_UITry.createInstance();
  22548. this.contentPane = this.ui;
  22549. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  22550. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  22551. }
  22552. show() {
  22553. super.show();
  22554. this.closeNum = 0;
  22555. this.closeTime = 15;
  22556. this.ui.t0.play();
  22557. PlatMgr.showRateBanner();
  22558. this.ui.myNode.txtTime.text = this.closeTime.toString();
  22559. Laya.timer.loop(1000, this, this.updateTime);
  22560. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  22561. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  22562. xGame.common.gameMgr.gamePause = true;
  22563. }
  22564. updateTime() {
  22565. if (this.closeTime > 1) {
  22566. this.closeTime--;
  22567. this.ui.myNode.txtTime.text = this.closeTime.toString();
  22568. }
  22569. else
  22570. this.hide();
  22571. }
  22572. hide() {
  22573. Laya.timer.clearAll(this);
  22574. Moyu.showBannerAd(false);
  22575. super.hide();
  22576. xGame.common.gameMgr.gamePause = false;
  22577. }
  22578. onTry() {
  22579. console.log('zh:qjff_AD_for_uitry');
  22580. if (Laya.Browser.onAndroid) {
  22581. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22582. if (!boo) {
  22583. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22584. return;
  22585. }
  22586. }
  22587. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  22588. }
  22589. else {
  22590. console.log('zh:AD 失败,直接发放奖励');
  22591. this.qjff_AD_for_uitry();
  22592. }
  22593. }
  22594. qjff_AD_for_uitry() {
  22595. let select = xGame.common.curPlayerSkillType;
  22596. DataMgr.gameData.trySkill = select;
  22597. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  22598. DataMgr.saveGameData();
  22599. DataMgr.setBigSkill(select, 1);
  22600. xGame.showTip("Trial Successful");
  22601. this.hide();
  22602. }
  22603. onCancel() {
  22604. if (this.closeNum > 0) {
  22605. this.closeNum--;
  22606. if (this.closeNum < 2)
  22607. this.hide();
  22608. return;
  22609. }
  22610. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  22611. this.onTry();
  22612. }
  22613. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  22614. this.closeNum = 3;
  22615. }
  22616. else
  22617. this.hide();
  22618. }
  22619. }
  22620. UITry$1.uiName = "UITry";
  22621. class UIGetAward$1 extends UIBase {
  22622. constructor() {
  22623. super();
  22624. this.showTriple = true;
  22625. }
  22626. onConstructor() {
  22627. this.ui = ui_UIGetAward.createInstance();
  22628. this.contentPane = this.ui;
  22629. this.isEject = false;
  22630. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  22631. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  22632. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  22633. }
  22634. show(arr, showTriple, callback) {
  22635. super.show();
  22636. this.ui.t0.play();
  22637. this.ui.eftNode.visible = true;
  22638. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  22639. this.ui.eftNode.visible = false;
  22640. }), 1, 0, 0, 0.9);
  22641. this.awardArr = arr;
  22642. this.showTriple = showTriple;
  22643. this.callback = callback;
  22644. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  22645. this.ui.myList.numItems = arr.length;
  22646. xGame.soundMgr.playSound("getaward");
  22647. }
  22648. updateSelf(index, obj) {
  22649. let temp = this.awardArr[index];
  22650. let icon = this.getIcon(temp.type);
  22651. let str = icon;
  22652. if (temp.type > 2) {
  22653. str = "s" + icon;
  22654. }
  22655. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  22656. obj.myIcon.rotation = 0;
  22657. obj.numTxt.text = temp.num + "";
  22658. obj.numTxt.visible = temp.type > 2 ? false : true;
  22659. obj.nameTxt.text = this.getNameStr(temp.type);
  22660. }
  22661. renderItem(index, obj) {
  22662. this.updateSelf(index, obj);
  22663. }
  22664. tripleGetAward() {
  22665. console.log('zh:qjff_AD_for_uigetAward');
  22666. if (Laya.Browser.onAndroid) {
  22667. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22668. if (!boo) {
  22669. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22670. return;
  22671. }
  22672. }
  22673. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  22674. }
  22675. else {
  22676. console.log('zh:AD 失败,直接发放奖励');
  22677. this.qjff_AD_for_uigetAward();
  22678. }
  22679. }
  22680. qjff_AD_for_uigetAward() {
  22681. this.getAward(3);
  22682. }
  22683. normalGetAward() {
  22684. if (PlatMgr.isMisVideo())
  22685. this.tripleGetAward();
  22686. else
  22687. this.getAward();
  22688. }
  22689. getAward(times = 1) {
  22690. this.hide();
  22691. for (let index = 0; index < this.awardArr.length; index++) {
  22692. this.awardArr[index].num *= times;
  22693. }
  22694. this.callback && this.callback(times != 1);
  22695. }
  22696. getIcon(type) {
  22697. switch (type) {
  22698. case Prop.diamond:
  22699. return "ty_zs";
  22700. case Prop.coin:
  22701. return "ty_jb";
  22702. case Prop.gan1:
  22703. return "qg1";
  22704. case Prop.gan2:
  22705. return "qg2";
  22706. case Prop.gan3:
  22707. return "qg3";
  22708. case Prop.gan4:
  22709. return "qg4";
  22710. default:
  22711. break;
  22712. }
  22713. }
  22714. getNameStr(type) {
  22715. switch (type) {
  22716. case Prop.diamond:
  22717. return "Diamond";
  22718. case Prop.coin:
  22719. return "Coins";
  22720. case Prop.gan1:
  22721. case Prop.gan2:
  22722. case Prop.gan3:
  22723. case Prop.gan4:
  22724. return cfgTable.ballrodData[type - 1].name;
  22725. default:
  22726. break;
  22727. }
  22728. }
  22729. }
  22730. UIGetAward$1.uiName = "UIGetAward";
  22731. class UIBox$1 extends UIBase {
  22732. constructor() {
  22733. super();
  22734. this.boxNum = 0;
  22735. this.boxMax = 10;
  22736. this.inAd = false;
  22737. this.isClose = false;
  22738. }
  22739. onConstructor() {
  22740. this.ui = ui_UIBox.createInstance();
  22741. this.contentPane = this.ui;
  22742. this.isEject = false;
  22743. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  22744. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  22745. Laya.timer.loop(1000, this, this.update);
  22746. }
  22747. update() {
  22748. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  22749. this.boxNum -= 1;
  22750. this.upBar();
  22751. }
  22752. }
  22753. upBar() {
  22754. if (this.boxNum > this.boxMax)
  22755. this.boxNum = this.boxMax;
  22756. this.ui.bar.value = this.boxNum * 10;
  22757. }
  22758. show() {
  22759. super.show();
  22760. this.isClose = false;
  22761. this.boxNum = 0;
  22762. this.inAd = false;
  22763. this.upBar();
  22764. this.ui.t0.play();
  22765. this.ui.closeBtn.visible = false;
  22766. Laya.timer.once(3000, this, () => {
  22767. this.ui.closeBtn.visible = true;
  22768. this.ui.bar.alpha = 1;
  22769. });
  22770. Laya.timer.once(500, this, () => {
  22771. this.ui.t1.play();
  22772. });
  22773. }
  22774. hide() {
  22775. Laya.timer.clearAll(this);
  22776. Moyu.showBannerAd(false);
  22777. super.hide();
  22778. }
  22779. onOpenBox() {
  22780. this.boxNum++;
  22781. if (this.boxNum < this.boxMax) {
  22782. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  22783. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  22784. }
  22785. }
  22786. else if (this.boxNum == this.boxMax) {
  22787. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  22788. this.ui.openBtn.c1.selectedIndex = 13;
  22789. this.inAd = true;
  22790. }
  22791. else
  22792. this.getAward();
  22793. }
  22794. else if (this.inAd) {
  22795. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  22796. if (Laya.Browser.onAndroid) {
  22797. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22798. if (!boo) {
  22799. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22800. return;
  22801. }
  22802. }
  22803. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  22804. }
  22805. else {
  22806. console.log('zh:AD 失败,直接发放奖励');
  22807. this.qjff_AD_for_UIBOX_onOpenBox();
  22808. }
  22809. }
  22810. this.upBar();
  22811. }
  22812. qjff_AD_for_UIBOX_onOpenBox() {
  22813. this.getAward();
  22814. }
  22815. onCloseBox() {
  22816. if (this.isClose)
  22817. this.hide();
  22818. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  22819. this.isClose = true;
  22820. PlatMgr.showBanner(true, 0, 3000);
  22821. }
  22822. else
  22823. this.hide();
  22824. }
  22825. getAward() {
  22826. let str = "";
  22827. if (Math.random() < 0.5) {
  22828. let max = Moyu.isLegal ? 500 : 2500;
  22829. let num = xGame.tools.random(max, 500 + max);
  22830. DataMgr.setCoin(num);
  22831. str = "金币x" + num;
  22832. }
  22833. else {
  22834. let max = Moyu.isLegal ? 10 : 30;
  22835. let num = xGame.tools.random(max, 30 + max);
  22836. DataMgr.setDiamond(num);
  22837. str = "钻石x" + num;
  22838. }
  22839. xGame.showTip("恭喜获得-" + str);
  22840. this.hide();
  22841. }
  22842. }
  22843. UIBox$1.uiName = "UIBox";
  22844. class UIMain$1 extends UIBase {
  22845. constructor() {
  22846. super();
  22847. this.firstEnter = true;
  22848. }
  22849. nativeCallJs(msg) {
  22850. let t = msg;
  22851. console.log("zh: nativeCallJs 奖励开始发放:", t);
  22852. switch (t) {
  22853. case 'qjff_chouJiang':
  22854. let dui = xGame.uiMgr.getUI(UIDraw$1);
  22855. dui.qjff_chouJiang();
  22856. break;
  22857. case 'qjff_AD_for_uisign':
  22858. let dui2 = xGame.uiMgr.getUI(UISign$1);
  22859. dui2.qjff_AD_for_uisign();
  22860. break;
  22861. case 'qjff_AD_for_uitry':
  22862. let dui3 = xGame.uiMgr.getUI(UITry$1);
  22863. dui3.qjff_AD_for_uitry();
  22864. break;
  22865. case 'qjff_AD_for_uipower':
  22866. let dui4 = xGame.uiMgr.getUI(UIPower$1);
  22867. dui4.qjff_AD_for_uipower();
  22868. break;
  22869. case 'qjff_AD_for_uigetAward':
  22870. let dui5 = xGame.uiMgr.getUI(UIGetAward$1);
  22871. dui5.qjff_AD_for_uigetAward();
  22872. break;
  22873. case 'qjff_AD_for_uiGameEnd':
  22874. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  22875. let dui6 = xGame.uiMgr.getUI(UIGameEnd$1);
  22876. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  22877. break;
  22878. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  22879. let dui7 = xGame.uiMgr.getUI(UIAddProp$1);
  22880. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  22881. break;
  22882. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  22883. let dui8 = xGame.uiMgr.getUI(UIAddProp$1);
  22884. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  22885. break;
  22886. case 'qjff_AD_for_UIrepentProp_videoRegret':
  22887. let dui9 = xGame.uiMgr.getUI(UIRepentProp$1);
  22888. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  22889. break;
  22890. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  22891. let dui10 = xGame.uiMgr.getUI(UIRepentProp$1);
  22892. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  22893. break;
  22894. case 'qjff_AD_for_UIBOX_onOpenBox':
  22895. let dui11 = xGame.uiMgr.getUI(UIBox$1);
  22896. dui11.qjff_AD_for_UIBOX_onOpenBox();
  22897. break;
  22898. case 'qjff_AD_for_UIAddCoin':
  22899. let dui12 = xGame.uiMgr.getUI(UIAddCoin$1);
  22900. dui12.qjff_AD_for_UIAddCoin();
  22901. break;
  22902. case '111a':
  22903. let dui14 = xGame.uiMgr.getUI(UISign$1);
  22904. dui14.qjff_AD_for_uisign();
  22905. break;
  22906. case '222a':
  22907. let dui15 = xGame.uiMgr.getUI(UISign$1);
  22908. dui15.qjff_AD_for_uisign();
  22909. break;
  22910. case '333a':
  22911. let dui16 = xGame.uiMgr.getUI(UISign$1);
  22912. dui16.qjff_AD_for_uisign();
  22913. break;
  22914. default:
  22915. console.log('zh:未知的方法名字' + t);
  22916. break;
  22917. }
  22918. }
  22919. onConstructor() {
  22920. console.log('zh: UIMain onConstructor');
  22921. this.ui = ui_UIMain.createInstance();
  22922. this.contentPane = this.ui;
  22923. this.isEject = false;
  22924. this.addEvent();
  22925. this.addClickSpine();
  22926. this.settingNode = new SettingNode$1(this.ui.settingNode);
  22927. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22928. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  22929. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  22930. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  22931. let curUse = DataMgr.getCurSecretary();
  22932. this.changeSecretary(curUse);
  22933. this.ui.talkNode.visible = false;
  22934. let guide = DataMgr.getSkillGuide();
  22935. if (xGame.common.isNewDay && guide == 1) {
  22936. xGame.common.isNewDay = false;
  22937. xGame.soundMgr.playSound("s_main01");
  22938. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22939. console.log("zh:播放小秘书每天语音");
  22940. }
  22941. this.onGetUserInfo();
  22942. this.ui.n83.visible = false;
  22943. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  22944. const d = LocalStorageManager.getItem(keyForLoginInfo);
  22945. let ua = d.username;
  22946. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  22947. }
  22948. this.c_btn_for_user();
  22949. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  22950. }
  22951. Logout() {
  22952. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  22953. LocalStorageManager.removeItem(keyForLoginInfo);
  22954. this.freshUser();
  22955. }
  22956. }
  22957. gotoLogin() {
  22958. xGame.uiMgr.Show(UILogin$1);
  22959. }
  22960. gotoRegUser() {
  22961. xGame.uiMgr.Show(UIReg$1);
  22962. }
  22963. c_btn_for_user() {
  22964. this.ui.n_Logout.visible = false;
  22965. this.ui.n_dengLu.visible = false;
  22966. this.ui.n_zhuCe.visible = false;
  22967. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  22968. this.ui.n_Logout.visible = true;
  22969. }
  22970. else {
  22971. this.ui.n_dengLu.visible = true;
  22972. }
  22973. }
  22974. changeSecretary(curUse) {
  22975. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  22976. xGame.common.secretary && xGame.common.secretary.dispose();
  22977. this.addSecretarySpine(name);
  22978. }
  22979. addSecretarySpine(name) {
  22980. let spine = new SpineMgr(name, () => {
  22981. this.playSecretaryIdle();
  22982. });
  22983. xGame.common.secretary = spine;
  22984. }
  22985. addClickSpine() {
  22986. let clickSpine = new SpineMgr("dianji", () => {
  22987. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  22988. let parent = Laya.stage;
  22989. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  22990. clickSpine.play(data, 0, false, parent, (spine) => {
  22991. spine.destroy(true);
  22992. });
  22993. });
  22994. });
  22995. }
  22996. addEvent() {
  22997. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  22998. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  22999. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  23000. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  23001. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  23002. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  23003. this.addUIClick(this.ui, this.interuptSecretary);
  23004. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  23005. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  23006. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  23007. this.addUIClick(this.ui.shopBtn, this.openShopView);
  23008. this.addUIClick(this.ui.signBtn, this.openSignView);
  23009. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  23010. this.addUIClick(this.ui.rankBtn, this.openRanking);
  23011. this.addUIClick(this.ui.n_Logout, this.Logout);
  23012. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  23013. this.addUIClick(this.ui.n_zhuCe, this.gotoRegUser);
  23014. }
  23015. show(showFailWords) {
  23016. super.show();
  23017. this.moneyNode.ui.c1.selectedIndex = 1;
  23018. this.playSecretaryIdle();
  23019. xGame.soundMgr.playMusic("caromhall01", 0);
  23020. Laya.timer.clearAll(this);
  23021. this.playSecretaryRandomSound();
  23022. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  23023. if (showFailWords) {
  23024. console.log('zh:uimain.ts ');
  23025. setTimeout(() => {
  23026. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  23027. let words = -1;
  23028. if (str == "s_main02") {
  23029. words = 2;
  23030. }
  23031. else {
  23032. words = 3;
  23033. }
  23034. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23035. xGame.soundMgr.playSound(str);
  23036. }, 300);
  23037. }
  23038. this.showGuide();
  23039. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  23040. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  23041. let guide = DataMgr.getSkillGuide();
  23042. if (guide == 1) {
  23043. let randTime = xGame.common.randomNum(300, 800);
  23044. if (this.firstEnter) {
  23045. console.log("zh: firstEnter");
  23046. this.firstEnter = false;
  23047. randTime += 900;
  23048. }
  23049. else {
  23050. console.log("zh: no firstEnter");
  23051. }
  23052. Laya.timer.once(randTime, this, () => {
  23053. xGame.common.autoPopUIView();
  23054. });
  23055. }
  23056. }
  23057. checkActive(show) {
  23058. }
  23059. showGuide() {
  23060. let guide = DataMgr.getSkillGuide();
  23061. this.ui.guideBtn.visible = guide == 0;
  23062. this.ui.enterGuide.visible = false;
  23063. this.ui.secretaryGuide.visible = guide == 0;
  23064. if (guide == 0) {
  23065. console.log("zh:显示引导");
  23066. xGame.soundMgr.playSound("s_guide");
  23067. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23068. }
  23069. else {
  23070. console.log("zh:不需要显示引导");
  23071. }
  23072. }
  23073. ensureSecretary() {
  23074. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  23075. this.ui.secretaryGuide.visible = false;
  23076. this.ui.enterGuide.visible = true;
  23077. this.ui.wordsNode.t0.play();
  23078. if (DataMgr.getNewUser())
  23079. Moyu.sendDataEvent("gameReady");
  23080. }
  23081. playSecretaryIdle() {
  23082. let parent = this.ui.secretary.displayObject;
  23083. parent.destroyChildren();
  23084. let xx = this.ui.secretary.width / 2;
  23085. let yy = this.ui.secretary.height;
  23086. let scale = xGame.common.getSecretaryScale();
  23087. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23088. console.log("zh:playSecretaryIdle", data);
  23089. xGame.common.secretary.play(data, 0, true, parent);
  23090. }
  23091. startGame(type) {
  23092. xGame.common.gameMode = type;
  23093. Moyu.sendDataEvent("PlayGame", { type: type });
  23094. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  23095. switch (xGame.common.gameMode) {
  23096. case GameMode.classic:
  23097. console.log('zh:进入经典模式111111111');
  23098. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  23099. let db_over_lev = DataMgr.getChallengeMode_overLev();
  23100. console.log('zh:classic db_over_lev=', db_over_lev);
  23101. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  23102. console.log('zh:判断是否可以玩该模式classic =NO');
  23103. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  23104. xGame.uiMgr.Show(UIMsg$1, tipStr);
  23105. return;
  23106. }
  23107. else {
  23108. console.log('zh:可以玩该模式classic 66666666666666');
  23109. this.beginGame();
  23110. }
  23111. }
  23112. else {
  23113. console.log('zh:不需要判断是否可以玩该classic');
  23114. let challengeTimes = DataMgr.getChallengeTimes();
  23115. if (challengeTimes == 0) {
  23116. xGame.uiMgr.Show(UIInvitation$1);
  23117. }
  23118. else {
  23119. this.beginGame();
  23120. }
  23121. break;
  23122. }
  23123. case GameMode.bigMove:
  23124. console.error('zh:bigMove check');
  23125. let guide = DataMgr.getSkillGuide();
  23126. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  23127. let db_over_lev = DataMgr.getChallengeMode_overLev();
  23128. console.log('zh:bigMove db_over_lev=', db_over_lev);
  23129. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  23130. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  23131. xGame.uiMgr.Show(UIMsg$1, tipStr);
  23132. return;
  23133. }
  23134. else {
  23135. console.log('zh:可以玩该模式 bigMove');
  23136. this.beginGame();
  23137. if (DataMgr.getNewUser())
  23138. Moyu.sendDataEvent("gameStart0");
  23139. }
  23140. }
  23141. else {
  23142. this.beginGame();
  23143. if (DataMgr.getNewUser())
  23144. Moyu.sendDataEvent("gameStart0");
  23145. }
  23146. break;
  23147. default:
  23148. console.error('zh:未知错误!!!!');
  23149. break;
  23150. }
  23151. }
  23152. beginGame(isNice = false) {
  23153. console.log('zh:beginGame ');
  23154. let guide = DataMgr.getSkillGuide();
  23155. if (guide == 1) {
  23156. console.log('zh:非新手引导,showInternAd ');
  23157. JSBridgeUtils.instance.showInternAd('beginGame');
  23158. }
  23159. else {
  23160. console.log('zh:新手引导,不显示AD ');
  23161. }
  23162. console.log('zh:beginGame 2 go');
  23163. if (xGame.common.gameMode == GameMode.classic) {
  23164. if (isNice) {
  23165. this.enterClassic();
  23166. }
  23167. else {
  23168. xGame.uiMgr.Show(UIModeSelection$1, () => {
  23169. console.log('zh:BBBBBBBBBBBBBBB');
  23170. this.enterClassic();
  23171. });
  23172. }
  23173. }
  23174. else if (xGame.common.gameMode == GameMode.bigMove) {
  23175. this.ui.enterGuide.visible = false;
  23176. xGame.uiMgr.Show(UISkill$1);
  23177. }
  23178. }
  23179. enterClassic() {
  23180. xGame.uiMgr.Show(UIGame$1);
  23181. xGame.uiMgr.Show(UIMatching$1, () => {
  23182. if (!this.isHide)
  23183. this.hide();
  23184. xGame.common.gameUI.ui.alpha = 1;
  23185. xGame.common.gameUI.startGame();
  23186. xGame.uiMgr.Hide(UIGameEnd$1);
  23187. });
  23188. }
  23189. startGlobal() {
  23190. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  23191. }
  23192. startWeekly() {
  23193. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  23194. }
  23195. zhouSaiMonth() {
  23196. console.log('zh: zhouSaiMonth 被调用');
  23197. }
  23198. startPlaceBall() {
  23199. xGame.uiMgr.Show(UILevelDisplay$1);
  23200. }
  23201. hide() {
  23202. console.log('zh:uimain hide ...');
  23203. super.hide();
  23204. xGame.common.stopGirlPop(this.ui.talkNode);
  23205. }
  23206. onGetUserInfo(force = false) {
  23207. if (Moyu.isWx) {
  23208. let info = Moyu.getSystemInfo();
  23209. if (info)
  23210. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  23211. }
  23212. else {
  23213. Moyu.initUser(this, this.freshUser, force);
  23214. }
  23215. this.freshUser();
  23216. }
  23217. freshUser() {
  23218. let user = Moyu.getUserInfo();
  23219. if (!user.isAuth) {
  23220. user.headIcon = 'res/ty_touxiang.png';
  23221. }
  23222. else {
  23223. DataMgr.upRankData();
  23224. }
  23225. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  23226. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  23227. let keyStr = keyForLoginInfo;
  23228. if (LocalStorageManager.hasJosnKey(keyStr)) {
  23229. const d = LocalStorageManager.getItem(keyStr);
  23230. let ua = d.username;
  23231. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  23232. }
  23233. else {
  23234. }
  23235. this.c_btn_for_user();
  23236. }
  23237. interuptSecretary() {
  23238. Laya.timer.clearAll(this);
  23239. this.playSecretaryRandomSound();
  23240. }
  23241. playSecretaryRandomSound() {
  23242. if (this.isHide)
  23243. return;
  23244. let time = xGame.common.randomNum(45000, 60000);
  23245. Laya.timer.once(time, this, () => {
  23246. if (this.isHide)
  23247. return;
  23248. let index = xGame.common.randomNum(4, 7);
  23249. xGame.soundMgr.playSound("s_main0" + index);
  23250. let words = 1;
  23251. switch (index) {
  23252. case 4:
  23253. words = 5;
  23254. break;
  23255. case 5:
  23256. words = 3;
  23257. break;
  23258. case 6:
  23259. words = 6;
  23260. break;
  23261. case 7:
  23262. words = 7;
  23263. break;
  23264. default:
  23265. break;
  23266. }
  23267. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23268. this.playSecretaryRandomSound();
  23269. });
  23270. }
  23271. openSecretaryView() {
  23272. xGame.uiMgr.Show(UISecretary$1);
  23273. Moyu.sendDataEvent("secretary");
  23274. }
  23275. openShopView() {
  23276. xGame.uiMgr.Show(UIShop$1, 0);
  23277. }
  23278. openSignView() {
  23279. xGame.uiMgr.Show(UISign$1);
  23280. }
  23281. openDrawView() {
  23282. xGame.uiMgr.Show(UIDraw$1);
  23283. }
  23284. openRanking() {
  23285. console.log('zh:phb openRanking');
  23286. xGame.uiMgr.Show(UIRanking$1);
  23287. Moyu.sendDataEvent("rankingList");
  23288. }
  23289. }
  23290. UIMain$1.uiName = "UIMain";
  23291. function InitShader() {
  23292. }
  23293. function appInit() {
  23294. xGame.context.init(getLoadingResList(), initCallback);
  23295. }
  23296. function getLoadingResList() {
  23297. return [
  23298. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  23299. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  23300. ];
  23301. }
  23302. function getGameResList() {
  23303. return [
  23304. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  23305. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  23306. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  23307. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  23308. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  23309. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  23310. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  23311. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  23312. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  23313. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  23314. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  23315. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  23316. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  23317. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  23318. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  23319. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  23320. { url: "res/font/arial.ttf", type: Laya.Loader.FONT },
  23321. ];
  23322. }
  23323. function initCallback() {
  23324. window["DataMgr"] = DataMgr;
  23325. DataMgr.Init();
  23326. Moyu.init(getPlat(), this, () => {
  23327. DataMgr.isNewDay();
  23328. PlatMgr.initConfig();
  23329. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  23330. }, true);
  23331. console.log('zh:开始sm init1 start');
  23332. xGame.soundMgr.init();
  23333. console.log('zh:开始sm init1 end');
  23334. xGame.uiMgr.init();
  23335. xGame.uiMgr.clearTempData();
  23336. xGame.uiMgr.bindFUI(fguiRes.loading);
  23337. xGame.uiMgr.Show(UILoading);
  23338. }
  23339. function loadSubRes(callback) {
  23340. var tab = ["asset", "res", "spine"];
  23341. let subDone = 0;
  23342. for (var i = 0; i < tab.length; i++) {
  23343. let sub = tab[i];
  23344. Moyu.loadSubRes(sub, (pro) => {
  23345. callback && callback(pro, false);
  23346. }).then(() => {
  23347. subDone++;
  23348. if (subDone >= tab.length)
  23349. callback && callback(1, true);
  23350. });
  23351. }
  23352. }
  23353. function enterGame() {
  23354. xGame.cfgMgr.init();
  23355. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  23356. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  23357. xGame.uiMgr.Hide(UILoading);
  23358. fgui.UIPackage.removePackage(fguiRes.loading);
  23359. xGame.uiMgr.bindFUI(fguiRes.game);
  23360. xGame.uiMgr.Show(UIMain$1);
  23361. if (DataMgr.getNewUser())
  23362. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  23363. }
  23364. function getPlat() {
  23365. let cfg = new MoyuCfg();
  23366. cfg.plat = MoyuPlat.web;
  23367. cfg.myId = 180;
  23368. cfg.myKey = '8848a885774230a4';
  23369. cfg.version = 0;
  23370. if (window.hasOwnProperty("gamebox")) {
  23371. cfg.plat = MoyuPlat.f399;
  23372. cfg.version = 0;
  23373. }
  23374. else if (window.hasOwnProperty("ks")) {
  23375. cfg.plat = MoyuPlat.ks;
  23376. cfg.version = 0;
  23377. cfg.ads.ksVideoId = '2300002254_01';
  23378. cfg.ads.ksInsertId = '2300002254_02';
  23379. }
  23380. else if (Laya.Browser.onTTMiniGame) {
  23381. cfg.plat = MoyuPlat.tt;
  23382. cfg.version = 0;
  23383. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  23384. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  23385. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  23386. }
  23387. else if (Laya.Browser.onMiniGame) {
  23388. cfg.plat = MoyuPlat.wx;
  23389. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  23390. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  23391. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  23392. }
  23393. else if (Laya.Browser.onQQMiniGame) {
  23394. cfg.plat = MoyuPlat.qq;
  23395. }
  23396. else if (Laya.Browser.onQGMiniGame) {
  23397. cfg.plat = MoyuPlat.op;
  23398. cfg.ads.opVideoId = '455502';
  23399. cfg.ads.opBannerId = '455507';
  23400. }
  23401. else if (Laya.Browser.onVVMiniGame) {
  23402. cfg.plat = MoyuPlat.vv;
  23403. cfg.version = 0;
  23404. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  23405. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  23406. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  23407. }
  23408. else if (Laya.Browser.onHWMiniGame) {
  23409. cfg.plat = MoyuPlat.hw;
  23410. }
  23411. else if (window["mz"]) {
  23412. cfg.plat = MoyuPlat.mz;
  23413. }
  23414. else {
  23415. let cfg = window['conchConfig'];
  23416. if (cfg) {
  23417. var os = cfg.getOS();
  23418. if (os == "Conch-ios") {
  23419. cfg.plat = MoyuPlat.ios;
  23420. }
  23421. else if (os == "Conch-android") {
  23422. }
  23423. }
  23424. }
  23425. return cfg;
  23426. }
  23427. class Main {
  23428. constructor() {
  23429. if (window["Laya3D"])
  23430. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  23431. else {
  23432. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  23433. this.initMain();
  23434. }
  23435. }
  23436. initMain() {
  23437. Laya["Physics"] && Laya["Physics"].enable();
  23438. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  23439. Laya.stage.scaleMode = GameConfig.scaleMode;
  23440. Laya.stage.screenMode = GameConfig.screenMode;
  23441. Laya.stage.alignV = GameConfig.alignV;
  23442. Laya.stage.alignH = GameConfig.alignH;
  23443. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  23444. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  23445. Laya.enableDebugPanel();
  23446. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  23447. Laya["PhysicsDebugDraw"].enable();
  23448. if (GameConfig.stat)
  23449. Laya.Stat.show();
  23450. Laya.alertGlobalError(true);
  23451. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  23452. }
  23453. onVersionLoaded() {
  23454. appInit();
  23455. }
  23456. }
  23457. new Main();
  23458. }());
  23459. //# sourceMappingURL=bundle.js.map