1
0

bundle.js 800 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982
  1. (function () {
  2. 'use strict';
  3. class GameConfig {
  4. constructor() {
  5. }
  6. static init() {
  7. var reg = Laya.ClassUtils.regClass;
  8. }
  9. }
  10. GameConfig.width = 1334;
  11. GameConfig.height = 750;
  12. GameConfig.scaleMode = "fixedheight";
  13. GameConfig.screenMode = "horizontal";
  14. GameConfig.alignV = "top";
  15. GameConfig.alignH = "left";
  16. GameConfig.startScene = "";
  17. GameConfig.sceneRoot = "";
  18. GameConfig.debug = false;
  19. GameConfig.stat = false;
  20. GameConfig.physicsDebug = false;
  21. GameConfig.exportSceneToJson = true;
  22. GameConfig.init();
  23. let fguiRes = {
  24. game: "asset/fgui/game",
  25. loading: "fgui/loading"
  26. };
  27. let ballCamp = {
  28. full: "full",
  29. flower: "flower"
  30. };
  31. let FoulType = {
  32. "timeOut": "1",
  33. "notTouch": "2",
  34. "wrongTouch": "3",
  35. "wrongHole": "4",
  36. "rootHole": "5",
  37. };
  38. let ALL_BALL_STOP = "ALL_BALL_STOP";
  39. let WAIT_SHOOT = "WAIT_SHOOT";
  40. let D3RES_LOADED = "D3RES_LOADED";
  41. let BALL_SHOOT = "BALL_SHOOT";
  42. let FIRST_BALL_HOLE = "FIRST_BALL_HOLE";
  43. let RESET_GAME = "RESET_GAME";
  44. let COIN_CHANGE = "COIN_CHANGE";
  45. let DIAMOND_CHANGE = "DIAMOND_CHANGE";
  46. let RESTART_GAME = "RESTART_GAME";
  47. let GET_USER_INFO = "GET_USER_INFO";
  48. let CHANGE_SECRETARY = "CHANGE_SECRETARY";
  49. let POWER_CHANGE = "POWER_CHANGE";
  50. let POWER_TIME = "POWER_TIME";
  51. let baseHeadUrl = "https://mygame1.tangro.cn/headimg/";
  52. let poolKey = {
  53. inHoleEft: "inHoleEft",
  54. d3ball: "d3ball",
  55. iceEft: "iceEft",
  56. hitEft: "hitEft",
  57. fireworksEft: "fireworksEft",
  58. };
  59. var GameMode;
  60. (function (GameMode) {
  61. GameMode[GameMode["classic"] = 0] = "classic";
  62. GameMode[GameMode["bigMove"] = 1] = "bigMove";
  63. GameMode[GameMode["placeBall"] = 2] = "placeBall";
  64. })(GameMode || (GameMode = {}));
  65. var SkillType;
  66. (function (SkillType) {
  67. SkillType[SkillType["highSpace"] = 0] = "highSpace";
  68. SkillType[SkillType["breakArmy"] = 1] = "breakArmy";
  69. SkillType[SkillType["ice"] = 2] = "ice";
  70. SkillType[SkillType["fireworks"] = 3] = "fireworks";
  71. SkillType[SkillType["GuanYu"] = 4] = "GuanYu";
  72. })(SkillType || (SkillType = {}));
  73. var ClassicWordsType;
  74. (function (ClassicWordsType) {
  75. ClassicWordsType[ClassicWordsType["directShoot"] = 0] = "directShoot";
  76. ClassicWordsType[ClassicWordsType["bigPower"] = 1] = "bigPower";
  77. ClassicWordsType[ClassicWordsType["anotherShoot"] = 2] = "anotherShoot";
  78. ClassicWordsType[ClassicWordsType["perfectShow"] = 3] = "perfectShow";
  79. ClassicWordsType[ClassicWordsType["hardShoot"] = 4] = "hardShoot";
  80. })(ClassicWordsType || (ClassicWordsType = {}));
  81. var PressType;
  82. (function (PressType) {
  83. PressType[PressType["powerNode"] = 0] = "powerNode";
  84. PressType[PressType["d2Root"] = 1] = "d2Root";
  85. PressType[PressType["moveNode"] = 2] = "moveNode";
  86. PressType[PressType["rulerNode"] = 3] = "rulerNode";
  87. })(PressType || (PressType = {}));
  88. var PlaceBallType;
  89. (function (PlaceBallType) {
  90. PlaceBallType[PlaceBallType["normal"] = 0] = "normal";
  91. PlaceBallType[PlaceBallType["challenge"] = 1] = "challenge";
  92. })(PlaceBallType || (PlaceBallType = {}));
  93. var EAdType;
  94. (function (EAdType) {
  95. EAdType[EAdType["upSkill"] = 0] = "upSkill";
  96. EAdType[EAdType["addDiamond"] = 1] = "addDiamond";
  97. EAdType[EAdType["placeBallNextLevel"] = 2] = "placeBallNextLevel";
  98. EAdType[EAdType["regretBall"] = 3] = "regretBall";
  99. EAdType[EAdType["longHelpLine"] = 4] = "longHelpLine";
  100. EAdType[EAdType["addFailCoin"] = 5] = "addFailCoin";
  101. EAdType[EAdType["sign"] = 6] = "sign";
  102. EAdType[EAdType["draw"] = 7] = "draw";
  103. EAdType[EAdType["triple"] = 8] = "triple";
  104. EAdType[EAdType["randomDiamond"] = 9] = "randomDiamond";
  105. EAdType[EAdType["getPower"] = 10] = "getPower";
  106. EAdType[EAdType["box"] = 11] = "box";
  107. EAdType[EAdType["try"] = 12] = "try";
  108. EAdType[EAdType["againSign"] = 13] = "againSign";
  109. EAdType[EAdType["addCoin"] = 14] = "addCoin";
  110. })(EAdType || (EAdType = {}));
  111. var Prop;
  112. (function (Prop) {
  113. Prop[Prop["diamond"] = 1] = "diamond";
  114. Prop[Prop["coin"] = 2] = "coin";
  115. Prop[Prop["gan1"] = 3] = "gan1";
  116. Prop[Prop["gan2"] = 4] = "gan2";
  117. Prop[Prop["gan3"] = 5] = "gan3";
  118. Prop[Prop["gan4"] = 6] = "gan4";
  119. })(Prop || (Prop = {}));
  120. var TipsType;
  121. (function (TipsType) {
  122. TipsType[TipsType["exitGame"] = 0] = "exitGame";
  123. TipsType[TipsType["foul"] = 1] = "foul";
  124. })(TipsType || (TipsType = {}));
  125. class AwardType {
  126. constructor(type, num) {
  127. this.type = type;
  128. this.num = num;
  129. }
  130. }
  131. var define = /*#__PURE__*/Object.freeze({
  132. fguiRes: fguiRes,
  133. ballCamp: ballCamp,
  134. FoulType: FoulType,
  135. ALL_BALL_STOP: ALL_BALL_STOP,
  136. WAIT_SHOOT: WAIT_SHOOT,
  137. D3RES_LOADED: D3RES_LOADED,
  138. BALL_SHOOT: BALL_SHOOT,
  139. FIRST_BALL_HOLE: FIRST_BALL_HOLE,
  140. RESET_GAME: RESET_GAME,
  141. COIN_CHANGE: COIN_CHANGE,
  142. DIAMOND_CHANGE: DIAMOND_CHANGE,
  143. RESTART_GAME: RESTART_GAME,
  144. GET_USER_INFO: GET_USER_INFO,
  145. CHANGE_SECRETARY: CHANGE_SECRETARY,
  146. POWER_CHANGE: POWER_CHANGE,
  147. POWER_TIME: POWER_TIME,
  148. baseHeadUrl: baseHeadUrl,
  149. poolKey: poolKey,
  150. get GameMode () { return GameMode; },
  151. get SkillType () { return SkillType; },
  152. get ClassicWordsType () { return ClassicWordsType; },
  153. get PressType () { return PressType; },
  154. get PlaceBallType () { return PlaceBallType; },
  155. get EAdType () { return EAdType; },
  156. get Prop () { return Prop; },
  157. get TipsType () { return TipsType; },
  158. AwardType: AwardType
  159. });
  160. class CContext {
  161. constructor() {
  162. this.winSize = { width: 0, height: 0 };
  163. this.notchHeight = 0;
  164. this.bannerHeight = 0;
  165. }
  166. init(resList, callback) {
  167. this.winSize = { width: Laya.Browser.clientWidth, height: Laya.Browser.clientHeight };
  168. this.notchHeight = this.getNotchHeight();
  169. this.bannerHeight = this.getBannerHeight();
  170. Laya.loader.load(resList, Laya.Handler.create(this, () => {
  171. callback && callback();
  172. }));
  173. }
  174. getNotchHeight() {
  175. let notchHeight = 50;
  176. if (Laya.Browser.onMiniGame) {
  177. let deviceInfo = wx.getSystemInfoSync();
  178. if (Laya.Browser.onIOS) {
  179. if (deviceInfo.model.search('iPhone X') != -1) {
  180. notchHeight = deviceInfo.statusBarHeight - 10;
  181. }
  182. else {
  183. if ((deviceInfo.screenWidth == 375 && deviceInfo.screenHeight == 812) ||
  184. (deviceInfo.screenWidth == 414 && deviceInfo.screenHeight == 896)) {
  185. notchHeight = deviceInfo.statusBarHeight - 10;
  186. }
  187. }
  188. }
  189. else if (Laya.Browser.onAndroid) {
  190. if (deviceInfo.screenWidth / deviceInfo.screenHeight < (9 / 16)) {
  191. notchHeight = deviceInfo.statusBarHeight;
  192. }
  193. }
  194. }
  195. return notchHeight;
  196. }
  197. getBannerHeight() {
  198. return 0;
  199. }
  200. }
  201. let context = new CContext();
  202. var Handler = Laya.Handler;
  203. var Tween = Laya.Tween;
  204. function playClickEffect(btn) {
  205. if (!btn)
  206. return;
  207. Laya.Tween.to(btn, { scaleX: 1.05, scaleY: 1.05 }, 20, null, Laya.Handler.create(null, () => {
  208. if (!btn)
  209. return;
  210. Laya.Tween.to(btn, { scaleX: 0.96, scaleY: 0.96 }, 30, null, Laya.Handler.create(null, () => {
  211. if (!btn)
  212. return;
  213. Laya.Tween.to(btn, { scaleX: 1, scaleY: 1 }, 20, null, null, 0, true);
  214. }), 0, true);
  215. }), 0, true);
  216. }
  217. function getNumList(strList) {
  218. let dataList = [];
  219. if (strList) {
  220. let list = strList;
  221. let array = list.split(',');
  222. for (var v in array) {
  223. dataList.push(Number(array[v]));
  224. }
  225. }
  226. return dataList;
  227. }
  228. function getStrList(strList) {
  229. let dataList = [];
  230. if (strList) {
  231. let list = strList;
  232. let array = list.split('|');
  233. for (var v in array) {
  234. dataList.push(String(array[v]));
  235. }
  236. }
  237. return dataList;
  238. }
  239. function getRandStr(len) {
  240. let list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'];
  241. let str = "";
  242. for (let i = 0; i < len; i++) {
  243. let rand = random(0, list.length);
  244. str += list[rand];
  245. }
  246. return str;
  247. }
  248. function getUserId() {
  249. let str = getRandStr(12) + Laya.timer.currTimer % 1000000;
  250. return str;
  251. }
  252. function formatPos(pos, len = 2) {
  253. let v = Math.pow(10, len);
  254. pos.x = Math.floor(pos.x * v) / v;
  255. pos.y = Math.floor(pos.y * v) / v;
  256. if (pos.z)
  257. pos.z = Math.floor(pos.z * v) / v;
  258. return pos;
  259. }
  260. function setPosInt(pos) {
  261. pos.x = pos.x > 0 ? Math.ceil(pos.x) : Math.floor(pos.x);
  262. pos.y = pos.y > 0 ? Math.ceil(pos.y) : Math.floor(pos.y);
  263. pos.z = pos.z > 0 ? Math.ceil(pos.z) : Math.floor(pos.z);
  264. return pos;
  265. }
  266. function random(min, max) {
  267. var rang = max - min;
  268. var rand = Math.random() * rang;
  269. return Math.floor(rand) + min;
  270. }
  271. function randomList(list, num) {
  272. if (list.length <= num)
  273. return list;
  274. let arry = [];
  275. list.forEach(item => {
  276. arry.push(item);
  277. });
  278. let nums = [];
  279. for (let i = 0; i < num; i++) {
  280. let rand = random(0, arry.length);
  281. let v = arry[rand];
  282. nums.push(v);
  283. arry.splice(rand, 1);
  284. }
  285. return nums;
  286. }
  287. function worldToScreen(camera, point, pos) {
  288. camera.viewport.project(point, camera.projectionViewMatrix, pos);
  289. pos.x = pos.x / Laya.stage.clientScaleX;
  290. pos.y = pos.y / Laya.stage.clientScaleY;
  291. }
  292. function getStringLenght(str) {
  293. return str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  294. }
  295. function reviseString(str, len) {
  296. let ld = str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  297. if (ld > len) {
  298. let sl = Math.floor(len / 2);
  299. let rs = str.substring(0, sl);
  300. let d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  301. while (d + 2 < len) {
  302. sl++;
  303. rs = str.substring(0, sl);
  304. d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  305. }
  306. return rs + "...";
  307. }
  308. return str;
  309. }
  310. function getCoinString(coin) {
  311. if (coin < 10000)
  312. return coin.toString();
  313. else if (coin < 1000000) {
  314. let vh = Math.ceil(coin / 100);
  315. return (vh / 10) + "k";
  316. }
  317. else if (coin < 1000000000) {
  318. var vh = Math.ceil(coin / 100000);
  319. return (vh / 10) + "m";
  320. }
  321. else if (coin < 1000000000000) {
  322. var vh = Math.ceil(coin / 100000000);
  323. return (vh / 10) + "b";
  324. }
  325. else if (coin < 1000000000000000) {
  326. var vh = Math.ceil(coin / 100000000000);
  327. return (vh / 10) + "t";
  328. }
  329. }
  330. function getV3Dest(pos, dir, dis, dest) {
  331. dir.x *= dis;
  332. dir.y *= dis;
  333. dir.z *= dis;
  334. Laya.Vector3.add(pos, dir, dest);
  335. return dest;
  336. }
  337. function getV2Dest(x1, y1, dir, dis, dest) {
  338. dest.x = x1 + dir.x * dis;
  339. dest.y = y1 + dir.y * dis;
  340. return dest;
  341. }
  342. function getV2Dir(x1, y1, x2, y2, dir) {
  343. dir.x = x2 - x1;
  344. dir.y = y2 - y1;
  345. Laya.Vector2.normalize(dir, dir);
  346. return dir;
  347. }
  348. function getV3Dir(p1, p2, dir) {
  349. Laya.Vector3.subtract(p1, p2, dir);
  350. Laya.Vector3.normalize(dir, dir);
  351. return dir;
  352. }
  353. function copyPos(ip, op) {
  354. op.x = ip.x;
  355. op.y = ip.y;
  356. if (ip.z)
  357. op.z = ip.z;
  358. return op;
  359. }
  360. function getScreenImg() {
  361. let gl = Laya.WebGLContext.mainContext;
  362. let pixels = new Uint8Array(gl.drawingBufferWidth * gl.drawingBufferHeight * 4);
  363. gl.readPixels(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
  364. let w = gl.drawingBufferWidth;
  365. let h = gl.drawingBufferHeight;
  366. let texture2d = new Laya.Texture2D(w, h, Laya.TextureFormat.R8G8B8A8, false, false);
  367. texture2d.setPixels(pixels);
  368. return new Laya.Texture(texture2d);
  369. }
  370. function playMoveByPositions(sp, positions, v, completeCallback) {
  371. let p;
  372. let play = () => {
  373. if (positions.length == 0) {
  374. completeCallback();
  375. return;
  376. }
  377. p = positions[0];
  378. positions.splice(0, 1);
  379. Laya.Tween.to(sp, { x: p.x, y: p.y }, getDistance(sp.x, sp.y, p.x, p.y) / v * 1000, null, Handler.create(this, () => {
  380. play();
  381. }));
  382. };
  383. play();
  384. }
  385. function setStarPos(node, num, max) {
  386. for (let i = 1; i <= 5; i++) {
  387. let img = node.getChildAt(i - 1);
  388. img.width = img.height = 30;
  389. img.pivotX = img.pivotY = 0.5;
  390. img.gray = i > num;
  391. img.visible = i <= max;
  392. if (max == 3) {
  393. img.x = node.width / 2 + (i - 2) * 30 - 15;
  394. img.y = node.height - 40;
  395. if (i == 2)
  396. img.y = node.height - 30;
  397. }
  398. else if (max == 5) {
  399. let ly = Math.abs(i - 3);
  400. img.x = node.width / 2 + (i - 3) * 20 - 15;
  401. img.y = node.height - ly * 8 - 30;
  402. }
  403. }
  404. }
  405. function playLoopAnimRotate(sp, time, clockwise = true) {
  406. let rotation;
  407. sp.rotation = sp.rotation % 360;
  408. if (clockwise) {
  409. rotation = -360;
  410. }
  411. else {
  412. rotation = 360;
  413. }
  414. Tween.to(sp, { rotation: rotation }, time, null, Handler.create(this, () => {
  415. this.playLoopAnimRotate(sp, time, clockwise);
  416. }));
  417. }
  418. function playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, isBig = true) {
  419. let x, y;
  420. if (isBig) {
  421. x = valueXMin;
  422. y = valueYMin;
  423. }
  424. else {
  425. x = valueXMax;
  426. y = valueYMax;
  427. }
  428. Tween.to(sp, { x: x, y: y }, time, null, Handler.create(this, () => {
  429. this.playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, !isBig);
  430. }));
  431. }
  432. function playLoopAnimScale(sp, valueMin, valueMax, time, isBig = true) {
  433. let scale;
  434. if (isBig) {
  435. scale = valueMin;
  436. }
  437. else {
  438. scale = valueMax;
  439. }
  440. Tween.to(sp, { scaleX: scale, scaleY: scale }, time, null, Handler.create(this, () => {
  441. playLoopAnimScale(sp, valueMin, valueMax, time, !isBig);
  442. }));
  443. }
  444. function playLoopAnimRotation(sp, valueMin, valueMax, time, isBig = true, count = 8) {
  445. let value;
  446. if (isBig) {
  447. value = valueMin;
  448. }
  449. else {
  450. value = valueMax;
  451. }
  452. if (count) {
  453. count--;
  454. Tween.to(sp, { rotation: value }, time, null, Handler.create(this, () => {
  455. playLoopAnimRotation(sp, valueMin, valueMax, time, !isBig, count);
  456. }));
  457. }
  458. else {
  459. sp.rotation = 0;
  460. }
  461. }
  462. function inRect(rect, p) {
  463. if (p.x >= rect.x && p.x <= rect.x + rect.w) {
  464. if (p.y >= rect.y && p.y <= rect.y + rect.h) {
  465. return true;
  466. }
  467. }
  468. return false;
  469. }
  470. function getNumberK(number) {
  471. if (number < 1000) {
  472. return number.toString();
  473. }
  474. else {
  475. return (number / 1000).toFixed(1) + "k";
  476. }
  477. }
  478. function pointInsideCircle(point, circle, r) {
  479. if (r === 0)
  480. return false;
  481. var dx = circle.x - point.x;
  482. var dy = circle.y - point.y;
  483. return dx * dx + dy * dy <= r * r;
  484. }
  485. function formatString(str, data) {
  486. if (!str || data == undefined) {
  487. return str;
  488. }
  489. if (typeof data === "object") {
  490. for (var key in data) {
  491. if (data.hasOwnProperty(key)) {
  492. str = str.replace(new RegExp("\{" + key + "\}", "g"), data[key]);
  493. }
  494. }
  495. }
  496. else {
  497. var args = arguments, reg = new RegExp("\{([0-" + (args.length - 1) + "])\}", "g");
  498. return str.replace(reg, function (match, index) {
  499. return args[index - (-1)];
  500. });
  501. }
  502. return str;
  503. }
  504. function getIntersection(a, b) {
  505. let t = [];
  506. for (var i = 0; i < a.length; i++) {
  507. for (var j = 0; j < b.length; j++) {
  508. if (a[i] == b[j]) {
  509. t.push(a[i]);
  510. }
  511. }
  512. }
  513. return t;
  514. }
  515. function getComplement(a, b) {
  516. let t = [];
  517. let count = false;
  518. for (var i = 0; i < a.length; i++) {
  519. count = false;
  520. for (var j = 0; j < b.length; j++) {
  521. if (a[i] == b[j]) {
  522. count = true;
  523. break;
  524. }
  525. }
  526. if (!count) {
  527. t.push(a[i]);
  528. }
  529. }
  530. return t;
  531. }
  532. function geSpriteStageRect(sp) {
  533. var point = sp.localToGlobal(Laya.Point.TEMP.setTo(0, 0));
  534. let rect = {
  535. x: point.x,
  536. y: point.y,
  537. width: sp.width * sp.globalScaleX,
  538. height: sp.height * sp.globalScaleY
  539. };
  540. return rect;
  541. }
  542. function touchButton(button) {
  543. let event = new Laya.Event();
  544. button.event(Laya.Event.CLICK, event.setTo(Laya.Event.CLICK, button, button));
  545. }
  546. function setColor(sprite, r, g, b) {
  547. var redMat = [
  548. r / 255, 0, 0, 0, 0,
  549. g / 255, 0, 0, 0, 0,
  550. b / 255, 0, 0, 0, 0,
  551. 0, 0, 0, 1, 0,
  552. ];
  553. var filter = new Laya.ColorFilter(redMat);
  554. sprite.filters = [filter];
  555. }
  556. function clone(obj, newobj = {}) {
  557. for (var attr in obj) {
  558. if (typeof obj[attr] == "object") {
  559. newobj[attr] = clone(obj[attr], newobj[attr]);
  560. }
  561. else {
  562. newobj[attr] = obj[attr];
  563. }
  564. }
  565. return newobj;
  566. }
  567. function _ms(arr, compare, begin, end) {
  568. const size = end - begin;
  569. if (size <= 1) {
  570. return;
  571. }
  572. const middle = (end + begin) >> 1;
  573. _ms(arr, compare, begin, middle);
  574. _ms(arr, compare, middle, end);
  575. if (compare(arr[middle - 1], arr[middle]) <= 0) {
  576. return;
  577. }
  578. const merged = [];
  579. let leftIndex = begin, rightIndex = middle;
  580. while (merged.length < size) {
  581. if (leftIndex === middle) {
  582. merged.push(arr[rightIndex++]);
  583. }
  584. else if (rightIndex === end) {
  585. merged.push(arr[leftIndex++]);
  586. }
  587. else {
  588. const c = compare(arr[leftIndex], arr[rightIndex]);
  589. if (c <= 0) {
  590. merged.push(arr[leftIndex++]);
  591. }
  592. else {
  593. merged.push(arr[rightIndex++]);
  594. }
  595. }
  596. }
  597. arr.splice(begin, size, ...merged);
  598. }
  599. function sort(arr, compare) {
  600. if (!Array.isArray(arr)) {
  601. throw new Error('sort的参数必须为数组');
  602. }
  603. _ms(arr, compare, 0, arr.length);
  604. return arr;
  605. }
  606. function getLanguage(id) {
  607. }
  608. function getLanguageByTip(id) {
  609. }
  610. function toWeights(array) {
  611. let max = 0;
  612. for (var i = 0; i < array.length; i++) {
  613. max = max + array[i];
  614. if (array[i] == 0) {
  615. array[i] = 0;
  616. }
  617. else {
  618. array[i] = max;
  619. }
  620. }
  621. return array;
  622. }
  623. function unique(array) {
  624. var n = {}, r = [], len = array.length, val, type;
  625. for (var i = 0; i < array.length; i++) {
  626. val = array[i];
  627. type = typeof val;
  628. if (!n[val]) {
  629. n[val] = [type];
  630. r.push(val);
  631. }
  632. else if (n[val].indexOf(type) < 0) {
  633. n[val].push(type);
  634. r.push(val);
  635. }
  636. }
  637. return r;
  638. }
  639. function unique1(array) {
  640. var r = [];
  641. for (var i = 0, l = array.length; i < l; i++) {
  642. for (var j = i + 1; j < l; j++)
  643. if (array[i] == array[j])
  644. j == ++i;
  645. r.push(array[i]);
  646. }
  647. return r;
  648. }
  649. function getDistance(x1, y1, x2, y2) {
  650. return Math.pow(((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)), 0.5);
  651. }
  652. function getV2Dis(pos1, pos2) {
  653. return Math.pow(((pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y)), 0.5);
  654. }
  655. function getV2SqDis(pos1, pos2) {
  656. return (pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y);
  657. }
  658. function getDis(x1, y1, x2, y2) {
  659. return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
  660. }
  661. function getDeltaxy(x1, y1, x2, y2) {
  662. return Math.abs(x1 - x2) + Math.abs(y1 - y2);
  663. }
  664. function getSymbolNumber(num) {
  665. if (num > 0) {
  666. return "+" + num;
  667. }
  668. else if (num < 0) {
  669. return num.toString();
  670. }
  671. return num.toString();
  672. }
  673. function fixNumber(num, length) {
  674. return ('' + num).length < length ? ((new Array(length + 1)).join('0') + num).slice(-length) : '' + num;
  675. }
  676. function toThousands(num) {
  677. return num.replace(/(\d)(?=(?:\d{3})+$)/g, '$1,');
  678. }
  679. let moneyUnitStr = ["", "K", "M", "B", "T", "AK", "AM", "AB", "AT", "BK", "BM", "BB", "BT", "CK", "CM", "CB", "CT"];
  680. function fmtMoney(money) {
  681. money = toThousands(money.replace(/^0+/, ''));
  682. if (money.length == 0) {
  683. money = "0";
  684. }
  685. let unit = 0;
  686. for (var i = 0; i < money.length; i++) {
  687. if (money.charAt(i) == ",") {
  688. unit++;
  689. }
  690. }
  691. if (unit == 0) {
  692. return money;
  693. }
  694. else {
  695. let idx = money.indexOf(",");
  696. if (idx) {
  697. money = money.slice(0, idx + 2) + moneyUnitStr[unit];
  698. }
  699. return money.replace(",", ".");
  700. }
  701. }
  702. function flatten(arr) {
  703. while (arr.some(item => Array.isArray(item))) {
  704. arr = [].concat(...arr);
  705. }
  706. return arr;
  707. }
  708. function getDistanceByPoint(p1, p2) {
  709. return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
  710. }
  711. function getAngleByPoint(p1, p2) {
  712. return Math.atan2((p2.y - p1.y), (p2.x - p1.x)) * (180 / Math.PI);
  713. }
  714. function toIntByArray(array) {
  715. for (var index = 0; index < array.length; index++) {
  716. array[index] = parseInt(array[index]);
  717. }
  718. return array;
  719. }
  720. function getAngle0To360(angle) {
  721. while (angle < 0) {
  722. angle += 360;
  723. }
  724. while (angle >= 360) {
  725. angle -= 360;
  726. }
  727. return angle;
  728. }
  729. function toAngle(radian) {
  730. return radian * 180 / Math.PI;
  731. }
  732. function toRadian(angle) {
  733. return angle * Math.PI / 180;
  734. }
  735. function getArrayValueRandom(array) {
  736. return array[random(0, array.length - 1)];
  737. }
  738. function promptByTip(tipId, color = "#FFFFFF", strokeColor = null, time = 1000, fontSize = 35, opacity = 1) {
  739. }
  740. function promptByErrorCode(id, color = "#FFFFFF", strokeColor = "#FF8B00", time = 1000, fontSize = 35, opacity = 1) {
  741. }
  742. function fmtTimeMMSS(time) {
  743. if (time < 0) {
  744. time = 0;
  745. }
  746. else
  747. time = Math.floor(time);
  748. return fixNumber(Math.floor(time / 60), 2) + ":" + fixNumber(time % 60, 2);
  749. }
  750. function fmtTimeMS(time) {
  751. if (time < 0) {
  752. time = 0;
  753. }
  754. return fixNumber(Math.floor(time / 60), 2) + "m" + fixNumber(time % 60, 2) + "s";
  755. }
  756. function fmtTimeHHMM(time) {
  757. if (time < 0) {
  758. time = 0;
  759. }
  760. time = Math.floor(time / 1000);
  761. return fixNumber(Math.floor(time / 3600), 2) + ":" + fixNumber(Math.floor((time % 3600) / 60), 2) + ":" + fixNumber(Math.floor(time % 60), 2);
  762. }
  763. let severTime = 0;
  764. function getServerTime() {
  765. return new Date(new Date().getTime() - severTime);
  766. }
  767. function setServerTime(data) {
  768. severTime = (new Date().getTime() - data);
  769. }
  770. var tools = /*#__PURE__*/Object.freeze({
  771. playClickEffect: playClickEffect,
  772. getNumList: getNumList,
  773. getStrList: getStrList,
  774. getRandStr: getRandStr,
  775. getUserId: getUserId,
  776. formatPos: formatPos,
  777. setPosInt: setPosInt,
  778. random: random,
  779. randomList: randomList,
  780. worldToScreen: worldToScreen,
  781. getStringLenght: getStringLenght,
  782. reviseString: reviseString,
  783. getCoinString: getCoinString,
  784. getV3Dest: getV3Dest,
  785. getV2Dest: getV2Dest,
  786. getV2Dir: getV2Dir,
  787. getV3Dir: getV3Dir,
  788. copyPos: copyPos,
  789. getScreenImg: getScreenImg,
  790. playMoveByPositions: playMoveByPositions,
  791. setStarPos: setStarPos,
  792. playLoopAnimRotate: playLoopAnimRotate,
  793. playLoopAnimPosition: playLoopAnimPosition,
  794. playLoopAnimScale: playLoopAnimScale,
  795. playLoopAnimRotation: playLoopAnimRotation,
  796. inRect: inRect,
  797. getNumberK: getNumberK,
  798. pointInsideCircle: pointInsideCircle,
  799. formatString: formatString,
  800. getIntersection: getIntersection,
  801. getComplement: getComplement,
  802. geSpriteStageRect: geSpriteStageRect,
  803. touchButton: touchButton,
  804. setColor: setColor,
  805. clone: clone,
  806. sort: sort,
  807. getLanguage: getLanguage,
  808. getLanguageByTip: getLanguageByTip,
  809. toWeights: toWeights,
  810. unique: unique,
  811. unique1: unique1,
  812. getDistance: getDistance,
  813. getV2Dis: getV2Dis,
  814. getV2SqDis: getV2SqDis,
  815. getDis: getDis,
  816. getDeltaxy: getDeltaxy,
  817. getSymbolNumber: getSymbolNumber,
  818. fixNumber: fixNumber,
  819. toThousands: toThousands,
  820. fmtMoney: fmtMoney,
  821. flatten: flatten,
  822. getDistanceByPoint: getDistanceByPoint,
  823. getAngleByPoint: getAngleByPoint,
  824. toIntByArray: toIntByArray,
  825. getAngle0To360: getAngle0To360,
  826. toAngle: toAngle,
  827. toRadian: toRadian,
  828. getArrayValueRandom: getArrayValueRandom,
  829. promptByTip: promptByTip,
  830. promptByErrorCode: promptByErrorCode,
  831. fmtTimeMMSS: fmtTimeMMSS,
  832. fmtTimeMS: fmtTimeMS,
  833. fmtTimeHHMM: fmtTimeHHMM,
  834. getServerTime: getServerTime,
  835. setServerTime: setServerTime
  836. });
  837. class HttpMgr {
  838. constructor() {
  839. HttpMgr._instance = this;
  840. }
  841. static getInstance() {
  842. if (!this._instance) {
  843. this._instance = new HttpMgr();
  844. }
  845. return this._instance;
  846. }
  847. sendPost(url, data, call) {
  848. let httpObj = new Laya.HttpRequest();
  849. httpObj.http.timeout = 5000;
  850. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  851. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  852. httpObj.send(url, data, 'post', 'text', ["Content-Type", "application/json; charset=UTF-8"]);
  853. function errorHandler(error) {
  854. console.log("errorHandler:" + error);
  855. }
  856. function completeHandler(data) {
  857. if (data && data.length > 0) {
  858. let jsonData = JSON.parse(data);
  859. if (call)
  860. call(jsonData);
  861. }
  862. }
  863. }
  864. sendGet(url, call) {
  865. let httpObj = new Laya.HttpRequest();
  866. httpObj.http.timeout = 5000;
  867. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  868. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  869. httpObj.send(url, '', 'get');
  870. function errorHandler(error) {
  871. console.log("errorHandler:" + error);
  872. }
  873. function completeHandler(data) {
  874. if (data && data.length > 0) {
  875. if (call)
  876. call(data);
  877. }
  878. }
  879. }
  880. }
  881. HttpMgr._instance = null;
  882. class LightShader extends Laya.Sprite {
  883. constructor() {
  884. super();
  885. this._time = 0;
  886. this._sin = 0;
  887. this.initShader();
  888. }
  889. initShader() {
  890. var vs = `
  891. #define FSHIGHPRECISION
  892. attribute vec4 posuv;
  893. uniform vec2 size;
  894. varying vec4 v_texcoord;
  895. void main() {
  896. vec4 pos = vec4(posuv.xy,0.,1.);
  897. vec4 pos1 =vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,0.,1.0);
  898. gl_Position=pos1;
  899. v_texcoord.xy = posuv.xy;
  900. }
  901. `;
  902. var ps = `
  903. #define FSHIGHPRECISION
  904. precision highp float;
  905. varying vec4 v_texcoord;
  906. uniform vec2 size;
  907. uniform sampler2D texture;
  908. uniform float u_Time;
  909. void main() {
  910. vec4 color= texture2D(texture, v_texcoord.xy);
  911. float width = 0.2;
  912. float start = u_Time;
  913. float offset = 1.0;
  914. vec2 myuv = vec2(v_texcoord.x/size.x,v_texcoord.y/size.y);
  915. if( myuv.x < (start - offset * myuv.y) && myuv.x > (start - offset * myuv.y - width))
  916. {
  917. color.r=1.1;
  918. color.g=1.1;
  919. color.b=1.1;
  920. gl_FragColor = color;
  921. } else {
  922. gl_FragColor = color;
  923. }
  924. }
  925. `;
  926. this.shaderValue = new Laya.Value2D(LightShader.DissolveSurfaceSaveName, LightShader.DissolveSurfaceSaveName);
  927. this.customRenderEnable = true;
  928. this.shaderValue.shader = new Laya.Shader2X(vs, ps, LightShader.DissolveSurfaceSaveName);
  929. }
  930. customRender(context, x, y) {
  931. this.onUpdate();
  932. if (!this.texture)
  933. return;
  934. let xx = x - this.pivotX;
  935. let yy = y - this.pivotY;
  936. context.drawTarget(this.texture, xx, yy, this.width, this.height, null, this.shaderValue);
  937. }
  938. onUpdate() {
  939. this._time += 2 * Laya.timer.delta * 0.001;
  940. this._sin = Math.sin(this._time);
  941. if (this._sin > 0.99) {
  942. this._sin = 0;
  943. this._time = 0;
  944. }
  945. this.shaderValue['u_Time'] = this._sin;
  946. }
  947. }
  948. LightShader.DissolveSurfaceSaveName = 9997;
  949. class UIBase extends fairygui.Window {
  950. constructor() {
  951. super();
  952. this.isEject = true;
  953. this.isHide = true;
  954. this.showbanner = true;
  955. this.className = "";
  956. this.isMuti = false;
  957. this.showbanner = false;
  958. this.onConstructor();
  959. }
  960. checkActive(show) {
  961. }
  962. getUIName() {
  963. return UIBase.uiName;
  964. }
  965. onConstructor() {
  966. }
  967. onInit() {
  968. if (!!this.contentPane) {
  969. this.contentPane.setSize(fairygui.GRoot.inst.width, fairygui.GRoot.inst.height);
  970. }
  971. this.setPivot(0.5, 0.5, false);
  972. }
  973. doShowAnimation() {
  974. if (!this.isEject)
  975. return;
  976. super.doShowAnimation();
  977. Laya.Tween.clearTween(this);
  978. this.scaleX = this.scaleY = 0.8;
  979. let tweenFunc1 = (func) => {
  980. Laya.Tween.to(this, { scaleX: 1.1, scaleY: 1.1 }, 100, Laya.Ease.linearIn, Laya.Handler.create(this, func));
  981. };
  982. let tweenFunc2 = (func) => {
  983. Laya.Tween.to(this, { scaleX: 1, scaleY: 1 }, 60, Laya.Ease.linearOut, Laya.Handler.create(this, this.refresh));
  984. };
  985. tweenFunc1(tweenFunc2);
  986. }
  987. show(...args) {
  988. super.show();
  989. this._openParam = args;
  990. this.isHide = false;
  991. xGame.uiMgr.checkUIState();
  992. }
  993. moveBannerButton() {
  994. }
  995. showBannerButton() {
  996. this.bannerButton.visible = true;
  997. Laya.Tween.to(this.bannerButton, { alpha: 1 }, 500, Laya.Ease.linearOut, Laya.Handler.create(this, () => {
  998. this.bannerButton.touchable = true;
  999. }));
  1000. }
  1001. hide() {
  1002. super.hide();
  1003. this.isHide = true;
  1004. xGame.uiMgr.checkUIState();
  1005. }
  1006. Dispose() {
  1007. super.dispose();
  1008. }
  1009. myUpdate(delay) {
  1010. }
  1011. refresh() { }
  1012. addUIClick(obj, func, arr = null) {
  1013. obj.onClick(this, func, arr);
  1014. obj.onClick(this, this.playBtnSound);
  1015. }
  1016. offUIClick(obj, func) {
  1017. obj.offClick(this, func);
  1018. }
  1019. playBtnSound() {
  1020. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  1021. }
  1022. }
  1023. UIBase.lastShowBanner = 0;
  1024. UIBase.showBannerNum = 0;
  1025. UIBase.uiName = "";
  1026. class ui_UIDraw extends fgui.GComponent {
  1027. static createInstance() {
  1028. return (fgui.UIPackage.createObject("game", "UIDraw"));
  1029. }
  1030. onConstruct() {
  1031. this.n1 = (this.getChild("n1"));
  1032. this.extraNode = (this.getChild("extraNode"));
  1033. this.myNode = (this.getChild("myNode"));
  1034. this.closeNode = (this.getChild("closeNode"));
  1035. this.moneyNode = (this.getChild("moneyNode"));
  1036. this.n38 = (this.getChild("n38"));
  1037. this.secretary = (this.getChild("secretary"));
  1038. this.drawBtn = (this.getChild("drawBtn"));
  1039. this.talkNode = (this.getChild("talkNode"));
  1040. this.t0 = this.getTransition("t0");
  1041. }
  1042. }
  1043. ui_UIDraw.URL = "ui://isxx5ak7wcn5v4ke";
  1044. class ui_UIBox extends fgui.GComponent {
  1045. static createInstance() {
  1046. return (fgui.UIPackage.createObject("game", "UIBox"));
  1047. }
  1048. onConstruct() {
  1049. this.n0 = (this.getChild("n0"));
  1050. this.n12 = (this.getChild("n12"));
  1051. this.n1 = (this.getChild("n1"));
  1052. this.n2 = (this.getChild("n2"));
  1053. this.bar = (this.getChild("bar"));
  1054. this.closeBtn = (this.getChild("closeBtn"));
  1055. this.openBtn = (this.getChild("openBtn"));
  1056. this.t0 = this.getTransition("t0");
  1057. this.t1 = this.getTransition("t1");
  1058. }
  1059. }
  1060. ui_UIBox.URL = "ui://isxx5ak7erstv4nm";
  1061. class UIBox extends UIBase {
  1062. constructor() {
  1063. super();
  1064. this.boxNum = 0;
  1065. this.boxMax = 10;
  1066. this.inAd = false;
  1067. this.isClose = false;
  1068. }
  1069. onConstructor() {
  1070. this.ui = ui_UIBox.createInstance();
  1071. this.contentPane = this.ui;
  1072. this.isEject = false;
  1073. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  1074. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  1075. Laya.timer.loop(1000, this, this.update);
  1076. }
  1077. update() {
  1078. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  1079. this.boxNum -= 1;
  1080. this.upBar();
  1081. }
  1082. }
  1083. upBar() {
  1084. if (this.boxNum > this.boxMax)
  1085. this.boxNum = this.boxMax;
  1086. this.ui.bar.value = this.boxNum * 10;
  1087. }
  1088. show() {
  1089. super.show();
  1090. this.isClose = false;
  1091. this.boxNum = 0;
  1092. this.inAd = false;
  1093. this.upBar();
  1094. this.ui.t0.play();
  1095. this.ui.closeBtn.visible = false;
  1096. Laya.timer.once(3000, this, () => {
  1097. this.ui.closeBtn.visible = true;
  1098. this.ui.bar.alpha = 1;
  1099. });
  1100. Laya.timer.once(500, this, () => {
  1101. this.ui.t1.play();
  1102. });
  1103. }
  1104. hide() {
  1105. Laya.timer.clearAll(this);
  1106. Moyu.showBannerAd(false);
  1107. super.hide();
  1108. }
  1109. onOpenBox() {
  1110. this.boxNum++;
  1111. if (this.boxNum < this.boxMax) {
  1112. if (PlatMgr.getRand() < PlatMgr.boxInsertRate)
  1113. Moyu.showInsertAd(0, PlatMgr.insertGap);
  1114. }
  1115. else if (this.boxNum == this.boxMax) {
  1116. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  1117. this.ui.openBtn.c1.selectedIndex = 13;
  1118. this.inAd = true;
  1119. }
  1120. else
  1121. this.getAward();
  1122. }
  1123. else if (this.inAd) {
  1124. Moyu.showVideoAd(() => {
  1125. this.getAward();
  1126. }, EAdType.box);
  1127. }
  1128. this.upBar();
  1129. }
  1130. onCloseBox() {
  1131. if (this.isClose)
  1132. this.hide();
  1133. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  1134. this.isClose = true;
  1135. PlatMgr.showBanner(true, 0, 3000);
  1136. }
  1137. else
  1138. this.hide();
  1139. }
  1140. getAward() {
  1141. let str = "";
  1142. if (Math.random() < 0.5) {
  1143. let max = Moyu.isLegal ? 500 : 2500;
  1144. let num = xGame.tools.random(max, 500 + max);
  1145. DataMgr.setCoin(num);
  1146. str = "金币x" + num;
  1147. }
  1148. else {
  1149. let max = Moyu.isLegal ? 10 : 30;
  1150. let num = xGame.tools.random(max, 30 + max);
  1151. DataMgr.setDiamond(num);
  1152. str = "钻石x" + num;
  1153. }
  1154. xGame.showTip("恭喜获得-" + str);
  1155. this.hide();
  1156. }
  1157. }
  1158. UIBox.uiName = "UIBox";
  1159. class ui_UITry extends fgui.GComponent {
  1160. static createInstance() {
  1161. return (fgui.UIPackage.createObject("game", "UITry"));
  1162. }
  1163. onConstruct() {
  1164. this.n11 = (this.getChild("n11"));
  1165. this.myNode = (this.getChild("myNode"));
  1166. this.t0 = this.getTransition("t0");
  1167. }
  1168. }
  1169. ui_UITry.URL = "ui://isxx5ak7cj92v4o4";
  1170. class UITry extends UIBase {
  1171. constructor() {
  1172. super();
  1173. this.closeTime = 0;
  1174. this.closeNum = 0;
  1175. this.skillUrl = xGame.common.skillIconList;
  1176. }
  1177. onConstructor() {
  1178. this.ui = ui_UITry.createInstance();
  1179. this.contentPane = this.ui;
  1180. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  1181. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  1182. }
  1183. show() {
  1184. super.show();
  1185. this.closeNum = 0;
  1186. this.closeTime = 15;
  1187. this.ui.t0.play();
  1188. PlatMgr.showRateBanner();
  1189. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1190. Laya.timer.loop(1000, this, this.updateTime);
  1191. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  1192. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  1193. xGame.common.gameMgr.gamePause = true;
  1194. }
  1195. updateTime() {
  1196. if (this.closeTime > 1) {
  1197. this.closeTime--;
  1198. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1199. }
  1200. else
  1201. this.hide();
  1202. }
  1203. hide() {
  1204. Laya.timer.clearAll(this);
  1205. Moyu.showBannerAd(false);
  1206. super.hide();
  1207. xGame.common.gameMgr.gamePause = false;
  1208. }
  1209. onTry() {
  1210. Moyu.showVideoAd(() => {
  1211. let select = xGame.common.curPlayerSkillType;
  1212. DataMgr.gameData.trySkill = select;
  1213. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  1214. DataMgr.saveGameData();
  1215. DataMgr.setBigSkill(select, 1);
  1216. xGame.showTip("Trial Successful");
  1217. this.hide();
  1218. }, EAdType.try);
  1219. }
  1220. onCancel() {
  1221. if (this.closeNum > 0) {
  1222. this.closeNum--;
  1223. if (this.closeNum < 2)
  1224. this.hide();
  1225. return;
  1226. }
  1227. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  1228. this.onTry();
  1229. }
  1230. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  1231. this.closeNum = 3;
  1232. }
  1233. else
  1234. this.hide();
  1235. }
  1236. }
  1237. UITry.uiName = "UITry";
  1238. class PlatMgr {
  1239. static initConfig() {
  1240. this.lastVt = 0;
  1241. if (!Moyu.platConfig)
  1242. return;
  1243. for (let k in Moyu.platConfig) {
  1244. let pd = this[k];
  1245. let pc = Moyu.platConfig[k];
  1246. if (pd != undefined && pc != undefined)
  1247. this[k] = pc;
  1248. }
  1249. Moyu.setBannerPos(0.5, 1);
  1250. }
  1251. static rand100(num) {
  1252. return xGame.tools.random(0, 100) < num;
  1253. }
  1254. static isMisVideo() {
  1255. let dt = Laya.timer.currTimer - this.lastVt;
  1256. if (dt > this.forceVideoGap && this.rand100(this.forceVideoRate)) {
  1257. this.lastVt = Laya.timer.currTimer;
  1258. return true;
  1259. }
  1260. else {
  1261. if (this.rand100(this.fullVideoRate))
  1262. Moyu.showInsertAd(0, 0, 'full');
  1263. return false;
  1264. }
  1265. }
  1266. static showVideo(call, type) {
  1267. Moyu.showVideoAd(() => {
  1268. this.lastVt = Laya.timer.currTimer;
  1269. call && call();
  1270. }, type);
  1271. }
  1272. static showInsert(delay = false) {
  1273. if (this.getRand() < this.insertRate) {
  1274. let dt = delay ? this.insertDelay : 0;
  1275. Moyu.showInsertAd(dt, this.insertGap);
  1276. }
  1277. }
  1278. static gameInsert() {
  1279. if (this.getRand() < this.gameInsertRate) {
  1280. Moyu.showInsertAd(xGame.tools.random(2000, 5100), this.insertGap);
  1281. }
  1282. }
  1283. static showRateBanner() {
  1284. if (this.getRand() < this.bannerRate)
  1285. this.showBanner(true, this.bannerDelay, 3000);
  1286. }
  1287. static showBanner(show, delay = 0, hide = 0) {
  1288. if (!show)
  1289. Moyu.showBannerAd(false);
  1290. else {
  1291. Laya.timer.clear(this, this.bannerShow);
  1292. if (delay > 0)
  1293. Laya.timer.once(delay, this, this.bannerShow, [true]);
  1294. else
  1295. this.bannerShow(true);
  1296. if (hide > 0)
  1297. Laya.timer.once(hide, this, this.bannerShow, [false]);
  1298. }
  1299. }
  1300. static bannerShow(show) {
  1301. Moyu.showBannerAd(show);
  1302. console.log("showBanner" + show);
  1303. }
  1304. static getRand() {
  1305. return xGame.tools.random(0, 100);
  1306. }
  1307. static openBox() {
  1308. if (this.getRand() < this.boxRate)
  1309. xGame.uiMgr.Show(UIBox);
  1310. }
  1311. static openTry() {
  1312. if (Laya.timer.currTimer < DataMgr.gameData.tryTime)
  1313. return;
  1314. if (this.getRand() < this.tryRate)
  1315. xGame.uiMgr.Show(UITry);
  1316. else if (DataMgr.gameData.gameCount == 1)
  1317. xGame.uiMgr.Show(UITry);
  1318. }
  1319. }
  1320. PlatMgr.forceShare = 0;
  1321. PlatMgr.signAdRate = 0;
  1322. PlatMgr.forceVideoRate = 0;
  1323. PlatMgr.forceVideoGap = 0;
  1324. PlatMgr.fullVideoRate = 0;
  1325. PlatMgr.gameInsertRate = 0;
  1326. PlatMgr.insertGap = 0;
  1327. PlatMgr.insertDelay = 0;
  1328. PlatMgr.insertRate = 0;
  1329. PlatMgr.boxRate = 0;
  1330. PlatMgr.boxVideoRate = 0;
  1331. PlatMgr.boxInsertRate = 0;
  1332. PlatMgr.boxBannerRate = 0;
  1333. PlatMgr.tryRate = 0;
  1334. PlatMgr.tryClose3Rate = 0;
  1335. PlatMgr.tryVideoRate = 0;
  1336. PlatMgr.bannerRate = 0;
  1337. PlatMgr.lastVt = 0;
  1338. class ui_UIAddProp extends fgui.GComponent {
  1339. static createInstance() {
  1340. return (fgui.UIPackage.createObject("game", "UIAddProp"));
  1341. }
  1342. onConstruct() {
  1343. this.n11 = (this.getChild("n11"));
  1344. this.myNode = (this.getChild("myNode"));
  1345. this.closeBtn = (this.getChild("closeBtn"));
  1346. this.t0 = this.getTransition("t0");
  1347. }
  1348. }
  1349. ui_UIAddProp.URL = "ui://isxx5ak7p4tr42k";
  1350. class SpineMgr {
  1351. constructor(name, loadCb = null) {
  1352. this.loaded = false;
  1353. this.spineName = '';
  1354. this.loadedCallback = loadCb;
  1355. this.templet = new Laya.Templet();
  1356. this.templet.on(Laya.Event.COMPLETE, this, this.parseComplete);
  1357. this.templet.on(Laya.Event.ERROR, this, this.onError);
  1358. if (name === 'mishu') {
  1359. this.templet.loadAni('spine/nvmishu.sk');
  1360. }
  1361. else {
  1362. this.templet.loadAni(`spine/${name}.sk`);
  1363. }
  1364. this.templet.lock = true;
  1365. this.spineName = name;
  1366. }
  1367. onError() {
  1368. console.log("zh:spine加载出错");
  1369. }
  1370. parseComplete() {
  1371. this.loaded = true;
  1372. this.loadedCallback && this.loadedCallback();
  1373. }
  1374. dispose() {
  1375. if (this.templet && !this.templet.destroyed) {
  1376. this.templet.destroy();
  1377. }
  1378. this.templet = null;
  1379. }
  1380. play(data, aniIndex, isLoop = true, parent, callback, mySpine = null) {
  1381. if (!this.loaded) {
  1382. return;
  1383. }
  1384. let spine;
  1385. if (mySpine) {
  1386. spine = mySpine;
  1387. }
  1388. else {
  1389. spine = this.createSpine(data, parent);
  1390. }
  1391. spine.play(aniIndex, isLoop, true, 0, 0, true);
  1392. if (!isLoop) {
  1393. spine.on(Laya.Event.STOPPED, this, () => {
  1394. spine.offAll(Laya.Event.STOPPED);
  1395. callback && callback(spine);
  1396. });
  1397. }
  1398. return spine;
  1399. }
  1400. createSpine(data, parent, type = 1) {
  1401. let spine;
  1402. spine = this.templet.buildArmature(type);
  1403. spine.showSkinByIndex(0);
  1404. parent.addChild(spine);
  1405. spine.pos(data.x, data.y);
  1406. spine.scale(data.scaleX, data.scaleY, true);
  1407. return spine;
  1408. }
  1409. }
  1410. var AIState;
  1411. (function (AIState) {
  1412. AIState[AIState["none"] = 0] = "none";
  1413. AIState[AIState["idle"] = 1] = "idle";
  1414. AIState[AIState["reset"] = 2] = "reset";
  1415. AIState[AIState["move"] = 3] = "move";
  1416. AIState[AIState["wait"] = 4] = "wait";
  1417. AIState[AIState["select"] = 5] = "select";
  1418. AIState[AIState["turn"] = 6] = "turn";
  1419. AIState[AIState["shoot"] = 7] = "shoot";
  1420. AIState[AIState["leave"] = 8] = "leave";
  1421. })(AIState || (AIState = {}));
  1422. class AIPlayer {
  1423. constructor() {
  1424. this.dtime = 30;
  1425. this.awayTime = 0;
  1426. this.awayNum = 0;
  1427. this.hideTime = 0;
  1428. this.rootMoveTime = 0;
  1429. this.isGuide = false;
  1430. this.state = AIState.none;
  1431. this.waitTime = 0;
  1432. this.forceNum = 0;
  1433. this.forceMax = 0;
  1434. this.ballSize = 33;
  1435. this.selectNum = 0;
  1436. this.destRot = 0;
  1437. this.aiLv = 10;
  1438. this.kickBall = [];
  1439. this.lineBall = [];
  1440. this.scoreBall = [];
  1441. this.holeBall = [];
  1442. this.turnNum = 0;
  1443. this.setNum = 0;
  1444. this.setMax = 0;
  1445. this.setRate = 0;
  1446. this.rectL = 0;
  1447. this.rectR = 0;
  1448. this.rectT = 0;
  1449. this.rectB = 0;
  1450. this.rootPos = { x: 0, y: 0 };
  1451. this.bestForce = 0;
  1452. this.bestAngle = 180;
  1453. this.bestPos = { x: 0, y: 0 };
  1454. this.bestKick = { x: 0, y: 0 };
  1455. this.posList = [];
  1456. this.posIdx = 0;
  1457. this.chatTime = 3000;
  1458. this.tempDir1 = new Laya.Vector2();
  1459. this.tempDir2 = new Laya.Vector2();
  1460. this.tempDir3 = new Laya.Vector2();
  1461. Laya.timer.loop(this.dtime, this, this.onUpdate);
  1462. xGame.eventMgr.off(RESET_GAME, this, this.resetAI);
  1463. xGame.eventMgr.on(RESET_GAME, this, this.resetAI);
  1464. this.gameSrc = xGame.common.gameUI;
  1465. this.hideTime = Laya.timer.currTimer;
  1466. Moyu.setOnTipCall((id) => {
  1467. if (id == 20012)
  1468. this.hideTime = Laya.timer.currTimer;
  1469. else
  1470. (id == 20011);
  1471. {
  1472. let dt = Laya.timer.currTimer - this.hideTime;
  1473. console.log("onshow" + dt);
  1474. if (dt > 30000 && this.state > AIState.none)
  1475. xGame.common.gameMgr.aiGameEnd(false);
  1476. }
  1477. }, this);
  1478. }
  1479. init() {
  1480. this.isGuide = DataMgr.getSkillGuide() < 1 || DataMgr.gameData.gameCount < 1;
  1481. this.awayTime = xGame.tools.random(5000, 10000);
  1482. this.awayNum = 0;
  1483. this.hideTime = Laya.timer.currTimer;
  1484. let rect = xGame.common.d2World.borderRect;
  1485. this.rectL = Math.ceil(rect.x) + 17;
  1486. this.rectT = Math.ceil(rect.y) + 17;
  1487. this.rectR = Math.floor(rect.x + rect.width) - 17;
  1488. this.rectB = Math.floor(rect.y + rect.height) - 17;
  1489. this.wBall = xGame.common.d2World.rootBall;
  1490. this.ballSize = this.wBall.gameObj.width - 1;
  1491. if (this.posList.length < 1) {
  1492. let dp = 40;
  1493. for (let i = this.rectL; i < this.rectR + dp; i = i + dp) {
  1494. for (let j = this.rectT; j < this.rectB + dp; j = j + dp) {
  1495. let dx = i < this.rectR ? i : this.rectR;
  1496. let dy = j < this.rectB ? j : this.rectB;
  1497. let order = xGame.tools.random(0, 1000);
  1498. this.posList.push({ x: dx, y: dy, order: order });
  1499. }
  1500. }
  1501. this.posList.sort(function (a, b) {
  1502. return a.order - b.order;
  1503. });
  1504. this.setMax = this.posList.length;
  1505. }
  1506. this.state = AIState.idle;
  1507. }
  1508. setAiLevel(num) {
  1509. this.aiLv = num;
  1510. }
  1511. initBall() {
  1512. this.rootPos.x = this.wBall.gameObj.x;
  1513. this.rootPos.y = this.wBall.gameObj.y;
  1514. this.initHoleBall();
  1515. }
  1516. initHoleBall() {
  1517. this.kickBall = [];
  1518. this.lineBall = [];
  1519. this.scoreBall = [];
  1520. this.holeBall = [];
  1521. this.selectNum = 0;
  1522. this.forceNum = 0;
  1523. this.forceMax = 0;
  1524. this.turnNum = 0;
  1525. let list = xGame.common.d2World.ballArr;
  1526. if (list.length < 20 && !this.isGuide) {
  1527. let holes = xGame.common.gameMgr.holePosList;
  1528. for (let i = 0; i < list.length; i++) {
  1529. let obj = list[i];
  1530. if (!obj)
  1531. continue;
  1532. obj.kickPos.x = 0;
  1533. obj.kickPos.y = 0;
  1534. obj.poleAngle = 0;
  1535. obj.hard = 0;
  1536. obj.borderDis = 0;
  1537. obj.kickAngle = 180;
  1538. if (obj.number == 0)
  1539. continue;
  1540. if (obj.ballType == xGame.common.gameMgr.selfCamp)
  1541. continue;
  1542. if (obj.number == 8 && xGame.common.gameMode == 0) {
  1543. if (xGame.common.gameMgr.aiBallArr.length > 0 || !xGame.common.gameMgr.ensureBallType)
  1544. continue;
  1545. }
  1546. let b = obj.gameObj;
  1547. let wbp = this.rootPos;
  1548. let bx = wbp.x - b.x;
  1549. let by = wbp.y - b.y;
  1550. obj.borderDis = xGame.tools.random(0, 100);
  1551. this.kickBall.push(obj);
  1552. if (!this.isLine(wbp, obj))
  1553. continue;
  1554. obj.kickAngle = xGame.tools.random(90, 180);
  1555. obj.kickPos.x = b.x;
  1556. obj.kickPos.y = b.y;
  1557. this.lineBall.push(obj);
  1558. let minDis = 999999;
  1559. let hole = false;
  1560. for (let j = 0; j < holes.length; j++) {
  1561. let hp = holes[j];
  1562. if (bx >= 0 && hp.x > b.x + 100)
  1563. continue;
  1564. if (bx <= 0 && hp.x < b.x - 100)
  1565. continue;
  1566. if (by < -10 && hp.y < wbp.y)
  1567. continue;
  1568. if (by > 10 && hp.y > wbp.y)
  1569. continue;
  1570. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  1571. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  1572. if (dis < minDis) {
  1573. let dx = b.x - this.tempDir1.x * this.ballSize;
  1574. let dy = b.y - this.tempDir1.y * this.ballSize;
  1575. this.tempDir3.x = this.tempDir1.x;
  1576. this.tempDir3.y = this.tempDir1.y;
  1577. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  1578. obj.kickPos.x = dx;
  1579. obj.kickPos.y = dy;
  1580. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  1581. if (num > 1)
  1582. num = 1;
  1583. obj.kickAngle = Math.acos(num) * 57.3;
  1584. if (b.x < this.rectL + 2 || b.x > this.rectR - 2 || b.y < this.rectT + 2 || b.y > this.rectB - 2)
  1585. dis = dis * 2;
  1586. if (Math.abs(hp.x - 600) < 100)
  1587. dis += 50;
  1588. obj.hard = dis + obj.kickAngle * 3;
  1589. hole = true;
  1590. }
  1591. }
  1592. }
  1593. }
  1594. if (hole) {
  1595. this.scoreBall.push(obj);
  1596. this.holeBall.push(obj);
  1597. }
  1598. }
  1599. this.scoreBall.sort(function (a, b) {
  1600. return a.hard - b.hard;
  1601. });
  1602. this.holeBall.sort(function (a, b) {
  1603. return a.kickAngle - b.kickAngle;
  1604. });
  1605. this.kickBall.sort(function (a, b) {
  1606. return a.borderDis - b.borderDis;
  1607. });
  1608. }
  1609. else {
  1610. let max = list.length - 1;
  1611. let i = xGame.tools.random(0, max);
  1612. for (i; i <= max; i++) {
  1613. let idx = i >= max ? i -= max : i;
  1614. let obj = list[idx];
  1615. if (obj && obj.number != 0) {
  1616. obj.kickAngle = xGame.tools.random(90, 180);
  1617. obj.kickPos.x = obj.gameObj.x + xGame.tools.random(-10, 10);
  1618. obj.kickPos.y = obj.gameObj.y + xGame.tools.random(-10, 10);
  1619. this.lineBall.push(obj);
  1620. break;
  1621. }
  1622. }
  1623. }
  1624. }
  1625. selectBall() {
  1626. let ball = null;
  1627. this.destRot = 0;
  1628. let max = this.isGuide ? 1 : 3 - Math.ceil(this.aiLv / 4) + xGame.tools.random(0, 2);
  1629. let ai = 110 - this.aiLv * 10;
  1630. let mis = xGame.tools.random(-ai, ai) * 0.005;
  1631. let score = false;
  1632. if (this.scoreBall.length < 1) {
  1633. if (this.lineBall.length < 1) {
  1634. for (let i = 0; i < this.kickBall.length; i++) {
  1635. let list = [];
  1636. let bo = this.kickBall[i];
  1637. let bobj = bo.gameObj;
  1638. let rect = xGame.common.d2World.borderRect;
  1639. let mobj = this.wBall.gameObj;
  1640. let minb = bobj.y - rect.y - 20;
  1641. let minw = mobj.y - rect.y - 50;
  1642. if (minb > 0 && minw > 0) {
  1643. let dlenx = 0;
  1644. let dleny = mobj.y - rect.y;
  1645. let spx = mobj.x;
  1646. let spy = rect.y - dleny;
  1647. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1648. }
  1649. minb = rect.y + rect.height - bobj.y - 20;
  1650. minw = rect.y + rect.height - mobj.y - 50;
  1651. if (minb > 0 && minw > 0) {
  1652. let dlenx = 0;
  1653. let dleny = rect.y + rect.height - mobj.y;
  1654. let spx = mobj.x;
  1655. let spy = rect.y + rect.height + dleny;
  1656. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1657. }
  1658. minb = bobj.x - rect.x - 20;
  1659. minw = mobj.x - rect.x - 50;
  1660. if (minb > 0 && minw > 0) {
  1661. let dlenx = mobj.x - rect.x;
  1662. let dleny = 0;
  1663. let spx = rect.x - dlenx;
  1664. let spy = mobj.y;
  1665. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1666. }
  1667. minb = rect.x + rect.width - bobj.x - 20;
  1668. minw = rect.x + rect.width - mobj.x - 50;
  1669. if (minb > 0 && minw > 0) {
  1670. let dlenx = rect.x + rect.width - mobj.x;
  1671. let dleny = 0;
  1672. let spx = rect.x + rect.width + dlenx;
  1673. let spy = mobj.y;
  1674. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1675. }
  1676. list.sort(function (a, b) {
  1677. return a.order - b.order;
  1678. });
  1679. for (let i = 0; i < list.length; i++) {
  1680. let data = list[i];
  1681. let mx = mobj.x - bobj.x;
  1682. let my = mobj.y - bobj.y;
  1683. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  1684. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  1685. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1686. if (num > 1)
  1687. num = 1;
  1688. let cos = Math.acos(num);
  1689. if (cos > 1.57)
  1690. cos = 1.57;
  1691. else if (cos < 0.01)
  1692. cos = 0.01;
  1693. let tan = Math.tan(cos);
  1694. let dx = tan * data.dleny;
  1695. let dy = tan * data.dlenx;
  1696. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  1697. if (Math.abs(bx - 667) < 40)
  1698. continue;
  1699. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  1700. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  1701. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  1702. this.forceMax = dis * 0.08;
  1703. this.destRot += mis * 0.1;
  1704. this.setKick(bx, by);
  1705. return true;
  1706. }
  1707. }
  1708. }
  1709. }
  1710. else {
  1711. ball = xGame.common.getRandArrEle(this.lineBall);
  1712. }
  1713. }
  1714. else {
  1715. for (let i = 0; i < this.scoreBall.length; i++) {
  1716. if (i < this.scoreBall.length - 1) {
  1717. let rand = 70 + this.aiLv * 10 + i * 10;
  1718. if (xGame.tools.random(0, 100) < rand) {
  1719. ball = this.scoreBall[i];
  1720. break;
  1721. }
  1722. }
  1723. else {
  1724. ball = this.scoreBall[i];
  1725. break;
  1726. }
  1727. }
  1728. score = true;
  1729. this.selectNum++;
  1730. }
  1731. if (!ball)
  1732. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  1733. if (this.selectNum >= max) {
  1734. let dx = ball.gameObj.x;
  1735. let dy = ball.gameObj.y;
  1736. let kickAngle = 0;
  1737. if (score) {
  1738. dx = ball.kickPos.x;
  1739. dy = ball.kickPos.y;
  1740. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  1741. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  1742. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  1743. if (adot > 1)
  1744. adot = 1;
  1745. kickAngle = Math.acos(adot) * 57.3;
  1746. if (kickAngle > 45) {
  1747. let kdx = ball.kickPos.x - ball.gameObj.x;
  1748. let kdy = ball.kickPos.y - ball.gameObj.y;
  1749. dx = ball.kickPos.x - kdx * mis * 0.3;
  1750. dy = ball.kickPos.y - kdy * mis * 0.3;
  1751. }
  1752. else
  1753. this.destRot += mis;
  1754. }
  1755. else if (ball.poleAngle != 0) {
  1756. this.destRot += ball.poleAngle;
  1757. }
  1758. if (xGame.common.gameMode == 0) {
  1759. let af = kickAngle * 0.08;
  1760. this.forceMax = ball.hard * 0.1 + af * af;
  1761. }
  1762. this.setKick(dx, dy);
  1763. }
  1764. else {
  1765. let rand = this.aiLv * 5 + 40;
  1766. if (xGame.tools.random(0, 100) < rand && this.scoreBall.length > 0)
  1767. ball = xGame.common.getRandArrEle(this.scoreBall);
  1768. else
  1769. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  1770. rand = this.aiLv * 3 + 40 + this.selectNum * 20;
  1771. if (xGame.tools.random(0, 100) > rand) {
  1772. this.selectNum = max;
  1773. }
  1774. this.setState(AIState.select, xGame.tools.random(500, 1000));
  1775. this.selectNum++;
  1776. }
  1777. ball.onClick(0, true);
  1778. }
  1779. isBlock(bn, bx, by, hx, hy, dn = -1) {
  1780. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  1781. let balls = xGame.common.d2World.ballArr;
  1782. let max = xGame.tools.getDis(hx, hy, bx, by);
  1783. for (let index = 0; index < balls.length; index++) {
  1784. let obj = balls[index];
  1785. if (obj.number == 0)
  1786. continue;
  1787. if (obj.number == bn || obj.number == dn)
  1788. continue;
  1789. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  1790. if (dis * dis > max)
  1791. continue;
  1792. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  1793. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1794. if (num > 1)
  1795. num = 1;
  1796. if (num < 0)
  1797. continue;
  1798. let gap = Math.sin(Math.acos(num)) * dis;
  1799. if (gap < this.ballSize)
  1800. return true;
  1801. }
  1802. return false;
  1803. }
  1804. isLine(xy, ball) {
  1805. let bx = xy.x;
  1806. let by = xy.y;
  1807. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  1808. let dis = ball.getDestDis(xy);
  1809. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  1810. let sin = Math.sin(angle);
  1811. let cos = Math.cos(angle);
  1812. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  1813. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  1814. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  1815. let dx = bx + this.tempDir2.x * dis;
  1816. let dy = by + this.tempDir2.y * dis;
  1817. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  1818. sin = Math.sin(-angle);
  1819. cos = Math.cos(-angle);
  1820. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  1821. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  1822. dx = bx + this.tempDir2.x * dis;
  1823. dy = by + this.tempDir2.y * dis;
  1824. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  1825. if (isr && isl)
  1826. return false;
  1827. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  1828. }
  1829. return true;
  1830. }
  1831. turnPole() {
  1832. this.turnNum++;
  1833. let rot = xGame.common.d2World.d2Gan.ui.rotation % 360;
  1834. let dr = rot - this.destRot;
  1835. let abs = Math.abs(dr) % 360;
  1836. if (abs > 180) {
  1837. if (rot > 180)
  1838. rot -= 360;
  1839. if (this.destRot > 180)
  1840. this.destRot -= 360;
  1841. }
  1842. let max = this.turnNum * 5 + this.aiLv * 5;
  1843. if (abs < 0.2 && xGame.tools.random(0, 100) < max) {
  1844. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  1845. let at = xGame.tools.random(1000, 2000);
  1846. if (!this.onAway(3))
  1847. at += xGame.tools.random(10000, 15000);
  1848. this.setState(AIState.shoot, at);
  1849. }
  1850. else {
  1851. let mr = 0;
  1852. if (abs > 3)
  1853. mr = 1 + xGame.tools.random(2, 6) * abs * 0.01;
  1854. else if (Math.random() > 0.6)
  1855. mr = xGame.tools.random(1, 10) * 0.1;
  1856. mr = dr > 0 ? -mr : mr;
  1857. xGame.common.d2World.d2Gan.rotDest(rot + mr);
  1858. }
  1859. }
  1860. setKick(dx, dy) {
  1861. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  1862. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  1863. this.tempDir1.x = 0;
  1864. this.tempDir1.y = 1;
  1865. this.tempDir2.y = -this.tempDir2.y;
  1866. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1867. if (num > 1)
  1868. num = 1;
  1869. let rot = Math.acos(num) * 57.3;
  1870. if (this.tempDir2.x < 0)
  1871. rot = 360 - rot;
  1872. this.destRot += rot;
  1873. if (!xGame.common.gameMgr.finishOneShoot) {
  1874. this.forceMax += xGame.tools.random(10, 50);
  1875. this.forceMax -= this.aiLv * 2;
  1876. if (this.forceMax < 20)
  1877. this.forceMax = 20;
  1878. }
  1879. if (this.forceMax > 100)
  1880. this.forceMax = 101;
  1881. else if (this.forceMax < 10)
  1882. this.forceMax += xGame.tools.random(0, 10);
  1883. if (xGame.common.gameMode == 1)
  1884. this.forceMax = xGame.tools.random(80, 100);
  1885. else
  1886. this.forceMax = xGame.tools.random(this.forceMax * 0.5, this.forceMax);
  1887. let max = 2000 - this.aiLv * 100;
  1888. if (Math.random() > 0.8)
  1889. max += xGame.tools.random(100, 2000);
  1890. this.setState(AIState.turn, xGame.tools.random(500, max));
  1891. }
  1892. shoot() {
  1893. if (this.waitTime < 0 && Math.abs(this.forceNum - this.forceMax) < 4) {
  1894. if (Math.random() > 0.8) {
  1895. this.gameSrc.aiForce(1);
  1896. this.setState(AIState.wait);
  1897. }
  1898. }
  1899. else {
  1900. let df = xGame.tools.random(3, 8);
  1901. if (this.forceNum < this.forceMax)
  1902. this.forceNum += df;
  1903. else
  1904. this.forceNum -= df;
  1905. let startY = this.gameSrc.ui.powerNode.y;
  1906. let height = this.gameSrc.ui.powerNode.height;
  1907. let force = startY + height * this.forceNum * 0.01;
  1908. this.gameSrc.aiForce(2, force);
  1909. }
  1910. }
  1911. reset() {
  1912. for (let i = 0; i < 4; i++) {
  1913. this.setRate--;
  1914. this.setNum++;
  1915. let pos = this.posList[this.posIdx];
  1916. this.rootPos.x = pos.x + xGame.tools.random(-20, 20);
  1917. this.rootPos.y = pos.y + xGame.tools.random(-20, 20);
  1918. if (!xGame.common.gameMgr.isTouchedBall && this.rootPos.x > 387)
  1919. this.rootPos.x = 387;
  1920. if (this.rootPos.x < this.rectL)
  1921. this.rootPos.x = this.rectL;
  1922. else if (this.rootPos.x > this.rectR)
  1923. this.rootPos.x = this.rectR;
  1924. if (this.rootPos.y < this.rectT)
  1925. this.rootPos.y = this.rectT;
  1926. else if (this.rootPos.y > this.rectB)
  1927. this.rootPos.y = this.rectB;
  1928. this.posIdx++;
  1929. let max = this.posList.length;
  1930. if (this.posIdx >= max)
  1931. this.posIdx -= max;
  1932. this.initHoleBall();
  1933. let ball = null;
  1934. if (this.scoreBall.length > 0)
  1935. ball = this.scoreBall[0];
  1936. else if (this.lineBall.length > 0)
  1937. ball = xGame.common.getRandArrEle(this.lineBall);
  1938. if (ball && ball.kickAngle < this.bestAngle) {
  1939. this.bestAngle = ball.kickAngle;
  1940. this.bestKick.x = ball.kickPos.x;
  1941. this.bestKick.y = ball.kickPos.y;
  1942. this.bestPos.x = this.rootPos.x;
  1943. this.bestPos.y = this.rootPos.y;
  1944. this.bestForce = ball.hard * 0.08;
  1945. }
  1946. }
  1947. if (this.setNum >= this.setMax)
  1948. this.setMax = 0;
  1949. if (this.setRate < 1) {
  1950. this.setState(AIState.move, 0);
  1951. this.rootMoveTime = Laya.timer.currTimer;
  1952. this.gameSrc.aiRootMove(true);
  1953. }
  1954. }
  1955. delayLine() {
  1956. this.gameSrc.aiRootMove(false);
  1957. }
  1958. move() {
  1959. if (this.bestPos.x < 1)
  1960. this.bestPos = this.rootPos;
  1961. let wObj = this.wBall.gameObj;
  1962. let destx = wObj.x;
  1963. let desty = wObj.y;
  1964. let dx = Math.abs(destx - this.bestPos.x);
  1965. let dy = Math.abs(desty - this.bestPos.y);
  1966. let mx = 3 + dx * 0.03;
  1967. let my = 3 + dy * 0.03;
  1968. if (dx < 4 && dy < 4) {
  1969. let dt = Laya.timer.currTimer - this.rootMoveTime;
  1970. dt = dt < 1000 ? 1000 - dt : 0;
  1971. if (this.setMax > 0) {
  1972. let min = this.setMax * 0.3 + this.aiLv * 5;
  1973. this.setRate = xGame.tools.random(min, this.setMax);
  1974. this.setState(AIState.reset, 0);
  1975. }
  1976. else {
  1977. this.destRot = 0;
  1978. this.forceMax = this.bestForce;
  1979. this.setKick(this.bestKick.x, this.bestKick.y);
  1980. }
  1981. if (dt > 100) {
  1982. Laya.timer.clear(this, this.delayLine);
  1983. Laya.timer.once(dt, this, this.delayLine);
  1984. }
  1985. else
  1986. this.gameSrc.aiRootMove(false);
  1987. }
  1988. else {
  1989. if (dx > 4)
  1990. destx = wObj.x < this.bestPos.x ? wObj.x + mx : wObj.x - mx;
  1991. if (dy > 4)
  1992. desty = wObj.y < this.bestPos.y ? wObj.y + my : wObj.y - my;
  1993. this.gameSrc.onRootMove({ x: destx, y: desty });
  1994. }
  1995. }
  1996. resetRoot() {
  1997. this.bestAngle = 180;
  1998. this.bestForce = 0;
  1999. this.setMax = this.posList.length;
  2000. this.posIdx = xGame.tools.random(0, this.setMax);
  2001. let min = this.setMax * 0.3 + this.aiLv * 5;
  2002. this.setRate = xGame.tools.random(min, this.setMax);
  2003. let max = 2000 - this.aiLv * 100;
  2004. if (Math.random() > 0.8)
  2005. max += xGame.tools.random(100, 1000);
  2006. if (this.isGuide)
  2007. this.setState(AIState.select, 500);
  2008. else if (this.onAway(2))
  2009. this.setState(AIState.reset, xGame.tools.random(400, max));
  2010. else
  2011. this.setState(AIState.none);
  2012. if (xGame.common.gameMgr.finishOneShoot)
  2013. this.chat();
  2014. }
  2015. runAI() {
  2016. if (this.state > AIState.idle)
  2017. return;
  2018. this.initBall();
  2019. this.onGame(2500);
  2020. if (Math.random() > 0.6)
  2021. this.chat();
  2022. }
  2023. stopRun() {
  2024. this.setState(AIState.idle);
  2025. }
  2026. onGame(base) {
  2027. let max = base - this.aiLv * 100;
  2028. if (Math.random() > 0.8)
  2029. max += xGame.tools.random(100, 1000);
  2030. if (this.onAway(2))
  2031. this.setState(AIState.select, xGame.tools.random(500, max));
  2032. else
  2033. this.setState(AIState.none);
  2034. }
  2035. setState(sta, wt = 0) {
  2036. if (this.state == AIState.none)
  2037. return;
  2038. this.state = sta;
  2039. this.waitTime = wt;
  2040. }
  2041. onUpdate() {
  2042. if (this.state == AIState.none)
  2043. return;
  2044. this.awayTime -= this.dtime;
  2045. if (this.awayTime < 1) {
  2046. this.awayTime = xGame.tools.random(6000, 10000);
  2047. this.awayNum += (11 - this.aiLv);
  2048. this.onAway(1);
  2049. }
  2050. if (this.waitTime >= 0) {
  2051. this.waitTime -= this.dtime;
  2052. return;
  2053. }
  2054. switch (this.state) {
  2055. case AIState.idle:
  2056. this.chat();
  2057. break;
  2058. case AIState.reset:
  2059. this.reset();
  2060. break;
  2061. case AIState.move:
  2062. this.move();
  2063. break;
  2064. case AIState.leave:
  2065. this.state = AIState.none;
  2066. xGame.common.gameMgr.aiGameEnd(true);
  2067. break;
  2068. case AIState.select:
  2069. this.selectBall();
  2070. break;
  2071. case AIState.turn:
  2072. this.turnPole();
  2073. break;
  2074. case AIState.shoot:
  2075. this.shoot();
  2076. break;
  2077. }
  2078. }
  2079. onAway(type) {
  2080. if (type == 1) {
  2081. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2082. let num = this.awayNum + db * 20;
  2083. if (db > 0 && num > 0 && xGame.tools.random(0, 10000) < num && this.state == AIState.idle) {
  2084. xGame.common.gameMgr.aiLeave();
  2085. this.setState(AIState.leave, 6666);
  2086. }
  2087. }
  2088. else if (type == 2) {
  2089. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2090. let num = this.awayNum + db * 30;
  2091. if (xGame.tools.random(0, 10000) < num)
  2092. return false;
  2093. }
  2094. else if (type == 3) {
  2095. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2096. let num = this.awayNum + db * 10;
  2097. if (xGame.tools.random(0, 4000) < num)
  2098. return false;
  2099. }
  2100. return true;
  2101. }
  2102. chat() {
  2103. if (this.chatTime > 0) {
  2104. this.chatTime -= this.dtime;
  2105. return;
  2106. }
  2107. this.chatTime = xGame.tools.random(2000, 10000);
  2108. let rand = xGame.tools.random(0, 100);
  2109. if (rand < 15)
  2110. this.talk();
  2111. else if (rand < 35)
  2112. this.emotion();
  2113. }
  2114. talk() {
  2115. xGame.common.talkMgr.showAITalk(0);
  2116. }
  2117. emotion() {
  2118. xGame.common.talkMgr.showAIEmotion(0);
  2119. }
  2120. resetAI() {
  2121. this.stopRun();
  2122. this.state = AIState.none;
  2123. }
  2124. }
  2125. class Partical extends Laya.Script3D {
  2126. constructor() {
  2127. super();
  2128. this.duration = 2000;
  2129. }
  2130. ;
  2131. onAwake() {
  2132. this.gameObj = this.owner;
  2133. }
  2134. onEnable() {
  2135. this.openTimer();
  2136. }
  2137. openTimer() {
  2138. Laya.timer.once(this.duration, this, this.disappear);
  2139. }
  2140. setCallback(obj, callback) {
  2141. this.obj = obj;
  2142. this.callback = callback;
  2143. Laya.timer.clearAll(this);
  2144. Laya.timer.once(this.duration, this, this.disappear);
  2145. }
  2146. disappear() {
  2147. xGame.poolD3Mgr.putItem(this.gameObj.name, this.gameObj);
  2148. this.callback && this.callback(this.obj);
  2149. }
  2150. }
  2151. class Ball extends Laya.Script3D {
  2152. constructor() {
  2153. super();
  2154. this.posV3 = new Laya.Vector3();
  2155. this.rotRate = 2.1;
  2156. this.rotSpeed = new Laya.Vector3();
  2157. this.myIndex = 0;
  2158. }
  2159. onAwake() {
  2160. this.gameObj = this.owner;
  2161. this.transform = this.gameObj.transform;
  2162. this.ballNode = this.gameObj.getChildByName("Ball");
  2163. this.shadowNode = this.gameObj.getChildByName("shadow");
  2164. }
  2165. initSelf(index, x, y, owner) {
  2166. this.d2BallSrc = owner;
  2167. this.myIndex = index;
  2168. this.setAlbedoTexture();
  2169. this.setTransPos(x, y);
  2170. this.setScale();
  2171. this.ballNode.transform.localRotationEulerX = 90;
  2172. if (index == 0) {
  2173. }
  2174. }
  2175. setAlbedoTexture(isIce = false) {
  2176. let url;
  2177. if (isIce) {
  2178. url = `res/d3Res/ballTexture/ice.jpg`;
  2179. }
  2180. else {
  2181. url = `res/d3Res/ballTexture/ball${this.myIndex}.png`;
  2182. }
  2183. Laya.Texture2D.load(url, Laya.Handler.create(this, (tex) => {
  2184. this.ballNode.meshRenderer.material["albedoTexture"] = tex;
  2185. }));
  2186. }
  2187. runFireworks(obj, delay, callback) {
  2188. Laya.timer.clearAll(this);
  2189. Laya.timer.once(delay + 1, this, () => {
  2190. let fire = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  2191. fire.transform.localPositionX = this.transform.localPositionX;
  2192. fire.transform.localPositionY = this.transform.localPositionY;
  2193. fire.transform.localPositionZ = this.transform.localPositionZ;
  2194. let src = fire.getComponent(Partical);
  2195. src.duration = 1000;
  2196. src.setCallback(obj, callback);
  2197. let eft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  2198. eft.transform.localPositionX = this.transform.localPositionX;
  2199. eft.transform.localPositionY = this.transform.localPositionY;
  2200. eft.transform.localPositionZ = this.transform.localPositionZ;
  2201. });
  2202. }
  2203. setTransPos(x, y) {
  2204. this.setRotation();
  2205. xGame.common.pos2to3Convert(x, y, this.posV3);
  2206. this.transform.localPositionX = this.posV3.x;
  2207. this.transform.localPositionY = 0;
  2208. this.transform.localPositionZ = this.posV3.z;
  2209. this.transform.localRotationEulerX = 0;
  2210. this.transform.localRotationEulerY = 0;
  2211. this.transform.localRotationEulerZ = 0;
  2212. this.shadowNode.transform.localPositionX = this.posV3.x / 30;
  2213. this.shadowNode.transform.localPositionY = 0.1;
  2214. this.shadowNode.transform.localPositionZ = this.posV3.z / 30;
  2215. }
  2216. setRotation() {
  2217. if (this.d2BallSrc.canRot) {
  2218. let speed = this.d2BallSrc.rigy.linearVelocity;
  2219. this.rotSpeed.x = speed.x * this.rotRate;
  2220. this.rotSpeed.z = speed.y * this.rotRate;
  2221. this.rotSpeed.y = this.d2BallSrc.rotY;
  2222. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2223. }
  2224. else if (Math.abs(this.d2BallSrc.rotY) > 0.1) {
  2225. this.rotSpeed.x = this.rotSpeed.y = 0;
  2226. this.rotSpeed.y = this.d2BallSrc.rotY;
  2227. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2228. }
  2229. }
  2230. setScale() {
  2231. let radius = xGame.common.d2World.rootBall.ui.width;
  2232. let scale = xGame.common.scale2to3Convert(radius);
  2233. this.transform.localScaleX = scale;
  2234. this.transform.localScaleY = scale;
  2235. this.transform.localScaleZ = scale;
  2236. }
  2237. playInHoleEft() {
  2238. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  2239. eft.transform.position = this.transform.position;
  2240. }
  2241. playIceEft() {
  2242. let eft = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  2243. eft.transform.position = this.transform.position;
  2244. }
  2245. get scaleXYZ() {
  2246. return this.transform.localScaleX;
  2247. }
  2248. set scaleXYZ(val) {
  2249. this.transform.localScaleX = val;
  2250. this.transform.localScaleY = val;
  2251. this.transform.localScaleZ = val;
  2252. }
  2253. get posX() {
  2254. return this.transform.localPositionX;
  2255. }
  2256. set posX(val) {
  2257. this.transform.localPositionX = val;
  2258. }
  2259. get posY() {
  2260. return this.transform.localPositionY;
  2261. }
  2262. set posY(val) {
  2263. this.transform.localPositionY = val;
  2264. }
  2265. get posZ() {
  2266. return this.transform.localPositionZ;
  2267. }
  2268. set posZ(val) {
  2269. this.transform.localPositionZ = val;
  2270. }
  2271. destroySelf() {
  2272. this.posV3 = null;
  2273. this.rotSpeed = null;
  2274. this.d2BallSrc = null;
  2275. this.ballNode = null;
  2276. this.gameObj.destroy(true);
  2277. this.transform = null;
  2278. this.destroy();
  2279. }
  2280. }
  2281. class ui_D2Ball extends fgui.GComponent {
  2282. static createInstance() {
  2283. return (fgui.UIPackage.createObject("game", "D2Ball"));
  2284. }
  2285. onConstruct() {
  2286. this.myIcon = (this.getChild("myIcon"));
  2287. this.inner = (this.getChild("inner"));
  2288. this.n8 = (this.getChild("n8"));
  2289. this.n4 = (this.getChild("n4"));
  2290. this.wrongTips = (this.getChild("wrongTips"));
  2291. this.rightTips = (this.getChild("rightTips"));
  2292. this.breathAni = this.getTransition("breathAni");
  2293. }
  2294. }
  2295. ui_D2Ball.URL = "ui://isxx5ak7kt443qi";
  2296. class D2BallSrc extends Laya.Script {
  2297. constructor() {
  2298. super();
  2299. this.number = 0;
  2300. this.startX = 0;
  2301. this.startY = 0;
  2302. this.angleV2 = new Laya.Vector2();
  2303. this.isRootBall = false;
  2304. this.isBlackBall = false;
  2305. this.ballType = "";
  2306. this.canRot = true;
  2307. this.rotY = 0;
  2308. this.poleAngle = 0;
  2309. this.kickPos = { x: 0, y: 0 };
  2310. this.hard = 0;
  2311. this.kickAngle = 0;
  2312. this.borderDis = 0;
  2313. this.speedP10 = 5.6;
  2314. this.lastSpeed = { x: 0, y: 0 };
  2315. this.stillSpeed = 0.12;
  2316. this.ballFunc = "normal";
  2317. this.isRunSkillAni = false;
  2318. this.isInHole = false;
  2319. this.iceOwner = "";
  2320. this.forceRun = false;
  2321. this.myUNID = "";
  2322. this.rectL = 0;
  2323. this.rectR = 0;
  2324. this.rectT = 0;
  2325. this.rectB = 0;
  2326. this.forceVec = new Laya.Vector2();
  2327. this.lastDis = 0;
  2328. this.helpOut = { type: "", x: 0, y: 0 };
  2329. }
  2330. initSelf(number, x, y, d3Ball) {
  2331. if (!this.gameObj)
  2332. this.gameObj = this.owner;
  2333. this.number = number;
  2334. this.startX = x;
  2335. this.startY = y;
  2336. this.d3Ball = d3Ball;
  2337. this.isRootBall = false;
  2338. this.isBlackBall = false;
  2339. this.ballType = "";
  2340. if (number == 0) {
  2341. this.isRootBall = true;
  2342. }
  2343. else if (number == 8) {
  2344. this.isBlackBall = true;
  2345. }
  2346. else {
  2347. if (number <= 7) {
  2348. this.ballType = ballCamp.full;
  2349. }
  2350. else {
  2351. this.ballType = ballCamp.flower;
  2352. }
  2353. }
  2354. this.setInfo();
  2355. this.setD3Ball();
  2356. this.owner["mySrc"] = this;
  2357. this.rigy.linearDamping = 1;
  2358. D2BallSrc._unid++;
  2359. this.myUNID = "d2ball" + D2BallSrc._unid;
  2360. let rect = xGame.common.d2World.borderRect;
  2361. this.rectL = Math.ceil(rect.x) + 20;
  2362. this.rectT = Math.ceil(rect.y) + 20;
  2363. this.rectR = Math.floor(rect.x + rect.width) - 20;
  2364. this.rectB = Math.floor(rect.y + rect.height) - 20;
  2365. }
  2366. setInfo() {
  2367. this.gameObj.x = this.startX;
  2368. this.gameObj.y = this.startY;
  2369. let radius = this.ui.width / 2;
  2370. this.gameObj.width = radius * 2;
  2371. this.gameObj.height = radius * 2;
  2372. if (xGame.common.showDebug) {
  2373. this.ui.myIcon.alpha = 1;
  2374. this.ui.inner.alpha = 1;
  2375. }
  2376. else {
  2377. this.ui.myIcon.alpha = 0;
  2378. this.ui.inner.alpha = 0;
  2379. }
  2380. }
  2381. setD3Ball() {
  2382. this.d3Ball = this.d3Ball;
  2383. this.d3BallSrc = this.d3Ball.getComponent(Ball);
  2384. this.d3BallSrc.initSelf(this.number, this.startX, this.startY, this);
  2385. }
  2386. onUpdate() {
  2387. if (xGame.common.gameMgr.gamePause)
  2388. return;
  2389. if (this.isInHole)
  2390. return;
  2391. if (!xGame.common.d2World.openCheckStill)
  2392. return;
  2393. this.runBall();
  2394. }
  2395. runBall() {
  2396. this.lastSpeed.x = this.rigy.linearVelocity.x;
  2397. this.lastSpeed.y = this.rigy.linearVelocity.y;
  2398. this.d3BallSrc.setTransPos(this.gameObj.x, this.gameObj.y);
  2399. this.judgeBorder();
  2400. }
  2401. getDestDis(dest) {
  2402. return xGame.tools.getDistance(dest.x, dest.y, this.gameObj.x, this.gameObj.y);
  2403. }
  2404. setmyXY(x, y) {
  2405. this.d3BallSrc.setTransPos(x, y);
  2406. }
  2407. getSpeed() {
  2408. let speed = this.rigy.linearVelocity;
  2409. return speed.x * speed.x + speed.y * speed.y;
  2410. }
  2411. onTriggerEnter(collider) {
  2412. if (!collider || !collider.owner)
  2413. return;
  2414. let coll = "collide";
  2415. let speed = this.getSpeed();
  2416. let sv2 = this.speedP10 * this.speedP10;
  2417. if (collider.label == "ball") {
  2418. if (speed < 9 && this.number != 0)
  2419. coll = "";
  2420. else if (speed < sv2)
  2421. coll = "collide_4";
  2422. else if (speed < sv2 * 6.2)
  2423. coll = "collide_3";
  2424. else if (speed < sv2 * 25)
  2425. coll = "collide_2";
  2426. else if (speed < sv2 * 56)
  2427. coll = "collide_1";
  2428. xGame.soundMgr.playSound(coll);
  2429. if (this.gameObj.x < this.rectL || this.gameObj.x > this.rectR || this.gameObj.y < this.rectT || this.gameObj.y > this.rectB) {
  2430. if (collider.owner) {
  2431. let rig = collider.owner.getComponent(D2BallSrc);
  2432. if (Math.abs(rig.rigy.linearVelocity.x) > 0)
  2433. rig.lastSpeed.x = rig.rigy.linearVelocity.x;
  2434. if (Math.abs(rig.rigy.linearVelocity.y) > 0)
  2435. rig.lastSpeed.y = rig.rigy.linearVelocity.y;
  2436. let vx = Math.abs(rig.lastSpeed.x * 0.4);
  2437. let vy = Math.abs(rig.lastSpeed.y * 0.5);
  2438. let rx = 0;
  2439. let ry = 0;
  2440. if (this.gameObj.x < this.rectL)
  2441. rx = vx;
  2442. else if (this.gameObj.x > this.rectR)
  2443. rx = -vx;
  2444. else if (this.gameObj.y < this.rectT)
  2445. ry = vy;
  2446. else if (this.gameObj.y > this.rectB)
  2447. ry = -vy;
  2448. this.rigy.applyLinearImpulseToCenter({ x: rx, y: ry });
  2449. }
  2450. }
  2451. if (this.number != 0) {
  2452. return;
  2453. }
  2454. else {
  2455. if (this.forceRun) {
  2456. console.log("randon force");
  2457. this.applyForce(collider);
  2458. }
  2459. }
  2460. if (xGame.common.d2World.isOnSameLine) {
  2461. xGame.common.d2World.isOnSameLine = false;
  2462. this.rigy.linearVelocity = { x: 0, y: 0 };
  2463. }
  2464. if (xGame.common.gameMgr.firstColliObj == null) {
  2465. xGame.common.gameMgr.firstColliObj = collider.owner["mySrc"].number;
  2466. xGame.common.gameMgr.isTouchedBall = true;
  2467. }
  2468. }
  2469. else {
  2470. xGame.common.recoverCameraView();
  2471. let wallStr = "";
  2472. if (speed < 9) { }
  2473. else if (speed < sv2) { }
  2474. else if (speed < sv2 * 6.2)
  2475. wallStr = "wall_30";
  2476. else if (speed < sv2 * 25)
  2477. wallStr = "wall_50";
  2478. else if (speed < sv2 * 56)
  2479. wallStr = "wall_80";
  2480. xGame.soundMgr.playSound(wallStr);
  2481. }
  2482. }
  2483. applyForce(collider) {
  2484. let src = collider.owner.mySrc;
  2485. this.forceVec.x = src.gameObj.x - this.gameObj.x;
  2486. this.forceVec.y = src.gameObj.y - this.gameObj.y;
  2487. Laya.Vector2.normalize(this.forceVec, this.forceVec);
  2488. Laya.Vector2.scale(this.forceVec, 50, this.forceVec);
  2489. src.rigy.applyLinearImpulseToCenter({ x: this.forceVec.x, y: this.forceVec.y });
  2490. }
  2491. checkWrongBall(playEft = true) {
  2492. if (this.isInHole)
  2493. return;
  2494. xGame.common.gameMgr.inHoleBalls.push(this.number);
  2495. if (this.number != 0 && playEft)
  2496. this.d3BallSrc.playInHoleEft();
  2497. let coll = "inpocket_1";
  2498. let speed = this.getSpeed();
  2499. let sv2 = this.speedP10 * this.speedP10 * 0.8;
  2500. if (speed < 9 && this.number != 0)
  2501. coll = "";
  2502. else if (speed < sv2 * 6.2)
  2503. coll = "inpocket_4";
  2504. else if (speed < sv2 * 25)
  2505. coll = "collide_3";
  2506. else if (speed < sv2 * 56)
  2507. coll = "collide_2";
  2508. xGame.soundMgr.playSound(coll);
  2509. this.isInHole = true;
  2510. if (this.number == 0) {
  2511. console.log("白球进了。。");
  2512. this.reset();
  2513. this.rigy.linearVelocity = { x: 0, y: 0 };
  2514. this.hideSelf();
  2515. xGame.common.gameUI.ui.whiteAni.visible = true;
  2516. xGame.common.gameUI.ui.whiteAni.t0.play(Laya.Handler.create(this, () => {
  2517. xGame.common.gameUI.ui.whiteAni.visible = false;
  2518. }));
  2519. }
  2520. else {
  2521. xGame.common.playClassicEmotion(this.number, this.gameObj.x, this.gameObj.y);
  2522. xGame.common.d2World.removeOneBall(this);
  2523. this.destroySelf();
  2524. xGame.common.playHappySound(this.number);
  2525. this.runFlyEft();
  2526. }
  2527. }
  2528. runFlyEft() {
  2529. if (xGame.common.gameMode == GameMode.placeBall && xGame.common.gameMgr.placeBallData.type == PlaceBallType.challenge) {
  2530. xGame.common.playAwardSpine(this.gameObj.x + 100, this.gameObj.y - 100);
  2531. }
  2532. }
  2533. hideSelf() {
  2534. if (this.d3Ball)
  2535. this.d3Ball.active = false;
  2536. }
  2537. showSelf() {
  2538. this.isInHole = false;
  2539. if (this.d3Ball && !this.d3Ball.active)
  2540. this.d3Ball.active = true;
  2541. }
  2542. isStill() {
  2543. let speed = this.rigy.linearVelocity;
  2544. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed) {
  2545. this.rigy.linearVelocity = { x: 0, y: 0 };
  2546. return true;
  2547. }
  2548. return false;
  2549. }
  2550. reset() {
  2551. }
  2552. destroySelf() {
  2553. this.d3BallSrc.destroySelf();
  2554. if (!this.ui.isDisposed) {
  2555. this.ui.removeFromParent();
  2556. this.ui.dispose();
  2557. this.ui = null;
  2558. }
  2559. this.outColli = null;
  2560. this.innerColli = null;
  2561. this.rigy = null;
  2562. this.d3Ball = null;
  2563. this.d3BallSrc = null;
  2564. this.angleV2 = null;
  2565. this.gameObj.destroy(true);
  2566. this.destroy();
  2567. }
  2568. judgeBorder() {
  2569. if (this.forceRun && this.owner == xGame.common.d2World.rootBall.owner) {
  2570. return;
  2571. }
  2572. if (this.destroyed)
  2573. return;
  2574. if (xGame.common.gameMode == GameMode.classic)
  2575. return;
  2576. let isOver = xGame.common.checkBallOverBorder(this.gameObj.x, this.gameObj.y);
  2577. if (isOver) {
  2578. this.checkWrongBall();
  2579. }
  2580. }
  2581. onClick(e, force = false) {
  2582. if (this.number == 0)
  2583. return;
  2584. if (force) {
  2585. }
  2586. else {
  2587. if (xGame.common.d2World.openCheckStill)
  2588. return;
  2589. if (!xGame.common.gameMgr.selfTurn) {
  2590. return;
  2591. }
  2592. }
  2593. if (!xGame.common.gameMgr.finishOneShoot)
  2594. return;
  2595. let root = xGame.common.d2World.rootBall.gameObj;
  2596. let x = this.gameObj.x - root.x;
  2597. let y = this.gameObj.y - root.y;
  2598. let angle = xGame.common.getfguiRotation(x, y);
  2599. xGame.common.d2World.d2Gan.ui.rotation = angle;
  2600. xGame.common.d2World.getHelpLine();
  2601. xGame.common.clickedBall = true;
  2602. this.checkGuide();
  2603. }
  2604. checkGuide() {
  2605. let guide = DataMgr.getSkillGuide();
  2606. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) {
  2607. xGame.common.guideStep++;
  2608. xGame.common.gameUI.ui.guide1.visible = false;
  2609. xGame.common.gameUI.ui.guide2.visible = true;
  2610. }
  2611. }
  2612. checkDistance(disX, disY, angle) {
  2613. let diameter = this.gameObj.width - 1;
  2614. let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2);
  2615. if (!this.lastDis)
  2616. this.lastDis = dis;
  2617. else {
  2618. if (dis > this.lastDis) {
  2619. this.helpOut.type = "remove";
  2620. return this.helpOut;
  2621. }
  2622. }
  2623. if (dis <= Math.pow(diameter, 2)) {
  2624. let del = 0.01;
  2625. let offest = 0;
  2626. let realX = disX - this.gameObj.x;
  2627. let realY = disY - this.gameObj.y;
  2628. while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) {
  2629. offest += del;
  2630. realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180);
  2631. realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180);
  2632. }
  2633. this.helpOut.type = "ok";
  2634. this.helpOut.x = realX + this.gameObj.x;
  2635. this.helpOut.y = realY + this.gameObj.y;
  2636. return this.helpOut;
  2637. }
  2638. else {
  2639. this.helpOut.type = "no";
  2640. return this.helpOut;
  2641. }
  2642. }
  2643. clearBallEft() {
  2644. this.clearBallRightEft();
  2645. this.clearBallWrongEft();
  2646. }
  2647. clearBallRightEft() {
  2648. this.ui.breathAni.stop();
  2649. this.ui.rightTips.visible = false;
  2650. }
  2651. clearBallWrongEft() {
  2652. this.ui.wrongTips.visible = false;
  2653. }
  2654. showWrongEft() {
  2655. if (!xGame.common.gameMgr.selfTurn)
  2656. return;
  2657. this.ui.wrongTips.visible = true;
  2658. }
  2659. showRightEft() {
  2660. if (!xGame.common.gameMgr.selfTurn)
  2661. return;
  2662. this.ui.rightTips.visible = true;
  2663. this.ui.rightTips.scaleX = 1;
  2664. this.ui.rightTips.scaleY = 1;
  2665. this.ui.breathAni.play();
  2666. }
  2667. setBallFunc(type, owner) {
  2668. if (type == "ice") {
  2669. this.ballFunc = type;
  2670. this.d3BallSrc.setAlbedoTexture(true);
  2671. this.rigy.type = "static";
  2672. this.iceOwner = owner;
  2673. }
  2674. else {
  2675. if (owner == this.iceOwner) {
  2676. this.ballFunc = type;
  2677. this.d3BallSrc.setAlbedoTexture(false);
  2678. this.rigy.type = "dynamic";
  2679. }
  2680. }
  2681. }
  2682. }
  2683. D2BallSrc._unid = 0;
  2684. class D2RootBallSrc extends D2BallSrc {
  2685. constructor() {
  2686. super();
  2687. this.maxSpeed = 0;
  2688. this.classicMaxSpeed = 2.2;
  2689. this.bigSkillMaxSpeed = 4;
  2690. this.angle = 0;
  2691. this.allPercent = 0;
  2692. this.linearPercent = 0;
  2693. this.anglePercent = 0;
  2694. this.maxAngleRate = 0.6;
  2695. this.baseRot = 7;
  2696. this.angleMax = 0;
  2697. this.speed = new Laya.Vector2();
  2698. this.rotSpeed = new Laya.Vector2();
  2699. }
  2700. isStill() {
  2701. let speed = this.rigy.linearVelocity;
  2702. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) {
  2703. if (this.anglePercent <= 0.1) {
  2704. this.rigy.linearVelocity = { x: 0, y: 0 };
  2705. return true;
  2706. }
  2707. }
  2708. return false;
  2709. }
  2710. reset() {
  2711. this.linearPercent = 0;
  2712. this.anglePercent = 0;
  2713. }
  2714. setSpeed(percent, angle) {
  2715. this.allPercent = percent;
  2716. this.angle = angle;
  2717. this.setAngleSpeed();
  2718. this.setLinearSpeed();
  2719. let hit = "hit";
  2720. if (percent < 25)
  2721. hit = "hit03";
  2722. else if (percent < 50)
  2723. hit = "hit02";
  2724. else if (percent < 75)
  2725. hit = "hit01";
  2726. xGame.soundMgr.playSound(hit);
  2727. }
  2728. setAngleSpeed() {
  2729. let offest = xGame.common.rodOffest;
  2730. let radius = 82;
  2731. let rate = Math.abs(offest.y / radius) * 0.5;
  2732. if (offest.y > 0)
  2733. this.angleMax = -this.baseRot * 2;
  2734. else
  2735. this.angleMax = this.baseRot;
  2736. this.rotY = -offest.x / radius * 100;
  2737. this.anglePercent = this.maxAngleRate * rate * this.allPercent;
  2738. this.linearPercent = this.allPercent - this.anglePercent;
  2739. }
  2740. setLinearSpeed() {
  2741. if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) {
  2742. if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) {
  2743. if (!xGame.common.longHelpLine) {
  2744. let offset = -150 + xGame.common.randomNum(0, 300);
  2745. offset /= 100;
  2746. this.angle += offset;
  2747. }
  2748. }
  2749. }
  2750. let sin = Math.sin(this.angle * Math.PI / 180);
  2751. let cos = Math.cos(this.angle * Math.PI / 180);
  2752. switch (xGame.common.gameMode) {
  2753. case GameMode.classic:
  2754. this.maxSpeed = this.classicMaxSpeed;
  2755. break;
  2756. case GameMode.bigMove:
  2757. this.maxSpeed = this.bigSkillMaxSpeed;
  2758. break;
  2759. case GameMode.placeBall:
  2760. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  2761. if (data.type == 1) {
  2762. this.maxSpeed = this.bigSkillMaxSpeed;
  2763. }
  2764. else {
  2765. this.maxSpeed = this.classicMaxSpeed;
  2766. }
  2767. break;
  2768. default:
  2769. break;
  2770. }
  2771. this.speed.x = this.maxSpeed * this.linearPercent * sin;
  2772. this.speed.y = -this.maxSpeed * this.linearPercent * cos;
  2773. this.rotSpeed.x = -this.angleMax * sin * this.anglePercent;
  2774. this.rotSpeed.y = this.angleMax * cos * this.anglePercent;
  2775. this.rigy.applyLinearImpulseToCenter(this.speed);
  2776. }
  2777. onUpdate() {
  2778. if (this.anglePercent > 0.1) {
  2779. this.anglePercent *= 0.97;
  2780. this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent;
  2781. this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent;
  2782. this.rigy.applyForceToCenter(this.rotSpeed);
  2783. Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed);
  2784. Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed);
  2785. let num = Laya.Vector2.dot(this.speed, this.rotSpeed);
  2786. if (num > 0.9)
  2787. this.canRot = true;
  2788. }
  2789. else
  2790. this.canRot = true;
  2791. if (Math.abs(this.rotY) > 0.1)
  2792. this.rotY *= 0.98;
  2793. super.onUpdate();
  2794. }
  2795. destroySelf() {
  2796. super.destroySelf();
  2797. this.speed = null;
  2798. }
  2799. }
  2800. class D2Ball extends Laya.Sprite {
  2801. constructor(isRootBall = false) {
  2802. super();
  2803. this.ui = ui_D2Ball.createInstance();
  2804. this.pivotX = this.ui.width / 2;
  2805. this.pivotY = this.ui.width / 2;
  2806. this.x = 0;
  2807. this.y = 0;
  2808. this.addChild(this.ui.displayObject);
  2809. this.ui.displayObject.x += this.ui.width / 2;
  2810. this.ui.displayObject.y += this.ui.width / 2;
  2811. if (isRootBall) {
  2812. this.d2Src = this.addComponent(D2RootBallSrc);
  2813. }
  2814. else {
  2815. this.d2Src = this.addComponent(D2BallSrc);
  2816. }
  2817. this.d2Src.ui = this.ui;
  2818. this.addCircleCollider();
  2819. this.addInnerCircleCollider();
  2820. this.addRigyBody();
  2821. }
  2822. addCircleCollider() {
  2823. let colli = xGame.common.getCollider("circle");
  2824. colli.radius = this.ui.width / 2;
  2825. this.addComponentIntance(colli);
  2826. this.d2Src.outColli = colli;
  2827. colli.label = "ball";
  2828. }
  2829. addInnerCircleCollider() {
  2830. let colli = xGame.common.getCollider("circle");
  2831. colli.radius = this.ui.inner.width / 2;
  2832. colli.x = (this.ui.width - this.ui.inner.width) / 2;
  2833. colli.y = (this.ui.width - this.ui.inner.width) / 2;
  2834. this.addComponentIntance(colli);
  2835. this.d2Src.innerColli = colli;
  2836. colli.label = "inner";
  2837. }
  2838. addRigyBody() {
  2839. let rigy = xGame.common.getRigbody();
  2840. rigy.type = "dynamic";
  2841. this.addComponentIntance(rigy);
  2842. this.d2Src.rigy = rigy;
  2843. }
  2844. disposeSelf() {
  2845. if (!this.ui.isDisposed) {
  2846. this.ui.dispose();
  2847. this.ui.removeFromParent();
  2848. this.ui = null;
  2849. }
  2850. }
  2851. }
  2852. class ui_D2Gan extends fgui.GComponent {
  2853. static createInstance() {
  2854. return (fgui.UIPackage.createObject("game", "D2Gan"));
  2855. }
  2856. onConstruct() {
  2857. this.myIcon = (this.getChild("myIcon"));
  2858. this.selfRodIcon = (this.getChild("selfRodIcon"));
  2859. this.selfEftRoot = (this.getChild("selfEftRoot"));
  2860. this.self = (this.getChild("self"));
  2861. this.aiRodIcon = (this.getChild("aiRodIcon"));
  2862. this.aiEftRoot = (this.getChild("aiEftRoot"));
  2863. this.ai = (this.getChild("ai"));
  2864. }
  2865. }
  2866. ui_D2Gan.URL = "ui://isxx5ak7sdh33qp";
  2867. class D2Gan {
  2868. constructor() {
  2869. this.offset = 0.15;
  2870. this.cell = 1.5;
  2871. this.onBallCell = 0.4;
  2872. this.lastInfo = { x: 0, y: 0, rotation: 0 };
  2873. this.moveNum = 70;
  2874. this.rulerRate = 0.1;
  2875. this.ui = ui_D2Gan.createInstance();
  2876. this.changeSelfRod();
  2877. this.changeAIRod();
  2878. }
  2879. changeSelfRod() {
  2880. let index = DataMgr.getCurBallRod();
  2881. let data = cfgTable.ballrodData[index + 1];
  2882. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  2883. this.selfMySpine && this.selfMySpine.dispose();
  2884. this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img);
  2885. if (data.spine) {
  2886. this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img);
  2887. this.selfMySpine = new SpineMgr(data.spine, () => {
  2888. let xx = this.ui.selfEftRoot.width / 2;
  2889. let yy = this.ui.selfEftRoot.height / 2;
  2890. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  2891. let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject);
  2892. outSpine.rotation = -90;
  2893. });
  2894. }
  2895. }
  2896. changeAIRod() {
  2897. let length = Object.keys(cfgTable.ballrodData).length;
  2898. let rand = Math.floor(length * Math.random()) + 1;
  2899. let data = cfgTable.ballrodData[rand];
  2900. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  2901. this.aiMySpine && this.aiMySpine.dispose();
  2902. this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img);
  2903. if (data.spine) {
  2904. this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img);
  2905. this.aiMySpine = new SpineMgr(data.spine, () => {
  2906. let xx = this.ui.aiEftRoot.width / 2;
  2907. let yy = this.ui.aiEftRoot.height / 2;
  2908. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  2909. let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject);
  2910. outSpine.rotation = -90;
  2911. });
  2912. }
  2913. }
  2914. setGanLastInfo() {
  2915. this.lastInfo.rotation = this.ui.rotation;
  2916. this.lastInfo.x = this.ui.x;
  2917. this.lastInfo.y = this.ui.y;
  2918. }
  2919. rotateSelf(flag, isRuler = false) {
  2920. let angle;
  2921. flag = flag * this.offset;
  2922. if (xGame.common.d2World.isHelpLineOnBall) {
  2923. angle = flag * this.onBallCell;
  2924. }
  2925. else {
  2926. angle = flag * this.cell;
  2927. }
  2928. if (isRuler) {
  2929. angle *= this.rulerRate;
  2930. }
  2931. this.ui.rotation += angle;
  2932. xGame.common.d2World.getHelpLine();
  2933. }
  2934. checkDistance() {
  2935. let target = xGame.common.d2World.targetBall;
  2936. let root = xGame.common.d2World.rootBall;
  2937. if (target == null) {
  2938. return 1;
  2939. }
  2940. let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2);
  2941. if (dis <= 2500) {
  2942. return 5;
  2943. }
  2944. return 1;
  2945. }
  2946. rotDest(rot) {
  2947. this.ui.rotation = rot;
  2948. xGame.common.d2World.getHelpLine();
  2949. }
  2950. storagePower(powerNum) {
  2951. let pos = (powerNum / 100) * this.moveNum;
  2952. let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos;
  2953. let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos;
  2954. this.ui.x = this.lastInfo.x + xx;
  2955. this.ui.y = this.lastInfo.y + yy;
  2956. }
  2957. shoot() {
  2958. this.storagePower(0);
  2959. this.ui.visible = false;
  2960. }
  2961. destroySelf() {
  2962. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  2963. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  2964. this.selfMySpine && this.selfMySpine.dispose();
  2965. this.aiMySpine && this.aiMySpine.dispose();
  2966. this.lastInfo = null;
  2967. if (!this.ui.isDisposed) {
  2968. this.ui.removeFromParent();
  2969. this.ui.dispose();
  2970. }
  2971. }
  2972. }
  2973. class ui_HelpLine extends fgui.GComponent {
  2974. static createInstance() {
  2975. return (fgui.UIPackage.createObject("game", "HelpLine"));
  2976. }
  2977. onConstruct() {
  2978. this.n10 = (this.getChild("n10"));
  2979. this.rect = (this.getChild("rect"));
  2980. this.dir11 = (this.getChild("dir11"));
  2981. this.dir = (this.getChild("dir"));
  2982. this.rootDir = (this.getChild("rootDir"));
  2983. this.dirDot = (this.getChild("dirDot"));
  2984. }
  2985. }
  2986. ui_HelpLine.URL = "ui://isxx5ak7sdh33qs";
  2987. class D2HelpLine {
  2988. constructor() {
  2989. this.starX = 0;
  2990. this.starY = 0;
  2991. this.ui = ui_HelpLine.createInstance();
  2992. xGame.common.gameUI.ui.ballNode.addChild(this.ui);
  2993. this.starX = this.ui.rect.x;
  2994. this.starY = this.ui.rect.y;
  2995. }
  2996. shoot() {
  2997. this.ui.visible = false;
  2998. }
  2999. destroySelf() {
  3000. if (this.ui.isDisposed) {
  3001. this.ui.removeFromParent();
  3002. this.ui.dispose();
  3003. }
  3004. }
  3005. }
  3006. class D2World extends Laya.Script {
  3007. constructor() {
  3008. super();
  3009. this.ballArr = [];
  3010. this.openCheckStill = false;
  3011. this.checkArr = [];
  3012. this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 };
  3013. this.isHelpLineOnBall = false;
  3014. this.isOnSameLine = false;
  3015. this.reflectAngle = 0;
  3016. this.powerPercent = 0;
  3017. this.inHolesSpeed = [];
  3018. this.outDir = new Laya.Vector2();
  3019. this.rootDir = new Laya.Vector2();
  3020. this.aiLv = 0;
  3021. this.rootPos = new Laya.Vector2();
  3022. this.tempDir1 = new Laya.Vector2();
  3023. this.tempDir2 = new Laya.Vector2();
  3024. this.tempDir3 = new Laya.Vector2();
  3025. this.ballSize = 33;
  3026. this.destRot = 0;
  3027. }
  3028. initSelf() {
  3029. this.createBalls();
  3030. xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop);
  3031. xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop);
  3032. xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot);
  3033. xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot);
  3034. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  3035. }
  3036. setBorderRect() {
  3037. let ui = xGame.common.gameUI.ui;
  3038. let starX = ui.border.bar5.x + ui.border.bar5.width / 2;
  3039. let starY = ui.border.bar1.y + ui.border.bar1.height / 2;
  3040. let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width);
  3041. let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height);
  3042. this.borderRect.x = starX;
  3043. this.borderRect.y = starY;
  3044. this.borderRect.width = width;
  3045. this.borderRect.height = height;
  3046. }
  3047. resetGame() {
  3048. this.openCheckStill = false;
  3049. let temp;
  3050. for (let index = 0; index < this.ballArr.length; index++) {
  3051. temp = this.ballArr[index];
  3052. temp.destroySelf();
  3053. }
  3054. xGame.common.d3World.ballRoot.destroyChildren();
  3055. xGame.common.gameUI.ui.ballNode.removeChildren();
  3056. console.log("进入摧毁逻辑");
  3057. this.d2Gan.destroySelf();
  3058. this.d2HelpLine.destroySelf();
  3059. this.ballArr = [];
  3060. }
  3061. setD2Gan() {
  3062. let ballNode = this.rootBall.ui;
  3063. let d2Gan = new D2Gan();
  3064. this.d2Gan = d2Gan;
  3065. let ganNode = d2Gan.ui;
  3066. ballNode.addChild(ganNode);
  3067. ganNode.pivotX = ganNode.pivotX;
  3068. ganNode.pivotY = ganNode.pivotY;
  3069. ganNode.x = ganNode.myIcon.width / 2;
  3070. ganNode.y = this.rootBall.gameObj.width;
  3071. d2Gan.setGanLastInfo();
  3072. }
  3073. setHelpLine() {
  3074. let d2Help = new D2HelpLine();
  3075. this.d2HelpLine = d2Help;
  3076. }
  3077. createBalls() {
  3078. let cfg;
  3079. switch (xGame.common.gameMode) {
  3080. case GameMode.classic:
  3081. cfg = xGame.cfgMgr.getRandomClassicLevel();
  3082. break;
  3083. case GameMode.bigMove:
  3084. cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex);
  3085. break;
  3086. case GameMode.placeBall:
  3087. cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel);
  3088. break;
  3089. default:
  3090. break;
  3091. }
  3092. cfg = JSON.parse(JSON.stringify(cfg));
  3093. for (const key in cfg) {
  3094. if (cfg[key].value == 0) {
  3095. this.createRootBall(cfg[key]);
  3096. delete cfg[key];
  3097. break;
  3098. }
  3099. }
  3100. this.createOtherBalls(cfg);
  3101. }
  3102. createRootBall(data) {
  3103. let root = new D2Ball(true);
  3104. xGame.common.gameUI.ui.ballNode.displayObject.addChild(root);
  3105. this.rootBall = root.d2Src;
  3106. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3107. let d3BallSrc = d3Ball.getComponent(Ball);
  3108. xGame.common.d3World.rootBall = d3Ball;
  3109. xGame.common.d3World.rootBallSrc = d3BallSrc;
  3110. let xx = data.x;
  3111. let yy = data.y;
  3112. let numer = data.value;
  3113. xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy);
  3114. this.rootBall.initSelf(numer, xx, yy, d3Ball);
  3115. this.ballArr.push(this.rootBall);
  3116. this.setD2Gan();
  3117. this.setHelpLine();
  3118. }
  3119. createOtherBalls(cfg) {
  3120. let temp;
  3121. let src;
  3122. let data;
  3123. for (const key in cfg) {
  3124. data = cfg[key];
  3125. temp = new D2Ball();
  3126. xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp);
  3127. src = temp.d2Src;
  3128. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3129. src.initSelf(data.value, data.x, data.y, d3Ball);
  3130. this.ballArr.push(src);
  3131. }
  3132. }
  3133. shoot(percent) {
  3134. this.powerPercent = percent;
  3135. this.openCheckStill = true;
  3136. let d2Angle = this.d2Gan.ui.rotation;
  3137. this.rootBall.setSpeed(percent, d2Angle);
  3138. this.clearBallAllEft();
  3139. this.changePlayerView();
  3140. }
  3141. onUpdate() {
  3142. if (!this.openCheckStill)
  3143. return;
  3144. this.checkStill();
  3145. }
  3146. checkStill() {
  3147. for (let index = 0; index < this.ballArr.length; index++) {
  3148. if (!this.ballArr[index].isStill()) {
  3149. return;
  3150. }
  3151. }
  3152. xGame.eventMgr.event(ALL_BALL_STOP);
  3153. }
  3154. allBallStop() {
  3155. this.openCheckStill = false;
  3156. xGame.common.recoverCameraView();
  3157. }
  3158. waitShoot() {
  3159. if (!this.d2Gan.ui.isDisposed) {
  3160. this.d2Gan.ui.visible = true;
  3161. }
  3162. if (!this.d2HelpLine.ui.isDisposed) {
  3163. this.d2HelpLine.ui.visible = true;
  3164. }
  3165. this.clearBallAllEft();
  3166. this.showBallRightEft();
  3167. this.getHelpLine();
  3168. this.inHolesSpeed = [];
  3169. this.selectOneBall();
  3170. }
  3171. _getAllBallArr() {
  3172. let arr = this.ballArr;
  3173. let outArr = [];
  3174. for (let index = 0; index < arr.length; index++) {
  3175. if (arr[index] instanceof D2RootBallSrc)
  3176. continue;
  3177. if (arr[index].ballFunc == "ice")
  3178. continue;
  3179. if (arr[index].destroyed)
  3180. continue;
  3181. outArr.push(arr[index]);
  3182. }
  3183. return outArr;
  3184. }
  3185. _getBlackObj() {
  3186. let arr = this.ballArr;
  3187. for (let index = 0; index < arr.length; index++) {
  3188. if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) {
  3189. return arr[index];
  3190. }
  3191. }
  3192. }
  3193. selectOneBall() {
  3194. let all = this._getAllBallArr();
  3195. let target;
  3196. switch (xGame.common.gameMode) {
  3197. case GameMode.classic:
  3198. if (xGame.common.gameMgr.selfTurn) {
  3199. let self = xGame.common.gameMgr.selfBallArr;
  3200. let black = this._getBlackObj();
  3201. if (xGame.common.gameMgr.ensureBallType) {
  3202. if (self.length > 0) {
  3203. let out = [];
  3204. for (let j = 0; j < all.length; j++) {
  3205. if (self.indexOf(all[j].number) > -1) {
  3206. out.push(all[j]);
  3207. }
  3208. }
  3209. target = this.selectBestEnterOne(out);
  3210. }
  3211. else {
  3212. target = this.selectBestEnterOne([black]);
  3213. }
  3214. }
  3215. else {
  3216. target = this.selectBestEnterOne(all);
  3217. }
  3218. }
  3219. else {
  3220. target = this.selectBestEnterOne(all);
  3221. }
  3222. break;
  3223. case GameMode.bigMove:
  3224. target = this.selectBestEnterOne(all);
  3225. break;
  3226. case GameMode.placeBall:
  3227. if (all.length > 0) {
  3228. target = this.selectBestEnterOne(all);
  3229. }
  3230. break;
  3231. default:
  3232. break;
  3233. }
  3234. if (target && !target.destroyed && target.onClick) {
  3235. target.onClick(0, true);
  3236. let num = -200 + xGame.common.randomNum(0, 400);
  3237. num /= 150;
  3238. if (xGame.common.longHelpLine) {
  3239. num = 0;
  3240. }
  3241. this.destRot += num;
  3242. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  3243. }
  3244. }
  3245. removeOneBall(ball) {
  3246. for (let index = 0; index < this.ballArr.length; index++) {
  3247. if (this.ballArr[index].id == ball.id) {
  3248. this.ballArr.splice(index, 1);
  3249. break;
  3250. }
  3251. }
  3252. }
  3253. getHelpLine() {
  3254. this.d2HelpLine.ui.dirDot.visible = false;
  3255. this.isOnSameLine = false;
  3256. let startX = this.rootBall.gameObj.x;
  3257. let startY = this.rootBall.gameObj.y;
  3258. let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation);
  3259. if (dis == null) {
  3260. this.d2HelpLine.ui.visible = false;
  3261. console.error("辅助线异常");
  3262. return;
  3263. }
  3264. this.d2HelpLine.ui.visible = true;
  3265. let angle = this.d2Gan.ui.rotation;
  3266. let radius = 16.5;
  3267. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3268. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3269. let colliObj = xGame.common.isBlock(startX, startY, disX, disY);
  3270. if (colliObj == null) {
  3271. this.getColliPos(disX, disY, radius, angle);
  3272. xGame.common.d2World.isHelpLineOnBall = false;
  3273. this.targetBall = null;
  3274. this.reflectAngle = 0;
  3275. this.showBallWrongEft();
  3276. }
  3277. else {
  3278. let target = colliObj.src;
  3279. let radius = 16.5;
  3280. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3281. dis1 = Math.sqrt(dis1);
  3282. let realDis = colliObj.disHon - dis1;
  3283. let dir = colliObj.dir;
  3284. let xx = startX + dir.x * realDis;
  3285. let yy = startY + dir.y * realDis;
  3286. this.getColliPos(xx, yy, radius, angle);
  3287. let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180;
  3288. if (Math.abs(reflectAngle - angle) <= 0.02) {
  3289. let offset = xGame.common.rodOffest;
  3290. if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1)
  3291. this.isOnSameLine = true;
  3292. }
  3293. this.getRootDirLine(reflectAngle, angle, xx, yy, target);
  3294. xGame.common.d2World.isHelpLineOnBall = true;
  3295. this.targetBall = target;
  3296. this.reflectAngle = reflectAngle;
  3297. this.showBallWrongEft();
  3298. if (xGame.common.longHelpLine) {
  3299. this.delayReflectLine(target, reflectAngle);
  3300. }
  3301. }
  3302. }
  3303. getBorderDot(startX, startY, angle) {
  3304. let radius = 17;
  3305. let distance;
  3306. let isDone;
  3307. distance = -(this.borderRect.y - startY + radius) / Math.cos(angle * Math.PI / 180);
  3308. isDone = this.judgeUpDown(distance, angle, startX);
  3309. if (isDone != null) {
  3310. return isDone;
  3311. }
  3312. distance = -(this.borderRect.y + this.borderRect.height - startY - radius) / Math.cos(angle * Math.PI / 180);
  3313. isDone = this.judgeUpDown(distance, angle, startX);
  3314. if (isDone != null) {
  3315. return isDone;
  3316. }
  3317. distance = (this.borderRect.x - startX + radius) / Math.sin(angle * Math.PI / 180);
  3318. isDone = this.judgeLeftRight(distance, angle, startY);
  3319. if (isDone != null) {
  3320. return isDone;
  3321. }
  3322. distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180);
  3323. isDone = this.judgeLeftRight(distance, angle, startY);
  3324. if (isDone != null) {
  3325. return isDone;
  3326. }
  3327. }
  3328. judgeUpDown(distance, angle, startX) {
  3329. let flag = Math.sin(angle * Math.PI / 180);
  3330. let temp = startX + distance * Math.sin(angle * Math.PI / 180);
  3331. if (distance >= 0) {
  3332. if (flag > 0) {
  3333. if (temp < this.borderRect.x + this.borderRect.width) {
  3334. return distance;
  3335. }
  3336. }
  3337. else {
  3338. if (temp > this.borderRect.x) {
  3339. return distance;
  3340. }
  3341. }
  3342. }
  3343. }
  3344. judgeLeftRight(distance, angle, starY) {
  3345. let flag = -Math.cos(angle * Math.PI / 180);
  3346. let temp = starY + distance * -Math.cos(angle * Math.PI / 180);
  3347. if (distance >= 0) {
  3348. if (flag > 0) {
  3349. if (temp < this.borderRect.y + this.borderRect.height) {
  3350. return distance;
  3351. }
  3352. }
  3353. else {
  3354. if (temp > this.borderRect.y) {
  3355. return distance;
  3356. }
  3357. }
  3358. }
  3359. }
  3360. clearBallAllEft() {
  3361. let temp;
  3362. for (let index = 0; index < this.ballArr.length; index++) {
  3363. temp = this.ballArr[index];
  3364. temp.clearBallEft();
  3365. }
  3366. }
  3367. showBallRightEft() {
  3368. let gameMgr = xGame.common.gameMgr;
  3369. let temp;
  3370. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3371. if (targetArr.length <= 0)
  3372. return;
  3373. for (let index = 0; index < this.ballArr.length; index++) {
  3374. temp = this.ballArr[index];
  3375. if (targetArr.indexOf(temp.number) > -1) {
  3376. temp.showRightEft();
  3377. }
  3378. }
  3379. }
  3380. showBallWrongEft() {
  3381. let gameMgr = xGame.common.gameMgr;
  3382. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3383. if (targetArr.length <= 0)
  3384. return;
  3385. let temp;
  3386. for (let index = 0; index < this.ballArr.length; index++) {
  3387. temp = this.ballArr[index];
  3388. if (this.targetBall && this.targetBall.number == temp.number) {
  3389. if (targetArr.indexOf(temp.number) <= -1) {
  3390. temp.showWrongEft();
  3391. }
  3392. else {
  3393. temp.clearBallWrongEft();
  3394. }
  3395. }
  3396. else {
  3397. temp.clearBallWrongEft();
  3398. }
  3399. }
  3400. }
  3401. getColliPos(x, y, radius, angle) {
  3402. this.d2HelpLine.ui.x = x;
  3403. this.d2HelpLine.ui.y = y;
  3404. let dirX = x - this.rootBall.gameObj.x;
  3405. let dirY = y - this.rootBall.gameObj.y;
  3406. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3407. if (rectH <= 0)
  3408. rectH = 0;
  3409. this.d2HelpLine.ui.rect.height = 0;
  3410. this.d2HelpLine.ui.rect.height = rectH;
  3411. this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY);
  3412. if (rectH < this.rootBall.gameObj.width) {
  3413. this.d2HelpLine.ui.rect.visible = false;
  3414. }
  3415. else {
  3416. this.d2HelpLine.ui.rect.visible = true;
  3417. }
  3418. this.d2HelpLine.ui.dir.visible = false;
  3419. this.d2HelpLine.ui.rootDir.visible = false;
  3420. }
  3421. getReflectLine(x, y, radius, target) {
  3422. this.d2HelpLine.ui.dir.visible = true;
  3423. let dirX = target.x - x;
  3424. let dirY = target.y - y;
  3425. let angle = xGame.common.getfguiRotation(dirX, dirY) + 180;
  3426. this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX;
  3427. this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY;
  3428. this.d2HelpLine.ui.dir.height = 48;
  3429. this.d2HelpLine.ui.dir.rotation = angle;
  3430. this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180);
  3431. this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180);
  3432. return angle;
  3433. }
  3434. getRootDirLine(angle, rodAngle, xx, yy, target) {
  3435. let rtX = xGame.common.d2World.rootBall.gameObj.x;
  3436. let rtY = xGame.common.d2World.rootBall.gameObj.y;
  3437. let targetX = target.gameObj.x;
  3438. let targetY = target.gameObj.y;
  3439. this.outDir.setValue(targetX - xx, targetY - yy);
  3440. this.rootDir.setValue(rtX - xx, rtY - yy);
  3441. let ver = Math.PI / 2;
  3442. let sin = Math.sin(ver);
  3443. let cos = Math.cos(ver);
  3444. let outX = this.outDir.x * cos - this.outDir.y * sin;
  3445. let outY = this.outDir.x * sin + this.outDir.y * cos;
  3446. this.outDir.setValue(outX, outY);
  3447. Laya.Vector2.normalize(this.rootDir, this.rootDir);
  3448. Laya.Vector2.normalize(this.outDir, this.outDir);
  3449. let result = Laya.Vector2.dot(this.rootDir, this.outDir);
  3450. if (Math.abs(result) <= 0.08) {
  3451. this.d2HelpLine.ui.rootDir.visible = false;
  3452. return;
  3453. }
  3454. if (result > 0) {
  3455. angle += 90;
  3456. }
  3457. else if (result < 0) {
  3458. angle -= 90;
  3459. }
  3460. this.d2HelpLine.ui.rootDir.visible = true;
  3461. this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX;
  3462. this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY;
  3463. this.d2HelpLine.ui.rootDir.rotation = angle;
  3464. }
  3465. delayReflectLine(obj, angle) {
  3466. if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) {
  3467. return;
  3468. }
  3469. this.isOnSameLine = false;
  3470. let startX = obj.gameObj.x;
  3471. let startY = obj.gameObj.y;
  3472. let dis = this.getBorderDot(startX, startY, angle);
  3473. if (dis == null) {
  3474. this.d2HelpLine.ui.dirDot.visible = false;
  3475. return;
  3476. }
  3477. this.d2HelpLine.ui.visible = true;
  3478. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3479. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3480. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, obj);
  3481. if (colliObj == null) {
  3482. this.setDelayLine(disX, disY, obj, angle);
  3483. }
  3484. else {
  3485. let radius = 16;
  3486. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3487. dis1 = Math.sqrt(dis1);
  3488. let realDis = colliObj.disHon - dis1;
  3489. let dir = colliObj.dir;
  3490. let xx = startX + dir.x * realDis;
  3491. let yy = startY + dir.y * realDis;
  3492. this.setDelayLine(xx, yy, obj, angle);
  3493. }
  3494. }
  3495. setDelayLine(x, y, obj, angle) {
  3496. let dirX = x - obj.gameObj.x;
  3497. let dirY = y - obj.gameObj.y;
  3498. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3499. if (rectH <= 0)
  3500. rectH = 0;
  3501. this.d2HelpLine.ui.dir.height = rectH;
  3502. this.d2HelpLine.ui.dirDot.visible = true;
  3503. this.d2HelpLine.ui.dirDot.x = 17;
  3504. this.d2HelpLine.ui.dirDot.y = 17;
  3505. this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180);
  3506. ;
  3507. this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180);
  3508. }
  3509. changePlayerView() {
  3510. if (Math.random() >= 0.7)
  3511. return;
  3512. if (!this.targetBall) {
  3513. return;
  3514. }
  3515. if (!xGame.common.gameMgr.selfTurn)
  3516. return;
  3517. switch (xGame.common.gameMode) {
  3518. case GameMode.classic:
  3519. if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) {
  3520. if (this.targetBall.number != 8) {
  3521. return;
  3522. }
  3523. }
  3524. break;
  3525. case GameMode.bigMove:
  3526. return;
  3527. case GameMode.placeBall:
  3528. break;
  3529. default:
  3530. break;
  3531. }
  3532. let startX = this.targetBall.gameObj.x;
  3533. let startY = this.targetBall.gameObj.y;
  3534. let angle = this.reflectAngle;
  3535. let dis = this.getBorderDot(startX, startY, angle);
  3536. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3537. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3538. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall);
  3539. if (colliObj) {
  3540. return;
  3541. }
  3542. let offset = 40;
  3543. let posObj = xGame.common.gameMgr.posObj;
  3544. let temp;
  3545. let radius;
  3546. let tarX, tarY;
  3547. for (const key in posObj) {
  3548. temp = posObj[key];
  3549. radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5);
  3550. tarX = startX + radius * Math.sin(angle * Math.PI / 180);
  3551. tarY = startY + radius * -Math.cos(angle * Math.PI / 180);
  3552. if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) {
  3553. xGame.common.showOneCamera("angle" + key);
  3554. xGame.common.gameUI.ui.d2Node.alpha = 0;
  3555. Laya.physicsTimer.scale = 0.7;
  3556. break;
  3557. }
  3558. }
  3559. }
  3560. selectBestEnterOne(arr) {
  3561. this.aiLv = xGame.tools.random(1, 11);
  3562. this.aiLv = 10;
  3563. this.wBall = xGame.common.d2World.rootBall;
  3564. this.rootPos.x = this.wBall.gameObj.x;
  3565. this.rootPos.y = this.wBall.gameObj.y;
  3566. this.initHoleBall(arr);
  3567. return this.selectBall();
  3568. }
  3569. selectBall() {
  3570. let ball = null;
  3571. this.destRot = 0;
  3572. let ai = 110 - this.aiLv * 10;
  3573. let mis = xGame.tools.random(-ai, ai) * 0.005;
  3574. let score = false;
  3575. if (this.scoreBall.length < 1) {
  3576. if (this.lineBall.length < 1) {
  3577. for (let i = 0; i < this.kickBall.length; i++) {
  3578. let list = [];
  3579. let bo = this.kickBall[i];
  3580. let bobj = bo.gameObj;
  3581. let rect = xGame.common.d2World.borderRect;
  3582. let mobj = this.wBall.gameObj;
  3583. let minb = bobj.y - rect.y - 20;
  3584. let minw = mobj.y - rect.y - 50;
  3585. if (minb > 0 && minw > 0) {
  3586. let dlenx = 0;
  3587. let dleny = mobj.y - rect.y;
  3588. let spx = mobj.x;
  3589. let spy = rect.y - dleny;
  3590. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3591. }
  3592. minb = rect.y + rect.height - bobj.y - 20;
  3593. minw = rect.y + rect.height - mobj.y - 50;
  3594. if (minb > 0 && minw > 0) {
  3595. let dlenx = 0;
  3596. let dleny = rect.y + rect.height - mobj.y;
  3597. let spx = mobj.x;
  3598. let spy = rect.y + rect.height + dleny;
  3599. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3600. }
  3601. minb = bobj.x - rect.x - 20;
  3602. minw = mobj.x - rect.x - 50;
  3603. if (minb > 0 && minw > 0) {
  3604. let dlenx = mobj.x - rect.x;
  3605. let dleny = 0;
  3606. let spx = rect.x - dlenx;
  3607. let spy = mobj.y;
  3608. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3609. }
  3610. minb = rect.x + rect.width - bobj.x - 20;
  3611. minw = rect.x + rect.width - mobj.x - 50;
  3612. if (minb > 0 && minw > 0) {
  3613. let dlenx = rect.x + rect.width - mobj.x;
  3614. let dleny = 0;
  3615. let spx = rect.x + rect.width + dlenx;
  3616. let spy = mobj.y;
  3617. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3618. }
  3619. list.sort(function (a, b) {
  3620. return a.order - b.order;
  3621. });
  3622. for (let i = 0; i < list.length; i++) {
  3623. let data = list[i];
  3624. let mx = mobj.x - bobj.x;
  3625. let my = mobj.y - bobj.y;
  3626. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  3627. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  3628. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3629. if (num > 1)
  3630. num = 1;
  3631. let cos = Math.acos(num);
  3632. if (cos > 1.57)
  3633. cos = 1.57;
  3634. else if (cos < 0.01)
  3635. cos = 0.01;
  3636. let tan = Math.tan(cos);
  3637. let dx = tan * data.dleny;
  3638. let dy = tan * data.dlenx;
  3639. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  3640. if (Math.abs(bx - 667) < 40)
  3641. continue;
  3642. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  3643. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  3644. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  3645. this.forceMax = dis * 0.08;
  3646. this.destRot += mis * 0.1;
  3647. this.setKick(bx, by);
  3648. return true;
  3649. }
  3650. }
  3651. }
  3652. }
  3653. else {
  3654. ball = xGame.common.getRandArrEle(this.lineBall);
  3655. }
  3656. }
  3657. else {
  3658. for (let i = 0; i < this.scoreBall.length; i++) {
  3659. if (i < this.scoreBall.length - 1) {
  3660. let rand = 70 + this.aiLv * 10 + i * 10;
  3661. if (xGame.tools.random(0, 100) < rand) {
  3662. ball = this.scoreBall[i];
  3663. break;
  3664. }
  3665. }
  3666. else {
  3667. ball = this.scoreBall[i];
  3668. break;
  3669. }
  3670. }
  3671. score = true;
  3672. this.selectNum++;
  3673. }
  3674. if (!ball)
  3675. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  3676. let dx = ball.gameObj.x;
  3677. let dy = ball.gameObj.y;
  3678. let kickAngle = 0;
  3679. if (score) {
  3680. dx = ball.kickPos.x;
  3681. dy = ball.kickPos.y;
  3682. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  3683. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  3684. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  3685. if (adot > 1)
  3686. adot = 1;
  3687. kickAngle = Math.acos(adot) * 57.3;
  3688. if (kickAngle > 45) {
  3689. let kdx = ball.kickPos.x - ball.gameObj.x;
  3690. let kdy = ball.kickPos.y - ball.gameObj.y;
  3691. dx = ball.kickPos.x - kdx * mis * 0.3;
  3692. dy = ball.kickPos.y - kdy * mis * 0.3;
  3693. }
  3694. else
  3695. this.destRot += mis;
  3696. }
  3697. else if (ball.poleAngle != 0) {
  3698. this.destRot += ball.poleAngle;
  3699. }
  3700. if (xGame.common.gameMode == 0) {
  3701. let af = kickAngle * 0.08;
  3702. this.forceMax = ball.hard * 0.1 + af * af;
  3703. }
  3704. this.setKick(dx, dy);
  3705. return ball;
  3706. }
  3707. initHoleBall(arr) {
  3708. this.kickBall = [];
  3709. this.lineBall = [];
  3710. this.scoreBall = [];
  3711. this.holeBall = [];
  3712. this.selectNum = 0;
  3713. this.forceNum = 0;
  3714. this.forceMax = 0;
  3715. this.turnNum = 0;
  3716. let list = arr;
  3717. let holes = xGame.common.gameMgr.holePosList;
  3718. let self = xGame.common.aiPlayer;
  3719. for (let i = 0; i < list.length; i++) {
  3720. let obj = list[i];
  3721. if (!obj)
  3722. continue;
  3723. obj.kickPos.x = 0;
  3724. obj.kickPos.y = 0;
  3725. obj.poleAngle = 0;
  3726. obj.hard = 0;
  3727. obj.borderDis = 0;
  3728. obj.kickAngle = 180;
  3729. let b = obj.gameObj;
  3730. let wbp = this.rootPos;
  3731. let bx = wbp.x - b.x;
  3732. let by = wbp.y - b.y;
  3733. obj.borderDis = xGame.tools.random(0, 100);
  3734. this.kickBall.push(obj);
  3735. if (!this.isLine(wbp, obj))
  3736. continue;
  3737. obj.kickAngle = xGame.tools.random(90, 180);
  3738. obj.kickPos.x = b.x;
  3739. obj.kickPos.y = b.y;
  3740. this.lineBall.push(obj);
  3741. let minDis = 999999;
  3742. let hole = false;
  3743. for (let j = 0; j < holes.length; j++) {
  3744. let hp = holes[j];
  3745. if (bx >= 0 && hp.x > b.x + 100)
  3746. continue;
  3747. if (bx <= 0 && hp.x < b.x - 100)
  3748. continue;
  3749. if (by < -10 && hp.y < wbp.y)
  3750. continue;
  3751. if (by > 10 && hp.y > wbp.y)
  3752. continue;
  3753. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  3754. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  3755. if (dis < minDis) {
  3756. let dx = b.x - this.tempDir1.x * this.ballSize;
  3757. let dy = b.y - this.tempDir1.y * this.ballSize;
  3758. this.tempDir3.x = this.tempDir1.x;
  3759. this.tempDir3.y = this.tempDir1.y;
  3760. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  3761. obj.kickPos.x = dx;
  3762. obj.kickPos.y = dy;
  3763. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  3764. if (num > 1)
  3765. num = 1;
  3766. obj.kickAngle = Math.acos(num) * 57.3;
  3767. if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2)
  3768. dis = dis * 2;
  3769. if (Math.abs(hp.x - 600) < 100)
  3770. dis += 50;
  3771. obj.hard = dis + obj.kickAngle * 3;
  3772. hole = true;
  3773. }
  3774. }
  3775. }
  3776. }
  3777. if (hole) {
  3778. this.scoreBall.push(obj);
  3779. this.holeBall.push(obj);
  3780. }
  3781. }
  3782. this.scoreBall.sort(function (a, b) {
  3783. return a.hard - b.hard;
  3784. });
  3785. this.holeBall.sort(function (a, b) {
  3786. return a.kickAngle - b.kickAngle;
  3787. });
  3788. this.kickBall.sort(function (a, b) {
  3789. return a.borderDis - b.borderDis;
  3790. });
  3791. }
  3792. isBlock(bn, bx, by, hx, hy, dn = -1) {
  3793. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  3794. let balls = xGame.common.d2World.ballArr;
  3795. let max = xGame.tools.getDis(hx, hy, bx, by);
  3796. for (let index = 0; index < balls.length; index++) {
  3797. let obj = balls[index];
  3798. if (obj.number == 0)
  3799. continue;
  3800. if (obj.number == bn || obj.number == dn)
  3801. continue;
  3802. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  3803. if (dis * dis > max)
  3804. continue;
  3805. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  3806. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3807. if (num > 1)
  3808. num = 1;
  3809. if (num < 0)
  3810. continue;
  3811. let gap = Math.sin(Math.acos(num)) * dis;
  3812. if (gap < this.ballSize)
  3813. return true;
  3814. }
  3815. return false;
  3816. }
  3817. isLine(xy, ball) {
  3818. let bx = xy.x;
  3819. let by = xy.y;
  3820. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  3821. let dis = ball.getDestDis(xy);
  3822. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  3823. let sin = Math.sin(angle);
  3824. let cos = Math.cos(angle);
  3825. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  3826. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  3827. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  3828. let dx = bx + this.tempDir2.x * dis;
  3829. let dy = by + this.tempDir2.y * dis;
  3830. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  3831. sin = Math.sin(-angle);
  3832. cos = Math.cos(-angle);
  3833. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  3834. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  3835. dx = bx + this.tempDir2.x * dis;
  3836. dy = by + this.tempDir2.y * dis;
  3837. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  3838. if (isr && isl)
  3839. return false;
  3840. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  3841. }
  3842. return true;
  3843. }
  3844. setKick(dx, dy) {
  3845. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  3846. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  3847. this.tempDir1.x = 0;
  3848. this.tempDir1.y = 1;
  3849. this.tempDir2.y = -this.tempDir2.y;
  3850. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3851. if (num > 1)
  3852. num = 1;
  3853. let rot = Math.acos(num) * 57.3;
  3854. if (this.tempDir2.x < 0)
  3855. rot = 360 - rot;
  3856. this.destRot += rot;
  3857. }
  3858. }
  3859. class ui_UIGame extends fgui.GComponent {
  3860. static createInstance() {
  3861. return (fgui.UIPackage.createObject("game", "UIGame"));
  3862. }
  3863. onConstruct() {
  3864. this.c1 = this.getController("c1");
  3865. this.d3Root = (this.getChild("d3Root"));
  3866. this.clickNode = (this.getChild("clickNode"));
  3867. this.d2Root = (this.getChild("d2Root"));
  3868. this.topNode = (this.getChild("topNode"));
  3869. this.n72 = (this.getChild("n72"));
  3870. this.n40 = (this.getChild("n40"));
  3871. this.rulerNode = (this.getChild("rulerNode"));
  3872. this.rulerClickNode = (this.getChild("rulerClickNode"));
  3873. this.n50 = (this.getChild("n50"));
  3874. this.keduNode = (this.getChild("keduNode"));
  3875. this.powerTxt = (this.getChild("powerTxt"));
  3876. this.powerNode = (this.getChild("powerNode"));
  3877. this.colorNode = (this.getChild("colorNode"));
  3878. this.powerEft = (this.getChild("powerEft"));
  3879. this.myPowerNode = (this.getChild("myPowerNode"));
  3880. this.ganNode = (this.getChild("ganNode"));
  3881. this.rodMethodNode = (this.getChild("rodMethodNode"));
  3882. this.placeChallengeNode = (this.getChild("placeChallengeNode"));
  3883. this.placeNormalNode = (this.getChild("placeNormalNode"));
  3884. this.skillRod = (this.getChild("skillRod"));
  3885. this.border = (this.getChild("border"));
  3886. this.bigSkillNode = (this.getChild("bigSkillNode"));
  3887. this.classicWorldsNode = (this.getChild("classicWorldsNode"));
  3888. this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode"));
  3889. this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode"));
  3890. this.awardSpineNode = (this.getChild("awardSpineNode"));
  3891. this.guanyuNode = (this.getChild("guanyuNode"));
  3892. this.helpBtn = (this.getChild("helpBtn"));
  3893. this.wordsBtn = (this.getChild("wordsBtn"));
  3894. this.aiWordsBtn = (this.getChild("aiWordsBtn"));
  3895. this.returnBtn = (this.getChild("returnBtn"));
  3896. this.ballNode = (this.getChild("ballNode"));
  3897. this.whiteAni = (this.getChild("whiteAni"));
  3898. this.blackAni = (this.getChild("blackAni"));
  3899. this.selfTurn = (this.getChild("selfTurn"));
  3900. this.aiTurn = (this.getChild("aiTurn"));
  3901. this.deskNode = (this.getChild("deskNode"));
  3902. this.moveNode = (this.getChild("moveNode"));
  3903. this.selfTalk = (this.getChild("selfTalk"));
  3904. this.aiTalk = (this.getChild("aiTalk"));
  3905. this.d2Node = (this.getChild("d2Node"));
  3906. this.snowNode = (this.getChild("snowNode"));
  3907. this.guide2 = (this.getChild("guide2"));
  3908. this.guide1 = (this.getChild("guide1"));
  3909. this.guide3 = (this.getChild("guide3"));
  3910. this.guideNode = (this.getChild("guideNode"));
  3911. }
  3912. }
  3913. ui_UIGame.URL = "ui://isxx5ak7kt443qg";
  3914. class ui_UIGameEnd extends fgui.GComponent {
  3915. static createInstance() {
  3916. return (fgui.UIPackage.createObject("game", "UIGameEnd"));
  3917. }
  3918. onConstruct() {
  3919. this.c1 = this.getController("c1");
  3920. this.n22 = (this.getChild("n22"));
  3921. this.n2 = (this.getChild("n2"));
  3922. this.n52 = (this.getChild("n52"));
  3923. this.n53 = (this.getChild("n53"));
  3924. this.coinNode = (this.getChild("coinNode"));
  3925. this.closeNode = (this.getChild("closeNode"));
  3926. this.moneyNode = (this.getChild("moneyNode"));
  3927. this.secretary = (this.getChild("secretary"));
  3928. this.n27 = (this.getChild("n27"));
  3929. this.n29 = (this.getChild("n29"));
  3930. this.talkNode = (this.getChild("talkNode"));
  3931. this.n38 = (this.getChild("n38"));
  3932. this.n39 = (this.getChild("n39"));
  3933. this.n40 = (this.getChild("n40"));
  3934. this.awardNode = (this.getChild("awardNode"));
  3935. this.starNumNode = (this.getChild("starNumNode"));
  3936. this.n47 = (this.getChild("n47"));
  3937. this.conditionNode = (this.getChild("conditionNode"));
  3938. this.isGetAward = (this.getChild("isGetAward"));
  3939. this.leftBtn = (this.getChild("leftBtn"));
  3940. this.rightBtn = (this.getChild("rightBtn"));
  3941. this.btnNode = (this.getChild("btnNode"));
  3942. }
  3943. }
  3944. ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3";
  3945. class ui_UIAddCoin extends fgui.GComponent {
  3946. static createInstance() {
  3947. return (fgui.UIPackage.createObject("game", "UIAddCoin"));
  3948. }
  3949. onConstruct() {
  3950. this.n11 = (this.getChild("n11"));
  3951. this.myNode = (this.getChild("myNode"));
  3952. this.t0 = this.getTransition("t0");
  3953. }
  3954. }
  3955. ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs";
  3956. class UIAddCoin extends UIBase {
  3957. constructor() {
  3958. super();
  3959. this.coinNum = 2000;
  3960. }
  3961. onConstructor() {
  3962. this.ui = ui_UIAddCoin.createInstance();
  3963. this.contentPane = this.ui;
  3964. this.isEject = false;
  3965. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  3966. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  3967. }
  3968. show() {
  3969. super.show();
  3970. this.ui.t0.play();
  3971. }
  3972. videoAddCoin() {
  3973. Moyu.showVideoAd(() => {
  3974. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  3975. this.hide();
  3976. }, EAdType.addFailCoin);
  3977. }
  3978. }
  3979. UIAddCoin.uiName = "UIAddCoin";
  3980. class ui_UIInvitation extends fgui.GComponent {
  3981. static createInstance() {
  3982. return (fgui.UIPackage.createObject("game", "UIInvitation"));
  3983. }
  3984. onConstruct() {
  3985. this.n14 = (this.getChild("n14"));
  3986. this.myNode = (this.getChild("myNode"));
  3987. this.t0 = this.getTransition("t0");
  3988. }
  3989. }
  3990. ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r";
  3991. class UIInvitation extends UIBase {
  3992. constructor() {
  3993. super();
  3994. }
  3995. onConstructor() {
  3996. this.ui = ui_UIInvitation.createInstance();
  3997. this.contentPane = this.ui;
  3998. this.isEject = false;
  3999. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  4000. }
  4001. show() {
  4002. super.show();
  4003. }
  4004. enterGame() {
  4005. xGame.common.gameMode = GameMode.classic;
  4006. DataMgr.setChallengeTimes(1);
  4007. xGame.common.passAwardCoin = 2000;
  4008. let need = xGame.common.classicNiceNeddCoin;
  4009. if (DataMgr.coinEnough(need)) {
  4010. DataMgr.setCoin(-need);
  4011. xGame.eventMgr.event(RESTART_GAME, true);
  4012. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  4013. }
  4014. else {
  4015. xGame.eventMgr.event(RESTART_GAME, true);
  4016. }
  4017. this.hide();
  4018. }
  4019. hide() {
  4020. super.hide();
  4021. }
  4022. }
  4023. UIInvitation.uiName = "UIInvitation";
  4024. class ui_UIMain extends fgui.GComponent {
  4025. static createInstance() {
  4026. return (fgui.UIPackage.createObject("game", "UIMain"));
  4027. }
  4028. onConstruct() {
  4029. this.n47 = (this.getChild("n47"));
  4030. this.n10 = (this.getChild("n10"));
  4031. this.secretary = (this.getChild("secretary"));
  4032. this.n33 = (this.getChild("n33"));
  4033. this.shopBtn = (this.getChild("shopBtn"));
  4034. this.moneyNode = (this.getChild("moneyNode"));
  4035. this.headNode = (this.getChild("headNode"));
  4036. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4037. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4038. this.classicBtn = (this.getChild("classicBtn"));
  4039. this.weeklyBtn = (this.getChild("weeklyBtn"));
  4040. this.globalBtn = (this.getChild("globalBtn"));
  4041. this.n44 = (this.getChild("n44"));
  4042. this.signBtn = (this.getChild("signBtn"));
  4043. this.drawBtn = (this.getChild("drawBtn"));
  4044. this.settingNode = (this.getChild("settingNode"));
  4045. this.n45 = (this.getChild("n45"));
  4046. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4047. this.rankBtn = (this.getChild("rankBtn"));
  4048. this.n46 = (this.getChild("n46"));
  4049. this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
  4050. this.liucheng1 = (this.getChild("liucheng1"));
  4051. this.rightBtn = (this.getChild("rightBtn"));
  4052. this.n75 = (this.getChild("n75"));
  4053. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4054. this.liucheng2 = (this.getChild("liucheng2"));
  4055. this.guideBtn = (this.getChild("guideBtn"));
  4056. this.n73 = (this.getChild("n73"));
  4057. this.wordsNode = (this.getChild("wordsNode"));
  4058. this.enterGuide = (this.getChild("enterGuide"));
  4059. this.talkNode = (this.getChild("talkNode"));
  4060. this.n83 = (this.getChild("n83"));
  4061. this.n84 = (this.getChild("n84"));
  4062. }
  4063. }
  4064. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4065. class ui_UIMoyu extends fgui.GComponent {
  4066. static createInstance() {
  4067. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4068. }
  4069. onConstruct() {
  4070. this.ageTip = (this.getChild("ageTip"));
  4071. this.mainBg = (this.getChild("mainBg"));
  4072. this.xyNode = (this.getChild("xyNode"));
  4073. this.rnNode = (this.getChild("rnNode"));
  4074. this.fcmNode = (this.getChild("fcmNode"));
  4075. this.ageNode = (this.getChild("ageNode"));
  4076. this.tipNode = (this.getChild("tipNode"));
  4077. this.msgNode = (this.getChild("msgNode"));
  4078. }
  4079. }
  4080. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4081. class MoyuMgr {
  4082. static initMoyu() {
  4083. this.moyuView = new MoyuView();
  4084. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4085. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4086. this.moyuView.ui.displayObject.zOrder = 1000;
  4087. this.moyuView.init();
  4088. this.moyuView.showTip(true);
  4089. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4090. window['XApk'] = this;
  4091. }
  4092. static showAge(show) {
  4093. if (this.moyuView)
  4094. this.moyuView.showAge(show);
  4095. }
  4096. static onPlatMsg(idx) {
  4097. if (!MoyuMgr.moyuView)
  4098. return;
  4099. if (idx == '0') {
  4100. MoyuMgr.moyuView.showTip(false);
  4101. }
  4102. }
  4103. static showAgree(call) {
  4104. if (this.moyuView)
  4105. this.moyuView.showAgree(call);
  4106. else
  4107. call && call();
  4108. }
  4109. static showXy(type = 1) {
  4110. if (this.moyuView)
  4111. this.moyuView.showXy(type);
  4112. }
  4113. }
  4114. MoyuMgr.isAdvise = false;
  4115. class MoyuView {
  4116. constructor() {
  4117. this.ysxyNum = 1;
  4118. this.ysJson = null;
  4119. this.ui = ui_UIMoyu.createInstance();
  4120. }
  4121. init() {
  4122. this.ui.mainBg.visible = false;
  4123. this.ui.xyNode.visible = false;
  4124. this.ui.ageNode.visible = false;
  4125. this.ui.tipNode.visible = false;
  4126. this.ui.rnNode.visible = false;
  4127. this.ui.fcmNode.visible = false;
  4128. this.ui.ageTip.visible = false;
  4129. this.ui.msgNode.visible = false;
  4130. this.ui.visible = false;
  4131. this.ui.xyNode.xyList.setVirtual();
  4132. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4133. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4134. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4135. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4136. this.ui.xyNode.btnKnown.visible = false;
  4137. this.ui.xyNode.xy1.visible = false;
  4138. this.ui.xyNode.xy2.visible = false;
  4139. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4140. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4141. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4142. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4143. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4144. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4145. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4146. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4147. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4148. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4149. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4150. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4151. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4152. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4153. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4154. this.ysxyNum = 2;
  4155. }
  4156. }
  4157. onClick(obj) {
  4158. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4159. switch (obj) {
  4160. case this.ui.ageTip:
  4161. if (Moyu.isTTApk) {
  4162. this.ui.ageNode.visible = true;
  4163. this.ui.mainBg.visible = true;
  4164. }
  4165. break;
  4166. case this.ui.tipNode:
  4167. this.showTip(false);
  4168. break;
  4169. case this.ui.ageNode.btnAge:
  4170. this.ui.ageNode.visible = false;
  4171. this.ui.mainBg.visible = false;
  4172. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4173. this.ui.visible = false;
  4174. break;
  4175. case this.ui.xyNode.btnXy3:
  4176. case this.ui.xyNode.btnXy1:
  4177. this.loadXy(1);
  4178. break;
  4179. case this.ui.xyNode.btnXy2:
  4180. this.loadXy(2);
  4181. break;
  4182. case this.ui.xyNode.btnBack:
  4183. this.ui.xyNode.xy1.visible = true;
  4184. this.ui.xyNode.xy2.visible = false;
  4185. break;
  4186. case this.ui.xyNode.btnKnown:
  4187. this.ui.xyNode.visible = false;
  4188. this.ui.mainBg.visible = false;
  4189. this.ui.visible = false;
  4190. break;
  4191. case this.ui.rnNode.btnCheck:
  4192. this.check();
  4193. break;
  4194. case this.ui.rnNode.btnExit:
  4195. case this.ui.xyNode.btnNo:
  4196. this.ysxyNum--;
  4197. if (this.ysxyNum > 0)
  4198. this.showMsg("Refuse to quit the game once again");
  4199. else {
  4200. Moyu.userAgree(false);
  4201. Moyu.exit();
  4202. }
  4203. break;
  4204. case this.ui.xyNode.btnSure:
  4205. case this.ui.xyNode.btnYes:
  4206. DataMgr.userData.isAgree = true;
  4207. DataMgr.saveUserData();
  4208. this.onAgree();
  4209. break;
  4210. case this.ui.rnNode.btnDone:
  4211. this.ui.rnNode.visible = false;
  4212. this.ui.visible = false;
  4213. break;
  4214. case this.ui.fcmNode.btnRn:
  4215. this.showRn();
  4216. break;
  4217. }
  4218. }
  4219. showTip(show) {
  4220. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4221. return;
  4222. if (show) {
  4223. MoyuMgr.isAdvise = true;
  4224. this.ui.visible = true;
  4225. this.ui.tipNode.visible = true;
  4226. this.ui.tipNode.alpha = 1;
  4227. Laya.timer.once(1000, this, this.showTip, [false]);
  4228. }
  4229. else {
  4230. this.ui.tipNode.alpha = 1;
  4231. this.ui.tipNode.visible = true;
  4232. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4233. this.ui.tipNode.visible = false;
  4234. MoyuMgr.isAdvise = false;
  4235. }), 1000);
  4236. }
  4237. }
  4238. showAge(show, px = 0, py = 0) {
  4239. if (Moyu.platType > 10 && !Moyu.isIos) {
  4240. this.ui.ageTip.x = px;
  4241. this.ui.ageTip.y = py;
  4242. this.ui.ageTip.visible = show;
  4243. if (show)
  4244. this.ui.visible = true;
  4245. }
  4246. }
  4247. showAgree(call) {
  4248. this.agreeCall = call;
  4249. this.onAgree();
  4250. return;
  4251. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4252. this.showXy(0);
  4253. }
  4254. else
  4255. this.onAgree();
  4256. }
  4257. onAgree() {
  4258. if (!this.ui.ageNode.visible)
  4259. this.ui.visible = false;
  4260. this.ui.xyNode.visible = false;
  4261. Moyu.userAgree(true);
  4262. this.showAge(false);
  4263. this.agreeCall && this.agreeCall();
  4264. this.showRn();
  4265. }
  4266. showMsg(txt) {
  4267. this.ui.msgNode.txtMsg.text = txt;
  4268. this.ui.msgNode.visible = true;
  4269. this.ui.msgNode.alpha = 1;
  4270. this.ui.visible = true;
  4271. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4272. this.ui.msgNode.visible = false;
  4273. }), 2500, true);
  4274. }
  4275. showRn() {
  4276. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4277. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4278. this.ui.rnNode.rn1.visible = true;
  4279. this.ui.rnNode.rn2.visible = false;
  4280. this.ui.rnNode.rn3.visible = false;
  4281. this.ui.rnNode.rn4.visible = false;
  4282. this.ui.rnNode.visible = true;
  4283. this.ui.mainBg.visible = true;
  4284. this.ui.rnNode.btnDone.visible = false;
  4285. this.ui.rnNode.btnExit.visible = true;
  4286. this.ui.rnNode.btnCheck.visible = true;
  4287. this.ui.fcmNode.visible = false;
  4288. this.ui.visible = true;
  4289. return;
  4290. }
  4291. }
  4292. this.showFcm();
  4293. }
  4294. showFcm() {
  4295. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4296. Moyu.initFCM(true);
  4297. if (Moyu.gameTime < 1)
  4298. this.fcmLoop();
  4299. else if (Moyu.gameTime < 999)
  4300. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4301. }
  4302. }
  4303. fcmLoop() {
  4304. if (Moyu.gameTime < 1) {
  4305. this.ui.rnNode.visible = false;
  4306. this.ui.fcmNode.visible = true;
  4307. this.ui.mainBg.visible = true;
  4308. this.ui.visible = true;
  4309. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4310. Laya.timer.clear(this.ui, this.fcmLoop);
  4311. }
  4312. }
  4313. check() {
  4314. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4315. this.ui.rnNode.rn1.visible = false;
  4316. this.ui.rnNode.rn2.visible = false;
  4317. this.ui.rnNode.rn4.visible = true;
  4318. }
  4319. else if (this.ui.rnNode.rn4.visible) {
  4320. let name = this.ui.rnNode.inputName.text;
  4321. let code = this.ui.rnNode.inputCode.text;
  4322. if (code && code.length == 18) {
  4323. this.ui.rnNode.rn1.visible = false;
  4324. this.ui.rnNode.rn4.visible = false;
  4325. Moyu.authenticate(name, code, (res) => {
  4326. this.ui.rnNode.rn2.visible = !res;
  4327. this.ui.rnNode.rn3.visible = res;
  4328. this.ui.rnNode.btnDone.visible = res;
  4329. this.ui.rnNode.btnExit.visible = !res;
  4330. this.ui.rnNode.btnCheck.visible = !res;
  4331. if (res)
  4332. this.showFcm();
  4333. });
  4334. }
  4335. else
  4336. this.showMsg("信息填写不完整");
  4337. }
  4338. }
  4339. loadXy(type = 0) {
  4340. this.ui.xyNode.xy1.visible = false;
  4341. this.ui.xyNode.xy2.visible = true;
  4342. this.ui.xyNode.xyList.scrollToView(0);
  4343. if (type == 1) {
  4344. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4345. }
  4346. else if (type == 2) {
  4347. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4348. }
  4349. }
  4350. showXy(type = 0) {
  4351. this.xyBtn();
  4352. if (type == 0) {
  4353. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4354. this.ui.xyNode.btnSure.visible = true;
  4355. }
  4356. else {
  4357. this.ui.xyNode.btnYes.visible = true;
  4358. this.ui.xyNode.btnNo.visible = true;
  4359. }
  4360. }
  4361. else {
  4362. this.ui.xyNode.btnKnown.visible = true;
  4363. this.ui.mainBg.visible = true;
  4364. }
  4365. this.ui.xyNode.xy1.visible = true;
  4366. this.ui.xyNode.xy2.visible = false;
  4367. this.ui.xyNode.visible = true;
  4368. this.ui.visible = true;
  4369. }
  4370. xyBtn() {
  4371. this.ui.xyNode.btnSure.visible = false;
  4372. this.ui.xyNode.btnYes.visible = false;
  4373. this.ui.xyNode.btnNo.visible = false;
  4374. this.ui.xyNode.btnKnown.visible = false;
  4375. {
  4376. this.ui.xyNode.btnXy3.visible = false;
  4377. this.ui.xyNode.btnXy2.visible = true;
  4378. this.ui.xyNode.btnXy1.visible = true;
  4379. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4380. }
  4381. }
  4382. createXY(json) {
  4383. this.ysJson = json.content;
  4384. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4385. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4386. this.ui.xyNode.xy2.visible = true;
  4387. }
  4388. renderListItem(idx, cell) {
  4389. let xy = this.ysJson[idx];
  4390. cell.height = xy.line * 30;
  4391. cell.xyItem.text = xy.text;
  4392. }
  4393. onDestroy() {
  4394. this.agreeCall = null;
  4395. }
  4396. }
  4397. class SettingNode {
  4398. constructor(ui) {
  4399. this.showSetting = false;
  4400. this.openSound = true;
  4401. this.openShake = true;
  4402. this.ui = ui;
  4403. this.ui.soundBtn.onClick(this, this.switchSound);
  4404. this.ui.shakeBtn.onClick(this, this.switchShake);
  4405. this.ui.xyBtn.onClick(this, this.onXy);
  4406. this.ui.clickNode.onClick(this, this.changeSetting);
  4407. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4408. }
  4409. changeSetting() {
  4410. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4411. this.showSetting = !this.showSetting;
  4412. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4413. }
  4414. switchSound() {
  4415. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4416. this.openSound = !this.openSound;
  4417. Moyu.onSetting(this.openSound, this.openShake);
  4418. xGame.soundMgr.onSetting(this.openSound);
  4419. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4420. }
  4421. switchShake() {
  4422. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4423. this.openShake = !this.openShake;
  4424. Moyu.onSetting(this.openSound, this.openShake);
  4425. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4426. }
  4427. onXy() {
  4428. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4429. MoyuMgr.showXy(1);
  4430. }
  4431. }
  4432. class ui_UILevelDisplay extends fgui.GComponent {
  4433. static createInstance() {
  4434. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4435. }
  4436. onConstruct() {
  4437. this.n9 = (this.getChild("n9"));
  4438. this.myNode = (this.getChild("myNode"));
  4439. this.closeNode = (this.getChild("closeNode"));
  4440. }
  4441. }
  4442. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4443. class ui_UILevelProp extends fgui.GComponent {
  4444. static createInstance() {
  4445. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4446. }
  4447. onConstruct() {
  4448. this.n16 = (this.getChild("n16"));
  4449. this.myNode = (this.getChild("myNode"));
  4450. this.closeBtn = (this.getChild("closeBtn"));
  4451. this.moneyNode = (this.getChild("moneyNode"));
  4452. this.t1 = this.getTransition("t1");
  4453. }
  4454. }
  4455. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  4456. class ui_ShowItem extends fgui.GComponent {
  4457. static createInstance() {
  4458. return (fgui.UIPackage.createObject("game", "ShowItem"));
  4459. }
  4460. onConstruct() {
  4461. this.myImg = (this.getChild("myImg"));
  4462. }
  4463. }
  4464. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  4465. class ShowItem {
  4466. constructor() {
  4467. this.ui = ui_ShowItem.createInstance();
  4468. }
  4469. destroySelf() {
  4470. if (!this.ui.isDisposed) {
  4471. this.ui.removeFromParent();
  4472. this.ui.dispose();
  4473. }
  4474. }
  4475. setParent(parent) {
  4476. parent.addChild(this.ui);
  4477. }
  4478. setPos(x, y) {
  4479. this.ui.x = x;
  4480. this.ui.y = y;
  4481. }
  4482. setUrl(index) {
  4483. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  4484. }
  4485. }
  4486. class ui_UIPower extends fgui.GComponent {
  4487. static createInstance() {
  4488. return (fgui.UIPackage.createObject("game", "UIPower"));
  4489. }
  4490. onConstruct() {
  4491. this.n11 = (this.getChild("n11"));
  4492. this.myNode = (this.getChild("myNode"));
  4493. this.t0 = this.getTransition("t0");
  4494. }
  4495. }
  4496. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  4497. class UIPower extends UIBase {
  4498. constructor() {
  4499. super();
  4500. }
  4501. onConstructor() {
  4502. this.ui = ui_UIPower.createInstance();
  4503. this.contentPane = this.ui;
  4504. this.isEject = false;
  4505. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4506. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  4507. }
  4508. show() {
  4509. super.show();
  4510. this.ui.t0.play();
  4511. }
  4512. videoGetPower() {
  4513. Moyu.showVideoAd(() => {
  4514. DataMgr.setPower(xGame.common.videoPower, true);
  4515. xGame.eventMgr.event(POWER_TIME);
  4516. this.hide();
  4517. }, EAdType.getPower);
  4518. }
  4519. }
  4520. UIPower.uiName = "UIPower";
  4521. class UILevelProp extends UIBase {
  4522. constructor() {
  4523. super();
  4524. this.firstPos = 385;
  4525. this.secondPos = 467;
  4526. this.showItemArr = [];
  4527. }
  4528. onConstructor() {
  4529. this.ui = ui_UILevelProp.createInstance();
  4530. this.contentPane = this.ui;
  4531. this.isEject = false;
  4532. this.addUIClick(this.ui.closeBtn, this.hide);
  4533. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  4534. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  4535. }
  4536. show(level) {
  4537. super.show();
  4538. this.ui.t1.play();
  4539. this.level = level;
  4540. this.data = cfgTable.placeballData[this.level];
  4541. this.updateSelf();
  4542. this.showPreView();
  4543. this.moneyNode.ui.c1.selectedIndex = 2;
  4544. this.moneyNode.checkPowerTime();
  4545. this.moneyNode.powerChange();
  4546. }
  4547. showPreView() {
  4548. let item;
  4549. let data;
  4550. for (let index = 0; index < this.showItemArr.length; index++) {
  4551. item = this.showItemArr[index];
  4552. item.destroySelf();
  4553. }
  4554. this.showItemArr = [];
  4555. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  4556. for (const key in cfgData) {
  4557. data = cfgData[key];
  4558. item = new ShowItem();
  4559. item.setParent(this.ui.myNode.displayRoot);
  4560. item.setPos(data.x, data.y);
  4561. item.setUrl(data.value);
  4562. this.showItemArr.push(item);
  4563. }
  4564. }
  4565. updateSelf() {
  4566. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  4567. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  4568. if (this.data.ball == -1) {
  4569. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  4570. }
  4571. else {
  4572. this.ui.myNode.conditionTxt.text = "Reward";
  4573. }
  4574. let localData = DataMgr.getPlaceBallLevel(this.level);
  4575. let getAward = localData.getAward;
  4576. let cfg = cfgTable.placeballData[this.level];
  4577. let coin = this.data.award[0];
  4578. let diamond = this.data.award[1];
  4579. if (cfg.type == PlaceBallType.challenge) {
  4580. diamond = 0;
  4581. coin = 100;
  4582. }
  4583. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  4584. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  4585. this.ui.myNode.coinNode.numTxt.text = coin + "";
  4586. if (cfg.type == PlaceBallType.challenge) {
  4587. this.ui.myNode.coinNode.numTxt.text = "";
  4588. }
  4589. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  4590. if (coin > 0 && diamond > 0) {
  4591. this.ui.myNode.diamondNode.x = 385;
  4592. this.ui.myNode.coinNode.x = 467;
  4593. }
  4594. else {
  4595. this.ui.myNode.diamondNode.x = 385;
  4596. this.ui.myNode.coinNode.x = 385;
  4597. }
  4598. if (!getAward) {
  4599. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  4600. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  4601. }
  4602. else {
  4603. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  4604. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  4605. }
  4606. }
  4607. startGame() {
  4608. if (DataMgr.powerEnough()) {
  4609. this.ui.myNode.startBtn.touchable = false;
  4610. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  4611. console.log('zh:startGame ');
  4612. this.ui.myNode.startBtn.touchable = true;
  4613. DataMgr.setPower(-1);
  4614. xGame.eventMgr.event(POWER_TIME);
  4615. xGame.common.gameMode = GameMode.placeBall;
  4616. xGame.common.placeBallCurLevel = this.level;
  4617. xGame.uiMgr.Show(UIGame);
  4618. xGame.uiMgr.Hide(UILevelDisplay);
  4619. xGame.uiMgr.Hide(UIMain);
  4620. this.hide();
  4621. }));
  4622. }
  4623. else {
  4624. console.log('zh:startGame no power');
  4625. xGame.uiMgr.Show(UIPower);
  4626. }
  4627. }
  4628. hide() {
  4629. super.hide();
  4630. }
  4631. }
  4632. UILevelProp.uiName = "UILevelProp";
  4633. class PutBallLevelDisplay {
  4634. constructor(ui, index) {
  4635. this.index = 0;
  4636. this.ui = ui;
  4637. this.index = index;
  4638. this.ui.onClick(this, this.clickSelf);
  4639. this.updateSelf();
  4640. this.ui.levelTxt.text = (this.index + 1) + "";
  4641. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  4642. this.ui.special.levelTxt.text = (this.index + 1) + "";
  4643. }
  4644. updateSelf() {
  4645. let level = this.index + 1;
  4646. this.data = DataMgr.getPlaceBallLevel(level);
  4647. this.ui.starNode.c1.selectedIndex = this.data.star;
  4648. let isChallenge = cfgTable.placeballData[level].type;
  4649. if (this.data.isCur) {
  4650. if (isChallenge) {
  4651. this.ui.c1.selectedIndex = 5;
  4652. }
  4653. else {
  4654. this.ui.c1.selectedIndex = 2;
  4655. }
  4656. }
  4657. else {
  4658. if (this.data.play) {
  4659. if (this.data.star == 3) {
  4660. this.ui.c1.selectedIndex = 0;
  4661. }
  4662. else {
  4663. this.ui.c1.selectedIndex = 1;
  4664. }
  4665. }
  4666. else {
  4667. if (isChallenge) {
  4668. this.ui.c1.selectedIndex = 4;
  4669. }
  4670. else {
  4671. this.ui.c1.selectedIndex = 3;
  4672. }
  4673. }
  4674. }
  4675. }
  4676. clickSelf() {
  4677. if (!this.data.play)
  4678. return;
  4679. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4680. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  4681. }
  4682. }
  4683. class UILevelDisplay extends UIBase {
  4684. constructor() {
  4685. super();
  4686. }
  4687. onConstructor() {
  4688. this.ui = ui_UILevelDisplay.createInstance();
  4689. this.contentPane = this.ui;
  4690. this.isEject = false;
  4691. this.myList = this.ui.myNode.myList;
  4692. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  4693. this.levelItemArr = [];
  4694. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  4695. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  4696. this.myList.numItems = levelNum;
  4697. if (Moyu.isKs)
  4698. this.ui.closeNode.closeBtn.x += 100;
  4699. }
  4700. levelItemRender(index, target) {
  4701. let item = new PutBallLevelDisplay(target, index);
  4702. this.levelItemArr.push(item);
  4703. }
  4704. show() {
  4705. super.show();
  4706. this.updateLevel();
  4707. this.scrollToPlace();
  4708. }
  4709. updateLevel() {
  4710. let temp;
  4711. for (let index = 0; index < this.levelItemArr.length; index++) {
  4712. temp = this.levelItemArr[index];
  4713. temp.updateSelf();
  4714. }
  4715. }
  4716. scrollToPlace() {
  4717. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  4718. let passArr = DataMgr.getPlaceBallLevelList();
  4719. let offest = passArr.length;
  4720. if (offest >= maxNum - 1)
  4721. offest = maxNum - 1;
  4722. this.myList.scrollToView(offest, true, true);
  4723. }
  4724. hide() {
  4725. super.hide();
  4726. }
  4727. }
  4728. UILevelDisplay.uiName = "UILevelDisplay";
  4729. class ui_UIMatching extends fgui.GComponent {
  4730. static createInstance() {
  4731. return (fgui.UIPackage.createObject("game", "UIMatching"));
  4732. }
  4733. onConstruct() {
  4734. this.n5 = (this.getChild("n5"));
  4735. this.n49 = (this.getChild("n49"));
  4736. this.n51 = (this.getChild("n51"));
  4737. this.n64 = (this.getChild("n64"));
  4738. this.n2 = (this.getChild("n2"));
  4739. this.n53 = (this.getChild("n53"));
  4740. this.n54 = (this.getChild("n54"));
  4741. this.n56 = (this.getChild("n56"));
  4742. this.n58 = (this.getChild("n58"));
  4743. this.n59 = (this.getChild("n59"));
  4744. this.n57 = (this.getChild("n57"));
  4745. this.n60 = (this.getChild("n60"));
  4746. this.n62 = (this.getChild("n62"));
  4747. this.awardTxt = (this.getChild("awardTxt"));
  4748. this.n61 = (this.getChild("n61"));
  4749. this.selfHead = (this.getChild("selfHead"));
  4750. this.aiHead = (this.getChild("aiHead"));
  4751. this.n82 = (this.getChild("n82"));
  4752. this.n84 = (this.getChild("n84"));
  4753. this.n83 = (this.getChild("n83"));
  4754. this.t1 = this.getTransition("t1");
  4755. this.t2 = this.getTransition("t2");
  4756. this.t3 = this.getTransition("t3");
  4757. this.t4 = this.getTransition("t4");
  4758. }
  4759. }
  4760. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  4761. class UIMatching extends UIBase {
  4762. constructor() {
  4763. super();
  4764. }
  4765. onConstructor() {
  4766. this.ui = ui_UIMatching.createInstance();
  4767. this.contentPane = this.ui;
  4768. this.isEject = false;
  4769. }
  4770. show(callback) {
  4771. super.show();
  4772. PlatMgr.showBanner(true);
  4773. this.callback = callback;
  4774. let user = Moyu.getUserInfo();
  4775. if (!this.selfPot) {
  4776. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  4777. }
  4778. if (!this.aiPot) {
  4779. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  4780. }
  4781. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  4782. this.ui.selfHead.nameTxt.text = user.nickName;
  4783. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  4784. this.ui.aiHead.nameTxt.text = "???";
  4785. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  4786. this.ui.selfHead.c1.selectedIndex = 0;
  4787. this.ui.aiHead.c1.selectedIndex = 0;
  4788. this.ui.selfHead.x = this.selfPot.x;
  4789. this.ui.selfHead.y = this.selfPot.y;
  4790. this.ui.aiHead.x = this.aiPot.x;
  4791. this.ui.aiHead.y = this.aiPot.y;
  4792. switch (xGame.common.gameMode) {
  4793. case GameMode.classic:
  4794. break;
  4795. case GameMode.bigMove:
  4796. this.initSkillData();
  4797. break;
  4798. default:
  4799. break;
  4800. }
  4801. this.ui.t1.play(Laya.Handler.create(this, () => {
  4802. this.ui.t2.play(Laya.Handler.create(this, () => {
  4803. switch (xGame.common.gameMode) {
  4804. case GameMode.classic:
  4805. this.waitingPeople();
  4806. break;
  4807. case GameMode.bigMove:
  4808. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  4809. break;
  4810. default:
  4811. break;
  4812. }
  4813. }));
  4814. }));
  4815. }
  4816. initSkillData() {
  4817. this.skillSelectData = [];
  4818. let skillUrl = xGame.common.skillIconList;
  4819. let skillName = xGame.common.skillNameList;
  4820. let skillLevel = DataMgr.getBigSkillList();
  4821. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  4822. for (let index = 0; index < 5; index++) {
  4823. let obj = {};
  4824. obj.skillImg = skillUrl[index];
  4825. obj.skillName = skillName[index];
  4826. obj.skillType = skillType[index];
  4827. obj.skillLevel = skillLevel[index];
  4828. this.skillSelectData.push(obj);
  4829. }
  4830. }
  4831. getAISkillLevel(myLevel) {
  4832. let video = xGame.common.upSkillLevel;
  4833. let aiLevel;
  4834. let temp;
  4835. if (video) {
  4836. temp = xGame.common.randomNum(-2, -1);
  4837. }
  4838. else {
  4839. if (myLevel <= 5) {
  4840. temp = xGame.common.randomNum(1, 3);
  4841. }
  4842. else if (myLevel <= 9) {
  4843. temp = xGame.common.randomNum(-2, 1);
  4844. }
  4845. else {
  4846. temp = xGame.common.randomNum(-4, 0);
  4847. }
  4848. }
  4849. aiLevel = temp + myLevel;
  4850. if (aiLevel <= 1)
  4851. aiLevel = 1;
  4852. if (aiLevel >= 10)
  4853. aiLevel = 10;
  4854. return aiLevel;
  4855. }
  4856. getAISkillType() {
  4857. return xGame.common.randomNum(1, 4);
  4858. let successTimes = DataMgr.getSkillSuccessTimes();
  4859. let info = cfgTable.aiskillData[successTimes];
  4860. if (!info) {
  4861. let max = Object.keys(cfgTable.aiskillData).length - 1;
  4862. info = cfgTable.aiskillData[max];
  4863. }
  4864. let dataArr = info.skillselect;
  4865. let myCfg = {};
  4866. for (let index = 0; index < dataArr.length; index++) {
  4867. let temp = dataArr[index].split('-');
  4868. myCfg[temp[0]] = {};
  4869. myCfg[temp[0]].id = parseInt(temp[0]);
  4870. myCfg[temp[0]].weight = parseInt(temp[1]);
  4871. }
  4872. let aiCfg = xGame.common.initWeight(myCfg);
  4873. let curData = xGame.common.getRandomWeightData(aiCfg);
  4874. return parseInt(curData.id);
  4875. }
  4876. getAISkillData(index) {
  4877. let myLevel = this.skillSelectData[index].skillLevel;
  4878. let aiLevel = this.getAISkillLevel(myLevel);
  4879. let aiType = this.getAISkillType() - 1;
  4880. return { aiLevel, aiType } = { aiLevel, aiType };
  4881. }
  4882. skillSelectFinish(index) {
  4883. let aiInfo = this.getAISkillData(index);
  4884. xGame.common.gameMgr.selfCurSkill = index;
  4885. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  4886. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  4887. this.ui.selfHead.c1.selectedIndex = 1;
  4888. this.ui.aiHead.c1.selectedIndex = 1;
  4889. let myData = this.skillSelectData[index];
  4890. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  4891. let guide = DataMgr.getSkillGuide();
  4892. if (guide == 0) {
  4893. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  4894. }
  4895. else {
  4896. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  4897. }
  4898. let aiData = this.skillSelectData[aiInfo.aiType];
  4899. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  4900. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  4901. this.waitingPeople();
  4902. }
  4903. waitingPeople() {
  4904. let time = xGame.common.randomNum(1000, 3000);
  4905. time += 1000;
  4906. Laya.timer.once(time, this, () => {
  4907. this.matchingSuccess();
  4908. });
  4909. }
  4910. matchingSuccess() {
  4911. let gameUI = xGame.common.gameUI;
  4912. let name = gameUI.ui.topNode.aiNameTxt.text;
  4913. let url = gameUI.ui.topNode.aiHeadLoader.url;
  4914. this.ui.aiHead.nameTxt.text = name;
  4915. this.ui.aiHead.headImg.url = url;
  4916. name = gameUI.ui.topNode.selfNameTxt.text;
  4917. url = gameUI.ui.topNode.selfHeadLoader.url;
  4918. this.ui.selfHead.nameTxt.text = name;
  4919. this.ui.selfHead.headImg.url = url;
  4920. this.ui.t3.play(Laya.Handler.create(this, () => {
  4921. this.callback && this.callback();
  4922. this.ui.t4.play(Laya.Handler.create(this, () => {
  4923. this.destroySelf();
  4924. }));
  4925. }));
  4926. }
  4927. destroySelf() {
  4928. this.callback = null;
  4929. this.skillSelectData = null;
  4930. this.selfPot = null;
  4931. this.aiPot = null;
  4932. if (!this.ui.isDisposed) {
  4933. this.ui.removeFromParent();
  4934. this.ui.dispose();
  4935. }
  4936. xGame.uiMgr.destroyUI(this);
  4937. }
  4938. }
  4939. UIMatching.uiName = "UIMatching";
  4940. class ui_UIRanking extends fgui.GComponent {
  4941. static createInstance() {
  4942. return (fgui.UIPackage.createObject("game", "UIRanking"));
  4943. }
  4944. onConstruct() {
  4945. this.n26 = (this.getChild("n26"));
  4946. this.myNode = (this.getChild("myNode"));
  4947. }
  4948. }
  4949. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  4950. class UIRanking extends UIBase {
  4951. constructor() {
  4952. super();
  4953. this.showSelf = true;
  4954. this.rankType = 1;
  4955. this.rankList = [];
  4956. this.myIndex = 0;
  4957. this.myStar = 0;
  4958. }
  4959. onConstructor() {
  4960. this.ui = ui_UIRanking.createInstance();
  4961. this.contentPane = this.ui;
  4962. this.isEject = false;
  4963. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  4964. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  4965. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  4966. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  4967. this.ui.myNode.myList.setVirtual();
  4968. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  4969. }
  4970. show() {
  4971. super.show();
  4972. this.myIndex = 51;
  4973. Moyu.getRankList({
  4974. rankId: xGame.common.curRankID,
  4975. type: MoyuRankType.total,
  4976. page: 1,
  4977. pageSize: 50,
  4978. }, this, this.updateItemData);
  4979. this.updateSelf();
  4980. let self = Moyu.getUserInfo();
  4981. if (!self.isAuth) {
  4982. Moyu.initUser(this, () => {
  4983. DataMgr.upRankData();
  4984. });
  4985. }
  4986. }
  4987. updateSelfItem() {
  4988. let self = Moyu.getUserInfo();
  4989. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  4990. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > 50 ? "未上榜" : this.myIndex.toString();
  4991. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  4992. this.ui.myNode.selfNode.nameTxt.text = Moyu.platType < 11 ? self.nickName : "myself";
  4993. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  4994. }
  4995. updateItemData(data) {
  4996. this.myStar = xGame.common.getAllStarNum();
  4997. if (this.rankList.length < 2) {
  4998. this.rankList = data;
  4999. let self = Moyu.getUserInfo();
  5000. for (let i = 0; i < data.length; i++) {
  5001. let data = this.rankList[i];
  5002. if (data.userId == self.userId) {
  5003. this.rankList.splice(i, 1);
  5004. break;
  5005. }
  5006. }
  5007. for (let i = 0; i < data.length; i++) {
  5008. let data = this.rankList[i];
  5009. if (data.rankScore < this.myStar && this.myIndex > 50) {
  5010. this.myIndex = i + 1;
  5011. let user = { headIcon: self.headIcon, nickName: "myself" };
  5012. let ud = { user: user, data: {} };
  5013. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5014. if (Moyu.platType < 11) {
  5015. user.headIcon = self.headIcon;
  5016. user.nickName = self.nickName;
  5017. }
  5018. this.rankList.splice(i, 0, md);
  5019. break;
  5020. }
  5021. }
  5022. }
  5023. this.updateSelfItem();
  5024. this.ui.myNode.myList.numItems = this.rankList.length;
  5025. }
  5026. updateItemUI(index, obj) {
  5027. let data = this.rankList[index];
  5028. let userData = JSON.parse(data.userData).user;
  5029. obj.nameTxt.text = userData.nickName.toString();
  5030. obj.valueTxt.text = data.rankScore;
  5031. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5032. obj.rankTxt.text = index + 1;
  5033. switch (index) {
  5034. case 0:
  5035. this.setImg(obj, 1, 0, 0);
  5036. obj.rankTxt.color = "#FFC047";
  5037. break;
  5038. case 1:
  5039. this.setImg(obj, 0, 1, 0);
  5040. obj.rankTxt.color = "#ACACAC";
  5041. break;
  5042. case 2:
  5043. this.setImg(obj, 0, 0, 1);
  5044. obj.rankTxt.color = "#D09672";
  5045. break;
  5046. default:
  5047. this.setImg(obj, 0, 0, 0);
  5048. obj.rankTxt.color = "#496FAB";
  5049. break;
  5050. }
  5051. }
  5052. setImg(obj, a, b, c) {
  5053. obj.img1.visible = a ? true : false;
  5054. obj.img2.visible = b ? true : false;
  5055. obj.img3.visible = c ? true : false;
  5056. }
  5057. changeList(type) {
  5058. this.rankType = type;
  5059. this.updateSelf();
  5060. }
  5061. changeSelfNode() {
  5062. this.showSelf = !this.showSelf;
  5063. this.updateSelf();
  5064. }
  5065. updateSelf() {
  5066. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5067. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5068. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5069. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5070. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5071. }
  5072. }
  5073. UIRanking.uiName = "UIRanking";
  5074. class ui_UISecretary extends fgui.GComponent {
  5075. static createInstance() {
  5076. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5077. }
  5078. onConstruct() {
  5079. this.n0 = (this.getChild("n0"));
  5080. this.myNode = (this.getChild("myNode"));
  5081. this.rightBtn = (this.getChild("rightBtn"));
  5082. this.leftBtn = (this.getChild("leftBtn"));
  5083. this.closeBtn = (this.getChild("closeBtn"));
  5084. this.t0 = this.getTransition("t0");
  5085. }
  5086. }
  5087. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5088. class UISecretary extends UIBase {
  5089. constructor() {
  5090. super();
  5091. this.curIndex = 1;
  5092. }
  5093. onConstructor() {
  5094. this.ui = ui_UISecretary.createInstance();
  5095. this.contentPane = this.ui;
  5096. this.isEject = false;
  5097. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5098. this.addUIClick(this.ui.leftBtn, this.turnLeft);
  5099. this.addUIClick(this.ui.rightBtn, this.turnRight);
  5100. this.nodeObj = { left: null, right: null, cur: null };
  5101. this.nodeObj.left = this.ui.myNode.gameNode1;
  5102. this.nodeObj.right = this.ui.myNode.gameNode2;
  5103. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5104. }
  5105. show() {
  5106. super.show();
  5107. this.ui.t0.play();
  5108. this.updateData();
  5109. }
  5110. addSecretarySpine(node, spineName) {
  5111. if (spineName == "mishu") {
  5112. if (this.secretarySpine1) {
  5113. node.displayObject.destroyChildren();
  5114. this.playWoman(this.secretarySpine1, node.displayObject);
  5115. }
  5116. else {
  5117. let spine1 = new SpineMgr("mishu", () => {
  5118. this.secretarySpine1 = spine1;
  5119. this.playWoman(this.secretarySpine1, node.displayObject);
  5120. });
  5121. }
  5122. }
  5123. else {
  5124. if (this.secretarySpine2) {
  5125. node.displayObject.destroyChildren();
  5126. this.playWoman(this.secretarySpine2, node.displayObject);
  5127. }
  5128. else {
  5129. let spine2 = new SpineMgr("xiaomishu2", () => {
  5130. this.secretarySpine2 = spine2;
  5131. this.playWoman(this.secretarySpine2, node.displayObject);
  5132. });
  5133. }
  5134. }
  5135. }
  5136. playWoman(node, parent) {
  5137. let xx = this.ui.myNode.gameNode1.secretary.width / 2;
  5138. let yy = this.ui.myNode.gameNode1.secretary.height;
  5139. let scale = 1.5;
  5140. if (node == this.secretarySpine2) {
  5141. scale = 1.2;
  5142. }
  5143. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5144. node.play(data, 0, true, parent);
  5145. }
  5146. turnLeft() {
  5147. this.curIndex--;
  5148. if (this.curIndex < 1) {
  5149. this.curIndex = 2;
  5150. }
  5151. let left = this.nodeObj.left;
  5152. let right = this.nodeObj.right;
  5153. let cur = this.nodeObj.cur;
  5154. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5155. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5156. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5157. this.updateData();
  5158. }));
  5159. this.ui.myNode.setChildIndex(right, 2);
  5160. this.nodeObj.left = cur;
  5161. this.nodeObj.right = left;
  5162. this.nodeObj.cur = right;
  5163. }
  5164. turnRight() {
  5165. this.curIndex++;
  5166. if (this.curIndex > 2) {
  5167. this.curIndex = 1;
  5168. }
  5169. let left = this.nodeObj.left;
  5170. let right = this.nodeObj.right;
  5171. let cur = this.nodeObj.cur;
  5172. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5173. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5174. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5175. this.updateData();
  5176. }));
  5177. this.ui.myNode.setChildIndex(left, 2);
  5178. this.nodeObj.left = right;
  5179. this.nodeObj.right = cur;
  5180. this.nodeObj.cur = left;
  5181. }
  5182. updateData() {
  5183. let data = cfgTable.secretaryshopData;
  5184. let children = this.ui.myNode._children;
  5185. let temp;
  5186. let curData;
  5187. for (let index = 0; index < children.length; index++) {
  5188. temp = children[index];
  5189. if (index == 2) {
  5190. curData = data[this.curIndex];
  5191. temp.purchaseBtn.touchable = true;
  5192. }
  5193. else {
  5194. temp.purchaseBtn.touchable = false;
  5195. if (this.curIndex == 1) {
  5196. curData = data[2];
  5197. }
  5198. else {
  5199. curData = data[1];
  5200. }
  5201. }
  5202. temp.heightTxt.text = curData.height;
  5203. temp.foodTxt.text = curData.food;
  5204. temp.historyTxt.text = curData.history;
  5205. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5206. this.addSecretarySpine(temp.secretary, curData.spine);
  5207. let womanIndex = curData.id - 1;
  5208. let getWoman = DataMgr.getSecretary(womanIndex);
  5209. let curUse = DataMgr.getCurSecretary();
  5210. if (getWoman) {
  5211. if (curUse == womanIndex) {
  5212. temp.purchaseBtn.c1.selectedIndex = 1;
  5213. }
  5214. else {
  5215. temp.purchaseBtn.c1.selectedIndex = 2;
  5216. }
  5217. }
  5218. else {
  5219. temp.purchaseBtn.c1.selectedIndex = 0;
  5220. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5221. }
  5222. temp.purchaseBtn.offClick(this, this.clickSecretary);
  5223. temp.purchaseBtn.onClick(this, this.clickSecretary, [getWoman, curUse, womanIndex, curData.price]);
  5224. }
  5225. }
  5226. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5227. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5228. if (getWoman) {
  5229. if (curUse != womanIndex) {
  5230. console.log();
  5231. DataMgr.setCurSecretary(womanIndex);
  5232. this.updateData();
  5233. }
  5234. }
  5235. else {
  5236. let need = needDiamond;
  5237. if (DataMgr.diamondEnough(need)) {
  5238. DataMgr.setDiamond(-need);
  5239. DataMgr.setSecretary(womanIndex, 1);
  5240. DataMgr.setCurSecretary(womanIndex);
  5241. this.updateData();
  5242. }
  5243. else {
  5244. xGame.uiMgr.Show(UIAddProp, 1);
  5245. }
  5246. }
  5247. }
  5248. closeSelf() {
  5249. this.hide();
  5250. }
  5251. }
  5252. UISecretary.uiName = "UISecretary";
  5253. class ui_UIShop extends fgui.GComponent {
  5254. static createInstance() {
  5255. return (fgui.UIPackage.createObject("game", "UIShop"));
  5256. }
  5257. onConstruct() {
  5258. this.n48 = (this.getChild("n48"));
  5259. this.n0 = (this.getChild("n0"));
  5260. this.secretary = (this.getChild("secretary"));
  5261. this.talkNode = (this.getChild("talkNode"));
  5262. this.closeNode = (this.getChild("closeNode"));
  5263. this.moneyNode = (this.getChild("moneyNode"));
  5264. this.myNode = (this.getChild("myNode"));
  5265. }
  5266. }
  5267. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5268. class BallRodDisplay {
  5269. constructor(ui, index) {
  5270. this.index = 0;
  5271. this.uiIndex = 0;
  5272. this.ui = ui;
  5273. this.index = index;
  5274. this.initData();
  5275. }
  5276. initData() {
  5277. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5278. let data = cfgTable.ballrodData[this.index + 1];
  5279. this.ui.nameTxt.text = data.name;
  5280. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5281. this.ui.levelNode.c1.selectedIndex = data.quality;
  5282. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5283. if (data.spine) {
  5284. this.mySpine = new SpineMgr(data.spine, () => {
  5285. let xx = 150;
  5286. let yy = 70;
  5287. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5288. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5289. });
  5290. }
  5291. }
  5292. updateSelf() {
  5293. let get = DataMgr.getBallRod(this.index);
  5294. if (get == null)
  5295. get = 1;
  5296. let curUse = DataMgr.getCurBallRod();
  5297. if (get) {
  5298. if (curUse == this.index) {
  5299. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5300. }
  5301. else {
  5302. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5303. }
  5304. }
  5305. else {
  5306. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5307. }
  5308. }
  5309. buyBallRod() {
  5310. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5311. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5312. switch (selectedIndex) {
  5313. case 0:
  5314. break;
  5315. case 1:
  5316. DataMgr.setCurBallRod(this.index);
  5317. let ui = xGame.uiMgr.getUI(UIShop);
  5318. ui.updateBallRod();
  5319. break;
  5320. case 2:
  5321. let data = cfgTable.ballrodData[this.index + 1];
  5322. let need = data.price;
  5323. if (DataMgr.diamondEnough(need)) {
  5324. DataMgr.setDiamond(-need);
  5325. DataMgr.setBallRod(this.index, 1);
  5326. DataMgr.setCurBallRod(this.index);
  5327. let ui = xGame.uiMgr.getUI(UIShop);
  5328. ui.updateBallRod();
  5329. }
  5330. else {
  5331. xGame.uiMgr.Show(UIAddProp, 1);
  5332. }
  5333. break;
  5334. default:
  5335. break;
  5336. }
  5337. }
  5338. }
  5339. class UIShop extends UIBase {
  5340. constructor() {
  5341. super();
  5342. this.itemNums = 0;
  5343. }
  5344. onConstructor() {
  5345. this.ui = ui_UIShop.createInstance();
  5346. this.contentPane = this.ui;
  5347. this.isEject = false;
  5348. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5349. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5350. this.addUIClick(this.ui, this.interuptSecretary);
  5351. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  5352. this.ballRodArr = [];
  5353. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  5354. this.ui.myNode.myList.numItems = this.itemNums;
  5355. if (Moyu.isKs)
  5356. this.ui.closeNode.closeBtn.x += 100;
  5357. }
  5358. show() {
  5359. super.show();
  5360. this.playSecretaryIdle();
  5361. this.updateBallRod();
  5362. }
  5363. updateBallRod() {
  5364. for (let index = 0; index < this.ballRodArr.length; index++) {
  5365. this.ballRodArr[index].updateSelf();
  5366. }
  5367. }
  5368. renderBallRod(sort, obj) {
  5369. let index = this.getIndexBySort(sort + 1) - 1;
  5370. let ballRod = new BallRodDisplay(obj, index);
  5371. this.ballRodArr.push(ballRod);
  5372. }
  5373. getIndexBySort(sort) {
  5374. let object = cfgTable.ballrodData;
  5375. for (const key in object) {
  5376. if (object[key].sort == sort) {
  5377. return parseInt(key);
  5378. }
  5379. }
  5380. }
  5381. playSecretaryIdle() {
  5382. let parent = this.ui.secretary.displayObject;
  5383. parent.destroyChildren();
  5384. let xx = this.ui.secretary.width / 2;
  5385. let yy = this.ui.secretary.height;
  5386. let scale = xGame.common.getSecretaryScale();
  5387. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5388. xGame.common.secretary.play(data, 0, true, parent);
  5389. }
  5390. interuptSecretary() {
  5391. Laya.timer.clearAll(this);
  5392. this.playSecretaryRandomSound();
  5393. }
  5394. playSecretaryRandomSound() {
  5395. if (this.isHide)
  5396. return;
  5397. let time = xGame.common.randomNum(45000, 60000);
  5398. Laya.timer.once(time, this, () => {
  5399. if (this.isHide)
  5400. return;
  5401. let index = xGame.common.randomNum(4, 7);
  5402. xGame.soundMgr.playSound("s_main0" + index);
  5403. let words = 1;
  5404. switch (index) {
  5405. case 4:
  5406. words = 5;
  5407. break;
  5408. case 5:
  5409. words = 3;
  5410. break;
  5411. case 6:
  5412. words = 6;
  5413. break;
  5414. case 7:
  5415. words = 7;
  5416. break;
  5417. default:
  5418. break;
  5419. }
  5420. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5421. this.playSecretaryRandomSound();
  5422. });
  5423. }
  5424. closeSelf() {
  5425. this.hide();
  5426. }
  5427. }
  5428. UIShop.uiName = "UIShop";
  5429. class ui_UISign extends fgui.GComponent {
  5430. static createInstance() {
  5431. return (fgui.UIPackage.createObject("game", "UISign"));
  5432. }
  5433. onConstruct() {
  5434. this.n6 = (this.getChild("n6"));
  5435. this.closeNode = (this.getChild("closeNode"));
  5436. this.myNode = (this.getChild("myNode"));
  5437. this.moneyNode = (this.getChild("moneyNode"));
  5438. this.secretary = (this.getChild("secretary"));
  5439. this.talkNode = (this.getChild("talkNode"));
  5440. this.tripleBtn = (this.getChild("tripleBtn"));
  5441. this.normalBtn = (this.getChild("normalBtn"));
  5442. this.tipsNode = (this.getChild("tipsNode"));
  5443. this.againBtn = (this.getChild("againBtn"));
  5444. this.t0 = this.getTransition("t0");
  5445. }
  5446. }
  5447. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  5448. class SignMax {
  5449. constructor(ui) {
  5450. this.ui = ui;
  5451. }
  5452. updateSelf(index, sameDay, curDayIndex) {
  5453. let data = cfgTable.signData[index + 1];
  5454. this.ui.titleTxt.text = data.title;
  5455. let arr1 = data.award[0].split('-');
  5456. let arr2 = data.award[1].split('-');
  5457. let num1 = parseInt(arr1[1]);
  5458. let num2 = parseInt(arr2[1]);
  5459. this.ui.numTxt1.text = num1 + "";
  5460. this.ui.numTxt2.text = num2 + "";
  5461. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  5462. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  5463. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  5464. this.ui.numTxt1.visible = false;
  5465. }
  5466. else {
  5467. this.ui.numTxt1.visible = true;
  5468. }
  5469. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  5470. this.ui.numTxt2.visible = false;
  5471. }
  5472. else {
  5473. this.ui.numTxt2.visible = true;
  5474. }
  5475. if (index < curDayIndex) {
  5476. this.ui.c1.selectedIndex = 1;
  5477. }
  5478. else if (index == curDayIndex) {
  5479. if (sameDay) {
  5480. this.ui.c1.selectedIndex = 2;
  5481. }
  5482. else {
  5483. this.ui.c1.selectedIndex = 2;
  5484. }
  5485. }
  5486. else {
  5487. this.ui.c1.selectedIndex = 0;
  5488. }
  5489. }
  5490. }
  5491. class SignNormal {
  5492. constructor(ui) {
  5493. this.ui = ui;
  5494. }
  5495. updateSelf(index, sameDay, curDayIndex) {
  5496. let data = cfgTable.signData[index + 1];
  5497. this.ui.titleTxt.text = data.title;
  5498. let arr = data.award[0].split('-');
  5499. let type = parseInt(arr[0]);
  5500. let num = parseInt(arr[1]);
  5501. this.ui.numTxt.text = num + "";
  5502. if (type > 2) {
  5503. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  5504. this.ui.myIcon.rotation = 0;
  5505. }
  5506. else {
  5507. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  5508. this.ui.myIcon.rotation = 0;
  5509. }
  5510. if (xGame.common.signAwardContainsRod(data.award)) {
  5511. this.ui.numTxt.visible = false;
  5512. }
  5513. else {
  5514. this.ui.numTxt.visible = true;
  5515. }
  5516. if (index < curDayIndex) {
  5517. this.ui.c1.selectedIndex = 1;
  5518. }
  5519. else if (index == curDayIndex) {
  5520. if (sameDay) {
  5521. this.ui.c1.selectedIndex = 2;
  5522. }
  5523. else {
  5524. this.ui.c1.selectedIndex = 2;
  5525. }
  5526. }
  5527. else {
  5528. this.ui.c1.selectedIndex = 0;
  5529. }
  5530. }
  5531. }
  5532. class UISign extends UIBase {
  5533. constructor() {
  5534. super();
  5535. this.curDayIndex = 0;
  5536. this.starX = 0;
  5537. }
  5538. onConstructor() {
  5539. this.ui = ui_UISign.createInstance();
  5540. this.contentPane = this.ui;
  5541. this.isEject = false;
  5542. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5543. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5544. this.initSignItem();
  5545. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  5546. this.addUIClick(this.ui.againBtn, this.againGetAward);
  5547. }
  5548. show() {
  5549. super.show();
  5550. this.ui.t0.play();
  5551. this.playSecretaryIdle();
  5552. this.updateSign();
  5553. }
  5554. initSignItem() {
  5555. this.signArr = [];
  5556. for (let index = 0; index < 6; index++) {
  5557. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  5558. this.signArr.push(temp);
  5559. }
  5560. this.signMax = new SignMax(this.ui.myNode.day7);
  5561. if (Moyu.isKs)
  5562. this.ui.closeNode.closeBtn.x += 100;
  5563. }
  5564. updateSign() {
  5565. let sameDay = xGame.common.judgeSameDay();
  5566. let max = 7;
  5567. this.curDayIndex = DataMgr.getSignData();
  5568. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  5569. this.curDayIndex = 0;
  5570. if (!sameDay) {
  5571. this.ui.normalBtn.visible = true;
  5572. this.ui.tipsNode.visible = false;
  5573. this.ui.againBtn.visible = false;
  5574. }
  5575. else {
  5576. this.ui.normalBtn.visible = false;
  5577. let again = DataMgr.getExtraSign();
  5578. let isCurrency = false;
  5579. let index = this.curDayIndex;
  5580. if (index == 0)
  5581. index = 7;
  5582. let award = cfgTable.signData[index].award;
  5583. let num = award[0].split("-")[0];
  5584. if (num == "1" || num == "2")
  5585. isCurrency = true;
  5586. let showAgain = again == 0 && isCurrency;
  5587. this.ui.againBtn.visible = showAgain;
  5588. this.ui.tipsNode.visible = !showAgain;
  5589. }
  5590. for (let index = 0; index < this.signArr.length; index++) {
  5591. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  5592. }
  5593. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  5594. }
  5595. playSecretaryIdle() {
  5596. let parent = this.ui.secretary.displayObject;
  5597. parent.destroyChildren();
  5598. let xx = this.ui.secretary.width / 2;
  5599. let yy = this.ui.secretary.height;
  5600. let scale = xGame.common.getSecretaryScale();
  5601. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5602. xGame.common.secretary.play(data, 0, true, parent);
  5603. }
  5604. closeSelf() {
  5605. this.hide();
  5606. }
  5607. normalGetAward() {
  5608. let sameDay = xGame.common.judgeSameDay();
  5609. if (!sameDay) {
  5610. let award = cfgTable.signData[this.curDayIndex + 1].award;
  5611. let temp;
  5612. let type;
  5613. let num;
  5614. let arr = [];
  5615. for (let index = 0; index < award.length; index++) {
  5616. temp = award[index].split("-");
  5617. type = parseInt(temp[0]);
  5618. num = parseInt(temp[1]);
  5619. let awardType = new AwardType();
  5620. awardType.num = num;
  5621. awardType.type = type;
  5622. arr.push(awardType);
  5623. }
  5624. xGame.common.getAward(arr, (watchVideo) => {
  5625. this.curDayIndex++;
  5626. if (this.curDayIndex > 7)
  5627. this.curDayIndex = 0;
  5628. DataMgr.setSignData(this.curDayIndex);
  5629. DataMgr.setSignTime(new Date().getTime());
  5630. if (watchVideo) {
  5631. DataMgr.setExtraSign(1);
  5632. Moyu.sendDataEvent("signIn1");
  5633. }
  5634. this.updateSign();
  5635. });
  5636. }
  5637. }
  5638. againGetAward() {
  5639. Moyu.sendDataEvent("signIn2");
  5640. Moyu.showVideoAd(() => {
  5641. let index = this.curDayIndex;
  5642. if (index == 0)
  5643. index = 7;
  5644. let award = cfgTable.signData[index].award;
  5645. let temp;
  5646. let type;
  5647. let num;
  5648. for (let index = 0; index < award.length; index++) {
  5649. temp = award[index].split("-");
  5650. type = parseInt(temp[0]);
  5651. num = parseInt(temp[1]) * 3;
  5652. xGame.common.playObjFlyAnim(num, type);
  5653. }
  5654. DataMgr.setExtraSign(1);
  5655. this.updateSign();
  5656. }, EAdType.againSign);
  5657. }
  5658. }
  5659. UISign.uiName = "UISign";
  5660. class ui_UISkill extends fgui.GComponent {
  5661. static createInstance() {
  5662. return (fgui.UIPackage.createObject("game", "UISkill"));
  5663. }
  5664. onConstruct() {
  5665. this.n48 = (this.getChild("n48"));
  5666. this.n0 = (this.getChild("n0"));
  5667. this.secretary = (this.getChild("secretary"));
  5668. this.talkNode = (this.getChild("talkNode"));
  5669. this.closeNode = (this.getChild("closeNode"));
  5670. this.moneyNode = (this.getChild("moneyNode"));
  5671. this.skillNode = (this.getChild("skillNode"));
  5672. this.guideNode = (this.getChild("guideNode"));
  5673. }
  5674. }
  5675. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  5676. class SkillDisplay {
  5677. constructor(ui, data, uiIndex) {
  5678. this.starX = 0;
  5679. this.starY = 0;
  5680. this.index = 0;
  5681. this.ui = ui;
  5682. this.data = data;
  5683. this.index = uiIndex;
  5684. this.initSelf();
  5685. console.log('zh:SkillDisplay constructor this.skillData=', data);
  5686. }
  5687. initSelf() {
  5688. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  5689. this.ui.nameTxt.text = this.data.name;
  5690. this.ui.describeTxt.text = this.data.describe;
  5691. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  5692. this.ui.startBtn.onClick(this, this.startGame);
  5693. this.updateSelf();
  5694. }
  5695. updateSelf() {
  5696. this.checkTry();
  5697. let level = DataMgr.getBigSkillByIndex(this.index);
  5698. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  5699. }
  5700. checkTry() {
  5701. let index = this.index;
  5702. let level = DataMgr.getBigSkillByIndex(index);
  5703. if (level == null) {
  5704. DataMgr.setBigSkill(index, 1, false);
  5705. level = 1;
  5706. }
  5707. this.ui.levelTxt.text = "LV." + level;
  5708. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  5709. this.ui.tryNode.visible = true;
  5710. else
  5711. this.ui.tryNode.visible = false;
  5712. }
  5713. clickAddLevel() {
  5714. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5715. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  5716. Moyu.showVideoAd(() => {
  5717. DataMgr.setBigSkill(this.data.index, 1);
  5718. this.updateSelf();
  5719. xGame.common.upSkillLevel = true;
  5720. }, EAdType.upSkill);
  5721. }
  5722. startGame() {
  5723. if (this.data.index == 3) {
  5724. alert('Coming soon!');
  5725. return;
  5726. }
  5727. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5728. let needCoin = xGame.common.bigMoveNeedCoin;
  5729. xGame.common.passAwardCoin = 2000;
  5730. let guide = DataMgr.getSkillGuide();
  5731. console.log('zh:startGame guide=' + guide);
  5732. xGame.common.temSelfLevel = 0;
  5733. if (guide == 0) {
  5734. needCoin = 0;
  5735. xGame.common.temSelfLevel = 100;
  5736. }
  5737. if (DataMgr.coinEnough(needCoin)) {
  5738. DataMgr.setCoin(-needCoin);
  5739. xGame.common.curPlayerSkillType = this.index;
  5740. if (guide == 0)
  5741. xGame.common.curPlayerSkillType = 0;
  5742. xGame.uiMgr.Show(UIGame);
  5743. xGame.uiMgr.Hide(UIMain);
  5744. xGame.uiMgr.Show(UIMatching, () => {
  5745. xGame.common.gameUI.ui.alpha = 1;
  5746. xGame.common.gameUI.startGame();
  5747. xGame.uiMgr.Hide(UISkill);
  5748. });
  5749. }
  5750. else {
  5751. xGame.uiMgr.Show(UIAddProp, 0);
  5752. Moyu.sendDataEvent("AddCoinVideo");
  5753. }
  5754. }
  5755. }
  5756. class UISkill extends UIBase {
  5757. constructor() {
  5758. super();
  5759. this.skillData = [];
  5760. }
  5761. onConstructor() {
  5762. this.ui = ui_UISkill.createInstance();
  5763. this.contentPane = this.ui;
  5764. this.isEject = false;
  5765. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5766. this.initSkillData();
  5767. console.log('zh:aaaaaa1111111111');
  5768. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  5769. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  5770. console.log('zh:aaaaaa22222222');
  5771. this.displayList = [];
  5772. this.ui.skillNode.skillList.numItems = 3;
  5773. this.addUIClick(this.ui, this.interuptSecretary);
  5774. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  5775. this.ui.talkNode.visible = false;
  5776. if (Moyu.isKs)
  5777. this.ui.closeNode.closeBtn.x += 100;
  5778. }
  5779. show() {
  5780. super.show();
  5781. this.playSecretaryIdle();
  5782. this.moneyNode.ui.c1.selectedIndex = 1;
  5783. Laya.timer.clearAll(this);
  5784. xGame.soundMgr.playSound("s_start");
  5785. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5786. let guide = DataMgr.getSkillGuide();
  5787. this.ui.guideNode.visible = guide == 0;
  5788. let item = this.getSkillItemByUIIndex(0);
  5789. if (guide == 0) {
  5790. item.ui.c1.selectedIndex = 1;
  5791. }
  5792. else {
  5793. item.ui.c1.selectedIndex = 0;
  5794. }
  5795. this.ui.guideNode.guideBtn.visible = guide == 0;
  5796. for (let index = 0; index < this.displayList.length; index++) {
  5797. this.displayList[index].checkTry();
  5798. }
  5799. }
  5800. getSkillItemByUIIndex(cur) {
  5801. for (let index = 0; index < this.displayList.length; index++) {
  5802. if (this.displayList[index].index == cur) {
  5803. return this.displayList[index];
  5804. }
  5805. }
  5806. }
  5807. enterGuideLevel() {
  5808. let item = this.getSkillItemByUIIndex(0);
  5809. item.startGame();
  5810. if (DataMgr.getNewUser())
  5811. Moyu.sendDataEvent("gameStart1");
  5812. }
  5813. initSkillData() {
  5814. this.skillData = [];
  5815. let nameList = xGame.common.skillNameList;
  5816. let iconList = xGame.common.skillIconList;
  5817. let describeList = [
  5818. "Jump shot executed — ball bounced and pocketed an extra one!",
  5819. "Bonus Sweep: A random follow-up strike hits 1 extra ball after your shot!",
  5820. "Freeze Effect: Your shot freezes 1 random ball — enemy can’t hit it, and others bounce off!"
  5821. ];
  5822. console.log('zh:initSkillData 111111111');
  5823. let data;
  5824. for (let index = 0; index < nameList.length; index++) {
  5825. data = {};
  5826. data.name = nameList[index];
  5827. data.icon = iconList[index];
  5828. data.describe = describeList[index];
  5829. data.index = index;
  5830. this.skillData.push(data);
  5831. }
  5832. }
  5833. updateSkillItem(index, target) {
  5834. if (this.displayList[index] == null) {
  5835. let uiIndex;
  5836. switch (index) {
  5837. case 0:
  5838. uiIndex = 1;
  5839. break;
  5840. case 1:
  5841. uiIndex = 0;
  5842. break;
  5843. case 2:
  5844. uiIndex = 2;
  5845. break;
  5846. case 3:
  5847. uiIndex = 3;
  5848. break;
  5849. default:
  5850. break;
  5851. }
  5852. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  5853. this.displayList.push(temp);
  5854. }
  5855. }
  5856. playSecretaryIdle() {
  5857. let parent = this.ui.secretary.displayObject;
  5858. parent.destroyChildren();
  5859. let xx = this.ui.secretary.width / 2;
  5860. let yy = this.ui.secretary.height;
  5861. let scale = xGame.common.getSecretaryScale();
  5862. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5863. xGame.common.secretary.play(data, 0, true, parent);
  5864. }
  5865. returnUIMain() {
  5866. this.hide();
  5867. xGame.common.stopGirlPop(this.ui.talkNode);
  5868. xGame.uiMgr.Show(UIMain);
  5869. }
  5870. interuptSecretary() {
  5871. Laya.timer.clearAll(this);
  5872. this.playSecretaryRandomSound();
  5873. }
  5874. playSecretaryRandomSound() {
  5875. if (this.isHide)
  5876. return;
  5877. let time = xGame.common.randomNum(45000, 60000);
  5878. Laya.timer.once(time, this, () => {
  5879. if (this.isHide)
  5880. return;
  5881. let index = xGame.common.randomNum(4, 7);
  5882. xGame.soundMgr.playSound("s_main0" + index);
  5883. let words = 1;
  5884. switch (index) {
  5885. case 4:
  5886. words = 5;
  5887. break;
  5888. case 5:
  5889. words = 3;
  5890. break;
  5891. case 6:
  5892. words = 6;
  5893. break;
  5894. case 7:
  5895. words = 7;
  5896. break;
  5897. default:
  5898. break;
  5899. }
  5900. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5901. this.playSecretaryRandomSound();
  5902. });
  5903. }
  5904. }
  5905. UISkill.uiName = "UISkill";
  5906. class ui_UIMsg extends fgui.GComponent {
  5907. static createInstance() {
  5908. return (fgui.UIPackage.createObject("game", "UIMsg"));
  5909. }
  5910. onConstruct() {
  5911. this.tipsNode = (this.getChild("tipsNode"));
  5912. }
  5913. }
  5914. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  5915. class UIMsg extends UIBase {
  5916. constructor() {
  5917. super();
  5918. }
  5919. onConstructor() {
  5920. this.ui = ui_UIMsg.createInstance();
  5921. this.contentPane = this.ui;
  5922. this.isEject = false;
  5923. this.isMuti = true;
  5924. }
  5925. show(msg, callback) {
  5926. super.show();
  5927. this.ui.tipsNode.msgTxt.text = msg;
  5928. this.ui.alpha = 1;
  5929. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  5930. this.hide();
  5931. callback && callback();
  5932. }), 1000);
  5933. }
  5934. }
  5935. UIMsg.uiName = "UIMsg";
  5936. class ui_UIModeSelection extends fgui.GComponent {
  5937. static createInstance() {
  5938. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  5939. }
  5940. onConstruct() {
  5941. this.n19 = (this.getChild("n19"));
  5942. this.closeBtn = (this.getChild("closeBtn"));
  5943. this.myNode = (this.getChild("myNode"));
  5944. this.t0 = this.getTransition("t0");
  5945. }
  5946. }
  5947. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  5948. class UIModeSelection extends UIBase {
  5949. constructor() {
  5950. super();
  5951. }
  5952. onConstructor() {
  5953. this.ui = ui_UIModeSelection.createInstance();
  5954. this.contentPane = this.ui;
  5955. this.isEject = false;
  5956. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  5957. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  5958. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  5959. this.addUIClick(this.ui.closeBtn, this.hide);
  5960. this.peopleArr = [650, 6900, 3800];
  5961. this.peopleOffest = [50, 500, 200];
  5962. this.updateSelf();
  5963. }
  5964. show(callback) {
  5965. super.show();
  5966. this.ui.t0.play();
  5967. this.callback = callback;
  5968. }
  5969. updateSelf() {
  5970. let cfg = cfgTable.modeselectData;
  5971. for (let index = 1; index <= 3; index++) {
  5972. let node = this.ui.myNode["type" + index];
  5973. node.need.text = cfg[index].need;
  5974. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  5975. node.peopleTxt.text = this.getRandPeople(index - 1);
  5976. }
  5977. }
  5978. enterGame(type) {
  5979. xGame.common.classicRoomType = type;
  5980. let cfg = cfgTable.modeselectData[type];
  5981. let need = cfg.need;
  5982. xGame.common.passAwardCoin = cfg.award;
  5983. if (DataMgr.coinEnough(need)) {
  5984. DataMgr.setCoin(-need);
  5985. this.ui.myNode["type" + type].t0.play();
  5986. Laya.timer.once(200, this, () => {
  5987. this.callback && this.callback();
  5988. });
  5989. }
  5990. else {
  5991. Moyu.sendDataEvent("AddCoinVideo");
  5992. xGame.uiMgr.Show(UIAddProp, 0);
  5993. }
  5994. }
  5995. getRandPeople(index) {
  5996. let rand = this.peopleOffest[index];
  5997. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  5998. }
  5999. }
  6000. UIModeSelection.uiName = "UIModeSelection";
  6001. class UIMain extends UIBase {
  6002. constructor() {
  6003. super();
  6004. this.firstEnter = true;
  6005. }
  6006. onConstructor() {
  6007. this.ui = ui_UIMain.createInstance();
  6008. this.contentPane = this.ui;
  6009. this.isEject = false;
  6010. this.addEvent();
  6011. this.addClickSpine();
  6012. this.settingNode = new SettingNode(this.ui.settingNode);
  6013. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6014. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  6015. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  6016. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  6017. let curUse = DataMgr.getCurSecretary();
  6018. this.changeSecretary(curUse);
  6019. this.ui.talkNode.visible = false;
  6020. let guide = DataMgr.getSkillGuide();
  6021. if (xGame.common.isNewDay && guide == 1) {
  6022. xGame.common.isNewDay = false;
  6023. xGame.soundMgr.playSound("s_main01");
  6024. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6025. console.log("播放小秘书每天语音");
  6026. }
  6027. this.onGetUserInfo();
  6028. this.ui.n83.visible = false;
  6029. Moyu.setShareInfo("8Ball Fury", ["台球", "万宁", "桌球"], '2300002254');
  6030. }
  6031. changeSecretary(curUse) {
  6032. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  6033. xGame.common.secretary && xGame.common.secretary.dispose();
  6034. this.addSecretarySpine(name);
  6035. }
  6036. addSecretarySpine(name) {
  6037. let spine = new SpineMgr(name, () => {
  6038. this.playSecretaryIdle();
  6039. });
  6040. xGame.common.secretary = spine;
  6041. }
  6042. addClickSpine() {
  6043. let clickSpine = new SpineMgr("dianji", () => {
  6044. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  6045. let parent = Laya.stage;
  6046. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  6047. clickSpine.play(data, 0, false, parent, (spine) => {
  6048. spine.destroy(true);
  6049. });
  6050. });
  6051. });
  6052. }
  6053. addEvent() {
  6054. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  6055. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  6056. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  6057. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  6058. this.addUIClick(this.ui.weeklyBtn, this.startWeekly);
  6059. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  6060. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  6061. this.addUIClick(this.ui, this.interuptSecretary);
  6062. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  6063. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  6064. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  6065. this.addUIClick(this.ui.shopBtn, this.openShopView);
  6066. this.addUIClick(this.ui.signBtn, this.openSignView);
  6067. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  6068. this.addUIClick(this.ui.rankBtn, this.openRanking);
  6069. }
  6070. show(showFailWords) {
  6071. super.show();
  6072. this.moneyNode.ui.c1.selectedIndex = 1;
  6073. this.playSecretaryIdle();
  6074. xGame.soundMgr.playMusic("caromhall01");
  6075. Laya.timer.clearAll(this);
  6076. this.playSecretaryRandomSound();
  6077. if (showFailWords) {
  6078. setTimeout(() => {
  6079. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  6080. let words = -1;
  6081. if (str == "s_main02") {
  6082. words = 2;
  6083. }
  6084. else {
  6085. words = 3;
  6086. }
  6087. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6088. xGame.soundMgr.playSound(str);
  6089. }, 300);
  6090. }
  6091. this.showGuide();
  6092. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  6093. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  6094. let guide = DataMgr.getSkillGuide();
  6095. if (guide == 1) {
  6096. let randTime = xGame.common.randomNum(300, 800);
  6097. if (this.firstEnter) {
  6098. this.firstEnter = false;
  6099. randTime += 900;
  6100. }
  6101. Laya.timer.once(randTime, this, () => {
  6102. xGame.common.autoPopUIView();
  6103. });
  6104. }
  6105. }
  6106. checkActive(show) {
  6107. }
  6108. showGuide() {
  6109. let guide = DataMgr.getSkillGuide();
  6110. this.ui.guideBtn.visible = guide == 0;
  6111. this.ui.enterGuide.visible = false;
  6112. this.ui.secretaryGuide.visible = guide == 0;
  6113. if (guide == 0) {
  6114. xGame.soundMgr.playSound("s_guide");
  6115. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6116. }
  6117. }
  6118. ensureSecretary() {
  6119. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  6120. this.ui.secretaryGuide.visible = false;
  6121. this.ui.enterGuide.visible = true;
  6122. this.ui.wordsNode.t0.play();
  6123. if (DataMgr.getNewUser())
  6124. Moyu.sendDataEvent("gameReady");
  6125. }
  6126. playSecretaryIdle() {
  6127. let parent = this.ui.secretary.displayObject;
  6128. parent.destroyChildren();
  6129. let xx = this.ui.secretary.width / 2;
  6130. let yy = this.ui.secretary.height;
  6131. let scale = xGame.common.getSecretaryScale();
  6132. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6133. console.log("zh:playSecretaryIdle", data);
  6134. xGame.common.secretary.play(data, 0, true, parent);
  6135. }
  6136. startGame(type) {
  6137. xGame.common.gameMode = type;
  6138. Moyu.sendDataEvent("PlayGame", { type: type });
  6139. switch (xGame.common.gameMode) {
  6140. case GameMode.classic:
  6141. let challengeTimes = DataMgr.getChallengeTimes();
  6142. if (challengeTimes == 0) {
  6143. xGame.uiMgr.Show(UIInvitation);
  6144. }
  6145. else {
  6146. this.beginGame();
  6147. }
  6148. break;
  6149. case GameMode.bigMove:
  6150. this.beginGame();
  6151. if (DataMgr.getNewUser())
  6152. Moyu.sendDataEvent("gameStart0");
  6153. break;
  6154. default:
  6155. break;
  6156. }
  6157. }
  6158. beginGame(isNice = false) {
  6159. if (xGame.common.gameMode == GameMode.classic) {
  6160. if (isNice) {
  6161. this.enterClassic();
  6162. }
  6163. else {
  6164. xGame.uiMgr.Show(UIModeSelection, () => {
  6165. this.enterClassic();
  6166. });
  6167. }
  6168. }
  6169. else if (xGame.common.gameMode == GameMode.bigMove) {
  6170. this.ui.enterGuide.visible = false;
  6171. xGame.uiMgr.Show(UISkill);
  6172. }
  6173. }
  6174. enterClassic() {
  6175. xGame.uiMgr.Show(UIGame);
  6176. xGame.uiMgr.Show(UIMatching, () => {
  6177. if (!this.isHide)
  6178. this.hide();
  6179. xGame.common.gameUI.ui.alpha = 1;
  6180. xGame.common.gameUI.startGame();
  6181. xGame.uiMgr.Hide(UIGameEnd);
  6182. });
  6183. }
  6184. startGlobal() {
  6185. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  6186. }
  6187. startWeekly() {
  6188. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  6189. }
  6190. startPlaceBall() {
  6191. xGame.uiMgr.Show(UILevelDisplay);
  6192. }
  6193. hide() {
  6194. super.hide();
  6195. xGame.common.stopGirlPop(this.ui.talkNode);
  6196. }
  6197. onGetUserInfo(force = false) {
  6198. if (Moyu.isWx) {
  6199. let info = Moyu.getSystemInfo();
  6200. if (info)
  6201. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  6202. }
  6203. else {
  6204. Moyu.initUser(this, this.freshUser, force);
  6205. }
  6206. if (!Moyu.hasUserInfo) {
  6207. let user = Moyu.getUserInfo();
  6208. user.headIcon = 'res/ty_touxiang.png';
  6209. }
  6210. this.freshUser();
  6211. }
  6212. freshUser() {
  6213. let user = Moyu.getUserInfo();
  6214. if (!user.isAuth) {
  6215. user.headIcon = 'res/ty_touxiang.png';
  6216. }
  6217. else
  6218. DataMgr.upRankData();
  6219. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  6220. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  6221. }
  6222. interuptSecretary() {
  6223. Laya.timer.clearAll(this);
  6224. this.playSecretaryRandomSound();
  6225. }
  6226. playSecretaryRandomSound() {
  6227. if (this.isHide)
  6228. return;
  6229. let time = xGame.common.randomNum(45000, 60000);
  6230. Laya.timer.once(time, this, () => {
  6231. if (this.isHide)
  6232. return;
  6233. let index = xGame.common.randomNum(4, 7);
  6234. xGame.soundMgr.playSound("s_main0" + index);
  6235. let words = 1;
  6236. switch (index) {
  6237. case 4:
  6238. words = 5;
  6239. break;
  6240. case 5:
  6241. words = 3;
  6242. break;
  6243. case 6:
  6244. words = 6;
  6245. break;
  6246. case 7:
  6247. words = 7;
  6248. break;
  6249. default:
  6250. break;
  6251. }
  6252. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6253. this.playSecretaryRandomSound();
  6254. });
  6255. }
  6256. openSecretaryView() {
  6257. xGame.uiMgr.Show(UISecretary);
  6258. Moyu.sendDataEvent("secretary");
  6259. }
  6260. openShopView() {
  6261. xGame.uiMgr.Show(UIShop);
  6262. }
  6263. openSignView() {
  6264. xGame.uiMgr.Show(UISign);
  6265. }
  6266. openDrawView() {
  6267. xGame.uiMgr.Show(UIDraw);
  6268. }
  6269. openRanking() {
  6270. xGame.uiMgr.Show(UIRanking);
  6271. Moyu.sendDataEvent("rankingList");
  6272. }
  6273. }
  6274. UIMain.uiName = "UIMain";
  6275. class UIGameEnd extends UIBase {
  6276. constructor() {
  6277. super();
  6278. this.success = false;
  6279. this.awardCoinNum = 1000;
  6280. this.awardDiamondNum = 10;
  6281. }
  6282. onConstructor() {
  6283. this.ui = ui_UIGameEnd.createInstance();
  6284. this.contentPane = this.ui;
  6285. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  6286. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  6287. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  6288. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6289. this.ui.talkNode.visible = false;
  6290. if (Moyu.isKs)
  6291. this.ui.closeNode.closeBtn.x += 100;
  6292. }
  6293. updateType() {
  6294. switch (xGame.common.gameMode) {
  6295. case GameMode.classic:
  6296. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  6297. this.ui.coinNode.visible = this.success;
  6298. if (!this.success) {
  6299. Laya.timer.once(500, this, () => {
  6300. xGame.uiMgr.Show(UIAddCoin);
  6301. });
  6302. }
  6303. this.ui.isGetAward.visible = false;
  6304. this.ui.leftBtn.c1.selectedIndex = 3;
  6305. this.ui.rightBtn.c1.selectedIndex = 0;
  6306. this.moneyNode.ui.c1.selectedIndex = 1;
  6307. break;
  6308. case GameMode.bigMove:
  6309. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  6310. this.ui.coinNode.visible = this.success;
  6311. if (xGame.common.gameMode == GameMode.bigMove) {
  6312. if (this.success) {
  6313. DataMgr.setSkillSuccessTimes(1, true);
  6314. DataMgr.setSkillAccTimes(1);
  6315. }
  6316. else {
  6317. DataMgr.setSkillSuccessTimes(0, false);
  6318. }
  6319. }
  6320. if (!this.success) {
  6321. Laya.timer.once(500, this, () => {
  6322. xGame.uiMgr.Show(UIAddCoin);
  6323. });
  6324. }
  6325. this.ui.isGetAward.visible = false;
  6326. this.ui.leftBtn.c1.selectedIndex = 3;
  6327. this.ui.rightBtn.c1.selectedIndex = 0;
  6328. this.moneyNode.ui.c1.selectedIndex = 1;
  6329. break;
  6330. case GameMode.placeBall:
  6331. this.ui.coinNode.visible = false;
  6332. if (this.success) {
  6333. if (xGame.common.placeBallStarNum == 3) {
  6334. this.ui.c1.selectedIndex = 2;
  6335. }
  6336. else {
  6337. this.ui.c1.selectedIndex = 3;
  6338. }
  6339. }
  6340. else {
  6341. this.ui.c1.selectedIndex = 4;
  6342. }
  6343. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  6344. if (cfg.type == PlaceBallType.challenge) {
  6345. this.ui.c1.selectedIndex = 2;
  6346. }
  6347. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  6348. this.updatePlaceBallBtn();
  6349. this.updatePlaceBallStarNum();
  6350. this.updatePlaceBallAwardState();
  6351. this.moneyNode.ui.c1.selectedIndex = 2;
  6352. this.moneyNode.checkPowerTime();
  6353. this.moneyNode.powerChange();
  6354. DataMgr.upRankData();
  6355. break;
  6356. default:
  6357. break;
  6358. }
  6359. }
  6360. updatePlaceBallBtn() {
  6361. this.ui.leftBtn.c1.selectedIndex = 5;
  6362. if (this.success) {
  6363. this.ui.rightBtn.c1.selectedIndex = 14;
  6364. }
  6365. else {
  6366. if (xGame.common.placeBallStarNum == 3) {
  6367. this.ui.rightBtn.c1.selectedIndex = 14;
  6368. }
  6369. else {
  6370. this.ui.rightBtn.c1.selectedIndex = 1;
  6371. }
  6372. }
  6373. }
  6374. updatePlaceBallStarNum() {
  6375. let starNum = xGame.common.placeBallStarNum;
  6376. if (starNum == 0)
  6377. this.ui.starNumNode.c1.selectedIndex = 3;
  6378. else {
  6379. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  6380. }
  6381. }
  6382. updatePlaceBallAwardState() {
  6383. let level = xGame.common.placeBallCurLevel;
  6384. let starNum = xGame.common.placeBallStarNum;
  6385. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  6386. let data = cfgTable.placeballData[level].award;
  6387. let cfg = cfgTable.placeballData[level];
  6388. this.awardDiamondNum = data[1];
  6389. this.awardCoinNum = data[0];
  6390. if (cfg.type == PlaceBallType.challenge) {
  6391. this.awardDiamondNum = 0;
  6392. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  6393. }
  6394. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  6395. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  6396. if (cfg.type == PlaceBallType.challenge) {
  6397. this.ui.awardNode.coinNode.visible = true;
  6398. }
  6399. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  6400. this.ui.awardNode.diamondNode.x = 265;
  6401. this.ui.awardNode.coinNode.x = 354;
  6402. }
  6403. else {
  6404. this.ui.awardNode.diamondNode.x = 291;
  6405. this.ui.awardNode.coinNode.x = 291;
  6406. }
  6407. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  6408. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  6409. if (this.awardCoinNum == 0) {
  6410. this.ui.awardNode.coinNode.numTxt.text = "";
  6411. }
  6412. if (getAward) {
  6413. this.ui.isGetAward.visible = true;
  6414. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  6415. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  6416. }
  6417. else {
  6418. this.ui.isGetAward.visible = false;
  6419. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  6420. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  6421. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  6422. }
  6423. else {
  6424. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  6425. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  6426. }
  6427. }
  6428. }
  6429. show(success) {
  6430. super.show();
  6431. xGame.eventMgr.event(RESET_GAME);
  6432. this.success = success;
  6433. Laya.timer.clearAll(this);
  6434. this.playSecretaryAni();
  6435. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  6436. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  6437. offsetTime = Math.floor(offsetTime / 1000);
  6438. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  6439. this.updateType();
  6440. Laya.timer.once(200, this, () => {
  6441. this.addAward(() => {
  6442. this.updateType();
  6443. Laya.timer.once(500, this, () => {
  6444. this.showChallengeLevel();
  6445. });
  6446. });
  6447. });
  6448. if (this.success) {
  6449. xGame.soundMgr.playSound('slots_roll01');
  6450. xGame.soundMgr.playSound("s_win");
  6451. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6452. }
  6453. else {
  6454. xGame.soundMgr.playSound('matchwin01');
  6455. xGame.soundMgr.playSound("s_lose");
  6456. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6457. }
  6458. if (!Moyu.isLegal)
  6459. PlatMgr.showBanner(true);
  6460. let challengeNum = DataMgr.getChallengeTimes();
  6461. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  6462. DataMgr.setChallengeTimes(1);
  6463. }
  6464. if (this.success && xGame.common.gameMode == GameMode.classic) {
  6465. DataMgr.setClassicTimes();
  6466. }
  6467. }
  6468. showChallengeLevel() {
  6469. if (DataMgr.getChallengeTimes() != 0)
  6470. return;
  6471. let skill = DataMgr.getSkillAccTimes();
  6472. let put = DataMgr.getPlaceBallLevelList().length;
  6473. if (skill >= 3 || put >= 5) {
  6474. xGame.uiMgr.Show(UIInvitation);
  6475. this.hide();
  6476. }
  6477. }
  6478. addAward(callback) {
  6479. if (!this.success) {
  6480. callback && callback();
  6481. return;
  6482. }
  6483. switch (xGame.common.gameMode) {
  6484. case GameMode.classic:
  6485. this.awardCoinNum = xGame.common.passAwardCoin;
  6486. this.awardDiamondNum = 0;
  6487. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  6488. break;
  6489. case GameMode.bigMove:
  6490. this.awardCoinNum = xGame.common.passAwardCoin;
  6491. this.awardDiamondNum = 0;
  6492. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  6493. callback && callback();
  6494. break;
  6495. case GameMode.placeBall:
  6496. let level = xGame.common.placeBallCurLevel;
  6497. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  6498. if (xGame.common.placeBallStarNum != 3) {
  6499. callback && callback();
  6500. return;
  6501. }
  6502. else {
  6503. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  6504. if (getAward) {
  6505. callback && callback();
  6506. return;
  6507. }
  6508. }
  6509. let cfg = cfgTable.placeballData[level];
  6510. let data = cfgTable.placeballData[level].award;
  6511. this.awardCoinNum = data[0];
  6512. this.awardDiamondNum = data[1];
  6513. if (cfg.type == PlaceBallType.challenge) {
  6514. this.awardDiamondNum = 0;
  6515. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  6516. }
  6517. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  6518. let diamondAward;
  6519. if (this.awardDiamondNum > 0) {
  6520. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  6521. xGame.common.getAward([diamondAward, coinAward], callback);
  6522. }
  6523. else {
  6524. xGame.common.getAward([coinAward], callback);
  6525. }
  6526. if (cfg.type == PlaceBallType.normal) {
  6527. DataMgr.setPlaceBallAward(level);
  6528. }
  6529. break;
  6530. default:
  6531. break;
  6532. }
  6533. }
  6534. playSecretaryAni_old() {
  6535. let parent = this.ui.secretary.displayObject;
  6536. parent.destroyChildren();
  6537. let xx = this.ui.secretary.width / 2;
  6538. let yy = this.ui.secretary.height;
  6539. let scale = xGame.common.getSecretaryScale();
  6540. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6541. if (this.success) {
  6542. let rand = Math.random() <= 0.5 ? 2 : 3;
  6543. xGame.common.secretary.play(data, rand, false, parent, () => {
  6544. xGame.common.secretary.play(data, 1, true, parent);
  6545. });
  6546. }
  6547. else {
  6548. xGame.common.secretary.play(data, 0, true, parent);
  6549. }
  6550. }
  6551. playSecretaryAni() {
  6552. let parent = this.ui.secretary.displayObject;
  6553. parent.destroyChildren();
  6554. let xx = this.ui.secretary.width / 2;
  6555. let yy = this.ui.secretary.height;
  6556. let scale = xGame.common.getSecretaryScale();
  6557. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6558. if (this.success) {
  6559. let rand = 0;
  6560. xGame.common.secretary.play(data, 0, true, parent);
  6561. }
  6562. else {
  6563. xGame.common.secretary.play(data, 0, true, parent);
  6564. }
  6565. }
  6566. restartGame() {
  6567. switch (xGame.common.gameMode) {
  6568. case GameMode.classic:
  6569. xGame.eventMgr.event(RESTART_GAME);
  6570. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  6571. break;
  6572. case GameMode.bigMove:
  6573. this.hide();
  6574. xGame.eventMgr.event(RESTART_GAME);
  6575. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  6576. break;
  6577. default:
  6578. break;
  6579. }
  6580. }
  6581. hide() {
  6582. super.hide();
  6583. xGame.common.stopGirlPop(this.ui.talkNode);
  6584. PlatMgr.showBanner(false);
  6585. }
  6586. returnHome() {
  6587. this.hide();
  6588. let showFailWords = !this.success;
  6589. xGame.uiMgr.Show(UIMain, showFailWords);
  6590. }
  6591. clickLeftBtn() {
  6592. switch (xGame.common.gameMode) {
  6593. case GameMode.classic:
  6594. case GameMode.bigMove:
  6595. this.returnHome();
  6596. break;
  6597. case GameMode.placeBall:
  6598. let level = xGame.common.placeBallCurLevel;
  6599. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  6600. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  6601. break;
  6602. default:
  6603. break;
  6604. }
  6605. }
  6606. powerStartPlaceBallLevel(level, btn) {
  6607. if (DataMgr.powerEnough()) {
  6608. btn.touchable = false;
  6609. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  6610. btn.touchable = true;
  6611. DataMgr.setPower(-1);
  6612. xGame.eventMgr.event(POWER_TIME);
  6613. this.startPlaceBallLevel(level);
  6614. }));
  6615. }
  6616. else {
  6617. xGame.uiMgr.Show(UIPower, 0);
  6618. }
  6619. }
  6620. clickRightBtn() {
  6621. switch (xGame.common.gameMode) {
  6622. case GameMode.classic:
  6623. console.log('zh:clickRightBtn 111');
  6624. case GameMode.bigMove:
  6625. console.log('zh:clickRightBtn 222');
  6626. this.restartGame();
  6627. break;
  6628. case GameMode.placeBall:
  6629. console.log('zh:clickRightBtn 333');
  6630. let level = xGame.common.placeBallCurLevel;
  6631. let data = DataMgr.getPlaceBallLevel(level);
  6632. let curPss = data.play && !data.isCur;
  6633. if (curPss) {
  6634. console.log('zh:clickRightBtn 333-111');
  6635. console.log('zh:当前LV=' + level);
  6636. if (level == 60) {
  6637. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  6638. Laya.timer.once(3000, this, () => {
  6639. this.returnHome();
  6640. });
  6641. }
  6642. else {
  6643. this.powerStartPlaceBallLevel(level + 1, this.ui.rightBtn);
  6644. }
  6645. }
  6646. else {
  6647. console.log('zh:clickRightBtn 333-000');
  6648. Moyu.sendDataEvent("placeBallNextLevel");
  6649. Moyu.showVideoAd(() => {
  6650. DataMgr.setPlaceBallLevel(level, 1);
  6651. this.startPlaceBallLevel(level + 1);
  6652. }, xGame.define.EAdType.placeBallNextLevel);
  6653. }
  6654. break;
  6655. default:
  6656. console.log('zh:clickRightBtn 444');
  6657. break;
  6658. }
  6659. }
  6660. startPlaceBallLevel(level) {
  6661. xGame.common.gameMode = GameMode.placeBall;
  6662. xGame.common.placeBallCurLevel = level;
  6663. xGame.uiMgr.Show(UIGame);
  6664. this.hide();
  6665. }
  6666. }
  6667. UIGameEnd.uiName = "UIGameEnd";
  6668. class ui_UIRepentProp extends fgui.GComponent {
  6669. static createInstance() {
  6670. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  6671. }
  6672. onConstruct() {
  6673. this.c1 = this.getController("c1");
  6674. this.n11 = (this.getChild("n11"));
  6675. this.regretNode = (this.getChild("regretNode"));
  6676. this.helpLineNode = (this.getChild("helpLineNode"));
  6677. this.t0 = this.getTransition("t0");
  6678. }
  6679. }
  6680. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  6681. class UIRepentProp extends UIBase {
  6682. constructor() {
  6683. super();
  6684. this.viewType = 0;
  6685. this.regretType = 0;
  6686. }
  6687. onConstructor() {
  6688. this.ui = ui_UIRepentProp.createInstance();
  6689. this.contentPane = this.ui;
  6690. this.isEject = false;
  6691. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  6692. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  6693. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  6694. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  6695. }
  6696. show(viewType, regretType, callback) {
  6697. PlatMgr.showInsert(true);
  6698. this.viewType = viewType;
  6699. this.regretType = regretType;
  6700. this.callback = callback;
  6701. super.show();
  6702. this.ui.t0.play();
  6703. this.ui.c1.selectedIndex = this.viewType;
  6704. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  6705. if (this.viewType == 0) {
  6706. let guide = DataMgr.getGuideHelpLine();
  6707. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  6708. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  6709. }
  6710. xGame.common.gameMgr.gamePause = true;
  6711. }
  6712. hideSelf() {
  6713. xGame.common.gameMgr.gamePause = false;
  6714. this.callback && this.callback(false);
  6715. this.hide();
  6716. }
  6717. videoRegret() {
  6718. Moyu.showVideoAd(() => {
  6719. this.callback && this.callback(true);
  6720. this.hideSelf();
  6721. }, EAdType.regretBall);
  6722. }
  6723. videoAddHelpLine() {
  6724. let guide = DataMgr.getGuideHelpLine();
  6725. if (guide == 0) {
  6726. this.callback && this.callback(true);
  6727. this.hideSelf();
  6728. DataMgr.setGuideHelpLine();
  6729. xGame.common.gameUI.ui.guideNode.visible = false;
  6730. }
  6731. else {
  6732. Moyu.showVideoAd(() => {
  6733. this.callback && this.callback(true);
  6734. this.hideSelf();
  6735. }, EAdType.longHelpLine);
  6736. }
  6737. }
  6738. }
  6739. UIRepentProp.uiName = "UIRepentProp";
  6740. class ui_UIVideoShare extends fgui.GComponent {
  6741. static createInstance() {
  6742. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  6743. }
  6744. onConstruct() {
  6745. this.n10 = (this.getChild("n10"));
  6746. this.myNode = (this.getChild("myNode"));
  6747. this.t0 = this.getTransition("t0");
  6748. }
  6749. }
  6750. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  6751. class UIVideoShare extends UIBase {
  6752. constructor() {
  6753. super();
  6754. this.success = false;
  6755. this.awardNum = 0;
  6756. this.isShared = true;
  6757. }
  6758. onConstructor() {
  6759. this.ui = ui_UIVideoShare.createInstance();
  6760. this.contentPane = this.ui;
  6761. this.isEject = false;
  6762. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  6763. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  6764. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  6765. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  6766. }
  6767. show(success) {
  6768. super.show();
  6769. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  6770. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  6771. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  6772. this.success = success;
  6773. let time = xGame.common.randomNum(600, 1500);
  6774. Moyu.showInsertAd(time, 60000);
  6775. if (success)
  6776. xGame.soundMgr.playSound("applause");
  6777. this.ui.t0.play();
  6778. this.checkShareState();
  6779. let times = DataMgr.getDailyVideoShareTimes();
  6780. this.awardNum = times == 0 ? 2000 : 200;
  6781. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  6782. }
  6783. checkShareState() {
  6784. if (PlatMgr.forceShare == 0) {
  6785. this.ui.myNode.closeBtn.visible = true;
  6786. this.ui.myNode.tipsNode.visible = false;
  6787. this.ui.myNode.closeBtn.x = 90;
  6788. this.ui.myNode.shareBtn.x = 342;
  6789. }
  6790. else if (PlatMgr.forceShare == 1) {
  6791. this.ui.myNode.closeBtn.visible = false;
  6792. this.ui.myNode.tipsNode.visible = true;
  6793. this.ui.myNode.shareBtn.x = 218;
  6794. this.isShared = true;
  6795. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  6796. }
  6797. }
  6798. checkForceShare() {
  6799. this.isShared = !this.isShared;
  6800. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  6801. }
  6802. videoShare() {
  6803. if (PlatMgr.forceShare == 1) {
  6804. if (this.isShared) {
  6805. this.shareGame();
  6806. }
  6807. else {
  6808. this.hideSelf();
  6809. }
  6810. }
  6811. else {
  6812. this.shareGame();
  6813. }
  6814. }
  6815. shareGame() {
  6816. Moyu.sendDataEvent("VideoShare");
  6817. if (Moyu.canShare() > 100) {
  6818. Moyu.shareGame((success) => {
  6819. if (success) {
  6820. DataMgr.setDailyVideoShareTimes(1);
  6821. DataMgr.setCoin(this.awardNum);
  6822. }
  6823. this.hideSelf();
  6824. }, this);
  6825. }
  6826. else {
  6827. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  6828. this.hideSelf();
  6829. }
  6830. }
  6831. hideSelf() {
  6832. this.hide();
  6833. xGame.uiMgr.Show(UIGameEnd, this.success);
  6834. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  6835. xGame.common.screenImg.destroy();
  6836. xGame.common.screenImg = null;
  6837. }
  6838. }
  6839. }
  6840. UIVideoShare.uiName = "UIVideoShare";
  6841. class ui_UITips extends fgui.GComponent {
  6842. static createInstance() {
  6843. return (fgui.UIPackage.createObject("game", "UITips"));
  6844. }
  6845. onConstruct() {
  6846. this.n0 = (this.getChild("n0"));
  6847. this.myNode = (this.getChild("myNode"));
  6848. this.t0 = this.getTransition("t0");
  6849. }
  6850. }
  6851. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  6852. class UITips extends UIBase {
  6853. constructor() {
  6854. super();
  6855. this.type = 0;
  6856. }
  6857. onConstructor() {
  6858. this.ui = ui_UITips.createInstance();
  6859. this.contentPane = this.ui;
  6860. this.isEject = false;
  6861. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  6862. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  6863. }
  6864. show(tipsTxt, womanTxt, type) {
  6865. super.show();
  6866. this.ui.t0.play();
  6867. this.ui.myNode.tipsTxt.text = tipsTxt;
  6868. this.ui.myNode.womanTxt.text = womanTxt;
  6869. PlatMgr.showInsert(true);
  6870. this.ui.myNode.c1.selectedIndex = type;
  6871. this.type = type;
  6872. switch (this.type) {
  6873. case TipsType.exitGame:
  6874. xGame.common.gameMgr.gamePause = true;
  6875. break;
  6876. case TipsType.foul:
  6877. Laya.timer.once(200, this, () => {
  6878. xGame.common.gameMgr.gamePause = true;
  6879. });
  6880. break;
  6881. default:
  6882. break;
  6883. }
  6884. }
  6885. clickLeftBtn() {
  6886. this.hide();
  6887. xGame.common.gameMgr.gamePause = false;
  6888. switch (this.type) {
  6889. case TipsType.exitGame:
  6890. break;
  6891. case TipsType.foul:
  6892. break;
  6893. default:
  6894. break;
  6895. }
  6896. }
  6897. clickRightBtn() {
  6898. this.hide();
  6899. switch (this.type) {
  6900. case TipsType.exitGame:
  6901. xGame.eventMgr.event(RESET_GAME);
  6902. xGame.uiMgr.Show(UIMain);
  6903. Moyu.recordEnd(this, null);
  6904. xGame.common.longHelpLine = false;
  6905. break;
  6906. case TipsType.foul:
  6907. xGame.common.gameMgr.gamePause = false;
  6908. Laya.timer.clearAll(this);
  6909. break;
  6910. default:
  6911. break;
  6912. }
  6913. }
  6914. }
  6915. UITips.uiName = "UITips";
  6916. class GameMgr {
  6917. constructor() {
  6918. this.selfCamp = "";
  6919. this.selfFoulNum = 0;
  6920. this.selfBallArr = [];
  6921. this.selfTimer = 0;
  6922. this.selfScore = 0;
  6923. this.aiCamp = "";
  6924. this.aiFoulNum = 0;
  6925. this.aiBallArr = [];
  6926. this.aiTimer = 0;
  6927. this.aiScore = 0;
  6928. this.aiSkillLevelNum = 1;
  6929. this.targertScore = 0;
  6930. this.setTime = 30;
  6931. this.selfTurnRate = 0.5;
  6932. this.accTime = 0;
  6933. this.curFoul = "";
  6934. this.maxFoulTimes = 3;
  6935. this.isFirstInGame = true;
  6936. this.firstColliObj = null;
  6937. this.inHoleBalls = [];
  6938. this.blackNum = 8;
  6939. this.success = false;
  6940. this.holePosList = [];
  6941. this.posObj = {};
  6942. this._selfTurn = false;
  6943. this.lastRootBallPos = new Laya.Vector2(311, 430);
  6944. this.ensureBallType = false;
  6945. this.isOpenBall = true;
  6946. this.finishOneShoot = true;
  6947. this.isEnd = false;
  6948. this.isChangeTurn = false;
  6949. this.isInterrupt = false;
  6950. this.aiPlayedBreakArmy = false;
  6951. this.isTouchedBall = false;
  6952. this.finishBalls = 0;
  6953. this.needBalls = 0;
  6954. this.allBallNum = 0;
  6955. this.placeBallPosData = {};
  6956. this.curHP = 0;
  6957. this.showLongView = false;
  6958. this.firstShoot = true;
  6959. this._gamePause = false;
  6960. this.trunCount = 0;
  6961. this.isBlackInHole = false;
  6962. this.isEnter = true;
  6963. xGame.eventMgr.offAll(ALL_BALL_STOP);
  6964. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  6965. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  6966. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  6967. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  6968. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  6969. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  6970. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  6971. }
  6972. get gamePause() {
  6973. return this._gamePause;
  6974. }
  6975. set gamePause(v) {
  6976. if (v) {
  6977. Laya.physicsTimer.pause();
  6978. }
  6979. else {
  6980. Laya.physicsTimer.resume();
  6981. }
  6982. this._gamePause = v;
  6983. }
  6984. get selfTurn() {
  6985. return this._selfTurn;
  6986. }
  6987. set selfTurn(val) {
  6988. this.trunCount++;
  6989. this._selfTurn = val;
  6990. if (val) {
  6991. xGame.common.d2World.d2Gan.ui.self.visible = true;
  6992. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  6993. }
  6994. else {
  6995. xGame.common.d2World.d2Gan.ui.self.visible = false;
  6996. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  6997. if (this.trunCount > 1)
  6998. PlatMgr.openBox();
  6999. }
  7000. }
  7001. resetGame() {
  7002. this.inHoleBalls = [];
  7003. this.isFirstInGame = true;
  7004. this.firstColliObj = null;
  7005. this.aiCamp = "";
  7006. this.selfCamp = "";
  7007. this.aiFoulNum = 0;
  7008. this.selfFoulNum = 0;
  7009. this.selfBallArr = [];
  7010. this.aiBallArr = [];
  7011. this.gamePause = false;
  7012. this.ensureBallType = false;
  7013. this.isInterrupt = false;
  7014. this.updateLeftBall();
  7015. this.clearTime();
  7016. this.aiPlayedBreakArmy = false;
  7017. this.isBlackInHole = false;
  7018. this.placeBallPosData = {};
  7019. if (xGame.common.d3World.knifeRoot) {
  7020. xGame.common.d3World.knifeRoot.destroyChildren();
  7021. }
  7022. }
  7023. gameReady() {
  7024. this.trunCount = 0;
  7025. this.firstColliObj = null;
  7026. this.isFirstInGame = true;
  7027. this.selfTurn = Math.random() <= this.selfTurnRate;
  7028. let challengeNum = DataMgr.getChallengeTimes();
  7029. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  7030. this.selfTurn = true;
  7031. }
  7032. if (xGame.common.gameMode == GameMode.placeBall)
  7033. this.selfTurn = true;
  7034. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  7035. this.selfTurn = true;
  7036. }
  7037. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  7038. this.checkGuide();
  7039. if (xGame.common.uiRodMethod)
  7040. xGame.common.uiRodMethod.resetRod();
  7041. xGame.common.d2World.getHelpLine();
  7042. this.isOpenBall = true;
  7043. this.isTouchedBall = false;
  7044. xGame.common.aiPlayer.stopRun();
  7045. this.setTime = 30;
  7046. let ui = xGame.common.gameUI.ui;
  7047. switch (xGame.common.gameMode) {
  7048. case GameMode.classic:
  7049. xGame.common.aiPlayer.init();
  7050. this.blackNum = 8;
  7051. this.placeRootBall();
  7052. this.peoplePlay(9, 10);
  7053. ui.wordsBtn.visible = true;
  7054. ui.aiWordsBtn.visible = true;
  7055. xGame.common.talkMgr.changeAIState(true);
  7056. DataMgr.gameData.gameCount++;
  7057. DataMgr.saveGameData();
  7058. break;
  7059. case GameMode.bigMove:
  7060. this.blackNum = -1;
  7061. this.selfScore = 0;
  7062. this.aiScore = 0;
  7063. xGame.common.aiPlayer.init();
  7064. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  7065. this.updateSelfScore();
  7066. this.updateAIScore();
  7067. this.updateTargetSroce();
  7068. this.placeRootBall();
  7069. this.peoplePlay(9, 10);
  7070. ui.wordsBtn.visible = true;
  7071. ui.aiWordsBtn.visible = true;
  7072. xGame.common.talkMgr.changeAIState(true);
  7073. if (DataMgr.getSkillGuide() < 1)
  7074. DataMgr.gameData.gameCount = 0;
  7075. else {
  7076. DataMgr.gameData.gameCount++;
  7077. DataMgr.saveGameData();
  7078. PlatMgr.openTry();
  7079. }
  7080. if (xGame.common.d3World.knifeRoot) {
  7081. xGame.common.d3World.knifeRoot.destroyChildren();
  7082. }
  7083. break;
  7084. case GameMode.placeBall:
  7085. this.blackNum = -1;
  7086. this.selfTurn = true;
  7087. this.setTime = 10000;
  7088. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  7089. this.curHP = this.placeBallData.hp;
  7090. if (this.placeBallData.ball == -1)
  7091. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  7092. else
  7093. this.needBalls = this.placeBallData.ball;
  7094. console.log("需要的进球数目", this.needBalls);
  7095. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  7096. this.finishBalls = 0;
  7097. this.placeBallPosData = {};
  7098. this.updatePlaceBallPos();
  7099. this.updatePlaceBallState();
  7100. this.finishOneShoot = true;
  7101. xGame.common.gameUI.ui.moveNode.visible = false;
  7102. this.isOpenBall = false;
  7103. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  7104. ui.wordsBtn.visible = false;
  7105. ui.aiWordsBtn.visible = false;
  7106. xGame.common.talkMgr.changeAIState(false);
  7107. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  7108. PlatMgr.openBox();
  7109. });
  7110. break;
  7111. default:
  7112. break;
  7113. }
  7114. this.showLongView = false;
  7115. xGame.common.wordsMgr.comboTimes = 1;
  7116. let guide = DataMgr.getSkillGuide();
  7117. if (guide)
  7118. xGame.eventMgr.event(WAIT_SHOOT);
  7119. xGame.common.upSkillLevel = false;
  7120. xGame.common.gameStartTime = new Date().getTime();
  7121. this.firstShoot = true;
  7122. }
  7123. checkGuide() {
  7124. let guide = DataMgr.getSkillGuide();
  7125. let gameUI = xGame.common.gameUI.ui;
  7126. gameUI.guide1.visible = false;
  7127. gameUI.guide2.visible = false;
  7128. gameUI.guide3.visible = false;
  7129. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  7130. this.selfTurn = true;
  7131. }
  7132. else {
  7133. return;
  7134. }
  7135. let oneBall = this.getOneBall();
  7136. gameUI.guide1.visible = true;
  7137. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  7138. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  7139. }
  7140. getOneBall() {
  7141. let arr = xGame.common.d2World.ballArr;
  7142. for (let index = 0; index < arr.length; index++) {
  7143. if (arr[index].number == 0)
  7144. continue;
  7145. return arr[index];
  7146. }
  7147. }
  7148. updateSelfScore() {
  7149. let ui = xGame.common.gameUI.ui.topNode;
  7150. ui.selfScoreTxt.text = this.selfScore + "";
  7151. }
  7152. updateAIScore() {
  7153. let ui = xGame.common.gameUI.ui.topNode;
  7154. ui.aiScoreTxt.text = this.aiScore + "";
  7155. }
  7156. updateTargetSroce() {
  7157. let ui = xGame.common.gameUI.ui.topNode;
  7158. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  7159. }
  7160. updateLeftBall() {
  7161. let topUI = xGame.common.gameUI.ui.topNode;
  7162. topUI.selfBallList.numItems = this.selfBallArr.length;
  7163. topUI.aiBallList.numItems = this.aiBallArr.length;
  7164. }
  7165. ballShoot() {
  7166. this.clearTime();
  7167. this.finishOneShoot = false;
  7168. xGame.common.gameUI.ui.moveNode.visible = false;
  7169. if (xGame.common.gameUI.ui.guideNode.visible) {
  7170. xGame.common.gameUI.ui.guideNode.visible = false;
  7171. }
  7172. if (this.firstShoot) {
  7173. this.firstShoot = false;
  7174. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  7175. }
  7176. }
  7177. ensureCamp(number) {
  7178. this.ensureBallType = true;
  7179. this.isOpenBall = false;
  7180. if (xGame.common.gameMode != GameMode.classic)
  7181. return;
  7182. let full = [1, 2, 3, 4, 5, 6, 7];
  7183. let flower = [9, 10, 11, 12, 13, 14, 15];
  7184. let sayWords = "";
  7185. if (this.selfTurn) {
  7186. if (number <= 7) {
  7187. this.selfCamp = ballCamp.full;
  7188. this.selfBallArr = full;
  7189. this.aiCamp = ballCamp.flower;
  7190. this.aiBallArr = flower;
  7191. sayWords = cfgTable.wordsData[3].msg;
  7192. }
  7193. else {
  7194. this.selfCamp = ballCamp.flower;
  7195. this.selfBallArr = flower;
  7196. this.aiCamp = ballCamp.full;
  7197. this.aiBallArr = full;
  7198. sayWords = cfgTable.wordsData[4].msg;
  7199. }
  7200. }
  7201. else {
  7202. if (number <= 7) {
  7203. this.selfCamp = ballCamp.flower;
  7204. this.selfBallArr = flower;
  7205. this.aiCamp = ballCamp.full;
  7206. this.aiBallArr = full;
  7207. sayWords = cfgTable.wordsData[2].msg;
  7208. }
  7209. else {
  7210. this.selfCamp = ballCamp.full;
  7211. this.selfBallArr = full;
  7212. this.aiCamp = ballCamp.flower;
  7213. this.aiBallArr = flower;
  7214. sayWords = cfgTable.wordsData[1].msg;
  7215. }
  7216. }
  7217. this.updateLeftBall();
  7218. xGame.uiMgr.Show(UIMsg, sayWords);
  7219. }
  7220. updatePlaceBallState() {
  7221. let ui = xGame.common.gameUI.ui;
  7222. switch (this.placeBallData.type) {
  7223. case PlaceBallType.normal:
  7224. let normal = ui.placeNormalNode;
  7225. normal.hpTxt.text = this.curHP + "";
  7226. this.updatePlaceBallStar(normal);
  7227. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  7228. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  7229. break;
  7230. case PlaceBallType.challenge:
  7231. let challenge = ui.placeChallengeNode;
  7232. challenge.hpTxt.text = "Shots:" + this.curHP;
  7233. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  7234. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  7235. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  7236. break;
  7237. default:
  7238. break;
  7239. }
  7240. }
  7241. playSubHpAni() {
  7242. let ui = xGame.common.gameUI.ui;
  7243. switch (this.placeBallData.type) {
  7244. case PlaceBallType.normal:
  7245. let normal = ui.placeNormalNode;
  7246. normal.hpTxt.visible = false;
  7247. normal.starAni.c1.selectedIndex = 1;
  7248. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  7249. normal.hpTxt.visible = true;
  7250. normal.starAni.c1.selectedIndex = 0;
  7251. }));
  7252. break;
  7253. default:
  7254. break;
  7255. }
  7256. }
  7257. getEndStarNum() {
  7258. let num;
  7259. let level = xGame.common.placeBallCurLevel;
  7260. if (this.curHP == this.placeBallData.hp) {
  7261. num = 3;
  7262. }
  7263. else if (this.curHP <= 1) {
  7264. num = 1;
  7265. }
  7266. else {
  7267. num = 2;
  7268. }
  7269. if (!this.success) {
  7270. num = 0;
  7271. }
  7272. else {
  7273. DataMgr.setPlaceBallLevel(level, num);
  7274. }
  7275. let myType = cfgTable.placeballData[level].type;
  7276. if (this.success && myType == 1) {
  7277. num = 3;
  7278. }
  7279. xGame.common.placeBallStarNum = num;
  7280. }
  7281. updatePlaceBallStar(node) {
  7282. let star = 0;
  7283. if (this.curHP == this.placeBallData.hp) {
  7284. star = 3;
  7285. }
  7286. else if (this.curHP >= 2) {
  7287. star = 2;
  7288. }
  7289. else if (this.curHP == 1) {
  7290. star = 1;
  7291. }
  7292. else {
  7293. star = 0;
  7294. }
  7295. let temp;
  7296. for (let index = 1; index <= 3; index++) {
  7297. temp = node["star" + index];
  7298. temp.c1.selectedIndex = star >= index ? 1 : 0;
  7299. }
  7300. node.myProgress.value = (star / 3) * 100;
  7301. }
  7302. openRegretView(isFoul, GoalNum, challenge = false) {
  7303. let regretType = -1;
  7304. if (isFoul) {
  7305. regretType = 1;
  7306. }
  7307. else {
  7308. if (GoalNum <= 0) {
  7309. regretType = 0;
  7310. }
  7311. }
  7312. if (challenge) {
  7313. regretType = 1;
  7314. }
  7315. if (regretType != -1) {
  7316. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  7317. if (success) {
  7318. this.curHP++;
  7319. this.updatePlaceBallState();
  7320. this.setPlaceBallAllPos();
  7321. xGame.common.gameUI.ui.moveNode.visible = false;
  7322. }
  7323. else {
  7324. if (this.curHP <= 0) {
  7325. this.success = false;
  7326. this.gameEnd();
  7327. }
  7328. this.playSubHpAni();
  7329. }
  7330. this.updatePlaceBallState();
  7331. this.updatePlaceBallPos();
  7332. });
  7333. }
  7334. }
  7335. setPlaceBallAllPos() {
  7336. let allBall = xGame.common.d2World.ballArr;
  7337. let cfgArr = this.placeBallPosData;
  7338. let temp;
  7339. let obj;
  7340. for (let index = 0; index < allBall.length; index++) {
  7341. temp = allBall[index];
  7342. if (temp.destroyed)
  7343. continue;
  7344. obj = cfgArr[temp.myUNID];
  7345. if (obj && obj.src && !obj.src.destroyed) {
  7346. temp.gameObj.x = obj.posX;
  7347. temp.gameObj.y = obj.posY;
  7348. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  7349. }
  7350. }
  7351. xGame.common.d2World.getHelpLine();
  7352. }
  7353. updatePlaceBallPos() {
  7354. let arr = xGame.common.d2World.ballArr;
  7355. let temp;
  7356. for (let index = 0; index < arr.length; index++) {
  7357. temp = arr[index];
  7358. if (!this.placeBallPosData[temp.myUNID]) {
  7359. this.placeBallPosData[temp.myUNID] = {
  7360. src: temp,
  7361. posX: temp.gameObj.x,
  7362. posY: temp.gameObj.y
  7363. };
  7364. }
  7365. else {
  7366. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  7367. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  7368. }
  7369. }
  7370. let check;
  7371. for (const key in this.placeBallPosData) {
  7372. check = this.placeBallPosData[key];
  7373. if (check.src.destroyed) {
  7374. delete this.placeBallPosData[key];
  7375. }
  7376. }
  7377. }
  7378. gameRun(type) {
  7379. if (this.gamePause)
  7380. return;
  7381. this.curFoul = this.getFoulType();
  7382. if (type) {
  7383. xGame.common.d2World.d2Gan.shoot();
  7384. xGame.common.gameUI.forceCancel();
  7385. this.curFoul = type;
  7386. }
  7387. this.isEnd = false;
  7388. this.isChangeTurn = true;
  7389. if (xGame.common.gameMode == GameMode.classic) {
  7390. this.judgeClassic(this.curFoul);
  7391. this.checkClassicWords(() => {
  7392. xGame.common.destroyClassicEmotion();
  7393. if (this.isEnd) {
  7394. if (this.isBlackInHole) {
  7395. xGame.common.gameUI.ui.blackAni.visible = true;
  7396. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  7397. xGame.common.gameUI.ui.blackAni.visible = false;
  7398. this.gameEnd();
  7399. }));
  7400. }
  7401. else {
  7402. this.gameEnd();
  7403. }
  7404. }
  7405. else {
  7406. this.waitShoot();
  7407. xGame.eventMgr.event(WAIT_SHOOT);
  7408. }
  7409. });
  7410. }
  7411. else if (xGame.common.gameMode == GameMode.bigMove) {
  7412. xGame.common.aiPlayer.stopRun();
  7413. let scoreArr = this.getScore(this.curFoul);
  7414. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  7415. this.isEnd = true;
  7416. }
  7417. this.checkBigSkillWords(() => {
  7418. if (this.isEnd) {
  7419. this.gameEnd();
  7420. }
  7421. else {
  7422. this.waitShoot();
  7423. xGame.eventMgr.event(WAIT_SHOOT);
  7424. }
  7425. });
  7426. }
  7427. else if (xGame.common.gameMode == GameMode.placeBall) {
  7428. xGame.common.destroyAwardSpine();
  7429. let isFoul = this.curFoul == FoulType.rootHole;
  7430. let GoalNum = this.inHoleBalls.length;
  7431. if (this.inHoleBalls.indexOf(0) > -1)
  7432. GoalNum -= 1;
  7433. if (isFoul) {
  7434. this.placeRootBall();
  7435. }
  7436. console.log("neeballs", this.needBalls);
  7437. console.log("当前完成的goalNum", GoalNum);
  7438. this.finishBalls += GoalNum;
  7439. console.log("当前完成的finishballs", this.finishBalls);
  7440. let need = this.needBalls;
  7441. if (this.placeBallData.type == PlaceBallType.challenge) {
  7442. need += 100;
  7443. }
  7444. if (this.finishBalls >= need) {
  7445. this.success = true;
  7446. this.gameEnd();
  7447. }
  7448. else {
  7449. switch (this.placeBallData.type) {
  7450. case PlaceBallType.normal:
  7451. if (!isFoul && GoalNum > 0) {
  7452. this.updatePlaceBallPos();
  7453. this.updatePlaceBallState();
  7454. }
  7455. else {
  7456. this.curHP--;
  7457. this.openRegretView(isFoul, GoalNum);
  7458. }
  7459. this.waitShoot();
  7460. xGame.eventMgr.event(WAIT_SHOOT);
  7461. break;
  7462. case PlaceBallType.challenge:
  7463. this.curHP--;
  7464. this.updatePlaceBallState();
  7465. if (isFoul) {
  7466. this.openRegretView(isFoul, GoalNum, true);
  7467. }
  7468. else {
  7469. this.updatePlaceBallPos();
  7470. if (this.curHP <= 0) {
  7471. this.success = true;
  7472. this.gameEnd();
  7473. }
  7474. }
  7475. this.waitShoot();
  7476. xGame.eventMgr.event(WAIT_SHOOT);
  7477. break;
  7478. default:
  7479. break;
  7480. }
  7481. }
  7482. }
  7483. }
  7484. checkClassicWords(callback) {
  7485. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  7486. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  7487. let type = this.getClassicWordsType();
  7488. if (condition && type != -1) {
  7489. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  7490. xGame.soundMgr.playSound(str);
  7491. xGame.common.wordsMgr.playClassicWords(type, callback);
  7492. }
  7493. else {
  7494. Laya.timer.once(300, this, () => {
  7495. callback && callback();
  7496. });
  7497. }
  7498. }
  7499. getClassicWordsType() {
  7500. let d2world = xGame.common.d2World;
  7501. let type = -1;
  7502. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  7503. type = ClassicWordsType.perfectShow;
  7504. return type;
  7505. }
  7506. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  7507. type = ClassicWordsType.directShoot;
  7508. return type;
  7509. }
  7510. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  7511. type = ClassicWordsType.anotherShoot;
  7512. return type;
  7513. }
  7514. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  7515. type = ClassicWordsType.bigPower;
  7516. return type;
  7517. }
  7518. let minSpeed = 1;
  7519. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  7520. type = ClassicWordsType.hardShoot;
  7521. return type;
  7522. }
  7523. if (this.inHoleBalls.length > 0) {
  7524. type = ClassicWordsType.directShoot;
  7525. return type;
  7526. }
  7527. return type;
  7528. }
  7529. checkBigSkillWords(callback) {
  7530. if (this.curFoul == FoulType.timeOut) {
  7531. callback && callback();
  7532. }
  7533. else {
  7534. let playSkill = false;
  7535. if (this.selfTurn) {
  7536. playSkill = true;
  7537. }
  7538. else {
  7539. if (!this.aiPlayedBreakArmy) {
  7540. this.aiPlayedBreakArmy = true;
  7541. playSkill = true;
  7542. }
  7543. if (this.aiCurSkill != SkillType.breakArmy) {
  7544. playSkill = true;
  7545. }
  7546. }
  7547. if (xGame.common.skillMgr.playedLastSkill) {
  7548. xGame.common.skillMgr.playedLastSkill = false;
  7549. playSkill = false;
  7550. }
  7551. if (playSkill) {
  7552. xGame.common.skillMgr.runBigSkill((extraScore) => {
  7553. let selfExtra = 0;
  7554. let aiExtra = 0;
  7555. if (this.selfTurn)
  7556. selfExtra += extraScore;
  7557. else
  7558. aiExtra += extraScore;
  7559. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  7560. this.isEnd = true;
  7561. }
  7562. this.playBigSkillTimes(callback);
  7563. });
  7564. }
  7565. else {
  7566. this.playBigSkillTimes(callback);
  7567. }
  7568. }
  7569. }
  7570. playBigSkillTimes(callback) {
  7571. let length = this.inHoleBalls.length;
  7572. if (this.inHoleBalls.indexOf(0) > -1) {
  7573. length = this.inHoleBalls.length - 1;
  7574. }
  7575. if (length <= 0) {
  7576. callback && callback();
  7577. return;
  7578. }
  7579. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  7580. callback && callback();
  7581. });
  7582. }
  7583. playSkillTips() {
  7584. let levelNum = 0;
  7585. let curType;
  7586. if (this.selfTurn) {
  7587. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  7588. curType = this.selfCurSkill;
  7589. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  7590. levelNum += 5;
  7591. }
  7592. }
  7593. else {
  7594. levelNum = this.aiSkillLevelNum;
  7595. curType = this.aiCurSkill;
  7596. }
  7597. let str = ``;
  7598. switch (curType) {
  7599. case SkillType.highSpace:
  7600. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  7601. break;
  7602. case SkillType.breakArmy:
  7603. str = `You pocketed ${levelNum} extra balls`;
  7604. break;
  7605. case SkillType.ice:
  7606. str = `${levelNum * 2} extra balls were frozen`;
  7607. break;
  7608. case SkillType.fireworks:
  7609. str = `${levelNum} extra balls exploded `;
  7610. break;
  7611. case SkillType.GuanYu:
  7612. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  7613. break;
  7614. default:
  7615. break;
  7616. }
  7617. xGame.uiMgr.Show(UIMsg, str);
  7618. }
  7619. getFoulType() {
  7620. let foulType = "";
  7621. if (this.firstColliObj == null) {
  7622. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  7623. return FoulType.rootHole;
  7624. }
  7625. return FoulType.notTouch;
  7626. }
  7627. else {
  7628. if (this.selfTurn) {
  7629. if (this.selfBallArr.length > 0) {
  7630. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  7631. foulType = FoulType.wrongTouch;
  7632. }
  7633. }
  7634. else {
  7635. if (this.ensureBallType) {
  7636. }
  7637. else {
  7638. if (this.firstColliObj == this.blackNum) {
  7639. foulType = FoulType.wrongTouch;
  7640. }
  7641. }
  7642. }
  7643. }
  7644. else {
  7645. if (this.aiBallArr.length > 0) {
  7646. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  7647. foulType = FoulType.wrongTouch;
  7648. }
  7649. }
  7650. else {
  7651. if (this.ensureBallType) {
  7652. }
  7653. else {
  7654. if (this.firstColliObj == this.blackNum) {
  7655. foulType = FoulType.wrongTouch;
  7656. }
  7657. }
  7658. }
  7659. }
  7660. if (this.inHoleBalls.length <= 0) {
  7661. return foulType;
  7662. }
  7663. let temp;
  7664. if (this.inHoleBalls.indexOf(0) > -1) {
  7665. foulType = FoulType.rootHole;
  7666. }
  7667. else {
  7668. for (let index = 0; index < this.inHoleBalls.length; index++) {
  7669. temp = this.inHoleBalls[index];
  7670. if (this.selfTurn) {
  7671. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  7672. foulType = FoulType.wrongHole;
  7673. break;
  7674. }
  7675. }
  7676. else {
  7677. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  7678. foulType = FoulType.wrongHole;
  7679. break;
  7680. }
  7681. }
  7682. }
  7683. }
  7684. let foo;
  7685. for (let index = 0; index < this.inHoleBalls.length; index++) {
  7686. temp = this.inHoleBalls[index];
  7687. foo = this.selfBallArr.indexOf(temp);
  7688. if (foo > -1) {
  7689. this.selfBallArr.splice(foo, 1);
  7690. }
  7691. foo = this.aiBallArr.indexOf(temp);
  7692. if (foo > -1) {
  7693. this.aiBallArr.splice(foo, 1);
  7694. }
  7695. }
  7696. this.updateLeftBall();
  7697. }
  7698. return foulType;
  7699. }
  7700. judgeGameEndByBlack(arr) {
  7701. if (this.selfTurn) {
  7702. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  7703. this.selfFoulNum = this.maxFoulTimes;
  7704. return true;
  7705. }
  7706. }
  7707. else {
  7708. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  7709. this.aiFoulNum = this.maxFoulTimes;
  7710. return true;
  7711. }
  7712. }
  7713. }
  7714. judgeClassic(type) {
  7715. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  7716. xGame.common.aiPlayer.stopRun();
  7717. if (this.judgeNormalSuccess()) {
  7718. this.isEnd = true;
  7719. return;
  7720. }
  7721. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  7722. if (this.selfTurn) {
  7723. if (isFoul) {
  7724. this.selfFoulNum++;
  7725. }
  7726. if (this.selfFoulNum >= this.maxFoulTimes) {
  7727. this.success = false;
  7728. this.isEnd = true;
  7729. return;
  7730. }
  7731. }
  7732. else {
  7733. if (isFoul)
  7734. this.aiFoulNum++;
  7735. if (this.aiFoulNum >= this.maxFoulTimes) {
  7736. this.success = true;
  7737. this.isEnd = true;
  7738. return;
  7739. }
  7740. }
  7741. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  7742. this.isChangeTurn = false;
  7743. }
  7744. else {
  7745. this.isInterrupt = true;
  7746. }
  7747. }
  7748. waitShoot() {
  7749. if (xGame.common.gameMode == GameMode.classic) {
  7750. switch (this.curFoul) {
  7751. case FoulType.timeOut:
  7752. case FoulType.rootHole:
  7753. this.selfTurn = !this.selfTurn;
  7754. this.peoplePlay(5, 6, true);
  7755. break;
  7756. case FoulType.notTouch:
  7757. this.selfTurn = !this.selfTurn;
  7758. this.peoplePlay(7, 7);
  7759. break;
  7760. case FoulType.wrongHole:
  7761. this.selfTurn = !this.selfTurn;
  7762. this.peoplePlay(11, 11);
  7763. break;
  7764. default:
  7765. if (this.inHoleBalls.length > 0) {
  7766. this.peoplePlay(0, 0, false, false);
  7767. }
  7768. else {
  7769. this.selfTurn = !this.selfTurn;
  7770. this.peoplePlay(7, 7);
  7771. }
  7772. break;
  7773. }
  7774. }
  7775. else if (xGame.common.gameMode == GameMode.bigMove) {
  7776. if (this.curFoul == FoulType.timeOut) {
  7777. this.selfTurn = !this.selfTurn;
  7778. this.peoplePlay(14, 15);
  7779. this.placeRootBall();
  7780. }
  7781. else {
  7782. this.selfTurn = !this.selfTurn;
  7783. if (this.curFoul == FoulType.rootHole) {
  7784. this.peoplePlay(12, 13);
  7785. this.placeRootBall();
  7786. }
  7787. else {
  7788. this.peoplePlay(0, 0, false, false);
  7789. }
  7790. }
  7791. }
  7792. else if (xGame.common.gameMode == GameMode.placeBall) {
  7793. this.finishOneShoot = true;
  7794. }
  7795. this.gameResult();
  7796. }
  7797. gameResult() {
  7798. this.firstColliObj = null;
  7799. this.inHoleBalls = [];
  7800. let curX = xGame.common.d2World.rootBall.gameObj.x;
  7801. let curY = xGame.common.d2World.rootBall.gameObj.y;
  7802. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  7803. if (xGame.common.uiRodMethod)
  7804. xGame.common.uiRodMethod.resetRod();
  7805. xGame.common.d2World.rootBall.showSelf();
  7806. this.clearIceSkill();
  7807. if (this.selfTurn) {
  7808. console.log("gameResult");
  7809. PlatMgr.gameInsert();
  7810. }
  7811. xGame.common.d3World.knifeRoot.destroyChildren();
  7812. if (this.selfTurn) {
  7813. xGame.common.gameUI.showHelpLineGuide();
  7814. xGame.common.gameUI.setTurnAlpha(true);
  7815. }
  7816. else {
  7817. xGame.common.gameUI.setTurnAlpha(false);
  7818. }
  7819. }
  7820. getScore(type) {
  7821. let selfAdd = 0;
  7822. let aiAdd = 0;
  7823. if (type == FoulType.timeOut) {
  7824. if (this.selfTurn)
  7825. aiAdd += 3;
  7826. else
  7827. selfAdd += 3;
  7828. }
  7829. else {
  7830. if (this.inHoleBalls.length > 0) {
  7831. if (this.selfTurn) {
  7832. if (type == FoulType.rootHole) {
  7833. aiAdd += 3;
  7834. if (this.inHoleBalls.length - 1 > 0) {
  7835. selfAdd += this.inHoleBalls.length - 1;
  7836. }
  7837. }
  7838. else {
  7839. selfAdd += this.inHoleBalls.length;
  7840. }
  7841. }
  7842. else {
  7843. if (type == FoulType.rootHole) {
  7844. selfAdd += 3;
  7845. if (this.inHoleBalls.length - 1 > 0) {
  7846. aiAdd += this.inHoleBalls.length - 1;
  7847. }
  7848. }
  7849. else {
  7850. aiAdd += this.inHoleBalls.length;
  7851. }
  7852. }
  7853. }
  7854. }
  7855. return [selfAdd, aiAdd];
  7856. }
  7857. judgeScoreEnd(selfAdd, aiAdd) {
  7858. this.selfScore += selfAdd;
  7859. this.aiScore += aiAdd;
  7860. this.updateAIScore();
  7861. this.updateSelfScore();
  7862. if (this.selfScore >= this.targertScore) {
  7863. this.success = true;
  7864. return true;
  7865. }
  7866. if (this.aiScore >= this.targertScore) {
  7867. this.success = false;
  7868. return true;
  7869. }
  7870. let ballArr = xGame.common.d2World.ballArr;
  7871. if (ballArr.length == 1 && ballArr[0].number == 0) {
  7872. if (this.selfScore > this.aiScore) {
  7873. this.success = true;
  7874. return true;
  7875. }
  7876. else if (this.selfScore < this.aiScore) {
  7877. this.success = false;
  7878. return true;
  7879. }
  7880. else {
  7881. if (this.selfTurn) {
  7882. this.success = false;
  7883. }
  7884. else {
  7885. this.success = true;
  7886. }
  7887. return true;
  7888. }
  7889. }
  7890. }
  7891. clearIceSkill() {
  7892. let arr = xGame.common.d2World.ballArr;
  7893. let temp;
  7894. if (this.selfTurn) {
  7895. if (this.selfCurSkill == SkillType.ice) {
  7896. for (let index = 0; index < arr.length; index++) {
  7897. temp = arr[index];
  7898. if (temp.ballFunc == "ice") {
  7899. temp.setBallFunc("normal", "self");
  7900. }
  7901. }
  7902. }
  7903. }
  7904. else {
  7905. if (this.aiCurSkill == SkillType.ice) {
  7906. for (let index = 0; index < arr.length; index++) {
  7907. temp = arr[index];
  7908. if (temp.ballFunc == "ice") {
  7909. temp.setBallFunc("normal", "ai");
  7910. }
  7911. }
  7912. }
  7913. }
  7914. }
  7915. judgeNormalSuccess() {
  7916. if (this.selfTurn) {
  7917. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  7918. this.success = true;
  7919. return true;
  7920. }
  7921. }
  7922. else {
  7923. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  7924. this.success = false;
  7925. return true;
  7926. }
  7927. }
  7928. }
  7929. gameEnd() {
  7930. if (Moyu.isTT) {
  7931. xGame.common.screenImg = getScreenImg();
  7932. }
  7933. console.log("游戏结束", this.success);
  7934. xGame.common.aiPlayer.stopRun();
  7935. if (xGame.common.gameMode == GameMode.placeBall) {
  7936. this.getEndStarNum();
  7937. this.updatePlaceBallState();
  7938. }
  7939. this.isEnter = false;
  7940. Moyu.recordEnd(this, () => {
  7941. if (this.isEnter)
  7942. return;
  7943. this.isEnter = true;
  7944. console.log("进入录结束回调");
  7945. this.enterNext();
  7946. });
  7947. Laya.timer.once(1000, this, () => {
  7948. if (this.isEnter)
  7949. return;
  7950. this.isEnter = true;
  7951. this.enterNext();
  7952. });
  7953. xGame.common.longHelpLine = false;
  7954. }
  7955. enterNext() {
  7956. Laya.timer.clearAll(this);
  7957. if (Moyu.canShare() > 100 || Moyu.isKs) {
  7958. xGame.uiMgr.Show(UIVideoShare, this.success);
  7959. }
  7960. else {
  7961. xGame.uiMgr.Show(UIGameEnd, this.success);
  7962. }
  7963. }
  7964. aiLeave() {
  7965. let ui = xGame.common.gameUI.ui;
  7966. ui.topNode.aiNameTxt.text = "offline";
  7967. }
  7968. aiGameEnd(suc) {
  7969. this.success = suc;
  7970. xGame.common.aiPlayer.stopRun();
  7971. if (this.success) {
  7972. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  7973. Laya.timer.once(1000, this, () => {
  7974. this.clearTime();
  7975. this.gameEnd();
  7976. });
  7977. }
  7978. }
  7979. openTimer() {
  7980. let src = xGame.common.gameUI;
  7981. if (this.selfTurn) {
  7982. src.ui.topNode.selfProgress.visible = true;
  7983. src.ui.topNode.aiProgress.visible = false;
  7984. this.curTimer = src.ui.topNode.selfProgress;
  7985. }
  7986. else {
  7987. src.ui.topNode.selfProgress.visible = false;
  7988. src.ui.topNode.aiProgress.visible = true;
  7989. this.curTimer = src.ui.topNode.aiProgress;
  7990. }
  7991. this.accTime = 0;
  7992. Laya.timer.clearAll(this);
  7993. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  7994. this.curTimer.value = 100;
  7995. }
  7996. updateTime(dt) {
  7997. if (this.gamePause)
  7998. return;
  7999. this.accTime += dt;
  8000. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  8001. if (this.accTime >= this.setTime) {
  8002. this.clearTime();
  8003. console.log("时钟进入了gameRun");
  8004. this.gameRun(FoulType.timeOut);
  8005. }
  8006. }
  8007. clearTime() {
  8008. let src = xGame.common.gameUI;
  8009. src.ui.topNode.selfProgress.visible = false;
  8010. src.ui.topNode.aiProgress.visible = false;
  8011. Laya.timer.clearAll(this);
  8012. }
  8013. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  8014. let ui = xGame.common.gameUI.ui;
  8015. let selfMsg, aiMsg;
  8016. if (sayWords) {
  8017. selfMsg = cfgTable.wordsData[selfIndex].msg;
  8018. aiMsg = cfgTable.wordsData[aiIndex].msg;
  8019. if (Foul) {
  8020. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  8021. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  8022. this.placeRootBall();
  8023. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  8024. if (this.curFoul == FoulType.rootHole) {
  8025. if (!DataMgr.getRootBallFoul()) {
  8026. DataMgr.setRootBallFoul();
  8027. aiMsg = "";
  8028. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  8029. let woman = "Boss, pay attention next time~";
  8030. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  8031. }
  8032. }
  8033. else if (this.curFoul == FoulType.timeOut) {
  8034. if (!DataMgr.getTimeoutFoul()) {
  8035. DataMgr.setTimeoutFoul();
  8036. aiMsg = "";
  8037. let tips = "Game timeout, 3 fouls, this game failed.";
  8038. let woman = "Boss, pay attention to the timeline~";
  8039. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  8040. }
  8041. }
  8042. }
  8043. }
  8044. }
  8045. if (this.selfTurn) {
  8046. if (sayWords) {
  8047. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  8048. ui.selfTurn.visible = true;
  8049. ui.aiTurn.visible = false;
  8050. ui.selfTurn.t0.play();
  8051. Moyu.vibration();
  8052. });
  8053. }
  8054. }
  8055. else {
  8056. let aiNum = xGame.tools.random(1, 11);
  8057. let challengeNum = DataMgr.getChallengeTimes();
  8058. let delay = false;
  8059. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8060. aiNum = 9;
  8061. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  8062. aiNum = 3;
  8063. if (challengeNum == 3) {
  8064. if (!this.showLongView) {
  8065. this.showLongView = true;
  8066. delay = true;
  8067. }
  8068. }
  8069. }
  8070. }
  8071. if (delay) {
  8072. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  8073. if (success) {
  8074. xGame.common.longHelpLine = true;
  8075. xGame.common.d2World.getHelpLine();
  8076. }
  8077. else {
  8078. aiNum = 10;
  8079. }
  8080. xGame.common.aiPlayer.setAiLevel(aiNum);
  8081. if (sayWords) {
  8082. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  8083. xGame.common.aiPlayer.runAI();
  8084. ui.selfTurn.visible = false;
  8085. ui.aiTurn.visible = true;
  8086. ui.aiTurn.t0.play();
  8087. });
  8088. }
  8089. else {
  8090. xGame.common.aiPlayer.runAI();
  8091. }
  8092. this.openTimer();
  8093. this.finishOneShoot = true;
  8094. if (this.selfTurn) {
  8095. ui.topNode.selfKuang.visible = true;
  8096. ui.topNode.aiKuang.visible = false;
  8097. ui.topNode.selfTips.visible = true;
  8098. ui.topNode.aiTips.visible = false;
  8099. }
  8100. else {
  8101. ui.topNode.selfKuang.visible = false;
  8102. ui.topNode.aiKuang.visible = true;
  8103. ui.topNode.selfTips.visible = false;
  8104. ui.topNode.aiTips.visible = true;
  8105. }
  8106. });
  8107. return;
  8108. }
  8109. if (xGame.common.gameMode == GameMode.classic) {
  8110. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  8111. if (cfg) {
  8112. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  8113. aiNum = aiLevel;
  8114. }
  8115. }
  8116. xGame.common.aiPlayer.setAiLevel(aiNum);
  8117. if (sayWords) {
  8118. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  8119. xGame.common.aiPlayer.runAI();
  8120. ui.selfTurn.visible = false;
  8121. ui.aiTurn.visible = true;
  8122. ui.aiTurn.t0.play();
  8123. });
  8124. }
  8125. else {
  8126. xGame.common.aiPlayer.runAI();
  8127. }
  8128. }
  8129. this.openTimer();
  8130. this.finishOneShoot = true;
  8131. if (this.selfTurn) {
  8132. ui.topNode.selfKuang.visible = true;
  8133. ui.topNode.aiKuang.visible = false;
  8134. ui.topNode.selfTips.visible = true;
  8135. ui.topNode.aiTips.visible = false;
  8136. }
  8137. else {
  8138. ui.topNode.selfKuang.visible = false;
  8139. ui.topNode.aiKuang.visible = true;
  8140. ui.topNode.selfTips.visible = false;
  8141. ui.topNode.aiTips.visible = true;
  8142. }
  8143. }
  8144. placeRootBall() {
  8145. let rootBall = xGame.common.d2World.rootBall;
  8146. if (!rootBall)
  8147. return;
  8148. rootBall.gameObj.x = this.lastRootBallPos.x;
  8149. rootBall.gameObj.y = this.lastRootBallPos.y;
  8150. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  8151. let moveNode = xGame.common.gameUI.ui.moveNode;
  8152. moveNode.visible = true;
  8153. moveNode.x = this.lastRootBallPos.x;
  8154. moveNode.y = this.lastRootBallPos.y;
  8155. if (!this.selfTurn) {
  8156. xGame.common.aiPlayer.resetRoot();
  8157. }
  8158. }
  8159. }
  8160. class ui_guanyuAni extends fgui.GComponent {
  8161. static createInstance() {
  8162. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  8163. }
  8164. onConstruct() {
  8165. this.n0 = (this.getChild("n0"));
  8166. }
  8167. }
  8168. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  8169. class UIFireworks extends UIBase {
  8170. constructor() {
  8171. super();
  8172. }
  8173. onConstructor() {
  8174. this.isEject = false;
  8175. }
  8176. show(callback) {
  8177. super.show();
  8178. }
  8179. }
  8180. UIFireworks.uiName = "UIFireworks";
  8181. class ui_UIGuanYu extends fgui.GComponent {
  8182. static createInstance() {
  8183. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  8184. }
  8185. onConstruct() {
  8186. this.n2 = (this.getChild("n2"));
  8187. this.n1 = (this.getChild("n1"));
  8188. this.n3 = (this.getChild("n3"));
  8189. this.n4 = (this.getChild("n4"));
  8190. this.n5 = (this.getChild("n5"));
  8191. this.n6 = (this.getChild("n6"));
  8192. this.n8 = (this.getChild("n8"));
  8193. this.n7 = (this.getChild("n7"));
  8194. this.t0 = this.getTransition("t0");
  8195. }
  8196. }
  8197. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  8198. class UIGuanYu extends UIBase {
  8199. constructor() {
  8200. super();
  8201. }
  8202. onConstructor() {
  8203. this.ui = ui_UIGuanYu.createInstance();
  8204. this.contentPane = this.ui;
  8205. this.isEject = false;
  8206. }
  8207. show(callback) {
  8208. super.show();
  8209. this.ui.t0.play(Laya.Handler.create(this, () => {
  8210. callback && callback();
  8211. this.hide();
  8212. }));
  8213. }
  8214. }
  8215. UIGuanYu.uiName = "UIGuanYu";
  8216. class SkillMgr {
  8217. constructor() {
  8218. this.leveNum = 0;
  8219. this.extraScore = 0;
  8220. this.selfTurn = false;
  8221. this.playedLastSkill = false;
  8222. this.tweenArr = [];
  8223. this._finishNum = 0;
  8224. this._curFinish = 0;
  8225. this._rootX = 0;
  8226. this._rootY = 0;
  8227. this.knifeTimes = 0;
  8228. this.knifeV2 = new Laya.Vector2();
  8229. this.knifeV3 = new Laya.Vector3();
  8230. this.rtStarX = 0;
  8231. this.rtStarY = 0;
  8232. this.addBigSkillSpine();
  8233. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8234. }
  8235. addBigSkillSpine() {
  8236. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  8237. console.log("extra2 success");
  8238. });
  8239. }
  8240. runBigSkill(callback) {
  8241. this.tweenArr = [];
  8242. this.callback = callback;
  8243. this.judgeSkill();
  8244. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  8245. let guide = DataMgr.getSkillGuide();
  8246. if (!xGame.common.gameMgr.selfTurn) {
  8247. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  8248. }
  8249. else {
  8250. if (xGame.common.temSelfLevel != 0) {
  8251. this.leveNum = xGame.common.temSelfLevel;
  8252. }
  8253. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  8254. this.leveNum += 5;
  8255. }
  8256. }
  8257. if (guide == 0) {
  8258. DataMgr.setSkillGuide(1);
  8259. if (DataMgr.getNewUser()) {
  8260. Moyu.sendDataEvent("gameFirstPlay");
  8261. DataMgr.setNewUser();
  8262. }
  8263. }
  8264. this.playSpineAni(() => {
  8265. switch (this.curSkill) {
  8266. case SkillType.highSpace:
  8267. this.runHighSpace();
  8268. break;
  8269. case SkillType.breakArmy:
  8270. this.runBreakArmy();
  8271. break;
  8272. case SkillType.ice:
  8273. this.runIce();
  8274. break;
  8275. case SkillType.fireworks:
  8276. this.runFireworks();
  8277. break;
  8278. case SkillType.GuanYu:
  8279. this.runGuanYu();
  8280. break;
  8281. default:
  8282. break;
  8283. }
  8284. });
  8285. }
  8286. judgeSkill() {
  8287. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  8288. let gameMgr = xGame.common.gameMgr;
  8289. let type;
  8290. for (let index = 0; index < typeArr.length; index++) {
  8291. type = typeArr[index];
  8292. if (gameMgr.selfTurn) {
  8293. if (gameMgr.selfCurSkill == type) {
  8294. this.selfTurn = true;
  8295. this.curSkill = type;
  8296. return;
  8297. }
  8298. }
  8299. else {
  8300. if (gameMgr.aiCurSkill == type) {
  8301. this.selfTurn = false;
  8302. this.curSkill = type;
  8303. return;
  8304. }
  8305. }
  8306. }
  8307. }
  8308. playSpineAni(callback) {
  8309. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  8310. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  8311. parent.destroyChildren();
  8312. let aniIndex = 0;
  8313. let skillSpine;
  8314. switch (this.curSkill) {
  8315. case SkillType.highSpace:
  8316. aniIndex = 1;
  8317. xGame.soundMgr.playSound("skill01");
  8318. skillSpine = this.skillSpine2;
  8319. data.scaleX = 0.5;
  8320. data.scaleY = 0.5;
  8321. skillSpine.play(data, 1, false, parent, () => {
  8322. callback && callback();
  8323. });
  8324. break;
  8325. case SkillType.breakArmy:
  8326. aniIndex = 2;
  8327. xGame.soundMgr.playSound("skill02");
  8328. skillSpine = this.skillSpine2;
  8329. data.scaleX = 0.5;
  8330. data.scaleY = 0.5;
  8331. skillSpine.play(data, 2, false, parent, () => {
  8332. callback && callback();
  8333. });
  8334. break;
  8335. case SkillType.ice:
  8336. aniIndex = 0;
  8337. xGame.soundMgr.playSound("skill03");
  8338. skillSpine = this.skillSpine2;
  8339. data.scaleX = 0.5;
  8340. data.scaleY = 0.5;
  8341. skillSpine.play(data, 0, false, parent, () => {
  8342. callback && callback();
  8343. });
  8344. break;
  8345. case SkillType.fireworks:
  8346. xGame.soundMgr.playSound("skill_04_01");
  8347. xGame.soundMgr.playSound("skill04");
  8348. xGame.uiMgr.Show(UIFireworks, callback);
  8349. break;
  8350. case SkillType.GuanYu:
  8351. xGame.soundMgr.playSound("skill05_1");
  8352. xGame.soundMgr.playSound("skill05");
  8353. xGame.uiMgr.Show(UIGuanYu, callback);
  8354. break;
  8355. default:
  8356. break;
  8357. }
  8358. }
  8359. getAllBallArr() {
  8360. let arr = xGame.common.d2World.ballArr;
  8361. let outArr = [];
  8362. for (let index = 0; index < arr.length; index++) {
  8363. if (arr[index] instanceof D2RootBallSrc)
  8364. continue;
  8365. if (arr[index].ballFunc == "ice")
  8366. continue;
  8367. if (arr[index].destroyed)
  8368. continue;
  8369. outArr.push(arr[index]);
  8370. }
  8371. return outArr;
  8372. }
  8373. getOneArr(deletObj) {
  8374. let allArr = this.getAllBallArr();
  8375. let temp;
  8376. for (let index = 0; index < allArr.length; index++) {
  8377. temp = allArr[index];
  8378. if (temp.id == deletObj.id) {
  8379. allArr.splice(index, 1);
  8380. break;
  8381. }
  8382. }
  8383. return allArr;
  8384. }
  8385. getNearBallBag(ball) {
  8386. let ui = xGame.common.gameUI.ui;
  8387. let circleArr = [];
  8388. for (let index = 1; index <= 6; index++) {
  8389. circleArr.push(ui.border["circle" + index]);
  8390. }
  8391. let outIndex = 0;
  8392. let temp;
  8393. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  8394. ;
  8395. let dis = 0;
  8396. for (let index = 1; index < circleArr.length; index++) {
  8397. temp = circleArr[index];
  8398. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  8399. if (dis < min) {
  8400. min = dis;
  8401. outIndex = index;
  8402. }
  8403. }
  8404. return [circleArr[outIndex], outIndex];
  8405. }
  8406. ballFlyToBag(ballArr, time = 300) {
  8407. let temp;
  8408. let hole;
  8409. this._finishNum = ballArr.length;
  8410. this._curFinish = 0;
  8411. let holeObj = {};
  8412. let holeCfg = {
  8413. "1": 0,
  8414. "2": 0,
  8415. "3": 0,
  8416. "4": 0,
  8417. "5": 0,
  8418. "6": 0
  8419. };
  8420. for (let index = 0; index < ballArr.length; index++) {
  8421. temp = ballArr[index];
  8422. temp.outColli.isSensor = true;
  8423. temp.innerColli.isSensor = true;
  8424. temp.isRunSkillAni = true;
  8425. let holeArr = this.getNearBallBag(temp);
  8426. hole = holeArr[0];
  8427. holeObj[index] = holeArr[1];
  8428. temp.d3BallSrc.scaleXYZ = 0.5;
  8429. this.tweenArr.push(temp.d3BallSrc, temp);
  8430. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  8431. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  8432. }));
  8433. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  8434. let mIndex = holeObj[this._curFinish];
  8435. let isDone = holeCfg[mIndex];
  8436. if (isDone) {
  8437. ballArr[this._curFinish].checkWrongBall(false);
  8438. }
  8439. else {
  8440. holeCfg[mIndex] = 1;
  8441. ballArr[this._curFinish].checkWrongBall();
  8442. }
  8443. this._curFinish++;
  8444. if (this._curFinish >= this._finishNum) {
  8445. if (this.curSkill == SkillType.highSpace) {
  8446. }
  8447. else if (this.curSkill == SkillType.breakArmy) {
  8448. let rootBall = xGame.common.d2World.rootBall;
  8449. rootBall.gameObj.x = this._rootX;
  8450. rootBall.gameObj.y = this._rootY;
  8451. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  8452. xGame.common.d2World.d2Gan.ui.visible = true;
  8453. xGame.common.d2World.d2HelpLine.ui.visible = true;
  8454. xGame.common.d2World.getHelpLine();
  8455. this.callback && this.callback(this.extraScore);
  8456. }
  8457. }
  8458. }));
  8459. }
  8460. }
  8461. runHighSpace() {
  8462. let rootBall = xGame.common.d2World.rootBall;
  8463. rootBall.showSelf();
  8464. let d3Src = rootBall.d3BallSrc;
  8465. let allArr = this.getAllBallArr();
  8466. if (allArr.length <= 0) {
  8467. this.callback && this.callback(0);
  8468. return;
  8469. }
  8470. let selectBall = xGame.common.d2World.targetBall;
  8471. let wrong = selectBall && selectBall.destroyed;
  8472. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  8473. selectBall = xGame.common.getRandArrEle(allArr);
  8474. }
  8475. let targetD3Src = selectBall.d3BallSrc;
  8476. xGame.common.d2World.d2Gan.ui.visible = false;
  8477. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8478. d3Src.scaleXYZ = 0.5;
  8479. this.tweenArr.push(d3Src);
  8480. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  8481. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  8482. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  8483. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  8484. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  8485. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  8486. let outArr = [selectBall];
  8487. let other = this.leveNum - 1;
  8488. if (other > 0) {
  8489. let nearArr = this.getOneArr(selectBall);
  8490. if (nearArr.length > 0) {
  8491. xGame.common.botherArr(nearArr);
  8492. if (other >= nearArr.length)
  8493. other = nearArr.length;
  8494. for (let index = 0; index < other; index++) {
  8495. outArr.push(nearArr[index]);
  8496. }
  8497. }
  8498. }
  8499. xGame.common.extraMoveNum = other + 1;
  8500. this.extraScore = other + 1;
  8501. this._rootX = selectBall.gameObj.x;
  8502. this._rootY = selectBall.gameObj.y;
  8503. rootBall.gameObj.x = this._rootX;
  8504. rootBall.gameObj.y = this._rootY;
  8505. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  8506. Laya.Tween.clearAll(d3Src);
  8507. this.addRandomForce(outArr);
  8508. }));
  8509. }));
  8510. }
  8511. addRandomForce(outArr) {
  8512. if (outArr.length > 0) {
  8513. xGame.common.d2World.openCheckStill = true;
  8514. this.playedLastSkill = true;
  8515. }
  8516. let temp;
  8517. for (let index = 0; index < outArr.length; index++) {
  8518. let angle = xGame.common.randomNum(0, 360);
  8519. let linearPercent = xGame.common.randomNum(65, 100);
  8520. temp = outArr[index];
  8521. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  8522. }
  8523. }
  8524. setLinearSpeed(angle, rigy, linearPercent) {
  8525. let sin = Math.sin(angle * Math.PI / 180);
  8526. let cos = Math.cos(angle * Math.PI / 180);
  8527. let maxSpeed = 4;
  8528. let speed = new Laya.Vector2();
  8529. speed.x = maxSpeed * linearPercent * sin;
  8530. speed.y = -maxSpeed * linearPercent * cos;
  8531. rigy.applyLinearImpulseToCenter(speed);
  8532. }
  8533. runBreakArmy() {
  8534. xGame.common.d2World.d2Gan.ui.visible = false;
  8535. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8536. let gameUI = xGame.common.gameUI.ui;
  8537. gameUI.skillRod.visible = true;
  8538. gameUI.skillRod.rotation = 110;
  8539. let outArr = this.getAllBallArr();
  8540. if (outArr.length <= 0) {
  8541. gameUI.skillRod.visible = false;
  8542. this.callback && this.callback(0);
  8543. return;
  8544. }
  8545. xGame.common.botherArr(outArr);
  8546. if (this.leveNum >= outArr.length)
  8547. this.leveNum = outArr.length;
  8548. let deleteNum = outArr.length - this.leveNum;
  8549. outArr.splice(0, deleteNum);
  8550. this.extraScore = this.leveNum;
  8551. let potX = gameUI.skillRod.x;
  8552. let potY = gameUI.skillRod.y;
  8553. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  8554. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  8555. let disArr = [];
  8556. for (let index = 0; index < outArr.length; index++) {
  8557. let obj = outArr[index];
  8558. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  8559. dis = Math.pow(dis, 0.5);
  8560. disArr.push(dis);
  8561. }
  8562. this.tweenArr.push(gameUI.skillRod);
  8563. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  8564. })).update = Laya.Handler.create(this, (e, t, c) => {
  8565. let angle = gameUI.skillRod.rotation;
  8566. let xx;
  8567. let yy;
  8568. let temp;
  8569. for (let index = 0; index < outArr.length; index++) {
  8570. temp = outArr[index];
  8571. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  8572. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  8573. yy -= 20;
  8574. temp.gameObj.x = xx;
  8575. temp.gameObj.y = yy;
  8576. temp.d3BallSrc.setTransPos(xx, yy);
  8577. }
  8578. if (angle <= 60) {
  8579. Laya.Tween.clearAll(gameUI.skillRod);
  8580. this.ballFlyToBag(outArr, 150);
  8581. gameUI.skillRod.visible = false;
  8582. }
  8583. }, null, false);
  8584. }
  8585. runIce() {
  8586. let ballArr = xGame.common.d2World.ballArr;
  8587. this.leveNum *= 2;
  8588. if (this.leveNum >= ballArr.length - 1)
  8589. this.leveNum = ballArr.length - 1;
  8590. let tempArr = [];
  8591. let outArr = [];
  8592. for (let index = 0; index < ballArr.length; index++) {
  8593. if (ballArr[index] instanceof D2RootBallSrc)
  8594. continue;
  8595. tempArr.push(ballArr[index]);
  8596. }
  8597. if (tempArr.length <= 0) {
  8598. this.callback && this.callback(0);
  8599. return;
  8600. }
  8601. xGame.common.botherArr(tempArr);
  8602. for (let index = 0; index < this.leveNum; index++) {
  8603. outArr.push(tempArr[index]);
  8604. }
  8605. this.extraScore = this.leveNum;
  8606. let temp;
  8607. for (let index = 0; index < outArr.length; index++) {
  8608. temp = outArr[index];
  8609. temp.d3BallSrc.playIceEft();
  8610. }
  8611. Laya.timer.once(2000, this, () => {
  8612. for (let index = 0; index < outArr.length; index++) {
  8613. temp = outArr[index];
  8614. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  8615. temp.setBallFunc("ice", str);
  8616. }
  8617. this.callback && this.callback(0);
  8618. });
  8619. }
  8620. runFireworks() {
  8621. let allArr = this.getAllBallArr();
  8622. if (allArr.length <= 0) {
  8623. this.callback && this.callback(0);
  8624. return;
  8625. }
  8626. xGame.common.d2World.d2Gan.ui.visible = false;
  8627. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8628. let outArr = [];
  8629. let other = this.leveNum;
  8630. if (other > 0) {
  8631. if (allArr.length > 0) {
  8632. xGame.common.botherArr(allArr);
  8633. if (other >= allArr.length)
  8634. other = allArr.length;
  8635. for (let index = 0; index < other; index++) {
  8636. outArr.push(allArr[index]);
  8637. }
  8638. }
  8639. }
  8640. xGame.common.extraMoveNum = other;
  8641. this.extraScore = other;
  8642. this.addRandmomFireworks(outArr);
  8643. }
  8644. addRandmomFireworks(outArr) {
  8645. Laya.timer.once(1100, this, () => {
  8646. if (outArr.length > 0) {
  8647. xGame.common.d2World.openCheckStill = true;
  8648. this.playedLastSkill = true;
  8649. }
  8650. });
  8651. xGame.soundMgr.playSound("skill_04_02");
  8652. let temp;
  8653. let delay = -200;
  8654. for (let index = 0; index < outArr.length; index++) {
  8655. temp = outArr[index];
  8656. delay += 200;
  8657. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  8658. let angle = xGame.common.randomNum(0, 360);
  8659. angle = this.getFireworksAngle(obj);
  8660. let linearPercent = xGame.common.randomNum(45, 80);
  8661. if (!obj.destroyed)
  8662. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  8663. });
  8664. }
  8665. }
  8666. getFireworksAngle(obj) {
  8667. let rootBall = xGame.common.d2World.rootBall;
  8668. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  8669. }
  8670. resetGame() {
  8671. Laya.timer.clearAll(this);
  8672. if (this.tweenArr) {
  8673. for (let index = 0; index < this.tweenArr.length; index++) {
  8674. Laya.Tween.clearAll(this.tweenArr[index]);
  8675. }
  8676. }
  8677. this.tweenArr = null;
  8678. }
  8679. runGuanYu() {
  8680. xGame.common.d2World.d2Gan.ui.visible = false;
  8681. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8682. let rootBall = xGame.common.d2World.rootBall;
  8683. if (rootBall.isInHole) {
  8684. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  8685. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  8686. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  8687. rootBall.showSelf();
  8688. }
  8689. this.rtStarX = rootBall.gameObj.x;
  8690. this.rtStarY = rootBall.gameObj.y;
  8691. this.knifeTimes = 0;
  8692. this.playedLastSkill = true;
  8693. rootBall.forceRun = true;
  8694. rootBall.rigy.type = "static";
  8695. xGame.common.d2World.openCheckStill = true;
  8696. this.guanyuRandomKnife();
  8697. }
  8698. guanyuRandomKnife() {
  8699. let rootBall = xGame.common.d2World.rootBall;
  8700. let dir = this.getRandDir();
  8701. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  8702. console.log("当前angle", angle);
  8703. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  8704. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  8705. let dis = 324;
  8706. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  8707. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  8708. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  8709. this.rtStarX = rootBall.gameObj.x;
  8710. this.rtStarY = rootBall.gameObj.y;
  8711. this.knifeTimes++;
  8712. let skillLevel;
  8713. if (xGame.common.gameMgr.selfTurn) {
  8714. skillLevel = DataMgr.getBigSkillByIndex(4);
  8715. }
  8716. else {
  8717. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  8718. }
  8719. if (!skillLevel)
  8720. skillLevel = 1;
  8721. skillLevel += 2;
  8722. if (this.knifeTimes < skillLevel) {
  8723. Laya.timer.once(400, this, () => {
  8724. this.guanyuRandomKnife();
  8725. });
  8726. }
  8727. else {
  8728. rootBall.forceRun = false;
  8729. rootBall.rigy.type = "dynamic";
  8730. xGame.common.extraMoveNum = skillLevel;
  8731. }
  8732. }));
  8733. }
  8734. getRandDir() {
  8735. let rootBall = xGame.common.d2World.rootBall;
  8736. let allBall = this.getAllBallArr();
  8737. let target = xGame.common.getRandArrEle(allBall);
  8738. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  8739. return this.knifeV2;
  8740. }
  8741. cloneKnife(x, y, rotation) {
  8742. let parent = xGame.common.d3World.knifeRoot;
  8743. let prefab = xGame.common.d3World.knife;
  8744. let clone = prefab.clone();
  8745. parent.addChild(clone);
  8746. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  8747. clone.transform.localPositionX = this.knifeV3.x;
  8748. clone.transform.localPositionY = 0;
  8749. clone.transform.localPositionZ = this.knifeV3.z;
  8750. clone.transform.localRotationEulerX = 0;
  8751. clone.transform.localRotationEulerY = rotation;
  8752. clone.transform.localRotationEulerZ = 0;
  8753. clone.active = true;
  8754. return clone;
  8755. }
  8756. cloneGuanYuEft(x, y, angle) {
  8757. return;
  8758. let parent = xGame.common.gameUI.ui.guanyuNode;
  8759. let eft = new ui_guanyuAni();
  8760. eft.parent = parent;
  8761. eft.x = x;
  8762. eft.y = y;
  8763. eft.rotation = angle;
  8764. }
  8765. }
  8766. class ui_UIWordsList extends fgui.GComponent {
  8767. static createInstance() {
  8768. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  8769. }
  8770. onConstruct() {
  8771. this.c1 = this.getController("c1");
  8772. this.n74 = (this.getChild("n74"));
  8773. this.clickNode = (this.getChild("clickNode"));
  8774. this.myNode = (this.getChild("myNode"));
  8775. this.n68 = (this.getChild("n68"));
  8776. this.n66 = (this.getChild("n66"));
  8777. this.n55 = (this.getChild("n55"));
  8778. this.wordsBtn = (this.getChild("wordsBtn"));
  8779. this.emotionBtn = (this.getChild("emotionBtn"));
  8780. this.mybggg = (this.getChild("mybggg"));
  8781. this.wordsList = (this.getChild("wordsList"));
  8782. this.emotionList = (this.getChild("emotionList"));
  8783. this.myRoot = (this.getChild("myRoot"));
  8784. }
  8785. }
  8786. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  8787. class EmotionDisplay {
  8788. constructor(index, ui) {
  8789. this.ui = ui;
  8790. this.index = index;
  8791. this.ui.onClick(this, this.clickSelf);
  8792. this.updateSelf();
  8793. }
  8794. updateSelf() {
  8795. let data = cfgTable.emotionData[this.index + 1];
  8796. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  8797. }
  8798. clickSelf() {
  8799. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  8800. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  8801. xGame.common.talkMgr.closeTalkView();
  8802. }
  8803. }
  8804. class WordsDisplay {
  8805. constructor(index, ui) {
  8806. this.ui = ui;
  8807. this.index = index;
  8808. this.ui.onClick(this, this.clickSelf);
  8809. this.updateSelf();
  8810. }
  8811. updateSelf() {
  8812. let data = cfgTable.talkwordsData[this.index + 1];
  8813. this.ui.txt.text = data.msg;
  8814. }
  8815. clickSelf() {
  8816. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  8817. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  8818. xGame.common.talkMgr.closeTalkView();
  8819. }
  8820. }
  8821. class UIWordsList extends UIBase {
  8822. constructor() {
  8823. super();
  8824. }
  8825. onConstructor() {
  8826. this.ui = ui_UIWordsList.createInstance();
  8827. this.contentPane = this.ui;
  8828. this.isEject = false;
  8829. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  8830. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  8831. this.addUIClick(this.ui.clickNode, this.hide);
  8832. this.initTalkList();
  8833. this.initEmotionList();
  8834. }
  8835. show() {
  8836. super.show();
  8837. }
  8838. initTalkList() {
  8839. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  8840. let data = cfgTable.talkwordsData;
  8841. let length = Object.keys(data).length;
  8842. this.ui.wordsList.numItems = length;
  8843. }
  8844. initEmotionList() {
  8845. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  8846. let data = cfgTable.emotionData;
  8847. let length = Object.keys(data).length;
  8848. this.ui.emotionList.numItems = length;
  8849. }
  8850. renderTalkItem(index, obj) {
  8851. let temp = new WordsDisplay(index, obj);
  8852. }
  8853. renderEmotionItem(index, obj) {
  8854. let temp = new EmotionDisplay(index, obj);
  8855. }
  8856. openTalkList() {
  8857. this.ui.c1.selectedIndex = 0;
  8858. }
  8859. openEmotionList() {
  8860. this.ui.c1.selectedIndex = 1;
  8861. }
  8862. }
  8863. UIWordsList.uiName = "UIWordsList";
  8864. class TalkMgr {
  8865. constructor() {
  8866. this.aiSpeak = true;
  8867. this.emotionList = [];
  8868. this.talkList = [];
  8869. this.addEvent();
  8870. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8871. this.emotionList = [];
  8872. this.talkList = [];
  8873. for (let k in cfgTable.emotionData) {
  8874. this.emotionList.push(cfgTable.emotionData[k].id);
  8875. }
  8876. for (let k in cfgTable.talkwordsData) {
  8877. this.talkList.push(cfgTable.talkwordsData[k].id);
  8878. }
  8879. }
  8880. addEvent() {
  8881. let ui = xGame.common.gameUI.ui;
  8882. ui.wordsBtn.visible = true;
  8883. ui.wordsBtn.onClick(this, this.openTalkView);
  8884. ui.aiWordsBtn.visible = true;
  8885. ui.aiWordsBtn.onClick(this, this.clickAIState);
  8886. }
  8887. openTalkView() {
  8888. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  8889. xGame.uiMgr.Show(UIWordsList);
  8890. }
  8891. closeTalkView() {
  8892. xGame.uiMgr.Hide(UIWordsList);
  8893. }
  8894. clickAIState() {
  8895. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  8896. this.aiSpeak = !this.aiSpeak;
  8897. this.changeAIState(this.aiSpeak);
  8898. }
  8899. changeAIState(speak) {
  8900. this.aiSpeak = speak;
  8901. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  8902. if (speak) {
  8903. btn.c1.selectedIndex = 0;
  8904. }
  8905. else {
  8906. btn.c1.selectedIndex = 1;
  8907. }
  8908. }
  8909. showSelfTalk(wordsId) {
  8910. let ui = xGame.common.gameUI.ui;
  8911. ui.selfTalk.visible = true;
  8912. ui.selfTalk.myNode.c1.selectedIndex = 1;
  8913. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  8914. ui.selfTalk.t0.play();
  8915. }
  8916. showSelfEmotion(emotionId) {
  8917. let ui = xGame.common.gameUI.ui;
  8918. ui.selfTalk.visible = true;
  8919. ui.selfTalk.myNode.c1.selectedIndex = 0;
  8920. this.selfSpine && this.selfSpine.dispose();
  8921. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  8922. let spineData = cfgTable.emotionData[emotionId].spine;
  8923. this.selfSpine = new SpineMgr(spineData, () => {
  8924. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  8925. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  8926. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  8927. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  8928. });
  8929. ui.selfTalk.t0.play();
  8930. }
  8931. showAITalk(wordsId) {
  8932. if (!this.aiSpeak)
  8933. return;
  8934. if (DataMgr.gameData.gameCount < 2)
  8935. return;
  8936. if (wordsId < 1)
  8937. wordsId = this.getRandTalk();
  8938. let ui = xGame.common.gameUI.ui;
  8939. ui.aiTalk.visible = true;
  8940. ui.aiTalk.myNode.c1.selectedIndex = 1;
  8941. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  8942. ui.aiTalk.t0.play();
  8943. }
  8944. getRandTalk() {
  8945. let rand = xGame.tools.random(0, this.talkList.length);
  8946. return this.emotionList[rand];
  8947. }
  8948. getRandEmotion() {
  8949. let rand = xGame.tools.random(0, this.emotionList.length);
  8950. return this.emotionList[rand];
  8951. }
  8952. showAIEmotion(emotionId) {
  8953. if (!this.aiSpeak)
  8954. return;
  8955. if (DataMgr.gameData.gameCount < 2)
  8956. return;
  8957. if (emotionId < 1)
  8958. emotionId = this.getRandEmotion();
  8959. let ui = xGame.common.gameUI.ui;
  8960. ui.aiTalk.visible = true;
  8961. ui.aiTalk.myNode.c1.selectedIndex = 0;
  8962. this.aiSpine && this.aiSpine.dispose();
  8963. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  8964. let spineData = cfgTable.emotionData[emotionId].spine;
  8965. this.aiSpine = new SpineMgr(spineData, () => {
  8966. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  8967. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  8968. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  8969. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  8970. });
  8971. ui.aiTalk.t0.play();
  8972. }
  8973. resetGame() {
  8974. let ui = xGame.common.gameUI.ui;
  8975. ui.aiTalk.visible = false;
  8976. ui.selfTalk.visible = false;
  8977. this.aiSpine && this.aiSpine.dispose();
  8978. this.selfSpine && this.selfSpine.dispose();
  8979. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  8980. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  8981. this.closeTalkView();
  8982. }
  8983. }
  8984. class WordsMgr {
  8985. constructor() {
  8986. this.comboTimes = 1;
  8987. this.skillTimes = 0;
  8988. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  8989. this.comboSpine = new SpineMgr("yxz_liangan");
  8990. this.skillSpine = new SpineMgr("yiganxqiu");
  8991. this.scoreSpine = new SpineMgr("defen");
  8992. }
  8993. setClassicCombo(isInterrupt) {
  8994. if (isInterrupt) {
  8995. this.comboTimes = 0;
  8996. }
  8997. }
  8998. playClassicWords(type, callback) {
  8999. this.callback = callback;
  9000. let aniIndex = type;
  9001. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9002. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  9003. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  9004. mySpine.destroy(true);
  9005. this.playClassicTimes();
  9006. });
  9007. }
  9008. playClassicTimes() {
  9009. this.comboTimes++;
  9010. if (this.comboTimes <= 1) {
  9011. this.callback && this.callback();
  9012. }
  9013. else {
  9014. let aniIndex = this.comboTimes - 1;
  9015. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9016. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  9017. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  9018. mySpine.destroy(true);
  9019. this.callback && this.callback();
  9020. });
  9021. }
  9022. }
  9023. playBigSkillTimes(times, callback) {
  9024. if (times <= 0) {
  9025. callback && callback();
  9026. return;
  9027. }
  9028. this.callback = callback;
  9029. let pre = "sz_0";
  9030. let aniIndex = 0;
  9031. this.getWordsImg(times, pre, () => {
  9032. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9033. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  9034. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  9035. let r1 = ``;
  9036. let r2 = ``;
  9037. if (times <= 9) {
  9038. r1 = `res/d2Res/${pre}${times}.png`;
  9039. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9040. aniIndex = 0;
  9041. }
  9042. else {
  9043. r1 = `res/d2Res/${pre}${times % 10}.png`;
  9044. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  9045. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  9046. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  9047. aniIndex = 1;
  9048. }
  9049. this.skillSpine.play(data, aniIndex, false, parent, () => {
  9050. mySpine.destroy(true);
  9051. xGame.common.gameMgr.playSkillTips();
  9052. this.playScore(times);
  9053. xGame.common.playRandomMutiBallBigSkillSound();
  9054. }, mySpine);
  9055. });
  9056. }
  9057. playScore(score) {
  9058. let pre = "sz_";
  9059. let aniIndex = 0;
  9060. this.getWordsImg(score, pre, () => {
  9061. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9062. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  9063. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  9064. let r1 = ``;
  9065. let r2 = ``;
  9066. if (score <= 9) {
  9067. r1 = `res/d2Res/${pre}${score}.png`;
  9068. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9069. aniIndex = 0;
  9070. }
  9071. else {
  9072. r1 = `res/d2Res/${pre}${score % 10}.png`;
  9073. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  9074. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9075. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  9076. aniIndex = 1;
  9077. }
  9078. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  9079. mySpine.destroy(true);
  9080. this.callback && this.callback();
  9081. }, mySpine);
  9082. });
  9083. }
  9084. getWordsImg(number, pre = "", callback) {
  9085. let arr = [];
  9086. if (number <= 9) {
  9087. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  9088. }
  9089. else {
  9090. 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 });
  9091. }
  9092. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  9093. callback && callback();
  9094. }));
  9095. }
  9096. }
  9097. class ui_UIRodMethod extends fgui.GComponent {
  9098. static createInstance() {
  9099. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  9100. }
  9101. onConstruct() {
  9102. this.n24 = (this.getChild("n24"));
  9103. this.white = (this.getChild("white"));
  9104. this.dot = (this.getChild("dot"));
  9105. this.sureBtn = (this.getChild("sureBtn"));
  9106. this.n20 = (this.getChild("n20"));
  9107. this.n21 = (this.getChild("n21"));
  9108. this.n22 = (this.getChild("n22"));
  9109. this.n23 = (this.getChild("n23"));
  9110. this.n5 = (this.getChild("n5"));
  9111. this.n14 = (this.getChild("n14"));
  9112. this.t0 = this.getTransition("t0");
  9113. }
  9114. }
  9115. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  9116. class UIRodMethod extends UIBase {
  9117. constructor() {
  9118. super();
  9119. this.isPressd = false;
  9120. }
  9121. onConstructor() {
  9122. this.ui = ui_UIRodMethod.createInstance();
  9123. this.contentPane = this.ui;
  9124. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  9125. this.moveDir = new Laya.Vector2();
  9126. this.moveDest = new Laya.Vector2();
  9127. this.centerPos = new Laya.Vector2();
  9128. xGame.common.uiRodMethod = this;
  9129. }
  9130. show() {
  9131. super.show();
  9132. xGame.common.gameMgr.gamePause = true;
  9133. this.openPressDotEvent();
  9134. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  9135. this.centerPos.x = this.ui.white.x;
  9136. this.centerPos.y = this.ui.white.y;
  9137. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  9138. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  9139. this.setDot();
  9140. }
  9141. setDot() {
  9142. this.ui.dot.x = this.moveDest.x;
  9143. this.ui.dot.y = this.moveDest.y;
  9144. }
  9145. closeSelf() {
  9146. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  9147. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  9148. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  9149. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  9150. xGame.common.gameMgr.gamePause = false;
  9151. this.hide();
  9152. }
  9153. openPressDotEvent() {
  9154. this.closePressDotEvent();
  9155. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9156. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  9157. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9158. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9159. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9160. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9161. }
  9162. closePressDotEvent() {
  9163. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9164. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  9165. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9166. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9167. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9168. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9169. }
  9170. onDown(e) {
  9171. if (e.type == Laya.Event.MOUSE_DOWN)
  9172. this.isPressd = true;
  9173. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  9174. this.isPressd = false;
  9175. if (!this.isPressd)
  9176. return;
  9177. this.moveDest.x = e.stageX;
  9178. this.moveDest.y = e.stageY;
  9179. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  9180. if (dis > 6724) {
  9181. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  9182. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  9183. }
  9184. this.setDot();
  9185. }
  9186. resetRod() {
  9187. this.ui.dot.x = this.ui.white.x;
  9188. this.ui.dot.y = this.ui.white.y;
  9189. this.gameRod.dot.x = this.gameRod.bg.x;
  9190. this.gameRod.dot.y = this.gameRod.bg.y;
  9191. xGame.common.rodOffest.x = 0;
  9192. xGame.common.rodOffest.y = 0;
  9193. }
  9194. }
  9195. UIRodMethod.uiName = "UIRodMethod";
  9196. class UIGame extends UIBase {
  9197. constructor() {
  9198. super();
  9199. this.powerNum = 0;
  9200. this.isD3Inited = false;
  9201. this.isPrePlay = false;
  9202. this.isMoveRod = false;
  9203. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  9204. this.rulerDis = 20;
  9205. this.rulerOffset = 0;
  9206. }
  9207. onConstructor() {
  9208. this.ui = ui_UIGame.createInstance();
  9209. this.contentPane = this.ui;
  9210. this.ui.x += xGame.common.sysOffestNum;
  9211. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  9212. this.isEject = false;
  9213. xGame.common.gameUI = this;
  9214. this.initSelf();
  9215. }
  9216. isTurnSelf() {
  9217. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  9218. return true;
  9219. }
  9220. }
  9221. initSelf() {
  9222. let topUI = this.ui.topNode;
  9223. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  9224. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  9225. this.barInfo = {};
  9226. this.barInfo.curY = 0;
  9227. this.barInfo.height = this.ui.powerNode.height;
  9228. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  9229. this.barInfo.powerStartY = this.ui.powerNode.y;
  9230. xGame.common.aiPlayer = new AIPlayer();
  9231. xGame.common.gameMgr = new GameMgr();
  9232. xGame.common.skillMgr = new SkillMgr();
  9233. xGame.common.wordsMgr = new WordsMgr();
  9234. xGame.common.talkMgr = new TalkMgr();
  9235. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  9236. console.log("加载经典模式表情文件chenggon !");
  9237. });
  9238. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  9239. console.log("挑战模式奖励模式spine加载成功!");
  9240. });
  9241. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  9242. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9243. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  9244. this.addUIClick(this.ui.returnBtn, this.returnHome);
  9245. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  9246. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  9247. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  9248. }
  9249. returnHome() {
  9250. let tips = "Are you sure to exit the game?";
  9251. let woman = "Boss, why don't you play for a while longer?";
  9252. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  9253. }
  9254. addRodMethodClick() {
  9255. if (this.isTurnSelf()) {
  9256. xGame.uiMgr.Show(UIRodMethod);
  9257. }
  9258. }
  9259. clickHelpLineBtn(force = false) {
  9260. if (!this.isTurnSelf())
  9261. return;
  9262. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  9263. if (success) {
  9264. xGame.common.longHelpLine = true;
  9265. xGame.common.d2World.getHelpLine();
  9266. Moyu.sendDataEvent("guideNum");
  9267. }
  9268. else {
  9269. }
  9270. });
  9271. }
  9272. renderSelfDisplayBalls(index, target) {
  9273. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  9274. target.myImg.url = xGame.common.getGameIconUrl(str);
  9275. }
  9276. renderAIDisplayBalls(index, target) {
  9277. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  9278. target.myImg.url = xGame.common.getGameIconUrl(str);
  9279. ;
  9280. }
  9281. updateMode() {
  9282. if (xGame.common.gameMode == GameMode.classic) {
  9283. this.ui.topNode.scoreNode.visible = false;
  9284. }
  9285. else if (xGame.common.gameMode == GameMode.bigMove) {
  9286. this.ui.topNode.scoreNode.visible = true;
  9287. }
  9288. }
  9289. show() {
  9290. super.show();
  9291. console.log("zh:uigame show");
  9292. this.ui.alpha = 0;
  9293. this.updateSelf();
  9294. console.log("zh:uigame bf gamemusic01 start");
  9295. xGame.soundMgr.playMusic("gamemusic01");
  9296. console.log("zh:uigame bf gamemusic01 end");
  9297. xGame.common.gameMgr.gamePause = false;
  9298. xGame.common.gameUI.ui.blackAni.visible = false;
  9299. xGame.common.gameUI.ui.whiteAni.visible = false;
  9300. this.ui.powerEft.visible = false;
  9301. this.ui.colorNode.visible = false;
  9302. this.updateHead();
  9303. }
  9304. updateSelf() {
  9305. if (xGame.common.gameMode == GameMode.classic) {
  9306. this.ui.c1.selectedIndex = 0;
  9307. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  9308. this.ui.topNode.middleNode.visible = true;
  9309. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  9310. }
  9311. else if (xGame.common.gameMode == GameMode.bigMove) {
  9312. this.ui.c1.selectedIndex = 0;
  9313. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  9314. this.ui.topNode.middleNode.visible = false;
  9315. let max = xGame.cfgMgr.getMaxBigMoveLength();
  9316. let rand = xGame.common.randomNum(1, max);
  9317. let guide = DataMgr.getSkillGuide();
  9318. if (guide == 0)
  9319. rand = 1;
  9320. xGame.common.bigMoveLevelIndex = rand;
  9321. }
  9322. else if (xGame.common.gameMode == GameMode.placeBall) {
  9323. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  9324. this.ui.c1.selectedIndex = 1 + data.type;
  9325. this.ui.alpha = 1;
  9326. this.startGame();
  9327. }
  9328. this.updateMode();
  9329. this.initD3world();
  9330. this.initD2world();
  9331. }
  9332. startGame() {
  9333. this.ui.snowNode.visible = Math.random() <= 0.1;
  9334. this.ui.d2Node.visible = false;
  9335. xGame.common.d3World.d3Hand.gameObj.active = false;
  9336. xGame.common.d3World.tableSrc.init();
  9337. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  9338. this.cameraViewChange(() => {
  9339. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  9340. switch (xGame.common.gameMode) {
  9341. case GameMode.classic:
  9342. xGame.common.d3World.d3Hand.gameObj.active = true;
  9343. this.playPutBallD3Ani();
  9344. break;
  9345. case GameMode.bigMove:
  9346. this.enterGame();
  9347. Laya.timer.once(500, this, () => {
  9348. this.ui.topNode.middleNode.visible = true;
  9349. this.ui.topNode.middleNode.t0.play();
  9350. });
  9351. break;
  9352. case GameMode.placeBall:
  9353. this.enterGame();
  9354. break;
  9355. default:
  9356. break;
  9357. }
  9358. });
  9359. PlatMgr.showBanner(false);
  9360. }
  9361. enterGame() {
  9362. this.ui.d2Node.visible = true;
  9363. xGame.common.d3World.d3Hand.gameObj.active = false;
  9364. xGame.common.showOneCamera("mainCamera");
  9365. Moyu.recordGame(30, true);
  9366. if (!this.isPrePlay) {
  9367. this.isPrePlay = true;
  9368. xGame.common.d3World.prePlayEft();
  9369. }
  9370. xGame.common.gameMgr.gameReady();
  9371. this.openAllEvent();
  9372. this.ui.snowNode.visible = false;
  9373. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  9374. this.ui.helpBtn.visible = condition;
  9375. }
  9376. showHelpLineGuide() {
  9377. let longGuide = DataMgr.getGuideHelpLine();
  9378. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  9379. this.ui.helpBtn.visible = true;
  9380. this.ui.guideNode.visible = true;
  9381. }
  9382. }
  9383. setTurnAlpha(alpha) {
  9384. this.ui.keduNode.alpha = alpha;
  9385. this.ui.ganNode.alpha = alpha;
  9386. this.ui.rodMethodNode.alpha = alpha;
  9387. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  9388. }
  9389. cameraViewChange(callback) {
  9390. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  9391. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  9392. xGame.common.showOneCamera("visitAngle");
  9393. cameraSrc.localRotationEulerY = 180;
  9394. cameraSrc.localRotationEulerZ = 0;
  9395. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  9396. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  9397. callback && callback();
  9398. }));
  9399. }));
  9400. }
  9401. playPutBallD3Ani() {
  9402. xGame.common.showOneCamera("mainCamera");
  9403. let handSrc = xGame.common.d3World.d3Hand;
  9404. handSrc.gameObj.active = true;
  9405. handSrc.transform.localPositionZ = 3;
  9406. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9407. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  9408. handSrc.gameObj.active = false;
  9409. this.enterGame();
  9410. }), 400);
  9411. }));
  9412. }
  9413. updateHead() {
  9414. let user = Moyu.getUserInfo();
  9415. this.ui.topNode.selfNameTxt.text = user.nickName;
  9416. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  9417. let aiData = xGame.cfgMgr.getRandomUserInfo();
  9418. if (DataMgr.getSkillGuide() < 1) {
  9419. this.ui.topNode.aiNameTxt.text = 'billiards';
  9420. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  9421. }
  9422. else {
  9423. this.ui.topNode.aiNameTxt.text = aiData.name;
  9424. let randNo = Math.floor(Math.random() * 10) + 1;
  9425. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  9426. }
  9427. }
  9428. initD2world() {
  9429. let node = this.ui.d2Root.displayObject;
  9430. let src = node.getComponent(D2World);
  9431. if (!src) {
  9432. xGame.common.d2World = node.addComponent(D2World);
  9433. }
  9434. xGame.common.d2World.initSelf();
  9435. }
  9436. initD3world() {
  9437. if (this.isD3Inited)
  9438. return;
  9439. this.isD3Inited = true;
  9440. let scene3D = xGame.common.d3Scene;
  9441. this.ui.d3Root.displayObject.addChild(scene3D);
  9442. scene3D.active = true;
  9443. xGame.common.d3World.tableSrc.setBorderPos();
  9444. }
  9445. onRootMove(e) {
  9446. let rootBall = xGame.common.d2World.rootBall;
  9447. this.ui.moveNode.x = e.x;
  9448. this.ui.moveNode.y = e.y;
  9449. rootBall.gameObj.x = e.x;
  9450. rootBall.gameObj.y = e.y;
  9451. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  9452. }
  9453. aiRootMove(move) {
  9454. if (move)
  9455. this.hideBallUI();
  9456. else {
  9457. this.showBallUI();
  9458. xGame.common.d2World.getHelpLine();
  9459. }
  9460. }
  9461. aiForce(type, force = 0) {
  9462. this.pressTarget = PressType.powerNode;
  9463. if (type == 1)
  9464. this.onEventUp({ force: true });
  9465. else if (type == 2)
  9466. this.onEventMove({ stageY: force, force: true });
  9467. }
  9468. onEventPress(e) {
  9469. if (e.stopPropagation)
  9470. e.stopPropagation();
  9471. if (!this.isTurnSelf())
  9472. return;
  9473. let target = e.target;
  9474. switch (target) {
  9475. case this.ui.myPowerNode.displayObject:
  9476. this.pressTarget = PressType.powerNode;
  9477. this.barInfo.curY = e.stageY;
  9478. this.updateBarInfo();
  9479. break;
  9480. case this.ui.moveNode.displayObject:
  9481. this.pressTarget = PressType.moveNode;
  9482. this.hideBallUI();
  9483. this.eventObj.curX = this.ui.moveNode.x;
  9484. this.eventObj.curY = this.ui.moveNode.y;
  9485. this.ui.moveNode.finger.visible = false;
  9486. this.eventObj.lastX = e.stageX;
  9487. this.eventObj.lastY = e.stageY;
  9488. break;
  9489. case this.ui.rulerClickNode.displayObject:
  9490. this.pressTarget = PressType.rulerNode;
  9491. this.eventObj.lastY = e.stageY;
  9492. break;
  9493. case this.ui.d2Root.displayObject:
  9494. this.pressTarget = PressType.d2Root;
  9495. this.eventObj.lastX = e.stageX;
  9496. this.eventObj.lastY = e.stageY;
  9497. this.eventObj.starX = e.stageX;
  9498. this.eventObj.starY = e.stageY;
  9499. this.eventObj.curX = 0;
  9500. this.eventObj.curY = 0;
  9501. xGame.common.d2World.d2Gan.setGanLastInfo();
  9502. this.rulerOffset = 0;
  9503. break;
  9504. default:
  9505. break;
  9506. }
  9507. }
  9508. onEventMove(e) {
  9509. if (e.stopPropagation)
  9510. e.stopPropagation();
  9511. if (e && e.force) {
  9512. }
  9513. else {
  9514. if (!this.isTurnSelf())
  9515. return;
  9516. }
  9517. switch (this.pressTarget) {
  9518. case PressType.powerNode:
  9519. this.barInfo.curY = e.stageY;
  9520. this.updateBarInfo();
  9521. this.isMoveRod = true;
  9522. break;
  9523. case PressType.moveNode:
  9524. let rootBall = xGame.common.d2World.rootBall;
  9525. let radius = rootBall.gameObj.width / 2;
  9526. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  9527. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  9528. let border = xGame.common.d2World.borderRect;
  9529. if (curX <= border.x + radius)
  9530. curX = border.x + radius;
  9531. else if (curX >= border.x + border.width - radius)
  9532. curX = border.x + border.width - radius;
  9533. if (curY <= border.y + radius)
  9534. curY = border.y + radius;
  9535. else if (curY >= border.y + border.height - radius)
  9536. curY = border.y + border.height - radius;
  9537. if (xGame.common.gameMgr.isOpenBall) {
  9538. if (curX >= border.x + border.openBallW - radius)
  9539. curX = border.x + border.openBallW - radius;
  9540. }
  9541. this.ui.moveNode.x = curX;
  9542. this.ui.moveNode.y = curY;
  9543. rootBall.gameObj.x = curX;
  9544. rootBall.gameObj.y = curY;
  9545. rootBall.d3BallSrc.setTransPos(curX, curY);
  9546. this.isMoveRod = true;
  9547. break;
  9548. case PressType.rulerNode:
  9549. let yy = e.stageY - this.eventObj.lastY;
  9550. this.eventObj.lastY = e.stageY;
  9551. let ruler1 = this.ui.rulerNode.img1;
  9552. let ruler2 = this.ui.rulerNode.img2;
  9553. ruler1.y += yy;
  9554. ruler2.y += yy;
  9555. this.rulerOffset += yy;
  9556. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  9557. this.rulerOffset = 0;
  9558. xGame.soundMgr.playSound("inch", 1, 10);
  9559. }
  9560. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  9561. let h = ruler1.height;
  9562. this.checkGuide();
  9563. this.isMoveRod = true;
  9564. if (ruler1.y >= h) {
  9565. ruler1.y = -h;
  9566. ruler2.y = 0;
  9567. return;
  9568. }
  9569. else if (ruler1.y <= -h) {
  9570. ruler1.y = h;
  9571. ruler2.y = 0;
  9572. return;
  9573. }
  9574. if (ruler2.y >= h) {
  9575. ruler2.y = -h;
  9576. ruler1.y = 0;
  9577. return;
  9578. }
  9579. else if (ruler2.y <= -h) {
  9580. ruler2.y = h;
  9581. ruler1.y = 0;
  9582. return;
  9583. }
  9584. break;
  9585. case PressType.d2Root:
  9586. this.eventObj.curX = e.stageX;
  9587. this.eventObj.curY = e.stageY;
  9588. let offset = this.checkRodMoveDir();
  9589. xGame.common.d2World.d2Gan.rotateSelf(offset);
  9590. this.eventObj.lastX = e.stageX;
  9591. this.eventObj.lastY = e.stageY;
  9592. break;
  9593. default:
  9594. break;
  9595. }
  9596. }
  9597. onEventUp(e) {
  9598. if (e.stopPropagation)
  9599. e.stopPropagation();
  9600. if (e && e.force) {
  9601. }
  9602. else {
  9603. if (!this.isTurnSelf())
  9604. return;
  9605. }
  9606. switch (this.pressTarget) {
  9607. case PressType.powerNode:
  9608. this.ui.powerNode.value = 0;
  9609. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  9610. this.ui.powerTxt.text = "";
  9611. if (this.powerNum > 0) {
  9612. xGame.eventMgr.event(BALL_SHOOT);
  9613. xGame.common.d2World.shoot(this.powerNum);
  9614. xGame.common.d2World.d2Gan.shoot();
  9615. xGame.common.d2World.d2HelpLine.shoot();
  9616. this.finishGuide();
  9617. this.ui.powerEft.visible = false;
  9618. this.ui.colorNode.visible = false;
  9619. let ganStr = "";
  9620. if (this.powerNum <= 30) {
  9621. ganStr = "gan_30";
  9622. }
  9623. else if (this.powerNum <= 60) {
  9624. ganStr = "gan_50";
  9625. }
  9626. else {
  9627. ganStr = "gan_80";
  9628. }
  9629. xGame.soundMgr.playSound(ganStr);
  9630. }
  9631. break;
  9632. case PressType.moveNode:
  9633. let rootBall = xGame.common.d2World.rootBall;
  9634. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  9635. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  9636. let isIntersect = this.judgeBallIntersect();
  9637. if (isIntersect) {
  9638. this.ui.moveNode.x = lastX;
  9639. this.ui.moveNode.y = lastY;
  9640. rootBall.gameObj.x = lastX;
  9641. rootBall.gameObj.y = lastY;
  9642. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  9643. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  9644. }
  9645. else {
  9646. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  9647. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  9648. }
  9649. this.showBallUI();
  9650. this.ui.moveNode.finger.visible = true;
  9651. xGame.common.d2World.getHelpLine();
  9652. break;
  9653. case PressType.rulerNode:
  9654. break;
  9655. case PressType.d2Root:
  9656. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  9657. if (dis <= 25) {
  9658. this.moveToClickDot(e);
  9659. }
  9660. break;
  9661. default:
  9662. break;
  9663. }
  9664. this.pressTarget = -1;
  9665. }
  9666. checkGuide() {
  9667. let guide = DataMgr.getSkillGuide();
  9668. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  9669. xGame.common.guideStep++;
  9670. xGame.common.gameUI.ui.guide2.visible = false;
  9671. xGame.common.gameUI.ui.guide3.visible = true;
  9672. }
  9673. }
  9674. finishGuide() {
  9675. let guide = DataMgr.getSkillGuide();
  9676. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  9677. xGame.common.guideStep = 10;
  9678. this.closeAllGuide();
  9679. }
  9680. }
  9681. closeAllGuide() {
  9682. xGame.common.gameUI.ui.guide1.visible = false;
  9683. xGame.common.gameUI.ui.guide2.visible = false;
  9684. xGame.common.gameUI.ui.guide3.visible = false;
  9685. }
  9686. updateBarInfo() {
  9687. let star = this.ui.powerNode.y;
  9688. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  9689. if (rate >= 1)
  9690. rate = 1;
  9691. if (rate <= 0)
  9692. rate = 0;
  9693. this.powerNum = Math.ceil(rate * 100);
  9694. this.ui.powerNode.value = this.powerNum;
  9695. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  9696. this.ui.colorNode.value = this.powerNum;
  9697. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  9698. this.ui.powerEft.visible = this.powerNum != 0;
  9699. this.ui.colorNode.visible = this.powerNum != 0;
  9700. this.ui.powerTxt.text = this.powerNum + "";
  9701. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  9702. }
  9703. forceCancel() {
  9704. this.ui.powerNode.value = 0;
  9705. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  9706. this.ui.powerTxt.text = "";
  9707. }
  9708. checkRodMoveDir() {
  9709. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  9710. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  9711. if (tempX >= 0 && tempY <= 0) {
  9712. return this.checkDir();
  9713. }
  9714. else if (tempX < 0 && tempY < 0) {
  9715. return this.checkDir(1, -1);
  9716. }
  9717. else if (tempX < 0 && tempY > 0) {
  9718. return this.checkDir(-1, -1);
  9719. }
  9720. else {
  9721. return this.checkDir(-1, 1);
  9722. }
  9723. }
  9724. checkDir(flagX = 1, flagY = 1) {
  9725. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  9726. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  9727. if (offsetY == 0) {
  9728. return offsetX * flagX;
  9729. }
  9730. if (offsetX == 0) {
  9731. return offsetY * flagY;
  9732. }
  9733. let angle = offsetY / offsetX;
  9734. if (Math.abs(angle) >= 1) {
  9735. return offsetY * flagY;
  9736. }
  9737. else {
  9738. return offsetX * flagX;
  9739. }
  9740. }
  9741. judgeBallIntersect() {
  9742. let rootBall = xGame.common.d2World.rootBall;
  9743. let ballArr = xGame.common.d2World.ballArr;
  9744. let radius = rootBall.gameObj.width / 2;
  9745. let temp;
  9746. let isIntersect = false;
  9747. for (let index = 0; index < ballArr.length; index++) {
  9748. temp = ballArr[index];
  9749. if (temp.number == rootBall.number)
  9750. continue;
  9751. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  9752. if (isIntersect) {
  9753. break;
  9754. }
  9755. }
  9756. return isIntersect;
  9757. }
  9758. hideBallUI() {
  9759. let d2Gan = xGame.common.d2World.d2Gan;
  9760. if (!d2Gan.ui.isDisposed)
  9761. d2Gan.ui.visible = false;
  9762. let d2Help = xGame.common.d2World.d2HelpLine;
  9763. if (!d2Help.ui.isDisposed)
  9764. d2Help.ui.visible = false;
  9765. let rootBall = xGame.common.d2World.rootBall;
  9766. if (!rootBall.destroyed) {
  9767. rootBall.gameObj.active = false;
  9768. }
  9769. }
  9770. showBallUI() {
  9771. let d2Gan = xGame.common.d2World.d2Gan;
  9772. if (!d2Gan.ui.isDisposed)
  9773. d2Gan.ui.visible = true;
  9774. let d2Help = xGame.common.d2World.d2HelpLine;
  9775. if (!d2Help.ui.isDisposed)
  9776. d2Help.ui.visible = true;
  9777. let rootBall = xGame.common.d2World.rootBall;
  9778. if (!rootBall.destroyed) {
  9779. rootBall.gameObj.active = true;
  9780. }
  9781. }
  9782. moveToClickDot(e) {
  9783. if (!this.isMoveRod && !xGame.common.clickedBall) {
  9784. let root = xGame.common.d2World.rootBall.gameObj;
  9785. let xx = e.stageX - xGame.common.sysOffestNum;
  9786. let yy = e.stageY;
  9787. let x = xx - root.x;
  9788. let y = yy - root.y;
  9789. let angle = xGame.common.getfguiRotation(x, y);
  9790. xGame.common.d2World.d2Gan.ui.rotation = angle;
  9791. xGame.common.d2World.getHelpLine();
  9792. }
  9793. this.isMoveRod = false;
  9794. xGame.common.clickedBall = false;
  9795. }
  9796. openAllEvent() {
  9797. this.closeAllEvent();
  9798. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9799. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9800. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9801. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9802. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  9803. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  9804. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  9805. }
  9806. closeAllEvent() {
  9807. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9808. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9809. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9810. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9811. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  9812. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  9813. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  9814. }
  9815. resetGame() {
  9816. this.closeAllEvent();
  9817. this.hideBallUI();
  9818. xGame.common.gameMgr.gamePause = true;
  9819. }
  9820. }
  9821. UIGame.uiName = "UIGame";
  9822. class UIAddProp extends UIBase {
  9823. constructor() {
  9824. super();
  9825. this.curType = "";
  9826. }
  9827. onConstructor() {
  9828. this.ui = ui_UIAddProp.createInstance();
  9829. this.contentPane = this.ui;
  9830. this.isEject = false;
  9831. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  9832. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  9833. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  9834. this.updateUI();
  9835. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  9836. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  9837. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  9838. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  9839. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  9840. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  9841. }
  9842. show(type) {
  9843. super.show();
  9844. this.curType = type == 0 ? "coin" : "diamond";
  9845. this.switchBtn("");
  9846. this.ui.t0.play();
  9847. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  9848. PlatMgr.showInsert(true);
  9849. }
  9850. closeSelf() {
  9851. this.hide();
  9852. }
  9853. updateUI() {
  9854. let data = cfgTable.moneyData;
  9855. let temp;
  9856. let obj;
  9857. for (const key in data) {
  9858. temp = data[key];
  9859. obj = this.ui.myNode["node" + key];
  9860. if (parseInt(key) <= 2) {
  9861. obj.diamondTxt.text = "+" + temp.num;
  9862. }
  9863. else {
  9864. obj.coinTxt.text = temp.num;
  9865. obj.diamondTxt.text = temp.get.split('_')[1];
  9866. }
  9867. }
  9868. this.updateDiamondShare();
  9869. }
  9870. updateDiamondShare() {
  9871. let data = DataMgr.getShareDiamondTimes();
  9872. if (data >= xGame.common.maxShareDiamondTimes) {
  9873. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  9874. this.ui.myNode.node1.touchable = false;
  9875. }
  9876. else {
  9877. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  9878. this.ui.myNode.node1.touchable = true;
  9879. }
  9880. }
  9881. switchBtn(type) {
  9882. if (type == "")
  9883. type = this.curType;
  9884. else {
  9885. if (this.curType == type) {
  9886. return;
  9887. }
  9888. else {
  9889. this.curType = type;
  9890. }
  9891. }
  9892. if (type == "coin") {
  9893. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  9894. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  9895. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  9896. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  9897. this.ui.myNode.c1.selectedIndex = 0;
  9898. }
  9899. else {
  9900. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  9901. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  9902. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  9903. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  9904. this.ui.myNode.c1.selectedIndex = 1;
  9905. }
  9906. }
  9907. convertCoin(index) {
  9908. let data = cfgTable.moneyData[index];
  9909. let coinNum = data.num;
  9910. let str = data.get.split('_')[1];
  9911. let needDiamond = parseInt(str);
  9912. if (DataMgr.diamondEnough(needDiamond)) {
  9913. DataMgr.setDiamond(-needDiamond);
  9914. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  9915. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  9916. }
  9917. else {
  9918. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  9919. this.switchBtn("diamond");
  9920. }
  9921. }
  9922. videoGetDiamond() {
  9923. let num = cfgTable.moneyData[2].num;
  9924. Moyu.showVideoAd(() => {
  9925. xGame.common.playObjFlyAnim(num, Prop.diamond);
  9926. this.closeSelf();
  9927. }, EAdType.addDiamond);
  9928. }
  9929. videoGetCoin() {
  9930. Moyu.showVideoAd(() => {
  9931. xGame.common.playObjFlyAnim(2000, Prop.coin);
  9932. this.closeSelf();
  9933. }, EAdType.addCoin);
  9934. }
  9935. shareGetDiamond() {
  9936. let times = DataMgr.getShareDiamondTimes();
  9937. if (times >= xGame.common.maxShareDiamondTimes) {
  9938. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  9939. }
  9940. else {
  9941. if (Moyu.isTT) {
  9942. let num = cfgTable.moneyData[1].num;
  9943. Moyu.shareVideo = '';
  9944. Moyu.shareGame((success) => {
  9945. if (success) {
  9946. xGame.uiMgr.Show(UIMsg, "分享成功!");
  9947. xGame.common.playObjFlyAnim(num, Prop.diamond);
  9948. DataMgr.setShareDiamondTimes(1);
  9949. this.updateDiamondShare();
  9950. }
  9951. else {
  9952. xGame.uiMgr.Show(UIMsg, "分享失败!");
  9953. }
  9954. });
  9955. }
  9956. else {
  9957. Moyu.showVideoAd(() => {
  9958. let diamond = xGame.common.randomNum(50, 100);
  9959. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  9960. DataMgr.setShareDiamondTimes(1);
  9961. this.updateDiamondShare();
  9962. }, EAdType.randomDiamond);
  9963. }
  9964. }
  9965. }
  9966. openPutBallView() {
  9967. let end = xGame.uiMgr.getUI(UIGameEnd);
  9968. let skill = xGame.uiMgr.getUI(UISkill);
  9969. let level = xGame.uiMgr.getUI(UILevelDisplay);
  9970. let uigame = xGame.uiMgr.getUI(UIGame);
  9971. if (end && !end.isHide) {
  9972. xGame.uiMgr.Hide(UIGameEnd);
  9973. xGame.uiMgr.Show(UIMain);
  9974. }
  9975. if (skill && !skill.isHide)
  9976. xGame.uiMgr.Hide(UISkill);
  9977. if (uigame && !uigame.isHide)
  9978. xGame.uiMgr.Hide(UIGame);
  9979. if (level && !level.isHide) {
  9980. }
  9981. else {
  9982. xGame.uiMgr.Show(UILevelDisplay);
  9983. }
  9984. this.closeSelf();
  9985. }
  9986. }
  9987. UIAddProp.uiName = "UIAddProp";
  9988. class MoneyNode {
  9989. constructor(ui) {
  9990. this.leftTime = 0;
  9991. this.ui = ui;
  9992. this.ui.addCoinBtn.onClick(this, this.addCoin);
  9993. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  9994. this.ui.addPowerBtn.onClick(this, this.addPower);
  9995. this.ui.c1.selectedIndex = 1;
  9996. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  9997. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  9998. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  9999. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  10000. this.coinChange();
  10001. this.diamondChange();
  10002. this.powerChange();
  10003. }
  10004. addPower() {
  10005. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10006. xGame.uiMgr.Show(UIPower);
  10007. }
  10008. powerChange() {
  10009. let powerNum = DataMgr.getPower();
  10010. this.ui.powerTxt.text = powerNum + "";
  10011. }
  10012. checkPowerTime() {
  10013. let cur = new Date().getTime();
  10014. let last = DataMgr.getPowerTime();
  10015. if (last == 0) {
  10016. last = cur;
  10017. DataMgr.setPowerTime(cur);
  10018. }
  10019. let power = DataMgr.getPower();
  10020. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  10021. Laya.timer.clearAll(this);
  10022. if (power >= xGame.common.natureMaxPower) {
  10023. this.ui.powerTimeTxt.text = "";
  10024. DataMgr.setPowerTime(cur);
  10025. return;
  10026. }
  10027. if (power + offset >= xGame.common.natureMaxPower) {
  10028. DataMgr.setPower(xGame.common.natureMaxPower, false);
  10029. this.ui.powerTimeTxt.text = "";
  10030. DataMgr.setPowerTime(cur);
  10031. }
  10032. else {
  10033. if (offset > 0) {
  10034. DataMgr.setPower(offset);
  10035. DataMgr.setPowerTime(cur);
  10036. }
  10037. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  10038. this.leftTime = xGame.common.powerRecoverNum - time;
  10039. if (this.leftTime <= 0)
  10040. this.leftTime = 0;
  10041. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10042. Laya.timer.loop(1000, this, this.updatePowerTime);
  10043. }
  10044. }
  10045. updatePowerTime() {
  10046. this.leftTime -= 1;
  10047. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10048. if (this.leftTime <= 0) {
  10049. this.checkPowerTime();
  10050. }
  10051. }
  10052. coinChange() {
  10053. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  10054. }
  10055. diamondChange() {
  10056. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  10057. }
  10058. addCoin() {
  10059. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10060. Moyu.sendDataEvent("AddCoinBtn");
  10061. xGame.uiMgr.Show(UIAddProp, 0);
  10062. }
  10063. addDiamond() {
  10064. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10065. Moyu.sendDataEvent("AddDiamondBtn");
  10066. xGame.uiMgr.Show(UIAddProp, 1);
  10067. }
  10068. }
  10069. class UIDraw extends UIBase {
  10070. constructor() {
  10071. super();
  10072. this.curKey = 0;
  10073. }
  10074. onConstructor() {
  10075. this.ui = ui_UIDraw.createInstance();
  10076. this.contentPane = this.ui;
  10077. this.isEject = false;
  10078. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  10079. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  10080. this.addUIClick(this.ui.drawBtn, this.startDraw);
  10081. this.initDraw();
  10082. this.initUI();
  10083. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  10084. if (Moyu.isKs)
  10085. this.ui.closeNode.closeBtn.x += 100;
  10086. }
  10087. show() {
  10088. super.show();
  10089. this.ui.t0.play();
  10090. this.playSecretaryIdle();
  10091. this.updateDraw();
  10092. this.checkFree();
  10093. if (PlatMgr.bannerDelay > 0) {
  10094. this.ui.closeNode.closeBtn.visible = false;
  10095. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  10096. this.ui.closeNode.closeBtn.visible = true;
  10097. });
  10098. }
  10099. PlatMgr.showRateBanner();
  10100. }
  10101. hide() {
  10102. Laya.timer.clearAll(this);
  10103. super.hide();
  10104. }
  10105. checkFree() {
  10106. let isFree = DataMgr.getDailyfreeDrawTimes();
  10107. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  10108. }
  10109. initDraw() {
  10110. this.drawObj = [];
  10111. let data = cfgTable.drawData;
  10112. let temp;
  10113. let weight = 0;
  10114. for (const key in data) {
  10115. temp = data[key];
  10116. weight += temp.weight;
  10117. this.drawObj.push(weight);
  10118. }
  10119. this.allWeight = weight;
  10120. }
  10121. initUI() {
  10122. let data = cfgTable.drawData;
  10123. let temp;
  10124. let img;
  10125. let txt;
  10126. for (const key in data) {
  10127. temp = data[key];
  10128. img = this.ui.myNode.rotNode["img" + key];
  10129. txt = this.ui.myNode.rotNode["txt" + key];
  10130. img.url = xGame.common.getGameIconUrl(temp.icon);
  10131. txt.visible = true;
  10132. if (temp.award > 2) {
  10133. img.rotation = 0;
  10134. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  10135. }
  10136. else {
  10137. img.rotation = temp.rotation;
  10138. txt.text = temp.num;
  10139. }
  10140. }
  10141. }
  10142. getCurkey() {
  10143. let rand = Math.random() * this.allWeight;
  10144. let temp;
  10145. for (let index = 0; index < this.drawObj.length - 1; index++) {
  10146. temp = this.drawObj[index];
  10147. if (index == 0) {
  10148. if (rand < temp) {
  10149. return index + 1;
  10150. }
  10151. }
  10152. else {
  10153. if (rand >= temp && rand < this.drawObj[index + 1]) {
  10154. return index + 1;
  10155. }
  10156. }
  10157. }
  10158. return 2;
  10159. }
  10160. startDraw() {
  10161. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  10162. if (freeTimes > 0) {
  10163. this.beginDraw();
  10164. DataMgr.setDailyfreeDrawTimes(0);
  10165. this.checkFree();
  10166. }
  10167. else {
  10168. Moyu.sendDataEvent("turntable");
  10169. Moyu.showVideoAd(() => {
  10170. this.beginDraw();
  10171. }, EAdType.draw);
  10172. }
  10173. }
  10174. beginDraw() {
  10175. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  10176. this.ui.drawBtn.touchable = false;
  10177. this.curKey = this.getCurkey();
  10178. console.log("当前key", this.curKey);
  10179. let cell = 60;
  10180. let lap = 3;
  10181. let angle = cell * (this.curKey - 1) + lap * 360;
  10182. let target = this.ui.myNode.rotNode;
  10183. target.rotation = 0;
  10184. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  10185. console.log("旋转完成");
  10186. this.ui.drawBtn.touchable = true;
  10187. this.getAward();
  10188. }));
  10189. }
  10190. getAward() {
  10191. let data = cfgTable.drawData[this.curKey];
  10192. let temp = new AwardType();
  10193. temp.type = data.award;
  10194. temp.num = data.num;
  10195. xGame.common.getAward([temp], () => {
  10196. DataMgr.setDrawTimes(1);
  10197. this.updateDraw();
  10198. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  10199. });
  10200. }
  10201. updateDraw() {
  10202. let drawTimes = DataMgr.getDrawTimes();
  10203. let awardTimes = DataMgr.getDrawAwardTimes();
  10204. if (Math.floor(drawTimes / 3) > awardTimes) {
  10205. this.ui.extraNode.boxBtn.t0.play(null, -1);
  10206. this.ui.extraNode.boxBtn.touchable = true;
  10207. this.ui.extraNode.tipsTxt.text = "3/3";
  10208. this.ui.extraNode.barNode.width = 265;
  10209. this.getExtraAward();
  10210. }
  10211. else {
  10212. this.ui.extraNode.boxBtn.t0.stop();
  10213. this.ui.extraNode.boxBtn.touchable = false;
  10214. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  10215. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  10216. }
  10217. let data = cfgTable.drawData[1];
  10218. if (awardTimes == 0) {
  10219. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  10220. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  10221. this.ui.myNode.rotNode.img1.rotation = 0;
  10222. }
  10223. else {
  10224. let award = data.nextid;
  10225. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  10226. this.ui.myNode.rotNode.txt1.text = award[1];
  10227. this.ui.myNode.rotNode.img1.rotation = 0;
  10228. }
  10229. }
  10230. getExtraAward() {
  10231. let drawTimes = DataMgr.getDrawTimes();
  10232. let awardTimes = DataMgr.getDrawAwardTimes();
  10233. let data = cfgTable.drawData[1];
  10234. let award = new AwardType();
  10235. if (awardTimes == 0) {
  10236. award.num = data.num;
  10237. award.type = data.award;
  10238. xGame.common.getAward([award], () => {
  10239. let all = Math.floor(drawTimes / 3);
  10240. DataMgr.setDrawAwardTimes(all);
  10241. this.updateDraw();
  10242. });
  10243. }
  10244. else {
  10245. award.num = parseInt(data.nextid[1]);
  10246. award.type = parseInt(data.nextid[0]);
  10247. xGame.common.getAward([award], () => {
  10248. let all = Math.floor(drawTimes / 3);
  10249. DataMgr.setDrawAwardTimes(all);
  10250. this.updateDraw();
  10251. });
  10252. }
  10253. }
  10254. closeSelf() {
  10255. this.hide();
  10256. }
  10257. playSecretaryIdle() {
  10258. let parent = this.ui.secretary.displayObject;
  10259. parent.destroyChildren();
  10260. let xx = this.ui.secretary.width / 2;
  10261. let yy = this.ui.secretary.height;
  10262. let scale = xGame.common.getSecretaryScale();
  10263. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  10264. xGame.common.secretary.play(data, 0, true, parent);
  10265. }
  10266. }
  10267. UIDraw.uiName = "UIDraw";
  10268. class ui_UIFlyEft extends fgui.GComponent {
  10269. static createInstance() {
  10270. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  10271. }
  10272. onConstruct() {
  10273. this.n0 = (this.getChild("n0"));
  10274. this.n1 = (this.getChild("n1"));
  10275. this.n2 = (this.getChild("n2"));
  10276. this.n3 = (this.getChild("n3"));
  10277. this.n4 = (this.getChild("n4"));
  10278. this.n5 = (this.getChild("n5"));
  10279. this.n6 = (this.getChild("n6"));
  10280. this.n7 = (this.getChild("n7"));
  10281. this.iconNode = (this.getChild("iconNode"));
  10282. this.txt = (this.getChild("txt"));
  10283. this.txtNode = (this.getChild("txtNode"));
  10284. }
  10285. }
  10286. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  10287. class UIFlyEft extends UIBase {
  10288. constructor() {
  10289. super();
  10290. this.max = 8;
  10291. this.delay = 0;
  10292. }
  10293. onConstructor() {
  10294. this.ui = ui_UIFlyEft.createInstance();
  10295. this.contentPane = this.ui;
  10296. this.isEject = false;
  10297. this.isMuti = true;
  10298. this.ui.x += xGame.common.sysOffestNum;
  10299. }
  10300. getArrPos() {
  10301. if (this.iconPos && this.iconPos.length > 0)
  10302. return;
  10303. this.iconPos = [];
  10304. let temp;
  10305. for (let index = 0; index < this.max; index++) {
  10306. temp = this.ui["n" + index];
  10307. this.iconPos.push([temp.x, temp.y]);
  10308. }
  10309. }
  10310. show(stPos, edPos, num, type, callback) {
  10311. super.show();
  10312. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  10313. this.getArrPos();
  10314. this.updateUI(type);
  10315. this.updatePos();
  10316. this.runFly(edPos, callback);
  10317. this.runWorlds(stPos, num);
  10318. }
  10319. updateUI(type) {
  10320. let temp;
  10321. let str;
  10322. for (let index = 0; index < this.max; index++) {
  10323. temp = this.ui["n" + index];
  10324. str = this.getIconStr(type);
  10325. temp.url = xGame.common.getGameIconUrl(str);
  10326. }
  10327. }
  10328. getIconStr(type) {
  10329. switch (type) {
  10330. case Prop.diamond:
  10331. return "ty_zs";
  10332. case Prop.coin:
  10333. return "ty_jb";
  10334. default:
  10335. break;
  10336. }
  10337. }
  10338. updatePos() {
  10339. let temp;
  10340. for (let index = 0; index < this.max; index++) {
  10341. temp = this.ui["n" + index];
  10342. temp.x = this.iconPos[index][0];
  10343. temp.y = this.iconPos[index][1];
  10344. }
  10345. }
  10346. runFly(endPos, callback) {
  10347. let all = 0;
  10348. let temp;
  10349. for (let index = 0; index < this.max; index++) {
  10350. temp = this.ui["n" + index];
  10351. temp.visible = true;
  10352. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  10353. temp.visible = false;
  10354. all++;
  10355. if (all >= this.max) {
  10356. callback && callback();
  10357. }
  10358. }), 20 * index);
  10359. }
  10360. }
  10361. runWorlds(stPos, num) {
  10362. let str = "+" + num;
  10363. this.ui.txt.text = str;
  10364. let starX = stPos.x;
  10365. let starY = stPos.y + 50;
  10366. this.ui.txt.x = starX;
  10367. this.ui.txt.y = starY;
  10368. this.ui.txt.visible = true;
  10369. this.ui.txt.alpha = 1;
  10370. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  10371. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  10372. this.ui.txt.visible = false;
  10373. this.hide();
  10374. }));
  10375. }));
  10376. }
  10377. }
  10378. UIFlyEft.uiName = "UIFlyEft";
  10379. class ui_UIGetAward extends fgui.GComponent {
  10380. static createInstance() {
  10381. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  10382. }
  10383. onConstruct() {
  10384. this.n4 = (this.getChild("n4"));
  10385. this.n0 = (this.getChild("n0"));
  10386. this.myList = (this.getChild("myList"));
  10387. this.n1 = (this.getChild("n1"));
  10388. this.eftNode = (this.getChild("eftNode"));
  10389. this.btnNode = (this.getChild("btnNode"));
  10390. this.t0 = this.getTransition("t0");
  10391. }
  10392. }
  10393. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  10394. class UIGetAward extends UIBase {
  10395. constructor() {
  10396. super();
  10397. this.showTriple = true;
  10398. }
  10399. onConstructor() {
  10400. this.ui = ui_UIGetAward.createInstance();
  10401. this.contentPane = this.ui;
  10402. this.isEject = false;
  10403. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  10404. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  10405. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  10406. }
  10407. show(arr, showTriple, callback) {
  10408. super.show();
  10409. this.ui.t0.play();
  10410. this.ui.eftNode.visible = true;
  10411. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  10412. this.ui.eftNode.visible = false;
  10413. }), 1, 0, 0, 0.9);
  10414. this.awardArr = arr;
  10415. this.showTriple = showTriple;
  10416. this.callback = callback;
  10417. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  10418. this.ui.myList.numItems = arr.length;
  10419. xGame.soundMgr.playSound("getaward");
  10420. }
  10421. updateSelf(index, obj) {
  10422. let temp = this.awardArr[index];
  10423. let icon = this.getIcon(temp.type);
  10424. let str = icon;
  10425. if (temp.type > 2) {
  10426. str = "s" + icon;
  10427. }
  10428. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  10429. obj.myIcon.rotation = 0;
  10430. obj.numTxt.text = temp.num + "";
  10431. obj.numTxt.visible = temp.type > 2 ? false : true;
  10432. obj.nameTxt.text = this.getNameStr(temp.type);
  10433. }
  10434. renderItem(index, obj) {
  10435. this.updateSelf(index, obj);
  10436. }
  10437. tripleGetAward() {
  10438. Moyu.showVideoAd(() => {
  10439. this.getAward(3);
  10440. }, EAdType.triple);
  10441. }
  10442. normalGetAward() {
  10443. if (PlatMgr.isMisVideo())
  10444. this.tripleGetAward();
  10445. else
  10446. this.getAward();
  10447. }
  10448. getAward(times = 1) {
  10449. this.hide();
  10450. for (let index = 0; index < this.awardArr.length; index++) {
  10451. this.awardArr[index].num *= times;
  10452. }
  10453. this.callback && this.callback(times != 1);
  10454. }
  10455. getIcon(type) {
  10456. switch (type) {
  10457. case Prop.diamond:
  10458. return "ty_zs";
  10459. case Prop.coin:
  10460. return "ty_jb";
  10461. case Prop.gan1:
  10462. return "qg1";
  10463. case Prop.gan2:
  10464. return "qg2";
  10465. case Prop.gan3:
  10466. return "qg3";
  10467. case Prop.gan4:
  10468. return "qg4";
  10469. default:
  10470. break;
  10471. }
  10472. }
  10473. getNameStr(type) {
  10474. switch (type) {
  10475. case Prop.diamond:
  10476. return "Diamond";
  10477. case Prop.coin:
  10478. return "Coins";
  10479. case Prop.gan1:
  10480. case Prop.gan2:
  10481. case Prop.gan3:
  10482. case Prop.gan4:
  10483. return cfgTable.ballrodData[type - 1].name;
  10484. default:
  10485. break;
  10486. }
  10487. }
  10488. }
  10489. UIGetAward.uiName = "UIGetAward";
  10490. class Common {
  10491. constructor() {
  10492. this.convertNum = 0.025;
  10493. this.VectorUp = new Laya.Vector3(0, 1, 0);
  10494. this.scaleV3One = new Laya.Vector3();
  10495. this.scaleV3Two = new Laya.Vector3();
  10496. this.posV4 = new Laya.Vector4();
  10497. this.showDebug = false;
  10498. this.openGuide = true;
  10499. this.rodOffest = new Laya.Vector2(0, 0);
  10500. this.rodAngle = 0;
  10501. this.gameMode = GameMode.classic;
  10502. this.bigMoveLevelIndex = 1;
  10503. this.bigMoveNeedCoin = 1000;
  10504. this.classicNiceNeddCoin = 1000;
  10505. this.passAwardCoin = 2000;
  10506. this.classicRoomType = 1;
  10507. this.maxPower = 20;
  10508. this.natureMaxPower = 5;
  10509. this.videoPower = 2;
  10510. this.powerRecoverNum = 900;
  10511. this.curPlayerSkillType = 0;
  10512. this.isNewDay = false;
  10513. this.clickedBall = false;
  10514. this.placeBallCurLevel = 0;
  10515. this.placeBallStarNum = 0;
  10516. this.longHelpLine = false;
  10517. this.maxShareDiamondTimes = 3;
  10518. this.guideStep = 0;
  10519. this.temSelfLevel = 0;
  10520. this.extraMoveNum = 0;
  10521. this.curRankID = 0;
  10522. this.rankID = {
  10523. normalStar: 12000,
  10524. wxStar: 12001
  10525. };
  10526. this.skillNameList = ["Fall from the sky", "Unstoppable Force", "Freeze Shot"];
  10527. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  10528. this.btnClickStr = "buttonclick";
  10529. this.maxSkillLevel = 10;
  10530. this.upSkillLevel = false;
  10531. this.gameStartTime = 0;
  10532. this._sysOffestNum = 0;
  10533. this.angleV2 = new Laya.Vector2();
  10534. this.rootV = new Laya.Vector2(0, 1);
  10535. this.tempDir1 = new Laya.Vector2();
  10536. this.tempDir2 = new Laya.Vector2();
  10537. this.ballSize = 33;
  10538. this.stPos = new Laya.Point();
  10539. this.edPos = new Laya.Point();
  10540. Common._instance = this;
  10541. window["common"] = this;
  10542. }
  10543. static getInstance() {
  10544. if (!this._instance) {
  10545. this._instance = new Common();
  10546. }
  10547. return this._instance;
  10548. }
  10549. get sysOffestNum() {
  10550. if (this._sysOffestNum == 0) {
  10551. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  10552. }
  10553. return this._sysOffestNum;
  10554. }
  10555. testShader() {
  10556. let test = new LightShader();
  10557. test.texture = "res/d3Res/ballTexture/ball1.png";
  10558. Laya.stage.addChild(test);
  10559. }
  10560. playScale(node) {
  10561. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  10562. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  10563. }));
  10564. }));
  10565. }
  10566. setGroup(colli, ...group) {
  10567. let out = 0;
  10568. for (let index = 0; index < group.length; index++) {
  10569. if (index == 0) {
  10570. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10571. }
  10572. else {
  10573. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10574. }
  10575. }
  10576. colli.collisionGroup = out;
  10577. }
  10578. setCanGroupWith(colli, ...group) {
  10579. let out = 0;
  10580. for (let index = 0; index < group.length; index++) {
  10581. if (index == 0) {
  10582. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10583. }
  10584. else {
  10585. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10586. }
  10587. }
  10588. colli.canCollideWith = out;
  10589. }
  10590. loadPrefab(name, callback) {
  10591. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  10592. let prefab = new Laya.Prefab();
  10593. prefab.json = obj;
  10594. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  10595. callback && callback(img);
  10596. }));
  10597. }
  10598. pos2to3Convert(x, y, d3Pos) {
  10599. x = x + this.sysOffestNum;
  10600. d3Pos.setValue(x, y, 0);
  10601. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  10602. if (success) {
  10603. }
  10604. else {
  10605. console.error("转换出错了。。。。。。。。");
  10606. }
  10607. }
  10608. scale2to3Convert(num) {
  10609. this.scaleV3One.setValue(0, 0, 0);
  10610. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  10611. this.scaleV3Two.setValue(0, num, 0);
  10612. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  10613. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  10614. return outNum;
  10615. }
  10616. pos3to2Convert(d3Pos) {
  10617. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  10618. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  10619. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  10620. d3Pos.x -= this.sysOffestNum;
  10621. }
  10622. scale3to2Convert(num) {
  10623. let scale = this.scale2to3Convert(1);
  10624. let d2Out = num / scale;
  10625. return d2Out;
  10626. }
  10627. getCollider(type, restitution = 0.9, density = 10) {
  10628. let colli;
  10629. if (type == "box")
  10630. colli = new Laya.BoxCollider();
  10631. else
  10632. colli = new Laya.CircleCollider();
  10633. colli.friction = 0;
  10634. colli.restitution = restitution;
  10635. colli.density = density;
  10636. return colli;
  10637. }
  10638. getRigbody() {
  10639. let rigy = new Laya.RigidBody();
  10640. rigy.bullet = true;
  10641. rigy.allowRotation = false;
  10642. rigy.allowSleep = false;
  10643. rigy.gravityScale = 0;
  10644. return rigy;
  10645. }
  10646. getfguiRotation(x, y) {
  10647. this.angleV2.setValue(x, y);
  10648. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  10649. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  10650. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  10651. angle = -angle;
  10652. }
  10653. return 180 + angle;
  10654. }
  10655. getAngle(x, y) {
  10656. this.angleV2.setValue(x, y);
  10657. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  10658. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  10659. return angle;
  10660. }
  10661. randomNum(a, b) {
  10662. return a + Math.floor((b - a + 1) * Math.random());
  10663. }
  10664. getRandArrEle(arr) {
  10665. return arr[Math.floor(arr.length * Math.random())];
  10666. }
  10667. getSign(val) {
  10668. return val >= 0 ? 1 : -1;
  10669. }
  10670. botherArr(arr) {
  10671. let times = arr.length + 2;
  10672. let length = arr.length;
  10673. let a;
  10674. let b;
  10675. let temp;
  10676. for (let index = 0; index < times; index++) {
  10677. a = Math.floor(Math.random() * length);
  10678. b = Math.floor(Math.random() * length);
  10679. temp = arr[a];
  10680. arr[a] = arr[b];
  10681. arr[b] = temp;
  10682. }
  10683. }
  10684. getGameIconUrl(id) {
  10685. return "ui://game/" + id;
  10686. }
  10687. getComponentUrl(id) {
  10688. return "ui://game/" + id;
  10689. }
  10690. getAnimation() {
  10691. }
  10692. judgeSkillType(type = SkillType.highSpace) {
  10693. if (this.gameMode == GameMode.classic)
  10694. return;
  10695. let gameMgr = this.gameMgr;
  10696. if (gameMgr.selfTurn) {
  10697. if (gameMgr.selfCurSkill == type) {
  10698. return true;
  10699. }
  10700. }
  10701. else {
  10702. if (gameMgr.aiCurSkill == type) {
  10703. return true;
  10704. }
  10705. }
  10706. }
  10707. ballColliHole(collider) {
  10708. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  10709. xGame.common.gameMgr.isFirstInGame = false;
  10710. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  10711. }
  10712. collider.owner.mySrc.checkWrongBall();
  10713. }
  10714. getArrMaxEle(arr) {
  10715. let max = -Infinity;
  10716. for (let index = 0; index < arr.length; index++) {
  10717. max = Math.max(arr[index], max);
  10718. }
  10719. return max;
  10720. }
  10721. getArrMinEle(arr) {
  10722. let min = Infinity;
  10723. for (let index = 0; index < arr.length; index++) {
  10724. min = Math.min(arr[index], min);
  10725. }
  10726. return min;
  10727. }
  10728. playRandomMutiBallBigSkillSound() {
  10729. if (Math.random() <= 0.5)
  10730. return;
  10731. let rand = this.randomNum(1, 6);
  10732. let str = "ganfa0" + rand;
  10733. xGame.soundMgr.playSound(str);
  10734. }
  10735. showOneCamera(type) {
  10736. let object = xGame.common.d3World.cameraObj;
  10737. for (const key in object) {
  10738. if (Object.prototype.hasOwnProperty.call(object, key)) {
  10739. object[key].init();
  10740. object[key].owner.active = key == type;
  10741. }
  10742. }
  10743. }
  10744. checkBallOverBorder(x, y) {
  10745. let radius = 17;
  10746. let condition = this._checkBorder(x + radius, y) ||
  10747. this._checkBorder(x - radius, y) ||
  10748. this._checkBorder(x, y + radius) ||
  10749. this._checkBorder(x, y - radius);
  10750. if (condition) {
  10751. return true;
  10752. }
  10753. }
  10754. _checkBorder(x, y) {
  10755. let borderRect = this.d2World.borderRect;
  10756. let xOffest = 20;
  10757. let yOffest = 20;
  10758. if (y <= borderRect.y - yOffest) {
  10759. return true;
  10760. }
  10761. if (y >= borderRect.y + borderRect.height + yOffest) {
  10762. return true;
  10763. }
  10764. if (x <= borderRect.x - xOffest) {
  10765. return true;
  10766. }
  10767. if (x >= borderRect.x + borderRect.width + xOffest) {
  10768. return true;
  10769. }
  10770. }
  10771. initWeight(cfg) {
  10772. let allCfgData = { data: {}, allWeightNum: 0 };
  10773. let weightCfg = allCfgData.data;
  10774. let weight = 0;
  10775. for (const key in cfg) {
  10776. weightCfg[key] = {};
  10777. weightCfg[key].id = cfg[key].id;
  10778. weightCfg[key].minWeight = weight;
  10779. weight += cfg[key].weight;
  10780. weightCfg[key].maxWeight = weight;
  10781. }
  10782. allCfgData.allWeightNum = weight;
  10783. return allCfgData;
  10784. }
  10785. getRandomWeightData(cfg) {
  10786. let weightCfg = cfg.data;
  10787. let allWeightNum = cfg.allWeightNum;
  10788. let rand = Math.floor(Math.random() * allWeightNum);
  10789. for (const key in weightCfg) {
  10790. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  10791. return weightCfg[key];
  10792. }
  10793. }
  10794. return weightCfg[1];
  10795. }
  10796. showGirlTalkPop(wordsIndex, node, msgNode) {
  10797. node.visible = true;
  10798. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  10799. node.t0.play(Laya.Handler.create(this, () => {
  10800. node.visible = false;
  10801. }));
  10802. }
  10803. stopGirlPop(node) {
  10804. node.t0.stop();
  10805. node.visible = false;
  10806. }
  10807. createHead(loader, url, size = 107) {
  10808. if (Laya.Browser.name == "Browser") {
  10809. loader.url = url;
  10810. return;
  10811. }
  10812. if (Moyu.isTT) {
  10813. let localImage = new Image();
  10814. localImage.src = url;
  10815. localImage.onload = () => {
  10816. let t2d = new Laya.Texture2D();
  10817. t2d.width = size;
  10818. t2d.height = size;
  10819. loader.displayObject.graphics.drawImage(new Laya.Texture(t2d), 0, 0);
  10820. t2d.loadImageSource(localImage);
  10821. };
  10822. }
  10823. else {
  10824. console.log('zh:url=', url);
  10825. loader.url = url;
  10826. }
  10827. }
  10828. addTestCoin(num) {
  10829. DataMgr.setCoin(num);
  10830. }
  10831. addTestDiamond(num) {
  10832. DataMgr.setDiamond(num);
  10833. }
  10834. addTestSkill() {
  10835. DataMgr.setBigSkill(0, 99);
  10836. DataMgr.setBigSkill(1, 99);
  10837. DataMgr.setBigSkill(2, 99);
  10838. }
  10839. playClassicEmotion(number, x, y) {
  10840. if (this.gameMode == GameMode.bigMove)
  10841. return;
  10842. let randIndex = this.randomNum(0, 2);
  10843. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  10844. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  10845. if (this.gameMgr.selfTurn) {
  10846. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  10847. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10848. }
  10849. else {
  10850. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  10851. }
  10852. else {
  10853. if (number == this.gameMgr.blackNum) {
  10854. if (this.gameMgr.selfBallArr.length == 0) {
  10855. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10856. }
  10857. else {
  10858. }
  10859. }
  10860. else {
  10861. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10862. }
  10863. }
  10864. }
  10865. }
  10866. else {
  10867. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  10868. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10869. }
  10870. else {
  10871. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  10872. }
  10873. else {
  10874. if (number == this.gameMgr.blackNum) {
  10875. if (this.gameMgr.aiBallArr.length == 0) {
  10876. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10877. }
  10878. else {
  10879. }
  10880. }
  10881. else {
  10882. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10883. }
  10884. }
  10885. }
  10886. }
  10887. }
  10888. playHappySound(number) {
  10889. if (this.gameMode != GameMode.classic)
  10890. return;
  10891. if (number == 8)
  10892. return;
  10893. let play = false;
  10894. if (this.gameMgr.selfTurn) {
  10895. if (this.gameMgr.ensureBallType) {
  10896. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  10897. play = true;
  10898. }
  10899. }
  10900. else {
  10901. play = true;
  10902. }
  10903. }
  10904. else {
  10905. if (this.gameMgr.ensureBallType) {
  10906. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  10907. play = true;
  10908. }
  10909. }
  10910. else {
  10911. play = true;
  10912. }
  10913. }
  10914. if (play)
  10915. xGame.soundMgr.playSound("applause");
  10916. }
  10917. destroyClassicEmotion() {
  10918. if (this.gameMode == GameMode.bigMove)
  10919. return;
  10920. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  10921. parent.destroyChildren();
  10922. }
  10923. playAwardSpine(x, y) {
  10924. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  10925. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  10926. this.awardSpine.play(data, 0, false, parent);
  10927. }
  10928. destroyAwardSpine() {
  10929. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  10930. parent.destroyChildren();
  10931. }
  10932. isBlock(bx, by, hx, hy, except = null) {
  10933. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  10934. let balls = xGame.common.d2World.ballArr;
  10935. let outArr = [];
  10936. for (let index = 0; index < balls.length; index++) {
  10937. let obj = balls[index];
  10938. if (obj.number == 0)
  10939. continue;
  10940. if (obj == except)
  10941. continue;
  10942. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  10943. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  10944. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  10945. if (num >= 1)
  10946. num = 1;
  10947. if (num < 0)
  10948. continue;
  10949. let gap = Math.sin(Math.acos(num)) * dis;
  10950. if (gap < this.ballSize) {
  10951. outArr.push({
  10952. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  10953. disHon: Math.cos(Math.acos(num)) * dis,
  10954. disVer: Math.sin(Math.acos(num)) * dis,
  10955. src: balls[index],
  10956. dir: this.tempDir1
  10957. });
  10958. }
  10959. }
  10960. if (outArr.length > 0) {
  10961. outArr.sort((a, b) => { return a.dis - b.dis; });
  10962. return outArr[0];
  10963. }
  10964. }
  10965. AngleBetween(vector1, vector2) {
  10966. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  10967. return rad * (180 / Math.PI);
  10968. }
  10969. getSecretaryScale() {
  10970. if (this.secretary.spineName == "mishu") {
  10971. return 1.28;
  10972. }
  10973. else {
  10974. return 1.024;
  10975. }
  10976. }
  10977. signAwardContainsRod(arr) {
  10978. let temp;
  10979. for (let index = 0; index < arr.length; index++) {
  10980. temp = arr[index].split('-')[0];
  10981. if (parseInt(temp) > 2) {
  10982. return true;
  10983. }
  10984. }
  10985. }
  10986. judgeSameDay() {
  10987. let lastTime = DataMgr.getSignTime();
  10988. let curTime = new Date().getTime();
  10989. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  10990. return true;
  10991. }
  10992. return false;
  10993. }
  10994. getAward(arr, callback) {
  10995. let showTriple = arr[0].type <= 2;
  10996. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  10997. let temp;
  10998. for (let index = 0; index < arr.length; index++) {
  10999. temp = arr[index];
  11000. switch (temp.type) {
  11001. case 1:
  11002. this.playObjFlyAnim(temp.num, temp.type);
  11003. break;
  11004. case 2:
  11005. this.playObjFlyAnim(temp.num, temp.type);
  11006. break;
  11007. case 3:
  11008. case 4:
  11009. case 5:
  11010. case 6:
  11011. DataMgr.setBallRod(temp.type - 2, 1);
  11012. DataMgr.setCurBallRod(temp.type - 2);
  11013. break;
  11014. default:
  11015. break;
  11016. }
  11017. }
  11018. callback && callback(watchVideo);
  11019. });
  11020. }
  11021. getMoneyNode() {
  11022. let moneyNode;
  11023. let sign = xGame.uiMgr.getUI(UISign);
  11024. let draw = xGame.uiMgr.getUI(UIDraw);
  11025. let end = xGame.uiMgr.getUI(UIGameEnd);
  11026. let skill = xGame.uiMgr.getUI(UISkill);
  11027. if (sign && !sign.isHide)
  11028. moneyNode = sign.ui.moneyNode;
  11029. if (draw && !draw.isHide)
  11030. moneyNode = draw.ui.moneyNode;
  11031. if (end && !end.isHide)
  11032. moneyNode = end.ui.moneyNode;
  11033. if (skill && !skill.isHide)
  11034. moneyNode = skill.ui.moneyNode;
  11035. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  11036. let main = xGame.uiMgr.getUI(UIMain);
  11037. if (condition1 && main && !main.isHide) {
  11038. moneyNode = main.ui.moneyNode;
  11039. }
  11040. return moneyNode;
  11041. }
  11042. playObjFlyAnim(num, type, callback = null) {
  11043. this.stPos.x = Laya.stage.width / 2;
  11044. this.stPos.y = Laya.stage.height / 2;
  11045. let moneyNode = this.getMoneyNode();
  11046. switch (type) {
  11047. case Prop.diamond:
  11048. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  11049. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  11050. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  11051. this.edPos.x /= 2;
  11052. this.edPos.y /= 2;
  11053. break;
  11054. case Prop.coin:
  11055. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  11056. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  11057. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  11058. this.edPos.x /= 2;
  11059. this.edPos.y /= 2;
  11060. break;
  11061. default:
  11062. break;
  11063. }
  11064. xGame.soundMgr.playSound("coinbag");
  11065. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  11066. switch (type) {
  11067. case Prop.diamond:
  11068. DataMgr.setDiamond(num);
  11069. break;
  11070. case Prop.coin:
  11071. DataMgr.setCoin(num);
  11072. break;
  11073. default:
  11074. break;
  11075. }
  11076. callback && callback();
  11077. });
  11078. }
  11079. autoPopUIView() {
  11080. let arr = [];
  11081. let sign = this.judgeSameDay() ? false : true;
  11082. if (sign)
  11083. arr.push("sign");
  11084. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  11085. if (draw)
  11086. arr.push("draw");
  11087. if (arr.length <= 0)
  11088. return;
  11089. let str = this.getRandArrEle(arr);
  11090. switch (str) {
  11091. case "sign":
  11092. xGame.uiMgr.Show(UISign);
  11093. break;
  11094. case "draw":
  11095. xGame.uiMgr.Show(UIDraw);
  11096. break;
  11097. default:
  11098. break;
  11099. }
  11100. }
  11101. getMSTime(time) {
  11102. let min = Math.floor(time / 60);
  11103. let sec = Math.floor((time - min * 60));
  11104. if (sec < 10)
  11105. sec = "0" + sec;
  11106. if (min < 10)
  11107. min = "0" + min;
  11108. return `${min}:${sec}`;
  11109. }
  11110. testPower() {
  11111. DataMgr.setPower(0, false);
  11112. }
  11113. getAllStarNum() {
  11114. let data = DataMgr.getPlaceBallLevelList();
  11115. let out = 0;
  11116. for (let index = 0; index < data.length; index++) {
  11117. out += data[index].star;
  11118. }
  11119. return out;
  11120. }
  11121. recoverCameraView() {
  11122. Laya.timer.once(900, this, () => {
  11123. xGame.common.showOneCamera("mainCamera");
  11124. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  11125. xGame.common.gameUI.ui.d2Node.alpha = 1;
  11126. xGame.common.gameUI.ui.border.alpha = 0;
  11127. if (Laya.physicsTimer.scale < 1) {
  11128. Laya.physicsTimer.scale = 1;
  11129. }
  11130. }
  11131. });
  11132. }
  11133. getClassicLevel() {
  11134. let successTimes = DataMgr.getClassicTimes();
  11135. let needKey = "";
  11136. let lastKey = "";
  11137. let cfg = cfgTable.classictimesData;
  11138. let data;
  11139. for (const key in cfg) {
  11140. data = cfg[key];
  11141. if (successTimes <= data.times) {
  11142. needKey = key;
  11143. }
  11144. lastKey = key;
  11145. }
  11146. if (needKey == "")
  11147. needKey = lastKey;
  11148. return cfg[needKey];
  11149. }
  11150. }
  11151. Common._instance = null;
  11152. class ui_Component92 extends fgui.GComponent {
  11153. static createInstance() {
  11154. return (fgui.UIPackage.createObject("game", "Component92"));
  11155. }
  11156. onConstruct() {
  11157. this.n0 = (this.getChild("n0"));
  11158. }
  11159. }
  11160. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  11161. class ui_Component129 extends fgui.GProgressBar {
  11162. static createInstance() {
  11163. return (fgui.UIPackage.createObject("game", "Component129"));
  11164. }
  11165. onConstruct() {
  11166. this.bar_v = (this.getChild("bar_v"));
  11167. this.n84 = (this.getChild("n84"));
  11168. }
  11169. }
  11170. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  11171. class ui_Component130 extends fgui.GComponent {
  11172. static createInstance() {
  11173. return (fgui.UIPackage.createObject("game", "Component130"));
  11174. }
  11175. onConstruct() {
  11176. this.ani = (this.getChild("ani"));
  11177. this.t0 = this.getTransition("t0");
  11178. }
  11179. }
  11180. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  11181. class ui_powerEft extends fgui.GComponent {
  11182. static createInstance() {
  11183. return (fgui.UIPackage.createObject("game", "powerEft"));
  11184. }
  11185. onConstruct() {
  11186. this.ani = (this.getChild("ani"));
  11187. this.n88 = (this.getChild("n88"));
  11188. this.n89 = (this.getChild("n89"));
  11189. }
  11190. }
  11191. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  11192. class ui_PutBallLevelDisplay extends fgui.GComponent {
  11193. static createInstance() {
  11194. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  11195. }
  11196. onConstruct() {
  11197. this.c1 = this.getController("c1");
  11198. this.n2 = (this.getChild("n2"));
  11199. this.n22 = (this.getChild("n22"));
  11200. this.n23 = (this.getChild("n23"));
  11201. this.n15 = (this.getChild("n15"));
  11202. this.challenge = (this.getChild("challenge"));
  11203. this.n17 = (this.getChild("n17"));
  11204. this.n3 = (this.getChild("n3"));
  11205. this.starNode = (this.getChild("starNode"));
  11206. this.levelTxt = (this.getChild("levelTxt"));
  11207. this.n14 = (this.getChild("n14"));
  11208. this.n19 = (this.getChild("n19"));
  11209. this.n20 = (this.getChild("n20"));
  11210. this.n21 = (this.getChild("n21"));
  11211. this.special = (this.getChild("special"));
  11212. }
  11213. }
  11214. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  11215. class ui_Component79 extends fgui.GComponent {
  11216. static createInstance() {
  11217. return (fgui.UIPackage.createObject("game", "Component79"));
  11218. }
  11219. onConstruct() {
  11220. this.c1 = this.getController("c1");
  11221. this.n7 = (this.getChild("n7"));
  11222. this.n8 = (this.getChild("n8"));
  11223. this.n9 = (this.getChild("n9"));
  11224. this.n10 = (this.getChild("n10"));
  11225. this.n11 = (this.getChild("n11"));
  11226. this.n12 = (this.getChild("n12"));
  11227. }
  11228. }
  11229. ui_Component79.URL = "ui://isxx5ak7avag477";
  11230. class ui_Component80 extends fgui.GComponent {
  11231. static createInstance() {
  11232. return (fgui.UIPackage.createObject("game", "Component80"));
  11233. }
  11234. onConstruct() {
  11235. this.n0 = (this.getChild("n0"));
  11236. this.n1 = (this.getChild("n1"));
  11237. this.myList = (this.getChild("myList"));
  11238. this.t0 = this.getTransition("t0");
  11239. }
  11240. }
  11241. ui_Component80.URL = "ui://isxx5ak7avag47b";
  11242. class ui_SignNormal extends fgui.GComponent {
  11243. static createInstance() {
  11244. return (fgui.UIPackage.createObject("game", "SignNormal"));
  11245. }
  11246. onConstruct() {
  11247. this.c1 = this.getController("c1");
  11248. this.n7 = (this.getChild("n7"));
  11249. this.n15 = (this.getChild("n15"));
  11250. this.titleTxt = (this.getChild("titleTxt"));
  11251. this.n8 = (this.getChild("n8"));
  11252. this.myIcon = (this.getChild("myIcon"));
  11253. this.numTxt = (this.getChild("numTxt"));
  11254. this.n12 = (this.getChild("n12"));
  11255. this.n13 = (this.getChild("n13"));
  11256. this.n17 = (this.getChild("n17"));
  11257. this.n14 = (this.getChild("n14"));
  11258. }
  11259. }
  11260. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  11261. class ui_screenNode extends fgui.GComponent {
  11262. static createInstance() {
  11263. return (fgui.UIPackage.createObject("game", "screenNode"));
  11264. }
  11265. onConstruct() {
  11266. this.n9 = (this.getChild("n9"));
  11267. this.screenImg = (this.getChild("screenImg"));
  11268. }
  11269. }
  11270. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  11271. class ui_GetAwrad_com1 extends fgui.GComponent {
  11272. static createInstance() {
  11273. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  11274. }
  11275. onConstruct() {
  11276. this.n38 = (this.getChild("n38"));
  11277. this.n39 = (this.getChild("n39"));
  11278. this.n40 = (this.getChild("n40"));
  11279. this.t0 = this.getTransition("t0");
  11280. this.t1 = this.getTransition("t1");
  11281. }
  11282. }
  11283. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  11284. class ui_GetAwrad_com2 extends fgui.GComponent {
  11285. static createInstance() {
  11286. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  11287. }
  11288. onConstruct() {
  11289. this.n39 = (this.getChild("n39"));
  11290. this.n40 = (this.getChild("n40"));
  11291. this.t0 = this.getTransition("t0");
  11292. }
  11293. }
  11294. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  11295. class ui_Component128 extends fgui.GComponent {
  11296. static createInstance() {
  11297. return (fgui.UIPackage.createObject("game", "Component128"));
  11298. }
  11299. onConstruct() {
  11300. this.n38 = (this.getChild("n38"));
  11301. this.n40 = (this.getChild("n40"));
  11302. }
  11303. }
  11304. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  11305. class ui_Component100_1 extends fgui.GComponent {
  11306. static createInstance() {
  11307. return (fgui.UIPackage.createObject("game", "Component100_1"));
  11308. }
  11309. onConstruct() {
  11310. this.myNode = (this.getChild("myNode"));
  11311. this.t0 = this.getTransition("t0");
  11312. }
  11313. }
  11314. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  11315. class ui_Component142 extends fgui.GComponent {
  11316. static createInstance() {
  11317. return (fgui.UIPackage.createObject("game", "Component142"));
  11318. }
  11319. onConstruct() {
  11320. this.n41 = (this.getChild("n41"));
  11321. this.n42 = (this.getChild("n42"));
  11322. }
  11323. }
  11324. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  11325. class ui_main_guang extends fgui.GComponent {
  11326. static createInstance() {
  11327. return (fgui.UIPackage.createObject("game", "main_guang"));
  11328. }
  11329. onConstruct() {
  11330. this.n1 = (this.getChild("n1"));
  11331. this.n2 = (this.getChild("n2"));
  11332. this.n3 = (this.getChild("n3"));
  11333. this.n4 = (this.getChild("n4"));
  11334. this.n5 = (this.getChild("n5"));
  11335. this.n6 = (this.getChild("n6"));
  11336. this.n8 = (this.getChild("n8"));
  11337. this.t0 = this.getTransition("t0");
  11338. }
  11339. }
  11340. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  11341. class ui_try_com1 extends fgui.GComponent {
  11342. static createInstance() {
  11343. return (fgui.UIPackage.createObject("game", "try_com1"));
  11344. }
  11345. onConstruct() {
  11346. this.c1 = this.getController("c1");
  11347. this.n0 = (this.getChild("n0"));
  11348. this.n2 = (this.getChild("n2"));
  11349. this.cancelBtn = (this.getChild("cancelBtn"));
  11350. this.videoBtn = (this.getChild("videoBtn"));
  11351. this.n9 = (this.getChild("n9"));
  11352. this.n24 = (this.getChild("n24"));
  11353. this.titleTxt = (this.getChild("titleTxt"));
  11354. this.n32 = (this.getChild("n32"));
  11355. this.n29 = (this.getChild("n29"));
  11356. this.n36 = (this.getChild("n36"));
  11357. this.txtTime = (this.getChild("txtTime"));
  11358. this.t0 = this.getTransition("t0");
  11359. }
  11360. }
  11361. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  11362. class ui_try_com2 extends fgui.GComponent {
  11363. static createInstance() {
  11364. return (fgui.UIPackage.createObject("game", "try_com2"));
  11365. }
  11366. onConstruct() {
  11367. this.skillicon = (this.getChild("skillicon"));
  11368. this.n35 = (this.getChild("n35"));
  11369. this.n31 = (this.getChild("n31"));
  11370. this.n32 = (this.getChild("n32"));
  11371. this.n33 = (this.getChild("n33"));
  11372. this.n34 = (this.getChild("n34"));
  11373. }
  11374. }
  11375. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  11376. class ui_try_com3 extends fgui.GComponent {
  11377. static createInstance() {
  11378. return (fgui.UIPackage.createObject("game", "try_com3"));
  11379. }
  11380. onConstruct() {
  11381. this.n33 = (this.getChild("n33"));
  11382. this.n34 = (this.getChild("n34"));
  11383. this.n35 = (this.getChild("n35"));
  11384. this.t0 = this.getTransition("t0");
  11385. }
  11386. }
  11387. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  11388. class ui_Component121 extends fgui.GButton {
  11389. static createInstance() {
  11390. return (fgui.UIPackage.createObject("game", "Component121"));
  11391. }
  11392. onConstruct() {
  11393. this.n3 = (this.getChild("n3"));
  11394. this.t0 = this.getTransition("t0");
  11395. }
  11396. }
  11397. ui_Component121.URL = "ui://isxx5ak7cy72v4ib";
  11398. class ui_huihe1 extends fgui.GComponent {
  11399. static createInstance() {
  11400. return (fgui.UIPackage.createObject("game", "huihe1"));
  11401. }
  11402. onConstruct() {
  11403. this.n0 = (this.getChild("n0"));
  11404. this.n1 = (this.getChild("n1"));
  11405. this.t0 = this.getTransition("t0");
  11406. }
  11407. }
  11408. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  11409. class ui_huihe2 extends fgui.GComponent {
  11410. static createInstance() {
  11411. return (fgui.UIPackage.createObject("game", "huihe2"));
  11412. }
  11413. onConstruct() {
  11414. this.n0 = (this.getChild("n0"));
  11415. this.n1 = (this.getChild("n1"));
  11416. this.t0 = this.getTransition("t0");
  11417. }
  11418. }
  11419. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  11420. class ui_Component143 extends fgui.GComponent {
  11421. static createInstance() {
  11422. return (fgui.UIPackage.createObject("game", "Component143"));
  11423. }
  11424. onConstruct() {
  11425. this.n3 = (this.getChild("n3"));
  11426. this.n4 = (this.getChild("n4"));
  11427. this.n5 = (this.getChild("n5"));
  11428. this.n6 = (this.getChild("n6"));
  11429. this.n7 = (this.getChild("n7"));
  11430. this.n8 = (this.getChild("n8"));
  11431. this.n9 = (this.getChild("n9"));
  11432. this.n10 = (this.getChild("n10"));
  11433. this.t0 = this.getTransition("t0");
  11434. }
  11435. }
  11436. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  11437. class ui_dh_jingbi2 extends fgui.GComponent {
  11438. static createInstance() {
  11439. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  11440. }
  11441. onConstruct() {
  11442. this.n0 = (this.getChild("n0"));
  11443. this.n1 = (this.getChild("n1"));
  11444. this.n2 = (this.getChild("n2"));
  11445. this.n3 = (this.getChild("n3"));
  11446. this.n4 = (this.getChild("n4"));
  11447. this.n5 = (this.getChild("n5"));
  11448. this.n6 = (this.getChild("n6"));
  11449. this.n8 = (this.getChild("n8"));
  11450. this.n10 = (this.getChild("n10"));
  11451. this.t0 = this.getTransition("t0");
  11452. }
  11453. }
  11454. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  11455. class ui_dh_jingbi2_1 extends fgui.GComponent {
  11456. static createInstance() {
  11457. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  11458. }
  11459. onConstruct() {
  11460. this.n1 = (this.getChild("n1"));
  11461. this.n4 = (this.getChild("n4"));
  11462. this.t0 = this.getTransition("t0");
  11463. }
  11464. }
  11465. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  11466. class ui_dh_jingbi3 extends fgui.GComponent {
  11467. static createInstance() {
  11468. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  11469. }
  11470. onConstruct() {
  11471. this.n0 = (this.getChild("n0"));
  11472. this.n1 = (this.getChild("n1"));
  11473. this.n2 = (this.getChild("n2"));
  11474. this.n3 = (this.getChild("n3"));
  11475. this.n4 = (this.getChild("n4"));
  11476. this.n5 = (this.getChild("n5"));
  11477. this.n6 = (this.getChild("n6"));
  11478. this.n8 = (this.getChild("n8"));
  11479. this.n10 = (this.getChild("n10"));
  11480. this.t0 = this.getTransition("t0");
  11481. }
  11482. }
  11483. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  11484. class ui_dh_jingbi3_1 extends fgui.GComponent {
  11485. static createInstance() {
  11486. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  11487. }
  11488. onConstruct() {
  11489. this.n3 = (this.getChild("n3"));
  11490. this.n1 = (this.getChild("n1"));
  11491. this.t0 = this.getTransition("t0");
  11492. }
  11493. }
  11494. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  11495. class ui_hb_jinbi1 extends fgui.GButton {
  11496. static createInstance() {
  11497. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  11498. }
  11499. onConstruct() {
  11500. this.n20 = (this.getChild("n20"));
  11501. this.n25 = (this.getChild("n25"));
  11502. this.coinTxt = (this.getChild("coinTxt"));
  11503. this.n28 = (this.getChild("n28"));
  11504. this.n32 = (this.getChild("n32"));
  11505. this.n38 = (this.getChild("n38"));
  11506. this.n45 = (this.getChild("n45"));
  11507. this.getTips = (this.getChild("getTips"));
  11508. this.n39 = (this.getChild("n39"));
  11509. this.diamondTxt = (this.getChild("diamondTxt"));
  11510. this.n41 = (this.getChild("n41"));
  11511. this.n42 = (this.getChild("n42"));
  11512. this.n46 = (this.getChild("n46"));
  11513. this.n47 = (this.getChild("n47"));
  11514. this.n48 = (this.getChild("n48"));
  11515. this.t0 = this.getTransition("t0");
  11516. }
  11517. }
  11518. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  11519. class ui_hb_jinbi2 extends fgui.GButton {
  11520. static createInstance() {
  11521. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  11522. }
  11523. onConstruct() {
  11524. this.n20 = (this.getChild("n20"));
  11525. this.n25 = (this.getChild("n25"));
  11526. this.coinTxt = (this.getChild("coinTxt"));
  11527. this.n28 = (this.getChild("n28"));
  11528. this.n32 = (this.getChild("n32"));
  11529. this.n38 = (this.getChild("n38"));
  11530. this.n39 = (this.getChild("n39"));
  11531. this.diamondTxt = (this.getChild("diamondTxt"));
  11532. this.n41 = (this.getChild("n41"));
  11533. this.n42 = (this.getChild("n42"));
  11534. this.n43 = (this.getChild("n43"));
  11535. this.n44 = (this.getChild("n44"));
  11536. this.n45 = (this.getChild("n45"));
  11537. this.t0 = this.getTransition("t0");
  11538. }
  11539. }
  11540. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  11541. class ui_hb_jinbi3 extends fgui.GButton {
  11542. static createInstance() {
  11543. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  11544. }
  11545. onConstruct() {
  11546. this.n20 = (this.getChild("n20"));
  11547. this.n25 = (this.getChild("n25"));
  11548. this.coinTxt = (this.getChild("coinTxt"));
  11549. this.n28 = (this.getChild("n28"));
  11550. this.n32 = (this.getChild("n32"));
  11551. this.n38 = (this.getChild("n38"));
  11552. this.n39 = (this.getChild("n39"));
  11553. this.diamondTxt = (this.getChild("diamondTxt"));
  11554. this.n41 = (this.getChild("n41"));
  11555. this.n42 = (this.getChild("n42"));
  11556. this.n43 = (this.getChild("n43"));
  11557. this.n44 = (this.getChild("n44"));
  11558. this.n45 = (this.getChild("n45"));
  11559. this.t0 = this.getTransition("t0");
  11560. }
  11561. }
  11562. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  11563. class ui_Component104 extends fgui.GComponent {
  11564. static createInstance() {
  11565. return (fgui.UIPackage.createObject("game", "Component104"));
  11566. }
  11567. onConstruct() {
  11568. this.c1 = this.getController("c1");
  11569. this.n12 = (this.getChild("n12"));
  11570. this.coinBtn = (this.getChild("coinBtn"));
  11571. this.diamondBtn = (this.getChild("diamondBtn"));
  11572. this.node3 = (this.getChild("node3"));
  11573. this.node4 = (this.getChild("node4"));
  11574. this.node5 = (this.getChild("node5"));
  11575. this.node1 = (this.getChild("node1"));
  11576. this.node2 = (this.getChild("node2"));
  11577. this.node6 = (this.getChild("node6"));
  11578. this.t0 = this.getTransition("t0");
  11579. }
  11580. }
  11581. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  11582. class ui_Component105 extends fgui.GButton {
  11583. static createInstance() {
  11584. return (fgui.UIPackage.createObject("game", "Component105"));
  11585. }
  11586. onConstruct() {
  11587. this.c1 = this.getController("c1");
  11588. this.n49 = (this.getChild("n49"));
  11589. this.n18 = (this.getChild("n18"));
  11590. this.n46 = (this.getChild("n46"));
  11591. this.n48 = (this.getChild("n48"));
  11592. }
  11593. }
  11594. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  11595. class ui_Component106 extends fgui.GButton {
  11596. static createInstance() {
  11597. return (fgui.UIPackage.createObject("game", "Component106"));
  11598. }
  11599. onConstruct() {
  11600. this.c1 = this.getController("c1");
  11601. this.n49 = (this.getChild("n49"));
  11602. this.n18 = (this.getChild("n18"));
  11603. this.n46 = (this.getChild("n46"));
  11604. this.n48 = (this.getChild("n48"));
  11605. }
  11606. }
  11607. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  11608. class ui_hb_zs1 extends fgui.GButton {
  11609. static createInstance() {
  11610. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  11611. }
  11612. onConstruct() {
  11613. this.c1 = this.getController("c1");
  11614. this.n20 = (this.getChild("n20"));
  11615. this.n21 = (this.getChild("n21"));
  11616. this.n26 = (this.getChild("n26"));
  11617. this.n27 = (this.getChild("n27"));
  11618. this.shareTxt = (this.getChild("shareTxt"));
  11619. this.n32 = (this.getChild("n32"));
  11620. this.n38 = (this.getChild("n38"));
  11621. this.n39 = (this.getChild("n39"));
  11622. this.n44 = (this.getChild("n44"));
  11623. this.diamondTxt = (this.getChild("diamondTxt"));
  11624. this.n41 = (this.getChild("n41"));
  11625. this.n45 = (this.getChild("n45"));
  11626. this.n47 = (this.getChild("n47"));
  11627. this.n48 = (this.getChild("n48"));
  11628. this.randTxt = (this.getChild("randTxt"));
  11629. this.n50 = (this.getChild("n50"));
  11630. this.t0 = this.getTransition("t0");
  11631. }
  11632. }
  11633. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  11634. class ui_dh_zs1 extends fgui.GComponent {
  11635. static createInstance() {
  11636. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  11637. }
  11638. onConstruct() {
  11639. this.n10 = (this.getChild("n10"));
  11640. this.n9 = (this.getChild("n9"));
  11641. this.n1 = (this.getChild("n1"));
  11642. this.n2 = (this.getChild("n2"));
  11643. this.n3 = (this.getChild("n3"));
  11644. this.n4 = (this.getChild("n4"));
  11645. this.n5 = (this.getChild("n5"));
  11646. this.n6 = (this.getChild("n6"));
  11647. this.n8 = (this.getChild("n8"));
  11648. this.n11 = (this.getChild("n11"));
  11649. this.t0 = this.getTransition("t0");
  11650. }
  11651. }
  11652. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  11653. class ui_dh_zs1_1 extends fgui.GComponent {
  11654. static createInstance() {
  11655. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  11656. }
  11657. onConstruct() {
  11658. this.n3 = (this.getChild("n3"));
  11659. this.n1 = (this.getChild("n1"));
  11660. this.t0 = this.getTransition("t0");
  11661. }
  11662. }
  11663. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  11664. class ui_hb_zs2 extends fgui.GButton {
  11665. static createInstance() {
  11666. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  11667. }
  11668. onConstruct() {
  11669. this.n20 = (this.getChild("n20"));
  11670. this.n21 = (this.getChild("n21"));
  11671. this.n26 = (this.getChild("n26"));
  11672. this.n27 = (this.getChild("n27"));
  11673. this.n32 = (this.getChild("n32"));
  11674. this.n38 = (this.getChild("n38"));
  11675. this.n39 = (this.getChild("n39"));
  11676. this.n44 = (this.getChild("n44"));
  11677. this.diamondTxt = (this.getChild("diamondTxt"));
  11678. this.n41 = (this.getChild("n41"));
  11679. this.n45 = (this.getChild("n45"));
  11680. this.t0 = this.getTransition("t0");
  11681. }
  11682. }
  11683. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  11684. class ui_hb_zs3 extends fgui.GButton {
  11685. static createInstance() {
  11686. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  11687. }
  11688. onConstruct() {
  11689. this.n20 = (this.getChild("n20"));
  11690. this.n21 = (this.getChild("n21"));
  11691. this.n26 = (this.getChild("n26"));
  11692. this.n27 = (this.getChild("n27"));
  11693. this.n32 = (this.getChild("n32"));
  11694. this.n38 = (this.getChild("n38"));
  11695. this.n47 = (this.getChild("n47"));
  11696. this.t0 = this.getTransition("t0");
  11697. }
  11698. }
  11699. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  11700. class ui_dh_zs2 extends fgui.GComponent {
  11701. static createInstance() {
  11702. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  11703. }
  11704. onConstruct() {
  11705. this.n10 = (this.getChild("n10"));
  11706. this.n9 = (this.getChild("n9"));
  11707. this.n1 = (this.getChild("n1"));
  11708. this.n2 = (this.getChild("n2"));
  11709. this.n3 = (this.getChild("n3"));
  11710. this.n4 = (this.getChild("n4"));
  11711. this.n5 = (this.getChild("n5"));
  11712. this.n6 = (this.getChild("n6"));
  11713. this.n8 = (this.getChild("n8"));
  11714. this.n11 = (this.getChild("n11"));
  11715. this.t0 = this.getTransition("t0");
  11716. }
  11717. }
  11718. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  11719. class ui_dh_zs2_1 extends fgui.GComponent {
  11720. static createInstance() {
  11721. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  11722. }
  11723. onConstruct() {
  11724. this.n3 = (this.getChild("n3"));
  11725. this.n1 = (this.getChild("n1"));
  11726. this.t0 = this.getTransition("t0");
  11727. }
  11728. }
  11729. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  11730. class ui_dh_zs3 extends fgui.GComponent {
  11731. static createInstance() {
  11732. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  11733. }
  11734. onConstruct() {
  11735. this.n10 = (this.getChild("n10"));
  11736. this.n9 = (this.getChild("n9"));
  11737. this.n1 = (this.getChild("n1"));
  11738. this.n2 = (this.getChild("n2"));
  11739. this.n3 = (this.getChild("n3"));
  11740. this.n4 = (this.getChild("n4"));
  11741. this.n5 = (this.getChild("n5"));
  11742. this.n6 = (this.getChild("n6"));
  11743. this.n8 = (this.getChild("n8"));
  11744. this.n11 = (this.getChild("n11"));
  11745. this.t0 = this.getTransition("t0");
  11746. }
  11747. }
  11748. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  11749. class ui_dh_zs3_1 extends fgui.GComponent {
  11750. static createInstance() {
  11751. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  11752. }
  11753. onConstruct() {
  11754. this.n3 = (this.getChild("n3"));
  11755. this.n1 = (this.getChild("n1"));
  11756. this.t0 = this.getTransition("t0");
  11757. }
  11758. }
  11759. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  11760. class ui_Component107 extends fgui.GComponent {
  11761. static createInstance() {
  11762. return (fgui.UIPackage.createObject("game", "Component107"));
  11763. }
  11764. onConstruct() {
  11765. this.n18 = (this.getChild("n18"));
  11766. this.n19 = (this.getChild("n19"));
  11767. this.n20 = (this.getChild("n20"));
  11768. this.n21 = (this.getChild("n21"));
  11769. this.n22 = (this.getChild("n22"));
  11770. this.levelTxt = (this.getChild("levelTxt"));
  11771. this.t0 = this.getTransition("t0");
  11772. }
  11773. }
  11774. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  11775. class ui_box_com1 extends fgui.GComponent {
  11776. static createInstance() {
  11777. return (fgui.UIPackage.createObject("game", "box_com1"));
  11778. }
  11779. onConstruct() {
  11780. this.n14 = (this.getChild("n14"));
  11781. this.n6 = (this.getChild("n6"));
  11782. this.t0 = this.getTransition("t0");
  11783. }
  11784. }
  11785. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  11786. class ui_box_com2 extends fgui.GProgressBar {
  11787. static createInstance() {
  11788. return (fgui.UIPackage.createObject("game", "box_com2"));
  11789. }
  11790. onConstruct() {
  11791. this.bg0 = (this.getChild("bg0"));
  11792. this.bg = (this.getChild("bg"));
  11793. this.bar = (this.getChild("bar"));
  11794. this.n7 = (this.getChild("n7"));
  11795. this.n8 = (this.getChild("n8"));
  11796. this.n10 = (this.getChild("n10"));
  11797. this.n11 = (this.getChild("n11"));
  11798. this.n12 = (this.getChild("n12"));
  11799. }
  11800. }
  11801. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  11802. class ui_box_com4 extends fgui.GComponent {
  11803. static createInstance() {
  11804. return (fgui.UIPackage.createObject("game", "box_com4"));
  11805. }
  11806. onConstruct() {
  11807. this.n8 = (this.getChild("n8"));
  11808. this.t0 = this.getTransition("t0");
  11809. }
  11810. }
  11811. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  11812. class ui_box_com3 extends fgui.GComponent {
  11813. static createInstance() {
  11814. return (fgui.UIPackage.createObject("game", "box_com3"));
  11815. }
  11816. onConstruct() {
  11817. this.n2 = (this.getChild("n2"));
  11818. this.n3 = (this.getChild("n3"));
  11819. this.n4 = (this.getChild("n4"));
  11820. this.n5 = (this.getChild("n5"));
  11821. this.t0 = this.getTransition("t0");
  11822. this.t1 = this.getTransition("t1");
  11823. }
  11824. }
  11825. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  11826. class ui_Component97 extends fgui.GComponent {
  11827. static createInstance() {
  11828. return (fgui.UIPackage.createObject("game", "Component97"));
  11829. }
  11830. onConstruct() {
  11831. this.c1 = this.getController("c1");
  11832. this.n46 = (this.getChild("n46"));
  11833. this.diamondNode = (this.getChild("diamondNode"));
  11834. this.coinNode = (this.getChild("coinNode"));
  11835. this.t0 = this.getTransition("t0");
  11836. }
  11837. }
  11838. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  11839. class ui_Component98 extends fgui.GButton {
  11840. static createInstance() {
  11841. return (fgui.UIPackage.createObject("game", "Component98"));
  11842. }
  11843. onConstruct() {
  11844. this.n8 = (this.getChild("n8"));
  11845. this.n40 = (this.getChild("n40"));
  11846. }
  11847. }
  11848. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  11849. class ui_Component28_11 extends fgui.GButton {
  11850. static createInstance() {
  11851. return (fgui.UIPackage.createObject("game", "Component28_11"));
  11852. }
  11853. onConstruct() {
  11854. this.c1 = this.getController("c1");
  11855. this.n12 = (this.getChild("n12"));
  11856. this.n17 = (this.getChild("n17"));
  11857. this.n13 = (this.getChild("n13"));
  11858. this.diamondTxt = (this.getChild("diamondTxt"));
  11859. this.n15 = (this.getChild("n15"));
  11860. this.n16 = (this.getChild("n16"));
  11861. }
  11862. }
  11863. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  11864. class ui_Component58_11 extends fgui.GComponent {
  11865. static createInstance() {
  11866. return (fgui.UIPackage.createObject("game", "Component58_11"));
  11867. }
  11868. onConstruct() {
  11869. this.n23 = (this.getChild("n23"));
  11870. this.n41 = (this.getChild("n41"));
  11871. this.myList = (this.getChild("myList"));
  11872. this.n45 = (this.getChild("n45"));
  11873. this.n44 = (this.getChild("n44"));
  11874. this.t0 = this.getTransition("t0");
  11875. }
  11876. }
  11877. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  11878. class ui_Component100 extends fgui.GComponent {
  11879. static createInstance() {
  11880. return (fgui.UIPackage.createObject("game", "Component100"));
  11881. }
  11882. onConstruct() {
  11883. this.c1 = this.getController("c1");
  11884. this.n75 = (this.getChild("n75"));
  11885. this.n76 = (this.getChild("n76"));
  11886. this.n80 = (this.getChild("n80"));
  11887. this.txt = (this.getChild("txt"));
  11888. this.spineRoot = (this.getChild("spineRoot"));
  11889. }
  11890. }
  11891. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  11892. class ui_Component101 extends fgui.GComponent {
  11893. static createInstance() {
  11894. return (fgui.UIPackage.createObject("game", "Component101"));
  11895. }
  11896. onConstruct() {
  11897. this.c1 = this.getController("c1");
  11898. this.n36 = (this.getChild("n36"));
  11899. this.n35 = (this.getChild("n35"));
  11900. this.n33 = (this.getChild("n33"));
  11901. this.n34 = (this.getChild("n34"));
  11902. }
  11903. }
  11904. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  11905. class ui_Component53 extends fgui.GComponent {
  11906. static createInstance() {
  11907. return (fgui.UIPackage.createObject("game", "Component53"));
  11908. }
  11909. onConstruct() {
  11910. this.n0 = (this.getChild("n0"));
  11911. this.n1 = (this.getChild("n1"));
  11912. this.n2 = (this.getChild("n2"));
  11913. this.n3 = (this.getChild("n3"));
  11914. this.n4 = (this.getChild("n4"));
  11915. this.n5 = (this.getChild("n5"));
  11916. this.n6 = (this.getChild("n6"));
  11917. this.n7 = (this.getChild("n7"));
  11918. this.n8 = (this.getChild("n8"));
  11919. this.n9 = (this.getChild("n9"));
  11920. this.n10 = (this.getChild("n10"));
  11921. this.n11 = (this.getChild("n11"));
  11922. this.n12 = (this.getChild("n12"));
  11923. this.n13 = (this.getChild("n13"));
  11924. this.n14 = (this.getChild("n14"));
  11925. this.n15 = (this.getChild("n15"));
  11926. this.n16 = (this.getChild("n16"));
  11927. this.n19 = (this.getChild("n19"));
  11928. this.n20 = (this.getChild("n20"));
  11929. this.n21 = (this.getChild("n21"));
  11930. this.n22 = (this.getChild("n22"));
  11931. this.n23 = (this.getChild("n23"));
  11932. this.n24 = (this.getChild("n24"));
  11933. this.n25 = (this.getChild("n25"));
  11934. this.n26 = (this.getChild("n26"));
  11935. this.n27 = (this.getChild("n27"));
  11936. this.n28 = (this.getChild("n28"));
  11937. this.n29 = (this.getChild("n29"));
  11938. this.n30 = (this.getChild("n30"));
  11939. this.n31 = (this.getChild("n31"));
  11940. this.n32 = (this.getChild("n32"));
  11941. this.n33 = (this.getChild("n33"));
  11942. this.n34 = (this.getChild("n34"));
  11943. this.n35 = (this.getChild("n35"));
  11944. this.t0 = this.getTransition("t0");
  11945. }
  11946. }
  11947. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  11948. class ui_Component58 extends fgui.GComponent {
  11949. static createInstance() {
  11950. return (fgui.UIPackage.createObject("game", "Component58"));
  11951. }
  11952. onConstruct() {
  11953. this.n23 = (this.getChild("n23"));
  11954. this.n41 = (this.getChild("n41"));
  11955. this.n8 = (this.getChild("n8"));
  11956. this.skillList = (this.getChild("skillList"));
  11957. this.t0 = this.getTransition("t0");
  11958. }
  11959. }
  11960. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  11961. class ui_Component59 extends fgui.GComponent {
  11962. static createInstance() {
  11963. return (fgui.UIPackage.createObject("game", "Component59"));
  11964. }
  11965. onConstruct() {
  11966. this.n3 = (this.getChild("n3"));
  11967. this.msgTxt = (this.getChild("msgTxt"));
  11968. this.t0 = this.getTransition("t0");
  11969. }
  11970. }
  11971. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  11972. class ui_RulerNode extends fgui.GComponent {
  11973. static createInstance() {
  11974. return (fgui.UIPackage.createObject("game", "RulerNode"));
  11975. }
  11976. onConstruct() {
  11977. this.n6 = (this.getChild("n6"));
  11978. this.n4 = (this.getChild("n4"));
  11979. this.img1 = (this.getChild("img1"));
  11980. this.img2 = (this.getChild("img2"));
  11981. }
  11982. }
  11983. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  11984. class ui_Component108 extends fgui.GComponent {
  11985. static createInstance() {
  11986. return (fgui.UIPackage.createObject("game", "Component108"));
  11987. }
  11988. onConstruct() {
  11989. this.n19 = (this.getChild("n19"));
  11990. this.t0 = this.getTransition("t0");
  11991. }
  11992. }
  11993. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  11994. class ui_Component63 extends fgui.GComponent {
  11995. static createInstance() {
  11996. return (fgui.UIPackage.createObject("game", "Component63"));
  11997. }
  11998. onConstruct() {
  11999. this.n66 = (this.getChild("n66"));
  12000. this.n56 = (this.getChild("n56"));
  12001. this.n63 = (this.getChild("n63"));
  12002. this.n65 = (this.getChild("n65"));
  12003. this.t0 = this.getTransition("t0");
  12004. }
  12005. }
  12006. ui_Component63.URL = "ui://isxx5ak7h657452";
  12007. class ui_topNode extends fgui.GComponent {
  12008. static createInstance() {
  12009. return (fgui.UIPackage.createObject("game", "topNode"));
  12010. }
  12011. onConstruct() {
  12012. this.selfProgress = (this.getChild("selfProgress"));
  12013. this.aiProgress = (this.getChild("aiProgress"));
  12014. this.selfKuang = (this.getChild("selfKuang"));
  12015. this.aiKuang = (this.getChild("aiKuang"));
  12016. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  12017. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  12018. this.n33 = (this.getChild("n33"));
  12019. this.n34 = (this.getChild("n34"));
  12020. this.selfNameTxt = (this.getChild("selfNameTxt"));
  12021. this.aiNameTxt = (this.getChild("aiNameTxt"));
  12022. this.selfBallList = (this.getChild("selfBallList"));
  12023. this.aiBallList = (this.getChild("aiBallList"));
  12024. this.middleNode = (this.getChild("middleNode"));
  12025. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  12026. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  12027. this.scoreNode = (this.getChild("scoreNode"));
  12028. this.selfTips = (this.getChild("selfTips"));
  12029. this.aiTips = (this.getChild("aiTips"));
  12030. }
  12031. }
  12032. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  12033. class ui_selfProgress extends fgui.GProgressBar {
  12034. static createInstance() {
  12035. return (fgui.UIPackage.createObject("game", "selfProgress"));
  12036. }
  12037. onConstruct() {
  12038. this.n3 = (this.getChild("n3"));
  12039. this.bar = (this.getChild("bar"));
  12040. }
  12041. }
  12042. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  12043. class ui_aiProgress extends fgui.GProgressBar {
  12044. static createInstance() {
  12045. return (fgui.UIPackage.createObject("game", "aiProgress"));
  12046. }
  12047. onConstruct() {
  12048. this.n3 = (this.getChild("n3"));
  12049. this.bar = (this.getChild("bar"));
  12050. }
  12051. }
  12052. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  12053. class ui_ballDisplay extends fgui.GComponent {
  12054. static createInstance() {
  12055. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  12056. }
  12057. onConstruct() {
  12058. this.myImg = (this.getChild("myImg"));
  12059. }
  12060. }
  12061. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  12062. class ui_moveNode extends fgui.GComponent {
  12063. static createInstance() {
  12064. return (fgui.UIPackage.createObject("game", "moveNode"));
  12065. }
  12066. onConstruct() {
  12067. this.n8 = (this.getChild("n8"));
  12068. this.finger = (this.getChild("finger"));
  12069. }
  12070. }
  12071. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  12072. class ui_cancelBtn extends fgui.GButton {
  12073. static createInstance() {
  12074. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  12075. }
  12076. onConstruct() {
  12077. this.c1 = this.getController("c1");
  12078. this.n0 = (this.getChild("n0"));
  12079. this.n1 = (this.getChild("n1"));
  12080. }
  12081. }
  12082. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  12083. class ui_shareBtn extends fgui.GButton {
  12084. static createInstance() {
  12085. return (fgui.UIPackage.createObject("game", "shareBtn"));
  12086. }
  12087. onConstruct() {
  12088. this.c1 = this.getController("c1");
  12089. this.n2 = (this.getChild("n2"));
  12090. this.n1 = (this.getChild("n1"));
  12091. this.n3 = (this.getChild("n3"));
  12092. this.n4 = (this.getChild("n4"));
  12093. this.n5 = (this.getChild("n5"));
  12094. this.n6 = (this.getChild("n6"));
  12095. }
  12096. }
  12097. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  12098. class ui_share2Btn extends fgui.GButton {
  12099. static createInstance() {
  12100. return (fgui.UIPackage.createObject("game", "share2Btn"));
  12101. }
  12102. onConstruct() {
  12103. this.n3 = (this.getChild("n3"));
  12104. }
  12105. }
  12106. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  12107. class ui_rodMethodNode extends fgui.GComponent {
  12108. static createInstance() {
  12109. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  12110. }
  12111. onConstruct() {
  12112. this.bg = (this.getChild("bg"));
  12113. this.dot = (this.getChild("dot"));
  12114. }
  12115. }
  12116. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  12117. class ui_sureBtn extends fgui.GButton {
  12118. static createInstance() {
  12119. return (fgui.UIPackage.createObject("game", "sureBtn"));
  12120. }
  12121. onConstruct() {
  12122. this.n2 = (this.getChild("n2"));
  12123. this.n1 = (this.getChild("n1"));
  12124. }
  12125. }
  12126. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  12127. class ui_Component18 extends fgui.GComponent {
  12128. static createInstance() {
  12129. return (fgui.UIPackage.createObject("game", "Component18"));
  12130. }
  12131. onConstruct() {
  12132. this.c1 = this.getController("c1");
  12133. this.nameTxt = (this.getChild("nameTxt"));
  12134. this.headImg = (this.getChild("headImg"));
  12135. this.n24 = (this.getChild("n24"));
  12136. this.skillImg = (this.getChild("skillImg"));
  12137. this.skillTxt = (this.getChild("skillTxt"));
  12138. }
  12139. }
  12140. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  12141. class ui_Component45 extends fgui.GComponent {
  12142. static createInstance() {
  12143. return (fgui.UIPackage.createObject("game", "Component45"));
  12144. }
  12145. onConstruct() {
  12146. this.c1 = this.getController("c1");
  12147. this.n40 = (this.getChild("n40"));
  12148. this.n41 = (this.getChild("n41"));
  12149. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  12150. this.n42 = (this.getChild("n42"));
  12151. this.awardTxt = (this.getChild("awardTxt"));
  12152. this.n44 = (this.getChild("n44"));
  12153. this.t0 = this.getTransition("t0");
  12154. }
  12155. }
  12156. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  12157. class ui_emotionDisplay extends fgui.GButton {
  12158. static createInstance() {
  12159. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  12160. }
  12161. onConstruct() {
  12162. this.myIcon = (this.getChild("myIcon"));
  12163. }
  12164. }
  12165. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  12166. class ui_Component49 extends fgui.GButton {
  12167. static createInstance() {
  12168. return (fgui.UIPackage.createObject("game", "Component49"));
  12169. }
  12170. onConstruct() {
  12171. this.n69 = (this.getChild("n69"));
  12172. this.n56 = (this.getChild("n56"));
  12173. }
  12174. }
  12175. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  12176. class ui_Component50 extends fgui.GButton {
  12177. static createInstance() {
  12178. return (fgui.UIPackage.createObject("game", "Component50"));
  12179. }
  12180. onConstruct() {
  12181. this.n54 = (this.getChild("n54"));
  12182. this.n65 = (this.getChild("n65"));
  12183. }
  12184. }
  12185. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  12186. class ui_Component51 extends fgui.GButton {
  12187. static createInstance() {
  12188. return (fgui.UIPackage.createObject("game", "Component51"));
  12189. }
  12190. onConstruct() {
  12191. this.c1 = this.getController("c1");
  12192. this.n51 = (this.getChild("n51"));
  12193. this.n54 = (this.getChild("n54"));
  12194. }
  12195. }
  12196. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  12197. class ui_Button5 extends fgui.GButton {
  12198. static createInstance() {
  12199. return (fgui.UIPackage.createObject("game", "Button5"));
  12200. }
  12201. onConstruct() {
  12202. this.c1 = this.getController("c1");
  12203. this.n0 = (this.getChild("n0"));
  12204. this.n2 = (this.getChild("n2"));
  12205. }
  12206. }
  12207. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  12208. class ui_Component124 extends fgui.GComponent {
  12209. static createInstance() {
  12210. return (fgui.UIPackage.createObject("game", "Component124"));
  12211. }
  12212. onConstruct() {
  12213. this.n22 = (this.getChild("n22"));
  12214. this.shareNode = (this.getChild("shareNode"));
  12215. }
  12216. }
  12217. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  12218. class ui_Component125 extends fgui.GComponent {
  12219. static createInstance() {
  12220. return (fgui.UIPackage.createObject("game", "Component125"));
  12221. }
  12222. onConstruct() {
  12223. this.n29 = (this.getChild("n29"));
  12224. this.coinTxt = (this.getChild("coinTxt"));
  12225. }
  12226. }
  12227. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  12228. class ui_Component52 extends fgui.GButton {
  12229. static createInstance() {
  12230. return (fgui.UIPackage.createObject("game", "Component52"));
  12231. }
  12232. onConstruct() {
  12233. this.n35 = (this.getChild("n35"));
  12234. this.n36 = (this.getChild("n36"));
  12235. }
  12236. }
  12237. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  12238. class ui_drawBtn extends fgui.GButton {
  12239. static createInstance() {
  12240. return (fgui.UIPackage.createObject("game", "drawBtn"));
  12241. }
  12242. onConstruct() {
  12243. this.c1 = this.getController("c1");
  12244. this.n2 = (this.getChild("n2"));
  12245. this.n1 = (this.getChild("n1"));
  12246. }
  12247. }
  12248. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  12249. class ui_Component43 extends fgui.GButton {
  12250. static createInstance() {
  12251. return (fgui.UIPackage.createObject("game", "Component43"));
  12252. }
  12253. onConstruct() {
  12254. this.n49 = (this.getChild("n49"));
  12255. }
  12256. }
  12257. ui_Component43.URL = "ui://isxx5ak7iveg434";
  12258. class ui_wordsDisplay extends fgui.GComponent {
  12259. static createInstance() {
  12260. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  12261. }
  12262. onConstruct() {
  12263. this.txt = (this.getChild("txt"));
  12264. this.n63 = (this.getChild("n63"));
  12265. }
  12266. }
  12267. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  12268. class ui_Component3 extends fgui.GComponent {
  12269. static createInstance() {
  12270. return (fgui.UIPackage.createObject("game", "Component3"));
  12271. }
  12272. onConstruct() {
  12273. this.n26 = (this.getChild("n26"));
  12274. this.n24 = (this.getChild("n24"));
  12275. this.nameTxt = (this.getChild("nameTxt"));
  12276. this.headRoot = (this.getChild("headRoot"));
  12277. }
  12278. }
  12279. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  12280. class ui_Component4 extends fgui.GComponent {
  12281. static createInstance() {
  12282. return (fgui.UIPackage.createObject("game", "Component4"));
  12283. }
  12284. onConstruct() {
  12285. this.headImg = (this.getChild("headImg"));
  12286. }
  12287. }
  12288. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  12289. class ui_Component7 extends fgui.GButton {
  12290. static createInstance() {
  12291. return (fgui.UIPackage.createObject("game", "Component7"));
  12292. }
  12293. onConstruct() {
  12294. this.n17 = (this.getChild("n17"));
  12295. }
  12296. }
  12297. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  12298. class ui_Component8 extends fgui.GButton {
  12299. static createInstance() {
  12300. return (fgui.UIPackage.createObject("game", "Component8"));
  12301. }
  12302. onConstruct() {
  12303. this.n19 = (this.getChild("n19"));
  12304. }
  12305. }
  12306. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  12307. class ui_Component9 extends fgui.GButton {
  12308. static createInstance() {
  12309. return (fgui.UIPackage.createObject("game", "Component9"));
  12310. }
  12311. onConstruct() {
  12312. this.n18 = (this.getChild("n18"));
  12313. }
  12314. }
  12315. ui_Component9.URL = "ui://isxx5ak7ixm43xs";
  12316. class ui_Component10 extends fgui.GButton {
  12317. static createInstance() {
  12318. return (fgui.UIPackage.createObject("game", "Component10"));
  12319. }
  12320. onConstruct() {
  12321. this.c1 = this.getController("c1");
  12322. this.n40 = (this.getChild("n40"));
  12323. }
  12324. }
  12325. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  12326. class ui_Component11 extends fgui.GButton {
  12327. static createInstance() {
  12328. return (fgui.UIPackage.createObject("game", "Component11"));
  12329. }
  12330. onConstruct() {
  12331. this.n34 = (this.getChild("n34"));
  12332. }
  12333. }
  12334. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  12335. class ui_Component12 extends fgui.GButton {
  12336. static createInstance() {
  12337. return (fgui.UIPackage.createObject("game", "Component12"));
  12338. }
  12339. onConstruct() {
  12340. this.n35 = (this.getChild("n35"));
  12341. }
  12342. }
  12343. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  12344. class ui_Component13 extends fgui.GButton {
  12345. static createInstance() {
  12346. return (fgui.UIPackage.createObject("game", "Component13"));
  12347. }
  12348. onConstruct() {
  12349. this.n27 = (this.getChild("n27"));
  12350. this.n36 = (this.getChild("n36"));
  12351. }
  12352. }
  12353. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  12354. class ui_Component16 extends fgui.GButton {
  12355. static createInstance() {
  12356. return (fgui.UIPackage.createObject("game", "Component16"));
  12357. }
  12358. onConstruct() {
  12359. }
  12360. }
  12361. ui_Component16.URL = "ui://isxx5ak7ixm43xz";
  12362. class ui_dh_js_tuowei extends fgui.GComponent {
  12363. static createInstance() {
  12364. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  12365. }
  12366. onConstruct() {
  12367. this.n19 = (this.getChild("n19"));
  12368. this.n18 = (this.getChild("n18"));
  12369. this.n0 = (this.getChild("n0"));
  12370. this.n3 = (this.getChild("n3"));
  12371. this.n4 = (this.getChild("n4"));
  12372. this.n5 = (this.getChild("n5"));
  12373. this.n6 = (this.getChild("n6"));
  12374. this.n8 = (this.getChild("n8"));
  12375. this.n9 = (this.getChild("n9"));
  12376. this.n10 = (this.getChild("n10"));
  12377. this.n11 = (this.getChild("n11"));
  12378. this.n12 = (this.getChild("n12"));
  12379. this.n13 = (this.getChild("n13"));
  12380. this.n14 = (this.getChild("n14"));
  12381. this.n15 = (this.getChild("n15"));
  12382. this.n20 = (this.getChild("n20"));
  12383. this.t0 = this.getTransition("t0");
  12384. this.t1 = this.getTransition("t1");
  12385. }
  12386. }
  12387. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  12388. class ui_dh_js_tw_g extends fgui.GComponent {
  12389. static createInstance() {
  12390. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  12391. }
  12392. onConstruct() {
  12393. this.n0 = (this.getChild("n0"));
  12394. this.n1 = (this.getChild("n1"));
  12395. this.t0 = this.getTransition("t0");
  12396. }
  12397. }
  12398. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  12399. class ui_dh_js_xingxing extends fgui.GComponent {
  12400. static createInstance() {
  12401. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  12402. }
  12403. onConstruct() {
  12404. this.n1 = (this.getChild("n1"));
  12405. this.n2 = (this.getChild("n2"));
  12406. this.n3 = (this.getChild("n3"));
  12407. this.n4 = (this.getChild("n4"));
  12408. this.n0 = (this.getChild("n0"));
  12409. this.t2 = this.getTransition("t2");
  12410. this.t1 = this.getTransition("t1");
  12411. }
  12412. }
  12413. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  12414. class ui_dh_zy_jiazai extends fgui.GComponent {
  12415. static createInstance() {
  12416. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  12417. }
  12418. onConstruct() {
  12419. this.c1 = this.getController("c1");
  12420. this.n0 = (this.getChild("n0"));
  12421. this.n1 = (this.getChild("n1"));
  12422. this.n2 = (this.getChild("n2"));
  12423. this.n4 = (this.getChild("n4"));
  12424. this.n5 = (this.getChild("n5"));
  12425. this.n6 = (this.getChild("n6"));
  12426. this.n8 = (this.getChild("n8"));
  12427. this.n7 = (this.getChild("n7"));
  12428. this.t0 = this.getTransition("t0");
  12429. }
  12430. }
  12431. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  12432. class ui_dh_js_xingxing2 extends fgui.GComponent {
  12433. static createInstance() {
  12434. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  12435. }
  12436. onConstruct() {
  12437. this.c1 = this.getController("c1");
  12438. this.n3 = (this.getChild("n3"));
  12439. this.n5 = (this.getChild("n5"));
  12440. this.n4 = (this.getChild("n4"));
  12441. this.n0 = (this.getChild("n0"));
  12442. this.n1 = (this.getChild("n1"));
  12443. this.n2 = (this.getChild("n2"));
  12444. }
  12445. }
  12446. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  12447. class ui_dh_js_tuowei2 extends fgui.GComponent {
  12448. static createInstance() {
  12449. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  12450. }
  12451. onConstruct() {
  12452. this.n19 = (this.getChild("n19"));
  12453. this.n21 = (this.getChild("n21"));
  12454. this.n0 = (this.getChild("n0"));
  12455. this.n3 = (this.getChild("n3"));
  12456. this.n4 = (this.getChild("n4"));
  12457. this.n5 = (this.getChild("n5"));
  12458. this.n6 = (this.getChild("n6"));
  12459. this.n8 = (this.getChild("n8"));
  12460. this.n9 = (this.getChild("n9"));
  12461. this.n10 = (this.getChild("n10"));
  12462. this.n11 = (this.getChild("n11"));
  12463. this.n12 = (this.getChild("n12"));
  12464. this.n13 = (this.getChild("n13"));
  12465. this.n14 = (this.getChild("n14"));
  12466. this.n15 = (this.getChild("n15"));
  12467. this.n23 = (this.getChild("n23"));
  12468. this.t0 = this.getTransition("t0");
  12469. this.t1 = this.getTransition("t1");
  12470. }
  12471. }
  12472. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  12473. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  12474. static createInstance() {
  12475. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  12476. }
  12477. onConstruct() {
  12478. this.n1 = (this.getChild("n1"));
  12479. this.n2 = (this.getChild("n2"));
  12480. this.t0 = this.getTransition("t0");
  12481. }
  12482. }
  12483. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  12484. class ui_dh_js_shibai_1 extends fgui.GComponent {
  12485. static createInstance() {
  12486. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  12487. }
  12488. onConstruct() {
  12489. this.n4 = (this.getChild("n4"));
  12490. this.n2 = (this.getChild("n2"));
  12491. this.n3 = (this.getChild("n3"));
  12492. this.idle = this.getTransition("idle");
  12493. this.attack = this.getTransition("attack");
  12494. }
  12495. }
  12496. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  12497. class ui_special extends fgui.GComponent {
  12498. static createInstance() {
  12499. return (fgui.UIPackage.createObject("game", "special"));
  12500. }
  12501. onConstruct() {
  12502. this.n18 = (this.getChild("n18"));
  12503. this.n19 = (this.getChild("n19"));
  12504. this.n20 = (this.getChild("n20"));
  12505. this.n21 = (this.getChild("n21"));
  12506. this.n22 = (this.getChild("n22"));
  12507. this.levelTxt = (this.getChild("levelTxt"));
  12508. this.n24 = (this.getChild("n24"));
  12509. this.n25 = (this.getChild("n25"));
  12510. this.t0 = this.getTransition("t0");
  12511. }
  12512. }
  12513. ui_special.URL = "ui://isxx5ak7j979v4i6";
  12514. class ui_Component145 extends fgui.GComponent {
  12515. static createInstance() {
  12516. return (fgui.UIPackage.createObject("game", "Component145"));
  12517. }
  12518. onConstruct() {
  12519. this.guanyuNode = (this.getChild("guanyuNode"));
  12520. }
  12521. }
  12522. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  12523. class ui_longBtn extends fgui.GButton {
  12524. static createInstance() {
  12525. return (fgui.UIPackage.createObject("game", "longBtn"));
  12526. }
  12527. onConstruct() {
  12528. this.c1 = this.getController("c1");
  12529. this.n2 = (this.getChild("n2"));
  12530. this.n1 = (this.getChild("n1"));
  12531. this.n4 = (this.getChild("n4"));
  12532. }
  12533. }
  12534. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  12535. class ui_Component146 extends fgui.GComponent {
  12536. static createInstance() {
  12537. return (fgui.UIPackage.createObject("game", "Component146"));
  12538. }
  12539. onConstruct() {
  12540. this.n89 = (this.getChild("n89"));
  12541. this.n90 = (this.getChild("n90"));
  12542. this.guideBtn = (this.getChild("guideBtn"));
  12543. }
  12544. }
  12545. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  12546. class ui_Component146_11 extends fgui.GComponent {
  12547. static createInstance() {
  12548. return (fgui.UIPackage.createObject("game", "Component146_11"));
  12549. }
  12550. onConstruct() {
  12551. this.n89 = (this.getChild("n89"));
  12552. this.n90 = (this.getChild("n90"));
  12553. this.guideBtn = (this.getChild("guideBtn"));
  12554. }
  12555. }
  12556. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  12557. class ui_Component111_1 extends fgui.GComponent {
  12558. static createInstance() {
  12559. return (fgui.UIPackage.createObject("game", "Component111_1"));
  12560. }
  12561. onConstruct() {
  12562. this.n68 = (this.getChild("n68"));
  12563. this.myMask = (this.getChild("myMask"));
  12564. }
  12565. }
  12566. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  12567. class ui_Component64_1 extends fgui.GComponent {
  12568. static createInstance() {
  12569. return (fgui.UIPackage.createObject("game", "Component64_1"));
  12570. }
  12571. onConstruct() {
  12572. this.n57 = (this.getChild("n57"));
  12573. this.n54 = (this.getChild("n54"));
  12574. this.n55 = (this.getChild("n55"));
  12575. this.n56 = (this.getChild("n56"));
  12576. this.t1 = this.getTransition("t1");
  12577. }
  12578. }
  12579. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  12580. class ui_ModeSelection_com123 extends fgui.GComponent {
  12581. static createInstance() {
  12582. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  12583. }
  12584. onConstruct() {
  12585. this.type1 = (this.getChild("type1"));
  12586. this.type2 = (this.getChild("type2"));
  12587. this.type3 = (this.getChild("type3"));
  12588. this.n38 = (this.getChild("n38"));
  12589. this.t0 = this.getTransition("t0");
  12590. }
  12591. }
  12592. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  12593. class ui_Component132_2 extends fgui.GComponent {
  12594. static createInstance() {
  12595. return (fgui.UIPackage.createObject("game", "Component132_2"));
  12596. }
  12597. onConstruct() {
  12598. this.n25 = (this.getChild("n25"));
  12599. this.n26 = (this.getChild("n26"));
  12600. this.n27 = (this.getChild("n27"));
  12601. this.t0 = this.getTransition("t0");
  12602. }
  12603. }
  12604. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  12605. class ui_UIPower$1 extends fgui.GComponent {
  12606. static createInstance() {
  12607. return (fgui.UIPackage.createObject("game", "UIPower"));
  12608. }
  12609. onConstruct() {
  12610. this.n11 = (this.getChild("n11"));
  12611. this.myNode = (this.getChild("myNode"));
  12612. this.t0 = this.getTransition("t0");
  12613. }
  12614. }
  12615. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  12616. class ui_Component133 extends fgui.GComponent {
  12617. static createInstance() {
  12618. return (fgui.UIPackage.createObject("game", "Component133"));
  12619. }
  12620. onConstruct() {
  12621. this.n29 = (this.getChild("n29"));
  12622. this.n30 = (this.getChild("n30"));
  12623. }
  12624. }
  12625. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  12626. class ui_Component134 extends fgui.GComponent {
  12627. static createInstance() {
  12628. return (fgui.UIPackage.createObject("game", "Component134"));
  12629. }
  12630. onConstruct() {
  12631. this.n30 = (this.getChild("n30"));
  12632. this.n31 = (this.getChild("n31"));
  12633. this.t0 = this.getTransition("t0");
  12634. }
  12635. }
  12636. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  12637. class ui_Component135 extends fgui.GComponent {
  12638. static createInstance() {
  12639. return (fgui.UIPackage.createObject("game", "Component135"));
  12640. }
  12641. onConstruct() {
  12642. this.n30 = (this.getChild("n30"));
  12643. this.t0 = this.getTransition("t0");
  12644. }
  12645. }
  12646. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  12647. class ui_Component137 extends fgui.GComponent {
  12648. static createInstance() {
  12649. return (fgui.UIPackage.createObject("game", "Component137"));
  12650. }
  12651. onConstruct() {
  12652. this.n28 = (this.getChild("n28"));
  12653. this.n29 = (this.getChild("n29"));
  12654. this.n30 = (this.getChild("n30"));
  12655. this.n32 = (this.getChild("n32"));
  12656. }
  12657. }
  12658. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  12659. class ui_dh_zuanshi extends fgui.GButton {
  12660. static createInstance() {
  12661. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  12662. }
  12663. onConstruct() {
  12664. this.n1 = (this.getChild("n1"));
  12665. this.n2 = (this.getChild("n2"));
  12666. this.n0 = (this.getChild("n0"));
  12667. this.n3 = (this.getChild("n3"));
  12668. this.n4 = (this.getChild("n4"));
  12669. }
  12670. }
  12671. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  12672. class ui_Component138 extends fgui.GComponent {
  12673. static createInstance() {
  12674. return (fgui.UIPackage.createObject("game", "Component138"));
  12675. }
  12676. onConstruct() {
  12677. this.n1 = (this.getChild("n1"));
  12678. this.n2 = (this.getChild("n2"));
  12679. this.t0 = this.getTransition("t0");
  12680. }
  12681. }
  12682. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  12683. class ui_Component139 extends fgui.GComponent {
  12684. static createInstance() {
  12685. return (fgui.UIPackage.createObject("game", "Component139"));
  12686. }
  12687. onConstruct() {
  12688. this.n0 = (this.getChild("n0"));
  12689. this.t0 = this.getTransition("t0");
  12690. }
  12691. }
  12692. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  12693. class ui_Component140 extends fgui.GComponent {
  12694. static createInstance() {
  12695. return (fgui.UIPackage.createObject("game", "Component140"));
  12696. }
  12697. onConstruct() {
  12698. this.n2 = (this.getChild("n2"));
  12699. this.n3 = (this.getChild("n3"));
  12700. this.t0 = this.getTransition("t0");
  12701. }
  12702. }
  12703. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  12704. class ui_Component141 extends fgui.GComponent {
  12705. static createInstance() {
  12706. return (fgui.UIPackage.createObject("game", "Component141"));
  12707. }
  12708. onConstruct() {
  12709. this.n0 = (this.getChild("n0"));
  12710. this.t0 = this.getTransition("t0");
  12711. }
  12712. }
  12713. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  12714. class ui_powerNode extends fgui.GProgressBar {
  12715. static createInstance() {
  12716. return (fgui.UIPackage.createObject("game", "powerNode"));
  12717. }
  12718. onConstruct() {
  12719. this.n2 = (this.getChild("n2"));
  12720. this.bar_v = (this.getChild("bar_v"));
  12721. this.showImg = (this.getChild("showImg"));
  12722. this.n12 = (this.getChild("n12"));
  12723. }
  12724. }
  12725. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  12726. class ui_dh_jingbi1 extends fgui.GComponent {
  12727. static createInstance() {
  12728. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  12729. }
  12730. onConstruct() {
  12731. this.n0 = (this.getChild("n0"));
  12732. this.n1 = (this.getChild("n1"));
  12733. this.n2 = (this.getChild("n2"));
  12734. this.n3 = (this.getChild("n3"));
  12735. this.n4 = (this.getChild("n4"));
  12736. this.n5 = (this.getChild("n5"));
  12737. this.n6 = (this.getChild("n6"));
  12738. this.n8 = (this.getChild("n8"));
  12739. this.t0 = this.getTransition("t0");
  12740. }
  12741. }
  12742. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  12743. class ui_Component94 extends fgui.GButton {
  12744. static createInstance() {
  12745. return (fgui.UIPackage.createObject("game", "Component94"));
  12746. }
  12747. onConstruct() {
  12748. this.n77 = (this.getChild("n77"));
  12749. }
  12750. }
  12751. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  12752. class ui_Component95 extends fgui.GButton {
  12753. static createInstance() {
  12754. return (fgui.UIPackage.createObject("game", "Component95"));
  12755. }
  12756. onConstruct() {
  12757. this.n77 = (this.getChild("n77"));
  12758. }
  12759. }
  12760. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  12761. class ui_Component126 extends fgui.GComponent {
  12762. static createInstance() {
  12763. return (fgui.UIPackage.createObject("game", "Component126"));
  12764. }
  12765. onConstruct() {
  12766. this.c1 = this.getController("c1");
  12767. this.normalBtn = (this.getChild("normalBtn"));
  12768. this.tripleBtn = (this.getChild("tripleBtn"));
  12769. }
  12770. }
  12771. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  12772. class ui_Component60 extends fgui.GComponent {
  12773. static createInstance() {
  12774. return (fgui.UIPackage.createObject("game", "Component60"));
  12775. }
  12776. onConstruct() {
  12777. this.c1 = this.getController("c1");
  12778. this.n48 = (this.getChild("n48"));
  12779. this.womanTxt = (this.getChild("womanTxt"));
  12780. this.t0 = this.getTransition("t0");
  12781. }
  12782. }
  12783. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  12784. class ui_Component98_3 extends fgui.GButton {
  12785. static createInstance() {
  12786. return (fgui.UIPackage.createObject("game", "Component98_3"));
  12787. }
  12788. onConstruct() {
  12789. this.c1 = this.getController("c1");
  12790. this.n8 = (this.getChild("n8"));
  12791. this.n41 = (this.getChild("n41"));
  12792. this.n40 = (this.getChild("n40"));
  12793. }
  12794. }
  12795. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  12796. class ui_ModeSelection_com1 extends fgui.GButton {
  12797. static createInstance() {
  12798. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  12799. }
  12800. onConstruct() {
  12801. this.n34 = (this.getChild("n34"));
  12802. this.n36 = (this.getChild("n36"));
  12803. this.n22 = (this.getChild("n22"));
  12804. this.n20 = (this.getChild("n20"));
  12805. this.n23 = (this.getChild("n23"));
  12806. this.n24 = (this.getChild("n24"));
  12807. this.n26 = (this.getChild("n26"));
  12808. this.n33 = (this.getChild("n33"));
  12809. this.coinImg = (this.getChild("coinImg"));
  12810. this.need = (this.getChild("need"));
  12811. this.n35 = (this.getChild("n35"));
  12812. this.n29 = (this.getChild("n29"));
  12813. this.tipsTxt = (this.getChild("tipsTxt"));
  12814. this.n30 = (this.getChild("n30"));
  12815. this.peopleTxt = (this.getChild("peopleTxt"));
  12816. this.t0 = this.getTransition("t0");
  12817. }
  12818. }
  12819. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  12820. class ui_ModeSelection_com2 extends fgui.GButton {
  12821. static createInstance() {
  12822. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  12823. }
  12824. onConstruct() {
  12825. this.n36 = (this.getChild("n36"));
  12826. this.n34 = (this.getChild("n34"));
  12827. this.n22 = (this.getChild("n22"));
  12828. this.n20 = (this.getChild("n20"));
  12829. this.n23 = (this.getChild("n23"));
  12830. this.n24 = (this.getChild("n24"));
  12831. this.n26 = (this.getChild("n26"));
  12832. this.n33 = (this.getChild("n33"));
  12833. this.coinImg = (this.getChild("coinImg"));
  12834. this.need = (this.getChild("need"));
  12835. this.n35 = (this.getChild("n35"));
  12836. this.n29 = (this.getChild("n29"));
  12837. this.tipsTxt = (this.getChild("tipsTxt"));
  12838. this.n30 = (this.getChild("n30"));
  12839. this.peopleTxt = (this.getChild("peopleTxt"));
  12840. this.t0 = this.getTransition("t0");
  12841. }
  12842. }
  12843. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  12844. class ui_ModeSelection_com3 extends fgui.GButton {
  12845. static createInstance() {
  12846. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  12847. }
  12848. onConstruct() {
  12849. this.n34 = (this.getChild("n34"));
  12850. this.n36 = (this.getChild("n36"));
  12851. this.n22 = (this.getChild("n22"));
  12852. this.n20 = (this.getChild("n20"));
  12853. this.n23 = (this.getChild("n23"));
  12854. this.n24 = (this.getChild("n24"));
  12855. this.n26 = (this.getChild("n26"));
  12856. this.n33 = (this.getChild("n33"));
  12857. this.coinImg = (this.getChild("coinImg"));
  12858. this.need = (this.getChild("need"));
  12859. this.n35 = (this.getChild("n35"));
  12860. this.n29 = (this.getChild("n29"));
  12861. this.tipsTxt = (this.getChild("tipsTxt"));
  12862. this.n30 = (this.getChild("n30"));
  12863. this.peopleTxt = (this.getChild("peopleTxt"));
  12864. this.t0 = this.getTransition("t0");
  12865. }
  12866. }
  12867. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  12868. class ui_Invitation_com1 extends fgui.GComponent {
  12869. static createInstance() {
  12870. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  12871. }
  12872. onConstruct() {
  12873. this.n14 = (this.getChild("n14"));
  12874. this.n13 = (this.getChild("n13"));
  12875. this.n3 = (this.getChild("n3"));
  12876. this.n1 = (this.getChild("n1"));
  12877. this.n6 = (this.getChild("n6"));
  12878. this.n7 = (this.getChild("n7"));
  12879. this.enterBtn = (this.getChild("enterBtn"));
  12880. this.n11 = (this.getChild("n11"));
  12881. this.n12 = (this.getChild("n12"));
  12882. this.n15 = (this.getChild("n15"));
  12883. this.t0 = this.getTransition("t0");
  12884. this.t1 = this.getTransition("t1");
  12885. }
  12886. }
  12887. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  12888. class ui_Component87_1 extends fgui.GComponent {
  12889. static createInstance() {
  12890. return (fgui.UIPackage.createObject("game", "Component87_1"));
  12891. }
  12892. onConstruct() {
  12893. this.n74 = (this.getChild("n74"));
  12894. this.n73 = (this.getChild("n73"));
  12895. this.ballTxt = (this.getChild("ballTxt"));
  12896. this.n76 = (this.getChild("n76"));
  12897. this.helpLineBtn = (this.getChild("helpLineBtn"));
  12898. this.levelTxt = (this.getChild("levelTxt"));
  12899. this.n87 = (this.getChild("n87"));
  12900. this.n84 = (this.getChild("n84"));
  12901. this.hpTxt = (this.getChild("hpTxt"));
  12902. this.n89 = (this.getChild("n89"));
  12903. this.tipsTxt = (this.getChild("tipsTxt"));
  12904. }
  12905. }
  12906. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  12907. class ui_sqg1 extends fgui.GComponent {
  12908. static createInstance() {
  12909. return (fgui.UIPackage.createObject("game", "sqg1"));
  12910. }
  12911. onConstruct() {
  12912. this.n1 = (this.getChild("n1"));
  12913. this.n0 = (this.getChild("n0"));
  12914. }
  12915. }
  12916. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  12917. class ui_sqg2 extends fgui.GComponent {
  12918. static createInstance() {
  12919. return (fgui.UIPackage.createObject("game", "sqg2"));
  12920. }
  12921. onConstruct() {
  12922. this.n1 = (this.getChild("n1"));
  12923. this.n0 = (this.getChild("n0"));
  12924. }
  12925. }
  12926. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  12927. class ui_sqg3 extends fgui.GComponent {
  12928. static createInstance() {
  12929. return (fgui.UIPackage.createObject("game", "sqg3"));
  12930. }
  12931. onConstruct() {
  12932. this.n1 = (this.getChild("n1"));
  12933. this.n0 = (this.getChild("n0"));
  12934. }
  12935. }
  12936. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  12937. class ui_sqg4 extends fgui.GComponent {
  12938. static createInstance() {
  12939. return (fgui.UIPackage.createObject("game", "sqg4"));
  12940. }
  12941. onConstruct() {
  12942. this.n1 = (this.getChild("n1"));
  12943. this.n0 = (this.getChild("n0"));
  12944. }
  12945. }
  12946. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  12947. class ui_Component36 extends fgui.GButton {
  12948. static createInstance() {
  12949. return (fgui.UIPackage.createObject("game", "Component36"));
  12950. }
  12951. onConstruct() {
  12952. this.c1 = this.getController("c1");
  12953. this.n53 = (this.getChild("n53"));
  12954. this.n56 = (this.getChild("n56"));
  12955. }
  12956. }
  12957. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  12958. class ui_Component37 extends fgui.GButton {
  12959. static createInstance() {
  12960. return (fgui.UIPackage.createObject("game", "Component37"));
  12961. }
  12962. onConstruct() {
  12963. this.c1 = this.getController("c1");
  12964. this.n52 = (this.getChild("n52"));
  12965. this.n54 = (this.getChild("n54"));
  12966. }
  12967. }
  12968. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  12969. class ui_UISetting extends fgui.GComponent {
  12970. static createInstance() {
  12971. return (fgui.UIPackage.createObject("game", "UISetting"));
  12972. }
  12973. onConstruct() {
  12974. this.c1 = this.getController("c1");
  12975. this.n4 = (this.getChild("n4"));
  12976. this.soundBtn = (this.getChild("soundBtn"));
  12977. this.shakeBtn = (this.getChild("shakeBtn"));
  12978. this.clickNode = (this.getChild("clickNode"));
  12979. this.xyBtn = (this.getChild("xyBtn"));
  12980. }
  12981. }
  12982. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  12983. class ui_Component39 extends fgui.GComponent {
  12984. static createInstance() {
  12985. return (fgui.UIPackage.createObject("game", "Component39"));
  12986. }
  12987. onConstruct() {
  12988. this.n5 = (this.getChild("n5"));
  12989. this.n6 = (this.getChild("n6"));
  12990. this.n7 = (this.getChild("n7"));
  12991. this.t0 = this.getTransition("t0");
  12992. }
  12993. }
  12994. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  12995. class ui_Component40 extends fgui.GButton {
  12996. static createInstance() {
  12997. return (fgui.UIPackage.createObject("game", "Component40"));
  12998. }
  12999. onConstruct() {
  13000. this.n46 = (this.getChild("n46"));
  13001. this.n47 = (this.getChild("n47"));
  13002. }
  13003. }
  13004. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  13005. class ui_Component41 extends fgui.GComponent {
  13006. static createInstance() {
  13007. return (fgui.UIPackage.createObject("game", "Component41"));
  13008. }
  13009. onConstruct() {
  13010. this.c1 = this.getController("c1");
  13011. this.n0 = (this.getChild("n0"));
  13012. this.titleTxt = (this.getChild("titleTxt"));
  13013. this.n2 = (this.getChild("n2"));
  13014. this.msgTips = (this.getChild("msgTips"));
  13015. this.numTxt = (this.getChild("numTxt"));
  13016. this.n18 = (this.getChild("n18"));
  13017. this.cancelBtn = (this.getChild("cancelBtn"));
  13018. this.videoBtn = (this.getChild("videoBtn"));
  13019. this.n10 = (this.getChild("n10"));
  13020. }
  13021. }
  13022. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  13023. class ui_Component42 extends fgui.GComponent {
  13024. static createInstance() {
  13025. return (fgui.UIPackage.createObject("game", "Component42"));
  13026. }
  13027. onConstruct() {
  13028. this.c1 = this.getController("c1");
  13029. this.n1 = (this.getChild("n1"));
  13030. this.n2 = (this.getChild("n2"));
  13031. this.n3 = (this.getChild("n3"));
  13032. this.tipsTxt = (this.getChild("tipsTxt"));
  13033. this.cancelBtn = (this.getChild("cancelBtn"));
  13034. this.sureBtn = (this.getChild("sureBtn"));
  13035. this.n11 = (this.getChild("n11"));
  13036. this.n13 = (this.getChild("n13"));
  13037. this.n14 = (this.getChild("n14"));
  13038. this.womanTxt = (this.getChild("womanTxt"));
  13039. this.t0 = this.getTransition("t0");
  13040. }
  13041. }
  13042. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  13043. class ui_dh_js_shengli extends fgui.GComponent {
  13044. static createInstance() {
  13045. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  13046. }
  13047. onConstruct() {
  13048. this.n3 = (this.getChild("n3"));
  13049. this.n4 = (this.getChild("n4"));
  13050. this.n1 = (this.getChild("n1"));
  13051. this.n2 = (this.getChild("n2"));
  13052. this.n5 = (this.getChild("n5"));
  13053. this.n6 = (this.getChild("n6"));
  13054. this.n7 = (this.getChild("n7"));
  13055. this.n8 = (this.getChild("n8"));
  13056. this.attack = this.getTransition("attack");
  13057. this.idle = this.getTransition("idle");
  13058. }
  13059. }
  13060. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  13061. class ui_dh_js_shengli_g extends fgui.GComponent {
  13062. static createInstance() {
  13063. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  13064. }
  13065. onConstruct() {
  13066. this.n3 = (this.getChild("n3"));
  13067. this.n1 = (this.getChild("n1"));
  13068. this.t0 = this.getTransition("t0");
  13069. }
  13070. }
  13071. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  13072. class ui_dh_js_shibai extends fgui.GComponent {
  13073. static createInstance() {
  13074. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  13075. }
  13076. onConstruct() {
  13077. this.n0 = (this.getChild("n0"));
  13078. this.n1 = (this.getChild("n1"));
  13079. this.n2 = (this.getChild("n2"));
  13080. this.n3 = (this.getChild("n3"));
  13081. this.idle = this.getTransition("idle");
  13082. this.attack = this.getTransition("attack");
  13083. }
  13084. }
  13085. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  13086. class ui_dh_zy_ganfa extends fgui.GButton {
  13087. static createInstance() {
  13088. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  13089. }
  13090. onConstruct() {
  13091. this.n0 = (this.getChild("n0"));
  13092. }
  13093. }
  13094. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  13095. class ui_dh_zy_sc_guang extends fgui.GButton {
  13096. static createInstance() {
  13097. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  13098. }
  13099. onConstruct() {
  13100. this.n0 = (this.getChild("n0"));
  13101. this.n2 = (this.getChild("n2"));
  13102. }
  13103. }
  13104. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  13105. class ui_dh_zy_shangcheng extends fgui.GComponent {
  13106. static createInstance() {
  13107. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  13108. }
  13109. onConstruct() {
  13110. this.n0 = (this.getChild("n0"));
  13111. this.n3 = (this.getChild("n3"));
  13112. this.t0 = this.getTransition("t0");
  13113. }
  13114. }
  13115. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  13116. class ui_dh_zy_wanfa extends fgui.GButton {
  13117. static createInstance() {
  13118. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  13119. }
  13120. onConstruct() {
  13121. this.n0 = (this.getChild("n0"));
  13122. }
  13123. }
  13124. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  13125. class ui_Component53_1 extends fgui.GComponent {
  13126. static createInstance() {
  13127. return (fgui.UIPackage.createObject("game", "Component53_1"));
  13128. }
  13129. onConstruct() {
  13130. this.n0 = (this.getChild("n0"));
  13131. this.n1 = (this.getChild("n1"));
  13132. this.n2 = (this.getChild("n2"));
  13133. this.n3 = (this.getChild("n3"));
  13134. this.n4 = (this.getChild("n4"));
  13135. this.n5 = (this.getChild("n5"));
  13136. this.n6 = (this.getChild("n6"));
  13137. this.n7 = (this.getChild("n7"));
  13138. this.n8 = (this.getChild("n8"));
  13139. this.n9 = (this.getChild("n9"));
  13140. this.n10 = (this.getChild("n10"));
  13141. this.n11 = (this.getChild("n11"));
  13142. this.n12 = (this.getChild("n12"));
  13143. this.n13 = (this.getChild("n13"));
  13144. this.n14 = (this.getChild("n14"));
  13145. this.n15 = (this.getChild("n15"));
  13146. this.n16 = (this.getChild("n16"));
  13147. this.n19 = (this.getChild("n19"));
  13148. this.n20 = (this.getChild("n20"));
  13149. this.n21 = (this.getChild("n21"));
  13150. this.n22 = (this.getChild("n22"));
  13151. this.n23 = (this.getChild("n23"));
  13152. this.n24 = (this.getChild("n24"));
  13153. this.n25 = (this.getChild("n25"));
  13154. this.n26 = (this.getChild("n26"));
  13155. this.n27 = (this.getChild("n27"));
  13156. this.n28 = (this.getChild("n28"));
  13157. this.n29 = (this.getChild("n29"));
  13158. this.n30 = (this.getChild("n30"));
  13159. this.n31 = (this.getChild("n31"));
  13160. this.n32 = (this.getChild("n32"));
  13161. this.n33 = (this.getChild("n33"));
  13162. this.n34 = (this.getChild("n34"));
  13163. this.n35 = (this.getChild("n35"));
  13164. this.t0 = this.getTransition("t0");
  13165. }
  13166. }
  13167. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  13168. class ui_Component30 extends fgui.GComponent {
  13169. static createInstance() {
  13170. return (fgui.UIPackage.createObject("game", "Component30"));
  13171. }
  13172. onConstruct() {
  13173. this.c1 = this.getController("c1");
  13174. this.n46 = (this.getChild("n46"));
  13175. this.n47 = (this.getChild("n47"));
  13176. this.numTxt = (this.getChild("numTxt"));
  13177. this.n50 = (this.getChild("n50"));
  13178. this.n53 = (this.getChild("n53"));
  13179. this.n54 = (this.getChild("n54"));
  13180. this.n55 = (this.getChild("n55"));
  13181. this.n56 = (this.getChild("n56"));
  13182. }
  13183. }
  13184. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  13185. class ui_Component30_1 extends fgui.GComponent {
  13186. static createInstance() {
  13187. return (fgui.UIPackage.createObject("game", "Component30_1"));
  13188. }
  13189. onConstruct() {
  13190. this.c1 = this.getController("c1");
  13191. this.n46 = (this.getChild("n46"));
  13192. this.n47 = (this.getChild("n47"));
  13193. this.numTxt = (this.getChild("numTxt"));
  13194. this.n50 = (this.getChild("n50"));
  13195. this.n51 = (this.getChild("n51"));
  13196. this.n52 = (this.getChild("n52"));
  13197. this.n53 = (this.getChild("n53"));
  13198. this.n54 = (this.getChild("n54"));
  13199. }
  13200. }
  13201. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  13202. class ui_Component31 extends fgui.GComponent {
  13203. static createInstance() {
  13204. return (fgui.UIPackage.createObject("game", "Component31"));
  13205. }
  13206. onConstruct() {
  13207. this.n55 = (this.getChild("n55"));
  13208. this.n54 = (this.getChild("n54"));
  13209. this.conditionTxt = (this.getChild("conditionTxt"));
  13210. this.n57 = (this.getChild("n57"));
  13211. this.t0 = this.getTransition("t0");
  13212. }
  13213. }
  13214. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  13215. class ui_Component32 extends fgui.GComponent {
  13216. static createInstance() {
  13217. return (fgui.UIPackage.createObject("game", "Component32"));
  13218. }
  13219. onConstruct() {
  13220. this.n5 = (this.getChild("n5"));
  13221. this.n6 = (this.getChild("n6"));
  13222. this.n7 = (this.getChild("n7"));
  13223. this.t0 = this.getTransition("t0");
  13224. }
  13225. }
  13226. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  13227. class ui_AwardItem extends fgui.GComponent {
  13228. static createInstance() {
  13229. return (fgui.UIPackage.createObject("game", "AwardItem"));
  13230. }
  13231. onConstruct() {
  13232. this.n9 = (this.getChild("n9"));
  13233. this.myIcon = (this.getChild("myIcon"));
  13234. this.numTxt = (this.getChild("numTxt"));
  13235. this.nameTxt = (this.getChild("nameTxt"));
  13236. this.n16 = (this.getChild("n16"));
  13237. this.n17 = (this.getChild("n17"));
  13238. }
  13239. }
  13240. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  13241. class ui_ranking_com1 extends fgui.GButton {
  13242. static createInstance() {
  13243. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  13244. }
  13245. onConstruct() {
  13246. this.c1 = this.getController("c1");
  13247. this.n49 = (this.getChild("n49"));
  13248. this.n18 = (this.getChild("n18"));
  13249. this.n46 = (this.getChild("n46"));
  13250. this.n48 = (this.getChild("n48"));
  13251. this.n50 = (this.getChild("n50"));
  13252. }
  13253. }
  13254. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  13255. class ui_ranking_com2 extends fgui.GButton {
  13256. static createInstance() {
  13257. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  13258. }
  13259. onConstruct() {
  13260. this.c1 = this.getController("c1");
  13261. this.n49 = (this.getChild("n49"));
  13262. this.n18 = (this.getChild("n18"));
  13263. this.n46 = (this.getChild("n46"));
  13264. this.n48 = (this.getChild("n48"));
  13265. this.n50 = (this.getChild("n50"));
  13266. }
  13267. }
  13268. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  13269. class ui_ranking_com3 extends fgui.GComponent {
  13270. static createInstance() {
  13271. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  13272. }
  13273. onConstruct() {
  13274. this.n17 = (this.getChild("n17"));
  13275. this.myIcon = (this.getChild("myIcon"));
  13276. }
  13277. }
  13278. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  13279. class ui_ranking_com4 extends fgui.GComponent {
  13280. static createInstance() {
  13281. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  13282. }
  13283. onConstruct() {
  13284. this.n16 = (this.getChild("n16"));
  13285. this.head = (this.getChild("head"));
  13286. }
  13287. }
  13288. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  13289. class ui_ranking_com5 extends fgui.GComponent {
  13290. static createInstance() {
  13291. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  13292. }
  13293. onConstruct() {
  13294. this.c1 = this.getController("c1");
  13295. this.c2 = this.getController("c2");
  13296. this.n2 = (this.getChild("n2"));
  13297. this.n3 = (this.getChild("n3"));
  13298. this.levelBtn = (this.getChild("levelBtn"));
  13299. this.starBtn = (this.getChild("starBtn"));
  13300. this.n23 = (this.getChild("n23"));
  13301. this.n24 = (this.getChild("n24"));
  13302. this.n25 = (this.getChild("n25"));
  13303. this.myList = (this.getChild("myList"));
  13304. this.selfNode = (this.getChild("selfNode"));
  13305. this.n9 = (this.getChild("n9"));
  13306. this.n12 = (this.getChild("n12"));
  13307. this.n13 = (this.getChild("n13"));
  13308. this.n14 = (this.getChild("n14"));
  13309. this.n39 = (this.getChild("n39"));
  13310. this.n41 = (this.getChild("n41"));
  13311. this.n42 = (this.getChild("n42"));
  13312. this.n45 = (this.getChild("n45"));
  13313. this.changeBtn = (this.getChild("changeBtn"));
  13314. this.closeBtn = (this.getChild("closeBtn"));
  13315. this.t0 = this.getTransition("t0");
  13316. }
  13317. }
  13318. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  13319. class ui_RankItem extends fgui.GComponent {
  13320. static createInstance() {
  13321. return (fgui.UIPackage.createObject("game", "RankItem"));
  13322. }
  13323. onConstruct() {
  13324. this.n10 = (this.getChild("n10"));
  13325. this.n11 = (this.getChild("n11"));
  13326. this.rankTxt = (this.getChild("rankTxt"));
  13327. this.headNode = (this.getChild("headNode"));
  13328. this.nameTxt = (this.getChild("nameTxt"));
  13329. this.n19 = (this.getChild("n19"));
  13330. this.valueTxt = (this.getChild("valueTxt"));
  13331. this.img1 = (this.getChild("img1"));
  13332. this.img2 = (this.getChild("img2"));
  13333. this.img3 = (this.getChild("img3"));
  13334. }
  13335. }
  13336. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  13337. class ui_ranking_com9 extends fgui.GComponent {
  13338. static createInstance() {
  13339. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  13340. }
  13341. onConstruct() {
  13342. this.c1 = this.getController("c1");
  13343. this.n27 = (this.getChild("n27"));
  13344. this.n28 = (this.getChild("n28"));
  13345. this.headNode = (this.getChild("headNode"));
  13346. this.rankTxt = (this.getChild("rankTxt"));
  13347. this.nameTxt = (this.getChild("nameTxt"));
  13348. this.n34 = (this.getChild("n34"));
  13349. this.valueTxt = (this.getChild("valueTxt"));
  13350. this.n36 = (this.getChild("n36"));
  13351. this.n37 = (this.getChild("n37"));
  13352. this.n38 = (this.getChild("n38"));
  13353. this.n39 = (this.getChild("n39"));
  13354. this.n40 = (this.getChild("n40"));
  13355. }
  13356. }
  13357. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  13358. class ui_ranking_com10 extends fgui.GComponent {
  13359. static createInstance() {
  13360. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  13361. }
  13362. onConstruct() {
  13363. this.n23 = (this.getChild("n23"));
  13364. this.n24 = (this.getChild("n24"));
  13365. }
  13366. }
  13367. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  13368. class ui_ranking_com11 extends fgui.GComponent {
  13369. static createInstance() {
  13370. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  13371. }
  13372. onConstruct() {
  13373. this.n24 = (this.getChild("n24"));
  13374. this.n25 = (this.getChild("n25"));
  13375. this.t0 = this.getTransition("t0");
  13376. }
  13377. }
  13378. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  13379. class ui_ranking_com13 extends fgui.GButton {
  13380. static createInstance() {
  13381. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  13382. }
  13383. onConstruct() {
  13384. this.c1 = this.getController("c1");
  13385. this.n44 = (this.getChild("n44"));
  13386. this.n45 = (this.getChild("n45"));
  13387. this.n46 = (this.getChild("n46"));
  13388. }
  13389. }
  13390. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  13391. class ui_Component122 extends fgui.GComponent {
  13392. static createInstance() {
  13393. return (fgui.UIPackage.createObject("game", "Component122"));
  13394. }
  13395. onConstruct() {
  13396. this.gameNode1 = (this.getChild("gameNode1"));
  13397. this.gameNode2 = (this.getChild("gameNode2"));
  13398. this.gameNode3 = (this.getChild("gameNode3"));
  13399. }
  13400. }
  13401. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  13402. class ui_skillItem extends fgui.GComponent {
  13403. static createInstance() {
  13404. return (fgui.UIPackage.createObject("game", "skillItem"));
  13405. }
  13406. onConstruct() {
  13407. this.c1 = this.getController("c1");
  13408. this.n31 = (this.getChild("n31"));
  13409. this.n6 = (this.getChild("n6"));
  13410. this.skillImg = (this.getChild("skillImg"));
  13411. this.nameTxt = (this.getChild("nameTxt"));
  13412. this.levelTxt = (this.getChild("levelTxt"));
  13413. this.n28 = (this.getChild("n28"));
  13414. this.describeTxt = (this.getChild("describeTxt"));
  13415. this.n32 = (this.getChild("n32"));
  13416. this.mutiBtn = (this.getChild("mutiBtn"));
  13417. this.tryNode = (this.getChild("tryNode"));
  13418. this.normalBtn = (this.getChild("normalBtn"));
  13419. this.startBtn = (this.getChild("startBtn"));
  13420. this.n42 = (this.getChild("n42"));
  13421. this.n43 = (this.getChild("n43"));
  13422. this.n44 = (this.getChild("n44"));
  13423. }
  13424. }
  13425. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  13426. class ui_Component26 extends fgui.GButton {
  13427. static createInstance() {
  13428. return (fgui.UIPackage.createObject("game", "Component26"));
  13429. }
  13430. onConstruct() {
  13431. this.n11 = (this.getChild("n11"));
  13432. this.n30 = (this.getChild("n30"));
  13433. this.n34 = (this.getChild("n34"));
  13434. }
  13435. }
  13436. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  13437. class ui_Component28 extends fgui.GButton {
  13438. static createInstance() {
  13439. return (fgui.UIPackage.createObject("game", "Component28"));
  13440. }
  13441. onConstruct() {
  13442. this.n12 = (this.getChild("n12"));
  13443. this.n31 = (this.getChild("n31"));
  13444. this.curTxt = (this.getChild("curTxt"));
  13445. this.n33 = (this.getChild("n33"));
  13446. }
  13447. }
  13448. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  13449. class ui_Component1302 extends fgui.GComponent {
  13450. static createInstance() {
  13451. return (fgui.UIPackage.createObject("game", "Component1302"));
  13452. }
  13453. onConstruct() {
  13454. this.n2 = (this.getChild("n2"));
  13455. this.n3 = (this.getChild("n3"));
  13456. }
  13457. }
  13458. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  13459. class ui_Component113 extends fgui.GComponent {
  13460. static createInstance() {
  13461. return (fgui.UIPackage.createObject("game", "Component113"));
  13462. }
  13463. onConstruct() {
  13464. this.n85 = (this.getChild("n85"));
  13465. this.n86 = (this.getChild("n86"));
  13466. this.n77 = (this.getChild("n77"));
  13467. this.n79 = (this.getChild("n79"));
  13468. this.n80 = (this.getChild("n80"));
  13469. this.n81 = (this.getChild("n81"));
  13470. this.n82 = (this.getChild("n82"));
  13471. this.n84 = (this.getChild("n84"));
  13472. this.n87 = (this.getChild("n87"));
  13473. this.t0 = this.getTransition("t0");
  13474. }
  13475. }
  13476. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  13477. class ui_Component114 extends fgui.GComponent {
  13478. static createInstance() {
  13479. return (fgui.UIPackage.createObject("game", "Component114"));
  13480. }
  13481. onConstruct() {
  13482. this.n77 = (this.getChild("n77"));
  13483. this.t0 = this.getTransition("t0");
  13484. }
  13485. }
  13486. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  13487. class ui_Component115 extends fgui.GComponent {
  13488. static createInstance() {
  13489. return (fgui.UIPackage.createObject("game", "Component115"));
  13490. }
  13491. onConstruct() {
  13492. this.n83 = (this.getChild("n83"));
  13493. this.fingerNode = (this.getChild("fingerNode"));
  13494. this.n84 = (this.getChild("n84"));
  13495. }
  13496. }
  13497. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  13498. class ui_Component117 extends fgui.GComponent {
  13499. static createInstance() {
  13500. return (fgui.UIPackage.createObject("game", "Component117"));
  13501. }
  13502. onConstruct() {
  13503. this.n87 = (this.getChild("n87"));
  13504. this.n88 = (this.getChild("n88"));
  13505. this.n84 = (this.getChild("n84"));
  13506. this.n85 = (this.getChild("n85"));
  13507. this.n86 = (this.getChild("n86"));
  13508. this.t0 = this.getTransition("t0");
  13509. }
  13510. }
  13511. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  13512. class ui_Component98_1 extends fgui.GButton {
  13513. static createInstance() {
  13514. return (fgui.UIPackage.createObject("game", "Component98_1"));
  13515. }
  13516. onConstruct() {
  13517. this.c1 = this.getController("c1");
  13518. this.n8 = (this.getChild("n8"));
  13519. this.n41 = (this.getChild("n41"));
  13520. this.n40 = (this.getChild("n40"));
  13521. }
  13522. }
  13523. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  13524. class ui_Component61 extends fgui.GComponent {
  13525. static createInstance() {
  13526. return (fgui.UIPackage.createObject("game", "Component61"));
  13527. }
  13528. onConstruct() {
  13529. this.n14 = (this.getChild("n14"));
  13530. this.n6 = (this.getChild("n6"));
  13531. this.t0 = this.getTransition("t0");
  13532. }
  13533. }
  13534. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  13535. class ui_Component62 extends fgui.GComponent {
  13536. static createInstance() {
  13537. return (fgui.UIPackage.createObject("game", "Component62"));
  13538. }
  13539. onConstruct() {
  13540. this.n66 = (this.getChild("n66"));
  13541. this.n56 = (this.getChild("n56"));
  13542. this.n63 = (this.getChild("n63"));
  13543. this.n65 = (this.getChild("n65"));
  13544. this.t0 = this.getTransition("t0");
  13545. }
  13546. }
  13547. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  13548. class ui_d3Root extends fgui.GComponent {
  13549. static createInstance() {
  13550. return (fgui.UIPackage.createObject("game", "d3Root"));
  13551. }
  13552. onConstruct() {
  13553. }
  13554. }
  13555. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  13556. class ui_d2Root extends fgui.GComponent {
  13557. static createInstance() {
  13558. return (fgui.UIPackage.createObject("game", "d2Root"));
  13559. }
  13560. onConstruct() {
  13561. }
  13562. }
  13563. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  13564. class ui_ballNode extends fgui.GComponent {
  13565. static createInstance() {
  13566. return (fgui.UIPackage.createObject("game", "ballNode"));
  13567. }
  13568. onConstruct() {
  13569. }
  13570. }
  13571. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  13572. class ui_border extends fgui.GComponent {
  13573. static createInstance() {
  13574. return (fgui.UIPackage.createObject("game", "border"));
  13575. }
  13576. onConstruct() {
  13577. this.bar1 = (this.getChild("bar1"));
  13578. this.bar2 = (this.getChild("bar2"));
  13579. this.bar3 = (this.getChild("bar3"));
  13580. this.bar4 = (this.getChild("bar4"));
  13581. this.bar5 = (this.getChild("bar5"));
  13582. this.bar6 = (this.getChild("bar6"));
  13583. this.circle1 = (this.getChild("circle1"));
  13584. this.circle2 = (this.getChild("circle2"));
  13585. this.circle3 = (this.getChild("circle3"));
  13586. this.circle4 = (this.getChild("circle4"));
  13587. this.circle5 = (this.getChild("circle5"));
  13588. this.circle6 = (this.getChild("circle6"));
  13589. this.n28 = (this.getChild("n28"));
  13590. }
  13591. }
  13592. ui_border.URL = "ui://isxx5ak7sdh33qq";
  13593. class ui_Component41_2 extends fgui.GComponent {
  13594. static createInstance() {
  13595. return (fgui.UIPackage.createObject("game", "Component41_2"));
  13596. }
  13597. onConstruct() {
  13598. this.c1 = this.getController("c1");
  13599. this.n0 = (this.getChild("n0"));
  13600. this.n2 = (this.getChild("n2"));
  13601. this.n19 = (this.getChild("n19"));
  13602. this.cancelBtn = (this.getChild("cancelBtn"));
  13603. this.videoBtn = (this.getChild("videoBtn"));
  13604. this.n9 = (this.getChild("n9"));
  13605. this.n22 = (this.getChild("n22"));
  13606. this.tipsTxt = (this.getChild("tipsTxt"));
  13607. this.n23 = (this.getChild("n23"));
  13608. this.n24 = (this.getChild("n24"));
  13609. this.n26 = (this.getChild("n26"));
  13610. this.n27 = (this.getChild("n27"));
  13611. this.titleTxt = (this.getChild("titleTxt"));
  13612. }
  13613. }
  13614. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  13615. class ui_Component41_1 extends fgui.GComponent {
  13616. static createInstance() {
  13617. return (fgui.UIPackage.createObject("game", "Component41_1"));
  13618. }
  13619. onConstruct() {
  13620. this.c1 = this.getController("c1");
  13621. this.n0 = (this.getChild("n0"));
  13622. this.n2 = (this.getChild("n2"));
  13623. this.cancelBtn = (this.getChild("cancelBtn"));
  13624. this.videoBtn = (this.getChild("videoBtn"));
  13625. this.n27 = (this.getChild("n27"));
  13626. this.n30 = (this.getChild("n30"));
  13627. this.n31 = (this.getChild("n31"));
  13628. this.n32 = (this.getChild("n32"));
  13629. this.n33 = (this.getChild("n33"));
  13630. this.n34 = (this.getChild("n34"));
  13631. this.n35 = (this.getChild("n35"));
  13632. this.n36 = (this.getChild("n36"));
  13633. this.n1 = (this.getChild("n1"));
  13634. this.n37 = (this.getChild("n37"));
  13635. this.t0 = this.getTransition("t0");
  13636. this.t1 = this.getTransition("t1");
  13637. this.t2 = this.getTransition("t2");
  13638. this.t3 = this.getTransition("t3");
  13639. }
  13640. }
  13641. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  13642. class ui_againBtn extends fgui.GButton {
  13643. static createInstance() {
  13644. return (fgui.UIPackage.createObject("game", "againBtn"));
  13645. }
  13646. onConstruct() {
  13647. this.n2 = (this.getChild("n2"));
  13648. this.n1 = (this.getChild("n1"));
  13649. this.n5 = (this.getChild("n5"));
  13650. }
  13651. }
  13652. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  13653. class ui_Component118 extends fgui.GButton {
  13654. static createInstance() {
  13655. return (fgui.UIPackage.createObject("game", "Component118"));
  13656. }
  13657. onConstruct() {
  13658. this.c1 = this.getController("c1");
  13659. this.n14 = (this.getChild("n14"));
  13660. this.n9 = (this.getChild("n9"));
  13661. this.n10 = (this.getChild("n10"));
  13662. this.diamondTxt = (this.getChild("diamondTxt"));
  13663. this.n13 = (this.getChild("n13"));
  13664. this.n15 = (this.getChild("n15"));
  13665. }
  13666. }
  13667. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  13668. class ui_Component119 extends fgui.GComponent {
  13669. static createInstance() {
  13670. return (fgui.UIPackage.createObject("game", "Component119"));
  13671. }
  13672. onConstruct() {
  13673. this.n1 = (this.getChild("n1"));
  13674. this.n2 = (this.getChild("n2"));
  13675. this.n13 = (this.getChild("n13"));
  13676. this.n6 = (this.getChild("n6"));
  13677. this.screenNode = (this.getChild("screenNode"));
  13678. this.n15 = (this.getChild("n15"));
  13679. this.closeBtn = (this.getChild("closeBtn"));
  13680. this.share2Btn = (this.getChild("share2Btn"));
  13681. this.shareBtn = (this.getChild("shareBtn"));
  13682. this.tipsNode = (this.getChild("tipsNode"));
  13683. this.awardNode = (this.getChild("awardNode"));
  13684. }
  13685. }
  13686. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  13687. class ui_Component132_1 extends fgui.GComponent {
  13688. static createInstance() {
  13689. return (fgui.UIPackage.createObject("game", "Component132_1"));
  13690. }
  13691. onConstruct() {
  13692. this.n25 = (this.getChild("n25"));
  13693. this.n26 = (this.getChild("n26"));
  13694. this.n27 = (this.getChild("n27"));
  13695. this.t0 = this.getTransition("t0");
  13696. }
  13697. }
  13698. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  13699. class ui_SecretaryDisplay extends fgui.GComponent {
  13700. static createInstance() {
  13701. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  13702. }
  13703. onConstruct() {
  13704. this.n2 = (this.getChild("n2"));
  13705. this.levelTxt = (this.getChild("levelTxt"));
  13706. this.n4 = (this.getChild("n4"));
  13707. this.secretary = (this.getChild("secretary"));
  13708. this.purchaseBtn = (this.getChild("purchaseBtn"));
  13709. this.n16 = (this.getChild("n16"));
  13710. this.n37 = (this.getChild("n37"));
  13711. this.n41 = (this.getChild("n41"));
  13712. this.n14 = (this.getChild("n14"));
  13713. this.n17 = (this.getChild("n17"));
  13714. this.heightTxt = (this.getChild("heightTxt"));
  13715. this.n46 = (this.getChild("n46"));
  13716. this.n36 = (this.getChild("n36"));
  13717. this.n38 = (this.getChild("n38"));
  13718. this.foodTxt = (this.getChild("foodTxt"));
  13719. this.n47 = (this.getChild("n47"));
  13720. this.n40 = (this.getChild("n40"));
  13721. this.n42 = (this.getChild("n42"));
  13722. this.historyTxt = (this.getChild("historyTxt"));
  13723. this.n48 = (this.getChild("n48"));
  13724. this.nameImg = (this.getChild("nameImg"));
  13725. this.n12 = (this.getChild("n12"));
  13726. this.n49 = (this.getChild("n49"));
  13727. this.t0 = this.getTransition("t0");
  13728. }
  13729. }
  13730. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  13731. class ui_BallRodDisplay extends fgui.GComponent {
  13732. static createInstance() {
  13733. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  13734. }
  13735. onConstruct() {
  13736. this.c1 = this.getController("c1");
  13737. this.n31 = (this.getChild("n31"));
  13738. this.n6 = (this.getChild("n6"));
  13739. this.nameTxt = (this.getChild("nameTxt"));
  13740. this.rodImg = (this.getChild("rodImg"));
  13741. this.levelNode = (this.getChild("levelNode"));
  13742. this.eftRod = (this.getChild("eftRod"));
  13743. this.purchaseBtn = (this.getChild("purchaseBtn"));
  13744. }
  13745. }
  13746. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  13747. class ui_Component111_11 extends fgui.GComponent {
  13748. static createInstance() {
  13749. return (fgui.UIPackage.createObject("game", "Component111_11"));
  13750. }
  13751. onConstruct() {
  13752. this.n68 = (this.getChild("n68"));
  13753. this.n69 = (this.getChild("n69"));
  13754. }
  13755. }
  13756. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  13757. class ui_Component112 extends fgui.GComponent {
  13758. static createInstance() {
  13759. return (fgui.UIPackage.createObject("game", "Component112"));
  13760. }
  13761. onConstruct() {
  13762. this.n68 = (this.getChild("n68"));
  13763. this.n70 = (this.getChild("n70"));
  13764. this.myMask = (this.getChild("myMask"));
  13765. }
  13766. }
  13767. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  13768. class ui_Component111 extends fgui.GComponent {
  13769. static createInstance() {
  13770. return (fgui.UIPackage.createObject("game", "Component111"));
  13771. }
  13772. onConstruct() {
  13773. this.n68 = (this.getChild("n68"));
  13774. this.myMask = (this.getChild("myMask"));
  13775. }
  13776. }
  13777. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  13778. class ui_Component144 extends fgui.GButton {
  13779. static createInstance() {
  13780. return (fgui.UIPackage.createObject("game", "Component144"));
  13781. }
  13782. onConstruct() {
  13783. this.n8 = (this.getChild("n8"));
  13784. }
  13785. }
  13786. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  13787. class ui_Sign_com2 extends fgui.GComponent {
  13788. static createInstance() {
  13789. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  13790. }
  13791. onConstruct() {
  13792. this.n0 = (this.getChild("n0"));
  13793. this.n1 = (this.getChild("n1"));
  13794. this.t0 = this.getTransition("t0");
  13795. }
  13796. }
  13797. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  13798. class ui_Sign_guang extends fgui.GComponent {
  13799. static createInstance() {
  13800. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  13801. }
  13802. onConstruct() {
  13803. this.n1 = (this.getChild("n1"));
  13804. this.n2 = (this.getChild("n2"));
  13805. this.n3 = (this.getChild("n3"));
  13806. this.n4 = (this.getChild("n4"));
  13807. this.n5 = (this.getChild("n5"));
  13808. this.n6 = (this.getChild("n6"));
  13809. this.n8 = (this.getChild("n8"));
  13810. }
  13811. }
  13812. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  13813. class ui_SignMax extends fgui.GComponent {
  13814. static createInstance() {
  13815. return (fgui.UIPackage.createObject("game", "SignMax"));
  13816. }
  13817. onConstruct() {
  13818. this.c1 = this.getController("c1");
  13819. this.n7 = (this.getChild("n7"));
  13820. this.n15 = (this.getChild("n15"));
  13821. this.n8 = (this.getChild("n8"));
  13822. this.titleTxt = (this.getChild("titleTxt"));
  13823. this.myIcon1 = (this.getChild("myIcon1"));
  13824. this.numTxt1 = (this.getChild("numTxt1"));
  13825. this.myIcon2 = (this.getChild("myIcon2"));
  13826. this.n20 = (this.getChild("n20"));
  13827. this.n17 = (this.getChild("n17"));
  13828. this.numTxt2 = (this.getChild("numTxt2"));
  13829. this.n12 = (this.getChild("n12"));
  13830. this.n13 = (this.getChild("n13"));
  13831. this.n21 = (this.getChild("n21"));
  13832. this.n14 = (this.getChild("n14"));
  13833. }
  13834. }
  13835. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  13836. class ui_Sign_com2_1 extends fgui.GComponent {
  13837. static createInstance() {
  13838. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  13839. }
  13840. onConstruct() {
  13841. this.n0 = (this.getChild("n0"));
  13842. this.n1 = (this.getChild("n1"));
  13843. this.t0 = this.getTransition("t0");
  13844. }
  13845. }
  13846. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  13847. class ui_Sign_com5 extends fgui.GComponent {
  13848. static createInstance() {
  13849. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  13850. }
  13851. onConstruct() {
  13852. this.n3 = (this.getChild("n3"));
  13853. this.n29 = (this.getChild("n29"));
  13854. this.n4 = (this.getChild("n4"));
  13855. this.day1 = (this.getChild("day1"));
  13856. this.day2 = (this.getChild("day2"));
  13857. this.day3 = (this.getChild("day3"));
  13858. this.day4 = (this.getChild("day4"));
  13859. this.day5 = (this.getChild("day5"));
  13860. this.day6 = (this.getChild("day6"));
  13861. this.day7 = (this.getChild("day7"));
  13862. this.t0 = this.getTransition("t0");
  13863. }
  13864. }
  13865. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  13866. class ui_Sign_com8 extends fgui.GComponent {
  13867. static createInstance() {
  13868. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  13869. }
  13870. onConstruct() {
  13871. this.n48 = (this.getChild("n48"));
  13872. this.womanTxt = (this.getChild("womanTxt"));
  13873. this.t0 = this.getTransition("t0");
  13874. }
  13875. }
  13876. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  13877. class ui_Sign_com6 extends fgui.GComponent {
  13878. static createInstance() {
  13879. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  13880. }
  13881. onConstruct() {
  13882. this.n2 = (this.getChild("n2"));
  13883. this.n3 = (this.getChild("n3"));
  13884. this.t0 = this.getTransition("t0");
  13885. }
  13886. }
  13887. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  13888. class ui_Sign_com7 extends fgui.GComponent {
  13889. static createInstance() {
  13890. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  13891. }
  13892. onConstruct() {
  13893. this.n29 = (this.getChild("n29"));
  13894. this.n2 = (this.getChild("n2"));
  13895. }
  13896. }
  13897. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  13898. class ui_UITurntable_com1_2 extends fgui.GComponent {
  13899. static createInstance() {
  13900. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  13901. }
  13902. onConstruct() {
  13903. this.n5 = (this.getChild("n5"));
  13904. this.n4 = (this.getChild("n4"));
  13905. this.t0 = this.getTransition("t0");
  13906. }
  13907. }
  13908. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  13909. class ui_UITurntable_com2 extends fgui.GComponent {
  13910. static createInstance() {
  13911. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  13912. }
  13913. onConstruct() {
  13914. this.c1 = this.getController("c1");
  13915. this.n4 = (this.getChild("n4"));
  13916. this.n6 = (this.getChild("n6"));
  13917. this.n10 = (this.getChild("n10"));
  13918. this.n11 = (this.getChild("n11"));
  13919. this.n12 = (this.getChild("n12"));
  13920. this.n13 = (this.getChild("n13"));
  13921. this.n14 = (this.getChild("n14"));
  13922. this.n15 = (this.getChild("n15"));
  13923. this.n16 = (this.getChild("n16"));
  13924. this.n17 = (this.getChild("n17"));
  13925. this.n18 = (this.getChild("n18"));
  13926. this.n19 = (this.getChild("n19"));
  13927. this.n20 = (this.getChild("n20"));
  13928. this.n21 = (this.getChild("n21"));
  13929. this.n22 = (this.getChild("n22"));
  13930. this.n23 = (this.getChild("n23"));
  13931. this.n24 = (this.getChild("n24"));
  13932. this.n25 = (this.getChild("n25"));
  13933. this.n26 = (this.getChild("n26"));
  13934. this.n27 = (this.getChild("n27"));
  13935. this.n28 = (this.getChild("n28"));
  13936. this.n29 = (this.getChild("n29"));
  13937. this.n30 = (this.getChild("n30"));
  13938. this.n31 = (this.getChild("n31"));
  13939. this.n32 = (this.getChild("n32"));
  13940. this.n33 = (this.getChild("n33"));
  13941. }
  13942. }
  13943. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  13944. class ui_UITurntable_com1_1 extends fgui.GComponent {
  13945. static createInstance() {
  13946. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  13947. }
  13948. onConstruct() {
  13949. this.n5 = (this.getChild("n5"));
  13950. this.n4 = (this.getChild("n4"));
  13951. this.t0 = this.getTransition("t0");
  13952. }
  13953. }
  13954. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  13955. class ui_UITurntable_com5 extends fgui.GComponent {
  13956. static createInstance() {
  13957. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  13958. }
  13959. onConstruct() {
  13960. this.flashNode = (this.getChild("flashNode"));
  13961. this.rotNode = (this.getChild("rotNode"));
  13962. this.n3 = (this.getChild("n3"));
  13963. this.n21 = (this.getChild("n21"));
  13964. this.t0 = this.getTransition("t0");
  13965. }
  13966. }
  13967. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  13968. class ui_UITurntable_com7 extends fgui.GComponent {
  13969. static createInstance() {
  13970. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  13971. }
  13972. onConstruct() {
  13973. this.n2 = (this.getChild("n2"));
  13974. this.n35 = (this.getChild("n35"));
  13975. this.img1 = (this.getChild("img1"));
  13976. this.img2 = (this.getChild("img2"));
  13977. this.img3 = (this.getChild("img3"));
  13978. this.img4 = (this.getChild("img4"));
  13979. this.img6 = (this.getChild("img6"));
  13980. this.img5 = (this.getChild("img5"));
  13981. this.txt1 = (this.getChild("txt1"));
  13982. this.txt2 = (this.getChild("txt2"));
  13983. this.txt3 = (this.getChild("txt3"));
  13984. this.txt4 = (this.getChild("txt4"));
  13985. this.txt5 = (this.getChild("txt5"));
  13986. this.txt6 = (this.getChild("txt6"));
  13987. }
  13988. }
  13989. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  13990. class ui_UITurntable_com9 extends fgui.GComponent {
  13991. static createInstance() {
  13992. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  13993. }
  13994. onConstruct() {
  13995. this.n38 = (this.getChild("n38"));
  13996. this.n39 = (this.getChild("n39"));
  13997. }
  13998. }
  13999. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  14000. class ui_UITurntable_com10 extends fgui.GComponent {
  14001. static createInstance() {
  14002. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  14003. }
  14004. onConstruct() {
  14005. this.n39 = (this.getChild("n39"));
  14006. this.n40 = (this.getChild("n40"));
  14007. this.t0 = this.getTransition("t0");
  14008. }
  14009. }
  14010. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  14011. class ui_UITurntable_com11 extends fgui.GComponent {
  14012. static createInstance() {
  14013. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  14014. }
  14015. onConstruct() {
  14016. this.n38 = (this.getChild("n38"));
  14017. this.n39 = (this.getChild("n39"));
  14018. this.n40 = (this.getChild("n40"));
  14019. this.t0 = this.getTransition("t0");
  14020. }
  14021. }
  14022. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  14023. class ui_UITurntable_com12 extends fgui.GComponent {
  14024. static createInstance() {
  14025. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  14026. }
  14027. onConstruct() {
  14028. this.n43 = (this.getChild("n43"));
  14029. this.barNode = (this.getChild("barNode"));
  14030. this.tipsTxt = (this.getChild("tipsTxt"));
  14031. this.n45 = (this.getChild("n45"));
  14032. this.boxBtn = (this.getChild("boxBtn"));
  14033. }
  14034. }
  14035. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  14036. class ui_UITurntable_com1 extends fgui.GButton {
  14037. static createInstance() {
  14038. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  14039. }
  14040. onConstruct() {
  14041. this.n41 = (this.getChild("n41"));
  14042. this.n42 = (this.getChild("n42"));
  14043. this.t0 = this.getTransition("t0");
  14044. }
  14045. }
  14046. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  14047. class ui_UITurntable_com3 extends fgui.GComponent {
  14048. static createInstance() {
  14049. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  14050. }
  14051. onConstruct() {
  14052. this.n48 = (this.getChild("n48"));
  14053. this.womanTxt = (this.getChild("womanTxt"));
  14054. this.t0 = this.getTransition("t0");
  14055. }
  14056. }
  14057. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  14058. class ui_cancelBtn2 extends fgui.GButton {
  14059. static createInstance() {
  14060. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  14061. }
  14062. onConstruct() {
  14063. this.c1 = this.getController("c1");
  14064. this.n0 = (this.getChild("n0"));
  14065. this.n1 = (this.getChild("n1"));
  14066. this.n2 = (this.getChild("n2"));
  14067. this.n3 = (this.getChild("n3"));
  14068. this.n4 = (this.getChild("n4"));
  14069. this.n5 = (this.getChild("n5"));
  14070. this.n6 = (this.getChild("n6"));
  14071. this.n7 = (this.getChild("n7"));
  14072. this.n8 = (this.getChild("n8"));
  14073. this.powerEft = (this.getChild("powerEft"));
  14074. }
  14075. }
  14076. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  14077. class ui_shareBtn2 extends fgui.GButton {
  14078. static createInstance() {
  14079. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  14080. }
  14081. onConstruct() {
  14082. this.c1 = this.getController("c1");
  14083. this.n2 = (this.getChild("n2"));
  14084. this.n24 = (this.getChild("n24"));
  14085. this.n1 = (this.getChild("n1"));
  14086. this.n3 = (this.getChild("n3"));
  14087. this.n23 = (this.getChild("n23"));
  14088. this.n4 = (this.getChild("n4"));
  14089. this.n5 = (this.getChild("n5"));
  14090. this.n6 = (this.getChild("n6"));
  14091. this.n20 = (this.getChild("n20"));
  14092. this.n21 = (this.getChild("n21"));
  14093. this.n22 = (this.getChild("n22"));
  14094. this.powerEft = (this.getChild("powerEft"));
  14095. }
  14096. }
  14097. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  14098. class ui_UIMoney extends fgui.GComponent {
  14099. static createInstance() {
  14100. return (fgui.UIPackage.createObject("game", "UIMoney"));
  14101. }
  14102. onConstruct() {
  14103. this.c1 = this.getController("c1");
  14104. this.n4 = (this.getChild("n4"));
  14105. this.coinImg = (this.getChild("coinImg"));
  14106. this.addCoinBtn = (this.getChild("addCoinBtn"));
  14107. this.coinTxt = (this.getChild("coinTxt"));
  14108. this.n7 = (this.getChild("n7"));
  14109. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  14110. this.diamondTxt = (this.getChild("diamondTxt"));
  14111. this.diamondImg = (this.getChild("diamondImg"));
  14112. this.n12 = (this.getChild("n12"));
  14113. this.powerImg = (this.getChild("powerImg"));
  14114. this.addPowerBtn = (this.getChild("addPowerBtn"));
  14115. this.powerTxt = (this.getChild("powerTxt"));
  14116. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  14117. }
  14118. }
  14119. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  14120. class ui_backBtn extends fgui.GButton {
  14121. static createInstance() {
  14122. return (fgui.UIPackage.createObject("game", "backBtn"));
  14123. }
  14124. onConstruct() {
  14125. this.n0 = (this.getChild("n0"));
  14126. this.t0 = this.getTransition("t0");
  14127. this.t1 = this.getTransition("t1");
  14128. }
  14129. }
  14130. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  14131. class ui_MoneyBtn extends fgui.GButton {
  14132. static createInstance() {
  14133. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  14134. }
  14135. onConstruct() {
  14136. this.button = this.getController("button");
  14137. this.n0 = (this.getChild("n0"));
  14138. }
  14139. }
  14140. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  14141. class ui_UIMoneyBtn extends fgui.GComponent {
  14142. static createInstance() {
  14143. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  14144. }
  14145. onConstruct() {
  14146. this.n1 = (this.getChild("n1"));
  14147. this.closeBtn = (this.getChild("closeBtn"));
  14148. }
  14149. }
  14150. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  14151. class ui_Component64 extends fgui.GComponent {
  14152. static createInstance() {
  14153. return (fgui.UIPackage.createObject("game", "Component64"));
  14154. }
  14155. onConstruct() {
  14156. this.n57 = (this.getChild("n57"));
  14157. this.n54 = (this.getChild("n54"));
  14158. this.n55 = (this.getChild("n55"));
  14159. this.n56 = (this.getChild("n56"));
  14160. this.t1 = this.getTransition("t1");
  14161. }
  14162. }
  14163. ui_Component64.URL = "ui://isxx5ak7wp26456";
  14164. class ui_Component41_3 extends fgui.GComponent {
  14165. static createInstance() {
  14166. return (fgui.UIPackage.createObject("game", "Component41_3"));
  14167. }
  14168. onConstruct() {
  14169. this.c1 = this.getController("c1");
  14170. this.n0 = (this.getChild("n0"));
  14171. this.n2 = (this.getChild("n2"));
  14172. this.cancelBtn = (this.getChild("cancelBtn"));
  14173. this.videoBtn = (this.getChild("videoBtn"));
  14174. this.n9 = (this.getChild("n9"));
  14175. this.n24 = (this.getChild("n24"));
  14176. this.n27 = (this.getChild("n27"));
  14177. this.titleTxt = (this.getChild("titleTxt"));
  14178. this.n28 = (this.getChild("n28"));
  14179. this.t0 = this.getTransition("t0");
  14180. }
  14181. }
  14182. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  14183. class ui_dh_zs_4 extends fgui.GComponent {
  14184. static createInstance() {
  14185. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  14186. }
  14187. onConstruct() {
  14188. this.n1 = (this.getChild("n1"));
  14189. this.n2 = (this.getChild("n2"));
  14190. this.n3 = (this.getChild("n3"));
  14191. this.n4 = (this.getChild("n4"));
  14192. this.n5 = (this.getChild("n5"));
  14193. this.n6 = (this.getChild("n6"));
  14194. this.n8 = (this.getChild("n8"));
  14195. this.t0 = this.getTransition("t0");
  14196. }
  14197. }
  14198. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  14199. class ui_Component71_1 extends fgui.GButton {
  14200. static createInstance() {
  14201. return (fgui.UIPackage.createObject("game", "Component71_1"));
  14202. }
  14203. onConstruct() {
  14204. this.n17 = (this.getChild("n17"));
  14205. this.t0 = this.getTransition("t0");
  14206. }
  14207. }
  14208. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  14209. class ui_Component83 extends fgui.GComponent {
  14210. static createInstance() {
  14211. return (fgui.UIPackage.createObject("game", "Component83"));
  14212. }
  14213. onConstruct() {
  14214. this.c1 = this.getController("c1");
  14215. this.n17 = (this.getChild("n17"));
  14216. this.n19 = (this.getChild("n19"));
  14217. this.n20 = (this.getChild("n20"));
  14218. }
  14219. }
  14220. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  14221. class ui_Component84 extends fgui.GComponent {
  14222. static createInstance() {
  14223. return (fgui.UIPackage.createObject("game", "Component84"));
  14224. }
  14225. onConstruct() {
  14226. this.c1 = this.getController("c1");
  14227. this.n4 = (this.getChild("n4"));
  14228. this.n22 = (this.getChild("n22"));
  14229. this.n23 = (this.getChild("n23"));
  14230. this.numTxt = (this.getChild("numTxt"));
  14231. this.n25 = (this.getChild("n25"));
  14232. this.n26 = (this.getChild("n26"));
  14233. }
  14234. }
  14235. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  14236. class ui_Component84_1 extends fgui.GComponent {
  14237. static createInstance() {
  14238. return (fgui.UIPackage.createObject("game", "Component84_1"));
  14239. }
  14240. onConstruct() {
  14241. this.c1 = this.getController("c1");
  14242. this.n4 = (this.getChild("n4"));
  14243. this.n22 = (this.getChild("n22"));
  14244. this.n23 = (this.getChild("n23"));
  14245. this.numTxt = (this.getChild("numTxt"));
  14246. this.n25 = (this.getChild("n25"));
  14247. this.n26 = (this.getChild("n26"));
  14248. }
  14249. }
  14250. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  14251. class ui_Component85 extends fgui.GComponent {
  14252. static createInstance() {
  14253. return (fgui.UIPackage.createObject("game", "Component85"));
  14254. }
  14255. onConstruct() {
  14256. this.n1 = (this.getChild("n1"));
  14257. this.n6 = (this.getChild("n6"));
  14258. this.n2 = (this.getChild("n2"));
  14259. this.n3 = (this.getChild("n3"));
  14260. this.levelTxt = (this.getChild("levelTxt"));
  14261. this.n10 = (this.getChild("n10"));
  14262. this.n11 = (this.getChild("n11"));
  14263. this.n12 = (this.getChild("n12"));
  14264. this.n13 = (this.getChild("n13"));
  14265. this.n14 = (this.getChild("n14"));
  14266. this.modeNode = (this.getChild("modeNode"));
  14267. this.n18 = (this.getChild("n18"));
  14268. this.conditionTxt = (this.getChild("conditionTxt"));
  14269. this.diamondNode = (this.getChild("diamondNode"));
  14270. this.coinNode = (this.getChild("coinNode"));
  14271. this.startBtn = (this.getChild("startBtn"));
  14272. this.n28 = (this.getChild("n28"));
  14273. this.displayRoot = (this.getChild("displayRoot"));
  14274. this.t0 = this.getTransition("t0");
  14275. }
  14276. }
  14277. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  14278. class ui_Component86 extends fgui.GButton {
  14279. static createInstance() {
  14280. return (fgui.UIPackage.createObject("game", "Component86"));
  14281. }
  14282. onConstruct() {
  14283. this.n15 = (this.getChild("n15"));
  14284. this.t0 = this.getTransition("t0");
  14285. }
  14286. }
  14287. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  14288. class ui_Component87 extends fgui.GComponent {
  14289. static createInstance() {
  14290. return (fgui.UIPackage.createObject("game", "Component87"));
  14291. }
  14292. onConstruct() {
  14293. this.n66 = (this.getChild("n66"));
  14294. this.myProgress = (this.getChild("myProgress"));
  14295. this.starAni = (this.getChild("starAni"));
  14296. this.hpTxt = (this.getChild("hpTxt"));
  14297. this.n74 = (this.getChild("n74"));
  14298. this.n73 = (this.getChild("n73"));
  14299. this.ballTxt = (this.getChild("ballTxt"));
  14300. this.n76 = (this.getChild("n76"));
  14301. this.helpLineBtn = (this.getChild("helpLineBtn"));
  14302. this.levelTxt = (this.getChild("levelTxt"));
  14303. this.star1 = (this.getChild("star1"));
  14304. this.star2 = (this.getChild("star2"));
  14305. this.star3 = (this.getChild("star3"));
  14306. }
  14307. }
  14308. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  14309. class ui_Component88 extends fgui.GProgressBar {
  14310. static createInstance() {
  14311. return (fgui.UIPackage.createObject("game", "Component88"));
  14312. }
  14313. onConstruct() {
  14314. this.n68 = (this.getChild("n68"));
  14315. this.bar = (this.getChild("bar"));
  14316. }
  14317. }
  14318. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  14319. class ui_Component89 extends fgui.GComponent {
  14320. static createInstance() {
  14321. return (fgui.UIPackage.createObject("game", "Component89"));
  14322. }
  14323. onConstruct() {
  14324. this.c1 = this.getController("c1");
  14325. this.n71 = (this.getChild("n71"));
  14326. this.n72 = (this.getChild("n72"));
  14327. }
  14328. }
  14329. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  14330. class ui_Component90 extends fgui.GComponent {
  14331. static createInstance() {
  14332. return (fgui.UIPackage.createObject("game", "Component90"));
  14333. }
  14334. onConstruct() {
  14335. this.c1 = this.getController("c1");
  14336. this.n64 = (this.getChild("n64"));
  14337. this.n65 = (this.getChild("n65"));
  14338. this.n66 = (this.getChild("n66"));
  14339. this.t0 = this.getTransition("t0");
  14340. }
  14341. }
  14342. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  14343. class ui_Component127 extends fgui.GButton {
  14344. static createInstance() {
  14345. return (fgui.UIPackage.createObject("game", "Component127"));
  14346. }
  14347. onConstruct() {
  14348. this.n5 = (this.getChild("n5"));
  14349. }
  14350. }
  14351. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  14352. class gameBinder {
  14353. static bindAll() {
  14354. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  14355. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  14356. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  14357. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  14358. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  14359. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  14360. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  14361. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  14362. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  14363. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  14364. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  14365. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  14366. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  14367. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  14368. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  14369. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  14370. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  14371. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  14372. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  14373. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  14374. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  14375. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  14376. fgui.UIObjectFactory.setExtension(ui_Component121.URL, ui_Component121);
  14377. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  14378. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  14379. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  14380. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  14381. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  14382. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  14383. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  14384. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  14385. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  14386. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  14387. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  14388. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  14389. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  14390. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  14391. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  14392. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  14393. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  14394. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  14395. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  14396. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  14397. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  14398. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  14399. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  14400. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  14401. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  14402. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  14403. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  14404. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  14405. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  14406. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  14407. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  14408. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  14409. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  14410. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  14411. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  14412. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  14413. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  14414. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  14415. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  14416. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  14417. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  14418. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  14419. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  14420. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  14421. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  14422. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  14423. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  14424. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  14425. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  14426. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  14427. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  14428. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  14429. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  14430. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  14431. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  14432. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  14433. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  14434. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  14435. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  14436. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  14437. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  14438. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  14439. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  14440. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  14441. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  14442. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  14443. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  14444. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  14445. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  14446. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  14447. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  14448. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  14449. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  14450. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  14451. fgui.UIObjectFactory.setExtension(ui_Component9.URL, ui_Component9);
  14452. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  14453. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  14454. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  14455. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  14456. fgui.UIObjectFactory.setExtension(ui_Component16.URL, ui_Component16);
  14457. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  14458. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  14459. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  14460. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  14461. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  14462. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  14463. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  14464. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  14465. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  14466. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  14467. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  14468. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  14469. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  14470. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  14471. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  14472. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  14473. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  14474. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  14475. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  14476. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  14477. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  14478. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  14479. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  14480. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  14481. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  14482. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  14483. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  14484. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  14485. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  14486. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  14487. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  14488. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  14489. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  14490. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  14491. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  14492. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  14493. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  14494. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  14495. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  14496. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  14497. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  14498. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  14499. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  14500. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  14501. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  14502. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  14503. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  14504. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  14505. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  14506. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  14507. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  14508. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  14509. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  14510. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  14511. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  14512. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  14513. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  14514. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  14515. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  14516. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  14517. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  14518. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  14519. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  14520. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  14521. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  14522. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  14523. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  14524. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  14525. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  14526. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  14527. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  14528. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  14529. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  14530. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  14531. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  14532. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  14533. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  14534. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  14535. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  14536. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  14537. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  14538. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  14539. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  14540. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  14541. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  14542. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  14543. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  14544. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  14545. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  14546. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  14547. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  14548. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  14549. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  14550. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  14551. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  14552. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  14553. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  14554. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  14555. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  14556. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  14557. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  14558. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  14559. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  14560. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  14561. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  14562. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  14563. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  14564. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  14565. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  14566. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  14567. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  14568. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  14569. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  14570. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  14571. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  14572. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  14573. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  14574. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  14575. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  14576. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  14577. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  14578. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  14579. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  14580. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  14581. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  14582. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  14583. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  14584. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  14585. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  14586. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  14587. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  14588. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  14589. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  14590. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  14591. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  14592. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  14593. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  14594. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  14595. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  14596. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  14597. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  14598. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  14599. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  14600. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  14601. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  14602. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  14603. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  14604. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  14605. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  14606. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  14607. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  14608. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  14609. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  14610. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  14611. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  14612. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  14613. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  14614. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  14615. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  14616. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  14617. }
  14618. }
  14619. class ui_btn6 extends fgui.GButton {
  14620. static createInstance() {
  14621. return (fgui.UIPackage.createObject("loading", "btn6"));
  14622. }
  14623. onConstruct() {
  14624. this.n6 = (this.getChild("n6"));
  14625. this.n1 = (this.getChild("n1"));
  14626. }
  14627. }
  14628. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  14629. class ui_xyItem extends fgui.GComponent {
  14630. static createInstance() {
  14631. return (fgui.UIPackage.createObject("loading", "xyItem"));
  14632. }
  14633. onConstruct() {
  14634. this.xyItem = (this.getChild("xyItem"));
  14635. }
  14636. }
  14637. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  14638. class ui_loadinfo extends fgui.GProgressBar {
  14639. static createInstance() {
  14640. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  14641. }
  14642. onConstruct() {
  14643. this.bg = (this.getChild("bg"));
  14644. this.bar = (this.getChild("bar"));
  14645. this.title = (this.getChild("title"));
  14646. this.ani = (this.getChild("ani"));
  14647. }
  14648. }
  14649. ui_loadinfo.URL = "ui://37nctnhwis36c";
  14650. class ui_xyNode extends fgui.GComponent {
  14651. static createInstance() {
  14652. return (fgui.UIPackage.createObject("loading", "xyNode"));
  14653. }
  14654. onConstruct() {
  14655. this.n0 = (this.getChild("n0"));
  14656. this.btnYes = (this.getChild("btnYes"));
  14657. this.btnNo = (this.getChild("btnNo"));
  14658. this.btnKnown = (this.getChild("btnKnown"));
  14659. this.btnSure = (this.getChild("btnSure"));
  14660. this.txtWelcom = (this.getChild("txtWelcom"));
  14661. this.txtXy = (this.getChild("txtXy"));
  14662. this.n75 = (this.getChild("n75"));
  14663. this.btnXy1 = (this.getChild("btnXy1"));
  14664. this.btnXy3 = (this.getChild("btnXy3"));
  14665. this.btnXy2 = (this.getChild("btnXy2"));
  14666. this.n74 = (this.getChild("n74"));
  14667. this.xy1 = (this.getChild("xy1"));
  14668. this.txtTitle = (this.getChild("txtTitle"));
  14669. this.btnBack = (this.getChild("btnBack"));
  14670. this.xyList = (this.getChild("xyList"));
  14671. this.xy2 = (this.getChild("xy2"));
  14672. this.xyNode = (this.getChild("xyNode"));
  14673. }
  14674. }
  14675. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  14676. class ui_ageNode extends fgui.GComponent {
  14677. static createInstance() {
  14678. return (fgui.UIPackage.createObject("loading", "ageNode"));
  14679. }
  14680. onConstruct() {
  14681. this.n3 = (this.getChild("n3"));
  14682. this.n7 = (this.getChild("n7"));
  14683. this.n4 = (this.getChild("n4"));
  14684. this.btnAge = (this.getChild("btnAge"));
  14685. this.ageNode = (this.getChild("ageNode"));
  14686. }
  14687. }
  14688. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  14689. class ui_rnNode extends fgui.GComponent {
  14690. static createInstance() {
  14691. return (fgui.UIPackage.createObject("loading", "rnNode"));
  14692. }
  14693. onConstruct() {
  14694. this.n28 = (this.getChild("n28"));
  14695. this.n30 = (this.getChild("n30"));
  14696. this.n33 = (this.getChild("n33"));
  14697. this.rn1 = (this.getChild("rn1"));
  14698. this.n40 = (this.getChild("n40"));
  14699. this.n41 = (this.getChild("n41"));
  14700. this.rn3 = (this.getChild("rn3"));
  14701. this.n37 = (this.getChild("n37"));
  14702. this.n39 = (this.getChild("n39"));
  14703. this.rn2 = (this.getChild("rn2"));
  14704. this.n47 = (this.getChild("n47"));
  14705. this.n49 = (this.getChild("n49"));
  14706. this.n44 = (this.getChild("n44"));
  14707. this.inputCode = (this.getChild("inputCode"));
  14708. this.inputName = (this.getChild("inputName"));
  14709. this.n48 = (this.getChild("n48"));
  14710. this.n50 = (this.getChild("n50"));
  14711. this.rn4 = (this.getChild("rn4"));
  14712. this.btnCheck = (this.getChild("btnCheck"));
  14713. this.btnExit = (this.getChild("btnExit"));
  14714. this.btnDone = (this.getChild("btnDone"));
  14715. this.rnNode = (this.getChild("rnNode"));
  14716. }
  14717. }
  14718. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  14719. class ui_tipNode extends fgui.GComponent {
  14720. static createInstance() {
  14721. return (fgui.UIPackage.createObject("loading", "tipNode"));
  14722. }
  14723. onConstruct() {
  14724. this.bg = (this.getChild("bg"));
  14725. this.n55 = (this.getChild("n55"));
  14726. this.n56 = (this.getChild("n56"));
  14727. this.tipNode = (this.getChild("tipNode"));
  14728. }
  14729. }
  14730. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  14731. class ui_fcmNode extends fgui.GComponent {
  14732. static createInstance() {
  14733. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  14734. }
  14735. onConstruct() {
  14736. this.n63 = (this.getChild("n63"));
  14737. this.n62 = (this.getChild("n62"));
  14738. this.btnRn = (this.getChild("btnRn"));
  14739. this.n61 = (this.getChild("n61"));
  14740. this.n58 = (this.getChild("n58"));
  14741. this.fcmNode = (this.getChild("fcmNode"));
  14742. }
  14743. }
  14744. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  14745. class ui_msgNode extends fgui.GComponent {
  14746. static createInstance() {
  14747. return (fgui.UIPackage.createObject("loading", "msgNode"));
  14748. }
  14749. onConstruct() {
  14750. this.n69 = (this.getChild("n69"));
  14751. this.txtMsg = (this.getChild("txtMsg"));
  14752. this.msgNode = (this.getChild("msgNode"));
  14753. }
  14754. }
  14755. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  14756. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  14757. static createInstance() {
  14758. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  14759. }
  14760. onConstruct() {
  14761. this.n1 = (this.getChild("n1"));
  14762. this.n13 = (this.getChild("n13"));
  14763. this.n14 = (this.getChild("n14"));
  14764. this.n15 = (this.getChild("n15"));
  14765. this.n3 = (this.getChild("n3"));
  14766. this.n4 = (this.getChild("n4"));
  14767. this.n5 = (this.getChild("n5"));
  14768. this.n6 = (this.getChild("n6"));
  14769. this.n7 = (this.getChild("n7"));
  14770. this.n8 = (this.getChild("n8"));
  14771. this.n9 = (this.getChild("n9"));
  14772. this.n10 = (this.getChild("n10"));
  14773. this.n12 = (this.getChild("n12"));
  14774. this.n11 = (this.getChild("n11"));
  14775. this.n16 = (this.getChild("n16"));
  14776. this.n17 = (this.getChild("n17"));
  14777. this.n18 = (this.getChild("n18"));
  14778. this.n20 = (this.getChild("n20"));
  14779. this.n21 = (this.getChild("n21"));
  14780. this.t0 = this.getTransition("t0");
  14781. }
  14782. }
  14783. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  14784. class ui_btn5 extends fgui.GButton {
  14785. static createInstance() {
  14786. return (fgui.UIPackage.createObject("loading", "btn5"));
  14787. }
  14788. onConstruct() {
  14789. this.n9 = (this.getChild("n9"));
  14790. this.n1 = (this.getChild("n1"));
  14791. }
  14792. }
  14793. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  14794. class ui_UILoading extends fgui.GComponent {
  14795. static createInstance() {
  14796. return (fgui.UIPackage.createObject("loading", "UILoading"));
  14797. }
  14798. onConstruct() {
  14799. this.n12 = (this.getChild("n12"));
  14800. this.loadinfo = (this.getChild("loadinfo"));
  14801. this.n13 = (this.getChild("n13"));
  14802. this.txtLoad = (this.getChild("txtLoad"));
  14803. this.n18 = (this.getChild("n18"));
  14804. }
  14805. }
  14806. ui_UILoading.URL = "ui://37nctnhwphc33";
  14807. class ui_AgeItem extends fgui.GComponent {
  14808. static createInstance() {
  14809. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  14810. }
  14811. onConstruct() {
  14812. this.txtAge = (this.getChild("txtAge"));
  14813. }
  14814. }
  14815. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  14816. class ui_btn1 extends fgui.GButton {
  14817. static createInstance() {
  14818. return (fgui.UIPackage.createObject("loading", "btn1"));
  14819. }
  14820. onConstruct() {
  14821. this.n6 = (this.getChild("n6"));
  14822. this.n1 = (this.getChild("n1"));
  14823. }
  14824. }
  14825. ui_btn1.URL = "ui://37nctnhwxe622p";
  14826. class ui_btn3 extends fgui.GButton {
  14827. static createInstance() {
  14828. return (fgui.UIPackage.createObject("loading", "btn3"));
  14829. }
  14830. onConstruct() {
  14831. this.n9 = (this.getChild("n9"));
  14832. this.n1 = (this.getChild("n1"));
  14833. }
  14834. }
  14835. ui_btn3.URL = "ui://37nctnhwxe622s";
  14836. class ui_btn2 extends fgui.GButton {
  14837. static createInstance() {
  14838. return (fgui.UIPackage.createObject("loading", "btn2"));
  14839. }
  14840. onConstruct() {
  14841. this.n6 = (this.getChild("n6"));
  14842. this.n1 = (this.getChild("n1"));
  14843. }
  14844. }
  14845. ui_btn2.URL = "ui://37nctnhwxe622t";
  14846. class ui_btnBack extends fgui.GButton {
  14847. static createInstance() {
  14848. return (fgui.UIPackage.createObject("loading", "btnBack"));
  14849. }
  14850. onConstruct() {
  14851. this.n6 = (this.getChild("n6"));
  14852. this.n7 = (this.getChild("n7"));
  14853. }
  14854. }
  14855. ui_btnBack.URL = "ui://37nctnhwxe622u";
  14856. class ui_btnXy1 extends fgui.GButton {
  14857. static createInstance() {
  14858. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  14859. }
  14860. onConstruct() {
  14861. this.n1 = (this.getChild("n1"));
  14862. }
  14863. }
  14864. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  14865. class ui_btnXy2 extends fgui.GButton {
  14866. static createInstance() {
  14867. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  14868. }
  14869. onConstruct() {
  14870. this.n1 = (this.getChild("n1"));
  14871. }
  14872. }
  14873. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  14874. class ui_btnXy3 extends fgui.GButton {
  14875. static createInstance() {
  14876. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  14877. }
  14878. onConstruct() {
  14879. this.n1 = (this.getChild("n1"));
  14880. }
  14881. }
  14882. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  14883. class ui_btn4 extends fgui.GButton {
  14884. static createInstance() {
  14885. return (fgui.UIPackage.createObject("loading", "btn4"));
  14886. }
  14887. onConstruct() {
  14888. this.n9 = (this.getChild("n9"));
  14889. this.n1 = (this.getChild("n1"));
  14890. }
  14891. }
  14892. ui_btn4.URL = "ui://37nctnhwxe622z";
  14893. class loadingBinder {
  14894. static bindAll() {
  14895. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  14896. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  14897. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  14898. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  14899. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  14900. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  14901. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  14902. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  14903. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  14904. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  14905. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  14906. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  14907. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  14908. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  14909. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  14910. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  14911. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  14912. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  14913. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  14914. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  14915. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  14916. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  14917. }
  14918. }
  14919. class UIMgr {
  14920. constructor() {
  14921. this._stage = null;
  14922. this._uiList = [];
  14923. this._showList = [];
  14924. this._bindPkgList = [];
  14925. this.uiIndex = 0;
  14926. }
  14927. static get inst() {
  14928. if (UIMgr._inst == null) {
  14929. UIMgr._inst = new UIMgr();
  14930. }
  14931. return UIMgr._inst;
  14932. }
  14933. setStage(s) {
  14934. if (this._stage) {
  14935. console.log("ViewMgr::Stage->舞台不可赋值两次");
  14936. return;
  14937. }
  14938. this._stage = s;
  14939. }
  14940. init() {
  14941. this.setStage(Laya.stage);
  14942. fairygui.UIConfig.defaultFont = "微软雅黑";
  14943. fairygui.UIConfig.modalLayerColor = "rgba(0,0,0,0.9)";
  14944. fairygui.UIConfig.packageFileExtension = "obj";
  14945. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  14946. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  14947. fairygui.GRoot.inst.width = Laya.stage.width;
  14948. fairygui.GRoot.inst.height = Laya.stage.height;
  14949. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  14950. }
  14951. addAllUpdate() {
  14952. this.uiIndex = 0;
  14953. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  14954. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  14955. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  14956. }
  14957. }
  14958. }
  14959. bindFUI(pkgname) {
  14960. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  14961. return;
  14962. }
  14963. switch (pkgname) {
  14964. case fguiRes.loading:
  14965. fairygui.UIPackage.addPackage(pkgname);
  14966. loadingBinder.bindAll();
  14967. this._bindPkgList.push(pkgname);
  14968. break;
  14969. case fguiRes.game:
  14970. fairygui.UIPackage.addPackage(pkgname);
  14971. gameBinder.bindAll();
  14972. this._bindPkgList.push(pkgname);
  14973. break;
  14974. default:
  14975. break;
  14976. }
  14977. }
  14978. Show(cls, ...param) {
  14979. let nameStr = cls.uiName;
  14980. for (let i = this._uiList.length - 1; i >= 0; i--) {
  14981. let temp = this._uiList[i];
  14982. let str = temp.className;
  14983. if (str == nameStr) {
  14984. if (temp.isMuti) {
  14985. if (temp.isHide) {
  14986. temp.show(...param);
  14987. this._uiList.splice(i, 1);
  14988. this._uiList.push(temp);
  14989. return temp;
  14990. }
  14991. }
  14992. else {
  14993. temp.show(...param);
  14994. this._uiList.splice(i, 1);
  14995. this._uiList.push(temp);
  14996. return temp;
  14997. }
  14998. }
  14999. }
  15000. let ui = new cls();
  15001. ui.className = nameStr;
  15002. this._showUI(ui, param);
  15003. return ui;
  15004. }
  15005. destroyUI(ui) {
  15006. for (let i = this._uiList.length - 1; i >= 0; i--) {
  15007. let temp = this._uiList[i].className;
  15008. if (temp == ui.className) {
  15009. this._uiList.splice(i, 1);
  15010. break;
  15011. }
  15012. }
  15013. this.checkUIState();
  15014. }
  15015. _showUI(ui, param) {
  15016. this._uiList.push(ui);
  15017. ui.show(...param);
  15018. }
  15019. Hide(uiClass) {
  15020. let ui = this.getUI(uiClass);
  15021. if (ui && !ui.isHide) {
  15022. ui.hide();
  15023. }
  15024. }
  15025. getUI(ui) {
  15026. let nameStr = ui.uiName;
  15027. for (let index = 0; index < this._uiList.length; index++) {
  15028. let temp = this._uiList[index];
  15029. if (temp.className == nameStr) {
  15030. return temp;
  15031. }
  15032. }
  15033. return null;
  15034. }
  15035. isShow(cls) {
  15036. for (var i of this._uiList) {
  15037. if (i instanceof cls) {
  15038. return i.isShowing;
  15039. }
  15040. }
  15041. return false;
  15042. }
  15043. showUINum() {
  15044. let num = 0;
  15045. for (var i of this._uiList) {
  15046. if (i.isShowing) {
  15047. num++;
  15048. }
  15049. }
  15050. return num;
  15051. }
  15052. checkUIState() {
  15053. Laya.timer.clear(this, this._uiCheck);
  15054. Laya.timer.once(400, this, this._uiCheck);
  15055. }
  15056. _uiCheck() {
  15057. let showList = [];
  15058. for (var i of this._uiList) {
  15059. if (!i.isHide) {
  15060. showList.push(i);
  15061. }
  15062. }
  15063. for (let index = 0; index < showList.length; index++) {
  15064. if (index == showList.length - 1) {
  15065. showList[index].checkActive(true);
  15066. }
  15067. else {
  15068. showList[index].checkActive(false);
  15069. }
  15070. }
  15071. }
  15072. showTip(msg, time = 600, size = 30) {
  15073. }
  15074. }
  15075. class UIShowList {
  15076. }
  15077. class SoundMgr {
  15078. constructor() {
  15079. this.soundMax = 4;
  15080. this.isLoad = false;
  15081. this.soundMap = {};
  15082. this.isSound = true;
  15083. this.openShake = true;
  15084. SoundMgr._instance = this;
  15085. }
  15086. static getInstance() {
  15087. if (!this._instance) {
  15088. this._instance = new SoundMgr();
  15089. }
  15090. return this._instance;
  15091. }
  15092. init() {
  15093. console.log('zh:sm init 1');
  15094. Laya.SoundManager.autoReleaseSound = true;
  15095. Laya.SoundManager.autoStopMusic = true;
  15096. Laya.SoundManager.musicVolume = 0.3;
  15097. Laya.SoundManager.soundVolume = 0.5;
  15098. this.musicPlayed = false;
  15099. this.audioUrl = "asset/sound/ogg/";
  15100. console.log('zh:sm init 2');
  15101. console.log('zh:dev type ');
  15102. if (Laya.Browser.onAndroid) {
  15103. console.log('zh:dev type android');
  15104. this.audioUrl = "asset/sound/ogg/";
  15105. this.isLoad = true;
  15106. }
  15107. else {
  15108. console.log('zh:dev type not android');
  15109. this.audioUrl = "asset/sound/mp3/";
  15110. this.isLoad = true;
  15111. }
  15112. }
  15113. onSetting(isS) {
  15114. this.isSound = isS;
  15115. this.mute(!this.isSound);
  15116. }
  15117. clearCount() {
  15118. for (var key in this.soundMap) {
  15119. delete this.soundMap[key];
  15120. }
  15121. }
  15122. playMusic(path, loop = 0) {
  15123. console.log('zh:playMusic 1 PATH=' + path);
  15124. this.musicPath = path;
  15125. if (!this.isLoad)
  15126. console.log('zh:playMusic 2');
  15127. return;
  15128. if (!path || path == "")
  15129. console.log('zh:playMusic 3');
  15130. return;
  15131. if (!this.isSound)
  15132. console.log('zh:playMusic 4');
  15133. return;
  15134. this.musicPlayed = true;
  15135. console.log('zh:playMusic 5');
  15136. let url = this.getUrl(path);
  15137. console.log('zh:playMusic 6' + url);
  15138. if (Laya.Browser.onPC) {
  15139. console.log('zh:playMusic 7');
  15140. Laya.loader.load(url, Laya.Handler.create(this, () => {
  15141. console.log('zh:playMusic 8');
  15142. this.play(url, loop);
  15143. }));
  15144. }
  15145. else
  15146. this.play(url, loop);
  15147. }
  15148. play(url, loop) {
  15149. Laya.SoundManager.playMusic(url, loop);
  15150. }
  15151. getUrl(path) {
  15152. let url = this.audioUrl + path;
  15153. if (Laya.Browser.onAndroid) {
  15154. url += ".ogg";
  15155. }
  15156. else {
  15157. url += ".mp3";
  15158. }
  15159. return url;
  15160. }
  15161. pauseMusic(pause) {
  15162. if (pause) {
  15163. this.mute(true);
  15164. }
  15165. else if (this.isSound)
  15166. this.mute(false);
  15167. }
  15168. stopMusic() {
  15169. Laya.SoundManager.stopMusic();
  15170. if (Moyu.isNeedPlatAudio) {
  15171. Moyu.stopMusic();
  15172. }
  15173. }
  15174. mute(mute) {
  15175. if (Moyu.isNeedPlatAudio) {
  15176. Moyu.pauseMusic(mute);
  15177. }
  15178. else {
  15179. Laya.SoundManager.musicMuted = mute;
  15180. if (!mute && !this.musicPlayed && this.musicPath) {
  15181. this.playMusic(this.musicPath);
  15182. }
  15183. }
  15184. }
  15185. stopSound(path) {
  15186. let url = this.getUrl(path);
  15187. Laya.SoundManager.stopSound(url);
  15188. }
  15189. playSound(path, loop = 1, soundMax = this.soundMax) {
  15190. if (!this.isLoad)
  15191. return;
  15192. if (!this.isSound)
  15193. return;
  15194. if (!path || path == "")
  15195. return;
  15196. let url = this.getUrl(path);
  15197. if (Moyu.isNeedPlatAudio) {
  15198. Moyu.playSound(path, loop == 0);
  15199. }
  15200. else {
  15201. let count = 1;
  15202. if (this.soundMap[path])
  15203. count = this.soundMap[path] + 1;
  15204. if (count > soundMax)
  15205. return;
  15206. this.soundMap[path] = count;
  15207. Laya.SoundManager.playSound(url, loop);
  15208. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  15209. }
  15210. }
  15211. removePath(path) {
  15212. if (this.soundMap[path]) {
  15213. let count = this.soundMap[path];
  15214. count--;
  15215. if (count < 1)
  15216. delete this.soundMap[path];
  15217. else
  15218. this.soundMap[path] = count;
  15219. }
  15220. }
  15221. playBtnSound() {
  15222. this.playSound("btn");
  15223. }
  15224. playGetSound() {
  15225. }
  15226. playCloseUISound() {
  15227. }
  15228. }
  15229. SoundMgr._instance = null;
  15230. var Handler$1 = Laya.Handler;
  15231. var EResType;
  15232. (function (EResType) {
  15233. EResType[EResType["none"] = 0] = "none";
  15234. EResType[EResType["nromal"] = 1] = "nromal";
  15235. EResType[EResType["td"] = 2] = "td";
  15236. EResType[EResType["sk"] = 3] = "sk";
  15237. })(EResType || (EResType = {}));
  15238. class CResLoader {
  15239. constructor(doneCall, proCall) {
  15240. this.completrCall = doneCall;
  15241. this.progressCall = proCall;
  15242. this.progressHander = new Handler$1(this, this.onProgress);
  15243. this.tdResMap = {};
  15244. }
  15245. load(resList) {
  15246. this.resCount = 0;
  15247. this.loadCount = 0;
  15248. for (let i = 0; i < resList.length; i++) {
  15249. let path = resList[i];
  15250. if (!path)
  15251. continue;
  15252. this.resCount++;
  15253. let type = this.getResType(path);
  15254. if (type == EResType.nromal)
  15255. this.loadNromal(path);
  15256. else if (type == EResType.td)
  15257. this.loadTd(path);
  15258. }
  15259. }
  15260. getRes(path) {
  15261. let type = this.getResType(path);
  15262. if (type == EResType.nromal)
  15263. return Laya.loader.getRes(path);
  15264. else if (type == EResType.td) {
  15265. let res = this.tdResMap[path];
  15266. if (res)
  15267. return res.clone();
  15268. return null;
  15269. }
  15270. }
  15271. destroy() {
  15272. this.progressHander.clear();
  15273. this.progressHander = null;
  15274. }
  15275. clearRes(path) {
  15276. let type = this.getResType(path);
  15277. if (type == EResType.nromal)
  15278. Laya.loader.clearRes(path);
  15279. else if (type == EResType.td) {
  15280. let obj = this.tdResMap[path];
  15281. if (obj)
  15282. obj.destroy();
  15283. delete this.tdResMap[path];
  15284. }
  15285. }
  15286. getResType(path) {
  15287. let exs = this.getExtension(path);
  15288. if (exs == "sk")
  15289. return EResType.sk;
  15290. if (exs == "ls" || exs == "lh" || exs == "lm")
  15291. return EResType.td;
  15292. else
  15293. return EResType.nromal;
  15294. }
  15295. getExtension(res) {
  15296. var index = res.lastIndexOf(".");
  15297. return res.substr(index + 1);
  15298. }
  15299. loadNromal(path) {
  15300. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  15301. if (res) {
  15302. this.onLoad();
  15303. }
  15304. else
  15305. console.log("load res fail:" + path);
  15306. }), this.progressHander);
  15307. }
  15308. loadSk() {
  15309. }
  15310. loadTd(path) {
  15311. if (this.tdResMap[path]) {
  15312. this.onLoad();
  15313. return;
  15314. }
  15315. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  15316. if (res) {
  15317. this.tdResMap[path] = res;
  15318. this.onLoad();
  15319. }
  15320. else
  15321. console.log("load res fail:" + path);
  15322. }));
  15323. }
  15324. onLoad() {
  15325. this.loadCount++;
  15326. this.onProgress(1);
  15327. if (this.loadCount >= this.resCount) {
  15328. this.completrCall.run();
  15329. }
  15330. }
  15331. onProgress(pro) {
  15332. let progress = (this.loadCount + pro) / this.resCount;
  15333. this.progressCall.runWith(progress);
  15334. }
  15335. }
  15336. var Handler$2 = Laya.Handler;
  15337. class ResInfo {
  15338. constructor() {
  15339. this.index = 0;
  15340. }
  15341. }
  15342. class ResMgr {
  15343. constructor() {
  15344. this.resList = [];
  15345. this.doneList = [];
  15346. this.resMap = {};
  15347. this.currentLoad = null;
  15348. this.completeHandler = new Handler$2(this, this.onComplete);
  15349. this.progressHandler = new Handler$2(this, this.onProgress);
  15350. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  15351. }
  15352. static getInstance() {
  15353. if (ResMgr._instance == null) {
  15354. ResMgr._instance = new ResMgr();
  15355. }
  15356. return ResMgr._instance;
  15357. }
  15358. loadList(list, completeHandler, progressHandler) {
  15359. if (list.length < 1) {
  15360. completeHandler.run();
  15361. return;
  15362. }
  15363. let info = this.getResInfo();
  15364. info.resList = list;
  15365. info.completeHandler = completeHandler;
  15366. info.progressHandler = progressHandler;
  15367. this.resList.push(info);
  15368. this.startLoad();
  15369. }
  15370. loadFguiRes(list, completeHandler, progressHandler) {
  15371. Laya.loader.load(list, completeHandler, progressHandler);
  15372. }
  15373. loadAny(list, completeHandler, progressHandler) {
  15374. Laya.loader.load(list, completeHandler, progressHandler);
  15375. }
  15376. load(path, completeHandler, progressHandler) {
  15377. let count = this.resMap[path];
  15378. if (count && count > 0) {
  15379. if (completeHandler)
  15380. completeHandler.run();
  15381. }
  15382. else
  15383. this.loadList([path], completeHandler, progressHandler);
  15384. }
  15385. getRes(path) {
  15386. let res = this.resMap[path];
  15387. if (!res)
  15388. this.showLog("资源不存在:" + path);
  15389. else
  15390. return this.loader.getRes(path);
  15391. }
  15392. clearList(list, force = false) {
  15393. if (!list || list.length < 1)
  15394. return;
  15395. let cr = () => {
  15396. for (const k in list) {
  15397. let v = list[k];
  15398. if (!v)
  15399. continue;
  15400. if (force) {
  15401. this.loader.clearRes(v);
  15402. delete this.resMap[v];
  15403. }
  15404. else {
  15405. let count = this.resMap[v];
  15406. if (count && count > 1) {
  15407. count--;
  15408. this.resMap[v] = count;
  15409. }
  15410. else {
  15411. this.loader.clearRes(v);
  15412. delete this.resMap[v];
  15413. }
  15414. }
  15415. }
  15416. if (!window.hasOwnProperty("ks"))
  15417. Laya.Resource.destroyUnusedResources();
  15418. };
  15419. Laya.timer.clearAll(this);
  15420. Laya.timer.once(2000, this, cr);
  15421. }
  15422. clear3D() {
  15423. for (const k in this.loader.tdResMap) {
  15424. this.loader.clearRes(k);
  15425. if (this.resMap[k])
  15426. delete this.resMap[k];
  15427. }
  15428. if (!window.hasOwnProperty("ks"))
  15429. Laya.Resource.destroyUnusedResources();
  15430. }
  15431. clear(path, force = false) {
  15432. this.clearList([path], force);
  15433. }
  15434. getResInfo() {
  15435. if (this.doneList.length > 0)
  15436. return this.doneList.pop();
  15437. else
  15438. return new ResInfo();
  15439. }
  15440. startLoad() {
  15441. if (this.currentLoad)
  15442. return;
  15443. this.currentLoad = this.resList.pop();
  15444. if (this.currentLoad) {
  15445. this.loader.load(this.currentLoad.resList);
  15446. }
  15447. }
  15448. onComplete() {
  15449. if (!this.currentLoad)
  15450. return;
  15451. for (const k in this.currentLoad.resList) {
  15452. let v = this.currentLoad.resList[k];
  15453. let count = this.resMap[v];
  15454. if (count)
  15455. count++;
  15456. else
  15457. count = 1;
  15458. this.resMap[v] = count;
  15459. }
  15460. if (this.currentLoad.completeHandler)
  15461. this.currentLoad.completeHandler.run();
  15462. this.doneList.push(this.currentLoad);
  15463. this.currentLoad = null;
  15464. this.startLoad();
  15465. }
  15466. onProgress(pro) {
  15467. if (!this.currentLoad)
  15468. return;
  15469. if (this.currentLoad.progressHandler)
  15470. this.currentLoad.progressHandler.runWith(pro);
  15471. }
  15472. showLog(str, ...args) {
  15473. console.log("[ResLoader] " + str);
  15474. }
  15475. }
  15476. ResMgr._instance = null;
  15477. class EventMgr extends Laya.EventDispatcher {
  15478. }
  15479. let eventMgr = new EventMgr();
  15480. class ConfigMgr {
  15481. static getInstance() {
  15482. if (!this._instance) {
  15483. this._instance = new ConfigMgr();
  15484. }
  15485. return this._instance;
  15486. }
  15487. init() {
  15488. this.npcJson = Laya.loader.getRes("res/json/npc.json").Data;
  15489. this.classicCfg = Laya.loader.getRes("res/json/classicCfg.json");
  15490. this.levelCfg = Laya.loader.getRes("res/json/levelCfg.json");
  15491. this.placeBallCfg = Laya.loader.getRes("res/json/placeBallCfg.json");
  15492. }
  15493. getUserInfoByIndex(index) {
  15494. return this.npcJson[index];
  15495. }
  15496. getRandomUserInfo() {
  15497. let index = xGame.tools.random(0, this.npcJson.length);
  15498. return this.npcJson[index];
  15499. }
  15500. getMaxBigMoveLength() {
  15501. return Object.keys(this.levelCfg).length;
  15502. }
  15503. getBigMoveLevelByIndex(index) {
  15504. let cfg = this.levelCfg;
  15505. cfg = cfg[index];
  15506. return cfg;
  15507. }
  15508. getRandomClassicLevel() {
  15509. let cfg = this.classicCfg;
  15510. let num = Object.keys(cfg).length;
  15511. let rand = xGame.common.randomNum(1, num);
  15512. return cfg[rand];
  15513. }
  15514. getPlaceBallByLevel(level) {
  15515. return this.placeBallCfg[level];
  15516. }
  15517. getMaxPlaceBall() {
  15518. return Object.keys(this.placeBallCfg).length;
  15519. }
  15520. }
  15521. class PoolD3Mgr {
  15522. constructor() {
  15523. this.pool = {};
  15524. }
  15525. static get ins() {
  15526. return this._ins || (this._ins = new PoolD3Mgr);
  15527. }
  15528. createList(key, prefab, parent) {
  15529. if (!this.pool[key]) {
  15530. this.pool[key] = {};
  15531. this.pool[key].prefab = prefab;
  15532. this.pool[key].list = [];
  15533. this.pool[key].parent = parent;
  15534. }
  15535. }
  15536. getItem(key) {
  15537. if (!this.pool[key]) {
  15538. return;
  15539. }
  15540. let temp;
  15541. if (this.pool[key].list.length > 0) {
  15542. temp = this.pool[key].list.pop();
  15543. }
  15544. else {
  15545. temp = this.pool[key].prefab.clone();
  15546. if (this.pool[key].parent) {
  15547. this.pool[key].parent.addChild(temp);
  15548. }
  15549. }
  15550. temp.active = true;
  15551. return temp;
  15552. }
  15553. putItem(key, obj) {
  15554. if (!this.pool[key]) {
  15555. return;
  15556. }
  15557. obj.active = false;
  15558. this.pool[key].list.push(obj);
  15559. }
  15560. }
  15561. let context$1 = context;
  15562. let uiMgr = UIMgr.inst;
  15563. let soundMgr = SoundMgr.getInstance();
  15564. let resMgr = ResMgr.getInstance();
  15565. let httpMgr = HttpMgr.getInstance();
  15566. let common = Common.getInstance();
  15567. let cfgMgr = ConfigMgr.getInstance();
  15568. let poolD3Mgr = PoolD3Mgr.ins;
  15569. let d3TexUrl = "res/d3Res/";
  15570. let d3ModeUrl = "res/unityRes/";
  15571. function setStageSize(view) {
  15572. if (view.width) {
  15573. view.width = Laya.stage.width;
  15574. view.height = Laya.stage.height;
  15575. }
  15576. }
  15577. function filledBg(view) {
  15578. let wh = Laya.stage.height / Laya.stage.width;
  15579. if (wh > 16 / 9) {
  15580. view.height = Laya.stage.height;
  15581. view.width = Laya.stage.height / 1334 * 750;
  15582. }
  15583. else {
  15584. view.width = Laya.stage.width;
  15585. view.height = Laya.stage.width / 750 * 1334;
  15586. }
  15587. }
  15588. function setNotch(view) {
  15589. if (view.height) {
  15590. view.y += context$1.notchHeight;
  15591. }
  15592. }
  15593. function showTip(str) {
  15594. uiMgr.Show(UIMsg, str);
  15595. }
  15596. function log(...args) {
  15597. console.log(args);
  15598. }
  15599. let xGame = {
  15600. context: context$1,
  15601. eventMgr,
  15602. resMgr,
  15603. uiMgr,
  15604. soundMgr,
  15605. define,
  15606. tools,
  15607. httpMgr,
  15608. d3TexUrl,
  15609. d3ModeUrl,
  15610. common,
  15611. cfgMgr,
  15612. poolD3Mgr,
  15613. setStageSize,
  15614. filledBg,
  15615. setNotch,
  15616. showTip,
  15617. log,
  15618. };
  15619. window["xGame"] = xGame;
  15620. let dataName = 'tBall_';
  15621. class UserData {
  15622. constructor() {
  15623. this.userId = "";
  15624. this.isAgree = false;
  15625. this.coinNum = 0;
  15626. this.gemNum = 0;
  15627. this.sound = true;
  15628. this.vibration = true;
  15629. this.currentDate = 0;
  15630. this.createTime = 0;
  15631. this.awardTime = 0;
  15632. this.roleId = 1;
  15633. this.roleList = [];
  15634. this.roleAds = [];
  15635. this.dressId = 101;
  15636. this.itemId = 201;
  15637. this.bigSkills = [1, 1, 1, 1, 1];
  15638. this.coin = 4000;
  15639. this.diamond = 0;
  15640. this.skillSuccessTimes = 0;
  15641. this.skillGuide = 0;
  15642. this.skillAccTimes = 0;
  15643. this.placeBallData = [];
  15644. this.shareDiamondTimes = 0;
  15645. this.dailyVideoShareTimes = 0;
  15646. this.secretary = [1, 0];
  15647. this.curSecretary = 0;
  15648. this.ballRod = [1, 0, 0, 0, 0, 1];
  15649. this.curBallRod = 5;
  15650. this.signData = 0;
  15651. this.signTime = 0;
  15652. this.drawTimes = 0;
  15653. this.drawAwardTimes = 0;
  15654. this.dailyfreeDrawTimes = 1;
  15655. this.power = 5;
  15656. this.powerTime = 0;
  15657. this.challengeTimes = 0;
  15658. this.extraSign = 0;
  15659. this.classicTimes = 0;
  15660. this.guideHelpLine = 0;
  15661. this.newUser = true;
  15662. this.rootBallFoul = 0;
  15663. this.timeoutFoul = 0;
  15664. this.roleList = [1];
  15665. }
  15666. saveData() {
  15667. let data = {};
  15668. for (let k in this) {
  15669. data[k.toString()] = this[k];
  15670. }
  15671. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  15672. }
  15673. getData() {
  15674. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  15675. if (ld) {
  15676. let localData = JSON.parse(ld);
  15677. if (localData) {
  15678. for (let k in this) {
  15679. let key = k.toString();
  15680. let data = localData[key];
  15681. if (data != undefined) {
  15682. this[k] = data;
  15683. }
  15684. }
  15685. }
  15686. }
  15687. }
  15688. }
  15689. class ItemData {
  15690. constructor() {
  15691. this.itemList = {};
  15692. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  15693. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  15694. }
  15695. saveData() {
  15696. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  15697. }
  15698. getData() {
  15699. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  15700. if (ld) {
  15701. let localData = JSON.parse(ld);
  15702. if (localData) {
  15703. this.itemList = localData;
  15704. }
  15705. }
  15706. }
  15707. }
  15708. class GameData {
  15709. constructor() {
  15710. this.curLevel = 0;
  15711. this.gameType = 1;
  15712. this.signIdx = 0;
  15713. this.signMax = 0;
  15714. this.rotaryTime = 0;
  15715. this.rotaryCount = 0;
  15716. this.rotaryList = [];
  15717. this.diyCount = 3;
  15718. this.awardIdx = 0;
  15719. this.shareNum = 2;
  15720. this.rankWeek = 0;
  15721. this.rankScore = 0;
  15722. this.gameCount = 0;
  15723. this.trySkill = -1;
  15724. this.tryTime = 0;
  15725. }
  15726. saveData() {
  15727. let data = {};
  15728. for (let k in this) {
  15729. data[k.toString()] = this[k];
  15730. }
  15731. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  15732. }
  15733. getData() {
  15734. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  15735. if (ld) {
  15736. let localData = JSON.parse(ld);
  15737. if (localData) {
  15738. for (let k in this) {
  15739. let key = k.toString();
  15740. let data = localData[key];
  15741. if (data != undefined) {
  15742. this[k] = data;
  15743. }
  15744. }
  15745. }
  15746. }
  15747. }
  15748. }
  15749. class DataMgr {
  15750. static Init() {
  15751. this.userData = new UserData();
  15752. this.gameData = new GameData();
  15753. this.itemData = new ItemData();
  15754. this.userData.getData();
  15755. this.gameData.getData();
  15756. this.itemData.getData();
  15757. this.roleId = this.userData.roleId;
  15758. this.resetUse();
  15759. }
  15760. static isNewDay() {
  15761. Moyu.isNewDay(this, (isnew) => {
  15762. xGame.common.isNewDay = isnew;
  15763. if (!isnew)
  15764. return;
  15765. DataMgr.setShareDiamondTimes(0, false);
  15766. DataMgr.setDailyVideoShareTimes(0, false);
  15767. DataMgr.setDailyfreeDrawTimes(1);
  15768. DataMgr.setExtraSign(0);
  15769. });
  15770. }
  15771. static deletData() {
  15772. Laya.LocalStorage.clear();
  15773. }
  15774. static upRankData() {
  15775. let num = xGame.common.getAllStarNum();
  15776. if (num > 0)
  15777. Moyu.upRankData(xGame.common.curRankID, num);
  15778. }
  15779. static addItem(id, count = 1) {
  15780. let v = this.itemData.itemList[id];
  15781. if (!v)
  15782. v = { id: id, count: count, adnum: 0, active: true };
  15783. else {
  15784. if (v.active) {
  15785. v.count += count;
  15786. }
  15787. else {
  15788. v.count = count;
  15789. v.active = true;
  15790. }
  15791. }
  15792. this.itemData.itemList[id] = v;
  15793. xGame.soundMgr.playGetSound();
  15794. this.saveItemData();
  15795. }
  15796. static hasItem(id) {
  15797. let v = this.itemData.itemList[id];
  15798. if (v && v.active)
  15799. return true;
  15800. return false;
  15801. }
  15802. static getItem(id) {
  15803. let v = this.itemData.itemList[id];
  15804. return v;
  15805. }
  15806. static getItemCount(id) {
  15807. let v = this.itemData.itemList[id];
  15808. if (v && v.active)
  15809. return v.count;
  15810. return 0;
  15811. }
  15812. static getItemAd(id) {
  15813. let v = this.itemData.itemList[id];
  15814. if (v) {
  15815. return v.adnum;
  15816. }
  15817. return 0;
  15818. }
  15819. static onItemAd(id, num = 1) {
  15820. let v = this.itemData.itemList[id];
  15821. if (!v)
  15822. v = { id: id, count: 1, adnum: num, active: false };
  15823. else
  15824. v.adnum += num;
  15825. this.itemData.itemList[id] = v;
  15826. this.saveItemData();
  15827. }
  15828. static costItem(id, count) {
  15829. let v = this.itemData.itemList[id];
  15830. if (v && v.active) {
  15831. if (v.count < count)
  15832. return false;
  15833. else {
  15834. v.count -= count;
  15835. this.itemData.itemList[id] = v;
  15836. return true;
  15837. }
  15838. }
  15839. return false;
  15840. }
  15841. static resetUse() {
  15842. this.dressId = this.userData.dressId;
  15843. this.itemId = this.userData.itemId;
  15844. }
  15845. static passLevel() {
  15846. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  15847. this.gameData.curLevel++;
  15848. this.curLevel = this.gameData.curLevel;
  15849. this.saveGameData();
  15850. }
  15851. static useRole(id) {
  15852. this.roleId = id;
  15853. if (this.hasRole(id)) {
  15854. this.userData.roleId = id;
  15855. this.saveUserData();
  15856. }
  15857. }
  15858. static addRole(id) {
  15859. if (this.hasRole(id))
  15860. return;
  15861. this.userData.roleList.push(id);
  15862. this.saveUserData();
  15863. }
  15864. static hasRole(id) {
  15865. return this.userData.roleList.indexOf(id) >= 0;
  15866. }
  15867. static gemEnough(num) {
  15868. return this.userData.gemNum >= num;
  15869. }
  15870. static roleHasAd(id) {
  15871. let count = this.userData.roleAds[id];
  15872. if (count != undefined && count >= 0)
  15873. return true;
  15874. else
  15875. return false;
  15876. }
  15877. static saveUserData(time = 1000, event, arg) {
  15878. if (this.userSaving)
  15879. return;
  15880. this.userSaving = true;
  15881. Laya.timer.once(time, this, () => {
  15882. this.userSaving = false;
  15883. this.userData.saveData();
  15884. if (event)
  15885. xGame.eventMgr.event(event, arg);
  15886. });
  15887. }
  15888. static saveGameData() {
  15889. if (this.gameSaving)
  15890. return;
  15891. this.gameSaving = true;
  15892. Laya.timer.once(1000, this, () => {
  15893. this.gameSaving = false;
  15894. this.gameData.saveData();
  15895. });
  15896. }
  15897. static saveItemData() {
  15898. let fun = () => {
  15899. this.itemData.saveData();
  15900. };
  15901. Laya.timer.clear(this, fun);
  15902. Laya.timer.once(500, this, fun);
  15903. }
  15904. static saveData() {
  15905. this.saveUserData();
  15906. this.saveGameData();
  15907. }
  15908. static getBigSkillList() {
  15909. return this.userData.bigSkills;
  15910. }
  15911. static getBigSkillByIndex(index) {
  15912. return this.userData.bigSkills[index];
  15913. }
  15914. static setBigSkill(index, val, addUp = true) {
  15915. if (addUp) {
  15916. this.userData.bigSkills[index] += val;
  15917. }
  15918. else {
  15919. this.userData.bigSkills[index] = val;
  15920. }
  15921. this.saveUserData();
  15922. }
  15923. static coinEnough(need) {
  15924. if (typeof need != "number") {
  15925. console.error("金币格式错误");
  15926. return;
  15927. }
  15928. return this.userData.coin >= need;
  15929. }
  15930. static setCoin(val) {
  15931. if (typeof val != "number") {
  15932. return;
  15933. }
  15934. this.userData.coin += val;
  15935. this.saveUserData();
  15936. xGame.eventMgr.event(COIN_CHANGE);
  15937. }
  15938. static getCoin() {
  15939. return this.userData.coin;
  15940. }
  15941. static diamondEnough(need) {
  15942. if (typeof need != "number") {
  15943. console.error("金币格式错误");
  15944. return;
  15945. }
  15946. return this.userData.diamond >= need;
  15947. }
  15948. static setDiamond(val) {
  15949. if (typeof val != "number") {
  15950. return;
  15951. }
  15952. this.userData.diamond += val;
  15953. this.saveUserData();
  15954. xGame.eventMgr.event(DIAMOND_CHANGE);
  15955. }
  15956. static getDiamond() {
  15957. return this.userData.diamond;
  15958. }
  15959. static getSkillSuccessTimes() {
  15960. return this.userData.skillSuccessTimes;
  15961. }
  15962. static setSkillSuccessTimes(val, addUp = true) {
  15963. if (addUp)
  15964. this.userData.skillSuccessTimes += val;
  15965. else
  15966. this.userData.skillSuccessTimes = val;
  15967. this.saveUserData();
  15968. }
  15969. static getSkillAccTimes() {
  15970. return this.userData.skillAccTimes;
  15971. }
  15972. static setSkillAccTimes(val) {
  15973. this.userData.skillAccTimes += val;
  15974. this.saveUserData();
  15975. }
  15976. static getSkillGuide() {
  15977. if (!xGame.common.openGuide) {
  15978. return 1;
  15979. }
  15980. return this.userData.skillGuide;
  15981. }
  15982. static setSkillGuide(val) {
  15983. this.userData.skillGuide = val;
  15984. this.saveUserData();
  15985. }
  15986. static getPlaceBallLevelList() {
  15987. return this.userData.placeBallData;
  15988. }
  15989. static getPlaceBallLevel(level) {
  15990. let arr = this.userData.placeBallData;
  15991. let index = level - 1;
  15992. let out;
  15993. if (arr[index]) {
  15994. out = arr[index];
  15995. }
  15996. else {
  15997. let max = arr.length;
  15998. if (max == index) {
  15999. out = {
  16000. star: 0,
  16001. play: true,
  16002. isCur: true,
  16003. getAward: false
  16004. };
  16005. }
  16006. else {
  16007. out = {
  16008. star: 0,
  16009. play: false,
  16010. getAward: false
  16011. };
  16012. }
  16013. }
  16014. return out;
  16015. }
  16016. static setPlaceBallLevel(level, star) {
  16017. let arr = this.userData.placeBallData;
  16018. let index = level - 1;
  16019. if (arr[index]) {
  16020. arr[index].star = Math.max(arr[index].star, star);
  16021. }
  16022. else {
  16023. let max = arr.length;
  16024. if (max == index) {
  16025. arr.push({
  16026. star: star,
  16027. play: true,
  16028. getAward: false
  16029. });
  16030. }
  16031. else {
  16032. console.error("关卡存储出错");
  16033. }
  16034. }
  16035. this.saveUserData();
  16036. }
  16037. static setPlaceBallAward(level) {
  16038. let arr = this.userData.placeBallData;
  16039. let index = level - 1;
  16040. if (arr[index]) {
  16041. arr[index].getAward = true;
  16042. }
  16043. this.saveUserData();
  16044. }
  16045. static getShareDiamondTimes() {
  16046. return this.userData.shareDiamondTimes;
  16047. }
  16048. static setShareDiamondTimes(val, addUp = true) {
  16049. if (addUp) {
  16050. this.userData.shareDiamondTimes += val;
  16051. }
  16052. else {
  16053. this.userData.shareDiamondTimes = val;
  16054. }
  16055. this.saveUserData();
  16056. }
  16057. static getDailyVideoShareTimes() {
  16058. return this.userData.dailyVideoShareTimes;
  16059. }
  16060. static setDailyVideoShareTimes(val, addUp = true) {
  16061. if (addUp) {
  16062. this.userData.dailyVideoShareTimes += val;
  16063. }
  16064. else {
  16065. this.userData.dailyVideoShareTimes = val;
  16066. }
  16067. this.saveUserData();
  16068. }
  16069. static getSecretary(index) {
  16070. return this.userData.secretary[index];
  16071. }
  16072. static setSecretary(index, val) {
  16073. this.userData.secretary[index] = val;
  16074. this.saveUserData();
  16075. }
  16076. static getCurSecretary() {
  16077. return this.userData.curSecretary;
  16078. }
  16079. static setCurSecretary(index) {
  16080. this.userData.curSecretary = index;
  16081. this.saveUserData();
  16082. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  16083. }
  16084. static getBallRod(index) {
  16085. return this.userData.ballRod[index];
  16086. }
  16087. static setBallRod(index, val) {
  16088. this.userData.ballRod[index] = val;
  16089. this.saveUserData();
  16090. }
  16091. static getCurBallRod() {
  16092. return this.userData.curBallRod;
  16093. }
  16094. static setCurBallRod(index) {
  16095. this.userData.curBallRod = index;
  16096. this.saveUserData();
  16097. }
  16098. static setSignData(val) {
  16099. this.userData.signData = val;
  16100. this.saveUserData();
  16101. }
  16102. static getSignData() {
  16103. return this.userData.signData;
  16104. }
  16105. static setSignTime(val) {
  16106. this.userData.signTime = val;
  16107. this.saveUserData();
  16108. }
  16109. static getSignTime() {
  16110. return this.userData.signTime;
  16111. }
  16112. static getDrawTimes() {
  16113. return this.userData.drawTimes;
  16114. }
  16115. static setDrawTimes(val, addUp = true) {
  16116. if (addUp) {
  16117. this.userData.drawTimes += val;
  16118. }
  16119. else {
  16120. this.userData.drawTimes = val;
  16121. }
  16122. this.saveUserData();
  16123. }
  16124. static getDrawAwardTimes() {
  16125. return this.userData.drawAwardTimes;
  16126. }
  16127. static setDrawAwardTimes(val) {
  16128. this.userData.drawAwardTimes = val;
  16129. this.saveUserData();
  16130. }
  16131. static getDailyfreeDrawTimes() {
  16132. return this.userData.dailyfreeDrawTimes;
  16133. }
  16134. static setDailyfreeDrawTimes(val) {
  16135. this.userData.dailyfreeDrawTimes = val;
  16136. this.saveUserData();
  16137. }
  16138. static setPower(val, addUp = true) {
  16139. if (addUp)
  16140. this.userData.power += val;
  16141. else
  16142. this.userData.power = val;
  16143. if (this.userData.power >= xGame.common.maxPower) {
  16144. this.userData.power = xGame.common.maxPower;
  16145. }
  16146. xGame.eventMgr.event(POWER_CHANGE, val);
  16147. this.saveUserData();
  16148. }
  16149. static getPower() {
  16150. return this.userData.power;
  16151. }
  16152. static setPowerTime(val) {
  16153. this.userData.powerTime = val;
  16154. this.saveUserData();
  16155. }
  16156. static getPowerTime() {
  16157. return this.userData.powerTime;
  16158. }
  16159. static powerEnough() {
  16160. return this.getPower() > 0;
  16161. }
  16162. static getChallengeTimes() {
  16163. return this.userData.challengeTimes;
  16164. }
  16165. static setChallengeTimes(val) {
  16166. this.userData.challengeTimes += val;
  16167. this.saveUserData();
  16168. }
  16169. static getExtraSign() {
  16170. return this.userData.extraSign;
  16171. }
  16172. static setExtraSign(val) {
  16173. this.userData.extraSign = val;
  16174. this.saveUserData();
  16175. }
  16176. static getClassicTimes() {
  16177. return this.userData.classicTimes;
  16178. }
  16179. static setClassicTimes() {
  16180. this.userData.classicTimes += 1;
  16181. this.saveUserData();
  16182. }
  16183. static getGuideHelpLine() {
  16184. return this.userData.guideHelpLine;
  16185. }
  16186. static setGuideHelpLine() {
  16187. this.userData.guideHelpLine = 1;
  16188. this.saveUserData();
  16189. }
  16190. static getNewUser() {
  16191. return this.userData.newUser;
  16192. }
  16193. static setNewUser() {
  16194. this.userData.newUser = false;
  16195. this.saveUserData();
  16196. }
  16197. static getRootBallFoul() {
  16198. return this.userData.rootBallFoul;
  16199. }
  16200. static setRootBallFoul() {
  16201. this.userData.rootBallFoul = 1;
  16202. this.saveUserData();
  16203. }
  16204. static getTimeoutFoul() {
  16205. return this.userData.timeoutFoul;
  16206. }
  16207. static setTimeoutFoul() {
  16208. this.userData.timeoutFoul = 1;
  16209. this.saveUserData();
  16210. }
  16211. }
  16212. DataMgr.isNewUser = false;
  16213. DataMgr.fristEnter = true;
  16214. DataMgr.levelType = 0;
  16215. DataMgr.awardId = 0;
  16216. DataMgr.awardCoin = 0;
  16217. DataMgr.sceneId = -1;
  16218. DataMgr.tryId = 0;
  16219. DataMgr.curLevel = 1;
  16220. DataMgr.vipLevel = 0;
  16221. DataMgr.maxLevel = 0;
  16222. DataMgr.awardRatio = 1;
  16223. DataMgr.gameList = [];
  16224. DataMgr.rankList = [];
  16225. DataMgr.recoverTime = 480000;
  16226. DataMgr.minScore = 0;
  16227. DataMgr.rankDis = 0;
  16228. DataMgr.userSaving = false;
  16229. DataMgr.gameSaving = false;
  16230. class D3Tween extends Laya.Script3D {
  16231. constructor() {
  16232. super();
  16233. this.isInited = false;
  16234. }
  16235. ;
  16236. init() {
  16237. if (this.isInited)
  16238. return;
  16239. this.isInited = true;
  16240. this.gameObj = this.owner;
  16241. this.transform = this.gameObj.transform;
  16242. }
  16243. get rotX() {
  16244. return this.transform.localRotationEulerX;
  16245. }
  16246. set rotX(v) {
  16247. this.transform.localRotationEulerX = v;
  16248. }
  16249. get rotY() {
  16250. return this.transform.localRotationEulerY;
  16251. }
  16252. set rotY(v) {
  16253. this.transform.localRotationEulerY = v;
  16254. }
  16255. get rotZ() {
  16256. return this.transform.localRotationEulerZ;
  16257. }
  16258. set rotZ(v) {
  16259. this.transform.localRotationEulerZ = v;
  16260. }
  16261. get posX() {
  16262. return this.transform.localPositionX;
  16263. }
  16264. set posX(v) {
  16265. this.transform.localPositionX = v;
  16266. }
  16267. get posY() {
  16268. return this.transform.localPositionY;
  16269. }
  16270. set posY(v) {
  16271. this.transform.localPositionY = v;
  16272. }
  16273. get posZ() {
  16274. return this.transform.localPositionZ;
  16275. }
  16276. set posZ(v) {
  16277. this.transform.localPositionZ = v;
  16278. }
  16279. get rotation() {
  16280. return this.transform.localRotation;
  16281. }
  16282. set rotation(v) {
  16283. this.transform.localRotation = v;
  16284. }
  16285. }
  16286. class D2Hole extends Laya.Script {
  16287. constructor() { super(); }
  16288. onTriggerEnter(collider) {
  16289. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  16290. return;
  16291. }
  16292. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  16293. if (collider.owner["mySrc"].isRunSkillAni) {
  16294. return;
  16295. }
  16296. if (collider.owner["mySrc"].number != 0) {
  16297. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  16298. }
  16299. xGame.common.ballColliHole(collider);
  16300. xGame.common.recoverCameraView();
  16301. }
  16302. }
  16303. }
  16304. class Table extends Laya.Script3D {
  16305. constructor() {
  16306. super();
  16307. this.isSetBorder = false;
  16308. this.inited = false;
  16309. }
  16310. ;
  16311. onAwake() {
  16312. this.init();
  16313. }
  16314. init() {
  16315. if (this.inited)
  16316. return;
  16317. this.inited = true;
  16318. this.gameObj = this.owner;
  16319. this.border = this.gameObj.getChildByName("border");
  16320. }
  16321. setBorderPos() {
  16322. if (this.isSetBorder)
  16323. return;
  16324. this.isSetBorder = true;
  16325. let ui = xGame.common.gameUI.ui;
  16326. let bar1 = this.border.getChildByName("bar1");
  16327. let bar2 = this.border.getChildByName("bar2");
  16328. let bar3 = this.border.getChildByName("bar3");
  16329. let bar4 = this.border.getChildByName("bar4");
  16330. let bar5 = this.border.getChildByName("bar5");
  16331. let bar6 = this.border.getChildByName("bar6");
  16332. this.setInfo(bar1, ui.border.bar1, "box");
  16333. this.setInfo(bar2, ui.border.bar2, "box");
  16334. this.setInfo(bar3, ui.border.bar3, "box");
  16335. this.setInfo(bar4, ui.border.bar4, "box");
  16336. this.setInfo(bar5, ui.border.bar5, "box");
  16337. this.setInfo(bar6, ui.border.bar6, "box");
  16338. let circle1 = this.border.getChildByName("circle1");
  16339. let circle2 = this.border.getChildByName("circle2");
  16340. let circle3 = this.border.getChildByName("circle3");
  16341. let circle4 = this.border.getChildByName("circle4");
  16342. let circle5 = this.border.getChildByName("circle5");
  16343. let circle6 = this.border.getChildByName("circle6");
  16344. this.setInfo(circle1, ui.border.circle1, "circle");
  16345. this.setInfo(circle2, ui.border.circle2, "circle");
  16346. this.setInfo(circle3, ui.border.circle3, "circle");
  16347. this.setInfo(circle4, ui.border.circle4, "circle");
  16348. this.setInfo(circle5, ui.border.circle5, "circle");
  16349. this.setInfo(circle6, ui.border.circle6, "circle");
  16350. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  16351. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  16352. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  16353. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  16354. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  16355. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  16356. let arr = xGame.common.gameMgr.holePosList;
  16357. xGame.common.gameMgr.posObj = {
  16358. "1": arr[0],
  16359. "3": arr[2],
  16360. "4": arr[3],
  16361. "6": arr[5]
  16362. };
  16363. }
  16364. initHolePos(x, y) {
  16365. if (x < 300)
  16366. x += 25;
  16367. else if (x > 1000)
  16368. x -= 25;
  16369. else if (y > 200)
  16370. y -= 10;
  16371. else
  16372. y += 10;
  16373. if (y < 200)
  16374. y += 30;
  16375. else if (y > 500)
  16376. y -= 30;
  16377. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  16378. }
  16379. setInfo(d3Obj, d2Obj, type) {
  16380. let ui = xGame.common.gameUI.ui;
  16381. let sprite = new Laya.Sprite();
  16382. ui.border.displayObject.addChild(sprite);
  16383. let colli = xGame.common.getCollider(type);
  16384. sprite.addComponentIntance(colli);
  16385. let rigy = xGame.common.getRigbody();
  16386. rigy.type = "static";
  16387. sprite.addComponentIntance(rigy);
  16388. let d3Pos = d3Obj.transform.position;
  16389. xGame.common.pos3to2Convert(d3Pos);
  16390. let scaleX = d3Obj.transform.localScaleX;
  16391. let scaleZ = d3Obj.transform.localScaleZ;
  16392. let width = xGame.common.scale3to2Convert(scaleZ);
  16393. let height = xGame.common.scale3to2Convert(scaleX);
  16394. sprite.pivotX = width / 2;
  16395. sprite.pivotY = height / 2;
  16396. sprite.x = d3Pos.x;
  16397. sprite.y = d3Pos.y;
  16398. sprite.width = width;
  16399. sprite.height = height;
  16400. d2Obj.x = d3Pos.x;
  16401. d2Obj.y = d3Pos.y;
  16402. d2Obj.width = width;
  16403. d2Obj.height = height;
  16404. if (type == "box") {
  16405. colli.width = width;
  16406. colli.height = height;
  16407. colli.isSensor = false;
  16408. colli.label = "border";
  16409. }
  16410. else {
  16411. colli.radius = width / 2;
  16412. colli.isSensor = true;
  16413. colli.label = "hole";
  16414. sprite.addComponent(D2Hole);
  16415. }
  16416. }
  16417. }
  16418. class D3World extends Laya.Script3D {
  16419. constructor() {
  16420. super();
  16421. this.loadNum = 0;
  16422. this.setLoadNum = 7;
  16423. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  16424. }
  16425. onAwake() {
  16426. }
  16427. loadScene() {
  16428. this.scene = this.owner;
  16429. let url = `res/unityRes/root.lh`;
  16430. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  16431. this.scene.addChild(prefab);
  16432. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  16433. this.putCameraInfo();
  16434. this.camera.enableHDR = false;
  16435. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  16436. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  16437. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  16438. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  16439. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  16440. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  16441. this.knife.active = false;
  16442. this.loadD3Obj();
  16443. }));
  16444. }
  16445. putCameraInfo() {
  16446. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  16447. this.cameraObj = new cameraType();
  16448. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  16449. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  16450. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  16451. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  16452. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  16453. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  16454. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  16455. this.visitAngleChild.init();
  16456. this.visitRootObj.posX = this.visitAngleChild.posX;
  16457. this.visitRootObj.posY = this.visitAngleChild.posY;
  16458. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  16459. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  16460. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  16461. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  16462. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  16463. xGame.common.showOneCamera("mainCamera");
  16464. }
  16465. loadD3Obj() {
  16466. this.loadTable();
  16467. this.loadRoom();
  16468. this.loadInHoleParticial();
  16469. this.loadIceParticial();
  16470. this.loadHitParticial();
  16471. this.loadFireworksParticial();
  16472. this.loadBall();
  16473. }
  16474. loadInHoleParticial() {
  16475. this.loadD3Res("inHoleEft", "", (prefab) => {
  16476. prefab.addComponent(Partical);
  16477. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  16478. });
  16479. }
  16480. loadIceParticial() {
  16481. this.loadD3Res("iceEft", "", (prefab) => {
  16482. prefab.addComponent(Partical);
  16483. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  16484. });
  16485. }
  16486. loadHitParticial() {
  16487. this.loadD3Res("hitEft", "", (prefab) => {
  16488. prefab.addComponent(Partical);
  16489. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  16490. });
  16491. }
  16492. loadFireworksParticial() {
  16493. this.loadD3Res("fireworksEft", "", (prefab) => {
  16494. prefab.addComponent(Partical);
  16495. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  16496. });
  16497. }
  16498. loadBall(index = 1) {
  16499. this.loadD3Res("ball", index, (prefab) => {
  16500. this.ballPrefab = prefab;
  16501. this.ballPrefab.addComponent(Ball);
  16502. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  16503. });
  16504. }
  16505. loadTable(index = 1) {
  16506. this.loadD3Res("table", index, (prefab) => {
  16507. this.tableSrc = prefab.addComponent(Table);
  16508. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  16509. this.d3Hand.init();
  16510. this.tableRoot.addChild(prefab);
  16511. });
  16512. }
  16513. loadRoom(index = 1) {
  16514. this.loadD3Res("room", index, (prefab) => {
  16515. this.roomRoot.addChild(prefab);
  16516. });
  16517. }
  16518. loadD3Res(type, index, callback) {
  16519. let url = `res/unityRes/${type}${index}.lh`;
  16520. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  16521. callback && callback(prefab);
  16522. this.checkResLoad();
  16523. }));
  16524. }
  16525. checkResLoad() {
  16526. this.loadNum++;
  16527. if (this.loadNum >= this.setLoadNum) {
  16528. xGame.eventMgr.event(D3RES_LOADED);
  16529. }
  16530. }
  16531. prePlayEft() {
  16532. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  16533. eft.transform.localPositionX = 0;
  16534. eft.transform.localPositionY = -5;
  16535. eft.transform.localPositionZ = 0;
  16536. eft.active = true;
  16537. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  16538. ice.transform.localPositionX = 0;
  16539. ice.transform.localPositionY = -5;
  16540. ice.transform.localPositionZ = 0;
  16541. ice.active = true;
  16542. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  16543. hit.transform.localPositionX = 0;
  16544. hit.transform.localPositionY = -5;
  16545. hit.transform.localPositionZ = 0;
  16546. hit.active = true;
  16547. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  16548. fireworks.transform.localPositionX = 0;
  16549. fireworks.transform.localPositionY = -5;
  16550. fireworks.transform.localPositionZ = 0;
  16551. fireworks.active = true;
  16552. }
  16553. }
  16554. class cameraType {
  16555. }
  16556. class MoyuMgr$1 {
  16557. static initMoyu() {
  16558. this.moyuView = new MoyuView$1();
  16559. Laya.stage.addChild(this.moyuView.ui.displayObject);
  16560. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  16561. this.moyuView.ui.displayObject.zOrder = 1000;
  16562. this.moyuView.init();
  16563. this.moyuView.showTip(true);
  16564. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  16565. window['XApk'] = this;
  16566. }
  16567. static showAge(show) {
  16568. if (this.moyuView)
  16569. this.moyuView.showAge(show);
  16570. }
  16571. static onPlatMsg(idx) {
  16572. if (!MoyuMgr$1.moyuView)
  16573. return;
  16574. if (idx == '0') {
  16575. MoyuMgr$1.moyuView.showTip(false);
  16576. }
  16577. }
  16578. static showAgree(call) {
  16579. if (this.moyuView)
  16580. this.moyuView.showAgree(call);
  16581. else
  16582. call && call();
  16583. }
  16584. static showXy(type = 1) {
  16585. if (this.moyuView)
  16586. this.moyuView.showXy(type);
  16587. }
  16588. }
  16589. MoyuMgr$1.isAdvise = false;
  16590. class MoyuView$1 {
  16591. constructor() {
  16592. this.ysxyNum = 1;
  16593. this.ysJson = null;
  16594. this.ui = ui_UIMoyu.createInstance();
  16595. }
  16596. init() {
  16597. this.ui.mainBg.visible = false;
  16598. this.ui.xyNode.visible = false;
  16599. this.ui.ageNode.visible = false;
  16600. this.ui.tipNode.visible = false;
  16601. this.ui.rnNode.visible = false;
  16602. this.ui.fcmNode.visible = false;
  16603. this.ui.ageTip.visible = false;
  16604. this.ui.msgNode.visible = false;
  16605. this.ui.visible = false;
  16606. this.ui.xyNode.xyList.setVirtual();
  16607. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  16608. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  16609. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  16610. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  16611. this.ui.xyNode.btnKnown.visible = false;
  16612. this.ui.xyNode.xy1.visible = false;
  16613. this.ui.xyNode.xy2.visible = false;
  16614. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  16615. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  16616. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  16617. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  16618. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  16619. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  16620. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  16621. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  16622. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  16623. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  16624. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  16625. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  16626. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  16627. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  16628. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  16629. this.ysxyNum = 2;
  16630. }
  16631. }
  16632. onClick(obj) {
  16633. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  16634. switch (obj) {
  16635. case this.ui.ageTip:
  16636. if (Moyu.isTTApk) {
  16637. this.ui.ageNode.visible = true;
  16638. this.ui.mainBg.visible = true;
  16639. }
  16640. break;
  16641. case this.ui.tipNode:
  16642. this.showTip(false);
  16643. break;
  16644. case this.ui.ageNode.btnAge:
  16645. this.ui.ageNode.visible = false;
  16646. this.ui.mainBg.visible = false;
  16647. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  16648. this.ui.visible = false;
  16649. break;
  16650. case this.ui.xyNode.btnXy3:
  16651. case this.ui.xyNode.btnXy1:
  16652. this.loadXy(1);
  16653. break;
  16654. case this.ui.xyNode.btnXy2:
  16655. this.loadXy(2);
  16656. break;
  16657. case this.ui.xyNode.btnBack:
  16658. this.ui.xyNode.xy1.visible = true;
  16659. this.ui.xyNode.xy2.visible = false;
  16660. break;
  16661. case this.ui.xyNode.btnKnown:
  16662. this.ui.xyNode.visible = false;
  16663. this.ui.mainBg.visible = false;
  16664. this.ui.visible = false;
  16665. break;
  16666. case this.ui.rnNode.btnCheck:
  16667. this.check();
  16668. break;
  16669. case this.ui.rnNode.btnExit:
  16670. case this.ui.xyNode.btnNo:
  16671. this.ysxyNum--;
  16672. if (this.ysxyNum > 0)
  16673. this.showMsg("Refuse to quit the game once again");
  16674. else {
  16675. Moyu.userAgree(false);
  16676. Moyu.exit();
  16677. }
  16678. break;
  16679. case this.ui.xyNode.btnSure:
  16680. case this.ui.xyNode.btnYes:
  16681. DataMgr.userData.isAgree = true;
  16682. DataMgr.saveUserData();
  16683. this.onAgree();
  16684. break;
  16685. case this.ui.rnNode.btnDone:
  16686. this.ui.rnNode.visible = false;
  16687. this.ui.visible = false;
  16688. break;
  16689. case this.ui.fcmNode.btnRn:
  16690. this.showRn();
  16691. break;
  16692. }
  16693. }
  16694. showTip(show) {
  16695. if (!Moyu.isVVApk && !Moyu.isOPApk)
  16696. return;
  16697. if (show) {
  16698. MoyuMgr$1.isAdvise = true;
  16699. this.ui.visible = true;
  16700. this.ui.tipNode.visible = true;
  16701. this.ui.tipNode.alpha = 1;
  16702. Laya.timer.once(1000, this, this.showTip, [false]);
  16703. }
  16704. else {
  16705. this.ui.tipNode.alpha = 1;
  16706. this.ui.tipNode.visible = true;
  16707. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  16708. this.ui.tipNode.visible = false;
  16709. MoyuMgr$1.isAdvise = false;
  16710. }), 1000);
  16711. }
  16712. }
  16713. showAge(show, px = 0, py = 0) {
  16714. if (Moyu.platType > 10 && !Moyu.isIos) {
  16715. this.ui.ageTip.x = px;
  16716. this.ui.ageTip.y = py;
  16717. this.ui.ageTip.visible = show;
  16718. if (show)
  16719. this.ui.visible = true;
  16720. }
  16721. }
  16722. showAgree(call) {
  16723. this.agreeCall = call;
  16724. this.onAgree();
  16725. return;
  16726. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  16727. this.showXy(0);
  16728. }
  16729. else
  16730. this.onAgree();
  16731. }
  16732. onAgree() {
  16733. if (!this.ui.ageNode.visible)
  16734. this.ui.visible = false;
  16735. this.ui.xyNode.visible = false;
  16736. Moyu.userAgree(true);
  16737. this.showAge(false);
  16738. this.agreeCall && this.agreeCall();
  16739. this.showRn();
  16740. }
  16741. showMsg(txt) {
  16742. this.ui.msgNode.txtMsg.text = txt;
  16743. this.ui.msgNode.visible = true;
  16744. this.ui.msgNode.alpha = 1;
  16745. this.ui.visible = true;
  16746. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  16747. this.ui.msgNode.visible = false;
  16748. }), 2500, true);
  16749. }
  16750. showRn() {
  16751. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  16752. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  16753. this.ui.rnNode.rn1.visible = true;
  16754. this.ui.rnNode.rn2.visible = false;
  16755. this.ui.rnNode.rn3.visible = false;
  16756. this.ui.rnNode.rn4.visible = false;
  16757. this.ui.rnNode.visible = true;
  16758. this.ui.mainBg.visible = true;
  16759. this.ui.rnNode.btnDone.visible = false;
  16760. this.ui.rnNode.btnExit.visible = true;
  16761. this.ui.rnNode.btnCheck.visible = true;
  16762. this.ui.fcmNode.visible = false;
  16763. this.ui.visible = true;
  16764. return;
  16765. }
  16766. }
  16767. this.showFcm();
  16768. }
  16769. showFcm() {
  16770. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  16771. Moyu.initFCM(true);
  16772. if (Moyu.gameTime < 1)
  16773. this.fcmLoop();
  16774. else if (Moyu.gameTime < 999)
  16775. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  16776. }
  16777. }
  16778. fcmLoop() {
  16779. if (Moyu.gameTime < 1) {
  16780. this.ui.rnNode.visible = false;
  16781. this.ui.fcmNode.visible = true;
  16782. this.ui.mainBg.visible = true;
  16783. this.ui.visible = true;
  16784. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  16785. Laya.timer.clear(this.ui, this.fcmLoop);
  16786. }
  16787. }
  16788. check() {
  16789. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  16790. this.ui.rnNode.rn1.visible = false;
  16791. this.ui.rnNode.rn2.visible = false;
  16792. this.ui.rnNode.rn4.visible = true;
  16793. }
  16794. else if (this.ui.rnNode.rn4.visible) {
  16795. let name = this.ui.rnNode.inputName.text;
  16796. let code = this.ui.rnNode.inputCode.text;
  16797. if (code && code.length == 18) {
  16798. this.ui.rnNode.rn1.visible = false;
  16799. this.ui.rnNode.rn4.visible = false;
  16800. Moyu.authenticate(name, code, (res) => {
  16801. this.ui.rnNode.rn2.visible = !res;
  16802. this.ui.rnNode.rn3.visible = res;
  16803. this.ui.rnNode.btnDone.visible = res;
  16804. this.ui.rnNode.btnExit.visible = !res;
  16805. this.ui.rnNode.btnCheck.visible = !res;
  16806. if (res)
  16807. this.showFcm();
  16808. });
  16809. }
  16810. else
  16811. this.showMsg("信息填写不完整");
  16812. }
  16813. }
  16814. loadXy(type = 0) {
  16815. this.ui.xyNode.xy1.visible = false;
  16816. this.ui.xyNode.xy2.visible = true;
  16817. this.ui.xyNode.xyList.scrollToView(0);
  16818. if (type == 1) {
  16819. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  16820. }
  16821. else if (type == 2) {
  16822. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  16823. }
  16824. }
  16825. showXy(type = 0) {
  16826. this.xyBtn();
  16827. if (type == 0) {
  16828. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  16829. this.ui.xyNode.btnSure.visible = true;
  16830. }
  16831. else {
  16832. this.ui.xyNode.btnYes.visible = true;
  16833. this.ui.xyNode.btnNo.visible = true;
  16834. }
  16835. }
  16836. else {
  16837. this.ui.xyNode.btnKnown.visible = true;
  16838. this.ui.mainBg.visible = true;
  16839. }
  16840. this.ui.xyNode.xy1.visible = true;
  16841. this.ui.xyNode.xy2.visible = false;
  16842. this.ui.xyNode.visible = true;
  16843. this.ui.visible = true;
  16844. }
  16845. xyBtn() {
  16846. this.ui.xyNode.btnSure.visible = false;
  16847. this.ui.xyNode.btnYes.visible = false;
  16848. this.ui.xyNode.btnNo.visible = false;
  16849. this.ui.xyNode.btnKnown.visible = false;
  16850. {
  16851. this.ui.xyNode.btnXy3.visible = false;
  16852. this.ui.xyNode.btnXy2.visible = true;
  16853. this.ui.xyNode.btnXy1.visible = true;
  16854. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  16855. }
  16856. }
  16857. createXY(json) {
  16858. this.ysJson = json.content;
  16859. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  16860. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  16861. this.ui.xyNode.xy2.visible = true;
  16862. }
  16863. renderListItem(idx, cell) {
  16864. let xy = this.ysJson[idx];
  16865. cell.height = xy.line * 30;
  16866. cell.xyItem.text = xy.text;
  16867. }
  16868. onDestroy() {
  16869. this.agreeCall = null;
  16870. }
  16871. }
  16872. class UILoading extends UIBase {
  16873. constructor() {
  16874. super();
  16875. this.accTime = 0;
  16876. this.curNum = 0;
  16877. this.rate = 1;
  16878. this.loadSubOk = false;
  16879. this.loadResOK = false;
  16880. this.openLoading = true;
  16881. this.beginLoadRes = false;
  16882. this.finishD2 = false;
  16883. this.finishD3 = false;
  16884. }
  16885. onConstructor() {
  16886. this.ui = ui_UILoading.createInstance();
  16887. this.contentPane = this.ui;
  16888. this.isEject = false;
  16889. this._initUI();
  16890. this._addEvent();
  16891. }
  16892. _initUI() {
  16893. MoyuMgr$1.initMoyu();
  16894. }
  16895. _addEvent() {
  16896. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  16897. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  16898. }
  16899. show() {
  16900. super.show();
  16901. console.log('zh:加载分包资源');
  16902. loadSubRes(this.subResProgress.bind(this));
  16903. this.ui.txtLoad.text = "Loading...";
  16904. }
  16905. subResProgress(pro, finish) {
  16906. this.curNum = pro;
  16907. if (finish) {
  16908. this.curNum = 1;
  16909. this.loadSubOk = true;
  16910. }
  16911. }
  16912. laodD3Res() {
  16913. let scene3D = new Laya.Scene3D();
  16914. xGame.common.d3Scene = scene3D;
  16915. xGame.common.d3World = scene3D.addComponent(D3World);
  16916. xGame.common.d3World.loadScene();
  16917. }
  16918. loadD2Res() {
  16919. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  16920. this.finishD2 = true;
  16921. this.checkLoadAll();
  16922. this.curNum = 1;
  16923. }), Laya.Handler.create(this, (pro) => {
  16924. this.curNum = pro;
  16925. }, null, false));
  16926. }
  16927. d3ResFinish() {
  16928. this.finishD3 = true;
  16929. this.checkLoadAll();
  16930. }
  16931. checkLoadAll() {
  16932. if (this.finishD2 && this.finishD3) {
  16933. this.loadResOK = true;
  16934. }
  16935. }
  16936. loadRes() {
  16937. this.laodD3Res();
  16938. this.loadD2Res();
  16939. }
  16940. myUpdate(dt) {
  16941. if (!this.openLoading)
  16942. return;
  16943. this.accTime += dt * this.rate;
  16944. if (this.accTime >= this.curNum)
  16945. this.accTime = this.curNum;
  16946. this.ui.loadinfo.value = this.accTime * 100;
  16947. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  16948. if (!this.beginLoadRes) {
  16949. this.beginLoadRes = true;
  16950. this.ui.txtLoad.text = "Loading...";
  16951. this.curNum = 0;
  16952. this.accTime = 0;
  16953. this.loadRes();
  16954. }
  16955. if (this.loadResOK) {
  16956. this.openLoading = false;
  16957. Laya.timer.once(300, this, () => {
  16958. xGame.common.d3Scene.active = false;
  16959. MoyuMgr$1.showAgree(enterGame);
  16960. });
  16961. }
  16962. }
  16963. }
  16964. release() {
  16965. }
  16966. hide() {
  16967. super.hide();
  16968. this.release();
  16969. }
  16970. onClose() {
  16971. this.hide();
  16972. }
  16973. }
  16974. UILoading.uiName = "UILoading";
  16975. class UIRepentProp$1 extends UIBase {
  16976. constructor() {
  16977. super();
  16978. this.viewType = 0;
  16979. this.regretType = 0;
  16980. }
  16981. onConstructor() {
  16982. this.ui = ui_UIRepentProp.createInstance();
  16983. this.contentPane = this.ui;
  16984. this.isEject = false;
  16985. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  16986. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  16987. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  16988. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  16989. }
  16990. show(viewType, regretType, callback) {
  16991. PlatMgr.showInsert(true);
  16992. this.viewType = viewType;
  16993. this.regretType = regretType;
  16994. this.callback = callback;
  16995. super.show();
  16996. this.ui.t0.play();
  16997. this.ui.c1.selectedIndex = this.viewType;
  16998. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  16999. if (this.viewType == 0) {
  17000. let guide = DataMgr.getGuideHelpLine();
  17001. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  17002. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  17003. }
  17004. xGame.common.gameMgr.gamePause = true;
  17005. }
  17006. hideSelf() {
  17007. xGame.common.gameMgr.gamePause = false;
  17008. this.callback && this.callback(false);
  17009. this.hide();
  17010. }
  17011. videoRegret() {
  17012. Moyu.showVideoAd(() => {
  17013. this.callback && this.callback(true);
  17014. this.hideSelf();
  17015. }, EAdType.regretBall);
  17016. }
  17017. videoAddHelpLine() {
  17018. let guide = DataMgr.getGuideHelpLine();
  17019. if (guide == 0) {
  17020. this.callback && this.callback(true);
  17021. this.hideSelf();
  17022. DataMgr.setGuideHelpLine();
  17023. xGame.common.gameUI.ui.guideNode.visible = false;
  17024. }
  17025. else {
  17026. Moyu.showVideoAd(() => {
  17027. this.callback && this.callback(true);
  17028. this.hideSelf();
  17029. }, EAdType.longHelpLine);
  17030. }
  17031. }
  17032. }
  17033. UIRepentProp$1.uiName = "UIRepentProp";
  17034. class UIRodMethod$1 extends UIBase {
  17035. constructor() {
  17036. super();
  17037. this.isPressd = false;
  17038. }
  17039. onConstructor() {
  17040. this.ui = ui_UIRodMethod.createInstance();
  17041. this.contentPane = this.ui;
  17042. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  17043. this.moveDir = new Laya.Vector2();
  17044. this.moveDest = new Laya.Vector2();
  17045. this.centerPos = new Laya.Vector2();
  17046. xGame.common.uiRodMethod = this;
  17047. }
  17048. show() {
  17049. super.show();
  17050. xGame.common.gameMgr.gamePause = true;
  17051. this.openPressDotEvent();
  17052. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  17053. this.centerPos.x = this.ui.white.x;
  17054. this.centerPos.y = this.ui.white.y;
  17055. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  17056. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  17057. this.setDot();
  17058. }
  17059. setDot() {
  17060. this.ui.dot.x = this.moveDest.x;
  17061. this.ui.dot.y = this.moveDest.y;
  17062. }
  17063. closeSelf() {
  17064. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  17065. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  17066. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  17067. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  17068. xGame.common.gameMgr.gamePause = false;
  17069. this.hide();
  17070. }
  17071. openPressDotEvent() {
  17072. this.closePressDotEvent();
  17073. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17074. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17075. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17076. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17077. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17078. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17079. }
  17080. closePressDotEvent() {
  17081. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17082. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17083. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17084. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17085. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17086. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17087. }
  17088. onDown(e) {
  17089. if (e.type == Laya.Event.MOUSE_DOWN)
  17090. this.isPressd = true;
  17091. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  17092. this.isPressd = false;
  17093. if (!this.isPressd)
  17094. return;
  17095. this.moveDest.x = e.stageX;
  17096. this.moveDest.y = e.stageY;
  17097. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  17098. if (dis > 6724) {
  17099. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  17100. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  17101. }
  17102. this.setDot();
  17103. }
  17104. resetRod() {
  17105. this.ui.dot.x = this.ui.white.x;
  17106. this.ui.dot.y = this.ui.white.y;
  17107. this.gameRod.dot.x = this.gameRod.bg.x;
  17108. this.gameRod.dot.y = this.gameRod.bg.y;
  17109. xGame.common.rodOffest.x = 0;
  17110. xGame.common.rodOffest.y = 0;
  17111. }
  17112. }
  17113. UIRodMethod$1.uiName = "UIRodMethod";
  17114. class UIMsg$1 extends UIBase {
  17115. constructor() {
  17116. super();
  17117. }
  17118. onConstructor() {
  17119. this.ui = ui_UIMsg.createInstance();
  17120. this.contentPane = this.ui;
  17121. this.isEject = false;
  17122. this.isMuti = true;
  17123. }
  17124. show(msg, callback) {
  17125. super.show();
  17126. this.ui.tipsNode.msgTxt.text = msg;
  17127. this.ui.alpha = 1;
  17128. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  17129. this.hide();
  17130. callback && callback();
  17131. }), 1000);
  17132. }
  17133. }
  17134. UIMsg$1.uiName = "UIMsg";
  17135. class UITips$1 extends UIBase {
  17136. constructor() {
  17137. super();
  17138. this.type = 0;
  17139. }
  17140. onConstructor() {
  17141. this.ui = ui_UITips.createInstance();
  17142. this.contentPane = this.ui;
  17143. this.isEject = false;
  17144. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  17145. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  17146. }
  17147. show(tipsTxt, womanTxt, type) {
  17148. super.show();
  17149. this.ui.t0.play();
  17150. this.ui.myNode.tipsTxt.text = tipsTxt;
  17151. this.ui.myNode.womanTxt.text = womanTxt;
  17152. PlatMgr.showInsert(true);
  17153. this.ui.myNode.c1.selectedIndex = type;
  17154. this.type = type;
  17155. switch (this.type) {
  17156. case TipsType.exitGame:
  17157. xGame.common.gameMgr.gamePause = true;
  17158. break;
  17159. case TipsType.foul:
  17160. Laya.timer.once(200, this, () => {
  17161. xGame.common.gameMgr.gamePause = true;
  17162. });
  17163. break;
  17164. default:
  17165. break;
  17166. }
  17167. }
  17168. clickLeftBtn() {
  17169. this.hide();
  17170. xGame.common.gameMgr.gamePause = false;
  17171. switch (this.type) {
  17172. case TipsType.exitGame:
  17173. break;
  17174. case TipsType.foul:
  17175. break;
  17176. default:
  17177. break;
  17178. }
  17179. }
  17180. clickRightBtn() {
  17181. this.hide();
  17182. switch (this.type) {
  17183. case TipsType.exitGame:
  17184. xGame.eventMgr.event(RESET_GAME);
  17185. xGame.uiMgr.Show(UIMain$1);
  17186. Moyu.recordEnd(this, null);
  17187. xGame.common.longHelpLine = false;
  17188. break;
  17189. case TipsType.foul:
  17190. xGame.common.gameMgr.gamePause = false;
  17191. Laya.timer.clearAll(this);
  17192. break;
  17193. default:
  17194. break;
  17195. }
  17196. }
  17197. }
  17198. UITips$1.uiName = "UITips";
  17199. class UIGame$1 extends UIBase {
  17200. constructor() {
  17201. super();
  17202. this.powerNum = 0;
  17203. this.isD3Inited = false;
  17204. this.isPrePlay = false;
  17205. this.isMoveRod = false;
  17206. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  17207. this.rulerDis = 20;
  17208. this.rulerOffset = 0;
  17209. }
  17210. onConstructor() {
  17211. this.ui = ui_UIGame.createInstance();
  17212. this.contentPane = this.ui;
  17213. this.ui.x += xGame.common.sysOffestNum;
  17214. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  17215. this.isEject = false;
  17216. xGame.common.gameUI = this;
  17217. this.initSelf();
  17218. }
  17219. isTurnSelf() {
  17220. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  17221. return true;
  17222. }
  17223. }
  17224. initSelf() {
  17225. let topUI = this.ui.topNode;
  17226. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  17227. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  17228. this.barInfo = {};
  17229. this.barInfo.curY = 0;
  17230. this.barInfo.height = this.ui.powerNode.height;
  17231. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  17232. this.barInfo.powerStartY = this.ui.powerNode.y;
  17233. xGame.common.aiPlayer = new AIPlayer();
  17234. xGame.common.gameMgr = new GameMgr();
  17235. xGame.common.skillMgr = new SkillMgr();
  17236. xGame.common.wordsMgr = new WordsMgr();
  17237. xGame.common.talkMgr = new TalkMgr();
  17238. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  17239. console.log("加载经典模式表情文件chenggon !");
  17240. });
  17241. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  17242. console.log("挑战模式奖励模式spine加载成功!");
  17243. });
  17244. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  17245. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  17246. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  17247. this.addUIClick(this.ui.returnBtn, this.returnHome);
  17248. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  17249. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  17250. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  17251. }
  17252. returnHome() {
  17253. let tips = "Are you sure to exit the game?";
  17254. let woman = "Boss, why don't you play for a while longer?";
  17255. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  17256. }
  17257. addRodMethodClick() {
  17258. if (this.isTurnSelf()) {
  17259. xGame.uiMgr.Show(UIRodMethod$1);
  17260. }
  17261. }
  17262. clickHelpLineBtn(force = false) {
  17263. if (!this.isTurnSelf())
  17264. return;
  17265. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  17266. if (success) {
  17267. xGame.common.longHelpLine = true;
  17268. xGame.common.d2World.getHelpLine();
  17269. Moyu.sendDataEvent("guideNum");
  17270. }
  17271. else {
  17272. }
  17273. });
  17274. }
  17275. renderSelfDisplayBalls(index, target) {
  17276. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  17277. target.myImg.url = xGame.common.getGameIconUrl(str);
  17278. }
  17279. renderAIDisplayBalls(index, target) {
  17280. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  17281. target.myImg.url = xGame.common.getGameIconUrl(str);
  17282. ;
  17283. }
  17284. updateMode() {
  17285. if (xGame.common.gameMode == GameMode.classic) {
  17286. this.ui.topNode.scoreNode.visible = false;
  17287. }
  17288. else if (xGame.common.gameMode == GameMode.bigMove) {
  17289. this.ui.topNode.scoreNode.visible = true;
  17290. }
  17291. }
  17292. show() {
  17293. super.show();
  17294. console.log("zh:uigame show");
  17295. this.ui.alpha = 0;
  17296. this.updateSelf();
  17297. console.log("zh:uigame bf gamemusic01 start");
  17298. xGame.soundMgr.playMusic("gamemusic01");
  17299. console.log("zh:uigame bf gamemusic01 end");
  17300. xGame.common.gameMgr.gamePause = false;
  17301. xGame.common.gameUI.ui.blackAni.visible = false;
  17302. xGame.common.gameUI.ui.whiteAni.visible = false;
  17303. this.ui.powerEft.visible = false;
  17304. this.ui.colorNode.visible = false;
  17305. this.updateHead();
  17306. }
  17307. updateSelf() {
  17308. if (xGame.common.gameMode == GameMode.classic) {
  17309. this.ui.c1.selectedIndex = 0;
  17310. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  17311. this.ui.topNode.middleNode.visible = true;
  17312. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  17313. }
  17314. else if (xGame.common.gameMode == GameMode.bigMove) {
  17315. this.ui.c1.selectedIndex = 0;
  17316. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  17317. this.ui.topNode.middleNode.visible = false;
  17318. let max = xGame.cfgMgr.getMaxBigMoveLength();
  17319. let rand = xGame.common.randomNum(1, max);
  17320. let guide = DataMgr.getSkillGuide();
  17321. if (guide == 0)
  17322. rand = 1;
  17323. xGame.common.bigMoveLevelIndex = rand;
  17324. }
  17325. else if (xGame.common.gameMode == GameMode.placeBall) {
  17326. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  17327. this.ui.c1.selectedIndex = 1 + data.type;
  17328. this.ui.alpha = 1;
  17329. this.startGame();
  17330. }
  17331. this.updateMode();
  17332. this.initD3world();
  17333. this.initD2world();
  17334. }
  17335. startGame() {
  17336. this.ui.snowNode.visible = Math.random() <= 0.1;
  17337. this.ui.d2Node.visible = false;
  17338. xGame.common.d3World.d3Hand.gameObj.active = false;
  17339. xGame.common.d3World.tableSrc.init();
  17340. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  17341. this.cameraViewChange(() => {
  17342. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  17343. switch (xGame.common.gameMode) {
  17344. case GameMode.classic:
  17345. xGame.common.d3World.d3Hand.gameObj.active = true;
  17346. this.playPutBallD3Ani();
  17347. break;
  17348. case GameMode.bigMove:
  17349. this.enterGame();
  17350. Laya.timer.once(500, this, () => {
  17351. this.ui.topNode.middleNode.visible = true;
  17352. this.ui.topNode.middleNode.t0.play();
  17353. });
  17354. break;
  17355. case GameMode.placeBall:
  17356. this.enterGame();
  17357. break;
  17358. default:
  17359. break;
  17360. }
  17361. });
  17362. PlatMgr.showBanner(false);
  17363. }
  17364. enterGame() {
  17365. this.ui.d2Node.visible = true;
  17366. xGame.common.d3World.d3Hand.gameObj.active = false;
  17367. xGame.common.showOneCamera("mainCamera");
  17368. Moyu.recordGame(30, true);
  17369. if (!this.isPrePlay) {
  17370. this.isPrePlay = true;
  17371. xGame.common.d3World.prePlayEft();
  17372. }
  17373. xGame.common.gameMgr.gameReady();
  17374. this.openAllEvent();
  17375. this.ui.snowNode.visible = false;
  17376. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  17377. this.ui.helpBtn.visible = condition;
  17378. }
  17379. showHelpLineGuide() {
  17380. let longGuide = DataMgr.getGuideHelpLine();
  17381. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  17382. this.ui.helpBtn.visible = true;
  17383. this.ui.guideNode.visible = true;
  17384. }
  17385. }
  17386. setTurnAlpha(alpha) {
  17387. this.ui.keduNode.alpha = alpha;
  17388. this.ui.ganNode.alpha = alpha;
  17389. this.ui.rodMethodNode.alpha = alpha;
  17390. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  17391. }
  17392. cameraViewChange(callback) {
  17393. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  17394. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  17395. xGame.common.showOneCamera("visitAngle");
  17396. cameraSrc.localRotationEulerY = 180;
  17397. cameraSrc.localRotationEulerZ = 0;
  17398. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  17399. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  17400. callback && callback();
  17401. }));
  17402. }));
  17403. }
  17404. playPutBallD3Ani() {
  17405. xGame.common.showOneCamera("mainCamera");
  17406. let handSrc = xGame.common.d3World.d3Hand;
  17407. handSrc.gameObj.active = true;
  17408. handSrc.transform.localPositionZ = 3;
  17409. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  17410. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  17411. handSrc.gameObj.active = false;
  17412. this.enterGame();
  17413. }), 400);
  17414. }));
  17415. }
  17416. updateHead() {
  17417. let user = Moyu.getUserInfo();
  17418. this.ui.topNode.selfNameTxt.text = user.nickName;
  17419. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  17420. let aiData = xGame.cfgMgr.getRandomUserInfo();
  17421. if (DataMgr.getSkillGuide() < 1) {
  17422. this.ui.topNode.aiNameTxt.text = 'billiards';
  17423. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  17424. }
  17425. else {
  17426. this.ui.topNode.aiNameTxt.text = aiData.name;
  17427. let randNo = Math.floor(Math.random() * 10) + 1;
  17428. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  17429. }
  17430. }
  17431. initD2world() {
  17432. let node = this.ui.d2Root.displayObject;
  17433. let src = node.getComponent(D2World);
  17434. if (!src) {
  17435. xGame.common.d2World = node.addComponent(D2World);
  17436. }
  17437. xGame.common.d2World.initSelf();
  17438. }
  17439. initD3world() {
  17440. if (this.isD3Inited)
  17441. return;
  17442. this.isD3Inited = true;
  17443. let scene3D = xGame.common.d3Scene;
  17444. this.ui.d3Root.displayObject.addChild(scene3D);
  17445. scene3D.active = true;
  17446. xGame.common.d3World.tableSrc.setBorderPos();
  17447. }
  17448. onRootMove(e) {
  17449. let rootBall = xGame.common.d2World.rootBall;
  17450. this.ui.moveNode.x = e.x;
  17451. this.ui.moveNode.y = e.y;
  17452. rootBall.gameObj.x = e.x;
  17453. rootBall.gameObj.y = e.y;
  17454. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  17455. }
  17456. aiRootMove(move) {
  17457. if (move)
  17458. this.hideBallUI();
  17459. else {
  17460. this.showBallUI();
  17461. xGame.common.d2World.getHelpLine();
  17462. }
  17463. }
  17464. aiForce(type, force = 0) {
  17465. this.pressTarget = PressType.powerNode;
  17466. if (type == 1)
  17467. this.onEventUp({ force: true });
  17468. else if (type == 2)
  17469. this.onEventMove({ stageY: force, force: true });
  17470. }
  17471. onEventPress(e) {
  17472. if (e.stopPropagation)
  17473. e.stopPropagation();
  17474. if (!this.isTurnSelf())
  17475. return;
  17476. let target = e.target;
  17477. switch (target) {
  17478. case this.ui.myPowerNode.displayObject:
  17479. this.pressTarget = PressType.powerNode;
  17480. this.barInfo.curY = e.stageY;
  17481. this.updateBarInfo();
  17482. break;
  17483. case this.ui.moveNode.displayObject:
  17484. this.pressTarget = PressType.moveNode;
  17485. this.hideBallUI();
  17486. this.eventObj.curX = this.ui.moveNode.x;
  17487. this.eventObj.curY = this.ui.moveNode.y;
  17488. this.ui.moveNode.finger.visible = false;
  17489. this.eventObj.lastX = e.stageX;
  17490. this.eventObj.lastY = e.stageY;
  17491. break;
  17492. case this.ui.rulerClickNode.displayObject:
  17493. this.pressTarget = PressType.rulerNode;
  17494. this.eventObj.lastY = e.stageY;
  17495. break;
  17496. case this.ui.d2Root.displayObject:
  17497. this.pressTarget = PressType.d2Root;
  17498. this.eventObj.lastX = e.stageX;
  17499. this.eventObj.lastY = e.stageY;
  17500. this.eventObj.starX = e.stageX;
  17501. this.eventObj.starY = e.stageY;
  17502. this.eventObj.curX = 0;
  17503. this.eventObj.curY = 0;
  17504. xGame.common.d2World.d2Gan.setGanLastInfo();
  17505. this.rulerOffset = 0;
  17506. break;
  17507. default:
  17508. break;
  17509. }
  17510. }
  17511. onEventMove(e) {
  17512. if (e.stopPropagation)
  17513. e.stopPropagation();
  17514. if (e && e.force) {
  17515. }
  17516. else {
  17517. if (!this.isTurnSelf())
  17518. return;
  17519. }
  17520. switch (this.pressTarget) {
  17521. case PressType.powerNode:
  17522. this.barInfo.curY = e.stageY;
  17523. this.updateBarInfo();
  17524. this.isMoveRod = true;
  17525. break;
  17526. case PressType.moveNode:
  17527. let rootBall = xGame.common.d2World.rootBall;
  17528. let radius = rootBall.gameObj.width / 2;
  17529. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  17530. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  17531. let border = xGame.common.d2World.borderRect;
  17532. if (curX <= border.x + radius)
  17533. curX = border.x + radius;
  17534. else if (curX >= border.x + border.width - radius)
  17535. curX = border.x + border.width - radius;
  17536. if (curY <= border.y + radius)
  17537. curY = border.y + radius;
  17538. else if (curY >= border.y + border.height - radius)
  17539. curY = border.y + border.height - radius;
  17540. if (xGame.common.gameMgr.isOpenBall) {
  17541. if (curX >= border.x + border.openBallW - radius)
  17542. curX = border.x + border.openBallW - radius;
  17543. }
  17544. this.ui.moveNode.x = curX;
  17545. this.ui.moveNode.y = curY;
  17546. rootBall.gameObj.x = curX;
  17547. rootBall.gameObj.y = curY;
  17548. rootBall.d3BallSrc.setTransPos(curX, curY);
  17549. this.isMoveRod = true;
  17550. break;
  17551. case PressType.rulerNode:
  17552. let yy = e.stageY - this.eventObj.lastY;
  17553. this.eventObj.lastY = e.stageY;
  17554. let ruler1 = this.ui.rulerNode.img1;
  17555. let ruler2 = this.ui.rulerNode.img2;
  17556. ruler1.y += yy;
  17557. ruler2.y += yy;
  17558. this.rulerOffset += yy;
  17559. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  17560. this.rulerOffset = 0;
  17561. xGame.soundMgr.playSound("inch", 1, 10);
  17562. }
  17563. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  17564. let h = ruler1.height;
  17565. this.checkGuide();
  17566. this.isMoveRod = true;
  17567. if (ruler1.y >= h) {
  17568. ruler1.y = -h;
  17569. ruler2.y = 0;
  17570. return;
  17571. }
  17572. else if (ruler1.y <= -h) {
  17573. ruler1.y = h;
  17574. ruler2.y = 0;
  17575. return;
  17576. }
  17577. if (ruler2.y >= h) {
  17578. ruler2.y = -h;
  17579. ruler1.y = 0;
  17580. return;
  17581. }
  17582. else if (ruler2.y <= -h) {
  17583. ruler2.y = h;
  17584. ruler1.y = 0;
  17585. return;
  17586. }
  17587. break;
  17588. case PressType.d2Root:
  17589. this.eventObj.curX = e.stageX;
  17590. this.eventObj.curY = e.stageY;
  17591. let offset = this.checkRodMoveDir();
  17592. xGame.common.d2World.d2Gan.rotateSelf(offset);
  17593. this.eventObj.lastX = e.stageX;
  17594. this.eventObj.lastY = e.stageY;
  17595. break;
  17596. default:
  17597. break;
  17598. }
  17599. }
  17600. onEventUp(e) {
  17601. if (e.stopPropagation)
  17602. e.stopPropagation();
  17603. if (e && e.force) {
  17604. }
  17605. else {
  17606. if (!this.isTurnSelf())
  17607. return;
  17608. }
  17609. switch (this.pressTarget) {
  17610. case PressType.powerNode:
  17611. this.ui.powerNode.value = 0;
  17612. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  17613. this.ui.powerTxt.text = "";
  17614. if (this.powerNum > 0) {
  17615. xGame.eventMgr.event(BALL_SHOOT);
  17616. xGame.common.d2World.shoot(this.powerNum);
  17617. xGame.common.d2World.d2Gan.shoot();
  17618. xGame.common.d2World.d2HelpLine.shoot();
  17619. this.finishGuide();
  17620. this.ui.powerEft.visible = false;
  17621. this.ui.colorNode.visible = false;
  17622. let ganStr = "";
  17623. if (this.powerNum <= 30) {
  17624. ganStr = "gan_30";
  17625. }
  17626. else if (this.powerNum <= 60) {
  17627. ganStr = "gan_50";
  17628. }
  17629. else {
  17630. ganStr = "gan_80";
  17631. }
  17632. xGame.soundMgr.playSound(ganStr);
  17633. }
  17634. break;
  17635. case PressType.moveNode:
  17636. let rootBall = xGame.common.d2World.rootBall;
  17637. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  17638. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  17639. let isIntersect = this.judgeBallIntersect();
  17640. if (isIntersect) {
  17641. this.ui.moveNode.x = lastX;
  17642. this.ui.moveNode.y = lastY;
  17643. rootBall.gameObj.x = lastX;
  17644. rootBall.gameObj.y = lastY;
  17645. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  17646. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  17647. }
  17648. else {
  17649. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  17650. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  17651. }
  17652. this.showBallUI();
  17653. this.ui.moveNode.finger.visible = true;
  17654. xGame.common.d2World.getHelpLine();
  17655. break;
  17656. case PressType.rulerNode:
  17657. break;
  17658. case PressType.d2Root:
  17659. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  17660. if (dis <= 25) {
  17661. this.moveToClickDot(e);
  17662. }
  17663. break;
  17664. default:
  17665. break;
  17666. }
  17667. this.pressTarget = -1;
  17668. }
  17669. checkGuide() {
  17670. let guide = DataMgr.getSkillGuide();
  17671. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  17672. xGame.common.guideStep++;
  17673. xGame.common.gameUI.ui.guide2.visible = false;
  17674. xGame.common.gameUI.ui.guide3.visible = true;
  17675. }
  17676. }
  17677. finishGuide() {
  17678. let guide = DataMgr.getSkillGuide();
  17679. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  17680. xGame.common.guideStep = 10;
  17681. this.closeAllGuide();
  17682. }
  17683. }
  17684. closeAllGuide() {
  17685. xGame.common.gameUI.ui.guide1.visible = false;
  17686. xGame.common.gameUI.ui.guide2.visible = false;
  17687. xGame.common.gameUI.ui.guide3.visible = false;
  17688. }
  17689. updateBarInfo() {
  17690. let star = this.ui.powerNode.y;
  17691. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  17692. if (rate >= 1)
  17693. rate = 1;
  17694. if (rate <= 0)
  17695. rate = 0;
  17696. this.powerNum = Math.ceil(rate * 100);
  17697. this.ui.powerNode.value = this.powerNum;
  17698. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  17699. this.ui.colorNode.value = this.powerNum;
  17700. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  17701. this.ui.powerEft.visible = this.powerNum != 0;
  17702. this.ui.colorNode.visible = this.powerNum != 0;
  17703. this.ui.powerTxt.text = this.powerNum + "";
  17704. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  17705. }
  17706. forceCancel() {
  17707. this.ui.powerNode.value = 0;
  17708. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  17709. this.ui.powerTxt.text = "";
  17710. }
  17711. checkRodMoveDir() {
  17712. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  17713. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  17714. if (tempX >= 0 && tempY <= 0) {
  17715. return this.checkDir();
  17716. }
  17717. else if (tempX < 0 && tempY < 0) {
  17718. return this.checkDir(1, -1);
  17719. }
  17720. else if (tempX < 0 && tempY > 0) {
  17721. return this.checkDir(-1, -1);
  17722. }
  17723. else {
  17724. return this.checkDir(-1, 1);
  17725. }
  17726. }
  17727. checkDir(flagX = 1, flagY = 1) {
  17728. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  17729. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  17730. if (offsetY == 0) {
  17731. return offsetX * flagX;
  17732. }
  17733. if (offsetX == 0) {
  17734. return offsetY * flagY;
  17735. }
  17736. let angle = offsetY / offsetX;
  17737. if (Math.abs(angle) >= 1) {
  17738. return offsetY * flagY;
  17739. }
  17740. else {
  17741. return offsetX * flagX;
  17742. }
  17743. }
  17744. judgeBallIntersect() {
  17745. let rootBall = xGame.common.d2World.rootBall;
  17746. let ballArr = xGame.common.d2World.ballArr;
  17747. let radius = rootBall.gameObj.width / 2;
  17748. let temp;
  17749. let isIntersect = false;
  17750. for (let index = 0; index < ballArr.length; index++) {
  17751. temp = ballArr[index];
  17752. if (temp.number == rootBall.number)
  17753. continue;
  17754. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  17755. if (isIntersect) {
  17756. break;
  17757. }
  17758. }
  17759. return isIntersect;
  17760. }
  17761. hideBallUI() {
  17762. let d2Gan = xGame.common.d2World.d2Gan;
  17763. if (!d2Gan.ui.isDisposed)
  17764. d2Gan.ui.visible = false;
  17765. let d2Help = xGame.common.d2World.d2HelpLine;
  17766. if (!d2Help.ui.isDisposed)
  17767. d2Help.ui.visible = false;
  17768. let rootBall = xGame.common.d2World.rootBall;
  17769. if (!rootBall.destroyed) {
  17770. rootBall.gameObj.active = false;
  17771. }
  17772. }
  17773. showBallUI() {
  17774. let d2Gan = xGame.common.d2World.d2Gan;
  17775. if (!d2Gan.ui.isDisposed)
  17776. d2Gan.ui.visible = true;
  17777. let d2Help = xGame.common.d2World.d2HelpLine;
  17778. if (!d2Help.ui.isDisposed)
  17779. d2Help.ui.visible = true;
  17780. let rootBall = xGame.common.d2World.rootBall;
  17781. if (!rootBall.destroyed) {
  17782. rootBall.gameObj.active = true;
  17783. }
  17784. }
  17785. moveToClickDot(e) {
  17786. if (!this.isMoveRod && !xGame.common.clickedBall) {
  17787. let root = xGame.common.d2World.rootBall.gameObj;
  17788. let xx = e.stageX - xGame.common.sysOffestNum;
  17789. let yy = e.stageY;
  17790. let x = xx - root.x;
  17791. let y = yy - root.y;
  17792. let angle = xGame.common.getfguiRotation(x, y);
  17793. xGame.common.d2World.d2Gan.ui.rotation = angle;
  17794. xGame.common.d2World.getHelpLine();
  17795. }
  17796. this.isMoveRod = false;
  17797. xGame.common.clickedBall = false;
  17798. }
  17799. openAllEvent() {
  17800. this.closeAllEvent();
  17801. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17802. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17803. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17804. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17805. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  17806. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  17807. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  17808. }
  17809. closeAllEvent() {
  17810. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17811. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17812. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17813. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17814. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  17815. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  17816. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  17817. }
  17818. resetGame() {
  17819. this.closeAllEvent();
  17820. this.hideBallUI();
  17821. xGame.common.gameMgr.gamePause = true;
  17822. }
  17823. }
  17824. UIGame$1.uiName = "UIGame";
  17825. class UIAddCoin$1 extends UIBase {
  17826. constructor() {
  17827. super();
  17828. this.coinNum = 2000;
  17829. }
  17830. onConstructor() {
  17831. this.ui = ui_UIAddCoin.createInstance();
  17832. this.contentPane = this.ui;
  17833. this.isEject = false;
  17834. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  17835. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  17836. }
  17837. show() {
  17838. super.show();
  17839. this.ui.t0.play();
  17840. }
  17841. videoAddCoin() {
  17842. Moyu.showVideoAd(() => {
  17843. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  17844. this.hide();
  17845. }, EAdType.addFailCoin);
  17846. }
  17847. }
  17848. UIAddCoin$1.uiName = "UIAddCoin";
  17849. class UIInvitation$1 extends UIBase {
  17850. constructor() {
  17851. super();
  17852. }
  17853. onConstructor() {
  17854. this.ui = ui_UIInvitation.createInstance();
  17855. this.contentPane = this.ui;
  17856. this.isEject = false;
  17857. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  17858. }
  17859. show() {
  17860. super.show();
  17861. }
  17862. enterGame() {
  17863. xGame.common.gameMode = GameMode.classic;
  17864. DataMgr.setChallengeTimes(1);
  17865. xGame.common.passAwardCoin = 2000;
  17866. let need = xGame.common.classicNiceNeddCoin;
  17867. if (DataMgr.coinEnough(need)) {
  17868. DataMgr.setCoin(-need);
  17869. xGame.eventMgr.event(RESTART_GAME, true);
  17870. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  17871. }
  17872. else {
  17873. xGame.eventMgr.event(RESTART_GAME, true);
  17874. }
  17875. this.hide();
  17876. }
  17877. hide() {
  17878. super.hide();
  17879. }
  17880. }
  17881. UIInvitation$1.uiName = "UIInvitation";
  17882. class UIPower$1 extends UIBase {
  17883. constructor() {
  17884. super();
  17885. }
  17886. onConstructor() {
  17887. this.ui = ui_UIPower.createInstance();
  17888. this.contentPane = this.ui;
  17889. this.isEject = false;
  17890. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  17891. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  17892. }
  17893. show() {
  17894. super.show();
  17895. this.ui.t0.play();
  17896. }
  17897. videoGetPower() {
  17898. Moyu.showVideoAd(() => {
  17899. DataMgr.setPower(xGame.common.videoPower, true);
  17900. xGame.eventMgr.event(POWER_TIME);
  17901. this.hide();
  17902. }, EAdType.getPower);
  17903. }
  17904. }
  17905. UIPower$1.uiName = "UIPower";
  17906. class UIGameEnd$1 extends UIBase {
  17907. constructor() {
  17908. super();
  17909. this.success = false;
  17910. this.awardCoinNum = 1000;
  17911. this.awardDiamondNum = 10;
  17912. }
  17913. onConstructor() {
  17914. this.ui = ui_UIGameEnd.createInstance();
  17915. this.contentPane = this.ui;
  17916. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  17917. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  17918. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  17919. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  17920. this.ui.talkNode.visible = false;
  17921. if (Moyu.isKs)
  17922. this.ui.closeNode.closeBtn.x += 100;
  17923. }
  17924. updateType() {
  17925. switch (xGame.common.gameMode) {
  17926. case GameMode.classic:
  17927. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  17928. this.ui.coinNode.visible = this.success;
  17929. if (!this.success) {
  17930. Laya.timer.once(500, this, () => {
  17931. xGame.uiMgr.Show(UIAddCoin$1);
  17932. });
  17933. }
  17934. this.ui.isGetAward.visible = false;
  17935. this.ui.leftBtn.c1.selectedIndex = 3;
  17936. this.ui.rightBtn.c1.selectedIndex = 0;
  17937. this.moneyNode.ui.c1.selectedIndex = 1;
  17938. break;
  17939. case GameMode.bigMove:
  17940. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  17941. this.ui.coinNode.visible = this.success;
  17942. if (xGame.common.gameMode == GameMode.bigMove) {
  17943. if (this.success) {
  17944. DataMgr.setSkillSuccessTimes(1, true);
  17945. DataMgr.setSkillAccTimes(1);
  17946. }
  17947. else {
  17948. DataMgr.setSkillSuccessTimes(0, false);
  17949. }
  17950. }
  17951. if (!this.success) {
  17952. Laya.timer.once(500, this, () => {
  17953. xGame.uiMgr.Show(UIAddCoin$1);
  17954. });
  17955. }
  17956. this.ui.isGetAward.visible = false;
  17957. this.ui.leftBtn.c1.selectedIndex = 3;
  17958. this.ui.rightBtn.c1.selectedIndex = 0;
  17959. this.moneyNode.ui.c1.selectedIndex = 1;
  17960. break;
  17961. case GameMode.placeBall:
  17962. this.ui.coinNode.visible = false;
  17963. if (this.success) {
  17964. if (xGame.common.placeBallStarNum == 3) {
  17965. this.ui.c1.selectedIndex = 2;
  17966. }
  17967. else {
  17968. this.ui.c1.selectedIndex = 3;
  17969. }
  17970. }
  17971. else {
  17972. this.ui.c1.selectedIndex = 4;
  17973. }
  17974. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  17975. if (cfg.type == PlaceBallType.challenge) {
  17976. this.ui.c1.selectedIndex = 2;
  17977. }
  17978. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  17979. this.updatePlaceBallBtn();
  17980. this.updatePlaceBallStarNum();
  17981. this.updatePlaceBallAwardState();
  17982. this.moneyNode.ui.c1.selectedIndex = 2;
  17983. this.moneyNode.checkPowerTime();
  17984. this.moneyNode.powerChange();
  17985. DataMgr.upRankData();
  17986. break;
  17987. default:
  17988. break;
  17989. }
  17990. }
  17991. updatePlaceBallBtn() {
  17992. this.ui.leftBtn.c1.selectedIndex = 5;
  17993. if (this.success) {
  17994. this.ui.rightBtn.c1.selectedIndex = 14;
  17995. }
  17996. else {
  17997. if (xGame.common.placeBallStarNum == 3) {
  17998. this.ui.rightBtn.c1.selectedIndex = 14;
  17999. }
  18000. else {
  18001. this.ui.rightBtn.c1.selectedIndex = 1;
  18002. }
  18003. }
  18004. }
  18005. updatePlaceBallStarNum() {
  18006. let starNum = xGame.common.placeBallStarNum;
  18007. if (starNum == 0)
  18008. this.ui.starNumNode.c1.selectedIndex = 3;
  18009. else {
  18010. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  18011. }
  18012. }
  18013. updatePlaceBallAwardState() {
  18014. let level = xGame.common.placeBallCurLevel;
  18015. let starNum = xGame.common.placeBallStarNum;
  18016. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  18017. let data = cfgTable.placeballData[level].award;
  18018. let cfg = cfgTable.placeballData[level];
  18019. this.awardDiamondNum = data[1];
  18020. this.awardCoinNum = data[0];
  18021. if (cfg.type == PlaceBallType.challenge) {
  18022. this.awardDiamondNum = 0;
  18023. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  18024. }
  18025. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  18026. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  18027. if (cfg.type == PlaceBallType.challenge) {
  18028. this.ui.awardNode.coinNode.visible = true;
  18029. }
  18030. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  18031. this.ui.awardNode.diamondNode.x = 265;
  18032. this.ui.awardNode.coinNode.x = 354;
  18033. }
  18034. else {
  18035. this.ui.awardNode.diamondNode.x = 291;
  18036. this.ui.awardNode.coinNode.x = 291;
  18037. }
  18038. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  18039. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  18040. if (this.awardCoinNum == 0) {
  18041. this.ui.awardNode.coinNode.numTxt.text = "";
  18042. }
  18043. if (getAward) {
  18044. this.ui.isGetAward.visible = true;
  18045. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  18046. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  18047. }
  18048. else {
  18049. this.ui.isGetAward.visible = false;
  18050. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  18051. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  18052. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  18053. }
  18054. else {
  18055. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  18056. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  18057. }
  18058. }
  18059. }
  18060. show(success) {
  18061. super.show();
  18062. xGame.eventMgr.event(RESET_GAME);
  18063. this.success = success;
  18064. Laya.timer.clearAll(this);
  18065. this.playSecretaryAni();
  18066. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  18067. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  18068. offsetTime = Math.floor(offsetTime / 1000);
  18069. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  18070. this.updateType();
  18071. Laya.timer.once(200, this, () => {
  18072. this.addAward(() => {
  18073. this.updateType();
  18074. Laya.timer.once(500, this, () => {
  18075. this.showChallengeLevel();
  18076. });
  18077. });
  18078. });
  18079. if (this.success) {
  18080. xGame.soundMgr.playSound('slots_roll01');
  18081. xGame.soundMgr.playSound("s_win");
  18082. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18083. }
  18084. else {
  18085. xGame.soundMgr.playSound('matchwin01');
  18086. xGame.soundMgr.playSound("s_lose");
  18087. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18088. }
  18089. if (!Moyu.isLegal)
  18090. PlatMgr.showBanner(true);
  18091. let challengeNum = DataMgr.getChallengeTimes();
  18092. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  18093. DataMgr.setChallengeTimes(1);
  18094. }
  18095. if (this.success && xGame.common.gameMode == GameMode.classic) {
  18096. DataMgr.setClassicTimes();
  18097. }
  18098. }
  18099. showChallengeLevel() {
  18100. if (DataMgr.getChallengeTimes() != 0)
  18101. return;
  18102. let skill = DataMgr.getSkillAccTimes();
  18103. let put = DataMgr.getPlaceBallLevelList().length;
  18104. if (skill >= 3 || put >= 5) {
  18105. xGame.uiMgr.Show(UIInvitation$1);
  18106. this.hide();
  18107. }
  18108. }
  18109. addAward(callback) {
  18110. if (!this.success) {
  18111. callback && callback();
  18112. return;
  18113. }
  18114. switch (xGame.common.gameMode) {
  18115. case GameMode.classic:
  18116. this.awardCoinNum = xGame.common.passAwardCoin;
  18117. this.awardDiamondNum = 0;
  18118. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  18119. break;
  18120. case GameMode.bigMove:
  18121. this.awardCoinNum = xGame.common.passAwardCoin;
  18122. this.awardDiamondNum = 0;
  18123. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  18124. callback && callback();
  18125. break;
  18126. case GameMode.placeBall:
  18127. let level = xGame.common.placeBallCurLevel;
  18128. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  18129. if (xGame.common.placeBallStarNum != 3) {
  18130. callback && callback();
  18131. return;
  18132. }
  18133. else {
  18134. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  18135. if (getAward) {
  18136. callback && callback();
  18137. return;
  18138. }
  18139. }
  18140. let cfg = cfgTable.placeballData[level];
  18141. let data = cfgTable.placeballData[level].award;
  18142. this.awardCoinNum = data[0];
  18143. this.awardDiamondNum = data[1];
  18144. if (cfg.type == PlaceBallType.challenge) {
  18145. this.awardDiamondNum = 0;
  18146. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  18147. }
  18148. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  18149. let diamondAward;
  18150. if (this.awardDiamondNum > 0) {
  18151. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  18152. xGame.common.getAward([diamondAward, coinAward], callback);
  18153. }
  18154. else {
  18155. xGame.common.getAward([coinAward], callback);
  18156. }
  18157. if (cfg.type == PlaceBallType.normal) {
  18158. DataMgr.setPlaceBallAward(level);
  18159. }
  18160. break;
  18161. default:
  18162. break;
  18163. }
  18164. }
  18165. playSecretaryAni_old() {
  18166. let parent = this.ui.secretary.displayObject;
  18167. parent.destroyChildren();
  18168. let xx = this.ui.secretary.width / 2;
  18169. let yy = this.ui.secretary.height;
  18170. let scale = xGame.common.getSecretaryScale();
  18171. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18172. if (this.success) {
  18173. let rand = Math.random() <= 0.5 ? 2 : 3;
  18174. xGame.common.secretary.play(data, rand, false, parent, () => {
  18175. xGame.common.secretary.play(data, 1, true, parent);
  18176. });
  18177. }
  18178. else {
  18179. xGame.common.secretary.play(data, 0, true, parent);
  18180. }
  18181. }
  18182. playSecretaryAni() {
  18183. let parent = this.ui.secretary.displayObject;
  18184. parent.destroyChildren();
  18185. let xx = this.ui.secretary.width / 2;
  18186. let yy = this.ui.secretary.height;
  18187. let scale = xGame.common.getSecretaryScale();
  18188. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18189. if (this.success) {
  18190. let rand = 0;
  18191. xGame.common.secretary.play(data, 0, true, parent);
  18192. }
  18193. else {
  18194. xGame.common.secretary.play(data, 0, true, parent);
  18195. }
  18196. }
  18197. restartGame() {
  18198. switch (xGame.common.gameMode) {
  18199. case GameMode.classic:
  18200. xGame.eventMgr.event(RESTART_GAME);
  18201. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18202. break;
  18203. case GameMode.bigMove:
  18204. this.hide();
  18205. xGame.eventMgr.event(RESTART_GAME);
  18206. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18207. break;
  18208. default:
  18209. break;
  18210. }
  18211. }
  18212. hide() {
  18213. super.hide();
  18214. xGame.common.stopGirlPop(this.ui.talkNode);
  18215. PlatMgr.showBanner(false);
  18216. }
  18217. returnHome() {
  18218. this.hide();
  18219. let showFailWords = !this.success;
  18220. xGame.uiMgr.Show(UIMain$1, showFailWords);
  18221. }
  18222. clickLeftBtn() {
  18223. switch (xGame.common.gameMode) {
  18224. case GameMode.classic:
  18225. case GameMode.bigMove:
  18226. this.returnHome();
  18227. break;
  18228. case GameMode.placeBall:
  18229. let level = xGame.common.placeBallCurLevel;
  18230. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  18231. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18232. break;
  18233. default:
  18234. break;
  18235. }
  18236. }
  18237. powerStartPlaceBallLevel(level, btn) {
  18238. if (DataMgr.powerEnough()) {
  18239. btn.touchable = false;
  18240. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  18241. btn.touchable = true;
  18242. DataMgr.setPower(-1);
  18243. xGame.eventMgr.event(POWER_TIME);
  18244. this.startPlaceBallLevel(level);
  18245. }));
  18246. }
  18247. else {
  18248. xGame.uiMgr.Show(UIPower$1, 0);
  18249. }
  18250. }
  18251. clickRightBtn() {
  18252. switch (xGame.common.gameMode) {
  18253. case GameMode.classic:
  18254. console.log('zh:clickRightBtn 111');
  18255. case GameMode.bigMove:
  18256. console.log('zh:clickRightBtn 222');
  18257. this.restartGame();
  18258. break;
  18259. case GameMode.placeBall:
  18260. console.log('zh:clickRightBtn 333');
  18261. let level = xGame.common.placeBallCurLevel;
  18262. let data = DataMgr.getPlaceBallLevel(level);
  18263. let curPss = data.play && !data.isCur;
  18264. if (curPss) {
  18265. console.log('zh:clickRightBtn 333-111');
  18266. console.log('zh:当前LV=' + level);
  18267. if (level == 60) {
  18268. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  18269. Laya.timer.once(3000, this, () => {
  18270. this.returnHome();
  18271. });
  18272. }
  18273. else {
  18274. this.powerStartPlaceBallLevel(level + 1, this.ui.rightBtn);
  18275. }
  18276. }
  18277. else {
  18278. console.log('zh:clickRightBtn 333-000');
  18279. Moyu.sendDataEvent("placeBallNextLevel");
  18280. Moyu.showVideoAd(() => {
  18281. DataMgr.setPlaceBallLevel(level, 1);
  18282. this.startPlaceBallLevel(level + 1);
  18283. }, xGame.define.EAdType.placeBallNextLevel);
  18284. }
  18285. break;
  18286. default:
  18287. console.log('zh:clickRightBtn 444');
  18288. break;
  18289. }
  18290. }
  18291. startPlaceBallLevel(level) {
  18292. xGame.common.gameMode = GameMode.placeBall;
  18293. xGame.common.placeBallCurLevel = level;
  18294. xGame.uiMgr.Show(UIGame$1);
  18295. this.hide();
  18296. }
  18297. }
  18298. UIGameEnd$1.uiName = "UIGameEnd";
  18299. class ShowItem$1 {
  18300. constructor() {
  18301. this.ui = ui_ShowItem.createInstance();
  18302. }
  18303. destroySelf() {
  18304. if (!this.ui.isDisposed) {
  18305. this.ui.removeFromParent();
  18306. this.ui.dispose();
  18307. }
  18308. }
  18309. setParent(parent) {
  18310. parent.addChild(this.ui);
  18311. }
  18312. setPos(x, y) {
  18313. this.ui.x = x;
  18314. this.ui.y = y;
  18315. }
  18316. setUrl(index) {
  18317. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  18318. }
  18319. }
  18320. class UILevelProp$1 extends UIBase {
  18321. constructor() {
  18322. super();
  18323. this.firstPos = 385;
  18324. this.secondPos = 467;
  18325. this.showItemArr = [];
  18326. }
  18327. onConstructor() {
  18328. this.ui = ui_UILevelProp.createInstance();
  18329. this.contentPane = this.ui;
  18330. this.isEject = false;
  18331. this.addUIClick(this.ui.closeBtn, this.hide);
  18332. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18333. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  18334. }
  18335. show(level) {
  18336. super.show();
  18337. this.ui.t1.play();
  18338. this.level = level;
  18339. this.data = cfgTable.placeballData[this.level];
  18340. this.updateSelf();
  18341. this.showPreView();
  18342. this.moneyNode.ui.c1.selectedIndex = 2;
  18343. this.moneyNode.checkPowerTime();
  18344. this.moneyNode.powerChange();
  18345. }
  18346. showPreView() {
  18347. let item;
  18348. let data;
  18349. for (let index = 0; index < this.showItemArr.length; index++) {
  18350. item = this.showItemArr[index];
  18351. item.destroySelf();
  18352. }
  18353. this.showItemArr = [];
  18354. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  18355. for (const key in cfgData) {
  18356. data = cfgData[key];
  18357. item = new ShowItem$1();
  18358. item.setParent(this.ui.myNode.displayRoot);
  18359. item.setPos(data.x, data.y);
  18360. item.setUrl(data.value);
  18361. this.showItemArr.push(item);
  18362. }
  18363. }
  18364. updateSelf() {
  18365. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  18366. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  18367. if (this.data.ball == -1) {
  18368. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  18369. }
  18370. else {
  18371. this.ui.myNode.conditionTxt.text = "Reward";
  18372. }
  18373. let localData = DataMgr.getPlaceBallLevel(this.level);
  18374. let getAward = localData.getAward;
  18375. let cfg = cfgTable.placeballData[this.level];
  18376. let coin = this.data.award[0];
  18377. let diamond = this.data.award[1];
  18378. if (cfg.type == PlaceBallType.challenge) {
  18379. diamond = 0;
  18380. coin = 100;
  18381. }
  18382. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  18383. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  18384. this.ui.myNode.coinNode.numTxt.text = coin + "";
  18385. if (cfg.type == PlaceBallType.challenge) {
  18386. this.ui.myNode.coinNode.numTxt.text = "";
  18387. }
  18388. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  18389. if (coin > 0 && diamond > 0) {
  18390. this.ui.myNode.diamondNode.x = 385;
  18391. this.ui.myNode.coinNode.x = 467;
  18392. }
  18393. else {
  18394. this.ui.myNode.diamondNode.x = 385;
  18395. this.ui.myNode.coinNode.x = 385;
  18396. }
  18397. if (!getAward) {
  18398. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  18399. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  18400. }
  18401. else {
  18402. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  18403. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  18404. }
  18405. }
  18406. startGame() {
  18407. if (DataMgr.powerEnough()) {
  18408. this.ui.myNode.startBtn.touchable = false;
  18409. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  18410. console.log('zh:startGame ');
  18411. this.ui.myNode.startBtn.touchable = true;
  18412. DataMgr.setPower(-1);
  18413. xGame.eventMgr.event(POWER_TIME);
  18414. xGame.common.gameMode = GameMode.placeBall;
  18415. xGame.common.placeBallCurLevel = this.level;
  18416. xGame.uiMgr.Show(UIGame$1);
  18417. xGame.uiMgr.Hide(UILevelDisplay$1);
  18418. xGame.uiMgr.Hide(UIMain$1);
  18419. this.hide();
  18420. }));
  18421. }
  18422. else {
  18423. console.log('zh:startGame no power');
  18424. xGame.uiMgr.Show(UIPower$1);
  18425. }
  18426. }
  18427. hide() {
  18428. super.hide();
  18429. }
  18430. }
  18431. UILevelProp$1.uiName = "UILevelProp";
  18432. class PutBallLevelDisplay$1 {
  18433. constructor(ui, index) {
  18434. this.index = 0;
  18435. this.ui = ui;
  18436. this.index = index;
  18437. this.ui.onClick(this, this.clickSelf);
  18438. this.updateSelf();
  18439. this.ui.levelTxt.text = (this.index + 1) + "";
  18440. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  18441. this.ui.special.levelTxt.text = (this.index + 1) + "";
  18442. }
  18443. updateSelf() {
  18444. let level = this.index + 1;
  18445. this.data = DataMgr.getPlaceBallLevel(level);
  18446. this.ui.starNode.c1.selectedIndex = this.data.star;
  18447. let isChallenge = cfgTable.placeballData[level].type;
  18448. if (this.data.isCur) {
  18449. if (isChallenge) {
  18450. this.ui.c1.selectedIndex = 5;
  18451. }
  18452. else {
  18453. this.ui.c1.selectedIndex = 2;
  18454. }
  18455. }
  18456. else {
  18457. if (this.data.play) {
  18458. if (this.data.star == 3) {
  18459. this.ui.c1.selectedIndex = 0;
  18460. }
  18461. else {
  18462. this.ui.c1.selectedIndex = 1;
  18463. }
  18464. }
  18465. else {
  18466. if (isChallenge) {
  18467. this.ui.c1.selectedIndex = 4;
  18468. }
  18469. else {
  18470. this.ui.c1.selectedIndex = 3;
  18471. }
  18472. }
  18473. }
  18474. }
  18475. clickSelf() {
  18476. if (!this.data.play)
  18477. return;
  18478. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18479. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  18480. }
  18481. }
  18482. class UILevelDisplay$1 extends UIBase {
  18483. constructor() {
  18484. super();
  18485. }
  18486. onConstructor() {
  18487. this.ui = ui_UILevelDisplay.createInstance();
  18488. this.contentPane = this.ui;
  18489. this.isEject = false;
  18490. this.myList = this.ui.myNode.myList;
  18491. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  18492. this.levelItemArr = [];
  18493. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  18494. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  18495. this.myList.numItems = levelNum;
  18496. if (Moyu.isKs)
  18497. this.ui.closeNode.closeBtn.x += 100;
  18498. }
  18499. levelItemRender(index, target) {
  18500. let item = new PutBallLevelDisplay$1(target, index);
  18501. this.levelItemArr.push(item);
  18502. }
  18503. show() {
  18504. super.show();
  18505. this.updateLevel();
  18506. this.scrollToPlace();
  18507. }
  18508. updateLevel() {
  18509. let temp;
  18510. for (let index = 0; index < this.levelItemArr.length; index++) {
  18511. temp = this.levelItemArr[index];
  18512. temp.updateSelf();
  18513. }
  18514. }
  18515. scrollToPlace() {
  18516. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  18517. let passArr = DataMgr.getPlaceBallLevelList();
  18518. let offest = passArr.length;
  18519. if (offest >= maxNum - 1)
  18520. offest = maxNum - 1;
  18521. this.myList.scrollToView(offest, true, true);
  18522. }
  18523. hide() {
  18524. super.hide();
  18525. }
  18526. }
  18527. UILevelDisplay$1.uiName = "UILevelDisplay";
  18528. class UIMatching$1 extends UIBase {
  18529. constructor() {
  18530. super();
  18531. }
  18532. onConstructor() {
  18533. this.ui = ui_UIMatching.createInstance();
  18534. this.contentPane = this.ui;
  18535. this.isEject = false;
  18536. }
  18537. show(callback) {
  18538. super.show();
  18539. PlatMgr.showBanner(true);
  18540. this.callback = callback;
  18541. let user = Moyu.getUserInfo();
  18542. if (!this.selfPot) {
  18543. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  18544. }
  18545. if (!this.aiPot) {
  18546. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  18547. }
  18548. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  18549. this.ui.selfHead.nameTxt.text = user.nickName;
  18550. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  18551. this.ui.aiHead.nameTxt.text = "???";
  18552. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  18553. this.ui.selfHead.c1.selectedIndex = 0;
  18554. this.ui.aiHead.c1.selectedIndex = 0;
  18555. this.ui.selfHead.x = this.selfPot.x;
  18556. this.ui.selfHead.y = this.selfPot.y;
  18557. this.ui.aiHead.x = this.aiPot.x;
  18558. this.ui.aiHead.y = this.aiPot.y;
  18559. switch (xGame.common.gameMode) {
  18560. case GameMode.classic:
  18561. break;
  18562. case GameMode.bigMove:
  18563. this.initSkillData();
  18564. break;
  18565. default:
  18566. break;
  18567. }
  18568. this.ui.t1.play(Laya.Handler.create(this, () => {
  18569. this.ui.t2.play(Laya.Handler.create(this, () => {
  18570. switch (xGame.common.gameMode) {
  18571. case GameMode.classic:
  18572. this.waitingPeople();
  18573. break;
  18574. case GameMode.bigMove:
  18575. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  18576. break;
  18577. default:
  18578. break;
  18579. }
  18580. }));
  18581. }));
  18582. }
  18583. initSkillData() {
  18584. this.skillSelectData = [];
  18585. let skillUrl = xGame.common.skillIconList;
  18586. let skillName = xGame.common.skillNameList;
  18587. let skillLevel = DataMgr.getBigSkillList();
  18588. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  18589. for (let index = 0; index < 5; index++) {
  18590. let obj = {};
  18591. obj.skillImg = skillUrl[index];
  18592. obj.skillName = skillName[index];
  18593. obj.skillType = skillType[index];
  18594. obj.skillLevel = skillLevel[index];
  18595. this.skillSelectData.push(obj);
  18596. }
  18597. }
  18598. getAISkillLevel(myLevel) {
  18599. let video = xGame.common.upSkillLevel;
  18600. let aiLevel;
  18601. let temp;
  18602. if (video) {
  18603. temp = xGame.common.randomNum(-2, -1);
  18604. }
  18605. else {
  18606. if (myLevel <= 5) {
  18607. temp = xGame.common.randomNum(1, 3);
  18608. }
  18609. else if (myLevel <= 9) {
  18610. temp = xGame.common.randomNum(-2, 1);
  18611. }
  18612. else {
  18613. temp = xGame.common.randomNum(-4, 0);
  18614. }
  18615. }
  18616. aiLevel = temp + myLevel;
  18617. if (aiLevel <= 1)
  18618. aiLevel = 1;
  18619. if (aiLevel >= 10)
  18620. aiLevel = 10;
  18621. return aiLevel;
  18622. }
  18623. getAISkillType() {
  18624. return xGame.common.randomNum(1, 4);
  18625. let successTimes = DataMgr.getSkillSuccessTimes();
  18626. let info = cfgTable.aiskillData[successTimes];
  18627. if (!info) {
  18628. let max = Object.keys(cfgTable.aiskillData).length - 1;
  18629. info = cfgTable.aiskillData[max];
  18630. }
  18631. let dataArr = info.skillselect;
  18632. let myCfg = {};
  18633. for (let index = 0; index < dataArr.length; index++) {
  18634. let temp = dataArr[index].split('-');
  18635. myCfg[temp[0]] = {};
  18636. myCfg[temp[0]].id = parseInt(temp[0]);
  18637. myCfg[temp[0]].weight = parseInt(temp[1]);
  18638. }
  18639. let aiCfg = xGame.common.initWeight(myCfg);
  18640. let curData = xGame.common.getRandomWeightData(aiCfg);
  18641. return parseInt(curData.id);
  18642. }
  18643. getAISkillData(index) {
  18644. let myLevel = this.skillSelectData[index].skillLevel;
  18645. let aiLevel = this.getAISkillLevel(myLevel);
  18646. let aiType = this.getAISkillType() - 1;
  18647. return { aiLevel, aiType } = { aiLevel, aiType };
  18648. }
  18649. skillSelectFinish(index) {
  18650. let aiInfo = this.getAISkillData(index);
  18651. xGame.common.gameMgr.selfCurSkill = index;
  18652. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  18653. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  18654. this.ui.selfHead.c1.selectedIndex = 1;
  18655. this.ui.aiHead.c1.selectedIndex = 1;
  18656. let myData = this.skillSelectData[index];
  18657. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  18658. let guide = DataMgr.getSkillGuide();
  18659. if (guide == 0) {
  18660. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  18661. }
  18662. else {
  18663. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  18664. }
  18665. let aiData = this.skillSelectData[aiInfo.aiType];
  18666. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  18667. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  18668. this.waitingPeople();
  18669. }
  18670. waitingPeople() {
  18671. let time = xGame.common.randomNum(1000, 3000);
  18672. time += 1000;
  18673. Laya.timer.once(time, this, () => {
  18674. this.matchingSuccess();
  18675. });
  18676. }
  18677. matchingSuccess() {
  18678. let gameUI = xGame.common.gameUI;
  18679. let name = gameUI.ui.topNode.aiNameTxt.text;
  18680. let url = gameUI.ui.topNode.aiHeadLoader.url;
  18681. this.ui.aiHead.nameTxt.text = name;
  18682. this.ui.aiHead.headImg.url = url;
  18683. name = gameUI.ui.topNode.selfNameTxt.text;
  18684. url = gameUI.ui.topNode.selfHeadLoader.url;
  18685. this.ui.selfHead.nameTxt.text = name;
  18686. this.ui.selfHead.headImg.url = url;
  18687. this.ui.t3.play(Laya.Handler.create(this, () => {
  18688. this.callback && this.callback();
  18689. this.ui.t4.play(Laya.Handler.create(this, () => {
  18690. this.destroySelf();
  18691. }));
  18692. }));
  18693. }
  18694. destroySelf() {
  18695. this.callback = null;
  18696. this.skillSelectData = null;
  18697. this.selfPot = null;
  18698. this.aiPot = null;
  18699. if (!this.ui.isDisposed) {
  18700. this.ui.removeFromParent();
  18701. this.ui.dispose();
  18702. }
  18703. xGame.uiMgr.destroyUI(this);
  18704. }
  18705. }
  18706. UIMatching$1.uiName = "UIMatching";
  18707. class SkillDisplay$1 {
  18708. constructor(ui, data, uiIndex) {
  18709. this.starX = 0;
  18710. this.starY = 0;
  18711. this.index = 0;
  18712. this.ui = ui;
  18713. this.data = data;
  18714. this.index = uiIndex;
  18715. this.initSelf();
  18716. console.log('zh:SkillDisplay constructor this.skillData=', data);
  18717. }
  18718. initSelf() {
  18719. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  18720. this.ui.nameTxt.text = this.data.name;
  18721. this.ui.describeTxt.text = this.data.describe;
  18722. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  18723. this.ui.startBtn.onClick(this, this.startGame);
  18724. this.updateSelf();
  18725. }
  18726. updateSelf() {
  18727. this.checkTry();
  18728. let level = DataMgr.getBigSkillByIndex(this.index);
  18729. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  18730. }
  18731. checkTry() {
  18732. let index = this.index;
  18733. let level = DataMgr.getBigSkillByIndex(index);
  18734. if (level == null) {
  18735. DataMgr.setBigSkill(index, 1, false);
  18736. level = 1;
  18737. }
  18738. this.ui.levelTxt.text = "LV." + level;
  18739. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  18740. this.ui.tryNode.visible = true;
  18741. else
  18742. this.ui.tryNode.visible = false;
  18743. }
  18744. clickAddLevel() {
  18745. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18746. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  18747. Moyu.showVideoAd(() => {
  18748. DataMgr.setBigSkill(this.data.index, 1);
  18749. this.updateSelf();
  18750. xGame.common.upSkillLevel = true;
  18751. }, EAdType.upSkill);
  18752. }
  18753. startGame() {
  18754. if (this.data.index == 3) {
  18755. alert('Coming soon!');
  18756. return;
  18757. }
  18758. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18759. let needCoin = xGame.common.bigMoveNeedCoin;
  18760. xGame.common.passAwardCoin = 2000;
  18761. let guide = DataMgr.getSkillGuide();
  18762. console.log('zh:startGame guide=' + guide);
  18763. xGame.common.temSelfLevel = 0;
  18764. if (guide == 0) {
  18765. needCoin = 0;
  18766. xGame.common.temSelfLevel = 100;
  18767. }
  18768. if (DataMgr.coinEnough(needCoin)) {
  18769. DataMgr.setCoin(-needCoin);
  18770. xGame.common.curPlayerSkillType = this.index;
  18771. if (guide == 0)
  18772. xGame.common.curPlayerSkillType = 0;
  18773. xGame.uiMgr.Show(UIGame$1);
  18774. xGame.uiMgr.Hide(UIMain$1);
  18775. xGame.uiMgr.Show(UIMatching$1, () => {
  18776. xGame.common.gameUI.ui.alpha = 1;
  18777. xGame.common.gameUI.startGame();
  18778. xGame.uiMgr.Hide(UISkill$1);
  18779. });
  18780. }
  18781. else {
  18782. xGame.uiMgr.Show(UIAddProp$1, 0);
  18783. Moyu.sendDataEvent("AddCoinVideo");
  18784. }
  18785. }
  18786. }
  18787. class UISkill$1 extends UIBase {
  18788. constructor() {
  18789. super();
  18790. this.skillData = [];
  18791. }
  18792. onConstructor() {
  18793. this.ui = ui_UISkill.createInstance();
  18794. this.contentPane = this.ui;
  18795. this.isEject = false;
  18796. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18797. this.initSkillData();
  18798. console.log('zh:aaaaaa1111111111');
  18799. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  18800. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  18801. console.log('zh:aaaaaa22222222');
  18802. this.displayList = [];
  18803. this.ui.skillNode.skillList.numItems = 3;
  18804. this.addUIClick(this.ui, this.interuptSecretary);
  18805. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  18806. this.ui.talkNode.visible = false;
  18807. if (Moyu.isKs)
  18808. this.ui.closeNode.closeBtn.x += 100;
  18809. }
  18810. show() {
  18811. super.show();
  18812. this.playSecretaryIdle();
  18813. this.moneyNode.ui.c1.selectedIndex = 1;
  18814. Laya.timer.clearAll(this);
  18815. xGame.soundMgr.playSound("s_start");
  18816. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18817. let guide = DataMgr.getSkillGuide();
  18818. this.ui.guideNode.visible = guide == 0;
  18819. let item = this.getSkillItemByUIIndex(0);
  18820. if (guide == 0) {
  18821. item.ui.c1.selectedIndex = 1;
  18822. }
  18823. else {
  18824. item.ui.c1.selectedIndex = 0;
  18825. }
  18826. this.ui.guideNode.guideBtn.visible = guide == 0;
  18827. for (let index = 0; index < this.displayList.length; index++) {
  18828. this.displayList[index].checkTry();
  18829. }
  18830. }
  18831. getSkillItemByUIIndex(cur) {
  18832. for (let index = 0; index < this.displayList.length; index++) {
  18833. if (this.displayList[index].index == cur) {
  18834. return this.displayList[index];
  18835. }
  18836. }
  18837. }
  18838. enterGuideLevel() {
  18839. let item = this.getSkillItemByUIIndex(0);
  18840. item.startGame();
  18841. if (DataMgr.getNewUser())
  18842. Moyu.sendDataEvent("gameStart1");
  18843. }
  18844. initSkillData() {
  18845. this.skillData = [];
  18846. let nameList = xGame.common.skillNameList;
  18847. let iconList = xGame.common.skillIconList;
  18848. let describeList = [
  18849. "Jump shot executed — ball bounced and pocketed an extra one!",
  18850. "Bonus Sweep: A random follow-up strike hits 1 extra ball after your shot!",
  18851. "Freeze Effect: Your shot freezes 1 random ball — enemy can’t hit it, and others bounce off!"
  18852. ];
  18853. console.log('zh:initSkillData 111111111');
  18854. let data;
  18855. for (let index = 0; index < nameList.length; index++) {
  18856. data = {};
  18857. data.name = nameList[index];
  18858. data.icon = iconList[index];
  18859. data.describe = describeList[index];
  18860. data.index = index;
  18861. this.skillData.push(data);
  18862. }
  18863. }
  18864. updateSkillItem(index, target) {
  18865. if (this.displayList[index] == null) {
  18866. let uiIndex;
  18867. switch (index) {
  18868. case 0:
  18869. uiIndex = 1;
  18870. break;
  18871. case 1:
  18872. uiIndex = 0;
  18873. break;
  18874. case 2:
  18875. uiIndex = 2;
  18876. break;
  18877. case 3:
  18878. uiIndex = 3;
  18879. break;
  18880. default:
  18881. break;
  18882. }
  18883. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  18884. this.displayList.push(temp);
  18885. }
  18886. }
  18887. playSecretaryIdle() {
  18888. let parent = this.ui.secretary.displayObject;
  18889. parent.destroyChildren();
  18890. let xx = this.ui.secretary.width / 2;
  18891. let yy = this.ui.secretary.height;
  18892. let scale = xGame.common.getSecretaryScale();
  18893. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18894. xGame.common.secretary.play(data, 0, true, parent);
  18895. }
  18896. returnUIMain() {
  18897. this.hide();
  18898. xGame.common.stopGirlPop(this.ui.talkNode);
  18899. xGame.uiMgr.Show(UIMain$1);
  18900. }
  18901. interuptSecretary() {
  18902. Laya.timer.clearAll(this);
  18903. this.playSecretaryRandomSound();
  18904. }
  18905. playSecretaryRandomSound() {
  18906. if (this.isHide)
  18907. return;
  18908. let time = xGame.common.randomNum(45000, 60000);
  18909. Laya.timer.once(time, this, () => {
  18910. if (this.isHide)
  18911. return;
  18912. let index = xGame.common.randomNum(4, 7);
  18913. xGame.soundMgr.playSound("s_main0" + index);
  18914. let words = 1;
  18915. switch (index) {
  18916. case 4:
  18917. words = 5;
  18918. break;
  18919. case 5:
  18920. words = 3;
  18921. break;
  18922. case 6:
  18923. words = 6;
  18924. break;
  18925. case 7:
  18926. words = 7;
  18927. break;
  18928. default:
  18929. break;
  18930. }
  18931. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18932. this.playSecretaryRandomSound();
  18933. });
  18934. }
  18935. }
  18936. UISkill$1.uiName = "UISkill";
  18937. class UIAddProp$1 extends UIBase {
  18938. constructor() {
  18939. super();
  18940. this.curType = "";
  18941. }
  18942. onConstructor() {
  18943. this.ui = ui_UIAddProp.createInstance();
  18944. this.contentPane = this.ui;
  18945. this.isEject = false;
  18946. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  18947. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  18948. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  18949. this.updateUI();
  18950. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  18951. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  18952. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  18953. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  18954. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  18955. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  18956. }
  18957. show(type) {
  18958. super.show();
  18959. this.curType = type == 0 ? "coin" : "diamond";
  18960. this.switchBtn("");
  18961. this.ui.t0.play();
  18962. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  18963. PlatMgr.showInsert(true);
  18964. }
  18965. closeSelf() {
  18966. this.hide();
  18967. }
  18968. updateUI() {
  18969. let data = cfgTable.moneyData;
  18970. let temp;
  18971. let obj;
  18972. for (const key in data) {
  18973. temp = data[key];
  18974. obj = this.ui.myNode["node" + key];
  18975. if (parseInt(key) <= 2) {
  18976. obj.diamondTxt.text = "+" + temp.num;
  18977. }
  18978. else {
  18979. obj.coinTxt.text = temp.num;
  18980. obj.diamondTxt.text = temp.get.split('_')[1];
  18981. }
  18982. }
  18983. this.updateDiamondShare();
  18984. }
  18985. updateDiamondShare() {
  18986. let data = DataMgr.getShareDiamondTimes();
  18987. if (data >= xGame.common.maxShareDiamondTimes) {
  18988. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  18989. this.ui.myNode.node1.touchable = false;
  18990. }
  18991. else {
  18992. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  18993. this.ui.myNode.node1.touchable = true;
  18994. }
  18995. }
  18996. switchBtn(type) {
  18997. if (type == "")
  18998. type = this.curType;
  18999. else {
  19000. if (this.curType == type) {
  19001. return;
  19002. }
  19003. else {
  19004. this.curType = type;
  19005. }
  19006. }
  19007. if (type == "coin") {
  19008. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  19009. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  19010. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  19011. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  19012. this.ui.myNode.c1.selectedIndex = 0;
  19013. }
  19014. else {
  19015. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  19016. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  19017. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  19018. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  19019. this.ui.myNode.c1.selectedIndex = 1;
  19020. }
  19021. }
  19022. convertCoin(index) {
  19023. let data = cfgTable.moneyData[index];
  19024. let coinNum = data.num;
  19025. let str = data.get.split('_')[1];
  19026. let needDiamond = parseInt(str);
  19027. if (DataMgr.diamondEnough(needDiamond)) {
  19028. DataMgr.setDiamond(-needDiamond);
  19029. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  19030. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  19031. }
  19032. else {
  19033. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  19034. this.switchBtn("diamond");
  19035. }
  19036. }
  19037. videoGetDiamond() {
  19038. let num = cfgTable.moneyData[2].num;
  19039. Moyu.showVideoAd(() => {
  19040. xGame.common.playObjFlyAnim(num, Prop.diamond);
  19041. this.closeSelf();
  19042. }, EAdType.addDiamond);
  19043. }
  19044. videoGetCoin() {
  19045. Moyu.showVideoAd(() => {
  19046. xGame.common.playObjFlyAnim(2000, Prop.coin);
  19047. this.closeSelf();
  19048. }, EAdType.addCoin);
  19049. }
  19050. shareGetDiamond() {
  19051. let times = DataMgr.getShareDiamondTimes();
  19052. if (times >= xGame.common.maxShareDiamondTimes) {
  19053. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  19054. }
  19055. else {
  19056. if (Moyu.isTT) {
  19057. let num = cfgTable.moneyData[1].num;
  19058. Moyu.shareVideo = '';
  19059. Moyu.shareGame((success) => {
  19060. if (success) {
  19061. xGame.uiMgr.Show(UIMsg$1, "分享成功!");
  19062. xGame.common.playObjFlyAnim(num, Prop.diamond);
  19063. DataMgr.setShareDiamondTimes(1);
  19064. this.updateDiamondShare();
  19065. }
  19066. else {
  19067. xGame.uiMgr.Show(UIMsg$1, "分享失败!");
  19068. }
  19069. });
  19070. }
  19071. else {
  19072. Moyu.showVideoAd(() => {
  19073. let diamond = xGame.common.randomNum(50, 100);
  19074. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  19075. DataMgr.setShareDiamondTimes(1);
  19076. this.updateDiamondShare();
  19077. }, EAdType.randomDiamond);
  19078. }
  19079. }
  19080. }
  19081. openPutBallView() {
  19082. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  19083. let skill = xGame.uiMgr.getUI(UISkill$1);
  19084. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  19085. let uigame = xGame.uiMgr.getUI(UIGame$1);
  19086. if (end && !end.isHide) {
  19087. xGame.uiMgr.Hide(UIGameEnd$1);
  19088. xGame.uiMgr.Show(UIMain$1);
  19089. }
  19090. if (skill && !skill.isHide)
  19091. xGame.uiMgr.Hide(UISkill$1);
  19092. if (uigame && !uigame.isHide)
  19093. xGame.uiMgr.Hide(UIGame$1);
  19094. if (level && !level.isHide) {
  19095. }
  19096. else {
  19097. xGame.uiMgr.Show(UILevelDisplay$1);
  19098. }
  19099. this.closeSelf();
  19100. }
  19101. }
  19102. UIAddProp$1.uiName = "UIAddProp";
  19103. class MoneyNode$1 {
  19104. constructor(ui) {
  19105. this.leftTime = 0;
  19106. this.ui = ui;
  19107. this.ui.addCoinBtn.onClick(this, this.addCoin);
  19108. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  19109. this.ui.addPowerBtn.onClick(this, this.addPower);
  19110. this.ui.c1.selectedIndex = 1;
  19111. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  19112. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  19113. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  19114. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  19115. this.coinChange();
  19116. this.diamondChange();
  19117. this.powerChange();
  19118. }
  19119. addPower() {
  19120. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19121. xGame.uiMgr.Show(UIPower$1);
  19122. }
  19123. powerChange() {
  19124. let powerNum = DataMgr.getPower();
  19125. this.ui.powerTxt.text = powerNum + "";
  19126. }
  19127. checkPowerTime() {
  19128. let cur = new Date().getTime();
  19129. let last = DataMgr.getPowerTime();
  19130. if (last == 0) {
  19131. last = cur;
  19132. DataMgr.setPowerTime(cur);
  19133. }
  19134. let power = DataMgr.getPower();
  19135. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  19136. Laya.timer.clearAll(this);
  19137. if (power >= xGame.common.natureMaxPower) {
  19138. this.ui.powerTimeTxt.text = "";
  19139. DataMgr.setPowerTime(cur);
  19140. return;
  19141. }
  19142. if (power + offset >= xGame.common.natureMaxPower) {
  19143. DataMgr.setPower(xGame.common.natureMaxPower, false);
  19144. this.ui.powerTimeTxt.text = "";
  19145. DataMgr.setPowerTime(cur);
  19146. }
  19147. else {
  19148. if (offset > 0) {
  19149. DataMgr.setPower(offset);
  19150. DataMgr.setPowerTime(cur);
  19151. }
  19152. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  19153. this.leftTime = xGame.common.powerRecoverNum - time;
  19154. if (this.leftTime <= 0)
  19155. this.leftTime = 0;
  19156. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  19157. Laya.timer.loop(1000, this, this.updatePowerTime);
  19158. }
  19159. }
  19160. updatePowerTime() {
  19161. this.leftTime -= 1;
  19162. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  19163. if (this.leftTime <= 0) {
  19164. this.checkPowerTime();
  19165. }
  19166. }
  19167. coinChange() {
  19168. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  19169. }
  19170. diamondChange() {
  19171. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  19172. }
  19173. addCoin() {
  19174. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19175. Moyu.sendDataEvent("AddCoinBtn");
  19176. xGame.uiMgr.Show(UIAddProp$1, 0);
  19177. }
  19178. addDiamond() {
  19179. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19180. Moyu.sendDataEvent("AddDiamondBtn");
  19181. xGame.uiMgr.Show(UIAddProp$1, 1);
  19182. }
  19183. }
  19184. class SettingNode$1 {
  19185. constructor(ui) {
  19186. this.showSetting = false;
  19187. this.openSound = true;
  19188. this.openShake = true;
  19189. this.ui = ui;
  19190. this.ui.soundBtn.onClick(this, this.switchSound);
  19191. this.ui.shakeBtn.onClick(this, this.switchShake);
  19192. this.ui.xyBtn.onClick(this, this.onXy);
  19193. this.ui.clickNode.onClick(this, this.changeSetting);
  19194. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  19195. }
  19196. changeSetting() {
  19197. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19198. this.showSetting = !this.showSetting;
  19199. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  19200. }
  19201. switchSound() {
  19202. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19203. this.openSound = !this.openSound;
  19204. Moyu.onSetting(this.openSound, this.openShake);
  19205. xGame.soundMgr.onSetting(this.openSound);
  19206. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  19207. }
  19208. switchShake() {
  19209. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19210. this.openShake = !this.openShake;
  19211. Moyu.onSetting(this.openSound, this.openShake);
  19212. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  19213. }
  19214. onXy() {
  19215. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19216. MoyuMgr$1.showXy(1);
  19217. }
  19218. }
  19219. class UIDraw$1 extends UIBase {
  19220. constructor() {
  19221. super();
  19222. this.curKey = 0;
  19223. }
  19224. onConstructor() {
  19225. this.ui = ui_UIDraw.createInstance();
  19226. this.contentPane = this.ui;
  19227. this.isEject = false;
  19228. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19229. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  19230. this.addUIClick(this.ui.drawBtn, this.startDraw);
  19231. this.initDraw();
  19232. this.initUI();
  19233. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  19234. if (Moyu.isKs)
  19235. this.ui.closeNode.closeBtn.x += 100;
  19236. }
  19237. show() {
  19238. super.show();
  19239. this.ui.t0.play();
  19240. this.playSecretaryIdle();
  19241. this.updateDraw();
  19242. this.checkFree();
  19243. if (PlatMgr.bannerDelay > 0) {
  19244. this.ui.closeNode.closeBtn.visible = false;
  19245. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  19246. this.ui.closeNode.closeBtn.visible = true;
  19247. });
  19248. }
  19249. PlatMgr.showRateBanner();
  19250. }
  19251. hide() {
  19252. Laya.timer.clearAll(this);
  19253. super.hide();
  19254. }
  19255. checkFree() {
  19256. let isFree = DataMgr.getDailyfreeDrawTimes();
  19257. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  19258. }
  19259. initDraw() {
  19260. this.drawObj = [];
  19261. let data = cfgTable.drawData;
  19262. let temp;
  19263. let weight = 0;
  19264. for (const key in data) {
  19265. temp = data[key];
  19266. weight += temp.weight;
  19267. this.drawObj.push(weight);
  19268. }
  19269. this.allWeight = weight;
  19270. }
  19271. initUI() {
  19272. let data = cfgTable.drawData;
  19273. let temp;
  19274. let img;
  19275. let txt;
  19276. for (const key in data) {
  19277. temp = data[key];
  19278. img = this.ui.myNode.rotNode["img" + key];
  19279. txt = this.ui.myNode.rotNode["txt" + key];
  19280. img.url = xGame.common.getGameIconUrl(temp.icon);
  19281. txt.visible = true;
  19282. if (temp.award > 2) {
  19283. img.rotation = 0;
  19284. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  19285. }
  19286. else {
  19287. img.rotation = temp.rotation;
  19288. txt.text = temp.num;
  19289. }
  19290. }
  19291. }
  19292. getCurkey() {
  19293. let rand = Math.random() * this.allWeight;
  19294. let temp;
  19295. for (let index = 0; index < this.drawObj.length - 1; index++) {
  19296. temp = this.drawObj[index];
  19297. if (index == 0) {
  19298. if (rand < temp) {
  19299. return index + 1;
  19300. }
  19301. }
  19302. else {
  19303. if (rand >= temp && rand < this.drawObj[index + 1]) {
  19304. return index + 1;
  19305. }
  19306. }
  19307. }
  19308. return 2;
  19309. }
  19310. startDraw() {
  19311. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  19312. if (freeTimes > 0) {
  19313. this.beginDraw();
  19314. DataMgr.setDailyfreeDrawTimes(0);
  19315. this.checkFree();
  19316. }
  19317. else {
  19318. Moyu.sendDataEvent("turntable");
  19319. Moyu.showVideoAd(() => {
  19320. this.beginDraw();
  19321. }, EAdType.draw);
  19322. }
  19323. }
  19324. beginDraw() {
  19325. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  19326. this.ui.drawBtn.touchable = false;
  19327. this.curKey = this.getCurkey();
  19328. console.log("当前key", this.curKey);
  19329. let cell = 60;
  19330. let lap = 3;
  19331. let angle = cell * (this.curKey - 1) + lap * 360;
  19332. let target = this.ui.myNode.rotNode;
  19333. target.rotation = 0;
  19334. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  19335. console.log("旋转完成");
  19336. this.ui.drawBtn.touchable = true;
  19337. this.getAward();
  19338. }));
  19339. }
  19340. getAward() {
  19341. let data = cfgTable.drawData[this.curKey];
  19342. let temp = new AwardType();
  19343. temp.type = data.award;
  19344. temp.num = data.num;
  19345. xGame.common.getAward([temp], () => {
  19346. DataMgr.setDrawTimes(1);
  19347. this.updateDraw();
  19348. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  19349. });
  19350. }
  19351. updateDraw() {
  19352. let drawTimes = DataMgr.getDrawTimes();
  19353. let awardTimes = DataMgr.getDrawAwardTimes();
  19354. if (Math.floor(drawTimes / 3) > awardTimes) {
  19355. this.ui.extraNode.boxBtn.t0.play(null, -1);
  19356. this.ui.extraNode.boxBtn.touchable = true;
  19357. this.ui.extraNode.tipsTxt.text = "3/3";
  19358. this.ui.extraNode.barNode.width = 265;
  19359. this.getExtraAward();
  19360. }
  19361. else {
  19362. this.ui.extraNode.boxBtn.t0.stop();
  19363. this.ui.extraNode.boxBtn.touchable = false;
  19364. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  19365. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  19366. }
  19367. let data = cfgTable.drawData[1];
  19368. if (awardTimes == 0) {
  19369. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  19370. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  19371. this.ui.myNode.rotNode.img1.rotation = 0;
  19372. }
  19373. else {
  19374. let award = data.nextid;
  19375. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  19376. this.ui.myNode.rotNode.txt1.text = award[1];
  19377. this.ui.myNode.rotNode.img1.rotation = 0;
  19378. }
  19379. }
  19380. getExtraAward() {
  19381. let drawTimes = DataMgr.getDrawTimes();
  19382. let awardTimes = DataMgr.getDrawAwardTimes();
  19383. let data = cfgTable.drawData[1];
  19384. let award = new AwardType();
  19385. if (awardTimes == 0) {
  19386. award.num = data.num;
  19387. award.type = data.award;
  19388. xGame.common.getAward([award], () => {
  19389. let all = Math.floor(drawTimes / 3);
  19390. DataMgr.setDrawAwardTimes(all);
  19391. this.updateDraw();
  19392. });
  19393. }
  19394. else {
  19395. award.num = parseInt(data.nextid[1]);
  19396. award.type = parseInt(data.nextid[0]);
  19397. xGame.common.getAward([award], () => {
  19398. let all = Math.floor(drawTimes / 3);
  19399. DataMgr.setDrawAwardTimes(all);
  19400. this.updateDraw();
  19401. });
  19402. }
  19403. }
  19404. closeSelf() {
  19405. this.hide();
  19406. }
  19407. playSecretaryIdle() {
  19408. let parent = this.ui.secretary.displayObject;
  19409. parent.destroyChildren();
  19410. let xx = this.ui.secretary.width / 2;
  19411. let yy = this.ui.secretary.height;
  19412. let scale = xGame.common.getSecretaryScale();
  19413. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19414. xGame.common.secretary.play(data, 0, true, parent);
  19415. }
  19416. }
  19417. UIDraw$1.uiName = "UIDraw";
  19418. class UIRanking$1 extends UIBase {
  19419. constructor() {
  19420. super();
  19421. this.showSelf = true;
  19422. this.rankType = 1;
  19423. this.rankList = [];
  19424. this.myIndex = 0;
  19425. this.myStar = 0;
  19426. }
  19427. onConstructor() {
  19428. this.ui = ui_UIRanking.createInstance();
  19429. this.contentPane = this.ui;
  19430. this.isEject = false;
  19431. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  19432. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  19433. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  19434. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  19435. this.ui.myNode.myList.setVirtual();
  19436. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  19437. }
  19438. show() {
  19439. super.show();
  19440. this.myIndex = 51;
  19441. Moyu.getRankList({
  19442. rankId: xGame.common.curRankID,
  19443. type: MoyuRankType.total,
  19444. page: 1,
  19445. pageSize: 50,
  19446. }, this, this.updateItemData);
  19447. this.updateSelf();
  19448. let self = Moyu.getUserInfo();
  19449. if (!self.isAuth) {
  19450. Moyu.initUser(this, () => {
  19451. DataMgr.upRankData();
  19452. });
  19453. }
  19454. }
  19455. updateSelfItem() {
  19456. let self = Moyu.getUserInfo();
  19457. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  19458. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > 50 ? "未上榜" : this.myIndex.toString();
  19459. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  19460. this.ui.myNode.selfNode.nameTxt.text = Moyu.platType < 11 ? self.nickName : "myself";
  19461. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  19462. }
  19463. updateItemData(data) {
  19464. this.myStar = xGame.common.getAllStarNum();
  19465. if (this.rankList.length < 2) {
  19466. this.rankList = data;
  19467. let self = Moyu.getUserInfo();
  19468. for (let i = 0; i < data.length; i++) {
  19469. let data = this.rankList[i];
  19470. if (data.userId == self.userId) {
  19471. this.rankList.splice(i, 1);
  19472. break;
  19473. }
  19474. }
  19475. for (let i = 0; i < data.length; i++) {
  19476. let data = this.rankList[i];
  19477. if (data.rankScore < this.myStar && this.myIndex > 50) {
  19478. this.myIndex = i + 1;
  19479. let user = { headIcon: self.headIcon, nickName: "myself" };
  19480. let ud = { user: user, data: {} };
  19481. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  19482. if (Moyu.platType < 11) {
  19483. user.headIcon = self.headIcon;
  19484. user.nickName = self.nickName;
  19485. }
  19486. this.rankList.splice(i, 0, md);
  19487. break;
  19488. }
  19489. }
  19490. }
  19491. this.updateSelfItem();
  19492. this.ui.myNode.myList.numItems = this.rankList.length;
  19493. }
  19494. updateItemUI(index, obj) {
  19495. let data = this.rankList[index];
  19496. let userData = JSON.parse(data.userData).user;
  19497. obj.nameTxt.text = userData.nickName.toString();
  19498. obj.valueTxt.text = data.rankScore;
  19499. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  19500. obj.rankTxt.text = index + 1;
  19501. switch (index) {
  19502. case 0:
  19503. this.setImg(obj, 1, 0, 0);
  19504. obj.rankTxt.color = "#FFC047";
  19505. break;
  19506. case 1:
  19507. this.setImg(obj, 0, 1, 0);
  19508. obj.rankTxt.color = "#ACACAC";
  19509. break;
  19510. case 2:
  19511. this.setImg(obj, 0, 0, 1);
  19512. obj.rankTxt.color = "#D09672";
  19513. break;
  19514. default:
  19515. this.setImg(obj, 0, 0, 0);
  19516. obj.rankTxt.color = "#496FAB";
  19517. break;
  19518. }
  19519. }
  19520. setImg(obj, a, b, c) {
  19521. obj.img1.visible = a ? true : false;
  19522. obj.img2.visible = b ? true : false;
  19523. obj.img3.visible = c ? true : false;
  19524. }
  19525. changeList(type) {
  19526. this.rankType = type;
  19527. this.updateSelf();
  19528. }
  19529. changeSelfNode() {
  19530. this.showSelf = !this.showSelf;
  19531. this.updateSelf();
  19532. }
  19533. updateSelf() {
  19534. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  19535. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  19536. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  19537. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  19538. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  19539. }
  19540. }
  19541. UIRanking$1.uiName = "UIRanking";
  19542. class UISecretary$1 extends UIBase {
  19543. constructor() {
  19544. super();
  19545. this.curIndex = 1;
  19546. }
  19547. onConstructor() {
  19548. this.ui = ui_UISecretary.createInstance();
  19549. this.contentPane = this.ui;
  19550. this.isEject = false;
  19551. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  19552. this.addUIClick(this.ui.leftBtn, this.turnLeft);
  19553. this.addUIClick(this.ui.rightBtn, this.turnRight);
  19554. this.nodeObj = { left: null, right: null, cur: null };
  19555. this.nodeObj.left = this.ui.myNode.gameNode1;
  19556. this.nodeObj.right = this.ui.myNode.gameNode2;
  19557. this.nodeObj.cur = this.ui.myNode.gameNode3;
  19558. }
  19559. show() {
  19560. super.show();
  19561. this.ui.t0.play();
  19562. this.updateData();
  19563. }
  19564. addSecretarySpine(node, spineName) {
  19565. if (spineName == "mishu") {
  19566. if (this.secretarySpine1) {
  19567. node.displayObject.destroyChildren();
  19568. this.playWoman(this.secretarySpine1, node.displayObject);
  19569. }
  19570. else {
  19571. let spine1 = new SpineMgr("mishu", () => {
  19572. this.secretarySpine1 = spine1;
  19573. this.playWoman(this.secretarySpine1, node.displayObject);
  19574. });
  19575. }
  19576. }
  19577. else {
  19578. if (this.secretarySpine2) {
  19579. node.displayObject.destroyChildren();
  19580. this.playWoman(this.secretarySpine2, node.displayObject);
  19581. }
  19582. else {
  19583. let spine2 = new SpineMgr("xiaomishu2", () => {
  19584. this.secretarySpine2 = spine2;
  19585. this.playWoman(this.secretarySpine2, node.displayObject);
  19586. });
  19587. }
  19588. }
  19589. }
  19590. playWoman(node, parent) {
  19591. let xx = this.ui.myNode.gameNode1.secretary.width / 2;
  19592. let yy = this.ui.myNode.gameNode1.secretary.height;
  19593. let scale = 1.5;
  19594. if (node == this.secretarySpine2) {
  19595. scale = 1.2;
  19596. }
  19597. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19598. node.play(data, 0, true, parent);
  19599. }
  19600. turnLeft() {
  19601. this.curIndex--;
  19602. if (this.curIndex < 1) {
  19603. this.curIndex = 2;
  19604. }
  19605. let left = this.nodeObj.left;
  19606. let right = this.nodeObj.right;
  19607. let cur = this.nodeObj.cur;
  19608. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  19609. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  19610. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  19611. this.updateData();
  19612. }));
  19613. this.ui.myNode.setChildIndex(right, 2);
  19614. this.nodeObj.left = cur;
  19615. this.nodeObj.right = left;
  19616. this.nodeObj.cur = right;
  19617. }
  19618. turnRight() {
  19619. this.curIndex++;
  19620. if (this.curIndex > 2) {
  19621. this.curIndex = 1;
  19622. }
  19623. let left = this.nodeObj.left;
  19624. let right = this.nodeObj.right;
  19625. let cur = this.nodeObj.cur;
  19626. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  19627. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  19628. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  19629. this.updateData();
  19630. }));
  19631. this.ui.myNode.setChildIndex(left, 2);
  19632. this.nodeObj.left = right;
  19633. this.nodeObj.right = cur;
  19634. this.nodeObj.cur = left;
  19635. }
  19636. updateData() {
  19637. let data = cfgTable.secretaryshopData;
  19638. let children = this.ui.myNode._children;
  19639. let temp;
  19640. let curData;
  19641. for (let index = 0; index < children.length; index++) {
  19642. temp = children[index];
  19643. if (index == 2) {
  19644. curData = data[this.curIndex];
  19645. temp.purchaseBtn.touchable = true;
  19646. }
  19647. else {
  19648. temp.purchaseBtn.touchable = false;
  19649. if (this.curIndex == 1) {
  19650. curData = data[2];
  19651. }
  19652. else {
  19653. curData = data[1];
  19654. }
  19655. }
  19656. temp.heightTxt.text = curData.height;
  19657. temp.foodTxt.text = curData.food;
  19658. temp.historyTxt.text = curData.history;
  19659. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  19660. this.addSecretarySpine(temp.secretary, curData.spine);
  19661. let womanIndex = curData.id - 1;
  19662. let getWoman = DataMgr.getSecretary(womanIndex);
  19663. let curUse = DataMgr.getCurSecretary();
  19664. if (getWoman) {
  19665. if (curUse == womanIndex) {
  19666. temp.purchaseBtn.c1.selectedIndex = 1;
  19667. }
  19668. else {
  19669. temp.purchaseBtn.c1.selectedIndex = 2;
  19670. }
  19671. }
  19672. else {
  19673. temp.purchaseBtn.c1.selectedIndex = 0;
  19674. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  19675. }
  19676. temp.purchaseBtn.offClick(this, this.clickSecretary);
  19677. temp.purchaseBtn.onClick(this, this.clickSecretary, [getWoman, curUse, womanIndex, curData.price]);
  19678. }
  19679. }
  19680. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  19681. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19682. if (getWoman) {
  19683. if (curUse != womanIndex) {
  19684. console.log();
  19685. DataMgr.setCurSecretary(womanIndex);
  19686. this.updateData();
  19687. }
  19688. }
  19689. else {
  19690. let need = needDiamond;
  19691. if (DataMgr.diamondEnough(need)) {
  19692. DataMgr.setDiamond(-need);
  19693. DataMgr.setSecretary(womanIndex, 1);
  19694. DataMgr.setCurSecretary(womanIndex);
  19695. this.updateData();
  19696. }
  19697. else {
  19698. xGame.uiMgr.Show(UIAddProp$1, 1);
  19699. }
  19700. }
  19701. }
  19702. closeSelf() {
  19703. this.hide();
  19704. }
  19705. }
  19706. UISecretary$1.uiName = "UISecretary";
  19707. class BallRodDisplay$1 {
  19708. constructor(ui, index) {
  19709. this.index = 0;
  19710. this.uiIndex = 0;
  19711. this.ui = ui;
  19712. this.index = index;
  19713. this.initData();
  19714. }
  19715. initData() {
  19716. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  19717. let data = cfgTable.ballrodData[this.index + 1];
  19718. this.ui.nameTxt.text = data.name;
  19719. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  19720. this.ui.levelNode.c1.selectedIndex = data.quality;
  19721. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  19722. if (data.spine) {
  19723. this.mySpine = new SpineMgr(data.spine, () => {
  19724. let xx = 150;
  19725. let yy = 70;
  19726. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  19727. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  19728. });
  19729. }
  19730. }
  19731. updateSelf() {
  19732. let get = DataMgr.getBallRod(this.index);
  19733. if (get == null)
  19734. get = 1;
  19735. let curUse = DataMgr.getCurBallRod();
  19736. if (get) {
  19737. if (curUse == this.index) {
  19738. this.ui.purchaseBtn.c1.selectedIndex = 0;
  19739. }
  19740. else {
  19741. this.ui.purchaseBtn.c1.selectedIndex = 1;
  19742. }
  19743. }
  19744. else {
  19745. this.ui.purchaseBtn.c1.selectedIndex = 2;
  19746. }
  19747. }
  19748. buyBallRod() {
  19749. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19750. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  19751. switch (selectedIndex) {
  19752. case 0:
  19753. break;
  19754. case 1:
  19755. DataMgr.setCurBallRod(this.index);
  19756. let ui = xGame.uiMgr.getUI(UIShop$1);
  19757. ui.updateBallRod();
  19758. break;
  19759. case 2:
  19760. let data = cfgTable.ballrodData[this.index + 1];
  19761. let need = data.price;
  19762. if (DataMgr.diamondEnough(need)) {
  19763. DataMgr.setDiamond(-need);
  19764. DataMgr.setBallRod(this.index, 1);
  19765. DataMgr.setCurBallRod(this.index);
  19766. let ui = xGame.uiMgr.getUI(UIShop$1);
  19767. ui.updateBallRod();
  19768. }
  19769. else {
  19770. xGame.uiMgr.Show(UIAddProp$1, 1);
  19771. }
  19772. break;
  19773. default:
  19774. break;
  19775. }
  19776. }
  19777. }
  19778. class UIShop$1 extends UIBase {
  19779. constructor() {
  19780. super();
  19781. this.itemNums = 0;
  19782. }
  19783. onConstructor() {
  19784. this.ui = ui_UIShop.createInstance();
  19785. this.contentPane = this.ui;
  19786. this.isEject = false;
  19787. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19788. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  19789. this.addUIClick(this.ui, this.interuptSecretary);
  19790. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  19791. this.ballRodArr = [];
  19792. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  19793. this.ui.myNode.myList.numItems = this.itemNums;
  19794. if (Moyu.isKs)
  19795. this.ui.closeNode.closeBtn.x += 100;
  19796. }
  19797. show() {
  19798. super.show();
  19799. this.playSecretaryIdle();
  19800. this.updateBallRod();
  19801. }
  19802. updateBallRod() {
  19803. for (let index = 0; index < this.ballRodArr.length; index++) {
  19804. this.ballRodArr[index].updateSelf();
  19805. }
  19806. }
  19807. renderBallRod(sort, obj) {
  19808. let index = this.getIndexBySort(sort + 1) - 1;
  19809. let ballRod = new BallRodDisplay$1(obj, index);
  19810. this.ballRodArr.push(ballRod);
  19811. }
  19812. getIndexBySort(sort) {
  19813. let object = cfgTable.ballrodData;
  19814. for (const key in object) {
  19815. if (object[key].sort == sort) {
  19816. return parseInt(key);
  19817. }
  19818. }
  19819. }
  19820. playSecretaryIdle() {
  19821. let parent = this.ui.secretary.displayObject;
  19822. parent.destroyChildren();
  19823. let xx = this.ui.secretary.width / 2;
  19824. let yy = this.ui.secretary.height;
  19825. let scale = xGame.common.getSecretaryScale();
  19826. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19827. xGame.common.secretary.play(data, 0, true, parent);
  19828. }
  19829. interuptSecretary() {
  19830. Laya.timer.clearAll(this);
  19831. this.playSecretaryRandomSound();
  19832. }
  19833. playSecretaryRandomSound() {
  19834. if (this.isHide)
  19835. return;
  19836. let time = xGame.common.randomNum(45000, 60000);
  19837. Laya.timer.once(time, this, () => {
  19838. if (this.isHide)
  19839. return;
  19840. let index = xGame.common.randomNum(4, 7);
  19841. xGame.soundMgr.playSound("s_main0" + index);
  19842. let words = 1;
  19843. switch (index) {
  19844. case 4:
  19845. words = 5;
  19846. break;
  19847. case 5:
  19848. words = 3;
  19849. break;
  19850. case 6:
  19851. words = 6;
  19852. break;
  19853. case 7:
  19854. words = 7;
  19855. break;
  19856. default:
  19857. break;
  19858. }
  19859. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19860. this.playSecretaryRandomSound();
  19861. });
  19862. }
  19863. closeSelf() {
  19864. this.hide();
  19865. }
  19866. }
  19867. UIShop$1.uiName = "UIShop";
  19868. class SignMax$1 {
  19869. constructor(ui) {
  19870. this.ui = ui;
  19871. }
  19872. updateSelf(index, sameDay, curDayIndex) {
  19873. let data = cfgTable.signData[index + 1];
  19874. this.ui.titleTxt.text = data.title;
  19875. let arr1 = data.award[0].split('-');
  19876. let arr2 = data.award[1].split('-');
  19877. let num1 = parseInt(arr1[1]);
  19878. let num2 = parseInt(arr2[1]);
  19879. this.ui.numTxt1.text = num1 + "";
  19880. this.ui.numTxt2.text = num2 + "";
  19881. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  19882. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  19883. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  19884. this.ui.numTxt1.visible = false;
  19885. }
  19886. else {
  19887. this.ui.numTxt1.visible = true;
  19888. }
  19889. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  19890. this.ui.numTxt2.visible = false;
  19891. }
  19892. else {
  19893. this.ui.numTxt2.visible = true;
  19894. }
  19895. if (index < curDayIndex) {
  19896. this.ui.c1.selectedIndex = 1;
  19897. }
  19898. else if (index == curDayIndex) {
  19899. if (sameDay) {
  19900. this.ui.c1.selectedIndex = 2;
  19901. }
  19902. else {
  19903. this.ui.c1.selectedIndex = 2;
  19904. }
  19905. }
  19906. else {
  19907. this.ui.c1.selectedIndex = 0;
  19908. }
  19909. }
  19910. }
  19911. class SignNormal$1 {
  19912. constructor(ui) {
  19913. this.ui = ui;
  19914. }
  19915. updateSelf(index, sameDay, curDayIndex) {
  19916. let data = cfgTable.signData[index + 1];
  19917. this.ui.titleTxt.text = data.title;
  19918. let arr = data.award[0].split('-');
  19919. let type = parseInt(arr[0]);
  19920. let num = parseInt(arr[1]);
  19921. this.ui.numTxt.text = num + "";
  19922. if (type > 2) {
  19923. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  19924. this.ui.myIcon.rotation = 0;
  19925. }
  19926. else {
  19927. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  19928. this.ui.myIcon.rotation = 0;
  19929. }
  19930. if (xGame.common.signAwardContainsRod(data.award)) {
  19931. this.ui.numTxt.visible = false;
  19932. }
  19933. else {
  19934. this.ui.numTxt.visible = true;
  19935. }
  19936. if (index < curDayIndex) {
  19937. this.ui.c1.selectedIndex = 1;
  19938. }
  19939. else if (index == curDayIndex) {
  19940. if (sameDay) {
  19941. this.ui.c1.selectedIndex = 2;
  19942. }
  19943. else {
  19944. this.ui.c1.selectedIndex = 2;
  19945. }
  19946. }
  19947. else {
  19948. this.ui.c1.selectedIndex = 0;
  19949. }
  19950. }
  19951. }
  19952. class UISign$1 extends UIBase {
  19953. constructor() {
  19954. super();
  19955. this.curDayIndex = 0;
  19956. this.starX = 0;
  19957. }
  19958. onConstructor() {
  19959. this.ui = ui_UISign.createInstance();
  19960. this.contentPane = this.ui;
  19961. this.isEject = false;
  19962. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19963. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  19964. this.initSignItem();
  19965. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  19966. this.addUIClick(this.ui.againBtn, this.againGetAward);
  19967. }
  19968. show() {
  19969. super.show();
  19970. this.ui.t0.play();
  19971. this.playSecretaryIdle();
  19972. this.updateSign();
  19973. }
  19974. initSignItem() {
  19975. this.signArr = [];
  19976. for (let index = 0; index < 6; index++) {
  19977. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  19978. this.signArr.push(temp);
  19979. }
  19980. this.signMax = new SignMax$1(this.ui.myNode.day7);
  19981. if (Moyu.isKs)
  19982. this.ui.closeNode.closeBtn.x += 100;
  19983. }
  19984. updateSign() {
  19985. let sameDay = xGame.common.judgeSameDay();
  19986. let max = 7;
  19987. this.curDayIndex = DataMgr.getSignData();
  19988. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  19989. this.curDayIndex = 0;
  19990. if (!sameDay) {
  19991. this.ui.normalBtn.visible = true;
  19992. this.ui.tipsNode.visible = false;
  19993. this.ui.againBtn.visible = false;
  19994. }
  19995. else {
  19996. this.ui.normalBtn.visible = false;
  19997. let again = DataMgr.getExtraSign();
  19998. let isCurrency = false;
  19999. let index = this.curDayIndex;
  20000. if (index == 0)
  20001. index = 7;
  20002. let award = cfgTable.signData[index].award;
  20003. let num = award[0].split("-")[0];
  20004. if (num == "1" || num == "2")
  20005. isCurrency = true;
  20006. let showAgain = again == 0 && isCurrency;
  20007. this.ui.againBtn.visible = showAgain;
  20008. this.ui.tipsNode.visible = !showAgain;
  20009. }
  20010. for (let index = 0; index < this.signArr.length; index++) {
  20011. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  20012. }
  20013. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  20014. }
  20015. playSecretaryIdle() {
  20016. let parent = this.ui.secretary.displayObject;
  20017. parent.destroyChildren();
  20018. let xx = this.ui.secretary.width / 2;
  20019. let yy = this.ui.secretary.height;
  20020. let scale = xGame.common.getSecretaryScale();
  20021. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20022. xGame.common.secretary.play(data, 0, true, parent);
  20023. }
  20024. closeSelf() {
  20025. this.hide();
  20026. }
  20027. normalGetAward() {
  20028. let sameDay = xGame.common.judgeSameDay();
  20029. if (!sameDay) {
  20030. let award = cfgTable.signData[this.curDayIndex + 1].award;
  20031. let temp;
  20032. let type;
  20033. let num;
  20034. let arr = [];
  20035. for (let index = 0; index < award.length; index++) {
  20036. temp = award[index].split("-");
  20037. type = parseInt(temp[0]);
  20038. num = parseInt(temp[1]);
  20039. let awardType = new AwardType();
  20040. awardType.num = num;
  20041. awardType.type = type;
  20042. arr.push(awardType);
  20043. }
  20044. xGame.common.getAward(arr, (watchVideo) => {
  20045. this.curDayIndex++;
  20046. if (this.curDayIndex > 7)
  20047. this.curDayIndex = 0;
  20048. DataMgr.setSignData(this.curDayIndex);
  20049. DataMgr.setSignTime(new Date().getTime());
  20050. if (watchVideo) {
  20051. DataMgr.setExtraSign(1);
  20052. Moyu.sendDataEvent("signIn1");
  20053. }
  20054. this.updateSign();
  20055. });
  20056. }
  20057. }
  20058. againGetAward() {
  20059. Moyu.sendDataEvent("signIn2");
  20060. Moyu.showVideoAd(() => {
  20061. let index = this.curDayIndex;
  20062. if (index == 0)
  20063. index = 7;
  20064. let award = cfgTable.signData[index].award;
  20065. let temp;
  20066. let type;
  20067. let num;
  20068. for (let index = 0; index < award.length; index++) {
  20069. temp = award[index].split("-");
  20070. type = parseInt(temp[0]);
  20071. num = parseInt(temp[1]) * 3;
  20072. xGame.common.playObjFlyAnim(num, type);
  20073. }
  20074. DataMgr.setExtraSign(1);
  20075. this.updateSign();
  20076. }, EAdType.againSign);
  20077. }
  20078. }
  20079. UISign$1.uiName = "UISign";
  20080. class UIModeSelection$1 extends UIBase {
  20081. constructor() {
  20082. super();
  20083. }
  20084. onConstructor() {
  20085. this.ui = ui_UIModeSelection.createInstance();
  20086. this.contentPane = this.ui;
  20087. this.isEject = false;
  20088. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  20089. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  20090. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  20091. this.addUIClick(this.ui.closeBtn, this.hide);
  20092. this.peopleArr = [650, 6900, 3800];
  20093. this.peopleOffest = [50, 500, 200];
  20094. this.updateSelf();
  20095. }
  20096. show(callback) {
  20097. super.show();
  20098. this.ui.t0.play();
  20099. this.callback = callback;
  20100. }
  20101. updateSelf() {
  20102. let cfg = cfgTable.modeselectData;
  20103. for (let index = 1; index <= 3; index++) {
  20104. let node = this.ui.myNode["type" + index];
  20105. node.need.text = cfg[index].need;
  20106. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  20107. node.peopleTxt.text = this.getRandPeople(index - 1);
  20108. }
  20109. }
  20110. enterGame(type) {
  20111. xGame.common.classicRoomType = type;
  20112. let cfg = cfgTable.modeselectData[type];
  20113. let need = cfg.need;
  20114. xGame.common.passAwardCoin = cfg.award;
  20115. if (DataMgr.coinEnough(need)) {
  20116. DataMgr.setCoin(-need);
  20117. this.ui.myNode["type" + type].t0.play();
  20118. Laya.timer.once(200, this, () => {
  20119. this.callback && this.callback();
  20120. });
  20121. }
  20122. else {
  20123. Moyu.sendDataEvent("AddCoinVideo");
  20124. xGame.uiMgr.Show(UIAddProp$1, 0);
  20125. }
  20126. }
  20127. getRandPeople(index) {
  20128. let rand = this.peopleOffest[index];
  20129. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  20130. }
  20131. }
  20132. UIModeSelection$1.uiName = "UIModeSelection";
  20133. class UIMain$1 extends UIBase {
  20134. constructor() {
  20135. super();
  20136. this.firstEnter = true;
  20137. }
  20138. onConstructor() {
  20139. this.ui = ui_UIMain.createInstance();
  20140. this.contentPane = this.ui;
  20141. this.isEject = false;
  20142. this.addEvent();
  20143. this.addClickSpine();
  20144. this.settingNode = new SettingNode$1(this.ui.settingNode);
  20145. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20146. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  20147. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  20148. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  20149. let curUse = DataMgr.getCurSecretary();
  20150. this.changeSecretary(curUse);
  20151. this.ui.talkNode.visible = false;
  20152. let guide = DataMgr.getSkillGuide();
  20153. if (xGame.common.isNewDay && guide == 1) {
  20154. xGame.common.isNewDay = false;
  20155. xGame.soundMgr.playSound("s_main01");
  20156. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20157. console.log("播放小秘书每天语音");
  20158. }
  20159. this.onGetUserInfo();
  20160. this.ui.n83.visible = false;
  20161. Moyu.setShareInfo("8Ball Fury", ["台球", "万宁", "桌球"], '2300002254');
  20162. }
  20163. changeSecretary(curUse) {
  20164. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  20165. xGame.common.secretary && xGame.common.secretary.dispose();
  20166. this.addSecretarySpine(name);
  20167. }
  20168. addSecretarySpine(name) {
  20169. let spine = new SpineMgr(name, () => {
  20170. this.playSecretaryIdle();
  20171. });
  20172. xGame.common.secretary = spine;
  20173. }
  20174. addClickSpine() {
  20175. let clickSpine = new SpineMgr("dianji", () => {
  20176. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  20177. let parent = Laya.stage;
  20178. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  20179. clickSpine.play(data, 0, false, parent, (spine) => {
  20180. spine.destroy(true);
  20181. });
  20182. });
  20183. });
  20184. }
  20185. addEvent() {
  20186. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  20187. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  20188. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  20189. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  20190. this.addUIClick(this.ui.weeklyBtn, this.startWeekly);
  20191. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  20192. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  20193. this.addUIClick(this.ui, this.interuptSecretary);
  20194. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  20195. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  20196. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  20197. this.addUIClick(this.ui.shopBtn, this.openShopView);
  20198. this.addUIClick(this.ui.signBtn, this.openSignView);
  20199. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  20200. this.addUIClick(this.ui.rankBtn, this.openRanking);
  20201. }
  20202. show(showFailWords) {
  20203. super.show();
  20204. this.moneyNode.ui.c1.selectedIndex = 1;
  20205. this.playSecretaryIdle();
  20206. xGame.soundMgr.playMusic("caromhall01");
  20207. Laya.timer.clearAll(this);
  20208. this.playSecretaryRandomSound();
  20209. if (showFailWords) {
  20210. setTimeout(() => {
  20211. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  20212. let words = -1;
  20213. if (str == "s_main02") {
  20214. words = 2;
  20215. }
  20216. else {
  20217. words = 3;
  20218. }
  20219. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20220. xGame.soundMgr.playSound(str);
  20221. }, 300);
  20222. }
  20223. this.showGuide();
  20224. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  20225. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  20226. let guide = DataMgr.getSkillGuide();
  20227. if (guide == 1) {
  20228. let randTime = xGame.common.randomNum(300, 800);
  20229. if (this.firstEnter) {
  20230. this.firstEnter = false;
  20231. randTime += 900;
  20232. }
  20233. Laya.timer.once(randTime, this, () => {
  20234. xGame.common.autoPopUIView();
  20235. });
  20236. }
  20237. }
  20238. checkActive(show) {
  20239. }
  20240. showGuide() {
  20241. let guide = DataMgr.getSkillGuide();
  20242. this.ui.guideBtn.visible = guide == 0;
  20243. this.ui.enterGuide.visible = false;
  20244. this.ui.secretaryGuide.visible = guide == 0;
  20245. if (guide == 0) {
  20246. xGame.soundMgr.playSound("s_guide");
  20247. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20248. }
  20249. }
  20250. ensureSecretary() {
  20251. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  20252. this.ui.secretaryGuide.visible = false;
  20253. this.ui.enterGuide.visible = true;
  20254. this.ui.wordsNode.t0.play();
  20255. if (DataMgr.getNewUser())
  20256. Moyu.sendDataEvent("gameReady");
  20257. }
  20258. playSecretaryIdle() {
  20259. let parent = this.ui.secretary.displayObject;
  20260. parent.destroyChildren();
  20261. let xx = this.ui.secretary.width / 2;
  20262. let yy = this.ui.secretary.height;
  20263. let scale = xGame.common.getSecretaryScale();
  20264. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20265. console.log("zh:playSecretaryIdle", data);
  20266. xGame.common.secretary.play(data, 0, true, parent);
  20267. }
  20268. startGame(type) {
  20269. xGame.common.gameMode = type;
  20270. Moyu.sendDataEvent("PlayGame", { type: type });
  20271. switch (xGame.common.gameMode) {
  20272. case GameMode.classic:
  20273. let challengeTimes = DataMgr.getChallengeTimes();
  20274. if (challengeTimes == 0) {
  20275. xGame.uiMgr.Show(UIInvitation$1);
  20276. }
  20277. else {
  20278. this.beginGame();
  20279. }
  20280. break;
  20281. case GameMode.bigMove:
  20282. this.beginGame();
  20283. if (DataMgr.getNewUser())
  20284. Moyu.sendDataEvent("gameStart0");
  20285. break;
  20286. default:
  20287. break;
  20288. }
  20289. }
  20290. beginGame(isNice = false) {
  20291. if (xGame.common.gameMode == GameMode.classic) {
  20292. if (isNice) {
  20293. this.enterClassic();
  20294. }
  20295. else {
  20296. xGame.uiMgr.Show(UIModeSelection$1, () => {
  20297. this.enterClassic();
  20298. });
  20299. }
  20300. }
  20301. else if (xGame.common.gameMode == GameMode.bigMove) {
  20302. this.ui.enterGuide.visible = false;
  20303. xGame.uiMgr.Show(UISkill$1);
  20304. }
  20305. }
  20306. enterClassic() {
  20307. xGame.uiMgr.Show(UIGame$1);
  20308. xGame.uiMgr.Show(UIMatching$1, () => {
  20309. if (!this.isHide)
  20310. this.hide();
  20311. xGame.common.gameUI.ui.alpha = 1;
  20312. xGame.common.gameUI.startGame();
  20313. xGame.uiMgr.Hide(UIGameEnd$1);
  20314. });
  20315. }
  20316. startGlobal() {
  20317. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  20318. }
  20319. startWeekly() {
  20320. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  20321. }
  20322. startPlaceBall() {
  20323. xGame.uiMgr.Show(UILevelDisplay$1);
  20324. }
  20325. hide() {
  20326. super.hide();
  20327. xGame.common.stopGirlPop(this.ui.talkNode);
  20328. }
  20329. onGetUserInfo(force = false) {
  20330. if (Moyu.isWx) {
  20331. let info = Moyu.getSystemInfo();
  20332. if (info)
  20333. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  20334. }
  20335. else {
  20336. Moyu.initUser(this, this.freshUser, force);
  20337. }
  20338. if (!Moyu.hasUserInfo) {
  20339. let user = Moyu.getUserInfo();
  20340. user.headIcon = 'res/ty_touxiang.png';
  20341. }
  20342. this.freshUser();
  20343. }
  20344. freshUser() {
  20345. let user = Moyu.getUserInfo();
  20346. if (!user.isAuth) {
  20347. user.headIcon = 'res/ty_touxiang.png';
  20348. }
  20349. else
  20350. DataMgr.upRankData();
  20351. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  20352. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  20353. }
  20354. interuptSecretary() {
  20355. Laya.timer.clearAll(this);
  20356. this.playSecretaryRandomSound();
  20357. }
  20358. playSecretaryRandomSound() {
  20359. if (this.isHide)
  20360. return;
  20361. let time = xGame.common.randomNum(45000, 60000);
  20362. Laya.timer.once(time, this, () => {
  20363. if (this.isHide)
  20364. return;
  20365. let index = xGame.common.randomNum(4, 7);
  20366. xGame.soundMgr.playSound("s_main0" + index);
  20367. let words = 1;
  20368. switch (index) {
  20369. case 4:
  20370. words = 5;
  20371. break;
  20372. case 5:
  20373. words = 3;
  20374. break;
  20375. case 6:
  20376. words = 6;
  20377. break;
  20378. case 7:
  20379. words = 7;
  20380. break;
  20381. default:
  20382. break;
  20383. }
  20384. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20385. this.playSecretaryRandomSound();
  20386. });
  20387. }
  20388. openSecretaryView() {
  20389. xGame.uiMgr.Show(UISecretary$1);
  20390. Moyu.sendDataEvent("secretary");
  20391. }
  20392. openShopView() {
  20393. xGame.uiMgr.Show(UIShop$1);
  20394. }
  20395. openSignView() {
  20396. xGame.uiMgr.Show(UISign$1);
  20397. }
  20398. openDrawView() {
  20399. xGame.uiMgr.Show(UIDraw$1);
  20400. }
  20401. openRanking() {
  20402. xGame.uiMgr.Show(UIRanking$1);
  20403. Moyu.sendDataEvent("rankingList");
  20404. }
  20405. }
  20406. UIMain$1.uiName = "UIMain";
  20407. function InitShader() {
  20408. }
  20409. function appInit() {
  20410. xGame.context.init(getLoadingResList(), initCallback);
  20411. }
  20412. function getLoadingResList() {
  20413. return [
  20414. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  20415. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  20416. ];
  20417. }
  20418. function getGameResList() {
  20419. return [
  20420. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  20421. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  20422. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  20423. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  20424. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  20425. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  20426. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  20427. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  20428. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  20429. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  20430. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  20431. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  20432. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  20433. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  20434. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  20435. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  20436. { url: "res/json/npc.json", type: Laya.Loader.JSON },
  20437. { url: "res/json/classicCfg.json", type: Laya.Loader.JSON },
  20438. { url: "res/json/levelCfg.json", type: Laya.Loader.JSON },
  20439. { url: "res/json/placeBallCfg.json", type: Laya.Loader.JSON },
  20440. ];
  20441. }
  20442. function initCallback() {
  20443. window["DataMgr"] = DataMgr;
  20444. DataMgr.Init();
  20445. Moyu.init(getPlat(), this, () => {
  20446. DataMgr.isNewDay();
  20447. PlatMgr.initConfig();
  20448. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  20449. }, true);
  20450. console.log('zh:开始sm init1 start');
  20451. xGame.soundMgr.init();
  20452. console.log('zh:开始sm init1 end');
  20453. xGame.uiMgr.init();
  20454. xGame.uiMgr.bindFUI(fguiRes.loading);
  20455. xGame.uiMgr.Show(UILoading);
  20456. }
  20457. function loadSubRes(callback) {
  20458. var tab = ["asset", "res", "spine"];
  20459. let subDone = 0;
  20460. for (var i = 0; i < tab.length; i++) {
  20461. let sub = tab[i];
  20462. Moyu.loadSubRes(sub, (pro) => {
  20463. callback && callback(pro, false);
  20464. }).then(() => {
  20465. subDone++;
  20466. if (subDone >= tab.length)
  20467. callback && callback(1, true);
  20468. });
  20469. }
  20470. }
  20471. function enterGame() {
  20472. xGame.cfgMgr.init();
  20473. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  20474. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  20475. xGame.uiMgr.Hide(UILoading);
  20476. fgui.UIPackage.removePackage(fguiRes.loading);
  20477. xGame.uiMgr.bindFUI(fguiRes.game);
  20478. xGame.uiMgr.Show(UIMain$1);
  20479. if (DataMgr.getNewUser())
  20480. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  20481. }
  20482. function getPlat() {
  20483. let cfg = new MoyuCfg();
  20484. cfg.plat = MoyuPlat.web;
  20485. cfg.myId = 120;
  20486. cfg.myKey = '8848a885774230a4';
  20487. cfg.version = 0;
  20488. if (window.hasOwnProperty("gamebox")) {
  20489. cfg.plat = MoyuPlat.f399;
  20490. cfg.version = 0;
  20491. }
  20492. else if (window.hasOwnProperty("ks")) {
  20493. cfg.plat = MoyuPlat.ks;
  20494. cfg.version = 0;
  20495. cfg.ads.ksVideoId = '2300002254_01';
  20496. cfg.ads.ksInsertId = '2300002254_02';
  20497. }
  20498. else if (Laya.Browser.onTTMiniGame) {
  20499. cfg.plat = MoyuPlat.tt;
  20500. cfg.version = 0;
  20501. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  20502. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  20503. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  20504. }
  20505. else if (Laya.Browser.onMiniGame) {
  20506. cfg.plat = MoyuPlat.wx;
  20507. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  20508. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  20509. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  20510. }
  20511. else if (Laya.Browser.onQQMiniGame) {
  20512. cfg.plat = MoyuPlat.qq;
  20513. }
  20514. else if (Laya.Browser.onQGMiniGame) {
  20515. cfg.plat = MoyuPlat.op;
  20516. cfg.ads.opVideoId = '455502';
  20517. cfg.ads.opBannerId = '455507';
  20518. }
  20519. else if (Laya.Browser.onVVMiniGame) {
  20520. cfg.plat = MoyuPlat.vv;
  20521. cfg.version = 0;
  20522. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  20523. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  20524. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  20525. }
  20526. else if (Laya.Browser.onHWMiniGame) {
  20527. cfg.plat = MoyuPlat.hw;
  20528. }
  20529. else if (window["mz"]) {
  20530. cfg.plat = MoyuPlat.mz;
  20531. }
  20532. else {
  20533. let cfg = window['conchConfig'];
  20534. if (cfg) {
  20535. var os = cfg.getOS();
  20536. if (os == "Conch-ios") {
  20537. cfg.plat = MoyuPlat.ios;
  20538. }
  20539. else if (os == "Conch-android") {
  20540. }
  20541. }
  20542. }
  20543. return cfg;
  20544. }
  20545. class Main {
  20546. constructor() {
  20547. if (window["Laya3D"])
  20548. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  20549. else {
  20550. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  20551. this.initMain();
  20552. }
  20553. }
  20554. initMain() {
  20555. Laya["Physics"] && Laya["Physics"].enable();
  20556. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  20557. Laya.stage.scaleMode = GameConfig.scaleMode;
  20558. Laya.stage.screenMode = GameConfig.screenMode;
  20559. Laya.stage.alignV = GameConfig.alignV;
  20560. Laya.stage.alignH = GameConfig.alignH;
  20561. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  20562. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  20563. Laya.enableDebugPanel();
  20564. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  20565. Laya["PhysicsDebugDraw"].enable();
  20566. if (GameConfig.stat)
  20567. Laya.Stat.show();
  20568. Laya.alertGlobalError(true);
  20569. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  20570. }
  20571. onVersionLoaded() {
  20572. appInit();
  20573. }
  20574. }
  20575. new Main();
  20576. }());
  20577. //# sourceMappingURL=bundle.js.map