1
0

bundle.js 797 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911
  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 baseHeadUrl = "https://mygame1.tangro.cn/headimg/";
  52. let poolKey = {
  53. inHoleEft: "inHoleEft",
  54. d3ball: "d3ball",
  55. iceEft: "iceEft",
  56. hitEft: "hitEft",
  57. fireworksEft: "fireworksEft",
  58. };
  59. var GameMode;
  60. (function (GameMode) {
  61. GameMode[GameMode["classic"] = 0] = "classic";
  62. GameMode[GameMode["bigMove"] = 1] = "bigMove";
  63. GameMode[GameMode["placeBall"] = 2] = "placeBall";
  64. })(GameMode || (GameMode = {}));
  65. var SkillType;
  66. (function (SkillType) {
  67. SkillType[SkillType["highSpace"] = 0] = "highSpace";
  68. SkillType[SkillType["breakArmy"] = 1] = "breakArmy";
  69. SkillType[SkillType["ice"] = 2] = "ice";
  70. SkillType[SkillType["fireworks"] = 3] = "fireworks";
  71. SkillType[SkillType["GuanYu"] = 4] = "GuanYu";
  72. })(SkillType || (SkillType = {}));
  73. var ClassicWordsType;
  74. (function (ClassicWordsType) {
  75. ClassicWordsType[ClassicWordsType["directShoot"] = 0] = "directShoot";
  76. ClassicWordsType[ClassicWordsType["bigPower"] = 1] = "bigPower";
  77. ClassicWordsType[ClassicWordsType["anotherShoot"] = 2] = "anotherShoot";
  78. ClassicWordsType[ClassicWordsType["perfectShow"] = 3] = "perfectShow";
  79. ClassicWordsType[ClassicWordsType["hardShoot"] = 4] = "hardShoot";
  80. })(ClassicWordsType || (ClassicWordsType = {}));
  81. var PressType;
  82. (function (PressType) {
  83. PressType[PressType["powerNode"] = 0] = "powerNode";
  84. PressType[PressType["d2Root"] = 1] = "d2Root";
  85. PressType[PressType["moveNode"] = 2] = "moveNode";
  86. PressType[PressType["rulerNode"] = 3] = "rulerNode";
  87. })(PressType || (PressType = {}));
  88. var PlaceBallType;
  89. (function (PlaceBallType) {
  90. PlaceBallType[PlaceBallType["normal"] = 0] = "normal";
  91. PlaceBallType[PlaceBallType["challenge"] = 1] = "challenge";
  92. })(PlaceBallType || (PlaceBallType = {}));
  93. var EAdType;
  94. (function (EAdType) {
  95. EAdType[EAdType["upSkill"] = 0] = "upSkill";
  96. EAdType[EAdType["addDiamond"] = 1] = "addDiamond";
  97. EAdType[EAdType["placeBallNextLevel"] = 2] = "placeBallNextLevel";
  98. EAdType[EAdType["regretBall"] = 3] = "regretBall";
  99. EAdType[EAdType["longHelpLine"] = 4] = "longHelpLine";
  100. EAdType[EAdType["addFailCoin"] = 5] = "addFailCoin";
  101. EAdType[EAdType["sign"] = 6] = "sign";
  102. EAdType[EAdType["draw"] = 7] = "draw";
  103. EAdType[EAdType["triple"] = 8] = "triple";
  104. EAdType[EAdType["randomDiamond"] = 9] = "randomDiamond";
  105. EAdType[EAdType["getPower"] = 10] = "getPower";
  106. EAdType[EAdType["box"] = 11] = "box";
  107. EAdType[EAdType["try"] = 12] = "try";
  108. EAdType[EAdType["againSign"] = 13] = "againSign";
  109. EAdType[EAdType["addCoin"] = 14] = "addCoin";
  110. })(EAdType || (EAdType = {}));
  111. var Prop;
  112. (function (Prop) {
  113. Prop[Prop["diamond"] = 1] = "diamond";
  114. Prop[Prop["coin"] = 2] = "coin";
  115. Prop[Prop["gan1"] = 3] = "gan1";
  116. Prop[Prop["gan2"] = 4] = "gan2";
  117. Prop[Prop["gan3"] = 5] = "gan3";
  118. Prop[Prop["gan4"] = 6] = "gan4";
  119. })(Prop || (Prop = {}));
  120. var TipsType;
  121. (function (TipsType) {
  122. TipsType[TipsType["exitGame"] = 0] = "exitGame";
  123. TipsType[TipsType["foul"] = 1] = "foul";
  124. })(TipsType || (TipsType = {}));
  125. class AwardType {
  126. constructor(type, num) {
  127. this.type = type;
  128. this.num = num;
  129. }
  130. }
  131. var define = /*#__PURE__*/Object.freeze({
  132. fguiRes: fguiRes,
  133. ballCamp: ballCamp,
  134. FoulType: FoulType,
  135. ALL_BALL_STOP: ALL_BALL_STOP,
  136. WAIT_SHOOT: WAIT_SHOOT,
  137. D3RES_LOADED: D3RES_LOADED,
  138. BALL_SHOOT: BALL_SHOOT,
  139. FIRST_BALL_HOLE: FIRST_BALL_HOLE,
  140. RESET_GAME: RESET_GAME,
  141. COIN_CHANGE: COIN_CHANGE,
  142. DIAMOND_CHANGE: DIAMOND_CHANGE,
  143. RESTART_GAME: RESTART_GAME,
  144. GET_USER_INFO: GET_USER_INFO,
  145. CHANGE_SECRETARY: CHANGE_SECRETARY,
  146. POWER_CHANGE: POWER_CHANGE,
  147. POWER_TIME: POWER_TIME,
  148. baseHeadUrl: baseHeadUrl,
  149. poolKey: poolKey,
  150. get GameMode () { return GameMode; },
  151. get SkillType () { return SkillType; },
  152. get ClassicWordsType () { return ClassicWordsType; },
  153. get PressType () { return PressType; },
  154. get PlaceBallType () { return PlaceBallType; },
  155. get EAdType () { return EAdType; },
  156. get Prop () { return Prop; },
  157. get TipsType () { return TipsType; },
  158. AwardType: AwardType
  159. });
  160. class CContext {
  161. constructor() {
  162. this.winSize = { width: 0, height: 0 };
  163. this.notchHeight = 0;
  164. this.bannerHeight = 0;
  165. }
  166. init(resList, callback) {
  167. this.winSize = { width: Laya.Browser.clientWidth, height: Laya.Browser.clientHeight };
  168. this.notchHeight = this.getNotchHeight();
  169. this.bannerHeight = this.getBannerHeight();
  170. Laya.loader.load(resList, Laya.Handler.create(this, () => {
  171. callback && callback();
  172. }));
  173. }
  174. getNotchHeight() {
  175. let notchHeight = 50;
  176. if (Laya.Browser.onMiniGame) {
  177. let deviceInfo = wx.getSystemInfoSync();
  178. if (Laya.Browser.onIOS) {
  179. if (deviceInfo.model.search('iPhone X') != -1) {
  180. notchHeight = deviceInfo.statusBarHeight - 10;
  181. }
  182. else {
  183. if ((deviceInfo.screenWidth == 375 && deviceInfo.screenHeight == 812) ||
  184. (deviceInfo.screenWidth == 414 && deviceInfo.screenHeight == 896)) {
  185. notchHeight = deviceInfo.statusBarHeight - 10;
  186. }
  187. }
  188. }
  189. else if (Laya.Browser.onAndroid) {
  190. if (deviceInfo.screenWidth / deviceInfo.screenHeight < (9 / 16)) {
  191. notchHeight = deviceInfo.statusBarHeight;
  192. }
  193. }
  194. }
  195. return notchHeight;
  196. }
  197. getBannerHeight() {
  198. return 0;
  199. }
  200. }
  201. let context = new CContext();
  202. var Handler = Laya.Handler;
  203. var Tween = Laya.Tween;
  204. function playClickEffect(btn) {
  205. if (!btn)
  206. return;
  207. Laya.Tween.to(btn, { scaleX: 1.05, scaleY: 1.05 }, 20, null, Laya.Handler.create(null, () => {
  208. if (!btn)
  209. return;
  210. Laya.Tween.to(btn, { scaleX: 0.96, scaleY: 0.96 }, 30, null, Laya.Handler.create(null, () => {
  211. if (!btn)
  212. return;
  213. Laya.Tween.to(btn, { scaleX: 1, scaleY: 1 }, 20, null, null, 0, true);
  214. }), 0, true);
  215. }), 0, true);
  216. }
  217. function getNumList(strList) {
  218. let dataList = [];
  219. if (strList) {
  220. let list = strList;
  221. let array = list.split(',');
  222. for (var v in array) {
  223. dataList.push(Number(array[v]));
  224. }
  225. }
  226. return dataList;
  227. }
  228. function getStrList(strList) {
  229. let dataList = [];
  230. if (strList) {
  231. let list = strList;
  232. let array = list.split('|');
  233. for (var v in array) {
  234. dataList.push(String(array[v]));
  235. }
  236. }
  237. return dataList;
  238. }
  239. function getRandStr(len) {
  240. 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'];
  241. let str = "";
  242. for (let i = 0; i < len; i++) {
  243. let rand = random(0, list.length);
  244. str += list[rand];
  245. }
  246. return str;
  247. }
  248. function getUserId() {
  249. let str = getRandStr(12) + Laya.timer.currTimer % 1000000;
  250. return str;
  251. }
  252. function formatPos(pos, len = 2) {
  253. let v = Math.pow(10, len);
  254. pos.x = Math.floor(pos.x * v) / v;
  255. pos.y = Math.floor(pos.y * v) / v;
  256. if (pos.z)
  257. pos.z = Math.floor(pos.z * v) / v;
  258. return pos;
  259. }
  260. function setPosInt(pos) {
  261. pos.x = pos.x > 0 ? Math.ceil(pos.x) : Math.floor(pos.x);
  262. pos.y = pos.y > 0 ? Math.ceil(pos.y) : Math.floor(pos.y);
  263. pos.z = pos.z > 0 ? Math.ceil(pos.z) : Math.floor(pos.z);
  264. return pos;
  265. }
  266. function random(min, max) {
  267. var rang = max - min;
  268. var rand = Math.random() * rang;
  269. return Math.floor(rand) + min;
  270. }
  271. function randomList(list, num) {
  272. if (list.length <= num)
  273. return list;
  274. let arry = [];
  275. list.forEach(item => {
  276. arry.push(item);
  277. });
  278. let nums = [];
  279. for (let i = 0; i < num; i++) {
  280. let rand = random(0, arry.length);
  281. let v = arry[rand];
  282. nums.push(v);
  283. arry.splice(rand, 1);
  284. }
  285. return nums;
  286. }
  287. function worldToScreen(camera, point, pos) {
  288. camera.viewport.project(point, camera.projectionViewMatrix, pos);
  289. pos.x = pos.x / Laya.stage.clientScaleX;
  290. pos.y = pos.y / Laya.stage.clientScaleY;
  291. }
  292. function getStringLenght(str) {
  293. return str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  294. }
  295. function reviseString(str, len) {
  296. let ld = str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  297. if (ld > len) {
  298. let sl = Math.floor(len / 2);
  299. let rs = str.substring(0, sl);
  300. let d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  301. while (d + 2 < len) {
  302. sl++;
  303. rs = str.substring(0, sl);
  304. d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  305. }
  306. return rs + "...";
  307. }
  308. return str;
  309. }
  310. function getCoinString(coin) {
  311. if (coin < 10000)
  312. return coin.toString();
  313. else if (coin < 1000000) {
  314. let vh = Math.ceil(coin / 100);
  315. return (vh / 10) + "k";
  316. }
  317. else if (coin < 1000000000) {
  318. var vh = Math.ceil(coin / 100000);
  319. return (vh / 10) + "m";
  320. }
  321. else if (coin < 1000000000000) {
  322. var vh = Math.ceil(coin / 100000000);
  323. return (vh / 10) + "b";
  324. }
  325. else if (coin < 1000000000000000) {
  326. var vh = Math.ceil(coin / 100000000000);
  327. return (vh / 10) + "t";
  328. }
  329. }
  330. function getV3Dest(pos, dir, dis, dest) {
  331. dir.x *= dis;
  332. dir.y *= dis;
  333. dir.z *= dis;
  334. Laya.Vector3.add(pos, dir, dest);
  335. return dest;
  336. }
  337. function getV2Dest(x1, y1, dir, dis, dest) {
  338. dest.x = x1 + dir.x * dis;
  339. dest.y = y1 + dir.y * dis;
  340. return dest;
  341. }
  342. function getV2Dir(x1, y1, x2, y2, dir) {
  343. dir.x = x2 - x1;
  344. dir.y = y2 - y1;
  345. Laya.Vector2.normalize(dir, dir);
  346. return dir;
  347. }
  348. function getV3Dir(p1, p2, dir) {
  349. Laya.Vector3.subtract(p1, p2, dir);
  350. Laya.Vector3.normalize(dir, dir);
  351. return dir;
  352. }
  353. function copyPos(ip, op) {
  354. op.x = ip.x;
  355. op.y = ip.y;
  356. if (ip.z)
  357. op.z = ip.z;
  358. return op;
  359. }
  360. function getScreenImg() {
  361. let gl = Laya.WebGLContext.mainContext;
  362. let pixels = new Uint8Array(gl.drawingBufferWidth * gl.drawingBufferHeight * 4);
  363. gl.readPixels(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
  364. let w = gl.drawingBufferWidth;
  365. let h = gl.drawingBufferHeight;
  366. let texture2d = new Laya.Texture2D(w, h, Laya.TextureFormat.R8G8B8A8, false, false);
  367. texture2d.setPixels(pixels);
  368. return new Laya.Texture(texture2d);
  369. }
  370. function playMoveByPositions(sp, positions, v, completeCallback) {
  371. let p;
  372. let play = () => {
  373. if (positions.length == 0) {
  374. completeCallback();
  375. return;
  376. }
  377. p = positions[0];
  378. positions.splice(0, 1);
  379. 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, () => {
  380. play();
  381. }));
  382. };
  383. play();
  384. }
  385. function setStarPos(node, num, max) {
  386. for (let i = 1; i <= 5; i++) {
  387. let img = node.getChildAt(i - 1);
  388. img.width = img.height = 30;
  389. img.pivotX = img.pivotY = 0.5;
  390. img.gray = i > num;
  391. img.visible = i <= max;
  392. if (max == 3) {
  393. img.x = node.width / 2 + (i - 2) * 30 - 15;
  394. img.y = node.height - 40;
  395. if (i == 2)
  396. img.y = node.height - 30;
  397. }
  398. else if (max == 5) {
  399. let ly = Math.abs(i - 3);
  400. img.x = node.width / 2 + (i - 3) * 20 - 15;
  401. img.y = node.height - ly * 8 - 30;
  402. }
  403. }
  404. }
  405. function playLoopAnimRotate(sp, time, clockwise = true) {
  406. let rotation;
  407. sp.rotation = sp.rotation % 360;
  408. if (clockwise) {
  409. rotation = -360;
  410. }
  411. else {
  412. rotation = 360;
  413. }
  414. Tween.to(sp, { rotation: rotation }, time, null, Handler.create(this, () => {
  415. this.playLoopAnimRotate(sp, time, clockwise);
  416. }));
  417. }
  418. function playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, isBig = true) {
  419. let x, y;
  420. if (isBig) {
  421. x = valueXMin;
  422. y = valueYMin;
  423. }
  424. else {
  425. x = valueXMax;
  426. y = valueYMax;
  427. }
  428. Tween.to(sp, { x: x, y: y }, time, null, Handler.create(this, () => {
  429. this.playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, !isBig);
  430. }));
  431. }
  432. function playLoopAnimScale(sp, valueMin, valueMax, time, isBig = true) {
  433. let scale;
  434. if (isBig) {
  435. scale = valueMin;
  436. }
  437. else {
  438. scale = valueMax;
  439. }
  440. Tween.to(sp, { scaleX: scale, scaleY: scale }, time, null, Handler.create(this, () => {
  441. playLoopAnimScale(sp, valueMin, valueMax, time, !isBig);
  442. }));
  443. }
  444. function playLoopAnimRotation(sp, valueMin, valueMax, time, isBig = true, count = 8) {
  445. let value;
  446. if (isBig) {
  447. value = valueMin;
  448. }
  449. else {
  450. value = valueMax;
  451. }
  452. if (count) {
  453. count--;
  454. Tween.to(sp, { rotation: value }, time, null, Handler.create(this, () => {
  455. playLoopAnimRotation(sp, valueMin, valueMax, time, !isBig, count);
  456. }));
  457. }
  458. else {
  459. sp.rotation = 0;
  460. }
  461. }
  462. function inRect(rect, p) {
  463. if (p.x >= rect.x && p.x <= rect.x + rect.w) {
  464. if (p.y >= rect.y && p.y <= rect.y + rect.h) {
  465. return true;
  466. }
  467. }
  468. return false;
  469. }
  470. function getNumberK(number) {
  471. if (number < 1000) {
  472. return number.toString();
  473. }
  474. else {
  475. return (number / 1000).toFixed(1) + "k";
  476. }
  477. }
  478. function pointInsideCircle(point, circle, r) {
  479. if (r === 0)
  480. return false;
  481. var dx = circle.x - point.x;
  482. var dy = circle.y - point.y;
  483. return dx * dx + dy * dy <= r * r;
  484. }
  485. function formatString(str, data) {
  486. if (!str || data == undefined) {
  487. return str;
  488. }
  489. if (typeof data === "object") {
  490. for (var key in data) {
  491. if (data.hasOwnProperty(key)) {
  492. str = str.replace(new RegExp("\{" + key + "\}", "g"), data[key]);
  493. }
  494. }
  495. }
  496. else {
  497. var args = arguments, reg = new RegExp("\{([0-" + (args.length - 1) + "])\}", "g");
  498. return str.replace(reg, function (match, index) {
  499. return args[index - (-1)];
  500. });
  501. }
  502. return str;
  503. }
  504. function getIntersection(a, b) {
  505. let t = [];
  506. for (var i = 0; i < a.length; i++) {
  507. for (var j = 0; j < b.length; j++) {
  508. if (a[i] == b[j]) {
  509. t.push(a[i]);
  510. }
  511. }
  512. }
  513. return t;
  514. }
  515. function getComplement(a, b) {
  516. let t = [];
  517. let count = false;
  518. for (var i = 0; i < a.length; i++) {
  519. count = false;
  520. for (var j = 0; j < b.length; j++) {
  521. if (a[i] == b[j]) {
  522. count = true;
  523. break;
  524. }
  525. }
  526. if (!count) {
  527. t.push(a[i]);
  528. }
  529. }
  530. return t;
  531. }
  532. function geSpriteStageRect(sp) {
  533. var point = sp.localToGlobal(Laya.Point.TEMP.setTo(0, 0));
  534. let rect = {
  535. x: point.x,
  536. y: point.y,
  537. width: sp.width * sp.globalScaleX,
  538. height: sp.height * sp.globalScaleY
  539. };
  540. return rect;
  541. }
  542. function touchButton(button) {
  543. let event = new Laya.Event();
  544. button.event(Laya.Event.CLICK, event.setTo(Laya.Event.CLICK, button, button));
  545. }
  546. function setColor(sprite, r, g, b) {
  547. var redMat = [
  548. r / 255, 0, 0, 0, 0,
  549. g / 255, 0, 0, 0, 0,
  550. b / 255, 0, 0, 0, 0,
  551. 0, 0, 0, 1, 0,
  552. ];
  553. var filter = new Laya.ColorFilter(redMat);
  554. sprite.filters = [filter];
  555. }
  556. function clone(obj, newobj = {}) {
  557. for (var attr in obj) {
  558. if (typeof obj[attr] == "object") {
  559. newobj[attr] = clone(obj[attr], newobj[attr]);
  560. }
  561. else {
  562. newobj[attr] = obj[attr];
  563. }
  564. }
  565. return newobj;
  566. }
  567. function _ms(arr, compare, begin, end) {
  568. const size = end - begin;
  569. if (size <= 1) {
  570. return;
  571. }
  572. const middle = (end + begin) >> 1;
  573. _ms(arr, compare, begin, middle);
  574. _ms(arr, compare, middle, end);
  575. if (compare(arr[middle - 1], arr[middle]) <= 0) {
  576. return;
  577. }
  578. const merged = [];
  579. let leftIndex = begin, rightIndex = middle;
  580. while (merged.length < size) {
  581. if (leftIndex === middle) {
  582. merged.push(arr[rightIndex++]);
  583. }
  584. else if (rightIndex === end) {
  585. merged.push(arr[leftIndex++]);
  586. }
  587. else {
  588. const c = compare(arr[leftIndex], arr[rightIndex]);
  589. if (c <= 0) {
  590. merged.push(arr[leftIndex++]);
  591. }
  592. else {
  593. merged.push(arr[rightIndex++]);
  594. }
  595. }
  596. }
  597. arr.splice(begin, size, ...merged);
  598. }
  599. function sort(arr, compare) {
  600. if (!Array.isArray(arr)) {
  601. throw new Error('sort的参数必须为数组');
  602. }
  603. _ms(arr, compare, 0, arr.length);
  604. return arr;
  605. }
  606. function getLanguage(id) {
  607. }
  608. function getLanguageByTip(id) {
  609. }
  610. function toWeights(array) {
  611. let max = 0;
  612. for (var i = 0; i < array.length; i++) {
  613. max = max + array[i];
  614. if (array[i] == 0) {
  615. array[i] = 0;
  616. }
  617. else {
  618. array[i] = max;
  619. }
  620. }
  621. return array;
  622. }
  623. function unique(array) {
  624. var n = {}, r = [], len = array.length, val, type;
  625. for (var i = 0; i < array.length; i++) {
  626. val = array[i];
  627. type = typeof val;
  628. if (!n[val]) {
  629. n[val] = [type];
  630. r.push(val);
  631. }
  632. else if (n[val].indexOf(type) < 0) {
  633. n[val].push(type);
  634. r.push(val);
  635. }
  636. }
  637. return r;
  638. }
  639. function unique1(array) {
  640. var r = [];
  641. for (var i = 0, l = array.length; i < l; i++) {
  642. for (var j = i + 1; j < l; j++)
  643. if (array[i] == array[j])
  644. j == ++i;
  645. r.push(array[i]);
  646. }
  647. return r;
  648. }
  649. function getDistance(x1, y1, x2, y2) {
  650. return Math.pow(((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)), 0.5);
  651. }
  652. function getV2Dis(pos1, pos2) {
  653. return Math.pow(((pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y)), 0.5);
  654. }
  655. function getV2SqDis(pos1, pos2) {
  656. return (pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y);
  657. }
  658. function getDis(x1, y1, x2, y2) {
  659. return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
  660. }
  661. function getDeltaxy(x1, y1, x2, y2) {
  662. return Math.abs(x1 - x2) + Math.abs(y1 - y2);
  663. }
  664. function getSymbolNumber(num) {
  665. if (num > 0) {
  666. return "+" + num;
  667. }
  668. else if (num < 0) {
  669. return num.toString();
  670. }
  671. return num.toString();
  672. }
  673. function fixNumber(num, length) {
  674. return ('' + num).length < length ? ((new Array(length + 1)).join('0') + num).slice(-length) : '' + num;
  675. }
  676. function toThousands(num) {
  677. return num.replace(/(\d)(?=(?:\d{3})+$)/g, '$1,');
  678. }
  679. let moneyUnitStr = ["", "K", "M", "B", "T", "AK", "AM", "AB", "AT", "BK", "BM", "BB", "BT", "CK", "CM", "CB", "CT"];
  680. function fmtMoney(money) {
  681. money = toThousands(money.replace(/^0+/, ''));
  682. if (money.length == 0) {
  683. money = "0";
  684. }
  685. let unit = 0;
  686. for (var i = 0; i < money.length; i++) {
  687. if (money.charAt(i) == ",") {
  688. unit++;
  689. }
  690. }
  691. if (unit == 0) {
  692. return money;
  693. }
  694. else {
  695. let idx = money.indexOf(",");
  696. if (idx) {
  697. money = money.slice(0, idx + 2) + moneyUnitStr[unit];
  698. }
  699. return money.replace(",", ".");
  700. }
  701. }
  702. function flatten(arr) {
  703. while (arr.some(item => Array.isArray(item))) {
  704. arr = [].concat(...arr);
  705. }
  706. return arr;
  707. }
  708. function getDistanceByPoint(p1, p2) {
  709. return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
  710. }
  711. function getAngleByPoint(p1, p2) {
  712. return Math.atan2((p2.y - p1.y), (p2.x - p1.x)) * (180 / Math.PI);
  713. }
  714. function toIntByArray(array) {
  715. for (var index = 0; index < array.length; index++) {
  716. array[index] = parseInt(array[index]);
  717. }
  718. return array;
  719. }
  720. function getAngle0To360(angle) {
  721. while (angle < 0) {
  722. angle += 360;
  723. }
  724. while (angle >= 360) {
  725. angle -= 360;
  726. }
  727. return angle;
  728. }
  729. function toAngle(radian) {
  730. return radian * 180 / Math.PI;
  731. }
  732. function toRadian(angle) {
  733. return angle * Math.PI / 180;
  734. }
  735. function getArrayValueRandom(array) {
  736. return array[random(0, array.length - 1)];
  737. }
  738. function promptByTip(tipId, color = "#FFFFFF", strokeColor = null, time = 1000, fontSize = 35, opacity = 1) {
  739. }
  740. function promptByErrorCode(id, color = "#FFFFFF", strokeColor = "#FF8B00", time = 1000, fontSize = 35, opacity = 1) {
  741. }
  742. function fmtTimeMMSS(time) {
  743. if (time < 0) {
  744. time = 0;
  745. }
  746. else
  747. time = Math.floor(time);
  748. return fixNumber(Math.floor(time / 60), 2) + ":" + fixNumber(time % 60, 2);
  749. }
  750. function fmtTimeMS(time) {
  751. if (time < 0) {
  752. time = 0;
  753. }
  754. return fixNumber(Math.floor(time / 60), 2) + "m" + fixNumber(time % 60, 2) + "s";
  755. }
  756. function fmtTimeHHMM(time) {
  757. if (time < 0) {
  758. time = 0;
  759. }
  760. time = Math.floor(time / 1000);
  761. return fixNumber(Math.floor(time / 3600), 2) + ":" + fixNumber(Math.floor((time % 3600) / 60), 2) + ":" + fixNumber(Math.floor(time % 60), 2);
  762. }
  763. let severTime = 0;
  764. function getServerTime() {
  765. return new Date(new Date().getTime() - severTime);
  766. }
  767. function setServerTime(data) {
  768. severTime = (new Date().getTime() - data);
  769. }
  770. var tools = /*#__PURE__*/Object.freeze({
  771. playClickEffect: playClickEffect,
  772. getNumList: getNumList,
  773. getStrList: getStrList,
  774. getRandStr: getRandStr,
  775. getUserId: getUserId,
  776. formatPos: formatPos,
  777. setPosInt: setPosInt,
  778. random: random,
  779. randomList: randomList,
  780. worldToScreen: worldToScreen,
  781. getStringLenght: getStringLenght,
  782. reviseString: reviseString,
  783. getCoinString: getCoinString,
  784. getV3Dest: getV3Dest,
  785. getV2Dest: getV2Dest,
  786. getV2Dir: getV2Dir,
  787. getV3Dir: getV3Dir,
  788. copyPos: copyPos,
  789. getScreenImg: getScreenImg,
  790. playMoveByPositions: playMoveByPositions,
  791. setStarPos: setStarPos,
  792. playLoopAnimRotate: playLoopAnimRotate,
  793. playLoopAnimPosition: playLoopAnimPosition,
  794. playLoopAnimScale: playLoopAnimScale,
  795. playLoopAnimRotation: playLoopAnimRotation,
  796. inRect: inRect,
  797. getNumberK: getNumberK,
  798. pointInsideCircle: pointInsideCircle,
  799. formatString: formatString,
  800. getIntersection: getIntersection,
  801. getComplement: getComplement,
  802. geSpriteStageRect: geSpriteStageRect,
  803. touchButton: touchButton,
  804. setColor: setColor,
  805. clone: clone,
  806. sort: sort,
  807. getLanguage: getLanguage,
  808. getLanguageByTip: getLanguageByTip,
  809. toWeights: toWeights,
  810. unique: unique,
  811. unique1: unique1,
  812. getDistance: getDistance,
  813. getV2Dis: getV2Dis,
  814. getV2SqDis: getV2SqDis,
  815. getDis: getDis,
  816. getDeltaxy: getDeltaxy,
  817. getSymbolNumber: getSymbolNumber,
  818. fixNumber: fixNumber,
  819. toThousands: toThousands,
  820. fmtMoney: fmtMoney,
  821. flatten: flatten,
  822. getDistanceByPoint: getDistanceByPoint,
  823. getAngleByPoint: getAngleByPoint,
  824. toIntByArray: toIntByArray,
  825. getAngle0To360: getAngle0To360,
  826. toAngle: toAngle,
  827. toRadian: toRadian,
  828. getArrayValueRandom: getArrayValueRandom,
  829. promptByTip: promptByTip,
  830. promptByErrorCode: promptByErrorCode,
  831. fmtTimeMMSS: fmtTimeMMSS,
  832. fmtTimeMS: fmtTimeMS,
  833. fmtTimeHHMM: fmtTimeHHMM,
  834. getServerTime: getServerTime,
  835. setServerTime: setServerTime
  836. });
  837. class HttpMgr {
  838. constructor() {
  839. HttpMgr._instance = this;
  840. }
  841. static getInstance() {
  842. if (!this._instance) {
  843. this._instance = new HttpMgr();
  844. }
  845. return this._instance;
  846. }
  847. sendPost(url, data, call) {
  848. let httpObj = new Laya.HttpRequest();
  849. httpObj.http.timeout = 5000;
  850. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  851. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  852. httpObj.send(url, data, 'post', 'text', ["Content-Type", "application/json; charset=UTF-8"]);
  853. function errorHandler(error) {
  854. console.log("errorHandler:" + error);
  855. }
  856. function completeHandler(data) {
  857. if (data && data.length > 0) {
  858. let jsonData = JSON.parse(data);
  859. if (call)
  860. call(jsonData);
  861. }
  862. }
  863. }
  864. sendGet(url, call) {
  865. let httpObj = new Laya.HttpRequest();
  866. httpObj.http.timeout = 5000;
  867. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  868. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  869. httpObj.send(url, '', 'get');
  870. function errorHandler(error) {
  871. console.log("errorHandler:" + error);
  872. }
  873. function completeHandler(data) {
  874. if (data && data.length > 0) {
  875. if (call)
  876. call(data);
  877. }
  878. }
  879. }
  880. }
  881. HttpMgr._instance = null;
  882. class LightShader extends Laya.Sprite {
  883. constructor() {
  884. super();
  885. this._time = 0;
  886. this._sin = 0;
  887. this.initShader();
  888. }
  889. initShader() {
  890. var vs = `
  891. #define FSHIGHPRECISION
  892. attribute vec4 posuv;
  893. uniform vec2 size;
  894. varying vec4 v_texcoord;
  895. void main() {
  896. vec4 pos = vec4(posuv.xy,0.,1.);
  897. vec4 pos1 =vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,0.,1.0);
  898. gl_Position=pos1;
  899. v_texcoord.xy = posuv.xy;
  900. }
  901. `;
  902. var ps = `
  903. #define FSHIGHPRECISION
  904. precision highp float;
  905. varying vec4 v_texcoord;
  906. uniform vec2 size;
  907. uniform sampler2D texture;
  908. uniform float u_Time;
  909. void main() {
  910. vec4 color= texture2D(texture, v_texcoord.xy);
  911. float width = 0.2;
  912. float start = u_Time;
  913. float offset = 1.0;
  914. vec2 myuv = vec2(v_texcoord.x/size.x,v_texcoord.y/size.y);
  915. if( myuv.x < (start - offset * myuv.y) && myuv.x > (start - offset * myuv.y - width))
  916. {
  917. color.r=1.1;
  918. color.g=1.1;
  919. color.b=1.1;
  920. gl_FragColor = color;
  921. } else {
  922. gl_FragColor = color;
  923. }
  924. }
  925. `;
  926. this.shaderValue = new Laya.Value2D(LightShader.DissolveSurfaceSaveName, LightShader.DissolveSurfaceSaveName);
  927. this.customRenderEnable = true;
  928. this.shaderValue.shader = new Laya.Shader2X(vs, ps, LightShader.DissolveSurfaceSaveName);
  929. }
  930. customRender(context, x, y) {
  931. this.onUpdate();
  932. if (!this.texture)
  933. return;
  934. let xx = x - this.pivotX;
  935. let yy = y - this.pivotY;
  936. context.drawTarget(this.texture, xx, yy, this.width, this.height, null, this.shaderValue);
  937. }
  938. onUpdate() {
  939. this._time += 2 * Laya.timer.delta * 0.001;
  940. this._sin = Math.sin(this._time);
  941. if (this._sin > 0.99) {
  942. this._sin = 0;
  943. this._time = 0;
  944. }
  945. this.shaderValue['u_Time'] = this._sin;
  946. }
  947. }
  948. LightShader.DissolveSurfaceSaveName = 9997;
  949. class UIBase extends fairygui.Window {
  950. constructor() {
  951. super();
  952. this.isEject = true;
  953. this.isHide = true;
  954. this.showbanner = true;
  955. this.className = "";
  956. this.isMuti = false;
  957. this.showbanner = false;
  958. this.onConstructor();
  959. }
  960. checkActive(show) {
  961. }
  962. getUIName() {
  963. return UIBase.uiName;
  964. }
  965. onConstructor() {
  966. }
  967. onInit() {
  968. if (!!this.contentPane) {
  969. this.contentPane.setSize(fairygui.GRoot.inst.width, fairygui.GRoot.inst.height);
  970. }
  971. this.setPivot(0.5, 0.5, false);
  972. }
  973. doShowAnimation() {
  974. if (!this.isEject)
  975. return;
  976. super.doShowAnimation();
  977. Laya.Tween.clearTween(this);
  978. this.scaleX = this.scaleY = 0.8;
  979. let tweenFunc1 = (func) => {
  980. Laya.Tween.to(this, { scaleX: 1.1, scaleY: 1.1 }, 100, Laya.Ease.linearIn, Laya.Handler.create(this, func));
  981. };
  982. let tweenFunc2 = (func) => {
  983. Laya.Tween.to(this, { scaleX: 1, scaleY: 1 }, 60, Laya.Ease.linearOut, Laya.Handler.create(this, this.refresh));
  984. };
  985. tweenFunc1(tweenFunc2);
  986. }
  987. show(...args) {
  988. super.show();
  989. this._openParam = args;
  990. this.isHide = false;
  991. xGame.uiMgr.checkUIState();
  992. }
  993. moveBannerButton() {
  994. }
  995. showBannerButton() {
  996. this.bannerButton.visible = true;
  997. Laya.Tween.to(this.bannerButton, { alpha: 1 }, 500, Laya.Ease.linearOut, Laya.Handler.create(this, () => {
  998. this.bannerButton.touchable = true;
  999. }));
  1000. }
  1001. hide() {
  1002. super.hide();
  1003. this.isHide = true;
  1004. xGame.uiMgr.checkUIState();
  1005. }
  1006. Dispose() {
  1007. super.dispose();
  1008. }
  1009. myUpdate(delay) {
  1010. }
  1011. refresh() { }
  1012. addUIClick(obj, func, arr = null) {
  1013. obj.onClick(this, func, arr);
  1014. obj.onClick(this, this.playBtnSound);
  1015. }
  1016. offUIClick(obj, func) {
  1017. obj.offClick(this, func);
  1018. }
  1019. playBtnSound() {
  1020. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  1021. }
  1022. }
  1023. UIBase.lastShowBanner = 0;
  1024. UIBase.showBannerNum = 0;
  1025. UIBase.uiName = "";
  1026. class ui_UIDraw extends fgui.GComponent {
  1027. static createInstance() {
  1028. return (fgui.UIPackage.createObject("game", "UIDraw"));
  1029. }
  1030. onConstruct() {
  1031. this.n1 = (this.getChild("n1"));
  1032. this.extraNode = (this.getChild("extraNode"));
  1033. this.myNode = (this.getChild("myNode"));
  1034. this.closeNode = (this.getChild("closeNode"));
  1035. this.moneyNode = (this.getChild("moneyNode"));
  1036. this.n38 = (this.getChild("n38"));
  1037. this.secretary = (this.getChild("secretary"));
  1038. this.drawBtn = (this.getChild("drawBtn"));
  1039. this.talkNode = (this.getChild("talkNode"));
  1040. this.t0 = this.getTransition("t0");
  1041. }
  1042. }
  1043. ui_UIDraw.URL = "ui://isxx5ak7wcn5v4ke";
  1044. class ui_UIBox extends fgui.GComponent {
  1045. static createInstance() {
  1046. return (fgui.UIPackage.createObject("game", "UIBox"));
  1047. }
  1048. onConstruct() {
  1049. this.n0 = (this.getChild("n0"));
  1050. this.n12 = (this.getChild("n12"));
  1051. this.n1 = (this.getChild("n1"));
  1052. this.n2 = (this.getChild("n2"));
  1053. this.bar = (this.getChild("bar"));
  1054. this.closeBtn = (this.getChild("closeBtn"));
  1055. this.openBtn = (this.getChild("openBtn"));
  1056. this.t0 = this.getTransition("t0");
  1057. this.t1 = this.getTransition("t1");
  1058. }
  1059. }
  1060. ui_UIBox.URL = "ui://isxx5ak7erstv4nm";
  1061. class UIBox extends UIBase {
  1062. constructor() {
  1063. super();
  1064. this.boxNum = 0;
  1065. this.boxMax = 10;
  1066. this.inAd = false;
  1067. this.isClose = false;
  1068. }
  1069. onConstructor() {
  1070. this.ui = ui_UIBox.createInstance();
  1071. this.contentPane = this.ui;
  1072. this.isEject = false;
  1073. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  1074. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  1075. Laya.timer.loop(1000, this, this.update);
  1076. }
  1077. update() {
  1078. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  1079. this.boxNum -= 1;
  1080. this.upBar();
  1081. }
  1082. }
  1083. upBar() {
  1084. if (this.boxNum > this.boxMax)
  1085. this.boxNum = this.boxMax;
  1086. this.ui.bar.value = this.boxNum * 10;
  1087. }
  1088. show() {
  1089. super.show();
  1090. this.isClose = false;
  1091. this.boxNum = 0;
  1092. this.inAd = false;
  1093. this.upBar();
  1094. this.ui.t0.play();
  1095. this.ui.closeBtn.visible = false;
  1096. Laya.timer.once(3000, this, () => {
  1097. this.ui.closeBtn.visible = true;
  1098. this.ui.bar.alpha = 1;
  1099. });
  1100. Laya.timer.once(500, this, () => {
  1101. this.ui.t1.play();
  1102. });
  1103. }
  1104. hide() {
  1105. Laya.timer.clearAll(this);
  1106. Moyu.showBannerAd(false);
  1107. super.hide();
  1108. }
  1109. onOpenBox() {
  1110. this.boxNum++;
  1111. if (this.boxNum < this.boxMax) {
  1112. if (PlatMgr.getRand() < PlatMgr.boxInsertRate)
  1113. Moyu.showInsertAd(0, PlatMgr.insertGap);
  1114. }
  1115. else if (this.boxNum == this.boxMax) {
  1116. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  1117. this.ui.openBtn.c1.selectedIndex = 13;
  1118. this.inAd = true;
  1119. }
  1120. else
  1121. this.getAward();
  1122. }
  1123. else if (this.inAd) {
  1124. Moyu.showVideoAd(() => {
  1125. this.getAward();
  1126. }, EAdType.box);
  1127. }
  1128. this.upBar();
  1129. }
  1130. onCloseBox() {
  1131. if (this.isClose)
  1132. this.hide();
  1133. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  1134. this.isClose = true;
  1135. PlatMgr.showBanner(true, 0, 3000);
  1136. }
  1137. else
  1138. this.hide();
  1139. }
  1140. getAward() {
  1141. let str = "";
  1142. if (Math.random() < 0.5) {
  1143. let max = Moyu.isLegal ? 500 : 2500;
  1144. let num = xGame.tools.random(max, 500 + max);
  1145. DataMgr.setCoin(num);
  1146. str = "金币x" + num;
  1147. }
  1148. else {
  1149. let max = Moyu.isLegal ? 10 : 30;
  1150. let num = xGame.tools.random(max, 30 + max);
  1151. DataMgr.setDiamond(num);
  1152. str = "钻石x" + num;
  1153. }
  1154. xGame.showTip("恭喜获得-" + str);
  1155. this.hide();
  1156. }
  1157. }
  1158. UIBox.uiName = "UIBox";
  1159. class ui_UITry extends fgui.GComponent {
  1160. static createInstance() {
  1161. return (fgui.UIPackage.createObject("game", "UITry"));
  1162. }
  1163. onConstruct() {
  1164. this.n11 = (this.getChild("n11"));
  1165. this.myNode = (this.getChild("myNode"));
  1166. this.t0 = this.getTransition("t0");
  1167. }
  1168. }
  1169. ui_UITry.URL = "ui://isxx5ak7cj92v4o4";
  1170. class UITry extends UIBase {
  1171. constructor() {
  1172. super();
  1173. this.closeTime = 0;
  1174. this.closeNum = 0;
  1175. this.skillUrl = xGame.common.skillIconList;
  1176. }
  1177. onConstructor() {
  1178. this.ui = ui_UITry.createInstance();
  1179. this.contentPane = this.ui;
  1180. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  1181. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  1182. }
  1183. show() {
  1184. super.show();
  1185. this.closeNum = 0;
  1186. this.closeTime = 15;
  1187. this.ui.t0.play();
  1188. PlatMgr.showRateBanner();
  1189. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1190. Laya.timer.loop(1000, this, this.updateTime);
  1191. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  1192. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  1193. xGame.common.gameMgr.gamePause = true;
  1194. }
  1195. updateTime() {
  1196. if (this.closeTime > 1) {
  1197. this.closeTime--;
  1198. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1199. }
  1200. else
  1201. this.hide();
  1202. }
  1203. hide() {
  1204. Laya.timer.clearAll(this);
  1205. Moyu.showBannerAd(false);
  1206. super.hide();
  1207. xGame.common.gameMgr.gamePause = false;
  1208. }
  1209. onTry() {
  1210. Moyu.showVideoAd(() => {
  1211. let select = xGame.common.curPlayerSkillType;
  1212. DataMgr.gameData.trySkill = select;
  1213. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  1214. DataMgr.saveGameData();
  1215. DataMgr.setBigSkill(select, 1);
  1216. xGame.showTip("Trial Successful");
  1217. this.hide();
  1218. }, EAdType.try);
  1219. }
  1220. onCancel() {
  1221. if (this.closeNum > 0) {
  1222. this.closeNum--;
  1223. if (this.closeNum < 2)
  1224. this.hide();
  1225. return;
  1226. }
  1227. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  1228. this.onTry();
  1229. }
  1230. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  1231. this.closeNum = 3;
  1232. }
  1233. else
  1234. this.hide();
  1235. }
  1236. }
  1237. UITry.uiName = "UITry";
  1238. class PlatMgr {
  1239. static initConfig() {
  1240. this.lastVt = 0;
  1241. if (!Moyu.platConfig)
  1242. return;
  1243. for (let k in Moyu.platConfig) {
  1244. let pd = this[k];
  1245. let pc = Moyu.platConfig[k];
  1246. if (pd != undefined && pc != undefined)
  1247. this[k] = pc;
  1248. }
  1249. Moyu.setBannerPos(0.5, 1);
  1250. }
  1251. static rand100(num) {
  1252. return xGame.tools.random(0, 100) < num;
  1253. }
  1254. static isMisVideo() {
  1255. let dt = Laya.timer.currTimer - this.lastVt;
  1256. if (dt > this.forceVideoGap && this.rand100(this.forceVideoRate)) {
  1257. this.lastVt = Laya.timer.currTimer;
  1258. return true;
  1259. }
  1260. else {
  1261. if (this.rand100(this.fullVideoRate))
  1262. Moyu.showInsertAd(0, 0, 'full');
  1263. return false;
  1264. }
  1265. }
  1266. static showVideo(call, type) {
  1267. Moyu.showVideoAd(() => {
  1268. this.lastVt = Laya.timer.currTimer;
  1269. call && call();
  1270. }, type);
  1271. }
  1272. static showInsert(delay = false) {
  1273. if (this.getRand() < this.insertRate) {
  1274. let dt = delay ? this.insertDelay : 0;
  1275. Moyu.showInsertAd(dt, this.insertGap);
  1276. }
  1277. }
  1278. static gameInsert() {
  1279. if (this.getRand() < this.gameInsertRate) {
  1280. Moyu.showInsertAd(xGame.tools.random(2000, 5100), this.insertGap);
  1281. }
  1282. }
  1283. static showRateBanner() {
  1284. if (this.getRand() < this.bannerRate)
  1285. this.showBanner(true, this.bannerDelay, 3000);
  1286. }
  1287. static showBanner(show, delay = 0, hide = 0) {
  1288. if (!show)
  1289. Moyu.showBannerAd(false);
  1290. else {
  1291. Laya.timer.clear(this, this.bannerShow);
  1292. if (delay > 0)
  1293. Laya.timer.once(delay, this, this.bannerShow, [true]);
  1294. else
  1295. this.bannerShow(true);
  1296. if (hide > 0)
  1297. Laya.timer.once(hide, this, this.bannerShow, [false]);
  1298. }
  1299. }
  1300. static bannerShow(show) {
  1301. Moyu.showBannerAd(show);
  1302. console.log("showBanner" + show);
  1303. }
  1304. static getRand() {
  1305. return xGame.tools.random(0, 100);
  1306. }
  1307. static openBox() {
  1308. if (this.getRand() < this.boxRate)
  1309. xGame.uiMgr.Show(UIBox);
  1310. }
  1311. static openTry() {
  1312. if (Laya.timer.currTimer < DataMgr.gameData.tryTime)
  1313. return;
  1314. if (this.getRand() < this.tryRate)
  1315. xGame.uiMgr.Show(UITry);
  1316. else if (DataMgr.gameData.gameCount == 1)
  1317. xGame.uiMgr.Show(UITry);
  1318. }
  1319. }
  1320. PlatMgr.forceShare = 0;
  1321. PlatMgr.signAdRate = 0;
  1322. PlatMgr.forceVideoRate = 0;
  1323. PlatMgr.forceVideoGap = 0;
  1324. PlatMgr.fullVideoRate = 0;
  1325. PlatMgr.gameInsertRate = 0;
  1326. PlatMgr.insertGap = 0;
  1327. PlatMgr.insertDelay = 0;
  1328. PlatMgr.insertRate = 0;
  1329. PlatMgr.boxRate = 0;
  1330. PlatMgr.boxVideoRate = 0;
  1331. PlatMgr.boxInsertRate = 0;
  1332. PlatMgr.boxBannerRate = 0;
  1333. PlatMgr.tryRate = 0;
  1334. PlatMgr.tryClose3Rate = 0;
  1335. PlatMgr.tryVideoRate = 0;
  1336. PlatMgr.bannerRate = 0;
  1337. PlatMgr.lastVt = 0;
  1338. class ui_UIAddProp extends fgui.GComponent {
  1339. static createInstance() {
  1340. return (fgui.UIPackage.createObject("game", "UIAddProp"));
  1341. }
  1342. onConstruct() {
  1343. this.n11 = (this.getChild("n11"));
  1344. this.myNode = (this.getChild("myNode"));
  1345. this.closeBtn = (this.getChild("closeBtn"));
  1346. this.t0 = this.getTransition("t0");
  1347. }
  1348. }
  1349. ui_UIAddProp.URL = "ui://isxx5ak7p4tr42k";
  1350. class SpineMgr {
  1351. constructor(name, loadCb = null) {
  1352. this.loaded = false;
  1353. this.spineName = '';
  1354. this.loadedCallback = loadCb;
  1355. this.templet = new Laya.Templet();
  1356. this.templet.on(Laya.Event.COMPLETE, this, this.parseComplete);
  1357. this.templet.on(Laya.Event.ERROR, this, this.onError);
  1358. if (name === 'mishu') {
  1359. this.templet.loadAni('spine/mishu.sk');
  1360. }
  1361. else {
  1362. this.templet.loadAni(`spine/${name}.sk`);
  1363. }
  1364. this.templet.lock = true;
  1365. this.spineName = name;
  1366. }
  1367. onError() {
  1368. console.log("spine加载出错");
  1369. }
  1370. parseComplete() {
  1371. this.loaded = true;
  1372. this.loadedCallback && this.loadedCallback();
  1373. }
  1374. dispose() {
  1375. if (this.templet && !this.templet.destroyed) {
  1376. this.templet.destroy();
  1377. }
  1378. this.templet = null;
  1379. }
  1380. play(data, aniIndex, isLoop = true, parent, callback, mySpine = null) {
  1381. if (!this.loaded) {
  1382. return;
  1383. }
  1384. let spine;
  1385. if (mySpine) {
  1386. spine = mySpine;
  1387. }
  1388. else {
  1389. spine = this.createSpine(data, parent);
  1390. }
  1391. spine.play(aniIndex, isLoop, true, 0, 0, true);
  1392. if (!isLoop) {
  1393. spine.on(Laya.Event.STOPPED, this, () => {
  1394. spine.offAll(Laya.Event.STOPPED);
  1395. callback && callback(spine);
  1396. });
  1397. }
  1398. return spine;
  1399. }
  1400. createSpine(data, parent, type = 1) {
  1401. let spine;
  1402. spine = this.templet.buildArmature(type);
  1403. spine.showSkinByIndex(0);
  1404. parent.addChild(spine);
  1405. spine.pos(data.x, data.y);
  1406. spine.scale(data.scaleX, data.scaleY, true);
  1407. return spine;
  1408. }
  1409. }
  1410. var AIState;
  1411. (function (AIState) {
  1412. AIState[AIState["none"] = 0] = "none";
  1413. AIState[AIState["idle"] = 1] = "idle";
  1414. AIState[AIState["reset"] = 2] = "reset";
  1415. AIState[AIState["move"] = 3] = "move";
  1416. AIState[AIState["wait"] = 4] = "wait";
  1417. AIState[AIState["select"] = 5] = "select";
  1418. AIState[AIState["turn"] = 6] = "turn";
  1419. AIState[AIState["shoot"] = 7] = "shoot";
  1420. AIState[AIState["leave"] = 8] = "leave";
  1421. })(AIState || (AIState = {}));
  1422. class AIPlayer {
  1423. constructor() {
  1424. this.dtime = 30;
  1425. this.awayTime = 0;
  1426. this.awayNum = 0;
  1427. this.hideTime = 0;
  1428. this.rootMoveTime = 0;
  1429. this.isGuide = false;
  1430. this.state = AIState.none;
  1431. this.waitTime = 0;
  1432. this.forceNum = 0;
  1433. this.forceMax = 0;
  1434. this.ballSize = 33;
  1435. this.selectNum = 0;
  1436. this.destRot = 0;
  1437. this.aiLv = 10;
  1438. this.kickBall = [];
  1439. this.lineBall = [];
  1440. this.scoreBall = [];
  1441. this.holeBall = [];
  1442. this.turnNum = 0;
  1443. this.setNum = 0;
  1444. this.setMax = 0;
  1445. this.setRate = 0;
  1446. this.rectL = 0;
  1447. this.rectR = 0;
  1448. this.rectT = 0;
  1449. this.rectB = 0;
  1450. this.rootPos = { x: 0, y: 0 };
  1451. this.bestForce = 0;
  1452. this.bestAngle = 180;
  1453. this.bestPos = { x: 0, y: 0 };
  1454. this.bestKick = { x: 0, y: 0 };
  1455. this.posList = [];
  1456. this.posIdx = 0;
  1457. this.chatTime = 3000;
  1458. this.tempDir1 = new Laya.Vector2();
  1459. this.tempDir2 = new Laya.Vector2();
  1460. this.tempDir3 = new Laya.Vector2();
  1461. Laya.timer.loop(this.dtime, this, this.onUpdate);
  1462. xGame.eventMgr.off(RESET_GAME, this, this.resetAI);
  1463. xGame.eventMgr.on(RESET_GAME, this, this.resetAI);
  1464. this.gameSrc = xGame.common.gameUI;
  1465. this.hideTime = Laya.timer.currTimer;
  1466. Moyu.setOnTipCall((id) => {
  1467. if (id == 20012)
  1468. this.hideTime = Laya.timer.currTimer;
  1469. else
  1470. (id == 20011);
  1471. {
  1472. let dt = Laya.timer.currTimer - this.hideTime;
  1473. console.log("onshow" + dt);
  1474. if (dt > 30000 && this.state > AIState.none)
  1475. xGame.common.gameMgr.aiGameEnd(false);
  1476. }
  1477. }, this);
  1478. }
  1479. init() {
  1480. this.isGuide = DataMgr.getSkillGuide() < 1 || DataMgr.gameData.gameCount < 1;
  1481. this.awayTime = xGame.tools.random(5000, 10000);
  1482. this.awayNum = 0;
  1483. this.hideTime = Laya.timer.currTimer;
  1484. let rect = xGame.common.d2World.borderRect;
  1485. this.rectL = Math.ceil(rect.x) + 17;
  1486. this.rectT = Math.ceil(rect.y) + 17;
  1487. this.rectR = Math.floor(rect.x + rect.width) - 17;
  1488. this.rectB = Math.floor(rect.y + rect.height) - 17;
  1489. this.wBall = xGame.common.d2World.rootBall;
  1490. this.ballSize = this.wBall.gameObj.width - 1;
  1491. if (this.posList.length < 1) {
  1492. let dp = 40;
  1493. for (let i = this.rectL; i < this.rectR + dp; i = i + dp) {
  1494. for (let j = this.rectT; j < this.rectB + dp; j = j + dp) {
  1495. let dx = i < this.rectR ? i : this.rectR;
  1496. let dy = j < this.rectB ? j : this.rectB;
  1497. let order = xGame.tools.random(0, 1000);
  1498. this.posList.push({ x: dx, y: dy, order: order });
  1499. }
  1500. }
  1501. this.posList.sort(function (a, b) {
  1502. return a.order - b.order;
  1503. });
  1504. this.setMax = this.posList.length;
  1505. }
  1506. this.state = AIState.idle;
  1507. }
  1508. setAiLevel(num) {
  1509. this.aiLv = num;
  1510. }
  1511. initBall() {
  1512. this.rootPos.x = this.wBall.gameObj.x;
  1513. this.rootPos.y = this.wBall.gameObj.y;
  1514. this.initHoleBall();
  1515. }
  1516. initHoleBall() {
  1517. this.kickBall = [];
  1518. this.lineBall = [];
  1519. this.scoreBall = [];
  1520. this.holeBall = [];
  1521. this.selectNum = 0;
  1522. this.forceNum = 0;
  1523. this.forceMax = 0;
  1524. this.turnNum = 0;
  1525. let list = xGame.common.d2World.ballArr;
  1526. if (list.length < 20 && !this.isGuide) {
  1527. let holes = xGame.common.gameMgr.holePosList;
  1528. for (let i = 0; i < list.length; i++) {
  1529. let obj = list[i];
  1530. if (!obj)
  1531. continue;
  1532. obj.kickPos.x = 0;
  1533. obj.kickPos.y = 0;
  1534. obj.poleAngle = 0;
  1535. obj.hard = 0;
  1536. obj.borderDis = 0;
  1537. obj.kickAngle = 180;
  1538. if (obj.number == 0)
  1539. continue;
  1540. if (obj.ballType == xGame.common.gameMgr.selfCamp)
  1541. continue;
  1542. if (obj.number == 8 && xGame.common.gameMode == 0) {
  1543. if (xGame.common.gameMgr.aiBallArr.length > 0 || !xGame.common.gameMgr.ensureBallType)
  1544. continue;
  1545. }
  1546. let b = obj.gameObj;
  1547. let wbp = this.rootPos;
  1548. let bx = wbp.x - b.x;
  1549. let by = wbp.y - b.y;
  1550. obj.borderDis = xGame.tools.random(0, 100);
  1551. this.kickBall.push(obj);
  1552. if (!this.isLine(wbp, obj))
  1553. continue;
  1554. obj.kickAngle = xGame.tools.random(90, 180);
  1555. obj.kickPos.x = b.x;
  1556. obj.kickPos.y = b.y;
  1557. this.lineBall.push(obj);
  1558. let minDis = 999999;
  1559. let hole = false;
  1560. for (let j = 0; j < holes.length; j++) {
  1561. let hp = holes[j];
  1562. if (bx >= 0 && hp.x > b.x + 100)
  1563. continue;
  1564. if (bx <= 0 && hp.x < b.x - 100)
  1565. continue;
  1566. if (by < -10 && hp.y < wbp.y)
  1567. continue;
  1568. if (by > 10 && hp.y > wbp.y)
  1569. continue;
  1570. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  1571. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  1572. if (dis < minDis) {
  1573. let dx = b.x - this.tempDir1.x * this.ballSize;
  1574. let dy = b.y - this.tempDir1.y * this.ballSize;
  1575. this.tempDir3.x = this.tempDir1.x;
  1576. this.tempDir3.y = this.tempDir1.y;
  1577. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  1578. obj.kickPos.x = dx;
  1579. obj.kickPos.y = dy;
  1580. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  1581. if (num > 1)
  1582. num = 1;
  1583. obj.kickAngle = Math.acos(num) * 57.3;
  1584. if (b.x < this.rectL + 2 || b.x > this.rectR - 2 || b.y < this.rectT + 2 || b.y > this.rectB - 2)
  1585. dis = dis * 2;
  1586. if (Math.abs(hp.x - 600) < 100)
  1587. dis += 50;
  1588. obj.hard = dis + obj.kickAngle * 3;
  1589. hole = true;
  1590. }
  1591. }
  1592. }
  1593. }
  1594. if (hole) {
  1595. this.scoreBall.push(obj);
  1596. this.holeBall.push(obj);
  1597. }
  1598. }
  1599. this.scoreBall.sort(function (a, b) {
  1600. return a.hard - b.hard;
  1601. });
  1602. this.holeBall.sort(function (a, b) {
  1603. return a.kickAngle - b.kickAngle;
  1604. });
  1605. this.kickBall.sort(function (a, b) {
  1606. return a.borderDis - b.borderDis;
  1607. });
  1608. }
  1609. else {
  1610. let max = list.length - 1;
  1611. let i = xGame.tools.random(0, max);
  1612. for (i; i <= max; i++) {
  1613. let idx = i >= max ? i -= max : i;
  1614. let obj = list[idx];
  1615. if (obj && obj.number != 0) {
  1616. obj.kickAngle = xGame.tools.random(90, 180);
  1617. obj.kickPos.x = obj.gameObj.x + xGame.tools.random(-10, 10);
  1618. obj.kickPos.y = obj.gameObj.y + xGame.tools.random(-10, 10);
  1619. this.lineBall.push(obj);
  1620. break;
  1621. }
  1622. }
  1623. }
  1624. }
  1625. selectBall() {
  1626. let ball = null;
  1627. this.destRot = 0;
  1628. let max = this.isGuide ? 1 : 3 - Math.ceil(this.aiLv / 4) + xGame.tools.random(0, 2);
  1629. let ai = 110 - this.aiLv * 10;
  1630. let mis = xGame.tools.random(-ai, ai) * 0.005;
  1631. let score = false;
  1632. if (this.scoreBall.length < 1) {
  1633. if (this.lineBall.length < 1) {
  1634. for (let i = 0; i < this.kickBall.length; i++) {
  1635. let list = [];
  1636. let bo = this.kickBall[i];
  1637. let bobj = bo.gameObj;
  1638. let rect = xGame.common.d2World.borderRect;
  1639. let mobj = this.wBall.gameObj;
  1640. let minb = bobj.y - rect.y - 20;
  1641. let minw = mobj.y - rect.y - 50;
  1642. if (minb > 0 && minw > 0) {
  1643. let dlenx = 0;
  1644. let dleny = mobj.y - rect.y;
  1645. let spx = mobj.x;
  1646. let spy = rect.y - dleny;
  1647. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1648. }
  1649. minb = rect.y + rect.height - bobj.y - 20;
  1650. minw = rect.y + rect.height - mobj.y - 50;
  1651. if (minb > 0 && minw > 0) {
  1652. let dlenx = 0;
  1653. let dleny = rect.y + rect.height - mobj.y;
  1654. let spx = mobj.x;
  1655. let spy = rect.y + rect.height + dleny;
  1656. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1657. }
  1658. minb = bobj.x - rect.x - 20;
  1659. minw = mobj.x - rect.x - 50;
  1660. if (minb > 0 && minw > 0) {
  1661. let dlenx = mobj.x - rect.x;
  1662. let dleny = 0;
  1663. let spx = rect.x - dlenx;
  1664. let spy = mobj.y;
  1665. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1666. }
  1667. minb = rect.x + rect.width - bobj.x - 20;
  1668. minw = rect.x + rect.width - mobj.x - 50;
  1669. if (minb > 0 && minw > 0) {
  1670. let dlenx = rect.x + rect.width - mobj.x;
  1671. let dleny = 0;
  1672. let spx = rect.x + rect.width + dlenx;
  1673. let spy = mobj.y;
  1674. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1675. }
  1676. list.sort(function (a, b) {
  1677. return a.order - b.order;
  1678. });
  1679. for (let i = 0; i < list.length; i++) {
  1680. let data = list[i];
  1681. let mx = mobj.x - bobj.x;
  1682. let my = mobj.y - bobj.y;
  1683. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  1684. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  1685. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1686. if (num > 1)
  1687. num = 1;
  1688. let cos = Math.acos(num);
  1689. if (cos > 1.57)
  1690. cos = 1.57;
  1691. else if (cos < 0.01)
  1692. cos = 0.01;
  1693. let tan = Math.tan(cos);
  1694. let dx = tan * data.dleny;
  1695. let dy = tan * data.dlenx;
  1696. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  1697. if (Math.abs(bx - 667) < 40)
  1698. continue;
  1699. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  1700. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  1701. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  1702. this.forceMax = dis * 0.08;
  1703. this.destRot += mis * 0.1;
  1704. this.setKick(bx, by);
  1705. return true;
  1706. }
  1707. }
  1708. }
  1709. }
  1710. else {
  1711. ball = xGame.common.getRandArrEle(this.lineBall);
  1712. }
  1713. }
  1714. else {
  1715. for (let i = 0; i < this.scoreBall.length; i++) {
  1716. if (i < this.scoreBall.length - 1) {
  1717. let rand = 70 + this.aiLv * 10 + i * 10;
  1718. if (xGame.tools.random(0, 100) < rand) {
  1719. ball = this.scoreBall[i];
  1720. break;
  1721. }
  1722. }
  1723. else {
  1724. ball = this.scoreBall[i];
  1725. break;
  1726. }
  1727. }
  1728. score = true;
  1729. this.selectNum++;
  1730. }
  1731. if (!ball)
  1732. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  1733. if (this.selectNum >= max) {
  1734. let dx = ball.gameObj.x;
  1735. let dy = ball.gameObj.y;
  1736. let kickAngle = 0;
  1737. if (score) {
  1738. dx = ball.kickPos.x;
  1739. dy = ball.kickPos.y;
  1740. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  1741. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  1742. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  1743. if (adot > 1)
  1744. adot = 1;
  1745. kickAngle = Math.acos(adot) * 57.3;
  1746. if (kickAngle > 45) {
  1747. let kdx = ball.kickPos.x - ball.gameObj.x;
  1748. let kdy = ball.kickPos.y - ball.gameObj.y;
  1749. dx = ball.kickPos.x - kdx * mis * 0.3;
  1750. dy = ball.kickPos.y - kdy * mis * 0.3;
  1751. }
  1752. else
  1753. this.destRot += mis;
  1754. }
  1755. else if (ball.poleAngle != 0) {
  1756. this.destRot += ball.poleAngle;
  1757. }
  1758. if (xGame.common.gameMode == 0) {
  1759. let af = kickAngle * 0.08;
  1760. this.forceMax = ball.hard * 0.1 + af * af;
  1761. }
  1762. this.setKick(dx, dy);
  1763. }
  1764. else {
  1765. let rand = this.aiLv * 5 + 40;
  1766. if (xGame.tools.random(0, 100) < rand && this.scoreBall.length > 0)
  1767. ball = xGame.common.getRandArrEle(this.scoreBall);
  1768. else
  1769. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  1770. rand = this.aiLv * 3 + 40 + this.selectNum * 20;
  1771. if (xGame.tools.random(0, 100) > rand) {
  1772. this.selectNum = max;
  1773. }
  1774. this.setState(AIState.select, xGame.tools.random(500, 1000));
  1775. this.selectNum++;
  1776. }
  1777. ball.onClick(0, true);
  1778. }
  1779. isBlock(bn, bx, by, hx, hy, dn = -1) {
  1780. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  1781. let balls = xGame.common.d2World.ballArr;
  1782. let max = xGame.tools.getDis(hx, hy, bx, by);
  1783. for (let index = 0; index < balls.length; index++) {
  1784. let obj = balls[index];
  1785. if (obj.number == 0)
  1786. continue;
  1787. if (obj.number == bn || obj.number == dn)
  1788. continue;
  1789. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  1790. if (dis * dis > max)
  1791. continue;
  1792. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  1793. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1794. if (num > 1)
  1795. num = 1;
  1796. if (num < 0)
  1797. continue;
  1798. let gap = Math.sin(Math.acos(num)) * dis;
  1799. if (gap < this.ballSize)
  1800. return true;
  1801. }
  1802. return false;
  1803. }
  1804. isLine(xy, ball) {
  1805. let bx = xy.x;
  1806. let by = xy.y;
  1807. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  1808. let dis = ball.getDestDis(xy);
  1809. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  1810. let sin = Math.sin(angle);
  1811. let cos = Math.cos(angle);
  1812. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  1813. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  1814. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  1815. let dx = bx + this.tempDir2.x * dis;
  1816. let dy = by + this.tempDir2.y * dis;
  1817. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  1818. sin = Math.sin(-angle);
  1819. cos = Math.cos(-angle);
  1820. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  1821. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  1822. dx = bx + this.tempDir2.x * dis;
  1823. dy = by + this.tempDir2.y * dis;
  1824. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  1825. if (isr && isl)
  1826. return false;
  1827. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  1828. }
  1829. return true;
  1830. }
  1831. turnPole() {
  1832. this.turnNum++;
  1833. let rot = xGame.common.d2World.d2Gan.ui.rotation % 360;
  1834. let dr = rot - this.destRot;
  1835. let abs = Math.abs(dr) % 360;
  1836. if (abs > 180) {
  1837. if (rot > 180)
  1838. rot -= 360;
  1839. if (this.destRot > 180)
  1840. this.destRot -= 360;
  1841. }
  1842. let max = this.turnNum * 5 + this.aiLv * 5;
  1843. if (abs < 0.2 && xGame.tools.random(0, 100) < max) {
  1844. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  1845. let at = xGame.tools.random(1000, 2000);
  1846. if (!this.onAway(3))
  1847. at += xGame.tools.random(10000, 15000);
  1848. this.setState(AIState.shoot, at);
  1849. }
  1850. else {
  1851. let mr = 0;
  1852. if (abs > 3)
  1853. mr = 1 + xGame.tools.random(2, 6) * abs * 0.01;
  1854. else if (Math.random() > 0.6)
  1855. mr = xGame.tools.random(1, 10) * 0.1;
  1856. mr = dr > 0 ? -mr : mr;
  1857. xGame.common.d2World.d2Gan.rotDest(rot + mr);
  1858. }
  1859. }
  1860. setKick(dx, dy) {
  1861. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  1862. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  1863. this.tempDir1.x = 0;
  1864. this.tempDir1.y = 1;
  1865. this.tempDir2.y = -this.tempDir2.y;
  1866. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1867. if (num > 1)
  1868. num = 1;
  1869. let rot = Math.acos(num) * 57.3;
  1870. if (this.tempDir2.x < 0)
  1871. rot = 360 - rot;
  1872. this.destRot += rot;
  1873. if (!xGame.common.gameMgr.finishOneShoot) {
  1874. this.forceMax += xGame.tools.random(10, 50);
  1875. this.forceMax -= this.aiLv * 2;
  1876. if (this.forceMax < 20)
  1877. this.forceMax = 20;
  1878. }
  1879. if (this.forceMax > 100)
  1880. this.forceMax = 101;
  1881. else if (this.forceMax < 10)
  1882. this.forceMax += xGame.tools.random(0, 10);
  1883. if (xGame.common.gameMode == 1)
  1884. this.forceMax = xGame.tools.random(80, 100);
  1885. else
  1886. this.forceMax = xGame.tools.random(this.forceMax * 0.5, this.forceMax);
  1887. let max = 2000 - this.aiLv * 100;
  1888. if (Math.random() > 0.8)
  1889. max += xGame.tools.random(100, 2000);
  1890. this.setState(AIState.turn, xGame.tools.random(500, max));
  1891. }
  1892. shoot() {
  1893. if (this.waitTime < 0 && Math.abs(this.forceNum - this.forceMax) < 4) {
  1894. if (Math.random() > 0.8) {
  1895. this.gameSrc.aiForce(1);
  1896. this.setState(AIState.wait);
  1897. }
  1898. }
  1899. else {
  1900. let df = xGame.tools.random(3, 8);
  1901. if (this.forceNum < this.forceMax)
  1902. this.forceNum += df;
  1903. else
  1904. this.forceNum -= df;
  1905. let startY = this.gameSrc.ui.powerNode.y;
  1906. let height = this.gameSrc.ui.powerNode.height;
  1907. let force = startY + height * this.forceNum * 0.01;
  1908. this.gameSrc.aiForce(2, force);
  1909. }
  1910. }
  1911. reset() {
  1912. for (let i = 0; i < 4; i++) {
  1913. this.setRate--;
  1914. this.setNum++;
  1915. let pos = this.posList[this.posIdx];
  1916. this.rootPos.x = pos.x + xGame.tools.random(-20, 20);
  1917. this.rootPos.y = pos.y + xGame.tools.random(-20, 20);
  1918. if (!xGame.common.gameMgr.isTouchedBall && this.rootPos.x > 387)
  1919. this.rootPos.x = 387;
  1920. if (this.rootPos.x < this.rectL)
  1921. this.rootPos.x = this.rectL;
  1922. else if (this.rootPos.x > this.rectR)
  1923. this.rootPos.x = this.rectR;
  1924. if (this.rootPos.y < this.rectT)
  1925. this.rootPos.y = this.rectT;
  1926. else if (this.rootPos.y > this.rectB)
  1927. this.rootPos.y = this.rectB;
  1928. this.posIdx++;
  1929. let max = this.posList.length;
  1930. if (this.posIdx >= max)
  1931. this.posIdx -= max;
  1932. this.initHoleBall();
  1933. let ball = null;
  1934. if (this.scoreBall.length > 0)
  1935. ball = this.scoreBall[0];
  1936. else if (this.lineBall.length > 0)
  1937. ball = xGame.common.getRandArrEle(this.lineBall);
  1938. if (ball && ball.kickAngle < this.bestAngle) {
  1939. this.bestAngle = ball.kickAngle;
  1940. this.bestKick.x = ball.kickPos.x;
  1941. this.bestKick.y = ball.kickPos.y;
  1942. this.bestPos.x = this.rootPos.x;
  1943. this.bestPos.y = this.rootPos.y;
  1944. this.bestForce = ball.hard * 0.08;
  1945. }
  1946. }
  1947. if (this.setNum >= this.setMax)
  1948. this.setMax = 0;
  1949. if (this.setRate < 1) {
  1950. this.setState(AIState.move, 0);
  1951. this.rootMoveTime = Laya.timer.currTimer;
  1952. this.gameSrc.aiRootMove(true);
  1953. }
  1954. }
  1955. delayLine() {
  1956. this.gameSrc.aiRootMove(false);
  1957. }
  1958. move() {
  1959. if (this.bestPos.x < 1)
  1960. this.bestPos = this.rootPos;
  1961. let wObj = this.wBall.gameObj;
  1962. let destx = wObj.x;
  1963. let desty = wObj.y;
  1964. let dx = Math.abs(destx - this.bestPos.x);
  1965. let dy = Math.abs(desty - this.bestPos.y);
  1966. let mx = 3 + dx * 0.03;
  1967. let my = 3 + dy * 0.03;
  1968. if (dx < 4 && dy < 4) {
  1969. let dt = Laya.timer.currTimer - this.rootMoveTime;
  1970. dt = dt < 1000 ? 1000 - dt : 0;
  1971. if (this.setMax > 0) {
  1972. let min = this.setMax * 0.3 + this.aiLv * 5;
  1973. this.setRate = xGame.tools.random(min, this.setMax);
  1974. this.setState(AIState.reset, 0);
  1975. }
  1976. else {
  1977. this.destRot = 0;
  1978. this.forceMax = this.bestForce;
  1979. this.setKick(this.bestKick.x, this.bestKick.y);
  1980. }
  1981. if (dt > 100) {
  1982. Laya.timer.clear(this, this.delayLine);
  1983. Laya.timer.once(dt, this, this.delayLine);
  1984. }
  1985. else
  1986. this.gameSrc.aiRootMove(false);
  1987. }
  1988. else {
  1989. if (dx > 4)
  1990. destx = wObj.x < this.bestPos.x ? wObj.x + mx : wObj.x - mx;
  1991. if (dy > 4)
  1992. desty = wObj.y < this.bestPos.y ? wObj.y + my : wObj.y - my;
  1993. this.gameSrc.onRootMove({ x: destx, y: desty });
  1994. }
  1995. }
  1996. resetRoot() {
  1997. this.bestAngle = 180;
  1998. this.bestForce = 0;
  1999. this.setMax = this.posList.length;
  2000. this.posIdx = xGame.tools.random(0, this.setMax);
  2001. let min = this.setMax * 0.3 + this.aiLv * 5;
  2002. this.setRate = xGame.tools.random(min, this.setMax);
  2003. let max = 2000 - this.aiLv * 100;
  2004. if (Math.random() > 0.8)
  2005. max += xGame.tools.random(100, 1000);
  2006. if (this.isGuide)
  2007. this.setState(AIState.select, 500);
  2008. else if (this.onAway(2))
  2009. this.setState(AIState.reset, xGame.tools.random(400, max));
  2010. else
  2011. this.setState(AIState.none);
  2012. if (xGame.common.gameMgr.finishOneShoot)
  2013. this.chat();
  2014. }
  2015. runAI() {
  2016. if (this.state > AIState.idle)
  2017. return;
  2018. this.initBall();
  2019. this.onGame(2500);
  2020. if (Math.random() > 0.6)
  2021. this.chat();
  2022. }
  2023. stopRun() {
  2024. this.setState(AIState.idle);
  2025. }
  2026. onGame(base) {
  2027. let max = base - this.aiLv * 100;
  2028. if (Math.random() > 0.8)
  2029. max += xGame.tools.random(100, 1000);
  2030. if (this.onAway(2))
  2031. this.setState(AIState.select, xGame.tools.random(500, max));
  2032. else
  2033. this.setState(AIState.none);
  2034. }
  2035. setState(sta, wt = 0) {
  2036. if (this.state == AIState.none)
  2037. return;
  2038. this.state = sta;
  2039. this.waitTime = wt;
  2040. }
  2041. onUpdate() {
  2042. if (this.state == AIState.none)
  2043. return;
  2044. this.awayTime -= this.dtime;
  2045. if (this.awayTime < 1) {
  2046. this.awayTime = xGame.tools.random(6000, 10000);
  2047. this.awayNum += (11 - this.aiLv);
  2048. this.onAway(1);
  2049. }
  2050. if (this.waitTime >= 0) {
  2051. this.waitTime -= this.dtime;
  2052. return;
  2053. }
  2054. switch (this.state) {
  2055. case AIState.idle:
  2056. this.chat();
  2057. break;
  2058. case AIState.reset:
  2059. this.reset();
  2060. break;
  2061. case AIState.move:
  2062. this.move();
  2063. break;
  2064. case AIState.leave:
  2065. this.state = AIState.none;
  2066. xGame.common.gameMgr.aiGameEnd(true);
  2067. break;
  2068. case AIState.select:
  2069. this.selectBall();
  2070. break;
  2071. case AIState.turn:
  2072. this.turnPole();
  2073. break;
  2074. case AIState.shoot:
  2075. this.shoot();
  2076. break;
  2077. }
  2078. }
  2079. onAway(type) {
  2080. if (type == 1) {
  2081. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2082. let num = this.awayNum + db * 20;
  2083. if (db > 0 && num > 0 && xGame.tools.random(0, 10000) < num && this.state == AIState.idle) {
  2084. xGame.common.gameMgr.aiLeave();
  2085. this.setState(AIState.leave, 6666);
  2086. }
  2087. }
  2088. else if (type == 2) {
  2089. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2090. let num = this.awayNum + db * 30;
  2091. if (xGame.tools.random(0, 10000) < num)
  2092. return false;
  2093. }
  2094. else if (type == 3) {
  2095. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2096. let num = this.awayNum + db * 10;
  2097. if (xGame.tools.random(0, 4000) < num)
  2098. return false;
  2099. }
  2100. return true;
  2101. }
  2102. chat() {
  2103. if (this.chatTime > 0) {
  2104. this.chatTime -= this.dtime;
  2105. return;
  2106. }
  2107. this.chatTime = xGame.tools.random(2000, 10000);
  2108. let rand = xGame.tools.random(0, 100);
  2109. if (rand < 15)
  2110. this.talk();
  2111. else if (rand < 35)
  2112. this.emotion();
  2113. }
  2114. talk() {
  2115. xGame.common.talkMgr.showAITalk(0);
  2116. }
  2117. emotion() {
  2118. xGame.common.talkMgr.showAIEmotion(0);
  2119. }
  2120. resetAI() {
  2121. this.stopRun();
  2122. this.state = AIState.none;
  2123. }
  2124. }
  2125. class Partical extends Laya.Script3D {
  2126. constructor() {
  2127. super();
  2128. this.duration = 2000;
  2129. }
  2130. ;
  2131. onAwake() {
  2132. this.gameObj = this.owner;
  2133. }
  2134. onEnable() {
  2135. this.openTimer();
  2136. }
  2137. openTimer() {
  2138. Laya.timer.once(this.duration, this, this.disappear);
  2139. }
  2140. setCallback(obj, callback) {
  2141. this.obj = obj;
  2142. this.callback = callback;
  2143. Laya.timer.clearAll(this);
  2144. Laya.timer.once(this.duration, this, this.disappear);
  2145. }
  2146. disappear() {
  2147. xGame.poolD3Mgr.putItem(this.gameObj.name, this.gameObj);
  2148. this.callback && this.callback(this.obj);
  2149. }
  2150. }
  2151. class Ball extends Laya.Script3D {
  2152. constructor() {
  2153. super();
  2154. this.posV3 = new Laya.Vector3();
  2155. this.rotRate = 2.1;
  2156. this.rotSpeed = new Laya.Vector3();
  2157. this.myIndex = 0;
  2158. }
  2159. onAwake() {
  2160. this.gameObj = this.owner;
  2161. this.transform = this.gameObj.transform;
  2162. this.ballNode = this.gameObj.getChildByName("Ball");
  2163. this.shadowNode = this.gameObj.getChildByName("shadow");
  2164. }
  2165. initSelf(index, x, y, owner) {
  2166. this.d2BallSrc = owner;
  2167. this.myIndex = index;
  2168. this.setAlbedoTexture();
  2169. this.setTransPos(x, y);
  2170. this.setScale();
  2171. this.ballNode.transform.localRotationEulerX = 90;
  2172. if (index == 0) {
  2173. }
  2174. }
  2175. setAlbedoTexture(isIce = false) {
  2176. let url;
  2177. if (isIce) {
  2178. url = `res/d3Res/ballTexture/ice.jpg`;
  2179. }
  2180. else {
  2181. url = `res/d3Res/ballTexture/ball${this.myIndex}.png`;
  2182. }
  2183. Laya.Texture2D.load(url, Laya.Handler.create(this, (tex) => {
  2184. this.ballNode.meshRenderer.material["albedoTexture"] = tex;
  2185. }));
  2186. }
  2187. runFireworks(obj, delay, callback) {
  2188. Laya.timer.clearAll(this);
  2189. Laya.timer.once(delay + 1, this, () => {
  2190. let fire = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  2191. fire.transform.localPositionX = this.transform.localPositionX;
  2192. fire.transform.localPositionY = this.transform.localPositionY;
  2193. fire.transform.localPositionZ = this.transform.localPositionZ;
  2194. let src = fire.getComponent(Partical);
  2195. src.duration = 1000;
  2196. src.setCallback(obj, callback);
  2197. let eft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  2198. eft.transform.localPositionX = this.transform.localPositionX;
  2199. eft.transform.localPositionY = this.transform.localPositionY;
  2200. eft.transform.localPositionZ = this.transform.localPositionZ;
  2201. });
  2202. }
  2203. setTransPos(x, y) {
  2204. this.setRotation();
  2205. xGame.common.pos2to3Convert(x, y, this.posV3);
  2206. this.transform.localPositionX = this.posV3.x;
  2207. this.transform.localPositionY = 0;
  2208. this.transform.localPositionZ = this.posV3.z;
  2209. this.transform.localRotationEulerX = 0;
  2210. this.transform.localRotationEulerY = 0;
  2211. this.transform.localRotationEulerZ = 0;
  2212. this.shadowNode.transform.localPositionX = this.posV3.x / 30;
  2213. this.shadowNode.transform.localPositionY = 0.1;
  2214. this.shadowNode.transform.localPositionZ = this.posV3.z / 30;
  2215. }
  2216. setRotation() {
  2217. if (this.d2BallSrc.canRot) {
  2218. let speed = this.d2BallSrc.rigy.linearVelocity;
  2219. this.rotSpeed.x = speed.x * this.rotRate;
  2220. this.rotSpeed.z = speed.y * this.rotRate;
  2221. this.rotSpeed.y = this.d2BallSrc.rotY;
  2222. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2223. }
  2224. else if (Math.abs(this.d2BallSrc.rotY) > 0.1) {
  2225. this.rotSpeed.x = this.rotSpeed.y = 0;
  2226. this.rotSpeed.y = this.d2BallSrc.rotY;
  2227. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2228. }
  2229. }
  2230. setScale() {
  2231. let radius = xGame.common.d2World.rootBall.ui.width;
  2232. let scale = xGame.common.scale2to3Convert(radius);
  2233. this.transform.localScaleX = scale;
  2234. this.transform.localScaleY = scale;
  2235. this.transform.localScaleZ = scale;
  2236. }
  2237. playInHoleEft() {
  2238. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  2239. eft.transform.position = this.transform.position;
  2240. }
  2241. playIceEft() {
  2242. let eft = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  2243. eft.transform.position = this.transform.position;
  2244. }
  2245. get scaleXYZ() {
  2246. return this.transform.localScaleX;
  2247. }
  2248. set scaleXYZ(val) {
  2249. this.transform.localScaleX = val;
  2250. this.transform.localScaleY = val;
  2251. this.transform.localScaleZ = val;
  2252. }
  2253. get posX() {
  2254. return this.transform.localPositionX;
  2255. }
  2256. set posX(val) {
  2257. this.transform.localPositionX = val;
  2258. }
  2259. get posY() {
  2260. return this.transform.localPositionY;
  2261. }
  2262. set posY(val) {
  2263. this.transform.localPositionY = val;
  2264. }
  2265. get posZ() {
  2266. return this.transform.localPositionZ;
  2267. }
  2268. set posZ(val) {
  2269. this.transform.localPositionZ = val;
  2270. }
  2271. destroySelf() {
  2272. this.posV3 = null;
  2273. this.rotSpeed = null;
  2274. this.d2BallSrc = null;
  2275. this.ballNode = null;
  2276. this.gameObj.destroy(true);
  2277. this.transform = null;
  2278. this.destroy();
  2279. }
  2280. }
  2281. class ui_D2Ball extends fgui.GComponent {
  2282. static createInstance() {
  2283. return (fgui.UIPackage.createObject("game", "D2Ball"));
  2284. }
  2285. onConstruct() {
  2286. this.myIcon = (this.getChild("myIcon"));
  2287. this.inner = (this.getChild("inner"));
  2288. this.n8 = (this.getChild("n8"));
  2289. this.n4 = (this.getChild("n4"));
  2290. this.wrongTips = (this.getChild("wrongTips"));
  2291. this.rightTips = (this.getChild("rightTips"));
  2292. this.breathAni = this.getTransition("breathAni");
  2293. }
  2294. }
  2295. ui_D2Ball.URL = "ui://isxx5ak7kt443qi";
  2296. class D2BallSrc extends Laya.Script {
  2297. constructor() {
  2298. super();
  2299. this.number = 0;
  2300. this.startX = 0;
  2301. this.startY = 0;
  2302. this.angleV2 = new Laya.Vector2();
  2303. this.isRootBall = false;
  2304. this.isBlackBall = false;
  2305. this.ballType = "";
  2306. this.canRot = true;
  2307. this.rotY = 0;
  2308. this.poleAngle = 0;
  2309. this.kickPos = { x: 0, y: 0 };
  2310. this.hard = 0;
  2311. this.kickAngle = 0;
  2312. this.borderDis = 0;
  2313. this.speedP10 = 5.6;
  2314. this.lastSpeed = { x: 0, y: 0 };
  2315. this.stillSpeed = 0.12;
  2316. this.ballFunc = "normal";
  2317. this.isRunSkillAni = false;
  2318. this.isInHole = false;
  2319. this.iceOwner = "";
  2320. this.forceRun = false;
  2321. this.myUNID = "";
  2322. this.rectL = 0;
  2323. this.rectR = 0;
  2324. this.rectT = 0;
  2325. this.rectB = 0;
  2326. this.forceVec = new Laya.Vector2();
  2327. this.lastDis = 0;
  2328. this.helpOut = { type: "", x: 0, y: 0 };
  2329. }
  2330. initSelf(number, x, y, d3Ball) {
  2331. if (!this.gameObj)
  2332. this.gameObj = this.owner;
  2333. this.number = number;
  2334. this.startX = x;
  2335. this.startY = y;
  2336. this.d3Ball = d3Ball;
  2337. this.isRootBall = false;
  2338. this.isBlackBall = false;
  2339. this.ballType = "";
  2340. if (number == 0) {
  2341. this.isRootBall = true;
  2342. }
  2343. else if (number == 8) {
  2344. this.isBlackBall = true;
  2345. }
  2346. else {
  2347. if (number <= 7) {
  2348. this.ballType = ballCamp.full;
  2349. }
  2350. else {
  2351. this.ballType = ballCamp.flower;
  2352. }
  2353. }
  2354. this.setInfo();
  2355. this.setD3Ball();
  2356. this.owner["mySrc"] = this;
  2357. this.rigy.linearDamping = 1;
  2358. D2BallSrc._unid++;
  2359. this.myUNID = "d2ball" + D2BallSrc._unid;
  2360. let rect = xGame.common.d2World.borderRect;
  2361. this.rectL = Math.ceil(rect.x) + 20;
  2362. this.rectT = Math.ceil(rect.y) + 20;
  2363. this.rectR = Math.floor(rect.x + rect.width) - 20;
  2364. this.rectB = Math.floor(rect.y + rect.height) - 20;
  2365. }
  2366. setInfo() {
  2367. this.gameObj.x = this.startX;
  2368. this.gameObj.y = this.startY;
  2369. let radius = this.ui.width / 2;
  2370. this.gameObj.width = radius * 2;
  2371. this.gameObj.height = radius * 2;
  2372. if (xGame.common.showDebug) {
  2373. this.ui.myIcon.alpha = 1;
  2374. this.ui.inner.alpha = 1;
  2375. }
  2376. else {
  2377. this.ui.myIcon.alpha = 0;
  2378. this.ui.inner.alpha = 0;
  2379. }
  2380. }
  2381. setD3Ball() {
  2382. this.d3Ball = this.d3Ball;
  2383. this.d3BallSrc = this.d3Ball.getComponent(Ball);
  2384. this.d3BallSrc.initSelf(this.number, this.startX, this.startY, this);
  2385. }
  2386. onUpdate() {
  2387. if (xGame.common.gameMgr.gamePause)
  2388. return;
  2389. if (this.isInHole)
  2390. return;
  2391. if (!xGame.common.d2World.openCheckStill)
  2392. return;
  2393. this.runBall();
  2394. }
  2395. runBall() {
  2396. this.lastSpeed.x = this.rigy.linearVelocity.x;
  2397. this.lastSpeed.y = this.rigy.linearVelocity.y;
  2398. this.d3BallSrc.setTransPos(this.gameObj.x, this.gameObj.y);
  2399. this.judgeBorder();
  2400. }
  2401. getDestDis(dest) {
  2402. return xGame.tools.getDistance(dest.x, dest.y, this.gameObj.x, this.gameObj.y);
  2403. }
  2404. setmyXY(x, y) {
  2405. this.d3BallSrc.setTransPos(x, y);
  2406. }
  2407. getSpeed() {
  2408. let speed = this.rigy.linearVelocity;
  2409. return speed.x * speed.x + speed.y * speed.y;
  2410. }
  2411. onTriggerEnter(collider) {
  2412. if (!collider || !collider.owner)
  2413. return;
  2414. let coll = "collide";
  2415. let speed = this.getSpeed();
  2416. let sv2 = this.speedP10 * this.speedP10;
  2417. if (collider.label == "ball") {
  2418. if (speed < 9 && this.number != 0)
  2419. coll = "";
  2420. else if (speed < sv2)
  2421. coll = "collide_4";
  2422. else if (speed < sv2 * 6.2)
  2423. coll = "collide_3";
  2424. else if (speed < sv2 * 25)
  2425. coll = "collide_2";
  2426. else if (speed < sv2 * 56)
  2427. coll = "collide_1";
  2428. xGame.soundMgr.playSound(coll);
  2429. if (this.gameObj.x < this.rectL || this.gameObj.x > this.rectR || this.gameObj.y < this.rectT || this.gameObj.y > this.rectB) {
  2430. if (collider.owner) {
  2431. let rig = collider.owner.getComponent(D2BallSrc);
  2432. if (Math.abs(rig.rigy.linearVelocity.x) > 0)
  2433. rig.lastSpeed.x = rig.rigy.linearVelocity.x;
  2434. if (Math.abs(rig.rigy.linearVelocity.y) > 0)
  2435. rig.lastSpeed.y = rig.rigy.linearVelocity.y;
  2436. let vx = Math.abs(rig.lastSpeed.x * 0.4);
  2437. let vy = Math.abs(rig.lastSpeed.y * 0.5);
  2438. let rx = 0;
  2439. let ry = 0;
  2440. if (this.gameObj.x < this.rectL)
  2441. rx = vx;
  2442. else if (this.gameObj.x > this.rectR)
  2443. rx = -vx;
  2444. else if (this.gameObj.y < this.rectT)
  2445. ry = vy;
  2446. else if (this.gameObj.y > this.rectB)
  2447. ry = -vy;
  2448. this.rigy.applyLinearImpulseToCenter({ x: rx, y: ry });
  2449. }
  2450. }
  2451. if (this.number != 0) {
  2452. return;
  2453. }
  2454. else {
  2455. if (this.forceRun) {
  2456. console.log("randon force");
  2457. this.applyForce(collider);
  2458. }
  2459. }
  2460. if (xGame.common.d2World.isOnSameLine) {
  2461. xGame.common.d2World.isOnSameLine = false;
  2462. this.rigy.linearVelocity = { x: 0, y: 0 };
  2463. }
  2464. if (xGame.common.gameMgr.firstColliObj == null) {
  2465. xGame.common.gameMgr.firstColliObj = collider.owner["mySrc"].number;
  2466. xGame.common.gameMgr.isTouchedBall = true;
  2467. }
  2468. }
  2469. else {
  2470. xGame.common.recoverCameraView();
  2471. let wallStr = "";
  2472. if (speed < 9) { }
  2473. else if (speed < sv2) { }
  2474. else if (speed < sv2 * 6.2)
  2475. wallStr = "wall_30";
  2476. else if (speed < sv2 * 25)
  2477. wallStr = "wall_50";
  2478. else if (speed < sv2 * 56)
  2479. wallStr = "wall_80";
  2480. xGame.soundMgr.playSound(wallStr);
  2481. }
  2482. }
  2483. applyForce(collider) {
  2484. let src = collider.owner.mySrc;
  2485. this.forceVec.x = src.gameObj.x - this.gameObj.x;
  2486. this.forceVec.y = src.gameObj.y - this.gameObj.y;
  2487. Laya.Vector2.normalize(this.forceVec, this.forceVec);
  2488. Laya.Vector2.scale(this.forceVec, 50, this.forceVec);
  2489. src.rigy.applyLinearImpulseToCenter({ x: this.forceVec.x, y: this.forceVec.y });
  2490. }
  2491. checkWrongBall(playEft = true) {
  2492. if (this.isInHole)
  2493. return;
  2494. xGame.common.gameMgr.inHoleBalls.push(this.number);
  2495. if (this.number != 0 && playEft)
  2496. this.d3BallSrc.playInHoleEft();
  2497. let coll = "inpocket_1";
  2498. let speed = this.getSpeed();
  2499. let sv2 = this.speedP10 * this.speedP10 * 0.8;
  2500. if (speed < 9 && this.number != 0)
  2501. coll = "";
  2502. else if (speed < sv2 * 6.2)
  2503. coll = "inpocket_4";
  2504. else if (speed < sv2 * 25)
  2505. coll = "collide_3";
  2506. else if (speed < sv2 * 56)
  2507. coll = "collide_2";
  2508. xGame.soundMgr.playSound(coll);
  2509. this.isInHole = true;
  2510. if (this.number == 0) {
  2511. console.log("白球进了。。");
  2512. this.reset();
  2513. this.rigy.linearVelocity = { x: 0, y: 0 };
  2514. this.hideSelf();
  2515. xGame.common.gameUI.ui.whiteAni.visible = true;
  2516. xGame.common.gameUI.ui.whiteAni.t0.play(Laya.Handler.create(this, () => {
  2517. xGame.common.gameUI.ui.whiteAni.visible = false;
  2518. }));
  2519. }
  2520. else {
  2521. xGame.common.playClassicEmotion(this.number, this.gameObj.x, this.gameObj.y);
  2522. xGame.common.d2World.removeOneBall(this);
  2523. this.destroySelf();
  2524. xGame.common.playHappySound(this.number);
  2525. this.runFlyEft();
  2526. }
  2527. }
  2528. runFlyEft() {
  2529. if (xGame.common.gameMode == GameMode.placeBall && xGame.common.gameMgr.placeBallData.type == PlaceBallType.challenge) {
  2530. xGame.common.playAwardSpine(this.gameObj.x + 100, this.gameObj.y - 100);
  2531. }
  2532. }
  2533. hideSelf() {
  2534. if (this.d3Ball)
  2535. this.d3Ball.active = false;
  2536. }
  2537. showSelf() {
  2538. this.isInHole = false;
  2539. if (this.d3Ball && !this.d3Ball.active)
  2540. this.d3Ball.active = true;
  2541. }
  2542. isStill() {
  2543. let speed = this.rigy.linearVelocity;
  2544. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed) {
  2545. this.rigy.linearVelocity = { x: 0, y: 0 };
  2546. return true;
  2547. }
  2548. return false;
  2549. }
  2550. reset() {
  2551. }
  2552. destroySelf() {
  2553. this.d3BallSrc.destroySelf();
  2554. if (!this.ui.isDisposed) {
  2555. this.ui.removeFromParent();
  2556. this.ui.dispose();
  2557. this.ui = null;
  2558. }
  2559. this.outColli = null;
  2560. this.innerColli = null;
  2561. this.rigy = null;
  2562. this.d3Ball = null;
  2563. this.d3BallSrc = null;
  2564. this.angleV2 = null;
  2565. this.gameObj.destroy(true);
  2566. this.destroy();
  2567. }
  2568. judgeBorder() {
  2569. if (this.forceRun && this.owner == xGame.common.d2World.rootBall.owner) {
  2570. return;
  2571. }
  2572. if (this.destroyed)
  2573. return;
  2574. if (xGame.common.gameMode == GameMode.classic)
  2575. return;
  2576. let isOver = xGame.common.checkBallOverBorder(this.gameObj.x, this.gameObj.y);
  2577. if (isOver) {
  2578. this.checkWrongBall();
  2579. }
  2580. }
  2581. onClick(e, force = false) {
  2582. if (this.number == 0)
  2583. return;
  2584. if (force) {
  2585. }
  2586. else {
  2587. if (xGame.common.d2World.openCheckStill)
  2588. return;
  2589. if (!xGame.common.gameMgr.selfTurn) {
  2590. return;
  2591. }
  2592. }
  2593. if (!xGame.common.gameMgr.finishOneShoot)
  2594. return;
  2595. let root = xGame.common.d2World.rootBall.gameObj;
  2596. let x = this.gameObj.x - root.x;
  2597. let y = this.gameObj.y - root.y;
  2598. let angle = xGame.common.getfguiRotation(x, y);
  2599. xGame.common.d2World.d2Gan.ui.rotation = angle;
  2600. xGame.common.d2World.getHelpLine();
  2601. xGame.common.clickedBall = true;
  2602. this.checkGuide();
  2603. }
  2604. checkGuide() {
  2605. let guide = DataMgr.getSkillGuide();
  2606. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) {
  2607. xGame.common.guideStep++;
  2608. xGame.common.gameUI.ui.guide1.visible = false;
  2609. xGame.common.gameUI.ui.guide2.visible = true;
  2610. }
  2611. }
  2612. checkDistance(disX, disY, angle) {
  2613. let diameter = this.gameObj.width - 1;
  2614. let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2);
  2615. if (!this.lastDis)
  2616. this.lastDis = dis;
  2617. else {
  2618. if (dis > this.lastDis) {
  2619. this.helpOut.type = "remove";
  2620. return this.helpOut;
  2621. }
  2622. }
  2623. if (dis <= Math.pow(diameter, 2)) {
  2624. let del = 0.01;
  2625. let offest = 0;
  2626. let realX = disX - this.gameObj.x;
  2627. let realY = disY - this.gameObj.y;
  2628. while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) {
  2629. offest += del;
  2630. realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180);
  2631. realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180);
  2632. }
  2633. this.helpOut.type = "ok";
  2634. this.helpOut.x = realX + this.gameObj.x;
  2635. this.helpOut.y = realY + this.gameObj.y;
  2636. return this.helpOut;
  2637. }
  2638. else {
  2639. this.helpOut.type = "no";
  2640. return this.helpOut;
  2641. }
  2642. }
  2643. clearBallEft() {
  2644. this.clearBallRightEft();
  2645. this.clearBallWrongEft();
  2646. }
  2647. clearBallRightEft() {
  2648. this.ui.breathAni.stop();
  2649. this.ui.rightTips.visible = false;
  2650. }
  2651. clearBallWrongEft() {
  2652. this.ui.wrongTips.visible = false;
  2653. }
  2654. showWrongEft() {
  2655. if (!xGame.common.gameMgr.selfTurn)
  2656. return;
  2657. this.ui.wrongTips.visible = true;
  2658. }
  2659. showRightEft() {
  2660. if (!xGame.common.gameMgr.selfTurn)
  2661. return;
  2662. this.ui.rightTips.visible = true;
  2663. this.ui.rightTips.scaleX = 1;
  2664. this.ui.rightTips.scaleY = 1;
  2665. this.ui.breathAni.play();
  2666. }
  2667. setBallFunc(type, owner) {
  2668. if (type == "ice") {
  2669. this.ballFunc = type;
  2670. this.d3BallSrc.setAlbedoTexture(true);
  2671. this.rigy.type = "static";
  2672. this.iceOwner = owner;
  2673. }
  2674. else {
  2675. if (owner == this.iceOwner) {
  2676. this.ballFunc = type;
  2677. this.d3BallSrc.setAlbedoTexture(false);
  2678. this.rigy.type = "dynamic";
  2679. }
  2680. }
  2681. }
  2682. }
  2683. D2BallSrc._unid = 0;
  2684. class D2RootBallSrc extends D2BallSrc {
  2685. constructor() {
  2686. super();
  2687. this.maxSpeed = 0;
  2688. this.classicMaxSpeed = 2.2;
  2689. this.bigSkillMaxSpeed = 4;
  2690. this.angle = 0;
  2691. this.allPercent = 0;
  2692. this.linearPercent = 0;
  2693. this.anglePercent = 0;
  2694. this.maxAngleRate = 0.6;
  2695. this.baseRot = 7;
  2696. this.angleMax = 0;
  2697. this.speed = new Laya.Vector2();
  2698. this.rotSpeed = new Laya.Vector2();
  2699. }
  2700. isStill() {
  2701. let speed = this.rigy.linearVelocity;
  2702. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) {
  2703. if (this.anglePercent <= 0.1) {
  2704. this.rigy.linearVelocity = { x: 0, y: 0 };
  2705. return true;
  2706. }
  2707. }
  2708. return false;
  2709. }
  2710. reset() {
  2711. this.linearPercent = 0;
  2712. this.anglePercent = 0;
  2713. }
  2714. setSpeed(percent, angle) {
  2715. this.allPercent = percent;
  2716. this.angle = angle;
  2717. this.setAngleSpeed();
  2718. this.setLinearSpeed();
  2719. let hit = "hit";
  2720. if (percent < 25)
  2721. hit = "hit03";
  2722. else if (percent < 50)
  2723. hit = "hit02";
  2724. else if (percent < 75)
  2725. hit = "hit01";
  2726. xGame.soundMgr.playSound(hit);
  2727. }
  2728. setAngleSpeed() {
  2729. let offest = xGame.common.rodOffest;
  2730. let radius = 82;
  2731. let rate = Math.abs(offest.y / radius) * 0.5;
  2732. if (offest.y > 0)
  2733. this.angleMax = -this.baseRot * 2;
  2734. else
  2735. this.angleMax = this.baseRot;
  2736. this.rotY = -offest.x / radius * 100;
  2737. this.anglePercent = this.maxAngleRate * rate * this.allPercent;
  2738. this.linearPercent = this.allPercent - this.anglePercent;
  2739. }
  2740. setLinearSpeed() {
  2741. if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) {
  2742. if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) {
  2743. if (!xGame.common.longHelpLine) {
  2744. let offset = -150 + xGame.common.randomNum(0, 300);
  2745. offset /= 100;
  2746. this.angle += offset;
  2747. }
  2748. }
  2749. }
  2750. let sin = Math.sin(this.angle * Math.PI / 180);
  2751. let cos = Math.cos(this.angle * Math.PI / 180);
  2752. switch (xGame.common.gameMode) {
  2753. case GameMode.classic:
  2754. this.maxSpeed = this.classicMaxSpeed;
  2755. break;
  2756. case GameMode.bigMove:
  2757. this.maxSpeed = this.bigSkillMaxSpeed;
  2758. break;
  2759. case GameMode.placeBall:
  2760. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  2761. if (data.type == 1) {
  2762. this.maxSpeed = this.bigSkillMaxSpeed;
  2763. }
  2764. else {
  2765. this.maxSpeed = this.classicMaxSpeed;
  2766. }
  2767. break;
  2768. default:
  2769. break;
  2770. }
  2771. this.speed.x = this.maxSpeed * this.linearPercent * sin;
  2772. this.speed.y = -this.maxSpeed * this.linearPercent * cos;
  2773. this.rotSpeed.x = -this.angleMax * sin * this.anglePercent;
  2774. this.rotSpeed.y = this.angleMax * cos * this.anglePercent;
  2775. this.rigy.applyLinearImpulseToCenter(this.speed);
  2776. }
  2777. onUpdate() {
  2778. if (this.anglePercent > 0.1) {
  2779. this.anglePercent *= 0.97;
  2780. this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent;
  2781. this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent;
  2782. this.rigy.applyForceToCenter(this.rotSpeed);
  2783. Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed);
  2784. Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed);
  2785. let num = Laya.Vector2.dot(this.speed, this.rotSpeed);
  2786. if (num > 0.9)
  2787. this.canRot = true;
  2788. }
  2789. else
  2790. this.canRot = true;
  2791. if (Math.abs(this.rotY) > 0.1)
  2792. this.rotY *= 0.98;
  2793. super.onUpdate();
  2794. }
  2795. destroySelf() {
  2796. super.destroySelf();
  2797. this.speed = null;
  2798. }
  2799. }
  2800. class D2Ball extends Laya.Sprite {
  2801. constructor(isRootBall = false) {
  2802. super();
  2803. this.ui = ui_D2Ball.createInstance();
  2804. this.pivotX = this.ui.width / 2;
  2805. this.pivotY = this.ui.width / 2;
  2806. this.x = 0;
  2807. this.y = 0;
  2808. this.addChild(this.ui.displayObject);
  2809. this.ui.displayObject.x += this.ui.width / 2;
  2810. this.ui.displayObject.y += this.ui.width / 2;
  2811. if (isRootBall) {
  2812. this.d2Src = this.addComponent(D2RootBallSrc);
  2813. }
  2814. else {
  2815. this.d2Src = this.addComponent(D2BallSrc);
  2816. }
  2817. this.d2Src.ui = this.ui;
  2818. this.addCircleCollider();
  2819. this.addInnerCircleCollider();
  2820. this.addRigyBody();
  2821. }
  2822. addCircleCollider() {
  2823. let colli = xGame.common.getCollider("circle");
  2824. colli.radius = this.ui.width / 2;
  2825. this.addComponentIntance(colli);
  2826. this.d2Src.outColli = colli;
  2827. colli.label = "ball";
  2828. }
  2829. addInnerCircleCollider() {
  2830. let colli = xGame.common.getCollider("circle");
  2831. colli.radius = this.ui.inner.width / 2;
  2832. colli.x = (this.ui.width - this.ui.inner.width) / 2;
  2833. colli.y = (this.ui.width - this.ui.inner.width) / 2;
  2834. this.addComponentIntance(colli);
  2835. this.d2Src.innerColli = colli;
  2836. colli.label = "inner";
  2837. }
  2838. addRigyBody() {
  2839. let rigy = xGame.common.getRigbody();
  2840. rigy.type = "dynamic";
  2841. this.addComponentIntance(rigy);
  2842. this.d2Src.rigy = rigy;
  2843. }
  2844. disposeSelf() {
  2845. if (!this.ui.isDisposed) {
  2846. this.ui.dispose();
  2847. this.ui.removeFromParent();
  2848. this.ui = null;
  2849. }
  2850. }
  2851. }
  2852. class ui_D2Gan extends fgui.GComponent {
  2853. static createInstance() {
  2854. return (fgui.UIPackage.createObject("game", "D2Gan"));
  2855. }
  2856. onConstruct() {
  2857. this.myIcon = (this.getChild("myIcon"));
  2858. this.selfRodIcon = (this.getChild("selfRodIcon"));
  2859. this.selfEftRoot = (this.getChild("selfEftRoot"));
  2860. this.self = (this.getChild("self"));
  2861. this.aiRodIcon = (this.getChild("aiRodIcon"));
  2862. this.aiEftRoot = (this.getChild("aiEftRoot"));
  2863. this.ai = (this.getChild("ai"));
  2864. }
  2865. }
  2866. ui_D2Gan.URL = "ui://isxx5ak7sdh33qp";
  2867. class D2Gan {
  2868. constructor() {
  2869. this.offset = 0.15;
  2870. this.cell = 1.5;
  2871. this.onBallCell = 0.4;
  2872. this.lastInfo = { x: 0, y: 0, rotation: 0 };
  2873. this.moveNum = 70;
  2874. this.rulerRate = 0.1;
  2875. this.ui = ui_D2Gan.createInstance();
  2876. this.changeSelfRod();
  2877. this.changeAIRod();
  2878. }
  2879. changeSelfRod() {
  2880. let index = DataMgr.getCurBallRod();
  2881. let data = cfgTable.ballrodData[index + 1];
  2882. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  2883. this.selfMySpine && this.selfMySpine.dispose();
  2884. this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img);
  2885. if (data.spine) {
  2886. this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img);
  2887. this.selfMySpine = new SpineMgr(data.spine, () => {
  2888. let xx = this.ui.selfEftRoot.width / 2;
  2889. let yy = this.ui.selfEftRoot.height / 2;
  2890. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  2891. let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject);
  2892. outSpine.rotation = -90;
  2893. });
  2894. }
  2895. }
  2896. changeAIRod() {
  2897. let length = Object.keys(cfgTable.ballrodData).length;
  2898. let rand = Math.floor(length * Math.random()) + 1;
  2899. let data = cfgTable.ballrodData[rand];
  2900. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  2901. this.aiMySpine && this.aiMySpine.dispose();
  2902. this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img);
  2903. if (data.spine) {
  2904. this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img);
  2905. this.aiMySpine = new SpineMgr(data.spine, () => {
  2906. let xx = this.ui.aiEftRoot.width / 2;
  2907. let yy = this.ui.aiEftRoot.height / 2;
  2908. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  2909. let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject);
  2910. outSpine.rotation = -90;
  2911. });
  2912. }
  2913. }
  2914. setGanLastInfo() {
  2915. this.lastInfo.rotation = this.ui.rotation;
  2916. this.lastInfo.x = this.ui.x;
  2917. this.lastInfo.y = this.ui.y;
  2918. }
  2919. rotateSelf(flag, isRuler = false) {
  2920. let angle;
  2921. flag = flag * this.offset;
  2922. if (xGame.common.d2World.isHelpLineOnBall) {
  2923. angle = flag * this.onBallCell;
  2924. }
  2925. else {
  2926. angle = flag * this.cell;
  2927. }
  2928. if (isRuler) {
  2929. angle *= this.rulerRate;
  2930. }
  2931. this.ui.rotation += angle;
  2932. xGame.common.d2World.getHelpLine();
  2933. }
  2934. checkDistance() {
  2935. let target = xGame.common.d2World.targetBall;
  2936. let root = xGame.common.d2World.rootBall;
  2937. if (target == null) {
  2938. return 1;
  2939. }
  2940. let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2);
  2941. if (dis <= 2500) {
  2942. return 5;
  2943. }
  2944. return 1;
  2945. }
  2946. rotDest(rot) {
  2947. this.ui.rotation = rot;
  2948. xGame.common.d2World.getHelpLine();
  2949. }
  2950. storagePower(powerNum) {
  2951. let pos = (powerNum / 100) * this.moveNum;
  2952. let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos;
  2953. let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos;
  2954. this.ui.x = this.lastInfo.x + xx;
  2955. this.ui.y = this.lastInfo.y + yy;
  2956. }
  2957. shoot() {
  2958. this.storagePower(0);
  2959. this.ui.visible = false;
  2960. }
  2961. destroySelf() {
  2962. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  2963. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  2964. this.selfMySpine && this.selfMySpine.dispose();
  2965. this.aiMySpine && this.aiMySpine.dispose();
  2966. this.lastInfo = null;
  2967. if (!this.ui.isDisposed) {
  2968. this.ui.removeFromParent();
  2969. this.ui.dispose();
  2970. }
  2971. }
  2972. }
  2973. class ui_HelpLine extends fgui.GComponent {
  2974. static createInstance() {
  2975. return (fgui.UIPackage.createObject("game", "HelpLine"));
  2976. }
  2977. onConstruct() {
  2978. this.n10 = (this.getChild("n10"));
  2979. this.rect = (this.getChild("rect"));
  2980. this.dir11 = (this.getChild("dir11"));
  2981. this.dir = (this.getChild("dir"));
  2982. this.rootDir = (this.getChild("rootDir"));
  2983. this.dirDot = (this.getChild("dirDot"));
  2984. }
  2985. }
  2986. ui_HelpLine.URL = "ui://isxx5ak7sdh33qs";
  2987. class D2HelpLine {
  2988. constructor() {
  2989. this.starX = 0;
  2990. this.starY = 0;
  2991. this.ui = ui_HelpLine.createInstance();
  2992. xGame.common.gameUI.ui.ballNode.addChild(this.ui);
  2993. this.starX = this.ui.rect.x;
  2994. this.starY = this.ui.rect.y;
  2995. }
  2996. shoot() {
  2997. this.ui.visible = false;
  2998. }
  2999. destroySelf() {
  3000. if (this.ui.isDisposed) {
  3001. this.ui.removeFromParent();
  3002. this.ui.dispose();
  3003. }
  3004. }
  3005. }
  3006. class D2World extends Laya.Script {
  3007. constructor() {
  3008. super();
  3009. this.ballArr = [];
  3010. this.openCheckStill = false;
  3011. this.checkArr = [];
  3012. this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 };
  3013. this.isHelpLineOnBall = false;
  3014. this.isOnSameLine = false;
  3015. this.reflectAngle = 0;
  3016. this.powerPercent = 0;
  3017. this.inHolesSpeed = [];
  3018. this.outDir = new Laya.Vector2();
  3019. this.rootDir = new Laya.Vector2();
  3020. this.aiLv = 0;
  3021. this.rootPos = new Laya.Vector2();
  3022. this.tempDir1 = new Laya.Vector2();
  3023. this.tempDir2 = new Laya.Vector2();
  3024. this.tempDir3 = new Laya.Vector2();
  3025. this.ballSize = 33;
  3026. this.destRot = 0;
  3027. }
  3028. initSelf() {
  3029. this.createBalls();
  3030. xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop);
  3031. xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop);
  3032. xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot);
  3033. xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot);
  3034. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  3035. }
  3036. setBorderRect() {
  3037. let ui = xGame.common.gameUI.ui;
  3038. let starX = ui.border.bar5.x + ui.border.bar5.width / 2;
  3039. let starY = ui.border.bar1.y + ui.border.bar1.height / 2;
  3040. let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width);
  3041. let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height);
  3042. this.borderRect.x = starX;
  3043. this.borderRect.y = starY;
  3044. this.borderRect.width = width;
  3045. this.borderRect.height = height;
  3046. }
  3047. resetGame() {
  3048. this.openCheckStill = false;
  3049. let temp;
  3050. for (let index = 0; index < this.ballArr.length; index++) {
  3051. temp = this.ballArr[index];
  3052. temp.destroySelf();
  3053. }
  3054. xGame.common.d3World.ballRoot.destroyChildren();
  3055. xGame.common.gameUI.ui.ballNode.removeChildren();
  3056. console.log("进入摧毁逻辑");
  3057. this.d2Gan.destroySelf();
  3058. this.d2HelpLine.destroySelf();
  3059. this.ballArr = [];
  3060. }
  3061. setD2Gan() {
  3062. let ballNode = this.rootBall.ui;
  3063. let d2Gan = new D2Gan();
  3064. this.d2Gan = d2Gan;
  3065. let ganNode = d2Gan.ui;
  3066. ballNode.addChild(ganNode);
  3067. ganNode.pivotX = ganNode.pivotX;
  3068. ganNode.pivotY = ganNode.pivotY;
  3069. ganNode.x = ganNode.myIcon.width / 2;
  3070. ganNode.y = this.rootBall.gameObj.width;
  3071. d2Gan.setGanLastInfo();
  3072. }
  3073. setHelpLine() {
  3074. let d2Help = new D2HelpLine();
  3075. this.d2HelpLine = d2Help;
  3076. }
  3077. createBalls() {
  3078. let cfg;
  3079. switch (xGame.common.gameMode) {
  3080. case GameMode.classic:
  3081. cfg = xGame.cfgMgr.getRandomClassicLevel();
  3082. break;
  3083. case GameMode.bigMove:
  3084. cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex);
  3085. break;
  3086. case GameMode.placeBall:
  3087. cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel);
  3088. break;
  3089. default:
  3090. break;
  3091. }
  3092. cfg = JSON.parse(JSON.stringify(cfg));
  3093. for (const key in cfg) {
  3094. if (cfg[key].value == 0) {
  3095. this.createRootBall(cfg[key]);
  3096. delete cfg[key];
  3097. break;
  3098. }
  3099. }
  3100. this.createOtherBalls(cfg);
  3101. }
  3102. createRootBall(data) {
  3103. let root = new D2Ball(true);
  3104. xGame.common.gameUI.ui.ballNode.displayObject.addChild(root);
  3105. this.rootBall = root.d2Src;
  3106. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3107. let d3BallSrc = d3Ball.getComponent(Ball);
  3108. xGame.common.d3World.rootBall = d3Ball;
  3109. xGame.common.d3World.rootBallSrc = d3BallSrc;
  3110. let xx = data.x;
  3111. let yy = data.y;
  3112. let numer = data.value;
  3113. xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy);
  3114. this.rootBall.initSelf(numer, xx, yy, d3Ball);
  3115. this.ballArr.push(this.rootBall);
  3116. this.setD2Gan();
  3117. this.setHelpLine();
  3118. }
  3119. createOtherBalls(cfg) {
  3120. let temp;
  3121. let src;
  3122. let data;
  3123. for (const key in cfg) {
  3124. data = cfg[key];
  3125. temp = new D2Ball();
  3126. xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp);
  3127. src = temp.d2Src;
  3128. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3129. src.initSelf(data.value, data.x, data.y, d3Ball);
  3130. this.ballArr.push(src);
  3131. }
  3132. }
  3133. shoot(percent) {
  3134. this.powerPercent = percent;
  3135. this.openCheckStill = true;
  3136. let d2Angle = this.d2Gan.ui.rotation;
  3137. this.rootBall.setSpeed(percent, d2Angle);
  3138. this.clearBallAllEft();
  3139. this.changePlayerView();
  3140. }
  3141. onUpdate() {
  3142. if (!this.openCheckStill)
  3143. return;
  3144. this.checkStill();
  3145. }
  3146. checkStill() {
  3147. for (let index = 0; index < this.ballArr.length; index++) {
  3148. if (!this.ballArr[index].isStill()) {
  3149. return;
  3150. }
  3151. }
  3152. xGame.eventMgr.event(ALL_BALL_STOP);
  3153. }
  3154. allBallStop() {
  3155. this.openCheckStill = false;
  3156. xGame.common.recoverCameraView();
  3157. }
  3158. waitShoot() {
  3159. if (!this.d2Gan.ui.isDisposed) {
  3160. this.d2Gan.ui.visible = true;
  3161. }
  3162. if (!this.d2HelpLine.ui.isDisposed) {
  3163. this.d2HelpLine.ui.visible = true;
  3164. }
  3165. this.clearBallAllEft();
  3166. this.showBallRightEft();
  3167. this.getHelpLine();
  3168. this.inHolesSpeed = [];
  3169. this.selectOneBall();
  3170. }
  3171. _getAllBallArr() {
  3172. let arr = this.ballArr;
  3173. let outArr = [];
  3174. for (let index = 0; index < arr.length; index++) {
  3175. if (arr[index] instanceof D2RootBallSrc)
  3176. continue;
  3177. if (arr[index].ballFunc == "ice")
  3178. continue;
  3179. if (arr[index].destroyed)
  3180. continue;
  3181. outArr.push(arr[index]);
  3182. }
  3183. return outArr;
  3184. }
  3185. _getBlackObj() {
  3186. let arr = this.ballArr;
  3187. for (let index = 0; index < arr.length; index++) {
  3188. if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) {
  3189. return arr[index];
  3190. }
  3191. }
  3192. }
  3193. selectOneBall() {
  3194. let all = this._getAllBallArr();
  3195. let target;
  3196. switch (xGame.common.gameMode) {
  3197. case GameMode.classic:
  3198. if (xGame.common.gameMgr.selfTurn) {
  3199. let self = xGame.common.gameMgr.selfBallArr;
  3200. let black = this._getBlackObj();
  3201. if (xGame.common.gameMgr.ensureBallType) {
  3202. if (self.length > 0) {
  3203. let out = [];
  3204. for (let j = 0; j < all.length; j++) {
  3205. if (self.indexOf(all[j].number) > -1) {
  3206. out.push(all[j]);
  3207. }
  3208. }
  3209. target = this.selectBestEnterOne(out);
  3210. }
  3211. else {
  3212. target = this.selectBestEnterOne([black]);
  3213. }
  3214. }
  3215. else {
  3216. target = this.selectBestEnterOne(all);
  3217. }
  3218. }
  3219. else {
  3220. target = this.selectBestEnterOne(all);
  3221. }
  3222. break;
  3223. case GameMode.bigMove:
  3224. target = this.selectBestEnterOne(all);
  3225. break;
  3226. case GameMode.placeBall:
  3227. if (all.length > 0) {
  3228. target = this.selectBestEnterOne(all);
  3229. }
  3230. break;
  3231. default:
  3232. break;
  3233. }
  3234. if (target && !target.destroyed && target.onClick) {
  3235. target.onClick(0, true);
  3236. let num = -200 + xGame.common.randomNum(0, 400);
  3237. num /= 150;
  3238. if (xGame.common.longHelpLine) {
  3239. num = 0;
  3240. }
  3241. this.destRot += num;
  3242. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  3243. }
  3244. }
  3245. removeOneBall(ball) {
  3246. for (let index = 0; index < this.ballArr.length; index++) {
  3247. if (this.ballArr[index].id == ball.id) {
  3248. this.ballArr.splice(index, 1);
  3249. break;
  3250. }
  3251. }
  3252. }
  3253. getHelpLine() {
  3254. this.d2HelpLine.ui.dirDot.visible = false;
  3255. this.isOnSameLine = false;
  3256. let startX = this.rootBall.gameObj.x;
  3257. let startY = this.rootBall.gameObj.y;
  3258. let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation);
  3259. if (dis == null) {
  3260. this.d2HelpLine.ui.visible = false;
  3261. console.error("辅助线异常");
  3262. return;
  3263. }
  3264. this.d2HelpLine.ui.visible = true;
  3265. let angle = this.d2Gan.ui.rotation;
  3266. let radius = 16.5;
  3267. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3268. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3269. let colliObj = xGame.common.isBlock(startX, startY, disX, disY);
  3270. if (colliObj == null) {
  3271. this.getColliPos(disX, disY, radius, angle);
  3272. xGame.common.d2World.isHelpLineOnBall = false;
  3273. this.targetBall = null;
  3274. this.reflectAngle = 0;
  3275. this.showBallWrongEft();
  3276. }
  3277. else {
  3278. let target = colliObj.src;
  3279. let radius = 16.5;
  3280. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3281. dis1 = Math.sqrt(dis1);
  3282. let realDis = colliObj.disHon - dis1;
  3283. let dir = colliObj.dir;
  3284. let xx = startX + dir.x * realDis;
  3285. let yy = startY + dir.y * realDis;
  3286. this.getColliPos(xx, yy, radius, angle);
  3287. let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180;
  3288. if (Math.abs(reflectAngle - angle) <= 0.02) {
  3289. let offset = xGame.common.rodOffest;
  3290. if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1)
  3291. this.isOnSameLine = true;
  3292. }
  3293. this.getRootDirLine(reflectAngle, angle, xx, yy, target);
  3294. xGame.common.d2World.isHelpLineOnBall = true;
  3295. this.targetBall = target;
  3296. this.reflectAngle = reflectAngle;
  3297. this.showBallWrongEft();
  3298. if (xGame.common.longHelpLine) {
  3299. this.delayReflectLine(target, reflectAngle);
  3300. }
  3301. }
  3302. }
  3303. getBorderDot(startX, startY, angle) {
  3304. let radius = 17;
  3305. let distance;
  3306. let isDone;
  3307. distance = -(this.borderRect.y - startY + radius) / Math.cos(angle * Math.PI / 180);
  3308. isDone = this.judgeUpDown(distance, angle, startX);
  3309. if (isDone != null) {
  3310. return isDone;
  3311. }
  3312. distance = -(this.borderRect.y + this.borderRect.height - startY - radius) / Math.cos(angle * Math.PI / 180);
  3313. isDone = this.judgeUpDown(distance, angle, startX);
  3314. if (isDone != null) {
  3315. return isDone;
  3316. }
  3317. distance = (this.borderRect.x - startX + radius) / Math.sin(angle * Math.PI / 180);
  3318. isDone = this.judgeLeftRight(distance, angle, startY);
  3319. if (isDone != null) {
  3320. return isDone;
  3321. }
  3322. distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180);
  3323. isDone = this.judgeLeftRight(distance, angle, startY);
  3324. if (isDone != null) {
  3325. return isDone;
  3326. }
  3327. }
  3328. judgeUpDown(distance, angle, startX) {
  3329. let flag = Math.sin(angle * Math.PI / 180);
  3330. let temp = startX + distance * Math.sin(angle * Math.PI / 180);
  3331. if (distance >= 0) {
  3332. if (flag > 0) {
  3333. if (temp < this.borderRect.x + this.borderRect.width) {
  3334. return distance;
  3335. }
  3336. }
  3337. else {
  3338. if (temp > this.borderRect.x) {
  3339. return distance;
  3340. }
  3341. }
  3342. }
  3343. }
  3344. judgeLeftRight(distance, angle, starY) {
  3345. let flag = -Math.cos(angle * Math.PI / 180);
  3346. let temp = starY + distance * -Math.cos(angle * Math.PI / 180);
  3347. if (distance >= 0) {
  3348. if (flag > 0) {
  3349. if (temp < this.borderRect.y + this.borderRect.height) {
  3350. return distance;
  3351. }
  3352. }
  3353. else {
  3354. if (temp > this.borderRect.y) {
  3355. return distance;
  3356. }
  3357. }
  3358. }
  3359. }
  3360. clearBallAllEft() {
  3361. let temp;
  3362. for (let index = 0; index < this.ballArr.length; index++) {
  3363. temp = this.ballArr[index];
  3364. temp.clearBallEft();
  3365. }
  3366. }
  3367. showBallRightEft() {
  3368. let gameMgr = xGame.common.gameMgr;
  3369. let temp;
  3370. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3371. if (targetArr.length <= 0)
  3372. return;
  3373. for (let index = 0; index < this.ballArr.length; index++) {
  3374. temp = this.ballArr[index];
  3375. if (targetArr.indexOf(temp.number) > -1) {
  3376. temp.showRightEft();
  3377. }
  3378. }
  3379. }
  3380. showBallWrongEft() {
  3381. let gameMgr = xGame.common.gameMgr;
  3382. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3383. if (targetArr.length <= 0)
  3384. return;
  3385. let temp;
  3386. for (let index = 0; index < this.ballArr.length; index++) {
  3387. temp = this.ballArr[index];
  3388. if (this.targetBall && this.targetBall.number == temp.number) {
  3389. if (targetArr.indexOf(temp.number) <= -1) {
  3390. temp.showWrongEft();
  3391. }
  3392. else {
  3393. temp.clearBallWrongEft();
  3394. }
  3395. }
  3396. else {
  3397. temp.clearBallWrongEft();
  3398. }
  3399. }
  3400. }
  3401. getColliPos(x, y, radius, angle) {
  3402. this.d2HelpLine.ui.x = x;
  3403. this.d2HelpLine.ui.y = y;
  3404. let dirX = x - this.rootBall.gameObj.x;
  3405. let dirY = y - this.rootBall.gameObj.y;
  3406. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3407. if (rectH <= 0)
  3408. rectH = 0;
  3409. this.d2HelpLine.ui.rect.height = 0;
  3410. this.d2HelpLine.ui.rect.height = rectH;
  3411. this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY);
  3412. if (rectH < this.rootBall.gameObj.width) {
  3413. this.d2HelpLine.ui.rect.visible = false;
  3414. }
  3415. else {
  3416. this.d2HelpLine.ui.rect.visible = true;
  3417. }
  3418. this.d2HelpLine.ui.dir.visible = false;
  3419. this.d2HelpLine.ui.rootDir.visible = false;
  3420. }
  3421. getReflectLine(x, y, radius, target) {
  3422. this.d2HelpLine.ui.dir.visible = true;
  3423. let dirX = target.x - x;
  3424. let dirY = target.y - y;
  3425. let angle = xGame.common.getfguiRotation(dirX, dirY) + 180;
  3426. this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX;
  3427. this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY;
  3428. this.d2HelpLine.ui.dir.height = 48;
  3429. this.d2HelpLine.ui.dir.rotation = angle;
  3430. this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180);
  3431. this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180);
  3432. return angle;
  3433. }
  3434. getRootDirLine(angle, rodAngle, xx, yy, target) {
  3435. let rtX = xGame.common.d2World.rootBall.gameObj.x;
  3436. let rtY = xGame.common.d2World.rootBall.gameObj.y;
  3437. let targetX = target.gameObj.x;
  3438. let targetY = target.gameObj.y;
  3439. this.outDir.setValue(targetX - xx, targetY - yy);
  3440. this.rootDir.setValue(rtX - xx, rtY - yy);
  3441. let ver = Math.PI / 2;
  3442. let sin = Math.sin(ver);
  3443. let cos = Math.cos(ver);
  3444. let outX = this.outDir.x * cos - this.outDir.y * sin;
  3445. let outY = this.outDir.x * sin + this.outDir.y * cos;
  3446. this.outDir.setValue(outX, outY);
  3447. Laya.Vector2.normalize(this.rootDir, this.rootDir);
  3448. Laya.Vector2.normalize(this.outDir, this.outDir);
  3449. let result = Laya.Vector2.dot(this.rootDir, this.outDir);
  3450. if (Math.abs(result) <= 0.08) {
  3451. this.d2HelpLine.ui.rootDir.visible = false;
  3452. return;
  3453. }
  3454. if (result > 0) {
  3455. angle += 90;
  3456. }
  3457. else if (result < 0) {
  3458. angle -= 90;
  3459. }
  3460. this.d2HelpLine.ui.rootDir.visible = true;
  3461. this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX;
  3462. this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY;
  3463. this.d2HelpLine.ui.rootDir.rotation = angle;
  3464. }
  3465. delayReflectLine(obj, angle) {
  3466. if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) {
  3467. return;
  3468. }
  3469. this.isOnSameLine = false;
  3470. let startX = obj.gameObj.x;
  3471. let startY = obj.gameObj.y;
  3472. let dis = this.getBorderDot(startX, startY, angle);
  3473. if (dis == null) {
  3474. this.d2HelpLine.ui.dirDot.visible = false;
  3475. return;
  3476. }
  3477. this.d2HelpLine.ui.visible = true;
  3478. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3479. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3480. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, obj);
  3481. if (colliObj == null) {
  3482. this.setDelayLine(disX, disY, obj, angle);
  3483. }
  3484. else {
  3485. let radius = 16;
  3486. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3487. dis1 = Math.sqrt(dis1);
  3488. let realDis = colliObj.disHon - dis1;
  3489. let dir = colliObj.dir;
  3490. let xx = startX + dir.x * realDis;
  3491. let yy = startY + dir.y * realDis;
  3492. this.setDelayLine(xx, yy, obj, angle);
  3493. }
  3494. }
  3495. setDelayLine(x, y, obj, angle) {
  3496. let dirX = x - obj.gameObj.x;
  3497. let dirY = y - obj.gameObj.y;
  3498. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3499. if (rectH <= 0)
  3500. rectH = 0;
  3501. this.d2HelpLine.ui.dir.height = rectH;
  3502. this.d2HelpLine.ui.dirDot.visible = true;
  3503. this.d2HelpLine.ui.dirDot.x = 17;
  3504. this.d2HelpLine.ui.dirDot.y = 17;
  3505. this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180);
  3506. ;
  3507. this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180);
  3508. }
  3509. changePlayerView() {
  3510. if (Math.random() >= 0.7)
  3511. return;
  3512. if (!this.targetBall) {
  3513. return;
  3514. }
  3515. if (!xGame.common.gameMgr.selfTurn)
  3516. return;
  3517. switch (xGame.common.gameMode) {
  3518. case GameMode.classic:
  3519. if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) {
  3520. if (this.targetBall.number != 8) {
  3521. return;
  3522. }
  3523. }
  3524. break;
  3525. case GameMode.bigMove:
  3526. return;
  3527. case GameMode.placeBall:
  3528. break;
  3529. default:
  3530. break;
  3531. }
  3532. let startX = this.targetBall.gameObj.x;
  3533. let startY = this.targetBall.gameObj.y;
  3534. let angle = this.reflectAngle;
  3535. let dis = this.getBorderDot(startX, startY, angle);
  3536. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3537. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3538. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall);
  3539. if (colliObj) {
  3540. return;
  3541. }
  3542. let offset = 40;
  3543. let posObj = xGame.common.gameMgr.posObj;
  3544. let temp;
  3545. let radius;
  3546. let tarX, tarY;
  3547. for (const key in posObj) {
  3548. temp = posObj[key];
  3549. radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5);
  3550. tarX = startX + radius * Math.sin(angle * Math.PI / 180);
  3551. tarY = startY + radius * -Math.cos(angle * Math.PI / 180);
  3552. if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) {
  3553. xGame.common.showOneCamera("angle" + key);
  3554. xGame.common.gameUI.ui.d2Node.alpha = 0;
  3555. Laya.physicsTimer.scale = 0.7;
  3556. break;
  3557. }
  3558. }
  3559. }
  3560. selectBestEnterOne(arr) {
  3561. this.aiLv = xGame.tools.random(1, 11);
  3562. this.aiLv = 10;
  3563. this.wBall = xGame.common.d2World.rootBall;
  3564. this.rootPos.x = this.wBall.gameObj.x;
  3565. this.rootPos.y = this.wBall.gameObj.y;
  3566. this.initHoleBall(arr);
  3567. return this.selectBall();
  3568. }
  3569. selectBall() {
  3570. let ball = null;
  3571. this.destRot = 0;
  3572. let ai = 110 - this.aiLv * 10;
  3573. let mis = xGame.tools.random(-ai, ai) * 0.005;
  3574. let score = false;
  3575. if (this.scoreBall.length < 1) {
  3576. if (this.lineBall.length < 1) {
  3577. for (let i = 0; i < this.kickBall.length; i++) {
  3578. let list = [];
  3579. let bo = this.kickBall[i];
  3580. let bobj = bo.gameObj;
  3581. let rect = xGame.common.d2World.borderRect;
  3582. let mobj = this.wBall.gameObj;
  3583. let minb = bobj.y - rect.y - 20;
  3584. let minw = mobj.y - rect.y - 50;
  3585. if (minb > 0 && minw > 0) {
  3586. let dlenx = 0;
  3587. let dleny = mobj.y - rect.y;
  3588. let spx = mobj.x;
  3589. let spy = rect.y - dleny;
  3590. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3591. }
  3592. minb = rect.y + rect.height - bobj.y - 20;
  3593. minw = rect.y + rect.height - mobj.y - 50;
  3594. if (minb > 0 && minw > 0) {
  3595. let dlenx = 0;
  3596. let dleny = rect.y + rect.height - mobj.y;
  3597. let spx = mobj.x;
  3598. let spy = rect.y + rect.height + dleny;
  3599. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3600. }
  3601. minb = bobj.x - rect.x - 20;
  3602. minw = mobj.x - rect.x - 50;
  3603. if (minb > 0 && minw > 0) {
  3604. let dlenx = mobj.x - rect.x;
  3605. let dleny = 0;
  3606. let spx = rect.x - dlenx;
  3607. let spy = mobj.y;
  3608. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3609. }
  3610. minb = rect.x + rect.width - bobj.x - 20;
  3611. minw = rect.x + rect.width - mobj.x - 50;
  3612. if (minb > 0 && minw > 0) {
  3613. let dlenx = rect.x + rect.width - mobj.x;
  3614. let dleny = 0;
  3615. let spx = rect.x + rect.width + dlenx;
  3616. let spy = mobj.y;
  3617. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3618. }
  3619. list.sort(function (a, b) {
  3620. return a.order - b.order;
  3621. });
  3622. for (let i = 0; i < list.length; i++) {
  3623. let data = list[i];
  3624. let mx = mobj.x - bobj.x;
  3625. let my = mobj.y - bobj.y;
  3626. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  3627. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  3628. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3629. if (num > 1)
  3630. num = 1;
  3631. let cos = Math.acos(num);
  3632. if (cos > 1.57)
  3633. cos = 1.57;
  3634. else if (cos < 0.01)
  3635. cos = 0.01;
  3636. let tan = Math.tan(cos);
  3637. let dx = tan * data.dleny;
  3638. let dy = tan * data.dlenx;
  3639. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  3640. if (Math.abs(bx - 667) < 40)
  3641. continue;
  3642. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  3643. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  3644. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  3645. this.forceMax = dis * 0.08;
  3646. this.destRot += mis * 0.1;
  3647. this.setKick(bx, by);
  3648. return true;
  3649. }
  3650. }
  3651. }
  3652. }
  3653. else {
  3654. ball = xGame.common.getRandArrEle(this.lineBall);
  3655. }
  3656. }
  3657. else {
  3658. for (let i = 0; i < this.scoreBall.length; i++) {
  3659. if (i < this.scoreBall.length - 1) {
  3660. let rand = 70 + this.aiLv * 10 + i * 10;
  3661. if (xGame.tools.random(0, 100) < rand) {
  3662. ball = this.scoreBall[i];
  3663. break;
  3664. }
  3665. }
  3666. else {
  3667. ball = this.scoreBall[i];
  3668. break;
  3669. }
  3670. }
  3671. score = true;
  3672. this.selectNum++;
  3673. }
  3674. if (!ball)
  3675. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  3676. let dx = ball.gameObj.x;
  3677. let dy = ball.gameObj.y;
  3678. let kickAngle = 0;
  3679. if (score) {
  3680. dx = ball.kickPos.x;
  3681. dy = ball.kickPos.y;
  3682. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  3683. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  3684. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  3685. if (adot > 1)
  3686. adot = 1;
  3687. kickAngle = Math.acos(adot) * 57.3;
  3688. if (kickAngle > 45) {
  3689. let kdx = ball.kickPos.x - ball.gameObj.x;
  3690. let kdy = ball.kickPos.y - ball.gameObj.y;
  3691. dx = ball.kickPos.x - kdx * mis * 0.3;
  3692. dy = ball.kickPos.y - kdy * mis * 0.3;
  3693. }
  3694. else
  3695. this.destRot += mis;
  3696. }
  3697. else if (ball.poleAngle != 0) {
  3698. this.destRot += ball.poleAngle;
  3699. }
  3700. if (xGame.common.gameMode == 0) {
  3701. let af = kickAngle * 0.08;
  3702. this.forceMax = ball.hard * 0.1 + af * af;
  3703. }
  3704. this.setKick(dx, dy);
  3705. return ball;
  3706. }
  3707. initHoleBall(arr) {
  3708. this.kickBall = [];
  3709. this.lineBall = [];
  3710. this.scoreBall = [];
  3711. this.holeBall = [];
  3712. this.selectNum = 0;
  3713. this.forceNum = 0;
  3714. this.forceMax = 0;
  3715. this.turnNum = 0;
  3716. let list = arr;
  3717. let holes = xGame.common.gameMgr.holePosList;
  3718. let self = xGame.common.aiPlayer;
  3719. for (let i = 0; i < list.length; i++) {
  3720. let obj = list[i];
  3721. if (!obj)
  3722. continue;
  3723. obj.kickPos.x = 0;
  3724. obj.kickPos.y = 0;
  3725. obj.poleAngle = 0;
  3726. obj.hard = 0;
  3727. obj.borderDis = 0;
  3728. obj.kickAngle = 180;
  3729. let b = obj.gameObj;
  3730. let wbp = this.rootPos;
  3731. let bx = wbp.x - b.x;
  3732. let by = wbp.y - b.y;
  3733. obj.borderDis = xGame.tools.random(0, 100);
  3734. this.kickBall.push(obj);
  3735. if (!this.isLine(wbp, obj))
  3736. continue;
  3737. obj.kickAngle = xGame.tools.random(90, 180);
  3738. obj.kickPos.x = b.x;
  3739. obj.kickPos.y = b.y;
  3740. this.lineBall.push(obj);
  3741. let minDis = 999999;
  3742. let hole = false;
  3743. for (let j = 0; j < holes.length; j++) {
  3744. let hp = holes[j];
  3745. if (bx >= 0 && hp.x > b.x + 100)
  3746. continue;
  3747. if (bx <= 0 && hp.x < b.x - 100)
  3748. continue;
  3749. if (by < -10 && hp.y < wbp.y)
  3750. continue;
  3751. if (by > 10 && hp.y > wbp.y)
  3752. continue;
  3753. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  3754. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  3755. if (dis < minDis) {
  3756. let dx = b.x - this.tempDir1.x * this.ballSize;
  3757. let dy = b.y - this.tempDir1.y * this.ballSize;
  3758. this.tempDir3.x = this.tempDir1.x;
  3759. this.tempDir3.y = this.tempDir1.y;
  3760. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  3761. obj.kickPos.x = dx;
  3762. obj.kickPos.y = dy;
  3763. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  3764. if (num > 1)
  3765. num = 1;
  3766. obj.kickAngle = Math.acos(num) * 57.3;
  3767. if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2)
  3768. dis = dis * 2;
  3769. if (Math.abs(hp.x - 600) < 100)
  3770. dis += 50;
  3771. obj.hard = dis + obj.kickAngle * 3;
  3772. hole = true;
  3773. }
  3774. }
  3775. }
  3776. }
  3777. if (hole) {
  3778. this.scoreBall.push(obj);
  3779. this.holeBall.push(obj);
  3780. }
  3781. }
  3782. this.scoreBall.sort(function (a, b) {
  3783. return a.hard - b.hard;
  3784. });
  3785. this.holeBall.sort(function (a, b) {
  3786. return a.kickAngle - b.kickAngle;
  3787. });
  3788. this.kickBall.sort(function (a, b) {
  3789. return a.borderDis - b.borderDis;
  3790. });
  3791. }
  3792. isBlock(bn, bx, by, hx, hy, dn = -1) {
  3793. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  3794. let balls = xGame.common.d2World.ballArr;
  3795. let max = xGame.tools.getDis(hx, hy, bx, by);
  3796. for (let index = 0; index < balls.length; index++) {
  3797. let obj = balls[index];
  3798. if (obj.number == 0)
  3799. continue;
  3800. if (obj.number == bn || obj.number == dn)
  3801. continue;
  3802. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  3803. if (dis * dis > max)
  3804. continue;
  3805. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  3806. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3807. if (num > 1)
  3808. num = 1;
  3809. if (num < 0)
  3810. continue;
  3811. let gap = Math.sin(Math.acos(num)) * dis;
  3812. if (gap < this.ballSize)
  3813. return true;
  3814. }
  3815. return false;
  3816. }
  3817. isLine(xy, ball) {
  3818. let bx = xy.x;
  3819. let by = xy.y;
  3820. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  3821. let dis = ball.getDestDis(xy);
  3822. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  3823. let sin = Math.sin(angle);
  3824. let cos = Math.cos(angle);
  3825. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  3826. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  3827. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  3828. let dx = bx + this.tempDir2.x * dis;
  3829. let dy = by + this.tempDir2.y * dis;
  3830. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  3831. sin = Math.sin(-angle);
  3832. cos = Math.cos(-angle);
  3833. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  3834. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  3835. dx = bx + this.tempDir2.x * dis;
  3836. dy = by + this.tempDir2.y * dis;
  3837. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  3838. if (isr && isl)
  3839. return false;
  3840. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  3841. }
  3842. return true;
  3843. }
  3844. setKick(dx, dy) {
  3845. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  3846. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  3847. this.tempDir1.x = 0;
  3848. this.tempDir1.y = 1;
  3849. this.tempDir2.y = -this.tempDir2.y;
  3850. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3851. if (num > 1)
  3852. num = 1;
  3853. let rot = Math.acos(num) * 57.3;
  3854. if (this.tempDir2.x < 0)
  3855. rot = 360 - rot;
  3856. this.destRot += rot;
  3857. }
  3858. }
  3859. class ui_UIGame extends fgui.GComponent {
  3860. static createInstance() {
  3861. return (fgui.UIPackage.createObject("game", "UIGame"));
  3862. }
  3863. onConstruct() {
  3864. this.c1 = this.getController("c1");
  3865. this.d3Root = (this.getChild("d3Root"));
  3866. this.clickNode = (this.getChild("clickNode"));
  3867. this.d2Root = (this.getChild("d2Root"));
  3868. this.topNode = (this.getChild("topNode"));
  3869. this.n72 = (this.getChild("n72"));
  3870. this.n40 = (this.getChild("n40"));
  3871. this.rulerNode = (this.getChild("rulerNode"));
  3872. this.rulerClickNode = (this.getChild("rulerClickNode"));
  3873. this.n50 = (this.getChild("n50"));
  3874. this.keduNode = (this.getChild("keduNode"));
  3875. this.powerTxt = (this.getChild("powerTxt"));
  3876. this.powerNode = (this.getChild("powerNode"));
  3877. this.colorNode = (this.getChild("colorNode"));
  3878. this.powerEft = (this.getChild("powerEft"));
  3879. this.myPowerNode = (this.getChild("myPowerNode"));
  3880. this.ganNode = (this.getChild("ganNode"));
  3881. this.rodMethodNode = (this.getChild("rodMethodNode"));
  3882. this.placeChallengeNode = (this.getChild("placeChallengeNode"));
  3883. this.placeNormalNode = (this.getChild("placeNormalNode"));
  3884. this.skillRod = (this.getChild("skillRod"));
  3885. this.border = (this.getChild("border"));
  3886. this.bigSkillNode = (this.getChild("bigSkillNode"));
  3887. this.classicWorldsNode = (this.getChild("classicWorldsNode"));
  3888. this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode"));
  3889. this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode"));
  3890. this.awardSpineNode = (this.getChild("awardSpineNode"));
  3891. this.guanyuNode = (this.getChild("guanyuNode"));
  3892. this.helpBtn = (this.getChild("helpBtn"));
  3893. this.wordsBtn = (this.getChild("wordsBtn"));
  3894. this.aiWordsBtn = (this.getChild("aiWordsBtn"));
  3895. this.returnBtn = (this.getChild("returnBtn"));
  3896. this.ballNode = (this.getChild("ballNode"));
  3897. this.whiteAni = (this.getChild("whiteAni"));
  3898. this.blackAni = (this.getChild("blackAni"));
  3899. this.selfTurn = (this.getChild("selfTurn"));
  3900. this.aiTurn = (this.getChild("aiTurn"));
  3901. this.deskNode = (this.getChild("deskNode"));
  3902. this.moveNode = (this.getChild("moveNode"));
  3903. this.selfTalk = (this.getChild("selfTalk"));
  3904. this.aiTalk = (this.getChild("aiTalk"));
  3905. this.d2Node = (this.getChild("d2Node"));
  3906. this.snowNode = (this.getChild("snowNode"));
  3907. this.guide2 = (this.getChild("guide2"));
  3908. this.guide1 = (this.getChild("guide1"));
  3909. this.guide3 = (this.getChild("guide3"));
  3910. this.guideNode = (this.getChild("guideNode"));
  3911. }
  3912. }
  3913. ui_UIGame.URL = "ui://isxx5ak7kt443qg";
  3914. class ui_UIGameEnd extends fgui.GComponent {
  3915. static createInstance() {
  3916. return (fgui.UIPackage.createObject("game", "UIGameEnd"));
  3917. }
  3918. onConstruct() {
  3919. this.c1 = this.getController("c1");
  3920. this.n22 = (this.getChild("n22"));
  3921. this.n2 = (this.getChild("n2"));
  3922. this.n52 = (this.getChild("n52"));
  3923. this.n53 = (this.getChild("n53"));
  3924. this.coinNode = (this.getChild("coinNode"));
  3925. this.closeNode = (this.getChild("closeNode"));
  3926. this.moneyNode = (this.getChild("moneyNode"));
  3927. this.secretary = (this.getChild("secretary"));
  3928. this.n27 = (this.getChild("n27"));
  3929. this.n29 = (this.getChild("n29"));
  3930. this.talkNode = (this.getChild("talkNode"));
  3931. this.n38 = (this.getChild("n38"));
  3932. this.n39 = (this.getChild("n39"));
  3933. this.n40 = (this.getChild("n40"));
  3934. this.awardNode = (this.getChild("awardNode"));
  3935. this.starNumNode = (this.getChild("starNumNode"));
  3936. this.n47 = (this.getChild("n47"));
  3937. this.conditionNode = (this.getChild("conditionNode"));
  3938. this.isGetAward = (this.getChild("isGetAward"));
  3939. this.leftBtn = (this.getChild("leftBtn"));
  3940. this.rightBtn = (this.getChild("rightBtn"));
  3941. this.btnNode = (this.getChild("btnNode"));
  3942. }
  3943. }
  3944. ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3";
  3945. class ui_UIAddCoin extends fgui.GComponent {
  3946. static createInstance() {
  3947. return (fgui.UIPackage.createObject("game", "UIAddCoin"));
  3948. }
  3949. onConstruct() {
  3950. this.n11 = (this.getChild("n11"));
  3951. this.myNode = (this.getChild("myNode"));
  3952. this.t0 = this.getTransition("t0");
  3953. }
  3954. }
  3955. ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs";
  3956. class UIAddCoin extends UIBase {
  3957. constructor() {
  3958. super();
  3959. this.coinNum = 2000;
  3960. }
  3961. onConstructor() {
  3962. this.ui = ui_UIAddCoin.createInstance();
  3963. this.contentPane = this.ui;
  3964. this.isEject = false;
  3965. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  3966. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  3967. }
  3968. show() {
  3969. super.show();
  3970. this.ui.t0.play();
  3971. }
  3972. videoAddCoin() {
  3973. Moyu.showVideoAd(() => {
  3974. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  3975. this.hide();
  3976. }, EAdType.addFailCoin);
  3977. }
  3978. }
  3979. UIAddCoin.uiName = "UIAddCoin";
  3980. class ui_UIInvitation extends fgui.GComponent {
  3981. static createInstance() {
  3982. return (fgui.UIPackage.createObject("game", "UIInvitation"));
  3983. }
  3984. onConstruct() {
  3985. this.n14 = (this.getChild("n14"));
  3986. this.myNode = (this.getChild("myNode"));
  3987. this.t0 = this.getTransition("t0");
  3988. }
  3989. }
  3990. ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r";
  3991. class UIInvitation extends UIBase {
  3992. constructor() {
  3993. super();
  3994. }
  3995. onConstructor() {
  3996. this.ui = ui_UIInvitation.createInstance();
  3997. this.contentPane = this.ui;
  3998. this.isEject = false;
  3999. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  4000. }
  4001. show() {
  4002. super.show();
  4003. }
  4004. enterGame() {
  4005. xGame.common.gameMode = GameMode.classic;
  4006. DataMgr.setChallengeTimes(1);
  4007. xGame.common.passAwardCoin = 2000;
  4008. let need = xGame.common.classicNiceNeddCoin;
  4009. if (DataMgr.coinEnough(need)) {
  4010. DataMgr.setCoin(-need);
  4011. xGame.eventMgr.event(RESTART_GAME, true);
  4012. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  4013. }
  4014. else {
  4015. xGame.eventMgr.event(RESTART_GAME, true);
  4016. }
  4017. this.hide();
  4018. }
  4019. hide() {
  4020. super.hide();
  4021. }
  4022. }
  4023. UIInvitation.uiName = "UIInvitation";
  4024. class ui_UIMain extends fgui.GComponent {
  4025. static createInstance() {
  4026. return (fgui.UIPackage.createObject("game", "UIMain"));
  4027. }
  4028. onConstruct() {
  4029. this.n47 = (this.getChild("n47"));
  4030. this.n10 = (this.getChild("n10"));
  4031. this.secretary = (this.getChild("secretary"));
  4032. this.n33 = (this.getChild("n33"));
  4033. this.shopBtn = (this.getChild("shopBtn"));
  4034. this.moneyNode = (this.getChild("moneyNode"));
  4035. this.headNode = (this.getChild("headNode"));
  4036. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4037. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4038. this.classicBtn = (this.getChild("classicBtn"));
  4039. this.weeklyBtn = (this.getChild("weeklyBtn"));
  4040. this.globalBtn = (this.getChild("globalBtn"));
  4041. this.n44 = (this.getChild("n44"));
  4042. this.signBtn = (this.getChild("signBtn"));
  4043. this.drawBtn = (this.getChild("drawBtn"));
  4044. this.settingNode = (this.getChild("settingNode"));
  4045. this.n45 = (this.getChild("n45"));
  4046. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4047. this.rankBtn = (this.getChild("rankBtn"));
  4048. this.n46 = (this.getChild("n46"));
  4049. this.liucheng1 = (this.getChild("liucheng1"));
  4050. this.rightBtn = (this.getChild("rightBtn"));
  4051. this.n75 = (this.getChild("n75"));
  4052. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4053. this.liucheng2 = (this.getChild("liucheng2"));
  4054. this.guideBtn = (this.getChild("guideBtn"));
  4055. this.n73 = (this.getChild("n73"));
  4056. this.wordsNode = (this.getChild("wordsNode"));
  4057. this.enterGuide = (this.getChild("enterGuide"));
  4058. this.talkNode = (this.getChild("talkNode"));
  4059. this.n83 = (this.getChild("n83"));
  4060. this.n84 = (this.getChild("n84"));
  4061. this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
  4062. this.n87 = (this.getChild("n87"));
  4063. }
  4064. }
  4065. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4066. class ui_UIMoyu extends fgui.GComponent {
  4067. static createInstance() {
  4068. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4069. }
  4070. onConstruct() {
  4071. this.ageTip = (this.getChild("ageTip"));
  4072. this.mainBg = (this.getChild("mainBg"));
  4073. this.xyNode = (this.getChild("xyNode"));
  4074. this.rnNode = (this.getChild("rnNode"));
  4075. this.fcmNode = (this.getChild("fcmNode"));
  4076. this.ageNode = (this.getChild("ageNode"));
  4077. this.tipNode = (this.getChild("tipNode"));
  4078. this.msgNode = (this.getChild("msgNode"));
  4079. }
  4080. }
  4081. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4082. class MoyuMgr {
  4083. static initMoyu() {
  4084. this.moyuView = new MoyuView();
  4085. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4086. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4087. this.moyuView.ui.displayObject.zOrder = 1000;
  4088. this.moyuView.init();
  4089. this.moyuView.showTip(true);
  4090. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4091. window['XApk'] = this;
  4092. }
  4093. static showAge(show) {
  4094. if (this.moyuView)
  4095. this.moyuView.showAge(show);
  4096. }
  4097. static onPlatMsg(idx) {
  4098. if (!MoyuMgr.moyuView)
  4099. return;
  4100. if (idx == '0') {
  4101. MoyuMgr.moyuView.showTip(false);
  4102. }
  4103. }
  4104. static showAgree(call) {
  4105. if (this.moyuView)
  4106. this.moyuView.showAgree(call);
  4107. else
  4108. call && call();
  4109. }
  4110. static showXy(type = 1) {
  4111. if (this.moyuView)
  4112. this.moyuView.showXy(type);
  4113. }
  4114. }
  4115. MoyuMgr.isAdvise = false;
  4116. class MoyuView {
  4117. constructor() {
  4118. this.ysxyNum = 1;
  4119. this.ysJson = null;
  4120. this.ui = ui_UIMoyu.createInstance();
  4121. }
  4122. init() {
  4123. this.ui.mainBg.visible = false;
  4124. this.ui.xyNode.visible = false;
  4125. this.ui.ageNode.visible = false;
  4126. this.ui.tipNode.visible = false;
  4127. this.ui.rnNode.visible = false;
  4128. this.ui.fcmNode.visible = false;
  4129. this.ui.ageTip.visible = false;
  4130. this.ui.msgNode.visible = false;
  4131. this.ui.visible = false;
  4132. this.ui.xyNode.xyList.setVirtual();
  4133. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4134. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4135. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4136. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4137. this.ui.xyNode.btnKnown.visible = false;
  4138. this.ui.xyNode.xy1.visible = false;
  4139. this.ui.xyNode.xy2.visible = false;
  4140. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4141. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4142. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4143. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4144. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4145. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4146. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4147. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4148. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4149. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4150. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4151. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4152. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4153. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4154. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4155. this.ysxyNum = 2;
  4156. }
  4157. }
  4158. onClick(obj) {
  4159. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4160. switch (obj) {
  4161. case this.ui.ageTip:
  4162. if (Moyu.isTTApk) {
  4163. this.ui.ageNode.visible = true;
  4164. this.ui.mainBg.visible = true;
  4165. }
  4166. break;
  4167. case this.ui.tipNode:
  4168. this.showTip(false);
  4169. break;
  4170. case this.ui.ageNode.btnAge:
  4171. this.ui.ageNode.visible = false;
  4172. this.ui.mainBg.visible = false;
  4173. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4174. this.ui.visible = false;
  4175. break;
  4176. case this.ui.xyNode.btnXy3:
  4177. case this.ui.xyNode.btnXy1:
  4178. this.loadXy(1);
  4179. break;
  4180. case this.ui.xyNode.btnXy2:
  4181. this.loadXy(2);
  4182. break;
  4183. case this.ui.xyNode.btnBack:
  4184. this.ui.xyNode.xy1.visible = true;
  4185. this.ui.xyNode.xy2.visible = false;
  4186. break;
  4187. case this.ui.xyNode.btnKnown:
  4188. this.ui.xyNode.visible = false;
  4189. this.ui.mainBg.visible = false;
  4190. this.ui.visible = false;
  4191. break;
  4192. case this.ui.rnNode.btnCheck:
  4193. this.check();
  4194. break;
  4195. case this.ui.rnNode.btnExit:
  4196. case this.ui.xyNode.btnNo:
  4197. this.ysxyNum--;
  4198. if (this.ysxyNum > 0)
  4199. this.showMsg("再次拒绝退出游戏");
  4200. else {
  4201. Moyu.userAgree(false);
  4202. Moyu.exit();
  4203. }
  4204. break;
  4205. case this.ui.xyNode.btnSure:
  4206. case this.ui.xyNode.btnYes:
  4207. DataMgr.userData.isAgree = true;
  4208. DataMgr.saveUserData();
  4209. this.onAgree();
  4210. break;
  4211. case this.ui.rnNode.btnDone:
  4212. this.ui.rnNode.visible = false;
  4213. this.ui.visible = false;
  4214. break;
  4215. case this.ui.fcmNode.btnRn:
  4216. this.showRn();
  4217. break;
  4218. }
  4219. }
  4220. showTip(show) {
  4221. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4222. return;
  4223. if (show) {
  4224. MoyuMgr.isAdvise = true;
  4225. this.ui.visible = true;
  4226. this.ui.tipNode.visible = true;
  4227. this.ui.tipNode.alpha = 1;
  4228. Laya.timer.once(1000, this, this.showTip, [false]);
  4229. }
  4230. else {
  4231. this.ui.tipNode.alpha = 1;
  4232. this.ui.tipNode.visible = true;
  4233. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4234. this.ui.tipNode.visible = false;
  4235. MoyuMgr.isAdvise = false;
  4236. }), 1000);
  4237. }
  4238. }
  4239. showAge(show, px = 0, py = 0) {
  4240. if (Moyu.platType > 10 && !Moyu.isIos) {
  4241. this.ui.ageTip.x = px;
  4242. this.ui.ageTip.y = py;
  4243. this.ui.ageTip.visible = show;
  4244. if (show)
  4245. this.ui.visible = true;
  4246. }
  4247. }
  4248. showAgree(call) {
  4249. this.agreeCall = call;
  4250. this.onAgree();
  4251. return;
  4252. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4253. this.showXy(0);
  4254. }
  4255. else
  4256. this.onAgree();
  4257. }
  4258. onAgree() {
  4259. if (!this.ui.ageNode.visible)
  4260. this.ui.visible = false;
  4261. this.ui.xyNode.visible = false;
  4262. Moyu.userAgree(true);
  4263. this.showAge(false);
  4264. this.agreeCall && this.agreeCall();
  4265. this.showRn();
  4266. }
  4267. showMsg(txt) {
  4268. this.ui.msgNode.txtMsg.text = txt;
  4269. this.ui.msgNode.visible = true;
  4270. this.ui.msgNode.alpha = 1;
  4271. this.ui.visible = true;
  4272. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4273. this.ui.msgNode.visible = false;
  4274. }), 2500, true);
  4275. }
  4276. showRn() {
  4277. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4278. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4279. this.ui.rnNode.rn1.visible = true;
  4280. this.ui.rnNode.rn2.visible = false;
  4281. this.ui.rnNode.rn3.visible = false;
  4282. this.ui.rnNode.rn4.visible = false;
  4283. this.ui.rnNode.visible = true;
  4284. this.ui.mainBg.visible = true;
  4285. this.ui.rnNode.btnDone.visible = false;
  4286. this.ui.rnNode.btnExit.visible = true;
  4287. this.ui.rnNode.btnCheck.visible = true;
  4288. this.ui.fcmNode.visible = false;
  4289. this.ui.visible = true;
  4290. return;
  4291. }
  4292. }
  4293. this.showFcm();
  4294. }
  4295. showFcm() {
  4296. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4297. Moyu.initFCM(true);
  4298. if (Moyu.gameTime < 1)
  4299. this.fcmLoop();
  4300. else if (Moyu.gameTime < 999)
  4301. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4302. }
  4303. }
  4304. fcmLoop() {
  4305. if (Moyu.gameTime < 1) {
  4306. this.ui.rnNode.visible = false;
  4307. this.ui.fcmNode.visible = true;
  4308. this.ui.mainBg.visible = true;
  4309. this.ui.visible = true;
  4310. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4311. Laya.timer.clear(this.ui, this.fcmLoop);
  4312. }
  4313. }
  4314. check() {
  4315. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4316. this.ui.rnNode.rn1.visible = false;
  4317. this.ui.rnNode.rn2.visible = false;
  4318. this.ui.rnNode.rn4.visible = true;
  4319. }
  4320. else if (this.ui.rnNode.rn4.visible) {
  4321. let name = this.ui.rnNode.inputName.text;
  4322. let code = this.ui.rnNode.inputCode.text;
  4323. if (code && code.length == 18) {
  4324. this.ui.rnNode.rn1.visible = false;
  4325. this.ui.rnNode.rn4.visible = false;
  4326. Moyu.authenticate(name, code, (res) => {
  4327. this.ui.rnNode.rn2.visible = !res;
  4328. this.ui.rnNode.rn3.visible = res;
  4329. this.ui.rnNode.btnDone.visible = res;
  4330. this.ui.rnNode.btnExit.visible = !res;
  4331. this.ui.rnNode.btnCheck.visible = !res;
  4332. if (res)
  4333. this.showFcm();
  4334. });
  4335. }
  4336. else
  4337. this.showMsg("信息填写不完整");
  4338. }
  4339. }
  4340. loadXy(type = 0) {
  4341. this.ui.xyNode.xy1.visible = false;
  4342. this.ui.xyNode.xy2.visible = true;
  4343. this.ui.xyNode.xyList.scrollToView(0);
  4344. if (type == 1) {
  4345. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4346. }
  4347. else if (type == 2) {
  4348. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4349. }
  4350. }
  4351. showXy(type = 0) {
  4352. this.xyBtn();
  4353. if (type == 0) {
  4354. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4355. this.ui.xyNode.btnSure.visible = true;
  4356. }
  4357. else {
  4358. this.ui.xyNode.btnYes.visible = true;
  4359. this.ui.xyNode.btnNo.visible = true;
  4360. }
  4361. }
  4362. else {
  4363. this.ui.xyNode.btnKnown.visible = true;
  4364. this.ui.mainBg.visible = true;
  4365. }
  4366. this.ui.xyNode.xy1.visible = true;
  4367. this.ui.xyNode.xy2.visible = false;
  4368. this.ui.xyNode.visible = true;
  4369. this.ui.visible = true;
  4370. }
  4371. xyBtn() {
  4372. this.ui.xyNode.btnSure.visible = false;
  4373. this.ui.xyNode.btnYes.visible = false;
  4374. this.ui.xyNode.btnNo.visible = false;
  4375. this.ui.xyNode.btnKnown.visible = false;
  4376. {
  4377. this.ui.xyNode.btnXy3.visible = false;
  4378. this.ui.xyNode.btnXy2.visible = true;
  4379. this.ui.xyNode.btnXy1.visible = true;
  4380. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4381. }
  4382. }
  4383. createXY(json) {
  4384. this.ysJson = json.content;
  4385. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4386. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4387. this.ui.xyNode.xy2.visible = true;
  4388. }
  4389. renderListItem(idx, cell) {
  4390. let xy = this.ysJson[idx];
  4391. cell.height = xy.line * 30;
  4392. cell.xyItem.text = xy.text;
  4393. }
  4394. onDestroy() {
  4395. this.agreeCall = null;
  4396. }
  4397. }
  4398. class SettingNode {
  4399. constructor(ui) {
  4400. this.showSetting = false;
  4401. this.openSound = true;
  4402. this.openShake = true;
  4403. this.ui = ui;
  4404. this.ui.soundBtn.onClick(this, this.switchSound);
  4405. this.ui.shakeBtn.onClick(this, this.switchShake);
  4406. this.ui.xyBtn.onClick(this, this.onXy);
  4407. this.ui.clickNode.onClick(this, this.changeSetting);
  4408. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4409. }
  4410. changeSetting() {
  4411. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4412. this.showSetting = !this.showSetting;
  4413. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4414. }
  4415. switchSound() {
  4416. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4417. this.openSound = !this.openSound;
  4418. Moyu.onSetting(this.openSound, this.openShake);
  4419. xGame.soundMgr.onSetting(this.openSound);
  4420. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4421. }
  4422. switchShake() {
  4423. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4424. this.openShake = !this.openShake;
  4425. Moyu.onSetting(this.openSound, this.openShake);
  4426. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4427. }
  4428. onXy() {
  4429. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4430. MoyuMgr.showXy(1);
  4431. }
  4432. }
  4433. class ui_UILevelDisplay extends fgui.GComponent {
  4434. static createInstance() {
  4435. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4436. }
  4437. onConstruct() {
  4438. this.n9 = (this.getChild("n9"));
  4439. this.myNode = (this.getChild("myNode"));
  4440. this.closeNode = (this.getChild("closeNode"));
  4441. }
  4442. }
  4443. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4444. class ui_UILevelProp extends fgui.GComponent {
  4445. static createInstance() {
  4446. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4447. }
  4448. onConstruct() {
  4449. this.n16 = (this.getChild("n16"));
  4450. this.myNode = (this.getChild("myNode"));
  4451. this.closeBtn = (this.getChild("closeBtn"));
  4452. this.moneyNode = (this.getChild("moneyNode"));
  4453. this.t1 = this.getTransition("t1");
  4454. }
  4455. }
  4456. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  4457. class ui_ShowItem extends fgui.GComponent {
  4458. static createInstance() {
  4459. return (fgui.UIPackage.createObject("game", "ShowItem"));
  4460. }
  4461. onConstruct() {
  4462. this.myImg = (this.getChild("myImg"));
  4463. }
  4464. }
  4465. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  4466. class ShowItem {
  4467. constructor() {
  4468. this.ui = ui_ShowItem.createInstance();
  4469. }
  4470. destroySelf() {
  4471. if (!this.ui.isDisposed) {
  4472. this.ui.removeFromParent();
  4473. this.ui.dispose();
  4474. }
  4475. }
  4476. setParent(parent) {
  4477. parent.addChild(this.ui);
  4478. }
  4479. setPos(x, y) {
  4480. this.ui.x = x;
  4481. this.ui.y = y;
  4482. }
  4483. setUrl(index) {
  4484. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  4485. }
  4486. }
  4487. class ui_UIPower extends fgui.GComponent {
  4488. static createInstance() {
  4489. return (fgui.UIPackage.createObject("game", "UIPower"));
  4490. }
  4491. onConstruct() {
  4492. this.n11 = (this.getChild("n11"));
  4493. this.myNode = (this.getChild("myNode"));
  4494. this.t0 = this.getTransition("t0");
  4495. }
  4496. }
  4497. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  4498. class UIPower extends UIBase {
  4499. constructor() {
  4500. super();
  4501. }
  4502. onConstructor() {
  4503. this.ui = ui_UIPower.createInstance();
  4504. this.contentPane = this.ui;
  4505. this.isEject = false;
  4506. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4507. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  4508. }
  4509. show() {
  4510. super.show();
  4511. this.ui.t0.play();
  4512. }
  4513. videoGetPower() {
  4514. Moyu.showVideoAd(() => {
  4515. DataMgr.setPower(xGame.common.videoPower, true);
  4516. xGame.eventMgr.event(POWER_TIME);
  4517. this.hide();
  4518. }, EAdType.getPower);
  4519. }
  4520. }
  4521. UIPower.uiName = "UIPower";
  4522. class UILevelProp extends UIBase {
  4523. constructor() {
  4524. super();
  4525. this.firstPos = 385;
  4526. this.secondPos = 467;
  4527. this.showItemArr = [];
  4528. }
  4529. onConstructor() {
  4530. this.ui = ui_UILevelProp.createInstance();
  4531. this.contentPane = this.ui;
  4532. this.isEject = false;
  4533. this.addUIClick(this.ui.closeBtn, this.hide);
  4534. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  4535. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  4536. }
  4537. show(level) {
  4538. super.show();
  4539. this.ui.t1.play();
  4540. this.level = level;
  4541. this.data = cfgTable.placeballData[this.level];
  4542. this.updateSelf();
  4543. this.showPreView();
  4544. this.moneyNode.ui.c1.selectedIndex = 2;
  4545. this.moneyNode.checkPowerTime();
  4546. this.moneyNode.powerChange();
  4547. }
  4548. showPreView() {
  4549. let item;
  4550. let data;
  4551. for (let index = 0; index < this.showItemArr.length; index++) {
  4552. item = this.showItemArr[index];
  4553. item.destroySelf();
  4554. }
  4555. this.showItemArr = [];
  4556. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  4557. for (const key in cfgData) {
  4558. data = cfgData[key];
  4559. item = new ShowItem();
  4560. item.setParent(this.ui.myNode.displayRoot);
  4561. item.setPos(data.x, data.y);
  4562. item.setUrl(data.value);
  4563. this.showItemArr.push(item);
  4564. }
  4565. }
  4566. updateSelf() {
  4567. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  4568. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  4569. if (this.data.ball == -1) {
  4570. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  4571. }
  4572. else {
  4573. this.ui.myNode.conditionTxt.text = "Reward";
  4574. }
  4575. let localData = DataMgr.getPlaceBallLevel(this.level);
  4576. let getAward = localData.getAward;
  4577. let cfg = cfgTable.placeballData[this.level];
  4578. let coin = this.data.award[0];
  4579. let diamond = this.data.award[1];
  4580. if (cfg.type == PlaceBallType.challenge) {
  4581. diamond = 0;
  4582. coin = 100;
  4583. }
  4584. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  4585. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  4586. this.ui.myNode.coinNode.numTxt.text = coin + "";
  4587. if (cfg.type == PlaceBallType.challenge) {
  4588. this.ui.myNode.coinNode.numTxt.text = "";
  4589. }
  4590. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  4591. if (coin > 0 && diamond > 0) {
  4592. this.ui.myNode.diamondNode.x = 385;
  4593. this.ui.myNode.coinNode.x = 467;
  4594. }
  4595. else {
  4596. this.ui.myNode.diamondNode.x = 385;
  4597. this.ui.myNode.coinNode.x = 385;
  4598. }
  4599. if (!getAward) {
  4600. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  4601. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  4602. }
  4603. else {
  4604. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  4605. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  4606. }
  4607. }
  4608. startGame() {
  4609. if (DataMgr.powerEnough()) {
  4610. this.ui.myNode.startBtn.touchable = false;
  4611. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  4612. console.log('zh:startGame ');
  4613. this.ui.myNode.startBtn.touchable = true;
  4614. DataMgr.setPower(-1);
  4615. xGame.eventMgr.event(POWER_TIME);
  4616. xGame.common.gameMode = GameMode.placeBall;
  4617. xGame.common.placeBallCurLevel = this.level;
  4618. xGame.uiMgr.Show(UIGame);
  4619. xGame.uiMgr.Hide(UILevelDisplay);
  4620. xGame.uiMgr.Hide(UIMain);
  4621. this.hide();
  4622. }));
  4623. }
  4624. else {
  4625. xGame.uiMgr.Show(UIPower);
  4626. }
  4627. }
  4628. hide() {
  4629. super.hide();
  4630. }
  4631. }
  4632. UILevelProp.uiName = "UILevelProp";
  4633. class PutBallLevelDisplay {
  4634. constructor(ui, index) {
  4635. this.index = 0;
  4636. this.ui = ui;
  4637. this.index = index;
  4638. this.ui.onClick(this, this.clickSelf);
  4639. this.updateSelf();
  4640. this.ui.levelTxt.text = (this.index + 1) + "";
  4641. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  4642. this.ui.special.levelTxt.text = (this.index + 1) + "";
  4643. }
  4644. updateSelf() {
  4645. let level = this.index + 1;
  4646. this.data = DataMgr.getPlaceBallLevel(level);
  4647. this.ui.starNode.c1.selectedIndex = this.data.star;
  4648. let isChallenge = cfgTable.placeballData[level].type;
  4649. if (this.data.isCur) {
  4650. if (isChallenge) {
  4651. this.ui.c1.selectedIndex = 5;
  4652. }
  4653. else {
  4654. this.ui.c1.selectedIndex = 2;
  4655. }
  4656. }
  4657. else {
  4658. if (this.data.play) {
  4659. if (this.data.star == 3) {
  4660. this.ui.c1.selectedIndex = 0;
  4661. }
  4662. else {
  4663. this.ui.c1.selectedIndex = 1;
  4664. }
  4665. }
  4666. else {
  4667. if (isChallenge) {
  4668. this.ui.c1.selectedIndex = 4;
  4669. }
  4670. else {
  4671. this.ui.c1.selectedIndex = 3;
  4672. }
  4673. }
  4674. }
  4675. }
  4676. clickSelf() {
  4677. if (!this.data.play)
  4678. return;
  4679. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4680. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  4681. }
  4682. }
  4683. class UILevelDisplay extends UIBase {
  4684. constructor() {
  4685. super();
  4686. }
  4687. onConstructor() {
  4688. this.ui = ui_UILevelDisplay.createInstance();
  4689. this.contentPane = this.ui;
  4690. this.isEject = false;
  4691. this.myList = this.ui.myNode.myList;
  4692. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  4693. this.levelItemArr = [];
  4694. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  4695. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  4696. this.myList.numItems = levelNum;
  4697. if (Moyu.isKs)
  4698. this.ui.closeNode.closeBtn.x += 100;
  4699. }
  4700. levelItemRender(index, target) {
  4701. let item = new PutBallLevelDisplay(target, index);
  4702. this.levelItemArr.push(item);
  4703. }
  4704. show() {
  4705. super.show();
  4706. this.updateLevel();
  4707. this.scrollToPlace();
  4708. }
  4709. updateLevel() {
  4710. let temp;
  4711. for (let index = 0; index < this.levelItemArr.length; index++) {
  4712. temp = this.levelItemArr[index];
  4713. temp.updateSelf();
  4714. }
  4715. }
  4716. scrollToPlace() {
  4717. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  4718. let passArr = DataMgr.getPlaceBallLevelList();
  4719. let offest = passArr.length;
  4720. if (offest >= maxNum - 1)
  4721. offest = maxNum - 1;
  4722. this.myList.scrollToView(offest, true, true);
  4723. }
  4724. hide() {
  4725. super.hide();
  4726. }
  4727. }
  4728. UILevelDisplay.uiName = "UILevelDisplay";
  4729. class ui_UIMatching extends fgui.GComponent {
  4730. static createInstance() {
  4731. return (fgui.UIPackage.createObject("game", "UIMatching"));
  4732. }
  4733. onConstruct() {
  4734. this.n5 = (this.getChild("n5"));
  4735. this.n49 = (this.getChild("n49"));
  4736. this.n51 = (this.getChild("n51"));
  4737. this.n64 = (this.getChild("n64"));
  4738. this.n2 = (this.getChild("n2"));
  4739. this.n53 = (this.getChild("n53"));
  4740. this.n54 = (this.getChild("n54"));
  4741. this.n56 = (this.getChild("n56"));
  4742. this.n58 = (this.getChild("n58"));
  4743. this.n59 = (this.getChild("n59"));
  4744. this.n57 = (this.getChild("n57"));
  4745. this.n60 = (this.getChild("n60"));
  4746. this.n62 = (this.getChild("n62"));
  4747. this.awardTxt = (this.getChild("awardTxt"));
  4748. this.n61 = (this.getChild("n61"));
  4749. this.selfHead = (this.getChild("selfHead"));
  4750. this.aiHead = (this.getChild("aiHead"));
  4751. this.n82 = (this.getChild("n82"));
  4752. this.n84 = (this.getChild("n84"));
  4753. this.n83 = (this.getChild("n83"));
  4754. this.t1 = this.getTransition("t1");
  4755. this.t2 = this.getTransition("t2");
  4756. this.t3 = this.getTransition("t3");
  4757. this.t4 = this.getTransition("t4");
  4758. }
  4759. }
  4760. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  4761. class UIMatching extends UIBase {
  4762. constructor() {
  4763. super();
  4764. }
  4765. onConstructor() {
  4766. this.ui = ui_UIMatching.createInstance();
  4767. this.contentPane = this.ui;
  4768. this.isEject = false;
  4769. }
  4770. show(callback) {
  4771. super.show();
  4772. PlatMgr.showBanner(true);
  4773. this.callback = callback;
  4774. let user = Moyu.getUserInfo();
  4775. if (!this.selfPot) {
  4776. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  4777. }
  4778. if (!this.aiPot) {
  4779. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  4780. }
  4781. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  4782. this.ui.selfHead.nameTxt.text = user.nickName;
  4783. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  4784. this.ui.aiHead.nameTxt.text = "???";
  4785. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  4786. this.ui.selfHead.c1.selectedIndex = 0;
  4787. this.ui.aiHead.c1.selectedIndex = 0;
  4788. this.ui.selfHead.x = this.selfPot.x;
  4789. this.ui.selfHead.y = this.selfPot.y;
  4790. this.ui.aiHead.x = this.aiPot.x;
  4791. this.ui.aiHead.y = this.aiPot.y;
  4792. switch (xGame.common.gameMode) {
  4793. case GameMode.classic:
  4794. break;
  4795. case GameMode.bigMove:
  4796. this.initSkillData();
  4797. break;
  4798. default:
  4799. break;
  4800. }
  4801. this.ui.t1.play(Laya.Handler.create(this, () => {
  4802. this.ui.t2.play(Laya.Handler.create(this, () => {
  4803. switch (xGame.common.gameMode) {
  4804. case GameMode.classic:
  4805. this.waitingPeople();
  4806. break;
  4807. case GameMode.bigMove:
  4808. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  4809. break;
  4810. default:
  4811. break;
  4812. }
  4813. }));
  4814. }));
  4815. }
  4816. initSkillData() {
  4817. this.skillSelectData = [];
  4818. let skillUrl = xGame.common.skillIconList;
  4819. let skillName = xGame.common.skillNameList;
  4820. let skillLevel = DataMgr.getBigSkillList();
  4821. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  4822. for (let index = 0; index < 5; index++) {
  4823. let obj = {};
  4824. obj.skillImg = skillUrl[index];
  4825. obj.skillName = skillName[index];
  4826. obj.skillType = skillType[index];
  4827. obj.skillLevel = skillLevel[index];
  4828. this.skillSelectData.push(obj);
  4829. }
  4830. }
  4831. getAISkillLevel(myLevel) {
  4832. let video = xGame.common.upSkillLevel;
  4833. let aiLevel;
  4834. let temp;
  4835. if (video) {
  4836. temp = xGame.common.randomNum(-2, -1);
  4837. }
  4838. else {
  4839. if (myLevel <= 5) {
  4840. temp = xGame.common.randomNum(1, 3);
  4841. }
  4842. else if (myLevel <= 9) {
  4843. temp = xGame.common.randomNum(-2, 1);
  4844. }
  4845. else {
  4846. temp = xGame.common.randomNum(-4, 0);
  4847. }
  4848. }
  4849. aiLevel = temp + myLevel;
  4850. if (aiLevel <= 1)
  4851. aiLevel = 1;
  4852. if (aiLevel >= 10)
  4853. aiLevel = 10;
  4854. return aiLevel;
  4855. }
  4856. getAISkillType() {
  4857. return xGame.common.randomNum(1, 4);
  4858. let successTimes = DataMgr.getSkillSuccessTimes();
  4859. let info = cfgTable.aiskillData[successTimes];
  4860. if (!info) {
  4861. let max = Object.keys(cfgTable.aiskillData).length - 1;
  4862. info = cfgTable.aiskillData[max];
  4863. }
  4864. let dataArr = info.skillselect;
  4865. let myCfg = {};
  4866. for (let index = 0; index < dataArr.length; index++) {
  4867. let temp = dataArr[index].split('-');
  4868. myCfg[temp[0]] = {};
  4869. myCfg[temp[0]].id = parseInt(temp[0]);
  4870. myCfg[temp[0]].weight = parseInt(temp[1]);
  4871. }
  4872. let aiCfg = xGame.common.initWeight(myCfg);
  4873. let curData = xGame.common.getRandomWeightData(aiCfg);
  4874. return parseInt(curData.id);
  4875. }
  4876. getAISkillData(index) {
  4877. let myLevel = this.skillSelectData[index].skillLevel;
  4878. let aiLevel = this.getAISkillLevel(myLevel);
  4879. let aiType = this.getAISkillType() - 1;
  4880. return { aiLevel, aiType } = { aiLevel, aiType };
  4881. }
  4882. skillSelectFinish(index) {
  4883. let aiInfo = this.getAISkillData(index);
  4884. xGame.common.gameMgr.selfCurSkill = index;
  4885. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  4886. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  4887. this.ui.selfHead.c1.selectedIndex = 1;
  4888. this.ui.aiHead.c1.selectedIndex = 1;
  4889. let myData = this.skillSelectData[index];
  4890. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  4891. let guide = DataMgr.getSkillGuide();
  4892. if (guide == 0) {
  4893. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  4894. }
  4895. else {
  4896. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  4897. }
  4898. let aiData = this.skillSelectData[aiInfo.aiType];
  4899. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  4900. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  4901. this.waitingPeople();
  4902. }
  4903. waitingPeople() {
  4904. let time = xGame.common.randomNum(1000, 3000);
  4905. time += 1000;
  4906. Laya.timer.once(time, this, () => {
  4907. this.matchingSuccess();
  4908. });
  4909. }
  4910. matchingSuccess() {
  4911. let gameUI = xGame.common.gameUI;
  4912. let name = gameUI.ui.topNode.aiNameTxt.text;
  4913. let url = gameUI.ui.topNode.aiHeadLoader.url;
  4914. this.ui.aiHead.nameTxt.text = name;
  4915. this.ui.aiHead.headImg.url = url;
  4916. name = gameUI.ui.topNode.selfNameTxt.text;
  4917. url = gameUI.ui.topNode.selfHeadLoader.url;
  4918. this.ui.selfHead.nameTxt.text = name;
  4919. this.ui.selfHead.headImg.url = url;
  4920. this.ui.t3.play(Laya.Handler.create(this, () => {
  4921. this.callback && this.callback();
  4922. this.ui.t4.play(Laya.Handler.create(this, () => {
  4923. this.destroySelf();
  4924. }));
  4925. }));
  4926. }
  4927. destroySelf() {
  4928. this.callback = null;
  4929. this.skillSelectData = null;
  4930. this.selfPot = null;
  4931. this.aiPot = null;
  4932. if (!this.ui.isDisposed) {
  4933. this.ui.removeFromParent();
  4934. this.ui.dispose();
  4935. }
  4936. xGame.uiMgr.destroyUI(this);
  4937. }
  4938. }
  4939. UIMatching.uiName = "UIMatching";
  4940. class ui_UIRanking extends fgui.GComponent {
  4941. static createInstance() {
  4942. return (fgui.UIPackage.createObject("game", "UIRanking"));
  4943. }
  4944. onConstruct() {
  4945. this.n26 = (this.getChild("n26"));
  4946. this.myNode = (this.getChild("myNode"));
  4947. }
  4948. }
  4949. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  4950. class UIRanking extends UIBase {
  4951. constructor() {
  4952. super();
  4953. this.showSelf = true;
  4954. this.rankType = 1;
  4955. this.rankList = [];
  4956. this.myIndex = 0;
  4957. this.myStar = 0;
  4958. }
  4959. onConstructor() {
  4960. this.ui = ui_UIRanking.createInstance();
  4961. this.contentPane = this.ui;
  4962. this.isEject = false;
  4963. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  4964. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  4965. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  4966. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  4967. this.ui.myNode.myList.setVirtual();
  4968. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  4969. }
  4970. show() {
  4971. super.show();
  4972. this.myIndex = 51;
  4973. Moyu.getRankList({
  4974. rankId: xGame.common.curRankID,
  4975. type: MoyuRankType.total,
  4976. page: 1,
  4977. pageSize: 50,
  4978. }, this, this.updateItemData);
  4979. this.updateSelf();
  4980. let self = Moyu.getUserInfo();
  4981. if (!self.isAuth) {
  4982. Moyu.initUser(this, () => {
  4983. DataMgr.upRankData();
  4984. });
  4985. }
  4986. }
  4987. updateSelfItem() {
  4988. let self = Moyu.getUserInfo();
  4989. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  4990. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > 50 ? "未上榜" : this.myIndex.toString();
  4991. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  4992. this.ui.myNode.selfNode.nameTxt.text = Moyu.platType < 11 ? self.nickName : "myself";
  4993. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  4994. }
  4995. updateItemData(data) {
  4996. this.myStar = xGame.common.getAllStarNum();
  4997. if (this.rankList.length < 2) {
  4998. this.rankList = data;
  4999. let self = Moyu.getUserInfo();
  5000. for (let i = 0; i < data.length; i++) {
  5001. let data = this.rankList[i];
  5002. if (data.userId == self.userId) {
  5003. this.rankList.splice(i, 1);
  5004. break;
  5005. }
  5006. }
  5007. for (let i = 0; i < data.length; i++) {
  5008. let data = this.rankList[i];
  5009. if (data.rankScore < this.myStar && this.myIndex > 50) {
  5010. this.myIndex = i + 1;
  5011. let user = { headIcon: self.headIcon, nickName: "myself" };
  5012. let ud = { user: user, data: {} };
  5013. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5014. if (Moyu.platType < 11) {
  5015. user.headIcon = self.headIcon;
  5016. user.nickName = self.nickName;
  5017. }
  5018. this.rankList.splice(i, 0, md);
  5019. break;
  5020. }
  5021. }
  5022. }
  5023. this.updateSelfItem();
  5024. this.ui.myNode.myList.numItems = this.rankList.length;
  5025. }
  5026. updateItemUI(index, obj) {
  5027. let data = this.rankList[index];
  5028. let userData = JSON.parse(data.userData).user;
  5029. obj.nameTxt.text = userData.nickName.toString();
  5030. obj.valueTxt.text = data.rankScore;
  5031. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5032. obj.rankTxt.text = index + 1;
  5033. switch (index) {
  5034. case 0:
  5035. this.setImg(obj, 1, 0, 0);
  5036. obj.rankTxt.color = "#FFC047";
  5037. break;
  5038. case 1:
  5039. this.setImg(obj, 0, 1, 0);
  5040. obj.rankTxt.color = "#ACACAC";
  5041. break;
  5042. case 2:
  5043. this.setImg(obj, 0, 0, 1);
  5044. obj.rankTxt.color = "#D09672";
  5045. break;
  5046. default:
  5047. this.setImg(obj, 0, 0, 0);
  5048. obj.rankTxt.color = "#496FAB";
  5049. break;
  5050. }
  5051. }
  5052. setImg(obj, a, b, c) {
  5053. obj.img1.visible = a ? true : false;
  5054. obj.img2.visible = b ? true : false;
  5055. obj.img3.visible = c ? true : false;
  5056. }
  5057. changeList(type) {
  5058. this.rankType = type;
  5059. this.updateSelf();
  5060. }
  5061. changeSelfNode() {
  5062. this.showSelf = !this.showSelf;
  5063. this.updateSelf();
  5064. }
  5065. updateSelf() {
  5066. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5067. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5068. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5069. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5070. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5071. }
  5072. }
  5073. UIRanking.uiName = "UIRanking";
  5074. class ui_UISecretary extends fgui.GComponent {
  5075. static createInstance() {
  5076. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5077. }
  5078. onConstruct() {
  5079. this.n0 = (this.getChild("n0"));
  5080. this.myNode = (this.getChild("myNode"));
  5081. this.rightBtn = (this.getChild("rightBtn"));
  5082. this.leftBtn = (this.getChild("leftBtn"));
  5083. this.closeBtn = (this.getChild("closeBtn"));
  5084. this.t0 = this.getTransition("t0");
  5085. }
  5086. }
  5087. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5088. class UISecretary extends UIBase {
  5089. constructor() {
  5090. super();
  5091. this.curIndex = 1;
  5092. }
  5093. onConstructor() {
  5094. this.ui = ui_UISecretary.createInstance();
  5095. this.contentPane = this.ui;
  5096. this.isEject = false;
  5097. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5098. this.addUIClick(this.ui.leftBtn, this.turnLeft);
  5099. this.addUIClick(this.ui.rightBtn, this.turnRight);
  5100. this.nodeObj = { left: null, right: null, cur: null };
  5101. this.nodeObj.left = this.ui.myNode.gameNode1;
  5102. this.nodeObj.right = this.ui.myNode.gameNode2;
  5103. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5104. }
  5105. show() {
  5106. super.show();
  5107. this.ui.t0.play();
  5108. this.updateData();
  5109. }
  5110. addSecretarySpine(node, spineName) {
  5111. if (spineName == "mishu") {
  5112. if (this.secretarySpine1) {
  5113. node.displayObject.destroyChildren();
  5114. this.playWoman(this.secretarySpine1, node.displayObject);
  5115. }
  5116. else {
  5117. let spine1 = new SpineMgr("mishu", () => {
  5118. this.secretarySpine1 = spine1;
  5119. this.playWoman(this.secretarySpine1, node.displayObject);
  5120. });
  5121. }
  5122. }
  5123. else {
  5124. if (this.secretarySpine2) {
  5125. node.displayObject.destroyChildren();
  5126. this.playWoman(this.secretarySpine2, node.displayObject);
  5127. }
  5128. else {
  5129. let spine2 = new SpineMgr("xiaomishu2", () => {
  5130. this.secretarySpine2 = spine2;
  5131. this.playWoman(this.secretarySpine2, node.displayObject);
  5132. });
  5133. }
  5134. }
  5135. }
  5136. playWoman(node, parent) {
  5137. let xx = this.ui.myNode.gameNode1.secretary.width / 2;
  5138. let yy = this.ui.myNode.gameNode1.secretary.height;
  5139. let scale = 1.5;
  5140. if (node == this.secretarySpine2) {
  5141. scale = 1.2;
  5142. }
  5143. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5144. node.play(data, 1, true, parent);
  5145. }
  5146. turnLeft() {
  5147. this.curIndex--;
  5148. if (this.curIndex < 1) {
  5149. this.curIndex = 2;
  5150. }
  5151. let left = this.nodeObj.left;
  5152. let right = this.nodeObj.right;
  5153. let cur = this.nodeObj.cur;
  5154. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5155. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5156. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5157. this.updateData();
  5158. }));
  5159. this.ui.myNode.setChildIndex(right, 2);
  5160. this.nodeObj.left = cur;
  5161. this.nodeObj.right = left;
  5162. this.nodeObj.cur = right;
  5163. }
  5164. turnRight() {
  5165. this.curIndex++;
  5166. if (this.curIndex > 2) {
  5167. this.curIndex = 1;
  5168. }
  5169. let left = this.nodeObj.left;
  5170. let right = this.nodeObj.right;
  5171. let cur = this.nodeObj.cur;
  5172. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5173. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5174. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5175. this.updateData();
  5176. }));
  5177. this.ui.myNode.setChildIndex(left, 2);
  5178. this.nodeObj.left = right;
  5179. this.nodeObj.right = cur;
  5180. this.nodeObj.cur = left;
  5181. }
  5182. updateData() {
  5183. let data = cfgTable.secretaryshopData;
  5184. let children = this.ui.myNode._children;
  5185. let temp;
  5186. let curData;
  5187. for (let index = 0; index < children.length; index++) {
  5188. temp = children[index];
  5189. if (index == 2) {
  5190. curData = data[this.curIndex];
  5191. temp.purchaseBtn.touchable = true;
  5192. }
  5193. else {
  5194. temp.purchaseBtn.touchable = false;
  5195. if (this.curIndex == 1) {
  5196. curData = data[2];
  5197. }
  5198. else {
  5199. curData = data[1];
  5200. }
  5201. }
  5202. temp.heightTxt.text = curData.height;
  5203. temp.foodTxt.text = curData.food;
  5204. temp.historyTxt.text = curData.history;
  5205. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5206. this.addSecretarySpine(temp.secretary, curData.spine);
  5207. let womanIndex = curData.id - 1;
  5208. let getWoman = DataMgr.getSecretary(womanIndex);
  5209. let curUse = DataMgr.getCurSecretary();
  5210. if (getWoman) {
  5211. if (curUse == womanIndex) {
  5212. temp.purchaseBtn.c1.selectedIndex = 1;
  5213. }
  5214. else {
  5215. temp.purchaseBtn.c1.selectedIndex = 2;
  5216. }
  5217. }
  5218. else {
  5219. temp.purchaseBtn.c1.selectedIndex = 0;
  5220. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5221. }
  5222. temp.purchaseBtn.offClick(this, this.clickSecretary);
  5223. temp.purchaseBtn.onClick(this, this.clickSecretary, [getWoman, curUse, womanIndex, curData.price]);
  5224. }
  5225. }
  5226. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5227. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5228. if (getWoman) {
  5229. if (curUse != womanIndex) {
  5230. console.log();
  5231. DataMgr.setCurSecretary(womanIndex);
  5232. this.updateData();
  5233. }
  5234. }
  5235. else {
  5236. let need = needDiamond;
  5237. if (DataMgr.diamondEnough(need)) {
  5238. DataMgr.setDiamond(-need);
  5239. DataMgr.setSecretary(womanIndex, 1);
  5240. DataMgr.setCurSecretary(womanIndex);
  5241. this.updateData();
  5242. }
  5243. else {
  5244. xGame.uiMgr.Show(UIAddProp, 1);
  5245. }
  5246. }
  5247. }
  5248. closeSelf() {
  5249. this.hide();
  5250. }
  5251. }
  5252. UISecretary.uiName = "UISecretary";
  5253. class ui_UIShop extends fgui.GComponent {
  5254. static createInstance() {
  5255. return (fgui.UIPackage.createObject("game", "UIShop"));
  5256. }
  5257. onConstruct() {
  5258. this.n48 = (this.getChild("n48"));
  5259. this.n0 = (this.getChild("n0"));
  5260. this.secretary = (this.getChild("secretary"));
  5261. this.talkNode = (this.getChild("talkNode"));
  5262. this.closeNode = (this.getChild("closeNode"));
  5263. this.moneyNode = (this.getChild("moneyNode"));
  5264. this.myNode = (this.getChild("myNode"));
  5265. }
  5266. }
  5267. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5268. class BallRodDisplay {
  5269. constructor(ui, index) {
  5270. this.index = 0;
  5271. this.uiIndex = 0;
  5272. this.ui = ui;
  5273. this.index = index;
  5274. this.initData();
  5275. }
  5276. initData() {
  5277. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5278. let data = cfgTable.ballrodData[this.index + 1];
  5279. this.ui.nameTxt.text = data.name;
  5280. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5281. this.ui.levelNode.c1.selectedIndex = data.quality;
  5282. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5283. if (data.spine) {
  5284. this.mySpine = new SpineMgr(data.spine, () => {
  5285. let xx = 150;
  5286. let yy = 70;
  5287. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5288. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5289. });
  5290. }
  5291. }
  5292. updateSelf() {
  5293. let get = DataMgr.getBallRod(this.index);
  5294. if (get == null)
  5295. get = 1;
  5296. let curUse = DataMgr.getCurBallRod();
  5297. if (get) {
  5298. if (curUse == this.index) {
  5299. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5300. }
  5301. else {
  5302. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5303. }
  5304. }
  5305. else {
  5306. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5307. }
  5308. }
  5309. buyBallRod() {
  5310. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5311. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5312. switch (selectedIndex) {
  5313. case 0:
  5314. break;
  5315. case 1:
  5316. DataMgr.setCurBallRod(this.index);
  5317. let ui = xGame.uiMgr.getUI(UIShop);
  5318. ui.updateBallRod();
  5319. break;
  5320. case 2:
  5321. let data = cfgTable.ballrodData[this.index + 1];
  5322. let need = data.price;
  5323. if (DataMgr.diamondEnough(need)) {
  5324. DataMgr.setDiamond(-need);
  5325. DataMgr.setBallRod(this.index, 1);
  5326. DataMgr.setCurBallRod(this.index);
  5327. let ui = xGame.uiMgr.getUI(UIShop);
  5328. ui.updateBallRod();
  5329. }
  5330. else {
  5331. xGame.uiMgr.Show(UIAddProp, 1);
  5332. }
  5333. break;
  5334. default:
  5335. break;
  5336. }
  5337. }
  5338. }
  5339. class UIShop extends UIBase {
  5340. constructor() {
  5341. super();
  5342. this.itemNums = 0;
  5343. }
  5344. onConstructor() {
  5345. this.ui = ui_UIShop.createInstance();
  5346. this.contentPane = this.ui;
  5347. this.isEject = false;
  5348. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5349. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5350. this.addUIClick(this.ui, this.interuptSecretary);
  5351. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  5352. this.ballRodArr = [];
  5353. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  5354. this.ui.myNode.myList.numItems = this.itemNums;
  5355. if (Moyu.isKs)
  5356. this.ui.closeNode.closeBtn.x += 100;
  5357. }
  5358. show() {
  5359. super.show();
  5360. this.playSecretaryIdle();
  5361. this.updateBallRod();
  5362. }
  5363. updateBallRod() {
  5364. for (let index = 0; index < this.ballRodArr.length; index++) {
  5365. this.ballRodArr[index].updateSelf();
  5366. }
  5367. }
  5368. renderBallRod(sort, obj) {
  5369. let index = this.getIndexBySort(sort + 1) - 1;
  5370. let ballRod = new BallRodDisplay(obj, index);
  5371. this.ballRodArr.push(ballRod);
  5372. }
  5373. getIndexBySort(sort) {
  5374. let object = cfgTable.ballrodData;
  5375. for (const key in object) {
  5376. if (object[key].sort == sort) {
  5377. return parseInt(key);
  5378. }
  5379. }
  5380. }
  5381. playSecretaryIdle() {
  5382. let parent = this.ui.secretary.displayObject;
  5383. parent.destroyChildren();
  5384. let xx = this.ui.secretary.width / 2;
  5385. let yy = this.ui.secretary.height;
  5386. let scale = xGame.common.getSecretaryScale();
  5387. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5388. xGame.common.secretary.play(data, 1, true, parent);
  5389. }
  5390. interuptSecretary() {
  5391. Laya.timer.clearAll(this);
  5392. this.playSecretaryRandomSound();
  5393. }
  5394. playSecretaryRandomSound() {
  5395. if (this.isHide)
  5396. return;
  5397. let time = xGame.common.randomNum(45000, 60000);
  5398. Laya.timer.once(time, this, () => {
  5399. if (this.isHide)
  5400. return;
  5401. let index = xGame.common.randomNum(4, 7);
  5402. xGame.soundMgr.playSound("s_main0" + index);
  5403. let words = 1;
  5404. switch (index) {
  5405. case 4:
  5406. words = 5;
  5407. break;
  5408. case 5:
  5409. words = 3;
  5410. break;
  5411. case 6:
  5412. words = 6;
  5413. break;
  5414. case 7:
  5415. words = 7;
  5416. break;
  5417. default:
  5418. break;
  5419. }
  5420. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5421. this.playSecretaryRandomSound();
  5422. });
  5423. }
  5424. closeSelf() {
  5425. this.hide();
  5426. }
  5427. }
  5428. UIShop.uiName = "UIShop";
  5429. class ui_UISign extends fgui.GComponent {
  5430. static createInstance() {
  5431. return (fgui.UIPackage.createObject("game", "UISign"));
  5432. }
  5433. onConstruct() {
  5434. this.n6 = (this.getChild("n6"));
  5435. this.closeNode = (this.getChild("closeNode"));
  5436. this.myNode = (this.getChild("myNode"));
  5437. this.moneyNode = (this.getChild("moneyNode"));
  5438. this.secretary = (this.getChild("secretary"));
  5439. this.talkNode = (this.getChild("talkNode"));
  5440. this.tripleBtn = (this.getChild("tripleBtn"));
  5441. this.normalBtn = (this.getChild("normalBtn"));
  5442. this.tipsNode = (this.getChild("tipsNode"));
  5443. this.againBtn = (this.getChild("againBtn"));
  5444. this.t0 = this.getTransition("t0");
  5445. }
  5446. }
  5447. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  5448. class SignMax {
  5449. constructor(ui) {
  5450. this.ui = ui;
  5451. }
  5452. updateSelf(index, sameDay, curDayIndex) {
  5453. let data = cfgTable.signData[index + 1];
  5454. this.ui.titleTxt.text = data.title;
  5455. let arr1 = data.award[0].split('-');
  5456. let arr2 = data.award[1].split('-');
  5457. let num1 = parseInt(arr1[1]);
  5458. let num2 = parseInt(arr2[1]);
  5459. this.ui.numTxt1.text = num1 + "";
  5460. this.ui.numTxt2.text = num2 + "";
  5461. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  5462. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  5463. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  5464. this.ui.numTxt1.visible = false;
  5465. }
  5466. else {
  5467. this.ui.numTxt1.visible = true;
  5468. }
  5469. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  5470. this.ui.numTxt2.visible = false;
  5471. }
  5472. else {
  5473. this.ui.numTxt2.visible = true;
  5474. }
  5475. if (index < curDayIndex) {
  5476. this.ui.c1.selectedIndex = 1;
  5477. }
  5478. else if (index == curDayIndex) {
  5479. if (sameDay) {
  5480. this.ui.c1.selectedIndex = 2;
  5481. }
  5482. else {
  5483. this.ui.c1.selectedIndex = 2;
  5484. }
  5485. }
  5486. else {
  5487. this.ui.c1.selectedIndex = 0;
  5488. }
  5489. }
  5490. }
  5491. class SignNormal {
  5492. constructor(ui) {
  5493. this.ui = ui;
  5494. }
  5495. updateSelf(index, sameDay, curDayIndex) {
  5496. let data = cfgTable.signData[index + 1];
  5497. this.ui.titleTxt.text = data.title;
  5498. let arr = data.award[0].split('-');
  5499. let type = parseInt(arr[0]);
  5500. let num = parseInt(arr[1]);
  5501. this.ui.numTxt.text = num + "";
  5502. if (type > 2) {
  5503. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  5504. this.ui.myIcon.rotation = 0;
  5505. }
  5506. else {
  5507. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  5508. this.ui.myIcon.rotation = 0;
  5509. }
  5510. if (xGame.common.signAwardContainsRod(data.award)) {
  5511. this.ui.numTxt.visible = false;
  5512. }
  5513. else {
  5514. this.ui.numTxt.visible = true;
  5515. }
  5516. if (index < curDayIndex) {
  5517. this.ui.c1.selectedIndex = 1;
  5518. }
  5519. else if (index == curDayIndex) {
  5520. if (sameDay) {
  5521. this.ui.c1.selectedIndex = 2;
  5522. }
  5523. else {
  5524. this.ui.c1.selectedIndex = 2;
  5525. }
  5526. }
  5527. else {
  5528. this.ui.c1.selectedIndex = 0;
  5529. }
  5530. }
  5531. }
  5532. class UISign extends UIBase {
  5533. constructor() {
  5534. super();
  5535. this.curDayIndex = 0;
  5536. this.starX = 0;
  5537. }
  5538. onConstructor() {
  5539. this.ui = ui_UISign.createInstance();
  5540. this.contentPane = this.ui;
  5541. this.isEject = false;
  5542. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5543. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5544. this.initSignItem();
  5545. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  5546. this.addUIClick(this.ui.againBtn, this.againGetAward);
  5547. }
  5548. show() {
  5549. super.show();
  5550. this.ui.t0.play();
  5551. this.playSecretaryIdle();
  5552. this.updateSign();
  5553. }
  5554. initSignItem() {
  5555. this.signArr = [];
  5556. for (let index = 0; index < 6; index++) {
  5557. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  5558. this.signArr.push(temp);
  5559. }
  5560. this.signMax = new SignMax(this.ui.myNode.day7);
  5561. if (Moyu.isKs)
  5562. this.ui.closeNode.closeBtn.x += 100;
  5563. }
  5564. updateSign() {
  5565. let sameDay = xGame.common.judgeSameDay();
  5566. let max = 7;
  5567. this.curDayIndex = DataMgr.getSignData();
  5568. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  5569. this.curDayIndex = 0;
  5570. if (!sameDay) {
  5571. this.ui.normalBtn.visible = true;
  5572. this.ui.tipsNode.visible = false;
  5573. this.ui.againBtn.visible = false;
  5574. }
  5575. else {
  5576. this.ui.normalBtn.visible = false;
  5577. let again = DataMgr.getExtraSign();
  5578. let isCurrency = false;
  5579. let index = this.curDayIndex;
  5580. if (index == 0)
  5581. index = 7;
  5582. let award = cfgTable.signData[index].award;
  5583. let num = award[0].split("-")[0];
  5584. if (num == "1" || num == "2")
  5585. isCurrency = true;
  5586. let showAgain = again == 0 && isCurrency;
  5587. this.ui.againBtn.visible = showAgain;
  5588. this.ui.tipsNode.visible = !showAgain;
  5589. }
  5590. for (let index = 0; index < this.signArr.length; index++) {
  5591. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  5592. }
  5593. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  5594. }
  5595. playSecretaryIdle() {
  5596. let parent = this.ui.secretary.displayObject;
  5597. parent.destroyChildren();
  5598. let xx = this.ui.secretary.width / 2;
  5599. let yy = this.ui.secretary.height;
  5600. let scale = xGame.common.getSecretaryScale();
  5601. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5602. xGame.common.secretary.play(data, 1, true, parent);
  5603. }
  5604. closeSelf() {
  5605. this.hide();
  5606. }
  5607. normalGetAward() {
  5608. let sameDay = xGame.common.judgeSameDay();
  5609. if (!sameDay) {
  5610. let award = cfgTable.signData[this.curDayIndex + 1].award;
  5611. let temp;
  5612. let type;
  5613. let num;
  5614. let arr = [];
  5615. for (let index = 0; index < award.length; index++) {
  5616. temp = award[index].split("-");
  5617. type = parseInt(temp[0]);
  5618. num = parseInt(temp[1]);
  5619. let awardType = new AwardType();
  5620. awardType.num = num;
  5621. awardType.type = type;
  5622. arr.push(awardType);
  5623. }
  5624. xGame.common.getAward(arr, (watchVideo) => {
  5625. this.curDayIndex++;
  5626. if (this.curDayIndex > 7)
  5627. this.curDayIndex = 0;
  5628. DataMgr.setSignData(this.curDayIndex);
  5629. DataMgr.setSignTime(new Date().getTime());
  5630. if (watchVideo) {
  5631. DataMgr.setExtraSign(1);
  5632. Moyu.sendDataEvent("signIn1");
  5633. }
  5634. this.updateSign();
  5635. });
  5636. }
  5637. }
  5638. againGetAward() {
  5639. Moyu.sendDataEvent("signIn2");
  5640. Moyu.showVideoAd(() => {
  5641. let index = this.curDayIndex;
  5642. if (index == 0)
  5643. index = 7;
  5644. let award = cfgTable.signData[index].award;
  5645. let temp;
  5646. let type;
  5647. let num;
  5648. for (let index = 0; index < award.length; index++) {
  5649. temp = award[index].split("-");
  5650. type = parseInt(temp[0]);
  5651. num = parseInt(temp[1]) * 3;
  5652. xGame.common.playObjFlyAnim(num, type);
  5653. }
  5654. DataMgr.setExtraSign(1);
  5655. this.updateSign();
  5656. }, EAdType.againSign);
  5657. }
  5658. }
  5659. UISign.uiName = "UISign";
  5660. class ui_UISkill extends fgui.GComponent {
  5661. static createInstance() {
  5662. return (fgui.UIPackage.createObject("game", "UISkill"));
  5663. }
  5664. onConstruct() {
  5665. this.n48 = (this.getChild("n48"));
  5666. this.n0 = (this.getChild("n0"));
  5667. this.secretary = (this.getChild("secretary"));
  5668. this.talkNode = (this.getChild("talkNode"));
  5669. this.closeNode = (this.getChild("closeNode"));
  5670. this.moneyNode = (this.getChild("moneyNode"));
  5671. this.skillNode = (this.getChild("skillNode"));
  5672. this.guideNode = (this.getChild("guideNode"));
  5673. }
  5674. }
  5675. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  5676. class SkillDisplay {
  5677. constructor(ui, data, uiIndex) {
  5678. this.starX = 0;
  5679. this.starY = 0;
  5680. this.index = 0;
  5681. this.ui = ui;
  5682. this.data = data;
  5683. this.index = uiIndex;
  5684. this.initSelf();
  5685. console.log('zh:SkillDisplay constructor this.skillData=', data);
  5686. }
  5687. initSelf() {
  5688. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  5689. this.ui.nameTxt.text = this.data.name;
  5690. this.ui.describeTxt.text = this.data.describe;
  5691. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  5692. this.ui.startBtn.onClick(this, this.startGame);
  5693. this.updateSelf();
  5694. }
  5695. updateSelf() {
  5696. this.checkTry();
  5697. let level = DataMgr.getBigSkillByIndex(this.index);
  5698. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  5699. }
  5700. checkTry() {
  5701. let index = this.index;
  5702. let level = DataMgr.getBigSkillByIndex(index);
  5703. if (level == null) {
  5704. DataMgr.setBigSkill(index, 1, false);
  5705. level = 1;
  5706. }
  5707. this.ui.levelTxt.text = "LV." + level;
  5708. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  5709. this.ui.tryNode.visible = true;
  5710. else
  5711. this.ui.tryNode.visible = false;
  5712. }
  5713. clickAddLevel() {
  5714. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5715. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  5716. Moyu.showVideoAd(() => {
  5717. DataMgr.setBigSkill(this.data.index, 1);
  5718. this.updateSelf();
  5719. xGame.common.upSkillLevel = true;
  5720. }, EAdType.upSkill);
  5721. }
  5722. startGame() {
  5723. if (this.data.index == 3) {
  5724. alert('Coming soon!');
  5725. return;
  5726. }
  5727. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5728. let needCoin = xGame.common.bigMoveNeedCoin;
  5729. xGame.common.passAwardCoin = 2000;
  5730. let guide = DataMgr.getSkillGuide();
  5731. console.log('zh:startGame guide=' + guide);
  5732. xGame.common.temSelfLevel = 0;
  5733. if (guide == 0) {
  5734. needCoin = 0;
  5735. xGame.common.temSelfLevel = 100;
  5736. }
  5737. if (DataMgr.coinEnough(needCoin)) {
  5738. DataMgr.setCoin(-needCoin);
  5739. xGame.common.curPlayerSkillType = this.index;
  5740. if (guide == 0)
  5741. xGame.common.curPlayerSkillType = 0;
  5742. xGame.uiMgr.Show(UIGame);
  5743. xGame.uiMgr.Hide(UIMain);
  5744. xGame.uiMgr.Show(UIMatching, () => {
  5745. xGame.common.gameUI.ui.alpha = 1;
  5746. xGame.common.gameUI.startGame();
  5747. xGame.uiMgr.Hide(UISkill);
  5748. });
  5749. }
  5750. else {
  5751. xGame.uiMgr.Show(UIAddProp, 0);
  5752. Moyu.sendDataEvent("AddCoinVideo");
  5753. }
  5754. }
  5755. }
  5756. class UISkill extends UIBase {
  5757. constructor() {
  5758. super();
  5759. this.skillData = [];
  5760. }
  5761. onConstructor() {
  5762. this.ui = ui_UISkill.createInstance();
  5763. this.contentPane = this.ui;
  5764. this.isEject = false;
  5765. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5766. this.initSkillData();
  5767. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  5768. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  5769. this.displayList = [];
  5770. this.ui.skillNode.skillList.numItems = 4;
  5771. this.addUIClick(this.ui, this.interuptSecretary);
  5772. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  5773. this.ui.talkNode.visible = false;
  5774. if (Moyu.isKs)
  5775. this.ui.closeNode.closeBtn.x += 100;
  5776. }
  5777. show() {
  5778. super.show();
  5779. this.playSecretaryIdle();
  5780. this.moneyNode.ui.c1.selectedIndex = 1;
  5781. Laya.timer.clearAll(this);
  5782. xGame.soundMgr.playSound("s_start");
  5783. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5784. let guide = DataMgr.getSkillGuide();
  5785. this.ui.guideNode.visible = guide == 0;
  5786. let item = this.getSkillItemByUIIndex(0);
  5787. if (guide == 0) {
  5788. item.ui.c1.selectedIndex = 1;
  5789. }
  5790. else {
  5791. item.ui.c1.selectedIndex = 0;
  5792. }
  5793. this.ui.guideNode.guideBtn.visible = guide == 0;
  5794. for (let index = 0; index < this.displayList.length; index++) {
  5795. this.displayList[index].checkTry();
  5796. }
  5797. }
  5798. getSkillItemByUIIndex(cur) {
  5799. for (let index = 0; index < this.displayList.length; index++) {
  5800. if (this.displayList[index].index == cur) {
  5801. return this.displayList[index];
  5802. }
  5803. }
  5804. }
  5805. enterGuideLevel() {
  5806. let item = this.getSkillItemByUIIndex(0);
  5807. item.startGame();
  5808. if (DataMgr.getNewUser())
  5809. Moyu.sendDataEvent("gameStart1");
  5810. }
  5811. initSkillData() {
  5812. this.skillData = [];
  5813. let nameList = xGame.common.skillNameList;
  5814. let iconList = xGame.common.skillIconList;
  5815. let describeList = [
  5816. "Jump shot executed — ball bounced and pocketed an extra one!",
  5817. "Bonus Sweep: A random follow-up strike hits 1 extra ball after your shot!",
  5818. "Freeze Effect: Your shot freezes 1 random ball — enemy can’t hit it, and others bounce off!"
  5819. ];
  5820. let data;
  5821. for (let index = 0; index < nameList.length; index++) {
  5822. data = {};
  5823. data.name = nameList[index];
  5824. data.icon = iconList[index];
  5825. data.describe = describeList[index];
  5826. data.index = index;
  5827. this.skillData.push(data);
  5828. }
  5829. }
  5830. updateSkillItem(index, target) {
  5831. if (this.displayList[index] == null) {
  5832. let uiIndex;
  5833. switch (index) {
  5834. case 0:
  5835. uiIndex = 1;
  5836. break;
  5837. case 1:
  5838. uiIndex = 0;
  5839. break;
  5840. case 2:
  5841. uiIndex = 2;
  5842. break;
  5843. case 3:
  5844. uiIndex = 3;
  5845. break;
  5846. default:
  5847. break;
  5848. }
  5849. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  5850. this.displayList.push(temp);
  5851. }
  5852. }
  5853. playSecretaryIdle() {
  5854. let parent = this.ui.secretary.displayObject;
  5855. parent.destroyChildren();
  5856. let xx = this.ui.secretary.width / 2;
  5857. let yy = this.ui.secretary.height;
  5858. let scale = xGame.common.getSecretaryScale();
  5859. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5860. xGame.common.secretary.play(data, 1, true, parent);
  5861. }
  5862. returnUIMain() {
  5863. this.hide();
  5864. xGame.common.stopGirlPop(this.ui.talkNode);
  5865. xGame.uiMgr.Show(UIMain);
  5866. }
  5867. interuptSecretary() {
  5868. Laya.timer.clearAll(this);
  5869. this.playSecretaryRandomSound();
  5870. }
  5871. playSecretaryRandomSound() {
  5872. if (this.isHide)
  5873. return;
  5874. let time = xGame.common.randomNum(45000, 60000);
  5875. Laya.timer.once(time, this, () => {
  5876. if (this.isHide)
  5877. return;
  5878. let index = xGame.common.randomNum(4, 7);
  5879. xGame.soundMgr.playSound("s_main0" + index);
  5880. let words = 1;
  5881. switch (index) {
  5882. case 4:
  5883. words = 5;
  5884. break;
  5885. case 5:
  5886. words = 3;
  5887. break;
  5888. case 6:
  5889. words = 6;
  5890. break;
  5891. case 7:
  5892. words = 7;
  5893. break;
  5894. default:
  5895. break;
  5896. }
  5897. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5898. this.playSecretaryRandomSound();
  5899. });
  5900. }
  5901. }
  5902. UISkill.uiName = "UISkill";
  5903. class ui_UIMsg extends fgui.GComponent {
  5904. static createInstance() {
  5905. return (fgui.UIPackage.createObject("game", "UIMsg"));
  5906. }
  5907. onConstruct() {
  5908. this.tipsNode = (this.getChild("tipsNode"));
  5909. }
  5910. }
  5911. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  5912. class UIMsg extends UIBase {
  5913. constructor() {
  5914. super();
  5915. }
  5916. onConstructor() {
  5917. this.ui = ui_UIMsg.createInstance();
  5918. this.contentPane = this.ui;
  5919. this.isEject = false;
  5920. this.isMuti = true;
  5921. }
  5922. show(msg, callback) {
  5923. super.show();
  5924. this.ui.tipsNode.msgTxt.text = msg;
  5925. this.ui.alpha = 1;
  5926. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  5927. this.hide();
  5928. callback && callback();
  5929. }), 1000);
  5930. }
  5931. }
  5932. UIMsg.uiName = "UIMsg";
  5933. class ui_UIModeSelection extends fgui.GComponent {
  5934. static createInstance() {
  5935. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  5936. }
  5937. onConstruct() {
  5938. this.n19 = (this.getChild("n19"));
  5939. this.closeBtn = (this.getChild("closeBtn"));
  5940. this.myNode = (this.getChild("myNode"));
  5941. this.t0 = this.getTransition("t0");
  5942. }
  5943. }
  5944. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  5945. class UIModeSelection extends UIBase {
  5946. constructor() {
  5947. super();
  5948. }
  5949. onConstructor() {
  5950. this.ui = ui_UIModeSelection.createInstance();
  5951. this.contentPane = this.ui;
  5952. this.isEject = false;
  5953. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  5954. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  5955. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  5956. this.addUIClick(this.ui.closeBtn, this.hide);
  5957. this.peopleArr = [650, 6900, 3800];
  5958. this.peopleOffest = [50, 500, 200];
  5959. this.updateSelf();
  5960. }
  5961. show(callback) {
  5962. super.show();
  5963. this.ui.t0.play();
  5964. this.callback = callback;
  5965. }
  5966. updateSelf() {
  5967. let cfg = cfgTable.modeselectData;
  5968. for (let index = 1; index <= 3; index++) {
  5969. let node = this.ui.myNode["type" + index];
  5970. node.need.text = cfg[index].need;
  5971. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  5972. node.peopleTxt.text = this.getRandPeople(index - 1);
  5973. }
  5974. }
  5975. enterGame(type) {
  5976. xGame.common.classicRoomType = type;
  5977. let cfg = cfgTable.modeselectData[type];
  5978. let need = cfg.need;
  5979. xGame.common.passAwardCoin = cfg.award;
  5980. if (DataMgr.coinEnough(need)) {
  5981. DataMgr.setCoin(-need);
  5982. this.ui.myNode["type" + type].t0.play();
  5983. Laya.timer.once(200, this, () => {
  5984. this.callback && this.callback();
  5985. });
  5986. }
  5987. else {
  5988. Moyu.sendDataEvent("AddCoinVideo");
  5989. xGame.uiMgr.Show(UIAddProp, 0);
  5990. }
  5991. }
  5992. getRandPeople(index) {
  5993. let rand = this.peopleOffest[index];
  5994. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  5995. }
  5996. }
  5997. UIModeSelection.uiName = "UIModeSelection";
  5998. class UIMain extends UIBase {
  5999. constructor() {
  6000. super();
  6001. this.firstEnter = true;
  6002. }
  6003. onConstructor() {
  6004. this.ui = ui_UIMain.createInstance();
  6005. this.contentPane = this.ui;
  6006. this.isEject = false;
  6007. this.addEvent();
  6008. this.addClickSpine();
  6009. this.settingNode = new SettingNode(this.ui.settingNode);
  6010. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6011. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  6012. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  6013. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  6014. let curUse = DataMgr.getCurSecretary();
  6015. this.changeSecretary(curUse);
  6016. this.ui.talkNode.visible = false;
  6017. let guide = DataMgr.getSkillGuide();
  6018. if (xGame.common.isNewDay && guide == 1) {
  6019. xGame.common.isNewDay = false;
  6020. xGame.soundMgr.playSound("s_main01");
  6021. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6022. console.log("播放小秘书每天语音");
  6023. }
  6024. this.onGetUserInfo();
  6025. this.ui.n83.visible = false;
  6026. Moyu.setShareInfo("8Ball Fury", ["台球", "万宁", "桌球"], '2300002254');
  6027. }
  6028. changeSecretary(curUse) {
  6029. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  6030. xGame.common.secretary && xGame.common.secretary.dispose();
  6031. this.addSecretarySpine(name);
  6032. }
  6033. addSecretarySpine(name) {
  6034. let spine = new SpineMgr(name, () => {
  6035. this.playSecretaryIdle();
  6036. });
  6037. xGame.common.secretary = spine;
  6038. }
  6039. addClickSpine() {
  6040. let clickSpine = new SpineMgr("dianji", () => {
  6041. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  6042. let parent = Laya.stage;
  6043. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  6044. clickSpine.play(data, 0, false, parent, (spine) => {
  6045. spine.destroy(true);
  6046. });
  6047. });
  6048. });
  6049. }
  6050. addEvent() {
  6051. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  6052. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  6053. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  6054. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  6055. this.addUIClick(this.ui.weeklyBtn, this.startWeekly);
  6056. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  6057. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  6058. this.addUIClick(this.ui, this.interuptSecretary);
  6059. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  6060. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  6061. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  6062. this.addUIClick(this.ui.shopBtn, this.openShopView);
  6063. this.addUIClick(this.ui.signBtn, this.openSignView);
  6064. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  6065. this.addUIClick(this.ui.rankBtn, this.openRanking);
  6066. }
  6067. show(showFailWords) {
  6068. super.show();
  6069. this.moneyNode.ui.c1.selectedIndex = 1;
  6070. this.playSecretaryIdle();
  6071. xGame.soundMgr.playMusic("caromhall01");
  6072. Laya.timer.clearAll(this);
  6073. this.playSecretaryRandomSound();
  6074. if (showFailWords) {
  6075. setTimeout(() => {
  6076. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  6077. let words = -1;
  6078. if (str == "s_main02") {
  6079. words = 2;
  6080. }
  6081. else {
  6082. words = 3;
  6083. }
  6084. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6085. xGame.soundMgr.playSound(str);
  6086. }, 300);
  6087. }
  6088. this.showGuide();
  6089. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  6090. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  6091. let guide = DataMgr.getSkillGuide();
  6092. if (guide == 1) {
  6093. let randTime = xGame.common.randomNum(300, 800);
  6094. if (this.firstEnter) {
  6095. this.firstEnter = false;
  6096. randTime += 900;
  6097. }
  6098. Laya.timer.once(randTime, this, () => {
  6099. xGame.common.autoPopUIView();
  6100. });
  6101. }
  6102. }
  6103. checkActive(show) {
  6104. }
  6105. showGuide() {
  6106. let guide = DataMgr.getSkillGuide();
  6107. this.ui.guideBtn.visible = guide == 0;
  6108. this.ui.enterGuide.visible = false;
  6109. this.ui.secretaryGuide.visible = guide == 0;
  6110. if (guide == 0) {
  6111. xGame.soundMgr.playSound("s_guide");
  6112. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6113. }
  6114. }
  6115. ensureSecretary() {
  6116. this.ui.secretaryGuide.visible = false;
  6117. this.ui.enterGuide.visible = true;
  6118. this.ui.wordsNode.t0.play();
  6119. if (DataMgr.getNewUser())
  6120. Moyu.sendDataEvent("gameReady");
  6121. }
  6122. playSecretaryIdle() {
  6123. let parent = this.ui.secretary.displayObject;
  6124. parent.destroyChildren();
  6125. let xx = this.ui.secretary.width / 2;
  6126. let yy = this.ui.secretary.height;
  6127. let scale = xGame.common.getSecretaryScale();
  6128. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6129. xGame.common.secretary.play(data, 1, true, parent);
  6130. }
  6131. startGame(type) {
  6132. xGame.common.gameMode = type;
  6133. Moyu.sendDataEvent("PlayGame", { type: type });
  6134. switch (xGame.common.gameMode) {
  6135. case GameMode.classic:
  6136. let challengeTimes = DataMgr.getChallengeTimes();
  6137. if (challengeTimes == 0) {
  6138. xGame.uiMgr.Show(UIInvitation);
  6139. }
  6140. else {
  6141. this.beginGame();
  6142. }
  6143. break;
  6144. case GameMode.bigMove:
  6145. this.beginGame();
  6146. if (DataMgr.getNewUser())
  6147. Moyu.sendDataEvent("gameStart0");
  6148. break;
  6149. default:
  6150. break;
  6151. }
  6152. }
  6153. beginGame(isNice = false) {
  6154. if (xGame.common.gameMode == GameMode.classic) {
  6155. if (isNice) {
  6156. this.enterClassic();
  6157. }
  6158. else {
  6159. xGame.uiMgr.Show(UIModeSelection, () => {
  6160. this.enterClassic();
  6161. });
  6162. }
  6163. }
  6164. else if (xGame.common.gameMode == GameMode.bigMove) {
  6165. this.ui.enterGuide.visible = false;
  6166. xGame.uiMgr.Show(UISkill);
  6167. }
  6168. }
  6169. enterClassic() {
  6170. xGame.uiMgr.Show(UIGame);
  6171. xGame.uiMgr.Show(UIMatching, () => {
  6172. if (!this.isHide)
  6173. this.hide();
  6174. xGame.common.gameUI.ui.alpha = 1;
  6175. xGame.common.gameUI.startGame();
  6176. xGame.uiMgr.Hide(UIGameEnd);
  6177. });
  6178. }
  6179. startGlobal() {
  6180. xGame.uiMgr.Show(UIMsg, "Coming Soon~");
  6181. }
  6182. startWeekly() {
  6183. xGame.uiMgr.Show(UIMsg, "Coming Soon~");
  6184. }
  6185. startPlaceBall() {
  6186. xGame.uiMgr.Show(UILevelDisplay);
  6187. }
  6188. hide() {
  6189. super.hide();
  6190. xGame.common.stopGirlPop(this.ui.talkNode);
  6191. }
  6192. onGetUserInfo(force = false) {
  6193. if (Moyu.isWx) {
  6194. let info = Moyu.getSystemInfo();
  6195. if (info)
  6196. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  6197. }
  6198. else {
  6199. Moyu.initUser(this, this.freshUser, force);
  6200. }
  6201. if (!Moyu.hasUserInfo) {
  6202. let user = Moyu.getUserInfo();
  6203. user.headIcon = 'res/ty_touxiang.png';
  6204. }
  6205. this.freshUser();
  6206. }
  6207. freshUser() {
  6208. let user = Moyu.getUserInfo();
  6209. if (!user.isAuth) {
  6210. user.headIcon = 'res/ty_touxiang.png';
  6211. }
  6212. else
  6213. DataMgr.upRankData();
  6214. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  6215. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  6216. }
  6217. interuptSecretary() {
  6218. Laya.timer.clearAll(this);
  6219. this.playSecretaryRandomSound();
  6220. }
  6221. playSecretaryRandomSound() {
  6222. if (this.isHide)
  6223. return;
  6224. let time = xGame.common.randomNum(45000, 60000);
  6225. Laya.timer.once(time, this, () => {
  6226. if (this.isHide)
  6227. return;
  6228. let index = xGame.common.randomNum(4, 7);
  6229. xGame.soundMgr.playSound("s_main0" + index);
  6230. let words = 1;
  6231. switch (index) {
  6232. case 4:
  6233. words = 5;
  6234. break;
  6235. case 5:
  6236. words = 3;
  6237. break;
  6238. case 6:
  6239. words = 6;
  6240. break;
  6241. case 7:
  6242. words = 7;
  6243. break;
  6244. default:
  6245. break;
  6246. }
  6247. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6248. this.playSecretaryRandomSound();
  6249. });
  6250. }
  6251. openSecretaryView() {
  6252. xGame.uiMgr.Show(UISecretary);
  6253. Moyu.sendDataEvent("secretary");
  6254. }
  6255. openShopView() {
  6256. xGame.uiMgr.Show(UIShop);
  6257. }
  6258. openSignView() {
  6259. xGame.uiMgr.Show(UISign);
  6260. }
  6261. openDrawView() {
  6262. xGame.uiMgr.Show(UIDraw);
  6263. }
  6264. openRanking() {
  6265. xGame.uiMgr.Show(UIRanking);
  6266. Moyu.sendDataEvent("rankingList");
  6267. }
  6268. }
  6269. UIMain.uiName = "UIMain";
  6270. class UIGameEnd extends UIBase {
  6271. constructor() {
  6272. super();
  6273. this.success = false;
  6274. this.awardCoinNum = 1000;
  6275. this.awardDiamondNum = 10;
  6276. }
  6277. onConstructor() {
  6278. this.ui = ui_UIGameEnd.createInstance();
  6279. this.contentPane = this.ui;
  6280. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  6281. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  6282. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  6283. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6284. this.ui.talkNode.visible = false;
  6285. if (Moyu.isKs)
  6286. this.ui.closeNode.closeBtn.x += 100;
  6287. }
  6288. updateType() {
  6289. switch (xGame.common.gameMode) {
  6290. case GameMode.classic:
  6291. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  6292. this.ui.coinNode.visible = this.success;
  6293. if (!this.success) {
  6294. Laya.timer.once(500, this, () => {
  6295. xGame.uiMgr.Show(UIAddCoin);
  6296. });
  6297. }
  6298. this.ui.isGetAward.visible = false;
  6299. this.ui.leftBtn.c1.selectedIndex = 3;
  6300. this.ui.rightBtn.c1.selectedIndex = 0;
  6301. this.moneyNode.ui.c1.selectedIndex = 1;
  6302. break;
  6303. case GameMode.bigMove:
  6304. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  6305. this.ui.coinNode.visible = this.success;
  6306. if (xGame.common.gameMode == GameMode.bigMove) {
  6307. if (this.success) {
  6308. DataMgr.setSkillSuccessTimes(1, true);
  6309. DataMgr.setSkillAccTimes(1);
  6310. }
  6311. else {
  6312. DataMgr.setSkillSuccessTimes(0, false);
  6313. }
  6314. }
  6315. if (!this.success) {
  6316. Laya.timer.once(500, this, () => {
  6317. xGame.uiMgr.Show(UIAddCoin);
  6318. });
  6319. }
  6320. this.ui.isGetAward.visible = false;
  6321. this.ui.leftBtn.c1.selectedIndex = 3;
  6322. this.ui.rightBtn.c1.selectedIndex = 0;
  6323. this.moneyNode.ui.c1.selectedIndex = 1;
  6324. break;
  6325. case GameMode.placeBall:
  6326. this.ui.coinNode.visible = false;
  6327. if (this.success) {
  6328. if (xGame.common.placeBallStarNum == 3) {
  6329. this.ui.c1.selectedIndex = 2;
  6330. }
  6331. else {
  6332. this.ui.c1.selectedIndex = 3;
  6333. }
  6334. }
  6335. else {
  6336. this.ui.c1.selectedIndex = 4;
  6337. }
  6338. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  6339. if (cfg.type == PlaceBallType.challenge) {
  6340. this.ui.c1.selectedIndex = 2;
  6341. }
  6342. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  6343. this.updatePlaceBallBtn();
  6344. this.updatePlaceBallStarNum();
  6345. this.updatePlaceBallAwardState();
  6346. this.moneyNode.ui.c1.selectedIndex = 2;
  6347. this.moneyNode.checkPowerTime();
  6348. this.moneyNode.powerChange();
  6349. DataMgr.upRankData();
  6350. break;
  6351. default:
  6352. break;
  6353. }
  6354. }
  6355. updatePlaceBallBtn() {
  6356. this.ui.leftBtn.c1.selectedIndex = 5;
  6357. if (this.success) {
  6358. this.ui.rightBtn.c1.selectedIndex = 14;
  6359. }
  6360. else {
  6361. if (xGame.common.placeBallStarNum == 3) {
  6362. this.ui.rightBtn.c1.selectedIndex = 14;
  6363. }
  6364. else {
  6365. this.ui.rightBtn.c1.selectedIndex = 1;
  6366. }
  6367. }
  6368. }
  6369. updatePlaceBallStarNum() {
  6370. let starNum = xGame.common.placeBallStarNum;
  6371. if (starNum == 0)
  6372. this.ui.starNumNode.c1.selectedIndex = 3;
  6373. else {
  6374. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  6375. }
  6376. }
  6377. updatePlaceBallAwardState() {
  6378. let level = xGame.common.placeBallCurLevel;
  6379. let starNum = xGame.common.placeBallStarNum;
  6380. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  6381. let data = cfgTable.placeballData[level].award;
  6382. let cfg = cfgTable.placeballData[level];
  6383. this.awardDiamondNum = data[1];
  6384. this.awardCoinNum = data[0];
  6385. if (cfg.type == PlaceBallType.challenge) {
  6386. this.awardDiamondNum = 0;
  6387. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  6388. }
  6389. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  6390. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  6391. if (cfg.type == PlaceBallType.challenge) {
  6392. this.ui.awardNode.coinNode.visible = true;
  6393. }
  6394. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  6395. this.ui.awardNode.diamondNode.x = 265;
  6396. this.ui.awardNode.coinNode.x = 354;
  6397. }
  6398. else {
  6399. this.ui.awardNode.diamondNode.x = 291;
  6400. this.ui.awardNode.coinNode.x = 291;
  6401. }
  6402. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  6403. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  6404. if (this.awardCoinNum == 0) {
  6405. this.ui.awardNode.coinNode.numTxt.text = "";
  6406. }
  6407. if (getAward) {
  6408. this.ui.isGetAward.visible = true;
  6409. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  6410. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  6411. }
  6412. else {
  6413. this.ui.isGetAward.visible = false;
  6414. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  6415. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  6416. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  6417. }
  6418. else {
  6419. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  6420. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  6421. }
  6422. }
  6423. }
  6424. show(success) {
  6425. super.show();
  6426. xGame.eventMgr.event(RESET_GAME);
  6427. this.success = success;
  6428. Laya.timer.clearAll(this);
  6429. this.playSecretaryAni();
  6430. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  6431. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  6432. offsetTime = Math.floor(offsetTime / 1000);
  6433. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  6434. this.updateType();
  6435. Laya.timer.once(200, this, () => {
  6436. this.addAward(() => {
  6437. this.updateType();
  6438. Laya.timer.once(500, this, () => {
  6439. this.showChallengeLevel();
  6440. });
  6441. });
  6442. });
  6443. if (this.success) {
  6444. xGame.soundMgr.playSound('slots_roll01');
  6445. xGame.soundMgr.playSound("s_win");
  6446. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6447. }
  6448. else {
  6449. xGame.soundMgr.playSound('matchwin01');
  6450. xGame.soundMgr.playSound("s_lose");
  6451. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6452. }
  6453. if (!Moyu.isLegal)
  6454. PlatMgr.showBanner(true);
  6455. let challengeNum = DataMgr.getChallengeTimes();
  6456. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  6457. DataMgr.setChallengeTimes(1);
  6458. }
  6459. if (this.success && xGame.common.gameMode == GameMode.classic) {
  6460. DataMgr.setClassicTimes();
  6461. }
  6462. }
  6463. showChallengeLevel() {
  6464. if (DataMgr.getChallengeTimes() != 0)
  6465. return;
  6466. let skill = DataMgr.getSkillAccTimes();
  6467. let put = DataMgr.getPlaceBallLevelList().length;
  6468. if (skill >= 3 || put >= 5) {
  6469. xGame.uiMgr.Show(UIInvitation);
  6470. this.hide();
  6471. }
  6472. }
  6473. addAward(callback) {
  6474. if (!this.success) {
  6475. callback && callback();
  6476. return;
  6477. }
  6478. switch (xGame.common.gameMode) {
  6479. case GameMode.classic:
  6480. this.awardCoinNum = xGame.common.passAwardCoin;
  6481. this.awardDiamondNum = 0;
  6482. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  6483. break;
  6484. case GameMode.bigMove:
  6485. this.awardCoinNum = xGame.common.passAwardCoin;
  6486. this.awardDiamondNum = 0;
  6487. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  6488. callback && callback();
  6489. break;
  6490. case GameMode.placeBall:
  6491. let level = xGame.common.placeBallCurLevel;
  6492. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  6493. if (xGame.common.placeBallStarNum != 3) {
  6494. callback && callback();
  6495. return;
  6496. }
  6497. else {
  6498. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  6499. if (getAward) {
  6500. callback && callback();
  6501. return;
  6502. }
  6503. }
  6504. let cfg = cfgTable.placeballData[level];
  6505. let data = cfgTable.placeballData[level].award;
  6506. this.awardCoinNum = data[0];
  6507. this.awardDiamondNum = data[1];
  6508. if (cfg.type == PlaceBallType.challenge) {
  6509. this.awardDiamondNum = 0;
  6510. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  6511. }
  6512. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  6513. let diamondAward;
  6514. if (this.awardDiamondNum > 0) {
  6515. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  6516. xGame.common.getAward([diamondAward, coinAward], callback);
  6517. }
  6518. else {
  6519. xGame.common.getAward([coinAward], callback);
  6520. }
  6521. if (cfg.type == PlaceBallType.normal) {
  6522. DataMgr.setPlaceBallAward(level);
  6523. }
  6524. break;
  6525. default:
  6526. break;
  6527. }
  6528. }
  6529. playSecretaryAni() {
  6530. let parent = this.ui.secretary.displayObject;
  6531. parent.destroyChildren();
  6532. let xx = this.ui.secretary.width / 2;
  6533. let yy = this.ui.secretary.height;
  6534. let scale = xGame.common.getSecretaryScale();
  6535. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6536. if (this.success) {
  6537. let rand = Math.random() <= 0.5 ? 2 : 3;
  6538. xGame.common.secretary.play(data, rand, false, parent, () => {
  6539. xGame.common.secretary.play(data, 1, true, parent);
  6540. });
  6541. }
  6542. else {
  6543. xGame.common.secretary.play(data, 0, true, parent);
  6544. }
  6545. }
  6546. restartGame() {
  6547. switch (xGame.common.gameMode) {
  6548. case GameMode.classic:
  6549. xGame.eventMgr.event(RESTART_GAME);
  6550. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  6551. break;
  6552. case GameMode.bigMove:
  6553. this.hide();
  6554. xGame.eventMgr.event(RESTART_GAME);
  6555. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  6556. break;
  6557. default:
  6558. break;
  6559. }
  6560. }
  6561. hide() {
  6562. super.hide();
  6563. xGame.common.stopGirlPop(this.ui.talkNode);
  6564. PlatMgr.showBanner(false);
  6565. }
  6566. returnHome() {
  6567. this.hide();
  6568. let showFailWords = !this.success;
  6569. xGame.uiMgr.Show(UIMain, showFailWords);
  6570. }
  6571. clickLeftBtn() {
  6572. switch (xGame.common.gameMode) {
  6573. case GameMode.classic:
  6574. case GameMode.bigMove:
  6575. this.returnHome();
  6576. break;
  6577. case GameMode.placeBall:
  6578. let level = xGame.common.placeBallCurLevel;
  6579. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  6580. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  6581. break;
  6582. default:
  6583. break;
  6584. }
  6585. }
  6586. powerStartPlaceBallLevel(level, btn) {
  6587. if (DataMgr.powerEnough()) {
  6588. btn.touchable = false;
  6589. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  6590. btn.touchable = true;
  6591. DataMgr.setPower(-1);
  6592. xGame.eventMgr.event(POWER_TIME);
  6593. this.startPlaceBallLevel(level);
  6594. }));
  6595. }
  6596. else {
  6597. xGame.uiMgr.Show(UIPower, 0);
  6598. }
  6599. }
  6600. clickRightBtn() {
  6601. switch (xGame.common.gameMode) {
  6602. case GameMode.classic:
  6603. case GameMode.bigMove:
  6604. this.restartGame();
  6605. break;
  6606. case GameMode.placeBall:
  6607. let level = xGame.common.placeBallCurLevel;
  6608. let data = DataMgr.getPlaceBallLevel(level);
  6609. let curPss = data.play && !data.isCur;
  6610. if (curPss) {
  6611. this.powerStartPlaceBallLevel(level + 1, this.ui.rightBtn);
  6612. }
  6613. else {
  6614. Moyu.sendDataEvent("placeBallNextLevel");
  6615. Moyu.showVideoAd(() => {
  6616. DataMgr.setPlaceBallLevel(level, 1);
  6617. this.startPlaceBallLevel(level + 1);
  6618. }, xGame.define.EAdType.placeBallNextLevel);
  6619. }
  6620. break;
  6621. default:
  6622. break;
  6623. }
  6624. }
  6625. startPlaceBallLevel(level) {
  6626. xGame.common.gameMode = GameMode.placeBall;
  6627. xGame.common.placeBallCurLevel = level;
  6628. xGame.uiMgr.Show(UIGame);
  6629. this.hide();
  6630. }
  6631. }
  6632. UIGameEnd.uiName = "UIGameEnd";
  6633. class ui_UIRepentProp extends fgui.GComponent {
  6634. static createInstance() {
  6635. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  6636. }
  6637. onConstruct() {
  6638. this.c1 = this.getController("c1");
  6639. this.n11 = (this.getChild("n11"));
  6640. this.regretNode = (this.getChild("regretNode"));
  6641. this.helpLineNode = (this.getChild("helpLineNode"));
  6642. this.t0 = this.getTransition("t0");
  6643. }
  6644. }
  6645. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  6646. class UIRepentProp extends UIBase {
  6647. constructor() {
  6648. super();
  6649. this.viewType = 0;
  6650. this.regretType = 0;
  6651. }
  6652. onConstructor() {
  6653. this.ui = ui_UIRepentProp.createInstance();
  6654. this.contentPane = this.ui;
  6655. this.isEject = false;
  6656. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  6657. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  6658. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  6659. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  6660. }
  6661. show(viewType, regretType, callback) {
  6662. PlatMgr.showInsert(true);
  6663. this.viewType = viewType;
  6664. this.regretType = regretType;
  6665. this.callback = callback;
  6666. super.show();
  6667. this.ui.t0.play();
  6668. this.ui.c1.selectedIndex = this.viewType;
  6669. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  6670. if (this.viewType == 0) {
  6671. let guide = DataMgr.getGuideHelpLine();
  6672. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  6673. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  6674. }
  6675. xGame.common.gameMgr.gamePause = true;
  6676. }
  6677. hideSelf() {
  6678. xGame.common.gameMgr.gamePause = false;
  6679. this.callback && this.callback(false);
  6680. this.hide();
  6681. }
  6682. videoRegret() {
  6683. Moyu.showVideoAd(() => {
  6684. this.callback && this.callback(true);
  6685. this.hideSelf();
  6686. }, EAdType.regretBall);
  6687. }
  6688. videoAddHelpLine() {
  6689. let guide = DataMgr.getGuideHelpLine();
  6690. if (guide == 0) {
  6691. this.callback && this.callback(true);
  6692. this.hideSelf();
  6693. DataMgr.setGuideHelpLine();
  6694. xGame.common.gameUI.ui.guideNode.visible = false;
  6695. }
  6696. else {
  6697. Moyu.showVideoAd(() => {
  6698. this.callback && this.callback(true);
  6699. this.hideSelf();
  6700. }, EAdType.longHelpLine);
  6701. }
  6702. }
  6703. }
  6704. UIRepentProp.uiName = "UIRepentProp";
  6705. class ui_UIVideoShare extends fgui.GComponent {
  6706. static createInstance() {
  6707. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  6708. }
  6709. onConstruct() {
  6710. this.n10 = (this.getChild("n10"));
  6711. this.myNode = (this.getChild("myNode"));
  6712. this.t0 = this.getTransition("t0");
  6713. }
  6714. }
  6715. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  6716. class UIVideoShare extends UIBase {
  6717. constructor() {
  6718. super();
  6719. this.success = false;
  6720. this.awardNum = 0;
  6721. this.isShared = true;
  6722. }
  6723. onConstructor() {
  6724. this.ui = ui_UIVideoShare.createInstance();
  6725. this.contentPane = this.ui;
  6726. this.isEject = false;
  6727. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  6728. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  6729. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  6730. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  6731. }
  6732. show(success) {
  6733. super.show();
  6734. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  6735. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  6736. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  6737. this.success = success;
  6738. let time = xGame.common.randomNum(600, 1500);
  6739. Moyu.showInsertAd(time, 60000);
  6740. if (success)
  6741. xGame.soundMgr.playSound("applause");
  6742. this.ui.t0.play();
  6743. this.checkShareState();
  6744. let times = DataMgr.getDailyVideoShareTimes();
  6745. this.awardNum = times == 0 ? 2000 : 200;
  6746. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  6747. }
  6748. checkShareState() {
  6749. if (PlatMgr.forceShare == 0) {
  6750. this.ui.myNode.closeBtn.visible = true;
  6751. this.ui.myNode.tipsNode.visible = false;
  6752. this.ui.myNode.closeBtn.x = 90;
  6753. this.ui.myNode.shareBtn.x = 342;
  6754. }
  6755. else if (PlatMgr.forceShare == 1) {
  6756. this.ui.myNode.closeBtn.visible = false;
  6757. this.ui.myNode.tipsNode.visible = true;
  6758. this.ui.myNode.shareBtn.x = 218;
  6759. this.isShared = true;
  6760. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  6761. }
  6762. }
  6763. checkForceShare() {
  6764. this.isShared = !this.isShared;
  6765. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  6766. }
  6767. videoShare() {
  6768. if (PlatMgr.forceShare == 1) {
  6769. if (this.isShared) {
  6770. this.shareGame();
  6771. }
  6772. else {
  6773. this.hideSelf();
  6774. }
  6775. }
  6776. else {
  6777. this.shareGame();
  6778. }
  6779. }
  6780. shareGame() {
  6781. Moyu.sendDataEvent("VideoShare");
  6782. if (Moyu.canShare() > 100) {
  6783. Moyu.shareGame((success) => {
  6784. if (success) {
  6785. DataMgr.setDailyVideoShareTimes(1);
  6786. DataMgr.setCoin(this.awardNum);
  6787. }
  6788. this.hideSelf();
  6789. }, this);
  6790. }
  6791. else {
  6792. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  6793. this.hideSelf();
  6794. }
  6795. }
  6796. hideSelf() {
  6797. this.hide();
  6798. xGame.uiMgr.Show(UIGameEnd, this.success);
  6799. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  6800. xGame.common.screenImg.destroy();
  6801. xGame.common.screenImg = null;
  6802. }
  6803. }
  6804. }
  6805. UIVideoShare.uiName = "UIVideoShare";
  6806. class ui_UITips extends fgui.GComponent {
  6807. static createInstance() {
  6808. return (fgui.UIPackage.createObject("game", "UITips"));
  6809. }
  6810. onConstruct() {
  6811. this.n0 = (this.getChild("n0"));
  6812. this.myNode = (this.getChild("myNode"));
  6813. this.t0 = this.getTransition("t0");
  6814. }
  6815. }
  6816. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  6817. class UITips extends UIBase {
  6818. constructor() {
  6819. super();
  6820. this.type = 0;
  6821. }
  6822. onConstructor() {
  6823. this.ui = ui_UITips.createInstance();
  6824. this.contentPane = this.ui;
  6825. this.isEject = false;
  6826. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  6827. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  6828. }
  6829. show(tipsTxt, womanTxt, type) {
  6830. super.show();
  6831. this.ui.t0.play();
  6832. this.ui.myNode.tipsTxt.text = tipsTxt;
  6833. this.ui.myNode.womanTxt.text = womanTxt;
  6834. PlatMgr.showInsert(true);
  6835. this.ui.myNode.c1.selectedIndex = type;
  6836. this.type = type;
  6837. switch (this.type) {
  6838. case TipsType.exitGame:
  6839. xGame.common.gameMgr.gamePause = true;
  6840. break;
  6841. case TipsType.foul:
  6842. Laya.timer.once(200, this, () => {
  6843. xGame.common.gameMgr.gamePause = true;
  6844. });
  6845. break;
  6846. default:
  6847. break;
  6848. }
  6849. }
  6850. clickLeftBtn() {
  6851. this.hide();
  6852. xGame.common.gameMgr.gamePause = false;
  6853. switch (this.type) {
  6854. case TipsType.exitGame:
  6855. break;
  6856. case TipsType.foul:
  6857. break;
  6858. default:
  6859. break;
  6860. }
  6861. }
  6862. clickRightBtn() {
  6863. this.hide();
  6864. switch (this.type) {
  6865. case TipsType.exitGame:
  6866. xGame.eventMgr.event(RESET_GAME);
  6867. xGame.uiMgr.Show(UIMain);
  6868. Moyu.recordEnd(this, null);
  6869. xGame.common.longHelpLine = false;
  6870. break;
  6871. case TipsType.foul:
  6872. xGame.common.gameMgr.gamePause = false;
  6873. Laya.timer.clearAll(this);
  6874. break;
  6875. default:
  6876. break;
  6877. }
  6878. }
  6879. }
  6880. UITips.uiName = "UITips";
  6881. class GameMgr {
  6882. constructor() {
  6883. this.selfCamp = "";
  6884. this.selfFoulNum = 0;
  6885. this.selfBallArr = [];
  6886. this.selfTimer = 0;
  6887. this.selfScore = 0;
  6888. this.aiCamp = "";
  6889. this.aiFoulNum = 0;
  6890. this.aiBallArr = [];
  6891. this.aiTimer = 0;
  6892. this.aiScore = 0;
  6893. this.aiSkillLevelNum = 1;
  6894. this.targertScore = 0;
  6895. this.setTime = 30;
  6896. this.selfTurnRate = 0.5;
  6897. this.accTime = 0;
  6898. this.curFoul = "";
  6899. this.maxFoulTimes = 3;
  6900. this.isFirstInGame = true;
  6901. this.firstColliObj = null;
  6902. this.inHoleBalls = [];
  6903. this.blackNum = 8;
  6904. this.success = false;
  6905. this.holePosList = [];
  6906. this.posObj = {};
  6907. this._selfTurn = false;
  6908. this.lastRootBallPos = new Laya.Vector2(311, 430);
  6909. this.ensureBallType = false;
  6910. this.isOpenBall = true;
  6911. this.finishOneShoot = true;
  6912. this.isEnd = false;
  6913. this.isChangeTurn = false;
  6914. this.isInterrupt = false;
  6915. this.aiPlayedBreakArmy = false;
  6916. this.isTouchedBall = false;
  6917. this.finishBalls = 0;
  6918. this.needBalls = 0;
  6919. this.allBallNum = 0;
  6920. this.placeBallPosData = {};
  6921. this.curHP = 0;
  6922. this.showLongView = false;
  6923. this.firstShoot = true;
  6924. this._gamePause = false;
  6925. this.trunCount = 0;
  6926. this.isBlackInHole = false;
  6927. this.isEnter = true;
  6928. xGame.eventMgr.offAll(ALL_BALL_STOP);
  6929. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  6930. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  6931. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  6932. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  6933. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  6934. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  6935. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  6936. }
  6937. get gamePause() {
  6938. return this._gamePause;
  6939. }
  6940. set gamePause(v) {
  6941. if (v) {
  6942. Laya.physicsTimer.pause();
  6943. }
  6944. else {
  6945. Laya.physicsTimer.resume();
  6946. }
  6947. this._gamePause = v;
  6948. }
  6949. get selfTurn() {
  6950. return this._selfTurn;
  6951. }
  6952. set selfTurn(val) {
  6953. this.trunCount++;
  6954. this._selfTurn = val;
  6955. if (val) {
  6956. xGame.common.d2World.d2Gan.ui.self.visible = true;
  6957. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  6958. }
  6959. else {
  6960. xGame.common.d2World.d2Gan.ui.self.visible = false;
  6961. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  6962. if (this.trunCount > 1)
  6963. PlatMgr.openBox();
  6964. }
  6965. }
  6966. resetGame() {
  6967. this.inHoleBalls = [];
  6968. this.isFirstInGame = true;
  6969. this.firstColliObj = null;
  6970. this.aiCamp = "";
  6971. this.selfCamp = "";
  6972. this.aiFoulNum = 0;
  6973. this.selfFoulNum = 0;
  6974. this.selfBallArr = [];
  6975. this.aiBallArr = [];
  6976. this.gamePause = false;
  6977. this.ensureBallType = false;
  6978. this.isInterrupt = false;
  6979. this.updateLeftBall();
  6980. this.clearTime();
  6981. this.aiPlayedBreakArmy = false;
  6982. this.isBlackInHole = false;
  6983. this.placeBallPosData = {};
  6984. if (xGame.common.d3World.knifeRoot) {
  6985. xGame.common.d3World.knifeRoot.destroyChildren();
  6986. }
  6987. }
  6988. gameReady() {
  6989. this.trunCount = 0;
  6990. this.firstColliObj = null;
  6991. this.isFirstInGame = true;
  6992. this.selfTurn = Math.random() <= this.selfTurnRate;
  6993. let challengeNum = DataMgr.getChallengeTimes();
  6994. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  6995. this.selfTurn = true;
  6996. }
  6997. if (xGame.common.gameMode == GameMode.placeBall)
  6998. this.selfTurn = true;
  6999. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  7000. this.selfTurn = true;
  7001. }
  7002. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  7003. this.checkGuide();
  7004. if (xGame.common.uiRodMethod)
  7005. xGame.common.uiRodMethod.resetRod();
  7006. xGame.common.d2World.getHelpLine();
  7007. this.isOpenBall = true;
  7008. this.isTouchedBall = false;
  7009. xGame.common.aiPlayer.stopRun();
  7010. this.setTime = 30;
  7011. let ui = xGame.common.gameUI.ui;
  7012. switch (xGame.common.gameMode) {
  7013. case GameMode.classic:
  7014. xGame.common.aiPlayer.init();
  7015. this.blackNum = 8;
  7016. this.placeRootBall();
  7017. this.peoplePlay(9, 10);
  7018. ui.wordsBtn.visible = true;
  7019. ui.aiWordsBtn.visible = true;
  7020. xGame.common.talkMgr.changeAIState(true);
  7021. DataMgr.gameData.gameCount++;
  7022. DataMgr.saveGameData();
  7023. break;
  7024. case GameMode.bigMove:
  7025. this.blackNum = -1;
  7026. this.selfScore = 0;
  7027. this.aiScore = 0;
  7028. xGame.common.aiPlayer.init();
  7029. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  7030. this.updateSelfScore();
  7031. this.updateAIScore();
  7032. this.updateTargetSroce();
  7033. this.placeRootBall();
  7034. this.peoplePlay(9, 10);
  7035. ui.wordsBtn.visible = true;
  7036. ui.aiWordsBtn.visible = true;
  7037. xGame.common.talkMgr.changeAIState(true);
  7038. if (DataMgr.getSkillGuide() < 1)
  7039. DataMgr.gameData.gameCount = 0;
  7040. else {
  7041. DataMgr.gameData.gameCount++;
  7042. DataMgr.saveGameData();
  7043. PlatMgr.openTry();
  7044. }
  7045. if (xGame.common.d3World.knifeRoot) {
  7046. xGame.common.d3World.knifeRoot.destroyChildren();
  7047. }
  7048. break;
  7049. case GameMode.placeBall:
  7050. this.blackNum = -1;
  7051. this.selfTurn = true;
  7052. this.setTime = 10000;
  7053. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  7054. this.curHP = this.placeBallData.hp;
  7055. if (this.placeBallData.ball == -1)
  7056. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  7057. else
  7058. this.needBalls = this.placeBallData.ball;
  7059. console.log("需要的进球数目", this.needBalls);
  7060. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  7061. this.finishBalls = 0;
  7062. this.placeBallPosData = {};
  7063. this.updatePlaceBallPos();
  7064. this.updatePlaceBallState();
  7065. this.finishOneShoot = true;
  7066. xGame.common.gameUI.ui.moveNode.visible = false;
  7067. this.isOpenBall = false;
  7068. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  7069. ui.wordsBtn.visible = false;
  7070. ui.aiWordsBtn.visible = false;
  7071. xGame.common.talkMgr.changeAIState(false);
  7072. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  7073. PlatMgr.openBox();
  7074. });
  7075. break;
  7076. default:
  7077. break;
  7078. }
  7079. this.showLongView = false;
  7080. xGame.common.wordsMgr.comboTimes = 1;
  7081. let guide = DataMgr.getSkillGuide();
  7082. if (guide)
  7083. xGame.eventMgr.event(WAIT_SHOOT);
  7084. xGame.common.upSkillLevel = false;
  7085. xGame.common.gameStartTime = new Date().getTime();
  7086. this.firstShoot = true;
  7087. }
  7088. checkGuide() {
  7089. let guide = DataMgr.getSkillGuide();
  7090. let gameUI = xGame.common.gameUI.ui;
  7091. gameUI.guide1.visible = false;
  7092. gameUI.guide2.visible = false;
  7093. gameUI.guide3.visible = false;
  7094. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  7095. this.selfTurn = true;
  7096. }
  7097. else {
  7098. return;
  7099. }
  7100. let oneBall = this.getOneBall();
  7101. gameUI.guide1.visible = true;
  7102. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  7103. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  7104. }
  7105. getOneBall() {
  7106. let arr = xGame.common.d2World.ballArr;
  7107. for (let index = 0; index < arr.length; index++) {
  7108. if (arr[index].number == 0)
  7109. continue;
  7110. return arr[index];
  7111. }
  7112. }
  7113. updateSelfScore() {
  7114. let ui = xGame.common.gameUI.ui.topNode;
  7115. ui.selfScoreTxt.text = this.selfScore + "";
  7116. }
  7117. updateAIScore() {
  7118. let ui = xGame.common.gameUI.ui.topNode;
  7119. ui.aiScoreTxt.text = this.aiScore + "";
  7120. }
  7121. updateTargetSroce() {
  7122. let ui = xGame.common.gameUI.ui.topNode;
  7123. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  7124. }
  7125. updateLeftBall() {
  7126. let topUI = xGame.common.gameUI.ui.topNode;
  7127. topUI.selfBallList.numItems = this.selfBallArr.length;
  7128. topUI.aiBallList.numItems = this.aiBallArr.length;
  7129. }
  7130. ballShoot() {
  7131. this.clearTime();
  7132. this.finishOneShoot = false;
  7133. xGame.common.gameUI.ui.moveNode.visible = false;
  7134. if (xGame.common.gameUI.ui.guideNode.visible) {
  7135. xGame.common.gameUI.ui.guideNode.visible = false;
  7136. }
  7137. if (this.firstShoot) {
  7138. this.firstShoot = false;
  7139. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  7140. }
  7141. }
  7142. ensureCamp(number) {
  7143. this.ensureBallType = true;
  7144. this.isOpenBall = false;
  7145. if (xGame.common.gameMode != GameMode.classic)
  7146. return;
  7147. let full = [1, 2, 3, 4, 5, 6, 7];
  7148. let flower = [9, 10, 11, 12, 13, 14, 15];
  7149. let sayWords = "";
  7150. if (this.selfTurn) {
  7151. if (number <= 7) {
  7152. this.selfCamp = ballCamp.full;
  7153. this.selfBallArr = full;
  7154. this.aiCamp = ballCamp.flower;
  7155. this.aiBallArr = flower;
  7156. sayWords = cfgTable.wordsData[3].msg;
  7157. }
  7158. else {
  7159. this.selfCamp = ballCamp.flower;
  7160. this.selfBallArr = flower;
  7161. this.aiCamp = ballCamp.full;
  7162. this.aiBallArr = full;
  7163. sayWords = cfgTable.wordsData[4].msg;
  7164. }
  7165. }
  7166. else {
  7167. if (number <= 7) {
  7168. this.selfCamp = ballCamp.flower;
  7169. this.selfBallArr = flower;
  7170. this.aiCamp = ballCamp.full;
  7171. this.aiBallArr = full;
  7172. sayWords = cfgTable.wordsData[2].msg;
  7173. }
  7174. else {
  7175. this.selfCamp = ballCamp.full;
  7176. this.selfBallArr = full;
  7177. this.aiCamp = ballCamp.flower;
  7178. this.aiBallArr = flower;
  7179. sayWords = cfgTable.wordsData[1].msg;
  7180. }
  7181. }
  7182. this.updateLeftBall();
  7183. xGame.uiMgr.Show(UIMsg, sayWords);
  7184. }
  7185. updatePlaceBallState() {
  7186. let ui = xGame.common.gameUI.ui;
  7187. switch (this.placeBallData.type) {
  7188. case PlaceBallType.normal:
  7189. let normal = ui.placeNormalNode;
  7190. normal.hpTxt.text = this.curHP + "";
  7191. this.updatePlaceBallStar(normal);
  7192. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  7193. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  7194. break;
  7195. case PlaceBallType.challenge:
  7196. let challenge = ui.placeChallengeNode;
  7197. challenge.hpTxt.text = "Shots:" + this.curHP;
  7198. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  7199. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  7200. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  7201. break;
  7202. default:
  7203. break;
  7204. }
  7205. }
  7206. playSubHpAni() {
  7207. let ui = xGame.common.gameUI.ui;
  7208. switch (this.placeBallData.type) {
  7209. case PlaceBallType.normal:
  7210. let normal = ui.placeNormalNode;
  7211. normal.hpTxt.visible = false;
  7212. normal.starAni.c1.selectedIndex = 1;
  7213. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  7214. normal.hpTxt.visible = true;
  7215. normal.starAni.c1.selectedIndex = 0;
  7216. }));
  7217. break;
  7218. default:
  7219. break;
  7220. }
  7221. }
  7222. getEndStarNum() {
  7223. let num;
  7224. let level = xGame.common.placeBallCurLevel;
  7225. if (this.curHP == this.placeBallData.hp) {
  7226. num = 3;
  7227. }
  7228. else if (this.curHP <= 1) {
  7229. num = 1;
  7230. }
  7231. else {
  7232. num = 2;
  7233. }
  7234. if (!this.success) {
  7235. num = 0;
  7236. }
  7237. else {
  7238. DataMgr.setPlaceBallLevel(level, num);
  7239. }
  7240. let myType = cfgTable.placeballData[level].type;
  7241. if (this.success && myType == 1) {
  7242. num = 3;
  7243. }
  7244. xGame.common.placeBallStarNum = num;
  7245. }
  7246. updatePlaceBallStar(node) {
  7247. let star = 0;
  7248. if (this.curHP == this.placeBallData.hp) {
  7249. star = 3;
  7250. }
  7251. else if (this.curHP >= 2) {
  7252. star = 2;
  7253. }
  7254. else if (this.curHP == 1) {
  7255. star = 1;
  7256. }
  7257. else {
  7258. star = 0;
  7259. }
  7260. let temp;
  7261. for (let index = 1; index <= 3; index++) {
  7262. temp = node["star" + index];
  7263. temp.c1.selectedIndex = star >= index ? 1 : 0;
  7264. }
  7265. node.myProgress.value = (star / 3) * 100;
  7266. }
  7267. openRegretView(isFoul, GoalNum, challenge = false) {
  7268. let regretType = -1;
  7269. if (isFoul) {
  7270. regretType = 1;
  7271. }
  7272. else {
  7273. if (GoalNum <= 0) {
  7274. regretType = 0;
  7275. }
  7276. }
  7277. if (challenge) {
  7278. regretType = 1;
  7279. }
  7280. if (regretType != -1) {
  7281. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  7282. if (success) {
  7283. this.curHP++;
  7284. this.updatePlaceBallState();
  7285. this.setPlaceBallAllPos();
  7286. xGame.common.gameUI.ui.moveNode.visible = false;
  7287. }
  7288. else {
  7289. if (this.curHP <= 0) {
  7290. this.success = false;
  7291. this.gameEnd();
  7292. }
  7293. this.playSubHpAni();
  7294. }
  7295. this.updatePlaceBallState();
  7296. this.updatePlaceBallPos();
  7297. });
  7298. }
  7299. }
  7300. setPlaceBallAllPos() {
  7301. let allBall = xGame.common.d2World.ballArr;
  7302. let cfgArr = this.placeBallPosData;
  7303. let temp;
  7304. let obj;
  7305. for (let index = 0; index < allBall.length; index++) {
  7306. temp = allBall[index];
  7307. if (temp.destroyed)
  7308. continue;
  7309. obj = cfgArr[temp.myUNID];
  7310. if (obj && obj.src && !obj.src.destroyed) {
  7311. temp.gameObj.x = obj.posX;
  7312. temp.gameObj.y = obj.posY;
  7313. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  7314. }
  7315. }
  7316. xGame.common.d2World.getHelpLine();
  7317. }
  7318. updatePlaceBallPos() {
  7319. let arr = xGame.common.d2World.ballArr;
  7320. let temp;
  7321. for (let index = 0; index < arr.length; index++) {
  7322. temp = arr[index];
  7323. if (!this.placeBallPosData[temp.myUNID]) {
  7324. this.placeBallPosData[temp.myUNID] = {
  7325. src: temp,
  7326. posX: temp.gameObj.x,
  7327. posY: temp.gameObj.y
  7328. };
  7329. }
  7330. else {
  7331. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  7332. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  7333. }
  7334. }
  7335. let check;
  7336. for (const key in this.placeBallPosData) {
  7337. check = this.placeBallPosData[key];
  7338. if (check.src.destroyed) {
  7339. delete this.placeBallPosData[key];
  7340. }
  7341. }
  7342. }
  7343. gameRun(type) {
  7344. if (this.gamePause)
  7345. return;
  7346. this.curFoul = this.getFoulType();
  7347. if (type) {
  7348. xGame.common.d2World.d2Gan.shoot();
  7349. xGame.common.gameUI.forceCancel();
  7350. this.curFoul = type;
  7351. }
  7352. this.isEnd = false;
  7353. this.isChangeTurn = true;
  7354. if (xGame.common.gameMode == GameMode.classic) {
  7355. this.judgeClassic(this.curFoul);
  7356. this.checkClassicWords(() => {
  7357. xGame.common.destroyClassicEmotion();
  7358. if (this.isEnd) {
  7359. if (this.isBlackInHole) {
  7360. xGame.common.gameUI.ui.blackAni.visible = true;
  7361. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  7362. xGame.common.gameUI.ui.blackAni.visible = false;
  7363. this.gameEnd();
  7364. }));
  7365. }
  7366. else {
  7367. this.gameEnd();
  7368. }
  7369. }
  7370. else {
  7371. this.waitShoot();
  7372. xGame.eventMgr.event(WAIT_SHOOT);
  7373. }
  7374. });
  7375. }
  7376. else if (xGame.common.gameMode == GameMode.bigMove) {
  7377. xGame.common.aiPlayer.stopRun();
  7378. let scoreArr = this.getScore(this.curFoul);
  7379. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  7380. this.isEnd = true;
  7381. }
  7382. this.checkBigSkillWords(() => {
  7383. if (this.isEnd) {
  7384. this.gameEnd();
  7385. }
  7386. else {
  7387. this.waitShoot();
  7388. xGame.eventMgr.event(WAIT_SHOOT);
  7389. }
  7390. });
  7391. }
  7392. else if (xGame.common.gameMode == GameMode.placeBall) {
  7393. xGame.common.destroyAwardSpine();
  7394. let isFoul = this.curFoul == FoulType.rootHole;
  7395. let GoalNum = this.inHoleBalls.length;
  7396. if (this.inHoleBalls.indexOf(0) > -1)
  7397. GoalNum -= 1;
  7398. if (isFoul) {
  7399. this.placeRootBall();
  7400. }
  7401. console.log("neeballs", this.needBalls);
  7402. console.log("当前完成的goalNum", GoalNum);
  7403. this.finishBalls += GoalNum;
  7404. console.log("当前完成的finishballs", this.finishBalls);
  7405. let need = this.needBalls;
  7406. if (this.placeBallData.type == PlaceBallType.challenge) {
  7407. need += 100;
  7408. }
  7409. if (this.finishBalls >= need) {
  7410. this.success = true;
  7411. this.gameEnd();
  7412. }
  7413. else {
  7414. switch (this.placeBallData.type) {
  7415. case PlaceBallType.normal:
  7416. if (!isFoul && GoalNum > 0) {
  7417. this.updatePlaceBallPos();
  7418. this.updatePlaceBallState();
  7419. }
  7420. else {
  7421. this.curHP--;
  7422. this.openRegretView(isFoul, GoalNum);
  7423. }
  7424. this.waitShoot();
  7425. xGame.eventMgr.event(WAIT_SHOOT);
  7426. break;
  7427. case PlaceBallType.challenge:
  7428. this.curHP--;
  7429. this.updatePlaceBallState();
  7430. if (isFoul) {
  7431. this.openRegretView(isFoul, GoalNum, true);
  7432. }
  7433. else {
  7434. this.updatePlaceBallPos();
  7435. if (this.curHP <= 0) {
  7436. this.success = true;
  7437. this.gameEnd();
  7438. }
  7439. }
  7440. this.waitShoot();
  7441. xGame.eventMgr.event(WAIT_SHOOT);
  7442. break;
  7443. default:
  7444. break;
  7445. }
  7446. }
  7447. }
  7448. }
  7449. checkClassicWords(callback) {
  7450. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  7451. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  7452. let type = this.getClassicWordsType();
  7453. if (condition && type != -1) {
  7454. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  7455. xGame.soundMgr.playSound(str);
  7456. xGame.common.wordsMgr.playClassicWords(type, callback);
  7457. }
  7458. else {
  7459. Laya.timer.once(300, this, () => {
  7460. callback && callback();
  7461. });
  7462. }
  7463. }
  7464. getClassicWordsType() {
  7465. let d2world = xGame.common.d2World;
  7466. let type = -1;
  7467. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  7468. type = ClassicWordsType.perfectShow;
  7469. return type;
  7470. }
  7471. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  7472. type = ClassicWordsType.directShoot;
  7473. return type;
  7474. }
  7475. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  7476. type = ClassicWordsType.anotherShoot;
  7477. return type;
  7478. }
  7479. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  7480. type = ClassicWordsType.bigPower;
  7481. return type;
  7482. }
  7483. let minSpeed = 1;
  7484. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  7485. type = ClassicWordsType.hardShoot;
  7486. return type;
  7487. }
  7488. if (this.inHoleBalls.length > 0) {
  7489. type = ClassicWordsType.directShoot;
  7490. return type;
  7491. }
  7492. return type;
  7493. }
  7494. checkBigSkillWords(callback) {
  7495. if (this.curFoul == FoulType.timeOut) {
  7496. callback && callback();
  7497. }
  7498. else {
  7499. let playSkill = false;
  7500. if (this.selfTurn) {
  7501. playSkill = true;
  7502. }
  7503. else {
  7504. if (!this.aiPlayedBreakArmy) {
  7505. this.aiPlayedBreakArmy = true;
  7506. playSkill = true;
  7507. }
  7508. if (this.aiCurSkill != SkillType.breakArmy) {
  7509. playSkill = true;
  7510. }
  7511. }
  7512. if (xGame.common.skillMgr.playedLastSkill) {
  7513. xGame.common.skillMgr.playedLastSkill = false;
  7514. playSkill = false;
  7515. }
  7516. if (playSkill) {
  7517. xGame.common.skillMgr.runBigSkill((extraScore) => {
  7518. let selfExtra = 0;
  7519. let aiExtra = 0;
  7520. if (this.selfTurn)
  7521. selfExtra += extraScore;
  7522. else
  7523. aiExtra += extraScore;
  7524. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  7525. this.isEnd = true;
  7526. }
  7527. this.playBigSkillTimes(callback);
  7528. });
  7529. }
  7530. else {
  7531. this.playBigSkillTimes(callback);
  7532. }
  7533. }
  7534. }
  7535. playBigSkillTimes(callback) {
  7536. let length = this.inHoleBalls.length;
  7537. if (this.inHoleBalls.indexOf(0) > -1) {
  7538. length = this.inHoleBalls.length - 1;
  7539. }
  7540. if (length <= 0) {
  7541. callback && callback();
  7542. return;
  7543. }
  7544. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  7545. callback && callback();
  7546. });
  7547. }
  7548. playSkillTips() {
  7549. let levelNum = 0;
  7550. let curType;
  7551. if (this.selfTurn) {
  7552. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  7553. curType = this.selfCurSkill;
  7554. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  7555. levelNum += 5;
  7556. }
  7557. }
  7558. else {
  7559. levelNum = this.aiSkillLevelNum;
  7560. curType = this.aiCurSkill;
  7561. }
  7562. let str = ``;
  7563. switch (curType) {
  7564. case SkillType.highSpace:
  7565. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  7566. break;
  7567. case SkillType.breakArmy:
  7568. str = `You pocketed ${levelNum} extra balls`;
  7569. break;
  7570. case SkillType.ice:
  7571. str = `${levelNum * 2} extra balls were frozen`;
  7572. break;
  7573. case SkillType.fireworks:
  7574. str = `${levelNum} extra balls exploded `;
  7575. break;
  7576. case SkillType.GuanYu:
  7577. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  7578. break;
  7579. default:
  7580. break;
  7581. }
  7582. xGame.uiMgr.Show(UIMsg, str);
  7583. }
  7584. getFoulType() {
  7585. let foulType = "";
  7586. if (this.firstColliObj == null) {
  7587. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  7588. return FoulType.rootHole;
  7589. }
  7590. return FoulType.notTouch;
  7591. }
  7592. else {
  7593. if (this.selfTurn) {
  7594. if (this.selfBallArr.length > 0) {
  7595. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  7596. foulType = FoulType.wrongTouch;
  7597. }
  7598. }
  7599. else {
  7600. if (this.ensureBallType) {
  7601. }
  7602. else {
  7603. if (this.firstColliObj == this.blackNum) {
  7604. foulType = FoulType.wrongTouch;
  7605. }
  7606. }
  7607. }
  7608. }
  7609. else {
  7610. if (this.aiBallArr.length > 0) {
  7611. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  7612. foulType = FoulType.wrongTouch;
  7613. }
  7614. }
  7615. else {
  7616. if (this.ensureBallType) {
  7617. }
  7618. else {
  7619. if (this.firstColliObj == this.blackNum) {
  7620. foulType = FoulType.wrongTouch;
  7621. }
  7622. }
  7623. }
  7624. }
  7625. if (this.inHoleBalls.length <= 0) {
  7626. return foulType;
  7627. }
  7628. let temp;
  7629. if (this.inHoleBalls.indexOf(0) > -1) {
  7630. foulType = FoulType.rootHole;
  7631. }
  7632. else {
  7633. for (let index = 0; index < this.inHoleBalls.length; index++) {
  7634. temp = this.inHoleBalls[index];
  7635. if (this.selfTurn) {
  7636. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  7637. foulType = FoulType.wrongHole;
  7638. break;
  7639. }
  7640. }
  7641. else {
  7642. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  7643. foulType = FoulType.wrongHole;
  7644. break;
  7645. }
  7646. }
  7647. }
  7648. }
  7649. let foo;
  7650. for (let index = 0; index < this.inHoleBalls.length; index++) {
  7651. temp = this.inHoleBalls[index];
  7652. foo = this.selfBallArr.indexOf(temp);
  7653. if (foo > -1) {
  7654. this.selfBallArr.splice(foo, 1);
  7655. }
  7656. foo = this.aiBallArr.indexOf(temp);
  7657. if (foo > -1) {
  7658. this.aiBallArr.splice(foo, 1);
  7659. }
  7660. }
  7661. this.updateLeftBall();
  7662. }
  7663. return foulType;
  7664. }
  7665. judgeGameEndByBlack(arr) {
  7666. if (this.selfTurn) {
  7667. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  7668. this.selfFoulNum = this.maxFoulTimes;
  7669. return true;
  7670. }
  7671. }
  7672. else {
  7673. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  7674. this.aiFoulNum = this.maxFoulTimes;
  7675. return true;
  7676. }
  7677. }
  7678. }
  7679. judgeClassic(type) {
  7680. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  7681. xGame.common.aiPlayer.stopRun();
  7682. if (this.judgeNormalSuccess()) {
  7683. this.isEnd = true;
  7684. return;
  7685. }
  7686. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  7687. if (this.selfTurn) {
  7688. if (isFoul) {
  7689. this.selfFoulNum++;
  7690. }
  7691. if (this.selfFoulNum >= this.maxFoulTimes) {
  7692. this.success = false;
  7693. this.isEnd = true;
  7694. return;
  7695. }
  7696. }
  7697. else {
  7698. if (isFoul)
  7699. this.aiFoulNum++;
  7700. if (this.aiFoulNum >= this.maxFoulTimes) {
  7701. this.success = true;
  7702. this.isEnd = true;
  7703. return;
  7704. }
  7705. }
  7706. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  7707. this.isChangeTurn = false;
  7708. }
  7709. else {
  7710. this.isInterrupt = true;
  7711. }
  7712. }
  7713. waitShoot() {
  7714. if (xGame.common.gameMode == GameMode.classic) {
  7715. switch (this.curFoul) {
  7716. case FoulType.timeOut:
  7717. case FoulType.rootHole:
  7718. this.selfTurn = !this.selfTurn;
  7719. this.peoplePlay(5, 6, true);
  7720. break;
  7721. case FoulType.notTouch:
  7722. this.selfTurn = !this.selfTurn;
  7723. this.peoplePlay(7, 7);
  7724. break;
  7725. case FoulType.wrongHole:
  7726. this.selfTurn = !this.selfTurn;
  7727. this.peoplePlay(11, 11);
  7728. break;
  7729. default:
  7730. if (this.inHoleBalls.length > 0) {
  7731. this.peoplePlay(0, 0, false, false);
  7732. }
  7733. else {
  7734. this.selfTurn = !this.selfTurn;
  7735. this.peoplePlay(7, 7);
  7736. }
  7737. break;
  7738. }
  7739. }
  7740. else if (xGame.common.gameMode == GameMode.bigMove) {
  7741. if (this.curFoul == FoulType.timeOut) {
  7742. this.selfTurn = !this.selfTurn;
  7743. this.peoplePlay(14, 15);
  7744. this.placeRootBall();
  7745. }
  7746. else {
  7747. this.selfTurn = !this.selfTurn;
  7748. if (this.curFoul == FoulType.rootHole) {
  7749. this.peoplePlay(12, 13);
  7750. this.placeRootBall();
  7751. }
  7752. else {
  7753. this.peoplePlay(0, 0, false, false);
  7754. }
  7755. }
  7756. }
  7757. else if (xGame.common.gameMode == GameMode.placeBall) {
  7758. this.finishOneShoot = true;
  7759. }
  7760. this.gameResult();
  7761. }
  7762. gameResult() {
  7763. this.firstColliObj = null;
  7764. this.inHoleBalls = [];
  7765. let curX = xGame.common.d2World.rootBall.gameObj.x;
  7766. let curY = xGame.common.d2World.rootBall.gameObj.y;
  7767. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  7768. if (xGame.common.uiRodMethod)
  7769. xGame.common.uiRodMethod.resetRod();
  7770. xGame.common.d2World.rootBall.showSelf();
  7771. this.clearIceSkill();
  7772. if (this.selfTurn) {
  7773. console.log("gameResult");
  7774. PlatMgr.gameInsert();
  7775. }
  7776. xGame.common.d3World.knifeRoot.destroyChildren();
  7777. if (this.selfTurn) {
  7778. xGame.common.gameUI.showHelpLineGuide();
  7779. xGame.common.gameUI.setTurnAlpha(true);
  7780. }
  7781. else {
  7782. xGame.common.gameUI.setTurnAlpha(false);
  7783. }
  7784. }
  7785. getScore(type) {
  7786. let selfAdd = 0;
  7787. let aiAdd = 0;
  7788. if (type == FoulType.timeOut) {
  7789. if (this.selfTurn)
  7790. aiAdd += 3;
  7791. else
  7792. selfAdd += 3;
  7793. }
  7794. else {
  7795. if (this.inHoleBalls.length > 0) {
  7796. if (this.selfTurn) {
  7797. if (type == FoulType.rootHole) {
  7798. aiAdd += 3;
  7799. if (this.inHoleBalls.length - 1 > 0) {
  7800. selfAdd += this.inHoleBalls.length - 1;
  7801. }
  7802. }
  7803. else {
  7804. selfAdd += this.inHoleBalls.length;
  7805. }
  7806. }
  7807. else {
  7808. if (type == FoulType.rootHole) {
  7809. selfAdd += 3;
  7810. if (this.inHoleBalls.length - 1 > 0) {
  7811. aiAdd += this.inHoleBalls.length - 1;
  7812. }
  7813. }
  7814. else {
  7815. aiAdd += this.inHoleBalls.length;
  7816. }
  7817. }
  7818. }
  7819. }
  7820. return [selfAdd, aiAdd];
  7821. }
  7822. judgeScoreEnd(selfAdd, aiAdd) {
  7823. this.selfScore += selfAdd;
  7824. this.aiScore += aiAdd;
  7825. this.updateAIScore();
  7826. this.updateSelfScore();
  7827. if (this.selfScore >= this.targertScore) {
  7828. this.success = true;
  7829. return true;
  7830. }
  7831. if (this.aiScore >= this.targertScore) {
  7832. this.success = false;
  7833. return true;
  7834. }
  7835. let ballArr = xGame.common.d2World.ballArr;
  7836. if (ballArr.length == 1 && ballArr[0].number == 0) {
  7837. if (this.selfScore > this.aiScore) {
  7838. this.success = true;
  7839. return true;
  7840. }
  7841. else if (this.selfScore < this.aiScore) {
  7842. this.success = false;
  7843. return true;
  7844. }
  7845. else {
  7846. if (this.selfTurn) {
  7847. this.success = false;
  7848. }
  7849. else {
  7850. this.success = true;
  7851. }
  7852. return true;
  7853. }
  7854. }
  7855. }
  7856. clearIceSkill() {
  7857. let arr = xGame.common.d2World.ballArr;
  7858. let temp;
  7859. if (this.selfTurn) {
  7860. if (this.selfCurSkill == SkillType.ice) {
  7861. for (let index = 0; index < arr.length; index++) {
  7862. temp = arr[index];
  7863. if (temp.ballFunc == "ice") {
  7864. temp.setBallFunc("normal", "self");
  7865. }
  7866. }
  7867. }
  7868. }
  7869. else {
  7870. if (this.aiCurSkill == SkillType.ice) {
  7871. for (let index = 0; index < arr.length; index++) {
  7872. temp = arr[index];
  7873. if (temp.ballFunc == "ice") {
  7874. temp.setBallFunc("normal", "ai");
  7875. }
  7876. }
  7877. }
  7878. }
  7879. }
  7880. judgeNormalSuccess() {
  7881. if (this.selfTurn) {
  7882. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  7883. this.success = true;
  7884. return true;
  7885. }
  7886. }
  7887. else {
  7888. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  7889. this.success = false;
  7890. return true;
  7891. }
  7892. }
  7893. }
  7894. gameEnd() {
  7895. if (Moyu.isTT) {
  7896. xGame.common.screenImg = getScreenImg();
  7897. }
  7898. console.log("游戏结束", this.success);
  7899. xGame.common.aiPlayer.stopRun();
  7900. if (xGame.common.gameMode == GameMode.placeBall) {
  7901. this.getEndStarNum();
  7902. this.updatePlaceBallState();
  7903. }
  7904. this.isEnter = false;
  7905. Moyu.recordEnd(this, () => {
  7906. if (this.isEnter)
  7907. return;
  7908. this.isEnter = true;
  7909. console.log("进入录结束回调");
  7910. this.enterNext();
  7911. });
  7912. Laya.timer.once(1000, this, () => {
  7913. if (this.isEnter)
  7914. return;
  7915. this.isEnter = true;
  7916. this.enterNext();
  7917. });
  7918. xGame.common.longHelpLine = false;
  7919. }
  7920. enterNext() {
  7921. Laya.timer.clearAll(this);
  7922. if (Moyu.canShare() > 100 || Moyu.isKs) {
  7923. xGame.uiMgr.Show(UIVideoShare, this.success);
  7924. }
  7925. else {
  7926. xGame.uiMgr.Show(UIGameEnd, this.success);
  7927. }
  7928. }
  7929. aiLeave() {
  7930. let ui = xGame.common.gameUI.ui;
  7931. ui.topNode.aiNameTxt.text = "offline";
  7932. }
  7933. aiGameEnd(suc) {
  7934. this.success = suc;
  7935. xGame.common.aiPlayer.stopRun();
  7936. if (this.success) {
  7937. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  7938. Laya.timer.once(1000, this, () => {
  7939. this.clearTime();
  7940. this.gameEnd();
  7941. });
  7942. }
  7943. }
  7944. openTimer() {
  7945. let src = xGame.common.gameUI;
  7946. if (this.selfTurn) {
  7947. src.ui.topNode.selfProgress.visible = true;
  7948. src.ui.topNode.aiProgress.visible = false;
  7949. this.curTimer = src.ui.topNode.selfProgress;
  7950. }
  7951. else {
  7952. src.ui.topNode.selfProgress.visible = false;
  7953. src.ui.topNode.aiProgress.visible = true;
  7954. this.curTimer = src.ui.topNode.aiProgress;
  7955. }
  7956. this.accTime = 0;
  7957. Laya.timer.clearAll(this);
  7958. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  7959. this.curTimer.value = 100;
  7960. }
  7961. updateTime(dt) {
  7962. if (this.gamePause)
  7963. return;
  7964. this.accTime += dt;
  7965. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  7966. if (this.accTime >= this.setTime) {
  7967. this.clearTime();
  7968. console.log("时钟进入了gameRun");
  7969. this.gameRun(FoulType.timeOut);
  7970. }
  7971. }
  7972. clearTime() {
  7973. let src = xGame.common.gameUI;
  7974. src.ui.topNode.selfProgress.visible = false;
  7975. src.ui.topNode.aiProgress.visible = false;
  7976. Laya.timer.clearAll(this);
  7977. }
  7978. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  7979. let ui = xGame.common.gameUI.ui;
  7980. let selfMsg, aiMsg;
  7981. if (sayWords) {
  7982. selfMsg = cfgTable.wordsData[selfIndex].msg;
  7983. aiMsg = cfgTable.wordsData[aiIndex].msg;
  7984. if (Foul) {
  7985. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  7986. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  7987. this.placeRootBall();
  7988. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  7989. if (this.curFoul == FoulType.rootHole) {
  7990. if (!DataMgr.getRootBallFoul()) {
  7991. DataMgr.setRootBallFoul();
  7992. aiMsg = "";
  7993. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  7994. let woman = "Boss, pay attention next time~";
  7995. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  7996. }
  7997. }
  7998. else if (this.curFoul == FoulType.timeOut) {
  7999. if (!DataMgr.getTimeoutFoul()) {
  8000. DataMgr.setTimeoutFoul();
  8001. aiMsg = "";
  8002. let tips = "Game timeout, 3 fouls, this game failed.";
  8003. let woman = "Boss, pay attention to the timeline~";
  8004. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  8005. }
  8006. }
  8007. }
  8008. }
  8009. }
  8010. if (this.selfTurn) {
  8011. if (sayWords) {
  8012. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  8013. ui.selfTurn.visible = true;
  8014. ui.aiTurn.visible = false;
  8015. ui.selfTurn.t0.play();
  8016. Moyu.vibration();
  8017. });
  8018. }
  8019. }
  8020. else {
  8021. let aiNum = xGame.tools.random(1, 11);
  8022. let challengeNum = DataMgr.getChallengeTimes();
  8023. let delay = false;
  8024. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8025. aiNum = 9;
  8026. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  8027. aiNum = 3;
  8028. if (challengeNum == 3) {
  8029. if (!this.showLongView) {
  8030. this.showLongView = true;
  8031. delay = true;
  8032. }
  8033. }
  8034. }
  8035. }
  8036. if (delay) {
  8037. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  8038. if (success) {
  8039. xGame.common.longHelpLine = true;
  8040. xGame.common.d2World.getHelpLine();
  8041. }
  8042. else {
  8043. aiNum = 10;
  8044. }
  8045. xGame.common.aiPlayer.setAiLevel(aiNum);
  8046. if (sayWords) {
  8047. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  8048. xGame.common.aiPlayer.runAI();
  8049. ui.selfTurn.visible = false;
  8050. ui.aiTurn.visible = true;
  8051. ui.aiTurn.t0.play();
  8052. });
  8053. }
  8054. else {
  8055. xGame.common.aiPlayer.runAI();
  8056. }
  8057. this.openTimer();
  8058. this.finishOneShoot = true;
  8059. if (this.selfTurn) {
  8060. ui.topNode.selfKuang.visible = true;
  8061. ui.topNode.aiKuang.visible = false;
  8062. ui.topNode.selfTips.visible = true;
  8063. ui.topNode.aiTips.visible = false;
  8064. }
  8065. else {
  8066. ui.topNode.selfKuang.visible = false;
  8067. ui.topNode.aiKuang.visible = true;
  8068. ui.topNode.selfTips.visible = false;
  8069. ui.topNode.aiTips.visible = true;
  8070. }
  8071. });
  8072. return;
  8073. }
  8074. if (xGame.common.gameMode == GameMode.classic) {
  8075. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  8076. if (cfg) {
  8077. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  8078. aiNum = aiLevel;
  8079. }
  8080. }
  8081. xGame.common.aiPlayer.setAiLevel(aiNum);
  8082. if (sayWords) {
  8083. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  8084. xGame.common.aiPlayer.runAI();
  8085. ui.selfTurn.visible = false;
  8086. ui.aiTurn.visible = true;
  8087. ui.aiTurn.t0.play();
  8088. });
  8089. }
  8090. else {
  8091. xGame.common.aiPlayer.runAI();
  8092. }
  8093. }
  8094. this.openTimer();
  8095. this.finishOneShoot = true;
  8096. if (this.selfTurn) {
  8097. ui.topNode.selfKuang.visible = true;
  8098. ui.topNode.aiKuang.visible = false;
  8099. ui.topNode.selfTips.visible = true;
  8100. ui.topNode.aiTips.visible = false;
  8101. }
  8102. else {
  8103. ui.topNode.selfKuang.visible = false;
  8104. ui.topNode.aiKuang.visible = true;
  8105. ui.topNode.selfTips.visible = false;
  8106. ui.topNode.aiTips.visible = true;
  8107. }
  8108. }
  8109. placeRootBall() {
  8110. let rootBall = xGame.common.d2World.rootBall;
  8111. if (!rootBall)
  8112. return;
  8113. rootBall.gameObj.x = this.lastRootBallPos.x;
  8114. rootBall.gameObj.y = this.lastRootBallPos.y;
  8115. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  8116. let moveNode = xGame.common.gameUI.ui.moveNode;
  8117. moveNode.visible = true;
  8118. moveNode.x = this.lastRootBallPos.x;
  8119. moveNode.y = this.lastRootBallPos.y;
  8120. if (!this.selfTurn) {
  8121. xGame.common.aiPlayer.resetRoot();
  8122. }
  8123. }
  8124. }
  8125. class ui_guanyuAni extends fgui.GComponent {
  8126. static createInstance() {
  8127. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  8128. }
  8129. onConstruct() {
  8130. this.n0 = (this.getChild("n0"));
  8131. }
  8132. }
  8133. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  8134. class UIFireworks extends UIBase {
  8135. constructor() {
  8136. super();
  8137. }
  8138. onConstructor() {
  8139. this.isEject = false;
  8140. }
  8141. show(callback) {
  8142. super.show();
  8143. }
  8144. }
  8145. UIFireworks.uiName = "UIFireworks";
  8146. class ui_UIGuanYu extends fgui.GComponent {
  8147. static createInstance() {
  8148. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  8149. }
  8150. onConstruct() {
  8151. this.n2 = (this.getChild("n2"));
  8152. this.n1 = (this.getChild("n1"));
  8153. this.n3 = (this.getChild("n3"));
  8154. this.n4 = (this.getChild("n4"));
  8155. this.n5 = (this.getChild("n5"));
  8156. this.n6 = (this.getChild("n6"));
  8157. this.n8 = (this.getChild("n8"));
  8158. this.n7 = (this.getChild("n7"));
  8159. this.t0 = this.getTransition("t0");
  8160. }
  8161. }
  8162. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  8163. class UIGuanYu extends UIBase {
  8164. constructor() {
  8165. super();
  8166. }
  8167. onConstructor() {
  8168. this.ui = ui_UIGuanYu.createInstance();
  8169. this.contentPane = this.ui;
  8170. this.isEject = false;
  8171. }
  8172. show(callback) {
  8173. super.show();
  8174. this.ui.t0.play(Laya.Handler.create(this, () => {
  8175. callback && callback();
  8176. this.hide();
  8177. }));
  8178. }
  8179. }
  8180. UIGuanYu.uiName = "UIGuanYu";
  8181. class SkillMgr {
  8182. constructor() {
  8183. this.leveNum = 0;
  8184. this.extraScore = 0;
  8185. this.selfTurn = false;
  8186. this.playedLastSkill = false;
  8187. this.tweenArr = [];
  8188. this._finishNum = 0;
  8189. this._curFinish = 0;
  8190. this._rootX = 0;
  8191. this._rootY = 0;
  8192. this.knifeTimes = 0;
  8193. this.knifeV2 = new Laya.Vector2();
  8194. this.knifeV3 = new Laya.Vector3();
  8195. this.rtStarX = 0;
  8196. this.rtStarY = 0;
  8197. this.addBigSkillSpine();
  8198. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8199. }
  8200. addBigSkillSpine() {
  8201. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  8202. console.log("extra2 success");
  8203. });
  8204. }
  8205. runBigSkill(callback) {
  8206. this.tweenArr = [];
  8207. this.callback = callback;
  8208. this.judgeSkill();
  8209. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  8210. let guide = DataMgr.getSkillGuide();
  8211. if (!xGame.common.gameMgr.selfTurn) {
  8212. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  8213. }
  8214. else {
  8215. if (xGame.common.temSelfLevel != 0) {
  8216. this.leveNum = xGame.common.temSelfLevel;
  8217. }
  8218. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  8219. this.leveNum += 5;
  8220. }
  8221. }
  8222. if (guide == 0) {
  8223. DataMgr.setSkillGuide(1);
  8224. if (DataMgr.getNewUser()) {
  8225. Moyu.sendDataEvent("gameFirstPlay");
  8226. DataMgr.setNewUser();
  8227. }
  8228. }
  8229. this.playSpineAni(() => {
  8230. switch (this.curSkill) {
  8231. case SkillType.highSpace:
  8232. this.runHighSpace();
  8233. break;
  8234. case SkillType.breakArmy:
  8235. this.runBreakArmy();
  8236. break;
  8237. case SkillType.ice:
  8238. this.runIce();
  8239. break;
  8240. case SkillType.fireworks:
  8241. this.runFireworks();
  8242. break;
  8243. case SkillType.GuanYu:
  8244. this.runGuanYu();
  8245. break;
  8246. default:
  8247. break;
  8248. }
  8249. });
  8250. }
  8251. judgeSkill() {
  8252. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  8253. let gameMgr = xGame.common.gameMgr;
  8254. let type;
  8255. for (let index = 0; index < typeArr.length; index++) {
  8256. type = typeArr[index];
  8257. if (gameMgr.selfTurn) {
  8258. if (gameMgr.selfCurSkill == type) {
  8259. this.selfTurn = true;
  8260. this.curSkill = type;
  8261. return;
  8262. }
  8263. }
  8264. else {
  8265. if (gameMgr.aiCurSkill == type) {
  8266. this.selfTurn = false;
  8267. this.curSkill = type;
  8268. return;
  8269. }
  8270. }
  8271. }
  8272. }
  8273. playSpineAni(callback) {
  8274. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  8275. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  8276. parent.destroyChildren();
  8277. let aniIndex = 0;
  8278. let skillSpine;
  8279. switch (this.curSkill) {
  8280. case SkillType.highSpace:
  8281. aniIndex = 1;
  8282. xGame.soundMgr.playSound("skill01");
  8283. skillSpine = this.skillSpine2;
  8284. data.scaleX = 0.5;
  8285. data.scaleY = 0.5;
  8286. skillSpine.play(data, 1, false, parent, () => {
  8287. callback && callback();
  8288. });
  8289. break;
  8290. case SkillType.breakArmy:
  8291. aniIndex = 2;
  8292. xGame.soundMgr.playSound("skill02");
  8293. skillSpine = this.skillSpine2;
  8294. data.scaleX = 0.5;
  8295. data.scaleY = 0.5;
  8296. skillSpine.play(data, 2, false, parent, () => {
  8297. callback && callback();
  8298. });
  8299. break;
  8300. case SkillType.ice:
  8301. aniIndex = 0;
  8302. xGame.soundMgr.playSound("skill03");
  8303. skillSpine = this.skillSpine2;
  8304. data.scaleX = 0.5;
  8305. data.scaleY = 0.5;
  8306. skillSpine.play(data, 0, false, parent, () => {
  8307. callback && callback();
  8308. });
  8309. break;
  8310. case SkillType.fireworks:
  8311. xGame.soundMgr.playSound("skill_04_01");
  8312. xGame.soundMgr.playSound("skill04");
  8313. xGame.uiMgr.Show(UIFireworks, callback);
  8314. break;
  8315. case SkillType.GuanYu:
  8316. xGame.soundMgr.playSound("skill05_1");
  8317. xGame.soundMgr.playSound("skill05");
  8318. xGame.uiMgr.Show(UIGuanYu, callback);
  8319. break;
  8320. default:
  8321. break;
  8322. }
  8323. }
  8324. getAllBallArr() {
  8325. let arr = xGame.common.d2World.ballArr;
  8326. let outArr = [];
  8327. for (let index = 0; index < arr.length; index++) {
  8328. if (arr[index] instanceof D2RootBallSrc)
  8329. continue;
  8330. if (arr[index].ballFunc == "ice")
  8331. continue;
  8332. if (arr[index].destroyed)
  8333. continue;
  8334. outArr.push(arr[index]);
  8335. }
  8336. return outArr;
  8337. }
  8338. getOneArr(deletObj) {
  8339. let allArr = this.getAllBallArr();
  8340. let temp;
  8341. for (let index = 0; index < allArr.length; index++) {
  8342. temp = allArr[index];
  8343. if (temp.id == deletObj.id) {
  8344. allArr.splice(index, 1);
  8345. break;
  8346. }
  8347. }
  8348. return allArr;
  8349. }
  8350. getNearBallBag(ball) {
  8351. let ui = xGame.common.gameUI.ui;
  8352. let circleArr = [];
  8353. for (let index = 1; index <= 6; index++) {
  8354. circleArr.push(ui.border["circle" + index]);
  8355. }
  8356. let outIndex = 0;
  8357. let temp;
  8358. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  8359. ;
  8360. let dis = 0;
  8361. for (let index = 1; index < circleArr.length; index++) {
  8362. temp = circleArr[index];
  8363. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  8364. if (dis < min) {
  8365. min = dis;
  8366. outIndex = index;
  8367. }
  8368. }
  8369. return [circleArr[outIndex], outIndex];
  8370. }
  8371. ballFlyToBag(ballArr, time = 300) {
  8372. let temp;
  8373. let hole;
  8374. this._finishNum = ballArr.length;
  8375. this._curFinish = 0;
  8376. let holeObj = {};
  8377. let holeCfg = {
  8378. "1": 0,
  8379. "2": 0,
  8380. "3": 0,
  8381. "4": 0,
  8382. "5": 0,
  8383. "6": 0
  8384. };
  8385. for (let index = 0; index < ballArr.length; index++) {
  8386. temp = ballArr[index];
  8387. temp.outColli.isSensor = true;
  8388. temp.innerColli.isSensor = true;
  8389. temp.isRunSkillAni = true;
  8390. let holeArr = this.getNearBallBag(temp);
  8391. hole = holeArr[0];
  8392. holeObj[index] = holeArr[1];
  8393. temp.d3BallSrc.scaleXYZ = 0.5;
  8394. this.tweenArr.push(temp.d3BallSrc, temp);
  8395. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  8396. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  8397. }));
  8398. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  8399. let mIndex = holeObj[this._curFinish];
  8400. let isDone = holeCfg[mIndex];
  8401. if (isDone) {
  8402. ballArr[this._curFinish].checkWrongBall(false);
  8403. }
  8404. else {
  8405. holeCfg[mIndex] = 1;
  8406. ballArr[this._curFinish].checkWrongBall();
  8407. }
  8408. this._curFinish++;
  8409. if (this._curFinish >= this._finishNum) {
  8410. if (this.curSkill == SkillType.highSpace) {
  8411. }
  8412. else if (this.curSkill == SkillType.breakArmy) {
  8413. let rootBall = xGame.common.d2World.rootBall;
  8414. rootBall.gameObj.x = this._rootX;
  8415. rootBall.gameObj.y = this._rootY;
  8416. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  8417. xGame.common.d2World.d2Gan.ui.visible = true;
  8418. xGame.common.d2World.d2HelpLine.ui.visible = true;
  8419. xGame.common.d2World.getHelpLine();
  8420. this.callback && this.callback(this.extraScore);
  8421. }
  8422. }
  8423. }));
  8424. }
  8425. }
  8426. runHighSpace() {
  8427. let rootBall = xGame.common.d2World.rootBall;
  8428. rootBall.showSelf();
  8429. let d3Src = rootBall.d3BallSrc;
  8430. let allArr = this.getAllBallArr();
  8431. if (allArr.length <= 0) {
  8432. this.callback && this.callback(0);
  8433. return;
  8434. }
  8435. let selectBall = xGame.common.d2World.targetBall;
  8436. let wrong = selectBall && selectBall.destroyed;
  8437. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  8438. selectBall = xGame.common.getRandArrEle(allArr);
  8439. }
  8440. let targetD3Src = selectBall.d3BallSrc;
  8441. xGame.common.d2World.d2Gan.ui.visible = false;
  8442. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8443. d3Src.scaleXYZ = 0.5;
  8444. this.tweenArr.push(d3Src);
  8445. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  8446. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  8447. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  8448. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  8449. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  8450. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  8451. let outArr = [selectBall];
  8452. let other = this.leveNum - 1;
  8453. if (other > 0) {
  8454. let nearArr = this.getOneArr(selectBall);
  8455. if (nearArr.length > 0) {
  8456. xGame.common.botherArr(nearArr);
  8457. if (other >= nearArr.length)
  8458. other = nearArr.length;
  8459. for (let index = 0; index < other; index++) {
  8460. outArr.push(nearArr[index]);
  8461. }
  8462. }
  8463. }
  8464. xGame.common.extraMoveNum = other + 1;
  8465. this.extraScore = other + 1;
  8466. this._rootX = selectBall.gameObj.x;
  8467. this._rootY = selectBall.gameObj.y;
  8468. rootBall.gameObj.x = this._rootX;
  8469. rootBall.gameObj.y = this._rootY;
  8470. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  8471. Laya.Tween.clearAll(d3Src);
  8472. this.addRandomForce(outArr);
  8473. }));
  8474. }));
  8475. }
  8476. addRandomForce(outArr) {
  8477. if (outArr.length > 0) {
  8478. xGame.common.d2World.openCheckStill = true;
  8479. this.playedLastSkill = true;
  8480. }
  8481. let temp;
  8482. for (let index = 0; index < outArr.length; index++) {
  8483. let angle = xGame.common.randomNum(0, 360);
  8484. let linearPercent = xGame.common.randomNum(65, 100);
  8485. temp = outArr[index];
  8486. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  8487. }
  8488. }
  8489. setLinearSpeed(angle, rigy, linearPercent) {
  8490. let sin = Math.sin(angle * Math.PI / 180);
  8491. let cos = Math.cos(angle * Math.PI / 180);
  8492. let maxSpeed = 4;
  8493. let speed = new Laya.Vector2();
  8494. speed.x = maxSpeed * linearPercent * sin;
  8495. speed.y = -maxSpeed * linearPercent * cos;
  8496. rigy.applyLinearImpulseToCenter(speed);
  8497. }
  8498. runBreakArmy() {
  8499. xGame.common.d2World.d2Gan.ui.visible = false;
  8500. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8501. let gameUI = xGame.common.gameUI.ui;
  8502. gameUI.skillRod.visible = true;
  8503. gameUI.skillRod.rotation = 110;
  8504. let outArr = this.getAllBallArr();
  8505. if (outArr.length <= 0) {
  8506. gameUI.skillRod.visible = false;
  8507. this.callback && this.callback(0);
  8508. return;
  8509. }
  8510. xGame.common.botherArr(outArr);
  8511. if (this.leveNum >= outArr.length)
  8512. this.leveNum = outArr.length;
  8513. let deleteNum = outArr.length - this.leveNum;
  8514. outArr.splice(0, deleteNum);
  8515. this.extraScore = this.leveNum;
  8516. let potX = gameUI.skillRod.x;
  8517. let potY = gameUI.skillRod.y;
  8518. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  8519. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  8520. let disArr = [];
  8521. for (let index = 0; index < outArr.length; index++) {
  8522. let obj = outArr[index];
  8523. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  8524. dis = Math.pow(dis, 0.5);
  8525. disArr.push(dis);
  8526. }
  8527. this.tweenArr.push(gameUI.skillRod);
  8528. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  8529. })).update = Laya.Handler.create(this, (e, t, c) => {
  8530. let angle = gameUI.skillRod.rotation;
  8531. let xx;
  8532. let yy;
  8533. let temp;
  8534. for (let index = 0; index < outArr.length; index++) {
  8535. temp = outArr[index];
  8536. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  8537. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  8538. yy -= 20;
  8539. temp.gameObj.x = xx;
  8540. temp.gameObj.y = yy;
  8541. temp.d3BallSrc.setTransPos(xx, yy);
  8542. }
  8543. if (angle <= 60) {
  8544. Laya.Tween.clearAll(gameUI.skillRod);
  8545. this.ballFlyToBag(outArr, 150);
  8546. gameUI.skillRod.visible = false;
  8547. }
  8548. }, null, false);
  8549. }
  8550. runIce() {
  8551. let ballArr = xGame.common.d2World.ballArr;
  8552. this.leveNum *= 2;
  8553. if (this.leveNum >= ballArr.length - 1)
  8554. this.leveNum = ballArr.length - 1;
  8555. let tempArr = [];
  8556. let outArr = [];
  8557. for (let index = 0; index < ballArr.length; index++) {
  8558. if (ballArr[index] instanceof D2RootBallSrc)
  8559. continue;
  8560. tempArr.push(ballArr[index]);
  8561. }
  8562. if (tempArr.length <= 0) {
  8563. this.callback && this.callback(0);
  8564. return;
  8565. }
  8566. xGame.common.botherArr(tempArr);
  8567. for (let index = 0; index < this.leveNum; index++) {
  8568. outArr.push(tempArr[index]);
  8569. }
  8570. this.extraScore = this.leveNum;
  8571. let temp;
  8572. for (let index = 0; index < outArr.length; index++) {
  8573. temp = outArr[index];
  8574. temp.d3BallSrc.playIceEft();
  8575. }
  8576. Laya.timer.once(2000, this, () => {
  8577. for (let index = 0; index < outArr.length; index++) {
  8578. temp = outArr[index];
  8579. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  8580. temp.setBallFunc("ice", str);
  8581. }
  8582. this.callback && this.callback(0);
  8583. });
  8584. }
  8585. runFireworks() {
  8586. let allArr = this.getAllBallArr();
  8587. if (allArr.length <= 0) {
  8588. this.callback && this.callback(0);
  8589. return;
  8590. }
  8591. xGame.common.d2World.d2Gan.ui.visible = false;
  8592. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8593. let outArr = [];
  8594. let other = this.leveNum;
  8595. if (other > 0) {
  8596. if (allArr.length > 0) {
  8597. xGame.common.botherArr(allArr);
  8598. if (other >= allArr.length)
  8599. other = allArr.length;
  8600. for (let index = 0; index < other; index++) {
  8601. outArr.push(allArr[index]);
  8602. }
  8603. }
  8604. }
  8605. xGame.common.extraMoveNum = other;
  8606. this.extraScore = other;
  8607. this.addRandmomFireworks(outArr);
  8608. }
  8609. addRandmomFireworks(outArr) {
  8610. Laya.timer.once(1100, this, () => {
  8611. if (outArr.length > 0) {
  8612. xGame.common.d2World.openCheckStill = true;
  8613. this.playedLastSkill = true;
  8614. }
  8615. });
  8616. xGame.soundMgr.playSound("skill_04_02");
  8617. let temp;
  8618. let delay = -200;
  8619. for (let index = 0; index < outArr.length; index++) {
  8620. temp = outArr[index];
  8621. delay += 200;
  8622. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  8623. let angle = xGame.common.randomNum(0, 360);
  8624. angle = this.getFireworksAngle(obj);
  8625. let linearPercent = xGame.common.randomNum(45, 80);
  8626. if (!obj.destroyed)
  8627. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  8628. });
  8629. }
  8630. }
  8631. getFireworksAngle(obj) {
  8632. let rootBall = xGame.common.d2World.rootBall;
  8633. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  8634. }
  8635. resetGame() {
  8636. Laya.timer.clearAll(this);
  8637. if (this.tweenArr) {
  8638. for (let index = 0; index < this.tweenArr.length; index++) {
  8639. Laya.Tween.clearAll(this.tweenArr[index]);
  8640. }
  8641. }
  8642. this.tweenArr = null;
  8643. }
  8644. runGuanYu() {
  8645. xGame.common.d2World.d2Gan.ui.visible = false;
  8646. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8647. let rootBall = xGame.common.d2World.rootBall;
  8648. if (rootBall.isInHole) {
  8649. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  8650. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  8651. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  8652. rootBall.showSelf();
  8653. }
  8654. this.rtStarX = rootBall.gameObj.x;
  8655. this.rtStarY = rootBall.gameObj.y;
  8656. this.knifeTimes = 0;
  8657. this.playedLastSkill = true;
  8658. rootBall.forceRun = true;
  8659. rootBall.rigy.type = "static";
  8660. xGame.common.d2World.openCheckStill = true;
  8661. this.guanyuRandomKnife();
  8662. }
  8663. guanyuRandomKnife() {
  8664. let rootBall = xGame.common.d2World.rootBall;
  8665. let dir = this.getRandDir();
  8666. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  8667. console.log("当前angle", angle);
  8668. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  8669. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  8670. let dis = 324;
  8671. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  8672. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  8673. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  8674. this.rtStarX = rootBall.gameObj.x;
  8675. this.rtStarY = rootBall.gameObj.y;
  8676. this.knifeTimes++;
  8677. let skillLevel;
  8678. if (xGame.common.gameMgr.selfTurn) {
  8679. skillLevel = DataMgr.getBigSkillByIndex(4);
  8680. }
  8681. else {
  8682. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  8683. }
  8684. if (!skillLevel)
  8685. skillLevel = 1;
  8686. skillLevel += 2;
  8687. if (this.knifeTimes < skillLevel) {
  8688. Laya.timer.once(400, this, () => {
  8689. this.guanyuRandomKnife();
  8690. });
  8691. }
  8692. else {
  8693. rootBall.forceRun = false;
  8694. rootBall.rigy.type = "dynamic";
  8695. xGame.common.extraMoveNum = skillLevel;
  8696. }
  8697. }));
  8698. }
  8699. getRandDir() {
  8700. let rootBall = xGame.common.d2World.rootBall;
  8701. let allBall = this.getAllBallArr();
  8702. let target = xGame.common.getRandArrEle(allBall);
  8703. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  8704. return this.knifeV2;
  8705. }
  8706. cloneKnife(x, y, rotation) {
  8707. let parent = xGame.common.d3World.knifeRoot;
  8708. let prefab = xGame.common.d3World.knife;
  8709. let clone = prefab.clone();
  8710. parent.addChild(clone);
  8711. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  8712. clone.transform.localPositionX = this.knifeV3.x;
  8713. clone.transform.localPositionY = 0;
  8714. clone.transform.localPositionZ = this.knifeV3.z;
  8715. clone.transform.localRotationEulerX = 0;
  8716. clone.transform.localRotationEulerY = rotation;
  8717. clone.transform.localRotationEulerZ = 0;
  8718. clone.active = true;
  8719. return clone;
  8720. }
  8721. cloneGuanYuEft(x, y, angle) {
  8722. return;
  8723. let parent = xGame.common.gameUI.ui.guanyuNode;
  8724. let eft = new ui_guanyuAni();
  8725. eft.parent = parent;
  8726. eft.x = x;
  8727. eft.y = y;
  8728. eft.rotation = angle;
  8729. }
  8730. }
  8731. class ui_UIWordsList extends fgui.GComponent {
  8732. static createInstance() {
  8733. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  8734. }
  8735. onConstruct() {
  8736. this.c1 = this.getController("c1");
  8737. this.n74 = (this.getChild("n74"));
  8738. this.clickNode = (this.getChild("clickNode"));
  8739. this.myNode = (this.getChild("myNode"));
  8740. this.n68 = (this.getChild("n68"));
  8741. this.n66 = (this.getChild("n66"));
  8742. this.n55 = (this.getChild("n55"));
  8743. this.wordsBtn = (this.getChild("wordsBtn"));
  8744. this.emotionBtn = (this.getChild("emotionBtn"));
  8745. this.mybggg = (this.getChild("mybggg"));
  8746. this.wordsList = (this.getChild("wordsList"));
  8747. this.emotionList = (this.getChild("emotionList"));
  8748. this.myRoot = (this.getChild("myRoot"));
  8749. }
  8750. }
  8751. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  8752. class EmotionDisplay {
  8753. constructor(index, ui) {
  8754. this.ui = ui;
  8755. this.index = index;
  8756. this.ui.onClick(this, this.clickSelf);
  8757. this.updateSelf();
  8758. }
  8759. updateSelf() {
  8760. let data = cfgTable.emotionData[this.index + 1];
  8761. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  8762. }
  8763. clickSelf() {
  8764. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  8765. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  8766. xGame.common.talkMgr.closeTalkView();
  8767. }
  8768. }
  8769. class WordsDisplay {
  8770. constructor(index, ui) {
  8771. this.ui = ui;
  8772. this.index = index;
  8773. this.ui.onClick(this, this.clickSelf);
  8774. this.updateSelf();
  8775. }
  8776. updateSelf() {
  8777. let data = cfgTable.talkwordsData[this.index + 1];
  8778. this.ui.txt.text = data.msg;
  8779. }
  8780. clickSelf() {
  8781. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  8782. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  8783. xGame.common.talkMgr.closeTalkView();
  8784. }
  8785. }
  8786. class UIWordsList extends UIBase {
  8787. constructor() {
  8788. super();
  8789. }
  8790. onConstructor() {
  8791. this.ui = ui_UIWordsList.createInstance();
  8792. this.contentPane = this.ui;
  8793. this.isEject = false;
  8794. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  8795. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  8796. this.addUIClick(this.ui.clickNode, this.hide);
  8797. this.initTalkList();
  8798. this.initEmotionList();
  8799. }
  8800. show() {
  8801. super.show();
  8802. }
  8803. initTalkList() {
  8804. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  8805. let data = cfgTable.talkwordsData;
  8806. let length = Object.keys(data).length;
  8807. this.ui.wordsList.numItems = length;
  8808. }
  8809. initEmotionList() {
  8810. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  8811. let data = cfgTable.emotionData;
  8812. let length = Object.keys(data).length;
  8813. this.ui.emotionList.numItems = length;
  8814. }
  8815. renderTalkItem(index, obj) {
  8816. let temp = new WordsDisplay(index, obj);
  8817. }
  8818. renderEmotionItem(index, obj) {
  8819. let temp = new EmotionDisplay(index, obj);
  8820. }
  8821. openTalkList() {
  8822. this.ui.c1.selectedIndex = 0;
  8823. }
  8824. openEmotionList() {
  8825. this.ui.c1.selectedIndex = 1;
  8826. }
  8827. }
  8828. UIWordsList.uiName = "UIWordsList";
  8829. class TalkMgr {
  8830. constructor() {
  8831. this.aiSpeak = true;
  8832. this.emotionList = [];
  8833. this.talkList = [];
  8834. this.addEvent();
  8835. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8836. this.emotionList = [];
  8837. this.talkList = [];
  8838. for (let k in cfgTable.emotionData) {
  8839. this.emotionList.push(cfgTable.emotionData[k].id);
  8840. }
  8841. for (let k in cfgTable.talkwordsData) {
  8842. this.talkList.push(cfgTable.talkwordsData[k].id);
  8843. }
  8844. }
  8845. addEvent() {
  8846. let ui = xGame.common.gameUI.ui;
  8847. ui.wordsBtn.visible = true;
  8848. ui.wordsBtn.onClick(this, this.openTalkView);
  8849. ui.aiWordsBtn.visible = true;
  8850. ui.aiWordsBtn.onClick(this, this.clickAIState);
  8851. }
  8852. openTalkView() {
  8853. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  8854. xGame.uiMgr.Show(UIWordsList);
  8855. }
  8856. closeTalkView() {
  8857. xGame.uiMgr.Hide(UIWordsList);
  8858. }
  8859. clickAIState() {
  8860. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  8861. this.aiSpeak = !this.aiSpeak;
  8862. this.changeAIState(this.aiSpeak);
  8863. }
  8864. changeAIState(speak) {
  8865. this.aiSpeak = speak;
  8866. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  8867. if (speak) {
  8868. btn.c1.selectedIndex = 0;
  8869. }
  8870. else {
  8871. btn.c1.selectedIndex = 1;
  8872. }
  8873. }
  8874. showSelfTalk(wordsId) {
  8875. let ui = xGame.common.gameUI.ui;
  8876. ui.selfTalk.visible = true;
  8877. ui.selfTalk.myNode.c1.selectedIndex = 1;
  8878. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  8879. ui.selfTalk.t0.play();
  8880. }
  8881. showSelfEmotion(emotionId) {
  8882. let ui = xGame.common.gameUI.ui;
  8883. ui.selfTalk.visible = true;
  8884. ui.selfTalk.myNode.c1.selectedIndex = 0;
  8885. this.selfSpine && this.selfSpine.dispose();
  8886. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  8887. let spineData = cfgTable.emotionData[emotionId].spine;
  8888. this.selfSpine = new SpineMgr(spineData, () => {
  8889. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  8890. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  8891. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  8892. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  8893. });
  8894. ui.selfTalk.t0.play();
  8895. }
  8896. showAITalk(wordsId) {
  8897. if (!this.aiSpeak)
  8898. return;
  8899. if (DataMgr.gameData.gameCount < 2)
  8900. return;
  8901. if (wordsId < 1)
  8902. wordsId = this.getRandTalk();
  8903. let ui = xGame.common.gameUI.ui;
  8904. ui.aiTalk.visible = true;
  8905. ui.aiTalk.myNode.c1.selectedIndex = 1;
  8906. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  8907. ui.aiTalk.t0.play();
  8908. }
  8909. getRandTalk() {
  8910. let rand = xGame.tools.random(0, this.talkList.length);
  8911. return this.emotionList[rand];
  8912. }
  8913. getRandEmotion() {
  8914. let rand = xGame.tools.random(0, this.emotionList.length);
  8915. return this.emotionList[rand];
  8916. }
  8917. showAIEmotion(emotionId) {
  8918. if (!this.aiSpeak)
  8919. return;
  8920. if (DataMgr.gameData.gameCount < 2)
  8921. return;
  8922. if (emotionId < 1)
  8923. emotionId = this.getRandEmotion();
  8924. let ui = xGame.common.gameUI.ui;
  8925. ui.aiTalk.visible = true;
  8926. ui.aiTalk.myNode.c1.selectedIndex = 0;
  8927. this.aiSpine && this.aiSpine.dispose();
  8928. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  8929. let spineData = cfgTable.emotionData[emotionId].spine;
  8930. this.aiSpine = new SpineMgr(spineData, () => {
  8931. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  8932. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  8933. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  8934. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  8935. });
  8936. ui.aiTalk.t0.play();
  8937. }
  8938. resetGame() {
  8939. let ui = xGame.common.gameUI.ui;
  8940. ui.aiTalk.visible = false;
  8941. ui.selfTalk.visible = false;
  8942. this.aiSpine && this.aiSpine.dispose();
  8943. this.selfSpine && this.selfSpine.dispose();
  8944. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  8945. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  8946. this.closeTalkView();
  8947. }
  8948. }
  8949. class WordsMgr {
  8950. constructor() {
  8951. this.comboTimes = 1;
  8952. this.skillTimes = 0;
  8953. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  8954. this.comboSpine = new SpineMgr("yxz_liangan");
  8955. this.skillSpine = new SpineMgr("yiganxqiu");
  8956. this.scoreSpine = new SpineMgr("defen");
  8957. }
  8958. setClassicCombo(isInterrupt) {
  8959. if (isInterrupt) {
  8960. this.comboTimes = 0;
  8961. }
  8962. }
  8963. playClassicWords(type, callback) {
  8964. this.callback = callback;
  8965. let aniIndex = type;
  8966. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  8967. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  8968. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  8969. mySpine.destroy(true);
  8970. this.playClassicTimes();
  8971. });
  8972. }
  8973. playClassicTimes() {
  8974. this.comboTimes++;
  8975. if (this.comboTimes <= 1) {
  8976. this.callback && this.callback();
  8977. }
  8978. else {
  8979. let aniIndex = this.comboTimes - 1;
  8980. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  8981. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  8982. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  8983. mySpine.destroy(true);
  8984. this.callback && this.callback();
  8985. });
  8986. }
  8987. }
  8988. playBigSkillTimes(times, callback) {
  8989. if (times <= 0) {
  8990. callback && callback();
  8991. return;
  8992. }
  8993. this.callback = callback;
  8994. let pre = "sz_0";
  8995. let aniIndex = 0;
  8996. this.getWordsImg(times, pre, () => {
  8997. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  8998. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  8999. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  9000. let r1 = ``;
  9001. let r2 = ``;
  9002. if (times <= 9) {
  9003. r1 = `res/d2Res/${pre}${times}.png`;
  9004. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9005. aniIndex = 0;
  9006. }
  9007. else {
  9008. r1 = `res/d2Res/${pre}${times % 10}.png`;
  9009. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  9010. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  9011. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  9012. aniIndex = 1;
  9013. }
  9014. this.skillSpine.play(data, aniIndex, false, parent, () => {
  9015. mySpine.destroy(true);
  9016. xGame.common.gameMgr.playSkillTips();
  9017. this.playScore(times);
  9018. xGame.common.playRandomMutiBallBigSkillSound();
  9019. }, mySpine);
  9020. });
  9021. }
  9022. playScore(score) {
  9023. let pre = "sz_";
  9024. let aniIndex = 0;
  9025. this.getWordsImg(score, pre, () => {
  9026. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9027. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  9028. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  9029. let r1 = ``;
  9030. let r2 = ``;
  9031. if (score <= 9) {
  9032. r1 = `res/d2Res/${pre}${score}.png`;
  9033. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9034. aniIndex = 0;
  9035. }
  9036. else {
  9037. r1 = `res/d2Res/${pre}${score % 10}.png`;
  9038. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  9039. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9040. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  9041. aniIndex = 1;
  9042. }
  9043. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  9044. mySpine.destroy(true);
  9045. this.callback && this.callback();
  9046. }, mySpine);
  9047. });
  9048. }
  9049. getWordsImg(number, pre = "", callback) {
  9050. let arr = [];
  9051. if (number <= 9) {
  9052. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  9053. }
  9054. else {
  9055. 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 });
  9056. }
  9057. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  9058. callback && callback();
  9059. }));
  9060. }
  9061. }
  9062. class ui_UIRodMethod extends fgui.GComponent {
  9063. static createInstance() {
  9064. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  9065. }
  9066. onConstruct() {
  9067. this.n24 = (this.getChild("n24"));
  9068. this.white = (this.getChild("white"));
  9069. this.dot = (this.getChild("dot"));
  9070. this.sureBtn = (this.getChild("sureBtn"));
  9071. this.n20 = (this.getChild("n20"));
  9072. this.n21 = (this.getChild("n21"));
  9073. this.n22 = (this.getChild("n22"));
  9074. this.n23 = (this.getChild("n23"));
  9075. this.n5 = (this.getChild("n5"));
  9076. this.n14 = (this.getChild("n14"));
  9077. this.t0 = this.getTransition("t0");
  9078. }
  9079. }
  9080. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  9081. class UIRodMethod extends UIBase {
  9082. constructor() {
  9083. super();
  9084. this.isPressd = false;
  9085. }
  9086. onConstructor() {
  9087. this.ui = ui_UIRodMethod.createInstance();
  9088. this.contentPane = this.ui;
  9089. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  9090. this.moveDir = new Laya.Vector2();
  9091. this.moveDest = new Laya.Vector2();
  9092. this.centerPos = new Laya.Vector2();
  9093. xGame.common.uiRodMethod = this;
  9094. }
  9095. show() {
  9096. super.show();
  9097. xGame.common.gameMgr.gamePause = true;
  9098. this.openPressDotEvent();
  9099. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  9100. this.centerPos.x = this.ui.white.x;
  9101. this.centerPos.y = this.ui.white.y;
  9102. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  9103. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  9104. this.setDot();
  9105. }
  9106. setDot() {
  9107. this.ui.dot.x = this.moveDest.x;
  9108. this.ui.dot.y = this.moveDest.y;
  9109. }
  9110. closeSelf() {
  9111. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  9112. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  9113. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  9114. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  9115. xGame.common.gameMgr.gamePause = false;
  9116. this.hide();
  9117. }
  9118. openPressDotEvent() {
  9119. this.closePressDotEvent();
  9120. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9121. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  9122. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9123. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9124. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9125. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9126. }
  9127. closePressDotEvent() {
  9128. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9129. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  9130. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9131. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9132. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9133. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9134. }
  9135. onDown(e) {
  9136. if (e.type == Laya.Event.MOUSE_DOWN)
  9137. this.isPressd = true;
  9138. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  9139. this.isPressd = false;
  9140. if (!this.isPressd)
  9141. return;
  9142. this.moveDest.x = e.stageX;
  9143. this.moveDest.y = e.stageY;
  9144. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  9145. if (dis > 6724) {
  9146. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  9147. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  9148. }
  9149. this.setDot();
  9150. }
  9151. resetRod() {
  9152. this.ui.dot.x = this.ui.white.x;
  9153. this.ui.dot.y = this.ui.white.y;
  9154. this.gameRod.dot.x = this.gameRod.bg.x;
  9155. this.gameRod.dot.y = this.gameRod.bg.y;
  9156. xGame.common.rodOffest.x = 0;
  9157. xGame.common.rodOffest.y = 0;
  9158. }
  9159. }
  9160. UIRodMethod.uiName = "UIRodMethod";
  9161. class UIGame extends UIBase {
  9162. constructor() {
  9163. super();
  9164. this.powerNum = 0;
  9165. this.isD3Inited = false;
  9166. this.isPrePlay = false;
  9167. this.isMoveRod = false;
  9168. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  9169. this.rulerDis = 20;
  9170. this.rulerOffset = 0;
  9171. }
  9172. onConstructor() {
  9173. this.ui = ui_UIGame.createInstance();
  9174. this.contentPane = this.ui;
  9175. this.ui.x += xGame.common.sysOffestNum;
  9176. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  9177. this.isEject = false;
  9178. xGame.common.gameUI = this;
  9179. this.initSelf();
  9180. }
  9181. isTurnSelf() {
  9182. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  9183. return true;
  9184. }
  9185. }
  9186. initSelf() {
  9187. let topUI = this.ui.topNode;
  9188. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  9189. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  9190. this.barInfo = {};
  9191. this.barInfo.curY = 0;
  9192. this.barInfo.height = this.ui.powerNode.height;
  9193. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  9194. this.barInfo.powerStartY = this.ui.powerNode.y;
  9195. xGame.common.aiPlayer = new AIPlayer();
  9196. xGame.common.gameMgr = new GameMgr();
  9197. xGame.common.skillMgr = new SkillMgr();
  9198. xGame.common.wordsMgr = new WordsMgr();
  9199. xGame.common.talkMgr = new TalkMgr();
  9200. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  9201. console.log("加载经典模式表情文件chenggon !");
  9202. });
  9203. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  9204. console.log("挑战模式奖励模式spine加载成功!");
  9205. });
  9206. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  9207. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9208. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  9209. this.addUIClick(this.ui.returnBtn, this.returnHome);
  9210. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  9211. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  9212. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  9213. }
  9214. returnHome() {
  9215. let tips = "Are you sure to exit the game?";
  9216. let woman = "Boss, why don't you play for a while longer?";
  9217. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  9218. }
  9219. addRodMethodClick() {
  9220. if (this.isTurnSelf()) {
  9221. xGame.uiMgr.Show(UIRodMethod);
  9222. }
  9223. }
  9224. clickHelpLineBtn(force = false) {
  9225. if (!this.isTurnSelf())
  9226. return;
  9227. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  9228. if (success) {
  9229. xGame.common.longHelpLine = true;
  9230. xGame.common.d2World.getHelpLine();
  9231. Moyu.sendDataEvent("guideNum");
  9232. }
  9233. else {
  9234. }
  9235. });
  9236. }
  9237. renderSelfDisplayBalls(index, target) {
  9238. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  9239. target.myImg.url = xGame.common.getGameIconUrl(str);
  9240. }
  9241. renderAIDisplayBalls(index, target) {
  9242. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  9243. target.myImg.url = xGame.common.getGameIconUrl(str);
  9244. ;
  9245. }
  9246. updateMode() {
  9247. if (xGame.common.gameMode == GameMode.classic) {
  9248. this.ui.topNode.scoreNode.visible = false;
  9249. }
  9250. else if (xGame.common.gameMode == GameMode.bigMove) {
  9251. this.ui.topNode.scoreNode.visible = true;
  9252. }
  9253. }
  9254. show() {
  9255. super.show();
  9256. console.log("zh:uigame show");
  9257. this.ui.alpha = 0;
  9258. this.updateSelf();
  9259. console.log("zh:uigame bf gamemusic01 start");
  9260. xGame.soundMgr.playMusic("gamemusic01");
  9261. console.log("zh:uigame bf gamemusic01 end");
  9262. xGame.common.gameMgr.gamePause = false;
  9263. xGame.common.gameUI.ui.blackAni.visible = false;
  9264. xGame.common.gameUI.ui.whiteAni.visible = false;
  9265. this.ui.powerEft.visible = false;
  9266. this.ui.colorNode.visible = false;
  9267. this.updateHead();
  9268. }
  9269. updateSelf() {
  9270. if (xGame.common.gameMode == GameMode.classic) {
  9271. this.ui.c1.selectedIndex = 0;
  9272. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  9273. this.ui.topNode.middleNode.visible = true;
  9274. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  9275. }
  9276. else if (xGame.common.gameMode == GameMode.bigMove) {
  9277. this.ui.c1.selectedIndex = 0;
  9278. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  9279. this.ui.topNode.middleNode.visible = false;
  9280. let max = xGame.cfgMgr.getMaxBigMoveLength();
  9281. let rand = xGame.common.randomNum(1, max);
  9282. let guide = DataMgr.getSkillGuide();
  9283. if (guide == 0)
  9284. rand = 1;
  9285. xGame.common.bigMoveLevelIndex = rand;
  9286. }
  9287. else if (xGame.common.gameMode == GameMode.placeBall) {
  9288. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  9289. this.ui.c1.selectedIndex = 1 + data.type;
  9290. this.ui.alpha = 1;
  9291. this.startGame();
  9292. }
  9293. this.updateMode();
  9294. this.initD3world();
  9295. this.initD2world();
  9296. }
  9297. startGame() {
  9298. this.ui.snowNode.visible = Math.random() <= 0.1;
  9299. this.ui.d2Node.visible = false;
  9300. xGame.common.d3World.d3Hand.gameObj.active = false;
  9301. xGame.common.d3World.tableSrc.init();
  9302. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  9303. this.cameraViewChange(() => {
  9304. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  9305. switch (xGame.common.gameMode) {
  9306. case GameMode.classic:
  9307. xGame.common.d3World.d3Hand.gameObj.active = true;
  9308. this.playPutBallD3Ani();
  9309. break;
  9310. case GameMode.bigMove:
  9311. this.enterGame();
  9312. Laya.timer.once(500, this, () => {
  9313. this.ui.topNode.middleNode.visible = true;
  9314. this.ui.topNode.middleNode.t0.play();
  9315. });
  9316. break;
  9317. case GameMode.placeBall:
  9318. this.enterGame();
  9319. break;
  9320. default:
  9321. break;
  9322. }
  9323. });
  9324. PlatMgr.showBanner(false);
  9325. }
  9326. enterGame() {
  9327. this.ui.d2Node.visible = true;
  9328. xGame.common.d3World.d3Hand.gameObj.active = false;
  9329. xGame.common.showOneCamera("mainCamera");
  9330. Moyu.recordGame(30, true);
  9331. if (!this.isPrePlay) {
  9332. this.isPrePlay = true;
  9333. xGame.common.d3World.prePlayEft();
  9334. }
  9335. xGame.common.gameMgr.gameReady();
  9336. this.openAllEvent();
  9337. this.ui.snowNode.visible = false;
  9338. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  9339. this.ui.helpBtn.visible = condition;
  9340. }
  9341. showHelpLineGuide() {
  9342. let longGuide = DataMgr.getGuideHelpLine();
  9343. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  9344. this.ui.helpBtn.visible = true;
  9345. this.ui.guideNode.visible = true;
  9346. }
  9347. }
  9348. setTurnAlpha(alpha) {
  9349. this.ui.keduNode.alpha = alpha;
  9350. this.ui.ganNode.alpha = alpha;
  9351. this.ui.rodMethodNode.alpha = alpha;
  9352. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  9353. }
  9354. cameraViewChange(callback) {
  9355. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  9356. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  9357. xGame.common.showOneCamera("visitAngle");
  9358. cameraSrc.localRotationEulerY = 180;
  9359. cameraSrc.localRotationEulerZ = 0;
  9360. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  9361. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  9362. callback && callback();
  9363. }));
  9364. }));
  9365. }
  9366. playPutBallD3Ani() {
  9367. xGame.common.showOneCamera("mainCamera");
  9368. let handSrc = xGame.common.d3World.d3Hand;
  9369. handSrc.gameObj.active = true;
  9370. handSrc.transform.localPositionZ = 3;
  9371. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9372. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  9373. handSrc.gameObj.active = false;
  9374. this.enterGame();
  9375. }), 400);
  9376. }));
  9377. }
  9378. updateHead() {
  9379. let user = Moyu.getUserInfo();
  9380. this.ui.topNode.selfNameTxt.text = user.nickName;
  9381. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  9382. let aiData = xGame.cfgMgr.getRandomUserInfo();
  9383. if (DataMgr.getSkillGuide() < 1) {
  9384. this.ui.topNode.aiNameTxt.text = 'billiards';
  9385. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  9386. }
  9387. else {
  9388. this.ui.topNode.aiNameTxt.text = aiData.name;
  9389. let randNo = Math.floor(Math.random() * 10) + 1;
  9390. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  9391. }
  9392. }
  9393. initD2world() {
  9394. let node = this.ui.d2Root.displayObject;
  9395. let src = node.getComponent(D2World);
  9396. if (!src) {
  9397. xGame.common.d2World = node.addComponent(D2World);
  9398. }
  9399. xGame.common.d2World.initSelf();
  9400. }
  9401. initD3world() {
  9402. if (this.isD3Inited)
  9403. return;
  9404. this.isD3Inited = true;
  9405. let scene3D = xGame.common.d3Scene;
  9406. this.ui.d3Root.displayObject.addChild(scene3D);
  9407. scene3D.active = true;
  9408. xGame.common.d3World.tableSrc.setBorderPos();
  9409. }
  9410. onRootMove(e) {
  9411. let rootBall = xGame.common.d2World.rootBall;
  9412. this.ui.moveNode.x = e.x;
  9413. this.ui.moveNode.y = e.y;
  9414. rootBall.gameObj.x = e.x;
  9415. rootBall.gameObj.y = e.y;
  9416. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  9417. }
  9418. aiRootMove(move) {
  9419. if (move)
  9420. this.hideBallUI();
  9421. else {
  9422. this.showBallUI();
  9423. xGame.common.d2World.getHelpLine();
  9424. }
  9425. }
  9426. aiForce(type, force = 0) {
  9427. this.pressTarget = PressType.powerNode;
  9428. if (type == 1)
  9429. this.onEventUp({ force: true });
  9430. else if (type == 2)
  9431. this.onEventMove({ stageY: force, force: true });
  9432. }
  9433. onEventPress(e) {
  9434. if (e.stopPropagation)
  9435. e.stopPropagation();
  9436. if (!this.isTurnSelf())
  9437. return;
  9438. let target = e.target;
  9439. switch (target) {
  9440. case this.ui.myPowerNode.displayObject:
  9441. this.pressTarget = PressType.powerNode;
  9442. this.barInfo.curY = e.stageY;
  9443. this.updateBarInfo();
  9444. break;
  9445. case this.ui.moveNode.displayObject:
  9446. this.pressTarget = PressType.moveNode;
  9447. this.hideBallUI();
  9448. this.eventObj.curX = this.ui.moveNode.x;
  9449. this.eventObj.curY = this.ui.moveNode.y;
  9450. this.ui.moveNode.finger.visible = false;
  9451. this.eventObj.lastX = e.stageX;
  9452. this.eventObj.lastY = e.stageY;
  9453. break;
  9454. case this.ui.rulerClickNode.displayObject:
  9455. this.pressTarget = PressType.rulerNode;
  9456. this.eventObj.lastY = e.stageY;
  9457. break;
  9458. case this.ui.d2Root.displayObject:
  9459. this.pressTarget = PressType.d2Root;
  9460. this.eventObj.lastX = e.stageX;
  9461. this.eventObj.lastY = e.stageY;
  9462. this.eventObj.starX = e.stageX;
  9463. this.eventObj.starY = e.stageY;
  9464. this.eventObj.curX = 0;
  9465. this.eventObj.curY = 0;
  9466. xGame.common.d2World.d2Gan.setGanLastInfo();
  9467. this.rulerOffset = 0;
  9468. break;
  9469. default:
  9470. break;
  9471. }
  9472. }
  9473. onEventMove(e) {
  9474. if (e.stopPropagation)
  9475. e.stopPropagation();
  9476. if (e && e.force) {
  9477. }
  9478. else {
  9479. if (!this.isTurnSelf())
  9480. return;
  9481. }
  9482. switch (this.pressTarget) {
  9483. case PressType.powerNode:
  9484. this.barInfo.curY = e.stageY;
  9485. this.updateBarInfo();
  9486. this.isMoveRod = true;
  9487. break;
  9488. case PressType.moveNode:
  9489. let rootBall = xGame.common.d2World.rootBall;
  9490. let radius = rootBall.gameObj.width / 2;
  9491. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  9492. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  9493. let border = xGame.common.d2World.borderRect;
  9494. if (curX <= border.x + radius)
  9495. curX = border.x + radius;
  9496. else if (curX >= border.x + border.width - radius)
  9497. curX = border.x + border.width - radius;
  9498. if (curY <= border.y + radius)
  9499. curY = border.y + radius;
  9500. else if (curY >= border.y + border.height - radius)
  9501. curY = border.y + border.height - radius;
  9502. if (xGame.common.gameMgr.isOpenBall) {
  9503. if (curX >= border.x + border.openBallW - radius)
  9504. curX = border.x + border.openBallW - radius;
  9505. }
  9506. this.ui.moveNode.x = curX;
  9507. this.ui.moveNode.y = curY;
  9508. rootBall.gameObj.x = curX;
  9509. rootBall.gameObj.y = curY;
  9510. rootBall.d3BallSrc.setTransPos(curX, curY);
  9511. this.isMoveRod = true;
  9512. break;
  9513. case PressType.rulerNode:
  9514. let yy = e.stageY - this.eventObj.lastY;
  9515. this.eventObj.lastY = e.stageY;
  9516. let ruler1 = this.ui.rulerNode.img1;
  9517. let ruler2 = this.ui.rulerNode.img2;
  9518. ruler1.y += yy;
  9519. ruler2.y += yy;
  9520. this.rulerOffset += yy;
  9521. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  9522. this.rulerOffset = 0;
  9523. xGame.soundMgr.playSound("inch", 1, 10);
  9524. }
  9525. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  9526. let h = ruler1.height;
  9527. this.checkGuide();
  9528. this.isMoveRod = true;
  9529. if (ruler1.y >= h) {
  9530. ruler1.y = -h;
  9531. ruler2.y = 0;
  9532. return;
  9533. }
  9534. else if (ruler1.y <= -h) {
  9535. ruler1.y = h;
  9536. ruler2.y = 0;
  9537. return;
  9538. }
  9539. if (ruler2.y >= h) {
  9540. ruler2.y = -h;
  9541. ruler1.y = 0;
  9542. return;
  9543. }
  9544. else if (ruler2.y <= -h) {
  9545. ruler2.y = h;
  9546. ruler1.y = 0;
  9547. return;
  9548. }
  9549. break;
  9550. case PressType.d2Root:
  9551. this.eventObj.curX = e.stageX;
  9552. this.eventObj.curY = e.stageY;
  9553. let offset = this.checkRodMoveDir();
  9554. xGame.common.d2World.d2Gan.rotateSelf(offset);
  9555. this.eventObj.lastX = e.stageX;
  9556. this.eventObj.lastY = e.stageY;
  9557. break;
  9558. default:
  9559. break;
  9560. }
  9561. }
  9562. onEventUp(e) {
  9563. if (e.stopPropagation)
  9564. e.stopPropagation();
  9565. if (e && e.force) {
  9566. }
  9567. else {
  9568. if (!this.isTurnSelf())
  9569. return;
  9570. }
  9571. switch (this.pressTarget) {
  9572. case PressType.powerNode:
  9573. this.ui.powerNode.value = 0;
  9574. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  9575. this.ui.powerTxt.text = "";
  9576. if (this.powerNum > 0) {
  9577. xGame.eventMgr.event(BALL_SHOOT);
  9578. xGame.common.d2World.shoot(this.powerNum);
  9579. xGame.common.d2World.d2Gan.shoot();
  9580. xGame.common.d2World.d2HelpLine.shoot();
  9581. this.finishGuide();
  9582. this.ui.powerEft.visible = false;
  9583. this.ui.colorNode.visible = false;
  9584. let ganStr = "";
  9585. if (this.powerNum <= 30) {
  9586. ganStr = "gan_30";
  9587. }
  9588. else if (this.powerNum <= 60) {
  9589. ganStr = "gan_50";
  9590. }
  9591. else {
  9592. ganStr = "gan_80";
  9593. }
  9594. xGame.soundMgr.playSound(ganStr);
  9595. }
  9596. break;
  9597. case PressType.moveNode:
  9598. let rootBall = xGame.common.d2World.rootBall;
  9599. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  9600. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  9601. let isIntersect = this.judgeBallIntersect();
  9602. if (isIntersect) {
  9603. this.ui.moveNode.x = lastX;
  9604. this.ui.moveNode.y = lastY;
  9605. rootBall.gameObj.x = lastX;
  9606. rootBall.gameObj.y = lastY;
  9607. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  9608. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  9609. }
  9610. else {
  9611. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  9612. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  9613. }
  9614. this.showBallUI();
  9615. this.ui.moveNode.finger.visible = true;
  9616. xGame.common.d2World.getHelpLine();
  9617. break;
  9618. case PressType.rulerNode:
  9619. break;
  9620. case PressType.d2Root:
  9621. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  9622. if (dis <= 25) {
  9623. this.moveToClickDot(e);
  9624. }
  9625. break;
  9626. default:
  9627. break;
  9628. }
  9629. this.pressTarget = -1;
  9630. }
  9631. checkGuide() {
  9632. let guide = DataMgr.getSkillGuide();
  9633. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  9634. xGame.common.guideStep++;
  9635. xGame.common.gameUI.ui.guide2.visible = false;
  9636. xGame.common.gameUI.ui.guide3.visible = true;
  9637. }
  9638. }
  9639. finishGuide() {
  9640. let guide = DataMgr.getSkillGuide();
  9641. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  9642. xGame.common.guideStep = 10;
  9643. this.closeAllGuide();
  9644. }
  9645. }
  9646. closeAllGuide() {
  9647. xGame.common.gameUI.ui.guide1.visible = false;
  9648. xGame.common.gameUI.ui.guide2.visible = false;
  9649. xGame.common.gameUI.ui.guide3.visible = false;
  9650. }
  9651. updateBarInfo() {
  9652. let star = this.ui.powerNode.y;
  9653. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  9654. if (rate >= 1)
  9655. rate = 1;
  9656. if (rate <= 0)
  9657. rate = 0;
  9658. this.powerNum = Math.ceil(rate * 100);
  9659. this.ui.powerNode.value = this.powerNum;
  9660. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  9661. this.ui.colorNode.value = this.powerNum;
  9662. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  9663. this.ui.powerEft.visible = this.powerNum != 0;
  9664. this.ui.colorNode.visible = this.powerNum != 0;
  9665. this.ui.powerTxt.text = this.powerNum + "";
  9666. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  9667. }
  9668. forceCancel() {
  9669. this.ui.powerNode.value = 0;
  9670. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  9671. this.ui.powerTxt.text = "";
  9672. }
  9673. checkRodMoveDir() {
  9674. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  9675. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  9676. if (tempX >= 0 && tempY <= 0) {
  9677. return this.checkDir();
  9678. }
  9679. else if (tempX < 0 && tempY < 0) {
  9680. return this.checkDir(1, -1);
  9681. }
  9682. else if (tempX < 0 && tempY > 0) {
  9683. return this.checkDir(-1, -1);
  9684. }
  9685. else {
  9686. return this.checkDir(-1, 1);
  9687. }
  9688. }
  9689. checkDir(flagX = 1, flagY = 1) {
  9690. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  9691. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  9692. if (offsetY == 0) {
  9693. return offsetX * flagX;
  9694. }
  9695. if (offsetX == 0) {
  9696. return offsetY * flagY;
  9697. }
  9698. let angle = offsetY / offsetX;
  9699. if (Math.abs(angle) >= 1) {
  9700. return offsetY * flagY;
  9701. }
  9702. else {
  9703. return offsetX * flagX;
  9704. }
  9705. }
  9706. judgeBallIntersect() {
  9707. let rootBall = xGame.common.d2World.rootBall;
  9708. let ballArr = xGame.common.d2World.ballArr;
  9709. let radius = rootBall.gameObj.width / 2;
  9710. let temp;
  9711. let isIntersect = false;
  9712. for (let index = 0; index < ballArr.length; index++) {
  9713. temp = ballArr[index];
  9714. if (temp.number == rootBall.number)
  9715. continue;
  9716. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  9717. if (isIntersect) {
  9718. break;
  9719. }
  9720. }
  9721. return isIntersect;
  9722. }
  9723. hideBallUI() {
  9724. let d2Gan = xGame.common.d2World.d2Gan;
  9725. if (!d2Gan.ui.isDisposed)
  9726. d2Gan.ui.visible = false;
  9727. let d2Help = xGame.common.d2World.d2HelpLine;
  9728. if (!d2Help.ui.isDisposed)
  9729. d2Help.ui.visible = false;
  9730. let rootBall = xGame.common.d2World.rootBall;
  9731. if (!rootBall.destroyed) {
  9732. rootBall.gameObj.active = false;
  9733. }
  9734. }
  9735. showBallUI() {
  9736. let d2Gan = xGame.common.d2World.d2Gan;
  9737. if (!d2Gan.ui.isDisposed)
  9738. d2Gan.ui.visible = true;
  9739. let d2Help = xGame.common.d2World.d2HelpLine;
  9740. if (!d2Help.ui.isDisposed)
  9741. d2Help.ui.visible = true;
  9742. let rootBall = xGame.common.d2World.rootBall;
  9743. if (!rootBall.destroyed) {
  9744. rootBall.gameObj.active = true;
  9745. }
  9746. }
  9747. moveToClickDot(e) {
  9748. if (!this.isMoveRod && !xGame.common.clickedBall) {
  9749. let root = xGame.common.d2World.rootBall.gameObj;
  9750. let xx = e.stageX - xGame.common.sysOffestNum;
  9751. let yy = e.stageY;
  9752. let x = xx - root.x;
  9753. let y = yy - root.y;
  9754. let angle = xGame.common.getfguiRotation(x, y);
  9755. xGame.common.d2World.d2Gan.ui.rotation = angle;
  9756. xGame.common.d2World.getHelpLine();
  9757. }
  9758. this.isMoveRod = false;
  9759. xGame.common.clickedBall = false;
  9760. }
  9761. openAllEvent() {
  9762. this.closeAllEvent();
  9763. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9764. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9765. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9766. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9767. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  9768. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  9769. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  9770. }
  9771. closeAllEvent() {
  9772. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9773. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9774. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9775. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9776. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  9777. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  9778. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  9779. }
  9780. resetGame() {
  9781. this.closeAllEvent();
  9782. this.hideBallUI();
  9783. xGame.common.gameMgr.gamePause = true;
  9784. }
  9785. }
  9786. UIGame.uiName = "UIGame";
  9787. class UIAddProp extends UIBase {
  9788. constructor() {
  9789. super();
  9790. this.curType = "";
  9791. }
  9792. onConstructor() {
  9793. this.ui = ui_UIAddProp.createInstance();
  9794. this.contentPane = this.ui;
  9795. this.isEject = false;
  9796. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  9797. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  9798. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  9799. this.updateUI();
  9800. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  9801. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  9802. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  9803. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  9804. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  9805. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  9806. }
  9807. show(type) {
  9808. super.show();
  9809. this.curType = type == 0 ? "coin" : "diamond";
  9810. this.switchBtn("");
  9811. this.ui.t0.play();
  9812. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  9813. PlatMgr.showInsert(true);
  9814. }
  9815. closeSelf() {
  9816. this.hide();
  9817. }
  9818. updateUI() {
  9819. let data = cfgTable.moneyData;
  9820. let temp;
  9821. let obj;
  9822. for (const key in data) {
  9823. temp = data[key];
  9824. obj = this.ui.myNode["node" + key];
  9825. if (parseInt(key) <= 2) {
  9826. obj.diamondTxt.text = "+" + temp.num;
  9827. }
  9828. else {
  9829. obj.coinTxt.text = temp.num;
  9830. obj.diamondTxt.text = temp.get.split('_')[1];
  9831. }
  9832. }
  9833. this.updateDiamondShare();
  9834. }
  9835. updateDiamondShare() {
  9836. let data = DataMgr.getShareDiamondTimes();
  9837. if (data >= xGame.common.maxShareDiamondTimes) {
  9838. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  9839. this.ui.myNode.node1.touchable = false;
  9840. }
  9841. else {
  9842. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  9843. this.ui.myNode.node1.touchable = true;
  9844. }
  9845. }
  9846. switchBtn(type) {
  9847. if (type == "")
  9848. type = this.curType;
  9849. else {
  9850. if (this.curType == type) {
  9851. return;
  9852. }
  9853. else {
  9854. this.curType = type;
  9855. }
  9856. }
  9857. if (type == "coin") {
  9858. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  9859. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  9860. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  9861. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  9862. this.ui.myNode.c1.selectedIndex = 0;
  9863. }
  9864. else {
  9865. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  9866. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  9867. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  9868. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  9869. this.ui.myNode.c1.selectedIndex = 1;
  9870. }
  9871. }
  9872. convertCoin(index) {
  9873. let data = cfgTable.moneyData[index];
  9874. let coinNum = data.num;
  9875. let str = data.get.split('_')[1];
  9876. let needDiamond = parseInt(str);
  9877. if (DataMgr.diamondEnough(needDiamond)) {
  9878. DataMgr.setDiamond(-needDiamond);
  9879. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  9880. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  9881. }
  9882. else {
  9883. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  9884. this.switchBtn("diamond");
  9885. }
  9886. }
  9887. videoGetDiamond() {
  9888. let num = cfgTable.moneyData[2].num;
  9889. Moyu.showVideoAd(() => {
  9890. xGame.common.playObjFlyAnim(num, Prop.diamond);
  9891. this.closeSelf();
  9892. }, EAdType.addDiamond);
  9893. }
  9894. videoGetCoin() {
  9895. Moyu.showVideoAd(() => {
  9896. xGame.common.playObjFlyAnim(2000, Prop.coin);
  9897. this.closeSelf();
  9898. }, EAdType.addCoin);
  9899. }
  9900. shareGetDiamond() {
  9901. let times = DataMgr.getShareDiamondTimes();
  9902. if (times >= xGame.common.maxShareDiamondTimes) {
  9903. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  9904. }
  9905. else {
  9906. if (Moyu.isTT) {
  9907. let num = cfgTable.moneyData[1].num;
  9908. Moyu.shareVideo = '';
  9909. Moyu.shareGame((success) => {
  9910. if (success) {
  9911. xGame.uiMgr.Show(UIMsg, "分享成功!");
  9912. xGame.common.playObjFlyAnim(num, Prop.diamond);
  9913. DataMgr.setShareDiamondTimes(1);
  9914. this.updateDiamondShare();
  9915. }
  9916. else {
  9917. xGame.uiMgr.Show(UIMsg, "分享失败!");
  9918. }
  9919. });
  9920. }
  9921. else {
  9922. Moyu.showVideoAd(() => {
  9923. let diamond = xGame.common.randomNum(50, 100);
  9924. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  9925. DataMgr.setShareDiamondTimes(1);
  9926. this.updateDiamondShare();
  9927. }, EAdType.randomDiamond);
  9928. }
  9929. }
  9930. }
  9931. openPutBallView() {
  9932. let end = xGame.uiMgr.getUI(UIGameEnd);
  9933. let skill = xGame.uiMgr.getUI(UISkill);
  9934. let level = xGame.uiMgr.getUI(UILevelDisplay);
  9935. let uigame = xGame.uiMgr.getUI(UIGame);
  9936. if (end && !end.isHide) {
  9937. xGame.uiMgr.Hide(UIGameEnd);
  9938. xGame.uiMgr.Show(UIMain);
  9939. }
  9940. if (skill && !skill.isHide)
  9941. xGame.uiMgr.Hide(UISkill);
  9942. if (uigame && !uigame.isHide)
  9943. xGame.uiMgr.Hide(UIGame);
  9944. if (level && !level.isHide) {
  9945. }
  9946. else {
  9947. xGame.uiMgr.Show(UILevelDisplay);
  9948. }
  9949. this.closeSelf();
  9950. }
  9951. }
  9952. UIAddProp.uiName = "UIAddProp";
  9953. class MoneyNode {
  9954. constructor(ui) {
  9955. this.leftTime = 0;
  9956. this.ui = ui;
  9957. this.ui.addCoinBtn.onClick(this, this.addCoin);
  9958. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  9959. this.ui.addPowerBtn.onClick(this, this.addPower);
  9960. this.ui.c1.selectedIndex = 1;
  9961. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  9962. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  9963. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  9964. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  9965. this.coinChange();
  9966. this.diamondChange();
  9967. this.powerChange();
  9968. }
  9969. addPower() {
  9970. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9971. xGame.uiMgr.Show(UIPower);
  9972. }
  9973. powerChange() {
  9974. let powerNum = DataMgr.getPower();
  9975. this.ui.powerTxt.text = powerNum + "";
  9976. }
  9977. checkPowerTime() {
  9978. let cur = new Date().getTime();
  9979. let last = DataMgr.getPowerTime();
  9980. if (last == 0) {
  9981. last = cur;
  9982. DataMgr.setPowerTime(cur);
  9983. }
  9984. let power = DataMgr.getPower();
  9985. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  9986. Laya.timer.clearAll(this);
  9987. if (power >= xGame.common.natureMaxPower) {
  9988. this.ui.powerTimeTxt.text = "";
  9989. DataMgr.setPowerTime(cur);
  9990. return;
  9991. }
  9992. if (power + offset >= xGame.common.natureMaxPower) {
  9993. DataMgr.setPower(xGame.common.natureMaxPower, false);
  9994. this.ui.powerTimeTxt.text = "";
  9995. DataMgr.setPowerTime(cur);
  9996. }
  9997. else {
  9998. if (offset > 0) {
  9999. DataMgr.setPower(offset);
  10000. DataMgr.setPowerTime(cur);
  10001. }
  10002. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  10003. this.leftTime = xGame.common.powerRecoverNum - time;
  10004. if (this.leftTime <= 0)
  10005. this.leftTime = 0;
  10006. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10007. Laya.timer.loop(1000, this, this.updatePowerTime);
  10008. }
  10009. }
  10010. updatePowerTime() {
  10011. this.leftTime -= 1;
  10012. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10013. if (this.leftTime <= 0) {
  10014. this.checkPowerTime();
  10015. }
  10016. }
  10017. coinChange() {
  10018. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  10019. }
  10020. diamondChange() {
  10021. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  10022. }
  10023. addCoin() {
  10024. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10025. Moyu.sendDataEvent("AddCoinBtn");
  10026. xGame.uiMgr.Show(UIAddProp, 0);
  10027. }
  10028. addDiamond() {
  10029. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10030. Moyu.sendDataEvent("AddDiamondBtn");
  10031. xGame.uiMgr.Show(UIAddProp, 1);
  10032. }
  10033. }
  10034. class UIDraw extends UIBase {
  10035. constructor() {
  10036. super();
  10037. this.curKey = 0;
  10038. }
  10039. onConstructor() {
  10040. this.ui = ui_UIDraw.createInstance();
  10041. this.contentPane = this.ui;
  10042. this.isEject = false;
  10043. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  10044. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  10045. this.addUIClick(this.ui.drawBtn, this.startDraw);
  10046. this.initDraw();
  10047. this.initUI();
  10048. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  10049. if (Moyu.isKs)
  10050. this.ui.closeNode.closeBtn.x += 100;
  10051. }
  10052. show() {
  10053. super.show();
  10054. this.ui.t0.play();
  10055. this.playSecretaryIdle();
  10056. this.updateDraw();
  10057. this.checkFree();
  10058. if (PlatMgr.bannerDelay > 0) {
  10059. this.ui.closeNode.closeBtn.visible = false;
  10060. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  10061. this.ui.closeNode.closeBtn.visible = true;
  10062. });
  10063. }
  10064. PlatMgr.showRateBanner();
  10065. }
  10066. hide() {
  10067. Laya.timer.clearAll(this);
  10068. super.hide();
  10069. }
  10070. checkFree() {
  10071. let isFree = DataMgr.getDailyfreeDrawTimes();
  10072. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  10073. }
  10074. initDraw() {
  10075. this.drawObj = [];
  10076. let data = cfgTable.drawData;
  10077. let temp;
  10078. let weight = 0;
  10079. for (const key in data) {
  10080. temp = data[key];
  10081. weight += temp.weight;
  10082. this.drawObj.push(weight);
  10083. }
  10084. this.allWeight = weight;
  10085. }
  10086. initUI() {
  10087. let data = cfgTable.drawData;
  10088. let temp;
  10089. let img;
  10090. let txt;
  10091. for (const key in data) {
  10092. temp = data[key];
  10093. img = this.ui.myNode.rotNode["img" + key];
  10094. txt = this.ui.myNode.rotNode["txt" + key];
  10095. img.url = xGame.common.getGameIconUrl(temp.icon);
  10096. txt.visible = true;
  10097. if (temp.award > 2) {
  10098. img.rotation = 0;
  10099. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  10100. }
  10101. else {
  10102. img.rotation = temp.rotation;
  10103. txt.text = temp.num;
  10104. }
  10105. }
  10106. }
  10107. getCurkey() {
  10108. let rand = Math.random() * this.allWeight;
  10109. let temp;
  10110. for (let index = 0; index < this.drawObj.length - 1; index++) {
  10111. temp = this.drawObj[index];
  10112. if (index == 0) {
  10113. if (rand < temp) {
  10114. return index + 1;
  10115. }
  10116. }
  10117. else {
  10118. if (rand >= temp && rand < this.drawObj[index + 1]) {
  10119. return index + 1;
  10120. }
  10121. }
  10122. }
  10123. return 2;
  10124. }
  10125. startDraw() {
  10126. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  10127. if (freeTimes > 0) {
  10128. this.beginDraw();
  10129. DataMgr.setDailyfreeDrawTimes(0);
  10130. this.checkFree();
  10131. }
  10132. else {
  10133. Moyu.sendDataEvent("turntable");
  10134. Moyu.showVideoAd(() => {
  10135. this.beginDraw();
  10136. }, EAdType.draw);
  10137. }
  10138. }
  10139. beginDraw() {
  10140. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  10141. this.ui.drawBtn.touchable = false;
  10142. this.curKey = this.getCurkey();
  10143. console.log("当前key", this.curKey);
  10144. let cell = 60;
  10145. let lap = 3;
  10146. let angle = cell * (this.curKey - 1) + lap * 360;
  10147. let target = this.ui.myNode.rotNode;
  10148. target.rotation = 0;
  10149. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  10150. console.log("旋转完成");
  10151. this.ui.drawBtn.touchable = true;
  10152. this.getAward();
  10153. }));
  10154. }
  10155. getAward() {
  10156. let data = cfgTable.drawData[this.curKey];
  10157. let temp = new AwardType();
  10158. temp.type = data.award;
  10159. temp.num = data.num;
  10160. xGame.common.getAward([temp], () => {
  10161. DataMgr.setDrawTimes(1);
  10162. this.updateDraw();
  10163. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  10164. });
  10165. }
  10166. updateDraw() {
  10167. let drawTimes = DataMgr.getDrawTimes();
  10168. let awardTimes = DataMgr.getDrawAwardTimes();
  10169. if (Math.floor(drawTimes / 3) > awardTimes) {
  10170. this.ui.extraNode.boxBtn.t0.play(null, -1);
  10171. this.ui.extraNode.boxBtn.touchable = true;
  10172. this.ui.extraNode.tipsTxt.text = "3/3";
  10173. this.ui.extraNode.barNode.width = 265;
  10174. this.getExtraAward();
  10175. }
  10176. else {
  10177. this.ui.extraNode.boxBtn.t0.stop();
  10178. this.ui.extraNode.boxBtn.touchable = false;
  10179. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  10180. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  10181. }
  10182. let data = cfgTable.drawData[1];
  10183. if (awardTimes == 0) {
  10184. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  10185. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  10186. this.ui.myNode.rotNode.img1.rotation = 0;
  10187. }
  10188. else {
  10189. let award = data.nextid;
  10190. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  10191. this.ui.myNode.rotNode.txt1.text = award[1];
  10192. this.ui.myNode.rotNode.img1.rotation = 0;
  10193. }
  10194. }
  10195. getExtraAward() {
  10196. let drawTimes = DataMgr.getDrawTimes();
  10197. let awardTimes = DataMgr.getDrawAwardTimes();
  10198. let data = cfgTable.drawData[1];
  10199. let award = new AwardType();
  10200. if (awardTimes == 0) {
  10201. award.num = data.num;
  10202. award.type = data.award;
  10203. xGame.common.getAward([award], () => {
  10204. let all = Math.floor(drawTimes / 3);
  10205. DataMgr.setDrawAwardTimes(all);
  10206. this.updateDraw();
  10207. });
  10208. }
  10209. else {
  10210. award.num = parseInt(data.nextid[1]);
  10211. award.type = parseInt(data.nextid[0]);
  10212. xGame.common.getAward([award], () => {
  10213. let all = Math.floor(drawTimes / 3);
  10214. DataMgr.setDrawAwardTimes(all);
  10215. this.updateDraw();
  10216. });
  10217. }
  10218. }
  10219. closeSelf() {
  10220. this.hide();
  10221. }
  10222. playSecretaryIdle() {
  10223. let parent = this.ui.secretary.displayObject;
  10224. parent.destroyChildren();
  10225. let xx = this.ui.secretary.width / 2;
  10226. let yy = this.ui.secretary.height;
  10227. let scale = xGame.common.getSecretaryScale();
  10228. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  10229. xGame.common.secretary.play(data, 1, true, parent);
  10230. }
  10231. }
  10232. UIDraw.uiName = "UIDraw";
  10233. class ui_UIFlyEft extends fgui.GComponent {
  10234. static createInstance() {
  10235. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  10236. }
  10237. onConstruct() {
  10238. this.n0 = (this.getChild("n0"));
  10239. this.n1 = (this.getChild("n1"));
  10240. this.n2 = (this.getChild("n2"));
  10241. this.n3 = (this.getChild("n3"));
  10242. this.n4 = (this.getChild("n4"));
  10243. this.n5 = (this.getChild("n5"));
  10244. this.n6 = (this.getChild("n6"));
  10245. this.n7 = (this.getChild("n7"));
  10246. this.iconNode = (this.getChild("iconNode"));
  10247. this.txt = (this.getChild("txt"));
  10248. this.txtNode = (this.getChild("txtNode"));
  10249. }
  10250. }
  10251. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  10252. class UIFlyEft extends UIBase {
  10253. constructor() {
  10254. super();
  10255. this.max = 8;
  10256. this.delay = 0;
  10257. }
  10258. onConstructor() {
  10259. this.ui = ui_UIFlyEft.createInstance();
  10260. this.contentPane = this.ui;
  10261. this.isEject = false;
  10262. this.isMuti = true;
  10263. this.ui.x += xGame.common.sysOffestNum;
  10264. }
  10265. getArrPos() {
  10266. if (this.iconPos && this.iconPos.length > 0)
  10267. return;
  10268. this.iconPos = [];
  10269. let temp;
  10270. for (let index = 0; index < this.max; index++) {
  10271. temp = this.ui["n" + index];
  10272. this.iconPos.push([temp.x, temp.y]);
  10273. }
  10274. }
  10275. show(stPos, edPos, num, type, callback) {
  10276. super.show();
  10277. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  10278. this.getArrPos();
  10279. this.updateUI(type);
  10280. this.updatePos();
  10281. this.runFly(edPos, callback);
  10282. this.runWorlds(stPos, num);
  10283. }
  10284. updateUI(type) {
  10285. let temp;
  10286. let str;
  10287. for (let index = 0; index < this.max; index++) {
  10288. temp = this.ui["n" + index];
  10289. str = this.getIconStr(type);
  10290. temp.url = xGame.common.getGameIconUrl(str);
  10291. }
  10292. }
  10293. getIconStr(type) {
  10294. switch (type) {
  10295. case Prop.diamond:
  10296. return "ty_zs";
  10297. case Prop.coin:
  10298. return "ty_jb";
  10299. default:
  10300. break;
  10301. }
  10302. }
  10303. updatePos() {
  10304. let temp;
  10305. for (let index = 0; index < this.max; index++) {
  10306. temp = this.ui["n" + index];
  10307. temp.x = this.iconPos[index][0];
  10308. temp.y = this.iconPos[index][1];
  10309. }
  10310. }
  10311. runFly(endPos, callback) {
  10312. let all = 0;
  10313. let temp;
  10314. for (let index = 0; index < this.max; index++) {
  10315. temp = this.ui["n" + index];
  10316. temp.visible = true;
  10317. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  10318. temp.visible = false;
  10319. all++;
  10320. if (all >= this.max) {
  10321. callback && callback();
  10322. }
  10323. }), 20 * index);
  10324. }
  10325. }
  10326. runWorlds(stPos, num) {
  10327. let str = "+" + num;
  10328. this.ui.txt.text = str;
  10329. let starX = stPos.x;
  10330. let starY = stPos.y + 50;
  10331. this.ui.txt.x = starX;
  10332. this.ui.txt.y = starY;
  10333. this.ui.txt.visible = true;
  10334. this.ui.txt.alpha = 1;
  10335. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  10336. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  10337. this.ui.txt.visible = false;
  10338. this.hide();
  10339. }));
  10340. }));
  10341. }
  10342. }
  10343. UIFlyEft.uiName = "UIFlyEft";
  10344. class ui_UIGetAward extends fgui.GComponent {
  10345. static createInstance() {
  10346. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  10347. }
  10348. onConstruct() {
  10349. this.n4 = (this.getChild("n4"));
  10350. this.n0 = (this.getChild("n0"));
  10351. this.myList = (this.getChild("myList"));
  10352. this.n1 = (this.getChild("n1"));
  10353. this.eftNode = (this.getChild("eftNode"));
  10354. this.btnNode = (this.getChild("btnNode"));
  10355. this.t0 = this.getTransition("t0");
  10356. }
  10357. }
  10358. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  10359. class UIGetAward extends UIBase {
  10360. constructor() {
  10361. super();
  10362. this.showTriple = true;
  10363. }
  10364. onConstructor() {
  10365. this.ui = ui_UIGetAward.createInstance();
  10366. this.contentPane = this.ui;
  10367. this.isEject = false;
  10368. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  10369. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  10370. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  10371. }
  10372. show(arr, showTriple, callback) {
  10373. super.show();
  10374. this.ui.t0.play();
  10375. this.ui.eftNode.visible = true;
  10376. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  10377. this.ui.eftNode.visible = false;
  10378. }), 1, 0, 0, 0.9);
  10379. this.awardArr = arr;
  10380. this.showTriple = showTriple;
  10381. this.callback = callback;
  10382. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  10383. this.ui.myList.numItems = arr.length;
  10384. xGame.soundMgr.playSound("getaward");
  10385. }
  10386. updateSelf(index, obj) {
  10387. let temp = this.awardArr[index];
  10388. let icon = this.getIcon(temp.type);
  10389. let str = icon;
  10390. if (temp.type > 2) {
  10391. str = "s" + icon;
  10392. }
  10393. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  10394. obj.myIcon.rotation = 0;
  10395. obj.numTxt.text = temp.num + "";
  10396. obj.numTxt.visible = temp.type > 2 ? false : true;
  10397. obj.nameTxt.text = this.getNameStr(temp.type);
  10398. }
  10399. renderItem(index, obj) {
  10400. this.updateSelf(index, obj);
  10401. }
  10402. tripleGetAward() {
  10403. Moyu.showVideoAd(() => {
  10404. this.getAward(3);
  10405. }, EAdType.triple);
  10406. }
  10407. normalGetAward() {
  10408. if (PlatMgr.isMisVideo())
  10409. this.tripleGetAward();
  10410. else
  10411. this.getAward();
  10412. }
  10413. getAward(times = 1) {
  10414. this.hide();
  10415. for (let index = 0; index < this.awardArr.length; index++) {
  10416. this.awardArr[index].num *= times;
  10417. }
  10418. this.callback && this.callback(times != 1);
  10419. }
  10420. getIcon(type) {
  10421. switch (type) {
  10422. case Prop.diamond:
  10423. return "ty_zs";
  10424. case Prop.coin:
  10425. return "ty_jb";
  10426. case Prop.gan1:
  10427. return "qg1";
  10428. case Prop.gan2:
  10429. return "qg2";
  10430. case Prop.gan3:
  10431. return "qg3";
  10432. case Prop.gan4:
  10433. return "qg4";
  10434. default:
  10435. break;
  10436. }
  10437. }
  10438. getNameStr(type) {
  10439. switch (type) {
  10440. case Prop.diamond:
  10441. return "Diamond";
  10442. case Prop.coin:
  10443. return "Coins";
  10444. case Prop.gan1:
  10445. case Prop.gan2:
  10446. case Prop.gan3:
  10447. case Prop.gan4:
  10448. return cfgTable.ballrodData[type - 1].name;
  10449. default:
  10450. break;
  10451. }
  10452. }
  10453. }
  10454. UIGetAward.uiName = "UIGetAward";
  10455. class Common {
  10456. constructor() {
  10457. this.convertNum = 0.025;
  10458. this.VectorUp = new Laya.Vector3(0, 1, 0);
  10459. this.scaleV3One = new Laya.Vector3();
  10460. this.scaleV3Two = new Laya.Vector3();
  10461. this.posV4 = new Laya.Vector4();
  10462. this.showDebug = false;
  10463. this.openGuide = true;
  10464. this.rodOffest = new Laya.Vector2(0, 0);
  10465. this.rodAngle = 0;
  10466. this.gameMode = GameMode.classic;
  10467. this.bigMoveLevelIndex = 1;
  10468. this.bigMoveNeedCoin = 1000;
  10469. this.classicNiceNeddCoin = 1000;
  10470. this.passAwardCoin = 2000;
  10471. this.classicRoomType = 1;
  10472. this.maxPower = 20;
  10473. this.natureMaxPower = 5;
  10474. this.videoPower = 2;
  10475. this.powerRecoverNum = 900;
  10476. this.curPlayerSkillType = 0;
  10477. this.isNewDay = false;
  10478. this.clickedBall = false;
  10479. this.placeBallCurLevel = 0;
  10480. this.placeBallStarNum = 0;
  10481. this.longHelpLine = false;
  10482. this.maxShareDiamondTimes = 3;
  10483. this.guideStep = 0;
  10484. this.temSelfLevel = 0;
  10485. this.extraMoveNum = 0;
  10486. this.curRankID = 0;
  10487. this.rankID = {
  10488. normalStar: 12000,
  10489. wxStar: 12001
  10490. };
  10491. this.skillNameList = ["Fall from the sky", "Unstoppable Force", "Freeze Shot", "Coming Soon"];
  10492. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4", "gf_jn4"];
  10493. this.btnClickStr = "buttonclick";
  10494. this.maxSkillLevel = 10;
  10495. this.upSkillLevel = false;
  10496. this.gameStartTime = 0;
  10497. this._sysOffestNum = 0;
  10498. this.angleV2 = new Laya.Vector2();
  10499. this.rootV = new Laya.Vector2(0, 1);
  10500. this.tempDir1 = new Laya.Vector2();
  10501. this.tempDir2 = new Laya.Vector2();
  10502. this.ballSize = 33;
  10503. this.stPos = new Laya.Point();
  10504. this.edPos = new Laya.Point();
  10505. Common._instance = this;
  10506. window["common"] = this;
  10507. }
  10508. static getInstance() {
  10509. if (!this._instance) {
  10510. this._instance = new Common();
  10511. }
  10512. return this._instance;
  10513. }
  10514. get sysOffestNum() {
  10515. if (this._sysOffestNum == 0) {
  10516. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  10517. }
  10518. return this._sysOffestNum;
  10519. }
  10520. testShader() {
  10521. let test = new LightShader();
  10522. test.texture = "res/d3Res/ballTexture/ball1.png";
  10523. Laya.stage.addChild(test);
  10524. }
  10525. playScale(node) {
  10526. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  10527. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  10528. }));
  10529. }));
  10530. }
  10531. setGroup(colli, ...group) {
  10532. let out = 0;
  10533. for (let index = 0; index < group.length; index++) {
  10534. if (index == 0) {
  10535. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10536. }
  10537. else {
  10538. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10539. }
  10540. }
  10541. colli.collisionGroup = out;
  10542. }
  10543. setCanGroupWith(colli, ...group) {
  10544. let out = 0;
  10545. for (let index = 0; index < group.length; index++) {
  10546. if (index == 0) {
  10547. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10548. }
  10549. else {
  10550. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10551. }
  10552. }
  10553. colli.canCollideWith = out;
  10554. }
  10555. loadPrefab(name, callback) {
  10556. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  10557. let prefab = new Laya.Prefab();
  10558. prefab.json = obj;
  10559. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  10560. callback && callback(img);
  10561. }));
  10562. }
  10563. pos2to3Convert(x, y, d3Pos) {
  10564. x = x + this.sysOffestNum;
  10565. d3Pos.setValue(x, y, 0);
  10566. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  10567. if (success) {
  10568. }
  10569. else {
  10570. console.error("转换出错了。。。。。。。。");
  10571. }
  10572. }
  10573. scale2to3Convert(num) {
  10574. this.scaleV3One.setValue(0, 0, 0);
  10575. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  10576. this.scaleV3Two.setValue(0, num, 0);
  10577. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  10578. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  10579. return outNum;
  10580. }
  10581. pos3to2Convert(d3Pos) {
  10582. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  10583. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  10584. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  10585. d3Pos.x -= this.sysOffestNum;
  10586. }
  10587. scale3to2Convert(num) {
  10588. let scale = this.scale2to3Convert(1);
  10589. let d2Out = num / scale;
  10590. return d2Out;
  10591. }
  10592. getCollider(type, restitution = 0.9, density = 10) {
  10593. let colli;
  10594. if (type == "box")
  10595. colli = new Laya.BoxCollider();
  10596. else
  10597. colli = new Laya.CircleCollider();
  10598. colli.friction = 0;
  10599. colli.restitution = restitution;
  10600. colli.density = density;
  10601. return colli;
  10602. }
  10603. getRigbody() {
  10604. let rigy = new Laya.RigidBody();
  10605. rigy.bullet = true;
  10606. rigy.allowRotation = false;
  10607. rigy.allowSleep = false;
  10608. rigy.gravityScale = 0;
  10609. return rigy;
  10610. }
  10611. getfguiRotation(x, y) {
  10612. this.angleV2.setValue(x, y);
  10613. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  10614. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  10615. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  10616. angle = -angle;
  10617. }
  10618. return 180 + angle;
  10619. }
  10620. getAngle(x, y) {
  10621. this.angleV2.setValue(x, y);
  10622. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  10623. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  10624. return angle;
  10625. }
  10626. randomNum(a, b) {
  10627. return a + Math.floor((b - a + 1) * Math.random());
  10628. }
  10629. getRandArrEle(arr) {
  10630. return arr[Math.floor(arr.length * Math.random())];
  10631. }
  10632. getSign(val) {
  10633. return val >= 0 ? 1 : -1;
  10634. }
  10635. botherArr(arr) {
  10636. let times = arr.length + 2;
  10637. let length = arr.length;
  10638. let a;
  10639. let b;
  10640. let temp;
  10641. for (let index = 0; index < times; index++) {
  10642. a = Math.floor(Math.random() * length);
  10643. b = Math.floor(Math.random() * length);
  10644. temp = arr[a];
  10645. arr[a] = arr[b];
  10646. arr[b] = temp;
  10647. }
  10648. }
  10649. getGameIconUrl(id) {
  10650. return "ui://game/" + id;
  10651. }
  10652. getComponentUrl(id) {
  10653. return "ui://game/" + id;
  10654. }
  10655. getAnimation() {
  10656. }
  10657. judgeSkillType(type = SkillType.highSpace) {
  10658. if (this.gameMode == GameMode.classic)
  10659. return;
  10660. let gameMgr = this.gameMgr;
  10661. if (gameMgr.selfTurn) {
  10662. if (gameMgr.selfCurSkill == type) {
  10663. return true;
  10664. }
  10665. }
  10666. else {
  10667. if (gameMgr.aiCurSkill == type) {
  10668. return true;
  10669. }
  10670. }
  10671. }
  10672. ballColliHole(collider) {
  10673. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  10674. xGame.common.gameMgr.isFirstInGame = false;
  10675. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  10676. }
  10677. collider.owner.mySrc.checkWrongBall();
  10678. }
  10679. getArrMaxEle(arr) {
  10680. let max = -Infinity;
  10681. for (let index = 0; index < arr.length; index++) {
  10682. max = Math.max(arr[index], max);
  10683. }
  10684. return max;
  10685. }
  10686. getArrMinEle(arr) {
  10687. let min = Infinity;
  10688. for (let index = 0; index < arr.length; index++) {
  10689. min = Math.min(arr[index], min);
  10690. }
  10691. return min;
  10692. }
  10693. playRandomMutiBallBigSkillSound() {
  10694. if (Math.random() <= 0.5)
  10695. return;
  10696. let rand = this.randomNum(1, 6);
  10697. let str = "ganfa0" + rand;
  10698. xGame.soundMgr.playSound(str);
  10699. }
  10700. showOneCamera(type) {
  10701. let object = xGame.common.d3World.cameraObj;
  10702. for (const key in object) {
  10703. if (Object.prototype.hasOwnProperty.call(object, key)) {
  10704. object[key].init();
  10705. object[key].owner.active = key == type;
  10706. }
  10707. }
  10708. }
  10709. checkBallOverBorder(x, y) {
  10710. let radius = 17;
  10711. let condition = this._checkBorder(x + radius, y) ||
  10712. this._checkBorder(x - radius, y) ||
  10713. this._checkBorder(x, y + radius) ||
  10714. this._checkBorder(x, y - radius);
  10715. if (condition) {
  10716. return true;
  10717. }
  10718. }
  10719. _checkBorder(x, y) {
  10720. let borderRect = this.d2World.borderRect;
  10721. let xOffest = 20;
  10722. let yOffest = 20;
  10723. if (y <= borderRect.y - yOffest) {
  10724. return true;
  10725. }
  10726. if (y >= borderRect.y + borderRect.height + yOffest) {
  10727. return true;
  10728. }
  10729. if (x <= borderRect.x - xOffest) {
  10730. return true;
  10731. }
  10732. if (x >= borderRect.x + borderRect.width + xOffest) {
  10733. return true;
  10734. }
  10735. }
  10736. initWeight(cfg) {
  10737. let allCfgData = { data: {}, allWeightNum: 0 };
  10738. let weightCfg = allCfgData.data;
  10739. let weight = 0;
  10740. for (const key in cfg) {
  10741. weightCfg[key] = {};
  10742. weightCfg[key].id = cfg[key].id;
  10743. weightCfg[key].minWeight = weight;
  10744. weight += cfg[key].weight;
  10745. weightCfg[key].maxWeight = weight;
  10746. }
  10747. allCfgData.allWeightNum = weight;
  10748. return allCfgData;
  10749. }
  10750. getRandomWeightData(cfg) {
  10751. let weightCfg = cfg.data;
  10752. let allWeightNum = cfg.allWeightNum;
  10753. let rand = Math.floor(Math.random() * allWeightNum);
  10754. for (const key in weightCfg) {
  10755. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  10756. return weightCfg[key];
  10757. }
  10758. }
  10759. return weightCfg[1];
  10760. }
  10761. showGirlTalkPop(wordsIndex, node, msgNode) {
  10762. node.visible = true;
  10763. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  10764. node.t0.play(Laya.Handler.create(this, () => {
  10765. node.visible = false;
  10766. }));
  10767. }
  10768. stopGirlPop(node) {
  10769. node.t0.stop();
  10770. node.visible = false;
  10771. }
  10772. createHead(loader, url, size = 107) {
  10773. if (Laya.Browser.name == "Browser") {
  10774. loader.url = url;
  10775. return;
  10776. }
  10777. if (Moyu.isTT) {
  10778. let localImage = new Image();
  10779. localImage.src = url;
  10780. localImage.onload = () => {
  10781. let t2d = new Laya.Texture2D();
  10782. t2d.width = size;
  10783. t2d.height = size;
  10784. loader.displayObject.graphics.drawImage(new Laya.Texture(t2d), 0, 0);
  10785. t2d.loadImageSource(localImage);
  10786. };
  10787. }
  10788. else {
  10789. console.log('zh:url=', url);
  10790. loader.url = url;
  10791. }
  10792. }
  10793. addTestCoin(num) {
  10794. DataMgr.setCoin(num);
  10795. }
  10796. addTestDiamond(num) {
  10797. DataMgr.setDiamond(num);
  10798. }
  10799. addTestSkill() {
  10800. DataMgr.setBigSkill(0, 99);
  10801. DataMgr.setBigSkill(1, 99);
  10802. DataMgr.setBigSkill(2, 99);
  10803. }
  10804. playClassicEmotion(number, x, y) {
  10805. if (this.gameMode == GameMode.bigMove)
  10806. return;
  10807. let randIndex = this.randomNum(0, 2);
  10808. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  10809. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  10810. if (this.gameMgr.selfTurn) {
  10811. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  10812. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10813. }
  10814. else {
  10815. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  10816. }
  10817. else {
  10818. if (number == this.gameMgr.blackNum) {
  10819. if (this.gameMgr.selfBallArr.length == 0) {
  10820. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10821. }
  10822. else {
  10823. }
  10824. }
  10825. else {
  10826. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10827. }
  10828. }
  10829. }
  10830. }
  10831. else {
  10832. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  10833. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10834. }
  10835. else {
  10836. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  10837. }
  10838. else {
  10839. if (number == this.gameMgr.blackNum) {
  10840. if (this.gameMgr.aiBallArr.length == 0) {
  10841. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10842. }
  10843. else {
  10844. }
  10845. }
  10846. else {
  10847. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10848. }
  10849. }
  10850. }
  10851. }
  10852. }
  10853. playHappySound(number) {
  10854. if (this.gameMode != GameMode.classic)
  10855. return;
  10856. if (number == 8)
  10857. return;
  10858. let play = false;
  10859. if (this.gameMgr.selfTurn) {
  10860. if (this.gameMgr.ensureBallType) {
  10861. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  10862. play = true;
  10863. }
  10864. }
  10865. else {
  10866. play = true;
  10867. }
  10868. }
  10869. else {
  10870. if (this.gameMgr.ensureBallType) {
  10871. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  10872. play = true;
  10873. }
  10874. }
  10875. else {
  10876. play = true;
  10877. }
  10878. }
  10879. if (play)
  10880. xGame.soundMgr.playSound("applause");
  10881. }
  10882. destroyClassicEmotion() {
  10883. if (this.gameMode == GameMode.bigMove)
  10884. return;
  10885. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  10886. parent.destroyChildren();
  10887. }
  10888. playAwardSpine(x, y) {
  10889. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  10890. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  10891. this.awardSpine.play(data, 0, false, parent);
  10892. }
  10893. destroyAwardSpine() {
  10894. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  10895. parent.destroyChildren();
  10896. }
  10897. isBlock(bx, by, hx, hy, except = null) {
  10898. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  10899. let balls = xGame.common.d2World.ballArr;
  10900. let outArr = [];
  10901. for (let index = 0; index < balls.length; index++) {
  10902. let obj = balls[index];
  10903. if (obj.number == 0)
  10904. continue;
  10905. if (obj == except)
  10906. continue;
  10907. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  10908. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  10909. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  10910. if (num >= 1)
  10911. num = 1;
  10912. if (num < 0)
  10913. continue;
  10914. let gap = Math.sin(Math.acos(num)) * dis;
  10915. if (gap < this.ballSize) {
  10916. outArr.push({
  10917. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  10918. disHon: Math.cos(Math.acos(num)) * dis,
  10919. disVer: Math.sin(Math.acos(num)) * dis,
  10920. src: balls[index],
  10921. dir: this.tempDir1
  10922. });
  10923. }
  10924. }
  10925. if (outArr.length > 0) {
  10926. outArr.sort((a, b) => { return a.dis - b.dis; });
  10927. return outArr[0];
  10928. }
  10929. }
  10930. AngleBetween(vector1, vector2) {
  10931. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  10932. return rad * (180 / Math.PI);
  10933. }
  10934. getSecretaryScale() {
  10935. if (this.secretary.spineName == "mishu") {
  10936. return 1.28;
  10937. }
  10938. else {
  10939. return 1.024;
  10940. }
  10941. }
  10942. signAwardContainsRod(arr) {
  10943. let temp;
  10944. for (let index = 0; index < arr.length; index++) {
  10945. temp = arr[index].split('-')[0];
  10946. if (parseInt(temp) > 2) {
  10947. return true;
  10948. }
  10949. }
  10950. }
  10951. judgeSameDay() {
  10952. let lastTime = DataMgr.getSignTime();
  10953. let curTime = new Date().getTime();
  10954. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  10955. return true;
  10956. }
  10957. return false;
  10958. }
  10959. getAward(arr, callback) {
  10960. let showTriple = arr[0].type <= 2;
  10961. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  10962. let temp;
  10963. for (let index = 0; index < arr.length; index++) {
  10964. temp = arr[index];
  10965. switch (temp.type) {
  10966. case 1:
  10967. this.playObjFlyAnim(temp.num, temp.type);
  10968. break;
  10969. case 2:
  10970. this.playObjFlyAnim(temp.num, temp.type);
  10971. break;
  10972. case 3:
  10973. case 4:
  10974. case 5:
  10975. case 6:
  10976. DataMgr.setBallRod(temp.type - 2, 1);
  10977. DataMgr.setCurBallRod(temp.type - 2);
  10978. break;
  10979. default:
  10980. break;
  10981. }
  10982. }
  10983. callback && callback(watchVideo);
  10984. });
  10985. }
  10986. getMoneyNode() {
  10987. let moneyNode;
  10988. let sign = xGame.uiMgr.getUI(UISign);
  10989. let draw = xGame.uiMgr.getUI(UIDraw);
  10990. let end = xGame.uiMgr.getUI(UIGameEnd);
  10991. let skill = xGame.uiMgr.getUI(UISkill);
  10992. if (sign && !sign.isHide)
  10993. moneyNode = sign.ui.moneyNode;
  10994. if (draw && !draw.isHide)
  10995. moneyNode = draw.ui.moneyNode;
  10996. if (end && !end.isHide)
  10997. moneyNode = end.ui.moneyNode;
  10998. if (skill && !skill.isHide)
  10999. moneyNode = skill.ui.moneyNode;
  11000. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  11001. let main = xGame.uiMgr.getUI(UIMain);
  11002. if (condition1 && main && !main.isHide) {
  11003. moneyNode = main.ui.moneyNode;
  11004. }
  11005. return moneyNode;
  11006. }
  11007. playObjFlyAnim(num, type, callback = null) {
  11008. this.stPos.x = Laya.stage.width / 2;
  11009. this.stPos.y = Laya.stage.height / 2;
  11010. let moneyNode = this.getMoneyNode();
  11011. switch (type) {
  11012. case Prop.diamond:
  11013. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  11014. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  11015. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  11016. this.edPos.x /= 2;
  11017. this.edPos.y /= 2;
  11018. break;
  11019. case Prop.coin:
  11020. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  11021. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  11022. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  11023. this.edPos.x /= 2;
  11024. this.edPos.y /= 2;
  11025. break;
  11026. default:
  11027. break;
  11028. }
  11029. xGame.soundMgr.playSound("coinbag");
  11030. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  11031. switch (type) {
  11032. case Prop.diamond:
  11033. DataMgr.setDiamond(num);
  11034. break;
  11035. case Prop.coin:
  11036. DataMgr.setCoin(num);
  11037. break;
  11038. default:
  11039. break;
  11040. }
  11041. callback && callback();
  11042. });
  11043. }
  11044. autoPopUIView() {
  11045. let arr = [];
  11046. let sign = this.judgeSameDay() ? false : true;
  11047. if (sign)
  11048. arr.push("sign");
  11049. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  11050. if (draw)
  11051. arr.push("draw");
  11052. if (arr.length <= 0)
  11053. return;
  11054. let str = this.getRandArrEle(arr);
  11055. switch (str) {
  11056. case "sign":
  11057. xGame.uiMgr.Show(UISign);
  11058. break;
  11059. case "draw":
  11060. xGame.uiMgr.Show(UIDraw);
  11061. break;
  11062. default:
  11063. break;
  11064. }
  11065. }
  11066. getMSTime(time) {
  11067. let min = Math.floor(time / 60);
  11068. let sec = Math.floor((time - min * 60));
  11069. if (sec < 10)
  11070. sec = "0" + sec;
  11071. if (min < 10)
  11072. min = "0" + min;
  11073. return `${min}:${sec}`;
  11074. }
  11075. testPower() {
  11076. DataMgr.setPower(0, false);
  11077. }
  11078. getAllStarNum() {
  11079. let data = DataMgr.getPlaceBallLevelList();
  11080. let out = 0;
  11081. for (let index = 0; index < data.length; index++) {
  11082. out += data[index].star;
  11083. }
  11084. return out;
  11085. }
  11086. recoverCameraView() {
  11087. Laya.timer.once(900, this, () => {
  11088. xGame.common.showOneCamera("mainCamera");
  11089. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  11090. xGame.common.gameUI.ui.d2Node.alpha = 1;
  11091. xGame.common.gameUI.ui.border.alpha = 0;
  11092. if (Laya.physicsTimer.scale < 1) {
  11093. Laya.physicsTimer.scale = 1;
  11094. }
  11095. }
  11096. });
  11097. }
  11098. getClassicLevel() {
  11099. let successTimes = DataMgr.getClassicTimes();
  11100. let needKey = "";
  11101. let lastKey = "";
  11102. let cfg = cfgTable.classictimesData;
  11103. let data;
  11104. for (const key in cfg) {
  11105. data = cfg[key];
  11106. if (successTimes <= data.times) {
  11107. needKey = key;
  11108. }
  11109. lastKey = key;
  11110. }
  11111. if (needKey == "")
  11112. needKey = lastKey;
  11113. return cfg[needKey];
  11114. }
  11115. }
  11116. Common._instance = null;
  11117. class ui_Component92 extends fgui.GComponent {
  11118. static createInstance() {
  11119. return (fgui.UIPackage.createObject("game", "Component92"));
  11120. }
  11121. onConstruct() {
  11122. this.n0 = (this.getChild("n0"));
  11123. }
  11124. }
  11125. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  11126. class ui_Component129 extends fgui.GProgressBar {
  11127. static createInstance() {
  11128. return (fgui.UIPackage.createObject("game", "Component129"));
  11129. }
  11130. onConstruct() {
  11131. this.bar_v = (this.getChild("bar_v"));
  11132. this.n84 = (this.getChild("n84"));
  11133. }
  11134. }
  11135. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  11136. class ui_Component130 extends fgui.GComponent {
  11137. static createInstance() {
  11138. return (fgui.UIPackage.createObject("game", "Component130"));
  11139. }
  11140. onConstruct() {
  11141. this.ani = (this.getChild("ani"));
  11142. this.t0 = this.getTransition("t0");
  11143. }
  11144. }
  11145. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  11146. class ui_powerEft extends fgui.GComponent {
  11147. static createInstance() {
  11148. return (fgui.UIPackage.createObject("game", "powerEft"));
  11149. }
  11150. onConstruct() {
  11151. this.ani = (this.getChild("ani"));
  11152. this.n88 = (this.getChild("n88"));
  11153. this.n89 = (this.getChild("n89"));
  11154. }
  11155. }
  11156. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  11157. class ui_PutBallLevelDisplay extends fgui.GComponent {
  11158. static createInstance() {
  11159. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  11160. }
  11161. onConstruct() {
  11162. this.c1 = this.getController("c1");
  11163. this.n2 = (this.getChild("n2"));
  11164. this.n22 = (this.getChild("n22"));
  11165. this.n23 = (this.getChild("n23"));
  11166. this.n15 = (this.getChild("n15"));
  11167. this.challenge = (this.getChild("challenge"));
  11168. this.n17 = (this.getChild("n17"));
  11169. this.n3 = (this.getChild("n3"));
  11170. this.starNode = (this.getChild("starNode"));
  11171. this.levelTxt = (this.getChild("levelTxt"));
  11172. this.n14 = (this.getChild("n14"));
  11173. this.n19 = (this.getChild("n19"));
  11174. this.n20 = (this.getChild("n20"));
  11175. this.n21 = (this.getChild("n21"));
  11176. this.special = (this.getChild("special"));
  11177. }
  11178. }
  11179. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  11180. class ui_Component79 extends fgui.GComponent {
  11181. static createInstance() {
  11182. return (fgui.UIPackage.createObject("game", "Component79"));
  11183. }
  11184. onConstruct() {
  11185. this.c1 = this.getController("c1");
  11186. this.n7 = (this.getChild("n7"));
  11187. this.n8 = (this.getChild("n8"));
  11188. this.n9 = (this.getChild("n9"));
  11189. this.n10 = (this.getChild("n10"));
  11190. this.n11 = (this.getChild("n11"));
  11191. this.n12 = (this.getChild("n12"));
  11192. }
  11193. }
  11194. ui_Component79.URL = "ui://isxx5ak7avag477";
  11195. class ui_Component80 extends fgui.GComponent {
  11196. static createInstance() {
  11197. return (fgui.UIPackage.createObject("game", "Component80"));
  11198. }
  11199. onConstruct() {
  11200. this.n0 = (this.getChild("n0"));
  11201. this.n1 = (this.getChild("n1"));
  11202. this.myList = (this.getChild("myList"));
  11203. this.t0 = this.getTransition("t0");
  11204. }
  11205. }
  11206. ui_Component80.URL = "ui://isxx5ak7avag47b";
  11207. class ui_SignNormal extends fgui.GComponent {
  11208. static createInstance() {
  11209. return (fgui.UIPackage.createObject("game", "SignNormal"));
  11210. }
  11211. onConstruct() {
  11212. this.c1 = this.getController("c1");
  11213. this.n7 = (this.getChild("n7"));
  11214. this.n15 = (this.getChild("n15"));
  11215. this.titleTxt = (this.getChild("titleTxt"));
  11216. this.n8 = (this.getChild("n8"));
  11217. this.myIcon = (this.getChild("myIcon"));
  11218. this.numTxt = (this.getChild("numTxt"));
  11219. this.n12 = (this.getChild("n12"));
  11220. this.n13 = (this.getChild("n13"));
  11221. this.n17 = (this.getChild("n17"));
  11222. this.n14 = (this.getChild("n14"));
  11223. }
  11224. }
  11225. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  11226. class ui_screenNode extends fgui.GComponent {
  11227. static createInstance() {
  11228. return (fgui.UIPackage.createObject("game", "screenNode"));
  11229. }
  11230. onConstruct() {
  11231. this.n9 = (this.getChild("n9"));
  11232. this.screenImg = (this.getChild("screenImg"));
  11233. }
  11234. }
  11235. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  11236. class ui_GetAwrad_com1 extends fgui.GComponent {
  11237. static createInstance() {
  11238. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  11239. }
  11240. onConstruct() {
  11241. this.n38 = (this.getChild("n38"));
  11242. this.n39 = (this.getChild("n39"));
  11243. this.n40 = (this.getChild("n40"));
  11244. this.t0 = this.getTransition("t0");
  11245. this.t1 = this.getTransition("t1");
  11246. }
  11247. }
  11248. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  11249. class ui_GetAwrad_com2 extends fgui.GComponent {
  11250. static createInstance() {
  11251. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  11252. }
  11253. onConstruct() {
  11254. this.n39 = (this.getChild("n39"));
  11255. this.n40 = (this.getChild("n40"));
  11256. this.t0 = this.getTransition("t0");
  11257. }
  11258. }
  11259. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  11260. class ui_Component128 extends fgui.GComponent {
  11261. static createInstance() {
  11262. return (fgui.UIPackage.createObject("game", "Component128"));
  11263. }
  11264. onConstruct() {
  11265. this.n38 = (this.getChild("n38"));
  11266. this.n40 = (this.getChild("n40"));
  11267. }
  11268. }
  11269. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  11270. class ui_Component100_1 extends fgui.GComponent {
  11271. static createInstance() {
  11272. return (fgui.UIPackage.createObject("game", "Component100_1"));
  11273. }
  11274. onConstruct() {
  11275. this.myNode = (this.getChild("myNode"));
  11276. this.t0 = this.getTransition("t0");
  11277. }
  11278. }
  11279. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  11280. class ui_Component142 extends fgui.GComponent {
  11281. static createInstance() {
  11282. return (fgui.UIPackage.createObject("game", "Component142"));
  11283. }
  11284. onConstruct() {
  11285. this.n41 = (this.getChild("n41"));
  11286. this.n42 = (this.getChild("n42"));
  11287. }
  11288. }
  11289. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  11290. class ui_main_guang extends fgui.GComponent {
  11291. static createInstance() {
  11292. return (fgui.UIPackage.createObject("game", "main_guang"));
  11293. }
  11294. onConstruct() {
  11295. this.n1 = (this.getChild("n1"));
  11296. this.n2 = (this.getChild("n2"));
  11297. this.n3 = (this.getChild("n3"));
  11298. this.n4 = (this.getChild("n4"));
  11299. this.n5 = (this.getChild("n5"));
  11300. this.n6 = (this.getChild("n6"));
  11301. this.n8 = (this.getChild("n8"));
  11302. this.t0 = this.getTransition("t0");
  11303. }
  11304. }
  11305. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  11306. class ui_try_com1 extends fgui.GComponent {
  11307. static createInstance() {
  11308. return (fgui.UIPackage.createObject("game", "try_com1"));
  11309. }
  11310. onConstruct() {
  11311. this.c1 = this.getController("c1");
  11312. this.n0 = (this.getChild("n0"));
  11313. this.n2 = (this.getChild("n2"));
  11314. this.cancelBtn = (this.getChild("cancelBtn"));
  11315. this.videoBtn = (this.getChild("videoBtn"));
  11316. this.n9 = (this.getChild("n9"));
  11317. this.n24 = (this.getChild("n24"));
  11318. this.titleTxt = (this.getChild("titleTxt"));
  11319. this.n32 = (this.getChild("n32"));
  11320. this.n29 = (this.getChild("n29"));
  11321. this.n36 = (this.getChild("n36"));
  11322. this.txtTime = (this.getChild("txtTime"));
  11323. this.t0 = this.getTransition("t0");
  11324. }
  11325. }
  11326. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  11327. class ui_try_com2 extends fgui.GComponent {
  11328. static createInstance() {
  11329. return (fgui.UIPackage.createObject("game", "try_com2"));
  11330. }
  11331. onConstruct() {
  11332. this.skillicon = (this.getChild("skillicon"));
  11333. this.n35 = (this.getChild("n35"));
  11334. this.n31 = (this.getChild("n31"));
  11335. this.n32 = (this.getChild("n32"));
  11336. this.n33 = (this.getChild("n33"));
  11337. this.n34 = (this.getChild("n34"));
  11338. }
  11339. }
  11340. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  11341. class ui_try_com3 extends fgui.GComponent {
  11342. static createInstance() {
  11343. return (fgui.UIPackage.createObject("game", "try_com3"));
  11344. }
  11345. onConstruct() {
  11346. this.n33 = (this.getChild("n33"));
  11347. this.n34 = (this.getChild("n34"));
  11348. this.n35 = (this.getChild("n35"));
  11349. this.t0 = this.getTransition("t0");
  11350. }
  11351. }
  11352. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  11353. class ui_Component121 extends fgui.GButton {
  11354. static createInstance() {
  11355. return (fgui.UIPackage.createObject("game", "Component121"));
  11356. }
  11357. onConstruct() {
  11358. this.n3 = (this.getChild("n3"));
  11359. this.t0 = this.getTransition("t0");
  11360. }
  11361. }
  11362. ui_Component121.URL = "ui://isxx5ak7cy72v4ib";
  11363. class ui_huihe1 extends fgui.GComponent {
  11364. static createInstance() {
  11365. return (fgui.UIPackage.createObject("game", "huihe1"));
  11366. }
  11367. onConstruct() {
  11368. this.n0 = (this.getChild("n0"));
  11369. this.n1 = (this.getChild("n1"));
  11370. this.t0 = this.getTransition("t0");
  11371. }
  11372. }
  11373. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  11374. class ui_huihe2 extends fgui.GComponent {
  11375. static createInstance() {
  11376. return (fgui.UIPackage.createObject("game", "huihe2"));
  11377. }
  11378. onConstruct() {
  11379. this.n0 = (this.getChild("n0"));
  11380. this.n1 = (this.getChild("n1"));
  11381. this.t0 = this.getTransition("t0");
  11382. }
  11383. }
  11384. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  11385. class ui_Component143 extends fgui.GComponent {
  11386. static createInstance() {
  11387. return (fgui.UIPackage.createObject("game", "Component143"));
  11388. }
  11389. onConstruct() {
  11390. this.n3 = (this.getChild("n3"));
  11391. this.n4 = (this.getChild("n4"));
  11392. this.n5 = (this.getChild("n5"));
  11393. this.n6 = (this.getChild("n6"));
  11394. this.n7 = (this.getChild("n7"));
  11395. this.n8 = (this.getChild("n8"));
  11396. this.n9 = (this.getChild("n9"));
  11397. this.n10 = (this.getChild("n10"));
  11398. this.t0 = this.getTransition("t0");
  11399. }
  11400. }
  11401. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  11402. class ui_dh_jingbi2 extends fgui.GComponent {
  11403. static createInstance() {
  11404. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  11405. }
  11406. onConstruct() {
  11407. this.n0 = (this.getChild("n0"));
  11408. this.n1 = (this.getChild("n1"));
  11409. this.n2 = (this.getChild("n2"));
  11410. this.n3 = (this.getChild("n3"));
  11411. this.n4 = (this.getChild("n4"));
  11412. this.n5 = (this.getChild("n5"));
  11413. this.n6 = (this.getChild("n6"));
  11414. this.n8 = (this.getChild("n8"));
  11415. this.n10 = (this.getChild("n10"));
  11416. this.t0 = this.getTransition("t0");
  11417. }
  11418. }
  11419. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  11420. class ui_dh_jingbi2_1 extends fgui.GComponent {
  11421. static createInstance() {
  11422. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  11423. }
  11424. onConstruct() {
  11425. this.n1 = (this.getChild("n1"));
  11426. this.n4 = (this.getChild("n4"));
  11427. this.t0 = this.getTransition("t0");
  11428. }
  11429. }
  11430. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  11431. class ui_dh_jingbi3 extends fgui.GComponent {
  11432. static createInstance() {
  11433. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  11434. }
  11435. onConstruct() {
  11436. this.n0 = (this.getChild("n0"));
  11437. this.n1 = (this.getChild("n1"));
  11438. this.n2 = (this.getChild("n2"));
  11439. this.n3 = (this.getChild("n3"));
  11440. this.n4 = (this.getChild("n4"));
  11441. this.n5 = (this.getChild("n5"));
  11442. this.n6 = (this.getChild("n6"));
  11443. this.n8 = (this.getChild("n8"));
  11444. this.n10 = (this.getChild("n10"));
  11445. this.t0 = this.getTransition("t0");
  11446. }
  11447. }
  11448. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  11449. class ui_dh_jingbi3_1 extends fgui.GComponent {
  11450. static createInstance() {
  11451. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  11452. }
  11453. onConstruct() {
  11454. this.n3 = (this.getChild("n3"));
  11455. this.n1 = (this.getChild("n1"));
  11456. this.t0 = this.getTransition("t0");
  11457. }
  11458. }
  11459. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  11460. class ui_hb_jinbi1 extends fgui.GButton {
  11461. static createInstance() {
  11462. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  11463. }
  11464. onConstruct() {
  11465. this.n20 = (this.getChild("n20"));
  11466. this.n25 = (this.getChild("n25"));
  11467. this.coinTxt = (this.getChild("coinTxt"));
  11468. this.n28 = (this.getChild("n28"));
  11469. this.n32 = (this.getChild("n32"));
  11470. this.n38 = (this.getChild("n38"));
  11471. this.n45 = (this.getChild("n45"));
  11472. this.getTips = (this.getChild("getTips"));
  11473. this.n39 = (this.getChild("n39"));
  11474. this.diamondTxt = (this.getChild("diamondTxt"));
  11475. this.n41 = (this.getChild("n41"));
  11476. this.n42 = (this.getChild("n42"));
  11477. this.n46 = (this.getChild("n46"));
  11478. this.n47 = (this.getChild("n47"));
  11479. this.n48 = (this.getChild("n48"));
  11480. this.t0 = this.getTransition("t0");
  11481. }
  11482. }
  11483. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  11484. class ui_hb_jinbi2 extends fgui.GButton {
  11485. static createInstance() {
  11486. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  11487. }
  11488. onConstruct() {
  11489. this.n20 = (this.getChild("n20"));
  11490. this.n25 = (this.getChild("n25"));
  11491. this.coinTxt = (this.getChild("coinTxt"));
  11492. this.n28 = (this.getChild("n28"));
  11493. this.n32 = (this.getChild("n32"));
  11494. this.n38 = (this.getChild("n38"));
  11495. this.n39 = (this.getChild("n39"));
  11496. this.diamondTxt = (this.getChild("diamondTxt"));
  11497. this.n41 = (this.getChild("n41"));
  11498. this.n42 = (this.getChild("n42"));
  11499. this.n43 = (this.getChild("n43"));
  11500. this.n44 = (this.getChild("n44"));
  11501. this.n45 = (this.getChild("n45"));
  11502. this.t0 = this.getTransition("t0");
  11503. }
  11504. }
  11505. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  11506. class ui_hb_jinbi3 extends fgui.GButton {
  11507. static createInstance() {
  11508. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  11509. }
  11510. onConstruct() {
  11511. this.n20 = (this.getChild("n20"));
  11512. this.n25 = (this.getChild("n25"));
  11513. this.coinTxt = (this.getChild("coinTxt"));
  11514. this.n28 = (this.getChild("n28"));
  11515. this.n32 = (this.getChild("n32"));
  11516. this.n38 = (this.getChild("n38"));
  11517. this.n39 = (this.getChild("n39"));
  11518. this.diamondTxt = (this.getChild("diamondTxt"));
  11519. this.n41 = (this.getChild("n41"));
  11520. this.n42 = (this.getChild("n42"));
  11521. this.n43 = (this.getChild("n43"));
  11522. this.n44 = (this.getChild("n44"));
  11523. this.n45 = (this.getChild("n45"));
  11524. this.t0 = this.getTransition("t0");
  11525. }
  11526. }
  11527. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  11528. class ui_Component104 extends fgui.GComponent {
  11529. static createInstance() {
  11530. return (fgui.UIPackage.createObject("game", "Component104"));
  11531. }
  11532. onConstruct() {
  11533. this.c1 = this.getController("c1");
  11534. this.n12 = (this.getChild("n12"));
  11535. this.coinBtn = (this.getChild("coinBtn"));
  11536. this.diamondBtn = (this.getChild("diamondBtn"));
  11537. this.node3 = (this.getChild("node3"));
  11538. this.node4 = (this.getChild("node4"));
  11539. this.node5 = (this.getChild("node5"));
  11540. this.node1 = (this.getChild("node1"));
  11541. this.node2 = (this.getChild("node2"));
  11542. this.node6 = (this.getChild("node6"));
  11543. this.t0 = this.getTransition("t0");
  11544. }
  11545. }
  11546. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  11547. class ui_Component105 extends fgui.GButton {
  11548. static createInstance() {
  11549. return (fgui.UIPackage.createObject("game", "Component105"));
  11550. }
  11551. onConstruct() {
  11552. this.c1 = this.getController("c1");
  11553. this.n49 = (this.getChild("n49"));
  11554. this.n18 = (this.getChild("n18"));
  11555. this.n46 = (this.getChild("n46"));
  11556. this.n48 = (this.getChild("n48"));
  11557. }
  11558. }
  11559. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  11560. class ui_Component106 extends fgui.GButton {
  11561. static createInstance() {
  11562. return (fgui.UIPackage.createObject("game", "Component106"));
  11563. }
  11564. onConstruct() {
  11565. this.c1 = this.getController("c1");
  11566. this.n49 = (this.getChild("n49"));
  11567. this.n18 = (this.getChild("n18"));
  11568. this.n46 = (this.getChild("n46"));
  11569. this.n48 = (this.getChild("n48"));
  11570. }
  11571. }
  11572. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  11573. class ui_hb_zs1 extends fgui.GButton {
  11574. static createInstance() {
  11575. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  11576. }
  11577. onConstruct() {
  11578. this.c1 = this.getController("c1");
  11579. this.n20 = (this.getChild("n20"));
  11580. this.n21 = (this.getChild("n21"));
  11581. this.n26 = (this.getChild("n26"));
  11582. this.n27 = (this.getChild("n27"));
  11583. this.shareTxt = (this.getChild("shareTxt"));
  11584. this.n32 = (this.getChild("n32"));
  11585. this.n38 = (this.getChild("n38"));
  11586. this.n39 = (this.getChild("n39"));
  11587. this.n44 = (this.getChild("n44"));
  11588. this.diamondTxt = (this.getChild("diamondTxt"));
  11589. this.n41 = (this.getChild("n41"));
  11590. this.n45 = (this.getChild("n45"));
  11591. this.n47 = (this.getChild("n47"));
  11592. this.n48 = (this.getChild("n48"));
  11593. this.randTxt = (this.getChild("randTxt"));
  11594. this.n50 = (this.getChild("n50"));
  11595. this.t0 = this.getTransition("t0");
  11596. }
  11597. }
  11598. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  11599. class ui_dh_zs1 extends fgui.GComponent {
  11600. static createInstance() {
  11601. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  11602. }
  11603. onConstruct() {
  11604. this.n10 = (this.getChild("n10"));
  11605. this.n9 = (this.getChild("n9"));
  11606. this.n1 = (this.getChild("n1"));
  11607. this.n2 = (this.getChild("n2"));
  11608. this.n3 = (this.getChild("n3"));
  11609. this.n4 = (this.getChild("n4"));
  11610. this.n5 = (this.getChild("n5"));
  11611. this.n6 = (this.getChild("n6"));
  11612. this.n8 = (this.getChild("n8"));
  11613. this.n11 = (this.getChild("n11"));
  11614. this.t0 = this.getTransition("t0");
  11615. }
  11616. }
  11617. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  11618. class ui_dh_zs1_1 extends fgui.GComponent {
  11619. static createInstance() {
  11620. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  11621. }
  11622. onConstruct() {
  11623. this.n3 = (this.getChild("n3"));
  11624. this.n1 = (this.getChild("n1"));
  11625. this.t0 = this.getTransition("t0");
  11626. }
  11627. }
  11628. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  11629. class ui_hb_zs2 extends fgui.GButton {
  11630. static createInstance() {
  11631. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  11632. }
  11633. onConstruct() {
  11634. this.n20 = (this.getChild("n20"));
  11635. this.n21 = (this.getChild("n21"));
  11636. this.n26 = (this.getChild("n26"));
  11637. this.n27 = (this.getChild("n27"));
  11638. this.n32 = (this.getChild("n32"));
  11639. this.n38 = (this.getChild("n38"));
  11640. this.n39 = (this.getChild("n39"));
  11641. this.n44 = (this.getChild("n44"));
  11642. this.diamondTxt = (this.getChild("diamondTxt"));
  11643. this.n41 = (this.getChild("n41"));
  11644. this.n45 = (this.getChild("n45"));
  11645. this.t0 = this.getTransition("t0");
  11646. }
  11647. }
  11648. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  11649. class ui_hb_zs3 extends fgui.GButton {
  11650. static createInstance() {
  11651. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  11652. }
  11653. onConstruct() {
  11654. this.n20 = (this.getChild("n20"));
  11655. this.n21 = (this.getChild("n21"));
  11656. this.n26 = (this.getChild("n26"));
  11657. this.n27 = (this.getChild("n27"));
  11658. this.n32 = (this.getChild("n32"));
  11659. this.n38 = (this.getChild("n38"));
  11660. this.n47 = (this.getChild("n47"));
  11661. this.t0 = this.getTransition("t0");
  11662. }
  11663. }
  11664. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  11665. class ui_dh_zs2 extends fgui.GComponent {
  11666. static createInstance() {
  11667. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  11668. }
  11669. onConstruct() {
  11670. this.n10 = (this.getChild("n10"));
  11671. this.n9 = (this.getChild("n9"));
  11672. this.n1 = (this.getChild("n1"));
  11673. this.n2 = (this.getChild("n2"));
  11674. this.n3 = (this.getChild("n3"));
  11675. this.n4 = (this.getChild("n4"));
  11676. this.n5 = (this.getChild("n5"));
  11677. this.n6 = (this.getChild("n6"));
  11678. this.n8 = (this.getChild("n8"));
  11679. this.n11 = (this.getChild("n11"));
  11680. this.t0 = this.getTransition("t0");
  11681. }
  11682. }
  11683. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  11684. class ui_dh_zs2_1 extends fgui.GComponent {
  11685. static createInstance() {
  11686. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  11687. }
  11688. onConstruct() {
  11689. this.n3 = (this.getChild("n3"));
  11690. this.n1 = (this.getChild("n1"));
  11691. this.t0 = this.getTransition("t0");
  11692. }
  11693. }
  11694. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  11695. class ui_dh_zs3 extends fgui.GComponent {
  11696. static createInstance() {
  11697. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  11698. }
  11699. onConstruct() {
  11700. this.n10 = (this.getChild("n10"));
  11701. this.n9 = (this.getChild("n9"));
  11702. this.n1 = (this.getChild("n1"));
  11703. this.n2 = (this.getChild("n2"));
  11704. this.n3 = (this.getChild("n3"));
  11705. this.n4 = (this.getChild("n4"));
  11706. this.n5 = (this.getChild("n5"));
  11707. this.n6 = (this.getChild("n6"));
  11708. this.n8 = (this.getChild("n8"));
  11709. this.n11 = (this.getChild("n11"));
  11710. this.t0 = this.getTransition("t0");
  11711. }
  11712. }
  11713. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  11714. class ui_dh_zs3_1 extends fgui.GComponent {
  11715. static createInstance() {
  11716. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  11717. }
  11718. onConstruct() {
  11719. this.n3 = (this.getChild("n3"));
  11720. this.n1 = (this.getChild("n1"));
  11721. this.t0 = this.getTransition("t0");
  11722. }
  11723. }
  11724. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  11725. class ui_Component107 extends fgui.GComponent {
  11726. static createInstance() {
  11727. return (fgui.UIPackage.createObject("game", "Component107"));
  11728. }
  11729. onConstruct() {
  11730. this.n18 = (this.getChild("n18"));
  11731. this.n19 = (this.getChild("n19"));
  11732. this.n20 = (this.getChild("n20"));
  11733. this.n21 = (this.getChild("n21"));
  11734. this.n22 = (this.getChild("n22"));
  11735. this.levelTxt = (this.getChild("levelTxt"));
  11736. this.t0 = this.getTransition("t0");
  11737. }
  11738. }
  11739. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  11740. class ui_box_com1 extends fgui.GComponent {
  11741. static createInstance() {
  11742. return (fgui.UIPackage.createObject("game", "box_com1"));
  11743. }
  11744. onConstruct() {
  11745. this.n14 = (this.getChild("n14"));
  11746. this.n6 = (this.getChild("n6"));
  11747. this.t0 = this.getTransition("t0");
  11748. }
  11749. }
  11750. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  11751. class ui_box_com2 extends fgui.GProgressBar {
  11752. static createInstance() {
  11753. return (fgui.UIPackage.createObject("game", "box_com2"));
  11754. }
  11755. onConstruct() {
  11756. this.bg0 = (this.getChild("bg0"));
  11757. this.bg = (this.getChild("bg"));
  11758. this.bar = (this.getChild("bar"));
  11759. this.n7 = (this.getChild("n7"));
  11760. this.n8 = (this.getChild("n8"));
  11761. this.n10 = (this.getChild("n10"));
  11762. this.n11 = (this.getChild("n11"));
  11763. this.n12 = (this.getChild("n12"));
  11764. }
  11765. }
  11766. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  11767. class ui_box_com4 extends fgui.GComponent {
  11768. static createInstance() {
  11769. return (fgui.UIPackage.createObject("game", "box_com4"));
  11770. }
  11771. onConstruct() {
  11772. this.n8 = (this.getChild("n8"));
  11773. this.t0 = this.getTransition("t0");
  11774. }
  11775. }
  11776. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  11777. class ui_box_com3 extends fgui.GComponent {
  11778. static createInstance() {
  11779. return (fgui.UIPackage.createObject("game", "box_com3"));
  11780. }
  11781. onConstruct() {
  11782. this.n2 = (this.getChild("n2"));
  11783. this.n3 = (this.getChild("n3"));
  11784. this.n4 = (this.getChild("n4"));
  11785. this.n5 = (this.getChild("n5"));
  11786. this.t0 = this.getTransition("t0");
  11787. this.t1 = this.getTransition("t1");
  11788. }
  11789. }
  11790. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  11791. class ui_Component97 extends fgui.GComponent {
  11792. static createInstance() {
  11793. return (fgui.UIPackage.createObject("game", "Component97"));
  11794. }
  11795. onConstruct() {
  11796. this.c1 = this.getController("c1");
  11797. this.n46 = (this.getChild("n46"));
  11798. this.diamondNode = (this.getChild("diamondNode"));
  11799. this.coinNode = (this.getChild("coinNode"));
  11800. this.t0 = this.getTransition("t0");
  11801. }
  11802. }
  11803. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  11804. class ui_Component98 extends fgui.GButton {
  11805. static createInstance() {
  11806. return (fgui.UIPackage.createObject("game", "Component98"));
  11807. }
  11808. onConstruct() {
  11809. this.n8 = (this.getChild("n8"));
  11810. this.n40 = (this.getChild("n40"));
  11811. }
  11812. }
  11813. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  11814. class ui_Component28_11 extends fgui.GButton {
  11815. static createInstance() {
  11816. return (fgui.UIPackage.createObject("game", "Component28_11"));
  11817. }
  11818. onConstruct() {
  11819. this.c1 = this.getController("c1");
  11820. this.n12 = (this.getChild("n12"));
  11821. this.n17 = (this.getChild("n17"));
  11822. this.n13 = (this.getChild("n13"));
  11823. this.diamondTxt = (this.getChild("diamondTxt"));
  11824. this.n15 = (this.getChild("n15"));
  11825. this.n16 = (this.getChild("n16"));
  11826. }
  11827. }
  11828. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  11829. class ui_Component58_11 extends fgui.GComponent {
  11830. static createInstance() {
  11831. return (fgui.UIPackage.createObject("game", "Component58_11"));
  11832. }
  11833. onConstruct() {
  11834. this.n23 = (this.getChild("n23"));
  11835. this.n41 = (this.getChild("n41"));
  11836. this.myList = (this.getChild("myList"));
  11837. this.n45 = (this.getChild("n45"));
  11838. this.n44 = (this.getChild("n44"));
  11839. this.t0 = this.getTransition("t0");
  11840. }
  11841. }
  11842. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  11843. class ui_Component100 extends fgui.GComponent {
  11844. static createInstance() {
  11845. return (fgui.UIPackage.createObject("game", "Component100"));
  11846. }
  11847. onConstruct() {
  11848. this.c1 = this.getController("c1");
  11849. this.n75 = (this.getChild("n75"));
  11850. this.n76 = (this.getChild("n76"));
  11851. this.n80 = (this.getChild("n80"));
  11852. this.txt = (this.getChild("txt"));
  11853. this.spineRoot = (this.getChild("spineRoot"));
  11854. }
  11855. }
  11856. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  11857. class ui_Component101 extends fgui.GComponent {
  11858. static createInstance() {
  11859. return (fgui.UIPackage.createObject("game", "Component101"));
  11860. }
  11861. onConstruct() {
  11862. this.c1 = this.getController("c1");
  11863. this.n36 = (this.getChild("n36"));
  11864. this.n35 = (this.getChild("n35"));
  11865. this.n33 = (this.getChild("n33"));
  11866. this.n34 = (this.getChild("n34"));
  11867. }
  11868. }
  11869. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  11870. class ui_Component53 extends fgui.GComponent {
  11871. static createInstance() {
  11872. return (fgui.UIPackage.createObject("game", "Component53"));
  11873. }
  11874. onConstruct() {
  11875. this.n0 = (this.getChild("n0"));
  11876. this.n1 = (this.getChild("n1"));
  11877. this.n2 = (this.getChild("n2"));
  11878. this.n3 = (this.getChild("n3"));
  11879. this.n4 = (this.getChild("n4"));
  11880. this.n5 = (this.getChild("n5"));
  11881. this.n6 = (this.getChild("n6"));
  11882. this.n7 = (this.getChild("n7"));
  11883. this.n8 = (this.getChild("n8"));
  11884. this.n9 = (this.getChild("n9"));
  11885. this.n10 = (this.getChild("n10"));
  11886. this.n11 = (this.getChild("n11"));
  11887. this.n12 = (this.getChild("n12"));
  11888. this.n13 = (this.getChild("n13"));
  11889. this.n14 = (this.getChild("n14"));
  11890. this.n15 = (this.getChild("n15"));
  11891. this.n16 = (this.getChild("n16"));
  11892. this.n19 = (this.getChild("n19"));
  11893. this.n20 = (this.getChild("n20"));
  11894. this.n21 = (this.getChild("n21"));
  11895. this.n22 = (this.getChild("n22"));
  11896. this.n23 = (this.getChild("n23"));
  11897. this.n24 = (this.getChild("n24"));
  11898. this.n25 = (this.getChild("n25"));
  11899. this.n26 = (this.getChild("n26"));
  11900. this.n27 = (this.getChild("n27"));
  11901. this.n28 = (this.getChild("n28"));
  11902. this.n29 = (this.getChild("n29"));
  11903. this.n30 = (this.getChild("n30"));
  11904. this.n31 = (this.getChild("n31"));
  11905. this.n32 = (this.getChild("n32"));
  11906. this.n33 = (this.getChild("n33"));
  11907. this.n34 = (this.getChild("n34"));
  11908. this.n35 = (this.getChild("n35"));
  11909. this.t0 = this.getTransition("t0");
  11910. }
  11911. }
  11912. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  11913. class ui_Component58 extends fgui.GComponent {
  11914. static createInstance() {
  11915. return (fgui.UIPackage.createObject("game", "Component58"));
  11916. }
  11917. onConstruct() {
  11918. this.n23 = (this.getChild("n23"));
  11919. this.n41 = (this.getChild("n41"));
  11920. this.n8 = (this.getChild("n8"));
  11921. this.skillList = (this.getChild("skillList"));
  11922. this.t0 = this.getTransition("t0");
  11923. }
  11924. }
  11925. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  11926. class ui_Component59 extends fgui.GComponent {
  11927. static createInstance() {
  11928. return (fgui.UIPackage.createObject("game", "Component59"));
  11929. }
  11930. onConstruct() {
  11931. this.n3 = (this.getChild("n3"));
  11932. this.msgTxt = (this.getChild("msgTxt"));
  11933. this.t0 = this.getTransition("t0");
  11934. }
  11935. }
  11936. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  11937. class ui_RulerNode extends fgui.GComponent {
  11938. static createInstance() {
  11939. return (fgui.UIPackage.createObject("game", "RulerNode"));
  11940. }
  11941. onConstruct() {
  11942. this.n6 = (this.getChild("n6"));
  11943. this.n4 = (this.getChild("n4"));
  11944. this.img1 = (this.getChild("img1"));
  11945. this.img2 = (this.getChild("img2"));
  11946. }
  11947. }
  11948. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  11949. class ui_Component108 extends fgui.GComponent {
  11950. static createInstance() {
  11951. return (fgui.UIPackage.createObject("game", "Component108"));
  11952. }
  11953. onConstruct() {
  11954. this.n19 = (this.getChild("n19"));
  11955. this.t0 = this.getTransition("t0");
  11956. }
  11957. }
  11958. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  11959. class ui_Component63 extends fgui.GComponent {
  11960. static createInstance() {
  11961. return (fgui.UIPackage.createObject("game", "Component63"));
  11962. }
  11963. onConstruct() {
  11964. this.n66 = (this.getChild("n66"));
  11965. this.n56 = (this.getChild("n56"));
  11966. this.n63 = (this.getChild("n63"));
  11967. this.n65 = (this.getChild("n65"));
  11968. this.t0 = this.getTransition("t0");
  11969. }
  11970. }
  11971. ui_Component63.URL = "ui://isxx5ak7h657452";
  11972. class ui_topNode extends fgui.GComponent {
  11973. static createInstance() {
  11974. return (fgui.UIPackage.createObject("game", "topNode"));
  11975. }
  11976. onConstruct() {
  11977. this.selfProgress = (this.getChild("selfProgress"));
  11978. this.aiProgress = (this.getChild("aiProgress"));
  11979. this.selfKuang = (this.getChild("selfKuang"));
  11980. this.aiKuang = (this.getChild("aiKuang"));
  11981. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  11982. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  11983. this.n33 = (this.getChild("n33"));
  11984. this.n34 = (this.getChild("n34"));
  11985. this.selfNameTxt = (this.getChild("selfNameTxt"));
  11986. this.aiNameTxt = (this.getChild("aiNameTxt"));
  11987. this.selfBallList = (this.getChild("selfBallList"));
  11988. this.aiBallList = (this.getChild("aiBallList"));
  11989. this.middleNode = (this.getChild("middleNode"));
  11990. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  11991. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  11992. this.scoreNode = (this.getChild("scoreNode"));
  11993. this.selfTips = (this.getChild("selfTips"));
  11994. this.aiTips = (this.getChild("aiTips"));
  11995. }
  11996. }
  11997. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  11998. class ui_selfProgress extends fgui.GProgressBar {
  11999. static createInstance() {
  12000. return (fgui.UIPackage.createObject("game", "selfProgress"));
  12001. }
  12002. onConstruct() {
  12003. this.n3 = (this.getChild("n3"));
  12004. this.bar = (this.getChild("bar"));
  12005. }
  12006. }
  12007. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  12008. class ui_aiProgress extends fgui.GProgressBar {
  12009. static createInstance() {
  12010. return (fgui.UIPackage.createObject("game", "aiProgress"));
  12011. }
  12012. onConstruct() {
  12013. this.n3 = (this.getChild("n3"));
  12014. this.bar = (this.getChild("bar"));
  12015. }
  12016. }
  12017. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  12018. class ui_ballDisplay extends fgui.GComponent {
  12019. static createInstance() {
  12020. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  12021. }
  12022. onConstruct() {
  12023. this.myImg = (this.getChild("myImg"));
  12024. }
  12025. }
  12026. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  12027. class ui_moveNode extends fgui.GComponent {
  12028. static createInstance() {
  12029. return (fgui.UIPackage.createObject("game", "moveNode"));
  12030. }
  12031. onConstruct() {
  12032. this.n8 = (this.getChild("n8"));
  12033. this.finger = (this.getChild("finger"));
  12034. }
  12035. }
  12036. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  12037. class ui_cancelBtn extends fgui.GButton {
  12038. static createInstance() {
  12039. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  12040. }
  12041. onConstruct() {
  12042. this.c1 = this.getController("c1");
  12043. this.n0 = (this.getChild("n0"));
  12044. this.n1 = (this.getChild("n1"));
  12045. }
  12046. }
  12047. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  12048. class ui_shareBtn extends fgui.GButton {
  12049. static createInstance() {
  12050. return (fgui.UIPackage.createObject("game", "shareBtn"));
  12051. }
  12052. onConstruct() {
  12053. this.c1 = this.getController("c1");
  12054. this.n2 = (this.getChild("n2"));
  12055. this.n1 = (this.getChild("n1"));
  12056. this.n3 = (this.getChild("n3"));
  12057. this.n4 = (this.getChild("n4"));
  12058. this.n5 = (this.getChild("n5"));
  12059. this.n6 = (this.getChild("n6"));
  12060. }
  12061. }
  12062. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  12063. class ui_share2Btn extends fgui.GButton {
  12064. static createInstance() {
  12065. return (fgui.UIPackage.createObject("game", "share2Btn"));
  12066. }
  12067. onConstruct() {
  12068. this.n3 = (this.getChild("n3"));
  12069. }
  12070. }
  12071. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  12072. class ui_rodMethodNode extends fgui.GComponent {
  12073. static createInstance() {
  12074. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  12075. }
  12076. onConstruct() {
  12077. this.bg = (this.getChild("bg"));
  12078. this.dot = (this.getChild("dot"));
  12079. }
  12080. }
  12081. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  12082. class ui_sureBtn extends fgui.GButton {
  12083. static createInstance() {
  12084. return (fgui.UIPackage.createObject("game", "sureBtn"));
  12085. }
  12086. onConstruct() {
  12087. this.n2 = (this.getChild("n2"));
  12088. this.n1 = (this.getChild("n1"));
  12089. }
  12090. }
  12091. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  12092. class ui_Component18 extends fgui.GComponent {
  12093. static createInstance() {
  12094. return (fgui.UIPackage.createObject("game", "Component18"));
  12095. }
  12096. onConstruct() {
  12097. this.c1 = this.getController("c1");
  12098. this.nameTxt = (this.getChild("nameTxt"));
  12099. this.headImg = (this.getChild("headImg"));
  12100. this.n24 = (this.getChild("n24"));
  12101. this.skillImg = (this.getChild("skillImg"));
  12102. this.skillTxt = (this.getChild("skillTxt"));
  12103. }
  12104. }
  12105. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  12106. class ui_Component45 extends fgui.GComponent {
  12107. static createInstance() {
  12108. return (fgui.UIPackage.createObject("game", "Component45"));
  12109. }
  12110. onConstruct() {
  12111. this.c1 = this.getController("c1");
  12112. this.n40 = (this.getChild("n40"));
  12113. this.n41 = (this.getChild("n41"));
  12114. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  12115. this.n42 = (this.getChild("n42"));
  12116. this.awardTxt = (this.getChild("awardTxt"));
  12117. this.n44 = (this.getChild("n44"));
  12118. this.t0 = this.getTransition("t0");
  12119. }
  12120. }
  12121. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  12122. class ui_emotionDisplay extends fgui.GButton {
  12123. static createInstance() {
  12124. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  12125. }
  12126. onConstruct() {
  12127. this.myIcon = (this.getChild("myIcon"));
  12128. }
  12129. }
  12130. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  12131. class ui_Component49 extends fgui.GButton {
  12132. static createInstance() {
  12133. return (fgui.UIPackage.createObject("game", "Component49"));
  12134. }
  12135. onConstruct() {
  12136. this.n69 = (this.getChild("n69"));
  12137. this.n56 = (this.getChild("n56"));
  12138. }
  12139. }
  12140. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  12141. class ui_Component50 extends fgui.GButton {
  12142. static createInstance() {
  12143. return (fgui.UIPackage.createObject("game", "Component50"));
  12144. }
  12145. onConstruct() {
  12146. this.n54 = (this.getChild("n54"));
  12147. this.n65 = (this.getChild("n65"));
  12148. }
  12149. }
  12150. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  12151. class ui_Component51 extends fgui.GButton {
  12152. static createInstance() {
  12153. return (fgui.UIPackage.createObject("game", "Component51"));
  12154. }
  12155. onConstruct() {
  12156. this.c1 = this.getController("c1");
  12157. this.n51 = (this.getChild("n51"));
  12158. this.n54 = (this.getChild("n54"));
  12159. }
  12160. }
  12161. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  12162. class ui_Button5 extends fgui.GButton {
  12163. static createInstance() {
  12164. return (fgui.UIPackage.createObject("game", "Button5"));
  12165. }
  12166. onConstruct() {
  12167. this.c1 = this.getController("c1");
  12168. this.n0 = (this.getChild("n0"));
  12169. this.n2 = (this.getChild("n2"));
  12170. }
  12171. }
  12172. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  12173. class ui_Component124 extends fgui.GComponent {
  12174. static createInstance() {
  12175. return (fgui.UIPackage.createObject("game", "Component124"));
  12176. }
  12177. onConstruct() {
  12178. this.n22 = (this.getChild("n22"));
  12179. this.shareNode = (this.getChild("shareNode"));
  12180. }
  12181. }
  12182. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  12183. class ui_Component125 extends fgui.GComponent {
  12184. static createInstance() {
  12185. return (fgui.UIPackage.createObject("game", "Component125"));
  12186. }
  12187. onConstruct() {
  12188. this.n29 = (this.getChild("n29"));
  12189. this.coinTxt = (this.getChild("coinTxt"));
  12190. }
  12191. }
  12192. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  12193. class ui_Component52 extends fgui.GButton {
  12194. static createInstance() {
  12195. return (fgui.UIPackage.createObject("game", "Component52"));
  12196. }
  12197. onConstruct() {
  12198. this.n35 = (this.getChild("n35"));
  12199. this.n36 = (this.getChild("n36"));
  12200. }
  12201. }
  12202. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  12203. class ui_drawBtn extends fgui.GButton {
  12204. static createInstance() {
  12205. return (fgui.UIPackage.createObject("game", "drawBtn"));
  12206. }
  12207. onConstruct() {
  12208. this.c1 = this.getController("c1");
  12209. this.n2 = (this.getChild("n2"));
  12210. this.n1 = (this.getChild("n1"));
  12211. }
  12212. }
  12213. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  12214. class ui_Component43 extends fgui.GButton {
  12215. static createInstance() {
  12216. return (fgui.UIPackage.createObject("game", "Component43"));
  12217. }
  12218. onConstruct() {
  12219. this.n49 = (this.getChild("n49"));
  12220. }
  12221. }
  12222. ui_Component43.URL = "ui://isxx5ak7iveg434";
  12223. class ui_wordsDisplay extends fgui.GComponent {
  12224. static createInstance() {
  12225. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  12226. }
  12227. onConstruct() {
  12228. this.txt = (this.getChild("txt"));
  12229. this.n63 = (this.getChild("n63"));
  12230. }
  12231. }
  12232. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  12233. class ui_Component3 extends fgui.GComponent {
  12234. static createInstance() {
  12235. return (fgui.UIPackage.createObject("game", "Component3"));
  12236. }
  12237. onConstruct() {
  12238. this.n26 = (this.getChild("n26"));
  12239. this.n24 = (this.getChild("n24"));
  12240. this.nameTxt = (this.getChild("nameTxt"));
  12241. this.headRoot = (this.getChild("headRoot"));
  12242. }
  12243. }
  12244. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  12245. class ui_Component4 extends fgui.GComponent {
  12246. static createInstance() {
  12247. return (fgui.UIPackage.createObject("game", "Component4"));
  12248. }
  12249. onConstruct() {
  12250. this.headImg = (this.getChild("headImg"));
  12251. }
  12252. }
  12253. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  12254. class ui_Component7 extends fgui.GButton {
  12255. static createInstance() {
  12256. return (fgui.UIPackage.createObject("game", "Component7"));
  12257. }
  12258. onConstruct() {
  12259. this.n17 = (this.getChild("n17"));
  12260. }
  12261. }
  12262. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  12263. class ui_Component8 extends fgui.GButton {
  12264. static createInstance() {
  12265. return (fgui.UIPackage.createObject("game", "Component8"));
  12266. }
  12267. onConstruct() {
  12268. this.n19 = (this.getChild("n19"));
  12269. }
  12270. }
  12271. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  12272. class ui_Component9 extends fgui.GButton {
  12273. static createInstance() {
  12274. return (fgui.UIPackage.createObject("game", "Component9"));
  12275. }
  12276. onConstruct() {
  12277. this.n18 = (this.getChild("n18"));
  12278. }
  12279. }
  12280. ui_Component9.URL = "ui://isxx5ak7ixm43xs";
  12281. class ui_Component10 extends fgui.GButton {
  12282. static createInstance() {
  12283. return (fgui.UIPackage.createObject("game", "Component10"));
  12284. }
  12285. onConstruct() {
  12286. this.c1 = this.getController("c1");
  12287. this.n40 = (this.getChild("n40"));
  12288. }
  12289. }
  12290. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  12291. class ui_Component11 extends fgui.GButton {
  12292. static createInstance() {
  12293. return (fgui.UIPackage.createObject("game", "Component11"));
  12294. }
  12295. onConstruct() {
  12296. this.n34 = (this.getChild("n34"));
  12297. }
  12298. }
  12299. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  12300. class ui_Component12 extends fgui.GButton {
  12301. static createInstance() {
  12302. return (fgui.UIPackage.createObject("game", "Component12"));
  12303. }
  12304. onConstruct() {
  12305. this.n35 = (this.getChild("n35"));
  12306. }
  12307. }
  12308. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  12309. class ui_Component13 extends fgui.GButton {
  12310. static createInstance() {
  12311. return (fgui.UIPackage.createObject("game", "Component13"));
  12312. }
  12313. onConstruct() {
  12314. this.n27 = (this.getChild("n27"));
  12315. this.n36 = (this.getChild("n36"));
  12316. }
  12317. }
  12318. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  12319. class ui_Component16 extends fgui.GButton {
  12320. static createInstance() {
  12321. return (fgui.UIPackage.createObject("game", "Component16"));
  12322. }
  12323. onConstruct() {
  12324. }
  12325. }
  12326. ui_Component16.URL = "ui://isxx5ak7ixm43xz";
  12327. class ui_dh_js_tuowei extends fgui.GComponent {
  12328. static createInstance() {
  12329. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  12330. }
  12331. onConstruct() {
  12332. this.n19 = (this.getChild("n19"));
  12333. this.n18 = (this.getChild("n18"));
  12334. this.n0 = (this.getChild("n0"));
  12335. this.n3 = (this.getChild("n3"));
  12336. this.n4 = (this.getChild("n4"));
  12337. this.n5 = (this.getChild("n5"));
  12338. this.n6 = (this.getChild("n6"));
  12339. this.n8 = (this.getChild("n8"));
  12340. this.n9 = (this.getChild("n9"));
  12341. this.n10 = (this.getChild("n10"));
  12342. this.n11 = (this.getChild("n11"));
  12343. this.n12 = (this.getChild("n12"));
  12344. this.n13 = (this.getChild("n13"));
  12345. this.n14 = (this.getChild("n14"));
  12346. this.n15 = (this.getChild("n15"));
  12347. this.n20 = (this.getChild("n20"));
  12348. this.t0 = this.getTransition("t0");
  12349. this.t1 = this.getTransition("t1");
  12350. }
  12351. }
  12352. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  12353. class ui_dh_js_tw_g extends fgui.GComponent {
  12354. static createInstance() {
  12355. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  12356. }
  12357. onConstruct() {
  12358. this.n0 = (this.getChild("n0"));
  12359. this.n1 = (this.getChild("n1"));
  12360. this.t0 = this.getTransition("t0");
  12361. }
  12362. }
  12363. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  12364. class ui_dh_js_xingxing extends fgui.GComponent {
  12365. static createInstance() {
  12366. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  12367. }
  12368. onConstruct() {
  12369. this.n1 = (this.getChild("n1"));
  12370. this.n2 = (this.getChild("n2"));
  12371. this.n3 = (this.getChild("n3"));
  12372. this.n4 = (this.getChild("n4"));
  12373. this.n0 = (this.getChild("n0"));
  12374. this.t2 = this.getTransition("t2");
  12375. this.t1 = this.getTransition("t1");
  12376. }
  12377. }
  12378. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  12379. class ui_dh_zy_jiazai extends fgui.GComponent {
  12380. static createInstance() {
  12381. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  12382. }
  12383. onConstruct() {
  12384. this.c1 = this.getController("c1");
  12385. this.n0 = (this.getChild("n0"));
  12386. this.n1 = (this.getChild("n1"));
  12387. this.n2 = (this.getChild("n2"));
  12388. this.n4 = (this.getChild("n4"));
  12389. this.n5 = (this.getChild("n5"));
  12390. this.n6 = (this.getChild("n6"));
  12391. this.n8 = (this.getChild("n8"));
  12392. this.n7 = (this.getChild("n7"));
  12393. this.t0 = this.getTransition("t0");
  12394. }
  12395. }
  12396. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  12397. class ui_dh_js_xingxing2 extends fgui.GComponent {
  12398. static createInstance() {
  12399. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  12400. }
  12401. onConstruct() {
  12402. this.c1 = this.getController("c1");
  12403. this.n3 = (this.getChild("n3"));
  12404. this.n5 = (this.getChild("n5"));
  12405. this.n4 = (this.getChild("n4"));
  12406. this.n0 = (this.getChild("n0"));
  12407. this.n1 = (this.getChild("n1"));
  12408. this.n2 = (this.getChild("n2"));
  12409. }
  12410. }
  12411. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  12412. class ui_dh_js_tuowei2 extends fgui.GComponent {
  12413. static createInstance() {
  12414. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  12415. }
  12416. onConstruct() {
  12417. this.n19 = (this.getChild("n19"));
  12418. this.n21 = (this.getChild("n21"));
  12419. this.n0 = (this.getChild("n0"));
  12420. this.n3 = (this.getChild("n3"));
  12421. this.n4 = (this.getChild("n4"));
  12422. this.n5 = (this.getChild("n5"));
  12423. this.n6 = (this.getChild("n6"));
  12424. this.n8 = (this.getChild("n8"));
  12425. this.n9 = (this.getChild("n9"));
  12426. this.n10 = (this.getChild("n10"));
  12427. this.n11 = (this.getChild("n11"));
  12428. this.n12 = (this.getChild("n12"));
  12429. this.n13 = (this.getChild("n13"));
  12430. this.n14 = (this.getChild("n14"));
  12431. this.n15 = (this.getChild("n15"));
  12432. this.n23 = (this.getChild("n23"));
  12433. this.t0 = this.getTransition("t0");
  12434. this.t1 = this.getTransition("t1");
  12435. }
  12436. }
  12437. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  12438. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  12439. static createInstance() {
  12440. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  12441. }
  12442. onConstruct() {
  12443. this.n1 = (this.getChild("n1"));
  12444. this.n2 = (this.getChild("n2"));
  12445. this.t0 = this.getTransition("t0");
  12446. }
  12447. }
  12448. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  12449. class ui_dh_js_shibai_1 extends fgui.GComponent {
  12450. static createInstance() {
  12451. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  12452. }
  12453. onConstruct() {
  12454. this.n4 = (this.getChild("n4"));
  12455. this.n2 = (this.getChild("n2"));
  12456. this.n3 = (this.getChild("n3"));
  12457. this.idle = this.getTransition("idle");
  12458. this.attack = this.getTransition("attack");
  12459. }
  12460. }
  12461. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  12462. class ui_special extends fgui.GComponent {
  12463. static createInstance() {
  12464. return (fgui.UIPackage.createObject("game", "special"));
  12465. }
  12466. onConstruct() {
  12467. this.n18 = (this.getChild("n18"));
  12468. this.n19 = (this.getChild("n19"));
  12469. this.n20 = (this.getChild("n20"));
  12470. this.n21 = (this.getChild("n21"));
  12471. this.n22 = (this.getChild("n22"));
  12472. this.levelTxt = (this.getChild("levelTxt"));
  12473. this.n24 = (this.getChild("n24"));
  12474. this.n25 = (this.getChild("n25"));
  12475. this.t0 = this.getTransition("t0");
  12476. }
  12477. }
  12478. ui_special.URL = "ui://isxx5ak7j979v4i6";
  12479. class ui_Component145 extends fgui.GComponent {
  12480. static createInstance() {
  12481. return (fgui.UIPackage.createObject("game", "Component145"));
  12482. }
  12483. onConstruct() {
  12484. this.guanyuNode = (this.getChild("guanyuNode"));
  12485. }
  12486. }
  12487. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  12488. class ui_longBtn extends fgui.GButton {
  12489. static createInstance() {
  12490. return (fgui.UIPackage.createObject("game", "longBtn"));
  12491. }
  12492. onConstruct() {
  12493. this.c1 = this.getController("c1");
  12494. this.n2 = (this.getChild("n2"));
  12495. this.n1 = (this.getChild("n1"));
  12496. this.n4 = (this.getChild("n4"));
  12497. }
  12498. }
  12499. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  12500. class ui_Component146 extends fgui.GComponent {
  12501. static createInstance() {
  12502. return (fgui.UIPackage.createObject("game", "Component146"));
  12503. }
  12504. onConstruct() {
  12505. this.n89 = (this.getChild("n89"));
  12506. this.n90 = (this.getChild("n90"));
  12507. this.guideBtn = (this.getChild("guideBtn"));
  12508. }
  12509. }
  12510. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  12511. class ui_Component146_11 extends fgui.GComponent {
  12512. static createInstance() {
  12513. return (fgui.UIPackage.createObject("game", "Component146_11"));
  12514. }
  12515. onConstruct() {
  12516. this.n89 = (this.getChild("n89"));
  12517. this.n90 = (this.getChild("n90"));
  12518. this.guideBtn = (this.getChild("guideBtn"));
  12519. }
  12520. }
  12521. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  12522. class ui_Component111_1 extends fgui.GComponent {
  12523. static createInstance() {
  12524. return (fgui.UIPackage.createObject("game", "Component111_1"));
  12525. }
  12526. onConstruct() {
  12527. this.n68 = (this.getChild("n68"));
  12528. this.myMask = (this.getChild("myMask"));
  12529. }
  12530. }
  12531. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  12532. class ui_Component64_1 extends fgui.GComponent {
  12533. static createInstance() {
  12534. return (fgui.UIPackage.createObject("game", "Component64_1"));
  12535. }
  12536. onConstruct() {
  12537. this.n57 = (this.getChild("n57"));
  12538. this.n54 = (this.getChild("n54"));
  12539. this.n55 = (this.getChild("n55"));
  12540. this.n56 = (this.getChild("n56"));
  12541. this.t1 = this.getTransition("t1");
  12542. }
  12543. }
  12544. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  12545. class ui_ModeSelection_com123 extends fgui.GComponent {
  12546. static createInstance() {
  12547. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  12548. }
  12549. onConstruct() {
  12550. this.type1 = (this.getChild("type1"));
  12551. this.type2 = (this.getChild("type2"));
  12552. this.type3 = (this.getChild("type3"));
  12553. this.n38 = (this.getChild("n38"));
  12554. this.t0 = this.getTransition("t0");
  12555. }
  12556. }
  12557. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  12558. class ui_Component132_2 extends fgui.GComponent {
  12559. static createInstance() {
  12560. return (fgui.UIPackage.createObject("game", "Component132_2"));
  12561. }
  12562. onConstruct() {
  12563. this.n25 = (this.getChild("n25"));
  12564. this.n26 = (this.getChild("n26"));
  12565. this.n27 = (this.getChild("n27"));
  12566. this.t0 = this.getTransition("t0");
  12567. }
  12568. }
  12569. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  12570. class ui_UIPower$1 extends fgui.GComponent {
  12571. static createInstance() {
  12572. return (fgui.UIPackage.createObject("game", "UIPower"));
  12573. }
  12574. onConstruct() {
  12575. this.n11 = (this.getChild("n11"));
  12576. this.myNode = (this.getChild("myNode"));
  12577. this.t0 = this.getTransition("t0");
  12578. }
  12579. }
  12580. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  12581. class ui_Component133 extends fgui.GComponent {
  12582. static createInstance() {
  12583. return (fgui.UIPackage.createObject("game", "Component133"));
  12584. }
  12585. onConstruct() {
  12586. this.n29 = (this.getChild("n29"));
  12587. this.n30 = (this.getChild("n30"));
  12588. }
  12589. }
  12590. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  12591. class ui_Component134 extends fgui.GComponent {
  12592. static createInstance() {
  12593. return (fgui.UIPackage.createObject("game", "Component134"));
  12594. }
  12595. onConstruct() {
  12596. this.n30 = (this.getChild("n30"));
  12597. this.n31 = (this.getChild("n31"));
  12598. this.t0 = this.getTransition("t0");
  12599. }
  12600. }
  12601. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  12602. class ui_Component135 extends fgui.GComponent {
  12603. static createInstance() {
  12604. return (fgui.UIPackage.createObject("game", "Component135"));
  12605. }
  12606. onConstruct() {
  12607. this.n30 = (this.getChild("n30"));
  12608. this.t0 = this.getTransition("t0");
  12609. }
  12610. }
  12611. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  12612. class ui_Component137 extends fgui.GComponent {
  12613. static createInstance() {
  12614. return (fgui.UIPackage.createObject("game", "Component137"));
  12615. }
  12616. onConstruct() {
  12617. this.n28 = (this.getChild("n28"));
  12618. this.n29 = (this.getChild("n29"));
  12619. this.n30 = (this.getChild("n30"));
  12620. this.n32 = (this.getChild("n32"));
  12621. }
  12622. }
  12623. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  12624. class ui_dh_zuanshi extends fgui.GButton {
  12625. static createInstance() {
  12626. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  12627. }
  12628. onConstruct() {
  12629. this.n1 = (this.getChild("n1"));
  12630. this.n2 = (this.getChild("n2"));
  12631. this.n0 = (this.getChild("n0"));
  12632. this.n3 = (this.getChild("n3"));
  12633. this.n4 = (this.getChild("n4"));
  12634. }
  12635. }
  12636. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  12637. class ui_Component138 extends fgui.GComponent {
  12638. static createInstance() {
  12639. return (fgui.UIPackage.createObject("game", "Component138"));
  12640. }
  12641. onConstruct() {
  12642. this.n1 = (this.getChild("n1"));
  12643. this.n2 = (this.getChild("n2"));
  12644. this.t0 = this.getTransition("t0");
  12645. }
  12646. }
  12647. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  12648. class ui_Component139 extends fgui.GComponent {
  12649. static createInstance() {
  12650. return (fgui.UIPackage.createObject("game", "Component139"));
  12651. }
  12652. onConstruct() {
  12653. this.n0 = (this.getChild("n0"));
  12654. this.t0 = this.getTransition("t0");
  12655. }
  12656. }
  12657. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  12658. class ui_Component140 extends fgui.GComponent {
  12659. static createInstance() {
  12660. return (fgui.UIPackage.createObject("game", "Component140"));
  12661. }
  12662. onConstruct() {
  12663. this.n2 = (this.getChild("n2"));
  12664. this.n3 = (this.getChild("n3"));
  12665. this.t0 = this.getTransition("t0");
  12666. }
  12667. }
  12668. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  12669. class ui_Component141 extends fgui.GComponent {
  12670. static createInstance() {
  12671. return (fgui.UIPackage.createObject("game", "Component141"));
  12672. }
  12673. onConstruct() {
  12674. this.n0 = (this.getChild("n0"));
  12675. this.t0 = this.getTransition("t0");
  12676. }
  12677. }
  12678. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  12679. class ui_powerNode extends fgui.GProgressBar {
  12680. static createInstance() {
  12681. return (fgui.UIPackage.createObject("game", "powerNode"));
  12682. }
  12683. onConstruct() {
  12684. this.n2 = (this.getChild("n2"));
  12685. this.bar_v = (this.getChild("bar_v"));
  12686. this.showImg = (this.getChild("showImg"));
  12687. this.n12 = (this.getChild("n12"));
  12688. }
  12689. }
  12690. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  12691. class ui_dh_jingbi1 extends fgui.GComponent {
  12692. static createInstance() {
  12693. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  12694. }
  12695. onConstruct() {
  12696. this.n0 = (this.getChild("n0"));
  12697. this.n1 = (this.getChild("n1"));
  12698. this.n2 = (this.getChild("n2"));
  12699. this.n3 = (this.getChild("n3"));
  12700. this.n4 = (this.getChild("n4"));
  12701. this.n5 = (this.getChild("n5"));
  12702. this.n6 = (this.getChild("n6"));
  12703. this.n8 = (this.getChild("n8"));
  12704. this.t0 = this.getTransition("t0");
  12705. }
  12706. }
  12707. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  12708. class ui_Component94 extends fgui.GButton {
  12709. static createInstance() {
  12710. return (fgui.UIPackage.createObject("game", "Component94"));
  12711. }
  12712. onConstruct() {
  12713. this.n77 = (this.getChild("n77"));
  12714. }
  12715. }
  12716. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  12717. class ui_Component95 extends fgui.GButton {
  12718. static createInstance() {
  12719. return (fgui.UIPackage.createObject("game", "Component95"));
  12720. }
  12721. onConstruct() {
  12722. this.n77 = (this.getChild("n77"));
  12723. }
  12724. }
  12725. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  12726. class ui_Component126 extends fgui.GComponent {
  12727. static createInstance() {
  12728. return (fgui.UIPackage.createObject("game", "Component126"));
  12729. }
  12730. onConstruct() {
  12731. this.c1 = this.getController("c1");
  12732. this.normalBtn = (this.getChild("normalBtn"));
  12733. this.tripleBtn = (this.getChild("tripleBtn"));
  12734. }
  12735. }
  12736. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  12737. class ui_Component60 extends fgui.GComponent {
  12738. static createInstance() {
  12739. return (fgui.UIPackage.createObject("game", "Component60"));
  12740. }
  12741. onConstruct() {
  12742. this.c1 = this.getController("c1");
  12743. this.n48 = (this.getChild("n48"));
  12744. this.womanTxt = (this.getChild("womanTxt"));
  12745. this.t0 = this.getTransition("t0");
  12746. }
  12747. }
  12748. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  12749. class ui_Component98_3 extends fgui.GButton {
  12750. static createInstance() {
  12751. return (fgui.UIPackage.createObject("game", "Component98_3"));
  12752. }
  12753. onConstruct() {
  12754. this.c1 = this.getController("c1");
  12755. this.n8 = (this.getChild("n8"));
  12756. this.n41 = (this.getChild("n41"));
  12757. this.n40 = (this.getChild("n40"));
  12758. }
  12759. }
  12760. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  12761. class ui_ModeSelection_com1 extends fgui.GButton {
  12762. static createInstance() {
  12763. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  12764. }
  12765. onConstruct() {
  12766. this.n34 = (this.getChild("n34"));
  12767. this.n36 = (this.getChild("n36"));
  12768. this.n22 = (this.getChild("n22"));
  12769. this.n20 = (this.getChild("n20"));
  12770. this.n23 = (this.getChild("n23"));
  12771. this.n24 = (this.getChild("n24"));
  12772. this.n26 = (this.getChild("n26"));
  12773. this.n33 = (this.getChild("n33"));
  12774. this.coinImg = (this.getChild("coinImg"));
  12775. this.need = (this.getChild("need"));
  12776. this.n35 = (this.getChild("n35"));
  12777. this.n29 = (this.getChild("n29"));
  12778. this.tipsTxt = (this.getChild("tipsTxt"));
  12779. this.n30 = (this.getChild("n30"));
  12780. this.peopleTxt = (this.getChild("peopleTxt"));
  12781. this.t0 = this.getTransition("t0");
  12782. }
  12783. }
  12784. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  12785. class ui_ModeSelection_com2 extends fgui.GButton {
  12786. static createInstance() {
  12787. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  12788. }
  12789. onConstruct() {
  12790. this.n36 = (this.getChild("n36"));
  12791. this.n34 = (this.getChild("n34"));
  12792. this.n22 = (this.getChild("n22"));
  12793. this.n20 = (this.getChild("n20"));
  12794. this.n23 = (this.getChild("n23"));
  12795. this.n24 = (this.getChild("n24"));
  12796. this.n26 = (this.getChild("n26"));
  12797. this.n33 = (this.getChild("n33"));
  12798. this.coinImg = (this.getChild("coinImg"));
  12799. this.need = (this.getChild("need"));
  12800. this.n35 = (this.getChild("n35"));
  12801. this.n29 = (this.getChild("n29"));
  12802. this.tipsTxt = (this.getChild("tipsTxt"));
  12803. this.n30 = (this.getChild("n30"));
  12804. this.peopleTxt = (this.getChild("peopleTxt"));
  12805. this.t0 = this.getTransition("t0");
  12806. }
  12807. }
  12808. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  12809. class ui_ModeSelection_com3 extends fgui.GButton {
  12810. static createInstance() {
  12811. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  12812. }
  12813. onConstruct() {
  12814. this.n34 = (this.getChild("n34"));
  12815. this.n36 = (this.getChild("n36"));
  12816. this.n22 = (this.getChild("n22"));
  12817. this.n20 = (this.getChild("n20"));
  12818. this.n23 = (this.getChild("n23"));
  12819. this.n24 = (this.getChild("n24"));
  12820. this.n26 = (this.getChild("n26"));
  12821. this.n33 = (this.getChild("n33"));
  12822. this.coinImg = (this.getChild("coinImg"));
  12823. this.need = (this.getChild("need"));
  12824. this.n35 = (this.getChild("n35"));
  12825. this.n29 = (this.getChild("n29"));
  12826. this.tipsTxt = (this.getChild("tipsTxt"));
  12827. this.n30 = (this.getChild("n30"));
  12828. this.peopleTxt = (this.getChild("peopleTxt"));
  12829. this.t0 = this.getTransition("t0");
  12830. }
  12831. }
  12832. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  12833. class ui_Invitation_com1 extends fgui.GComponent {
  12834. static createInstance() {
  12835. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  12836. }
  12837. onConstruct() {
  12838. this.n14 = (this.getChild("n14"));
  12839. this.n13 = (this.getChild("n13"));
  12840. this.n3 = (this.getChild("n3"));
  12841. this.n1 = (this.getChild("n1"));
  12842. this.n6 = (this.getChild("n6"));
  12843. this.n7 = (this.getChild("n7"));
  12844. this.enterBtn = (this.getChild("enterBtn"));
  12845. this.n11 = (this.getChild("n11"));
  12846. this.n12 = (this.getChild("n12"));
  12847. this.n15 = (this.getChild("n15"));
  12848. this.t0 = this.getTransition("t0");
  12849. this.t1 = this.getTransition("t1");
  12850. }
  12851. }
  12852. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  12853. class ui_Component87_1 extends fgui.GComponent {
  12854. static createInstance() {
  12855. return (fgui.UIPackage.createObject("game", "Component87_1"));
  12856. }
  12857. onConstruct() {
  12858. this.n74 = (this.getChild("n74"));
  12859. this.n73 = (this.getChild("n73"));
  12860. this.ballTxt = (this.getChild("ballTxt"));
  12861. this.n76 = (this.getChild("n76"));
  12862. this.helpLineBtn = (this.getChild("helpLineBtn"));
  12863. this.levelTxt = (this.getChild("levelTxt"));
  12864. this.n87 = (this.getChild("n87"));
  12865. this.n84 = (this.getChild("n84"));
  12866. this.hpTxt = (this.getChild("hpTxt"));
  12867. this.n89 = (this.getChild("n89"));
  12868. this.tipsTxt = (this.getChild("tipsTxt"));
  12869. }
  12870. }
  12871. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  12872. class ui_sqg1 extends fgui.GComponent {
  12873. static createInstance() {
  12874. return (fgui.UIPackage.createObject("game", "sqg1"));
  12875. }
  12876. onConstruct() {
  12877. this.n1 = (this.getChild("n1"));
  12878. this.n0 = (this.getChild("n0"));
  12879. }
  12880. }
  12881. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  12882. class ui_sqg2 extends fgui.GComponent {
  12883. static createInstance() {
  12884. return (fgui.UIPackage.createObject("game", "sqg2"));
  12885. }
  12886. onConstruct() {
  12887. this.n1 = (this.getChild("n1"));
  12888. this.n0 = (this.getChild("n0"));
  12889. }
  12890. }
  12891. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  12892. class ui_sqg3 extends fgui.GComponent {
  12893. static createInstance() {
  12894. return (fgui.UIPackage.createObject("game", "sqg3"));
  12895. }
  12896. onConstruct() {
  12897. this.n1 = (this.getChild("n1"));
  12898. this.n0 = (this.getChild("n0"));
  12899. }
  12900. }
  12901. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  12902. class ui_sqg4 extends fgui.GComponent {
  12903. static createInstance() {
  12904. return (fgui.UIPackage.createObject("game", "sqg4"));
  12905. }
  12906. onConstruct() {
  12907. this.n1 = (this.getChild("n1"));
  12908. this.n0 = (this.getChild("n0"));
  12909. }
  12910. }
  12911. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  12912. class ui_Component36 extends fgui.GButton {
  12913. static createInstance() {
  12914. return (fgui.UIPackage.createObject("game", "Component36"));
  12915. }
  12916. onConstruct() {
  12917. this.c1 = this.getController("c1");
  12918. this.n53 = (this.getChild("n53"));
  12919. this.n56 = (this.getChild("n56"));
  12920. }
  12921. }
  12922. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  12923. class ui_Component37 extends fgui.GButton {
  12924. static createInstance() {
  12925. return (fgui.UIPackage.createObject("game", "Component37"));
  12926. }
  12927. onConstruct() {
  12928. this.c1 = this.getController("c1");
  12929. this.n52 = (this.getChild("n52"));
  12930. this.n54 = (this.getChild("n54"));
  12931. }
  12932. }
  12933. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  12934. class ui_UISetting extends fgui.GComponent {
  12935. static createInstance() {
  12936. return (fgui.UIPackage.createObject("game", "UISetting"));
  12937. }
  12938. onConstruct() {
  12939. this.c1 = this.getController("c1");
  12940. this.n4 = (this.getChild("n4"));
  12941. this.soundBtn = (this.getChild("soundBtn"));
  12942. this.shakeBtn = (this.getChild("shakeBtn"));
  12943. this.clickNode = (this.getChild("clickNode"));
  12944. this.xyBtn = (this.getChild("xyBtn"));
  12945. }
  12946. }
  12947. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  12948. class ui_Component39 extends fgui.GComponent {
  12949. static createInstance() {
  12950. return (fgui.UIPackage.createObject("game", "Component39"));
  12951. }
  12952. onConstruct() {
  12953. this.n5 = (this.getChild("n5"));
  12954. this.n6 = (this.getChild("n6"));
  12955. this.n7 = (this.getChild("n7"));
  12956. this.t0 = this.getTransition("t0");
  12957. }
  12958. }
  12959. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  12960. class ui_Component40 extends fgui.GButton {
  12961. static createInstance() {
  12962. return (fgui.UIPackage.createObject("game", "Component40"));
  12963. }
  12964. onConstruct() {
  12965. this.n46 = (this.getChild("n46"));
  12966. this.n47 = (this.getChild("n47"));
  12967. }
  12968. }
  12969. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  12970. class ui_Component41 extends fgui.GComponent {
  12971. static createInstance() {
  12972. return (fgui.UIPackage.createObject("game", "Component41"));
  12973. }
  12974. onConstruct() {
  12975. this.c1 = this.getController("c1");
  12976. this.n0 = (this.getChild("n0"));
  12977. this.titleTxt = (this.getChild("titleTxt"));
  12978. this.n2 = (this.getChild("n2"));
  12979. this.msgTips = (this.getChild("msgTips"));
  12980. this.numTxt = (this.getChild("numTxt"));
  12981. this.n18 = (this.getChild("n18"));
  12982. this.cancelBtn = (this.getChild("cancelBtn"));
  12983. this.videoBtn = (this.getChild("videoBtn"));
  12984. this.n10 = (this.getChild("n10"));
  12985. }
  12986. }
  12987. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  12988. class ui_Component42 extends fgui.GComponent {
  12989. static createInstance() {
  12990. return (fgui.UIPackage.createObject("game", "Component42"));
  12991. }
  12992. onConstruct() {
  12993. this.c1 = this.getController("c1");
  12994. this.n1 = (this.getChild("n1"));
  12995. this.n2 = (this.getChild("n2"));
  12996. this.n3 = (this.getChild("n3"));
  12997. this.tipsTxt = (this.getChild("tipsTxt"));
  12998. this.cancelBtn = (this.getChild("cancelBtn"));
  12999. this.sureBtn = (this.getChild("sureBtn"));
  13000. this.n11 = (this.getChild("n11"));
  13001. this.n13 = (this.getChild("n13"));
  13002. this.n14 = (this.getChild("n14"));
  13003. this.womanTxt = (this.getChild("womanTxt"));
  13004. this.t0 = this.getTransition("t0");
  13005. }
  13006. }
  13007. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  13008. class ui_dh_js_shengli extends fgui.GComponent {
  13009. static createInstance() {
  13010. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  13011. }
  13012. onConstruct() {
  13013. this.n3 = (this.getChild("n3"));
  13014. this.n4 = (this.getChild("n4"));
  13015. this.n1 = (this.getChild("n1"));
  13016. this.n2 = (this.getChild("n2"));
  13017. this.n5 = (this.getChild("n5"));
  13018. this.n6 = (this.getChild("n6"));
  13019. this.n7 = (this.getChild("n7"));
  13020. this.n8 = (this.getChild("n8"));
  13021. this.attack = this.getTransition("attack");
  13022. this.idle = this.getTransition("idle");
  13023. }
  13024. }
  13025. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  13026. class ui_dh_js_shengli_g extends fgui.GComponent {
  13027. static createInstance() {
  13028. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  13029. }
  13030. onConstruct() {
  13031. this.n3 = (this.getChild("n3"));
  13032. this.n1 = (this.getChild("n1"));
  13033. this.t0 = this.getTransition("t0");
  13034. }
  13035. }
  13036. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  13037. class ui_dh_js_shibai extends fgui.GComponent {
  13038. static createInstance() {
  13039. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  13040. }
  13041. onConstruct() {
  13042. this.n0 = (this.getChild("n0"));
  13043. this.n1 = (this.getChild("n1"));
  13044. this.n2 = (this.getChild("n2"));
  13045. this.n3 = (this.getChild("n3"));
  13046. this.idle = this.getTransition("idle");
  13047. this.attack = this.getTransition("attack");
  13048. }
  13049. }
  13050. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  13051. class ui_dh_zy_ganfa extends fgui.GButton {
  13052. static createInstance() {
  13053. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  13054. }
  13055. onConstruct() {
  13056. this.n0 = (this.getChild("n0"));
  13057. }
  13058. }
  13059. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  13060. class ui_dh_zy_sc_guang extends fgui.GButton {
  13061. static createInstance() {
  13062. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  13063. }
  13064. onConstruct() {
  13065. this.n0 = (this.getChild("n0"));
  13066. this.n2 = (this.getChild("n2"));
  13067. }
  13068. }
  13069. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  13070. class ui_dh_zy_shangcheng extends fgui.GComponent {
  13071. static createInstance() {
  13072. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  13073. }
  13074. onConstruct() {
  13075. this.n0 = (this.getChild("n0"));
  13076. this.n3 = (this.getChild("n3"));
  13077. this.t0 = this.getTransition("t0");
  13078. }
  13079. }
  13080. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  13081. class ui_dh_zy_wanfa extends fgui.GButton {
  13082. static createInstance() {
  13083. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  13084. }
  13085. onConstruct() {
  13086. this.n0 = (this.getChild("n0"));
  13087. }
  13088. }
  13089. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  13090. class ui_Component53_1 extends fgui.GComponent {
  13091. static createInstance() {
  13092. return (fgui.UIPackage.createObject("game", "Component53_1"));
  13093. }
  13094. onConstruct() {
  13095. this.n0 = (this.getChild("n0"));
  13096. this.n1 = (this.getChild("n1"));
  13097. this.n2 = (this.getChild("n2"));
  13098. this.n3 = (this.getChild("n3"));
  13099. this.n4 = (this.getChild("n4"));
  13100. this.n5 = (this.getChild("n5"));
  13101. this.n6 = (this.getChild("n6"));
  13102. this.n7 = (this.getChild("n7"));
  13103. this.n8 = (this.getChild("n8"));
  13104. this.n9 = (this.getChild("n9"));
  13105. this.n10 = (this.getChild("n10"));
  13106. this.n11 = (this.getChild("n11"));
  13107. this.n12 = (this.getChild("n12"));
  13108. this.n13 = (this.getChild("n13"));
  13109. this.n14 = (this.getChild("n14"));
  13110. this.n15 = (this.getChild("n15"));
  13111. this.n16 = (this.getChild("n16"));
  13112. this.n19 = (this.getChild("n19"));
  13113. this.n20 = (this.getChild("n20"));
  13114. this.n21 = (this.getChild("n21"));
  13115. this.n22 = (this.getChild("n22"));
  13116. this.n23 = (this.getChild("n23"));
  13117. this.n24 = (this.getChild("n24"));
  13118. this.n25 = (this.getChild("n25"));
  13119. this.n26 = (this.getChild("n26"));
  13120. this.n27 = (this.getChild("n27"));
  13121. this.n28 = (this.getChild("n28"));
  13122. this.n29 = (this.getChild("n29"));
  13123. this.n30 = (this.getChild("n30"));
  13124. this.n31 = (this.getChild("n31"));
  13125. this.n32 = (this.getChild("n32"));
  13126. this.n33 = (this.getChild("n33"));
  13127. this.n34 = (this.getChild("n34"));
  13128. this.n35 = (this.getChild("n35"));
  13129. this.t0 = this.getTransition("t0");
  13130. }
  13131. }
  13132. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  13133. class ui_Component30 extends fgui.GComponent {
  13134. static createInstance() {
  13135. return (fgui.UIPackage.createObject("game", "Component30"));
  13136. }
  13137. onConstruct() {
  13138. this.c1 = this.getController("c1");
  13139. this.n46 = (this.getChild("n46"));
  13140. this.n47 = (this.getChild("n47"));
  13141. this.numTxt = (this.getChild("numTxt"));
  13142. this.n50 = (this.getChild("n50"));
  13143. this.n53 = (this.getChild("n53"));
  13144. this.n54 = (this.getChild("n54"));
  13145. this.n55 = (this.getChild("n55"));
  13146. this.n56 = (this.getChild("n56"));
  13147. }
  13148. }
  13149. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  13150. class ui_Component30_1 extends fgui.GComponent {
  13151. static createInstance() {
  13152. return (fgui.UIPackage.createObject("game", "Component30_1"));
  13153. }
  13154. onConstruct() {
  13155. this.c1 = this.getController("c1");
  13156. this.n46 = (this.getChild("n46"));
  13157. this.n47 = (this.getChild("n47"));
  13158. this.numTxt = (this.getChild("numTxt"));
  13159. this.n50 = (this.getChild("n50"));
  13160. this.n51 = (this.getChild("n51"));
  13161. this.n52 = (this.getChild("n52"));
  13162. this.n53 = (this.getChild("n53"));
  13163. this.n54 = (this.getChild("n54"));
  13164. }
  13165. }
  13166. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  13167. class ui_Component31 extends fgui.GComponent {
  13168. static createInstance() {
  13169. return (fgui.UIPackage.createObject("game", "Component31"));
  13170. }
  13171. onConstruct() {
  13172. this.n55 = (this.getChild("n55"));
  13173. this.n54 = (this.getChild("n54"));
  13174. this.conditionTxt = (this.getChild("conditionTxt"));
  13175. this.n57 = (this.getChild("n57"));
  13176. this.t0 = this.getTransition("t0");
  13177. }
  13178. }
  13179. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  13180. class ui_Component32 extends fgui.GComponent {
  13181. static createInstance() {
  13182. return (fgui.UIPackage.createObject("game", "Component32"));
  13183. }
  13184. onConstruct() {
  13185. this.n5 = (this.getChild("n5"));
  13186. this.n6 = (this.getChild("n6"));
  13187. this.n7 = (this.getChild("n7"));
  13188. this.t0 = this.getTransition("t0");
  13189. }
  13190. }
  13191. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  13192. class ui_AwardItem extends fgui.GComponent {
  13193. static createInstance() {
  13194. return (fgui.UIPackage.createObject("game", "AwardItem"));
  13195. }
  13196. onConstruct() {
  13197. this.n9 = (this.getChild("n9"));
  13198. this.myIcon = (this.getChild("myIcon"));
  13199. this.numTxt = (this.getChild("numTxt"));
  13200. this.nameTxt = (this.getChild("nameTxt"));
  13201. this.n16 = (this.getChild("n16"));
  13202. this.n17 = (this.getChild("n17"));
  13203. }
  13204. }
  13205. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  13206. class ui_ranking_com1 extends fgui.GButton {
  13207. static createInstance() {
  13208. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  13209. }
  13210. onConstruct() {
  13211. this.c1 = this.getController("c1");
  13212. this.n49 = (this.getChild("n49"));
  13213. this.n18 = (this.getChild("n18"));
  13214. this.n46 = (this.getChild("n46"));
  13215. this.n48 = (this.getChild("n48"));
  13216. this.n50 = (this.getChild("n50"));
  13217. }
  13218. }
  13219. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  13220. class ui_ranking_com2 extends fgui.GButton {
  13221. static createInstance() {
  13222. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  13223. }
  13224. onConstruct() {
  13225. this.c1 = this.getController("c1");
  13226. this.n49 = (this.getChild("n49"));
  13227. this.n18 = (this.getChild("n18"));
  13228. this.n46 = (this.getChild("n46"));
  13229. this.n48 = (this.getChild("n48"));
  13230. this.n50 = (this.getChild("n50"));
  13231. }
  13232. }
  13233. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  13234. class ui_ranking_com3 extends fgui.GComponent {
  13235. static createInstance() {
  13236. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  13237. }
  13238. onConstruct() {
  13239. this.n17 = (this.getChild("n17"));
  13240. this.myIcon = (this.getChild("myIcon"));
  13241. }
  13242. }
  13243. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  13244. class ui_ranking_com4 extends fgui.GComponent {
  13245. static createInstance() {
  13246. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  13247. }
  13248. onConstruct() {
  13249. this.n16 = (this.getChild("n16"));
  13250. this.head = (this.getChild("head"));
  13251. }
  13252. }
  13253. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  13254. class ui_ranking_com5 extends fgui.GComponent {
  13255. static createInstance() {
  13256. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  13257. }
  13258. onConstruct() {
  13259. this.c1 = this.getController("c1");
  13260. this.c2 = this.getController("c2");
  13261. this.n2 = (this.getChild("n2"));
  13262. this.n3 = (this.getChild("n3"));
  13263. this.levelBtn = (this.getChild("levelBtn"));
  13264. this.starBtn = (this.getChild("starBtn"));
  13265. this.n23 = (this.getChild("n23"));
  13266. this.n24 = (this.getChild("n24"));
  13267. this.n25 = (this.getChild("n25"));
  13268. this.myList = (this.getChild("myList"));
  13269. this.selfNode = (this.getChild("selfNode"));
  13270. this.n9 = (this.getChild("n9"));
  13271. this.n12 = (this.getChild("n12"));
  13272. this.n13 = (this.getChild("n13"));
  13273. this.n14 = (this.getChild("n14"));
  13274. this.n39 = (this.getChild("n39"));
  13275. this.n41 = (this.getChild("n41"));
  13276. this.n42 = (this.getChild("n42"));
  13277. this.n45 = (this.getChild("n45"));
  13278. this.changeBtn = (this.getChild("changeBtn"));
  13279. this.closeBtn = (this.getChild("closeBtn"));
  13280. this.t0 = this.getTransition("t0");
  13281. }
  13282. }
  13283. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  13284. class ui_RankItem extends fgui.GComponent {
  13285. static createInstance() {
  13286. return (fgui.UIPackage.createObject("game", "RankItem"));
  13287. }
  13288. onConstruct() {
  13289. this.n10 = (this.getChild("n10"));
  13290. this.n11 = (this.getChild("n11"));
  13291. this.rankTxt = (this.getChild("rankTxt"));
  13292. this.headNode = (this.getChild("headNode"));
  13293. this.nameTxt = (this.getChild("nameTxt"));
  13294. this.n19 = (this.getChild("n19"));
  13295. this.valueTxt = (this.getChild("valueTxt"));
  13296. this.img1 = (this.getChild("img1"));
  13297. this.img2 = (this.getChild("img2"));
  13298. this.img3 = (this.getChild("img3"));
  13299. }
  13300. }
  13301. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  13302. class ui_ranking_com9 extends fgui.GComponent {
  13303. static createInstance() {
  13304. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  13305. }
  13306. onConstruct() {
  13307. this.c1 = this.getController("c1");
  13308. this.n27 = (this.getChild("n27"));
  13309. this.n28 = (this.getChild("n28"));
  13310. this.headNode = (this.getChild("headNode"));
  13311. this.rankTxt = (this.getChild("rankTxt"));
  13312. this.nameTxt = (this.getChild("nameTxt"));
  13313. this.n34 = (this.getChild("n34"));
  13314. this.valueTxt = (this.getChild("valueTxt"));
  13315. this.n36 = (this.getChild("n36"));
  13316. this.n37 = (this.getChild("n37"));
  13317. this.n38 = (this.getChild("n38"));
  13318. this.n39 = (this.getChild("n39"));
  13319. this.n40 = (this.getChild("n40"));
  13320. }
  13321. }
  13322. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  13323. class ui_ranking_com10 extends fgui.GComponent {
  13324. static createInstance() {
  13325. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  13326. }
  13327. onConstruct() {
  13328. this.n23 = (this.getChild("n23"));
  13329. this.n24 = (this.getChild("n24"));
  13330. }
  13331. }
  13332. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  13333. class ui_ranking_com11 extends fgui.GComponent {
  13334. static createInstance() {
  13335. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  13336. }
  13337. onConstruct() {
  13338. this.n24 = (this.getChild("n24"));
  13339. this.n25 = (this.getChild("n25"));
  13340. this.t0 = this.getTransition("t0");
  13341. }
  13342. }
  13343. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  13344. class ui_ranking_com13 extends fgui.GButton {
  13345. static createInstance() {
  13346. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  13347. }
  13348. onConstruct() {
  13349. this.c1 = this.getController("c1");
  13350. this.n44 = (this.getChild("n44"));
  13351. this.n45 = (this.getChild("n45"));
  13352. this.n46 = (this.getChild("n46"));
  13353. }
  13354. }
  13355. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  13356. class ui_Component122 extends fgui.GComponent {
  13357. static createInstance() {
  13358. return (fgui.UIPackage.createObject("game", "Component122"));
  13359. }
  13360. onConstruct() {
  13361. this.gameNode1 = (this.getChild("gameNode1"));
  13362. this.gameNode2 = (this.getChild("gameNode2"));
  13363. this.gameNode3 = (this.getChild("gameNode3"));
  13364. }
  13365. }
  13366. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  13367. class ui_skillItem extends fgui.GComponent {
  13368. static createInstance() {
  13369. return (fgui.UIPackage.createObject("game", "skillItem"));
  13370. }
  13371. onConstruct() {
  13372. this.c1 = this.getController("c1");
  13373. this.n31 = (this.getChild("n31"));
  13374. this.n6 = (this.getChild("n6"));
  13375. this.skillImg = (this.getChild("skillImg"));
  13376. this.nameTxt = (this.getChild("nameTxt"));
  13377. this.levelTxt = (this.getChild("levelTxt"));
  13378. this.n28 = (this.getChild("n28"));
  13379. this.describeTxt = (this.getChild("describeTxt"));
  13380. this.n32 = (this.getChild("n32"));
  13381. this.mutiBtn = (this.getChild("mutiBtn"));
  13382. this.tryNode = (this.getChild("tryNode"));
  13383. this.normalBtn = (this.getChild("normalBtn"));
  13384. this.startBtn = (this.getChild("startBtn"));
  13385. this.n42 = (this.getChild("n42"));
  13386. this.n43 = (this.getChild("n43"));
  13387. this.n44 = (this.getChild("n44"));
  13388. }
  13389. }
  13390. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  13391. class ui_Component26 extends fgui.GButton {
  13392. static createInstance() {
  13393. return (fgui.UIPackage.createObject("game", "Component26"));
  13394. }
  13395. onConstruct() {
  13396. this.n11 = (this.getChild("n11"));
  13397. this.n30 = (this.getChild("n30"));
  13398. this.n34 = (this.getChild("n34"));
  13399. }
  13400. }
  13401. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  13402. class ui_Component28 extends fgui.GButton {
  13403. static createInstance() {
  13404. return (fgui.UIPackage.createObject("game", "Component28"));
  13405. }
  13406. onConstruct() {
  13407. this.n12 = (this.getChild("n12"));
  13408. this.n31 = (this.getChild("n31"));
  13409. this.curTxt = (this.getChild("curTxt"));
  13410. this.n33 = (this.getChild("n33"));
  13411. }
  13412. }
  13413. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  13414. class ui_Component1302 extends fgui.GComponent {
  13415. static createInstance() {
  13416. return (fgui.UIPackage.createObject("game", "Component1302"));
  13417. }
  13418. onConstruct() {
  13419. this.n2 = (this.getChild("n2"));
  13420. this.n3 = (this.getChild("n3"));
  13421. }
  13422. }
  13423. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  13424. class ui_Component113 extends fgui.GComponent {
  13425. static createInstance() {
  13426. return (fgui.UIPackage.createObject("game", "Component113"));
  13427. }
  13428. onConstruct() {
  13429. this.n85 = (this.getChild("n85"));
  13430. this.n86 = (this.getChild("n86"));
  13431. this.n77 = (this.getChild("n77"));
  13432. this.n79 = (this.getChild("n79"));
  13433. this.n80 = (this.getChild("n80"));
  13434. this.n81 = (this.getChild("n81"));
  13435. this.n82 = (this.getChild("n82"));
  13436. this.n84 = (this.getChild("n84"));
  13437. this.n87 = (this.getChild("n87"));
  13438. this.t0 = this.getTransition("t0");
  13439. }
  13440. }
  13441. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  13442. class ui_Component114 extends fgui.GComponent {
  13443. static createInstance() {
  13444. return (fgui.UIPackage.createObject("game", "Component114"));
  13445. }
  13446. onConstruct() {
  13447. this.n77 = (this.getChild("n77"));
  13448. this.t0 = this.getTransition("t0");
  13449. }
  13450. }
  13451. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  13452. class ui_Component115 extends fgui.GComponent {
  13453. static createInstance() {
  13454. return (fgui.UIPackage.createObject("game", "Component115"));
  13455. }
  13456. onConstruct() {
  13457. this.n83 = (this.getChild("n83"));
  13458. this.fingerNode = (this.getChild("fingerNode"));
  13459. this.n84 = (this.getChild("n84"));
  13460. }
  13461. }
  13462. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  13463. class ui_Component117 extends fgui.GComponent {
  13464. static createInstance() {
  13465. return (fgui.UIPackage.createObject("game", "Component117"));
  13466. }
  13467. onConstruct() {
  13468. this.n87 = (this.getChild("n87"));
  13469. this.n88 = (this.getChild("n88"));
  13470. this.n84 = (this.getChild("n84"));
  13471. this.n85 = (this.getChild("n85"));
  13472. this.n86 = (this.getChild("n86"));
  13473. this.t0 = this.getTransition("t0");
  13474. }
  13475. }
  13476. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  13477. class ui_Component98_1 extends fgui.GButton {
  13478. static createInstance() {
  13479. return (fgui.UIPackage.createObject("game", "Component98_1"));
  13480. }
  13481. onConstruct() {
  13482. this.c1 = this.getController("c1");
  13483. this.n8 = (this.getChild("n8"));
  13484. this.n41 = (this.getChild("n41"));
  13485. this.n40 = (this.getChild("n40"));
  13486. }
  13487. }
  13488. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  13489. class ui_Component61 extends fgui.GComponent {
  13490. static createInstance() {
  13491. return (fgui.UIPackage.createObject("game", "Component61"));
  13492. }
  13493. onConstruct() {
  13494. this.n14 = (this.getChild("n14"));
  13495. this.n6 = (this.getChild("n6"));
  13496. this.t0 = this.getTransition("t0");
  13497. }
  13498. }
  13499. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  13500. class ui_Component62 extends fgui.GComponent {
  13501. static createInstance() {
  13502. return (fgui.UIPackage.createObject("game", "Component62"));
  13503. }
  13504. onConstruct() {
  13505. this.n66 = (this.getChild("n66"));
  13506. this.n56 = (this.getChild("n56"));
  13507. this.n63 = (this.getChild("n63"));
  13508. this.n65 = (this.getChild("n65"));
  13509. this.t0 = this.getTransition("t0");
  13510. }
  13511. }
  13512. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  13513. class ui_d3Root extends fgui.GComponent {
  13514. static createInstance() {
  13515. return (fgui.UIPackage.createObject("game", "d3Root"));
  13516. }
  13517. onConstruct() {
  13518. }
  13519. }
  13520. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  13521. class ui_d2Root extends fgui.GComponent {
  13522. static createInstance() {
  13523. return (fgui.UIPackage.createObject("game", "d2Root"));
  13524. }
  13525. onConstruct() {
  13526. }
  13527. }
  13528. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  13529. class ui_ballNode extends fgui.GComponent {
  13530. static createInstance() {
  13531. return (fgui.UIPackage.createObject("game", "ballNode"));
  13532. }
  13533. onConstruct() {
  13534. }
  13535. }
  13536. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  13537. class ui_border extends fgui.GComponent {
  13538. static createInstance() {
  13539. return (fgui.UIPackage.createObject("game", "border"));
  13540. }
  13541. onConstruct() {
  13542. this.bar1 = (this.getChild("bar1"));
  13543. this.bar2 = (this.getChild("bar2"));
  13544. this.bar3 = (this.getChild("bar3"));
  13545. this.bar4 = (this.getChild("bar4"));
  13546. this.bar5 = (this.getChild("bar5"));
  13547. this.bar6 = (this.getChild("bar6"));
  13548. this.circle1 = (this.getChild("circle1"));
  13549. this.circle2 = (this.getChild("circle2"));
  13550. this.circle3 = (this.getChild("circle3"));
  13551. this.circle4 = (this.getChild("circle4"));
  13552. this.circle5 = (this.getChild("circle5"));
  13553. this.circle6 = (this.getChild("circle6"));
  13554. this.n28 = (this.getChild("n28"));
  13555. }
  13556. }
  13557. ui_border.URL = "ui://isxx5ak7sdh33qq";
  13558. class ui_Component41_2 extends fgui.GComponent {
  13559. static createInstance() {
  13560. return (fgui.UIPackage.createObject("game", "Component41_2"));
  13561. }
  13562. onConstruct() {
  13563. this.c1 = this.getController("c1");
  13564. this.n0 = (this.getChild("n0"));
  13565. this.n2 = (this.getChild("n2"));
  13566. this.n19 = (this.getChild("n19"));
  13567. this.cancelBtn = (this.getChild("cancelBtn"));
  13568. this.videoBtn = (this.getChild("videoBtn"));
  13569. this.n9 = (this.getChild("n9"));
  13570. this.n22 = (this.getChild("n22"));
  13571. this.tipsTxt = (this.getChild("tipsTxt"));
  13572. this.n23 = (this.getChild("n23"));
  13573. this.n24 = (this.getChild("n24"));
  13574. this.n26 = (this.getChild("n26"));
  13575. this.n27 = (this.getChild("n27"));
  13576. this.titleTxt = (this.getChild("titleTxt"));
  13577. }
  13578. }
  13579. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  13580. class ui_Component41_1 extends fgui.GComponent {
  13581. static createInstance() {
  13582. return (fgui.UIPackage.createObject("game", "Component41_1"));
  13583. }
  13584. onConstruct() {
  13585. this.c1 = this.getController("c1");
  13586. this.n0 = (this.getChild("n0"));
  13587. this.n2 = (this.getChild("n2"));
  13588. this.cancelBtn = (this.getChild("cancelBtn"));
  13589. this.videoBtn = (this.getChild("videoBtn"));
  13590. this.n27 = (this.getChild("n27"));
  13591. this.n30 = (this.getChild("n30"));
  13592. this.n31 = (this.getChild("n31"));
  13593. this.n32 = (this.getChild("n32"));
  13594. this.n33 = (this.getChild("n33"));
  13595. this.n34 = (this.getChild("n34"));
  13596. this.n35 = (this.getChild("n35"));
  13597. this.n36 = (this.getChild("n36"));
  13598. this.n1 = (this.getChild("n1"));
  13599. this.n37 = (this.getChild("n37"));
  13600. this.t0 = this.getTransition("t0");
  13601. this.t1 = this.getTransition("t1");
  13602. this.t2 = this.getTransition("t2");
  13603. this.t3 = this.getTransition("t3");
  13604. }
  13605. }
  13606. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  13607. class ui_againBtn extends fgui.GButton {
  13608. static createInstance() {
  13609. return (fgui.UIPackage.createObject("game", "againBtn"));
  13610. }
  13611. onConstruct() {
  13612. this.n2 = (this.getChild("n2"));
  13613. this.n1 = (this.getChild("n1"));
  13614. this.n5 = (this.getChild("n5"));
  13615. }
  13616. }
  13617. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  13618. class ui_Component118 extends fgui.GButton {
  13619. static createInstance() {
  13620. return (fgui.UIPackage.createObject("game", "Component118"));
  13621. }
  13622. onConstruct() {
  13623. this.c1 = this.getController("c1");
  13624. this.n14 = (this.getChild("n14"));
  13625. this.n9 = (this.getChild("n9"));
  13626. this.n10 = (this.getChild("n10"));
  13627. this.diamondTxt = (this.getChild("diamondTxt"));
  13628. this.n13 = (this.getChild("n13"));
  13629. this.n15 = (this.getChild("n15"));
  13630. }
  13631. }
  13632. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  13633. class ui_Component119 extends fgui.GComponent {
  13634. static createInstance() {
  13635. return (fgui.UIPackage.createObject("game", "Component119"));
  13636. }
  13637. onConstruct() {
  13638. this.n1 = (this.getChild("n1"));
  13639. this.n2 = (this.getChild("n2"));
  13640. this.n13 = (this.getChild("n13"));
  13641. this.n6 = (this.getChild("n6"));
  13642. this.screenNode = (this.getChild("screenNode"));
  13643. this.n15 = (this.getChild("n15"));
  13644. this.closeBtn = (this.getChild("closeBtn"));
  13645. this.share2Btn = (this.getChild("share2Btn"));
  13646. this.shareBtn = (this.getChild("shareBtn"));
  13647. this.tipsNode = (this.getChild("tipsNode"));
  13648. this.awardNode = (this.getChild("awardNode"));
  13649. }
  13650. }
  13651. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  13652. class ui_Component132_1 extends fgui.GComponent {
  13653. static createInstance() {
  13654. return (fgui.UIPackage.createObject("game", "Component132_1"));
  13655. }
  13656. onConstruct() {
  13657. this.n25 = (this.getChild("n25"));
  13658. this.n26 = (this.getChild("n26"));
  13659. this.n27 = (this.getChild("n27"));
  13660. this.t0 = this.getTransition("t0");
  13661. }
  13662. }
  13663. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  13664. class ui_SecretaryDisplay extends fgui.GComponent {
  13665. static createInstance() {
  13666. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  13667. }
  13668. onConstruct() {
  13669. this.n2 = (this.getChild("n2"));
  13670. this.levelTxt = (this.getChild("levelTxt"));
  13671. this.n4 = (this.getChild("n4"));
  13672. this.secretary = (this.getChild("secretary"));
  13673. this.purchaseBtn = (this.getChild("purchaseBtn"));
  13674. this.n16 = (this.getChild("n16"));
  13675. this.n37 = (this.getChild("n37"));
  13676. this.n41 = (this.getChild("n41"));
  13677. this.n14 = (this.getChild("n14"));
  13678. this.n17 = (this.getChild("n17"));
  13679. this.heightTxt = (this.getChild("heightTxt"));
  13680. this.n46 = (this.getChild("n46"));
  13681. this.n36 = (this.getChild("n36"));
  13682. this.n38 = (this.getChild("n38"));
  13683. this.foodTxt = (this.getChild("foodTxt"));
  13684. this.n47 = (this.getChild("n47"));
  13685. this.n40 = (this.getChild("n40"));
  13686. this.n42 = (this.getChild("n42"));
  13687. this.historyTxt = (this.getChild("historyTxt"));
  13688. this.n48 = (this.getChild("n48"));
  13689. this.nameImg = (this.getChild("nameImg"));
  13690. this.n12 = (this.getChild("n12"));
  13691. this.n49 = (this.getChild("n49"));
  13692. this.t0 = this.getTransition("t0");
  13693. }
  13694. }
  13695. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  13696. class ui_BallRodDisplay extends fgui.GComponent {
  13697. static createInstance() {
  13698. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  13699. }
  13700. onConstruct() {
  13701. this.c1 = this.getController("c1");
  13702. this.n31 = (this.getChild("n31"));
  13703. this.n6 = (this.getChild("n6"));
  13704. this.nameTxt = (this.getChild("nameTxt"));
  13705. this.rodImg = (this.getChild("rodImg"));
  13706. this.levelNode = (this.getChild("levelNode"));
  13707. this.eftRod = (this.getChild("eftRod"));
  13708. this.purchaseBtn = (this.getChild("purchaseBtn"));
  13709. }
  13710. }
  13711. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  13712. class ui_Component111_11 extends fgui.GComponent {
  13713. static createInstance() {
  13714. return (fgui.UIPackage.createObject("game", "Component111_11"));
  13715. }
  13716. onConstruct() {
  13717. this.n68 = (this.getChild("n68"));
  13718. this.n69 = (this.getChild("n69"));
  13719. }
  13720. }
  13721. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  13722. class ui_Component112 extends fgui.GComponent {
  13723. static createInstance() {
  13724. return (fgui.UIPackage.createObject("game", "Component112"));
  13725. }
  13726. onConstruct() {
  13727. this.n68 = (this.getChild("n68"));
  13728. this.n70 = (this.getChild("n70"));
  13729. this.myMask = (this.getChild("myMask"));
  13730. }
  13731. }
  13732. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  13733. class ui_Component111 extends fgui.GComponent {
  13734. static createInstance() {
  13735. return (fgui.UIPackage.createObject("game", "Component111"));
  13736. }
  13737. onConstruct() {
  13738. this.n68 = (this.getChild("n68"));
  13739. this.myMask = (this.getChild("myMask"));
  13740. }
  13741. }
  13742. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  13743. class ui_Component144 extends fgui.GButton {
  13744. static createInstance() {
  13745. return (fgui.UIPackage.createObject("game", "Component144"));
  13746. }
  13747. onConstruct() {
  13748. this.n8 = (this.getChild("n8"));
  13749. }
  13750. }
  13751. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  13752. class ui_Sign_com2 extends fgui.GComponent {
  13753. static createInstance() {
  13754. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  13755. }
  13756. onConstruct() {
  13757. this.n0 = (this.getChild("n0"));
  13758. this.n1 = (this.getChild("n1"));
  13759. this.t0 = this.getTransition("t0");
  13760. }
  13761. }
  13762. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  13763. class ui_Sign_guang extends fgui.GComponent {
  13764. static createInstance() {
  13765. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  13766. }
  13767. onConstruct() {
  13768. this.n1 = (this.getChild("n1"));
  13769. this.n2 = (this.getChild("n2"));
  13770. this.n3 = (this.getChild("n3"));
  13771. this.n4 = (this.getChild("n4"));
  13772. this.n5 = (this.getChild("n5"));
  13773. this.n6 = (this.getChild("n6"));
  13774. this.n8 = (this.getChild("n8"));
  13775. }
  13776. }
  13777. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  13778. class ui_SignMax extends fgui.GComponent {
  13779. static createInstance() {
  13780. return (fgui.UIPackage.createObject("game", "SignMax"));
  13781. }
  13782. onConstruct() {
  13783. this.c1 = this.getController("c1");
  13784. this.n7 = (this.getChild("n7"));
  13785. this.n15 = (this.getChild("n15"));
  13786. this.n8 = (this.getChild("n8"));
  13787. this.titleTxt = (this.getChild("titleTxt"));
  13788. this.myIcon1 = (this.getChild("myIcon1"));
  13789. this.numTxt1 = (this.getChild("numTxt1"));
  13790. this.myIcon2 = (this.getChild("myIcon2"));
  13791. this.n20 = (this.getChild("n20"));
  13792. this.n17 = (this.getChild("n17"));
  13793. this.numTxt2 = (this.getChild("numTxt2"));
  13794. this.n12 = (this.getChild("n12"));
  13795. this.n13 = (this.getChild("n13"));
  13796. this.n21 = (this.getChild("n21"));
  13797. this.n14 = (this.getChild("n14"));
  13798. }
  13799. }
  13800. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  13801. class ui_Sign_com2_1 extends fgui.GComponent {
  13802. static createInstance() {
  13803. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  13804. }
  13805. onConstruct() {
  13806. this.n0 = (this.getChild("n0"));
  13807. this.n1 = (this.getChild("n1"));
  13808. this.t0 = this.getTransition("t0");
  13809. }
  13810. }
  13811. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  13812. class ui_Sign_com5 extends fgui.GComponent {
  13813. static createInstance() {
  13814. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  13815. }
  13816. onConstruct() {
  13817. this.n3 = (this.getChild("n3"));
  13818. this.n29 = (this.getChild("n29"));
  13819. this.n4 = (this.getChild("n4"));
  13820. this.day1 = (this.getChild("day1"));
  13821. this.day2 = (this.getChild("day2"));
  13822. this.day3 = (this.getChild("day3"));
  13823. this.day4 = (this.getChild("day4"));
  13824. this.day5 = (this.getChild("day5"));
  13825. this.day6 = (this.getChild("day6"));
  13826. this.day7 = (this.getChild("day7"));
  13827. this.t0 = this.getTransition("t0");
  13828. }
  13829. }
  13830. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  13831. class ui_Sign_com8 extends fgui.GComponent {
  13832. static createInstance() {
  13833. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  13834. }
  13835. onConstruct() {
  13836. this.n48 = (this.getChild("n48"));
  13837. this.womanTxt = (this.getChild("womanTxt"));
  13838. this.t0 = this.getTransition("t0");
  13839. }
  13840. }
  13841. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  13842. class ui_Sign_com6 extends fgui.GComponent {
  13843. static createInstance() {
  13844. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  13845. }
  13846. onConstruct() {
  13847. this.n2 = (this.getChild("n2"));
  13848. this.n3 = (this.getChild("n3"));
  13849. this.t0 = this.getTransition("t0");
  13850. }
  13851. }
  13852. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  13853. class ui_Sign_com7 extends fgui.GComponent {
  13854. static createInstance() {
  13855. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  13856. }
  13857. onConstruct() {
  13858. this.n29 = (this.getChild("n29"));
  13859. this.n2 = (this.getChild("n2"));
  13860. }
  13861. }
  13862. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  13863. class ui_UITurntable_com1_2 extends fgui.GComponent {
  13864. static createInstance() {
  13865. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  13866. }
  13867. onConstruct() {
  13868. this.n5 = (this.getChild("n5"));
  13869. this.n4 = (this.getChild("n4"));
  13870. this.t0 = this.getTransition("t0");
  13871. }
  13872. }
  13873. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  13874. class ui_UITurntable_com2 extends fgui.GComponent {
  13875. static createInstance() {
  13876. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  13877. }
  13878. onConstruct() {
  13879. this.c1 = this.getController("c1");
  13880. this.n4 = (this.getChild("n4"));
  13881. this.n6 = (this.getChild("n6"));
  13882. this.n10 = (this.getChild("n10"));
  13883. this.n11 = (this.getChild("n11"));
  13884. this.n12 = (this.getChild("n12"));
  13885. this.n13 = (this.getChild("n13"));
  13886. this.n14 = (this.getChild("n14"));
  13887. this.n15 = (this.getChild("n15"));
  13888. this.n16 = (this.getChild("n16"));
  13889. this.n17 = (this.getChild("n17"));
  13890. this.n18 = (this.getChild("n18"));
  13891. this.n19 = (this.getChild("n19"));
  13892. this.n20 = (this.getChild("n20"));
  13893. this.n21 = (this.getChild("n21"));
  13894. this.n22 = (this.getChild("n22"));
  13895. this.n23 = (this.getChild("n23"));
  13896. this.n24 = (this.getChild("n24"));
  13897. this.n25 = (this.getChild("n25"));
  13898. this.n26 = (this.getChild("n26"));
  13899. this.n27 = (this.getChild("n27"));
  13900. this.n28 = (this.getChild("n28"));
  13901. this.n29 = (this.getChild("n29"));
  13902. this.n30 = (this.getChild("n30"));
  13903. this.n31 = (this.getChild("n31"));
  13904. this.n32 = (this.getChild("n32"));
  13905. this.n33 = (this.getChild("n33"));
  13906. }
  13907. }
  13908. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  13909. class ui_UITurntable_com1_1 extends fgui.GComponent {
  13910. static createInstance() {
  13911. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  13912. }
  13913. onConstruct() {
  13914. this.n5 = (this.getChild("n5"));
  13915. this.n4 = (this.getChild("n4"));
  13916. this.t0 = this.getTransition("t0");
  13917. }
  13918. }
  13919. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  13920. class ui_UITurntable_com5 extends fgui.GComponent {
  13921. static createInstance() {
  13922. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  13923. }
  13924. onConstruct() {
  13925. this.flashNode = (this.getChild("flashNode"));
  13926. this.rotNode = (this.getChild("rotNode"));
  13927. this.n3 = (this.getChild("n3"));
  13928. this.n21 = (this.getChild("n21"));
  13929. this.t0 = this.getTransition("t0");
  13930. }
  13931. }
  13932. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  13933. class ui_UITurntable_com7 extends fgui.GComponent {
  13934. static createInstance() {
  13935. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  13936. }
  13937. onConstruct() {
  13938. this.n2 = (this.getChild("n2"));
  13939. this.n35 = (this.getChild("n35"));
  13940. this.img1 = (this.getChild("img1"));
  13941. this.img2 = (this.getChild("img2"));
  13942. this.img3 = (this.getChild("img3"));
  13943. this.img4 = (this.getChild("img4"));
  13944. this.img6 = (this.getChild("img6"));
  13945. this.img5 = (this.getChild("img5"));
  13946. this.txt1 = (this.getChild("txt1"));
  13947. this.txt2 = (this.getChild("txt2"));
  13948. this.txt3 = (this.getChild("txt3"));
  13949. this.txt4 = (this.getChild("txt4"));
  13950. this.txt5 = (this.getChild("txt5"));
  13951. this.txt6 = (this.getChild("txt6"));
  13952. }
  13953. }
  13954. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  13955. class ui_UITurntable_com9 extends fgui.GComponent {
  13956. static createInstance() {
  13957. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  13958. }
  13959. onConstruct() {
  13960. this.n38 = (this.getChild("n38"));
  13961. this.n39 = (this.getChild("n39"));
  13962. }
  13963. }
  13964. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  13965. class ui_UITurntable_com10 extends fgui.GComponent {
  13966. static createInstance() {
  13967. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  13968. }
  13969. onConstruct() {
  13970. this.n39 = (this.getChild("n39"));
  13971. this.n40 = (this.getChild("n40"));
  13972. this.t0 = this.getTransition("t0");
  13973. }
  13974. }
  13975. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  13976. class ui_UITurntable_com11 extends fgui.GComponent {
  13977. static createInstance() {
  13978. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  13979. }
  13980. onConstruct() {
  13981. this.n38 = (this.getChild("n38"));
  13982. this.n39 = (this.getChild("n39"));
  13983. this.n40 = (this.getChild("n40"));
  13984. this.t0 = this.getTransition("t0");
  13985. }
  13986. }
  13987. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  13988. class ui_UITurntable_com12 extends fgui.GComponent {
  13989. static createInstance() {
  13990. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  13991. }
  13992. onConstruct() {
  13993. this.n43 = (this.getChild("n43"));
  13994. this.barNode = (this.getChild("barNode"));
  13995. this.tipsTxt = (this.getChild("tipsTxt"));
  13996. this.n45 = (this.getChild("n45"));
  13997. this.boxBtn = (this.getChild("boxBtn"));
  13998. }
  13999. }
  14000. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  14001. class ui_UITurntable_com1 extends fgui.GButton {
  14002. static createInstance() {
  14003. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  14004. }
  14005. onConstruct() {
  14006. this.n41 = (this.getChild("n41"));
  14007. this.n42 = (this.getChild("n42"));
  14008. this.t0 = this.getTransition("t0");
  14009. }
  14010. }
  14011. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  14012. class ui_UITurntable_com3 extends fgui.GComponent {
  14013. static createInstance() {
  14014. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  14015. }
  14016. onConstruct() {
  14017. this.n48 = (this.getChild("n48"));
  14018. this.womanTxt = (this.getChild("womanTxt"));
  14019. this.t0 = this.getTransition("t0");
  14020. }
  14021. }
  14022. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  14023. class ui_cancelBtn2 extends fgui.GButton {
  14024. static createInstance() {
  14025. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  14026. }
  14027. onConstruct() {
  14028. this.c1 = this.getController("c1");
  14029. this.n0 = (this.getChild("n0"));
  14030. this.n1 = (this.getChild("n1"));
  14031. this.n2 = (this.getChild("n2"));
  14032. this.n3 = (this.getChild("n3"));
  14033. this.n4 = (this.getChild("n4"));
  14034. this.n5 = (this.getChild("n5"));
  14035. this.n6 = (this.getChild("n6"));
  14036. this.n7 = (this.getChild("n7"));
  14037. this.n8 = (this.getChild("n8"));
  14038. this.powerEft = (this.getChild("powerEft"));
  14039. }
  14040. }
  14041. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  14042. class ui_shareBtn2 extends fgui.GButton {
  14043. static createInstance() {
  14044. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  14045. }
  14046. onConstruct() {
  14047. this.c1 = this.getController("c1");
  14048. this.n2 = (this.getChild("n2"));
  14049. this.n24 = (this.getChild("n24"));
  14050. this.n1 = (this.getChild("n1"));
  14051. this.n3 = (this.getChild("n3"));
  14052. this.n23 = (this.getChild("n23"));
  14053. this.n4 = (this.getChild("n4"));
  14054. this.n5 = (this.getChild("n5"));
  14055. this.n6 = (this.getChild("n6"));
  14056. this.n20 = (this.getChild("n20"));
  14057. this.n21 = (this.getChild("n21"));
  14058. this.n22 = (this.getChild("n22"));
  14059. this.powerEft = (this.getChild("powerEft"));
  14060. }
  14061. }
  14062. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  14063. class ui_UIMoney extends fgui.GComponent {
  14064. static createInstance() {
  14065. return (fgui.UIPackage.createObject("game", "UIMoney"));
  14066. }
  14067. onConstruct() {
  14068. this.c1 = this.getController("c1");
  14069. this.n4 = (this.getChild("n4"));
  14070. this.coinImg = (this.getChild("coinImg"));
  14071. this.addCoinBtn = (this.getChild("addCoinBtn"));
  14072. this.coinTxt = (this.getChild("coinTxt"));
  14073. this.n7 = (this.getChild("n7"));
  14074. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  14075. this.diamondTxt = (this.getChild("diamondTxt"));
  14076. this.diamondImg = (this.getChild("diamondImg"));
  14077. this.n12 = (this.getChild("n12"));
  14078. this.powerImg = (this.getChild("powerImg"));
  14079. this.addPowerBtn = (this.getChild("addPowerBtn"));
  14080. this.powerTxt = (this.getChild("powerTxt"));
  14081. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  14082. }
  14083. }
  14084. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  14085. class ui_backBtn extends fgui.GButton {
  14086. static createInstance() {
  14087. return (fgui.UIPackage.createObject("game", "backBtn"));
  14088. }
  14089. onConstruct() {
  14090. this.n0 = (this.getChild("n0"));
  14091. this.t0 = this.getTransition("t0");
  14092. this.t1 = this.getTransition("t1");
  14093. }
  14094. }
  14095. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  14096. class ui_MoneyBtn extends fgui.GButton {
  14097. static createInstance() {
  14098. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  14099. }
  14100. onConstruct() {
  14101. this.button = this.getController("button");
  14102. this.n0 = (this.getChild("n0"));
  14103. }
  14104. }
  14105. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  14106. class ui_UIMoneyBtn extends fgui.GComponent {
  14107. static createInstance() {
  14108. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  14109. }
  14110. onConstruct() {
  14111. this.n1 = (this.getChild("n1"));
  14112. this.closeBtn = (this.getChild("closeBtn"));
  14113. }
  14114. }
  14115. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  14116. class ui_Component64 extends fgui.GComponent {
  14117. static createInstance() {
  14118. return (fgui.UIPackage.createObject("game", "Component64"));
  14119. }
  14120. onConstruct() {
  14121. this.n57 = (this.getChild("n57"));
  14122. this.n54 = (this.getChild("n54"));
  14123. this.n55 = (this.getChild("n55"));
  14124. this.n56 = (this.getChild("n56"));
  14125. this.t1 = this.getTransition("t1");
  14126. }
  14127. }
  14128. ui_Component64.URL = "ui://isxx5ak7wp26456";
  14129. class ui_Component41_3 extends fgui.GComponent {
  14130. static createInstance() {
  14131. return (fgui.UIPackage.createObject("game", "Component41_3"));
  14132. }
  14133. onConstruct() {
  14134. this.c1 = this.getController("c1");
  14135. this.n0 = (this.getChild("n0"));
  14136. this.n2 = (this.getChild("n2"));
  14137. this.cancelBtn = (this.getChild("cancelBtn"));
  14138. this.videoBtn = (this.getChild("videoBtn"));
  14139. this.n9 = (this.getChild("n9"));
  14140. this.n24 = (this.getChild("n24"));
  14141. this.n27 = (this.getChild("n27"));
  14142. this.titleTxt = (this.getChild("titleTxt"));
  14143. this.n28 = (this.getChild("n28"));
  14144. this.t0 = this.getTransition("t0");
  14145. }
  14146. }
  14147. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  14148. class ui_dh_zs_4 extends fgui.GComponent {
  14149. static createInstance() {
  14150. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  14151. }
  14152. onConstruct() {
  14153. this.n1 = (this.getChild("n1"));
  14154. this.n2 = (this.getChild("n2"));
  14155. this.n3 = (this.getChild("n3"));
  14156. this.n4 = (this.getChild("n4"));
  14157. this.n5 = (this.getChild("n5"));
  14158. this.n6 = (this.getChild("n6"));
  14159. this.n8 = (this.getChild("n8"));
  14160. this.t0 = this.getTransition("t0");
  14161. }
  14162. }
  14163. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  14164. class ui_Component71_1 extends fgui.GButton {
  14165. static createInstance() {
  14166. return (fgui.UIPackage.createObject("game", "Component71_1"));
  14167. }
  14168. onConstruct() {
  14169. this.n17 = (this.getChild("n17"));
  14170. this.t0 = this.getTransition("t0");
  14171. }
  14172. }
  14173. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  14174. class ui_Component83 extends fgui.GComponent {
  14175. static createInstance() {
  14176. return (fgui.UIPackage.createObject("game", "Component83"));
  14177. }
  14178. onConstruct() {
  14179. this.c1 = this.getController("c1");
  14180. this.n17 = (this.getChild("n17"));
  14181. this.n19 = (this.getChild("n19"));
  14182. this.n20 = (this.getChild("n20"));
  14183. }
  14184. }
  14185. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  14186. class ui_Component84 extends fgui.GComponent {
  14187. static createInstance() {
  14188. return (fgui.UIPackage.createObject("game", "Component84"));
  14189. }
  14190. onConstruct() {
  14191. this.c1 = this.getController("c1");
  14192. this.n4 = (this.getChild("n4"));
  14193. this.n22 = (this.getChild("n22"));
  14194. this.n23 = (this.getChild("n23"));
  14195. this.numTxt = (this.getChild("numTxt"));
  14196. this.n25 = (this.getChild("n25"));
  14197. this.n26 = (this.getChild("n26"));
  14198. }
  14199. }
  14200. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  14201. class ui_Component84_1 extends fgui.GComponent {
  14202. static createInstance() {
  14203. return (fgui.UIPackage.createObject("game", "Component84_1"));
  14204. }
  14205. onConstruct() {
  14206. this.c1 = this.getController("c1");
  14207. this.n4 = (this.getChild("n4"));
  14208. this.n22 = (this.getChild("n22"));
  14209. this.n23 = (this.getChild("n23"));
  14210. this.numTxt = (this.getChild("numTxt"));
  14211. this.n25 = (this.getChild("n25"));
  14212. this.n26 = (this.getChild("n26"));
  14213. }
  14214. }
  14215. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  14216. class ui_Component85 extends fgui.GComponent {
  14217. static createInstance() {
  14218. return (fgui.UIPackage.createObject("game", "Component85"));
  14219. }
  14220. onConstruct() {
  14221. this.n1 = (this.getChild("n1"));
  14222. this.n6 = (this.getChild("n6"));
  14223. this.n2 = (this.getChild("n2"));
  14224. this.n3 = (this.getChild("n3"));
  14225. this.levelTxt = (this.getChild("levelTxt"));
  14226. this.n10 = (this.getChild("n10"));
  14227. this.n11 = (this.getChild("n11"));
  14228. this.n12 = (this.getChild("n12"));
  14229. this.n13 = (this.getChild("n13"));
  14230. this.n14 = (this.getChild("n14"));
  14231. this.modeNode = (this.getChild("modeNode"));
  14232. this.n18 = (this.getChild("n18"));
  14233. this.conditionTxt = (this.getChild("conditionTxt"));
  14234. this.diamondNode = (this.getChild("diamondNode"));
  14235. this.coinNode = (this.getChild("coinNode"));
  14236. this.startBtn = (this.getChild("startBtn"));
  14237. this.n28 = (this.getChild("n28"));
  14238. this.displayRoot = (this.getChild("displayRoot"));
  14239. this.t0 = this.getTransition("t0");
  14240. }
  14241. }
  14242. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  14243. class ui_Component86 extends fgui.GButton {
  14244. static createInstance() {
  14245. return (fgui.UIPackage.createObject("game", "Component86"));
  14246. }
  14247. onConstruct() {
  14248. this.n15 = (this.getChild("n15"));
  14249. this.t0 = this.getTransition("t0");
  14250. }
  14251. }
  14252. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  14253. class ui_Component87 extends fgui.GComponent {
  14254. static createInstance() {
  14255. return (fgui.UIPackage.createObject("game", "Component87"));
  14256. }
  14257. onConstruct() {
  14258. this.n66 = (this.getChild("n66"));
  14259. this.myProgress = (this.getChild("myProgress"));
  14260. this.starAni = (this.getChild("starAni"));
  14261. this.hpTxt = (this.getChild("hpTxt"));
  14262. this.n74 = (this.getChild("n74"));
  14263. this.n73 = (this.getChild("n73"));
  14264. this.ballTxt = (this.getChild("ballTxt"));
  14265. this.n76 = (this.getChild("n76"));
  14266. this.helpLineBtn = (this.getChild("helpLineBtn"));
  14267. this.levelTxt = (this.getChild("levelTxt"));
  14268. this.star1 = (this.getChild("star1"));
  14269. this.star2 = (this.getChild("star2"));
  14270. this.star3 = (this.getChild("star3"));
  14271. }
  14272. }
  14273. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  14274. class ui_Component88 extends fgui.GProgressBar {
  14275. static createInstance() {
  14276. return (fgui.UIPackage.createObject("game", "Component88"));
  14277. }
  14278. onConstruct() {
  14279. this.n68 = (this.getChild("n68"));
  14280. this.bar = (this.getChild("bar"));
  14281. }
  14282. }
  14283. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  14284. class ui_Component89 extends fgui.GComponent {
  14285. static createInstance() {
  14286. return (fgui.UIPackage.createObject("game", "Component89"));
  14287. }
  14288. onConstruct() {
  14289. this.c1 = this.getController("c1");
  14290. this.n71 = (this.getChild("n71"));
  14291. this.n72 = (this.getChild("n72"));
  14292. }
  14293. }
  14294. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  14295. class ui_Component90 extends fgui.GComponent {
  14296. static createInstance() {
  14297. return (fgui.UIPackage.createObject("game", "Component90"));
  14298. }
  14299. onConstruct() {
  14300. this.c1 = this.getController("c1");
  14301. this.n64 = (this.getChild("n64"));
  14302. this.n65 = (this.getChild("n65"));
  14303. this.n66 = (this.getChild("n66"));
  14304. this.t0 = this.getTransition("t0");
  14305. }
  14306. }
  14307. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  14308. class ui_Component127 extends fgui.GButton {
  14309. static createInstance() {
  14310. return (fgui.UIPackage.createObject("game", "Component127"));
  14311. }
  14312. onConstruct() {
  14313. this.n5 = (this.getChild("n5"));
  14314. }
  14315. }
  14316. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  14317. class gameBinder {
  14318. static bindAll() {
  14319. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  14320. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  14321. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  14322. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  14323. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  14324. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  14325. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  14326. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  14327. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  14328. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  14329. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  14330. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  14331. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  14332. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  14333. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  14334. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  14335. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  14336. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  14337. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  14338. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  14339. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  14340. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  14341. fgui.UIObjectFactory.setExtension(ui_Component121.URL, ui_Component121);
  14342. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  14343. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  14344. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  14345. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  14346. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  14347. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  14348. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  14349. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  14350. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  14351. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  14352. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  14353. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  14354. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  14355. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  14356. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  14357. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  14358. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  14359. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  14360. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  14361. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  14362. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  14363. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  14364. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  14365. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  14366. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  14367. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  14368. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  14369. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  14370. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  14371. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  14372. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  14373. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  14374. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  14375. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  14376. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  14377. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  14378. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  14379. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  14380. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  14381. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  14382. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  14383. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  14384. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  14385. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  14386. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  14387. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  14388. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  14389. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  14390. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  14391. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  14392. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  14393. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  14394. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  14395. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  14396. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  14397. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  14398. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  14399. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  14400. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  14401. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  14402. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  14403. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  14404. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  14405. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  14406. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  14407. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  14408. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  14409. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  14410. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  14411. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  14412. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  14413. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  14414. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  14415. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  14416. fgui.UIObjectFactory.setExtension(ui_Component9.URL, ui_Component9);
  14417. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  14418. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  14419. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  14420. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  14421. fgui.UIObjectFactory.setExtension(ui_Component16.URL, ui_Component16);
  14422. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  14423. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  14424. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  14425. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  14426. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  14427. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  14428. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  14429. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  14430. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  14431. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  14432. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  14433. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  14434. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  14435. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  14436. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  14437. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  14438. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  14439. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  14440. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  14441. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  14442. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  14443. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  14444. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  14445. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  14446. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  14447. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  14448. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  14449. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  14450. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  14451. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  14452. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  14453. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  14454. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  14455. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  14456. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  14457. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  14458. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  14459. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  14460. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  14461. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  14462. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  14463. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  14464. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  14465. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  14466. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  14467. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  14468. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  14469. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  14470. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  14471. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  14472. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  14473. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  14474. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  14475. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  14476. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  14477. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  14478. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  14479. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  14480. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  14481. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  14482. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  14483. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  14484. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  14485. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  14486. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  14487. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  14488. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  14489. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  14490. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  14491. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  14492. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  14493. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  14494. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  14495. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  14496. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  14497. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  14498. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  14499. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  14500. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  14501. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  14502. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  14503. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  14504. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  14505. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  14506. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  14507. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  14508. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  14509. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  14510. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  14511. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  14512. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  14513. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  14514. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  14515. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  14516. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  14517. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  14518. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  14519. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  14520. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  14521. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  14522. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  14523. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  14524. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  14525. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  14526. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  14527. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  14528. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  14529. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  14530. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  14531. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  14532. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  14533. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  14534. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  14535. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  14536. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  14537. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  14538. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  14539. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  14540. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  14541. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  14542. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  14543. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  14544. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  14545. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  14546. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  14547. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  14548. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  14549. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  14550. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  14551. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  14552. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  14553. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  14554. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  14555. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  14556. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  14557. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  14558. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  14559. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  14560. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  14561. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  14562. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  14563. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  14564. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  14565. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  14566. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  14567. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  14568. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  14569. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  14570. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  14571. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  14572. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  14573. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  14574. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  14575. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  14576. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  14577. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  14578. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  14579. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  14580. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  14581. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  14582. }
  14583. }
  14584. class ui_btn6 extends fgui.GButton {
  14585. static createInstance() {
  14586. return (fgui.UIPackage.createObject("loading", "btn6"));
  14587. }
  14588. onConstruct() {
  14589. this.n6 = (this.getChild("n6"));
  14590. this.n1 = (this.getChild("n1"));
  14591. }
  14592. }
  14593. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  14594. class ui_xyItem extends fgui.GComponent {
  14595. static createInstance() {
  14596. return (fgui.UIPackage.createObject("loading", "xyItem"));
  14597. }
  14598. onConstruct() {
  14599. this.xyItem = (this.getChild("xyItem"));
  14600. }
  14601. }
  14602. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  14603. class ui_loadinfo extends fgui.GProgressBar {
  14604. static createInstance() {
  14605. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  14606. }
  14607. onConstruct() {
  14608. this.bg = (this.getChild("bg"));
  14609. this.bar = (this.getChild("bar"));
  14610. this.title = (this.getChild("title"));
  14611. this.ani = (this.getChild("ani"));
  14612. }
  14613. }
  14614. ui_loadinfo.URL = "ui://37nctnhwis36c";
  14615. class ui_xyNode extends fgui.GComponent {
  14616. static createInstance() {
  14617. return (fgui.UIPackage.createObject("loading", "xyNode"));
  14618. }
  14619. onConstruct() {
  14620. this.n0 = (this.getChild("n0"));
  14621. this.btnYes = (this.getChild("btnYes"));
  14622. this.btnNo = (this.getChild("btnNo"));
  14623. this.btnKnown = (this.getChild("btnKnown"));
  14624. this.btnSure = (this.getChild("btnSure"));
  14625. this.txtWelcom = (this.getChild("txtWelcom"));
  14626. this.txtXy = (this.getChild("txtXy"));
  14627. this.n75 = (this.getChild("n75"));
  14628. this.btnXy1 = (this.getChild("btnXy1"));
  14629. this.btnXy3 = (this.getChild("btnXy3"));
  14630. this.btnXy2 = (this.getChild("btnXy2"));
  14631. this.n74 = (this.getChild("n74"));
  14632. this.xy1 = (this.getChild("xy1"));
  14633. this.txtTitle = (this.getChild("txtTitle"));
  14634. this.btnBack = (this.getChild("btnBack"));
  14635. this.xyList = (this.getChild("xyList"));
  14636. this.xy2 = (this.getChild("xy2"));
  14637. this.xyNode = (this.getChild("xyNode"));
  14638. }
  14639. }
  14640. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  14641. class ui_ageNode extends fgui.GComponent {
  14642. static createInstance() {
  14643. return (fgui.UIPackage.createObject("loading", "ageNode"));
  14644. }
  14645. onConstruct() {
  14646. this.n3 = (this.getChild("n3"));
  14647. this.n7 = (this.getChild("n7"));
  14648. this.n4 = (this.getChild("n4"));
  14649. this.btnAge = (this.getChild("btnAge"));
  14650. this.ageNode = (this.getChild("ageNode"));
  14651. }
  14652. }
  14653. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  14654. class ui_rnNode extends fgui.GComponent {
  14655. static createInstance() {
  14656. return (fgui.UIPackage.createObject("loading", "rnNode"));
  14657. }
  14658. onConstruct() {
  14659. this.n28 = (this.getChild("n28"));
  14660. this.n30 = (this.getChild("n30"));
  14661. this.n33 = (this.getChild("n33"));
  14662. this.rn1 = (this.getChild("rn1"));
  14663. this.n40 = (this.getChild("n40"));
  14664. this.n41 = (this.getChild("n41"));
  14665. this.rn3 = (this.getChild("rn3"));
  14666. this.n37 = (this.getChild("n37"));
  14667. this.n39 = (this.getChild("n39"));
  14668. this.rn2 = (this.getChild("rn2"));
  14669. this.n47 = (this.getChild("n47"));
  14670. this.n49 = (this.getChild("n49"));
  14671. this.n44 = (this.getChild("n44"));
  14672. this.inputCode = (this.getChild("inputCode"));
  14673. this.inputName = (this.getChild("inputName"));
  14674. this.n48 = (this.getChild("n48"));
  14675. this.n50 = (this.getChild("n50"));
  14676. this.rn4 = (this.getChild("rn4"));
  14677. this.btnCheck = (this.getChild("btnCheck"));
  14678. this.btnExit = (this.getChild("btnExit"));
  14679. this.btnDone = (this.getChild("btnDone"));
  14680. this.rnNode = (this.getChild("rnNode"));
  14681. }
  14682. }
  14683. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  14684. class ui_tipNode extends fgui.GComponent {
  14685. static createInstance() {
  14686. return (fgui.UIPackage.createObject("loading", "tipNode"));
  14687. }
  14688. onConstruct() {
  14689. this.bg = (this.getChild("bg"));
  14690. this.n55 = (this.getChild("n55"));
  14691. this.n56 = (this.getChild("n56"));
  14692. this.tipNode = (this.getChild("tipNode"));
  14693. }
  14694. }
  14695. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  14696. class ui_fcmNode extends fgui.GComponent {
  14697. static createInstance() {
  14698. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  14699. }
  14700. onConstruct() {
  14701. this.n63 = (this.getChild("n63"));
  14702. this.n62 = (this.getChild("n62"));
  14703. this.btnRn = (this.getChild("btnRn"));
  14704. this.n61 = (this.getChild("n61"));
  14705. this.n58 = (this.getChild("n58"));
  14706. this.fcmNode = (this.getChild("fcmNode"));
  14707. }
  14708. }
  14709. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  14710. class ui_msgNode extends fgui.GComponent {
  14711. static createInstance() {
  14712. return (fgui.UIPackage.createObject("loading", "msgNode"));
  14713. }
  14714. onConstruct() {
  14715. this.n69 = (this.getChild("n69"));
  14716. this.txtMsg = (this.getChild("txtMsg"));
  14717. this.msgNode = (this.getChild("msgNode"));
  14718. }
  14719. }
  14720. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  14721. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  14722. static createInstance() {
  14723. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  14724. }
  14725. onConstruct() {
  14726. this.n1 = (this.getChild("n1"));
  14727. this.n13 = (this.getChild("n13"));
  14728. this.n14 = (this.getChild("n14"));
  14729. this.n15 = (this.getChild("n15"));
  14730. this.n3 = (this.getChild("n3"));
  14731. this.n4 = (this.getChild("n4"));
  14732. this.n5 = (this.getChild("n5"));
  14733. this.n6 = (this.getChild("n6"));
  14734. this.n7 = (this.getChild("n7"));
  14735. this.n8 = (this.getChild("n8"));
  14736. this.n9 = (this.getChild("n9"));
  14737. this.n10 = (this.getChild("n10"));
  14738. this.n12 = (this.getChild("n12"));
  14739. this.n11 = (this.getChild("n11"));
  14740. this.n16 = (this.getChild("n16"));
  14741. this.n17 = (this.getChild("n17"));
  14742. this.n18 = (this.getChild("n18"));
  14743. this.n20 = (this.getChild("n20"));
  14744. this.n21 = (this.getChild("n21"));
  14745. this.t0 = this.getTransition("t0");
  14746. }
  14747. }
  14748. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  14749. class ui_btn5 extends fgui.GButton {
  14750. static createInstance() {
  14751. return (fgui.UIPackage.createObject("loading", "btn5"));
  14752. }
  14753. onConstruct() {
  14754. this.n9 = (this.getChild("n9"));
  14755. this.n1 = (this.getChild("n1"));
  14756. }
  14757. }
  14758. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  14759. class ui_UILoading extends fgui.GComponent {
  14760. static createInstance() {
  14761. return (fgui.UIPackage.createObject("loading", "UILoading"));
  14762. }
  14763. onConstruct() {
  14764. this.n12 = (this.getChild("n12"));
  14765. this.loadinfo = (this.getChild("loadinfo"));
  14766. this.n13 = (this.getChild("n13"));
  14767. this.txtLoad = (this.getChild("txtLoad"));
  14768. this.n18 = (this.getChild("n18"));
  14769. }
  14770. }
  14771. ui_UILoading.URL = "ui://37nctnhwphc33";
  14772. class ui_AgeItem extends fgui.GComponent {
  14773. static createInstance() {
  14774. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  14775. }
  14776. onConstruct() {
  14777. this.txtAge = (this.getChild("txtAge"));
  14778. }
  14779. }
  14780. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  14781. class ui_btn1 extends fgui.GButton {
  14782. static createInstance() {
  14783. return (fgui.UIPackage.createObject("loading", "btn1"));
  14784. }
  14785. onConstruct() {
  14786. this.n6 = (this.getChild("n6"));
  14787. this.n1 = (this.getChild("n1"));
  14788. }
  14789. }
  14790. ui_btn1.URL = "ui://37nctnhwxe622p";
  14791. class ui_btn3 extends fgui.GButton {
  14792. static createInstance() {
  14793. return (fgui.UIPackage.createObject("loading", "btn3"));
  14794. }
  14795. onConstruct() {
  14796. this.n9 = (this.getChild("n9"));
  14797. this.n1 = (this.getChild("n1"));
  14798. }
  14799. }
  14800. ui_btn3.URL = "ui://37nctnhwxe622s";
  14801. class ui_btn2 extends fgui.GButton {
  14802. static createInstance() {
  14803. return (fgui.UIPackage.createObject("loading", "btn2"));
  14804. }
  14805. onConstruct() {
  14806. this.n6 = (this.getChild("n6"));
  14807. this.n1 = (this.getChild("n1"));
  14808. }
  14809. }
  14810. ui_btn2.URL = "ui://37nctnhwxe622t";
  14811. class ui_btnBack extends fgui.GButton {
  14812. static createInstance() {
  14813. return (fgui.UIPackage.createObject("loading", "btnBack"));
  14814. }
  14815. onConstruct() {
  14816. this.n6 = (this.getChild("n6"));
  14817. this.n7 = (this.getChild("n7"));
  14818. }
  14819. }
  14820. ui_btnBack.URL = "ui://37nctnhwxe622u";
  14821. class ui_btnXy1 extends fgui.GButton {
  14822. static createInstance() {
  14823. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  14824. }
  14825. onConstruct() {
  14826. this.n1 = (this.getChild("n1"));
  14827. }
  14828. }
  14829. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  14830. class ui_btnXy2 extends fgui.GButton {
  14831. static createInstance() {
  14832. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  14833. }
  14834. onConstruct() {
  14835. this.n1 = (this.getChild("n1"));
  14836. }
  14837. }
  14838. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  14839. class ui_btnXy3 extends fgui.GButton {
  14840. static createInstance() {
  14841. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  14842. }
  14843. onConstruct() {
  14844. this.n1 = (this.getChild("n1"));
  14845. }
  14846. }
  14847. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  14848. class ui_btn4 extends fgui.GButton {
  14849. static createInstance() {
  14850. return (fgui.UIPackage.createObject("loading", "btn4"));
  14851. }
  14852. onConstruct() {
  14853. this.n9 = (this.getChild("n9"));
  14854. this.n1 = (this.getChild("n1"));
  14855. }
  14856. }
  14857. ui_btn4.URL = "ui://37nctnhwxe622z";
  14858. class loadingBinder {
  14859. static bindAll() {
  14860. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  14861. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  14862. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  14863. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  14864. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  14865. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  14866. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  14867. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  14868. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  14869. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  14870. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  14871. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  14872. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  14873. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  14874. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  14875. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  14876. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  14877. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  14878. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  14879. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  14880. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  14881. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  14882. }
  14883. }
  14884. class UIMgr {
  14885. constructor() {
  14886. this._stage = null;
  14887. this._uiList = [];
  14888. this._showList = [];
  14889. this._bindPkgList = [];
  14890. this.uiIndex = 0;
  14891. }
  14892. static get inst() {
  14893. if (UIMgr._inst == null) {
  14894. UIMgr._inst = new UIMgr();
  14895. }
  14896. return UIMgr._inst;
  14897. }
  14898. setStage(s) {
  14899. if (this._stage) {
  14900. console.log("ViewMgr::Stage->舞台不可赋值两次");
  14901. return;
  14902. }
  14903. this._stage = s;
  14904. }
  14905. init() {
  14906. this.setStage(Laya.stage);
  14907. fairygui.UIConfig.defaultFont = "微软雅黑";
  14908. fairygui.UIConfig.modalLayerColor = "rgba(0,0,0,0.9)";
  14909. fairygui.UIConfig.packageFileExtension = "obj";
  14910. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  14911. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  14912. fairygui.GRoot.inst.width = Laya.stage.width;
  14913. fairygui.GRoot.inst.height = Laya.stage.height;
  14914. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  14915. }
  14916. addAllUpdate() {
  14917. this.uiIndex = 0;
  14918. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  14919. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  14920. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  14921. }
  14922. }
  14923. }
  14924. bindFUI(pkgname) {
  14925. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  14926. return;
  14927. }
  14928. switch (pkgname) {
  14929. case fguiRes.loading:
  14930. fairygui.UIPackage.addPackage(pkgname);
  14931. loadingBinder.bindAll();
  14932. this._bindPkgList.push(pkgname);
  14933. break;
  14934. case fguiRes.game:
  14935. fairygui.UIPackage.addPackage(pkgname);
  14936. gameBinder.bindAll();
  14937. this._bindPkgList.push(pkgname);
  14938. break;
  14939. default:
  14940. break;
  14941. }
  14942. }
  14943. Show(cls, ...param) {
  14944. let nameStr = cls.uiName;
  14945. for (let i = this._uiList.length - 1; i >= 0; i--) {
  14946. let temp = this._uiList[i];
  14947. let str = temp.className;
  14948. if (str == nameStr) {
  14949. if (temp.isMuti) {
  14950. if (temp.isHide) {
  14951. temp.show(...param);
  14952. this._uiList.splice(i, 1);
  14953. this._uiList.push(temp);
  14954. return temp;
  14955. }
  14956. }
  14957. else {
  14958. temp.show(...param);
  14959. this._uiList.splice(i, 1);
  14960. this._uiList.push(temp);
  14961. return temp;
  14962. }
  14963. }
  14964. }
  14965. let ui = new cls();
  14966. ui.className = nameStr;
  14967. this._showUI(ui, param);
  14968. return ui;
  14969. }
  14970. destroyUI(ui) {
  14971. for (let i = this._uiList.length - 1; i >= 0; i--) {
  14972. let temp = this._uiList[i].className;
  14973. if (temp == ui.className) {
  14974. this._uiList.splice(i, 1);
  14975. break;
  14976. }
  14977. }
  14978. this.checkUIState();
  14979. }
  14980. _showUI(ui, param) {
  14981. this._uiList.push(ui);
  14982. ui.show(...param);
  14983. }
  14984. Hide(uiClass) {
  14985. let ui = this.getUI(uiClass);
  14986. if (ui && !ui.isHide) {
  14987. ui.hide();
  14988. }
  14989. }
  14990. getUI(ui) {
  14991. let nameStr = ui.uiName;
  14992. for (let index = 0; index < this._uiList.length; index++) {
  14993. let temp = this._uiList[index];
  14994. if (temp.className == nameStr) {
  14995. return temp;
  14996. }
  14997. }
  14998. return null;
  14999. }
  15000. isShow(cls) {
  15001. for (var i of this._uiList) {
  15002. if (i instanceof cls) {
  15003. return i.isShowing;
  15004. }
  15005. }
  15006. return false;
  15007. }
  15008. showUINum() {
  15009. let num = 0;
  15010. for (var i of this._uiList) {
  15011. if (i.isShowing) {
  15012. num++;
  15013. }
  15014. }
  15015. return num;
  15016. }
  15017. checkUIState() {
  15018. Laya.timer.clear(this, this._uiCheck);
  15019. Laya.timer.once(400, this, this._uiCheck);
  15020. }
  15021. _uiCheck() {
  15022. let showList = [];
  15023. for (var i of this._uiList) {
  15024. if (!i.isHide) {
  15025. showList.push(i);
  15026. }
  15027. }
  15028. for (let index = 0; index < showList.length; index++) {
  15029. if (index == showList.length - 1) {
  15030. showList[index].checkActive(true);
  15031. }
  15032. else {
  15033. showList[index].checkActive(false);
  15034. }
  15035. }
  15036. }
  15037. showTip(msg, time = 600, size = 30) {
  15038. }
  15039. }
  15040. class UIShowList {
  15041. }
  15042. class SoundMgr {
  15043. constructor() {
  15044. this.soundMax = 4;
  15045. this.isLoad = false;
  15046. this.soundMap = {};
  15047. this.isSound = true;
  15048. this.openShake = true;
  15049. SoundMgr._instance = this;
  15050. }
  15051. static getInstance() {
  15052. if (!this._instance) {
  15053. this._instance = new SoundMgr();
  15054. }
  15055. return this._instance;
  15056. }
  15057. init() {
  15058. console.log('zh:sm init 1');
  15059. Laya.SoundManager.autoReleaseSound = true;
  15060. Laya.SoundManager.autoStopMusic = true;
  15061. Laya.SoundManager.musicVolume = 0.3;
  15062. Laya.SoundManager.soundVolume = 0.5;
  15063. this.musicPlayed = false;
  15064. this.audioUrl = "asset/sound/ogg/";
  15065. console.log('zh:sm init 2');
  15066. console.log('zh:dev type ');
  15067. if (Laya.Browser.onAndroid) {
  15068. console.log('zh:dev type android');
  15069. this.audioUrl = "asset/sound/ogg/";
  15070. this.isLoad = true;
  15071. }
  15072. else {
  15073. console.log('zh:dev type not android');
  15074. this.audioUrl = "asset/sound/mp3/";
  15075. this.isLoad = true;
  15076. }
  15077. }
  15078. onSetting(isS) {
  15079. this.isSound = isS;
  15080. this.mute(!this.isSound);
  15081. }
  15082. clearCount() {
  15083. for (var key in this.soundMap) {
  15084. delete this.soundMap[key];
  15085. }
  15086. }
  15087. playMusic(path, loop = 0) {
  15088. console.log('zh:playMusic 1 PATH=' + path);
  15089. this.musicPath = path;
  15090. if (!this.isLoad)
  15091. console.log('zh:playMusic 2');
  15092. return;
  15093. if (!path || path == "")
  15094. console.log('zh:playMusic 3');
  15095. return;
  15096. if (!this.isSound)
  15097. console.log('zh:playMusic 4');
  15098. return;
  15099. this.musicPlayed = true;
  15100. console.log('zh:playMusic 5');
  15101. let url = this.getUrl(path);
  15102. console.log('zh:playMusic 6' + url);
  15103. if (Laya.Browser.onPC) {
  15104. console.log('zh:playMusic 7');
  15105. Laya.loader.load(url, Laya.Handler.create(this, () => {
  15106. console.log('zh:playMusic 8');
  15107. this.play(url, loop);
  15108. }));
  15109. }
  15110. else
  15111. this.play(url, loop);
  15112. }
  15113. play(url, loop) {
  15114. Laya.SoundManager.playMusic(url, loop);
  15115. }
  15116. getUrl(path) {
  15117. let url = this.audioUrl + path;
  15118. if (Laya.Browser.onAndroid) {
  15119. url += ".ogg";
  15120. }
  15121. else {
  15122. url += ".mp3";
  15123. }
  15124. return url;
  15125. }
  15126. pauseMusic(pause) {
  15127. if (pause) {
  15128. this.mute(true);
  15129. }
  15130. else if (this.isSound)
  15131. this.mute(false);
  15132. }
  15133. stopMusic() {
  15134. Laya.SoundManager.stopMusic();
  15135. if (Moyu.isNeedPlatAudio) {
  15136. Moyu.stopMusic();
  15137. }
  15138. }
  15139. mute(mute) {
  15140. if (Moyu.isNeedPlatAudio) {
  15141. Moyu.pauseMusic(mute);
  15142. }
  15143. else {
  15144. Laya.SoundManager.musicMuted = mute;
  15145. if (!mute && !this.musicPlayed && this.musicPath) {
  15146. this.playMusic(this.musicPath);
  15147. }
  15148. }
  15149. }
  15150. stopSound(path) {
  15151. let url = this.getUrl(path);
  15152. Laya.SoundManager.stopSound(url);
  15153. }
  15154. playSound(path, loop = 1, soundMax = this.soundMax) {
  15155. if (!this.isLoad)
  15156. return;
  15157. if (!this.isSound)
  15158. return;
  15159. if (!path || path == "")
  15160. return;
  15161. let url = this.getUrl(path);
  15162. if (Moyu.isNeedPlatAudio) {
  15163. Moyu.playSound(path, loop == 0);
  15164. }
  15165. else {
  15166. let count = 1;
  15167. if (this.soundMap[path])
  15168. count = this.soundMap[path] + 1;
  15169. if (count > soundMax)
  15170. return;
  15171. this.soundMap[path] = count;
  15172. Laya.SoundManager.playSound(url, loop);
  15173. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  15174. }
  15175. }
  15176. removePath(path) {
  15177. if (this.soundMap[path]) {
  15178. let count = this.soundMap[path];
  15179. count--;
  15180. if (count < 1)
  15181. delete this.soundMap[path];
  15182. else
  15183. this.soundMap[path] = count;
  15184. }
  15185. }
  15186. playBtnSound() {
  15187. this.playSound("btn");
  15188. }
  15189. playGetSound() {
  15190. }
  15191. playCloseUISound() {
  15192. }
  15193. }
  15194. SoundMgr._instance = null;
  15195. var Handler$1 = Laya.Handler;
  15196. var EResType;
  15197. (function (EResType) {
  15198. EResType[EResType["none"] = 0] = "none";
  15199. EResType[EResType["nromal"] = 1] = "nromal";
  15200. EResType[EResType["td"] = 2] = "td";
  15201. EResType[EResType["sk"] = 3] = "sk";
  15202. })(EResType || (EResType = {}));
  15203. class CResLoader {
  15204. constructor(doneCall, proCall) {
  15205. this.completrCall = doneCall;
  15206. this.progressCall = proCall;
  15207. this.progressHander = new Handler$1(this, this.onProgress);
  15208. this.tdResMap = {};
  15209. }
  15210. load(resList) {
  15211. this.resCount = 0;
  15212. this.loadCount = 0;
  15213. for (let i = 0; i < resList.length; i++) {
  15214. let path = resList[i];
  15215. if (!path)
  15216. continue;
  15217. this.resCount++;
  15218. let type = this.getResType(path);
  15219. if (type == EResType.nromal)
  15220. this.loadNromal(path);
  15221. else if (type == EResType.td)
  15222. this.loadTd(path);
  15223. }
  15224. }
  15225. getRes(path) {
  15226. let type = this.getResType(path);
  15227. if (type == EResType.nromal)
  15228. return Laya.loader.getRes(path);
  15229. else if (type == EResType.td) {
  15230. let res = this.tdResMap[path];
  15231. if (res)
  15232. return res.clone();
  15233. return null;
  15234. }
  15235. }
  15236. destroy() {
  15237. this.progressHander.clear();
  15238. this.progressHander = null;
  15239. }
  15240. clearRes(path) {
  15241. let type = this.getResType(path);
  15242. if (type == EResType.nromal)
  15243. Laya.loader.clearRes(path);
  15244. else if (type == EResType.td) {
  15245. let obj = this.tdResMap[path];
  15246. if (obj)
  15247. obj.destroy();
  15248. delete this.tdResMap[path];
  15249. }
  15250. }
  15251. getResType(path) {
  15252. let exs = this.getExtension(path);
  15253. if (exs == "sk")
  15254. return EResType.sk;
  15255. if (exs == "ls" || exs == "lh" || exs == "lm")
  15256. return EResType.td;
  15257. else
  15258. return EResType.nromal;
  15259. }
  15260. getExtension(res) {
  15261. var index = res.lastIndexOf(".");
  15262. return res.substr(index + 1);
  15263. }
  15264. loadNromal(path) {
  15265. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  15266. if (res) {
  15267. this.onLoad();
  15268. }
  15269. else
  15270. console.log("load res fail:" + path);
  15271. }), this.progressHander);
  15272. }
  15273. loadSk() {
  15274. }
  15275. loadTd(path) {
  15276. if (this.tdResMap[path]) {
  15277. this.onLoad();
  15278. return;
  15279. }
  15280. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  15281. if (res) {
  15282. this.tdResMap[path] = res;
  15283. this.onLoad();
  15284. }
  15285. else
  15286. console.log("load res fail:" + path);
  15287. }));
  15288. }
  15289. onLoad() {
  15290. this.loadCount++;
  15291. this.onProgress(1);
  15292. if (this.loadCount >= this.resCount) {
  15293. this.completrCall.run();
  15294. }
  15295. }
  15296. onProgress(pro) {
  15297. let progress = (this.loadCount + pro) / this.resCount;
  15298. this.progressCall.runWith(progress);
  15299. }
  15300. }
  15301. var Handler$2 = Laya.Handler;
  15302. class ResInfo {
  15303. constructor() {
  15304. this.index = 0;
  15305. }
  15306. }
  15307. class ResMgr {
  15308. constructor() {
  15309. this.resList = [];
  15310. this.doneList = [];
  15311. this.resMap = {};
  15312. this.currentLoad = null;
  15313. this.completeHandler = new Handler$2(this, this.onComplete);
  15314. this.progressHandler = new Handler$2(this, this.onProgress);
  15315. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  15316. }
  15317. static getInstance() {
  15318. if (ResMgr._instance == null) {
  15319. ResMgr._instance = new ResMgr();
  15320. }
  15321. return ResMgr._instance;
  15322. }
  15323. loadList(list, completeHandler, progressHandler) {
  15324. if (list.length < 1) {
  15325. completeHandler.run();
  15326. return;
  15327. }
  15328. let info = this.getResInfo();
  15329. info.resList = list;
  15330. info.completeHandler = completeHandler;
  15331. info.progressHandler = progressHandler;
  15332. this.resList.push(info);
  15333. this.startLoad();
  15334. }
  15335. loadFguiRes(list, completeHandler, progressHandler) {
  15336. Laya.loader.load(list, completeHandler, progressHandler);
  15337. }
  15338. loadAny(list, completeHandler, progressHandler) {
  15339. Laya.loader.load(list, completeHandler, progressHandler);
  15340. }
  15341. load(path, completeHandler, progressHandler) {
  15342. let count = this.resMap[path];
  15343. if (count && count > 0) {
  15344. if (completeHandler)
  15345. completeHandler.run();
  15346. }
  15347. else
  15348. this.loadList([path], completeHandler, progressHandler);
  15349. }
  15350. getRes(path) {
  15351. let res = this.resMap[path];
  15352. if (!res)
  15353. this.showLog("资源不存在:" + path);
  15354. else
  15355. return this.loader.getRes(path);
  15356. }
  15357. clearList(list, force = false) {
  15358. if (!list || list.length < 1)
  15359. return;
  15360. let cr = () => {
  15361. for (const k in list) {
  15362. let v = list[k];
  15363. if (!v)
  15364. continue;
  15365. if (force) {
  15366. this.loader.clearRes(v);
  15367. delete this.resMap[v];
  15368. }
  15369. else {
  15370. let count = this.resMap[v];
  15371. if (count && count > 1) {
  15372. count--;
  15373. this.resMap[v] = count;
  15374. }
  15375. else {
  15376. this.loader.clearRes(v);
  15377. delete this.resMap[v];
  15378. }
  15379. }
  15380. }
  15381. if (!window.hasOwnProperty("ks"))
  15382. Laya.Resource.destroyUnusedResources();
  15383. };
  15384. Laya.timer.clearAll(this);
  15385. Laya.timer.once(2000, this, cr);
  15386. }
  15387. clear3D() {
  15388. for (const k in this.loader.tdResMap) {
  15389. this.loader.clearRes(k);
  15390. if (this.resMap[k])
  15391. delete this.resMap[k];
  15392. }
  15393. if (!window.hasOwnProperty("ks"))
  15394. Laya.Resource.destroyUnusedResources();
  15395. }
  15396. clear(path, force = false) {
  15397. this.clearList([path], force);
  15398. }
  15399. getResInfo() {
  15400. if (this.doneList.length > 0)
  15401. return this.doneList.pop();
  15402. else
  15403. return new ResInfo();
  15404. }
  15405. startLoad() {
  15406. if (this.currentLoad)
  15407. return;
  15408. this.currentLoad = this.resList.pop();
  15409. if (this.currentLoad) {
  15410. this.loader.load(this.currentLoad.resList);
  15411. }
  15412. }
  15413. onComplete() {
  15414. if (!this.currentLoad)
  15415. return;
  15416. for (const k in this.currentLoad.resList) {
  15417. let v = this.currentLoad.resList[k];
  15418. let count = this.resMap[v];
  15419. if (count)
  15420. count++;
  15421. else
  15422. count = 1;
  15423. this.resMap[v] = count;
  15424. }
  15425. if (this.currentLoad.completeHandler)
  15426. this.currentLoad.completeHandler.run();
  15427. this.doneList.push(this.currentLoad);
  15428. this.currentLoad = null;
  15429. this.startLoad();
  15430. }
  15431. onProgress(pro) {
  15432. if (!this.currentLoad)
  15433. return;
  15434. if (this.currentLoad.progressHandler)
  15435. this.currentLoad.progressHandler.runWith(pro);
  15436. }
  15437. showLog(str, ...args) {
  15438. console.log("[ResLoader] " + str);
  15439. }
  15440. }
  15441. ResMgr._instance = null;
  15442. class EventMgr extends Laya.EventDispatcher {
  15443. }
  15444. let eventMgr = new EventMgr();
  15445. class ConfigMgr {
  15446. static getInstance() {
  15447. if (!this._instance) {
  15448. this._instance = new ConfigMgr();
  15449. }
  15450. return this._instance;
  15451. }
  15452. init() {
  15453. this.npcJson = Laya.loader.getRes("res/json/npc.json").Data;
  15454. this.classicCfg = Laya.loader.getRes("res/json/classicCfg.json");
  15455. this.levelCfg = Laya.loader.getRes("res/json/levelCfg.json");
  15456. this.placeBallCfg = Laya.loader.getRes("res/json/placeBallCfg.json");
  15457. }
  15458. getUserInfoByIndex(index) {
  15459. return this.npcJson[index];
  15460. }
  15461. getRandomUserInfo() {
  15462. let index = xGame.tools.random(0, this.npcJson.length);
  15463. return this.npcJson[index];
  15464. }
  15465. getMaxBigMoveLength() {
  15466. return Object.keys(this.levelCfg).length;
  15467. }
  15468. getBigMoveLevelByIndex(index) {
  15469. let cfg = this.levelCfg;
  15470. cfg = cfg[index];
  15471. return cfg;
  15472. }
  15473. getRandomClassicLevel() {
  15474. let cfg = this.classicCfg;
  15475. let num = Object.keys(cfg).length;
  15476. let rand = xGame.common.randomNum(1, num);
  15477. return cfg[rand];
  15478. }
  15479. getPlaceBallByLevel(level) {
  15480. return this.placeBallCfg[level];
  15481. }
  15482. getMaxPlaceBall() {
  15483. return Object.keys(this.placeBallCfg).length;
  15484. }
  15485. }
  15486. class PoolD3Mgr {
  15487. constructor() {
  15488. this.pool = {};
  15489. }
  15490. static get ins() {
  15491. return this._ins || (this._ins = new PoolD3Mgr);
  15492. }
  15493. createList(key, prefab, parent) {
  15494. if (!this.pool[key]) {
  15495. this.pool[key] = {};
  15496. this.pool[key].prefab = prefab;
  15497. this.pool[key].list = [];
  15498. this.pool[key].parent = parent;
  15499. }
  15500. }
  15501. getItem(key) {
  15502. if (!this.pool[key]) {
  15503. return;
  15504. }
  15505. let temp;
  15506. if (this.pool[key].list.length > 0) {
  15507. temp = this.pool[key].list.pop();
  15508. }
  15509. else {
  15510. temp = this.pool[key].prefab.clone();
  15511. if (this.pool[key].parent) {
  15512. this.pool[key].parent.addChild(temp);
  15513. }
  15514. }
  15515. temp.active = true;
  15516. return temp;
  15517. }
  15518. putItem(key, obj) {
  15519. if (!this.pool[key]) {
  15520. return;
  15521. }
  15522. obj.active = false;
  15523. this.pool[key].list.push(obj);
  15524. }
  15525. }
  15526. let context$1 = context;
  15527. let uiMgr = UIMgr.inst;
  15528. let soundMgr = SoundMgr.getInstance();
  15529. let resMgr = ResMgr.getInstance();
  15530. let httpMgr = HttpMgr.getInstance();
  15531. let common = Common.getInstance();
  15532. let cfgMgr = ConfigMgr.getInstance();
  15533. let poolD3Mgr = PoolD3Mgr.ins;
  15534. let d3TexUrl = "res/d3Res/";
  15535. let d3ModeUrl = "res/unityRes/";
  15536. function setStageSize(view) {
  15537. if (view.width) {
  15538. view.width = Laya.stage.width;
  15539. view.height = Laya.stage.height;
  15540. }
  15541. }
  15542. function filledBg(view) {
  15543. let wh = Laya.stage.height / Laya.stage.width;
  15544. if (wh > 16 / 9) {
  15545. view.height = Laya.stage.height;
  15546. view.width = Laya.stage.height / 1334 * 750;
  15547. }
  15548. else {
  15549. view.width = Laya.stage.width;
  15550. view.height = Laya.stage.width / 750 * 1334;
  15551. }
  15552. }
  15553. function setNotch(view) {
  15554. if (view.height) {
  15555. view.y += context$1.notchHeight;
  15556. }
  15557. }
  15558. function showTip(str) {
  15559. uiMgr.Show(UIMsg, str);
  15560. }
  15561. function log(...args) {
  15562. console.log(args);
  15563. }
  15564. let xGame = {
  15565. context: context$1,
  15566. eventMgr,
  15567. resMgr,
  15568. uiMgr,
  15569. soundMgr,
  15570. define,
  15571. tools,
  15572. httpMgr,
  15573. d3TexUrl,
  15574. d3ModeUrl,
  15575. common,
  15576. cfgMgr,
  15577. poolD3Mgr,
  15578. setStageSize,
  15579. filledBg,
  15580. setNotch,
  15581. showTip,
  15582. log,
  15583. };
  15584. window["xGame"] = xGame;
  15585. let dataName = 'tBall_';
  15586. class UserData {
  15587. constructor() {
  15588. this.userId = "";
  15589. this.isAgree = false;
  15590. this.coinNum = 0;
  15591. this.gemNum = 0;
  15592. this.sound = true;
  15593. this.vibration = true;
  15594. this.currentDate = 0;
  15595. this.createTime = 0;
  15596. this.awardTime = 0;
  15597. this.roleId = 1;
  15598. this.roleList = [];
  15599. this.roleAds = [];
  15600. this.dressId = 101;
  15601. this.itemId = 201;
  15602. this.bigSkills = [1, 1, 1, 1, 1];
  15603. this.coin = 4000;
  15604. this.diamond = 0;
  15605. this.skillSuccessTimes = 0;
  15606. this.skillGuide = 0;
  15607. this.skillAccTimes = 0;
  15608. this.placeBallData = [];
  15609. this.shareDiamondTimes = 0;
  15610. this.dailyVideoShareTimes = 0;
  15611. this.secretary = [1, 0];
  15612. this.curSecretary = 0;
  15613. this.ballRod = [1, 0, 0, 0, 0, 1];
  15614. this.curBallRod = 5;
  15615. this.signData = 0;
  15616. this.signTime = 0;
  15617. this.drawTimes = 0;
  15618. this.drawAwardTimes = 0;
  15619. this.dailyfreeDrawTimes = 1;
  15620. this.power = 5;
  15621. this.powerTime = 0;
  15622. this.challengeTimes = 0;
  15623. this.extraSign = 0;
  15624. this.classicTimes = 0;
  15625. this.guideHelpLine = 0;
  15626. this.newUser = true;
  15627. this.rootBallFoul = 0;
  15628. this.timeoutFoul = 0;
  15629. this.roleList = [1];
  15630. }
  15631. saveData() {
  15632. let data = {};
  15633. for (let k in this) {
  15634. data[k.toString()] = this[k];
  15635. }
  15636. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  15637. }
  15638. getData() {
  15639. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  15640. if (ld) {
  15641. let localData = JSON.parse(ld);
  15642. if (localData) {
  15643. for (let k in this) {
  15644. let key = k.toString();
  15645. let data = localData[key];
  15646. if (data != undefined) {
  15647. this[k] = data;
  15648. }
  15649. }
  15650. }
  15651. }
  15652. }
  15653. }
  15654. class ItemData {
  15655. constructor() {
  15656. this.itemList = {};
  15657. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  15658. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  15659. }
  15660. saveData() {
  15661. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  15662. }
  15663. getData() {
  15664. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  15665. if (ld) {
  15666. let localData = JSON.parse(ld);
  15667. if (localData) {
  15668. this.itemList = localData;
  15669. }
  15670. }
  15671. }
  15672. }
  15673. class GameData {
  15674. constructor() {
  15675. this.curLevel = 0;
  15676. this.gameType = 1;
  15677. this.signIdx = 0;
  15678. this.signMax = 0;
  15679. this.rotaryTime = 0;
  15680. this.rotaryCount = 0;
  15681. this.rotaryList = [];
  15682. this.diyCount = 3;
  15683. this.awardIdx = 0;
  15684. this.shareNum = 2;
  15685. this.rankWeek = 0;
  15686. this.rankScore = 0;
  15687. this.gameCount = 0;
  15688. this.trySkill = -1;
  15689. this.tryTime = 0;
  15690. }
  15691. saveData() {
  15692. let data = {};
  15693. for (let k in this) {
  15694. data[k.toString()] = this[k];
  15695. }
  15696. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  15697. }
  15698. getData() {
  15699. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  15700. if (ld) {
  15701. let localData = JSON.parse(ld);
  15702. if (localData) {
  15703. for (let k in this) {
  15704. let key = k.toString();
  15705. let data = localData[key];
  15706. if (data != undefined) {
  15707. this[k] = data;
  15708. }
  15709. }
  15710. }
  15711. }
  15712. }
  15713. }
  15714. class DataMgr {
  15715. static Init() {
  15716. this.userData = new UserData();
  15717. this.gameData = new GameData();
  15718. this.itemData = new ItemData();
  15719. this.userData.getData();
  15720. this.gameData.getData();
  15721. this.itemData.getData();
  15722. this.roleId = this.userData.roleId;
  15723. this.resetUse();
  15724. }
  15725. static isNewDay() {
  15726. Moyu.isNewDay(this, (isnew) => {
  15727. xGame.common.isNewDay = isnew;
  15728. if (!isnew)
  15729. return;
  15730. DataMgr.setShareDiamondTimes(0, false);
  15731. DataMgr.setDailyVideoShareTimes(0, false);
  15732. DataMgr.setDailyfreeDrawTimes(1);
  15733. DataMgr.setExtraSign(0);
  15734. });
  15735. }
  15736. static deletData() {
  15737. Laya.LocalStorage.clear();
  15738. }
  15739. static upRankData() {
  15740. let num = xGame.common.getAllStarNum();
  15741. if (num > 0)
  15742. Moyu.upRankData(xGame.common.curRankID, num);
  15743. }
  15744. static addItem(id, count = 1) {
  15745. let v = this.itemData.itemList[id];
  15746. if (!v)
  15747. v = { id: id, count: count, adnum: 0, active: true };
  15748. else {
  15749. if (v.active) {
  15750. v.count += count;
  15751. }
  15752. else {
  15753. v.count = count;
  15754. v.active = true;
  15755. }
  15756. }
  15757. this.itemData.itemList[id] = v;
  15758. xGame.soundMgr.playGetSound();
  15759. this.saveItemData();
  15760. }
  15761. static hasItem(id) {
  15762. let v = this.itemData.itemList[id];
  15763. if (v && v.active)
  15764. return true;
  15765. return false;
  15766. }
  15767. static getItem(id) {
  15768. let v = this.itemData.itemList[id];
  15769. return v;
  15770. }
  15771. static getItemCount(id) {
  15772. let v = this.itemData.itemList[id];
  15773. if (v && v.active)
  15774. return v.count;
  15775. return 0;
  15776. }
  15777. static getItemAd(id) {
  15778. let v = this.itemData.itemList[id];
  15779. if (v) {
  15780. return v.adnum;
  15781. }
  15782. return 0;
  15783. }
  15784. static onItemAd(id, num = 1) {
  15785. let v = this.itemData.itemList[id];
  15786. if (!v)
  15787. v = { id: id, count: 1, adnum: num, active: false };
  15788. else
  15789. v.adnum += num;
  15790. this.itemData.itemList[id] = v;
  15791. this.saveItemData();
  15792. }
  15793. static costItem(id, count) {
  15794. let v = this.itemData.itemList[id];
  15795. if (v && v.active) {
  15796. if (v.count < count)
  15797. return false;
  15798. else {
  15799. v.count -= count;
  15800. this.itemData.itemList[id] = v;
  15801. return true;
  15802. }
  15803. }
  15804. return false;
  15805. }
  15806. static resetUse() {
  15807. this.dressId = this.userData.dressId;
  15808. this.itemId = this.userData.itemId;
  15809. }
  15810. static passLevel() {
  15811. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  15812. this.gameData.curLevel++;
  15813. this.curLevel = this.gameData.curLevel;
  15814. this.saveGameData();
  15815. }
  15816. static useRole(id) {
  15817. this.roleId = id;
  15818. if (this.hasRole(id)) {
  15819. this.userData.roleId = id;
  15820. this.saveUserData();
  15821. }
  15822. }
  15823. static addRole(id) {
  15824. if (this.hasRole(id))
  15825. return;
  15826. this.userData.roleList.push(id);
  15827. this.saveUserData();
  15828. }
  15829. static hasRole(id) {
  15830. return this.userData.roleList.indexOf(id) >= 0;
  15831. }
  15832. static gemEnough(num) {
  15833. return this.userData.gemNum >= num;
  15834. }
  15835. static roleHasAd(id) {
  15836. let count = this.userData.roleAds[id];
  15837. if (count != undefined && count >= 0)
  15838. return true;
  15839. else
  15840. return false;
  15841. }
  15842. static saveUserData(time = 1000, event, arg) {
  15843. if (this.userSaving)
  15844. return;
  15845. this.userSaving = true;
  15846. Laya.timer.once(time, this, () => {
  15847. this.userSaving = false;
  15848. this.userData.saveData();
  15849. if (event)
  15850. xGame.eventMgr.event(event, arg);
  15851. });
  15852. }
  15853. static saveGameData() {
  15854. if (this.gameSaving)
  15855. return;
  15856. this.gameSaving = true;
  15857. Laya.timer.once(1000, this, () => {
  15858. this.gameSaving = false;
  15859. this.gameData.saveData();
  15860. });
  15861. }
  15862. static saveItemData() {
  15863. let fun = () => {
  15864. this.itemData.saveData();
  15865. };
  15866. Laya.timer.clear(this, fun);
  15867. Laya.timer.once(500, this, fun);
  15868. }
  15869. static saveData() {
  15870. this.saveUserData();
  15871. this.saveGameData();
  15872. }
  15873. static getBigSkillList() {
  15874. return this.userData.bigSkills;
  15875. }
  15876. static getBigSkillByIndex(index) {
  15877. return this.userData.bigSkills[index];
  15878. }
  15879. static setBigSkill(index, val, addUp = true) {
  15880. if (addUp) {
  15881. this.userData.bigSkills[index] += val;
  15882. }
  15883. else {
  15884. this.userData.bigSkills[index] = val;
  15885. }
  15886. this.saveUserData();
  15887. }
  15888. static coinEnough(need) {
  15889. if (typeof need != "number") {
  15890. console.error("金币格式错误");
  15891. return;
  15892. }
  15893. return this.userData.coin >= need;
  15894. }
  15895. static setCoin(val) {
  15896. if (typeof val != "number") {
  15897. return;
  15898. }
  15899. this.userData.coin += val;
  15900. this.saveUserData();
  15901. xGame.eventMgr.event(COIN_CHANGE);
  15902. }
  15903. static getCoin() {
  15904. return this.userData.coin;
  15905. }
  15906. static diamondEnough(need) {
  15907. if (typeof need != "number") {
  15908. console.error("金币格式错误");
  15909. return;
  15910. }
  15911. return this.userData.diamond >= need;
  15912. }
  15913. static setDiamond(val) {
  15914. if (typeof val != "number") {
  15915. return;
  15916. }
  15917. this.userData.diamond += val;
  15918. this.saveUserData();
  15919. xGame.eventMgr.event(DIAMOND_CHANGE);
  15920. }
  15921. static getDiamond() {
  15922. return this.userData.diamond;
  15923. }
  15924. static getSkillSuccessTimes() {
  15925. return this.userData.skillSuccessTimes;
  15926. }
  15927. static setSkillSuccessTimes(val, addUp = true) {
  15928. if (addUp)
  15929. this.userData.skillSuccessTimes += val;
  15930. else
  15931. this.userData.skillSuccessTimes = val;
  15932. this.saveUserData();
  15933. }
  15934. static getSkillAccTimes() {
  15935. return this.userData.skillAccTimes;
  15936. }
  15937. static setSkillAccTimes(val) {
  15938. this.userData.skillAccTimes += val;
  15939. this.saveUserData();
  15940. }
  15941. static getSkillGuide() {
  15942. if (!xGame.common.openGuide) {
  15943. return 1;
  15944. }
  15945. return this.userData.skillGuide;
  15946. }
  15947. static setSkillGuide(val) {
  15948. this.userData.skillGuide = val;
  15949. this.saveUserData();
  15950. }
  15951. static getPlaceBallLevelList() {
  15952. return this.userData.placeBallData;
  15953. }
  15954. static getPlaceBallLevel(level) {
  15955. let arr = this.userData.placeBallData;
  15956. let index = level - 1;
  15957. let out;
  15958. if (arr[index]) {
  15959. out = arr[index];
  15960. }
  15961. else {
  15962. let max = arr.length;
  15963. if (max == index) {
  15964. out = {
  15965. star: 0,
  15966. play: true,
  15967. isCur: true,
  15968. getAward: false
  15969. };
  15970. }
  15971. else {
  15972. out = {
  15973. star: 0,
  15974. play: false,
  15975. getAward: false
  15976. };
  15977. }
  15978. }
  15979. return out;
  15980. }
  15981. static setPlaceBallLevel(level, star) {
  15982. let arr = this.userData.placeBallData;
  15983. let index = level - 1;
  15984. if (arr[index]) {
  15985. arr[index].star = Math.max(arr[index].star, star);
  15986. }
  15987. else {
  15988. let max = arr.length;
  15989. if (max == index) {
  15990. arr.push({
  15991. star: star,
  15992. play: true,
  15993. getAward: false
  15994. });
  15995. }
  15996. else {
  15997. console.error("关卡存储出错");
  15998. }
  15999. }
  16000. this.saveUserData();
  16001. }
  16002. static setPlaceBallAward(level) {
  16003. let arr = this.userData.placeBallData;
  16004. let index = level - 1;
  16005. if (arr[index]) {
  16006. arr[index].getAward = true;
  16007. }
  16008. this.saveUserData();
  16009. }
  16010. static getShareDiamondTimes() {
  16011. return this.userData.shareDiamondTimes;
  16012. }
  16013. static setShareDiamondTimes(val, addUp = true) {
  16014. if (addUp) {
  16015. this.userData.shareDiamondTimes += val;
  16016. }
  16017. else {
  16018. this.userData.shareDiamondTimes = val;
  16019. }
  16020. this.saveUserData();
  16021. }
  16022. static getDailyVideoShareTimes() {
  16023. return this.userData.dailyVideoShareTimes;
  16024. }
  16025. static setDailyVideoShareTimes(val, addUp = true) {
  16026. if (addUp) {
  16027. this.userData.dailyVideoShareTimes += val;
  16028. }
  16029. else {
  16030. this.userData.dailyVideoShareTimes = val;
  16031. }
  16032. this.saveUserData();
  16033. }
  16034. static getSecretary(index) {
  16035. return this.userData.secretary[index];
  16036. }
  16037. static setSecretary(index, val) {
  16038. this.userData.secretary[index] = val;
  16039. this.saveUserData();
  16040. }
  16041. static getCurSecretary() {
  16042. return this.userData.curSecretary;
  16043. }
  16044. static setCurSecretary(index) {
  16045. this.userData.curSecretary = index;
  16046. this.saveUserData();
  16047. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  16048. }
  16049. static getBallRod(index) {
  16050. return this.userData.ballRod[index];
  16051. }
  16052. static setBallRod(index, val) {
  16053. this.userData.ballRod[index] = val;
  16054. this.saveUserData();
  16055. }
  16056. static getCurBallRod() {
  16057. return this.userData.curBallRod;
  16058. }
  16059. static setCurBallRod(index) {
  16060. this.userData.curBallRod = index;
  16061. this.saveUserData();
  16062. }
  16063. static setSignData(val) {
  16064. this.userData.signData = val;
  16065. this.saveUserData();
  16066. }
  16067. static getSignData() {
  16068. return this.userData.signData;
  16069. }
  16070. static setSignTime(val) {
  16071. this.userData.signTime = val;
  16072. this.saveUserData();
  16073. }
  16074. static getSignTime() {
  16075. return this.userData.signTime;
  16076. }
  16077. static getDrawTimes() {
  16078. return this.userData.drawTimes;
  16079. }
  16080. static setDrawTimes(val, addUp = true) {
  16081. if (addUp) {
  16082. this.userData.drawTimes += val;
  16083. }
  16084. else {
  16085. this.userData.drawTimes = val;
  16086. }
  16087. this.saveUserData();
  16088. }
  16089. static getDrawAwardTimes() {
  16090. return this.userData.drawAwardTimes;
  16091. }
  16092. static setDrawAwardTimes(val) {
  16093. this.userData.drawAwardTimes = val;
  16094. this.saveUserData();
  16095. }
  16096. static getDailyfreeDrawTimes() {
  16097. return this.userData.dailyfreeDrawTimes;
  16098. }
  16099. static setDailyfreeDrawTimes(val) {
  16100. this.userData.dailyfreeDrawTimes = val;
  16101. this.saveUserData();
  16102. }
  16103. static setPower(val, addUp = true) {
  16104. if (addUp)
  16105. this.userData.power += val;
  16106. else
  16107. this.userData.power = val;
  16108. if (this.userData.power >= xGame.common.maxPower) {
  16109. this.userData.power = xGame.common.maxPower;
  16110. }
  16111. xGame.eventMgr.event(POWER_CHANGE, val);
  16112. this.saveUserData();
  16113. }
  16114. static getPower() {
  16115. return this.userData.power;
  16116. }
  16117. static setPowerTime(val) {
  16118. this.userData.powerTime = val;
  16119. this.saveUserData();
  16120. }
  16121. static getPowerTime() {
  16122. return this.userData.powerTime;
  16123. }
  16124. static powerEnough() {
  16125. return this.getPower() > 0;
  16126. }
  16127. static getChallengeTimes() {
  16128. return this.userData.challengeTimes;
  16129. }
  16130. static setChallengeTimes(val) {
  16131. this.userData.challengeTimes += val;
  16132. this.saveUserData();
  16133. }
  16134. static getExtraSign() {
  16135. return this.userData.extraSign;
  16136. }
  16137. static setExtraSign(val) {
  16138. this.userData.extraSign = val;
  16139. this.saveUserData();
  16140. }
  16141. static getClassicTimes() {
  16142. return this.userData.classicTimes;
  16143. }
  16144. static setClassicTimes() {
  16145. this.userData.classicTimes += 1;
  16146. this.saveUserData();
  16147. }
  16148. static getGuideHelpLine() {
  16149. return this.userData.guideHelpLine;
  16150. }
  16151. static setGuideHelpLine() {
  16152. this.userData.guideHelpLine = 1;
  16153. this.saveUserData();
  16154. }
  16155. static getNewUser() {
  16156. return this.userData.newUser;
  16157. }
  16158. static setNewUser() {
  16159. this.userData.newUser = false;
  16160. this.saveUserData();
  16161. }
  16162. static getRootBallFoul() {
  16163. return this.userData.rootBallFoul;
  16164. }
  16165. static setRootBallFoul() {
  16166. this.userData.rootBallFoul = 1;
  16167. this.saveUserData();
  16168. }
  16169. static getTimeoutFoul() {
  16170. return this.userData.timeoutFoul;
  16171. }
  16172. static setTimeoutFoul() {
  16173. this.userData.timeoutFoul = 1;
  16174. this.saveUserData();
  16175. }
  16176. }
  16177. DataMgr.isNewUser = false;
  16178. DataMgr.fristEnter = true;
  16179. DataMgr.levelType = 0;
  16180. DataMgr.awardId = 0;
  16181. DataMgr.awardCoin = 0;
  16182. DataMgr.sceneId = -1;
  16183. DataMgr.tryId = 0;
  16184. DataMgr.curLevel = 1;
  16185. DataMgr.vipLevel = 0;
  16186. DataMgr.maxLevel = 0;
  16187. DataMgr.awardRatio = 1;
  16188. DataMgr.gameList = [];
  16189. DataMgr.rankList = [];
  16190. DataMgr.recoverTime = 480000;
  16191. DataMgr.minScore = 0;
  16192. DataMgr.rankDis = 0;
  16193. DataMgr.userSaving = false;
  16194. DataMgr.gameSaving = false;
  16195. class D3Tween extends Laya.Script3D {
  16196. constructor() {
  16197. super();
  16198. this.isInited = false;
  16199. }
  16200. ;
  16201. init() {
  16202. if (this.isInited)
  16203. return;
  16204. this.isInited = true;
  16205. this.gameObj = this.owner;
  16206. this.transform = this.gameObj.transform;
  16207. }
  16208. get rotX() {
  16209. return this.transform.localRotationEulerX;
  16210. }
  16211. set rotX(v) {
  16212. this.transform.localRotationEulerX = v;
  16213. }
  16214. get rotY() {
  16215. return this.transform.localRotationEulerY;
  16216. }
  16217. set rotY(v) {
  16218. this.transform.localRotationEulerY = v;
  16219. }
  16220. get rotZ() {
  16221. return this.transform.localRotationEulerZ;
  16222. }
  16223. set rotZ(v) {
  16224. this.transform.localRotationEulerZ = v;
  16225. }
  16226. get posX() {
  16227. return this.transform.localPositionX;
  16228. }
  16229. set posX(v) {
  16230. this.transform.localPositionX = v;
  16231. }
  16232. get posY() {
  16233. return this.transform.localPositionY;
  16234. }
  16235. set posY(v) {
  16236. this.transform.localPositionY = v;
  16237. }
  16238. get posZ() {
  16239. return this.transform.localPositionZ;
  16240. }
  16241. set posZ(v) {
  16242. this.transform.localPositionZ = v;
  16243. }
  16244. get rotation() {
  16245. return this.transform.localRotation;
  16246. }
  16247. set rotation(v) {
  16248. this.transform.localRotation = v;
  16249. }
  16250. }
  16251. class D2Hole extends Laya.Script {
  16252. constructor() { super(); }
  16253. onTriggerEnter(collider) {
  16254. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  16255. return;
  16256. }
  16257. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  16258. if (collider.owner["mySrc"].isRunSkillAni) {
  16259. return;
  16260. }
  16261. if (collider.owner["mySrc"].number != 0) {
  16262. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  16263. }
  16264. xGame.common.ballColliHole(collider);
  16265. xGame.common.recoverCameraView();
  16266. }
  16267. }
  16268. }
  16269. class Table extends Laya.Script3D {
  16270. constructor() {
  16271. super();
  16272. this.isSetBorder = false;
  16273. this.inited = false;
  16274. }
  16275. ;
  16276. onAwake() {
  16277. this.init();
  16278. }
  16279. init() {
  16280. if (this.inited)
  16281. return;
  16282. this.inited = true;
  16283. this.gameObj = this.owner;
  16284. this.border = this.gameObj.getChildByName("border");
  16285. }
  16286. setBorderPos() {
  16287. if (this.isSetBorder)
  16288. return;
  16289. this.isSetBorder = true;
  16290. let ui = xGame.common.gameUI.ui;
  16291. let bar1 = this.border.getChildByName("bar1");
  16292. let bar2 = this.border.getChildByName("bar2");
  16293. let bar3 = this.border.getChildByName("bar3");
  16294. let bar4 = this.border.getChildByName("bar4");
  16295. let bar5 = this.border.getChildByName("bar5");
  16296. let bar6 = this.border.getChildByName("bar6");
  16297. this.setInfo(bar1, ui.border.bar1, "box");
  16298. this.setInfo(bar2, ui.border.bar2, "box");
  16299. this.setInfo(bar3, ui.border.bar3, "box");
  16300. this.setInfo(bar4, ui.border.bar4, "box");
  16301. this.setInfo(bar5, ui.border.bar5, "box");
  16302. this.setInfo(bar6, ui.border.bar6, "box");
  16303. let circle1 = this.border.getChildByName("circle1");
  16304. let circle2 = this.border.getChildByName("circle2");
  16305. let circle3 = this.border.getChildByName("circle3");
  16306. let circle4 = this.border.getChildByName("circle4");
  16307. let circle5 = this.border.getChildByName("circle5");
  16308. let circle6 = this.border.getChildByName("circle6");
  16309. this.setInfo(circle1, ui.border.circle1, "circle");
  16310. this.setInfo(circle2, ui.border.circle2, "circle");
  16311. this.setInfo(circle3, ui.border.circle3, "circle");
  16312. this.setInfo(circle4, ui.border.circle4, "circle");
  16313. this.setInfo(circle5, ui.border.circle5, "circle");
  16314. this.setInfo(circle6, ui.border.circle6, "circle");
  16315. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  16316. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  16317. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  16318. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  16319. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  16320. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  16321. let arr = xGame.common.gameMgr.holePosList;
  16322. xGame.common.gameMgr.posObj = {
  16323. "1": arr[0],
  16324. "3": arr[2],
  16325. "4": arr[3],
  16326. "6": arr[5]
  16327. };
  16328. }
  16329. initHolePos(x, y) {
  16330. if (x < 300)
  16331. x += 25;
  16332. else if (x > 1000)
  16333. x -= 25;
  16334. else if (y > 200)
  16335. y -= 10;
  16336. else
  16337. y += 10;
  16338. if (y < 200)
  16339. y += 30;
  16340. else if (y > 500)
  16341. y -= 30;
  16342. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  16343. }
  16344. setInfo(d3Obj, d2Obj, type) {
  16345. let ui = xGame.common.gameUI.ui;
  16346. let sprite = new Laya.Sprite();
  16347. ui.border.displayObject.addChild(sprite);
  16348. let colli = xGame.common.getCollider(type);
  16349. sprite.addComponentIntance(colli);
  16350. let rigy = xGame.common.getRigbody();
  16351. rigy.type = "static";
  16352. sprite.addComponentIntance(rigy);
  16353. let d3Pos = d3Obj.transform.position;
  16354. xGame.common.pos3to2Convert(d3Pos);
  16355. let scaleX = d3Obj.transform.localScaleX;
  16356. let scaleZ = d3Obj.transform.localScaleZ;
  16357. let width = xGame.common.scale3to2Convert(scaleZ);
  16358. let height = xGame.common.scale3to2Convert(scaleX);
  16359. sprite.pivotX = width / 2;
  16360. sprite.pivotY = height / 2;
  16361. sprite.x = d3Pos.x;
  16362. sprite.y = d3Pos.y;
  16363. sprite.width = width;
  16364. sprite.height = height;
  16365. d2Obj.x = d3Pos.x;
  16366. d2Obj.y = d3Pos.y;
  16367. d2Obj.width = width;
  16368. d2Obj.height = height;
  16369. if (type == "box") {
  16370. colli.width = width;
  16371. colli.height = height;
  16372. colli.isSensor = false;
  16373. colli.label = "border";
  16374. }
  16375. else {
  16376. colli.radius = width / 2;
  16377. colli.isSensor = true;
  16378. colli.label = "hole";
  16379. sprite.addComponent(D2Hole);
  16380. }
  16381. }
  16382. }
  16383. class D3World extends Laya.Script3D {
  16384. constructor() {
  16385. super();
  16386. this.loadNum = 0;
  16387. this.setLoadNum = 7;
  16388. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  16389. }
  16390. onAwake() {
  16391. }
  16392. loadScene() {
  16393. this.scene = this.owner;
  16394. let url = `res/unityRes/root.lh`;
  16395. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  16396. this.scene.addChild(prefab);
  16397. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  16398. this.putCameraInfo();
  16399. this.camera.enableHDR = false;
  16400. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  16401. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  16402. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  16403. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  16404. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  16405. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  16406. this.knife.active = false;
  16407. this.loadD3Obj();
  16408. }));
  16409. }
  16410. putCameraInfo() {
  16411. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  16412. this.cameraObj = new cameraType();
  16413. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  16414. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  16415. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  16416. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  16417. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  16418. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  16419. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  16420. this.visitAngleChild.init();
  16421. this.visitRootObj.posX = this.visitAngleChild.posX;
  16422. this.visitRootObj.posY = this.visitAngleChild.posY;
  16423. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  16424. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  16425. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  16426. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  16427. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  16428. xGame.common.showOneCamera("mainCamera");
  16429. }
  16430. loadD3Obj() {
  16431. this.loadTable();
  16432. this.loadRoom();
  16433. this.loadInHoleParticial();
  16434. this.loadIceParticial();
  16435. this.loadHitParticial();
  16436. this.loadFireworksParticial();
  16437. this.loadBall();
  16438. }
  16439. loadInHoleParticial() {
  16440. this.loadD3Res("inHoleEft", "", (prefab) => {
  16441. prefab.addComponent(Partical);
  16442. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  16443. });
  16444. }
  16445. loadIceParticial() {
  16446. this.loadD3Res("iceEft", "", (prefab) => {
  16447. prefab.addComponent(Partical);
  16448. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  16449. });
  16450. }
  16451. loadHitParticial() {
  16452. this.loadD3Res("hitEft", "", (prefab) => {
  16453. prefab.addComponent(Partical);
  16454. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  16455. });
  16456. }
  16457. loadFireworksParticial() {
  16458. this.loadD3Res("fireworksEft", "", (prefab) => {
  16459. prefab.addComponent(Partical);
  16460. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  16461. });
  16462. }
  16463. loadBall(index = 1) {
  16464. this.loadD3Res("ball", index, (prefab) => {
  16465. this.ballPrefab = prefab;
  16466. this.ballPrefab.addComponent(Ball);
  16467. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  16468. });
  16469. }
  16470. loadTable(index = 1) {
  16471. this.loadD3Res("table", index, (prefab) => {
  16472. this.tableSrc = prefab.addComponent(Table);
  16473. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  16474. this.d3Hand.init();
  16475. this.tableRoot.addChild(prefab);
  16476. });
  16477. }
  16478. loadRoom(index = 1) {
  16479. this.loadD3Res("room", index, (prefab) => {
  16480. this.roomRoot.addChild(prefab);
  16481. });
  16482. }
  16483. loadD3Res(type, index, callback) {
  16484. let url = `res/unityRes/${type}${index}.lh`;
  16485. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  16486. callback && callback(prefab);
  16487. this.checkResLoad();
  16488. }));
  16489. }
  16490. checkResLoad() {
  16491. this.loadNum++;
  16492. if (this.loadNum >= this.setLoadNum) {
  16493. xGame.eventMgr.event(D3RES_LOADED);
  16494. }
  16495. }
  16496. prePlayEft() {
  16497. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  16498. eft.transform.localPositionX = 0;
  16499. eft.transform.localPositionY = -5;
  16500. eft.transform.localPositionZ = 0;
  16501. eft.active = true;
  16502. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  16503. ice.transform.localPositionX = 0;
  16504. ice.transform.localPositionY = -5;
  16505. ice.transform.localPositionZ = 0;
  16506. ice.active = true;
  16507. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  16508. hit.transform.localPositionX = 0;
  16509. hit.transform.localPositionY = -5;
  16510. hit.transform.localPositionZ = 0;
  16511. hit.active = true;
  16512. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  16513. fireworks.transform.localPositionX = 0;
  16514. fireworks.transform.localPositionY = -5;
  16515. fireworks.transform.localPositionZ = 0;
  16516. fireworks.active = true;
  16517. }
  16518. }
  16519. class cameraType {
  16520. }
  16521. class MoyuMgr$1 {
  16522. static initMoyu() {
  16523. this.moyuView = new MoyuView$1();
  16524. Laya.stage.addChild(this.moyuView.ui.displayObject);
  16525. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  16526. this.moyuView.ui.displayObject.zOrder = 1000;
  16527. this.moyuView.init();
  16528. this.moyuView.showTip(true);
  16529. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  16530. window['XApk'] = this;
  16531. }
  16532. static showAge(show) {
  16533. if (this.moyuView)
  16534. this.moyuView.showAge(show);
  16535. }
  16536. static onPlatMsg(idx) {
  16537. if (!MoyuMgr$1.moyuView)
  16538. return;
  16539. if (idx == '0') {
  16540. MoyuMgr$1.moyuView.showTip(false);
  16541. }
  16542. }
  16543. static showAgree(call) {
  16544. if (this.moyuView)
  16545. this.moyuView.showAgree(call);
  16546. else
  16547. call && call();
  16548. }
  16549. static showXy(type = 1) {
  16550. if (this.moyuView)
  16551. this.moyuView.showXy(type);
  16552. }
  16553. }
  16554. MoyuMgr$1.isAdvise = false;
  16555. class MoyuView$1 {
  16556. constructor() {
  16557. this.ysxyNum = 1;
  16558. this.ysJson = null;
  16559. this.ui = ui_UIMoyu.createInstance();
  16560. }
  16561. init() {
  16562. this.ui.mainBg.visible = false;
  16563. this.ui.xyNode.visible = false;
  16564. this.ui.ageNode.visible = false;
  16565. this.ui.tipNode.visible = false;
  16566. this.ui.rnNode.visible = false;
  16567. this.ui.fcmNode.visible = false;
  16568. this.ui.ageTip.visible = false;
  16569. this.ui.msgNode.visible = false;
  16570. this.ui.visible = false;
  16571. this.ui.xyNode.xyList.setVirtual();
  16572. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  16573. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  16574. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  16575. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  16576. this.ui.xyNode.btnKnown.visible = false;
  16577. this.ui.xyNode.xy1.visible = false;
  16578. this.ui.xyNode.xy2.visible = false;
  16579. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  16580. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  16581. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  16582. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  16583. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  16584. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  16585. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  16586. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  16587. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  16588. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  16589. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  16590. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  16591. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  16592. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  16593. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  16594. this.ysxyNum = 2;
  16595. }
  16596. }
  16597. onClick(obj) {
  16598. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  16599. switch (obj) {
  16600. case this.ui.ageTip:
  16601. if (Moyu.isTTApk) {
  16602. this.ui.ageNode.visible = true;
  16603. this.ui.mainBg.visible = true;
  16604. }
  16605. break;
  16606. case this.ui.tipNode:
  16607. this.showTip(false);
  16608. break;
  16609. case this.ui.ageNode.btnAge:
  16610. this.ui.ageNode.visible = false;
  16611. this.ui.mainBg.visible = false;
  16612. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  16613. this.ui.visible = false;
  16614. break;
  16615. case this.ui.xyNode.btnXy3:
  16616. case this.ui.xyNode.btnXy1:
  16617. this.loadXy(1);
  16618. break;
  16619. case this.ui.xyNode.btnXy2:
  16620. this.loadXy(2);
  16621. break;
  16622. case this.ui.xyNode.btnBack:
  16623. this.ui.xyNode.xy1.visible = true;
  16624. this.ui.xyNode.xy2.visible = false;
  16625. break;
  16626. case this.ui.xyNode.btnKnown:
  16627. this.ui.xyNode.visible = false;
  16628. this.ui.mainBg.visible = false;
  16629. this.ui.visible = false;
  16630. break;
  16631. case this.ui.rnNode.btnCheck:
  16632. this.check();
  16633. break;
  16634. case this.ui.rnNode.btnExit:
  16635. case this.ui.xyNode.btnNo:
  16636. this.ysxyNum--;
  16637. if (this.ysxyNum > 0)
  16638. this.showMsg("再次拒绝退出游戏");
  16639. else {
  16640. Moyu.userAgree(false);
  16641. Moyu.exit();
  16642. }
  16643. break;
  16644. case this.ui.xyNode.btnSure:
  16645. case this.ui.xyNode.btnYes:
  16646. DataMgr.userData.isAgree = true;
  16647. DataMgr.saveUserData();
  16648. this.onAgree();
  16649. break;
  16650. case this.ui.rnNode.btnDone:
  16651. this.ui.rnNode.visible = false;
  16652. this.ui.visible = false;
  16653. break;
  16654. case this.ui.fcmNode.btnRn:
  16655. this.showRn();
  16656. break;
  16657. }
  16658. }
  16659. showTip(show) {
  16660. if (!Moyu.isVVApk && !Moyu.isOPApk)
  16661. return;
  16662. if (show) {
  16663. MoyuMgr$1.isAdvise = true;
  16664. this.ui.visible = true;
  16665. this.ui.tipNode.visible = true;
  16666. this.ui.tipNode.alpha = 1;
  16667. Laya.timer.once(1000, this, this.showTip, [false]);
  16668. }
  16669. else {
  16670. this.ui.tipNode.alpha = 1;
  16671. this.ui.tipNode.visible = true;
  16672. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  16673. this.ui.tipNode.visible = false;
  16674. MoyuMgr$1.isAdvise = false;
  16675. }), 1000);
  16676. }
  16677. }
  16678. showAge(show, px = 0, py = 0) {
  16679. if (Moyu.platType > 10 && !Moyu.isIos) {
  16680. this.ui.ageTip.x = px;
  16681. this.ui.ageTip.y = py;
  16682. this.ui.ageTip.visible = show;
  16683. if (show)
  16684. this.ui.visible = true;
  16685. }
  16686. }
  16687. showAgree(call) {
  16688. this.agreeCall = call;
  16689. this.onAgree();
  16690. return;
  16691. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  16692. this.showXy(0);
  16693. }
  16694. else
  16695. this.onAgree();
  16696. }
  16697. onAgree() {
  16698. if (!this.ui.ageNode.visible)
  16699. this.ui.visible = false;
  16700. this.ui.xyNode.visible = false;
  16701. Moyu.userAgree(true);
  16702. this.showAge(false);
  16703. this.agreeCall && this.agreeCall();
  16704. this.showRn();
  16705. }
  16706. showMsg(txt) {
  16707. this.ui.msgNode.txtMsg.text = txt;
  16708. this.ui.msgNode.visible = true;
  16709. this.ui.msgNode.alpha = 1;
  16710. this.ui.visible = true;
  16711. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  16712. this.ui.msgNode.visible = false;
  16713. }), 2500, true);
  16714. }
  16715. showRn() {
  16716. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  16717. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  16718. this.ui.rnNode.rn1.visible = true;
  16719. this.ui.rnNode.rn2.visible = false;
  16720. this.ui.rnNode.rn3.visible = false;
  16721. this.ui.rnNode.rn4.visible = false;
  16722. this.ui.rnNode.visible = true;
  16723. this.ui.mainBg.visible = true;
  16724. this.ui.rnNode.btnDone.visible = false;
  16725. this.ui.rnNode.btnExit.visible = true;
  16726. this.ui.rnNode.btnCheck.visible = true;
  16727. this.ui.fcmNode.visible = false;
  16728. this.ui.visible = true;
  16729. return;
  16730. }
  16731. }
  16732. this.showFcm();
  16733. }
  16734. showFcm() {
  16735. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  16736. Moyu.initFCM(true);
  16737. if (Moyu.gameTime < 1)
  16738. this.fcmLoop();
  16739. else if (Moyu.gameTime < 999)
  16740. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  16741. }
  16742. }
  16743. fcmLoop() {
  16744. if (Moyu.gameTime < 1) {
  16745. this.ui.rnNode.visible = false;
  16746. this.ui.fcmNode.visible = true;
  16747. this.ui.mainBg.visible = true;
  16748. this.ui.visible = true;
  16749. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  16750. Laya.timer.clear(this.ui, this.fcmLoop);
  16751. }
  16752. }
  16753. check() {
  16754. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  16755. this.ui.rnNode.rn1.visible = false;
  16756. this.ui.rnNode.rn2.visible = false;
  16757. this.ui.rnNode.rn4.visible = true;
  16758. }
  16759. else if (this.ui.rnNode.rn4.visible) {
  16760. let name = this.ui.rnNode.inputName.text;
  16761. let code = this.ui.rnNode.inputCode.text;
  16762. if (code && code.length == 18) {
  16763. this.ui.rnNode.rn1.visible = false;
  16764. this.ui.rnNode.rn4.visible = false;
  16765. Moyu.authenticate(name, code, (res) => {
  16766. this.ui.rnNode.rn2.visible = !res;
  16767. this.ui.rnNode.rn3.visible = res;
  16768. this.ui.rnNode.btnDone.visible = res;
  16769. this.ui.rnNode.btnExit.visible = !res;
  16770. this.ui.rnNode.btnCheck.visible = !res;
  16771. if (res)
  16772. this.showFcm();
  16773. });
  16774. }
  16775. else
  16776. this.showMsg("信息填写不完整");
  16777. }
  16778. }
  16779. loadXy(type = 0) {
  16780. this.ui.xyNode.xy1.visible = false;
  16781. this.ui.xyNode.xy2.visible = true;
  16782. this.ui.xyNode.xyList.scrollToView(0);
  16783. if (type == 1) {
  16784. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  16785. }
  16786. else if (type == 2) {
  16787. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  16788. }
  16789. }
  16790. showXy(type = 0) {
  16791. this.xyBtn();
  16792. if (type == 0) {
  16793. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  16794. this.ui.xyNode.btnSure.visible = true;
  16795. }
  16796. else {
  16797. this.ui.xyNode.btnYes.visible = true;
  16798. this.ui.xyNode.btnNo.visible = true;
  16799. }
  16800. }
  16801. else {
  16802. this.ui.xyNode.btnKnown.visible = true;
  16803. this.ui.mainBg.visible = true;
  16804. }
  16805. this.ui.xyNode.xy1.visible = true;
  16806. this.ui.xyNode.xy2.visible = false;
  16807. this.ui.xyNode.visible = true;
  16808. this.ui.visible = true;
  16809. }
  16810. xyBtn() {
  16811. this.ui.xyNode.btnSure.visible = false;
  16812. this.ui.xyNode.btnYes.visible = false;
  16813. this.ui.xyNode.btnNo.visible = false;
  16814. this.ui.xyNode.btnKnown.visible = false;
  16815. {
  16816. this.ui.xyNode.btnXy3.visible = false;
  16817. this.ui.xyNode.btnXy2.visible = true;
  16818. this.ui.xyNode.btnXy1.visible = true;
  16819. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  16820. }
  16821. }
  16822. createXY(json) {
  16823. this.ysJson = json.content;
  16824. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  16825. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  16826. this.ui.xyNode.xy2.visible = true;
  16827. }
  16828. renderListItem(idx, cell) {
  16829. let xy = this.ysJson[idx];
  16830. cell.height = xy.line * 30;
  16831. cell.xyItem.text = xy.text;
  16832. }
  16833. onDestroy() {
  16834. this.agreeCall = null;
  16835. }
  16836. }
  16837. class UILoading extends UIBase {
  16838. constructor() {
  16839. super();
  16840. this.accTime = 0;
  16841. this.curNum = 0;
  16842. this.rate = 1;
  16843. this.loadSubOk = false;
  16844. this.loadResOK = false;
  16845. this.openLoading = true;
  16846. this.beginLoadRes = false;
  16847. this.finishD2 = false;
  16848. this.finishD3 = false;
  16849. }
  16850. onConstructor() {
  16851. this.ui = ui_UILoading.createInstance();
  16852. this.contentPane = this.ui;
  16853. this.isEject = false;
  16854. this._initUI();
  16855. this._addEvent();
  16856. }
  16857. _initUI() {
  16858. MoyuMgr$1.initMoyu();
  16859. }
  16860. _addEvent() {
  16861. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  16862. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  16863. }
  16864. show() {
  16865. super.show();
  16866. console.log('zh:加载分包资源');
  16867. loadSubRes(this.subResProgress.bind(this));
  16868. this.ui.txtLoad.text = "Loading...";
  16869. }
  16870. subResProgress(pro, finish) {
  16871. this.curNum = pro;
  16872. if (finish) {
  16873. this.curNum = 1;
  16874. this.loadSubOk = true;
  16875. }
  16876. }
  16877. laodD3Res() {
  16878. let scene3D = new Laya.Scene3D();
  16879. xGame.common.d3Scene = scene3D;
  16880. xGame.common.d3World = scene3D.addComponent(D3World);
  16881. xGame.common.d3World.loadScene();
  16882. }
  16883. loadD2Res() {
  16884. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  16885. this.finishD2 = true;
  16886. this.checkLoadAll();
  16887. this.curNum = 1;
  16888. }), Laya.Handler.create(this, (pro) => {
  16889. this.curNum = pro;
  16890. }, null, false));
  16891. }
  16892. d3ResFinish() {
  16893. this.finishD3 = true;
  16894. this.checkLoadAll();
  16895. }
  16896. checkLoadAll() {
  16897. if (this.finishD2 && this.finishD3) {
  16898. this.loadResOK = true;
  16899. }
  16900. }
  16901. loadRes() {
  16902. this.laodD3Res();
  16903. this.loadD2Res();
  16904. }
  16905. myUpdate(dt) {
  16906. if (!this.openLoading)
  16907. return;
  16908. this.accTime += dt * this.rate;
  16909. if (this.accTime >= this.curNum)
  16910. this.accTime = this.curNum;
  16911. this.ui.loadinfo.value = this.accTime * 100;
  16912. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  16913. if (!this.beginLoadRes) {
  16914. this.beginLoadRes = true;
  16915. this.ui.txtLoad.text = "Loading...";
  16916. this.curNum = 0;
  16917. this.accTime = 0;
  16918. this.loadRes();
  16919. }
  16920. if (this.loadResOK) {
  16921. this.openLoading = false;
  16922. Laya.timer.once(300, this, () => {
  16923. xGame.common.d3Scene.active = false;
  16924. MoyuMgr$1.showAgree(enterGame);
  16925. });
  16926. }
  16927. }
  16928. }
  16929. release() {
  16930. }
  16931. hide() {
  16932. super.hide();
  16933. this.release();
  16934. }
  16935. onClose() {
  16936. this.hide();
  16937. }
  16938. }
  16939. UILoading.uiName = "UILoading";
  16940. class UIRepentProp$1 extends UIBase {
  16941. constructor() {
  16942. super();
  16943. this.viewType = 0;
  16944. this.regretType = 0;
  16945. }
  16946. onConstructor() {
  16947. this.ui = ui_UIRepentProp.createInstance();
  16948. this.contentPane = this.ui;
  16949. this.isEject = false;
  16950. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  16951. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  16952. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  16953. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  16954. }
  16955. show(viewType, regretType, callback) {
  16956. PlatMgr.showInsert(true);
  16957. this.viewType = viewType;
  16958. this.regretType = regretType;
  16959. this.callback = callback;
  16960. super.show();
  16961. this.ui.t0.play();
  16962. this.ui.c1.selectedIndex = this.viewType;
  16963. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  16964. if (this.viewType == 0) {
  16965. let guide = DataMgr.getGuideHelpLine();
  16966. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  16967. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  16968. }
  16969. xGame.common.gameMgr.gamePause = true;
  16970. }
  16971. hideSelf() {
  16972. xGame.common.gameMgr.gamePause = false;
  16973. this.callback && this.callback(false);
  16974. this.hide();
  16975. }
  16976. videoRegret() {
  16977. Moyu.showVideoAd(() => {
  16978. this.callback && this.callback(true);
  16979. this.hideSelf();
  16980. }, EAdType.regretBall);
  16981. }
  16982. videoAddHelpLine() {
  16983. let guide = DataMgr.getGuideHelpLine();
  16984. if (guide == 0) {
  16985. this.callback && this.callback(true);
  16986. this.hideSelf();
  16987. DataMgr.setGuideHelpLine();
  16988. xGame.common.gameUI.ui.guideNode.visible = false;
  16989. }
  16990. else {
  16991. Moyu.showVideoAd(() => {
  16992. this.callback && this.callback(true);
  16993. this.hideSelf();
  16994. }, EAdType.longHelpLine);
  16995. }
  16996. }
  16997. }
  16998. UIRepentProp$1.uiName = "UIRepentProp";
  16999. class UIRodMethod$1 extends UIBase {
  17000. constructor() {
  17001. super();
  17002. this.isPressd = false;
  17003. }
  17004. onConstructor() {
  17005. this.ui = ui_UIRodMethod.createInstance();
  17006. this.contentPane = this.ui;
  17007. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  17008. this.moveDir = new Laya.Vector2();
  17009. this.moveDest = new Laya.Vector2();
  17010. this.centerPos = new Laya.Vector2();
  17011. xGame.common.uiRodMethod = this;
  17012. }
  17013. show() {
  17014. super.show();
  17015. xGame.common.gameMgr.gamePause = true;
  17016. this.openPressDotEvent();
  17017. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  17018. this.centerPos.x = this.ui.white.x;
  17019. this.centerPos.y = this.ui.white.y;
  17020. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  17021. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  17022. this.setDot();
  17023. }
  17024. setDot() {
  17025. this.ui.dot.x = this.moveDest.x;
  17026. this.ui.dot.y = this.moveDest.y;
  17027. }
  17028. closeSelf() {
  17029. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  17030. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  17031. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  17032. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  17033. xGame.common.gameMgr.gamePause = false;
  17034. this.hide();
  17035. }
  17036. openPressDotEvent() {
  17037. this.closePressDotEvent();
  17038. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17039. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17040. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17041. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17042. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17043. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17044. }
  17045. closePressDotEvent() {
  17046. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17047. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17048. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17049. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17050. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17051. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17052. }
  17053. onDown(e) {
  17054. if (e.type == Laya.Event.MOUSE_DOWN)
  17055. this.isPressd = true;
  17056. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  17057. this.isPressd = false;
  17058. if (!this.isPressd)
  17059. return;
  17060. this.moveDest.x = e.stageX;
  17061. this.moveDest.y = e.stageY;
  17062. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  17063. if (dis > 6724) {
  17064. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  17065. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  17066. }
  17067. this.setDot();
  17068. }
  17069. resetRod() {
  17070. this.ui.dot.x = this.ui.white.x;
  17071. this.ui.dot.y = this.ui.white.y;
  17072. this.gameRod.dot.x = this.gameRod.bg.x;
  17073. this.gameRod.dot.y = this.gameRod.bg.y;
  17074. xGame.common.rodOffest.x = 0;
  17075. xGame.common.rodOffest.y = 0;
  17076. }
  17077. }
  17078. UIRodMethod$1.uiName = "UIRodMethod";
  17079. class UIMsg$1 extends UIBase {
  17080. constructor() {
  17081. super();
  17082. }
  17083. onConstructor() {
  17084. this.ui = ui_UIMsg.createInstance();
  17085. this.contentPane = this.ui;
  17086. this.isEject = false;
  17087. this.isMuti = true;
  17088. }
  17089. show(msg, callback) {
  17090. super.show();
  17091. this.ui.tipsNode.msgTxt.text = msg;
  17092. this.ui.alpha = 1;
  17093. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  17094. this.hide();
  17095. callback && callback();
  17096. }), 1000);
  17097. }
  17098. }
  17099. UIMsg$1.uiName = "UIMsg";
  17100. class UITips$1 extends UIBase {
  17101. constructor() {
  17102. super();
  17103. this.type = 0;
  17104. }
  17105. onConstructor() {
  17106. this.ui = ui_UITips.createInstance();
  17107. this.contentPane = this.ui;
  17108. this.isEject = false;
  17109. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  17110. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  17111. }
  17112. show(tipsTxt, womanTxt, type) {
  17113. super.show();
  17114. this.ui.t0.play();
  17115. this.ui.myNode.tipsTxt.text = tipsTxt;
  17116. this.ui.myNode.womanTxt.text = womanTxt;
  17117. PlatMgr.showInsert(true);
  17118. this.ui.myNode.c1.selectedIndex = type;
  17119. this.type = type;
  17120. switch (this.type) {
  17121. case TipsType.exitGame:
  17122. xGame.common.gameMgr.gamePause = true;
  17123. break;
  17124. case TipsType.foul:
  17125. Laya.timer.once(200, this, () => {
  17126. xGame.common.gameMgr.gamePause = true;
  17127. });
  17128. break;
  17129. default:
  17130. break;
  17131. }
  17132. }
  17133. clickLeftBtn() {
  17134. this.hide();
  17135. xGame.common.gameMgr.gamePause = false;
  17136. switch (this.type) {
  17137. case TipsType.exitGame:
  17138. break;
  17139. case TipsType.foul:
  17140. break;
  17141. default:
  17142. break;
  17143. }
  17144. }
  17145. clickRightBtn() {
  17146. this.hide();
  17147. switch (this.type) {
  17148. case TipsType.exitGame:
  17149. xGame.eventMgr.event(RESET_GAME);
  17150. xGame.uiMgr.Show(UIMain$1);
  17151. Moyu.recordEnd(this, null);
  17152. xGame.common.longHelpLine = false;
  17153. break;
  17154. case TipsType.foul:
  17155. xGame.common.gameMgr.gamePause = false;
  17156. Laya.timer.clearAll(this);
  17157. break;
  17158. default:
  17159. break;
  17160. }
  17161. }
  17162. }
  17163. UITips$1.uiName = "UITips";
  17164. class UIGame$1 extends UIBase {
  17165. constructor() {
  17166. super();
  17167. this.powerNum = 0;
  17168. this.isD3Inited = false;
  17169. this.isPrePlay = false;
  17170. this.isMoveRod = false;
  17171. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  17172. this.rulerDis = 20;
  17173. this.rulerOffset = 0;
  17174. }
  17175. onConstructor() {
  17176. this.ui = ui_UIGame.createInstance();
  17177. this.contentPane = this.ui;
  17178. this.ui.x += xGame.common.sysOffestNum;
  17179. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  17180. this.isEject = false;
  17181. xGame.common.gameUI = this;
  17182. this.initSelf();
  17183. }
  17184. isTurnSelf() {
  17185. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  17186. return true;
  17187. }
  17188. }
  17189. initSelf() {
  17190. let topUI = this.ui.topNode;
  17191. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  17192. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  17193. this.barInfo = {};
  17194. this.barInfo.curY = 0;
  17195. this.barInfo.height = this.ui.powerNode.height;
  17196. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  17197. this.barInfo.powerStartY = this.ui.powerNode.y;
  17198. xGame.common.aiPlayer = new AIPlayer();
  17199. xGame.common.gameMgr = new GameMgr();
  17200. xGame.common.skillMgr = new SkillMgr();
  17201. xGame.common.wordsMgr = new WordsMgr();
  17202. xGame.common.talkMgr = new TalkMgr();
  17203. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  17204. console.log("加载经典模式表情文件chenggon !");
  17205. });
  17206. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  17207. console.log("挑战模式奖励模式spine加载成功!");
  17208. });
  17209. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  17210. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  17211. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  17212. this.addUIClick(this.ui.returnBtn, this.returnHome);
  17213. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  17214. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  17215. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  17216. }
  17217. returnHome() {
  17218. let tips = "Are you sure to exit the game?";
  17219. let woman = "Boss, why don't you play for a while longer?";
  17220. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  17221. }
  17222. addRodMethodClick() {
  17223. if (this.isTurnSelf()) {
  17224. xGame.uiMgr.Show(UIRodMethod$1);
  17225. }
  17226. }
  17227. clickHelpLineBtn(force = false) {
  17228. if (!this.isTurnSelf())
  17229. return;
  17230. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  17231. if (success) {
  17232. xGame.common.longHelpLine = true;
  17233. xGame.common.d2World.getHelpLine();
  17234. Moyu.sendDataEvent("guideNum");
  17235. }
  17236. else {
  17237. }
  17238. });
  17239. }
  17240. renderSelfDisplayBalls(index, target) {
  17241. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  17242. target.myImg.url = xGame.common.getGameIconUrl(str);
  17243. }
  17244. renderAIDisplayBalls(index, target) {
  17245. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  17246. target.myImg.url = xGame.common.getGameIconUrl(str);
  17247. ;
  17248. }
  17249. updateMode() {
  17250. if (xGame.common.gameMode == GameMode.classic) {
  17251. this.ui.topNode.scoreNode.visible = false;
  17252. }
  17253. else if (xGame.common.gameMode == GameMode.bigMove) {
  17254. this.ui.topNode.scoreNode.visible = true;
  17255. }
  17256. }
  17257. show() {
  17258. super.show();
  17259. console.log("zh:uigame show");
  17260. this.ui.alpha = 0;
  17261. this.updateSelf();
  17262. console.log("zh:uigame bf gamemusic01 start");
  17263. xGame.soundMgr.playMusic("gamemusic01");
  17264. console.log("zh:uigame bf gamemusic01 end");
  17265. xGame.common.gameMgr.gamePause = false;
  17266. xGame.common.gameUI.ui.blackAni.visible = false;
  17267. xGame.common.gameUI.ui.whiteAni.visible = false;
  17268. this.ui.powerEft.visible = false;
  17269. this.ui.colorNode.visible = false;
  17270. this.updateHead();
  17271. }
  17272. updateSelf() {
  17273. if (xGame.common.gameMode == GameMode.classic) {
  17274. this.ui.c1.selectedIndex = 0;
  17275. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  17276. this.ui.topNode.middleNode.visible = true;
  17277. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  17278. }
  17279. else if (xGame.common.gameMode == GameMode.bigMove) {
  17280. this.ui.c1.selectedIndex = 0;
  17281. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  17282. this.ui.topNode.middleNode.visible = false;
  17283. let max = xGame.cfgMgr.getMaxBigMoveLength();
  17284. let rand = xGame.common.randomNum(1, max);
  17285. let guide = DataMgr.getSkillGuide();
  17286. if (guide == 0)
  17287. rand = 1;
  17288. xGame.common.bigMoveLevelIndex = rand;
  17289. }
  17290. else if (xGame.common.gameMode == GameMode.placeBall) {
  17291. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  17292. this.ui.c1.selectedIndex = 1 + data.type;
  17293. this.ui.alpha = 1;
  17294. this.startGame();
  17295. }
  17296. this.updateMode();
  17297. this.initD3world();
  17298. this.initD2world();
  17299. }
  17300. startGame() {
  17301. this.ui.snowNode.visible = Math.random() <= 0.1;
  17302. this.ui.d2Node.visible = false;
  17303. xGame.common.d3World.d3Hand.gameObj.active = false;
  17304. xGame.common.d3World.tableSrc.init();
  17305. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  17306. this.cameraViewChange(() => {
  17307. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  17308. switch (xGame.common.gameMode) {
  17309. case GameMode.classic:
  17310. xGame.common.d3World.d3Hand.gameObj.active = true;
  17311. this.playPutBallD3Ani();
  17312. break;
  17313. case GameMode.bigMove:
  17314. this.enterGame();
  17315. Laya.timer.once(500, this, () => {
  17316. this.ui.topNode.middleNode.visible = true;
  17317. this.ui.topNode.middleNode.t0.play();
  17318. });
  17319. break;
  17320. case GameMode.placeBall:
  17321. this.enterGame();
  17322. break;
  17323. default:
  17324. break;
  17325. }
  17326. });
  17327. PlatMgr.showBanner(false);
  17328. }
  17329. enterGame() {
  17330. this.ui.d2Node.visible = true;
  17331. xGame.common.d3World.d3Hand.gameObj.active = false;
  17332. xGame.common.showOneCamera("mainCamera");
  17333. Moyu.recordGame(30, true);
  17334. if (!this.isPrePlay) {
  17335. this.isPrePlay = true;
  17336. xGame.common.d3World.prePlayEft();
  17337. }
  17338. xGame.common.gameMgr.gameReady();
  17339. this.openAllEvent();
  17340. this.ui.snowNode.visible = false;
  17341. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  17342. this.ui.helpBtn.visible = condition;
  17343. }
  17344. showHelpLineGuide() {
  17345. let longGuide = DataMgr.getGuideHelpLine();
  17346. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  17347. this.ui.helpBtn.visible = true;
  17348. this.ui.guideNode.visible = true;
  17349. }
  17350. }
  17351. setTurnAlpha(alpha) {
  17352. this.ui.keduNode.alpha = alpha;
  17353. this.ui.ganNode.alpha = alpha;
  17354. this.ui.rodMethodNode.alpha = alpha;
  17355. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  17356. }
  17357. cameraViewChange(callback) {
  17358. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  17359. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  17360. xGame.common.showOneCamera("visitAngle");
  17361. cameraSrc.localRotationEulerY = 180;
  17362. cameraSrc.localRotationEulerZ = 0;
  17363. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  17364. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  17365. callback && callback();
  17366. }));
  17367. }));
  17368. }
  17369. playPutBallD3Ani() {
  17370. xGame.common.showOneCamera("mainCamera");
  17371. let handSrc = xGame.common.d3World.d3Hand;
  17372. handSrc.gameObj.active = true;
  17373. handSrc.transform.localPositionZ = 3;
  17374. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  17375. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  17376. handSrc.gameObj.active = false;
  17377. this.enterGame();
  17378. }), 400);
  17379. }));
  17380. }
  17381. updateHead() {
  17382. let user = Moyu.getUserInfo();
  17383. this.ui.topNode.selfNameTxt.text = user.nickName;
  17384. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  17385. let aiData = xGame.cfgMgr.getRandomUserInfo();
  17386. if (DataMgr.getSkillGuide() < 1) {
  17387. this.ui.topNode.aiNameTxt.text = 'billiards';
  17388. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  17389. }
  17390. else {
  17391. this.ui.topNode.aiNameTxt.text = aiData.name;
  17392. let randNo = Math.floor(Math.random() * 10) + 1;
  17393. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  17394. }
  17395. }
  17396. initD2world() {
  17397. let node = this.ui.d2Root.displayObject;
  17398. let src = node.getComponent(D2World);
  17399. if (!src) {
  17400. xGame.common.d2World = node.addComponent(D2World);
  17401. }
  17402. xGame.common.d2World.initSelf();
  17403. }
  17404. initD3world() {
  17405. if (this.isD3Inited)
  17406. return;
  17407. this.isD3Inited = true;
  17408. let scene3D = xGame.common.d3Scene;
  17409. this.ui.d3Root.displayObject.addChild(scene3D);
  17410. scene3D.active = true;
  17411. xGame.common.d3World.tableSrc.setBorderPos();
  17412. }
  17413. onRootMove(e) {
  17414. let rootBall = xGame.common.d2World.rootBall;
  17415. this.ui.moveNode.x = e.x;
  17416. this.ui.moveNode.y = e.y;
  17417. rootBall.gameObj.x = e.x;
  17418. rootBall.gameObj.y = e.y;
  17419. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  17420. }
  17421. aiRootMove(move) {
  17422. if (move)
  17423. this.hideBallUI();
  17424. else {
  17425. this.showBallUI();
  17426. xGame.common.d2World.getHelpLine();
  17427. }
  17428. }
  17429. aiForce(type, force = 0) {
  17430. this.pressTarget = PressType.powerNode;
  17431. if (type == 1)
  17432. this.onEventUp({ force: true });
  17433. else if (type == 2)
  17434. this.onEventMove({ stageY: force, force: true });
  17435. }
  17436. onEventPress(e) {
  17437. if (e.stopPropagation)
  17438. e.stopPropagation();
  17439. if (!this.isTurnSelf())
  17440. return;
  17441. let target = e.target;
  17442. switch (target) {
  17443. case this.ui.myPowerNode.displayObject:
  17444. this.pressTarget = PressType.powerNode;
  17445. this.barInfo.curY = e.stageY;
  17446. this.updateBarInfo();
  17447. break;
  17448. case this.ui.moveNode.displayObject:
  17449. this.pressTarget = PressType.moveNode;
  17450. this.hideBallUI();
  17451. this.eventObj.curX = this.ui.moveNode.x;
  17452. this.eventObj.curY = this.ui.moveNode.y;
  17453. this.ui.moveNode.finger.visible = false;
  17454. this.eventObj.lastX = e.stageX;
  17455. this.eventObj.lastY = e.stageY;
  17456. break;
  17457. case this.ui.rulerClickNode.displayObject:
  17458. this.pressTarget = PressType.rulerNode;
  17459. this.eventObj.lastY = e.stageY;
  17460. break;
  17461. case this.ui.d2Root.displayObject:
  17462. this.pressTarget = PressType.d2Root;
  17463. this.eventObj.lastX = e.stageX;
  17464. this.eventObj.lastY = e.stageY;
  17465. this.eventObj.starX = e.stageX;
  17466. this.eventObj.starY = e.stageY;
  17467. this.eventObj.curX = 0;
  17468. this.eventObj.curY = 0;
  17469. xGame.common.d2World.d2Gan.setGanLastInfo();
  17470. this.rulerOffset = 0;
  17471. break;
  17472. default:
  17473. break;
  17474. }
  17475. }
  17476. onEventMove(e) {
  17477. if (e.stopPropagation)
  17478. e.stopPropagation();
  17479. if (e && e.force) {
  17480. }
  17481. else {
  17482. if (!this.isTurnSelf())
  17483. return;
  17484. }
  17485. switch (this.pressTarget) {
  17486. case PressType.powerNode:
  17487. this.barInfo.curY = e.stageY;
  17488. this.updateBarInfo();
  17489. this.isMoveRod = true;
  17490. break;
  17491. case PressType.moveNode:
  17492. let rootBall = xGame.common.d2World.rootBall;
  17493. let radius = rootBall.gameObj.width / 2;
  17494. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  17495. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  17496. let border = xGame.common.d2World.borderRect;
  17497. if (curX <= border.x + radius)
  17498. curX = border.x + radius;
  17499. else if (curX >= border.x + border.width - radius)
  17500. curX = border.x + border.width - radius;
  17501. if (curY <= border.y + radius)
  17502. curY = border.y + radius;
  17503. else if (curY >= border.y + border.height - radius)
  17504. curY = border.y + border.height - radius;
  17505. if (xGame.common.gameMgr.isOpenBall) {
  17506. if (curX >= border.x + border.openBallW - radius)
  17507. curX = border.x + border.openBallW - radius;
  17508. }
  17509. this.ui.moveNode.x = curX;
  17510. this.ui.moveNode.y = curY;
  17511. rootBall.gameObj.x = curX;
  17512. rootBall.gameObj.y = curY;
  17513. rootBall.d3BallSrc.setTransPos(curX, curY);
  17514. this.isMoveRod = true;
  17515. break;
  17516. case PressType.rulerNode:
  17517. let yy = e.stageY - this.eventObj.lastY;
  17518. this.eventObj.lastY = e.stageY;
  17519. let ruler1 = this.ui.rulerNode.img1;
  17520. let ruler2 = this.ui.rulerNode.img2;
  17521. ruler1.y += yy;
  17522. ruler2.y += yy;
  17523. this.rulerOffset += yy;
  17524. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  17525. this.rulerOffset = 0;
  17526. xGame.soundMgr.playSound("inch", 1, 10);
  17527. }
  17528. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  17529. let h = ruler1.height;
  17530. this.checkGuide();
  17531. this.isMoveRod = true;
  17532. if (ruler1.y >= h) {
  17533. ruler1.y = -h;
  17534. ruler2.y = 0;
  17535. return;
  17536. }
  17537. else if (ruler1.y <= -h) {
  17538. ruler1.y = h;
  17539. ruler2.y = 0;
  17540. return;
  17541. }
  17542. if (ruler2.y >= h) {
  17543. ruler2.y = -h;
  17544. ruler1.y = 0;
  17545. return;
  17546. }
  17547. else if (ruler2.y <= -h) {
  17548. ruler2.y = h;
  17549. ruler1.y = 0;
  17550. return;
  17551. }
  17552. break;
  17553. case PressType.d2Root:
  17554. this.eventObj.curX = e.stageX;
  17555. this.eventObj.curY = e.stageY;
  17556. let offset = this.checkRodMoveDir();
  17557. xGame.common.d2World.d2Gan.rotateSelf(offset);
  17558. this.eventObj.lastX = e.stageX;
  17559. this.eventObj.lastY = e.stageY;
  17560. break;
  17561. default:
  17562. break;
  17563. }
  17564. }
  17565. onEventUp(e) {
  17566. if (e.stopPropagation)
  17567. e.stopPropagation();
  17568. if (e && e.force) {
  17569. }
  17570. else {
  17571. if (!this.isTurnSelf())
  17572. return;
  17573. }
  17574. switch (this.pressTarget) {
  17575. case PressType.powerNode:
  17576. this.ui.powerNode.value = 0;
  17577. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  17578. this.ui.powerTxt.text = "";
  17579. if (this.powerNum > 0) {
  17580. xGame.eventMgr.event(BALL_SHOOT);
  17581. xGame.common.d2World.shoot(this.powerNum);
  17582. xGame.common.d2World.d2Gan.shoot();
  17583. xGame.common.d2World.d2HelpLine.shoot();
  17584. this.finishGuide();
  17585. this.ui.powerEft.visible = false;
  17586. this.ui.colorNode.visible = false;
  17587. let ganStr = "";
  17588. if (this.powerNum <= 30) {
  17589. ganStr = "gan_30";
  17590. }
  17591. else if (this.powerNum <= 60) {
  17592. ganStr = "gan_50";
  17593. }
  17594. else {
  17595. ganStr = "gan_80";
  17596. }
  17597. xGame.soundMgr.playSound(ganStr);
  17598. }
  17599. break;
  17600. case PressType.moveNode:
  17601. let rootBall = xGame.common.d2World.rootBall;
  17602. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  17603. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  17604. let isIntersect = this.judgeBallIntersect();
  17605. if (isIntersect) {
  17606. this.ui.moveNode.x = lastX;
  17607. this.ui.moveNode.y = lastY;
  17608. rootBall.gameObj.x = lastX;
  17609. rootBall.gameObj.y = lastY;
  17610. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  17611. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  17612. }
  17613. else {
  17614. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  17615. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  17616. }
  17617. this.showBallUI();
  17618. this.ui.moveNode.finger.visible = true;
  17619. xGame.common.d2World.getHelpLine();
  17620. break;
  17621. case PressType.rulerNode:
  17622. break;
  17623. case PressType.d2Root:
  17624. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  17625. if (dis <= 25) {
  17626. this.moveToClickDot(e);
  17627. }
  17628. break;
  17629. default:
  17630. break;
  17631. }
  17632. this.pressTarget = -1;
  17633. }
  17634. checkGuide() {
  17635. let guide = DataMgr.getSkillGuide();
  17636. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  17637. xGame.common.guideStep++;
  17638. xGame.common.gameUI.ui.guide2.visible = false;
  17639. xGame.common.gameUI.ui.guide3.visible = true;
  17640. }
  17641. }
  17642. finishGuide() {
  17643. let guide = DataMgr.getSkillGuide();
  17644. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  17645. xGame.common.guideStep = 10;
  17646. this.closeAllGuide();
  17647. }
  17648. }
  17649. closeAllGuide() {
  17650. xGame.common.gameUI.ui.guide1.visible = false;
  17651. xGame.common.gameUI.ui.guide2.visible = false;
  17652. xGame.common.gameUI.ui.guide3.visible = false;
  17653. }
  17654. updateBarInfo() {
  17655. let star = this.ui.powerNode.y;
  17656. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  17657. if (rate >= 1)
  17658. rate = 1;
  17659. if (rate <= 0)
  17660. rate = 0;
  17661. this.powerNum = Math.ceil(rate * 100);
  17662. this.ui.powerNode.value = this.powerNum;
  17663. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  17664. this.ui.colorNode.value = this.powerNum;
  17665. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  17666. this.ui.powerEft.visible = this.powerNum != 0;
  17667. this.ui.colorNode.visible = this.powerNum != 0;
  17668. this.ui.powerTxt.text = this.powerNum + "";
  17669. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  17670. }
  17671. forceCancel() {
  17672. this.ui.powerNode.value = 0;
  17673. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  17674. this.ui.powerTxt.text = "";
  17675. }
  17676. checkRodMoveDir() {
  17677. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  17678. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  17679. if (tempX >= 0 && tempY <= 0) {
  17680. return this.checkDir();
  17681. }
  17682. else if (tempX < 0 && tempY < 0) {
  17683. return this.checkDir(1, -1);
  17684. }
  17685. else if (tempX < 0 && tempY > 0) {
  17686. return this.checkDir(-1, -1);
  17687. }
  17688. else {
  17689. return this.checkDir(-1, 1);
  17690. }
  17691. }
  17692. checkDir(flagX = 1, flagY = 1) {
  17693. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  17694. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  17695. if (offsetY == 0) {
  17696. return offsetX * flagX;
  17697. }
  17698. if (offsetX == 0) {
  17699. return offsetY * flagY;
  17700. }
  17701. let angle = offsetY / offsetX;
  17702. if (Math.abs(angle) >= 1) {
  17703. return offsetY * flagY;
  17704. }
  17705. else {
  17706. return offsetX * flagX;
  17707. }
  17708. }
  17709. judgeBallIntersect() {
  17710. let rootBall = xGame.common.d2World.rootBall;
  17711. let ballArr = xGame.common.d2World.ballArr;
  17712. let radius = rootBall.gameObj.width / 2;
  17713. let temp;
  17714. let isIntersect = false;
  17715. for (let index = 0; index < ballArr.length; index++) {
  17716. temp = ballArr[index];
  17717. if (temp.number == rootBall.number)
  17718. continue;
  17719. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  17720. if (isIntersect) {
  17721. break;
  17722. }
  17723. }
  17724. return isIntersect;
  17725. }
  17726. hideBallUI() {
  17727. let d2Gan = xGame.common.d2World.d2Gan;
  17728. if (!d2Gan.ui.isDisposed)
  17729. d2Gan.ui.visible = false;
  17730. let d2Help = xGame.common.d2World.d2HelpLine;
  17731. if (!d2Help.ui.isDisposed)
  17732. d2Help.ui.visible = false;
  17733. let rootBall = xGame.common.d2World.rootBall;
  17734. if (!rootBall.destroyed) {
  17735. rootBall.gameObj.active = false;
  17736. }
  17737. }
  17738. showBallUI() {
  17739. let d2Gan = xGame.common.d2World.d2Gan;
  17740. if (!d2Gan.ui.isDisposed)
  17741. d2Gan.ui.visible = true;
  17742. let d2Help = xGame.common.d2World.d2HelpLine;
  17743. if (!d2Help.ui.isDisposed)
  17744. d2Help.ui.visible = true;
  17745. let rootBall = xGame.common.d2World.rootBall;
  17746. if (!rootBall.destroyed) {
  17747. rootBall.gameObj.active = true;
  17748. }
  17749. }
  17750. moveToClickDot(e) {
  17751. if (!this.isMoveRod && !xGame.common.clickedBall) {
  17752. let root = xGame.common.d2World.rootBall.gameObj;
  17753. let xx = e.stageX - xGame.common.sysOffestNum;
  17754. let yy = e.stageY;
  17755. let x = xx - root.x;
  17756. let y = yy - root.y;
  17757. let angle = xGame.common.getfguiRotation(x, y);
  17758. xGame.common.d2World.d2Gan.ui.rotation = angle;
  17759. xGame.common.d2World.getHelpLine();
  17760. }
  17761. this.isMoveRod = false;
  17762. xGame.common.clickedBall = false;
  17763. }
  17764. openAllEvent() {
  17765. this.closeAllEvent();
  17766. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17767. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17768. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17769. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17770. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  17771. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  17772. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  17773. }
  17774. closeAllEvent() {
  17775. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17776. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17777. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17778. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17779. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  17780. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  17781. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  17782. }
  17783. resetGame() {
  17784. this.closeAllEvent();
  17785. this.hideBallUI();
  17786. xGame.common.gameMgr.gamePause = true;
  17787. }
  17788. }
  17789. UIGame$1.uiName = "UIGame";
  17790. class UIAddCoin$1 extends UIBase {
  17791. constructor() {
  17792. super();
  17793. this.coinNum = 2000;
  17794. }
  17795. onConstructor() {
  17796. this.ui = ui_UIAddCoin.createInstance();
  17797. this.contentPane = this.ui;
  17798. this.isEject = false;
  17799. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  17800. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  17801. }
  17802. show() {
  17803. super.show();
  17804. this.ui.t0.play();
  17805. }
  17806. videoAddCoin() {
  17807. Moyu.showVideoAd(() => {
  17808. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  17809. this.hide();
  17810. }, EAdType.addFailCoin);
  17811. }
  17812. }
  17813. UIAddCoin$1.uiName = "UIAddCoin";
  17814. class UIInvitation$1 extends UIBase {
  17815. constructor() {
  17816. super();
  17817. }
  17818. onConstructor() {
  17819. this.ui = ui_UIInvitation.createInstance();
  17820. this.contentPane = this.ui;
  17821. this.isEject = false;
  17822. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  17823. }
  17824. show() {
  17825. super.show();
  17826. }
  17827. enterGame() {
  17828. xGame.common.gameMode = GameMode.classic;
  17829. DataMgr.setChallengeTimes(1);
  17830. xGame.common.passAwardCoin = 2000;
  17831. let need = xGame.common.classicNiceNeddCoin;
  17832. if (DataMgr.coinEnough(need)) {
  17833. DataMgr.setCoin(-need);
  17834. xGame.eventMgr.event(RESTART_GAME, true);
  17835. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  17836. }
  17837. else {
  17838. xGame.eventMgr.event(RESTART_GAME, true);
  17839. }
  17840. this.hide();
  17841. }
  17842. hide() {
  17843. super.hide();
  17844. }
  17845. }
  17846. UIInvitation$1.uiName = "UIInvitation";
  17847. class UIPower$1 extends UIBase {
  17848. constructor() {
  17849. super();
  17850. }
  17851. onConstructor() {
  17852. this.ui = ui_UIPower.createInstance();
  17853. this.contentPane = this.ui;
  17854. this.isEject = false;
  17855. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  17856. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  17857. }
  17858. show() {
  17859. super.show();
  17860. this.ui.t0.play();
  17861. }
  17862. videoGetPower() {
  17863. Moyu.showVideoAd(() => {
  17864. DataMgr.setPower(xGame.common.videoPower, true);
  17865. xGame.eventMgr.event(POWER_TIME);
  17866. this.hide();
  17867. }, EAdType.getPower);
  17868. }
  17869. }
  17870. UIPower$1.uiName = "UIPower";
  17871. class UIGameEnd$1 extends UIBase {
  17872. constructor() {
  17873. super();
  17874. this.success = false;
  17875. this.awardCoinNum = 1000;
  17876. this.awardDiamondNum = 10;
  17877. }
  17878. onConstructor() {
  17879. this.ui = ui_UIGameEnd.createInstance();
  17880. this.contentPane = this.ui;
  17881. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  17882. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  17883. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  17884. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  17885. this.ui.talkNode.visible = false;
  17886. if (Moyu.isKs)
  17887. this.ui.closeNode.closeBtn.x += 100;
  17888. }
  17889. updateType() {
  17890. switch (xGame.common.gameMode) {
  17891. case GameMode.classic:
  17892. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  17893. this.ui.coinNode.visible = this.success;
  17894. if (!this.success) {
  17895. Laya.timer.once(500, this, () => {
  17896. xGame.uiMgr.Show(UIAddCoin$1);
  17897. });
  17898. }
  17899. this.ui.isGetAward.visible = false;
  17900. this.ui.leftBtn.c1.selectedIndex = 3;
  17901. this.ui.rightBtn.c1.selectedIndex = 0;
  17902. this.moneyNode.ui.c1.selectedIndex = 1;
  17903. break;
  17904. case GameMode.bigMove:
  17905. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  17906. this.ui.coinNode.visible = this.success;
  17907. if (xGame.common.gameMode == GameMode.bigMove) {
  17908. if (this.success) {
  17909. DataMgr.setSkillSuccessTimes(1, true);
  17910. DataMgr.setSkillAccTimes(1);
  17911. }
  17912. else {
  17913. DataMgr.setSkillSuccessTimes(0, false);
  17914. }
  17915. }
  17916. if (!this.success) {
  17917. Laya.timer.once(500, this, () => {
  17918. xGame.uiMgr.Show(UIAddCoin$1);
  17919. });
  17920. }
  17921. this.ui.isGetAward.visible = false;
  17922. this.ui.leftBtn.c1.selectedIndex = 3;
  17923. this.ui.rightBtn.c1.selectedIndex = 0;
  17924. this.moneyNode.ui.c1.selectedIndex = 1;
  17925. break;
  17926. case GameMode.placeBall:
  17927. this.ui.coinNode.visible = false;
  17928. if (this.success) {
  17929. if (xGame.common.placeBallStarNum == 3) {
  17930. this.ui.c1.selectedIndex = 2;
  17931. }
  17932. else {
  17933. this.ui.c1.selectedIndex = 3;
  17934. }
  17935. }
  17936. else {
  17937. this.ui.c1.selectedIndex = 4;
  17938. }
  17939. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  17940. if (cfg.type == PlaceBallType.challenge) {
  17941. this.ui.c1.selectedIndex = 2;
  17942. }
  17943. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  17944. this.updatePlaceBallBtn();
  17945. this.updatePlaceBallStarNum();
  17946. this.updatePlaceBallAwardState();
  17947. this.moneyNode.ui.c1.selectedIndex = 2;
  17948. this.moneyNode.checkPowerTime();
  17949. this.moneyNode.powerChange();
  17950. DataMgr.upRankData();
  17951. break;
  17952. default:
  17953. break;
  17954. }
  17955. }
  17956. updatePlaceBallBtn() {
  17957. this.ui.leftBtn.c1.selectedIndex = 5;
  17958. if (this.success) {
  17959. this.ui.rightBtn.c1.selectedIndex = 14;
  17960. }
  17961. else {
  17962. if (xGame.common.placeBallStarNum == 3) {
  17963. this.ui.rightBtn.c1.selectedIndex = 14;
  17964. }
  17965. else {
  17966. this.ui.rightBtn.c1.selectedIndex = 1;
  17967. }
  17968. }
  17969. }
  17970. updatePlaceBallStarNum() {
  17971. let starNum = xGame.common.placeBallStarNum;
  17972. if (starNum == 0)
  17973. this.ui.starNumNode.c1.selectedIndex = 3;
  17974. else {
  17975. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  17976. }
  17977. }
  17978. updatePlaceBallAwardState() {
  17979. let level = xGame.common.placeBallCurLevel;
  17980. let starNum = xGame.common.placeBallStarNum;
  17981. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  17982. let data = cfgTable.placeballData[level].award;
  17983. let cfg = cfgTable.placeballData[level];
  17984. this.awardDiamondNum = data[1];
  17985. this.awardCoinNum = data[0];
  17986. if (cfg.type == PlaceBallType.challenge) {
  17987. this.awardDiamondNum = 0;
  17988. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  17989. }
  17990. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  17991. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  17992. if (cfg.type == PlaceBallType.challenge) {
  17993. this.ui.awardNode.coinNode.visible = true;
  17994. }
  17995. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  17996. this.ui.awardNode.diamondNode.x = 265;
  17997. this.ui.awardNode.coinNode.x = 354;
  17998. }
  17999. else {
  18000. this.ui.awardNode.diamondNode.x = 291;
  18001. this.ui.awardNode.coinNode.x = 291;
  18002. }
  18003. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  18004. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  18005. if (this.awardCoinNum == 0) {
  18006. this.ui.awardNode.coinNode.numTxt.text = "";
  18007. }
  18008. if (getAward) {
  18009. this.ui.isGetAward.visible = true;
  18010. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  18011. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  18012. }
  18013. else {
  18014. this.ui.isGetAward.visible = false;
  18015. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  18016. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  18017. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  18018. }
  18019. else {
  18020. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  18021. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  18022. }
  18023. }
  18024. }
  18025. show(success) {
  18026. super.show();
  18027. xGame.eventMgr.event(RESET_GAME);
  18028. this.success = success;
  18029. Laya.timer.clearAll(this);
  18030. this.playSecretaryAni();
  18031. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  18032. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  18033. offsetTime = Math.floor(offsetTime / 1000);
  18034. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  18035. this.updateType();
  18036. Laya.timer.once(200, this, () => {
  18037. this.addAward(() => {
  18038. this.updateType();
  18039. Laya.timer.once(500, this, () => {
  18040. this.showChallengeLevel();
  18041. });
  18042. });
  18043. });
  18044. if (this.success) {
  18045. xGame.soundMgr.playSound('slots_roll01');
  18046. xGame.soundMgr.playSound("s_win");
  18047. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18048. }
  18049. else {
  18050. xGame.soundMgr.playSound('matchwin01');
  18051. xGame.soundMgr.playSound("s_lose");
  18052. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18053. }
  18054. if (!Moyu.isLegal)
  18055. PlatMgr.showBanner(true);
  18056. let challengeNum = DataMgr.getChallengeTimes();
  18057. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  18058. DataMgr.setChallengeTimes(1);
  18059. }
  18060. if (this.success && xGame.common.gameMode == GameMode.classic) {
  18061. DataMgr.setClassicTimes();
  18062. }
  18063. }
  18064. showChallengeLevel() {
  18065. if (DataMgr.getChallengeTimes() != 0)
  18066. return;
  18067. let skill = DataMgr.getSkillAccTimes();
  18068. let put = DataMgr.getPlaceBallLevelList().length;
  18069. if (skill >= 3 || put >= 5) {
  18070. xGame.uiMgr.Show(UIInvitation$1);
  18071. this.hide();
  18072. }
  18073. }
  18074. addAward(callback) {
  18075. if (!this.success) {
  18076. callback && callback();
  18077. return;
  18078. }
  18079. switch (xGame.common.gameMode) {
  18080. case GameMode.classic:
  18081. this.awardCoinNum = xGame.common.passAwardCoin;
  18082. this.awardDiamondNum = 0;
  18083. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  18084. break;
  18085. case GameMode.bigMove:
  18086. this.awardCoinNum = xGame.common.passAwardCoin;
  18087. this.awardDiamondNum = 0;
  18088. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  18089. callback && callback();
  18090. break;
  18091. case GameMode.placeBall:
  18092. let level = xGame.common.placeBallCurLevel;
  18093. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  18094. if (xGame.common.placeBallStarNum != 3) {
  18095. callback && callback();
  18096. return;
  18097. }
  18098. else {
  18099. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  18100. if (getAward) {
  18101. callback && callback();
  18102. return;
  18103. }
  18104. }
  18105. let cfg = cfgTable.placeballData[level];
  18106. let data = cfgTable.placeballData[level].award;
  18107. this.awardCoinNum = data[0];
  18108. this.awardDiamondNum = data[1];
  18109. if (cfg.type == PlaceBallType.challenge) {
  18110. this.awardDiamondNum = 0;
  18111. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  18112. }
  18113. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  18114. let diamondAward;
  18115. if (this.awardDiamondNum > 0) {
  18116. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  18117. xGame.common.getAward([diamondAward, coinAward], callback);
  18118. }
  18119. else {
  18120. xGame.common.getAward([coinAward], callback);
  18121. }
  18122. if (cfg.type == PlaceBallType.normal) {
  18123. DataMgr.setPlaceBallAward(level);
  18124. }
  18125. break;
  18126. default:
  18127. break;
  18128. }
  18129. }
  18130. playSecretaryAni() {
  18131. let parent = this.ui.secretary.displayObject;
  18132. parent.destroyChildren();
  18133. let xx = this.ui.secretary.width / 2;
  18134. let yy = this.ui.secretary.height;
  18135. let scale = xGame.common.getSecretaryScale();
  18136. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18137. if (this.success) {
  18138. let rand = Math.random() <= 0.5 ? 2 : 3;
  18139. xGame.common.secretary.play(data, rand, false, parent, () => {
  18140. xGame.common.secretary.play(data, 1, true, parent);
  18141. });
  18142. }
  18143. else {
  18144. xGame.common.secretary.play(data, 0, true, parent);
  18145. }
  18146. }
  18147. restartGame() {
  18148. switch (xGame.common.gameMode) {
  18149. case GameMode.classic:
  18150. xGame.eventMgr.event(RESTART_GAME);
  18151. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18152. break;
  18153. case GameMode.bigMove:
  18154. this.hide();
  18155. xGame.eventMgr.event(RESTART_GAME);
  18156. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18157. break;
  18158. default:
  18159. break;
  18160. }
  18161. }
  18162. hide() {
  18163. super.hide();
  18164. xGame.common.stopGirlPop(this.ui.talkNode);
  18165. PlatMgr.showBanner(false);
  18166. }
  18167. returnHome() {
  18168. this.hide();
  18169. let showFailWords = !this.success;
  18170. xGame.uiMgr.Show(UIMain$1, showFailWords);
  18171. }
  18172. clickLeftBtn() {
  18173. switch (xGame.common.gameMode) {
  18174. case GameMode.classic:
  18175. case GameMode.bigMove:
  18176. this.returnHome();
  18177. break;
  18178. case GameMode.placeBall:
  18179. let level = xGame.common.placeBallCurLevel;
  18180. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  18181. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18182. break;
  18183. default:
  18184. break;
  18185. }
  18186. }
  18187. powerStartPlaceBallLevel(level, btn) {
  18188. if (DataMgr.powerEnough()) {
  18189. btn.touchable = false;
  18190. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  18191. btn.touchable = true;
  18192. DataMgr.setPower(-1);
  18193. xGame.eventMgr.event(POWER_TIME);
  18194. this.startPlaceBallLevel(level);
  18195. }));
  18196. }
  18197. else {
  18198. xGame.uiMgr.Show(UIPower$1, 0);
  18199. }
  18200. }
  18201. clickRightBtn() {
  18202. switch (xGame.common.gameMode) {
  18203. case GameMode.classic:
  18204. case GameMode.bigMove:
  18205. this.restartGame();
  18206. break;
  18207. case GameMode.placeBall:
  18208. let level = xGame.common.placeBallCurLevel;
  18209. let data = DataMgr.getPlaceBallLevel(level);
  18210. let curPss = data.play && !data.isCur;
  18211. if (curPss) {
  18212. this.powerStartPlaceBallLevel(level + 1, this.ui.rightBtn);
  18213. }
  18214. else {
  18215. Moyu.sendDataEvent("placeBallNextLevel");
  18216. Moyu.showVideoAd(() => {
  18217. DataMgr.setPlaceBallLevel(level, 1);
  18218. this.startPlaceBallLevel(level + 1);
  18219. }, xGame.define.EAdType.placeBallNextLevel);
  18220. }
  18221. break;
  18222. default:
  18223. break;
  18224. }
  18225. }
  18226. startPlaceBallLevel(level) {
  18227. xGame.common.gameMode = GameMode.placeBall;
  18228. xGame.common.placeBallCurLevel = level;
  18229. xGame.uiMgr.Show(UIGame$1);
  18230. this.hide();
  18231. }
  18232. }
  18233. UIGameEnd$1.uiName = "UIGameEnd";
  18234. class ShowItem$1 {
  18235. constructor() {
  18236. this.ui = ui_ShowItem.createInstance();
  18237. }
  18238. destroySelf() {
  18239. if (!this.ui.isDisposed) {
  18240. this.ui.removeFromParent();
  18241. this.ui.dispose();
  18242. }
  18243. }
  18244. setParent(parent) {
  18245. parent.addChild(this.ui);
  18246. }
  18247. setPos(x, y) {
  18248. this.ui.x = x;
  18249. this.ui.y = y;
  18250. }
  18251. setUrl(index) {
  18252. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  18253. }
  18254. }
  18255. class UILevelProp$1 extends UIBase {
  18256. constructor() {
  18257. super();
  18258. this.firstPos = 385;
  18259. this.secondPos = 467;
  18260. this.showItemArr = [];
  18261. }
  18262. onConstructor() {
  18263. this.ui = ui_UILevelProp.createInstance();
  18264. this.contentPane = this.ui;
  18265. this.isEject = false;
  18266. this.addUIClick(this.ui.closeBtn, this.hide);
  18267. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18268. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  18269. }
  18270. show(level) {
  18271. super.show();
  18272. this.ui.t1.play();
  18273. this.level = level;
  18274. this.data = cfgTable.placeballData[this.level];
  18275. this.updateSelf();
  18276. this.showPreView();
  18277. this.moneyNode.ui.c1.selectedIndex = 2;
  18278. this.moneyNode.checkPowerTime();
  18279. this.moneyNode.powerChange();
  18280. }
  18281. showPreView() {
  18282. let item;
  18283. let data;
  18284. for (let index = 0; index < this.showItemArr.length; index++) {
  18285. item = this.showItemArr[index];
  18286. item.destroySelf();
  18287. }
  18288. this.showItemArr = [];
  18289. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  18290. for (const key in cfgData) {
  18291. data = cfgData[key];
  18292. item = new ShowItem$1();
  18293. item.setParent(this.ui.myNode.displayRoot);
  18294. item.setPos(data.x, data.y);
  18295. item.setUrl(data.value);
  18296. this.showItemArr.push(item);
  18297. }
  18298. }
  18299. updateSelf() {
  18300. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  18301. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  18302. if (this.data.ball == -1) {
  18303. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  18304. }
  18305. else {
  18306. this.ui.myNode.conditionTxt.text = "Reward";
  18307. }
  18308. let localData = DataMgr.getPlaceBallLevel(this.level);
  18309. let getAward = localData.getAward;
  18310. let cfg = cfgTable.placeballData[this.level];
  18311. let coin = this.data.award[0];
  18312. let diamond = this.data.award[1];
  18313. if (cfg.type == PlaceBallType.challenge) {
  18314. diamond = 0;
  18315. coin = 100;
  18316. }
  18317. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  18318. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  18319. this.ui.myNode.coinNode.numTxt.text = coin + "";
  18320. if (cfg.type == PlaceBallType.challenge) {
  18321. this.ui.myNode.coinNode.numTxt.text = "";
  18322. }
  18323. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  18324. if (coin > 0 && diamond > 0) {
  18325. this.ui.myNode.diamondNode.x = 385;
  18326. this.ui.myNode.coinNode.x = 467;
  18327. }
  18328. else {
  18329. this.ui.myNode.diamondNode.x = 385;
  18330. this.ui.myNode.coinNode.x = 385;
  18331. }
  18332. if (!getAward) {
  18333. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  18334. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  18335. }
  18336. else {
  18337. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  18338. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  18339. }
  18340. }
  18341. startGame() {
  18342. if (DataMgr.powerEnough()) {
  18343. this.ui.myNode.startBtn.touchable = false;
  18344. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  18345. console.log('zh:startGame ');
  18346. this.ui.myNode.startBtn.touchable = true;
  18347. DataMgr.setPower(-1);
  18348. xGame.eventMgr.event(POWER_TIME);
  18349. xGame.common.gameMode = GameMode.placeBall;
  18350. xGame.common.placeBallCurLevel = this.level;
  18351. xGame.uiMgr.Show(UIGame$1);
  18352. xGame.uiMgr.Hide(UILevelDisplay$1);
  18353. xGame.uiMgr.Hide(UIMain$1);
  18354. this.hide();
  18355. }));
  18356. }
  18357. else {
  18358. xGame.uiMgr.Show(UIPower$1);
  18359. }
  18360. }
  18361. hide() {
  18362. super.hide();
  18363. }
  18364. }
  18365. UILevelProp$1.uiName = "UILevelProp";
  18366. class PutBallLevelDisplay$1 {
  18367. constructor(ui, index) {
  18368. this.index = 0;
  18369. this.ui = ui;
  18370. this.index = index;
  18371. this.ui.onClick(this, this.clickSelf);
  18372. this.updateSelf();
  18373. this.ui.levelTxt.text = (this.index + 1) + "";
  18374. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  18375. this.ui.special.levelTxt.text = (this.index + 1) + "";
  18376. }
  18377. updateSelf() {
  18378. let level = this.index + 1;
  18379. this.data = DataMgr.getPlaceBallLevel(level);
  18380. this.ui.starNode.c1.selectedIndex = this.data.star;
  18381. let isChallenge = cfgTable.placeballData[level].type;
  18382. if (this.data.isCur) {
  18383. if (isChallenge) {
  18384. this.ui.c1.selectedIndex = 5;
  18385. }
  18386. else {
  18387. this.ui.c1.selectedIndex = 2;
  18388. }
  18389. }
  18390. else {
  18391. if (this.data.play) {
  18392. if (this.data.star == 3) {
  18393. this.ui.c1.selectedIndex = 0;
  18394. }
  18395. else {
  18396. this.ui.c1.selectedIndex = 1;
  18397. }
  18398. }
  18399. else {
  18400. if (isChallenge) {
  18401. this.ui.c1.selectedIndex = 4;
  18402. }
  18403. else {
  18404. this.ui.c1.selectedIndex = 3;
  18405. }
  18406. }
  18407. }
  18408. }
  18409. clickSelf() {
  18410. if (!this.data.play)
  18411. return;
  18412. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18413. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  18414. }
  18415. }
  18416. class UILevelDisplay$1 extends UIBase {
  18417. constructor() {
  18418. super();
  18419. }
  18420. onConstructor() {
  18421. this.ui = ui_UILevelDisplay.createInstance();
  18422. this.contentPane = this.ui;
  18423. this.isEject = false;
  18424. this.myList = this.ui.myNode.myList;
  18425. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  18426. this.levelItemArr = [];
  18427. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  18428. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  18429. this.myList.numItems = levelNum;
  18430. if (Moyu.isKs)
  18431. this.ui.closeNode.closeBtn.x += 100;
  18432. }
  18433. levelItemRender(index, target) {
  18434. let item = new PutBallLevelDisplay$1(target, index);
  18435. this.levelItemArr.push(item);
  18436. }
  18437. show() {
  18438. super.show();
  18439. this.updateLevel();
  18440. this.scrollToPlace();
  18441. }
  18442. updateLevel() {
  18443. let temp;
  18444. for (let index = 0; index < this.levelItemArr.length; index++) {
  18445. temp = this.levelItemArr[index];
  18446. temp.updateSelf();
  18447. }
  18448. }
  18449. scrollToPlace() {
  18450. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  18451. let passArr = DataMgr.getPlaceBallLevelList();
  18452. let offest = passArr.length;
  18453. if (offest >= maxNum - 1)
  18454. offest = maxNum - 1;
  18455. this.myList.scrollToView(offest, true, true);
  18456. }
  18457. hide() {
  18458. super.hide();
  18459. }
  18460. }
  18461. UILevelDisplay$1.uiName = "UILevelDisplay";
  18462. class UIMatching$1 extends UIBase {
  18463. constructor() {
  18464. super();
  18465. }
  18466. onConstructor() {
  18467. this.ui = ui_UIMatching.createInstance();
  18468. this.contentPane = this.ui;
  18469. this.isEject = false;
  18470. }
  18471. show(callback) {
  18472. super.show();
  18473. PlatMgr.showBanner(true);
  18474. this.callback = callback;
  18475. let user = Moyu.getUserInfo();
  18476. if (!this.selfPot) {
  18477. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  18478. }
  18479. if (!this.aiPot) {
  18480. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  18481. }
  18482. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  18483. this.ui.selfHead.nameTxt.text = user.nickName;
  18484. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  18485. this.ui.aiHead.nameTxt.text = "???";
  18486. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  18487. this.ui.selfHead.c1.selectedIndex = 0;
  18488. this.ui.aiHead.c1.selectedIndex = 0;
  18489. this.ui.selfHead.x = this.selfPot.x;
  18490. this.ui.selfHead.y = this.selfPot.y;
  18491. this.ui.aiHead.x = this.aiPot.x;
  18492. this.ui.aiHead.y = this.aiPot.y;
  18493. switch (xGame.common.gameMode) {
  18494. case GameMode.classic:
  18495. break;
  18496. case GameMode.bigMove:
  18497. this.initSkillData();
  18498. break;
  18499. default:
  18500. break;
  18501. }
  18502. this.ui.t1.play(Laya.Handler.create(this, () => {
  18503. this.ui.t2.play(Laya.Handler.create(this, () => {
  18504. switch (xGame.common.gameMode) {
  18505. case GameMode.classic:
  18506. this.waitingPeople();
  18507. break;
  18508. case GameMode.bigMove:
  18509. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  18510. break;
  18511. default:
  18512. break;
  18513. }
  18514. }));
  18515. }));
  18516. }
  18517. initSkillData() {
  18518. this.skillSelectData = [];
  18519. let skillUrl = xGame.common.skillIconList;
  18520. let skillName = xGame.common.skillNameList;
  18521. let skillLevel = DataMgr.getBigSkillList();
  18522. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  18523. for (let index = 0; index < 5; index++) {
  18524. let obj = {};
  18525. obj.skillImg = skillUrl[index];
  18526. obj.skillName = skillName[index];
  18527. obj.skillType = skillType[index];
  18528. obj.skillLevel = skillLevel[index];
  18529. this.skillSelectData.push(obj);
  18530. }
  18531. }
  18532. getAISkillLevel(myLevel) {
  18533. let video = xGame.common.upSkillLevel;
  18534. let aiLevel;
  18535. let temp;
  18536. if (video) {
  18537. temp = xGame.common.randomNum(-2, -1);
  18538. }
  18539. else {
  18540. if (myLevel <= 5) {
  18541. temp = xGame.common.randomNum(1, 3);
  18542. }
  18543. else if (myLevel <= 9) {
  18544. temp = xGame.common.randomNum(-2, 1);
  18545. }
  18546. else {
  18547. temp = xGame.common.randomNum(-4, 0);
  18548. }
  18549. }
  18550. aiLevel = temp + myLevel;
  18551. if (aiLevel <= 1)
  18552. aiLevel = 1;
  18553. if (aiLevel >= 10)
  18554. aiLevel = 10;
  18555. return aiLevel;
  18556. }
  18557. getAISkillType() {
  18558. return xGame.common.randomNum(1, 4);
  18559. let successTimes = DataMgr.getSkillSuccessTimes();
  18560. let info = cfgTable.aiskillData[successTimes];
  18561. if (!info) {
  18562. let max = Object.keys(cfgTable.aiskillData).length - 1;
  18563. info = cfgTable.aiskillData[max];
  18564. }
  18565. let dataArr = info.skillselect;
  18566. let myCfg = {};
  18567. for (let index = 0; index < dataArr.length; index++) {
  18568. let temp = dataArr[index].split('-');
  18569. myCfg[temp[0]] = {};
  18570. myCfg[temp[0]].id = parseInt(temp[0]);
  18571. myCfg[temp[0]].weight = parseInt(temp[1]);
  18572. }
  18573. let aiCfg = xGame.common.initWeight(myCfg);
  18574. let curData = xGame.common.getRandomWeightData(aiCfg);
  18575. return parseInt(curData.id);
  18576. }
  18577. getAISkillData(index) {
  18578. let myLevel = this.skillSelectData[index].skillLevel;
  18579. let aiLevel = this.getAISkillLevel(myLevel);
  18580. let aiType = this.getAISkillType() - 1;
  18581. return { aiLevel, aiType } = { aiLevel, aiType };
  18582. }
  18583. skillSelectFinish(index) {
  18584. let aiInfo = this.getAISkillData(index);
  18585. xGame.common.gameMgr.selfCurSkill = index;
  18586. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  18587. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  18588. this.ui.selfHead.c1.selectedIndex = 1;
  18589. this.ui.aiHead.c1.selectedIndex = 1;
  18590. let myData = this.skillSelectData[index];
  18591. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  18592. let guide = DataMgr.getSkillGuide();
  18593. if (guide == 0) {
  18594. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  18595. }
  18596. else {
  18597. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  18598. }
  18599. let aiData = this.skillSelectData[aiInfo.aiType];
  18600. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  18601. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  18602. this.waitingPeople();
  18603. }
  18604. waitingPeople() {
  18605. let time = xGame.common.randomNum(1000, 3000);
  18606. time += 1000;
  18607. Laya.timer.once(time, this, () => {
  18608. this.matchingSuccess();
  18609. });
  18610. }
  18611. matchingSuccess() {
  18612. let gameUI = xGame.common.gameUI;
  18613. let name = gameUI.ui.topNode.aiNameTxt.text;
  18614. let url = gameUI.ui.topNode.aiHeadLoader.url;
  18615. this.ui.aiHead.nameTxt.text = name;
  18616. this.ui.aiHead.headImg.url = url;
  18617. name = gameUI.ui.topNode.selfNameTxt.text;
  18618. url = gameUI.ui.topNode.selfHeadLoader.url;
  18619. this.ui.selfHead.nameTxt.text = name;
  18620. this.ui.selfHead.headImg.url = url;
  18621. this.ui.t3.play(Laya.Handler.create(this, () => {
  18622. this.callback && this.callback();
  18623. this.ui.t4.play(Laya.Handler.create(this, () => {
  18624. this.destroySelf();
  18625. }));
  18626. }));
  18627. }
  18628. destroySelf() {
  18629. this.callback = null;
  18630. this.skillSelectData = null;
  18631. this.selfPot = null;
  18632. this.aiPot = null;
  18633. if (!this.ui.isDisposed) {
  18634. this.ui.removeFromParent();
  18635. this.ui.dispose();
  18636. }
  18637. xGame.uiMgr.destroyUI(this);
  18638. }
  18639. }
  18640. UIMatching$1.uiName = "UIMatching";
  18641. class SkillDisplay$1 {
  18642. constructor(ui, data, uiIndex) {
  18643. this.starX = 0;
  18644. this.starY = 0;
  18645. this.index = 0;
  18646. this.ui = ui;
  18647. this.data = data;
  18648. this.index = uiIndex;
  18649. this.initSelf();
  18650. console.log('zh:SkillDisplay constructor this.skillData=', data);
  18651. }
  18652. initSelf() {
  18653. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  18654. this.ui.nameTxt.text = this.data.name;
  18655. this.ui.describeTxt.text = this.data.describe;
  18656. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  18657. this.ui.startBtn.onClick(this, this.startGame);
  18658. this.updateSelf();
  18659. }
  18660. updateSelf() {
  18661. this.checkTry();
  18662. let level = DataMgr.getBigSkillByIndex(this.index);
  18663. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  18664. }
  18665. checkTry() {
  18666. let index = this.index;
  18667. let level = DataMgr.getBigSkillByIndex(index);
  18668. if (level == null) {
  18669. DataMgr.setBigSkill(index, 1, false);
  18670. level = 1;
  18671. }
  18672. this.ui.levelTxt.text = "LV." + level;
  18673. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  18674. this.ui.tryNode.visible = true;
  18675. else
  18676. this.ui.tryNode.visible = false;
  18677. }
  18678. clickAddLevel() {
  18679. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18680. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  18681. Moyu.showVideoAd(() => {
  18682. DataMgr.setBigSkill(this.data.index, 1);
  18683. this.updateSelf();
  18684. xGame.common.upSkillLevel = true;
  18685. }, EAdType.upSkill);
  18686. }
  18687. startGame() {
  18688. if (this.data.index == 3) {
  18689. alert('Coming soon!');
  18690. return;
  18691. }
  18692. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18693. let needCoin = xGame.common.bigMoveNeedCoin;
  18694. xGame.common.passAwardCoin = 2000;
  18695. let guide = DataMgr.getSkillGuide();
  18696. console.log('zh:startGame guide=' + guide);
  18697. xGame.common.temSelfLevel = 0;
  18698. if (guide == 0) {
  18699. needCoin = 0;
  18700. xGame.common.temSelfLevel = 100;
  18701. }
  18702. if (DataMgr.coinEnough(needCoin)) {
  18703. DataMgr.setCoin(-needCoin);
  18704. xGame.common.curPlayerSkillType = this.index;
  18705. if (guide == 0)
  18706. xGame.common.curPlayerSkillType = 0;
  18707. xGame.uiMgr.Show(UIGame$1);
  18708. xGame.uiMgr.Hide(UIMain$1);
  18709. xGame.uiMgr.Show(UIMatching$1, () => {
  18710. xGame.common.gameUI.ui.alpha = 1;
  18711. xGame.common.gameUI.startGame();
  18712. xGame.uiMgr.Hide(UISkill$1);
  18713. });
  18714. }
  18715. else {
  18716. xGame.uiMgr.Show(UIAddProp$1, 0);
  18717. Moyu.sendDataEvent("AddCoinVideo");
  18718. }
  18719. }
  18720. }
  18721. class UISkill$1 extends UIBase {
  18722. constructor() {
  18723. super();
  18724. this.skillData = [];
  18725. }
  18726. onConstructor() {
  18727. this.ui = ui_UISkill.createInstance();
  18728. this.contentPane = this.ui;
  18729. this.isEject = false;
  18730. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18731. this.initSkillData();
  18732. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  18733. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  18734. this.displayList = [];
  18735. this.ui.skillNode.skillList.numItems = 4;
  18736. this.addUIClick(this.ui, this.interuptSecretary);
  18737. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  18738. this.ui.talkNode.visible = false;
  18739. if (Moyu.isKs)
  18740. this.ui.closeNode.closeBtn.x += 100;
  18741. }
  18742. show() {
  18743. super.show();
  18744. this.playSecretaryIdle();
  18745. this.moneyNode.ui.c1.selectedIndex = 1;
  18746. Laya.timer.clearAll(this);
  18747. xGame.soundMgr.playSound("s_start");
  18748. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18749. let guide = DataMgr.getSkillGuide();
  18750. this.ui.guideNode.visible = guide == 0;
  18751. let item = this.getSkillItemByUIIndex(0);
  18752. if (guide == 0) {
  18753. item.ui.c1.selectedIndex = 1;
  18754. }
  18755. else {
  18756. item.ui.c1.selectedIndex = 0;
  18757. }
  18758. this.ui.guideNode.guideBtn.visible = guide == 0;
  18759. for (let index = 0; index < this.displayList.length; index++) {
  18760. this.displayList[index].checkTry();
  18761. }
  18762. }
  18763. getSkillItemByUIIndex(cur) {
  18764. for (let index = 0; index < this.displayList.length; index++) {
  18765. if (this.displayList[index].index == cur) {
  18766. return this.displayList[index];
  18767. }
  18768. }
  18769. }
  18770. enterGuideLevel() {
  18771. let item = this.getSkillItemByUIIndex(0);
  18772. item.startGame();
  18773. if (DataMgr.getNewUser())
  18774. Moyu.sendDataEvent("gameStart1");
  18775. }
  18776. initSkillData() {
  18777. this.skillData = [];
  18778. let nameList = xGame.common.skillNameList;
  18779. let iconList = xGame.common.skillIconList;
  18780. let describeList = [
  18781. "Jump shot executed — ball bounced and pocketed an extra one!",
  18782. "Bonus Sweep: A random follow-up strike hits 1 extra ball after your shot!",
  18783. "Freeze Effect: Your shot freezes 1 random ball — enemy can’t hit it, and others bounce off!"
  18784. ];
  18785. let data;
  18786. for (let index = 0; index < nameList.length; index++) {
  18787. data = {};
  18788. data.name = nameList[index];
  18789. data.icon = iconList[index];
  18790. data.describe = describeList[index];
  18791. data.index = index;
  18792. this.skillData.push(data);
  18793. }
  18794. }
  18795. updateSkillItem(index, target) {
  18796. if (this.displayList[index] == null) {
  18797. let uiIndex;
  18798. switch (index) {
  18799. case 0:
  18800. uiIndex = 1;
  18801. break;
  18802. case 1:
  18803. uiIndex = 0;
  18804. break;
  18805. case 2:
  18806. uiIndex = 2;
  18807. break;
  18808. case 3:
  18809. uiIndex = 3;
  18810. break;
  18811. default:
  18812. break;
  18813. }
  18814. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  18815. this.displayList.push(temp);
  18816. }
  18817. }
  18818. playSecretaryIdle() {
  18819. let parent = this.ui.secretary.displayObject;
  18820. parent.destroyChildren();
  18821. let xx = this.ui.secretary.width / 2;
  18822. let yy = this.ui.secretary.height;
  18823. let scale = xGame.common.getSecretaryScale();
  18824. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18825. xGame.common.secretary.play(data, 1, true, parent);
  18826. }
  18827. returnUIMain() {
  18828. this.hide();
  18829. xGame.common.stopGirlPop(this.ui.talkNode);
  18830. xGame.uiMgr.Show(UIMain$1);
  18831. }
  18832. interuptSecretary() {
  18833. Laya.timer.clearAll(this);
  18834. this.playSecretaryRandomSound();
  18835. }
  18836. playSecretaryRandomSound() {
  18837. if (this.isHide)
  18838. return;
  18839. let time = xGame.common.randomNum(45000, 60000);
  18840. Laya.timer.once(time, this, () => {
  18841. if (this.isHide)
  18842. return;
  18843. let index = xGame.common.randomNum(4, 7);
  18844. xGame.soundMgr.playSound("s_main0" + index);
  18845. let words = 1;
  18846. switch (index) {
  18847. case 4:
  18848. words = 5;
  18849. break;
  18850. case 5:
  18851. words = 3;
  18852. break;
  18853. case 6:
  18854. words = 6;
  18855. break;
  18856. case 7:
  18857. words = 7;
  18858. break;
  18859. default:
  18860. break;
  18861. }
  18862. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18863. this.playSecretaryRandomSound();
  18864. });
  18865. }
  18866. }
  18867. UISkill$1.uiName = "UISkill";
  18868. class UIAddProp$1 extends UIBase {
  18869. constructor() {
  18870. super();
  18871. this.curType = "";
  18872. }
  18873. onConstructor() {
  18874. this.ui = ui_UIAddProp.createInstance();
  18875. this.contentPane = this.ui;
  18876. this.isEject = false;
  18877. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  18878. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  18879. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  18880. this.updateUI();
  18881. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  18882. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  18883. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  18884. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  18885. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  18886. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  18887. }
  18888. show(type) {
  18889. super.show();
  18890. this.curType = type == 0 ? "coin" : "diamond";
  18891. this.switchBtn("");
  18892. this.ui.t0.play();
  18893. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  18894. PlatMgr.showInsert(true);
  18895. }
  18896. closeSelf() {
  18897. this.hide();
  18898. }
  18899. updateUI() {
  18900. let data = cfgTable.moneyData;
  18901. let temp;
  18902. let obj;
  18903. for (const key in data) {
  18904. temp = data[key];
  18905. obj = this.ui.myNode["node" + key];
  18906. if (parseInt(key) <= 2) {
  18907. obj.diamondTxt.text = "+" + temp.num;
  18908. }
  18909. else {
  18910. obj.coinTxt.text = temp.num;
  18911. obj.diamondTxt.text = temp.get.split('_')[1];
  18912. }
  18913. }
  18914. this.updateDiamondShare();
  18915. }
  18916. updateDiamondShare() {
  18917. let data = DataMgr.getShareDiamondTimes();
  18918. if (data >= xGame.common.maxShareDiamondTimes) {
  18919. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  18920. this.ui.myNode.node1.touchable = false;
  18921. }
  18922. else {
  18923. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  18924. this.ui.myNode.node1.touchable = true;
  18925. }
  18926. }
  18927. switchBtn(type) {
  18928. if (type == "")
  18929. type = this.curType;
  18930. else {
  18931. if (this.curType == type) {
  18932. return;
  18933. }
  18934. else {
  18935. this.curType = type;
  18936. }
  18937. }
  18938. if (type == "coin") {
  18939. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  18940. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  18941. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  18942. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  18943. this.ui.myNode.c1.selectedIndex = 0;
  18944. }
  18945. else {
  18946. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  18947. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  18948. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  18949. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  18950. this.ui.myNode.c1.selectedIndex = 1;
  18951. }
  18952. }
  18953. convertCoin(index) {
  18954. let data = cfgTable.moneyData[index];
  18955. let coinNum = data.num;
  18956. let str = data.get.split('_')[1];
  18957. let needDiamond = parseInt(str);
  18958. if (DataMgr.diamondEnough(needDiamond)) {
  18959. DataMgr.setDiamond(-needDiamond);
  18960. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  18961. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  18962. }
  18963. else {
  18964. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  18965. this.switchBtn("diamond");
  18966. }
  18967. }
  18968. videoGetDiamond() {
  18969. let num = cfgTable.moneyData[2].num;
  18970. Moyu.showVideoAd(() => {
  18971. xGame.common.playObjFlyAnim(num, Prop.diamond);
  18972. this.closeSelf();
  18973. }, EAdType.addDiamond);
  18974. }
  18975. videoGetCoin() {
  18976. Moyu.showVideoAd(() => {
  18977. xGame.common.playObjFlyAnim(2000, Prop.coin);
  18978. this.closeSelf();
  18979. }, EAdType.addCoin);
  18980. }
  18981. shareGetDiamond() {
  18982. let times = DataMgr.getShareDiamondTimes();
  18983. if (times >= xGame.common.maxShareDiamondTimes) {
  18984. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  18985. }
  18986. else {
  18987. if (Moyu.isTT) {
  18988. let num = cfgTable.moneyData[1].num;
  18989. Moyu.shareVideo = '';
  18990. Moyu.shareGame((success) => {
  18991. if (success) {
  18992. xGame.uiMgr.Show(UIMsg$1, "分享成功!");
  18993. xGame.common.playObjFlyAnim(num, Prop.diamond);
  18994. DataMgr.setShareDiamondTimes(1);
  18995. this.updateDiamondShare();
  18996. }
  18997. else {
  18998. xGame.uiMgr.Show(UIMsg$1, "分享失败!");
  18999. }
  19000. });
  19001. }
  19002. else {
  19003. Moyu.showVideoAd(() => {
  19004. let diamond = xGame.common.randomNum(50, 100);
  19005. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  19006. DataMgr.setShareDiamondTimes(1);
  19007. this.updateDiamondShare();
  19008. }, EAdType.randomDiamond);
  19009. }
  19010. }
  19011. }
  19012. openPutBallView() {
  19013. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  19014. let skill = xGame.uiMgr.getUI(UISkill$1);
  19015. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  19016. let uigame = xGame.uiMgr.getUI(UIGame$1);
  19017. if (end && !end.isHide) {
  19018. xGame.uiMgr.Hide(UIGameEnd$1);
  19019. xGame.uiMgr.Show(UIMain$1);
  19020. }
  19021. if (skill && !skill.isHide)
  19022. xGame.uiMgr.Hide(UISkill$1);
  19023. if (uigame && !uigame.isHide)
  19024. xGame.uiMgr.Hide(UIGame$1);
  19025. if (level && !level.isHide) {
  19026. }
  19027. else {
  19028. xGame.uiMgr.Show(UILevelDisplay$1);
  19029. }
  19030. this.closeSelf();
  19031. }
  19032. }
  19033. UIAddProp$1.uiName = "UIAddProp";
  19034. class MoneyNode$1 {
  19035. constructor(ui) {
  19036. this.leftTime = 0;
  19037. this.ui = ui;
  19038. this.ui.addCoinBtn.onClick(this, this.addCoin);
  19039. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  19040. this.ui.addPowerBtn.onClick(this, this.addPower);
  19041. this.ui.c1.selectedIndex = 1;
  19042. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  19043. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  19044. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  19045. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  19046. this.coinChange();
  19047. this.diamondChange();
  19048. this.powerChange();
  19049. }
  19050. addPower() {
  19051. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19052. xGame.uiMgr.Show(UIPower$1);
  19053. }
  19054. powerChange() {
  19055. let powerNum = DataMgr.getPower();
  19056. this.ui.powerTxt.text = powerNum + "";
  19057. }
  19058. checkPowerTime() {
  19059. let cur = new Date().getTime();
  19060. let last = DataMgr.getPowerTime();
  19061. if (last == 0) {
  19062. last = cur;
  19063. DataMgr.setPowerTime(cur);
  19064. }
  19065. let power = DataMgr.getPower();
  19066. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  19067. Laya.timer.clearAll(this);
  19068. if (power >= xGame.common.natureMaxPower) {
  19069. this.ui.powerTimeTxt.text = "";
  19070. DataMgr.setPowerTime(cur);
  19071. return;
  19072. }
  19073. if (power + offset >= xGame.common.natureMaxPower) {
  19074. DataMgr.setPower(xGame.common.natureMaxPower, false);
  19075. this.ui.powerTimeTxt.text = "";
  19076. DataMgr.setPowerTime(cur);
  19077. }
  19078. else {
  19079. if (offset > 0) {
  19080. DataMgr.setPower(offset);
  19081. DataMgr.setPowerTime(cur);
  19082. }
  19083. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  19084. this.leftTime = xGame.common.powerRecoverNum - time;
  19085. if (this.leftTime <= 0)
  19086. this.leftTime = 0;
  19087. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  19088. Laya.timer.loop(1000, this, this.updatePowerTime);
  19089. }
  19090. }
  19091. updatePowerTime() {
  19092. this.leftTime -= 1;
  19093. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  19094. if (this.leftTime <= 0) {
  19095. this.checkPowerTime();
  19096. }
  19097. }
  19098. coinChange() {
  19099. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  19100. }
  19101. diamondChange() {
  19102. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  19103. }
  19104. addCoin() {
  19105. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19106. Moyu.sendDataEvent("AddCoinBtn");
  19107. xGame.uiMgr.Show(UIAddProp$1, 0);
  19108. }
  19109. addDiamond() {
  19110. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19111. Moyu.sendDataEvent("AddDiamondBtn");
  19112. xGame.uiMgr.Show(UIAddProp$1, 1);
  19113. }
  19114. }
  19115. class SettingNode$1 {
  19116. constructor(ui) {
  19117. this.showSetting = false;
  19118. this.openSound = true;
  19119. this.openShake = true;
  19120. this.ui = ui;
  19121. this.ui.soundBtn.onClick(this, this.switchSound);
  19122. this.ui.shakeBtn.onClick(this, this.switchShake);
  19123. this.ui.xyBtn.onClick(this, this.onXy);
  19124. this.ui.clickNode.onClick(this, this.changeSetting);
  19125. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  19126. }
  19127. changeSetting() {
  19128. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19129. this.showSetting = !this.showSetting;
  19130. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  19131. }
  19132. switchSound() {
  19133. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19134. this.openSound = !this.openSound;
  19135. Moyu.onSetting(this.openSound, this.openShake);
  19136. xGame.soundMgr.onSetting(this.openSound);
  19137. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  19138. }
  19139. switchShake() {
  19140. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19141. this.openShake = !this.openShake;
  19142. Moyu.onSetting(this.openSound, this.openShake);
  19143. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  19144. }
  19145. onXy() {
  19146. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19147. MoyuMgr$1.showXy(1);
  19148. }
  19149. }
  19150. class UIDraw$1 extends UIBase {
  19151. constructor() {
  19152. super();
  19153. this.curKey = 0;
  19154. }
  19155. onConstructor() {
  19156. this.ui = ui_UIDraw.createInstance();
  19157. this.contentPane = this.ui;
  19158. this.isEject = false;
  19159. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19160. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  19161. this.addUIClick(this.ui.drawBtn, this.startDraw);
  19162. this.initDraw();
  19163. this.initUI();
  19164. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  19165. if (Moyu.isKs)
  19166. this.ui.closeNode.closeBtn.x += 100;
  19167. }
  19168. show() {
  19169. super.show();
  19170. this.ui.t0.play();
  19171. this.playSecretaryIdle();
  19172. this.updateDraw();
  19173. this.checkFree();
  19174. if (PlatMgr.bannerDelay > 0) {
  19175. this.ui.closeNode.closeBtn.visible = false;
  19176. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  19177. this.ui.closeNode.closeBtn.visible = true;
  19178. });
  19179. }
  19180. PlatMgr.showRateBanner();
  19181. }
  19182. hide() {
  19183. Laya.timer.clearAll(this);
  19184. super.hide();
  19185. }
  19186. checkFree() {
  19187. let isFree = DataMgr.getDailyfreeDrawTimes();
  19188. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  19189. }
  19190. initDraw() {
  19191. this.drawObj = [];
  19192. let data = cfgTable.drawData;
  19193. let temp;
  19194. let weight = 0;
  19195. for (const key in data) {
  19196. temp = data[key];
  19197. weight += temp.weight;
  19198. this.drawObj.push(weight);
  19199. }
  19200. this.allWeight = weight;
  19201. }
  19202. initUI() {
  19203. let data = cfgTable.drawData;
  19204. let temp;
  19205. let img;
  19206. let txt;
  19207. for (const key in data) {
  19208. temp = data[key];
  19209. img = this.ui.myNode.rotNode["img" + key];
  19210. txt = this.ui.myNode.rotNode["txt" + key];
  19211. img.url = xGame.common.getGameIconUrl(temp.icon);
  19212. txt.visible = true;
  19213. if (temp.award > 2) {
  19214. img.rotation = 0;
  19215. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  19216. }
  19217. else {
  19218. img.rotation = temp.rotation;
  19219. txt.text = temp.num;
  19220. }
  19221. }
  19222. }
  19223. getCurkey() {
  19224. let rand = Math.random() * this.allWeight;
  19225. let temp;
  19226. for (let index = 0; index < this.drawObj.length - 1; index++) {
  19227. temp = this.drawObj[index];
  19228. if (index == 0) {
  19229. if (rand < temp) {
  19230. return index + 1;
  19231. }
  19232. }
  19233. else {
  19234. if (rand >= temp && rand < this.drawObj[index + 1]) {
  19235. return index + 1;
  19236. }
  19237. }
  19238. }
  19239. return 2;
  19240. }
  19241. startDraw() {
  19242. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  19243. if (freeTimes > 0) {
  19244. this.beginDraw();
  19245. DataMgr.setDailyfreeDrawTimes(0);
  19246. this.checkFree();
  19247. }
  19248. else {
  19249. Moyu.sendDataEvent("turntable");
  19250. Moyu.showVideoAd(() => {
  19251. this.beginDraw();
  19252. }, EAdType.draw);
  19253. }
  19254. }
  19255. beginDraw() {
  19256. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  19257. this.ui.drawBtn.touchable = false;
  19258. this.curKey = this.getCurkey();
  19259. console.log("当前key", this.curKey);
  19260. let cell = 60;
  19261. let lap = 3;
  19262. let angle = cell * (this.curKey - 1) + lap * 360;
  19263. let target = this.ui.myNode.rotNode;
  19264. target.rotation = 0;
  19265. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  19266. console.log("旋转完成");
  19267. this.ui.drawBtn.touchable = true;
  19268. this.getAward();
  19269. }));
  19270. }
  19271. getAward() {
  19272. let data = cfgTable.drawData[this.curKey];
  19273. let temp = new AwardType();
  19274. temp.type = data.award;
  19275. temp.num = data.num;
  19276. xGame.common.getAward([temp], () => {
  19277. DataMgr.setDrawTimes(1);
  19278. this.updateDraw();
  19279. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  19280. });
  19281. }
  19282. updateDraw() {
  19283. let drawTimes = DataMgr.getDrawTimes();
  19284. let awardTimes = DataMgr.getDrawAwardTimes();
  19285. if (Math.floor(drawTimes / 3) > awardTimes) {
  19286. this.ui.extraNode.boxBtn.t0.play(null, -1);
  19287. this.ui.extraNode.boxBtn.touchable = true;
  19288. this.ui.extraNode.tipsTxt.text = "3/3";
  19289. this.ui.extraNode.barNode.width = 265;
  19290. this.getExtraAward();
  19291. }
  19292. else {
  19293. this.ui.extraNode.boxBtn.t0.stop();
  19294. this.ui.extraNode.boxBtn.touchable = false;
  19295. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  19296. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  19297. }
  19298. let data = cfgTable.drawData[1];
  19299. if (awardTimes == 0) {
  19300. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  19301. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  19302. this.ui.myNode.rotNode.img1.rotation = 0;
  19303. }
  19304. else {
  19305. let award = data.nextid;
  19306. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  19307. this.ui.myNode.rotNode.txt1.text = award[1];
  19308. this.ui.myNode.rotNode.img1.rotation = 0;
  19309. }
  19310. }
  19311. getExtraAward() {
  19312. let drawTimes = DataMgr.getDrawTimes();
  19313. let awardTimes = DataMgr.getDrawAwardTimes();
  19314. let data = cfgTable.drawData[1];
  19315. let award = new AwardType();
  19316. if (awardTimes == 0) {
  19317. award.num = data.num;
  19318. award.type = data.award;
  19319. xGame.common.getAward([award], () => {
  19320. let all = Math.floor(drawTimes / 3);
  19321. DataMgr.setDrawAwardTimes(all);
  19322. this.updateDraw();
  19323. });
  19324. }
  19325. else {
  19326. award.num = parseInt(data.nextid[1]);
  19327. award.type = parseInt(data.nextid[0]);
  19328. xGame.common.getAward([award], () => {
  19329. let all = Math.floor(drawTimes / 3);
  19330. DataMgr.setDrawAwardTimes(all);
  19331. this.updateDraw();
  19332. });
  19333. }
  19334. }
  19335. closeSelf() {
  19336. this.hide();
  19337. }
  19338. playSecretaryIdle() {
  19339. let parent = this.ui.secretary.displayObject;
  19340. parent.destroyChildren();
  19341. let xx = this.ui.secretary.width / 2;
  19342. let yy = this.ui.secretary.height;
  19343. let scale = xGame.common.getSecretaryScale();
  19344. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19345. xGame.common.secretary.play(data, 1, true, parent);
  19346. }
  19347. }
  19348. UIDraw$1.uiName = "UIDraw";
  19349. class UIRanking$1 extends UIBase {
  19350. constructor() {
  19351. super();
  19352. this.showSelf = true;
  19353. this.rankType = 1;
  19354. this.rankList = [];
  19355. this.myIndex = 0;
  19356. this.myStar = 0;
  19357. }
  19358. onConstructor() {
  19359. this.ui = ui_UIRanking.createInstance();
  19360. this.contentPane = this.ui;
  19361. this.isEject = false;
  19362. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  19363. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  19364. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  19365. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  19366. this.ui.myNode.myList.setVirtual();
  19367. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  19368. }
  19369. show() {
  19370. super.show();
  19371. this.myIndex = 51;
  19372. Moyu.getRankList({
  19373. rankId: xGame.common.curRankID,
  19374. type: MoyuRankType.total,
  19375. page: 1,
  19376. pageSize: 50,
  19377. }, this, this.updateItemData);
  19378. this.updateSelf();
  19379. let self = Moyu.getUserInfo();
  19380. if (!self.isAuth) {
  19381. Moyu.initUser(this, () => {
  19382. DataMgr.upRankData();
  19383. });
  19384. }
  19385. }
  19386. updateSelfItem() {
  19387. let self = Moyu.getUserInfo();
  19388. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  19389. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > 50 ? "未上榜" : this.myIndex.toString();
  19390. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  19391. this.ui.myNode.selfNode.nameTxt.text = Moyu.platType < 11 ? self.nickName : "myself";
  19392. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  19393. }
  19394. updateItemData(data) {
  19395. this.myStar = xGame.common.getAllStarNum();
  19396. if (this.rankList.length < 2) {
  19397. this.rankList = data;
  19398. let self = Moyu.getUserInfo();
  19399. for (let i = 0; i < data.length; i++) {
  19400. let data = this.rankList[i];
  19401. if (data.userId == self.userId) {
  19402. this.rankList.splice(i, 1);
  19403. break;
  19404. }
  19405. }
  19406. for (let i = 0; i < data.length; i++) {
  19407. let data = this.rankList[i];
  19408. if (data.rankScore < this.myStar && this.myIndex > 50) {
  19409. this.myIndex = i + 1;
  19410. let user = { headIcon: self.headIcon, nickName: "myself" };
  19411. let ud = { user: user, data: {} };
  19412. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  19413. if (Moyu.platType < 11) {
  19414. user.headIcon = self.headIcon;
  19415. user.nickName = self.nickName;
  19416. }
  19417. this.rankList.splice(i, 0, md);
  19418. break;
  19419. }
  19420. }
  19421. }
  19422. this.updateSelfItem();
  19423. this.ui.myNode.myList.numItems = this.rankList.length;
  19424. }
  19425. updateItemUI(index, obj) {
  19426. let data = this.rankList[index];
  19427. let userData = JSON.parse(data.userData).user;
  19428. obj.nameTxt.text = userData.nickName.toString();
  19429. obj.valueTxt.text = data.rankScore;
  19430. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  19431. obj.rankTxt.text = index + 1;
  19432. switch (index) {
  19433. case 0:
  19434. this.setImg(obj, 1, 0, 0);
  19435. obj.rankTxt.color = "#FFC047";
  19436. break;
  19437. case 1:
  19438. this.setImg(obj, 0, 1, 0);
  19439. obj.rankTxt.color = "#ACACAC";
  19440. break;
  19441. case 2:
  19442. this.setImg(obj, 0, 0, 1);
  19443. obj.rankTxt.color = "#D09672";
  19444. break;
  19445. default:
  19446. this.setImg(obj, 0, 0, 0);
  19447. obj.rankTxt.color = "#496FAB";
  19448. break;
  19449. }
  19450. }
  19451. setImg(obj, a, b, c) {
  19452. obj.img1.visible = a ? true : false;
  19453. obj.img2.visible = b ? true : false;
  19454. obj.img3.visible = c ? true : false;
  19455. }
  19456. changeList(type) {
  19457. this.rankType = type;
  19458. this.updateSelf();
  19459. }
  19460. changeSelfNode() {
  19461. this.showSelf = !this.showSelf;
  19462. this.updateSelf();
  19463. }
  19464. updateSelf() {
  19465. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  19466. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  19467. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  19468. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  19469. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  19470. }
  19471. }
  19472. UIRanking$1.uiName = "UIRanking";
  19473. class UISecretary$1 extends UIBase {
  19474. constructor() {
  19475. super();
  19476. this.curIndex = 1;
  19477. }
  19478. onConstructor() {
  19479. this.ui = ui_UISecretary.createInstance();
  19480. this.contentPane = this.ui;
  19481. this.isEject = false;
  19482. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  19483. this.addUIClick(this.ui.leftBtn, this.turnLeft);
  19484. this.addUIClick(this.ui.rightBtn, this.turnRight);
  19485. this.nodeObj = { left: null, right: null, cur: null };
  19486. this.nodeObj.left = this.ui.myNode.gameNode1;
  19487. this.nodeObj.right = this.ui.myNode.gameNode2;
  19488. this.nodeObj.cur = this.ui.myNode.gameNode3;
  19489. }
  19490. show() {
  19491. super.show();
  19492. this.ui.t0.play();
  19493. this.updateData();
  19494. }
  19495. addSecretarySpine(node, spineName) {
  19496. if (spineName == "mishu") {
  19497. if (this.secretarySpine1) {
  19498. node.displayObject.destroyChildren();
  19499. this.playWoman(this.secretarySpine1, node.displayObject);
  19500. }
  19501. else {
  19502. let spine1 = new SpineMgr("mishu", () => {
  19503. this.secretarySpine1 = spine1;
  19504. this.playWoman(this.secretarySpine1, node.displayObject);
  19505. });
  19506. }
  19507. }
  19508. else {
  19509. if (this.secretarySpine2) {
  19510. node.displayObject.destroyChildren();
  19511. this.playWoman(this.secretarySpine2, node.displayObject);
  19512. }
  19513. else {
  19514. let spine2 = new SpineMgr("xiaomishu2", () => {
  19515. this.secretarySpine2 = spine2;
  19516. this.playWoman(this.secretarySpine2, node.displayObject);
  19517. });
  19518. }
  19519. }
  19520. }
  19521. playWoman(node, parent) {
  19522. let xx = this.ui.myNode.gameNode1.secretary.width / 2;
  19523. let yy = this.ui.myNode.gameNode1.secretary.height;
  19524. let scale = 1.5;
  19525. if (node == this.secretarySpine2) {
  19526. scale = 1.2;
  19527. }
  19528. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19529. node.play(data, 1, true, parent);
  19530. }
  19531. turnLeft() {
  19532. this.curIndex--;
  19533. if (this.curIndex < 1) {
  19534. this.curIndex = 2;
  19535. }
  19536. let left = this.nodeObj.left;
  19537. let right = this.nodeObj.right;
  19538. let cur = this.nodeObj.cur;
  19539. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  19540. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  19541. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  19542. this.updateData();
  19543. }));
  19544. this.ui.myNode.setChildIndex(right, 2);
  19545. this.nodeObj.left = cur;
  19546. this.nodeObj.right = left;
  19547. this.nodeObj.cur = right;
  19548. }
  19549. turnRight() {
  19550. this.curIndex++;
  19551. if (this.curIndex > 2) {
  19552. this.curIndex = 1;
  19553. }
  19554. let left = this.nodeObj.left;
  19555. let right = this.nodeObj.right;
  19556. let cur = this.nodeObj.cur;
  19557. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  19558. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  19559. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  19560. this.updateData();
  19561. }));
  19562. this.ui.myNode.setChildIndex(left, 2);
  19563. this.nodeObj.left = right;
  19564. this.nodeObj.right = cur;
  19565. this.nodeObj.cur = left;
  19566. }
  19567. updateData() {
  19568. let data = cfgTable.secretaryshopData;
  19569. let children = this.ui.myNode._children;
  19570. let temp;
  19571. let curData;
  19572. for (let index = 0; index < children.length; index++) {
  19573. temp = children[index];
  19574. if (index == 2) {
  19575. curData = data[this.curIndex];
  19576. temp.purchaseBtn.touchable = true;
  19577. }
  19578. else {
  19579. temp.purchaseBtn.touchable = false;
  19580. if (this.curIndex == 1) {
  19581. curData = data[2];
  19582. }
  19583. else {
  19584. curData = data[1];
  19585. }
  19586. }
  19587. temp.heightTxt.text = curData.height;
  19588. temp.foodTxt.text = curData.food;
  19589. temp.historyTxt.text = curData.history;
  19590. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  19591. this.addSecretarySpine(temp.secretary, curData.spine);
  19592. let womanIndex = curData.id - 1;
  19593. let getWoman = DataMgr.getSecretary(womanIndex);
  19594. let curUse = DataMgr.getCurSecretary();
  19595. if (getWoman) {
  19596. if (curUse == womanIndex) {
  19597. temp.purchaseBtn.c1.selectedIndex = 1;
  19598. }
  19599. else {
  19600. temp.purchaseBtn.c1.selectedIndex = 2;
  19601. }
  19602. }
  19603. else {
  19604. temp.purchaseBtn.c1.selectedIndex = 0;
  19605. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  19606. }
  19607. temp.purchaseBtn.offClick(this, this.clickSecretary);
  19608. temp.purchaseBtn.onClick(this, this.clickSecretary, [getWoman, curUse, womanIndex, curData.price]);
  19609. }
  19610. }
  19611. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  19612. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19613. if (getWoman) {
  19614. if (curUse != womanIndex) {
  19615. console.log();
  19616. DataMgr.setCurSecretary(womanIndex);
  19617. this.updateData();
  19618. }
  19619. }
  19620. else {
  19621. let need = needDiamond;
  19622. if (DataMgr.diamondEnough(need)) {
  19623. DataMgr.setDiamond(-need);
  19624. DataMgr.setSecretary(womanIndex, 1);
  19625. DataMgr.setCurSecretary(womanIndex);
  19626. this.updateData();
  19627. }
  19628. else {
  19629. xGame.uiMgr.Show(UIAddProp$1, 1);
  19630. }
  19631. }
  19632. }
  19633. closeSelf() {
  19634. this.hide();
  19635. }
  19636. }
  19637. UISecretary$1.uiName = "UISecretary";
  19638. class BallRodDisplay$1 {
  19639. constructor(ui, index) {
  19640. this.index = 0;
  19641. this.uiIndex = 0;
  19642. this.ui = ui;
  19643. this.index = index;
  19644. this.initData();
  19645. }
  19646. initData() {
  19647. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  19648. let data = cfgTable.ballrodData[this.index + 1];
  19649. this.ui.nameTxt.text = data.name;
  19650. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  19651. this.ui.levelNode.c1.selectedIndex = data.quality;
  19652. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  19653. if (data.spine) {
  19654. this.mySpine = new SpineMgr(data.spine, () => {
  19655. let xx = 150;
  19656. let yy = 70;
  19657. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  19658. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  19659. });
  19660. }
  19661. }
  19662. updateSelf() {
  19663. let get = DataMgr.getBallRod(this.index);
  19664. if (get == null)
  19665. get = 1;
  19666. let curUse = DataMgr.getCurBallRod();
  19667. if (get) {
  19668. if (curUse == this.index) {
  19669. this.ui.purchaseBtn.c1.selectedIndex = 0;
  19670. }
  19671. else {
  19672. this.ui.purchaseBtn.c1.selectedIndex = 1;
  19673. }
  19674. }
  19675. else {
  19676. this.ui.purchaseBtn.c1.selectedIndex = 2;
  19677. }
  19678. }
  19679. buyBallRod() {
  19680. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19681. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  19682. switch (selectedIndex) {
  19683. case 0:
  19684. break;
  19685. case 1:
  19686. DataMgr.setCurBallRod(this.index);
  19687. let ui = xGame.uiMgr.getUI(UIShop$1);
  19688. ui.updateBallRod();
  19689. break;
  19690. case 2:
  19691. let data = cfgTable.ballrodData[this.index + 1];
  19692. let need = data.price;
  19693. if (DataMgr.diamondEnough(need)) {
  19694. DataMgr.setDiamond(-need);
  19695. DataMgr.setBallRod(this.index, 1);
  19696. DataMgr.setCurBallRod(this.index);
  19697. let ui = xGame.uiMgr.getUI(UIShop$1);
  19698. ui.updateBallRod();
  19699. }
  19700. else {
  19701. xGame.uiMgr.Show(UIAddProp$1, 1);
  19702. }
  19703. break;
  19704. default:
  19705. break;
  19706. }
  19707. }
  19708. }
  19709. class UIShop$1 extends UIBase {
  19710. constructor() {
  19711. super();
  19712. this.itemNums = 0;
  19713. }
  19714. onConstructor() {
  19715. this.ui = ui_UIShop.createInstance();
  19716. this.contentPane = this.ui;
  19717. this.isEject = false;
  19718. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19719. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  19720. this.addUIClick(this.ui, this.interuptSecretary);
  19721. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  19722. this.ballRodArr = [];
  19723. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  19724. this.ui.myNode.myList.numItems = this.itemNums;
  19725. if (Moyu.isKs)
  19726. this.ui.closeNode.closeBtn.x += 100;
  19727. }
  19728. show() {
  19729. super.show();
  19730. this.playSecretaryIdle();
  19731. this.updateBallRod();
  19732. }
  19733. updateBallRod() {
  19734. for (let index = 0; index < this.ballRodArr.length; index++) {
  19735. this.ballRodArr[index].updateSelf();
  19736. }
  19737. }
  19738. renderBallRod(sort, obj) {
  19739. let index = this.getIndexBySort(sort + 1) - 1;
  19740. let ballRod = new BallRodDisplay$1(obj, index);
  19741. this.ballRodArr.push(ballRod);
  19742. }
  19743. getIndexBySort(sort) {
  19744. let object = cfgTable.ballrodData;
  19745. for (const key in object) {
  19746. if (object[key].sort == sort) {
  19747. return parseInt(key);
  19748. }
  19749. }
  19750. }
  19751. playSecretaryIdle() {
  19752. let parent = this.ui.secretary.displayObject;
  19753. parent.destroyChildren();
  19754. let xx = this.ui.secretary.width / 2;
  19755. let yy = this.ui.secretary.height;
  19756. let scale = xGame.common.getSecretaryScale();
  19757. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19758. xGame.common.secretary.play(data, 1, true, parent);
  19759. }
  19760. interuptSecretary() {
  19761. Laya.timer.clearAll(this);
  19762. this.playSecretaryRandomSound();
  19763. }
  19764. playSecretaryRandomSound() {
  19765. if (this.isHide)
  19766. return;
  19767. let time = xGame.common.randomNum(45000, 60000);
  19768. Laya.timer.once(time, this, () => {
  19769. if (this.isHide)
  19770. return;
  19771. let index = xGame.common.randomNum(4, 7);
  19772. xGame.soundMgr.playSound("s_main0" + index);
  19773. let words = 1;
  19774. switch (index) {
  19775. case 4:
  19776. words = 5;
  19777. break;
  19778. case 5:
  19779. words = 3;
  19780. break;
  19781. case 6:
  19782. words = 6;
  19783. break;
  19784. case 7:
  19785. words = 7;
  19786. break;
  19787. default:
  19788. break;
  19789. }
  19790. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19791. this.playSecretaryRandomSound();
  19792. });
  19793. }
  19794. closeSelf() {
  19795. this.hide();
  19796. }
  19797. }
  19798. UIShop$1.uiName = "UIShop";
  19799. class SignMax$1 {
  19800. constructor(ui) {
  19801. this.ui = ui;
  19802. }
  19803. updateSelf(index, sameDay, curDayIndex) {
  19804. let data = cfgTable.signData[index + 1];
  19805. this.ui.titleTxt.text = data.title;
  19806. let arr1 = data.award[0].split('-');
  19807. let arr2 = data.award[1].split('-');
  19808. let num1 = parseInt(arr1[1]);
  19809. let num2 = parseInt(arr2[1]);
  19810. this.ui.numTxt1.text = num1 + "";
  19811. this.ui.numTxt2.text = num2 + "";
  19812. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  19813. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  19814. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  19815. this.ui.numTxt1.visible = false;
  19816. }
  19817. else {
  19818. this.ui.numTxt1.visible = true;
  19819. }
  19820. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  19821. this.ui.numTxt2.visible = false;
  19822. }
  19823. else {
  19824. this.ui.numTxt2.visible = true;
  19825. }
  19826. if (index < curDayIndex) {
  19827. this.ui.c1.selectedIndex = 1;
  19828. }
  19829. else if (index == curDayIndex) {
  19830. if (sameDay) {
  19831. this.ui.c1.selectedIndex = 2;
  19832. }
  19833. else {
  19834. this.ui.c1.selectedIndex = 2;
  19835. }
  19836. }
  19837. else {
  19838. this.ui.c1.selectedIndex = 0;
  19839. }
  19840. }
  19841. }
  19842. class SignNormal$1 {
  19843. constructor(ui) {
  19844. this.ui = ui;
  19845. }
  19846. updateSelf(index, sameDay, curDayIndex) {
  19847. let data = cfgTable.signData[index + 1];
  19848. this.ui.titleTxt.text = data.title;
  19849. let arr = data.award[0].split('-');
  19850. let type = parseInt(arr[0]);
  19851. let num = parseInt(arr[1]);
  19852. this.ui.numTxt.text = num + "";
  19853. if (type > 2) {
  19854. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  19855. this.ui.myIcon.rotation = 0;
  19856. }
  19857. else {
  19858. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  19859. this.ui.myIcon.rotation = 0;
  19860. }
  19861. if (xGame.common.signAwardContainsRod(data.award)) {
  19862. this.ui.numTxt.visible = false;
  19863. }
  19864. else {
  19865. this.ui.numTxt.visible = true;
  19866. }
  19867. if (index < curDayIndex) {
  19868. this.ui.c1.selectedIndex = 1;
  19869. }
  19870. else if (index == curDayIndex) {
  19871. if (sameDay) {
  19872. this.ui.c1.selectedIndex = 2;
  19873. }
  19874. else {
  19875. this.ui.c1.selectedIndex = 2;
  19876. }
  19877. }
  19878. else {
  19879. this.ui.c1.selectedIndex = 0;
  19880. }
  19881. }
  19882. }
  19883. class UISign$1 extends UIBase {
  19884. constructor() {
  19885. super();
  19886. this.curDayIndex = 0;
  19887. this.starX = 0;
  19888. }
  19889. onConstructor() {
  19890. this.ui = ui_UISign.createInstance();
  19891. this.contentPane = this.ui;
  19892. this.isEject = false;
  19893. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19894. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  19895. this.initSignItem();
  19896. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  19897. this.addUIClick(this.ui.againBtn, this.againGetAward);
  19898. }
  19899. show() {
  19900. super.show();
  19901. this.ui.t0.play();
  19902. this.playSecretaryIdle();
  19903. this.updateSign();
  19904. }
  19905. initSignItem() {
  19906. this.signArr = [];
  19907. for (let index = 0; index < 6; index++) {
  19908. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  19909. this.signArr.push(temp);
  19910. }
  19911. this.signMax = new SignMax$1(this.ui.myNode.day7);
  19912. if (Moyu.isKs)
  19913. this.ui.closeNode.closeBtn.x += 100;
  19914. }
  19915. updateSign() {
  19916. let sameDay = xGame.common.judgeSameDay();
  19917. let max = 7;
  19918. this.curDayIndex = DataMgr.getSignData();
  19919. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  19920. this.curDayIndex = 0;
  19921. if (!sameDay) {
  19922. this.ui.normalBtn.visible = true;
  19923. this.ui.tipsNode.visible = false;
  19924. this.ui.againBtn.visible = false;
  19925. }
  19926. else {
  19927. this.ui.normalBtn.visible = false;
  19928. let again = DataMgr.getExtraSign();
  19929. let isCurrency = false;
  19930. let index = this.curDayIndex;
  19931. if (index == 0)
  19932. index = 7;
  19933. let award = cfgTable.signData[index].award;
  19934. let num = award[0].split("-")[0];
  19935. if (num == "1" || num == "2")
  19936. isCurrency = true;
  19937. let showAgain = again == 0 && isCurrency;
  19938. this.ui.againBtn.visible = showAgain;
  19939. this.ui.tipsNode.visible = !showAgain;
  19940. }
  19941. for (let index = 0; index < this.signArr.length; index++) {
  19942. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  19943. }
  19944. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  19945. }
  19946. playSecretaryIdle() {
  19947. let parent = this.ui.secretary.displayObject;
  19948. parent.destroyChildren();
  19949. let xx = this.ui.secretary.width / 2;
  19950. let yy = this.ui.secretary.height;
  19951. let scale = xGame.common.getSecretaryScale();
  19952. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19953. xGame.common.secretary.play(data, 1, true, parent);
  19954. }
  19955. closeSelf() {
  19956. this.hide();
  19957. }
  19958. normalGetAward() {
  19959. let sameDay = xGame.common.judgeSameDay();
  19960. if (!sameDay) {
  19961. let award = cfgTable.signData[this.curDayIndex + 1].award;
  19962. let temp;
  19963. let type;
  19964. let num;
  19965. let arr = [];
  19966. for (let index = 0; index < award.length; index++) {
  19967. temp = award[index].split("-");
  19968. type = parseInt(temp[0]);
  19969. num = parseInt(temp[1]);
  19970. let awardType = new AwardType();
  19971. awardType.num = num;
  19972. awardType.type = type;
  19973. arr.push(awardType);
  19974. }
  19975. xGame.common.getAward(arr, (watchVideo) => {
  19976. this.curDayIndex++;
  19977. if (this.curDayIndex > 7)
  19978. this.curDayIndex = 0;
  19979. DataMgr.setSignData(this.curDayIndex);
  19980. DataMgr.setSignTime(new Date().getTime());
  19981. if (watchVideo) {
  19982. DataMgr.setExtraSign(1);
  19983. Moyu.sendDataEvent("signIn1");
  19984. }
  19985. this.updateSign();
  19986. });
  19987. }
  19988. }
  19989. againGetAward() {
  19990. Moyu.sendDataEvent("signIn2");
  19991. Moyu.showVideoAd(() => {
  19992. let index = this.curDayIndex;
  19993. if (index == 0)
  19994. index = 7;
  19995. let award = cfgTable.signData[index].award;
  19996. let temp;
  19997. let type;
  19998. let num;
  19999. for (let index = 0; index < award.length; index++) {
  20000. temp = award[index].split("-");
  20001. type = parseInt(temp[0]);
  20002. num = parseInt(temp[1]) * 3;
  20003. xGame.common.playObjFlyAnim(num, type);
  20004. }
  20005. DataMgr.setExtraSign(1);
  20006. this.updateSign();
  20007. }, EAdType.againSign);
  20008. }
  20009. }
  20010. UISign$1.uiName = "UISign";
  20011. class UIModeSelection$1 extends UIBase {
  20012. constructor() {
  20013. super();
  20014. }
  20015. onConstructor() {
  20016. this.ui = ui_UIModeSelection.createInstance();
  20017. this.contentPane = this.ui;
  20018. this.isEject = false;
  20019. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  20020. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  20021. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  20022. this.addUIClick(this.ui.closeBtn, this.hide);
  20023. this.peopleArr = [650, 6900, 3800];
  20024. this.peopleOffest = [50, 500, 200];
  20025. this.updateSelf();
  20026. }
  20027. show(callback) {
  20028. super.show();
  20029. this.ui.t0.play();
  20030. this.callback = callback;
  20031. }
  20032. updateSelf() {
  20033. let cfg = cfgTable.modeselectData;
  20034. for (let index = 1; index <= 3; index++) {
  20035. let node = this.ui.myNode["type" + index];
  20036. node.need.text = cfg[index].need;
  20037. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  20038. node.peopleTxt.text = this.getRandPeople(index - 1);
  20039. }
  20040. }
  20041. enterGame(type) {
  20042. xGame.common.classicRoomType = type;
  20043. let cfg = cfgTable.modeselectData[type];
  20044. let need = cfg.need;
  20045. xGame.common.passAwardCoin = cfg.award;
  20046. if (DataMgr.coinEnough(need)) {
  20047. DataMgr.setCoin(-need);
  20048. this.ui.myNode["type" + type].t0.play();
  20049. Laya.timer.once(200, this, () => {
  20050. this.callback && this.callback();
  20051. });
  20052. }
  20053. else {
  20054. Moyu.sendDataEvent("AddCoinVideo");
  20055. xGame.uiMgr.Show(UIAddProp$1, 0);
  20056. }
  20057. }
  20058. getRandPeople(index) {
  20059. let rand = this.peopleOffest[index];
  20060. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  20061. }
  20062. }
  20063. UIModeSelection$1.uiName = "UIModeSelection";
  20064. class UIMain$1 extends UIBase {
  20065. constructor() {
  20066. super();
  20067. this.firstEnter = true;
  20068. }
  20069. onConstructor() {
  20070. this.ui = ui_UIMain.createInstance();
  20071. this.contentPane = this.ui;
  20072. this.isEject = false;
  20073. this.addEvent();
  20074. this.addClickSpine();
  20075. this.settingNode = new SettingNode$1(this.ui.settingNode);
  20076. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20077. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  20078. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  20079. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  20080. let curUse = DataMgr.getCurSecretary();
  20081. this.changeSecretary(curUse);
  20082. this.ui.talkNode.visible = false;
  20083. let guide = DataMgr.getSkillGuide();
  20084. if (xGame.common.isNewDay && guide == 1) {
  20085. xGame.common.isNewDay = false;
  20086. xGame.soundMgr.playSound("s_main01");
  20087. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20088. console.log("播放小秘书每天语音");
  20089. }
  20090. this.onGetUserInfo();
  20091. this.ui.n83.visible = false;
  20092. Moyu.setShareInfo("8Ball Fury", ["台球", "万宁", "桌球"], '2300002254');
  20093. }
  20094. changeSecretary(curUse) {
  20095. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  20096. xGame.common.secretary && xGame.common.secretary.dispose();
  20097. this.addSecretarySpine(name);
  20098. }
  20099. addSecretarySpine(name) {
  20100. let spine = new SpineMgr(name, () => {
  20101. this.playSecretaryIdle();
  20102. });
  20103. xGame.common.secretary = spine;
  20104. }
  20105. addClickSpine() {
  20106. let clickSpine = new SpineMgr("dianji", () => {
  20107. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  20108. let parent = Laya.stage;
  20109. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  20110. clickSpine.play(data, 0, false, parent, (spine) => {
  20111. spine.destroy(true);
  20112. });
  20113. });
  20114. });
  20115. }
  20116. addEvent() {
  20117. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  20118. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  20119. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  20120. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  20121. this.addUIClick(this.ui.weeklyBtn, this.startWeekly);
  20122. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  20123. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  20124. this.addUIClick(this.ui, this.interuptSecretary);
  20125. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  20126. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  20127. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  20128. this.addUIClick(this.ui.shopBtn, this.openShopView);
  20129. this.addUIClick(this.ui.signBtn, this.openSignView);
  20130. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  20131. this.addUIClick(this.ui.rankBtn, this.openRanking);
  20132. }
  20133. show(showFailWords) {
  20134. super.show();
  20135. this.moneyNode.ui.c1.selectedIndex = 1;
  20136. this.playSecretaryIdle();
  20137. xGame.soundMgr.playMusic("caromhall01");
  20138. Laya.timer.clearAll(this);
  20139. this.playSecretaryRandomSound();
  20140. if (showFailWords) {
  20141. setTimeout(() => {
  20142. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  20143. let words = -1;
  20144. if (str == "s_main02") {
  20145. words = 2;
  20146. }
  20147. else {
  20148. words = 3;
  20149. }
  20150. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20151. xGame.soundMgr.playSound(str);
  20152. }, 300);
  20153. }
  20154. this.showGuide();
  20155. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  20156. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  20157. let guide = DataMgr.getSkillGuide();
  20158. if (guide == 1) {
  20159. let randTime = xGame.common.randomNum(300, 800);
  20160. if (this.firstEnter) {
  20161. this.firstEnter = false;
  20162. randTime += 900;
  20163. }
  20164. Laya.timer.once(randTime, this, () => {
  20165. xGame.common.autoPopUIView();
  20166. });
  20167. }
  20168. }
  20169. checkActive(show) {
  20170. }
  20171. showGuide() {
  20172. let guide = DataMgr.getSkillGuide();
  20173. this.ui.guideBtn.visible = guide == 0;
  20174. this.ui.enterGuide.visible = false;
  20175. this.ui.secretaryGuide.visible = guide == 0;
  20176. if (guide == 0) {
  20177. xGame.soundMgr.playSound("s_guide");
  20178. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20179. }
  20180. }
  20181. ensureSecretary() {
  20182. this.ui.secretaryGuide.visible = false;
  20183. this.ui.enterGuide.visible = true;
  20184. this.ui.wordsNode.t0.play();
  20185. if (DataMgr.getNewUser())
  20186. Moyu.sendDataEvent("gameReady");
  20187. }
  20188. playSecretaryIdle() {
  20189. let parent = this.ui.secretary.displayObject;
  20190. parent.destroyChildren();
  20191. let xx = this.ui.secretary.width / 2;
  20192. let yy = this.ui.secretary.height;
  20193. let scale = xGame.common.getSecretaryScale();
  20194. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20195. xGame.common.secretary.play(data, 1, true, parent);
  20196. }
  20197. startGame(type) {
  20198. xGame.common.gameMode = type;
  20199. Moyu.sendDataEvent("PlayGame", { type: type });
  20200. switch (xGame.common.gameMode) {
  20201. case GameMode.classic:
  20202. let challengeTimes = DataMgr.getChallengeTimes();
  20203. if (challengeTimes == 0) {
  20204. xGame.uiMgr.Show(UIInvitation$1);
  20205. }
  20206. else {
  20207. this.beginGame();
  20208. }
  20209. break;
  20210. case GameMode.bigMove:
  20211. this.beginGame();
  20212. if (DataMgr.getNewUser())
  20213. Moyu.sendDataEvent("gameStart0");
  20214. break;
  20215. default:
  20216. break;
  20217. }
  20218. }
  20219. beginGame(isNice = false) {
  20220. if (xGame.common.gameMode == GameMode.classic) {
  20221. if (isNice) {
  20222. this.enterClassic();
  20223. }
  20224. else {
  20225. xGame.uiMgr.Show(UIModeSelection$1, () => {
  20226. this.enterClassic();
  20227. });
  20228. }
  20229. }
  20230. else if (xGame.common.gameMode == GameMode.bigMove) {
  20231. this.ui.enterGuide.visible = false;
  20232. xGame.uiMgr.Show(UISkill$1);
  20233. }
  20234. }
  20235. enterClassic() {
  20236. xGame.uiMgr.Show(UIGame$1);
  20237. xGame.uiMgr.Show(UIMatching$1, () => {
  20238. if (!this.isHide)
  20239. this.hide();
  20240. xGame.common.gameUI.ui.alpha = 1;
  20241. xGame.common.gameUI.startGame();
  20242. xGame.uiMgr.Hide(UIGameEnd$1);
  20243. });
  20244. }
  20245. startGlobal() {
  20246. xGame.uiMgr.Show(UIMsg$1, "Coming Soon~");
  20247. }
  20248. startWeekly() {
  20249. xGame.uiMgr.Show(UIMsg$1, "Coming Soon~");
  20250. }
  20251. startPlaceBall() {
  20252. xGame.uiMgr.Show(UILevelDisplay$1);
  20253. }
  20254. hide() {
  20255. super.hide();
  20256. xGame.common.stopGirlPop(this.ui.talkNode);
  20257. }
  20258. onGetUserInfo(force = false) {
  20259. if (Moyu.isWx) {
  20260. let info = Moyu.getSystemInfo();
  20261. if (info)
  20262. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  20263. }
  20264. else {
  20265. Moyu.initUser(this, this.freshUser, force);
  20266. }
  20267. if (!Moyu.hasUserInfo) {
  20268. let user = Moyu.getUserInfo();
  20269. user.headIcon = 'res/ty_touxiang.png';
  20270. }
  20271. this.freshUser();
  20272. }
  20273. freshUser() {
  20274. let user = Moyu.getUserInfo();
  20275. if (!user.isAuth) {
  20276. user.headIcon = 'res/ty_touxiang.png';
  20277. }
  20278. else
  20279. DataMgr.upRankData();
  20280. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  20281. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  20282. }
  20283. interuptSecretary() {
  20284. Laya.timer.clearAll(this);
  20285. this.playSecretaryRandomSound();
  20286. }
  20287. playSecretaryRandomSound() {
  20288. if (this.isHide)
  20289. return;
  20290. let time = xGame.common.randomNum(45000, 60000);
  20291. Laya.timer.once(time, this, () => {
  20292. if (this.isHide)
  20293. return;
  20294. let index = xGame.common.randomNum(4, 7);
  20295. xGame.soundMgr.playSound("s_main0" + index);
  20296. let words = 1;
  20297. switch (index) {
  20298. case 4:
  20299. words = 5;
  20300. break;
  20301. case 5:
  20302. words = 3;
  20303. break;
  20304. case 6:
  20305. words = 6;
  20306. break;
  20307. case 7:
  20308. words = 7;
  20309. break;
  20310. default:
  20311. break;
  20312. }
  20313. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20314. this.playSecretaryRandomSound();
  20315. });
  20316. }
  20317. openSecretaryView() {
  20318. xGame.uiMgr.Show(UISecretary$1);
  20319. Moyu.sendDataEvent("secretary");
  20320. }
  20321. openShopView() {
  20322. xGame.uiMgr.Show(UIShop$1);
  20323. }
  20324. openSignView() {
  20325. xGame.uiMgr.Show(UISign$1);
  20326. }
  20327. openDrawView() {
  20328. xGame.uiMgr.Show(UIDraw$1);
  20329. }
  20330. openRanking() {
  20331. xGame.uiMgr.Show(UIRanking$1);
  20332. Moyu.sendDataEvent("rankingList");
  20333. }
  20334. }
  20335. UIMain$1.uiName = "UIMain";
  20336. function InitShader() {
  20337. }
  20338. function appInit() {
  20339. xGame.context.init(getLoadingResList(), initCallback);
  20340. }
  20341. function getLoadingResList() {
  20342. return [
  20343. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  20344. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  20345. ];
  20346. }
  20347. function getGameResList() {
  20348. return [
  20349. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  20350. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  20351. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  20352. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  20353. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  20354. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  20355. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  20356. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  20357. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  20358. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  20359. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  20360. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  20361. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  20362. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  20363. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  20364. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  20365. { url: "res/json/npc.json", type: Laya.Loader.JSON },
  20366. { url: "res/json/classicCfg.json", type: Laya.Loader.JSON },
  20367. { url: "res/json/levelCfg.json", type: Laya.Loader.JSON },
  20368. { url: "res/json/placeBallCfg.json", type: Laya.Loader.JSON },
  20369. ];
  20370. }
  20371. function initCallback() {
  20372. window["DataMgr"] = DataMgr;
  20373. DataMgr.Init();
  20374. Moyu.init(getPlat(), this, () => {
  20375. DataMgr.isNewDay();
  20376. PlatMgr.initConfig();
  20377. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  20378. }, true);
  20379. console.log('zh:开始sm init1 start');
  20380. xGame.soundMgr.init();
  20381. console.log('zh:开始sm init1 end');
  20382. xGame.uiMgr.init();
  20383. xGame.uiMgr.bindFUI(fguiRes.loading);
  20384. xGame.uiMgr.Show(UILoading);
  20385. }
  20386. function loadSubRes(callback) {
  20387. var tab = ["asset", "res", "spine"];
  20388. let subDone = 0;
  20389. for (var i = 0; i < tab.length; i++) {
  20390. let sub = tab[i];
  20391. Moyu.loadSubRes(sub, (pro) => {
  20392. callback && callback(pro, false);
  20393. }).then(() => {
  20394. subDone++;
  20395. if (subDone >= tab.length)
  20396. callback && callback(1, true);
  20397. });
  20398. }
  20399. }
  20400. function enterGame() {
  20401. xGame.cfgMgr.init();
  20402. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  20403. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  20404. xGame.uiMgr.Hide(UILoading);
  20405. fgui.UIPackage.removePackage(fguiRes.loading);
  20406. xGame.uiMgr.bindFUI(fguiRes.game);
  20407. xGame.uiMgr.Show(UIMain$1);
  20408. if (DataMgr.getNewUser())
  20409. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  20410. }
  20411. function getPlat() {
  20412. let cfg = new MoyuCfg();
  20413. cfg.plat = MoyuPlat.web;
  20414. cfg.myId = 120;
  20415. cfg.myKey = '8848a885774230a4';
  20416. cfg.version = 0;
  20417. if (window.hasOwnProperty("gamebox")) {
  20418. cfg.plat = MoyuPlat.f399;
  20419. cfg.version = 0;
  20420. }
  20421. else if (window.hasOwnProperty("ks")) {
  20422. cfg.plat = MoyuPlat.ks;
  20423. cfg.version = 0;
  20424. cfg.ads.ksVideoId = '2300002254_01';
  20425. cfg.ads.ksInsertId = '2300002254_02';
  20426. }
  20427. else if (Laya.Browser.onTTMiniGame) {
  20428. cfg.plat = MoyuPlat.tt;
  20429. cfg.version = 0;
  20430. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  20431. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  20432. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  20433. }
  20434. else if (Laya.Browser.onMiniGame) {
  20435. cfg.plat = MoyuPlat.wx;
  20436. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  20437. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  20438. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  20439. }
  20440. else if (Laya.Browser.onQQMiniGame) {
  20441. cfg.plat = MoyuPlat.qq;
  20442. }
  20443. else if (Laya.Browser.onQGMiniGame) {
  20444. cfg.plat = MoyuPlat.op;
  20445. cfg.ads.opVideoId = '455502';
  20446. cfg.ads.opBannerId = '455507';
  20447. }
  20448. else if (Laya.Browser.onVVMiniGame) {
  20449. cfg.plat = MoyuPlat.vv;
  20450. cfg.version = 0;
  20451. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  20452. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  20453. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  20454. }
  20455. else if (Laya.Browser.onHWMiniGame) {
  20456. cfg.plat = MoyuPlat.hw;
  20457. }
  20458. else if (window["mz"]) {
  20459. cfg.plat = MoyuPlat.mz;
  20460. }
  20461. else {
  20462. let cfg = window['conchConfig'];
  20463. if (cfg) {
  20464. var os = cfg.getOS();
  20465. if (os == "Conch-ios") {
  20466. cfg.plat = MoyuPlat.ios;
  20467. }
  20468. else if (os == "Conch-android") {
  20469. }
  20470. }
  20471. }
  20472. return cfg;
  20473. }
  20474. class Main {
  20475. constructor() {
  20476. if (window["Laya3D"])
  20477. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  20478. else {
  20479. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  20480. this.initMain();
  20481. }
  20482. }
  20483. initMain() {
  20484. Laya["Physics"] && Laya["Physics"].enable();
  20485. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  20486. Laya.stage.scaleMode = GameConfig.scaleMode;
  20487. Laya.stage.screenMode = GameConfig.screenMode;
  20488. Laya.stage.alignV = GameConfig.alignV;
  20489. Laya.stage.alignH = GameConfig.alignH;
  20490. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  20491. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  20492. Laya.enableDebugPanel();
  20493. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  20494. Laya["PhysicsDebugDraw"].enable();
  20495. if (GameConfig.stat)
  20496. Laya.Stat.show();
  20497. Laya.alertGlobalError(true);
  20498. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  20499. }
  20500. onVersionLoaded() {
  20501. appInit();
  20502. }
  20503. }
  20504. new Main();
  20505. }());
  20506. //# sourceMappingURL=bundle.js.map