1
0

bundle.js 800 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988
  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("试用成功");
  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. this.templet.loadAni(`spine/${name}.sk`);
  1359. this.templet.lock = true;
  1360. this.spineName = name;
  1361. }
  1362. onError() {
  1363. console.log("spine加载出错");
  1364. }
  1365. parseComplete() {
  1366. this.loaded = true;
  1367. this.loadedCallback && this.loadedCallback();
  1368. }
  1369. dispose() {
  1370. if (this.templet && !this.templet.destroyed) {
  1371. this.templet.destroy();
  1372. }
  1373. this.templet = null;
  1374. }
  1375. play(data, aniIndex, isLoop = true, parent, callback, mySpine = null) {
  1376. if (!this.loaded) {
  1377. return;
  1378. }
  1379. let spine;
  1380. if (mySpine) {
  1381. spine = mySpine;
  1382. }
  1383. else {
  1384. spine = this.createSpine(data, parent);
  1385. }
  1386. spine.play(aniIndex, isLoop, true, 0, 0, true);
  1387. if (!isLoop) {
  1388. spine.on(Laya.Event.STOPPED, this, () => {
  1389. spine.offAll(Laya.Event.STOPPED);
  1390. callback && callback(spine);
  1391. });
  1392. }
  1393. return spine;
  1394. }
  1395. createSpine(data, parent, type = 1) {
  1396. let spine;
  1397. spine = this.templet.buildArmature(type);
  1398. spine.showSkinByIndex(0);
  1399. parent.addChild(spine);
  1400. spine.pos(data.x, data.y);
  1401. spine.scale(data.scaleX, data.scaleY, true);
  1402. return spine;
  1403. }
  1404. }
  1405. var AIState;
  1406. (function (AIState) {
  1407. AIState[AIState["none"] = 0] = "none";
  1408. AIState[AIState["idle"] = 1] = "idle";
  1409. AIState[AIState["reset"] = 2] = "reset";
  1410. AIState[AIState["move"] = 3] = "move";
  1411. AIState[AIState["wait"] = 4] = "wait";
  1412. AIState[AIState["select"] = 5] = "select";
  1413. AIState[AIState["turn"] = 6] = "turn";
  1414. AIState[AIState["shoot"] = 7] = "shoot";
  1415. AIState[AIState["leave"] = 8] = "leave";
  1416. })(AIState || (AIState = {}));
  1417. class AIPlayer {
  1418. constructor() {
  1419. this.dtime = 30;
  1420. this.awayTime = 0;
  1421. this.awayNum = 0;
  1422. this.hideTime = 0;
  1423. this.rootMoveTime = 0;
  1424. this.isGuide = false;
  1425. this.state = AIState.none;
  1426. this.waitTime = 0;
  1427. this.forceNum = 0;
  1428. this.forceMax = 0;
  1429. this.ballSize = 33;
  1430. this.selectNum = 0;
  1431. this.destRot = 0;
  1432. this.aiLv = 10;
  1433. this.kickBall = [];
  1434. this.lineBall = [];
  1435. this.scoreBall = [];
  1436. this.holeBall = [];
  1437. this.turnNum = 0;
  1438. this.setNum = 0;
  1439. this.setMax = 0;
  1440. this.setRate = 0;
  1441. this.rectL = 0;
  1442. this.rectR = 0;
  1443. this.rectT = 0;
  1444. this.rectB = 0;
  1445. this.rootPos = { x: 0, y: 0 };
  1446. this.bestForce = 0;
  1447. this.bestAngle = 180;
  1448. this.bestPos = { x: 0, y: 0 };
  1449. this.bestKick = { x: 0, y: 0 };
  1450. this.posList = [];
  1451. this.posIdx = 0;
  1452. this.chatTime = 3000;
  1453. this.tempDir1 = new Laya.Vector2();
  1454. this.tempDir2 = new Laya.Vector2();
  1455. this.tempDir3 = new Laya.Vector2();
  1456. Laya.timer.loop(this.dtime, this, this.onUpdate);
  1457. xGame.eventMgr.off(RESET_GAME, this, this.resetAI);
  1458. xGame.eventMgr.on(RESET_GAME, this, this.resetAI);
  1459. this.gameSrc = xGame.common.gameUI;
  1460. this.hideTime = Laya.timer.currTimer;
  1461. Moyu.setOnTipCall((id) => {
  1462. if (id == 20012)
  1463. this.hideTime = Laya.timer.currTimer;
  1464. else
  1465. (id == 20011);
  1466. {
  1467. let dt = Laya.timer.currTimer - this.hideTime;
  1468. console.log("onshow" + dt);
  1469. if (dt > 30000 && this.state > AIState.none)
  1470. xGame.common.gameMgr.aiGameEnd(false);
  1471. }
  1472. }, this);
  1473. }
  1474. init() {
  1475. this.isGuide = DataMgr.getSkillGuide() < 1 || DataMgr.gameData.gameCount < 1;
  1476. this.awayTime = xGame.tools.random(5000, 10000);
  1477. this.awayNum = 0;
  1478. this.hideTime = Laya.timer.currTimer;
  1479. let rect = xGame.common.d2World.borderRect;
  1480. this.rectL = Math.ceil(rect.x) + 17;
  1481. this.rectT = Math.ceil(rect.y) + 17;
  1482. this.rectR = Math.floor(rect.x + rect.width) - 17;
  1483. this.rectB = Math.floor(rect.y + rect.height) - 17;
  1484. this.wBall = xGame.common.d2World.rootBall;
  1485. this.ballSize = this.wBall.gameObj.width - 1;
  1486. if (this.posList.length < 1) {
  1487. let dp = 40;
  1488. for (let i = this.rectL; i < this.rectR + dp; i = i + dp) {
  1489. for (let j = this.rectT; j < this.rectB + dp; j = j + dp) {
  1490. let dx = i < this.rectR ? i : this.rectR;
  1491. let dy = j < this.rectB ? j : this.rectB;
  1492. let order = xGame.tools.random(0, 1000);
  1493. this.posList.push({ x: dx, y: dy, order: order });
  1494. }
  1495. }
  1496. this.posList.sort(function (a, b) {
  1497. return a.order - b.order;
  1498. });
  1499. this.setMax = this.posList.length;
  1500. }
  1501. this.state = AIState.idle;
  1502. }
  1503. setAiLevel(num) {
  1504. this.aiLv = num;
  1505. }
  1506. initBall() {
  1507. this.rootPos.x = this.wBall.gameObj.x;
  1508. this.rootPos.y = this.wBall.gameObj.y;
  1509. this.initHoleBall();
  1510. }
  1511. initHoleBall() {
  1512. this.kickBall = [];
  1513. this.lineBall = [];
  1514. this.scoreBall = [];
  1515. this.holeBall = [];
  1516. this.selectNum = 0;
  1517. this.forceNum = 0;
  1518. this.forceMax = 0;
  1519. this.turnNum = 0;
  1520. let list = xGame.common.d2World.ballArr;
  1521. if (list.length < 20 && !this.isGuide) {
  1522. let holes = xGame.common.gameMgr.holePosList;
  1523. for (let i = 0; i < list.length; i++) {
  1524. let obj = list[i];
  1525. if (!obj)
  1526. continue;
  1527. obj.kickPos.x = 0;
  1528. obj.kickPos.y = 0;
  1529. obj.poleAngle = 0;
  1530. obj.hard = 0;
  1531. obj.borderDis = 0;
  1532. obj.kickAngle = 180;
  1533. if (obj.number == 0)
  1534. continue;
  1535. if (obj.ballType == xGame.common.gameMgr.selfCamp)
  1536. continue;
  1537. if (obj.number == 8 && xGame.common.gameMode == 0) {
  1538. if (xGame.common.gameMgr.aiBallArr.length > 0 || !xGame.common.gameMgr.ensureBallType)
  1539. continue;
  1540. }
  1541. let b = obj.gameObj;
  1542. let wbp = this.rootPos;
  1543. let bx = wbp.x - b.x;
  1544. let by = wbp.y - b.y;
  1545. obj.borderDis = xGame.tools.random(0, 100);
  1546. this.kickBall.push(obj);
  1547. if (!this.isLine(wbp, obj))
  1548. continue;
  1549. obj.kickAngle = xGame.tools.random(90, 180);
  1550. obj.kickPos.x = b.x;
  1551. obj.kickPos.y = b.y;
  1552. this.lineBall.push(obj);
  1553. let minDis = 999999;
  1554. let hole = false;
  1555. for (let j = 0; j < holes.length; j++) {
  1556. let hp = holes[j];
  1557. if (bx >= 0 && hp.x > b.x + 100)
  1558. continue;
  1559. if (bx <= 0 && hp.x < b.x - 100)
  1560. continue;
  1561. if (by < -10 && hp.y < wbp.y)
  1562. continue;
  1563. if (by > 10 && hp.y > wbp.y)
  1564. continue;
  1565. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  1566. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  1567. if (dis < minDis) {
  1568. let dx = b.x - this.tempDir1.x * this.ballSize;
  1569. let dy = b.y - this.tempDir1.y * this.ballSize;
  1570. this.tempDir3.x = this.tempDir1.x;
  1571. this.tempDir3.y = this.tempDir1.y;
  1572. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  1573. obj.kickPos.x = dx;
  1574. obj.kickPos.y = dy;
  1575. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  1576. if (num > 1)
  1577. num = 1;
  1578. obj.kickAngle = Math.acos(num) * 57.3;
  1579. if (b.x < this.rectL + 2 || b.x > this.rectR - 2 || b.y < this.rectT + 2 || b.y > this.rectB - 2)
  1580. dis = dis * 2;
  1581. if (Math.abs(hp.x - 600) < 100)
  1582. dis += 50;
  1583. obj.hard = dis + obj.kickAngle * 3;
  1584. hole = true;
  1585. }
  1586. }
  1587. }
  1588. }
  1589. if (hole) {
  1590. this.scoreBall.push(obj);
  1591. this.holeBall.push(obj);
  1592. }
  1593. }
  1594. this.scoreBall.sort(function (a, b) {
  1595. return a.hard - b.hard;
  1596. });
  1597. this.holeBall.sort(function (a, b) {
  1598. return a.kickAngle - b.kickAngle;
  1599. });
  1600. this.kickBall.sort(function (a, b) {
  1601. return a.borderDis - b.borderDis;
  1602. });
  1603. }
  1604. else {
  1605. let max = list.length - 1;
  1606. let i = xGame.tools.random(0, max);
  1607. for (i; i <= max; i++) {
  1608. let idx = i >= max ? i -= max : i;
  1609. let obj = list[idx];
  1610. if (obj && obj.number != 0) {
  1611. obj.kickAngle = xGame.tools.random(90, 180);
  1612. obj.kickPos.x = obj.gameObj.x + xGame.tools.random(-10, 10);
  1613. obj.kickPos.y = obj.gameObj.y + xGame.tools.random(-10, 10);
  1614. this.lineBall.push(obj);
  1615. break;
  1616. }
  1617. }
  1618. }
  1619. }
  1620. selectBall() {
  1621. let ball = null;
  1622. this.destRot = 0;
  1623. let max = this.isGuide ? 1 : 3 - Math.ceil(this.aiLv / 4) + xGame.tools.random(0, 2);
  1624. let ai = 110 - this.aiLv * 10;
  1625. let mis = xGame.tools.random(-ai, ai) * 0.005;
  1626. let score = false;
  1627. if (this.scoreBall.length < 1) {
  1628. if (this.lineBall.length < 1) {
  1629. for (let i = 0; i < this.kickBall.length; i++) {
  1630. let list = [];
  1631. let bo = this.kickBall[i];
  1632. let bobj = bo.gameObj;
  1633. let rect = xGame.common.d2World.borderRect;
  1634. let mobj = this.wBall.gameObj;
  1635. let minb = bobj.y - rect.y - 20;
  1636. let minw = mobj.y - rect.y - 50;
  1637. if (minb > 0 && minw > 0) {
  1638. let dlenx = 0;
  1639. let dleny = mobj.y - rect.y;
  1640. let spx = mobj.x;
  1641. let spy = rect.y - dleny;
  1642. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1643. }
  1644. minb = rect.y + rect.height - bobj.y - 20;
  1645. minw = rect.y + rect.height - mobj.y - 50;
  1646. if (minb > 0 && minw > 0) {
  1647. let dlenx = 0;
  1648. let dleny = rect.y + rect.height - mobj.y;
  1649. let spx = mobj.x;
  1650. let spy = rect.y + rect.height + dleny;
  1651. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1652. }
  1653. minb = bobj.x - rect.x - 20;
  1654. minw = mobj.x - rect.x - 50;
  1655. if (minb > 0 && minw > 0) {
  1656. let dlenx = mobj.x - rect.x;
  1657. let dleny = 0;
  1658. let spx = rect.x - dlenx;
  1659. let spy = mobj.y;
  1660. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1661. }
  1662. minb = rect.x + rect.width - bobj.x - 20;
  1663. minw = rect.x + rect.width - mobj.x - 50;
  1664. if (minb > 0 && minw > 0) {
  1665. let dlenx = rect.x + rect.width - mobj.x;
  1666. let dleny = 0;
  1667. let spx = rect.x + rect.width + dlenx;
  1668. let spy = mobj.y;
  1669. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1670. }
  1671. list.sort(function (a, b) {
  1672. return a.order - b.order;
  1673. });
  1674. for (let i = 0; i < list.length; i++) {
  1675. let data = list[i];
  1676. let mx = mobj.x - bobj.x;
  1677. let my = mobj.y - bobj.y;
  1678. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  1679. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  1680. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1681. if (num > 1)
  1682. num = 1;
  1683. let cos = Math.acos(num);
  1684. if (cos > 1.57)
  1685. cos = 1.57;
  1686. else if (cos < 0.01)
  1687. cos = 0.01;
  1688. let tan = Math.tan(cos);
  1689. let dx = tan * data.dleny;
  1690. let dy = tan * data.dlenx;
  1691. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  1692. if (Math.abs(bx - 667) < 40)
  1693. continue;
  1694. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  1695. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  1696. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  1697. this.forceMax = dis * 0.08;
  1698. this.destRot += mis * 0.1;
  1699. this.setKick(bx, by);
  1700. return true;
  1701. }
  1702. }
  1703. }
  1704. }
  1705. else {
  1706. ball = xGame.common.getRandArrEle(this.lineBall);
  1707. }
  1708. }
  1709. else {
  1710. for (let i = 0; i < this.scoreBall.length; i++) {
  1711. if (i < this.scoreBall.length - 1) {
  1712. let rand = 70 + this.aiLv * 10 + i * 10;
  1713. if (xGame.tools.random(0, 100) < rand) {
  1714. ball = this.scoreBall[i];
  1715. break;
  1716. }
  1717. }
  1718. else {
  1719. ball = this.scoreBall[i];
  1720. break;
  1721. }
  1722. }
  1723. score = true;
  1724. this.selectNum++;
  1725. }
  1726. if (!ball)
  1727. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  1728. if (this.selectNum >= max) {
  1729. let dx = ball.gameObj.x;
  1730. let dy = ball.gameObj.y;
  1731. let kickAngle = 0;
  1732. if (score) {
  1733. dx = ball.kickPos.x;
  1734. dy = ball.kickPos.y;
  1735. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  1736. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  1737. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  1738. if (adot > 1)
  1739. adot = 1;
  1740. kickAngle = Math.acos(adot) * 57.3;
  1741. if (kickAngle > 45) {
  1742. let kdx = ball.kickPos.x - ball.gameObj.x;
  1743. let kdy = ball.kickPos.y - ball.gameObj.y;
  1744. dx = ball.kickPos.x - kdx * mis * 0.3;
  1745. dy = ball.kickPos.y - kdy * mis * 0.3;
  1746. }
  1747. else
  1748. this.destRot += mis;
  1749. }
  1750. else if (ball.poleAngle != 0) {
  1751. this.destRot += ball.poleAngle;
  1752. }
  1753. if (xGame.common.gameMode == 0) {
  1754. let af = kickAngle * 0.08;
  1755. this.forceMax = ball.hard * 0.1 + af * af;
  1756. }
  1757. this.setKick(dx, dy);
  1758. }
  1759. else {
  1760. let rand = this.aiLv * 5 + 40;
  1761. if (xGame.tools.random(0, 100) < rand && this.scoreBall.length > 0)
  1762. ball = xGame.common.getRandArrEle(this.scoreBall);
  1763. else
  1764. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  1765. rand = this.aiLv * 3 + 40 + this.selectNum * 20;
  1766. if (xGame.tools.random(0, 100) > rand) {
  1767. this.selectNum = max;
  1768. }
  1769. this.setState(AIState.select, xGame.tools.random(500, 1000));
  1770. this.selectNum++;
  1771. }
  1772. ball.onClick(0, true);
  1773. }
  1774. isBlock(bn, bx, by, hx, hy, dn = -1) {
  1775. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  1776. let balls = xGame.common.d2World.ballArr;
  1777. let max = xGame.tools.getDis(hx, hy, bx, by);
  1778. for (let index = 0; index < balls.length; index++) {
  1779. let obj = balls[index];
  1780. if (obj.number == 0)
  1781. continue;
  1782. if (obj.number == bn || obj.number == dn)
  1783. continue;
  1784. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  1785. if (dis * dis > max)
  1786. continue;
  1787. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  1788. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1789. if (num > 1)
  1790. num = 1;
  1791. if (num < 0)
  1792. continue;
  1793. let gap = Math.sin(Math.acos(num)) * dis;
  1794. if (gap < this.ballSize)
  1795. return true;
  1796. }
  1797. return false;
  1798. }
  1799. isLine(xy, ball) {
  1800. let bx = xy.x;
  1801. let by = xy.y;
  1802. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  1803. let dis = ball.getDestDis(xy);
  1804. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  1805. let sin = Math.sin(angle);
  1806. let cos = Math.cos(angle);
  1807. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  1808. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  1809. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  1810. let dx = bx + this.tempDir2.x * dis;
  1811. let dy = by + this.tempDir2.y * dis;
  1812. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  1813. sin = Math.sin(-angle);
  1814. cos = Math.cos(-angle);
  1815. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  1816. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  1817. dx = bx + this.tempDir2.x * dis;
  1818. dy = by + this.tempDir2.y * dis;
  1819. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  1820. if (isr && isl)
  1821. return false;
  1822. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  1823. }
  1824. return true;
  1825. }
  1826. turnPole() {
  1827. this.turnNum++;
  1828. let rot = xGame.common.d2World.d2Gan.ui.rotation % 360;
  1829. let dr = rot - this.destRot;
  1830. let abs = Math.abs(dr) % 360;
  1831. if (abs > 180) {
  1832. if (rot > 180)
  1833. rot -= 360;
  1834. if (this.destRot > 180)
  1835. this.destRot -= 360;
  1836. }
  1837. let max = this.turnNum * 5 + this.aiLv * 5;
  1838. if (abs < 0.2 && xGame.tools.random(0, 100) < max) {
  1839. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  1840. let at = xGame.tools.random(1000, 2000);
  1841. if (!this.onAway(3))
  1842. at += xGame.tools.random(10000, 15000);
  1843. this.setState(AIState.shoot, at);
  1844. }
  1845. else {
  1846. let mr = 0;
  1847. if (abs > 3)
  1848. mr = 1 + xGame.tools.random(2, 6) * abs * 0.01;
  1849. else if (Math.random() > 0.6)
  1850. mr = xGame.tools.random(1, 10) * 0.1;
  1851. mr = dr > 0 ? -mr : mr;
  1852. xGame.common.d2World.d2Gan.rotDest(rot + mr);
  1853. }
  1854. }
  1855. setKick(dx, dy) {
  1856. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  1857. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  1858. this.tempDir1.x = 0;
  1859. this.tempDir1.y = 1;
  1860. this.tempDir2.y = -this.tempDir2.y;
  1861. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1862. if (num > 1)
  1863. num = 1;
  1864. let rot = Math.acos(num) * 57.3;
  1865. if (this.tempDir2.x < 0)
  1866. rot = 360 - rot;
  1867. this.destRot += rot;
  1868. if (!xGame.common.gameMgr.finishOneShoot) {
  1869. this.forceMax += xGame.tools.random(10, 50);
  1870. this.forceMax -= this.aiLv * 2;
  1871. if (this.forceMax < 20)
  1872. this.forceMax = 20;
  1873. }
  1874. if (this.forceMax > 100)
  1875. this.forceMax = 101;
  1876. else if (this.forceMax < 10)
  1877. this.forceMax += xGame.tools.random(0, 10);
  1878. if (xGame.common.gameMode == 1)
  1879. this.forceMax = xGame.tools.random(80, 100);
  1880. else
  1881. this.forceMax = xGame.tools.random(this.forceMax * 0.5, this.forceMax);
  1882. let max = 2000 - this.aiLv * 100;
  1883. if (Math.random() > 0.8)
  1884. max += xGame.tools.random(100, 2000);
  1885. this.setState(AIState.turn, xGame.tools.random(500, max));
  1886. }
  1887. shoot() {
  1888. if (this.waitTime < 0 && Math.abs(this.forceNum - this.forceMax) < 4) {
  1889. if (Math.random() > 0.8) {
  1890. this.gameSrc.aiForce(1);
  1891. this.setState(AIState.wait);
  1892. }
  1893. }
  1894. else {
  1895. let df = xGame.tools.random(3, 8);
  1896. if (this.forceNum < this.forceMax)
  1897. this.forceNum += df;
  1898. else
  1899. this.forceNum -= df;
  1900. let startY = this.gameSrc.ui.powerNode.y;
  1901. let height = this.gameSrc.ui.powerNode.height;
  1902. let force = startY + height * this.forceNum * 0.01;
  1903. this.gameSrc.aiForce(2, force);
  1904. }
  1905. }
  1906. reset() {
  1907. for (let i = 0; i < 4; i++) {
  1908. this.setRate--;
  1909. this.setNum++;
  1910. let pos = this.posList[this.posIdx];
  1911. this.rootPos.x = pos.x + xGame.tools.random(-20, 20);
  1912. this.rootPos.y = pos.y + xGame.tools.random(-20, 20);
  1913. if (!xGame.common.gameMgr.isTouchedBall && this.rootPos.x > 387)
  1914. this.rootPos.x = 387;
  1915. if (this.rootPos.x < this.rectL)
  1916. this.rootPos.x = this.rectL;
  1917. else if (this.rootPos.x > this.rectR)
  1918. this.rootPos.x = this.rectR;
  1919. if (this.rootPos.y < this.rectT)
  1920. this.rootPos.y = this.rectT;
  1921. else if (this.rootPos.y > this.rectB)
  1922. this.rootPos.y = this.rectB;
  1923. this.posIdx++;
  1924. let max = this.posList.length;
  1925. if (this.posIdx >= max)
  1926. this.posIdx -= max;
  1927. this.initHoleBall();
  1928. let ball = null;
  1929. if (this.scoreBall.length > 0)
  1930. ball = this.scoreBall[0];
  1931. else if (this.lineBall.length > 0)
  1932. ball = xGame.common.getRandArrEle(this.lineBall);
  1933. if (ball && ball.kickAngle < this.bestAngle) {
  1934. this.bestAngle = ball.kickAngle;
  1935. this.bestKick.x = ball.kickPos.x;
  1936. this.bestKick.y = ball.kickPos.y;
  1937. this.bestPos.x = this.rootPos.x;
  1938. this.bestPos.y = this.rootPos.y;
  1939. this.bestForce = ball.hard * 0.08;
  1940. }
  1941. }
  1942. if (this.setNum >= this.setMax)
  1943. this.setMax = 0;
  1944. if (this.setRate < 1) {
  1945. this.setState(AIState.move, 0);
  1946. this.rootMoveTime = Laya.timer.currTimer;
  1947. this.gameSrc.aiRootMove(true);
  1948. }
  1949. }
  1950. delayLine() {
  1951. this.gameSrc.aiRootMove(false);
  1952. }
  1953. move() {
  1954. if (this.bestPos.x < 1)
  1955. this.bestPos = this.rootPos;
  1956. let wObj = this.wBall.gameObj;
  1957. let destx = wObj.x;
  1958. let desty = wObj.y;
  1959. let dx = Math.abs(destx - this.bestPos.x);
  1960. let dy = Math.abs(desty - this.bestPos.y);
  1961. let mx = 3 + dx * 0.03;
  1962. let my = 3 + dy * 0.03;
  1963. if (dx < 4 && dy < 4) {
  1964. let dt = Laya.timer.currTimer - this.rootMoveTime;
  1965. dt = dt < 1000 ? 1000 - dt : 0;
  1966. if (this.setMax > 0) {
  1967. let min = this.setMax * 0.3 + this.aiLv * 5;
  1968. this.setRate = xGame.tools.random(min, this.setMax);
  1969. this.setState(AIState.reset, 0);
  1970. }
  1971. else {
  1972. this.destRot = 0;
  1973. this.forceMax = this.bestForce;
  1974. this.setKick(this.bestKick.x, this.bestKick.y);
  1975. }
  1976. if (dt > 100) {
  1977. Laya.timer.clear(this, this.delayLine);
  1978. Laya.timer.once(dt, this, this.delayLine);
  1979. }
  1980. else
  1981. this.gameSrc.aiRootMove(false);
  1982. }
  1983. else {
  1984. if (dx > 4)
  1985. destx = wObj.x < this.bestPos.x ? wObj.x + mx : wObj.x - mx;
  1986. if (dy > 4)
  1987. desty = wObj.y < this.bestPos.y ? wObj.y + my : wObj.y - my;
  1988. this.gameSrc.onRootMove({ x: destx, y: desty });
  1989. }
  1990. }
  1991. resetRoot() {
  1992. this.bestAngle = 180;
  1993. this.bestForce = 0;
  1994. this.setMax = this.posList.length;
  1995. this.posIdx = xGame.tools.random(0, this.setMax);
  1996. let min = this.setMax * 0.3 + this.aiLv * 5;
  1997. this.setRate = xGame.tools.random(min, this.setMax);
  1998. let max = 2000 - this.aiLv * 100;
  1999. if (Math.random() > 0.8)
  2000. max += xGame.tools.random(100, 1000);
  2001. if (this.isGuide)
  2002. this.setState(AIState.select, 500);
  2003. else if (this.onAway(2))
  2004. this.setState(AIState.reset, xGame.tools.random(400, max));
  2005. else
  2006. this.setState(AIState.none);
  2007. if (xGame.common.gameMgr.finishOneShoot)
  2008. this.chat();
  2009. }
  2010. runAI() {
  2011. if (this.state > AIState.idle)
  2012. return;
  2013. this.initBall();
  2014. this.onGame(2500);
  2015. if (Math.random() > 0.6)
  2016. this.chat();
  2017. }
  2018. stopRun() {
  2019. this.setState(AIState.idle);
  2020. }
  2021. onGame(base) {
  2022. let max = base - this.aiLv * 100;
  2023. if (Math.random() > 0.8)
  2024. max += xGame.tools.random(100, 1000);
  2025. if (this.onAway(2))
  2026. this.setState(AIState.select, xGame.tools.random(500, max));
  2027. else
  2028. this.setState(AIState.none);
  2029. }
  2030. setState(sta, wt = 0) {
  2031. if (this.state == AIState.none)
  2032. return;
  2033. this.state = sta;
  2034. this.waitTime = wt;
  2035. }
  2036. onUpdate() {
  2037. if (this.state == AIState.none)
  2038. return;
  2039. this.awayTime -= this.dtime;
  2040. if (this.awayTime < 1) {
  2041. this.awayTime = xGame.tools.random(6000, 10000);
  2042. this.awayNum += (11 - this.aiLv);
  2043. this.onAway(1);
  2044. }
  2045. if (this.waitTime >= 0) {
  2046. this.waitTime -= this.dtime;
  2047. return;
  2048. }
  2049. switch (this.state) {
  2050. case AIState.idle:
  2051. this.chat();
  2052. break;
  2053. case AIState.reset:
  2054. this.reset();
  2055. break;
  2056. case AIState.move:
  2057. this.move();
  2058. break;
  2059. case AIState.leave:
  2060. this.state = AIState.none;
  2061. xGame.common.gameMgr.aiGameEnd(true);
  2062. break;
  2063. case AIState.select:
  2064. this.selectBall();
  2065. break;
  2066. case AIState.turn:
  2067. this.turnPole();
  2068. break;
  2069. case AIState.shoot:
  2070. this.shoot();
  2071. break;
  2072. }
  2073. }
  2074. onAway(type) {
  2075. if (type == 1) {
  2076. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2077. let num = this.awayNum + db * 20;
  2078. if (db > 0 && num > 0 && xGame.tools.random(0, 10000) < num && this.state == AIState.idle) {
  2079. xGame.common.gameMgr.aiLeave();
  2080. this.setState(AIState.leave, 6666);
  2081. }
  2082. }
  2083. else if (type == 2) {
  2084. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2085. let num = this.awayNum + db * 30;
  2086. if (xGame.tools.random(0, 10000) < num)
  2087. return false;
  2088. }
  2089. else if (type == 3) {
  2090. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2091. let num = this.awayNum + db * 10;
  2092. if (xGame.tools.random(0, 4000) < num)
  2093. return false;
  2094. }
  2095. return true;
  2096. }
  2097. chat() {
  2098. if (this.chatTime > 0) {
  2099. this.chatTime -= this.dtime;
  2100. return;
  2101. }
  2102. this.chatTime = xGame.tools.random(2000, 10000);
  2103. let rand = xGame.tools.random(0, 100);
  2104. if (rand < 15)
  2105. this.talk();
  2106. else if (rand < 35)
  2107. this.emotion();
  2108. }
  2109. talk() {
  2110. xGame.common.talkMgr.showAITalk(0);
  2111. }
  2112. emotion() {
  2113. xGame.common.talkMgr.showAIEmotion(0);
  2114. }
  2115. resetAI() {
  2116. this.stopRun();
  2117. this.state = AIState.none;
  2118. }
  2119. }
  2120. class Partical extends Laya.Script3D {
  2121. constructor() {
  2122. super();
  2123. this.duration = 2000;
  2124. }
  2125. ;
  2126. onAwake() {
  2127. this.gameObj = this.owner;
  2128. }
  2129. onEnable() {
  2130. this.openTimer();
  2131. }
  2132. openTimer() {
  2133. Laya.timer.once(this.duration, this, this.disappear);
  2134. }
  2135. setCallback(obj, callback) {
  2136. this.obj = obj;
  2137. this.callback = callback;
  2138. Laya.timer.clearAll(this);
  2139. Laya.timer.once(this.duration, this, this.disappear);
  2140. }
  2141. disappear() {
  2142. xGame.poolD3Mgr.putItem(this.gameObj.name, this.gameObj);
  2143. this.callback && this.callback(this.obj);
  2144. }
  2145. }
  2146. class Ball extends Laya.Script3D {
  2147. constructor() {
  2148. super();
  2149. this.posV3 = new Laya.Vector3();
  2150. this.rotRate = 2.1;
  2151. this.rotSpeed = new Laya.Vector3();
  2152. this.myIndex = 0;
  2153. }
  2154. onAwake() {
  2155. this.gameObj = this.owner;
  2156. this.transform = this.gameObj.transform;
  2157. this.ballNode = this.gameObj.getChildByName("Ball");
  2158. this.shadowNode = this.gameObj.getChildByName("shadow");
  2159. }
  2160. initSelf(index, x, y, owner) {
  2161. this.d2BallSrc = owner;
  2162. this.myIndex = index;
  2163. this.setAlbedoTexture();
  2164. this.setTransPos(x, y);
  2165. this.setScale();
  2166. this.ballNode.transform.localRotationEulerX = 90;
  2167. if (index == 0) {
  2168. }
  2169. }
  2170. setAlbedoTexture(isIce = false) {
  2171. let url;
  2172. if (isIce) {
  2173. url = `res/d3Res/ballTexture/ice.jpg`;
  2174. }
  2175. else {
  2176. url = `res/d3Res/ballTexture/ball${this.myIndex}.png`;
  2177. }
  2178. Laya.Texture2D.load(url, Laya.Handler.create(this, (tex) => {
  2179. this.ballNode.meshRenderer.material["albedoTexture"] = tex;
  2180. }));
  2181. }
  2182. runFireworks(obj, delay, callback) {
  2183. Laya.timer.clearAll(this);
  2184. Laya.timer.once(delay + 1, this, () => {
  2185. let fire = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  2186. fire.transform.localPositionX = this.transform.localPositionX;
  2187. fire.transform.localPositionY = this.transform.localPositionY;
  2188. fire.transform.localPositionZ = this.transform.localPositionZ;
  2189. let src = fire.getComponent(Partical);
  2190. src.duration = 1000;
  2191. src.setCallback(obj, callback);
  2192. let eft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  2193. eft.transform.localPositionX = this.transform.localPositionX;
  2194. eft.transform.localPositionY = this.transform.localPositionY;
  2195. eft.transform.localPositionZ = this.transform.localPositionZ;
  2196. });
  2197. }
  2198. setTransPos(x, y) {
  2199. this.setRotation();
  2200. xGame.common.pos2to3Convert(x, y, this.posV3);
  2201. this.transform.localPositionX = this.posV3.x;
  2202. this.transform.localPositionY = 0;
  2203. this.transform.localPositionZ = this.posV3.z;
  2204. this.transform.localRotationEulerX = 0;
  2205. this.transform.localRotationEulerY = 0;
  2206. this.transform.localRotationEulerZ = 0;
  2207. this.shadowNode.transform.localPositionX = this.posV3.x / 30;
  2208. this.shadowNode.transform.localPositionY = 0.1;
  2209. this.shadowNode.transform.localPositionZ = this.posV3.z / 30;
  2210. }
  2211. setRotation() {
  2212. if (this.d2BallSrc.canRot) {
  2213. let speed = this.d2BallSrc.rigy.linearVelocity;
  2214. this.rotSpeed.x = speed.x * this.rotRate;
  2215. this.rotSpeed.z = speed.y * this.rotRate;
  2216. this.rotSpeed.y = this.d2BallSrc.rotY;
  2217. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2218. }
  2219. else if (Math.abs(this.d2BallSrc.rotY) > 0.1) {
  2220. this.rotSpeed.x = this.rotSpeed.y = 0;
  2221. this.rotSpeed.y = this.d2BallSrc.rotY;
  2222. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2223. }
  2224. }
  2225. setScale() {
  2226. let radius = xGame.common.d2World.rootBall.ui.width;
  2227. let scale = xGame.common.scale2to3Convert(radius);
  2228. this.transform.localScaleX = scale;
  2229. this.transform.localScaleY = scale;
  2230. this.transform.localScaleZ = scale;
  2231. }
  2232. playInHoleEft() {
  2233. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  2234. eft.transform.position = this.transform.position;
  2235. }
  2236. playIceEft() {
  2237. let eft = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  2238. eft.transform.position = this.transform.position;
  2239. }
  2240. get scaleXYZ() {
  2241. return this.transform.localScaleX;
  2242. }
  2243. set scaleXYZ(val) {
  2244. this.transform.localScaleX = val;
  2245. this.transform.localScaleY = val;
  2246. this.transform.localScaleZ = val;
  2247. }
  2248. get posX() {
  2249. return this.transform.localPositionX;
  2250. }
  2251. set posX(val) {
  2252. this.transform.localPositionX = val;
  2253. }
  2254. get posY() {
  2255. return this.transform.localPositionY;
  2256. }
  2257. set posY(val) {
  2258. this.transform.localPositionY = val;
  2259. }
  2260. get posZ() {
  2261. return this.transform.localPositionZ;
  2262. }
  2263. set posZ(val) {
  2264. this.transform.localPositionZ = val;
  2265. }
  2266. destroySelf() {
  2267. this.posV3 = null;
  2268. this.rotSpeed = null;
  2269. this.d2BallSrc = null;
  2270. this.ballNode = null;
  2271. this.gameObj.destroy(true);
  2272. this.transform = null;
  2273. this.destroy();
  2274. }
  2275. }
  2276. class ui_D2Ball extends fgui.GComponent {
  2277. static createInstance() {
  2278. return (fgui.UIPackage.createObject("game", "D2Ball"));
  2279. }
  2280. onConstruct() {
  2281. this.myIcon = (this.getChild("myIcon"));
  2282. this.inner = (this.getChild("inner"));
  2283. this.n8 = (this.getChild("n8"));
  2284. this.n4 = (this.getChild("n4"));
  2285. this.wrongTips = (this.getChild("wrongTips"));
  2286. this.rightTips = (this.getChild("rightTips"));
  2287. this.breathAni = this.getTransition("breathAni");
  2288. }
  2289. }
  2290. ui_D2Ball.URL = "ui://isxx5ak7kt443qi";
  2291. class D2BallSrc extends Laya.Script {
  2292. constructor() {
  2293. super();
  2294. this.number = 0;
  2295. this.startX = 0;
  2296. this.startY = 0;
  2297. this.angleV2 = new Laya.Vector2();
  2298. this.isRootBall = false;
  2299. this.isBlackBall = false;
  2300. this.ballType = "";
  2301. this.canRot = true;
  2302. this.rotY = 0;
  2303. this.poleAngle = 0;
  2304. this.kickPos = { x: 0, y: 0 };
  2305. this.hard = 0;
  2306. this.kickAngle = 0;
  2307. this.borderDis = 0;
  2308. this.speedP10 = 5.6;
  2309. this.lastSpeed = { x: 0, y: 0 };
  2310. this.stillSpeed = 0.12;
  2311. this.ballFunc = "normal";
  2312. this.isRunSkillAni = false;
  2313. this.isInHole = false;
  2314. this.iceOwner = "";
  2315. this.forceRun = false;
  2316. this.myUNID = "";
  2317. this.rectL = 0;
  2318. this.rectR = 0;
  2319. this.rectT = 0;
  2320. this.rectB = 0;
  2321. this.forceVec = new Laya.Vector2();
  2322. this.lastDis = 0;
  2323. this.helpOut = { type: "", x: 0, y: 0 };
  2324. }
  2325. initSelf(number, x, y, d3Ball) {
  2326. if (!this.gameObj)
  2327. this.gameObj = this.owner;
  2328. this.number = number;
  2329. this.startX = x;
  2330. this.startY = y;
  2331. this.d3Ball = d3Ball;
  2332. this.isRootBall = false;
  2333. this.isBlackBall = false;
  2334. this.ballType = "";
  2335. if (number == 0) {
  2336. this.isRootBall = true;
  2337. }
  2338. else if (number == 8) {
  2339. this.isBlackBall = true;
  2340. }
  2341. else {
  2342. if (number <= 7) {
  2343. this.ballType = ballCamp.full;
  2344. }
  2345. else {
  2346. this.ballType = ballCamp.flower;
  2347. }
  2348. }
  2349. this.setInfo();
  2350. this.setD3Ball();
  2351. this.owner["mySrc"] = this;
  2352. this.rigy.linearDamping = 1;
  2353. D2BallSrc._unid++;
  2354. this.myUNID = "d2ball" + D2BallSrc._unid;
  2355. let rect = xGame.common.d2World.borderRect;
  2356. this.rectL = Math.ceil(rect.x) + 20;
  2357. this.rectT = Math.ceil(rect.y) + 20;
  2358. this.rectR = Math.floor(rect.x + rect.width) - 20;
  2359. this.rectB = Math.floor(rect.y + rect.height) - 20;
  2360. }
  2361. setInfo() {
  2362. this.gameObj.x = this.startX;
  2363. this.gameObj.y = this.startY;
  2364. let radius = this.ui.width / 2;
  2365. this.gameObj.width = radius * 2;
  2366. this.gameObj.height = radius * 2;
  2367. if (xGame.common.showDebug) {
  2368. this.ui.myIcon.alpha = 1;
  2369. this.ui.inner.alpha = 1;
  2370. }
  2371. else {
  2372. this.ui.myIcon.alpha = 0;
  2373. this.ui.inner.alpha = 0;
  2374. }
  2375. }
  2376. setD3Ball() {
  2377. this.d3Ball = this.d3Ball;
  2378. this.d3BallSrc = this.d3Ball.getComponent(Ball);
  2379. this.d3BallSrc.initSelf(this.number, this.startX, this.startY, this);
  2380. }
  2381. onUpdate() {
  2382. if (xGame.common.gameMgr.gamePause)
  2383. return;
  2384. if (this.isInHole)
  2385. return;
  2386. if (!xGame.common.d2World.openCheckStill)
  2387. return;
  2388. this.runBall();
  2389. }
  2390. runBall() {
  2391. this.lastSpeed.x = this.rigy.linearVelocity.x;
  2392. this.lastSpeed.y = this.rigy.linearVelocity.y;
  2393. this.d3BallSrc.setTransPos(this.gameObj.x, this.gameObj.y);
  2394. this.judgeBorder();
  2395. }
  2396. getDestDis(dest) {
  2397. return xGame.tools.getDistance(dest.x, dest.y, this.gameObj.x, this.gameObj.y);
  2398. }
  2399. setmyXY(x, y) {
  2400. this.d3BallSrc.setTransPos(x, y);
  2401. }
  2402. getSpeed() {
  2403. let speed = this.rigy.linearVelocity;
  2404. return speed.x * speed.x + speed.y * speed.y;
  2405. }
  2406. onTriggerEnter(collider) {
  2407. if (!collider || !collider.owner)
  2408. return;
  2409. let coll = "collide";
  2410. let speed = this.getSpeed();
  2411. let sv2 = this.speedP10 * this.speedP10;
  2412. if (collider.label == "ball") {
  2413. if (speed < 9 && this.number != 0)
  2414. coll = "";
  2415. else if (speed < sv2)
  2416. coll = "collide_4";
  2417. else if (speed < sv2 * 6.2)
  2418. coll = "collide_3";
  2419. else if (speed < sv2 * 25)
  2420. coll = "collide_2";
  2421. else if (speed < sv2 * 56)
  2422. coll = "collide_1";
  2423. xGame.soundMgr.playSound(coll);
  2424. if (this.gameObj.x < this.rectL || this.gameObj.x > this.rectR || this.gameObj.y < this.rectT || this.gameObj.y > this.rectB) {
  2425. if (collider.owner) {
  2426. let rig = collider.owner.getComponent(D2BallSrc);
  2427. if (Math.abs(rig.rigy.linearVelocity.x) > 0)
  2428. rig.lastSpeed.x = rig.rigy.linearVelocity.x;
  2429. if (Math.abs(rig.rigy.linearVelocity.y) > 0)
  2430. rig.lastSpeed.y = rig.rigy.linearVelocity.y;
  2431. let vx = Math.abs(rig.lastSpeed.x * 0.4);
  2432. let vy = Math.abs(rig.lastSpeed.y * 0.5);
  2433. let rx = 0;
  2434. let ry = 0;
  2435. if (this.gameObj.x < this.rectL)
  2436. rx = vx;
  2437. else if (this.gameObj.x > this.rectR)
  2438. rx = -vx;
  2439. else if (this.gameObj.y < this.rectT)
  2440. ry = vy;
  2441. else if (this.gameObj.y > this.rectB)
  2442. ry = -vy;
  2443. this.rigy.applyLinearImpulseToCenter({ x: rx, y: ry });
  2444. }
  2445. }
  2446. if (this.number != 0) {
  2447. return;
  2448. }
  2449. else {
  2450. if (this.forceRun) {
  2451. console.log("randon force");
  2452. this.applyForce(collider);
  2453. }
  2454. }
  2455. if (xGame.common.d2World.isOnSameLine) {
  2456. xGame.common.d2World.isOnSameLine = false;
  2457. this.rigy.linearVelocity = { x: 0, y: 0 };
  2458. }
  2459. if (xGame.common.gameMgr.firstColliObj == null) {
  2460. xGame.common.gameMgr.firstColliObj = collider.owner["mySrc"].number;
  2461. xGame.common.gameMgr.isTouchedBall = true;
  2462. }
  2463. }
  2464. else {
  2465. xGame.common.recoverCameraView();
  2466. let wallStr = "";
  2467. if (speed < 9) { }
  2468. else if (speed < sv2) { }
  2469. else if (speed < sv2 * 6.2)
  2470. wallStr = "wall_30";
  2471. else if (speed < sv2 * 25)
  2472. wallStr = "wall_50";
  2473. else if (speed < sv2 * 56)
  2474. wallStr = "wall_80";
  2475. xGame.soundMgr.playSound(wallStr);
  2476. }
  2477. }
  2478. applyForce(collider) {
  2479. let src = collider.owner.mySrc;
  2480. this.forceVec.x = src.gameObj.x - this.gameObj.x;
  2481. this.forceVec.y = src.gameObj.y - this.gameObj.y;
  2482. Laya.Vector2.normalize(this.forceVec, this.forceVec);
  2483. Laya.Vector2.scale(this.forceVec, 50, this.forceVec);
  2484. src.rigy.applyLinearImpulseToCenter({ x: this.forceVec.x, y: this.forceVec.y });
  2485. }
  2486. checkWrongBall(playEft = true) {
  2487. if (this.isInHole)
  2488. return;
  2489. xGame.common.gameMgr.inHoleBalls.push(this.number);
  2490. if (this.number != 0 && playEft)
  2491. this.d3BallSrc.playInHoleEft();
  2492. let coll = "inpocket_1";
  2493. let speed = this.getSpeed();
  2494. let sv2 = this.speedP10 * this.speedP10 * 0.8;
  2495. if (speed < 9 && this.number != 0)
  2496. coll = "";
  2497. else if (speed < sv2 * 6.2)
  2498. coll = "inpocket_4";
  2499. else if (speed < sv2 * 25)
  2500. coll = "collide_3";
  2501. else if (speed < sv2 * 56)
  2502. coll = "collide_2";
  2503. xGame.soundMgr.playSound(coll);
  2504. this.isInHole = true;
  2505. if (this.number == 0) {
  2506. console.log("白球进了。。");
  2507. this.reset();
  2508. this.rigy.linearVelocity = { x: 0, y: 0 };
  2509. this.hideSelf();
  2510. xGame.common.gameUI.ui.whiteAni.visible = true;
  2511. xGame.common.gameUI.ui.whiteAni.t0.play(Laya.Handler.create(this, () => {
  2512. xGame.common.gameUI.ui.whiteAni.visible = false;
  2513. }));
  2514. }
  2515. else {
  2516. xGame.common.playClassicEmotion(this.number, this.gameObj.x, this.gameObj.y);
  2517. xGame.common.d2World.removeOneBall(this);
  2518. this.destroySelf();
  2519. xGame.common.playHappySound(this.number);
  2520. this.runFlyEft();
  2521. }
  2522. }
  2523. runFlyEft() {
  2524. if (xGame.common.gameMode == GameMode.placeBall && xGame.common.gameMgr.placeBallData.type == PlaceBallType.challenge) {
  2525. xGame.common.playAwardSpine(this.gameObj.x + 100, this.gameObj.y - 100);
  2526. }
  2527. }
  2528. hideSelf() {
  2529. if (this.d3Ball)
  2530. this.d3Ball.active = false;
  2531. }
  2532. showSelf() {
  2533. this.isInHole = false;
  2534. if (this.d3Ball && !this.d3Ball.active)
  2535. this.d3Ball.active = true;
  2536. }
  2537. isStill() {
  2538. let speed = this.rigy.linearVelocity;
  2539. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed) {
  2540. this.rigy.linearVelocity = { x: 0, y: 0 };
  2541. return true;
  2542. }
  2543. return false;
  2544. }
  2545. reset() {
  2546. }
  2547. destroySelf() {
  2548. this.d3BallSrc.destroySelf();
  2549. if (!this.ui.isDisposed) {
  2550. this.ui.removeFromParent();
  2551. this.ui.dispose();
  2552. this.ui = null;
  2553. }
  2554. this.outColli = null;
  2555. this.innerColli = null;
  2556. this.rigy = null;
  2557. this.d3Ball = null;
  2558. this.d3BallSrc = null;
  2559. this.angleV2 = null;
  2560. this.gameObj.destroy(true);
  2561. this.destroy();
  2562. }
  2563. judgeBorder() {
  2564. if (this.forceRun && this.owner == xGame.common.d2World.rootBall.owner) {
  2565. return;
  2566. }
  2567. if (this.destroyed)
  2568. return;
  2569. if (xGame.common.gameMode == GameMode.classic)
  2570. return;
  2571. let isOver = xGame.common.checkBallOverBorder(this.gameObj.x, this.gameObj.y);
  2572. if (isOver) {
  2573. this.checkWrongBall();
  2574. }
  2575. }
  2576. onClick(e, force = false) {
  2577. if (this.number == 0)
  2578. return;
  2579. if (force) {
  2580. }
  2581. else {
  2582. if (xGame.common.d2World.openCheckStill)
  2583. return;
  2584. if (!xGame.common.gameMgr.selfTurn) {
  2585. return;
  2586. }
  2587. }
  2588. if (!xGame.common.gameMgr.finishOneShoot)
  2589. return;
  2590. let root = xGame.common.d2World.rootBall.gameObj;
  2591. let x = this.gameObj.x - root.x;
  2592. let y = this.gameObj.y - root.y;
  2593. let angle = xGame.common.getfguiRotation(x, y);
  2594. xGame.common.d2World.d2Gan.ui.rotation = angle;
  2595. xGame.common.d2World.getHelpLine();
  2596. xGame.common.clickedBall = true;
  2597. this.checkGuide();
  2598. }
  2599. checkGuide() {
  2600. let guide = DataMgr.getSkillGuide();
  2601. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) {
  2602. xGame.common.guideStep++;
  2603. xGame.common.gameUI.ui.guide1.visible = false;
  2604. xGame.common.gameUI.ui.guide2.visible = true;
  2605. }
  2606. }
  2607. checkDistance(disX, disY, angle) {
  2608. let diameter = this.gameObj.width - 1;
  2609. let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2);
  2610. if (!this.lastDis)
  2611. this.lastDis = dis;
  2612. else {
  2613. if (dis > this.lastDis) {
  2614. this.helpOut.type = "remove";
  2615. return this.helpOut;
  2616. }
  2617. }
  2618. if (dis <= Math.pow(diameter, 2)) {
  2619. let del = 0.01;
  2620. let offest = 0;
  2621. let realX = disX - this.gameObj.x;
  2622. let realY = disY - this.gameObj.y;
  2623. while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) {
  2624. offest += del;
  2625. realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180);
  2626. realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180);
  2627. }
  2628. this.helpOut.type = "ok";
  2629. this.helpOut.x = realX + this.gameObj.x;
  2630. this.helpOut.y = realY + this.gameObj.y;
  2631. return this.helpOut;
  2632. }
  2633. else {
  2634. this.helpOut.type = "no";
  2635. return this.helpOut;
  2636. }
  2637. }
  2638. clearBallEft() {
  2639. this.clearBallRightEft();
  2640. this.clearBallWrongEft();
  2641. }
  2642. clearBallRightEft() {
  2643. this.ui.breathAni.stop();
  2644. this.ui.rightTips.visible = false;
  2645. }
  2646. clearBallWrongEft() {
  2647. this.ui.wrongTips.visible = false;
  2648. }
  2649. showWrongEft() {
  2650. if (!xGame.common.gameMgr.selfTurn)
  2651. return;
  2652. this.ui.wrongTips.visible = true;
  2653. }
  2654. showRightEft() {
  2655. if (!xGame.common.gameMgr.selfTurn)
  2656. return;
  2657. this.ui.rightTips.visible = true;
  2658. this.ui.rightTips.scaleX = 1;
  2659. this.ui.rightTips.scaleY = 1;
  2660. this.ui.breathAni.play();
  2661. }
  2662. setBallFunc(type, owner) {
  2663. if (type == "ice") {
  2664. this.ballFunc = type;
  2665. this.d3BallSrc.setAlbedoTexture(true);
  2666. this.rigy.type = "static";
  2667. this.iceOwner = owner;
  2668. }
  2669. else {
  2670. if (owner == this.iceOwner) {
  2671. this.ballFunc = type;
  2672. this.d3BallSrc.setAlbedoTexture(false);
  2673. this.rigy.type = "dynamic";
  2674. }
  2675. }
  2676. }
  2677. }
  2678. D2BallSrc._unid = 0;
  2679. class D2RootBallSrc extends D2BallSrc {
  2680. constructor() {
  2681. super();
  2682. this.maxSpeed = 0;
  2683. this.classicMaxSpeed = 2.2;
  2684. this.bigSkillMaxSpeed = 4;
  2685. this.angle = 0;
  2686. this.allPercent = 0;
  2687. this.linearPercent = 0;
  2688. this.anglePercent = 0;
  2689. this.maxAngleRate = 0.6;
  2690. this.baseRot = 7;
  2691. this.angleMax = 0;
  2692. this.speed = new Laya.Vector2();
  2693. this.rotSpeed = new Laya.Vector2();
  2694. }
  2695. isStill() {
  2696. let speed = this.rigy.linearVelocity;
  2697. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) {
  2698. if (this.anglePercent <= 0.1) {
  2699. this.rigy.linearVelocity = { x: 0, y: 0 };
  2700. return true;
  2701. }
  2702. }
  2703. return false;
  2704. }
  2705. reset() {
  2706. this.linearPercent = 0;
  2707. this.anglePercent = 0;
  2708. }
  2709. setSpeed(percent, angle) {
  2710. this.allPercent = percent;
  2711. this.angle = angle;
  2712. this.setAngleSpeed();
  2713. this.setLinearSpeed();
  2714. let hit = "hit";
  2715. if (percent < 25)
  2716. hit = "hit03";
  2717. else if (percent < 50)
  2718. hit = "hit02";
  2719. else if (percent < 75)
  2720. hit = "hit01";
  2721. xGame.soundMgr.playSound(hit);
  2722. }
  2723. setAngleSpeed() {
  2724. let offest = xGame.common.rodOffest;
  2725. let radius = 82;
  2726. let rate = Math.abs(offest.y / radius) * 0.5;
  2727. if (offest.y > 0)
  2728. this.angleMax = -this.baseRot * 2;
  2729. else
  2730. this.angleMax = this.baseRot;
  2731. this.rotY = -offest.x / radius * 100;
  2732. this.anglePercent = this.maxAngleRate * rate * this.allPercent;
  2733. this.linearPercent = this.allPercent - this.anglePercent;
  2734. }
  2735. setLinearSpeed() {
  2736. if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) {
  2737. if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) {
  2738. if (!xGame.common.longHelpLine) {
  2739. let offset = -150 + xGame.common.randomNum(0, 300);
  2740. offset /= 100;
  2741. this.angle += offset;
  2742. }
  2743. }
  2744. }
  2745. let sin = Math.sin(this.angle * Math.PI / 180);
  2746. let cos = Math.cos(this.angle * Math.PI / 180);
  2747. switch (xGame.common.gameMode) {
  2748. case GameMode.classic:
  2749. this.maxSpeed = this.classicMaxSpeed;
  2750. break;
  2751. case GameMode.bigMove:
  2752. this.maxSpeed = this.bigSkillMaxSpeed;
  2753. break;
  2754. case GameMode.placeBall:
  2755. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  2756. if (data.type == 1) {
  2757. this.maxSpeed = this.bigSkillMaxSpeed;
  2758. }
  2759. else {
  2760. this.maxSpeed = this.classicMaxSpeed;
  2761. }
  2762. break;
  2763. default:
  2764. break;
  2765. }
  2766. this.speed.x = this.maxSpeed * this.linearPercent * sin;
  2767. this.speed.y = -this.maxSpeed * this.linearPercent * cos;
  2768. this.rotSpeed.x = -this.angleMax * sin * this.anglePercent;
  2769. this.rotSpeed.y = this.angleMax * cos * this.anglePercent;
  2770. this.rigy.applyLinearImpulseToCenter(this.speed);
  2771. }
  2772. onUpdate() {
  2773. if (this.anglePercent > 0.1) {
  2774. this.anglePercent *= 0.97;
  2775. this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent;
  2776. this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent;
  2777. this.rigy.applyForceToCenter(this.rotSpeed);
  2778. Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed);
  2779. Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed);
  2780. let num = Laya.Vector2.dot(this.speed, this.rotSpeed);
  2781. if (num > 0.9)
  2782. this.canRot = true;
  2783. }
  2784. else
  2785. this.canRot = true;
  2786. if (Math.abs(this.rotY) > 0.1)
  2787. this.rotY *= 0.98;
  2788. super.onUpdate();
  2789. }
  2790. destroySelf() {
  2791. super.destroySelf();
  2792. this.speed = null;
  2793. }
  2794. }
  2795. class D2Ball extends Laya.Sprite {
  2796. constructor(isRootBall = false) {
  2797. super();
  2798. this.ui = ui_D2Ball.createInstance();
  2799. this.pivotX = this.ui.width / 2;
  2800. this.pivotY = this.ui.width / 2;
  2801. this.x = 0;
  2802. this.y = 0;
  2803. this.addChild(this.ui.displayObject);
  2804. this.ui.displayObject.x += this.ui.width / 2;
  2805. this.ui.displayObject.y += this.ui.width / 2;
  2806. if (isRootBall) {
  2807. this.d2Src = this.addComponent(D2RootBallSrc);
  2808. }
  2809. else {
  2810. this.d2Src = this.addComponent(D2BallSrc);
  2811. }
  2812. this.d2Src.ui = this.ui;
  2813. this.addCircleCollider();
  2814. this.addInnerCircleCollider();
  2815. this.addRigyBody();
  2816. }
  2817. addCircleCollider() {
  2818. let colli = xGame.common.getCollider("circle");
  2819. colli.radius = this.ui.width / 2;
  2820. this.addComponentIntance(colli);
  2821. this.d2Src.outColli = colli;
  2822. colli.label = "ball";
  2823. }
  2824. addInnerCircleCollider() {
  2825. let colli = xGame.common.getCollider("circle");
  2826. colli.radius = this.ui.inner.width / 2;
  2827. colli.x = (this.ui.width - this.ui.inner.width) / 2;
  2828. colli.y = (this.ui.width - this.ui.inner.width) / 2;
  2829. this.addComponentIntance(colli);
  2830. this.d2Src.innerColli = colli;
  2831. colli.label = "inner";
  2832. }
  2833. addRigyBody() {
  2834. let rigy = xGame.common.getRigbody();
  2835. rigy.type = "dynamic";
  2836. this.addComponentIntance(rigy);
  2837. this.d2Src.rigy = rigy;
  2838. }
  2839. disposeSelf() {
  2840. if (!this.ui.isDisposed) {
  2841. this.ui.dispose();
  2842. this.ui.removeFromParent();
  2843. this.ui = null;
  2844. }
  2845. }
  2846. }
  2847. class ui_D2Gan extends fgui.GComponent {
  2848. static createInstance() {
  2849. return (fgui.UIPackage.createObject("game", "D2Gan"));
  2850. }
  2851. onConstruct() {
  2852. this.myIcon = (this.getChild("myIcon"));
  2853. this.selfRodIcon = (this.getChild("selfRodIcon"));
  2854. this.selfEftRoot = (this.getChild("selfEftRoot"));
  2855. this.self = (this.getChild("self"));
  2856. this.aiRodIcon = (this.getChild("aiRodIcon"));
  2857. this.aiEftRoot = (this.getChild("aiEftRoot"));
  2858. this.ai = (this.getChild("ai"));
  2859. }
  2860. }
  2861. ui_D2Gan.URL = "ui://isxx5ak7sdh33qp";
  2862. class D2Gan {
  2863. constructor() {
  2864. this.offset = 0.15;
  2865. this.cell = 1.5;
  2866. this.onBallCell = 0.4;
  2867. this.lastInfo = { x: 0, y: 0, rotation: 0 };
  2868. this.moveNum = 70;
  2869. this.rulerRate = 0.1;
  2870. this.ui = ui_D2Gan.createInstance();
  2871. this.changeSelfRod();
  2872. this.changeAIRod();
  2873. }
  2874. changeSelfRod() {
  2875. let index = DataMgr.getCurBallRod();
  2876. let data = cfgTable.ballrodData[index + 1];
  2877. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  2878. this.selfMySpine && this.selfMySpine.dispose();
  2879. this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img);
  2880. if (data.spine) {
  2881. this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img);
  2882. this.selfMySpine = new SpineMgr(data.spine, () => {
  2883. let xx = this.ui.selfEftRoot.width / 2;
  2884. let yy = this.ui.selfEftRoot.height / 2;
  2885. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  2886. let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject);
  2887. outSpine.rotation = -90;
  2888. });
  2889. }
  2890. }
  2891. changeAIRod() {
  2892. let length = Object.keys(cfgTable.ballrodData).length;
  2893. let rand = Math.floor(length * Math.random()) + 1;
  2894. let data = cfgTable.ballrodData[rand];
  2895. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  2896. this.aiMySpine && this.aiMySpine.dispose();
  2897. this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img);
  2898. if (data.spine) {
  2899. this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img);
  2900. this.aiMySpine = new SpineMgr(data.spine, () => {
  2901. let xx = this.ui.aiEftRoot.width / 2;
  2902. let yy = this.ui.aiEftRoot.height / 2;
  2903. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  2904. let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject);
  2905. outSpine.rotation = -90;
  2906. });
  2907. }
  2908. }
  2909. setGanLastInfo() {
  2910. this.lastInfo.rotation = this.ui.rotation;
  2911. this.lastInfo.x = this.ui.x;
  2912. this.lastInfo.y = this.ui.y;
  2913. }
  2914. rotateSelf(flag, isRuler = false) {
  2915. let angle;
  2916. flag = flag * this.offset;
  2917. if (xGame.common.d2World.isHelpLineOnBall) {
  2918. angle = flag * this.onBallCell;
  2919. }
  2920. else {
  2921. angle = flag * this.cell;
  2922. }
  2923. if (isRuler) {
  2924. angle *= this.rulerRate;
  2925. }
  2926. this.ui.rotation += angle;
  2927. xGame.common.d2World.getHelpLine();
  2928. }
  2929. checkDistance() {
  2930. let target = xGame.common.d2World.targetBall;
  2931. let root = xGame.common.d2World.rootBall;
  2932. if (target == null) {
  2933. return 1;
  2934. }
  2935. let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2);
  2936. if (dis <= 2500) {
  2937. return 5;
  2938. }
  2939. return 1;
  2940. }
  2941. rotDest(rot) {
  2942. this.ui.rotation = rot;
  2943. xGame.common.d2World.getHelpLine();
  2944. }
  2945. storagePower(powerNum) {
  2946. let pos = (powerNum / 100) * this.moveNum;
  2947. let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos;
  2948. let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos;
  2949. this.ui.x = this.lastInfo.x + xx;
  2950. this.ui.y = this.lastInfo.y + yy;
  2951. }
  2952. shoot() {
  2953. this.storagePower(0);
  2954. this.ui.visible = false;
  2955. }
  2956. destroySelf() {
  2957. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  2958. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  2959. this.selfMySpine && this.selfMySpine.dispose();
  2960. this.aiMySpine && this.aiMySpine.dispose();
  2961. this.lastInfo = null;
  2962. if (!this.ui.isDisposed) {
  2963. this.ui.removeFromParent();
  2964. this.ui.dispose();
  2965. }
  2966. }
  2967. }
  2968. class ui_HelpLine extends fgui.GComponent {
  2969. static createInstance() {
  2970. return (fgui.UIPackage.createObject("game", "HelpLine"));
  2971. }
  2972. onConstruct() {
  2973. this.n10 = (this.getChild("n10"));
  2974. this.rect = (this.getChild("rect"));
  2975. this.dir11 = (this.getChild("dir11"));
  2976. this.dir = (this.getChild("dir"));
  2977. this.rootDir = (this.getChild("rootDir"));
  2978. this.dirDot = (this.getChild("dirDot"));
  2979. }
  2980. }
  2981. ui_HelpLine.URL = "ui://isxx5ak7sdh33qs";
  2982. class D2HelpLine {
  2983. constructor() {
  2984. this.starX = 0;
  2985. this.starY = 0;
  2986. this.ui = ui_HelpLine.createInstance();
  2987. xGame.common.gameUI.ui.ballNode.addChild(this.ui);
  2988. this.starX = this.ui.rect.x;
  2989. this.starY = this.ui.rect.y;
  2990. }
  2991. shoot() {
  2992. this.ui.visible = false;
  2993. }
  2994. destroySelf() {
  2995. if (this.ui.isDisposed) {
  2996. this.ui.removeFromParent();
  2997. this.ui.dispose();
  2998. }
  2999. }
  3000. }
  3001. class D2World extends Laya.Script {
  3002. constructor() {
  3003. super();
  3004. this.ballArr = [];
  3005. this.openCheckStill = false;
  3006. this.checkArr = [];
  3007. this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 };
  3008. this.isHelpLineOnBall = false;
  3009. this.isOnSameLine = false;
  3010. this.reflectAngle = 0;
  3011. this.powerPercent = 0;
  3012. this.inHolesSpeed = [];
  3013. this.outDir = new Laya.Vector2();
  3014. this.rootDir = new Laya.Vector2();
  3015. this.aiLv = 0;
  3016. this.rootPos = new Laya.Vector2();
  3017. this.tempDir1 = new Laya.Vector2();
  3018. this.tempDir2 = new Laya.Vector2();
  3019. this.tempDir3 = new Laya.Vector2();
  3020. this.ballSize = 33;
  3021. this.destRot = 0;
  3022. }
  3023. initSelf() {
  3024. this.createBalls();
  3025. xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop);
  3026. xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop);
  3027. xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot);
  3028. xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot);
  3029. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  3030. }
  3031. setBorderRect() {
  3032. let ui = xGame.common.gameUI.ui;
  3033. let starX = ui.border.bar5.x + ui.border.bar5.width / 2;
  3034. let starY = ui.border.bar1.y + ui.border.bar1.height / 2;
  3035. let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width);
  3036. let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height);
  3037. this.borderRect.x = starX;
  3038. this.borderRect.y = starY;
  3039. this.borderRect.width = width;
  3040. this.borderRect.height = height;
  3041. }
  3042. resetGame() {
  3043. this.openCheckStill = false;
  3044. let temp;
  3045. for (let index = 0; index < this.ballArr.length; index++) {
  3046. temp = this.ballArr[index];
  3047. temp.destroySelf();
  3048. }
  3049. xGame.common.d3World.ballRoot.destroyChildren();
  3050. xGame.common.gameUI.ui.ballNode.removeChildren();
  3051. console.log("进入摧毁逻辑");
  3052. this.d2Gan.destroySelf();
  3053. this.d2HelpLine.destroySelf();
  3054. this.ballArr = [];
  3055. }
  3056. setD2Gan() {
  3057. let ballNode = this.rootBall.ui;
  3058. let d2Gan = new D2Gan();
  3059. this.d2Gan = d2Gan;
  3060. let ganNode = d2Gan.ui;
  3061. ballNode.addChild(ganNode);
  3062. ganNode.pivotX = ganNode.pivotX;
  3063. ganNode.pivotY = ganNode.pivotY;
  3064. ganNode.x = ganNode.myIcon.width / 2;
  3065. ganNode.y = this.rootBall.gameObj.width;
  3066. d2Gan.setGanLastInfo();
  3067. }
  3068. setHelpLine() {
  3069. let d2Help = new D2HelpLine();
  3070. this.d2HelpLine = d2Help;
  3071. }
  3072. createBalls() {
  3073. let cfg;
  3074. switch (xGame.common.gameMode) {
  3075. case GameMode.classic:
  3076. cfg = xGame.cfgMgr.getRandomClassicLevel();
  3077. break;
  3078. case GameMode.bigMove:
  3079. cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex);
  3080. break;
  3081. case GameMode.placeBall:
  3082. cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel);
  3083. break;
  3084. default:
  3085. break;
  3086. }
  3087. cfg = JSON.parse(JSON.stringify(cfg));
  3088. for (const key in cfg) {
  3089. if (cfg[key].value == 0) {
  3090. this.createRootBall(cfg[key]);
  3091. delete cfg[key];
  3092. break;
  3093. }
  3094. }
  3095. this.createOtherBalls(cfg);
  3096. }
  3097. createRootBall(data) {
  3098. let root = new D2Ball(true);
  3099. xGame.common.gameUI.ui.ballNode.displayObject.addChild(root);
  3100. this.rootBall = root.d2Src;
  3101. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3102. let d3BallSrc = d3Ball.getComponent(Ball);
  3103. xGame.common.d3World.rootBall = d3Ball;
  3104. xGame.common.d3World.rootBallSrc = d3BallSrc;
  3105. let xx = data.x;
  3106. let yy = data.y;
  3107. let numer = data.value;
  3108. xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy);
  3109. this.rootBall.initSelf(numer, xx, yy, d3Ball);
  3110. this.ballArr.push(this.rootBall);
  3111. this.setD2Gan();
  3112. this.setHelpLine();
  3113. }
  3114. createOtherBalls(cfg) {
  3115. let temp;
  3116. let src;
  3117. let data;
  3118. for (const key in cfg) {
  3119. data = cfg[key];
  3120. temp = new D2Ball();
  3121. xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp);
  3122. src = temp.d2Src;
  3123. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3124. src.initSelf(data.value, data.x, data.y, d3Ball);
  3125. this.ballArr.push(src);
  3126. }
  3127. }
  3128. shoot(percent) {
  3129. this.powerPercent = percent;
  3130. this.openCheckStill = true;
  3131. let d2Angle = this.d2Gan.ui.rotation;
  3132. this.rootBall.setSpeed(percent, d2Angle);
  3133. this.clearBallAllEft();
  3134. this.changePlayerView();
  3135. }
  3136. onUpdate() {
  3137. if (!this.openCheckStill)
  3138. return;
  3139. this.checkStill();
  3140. }
  3141. checkStill() {
  3142. for (let index = 0; index < this.ballArr.length; index++) {
  3143. if (!this.ballArr[index].isStill()) {
  3144. return;
  3145. }
  3146. }
  3147. xGame.eventMgr.event(ALL_BALL_STOP);
  3148. }
  3149. allBallStop() {
  3150. this.openCheckStill = false;
  3151. xGame.common.recoverCameraView();
  3152. }
  3153. waitShoot() {
  3154. if (!this.d2Gan.ui.isDisposed) {
  3155. this.d2Gan.ui.visible = true;
  3156. }
  3157. if (!this.d2HelpLine.ui.isDisposed) {
  3158. this.d2HelpLine.ui.visible = true;
  3159. }
  3160. this.clearBallAllEft();
  3161. this.showBallRightEft();
  3162. this.getHelpLine();
  3163. this.inHolesSpeed = [];
  3164. this.selectOneBall();
  3165. }
  3166. _getAllBallArr() {
  3167. let arr = this.ballArr;
  3168. let outArr = [];
  3169. for (let index = 0; index < arr.length; index++) {
  3170. if (arr[index] instanceof D2RootBallSrc)
  3171. continue;
  3172. if (arr[index].ballFunc == "ice")
  3173. continue;
  3174. if (arr[index].destroyed)
  3175. continue;
  3176. outArr.push(arr[index]);
  3177. }
  3178. return outArr;
  3179. }
  3180. _getBlackObj() {
  3181. let arr = this.ballArr;
  3182. for (let index = 0; index < arr.length; index++) {
  3183. if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) {
  3184. return arr[index];
  3185. }
  3186. }
  3187. }
  3188. selectOneBall() {
  3189. let all = this._getAllBallArr();
  3190. let target;
  3191. switch (xGame.common.gameMode) {
  3192. case GameMode.classic:
  3193. if (xGame.common.gameMgr.selfTurn) {
  3194. let self = xGame.common.gameMgr.selfBallArr;
  3195. let black = this._getBlackObj();
  3196. if (xGame.common.gameMgr.ensureBallType) {
  3197. if (self.length > 0) {
  3198. let out = [];
  3199. for (let j = 0; j < all.length; j++) {
  3200. if (self.indexOf(all[j].number) > -1) {
  3201. out.push(all[j]);
  3202. }
  3203. }
  3204. target = this.selectBestEnterOne(out);
  3205. }
  3206. else {
  3207. target = this.selectBestEnterOne([black]);
  3208. }
  3209. }
  3210. else {
  3211. target = this.selectBestEnterOne(all);
  3212. }
  3213. }
  3214. else {
  3215. target = this.selectBestEnterOne(all);
  3216. }
  3217. break;
  3218. case GameMode.bigMove:
  3219. target = this.selectBestEnterOne(all);
  3220. break;
  3221. case GameMode.placeBall:
  3222. if (all.length > 0) {
  3223. target = this.selectBestEnterOne(all);
  3224. }
  3225. break;
  3226. default:
  3227. break;
  3228. }
  3229. if (target && !target.destroyed && target.onClick) {
  3230. target.onClick(0, true);
  3231. let num = -200 + xGame.common.randomNum(0, 400);
  3232. num /= 150;
  3233. if (xGame.common.longHelpLine) {
  3234. num = 0;
  3235. }
  3236. this.destRot += num;
  3237. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  3238. }
  3239. }
  3240. removeOneBall(ball) {
  3241. for (let index = 0; index < this.ballArr.length; index++) {
  3242. if (this.ballArr[index].id == ball.id) {
  3243. this.ballArr.splice(index, 1);
  3244. break;
  3245. }
  3246. }
  3247. }
  3248. getHelpLine() {
  3249. this.d2HelpLine.ui.dirDot.visible = false;
  3250. this.isOnSameLine = false;
  3251. let startX = this.rootBall.gameObj.x;
  3252. let startY = this.rootBall.gameObj.y;
  3253. let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation);
  3254. if (dis == null) {
  3255. this.d2HelpLine.ui.visible = false;
  3256. console.error("辅助线异常");
  3257. return;
  3258. }
  3259. this.d2HelpLine.ui.visible = true;
  3260. let angle = this.d2Gan.ui.rotation;
  3261. let radius = 16.5;
  3262. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3263. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3264. let colliObj = xGame.common.isBlock(startX, startY, disX, disY);
  3265. if (colliObj == null) {
  3266. this.getColliPos(disX, disY, radius, angle);
  3267. xGame.common.d2World.isHelpLineOnBall = false;
  3268. this.targetBall = null;
  3269. this.reflectAngle = 0;
  3270. this.showBallWrongEft();
  3271. }
  3272. else {
  3273. let target = colliObj.src;
  3274. let radius = 16.5;
  3275. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3276. dis1 = Math.sqrt(dis1);
  3277. let realDis = colliObj.disHon - dis1;
  3278. let dir = colliObj.dir;
  3279. let xx = startX + dir.x * realDis;
  3280. let yy = startY + dir.y * realDis;
  3281. this.getColliPos(xx, yy, radius, angle);
  3282. let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180;
  3283. if (Math.abs(reflectAngle - angle) <= 0.02) {
  3284. let offset = xGame.common.rodOffest;
  3285. if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1)
  3286. this.isOnSameLine = true;
  3287. }
  3288. this.getRootDirLine(reflectAngle, angle, xx, yy, target);
  3289. xGame.common.d2World.isHelpLineOnBall = true;
  3290. this.targetBall = target;
  3291. this.reflectAngle = reflectAngle;
  3292. this.showBallWrongEft();
  3293. if (xGame.common.longHelpLine) {
  3294. this.delayReflectLine(target, reflectAngle);
  3295. }
  3296. }
  3297. }
  3298. getBorderDot(startX, startY, angle) {
  3299. let radius = 17;
  3300. let distance;
  3301. let isDone;
  3302. distance = -(this.borderRect.y - startY + radius) / Math.cos(angle * Math.PI / 180);
  3303. isDone = this.judgeUpDown(distance, angle, startX);
  3304. if (isDone != null) {
  3305. return isDone;
  3306. }
  3307. distance = -(this.borderRect.y + this.borderRect.height - 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.x - startX + radius) / Math.sin(angle * Math.PI / 180);
  3313. isDone = this.judgeLeftRight(distance, angle, startY);
  3314. if (isDone != null) {
  3315. return isDone;
  3316. }
  3317. distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180);
  3318. isDone = this.judgeLeftRight(distance, angle, startY);
  3319. if (isDone != null) {
  3320. return isDone;
  3321. }
  3322. }
  3323. judgeUpDown(distance, angle, startX) {
  3324. let flag = Math.sin(angle * Math.PI / 180);
  3325. let temp = startX + distance * Math.sin(angle * Math.PI / 180);
  3326. if (distance >= 0) {
  3327. if (flag > 0) {
  3328. if (temp < this.borderRect.x + this.borderRect.width) {
  3329. return distance;
  3330. }
  3331. }
  3332. else {
  3333. if (temp > this.borderRect.x) {
  3334. return distance;
  3335. }
  3336. }
  3337. }
  3338. }
  3339. judgeLeftRight(distance, angle, starY) {
  3340. let flag = -Math.cos(angle * Math.PI / 180);
  3341. let temp = starY + distance * -Math.cos(angle * Math.PI / 180);
  3342. if (distance >= 0) {
  3343. if (flag > 0) {
  3344. if (temp < this.borderRect.y + this.borderRect.height) {
  3345. return distance;
  3346. }
  3347. }
  3348. else {
  3349. if (temp > this.borderRect.y) {
  3350. return distance;
  3351. }
  3352. }
  3353. }
  3354. }
  3355. clearBallAllEft() {
  3356. let temp;
  3357. for (let index = 0; index < this.ballArr.length; index++) {
  3358. temp = this.ballArr[index];
  3359. temp.clearBallEft();
  3360. }
  3361. }
  3362. showBallRightEft() {
  3363. let gameMgr = xGame.common.gameMgr;
  3364. let temp;
  3365. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3366. if (targetArr.length <= 0)
  3367. return;
  3368. for (let index = 0; index < this.ballArr.length; index++) {
  3369. temp = this.ballArr[index];
  3370. if (targetArr.indexOf(temp.number) > -1) {
  3371. temp.showRightEft();
  3372. }
  3373. }
  3374. }
  3375. showBallWrongEft() {
  3376. let gameMgr = xGame.common.gameMgr;
  3377. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3378. if (targetArr.length <= 0)
  3379. return;
  3380. let temp;
  3381. for (let index = 0; index < this.ballArr.length; index++) {
  3382. temp = this.ballArr[index];
  3383. if (this.targetBall && this.targetBall.number == temp.number) {
  3384. if (targetArr.indexOf(temp.number) <= -1) {
  3385. temp.showWrongEft();
  3386. }
  3387. else {
  3388. temp.clearBallWrongEft();
  3389. }
  3390. }
  3391. else {
  3392. temp.clearBallWrongEft();
  3393. }
  3394. }
  3395. }
  3396. getColliPos(x, y, radius, angle) {
  3397. this.d2HelpLine.ui.x = x;
  3398. this.d2HelpLine.ui.y = y;
  3399. let dirX = x - this.rootBall.gameObj.x;
  3400. let dirY = y - this.rootBall.gameObj.y;
  3401. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3402. if (rectH <= 0)
  3403. rectH = 0;
  3404. this.d2HelpLine.ui.rect.height = 0;
  3405. this.d2HelpLine.ui.rect.height = rectH;
  3406. this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY);
  3407. if (rectH < this.rootBall.gameObj.width) {
  3408. this.d2HelpLine.ui.rect.visible = false;
  3409. }
  3410. else {
  3411. this.d2HelpLine.ui.rect.visible = true;
  3412. }
  3413. this.d2HelpLine.ui.dir.visible = false;
  3414. this.d2HelpLine.ui.rootDir.visible = false;
  3415. }
  3416. getReflectLine(x, y, radius, target) {
  3417. this.d2HelpLine.ui.dir.visible = true;
  3418. let dirX = target.x - x;
  3419. let dirY = target.y - y;
  3420. let angle = xGame.common.getfguiRotation(dirX, dirY) + 180;
  3421. this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX;
  3422. this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY;
  3423. this.d2HelpLine.ui.dir.height = 48;
  3424. this.d2HelpLine.ui.dir.rotation = angle;
  3425. this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180);
  3426. this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180);
  3427. return angle;
  3428. }
  3429. getRootDirLine(angle, rodAngle, xx, yy, target) {
  3430. let rtX = xGame.common.d2World.rootBall.gameObj.x;
  3431. let rtY = xGame.common.d2World.rootBall.gameObj.y;
  3432. let targetX = target.gameObj.x;
  3433. let targetY = target.gameObj.y;
  3434. this.outDir.setValue(targetX - xx, targetY - yy);
  3435. this.rootDir.setValue(rtX - xx, rtY - yy);
  3436. let ver = Math.PI / 2;
  3437. let sin = Math.sin(ver);
  3438. let cos = Math.cos(ver);
  3439. let outX = this.outDir.x * cos - this.outDir.y * sin;
  3440. let outY = this.outDir.x * sin + this.outDir.y * cos;
  3441. this.outDir.setValue(outX, outY);
  3442. Laya.Vector2.normalize(this.rootDir, this.rootDir);
  3443. Laya.Vector2.normalize(this.outDir, this.outDir);
  3444. let result = Laya.Vector2.dot(this.rootDir, this.outDir);
  3445. if (Math.abs(result) <= 0.08) {
  3446. this.d2HelpLine.ui.rootDir.visible = false;
  3447. return;
  3448. }
  3449. if (result > 0) {
  3450. angle += 90;
  3451. }
  3452. else if (result < 0) {
  3453. angle -= 90;
  3454. }
  3455. this.d2HelpLine.ui.rootDir.visible = true;
  3456. this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX;
  3457. this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY;
  3458. this.d2HelpLine.ui.rootDir.rotation = angle;
  3459. }
  3460. delayReflectLine(obj, angle) {
  3461. if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) {
  3462. return;
  3463. }
  3464. this.isOnSameLine = false;
  3465. let startX = obj.gameObj.x;
  3466. let startY = obj.gameObj.y;
  3467. let dis = this.getBorderDot(startX, startY, angle);
  3468. if (dis == null) {
  3469. this.d2HelpLine.ui.dirDot.visible = false;
  3470. return;
  3471. }
  3472. this.d2HelpLine.ui.visible = true;
  3473. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3474. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3475. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, obj);
  3476. if (colliObj == null) {
  3477. this.setDelayLine(disX, disY, obj, angle);
  3478. }
  3479. else {
  3480. let radius = 16;
  3481. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3482. dis1 = Math.sqrt(dis1);
  3483. let realDis = colliObj.disHon - dis1;
  3484. let dir = colliObj.dir;
  3485. let xx = startX + dir.x * realDis;
  3486. let yy = startY + dir.y * realDis;
  3487. this.setDelayLine(xx, yy, obj, angle);
  3488. }
  3489. }
  3490. setDelayLine(x, y, obj, angle) {
  3491. let dirX = x - obj.gameObj.x;
  3492. let dirY = y - obj.gameObj.y;
  3493. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3494. if (rectH <= 0)
  3495. rectH = 0;
  3496. this.d2HelpLine.ui.dir.height = rectH;
  3497. this.d2HelpLine.ui.dirDot.visible = true;
  3498. this.d2HelpLine.ui.dirDot.x = 17;
  3499. this.d2HelpLine.ui.dirDot.y = 17;
  3500. this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180);
  3501. ;
  3502. this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180);
  3503. }
  3504. changePlayerView() {
  3505. if (Math.random() >= 0.7)
  3506. return;
  3507. if (!this.targetBall) {
  3508. return;
  3509. }
  3510. if (!xGame.common.gameMgr.selfTurn)
  3511. return;
  3512. switch (xGame.common.gameMode) {
  3513. case GameMode.classic:
  3514. if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) {
  3515. if (this.targetBall.number != 8) {
  3516. return;
  3517. }
  3518. }
  3519. break;
  3520. case GameMode.bigMove:
  3521. return;
  3522. case GameMode.placeBall:
  3523. break;
  3524. default:
  3525. break;
  3526. }
  3527. let startX = this.targetBall.gameObj.x;
  3528. let startY = this.targetBall.gameObj.y;
  3529. let angle = this.reflectAngle;
  3530. let dis = this.getBorderDot(startX, startY, angle);
  3531. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3532. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3533. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall);
  3534. if (colliObj) {
  3535. return;
  3536. }
  3537. let offset = 40;
  3538. let posObj = xGame.common.gameMgr.posObj;
  3539. let temp;
  3540. let radius;
  3541. let tarX, tarY;
  3542. for (const key in posObj) {
  3543. temp = posObj[key];
  3544. radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5);
  3545. tarX = startX + radius * Math.sin(angle * Math.PI / 180);
  3546. tarY = startY + radius * -Math.cos(angle * Math.PI / 180);
  3547. if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) {
  3548. xGame.common.showOneCamera("angle" + key);
  3549. xGame.common.gameUI.ui.d2Node.alpha = 0;
  3550. Laya.physicsTimer.scale = 0.7;
  3551. break;
  3552. }
  3553. }
  3554. }
  3555. selectBestEnterOne(arr) {
  3556. this.aiLv = xGame.tools.random(1, 11);
  3557. this.aiLv = 10;
  3558. this.wBall = xGame.common.d2World.rootBall;
  3559. this.rootPos.x = this.wBall.gameObj.x;
  3560. this.rootPos.y = this.wBall.gameObj.y;
  3561. this.initHoleBall(arr);
  3562. return this.selectBall();
  3563. }
  3564. selectBall() {
  3565. let ball = null;
  3566. this.destRot = 0;
  3567. let ai = 110 - this.aiLv * 10;
  3568. let mis = xGame.tools.random(-ai, ai) * 0.005;
  3569. let score = false;
  3570. if (this.scoreBall.length < 1) {
  3571. if (this.lineBall.length < 1) {
  3572. for (let i = 0; i < this.kickBall.length; i++) {
  3573. let list = [];
  3574. let bo = this.kickBall[i];
  3575. let bobj = bo.gameObj;
  3576. let rect = xGame.common.d2World.borderRect;
  3577. let mobj = this.wBall.gameObj;
  3578. let minb = bobj.y - rect.y - 20;
  3579. let minw = mobj.y - rect.y - 50;
  3580. if (minb > 0 && minw > 0) {
  3581. let dlenx = 0;
  3582. let dleny = mobj.y - rect.y;
  3583. let spx = mobj.x;
  3584. let spy = rect.y - dleny;
  3585. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3586. }
  3587. minb = rect.y + rect.height - bobj.y - 20;
  3588. minw = rect.y + rect.height - mobj.y - 50;
  3589. if (minb > 0 && minw > 0) {
  3590. let dlenx = 0;
  3591. let dleny = rect.y + rect.height - mobj.y;
  3592. let spx = mobj.x;
  3593. let spy = rect.y + rect.height + dleny;
  3594. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3595. }
  3596. minb = bobj.x - rect.x - 20;
  3597. minw = mobj.x - rect.x - 50;
  3598. if (minb > 0 && minw > 0) {
  3599. let dlenx = mobj.x - rect.x;
  3600. let dleny = 0;
  3601. let spx = rect.x - dlenx;
  3602. let spy = mobj.y;
  3603. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3604. }
  3605. minb = rect.x + rect.width - bobj.x - 20;
  3606. minw = rect.x + rect.width - mobj.x - 50;
  3607. if (minb > 0 && minw > 0) {
  3608. let dlenx = rect.x + rect.width - mobj.x;
  3609. let dleny = 0;
  3610. let spx = rect.x + rect.width + dlenx;
  3611. let spy = mobj.y;
  3612. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3613. }
  3614. list.sort(function (a, b) {
  3615. return a.order - b.order;
  3616. });
  3617. for (let i = 0; i < list.length; i++) {
  3618. let data = list[i];
  3619. let mx = mobj.x - bobj.x;
  3620. let my = mobj.y - bobj.y;
  3621. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  3622. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  3623. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3624. if (num > 1)
  3625. num = 1;
  3626. let cos = Math.acos(num);
  3627. if (cos > 1.57)
  3628. cos = 1.57;
  3629. else if (cos < 0.01)
  3630. cos = 0.01;
  3631. let tan = Math.tan(cos);
  3632. let dx = tan * data.dleny;
  3633. let dy = tan * data.dlenx;
  3634. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  3635. if (Math.abs(bx - 667) < 40)
  3636. continue;
  3637. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  3638. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  3639. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  3640. this.forceMax = dis * 0.08;
  3641. this.destRot += mis * 0.1;
  3642. this.setKick(bx, by);
  3643. return true;
  3644. }
  3645. }
  3646. }
  3647. }
  3648. else {
  3649. ball = xGame.common.getRandArrEle(this.lineBall);
  3650. }
  3651. }
  3652. else {
  3653. for (let i = 0; i < this.scoreBall.length; i++) {
  3654. if (i < this.scoreBall.length - 1) {
  3655. let rand = 70 + this.aiLv * 10 + i * 10;
  3656. if (xGame.tools.random(0, 100) < rand) {
  3657. ball = this.scoreBall[i];
  3658. break;
  3659. }
  3660. }
  3661. else {
  3662. ball = this.scoreBall[i];
  3663. break;
  3664. }
  3665. }
  3666. score = true;
  3667. this.selectNum++;
  3668. }
  3669. if (!ball)
  3670. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  3671. let dx = ball.gameObj.x;
  3672. let dy = ball.gameObj.y;
  3673. let kickAngle = 0;
  3674. if (score) {
  3675. dx = ball.kickPos.x;
  3676. dy = ball.kickPos.y;
  3677. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  3678. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  3679. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  3680. if (adot > 1)
  3681. adot = 1;
  3682. kickAngle = Math.acos(adot) * 57.3;
  3683. if (kickAngle > 45) {
  3684. let kdx = ball.kickPos.x - ball.gameObj.x;
  3685. let kdy = ball.kickPos.y - ball.gameObj.y;
  3686. dx = ball.kickPos.x - kdx * mis * 0.3;
  3687. dy = ball.kickPos.y - kdy * mis * 0.3;
  3688. }
  3689. else
  3690. this.destRot += mis;
  3691. }
  3692. else if (ball.poleAngle != 0) {
  3693. this.destRot += ball.poleAngle;
  3694. }
  3695. if (xGame.common.gameMode == 0) {
  3696. let af = kickAngle * 0.08;
  3697. this.forceMax = ball.hard * 0.1 + af * af;
  3698. }
  3699. this.setKick(dx, dy);
  3700. return ball;
  3701. }
  3702. initHoleBall(arr) {
  3703. this.kickBall = [];
  3704. this.lineBall = [];
  3705. this.scoreBall = [];
  3706. this.holeBall = [];
  3707. this.selectNum = 0;
  3708. this.forceNum = 0;
  3709. this.forceMax = 0;
  3710. this.turnNum = 0;
  3711. let list = arr;
  3712. let holes = xGame.common.gameMgr.holePosList;
  3713. let self = xGame.common.aiPlayer;
  3714. for (let i = 0; i < list.length; i++) {
  3715. let obj = list[i];
  3716. if (!obj)
  3717. continue;
  3718. obj.kickPos.x = 0;
  3719. obj.kickPos.y = 0;
  3720. obj.poleAngle = 0;
  3721. obj.hard = 0;
  3722. obj.borderDis = 0;
  3723. obj.kickAngle = 180;
  3724. let b = obj.gameObj;
  3725. let wbp = this.rootPos;
  3726. let bx = wbp.x - b.x;
  3727. let by = wbp.y - b.y;
  3728. obj.borderDis = xGame.tools.random(0, 100);
  3729. this.kickBall.push(obj);
  3730. if (!this.isLine(wbp, obj))
  3731. continue;
  3732. obj.kickAngle = xGame.tools.random(90, 180);
  3733. obj.kickPos.x = b.x;
  3734. obj.kickPos.y = b.y;
  3735. this.lineBall.push(obj);
  3736. let minDis = 999999;
  3737. let hole = false;
  3738. for (let j = 0; j < holes.length; j++) {
  3739. let hp = holes[j];
  3740. if (bx >= 0 && hp.x > b.x + 100)
  3741. continue;
  3742. if (bx <= 0 && hp.x < b.x - 100)
  3743. continue;
  3744. if (by < -10 && hp.y < wbp.y)
  3745. continue;
  3746. if (by > 10 && hp.y > wbp.y)
  3747. continue;
  3748. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  3749. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  3750. if (dis < minDis) {
  3751. let dx = b.x - this.tempDir1.x * this.ballSize;
  3752. let dy = b.y - this.tempDir1.y * this.ballSize;
  3753. this.tempDir3.x = this.tempDir1.x;
  3754. this.tempDir3.y = this.tempDir1.y;
  3755. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  3756. obj.kickPos.x = dx;
  3757. obj.kickPos.y = dy;
  3758. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  3759. if (num > 1)
  3760. num = 1;
  3761. obj.kickAngle = Math.acos(num) * 57.3;
  3762. if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2)
  3763. dis = dis * 2;
  3764. if (Math.abs(hp.x - 600) < 100)
  3765. dis += 50;
  3766. obj.hard = dis + obj.kickAngle * 3;
  3767. hole = true;
  3768. }
  3769. }
  3770. }
  3771. }
  3772. if (hole) {
  3773. this.scoreBall.push(obj);
  3774. this.holeBall.push(obj);
  3775. }
  3776. }
  3777. this.scoreBall.sort(function (a, b) {
  3778. return a.hard - b.hard;
  3779. });
  3780. this.holeBall.sort(function (a, b) {
  3781. return a.kickAngle - b.kickAngle;
  3782. });
  3783. this.kickBall.sort(function (a, b) {
  3784. return a.borderDis - b.borderDis;
  3785. });
  3786. }
  3787. isBlock(bn, bx, by, hx, hy, dn = -1) {
  3788. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  3789. let balls = xGame.common.d2World.ballArr;
  3790. let max = xGame.tools.getDis(hx, hy, bx, by);
  3791. for (let index = 0; index < balls.length; index++) {
  3792. let obj = balls[index];
  3793. if (obj.number == 0)
  3794. continue;
  3795. if (obj.number == bn || obj.number == dn)
  3796. continue;
  3797. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  3798. if (dis * dis > max)
  3799. continue;
  3800. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  3801. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3802. if (num > 1)
  3803. num = 1;
  3804. if (num < 0)
  3805. continue;
  3806. let gap = Math.sin(Math.acos(num)) * dis;
  3807. if (gap < this.ballSize)
  3808. return true;
  3809. }
  3810. return false;
  3811. }
  3812. isLine(xy, ball) {
  3813. let bx = xy.x;
  3814. let by = xy.y;
  3815. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  3816. let dis = ball.getDestDis(xy);
  3817. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  3818. let sin = Math.sin(angle);
  3819. let cos = Math.cos(angle);
  3820. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  3821. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  3822. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  3823. let dx = bx + this.tempDir2.x * dis;
  3824. let dy = by + this.tempDir2.y * dis;
  3825. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  3826. sin = Math.sin(-angle);
  3827. cos = Math.cos(-angle);
  3828. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  3829. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  3830. dx = bx + this.tempDir2.x * dis;
  3831. dy = by + this.tempDir2.y * dis;
  3832. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  3833. if (isr && isl)
  3834. return false;
  3835. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  3836. }
  3837. return true;
  3838. }
  3839. setKick(dx, dy) {
  3840. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  3841. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  3842. this.tempDir1.x = 0;
  3843. this.tempDir1.y = 1;
  3844. this.tempDir2.y = -this.tempDir2.y;
  3845. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3846. if (num > 1)
  3847. num = 1;
  3848. let rot = Math.acos(num) * 57.3;
  3849. if (this.tempDir2.x < 0)
  3850. rot = 360 - rot;
  3851. this.destRot += rot;
  3852. }
  3853. }
  3854. class ui_UIGame extends fgui.GComponent {
  3855. static createInstance() {
  3856. return (fgui.UIPackage.createObject("game", "UIGame"));
  3857. }
  3858. onConstruct() {
  3859. this.c1 = this.getController("c1");
  3860. this.d3Root = (this.getChild("d3Root"));
  3861. this.clickNode = (this.getChild("clickNode"));
  3862. this.d2Root = (this.getChild("d2Root"));
  3863. this.topNode = (this.getChild("topNode"));
  3864. this.n72 = (this.getChild("n72"));
  3865. this.n40 = (this.getChild("n40"));
  3866. this.rulerNode = (this.getChild("rulerNode"));
  3867. this.rulerClickNode = (this.getChild("rulerClickNode"));
  3868. this.n50 = (this.getChild("n50"));
  3869. this.keduNode = (this.getChild("keduNode"));
  3870. this.powerTxt = (this.getChild("powerTxt"));
  3871. this.powerNode = (this.getChild("powerNode"));
  3872. this.colorNode = (this.getChild("colorNode"));
  3873. this.powerEft = (this.getChild("powerEft"));
  3874. this.myPowerNode = (this.getChild("myPowerNode"));
  3875. this.ganNode = (this.getChild("ganNode"));
  3876. this.rodMethodNode = (this.getChild("rodMethodNode"));
  3877. this.placeChallengeNode = (this.getChild("placeChallengeNode"));
  3878. this.placeNormalNode = (this.getChild("placeNormalNode"));
  3879. this.skillRod = (this.getChild("skillRod"));
  3880. this.border = (this.getChild("border"));
  3881. this.bigSkillNode = (this.getChild("bigSkillNode"));
  3882. this.classicWorldsNode = (this.getChild("classicWorldsNode"));
  3883. this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode"));
  3884. this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode"));
  3885. this.awardSpineNode = (this.getChild("awardSpineNode"));
  3886. this.guanyuNode = (this.getChild("guanyuNode"));
  3887. this.helpBtn = (this.getChild("helpBtn"));
  3888. this.wordsBtn = (this.getChild("wordsBtn"));
  3889. this.aiWordsBtn = (this.getChild("aiWordsBtn"));
  3890. this.returnBtn = (this.getChild("returnBtn"));
  3891. this.ballNode = (this.getChild("ballNode"));
  3892. this.whiteAni = (this.getChild("whiteAni"));
  3893. this.blackAni = (this.getChild("blackAni"));
  3894. this.selfTurn = (this.getChild("selfTurn"));
  3895. this.aiTurn = (this.getChild("aiTurn"));
  3896. this.deskNode = (this.getChild("deskNode"));
  3897. this.moveNode = (this.getChild("moveNode"));
  3898. this.selfTalk = (this.getChild("selfTalk"));
  3899. this.aiTalk = (this.getChild("aiTalk"));
  3900. this.d2Node = (this.getChild("d2Node"));
  3901. this.snowNode = (this.getChild("snowNode"));
  3902. this.guide2 = (this.getChild("guide2"));
  3903. this.guide1 = (this.getChild("guide1"));
  3904. this.guide3 = (this.getChild("guide3"));
  3905. this.guideNode = (this.getChild("guideNode"));
  3906. }
  3907. }
  3908. ui_UIGame.URL = "ui://isxx5ak7kt443qg";
  3909. class ui_UIGameEnd extends fgui.GComponent {
  3910. static createInstance() {
  3911. return (fgui.UIPackage.createObject("game", "UIGameEnd"));
  3912. }
  3913. onConstruct() {
  3914. this.c1 = this.getController("c1");
  3915. this.n22 = (this.getChild("n22"));
  3916. this.n2 = (this.getChild("n2"));
  3917. this.n52 = (this.getChild("n52"));
  3918. this.n53 = (this.getChild("n53"));
  3919. this.coinNode = (this.getChild("coinNode"));
  3920. this.closeNode = (this.getChild("closeNode"));
  3921. this.moneyNode = (this.getChild("moneyNode"));
  3922. this.secretary = (this.getChild("secretary"));
  3923. this.n27 = (this.getChild("n27"));
  3924. this.n29 = (this.getChild("n29"));
  3925. this.talkNode = (this.getChild("talkNode"));
  3926. this.n38 = (this.getChild("n38"));
  3927. this.n39 = (this.getChild("n39"));
  3928. this.n40 = (this.getChild("n40"));
  3929. this.starNumNode = (this.getChild("starNumNode"));
  3930. this.awardNode = (this.getChild("awardNode"));
  3931. this.n47 = (this.getChild("n47"));
  3932. this.conditionNode = (this.getChild("conditionNode"));
  3933. this.isGetAward = (this.getChild("isGetAward"));
  3934. this.leftBtn = (this.getChild("leftBtn"));
  3935. this.rightBtn = (this.getChild("rightBtn"));
  3936. this.btnNode = (this.getChild("btnNode"));
  3937. }
  3938. }
  3939. ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3";
  3940. class ui_UIAddCoin extends fgui.GComponent {
  3941. static createInstance() {
  3942. return (fgui.UIPackage.createObject("game", "UIAddCoin"));
  3943. }
  3944. onConstruct() {
  3945. this.n11 = (this.getChild("n11"));
  3946. this.myNode = (this.getChild("myNode"));
  3947. this.t0 = this.getTransition("t0");
  3948. }
  3949. }
  3950. ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs";
  3951. class UIAddCoin extends UIBase {
  3952. constructor() {
  3953. super();
  3954. this.coinNum = 2000;
  3955. }
  3956. onConstructor() {
  3957. this.ui = ui_UIAddCoin.createInstance();
  3958. this.contentPane = this.ui;
  3959. this.isEject = false;
  3960. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  3961. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  3962. }
  3963. show() {
  3964. super.show();
  3965. this.ui.t0.play();
  3966. }
  3967. videoAddCoin() {
  3968. Moyu.showVideoAd(() => {
  3969. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  3970. this.hide();
  3971. }, EAdType.addFailCoin);
  3972. }
  3973. }
  3974. UIAddCoin.uiName = "UIAddCoin";
  3975. class ui_UIInvitation extends fgui.GComponent {
  3976. static createInstance() {
  3977. return (fgui.UIPackage.createObject("game", "UIInvitation"));
  3978. }
  3979. onConstruct() {
  3980. this.n14 = (this.getChild("n14"));
  3981. this.myNode = (this.getChild("myNode"));
  3982. this.t0 = this.getTransition("t0");
  3983. }
  3984. }
  3985. ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r";
  3986. class UIInvitation extends UIBase {
  3987. constructor() {
  3988. super();
  3989. }
  3990. onConstructor() {
  3991. this.ui = ui_UIInvitation.createInstance();
  3992. this.contentPane = this.ui;
  3993. this.isEject = false;
  3994. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  3995. }
  3996. show() {
  3997. super.show();
  3998. }
  3999. enterGame() {
  4000. xGame.common.gameMode = GameMode.classic;
  4001. DataMgr.setChallengeTimes(1);
  4002. xGame.common.passAwardCoin = 2000;
  4003. let need = xGame.common.classicNiceNeddCoin;
  4004. if (DataMgr.coinEnough(need)) {
  4005. DataMgr.setCoin(-need);
  4006. xGame.eventMgr.event(RESTART_GAME, true);
  4007. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  4008. }
  4009. else {
  4010. xGame.eventMgr.event(RESTART_GAME, true);
  4011. }
  4012. this.hide();
  4013. }
  4014. hide() {
  4015. super.hide();
  4016. }
  4017. }
  4018. UIInvitation.uiName = "UIInvitation";
  4019. class ui_UIMain extends fgui.GComponent {
  4020. static createInstance() {
  4021. return (fgui.UIPackage.createObject("game", "UIMain"));
  4022. }
  4023. onConstruct() {
  4024. this.n47 = (this.getChild("n47"));
  4025. this.n10 = (this.getChild("n10"));
  4026. this.secretary = (this.getChild("secretary"));
  4027. this.n33 = (this.getChild("n33"));
  4028. this.shopBtn = (this.getChild("shopBtn"));
  4029. this.moneyNode = (this.getChild("moneyNode"));
  4030. this.headNode = (this.getChild("headNode"));
  4031. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4032. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4033. this.classicBtn = (this.getChild("classicBtn"));
  4034. this.weeklyBtn = (this.getChild("weeklyBtn"));
  4035. this.globalBtn = (this.getChild("globalBtn"));
  4036. this.n20 = (this.getChild("n20"));
  4037. this.n21 = (this.getChild("n21"));
  4038. this.n22 = (this.getChild("n22"));
  4039. this.n31 = (this.getChild("n31"));
  4040. this.n32 = (this.getChild("n32"));
  4041. this.n64 = (this.getChild("n64"));
  4042. this.n66 = (this.getChild("n66"));
  4043. this.n44 = (this.getChild("n44"));
  4044. this.signBtn = (this.getChild("signBtn"));
  4045. this.drawBtn = (this.getChild("drawBtn"));
  4046. this.settingNode = (this.getChild("settingNode"));
  4047. this.n45 = (this.getChild("n45"));
  4048. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4049. this.n85 = (this.getChild("n85"));
  4050. this.rankBtn = (this.getChild("rankBtn"));
  4051. this.n46 = (this.getChild("n46"));
  4052. this.liucheng1 = (this.getChild("liucheng1"));
  4053. this.rightBtn = (this.getChild("rightBtn"));
  4054. this.n75 = (this.getChild("n75"));
  4055. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4056. this.liucheng2 = (this.getChild("liucheng2"));
  4057. this.guideBtn = (this.getChild("guideBtn"));
  4058. this.n73 = (this.getChild("n73"));
  4059. this.wordsNode = (this.getChild("wordsNode"));
  4060. this.enterGuide = (this.getChild("enterGuide"));
  4061. this.talkNode = (this.getChild("talkNode"));
  4062. this.n83 = (this.getChild("n83"));
  4063. this.n84 = (this.getChild("n84"));
  4064. }
  4065. }
  4066. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4067. class ui_UIMoyu extends fgui.GComponent {
  4068. static createInstance() {
  4069. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4070. }
  4071. onConstruct() {
  4072. this.ageTip = (this.getChild("ageTip"));
  4073. this.mainBg = (this.getChild("mainBg"));
  4074. this.xyNode = (this.getChild("xyNode"));
  4075. this.rnNode = (this.getChild("rnNode"));
  4076. this.fcmNode = (this.getChild("fcmNode"));
  4077. this.ageNode = (this.getChild("ageNode"));
  4078. this.tipNode = (this.getChild("tipNode"));
  4079. this.msgNode = (this.getChild("msgNode"));
  4080. }
  4081. }
  4082. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4083. class MoyuMgr {
  4084. static initMoyu() {
  4085. this.moyuView = new MoyuView();
  4086. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4087. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4088. this.moyuView.ui.displayObject.zOrder = 1000;
  4089. this.moyuView.init();
  4090. this.moyuView.showTip(true);
  4091. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4092. window['XApk'] = this;
  4093. }
  4094. static showAge(show) {
  4095. if (this.moyuView)
  4096. this.moyuView.showAge(show);
  4097. }
  4098. static onPlatMsg(idx) {
  4099. if (!MoyuMgr.moyuView)
  4100. return;
  4101. if (idx == '0') {
  4102. MoyuMgr.moyuView.showTip(false);
  4103. }
  4104. }
  4105. static showAgree(call) {
  4106. if (this.moyuView)
  4107. this.moyuView.showAgree(call);
  4108. else
  4109. call && call();
  4110. }
  4111. static showXy(type = 1) {
  4112. if (this.moyuView)
  4113. this.moyuView.showXy(type);
  4114. }
  4115. }
  4116. MoyuMgr.isAdvise = false;
  4117. class MoyuView {
  4118. constructor() {
  4119. this.ysxyNum = 1;
  4120. this.ysJson = null;
  4121. this.ui = ui_UIMoyu.createInstance();
  4122. }
  4123. init() {
  4124. this.ui.mainBg.visible = false;
  4125. this.ui.xyNode.visible = false;
  4126. this.ui.ageNode.visible = false;
  4127. this.ui.tipNode.visible = false;
  4128. this.ui.rnNode.visible = false;
  4129. this.ui.fcmNode.visible = false;
  4130. this.ui.ageTip.visible = false;
  4131. this.ui.msgNode.visible = false;
  4132. this.ui.visible = false;
  4133. this.ui.xyNode.xyList.setVirtual();
  4134. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4135. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4136. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4137. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4138. this.ui.xyNode.btnKnown.visible = false;
  4139. this.ui.xyNode.xy1.visible = false;
  4140. this.ui.xyNode.xy2.visible = false;
  4141. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4142. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4143. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4144. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4145. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4146. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4147. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4148. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4149. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4150. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4151. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4152. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4153. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4154. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4155. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4156. this.ysxyNum = 2;
  4157. }
  4158. }
  4159. onClick(obj) {
  4160. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4161. switch (obj) {
  4162. case this.ui.ageTip:
  4163. if (Moyu.isTTApk) {
  4164. this.ui.ageNode.visible = true;
  4165. this.ui.mainBg.visible = true;
  4166. }
  4167. break;
  4168. case this.ui.tipNode:
  4169. this.showTip(false);
  4170. break;
  4171. case this.ui.ageNode.btnAge:
  4172. this.ui.ageNode.visible = false;
  4173. this.ui.mainBg.visible = false;
  4174. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4175. this.ui.visible = false;
  4176. break;
  4177. case this.ui.xyNode.btnXy3:
  4178. case this.ui.xyNode.btnXy1:
  4179. this.loadXy(1);
  4180. break;
  4181. case this.ui.xyNode.btnXy2:
  4182. this.loadXy(2);
  4183. break;
  4184. case this.ui.xyNode.btnBack:
  4185. this.ui.xyNode.xy1.visible = true;
  4186. this.ui.xyNode.xy2.visible = false;
  4187. break;
  4188. case this.ui.xyNode.btnKnown:
  4189. this.ui.xyNode.visible = false;
  4190. this.ui.mainBg.visible = false;
  4191. this.ui.visible = false;
  4192. break;
  4193. case this.ui.rnNode.btnCheck:
  4194. this.check();
  4195. break;
  4196. case this.ui.rnNode.btnExit:
  4197. case this.ui.xyNode.btnNo:
  4198. this.ysxyNum--;
  4199. if (this.ysxyNum > 0)
  4200. this.showMsg("再次拒绝退出游戏");
  4201. else {
  4202. Moyu.userAgree(false);
  4203. Moyu.exit();
  4204. }
  4205. break;
  4206. case this.ui.xyNode.btnSure:
  4207. case this.ui.xyNode.btnYes:
  4208. DataMgr.userData.isAgree = true;
  4209. DataMgr.saveUserData();
  4210. this.onAgree();
  4211. break;
  4212. case this.ui.rnNode.btnDone:
  4213. this.ui.rnNode.visible = false;
  4214. this.ui.visible = false;
  4215. break;
  4216. case this.ui.fcmNode.btnRn:
  4217. this.showRn();
  4218. break;
  4219. }
  4220. }
  4221. showTip(show) {
  4222. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4223. return;
  4224. if (show) {
  4225. MoyuMgr.isAdvise = true;
  4226. this.ui.visible = true;
  4227. this.ui.tipNode.visible = true;
  4228. this.ui.tipNode.alpha = 1;
  4229. Laya.timer.once(1000, this, this.showTip, [false]);
  4230. }
  4231. else {
  4232. this.ui.tipNode.alpha = 1;
  4233. this.ui.tipNode.visible = true;
  4234. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4235. this.ui.tipNode.visible = false;
  4236. MoyuMgr.isAdvise = false;
  4237. }), 1000);
  4238. }
  4239. }
  4240. showAge(show, px = 0, py = 0) {
  4241. if (Moyu.platType > 10 && !Moyu.isIos) {
  4242. this.ui.ageTip.x = px;
  4243. this.ui.ageTip.y = py;
  4244. this.ui.ageTip.visible = show;
  4245. if (show)
  4246. this.ui.visible = true;
  4247. }
  4248. }
  4249. showAgree(call) {
  4250. this.agreeCall = call;
  4251. this.onAgree();
  4252. return;
  4253. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4254. this.showXy(0);
  4255. }
  4256. else
  4257. this.onAgree();
  4258. }
  4259. onAgree() {
  4260. if (!this.ui.ageNode.visible)
  4261. this.ui.visible = false;
  4262. this.ui.xyNode.visible = false;
  4263. Moyu.userAgree(true);
  4264. this.showAge(false);
  4265. this.agreeCall && this.agreeCall();
  4266. this.showRn();
  4267. }
  4268. showMsg(txt) {
  4269. this.ui.msgNode.txtMsg.text = txt;
  4270. this.ui.msgNode.visible = true;
  4271. this.ui.msgNode.alpha = 1;
  4272. this.ui.visible = true;
  4273. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4274. this.ui.msgNode.visible = false;
  4275. }), 2500, true);
  4276. }
  4277. showRn() {
  4278. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4279. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4280. this.ui.rnNode.rn1.visible = true;
  4281. this.ui.rnNode.rn2.visible = false;
  4282. this.ui.rnNode.rn3.visible = false;
  4283. this.ui.rnNode.rn4.visible = false;
  4284. this.ui.rnNode.visible = true;
  4285. this.ui.mainBg.visible = true;
  4286. this.ui.rnNode.btnDone.visible = false;
  4287. this.ui.rnNode.btnExit.visible = true;
  4288. this.ui.rnNode.btnCheck.visible = true;
  4289. this.ui.fcmNode.visible = false;
  4290. this.ui.visible = true;
  4291. return;
  4292. }
  4293. }
  4294. this.showFcm();
  4295. }
  4296. showFcm() {
  4297. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4298. Moyu.initFCM(true);
  4299. if (Moyu.gameTime < 1)
  4300. this.fcmLoop();
  4301. else if (Moyu.gameTime < 999)
  4302. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4303. }
  4304. }
  4305. fcmLoop() {
  4306. if (Moyu.gameTime < 1) {
  4307. this.ui.rnNode.visible = false;
  4308. this.ui.fcmNode.visible = true;
  4309. this.ui.mainBg.visible = true;
  4310. this.ui.visible = true;
  4311. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4312. Laya.timer.clear(this.ui, this.fcmLoop);
  4313. }
  4314. }
  4315. check() {
  4316. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4317. this.ui.rnNode.rn1.visible = false;
  4318. this.ui.rnNode.rn2.visible = false;
  4319. this.ui.rnNode.rn4.visible = true;
  4320. }
  4321. else if (this.ui.rnNode.rn4.visible) {
  4322. let name = this.ui.rnNode.inputName.text;
  4323. let code = this.ui.rnNode.inputCode.text;
  4324. if (code && code.length == 18) {
  4325. this.ui.rnNode.rn1.visible = false;
  4326. this.ui.rnNode.rn4.visible = false;
  4327. Moyu.authenticate(name, code, (res) => {
  4328. this.ui.rnNode.rn2.visible = !res;
  4329. this.ui.rnNode.rn3.visible = res;
  4330. this.ui.rnNode.btnDone.visible = res;
  4331. this.ui.rnNode.btnExit.visible = !res;
  4332. this.ui.rnNode.btnCheck.visible = !res;
  4333. if (res)
  4334. this.showFcm();
  4335. });
  4336. }
  4337. else
  4338. this.showMsg("信息填写不完整");
  4339. }
  4340. }
  4341. loadXy(type = 0) {
  4342. this.ui.xyNode.xy1.visible = false;
  4343. this.ui.xyNode.xy2.visible = true;
  4344. this.ui.xyNode.xyList.scrollToView(0);
  4345. if (type == 1) {
  4346. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4347. }
  4348. else if (type == 2) {
  4349. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4350. }
  4351. }
  4352. showXy(type = 0) {
  4353. this.xyBtn();
  4354. if (type == 0) {
  4355. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4356. this.ui.xyNode.btnSure.visible = true;
  4357. }
  4358. else {
  4359. this.ui.xyNode.btnYes.visible = true;
  4360. this.ui.xyNode.btnNo.visible = true;
  4361. }
  4362. }
  4363. else {
  4364. this.ui.xyNode.btnKnown.visible = true;
  4365. this.ui.mainBg.visible = true;
  4366. }
  4367. this.ui.xyNode.xy1.visible = true;
  4368. this.ui.xyNode.xy2.visible = false;
  4369. this.ui.xyNode.visible = true;
  4370. this.ui.visible = true;
  4371. }
  4372. xyBtn() {
  4373. this.ui.xyNode.btnSure.visible = false;
  4374. this.ui.xyNode.btnYes.visible = false;
  4375. this.ui.xyNode.btnNo.visible = false;
  4376. this.ui.xyNode.btnKnown.visible = false;
  4377. {
  4378. this.ui.xyNode.btnXy3.visible = false;
  4379. this.ui.xyNode.btnXy2.visible = true;
  4380. this.ui.xyNode.btnXy1.visible = true;
  4381. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4382. }
  4383. }
  4384. createXY(json) {
  4385. this.ysJson = json.content;
  4386. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4387. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4388. this.ui.xyNode.xy2.visible = true;
  4389. }
  4390. renderListItem(idx, cell) {
  4391. let xy = this.ysJson[idx];
  4392. cell.height = xy.line * 30;
  4393. cell.xyItem.text = xy.text;
  4394. }
  4395. onDestroy() {
  4396. this.agreeCall = null;
  4397. }
  4398. }
  4399. class SettingNode {
  4400. constructor(ui) {
  4401. this.showSetting = false;
  4402. this.openSound = true;
  4403. this.openShake = true;
  4404. this.ui = ui;
  4405. this.ui.soundBtn.onClick(this, this.switchSound);
  4406. this.ui.shakeBtn.onClick(this, this.switchShake);
  4407. this.ui.xyBtn.onClick(this, this.onXy);
  4408. this.ui.clickNode.onClick(this, this.changeSetting);
  4409. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4410. }
  4411. changeSetting() {
  4412. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4413. this.showSetting = !this.showSetting;
  4414. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4415. }
  4416. switchSound() {
  4417. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4418. this.openSound = !this.openSound;
  4419. Moyu.onSetting(this.openSound, this.openShake);
  4420. xGame.soundMgr.onSetting(this.openSound);
  4421. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4422. }
  4423. switchShake() {
  4424. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4425. this.openShake = !this.openShake;
  4426. Moyu.onSetting(this.openSound, this.openShake);
  4427. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4428. }
  4429. onXy() {
  4430. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4431. MoyuMgr.showXy(1);
  4432. }
  4433. }
  4434. class ui_UILevelDisplay extends fgui.GComponent {
  4435. static createInstance() {
  4436. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4437. }
  4438. onConstruct() {
  4439. this.n9 = (this.getChild("n9"));
  4440. this.myNode = (this.getChild("myNode"));
  4441. this.closeNode = (this.getChild("closeNode"));
  4442. }
  4443. }
  4444. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4445. class ui_UILevelProp extends fgui.GComponent {
  4446. static createInstance() {
  4447. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4448. }
  4449. onConstruct() {
  4450. this.n16 = (this.getChild("n16"));
  4451. this.myNode = (this.getChild("myNode"));
  4452. this.closeBtn = (this.getChild("closeBtn"));
  4453. this.moneyNode = (this.getChild("moneyNode"));
  4454. this.t1 = this.getTransition("t1");
  4455. }
  4456. }
  4457. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  4458. class ui_ShowItem extends fgui.GComponent {
  4459. static createInstance() {
  4460. return (fgui.UIPackage.createObject("game", "ShowItem"));
  4461. }
  4462. onConstruct() {
  4463. this.myImg = (this.getChild("myImg"));
  4464. }
  4465. }
  4466. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  4467. class ShowItem {
  4468. constructor() {
  4469. this.ui = ui_ShowItem.createInstance();
  4470. }
  4471. destroySelf() {
  4472. if (!this.ui.isDisposed) {
  4473. this.ui.removeFromParent();
  4474. this.ui.dispose();
  4475. }
  4476. }
  4477. setParent(parent) {
  4478. parent.addChild(this.ui);
  4479. }
  4480. setPos(x, y) {
  4481. this.ui.x = x;
  4482. this.ui.y = y;
  4483. }
  4484. setUrl(index) {
  4485. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  4486. }
  4487. }
  4488. class ui_UIPower extends fgui.GComponent {
  4489. static createInstance() {
  4490. return (fgui.UIPackage.createObject("game", "UIPower"));
  4491. }
  4492. onConstruct() {
  4493. this.n11 = (this.getChild("n11"));
  4494. this.myNode = (this.getChild("myNode"));
  4495. this.t0 = this.getTransition("t0");
  4496. }
  4497. }
  4498. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  4499. class UIPower extends UIBase {
  4500. constructor() {
  4501. super();
  4502. }
  4503. onConstructor() {
  4504. this.ui = ui_UIPower.createInstance();
  4505. this.contentPane = this.ui;
  4506. this.isEject = false;
  4507. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4508. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  4509. }
  4510. show() {
  4511. super.show();
  4512. this.ui.t0.play();
  4513. }
  4514. videoGetPower() {
  4515. Moyu.showVideoAd(() => {
  4516. DataMgr.setPower(xGame.common.videoPower, true);
  4517. xGame.eventMgr.event(POWER_TIME);
  4518. this.hide();
  4519. }, EAdType.getPower);
  4520. }
  4521. }
  4522. UIPower.uiName = "UIPower";
  4523. class UILevelProp extends UIBase {
  4524. constructor() {
  4525. super();
  4526. this.firstPos = 385;
  4527. this.secondPos = 467;
  4528. this.showItemArr = [];
  4529. }
  4530. onConstructor() {
  4531. this.ui = ui_UILevelProp.createInstance();
  4532. this.contentPane = this.ui;
  4533. this.isEject = false;
  4534. this.addUIClick(this.ui.closeBtn, this.hide);
  4535. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  4536. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  4537. }
  4538. show(level) {
  4539. super.show();
  4540. this.ui.t1.play();
  4541. this.level = level;
  4542. this.data = cfgTable.placeballData[this.level];
  4543. this.updateSelf();
  4544. this.showPreView();
  4545. this.moneyNode.ui.c1.selectedIndex = 2;
  4546. this.moneyNode.checkPowerTime();
  4547. this.moneyNode.powerChange();
  4548. }
  4549. showPreView() {
  4550. let item;
  4551. let data;
  4552. for (let index = 0; index < this.showItemArr.length; index++) {
  4553. item = this.showItemArr[index];
  4554. item.destroySelf();
  4555. }
  4556. this.showItemArr = [];
  4557. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  4558. for (const key in cfgData) {
  4559. data = cfgData[key];
  4560. item = new ShowItem();
  4561. item.setParent(this.ui.myNode.displayRoot);
  4562. item.setPos(data.x, data.y);
  4563. item.setUrl(data.value);
  4564. this.showItemArr.push(item);
  4565. }
  4566. }
  4567. updateSelf() {
  4568. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  4569. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  4570. if (this.data.ball == -1) {
  4571. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  4572. }
  4573. else {
  4574. this.ui.myNode.conditionTxt.text = "Reward";
  4575. }
  4576. let localData = DataMgr.getPlaceBallLevel(this.level);
  4577. let getAward = localData.getAward;
  4578. let cfg = cfgTable.placeballData[this.level];
  4579. let coin = this.data.award[0];
  4580. let diamond = this.data.award[1];
  4581. if (cfg.type == PlaceBallType.challenge) {
  4582. diamond = 0;
  4583. coin = 100;
  4584. }
  4585. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  4586. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  4587. this.ui.myNode.coinNode.numTxt.text = coin + "";
  4588. if (cfg.type == PlaceBallType.challenge) {
  4589. this.ui.myNode.coinNode.numTxt.text = "";
  4590. }
  4591. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  4592. if (coin > 0 && diamond > 0) {
  4593. this.ui.myNode.diamondNode.x = 385;
  4594. this.ui.myNode.coinNode.x = 467;
  4595. }
  4596. else {
  4597. this.ui.myNode.diamondNode.x = 385;
  4598. this.ui.myNode.coinNode.x = 385;
  4599. }
  4600. if (!getAward) {
  4601. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  4602. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  4603. }
  4604. else {
  4605. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  4606. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  4607. }
  4608. }
  4609. startGame() {
  4610. if (DataMgr.powerEnough()) {
  4611. this.ui.myNode.startBtn.touchable = false;
  4612. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  4613. console.log('zh:startGame ');
  4614. this.ui.myNode.startBtn.touchable = true;
  4615. DataMgr.setPower(-1);
  4616. xGame.eventMgr.event(POWER_TIME);
  4617. xGame.common.gameMode = GameMode.placeBall;
  4618. xGame.common.placeBallCurLevel = this.level;
  4619. xGame.uiMgr.Show(UIGame);
  4620. xGame.uiMgr.Hide(UILevelDisplay);
  4621. xGame.uiMgr.Hide(UIMain);
  4622. this.hide();
  4623. }));
  4624. }
  4625. else {
  4626. xGame.uiMgr.Show(UIPower);
  4627. }
  4628. }
  4629. hide() {
  4630. super.hide();
  4631. }
  4632. }
  4633. UILevelProp.uiName = "UILevelProp";
  4634. class PutBallLevelDisplay {
  4635. constructor(ui, index) {
  4636. this.index = 0;
  4637. this.ui = ui;
  4638. this.index = index;
  4639. this.ui.onClick(this, this.clickSelf);
  4640. this.updateSelf();
  4641. this.ui.levelTxt.text = (this.index + 1) + "";
  4642. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  4643. this.ui.special.levelTxt.text = (this.index + 1) + "";
  4644. }
  4645. updateSelf() {
  4646. let level = this.index + 1;
  4647. this.data = DataMgr.getPlaceBallLevel(level);
  4648. this.ui.starNode.c1.selectedIndex = this.data.star;
  4649. let isChallenge = cfgTable.placeballData[level].type;
  4650. if (this.data.isCur) {
  4651. if (isChallenge) {
  4652. this.ui.c1.selectedIndex = 5;
  4653. }
  4654. else {
  4655. this.ui.c1.selectedIndex = 2;
  4656. }
  4657. }
  4658. else {
  4659. if (this.data.play) {
  4660. if (this.data.star == 3) {
  4661. this.ui.c1.selectedIndex = 0;
  4662. }
  4663. else {
  4664. this.ui.c1.selectedIndex = 1;
  4665. }
  4666. }
  4667. else {
  4668. if (isChallenge) {
  4669. this.ui.c1.selectedIndex = 4;
  4670. }
  4671. else {
  4672. this.ui.c1.selectedIndex = 3;
  4673. }
  4674. }
  4675. }
  4676. }
  4677. clickSelf() {
  4678. if (!this.data.play)
  4679. return;
  4680. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4681. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  4682. }
  4683. }
  4684. class UILevelDisplay extends UIBase {
  4685. constructor() {
  4686. super();
  4687. }
  4688. onConstructor() {
  4689. this.ui = ui_UILevelDisplay.createInstance();
  4690. this.contentPane = this.ui;
  4691. this.isEject = false;
  4692. this.myList = this.ui.myNode.myList;
  4693. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  4694. this.levelItemArr = [];
  4695. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  4696. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  4697. this.myList.numItems = levelNum;
  4698. if (Moyu.isKs)
  4699. this.ui.closeNode.closeBtn.x += 100;
  4700. }
  4701. levelItemRender(index, target) {
  4702. let item = new PutBallLevelDisplay(target, index);
  4703. this.levelItemArr.push(item);
  4704. }
  4705. show() {
  4706. super.show();
  4707. this.updateLevel();
  4708. this.scrollToPlace();
  4709. }
  4710. updateLevel() {
  4711. let temp;
  4712. for (let index = 0; index < this.levelItemArr.length; index++) {
  4713. temp = this.levelItemArr[index];
  4714. temp.updateSelf();
  4715. }
  4716. }
  4717. scrollToPlace() {
  4718. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  4719. let passArr = DataMgr.getPlaceBallLevelList();
  4720. let offest = passArr.length;
  4721. if (offest >= maxNum - 1)
  4722. offest = maxNum - 1;
  4723. this.myList.scrollToView(offest, true, true);
  4724. }
  4725. hide() {
  4726. super.hide();
  4727. }
  4728. }
  4729. UILevelDisplay.uiName = "UILevelDisplay";
  4730. class ui_UIMatching extends fgui.GComponent {
  4731. static createInstance() {
  4732. return (fgui.UIPackage.createObject("game", "UIMatching"));
  4733. }
  4734. onConstruct() {
  4735. this.n5 = (this.getChild("n5"));
  4736. this.n49 = (this.getChild("n49"));
  4737. this.n51 = (this.getChild("n51"));
  4738. this.n64 = (this.getChild("n64"));
  4739. this.n2 = (this.getChild("n2"));
  4740. this.n53 = (this.getChild("n53"));
  4741. this.n54 = (this.getChild("n54"));
  4742. this.n56 = (this.getChild("n56"));
  4743. this.n58 = (this.getChild("n58"));
  4744. this.n59 = (this.getChild("n59"));
  4745. this.n57 = (this.getChild("n57"));
  4746. this.n60 = (this.getChild("n60"));
  4747. this.n62 = (this.getChild("n62"));
  4748. this.awardTxt = (this.getChild("awardTxt"));
  4749. this.n61 = (this.getChild("n61"));
  4750. this.selfHead = (this.getChild("selfHead"));
  4751. this.aiHead = (this.getChild("aiHead"));
  4752. this.n82 = (this.getChild("n82"));
  4753. this.n84 = (this.getChild("n84"));
  4754. this.n83 = (this.getChild("n83"));
  4755. this.t1 = this.getTransition("t1");
  4756. this.t2 = this.getTransition("t2");
  4757. this.t3 = this.getTransition("t3");
  4758. this.t4 = this.getTransition("t4");
  4759. }
  4760. }
  4761. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  4762. class UIMatching extends UIBase {
  4763. constructor() {
  4764. super();
  4765. }
  4766. onConstructor() {
  4767. this.ui = ui_UIMatching.createInstance();
  4768. this.contentPane = this.ui;
  4769. this.isEject = false;
  4770. }
  4771. show(callback) {
  4772. super.show();
  4773. PlatMgr.showBanner(true);
  4774. this.callback = callback;
  4775. let user = Moyu.getUserInfo();
  4776. if (!this.selfPot) {
  4777. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  4778. }
  4779. if (!this.aiPot) {
  4780. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  4781. }
  4782. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  4783. this.ui.selfHead.nameTxt.text = user.nickName;
  4784. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  4785. this.ui.aiHead.nameTxt.text = "???";
  4786. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  4787. this.ui.selfHead.c1.selectedIndex = 0;
  4788. this.ui.aiHead.c1.selectedIndex = 0;
  4789. this.ui.selfHead.x = this.selfPot.x;
  4790. this.ui.selfHead.y = this.selfPot.y;
  4791. this.ui.aiHead.x = this.aiPot.x;
  4792. this.ui.aiHead.y = this.aiPot.y;
  4793. switch (xGame.common.gameMode) {
  4794. case GameMode.classic:
  4795. break;
  4796. case GameMode.bigMove:
  4797. this.initSkillData();
  4798. break;
  4799. default:
  4800. break;
  4801. }
  4802. this.ui.t1.play(Laya.Handler.create(this, () => {
  4803. this.ui.t2.play(Laya.Handler.create(this, () => {
  4804. switch (xGame.common.gameMode) {
  4805. case GameMode.classic:
  4806. this.waitingPeople();
  4807. break;
  4808. case GameMode.bigMove:
  4809. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  4810. break;
  4811. default:
  4812. break;
  4813. }
  4814. }));
  4815. }));
  4816. }
  4817. initSkillData() {
  4818. this.skillSelectData = [];
  4819. let skillUrl = xGame.common.skillIconList;
  4820. let skillName = xGame.common.skillNameList;
  4821. let skillLevel = DataMgr.getBigSkillList();
  4822. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  4823. for (let index = 0; index < 5; index++) {
  4824. let obj = {};
  4825. obj.skillImg = skillUrl[index];
  4826. obj.skillName = skillName[index];
  4827. obj.skillType = skillType[index];
  4828. obj.skillLevel = skillLevel[index];
  4829. this.skillSelectData.push(obj);
  4830. }
  4831. }
  4832. getAISkillLevel(myLevel) {
  4833. let video = xGame.common.upSkillLevel;
  4834. let aiLevel;
  4835. let temp;
  4836. if (video) {
  4837. temp = xGame.common.randomNum(-2, -1);
  4838. }
  4839. else {
  4840. if (myLevel <= 5) {
  4841. temp = xGame.common.randomNum(1, 3);
  4842. }
  4843. else if (myLevel <= 9) {
  4844. temp = xGame.common.randomNum(-2, 1);
  4845. }
  4846. else {
  4847. temp = xGame.common.randomNum(-4, 0);
  4848. }
  4849. }
  4850. aiLevel = temp + myLevel;
  4851. if (aiLevel <= 1)
  4852. aiLevel = 1;
  4853. if (aiLevel >= 10)
  4854. aiLevel = 10;
  4855. return aiLevel;
  4856. }
  4857. getAISkillType() {
  4858. return xGame.common.randomNum(1, 4);
  4859. let successTimes = DataMgr.getSkillSuccessTimes();
  4860. let info = cfgTable.aiskillData[successTimes];
  4861. if (!info) {
  4862. let max = Object.keys(cfgTable.aiskillData).length - 1;
  4863. info = cfgTable.aiskillData[max];
  4864. }
  4865. let dataArr = info.skillselect;
  4866. let myCfg = {};
  4867. for (let index = 0; index < dataArr.length; index++) {
  4868. let temp = dataArr[index].split('-');
  4869. myCfg[temp[0]] = {};
  4870. myCfg[temp[0]].id = parseInt(temp[0]);
  4871. myCfg[temp[0]].weight = parseInt(temp[1]);
  4872. }
  4873. let aiCfg = xGame.common.initWeight(myCfg);
  4874. let curData = xGame.common.getRandomWeightData(aiCfg);
  4875. return parseInt(curData.id);
  4876. }
  4877. getAISkillData(index) {
  4878. let myLevel = this.skillSelectData[index].skillLevel;
  4879. let aiLevel = this.getAISkillLevel(myLevel);
  4880. let aiType = this.getAISkillType() - 1;
  4881. return { aiLevel, aiType } = { aiLevel, aiType };
  4882. }
  4883. skillSelectFinish(index) {
  4884. let aiInfo = this.getAISkillData(index);
  4885. xGame.common.gameMgr.selfCurSkill = index;
  4886. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  4887. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  4888. this.ui.selfHead.c1.selectedIndex = 1;
  4889. this.ui.aiHead.c1.selectedIndex = 1;
  4890. let myData = this.skillSelectData[index];
  4891. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  4892. let guide = DataMgr.getSkillGuide();
  4893. if (guide == 0) {
  4894. this.ui.selfHead.skillTxt.text = myData.skillName + " 满级";
  4895. }
  4896. else {
  4897. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  4898. }
  4899. let aiData = this.skillSelectData[aiInfo.aiType];
  4900. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  4901. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  4902. this.waitingPeople();
  4903. }
  4904. waitingPeople() {
  4905. let time = xGame.common.randomNum(1000, 3000);
  4906. time += 1000;
  4907. Laya.timer.once(time, this, () => {
  4908. this.matchingSuccess();
  4909. });
  4910. }
  4911. matchingSuccess() {
  4912. let gameUI = xGame.common.gameUI;
  4913. let name = gameUI.ui.topNode.aiNameTxt.text;
  4914. let url = gameUI.ui.topNode.aiHeadLoader.url;
  4915. this.ui.aiHead.nameTxt.text = name;
  4916. this.ui.aiHead.headImg.url = url;
  4917. name = gameUI.ui.topNode.selfNameTxt.text;
  4918. url = gameUI.ui.topNode.selfHeadLoader.url;
  4919. this.ui.selfHead.nameTxt.text = name;
  4920. this.ui.selfHead.headImg.url = url;
  4921. this.ui.t3.play(Laya.Handler.create(this, () => {
  4922. this.callback && this.callback();
  4923. this.ui.t4.play(Laya.Handler.create(this, () => {
  4924. this.destroySelf();
  4925. }));
  4926. }));
  4927. }
  4928. destroySelf() {
  4929. this.callback = null;
  4930. this.skillSelectData = null;
  4931. this.selfPot = null;
  4932. this.aiPot = null;
  4933. if (!this.ui.isDisposed) {
  4934. this.ui.removeFromParent();
  4935. this.ui.dispose();
  4936. }
  4937. xGame.uiMgr.destroyUI(this);
  4938. }
  4939. }
  4940. UIMatching.uiName = "UIMatching";
  4941. class ui_UIRanking extends fgui.GComponent {
  4942. static createInstance() {
  4943. return (fgui.UIPackage.createObject("game", "UIRanking"));
  4944. }
  4945. onConstruct() {
  4946. this.n26 = (this.getChild("n26"));
  4947. this.myNode = (this.getChild("myNode"));
  4948. }
  4949. }
  4950. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  4951. class UIRanking extends UIBase {
  4952. constructor() {
  4953. super();
  4954. this.showSelf = true;
  4955. this.rankType = 1;
  4956. this.rankList = [];
  4957. this.myIndex = 0;
  4958. this.myStar = 0;
  4959. }
  4960. onConstructor() {
  4961. this.ui = ui_UIRanking.createInstance();
  4962. this.contentPane = this.ui;
  4963. this.isEject = false;
  4964. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  4965. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  4966. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  4967. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  4968. this.ui.myNode.myList.setVirtual();
  4969. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  4970. }
  4971. show() {
  4972. super.show();
  4973. this.myIndex = 51;
  4974. Moyu.getRankList({
  4975. rankId: xGame.common.curRankID,
  4976. type: MoyuRankType.total,
  4977. page: 1,
  4978. pageSize: 50,
  4979. }, this, this.updateItemData);
  4980. this.updateSelf();
  4981. let self = Moyu.getUserInfo();
  4982. if (!self.isAuth) {
  4983. Moyu.initUser(this, () => {
  4984. DataMgr.upRankData();
  4985. });
  4986. }
  4987. }
  4988. updateSelfItem() {
  4989. let self = Moyu.getUserInfo();
  4990. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  4991. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > 50 ? "未上榜" : this.myIndex.toString();
  4992. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  4993. this.ui.myNode.selfNode.nameTxt.text = Moyu.platType < 11 ? self.nickName : "myself";
  4994. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  4995. }
  4996. updateItemData(data) {
  4997. this.myStar = xGame.common.getAllStarNum();
  4998. if (this.rankList.length < 2) {
  4999. this.rankList = data;
  5000. let self = Moyu.getUserInfo();
  5001. for (let i = 0; i < data.length; i++) {
  5002. let data = this.rankList[i];
  5003. if (data.userId == self.userId) {
  5004. this.rankList.splice(i, 1);
  5005. break;
  5006. }
  5007. }
  5008. for (let i = 0; i < data.length; i++) {
  5009. let data = this.rankList[i];
  5010. if (data.rankScore < this.myStar && this.myIndex > 50) {
  5011. this.myIndex = i + 1;
  5012. let user = { headIcon: self.headIcon, nickName: "myself" };
  5013. let ud = { user: user, data: {} };
  5014. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5015. if (Moyu.platType < 11) {
  5016. user.headIcon = self.headIcon;
  5017. user.nickName = self.nickName;
  5018. }
  5019. this.rankList.splice(i, 0, md);
  5020. break;
  5021. }
  5022. }
  5023. }
  5024. this.updateSelfItem();
  5025. this.ui.myNode.myList.numItems = this.rankList.length;
  5026. }
  5027. updateItemUI(index, obj) {
  5028. let data = this.rankList[index];
  5029. let userData = JSON.parse(data.userData).user;
  5030. obj.nameTxt.text = userData.nickName.toString();
  5031. obj.valueTxt.text = data.rankScore;
  5032. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5033. obj.rankTxt.text = index + 1;
  5034. switch (index) {
  5035. case 0:
  5036. this.setImg(obj, 1, 0, 0);
  5037. obj.rankTxt.color = "#FFC047";
  5038. break;
  5039. case 1:
  5040. this.setImg(obj, 0, 1, 0);
  5041. obj.rankTxt.color = "#ACACAC";
  5042. break;
  5043. case 2:
  5044. this.setImg(obj, 0, 0, 1);
  5045. obj.rankTxt.color = "#D09672";
  5046. break;
  5047. default:
  5048. this.setImg(obj, 0, 0, 0);
  5049. obj.rankTxt.color = "#496FAB";
  5050. break;
  5051. }
  5052. }
  5053. setImg(obj, a, b, c) {
  5054. obj.img1.visible = a ? true : false;
  5055. obj.img2.visible = b ? true : false;
  5056. obj.img3.visible = c ? true : false;
  5057. }
  5058. changeList(type) {
  5059. this.rankType = type;
  5060. this.updateSelf();
  5061. }
  5062. changeSelfNode() {
  5063. this.showSelf = !this.showSelf;
  5064. this.updateSelf();
  5065. }
  5066. updateSelf() {
  5067. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5068. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5069. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5070. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5071. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5072. }
  5073. }
  5074. UIRanking.uiName = "UIRanking";
  5075. class ui_UISecretary extends fgui.GComponent {
  5076. static createInstance() {
  5077. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5078. }
  5079. onConstruct() {
  5080. this.n0 = (this.getChild("n0"));
  5081. this.myNode = (this.getChild("myNode"));
  5082. this.rightBtn = (this.getChild("rightBtn"));
  5083. this.leftBtn = (this.getChild("leftBtn"));
  5084. this.closeBtn = (this.getChild("closeBtn"));
  5085. this.t0 = this.getTransition("t0");
  5086. }
  5087. }
  5088. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5089. class UISecretary extends UIBase {
  5090. constructor() {
  5091. super();
  5092. this.curIndex = 1;
  5093. }
  5094. onConstructor() {
  5095. this.ui = ui_UISecretary.createInstance();
  5096. this.contentPane = this.ui;
  5097. this.isEject = false;
  5098. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5099. this.addUIClick(this.ui.leftBtn, this.turnLeft);
  5100. this.addUIClick(this.ui.rightBtn, this.turnRight);
  5101. this.nodeObj = { left: null, right: null, cur: null };
  5102. this.nodeObj.left = this.ui.myNode.gameNode1;
  5103. this.nodeObj.right = this.ui.myNode.gameNode2;
  5104. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5105. }
  5106. show() {
  5107. super.show();
  5108. this.ui.t0.play();
  5109. this.updateData();
  5110. }
  5111. addSecretarySpine(node, spineName) {
  5112. if (spineName == "mishu") {
  5113. if (this.secretarySpine1) {
  5114. node.displayObject.destroyChildren();
  5115. this.playWoman(this.secretarySpine1, node.displayObject);
  5116. }
  5117. else {
  5118. let spine1 = new SpineMgr("mishu", () => {
  5119. this.secretarySpine1 = spine1;
  5120. this.playWoman(this.secretarySpine1, node.displayObject);
  5121. });
  5122. }
  5123. }
  5124. else {
  5125. if (this.secretarySpine2) {
  5126. node.displayObject.destroyChildren();
  5127. this.playWoman(this.secretarySpine2, node.displayObject);
  5128. }
  5129. else {
  5130. let spine2 = new SpineMgr("xiaomishu2", () => {
  5131. this.secretarySpine2 = spine2;
  5132. this.playWoman(this.secretarySpine2, node.displayObject);
  5133. });
  5134. }
  5135. }
  5136. }
  5137. playWoman(node, parent) {
  5138. let xx = this.ui.myNode.gameNode1.secretary.width / 2;
  5139. let yy = this.ui.myNode.gameNode1.secretary.height;
  5140. let scale = 1.5;
  5141. if (node == this.secretarySpine2) {
  5142. scale = 1.2;
  5143. }
  5144. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5145. node.play(data, 1, true, parent);
  5146. }
  5147. turnLeft() {
  5148. this.curIndex--;
  5149. if (this.curIndex < 1) {
  5150. this.curIndex = 2;
  5151. }
  5152. let left = this.nodeObj.left;
  5153. let right = this.nodeObj.right;
  5154. let cur = this.nodeObj.cur;
  5155. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5156. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5157. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5158. this.updateData();
  5159. }));
  5160. this.ui.myNode.setChildIndex(right, 2);
  5161. this.nodeObj.left = cur;
  5162. this.nodeObj.right = left;
  5163. this.nodeObj.cur = right;
  5164. }
  5165. turnRight() {
  5166. this.curIndex++;
  5167. if (this.curIndex > 2) {
  5168. this.curIndex = 1;
  5169. }
  5170. let left = this.nodeObj.left;
  5171. let right = this.nodeObj.right;
  5172. let cur = this.nodeObj.cur;
  5173. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5174. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5175. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5176. this.updateData();
  5177. }));
  5178. this.ui.myNode.setChildIndex(left, 2);
  5179. this.nodeObj.left = right;
  5180. this.nodeObj.right = cur;
  5181. this.nodeObj.cur = left;
  5182. }
  5183. updateData() {
  5184. let data = cfgTable.secretaryshopData;
  5185. let children = this.ui.myNode._children;
  5186. let temp;
  5187. let curData;
  5188. for (let index = 0; index < children.length; index++) {
  5189. temp = children[index];
  5190. if (index == 2) {
  5191. curData = data[this.curIndex];
  5192. temp.purchaseBtn.touchable = true;
  5193. }
  5194. else {
  5195. temp.purchaseBtn.touchable = false;
  5196. if (this.curIndex == 1) {
  5197. curData = data[2];
  5198. }
  5199. else {
  5200. curData = data[1];
  5201. }
  5202. }
  5203. temp.heightTxt.text = curData.height;
  5204. temp.foodTxt.text = curData.food;
  5205. temp.historyTxt.text = curData.history;
  5206. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5207. this.addSecretarySpine(temp.secretary, curData.spine);
  5208. let womanIndex = curData.id - 1;
  5209. let getWoman = DataMgr.getSecretary(womanIndex);
  5210. let curUse = DataMgr.getCurSecretary();
  5211. if (getWoman) {
  5212. if (curUse == womanIndex) {
  5213. temp.purchaseBtn.c1.selectedIndex = 1;
  5214. }
  5215. else {
  5216. temp.purchaseBtn.c1.selectedIndex = 2;
  5217. }
  5218. }
  5219. else {
  5220. temp.purchaseBtn.c1.selectedIndex = 0;
  5221. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5222. }
  5223. temp.purchaseBtn.offClick(this, this.clickSecretary);
  5224. temp.purchaseBtn.onClick(this, this.clickSecretary, [getWoman, curUse, womanIndex, curData.price]);
  5225. }
  5226. }
  5227. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5228. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5229. if (getWoman) {
  5230. if (curUse != womanIndex) {
  5231. console.log();
  5232. DataMgr.setCurSecretary(womanIndex);
  5233. this.updateData();
  5234. }
  5235. }
  5236. else {
  5237. let need = needDiamond;
  5238. if (DataMgr.diamondEnough(need)) {
  5239. DataMgr.setDiamond(-need);
  5240. DataMgr.setSecretary(womanIndex, 1);
  5241. DataMgr.setCurSecretary(womanIndex);
  5242. this.updateData();
  5243. }
  5244. else {
  5245. xGame.uiMgr.Show(UIAddProp, 1);
  5246. }
  5247. }
  5248. }
  5249. closeSelf() {
  5250. this.hide();
  5251. }
  5252. }
  5253. UISecretary.uiName = "UISecretary";
  5254. class ui_UIShop extends fgui.GComponent {
  5255. static createInstance() {
  5256. return (fgui.UIPackage.createObject("game", "UIShop"));
  5257. }
  5258. onConstruct() {
  5259. this.n48 = (this.getChild("n48"));
  5260. this.n0 = (this.getChild("n0"));
  5261. this.secretary = (this.getChild("secretary"));
  5262. this.talkNode = (this.getChild("talkNode"));
  5263. this.closeNode = (this.getChild("closeNode"));
  5264. this.moneyNode = (this.getChild("moneyNode"));
  5265. this.myNode = (this.getChild("myNode"));
  5266. }
  5267. }
  5268. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5269. class BallRodDisplay {
  5270. constructor(ui, index) {
  5271. this.index = 0;
  5272. this.uiIndex = 0;
  5273. this.ui = ui;
  5274. this.index = index;
  5275. this.initData();
  5276. }
  5277. initData() {
  5278. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5279. let data = cfgTable.ballrodData[this.index + 1];
  5280. this.ui.nameTxt.text = data.name;
  5281. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5282. this.ui.levelNode.c1.selectedIndex = data.quality;
  5283. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5284. if (data.spine) {
  5285. this.mySpine = new SpineMgr(data.spine, () => {
  5286. let xx = 150;
  5287. let yy = 70;
  5288. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5289. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5290. });
  5291. }
  5292. }
  5293. updateSelf() {
  5294. let get = DataMgr.getBallRod(this.index);
  5295. if (get == null)
  5296. get = 1;
  5297. let curUse = DataMgr.getCurBallRod();
  5298. if (get) {
  5299. if (curUse == this.index) {
  5300. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5301. }
  5302. else {
  5303. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5304. }
  5305. }
  5306. else {
  5307. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5308. }
  5309. }
  5310. buyBallRod() {
  5311. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5312. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5313. switch (selectedIndex) {
  5314. case 0:
  5315. break;
  5316. case 1:
  5317. DataMgr.setCurBallRod(this.index);
  5318. let ui = xGame.uiMgr.getUI(UIShop);
  5319. ui.updateBallRod();
  5320. break;
  5321. case 2:
  5322. let data = cfgTable.ballrodData[this.index + 1];
  5323. let need = data.price;
  5324. if (DataMgr.diamondEnough(need)) {
  5325. DataMgr.setDiamond(-need);
  5326. DataMgr.setBallRod(this.index, 1);
  5327. DataMgr.setCurBallRod(this.index);
  5328. let ui = xGame.uiMgr.getUI(UIShop);
  5329. ui.updateBallRod();
  5330. }
  5331. else {
  5332. xGame.uiMgr.Show(UIAddProp, 1);
  5333. }
  5334. break;
  5335. default:
  5336. break;
  5337. }
  5338. }
  5339. }
  5340. class UIShop extends UIBase {
  5341. constructor() {
  5342. super();
  5343. this.itemNums = 0;
  5344. }
  5345. onConstructor() {
  5346. this.ui = ui_UIShop.createInstance();
  5347. this.contentPane = this.ui;
  5348. this.isEject = false;
  5349. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5350. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5351. this.addUIClick(this.ui, this.interuptSecretary);
  5352. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  5353. this.ballRodArr = [];
  5354. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  5355. this.ui.myNode.myList.numItems = this.itemNums;
  5356. if (Moyu.isKs)
  5357. this.ui.closeNode.closeBtn.x += 100;
  5358. }
  5359. show() {
  5360. super.show();
  5361. this.playSecretaryIdle();
  5362. this.updateBallRod();
  5363. }
  5364. updateBallRod() {
  5365. for (let index = 0; index < this.ballRodArr.length; index++) {
  5366. this.ballRodArr[index].updateSelf();
  5367. }
  5368. }
  5369. renderBallRod(sort, obj) {
  5370. let index = this.getIndexBySort(sort + 1) - 1;
  5371. let ballRod = new BallRodDisplay(obj, index);
  5372. this.ballRodArr.push(ballRod);
  5373. }
  5374. getIndexBySort(sort) {
  5375. let object = cfgTable.ballrodData;
  5376. for (const key in object) {
  5377. if (object[key].sort == sort) {
  5378. return parseInt(key);
  5379. }
  5380. }
  5381. }
  5382. playSecretaryIdle() {
  5383. let parent = this.ui.secretary.displayObject;
  5384. parent.destroyChildren();
  5385. let xx = this.ui.secretary.width / 2;
  5386. let yy = this.ui.secretary.height;
  5387. let scale = xGame.common.getSecretaryScale();
  5388. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5389. xGame.common.secretary.play(data, 1, true, parent);
  5390. }
  5391. interuptSecretary() {
  5392. Laya.timer.clearAll(this);
  5393. this.playSecretaryRandomSound();
  5394. }
  5395. playSecretaryRandomSound() {
  5396. if (this.isHide)
  5397. return;
  5398. let time = xGame.common.randomNum(45000, 60000);
  5399. Laya.timer.once(time, this, () => {
  5400. if (this.isHide)
  5401. return;
  5402. let index = xGame.common.randomNum(4, 7);
  5403. xGame.soundMgr.playSound("s_main0" + index);
  5404. let words = 1;
  5405. switch (index) {
  5406. case 4:
  5407. words = 5;
  5408. break;
  5409. case 5:
  5410. words = 3;
  5411. break;
  5412. case 6:
  5413. words = 6;
  5414. break;
  5415. case 7:
  5416. words = 7;
  5417. break;
  5418. default:
  5419. break;
  5420. }
  5421. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5422. this.playSecretaryRandomSound();
  5423. });
  5424. }
  5425. closeSelf() {
  5426. this.hide();
  5427. }
  5428. }
  5429. UIShop.uiName = "UIShop";
  5430. class ui_UISign extends fgui.GComponent {
  5431. static createInstance() {
  5432. return (fgui.UIPackage.createObject("game", "UISign"));
  5433. }
  5434. onConstruct() {
  5435. this.n6 = (this.getChild("n6"));
  5436. this.closeNode = (this.getChild("closeNode"));
  5437. this.myNode = (this.getChild("myNode"));
  5438. this.moneyNode = (this.getChild("moneyNode"));
  5439. this.secretary = (this.getChild("secretary"));
  5440. this.talkNode = (this.getChild("talkNode"));
  5441. this.tripleBtn = (this.getChild("tripleBtn"));
  5442. this.normalBtn = (this.getChild("normalBtn"));
  5443. this.tipsNode = (this.getChild("tipsNode"));
  5444. this.againBtn = (this.getChild("againBtn"));
  5445. this.t0 = this.getTransition("t0");
  5446. }
  5447. }
  5448. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  5449. class SignMax {
  5450. constructor(ui) {
  5451. this.ui = ui;
  5452. }
  5453. updateSelf(index, sameDay, curDayIndex) {
  5454. let data = cfgTable.signData[index + 1];
  5455. this.ui.titleTxt.text = data.title;
  5456. let arr1 = data.award[0].split('-');
  5457. let arr2 = data.award[1].split('-');
  5458. let num1 = parseInt(arr1[1]);
  5459. let num2 = parseInt(arr2[1]);
  5460. this.ui.numTxt1.text = num1 + "";
  5461. this.ui.numTxt2.text = num2 + "";
  5462. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  5463. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  5464. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  5465. this.ui.numTxt1.visible = false;
  5466. }
  5467. else {
  5468. this.ui.numTxt1.visible = true;
  5469. }
  5470. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  5471. this.ui.numTxt2.visible = false;
  5472. }
  5473. else {
  5474. this.ui.numTxt2.visible = true;
  5475. }
  5476. if (index < curDayIndex) {
  5477. this.ui.c1.selectedIndex = 1;
  5478. }
  5479. else if (index == curDayIndex) {
  5480. if (sameDay) {
  5481. this.ui.c1.selectedIndex = 2;
  5482. }
  5483. else {
  5484. this.ui.c1.selectedIndex = 2;
  5485. }
  5486. }
  5487. else {
  5488. this.ui.c1.selectedIndex = 0;
  5489. }
  5490. }
  5491. }
  5492. class SignNormal {
  5493. constructor(ui) {
  5494. this.ui = ui;
  5495. }
  5496. updateSelf(index, sameDay, curDayIndex) {
  5497. let data = cfgTable.signData[index + 1];
  5498. this.ui.titleTxt.text = data.title;
  5499. let arr = data.award[0].split('-');
  5500. let type = parseInt(arr[0]);
  5501. let num = parseInt(arr[1]);
  5502. this.ui.numTxt.text = num + "";
  5503. if (type > 2) {
  5504. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  5505. this.ui.myIcon.rotation = 0;
  5506. }
  5507. else {
  5508. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  5509. this.ui.myIcon.rotation = 0;
  5510. }
  5511. if (xGame.common.signAwardContainsRod(data.award)) {
  5512. this.ui.numTxt.visible = false;
  5513. }
  5514. else {
  5515. this.ui.numTxt.visible = true;
  5516. }
  5517. if (index < curDayIndex) {
  5518. this.ui.c1.selectedIndex = 1;
  5519. }
  5520. else if (index == curDayIndex) {
  5521. if (sameDay) {
  5522. this.ui.c1.selectedIndex = 2;
  5523. }
  5524. else {
  5525. this.ui.c1.selectedIndex = 2;
  5526. }
  5527. }
  5528. else {
  5529. this.ui.c1.selectedIndex = 0;
  5530. }
  5531. }
  5532. }
  5533. class UISign extends UIBase {
  5534. constructor() {
  5535. super();
  5536. this.curDayIndex = 0;
  5537. this.starX = 0;
  5538. }
  5539. onConstructor() {
  5540. this.ui = ui_UISign.createInstance();
  5541. this.contentPane = this.ui;
  5542. this.isEject = false;
  5543. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5544. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5545. this.initSignItem();
  5546. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  5547. this.addUIClick(this.ui.againBtn, this.againGetAward);
  5548. }
  5549. show() {
  5550. super.show();
  5551. this.ui.t0.play();
  5552. this.playSecretaryIdle();
  5553. this.updateSign();
  5554. }
  5555. initSignItem() {
  5556. this.signArr = [];
  5557. for (let index = 0; index < 6; index++) {
  5558. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  5559. this.signArr.push(temp);
  5560. }
  5561. this.signMax = new SignMax(this.ui.myNode.day7);
  5562. if (Moyu.isKs)
  5563. this.ui.closeNode.closeBtn.x += 100;
  5564. }
  5565. updateSign() {
  5566. let sameDay = xGame.common.judgeSameDay();
  5567. let max = 7;
  5568. this.curDayIndex = DataMgr.getSignData();
  5569. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  5570. this.curDayIndex = 0;
  5571. if (!sameDay) {
  5572. this.ui.normalBtn.visible = true;
  5573. this.ui.tipsNode.visible = false;
  5574. this.ui.againBtn.visible = false;
  5575. }
  5576. else {
  5577. this.ui.normalBtn.visible = false;
  5578. let again = DataMgr.getExtraSign();
  5579. let isCurrency = false;
  5580. let index = this.curDayIndex;
  5581. if (index == 0)
  5582. index = 7;
  5583. let award = cfgTable.signData[index].award;
  5584. let num = award[0].split("-")[0];
  5585. if (num == "1" || num == "2")
  5586. isCurrency = true;
  5587. let showAgain = again == 0 && isCurrency;
  5588. this.ui.againBtn.visible = showAgain;
  5589. this.ui.tipsNode.visible = !showAgain;
  5590. }
  5591. for (let index = 0; index < this.signArr.length; index++) {
  5592. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  5593. }
  5594. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  5595. }
  5596. playSecretaryIdle() {
  5597. let parent = this.ui.secretary.displayObject;
  5598. parent.destroyChildren();
  5599. let xx = this.ui.secretary.width / 2;
  5600. let yy = this.ui.secretary.height;
  5601. let scale = xGame.common.getSecretaryScale();
  5602. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5603. xGame.common.secretary.play(data, 1, true, parent);
  5604. }
  5605. closeSelf() {
  5606. this.hide();
  5607. }
  5608. normalGetAward() {
  5609. let sameDay = xGame.common.judgeSameDay();
  5610. if (!sameDay) {
  5611. let award = cfgTable.signData[this.curDayIndex + 1].award;
  5612. let temp;
  5613. let type;
  5614. let num;
  5615. let arr = [];
  5616. for (let index = 0; index < award.length; index++) {
  5617. temp = award[index].split("-");
  5618. type = parseInt(temp[0]);
  5619. num = parseInt(temp[1]);
  5620. let awardType = new AwardType();
  5621. awardType.num = num;
  5622. awardType.type = type;
  5623. arr.push(awardType);
  5624. }
  5625. xGame.common.getAward(arr, (watchVideo) => {
  5626. this.curDayIndex++;
  5627. if (this.curDayIndex > 7)
  5628. this.curDayIndex = 0;
  5629. DataMgr.setSignData(this.curDayIndex);
  5630. DataMgr.setSignTime(new Date().getTime());
  5631. if (watchVideo) {
  5632. DataMgr.setExtraSign(1);
  5633. Moyu.sendDataEvent("signIn1");
  5634. }
  5635. this.updateSign();
  5636. });
  5637. }
  5638. }
  5639. againGetAward() {
  5640. Moyu.sendDataEvent("signIn2");
  5641. Moyu.showVideoAd(() => {
  5642. let index = this.curDayIndex;
  5643. if (index == 0)
  5644. index = 7;
  5645. let award = cfgTable.signData[index].award;
  5646. let temp;
  5647. let type;
  5648. let num;
  5649. for (let index = 0; index < award.length; index++) {
  5650. temp = award[index].split("-");
  5651. type = parseInt(temp[0]);
  5652. num = parseInt(temp[1]) * 3;
  5653. xGame.common.playObjFlyAnim(num, type);
  5654. }
  5655. DataMgr.setExtraSign(1);
  5656. this.updateSign();
  5657. }, EAdType.againSign);
  5658. }
  5659. }
  5660. UISign.uiName = "UISign";
  5661. class ui_UISkill extends fgui.GComponent {
  5662. static createInstance() {
  5663. return (fgui.UIPackage.createObject("game", "UISkill"));
  5664. }
  5665. onConstruct() {
  5666. this.n48 = (this.getChild("n48"));
  5667. this.n0 = (this.getChild("n0"));
  5668. this.secretary = (this.getChild("secretary"));
  5669. this.talkNode = (this.getChild("talkNode"));
  5670. this.closeNode = (this.getChild("closeNode"));
  5671. this.moneyNode = (this.getChild("moneyNode"));
  5672. this.skillNode = (this.getChild("skillNode"));
  5673. this.guideNode = (this.getChild("guideNode"));
  5674. }
  5675. }
  5676. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  5677. class SkillDisplay {
  5678. constructor(ui, data, uiIndex) {
  5679. this.starX = 0;
  5680. this.starY = 0;
  5681. this.index = 0;
  5682. this.ui = ui;
  5683. this.data = data;
  5684. this.index = uiIndex;
  5685. this.initSelf();
  5686. console.log('zh:SkillDisplay constructor this.skillData=', data);
  5687. }
  5688. initSelf() {
  5689. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  5690. this.ui.nameTxt.text = this.data.name;
  5691. this.ui.describeTxt.text = this.data.describe;
  5692. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  5693. this.ui.startBtn.onClick(this, this.startGame);
  5694. this.updateSelf();
  5695. }
  5696. updateSelf() {
  5697. this.checkTry();
  5698. let level = DataMgr.getBigSkillByIndex(this.index);
  5699. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  5700. }
  5701. checkTry() {
  5702. let index = this.index;
  5703. let level = DataMgr.getBigSkillByIndex(index);
  5704. if (level == null) {
  5705. DataMgr.setBigSkill(index, 1, false);
  5706. level = 1;
  5707. }
  5708. this.ui.levelTxt.text = "LV." + level;
  5709. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  5710. this.ui.tryNode.visible = true;
  5711. else
  5712. this.ui.tryNode.visible = false;
  5713. }
  5714. clickAddLevel() {
  5715. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5716. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  5717. Moyu.showVideoAd(() => {
  5718. DataMgr.setBigSkill(this.data.index, 1);
  5719. this.updateSelf();
  5720. xGame.common.upSkillLevel = true;
  5721. }, EAdType.upSkill);
  5722. }
  5723. startGame() {
  5724. if (this.data.index == 3) {
  5725. alert('期待吧');
  5726. return;
  5727. }
  5728. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5729. let needCoin = xGame.common.bigMoveNeedCoin;
  5730. xGame.common.passAwardCoin = 2000;
  5731. let guide = DataMgr.getSkillGuide();
  5732. console.log('zh:startGame guide=' + guide);
  5733. xGame.common.temSelfLevel = 0;
  5734. if (guide == 0) {
  5735. needCoin = 0;
  5736. xGame.common.temSelfLevel = 100;
  5737. }
  5738. if (DataMgr.coinEnough(needCoin)) {
  5739. DataMgr.setCoin(-needCoin);
  5740. xGame.common.curPlayerSkillType = this.index;
  5741. if (guide == 0)
  5742. xGame.common.curPlayerSkillType = 0;
  5743. xGame.uiMgr.Show(UIGame);
  5744. xGame.uiMgr.Hide(UIMain);
  5745. xGame.uiMgr.Show(UIMatching, () => {
  5746. xGame.common.gameUI.ui.alpha = 1;
  5747. xGame.common.gameUI.startGame();
  5748. xGame.uiMgr.Hide(UISkill);
  5749. });
  5750. }
  5751. else {
  5752. xGame.uiMgr.Show(UIAddProp, 0);
  5753. Moyu.sendDataEvent("AddCoinVideo");
  5754. }
  5755. }
  5756. }
  5757. class UISkill extends UIBase {
  5758. constructor() {
  5759. super();
  5760. this.skillData = [];
  5761. }
  5762. onConstructor() {
  5763. this.ui = ui_UISkill.createInstance();
  5764. this.contentPane = this.ui;
  5765. this.isEject = false;
  5766. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5767. this.initSkillData();
  5768. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  5769. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  5770. this.displayList = [];
  5771. this.ui.skillNode.skillList.numItems = 4;
  5772. this.addUIClick(this.ui, this.interuptSecretary);
  5773. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  5774. this.ui.talkNode.visible = false;
  5775. if (Moyu.isKs)
  5776. this.ui.closeNode.closeBtn.x += 100;
  5777. }
  5778. show() {
  5779. super.show();
  5780. this.playSecretaryIdle();
  5781. this.moneyNode.ui.c1.selectedIndex = 1;
  5782. Laya.timer.clearAll(this);
  5783. xGame.soundMgr.playSound("s_start");
  5784. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5785. let guide = DataMgr.getSkillGuide();
  5786. this.ui.guideNode.visible = guide == 0;
  5787. let item = this.getSkillItemByUIIndex(0);
  5788. if (guide == 0) {
  5789. item.ui.c1.selectedIndex = 1;
  5790. }
  5791. else {
  5792. item.ui.c1.selectedIndex = 0;
  5793. }
  5794. this.ui.guideNode.guideBtn.visible = guide == 0;
  5795. for (let index = 0; index < this.displayList.length; index++) {
  5796. this.displayList[index].checkTry();
  5797. }
  5798. }
  5799. getSkillItemByUIIndex(cur) {
  5800. for (let index = 0; index < this.displayList.length; index++) {
  5801. if (this.displayList[index].index == cur) {
  5802. return this.displayList[index];
  5803. }
  5804. }
  5805. }
  5806. enterGuideLevel() {
  5807. let item = this.getSkillItemByUIIndex(0);
  5808. item.startGame();
  5809. if (DataMgr.getNewUser())
  5810. Moyu.sendDataEvent("gameStart1");
  5811. }
  5812. initSkillData() {
  5813. this.skillData = [];
  5814. let nameList = xGame.common.skillNameList;
  5815. let iconList = xGame.common.skillIconList;
  5816. let describeList = [
  5817. "Jump shot executed — ball bounced and pocketed an extra one!",
  5818. "Bonus Sweep: A random follow-up strike hits 1 extra ball after your shot!",
  5819. "Freeze Effect: Your shot freezes 1 random ball — enemy can’t hit it, and others bounce off!"
  5820. ];
  5821. let data;
  5822. for (let index = 0; index < nameList.length; index++) {
  5823. data = {};
  5824. data.name = nameList[index];
  5825. data.icon = iconList[index];
  5826. data.describe = describeList[index];
  5827. data.index = index;
  5828. this.skillData.push(data);
  5829. }
  5830. }
  5831. updateSkillItem(index, target) {
  5832. if (this.displayList[index] == null) {
  5833. let uiIndex;
  5834. switch (index) {
  5835. case 0:
  5836. uiIndex = 1;
  5837. break;
  5838. case 1:
  5839. uiIndex = 0;
  5840. break;
  5841. case 2:
  5842. uiIndex = 2;
  5843. break;
  5844. case 3:
  5845. uiIndex = 3;
  5846. break;
  5847. default:
  5848. break;
  5849. }
  5850. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  5851. this.displayList.push(temp);
  5852. }
  5853. }
  5854. playSecretaryIdle() {
  5855. let parent = this.ui.secretary.displayObject;
  5856. parent.destroyChildren();
  5857. let xx = this.ui.secretary.width / 2;
  5858. let yy = this.ui.secretary.height;
  5859. let scale = xGame.common.getSecretaryScale();
  5860. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5861. xGame.common.secretary.play(data, 1, true, parent);
  5862. }
  5863. returnUIMain() {
  5864. this.hide();
  5865. xGame.common.stopGirlPop(this.ui.talkNode);
  5866. xGame.uiMgr.Show(UIMain);
  5867. }
  5868. interuptSecretary() {
  5869. Laya.timer.clearAll(this);
  5870. this.playSecretaryRandomSound();
  5871. }
  5872. playSecretaryRandomSound() {
  5873. if (this.isHide)
  5874. return;
  5875. let time = xGame.common.randomNum(45000, 60000);
  5876. Laya.timer.once(time, this, () => {
  5877. if (this.isHide)
  5878. return;
  5879. let index = xGame.common.randomNum(4, 7);
  5880. xGame.soundMgr.playSound("s_main0" + index);
  5881. let words = 1;
  5882. switch (index) {
  5883. case 4:
  5884. words = 5;
  5885. break;
  5886. case 5:
  5887. words = 3;
  5888. break;
  5889. case 6:
  5890. words = 6;
  5891. break;
  5892. case 7:
  5893. words = 7;
  5894. break;
  5895. default:
  5896. break;
  5897. }
  5898. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5899. this.playSecretaryRandomSound();
  5900. });
  5901. }
  5902. }
  5903. UISkill.uiName = "UISkill";
  5904. class ui_UIMsg extends fgui.GComponent {
  5905. static createInstance() {
  5906. return (fgui.UIPackage.createObject("game", "UIMsg"));
  5907. }
  5908. onConstruct() {
  5909. this.tipsNode = (this.getChild("tipsNode"));
  5910. }
  5911. }
  5912. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  5913. class UIMsg extends UIBase {
  5914. constructor() {
  5915. super();
  5916. }
  5917. onConstructor() {
  5918. this.ui = ui_UIMsg.createInstance();
  5919. this.contentPane = this.ui;
  5920. this.isEject = false;
  5921. this.isMuti = true;
  5922. }
  5923. show(msg, callback) {
  5924. super.show();
  5925. this.ui.tipsNode.msgTxt.text = msg;
  5926. this.ui.alpha = 1;
  5927. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  5928. this.hide();
  5929. callback && callback();
  5930. }), 1000);
  5931. }
  5932. }
  5933. UIMsg.uiName = "UIMsg";
  5934. class ui_UIModeSelection extends fgui.GComponent {
  5935. static createInstance() {
  5936. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  5937. }
  5938. onConstruct() {
  5939. this.n19 = (this.getChild("n19"));
  5940. this.closeBtn = (this.getChild("closeBtn"));
  5941. this.myNode = (this.getChild("myNode"));
  5942. this.t0 = this.getTransition("t0");
  5943. }
  5944. }
  5945. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  5946. class UIModeSelection extends UIBase {
  5947. constructor() {
  5948. super();
  5949. }
  5950. onConstructor() {
  5951. this.ui = ui_UIModeSelection.createInstance();
  5952. this.contentPane = this.ui;
  5953. this.isEject = false;
  5954. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  5955. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  5956. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  5957. this.addUIClick(this.ui.closeBtn, this.hide);
  5958. this.peopleArr = [650, 6900, 3800];
  5959. this.peopleOffest = [50, 500, 200];
  5960. this.updateSelf();
  5961. }
  5962. show(callback) {
  5963. super.show();
  5964. this.ui.t0.play();
  5965. this.callback = callback;
  5966. }
  5967. updateSelf() {
  5968. let cfg = cfgTable.modeselectData;
  5969. for (let index = 1; index <= 3; index++) {
  5970. let node = this.ui.myNode["type" + index];
  5971. node.need.text = cfg[index].need;
  5972. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  5973. node.peopleTxt.text = this.getRandPeople(index - 1);
  5974. }
  5975. }
  5976. enterGame(type) {
  5977. xGame.common.classicRoomType = type;
  5978. let cfg = cfgTable.modeselectData[type];
  5979. let need = cfg.need;
  5980. xGame.common.passAwardCoin = cfg.award;
  5981. if (DataMgr.coinEnough(need)) {
  5982. DataMgr.setCoin(-need);
  5983. this.ui.myNode["type" + type].t0.play();
  5984. Laya.timer.once(200, this, () => {
  5985. this.callback && this.callback();
  5986. });
  5987. }
  5988. else {
  5989. Moyu.sendDataEvent("AddCoinVideo");
  5990. xGame.uiMgr.Show(UIAddProp, 0);
  5991. }
  5992. }
  5993. getRandPeople(index) {
  5994. let rand = this.peopleOffest[index];
  5995. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  5996. }
  5997. }
  5998. UIModeSelection.uiName = "UIModeSelection";
  5999. class UIMain extends UIBase {
  6000. constructor() {
  6001. super();
  6002. this.firstEnter = true;
  6003. }
  6004. onConstructor() {
  6005. this.ui = ui_UIMain.createInstance();
  6006. this.contentPane = this.ui;
  6007. this.isEject = false;
  6008. this.addEvent();
  6009. this.addClickSpine();
  6010. this.settingNode = new SettingNode(this.ui.settingNode);
  6011. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6012. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  6013. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  6014. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  6015. let curUse = DataMgr.getCurSecretary();
  6016. this.changeSecretary(curUse);
  6017. this.ui.talkNode.visible = false;
  6018. let guide = DataMgr.getSkillGuide();
  6019. if (xGame.common.isNewDay && guide == 1) {
  6020. xGame.common.isNewDay = false;
  6021. xGame.soundMgr.playSound("s_main01");
  6022. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6023. console.log("播放小秘书每天语音");
  6024. }
  6025. this.onGetUserInfo();
  6026. this.ui.n83.visible = false;
  6027. Moyu.setShareInfo("8Ball Fury", ["台球", "万宁", "桌球"], '2300002254');
  6028. }
  6029. changeSecretary(curUse) {
  6030. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  6031. xGame.common.secretary && xGame.common.secretary.dispose();
  6032. this.addSecretarySpine(name);
  6033. }
  6034. addSecretarySpine(name) {
  6035. let spine = new SpineMgr(name, () => {
  6036. this.playSecretaryIdle();
  6037. });
  6038. xGame.common.secretary = spine;
  6039. }
  6040. addClickSpine() {
  6041. let clickSpine = new SpineMgr("dianji", () => {
  6042. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  6043. let parent = Laya.stage;
  6044. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  6045. clickSpine.play(data, 0, false, parent, (spine) => {
  6046. spine.destroy(true);
  6047. });
  6048. });
  6049. });
  6050. }
  6051. addEvent() {
  6052. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  6053. this.addUIClick(this.ui.bigMoveBtn, 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, "敬请期待~");
  6181. }
  6182. startWeekly() {
  6183. xGame.uiMgr.Show(UIMsg, "敬请期待~");
  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 ? `打进场上所有球` : `打进${cfg.ball}颗球`;
  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 = "杆数:" + this.curHP;
  7198. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  7199. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  7200. challenge.tipsTxt.text = `打进${this.needBalls}颗球`;
  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. this.ui.topNode.aiHeadLoader.url = baseHeadUrl + aiData.icon;
  9390. }
  9391. }
  9392. initD2world() {
  9393. let node = this.ui.d2Root.displayObject;
  9394. let src = node.getComponent(D2World);
  9395. if (!src) {
  9396. xGame.common.d2World = node.addComponent(D2World);
  9397. }
  9398. xGame.common.d2World.initSelf();
  9399. }
  9400. initD3world() {
  9401. if (this.isD3Inited)
  9402. return;
  9403. this.isD3Inited = true;
  9404. let scene3D = xGame.common.d3Scene;
  9405. this.ui.d3Root.displayObject.addChild(scene3D);
  9406. scene3D.active = true;
  9407. xGame.common.d3World.tableSrc.setBorderPos();
  9408. }
  9409. onRootMove(e) {
  9410. let rootBall = xGame.common.d2World.rootBall;
  9411. this.ui.moveNode.x = e.x;
  9412. this.ui.moveNode.y = e.y;
  9413. rootBall.gameObj.x = e.x;
  9414. rootBall.gameObj.y = e.y;
  9415. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  9416. }
  9417. aiRootMove(move) {
  9418. if (move)
  9419. this.hideBallUI();
  9420. else {
  9421. this.showBallUI();
  9422. xGame.common.d2World.getHelpLine();
  9423. }
  9424. }
  9425. aiForce(type, force = 0) {
  9426. this.pressTarget = PressType.powerNode;
  9427. if (type == 1)
  9428. this.onEventUp({ force: true });
  9429. else if (type == 2)
  9430. this.onEventMove({ stageY: force, force: true });
  9431. }
  9432. onEventPress(e) {
  9433. if (e.stopPropagation)
  9434. e.stopPropagation();
  9435. if (!this.isTurnSelf())
  9436. return;
  9437. let target = e.target;
  9438. switch (target) {
  9439. case this.ui.myPowerNode.displayObject:
  9440. this.pressTarget = PressType.powerNode;
  9441. this.barInfo.curY = e.stageY;
  9442. this.updateBarInfo();
  9443. break;
  9444. case this.ui.moveNode.displayObject:
  9445. this.pressTarget = PressType.moveNode;
  9446. this.hideBallUI();
  9447. this.eventObj.curX = this.ui.moveNode.x;
  9448. this.eventObj.curY = this.ui.moveNode.y;
  9449. this.ui.moveNode.finger.visible = false;
  9450. this.eventObj.lastX = e.stageX;
  9451. this.eventObj.lastY = e.stageY;
  9452. break;
  9453. case this.ui.rulerClickNode.displayObject:
  9454. this.pressTarget = PressType.rulerNode;
  9455. this.eventObj.lastY = e.stageY;
  9456. break;
  9457. case this.ui.d2Root.displayObject:
  9458. this.pressTarget = PressType.d2Root;
  9459. this.eventObj.lastX = e.stageX;
  9460. this.eventObj.lastY = e.stageY;
  9461. this.eventObj.starX = e.stageX;
  9462. this.eventObj.starY = e.stageY;
  9463. this.eventObj.curX = 0;
  9464. this.eventObj.curY = 0;
  9465. xGame.common.d2World.d2Gan.setGanLastInfo();
  9466. this.rulerOffset = 0;
  9467. break;
  9468. default:
  9469. break;
  9470. }
  9471. }
  9472. onEventMove(e) {
  9473. if (e.stopPropagation)
  9474. e.stopPropagation();
  9475. if (e && e.force) {
  9476. }
  9477. else {
  9478. if (!this.isTurnSelf())
  9479. return;
  9480. }
  9481. switch (this.pressTarget) {
  9482. case PressType.powerNode:
  9483. this.barInfo.curY = e.stageY;
  9484. this.updateBarInfo();
  9485. this.isMoveRod = true;
  9486. break;
  9487. case PressType.moveNode:
  9488. let rootBall = xGame.common.d2World.rootBall;
  9489. let radius = rootBall.gameObj.width / 2;
  9490. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  9491. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  9492. let border = xGame.common.d2World.borderRect;
  9493. if (curX <= border.x + radius)
  9494. curX = border.x + radius;
  9495. else if (curX >= border.x + border.width - radius)
  9496. curX = border.x + border.width - radius;
  9497. if (curY <= border.y + radius)
  9498. curY = border.y + radius;
  9499. else if (curY >= border.y + border.height - radius)
  9500. curY = border.y + border.height - radius;
  9501. if (xGame.common.gameMgr.isOpenBall) {
  9502. if (curX >= border.x + border.openBallW - radius)
  9503. curX = border.x + border.openBallW - radius;
  9504. }
  9505. this.ui.moveNode.x = curX;
  9506. this.ui.moveNode.y = curY;
  9507. rootBall.gameObj.x = curX;
  9508. rootBall.gameObj.y = curY;
  9509. rootBall.d3BallSrc.setTransPos(curX, curY);
  9510. this.isMoveRod = true;
  9511. break;
  9512. case PressType.rulerNode:
  9513. let yy = e.stageY - this.eventObj.lastY;
  9514. this.eventObj.lastY = e.stageY;
  9515. let ruler1 = this.ui.rulerNode.img1;
  9516. let ruler2 = this.ui.rulerNode.img2;
  9517. ruler1.y += yy;
  9518. ruler2.y += yy;
  9519. this.rulerOffset += yy;
  9520. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  9521. this.rulerOffset = 0;
  9522. xGame.soundMgr.playSound("inch", 1, 10);
  9523. }
  9524. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  9525. let h = ruler1.height;
  9526. this.checkGuide();
  9527. this.isMoveRod = true;
  9528. if (ruler1.y >= h) {
  9529. ruler1.y = -h;
  9530. ruler2.y = 0;
  9531. return;
  9532. }
  9533. else if (ruler1.y <= -h) {
  9534. ruler1.y = h;
  9535. ruler2.y = 0;
  9536. return;
  9537. }
  9538. if (ruler2.y >= h) {
  9539. ruler2.y = -h;
  9540. ruler1.y = 0;
  9541. return;
  9542. }
  9543. else if (ruler2.y <= -h) {
  9544. ruler2.y = h;
  9545. ruler1.y = 0;
  9546. return;
  9547. }
  9548. break;
  9549. case PressType.d2Root:
  9550. this.eventObj.curX = e.stageX;
  9551. this.eventObj.curY = e.stageY;
  9552. let offset = this.checkRodMoveDir();
  9553. xGame.common.d2World.d2Gan.rotateSelf(offset);
  9554. this.eventObj.lastX = e.stageX;
  9555. this.eventObj.lastY = e.stageY;
  9556. break;
  9557. default:
  9558. break;
  9559. }
  9560. }
  9561. onEventUp(e) {
  9562. if (e.stopPropagation)
  9563. e.stopPropagation();
  9564. if (e && e.force) {
  9565. }
  9566. else {
  9567. if (!this.isTurnSelf())
  9568. return;
  9569. }
  9570. switch (this.pressTarget) {
  9571. case PressType.powerNode:
  9572. this.ui.powerNode.value = 0;
  9573. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  9574. this.ui.powerTxt.text = "";
  9575. if (this.powerNum > 0) {
  9576. xGame.eventMgr.event(BALL_SHOOT);
  9577. xGame.common.d2World.shoot(this.powerNum);
  9578. xGame.common.d2World.d2Gan.shoot();
  9579. xGame.common.d2World.d2HelpLine.shoot();
  9580. this.finishGuide();
  9581. this.ui.powerEft.visible = false;
  9582. this.ui.colorNode.visible = false;
  9583. let ganStr = "";
  9584. if (this.powerNum <= 30) {
  9585. ganStr = "gan_30";
  9586. }
  9587. else if (this.powerNum <= 60) {
  9588. ganStr = "gan_50";
  9589. }
  9590. else {
  9591. ganStr = "gan_80";
  9592. }
  9593. xGame.soundMgr.playSound(ganStr);
  9594. }
  9595. break;
  9596. case PressType.moveNode:
  9597. let rootBall = xGame.common.d2World.rootBall;
  9598. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  9599. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  9600. let isIntersect = this.judgeBallIntersect();
  9601. if (isIntersect) {
  9602. this.ui.moveNode.x = lastX;
  9603. this.ui.moveNode.y = lastY;
  9604. rootBall.gameObj.x = lastX;
  9605. rootBall.gameObj.y = lastY;
  9606. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  9607. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  9608. }
  9609. else {
  9610. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  9611. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  9612. }
  9613. this.showBallUI();
  9614. this.ui.moveNode.finger.visible = true;
  9615. xGame.common.d2World.getHelpLine();
  9616. break;
  9617. case PressType.rulerNode:
  9618. break;
  9619. case PressType.d2Root:
  9620. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  9621. if (dis <= 25) {
  9622. this.moveToClickDot(e);
  9623. }
  9624. break;
  9625. default:
  9626. break;
  9627. }
  9628. this.pressTarget = -1;
  9629. }
  9630. checkGuide() {
  9631. let guide = DataMgr.getSkillGuide();
  9632. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  9633. xGame.common.guideStep++;
  9634. xGame.common.gameUI.ui.guide2.visible = false;
  9635. xGame.common.gameUI.ui.guide3.visible = true;
  9636. }
  9637. }
  9638. finishGuide() {
  9639. let guide = DataMgr.getSkillGuide();
  9640. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  9641. xGame.common.guideStep = 10;
  9642. this.closeAllGuide();
  9643. }
  9644. }
  9645. closeAllGuide() {
  9646. xGame.common.gameUI.ui.guide1.visible = false;
  9647. xGame.common.gameUI.ui.guide2.visible = false;
  9648. xGame.common.gameUI.ui.guide3.visible = false;
  9649. }
  9650. updateBarInfo() {
  9651. let star = this.ui.powerNode.y;
  9652. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  9653. if (rate >= 1)
  9654. rate = 1;
  9655. if (rate <= 0)
  9656. rate = 0;
  9657. this.powerNum = Math.ceil(rate * 100);
  9658. this.ui.powerNode.value = this.powerNum;
  9659. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  9660. this.ui.colorNode.value = this.powerNum;
  9661. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  9662. this.ui.powerEft.visible = this.powerNum != 0;
  9663. this.ui.colorNode.visible = this.powerNum != 0;
  9664. this.ui.powerTxt.text = this.powerNum + "";
  9665. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  9666. }
  9667. forceCancel() {
  9668. this.ui.powerNode.value = 0;
  9669. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  9670. this.ui.powerTxt.text = "";
  9671. }
  9672. checkRodMoveDir() {
  9673. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  9674. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  9675. if (tempX >= 0 && tempY <= 0) {
  9676. return this.checkDir();
  9677. }
  9678. else if (tempX < 0 && tempY < 0) {
  9679. return this.checkDir(1, -1);
  9680. }
  9681. else if (tempX < 0 && tempY > 0) {
  9682. return this.checkDir(-1, -1);
  9683. }
  9684. else {
  9685. return this.checkDir(-1, 1);
  9686. }
  9687. }
  9688. checkDir(flagX = 1, flagY = 1) {
  9689. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  9690. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  9691. if (offsetY == 0) {
  9692. return offsetX * flagX;
  9693. }
  9694. if (offsetX == 0) {
  9695. return offsetY * flagY;
  9696. }
  9697. let angle = offsetY / offsetX;
  9698. if (Math.abs(angle) >= 1) {
  9699. return offsetY * flagY;
  9700. }
  9701. else {
  9702. return offsetX * flagX;
  9703. }
  9704. }
  9705. judgeBallIntersect() {
  9706. let rootBall = xGame.common.d2World.rootBall;
  9707. let ballArr = xGame.common.d2World.ballArr;
  9708. let radius = rootBall.gameObj.width / 2;
  9709. let temp;
  9710. let isIntersect = false;
  9711. for (let index = 0; index < ballArr.length; index++) {
  9712. temp = ballArr[index];
  9713. if (temp.number == rootBall.number)
  9714. continue;
  9715. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  9716. if (isIntersect) {
  9717. break;
  9718. }
  9719. }
  9720. return isIntersect;
  9721. }
  9722. hideBallUI() {
  9723. let d2Gan = xGame.common.d2World.d2Gan;
  9724. if (!d2Gan.ui.isDisposed)
  9725. d2Gan.ui.visible = false;
  9726. let d2Help = xGame.common.d2World.d2HelpLine;
  9727. if (!d2Help.ui.isDisposed)
  9728. d2Help.ui.visible = false;
  9729. let rootBall = xGame.common.d2World.rootBall;
  9730. if (!rootBall.destroyed) {
  9731. rootBall.gameObj.active = false;
  9732. }
  9733. }
  9734. showBallUI() {
  9735. let d2Gan = xGame.common.d2World.d2Gan;
  9736. if (!d2Gan.ui.isDisposed)
  9737. d2Gan.ui.visible = true;
  9738. let d2Help = xGame.common.d2World.d2HelpLine;
  9739. if (!d2Help.ui.isDisposed)
  9740. d2Help.ui.visible = true;
  9741. let rootBall = xGame.common.d2World.rootBall;
  9742. if (!rootBall.destroyed) {
  9743. rootBall.gameObj.active = true;
  9744. }
  9745. }
  9746. moveToClickDot(e) {
  9747. if (!this.isMoveRod && !xGame.common.clickedBall) {
  9748. let root = xGame.common.d2World.rootBall.gameObj;
  9749. let xx = e.stageX - xGame.common.sysOffestNum;
  9750. let yy = e.stageY;
  9751. let x = xx - root.x;
  9752. let y = yy - root.y;
  9753. let angle = xGame.common.getfguiRotation(x, y);
  9754. xGame.common.d2World.d2Gan.ui.rotation = angle;
  9755. xGame.common.d2World.getHelpLine();
  9756. }
  9757. this.isMoveRod = false;
  9758. xGame.common.clickedBall = false;
  9759. }
  9760. openAllEvent() {
  9761. this.closeAllEvent();
  9762. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9763. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9764. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9765. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9766. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  9767. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  9768. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  9769. }
  9770. closeAllEvent() {
  9771. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9772. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9773. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9774. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9775. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  9776. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  9777. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  9778. }
  9779. resetGame() {
  9780. this.closeAllEvent();
  9781. this.hideBallUI();
  9782. xGame.common.gameMgr.gamePause = true;
  9783. }
  9784. }
  9785. UIGame.uiName = "UIGame";
  9786. class UIAddProp extends UIBase {
  9787. constructor() {
  9788. super();
  9789. this.curType = "";
  9790. }
  9791. onConstructor() {
  9792. this.ui = ui_UIAddProp.createInstance();
  9793. this.contentPane = this.ui;
  9794. this.isEject = false;
  9795. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  9796. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  9797. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  9798. this.updateUI();
  9799. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  9800. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  9801. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  9802. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  9803. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  9804. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  9805. }
  9806. show(type) {
  9807. super.show();
  9808. this.curType = type == 0 ? "coin" : "diamond";
  9809. this.switchBtn("");
  9810. this.ui.t0.play();
  9811. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  9812. PlatMgr.showInsert(true);
  9813. }
  9814. closeSelf() {
  9815. this.hide();
  9816. }
  9817. updateUI() {
  9818. let data = cfgTable.moneyData;
  9819. let temp;
  9820. let obj;
  9821. for (const key in data) {
  9822. temp = data[key];
  9823. obj = this.ui.myNode["node" + key];
  9824. if (parseInt(key) <= 2) {
  9825. obj.diamondTxt.text = "+" + temp.num;
  9826. }
  9827. else {
  9828. obj.coinTxt.text = temp.num;
  9829. obj.diamondTxt.text = temp.get.split('_')[1];
  9830. }
  9831. }
  9832. this.updateDiamondShare();
  9833. }
  9834. updateDiamondShare() {
  9835. let data = DataMgr.getShareDiamondTimes();
  9836. if (data >= xGame.common.maxShareDiamondTimes) {
  9837. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  9838. this.ui.myNode.node1.touchable = false;
  9839. }
  9840. else {
  9841. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  9842. this.ui.myNode.node1.touchable = true;
  9843. }
  9844. }
  9845. switchBtn(type) {
  9846. if (type == "")
  9847. type = this.curType;
  9848. else {
  9849. if (this.curType == type) {
  9850. return;
  9851. }
  9852. else {
  9853. this.curType = type;
  9854. }
  9855. }
  9856. if (type == "coin") {
  9857. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  9858. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  9859. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  9860. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  9861. this.ui.myNode.c1.selectedIndex = 0;
  9862. }
  9863. else {
  9864. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  9865. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  9866. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  9867. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  9868. this.ui.myNode.c1.selectedIndex = 1;
  9869. }
  9870. }
  9871. convertCoin(index) {
  9872. let data = cfgTable.moneyData[index];
  9873. let coinNum = data.num;
  9874. let str = data.get.split('_')[1];
  9875. let needDiamond = parseInt(str);
  9876. if (DataMgr.diamondEnough(needDiamond)) {
  9877. DataMgr.setDiamond(-needDiamond);
  9878. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  9879. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  9880. }
  9881. else {
  9882. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  9883. this.switchBtn("diamond");
  9884. }
  9885. }
  9886. videoGetDiamond() {
  9887. let num = cfgTable.moneyData[2].num;
  9888. Moyu.showVideoAd(() => {
  9889. xGame.common.playObjFlyAnim(num, Prop.diamond);
  9890. this.closeSelf();
  9891. }, EAdType.addDiamond);
  9892. }
  9893. videoGetCoin() {
  9894. Moyu.showVideoAd(() => {
  9895. xGame.common.playObjFlyAnim(2000, Prop.coin);
  9896. this.closeSelf();
  9897. }, EAdType.addCoin);
  9898. }
  9899. shareGetDiamond() {
  9900. let times = DataMgr.getShareDiamondTimes();
  9901. if (times >= xGame.common.maxShareDiamondTimes) {
  9902. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  9903. }
  9904. else {
  9905. if (Moyu.isTT) {
  9906. let num = cfgTable.moneyData[1].num;
  9907. Moyu.shareVideo = '';
  9908. Moyu.shareGame((success) => {
  9909. if (success) {
  9910. xGame.uiMgr.Show(UIMsg, "分享成功!");
  9911. xGame.common.playObjFlyAnim(num, Prop.diamond);
  9912. DataMgr.setShareDiamondTimes(1);
  9913. this.updateDiamondShare();
  9914. }
  9915. else {
  9916. xGame.uiMgr.Show(UIMsg, "分享失败!");
  9917. }
  9918. });
  9919. }
  9920. else {
  9921. Moyu.showVideoAd(() => {
  9922. let diamond = xGame.common.randomNum(50, 100);
  9923. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  9924. DataMgr.setShareDiamondTimes(1);
  9925. this.updateDiamondShare();
  9926. }, EAdType.randomDiamond);
  9927. }
  9928. }
  9929. }
  9930. openPutBallView() {
  9931. let end = xGame.uiMgr.getUI(UIGameEnd);
  9932. let skill = xGame.uiMgr.getUI(UISkill);
  9933. let level = xGame.uiMgr.getUI(UILevelDisplay);
  9934. let uigame = xGame.uiMgr.getUI(UIGame);
  9935. if (end && !end.isHide) {
  9936. xGame.uiMgr.Hide(UIGameEnd);
  9937. xGame.uiMgr.Show(UIMain);
  9938. }
  9939. if (skill && !skill.isHide)
  9940. xGame.uiMgr.Hide(UISkill);
  9941. if (uigame && !uigame.isHide)
  9942. xGame.uiMgr.Hide(UIGame);
  9943. if (level && !level.isHide) {
  9944. }
  9945. else {
  9946. xGame.uiMgr.Show(UILevelDisplay);
  9947. }
  9948. this.closeSelf();
  9949. }
  9950. }
  9951. UIAddProp.uiName = "UIAddProp";
  9952. class MoneyNode {
  9953. constructor(ui) {
  9954. this.leftTime = 0;
  9955. this.ui = ui;
  9956. this.ui.addCoinBtn.onClick(this, this.addCoin);
  9957. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  9958. this.ui.addPowerBtn.onClick(this, this.addPower);
  9959. this.ui.c1.selectedIndex = 1;
  9960. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  9961. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  9962. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  9963. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  9964. this.coinChange();
  9965. this.diamondChange();
  9966. this.powerChange();
  9967. }
  9968. addPower() {
  9969. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9970. xGame.uiMgr.Show(UIPower);
  9971. }
  9972. powerChange() {
  9973. let powerNum = DataMgr.getPower();
  9974. this.ui.powerTxt.text = powerNum + "";
  9975. }
  9976. checkPowerTime() {
  9977. let cur = new Date().getTime();
  9978. let last = DataMgr.getPowerTime();
  9979. if (last == 0) {
  9980. last = cur;
  9981. DataMgr.setPowerTime(cur);
  9982. }
  9983. let power = DataMgr.getPower();
  9984. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  9985. Laya.timer.clearAll(this);
  9986. if (power >= xGame.common.natureMaxPower) {
  9987. this.ui.powerTimeTxt.text = "";
  9988. DataMgr.setPowerTime(cur);
  9989. return;
  9990. }
  9991. if (power + offset >= xGame.common.natureMaxPower) {
  9992. DataMgr.setPower(xGame.common.natureMaxPower, false);
  9993. this.ui.powerTimeTxt.text = "";
  9994. DataMgr.setPowerTime(cur);
  9995. }
  9996. else {
  9997. if (offset > 0) {
  9998. DataMgr.setPower(offset);
  9999. DataMgr.setPowerTime(cur);
  10000. }
  10001. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  10002. this.leftTime = xGame.common.powerRecoverNum - time;
  10003. if (this.leftTime <= 0)
  10004. this.leftTime = 0;
  10005. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10006. Laya.timer.loop(1000, this, this.updatePowerTime);
  10007. }
  10008. }
  10009. updatePowerTime() {
  10010. this.leftTime -= 1;
  10011. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10012. if (this.leftTime <= 0) {
  10013. this.checkPowerTime();
  10014. }
  10015. }
  10016. coinChange() {
  10017. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  10018. }
  10019. diamondChange() {
  10020. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  10021. }
  10022. addCoin() {
  10023. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10024. Moyu.sendDataEvent("AddCoinBtn");
  10025. xGame.uiMgr.Show(UIAddProp, 0);
  10026. }
  10027. addDiamond() {
  10028. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10029. Moyu.sendDataEvent("AddDiamondBtn");
  10030. xGame.uiMgr.Show(UIAddProp, 1);
  10031. }
  10032. }
  10033. class UIDraw extends UIBase {
  10034. constructor() {
  10035. super();
  10036. this.curKey = 0;
  10037. }
  10038. onConstructor() {
  10039. this.ui = ui_UIDraw.createInstance();
  10040. this.contentPane = this.ui;
  10041. this.isEject = false;
  10042. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  10043. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  10044. this.addUIClick(this.ui.drawBtn, this.startDraw);
  10045. this.initDraw();
  10046. this.initUI();
  10047. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  10048. if (Moyu.isKs)
  10049. this.ui.closeNode.closeBtn.x += 100;
  10050. }
  10051. show() {
  10052. super.show();
  10053. this.ui.t0.play();
  10054. this.playSecretaryIdle();
  10055. this.updateDraw();
  10056. this.checkFree();
  10057. if (PlatMgr.bannerDelay > 0) {
  10058. this.ui.closeNode.closeBtn.visible = false;
  10059. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  10060. this.ui.closeNode.closeBtn.visible = true;
  10061. });
  10062. }
  10063. PlatMgr.showRateBanner();
  10064. }
  10065. hide() {
  10066. Laya.timer.clearAll(this);
  10067. super.hide();
  10068. }
  10069. checkFree() {
  10070. let isFree = DataMgr.getDailyfreeDrawTimes();
  10071. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  10072. }
  10073. initDraw() {
  10074. this.drawObj = [];
  10075. let data = cfgTable.drawData;
  10076. let temp;
  10077. let weight = 0;
  10078. for (const key in data) {
  10079. temp = data[key];
  10080. weight += temp.weight;
  10081. this.drawObj.push(weight);
  10082. }
  10083. this.allWeight = weight;
  10084. }
  10085. initUI() {
  10086. let data = cfgTable.drawData;
  10087. let temp;
  10088. let img;
  10089. let txt;
  10090. for (const key in data) {
  10091. temp = data[key];
  10092. img = this.ui.myNode.rotNode["img" + key];
  10093. txt = this.ui.myNode.rotNode["txt" + key];
  10094. img.url = xGame.common.getGameIconUrl(temp.icon);
  10095. txt.visible = true;
  10096. if (temp.award > 2) {
  10097. img.rotation = 0;
  10098. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  10099. }
  10100. else {
  10101. img.rotation = temp.rotation;
  10102. txt.text = temp.num;
  10103. }
  10104. }
  10105. }
  10106. getCurkey() {
  10107. let rand = Math.random() * this.allWeight;
  10108. let temp;
  10109. for (let index = 0; index < this.drawObj.length - 1; index++) {
  10110. temp = this.drawObj[index];
  10111. if (index == 0) {
  10112. if (rand < temp) {
  10113. return index + 1;
  10114. }
  10115. }
  10116. else {
  10117. if (rand >= temp && rand < this.drawObj[index + 1]) {
  10118. return index + 1;
  10119. }
  10120. }
  10121. }
  10122. return 2;
  10123. }
  10124. startDraw() {
  10125. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  10126. if (freeTimes > 0) {
  10127. this.beginDraw();
  10128. DataMgr.setDailyfreeDrawTimes(0);
  10129. this.checkFree();
  10130. }
  10131. else {
  10132. Moyu.sendDataEvent("turntable");
  10133. Moyu.showVideoAd(() => {
  10134. this.beginDraw();
  10135. }, EAdType.draw);
  10136. }
  10137. }
  10138. beginDraw() {
  10139. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  10140. this.ui.drawBtn.touchable = false;
  10141. this.curKey = this.getCurkey();
  10142. console.log("当前key", this.curKey);
  10143. let cell = 60;
  10144. let lap = 3;
  10145. let angle = cell * (this.curKey - 1) + lap * 360;
  10146. let target = this.ui.myNode.rotNode;
  10147. target.rotation = 0;
  10148. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  10149. console.log("旋转完成");
  10150. this.ui.drawBtn.touchable = true;
  10151. this.getAward();
  10152. }));
  10153. }
  10154. getAward() {
  10155. let data = cfgTable.drawData[this.curKey];
  10156. let temp = new AwardType();
  10157. temp.type = data.award;
  10158. temp.num = data.num;
  10159. xGame.common.getAward([temp], () => {
  10160. DataMgr.setDrawTimes(1);
  10161. this.updateDraw();
  10162. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  10163. });
  10164. }
  10165. updateDraw() {
  10166. let drawTimes = DataMgr.getDrawTimes();
  10167. let awardTimes = DataMgr.getDrawAwardTimes();
  10168. if (Math.floor(drawTimes / 3) > awardTimes) {
  10169. this.ui.extraNode.boxBtn.t0.play(null, -1);
  10170. this.ui.extraNode.boxBtn.touchable = true;
  10171. this.ui.extraNode.tipsTxt.text = "3/3";
  10172. this.ui.extraNode.barNode.width = 265;
  10173. this.getExtraAward();
  10174. }
  10175. else {
  10176. this.ui.extraNode.boxBtn.t0.stop();
  10177. this.ui.extraNode.boxBtn.touchable = false;
  10178. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  10179. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  10180. }
  10181. let data = cfgTable.drawData[1];
  10182. if (awardTimes == 0) {
  10183. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  10184. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  10185. this.ui.myNode.rotNode.img1.rotation = 0;
  10186. }
  10187. else {
  10188. let award = data.nextid;
  10189. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  10190. this.ui.myNode.rotNode.txt1.text = award[1];
  10191. this.ui.myNode.rotNode.img1.rotation = 0;
  10192. }
  10193. }
  10194. getExtraAward() {
  10195. let drawTimes = DataMgr.getDrawTimes();
  10196. let awardTimes = DataMgr.getDrawAwardTimes();
  10197. let data = cfgTable.drawData[1];
  10198. let award = new AwardType();
  10199. if (awardTimes == 0) {
  10200. award.num = data.num;
  10201. award.type = data.award;
  10202. xGame.common.getAward([award], () => {
  10203. let all = Math.floor(drawTimes / 3);
  10204. DataMgr.setDrawAwardTimes(all);
  10205. this.updateDraw();
  10206. });
  10207. }
  10208. else {
  10209. award.num = parseInt(data.nextid[1]);
  10210. award.type = parseInt(data.nextid[0]);
  10211. xGame.common.getAward([award], () => {
  10212. let all = Math.floor(drawTimes / 3);
  10213. DataMgr.setDrawAwardTimes(all);
  10214. this.updateDraw();
  10215. });
  10216. }
  10217. }
  10218. closeSelf() {
  10219. this.hide();
  10220. }
  10221. playSecretaryIdle() {
  10222. let parent = this.ui.secretary.displayObject;
  10223. parent.destroyChildren();
  10224. let xx = this.ui.secretary.width / 2;
  10225. let yy = this.ui.secretary.height;
  10226. let scale = xGame.common.getSecretaryScale();
  10227. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  10228. xGame.common.secretary.play(data, 1, true, parent);
  10229. }
  10230. }
  10231. UIDraw.uiName = "UIDraw";
  10232. class ui_UIFlyEft extends fgui.GComponent {
  10233. static createInstance() {
  10234. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  10235. }
  10236. onConstruct() {
  10237. this.n0 = (this.getChild("n0"));
  10238. this.n1 = (this.getChild("n1"));
  10239. this.n2 = (this.getChild("n2"));
  10240. this.n3 = (this.getChild("n3"));
  10241. this.n4 = (this.getChild("n4"));
  10242. this.n5 = (this.getChild("n5"));
  10243. this.n6 = (this.getChild("n6"));
  10244. this.n7 = (this.getChild("n7"));
  10245. this.iconNode = (this.getChild("iconNode"));
  10246. this.txt = (this.getChild("txt"));
  10247. this.txtNode = (this.getChild("txtNode"));
  10248. }
  10249. }
  10250. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  10251. class UIFlyEft extends UIBase {
  10252. constructor() {
  10253. super();
  10254. this.max = 8;
  10255. this.delay = 0;
  10256. }
  10257. onConstructor() {
  10258. this.ui = ui_UIFlyEft.createInstance();
  10259. this.contentPane = this.ui;
  10260. this.isEject = false;
  10261. this.isMuti = true;
  10262. this.ui.x += xGame.common.sysOffestNum;
  10263. }
  10264. getArrPos() {
  10265. if (this.iconPos && this.iconPos.length > 0)
  10266. return;
  10267. this.iconPos = [];
  10268. let temp;
  10269. for (let index = 0; index < this.max; index++) {
  10270. temp = this.ui["n" + index];
  10271. this.iconPos.push([temp.x, temp.y]);
  10272. }
  10273. }
  10274. show(stPos, edPos, num, type, callback) {
  10275. super.show();
  10276. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  10277. this.getArrPos();
  10278. this.updateUI(type);
  10279. this.updatePos();
  10280. this.runFly(edPos, callback);
  10281. this.runWorlds(stPos, num);
  10282. }
  10283. updateUI(type) {
  10284. let temp;
  10285. let str;
  10286. for (let index = 0; index < this.max; index++) {
  10287. temp = this.ui["n" + index];
  10288. str = this.getIconStr(type);
  10289. temp.url = xGame.common.getGameIconUrl(str);
  10290. }
  10291. }
  10292. getIconStr(type) {
  10293. switch (type) {
  10294. case Prop.diamond:
  10295. return "ty_zs";
  10296. case Prop.coin:
  10297. return "ty_jb";
  10298. default:
  10299. break;
  10300. }
  10301. }
  10302. updatePos() {
  10303. let temp;
  10304. for (let index = 0; index < this.max; index++) {
  10305. temp = this.ui["n" + index];
  10306. temp.x = this.iconPos[index][0];
  10307. temp.y = this.iconPos[index][1];
  10308. }
  10309. }
  10310. runFly(endPos, callback) {
  10311. let all = 0;
  10312. let temp;
  10313. for (let index = 0; index < this.max; index++) {
  10314. temp = this.ui["n" + index];
  10315. temp.visible = true;
  10316. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  10317. temp.visible = false;
  10318. all++;
  10319. if (all >= this.max) {
  10320. callback && callback();
  10321. }
  10322. }), 20 * index);
  10323. }
  10324. }
  10325. runWorlds(stPos, num) {
  10326. let str = "+" + num;
  10327. this.ui.txt.text = str;
  10328. let starX = stPos.x;
  10329. let starY = stPos.y + 50;
  10330. this.ui.txt.x = starX;
  10331. this.ui.txt.y = starY;
  10332. this.ui.txt.visible = true;
  10333. this.ui.txt.alpha = 1;
  10334. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  10335. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  10336. this.ui.txt.visible = false;
  10337. this.hide();
  10338. }));
  10339. }));
  10340. }
  10341. }
  10342. UIFlyEft.uiName = "UIFlyEft";
  10343. class ui_UIGetAward extends fgui.GComponent {
  10344. static createInstance() {
  10345. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  10346. }
  10347. onConstruct() {
  10348. this.n4 = (this.getChild("n4"));
  10349. this.n0 = (this.getChild("n0"));
  10350. this.myList = (this.getChild("myList"));
  10351. this.n1 = (this.getChild("n1"));
  10352. this.eftNode = (this.getChild("eftNode"));
  10353. this.btnNode = (this.getChild("btnNode"));
  10354. this.t0 = this.getTransition("t0");
  10355. }
  10356. }
  10357. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  10358. class UIGetAward extends UIBase {
  10359. constructor() {
  10360. super();
  10361. this.showTriple = true;
  10362. }
  10363. onConstructor() {
  10364. this.ui = ui_UIGetAward.createInstance();
  10365. this.contentPane = this.ui;
  10366. this.isEject = false;
  10367. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  10368. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  10369. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  10370. }
  10371. show(arr, showTriple, callback) {
  10372. super.show();
  10373. this.ui.t0.play();
  10374. this.ui.eftNode.visible = true;
  10375. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  10376. this.ui.eftNode.visible = false;
  10377. }), 1, 0, 0, 0.9);
  10378. this.awardArr = arr;
  10379. this.showTriple = showTriple;
  10380. this.callback = callback;
  10381. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  10382. this.ui.myList.numItems = arr.length;
  10383. xGame.soundMgr.playSound("getaward");
  10384. }
  10385. updateSelf(index, obj) {
  10386. let temp = this.awardArr[index];
  10387. let icon = this.getIcon(temp.type);
  10388. let str = icon;
  10389. if (temp.type > 2) {
  10390. str = "s" + icon;
  10391. }
  10392. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  10393. obj.myIcon.rotation = 0;
  10394. obj.numTxt.text = temp.num + "";
  10395. obj.numTxt.visible = temp.type > 2 ? false : true;
  10396. obj.nameTxt.text = this.getNameStr(temp.type);
  10397. }
  10398. renderItem(index, obj) {
  10399. this.updateSelf(index, obj);
  10400. }
  10401. tripleGetAward() {
  10402. Moyu.showVideoAd(() => {
  10403. this.getAward(3);
  10404. }, EAdType.triple);
  10405. }
  10406. normalGetAward() {
  10407. if (PlatMgr.isMisVideo())
  10408. this.tripleGetAward();
  10409. else
  10410. this.getAward();
  10411. }
  10412. getAward(times = 1) {
  10413. this.hide();
  10414. for (let index = 0; index < this.awardArr.length; index++) {
  10415. this.awardArr[index].num *= times;
  10416. }
  10417. this.callback && this.callback(times != 1);
  10418. }
  10419. getIcon(type) {
  10420. switch (type) {
  10421. case Prop.diamond:
  10422. return "ty_zs";
  10423. case Prop.coin:
  10424. return "ty_jb";
  10425. case Prop.gan1:
  10426. return "qg1";
  10427. case Prop.gan2:
  10428. return "qg2";
  10429. case Prop.gan3:
  10430. return "qg3";
  10431. case Prop.gan4:
  10432. return "qg4";
  10433. default:
  10434. break;
  10435. }
  10436. }
  10437. getNameStr(type) {
  10438. switch (type) {
  10439. case Prop.diamond:
  10440. return "Diamond";
  10441. case Prop.coin:
  10442. return "Coins";
  10443. case Prop.gan1:
  10444. case Prop.gan2:
  10445. case Prop.gan3:
  10446. case Prop.gan4:
  10447. return cfgTable.ballrodData[type - 1].name;
  10448. default:
  10449. break;
  10450. }
  10451. }
  10452. }
  10453. UIGetAward.uiName = "UIGetAward";
  10454. class Common {
  10455. constructor() {
  10456. this.convertNum = 0.025;
  10457. this.VectorUp = new Laya.Vector3(0, 1, 0);
  10458. this.scaleV3One = new Laya.Vector3();
  10459. this.scaleV3Two = new Laya.Vector3();
  10460. this.posV4 = new Laya.Vector4();
  10461. this.showDebug = false;
  10462. this.openGuide = true;
  10463. this.rodOffest = new Laya.Vector2(0, 0);
  10464. this.rodAngle = 0;
  10465. this.gameMode = GameMode.classic;
  10466. this.bigMoveLevelIndex = 1;
  10467. this.bigMoveNeedCoin = 1000;
  10468. this.classicNiceNeddCoin = 1000;
  10469. this.passAwardCoin = 2000;
  10470. this.classicRoomType = 1;
  10471. this.maxPower = 20;
  10472. this.natureMaxPower = 5;
  10473. this.videoPower = 2;
  10474. this.powerRecoverNum = 900;
  10475. this.curPlayerSkillType = 0;
  10476. this.isNewDay = false;
  10477. this.clickedBall = false;
  10478. this.placeBallCurLevel = 0;
  10479. this.placeBallStarNum = 0;
  10480. this.longHelpLine = false;
  10481. this.maxShareDiamondTimes = 3;
  10482. this.guideStep = 0;
  10483. this.temSelfLevel = 0;
  10484. this.extraMoveNum = 0;
  10485. this.curRankID = 0;
  10486. this.rankID = {
  10487. normalStar: 12000,
  10488. wxStar: 12001
  10489. };
  10490. this.skillNameList = ["Fall from the sky", "Unstoppable Force", "Freeze Shot", "Coming Soon"];
  10491. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4", "gf_jn4"];
  10492. this.btnClickStr = "buttonclick";
  10493. this.maxSkillLevel = 10;
  10494. this.upSkillLevel = false;
  10495. this.gameStartTime = 0;
  10496. this._sysOffestNum = 0;
  10497. this.angleV2 = new Laya.Vector2();
  10498. this.rootV = new Laya.Vector2(0, 1);
  10499. this.tempDir1 = new Laya.Vector2();
  10500. this.tempDir2 = new Laya.Vector2();
  10501. this.ballSize = 33;
  10502. this.stPos = new Laya.Point();
  10503. this.edPos = new Laya.Point();
  10504. Common._instance = this;
  10505. window["common"] = this;
  10506. }
  10507. static getInstance() {
  10508. if (!this._instance) {
  10509. this._instance = new Common();
  10510. }
  10511. return this._instance;
  10512. }
  10513. get sysOffestNum() {
  10514. if (this._sysOffestNum == 0) {
  10515. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  10516. }
  10517. return this._sysOffestNum;
  10518. }
  10519. testShader() {
  10520. let test = new LightShader();
  10521. test.texture = "res/d3Res/ballTexture/ball1.png";
  10522. Laya.stage.addChild(test);
  10523. }
  10524. playScale(node) {
  10525. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  10526. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  10527. }));
  10528. }));
  10529. }
  10530. setGroup(colli, ...group) {
  10531. let out = 0;
  10532. for (let index = 0; index < group.length; index++) {
  10533. if (index == 0) {
  10534. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10535. }
  10536. else {
  10537. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10538. }
  10539. }
  10540. colli.collisionGroup = out;
  10541. }
  10542. setCanGroupWith(colli, ...group) {
  10543. let out = 0;
  10544. for (let index = 0; index < group.length; index++) {
  10545. if (index == 0) {
  10546. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10547. }
  10548. else {
  10549. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10550. }
  10551. }
  10552. colli.canCollideWith = out;
  10553. }
  10554. loadPrefab(name, callback) {
  10555. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  10556. let prefab = new Laya.Prefab();
  10557. prefab.json = obj;
  10558. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  10559. callback && callback(img);
  10560. }));
  10561. }
  10562. pos2to3Convert(x, y, d3Pos) {
  10563. x = x + this.sysOffestNum;
  10564. d3Pos.setValue(x, y, 0);
  10565. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  10566. if (success) {
  10567. }
  10568. else {
  10569. console.error("转换出错了。。。。。。。。");
  10570. }
  10571. }
  10572. scale2to3Convert(num) {
  10573. this.scaleV3One.setValue(0, 0, 0);
  10574. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  10575. this.scaleV3Two.setValue(0, num, 0);
  10576. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  10577. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  10578. return outNum;
  10579. }
  10580. pos3to2Convert(d3Pos) {
  10581. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  10582. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  10583. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  10584. d3Pos.x -= this.sysOffestNum;
  10585. }
  10586. scale3to2Convert(num) {
  10587. let scale = this.scale2to3Convert(1);
  10588. let d2Out = num / scale;
  10589. return d2Out;
  10590. }
  10591. getCollider(type, restitution = 0.9, density = 10) {
  10592. let colli;
  10593. if (type == "box")
  10594. colli = new Laya.BoxCollider();
  10595. else
  10596. colli = new Laya.CircleCollider();
  10597. colli.friction = 0;
  10598. colli.restitution = restitution;
  10599. colli.density = density;
  10600. return colli;
  10601. }
  10602. getRigbody() {
  10603. let rigy = new Laya.RigidBody();
  10604. rigy.bullet = true;
  10605. rigy.allowRotation = false;
  10606. rigy.allowSleep = false;
  10607. rigy.gravityScale = 0;
  10608. return rigy;
  10609. }
  10610. getfguiRotation(x, y) {
  10611. this.angleV2.setValue(x, y);
  10612. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  10613. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  10614. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  10615. angle = -angle;
  10616. }
  10617. return 180 + angle;
  10618. }
  10619. getAngle(x, y) {
  10620. this.angleV2.setValue(x, y);
  10621. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  10622. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  10623. return angle;
  10624. }
  10625. randomNum(a, b) {
  10626. return a + Math.floor((b - a + 1) * Math.random());
  10627. }
  10628. getRandArrEle(arr) {
  10629. return arr[Math.floor(arr.length * Math.random())];
  10630. }
  10631. getSign(val) {
  10632. return val >= 0 ? 1 : -1;
  10633. }
  10634. botherArr(arr) {
  10635. let times = arr.length + 2;
  10636. let length = arr.length;
  10637. let a;
  10638. let b;
  10639. let temp;
  10640. for (let index = 0; index < times; index++) {
  10641. a = Math.floor(Math.random() * length);
  10642. b = Math.floor(Math.random() * length);
  10643. temp = arr[a];
  10644. arr[a] = arr[b];
  10645. arr[b] = temp;
  10646. }
  10647. }
  10648. getGameIconUrl(id) {
  10649. return "ui://game/" + id;
  10650. }
  10651. getComponentUrl(id) {
  10652. return "ui://game/" + id;
  10653. }
  10654. getAnimation() {
  10655. }
  10656. judgeSkillType(type = SkillType.highSpace) {
  10657. if (this.gameMode == GameMode.classic)
  10658. return;
  10659. let gameMgr = this.gameMgr;
  10660. if (gameMgr.selfTurn) {
  10661. if (gameMgr.selfCurSkill == type) {
  10662. return true;
  10663. }
  10664. }
  10665. else {
  10666. if (gameMgr.aiCurSkill == type) {
  10667. return true;
  10668. }
  10669. }
  10670. }
  10671. ballColliHole(collider) {
  10672. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  10673. xGame.common.gameMgr.isFirstInGame = false;
  10674. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  10675. }
  10676. collider.owner.mySrc.checkWrongBall();
  10677. }
  10678. getArrMaxEle(arr) {
  10679. let max = -Infinity;
  10680. for (let index = 0; index < arr.length; index++) {
  10681. max = Math.max(arr[index], max);
  10682. }
  10683. return max;
  10684. }
  10685. getArrMinEle(arr) {
  10686. let min = Infinity;
  10687. for (let index = 0; index < arr.length; index++) {
  10688. min = Math.min(arr[index], min);
  10689. }
  10690. return min;
  10691. }
  10692. playRandomMutiBallBigSkillSound() {
  10693. if (Math.random() <= 0.5)
  10694. return;
  10695. let rand = this.randomNum(1, 6);
  10696. let str = "ganfa0" + rand;
  10697. xGame.soundMgr.playSound(str);
  10698. }
  10699. showOneCamera(type) {
  10700. let object = xGame.common.d3World.cameraObj;
  10701. for (const key in object) {
  10702. if (Object.prototype.hasOwnProperty.call(object, key)) {
  10703. object[key].init();
  10704. object[key].owner.active = key == type;
  10705. }
  10706. }
  10707. }
  10708. checkBallOverBorder(x, y) {
  10709. let radius = 17;
  10710. let condition = this._checkBorder(x + radius, y) ||
  10711. this._checkBorder(x - radius, y) ||
  10712. this._checkBorder(x, y + radius) ||
  10713. this._checkBorder(x, y - radius);
  10714. if (condition) {
  10715. return true;
  10716. }
  10717. }
  10718. _checkBorder(x, y) {
  10719. let borderRect = this.d2World.borderRect;
  10720. let xOffest = 20;
  10721. let yOffest = 20;
  10722. if (y <= borderRect.y - yOffest) {
  10723. return true;
  10724. }
  10725. if (y >= borderRect.y + borderRect.height + yOffest) {
  10726. return true;
  10727. }
  10728. if (x <= borderRect.x - xOffest) {
  10729. return true;
  10730. }
  10731. if (x >= borderRect.x + borderRect.width + xOffest) {
  10732. return true;
  10733. }
  10734. }
  10735. initWeight(cfg) {
  10736. let allCfgData = { data: {}, allWeightNum: 0 };
  10737. let weightCfg = allCfgData.data;
  10738. let weight = 0;
  10739. for (const key in cfg) {
  10740. weightCfg[key] = {};
  10741. weightCfg[key].id = cfg[key].id;
  10742. weightCfg[key].minWeight = weight;
  10743. weight += cfg[key].weight;
  10744. weightCfg[key].maxWeight = weight;
  10745. }
  10746. allCfgData.allWeightNum = weight;
  10747. return allCfgData;
  10748. }
  10749. getRandomWeightData(cfg) {
  10750. let weightCfg = cfg.data;
  10751. let allWeightNum = cfg.allWeightNum;
  10752. let rand = Math.floor(Math.random() * allWeightNum);
  10753. for (const key in weightCfg) {
  10754. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  10755. return weightCfg[key];
  10756. }
  10757. }
  10758. return weightCfg[1];
  10759. }
  10760. showGirlTalkPop(wordsIndex, node, msgNode) {
  10761. node.visible = true;
  10762. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  10763. node.t0.play(Laya.Handler.create(this, () => {
  10764. node.visible = false;
  10765. }));
  10766. }
  10767. stopGirlPop(node) {
  10768. node.t0.stop();
  10769. node.visible = false;
  10770. }
  10771. createHead(loader, url, size = 107) {
  10772. if (Laya.Browser.name == "Browser") {
  10773. loader.url = url;
  10774. return;
  10775. }
  10776. if (Moyu.isTT) {
  10777. let localImage = new Image();
  10778. localImage.src = url;
  10779. localImage.onload = () => {
  10780. let t2d = new Laya.Texture2D();
  10781. t2d.width = size;
  10782. t2d.height = size;
  10783. loader.displayObject.graphics.drawImage(new Laya.Texture(t2d), 0, 0);
  10784. t2d.loadImageSource(localImage);
  10785. };
  10786. }
  10787. else {
  10788. loader.url = url;
  10789. }
  10790. }
  10791. addTestCoin(num) {
  10792. DataMgr.setCoin(num);
  10793. }
  10794. addTestDiamond(num) {
  10795. DataMgr.setDiamond(num);
  10796. }
  10797. addTestSkill() {
  10798. DataMgr.setBigSkill(0, 99);
  10799. DataMgr.setBigSkill(1, 99);
  10800. DataMgr.setBigSkill(2, 99);
  10801. }
  10802. playClassicEmotion(number, x, y) {
  10803. if (this.gameMode == GameMode.bigMove)
  10804. return;
  10805. let randIndex = this.randomNum(0, 2);
  10806. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  10807. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  10808. if (this.gameMgr.selfTurn) {
  10809. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  10810. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10811. }
  10812. else {
  10813. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  10814. }
  10815. else {
  10816. if (number == this.gameMgr.blackNum) {
  10817. if (this.gameMgr.selfBallArr.length == 0) {
  10818. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10819. }
  10820. else {
  10821. }
  10822. }
  10823. else {
  10824. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10825. }
  10826. }
  10827. }
  10828. }
  10829. else {
  10830. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  10831. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10832. }
  10833. else {
  10834. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  10835. }
  10836. else {
  10837. if (number == this.gameMgr.blackNum) {
  10838. if (this.gameMgr.aiBallArr.length == 0) {
  10839. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10840. }
  10841. else {
  10842. }
  10843. }
  10844. else {
  10845. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10846. }
  10847. }
  10848. }
  10849. }
  10850. }
  10851. playHappySound(number) {
  10852. if (this.gameMode != GameMode.classic)
  10853. return;
  10854. if (number == 8)
  10855. return;
  10856. let play = false;
  10857. if (this.gameMgr.selfTurn) {
  10858. if (this.gameMgr.ensureBallType) {
  10859. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  10860. play = true;
  10861. }
  10862. }
  10863. else {
  10864. play = true;
  10865. }
  10866. }
  10867. else {
  10868. if (this.gameMgr.ensureBallType) {
  10869. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  10870. play = true;
  10871. }
  10872. }
  10873. else {
  10874. play = true;
  10875. }
  10876. }
  10877. if (play)
  10878. xGame.soundMgr.playSound("applause");
  10879. }
  10880. destroyClassicEmotion() {
  10881. if (this.gameMode == GameMode.bigMove)
  10882. return;
  10883. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  10884. parent.destroyChildren();
  10885. }
  10886. playAwardSpine(x, y) {
  10887. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  10888. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  10889. this.awardSpine.play(data, 0, false, parent);
  10890. }
  10891. destroyAwardSpine() {
  10892. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  10893. parent.destroyChildren();
  10894. }
  10895. isBlock(bx, by, hx, hy, except = null) {
  10896. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  10897. let balls = xGame.common.d2World.ballArr;
  10898. let outArr = [];
  10899. for (let index = 0; index < balls.length; index++) {
  10900. let obj = balls[index];
  10901. if (obj.number == 0)
  10902. continue;
  10903. if (obj == except)
  10904. continue;
  10905. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  10906. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  10907. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  10908. if (num >= 1)
  10909. num = 1;
  10910. if (num < 0)
  10911. continue;
  10912. let gap = Math.sin(Math.acos(num)) * dis;
  10913. if (gap < this.ballSize) {
  10914. outArr.push({
  10915. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  10916. disHon: Math.cos(Math.acos(num)) * dis,
  10917. disVer: Math.sin(Math.acos(num)) * dis,
  10918. src: balls[index],
  10919. dir: this.tempDir1
  10920. });
  10921. }
  10922. }
  10923. if (outArr.length > 0) {
  10924. outArr.sort((a, b) => { return a.dis - b.dis; });
  10925. return outArr[0];
  10926. }
  10927. }
  10928. AngleBetween(vector1, vector2) {
  10929. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  10930. return rad * (180 / Math.PI);
  10931. }
  10932. getSecretaryScale() {
  10933. if (this.secretary.spineName == "mishu") {
  10934. return 1.28;
  10935. }
  10936. else {
  10937. return 1.024;
  10938. }
  10939. }
  10940. signAwardContainsRod(arr) {
  10941. let temp;
  10942. for (let index = 0; index < arr.length; index++) {
  10943. temp = arr[index].split('-')[0];
  10944. if (parseInt(temp) > 2) {
  10945. return true;
  10946. }
  10947. }
  10948. }
  10949. judgeSameDay() {
  10950. let lastTime = DataMgr.getSignTime();
  10951. let curTime = new Date().getTime();
  10952. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  10953. return true;
  10954. }
  10955. return false;
  10956. }
  10957. getAward(arr, callback) {
  10958. let showTriple = arr[0].type <= 2;
  10959. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  10960. let temp;
  10961. for (let index = 0; index < arr.length; index++) {
  10962. temp = arr[index];
  10963. switch (temp.type) {
  10964. case 1:
  10965. this.playObjFlyAnim(temp.num, temp.type);
  10966. break;
  10967. case 2:
  10968. this.playObjFlyAnim(temp.num, temp.type);
  10969. break;
  10970. case 3:
  10971. case 4:
  10972. case 5:
  10973. case 6:
  10974. DataMgr.setBallRod(temp.type - 2, 1);
  10975. DataMgr.setCurBallRod(temp.type - 2);
  10976. break;
  10977. default:
  10978. break;
  10979. }
  10980. }
  10981. callback && callback(watchVideo);
  10982. });
  10983. }
  10984. getMoneyNode() {
  10985. let moneyNode;
  10986. let sign = xGame.uiMgr.getUI(UISign);
  10987. let draw = xGame.uiMgr.getUI(UIDraw);
  10988. let end = xGame.uiMgr.getUI(UIGameEnd);
  10989. let skill = xGame.uiMgr.getUI(UISkill);
  10990. if (sign && !sign.isHide)
  10991. moneyNode = sign.ui.moneyNode;
  10992. if (draw && !draw.isHide)
  10993. moneyNode = draw.ui.moneyNode;
  10994. if (end && !end.isHide)
  10995. moneyNode = end.ui.moneyNode;
  10996. if (skill && !skill.isHide)
  10997. moneyNode = skill.ui.moneyNode;
  10998. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  10999. let main = xGame.uiMgr.getUI(UIMain);
  11000. if (condition1 && main && !main.isHide) {
  11001. moneyNode = main.ui.moneyNode;
  11002. }
  11003. return moneyNode;
  11004. }
  11005. playObjFlyAnim(num, type, callback = null) {
  11006. this.stPos.x = Laya.stage.width / 2;
  11007. this.stPos.y = Laya.stage.height / 2;
  11008. let moneyNode = this.getMoneyNode();
  11009. switch (type) {
  11010. case Prop.diamond:
  11011. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  11012. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  11013. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  11014. this.edPos.x /= 2;
  11015. this.edPos.y /= 2;
  11016. break;
  11017. case Prop.coin:
  11018. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  11019. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  11020. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  11021. this.edPos.x /= 2;
  11022. this.edPos.y /= 2;
  11023. break;
  11024. default:
  11025. break;
  11026. }
  11027. xGame.soundMgr.playSound("coinbag");
  11028. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  11029. switch (type) {
  11030. case Prop.diamond:
  11031. DataMgr.setDiamond(num);
  11032. break;
  11033. case Prop.coin:
  11034. DataMgr.setCoin(num);
  11035. break;
  11036. default:
  11037. break;
  11038. }
  11039. callback && callback();
  11040. });
  11041. }
  11042. autoPopUIView() {
  11043. let arr = [];
  11044. let sign = this.judgeSameDay() ? false : true;
  11045. if (sign)
  11046. arr.push("sign");
  11047. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  11048. if (draw)
  11049. arr.push("draw");
  11050. if (arr.length <= 0)
  11051. return;
  11052. let str = this.getRandArrEle(arr);
  11053. switch (str) {
  11054. case "sign":
  11055. xGame.uiMgr.Show(UISign);
  11056. break;
  11057. case "draw":
  11058. xGame.uiMgr.Show(UIDraw);
  11059. break;
  11060. default:
  11061. break;
  11062. }
  11063. }
  11064. getMSTime(time) {
  11065. let min = Math.floor(time / 60);
  11066. let sec = Math.floor((time - min * 60));
  11067. if (sec < 10)
  11068. sec = "0" + sec;
  11069. if (min < 10)
  11070. min = "0" + min;
  11071. return `${min}:${sec}`;
  11072. }
  11073. testPower() {
  11074. DataMgr.setPower(0, false);
  11075. }
  11076. getAllStarNum() {
  11077. let data = DataMgr.getPlaceBallLevelList();
  11078. let out = 0;
  11079. for (let index = 0; index < data.length; index++) {
  11080. out += data[index].star;
  11081. }
  11082. return out;
  11083. }
  11084. recoverCameraView() {
  11085. Laya.timer.once(900, this, () => {
  11086. xGame.common.showOneCamera("mainCamera");
  11087. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  11088. xGame.common.gameUI.ui.d2Node.alpha = 1;
  11089. xGame.common.gameUI.ui.border.alpha = 0;
  11090. if (Laya.physicsTimer.scale < 1) {
  11091. Laya.physicsTimer.scale = 1;
  11092. }
  11093. }
  11094. });
  11095. }
  11096. getClassicLevel() {
  11097. let successTimes = DataMgr.getClassicTimes();
  11098. let needKey = "";
  11099. let lastKey = "";
  11100. let cfg = cfgTable.classictimesData;
  11101. let data;
  11102. for (const key in cfg) {
  11103. data = cfg[key];
  11104. if (successTimes <= data.times) {
  11105. needKey = key;
  11106. }
  11107. lastKey = key;
  11108. }
  11109. if (needKey == "")
  11110. needKey = lastKey;
  11111. return cfg[needKey];
  11112. }
  11113. }
  11114. Common._instance = null;
  11115. class ui_Component92 extends fgui.GComponent {
  11116. static createInstance() {
  11117. return (fgui.UIPackage.createObject("game", "Component92"));
  11118. }
  11119. onConstruct() {
  11120. this.n0 = (this.getChild("n0"));
  11121. }
  11122. }
  11123. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  11124. class ui_Component129 extends fgui.GProgressBar {
  11125. static createInstance() {
  11126. return (fgui.UIPackage.createObject("game", "Component129"));
  11127. }
  11128. onConstruct() {
  11129. this.bar_v = (this.getChild("bar_v"));
  11130. this.n84 = (this.getChild("n84"));
  11131. }
  11132. }
  11133. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  11134. class ui_Component130 extends fgui.GComponent {
  11135. static createInstance() {
  11136. return (fgui.UIPackage.createObject("game", "Component130"));
  11137. }
  11138. onConstruct() {
  11139. this.ani = (this.getChild("ani"));
  11140. this.t0 = this.getTransition("t0");
  11141. }
  11142. }
  11143. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  11144. class ui_powerEft extends fgui.GComponent {
  11145. static createInstance() {
  11146. return (fgui.UIPackage.createObject("game", "powerEft"));
  11147. }
  11148. onConstruct() {
  11149. this.ani = (this.getChild("ani"));
  11150. this.n88 = (this.getChild("n88"));
  11151. this.n89 = (this.getChild("n89"));
  11152. }
  11153. }
  11154. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  11155. class ui_PutBallLevelDisplay extends fgui.GComponent {
  11156. static createInstance() {
  11157. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  11158. }
  11159. onConstruct() {
  11160. this.c1 = this.getController("c1");
  11161. this.n2 = (this.getChild("n2"));
  11162. this.n22 = (this.getChild("n22"));
  11163. this.n23 = (this.getChild("n23"));
  11164. this.n15 = (this.getChild("n15"));
  11165. this.challenge = (this.getChild("challenge"));
  11166. this.n17 = (this.getChild("n17"));
  11167. this.n3 = (this.getChild("n3"));
  11168. this.starNode = (this.getChild("starNode"));
  11169. this.levelTxt = (this.getChild("levelTxt"));
  11170. this.n14 = (this.getChild("n14"));
  11171. this.n19 = (this.getChild("n19"));
  11172. this.n20 = (this.getChild("n20"));
  11173. this.n21 = (this.getChild("n21"));
  11174. this.special = (this.getChild("special"));
  11175. }
  11176. }
  11177. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  11178. class ui_Component79 extends fgui.GComponent {
  11179. static createInstance() {
  11180. return (fgui.UIPackage.createObject("game", "Component79"));
  11181. }
  11182. onConstruct() {
  11183. this.c1 = this.getController("c1");
  11184. this.n7 = (this.getChild("n7"));
  11185. this.n8 = (this.getChild("n8"));
  11186. this.n9 = (this.getChild("n9"));
  11187. this.n10 = (this.getChild("n10"));
  11188. this.n11 = (this.getChild("n11"));
  11189. this.n12 = (this.getChild("n12"));
  11190. }
  11191. }
  11192. ui_Component79.URL = "ui://isxx5ak7avag477";
  11193. class ui_Component80 extends fgui.GComponent {
  11194. static createInstance() {
  11195. return (fgui.UIPackage.createObject("game", "Component80"));
  11196. }
  11197. onConstruct() {
  11198. this.n0 = (this.getChild("n0"));
  11199. this.n1 = (this.getChild("n1"));
  11200. this.myList = (this.getChild("myList"));
  11201. this.t0 = this.getTransition("t0");
  11202. }
  11203. }
  11204. ui_Component80.URL = "ui://isxx5ak7avag47b";
  11205. class ui_SignNormal extends fgui.GComponent {
  11206. static createInstance() {
  11207. return (fgui.UIPackage.createObject("game", "SignNormal"));
  11208. }
  11209. onConstruct() {
  11210. this.c1 = this.getController("c1");
  11211. this.n7 = (this.getChild("n7"));
  11212. this.n15 = (this.getChild("n15"));
  11213. this.titleTxt = (this.getChild("titleTxt"));
  11214. this.n8 = (this.getChild("n8"));
  11215. this.myIcon = (this.getChild("myIcon"));
  11216. this.numTxt = (this.getChild("numTxt"));
  11217. this.n12 = (this.getChild("n12"));
  11218. this.n13 = (this.getChild("n13"));
  11219. this.n17 = (this.getChild("n17"));
  11220. this.n14 = (this.getChild("n14"));
  11221. }
  11222. }
  11223. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  11224. class ui_screenNode extends fgui.GComponent {
  11225. static createInstance() {
  11226. return (fgui.UIPackage.createObject("game", "screenNode"));
  11227. }
  11228. onConstruct() {
  11229. this.n9 = (this.getChild("n9"));
  11230. this.screenImg = (this.getChild("screenImg"));
  11231. }
  11232. }
  11233. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  11234. class ui_GetAwrad_com1 extends fgui.GComponent {
  11235. static createInstance() {
  11236. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  11237. }
  11238. onConstruct() {
  11239. this.n38 = (this.getChild("n38"));
  11240. this.n39 = (this.getChild("n39"));
  11241. this.n40 = (this.getChild("n40"));
  11242. this.t0 = this.getTransition("t0");
  11243. this.t1 = this.getTransition("t1");
  11244. }
  11245. }
  11246. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  11247. class ui_GetAwrad_com2 extends fgui.GComponent {
  11248. static createInstance() {
  11249. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  11250. }
  11251. onConstruct() {
  11252. this.n39 = (this.getChild("n39"));
  11253. this.n40 = (this.getChild("n40"));
  11254. this.t0 = this.getTransition("t0");
  11255. }
  11256. }
  11257. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  11258. class ui_Component128 extends fgui.GComponent {
  11259. static createInstance() {
  11260. return (fgui.UIPackage.createObject("game", "Component128"));
  11261. }
  11262. onConstruct() {
  11263. this.n38 = (this.getChild("n38"));
  11264. this.n40 = (this.getChild("n40"));
  11265. }
  11266. }
  11267. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  11268. class ui_Component100_1 extends fgui.GComponent {
  11269. static createInstance() {
  11270. return (fgui.UIPackage.createObject("game", "Component100_1"));
  11271. }
  11272. onConstruct() {
  11273. this.myNode = (this.getChild("myNode"));
  11274. this.t0 = this.getTransition("t0");
  11275. }
  11276. }
  11277. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  11278. class ui_Component142 extends fgui.GComponent {
  11279. static createInstance() {
  11280. return (fgui.UIPackage.createObject("game", "Component142"));
  11281. }
  11282. onConstruct() {
  11283. this.n41 = (this.getChild("n41"));
  11284. this.n42 = (this.getChild("n42"));
  11285. }
  11286. }
  11287. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  11288. class ui_main_guang extends fgui.GComponent {
  11289. static createInstance() {
  11290. return (fgui.UIPackage.createObject("game", "main_guang"));
  11291. }
  11292. onConstruct() {
  11293. this.n1 = (this.getChild("n1"));
  11294. this.n2 = (this.getChild("n2"));
  11295. this.n3 = (this.getChild("n3"));
  11296. this.n4 = (this.getChild("n4"));
  11297. this.n5 = (this.getChild("n5"));
  11298. this.n6 = (this.getChild("n6"));
  11299. this.n8 = (this.getChild("n8"));
  11300. this.t0 = this.getTransition("t0");
  11301. }
  11302. }
  11303. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  11304. class ui_try_com1 extends fgui.GComponent {
  11305. static createInstance() {
  11306. return (fgui.UIPackage.createObject("game", "try_com1"));
  11307. }
  11308. onConstruct() {
  11309. this.c1 = this.getController("c1");
  11310. this.n0 = (this.getChild("n0"));
  11311. this.n2 = (this.getChild("n2"));
  11312. this.cancelBtn = (this.getChild("cancelBtn"));
  11313. this.videoBtn = (this.getChild("videoBtn"));
  11314. this.n9 = (this.getChild("n9"));
  11315. this.n24 = (this.getChild("n24"));
  11316. this.titleTxt = (this.getChild("titleTxt"));
  11317. this.n32 = (this.getChild("n32"));
  11318. this.n29 = (this.getChild("n29"));
  11319. this.n36 = (this.getChild("n36"));
  11320. this.txtTime = (this.getChild("txtTime"));
  11321. this.t0 = this.getTransition("t0");
  11322. }
  11323. }
  11324. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  11325. class ui_try_com2 extends fgui.GComponent {
  11326. static createInstance() {
  11327. return (fgui.UIPackage.createObject("game", "try_com2"));
  11328. }
  11329. onConstruct() {
  11330. this.skillicon = (this.getChild("skillicon"));
  11331. this.n35 = (this.getChild("n35"));
  11332. this.n31 = (this.getChild("n31"));
  11333. this.n32 = (this.getChild("n32"));
  11334. this.n33 = (this.getChild("n33"));
  11335. this.n34 = (this.getChild("n34"));
  11336. }
  11337. }
  11338. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  11339. class ui_try_com3 extends fgui.GComponent {
  11340. static createInstance() {
  11341. return (fgui.UIPackage.createObject("game", "try_com3"));
  11342. }
  11343. onConstruct() {
  11344. this.n33 = (this.getChild("n33"));
  11345. this.n34 = (this.getChild("n34"));
  11346. this.n35 = (this.getChild("n35"));
  11347. this.t0 = this.getTransition("t0");
  11348. }
  11349. }
  11350. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  11351. class ui_Component121 extends fgui.GButton {
  11352. static createInstance() {
  11353. return (fgui.UIPackage.createObject("game", "Component121"));
  11354. }
  11355. onConstruct() {
  11356. this.n3 = (this.getChild("n3"));
  11357. this.t0 = this.getTransition("t0");
  11358. }
  11359. }
  11360. ui_Component121.URL = "ui://isxx5ak7cy72v4ib";
  11361. class ui_huihe1 extends fgui.GComponent {
  11362. static createInstance() {
  11363. return (fgui.UIPackage.createObject("game", "huihe1"));
  11364. }
  11365. onConstruct() {
  11366. this.n0 = (this.getChild("n0"));
  11367. this.n1 = (this.getChild("n1"));
  11368. this.t0 = this.getTransition("t0");
  11369. }
  11370. }
  11371. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  11372. class ui_huihe2 extends fgui.GComponent {
  11373. static createInstance() {
  11374. return (fgui.UIPackage.createObject("game", "huihe2"));
  11375. }
  11376. onConstruct() {
  11377. this.n0 = (this.getChild("n0"));
  11378. this.n1 = (this.getChild("n1"));
  11379. this.t0 = this.getTransition("t0");
  11380. }
  11381. }
  11382. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  11383. class ui_Component143 extends fgui.GComponent {
  11384. static createInstance() {
  11385. return (fgui.UIPackage.createObject("game", "Component143"));
  11386. }
  11387. onConstruct() {
  11388. this.n3 = (this.getChild("n3"));
  11389. this.n4 = (this.getChild("n4"));
  11390. this.n5 = (this.getChild("n5"));
  11391. this.n6 = (this.getChild("n6"));
  11392. this.n7 = (this.getChild("n7"));
  11393. this.n8 = (this.getChild("n8"));
  11394. this.n9 = (this.getChild("n9"));
  11395. this.n10 = (this.getChild("n10"));
  11396. this.t0 = this.getTransition("t0");
  11397. }
  11398. }
  11399. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  11400. class ui_dh_jingbi2 extends fgui.GComponent {
  11401. static createInstance() {
  11402. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  11403. }
  11404. onConstruct() {
  11405. this.n0 = (this.getChild("n0"));
  11406. this.n1 = (this.getChild("n1"));
  11407. this.n2 = (this.getChild("n2"));
  11408. this.n3 = (this.getChild("n3"));
  11409. this.n4 = (this.getChild("n4"));
  11410. this.n5 = (this.getChild("n5"));
  11411. this.n6 = (this.getChild("n6"));
  11412. this.n8 = (this.getChild("n8"));
  11413. this.n10 = (this.getChild("n10"));
  11414. this.t0 = this.getTransition("t0");
  11415. }
  11416. }
  11417. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  11418. class ui_dh_jingbi2_1 extends fgui.GComponent {
  11419. static createInstance() {
  11420. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  11421. }
  11422. onConstruct() {
  11423. this.n1 = (this.getChild("n1"));
  11424. this.n4 = (this.getChild("n4"));
  11425. this.t0 = this.getTransition("t0");
  11426. }
  11427. }
  11428. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  11429. class ui_dh_jingbi3 extends fgui.GComponent {
  11430. static createInstance() {
  11431. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  11432. }
  11433. onConstruct() {
  11434. this.n0 = (this.getChild("n0"));
  11435. this.n1 = (this.getChild("n1"));
  11436. this.n2 = (this.getChild("n2"));
  11437. this.n3 = (this.getChild("n3"));
  11438. this.n4 = (this.getChild("n4"));
  11439. this.n5 = (this.getChild("n5"));
  11440. this.n6 = (this.getChild("n6"));
  11441. this.n8 = (this.getChild("n8"));
  11442. this.n10 = (this.getChild("n10"));
  11443. this.t0 = this.getTransition("t0");
  11444. }
  11445. }
  11446. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  11447. class ui_dh_jingbi3_1 extends fgui.GComponent {
  11448. static createInstance() {
  11449. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  11450. }
  11451. onConstruct() {
  11452. this.n3 = (this.getChild("n3"));
  11453. this.n1 = (this.getChild("n1"));
  11454. this.t0 = this.getTransition("t0");
  11455. }
  11456. }
  11457. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  11458. class ui_hb_jinbi1 extends fgui.GButton {
  11459. static createInstance() {
  11460. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  11461. }
  11462. onConstruct() {
  11463. this.n20 = (this.getChild("n20"));
  11464. this.n25 = (this.getChild("n25"));
  11465. this.coinTxt = (this.getChild("coinTxt"));
  11466. this.n28 = (this.getChild("n28"));
  11467. this.n32 = (this.getChild("n32"));
  11468. this.n38 = (this.getChild("n38"));
  11469. this.n45 = (this.getChild("n45"));
  11470. this.getTips = (this.getChild("getTips"));
  11471. this.n39 = (this.getChild("n39"));
  11472. this.diamondTxt = (this.getChild("diamondTxt"));
  11473. this.n41 = (this.getChild("n41"));
  11474. this.n42 = (this.getChild("n42"));
  11475. this.n46 = (this.getChild("n46"));
  11476. this.n47 = (this.getChild("n47"));
  11477. this.n48 = (this.getChild("n48"));
  11478. this.t0 = this.getTransition("t0");
  11479. }
  11480. }
  11481. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  11482. class ui_hb_jinbi2 extends fgui.GButton {
  11483. static createInstance() {
  11484. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  11485. }
  11486. onConstruct() {
  11487. this.n20 = (this.getChild("n20"));
  11488. this.n25 = (this.getChild("n25"));
  11489. this.coinTxt = (this.getChild("coinTxt"));
  11490. this.n28 = (this.getChild("n28"));
  11491. this.n32 = (this.getChild("n32"));
  11492. this.n38 = (this.getChild("n38"));
  11493. this.n39 = (this.getChild("n39"));
  11494. this.diamondTxt = (this.getChild("diamondTxt"));
  11495. this.n41 = (this.getChild("n41"));
  11496. this.n42 = (this.getChild("n42"));
  11497. this.n43 = (this.getChild("n43"));
  11498. this.n44 = (this.getChild("n44"));
  11499. this.n45 = (this.getChild("n45"));
  11500. this.t0 = this.getTransition("t0");
  11501. }
  11502. }
  11503. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  11504. class ui_hb_jinbi3 extends fgui.GButton {
  11505. static createInstance() {
  11506. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  11507. }
  11508. onConstruct() {
  11509. this.n20 = (this.getChild("n20"));
  11510. this.n25 = (this.getChild("n25"));
  11511. this.coinTxt = (this.getChild("coinTxt"));
  11512. this.n28 = (this.getChild("n28"));
  11513. this.n32 = (this.getChild("n32"));
  11514. this.n38 = (this.getChild("n38"));
  11515. this.n39 = (this.getChild("n39"));
  11516. this.diamondTxt = (this.getChild("diamondTxt"));
  11517. this.n41 = (this.getChild("n41"));
  11518. this.n42 = (this.getChild("n42"));
  11519. this.n43 = (this.getChild("n43"));
  11520. this.n44 = (this.getChild("n44"));
  11521. this.n45 = (this.getChild("n45"));
  11522. this.t0 = this.getTransition("t0");
  11523. }
  11524. }
  11525. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  11526. class ui_Component104 extends fgui.GComponent {
  11527. static createInstance() {
  11528. return (fgui.UIPackage.createObject("game", "Component104"));
  11529. }
  11530. onConstruct() {
  11531. this.c1 = this.getController("c1");
  11532. this.n12 = (this.getChild("n12"));
  11533. this.coinBtn = (this.getChild("coinBtn"));
  11534. this.diamondBtn = (this.getChild("diamondBtn"));
  11535. this.node3 = (this.getChild("node3"));
  11536. this.node4 = (this.getChild("node4"));
  11537. this.node5 = (this.getChild("node5"));
  11538. this.node1 = (this.getChild("node1"));
  11539. this.node2 = (this.getChild("node2"));
  11540. this.node6 = (this.getChild("node6"));
  11541. this.t0 = this.getTransition("t0");
  11542. }
  11543. }
  11544. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  11545. class ui_Component105 extends fgui.GButton {
  11546. static createInstance() {
  11547. return (fgui.UIPackage.createObject("game", "Component105"));
  11548. }
  11549. onConstruct() {
  11550. this.c1 = this.getController("c1");
  11551. this.n49 = (this.getChild("n49"));
  11552. this.n18 = (this.getChild("n18"));
  11553. this.n46 = (this.getChild("n46"));
  11554. this.n48 = (this.getChild("n48"));
  11555. }
  11556. }
  11557. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  11558. class ui_Component106 extends fgui.GButton {
  11559. static createInstance() {
  11560. return (fgui.UIPackage.createObject("game", "Component106"));
  11561. }
  11562. onConstruct() {
  11563. this.c1 = this.getController("c1");
  11564. this.n49 = (this.getChild("n49"));
  11565. this.n18 = (this.getChild("n18"));
  11566. this.n46 = (this.getChild("n46"));
  11567. this.n48 = (this.getChild("n48"));
  11568. }
  11569. }
  11570. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  11571. class ui_hb_zs1 extends fgui.GButton {
  11572. static createInstance() {
  11573. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  11574. }
  11575. onConstruct() {
  11576. this.c1 = this.getController("c1");
  11577. this.n20 = (this.getChild("n20"));
  11578. this.n21 = (this.getChild("n21"));
  11579. this.n26 = (this.getChild("n26"));
  11580. this.n27 = (this.getChild("n27"));
  11581. this.shareTxt = (this.getChild("shareTxt"));
  11582. this.n32 = (this.getChild("n32"));
  11583. this.n38 = (this.getChild("n38"));
  11584. this.n39 = (this.getChild("n39"));
  11585. this.n44 = (this.getChild("n44"));
  11586. this.diamondTxt = (this.getChild("diamondTxt"));
  11587. this.n41 = (this.getChild("n41"));
  11588. this.n45 = (this.getChild("n45"));
  11589. this.n47 = (this.getChild("n47"));
  11590. this.n48 = (this.getChild("n48"));
  11591. this.randTxt = (this.getChild("randTxt"));
  11592. this.n50 = (this.getChild("n50"));
  11593. this.t0 = this.getTransition("t0");
  11594. }
  11595. }
  11596. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  11597. class ui_dh_zs1 extends fgui.GComponent {
  11598. static createInstance() {
  11599. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  11600. }
  11601. onConstruct() {
  11602. this.n10 = (this.getChild("n10"));
  11603. this.n9 = (this.getChild("n9"));
  11604. this.n1 = (this.getChild("n1"));
  11605. this.n2 = (this.getChild("n2"));
  11606. this.n3 = (this.getChild("n3"));
  11607. this.n4 = (this.getChild("n4"));
  11608. this.n5 = (this.getChild("n5"));
  11609. this.n6 = (this.getChild("n6"));
  11610. this.n8 = (this.getChild("n8"));
  11611. this.n11 = (this.getChild("n11"));
  11612. this.t0 = this.getTransition("t0");
  11613. }
  11614. }
  11615. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  11616. class ui_dh_zs1_1 extends fgui.GComponent {
  11617. static createInstance() {
  11618. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  11619. }
  11620. onConstruct() {
  11621. this.n3 = (this.getChild("n3"));
  11622. this.n1 = (this.getChild("n1"));
  11623. this.t0 = this.getTransition("t0");
  11624. }
  11625. }
  11626. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  11627. class ui_hb_zs2 extends fgui.GButton {
  11628. static createInstance() {
  11629. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  11630. }
  11631. onConstruct() {
  11632. this.n20 = (this.getChild("n20"));
  11633. this.n21 = (this.getChild("n21"));
  11634. this.n26 = (this.getChild("n26"));
  11635. this.n27 = (this.getChild("n27"));
  11636. this.n32 = (this.getChild("n32"));
  11637. this.n38 = (this.getChild("n38"));
  11638. this.n39 = (this.getChild("n39"));
  11639. this.n44 = (this.getChild("n44"));
  11640. this.diamondTxt = (this.getChild("diamondTxt"));
  11641. this.n41 = (this.getChild("n41"));
  11642. this.n45 = (this.getChild("n45"));
  11643. this.t0 = this.getTransition("t0");
  11644. }
  11645. }
  11646. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  11647. class ui_hb_zs3 extends fgui.GButton {
  11648. static createInstance() {
  11649. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  11650. }
  11651. onConstruct() {
  11652. this.n20 = (this.getChild("n20"));
  11653. this.n21 = (this.getChild("n21"));
  11654. this.n26 = (this.getChild("n26"));
  11655. this.n27 = (this.getChild("n27"));
  11656. this.n32 = (this.getChild("n32"));
  11657. this.n38 = (this.getChild("n38"));
  11658. this.n47 = (this.getChild("n47"));
  11659. this.t0 = this.getTransition("t0");
  11660. }
  11661. }
  11662. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  11663. class ui_dh_zs2 extends fgui.GComponent {
  11664. static createInstance() {
  11665. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  11666. }
  11667. onConstruct() {
  11668. this.n10 = (this.getChild("n10"));
  11669. this.n9 = (this.getChild("n9"));
  11670. this.n1 = (this.getChild("n1"));
  11671. this.n2 = (this.getChild("n2"));
  11672. this.n3 = (this.getChild("n3"));
  11673. this.n4 = (this.getChild("n4"));
  11674. this.n5 = (this.getChild("n5"));
  11675. this.n6 = (this.getChild("n6"));
  11676. this.n8 = (this.getChild("n8"));
  11677. this.n11 = (this.getChild("n11"));
  11678. this.t0 = this.getTransition("t0");
  11679. }
  11680. }
  11681. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  11682. class ui_dh_zs2_1 extends fgui.GComponent {
  11683. static createInstance() {
  11684. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  11685. }
  11686. onConstruct() {
  11687. this.n3 = (this.getChild("n3"));
  11688. this.n1 = (this.getChild("n1"));
  11689. this.t0 = this.getTransition("t0");
  11690. }
  11691. }
  11692. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  11693. class ui_dh_zs3 extends fgui.GComponent {
  11694. static createInstance() {
  11695. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  11696. }
  11697. onConstruct() {
  11698. this.n10 = (this.getChild("n10"));
  11699. this.n9 = (this.getChild("n9"));
  11700. this.n1 = (this.getChild("n1"));
  11701. this.n2 = (this.getChild("n2"));
  11702. this.n3 = (this.getChild("n3"));
  11703. this.n4 = (this.getChild("n4"));
  11704. this.n5 = (this.getChild("n5"));
  11705. this.n6 = (this.getChild("n6"));
  11706. this.n8 = (this.getChild("n8"));
  11707. this.n11 = (this.getChild("n11"));
  11708. this.t0 = this.getTransition("t0");
  11709. }
  11710. }
  11711. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  11712. class ui_dh_zs3_1 extends fgui.GComponent {
  11713. static createInstance() {
  11714. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  11715. }
  11716. onConstruct() {
  11717. this.n3 = (this.getChild("n3"));
  11718. this.n1 = (this.getChild("n1"));
  11719. this.t0 = this.getTransition("t0");
  11720. }
  11721. }
  11722. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  11723. class ui_Component107 extends fgui.GComponent {
  11724. static createInstance() {
  11725. return (fgui.UIPackage.createObject("game", "Component107"));
  11726. }
  11727. onConstruct() {
  11728. this.n18 = (this.getChild("n18"));
  11729. this.n19 = (this.getChild("n19"));
  11730. this.n20 = (this.getChild("n20"));
  11731. this.n21 = (this.getChild("n21"));
  11732. this.n22 = (this.getChild("n22"));
  11733. this.levelTxt = (this.getChild("levelTxt"));
  11734. this.t0 = this.getTransition("t0");
  11735. }
  11736. }
  11737. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  11738. class ui_box_com1 extends fgui.GComponent {
  11739. static createInstance() {
  11740. return (fgui.UIPackage.createObject("game", "box_com1"));
  11741. }
  11742. onConstruct() {
  11743. this.n14 = (this.getChild("n14"));
  11744. this.n6 = (this.getChild("n6"));
  11745. this.t0 = this.getTransition("t0");
  11746. }
  11747. }
  11748. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  11749. class ui_box_com2 extends fgui.GProgressBar {
  11750. static createInstance() {
  11751. return (fgui.UIPackage.createObject("game", "box_com2"));
  11752. }
  11753. onConstruct() {
  11754. this.bg0 = (this.getChild("bg0"));
  11755. this.bg = (this.getChild("bg"));
  11756. this.bar = (this.getChild("bar"));
  11757. this.n7 = (this.getChild("n7"));
  11758. this.n8 = (this.getChild("n8"));
  11759. this.n10 = (this.getChild("n10"));
  11760. this.n11 = (this.getChild("n11"));
  11761. this.n12 = (this.getChild("n12"));
  11762. }
  11763. }
  11764. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  11765. class ui_box_com4 extends fgui.GComponent {
  11766. static createInstance() {
  11767. return (fgui.UIPackage.createObject("game", "box_com4"));
  11768. }
  11769. onConstruct() {
  11770. this.n8 = (this.getChild("n8"));
  11771. this.t0 = this.getTransition("t0");
  11772. }
  11773. }
  11774. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  11775. class ui_box_com3 extends fgui.GComponent {
  11776. static createInstance() {
  11777. return (fgui.UIPackage.createObject("game", "box_com3"));
  11778. }
  11779. onConstruct() {
  11780. this.n2 = (this.getChild("n2"));
  11781. this.n3 = (this.getChild("n3"));
  11782. this.n4 = (this.getChild("n4"));
  11783. this.n5 = (this.getChild("n5"));
  11784. this.t0 = this.getTransition("t0");
  11785. this.t1 = this.getTransition("t1");
  11786. }
  11787. }
  11788. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  11789. class ui_Component97 extends fgui.GComponent {
  11790. static createInstance() {
  11791. return (fgui.UIPackage.createObject("game", "Component97"));
  11792. }
  11793. onConstruct() {
  11794. this.c1 = this.getController("c1");
  11795. this.n46 = (this.getChild("n46"));
  11796. this.diamondNode = (this.getChild("diamondNode"));
  11797. this.coinNode = (this.getChild("coinNode"));
  11798. this.t0 = this.getTransition("t0");
  11799. }
  11800. }
  11801. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  11802. class ui_Component98 extends fgui.GButton {
  11803. static createInstance() {
  11804. return (fgui.UIPackage.createObject("game", "Component98"));
  11805. }
  11806. onConstruct() {
  11807. this.n8 = (this.getChild("n8"));
  11808. this.n40 = (this.getChild("n40"));
  11809. }
  11810. }
  11811. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  11812. class ui_Component28_11 extends fgui.GButton {
  11813. static createInstance() {
  11814. return (fgui.UIPackage.createObject("game", "Component28_11"));
  11815. }
  11816. onConstruct() {
  11817. this.c1 = this.getController("c1");
  11818. this.n12 = (this.getChild("n12"));
  11819. this.n17 = (this.getChild("n17"));
  11820. this.n13 = (this.getChild("n13"));
  11821. this.diamondTxt = (this.getChild("diamondTxt"));
  11822. this.n15 = (this.getChild("n15"));
  11823. this.n16 = (this.getChild("n16"));
  11824. }
  11825. }
  11826. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  11827. class ui_Component58_11 extends fgui.GComponent {
  11828. static createInstance() {
  11829. return (fgui.UIPackage.createObject("game", "Component58_11"));
  11830. }
  11831. onConstruct() {
  11832. this.n23 = (this.getChild("n23"));
  11833. this.n41 = (this.getChild("n41"));
  11834. this.myList = (this.getChild("myList"));
  11835. this.n45 = (this.getChild("n45"));
  11836. this.n44 = (this.getChild("n44"));
  11837. this.t0 = this.getTransition("t0");
  11838. }
  11839. }
  11840. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  11841. class ui_Component100 extends fgui.GComponent {
  11842. static createInstance() {
  11843. return (fgui.UIPackage.createObject("game", "Component100"));
  11844. }
  11845. onConstruct() {
  11846. this.c1 = this.getController("c1");
  11847. this.n75 = (this.getChild("n75"));
  11848. this.n76 = (this.getChild("n76"));
  11849. this.n80 = (this.getChild("n80"));
  11850. this.txt = (this.getChild("txt"));
  11851. this.spineRoot = (this.getChild("spineRoot"));
  11852. }
  11853. }
  11854. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  11855. class ui_Component101 extends fgui.GComponent {
  11856. static createInstance() {
  11857. return (fgui.UIPackage.createObject("game", "Component101"));
  11858. }
  11859. onConstruct() {
  11860. this.c1 = this.getController("c1");
  11861. this.n36 = (this.getChild("n36"));
  11862. this.n35 = (this.getChild("n35"));
  11863. this.n33 = (this.getChild("n33"));
  11864. this.n34 = (this.getChild("n34"));
  11865. }
  11866. }
  11867. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  11868. class ui_Component53 extends fgui.GComponent {
  11869. static createInstance() {
  11870. return (fgui.UIPackage.createObject("game", "Component53"));
  11871. }
  11872. onConstruct() {
  11873. this.n0 = (this.getChild("n0"));
  11874. this.n1 = (this.getChild("n1"));
  11875. this.n2 = (this.getChild("n2"));
  11876. this.n3 = (this.getChild("n3"));
  11877. this.n4 = (this.getChild("n4"));
  11878. this.n5 = (this.getChild("n5"));
  11879. this.n6 = (this.getChild("n6"));
  11880. this.n7 = (this.getChild("n7"));
  11881. this.n8 = (this.getChild("n8"));
  11882. this.n9 = (this.getChild("n9"));
  11883. this.n10 = (this.getChild("n10"));
  11884. this.n11 = (this.getChild("n11"));
  11885. this.n12 = (this.getChild("n12"));
  11886. this.n13 = (this.getChild("n13"));
  11887. this.n14 = (this.getChild("n14"));
  11888. this.n15 = (this.getChild("n15"));
  11889. this.n16 = (this.getChild("n16"));
  11890. this.n19 = (this.getChild("n19"));
  11891. this.n20 = (this.getChild("n20"));
  11892. this.n21 = (this.getChild("n21"));
  11893. this.n22 = (this.getChild("n22"));
  11894. this.n23 = (this.getChild("n23"));
  11895. this.n24 = (this.getChild("n24"));
  11896. this.n25 = (this.getChild("n25"));
  11897. this.n26 = (this.getChild("n26"));
  11898. this.n27 = (this.getChild("n27"));
  11899. this.n28 = (this.getChild("n28"));
  11900. this.n29 = (this.getChild("n29"));
  11901. this.n30 = (this.getChild("n30"));
  11902. this.n31 = (this.getChild("n31"));
  11903. this.n32 = (this.getChild("n32"));
  11904. this.n33 = (this.getChild("n33"));
  11905. this.n34 = (this.getChild("n34"));
  11906. this.n35 = (this.getChild("n35"));
  11907. this.t0 = this.getTransition("t0");
  11908. }
  11909. }
  11910. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  11911. class ui_Component58 extends fgui.GComponent {
  11912. static createInstance() {
  11913. return (fgui.UIPackage.createObject("game", "Component58"));
  11914. }
  11915. onConstruct() {
  11916. this.n23 = (this.getChild("n23"));
  11917. this.n41 = (this.getChild("n41"));
  11918. this.n8 = (this.getChild("n8"));
  11919. this.skillList = (this.getChild("skillList"));
  11920. this.t0 = this.getTransition("t0");
  11921. }
  11922. }
  11923. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  11924. class ui_Component59 extends fgui.GComponent {
  11925. static createInstance() {
  11926. return (fgui.UIPackage.createObject("game", "Component59"));
  11927. }
  11928. onConstruct() {
  11929. this.n3 = (this.getChild("n3"));
  11930. this.msgTxt = (this.getChild("msgTxt"));
  11931. this.t0 = this.getTransition("t0");
  11932. }
  11933. }
  11934. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  11935. class ui_RulerNode extends fgui.GComponent {
  11936. static createInstance() {
  11937. return (fgui.UIPackage.createObject("game", "RulerNode"));
  11938. }
  11939. onConstruct() {
  11940. this.n6 = (this.getChild("n6"));
  11941. this.n4 = (this.getChild("n4"));
  11942. this.img1 = (this.getChild("img1"));
  11943. this.img2 = (this.getChild("img2"));
  11944. }
  11945. }
  11946. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  11947. class ui_Component108 extends fgui.GComponent {
  11948. static createInstance() {
  11949. return (fgui.UIPackage.createObject("game", "Component108"));
  11950. }
  11951. onConstruct() {
  11952. this.n19 = (this.getChild("n19"));
  11953. this.t0 = this.getTransition("t0");
  11954. }
  11955. }
  11956. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  11957. class ui_Component63 extends fgui.GComponent {
  11958. static createInstance() {
  11959. return (fgui.UIPackage.createObject("game", "Component63"));
  11960. }
  11961. onConstruct() {
  11962. this.n66 = (this.getChild("n66"));
  11963. this.n56 = (this.getChild("n56"));
  11964. this.n63 = (this.getChild("n63"));
  11965. this.n65 = (this.getChild("n65"));
  11966. this.t0 = this.getTransition("t0");
  11967. }
  11968. }
  11969. ui_Component63.URL = "ui://isxx5ak7h657452";
  11970. class ui_topNode extends fgui.GComponent {
  11971. static createInstance() {
  11972. return (fgui.UIPackage.createObject("game", "topNode"));
  11973. }
  11974. onConstruct() {
  11975. this.selfProgress = (this.getChild("selfProgress"));
  11976. this.aiProgress = (this.getChild("aiProgress"));
  11977. this.selfKuang = (this.getChild("selfKuang"));
  11978. this.aiKuang = (this.getChild("aiKuang"));
  11979. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  11980. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  11981. this.n33 = (this.getChild("n33"));
  11982. this.n34 = (this.getChild("n34"));
  11983. this.selfNameTxt = (this.getChild("selfNameTxt"));
  11984. this.aiNameTxt = (this.getChild("aiNameTxt"));
  11985. this.selfBallList = (this.getChild("selfBallList"));
  11986. this.aiBallList = (this.getChild("aiBallList"));
  11987. this.middleNode = (this.getChild("middleNode"));
  11988. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  11989. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  11990. this.scoreNode = (this.getChild("scoreNode"));
  11991. this.selfTips = (this.getChild("selfTips"));
  11992. this.aiTips = (this.getChild("aiTips"));
  11993. }
  11994. }
  11995. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  11996. class ui_selfProgress extends fgui.GProgressBar {
  11997. static createInstance() {
  11998. return (fgui.UIPackage.createObject("game", "selfProgress"));
  11999. }
  12000. onConstruct() {
  12001. this.n3 = (this.getChild("n3"));
  12002. this.bar = (this.getChild("bar"));
  12003. }
  12004. }
  12005. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  12006. class ui_aiProgress extends fgui.GProgressBar {
  12007. static createInstance() {
  12008. return (fgui.UIPackage.createObject("game", "aiProgress"));
  12009. }
  12010. onConstruct() {
  12011. this.n3 = (this.getChild("n3"));
  12012. this.bar = (this.getChild("bar"));
  12013. }
  12014. }
  12015. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  12016. class ui_ballDisplay extends fgui.GComponent {
  12017. static createInstance() {
  12018. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  12019. }
  12020. onConstruct() {
  12021. this.myImg = (this.getChild("myImg"));
  12022. }
  12023. }
  12024. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  12025. class ui_moveNode extends fgui.GComponent {
  12026. static createInstance() {
  12027. return (fgui.UIPackage.createObject("game", "moveNode"));
  12028. }
  12029. onConstruct() {
  12030. this.n8 = (this.getChild("n8"));
  12031. this.finger = (this.getChild("finger"));
  12032. }
  12033. }
  12034. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  12035. class ui_cancelBtn extends fgui.GButton {
  12036. static createInstance() {
  12037. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  12038. }
  12039. onConstruct() {
  12040. this.c1 = this.getController("c1");
  12041. this.n0 = (this.getChild("n0"));
  12042. this.n1 = (this.getChild("n1"));
  12043. }
  12044. }
  12045. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  12046. class ui_shareBtn extends fgui.GButton {
  12047. static createInstance() {
  12048. return (fgui.UIPackage.createObject("game", "shareBtn"));
  12049. }
  12050. onConstruct() {
  12051. this.c1 = this.getController("c1");
  12052. this.n2 = (this.getChild("n2"));
  12053. this.n1 = (this.getChild("n1"));
  12054. this.n3 = (this.getChild("n3"));
  12055. this.n4 = (this.getChild("n4"));
  12056. this.n5 = (this.getChild("n5"));
  12057. this.n6 = (this.getChild("n6"));
  12058. }
  12059. }
  12060. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  12061. class ui_share2Btn extends fgui.GButton {
  12062. static createInstance() {
  12063. return (fgui.UIPackage.createObject("game", "share2Btn"));
  12064. }
  12065. onConstruct() {
  12066. this.n3 = (this.getChild("n3"));
  12067. }
  12068. }
  12069. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  12070. class ui_rodMethodNode extends fgui.GComponent {
  12071. static createInstance() {
  12072. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  12073. }
  12074. onConstruct() {
  12075. this.bg = (this.getChild("bg"));
  12076. this.dot = (this.getChild("dot"));
  12077. }
  12078. }
  12079. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  12080. class ui_sureBtn extends fgui.GButton {
  12081. static createInstance() {
  12082. return (fgui.UIPackage.createObject("game", "sureBtn"));
  12083. }
  12084. onConstruct() {
  12085. this.n2 = (this.getChild("n2"));
  12086. this.n1 = (this.getChild("n1"));
  12087. }
  12088. }
  12089. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  12090. class ui_Component18 extends fgui.GComponent {
  12091. static createInstance() {
  12092. return (fgui.UIPackage.createObject("game", "Component18"));
  12093. }
  12094. onConstruct() {
  12095. this.c1 = this.getController("c1");
  12096. this.nameTxt = (this.getChild("nameTxt"));
  12097. this.headImg = (this.getChild("headImg"));
  12098. this.n24 = (this.getChild("n24"));
  12099. this.skillImg = (this.getChild("skillImg"));
  12100. this.skillTxt = (this.getChild("skillTxt"));
  12101. }
  12102. }
  12103. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  12104. class ui_Component45 extends fgui.GComponent {
  12105. static createInstance() {
  12106. return (fgui.UIPackage.createObject("game", "Component45"));
  12107. }
  12108. onConstruct() {
  12109. this.c1 = this.getController("c1");
  12110. this.n40 = (this.getChild("n40"));
  12111. this.n41 = (this.getChild("n41"));
  12112. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  12113. this.n42 = (this.getChild("n42"));
  12114. this.awardTxt = (this.getChild("awardTxt"));
  12115. this.n44 = (this.getChild("n44"));
  12116. this.t0 = this.getTransition("t0");
  12117. }
  12118. }
  12119. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  12120. class ui_emotionDisplay extends fgui.GButton {
  12121. static createInstance() {
  12122. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  12123. }
  12124. onConstruct() {
  12125. this.myIcon = (this.getChild("myIcon"));
  12126. }
  12127. }
  12128. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  12129. class ui_Component49 extends fgui.GButton {
  12130. static createInstance() {
  12131. return (fgui.UIPackage.createObject("game", "Component49"));
  12132. }
  12133. onConstruct() {
  12134. this.n69 = (this.getChild("n69"));
  12135. this.n56 = (this.getChild("n56"));
  12136. }
  12137. }
  12138. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  12139. class ui_Component50 extends fgui.GButton {
  12140. static createInstance() {
  12141. return (fgui.UIPackage.createObject("game", "Component50"));
  12142. }
  12143. onConstruct() {
  12144. this.n54 = (this.getChild("n54"));
  12145. this.n65 = (this.getChild("n65"));
  12146. }
  12147. }
  12148. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  12149. class ui_Component51 extends fgui.GButton {
  12150. static createInstance() {
  12151. return (fgui.UIPackage.createObject("game", "Component51"));
  12152. }
  12153. onConstruct() {
  12154. this.c1 = this.getController("c1");
  12155. this.n51 = (this.getChild("n51"));
  12156. this.n54 = (this.getChild("n54"));
  12157. }
  12158. }
  12159. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  12160. class ui_Button5 extends fgui.GButton {
  12161. static createInstance() {
  12162. return (fgui.UIPackage.createObject("game", "Button5"));
  12163. }
  12164. onConstruct() {
  12165. this.c1 = this.getController("c1");
  12166. this.n0 = (this.getChild("n0"));
  12167. this.n2 = (this.getChild("n2"));
  12168. }
  12169. }
  12170. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  12171. class ui_Component124 extends fgui.GComponent {
  12172. static createInstance() {
  12173. return (fgui.UIPackage.createObject("game", "Component124"));
  12174. }
  12175. onConstruct() {
  12176. this.n22 = (this.getChild("n22"));
  12177. this.shareNode = (this.getChild("shareNode"));
  12178. }
  12179. }
  12180. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  12181. class ui_Component125 extends fgui.GComponent {
  12182. static createInstance() {
  12183. return (fgui.UIPackage.createObject("game", "Component125"));
  12184. }
  12185. onConstruct() {
  12186. this.n29 = (this.getChild("n29"));
  12187. this.coinTxt = (this.getChild("coinTxt"));
  12188. }
  12189. }
  12190. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  12191. class ui_Component52 extends fgui.GButton {
  12192. static createInstance() {
  12193. return (fgui.UIPackage.createObject("game", "Component52"));
  12194. }
  12195. onConstruct() {
  12196. this.n35 = (this.getChild("n35"));
  12197. this.n36 = (this.getChild("n36"));
  12198. }
  12199. }
  12200. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  12201. class ui_drawBtn extends fgui.GButton {
  12202. static createInstance() {
  12203. return (fgui.UIPackage.createObject("game", "drawBtn"));
  12204. }
  12205. onConstruct() {
  12206. this.c1 = this.getController("c1");
  12207. this.n2 = (this.getChild("n2"));
  12208. this.n1 = (this.getChild("n1"));
  12209. this.n5 = (this.getChild("n5"));
  12210. }
  12211. }
  12212. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  12213. class ui_Component43 extends fgui.GButton {
  12214. static createInstance() {
  12215. return (fgui.UIPackage.createObject("game", "Component43"));
  12216. }
  12217. onConstruct() {
  12218. this.n49 = (this.getChild("n49"));
  12219. }
  12220. }
  12221. ui_Component43.URL = "ui://isxx5ak7iveg434";
  12222. class ui_wordsDisplay extends fgui.GComponent {
  12223. static createInstance() {
  12224. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  12225. }
  12226. onConstruct() {
  12227. this.txt = (this.getChild("txt"));
  12228. this.n63 = (this.getChild("n63"));
  12229. }
  12230. }
  12231. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  12232. class ui_Component3 extends fgui.GComponent {
  12233. static createInstance() {
  12234. return (fgui.UIPackage.createObject("game", "Component3"));
  12235. }
  12236. onConstruct() {
  12237. this.n26 = (this.getChild("n26"));
  12238. this.n24 = (this.getChild("n24"));
  12239. this.nameTxt = (this.getChild("nameTxt"));
  12240. this.headRoot = (this.getChild("headRoot"));
  12241. }
  12242. }
  12243. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  12244. class ui_Component4 extends fgui.GComponent {
  12245. static createInstance() {
  12246. return (fgui.UIPackage.createObject("game", "Component4"));
  12247. }
  12248. onConstruct() {
  12249. this.n44 = (this.getChild("n44"));
  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. this.n20 = (this.getChild("n20"));
  12270. this.n21 = (this.getChild("n21"));
  12271. }
  12272. }
  12273. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  12274. class ui_Component9 extends fgui.GButton {
  12275. static createInstance() {
  12276. return (fgui.UIPackage.createObject("game", "Component9"));
  12277. }
  12278. onConstruct() {
  12279. this.n18 = (this.getChild("n18"));
  12280. this.n19 = (this.getChild("n19"));
  12281. this.n20 = (this.getChild("n20"));
  12282. }
  12283. }
  12284. ui_Component9.URL = "ui://isxx5ak7ixm43xs";
  12285. class ui_Component10 extends fgui.GButton {
  12286. static createInstance() {
  12287. return (fgui.UIPackage.createObject("game", "Component10"));
  12288. }
  12289. onConstruct() {
  12290. this.c1 = this.getController("c1");
  12291. this.n40 = (this.getChild("n40"));
  12292. this.n41 = (this.getChild("n41"));
  12293. }
  12294. }
  12295. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  12296. class ui_Component11 extends fgui.GButton {
  12297. static createInstance() {
  12298. return (fgui.UIPackage.createObject("game", "Component11"));
  12299. }
  12300. onConstruct() {
  12301. this.n34 = (this.getChild("n34"));
  12302. this.n42 = (this.getChild("n42"));
  12303. }
  12304. }
  12305. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  12306. class ui_Component12 extends fgui.GButton {
  12307. static createInstance() {
  12308. return (fgui.UIPackage.createObject("game", "Component12"));
  12309. }
  12310. onConstruct() {
  12311. this.n35 = (this.getChild("n35"));
  12312. this.n43 = (this.getChild("n43"));
  12313. this.t0 = this.getTransition("t0");
  12314. }
  12315. }
  12316. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  12317. class ui_Component13 extends fgui.GButton {
  12318. static createInstance() {
  12319. return (fgui.UIPackage.createObject("game", "Component13"));
  12320. }
  12321. onConstruct() {
  12322. this.n27 = (this.getChild("n27"));
  12323. this.n36 = (this.getChild("n36"));
  12324. }
  12325. }
  12326. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  12327. class ui_Component16 extends fgui.GButton {
  12328. static createInstance() {
  12329. return (fgui.UIPackage.createObject("game", "Component16"));
  12330. }
  12331. onConstruct() {
  12332. this.n30 = (this.getChild("n30"));
  12333. this.n39 = (this.getChild("n39"));
  12334. }
  12335. }
  12336. ui_Component16.URL = "ui://isxx5ak7ixm43xz";
  12337. class ui_dh_js_tuowei extends fgui.GComponent {
  12338. static createInstance() {
  12339. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  12340. }
  12341. onConstruct() {
  12342. this.n19 = (this.getChild("n19"));
  12343. this.n18 = (this.getChild("n18"));
  12344. this.n0 = (this.getChild("n0"));
  12345. this.n3 = (this.getChild("n3"));
  12346. this.n4 = (this.getChild("n4"));
  12347. this.n5 = (this.getChild("n5"));
  12348. this.n6 = (this.getChild("n6"));
  12349. this.n8 = (this.getChild("n8"));
  12350. this.n9 = (this.getChild("n9"));
  12351. this.n10 = (this.getChild("n10"));
  12352. this.n11 = (this.getChild("n11"));
  12353. this.n12 = (this.getChild("n12"));
  12354. this.n13 = (this.getChild("n13"));
  12355. this.n14 = (this.getChild("n14"));
  12356. this.n15 = (this.getChild("n15"));
  12357. this.n20 = (this.getChild("n20"));
  12358. this.t0 = this.getTransition("t0");
  12359. this.t1 = this.getTransition("t1");
  12360. }
  12361. }
  12362. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  12363. class ui_dh_js_tw_g extends fgui.GComponent {
  12364. static createInstance() {
  12365. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  12366. }
  12367. onConstruct() {
  12368. this.n0 = (this.getChild("n0"));
  12369. this.n1 = (this.getChild("n1"));
  12370. this.t0 = this.getTransition("t0");
  12371. }
  12372. }
  12373. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  12374. class ui_dh_js_xingxing extends fgui.GComponent {
  12375. static createInstance() {
  12376. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  12377. }
  12378. onConstruct() {
  12379. this.n1 = (this.getChild("n1"));
  12380. this.n2 = (this.getChild("n2"));
  12381. this.n3 = (this.getChild("n3"));
  12382. this.n4 = (this.getChild("n4"));
  12383. this.n0 = (this.getChild("n0"));
  12384. this.t2 = this.getTransition("t2");
  12385. this.t1 = this.getTransition("t1");
  12386. }
  12387. }
  12388. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  12389. class ui_dh_zy_jiazai extends fgui.GComponent {
  12390. static createInstance() {
  12391. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  12392. }
  12393. onConstruct() {
  12394. this.c1 = this.getController("c1");
  12395. this.n0 = (this.getChild("n0"));
  12396. this.n1 = (this.getChild("n1"));
  12397. this.n2 = (this.getChild("n2"));
  12398. this.n4 = (this.getChild("n4"));
  12399. this.n5 = (this.getChild("n5"));
  12400. this.n6 = (this.getChild("n6"));
  12401. this.n8 = (this.getChild("n8"));
  12402. this.n7 = (this.getChild("n7"));
  12403. this.t0 = this.getTransition("t0");
  12404. }
  12405. }
  12406. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  12407. class ui_dh_js_xingxing2 extends fgui.GComponent {
  12408. static createInstance() {
  12409. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  12410. }
  12411. onConstruct() {
  12412. this.c1 = this.getController("c1");
  12413. this.n3 = (this.getChild("n3"));
  12414. this.n5 = (this.getChild("n5"));
  12415. this.n4 = (this.getChild("n4"));
  12416. this.n0 = (this.getChild("n0"));
  12417. this.n1 = (this.getChild("n1"));
  12418. this.n2 = (this.getChild("n2"));
  12419. }
  12420. }
  12421. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  12422. class ui_dh_js_tuowei2 extends fgui.GComponent {
  12423. static createInstance() {
  12424. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  12425. }
  12426. onConstruct() {
  12427. this.n19 = (this.getChild("n19"));
  12428. this.n21 = (this.getChild("n21"));
  12429. this.n0 = (this.getChild("n0"));
  12430. this.n3 = (this.getChild("n3"));
  12431. this.n4 = (this.getChild("n4"));
  12432. this.n5 = (this.getChild("n5"));
  12433. this.n6 = (this.getChild("n6"));
  12434. this.n8 = (this.getChild("n8"));
  12435. this.n9 = (this.getChild("n9"));
  12436. this.n10 = (this.getChild("n10"));
  12437. this.n11 = (this.getChild("n11"));
  12438. this.n12 = (this.getChild("n12"));
  12439. this.n13 = (this.getChild("n13"));
  12440. this.n14 = (this.getChild("n14"));
  12441. this.n15 = (this.getChild("n15"));
  12442. this.n23 = (this.getChild("n23"));
  12443. this.t0 = this.getTransition("t0");
  12444. this.t1 = this.getTransition("t1");
  12445. }
  12446. }
  12447. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  12448. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  12449. static createInstance() {
  12450. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  12451. }
  12452. onConstruct() {
  12453. this.n1 = (this.getChild("n1"));
  12454. this.n2 = (this.getChild("n2"));
  12455. this.t0 = this.getTransition("t0");
  12456. }
  12457. }
  12458. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  12459. class ui_dh_js_shibai_1 extends fgui.GComponent {
  12460. static createInstance() {
  12461. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  12462. }
  12463. onConstruct() {
  12464. this.n4 = (this.getChild("n4"));
  12465. this.n2 = (this.getChild("n2"));
  12466. this.n3 = (this.getChild("n3"));
  12467. this.idle = this.getTransition("idle");
  12468. this.attack = this.getTransition("attack");
  12469. }
  12470. }
  12471. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  12472. class ui_special extends fgui.GComponent {
  12473. static createInstance() {
  12474. return (fgui.UIPackage.createObject("game", "special"));
  12475. }
  12476. onConstruct() {
  12477. this.n18 = (this.getChild("n18"));
  12478. this.n19 = (this.getChild("n19"));
  12479. this.n20 = (this.getChild("n20"));
  12480. this.n21 = (this.getChild("n21"));
  12481. this.n22 = (this.getChild("n22"));
  12482. this.levelTxt = (this.getChild("levelTxt"));
  12483. this.n24 = (this.getChild("n24"));
  12484. this.n25 = (this.getChild("n25"));
  12485. this.t0 = this.getTransition("t0");
  12486. }
  12487. }
  12488. ui_special.URL = "ui://isxx5ak7j979v4i6";
  12489. class ui_Component145 extends fgui.GComponent {
  12490. static createInstance() {
  12491. return (fgui.UIPackage.createObject("game", "Component145"));
  12492. }
  12493. onConstruct() {
  12494. this.guanyuNode = (this.getChild("guanyuNode"));
  12495. }
  12496. }
  12497. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  12498. class ui_longBtn extends fgui.GButton {
  12499. static createInstance() {
  12500. return (fgui.UIPackage.createObject("game", "longBtn"));
  12501. }
  12502. onConstruct() {
  12503. this.c1 = this.getController("c1");
  12504. this.n2 = (this.getChild("n2"));
  12505. this.n1 = (this.getChild("n1"));
  12506. this.n4 = (this.getChild("n4"));
  12507. }
  12508. }
  12509. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  12510. class ui_Component146 extends fgui.GComponent {
  12511. static createInstance() {
  12512. return (fgui.UIPackage.createObject("game", "Component146"));
  12513. }
  12514. onConstruct() {
  12515. this.n89 = (this.getChild("n89"));
  12516. this.n90 = (this.getChild("n90"));
  12517. this.guideBtn = (this.getChild("guideBtn"));
  12518. }
  12519. }
  12520. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  12521. class ui_Component146_11 extends fgui.GComponent {
  12522. static createInstance() {
  12523. return (fgui.UIPackage.createObject("game", "Component146_11"));
  12524. }
  12525. onConstruct() {
  12526. this.n89 = (this.getChild("n89"));
  12527. this.n90 = (this.getChild("n90"));
  12528. this.guideBtn = (this.getChild("guideBtn"));
  12529. }
  12530. }
  12531. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  12532. class ui_Component111_1 extends fgui.GComponent {
  12533. static createInstance() {
  12534. return (fgui.UIPackage.createObject("game", "Component111_1"));
  12535. }
  12536. onConstruct() {
  12537. this.n68 = (this.getChild("n68"));
  12538. this.myMask = (this.getChild("myMask"));
  12539. }
  12540. }
  12541. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  12542. class ui_Component64_1 extends fgui.GComponent {
  12543. static createInstance() {
  12544. return (fgui.UIPackage.createObject("game", "Component64_1"));
  12545. }
  12546. onConstruct() {
  12547. this.n57 = (this.getChild("n57"));
  12548. this.n54 = (this.getChild("n54"));
  12549. this.n55 = (this.getChild("n55"));
  12550. this.n56 = (this.getChild("n56"));
  12551. this.t1 = this.getTransition("t1");
  12552. }
  12553. }
  12554. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  12555. class ui_ModeSelection_com123 extends fgui.GComponent {
  12556. static createInstance() {
  12557. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  12558. }
  12559. onConstruct() {
  12560. this.type1 = (this.getChild("type1"));
  12561. this.type2 = (this.getChild("type2"));
  12562. this.type3 = (this.getChild("type3"));
  12563. this.n38 = (this.getChild("n38"));
  12564. this.t0 = this.getTransition("t0");
  12565. }
  12566. }
  12567. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  12568. class ui_Component132_2 extends fgui.GComponent {
  12569. static createInstance() {
  12570. return (fgui.UIPackage.createObject("game", "Component132_2"));
  12571. }
  12572. onConstruct() {
  12573. this.n25 = (this.getChild("n25"));
  12574. this.n26 = (this.getChild("n26"));
  12575. this.n27 = (this.getChild("n27"));
  12576. this.t0 = this.getTransition("t0");
  12577. }
  12578. }
  12579. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  12580. class ui_UIPower$1 extends fgui.GComponent {
  12581. static createInstance() {
  12582. return (fgui.UIPackage.createObject("game", "UIPower"));
  12583. }
  12584. onConstruct() {
  12585. this.n11 = (this.getChild("n11"));
  12586. this.myNode = (this.getChild("myNode"));
  12587. this.t0 = this.getTransition("t0");
  12588. }
  12589. }
  12590. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  12591. class ui_Component133 extends fgui.GComponent {
  12592. static createInstance() {
  12593. return (fgui.UIPackage.createObject("game", "Component133"));
  12594. }
  12595. onConstruct() {
  12596. this.n29 = (this.getChild("n29"));
  12597. this.n30 = (this.getChild("n30"));
  12598. }
  12599. }
  12600. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  12601. class ui_Component134 extends fgui.GComponent {
  12602. static createInstance() {
  12603. return (fgui.UIPackage.createObject("game", "Component134"));
  12604. }
  12605. onConstruct() {
  12606. this.n30 = (this.getChild("n30"));
  12607. this.n31 = (this.getChild("n31"));
  12608. this.t0 = this.getTransition("t0");
  12609. }
  12610. }
  12611. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  12612. class ui_Component135 extends fgui.GComponent {
  12613. static createInstance() {
  12614. return (fgui.UIPackage.createObject("game", "Component135"));
  12615. }
  12616. onConstruct() {
  12617. this.n30 = (this.getChild("n30"));
  12618. this.t0 = this.getTransition("t0");
  12619. }
  12620. }
  12621. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  12622. class ui_Component137 extends fgui.GComponent {
  12623. static createInstance() {
  12624. return (fgui.UIPackage.createObject("game", "Component137"));
  12625. }
  12626. onConstruct() {
  12627. this.n28 = (this.getChild("n28"));
  12628. this.n29 = (this.getChild("n29"));
  12629. this.n30 = (this.getChild("n30"));
  12630. this.n32 = (this.getChild("n32"));
  12631. }
  12632. }
  12633. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  12634. class ui_dh_zuanshi extends fgui.GButton {
  12635. static createInstance() {
  12636. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  12637. }
  12638. onConstruct() {
  12639. this.n1 = (this.getChild("n1"));
  12640. this.n2 = (this.getChild("n2"));
  12641. this.n0 = (this.getChild("n0"));
  12642. this.n3 = (this.getChild("n3"));
  12643. this.n4 = (this.getChild("n4"));
  12644. }
  12645. }
  12646. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  12647. class ui_Component138 extends fgui.GComponent {
  12648. static createInstance() {
  12649. return (fgui.UIPackage.createObject("game", "Component138"));
  12650. }
  12651. onConstruct() {
  12652. this.n1 = (this.getChild("n1"));
  12653. this.n2 = (this.getChild("n2"));
  12654. this.t0 = this.getTransition("t0");
  12655. }
  12656. }
  12657. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  12658. class ui_Component139 extends fgui.GComponent {
  12659. static createInstance() {
  12660. return (fgui.UIPackage.createObject("game", "Component139"));
  12661. }
  12662. onConstruct() {
  12663. this.n0 = (this.getChild("n0"));
  12664. this.t0 = this.getTransition("t0");
  12665. }
  12666. }
  12667. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  12668. class ui_Component140 extends fgui.GComponent {
  12669. static createInstance() {
  12670. return (fgui.UIPackage.createObject("game", "Component140"));
  12671. }
  12672. onConstruct() {
  12673. this.n2 = (this.getChild("n2"));
  12674. this.n3 = (this.getChild("n3"));
  12675. this.t0 = this.getTransition("t0");
  12676. }
  12677. }
  12678. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  12679. class ui_Component141 extends fgui.GComponent {
  12680. static createInstance() {
  12681. return (fgui.UIPackage.createObject("game", "Component141"));
  12682. }
  12683. onConstruct() {
  12684. this.n0 = (this.getChild("n0"));
  12685. this.t0 = this.getTransition("t0");
  12686. }
  12687. }
  12688. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  12689. class ui_powerNode extends fgui.GProgressBar {
  12690. static createInstance() {
  12691. return (fgui.UIPackage.createObject("game", "powerNode"));
  12692. }
  12693. onConstruct() {
  12694. this.n2 = (this.getChild("n2"));
  12695. this.bar_v = (this.getChild("bar_v"));
  12696. this.showImg = (this.getChild("showImg"));
  12697. this.n12 = (this.getChild("n12"));
  12698. }
  12699. }
  12700. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  12701. class ui_dh_jingbi1 extends fgui.GComponent {
  12702. static createInstance() {
  12703. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  12704. }
  12705. onConstruct() {
  12706. this.n0 = (this.getChild("n0"));
  12707. this.n1 = (this.getChild("n1"));
  12708. this.n2 = (this.getChild("n2"));
  12709. this.n3 = (this.getChild("n3"));
  12710. this.n4 = (this.getChild("n4"));
  12711. this.n5 = (this.getChild("n5"));
  12712. this.n6 = (this.getChild("n6"));
  12713. this.n8 = (this.getChild("n8"));
  12714. this.t0 = this.getTransition("t0");
  12715. }
  12716. }
  12717. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  12718. class ui_Component94 extends fgui.GButton {
  12719. static createInstance() {
  12720. return (fgui.UIPackage.createObject("game", "Component94"));
  12721. }
  12722. onConstruct() {
  12723. this.n77 = (this.getChild("n77"));
  12724. }
  12725. }
  12726. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  12727. class ui_Component95 extends fgui.GButton {
  12728. static createInstance() {
  12729. return (fgui.UIPackage.createObject("game", "Component95"));
  12730. }
  12731. onConstruct() {
  12732. this.n77 = (this.getChild("n77"));
  12733. }
  12734. }
  12735. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  12736. class ui_Component126 extends fgui.GComponent {
  12737. static createInstance() {
  12738. return (fgui.UIPackage.createObject("game", "Component126"));
  12739. }
  12740. onConstruct() {
  12741. this.c1 = this.getController("c1");
  12742. this.normalBtn = (this.getChild("normalBtn"));
  12743. this.tripleBtn = (this.getChild("tripleBtn"));
  12744. }
  12745. }
  12746. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  12747. class ui_Component60 extends fgui.GComponent {
  12748. static createInstance() {
  12749. return (fgui.UIPackage.createObject("game", "Component60"));
  12750. }
  12751. onConstruct() {
  12752. this.c1 = this.getController("c1");
  12753. this.n48 = (this.getChild("n48"));
  12754. this.womanTxt = (this.getChild("womanTxt"));
  12755. this.t0 = this.getTransition("t0");
  12756. }
  12757. }
  12758. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  12759. class ui_Component98_3 extends fgui.GButton {
  12760. static createInstance() {
  12761. return (fgui.UIPackage.createObject("game", "Component98_3"));
  12762. }
  12763. onConstruct() {
  12764. this.c1 = this.getController("c1");
  12765. this.n8 = (this.getChild("n8"));
  12766. this.n41 = (this.getChild("n41"));
  12767. this.n40 = (this.getChild("n40"));
  12768. }
  12769. }
  12770. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  12771. class ui_ModeSelection_com1 extends fgui.GButton {
  12772. static createInstance() {
  12773. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  12774. }
  12775. onConstruct() {
  12776. this.n34 = (this.getChild("n34"));
  12777. this.n36 = (this.getChild("n36"));
  12778. this.n22 = (this.getChild("n22"));
  12779. this.n20 = (this.getChild("n20"));
  12780. this.n23 = (this.getChild("n23"));
  12781. this.n24 = (this.getChild("n24"));
  12782. this.n26 = (this.getChild("n26"));
  12783. this.n33 = (this.getChild("n33"));
  12784. this.coinImg = (this.getChild("coinImg"));
  12785. this.need = (this.getChild("need"));
  12786. this.n35 = (this.getChild("n35"));
  12787. this.n29 = (this.getChild("n29"));
  12788. this.tipsTxt = (this.getChild("tipsTxt"));
  12789. this.n30 = (this.getChild("n30"));
  12790. this.peopleTxt = (this.getChild("peopleTxt"));
  12791. this.t0 = this.getTransition("t0");
  12792. }
  12793. }
  12794. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  12795. class ui_ModeSelection_com2 extends fgui.GButton {
  12796. static createInstance() {
  12797. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  12798. }
  12799. onConstruct() {
  12800. this.n36 = (this.getChild("n36"));
  12801. this.n34 = (this.getChild("n34"));
  12802. this.n22 = (this.getChild("n22"));
  12803. this.n20 = (this.getChild("n20"));
  12804. this.n23 = (this.getChild("n23"));
  12805. this.n24 = (this.getChild("n24"));
  12806. this.n26 = (this.getChild("n26"));
  12807. this.n33 = (this.getChild("n33"));
  12808. this.coinImg = (this.getChild("coinImg"));
  12809. this.need = (this.getChild("need"));
  12810. this.n35 = (this.getChild("n35"));
  12811. this.n29 = (this.getChild("n29"));
  12812. this.tipsTxt = (this.getChild("tipsTxt"));
  12813. this.n30 = (this.getChild("n30"));
  12814. this.peopleTxt = (this.getChild("peopleTxt"));
  12815. this.t0 = this.getTransition("t0");
  12816. }
  12817. }
  12818. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  12819. class ui_ModeSelection_com3 extends fgui.GButton {
  12820. static createInstance() {
  12821. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  12822. }
  12823. onConstruct() {
  12824. this.n34 = (this.getChild("n34"));
  12825. this.n36 = (this.getChild("n36"));
  12826. this.n22 = (this.getChild("n22"));
  12827. this.n20 = (this.getChild("n20"));
  12828. this.n23 = (this.getChild("n23"));
  12829. this.n24 = (this.getChild("n24"));
  12830. this.n26 = (this.getChild("n26"));
  12831. this.n33 = (this.getChild("n33"));
  12832. this.coinImg = (this.getChild("coinImg"));
  12833. this.need = (this.getChild("need"));
  12834. this.n35 = (this.getChild("n35"));
  12835. this.n29 = (this.getChild("n29"));
  12836. this.tipsTxt = (this.getChild("tipsTxt"));
  12837. this.n30 = (this.getChild("n30"));
  12838. this.peopleTxt = (this.getChild("peopleTxt"));
  12839. this.t0 = this.getTransition("t0");
  12840. }
  12841. }
  12842. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  12843. class ui_Invitation_com1 extends fgui.GComponent {
  12844. static createInstance() {
  12845. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  12846. }
  12847. onConstruct() {
  12848. this.n14 = (this.getChild("n14"));
  12849. this.n13 = (this.getChild("n13"));
  12850. this.n3 = (this.getChild("n3"));
  12851. this.n1 = (this.getChild("n1"));
  12852. this.n6 = (this.getChild("n6"));
  12853. this.n7 = (this.getChild("n7"));
  12854. this.enterBtn = (this.getChild("enterBtn"));
  12855. this.n11 = (this.getChild("n11"));
  12856. this.n12 = (this.getChild("n12"));
  12857. this.n15 = (this.getChild("n15"));
  12858. this.t0 = this.getTransition("t0");
  12859. this.t1 = this.getTransition("t1");
  12860. }
  12861. }
  12862. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  12863. class ui_Component87_1 extends fgui.GComponent {
  12864. static createInstance() {
  12865. return (fgui.UIPackage.createObject("game", "Component87_1"));
  12866. }
  12867. onConstruct() {
  12868. this.n74 = (this.getChild("n74"));
  12869. this.n73 = (this.getChild("n73"));
  12870. this.ballTxt = (this.getChild("ballTxt"));
  12871. this.n76 = (this.getChild("n76"));
  12872. this.helpLineBtn = (this.getChild("helpLineBtn"));
  12873. this.levelTxt = (this.getChild("levelTxt"));
  12874. this.n87 = (this.getChild("n87"));
  12875. this.n84 = (this.getChild("n84"));
  12876. this.hpTxt = (this.getChild("hpTxt"));
  12877. this.n89 = (this.getChild("n89"));
  12878. this.tipsTxt = (this.getChild("tipsTxt"));
  12879. }
  12880. }
  12881. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  12882. class ui_sqg1 extends fgui.GComponent {
  12883. static createInstance() {
  12884. return (fgui.UIPackage.createObject("game", "sqg1"));
  12885. }
  12886. onConstruct() {
  12887. this.n1 = (this.getChild("n1"));
  12888. this.n0 = (this.getChild("n0"));
  12889. }
  12890. }
  12891. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  12892. class ui_sqg2 extends fgui.GComponent {
  12893. static createInstance() {
  12894. return (fgui.UIPackage.createObject("game", "sqg2"));
  12895. }
  12896. onConstruct() {
  12897. this.n1 = (this.getChild("n1"));
  12898. this.n0 = (this.getChild("n0"));
  12899. }
  12900. }
  12901. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  12902. class ui_sqg3 extends fgui.GComponent {
  12903. static createInstance() {
  12904. return (fgui.UIPackage.createObject("game", "sqg3"));
  12905. }
  12906. onConstruct() {
  12907. this.n1 = (this.getChild("n1"));
  12908. this.n0 = (this.getChild("n0"));
  12909. }
  12910. }
  12911. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  12912. class ui_sqg4 extends fgui.GComponent {
  12913. static createInstance() {
  12914. return (fgui.UIPackage.createObject("game", "sqg4"));
  12915. }
  12916. onConstruct() {
  12917. this.n1 = (this.getChild("n1"));
  12918. this.n0 = (this.getChild("n0"));
  12919. }
  12920. }
  12921. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  12922. class ui_Component36 extends fgui.GButton {
  12923. static createInstance() {
  12924. return (fgui.UIPackage.createObject("game", "Component36"));
  12925. }
  12926. onConstruct() {
  12927. this.c1 = this.getController("c1");
  12928. this.n53 = (this.getChild("n53"));
  12929. this.n56 = (this.getChild("n56"));
  12930. }
  12931. }
  12932. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  12933. class ui_Component37 extends fgui.GButton {
  12934. static createInstance() {
  12935. return (fgui.UIPackage.createObject("game", "Component37"));
  12936. }
  12937. onConstruct() {
  12938. this.c1 = this.getController("c1");
  12939. this.n52 = (this.getChild("n52"));
  12940. this.n54 = (this.getChild("n54"));
  12941. }
  12942. }
  12943. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  12944. class ui_UISetting extends fgui.GComponent {
  12945. static createInstance() {
  12946. return (fgui.UIPackage.createObject("game", "UISetting"));
  12947. }
  12948. onConstruct() {
  12949. this.c1 = this.getController("c1");
  12950. this.n4 = (this.getChild("n4"));
  12951. this.soundBtn = (this.getChild("soundBtn"));
  12952. this.shakeBtn = (this.getChild("shakeBtn"));
  12953. this.clickNode = (this.getChild("clickNode"));
  12954. this.xyBtn = (this.getChild("xyBtn"));
  12955. }
  12956. }
  12957. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  12958. class ui_Component39 extends fgui.GComponent {
  12959. static createInstance() {
  12960. return (fgui.UIPackage.createObject("game", "Component39"));
  12961. }
  12962. onConstruct() {
  12963. this.n5 = (this.getChild("n5"));
  12964. this.n6 = (this.getChild("n6"));
  12965. this.n7 = (this.getChild("n7"));
  12966. this.t0 = this.getTransition("t0");
  12967. }
  12968. }
  12969. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  12970. class ui_Component40 extends fgui.GButton {
  12971. static createInstance() {
  12972. return (fgui.UIPackage.createObject("game", "Component40"));
  12973. }
  12974. onConstruct() {
  12975. this.n46 = (this.getChild("n46"));
  12976. this.n47 = (this.getChild("n47"));
  12977. }
  12978. }
  12979. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  12980. class ui_Component41 extends fgui.GComponent {
  12981. static createInstance() {
  12982. return (fgui.UIPackage.createObject("game", "Component41"));
  12983. }
  12984. onConstruct() {
  12985. this.c1 = this.getController("c1");
  12986. this.n0 = (this.getChild("n0"));
  12987. this.titleTxt = (this.getChild("titleTxt"));
  12988. this.n2 = (this.getChild("n2"));
  12989. this.msgTips = (this.getChild("msgTips"));
  12990. this.numTxt = (this.getChild("numTxt"));
  12991. this.n18 = (this.getChild("n18"));
  12992. this.cancelBtn = (this.getChild("cancelBtn"));
  12993. this.videoBtn = (this.getChild("videoBtn"));
  12994. this.n10 = (this.getChild("n10"));
  12995. }
  12996. }
  12997. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  12998. class ui_Component42 extends fgui.GComponent {
  12999. static createInstance() {
  13000. return (fgui.UIPackage.createObject("game", "Component42"));
  13001. }
  13002. onConstruct() {
  13003. this.c1 = this.getController("c1");
  13004. this.n1 = (this.getChild("n1"));
  13005. this.n2 = (this.getChild("n2"));
  13006. this.n3 = (this.getChild("n3"));
  13007. this.tipsTxt = (this.getChild("tipsTxt"));
  13008. this.cancelBtn = (this.getChild("cancelBtn"));
  13009. this.sureBtn = (this.getChild("sureBtn"));
  13010. this.n11 = (this.getChild("n11"));
  13011. this.n13 = (this.getChild("n13"));
  13012. this.n14 = (this.getChild("n14"));
  13013. this.womanTxt = (this.getChild("womanTxt"));
  13014. this.t0 = this.getTransition("t0");
  13015. }
  13016. }
  13017. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  13018. class ui_dh_js_shengli extends fgui.GComponent {
  13019. static createInstance() {
  13020. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  13021. }
  13022. onConstruct() {
  13023. this.n3 = (this.getChild("n3"));
  13024. this.n4 = (this.getChild("n4"));
  13025. this.n1 = (this.getChild("n1"));
  13026. this.n2 = (this.getChild("n2"));
  13027. this.n5 = (this.getChild("n5"));
  13028. this.n6 = (this.getChild("n6"));
  13029. this.n7 = (this.getChild("n7"));
  13030. this.n8 = (this.getChild("n8"));
  13031. this.attack = this.getTransition("attack");
  13032. this.idle = this.getTransition("idle");
  13033. }
  13034. }
  13035. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  13036. class ui_dh_js_shengli_g extends fgui.GComponent {
  13037. static createInstance() {
  13038. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  13039. }
  13040. onConstruct() {
  13041. this.n3 = (this.getChild("n3"));
  13042. this.n1 = (this.getChild("n1"));
  13043. this.t0 = this.getTransition("t0");
  13044. }
  13045. }
  13046. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  13047. class ui_dh_js_shibai extends fgui.GComponent {
  13048. static createInstance() {
  13049. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  13050. }
  13051. onConstruct() {
  13052. this.n0 = (this.getChild("n0"));
  13053. this.n1 = (this.getChild("n1"));
  13054. this.n2 = (this.getChild("n2"));
  13055. this.n3 = (this.getChild("n3"));
  13056. this.idle = this.getTransition("idle");
  13057. this.attack = this.getTransition("attack");
  13058. }
  13059. }
  13060. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  13061. class ui_dh_zy_ganfa extends fgui.GButton {
  13062. static createInstance() {
  13063. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  13064. }
  13065. onConstruct() {
  13066. this.n27 = (this.getChild("n27"));
  13067. this.n0 = (this.getChild("n0"));
  13068. this.n1 = (this.getChild("n1"));
  13069. this.n13 = (this.getChild("n13"));
  13070. this.n14 = (this.getChild("n14"));
  13071. this.n15 = (this.getChild("n15"));
  13072. this.n3 = (this.getChild("n3"));
  13073. this.n4 = (this.getChild("n4"));
  13074. this.n5 = (this.getChild("n5"));
  13075. this.n6 = (this.getChild("n6"));
  13076. this.n7 = (this.getChild("n7"));
  13077. this.n8 = (this.getChild("n8"));
  13078. this.n9 = (this.getChild("n9"));
  13079. this.n10 = (this.getChild("n10"));
  13080. this.n12 = (this.getChild("n12"));
  13081. this.n11 = (this.getChild("n11"));
  13082. this.n16 = (this.getChild("n16"));
  13083. this.n17 = (this.getChild("n17"));
  13084. this.n18 = (this.getChild("n18"));
  13085. this.n19 = (this.getChild("n19"));
  13086. this.n20 = (this.getChild("n20"));
  13087. this.n21 = (this.getChild("n21"));
  13088. this.n28 = (this.getChild("n28"));
  13089. this.n29 = (this.getChild("n29"));
  13090. this.t0 = this.getTransition("t0");
  13091. }
  13092. }
  13093. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  13094. class ui_dh_zy_ganzi extends fgui.GComponent {
  13095. static createInstance() {
  13096. return (fgui.UIPackage.createObject("game", "dh_zy_ganzi"));
  13097. }
  13098. onConstruct() {
  13099. this.n3 = (this.getChild("n3"));
  13100. this.n2 = (this.getChild("n2"));
  13101. this.t0 = this.getTransition("t0");
  13102. }
  13103. }
  13104. ui_dh_zy_ganzi.URL = "ui://isxx5ak7n43d3vm";
  13105. class ui_dh_zy_sc_guang extends fgui.GButton {
  13106. static createInstance() {
  13107. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  13108. }
  13109. onConstruct() {
  13110. this.n1 = (this.getChild("n1"));
  13111. this.n3 = (this.getChild("n3"));
  13112. this.n0 = (this.getChild("n0"));
  13113. this.n2 = (this.getChild("n2"));
  13114. this.n4 = (this.getChild("n4"));
  13115. this.t0 = this.getTransition("t0");
  13116. this.t1 = this.getTransition("t1");
  13117. }
  13118. }
  13119. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  13120. class ui_dh_zy_shangcheng extends fgui.GComponent {
  13121. static createInstance() {
  13122. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  13123. }
  13124. onConstruct() {
  13125. this.n0 = (this.getChild("n0"));
  13126. this.n3 = (this.getChild("n3"));
  13127. this.t0 = this.getTransition("t0");
  13128. }
  13129. }
  13130. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  13131. class ui_dh_zy_wanfa extends fgui.GButton {
  13132. static createInstance() {
  13133. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  13134. }
  13135. onConstruct() {
  13136. this.n0 = (this.getChild("n0"));
  13137. this.n2 = (this.getChild("n2"));
  13138. this.n1 = (this.getChild("n1"));
  13139. this.n3 = (this.getChild("n3"));
  13140. this.n8 = (this.getChild("n8"));
  13141. this.t0 = this.getTransition("t0");
  13142. }
  13143. }
  13144. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  13145. class ui_Component53_1 extends fgui.GComponent {
  13146. static createInstance() {
  13147. return (fgui.UIPackage.createObject("game", "Component53_1"));
  13148. }
  13149. onConstruct() {
  13150. this.n0 = (this.getChild("n0"));
  13151. this.n1 = (this.getChild("n1"));
  13152. this.n2 = (this.getChild("n2"));
  13153. this.n3 = (this.getChild("n3"));
  13154. this.n4 = (this.getChild("n4"));
  13155. this.n5 = (this.getChild("n5"));
  13156. this.n6 = (this.getChild("n6"));
  13157. this.n7 = (this.getChild("n7"));
  13158. this.n8 = (this.getChild("n8"));
  13159. this.n9 = (this.getChild("n9"));
  13160. this.n10 = (this.getChild("n10"));
  13161. this.n11 = (this.getChild("n11"));
  13162. this.n12 = (this.getChild("n12"));
  13163. this.n13 = (this.getChild("n13"));
  13164. this.n14 = (this.getChild("n14"));
  13165. this.n15 = (this.getChild("n15"));
  13166. this.n16 = (this.getChild("n16"));
  13167. this.n19 = (this.getChild("n19"));
  13168. this.n20 = (this.getChild("n20"));
  13169. this.n21 = (this.getChild("n21"));
  13170. this.n22 = (this.getChild("n22"));
  13171. this.n23 = (this.getChild("n23"));
  13172. this.n24 = (this.getChild("n24"));
  13173. this.n25 = (this.getChild("n25"));
  13174. this.n26 = (this.getChild("n26"));
  13175. this.n27 = (this.getChild("n27"));
  13176. this.n28 = (this.getChild("n28"));
  13177. this.n29 = (this.getChild("n29"));
  13178. this.n30 = (this.getChild("n30"));
  13179. this.n31 = (this.getChild("n31"));
  13180. this.n32 = (this.getChild("n32"));
  13181. this.n33 = (this.getChild("n33"));
  13182. this.n34 = (this.getChild("n34"));
  13183. this.n35 = (this.getChild("n35"));
  13184. this.t0 = this.getTransition("t0");
  13185. }
  13186. }
  13187. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  13188. class ui_Component30 extends fgui.GComponent {
  13189. static createInstance() {
  13190. return (fgui.UIPackage.createObject("game", "Component30"));
  13191. }
  13192. onConstruct() {
  13193. this.c1 = this.getController("c1");
  13194. this.n46 = (this.getChild("n46"));
  13195. this.n47 = (this.getChild("n47"));
  13196. this.numTxt = (this.getChild("numTxt"));
  13197. this.n50 = (this.getChild("n50"));
  13198. this.n53 = (this.getChild("n53"));
  13199. this.n54 = (this.getChild("n54"));
  13200. this.n55 = (this.getChild("n55"));
  13201. this.n56 = (this.getChild("n56"));
  13202. }
  13203. }
  13204. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  13205. class ui_Component30_1 extends fgui.GComponent {
  13206. static createInstance() {
  13207. return (fgui.UIPackage.createObject("game", "Component30_1"));
  13208. }
  13209. onConstruct() {
  13210. this.c1 = this.getController("c1");
  13211. this.n46 = (this.getChild("n46"));
  13212. this.n47 = (this.getChild("n47"));
  13213. this.numTxt = (this.getChild("numTxt"));
  13214. this.n50 = (this.getChild("n50"));
  13215. this.n51 = (this.getChild("n51"));
  13216. this.n52 = (this.getChild("n52"));
  13217. this.n53 = (this.getChild("n53"));
  13218. this.n54 = (this.getChild("n54"));
  13219. }
  13220. }
  13221. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  13222. class ui_Component31 extends fgui.GComponent {
  13223. static createInstance() {
  13224. return (fgui.UIPackage.createObject("game", "Component31"));
  13225. }
  13226. onConstruct() {
  13227. this.n55 = (this.getChild("n55"));
  13228. this.n54 = (this.getChild("n54"));
  13229. this.conditionTxt = (this.getChild("conditionTxt"));
  13230. this.n57 = (this.getChild("n57"));
  13231. this.t0 = this.getTransition("t0");
  13232. }
  13233. }
  13234. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  13235. class ui_Component32 extends fgui.GComponent {
  13236. static createInstance() {
  13237. return (fgui.UIPackage.createObject("game", "Component32"));
  13238. }
  13239. onConstruct() {
  13240. this.n5 = (this.getChild("n5"));
  13241. this.n6 = (this.getChild("n6"));
  13242. this.n7 = (this.getChild("n7"));
  13243. this.t0 = this.getTransition("t0");
  13244. }
  13245. }
  13246. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  13247. class ui_AwardItem extends fgui.GComponent {
  13248. static createInstance() {
  13249. return (fgui.UIPackage.createObject("game", "AwardItem"));
  13250. }
  13251. onConstruct() {
  13252. this.n9 = (this.getChild("n9"));
  13253. this.myIcon = (this.getChild("myIcon"));
  13254. this.numTxt = (this.getChild("numTxt"));
  13255. this.nameTxt = (this.getChild("nameTxt"));
  13256. this.n16 = (this.getChild("n16"));
  13257. this.n17 = (this.getChild("n17"));
  13258. }
  13259. }
  13260. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  13261. class ui_ranking_com1 extends fgui.GButton {
  13262. static createInstance() {
  13263. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  13264. }
  13265. onConstruct() {
  13266. this.c1 = this.getController("c1");
  13267. this.n49 = (this.getChild("n49"));
  13268. this.n18 = (this.getChild("n18"));
  13269. this.n46 = (this.getChild("n46"));
  13270. this.n48 = (this.getChild("n48"));
  13271. this.n50 = (this.getChild("n50"));
  13272. }
  13273. }
  13274. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  13275. class ui_ranking_com2 extends fgui.GButton {
  13276. static createInstance() {
  13277. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  13278. }
  13279. onConstruct() {
  13280. this.c1 = this.getController("c1");
  13281. this.n49 = (this.getChild("n49"));
  13282. this.n18 = (this.getChild("n18"));
  13283. this.n46 = (this.getChild("n46"));
  13284. this.n48 = (this.getChild("n48"));
  13285. this.n50 = (this.getChild("n50"));
  13286. }
  13287. }
  13288. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  13289. class ui_ranking_com3 extends fgui.GComponent {
  13290. static createInstance() {
  13291. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  13292. }
  13293. onConstruct() {
  13294. this.n17 = (this.getChild("n17"));
  13295. this.myIcon = (this.getChild("myIcon"));
  13296. }
  13297. }
  13298. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  13299. class ui_ranking_com4 extends fgui.GComponent {
  13300. static createInstance() {
  13301. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  13302. }
  13303. onConstruct() {
  13304. this.n16 = (this.getChild("n16"));
  13305. this.head = (this.getChild("head"));
  13306. }
  13307. }
  13308. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  13309. class ui_ranking_com5 extends fgui.GComponent {
  13310. static createInstance() {
  13311. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  13312. }
  13313. onConstruct() {
  13314. this.c1 = this.getController("c1");
  13315. this.c2 = this.getController("c2");
  13316. this.n2 = (this.getChild("n2"));
  13317. this.n3 = (this.getChild("n3"));
  13318. this.levelBtn = (this.getChild("levelBtn"));
  13319. this.starBtn = (this.getChild("starBtn"));
  13320. this.n23 = (this.getChild("n23"));
  13321. this.n24 = (this.getChild("n24"));
  13322. this.n25 = (this.getChild("n25"));
  13323. this.myList = (this.getChild("myList"));
  13324. this.selfNode = (this.getChild("selfNode"));
  13325. this.n9 = (this.getChild("n9"));
  13326. this.n12 = (this.getChild("n12"));
  13327. this.n13 = (this.getChild("n13"));
  13328. this.n14 = (this.getChild("n14"));
  13329. this.n39 = (this.getChild("n39"));
  13330. this.n41 = (this.getChild("n41"));
  13331. this.n42 = (this.getChild("n42"));
  13332. this.n45 = (this.getChild("n45"));
  13333. this.changeBtn = (this.getChild("changeBtn"));
  13334. this.closeBtn = (this.getChild("closeBtn"));
  13335. this.t0 = this.getTransition("t0");
  13336. }
  13337. }
  13338. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  13339. class ui_RankItem extends fgui.GComponent {
  13340. static createInstance() {
  13341. return (fgui.UIPackage.createObject("game", "RankItem"));
  13342. }
  13343. onConstruct() {
  13344. this.n10 = (this.getChild("n10"));
  13345. this.n11 = (this.getChild("n11"));
  13346. this.rankTxt = (this.getChild("rankTxt"));
  13347. this.headNode = (this.getChild("headNode"));
  13348. this.nameTxt = (this.getChild("nameTxt"));
  13349. this.n19 = (this.getChild("n19"));
  13350. this.valueTxt = (this.getChild("valueTxt"));
  13351. this.img1 = (this.getChild("img1"));
  13352. this.img2 = (this.getChild("img2"));
  13353. this.img3 = (this.getChild("img3"));
  13354. }
  13355. }
  13356. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  13357. class ui_ranking_com9 extends fgui.GComponent {
  13358. static createInstance() {
  13359. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  13360. }
  13361. onConstruct() {
  13362. this.c1 = this.getController("c1");
  13363. this.n27 = (this.getChild("n27"));
  13364. this.n28 = (this.getChild("n28"));
  13365. this.headNode = (this.getChild("headNode"));
  13366. this.rankTxt = (this.getChild("rankTxt"));
  13367. this.nameTxt = (this.getChild("nameTxt"));
  13368. this.n34 = (this.getChild("n34"));
  13369. this.valueTxt = (this.getChild("valueTxt"));
  13370. this.n36 = (this.getChild("n36"));
  13371. this.n37 = (this.getChild("n37"));
  13372. this.n38 = (this.getChild("n38"));
  13373. this.n39 = (this.getChild("n39"));
  13374. this.n40 = (this.getChild("n40"));
  13375. }
  13376. }
  13377. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  13378. class ui_ranking_com10 extends fgui.GComponent {
  13379. static createInstance() {
  13380. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  13381. }
  13382. onConstruct() {
  13383. this.n23 = (this.getChild("n23"));
  13384. this.n24 = (this.getChild("n24"));
  13385. }
  13386. }
  13387. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  13388. class ui_ranking_com11 extends fgui.GComponent {
  13389. static createInstance() {
  13390. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  13391. }
  13392. onConstruct() {
  13393. this.n24 = (this.getChild("n24"));
  13394. this.n25 = (this.getChild("n25"));
  13395. this.t0 = this.getTransition("t0");
  13396. }
  13397. }
  13398. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  13399. class ui_ranking_com13 extends fgui.GButton {
  13400. static createInstance() {
  13401. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  13402. }
  13403. onConstruct() {
  13404. this.c1 = this.getController("c1");
  13405. this.n44 = (this.getChild("n44"));
  13406. this.n45 = (this.getChild("n45"));
  13407. this.n46 = (this.getChild("n46"));
  13408. }
  13409. }
  13410. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  13411. class ui_Component122 extends fgui.GComponent {
  13412. static createInstance() {
  13413. return (fgui.UIPackage.createObject("game", "Component122"));
  13414. }
  13415. onConstruct() {
  13416. this.gameNode1 = (this.getChild("gameNode1"));
  13417. this.gameNode2 = (this.getChild("gameNode2"));
  13418. this.gameNode3 = (this.getChild("gameNode3"));
  13419. }
  13420. }
  13421. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  13422. class ui_skillItem extends fgui.GComponent {
  13423. static createInstance() {
  13424. return (fgui.UIPackage.createObject("game", "skillItem"));
  13425. }
  13426. onConstruct() {
  13427. this.c1 = this.getController("c1");
  13428. this.n31 = (this.getChild("n31"));
  13429. this.n6 = (this.getChild("n6"));
  13430. this.skillImg = (this.getChild("skillImg"));
  13431. this.nameTxt = (this.getChild("nameTxt"));
  13432. this.levelTxt = (this.getChild("levelTxt"));
  13433. this.n28 = (this.getChild("n28"));
  13434. this.describeTxt = (this.getChild("describeTxt"));
  13435. this.n32 = (this.getChild("n32"));
  13436. this.mutiBtn = (this.getChild("mutiBtn"));
  13437. this.tryNode = (this.getChild("tryNode"));
  13438. this.normalBtn = (this.getChild("normalBtn"));
  13439. this.startBtn = (this.getChild("startBtn"));
  13440. this.n42 = (this.getChild("n42"));
  13441. this.n43 = (this.getChild("n43"));
  13442. this.n44 = (this.getChild("n44"));
  13443. }
  13444. }
  13445. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  13446. class ui_Component26 extends fgui.GButton {
  13447. static createInstance() {
  13448. return (fgui.UIPackage.createObject("game", "Component26"));
  13449. }
  13450. onConstruct() {
  13451. this.n11 = (this.getChild("n11"));
  13452. this.n30 = (this.getChild("n30"));
  13453. this.n34 = (this.getChild("n34"));
  13454. }
  13455. }
  13456. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  13457. class ui_Component28 extends fgui.GButton {
  13458. static createInstance() {
  13459. return (fgui.UIPackage.createObject("game", "Component28"));
  13460. }
  13461. onConstruct() {
  13462. this.n12 = (this.getChild("n12"));
  13463. this.n31 = (this.getChild("n31"));
  13464. this.curTxt = (this.getChild("curTxt"));
  13465. this.n33 = (this.getChild("n33"));
  13466. }
  13467. }
  13468. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  13469. class ui_Component113 extends fgui.GComponent {
  13470. static createInstance() {
  13471. return (fgui.UIPackage.createObject("game", "Component113"));
  13472. }
  13473. onConstruct() {
  13474. this.n85 = (this.getChild("n85"));
  13475. this.n86 = (this.getChild("n86"));
  13476. this.n77 = (this.getChild("n77"));
  13477. this.n79 = (this.getChild("n79"));
  13478. this.n80 = (this.getChild("n80"));
  13479. this.n81 = (this.getChild("n81"));
  13480. this.n82 = (this.getChild("n82"));
  13481. this.n84 = (this.getChild("n84"));
  13482. this.n87 = (this.getChild("n87"));
  13483. this.t0 = this.getTransition("t0");
  13484. }
  13485. }
  13486. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  13487. class ui_Component114 extends fgui.GComponent {
  13488. static createInstance() {
  13489. return (fgui.UIPackage.createObject("game", "Component114"));
  13490. }
  13491. onConstruct() {
  13492. this.n77 = (this.getChild("n77"));
  13493. this.t0 = this.getTransition("t0");
  13494. }
  13495. }
  13496. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  13497. class ui_Component115 extends fgui.GComponent {
  13498. static createInstance() {
  13499. return (fgui.UIPackage.createObject("game", "Component115"));
  13500. }
  13501. onConstruct() {
  13502. this.n83 = (this.getChild("n83"));
  13503. this.fingerNode = (this.getChild("fingerNode"));
  13504. this.n84 = (this.getChild("n84"));
  13505. }
  13506. }
  13507. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  13508. class ui_Component117 extends fgui.GComponent {
  13509. static createInstance() {
  13510. return (fgui.UIPackage.createObject("game", "Component117"));
  13511. }
  13512. onConstruct() {
  13513. this.n87 = (this.getChild("n87"));
  13514. this.n88 = (this.getChild("n88"));
  13515. this.n84 = (this.getChild("n84"));
  13516. this.n85 = (this.getChild("n85"));
  13517. this.n86 = (this.getChild("n86"));
  13518. this.t0 = this.getTransition("t0");
  13519. }
  13520. }
  13521. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  13522. class ui_Component98_1 extends fgui.GButton {
  13523. static createInstance() {
  13524. return (fgui.UIPackage.createObject("game", "Component98_1"));
  13525. }
  13526. onConstruct() {
  13527. this.c1 = this.getController("c1");
  13528. this.n8 = (this.getChild("n8"));
  13529. this.n41 = (this.getChild("n41"));
  13530. this.n40 = (this.getChild("n40"));
  13531. }
  13532. }
  13533. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  13534. class ui_Component61 extends fgui.GComponent {
  13535. static createInstance() {
  13536. return (fgui.UIPackage.createObject("game", "Component61"));
  13537. }
  13538. onConstruct() {
  13539. this.n14 = (this.getChild("n14"));
  13540. this.n6 = (this.getChild("n6"));
  13541. this.t0 = this.getTransition("t0");
  13542. }
  13543. }
  13544. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  13545. class ui_Component62 extends fgui.GComponent {
  13546. static createInstance() {
  13547. return (fgui.UIPackage.createObject("game", "Component62"));
  13548. }
  13549. onConstruct() {
  13550. this.n66 = (this.getChild("n66"));
  13551. this.n56 = (this.getChild("n56"));
  13552. this.n63 = (this.getChild("n63"));
  13553. this.n65 = (this.getChild("n65"));
  13554. this.t0 = this.getTransition("t0");
  13555. }
  13556. }
  13557. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  13558. class ui_d3Root extends fgui.GComponent {
  13559. static createInstance() {
  13560. return (fgui.UIPackage.createObject("game", "d3Root"));
  13561. }
  13562. onConstruct() {
  13563. }
  13564. }
  13565. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  13566. class ui_d2Root extends fgui.GComponent {
  13567. static createInstance() {
  13568. return (fgui.UIPackage.createObject("game", "d2Root"));
  13569. }
  13570. onConstruct() {
  13571. }
  13572. }
  13573. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  13574. class ui_ballNode extends fgui.GComponent {
  13575. static createInstance() {
  13576. return (fgui.UIPackage.createObject("game", "ballNode"));
  13577. }
  13578. onConstruct() {
  13579. }
  13580. }
  13581. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  13582. class ui_border extends fgui.GComponent {
  13583. static createInstance() {
  13584. return (fgui.UIPackage.createObject("game", "border"));
  13585. }
  13586. onConstruct() {
  13587. this.bar1 = (this.getChild("bar1"));
  13588. this.bar2 = (this.getChild("bar2"));
  13589. this.bar3 = (this.getChild("bar3"));
  13590. this.bar4 = (this.getChild("bar4"));
  13591. this.bar5 = (this.getChild("bar5"));
  13592. this.bar6 = (this.getChild("bar6"));
  13593. this.circle1 = (this.getChild("circle1"));
  13594. this.circle2 = (this.getChild("circle2"));
  13595. this.circle3 = (this.getChild("circle3"));
  13596. this.circle4 = (this.getChild("circle4"));
  13597. this.circle5 = (this.getChild("circle5"));
  13598. this.circle6 = (this.getChild("circle6"));
  13599. this.n28 = (this.getChild("n28"));
  13600. }
  13601. }
  13602. ui_border.URL = "ui://isxx5ak7sdh33qq";
  13603. class ui_Component41_2 extends fgui.GComponent {
  13604. static createInstance() {
  13605. return (fgui.UIPackage.createObject("game", "Component41_2"));
  13606. }
  13607. onConstruct() {
  13608. this.c1 = this.getController("c1");
  13609. this.n0 = (this.getChild("n0"));
  13610. this.n2 = (this.getChild("n2"));
  13611. this.n19 = (this.getChild("n19"));
  13612. this.cancelBtn = (this.getChild("cancelBtn"));
  13613. this.videoBtn = (this.getChild("videoBtn"));
  13614. this.n9 = (this.getChild("n9"));
  13615. this.n22 = (this.getChild("n22"));
  13616. this.tipsTxt = (this.getChild("tipsTxt"));
  13617. this.n23 = (this.getChild("n23"));
  13618. this.n24 = (this.getChild("n24"));
  13619. this.n26 = (this.getChild("n26"));
  13620. this.n27 = (this.getChild("n27"));
  13621. this.titleTxt = (this.getChild("titleTxt"));
  13622. }
  13623. }
  13624. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  13625. class ui_Component41_1 extends fgui.GComponent {
  13626. static createInstance() {
  13627. return (fgui.UIPackage.createObject("game", "Component41_1"));
  13628. }
  13629. onConstruct() {
  13630. this.c1 = this.getController("c1");
  13631. this.n0 = (this.getChild("n0"));
  13632. this.n2 = (this.getChild("n2"));
  13633. this.cancelBtn = (this.getChild("cancelBtn"));
  13634. this.videoBtn = (this.getChild("videoBtn"));
  13635. this.n27 = (this.getChild("n27"));
  13636. this.n30 = (this.getChild("n30"));
  13637. this.n31 = (this.getChild("n31"));
  13638. this.n32 = (this.getChild("n32"));
  13639. this.n33 = (this.getChild("n33"));
  13640. this.n34 = (this.getChild("n34"));
  13641. this.n35 = (this.getChild("n35"));
  13642. this.n36 = (this.getChild("n36"));
  13643. this.n1 = (this.getChild("n1"));
  13644. this.n37 = (this.getChild("n37"));
  13645. this.t0 = this.getTransition("t0");
  13646. this.t1 = this.getTransition("t1");
  13647. this.t2 = this.getTransition("t2");
  13648. this.t3 = this.getTransition("t3");
  13649. }
  13650. }
  13651. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  13652. class ui_againBtn extends fgui.GButton {
  13653. static createInstance() {
  13654. return (fgui.UIPackage.createObject("game", "againBtn"));
  13655. }
  13656. onConstruct() {
  13657. this.n2 = (this.getChild("n2"));
  13658. this.n1 = (this.getChild("n1"));
  13659. this.n5 = (this.getChild("n5"));
  13660. }
  13661. }
  13662. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  13663. class ui_Component118 extends fgui.GButton {
  13664. static createInstance() {
  13665. return (fgui.UIPackage.createObject("game", "Component118"));
  13666. }
  13667. onConstruct() {
  13668. this.c1 = this.getController("c1");
  13669. this.n14 = (this.getChild("n14"));
  13670. this.n9 = (this.getChild("n9"));
  13671. this.n10 = (this.getChild("n10"));
  13672. this.diamondTxt = (this.getChild("diamondTxt"));
  13673. this.n13 = (this.getChild("n13"));
  13674. this.n15 = (this.getChild("n15"));
  13675. }
  13676. }
  13677. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  13678. class ui_Component119 extends fgui.GComponent {
  13679. static createInstance() {
  13680. return (fgui.UIPackage.createObject("game", "Component119"));
  13681. }
  13682. onConstruct() {
  13683. this.n1 = (this.getChild("n1"));
  13684. this.n2 = (this.getChild("n2"));
  13685. this.n13 = (this.getChild("n13"));
  13686. this.n6 = (this.getChild("n6"));
  13687. this.screenNode = (this.getChild("screenNode"));
  13688. this.n15 = (this.getChild("n15"));
  13689. this.closeBtn = (this.getChild("closeBtn"));
  13690. this.share2Btn = (this.getChild("share2Btn"));
  13691. this.shareBtn = (this.getChild("shareBtn"));
  13692. this.tipsNode = (this.getChild("tipsNode"));
  13693. this.awardNode = (this.getChild("awardNode"));
  13694. }
  13695. }
  13696. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  13697. class ui_Component132_1 extends fgui.GComponent {
  13698. static createInstance() {
  13699. return (fgui.UIPackage.createObject("game", "Component132_1"));
  13700. }
  13701. onConstruct() {
  13702. this.n25 = (this.getChild("n25"));
  13703. this.n26 = (this.getChild("n26"));
  13704. this.n27 = (this.getChild("n27"));
  13705. this.t0 = this.getTransition("t0");
  13706. }
  13707. }
  13708. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  13709. class ui_SecretaryDisplay extends fgui.GComponent {
  13710. static createInstance() {
  13711. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  13712. }
  13713. onConstruct() {
  13714. this.n2 = (this.getChild("n2"));
  13715. this.levelTxt = (this.getChild("levelTxt"));
  13716. this.n4 = (this.getChild("n4"));
  13717. this.secretary = (this.getChild("secretary"));
  13718. this.purchaseBtn = (this.getChild("purchaseBtn"));
  13719. this.n16 = (this.getChild("n16"));
  13720. this.n37 = (this.getChild("n37"));
  13721. this.n41 = (this.getChild("n41"));
  13722. this.n14 = (this.getChild("n14"));
  13723. this.n17 = (this.getChild("n17"));
  13724. this.heightTxt = (this.getChild("heightTxt"));
  13725. this.n46 = (this.getChild("n46"));
  13726. this.n36 = (this.getChild("n36"));
  13727. this.n38 = (this.getChild("n38"));
  13728. this.foodTxt = (this.getChild("foodTxt"));
  13729. this.n47 = (this.getChild("n47"));
  13730. this.n40 = (this.getChild("n40"));
  13731. this.n42 = (this.getChild("n42"));
  13732. this.historyTxt = (this.getChild("historyTxt"));
  13733. this.n48 = (this.getChild("n48"));
  13734. this.nameImg = (this.getChild("nameImg"));
  13735. this.n12 = (this.getChild("n12"));
  13736. this.n49 = (this.getChild("n49"));
  13737. this.t0 = this.getTransition("t0");
  13738. }
  13739. }
  13740. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  13741. class ui_BallRodDisplay extends fgui.GComponent {
  13742. static createInstance() {
  13743. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  13744. }
  13745. onConstruct() {
  13746. this.c1 = this.getController("c1");
  13747. this.n31 = (this.getChild("n31"));
  13748. this.n6 = (this.getChild("n6"));
  13749. this.nameTxt = (this.getChild("nameTxt"));
  13750. this.rodImg = (this.getChild("rodImg"));
  13751. this.levelNode = (this.getChild("levelNode"));
  13752. this.eftRod = (this.getChild("eftRod"));
  13753. this.purchaseBtn = (this.getChild("purchaseBtn"));
  13754. }
  13755. }
  13756. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  13757. class ui_Component109 extends fgui.GComponent {
  13758. static createInstance() {
  13759. return (fgui.UIPackage.createObject("game", "Component109"));
  13760. }
  13761. onConstruct() {
  13762. this.n65 = (this.getChild("n65"));
  13763. this.n64 = (this.getChild("n64"));
  13764. this.n62 = (this.getChild("n62"));
  13765. this.n63 = (this.getChild("n63"));
  13766. this.t0 = this.getTransition("t0");
  13767. }
  13768. }
  13769. ui_Component109.URL = "ui://isxx5ak7vhzhv4hi";
  13770. class ui_Component110 extends fgui.GComponent {
  13771. static createInstance() {
  13772. return (fgui.UIPackage.createObject("game", "Component110"));
  13773. }
  13774. onConstruct() {
  13775. this.n65 = (this.getChild("n65"));
  13776. this.n64 = (this.getChild("n64"));
  13777. this.n62 = (this.getChild("n62"));
  13778. this.n63 = (this.getChild("n63"));
  13779. this.t0 = this.getTransition("t0");
  13780. }
  13781. }
  13782. ui_Component110.URL = "ui://isxx5ak7vhzhv4hj";
  13783. class ui_Component111_11 extends fgui.GComponent {
  13784. static createInstance() {
  13785. return (fgui.UIPackage.createObject("game", "Component111_11"));
  13786. }
  13787. onConstruct() {
  13788. this.n68 = (this.getChild("n68"));
  13789. this.n69 = (this.getChild("n69"));
  13790. }
  13791. }
  13792. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  13793. class ui_Component112 extends fgui.GComponent {
  13794. static createInstance() {
  13795. return (fgui.UIPackage.createObject("game", "Component112"));
  13796. }
  13797. onConstruct() {
  13798. this.n68 = (this.getChild("n68"));
  13799. this.n70 = (this.getChild("n70"));
  13800. this.myMask = (this.getChild("myMask"));
  13801. }
  13802. }
  13803. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  13804. class ui_Component111 extends fgui.GComponent {
  13805. static createInstance() {
  13806. return (fgui.UIPackage.createObject("game", "Component111"));
  13807. }
  13808. onConstruct() {
  13809. this.n68 = (this.getChild("n68"));
  13810. this.myMask = (this.getChild("myMask"));
  13811. }
  13812. }
  13813. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  13814. class ui_Component144 extends fgui.GButton {
  13815. static createInstance() {
  13816. return (fgui.UIPackage.createObject("game", "Component144"));
  13817. }
  13818. onConstruct() {
  13819. this.n8 = (this.getChild("n8"));
  13820. }
  13821. }
  13822. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  13823. class ui_Sign_com2 extends fgui.GComponent {
  13824. static createInstance() {
  13825. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  13826. }
  13827. onConstruct() {
  13828. this.n0 = (this.getChild("n0"));
  13829. this.n1 = (this.getChild("n1"));
  13830. this.t0 = this.getTransition("t0");
  13831. }
  13832. }
  13833. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  13834. class ui_Sign_guang extends fgui.GComponent {
  13835. static createInstance() {
  13836. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  13837. }
  13838. onConstruct() {
  13839. this.n1 = (this.getChild("n1"));
  13840. this.n2 = (this.getChild("n2"));
  13841. this.n3 = (this.getChild("n3"));
  13842. this.n4 = (this.getChild("n4"));
  13843. this.n5 = (this.getChild("n5"));
  13844. this.n6 = (this.getChild("n6"));
  13845. this.n8 = (this.getChild("n8"));
  13846. this.t0 = this.getTransition("t0");
  13847. }
  13848. }
  13849. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  13850. class ui_SignMax extends fgui.GComponent {
  13851. static createInstance() {
  13852. return (fgui.UIPackage.createObject("game", "SignMax"));
  13853. }
  13854. onConstruct() {
  13855. this.c1 = this.getController("c1");
  13856. this.n7 = (this.getChild("n7"));
  13857. this.n15 = (this.getChild("n15"));
  13858. this.n8 = (this.getChild("n8"));
  13859. this.titleTxt = (this.getChild("titleTxt"));
  13860. this.myIcon1 = (this.getChild("myIcon1"));
  13861. this.numTxt1 = (this.getChild("numTxt1"));
  13862. this.myIcon2 = (this.getChild("myIcon2"));
  13863. this.n20 = (this.getChild("n20"));
  13864. this.n17 = (this.getChild("n17"));
  13865. this.numTxt2 = (this.getChild("numTxt2"));
  13866. this.n12 = (this.getChild("n12"));
  13867. this.n13 = (this.getChild("n13"));
  13868. this.n21 = (this.getChild("n21"));
  13869. this.n14 = (this.getChild("n14"));
  13870. }
  13871. }
  13872. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  13873. class ui_Sign_com2_1 extends fgui.GComponent {
  13874. static createInstance() {
  13875. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  13876. }
  13877. onConstruct() {
  13878. this.n0 = (this.getChild("n0"));
  13879. this.n1 = (this.getChild("n1"));
  13880. this.t0 = this.getTransition("t0");
  13881. }
  13882. }
  13883. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  13884. class ui_Sign_com5 extends fgui.GComponent {
  13885. static createInstance() {
  13886. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  13887. }
  13888. onConstruct() {
  13889. this.n3 = (this.getChild("n3"));
  13890. this.n29 = (this.getChild("n29"));
  13891. this.n4 = (this.getChild("n4"));
  13892. this.day1 = (this.getChild("day1"));
  13893. this.day2 = (this.getChild("day2"));
  13894. this.day3 = (this.getChild("day3"));
  13895. this.day4 = (this.getChild("day4"));
  13896. this.day5 = (this.getChild("day5"));
  13897. this.day6 = (this.getChild("day6"));
  13898. this.day7 = (this.getChild("day7"));
  13899. this.t0 = this.getTransition("t0");
  13900. }
  13901. }
  13902. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  13903. class ui_Sign_com8 extends fgui.GComponent {
  13904. static createInstance() {
  13905. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  13906. }
  13907. onConstruct() {
  13908. this.n48 = (this.getChild("n48"));
  13909. this.womanTxt = (this.getChild("womanTxt"));
  13910. this.t0 = this.getTransition("t0");
  13911. }
  13912. }
  13913. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  13914. class ui_Sign_com6 extends fgui.GComponent {
  13915. static createInstance() {
  13916. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  13917. }
  13918. onConstruct() {
  13919. this.n2 = (this.getChild("n2"));
  13920. this.n3 = (this.getChild("n3"));
  13921. this.t0 = this.getTransition("t0");
  13922. }
  13923. }
  13924. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  13925. class ui_Sign_com7 extends fgui.GComponent {
  13926. static createInstance() {
  13927. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  13928. }
  13929. onConstruct() {
  13930. this.n29 = (this.getChild("n29"));
  13931. this.n2 = (this.getChild("n2"));
  13932. }
  13933. }
  13934. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  13935. class ui_UITurntable_com1_2 extends fgui.GComponent {
  13936. static createInstance() {
  13937. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  13938. }
  13939. onConstruct() {
  13940. this.n5 = (this.getChild("n5"));
  13941. this.n4 = (this.getChild("n4"));
  13942. this.t0 = this.getTransition("t0");
  13943. }
  13944. }
  13945. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  13946. class ui_UITurntable_com2 extends fgui.GComponent {
  13947. static createInstance() {
  13948. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  13949. }
  13950. onConstruct() {
  13951. this.c1 = this.getController("c1");
  13952. this.n4 = (this.getChild("n4"));
  13953. this.n6 = (this.getChild("n6"));
  13954. this.n10 = (this.getChild("n10"));
  13955. this.n11 = (this.getChild("n11"));
  13956. this.n12 = (this.getChild("n12"));
  13957. this.n13 = (this.getChild("n13"));
  13958. this.n14 = (this.getChild("n14"));
  13959. this.n15 = (this.getChild("n15"));
  13960. this.n16 = (this.getChild("n16"));
  13961. this.n17 = (this.getChild("n17"));
  13962. this.n18 = (this.getChild("n18"));
  13963. this.n19 = (this.getChild("n19"));
  13964. this.n20 = (this.getChild("n20"));
  13965. this.n21 = (this.getChild("n21"));
  13966. this.n22 = (this.getChild("n22"));
  13967. this.n23 = (this.getChild("n23"));
  13968. this.n24 = (this.getChild("n24"));
  13969. this.n25 = (this.getChild("n25"));
  13970. this.n26 = (this.getChild("n26"));
  13971. this.n27 = (this.getChild("n27"));
  13972. this.n28 = (this.getChild("n28"));
  13973. this.n29 = (this.getChild("n29"));
  13974. this.n30 = (this.getChild("n30"));
  13975. this.n31 = (this.getChild("n31"));
  13976. this.n32 = (this.getChild("n32"));
  13977. this.n33 = (this.getChild("n33"));
  13978. }
  13979. }
  13980. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  13981. class ui_UITurntable_com1_1 extends fgui.GComponent {
  13982. static createInstance() {
  13983. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  13984. }
  13985. onConstruct() {
  13986. this.n5 = (this.getChild("n5"));
  13987. this.n4 = (this.getChild("n4"));
  13988. this.t0 = this.getTransition("t0");
  13989. }
  13990. }
  13991. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  13992. class ui_UITurntable_com5 extends fgui.GComponent {
  13993. static createInstance() {
  13994. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  13995. }
  13996. onConstruct() {
  13997. this.flashNode = (this.getChild("flashNode"));
  13998. this.rotNode = (this.getChild("rotNode"));
  13999. this.n3 = (this.getChild("n3"));
  14000. this.n21 = (this.getChild("n21"));
  14001. this.t0 = this.getTransition("t0");
  14002. }
  14003. }
  14004. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  14005. class ui_UITurntable_com7 extends fgui.GComponent {
  14006. static createInstance() {
  14007. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  14008. }
  14009. onConstruct() {
  14010. this.n2 = (this.getChild("n2"));
  14011. this.n35 = (this.getChild("n35"));
  14012. this.img1 = (this.getChild("img1"));
  14013. this.img2 = (this.getChild("img2"));
  14014. this.img3 = (this.getChild("img3"));
  14015. this.img4 = (this.getChild("img4"));
  14016. this.img6 = (this.getChild("img6"));
  14017. this.img5 = (this.getChild("img5"));
  14018. this.txt1 = (this.getChild("txt1"));
  14019. this.txt2 = (this.getChild("txt2"));
  14020. this.txt3 = (this.getChild("txt3"));
  14021. this.txt4 = (this.getChild("txt4"));
  14022. this.txt5 = (this.getChild("txt5"));
  14023. this.txt6 = (this.getChild("txt6"));
  14024. }
  14025. }
  14026. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  14027. class ui_UITurntable_com9 extends fgui.GComponent {
  14028. static createInstance() {
  14029. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  14030. }
  14031. onConstruct() {
  14032. this.n38 = (this.getChild("n38"));
  14033. this.n39 = (this.getChild("n39"));
  14034. }
  14035. }
  14036. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  14037. class ui_UITurntable_com10 extends fgui.GComponent {
  14038. static createInstance() {
  14039. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  14040. }
  14041. onConstruct() {
  14042. this.n39 = (this.getChild("n39"));
  14043. this.n40 = (this.getChild("n40"));
  14044. this.t0 = this.getTransition("t0");
  14045. }
  14046. }
  14047. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  14048. class ui_UITurntable_com11 extends fgui.GComponent {
  14049. static createInstance() {
  14050. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  14051. }
  14052. onConstruct() {
  14053. this.n38 = (this.getChild("n38"));
  14054. this.n39 = (this.getChild("n39"));
  14055. this.n40 = (this.getChild("n40"));
  14056. this.t0 = this.getTransition("t0");
  14057. }
  14058. }
  14059. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  14060. class ui_UITurntable_com12 extends fgui.GComponent {
  14061. static createInstance() {
  14062. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  14063. }
  14064. onConstruct() {
  14065. this.n43 = (this.getChild("n43"));
  14066. this.barNode = (this.getChild("barNode"));
  14067. this.tipsTxt = (this.getChild("tipsTxt"));
  14068. this.n45 = (this.getChild("n45"));
  14069. this.boxBtn = (this.getChild("boxBtn"));
  14070. }
  14071. }
  14072. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  14073. class ui_UITurntable_com1 extends fgui.GButton {
  14074. static createInstance() {
  14075. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  14076. }
  14077. onConstruct() {
  14078. this.n41 = (this.getChild("n41"));
  14079. this.n42 = (this.getChild("n42"));
  14080. this.t0 = this.getTransition("t0");
  14081. }
  14082. }
  14083. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  14084. class ui_UITurntable_com3 extends fgui.GComponent {
  14085. static createInstance() {
  14086. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  14087. }
  14088. onConstruct() {
  14089. this.n48 = (this.getChild("n48"));
  14090. this.womanTxt = (this.getChild("womanTxt"));
  14091. this.t0 = this.getTransition("t0");
  14092. }
  14093. }
  14094. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  14095. class ui_cancelBtn2 extends fgui.GButton {
  14096. static createInstance() {
  14097. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  14098. }
  14099. onConstruct() {
  14100. this.c1 = this.getController("c1");
  14101. this.n0 = (this.getChild("n0"));
  14102. this.n1 = (this.getChild("n1"));
  14103. this.n2 = (this.getChild("n2"));
  14104. this.n3 = (this.getChild("n3"));
  14105. this.n4 = (this.getChild("n4"));
  14106. this.n5 = (this.getChild("n5"));
  14107. this.n6 = (this.getChild("n6"));
  14108. this.n7 = (this.getChild("n7"));
  14109. this.n8 = (this.getChild("n8"));
  14110. this.powerEft = (this.getChild("powerEft"));
  14111. }
  14112. }
  14113. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  14114. class ui_shareBtn2 extends fgui.GButton {
  14115. static createInstance() {
  14116. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  14117. }
  14118. onConstruct() {
  14119. this.c1 = this.getController("c1");
  14120. this.n2 = (this.getChild("n2"));
  14121. this.n24 = (this.getChild("n24"));
  14122. this.n1 = (this.getChild("n1"));
  14123. this.n3 = (this.getChild("n3"));
  14124. this.n23 = (this.getChild("n23"));
  14125. this.n4 = (this.getChild("n4"));
  14126. this.n5 = (this.getChild("n5"));
  14127. this.n6 = (this.getChild("n6"));
  14128. this.n20 = (this.getChild("n20"));
  14129. this.n21 = (this.getChild("n21"));
  14130. this.n22 = (this.getChild("n22"));
  14131. this.powerEft = (this.getChild("powerEft"));
  14132. }
  14133. }
  14134. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  14135. class ui_UIMoney extends fgui.GComponent {
  14136. static createInstance() {
  14137. return (fgui.UIPackage.createObject("game", "UIMoney"));
  14138. }
  14139. onConstruct() {
  14140. this.c1 = this.getController("c1");
  14141. this.n4 = (this.getChild("n4"));
  14142. this.coinImg = (this.getChild("coinImg"));
  14143. this.addCoinBtn = (this.getChild("addCoinBtn"));
  14144. this.coinTxt = (this.getChild("coinTxt"));
  14145. this.n7 = (this.getChild("n7"));
  14146. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  14147. this.diamondTxt = (this.getChild("diamondTxt"));
  14148. this.diamondImg = (this.getChild("diamondImg"));
  14149. this.n12 = (this.getChild("n12"));
  14150. this.powerImg = (this.getChild("powerImg"));
  14151. this.addPowerBtn = (this.getChild("addPowerBtn"));
  14152. this.powerTxt = (this.getChild("powerTxt"));
  14153. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  14154. }
  14155. }
  14156. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  14157. class ui_backBtn extends fgui.GButton {
  14158. static createInstance() {
  14159. return (fgui.UIPackage.createObject("game", "backBtn"));
  14160. }
  14161. onConstruct() {
  14162. this.n0 = (this.getChild("n0"));
  14163. this.t0 = this.getTransition("t0");
  14164. this.t1 = this.getTransition("t1");
  14165. }
  14166. }
  14167. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  14168. class ui_MoneyBtn extends fgui.GButton {
  14169. static createInstance() {
  14170. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  14171. }
  14172. onConstruct() {
  14173. this.button = this.getController("button");
  14174. this.n0 = (this.getChild("n0"));
  14175. }
  14176. }
  14177. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  14178. class ui_UIMoneyBtn extends fgui.GComponent {
  14179. static createInstance() {
  14180. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  14181. }
  14182. onConstruct() {
  14183. this.n1 = (this.getChild("n1"));
  14184. this.closeBtn = (this.getChild("closeBtn"));
  14185. }
  14186. }
  14187. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  14188. class ui_Component64 extends fgui.GComponent {
  14189. static createInstance() {
  14190. return (fgui.UIPackage.createObject("game", "Component64"));
  14191. }
  14192. onConstruct() {
  14193. this.n57 = (this.getChild("n57"));
  14194. this.n54 = (this.getChild("n54"));
  14195. this.n55 = (this.getChild("n55"));
  14196. this.n56 = (this.getChild("n56"));
  14197. this.t1 = this.getTransition("t1");
  14198. }
  14199. }
  14200. ui_Component64.URL = "ui://isxx5ak7wp26456";
  14201. class ui_Component41_3 extends fgui.GComponent {
  14202. static createInstance() {
  14203. return (fgui.UIPackage.createObject("game", "Component41_3"));
  14204. }
  14205. onConstruct() {
  14206. this.c1 = this.getController("c1");
  14207. this.n0 = (this.getChild("n0"));
  14208. this.n2 = (this.getChild("n2"));
  14209. this.cancelBtn = (this.getChild("cancelBtn"));
  14210. this.videoBtn = (this.getChild("videoBtn"));
  14211. this.n9 = (this.getChild("n9"));
  14212. this.n24 = (this.getChild("n24"));
  14213. this.n27 = (this.getChild("n27"));
  14214. this.titleTxt = (this.getChild("titleTxt"));
  14215. this.n28 = (this.getChild("n28"));
  14216. this.t0 = this.getTransition("t0");
  14217. }
  14218. }
  14219. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  14220. class ui_dh_zs_4 extends fgui.GComponent {
  14221. static createInstance() {
  14222. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  14223. }
  14224. onConstruct() {
  14225. this.n1 = (this.getChild("n1"));
  14226. this.n2 = (this.getChild("n2"));
  14227. this.n3 = (this.getChild("n3"));
  14228. this.n4 = (this.getChild("n4"));
  14229. this.n5 = (this.getChild("n5"));
  14230. this.n6 = (this.getChild("n6"));
  14231. this.n8 = (this.getChild("n8"));
  14232. this.t0 = this.getTransition("t0");
  14233. }
  14234. }
  14235. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  14236. class ui_Component71_1 extends fgui.GButton {
  14237. static createInstance() {
  14238. return (fgui.UIPackage.createObject("game", "Component71_1"));
  14239. }
  14240. onConstruct() {
  14241. this.n17 = (this.getChild("n17"));
  14242. this.t0 = this.getTransition("t0");
  14243. }
  14244. }
  14245. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  14246. class ui_Component83 extends fgui.GComponent {
  14247. static createInstance() {
  14248. return (fgui.UIPackage.createObject("game", "Component83"));
  14249. }
  14250. onConstruct() {
  14251. this.c1 = this.getController("c1");
  14252. this.n17 = (this.getChild("n17"));
  14253. this.n19 = (this.getChild("n19"));
  14254. this.n20 = (this.getChild("n20"));
  14255. }
  14256. }
  14257. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  14258. class ui_Component84 extends fgui.GComponent {
  14259. static createInstance() {
  14260. return (fgui.UIPackage.createObject("game", "Component84"));
  14261. }
  14262. onConstruct() {
  14263. this.c1 = this.getController("c1");
  14264. this.n4 = (this.getChild("n4"));
  14265. this.n22 = (this.getChild("n22"));
  14266. this.n23 = (this.getChild("n23"));
  14267. this.numTxt = (this.getChild("numTxt"));
  14268. this.n25 = (this.getChild("n25"));
  14269. this.n26 = (this.getChild("n26"));
  14270. }
  14271. }
  14272. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  14273. class ui_Component84_1 extends fgui.GComponent {
  14274. static createInstance() {
  14275. return (fgui.UIPackage.createObject("game", "Component84_1"));
  14276. }
  14277. onConstruct() {
  14278. this.c1 = this.getController("c1");
  14279. this.n4 = (this.getChild("n4"));
  14280. this.n22 = (this.getChild("n22"));
  14281. this.n23 = (this.getChild("n23"));
  14282. this.numTxt = (this.getChild("numTxt"));
  14283. this.n25 = (this.getChild("n25"));
  14284. this.n26 = (this.getChild("n26"));
  14285. }
  14286. }
  14287. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  14288. class ui_Component85 extends fgui.GComponent {
  14289. static createInstance() {
  14290. return (fgui.UIPackage.createObject("game", "Component85"));
  14291. }
  14292. onConstruct() {
  14293. this.n1 = (this.getChild("n1"));
  14294. this.n6 = (this.getChild("n6"));
  14295. this.n2 = (this.getChild("n2"));
  14296. this.n3 = (this.getChild("n3"));
  14297. this.levelTxt = (this.getChild("levelTxt"));
  14298. this.n10 = (this.getChild("n10"));
  14299. this.n11 = (this.getChild("n11"));
  14300. this.n12 = (this.getChild("n12"));
  14301. this.n13 = (this.getChild("n13"));
  14302. this.n14 = (this.getChild("n14"));
  14303. this.modeNode = (this.getChild("modeNode"));
  14304. this.n18 = (this.getChild("n18"));
  14305. this.conditionTxt = (this.getChild("conditionTxt"));
  14306. this.diamondNode = (this.getChild("diamondNode"));
  14307. this.coinNode = (this.getChild("coinNode"));
  14308. this.startBtn = (this.getChild("startBtn"));
  14309. this.n28 = (this.getChild("n28"));
  14310. this.displayRoot = (this.getChild("displayRoot"));
  14311. this.t0 = this.getTransition("t0");
  14312. }
  14313. }
  14314. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  14315. class ui_Component86 extends fgui.GButton {
  14316. static createInstance() {
  14317. return (fgui.UIPackage.createObject("game", "Component86"));
  14318. }
  14319. onConstruct() {
  14320. this.n15 = (this.getChild("n15"));
  14321. this.t0 = this.getTransition("t0");
  14322. }
  14323. }
  14324. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  14325. class ui_Component87 extends fgui.GComponent {
  14326. static createInstance() {
  14327. return (fgui.UIPackage.createObject("game", "Component87"));
  14328. }
  14329. onConstruct() {
  14330. this.n66 = (this.getChild("n66"));
  14331. this.myProgress = (this.getChild("myProgress"));
  14332. this.starAni = (this.getChild("starAni"));
  14333. this.hpTxt = (this.getChild("hpTxt"));
  14334. this.n74 = (this.getChild("n74"));
  14335. this.n73 = (this.getChild("n73"));
  14336. this.ballTxt = (this.getChild("ballTxt"));
  14337. this.n76 = (this.getChild("n76"));
  14338. this.helpLineBtn = (this.getChild("helpLineBtn"));
  14339. this.levelTxt = (this.getChild("levelTxt"));
  14340. this.star1 = (this.getChild("star1"));
  14341. this.star2 = (this.getChild("star2"));
  14342. this.star3 = (this.getChild("star3"));
  14343. }
  14344. }
  14345. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  14346. class ui_Component88 extends fgui.GProgressBar {
  14347. static createInstance() {
  14348. return (fgui.UIPackage.createObject("game", "Component88"));
  14349. }
  14350. onConstruct() {
  14351. this.n68 = (this.getChild("n68"));
  14352. this.bar = (this.getChild("bar"));
  14353. }
  14354. }
  14355. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  14356. class ui_Component89 extends fgui.GComponent {
  14357. static createInstance() {
  14358. return (fgui.UIPackage.createObject("game", "Component89"));
  14359. }
  14360. onConstruct() {
  14361. this.c1 = this.getController("c1");
  14362. this.n71 = (this.getChild("n71"));
  14363. this.n72 = (this.getChild("n72"));
  14364. }
  14365. }
  14366. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  14367. class ui_Component90 extends fgui.GComponent {
  14368. static createInstance() {
  14369. return (fgui.UIPackage.createObject("game", "Component90"));
  14370. }
  14371. onConstruct() {
  14372. this.c1 = this.getController("c1");
  14373. this.n64 = (this.getChild("n64"));
  14374. this.n65 = (this.getChild("n65"));
  14375. this.n66 = (this.getChild("n66"));
  14376. this.t0 = this.getTransition("t0");
  14377. }
  14378. }
  14379. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  14380. class ui_Component127 extends fgui.GButton {
  14381. static createInstance() {
  14382. return (fgui.UIPackage.createObject("game", "Component127"));
  14383. }
  14384. onConstruct() {
  14385. this.n5 = (this.getChild("n5"));
  14386. }
  14387. }
  14388. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  14389. class gameBinder {
  14390. static bindAll() {
  14391. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  14392. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  14393. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  14394. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  14395. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  14396. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  14397. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  14398. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  14399. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  14400. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  14401. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  14402. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  14403. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  14404. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  14405. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  14406. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  14407. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  14408. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  14409. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  14410. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  14411. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  14412. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  14413. fgui.UIObjectFactory.setExtension(ui_Component121.URL, ui_Component121);
  14414. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  14415. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  14416. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  14417. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  14418. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  14419. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  14420. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  14421. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  14422. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  14423. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  14424. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  14425. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  14426. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  14427. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  14428. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  14429. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  14430. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  14431. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  14432. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  14433. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  14434. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  14435. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  14436. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  14437. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  14438. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  14439. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  14440. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  14441. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  14442. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  14443. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  14444. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  14445. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  14446. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  14447. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  14448. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  14449. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  14450. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  14451. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  14452. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  14453. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  14454. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  14455. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  14456. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  14457. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  14458. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  14459. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  14460. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  14461. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  14462. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  14463. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  14464. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  14465. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  14466. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  14467. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  14468. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  14469. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  14470. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  14471. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  14472. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  14473. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  14474. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  14475. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  14476. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  14477. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  14478. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  14479. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  14480. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  14481. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  14482. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  14483. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  14484. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  14485. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  14486. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  14487. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  14488. fgui.UIObjectFactory.setExtension(ui_Component9.URL, ui_Component9);
  14489. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  14490. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  14491. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  14492. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  14493. fgui.UIObjectFactory.setExtension(ui_Component16.URL, ui_Component16);
  14494. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  14495. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  14496. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  14497. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  14498. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  14499. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  14500. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  14501. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  14502. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  14503. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  14504. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  14505. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  14506. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  14507. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  14508. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  14509. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  14510. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  14511. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  14512. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  14513. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  14514. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  14515. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  14516. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  14517. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  14518. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  14519. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  14520. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  14521. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  14522. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  14523. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  14524. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  14525. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  14526. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  14527. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  14528. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  14529. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  14530. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  14531. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  14532. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  14533. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  14534. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  14535. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  14536. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  14537. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  14538. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  14539. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  14540. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  14541. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  14542. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  14543. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  14544. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  14545. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  14546. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  14547. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  14548. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  14549. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  14550. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  14551. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  14552. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  14553. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  14554. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  14555. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  14556. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  14557. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganzi.URL, ui_dh_zy_ganzi);
  14558. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  14559. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  14560. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  14561. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  14562. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  14563. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  14564. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  14565. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  14566. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  14567. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  14568. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  14569. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  14570. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  14571. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  14572. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  14573. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  14574. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  14575. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  14576. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  14577. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  14578. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  14579. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  14580. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  14581. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  14582. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  14583. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  14584. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  14585. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  14586. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  14587. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  14588. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  14589. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  14590. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  14591. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  14592. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  14593. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  14594. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  14595. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  14596. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  14597. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  14598. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  14599. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  14600. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  14601. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  14602. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  14603. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  14604. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  14605. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  14606. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  14607. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  14608. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  14609. fgui.UIObjectFactory.setExtension(ui_Component109.URL, ui_Component109);
  14610. fgui.UIObjectFactory.setExtension(ui_Component110.URL, ui_Component110);
  14611. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  14612. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  14613. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  14614. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  14615. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  14616. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  14617. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  14618. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  14619. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  14620. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  14621. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  14622. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  14623. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  14624. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  14625. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  14626. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  14627. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  14628. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  14629. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  14630. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  14631. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  14632. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  14633. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  14634. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  14635. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  14636. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  14637. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  14638. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  14639. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  14640. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  14641. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  14642. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  14643. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  14644. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  14645. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  14646. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  14647. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  14648. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  14649. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  14650. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  14651. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  14652. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  14653. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  14654. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  14655. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  14656. }
  14657. }
  14658. class ui_btn6 extends fgui.GButton {
  14659. static createInstance() {
  14660. return (fgui.UIPackage.createObject("loading", "btn6"));
  14661. }
  14662. onConstruct() {
  14663. this.n6 = (this.getChild("n6"));
  14664. this.n1 = (this.getChild("n1"));
  14665. }
  14666. }
  14667. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  14668. class ui_xyItem extends fgui.GComponent {
  14669. static createInstance() {
  14670. return (fgui.UIPackage.createObject("loading", "xyItem"));
  14671. }
  14672. onConstruct() {
  14673. this.xyItem = (this.getChild("xyItem"));
  14674. }
  14675. }
  14676. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  14677. class ui_loadinfo extends fgui.GProgressBar {
  14678. static createInstance() {
  14679. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  14680. }
  14681. onConstruct() {
  14682. this.bg = (this.getChild("bg"));
  14683. this.bar = (this.getChild("bar"));
  14684. this.title = (this.getChild("title"));
  14685. this.ani = (this.getChild("ani"));
  14686. }
  14687. }
  14688. ui_loadinfo.URL = "ui://37nctnhwis36c";
  14689. class ui_xyNode extends fgui.GComponent {
  14690. static createInstance() {
  14691. return (fgui.UIPackage.createObject("loading", "xyNode"));
  14692. }
  14693. onConstruct() {
  14694. this.n0 = (this.getChild("n0"));
  14695. this.btnYes = (this.getChild("btnYes"));
  14696. this.btnNo = (this.getChild("btnNo"));
  14697. this.btnKnown = (this.getChild("btnKnown"));
  14698. this.btnSure = (this.getChild("btnSure"));
  14699. this.txtWelcom = (this.getChild("txtWelcom"));
  14700. this.txtXy = (this.getChild("txtXy"));
  14701. this.n75 = (this.getChild("n75"));
  14702. this.btnXy1 = (this.getChild("btnXy1"));
  14703. this.btnXy3 = (this.getChild("btnXy3"));
  14704. this.btnXy2 = (this.getChild("btnXy2"));
  14705. this.n74 = (this.getChild("n74"));
  14706. this.xy1 = (this.getChild("xy1"));
  14707. this.txtTitle = (this.getChild("txtTitle"));
  14708. this.btnBack = (this.getChild("btnBack"));
  14709. this.xyList = (this.getChild("xyList"));
  14710. this.xy2 = (this.getChild("xy2"));
  14711. this.xyNode = (this.getChild("xyNode"));
  14712. }
  14713. }
  14714. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  14715. class ui_ageNode extends fgui.GComponent {
  14716. static createInstance() {
  14717. return (fgui.UIPackage.createObject("loading", "ageNode"));
  14718. }
  14719. onConstruct() {
  14720. this.n3 = (this.getChild("n3"));
  14721. this.n7 = (this.getChild("n7"));
  14722. this.n4 = (this.getChild("n4"));
  14723. this.btnAge = (this.getChild("btnAge"));
  14724. this.ageNode = (this.getChild("ageNode"));
  14725. }
  14726. }
  14727. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  14728. class ui_rnNode extends fgui.GComponent {
  14729. static createInstance() {
  14730. return (fgui.UIPackage.createObject("loading", "rnNode"));
  14731. }
  14732. onConstruct() {
  14733. this.n28 = (this.getChild("n28"));
  14734. this.n30 = (this.getChild("n30"));
  14735. this.n33 = (this.getChild("n33"));
  14736. this.rn1 = (this.getChild("rn1"));
  14737. this.n40 = (this.getChild("n40"));
  14738. this.n41 = (this.getChild("n41"));
  14739. this.rn3 = (this.getChild("rn3"));
  14740. this.n37 = (this.getChild("n37"));
  14741. this.n39 = (this.getChild("n39"));
  14742. this.rn2 = (this.getChild("rn2"));
  14743. this.n47 = (this.getChild("n47"));
  14744. this.n49 = (this.getChild("n49"));
  14745. this.n44 = (this.getChild("n44"));
  14746. this.inputCode = (this.getChild("inputCode"));
  14747. this.inputName = (this.getChild("inputName"));
  14748. this.n48 = (this.getChild("n48"));
  14749. this.n50 = (this.getChild("n50"));
  14750. this.rn4 = (this.getChild("rn4"));
  14751. this.btnCheck = (this.getChild("btnCheck"));
  14752. this.btnExit = (this.getChild("btnExit"));
  14753. this.btnDone = (this.getChild("btnDone"));
  14754. this.rnNode = (this.getChild("rnNode"));
  14755. }
  14756. }
  14757. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  14758. class ui_tipNode extends fgui.GComponent {
  14759. static createInstance() {
  14760. return (fgui.UIPackage.createObject("loading", "tipNode"));
  14761. }
  14762. onConstruct() {
  14763. this.bg = (this.getChild("bg"));
  14764. this.n55 = (this.getChild("n55"));
  14765. this.n56 = (this.getChild("n56"));
  14766. this.tipNode = (this.getChild("tipNode"));
  14767. }
  14768. }
  14769. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  14770. class ui_fcmNode extends fgui.GComponent {
  14771. static createInstance() {
  14772. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  14773. }
  14774. onConstruct() {
  14775. this.n63 = (this.getChild("n63"));
  14776. this.n62 = (this.getChild("n62"));
  14777. this.btnRn = (this.getChild("btnRn"));
  14778. this.n61 = (this.getChild("n61"));
  14779. this.n58 = (this.getChild("n58"));
  14780. this.fcmNode = (this.getChild("fcmNode"));
  14781. }
  14782. }
  14783. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  14784. class ui_msgNode extends fgui.GComponent {
  14785. static createInstance() {
  14786. return (fgui.UIPackage.createObject("loading", "msgNode"));
  14787. }
  14788. onConstruct() {
  14789. this.n69 = (this.getChild("n69"));
  14790. this.txtMsg = (this.getChild("txtMsg"));
  14791. this.msgNode = (this.getChild("msgNode"));
  14792. }
  14793. }
  14794. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  14795. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  14796. static createInstance() {
  14797. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  14798. }
  14799. onConstruct() {
  14800. this.n1 = (this.getChild("n1"));
  14801. this.n13 = (this.getChild("n13"));
  14802. this.n14 = (this.getChild("n14"));
  14803. this.n15 = (this.getChild("n15"));
  14804. this.n3 = (this.getChild("n3"));
  14805. this.n4 = (this.getChild("n4"));
  14806. this.n5 = (this.getChild("n5"));
  14807. this.n6 = (this.getChild("n6"));
  14808. this.n7 = (this.getChild("n7"));
  14809. this.n8 = (this.getChild("n8"));
  14810. this.n9 = (this.getChild("n9"));
  14811. this.n10 = (this.getChild("n10"));
  14812. this.n12 = (this.getChild("n12"));
  14813. this.n11 = (this.getChild("n11"));
  14814. this.n16 = (this.getChild("n16"));
  14815. this.n17 = (this.getChild("n17"));
  14816. this.n18 = (this.getChild("n18"));
  14817. this.n20 = (this.getChild("n20"));
  14818. this.n21 = (this.getChild("n21"));
  14819. this.t0 = this.getTransition("t0");
  14820. }
  14821. }
  14822. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  14823. class ui_btn5 extends fgui.GButton {
  14824. static createInstance() {
  14825. return (fgui.UIPackage.createObject("loading", "btn5"));
  14826. }
  14827. onConstruct() {
  14828. this.n9 = (this.getChild("n9"));
  14829. this.n1 = (this.getChild("n1"));
  14830. }
  14831. }
  14832. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  14833. class ui_UILoading extends fgui.GComponent {
  14834. static createInstance() {
  14835. return (fgui.UIPackage.createObject("loading", "UILoading"));
  14836. }
  14837. onConstruct() {
  14838. this.n12 = (this.getChild("n12"));
  14839. this.loadinfo = (this.getChild("loadinfo"));
  14840. this.n13 = (this.getChild("n13"));
  14841. this.txtLoad = (this.getChild("txtLoad"));
  14842. this.n19 = (this.getChild("n19"));
  14843. this.n20 = (this.getChild("n20"));
  14844. this.t_d = (this.getChild("t_d"));
  14845. this.n18 = (this.getChild("n18"));
  14846. }
  14847. }
  14848. ui_UILoading.URL = "ui://37nctnhwphc33";
  14849. class ui_AgeItem extends fgui.GComponent {
  14850. static createInstance() {
  14851. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  14852. }
  14853. onConstruct() {
  14854. this.txtAge = (this.getChild("txtAge"));
  14855. }
  14856. }
  14857. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  14858. class ui_btn1 extends fgui.GButton {
  14859. static createInstance() {
  14860. return (fgui.UIPackage.createObject("loading", "btn1"));
  14861. }
  14862. onConstruct() {
  14863. this.n6 = (this.getChild("n6"));
  14864. this.n1 = (this.getChild("n1"));
  14865. }
  14866. }
  14867. ui_btn1.URL = "ui://37nctnhwxe622p";
  14868. class ui_btn3 extends fgui.GButton {
  14869. static createInstance() {
  14870. return (fgui.UIPackage.createObject("loading", "btn3"));
  14871. }
  14872. onConstruct() {
  14873. this.n9 = (this.getChild("n9"));
  14874. this.n1 = (this.getChild("n1"));
  14875. }
  14876. }
  14877. ui_btn3.URL = "ui://37nctnhwxe622s";
  14878. class ui_btn2 extends fgui.GButton {
  14879. static createInstance() {
  14880. return (fgui.UIPackage.createObject("loading", "btn2"));
  14881. }
  14882. onConstruct() {
  14883. this.n6 = (this.getChild("n6"));
  14884. this.n1 = (this.getChild("n1"));
  14885. }
  14886. }
  14887. ui_btn2.URL = "ui://37nctnhwxe622t";
  14888. class ui_btnBack extends fgui.GButton {
  14889. static createInstance() {
  14890. return (fgui.UIPackage.createObject("loading", "btnBack"));
  14891. }
  14892. onConstruct() {
  14893. this.n6 = (this.getChild("n6"));
  14894. this.n7 = (this.getChild("n7"));
  14895. }
  14896. }
  14897. ui_btnBack.URL = "ui://37nctnhwxe622u";
  14898. class ui_btnXy1 extends fgui.GButton {
  14899. static createInstance() {
  14900. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  14901. }
  14902. onConstruct() {
  14903. this.n1 = (this.getChild("n1"));
  14904. }
  14905. }
  14906. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  14907. class ui_btnXy2 extends fgui.GButton {
  14908. static createInstance() {
  14909. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  14910. }
  14911. onConstruct() {
  14912. this.n1 = (this.getChild("n1"));
  14913. }
  14914. }
  14915. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  14916. class ui_btnXy3 extends fgui.GButton {
  14917. static createInstance() {
  14918. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  14919. }
  14920. onConstruct() {
  14921. this.n1 = (this.getChild("n1"));
  14922. }
  14923. }
  14924. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  14925. class ui_btn4 extends fgui.GButton {
  14926. static createInstance() {
  14927. return (fgui.UIPackage.createObject("loading", "btn4"));
  14928. }
  14929. onConstruct() {
  14930. this.n9 = (this.getChild("n9"));
  14931. this.n1 = (this.getChild("n1"));
  14932. }
  14933. }
  14934. ui_btn4.URL = "ui://37nctnhwxe622z";
  14935. class loadingBinder {
  14936. static bindAll() {
  14937. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  14938. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  14939. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  14940. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  14941. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  14942. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  14943. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  14944. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  14945. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  14946. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  14947. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  14948. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  14949. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  14950. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  14951. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  14952. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  14953. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  14954. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  14955. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  14956. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  14957. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  14958. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  14959. }
  14960. }
  14961. class UIMgr {
  14962. constructor() {
  14963. this._stage = null;
  14964. this._uiList = [];
  14965. this._showList = [];
  14966. this._bindPkgList = [];
  14967. this.uiIndex = 0;
  14968. }
  14969. static get inst() {
  14970. if (UIMgr._inst == null) {
  14971. UIMgr._inst = new UIMgr();
  14972. }
  14973. return UIMgr._inst;
  14974. }
  14975. setStage(s) {
  14976. if (this._stage) {
  14977. console.log("ViewMgr::Stage->舞台不可赋值两次");
  14978. return;
  14979. }
  14980. this._stage = s;
  14981. }
  14982. init() {
  14983. this.setStage(Laya.stage);
  14984. fairygui.UIConfig.defaultFont = "微软雅黑";
  14985. fairygui.UIConfig.modalLayerColor = "rgba(0,0,0,0.9)";
  14986. fairygui.UIConfig.packageFileExtension = "obj";
  14987. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  14988. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  14989. fairygui.GRoot.inst.width = Laya.stage.width;
  14990. fairygui.GRoot.inst.height = Laya.stage.height;
  14991. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  14992. }
  14993. addAllUpdate() {
  14994. this.uiIndex = 0;
  14995. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  14996. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  14997. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  14998. }
  14999. }
  15000. }
  15001. bindFUI(pkgname) {
  15002. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  15003. return;
  15004. }
  15005. switch (pkgname) {
  15006. case fguiRes.loading:
  15007. fairygui.UIPackage.addPackage(pkgname);
  15008. loadingBinder.bindAll();
  15009. this._bindPkgList.push(pkgname);
  15010. break;
  15011. case fguiRes.game:
  15012. fairygui.UIPackage.addPackage(pkgname);
  15013. gameBinder.bindAll();
  15014. this._bindPkgList.push(pkgname);
  15015. break;
  15016. default:
  15017. break;
  15018. }
  15019. }
  15020. Show(cls, ...param) {
  15021. let nameStr = cls.uiName;
  15022. for (let i = this._uiList.length - 1; i >= 0; i--) {
  15023. let temp = this._uiList[i];
  15024. let str = temp.className;
  15025. if (str == nameStr) {
  15026. if (temp.isMuti) {
  15027. if (temp.isHide) {
  15028. temp.show(...param);
  15029. this._uiList.splice(i, 1);
  15030. this._uiList.push(temp);
  15031. return temp;
  15032. }
  15033. }
  15034. else {
  15035. temp.show(...param);
  15036. this._uiList.splice(i, 1);
  15037. this._uiList.push(temp);
  15038. return temp;
  15039. }
  15040. }
  15041. }
  15042. let ui = new cls();
  15043. ui.className = nameStr;
  15044. this._showUI(ui, param);
  15045. return ui;
  15046. }
  15047. destroyUI(ui) {
  15048. for (let i = this._uiList.length - 1; i >= 0; i--) {
  15049. let temp = this._uiList[i].className;
  15050. if (temp == ui.className) {
  15051. this._uiList.splice(i, 1);
  15052. break;
  15053. }
  15054. }
  15055. this.checkUIState();
  15056. }
  15057. _showUI(ui, param) {
  15058. this._uiList.push(ui);
  15059. ui.show(...param);
  15060. }
  15061. Hide(uiClass) {
  15062. let ui = this.getUI(uiClass);
  15063. if (ui && !ui.isHide) {
  15064. ui.hide();
  15065. }
  15066. }
  15067. getUI(ui) {
  15068. let nameStr = ui.uiName;
  15069. for (let index = 0; index < this._uiList.length; index++) {
  15070. let temp = this._uiList[index];
  15071. if (temp.className == nameStr) {
  15072. return temp;
  15073. }
  15074. }
  15075. return null;
  15076. }
  15077. isShow(cls) {
  15078. for (var i of this._uiList) {
  15079. if (i instanceof cls) {
  15080. return i.isShowing;
  15081. }
  15082. }
  15083. return false;
  15084. }
  15085. showUINum() {
  15086. let num = 0;
  15087. for (var i of this._uiList) {
  15088. if (i.isShowing) {
  15089. num++;
  15090. }
  15091. }
  15092. return num;
  15093. }
  15094. checkUIState() {
  15095. Laya.timer.clear(this, this._uiCheck);
  15096. Laya.timer.once(400, this, this._uiCheck);
  15097. }
  15098. _uiCheck() {
  15099. let showList = [];
  15100. for (var i of this._uiList) {
  15101. if (!i.isHide) {
  15102. showList.push(i);
  15103. }
  15104. }
  15105. for (let index = 0; index < showList.length; index++) {
  15106. if (index == showList.length - 1) {
  15107. showList[index].checkActive(true);
  15108. }
  15109. else {
  15110. showList[index].checkActive(false);
  15111. }
  15112. }
  15113. }
  15114. showTip(msg, time = 600, size = 30) {
  15115. }
  15116. }
  15117. class UIShowList {
  15118. }
  15119. class SoundMgr {
  15120. constructor() {
  15121. this.soundMax = 4;
  15122. this.isLoad = false;
  15123. this.soundMap = {};
  15124. this.isSound = true;
  15125. this.openShake = true;
  15126. SoundMgr._instance = this;
  15127. }
  15128. static getInstance() {
  15129. if (!this._instance) {
  15130. this._instance = new SoundMgr();
  15131. }
  15132. return this._instance;
  15133. }
  15134. init() {
  15135. console.log('zh:sm init 1');
  15136. Laya.SoundManager.autoReleaseSound = true;
  15137. Laya.SoundManager.autoStopMusic = true;
  15138. Laya.SoundManager.musicVolume = 0.3;
  15139. Laya.SoundManager.soundVolume = 0.5;
  15140. this.musicPlayed = false;
  15141. this.audioUrl = "asset/sound/ogg/";
  15142. console.log('zh:sm init 2');
  15143. console.log('zh:dev type ');
  15144. if (Laya.Browser.onAndroid) {
  15145. console.log('zh:dev type android');
  15146. this.audioUrl = "asset/sound/ogg/";
  15147. this.isLoad = true;
  15148. }
  15149. else {
  15150. console.log('zh:dev type not android');
  15151. this.audioUrl = "asset/sound/mp3/";
  15152. this.isLoad = true;
  15153. }
  15154. }
  15155. onSetting(isS) {
  15156. this.isSound = isS;
  15157. this.mute(!this.isSound);
  15158. }
  15159. clearCount() {
  15160. for (var key in this.soundMap) {
  15161. delete this.soundMap[key];
  15162. }
  15163. }
  15164. playMusic(path, loop = 0) {
  15165. console.log('zh:playMusic 1 PATH=' + path);
  15166. this.musicPath = path;
  15167. if (!this.isLoad)
  15168. console.log('zh:playMusic 2');
  15169. return;
  15170. if (!path || path == "")
  15171. console.log('zh:playMusic 3');
  15172. return;
  15173. if (!this.isSound)
  15174. console.log('zh:playMusic 4');
  15175. return;
  15176. this.musicPlayed = true;
  15177. console.log('zh:playMusic 5');
  15178. let url = this.getUrl(path);
  15179. console.log('zh:playMusic 6' + url);
  15180. if (Laya.Browser.onPC) {
  15181. console.log('zh:playMusic 7');
  15182. Laya.loader.load(url, Laya.Handler.create(this, () => {
  15183. console.log('zh:playMusic 8');
  15184. this.play(url, loop);
  15185. }));
  15186. }
  15187. else
  15188. this.play(url, loop);
  15189. }
  15190. play(url, loop) {
  15191. Laya.SoundManager.playMusic(url, loop);
  15192. }
  15193. getUrl(path) {
  15194. let url = this.audioUrl + path;
  15195. if (Laya.Browser.onAndroid) {
  15196. url += ".ogg";
  15197. }
  15198. else {
  15199. url += ".mp3";
  15200. }
  15201. return url;
  15202. }
  15203. pauseMusic(pause) {
  15204. if (pause) {
  15205. this.mute(true);
  15206. }
  15207. else if (this.isSound)
  15208. this.mute(false);
  15209. }
  15210. stopMusic() {
  15211. Laya.SoundManager.stopMusic();
  15212. if (Moyu.isNeedPlatAudio) {
  15213. Moyu.stopMusic();
  15214. }
  15215. }
  15216. mute(mute) {
  15217. if (Moyu.isNeedPlatAudio) {
  15218. Moyu.pauseMusic(mute);
  15219. }
  15220. else {
  15221. Laya.SoundManager.musicMuted = mute;
  15222. if (!mute && !this.musicPlayed && this.musicPath) {
  15223. this.playMusic(this.musicPath);
  15224. }
  15225. }
  15226. }
  15227. stopSound(path) {
  15228. let url = this.getUrl(path);
  15229. Laya.SoundManager.stopSound(url);
  15230. }
  15231. playSound(path, loop = 1, soundMax = this.soundMax) {
  15232. if (!this.isLoad)
  15233. return;
  15234. if (!this.isSound)
  15235. return;
  15236. if (!path || path == "")
  15237. return;
  15238. let url = this.getUrl(path);
  15239. if (Moyu.isNeedPlatAudio) {
  15240. Moyu.playSound(path, loop == 0);
  15241. }
  15242. else {
  15243. let count = 1;
  15244. if (this.soundMap[path])
  15245. count = this.soundMap[path] + 1;
  15246. if (count > soundMax)
  15247. return;
  15248. this.soundMap[path] = count;
  15249. Laya.SoundManager.playSound(url, loop);
  15250. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  15251. }
  15252. }
  15253. removePath(path) {
  15254. if (this.soundMap[path]) {
  15255. let count = this.soundMap[path];
  15256. count--;
  15257. if (count < 1)
  15258. delete this.soundMap[path];
  15259. else
  15260. this.soundMap[path] = count;
  15261. }
  15262. }
  15263. playBtnSound() {
  15264. this.playSound("btn");
  15265. }
  15266. playGetSound() {
  15267. }
  15268. playCloseUISound() {
  15269. }
  15270. }
  15271. SoundMgr._instance = null;
  15272. var Handler$1 = Laya.Handler;
  15273. var EResType;
  15274. (function (EResType) {
  15275. EResType[EResType["none"] = 0] = "none";
  15276. EResType[EResType["nromal"] = 1] = "nromal";
  15277. EResType[EResType["td"] = 2] = "td";
  15278. EResType[EResType["sk"] = 3] = "sk";
  15279. })(EResType || (EResType = {}));
  15280. class CResLoader {
  15281. constructor(doneCall, proCall) {
  15282. this.completrCall = doneCall;
  15283. this.progressCall = proCall;
  15284. this.progressHander = new Handler$1(this, this.onProgress);
  15285. this.tdResMap = {};
  15286. }
  15287. load(resList) {
  15288. this.resCount = 0;
  15289. this.loadCount = 0;
  15290. for (let i = 0; i < resList.length; i++) {
  15291. let path = resList[i];
  15292. if (!path)
  15293. continue;
  15294. this.resCount++;
  15295. let type = this.getResType(path);
  15296. if (type == EResType.nromal)
  15297. this.loadNromal(path);
  15298. else if (type == EResType.td)
  15299. this.loadTd(path);
  15300. }
  15301. }
  15302. getRes(path) {
  15303. let type = this.getResType(path);
  15304. if (type == EResType.nromal)
  15305. return Laya.loader.getRes(path);
  15306. else if (type == EResType.td) {
  15307. let res = this.tdResMap[path];
  15308. if (res)
  15309. return res.clone();
  15310. return null;
  15311. }
  15312. }
  15313. destroy() {
  15314. this.progressHander.clear();
  15315. this.progressHander = null;
  15316. }
  15317. clearRes(path) {
  15318. let type = this.getResType(path);
  15319. if (type == EResType.nromal)
  15320. Laya.loader.clearRes(path);
  15321. else if (type == EResType.td) {
  15322. let obj = this.tdResMap[path];
  15323. if (obj)
  15324. obj.destroy();
  15325. delete this.tdResMap[path];
  15326. }
  15327. }
  15328. getResType(path) {
  15329. let exs = this.getExtension(path);
  15330. if (exs == "sk")
  15331. return EResType.sk;
  15332. if (exs == "ls" || exs == "lh" || exs == "lm")
  15333. return EResType.td;
  15334. else
  15335. return EResType.nromal;
  15336. }
  15337. getExtension(res) {
  15338. var index = res.lastIndexOf(".");
  15339. return res.substr(index + 1);
  15340. }
  15341. loadNromal(path) {
  15342. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  15343. if (res) {
  15344. this.onLoad();
  15345. }
  15346. else
  15347. console.log("load res fail:" + path);
  15348. }), this.progressHander);
  15349. }
  15350. loadSk() {
  15351. }
  15352. loadTd(path) {
  15353. if (this.tdResMap[path]) {
  15354. this.onLoad();
  15355. return;
  15356. }
  15357. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  15358. if (res) {
  15359. this.tdResMap[path] = res;
  15360. this.onLoad();
  15361. }
  15362. else
  15363. console.log("load res fail:" + path);
  15364. }));
  15365. }
  15366. onLoad() {
  15367. this.loadCount++;
  15368. this.onProgress(1);
  15369. if (this.loadCount >= this.resCount) {
  15370. this.completrCall.run();
  15371. }
  15372. }
  15373. onProgress(pro) {
  15374. let progress = (this.loadCount + pro) / this.resCount;
  15375. this.progressCall.runWith(progress);
  15376. }
  15377. }
  15378. var Handler$2 = Laya.Handler;
  15379. class ResInfo {
  15380. constructor() {
  15381. this.index = 0;
  15382. }
  15383. }
  15384. class ResMgr {
  15385. constructor() {
  15386. this.resList = [];
  15387. this.doneList = [];
  15388. this.resMap = {};
  15389. this.currentLoad = null;
  15390. this.completeHandler = new Handler$2(this, this.onComplete);
  15391. this.progressHandler = new Handler$2(this, this.onProgress);
  15392. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  15393. }
  15394. static getInstance() {
  15395. if (ResMgr._instance == null) {
  15396. ResMgr._instance = new ResMgr();
  15397. }
  15398. return ResMgr._instance;
  15399. }
  15400. loadList(list, completeHandler, progressHandler) {
  15401. if (list.length < 1) {
  15402. completeHandler.run();
  15403. return;
  15404. }
  15405. let info = this.getResInfo();
  15406. info.resList = list;
  15407. info.completeHandler = completeHandler;
  15408. info.progressHandler = progressHandler;
  15409. this.resList.push(info);
  15410. this.startLoad();
  15411. }
  15412. loadFguiRes(list, completeHandler, progressHandler) {
  15413. Laya.loader.load(list, completeHandler, progressHandler);
  15414. }
  15415. loadAny(list, completeHandler, progressHandler) {
  15416. Laya.loader.load(list, completeHandler, progressHandler);
  15417. }
  15418. load(path, completeHandler, progressHandler) {
  15419. let count = this.resMap[path];
  15420. if (count && count > 0) {
  15421. if (completeHandler)
  15422. completeHandler.run();
  15423. }
  15424. else
  15425. this.loadList([path], completeHandler, progressHandler);
  15426. }
  15427. getRes(path) {
  15428. let res = this.resMap[path];
  15429. if (!res)
  15430. this.showLog("资源不存在:" + path);
  15431. else
  15432. return this.loader.getRes(path);
  15433. }
  15434. clearList(list, force = false) {
  15435. if (!list || list.length < 1)
  15436. return;
  15437. let cr = () => {
  15438. for (const k in list) {
  15439. let v = list[k];
  15440. if (!v)
  15441. continue;
  15442. if (force) {
  15443. this.loader.clearRes(v);
  15444. delete this.resMap[v];
  15445. }
  15446. else {
  15447. let count = this.resMap[v];
  15448. if (count && count > 1) {
  15449. count--;
  15450. this.resMap[v] = count;
  15451. }
  15452. else {
  15453. this.loader.clearRes(v);
  15454. delete this.resMap[v];
  15455. }
  15456. }
  15457. }
  15458. if (!window.hasOwnProperty("ks"))
  15459. Laya.Resource.destroyUnusedResources();
  15460. };
  15461. Laya.timer.clearAll(this);
  15462. Laya.timer.once(2000, this, cr);
  15463. }
  15464. clear3D() {
  15465. for (const k in this.loader.tdResMap) {
  15466. this.loader.clearRes(k);
  15467. if (this.resMap[k])
  15468. delete this.resMap[k];
  15469. }
  15470. if (!window.hasOwnProperty("ks"))
  15471. Laya.Resource.destroyUnusedResources();
  15472. }
  15473. clear(path, force = false) {
  15474. this.clearList([path], force);
  15475. }
  15476. getResInfo() {
  15477. if (this.doneList.length > 0)
  15478. return this.doneList.pop();
  15479. else
  15480. return new ResInfo();
  15481. }
  15482. startLoad() {
  15483. if (this.currentLoad)
  15484. return;
  15485. this.currentLoad = this.resList.pop();
  15486. if (this.currentLoad) {
  15487. this.loader.load(this.currentLoad.resList);
  15488. }
  15489. }
  15490. onComplete() {
  15491. if (!this.currentLoad)
  15492. return;
  15493. for (const k in this.currentLoad.resList) {
  15494. let v = this.currentLoad.resList[k];
  15495. let count = this.resMap[v];
  15496. if (count)
  15497. count++;
  15498. else
  15499. count = 1;
  15500. this.resMap[v] = count;
  15501. }
  15502. if (this.currentLoad.completeHandler)
  15503. this.currentLoad.completeHandler.run();
  15504. this.doneList.push(this.currentLoad);
  15505. this.currentLoad = null;
  15506. this.startLoad();
  15507. }
  15508. onProgress(pro) {
  15509. if (!this.currentLoad)
  15510. return;
  15511. if (this.currentLoad.progressHandler)
  15512. this.currentLoad.progressHandler.runWith(pro);
  15513. }
  15514. showLog(str, ...args) {
  15515. console.log("[ResLoader] " + str);
  15516. }
  15517. }
  15518. ResMgr._instance = null;
  15519. class EventMgr extends Laya.EventDispatcher {
  15520. }
  15521. let eventMgr = new EventMgr();
  15522. class ConfigMgr {
  15523. static getInstance() {
  15524. if (!this._instance) {
  15525. this._instance = new ConfigMgr();
  15526. }
  15527. return this._instance;
  15528. }
  15529. init() {
  15530. this.npcJson = Laya.loader.getRes("res/json/npc.json").Data;
  15531. this.classicCfg = Laya.loader.getRes("res/json/classicCfg.json");
  15532. this.levelCfg = Laya.loader.getRes("res/json/levelCfg.json");
  15533. this.placeBallCfg = Laya.loader.getRes("res/json/placeBallCfg.json");
  15534. }
  15535. getUserInfoByIndex(index) {
  15536. return this.npcJson[index];
  15537. }
  15538. getRandomUserInfo() {
  15539. let index = xGame.tools.random(0, this.npcJson.length);
  15540. return this.npcJson[index];
  15541. }
  15542. getMaxBigMoveLength() {
  15543. return Object.keys(this.levelCfg).length;
  15544. }
  15545. getBigMoveLevelByIndex(index) {
  15546. let cfg = this.levelCfg;
  15547. cfg = cfg[index];
  15548. return cfg;
  15549. }
  15550. getRandomClassicLevel() {
  15551. let cfg = this.classicCfg;
  15552. let num = Object.keys(cfg).length;
  15553. let rand = xGame.common.randomNum(1, num);
  15554. return cfg[rand];
  15555. }
  15556. getPlaceBallByLevel(level) {
  15557. return this.placeBallCfg[level];
  15558. }
  15559. getMaxPlaceBall() {
  15560. return Object.keys(this.placeBallCfg).length;
  15561. }
  15562. }
  15563. class PoolD3Mgr {
  15564. constructor() {
  15565. this.pool = {};
  15566. }
  15567. static get ins() {
  15568. return this._ins || (this._ins = new PoolD3Mgr);
  15569. }
  15570. createList(key, prefab, parent) {
  15571. if (!this.pool[key]) {
  15572. this.pool[key] = {};
  15573. this.pool[key].prefab = prefab;
  15574. this.pool[key].list = [];
  15575. this.pool[key].parent = parent;
  15576. }
  15577. }
  15578. getItem(key) {
  15579. if (!this.pool[key]) {
  15580. return;
  15581. }
  15582. let temp;
  15583. if (this.pool[key].list.length > 0) {
  15584. temp = this.pool[key].list.pop();
  15585. }
  15586. else {
  15587. temp = this.pool[key].prefab.clone();
  15588. if (this.pool[key].parent) {
  15589. this.pool[key].parent.addChild(temp);
  15590. }
  15591. }
  15592. temp.active = true;
  15593. return temp;
  15594. }
  15595. putItem(key, obj) {
  15596. if (!this.pool[key]) {
  15597. return;
  15598. }
  15599. obj.active = false;
  15600. this.pool[key].list.push(obj);
  15601. }
  15602. }
  15603. let context$1 = context;
  15604. let uiMgr = UIMgr.inst;
  15605. let soundMgr = SoundMgr.getInstance();
  15606. let resMgr = ResMgr.getInstance();
  15607. let httpMgr = HttpMgr.getInstance();
  15608. let common = Common.getInstance();
  15609. let cfgMgr = ConfigMgr.getInstance();
  15610. let poolD3Mgr = PoolD3Mgr.ins;
  15611. let d3TexUrl = "res/d3Res/";
  15612. let d3ModeUrl = "res/unityRes/";
  15613. function setStageSize(view) {
  15614. if (view.width) {
  15615. view.width = Laya.stage.width;
  15616. view.height = Laya.stage.height;
  15617. }
  15618. }
  15619. function filledBg(view) {
  15620. let wh = Laya.stage.height / Laya.stage.width;
  15621. if (wh > 16 / 9) {
  15622. view.height = Laya.stage.height;
  15623. view.width = Laya.stage.height / 1334 * 750;
  15624. }
  15625. else {
  15626. view.width = Laya.stage.width;
  15627. view.height = Laya.stage.width / 750 * 1334;
  15628. }
  15629. }
  15630. function setNotch(view) {
  15631. if (view.height) {
  15632. view.y += context$1.notchHeight;
  15633. }
  15634. }
  15635. function showTip(str) {
  15636. uiMgr.Show(UIMsg, str);
  15637. }
  15638. function log(...args) {
  15639. console.log(args);
  15640. }
  15641. let xGame = {
  15642. context: context$1,
  15643. eventMgr,
  15644. resMgr,
  15645. uiMgr,
  15646. soundMgr,
  15647. define,
  15648. tools,
  15649. httpMgr,
  15650. d3TexUrl,
  15651. d3ModeUrl,
  15652. common,
  15653. cfgMgr,
  15654. poolD3Mgr,
  15655. setStageSize,
  15656. filledBg,
  15657. setNotch,
  15658. showTip,
  15659. log,
  15660. };
  15661. window["xGame"] = xGame;
  15662. let dataName = 'tBall_';
  15663. class UserData {
  15664. constructor() {
  15665. this.userId = "";
  15666. this.isAgree = false;
  15667. this.coinNum = 0;
  15668. this.gemNum = 0;
  15669. this.sound = true;
  15670. this.vibration = true;
  15671. this.currentDate = 0;
  15672. this.createTime = 0;
  15673. this.awardTime = 0;
  15674. this.roleId = 1;
  15675. this.roleList = [];
  15676. this.roleAds = [];
  15677. this.dressId = 101;
  15678. this.itemId = 201;
  15679. this.bigSkills = [1, 1, 1, 1, 1];
  15680. this.coin = 4000;
  15681. this.diamond = 0;
  15682. this.skillSuccessTimes = 0;
  15683. this.skillGuide = 0;
  15684. this.skillAccTimes = 0;
  15685. this.placeBallData = [];
  15686. this.shareDiamondTimes = 0;
  15687. this.dailyVideoShareTimes = 0;
  15688. this.secretary = [1, 0];
  15689. this.curSecretary = 0;
  15690. this.ballRod = [1, 0, 0, 0, 0, 1];
  15691. this.curBallRod = 5;
  15692. this.signData = 0;
  15693. this.signTime = 0;
  15694. this.drawTimes = 0;
  15695. this.drawAwardTimes = 0;
  15696. this.dailyfreeDrawTimes = 1;
  15697. this.power = 5;
  15698. this.powerTime = 0;
  15699. this.challengeTimes = 0;
  15700. this.extraSign = 0;
  15701. this.classicTimes = 0;
  15702. this.guideHelpLine = 0;
  15703. this.newUser = true;
  15704. this.rootBallFoul = 0;
  15705. this.timeoutFoul = 0;
  15706. this.roleList = [1];
  15707. }
  15708. saveData() {
  15709. let data = {};
  15710. for (let k in this) {
  15711. data[k.toString()] = this[k];
  15712. }
  15713. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  15714. }
  15715. getData() {
  15716. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  15717. if (ld) {
  15718. let localData = JSON.parse(ld);
  15719. if (localData) {
  15720. for (let k in this) {
  15721. let key = k.toString();
  15722. let data = localData[key];
  15723. if (data != undefined) {
  15724. this[k] = data;
  15725. }
  15726. }
  15727. }
  15728. }
  15729. }
  15730. }
  15731. class ItemData {
  15732. constructor() {
  15733. this.itemList = {};
  15734. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  15735. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  15736. }
  15737. saveData() {
  15738. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  15739. }
  15740. getData() {
  15741. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  15742. if (ld) {
  15743. let localData = JSON.parse(ld);
  15744. if (localData) {
  15745. this.itemList = localData;
  15746. }
  15747. }
  15748. }
  15749. }
  15750. class GameData {
  15751. constructor() {
  15752. this.curLevel = 0;
  15753. this.gameType = 1;
  15754. this.signIdx = 0;
  15755. this.signMax = 0;
  15756. this.rotaryTime = 0;
  15757. this.rotaryCount = 0;
  15758. this.rotaryList = [];
  15759. this.diyCount = 3;
  15760. this.awardIdx = 0;
  15761. this.shareNum = 2;
  15762. this.rankWeek = 0;
  15763. this.rankScore = 0;
  15764. this.gameCount = 0;
  15765. this.trySkill = -1;
  15766. this.tryTime = 0;
  15767. }
  15768. saveData() {
  15769. let data = {};
  15770. for (let k in this) {
  15771. data[k.toString()] = this[k];
  15772. }
  15773. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  15774. }
  15775. getData() {
  15776. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  15777. if (ld) {
  15778. let localData = JSON.parse(ld);
  15779. if (localData) {
  15780. for (let k in this) {
  15781. let key = k.toString();
  15782. let data = localData[key];
  15783. if (data != undefined) {
  15784. this[k] = data;
  15785. }
  15786. }
  15787. }
  15788. }
  15789. }
  15790. }
  15791. class DataMgr {
  15792. static Init() {
  15793. this.userData = new UserData();
  15794. this.gameData = new GameData();
  15795. this.itemData = new ItemData();
  15796. this.userData.getData();
  15797. this.gameData.getData();
  15798. this.itemData.getData();
  15799. this.roleId = this.userData.roleId;
  15800. this.resetUse();
  15801. }
  15802. static isNewDay() {
  15803. Moyu.isNewDay(this, (isnew) => {
  15804. xGame.common.isNewDay = isnew;
  15805. if (!isnew)
  15806. return;
  15807. DataMgr.setShareDiamondTimes(0, false);
  15808. DataMgr.setDailyVideoShareTimes(0, false);
  15809. DataMgr.setDailyfreeDrawTimes(1);
  15810. DataMgr.setExtraSign(0);
  15811. });
  15812. }
  15813. static deletData() {
  15814. Laya.LocalStorage.clear();
  15815. }
  15816. static upRankData() {
  15817. let num = xGame.common.getAllStarNum();
  15818. if (num > 0)
  15819. Moyu.upRankData(xGame.common.curRankID, num);
  15820. }
  15821. static addItem(id, count = 1) {
  15822. let v = this.itemData.itemList[id];
  15823. if (!v)
  15824. v = { id: id, count: count, adnum: 0, active: true };
  15825. else {
  15826. if (v.active) {
  15827. v.count += count;
  15828. }
  15829. else {
  15830. v.count = count;
  15831. v.active = true;
  15832. }
  15833. }
  15834. this.itemData.itemList[id] = v;
  15835. xGame.soundMgr.playGetSound();
  15836. this.saveItemData();
  15837. }
  15838. static hasItem(id) {
  15839. let v = this.itemData.itemList[id];
  15840. if (v && v.active)
  15841. return true;
  15842. return false;
  15843. }
  15844. static getItem(id) {
  15845. let v = this.itemData.itemList[id];
  15846. return v;
  15847. }
  15848. static getItemCount(id) {
  15849. let v = this.itemData.itemList[id];
  15850. if (v && v.active)
  15851. return v.count;
  15852. return 0;
  15853. }
  15854. static getItemAd(id) {
  15855. let v = this.itemData.itemList[id];
  15856. if (v) {
  15857. return v.adnum;
  15858. }
  15859. return 0;
  15860. }
  15861. static onItemAd(id, num = 1) {
  15862. let v = this.itemData.itemList[id];
  15863. if (!v)
  15864. v = { id: id, count: 1, adnum: num, active: false };
  15865. else
  15866. v.adnum += num;
  15867. this.itemData.itemList[id] = v;
  15868. this.saveItemData();
  15869. }
  15870. static costItem(id, count) {
  15871. let v = this.itemData.itemList[id];
  15872. if (v && v.active) {
  15873. if (v.count < count)
  15874. return false;
  15875. else {
  15876. v.count -= count;
  15877. this.itemData.itemList[id] = v;
  15878. return true;
  15879. }
  15880. }
  15881. return false;
  15882. }
  15883. static resetUse() {
  15884. this.dressId = this.userData.dressId;
  15885. this.itemId = this.userData.itemId;
  15886. }
  15887. static passLevel() {
  15888. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  15889. this.gameData.curLevel++;
  15890. this.curLevel = this.gameData.curLevel;
  15891. this.saveGameData();
  15892. }
  15893. static useRole(id) {
  15894. this.roleId = id;
  15895. if (this.hasRole(id)) {
  15896. this.userData.roleId = id;
  15897. this.saveUserData();
  15898. }
  15899. }
  15900. static addRole(id) {
  15901. if (this.hasRole(id))
  15902. return;
  15903. this.userData.roleList.push(id);
  15904. this.saveUserData();
  15905. }
  15906. static hasRole(id) {
  15907. return this.userData.roleList.indexOf(id) >= 0;
  15908. }
  15909. static gemEnough(num) {
  15910. return this.userData.gemNum >= num;
  15911. }
  15912. static roleHasAd(id) {
  15913. let count = this.userData.roleAds[id];
  15914. if (count != undefined && count >= 0)
  15915. return true;
  15916. else
  15917. return false;
  15918. }
  15919. static saveUserData(time = 1000, event, arg) {
  15920. if (this.userSaving)
  15921. return;
  15922. this.userSaving = true;
  15923. Laya.timer.once(time, this, () => {
  15924. this.userSaving = false;
  15925. this.userData.saveData();
  15926. if (event)
  15927. xGame.eventMgr.event(event, arg);
  15928. });
  15929. }
  15930. static saveGameData() {
  15931. if (this.gameSaving)
  15932. return;
  15933. this.gameSaving = true;
  15934. Laya.timer.once(1000, this, () => {
  15935. this.gameSaving = false;
  15936. this.gameData.saveData();
  15937. });
  15938. }
  15939. static saveItemData() {
  15940. let fun = () => {
  15941. this.itemData.saveData();
  15942. };
  15943. Laya.timer.clear(this, fun);
  15944. Laya.timer.once(500, this, fun);
  15945. }
  15946. static saveData() {
  15947. this.saveUserData();
  15948. this.saveGameData();
  15949. }
  15950. static getBigSkillList() {
  15951. return this.userData.bigSkills;
  15952. }
  15953. static getBigSkillByIndex(index) {
  15954. return this.userData.bigSkills[index];
  15955. }
  15956. static setBigSkill(index, val, addUp = true) {
  15957. if (addUp) {
  15958. this.userData.bigSkills[index] += val;
  15959. }
  15960. else {
  15961. this.userData.bigSkills[index] = val;
  15962. }
  15963. this.saveUserData();
  15964. }
  15965. static coinEnough(need) {
  15966. if (typeof need != "number") {
  15967. console.error("金币格式错误");
  15968. return;
  15969. }
  15970. return this.userData.coin >= need;
  15971. }
  15972. static setCoin(val) {
  15973. if (typeof val != "number") {
  15974. return;
  15975. }
  15976. this.userData.coin += val;
  15977. this.saveUserData();
  15978. xGame.eventMgr.event(COIN_CHANGE);
  15979. }
  15980. static getCoin() {
  15981. return this.userData.coin;
  15982. }
  15983. static diamondEnough(need) {
  15984. if (typeof need != "number") {
  15985. console.error("金币格式错误");
  15986. return;
  15987. }
  15988. return this.userData.diamond >= need;
  15989. }
  15990. static setDiamond(val) {
  15991. if (typeof val != "number") {
  15992. return;
  15993. }
  15994. this.userData.diamond += val;
  15995. this.saveUserData();
  15996. xGame.eventMgr.event(DIAMOND_CHANGE);
  15997. }
  15998. static getDiamond() {
  15999. return this.userData.diamond;
  16000. }
  16001. static getSkillSuccessTimes() {
  16002. return this.userData.skillSuccessTimes;
  16003. }
  16004. static setSkillSuccessTimes(val, addUp = true) {
  16005. if (addUp)
  16006. this.userData.skillSuccessTimes += val;
  16007. else
  16008. this.userData.skillSuccessTimes = val;
  16009. this.saveUserData();
  16010. }
  16011. static getSkillAccTimes() {
  16012. return this.userData.skillAccTimes;
  16013. }
  16014. static setSkillAccTimes(val) {
  16015. this.userData.skillAccTimes += val;
  16016. this.saveUserData();
  16017. }
  16018. static getSkillGuide() {
  16019. if (!xGame.common.openGuide) {
  16020. return 1;
  16021. }
  16022. return this.userData.skillGuide;
  16023. }
  16024. static setSkillGuide(val) {
  16025. this.userData.skillGuide = val;
  16026. this.saveUserData();
  16027. }
  16028. static getPlaceBallLevelList() {
  16029. return this.userData.placeBallData;
  16030. }
  16031. static getPlaceBallLevel(level) {
  16032. let arr = this.userData.placeBallData;
  16033. let index = level - 1;
  16034. let out;
  16035. if (arr[index]) {
  16036. out = arr[index];
  16037. }
  16038. else {
  16039. let max = arr.length;
  16040. if (max == index) {
  16041. out = {
  16042. star: 0,
  16043. play: true,
  16044. isCur: true,
  16045. getAward: false
  16046. };
  16047. }
  16048. else {
  16049. out = {
  16050. star: 0,
  16051. play: false,
  16052. getAward: false
  16053. };
  16054. }
  16055. }
  16056. return out;
  16057. }
  16058. static setPlaceBallLevel(level, star) {
  16059. let arr = this.userData.placeBallData;
  16060. let index = level - 1;
  16061. if (arr[index]) {
  16062. arr[index].star = Math.max(arr[index].star, star);
  16063. }
  16064. else {
  16065. let max = arr.length;
  16066. if (max == index) {
  16067. arr.push({
  16068. star: star,
  16069. play: true,
  16070. getAward: false
  16071. });
  16072. }
  16073. else {
  16074. console.error("关卡存储出错");
  16075. }
  16076. }
  16077. this.saveUserData();
  16078. }
  16079. static setPlaceBallAward(level) {
  16080. let arr = this.userData.placeBallData;
  16081. let index = level - 1;
  16082. if (arr[index]) {
  16083. arr[index].getAward = true;
  16084. }
  16085. this.saveUserData();
  16086. }
  16087. static getShareDiamondTimes() {
  16088. return this.userData.shareDiamondTimes;
  16089. }
  16090. static setShareDiamondTimes(val, addUp = true) {
  16091. if (addUp) {
  16092. this.userData.shareDiamondTimes += val;
  16093. }
  16094. else {
  16095. this.userData.shareDiamondTimes = val;
  16096. }
  16097. this.saveUserData();
  16098. }
  16099. static getDailyVideoShareTimes() {
  16100. return this.userData.dailyVideoShareTimes;
  16101. }
  16102. static setDailyVideoShareTimes(val, addUp = true) {
  16103. if (addUp) {
  16104. this.userData.dailyVideoShareTimes += val;
  16105. }
  16106. else {
  16107. this.userData.dailyVideoShareTimes = val;
  16108. }
  16109. this.saveUserData();
  16110. }
  16111. static getSecretary(index) {
  16112. return this.userData.secretary[index];
  16113. }
  16114. static setSecretary(index, val) {
  16115. this.userData.secretary[index] = val;
  16116. this.saveUserData();
  16117. }
  16118. static getCurSecretary() {
  16119. return this.userData.curSecretary;
  16120. }
  16121. static setCurSecretary(index) {
  16122. this.userData.curSecretary = index;
  16123. this.saveUserData();
  16124. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  16125. }
  16126. static getBallRod(index) {
  16127. return this.userData.ballRod[index];
  16128. }
  16129. static setBallRod(index, val) {
  16130. this.userData.ballRod[index] = val;
  16131. this.saveUserData();
  16132. }
  16133. static getCurBallRod() {
  16134. return this.userData.curBallRod;
  16135. }
  16136. static setCurBallRod(index) {
  16137. this.userData.curBallRod = index;
  16138. this.saveUserData();
  16139. }
  16140. static setSignData(val) {
  16141. this.userData.signData = val;
  16142. this.saveUserData();
  16143. }
  16144. static getSignData() {
  16145. return this.userData.signData;
  16146. }
  16147. static setSignTime(val) {
  16148. this.userData.signTime = val;
  16149. this.saveUserData();
  16150. }
  16151. static getSignTime() {
  16152. return this.userData.signTime;
  16153. }
  16154. static getDrawTimes() {
  16155. return this.userData.drawTimes;
  16156. }
  16157. static setDrawTimes(val, addUp = true) {
  16158. if (addUp) {
  16159. this.userData.drawTimes += val;
  16160. }
  16161. else {
  16162. this.userData.drawTimes = val;
  16163. }
  16164. this.saveUserData();
  16165. }
  16166. static getDrawAwardTimes() {
  16167. return this.userData.drawAwardTimes;
  16168. }
  16169. static setDrawAwardTimes(val) {
  16170. this.userData.drawAwardTimes = val;
  16171. this.saveUserData();
  16172. }
  16173. static getDailyfreeDrawTimes() {
  16174. return this.userData.dailyfreeDrawTimes;
  16175. }
  16176. static setDailyfreeDrawTimes(val) {
  16177. this.userData.dailyfreeDrawTimes = val;
  16178. this.saveUserData();
  16179. }
  16180. static setPower(val, addUp = true) {
  16181. if (addUp)
  16182. this.userData.power += val;
  16183. else
  16184. this.userData.power = val;
  16185. if (this.userData.power >= xGame.common.maxPower) {
  16186. this.userData.power = xGame.common.maxPower;
  16187. }
  16188. xGame.eventMgr.event(POWER_CHANGE, val);
  16189. this.saveUserData();
  16190. }
  16191. static getPower() {
  16192. return this.userData.power;
  16193. }
  16194. static setPowerTime(val) {
  16195. this.userData.powerTime = val;
  16196. this.saveUserData();
  16197. }
  16198. static getPowerTime() {
  16199. return this.userData.powerTime;
  16200. }
  16201. static powerEnough() {
  16202. return this.getPower() > 0;
  16203. }
  16204. static getChallengeTimes() {
  16205. return this.userData.challengeTimes;
  16206. }
  16207. static setChallengeTimes(val) {
  16208. this.userData.challengeTimes += val;
  16209. this.saveUserData();
  16210. }
  16211. static getExtraSign() {
  16212. return this.userData.extraSign;
  16213. }
  16214. static setExtraSign(val) {
  16215. this.userData.extraSign = val;
  16216. this.saveUserData();
  16217. }
  16218. static getClassicTimes() {
  16219. return this.userData.classicTimes;
  16220. }
  16221. static setClassicTimes() {
  16222. this.userData.classicTimes += 1;
  16223. this.saveUserData();
  16224. }
  16225. static getGuideHelpLine() {
  16226. return this.userData.guideHelpLine;
  16227. }
  16228. static setGuideHelpLine() {
  16229. this.userData.guideHelpLine = 1;
  16230. this.saveUserData();
  16231. }
  16232. static getNewUser() {
  16233. return this.userData.newUser;
  16234. }
  16235. static setNewUser() {
  16236. this.userData.newUser = false;
  16237. this.saveUserData();
  16238. }
  16239. static getRootBallFoul() {
  16240. return this.userData.rootBallFoul;
  16241. }
  16242. static setRootBallFoul() {
  16243. this.userData.rootBallFoul = 1;
  16244. this.saveUserData();
  16245. }
  16246. static getTimeoutFoul() {
  16247. return this.userData.timeoutFoul;
  16248. }
  16249. static setTimeoutFoul() {
  16250. this.userData.timeoutFoul = 1;
  16251. this.saveUserData();
  16252. }
  16253. }
  16254. DataMgr.isNewUser = false;
  16255. DataMgr.fristEnter = true;
  16256. DataMgr.levelType = 0;
  16257. DataMgr.awardId = 0;
  16258. DataMgr.awardCoin = 0;
  16259. DataMgr.sceneId = -1;
  16260. DataMgr.tryId = 0;
  16261. DataMgr.curLevel = 1;
  16262. DataMgr.vipLevel = 0;
  16263. DataMgr.maxLevel = 0;
  16264. DataMgr.awardRatio = 1;
  16265. DataMgr.gameList = [];
  16266. DataMgr.rankList = [];
  16267. DataMgr.recoverTime = 480000;
  16268. DataMgr.minScore = 0;
  16269. DataMgr.rankDis = 0;
  16270. DataMgr.userSaving = false;
  16271. DataMgr.gameSaving = false;
  16272. class D3Tween extends Laya.Script3D {
  16273. constructor() {
  16274. super();
  16275. this.isInited = false;
  16276. }
  16277. ;
  16278. init() {
  16279. if (this.isInited)
  16280. return;
  16281. this.isInited = true;
  16282. this.gameObj = this.owner;
  16283. this.transform = this.gameObj.transform;
  16284. }
  16285. get rotX() {
  16286. return this.transform.localRotationEulerX;
  16287. }
  16288. set rotX(v) {
  16289. this.transform.localRotationEulerX = v;
  16290. }
  16291. get rotY() {
  16292. return this.transform.localRotationEulerY;
  16293. }
  16294. set rotY(v) {
  16295. this.transform.localRotationEulerY = v;
  16296. }
  16297. get rotZ() {
  16298. return this.transform.localRotationEulerZ;
  16299. }
  16300. set rotZ(v) {
  16301. this.transform.localRotationEulerZ = v;
  16302. }
  16303. get posX() {
  16304. return this.transform.localPositionX;
  16305. }
  16306. set posX(v) {
  16307. this.transform.localPositionX = v;
  16308. }
  16309. get posY() {
  16310. return this.transform.localPositionY;
  16311. }
  16312. set posY(v) {
  16313. this.transform.localPositionY = v;
  16314. }
  16315. get posZ() {
  16316. return this.transform.localPositionZ;
  16317. }
  16318. set posZ(v) {
  16319. this.transform.localPositionZ = v;
  16320. }
  16321. get rotation() {
  16322. return this.transform.localRotation;
  16323. }
  16324. set rotation(v) {
  16325. this.transform.localRotation = v;
  16326. }
  16327. }
  16328. class D2Hole extends Laya.Script {
  16329. constructor() { super(); }
  16330. onTriggerEnter(collider) {
  16331. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  16332. return;
  16333. }
  16334. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  16335. if (collider.owner["mySrc"].isRunSkillAni) {
  16336. return;
  16337. }
  16338. if (collider.owner["mySrc"].number != 0) {
  16339. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  16340. }
  16341. xGame.common.ballColliHole(collider);
  16342. xGame.common.recoverCameraView();
  16343. }
  16344. }
  16345. }
  16346. class Table extends Laya.Script3D {
  16347. constructor() {
  16348. super();
  16349. this.isSetBorder = false;
  16350. this.inited = false;
  16351. }
  16352. ;
  16353. onAwake() {
  16354. this.init();
  16355. }
  16356. init() {
  16357. if (this.inited)
  16358. return;
  16359. this.inited = true;
  16360. this.gameObj = this.owner;
  16361. this.border = this.gameObj.getChildByName("border");
  16362. }
  16363. setBorderPos() {
  16364. if (this.isSetBorder)
  16365. return;
  16366. this.isSetBorder = true;
  16367. let ui = xGame.common.gameUI.ui;
  16368. let bar1 = this.border.getChildByName("bar1");
  16369. let bar2 = this.border.getChildByName("bar2");
  16370. let bar3 = this.border.getChildByName("bar3");
  16371. let bar4 = this.border.getChildByName("bar4");
  16372. let bar5 = this.border.getChildByName("bar5");
  16373. let bar6 = this.border.getChildByName("bar6");
  16374. this.setInfo(bar1, ui.border.bar1, "box");
  16375. this.setInfo(bar2, ui.border.bar2, "box");
  16376. this.setInfo(bar3, ui.border.bar3, "box");
  16377. this.setInfo(bar4, ui.border.bar4, "box");
  16378. this.setInfo(bar5, ui.border.bar5, "box");
  16379. this.setInfo(bar6, ui.border.bar6, "box");
  16380. let circle1 = this.border.getChildByName("circle1");
  16381. let circle2 = this.border.getChildByName("circle2");
  16382. let circle3 = this.border.getChildByName("circle3");
  16383. let circle4 = this.border.getChildByName("circle4");
  16384. let circle5 = this.border.getChildByName("circle5");
  16385. let circle6 = this.border.getChildByName("circle6");
  16386. this.setInfo(circle1, ui.border.circle1, "circle");
  16387. this.setInfo(circle2, ui.border.circle2, "circle");
  16388. this.setInfo(circle3, ui.border.circle3, "circle");
  16389. this.setInfo(circle4, ui.border.circle4, "circle");
  16390. this.setInfo(circle5, ui.border.circle5, "circle");
  16391. this.setInfo(circle6, ui.border.circle6, "circle");
  16392. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  16393. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  16394. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  16395. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  16396. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  16397. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  16398. let arr = xGame.common.gameMgr.holePosList;
  16399. xGame.common.gameMgr.posObj = {
  16400. "1": arr[0],
  16401. "3": arr[2],
  16402. "4": arr[3],
  16403. "6": arr[5]
  16404. };
  16405. }
  16406. initHolePos(x, y) {
  16407. if (x < 300)
  16408. x += 25;
  16409. else if (x > 1000)
  16410. x -= 25;
  16411. else if (y > 200)
  16412. y -= 10;
  16413. else
  16414. y += 10;
  16415. if (y < 200)
  16416. y += 30;
  16417. else if (y > 500)
  16418. y -= 30;
  16419. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  16420. }
  16421. setInfo(d3Obj, d2Obj, type) {
  16422. let ui = xGame.common.gameUI.ui;
  16423. let sprite = new Laya.Sprite();
  16424. ui.border.displayObject.addChild(sprite);
  16425. let colli = xGame.common.getCollider(type);
  16426. sprite.addComponentIntance(colli);
  16427. let rigy = xGame.common.getRigbody();
  16428. rigy.type = "static";
  16429. sprite.addComponentIntance(rigy);
  16430. let d3Pos = d3Obj.transform.position;
  16431. xGame.common.pos3to2Convert(d3Pos);
  16432. let scaleX = d3Obj.transform.localScaleX;
  16433. let scaleZ = d3Obj.transform.localScaleZ;
  16434. let width = xGame.common.scale3to2Convert(scaleZ);
  16435. let height = xGame.common.scale3to2Convert(scaleX);
  16436. sprite.pivotX = width / 2;
  16437. sprite.pivotY = height / 2;
  16438. sprite.x = d3Pos.x;
  16439. sprite.y = d3Pos.y;
  16440. sprite.width = width;
  16441. sprite.height = height;
  16442. d2Obj.x = d3Pos.x;
  16443. d2Obj.y = d3Pos.y;
  16444. d2Obj.width = width;
  16445. d2Obj.height = height;
  16446. if (type == "box") {
  16447. colli.width = width;
  16448. colli.height = height;
  16449. colli.isSensor = false;
  16450. colli.label = "border";
  16451. }
  16452. else {
  16453. colli.radius = width / 2;
  16454. colli.isSensor = true;
  16455. colli.label = "hole";
  16456. sprite.addComponent(D2Hole);
  16457. }
  16458. }
  16459. }
  16460. class D3World extends Laya.Script3D {
  16461. constructor() {
  16462. super();
  16463. this.loadNum = 0;
  16464. this.setLoadNum = 7;
  16465. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  16466. }
  16467. onAwake() {
  16468. }
  16469. loadScene() {
  16470. this.scene = this.owner;
  16471. let url = `res/unityRes/root.lh`;
  16472. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  16473. this.scene.addChild(prefab);
  16474. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  16475. this.putCameraInfo();
  16476. this.camera.enableHDR = false;
  16477. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  16478. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  16479. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  16480. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  16481. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  16482. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  16483. this.knife.active = false;
  16484. this.loadD3Obj();
  16485. }));
  16486. }
  16487. putCameraInfo() {
  16488. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  16489. this.cameraObj = new cameraType();
  16490. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  16491. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  16492. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  16493. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  16494. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  16495. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  16496. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  16497. this.visitAngleChild.init();
  16498. this.visitRootObj.posX = this.visitAngleChild.posX;
  16499. this.visitRootObj.posY = this.visitAngleChild.posY;
  16500. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  16501. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  16502. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  16503. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  16504. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  16505. xGame.common.showOneCamera("mainCamera");
  16506. }
  16507. loadD3Obj() {
  16508. this.loadTable();
  16509. this.loadRoom();
  16510. this.loadInHoleParticial();
  16511. this.loadIceParticial();
  16512. this.loadHitParticial();
  16513. this.loadFireworksParticial();
  16514. this.loadBall();
  16515. }
  16516. loadInHoleParticial() {
  16517. this.loadD3Res("inHoleEft", "", (prefab) => {
  16518. prefab.addComponent(Partical);
  16519. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  16520. });
  16521. }
  16522. loadIceParticial() {
  16523. this.loadD3Res("iceEft", "", (prefab) => {
  16524. prefab.addComponent(Partical);
  16525. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  16526. });
  16527. }
  16528. loadHitParticial() {
  16529. this.loadD3Res("hitEft", "", (prefab) => {
  16530. prefab.addComponent(Partical);
  16531. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  16532. });
  16533. }
  16534. loadFireworksParticial() {
  16535. this.loadD3Res("fireworksEft", "", (prefab) => {
  16536. prefab.addComponent(Partical);
  16537. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  16538. });
  16539. }
  16540. loadBall(index = 1) {
  16541. this.loadD3Res("ball", index, (prefab) => {
  16542. this.ballPrefab = prefab;
  16543. this.ballPrefab.addComponent(Ball);
  16544. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  16545. });
  16546. }
  16547. loadTable(index = 1) {
  16548. this.loadD3Res("table", index, (prefab) => {
  16549. this.tableSrc = prefab.addComponent(Table);
  16550. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  16551. this.d3Hand.init();
  16552. this.tableRoot.addChild(prefab);
  16553. });
  16554. }
  16555. loadRoom(index = 1) {
  16556. this.loadD3Res("room", index, (prefab) => {
  16557. this.roomRoot.addChild(prefab);
  16558. });
  16559. }
  16560. loadD3Res(type, index, callback) {
  16561. let url = `res/unityRes/${type}${index}.lh`;
  16562. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  16563. callback && callback(prefab);
  16564. this.checkResLoad();
  16565. }));
  16566. }
  16567. checkResLoad() {
  16568. this.loadNum++;
  16569. if (this.loadNum >= this.setLoadNum) {
  16570. xGame.eventMgr.event(D3RES_LOADED);
  16571. }
  16572. }
  16573. prePlayEft() {
  16574. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  16575. eft.transform.localPositionX = 0;
  16576. eft.transform.localPositionY = -5;
  16577. eft.transform.localPositionZ = 0;
  16578. eft.active = true;
  16579. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  16580. ice.transform.localPositionX = 0;
  16581. ice.transform.localPositionY = -5;
  16582. ice.transform.localPositionZ = 0;
  16583. ice.active = true;
  16584. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  16585. hit.transform.localPositionX = 0;
  16586. hit.transform.localPositionY = -5;
  16587. hit.transform.localPositionZ = 0;
  16588. hit.active = true;
  16589. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  16590. fireworks.transform.localPositionX = 0;
  16591. fireworks.transform.localPositionY = -5;
  16592. fireworks.transform.localPositionZ = 0;
  16593. fireworks.active = true;
  16594. }
  16595. }
  16596. class cameraType {
  16597. }
  16598. class MoyuMgr$1 {
  16599. static initMoyu() {
  16600. this.moyuView = new MoyuView$1();
  16601. Laya.stage.addChild(this.moyuView.ui.displayObject);
  16602. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  16603. this.moyuView.ui.displayObject.zOrder = 1000;
  16604. this.moyuView.init();
  16605. this.moyuView.showTip(true);
  16606. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  16607. window['XApk'] = this;
  16608. }
  16609. static showAge(show) {
  16610. if (this.moyuView)
  16611. this.moyuView.showAge(show);
  16612. }
  16613. static onPlatMsg(idx) {
  16614. if (!MoyuMgr$1.moyuView)
  16615. return;
  16616. if (idx == '0') {
  16617. MoyuMgr$1.moyuView.showTip(false);
  16618. }
  16619. }
  16620. static showAgree(call) {
  16621. if (this.moyuView)
  16622. this.moyuView.showAgree(call);
  16623. else
  16624. call && call();
  16625. }
  16626. static showXy(type = 1) {
  16627. if (this.moyuView)
  16628. this.moyuView.showXy(type);
  16629. }
  16630. }
  16631. MoyuMgr$1.isAdvise = false;
  16632. class MoyuView$1 {
  16633. constructor() {
  16634. this.ysxyNum = 1;
  16635. this.ysJson = null;
  16636. this.ui = ui_UIMoyu.createInstance();
  16637. }
  16638. init() {
  16639. this.ui.mainBg.visible = false;
  16640. this.ui.xyNode.visible = false;
  16641. this.ui.ageNode.visible = false;
  16642. this.ui.tipNode.visible = false;
  16643. this.ui.rnNode.visible = false;
  16644. this.ui.fcmNode.visible = false;
  16645. this.ui.ageTip.visible = false;
  16646. this.ui.msgNode.visible = false;
  16647. this.ui.visible = false;
  16648. this.ui.xyNode.xyList.setVirtual();
  16649. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  16650. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  16651. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  16652. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  16653. this.ui.xyNode.btnKnown.visible = false;
  16654. this.ui.xyNode.xy1.visible = false;
  16655. this.ui.xyNode.xy2.visible = false;
  16656. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  16657. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  16658. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  16659. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  16660. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  16661. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  16662. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  16663. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  16664. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  16665. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  16666. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  16667. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  16668. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  16669. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  16670. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  16671. this.ysxyNum = 2;
  16672. }
  16673. }
  16674. onClick(obj) {
  16675. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  16676. switch (obj) {
  16677. case this.ui.ageTip:
  16678. if (Moyu.isTTApk) {
  16679. this.ui.ageNode.visible = true;
  16680. this.ui.mainBg.visible = true;
  16681. }
  16682. break;
  16683. case this.ui.tipNode:
  16684. this.showTip(false);
  16685. break;
  16686. case this.ui.ageNode.btnAge:
  16687. this.ui.ageNode.visible = false;
  16688. this.ui.mainBg.visible = false;
  16689. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  16690. this.ui.visible = false;
  16691. break;
  16692. case this.ui.xyNode.btnXy3:
  16693. case this.ui.xyNode.btnXy1:
  16694. this.loadXy(1);
  16695. break;
  16696. case this.ui.xyNode.btnXy2:
  16697. this.loadXy(2);
  16698. break;
  16699. case this.ui.xyNode.btnBack:
  16700. this.ui.xyNode.xy1.visible = true;
  16701. this.ui.xyNode.xy2.visible = false;
  16702. break;
  16703. case this.ui.xyNode.btnKnown:
  16704. this.ui.xyNode.visible = false;
  16705. this.ui.mainBg.visible = false;
  16706. this.ui.visible = false;
  16707. break;
  16708. case this.ui.rnNode.btnCheck:
  16709. this.check();
  16710. break;
  16711. case this.ui.rnNode.btnExit:
  16712. case this.ui.xyNode.btnNo:
  16713. this.ysxyNum--;
  16714. if (this.ysxyNum > 0)
  16715. this.showMsg("再次拒绝退出游戏");
  16716. else {
  16717. Moyu.userAgree(false);
  16718. Moyu.exit();
  16719. }
  16720. break;
  16721. case this.ui.xyNode.btnSure:
  16722. case this.ui.xyNode.btnYes:
  16723. DataMgr.userData.isAgree = true;
  16724. DataMgr.saveUserData();
  16725. this.onAgree();
  16726. break;
  16727. case this.ui.rnNode.btnDone:
  16728. this.ui.rnNode.visible = false;
  16729. this.ui.visible = false;
  16730. break;
  16731. case this.ui.fcmNode.btnRn:
  16732. this.showRn();
  16733. break;
  16734. }
  16735. }
  16736. showTip(show) {
  16737. if (!Moyu.isVVApk && !Moyu.isOPApk)
  16738. return;
  16739. if (show) {
  16740. MoyuMgr$1.isAdvise = true;
  16741. this.ui.visible = true;
  16742. this.ui.tipNode.visible = true;
  16743. this.ui.tipNode.alpha = 1;
  16744. Laya.timer.once(1000, this, this.showTip, [false]);
  16745. }
  16746. else {
  16747. this.ui.tipNode.alpha = 1;
  16748. this.ui.tipNode.visible = true;
  16749. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  16750. this.ui.tipNode.visible = false;
  16751. MoyuMgr$1.isAdvise = false;
  16752. }), 1000);
  16753. }
  16754. }
  16755. showAge(show, px = 0, py = 0) {
  16756. if (Moyu.platType > 10 && !Moyu.isIos) {
  16757. this.ui.ageTip.x = px;
  16758. this.ui.ageTip.y = py;
  16759. this.ui.ageTip.visible = show;
  16760. if (show)
  16761. this.ui.visible = true;
  16762. }
  16763. }
  16764. showAgree(call) {
  16765. this.agreeCall = call;
  16766. this.onAgree();
  16767. return;
  16768. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  16769. this.showXy(0);
  16770. }
  16771. else
  16772. this.onAgree();
  16773. }
  16774. onAgree() {
  16775. if (!this.ui.ageNode.visible)
  16776. this.ui.visible = false;
  16777. this.ui.xyNode.visible = false;
  16778. Moyu.userAgree(true);
  16779. this.showAge(false);
  16780. this.agreeCall && this.agreeCall();
  16781. this.showRn();
  16782. }
  16783. showMsg(txt) {
  16784. this.ui.msgNode.txtMsg.text = txt;
  16785. this.ui.msgNode.visible = true;
  16786. this.ui.msgNode.alpha = 1;
  16787. this.ui.visible = true;
  16788. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  16789. this.ui.msgNode.visible = false;
  16790. }), 2500, true);
  16791. }
  16792. showRn() {
  16793. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  16794. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  16795. this.ui.rnNode.rn1.visible = true;
  16796. this.ui.rnNode.rn2.visible = false;
  16797. this.ui.rnNode.rn3.visible = false;
  16798. this.ui.rnNode.rn4.visible = false;
  16799. this.ui.rnNode.visible = true;
  16800. this.ui.mainBg.visible = true;
  16801. this.ui.rnNode.btnDone.visible = false;
  16802. this.ui.rnNode.btnExit.visible = true;
  16803. this.ui.rnNode.btnCheck.visible = true;
  16804. this.ui.fcmNode.visible = false;
  16805. this.ui.visible = true;
  16806. return;
  16807. }
  16808. }
  16809. this.showFcm();
  16810. }
  16811. showFcm() {
  16812. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  16813. Moyu.initFCM(true);
  16814. if (Moyu.gameTime < 1)
  16815. this.fcmLoop();
  16816. else if (Moyu.gameTime < 999)
  16817. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  16818. }
  16819. }
  16820. fcmLoop() {
  16821. if (Moyu.gameTime < 1) {
  16822. this.ui.rnNode.visible = false;
  16823. this.ui.fcmNode.visible = true;
  16824. this.ui.mainBg.visible = true;
  16825. this.ui.visible = true;
  16826. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  16827. Laya.timer.clear(this.ui, this.fcmLoop);
  16828. }
  16829. }
  16830. check() {
  16831. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  16832. this.ui.rnNode.rn1.visible = false;
  16833. this.ui.rnNode.rn2.visible = false;
  16834. this.ui.rnNode.rn4.visible = true;
  16835. }
  16836. else if (this.ui.rnNode.rn4.visible) {
  16837. let name = this.ui.rnNode.inputName.text;
  16838. let code = this.ui.rnNode.inputCode.text;
  16839. if (code && code.length == 18) {
  16840. this.ui.rnNode.rn1.visible = false;
  16841. this.ui.rnNode.rn4.visible = false;
  16842. Moyu.authenticate(name, code, (res) => {
  16843. this.ui.rnNode.rn2.visible = !res;
  16844. this.ui.rnNode.rn3.visible = res;
  16845. this.ui.rnNode.btnDone.visible = res;
  16846. this.ui.rnNode.btnExit.visible = !res;
  16847. this.ui.rnNode.btnCheck.visible = !res;
  16848. if (res)
  16849. this.showFcm();
  16850. });
  16851. }
  16852. else
  16853. this.showMsg("信息填写不完整");
  16854. }
  16855. }
  16856. loadXy(type = 0) {
  16857. this.ui.xyNode.xy1.visible = false;
  16858. this.ui.xyNode.xy2.visible = true;
  16859. this.ui.xyNode.xyList.scrollToView(0);
  16860. if (type == 1) {
  16861. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  16862. }
  16863. else if (type == 2) {
  16864. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  16865. }
  16866. }
  16867. showXy(type = 0) {
  16868. this.xyBtn();
  16869. if (type == 0) {
  16870. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  16871. this.ui.xyNode.btnSure.visible = true;
  16872. }
  16873. else {
  16874. this.ui.xyNode.btnYes.visible = true;
  16875. this.ui.xyNode.btnNo.visible = true;
  16876. }
  16877. }
  16878. else {
  16879. this.ui.xyNode.btnKnown.visible = true;
  16880. this.ui.mainBg.visible = true;
  16881. }
  16882. this.ui.xyNode.xy1.visible = true;
  16883. this.ui.xyNode.xy2.visible = false;
  16884. this.ui.xyNode.visible = true;
  16885. this.ui.visible = true;
  16886. }
  16887. xyBtn() {
  16888. this.ui.xyNode.btnSure.visible = false;
  16889. this.ui.xyNode.btnYes.visible = false;
  16890. this.ui.xyNode.btnNo.visible = false;
  16891. this.ui.xyNode.btnKnown.visible = false;
  16892. {
  16893. this.ui.xyNode.btnXy3.visible = false;
  16894. this.ui.xyNode.btnXy2.visible = true;
  16895. this.ui.xyNode.btnXy1.visible = true;
  16896. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  16897. }
  16898. }
  16899. createXY(json) {
  16900. this.ysJson = json.content;
  16901. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  16902. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  16903. this.ui.xyNode.xy2.visible = true;
  16904. }
  16905. renderListItem(idx, cell) {
  16906. let xy = this.ysJson[idx];
  16907. cell.height = xy.line * 30;
  16908. cell.xyItem.text = xy.text;
  16909. }
  16910. onDestroy() {
  16911. this.agreeCall = null;
  16912. }
  16913. }
  16914. class UILoading extends UIBase {
  16915. constructor() {
  16916. super();
  16917. this.accTime = 0;
  16918. this.curNum = 0;
  16919. this.rate = 1;
  16920. this.loadSubOk = false;
  16921. this.loadResOK = false;
  16922. this.openLoading = true;
  16923. this.beginLoadRes = false;
  16924. this.finishD2 = false;
  16925. this.finishD3 = false;
  16926. }
  16927. onConstructor() {
  16928. this.ui = ui_UILoading.createInstance();
  16929. this.contentPane = this.ui;
  16930. this.isEject = false;
  16931. this._initUI();
  16932. this._addEvent();
  16933. }
  16934. _initUI() {
  16935. MoyuMgr$1.initMoyu();
  16936. }
  16937. _addEvent() {
  16938. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  16939. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  16940. }
  16941. show() {
  16942. super.show();
  16943. console.log('zh:加载分包资源');
  16944. loadSubRes(this.subResProgress.bind(this));
  16945. this.ui.txtLoad.text = "Loading...";
  16946. }
  16947. subResProgress(pro, finish) {
  16948. this.curNum = pro;
  16949. if (finish) {
  16950. this.curNum = 1;
  16951. this.loadSubOk = true;
  16952. }
  16953. }
  16954. laodD3Res() {
  16955. let scene3D = new Laya.Scene3D();
  16956. xGame.common.d3Scene = scene3D;
  16957. xGame.common.d3World = scene3D.addComponent(D3World);
  16958. xGame.common.d3World.loadScene();
  16959. }
  16960. loadD2Res() {
  16961. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  16962. this.finishD2 = true;
  16963. this.checkLoadAll();
  16964. this.curNum = 1;
  16965. }), Laya.Handler.create(this, (pro) => {
  16966. this.curNum = pro;
  16967. }, null, false));
  16968. }
  16969. d3ResFinish() {
  16970. this.finishD3 = true;
  16971. this.checkLoadAll();
  16972. }
  16973. checkLoadAll() {
  16974. if (this.finishD2 && this.finishD3) {
  16975. this.loadResOK = true;
  16976. }
  16977. }
  16978. loadRes() {
  16979. this.laodD3Res();
  16980. this.loadD2Res();
  16981. }
  16982. myUpdate(dt) {
  16983. if (!this.openLoading)
  16984. return;
  16985. this.accTime += dt * this.rate;
  16986. if (this.accTime >= this.curNum)
  16987. this.accTime = this.curNum;
  16988. this.ui.loadinfo.value = this.accTime * 100;
  16989. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  16990. if (!this.beginLoadRes) {
  16991. this.beginLoadRes = true;
  16992. this.ui.txtLoad.text = "Loading...";
  16993. this.curNum = 0;
  16994. this.accTime = 0;
  16995. this.loadRes();
  16996. }
  16997. if (this.loadResOK) {
  16998. this.openLoading = false;
  16999. Laya.timer.once(300, this, () => {
  17000. xGame.common.d3Scene.active = false;
  17001. MoyuMgr$1.showAgree(enterGame);
  17002. });
  17003. }
  17004. }
  17005. }
  17006. release() {
  17007. }
  17008. hide() {
  17009. super.hide();
  17010. this.release();
  17011. }
  17012. onClose() {
  17013. this.hide();
  17014. }
  17015. }
  17016. UILoading.uiName = "UILoading";
  17017. class UIRepentProp$1 extends UIBase {
  17018. constructor() {
  17019. super();
  17020. this.viewType = 0;
  17021. this.regretType = 0;
  17022. }
  17023. onConstructor() {
  17024. this.ui = ui_UIRepentProp.createInstance();
  17025. this.contentPane = this.ui;
  17026. this.isEject = false;
  17027. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  17028. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  17029. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  17030. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  17031. }
  17032. show(viewType, regretType, callback) {
  17033. PlatMgr.showInsert(true);
  17034. this.viewType = viewType;
  17035. this.regretType = regretType;
  17036. this.callback = callback;
  17037. super.show();
  17038. this.ui.t0.play();
  17039. this.ui.c1.selectedIndex = this.viewType;
  17040. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  17041. if (this.viewType == 0) {
  17042. let guide = DataMgr.getGuideHelpLine();
  17043. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  17044. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  17045. }
  17046. xGame.common.gameMgr.gamePause = true;
  17047. }
  17048. hideSelf() {
  17049. xGame.common.gameMgr.gamePause = false;
  17050. this.callback && this.callback(false);
  17051. this.hide();
  17052. }
  17053. videoRegret() {
  17054. Moyu.showVideoAd(() => {
  17055. this.callback && this.callback(true);
  17056. this.hideSelf();
  17057. }, EAdType.regretBall);
  17058. }
  17059. videoAddHelpLine() {
  17060. let guide = DataMgr.getGuideHelpLine();
  17061. if (guide == 0) {
  17062. this.callback && this.callback(true);
  17063. this.hideSelf();
  17064. DataMgr.setGuideHelpLine();
  17065. xGame.common.gameUI.ui.guideNode.visible = false;
  17066. }
  17067. else {
  17068. Moyu.showVideoAd(() => {
  17069. this.callback && this.callback(true);
  17070. this.hideSelf();
  17071. }, EAdType.longHelpLine);
  17072. }
  17073. }
  17074. }
  17075. UIRepentProp$1.uiName = "UIRepentProp";
  17076. class UIRodMethod$1 extends UIBase {
  17077. constructor() {
  17078. super();
  17079. this.isPressd = false;
  17080. }
  17081. onConstructor() {
  17082. this.ui = ui_UIRodMethod.createInstance();
  17083. this.contentPane = this.ui;
  17084. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  17085. this.moveDir = new Laya.Vector2();
  17086. this.moveDest = new Laya.Vector2();
  17087. this.centerPos = new Laya.Vector2();
  17088. xGame.common.uiRodMethod = this;
  17089. }
  17090. show() {
  17091. super.show();
  17092. xGame.common.gameMgr.gamePause = true;
  17093. this.openPressDotEvent();
  17094. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  17095. this.centerPos.x = this.ui.white.x;
  17096. this.centerPos.y = this.ui.white.y;
  17097. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  17098. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  17099. this.setDot();
  17100. }
  17101. setDot() {
  17102. this.ui.dot.x = this.moveDest.x;
  17103. this.ui.dot.y = this.moveDest.y;
  17104. }
  17105. closeSelf() {
  17106. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  17107. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  17108. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  17109. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  17110. xGame.common.gameMgr.gamePause = false;
  17111. this.hide();
  17112. }
  17113. openPressDotEvent() {
  17114. this.closePressDotEvent();
  17115. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17116. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17117. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17118. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17119. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17120. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17121. }
  17122. closePressDotEvent() {
  17123. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17124. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17125. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17126. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17127. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17128. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17129. }
  17130. onDown(e) {
  17131. if (e.type == Laya.Event.MOUSE_DOWN)
  17132. this.isPressd = true;
  17133. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  17134. this.isPressd = false;
  17135. if (!this.isPressd)
  17136. return;
  17137. this.moveDest.x = e.stageX;
  17138. this.moveDest.y = e.stageY;
  17139. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  17140. if (dis > 6724) {
  17141. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  17142. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  17143. }
  17144. this.setDot();
  17145. }
  17146. resetRod() {
  17147. this.ui.dot.x = this.ui.white.x;
  17148. this.ui.dot.y = this.ui.white.y;
  17149. this.gameRod.dot.x = this.gameRod.bg.x;
  17150. this.gameRod.dot.y = this.gameRod.bg.y;
  17151. xGame.common.rodOffest.x = 0;
  17152. xGame.common.rodOffest.y = 0;
  17153. }
  17154. }
  17155. UIRodMethod$1.uiName = "UIRodMethod";
  17156. class UIMsg$1 extends UIBase {
  17157. constructor() {
  17158. super();
  17159. }
  17160. onConstructor() {
  17161. this.ui = ui_UIMsg.createInstance();
  17162. this.contentPane = this.ui;
  17163. this.isEject = false;
  17164. this.isMuti = true;
  17165. }
  17166. show(msg, callback) {
  17167. super.show();
  17168. this.ui.tipsNode.msgTxt.text = msg;
  17169. this.ui.alpha = 1;
  17170. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  17171. this.hide();
  17172. callback && callback();
  17173. }), 1000);
  17174. }
  17175. }
  17176. UIMsg$1.uiName = "UIMsg";
  17177. class UITips$1 extends UIBase {
  17178. constructor() {
  17179. super();
  17180. this.type = 0;
  17181. }
  17182. onConstructor() {
  17183. this.ui = ui_UITips.createInstance();
  17184. this.contentPane = this.ui;
  17185. this.isEject = false;
  17186. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  17187. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  17188. }
  17189. show(tipsTxt, womanTxt, type) {
  17190. super.show();
  17191. this.ui.t0.play();
  17192. this.ui.myNode.tipsTxt.text = tipsTxt;
  17193. this.ui.myNode.womanTxt.text = womanTxt;
  17194. PlatMgr.showInsert(true);
  17195. this.ui.myNode.c1.selectedIndex = type;
  17196. this.type = type;
  17197. switch (this.type) {
  17198. case TipsType.exitGame:
  17199. xGame.common.gameMgr.gamePause = true;
  17200. break;
  17201. case TipsType.foul:
  17202. Laya.timer.once(200, this, () => {
  17203. xGame.common.gameMgr.gamePause = true;
  17204. });
  17205. break;
  17206. default:
  17207. break;
  17208. }
  17209. }
  17210. clickLeftBtn() {
  17211. this.hide();
  17212. xGame.common.gameMgr.gamePause = false;
  17213. switch (this.type) {
  17214. case TipsType.exitGame:
  17215. break;
  17216. case TipsType.foul:
  17217. break;
  17218. default:
  17219. break;
  17220. }
  17221. }
  17222. clickRightBtn() {
  17223. this.hide();
  17224. switch (this.type) {
  17225. case TipsType.exitGame:
  17226. xGame.eventMgr.event(RESET_GAME);
  17227. xGame.uiMgr.Show(UIMain$1);
  17228. Moyu.recordEnd(this, null);
  17229. xGame.common.longHelpLine = false;
  17230. break;
  17231. case TipsType.foul:
  17232. xGame.common.gameMgr.gamePause = false;
  17233. Laya.timer.clearAll(this);
  17234. break;
  17235. default:
  17236. break;
  17237. }
  17238. }
  17239. }
  17240. UITips$1.uiName = "UITips";
  17241. class UIGame$1 extends UIBase {
  17242. constructor() {
  17243. super();
  17244. this.powerNum = 0;
  17245. this.isD3Inited = false;
  17246. this.isPrePlay = false;
  17247. this.isMoveRod = false;
  17248. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  17249. this.rulerDis = 20;
  17250. this.rulerOffset = 0;
  17251. }
  17252. onConstructor() {
  17253. this.ui = ui_UIGame.createInstance();
  17254. this.contentPane = this.ui;
  17255. this.ui.x += xGame.common.sysOffestNum;
  17256. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  17257. this.isEject = false;
  17258. xGame.common.gameUI = this;
  17259. this.initSelf();
  17260. }
  17261. isTurnSelf() {
  17262. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  17263. return true;
  17264. }
  17265. }
  17266. initSelf() {
  17267. let topUI = this.ui.topNode;
  17268. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  17269. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  17270. this.barInfo = {};
  17271. this.barInfo.curY = 0;
  17272. this.barInfo.height = this.ui.powerNode.height;
  17273. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  17274. this.barInfo.powerStartY = this.ui.powerNode.y;
  17275. xGame.common.aiPlayer = new AIPlayer();
  17276. xGame.common.gameMgr = new GameMgr();
  17277. xGame.common.skillMgr = new SkillMgr();
  17278. xGame.common.wordsMgr = new WordsMgr();
  17279. xGame.common.talkMgr = new TalkMgr();
  17280. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  17281. console.log("加载经典模式表情文件chenggon !");
  17282. });
  17283. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  17284. console.log("挑战模式奖励模式spine加载成功!");
  17285. });
  17286. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  17287. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  17288. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  17289. this.addUIClick(this.ui.returnBtn, this.returnHome);
  17290. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  17291. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  17292. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  17293. }
  17294. returnHome() {
  17295. let tips = "Are you sure to exit the game?";
  17296. let woman = "Boss, why don't you play for a while longer?";
  17297. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  17298. }
  17299. addRodMethodClick() {
  17300. if (this.isTurnSelf()) {
  17301. xGame.uiMgr.Show(UIRodMethod$1);
  17302. }
  17303. }
  17304. clickHelpLineBtn(force = false) {
  17305. if (!this.isTurnSelf())
  17306. return;
  17307. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  17308. if (success) {
  17309. xGame.common.longHelpLine = true;
  17310. xGame.common.d2World.getHelpLine();
  17311. Moyu.sendDataEvent("guideNum");
  17312. }
  17313. else {
  17314. }
  17315. });
  17316. }
  17317. renderSelfDisplayBalls(index, target) {
  17318. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  17319. target.myImg.url = xGame.common.getGameIconUrl(str);
  17320. }
  17321. renderAIDisplayBalls(index, target) {
  17322. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  17323. target.myImg.url = xGame.common.getGameIconUrl(str);
  17324. ;
  17325. }
  17326. updateMode() {
  17327. if (xGame.common.gameMode == GameMode.classic) {
  17328. this.ui.topNode.scoreNode.visible = false;
  17329. }
  17330. else if (xGame.common.gameMode == GameMode.bigMove) {
  17331. this.ui.topNode.scoreNode.visible = true;
  17332. }
  17333. }
  17334. show() {
  17335. super.show();
  17336. console.log("zh:uigame show");
  17337. this.ui.alpha = 0;
  17338. this.updateSelf();
  17339. console.log("zh:uigame bf gamemusic01 start");
  17340. xGame.soundMgr.playMusic("gamemusic01");
  17341. console.log("zh:uigame bf gamemusic01 end");
  17342. xGame.common.gameMgr.gamePause = false;
  17343. xGame.common.gameUI.ui.blackAni.visible = false;
  17344. xGame.common.gameUI.ui.whiteAni.visible = false;
  17345. this.ui.powerEft.visible = false;
  17346. this.ui.colorNode.visible = false;
  17347. this.updateHead();
  17348. }
  17349. updateSelf() {
  17350. if (xGame.common.gameMode == GameMode.classic) {
  17351. this.ui.c1.selectedIndex = 0;
  17352. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  17353. this.ui.topNode.middleNode.visible = true;
  17354. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  17355. }
  17356. else if (xGame.common.gameMode == GameMode.bigMove) {
  17357. this.ui.c1.selectedIndex = 0;
  17358. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  17359. this.ui.topNode.middleNode.visible = false;
  17360. let max = xGame.cfgMgr.getMaxBigMoveLength();
  17361. let rand = xGame.common.randomNum(1, max);
  17362. let guide = DataMgr.getSkillGuide();
  17363. if (guide == 0)
  17364. rand = 1;
  17365. xGame.common.bigMoveLevelIndex = rand;
  17366. }
  17367. else if (xGame.common.gameMode == GameMode.placeBall) {
  17368. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  17369. this.ui.c1.selectedIndex = 1 + data.type;
  17370. this.ui.alpha = 1;
  17371. this.startGame();
  17372. }
  17373. this.updateMode();
  17374. this.initD3world();
  17375. this.initD2world();
  17376. }
  17377. startGame() {
  17378. this.ui.snowNode.visible = Math.random() <= 0.1;
  17379. this.ui.d2Node.visible = false;
  17380. xGame.common.d3World.d3Hand.gameObj.active = false;
  17381. xGame.common.d3World.tableSrc.init();
  17382. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  17383. this.cameraViewChange(() => {
  17384. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  17385. switch (xGame.common.gameMode) {
  17386. case GameMode.classic:
  17387. xGame.common.d3World.d3Hand.gameObj.active = true;
  17388. this.playPutBallD3Ani();
  17389. break;
  17390. case GameMode.bigMove:
  17391. this.enterGame();
  17392. Laya.timer.once(500, this, () => {
  17393. this.ui.topNode.middleNode.visible = true;
  17394. this.ui.topNode.middleNode.t0.play();
  17395. });
  17396. break;
  17397. case GameMode.placeBall:
  17398. this.enterGame();
  17399. break;
  17400. default:
  17401. break;
  17402. }
  17403. });
  17404. PlatMgr.showBanner(false);
  17405. }
  17406. enterGame() {
  17407. this.ui.d2Node.visible = true;
  17408. xGame.common.d3World.d3Hand.gameObj.active = false;
  17409. xGame.common.showOneCamera("mainCamera");
  17410. Moyu.recordGame(30, true);
  17411. if (!this.isPrePlay) {
  17412. this.isPrePlay = true;
  17413. xGame.common.d3World.prePlayEft();
  17414. }
  17415. xGame.common.gameMgr.gameReady();
  17416. this.openAllEvent();
  17417. this.ui.snowNode.visible = false;
  17418. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  17419. this.ui.helpBtn.visible = condition;
  17420. }
  17421. showHelpLineGuide() {
  17422. let longGuide = DataMgr.getGuideHelpLine();
  17423. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  17424. this.ui.helpBtn.visible = true;
  17425. this.ui.guideNode.visible = true;
  17426. }
  17427. }
  17428. setTurnAlpha(alpha) {
  17429. this.ui.keduNode.alpha = alpha;
  17430. this.ui.ganNode.alpha = alpha;
  17431. this.ui.rodMethodNode.alpha = alpha;
  17432. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  17433. }
  17434. cameraViewChange(callback) {
  17435. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  17436. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  17437. xGame.common.showOneCamera("visitAngle");
  17438. cameraSrc.localRotationEulerY = 180;
  17439. cameraSrc.localRotationEulerZ = 0;
  17440. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  17441. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  17442. callback && callback();
  17443. }));
  17444. }));
  17445. }
  17446. playPutBallD3Ani() {
  17447. xGame.common.showOneCamera("mainCamera");
  17448. let handSrc = xGame.common.d3World.d3Hand;
  17449. handSrc.gameObj.active = true;
  17450. handSrc.transform.localPositionZ = 3;
  17451. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  17452. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  17453. handSrc.gameObj.active = false;
  17454. this.enterGame();
  17455. }), 400);
  17456. }));
  17457. }
  17458. updateHead() {
  17459. let user = Moyu.getUserInfo();
  17460. this.ui.topNode.selfNameTxt.text = user.nickName;
  17461. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  17462. let aiData = xGame.cfgMgr.getRandomUserInfo();
  17463. if (DataMgr.getSkillGuide() < 1) {
  17464. this.ui.topNode.aiNameTxt.text = 'billiards';
  17465. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  17466. }
  17467. else {
  17468. this.ui.topNode.aiNameTxt.text = aiData.name;
  17469. this.ui.topNode.aiHeadLoader.url = baseHeadUrl + aiData.icon;
  17470. }
  17471. }
  17472. initD2world() {
  17473. let node = this.ui.d2Root.displayObject;
  17474. let src = node.getComponent(D2World);
  17475. if (!src) {
  17476. xGame.common.d2World = node.addComponent(D2World);
  17477. }
  17478. xGame.common.d2World.initSelf();
  17479. }
  17480. initD3world() {
  17481. if (this.isD3Inited)
  17482. return;
  17483. this.isD3Inited = true;
  17484. let scene3D = xGame.common.d3Scene;
  17485. this.ui.d3Root.displayObject.addChild(scene3D);
  17486. scene3D.active = true;
  17487. xGame.common.d3World.tableSrc.setBorderPos();
  17488. }
  17489. onRootMove(e) {
  17490. let rootBall = xGame.common.d2World.rootBall;
  17491. this.ui.moveNode.x = e.x;
  17492. this.ui.moveNode.y = e.y;
  17493. rootBall.gameObj.x = e.x;
  17494. rootBall.gameObj.y = e.y;
  17495. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  17496. }
  17497. aiRootMove(move) {
  17498. if (move)
  17499. this.hideBallUI();
  17500. else {
  17501. this.showBallUI();
  17502. xGame.common.d2World.getHelpLine();
  17503. }
  17504. }
  17505. aiForce(type, force = 0) {
  17506. this.pressTarget = PressType.powerNode;
  17507. if (type == 1)
  17508. this.onEventUp({ force: true });
  17509. else if (type == 2)
  17510. this.onEventMove({ stageY: force, force: true });
  17511. }
  17512. onEventPress(e) {
  17513. if (e.stopPropagation)
  17514. e.stopPropagation();
  17515. if (!this.isTurnSelf())
  17516. return;
  17517. let target = e.target;
  17518. switch (target) {
  17519. case this.ui.myPowerNode.displayObject:
  17520. this.pressTarget = PressType.powerNode;
  17521. this.barInfo.curY = e.stageY;
  17522. this.updateBarInfo();
  17523. break;
  17524. case this.ui.moveNode.displayObject:
  17525. this.pressTarget = PressType.moveNode;
  17526. this.hideBallUI();
  17527. this.eventObj.curX = this.ui.moveNode.x;
  17528. this.eventObj.curY = this.ui.moveNode.y;
  17529. this.ui.moveNode.finger.visible = false;
  17530. this.eventObj.lastX = e.stageX;
  17531. this.eventObj.lastY = e.stageY;
  17532. break;
  17533. case this.ui.rulerClickNode.displayObject:
  17534. this.pressTarget = PressType.rulerNode;
  17535. this.eventObj.lastY = e.stageY;
  17536. break;
  17537. case this.ui.d2Root.displayObject:
  17538. this.pressTarget = PressType.d2Root;
  17539. this.eventObj.lastX = e.stageX;
  17540. this.eventObj.lastY = e.stageY;
  17541. this.eventObj.starX = e.stageX;
  17542. this.eventObj.starY = e.stageY;
  17543. this.eventObj.curX = 0;
  17544. this.eventObj.curY = 0;
  17545. xGame.common.d2World.d2Gan.setGanLastInfo();
  17546. this.rulerOffset = 0;
  17547. break;
  17548. default:
  17549. break;
  17550. }
  17551. }
  17552. onEventMove(e) {
  17553. if (e.stopPropagation)
  17554. e.stopPropagation();
  17555. if (e && e.force) {
  17556. }
  17557. else {
  17558. if (!this.isTurnSelf())
  17559. return;
  17560. }
  17561. switch (this.pressTarget) {
  17562. case PressType.powerNode:
  17563. this.barInfo.curY = e.stageY;
  17564. this.updateBarInfo();
  17565. this.isMoveRod = true;
  17566. break;
  17567. case PressType.moveNode:
  17568. let rootBall = xGame.common.d2World.rootBall;
  17569. let radius = rootBall.gameObj.width / 2;
  17570. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  17571. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  17572. let border = xGame.common.d2World.borderRect;
  17573. if (curX <= border.x + radius)
  17574. curX = border.x + radius;
  17575. else if (curX >= border.x + border.width - radius)
  17576. curX = border.x + border.width - radius;
  17577. if (curY <= border.y + radius)
  17578. curY = border.y + radius;
  17579. else if (curY >= border.y + border.height - radius)
  17580. curY = border.y + border.height - radius;
  17581. if (xGame.common.gameMgr.isOpenBall) {
  17582. if (curX >= border.x + border.openBallW - radius)
  17583. curX = border.x + border.openBallW - radius;
  17584. }
  17585. this.ui.moveNode.x = curX;
  17586. this.ui.moveNode.y = curY;
  17587. rootBall.gameObj.x = curX;
  17588. rootBall.gameObj.y = curY;
  17589. rootBall.d3BallSrc.setTransPos(curX, curY);
  17590. this.isMoveRod = true;
  17591. break;
  17592. case PressType.rulerNode:
  17593. let yy = e.stageY - this.eventObj.lastY;
  17594. this.eventObj.lastY = e.stageY;
  17595. let ruler1 = this.ui.rulerNode.img1;
  17596. let ruler2 = this.ui.rulerNode.img2;
  17597. ruler1.y += yy;
  17598. ruler2.y += yy;
  17599. this.rulerOffset += yy;
  17600. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  17601. this.rulerOffset = 0;
  17602. xGame.soundMgr.playSound("inch", 1, 10);
  17603. }
  17604. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  17605. let h = ruler1.height;
  17606. this.checkGuide();
  17607. this.isMoveRod = true;
  17608. if (ruler1.y >= h) {
  17609. ruler1.y = -h;
  17610. ruler2.y = 0;
  17611. return;
  17612. }
  17613. else if (ruler1.y <= -h) {
  17614. ruler1.y = h;
  17615. ruler2.y = 0;
  17616. return;
  17617. }
  17618. if (ruler2.y >= h) {
  17619. ruler2.y = -h;
  17620. ruler1.y = 0;
  17621. return;
  17622. }
  17623. else if (ruler2.y <= -h) {
  17624. ruler2.y = h;
  17625. ruler1.y = 0;
  17626. return;
  17627. }
  17628. break;
  17629. case PressType.d2Root:
  17630. this.eventObj.curX = e.stageX;
  17631. this.eventObj.curY = e.stageY;
  17632. let offset = this.checkRodMoveDir();
  17633. xGame.common.d2World.d2Gan.rotateSelf(offset);
  17634. this.eventObj.lastX = e.stageX;
  17635. this.eventObj.lastY = e.stageY;
  17636. break;
  17637. default:
  17638. break;
  17639. }
  17640. }
  17641. onEventUp(e) {
  17642. if (e.stopPropagation)
  17643. e.stopPropagation();
  17644. if (e && e.force) {
  17645. }
  17646. else {
  17647. if (!this.isTurnSelf())
  17648. return;
  17649. }
  17650. switch (this.pressTarget) {
  17651. case PressType.powerNode:
  17652. this.ui.powerNode.value = 0;
  17653. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  17654. this.ui.powerTxt.text = "";
  17655. if (this.powerNum > 0) {
  17656. xGame.eventMgr.event(BALL_SHOOT);
  17657. xGame.common.d2World.shoot(this.powerNum);
  17658. xGame.common.d2World.d2Gan.shoot();
  17659. xGame.common.d2World.d2HelpLine.shoot();
  17660. this.finishGuide();
  17661. this.ui.powerEft.visible = false;
  17662. this.ui.colorNode.visible = false;
  17663. let ganStr = "";
  17664. if (this.powerNum <= 30) {
  17665. ganStr = "gan_30";
  17666. }
  17667. else if (this.powerNum <= 60) {
  17668. ganStr = "gan_50";
  17669. }
  17670. else {
  17671. ganStr = "gan_80";
  17672. }
  17673. xGame.soundMgr.playSound(ganStr);
  17674. }
  17675. break;
  17676. case PressType.moveNode:
  17677. let rootBall = xGame.common.d2World.rootBall;
  17678. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  17679. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  17680. let isIntersect = this.judgeBallIntersect();
  17681. if (isIntersect) {
  17682. this.ui.moveNode.x = lastX;
  17683. this.ui.moveNode.y = lastY;
  17684. rootBall.gameObj.x = lastX;
  17685. rootBall.gameObj.y = lastY;
  17686. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  17687. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  17688. }
  17689. else {
  17690. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  17691. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  17692. }
  17693. this.showBallUI();
  17694. this.ui.moveNode.finger.visible = true;
  17695. xGame.common.d2World.getHelpLine();
  17696. break;
  17697. case PressType.rulerNode:
  17698. break;
  17699. case PressType.d2Root:
  17700. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  17701. if (dis <= 25) {
  17702. this.moveToClickDot(e);
  17703. }
  17704. break;
  17705. default:
  17706. break;
  17707. }
  17708. this.pressTarget = -1;
  17709. }
  17710. checkGuide() {
  17711. let guide = DataMgr.getSkillGuide();
  17712. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  17713. xGame.common.guideStep++;
  17714. xGame.common.gameUI.ui.guide2.visible = false;
  17715. xGame.common.gameUI.ui.guide3.visible = true;
  17716. }
  17717. }
  17718. finishGuide() {
  17719. let guide = DataMgr.getSkillGuide();
  17720. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  17721. xGame.common.guideStep = 10;
  17722. this.closeAllGuide();
  17723. }
  17724. }
  17725. closeAllGuide() {
  17726. xGame.common.gameUI.ui.guide1.visible = false;
  17727. xGame.common.gameUI.ui.guide2.visible = false;
  17728. xGame.common.gameUI.ui.guide3.visible = false;
  17729. }
  17730. updateBarInfo() {
  17731. let star = this.ui.powerNode.y;
  17732. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  17733. if (rate >= 1)
  17734. rate = 1;
  17735. if (rate <= 0)
  17736. rate = 0;
  17737. this.powerNum = Math.ceil(rate * 100);
  17738. this.ui.powerNode.value = this.powerNum;
  17739. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  17740. this.ui.colorNode.value = this.powerNum;
  17741. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  17742. this.ui.powerEft.visible = this.powerNum != 0;
  17743. this.ui.colorNode.visible = this.powerNum != 0;
  17744. this.ui.powerTxt.text = this.powerNum + "";
  17745. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  17746. }
  17747. forceCancel() {
  17748. this.ui.powerNode.value = 0;
  17749. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  17750. this.ui.powerTxt.text = "";
  17751. }
  17752. checkRodMoveDir() {
  17753. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  17754. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  17755. if (tempX >= 0 && tempY <= 0) {
  17756. return this.checkDir();
  17757. }
  17758. else if (tempX < 0 && tempY < 0) {
  17759. return this.checkDir(1, -1);
  17760. }
  17761. else if (tempX < 0 && tempY > 0) {
  17762. return this.checkDir(-1, -1);
  17763. }
  17764. else {
  17765. return this.checkDir(-1, 1);
  17766. }
  17767. }
  17768. checkDir(flagX = 1, flagY = 1) {
  17769. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  17770. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  17771. if (offsetY == 0) {
  17772. return offsetX * flagX;
  17773. }
  17774. if (offsetX == 0) {
  17775. return offsetY * flagY;
  17776. }
  17777. let angle = offsetY / offsetX;
  17778. if (Math.abs(angle) >= 1) {
  17779. return offsetY * flagY;
  17780. }
  17781. else {
  17782. return offsetX * flagX;
  17783. }
  17784. }
  17785. judgeBallIntersect() {
  17786. let rootBall = xGame.common.d2World.rootBall;
  17787. let ballArr = xGame.common.d2World.ballArr;
  17788. let radius = rootBall.gameObj.width / 2;
  17789. let temp;
  17790. let isIntersect = false;
  17791. for (let index = 0; index < ballArr.length; index++) {
  17792. temp = ballArr[index];
  17793. if (temp.number == rootBall.number)
  17794. continue;
  17795. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  17796. if (isIntersect) {
  17797. break;
  17798. }
  17799. }
  17800. return isIntersect;
  17801. }
  17802. hideBallUI() {
  17803. let d2Gan = xGame.common.d2World.d2Gan;
  17804. if (!d2Gan.ui.isDisposed)
  17805. d2Gan.ui.visible = false;
  17806. let d2Help = xGame.common.d2World.d2HelpLine;
  17807. if (!d2Help.ui.isDisposed)
  17808. d2Help.ui.visible = false;
  17809. let rootBall = xGame.common.d2World.rootBall;
  17810. if (!rootBall.destroyed) {
  17811. rootBall.gameObj.active = false;
  17812. }
  17813. }
  17814. showBallUI() {
  17815. let d2Gan = xGame.common.d2World.d2Gan;
  17816. if (!d2Gan.ui.isDisposed)
  17817. d2Gan.ui.visible = true;
  17818. let d2Help = xGame.common.d2World.d2HelpLine;
  17819. if (!d2Help.ui.isDisposed)
  17820. d2Help.ui.visible = true;
  17821. let rootBall = xGame.common.d2World.rootBall;
  17822. if (!rootBall.destroyed) {
  17823. rootBall.gameObj.active = true;
  17824. }
  17825. }
  17826. moveToClickDot(e) {
  17827. if (!this.isMoveRod && !xGame.common.clickedBall) {
  17828. let root = xGame.common.d2World.rootBall.gameObj;
  17829. let xx = e.stageX - xGame.common.sysOffestNum;
  17830. let yy = e.stageY;
  17831. let x = xx - root.x;
  17832. let y = yy - root.y;
  17833. let angle = xGame.common.getfguiRotation(x, y);
  17834. xGame.common.d2World.d2Gan.ui.rotation = angle;
  17835. xGame.common.d2World.getHelpLine();
  17836. }
  17837. this.isMoveRod = false;
  17838. xGame.common.clickedBall = false;
  17839. }
  17840. openAllEvent() {
  17841. this.closeAllEvent();
  17842. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17843. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17844. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17845. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17846. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  17847. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  17848. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  17849. }
  17850. closeAllEvent() {
  17851. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17852. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17853. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17854. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17855. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  17856. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  17857. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  17858. }
  17859. resetGame() {
  17860. this.closeAllEvent();
  17861. this.hideBallUI();
  17862. xGame.common.gameMgr.gamePause = true;
  17863. }
  17864. }
  17865. UIGame$1.uiName = "UIGame";
  17866. class UIAddCoin$1 extends UIBase {
  17867. constructor() {
  17868. super();
  17869. this.coinNum = 2000;
  17870. }
  17871. onConstructor() {
  17872. this.ui = ui_UIAddCoin.createInstance();
  17873. this.contentPane = this.ui;
  17874. this.isEject = false;
  17875. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  17876. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  17877. }
  17878. show() {
  17879. super.show();
  17880. this.ui.t0.play();
  17881. }
  17882. videoAddCoin() {
  17883. Moyu.showVideoAd(() => {
  17884. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  17885. this.hide();
  17886. }, EAdType.addFailCoin);
  17887. }
  17888. }
  17889. UIAddCoin$1.uiName = "UIAddCoin";
  17890. class UIInvitation$1 extends UIBase {
  17891. constructor() {
  17892. super();
  17893. }
  17894. onConstructor() {
  17895. this.ui = ui_UIInvitation.createInstance();
  17896. this.contentPane = this.ui;
  17897. this.isEject = false;
  17898. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  17899. }
  17900. show() {
  17901. super.show();
  17902. }
  17903. enterGame() {
  17904. xGame.common.gameMode = GameMode.classic;
  17905. DataMgr.setChallengeTimes(1);
  17906. xGame.common.passAwardCoin = 2000;
  17907. let need = xGame.common.classicNiceNeddCoin;
  17908. if (DataMgr.coinEnough(need)) {
  17909. DataMgr.setCoin(-need);
  17910. xGame.eventMgr.event(RESTART_GAME, true);
  17911. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  17912. }
  17913. else {
  17914. xGame.eventMgr.event(RESTART_GAME, true);
  17915. }
  17916. this.hide();
  17917. }
  17918. hide() {
  17919. super.hide();
  17920. }
  17921. }
  17922. UIInvitation$1.uiName = "UIInvitation";
  17923. class UIPower$1 extends UIBase {
  17924. constructor() {
  17925. super();
  17926. }
  17927. onConstructor() {
  17928. this.ui = ui_UIPower.createInstance();
  17929. this.contentPane = this.ui;
  17930. this.isEject = false;
  17931. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  17932. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  17933. }
  17934. show() {
  17935. super.show();
  17936. this.ui.t0.play();
  17937. }
  17938. videoGetPower() {
  17939. Moyu.showVideoAd(() => {
  17940. DataMgr.setPower(xGame.common.videoPower, true);
  17941. xGame.eventMgr.event(POWER_TIME);
  17942. this.hide();
  17943. }, EAdType.getPower);
  17944. }
  17945. }
  17946. UIPower$1.uiName = "UIPower";
  17947. class UIGameEnd$1 extends UIBase {
  17948. constructor() {
  17949. super();
  17950. this.success = false;
  17951. this.awardCoinNum = 1000;
  17952. this.awardDiamondNum = 10;
  17953. }
  17954. onConstructor() {
  17955. this.ui = ui_UIGameEnd.createInstance();
  17956. this.contentPane = this.ui;
  17957. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  17958. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  17959. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  17960. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  17961. this.ui.talkNode.visible = false;
  17962. if (Moyu.isKs)
  17963. this.ui.closeNode.closeBtn.x += 100;
  17964. }
  17965. updateType() {
  17966. switch (xGame.common.gameMode) {
  17967. case GameMode.classic:
  17968. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  17969. this.ui.coinNode.visible = this.success;
  17970. if (!this.success) {
  17971. Laya.timer.once(500, this, () => {
  17972. xGame.uiMgr.Show(UIAddCoin$1);
  17973. });
  17974. }
  17975. this.ui.isGetAward.visible = false;
  17976. this.ui.leftBtn.c1.selectedIndex = 3;
  17977. this.ui.rightBtn.c1.selectedIndex = 0;
  17978. this.moneyNode.ui.c1.selectedIndex = 1;
  17979. break;
  17980. case GameMode.bigMove:
  17981. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  17982. this.ui.coinNode.visible = this.success;
  17983. if (xGame.common.gameMode == GameMode.bigMove) {
  17984. if (this.success) {
  17985. DataMgr.setSkillSuccessTimes(1, true);
  17986. DataMgr.setSkillAccTimes(1);
  17987. }
  17988. else {
  17989. DataMgr.setSkillSuccessTimes(0, false);
  17990. }
  17991. }
  17992. if (!this.success) {
  17993. Laya.timer.once(500, this, () => {
  17994. xGame.uiMgr.Show(UIAddCoin$1);
  17995. });
  17996. }
  17997. this.ui.isGetAward.visible = false;
  17998. this.ui.leftBtn.c1.selectedIndex = 3;
  17999. this.ui.rightBtn.c1.selectedIndex = 0;
  18000. this.moneyNode.ui.c1.selectedIndex = 1;
  18001. break;
  18002. case GameMode.placeBall:
  18003. this.ui.coinNode.visible = false;
  18004. if (this.success) {
  18005. if (xGame.common.placeBallStarNum == 3) {
  18006. this.ui.c1.selectedIndex = 2;
  18007. }
  18008. else {
  18009. this.ui.c1.selectedIndex = 3;
  18010. }
  18011. }
  18012. else {
  18013. this.ui.c1.selectedIndex = 4;
  18014. }
  18015. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  18016. if (cfg.type == PlaceBallType.challenge) {
  18017. this.ui.c1.selectedIndex = 2;
  18018. }
  18019. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `打进场上所有球` : `打进${cfg.ball}颗球`;
  18020. this.updatePlaceBallBtn();
  18021. this.updatePlaceBallStarNum();
  18022. this.updatePlaceBallAwardState();
  18023. this.moneyNode.ui.c1.selectedIndex = 2;
  18024. this.moneyNode.checkPowerTime();
  18025. this.moneyNode.powerChange();
  18026. DataMgr.upRankData();
  18027. break;
  18028. default:
  18029. break;
  18030. }
  18031. }
  18032. updatePlaceBallBtn() {
  18033. this.ui.leftBtn.c1.selectedIndex = 5;
  18034. if (this.success) {
  18035. this.ui.rightBtn.c1.selectedIndex = 14;
  18036. }
  18037. else {
  18038. if (xGame.common.placeBallStarNum == 3) {
  18039. this.ui.rightBtn.c1.selectedIndex = 14;
  18040. }
  18041. else {
  18042. this.ui.rightBtn.c1.selectedIndex = 1;
  18043. }
  18044. }
  18045. }
  18046. updatePlaceBallStarNum() {
  18047. let starNum = xGame.common.placeBallStarNum;
  18048. if (starNum == 0)
  18049. this.ui.starNumNode.c1.selectedIndex = 3;
  18050. else {
  18051. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  18052. }
  18053. }
  18054. updatePlaceBallAwardState() {
  18055. let level = xGame.common.placeBallCurLevel;
  18056. let starNum = xGame.common.placeBallStarNum;
  18057. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  18058. let data = cfgTable.placeballData[level].award;
  18059. let cfg = cfgTable.placeballData[level];
  18060. this.awardDiamondNum = data[1];
  18061. this.awardCoinNum = data[0];
  18062. if (cfg.type == PlaceBallType.challenge) {
  18063. this.awardDiamondNum = 0;
  18064. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  18065. }
  18066. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  18067. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  18068. if (cfg.type == PlaceBallType.challenge) {
  18069. this.ui.awardNode.coinNode.visible = true;
  18070. }
  18071. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  18072. this.ui.awardNode.diamondNode.x = 265;
  18073. this.ui.awardNode.coinNode.x = 354;
  18074. }
  18075. else {
  18076. this.ui.awardNode.diamondNode.x = 291;
  18077. this.ui.awardNode.coinNode.x = 291;
  18078. }
  18079. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  18080. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  18081. if (this.awardCoinNum == 0) {
  18082. this.ui.awardNode.coinNode.numTxt.text = "";
  18083. }
  18084. if (getAward) {
  18085. this.ui.isGetAward.visible = true;
  18086. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  18087. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  18088. }
  18089. else {
  18090. this.ui.isGetAward.visible = false;
  18091. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  18092. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  18093. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  18094. }
  18095. else {
  18096. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  18097. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  18098. }
  18099. }
  18100. }
  18101. show(success) {
  18102. super.show();
  18103. xGame.eventMgr.event(RESET_GAME);
  18104. this.success = success;
  18105. Laya.timer.clearAll(this);
  18106. this.playSecretaryAni();
  18107. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  18108. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  18109. offsetTime = Math.floor(offsetTime / 1000);
  18110. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  18111. this.updateType();
  18112. Laya.timer.once(200, this, () => {
  18113. this.addAward(() => {
  18114. this.updateType();
  18115. Laya.timer.once(500, this, () => {
  18116. this.showChallengeLevel();
  18117. });
  18118. });
  18119. });
  18120. if (this.success) {
  18121. xGame.soundMgr.playSound('slots_roll01');
  18122. xGame.soundMgr.playSound("s_win");
  18123. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18124. }
  18125. else {
  18126. xGame.soundMgr.playSound('matchwin01');
  18127. xGame.soundMgr.playSound("s_lose");
  18128. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18129. }
  18130. if (!Moyu.isLegal)
  18131. PlatMgr.showBanner(true);
  18132. let challengeNum = DataMgr.getChallengeTimes();
  18133. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  18134. DataMgr.setChallengeTimes(1);
  18135. }
  18136. if (this.success && xGame.common.gameMode == GameMode.classic) {
  18137. DataMgr.setClassicTimes();
  18138. }
  18139. }
  18140. showChallengeLevel() {
  18141. if (DataMgr.getChallengeTimes() != 0)
  18142. return;
  18143. let skill = DataMgr.getSkillAccTimes();
  18144. let put = DataMgr.getPlaceBallLevelList().length;
  18145. if (skill >= 3 || put >= 5) {
  18146. xGame.uiMgr.Show(UIInvitation$1);
  18147. this.hide();
  18148. }
  18149. }
  18150. addAward(callback) {
  18151. if (!this.success) {
  18152. callback && callback();
  18153. return;
  18154. }
  18155. switch (xGame.common.gameMode) {
  18156. case GameMode.classic:
  18157. this.awardCoinNum = xGame.common.passAwardCoin;
  18158. this.awardDiamondNum = 0;
  18159. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  18160. break;
  18161. case GameMode.bigMove:
  18162. this.awardCoinNum = xGame.common.passAwardCoin;
  18163. this.awardDiamondNum = 0;
  18164. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  18165. callback && callback();
  18166. break;
  18167. case GameMode.placeBall:
  18168. let level = xGame.common.placeBallCurLevel;
  18169. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  18170. if (xGame.common.placeBallStarNum != 3) {
  18171. callback && callback();
  18172. return;
  18173. }
  18174. else {
  18175. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  18176. if (getAward) {
  18177. callback && callback();
  18178. return;
  18179. }
  18180. }
  18181. let cfg = cfgTable.placeballData[level];
  18182. let data = cfgTable.placeballData[level].award;
  18183. this.awardCoinNum = data[0];
  18184. this.awardDiamondNum = data[1];
  18185. if (cfg.type == PlaceBallType.challenge) {
  18186. this.awardDiamondNum = 0;
  18187. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  18188. }
  18189. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  18190. let diamondAward;
  18191. if (this.awardDiamondNum > 0) {
  18192. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  18193. xGame.common.getAward([diamondAward, coinAward], callback);
  18194. }
  18195. else {
  18196. xGame.common.getAward([coinAward], callback);
  18197. }
  18198. if (cfg.type == PlaceBallType.normal) {
  18199. DataMgr.setPlaceBallAward(level);
  18200. }
  18201. break;
  18202. default:
  18203. break;
  18204. }
  18205. }
  18206. playSecretaryAni() {
  18207. let parent = this.ui.secretary.displayObject;
  18208. parent.destroyChildren();
  18209. let xx = this.ui.secretary.width / 2;
  18210. let yy = this.ui.secretary.height;
  18211. let scale = xGame.common.getSecretaryScale();
  18212. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18213. if (this.success) {
  18214. let rand = Math.random() <= 0.5 ? 2 : 3;
  18215. xGame.common.secretary.play(data, rand, false, parent, () => {
  18216. xGame.common.secretary.play(data, 1, true, parent);
  18217. });
  18218. }
  18219. else {
  18220. xGame.common.secretary.play(data, 0, true, parent);
  18221. }
  18222. }
  18223. restartGame() {
  18224. switch (xGame.common.gameMode) {
  18225. case GameMode.classic:
  18226. xGame.eventMgr.event(RESTART_GAME);
  18227. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18228. break;
  18229. case GameMode.bigMove:
  18230. this.hide();
  18231. xGame.eventMgr.event(RESTART_GAME);
  18232. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18233. break;
  18234. default:
  18235. break;
  18236. }
  18237. }
  18238. hide() {
  18239. super.hide();
  18240. xGame.common.stopGirlPop(this.ui.talkNode);
  18241. PlatMgr.showBanner(false);
  18242. }
  18243. returnHome() {
  18244. this.hide();
  18245. let showFailWords = !this.success;
  18246. xGame.uiMgr.Show(UIMain$1, showFailWords);
  18247. }
  18248. clickLeftBtn() {
  18249. switch (xGame.common.gameMode) {
  18250. case GameMode.classic:
  18251. case GameMode.bigMove:
  18252. this.returnHome();
  18253. break;
  18254. case GameMode.placeBall:
  18255. let level = xGame.common.placeBallCurLevel;
  18256. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  18257. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18258. break;
  18259. default:
  18260. break;
  18261. }
  18262. }
  18263. powerStartPlaceBallLevel(level, btn) {
  18264. if (DataMgr.powerEnough()) {
  18265. btn.touchable = false;
  18266. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  18267. btn.touchable = true;
  18268. DataMgr.setPower(-1);
  18269. xGame.eventMgr.event(POWER_TIME);
  18270. this.startPlaceBallLevel(level);
  18271. }));
  18272. }
  18273. else {
  18274. xGame.uiMgr.Show(UIPower$1, 0);
  18275. }
  18276. }
  18277. clickRightBtn() {
  18278. switch (xGame.common.gameMode) {
  18279. case GameMode.classic:
  18280. case GameMode.bigMove:
  18281. this.restartGame();
  18282. break;
  18283. case GameMode.placeBall:
  18284. let level = xGame.common.placeBallCurLevel;
  18285. let data = DataMgr.getPlaceBallLevel(level);
  18286. let curPss = data.play && !data.isCur;
  18287. if (curPss) {
  18288. this.powerStartPlaceBallLevel(level + 1, this.ui.rightBtn);
  18289. }
  18290. else {
  18291. Moyu.sendDataEvent("placeBallNextLevel");
  18292. Moyu.showVideoAd(() => {
  18293. DataMgr.setPlaceBallLevel(level, 1);
  18294. this.startPlaceBallLevel(level + 1);
  18295. }, xGame.define.EAdType.placeBallNextLevel);
  18296. }
  18297. break;
  18298. default:
  18299. break;
  18300. }
  18301. }
  18302. startPlaceBallLevel(level) {
  18303. xGame.common.gameMode = GameMode.placeBall;
  18304. xGame.common.placeBallCurLevel = level;
  18305. xGame.uiMgr.Show(UIGame$1);
  18306. this.hide();
  18307. }
  18308. }
  18309. UIGameEnd$1.uiName = "UIGameEnd";
  18310. class ShowItem$1 {
  18311. constructor() {
  18312. this.ui = ui_ShowItem.createInstance();
  18313. }
  18314. destroySelf() {
  18315. if (!this.ui.isDisposed) {
  18316. this.ui.removeFromParent();
  18317. this.ui.dispose();
  18318. }
  18319. }
  18320. setParent(parent) {
  18321. parent.addChild(this.ui);
  18322. }
  18323. setPos(x, y) {
  18324. this.ui.x = x;
  18325. this.ui.y = y;
  18326. }
  18327. setUrl(index) {
  18328. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  18329. }
  18330. }
  18331. class UILevelProp$1 extends UIBase {
  18332. constructor() {
  18333. super();
  18334. this.firstPos = 385;
  18335. this.secondPos = 467;
  18336. this.showItemArr = [];
  18337. }
  18338. onConstructor() {
  18339. this.ui = ui_UILevelProp.createInstance();
  18340. this.contentPane = this.ui;
  18341. this.isEject = false;
  18342. this.addUIClick(this.ui.closeBtn, this.hide);
  18343. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18344. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  18345. }
  18346. show(level) {
  18347. super.show();
  18348. this.ui.t1.play();
  18349. this.level = level;
  18350. this.data = cfgTable.placeballData[this.level];
  18351. this.updateSelf();
  18352. this.showPreView();
  18353. this.moneyNode.ui.c1.selectedIndex = 2;
  18354. this.moneyNode.checkPowerTime();
  18355. this.moneyNode.powerChange();
  18356. }
  18357. showPreView() {
  18358. let item;
  18359. let data;
  18360. for (let index = 0; index < this.showItemArr.length; index++) {
  18361. item = this.showItemArr[index];
  18362. item.destroySelf();
  18363. }
  18364. this.showItemArr = [];
  18365. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  18366. for (const key in cfgData) {
  18367. data = cfgData[key];
  18368. item = new ShowItem$1();
  18369. item.setParent(this.ui.myNode.displayRoot);
  18370. item.setPos(data.x, data.y);
  18371. item.setUrl(data.value);
  18372. this.showItemArr.push(item);
  18373. }
  18374. }
  18375. updateSelf() {
  18376. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  18377. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  18378. if (this.data.ball == -1) {
  18379. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  18380. }
  18381. else {
  18382. this.ui.myNode.conditionTxt.text = "Reward";
  18383. }
  18384. let localData = DataMgr.getPlaceBallLevel(this.level);
  18385. let getAward = localData.getAward;
  18386. let cfg = cfgTable.placeballData[this.level];
  18387. let coin = this.data.award[0];
  18388. let diamond = this.data.award[1];
  18389. if (cfg.type == PlaceBallType.challenge) {
  18390. diamond = 0;
  18391. coin = 100;
  18392. }
  18393. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  18394. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  18395. this.ui.myNode.coinNode.numTxt.text = coin + "";
  18396. if (cfg.type == PlaceBallType.challenge) {
  18397. this.ui.myNode.coinNode.numTxt.text = "";
  18398. }
  18399. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  18400. if (coin > 0 && diamond > 0) {
  18401. this.ui.myNode.diamondNode.x = 385;
  18402. this.ui.myNode.coinNode.x = 467;
  18403. }
  18404. else {
  18405. this.ui.myNode.diamondNode.x = 385;
  18406. this.ui.myNode.coinNode.x = 385;
  18407. }
  18408. if (!getAward) {
  18409. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  18410. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  18411. }
  18412. else {
  18413. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  18414. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  18415. }
  18416. }
  18417. startGame() {
  18418. if (DataMgr.powerEnough()) {
  18419. this.ui.myNode.startBtn.touchable = false;
  18420. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  18421. console.log('zh:startGame ');
  18422. this.ui.myNode.startBtn.touchable = true;
  18423. DataMgr.setPower(-1);
  18424. xGame.eventMgr.event(POWER_TIME);
  18425. xGame.common.gameMode = GameMode.placeBall;
  18426. xGame.common.placeBallCurLevel = this.level;
  18427. xGame.uiMgr.Show(UIGame$1);
  18428. xGame.uiMgr.Hide(UILevelDisplay$1);
  18429. xGame.uiMgr.Hide(UIMain$1);
  18430. this.hide();
  18431. }));
  18432. }
  18433. else {
  18434. xGame.uiMgr.Show(UIPower$1);
  18435. }
  18436. }
  18437. hide() {
  18438. super.hide();
  18439. }
  18440. }
  18441. UILevelProp$1.uiName = "UILevelProp";
  18442. class PutBallLevelDisplay$1 {
  18443. constructor(ui, index) {
  18444. this.index = 0;
  18445. this.ui = ui;
  18446. this.index = index;
  18447. this.ui.onClick(this, this.clickSelf);
  18448. this.updateSelf();
  18449. this.ui.levelTxt.text = (this.index + 1) + "";
  18450. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  18451. this.ui.special.levelTxt.text = (this.index + 1) + "";
  18452. }
  18453. updateSelf() {
  18454. let level = this.index + 1;
  18455. this.data = DataMgr.getPlaceBallLevel(level);
  18456. this.ui.starNode.c1.selectedIndex = this.data.star;
  18457. let isChallenge = cfgTable.placeballData[level].type;
  18458. if (this.data.isCur) {
  18459. if (isChallenge) {
  18460. this.ui.c1.selectedIndex = 5;
  18461. }
  18462. else {
  18463. this.ui.c1.selectedIndex = 2;
  18464. }
  18465. }
  18466. else {
  18467. if (this.data.play) {
  18468. if (this.data.star == 3) {
  18469. this.ui.c1.selectedIndex = 0;
  18470. }
  18471. else {
  18472. this.ui.c1.selectedIndex = 1;
  18473. }
  18474. }
  18475. else {
  18476. if (isChallenge) {
  18477. this.ui.c1.selectedIndex = 4;
  18478. }
  18479. else {
  18480. this.ui.c1.selectedIndex = 3;
  18481. }
  18482. }
  18483. }
  18484. }
  18485. clickSelf() {
  18486. if (!this.data.play)
  18487. return;
  18488. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18489. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  18490. }
  18491. }
  18492. class UILevelDisplay$1 extends UIBase {
  18493. constructor() {
  18494. super();
  18495. }
  18496. onConstructor() {
  18497. this.ui = ui_UILevelDisplay.createInstance();
  18498. this.contentPane = this.ui;
  18499. this.isEject = false;
  18500. this.myList = this.ui.myNode.myList;
  18501. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  18502. this.levelItemArr = [];
  18503. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  18504. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  18505. this.myList.numItems = levelNum;
  18506. if (Moyu.isKs)
  18507. this.ui.closeNode.closeBtn.x += 100;
  18508. }
  18509. levelItemRender(index, target) {
  18510. let item = new PutBallLevelDisplay$1(target, index);
  18511. this.levelItemArr.push(item);
  18512. }
  18513. show() {
  18514. super.show();
  18515. this.updateLevel();
  18516. this.scrollToPlace();
  18517. }
  18518. updateLevel() {
  18519. let temp;
  18520. for (let index = 0; index < this.levelItemArr.length; index++) {
  18521. temp = this.levelItemArr[index];
  18522. temp.updateSelf();
  18523. }
  18524. }
  18525. scrollToPlace() {
  18526. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  18527. let passArr = DataMgr.getPlaceBallLevelList();
  18528. let offest = passArr.length;
  18529. if (offest >= maxNum - 1)
  18530. offest = maxNum - 1;
  18531. this.myList.scrollToView(offest, true, true);
  18532. }
  18533. hide() {
  18534. super.hide();
  18535. }
  18536. }
  18537. UILevelDisplay$1.uiName = "UILevelDisplay";
  18538. class UIMatching$1 extends UIBase {
  18539. constructor() {
  18540. super();
  18541. }
  18542. onConstructor() {
  18543. this.ui = ui_UIMatching.createInstance();
  18544. this.contentPane = this.ui;
  18545. this.isEject = false;
  18546. }
  18547. show(callback) {
  18548. super.show();
  18549. PlatMgr.showBanner(true);
  18550. this.callback = callback;
  18551. let user = Moyu.getUserInfo();
  18552. if (!this.selfPot) {
  18553. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  18554. }
  18555. if (!this.aiPot) {
  18556. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  18557. }
  18558. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  18559. this.ui.selfHead.nameTxt.text = user.nickName;
  18560. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  18561. this.ui.aiHead.nameTxt.text = "???";
  18562. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  18563. this.ui.selfHead.c1.selectedIndex = 0;
  18564. this.ui.aiHead.c1.selectedIndex = 0;
  18565. this.ui.selfHead.x = this.selfPot.x;
  18566. this.ui.selfHead.y = this.selfPot.y;
  18567. this.ui.aiHead.x = this.aiPot.x;
  18568. this.ui.aiHead.y = this.aiPot.y;
  18569. switch (xGame.common.gameMode) {
  18570. case GameMode.classic:
  18571. break;
  18572. case GameMode.bigMove:
  18573. this.initSkillData();
  18574. break;
  18575. default:
  18576. break;
  18577. }
  18578. this.ui.t1.play(Laya.Handler.create(this, () => {
  18579. this.ui.t2.play(Laya.Handler.create(this, () => {
  18580. switch (xGame.common.gameMode) {
  18581. case GameMode.classic:
  18582. this.waitingPeople();
  18583. break;
  18584. case GameMode.bigMove:
  18585. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  18586. break;
  18587. default:
  18588. break;
  18589. }
  18590. }));
  18591. }));
  18592. }
  18593. initSkillData() {
  18594. this.skillSelectData = [];
  18595. let skillUrl = xGame.common.skillIconList;
  18596. let skillName = xGame.common.skillNameList;
  18597. let skillLevel = DataMgr.getBigSkillList();
  18598. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  18599. for (let index = 0; index < 5; index++) {
  18600. let obj = {};
  18601. obj.skillImg = skillUrl[index];
  18602. obj.skillName = skillName[index];
  18603. obj.skillType = skillType[index];
  18604. obj.skillLevel = skillLevel[index];
  18605. this.skillSelectData.push(obj);
  18606. }
  18607. }
  18608. getAISkillLevel(myLevel) {
  18609. let video = xGame.common.upSkillLevel;
  18610. let aiLevel;
  18611. let temp;
  18612. if (video) {
  18613. temp = xGame.common.randomNum(-2, -1);
  18614. }
  18615. else {
  18616. if (myLevel <= 5) {
  18617. temp = xGame.common.randomNum(1, 3);
  18618. }
  18619. else if (myLevel <= 9) {
  18620. temp = xGame.common.randomNum(-2, 1);
  18621. }
  18622. else {
  18623. temp = xGame.common.randomNum(-4, 0);
  18624. }
  18625. }
  18626. aiLevel = temp + myLevel;
  18627. if (aiLevel <= 1)
  18628. aiLevel = 1;
  18629. if (aiLevel >= 10)
  18630. aiLevel = 10;
  18631. return aiLevel;
  18632. }
  18633. getAISkillType() {
  18634. return xGame.common.randomNum(1, 4);
  18635. let successTimes = DataMgr.getSkillSuccessTimes();
  18636. let info = cfgTable.aiskillData[successTimes];
  18637. if (!info) {
  18638. let max = Object.keys(cfgTable.aiskillData).length - 1;
  18639. info = cfgTable.aiskillData[max];
  18640. }
  18641. let dataArr = info.skillselect;
  18642. let myCfg = {};
  18643. for (let index = 0; index < dataArr.length; index++) {
  18644. let temp = dataArr[index].split('-');
  18645. myCfg[temp[0]] = {};
  18646. myCfg[temp[0]].id = parseInt(temp[0]);
  18647. myCfg[temp[0]].weight = parseInt(temp[1]);
  18648. }
  18649. let aiCfg = xGame.common.initWeight(myCfg);
  18650. let curData = xGame.common.getRandomWeightData(aiCfg);
  18651. return parseInt(curData.id);
  18652. }
  18653. getAISkillData(index) {
  18654. let myLevel = this.skillSelectData[index].skillLevel;
  18655. let aiLevel = this.getAISkillLevel(myLevel);
  18656. let aiType = this.getAISkillType() - 1;
  18657. return { aiLevel, aiType } = { aiLevel, aiType };
  18658. }
  18659. skillSelectFinish(index) {
  18660. let aiInfo = this.getAISkillData(index);
  18661. xGame.common.gameMgr.selfCurSkill = index;
  18662. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  18663. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  18664. this.ui.selfHead.c1.selectedIndex = 1;
  18665. this.ui.aiHead.c1.selectedIndex = 1;
  18666. let myData = this.skillSelectData[index];
  18667. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  18668. let guide = DataMgr.getSkillGuide();
  18669. if (guide == 0) {
  18670. this.ui.selfHead.skillTxt.text = myData.skillName + " 满级";
  18671. }
  18672. else {
  18673. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  18674. }
  18675. let aiData = this.skillSelectData[aiInfo.aiType];
  18676. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  18677. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  18678. this.waitingPeople();
  18679. }
  18680. waitingPeople() {
  18681. let time = xGame.common.randomNum(1000, 3000);
  18682. time += 1000;
  18683. Laya.timer.once(time, this, () => {
  18684. this.matchingSuccess();
  18685. });
  18686. }
  18687. matchingSuccess() {
  18688. let gameUI = xGame.common.gameUI;
  18689. let name = gameUI.ui.topNode.aiNameTxt.text;
  18690. let url = gameUI.ui.topNode.aiHeadLoader.url;
  18691. this.ui.aiHead.nameTxt.text = name;
  18692. this.ui.aiHead.headImg.url = url;
  18693. name = gameUI.ui.topNode.selfNameTxt.text;
  18694. url = gameUI.ui.topNode.selfHeadLoader.url;
  18695. this.ui.selfHead.nameTxt.text = name;
  18696. this.ui.selfHead.headImg.url = url;
  18697. this.ui.t3.play(Laya.Handler.create(this, () => {
  18698. this.callback && this.callback();
  18699. this.ui.t4.play(Laya.Handler.create(this, () => {
  18700. this.destroySelf();
  18701. }));
  18702. }));
  18703. }
  18704. destroySelf() {
  18705. this.callback = null;
  18706. this.skillSelectData = null;
  18707. this.selfPot = null;
  18708. this.aiPot = null;
  18709. if (!this.ui.isDisposed) {
  18710. this.ui.removeFromParent();
  18711. this.ui.dispose();
  18712. }
  18713. xGame.uiMgr.destroyUI(this);
  18714. }
  18715. }
  18716. UIMatching$1.uiName = "UIMatching";
  18717. class SkillDisplay$1 {
  18718. constructor(ui, data, uiIndex) {
  18719. this.starX = 0;
  18720. this.starY = 0;
  18721. this.index = 0;
  18722. this.ui = ui;
  18723. this.data = data;
  18724. this.index = uiIndex;
  18725. this.initSelf();
  18726. console.log('zh:SkillDisplay constructor this.skillData=', data);
  18727. }
  18728. initSelf() {
  18729. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  18730. this.ui.nameTxt.text = this.data.name;
  18731. this.ui.describeTxt.text = this.data.describe;
  18732. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  18733. this.ui.startBtn.onClick(this, this.startGame);
  18734. this.updateSelf();
  18735. }
  18736. updateSelf() {
  18737. this.checkTry();
  18738. let level = DataMgr.getBigSkillByIndex(this.index);
  18739. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  18740. }
  18741. checkTry() {
  18742. let index = this.index;
  18743. let level = DataMgr.getBigSkillByIndex(index);
  18744. if (level == null) {
  18745. DataMgr.setBigSkill(index, 1, false);
  18746. level = 1;
  18747. }
  18748. this.ui.levelTxt.text = "LV." + level;
  18749. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  18750. this.ui.tryNode.visible = true;
  18751. else
  18752. this.ui.tryNode.visible = false;
  18753. }
  18754. clickAddLevel() {
  18755. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18756. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  18757. Moyu.showVideoAd(() => {
  18758. DataMgr.setBigSkill(this.data.index, 1);
  18759. this.updateSelf();
  18760. xGame.common.upSkillLevel = true;
  18761. }, EAdType.upSkill);
  18762. }
  18763. startGame() {
  18764. if (this.data.index == 3) {
  18765. alert('期待吧');
  18766. return;
  18767. }
  18768. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18769. let needCoin = xGame.common.bigMoveNeedCoin;
  18770. xGame.common.passAwardCoin = 2000;
  18771. let guide = DataMgr.getSkillGuide();
  18772. console.log('zh:startGame guide=' + guide);
  18773. xGame.common.temSelfLevel = 0;
  18774. if (guide == 0) {
  18775. needCoin = 0;
  18776. xGame.common.temSelfLevel = 100;
  18777. }
  18778. if (DataMgr.coinEnough(needCoin)) {
  18779. DataMgr.setCoin(-needCoin);
  18780. xGame.common.curPlayerSkillType = this.index;
  18781. if (guide == 0)
  18782. xGame.common.curPlayerSkillType = 0;
  18783. xGame.uiMgr.Show(UIGame$1);
  18784. xGame.uiMgr.Hide(UIMain$1);
  18785. xGame.uiMgr.Show(UIMatching$1, () => {
  18786. xGame.common.gameUI.ui.alpha = 1;
  18787. xGame.common.gameUI.startGame();
  18788. xGame.uiMgr.Hide(UISkill$1);
  18789. });
  18790. }
  18791. else {
  18792. xGame.uiMgr.Show(UIAddProp$1, 0);
  18793. Moyu.sendDataEvent("AddCoinVideo");
  18794. }
  18795. }
  18796. }
  18797. class UISkill$1 extends UIBase {
  18798. constructor() {
  18799. super();
  18800. this.skillData = [];
  18801. }
  18802. onConstructor() {
  18803. this.ui = ui_UISkill.createInstance();
  18804. this.contentPane = this.ui;
  18805. this.isEject = false;
  18806. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18807. this.initSkillData();
  18808. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  18809. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  18810. this.displayList = [];
  18811. this.ui.skillNode.skillList.numItems = 4;
  18812. this.addUIClick(this.ui, this.interuptSecretary);
  18813. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  18814. this.ui.talkNode.visible = false;
  18815. if (Moyu.isKs)
  18816. this.ui.closeNode.closeBtn.x += 100;
  18817. }
  18818. show() {
  18819. super.show();
  18820. this.playSecretaryIdle();
  18821. this.moneyNode.ui.c1.selectedIndex = 1;
  18822. Laya.timer.clearAll(this);
  18823. xGame.soundMgr.playSound("s_start");
  18824. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18825. let guide = DataMgr.getSkillGuide();
  18826. this.ui.guideNode.visible = guide == 0;
  18827. let item = this.getSkillItemByUIIndex(0);
  18828. if (guide == 0) {
  18829. item.ui.c1.selectedIndex = 1;
  18830. }
  18831. else {
  18832. item.ui.c1.selectedIndex = 0;
  18833. }
  18834. this.ui.guideNode.guideBtn.visible = guide == 0;
  18835. for (let index = 0; index < this.displayList.length; index++) {
  18836. this.displayList[index].checkTry();
  18837. }
  18838. }
  18839. getSkillItemByUIIndex(cur) {
  18840. for (let index = 0; index < this.displayList.length; index++) {
  18841. if (this.displayList[index].index == cur) {
  18842. return this.displayList[index];
  18843. }
  18844. }
  18845. }
  18846. enterGuideLevel() {
  18847. let item = this.getSkillItemByUIIndex(0);
  18848. item.startGame();
  18849. if (DataMgr.getNewUser())
  18850. Moyu.sendDataEvent("gameStart1");
  18851. }
  18852. initSkillData() {
  18853. this.skillData = [];
  18854. let nameList = xGame.common.skillNameList;
  18855. let iconList = xGame.common.skillIconList;
  18856. let describeList = [
  18857. "Jump shot executed — ball bounced and pocketed an extra one!",
  18858. "Bonus Sweep: A random follow-up strike hits 1 extra ball after your shot!",
  18859. "Freeze Effect: Your shot freezes 1 random ball — enemy can’t hit it, and others bounce off!"
  18860. ];
  18861. let data;
  18862. for (let index = 0; index < nameList.length; index++) {
  18863. data = {};
  18864. data.name = nameList[index];
  18865. data.icon = iconList[index];
  18866. data.describe = describeList[index];
  18867. data.index = index;
  18868. this.skillData.push(data);
  18869. }
  18870. }
  18871. updateSkillItem(index, target) {
  18872. if (this.displayList[index] == null) {
  18873. let uiIndex;
  18874. switch (index) {
  18875. case 0:
  18876. uiIndex = 1;
  18877. break;
  18878. case 1:
  18879. uiIndex = 0;
  18880. break;
  18881. case 2:
  18882. uiIndex = 2;
  18883. break;
  18884. case 3:
  18885. uiIndex = 3;
  18886. break;
  18887. default:
  18888. break;
  18889. }
  18890. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  18891. this.displayList.push(temp);
  18892. }
  18893. }
  18894. playSecretaryIdle() {
  18895. let parent = this.ui.secretary.displayObject;
  18896. parent.destroyChildren();
  18897. let xx = this.ui.secretary.width / 2;
  18898. let yy = this.ui.secretary.height;
  18899. let scale = xGame.common.getSecretaryScale();
  18900. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18901. xGame.common.secretary.play(data, 1, true, parent);
  18902. }
  18903. returnUIMain() {
  18904. this.hide();
  18905. xGame.common.stopGirlPop(this.ui.talkNode);
  18906. xGame.uiMgr.Show(UIMain$1);
  18907. }
  18908. interuptSecretary() {
  18909. Laya.timer.clearAll(this);
  18910. this.playSecretaryRandomSound();
  18911. }
  18912. playSecretaryRandomSound() {
  18913. if (this.isHide)
  18914. return;
  18915. let time = xGame.common.randomNum(45000, 60000);
  18916. Laya.timer.once(time, this, () => {
  18917. if (this.isHide)
  18918. return;
  18919. let index = xGame.common.randomNum(4, 7);
  18920. xGame.soundMgr.playSound("s_main0" + index);
  18921. let words = 1;
  18922. switch (index) {
  18923. case 4:
  18924. words = 5;
  18925. break;
  18926. case 5:
  18927. words = 3;
  18928. break;
  18929. case 6:
  18930. words = 6;
  18931. break;
  18932. case 7:
  18933. words = 7;
  18934. break;
  18935. default:
  18936. break;
  18937. }
  18938. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18939. this.playSecretaryRandomSound();
  18940. });
  18941. }
  18942. }
  18943. UISkill$1.uiName = "UISkill";
  18944. class UIAddProp$1 extends UIBase {
  18945. constructor() {
  18946. super();
  18947. this.curType = "";
  18948. }
  18949. onConstructor() {
  18950. this.ui = ui_UIAddProp.createInstance();
  18951. this.contentPane = this.ui;
  18952. this.isEject = false;
  18953. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  18954. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  18955. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  18956. this.updateUI();
  18957. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  18958. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  18959. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  18960. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  18961. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  18962. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  18963. }
  18964. show(type) {
  18965. super.show();
  18966. this.curType = type == 0 ? "coin" : "diamond";
  18967. this.switchBtn("");
  18968. this.ui.t0.play();
  18969. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  18970. PlatMgr.showInsert(true);
  18971. }
  18972. closeSelf() {
  18973. this.hide();
  18974. }
  18975. updateUI() {
  18976. let data = cfgTable.moneyData;
  18977. let temp;
  18978. let obj;
  18979. for (const key in data) {
  18980. temp = data[key];
  18981. obj = this.ui.myNode["node" + key];
  18982. if (parseInt(key) <= 2) {
  18983. obj.diamondTxt.text = "+" + temp.num;
  18984. }
  18985. else {
  18986. obj.coinTxt.text = temp.num;
  18987. obj.diamondTxt.text = temp.get.split('_')[1];
  18988. }
  18989. }
  18990. this.updateDiamondShare();
  18991. }
  18992. updateDiamondShare() {
  18993. let data = DataMgr.getShareDiamondTimes();
  18994. if (data >= xGame.common.maxShareDiamondTimes) {
  18995. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  18996. this.ui.myNode.node1.touchable = false;
  18997. }
  18998. else {
  18999. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  19000. this.ui.myNode.node1.touchable = true;
  19001. }
  19002. }
  19003. switchBtn(type) {
  19004. if (type == "")
  19005. type = this.curType;
  19006. else {
  19007. if (this.curType == type) {
  19008. return;
  19009. }
  19010. else {
  19011. this.curType = type;
  19012. }
  19013. }
  19014. if (type == "coin") {
  19015. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  19016. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  19017. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  19018. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  19019. this.ui.myNode.c1.selectedIndex = 0;
  19020. }
  19021. else {
  19022. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  19023. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  19024. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  19025. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  19026. this.ui.myNode.c1.selectedIndex = 1;
  19027. }
  19028. }
  19029. convertCoin(index) {
  19030. let data = cfgTable.moneyData[index];
  19031. let coinNum = data.num;
  19032. let str = data.get.split('_')[1];
  19033. let needDiamond = parseInt(str);
  19034. if (DataMgr.diamondEnough(needDiamond)) {
  19035. DataMgr.setDiamond(-needDiamond);
  19036. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  19037. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  19038. }
  19039. else {
  19040. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  19041. this.switchBtn("diamond");
  19042. }
  19043. }
  19044. videoGetDiamond() {
  19045. let num = cfgTable.moneyData[2].num;
  19046. Moyu.showVideoAd(() => {
  19047. xGame.common.playObjFlyAnim(num, Prop.diamond);
  19048. this.closeSelf();
  19049. }, EAdType.addDiamond);
  19050. }
  19051. videoGetCoin() {
  19052. Moyu.showVideoAd(() => {
  19053. xGame.common.playObjFlyAnim(2000, Prop.coin);
  19054. this.closeSelf();
  19055. }, EAdType.addCoin);
  19056. }
  19057. shareGetDiamond() {
  19058. let times = DataMgr.getShareDiamondTimes();
  19059. if (times >= xGame.common.maxShareDiamondTimes) {
  19060. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  19061. }
  19062. else {
  19063. if (Moyu.isTT) {
  19064. let num = cfgTable.moneyData[1].num;
  19065. Moyu.shareVideo = '';
  19066. Moyu.shareGame((success) => {
  19067. if (success) {
  19068. xGame.uiMgr.Show(UIMsg$1, "分享成功!");
  19069. xGame.common.playObjFlyAnim(num, Prop.diamond);
  19070. DataMgr.setShareDiamondTimes(1);
  19071. this.updateDiamondShare();
  19072. }
  19073. else {
  19074. xGame.uiMgr.Show(UIMsg$1, "分享失败!");
  19075. }
  19076. });
  19077. }
  19078. else {
  19079. Moyu.showVideoAd(() => {
  19080. let diamond = xGame.common.randomNum(50, 100);
  19081. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  19082. DataMgr.setShareDiamondTimes(1);
  19083. this.updateDiamondShare();
  19084. }, EAdType.randomDiamond);
  19085. }
  19086. }
  19087. }
  19088. openPutBallView() {
  19089. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  19090. let skill = xGame.uiMgr.getUI(UISkill$1);
  19091. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  19092. let uigame = xGame.uiMgr.getUI(UIGame$1);
  19093. if (end && !end.isHide) {
  19094. xGame.uiMgr.Hide(UIGameEnd$1);
  19095. xGame.uiMgr.Show(UIMain$1);
  19096. }
  19097. if (skill && !skill.isHide)
  19098. xGame.uiMgr.Hide(UISkill$1);
  19099. if (uigame && !uigame.isHide)
  19100. xGame.uiMgr.Hide(UIGame$1);
  19101. if (level && !level.isHide) {
  19102. }
  19103. else {
  19104. xGame.uiMgr.Show(UILevelDisplay$1);
  19105. }
  19106. this.closeSelf();
  19107. }
  19108. }
  19109. UIAddProp$1.uiName = "UIAddProp";
  19110. class MoneyNode$1 {
  19111. constructor(ui) {
  19112. this.leftTime = 0;
  19113. this.ui = ui;
  19114. this.ui.addCoinBtn.onClick(this, this.addCoin);
  19115. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  19116. this.ui.addPowerBtn.onClick(this, this.addPower);
  19117. this.ui.c1.selectedIndex = 1;
  19118. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  19119. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  19120. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  19121. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  19122. this.coinChange();
  19123. this.diamondChange();
  19124. this.powerChange();
  19125. }
  19126. addPower() {
  19127. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19128. xGame.uiMgr.Show(UIPower$1);
  19129. }
  19130. powerChange() {
  19131. let powerNum = DataMgr.getPower();
  19132. this.ui.powerTxt.text = powerNum + "";
  19133. }
  19134. checkPowerTime() {
  19135. let cur = new Date().getTime();
  19136. let last = DataMgr.getPowerTime();
  19137. if (last == 0) {
  19138. last = cur;
  19139. DataMgr.setPowerTime(cur);
  19140. }
  19141. let power = DataMgr.getPower();
  19142. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  19143. Laya.timer.clearAll(this);
  19144. if (power >= xGame.common.natureMaxPower) {
  19145. this.ui.powerTimeTxt.text = "";
  19146. DataMgr.setPowerTime(cur);
  19147. return;
  19148. }
  19149. if (power + offset >= xGame.common.natureMaxPower) {
  19150. DataMgr.setPower(xGame.common.natureMaxPower, false);
  19151. this.ui.powerTimeTxt.text = "";
  19152. DataMgr.setPowerTime(cur);
  19153. }
  19154. else {
  19155. if (offset > 0) {
  19156. DataMgr.setPower(offset);
  19157. DataMgr.setPowerTime(cur);
  19158. }
  19159. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  19160. this.leftTime = xGame.common.powerRecoverNum - time;
  19161. if (this.leftTime <= 0)
  19162. this.leftTime = 0;
  19163. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  19164. Laya.timer.loop(1000, this, this.updatePowerTime);
  19165. }
  19166. }
  19167. updatePowerTime() {
  19168. this.leftTime -= 1;
  19169. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  19170. if (this.leftTime <= 0) {
  19171. this.checkPowerTime();
  19172. }
  19173. }
  19174. coinChange() {
  19175. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  19176. }
  19177. diamondChange() {
  19178. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  19179. }
  19180. addCoin() {
  19181. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19182. Moyu.sendDataEvent("AddCoinBtn");
  19183. xGame.uiMgr.Show(UIAddProp$1, 0);
  19184. }
  19185. addDiamond() {
  19186. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19187. Moyu.sendDataEvent("AddDiamondBtn");
  19188. xGame.uiMgr.Show(UIAddProp$1, 1);
  19189. }
  19190. }
  19191. class SettingNode$1 {
  19192. constructor(ui) {
  19193. this.showSetting = false;
  19194. this.openSound = true;
  19195. this.openShake = true;
  19196. this.ui = ui;
  19197. this.ui.soundBtn.onClick(this, this.switchSound);
  19198. this.ui.shakeBtn.onClick(this, this.switchShake);
  19199. this.ui.xyBtn.onClick(this, this.onXy);
  19200. this.ui.clickNode.onClick(this, this.changeSetting);
  19201. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  19202. }
  19203. changeSetting() {
  19204. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19205. this.showSetting = !this.showSetting;
  19206. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  19207. }
  19208. switchSound() {
  19209. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19210. this.openSound = !this.openSound;
  19211. Moyu.onSetting(this.openSound, this.openShake);
  19212. xGame.soundMgr.onSetting(this.openSound);
  19213. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  19214. }
  19215. switchShake() {
  19216. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19217. this.openShake = !this.openShake;
  19218. Moyu.onSetting(this.openSound, this.openShake);
  19219. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  19220. }
  19221. onXy() {
  19222. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19223. MoyuMgr$1.showXy(1);
  19224. }
  19225. }
  19226. class UIDraw$1 extends UIBase {
  19227. constructor() {
  19228. super();
  19229. this.curKey = 0;
  19230. }
  19231. onConstructor() {
  19232. this.ui = ui_UIDraw.createInstance();
  19233. this.contentPane = this.ui;
  19234. this.isEject = false;
  19235. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19236. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  19237. this.addUIClick(this.ui.drawBtn, this.startDraw);
  19238. this.initDraw();
  19239. this.initUI();
  19240. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  19241. if (Moyu.isKs)
  19242. this.ui.closeNode.closeBtn.x += 100;
  19243. }
  19244. show() {
  19245. super.show();
  19246. this.ui.t0.play();
  19247. this.playSecretaryIdle();
  19248. this.updateDraw();
  19249. this.checkFree();
  19250. if (PlatMgr.bannerDelay > 0) {
  19251. this.ui.closeNode.closeBtn.visible = false;
  19252. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  19253. this.ui.closeNode.closeBtn.visible = true;
  19254. });
  19255. }
  19256. PlatMgr.showRateBanner();
  19257. }
  19258. hide() {
  19259. Laya.timer.clearAll(this);
  19260. super.hide();
  19261. }
  19262. checkFree() {
  19263. let isFree = DataMgr.getDailyfreeDrawTimes();
  19264. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  19265. }
  19266. initDraw() {
  19267. this.drawObj = [];
  19268. let data = cfgTable.drawData;
  19269. let temp;
  19270. let weight = 0;
  19271. for (const key in data) {
  19272. temp = data[key];
  19273. weight += temp.weight;
  19274. this.drawObj.push(weight);
  19275. }
  19276. this.allWeight = weight;
  19277. }
  19278. initUI() {
  19279. let data = cfgTable.drawData;
  19280. let temp;
  19281. let img;
  19282. let txt;
  19283. for (const key in data) {
  19284. temp = data[key];
  19285. img = this.ui.myNode.rotNode["img" + key];
  19286. txt = this.ui.myNode.rotNode["txt" + key];
  19287. img.url = xGame.common.getGameIconUrl(temp.icon);
  19288. txt.visible = true;
  19289. if (temp.award > 2) {
  19290. img.rotation = 0;
  19291. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  19292. }
  19293. else {
  19294. img.rotation = temp.rotation;
  19295. txt.text = temp.num;
  19296. }
  19297. }
  19298. }
  19299. getCurkey() {
  19300. let rand = Math.random() * this.allWeight;
  19301. let temp;
  19302. for (let index = 0; index < this.drawObj.length - 1; index++) {
  19303. temp = this.drawObj[index];
  19304. if (index == 0) {
  19305. if (rand < temp) {
  19306. return index + 1;
  19307. }
  19308. }
  19309. else {
  19310. if (rand >= temp && rand < this.drawObj[index + 1]) {
  19311. return index + 1;
  19312. }
  19313. }
  19314. }
  19315. return 2;
  19316. }
  19317. startDraw() {
  19318. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  19319. if (freeTimes > 0) {
  19320. this.beginDraw();
  19321. DataMgr.setDailyfreeDrawTimes(0);
  19322. this.checkFree();
  19323. }
  19324. else {
  19325. Moyu.sendDataEvent("turntable");
  19326. Moyu.showVideoAd(() => {
  19327. this.beginDraw();
  19328. }, EAdType.draw);
  19329. }
  19330. }
  19331. beginDraw() {
  19332. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  19333. this.ui.drawBtn.touchable = false;
  19334. this.curKey = this.getCurkey();
  19335. console.log("当前key", this.curKey);
  19336. let cell = 60;
  19337. let lap = 3;
  19338. let angle = cell * (this.curKey - 1) + lap * 360;
  19339. let target = this.ui.myNode.rotNode;
  19340. target.rotation = 0;
  19341. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  19342. console.log("旋转完成");
  19343. this.ui.drawBtn.touchable = true;
  19344. this.getAward();
  19345. }));
  19346. }
  19347. getAward() {
  19348. let data = cfgTable.drawData[this.curKey];
  19349. let temp = new AwardType();
  19350. temp.type = data.award;
  19351. temp.num = data.num;
  19352. xGame.common.getAward([temp], () => {
  19353. DataMgr.setDrawTimes(1);
  19354. this.updateDraw();
  19355. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  19356. });
  19357. }
  19358. updateDraw() {
  19359. let drawTimes = DataMgr.getDrawTimes();
  19360. let awardTimes = DataMgr.getDrawAwardTimes();
  19361. if (Math.floor(drawTimes / 3) > awardTimes) {
  19362. this.ui.extraNode.boxBtn.t0.play(null, -1);
  19363. this.ui.extraNode.boxBtn.touchable = true;
  19364. this.ui.extraNode.tipsTxt.text = "3/3";
  19365. this.ui.extraNode.barNode.width = 265;
  19366. this.getExtraAward();
  19367. }
  19368. else {
  19369. this.ui.extraNode.boxBtn.t0.stop();
  19370. this.ui.extraNode.boxBtn.touchable = false;
  19371. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  19372. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  19373. }
  19374. let data = cfgTable.drawData[1];
  19375. if (awardTimes == 0) {
  19376. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  19377. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  19378. this.ui.myNode.rotNode.img1.rotation = 0;
  19379. }
  19380. else {
  19381. let award = data.nextid;
  19382. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  19383. this.ui.myNode.rotNode.txt1.text = award[1];
  19384. this.ui.myNode.rotNode.img1.rotation = 0;
  19385. }
  19386. }
  19387. getExtraAward() {
  19388. let drawTimes = DataMgr.getDrawTimes();
  19389. let awardTimes = DataMgr.getDrawAwardTimes();
  19390. let data = cfgTable.drawData[1];
  19391. let award = new AwardType();
  19392. if (awardTimes == 0) {
  19393. award.num = data.num;
  19394. award.type = data.award;
  19395. xGame.common.getAward([award], () => {
  19396. let all = Math.floor(drawTimes / 3);
  19397. DataMgr.setDrawAwardTimes(all);
  19398. this.updateDraw();
  19399. });
  19400. }
  19401. else {
  19402. award.num = parseInt(data.nextid[1]);
  19403. award.type = parseInt(data.nextid[0]);
  19404. xGame.common.getAward([award], () => {
  19405. let all = Math.floor(drawTimes / 3);
  19406. DataMgr.setDrawAwardTimes(all);
  19407. this.updateDraw();
  19408. });
  19409. }
  19410. }
  19411. closeSelf() {
  19412. this.hide();
  19413. }
  19414. playSecretaryIdle() {
  19415. let parent = this.ui.secretary.displayObject;
  19416. parent.destroyChildren();
  19417. let xx = this.ui.secretary.width / 2;
  19418. let yy = this.ui.secretary.height;
  19419. let scale = xGame.common.getSecretaryScale();
  19420. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19421. xGame.common.secretary.play(data, 1, true, parent);
  19422. }
  19423. }
  19424. UIDraw$1.uiName = "UIDraw";
  19425. class UIRanking$1 extends UIBase {
  19426. constructor() {
  19427. super();
  19428. this.showSelf = true;
  19429. this.rankType = 1;
  19430. this.rankList = [];
  19431. this.myIndex = 0;
  19432. this.myStar = 0;
  19433. }
  19434. onConstructor() {
  19435. this.ui = ui_UIRanking.createInstance();
  19436. this.contentPane = this.ui;
  19437. this.isEject = false;
  19438. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  19439. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  19440. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  19441. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  19442. this.ui.myNode.myList.setVirtual();
  19443. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  19444. }
  19445. show() {
  19446. super.show();
  19447. this.myIndex = 51;
  19448. Moyu.getRankList({
  19449. rankId: xGame.common.curRankID,
  19450. type: MoyuRankType.total,
  19451. page: 1,
  19452. pageSize: 50,
  19453. }, this, this.updateItemData);
  19454. this.updateSelf();
  19455. let self = Moyu.getUserInfo();
  19456. if (!self.isAuth) {
  19457. Moyu.initUser(this, () => {
  19458. DataMgr.upRankData();
  19459. });
  19460. }
  19461. }
  19462. updateSelfItem() {
  19463. let self = Moyu.getUserInfo();
  19464. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  19465. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > 50 ? "未上榜" : this.myIndex.toString();
  19466. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  19467. this.ui.myNode.selfNode.nameTxt.text = Moyu.platType < 11 ? self.nickName : "myself";
  19468. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  19469. }
  19470. updateItemData(data) {
  19471. this.myStar = xGame.common.getAllStarNum();
  19472. if (this.rankList.length < 2) {
  19473. this.rankList = data;
  19474. let self = Moyu.getUserInfo();
  19475. for (let i = 0; i < data.length; i++) {
  19476. let data = this.rankList[i];
  19477. if (data.userId == self.userId) {
  19478. this.rankList.splice(i, 1);
  19479. break;
  19480. }
  19481. }
  19482. for (let i = 0; i < data.length; i++) {
  19483. let data = this.rankList[i];
  19484. if (data.rankScore < this.myStar && this.myIndex > 50) {
  19485. this.myIndex = i + 1;
  19486. let user = { headIcon: self.headIcon, nickName: "myself" };
  19487. let ud = { user: user, data: {} };
  19488. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  19489. if (Moyu.platType < 11) {
  19490. user.headIcon = self.headIcon;
  19491. user.nickName = self.nickName;
  19492. }
  19493. this.rankList.splice(i, 0, md);
  19494. break;
  19495. }
  19496. }
  19497. }
  19498. this.updateSelfItem();
  19499. this.ui.myNode.myList.numItems = this.rankList.length;
  19500. }
  19501. updateItemUI(index, obj) {
  19502. let data = this.rankList[index];
  19503. let userData = JSON.parse(data.userData).user;
  19504. obj.nameTxt.text = userData.nickName.toString();
  19505. obj.valueTxt.text = data.rankScore;
  19506. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  19507. obj.rankTxt.text = index + 1;
  19508. switch (index) {
  19509. case 0:
  19510. this.setImg(obj, 1, 0, 0);
  19511. obj.rankTxt.color = "#FFC047";
  19512. break;
  19513. case 1:
  19514. this.setImg(obj, 0, 1, 0);
  19515. obj.rankTxt.color = "#ACACAC";
  19516. break;
  19517. case 2:
  19518. this.setImg(obj, 0, 0, 1);
  19519. obj.rankTxt.color = "#D09672";
  19520. break;
  19521. default:
  19522. this.setImg(obj, 0, 0, 0);
  19523. obj.rankTxt.color = "#496FAB";
  19524. break;
  19525. }
  19526. }
  19527. setImg(obj, a, b, c) {
  19528. obj.img1.visible = a ? true : false;
  19529. obj.img2.visible = b ? true : false;
  19530. obj.img3.visible = c ? true : false;
  19531. }
  19532. changeList(type) {
  19533. this.rankType = type;
  19534. this.updateSelf();
  19535. }
  19536. changeSelfNode() {
  19537. this.showSelf = !this.showSelf;
  19538. this.updateSelf();
  19539. }
  19540. updateSelf() {
  19541. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  19542. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  19543. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  19544. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  19545. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  19546. }
  19547. }
  19548. UIRanking$1.uiName = "UIRanking";
  19549. class UISecretary$1 extends UIBase {
  19550. constructor() {
  19551. super();
  19552. this.curIndex = 1;
  19553. }
  19554. onConstructor() {
  19555. this.ui = ui_UISecretary.createInstance();
  19556. this.contentPane = this.ui;
  19557. this.isEject = false;
  19558. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  19559. this.addUIClick(this.ui.leftBtn, this.turnLeft);
  19560. this.addUIClick(this.ui.rightBtn, this.turnRight);
  19561. this.nodeObj = { left: null, right: null, cur: null };
  19562. this.nodeObj.left = this.ui.myNode.gameNode1;
  19563. this.nodeObj.right = this.ui.myNode.gameNode2;
  19564. this.nodeObj.cur = this.ui.myNode.gameNode3;
  19565. }
  19566. show() {
  19567. super.show();
  19568. this.ui.t0.play();
  19569. this.updateData();
  19570. }
  19571. addSecretarySpine(node, spineName) {
  19572. if (spineName == "mishu") {
  19573. if (this.secretarySpine1) {
  19574. node.displayObject.destroyChildren();
  19575. this.playWoman(this.secretarySpine1, node.displayObject);
  19576. }
  19577. else {
  19578. let spine1 = new SpineMgr("mishu", () => {
  19579. this.secretarySpine1 = spine1;
  19580. this.playWoman(this.secretarySpine1, node.displayObject);
  19581. });
  19582. }
  19583. }
  19584. else {
  19585. if (this.secretarySpine2) {
  19586. node.displayObject.destroyChildren();
  19587. this.playWoman(this.secretarySpine2, node.displayObject);
  19588. }
  19589. else {
  19590. let spine2 = new SpineMgr("xiaomishu2", () => {
  19591. this.secretarySpine2 = spine2;
  19592. this.playWoman(this.secretarySpine2, node.displayObject);
  19593. });
  19594. }
  19595. }
  19596. }
  19597. playWoman(node, parent) {
  19598. let xx = this.ui.myNode.gameNode1.secretary.width / 2;
  19599. let yy = this.ui.myNode.gameNode1.secretary.height;
  19600. let scale = 1.5;
  19601. if (node == this.secretarySpine2) {
  19602. scale = 1.2;
  19603. }
  19604. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19605. node.play(data, 1, true, parent);
  19606. }
  19607. turnLeft() {
  19608. this.curIndex--;
  19609. if (this.curIndex < 1) {
  19610. this.curIndex = 2;
  19611. }
  19612. let left = this.nodeObj.left;
  19613. let right = this.nodeObj.right;
  19614. let cur = this.nodeObj.cur;
  19615. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  19616. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  19617. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  19618. this.updateData();
  19619. }));
  19620. this.ui.myNode.setChildIndex(right, 2);
  19621. this.nodeObj.left = cur;
  19622. this.nodeObj.right = left;
  19623. this.nodeObj.cur = right;
  19624. }
  19625. turnRight() {
  19626. this.curIndex++;
  19627. if (this.curIndex > 2) {
  19628. this.curIndex = 1;
  19629. }
  19630. let left = this.nodeObj.left;
  19631. let right = this.nodeObj.right;
  19632. let cur = this.nodeObj.cur;
  19633. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  19634. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  19635. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  19636. this.updateData();
  19637. }));
  19638. this.ui.myNode.setChildIndex(left, 2);
  19639. this.nodeObj.left = right;
  19640. this.nodeObj.right = cur;
  19641. this.nodeObj.cur = left;
  19642. }
  19643. updateData() {
  19644. let data = cfgTable.secretaryshopData;
  19645. let children = this.ui.myNode._children;
  19646. let temp;
  19647. let curData;
  19648. for (let index = 0; index < children.length; index++) {
  19649. temp = children[index];
  19650. if (index == 2) {
  19651. curData = data[this.curIndex];
  19652. temp.purchaseBtn.touchable = true;
  19653. }
  19654. else {
  19655. temp.purchaseBtn.touchable = false;
  19656. if (this.curIndex == 1) {
  19657. curData = data[2];
  19658. }
  19659. else {
  19660. curData = data[1];
  19661. }
  19662. }
  19663. temp.heightTxt.text = curData.height;
  19664. temp.foodTxt.text = curData.food;
  19665. temp.historyTxt.text = curData.history;
  19666. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  19667. this.addSecretarySpine(temp.secretary, curData.spine);
  19668. let womanIndex = curData.id - 1;
  19669. let getWoman = DataMgr.getSecretary(womanIndex);
  19670. let curUse = DataMgr.getCurSecretary();
  19671. if (getWoman) {
  19672. if (curUse == womanIndex) {
  19673. temp.purchaseBtn.c1.selectedIndex = 1;
  19674. }
  19675. else {
  19676. temp.purchaseBtn.c1.selectedIndex = 2;
  19677. }
  19678. }
  19679. else {
  19680. temp.purchaseBtn.c1.selectedIndex = 0;
  19681. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  19682. }
  19683. temp.purchaseBtn.offClick(this, this.clickSecretary);
  19684. temp.purchaseBtn.onClick(this, this.clickSecretary, [getWoman, curUse, womanIndex, curData.price]);
  19685. }
  19686. }
  19687. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  19688. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19689. if (getWoman) {
  19690. if (curUse != womanIndex) {
  19691. console.log();
  19692. DataMgr.setCurSecretary(womanIndex);
  19693. this.updateData();
  19694. }
  19695. }
  19696. else {
  19697. let need = needDiamond;
  19698. if (DataMgr.diamondEnough(need)) {
  19699. DataMgr.setDiamond(-need);
  19700. DataMgr.setSecretary(womanIndex, 1);
  19701. DataMgr.setCurSecretary(womanIndex);
  19702. this.updateData();
  19703. }
  19704. else {
  19705. xGame.uiMgr.Show(UIAddProp$1, 1);
  19706. }
  19707. }
  19708. }
  19709. closeSelf() {
  19710. this.hide();
  19711. }
  19712. }
  19713. UISecretary$1.uiName = "UISecretary";
  19714. class BallRodDisplay$1 {
  19715. constructor(ui, index) {
  19716. this.index = 0;
  19717. this.uiIndex = 0;
  19718. this.ui = ui;
  19719. this.index = index;
  19720. this.initData();
  19721. }
  19722. initData() {
  19723. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  19724. let data = cfgTable.ballrodData[this.index + 1];
  19725. this.ui.nameTxt.text = data.name;
  19726. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  19727. this.ui.levelNode.c1.selectedIndex = data.quality;
  19728. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  19729. if (data.spine) {
  19730. this.mySpine = new SpineMgr(data.spine, () => {
  19731. let xx = 150;
  19732. let yy = 70;
  19733. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  19734. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  19735. });
  19736. }
  19737. }
  19738. updateSelf() {
  19739. let get = DataMgr.getBallRod(this.index);
  19740. if (get == null)
  19741. get = 1;
  19742. let curUse = DataMgr.getCurBallRod();
  19743. if (get) {
  19744. if (curUse == this.index) {
  19745. this.ui.purchaseBtn.c1.selectedIndex = 0;
  19746. }
  19747. else {
  19748. this.ui.purchaseBtn.c1.selectedIndex = 1;
  19749. }
  19750. }
  19751. else {
  19752. this.ui.purchaseBtn.c1.selectedIndex = 2;
  19753. }
  19754. }
  19755. buyBallRod() {
  19756. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19757. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  19758. switch (selectedIndex) {
  19759. case 0:
  19760. break;
  19761. case 1:
  19762. DataMgr.setCurBallRod(this.index);
  19763. let ui = xGame.uiMgr.getUI(UIShop$1);
  19764. ui.updateBallRod();
  19765. break;
  19766. case 2:
  19767. let data = cfgTable.ballrodData[this.index + 1];
  19768. let need = data.price;
  19769. if (DataMgr.diamondEnough(need)) {
  19770. DataMgr.setDiamond(-need);
  19771. DataMgr.setBallRod(this.index, 1);
  19772. DataMgr.setCurBallRod(this.index);
  19773. let ui = xGame.uiMgr.getUI(UIShop$1);
  19774. ui.updateBallRod();
  19775. }
  19776. else {
  19777. xGame.uiMgr.Show(UIAddProp$1, 1);
  19778. }
  19779. break;
  19780. default:
  19781. break;
  19782. }
  19783. }
  19784. }
  19785. class UIShop$1 extends UIBase {
  19786. constructor() {
  19787. super();
  19788. this.itemNums = 0;
  19789. }
  19790. onConstructor() {
  19791. this.ui = ui_UIShop.createInstance();
  19792. this.contentPane = this.ui;
  19793. this.isEject = false;
  19794. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19795. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  19796. this.addUIClick(this.ui, this.interuptSecretary);
  19797. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  19798. this.ballRodArr = [];
  19799. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  19800. this.ui.myNode.myList.numItems = this.itemNums;
  19801. if (Moyu.isKs)
  19802. this.ui.closeNode.closeBtn.x += 100;
  19803. }
  19804. show() {
  19805. super.show();
  19806. this.playSecretaryIdle();
  19807. this.updateBallRod();
  19808. }
  19809. updateBallRod() {
  19810. for (let index = 0; index < this.ballRodArr.length; index++) {
  19811. this.ballRodArr[index].updateSelf();
  19812. }
  19813. }
  19814. renderBallRod(sort, obj) {
  19815. let index = this.getIndexBySort(sort + 1) - 1;
  19816. let ballRod = new BallRodDisplay$1(obj, index);
  19817. this.ballRodArr.push(ballRod);
  19818. }
  19819. getIndexBySort(sort) {
  19820. let object = cfgTable.ballrodData;
  19821. for (const key in object) {
  19822. if (object[key].sort == sort) {
  19823. return parseInt(key);
  19824. }
  19825. }
  19826. }
  19827. playSecretaryIdle() {
  19828. let parent = this.ui.secretary.displayObject;
  19829. parent.destroyChildren();
  19830. let xx = this.ui.secretary.width / 2;
  19831. let yy = this.ui.secretary.height;
  19832. let scale = xGame.common.getSecretaryScale();
  19833. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19834. xGame.common.secretary.play(data, 1, true, parent);
  19835. }
  19836. interuptSecretary() {
  19837. Laya.timer.clearAll(this);
  19838. this.playSecretaryRandomSound();
  19839. }
  19840. playSecretaryRandomSound() {
  19841. if (this.isHide)
  19842. return;
  19843. let time = xGame.common.randomNum(45000, 60000);
  19844. Laya.timer.once(time, this, () => {
  19845. if (this.isHide)
  19846. return;
  19847. let index = xGame.common.randomNum(4, 7);
  19848. xGame.soundMgr.playSound("s_main0" + index);
  19849. let words = 1;
  19850. switch (index) {
  19851. case 4:
  19852. words = 5;
  19853. break;
  19854. case 5:
  19855. words = 3;
  19856. break;
  19857. case 6:
  19858. words = 6;
  19859. break;
  19860. case 7:
  19861. words = 7;
  19862. break;
  19863. default:
  19864. break;
  19865. }
  19866. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19867. this.playSecretaryRandomSound();
  19868. });
  19869. }
  19870. closeSelf() {
  19871. this.hide();
  19872. }
  19873. }
  19874. UIShop$1.uiName = "UIShop";
  19875. class SignMax$1 {
  19876. constructor(ui) {
  19877. this.ui = ui;
  19878. }
  19879. updateSelf(index, sameDay, curDayIndex) {
  19880. let data = cfgTable.signData[index + 1];
  19881. this.ui.titleTxt.text = data.title;
  19882. let arr1 = data.award[0].split('-');
  19883. let arr2 = data.award[1].split('-');
  19884. let num1 = parseInt(arr1[1]);
  19885. let num2 = parseInt(arr2[1]);
  19886. this.ui.numTxt1.text = num1 + "";
  19887. this.ui.numTxt2.text = num2 + "";
  19888. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  19889. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  19890. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  19891. this.ui.numTxt1.visible = false;
  19892. }
  19893. else {
  19894. this.ui.numTxt1.visible = true;
  19895. }
  19896. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  19897. this.ui.numTxt2.visible = false;
  19898. }
  19899. else {
  19900. this.ui.numTxt2.visible = true;
  19901. }
  19902. if (index < curDayIndex) {
  19903. this.ui.c1.selectedIndex = 1;
  19904. }
  19905. else if (index == curDayIndex) {
  19906. if (sameDay) {
  19907. this.ui.c1.selectedIndex = 2;
  19908. }
  19909. else {
  19910. this.ui.c1.selectedIndex = 2;
  19911. }
  19912. }
  19913. else {
  19914. this.ui.c1.selectedIndex = 0;
  19915. }
  19916. }
  19917. }
  19918. class SignNormal$1 {
  19919. constructor(ui) {
  19920. this.ui = ui;
  19921. }
  19922. updateSelf(index, sameDay, curDayIndex) {
  19923. let data = cfgTable.signData[index + 1];
  19924. this.ui.titleTxt.text = data.title;
  19925. let arr = data.award[0].split('-');
  19926. let type = parseInt(arr[0]);
  19927. let num = parseInt(arr[1]);
  19928. this.ui.numTxt.text = num + "";
  19929. if (type > 2) {
  19930. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  19931. this.ui.myIcon.rotation = 0;
  19932. }
  19933. else {
  19934. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  19935. this.ui.myIcon.rotation = 0;
  19936. }
  19937. if (xGame.common.signAwardContainsRod(data.award)) {
  19938. this.ui.numTxt.visible = false;
  19939. }
  19940. else {
  19941. this.ui.numTxt.visible = true;
  19942. }
  19943. if (index < curDayIndex) {
  19944. this.ui.c1.selectedIndex = 1;
  19945. }
  19946. else if (index == curDayIndex) {
  19947. if (sameDay) {
  19948. this.ui.c1.selectedIndex = 2;
  19949. }
  19950. else {
  19951. this.ui.c1.selectedIndex = 2;
  19952. }
  19953. }
  19954. else {
  19955. this.ui.c1.selectedIndex = 0;
  19956. }
  19957. }
  19958. }
  19959. class UISign$1 extends UIBase {
  19960. constructor() {
  19961. super();
  19962. this.curDayIndex = 0;
  19963. this.starX = 0;
  19964. }
  19965. onConstructor() {
  19966. this.ui = ui_UISign.createInstance();
  19967. this.contentPane = this.ui;
  19968. this.isEject = false;
  19969. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19970. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  19971. this.initSignItem();
  19972. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  19973. this.addUIClick(this.ui.againBtn, this.againGetAward);
  19974. }
  19975. show() {
  19976. super.show();
  19977. this.ui.t0.play();
  19978. this.playSecretaryIdle();
  19979. this.updateSign();
  19980. }
  19981. initSignItem() {
  19982. this.signArr = [];
  19983. for (let index = 0; index < 6; index++) {
  19984. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  19985. this.signArr.push(temp);
  19986. }
  19987. this.signMax = new SignMax$1(this.ui.myNode.day7);
  19988. if (Moyu.isKs)
  19989. this.ui.closeNode.closeBtn.x += 100;
  19990. }
  19991. updateSign() {
  19992. let sameDay = xGame.common.judgeSameDay();
  19993. let max = 7;
  19994. this.curDayIndex = DataMgr.getSignData();
  19995. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  19996. this.curDayIndex = 0;
  19997. if (!sameDay) {
  19998. this.ui.normalBtn.visible = true;
  19999. this.ui.tipsNode.visible = false;
  20000. this.ui.againBtn.visible = false;
  20001. }
  20002. else {
  20003. this.ui.normalBtn.visible = false;
  20004. let again = DataMgr.getExtraSign();
  20005. let isCurrency = false;
  20006. let index = this.curDayIndex;
  20007. if (index == 0)
  20008. index = 7;
  20009. let award = cfgTable.signData[index].award;
  20010. let num = award[0].split("-")[0];
  20011. if (num == "1" || num == "2")
  20012. isCurrency = true;
  20013. let showAgain = again == 0 && isCurrency;
  20014. this.ui.againBtn.visible = showAgain;
  20015. this.ui.tipsNode.visible = !showAgain;
  20016. }
  20017. for (let index = 0; index < this.signArr.length; index++) {
  20018. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  20019. }
  20020. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  20021. }
  20022. playSecretaryIdle() {
  20023. let parent = this.ui.secretary.displayObject;
  20024. parent.destroyChildren();
  20025. let xx = this.ui.secretary.width / 2;
  20026. let yy = this.ui.secretary.height;
  20027. let scale = xGame.common.getSecretaryScale();
  20028. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20029. xGame.common.secretary.play(data, 1, true, parent);
  20030. }
  20031. closeSelf() {
  20032. this.hide();
  20033. }
  20034. normalGetAward() {
  20035. let sameDay = xGame.common.judgeSameDay();
  20036. if (!sameDay) {
  20037. let award = cfgTable.signData[this.curDayIndex + 1].award;
  20038. let temp;
  20039. let type;
  20040. let num;
  20041. let arr = [];
  20042. for (let index = 0; index < award.length; index++) {
  20043. temp = award[index].split("-");
  20044. type = parseInt(temp[0]);
  20045. num = parseInt(temp[1]);
  20046. let awardType = new AwardType();
  20047. awardType.num = num;
  20048. awardType.type = type;
  20049. arr.push(awardType);
  20050. }
  20051. xGame.common.getAward(arr, (watchVideo) => {
  20052. this.curDayIndex++;
  20053. if (this.curDayIndex > 7)
  20054. this.curDayIndex = 0;
  20055. DataMgr.setSignData(this.curDayIndex);
  20056. DataMgr.setSignTime(new Date().getTime());
  20057. if (watchVideo) {
  20058. DataMgr.setExtraSign(1);
  20059. Moyu.sendDataEvent("signIn1");
  20060. }
  20061. this.updateSign();
  20062. });
  20063. }
  20064. }
  20065. againGetAward() {
  20066. Moyu.sendDataEvent("signIn2");
  20067. Moyu.showVideoAd(() => {
  20068. let index = this.curDayIndex;
  20069. if (index == 0)
  20070. index = 7;
  20071. let award = cfgTable.signData[index].award;
  20072. let temp;
  20073. let type;
  20074. let num;
  20075. for (let index = 0; index < award.length; index++) {
  20076. temp = award[index].split("-");
  20077. type = parseInt(temp[0]);
  20078. num = parseInt(temp[1]) * 3;
  20079. xGame.common.playObjFlyAnim(num, type);
  20080. }
  20081. DataMgr.setExtraSign(1);
  20082. this.updateSign();
  20083. }, EAdType.againSign);
  20084. }
  20085. }
  20086. UISign$1.uiName = "UISign";
  20087. class UIModeSelection$1 extends UIBase {
  20088. constructor() {
  20089. super();
  20090. }
  20091. onConstructor() {
  20092. this.ui = ui_UIModeSelection.createInstance();
  20093. this.contentPane = this.ui;
  20094. this.isEject = false;
  20095. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  20096. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  20097. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  20098. this.addUIClick(this.ui.closeBtn, this.hide);
  20099. this.peopleArr = [650, 6900, 3800];
  20100. this.peopleOffest = [50, 500, 200];
  20101. this.updateSelf();
  20102. }
  20103. show(callback) {
  20104. super.show();
  20105. this.ui.t0.play();
  20106. this.callback = callback;
  20107. }
  20108. updateSelf() {
  20109. let cfg = cfgTable.modeselectData;
  20110. for (let index = 1; index <= 3; index++) {
  20111. let node = this.ui.myNode["type" + index];
  20112. node.need.text = cfg[index].need;
  20113. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  20114. node.peopleTxt.text = this.getRandPeople(index - 1);
  20115. }
  20116. }
  20117. enterGame(type) {
  20118. xGame.common.classicRoomType = type;
  20119. let cfg = cfgTable.modeselectData[type];
  20120. let need = cfg.need;
  20121. xGame.common.passAwardCoin = cfg.award;
  20122. if (DataMgr.coinEnough(need)) {
  20123. DataMgr.setCoin(-need);
  20124. this.ui.myNode["type" + type].t0.play();
  20125. Laya.timer.once(200, this, () => {
  20126. this.callback && this.callback();
  20127. });
  20128. }
  20129. else {
  20130. Moyu.sendDataEvent("AddCoinVideo");
  20131. xGame.uiMgr.Show(UIAddProp$1, 0);
  20132. }
  20133. }
  20134. getRandPeople(index) {
  20135. let rand = this.peopleOffest[index];
  20136. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  20137. }
  20138. }
  20139. UIModeSelection$1.uiName = "UIModeSelection";
  20140. class UIMain$1 extends UIBase {
  20141. constructor() {
  20142. super();
  20143. this.firstEnter = true;
  20144. }
  20145. onConstructor() {
  20146. this.ui = ui_UIMain.createInstance();
  20147. this.contentPane = this.ui;
  20148. this.isEject = false;
  20149. this.addEvent();
  20150. this.addClickSpine();
  20151. this.settingNode = new SettingNode$1(this.ui.settingNode);
  20152. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20153. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  20154. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  20155. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  20156. let curUse = DataMgr.getCurSecretary();
  20157. this.changeSecretary(curUse);
  20158. this.ui.talkNode.visible = false;
  20159. let guide = DataMgr.getSkillGuide();
  20160. if (xGame.common.isNewDay && guide == 1) {
  20161. xGame.common.isNewDay = false;
  20162. xGame.soundMgr.playSound("s_main01");
  20163. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20164. console.log("播放小秘书每天语音");
  20165. }
  20166. this.onGetUserInfo();
  20167. this.ui.n83.visible = false;
  20168. Moyu.setShareInfo("8Ball Fury", ["台球", "万宁", "桌球"], '2300002254');
  20169. }
  20170. changeSecretary(curUse) {
  20171. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  20172. xGame.common.secretary && xGame.common.secretary.dispose();
  20173. this.addSecretarySpine(name);
  20174. }
  20175. addSecretarySpine(name) {
  20176. let spine = new SpineMgr(name, () => {
  20177. this.playSecretaryIdle();
  20178. });
  20179. xGame.common.secretary = spine;
  20180. }
  20181. addClickSpine() {
  20182. let clickSpine = new SpineMgr("dianji", () => {
  20183. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  20184. let parent = Laya.stage;
  20185. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  20186. clickSpine.play(data, 0, false, parent, (spine) => {
  20187. spine.destroy(true);
  20188. });
  20189. });
  20190. });
  20191. }
  20192. addEvent() {
  20193. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  20194. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  20195. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  20196. this.addUIClick(this.ui.weeklyBtn, this.startWeekly);
  20197. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  20198. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  20199. this.addUIClick(this.ui, this.interuptSecretary);
  20200. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  20201. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  20202. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  20203. this.addUIClick(this.ui.shopBtn, this.openShopView);
  20204. this.addUIClick(this.ui.signBtn, this.openSignView);
  20205. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  20206. this.addUIClick(this.ui.rankBtn, this.openRanking);
  20207. }
  20208. show(showFailWords) {
  20209. super.show();
  20210. this.moneyNode.ui.c1.selectedIndex = 1;
  20211. this.playSecretaryIdle();
  20212. xGame.soundMgr.playMusic("caromhall01");
  20213. Laya.timer.clearAll(this);
  20214. this.playSecretaryRandomSound();
  20215. if (showFailWords) {
  20216. setTimeout(() => {
  20217. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  20218. let words = -1;
  20219. if (str == "s_main02") {
  20220. words = 2;
  20221. }
  20222. else {
  20223. words = 3;
  20224. }
  20225. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20226. xGame.soundMgr.playSound(str);
  20227. }, 300);
  20228. }
  20229. this.showGuide();
  20230. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  20231. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  20232. let guide = DataMgr.getSkillGuide();
  20233. if (guide == 1) {
  20234. let randTime = xGame.common.randomNum(300, 800);
  20235. if (this.firstEnter) {
  20236. this.firstEnter = false;
  20237. randTime += 900;
  20238. }
  20239. Laya.timer.once(randTime, this, () => {
  20240. xGame.common.autoPopUIView();
  20241. });
  20242. }
  20243. }
  20244. checkActive(show) {
  20245. }
  20246. showGuide() {
  20247. let guide = DataMgr.getSkillGuide();
  20248. this.ui.guideBtn.visible = guide == 0;
  20249. this.ui.enterGuide.visible = false;
  20250. this.ui.secretaryGuide.visible = guide == 0;
  20251. if (guide == 0) {
  20252. xGame.soundMgr.playSound("s_guide");
  20253. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20254. }
  20255. }
  20256. ensureSecretary() {
  20257. this.ui.secretaryGuide.visible = false;
  20258. this.ui.enterGuide.visible = true;
  20259. this.ui.wordsNode.t0.play();
  20260. if (DataMgr.getNewUser())
  20261. Moyu.sendDataEvent("gameReady");
  20262. }
  20263. playSecretaryIdle() {
  20264. let parent = this.ui.secretary.displayObject;
  20265. parent.destroyChildren();
  20266. let xx = this.ui.secretary.width / 2;
  20267. let yy = this.ui.secretary.height;
  20268. let scale = xGame.common.getSecretaryScale();
  20269. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20270. xGame.common.secretary.play(data, 1, true, parent);
  20271. }
  20272. startGame(type) {
  20273. xGame.common.gameMode = type;
  20274. Moyu.sendDataEvent("PlayGame", { type: type });
  20275. switch (xGame.common.gameMode) {
  20276. case GameMode.classic:
  20277. let challengeTimes = DataMgr.getChallengeTimes();
  20278. if (challengeTimes == 0) {
  20279. xGame.uiMgr.Show(UIInvitation$1);
  20280. }
  20281. else {
  20282. this.beginGame();
  20283. }
  20284. break;
  20285. case GameMode.bigMove:
  20286. this.beginGame();
  20287. if (DataMgr.getNewUser())
  20288. Moyu.sendDataEvent("gameStart0");
  20289. break;
  20290. default:
  20291. break;
  20292. }
  20293. }
  20294. beginGame(isNice = false) {
  20295. if (xGame.common.gameMode == GameMode.classic) {
  20296. if (isNice) {
  20297. this.enterClassic();
  20298. }
  20299. else {
  20300. xGame.uiMgr.Show(UIModeSelection$1, () => {
  20301. this.enterClassic();
  20302. });
  20303. }
  20304. }
  20305. else if (xGame.common.gameMode == GameMode.bigMove) {
  20306. this.ui.enterGuide.visible = false;
  20307. xGame.uiMgr.Show(UISkill$1);
  20308. }
  20309. }
  20310. enterClassic() {
  20311. xGame.uiMgr.Show(UIGame$1);
  20312. xGame.uiMgr.Show(UIMatching$1, () => {
  20313. if (!this.isHide)
  20314. this.hide();
  20315. xGame.common.gameUI.ui.alpha = 1;
  20316. xGame.common.gameUI.startGame();
  20317. xGame.uiMgr.Hide(UIGameEnd$1);
  20318. });
  20319. }
  20320. startGlobal() {
  20321. xGame.uiMgr.Show(UIMsg$1, "敬请期待~");
  20322. }
  20323. startWeekly() {
  20324. xGame.uiMgr.Show(UIMsg$1, "敬请期待~");
  20325. }
  20326. startPlaceBall() {
  20327. xGame.uiMgr.Show(UILevelDisplay$1);
  20328. }
  20329. hide() {
  20330. super.hide();
  20331. xGame.common.stopGirlPop(this.ui.talkNode);
  20332. }
  20333. onGetUserInfo(force = false) {
  20334. if (Moyu.isWx) {
  20335. let info = Moyu.getSystemInfo();
  20336. if (info)
  20337. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  20338. }
  20339. else {
  20340. Moyu.initUser(this, this.freshUser, force);
  20341. }
  20342. if (!Moyu.hasUserInfo) {
  20343. let user = Moyu.getUserInfo();
  20344. user.headIcon = 'res/ty_touxiang.png';
  20345. }
  20346. this.freshUser();
  20347. }
  20348. freshUser() {
  20349. let user = Moyu.getUserInfo();
  20350. if (!user.isAuth) {
  20351. user.headIcon = 'res/ty_touxiang.png';
  20352. }
  20353. else
  20354. DataMgr.upRankData();
  20355. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  20356. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  20357. }
  20358. interuptSecretary() {
  20359. Laya.timer.clearAll(this);
  20360. this.playSecretaryRandomSound();
  20361. }
  20362. playSecretaryRandomSound() {
  20363. if (this.isHide)
  20364. return;
  20365. let time = xGame.common.randomNum(45000, 60000);
  20366. Laya.timer.once(time, this, () => {
  20367. if (this.isHide)
  20368. return;
  20369. let index = xGame.common.randomNum(4, 7);
  20370. xGame.soundMgr.playSound("s_main0" + index);
  20371. let words = 1;
  20372. switch (index) {
  20373. case 4:
  20374. words = 5;
  20375. break;
  20376. case 5:
  20377. words = 3;
  20378. break;
  20379. case 6:
  20380. words = 6;
  20381. break;
  20382. case 7:
  20383. words = 7;
  20384. break;
  20385. default:
  20386. break;
  20387. }
  20388. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20389. this.playSecretaryRandomSound();
  20390. });
  20391. }
  20392. openSecretaryView() {
  20393. xGame.uiMgr.Show(UISecretary$1);
  20394. Moyu.sendDataEvent("secretary");
  20395. }
  20396. openShopView() {
  20397. xGame.uiMgr.Show(UIShop$1);
  20398. }
  20399. openSignView() {
  20400. xGame.uiMgr.Show(UISign$1);
  20401. }
  20402. openDrawView() {
  20403. xGame.uiMgr.Show(UIDraw$1);
  20404. }
  20405. openRanking() {
  20406. xGame.uiMgr.Show(UIRanking$1);
  20407. Moyu.sendDataEvent("rankingList");
  20408. }
  20409. }
  20410. UIMain$1.uiName = "UIMain";
  20411. function InitShader() {
  20412. }
  20413. function appInit() {
  20414. xGame.context.init(getLoadingResList(), initCallback);
  20415. }
  20416. function getLoadingResList() {
  20417. return [
  20418. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  20419. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  20420. ];
  20421. }
  20422. function getGameResList() {
  20423. return [
  20424. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  20425. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  20426. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  20427. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  20428. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  20429. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  20430. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  20431. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  20432. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  20433. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  20434. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  20435. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  20436. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  20437. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  20438. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  20439. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  20440. { url: "res/json/npc.json", type: Laya.Loader.JSON },
  20441. { url: "res/json/classicCfg.json", type: Laya.Loader.JSON },
  20442. { url: "res/json/levelCfg.json", type: Laya.Loader.JSON },
  20443. { url: "res/json/placeBallCfg.json", type: Laya.Loader.JSON },
  20444. ];
  20445. }
  20446. function initCallback() {
  20447. window["DataMgr"] = DataMgr;
  20448. DataMgr.Init();
  20449. Moyu.init(getPlat(), this, () => {
  20450. DataMgr.isNewDay();
  20451. PlatMgr.initConfig();
  20452. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  20453. }, true);
  20454. console.log('zh:开始sm init1 start');
  20455. xGame.soundMgr.init();
  20456. console.log('zh:开始sm init1 end');
  20457. xGame.uiMgr.init();
  20458. xGame.uiMgr.bindFUI(fguiRes.loading);
  20459. xGame.uiMgr.Show(UILoading);
  20460. }
  20461. function loadSubRes(callback) {
  20462. var tab = ["asset", "res", "spine"];
  20463. let subDone = 0;
  20464. for (var i = 0; i < tab.length; i++) {
  20465. let sub = tab[i];
  20466. Moyu.loadSubRes(sub, (pro) => {
  20467. callback && callback(pro, false);
  20468. }).then(() => {
  20469. subDone++;
  20470. if (subDone >= tab.length)
  20471. callback && callback(1, true);
  20472. });
  20473. }
  20474. }
  20475. function enterGame() {
  20476. xGame.cfgMgr.init();
  20477. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  20478. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  20479. xGame.uiMgr.Hide(UILoading);
  20480. fgui.UIPackage.removePackage(fguiRes.loading);
  20481. xGame.uiMgr.bindFUI(fguiRes.game);
  20482. xGame.uiMgr.Show(UIMain$1);
  20483. if (DataMgr.getNewUser())
  20484. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  20485. }
  20486. function getPlat() {
  20487. let cfg = new MoyuCfg();
  20488. cfg.plat = MoyuPlat.web;
  20489. cfg.myId = 120;
  20490. cfg.myKey = '8848a885774230a4';
  20491. cfg.version = 0;
  20492. if (window.hasOwnProperty("gamebox")) {
  20493. cfg.plat = MoyuPlat.f399;
  20494. cfg.version = 0;
  20495. }
  20496. else if (window.hasOwnProperty("ks")) {
  20497. cfg.plat = MoyuPlat.ks;
  20498. cfg.version = 0;
  20499. cfg.ads.ksVideoId = '2300002254_01';
  20500. cfg.ads.ksInsertId = '2300002254_02';
  20501. }
  20502. else if (Laya.Browser.onTTMiniGame) {
  20503. cfg.plat = MoyuPlat.tt;
  20504. cfg.version = 0;
  20505. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  20506. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  20507. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  20508. }
  20509. else if (Laya.Browser.onMiniGame) {
  20510. cfg.plat = MoyuPlat.wx;
  20511. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  20512. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  20513. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  20514. }
  20515. else if (Laya.Browser.onQQMiniGame) {
  20516. cfg.plat = MoyuPlat.qq;
  20517. }
  20518. else if (Laya.Browser.onQGMiniGame) {
  20519. cfg.plat = MoyuPlat.op;
  20520. cfg.ads.opVideoId = '455502';
  20521. cfg.ads.opBannerId = '455507';
  20522. }
  20523. else if (Laya.Browser.onVVMiniGame) {
  20524. cfg.plat = MoyuPlat.vv;
  20525. cfg.version = 0;
  20526. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  20527. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  20528. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  20529. }
  20530. else if (Laya.Browser.onHWMiniGame) {
  20531. cfg.plat = MoyuPlat.hw;
  20532. }
  20533. else if (window["mz"]) {
  20534. cfg.plat = MoyuPlat.mz;
  20535. }
  20536. else {
  20537. let cfg = window['conchConfig'];
  20538. if (cfg) {
  20539. var os = cfg.getOS();
  20540. if (os == "Conch-ios") {
  20541. cfg.plat = MoyuPlat.ios;
  20542. }
  20543. else if (os == "Conch-android") {
  20544. }
  20545. }
  20546. }
  20547. return cfg;
  20548. }
  20549. class Main {
  20550. constructor() {
  20551. if (window["Laya3D"])
  20552. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  20553. else {
  20554. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  20555. this.initMain();
  20556. }
  20557. }
  20558. initMain() {
  20559. Laya["Physics"] && Laya["Physics"].enable();
  20560. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  20561. Laya.stage.scaleMode = GameConfig.scaleMode;
  20562. Laya.stage.screenMode = GameConfig.screenMode;
  20563. Laya.stage.alignV = GameConfig.alignV;
  20564. Laya.stage.alignH = GameConfig.alignH;
  20565. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  20566. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  20567. Laya.enableDebugPanel();
  20568. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  20569. Laya["PhysicsDebugDraw"].enable();
  20570. if (GameConfig.stat)
  20571. Laya.Stat.show();
  20572. Laya.alertGlobalError(true);
  20573. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  20574. }
  20575. onVersionLoaded() {
  20576. appInit();
  20577. }
  20578. }
  20579. new Main();
  20580. }());
  20581. //# sourceMappingURL=bundle.js.map