1
0

bundle.js 826 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685
  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 GlobalManager {
  1062. constructor() {
  1063. }
  1064. registerMethod(name, method) {
  1065. console.log('zh: 注册全局方法', name);
  1066. this[name] = method;
  1067. }
  1068. callMethod(name, ...args) {
  1069. console.log('zh: 调用全局方法', name);
  1070. if (this[name]) {
  1071. return this[name](...args);
  1072. }
  1073. else {
  1074. console.error(`zh: 全局方法 Method ${name} not found`);
  1075. }
  1076. }
  1077. }
  1078. GlobalManager.instance = new GlobalManager();
  1079. class JSBridgeUtils {
  1080. constructor() { }
  1081. static get instance() {
  1082. if (!this._instance) {
  1083. this._instance = new JSBridgeUtils();
  1084. }
  1085. return this._instance;
  1086. }
  1087. initBridge() {
  1088. if (!Laya.Browser.onAndroid) {
  1089. console.log('zh:非android dev');
  1090. return;
  1091. }
  1092. let cfg = window['conchConfig'];
  1093. if (cfg) {
  1094. var os = cfg.getOS();
  1095. if (os == "Conch-android") {
  1096. this.bridge = window['PlatformClass'].createClass("demo.JSBridge");
  1097. if (this.bridge) {
  1098. return true;
  1099. }
  1100. else {
  1101. return false;
  1102. }
  1103. }
  1104. else {
  1105. return false;
  1106. }
  1107. }
  1108. else {
  1109. return false;
  1110. }
  1111. }
  1112. testAd1() {
  1113. if (!Laya.Browser.onAndroid) {
  1114. console.log('zh:非android dev');
  1115. return;
  1116. }
  1117. if (!this.initBridge()) {
  1118. return;
  1119. }
  1120. let rs = this.bridge.call("testString", "hello");
  1121. console.log('zh:testString rs=' + rs);
  1122. }
  1123. testAdCallBack() {
  1124. if (!this.initBridge()) {
  1125. return;
  1126. }
  1127. console.log("zh:testAdCallBack start");
  1128. const defaultObj = { code: 200, msg: "req update Ui" };
  1129. const reqObj = { code: 300, msg: "hello java ui" };
  1130. this.bridge.callWithBack((rsStr) => {
  1131. const rsObj = JSON.parse(rsStr);
  1132. console.log(`zh:testAsyncCallback js收到java返回值=${rsStr}`);
  1133. }, "testAsyncCallback", JSON.stringify(reqObj));
  1134. }
  1135. showInternAd(mark) {
  1136. if (!Laya.Browser.onAndroid) {
  1137. console.log('zh:非android dev');
  1138. return false;
  1139. }
  1140. if (!this.initBridge()) {
  1141. return false;
  1142. }
  1143. let rs = this.bridge.call("showInternAd", mark);
  1144. console.log('zh:showInternAd rs= ' + rs + ' ,mark=' + mark);
  1145. try {
  1146. const result = JSON.parse(rs);
  1147. if (result.code === 200) {
  1148. console.log("zh:广告显示成功");
  1149. return true;
  1150. }
  1151. else {
  1152. console.warn("zh:广告显示失败:", result.msg);
  1153. return false;
  1154. }
  1155. }
  1156. catch (e) {
  1157. console.error("zh:解析桥接返回值失败:", e);
  1158. return false;
  1159. }
  1160. }
  1161. showRewardAd(mark) {
  1162. if (!Laya.Browser.onAndroid) {
  1163. console.log('zh:非android dev');
  1164. return false;
  1165. }
  1166. if (!this.initBridge()) {
  1167. return false;
  1168. }
  1169. let rs = this.bridge.call("showRewardAd", mark);
  1170. console.log('zh:showRewardAd rs= ' + rs + ' ,mark=' + mark);
  1171. try {
  1172. const result = JSON.parse(rs);
  1173. if (result.code === 200) {
  1174. console.log("zh:广告显示成功");
  1175. return true;
  1176. }
  1177. else {
  1178. console.warn("zh:广告显示失败:", result.msg);
  1179. return false;
  1180. }
  1181. }
  1182. catch (e) {
  1183. console.error("zh:解析桥接返回值失败:", e);
  1184. return false;
  1185. }
  1186. }
  1187. nativeCallJs(msg) {
  1188. console.log("zh:nativeCallJs received data: 1111", msg);
  1189. if (msg === 'Ad1') {
  1190. GlobalManager.instance.callMethod('Ad1');
  1191. console.log("zh: Ad1 奖励发送成功");
  1192. }
  1193. else if (msg === 'Ad2') {
  1194. GlobalManager.instance.callMethod('Ad2');
  1195. console.log("zh: Ad2 奖励发送成功");
  1196. }
  1197. else if (msg === 'Ad3') {
  1198. GlobalManager.instance.callMethod('Ad3');
  1199. console.log("zh: Ad3 奖励发送成功");
  1200. }
  1201. else if (msg === 'Ad4') {
  1202. GlobalManager.instance.callMethod('Ad4');
  1203. console.log("zh: Ad4 奖励发送成功");
  1204. }
  1205. else if (msg === 'Ad5') {
  1206. console.log("zh: Ad5 奖励发送成功");
  1207. GlobalManager.instance.callMethod('Ad5');
  1208. }
  1209. }
  1210. }
  1211. class UIBox extends UIBase {
  1212. constructor() {
  1213. super();
  1214. this.boxNum = 0;
  1215. this.boxMax = 10;
  1216. this.inAd = false;
  1217. this.isClose = false;
  1218. }
  1219. onConstructor() {
  1220. this.ui = ui_UIBox.createInstance();
  1221. this.contentPane = this.ui;
  1222. this.isEject = false;
  1223. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  1224. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  1225. Laya.timer.loop(1000, this, this.update);
  1226. }
  1227. update() {
  1228. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  1229. this.boxNum -= 1;
  1230. this.upBar();
  1231. }
  1232. }
  1233. upBar() {
  1234. if (this.boxNum > this.boxMax)
  1235. this.boxNum = this.boxMax;
  1236. this.ui.bar.value = this.boxNum * 10;
  1237. }
  1238. show() {
  1239. super.show();
  1240. this.isClose = false;
  1241. this.boxNum = 0;
  1242. this.inAd = false;
  1243. this.upBar();
  1244. this.ui.t0.play();
  1245. this.ui.closeBtn.visible = false;
  1246. Laya.timer.once(3000, this, () => {
  1247. this.ui.closeBtn.visible = true;
  1248. this.ui.bar.alpha = 1;
  1249. });
  1250. Laya.timer.once(500, this, () => {
  1251. this.ui.t1.play();
  1252. });
  1253. }
  1254. hide() {
  1255. Laya.timer.clearAll(this);
  1256. Moyu.showBannerAd(false);
  1257. super.hide();
  1258. }
  1259. onOpenBox() {
  1260. this.boxNum++;
  1261. if (this.boxNum < this.boxMax) {
  1262. if (PlatMgr.getRand() < PlatMgr.boxInsertRate)
  1263. Moyu.showInsertAd(0, PlatMgr.insertGap);
  1264. }
  1265. else if (this.boxNum == this.boxMax) {
  1266. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  1267. this.ui.openBtn.c1.selectedIndex = 13;
  1268. this.inAd = true;
  1269. }
  1270. else
  1271. this.getAward();
  1272. }
  1273. else if (this.inAd) {
  1274. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  1275. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  1276. }
  1277. else {
  1278. console.log('zh:AD 失败,直接发放奖励');
  1279. this.qjff_AD_for_UIBOX_onOpenBox();
  1280. }
  1281. }
  1282. this.upBar();
  1283. }
  1284. qjff_AD_for_UIBOX_onOpenBox() {
  1285. this.getAward();
  1286. }
  1287. onCloseBox() {
  1288. if (this.isClose)
  1289. this.hide();
  1290. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  1291. this.isClose = true;
  1292. PlatMgr.showBanner(true, 0, 3000);
  1293. }
  1294. else
  1295. this.hide();
  1296. }
  1297. getAward() {
  1298. let str = "";
  1299. if (Math.random() < 0.5) {
  1300. let max = Moyu.isLegal ? 500 : 2500;
  1301. let num = xGame.tools.random(max, 500 + max);
  1302. DataMgr.setCoin(num);
  1303. str = "金币x" + num;
  1304. }
  1305. else {
  1306. let max = Moyu.isLegal ? 10 : 30;
  1307. let num = xGame.tools.random(max, 30 + max);
  1308. DataMgr.setDiamond(num);
  1309. str = "钻石x" + num;
  1310. }
  1311. xGame.showTip("恭喜获得-" + str);
  1312. this.hide();
  1313. }
  1314. }
  1315. UIBox.uiName = "UIBox";
  1316. class ui_UITry extends fgui.GComponent {
  1317. static createInstance() {
  1318. return (fgui.UIPackage.createObject("game", "UITry"));
  1319. }
  1320. onConstruct() {
  1321. this.n11 = (this.getChild("n11"));
  1322. this.myNode = (this.getChild("myNode"));
  1323. this.t0 = this.getTransition("t0");
  1324. }
  1325. }
  1326. ui_UITry.URL = "ui://isxx5ak7cj92v4o4";
  1327. class UITry extends UIBase {
  1328. constructor() {
  1329. super();
  1330. this.closeTime = 0;
  1331. this.closeNum = 0;
  1332. this.skillUrl = xGame.common.skillIconList;
  1333. }
  1334. onConstructor() {
  1335. this.ui = ui_UITry.createInstance();
  1336. this.contentPane = this.ui;
  1337. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  1338. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  1339. }
  1340. show() {
  1341. super.show();
  1342. this.closeNum = 0;
  1343. this.closeTime = 15;
  1344. this.ui.t0.play();
  1345. PlatMgr.showRateBanner();
  1346. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1347. Laya.timer.loop(1000, this, this.updateTime);
  1348. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  1349. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  1350. xGame.common.gameMgr.gamePause = true;
  1351. }
  1352. updateTime() {
  1353. if (this.closeTime > 1) {
  1354. this.closeTime--;
  1355. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1356. }
  1357. else
  1358. this.hide();
  1359. }
  1360. hide() {
  1361. Laya.timer.clearAll(this);
  1362. Moyu.showBannerAd(false);
  1363. super.hide();
  1364. xGame.common.gameMgr.gamePause = false;
  1365. }
  1366. onTry() {
  1367. console.log('zh:qjff_AD_for_uitry');
  1368. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  1369. }
  1370. else {
  1371. console.log('zh:AD 失败,直接发放奖励');
  1372. this.qjff_AD_for_uitry();
  1373. }
  1374. }
  1375. qjff_AD_for_uitry() {
  1376. let select = xGame.common.curPlayerSkillType;
  1377. DataMgr.gameData.trySkill = select;
  1378. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  1379. DataMgr.saveGameData();
  1380. DataMgr.setBigSkill(select, 1);
  1381. xGame.showTip("Trial Successful");
  1382. this.hide();
  1383. }
  1384. onCancel() {
  1385. if (this.closeNum > 0) {
  1386. this.closeNum--;
  1387. if (this.closeNum < 2)
  1388. this.hide();
  1389. return;
  1390. }
  1391. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  1392. this.onTry();
  1393. }
  1394. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  1395. this.closeNum = 3;
  1396. }
  1397. else
  1398. this.hide();
  1399. }
  1400. }
  1401. UITry.uiName = "UITry";
  1402. class PlatMgr {
  1403. static initConfig() {
  1404. this.lastVt = 0;
  1405. if (!Moyu.platConfig)
  1406. return;
  1407. for (let k in Moyu.platConfig) {
  1408. let pd = this[k];
  1409. let pc = Moyu.platConfig[k];
  1410. if (pd != undefined && pc != undefined)
  1411. this[k] = pc;
  1412. }
  1413. Moyu.setBannerPos(0.5, 1);
  1414. }
  1415. static rand100(num) {
  1416. return xGame.tools.random(0, 100) < num;
  1417. }
  1418. static isMisVideo() {
  1419. let dt = Laya.timer.currTimer - this.lastVt;
  1420. if (dt > this.forceVideoGap && this.rand100(this.forceVideoRate)) {
  1421. this.lastVt = Laya.timer.currTimer;
  1422. return true;
  1423. }
  1424. else {
  1425. if (this.rand100(this.fullVideoRate))
  1426. Moyu.showInsertAd(0, 0, 'full');
  1427. return false;
  1428. }
  1429. }
  1430. static showVideo(call, type) {
  1431. Moyu.showVideoAd(() => {
  1432. this.lastVt = Laya.timer.currTimer;
  1433. call && call();
  1434. }, type);
  1435. }
  1436. static showInsert(delay = false) {
  1437. if (this.getRand() < this.insertRate) {
  1438. let dt = delay ? this.insertDelay : 0;
  1439. Moyu.showInsertAd(dt, this.insertGap);
  1440. }
  1441. }
  1442. static gameInsert() {
  1443. if (this.getRand() < this.gameInsertRate) {
  1444. console.log('zh: 游戏中插屏 hhhhhhhhhhhhhhhhhh');
  1445. Moyu.showInsertAd(xGame.tools.random(2000, 5100), this.insertGap);
  1446. }
  1447. }
  1448. static showRateBanner() {
  1449. if (this.getRand() < this.bannerRate)
  1450. this.showBanner(true, this.bannerDelay, 3000);
  1451. }
  1452. static showBanner(show, delay = 0, hide = 0) {
  1453. if (!show)
  1454. Moyu.showBannerAd(false);
  1455. else {
  1456. Laya.timer.clear(this, this.bannerShow);
  1457. if (delay > 0)
  1458. Laya.timer.once(delay, this, this.bannerShow, [true]);
  1459. else
  1460. this.bannerShow(true);
  1461. if (hide > 0)
  1462. Laya.timer.once(hide, this, this.bannerShow, [false]);
  1463. }
  1464. }
  1465. static bannerShow(show) {
  1466. Moyu.showBannerAd(show);
  1467. console.log("showBanner" + show);
  1468. }
  1469. static getRand() {
  1470. return xGame.tools.random(0, 100);
  1471. }
  1472. static openBox() {
  1473. if (this.getRand() < this.boxRate)
  1474. xGame.uiMgr.Show(UIBox);
  1475. }
  1476. static openTry() {
  1477. if (Laya.timer.currTimer < DataMgr.gameData.tryTime)
  1478. return;
  1479. if (this.getRand() < this.tryRate)
  1480. xGame.uiMgr.Show(UITry);
  1481. else if (DataMgr.gameData.gameCount == 1)
  1482. xGame.uiMgr.Show(UITry);
  1483. }
  1484. }
  1485. PlatMgr.forceShare = 0;
  1486. PlatMgr.signAdRate = 0;
  1487. PlatMgr.forceVideoRate = 0;
  1488. PlatMgr.forceVideoGap = 0;
  1489. PlatMgr.fullVideoRate = 0;
  1490. PlatMgr.gameInsertRate = 0;
  1491. PlatMgr.insertGap = 0;
  1492. PlatMgr.insertDelay = 0;
  1493. PlatMgr.insertRate = 0;
  1494. PlatMgr.boxRate = 0;
  1495. PlatMgr.boxVideoRate = 0;
  1496. PlatMgr.boxInsertRate = 0;
  1497. PlatMgr.boxBannerRate = 0;
  1498. PlatMgr.tryRate = 0;
  1499. PlatMgr.tryClose3Rate = 0;
  1500. PlatMgr.tryVideoRate = 0;
  1501. PlatMgr.bannerRate = 0;
  1502. PlatMgr.lastVt = 0;
  1503. class ui_UIAddProp extends fgui.GComponent {
  1504. static createInstance() {
  1505. return (fgui.UIPackage.createObject("game", "UIAddProp"));
  1506. }
  1507. onConstruct() {
  1508. this.n11 = (this.getChild("n11"));
  1509. this.myNode = (this.getChild("myNode"));
  1510. this.closeBtn = (this.getChild("closeBtn"));
  1511. this.t0 = this.getTransition("t0");
  1512. }
  1513. }
  1514. ui_UIAddProp.URL = "ui://isxx5ak7p4tr42k";
  1515. class SpineMgr {
  1516. constructor(name, loadCb = null) {
  1517. this.loaded = false;
  1518. this.spineName = '';
  1519. this.loadedCallback = loadCb;
  1520. this.templet = new Laya.Templet();
  1521. this.templet.on(Laya.Event.COMPLETE, this, this.parseComplete);
  1522. this.templet.on(Laya.Event.ERROR, this, this.onError);
  1523. if (name === 'mishu') {
  1524. this.templet.loadAni('spine/nvmishu.sk');
  1525. }
  1526. else {
  1527. this.templet.loadAni(`spine/${name}.sk`);
  1528. }
  1529. this.templet.lock = true;
  1530. this.spineName = name;
  1531. }
  1532. onError() {
  1533. console.log("zh:spine加载出错");
  1534. }
  1535. parseComplete() {
  1536. this.loaded = true;
  1537. this.loadedCallback && this.loadedCallback();
  1538. }
  1539. dispose() {
  1540. if (this.templet && !this.templet.destroyed) {
  1541. this.templet.destroy();
  1542. }
  1543. this.templet = null;
  1544. }
  1545. play(data, aniIndex, isLoop = true, parent, callback, mySpine = null) {
  1546. if (!this.loaded) {
  1547. return;
  1548. }
  1549. let spine;
  1550. if (mySpine) {
  1551. spine = mySpine;
  1552. }
  1553. else {
  1554. spine = this.createSpine(data, parent);
  1555. }
  1556. spine.play(aniIndex, isLoop, true, 0, 0, true);
  1557. if (!isLoop) {
  1558. spine.on(Laya.Event.STOPPED, this, () => {
  1559. spine.offAll(Laya.Event.STOPPED);
  1560. callback && callback(spine);
  1561. });
  1562. }
  1563. return spine;
  1564. }
  1565. createSpine(data, parent, type = 1) {
  1566. let spine;
  1567. spine = this.templet.buildArmature(type);
  1568. spine.showSkinByIndex(0);
  1569. parent.addChild(spine);
  1570. spine.pos(data.x, data.y);
  1571. spine.scale(data.scaleX, data.scaleY, true);
  1572. return spine;
  1573. }
  1574. }
  1575. var AIState;
  1576. (function (AIState) {
  1577. AIState[AIState["none"] = 0] = "none";
  1578. AIState[AIState["idle"] = 1] = "idle";
  1579. AIState[AIState["reset"] = 2] = "reset";
  1580. AIState[AIState["move"] = 3] = "move";
  1581. AIState[AIState["wait"] = 4] = "wait";
  1582. AIState[AIState["select"] = 5] = "select";
  1583. AIState[AIState["turn"] = 6] = "turn";
  1584. AIState[AIState["shoot"] = 7] = "shoot";
  1585. AIState[AIState["leave"] = 8] = "leave";
  1586. })(AIState || (AIState = {}));
  1587. class AIPlayer {
  1588. constructor() {
  1589. this.dtime = 30;
  1590. this.awayTime = 0;
  1591. this.awayNum = 0;
  1592. this.hideTime = 0;
  1593. this.rootMoveTime = 0;
  1594. this.isGuide = false;
  1595. this.state = AIState.none;
  1596. this.waitTime = 0;
  1597. this.forceNum = 0;
  1598. this.forceMax = 0;
  1599. this.ballSize = 33;
  1600. this.selectNum = 0;
  1601. this.destRot = 0;
  1602. this.aiLv = 10;
  1603. this.kickBall = [];
  1604. this.lineBall = [];
  1605. this.scoreBall = [];
  1606. this.holeBall = [];
  1607. this.turnNum = 0;
  1608. this.setNum = 0;
  1609. this.setMax = 0;
  1610. this.setRate = 0;
  1611. this.rectL = 0;
  1612. this.rectR = 0;
  1613. this.rectT = 0;
  1614. this.rectB = 0;
  1615. this.rootPos = { x: 0, y: 0 };
  1616. this.bestForce = 0;
  1617. this.bestAngle = 180;
  1618. this.bestPos = { x: 0, y: 0 };
  1619. this.bestKick = { x: 0, y: 0 };
  1620. this.posList = [];
  1621. this.posIdx = 0;
  1622. this.chatTime = 3000;
  1623. this.tempDir1 = new Laya.Vector2();
  1624. this.tempDir2 = new Laya.Vector2();
  1625. this.tempDir3 = new Laya.Vector2();
  1626. Laya.timer.loop(this.dtime, this, this.onUpdate);
  1627. xGame.eventMgr.off(RESET_GAME, this, this.resetAI);
  1628. xGame.eventMgr.on(RESET_GAME, this, this.resetAI);
  1629. this.gameSrc = xGame.common.gameUI;
  1630. this.hideTime = Laya.timer.currTimer;
  1631. Moyu.setOnTipCall((id) => {
  1632. if (id == 20012)
  1633. this.hideTime = Laya.timer.currTimer;
  1634. else
  1635. (id == 20011);
  1636. {
  1637. let dt = Laya.timer.currTimer - this.hideTime;
  1638. console.log("onshow" + dt);
  1639. if (dt > 30000 && this.state > AIState.none)
  1640. xGame.common.gameMgr.aiGameEnd(false);
  1641. }
  1642. }, this);
  1643. }
  1644. init() {
  1645. this.isGuide = DataMgr.getSkillGuide() < 1 || DataMgr.gameData.gameCount < 1;
  1646. this.awayTime = xGame.tools.random(5000, 10000);
  1647. this.awayNum = 0;
  1648. this.hideTime = Laya.timer.currTimer;
  1649. let rect = xGame.common.d2World.borderRect;
  1650. this.rectL = Math.ceil(rect.x) + 17;
  1651. this.rectT = Math.ceil(rect.y) + 17;
  1652. this.rectR = Math.floor(rect.x + rect.width) - 17;
  1653. this.rectB = Math.floor(rect.y + rect.height) - 17;
  1654. this.wBall = xGame.common.d2World.rootBall;
  1655. this.ballSize = this.wBall.gameObj.width - 1;
  1656. if (this.posList.length < 1) {
  1657. let dp = 40;
  1658. for (let i = this.rectL; i < this.rectR + dp; i = i + dp) {
  1659. for (let j = this.rectT; j < this.rectB + dp; j = j + dp) {
  1660. let dx = i < this.rectR ? i : this.rectR;
  1661. let dy = j < this.rectB ? j : this.rectB;
  1662. let order = xGame.tools.random(0, 1000);
  1663. this.posList.push({ x: dx, y: dy, order: order });
  1664. }
  1665. }
  1666. this.posList.sort(function (a, b) {
  1667. return a.order - b.order;
  1668. });
  1669. this.setMax = this.posList.length;
  1670. }
  1671. this.state = AIState.idle;
  1672. }
  1673. setAiLevel(num) {
  1674. this.aiLv = num;
  1675. }
  1676. initBall() {
  1677. this.rootPos.x = this.wBall.gameObj.x;
  1678. this.rootPos.y = this.wBall.gameObj.y;
  1679. this.initHoleBall();
  1680. }
  1681. initHoleBall() {
  1682. this.kickBall = [];
  1683. this.lineBall = [];
  1684. this.scoreBall = [];
  1685. this.holeBall = [];
  1686. this.selectNum = 0;
  1687. this.forceNum = 0;
  1688. this.forceMax = 0;
  1689. this.turnNum = 0;
  1690. let list = xGame.common.d2World.ballArr;
  1691. if (list.length < 20 && !this.isGuide) {
  1692. let holes = xGame.common.gameMgr.holePosList;
  1693. for (let i = 0; i < list.length; i++) {
  1694. let obj = list[i];
  1695. if (!obj)
  1696. continue;
  1697. obj.kickPos.x = 0;
  1698. obj.kickPos.y = 0;
  1699. obj.poleAngle = 0;
  1700. obj.hard = 0;
  1701. obj.borderDis = 0;
  1702. obj.kickAngle = 180;
  1703. if (obj.number == 0)
  1704. continue;
  1705. if (obj.ballType == xGame.common.gameMgr.selfCamp)
  1706. continue;
  1707. if (obj.number == 8 && xGame.common.gameMode == 0) {
  1708. if (xGame.common.gameMgr.aiBallArr.length > 0 || !xGame.common.gameMgr.ensureBallType)
  1709. continue;
  1710. }
  1711. let b = obj.gameObj;
  1712. let wbp = this.rootPos;
  1713. let bx = wbp.x - b.x;
  1714. let by = wbp.y - b.y;
  1715. obj.borderDis = xGame.tools.random(0, 100);
  1716. this.kickBall.push(obj);
  1717. if (!this.isLine(wbp, obj))
  1718. continue;
  1719. obj.kickAngle = xGame.tools.random(90, 180);
  1720. obj.kickPos.x = b.x;
  1721. obj.kickPos.y = b.y;
  1722. this.lineBall.push(obj);
  1723. let minDis = 999999;
  1724. let hole = false;
  1725. for (let j = 0; j < holes.length; j++) {
  1726. let hp = holes[j];
  1727. if (bx >= 0 && hp.x > b.x + 100)
  1728. continue;
  1729. if (bx <= 0 && hp.x < b.x - 100)
  1730. continue;
  1731. if (by < -10 && hp.y < wbp.y)
  1732. continue;
  1733. if (by > 10 && hp.y > wbp.y)
  1734. continue;
  1735. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  1736. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  1737. if (dis < minDis) {
  1738. let dx = b.x - this.tempDir1.x * this.ballSize;
  1739. let dy = b.y - this.tempDir1.y * this.ballSize;
  1740. this.tempDir3.x = this.tempDir1.x;
  1741. this.tempDir3.y = this.tempDir1.y;
  1742. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  1743. obj.kickPos.x = dx;
  1744. obj.kickPos.y = dy;
  1745. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  1746. if (num > 1)
  1747. num = 1;
  1748. obj.kickAngle = Math.acos(num) * 57.3;
  1749. if (b.x < this.rectL + 2 || b.x > this.rectR - 2 || b.y < this.rectT + 2 || b.y > this.rectB - 2)
  1750. dis = dis * 2;
  1751. if (Math.abs(hp.x - 600) < 100)
  1752. dis += 50;
  1753. obj.hard = dis + obj.kickAngle * 3;
  1754. hole = true;
  1755. }
  1756. }
  1757. }
  1758. }
  1759. if (hole) {
  1760. this.scoreBall.push(obj);
  1761. this.holeBall.push(obj);
  1762. }
  1763. }
  1764. this.scoreBall.sort(function (a, b) {
  1765. return a.hard - b.hard;
  1766. });
  1767. this.holeBall.sort(function (a, b) {
  1768. return a.kickAngle - b.kickAngle;
  1769. });
  1770. this.kickBall.sort(function (a, b) {
  1771. return a.borderDis - b.borderDis;
  1772. });
  1773. }
  1774. else {
  1775. let max = list.length - 1;
  1776. let i = xGame.tools.random(0, max);
  1777. for (i; i <= max; i++) {
  1778. let idx = i >= max ? i -= max : i;
  1779. let obj = list[idx];
  1780. if (obj && obj.number != 0) {
  1781. obj.kickAngle = xGame.tools.random(90, 180);
  1782. obj.kickPos.x = obj.gameObj.x + xGame.tools.random(-10, 10);
  1783. obj.kickPos.y = obj.gameObj.y + xGame.tools.random(-10, 10);
  1784. this.lineBall.push(obj);
  1785. break;
  1786. }
  1787. }
  1788. }
  1789. }
  1790. selectBall() {
  1791. let ball = null;
  1792. this.destRot = 0;
  1793. let max = this.isGuide ? 1 : 3 - Math.ceil(this.aiLv / 4) + xGame.tools.random(0, 2);
  1794. let ai = 110 - this.aiLv * 10;
  1795. let mis = xGame.tools.random(-ai, ai) * 0.005;
  1796. let score = false;
  1797. if (this.scoreBall.length < 1) {
  1798. if (this.lineBall.length < 1) {
  1799. for (let i = 0; i < this.kickBall.length; i++) {
  1800. let list = [];
  1801. let bo = this.kickBall[i];
  1802. let bobj = bo.gameObj;
  1803. let rect = xGame.common.d2World.borderRect;
  1804. let mobj = this.wBall.gameObj;
  1805. let minb = bobj.y - rect.y - 20;
  1806. let minw = mobj.y - rect.y - 50;
  1807. if (minb > 0 && minw > 0) {
  1808. let dlenx = 0;
  1809. let dleny = mobj.y - rect.y;
  1810. let spx = mobj.x;
  1811. let spy = rect.y - dleny;
  1812. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1813. }
  1814. minb = rect.y + rect.height - bobj.y - 20;
  1815. minw = rect.y + rect.height - mobj.y - 50;
  1816. if (minb > 0 && minw > 0) {
  1817. let dlenx = 0;
  1818. let dleny = rect.y + rect.height - mobj.y;
  1819. let spx = mobj.x;
  1820. let spy = rect.y + rect.height + dleny;
  1821. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1822. }
  1823. minb = bobj.x - rect.x - 20;
  1824. minw = mobj.x - rect.x - 50;
  1825. if (minb > 0 && minw > 0) {
  1826. let dlenx = mobj.x - rect.x;
  1827. let dleny = 0;
  1828. let spx = rect.x - dlenx;
  1829. let spy = mobj.y;
  1830. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1831. }
  1832. minb = rect.x + rect.width - bobj.x - 20;
  1833. minw = rect.x + rect.width - mobj.x - 50;
  1834. if (minb > 0 && minw > 0) {
  1835. let dlenx = rect.x + rect.width - mobj.x;
  1836. let dleny = 0;
  1837. let spx = rect.x + rect.width + dlenx;
  1838. let spy = mobj.y;
  1839. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1840. }
  1841. list.sort(function (a, b) {
  1842. return a.order - b.order;
  1843. });
  1844. for (let i = 0; i < list.length; i++) {
  1845. let data = list[i];
  1846. let mx = mobj.x - bobj.x;
  1847. let my = mobj.y - bobj.y;
  1848. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  1849. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  1850. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1851. if (num > 1)
  1852. num = 1;
  1853. let cos = Math.acos(num);
  1854. if (cos > 1.57)
  1855. cos = 1.57;
  1856. else if (cos < 0.01)
  1857. cos = 0.01;
  1858. let tan = Math.tan(cos);
  1859. let dx = tan * data.dleny;
  1860. let dy = tan * data.dlenx;
  1861. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  1862. if (Math.abs(bx - 667) < 40)
  1863. continue;
  1864. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  1865. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  1866. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  1867. this.forceMax = dis * 0.08;
  1868. this.destRot += mis * 0.1;
  1869. this.setKick(bx, by);
  1870. return true;
  1871. }
  1872. }
  1873. }
  1874. }
  1875. else {
  1876. ball = xGame.common.getRandArrEle(this.lineBall);
  1877. }
  1878. }
  1879. else {
  1880. for (let i = 0; i < this.scoreBall.length; i++) {
  1881. if (i < this.scoreBall.length - 1) {
  1882. let rand = 70 + this.aiLv * 10 + i * 10;
  1883. if (xGame.tools.random(0, 100) < rand) {
  1884. ball = this.scoreBall[i];
  1885. break;
  1886. }
  1887. }
  1888. else {
  1889. ball = this.scoreBall[i];
  1890. break;
  1891. }
  1892. }
  1893. score = true;
  1894. this.selectNum++;
  1895. }
  1896. if (!ball)
  1897. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  1898. if (this.selectNum >= max) {
  1899. let dx = ball.gameObj.x;
  1900. let dy = ball.gameObj.y;
  1901. let kickAngle = 0;
  1902. if (score) {
  1903. dx = ball.kickPos.x;
  1904. dy = ball.kickPos.y;
  1905. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  1906. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  1907. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  1908. if (adot > 1)
  1909. adot = 1;
  1910. kickAngle = Math.acos(adot) * 57.3;
  1911. if (kickAngle > 45) {
  1912. let kdx = ball.kickPos.x - ball.gameObj.x;
  1913. let kdy = ball.kickPos.y - ball.gameObj.y;
  1914. dx = ball.kickPos.x - kdx * mis * 0.3;
  1915. dy = ball.kickPos.y - kdy * mis * 0.3;
  1916. }
  1917. else
  1918. this.destRot += mis;
  1919. }
  1920. else if (ball.poleAngle != 0) {
  1921. this.destRot += ball.poleAngle;
  1922. }
  1923. if (xGame.common.gameMode == 0) {
  1924. let af = kickAngle * 0.08;
  1925. this.forceMax = ball.hard * 0.1 + af * af;
  1926. }
  1927. this.setKick(dx, dy);
  1928. }
  1929. else {
  1930. let rand = this.aiLv * 5 + 40;
  1931. if (xGame.tools.random(0, 100) < rand && this.scoreBall.length > 0)
  1932. ball = xGame.common.getRandArrEle(this.scoreBall);
  1933. else
  1934. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  1935. rand = this.aiLv * 3 + 40 + this.selectNum * 20;
  1936. if (xGame.tools.random(0, 100) > rand) {
  1937. this.selectNum = max;
  1938. }
  1939. this.setState(AIState.select, xGame.tools.random(500, 1000));
  1940. this.selectNum++;
  1941. }
  1942. ball.onClick(0, true);
  1943. }
  1944. isBlock(bn, bx, by, hx, hy, dn = -1) {
  1945. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  1946. let balls = xGame.common.d2World.ballArr;
  1947. let max = xGame.tools.getDis(hx, hy, bx, by);
  1948. for (let index = 0; index < balls.length; index++) {
  1949. let obj = balls[index];
  1950. if (obj.number == 0)
  1951. continue;
  1952. if (obj.number == bn || obj.number == dn)
  1953. continue;
  1954. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  1955. if (dis * dis > max)
  1956. continue;
  1957. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  1958. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1959. if (num > 1)
  1960. num = 1;
  1961. if (num < 0)
  1962. continue;
  1963. let gap = Math.sin(Math.acos(num)) * dis;
  1964. if (gap < this.ballSize)
  1965. return true;
  1966. }
  1967. return false;
  1968. }
  1969. isLine(xy, ball) {
  1970. let bx = xy.x;
  1971. let by = xy.y;
  1972. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  1973. let dis = ball.getDestDis(xy);
  1974. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  1975. let sin = Math.sin(angle);
  1976. let cos = Math.cos(angle);
  1977. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  1978. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  1979. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  1980. let dx = bx + this.tempDir2.x * dis;
  1981. let dy = by + this.tempDir2.y * dis;
  1982. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  1983. sin = Math.sin(-angle);
  1984. cos = Math.cos(-angle);
  1985. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  1986. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  1987. dx = bx + this.tempDir2.x * dis;
  1988. dy = by + this.tempDir2.y * dis;
  1989. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  1990. if (isr && isl)
  1991. return false;
  1992. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  1993. }
  1994. return true;
  1995. }
  1996. turnPole() {
  1997. this.turnNum++;
  1998. let rot = xGame.common.d2World.d2Gan.ui.rotation % 360;
  1999. let dr = rot - this.destRot;
  2000. let abs = Math.abs(dr) % 360;
  2001. if (abs > 180) {
  2002. if (rot > 180)
  2003. rot -= 360;
  2004. if (this.destRot > 180)
  2005. this.destRot -= 360;
  2006. }
  2007. let max = this.turnNum * 5 + this.aiLv * 5;
  2008. if (abs < 0.2 && xGame.tools.random(0, 100) < max) {
  2009. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  2010. let at = xGame.tools.random(1000, 2000);
  2011. if (!this.onAway(3))
  2012. at += xGame.tools.random(10000, 15000);
  2013. this.setState(AIState.shoot, at);
  2014. }
  2015. else {
  2016. let mr = 0;
  2017. if (abs > 3)
  2018. mr = 1 + xGame.tools.random(2, 6) * abs * 0.01;
  2019. else if (Math.random() > 0.6)
  2020. mr = xGame.tools.random(1, 10) * 0.1;
  2021. mr = dr > 0 ? -mr : mr;
  2022. xGame.common.d2World.d2Gan.rotDest(rot + mr);
  2023. }
  2024. }
  2025. setKick(dx, dy) {
  2026. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  2027. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2028. this.tempDir1.x = 0;
  2029. this.tempDir1.y = 1;
  2030. this.tempDir2.y = -this.tempDir2.y;
  2031. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2032. if (num > 1)
  2033. num = 1;
  2034. let rot = Math.acos(num) * 57.3;
  2035. if (this.tempDir2.x < 0)
  2036. rot = 360 - rot;
  2037. this.destRot += rot;
  2038. if (!xGame.common.gameMgr.finishOneShoot) {
  2039. this.forceMax += xGame.tools.random(10, 50);
  2040. this.forceMax -= this.aiLv * 2;
  2041. if (this.forceMax < 20)
  2042. this.forceMax = 20;
  2043. }
  2044. if (this.forceMax > 100)
  2045. this.forceMax = 101;
  2046. else if (this.forceMax < 10)
  2047. this.forceMax += xGame.tools.random(0, 10);
  2048. if (xGame.common.gameMode == 1)
  2049. this.forceMax = xGame.tools.random(80, 100);
  2050. else
  2051. this.forceMax = xGame.tools.random(this.forceMax * 0.5, this.forceMax);
  2052. let max = 2000 - this.aiLv * 100;
  2053. if (Math.random() > 0.8)
  2054. max += xGame.tools.random(100, 2000);
  2055. this.setState(AIState.turn, xGame.tools.random(500, max));
  2056. }
  2057. shoot() {
  2058. if (this.waitTime < 0 && Math.abs(this.forceNum - this.forceMax) < 4) {
  2059. if (Math.random() > 0.8) {
  2060. this.gameSrc.aiForce(1);
  2061. this.setState(AIState.wait);
  2062. }
  2063. }
  2064. else {
  2065. let df = xGame.tools.random(3, 8);
  2066. if (this.forceNum < this.forceMax)
  2067. this.forceNum += df;
  2068. else
  2069. this.forceNum -= df;
  2070. let startY = this.gameSrc.ui.powerNode.y;
  2071. let height = this.gameSrc.ui.powerNode.height;
  2072. let force = startY + height * this.forceNum * 0.01;
  2073. this.gameSrc.aiForce(2, force);
  2074. }
  2075. }
  2076. reset() {
  2077. for (let i = 0; i < 4; i++) {
  2078. this.setRate--;
  2079. this.setNum++;
  2080. let pos = this.posList[this.posIdx];
  2081. this.rootPos.x = pos.x + xGame.tools.random(-20, 20);
  2082. this.rootPos.y = pos.y + xGame.tools.random(-20, 20);
  2083. if (!xGame.common.gameMgr.isTouchedBall && this.rootPos.x > 387)
  2084. this.rootPos.x = 387;
  2085. if (this.rootPos.x < this.rectL)
  2086. this.rootPos.x = this.rectL;
  2087. else if (this.rootPos.x > this.rectR)
  2088. this.rootPos.x = this.rectR;
  2089. if (this.rootPos.y < this.rectT)
  2090. this.rootPos.y = this.rectT;
  2091. else if (this.rootPos.y > this.rectB)
  2092. this.rootPos.y = this.rectB;
  2093. this.posIdx++;
  2094. let max = this.posList.length;
  2095. if (this.posIdx >= max)
  2096. this.posIdx -= max;
  2097. this.initHoleBall();
  2098. let ball = null;
  2099. if (this.scoreBall.length > 0)
  2100. ball = this.scoreBall[0];
  2101. else if (this.lineBall.length > 0)
  2102. ball = xGame.common.getRandArrEle(this.lineBall);
  2103. if (ball && ball.kickAngle < this.bestAngle) {
  2104. this.bestAngle = ball.kickAngle;
  2105. this.bestKick.x = ball.kickPos.x;
  2106. this.bestKick.y = ball.kickPos.y;
  2107. this.bestPos.x = this.rootPos.x;
  2108. this.bestPos.y = this.rootPos.y;
  2109. this.bestForce = ball.hard * 0.08;
  2110. }
  2111. }
  2112. if (this.setNum >= this.setMax)
  2113. this.setMax = 0;
  2114. if (this.setRate < 1) {
  2115. this.setState(AIState.move, 0);
  2116. this.rootMoveTime = Laya.timer.currTimer;
  2117. this.gameSrc.aiRootMove(true);
  2118. }
  2119. }
  2120. delayLine() {
  2121. this.gameSrc.aiRootMove(false);
  2122. }
  2123. move() {
  2124. if (this.bestPos.x < 1)
  2125. this.bestPos = this.rootPos;
  2126. let wObj = this.wBall.gameObj;
  2127. let destx = wObj.x;
  2128. let desty = wObj.y;
  2129. let dx = Math.abs(destx - this.bestPos.x);
  2130. let dy = Math.abs(desty - this.bestPos.y);
  2131. let mx = 3 + dx * 0.03;
  2132. let my = 3 + dy * 0.03;
  2133. if (dx < 4 && dy < 4) {
  2134. let dt = Laya.timer.currTimer - this.rootMoveTime;
  2135. dt = dt < 1000 ? 1000 - dt : 0;
  2136. if (this.setMax > 0) {
  2137. let min = this.setMax * 0.3 + this.aiLv * 5;
  2138. this.setRate = xGame.tools.random(min, this.setMax);
  2139. this.setState(AIState.reset, 0);
  2140. }
  2141. else {
  2142. this.destRot = 0;
  2143. this.forceMax = this.bestForce;
  2144. this.setKick(this.bestKick.x, this.bestKick.y);
  2145. }
  2146. if (dt > 100) {
  2147. Laya.timer.clear(this, this.delayLine);
  2148. Laya.timer.once(dt, this, this.delayLine);
  2149. }
  2150. else
  2151. this.gameSrc.aiRootMove(false);
  2152. }
  2153. else {
  2154. if (dx > 4)
  2155. destx = wObj.x < this.bestPos.x ? wObj.x + mx : wObj.x - mx;
  2156. if (dy > 4)
  2157. desty = wObj.y < this.bestPos.y ? wObj.y + my : wObj.y - my;
  2158. this.gameSrc.onRootMove({ x: destx, y: desty });
  2159. }
  2160. }
  2161. resetRoot() {
  2162. this.bestAngle = 180;
  2163. this.bestForce = 0;
  2164. this.setMax = this.posList.length;
  2165. this.posIdx = xGame.tools.random(0, this.setMax);
  2166. let min = this.setMax * 0.3 + this.aiLv * 5;
  2167. this.setRate = xGame.tools.random(min, this.setMax);
  2168. let max = 2000 - this.aiLv * 100;
  2169. if (Math.random() > 0.8)
  2170. max += xGame.tools.random(100, 1000);
  2171. if (this.isGuide)
  2172. this.setState(AIState.select, 500);
  2173. else if (this.onAway(2))
  2174. this.setState(AIState.reset, xGame.tools.random(400, max));
  2175. else
  2176. this.setState(AIState.none);
  2177. if (xGame.common.gameMgr.finishOneShoot)
  2178. this.chat();
  2179. }
  2180. runAI() {
  2181. if (this.state > AIState.idle)
  2182. return;
  2183. this.initBall();
  2184. this.onGame(2500);
  2185. if (Math.random() > 0.6)
  2186. this.chat();
  2187. }
  2188. stopRun() {
  2189. this.setState(AIState.idle);
  2190. }
  2191. onGame(base) {
  2192. let max = base - this.aiLv * 100;
  2193. if (Math.random() > 0.8)
  2194. max += xGame.tools.random(100, 1000);
  2195. if (this.onAway(2))
  2196. this.setState(AIState.select, xGame.tools.random(500, max));
  2197. else
  2198. this.setState(AIState.none);
  2199. }
  2200. setState(sta, wt = 0) {
  2201. if (this.state == AIState.none)
  2202. return;
  2203. this.state = sta;
  2204. this.waitTime = wt;
  2205. }
  2206. onUpdate() {
  2207. if (this.state == AIState.none)
  2208. return;
  2209. this.awayTime -= this.dtime;
  2210. if (this.awayTime < 1) {
  2211. this.awayTime = xGame.tools.random(6000, 10000);
  2212. this.awayNum += (11 - this.aiLv);
  2213. this.onAway(1);
  2214. }
  2215. if (this.waitTime >= 0) {
  2216. this.waitTime -= this.dtime;
  2217. return;
  2218. }
  2219. switch (this.state) {
  2220. case AIState.idle:
  2221. this.chat();
  2222. break;
  2223. case AIState.reset:
  2224. this.reset();
  2225. break;
  2226. case AIState.move:
  2227. this.move();
  2228. break;
  2229. case AIState.leave:
  2230. this.state = AIState.none;
  2231. xGame.common.gameMgr.aiGameEnd(true);
  2232. break;
  2233. case AIState.select:
  2234. this.selectBall();
  2235. break;
  2236. case AIState.turn:
  2237. this.turnPole();
  2238. break;
  2239. case AIState.shoot:
  2240. this.shoot();
  2241. break;
  2242. }
  2243. }
  2244. onAway(type) {
  2245. if (type == 1) {
  2246. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2247. let num = this.awayNum + db * 20;
  2248. if (db > 0 && num > 0 && xGame.tools.random(0, 10000) < num && this.state == AIState.idle) {
  2249. xGame.common.gameMgr.aiLeave();
  2250. this.setState(AIState.leave, 6666);
  2251. }
  2252. }
  2253. else if (type == 2) {
  2254. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2255. let num = this.awayNum + db * 30;
  2256. if (xGame.tools.random(0, 10000) < num)
  2257. return false;
  2258. }
  2259. else if (type == 3) {
  2260. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2261. let num = this.awayNum + db * 10;
  2262. if (xGame.tools.random(0, 4000) < num)
  2263. return false;
  2264. }
  2265. return true;
  2266. }
  2267. chat() {
  2268. if (this.chatTime > 0) {
  2269. this.chatTime -= this.dtime;
  2270. return;
  2271. }
  2272. this.chatTime = xGame.tools.random(2000, 10000);
  2273. let rand = xGame.tools.random(0, 100);
  2274. if (rand < 15)
  2275. this.talk();
  2276. else if (rand < 35)
  2277. this.emotion();
  2278. }
  2279. talk() {
  2280. xGame.common.talkMgr.showAITalk(0);
  2281. }
  2282. emotion() {
  2283. xGame.common.talkMgr.showAIEmotion(0);
  2284. }
  2285. resetAI() {
  2286. this.stopRun();
  2287. this.state = AIState.none;
  2288. }
  2289. }
  2290. class Partical extends Laya.Script3D {
  2291. constructor() {
  2292. super();
  2293. this.duration = 2000;
  2294. }
  2295. ;
  2296. onAwake() {
  2297. this.gameObj = this.owner;
  2298. }
  2299. onEnable() {
  2300. this.openTimer();
  2301. }
  2302. openTimer() {
  2303. Laya.timer.once(this.duration, this, this.disappear);
  2304. }
  2305. setCallback(obj, callback) {
  2306. this.obj = obj;
  2307. this.callback = callback;
  2308. Laya.timer.clearAll(this);
  2309. Laya.timer.once(this.duration, this, this.disappear);
  2310. }
  2311. disappear() {
  2312. xGame.poolD3Mgr.putItem(this.gameObj.name, this.gameObj);
  2313. this.callback && this.callback(this.obj);
  2314. }
  2315. }
  2316. class Ball extends Laya.Script3D {
  2317. constructor() {
  2318. super();
  2319. this.posV3 = new Laya.Vector3();
  2320. this.rotRate = 2.1;
  2321. this.rotSpeed = new Laya.Vector3();
  2322. this.myIndex = 0;
  2323. }
  2324. onAwake() {
  2325. this.gameObj = this.owner;
  2326. this.transform = this.gameObj.transform;
  2327. this.ballNode = this.gameObj.getChildByName("Ball");
  2328. this.shadowNode = this.gameObj.getChildByName("shadow");
  2329. }
  2330. initSelf(index, x, y, owner) {
  2331. this.d2BallSrc = owner;
  2332. this.myIndex = index;
  2333. this.setAlbedoTexture();
  2334. this.setTransPos(x, y);
  2335. this.setScale();
  2336. this.ballNode.transform.localRotationEulerX = 90;
  2337. if (index == 0) {
  2338. }
  2339. }
  2340. setAlbedoTexture(isIce = false) {
  2341. let url;
  2342. if (isIce) {
  2343. url = `res/d3Res/ballTexture/ice.jpg`;
  2344. }
  2345. else {
  2346. url = `res/d3Res/ballTexture/ball${this.myIndex}.png`;
  2347. }
  2348. Laya.Texture2D.load(url, Laya.Handler.create(this, (tex) => {
  2349. this.ballNode.meshRenderer.material["albedoTexture"] = tex;
  2350. }));
  2351. }
  2352. runFireworks(obj, delay, callback) {
  2353. Laya.timer.clearAll(this);
  2354. Laya.timer.once(delay + 1, this, () => {
  2355. let fire = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  2356. fire.transform.localPositionX = this.transform.localPositionX;
  2357. fire.transform.localPositionY = this.transform.localPositionY;
  2358. fire.transform.localPositionZ = this.transform.localPositionZ;
  2359. let src = fire.getComponent(Partical);
  2360. src.duration = 1000;
  2361. src.setCallback(obj, callback);
  2362. let eft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  2363. eft.transform.localPositionX = this.transform.localPositionX;
  2364. eft.transform.localPositionY = this.transform.localPositionY;
  2365. eft.transform.localPositionZ = this.transform.localPositionZ;
  2366. });
  2367. }
  2368. setTransPos(x, y) {
  2369. this.setRotation();
  2370. xGame.common.pos2to3Convert(x, y, this.posV3);
  2371. this.transform.localPositionX = this.posV3.x;
  2372. this.transform.localPositionY = 0;
  2373. this.transform.localPositionZ = this.posV3.z;
  2374. this.transform.localRotationEulerX = 0;
  2375. this.transform.localRotationEulerY = 0;
  2376. this.transform.localRotationEulerZ = 0;
  2377. this.shadowNode.transform.localPositionX = this.posV3.x / 30;
  2378. this.shadowNode.transform.localPositionY = 0.1;
  2379. this.shadowNode.transform.localPositionZ = this.posV3.z / 30;
  2380. }
  2381. setRotation() {
  2382. if (this.d2BallSrc.canRot) {
  2383. let speed = this.d2BallSrc.rigy.linearVelocity;
  2384. this.rotSpeed.x = speed.x * this.rotRate;
  2385. this.rotSpeed.z = speed.y * this.rotRate;
  2386. this.rotSpeed.y = this.d2BallSrc.rotY;
  2387. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2388. }
  2389. else if (Math.abs(this.d2BallSrc.rotY) > 0.1) {
  2390. this.rotSpeed.x = this.rotSpeed.y = 0;
  2391. this.rotSpeed.y = this.d2BallSrc.rotY;
  2392. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2393. }
  2394. }
  2395. setScale() {
  2396. let radius = xGame.common.d2World.rootBall.ui.width;
  2397. let scale = xGame.common.scale2to3Convert(radius);
  2398. this.transform.localScaleX = scale;
  2399. this.transform.localScaleY = scale;
  2400. this.transform.localScaleZ = scale;
  2401. }
  2402. playInHoleEft() {
  2403. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  2404. eft.transform.position = this.transform.position;
  2405. }
  2406. playIceEft() {
  2407. let eft = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  2408. eft.transform.position = this.transform.position;
  2409. }
  2410. get scaleXYZ() {
  2411. return this.transform.localScaleX;
  2412. }
  2413. set scaleXYZ(val) {
  2414. this.transform.localScaleX = val;
  2415. this.transform.localScaleY = val;
  2416. this.transform.localScaleZ = val;
  2417. }
  2418. get posX() {
  2419. return this.transform.localPositionX;
  2420. }
  2421. set posX(val) {
  2422. this.transform.localPositionX = val;
  2423. }
  2424. get posY() {
  2425. return this.transform.localPositionY;
  2426. }
  2427. set posY(val) {
  2428. this.transform.localPositionY = val;
  2429. }
  2430. get posZ() {
  2431. return this.transform.localPositionZ;
  2432. }
  2433. set posZ(val) {
  2434. this.transform.localPositionZ = val;
  2435. }
  2436. destroySelf() {
  2437. this.posV3 = null;
  2438. this.rotSpeed = null;
  2439. this.d2BallSrc = null;
  2440. this.ballNode = null;
  2441. this.gameObj.destroy(true);
  2442. this.transform = null;
  2443. this.destroy();
  2444. }
  2445. }
  2446. class ui_D2Ball extends fgui.GComponent {
  2447. static createInstance() {
  2448. return (fgui.UIPackage.createObject("game", "D2Ball"));
  2449. }
  2450. onConstruct() {
  2451. this.myIcon = (this.getChild("myIcon"));
  2452. this.inner = (this.getChild("inner"));
  2453. this.n8 = (this.getChild("n8"));
  2454. this.n4 = (this.getChild("n4"));
  2455. this.wrongTips = (this.getChild("wrongTips"));
  2456. this.rightTips = (this.getChild("rightTips"));
  2457. this.breathAni = this.getTransition("breathAni");
  2458. }
  2459. }
  2460. ui_D2Ball.URL = "ui://isxx5ak7kt443qi";
  2461. class D2BallSrc extends Laya.Script {
  2462. constructor() {
  2463. super();
  2464. this.number = 0;
  2465. this.startX = 0;
  2466. this.startY = 0;
  2467. this.angleV2 = new Laya.Vector2();
  2468. this.isRootBall = false;
  2469. this.isBlackBall = false;
  2470. this.ballType = "";
  2471. this.canRot = true;
  2472. this.rotY = 0;
  2473. this.poleAngle = 0;
  2474. this.kickPos = { x: 0, y: 0 };
  2475. this.hard = 0;
  2476. this.kickAngle = 0;
  2477. this.borderDis = 0;
  2478. this.speedP10 = 5.6;
  2479. this.lastSpeed = { x: 0, y: 0 };
  2480. this.stillSpeed = 0.12;
  2481. this.ballFunc = "normal";
  2482. this.isRunSkillAni = false;
  2483. this.isInHole = false;
  2484. this.iceOwner = "";
  2485. this.forceRun = false;
  2486. this.myUNID = "";
  2487. this.rectL = 0;
  2488. this.rectR = 0;
  2489. this.rectT = 0;
  2490. this.rectB = 0;
  2491. this.forceVec = new Laya.Vector2();
  2492. this.lastDis = 0;
  2493. this.helpOut = { type: "", x: 0, y: 0 };
  2494. }
  2495. initSelf(number, x, y, d3Ball) {
  2496. if (!this.gameObj)
  2497. this.gameObj = this.owner;
  2498. this.number = number;
  2499. this.startX = x;
  2500. this.startY = y;
  2501. this.d3Ball = d3Ball;
  2502. this.isRootBall = false;
  2503. this.isBlackBall = false;
  2504. this.ballType = "";
  2505. if (number == 0) {
  2506. this.isRootBall = true;
  2507. }
  2508. else if (number == 8) {
  2509. this.isBlackBall = true;
  2510. }
  2511. else {
  2512. if (number <= 7) {
  2513. this.ballType = ballCamp.full;
  2514. }
  2515. else {
  2516. this.ballType = ballCamp.flower;
  2517. }
  2518. }
  2519. this.setInfo();
  2520. this.setD3Ball();
  2521. this.owner["mySrc"] = this;
  2522. this.rigy.linearDamping = 1;
  2523. D2BallSrc._unid++;
  2524. this.myUNID = "d2ball" + D2BallSrc._unid;
  2525. let rect = xGame.common.d2World.borderRect;
  2526. this.rectL = Math.ceil(rect.x) + 20;
  2527. this.rectT = Math.ceil(rect.y) + 20;
  2528. this.rectR = Math.floor(rect.x + rect.width) - 20;
  2529. this.rectB = Math.floor(rect.y + rect.height) - 20;
  2530. }
  2531. setInfo() {
  2532. this.gameObj.x = this.startX;
  2533. this.gameObj.y = this.startY;
  2534. let radius = this.ui.width / 2;
  2535. this.gameObj.width = radius * 2;
  2536. this.gameObj.height = radius * 2;
  2537. if (xGame.common.showDebug) {
  2538. this.ui.myIcon.alpha = 1;
  2539. this.ui.inner.alpha = 1;
  2540. }
  2541. else {
  2542. this.ui.myIcon.alpha = 0;
  2543. this.ui.inner.alpha = 0;
  2544. }
  2545. }
  2546. setD3Ball() {
  2547. this.d3Ball = this.d3Ball;
  2548. this.d3BallSrc = this.d3Ball.getComponent(Ball);
  2549. this.d3BallSrc.initSelf(this.number, this.startX, this.startY, this);
  2550. }
  2551. onUpdate() {
  2552. if (xGame.common.gameMgr.gamePause)
  2553. return;
  2554. if (this.isInHole)
  2555. return;
  2556. if (!xGame.common.d2World.openCheckStill)
  2557. return;
  2558. this.runBall();
  2559. }
  2560. runBall() {
  2561. this.lastSpeed.x = this.rigy.linearVelocity.x;
  2562. this.lastSpeed.y = this.rigy.linearVelocity.y;
  2563. this.d3BallSrc.setTransPos(this.gameObj.x, this.gameObj.y);
  2564. this.judgeBorder();
  2565. }
  2566. getDestDis(dest) {
  2567. return xGame.tools.getDistance(dest.x, dest.y, this.gameObj.x, this.gameObj.y);
  2568. }
  2569. setmyXY(x, y) {
  2570. this.d3BallSrc.setTransPos(x, y);
  2571. }
  2572. getSpeed() {
  2573. let speed = this.rigy.linearVelocity;
  2574. return speed.x * speed.x + speed.y * speed.y;
  2575. }
  2576. onTriggerEnter(collider) {
  2577. if (!collider || !collider.owner)
  2578. return;
  2579. let coll = "collide";
  2580. let speed = this.getSpeed();
  2581. let sv2 = this.speedP10 * this.speedP10;
  2582. if (collider.label == "ball") {
  2583. if (speed < 9 && this.number != 0)
  2584. coll = "";
  2585. else if (speed < sv2)
  2586. coll = "collide_4";
  2587. else if (speed < sv2 * 6.2)
  2588. coll = "collide_3";
  2589. else if (speed < sv2 * 25)
  2590. coll = "collide_2";
  2591. else if (speed < sv2 * 56)
  2592. coll = "collide_1";
  2593. xGame.soundMgr.playSound(coll);
  2594. if (this.gameObj.x < this.rectL || this.gameObj.x > this.rectR || this.gameObj.y < this.rectT || this.gameObj.y > this.rectB) {
  2595. if (collider.owner) {
  2596. let rig = collider.owner.getComponent(D2BallSrc);
  2597. if (Math.abs(rig.rigy.linearVelocity.x) > 0)
  2598. rig.lastSpeed.x = rig.rigy.linearVelocity.x;
  2599. if (Math.abs(rig.rigy.linearVelocity.y) > 0)
  2600. rig.lastSpeed.y = rig.rigy.linearVelocity.y;
  2601. let vx = Math.abs(rig.lastSpeed.x * 0.4);
  2602. let vy = Math.abs(rig.lastSpeed.y * 0.5);
  2603. let rx = 0;
  2604. let ry = 0;
  2605. if (this.gameObj.x < this.rectL)
  2606. rx = vx;
  2607. else if (this.gameObj.x > this.rectR)
  2608. rx = -vx;
  2609. else if (this.gameObj.y < this.rectT)
  2610. ry = vy;
  2611. else if (this.gameObj.y > this.rectB)
  2612. ry = -vy;
  2613. this.rigy.applyLinearImpulseToCenter({ x: rx, y: ry });
  2614. }
  2615. }
  2616. if (this.number != 0) {
  2617. return;
  2618. }
  2619. else {
  2620. if (this.forceRun) {
  2621. console.log("randon force");
  2622. this.applyForce(collider);
  2623. }
  2624. }
  2625. if (xGame.common.d2World.isOnSameLine) {
  2626. xGame.common.d2World.isOnSameLine = false;
  2627. this.rigy.linearVelocity = { x: 0, y: 0 };
  2628. }
  2629. if (xGame.common.gameMgr.firstColliObj == null) {
  2630. xGame.common.gameMgr.firstColliObj = collider.owner["mySrc"].number;
  2631. xGame.common.gameMgr.isTouchedBall = true;
  2632. }
  2633. }
  2634. else {
  2635. xGame.common.recoverCameraView();
  2636. let wallStr = "";
  2637. if (speed < 9) { }
  2638. else if (speed < sv2) { }
  2639. else if (speed < sv2 * 6.2)
  2640. wallStr = "wall_30";
  2641. else if (speed < sv2 * 25)
  2642. wallStr = "wall_50";
  2643. else if (speed < sv2 * 56)
  2644. wallStr = "wall_80";
  2645. xGame.soundMgr.playSound(wallStr);
  2646. }
  2647. }
  2648. applyForce(collider) {
  2649. let src = collider.owner.mySrc;
  2650. this.forceVec.x = src.gameObj.x - this.gameObj.x;
  2651. this.forceVec.y = src.gameObj.y - this.gameObj.y;
  2652. Laya.Vector2.normalize(this.forceVec, this.forceVec);
  2653. Laya.Vector2.scale(this.forceVec, 50, this.forceVec);
  2654. src.rigy.applyLinearImpulseToCenter({ x: this.forceVec.x, y: this.forceVec.y });
  2655. }
  2656. checkWrongBall(playEft = true) {
  2657. if (this.isInHole)
  2658. return;
  2659. xGame.common.gameMgr.inHoleBalls.push(this.number);
  2660. if (this.number != 0 && playEft)
  2661. this.d3BallSrc.playInHoleEft();
  2662. let coll = "inpocket_1";
  2663. let speed = this.getSpeed();
  2664. let sv2 = this.speedP10 * this.speedP10 * 0.8;
  2665. if (speed < 9 && this.number != 0)
  2666. coll = "";
  2667. else if (speed < sv2 * 6.2)
  2668. coll = "inpocket_4";
  2669. else if (speed < sv2 * 25)
  2670. coll = "collide_3";
  2671. else if (speed < sv2 * 56)
  2672. coll = "collide_2";
  2673. xGame.soundMgr.playSound(coll);
  2674. this.isInHole = true;
  2675. if (this.number == 0) {
  2676. console.log("白球进了。。");
  2677. this.reset();
  2678. this.rigy.linearVelocity = { x: 0, y: 0 };
  2679. this.hideSelf();
  2680. xGame.common.gameUI.ui.whiteAni.visible = true;
  2681. xGame.common.gameUI.ui.whiteAni.t0.play(Laya.Handler.create(this, () => {
  2682. xGame.common.gameUI.ui.whiteAni.visible = false;
  2683. }));
  2684. }
  2685. else {
  2686. xGame.common.playClassicEmotion(this.number, this.gameObj.x, this.gameObj.y);
  2687. xGame.common.d2World.removeOneBall(this);
  2688. this.destroySelf();
  2689. xGame.common.playHappySound(this.number);
  2690. this.runFlyEft();
  2691. }
  2692. }
  2693. runFlyEft() {
  2694. if (xGame.common.gameMode == GameMode.placeBall && xGame.common.gameMgr.placeBallData.type == PlaceBallType.challenge) {
  2695. xGame.common.playAwardSpine(this.gameObj.x + 100, this.gameObj.y - 100);
  2696. }
  2697. }
  2698. hideSelf() {
  2699. if (this.d3Ball)
  2700. this.d3Ball.active = false;
  2701. }
  2702. showSelf() {
  2703. this.isInHole = false;
  2704. if (this.d3Ball && !this.d3Ball.active)
  2705. this.d3Ball.active = true;
  2706. }
  2707. isStill() {
  2708. let speed = this.rigy.linearVelocity;
  2709. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed) {
  2710. this.rigy.linearVelocity = { x: 0, y: 0 };
  2711. return true;
  2712. }
  2713. return false;
  2714. }
  2715. reset() {
  2716. }
  2717. destroySelf() {
  2718. this.d3BallSrc.destroySelf();
  2719. if (!this.ui.isDisposed) {
  2720. this.ui.removeFromParent();
  2721. this.ui.dispose();
  2722. this.ui = null;
  2723. }
  2724. this.outColli = null;
  2725. this.innerColli = null;
  2726. this.rigy = null;
  2727. this.d3Ball = null;
  2728. this.d3BallSrc = null;
  2729. this.angleV2 = null;
  2730. this.gameObj.destroy(true);
  2731. this.destroy();
  2732. }
  2733. judgeBorder() {
  2734. if (this.forceRun && this.owner == xGame.common.d2World.rootBall.owner) {
  2735. return;
  2736. }
  2737. if (this.destroyed)
  2738. return;
  2739. if (xGame.common.gameMode == GameMode.classic)
  2740. return;
  2741. let isOver = xGame.common.checkBallOverBorder(this.gameObj.x, this.gameObj.y);
  2742. if (isOver) {
  2743. this.checkWrongBall();
  2744. }
  2745. }
  2746. onClick(e, force = false) {
  2747. if (this.number == 0)
  2748. return;
  2749. if (force) {
  2750. }
  2751. else {
  2752. if (xGame.common.d2World.openCheckStill)
  2753. return;
  2754. if (!xGame.common.gameMgr.selfTurn) {
  2755. return;
  2756. }
  2757. }
  2758. if (!xGame.common.gameMgr.finishOneShoot)
  2759. return;
  2760. let root = xGame.common.d2World.rootBall.gameObj;
  2761. let x = this.gameObj.x - root.x;
  2762. let y = this.gameObj.y - root.y;
  2763. let angle = xGame.common.getfguiRotation(x, y);
  2764. xGame.common.d2World.d2Gan.ui.rotation = angle;
  2765. xGame.common.d2World.getHelpLine();
  2766. xGame.common.clickedBall = true;
  2767. this.checkGuide();
  2768. }
  2769. checkGuide() {
  2770. let guide = DataMgr.getSkillGuide();
  2771. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) {
  2772. xGame.common.guideStep++;
  2773. xGame.common.gameUI.ui.guide1.visible = false;
  2774. xGame.common.gameUI.ui.guide2.visible = true;
  2775. }
  2776. }
  2777. checkDistance(disX, disY, angle) {
  2778. let diameter = this.gameObj.width - 1;
  2779. let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2);
  2780. if (!this.lastDis)
  2781. this.lastDis = dis;
  2782. else {
  2783. if (dis > this.lastDis) {
  2784. this.helpOut.type = "remove";
  2785. return this.helpOut;
  2786. }
  2787. }
  2788. if (dis <= Math.pow(diameter, 2)) {
  2789. let del = 0.01;
  2790. let offest = 0;
  2791. let realX = disX - this.gameObj.x;
  2792. let realY = disY - this.gameObj.y;
  2793. while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) {
  2794. offest += del;
  2795. realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180);
  2796. realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180);
  2797. }
  2798. this.helpOut.type = "ok";
  2799. this.helpOut.x = realX + this.gameObj.x;
  2800. this.helpOut.y = realY + this.gameObj.y;
  2801. return this.helpOut;
  2802. }
  2803. else {
  2804. this.helpOut.type = "no";
  2805. return this.helpOut;
  2806. }
  2807. }
  2808. clearBallEft() {
  2809. this.clearBallRightEft();
  2810. this.clearBallWrongEft();
  2811. }
  2812. clearBallRightEft() {
  2813. this.ui.breathAni.stop();
  2814. this.ui.rightTips.visible = false;
  2815. }
  2816. clearBallWrongEft() {
  2817. this.ui.wrongTips.visible = false;
  2818. }
  2819. showWrongEft() {
  2820. if (!xGame.common.gameMgr.selfTurn)
  2821. return;
  2822. this.ui.wrongTips.visible = true;
  2823. }
  2824. showRightEft() {
  2825. if (!xGame.common.gameMgr.selfTurn)
  2826. return;
  2827. this.ui.rightTips.visible = true;
  2828. this.ui.rightTips.scaleX = 1;
  2829. this.ui.rightTips.scaleY = 1;
  2830. this.ui.breathAni.play();
  2831. }
  2832. setBallFunc(type, owner) {
  2833. if (type == "ice") {
  2834. this.ballFunc = type;
  2835. this.d3BallSrc.setAlbedoTexture(true);
  2836. this.rigy.type = "static";
  2837. this.iceOwner = owner;
  2838. }
  2839. else {
  2840. if (owner == this.iceOwner) {
  2841. this.ballFunc = type;
  2842. this.d3BallSrc.setAlbedoTexture(false);
  2843. this.rigy.type = "dynamic";
  2844. }
  2845. }
  2846. }
  2847. }
  2848. D2BallSrc._unid = 0;
  2849. class D2RootBallSrc extends D2BallSrc {
  2850. constructor() {
  2851. super();
  2852. this.maxSpeed = 0;
  2853. this.classicMaxSpeed = 2.2;
  2854. this.bigSkillMaxSpeed = 4;
  2855. this.angle = 0;
  2856. this.allPercent = 0;
  2857. this.linearPercent = 0;
  2858. this.anglePercent = 0;
  2859. this.maxAngleRate = 0.6;
  2860. this.baseRot = 7;
  2861. this.angleMax = 0;
  2862. this.speed = new Laya.Vector2();
  2863. this.rotSpeed = new Laya.Vector2();
  2864. }
  2865. isStill() {
  2866. let speed = this.rigy.linearVelocity;
  2867. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) {
  2868. if (this.anglePercent <= 0.1) {
  2869. this.rigy.linearVelocity = { x: 0, y: 0 };
  2870. return true;
  2871. }
  2872. }
  2873. return false;
  2874. }
  2875. reset() {
  2876. this.linearPercent = 0;
  2877. this.anglePercent = 0;
  2878. }
  2879. setSpeed(percent, angle) {
  2880. this.allPercent = percent;
  2881. this.angle = angle;
  2882. this.setAngleSpeed();
  2883. this.setLinearSpeed();
  2884. let hit = "hit";
  2885. if (percent < 25)
  2886. hit = "hit03";
  2887. else if (percent < 50)
  2888. hit = "hit02";
  2889. else if (percent < 75)
  2890. hit = "hit01";
  2891. xGame.soundMgr.playSound(hit);
  2892. }
  2893. setAngleSpeed() {
  2894. let offest = xGame.common.rodOffest;
  2895. let radius = 82;
  2896. let rate = Math.abs(offest.y / radius) * 0.5;
  2897. if (offest.y > 0)
  2898. this.angleMax = -this.baseRot * 2;
  2899. else
  2900. this.angleMax = this.baseRot;
  2901. this.rotY = -offest.x / radius * 100;
  2902. this.anglePercent = this.maxAngleRate * rate * this.allPercent;
  2903. this.linearPercent = this.allPercent - this.anglePercent;
  2904. }
  2905. setLinearSpeed() {
  2906. if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) {
  2907. if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) {
  2908. if (!xGame.common.longHelpLine) {
  2909. let offset = -150 + xGame.common.randomNum(0, 300);
  2910. offset /= 100;
  2911. this.angle += offset;
  2912. }
  2913. }
  2914. }
  2915. let sin = Math.sin(this.angle * Math.PI / 180);
  2916. let cos = Math.cos(this.angle * Math.PI / 180);
  2917. switch (xGame.common.gameMode) {
  2918. case GameMode.classic:
  2919. this.maxSpeed = this.classicMaxSpeed;
  2920. break;
  2921. case GameMode.bigMove:
  2922. this.maxSpeed = this.bigSkillMaxSpeed;
  2923. break;
  2924. case GameMode.placeBall:
  2925. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  2926. if (data.type == 1) {
  2927. this.maxSpeed = this.bigSkillMaxSpeed;
  2928. }
  2929. else {
  2930. this.maxSpeed = this.classicMaxSpeed;
  2931. }
  2932. break;
  2933. default:
  2934. break;
  2935. }
  2936. this.speed.x = this.maxSpeed * this.linearPercent * sin;
  2937. this.speed.y = -this.maxSpeed * this.linearPercent * cos;
  2938. this.rotSpeed.x = -this.angleMax * sin * this.anglePercent;
  2939. this.rotSpeed.y = this.angleMax * cos * this.anglePercent;
  2940. this.rigy.applyLinearImpulseToCenter(this.speed);
  2941. }
  2942. onUpdate() {
  2943. if (this.anglePercent > 0.1) {
  2944. this.anglePercent *= 0.97;
  2945. this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent;
  2946. this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent;
  2947. this.rigy.applyForceToCenter(this.rotSpeed);
  2948. Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed);
  2949. Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed);
  2950. let num = Laya.Vector2.dot(this.speed, this.rotSpeed);
  2951. if (num > 0.9)
  2952. this.canRot = true;
  2953. }
  2954. else
  2955. this.canRot = true;
  2956. if (Math.abs(this.rotY) > 0.1)
  2957. this.rotY *= 0.98;
  2958. super.onUpdate();
  2959. }
  2960. destroySelf() {
  2961. super.destroySelf();
  2962. this.speed = null;
  2963. }
  2964. }
  2965. class D2Ball extends Laya.Sprite {
  2966. constructor(isRootBall = false) {
  2967. super();
  2968. this.ui = ui_D2Ball.createInstance();
  2969. this.pivotX = this.ui.width / 2;
  2970. this.pivotY = this.ui.width / 2;
  2971. this.x = 0;
  2972. this.y = 0;
  2973. this.addChild(this.ui.displayObject);
  2974. this.ui.displayObject.x += this.ui.width / 2;
  2975. this.ui.displayObject.y += this.ui.width / 2;
  2976. if (isRootBall) {
  2977. this.d2Src = this.addComponent(D2RootBallSrc);
  2978. }
  2979. else {
  2980. this.d2Src = this.addComponent(D2BallSrc);
  2981. }
  2982. this.d2Src.ui = this.ui;
  2983. this.addCircleCollider();
  2984. this.addInnerCircleCollider();
  2985. this.addRigyBody();
  2986. }
  2987. addCircleCollider() {
  2988. let colli = xGame.common.getCollider("circle");
  2989. colli.radius = this.ui.width / 2;
  2990. this.addComponentIntance(colli);
  2991. this.d2Src.outColli = colli;
  2992. colli.label = "ball";
  2993. }
  2994. addInnerCircleCollider() {
  2995. let colli = xGame.common.getCollider("circle");
  2996. colli.radius = this.ui.inner.width / 2;
  2997. colli.x = (this.ui.width - this.ui.inner.width) / 2;
  2998. colli.y = (this.ui.width - this.ui.inner.width) / 2;
  2999. this.addComponentIntance(colli);
  3000. this.d2Src.innerColli = colli;
  3001. colli.label = "inner";
  3002. }
  3003. addRigyBody() {
  3004. let rigy = xGame.common.getRigbody();
  3005. rigy.type = "dynamic";
  3006. this.addComponentIntance(rigy);
  3007. this.d2Src.rigy = rigy;
  3008. }
  3009. disposeSelf() {
  3010. if (!this.ui.isDisposed) {
  3011. this.ui.dispose();
  3012. this.ui.removeFromParent();
  3013. this.ui = null;
  3014. }
  3015. }
  3016. }
  3017. class ui_D2Gan extends fgui.GComponent {
  3018. static createInstance() {
  3019. return (fgui.UIPackage.createObject("game", "D2Gan"));
  3020. }
  3021. onConstruct() {
  3022. this.myIcon = (this.getChild("myIcon"));
  3023. this.selfRodIcon = (this.getChild("selfRodIcon"));
  3024. this.selfEftRoot = (this.getChild("selfEftRoot"));
  3025. this.self = (this.getChild("self"));
  3026. this.aiRodIcon = (this.getChild("aiRodIcon"));
  3027. this.aiEftRoot = (this.getChild("aiEftRoot"));
  3028. this.ai = (this.getChild("ai"));
  3029. }
  3030. }
  3031. ui_D2Gan.URL = "ui://isxx5ak7sdh33qp";
  3032. class D2Gan {
  3033. constructor() {
  3034. this.offset = 0.15;
  3035. this.cell = 1.5;
  3036. this.onBallCell = 0.4;
  3037. this.lastInfo = { x: 0, y: 0, rotation: 0 };
  3038. this.moveNum = 70;
  3039. this.rulerRate = 0.1;
  3040. this.ui = ui_D2Gan.createInstance();
  3041. this.changeSelfRod();
  3042. this.changeAIRod();
  3043. }
  3044. changeSelfRod() {
  3045. let index = DataMgr.getCurBallRod();
  3046. let data = cfgTable.ballrodData[index + 1];
  3047. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3048. this.selfMySpine && this.selfMySpine.dispose();
  3049. this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3050. if (data.spine) {
  3051. this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3052. this.selfMySpine = new SpineMgr(data.spine, () => {
  3053. let xx = this.ui.selfEftRoot.width / 2;
  3054. let yy = this.ui.selfEftRoot.height / 2;
  3055. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3056. let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject);
  3057. outSpine.rotation = -90;
  3058. });
  3059. }
  3060. }
  3061. changeAIRod() {
  3062. let length = Object.keys(cfgTable.ballrodData).length;
  3063. let rand = Math.floor(length * Math.random()) + 1;
  3064. let data = cfgTable.ballrodData[rand];
  3065. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3066. this.aiMySpine && this.aiMySpine.dispose();
  3067. this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3068. if (data.spine) {
  3069. this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3070. this.aiMySpine = new SpineMgr(data.spine, () => {
  3071. let xx = this.ui.aiEftRoot.width / 2;
  3072. let yy = this.ui.aiEftRoot.height / 2;
  3073. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3074. let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject);
  3075. outSpine.rotation = -90;
  3076. });
  3077. }
  3078. }
  3079. setGanLastInfo() {
  3080. this.lastInfo.rotation = this.ui.rotation;
  3081. this.lastInfo.x = this.ui.x;
  3082. this.lastInfo.y = this.ui.y;
  3083. }
  3084. rotateSelf(flag, isRuler = false) {
  3085. let angle;
  3086. flag = flag * this.offset;
  3087. if (xGame.common.d2World.isHelpLineOnBall) {
  3088. angle = flag * this.onBallCell;
  3089. }
  3090. else {
  3091. angle = flag * this.cell;
  3092. }
  3093. if (isRuler) {
  3094. angle *= this.rulerRate;
  3095. }
  3096. this.ui.rotation += angle;
  3097. xGame.common.d2World.getHelpLine();
  3098. }
  3099. checkDistance() {
  3100. let target = xGame.common.d2World.targetBall;
  3101. let root = xGame.common.d2World.rootBall;
  3102. if (target == null) {
  3103. return 1;
  3104. }
  3105. let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2);
  3106. if (dis <= 2500) {
  3107. return 5;
  3108. }
  3109. return 1;
  3110. }
  3111. rotDest(rot) {
  3112. this.ui.rotation = rot;
  3113. xGame.common.d2World.getHelpLine();
  3114. }
  3115. storagePower(powerNum) {
  3116. let pos = (powerNum / 100) * this.moveNum;
  3117. let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos;
  3118. let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos;
  3119. this.ui.x = this.lastInfo.x + xx;
  3120. this.ui.y = this.lastInfo.y + yy;
  3121. }
  3122. shoot() {
  3123. this.storagePower(0);
  3124. this.ui.visible = false;
  3125. }
  3126. destroySelf() {
  3127. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3128. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3129. this.selfMySpine && this.selfMySpine.dispose();
  3130. this.aiMySpine && this.aiMySpine.dispose();
  3131. this.lastInfo = null;
  3132. if (!this.ui.isDisposed) {
  3133. this.ui.removeFromParent();
  3134. this.ui.dispose();
  3135. }
  3136. }
  3137. }
  3138. class ui_HelpLine extends fgui.GComponent {
  3139. static createInstance() {
  3140. return (fgui.UIPackage.createObject("game", "HelpLine"));
  3141. }
  3142. onConstruct() {
  3143. this.n10 = (this.getChild("n10"));
  3144. this.rect = (this.getChild("rect"));
  3145. this.dir11 = (this.getChild("dir11"));
  3146. this.dir = (this.getChild("dir"));
  3147. this.rootDir = (this.getChild("rootDir"));
  3148. this.dirDot = (this.getChild("dirDot"));
  3149. }
  3150. }
  3151. ui_HelpLine.URL = "ui://isxx5ak7sdh33qs";
  3152. class D2HelpLine {
  3153. constructor() {
  3154. this.starX = 0;
  3155. this.starY = 0;
  3156. this.ui = ui_HelpLine.createInstance();
  3157. xGame.common.gameUI.ui.ballNode.addChild(this.ui);
  3158. this.starX = this.ui.rect.x;
  3159. this.starY = this.ui.rect.y;
  3160. }
  3161. shoot() {
  3162. this.ui.visible = false;
  3163. }
  3164. destroySelf() {
  3165. if (this.ui.isDisposed) {
  3166. this.ui.removeFromParent();
  3167. this.ui.dispose();
  3168. }
  3169. }
  3170. }
  3171. class D2World extends Laya.Script {
  3172. constructor() {
  3173. super();
  3174. this.ballArr = [];
  3175. this.openCheckStill = false;
  3176. this.checkArr = [];
  3177. this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 };
  3178. this.isHelpLineOnBall = false;
  3179. this.isOnSameLine = false;
  3180. this.reflectAngle = 0;
  3181. this.powerPercent = 0;
  3182. this.inHolesSpeed = [];
  3183. this.outDir = new Laya.Vector2();
  3184. this.rootDir = new Laya.Vector2();
  3185. this.aiLv = 0;
  3186. this.rootPos = new Laya.Vector2();
  3187. this.tempDir1 = new Laya.Vector2();
  3188. this.tempDir2 = new Laya.Vector2();
  3189. this.tempDir3 = new Laya.Vector2();
  3190. this.ballSize = 33;
  3191. this.destRot = 0;
  3192. }
  3193. initSelf() {
  3194. this.createBalls();
  3195. xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop);
  3196. xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop);
  3197. xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot);
  3198. xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot);
  3199. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  3200. }
  3201. setBorderRect() {
  3202. let ui = xGame.common.gameUI.ui;
  3203. let starX = ui.border.bar5.x + ui.border.bar5.width / 2;
  3204. let starY = ui.border.bar1.y + ui.border.bar1.height / 2;
  3205. let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width);
  3206. let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height);
  3207. this.borderRect.x = starX;
  3208. this.borderRect.y = starY;
  3209. this.borderRect.width = width;
  3210. this.borderRect.height = height;
  3211. }
  3212. resetGame() {
  3213. this.openCheckStill = false;
  3214. let temp;
  3215. for (let index = 0; index < this.ballArr.length; index++) {
  3216. temp = this.ballArr[index];
  3217. temp.destroySelf();
  3218. }
  3219. xGame.common.d3World.ballRoot.destroyChildren();
  3220. xGame.common.gameUI.ui.ballNode.removeChildren();
  3221. console.log("进入摧毁逻辑");
  3222. this.d2Gan.destroySelf();
  3223. this.d2HelpLine.destroySelf();
  3224. this.ballArr = [];
  3225. }
  3226. setD2Gan() {
  3227. let ballNode = this.rootBall.ui;
  3228. let d2Gan = new D2Gan();
  3229. this.d2Gan = d2Gan;
  3230. let ganNode = d2Gan.ui;
  3231. ballNode.addChild(ganNode);
  3232. ganNode.pivotX = ganNode.pivotX;
  3233. ganNode.pivotY = ganNode.pivotY;
  3234. ganNode.x = ganNode.myIcon.width / 2;
  3235. ganNode.y = this.rootBall.gameObj.width;
  3236. d2Gan.setGanLastInfo();
  3237. }
  3238. setHelpLine() {
  3239. let d2Help = new D2HelpLine();
  3240. this.d2HelpLine = d2Help;
  3241. }
  3242. createBalls() {
  3243. let cfg;
  3244. switch (xGame.common.gameMode) {
  3245. case GameMode.classic:
  3246. cfg = xGame.cfgMgr.getRandomClassicLevel();
  3247. break;
  3248. case GameMode.bigMove:
  3249. cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex);
  3250. break;
  3251. case GameMode.placeBall:
  3252. cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel);
  3253. break;
  3254. default:
  3255. break;
  3256. }
  3257. cfg = JSON.parse(JSON.stringify(cfg));
  3258. for (const key in cfg) {
  3259. if (cfg[key].value == 0) {
  3260. this.createRootBall(cfg[key]);
  3261. delete cfg[key];
  3262. break;
  3263. }
  3264. }
  3265. this.createOtherBalls(cfg);
  3266. }
  3267. createRootBall(data) {
  3268. let root = new D2Ball(true);
  3269. xGame.common.gameUI.ui.ballNode.displayObject.addChild(root);
  3270. this.rootBall = root.d2Src;
  3271. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3272. let d3BallSrc = d3Ball.getComponent(Ball);
  3273. xGame.common.d3World.rootBall = d3Ball;
  3274. xGame.common.d3World.rootBallSrc = d3BallSrc;
  3275. let xx = data.x;
  3276. let yy = data.y;
  3277. let numer = data.value;
  3278. xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy);
  3279. this.rootBall.initSelf(numer, xx, yy, d3Ball);
  3280. this.ballArr.push(this.rootBall);
  3281. this.setD2Gan();
  3282. this.setHelpLine();
  3283. }
  3284. createOtherBalls(cfg) {
  3285. let temp;
  3286. let src;
  3287. let data;
  3288. for (const key in cfg) {
  3289. data = cfg[key];
  3290. temp = new D2Ball();
  3291. xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp);
  3292. src = temp.d2Src;
  3293. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3294. src.initSelf(data.value, data.x, data.y, d3Ball);
  3295. this.ballArr.push(src);
  3296. }
  3297. }
  3298. shoot(percent) {
  3299. this.powerPercent = percent;
  3300. this.openCheckStill = true;
  3301. let d2Angle = this.d2Gan.ui.rotation;
  3302. this.rootBall.setSpeed(percent, d2Angle);
  3303. this.clearBallAllEft();
  3304. this.changePlayerView();
  3305. }
  3306. onUpdate() {
  3307. if (!this.openCheckStill)
  3308. return;
  3309. this.checkStill();
  3310. }
  3311. checkStill() {
  3312. for (let index = 0; index < this.ballArr.length; index++) {
  3313. if (!this.ballArr[index].isStill()) {
  3314. return;
  3315. }
  3316. }
  3317. xGame.eventMgr.event(ALL_BALL_STOP);
  3318. }
  3319. allBallStop() {
  3320. this.openCheckStill = false;
  3321. xGame.common.recoverCameraView();
  3322. }
  3323. waitShoot() {
  3324. if (!this.d2Gan.ui.isDisposed) {
  3325. this.d2Gan.ui.visible = true;
  3326. }
  3327. if (!this.d2HelpLine.ui.isDisposed) {
  3328. this.d2HelpLine.ui.visible = true;
  3329. }
  3330. this.clearBallAllEft();
  3331. this.showBallRightEft();
  3332. this.getHelpLine();
  3333. this.inHolesSpeed = [];
  3334. this.selectOneBall();
  3335. }
  3336. _getAllBallArr() {
  3337. let arr = this.ballArr;
  3338. let outArr = [];
  3339. for (let index = 0; index < arr.length; index++) {
  3340. if (arr[index] instanceof D2RootBallSrc)
  3341. continue;
  3342. if (arr[index].ballFunc == "ice")
  3343. continue;
  3344. if (arr[index].destroyed)
  3345. continue;
  3346. outArr.push(arr[index]);
  3347. }
  3348. return outArr;
  3349. }
  3350. _getBlackObj() {
  3351. let arr = this.ballArr;
  3352. for (let index = 0; index < arr.length; index++) {
  3353. if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) {
  3354. return arr[index];
  3355. }
  3356. }
  3357. }
  3358. selectOneBall() {
  3359. let all = this._getAllBallArr();
  3360. let target;
  3361. switch (xGame.common.gameMode) {
  3362. case GameMode.classic:
  3363. if (xGame.common.gameMgr.selfTurn) {
  3364. let self = xGame.common.gameMgr.selfBallArr;
  3365. let black = this._getBlackObj();
  3366. if (xGame.common.gameMgr.ensureBallType) {
  3367. if (self.length > 0) {
  3368. let out = [];
  3369. for (let j = 0; j < all.length; j++) {
  3370. if (self.indexOf(all[j].number) > -1) {
  3371. out.push(all[j]);
  3372. }
  3373. }
  3374. target = this.selectBestEnterOne(out);
  3375. }
  3376. else {
  3377. target = this.selectBestEnterOne([black]);
  3378. }
  3379. }
  3380. else {
  3381. target = this.selectBestEnterOne(all);
  3382. }
  3383. }
  3384. else {
  3385. target = this.selectBestEnterOne(all);
  3386. }
  3387. break;
  3388. case GameMode.bigMove:
  3389. target = this.selectBestEnterOne(all);
  3390. break;
  3391. case GameMode.placeBall:
  3392. if (all.length > 0) {
  3393. target = this.selectBestEnterOne(all);
  3394. }
  3395. break;
  3396. default:
  3397. break;
  3398. }
  3399. if (target && !target.destroyed && target.onClick) {
  3400. target.onClick(0, true);
  3401. let num = -200 + xGame.common.randomNum(0, 400);
  3402. num /= 150;
  3403. if (xGame.common.longHelpLine) {
  3404. num = 0;
  3405. }
  3406. this.destRot += num;
  3407. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  3408. }
  3409. }
  3410. removeOneBall(ball) {
  3411. for (let index = 0; index < this.ballArr.length; index++) {
  3412. if (this.ballArr[index].id == ball.id) {
  3413. this.ballArr.splice(index, 1);
  3414. break;
  3415. }
  3416. }
  3417. }
  3418. getHelpLine() {
  3419. this.d2HelpLine.ui.dirDot.visible = false;
  3420. this.isOnSameLine = false;
  3421. let startX = this.rootBall.gameObj.x;
  3422. let startY = this.rootBall.gameObj.y;
  3423. let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation);
  3424. if (dis == null) {
  3425. this.d2HelpLine.ui.visible = false;
  3426. console.error("辅助线异常");
  3427. return;
  3428. }
  3429. this.d2HelpLine.ui.visible = true;
  3430. let angle = this.d2Gan.ui.rotation;
  3431. let radius = 16.5;
  3432. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3433. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3434. let colliObj = xGame.common.isBlock(startX, startY, disX, disY);
  3435. if (colliObj == null) {
  3436. this.getColliPos(disX, disY, radius, angle);
  3437. xGame.common.d2World.isHelpLineOnBall = false;
  3438. this.targetBall = null;
  3439. this.reflectAngle = 0;
  3440. this.showBallWrongEft();
  3441. }
  3442. else {
  3443. let target = colliObj.src;
  3444. let radius = 16.5;
  3445. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3446. dis1 = Math.sqrt(dis1);
  3447. let realDis = colliObj.disHon - dis1;
  3448. let dir = colliObj.dir;
  3449. let xx = startX + dir.x * realDis;
  3450. let yy = startY + dir.y * realDis;
  3451. this.getColliPos(xx, yy, radius, angle);
  3452. let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180;
  3453. if (Math.abs(reflectAngle - angle) <= 0.02) {
  3454. let offset = xGame.common.rodOffest;
  3455. if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1)
  3456. this.isOnSameLine = true;
  3457. }
  3458. this.getRootDirLine(reflectAngle, angle, xx, yy, target);
  3459. xGame.common.d2World.isHelpLineOnBall = true;
  3460. this.targetBall = target;
  3461. this.reflectAngle = reflectAngle;
  3462. this.showBallWrongEft();
  3463. if (xGame.common.longHelpLine) {
  3464. this.delayReflectLine(target, reflectAngle);
  3465. }
  3466. }
  3467. }
  3468. getBorderDot(startX, startY, angle) {
  3469. let radius = 17;
  3470. let distance;
  3471. let isDone;
  3472. distance = -(this.borderRect.y - startY + radius) / Math.cos(angle * Math.PI / 180);
  3473. isDone = this.judgeUpDown(distance, angle, startX);
  3474. if (isDone != null) {
  3475. return isDone;
  3476. }
  3477. distance = -(this.borderRect.y + this.borderRect.height - startY - radius) / Math.cos(angle * Math.PI / 180);
  3478. isDone = this.judgeUpDown(distance, angle, startX);
  3479. if (isDone != null) {
  3480. return isDone;
  3481. }
  3482. distance = (this.borderRect.x - startX + radius) / Math.sin(angle * Math.PI / 180);
  3483. isDone = this.judgeLeftRight(distance, angle, startY);
  3484. if (isDone != null) {
  3485. return isDone;
  3486. }
  3487. distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180);
  3488. isDone = this.judgeLeftRight(distance, angle, startY);
  3489. if (isDone != null) {
  3490. return isDone;
  3491. }
  3492. }
  3493. judgeUpDown(distance, angle, startX) {
  3494. let flag = Math.sin(angle * Math.PI / 180);
  3495. let temp = startX + distance * Math.sin(angle * Math.PI / 180);
  3496. if (distance >= 0) {
  3497. if (flag > 0) {
  3498. if (temp < this.borderRect.x + this.borderRect.width) {
  3499. return distance;
  3500. }
  3501. }
  3502. else {
  3503. if (temp > this.borderRect.x) {
  3504. return distance;
  3505. }
  3506. }
  3507. }
  3508. }
  3509. judgeLeftRight(distance, angle, starY) {
  3510. let flag = -Math.cos(angle * Math.PI / 180);
  3511. let temp = starY + distance * -Math.cos(angle * Math.PI / 180);
  3512. if (distance >= 0) {
  3513. if (flag > 0) {
  3514. if (temp < this.borderRect.y + this.borderRect.height) {
  3515. return distance;
  3516. }
  3517. }
  3518. else {
  3519. if (temp > this.borderRect.y) {
  3520. return distance;
  3521. }
  3522. }
  3523. }
  3524. }
  3525. clearBallAllEft() {
  3526. let temp;
  3527. for (let index = 0; index < this.ballArr.length; index++) {
  3528. temp = this.ballArr[index];
  3529. temp.clearBallEft();
  3530. }
  3531. }
  3532. showBallRightEft() {
  3533. let gameMgr = xGame.common.gameMgr;
  3534. let temp;
  3535. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3536. if (targetArr.length <= 0)
  3537. return;
  3538. for (let index = 0; index < this.ballArr.length; index++) {
  3539. temp = this.ballArr[index];
  3540. if (targetArr.indexOf(temp.number) > -1) {
  3541. temp.showRightEft();
  3542. }
  3543. }
  3544. }
  3545. showBallWrongEft() {
  3546. let gameMgr = xGame.common.gameMgr;
  3547. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3548. if (targetArr.length <= 0)
  3549. return;
  3550. let temp;
  3551. for (let index = 0; index < this.ballArr.length; index++) {
  3552. temp = this.ballArr[index];
  3553. if (this.targetBall && this.targetBall.number == temp.number) {
  3554. if (targetArr.indexOf(temp.number) <= -1) {
  3555. temp.showWrongEft();
  3556. }
  3557. else {
  3558. temp.clearBallWrongEft();
  3559. }
  3560. }
  3561. else {
  3562. temp.clearBallWrongEft();
  3563. }
  3564. }
  3565. }
  3566. getColliPos(x, y, radius, angle) {
  3567. this.d2HelpLine.ui.x = x;
  3568. this.d2HelpLine.ui.y = y;
  3569. let dirX = x - this.rootBall.gameObj.x;
  3570. let dirY = y - this.rootBall.gameObj.y;
  3571. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3572. if (rectH <= 0)
  3573. rectH = 0;
  3574. this.d2HelpLine.ui.rect.height = 0;
  3575. this.d2HelpLine.ui.rect.height = rectH;
  3576. this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY);
  3577. if (rectH < this.rootBall.gameObj.width) {
  3578. this.d2HelpLine.ui.rect.visible = false;
  3579. }
  3580. else {
  3581. this.d2HelpLine.ui.rect.visible = true;
  3582. }
  3583. this.d2HelpLine.ui.dir.visible = false;
  3584. this.d2HelpLine.ui.rootDir.visible = false;
  3585. }
  3586. getReflectLine(x, y, radius, target) {
  3587. this.d2HelpLine.ui.dir.visible = true;
  3588. let dirX = target.x - x;
  3589. let dirY = target.y - y;
  3590. let angle = xGame.common.getfguiRotation(dirX, dirY) + 180;
  3591. this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX;
  3592. this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY;
  3593. this.d2HelpLine.ui.dir.height = 48;
  3594. this.d2HelpLine.ui.dir.rotation = angle;
  3595. this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180);
  3596. this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180);
  3597. return angle;
  3598. }
  3599. getRootDirLine(angle, rodAngle, xx, yy, target) {
  3600. let rtX = xGame.common.d2World.rootBall.gameObj.x;
  3601. let rtY = xGame.common.d2World.rootBall.gameObj.y;
  3602. let targetX = target.gameObj.x;
  3603. let targetY = target.gameObj.y;
  3604. this.outDir.setValue(targetX - xx, targetY - yy);
  3605. this.rootDir.setValue(rtX - xx, rtY - yy);
  3606. let ver = Math.PI / 2;
  3607. let sin = Math.sin(ver);
  3608. let cos = Math.cos(ver);
  3609. let outX = this.outDir.x * cos - this.outDir.y * sin;
  3610. let outY = this.outDir.x * sin + this.outDir.y * cos;
  3611. this.outDir.setValue(outX, outY);
  3612. Laya.Vector2.normalize(this.rootDir, this.rootDir);
  3613. Laya.Vector2.normalize(this.outDir, this.outDir);
  3614. let result = Laya.Vector2.dot(this.rootDir, this.outDir);
  3615. if (Math.abs(result) <= 0.08) {
  3616. this.d2HelpLine.ui.rootDir.visible = false;
  3617. return;
  3618. }
  3619. if (result > 0) {
  3620. angle += 90;
  3621. }
  3622. else if (result < 0) {
  3623. angle -= 90;
  3624. }
  3625. this.d2HelpLine.ui.rootDir.visible = true;
  3626. this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX;
  3627. this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY;
  3628. this.d2HelpLine.ui.rootDir.rotation = angle;
  3629. }
  3630. delayReflectLine(obj, angle) {
  3631. if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) {
  3632. return;
  3633. }
  3634. this.isOnSameLine = false;
  3635. let startX = obj.gameObj.x;
  3636. let startY = obj.gameObj.y;
  3637. let dis = this.getBorderDot(startX, startY, angle);
  3638. if (dis == null) {
  3639. this.d2HelpLine.ui.dirDot.visible = false;
  3640. return;
  3641. }
  3642. this.d2HelpLine.ui.visible = true;
  3643. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3644. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3645. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, obj);
  3646. if (colliObj == null) {
  3647. this.setDelayLine(disX, disY, obj, angle);
  3648. }
  3649. else {
  3650. let radius = 16;
  3651. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3652. dis1 = Math.sqrt(dis1);
  3653. let realDis = colliObj.disHon - dis1;
  3654. let dir = colliObj.dir;
  3655. let xx = startX + dir.x * realDis;
  3656. let yy = startY + dir.y * realDis;
  3657. this.setDelayLine(xx, yy, obj, angle);
  3658. }
  3659. }
  3660. setDelayLine(x, y, obj, angle) {
  3661. let dirX = x - obj.gameObj.x;
  3662. let dirY = y - obj.gameObj.y;
  3663. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3664. if (rectH <= 0)
  3665. rectH = 0;
  3666. this.d2HelpLine.ui.dir.height = rectH;
  3667. this.d2HelpLine.ui.dirDot.visible = true;
  3668. this.d2HelpLine.ui.dirDot.x = 17;
  3669. this.d2HelpLine.ui.dirDot.y = 17;
  3670. this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180);
  3671. ;
  3672. this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180);
  3673. }
  3674. changePlayerView() {
  3675. if (Math.random() >= 0.7)
  3676. return;
  3677. if (!this.targetBall) {
  3678. return;
  3679. }
  3680. if (!xGame.common.gameMgr.selfTurn)
  3681. return;
  3682. switch (xGame.common.gameMode) {
  3683. case GameMode.classic:
  3684. if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) {
  3685. if (this.targetBall.number != 8) {
  3686. return;
  3687. }
  3688. }
  3689. break;
  3690. case GameMode.bigMove:
  3691. return;
  3692. case GameMode.placeBall:
  3693. break;
  3694. default:
  3695. break;
  3696. }
  3697. let startX = this.targetBall.gameObj.x;
  3698. let startY = this.targetBall.gameObj.y;
  3699. let angle = this.reflectAngle;
  3700. let dis = this.getBorderDot(startX, startY, angle);
  3701. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3702. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3703. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall);
  3704. if (colliObj) {
  3705. return;
  3706. }
  3707. let offset = 40;
  3708. let posObj = xGame.common.gameMgr.posObj;
  3709. let temp;
  3710. let radius;
  3711. let tarX, tarY;
  3712. for (const key in posObj) {
  3713. temp = posObj[key];
  3714. radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5);
  3715. tarX = startX + radius * Math.sin(angle * Math.PI / 180);
  3716. tarY = startY + radius * -Math.cos(angle * Math.PI / 180);
  3717. if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) {
  3718. xGame.common.showOneCamera("angle" + key);
  3719. xGame.common.gameUI.ui.d2Node.alpha = 0;
  3720. Laya.physicsTimer.scale = 0.7;
  3721. break;
  3722. }
  3723. }
  3724. }
  3725. selectBestEnterOne(arr) {
  3726. this.aiLv = xGame.tools.random(1, 11);
  3727. this.aiLv = 10;
  3728. this.wBall = xGame.common.d2World.rootBall;
  3729. this.rootPos.x = this.wBall.gameObj.x;
  3730. this.rootPos.y = this.wBall.gameObj.y;
  3731. this.initHoleBall(arr);
  3732. return this.selectBall();
  3733. }
  3734. selectBall() {
  3735. let ball = null;
  3736. this.destRot = 0;
  3737. let ai = 110 - this.aiLv * 10;
  3738. let mis = xGame.tools.random(-ai, ai) * 0.005;
  3739. let score = false;
  3740. if (this.scoreBall.length < 1) {
  3741. if (this.lineBall.length < 1) {
  3742. for (let i = 0; i < this.kickBall.length; i++) {
  3743. let list = [];
  3744. let bo = this.kickBall[i];
  3745. let bobj = bo.gameObj;
  3746. let rect = xGame.common.d2World.borderRect;
  3747. let mobj = this.wBall.gameObj;
  3748. let minb = bobj.y - rect.y - 20;
  3749. let minw = mobj.y - rect.y - 50;
  3750. if (minb > 0 && minw > 0) {
  3751. let dlenx = 0;
  3752. let dleny = mobj.y - rect.y;
  3753. let spx = mobj.x;
  3754. let spy = rect.y - dleny;
  3755. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3756. }
  3757. minb = rect.y + rect.height - bobj.y - 20;
  3758. minw = rect.y + rect.height - mobj.y - 50;
  3759. if (minb > 0 && minw > 0) {
  3760. let dlenx = 0;
  3761. let dleny = rect.y + rect.height - mobj.y;
  3762. let spx = mobj.x;
  3763. let spy = rect.y + rect.height + dleny;
  3764. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3765. }
  3766. minb = bobj.x - rect.x - 20;
  3767. minw = mobj.x - rect.x - 50;
  3768. if (minb > 0 && minw > 0) {
  3769. let dlenx = mobj.x - rect.x;
  3770. let dleny = 0;
  3771. let spx = rect.x - dlenx;
  3772. let spy = mobj.y;
  3773. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3774. }
  3775. minb = rect.x + rect.width - bobj.x - 20;
  3776. minw = rect.x + rect.width - mobj.x - 50;
  3777. if (minb > 0 && minw > 0) {
  3778. let dlenx = rect.x + rect.width - mobj.x;
  3779. let dleny = 0;
  3780. let spx = rect.x + rect.width + dlenx;
  3781. let spy = mobj.y;
  3782. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3783. }
  3784. list.sort(function (a, b) {
  3785. return a.order - b.order;
  3786. });
  3787. for (let i = 0; i < list.length; i++) {
  3788. let data = list[i];
  3789. let mx = mobj.x - bobj.x;
  3790. let my = mobj.y - bobj.y;
  3791. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  3792. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  3793. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3794. if (num > 1)
  3795. num = 1;
  3796. let cos = Math.acos(num);
  3797. if (cos > 1.57)
  3798. cos = 1.57;
  3799. else if (cos < 0.01)
  3800. cos = 0.01;
  3801. let tan = Math.tan(cos);
  3802. let dx = tan * data.dleny;
  3803. let dy = tan * data.dlenx;
  3804. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  3805. if (Math.abs(bx - 667) < 40)
  3806. continue;
  3807. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  3808. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  3809. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  3810. this.forceMax = dis * 0.08;
  3811. this.destRot += mis * 0.1;
  3812. this.setKick(bx, by);
  3813. return true;
  3814. }
  3815. }
  3816. }
  3817. }
  3818. else {
  3819. ball = xGame.common.getRandArrEle(this.lineBall);
  3820. }
  3821. }
  3822. else {
  3823. for (let i = 0; i < this.scoreBall.length; i++) {
  3824. if (i < this.scoreBall.length - 1) {
  3825. let rand = 70 + this.aiLv * 10 + i * 10;
  3826. if (xGame.tools.random(0, 100) < rand) {
  3827. ball = this.scoreBall[i];
  3828. break;
  3829. }
  3830. }
  3831. else {
  3832. ball = this.scoreBall[i];
  3833. break;
  3834. }
  3835. }
  3836. score = true;
  3837. this.selectNum++;
  3838. }
  3839. if (!ball)
  3840. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  3841. let dx = ball.gameObj.x;
  3842. let dy = ball.gameObj.y;
  3843. let kickAngle = 0;
  3844. if (score) {
  3845. dx = ball.kickPos.x;
  3846. dy = ball.kickPos.y;
  3847. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  3848. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  3849. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  3850. if (adot > 1)
  3851. adot = 1;
  3852. kickAngle = Math.acos(adot) * 57.3;
  3853. if (kickAngle > 45) {
  3854. let kdx = ball.kickPos.x - ball.gameObj.x;
  3855. let kdy = ball.kickPos.y - ball.gameObj.y;
  3856. dx = ball.kickPos.x - kdx * mis * 0.3;
  3857. dy = ball.kickPos.y - kdy * mis * 0.3;
  3858. }
  3859. else
  3860. this.destRot += mis;
  3861. }
  3862. else if (ball.poleAngle != 0) {
  3863. this.destRot += ball.poleAngle;
  3864. }
  3865. if (xGame.common.gameMode == 0) {
  3866. let af = kickAngle * 0.08;
  3867. this.forceMax = ball.hard * 0.1 + af * af;
  3868. }
  3869. this.setKick(dx, dy);
  3870. return ball;
  3871. }
  3872. initHoleBall(arr) {
  3873. this.kickBall = [];
  3874. this.lineBall = [];
  3875. this.scoreBall = [];
  3876. this.holeBall = [];
  3877. this.selectNum = 0;
  3878. this.forceNum = 0;
  3879. this.forceMax = 0;
  3880. this.turnNum = 0;
  3881. let list = arr;
  3882. let holes = xGame.common.gameMgr.holePosList;
  3883. let self = xGame.common.aiPlayer;
  3884. for (let i = 0; i < list.length; i++) {
  3885. let obj = list[i];
  3886. if (!obj)
  3887. continue;
  3888. obj.kickPos.x = 0;
  3889. obj.kickPos.y = 0;
  3890. obj.poleAngle = 0;
  3891. obj.hard = 0;
  3892. obj.borderDis = 0;
  3893. obj.kickAngle = 180;
  3894. let b = obj.gameObj;
  3895. let wbp = this.rootPos;
  3896. let bx = wbp.x - b.x;
  3897. let by = wbp.y - b.y;
  3898. obj.borderDis = xGame.tools.random(0, 100);
  3899. this.kickBall.push(obj);
  3900. if (!this.isLine(wbp, obj))
  3901. continue;
  3902. obj.kickAngle = xGame.tools.random(90, 180);
  3903. obj.kickPos.x = b.x;
  3904. obj.kickPos.y = b.y;
  3905. this.lineBall.push(obj);
  3906. let minDis = 999999;
  3907. let hole = false;
  3908. for (let j = 0; j < holes.length; j++) {
  3909. let hp = holes[j];
  3910. if (bx >= 0 && hp.x > b.x + 100)
  3911. continue;
  3912. if (bx <= 0 && hp.x < b.x - 100)
  3913. continue;
  3914. if (by < -10 && hp.y < wbp.y)
  3915. continue;
  3916. if (by > 10 && hp.y > wbp.y)
  3917. continue;
  3918. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  3919. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  3920. if (dis < minDis) {
  3921. let dx = b.x - this.tempDir1.x * this.ballSize;
  3922. let dy = b.y - this.tempDir1.y * this.ballSize;
  3923. this.tempDir3.x = this.tempDir1.x;
  3924. this.tempDir3.y = this.tempDir1.y;
  3925. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  3926. obj.kickPos.x = dx;
  3927. obj.kickPos.y = dy;
  3928. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  3929. if (num > 1)
  3930. num = 1;
  3931. obj.kickAngle = Math.acos(num) * 57.3;
  3932. if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2)
  3933. dis = dis * 2;
  3934. if (Math.abs(hp.x - 600) < 100)
  3935. dis += 50;
  3936. obj.hard = dis + obj.kickAngle * 3;
  3937. hole = true;
  3938. }
  3939. }
  3940. }
  3941. }
  3942. if (hole) {
  3943. this.scoreBall.push(obj);
  3944. this.holeBall.push(obj);
  3945. }
  3946. }
  3947. this.scoreBall.sort(function (a, b) {
  3948. return a.hard - b.hard;
  3949. });
  3950. this.holeBall.sort(function (a, b) {
  3951. return a.kickAngle - b.kickAngle;
  3952. });
  3953. this.kickBall.sort(function (a, b) {
  3954. return a.borderDis - b.borderDis;
  3955. });
  3956. }
  3957. isBlock(bn, bx, by, hx, hy, dn = -1) {
  3958. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  3959. let balls = xGame.common.d2World.ballArr;
  3960. let max = xGame.tools.getDis(hx, hy, bx, by);
  3961. for (let index = 0; index < balls.length; index++) {
  3962. let obj = balls[index];
  3963. if (obj.number == 0)
  3964. continue;
  3965. if (obj.number == bn || obj.number == dn)
  3966. continue;
  3967. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  3968. if (dis * dis > max)
  3969. continue;
  3970. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  3971. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3972. if (num > 1)
  3973. num = 1;
  3974. if (num < 0)
  3975. continue;
  3976. let gap = Math.sin(Math.acos(num)) * dis;
  3977. if (gap < this.ballSize)
  3978. return true;
  3979. }
  3980. return false;
  3981. }
  3982. isLine(xy, ball) {
  3983. let bx = xy.x;
  3984. let by = xy.y;
  3985. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  3986. let dis = ball.getDestDis(xy);
  3987. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  3988. let sin = Math.sin(angle);
  3989. let cos = Math.cos(angle);
  3990. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  3991. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  3992. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  3993. let dx = bx + this.tempDir2.x * dis;
  3994. let dy = by + this.tempDir2.y * dis;
  3995. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  3996. sin = Math.sin(-angle);
  3997. cos = Math.cos(-angle);
  3998. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  3999. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4000. dx = bx + this.tempDir2.x * dis;
  4001. dy = by + this.tempDir2.y * dis;
  4002. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  4003. if (isr && isl)
  4004. return false;
  4005. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  4006. }
  4007. return true;
  4008. }
  4009. setKick(dx, dy) {
  4010. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  4011. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4012. this.tempDir1.x = 0;
  4013. this.tempDir1.y = 1;
  4014. this.tempDir2.y = -this.tempDir2.y;
  4015. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4016. if (num > 1)
  4017. num = 1;
  4018. let rot = Math.acos(num) * 57.3;
  4019. if (this.tempDir2.x < 0)
  4020. rot = 360 - rot;
  4021. this.destRot += rot;
  4022. }
  4023. }
  4024. class ui_UIGame extends fgui.GComponent {
  4025. static createInstance() {
  4026. return (fgui.UIPackage.createObject("game", "UIGame"));
  4027. }
  4028. onConstruct() {
  4029. this.c1 = this.getController("c1");
  4030. this.d3Root = (this.getChild("d3Root"));
  4031. this.clickNode = (this.getChild("clickNode"));
  4032. this.d2Root = (this.getChild("d2Root"));
  4033. this.topNode = (this.getChild("topNode"));
  4034. this.n72 = (this.getChild("n72"));
  4035. this.n40 = (this.getChild("n40"));
  4036. this.rulerNode = (this.getChild("rulerNode"));
  4037. this.rulerClickNode = (this.getChild("rulerClickNode"));
  4038. this.n50 = (this.getChild("n50"));
  4039. this.keduNode = (this.getChild("keduNode"));
  4040. this.powerTxt = (this.getChild("powerTxt"));
  4041. this.powerNode = (this.getChild("powerNode"));
  4042. this.colorNode = (this.getChild("colorNode"));
  4043. this.powerEft = (this.getChild("powerEft"));
  4044. this.myPowerNode = (this.getChild("myPowerNode"));
  4045. this.ganNode = (this.getChild("ganNode"));
  4046. this.rodMethodNode = (this.getChild("rodMethodNode"));
  4047. this.placeChallengeNode = (this.getChild("placeChallengeNode"));
  4048. this.placeNormalNode = (this.getChild("placeNormalNode"));
  4049. this.skillRod = (this.getChild("skillRod"));
  4050. this.border = (this.getChild("border"));
  4051. this.bigSkillNode = (this.getChild("bigSkillNode"));
  4052. this.classicWorldsNode = (this.getChild("classicWorldsNode"));
  4053. this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode"));
  4054. this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode"));
  4055. this.awardSpineNode = (this.getChild("awardSpineNode"));
  4056. this.guanyuNode = (this.getChild("guanyuNode"));
  4057. this.helpBtn = (this.getChild("helpBtn"));
  4058. this.wordsBtn = (this.getChild("wordsBtn"));
  4059. this.aiWordsBtn = (this.getChild("aiWordsBtn"));
  4060. this.returnBtn = (this.getChild("returnBtn"));
  4061. this.ballNode = (this.getChild("ballNode"));
  4062. this.whiteAni = (this.getChild("whiteAni"));
  4063. this.blackAni = (this.getChild("blackAni"));
  4064. this.selfTurn = (this.getChild("selfTurn"));
  4065. this.aiTurn = (this.getChild("aiTurn"));
  4066. this.deskNode = (this.getChild("deskNode"));
  4067. this.moveNode = (this.getChild("moveNode"));
  4068. this.selfTalk = (this.getChild("selfTalk"));
  4069. this.aiTalk = (this.getChild("aiTalk"));
  4070. this.d2Node = (this.getChild("d2Node"));
  4071. this.snowNode = (this.getChild("snowNode"));
  4072. this.guide2 = (this.getChild("guide2"));
  4073. this.guide1 = (this.getChild("guide1"));
  4074. this.guide3 = (this.getChild("guide3"));
  4075. this.guideNode = (this.getChild("guideNode"));
  4076. }
  4077. }
  4078. ui_UIGame.URL = "ui://isxx5ak7kt443qg";
  4079. class ui_UIGameEnd extends fgui.GComponent {
  4080. static createInstance() {
  4081. return (fgui.UIPackage.createObject("game", "UIGameEnd"));
  4082. }
  4083. onConstruct() {
  4084. this.c1 = this.getController("c1");
  4085. this.n22 = (this.getChild("n22"));
  4086. this.n2 = (this.getChild("n2"));
  4087. this.n52 = (this.getChild("n52"));
  4088. this.n53 = (this.getChild("n53"));
  4089. this.coinNode = (this.getChild("coinNode"));
  4090. this.closeNode = (this.getChild("closeNode"));
  4091. this.moneyNode = (this.getChild("moneyNode"));
  4092. this.secretary = (this.getChild("secretary"));
  4093. this.n27 = (this.getChild("n27"));
  4094. this.n29 = (this.getChild("n29"));
  4095. this.talkNode = (this.getChild("talkNode"));
  4096. this.n38 = (this.getChild("n38"));
  4097. this.n39 = (this.getChild("n39"));
  4098. this.n40 = (this.getChild("n40"));
  4099. this.awardNode = (this.getChild("awardNode"));
  4100. this.starNumNode = (this.getChild("starNumNode"));
  4101. this.n47 = (this.getChild("n47"));
  4102. this.conditionNode = (this.getChild("conditionNode"));
  4103. this.isGetAward = (this.getChild("isGetAward"));
  4104. this.leftBtn = (this.getChild("leftBtn"));
  4105. this.rightBtn = (this.getChild("rightBtn"));
  4106. this.btnNode = (this.getChild("btnNode"));
  4107. }
  4108. }
  4109. ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3";
  4110. class ui_UIAddCoin extends fgui.GComponent {
  4111. static createInstance() {
  4112. return (fgui.UIPackage.createObject("game", "UIAddCoin"));
  4113. }
  4114. onConstruct() {
  4115. this.n11 = (this.getChild("n11"));
  4116. this.myNode = (this.getChild("myNode"));
  4117. this.t0 = this.getTransition("t0");
  4118. }
  4119. }
  4120. ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs";
  4121. class UIAddCoin extends UIBase {
  4122. constructor() {
  4123. super();
  4124. this.coinNum = 2000;
  4125. }
  4126. onConstructor() {
  4127. this.ui = ui_UIAddCoin.createInstance();
  4128. this.contentPane = this.ui;
  4129. this.isEject = false;
  4130. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4131. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  4132. }
  4133. show() {
  4134. super.show();
  4135. this.ui.t0.play();
  4136. }
  4137. videoAddCoin() {
  4138. console.log('zh:qjff_AD_for_UIAddCoin');
  4139. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  4140. }
  4141. else {
  4142. console.log('zh:AD 失败,直接发放奖励');
  4143. this.qjff_AD_for_UIAddCoin();
  4144. }
  4145. }
  4146. qjff_AD_for_UIAddCoin() {
  4147. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  4148. this.hide();
  4149. }
  4150. }
  4151. UIAddCoin.uiName = "UIAddCoin";
  4152. class ui_UIInvitation extends fgui.GComponent {
  4153. static createInstance() {
  4154. return (fgui.UIPackage.createObject("game", "UIInvitation"));
  4155. }
  4156. onConstruct() {
  4157. this.n14 = (this.getChild("n14"));
  4158. this.myNode = (this.getChild("myNode"));
  4159. this.t0 = this.getTransition("t0");
  4160. }
  4161. }
  4162. ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r";
  4163. class UIInvitation extends UIBase {
  4164. constructor() {
  4165. super();
  4166. }
  4167. onConstructor() {
  4168. this.ui = ui_UIInvitation.createInstance();
  4169. this.contentPane = this.ui;
  4170. this.isEject = false;
  4171. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  4172. }
  4173. show() {
  4174. super.show();
  4175. }
  4176. enterGame() {
  4177. xGame.common.gameMode = GameMode.classic;
  4178. DataMgr.setChallengeTimes(1);
  4179. xGame.common.passAwardCoin = 2000;
  4180. let need = xGame.common.classicNiceNeddCoin;
  4181. if (DataMgr.coinEnough(need)) {
  4182. DataMgr.setCoin(-need);
  4183. xGame.eventMgr.event(RESTART_GAME, true);
  4184. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  4185. }
  4186. else {
  4187. xGame.eventMgr.event(RESTART_GAME, true);
  4188. }
  4189. this.hide();
  4190. }
  4191. hide() {
  4192. super.hide();
  4193. }
  4194. }
  4195. UIInvitation.uiName = "UIInvitation";
  4196. class ui_UIMain extends fgui.GComponent {
  4197. static createInstance() {
  4198. return (fgui.UIPackage.createObject("game", "UIMain"));
  4199. }
  4200. onConstruct() {
  4201. this.n47 = (this.getChild("n47"));
  4202. this.n10 = (this.getChild("n10"));
  4203. this.secretary = (this.getChild("secretary"));
  4204. this.n33 = (this.getChild("n33"));
  4205. this.shopBtn = (this.getChild("shopBtn"));
  4206. this.moneyNode = (this.getChild("moneyNode"));
  4207. this.headNode = (this.getChild("headNode"));
  4208. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4209. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4210. this.classicBtn = (this.getChild("classicBtn"));
  4211. this.weeklyBtn = (this.getChild("weeklyBtn"));
  4212. this.globalBtn = (this.getChild("globalBtn"));
  4213. this.n44 = (this.getChild("n44"));
  4214. this.signBtn = (this.getChild("signBtn"));
  4215. this.drawBtn = (this.getChild("drawBtn"));
  4216. this.settingNode = (this.getChild("settingNode"));
  4217. this.n45 = (this.getChild("n45"));
  4218. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4219. this.n46 = (this.getChild("n46"));
  4220. this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
  4221. this.liucheng1 = (this.getChild("liucheng1"));
  4222. this.rightBtn = (this.getChild("rightBtn"));
  4223. this.n75 = (this.getChild("n75"));
  4224. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4225. this.liucheng2 = (this.getChild("liucheng2"));
  4226. this.guideBtn = (this.getChild("guideBtn"));
  4227. this.n73 = (this.getChild("n73"));
  4228. this.wordsNode = (this.getChild("wordsNode"));
  4229. this.enterGuide = (this.getChild("enterGuide"));
  4230. this.talkNode = (this.getChild("talkNode"));
  4231. this.n83 = (this.getChild("n83"));
  4232. this.n84 = (this.getChild("n84"));
  4233. }
  4234. }
  4235. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4236. class ui_UIMoyu extends fgui.GComponent {
  4237. static createInstance() {
  4238. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4239. }
  4240. onConstruct() {
  4241. this.ageTip = (this.getChild("ageTip"));
  4242. this.mainBg = (this.getChild("mainBg"));
  4243. this.xyNode = (this.getChild("xyNode"));
  4244. this.rnNode = (this.getChild("rnNode"));
  4245. this.fcmNode = (this.getChild("fcmNode"));
  4246. this.ageNode = (this.getChild("ageNode"));
  4247. this.tipNode = (this.getChild("tipNode"));
  4248. this.msgNode = (this.getChild("msgNode"));
  4249. }
  4250. }
  4251. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4252. class MoyuMgr {
  4253. static initMoyu() {
  4254. this.moyuView = new MoyuView();
  4255. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4256. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4257. this.moyuView.ui.displayObject.zOrder = 1000;
  4258. this.moyuView.init();
  4259. this.moyuView.showTip(true);
  4260. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4261. window['XApk'] = this;
  4262. }
  4263. static showAge(show) {
  4264. if (this.moyuView)
  4265. this.moyuView.showAge(show);
  4266. }
  4267. static onPlatMsg(idx) {
  4268. if (!MoyuMgr.moyuView)
  4269. return;
  4270. if (idx == '0') {
  4271. MoyuMgr.moyuView.showTip(false);
  4272. }
  4273. }
  4274. static showAgree(call) {
  4275. if (this.moyuView)
  4276. this.moyuView.showAgree(call);
  4277. else
  4278. call && call();
  4279. }
  4280. static showXy(type = 1) {
  4281. if (this.moyuView)
  4282. this.moyuView.showXy(type);
  4283. }
  4284. }
  4285. MoyuMgr.isAdvise = false;
  4286. class MoyuView {
  4287. constructor() {
  4288. this.ysxyNum = 1;
  4289. this.ysJson = null;
  4290. this.ui = ui_UIMoyu.createInstance();
  4291. }
  4292. init() {
  4293. this.ui.mainBg.visible = false;
  4294. this.ui.xyNode.visible = false;
  4295. this.ui.ageNode.visible = false;
  4296. this.ui.tipNode.visible = false;
  4297. this.ui.rnNode.visible = false;
  4298. this.ui.fcmNode.visible = false;
  4299. this.ui.ageTip.visible = false;
  4300. this.ui.msgNode.visible = false;
  4301. this.ui.visible = false;
  4302. this.ui.xyNode.xyList.setVirtual();
  4303. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4304. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4305. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4306. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4307. this.ui.xyNode.btnKnown.visible = false;
  4308. this.ui.xyNode.xy1.visible = false;
  4309. this.ui.xyNode.xy2.visible = false;
  4310. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4311. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4312. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4313. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4314. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4315. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4316. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4317. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4318. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4319. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4320. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4321. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4322. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4323. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4324. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4325. this.ysxyNum = 2;
  4326. }
  4327. }
  4328. onClick(obj) {
  4329. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4330. switch (obj) {
  4331. case this.ui.ageTip:
  4332. if (Moyu.isTTApk) {
  4333. this.ui.ageNode.visible = true;
  4334. this.ui.mainBg.visible = true;
  4335. }
  4336. break;
  4337. case this.ui.tipNode:
  4338. this.showTip(false);
  4339. break;
  4340. case this.ui.ageNode.btnAge:
  4341. this.ui.ageNode.visible = false;
  4342. this.ui.mainBg.visible = false;
  4343. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4344. this.ui.visible = false;
  4345. break;
  4346. case this.ui.xyNode.btnXy3:
  4347. case this.ui.xyNode.btnXy1:
  4348. this.loadXy(1);
  4349. break;
  4350. case this.ui.xyNode.btnXy2:
  4351. this.loadXy(2);
  4352. break;
  4353. case this.ui.xyNode.btnBack:
  4354. this.ui.xyNode.xy1.visible = true;
  4355. this.ui.xyNode.xy2.visible = false;
  4356. break;
  4357. case this.ui.xyNode.btnKnown:
  4358. this.ui.xyNode.visible = false;
  4359. this.ui.mainBg.visible = false;
  4360. this.ui.visible = false;
  4361. break;
  4362. case this.ui.rnNode.btnCheck:
  4363. this.check();
  4364. break;
  4365. case this.ui.rnNode.btnExit:
  4366. case this.ui.xyNode.btnNo:
  4367. this.ysxyNum--;
  4368. if (this.ysxyNum > 0)
  4369. this.showMsg("Refuse to quit the game once again");
  4370. else {
  4371. Moyu.userAgree(false);
  4372. Moyu.exit();
  4373. }
  4374. break;
  4375. case this.ui.xyNode.btnSure:
  4376. case this.ui.xyNode.btnYes:
  4377. DataMgr.userData.isAgree = true;
  4378. DataMgr.saveUserData();
  4379. this.onAgree();
  4380. break;
  4381. case this.ui.rnNode.btnDone:
  4382. this.ui.rnNode.visible = false;
  4383. this.ui.visible = false;
  4384. break;
  4385. case this.ui.fcmNode.btnRn:
  4386. this.showRn();
  4387. break;
  4388. }
  4389. }
  4390. showTip(show) {
  4391. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4392. return;
  4393. if (show) {
  4394. MoyuMgr.isAdvise = true;
  4395. this.ui.visible = true;
  4396. this.ui.tipNode.visible = true;
  4397. this.ui.tipNode.alpha = 1;
  4398. Laya.timer.once(1000, this, this.showTip, [false]);
  4399. }
  4400. else {
  4401. this.ui.tipNode.alpha = 1;
  4402. this.ui.tipNode.visible = true;
  4403. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4404. this.ui.tipNode.visible = false;
  4405. MoyuMgr.isAdvise = false;
  4406. }), 1000);
  4407. }
  4408. }
  4409. showAge(show, px = 0, py = 0) {
  4410. if (Moyu.platType > 10 && !Moyu.isIos) {
  4411. this.ui.ageTip.x = px;
  4412. this.ui.ageTip.y = py;
  4413. this.ui.ageTip.visible = show;
  4414. if (show)
  4415. this.ui.visible = true;
  4416. }
  4417. }
  4418. showAgree(call) {
  4419. this.agreeCall = call;
  4420. this.onAgree();
  4421. return;
  4422. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4423. this.showXy(0);
  4424. }
  4425. else
  4426. this.onAgree();
  4427. }
  4428. onAgree() {
  4429. if (!this.ui.ageNode.visible)
  4430. this.ui.visible = false;
  4431. this.ui.xyNode.visible = false;
  4432. Moyu.userAgree(true);
  4433. this.showAge(false);
  4434. this.agreeCall && this.agreeCall();
  4435. this.showRn();
  4436. }
  4437. showMsg(txt) {
  4438. this.ui.msgNode.txtMsg.text = txt;
  4439. this.ui.msgNode.visible = true;
  4440. this.ui.msgNode.alpha = 1;
  4441. this.ui.visible = true;
  4442. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4443. this.ui.msgNode.visible = false;
  4444. }), 2500, true);
  4445. }
  4446. showRn() {
  4447. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4448. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4449. this.ui.rnNode.rn1.visible = true;
  4450. this.ui.rnNode.rn2.visible = false;
  4451. this.ui.rnNode.rn3.visible = false;
  4452. this.ui.rnNode.rn4.visible = false;
  4453. this.ui.rnNode.visible = true;
  4454. this.ui.mainBg.visible = true;
  4455. this.ui.rnNode.btnDone.visible = false;
  4456. this.ui.rnNode.btnExit.visible = true;
  4457. this.ui.rnNode.btnCheck.visible = true;
  4458. this.ui.fcmNode.visible = false;
  4459. this.ui.visible = true;
  4460. return;
  4461. }
  4462. }
  4463. this.showFcm();
  4464. }
  4465. showFcm() {
  4466. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4467. Moyu.initFCM(true);
  4468. if (Moyu.gameTime < 1)
  4469. this.fcmLoop();
  4470. else if (Moyu.gameTime < 999)
  4471. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4472. }
  4473. }
  4474. fcmLoop() {
  4475. if (Moyu.gameTime < 1) {
  4476. this.ui.rnNode.visible = false;
  4477. this.ui.fcmNode.visible = true;
  4478. this.ui.mainBg.visible = true;
  4479. this.ui.visible = true;
  4480. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4481. Laya.timer.clear(this.ui, this.fcmLoop);
  4482. }
  4483. }
  4484. check() {
  4485. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4486. this.ui.rnNode.rn1.visible = false;
  4487. this.ui.rnNode.rn2.visible = false;
  4488. this.ui.rnNode.rn4.visible = true;
  4489. }
  4490. else if (this.ui.rnNode.rn4.visible) {
  4491. let name = this.ui.rnNode.inputName.text;
  4492. let code = this.ui.rnNode.inputCode.text;
  4493. if (code && code.length == 18) {
  4494. this.ui.rnNode.rn1.visible = false;
  4495. this.ui.rnNode.rn4.visible = false;
  4496. Moyu.authenticate(name, code, (res) => {
  4497. this.ui.rnNode.rn2.visible = !res;
  4498. this.ui.rnNode.rn3.visible = res;
  4499. this.ui.rnNode.btnDone.visible = res;
  4500. this.ui.rnNode.btnExit.visible = !res;
  4501. this.ui.rnNode.btnCheck.visible = !res;
  4502. if (res)
  4503. this.showFcm();
  4504. });
  4505. }
  4506. else
  4507. this.showMsg("信息填写不完整");
  4508. }
  4509. }
  4510. loadXy(type = 0) {
  4511. this.ui.xyNode.xy1.visible = false;
  4512. this.ui.xyNode.xy2.visible = true;
  4513. this.ui.xyNode.xyList.scrollToView(0);
  4514. if (type == 1) {
  4515. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4516. }
  4517. else if (type == 2) {
  4518. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4519. }
  4520. }
  4521. showXy(type = 0) {
  4522. this.xyBtn();
  4523. if (type == 0) {
  4524. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4525. this.ui.xyNode.btnSure.visible = true;
  4526. }
  4527. else {
  4528. this.ui.xyNode.btnYes.visible = true;
  4529. this.ui.xyNode.btnNo.visible = true;
  4530. }
  4531. }
  4532. else {
  4533. this.ui.xyNode.btnKnown.visible = true;
  4534. this.ui.mainBg.visible = true;
  4535. }
  4536. this.ui.xyNode.xy1.visible = true;
  4537. this.ui.xyNode.xy2.visible = false;
  4538. this.ui.xyNode.visible = true;
  4539. this.ui.visible = true;
  4540. }
  4541. xyBtn() {
  4542. this.ui.xyNode.btnSure.visible = false;
  4543. this.ui.xyNode.btnYes.visible = false;
  4544. this.ui.xyNode.btnNo.visible = false;
  4545. this.ui.xyNode.btnKnown.visible = false;
  4546. {
  4547. this.ui.xyNode.btnXy3.visible = false;
  4548. this.ui.xyNode.btnXy2.visible = true;
  4549. this.ui.xyNode.btnXy1.visible = true;
  4550. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4551. }
  4552. }
  4553. createXY(json) {
  4554. this.ysJson = json.content;
  4555. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4556. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4557. this.ui.xyNode.xy2.visible = true;
  4558. }
  4559. renderListItem(idx, cell) {
  4560. let xy = this.ysJson[idx];
  4561. cell.height = xy.line * 30;
  4562. cell.xyItem.text = xy.text;
  4563. }
  4564. onDestroy() {
  4565. this.agreeCall = null;
  4566. }
  4567. }
  4568. class SettingNode {
  4569. constructor(ui) {
  4570. this.showSetting = false;
  4571. this.openSound = true;
  4572. this.openShake = true;
  4573. this.ui = ui;
  4574. this.ui.soundBtn.onClick(this, this.switchSound);
  4575. this.ui.shakeBtn.onClick(this, this.switchShake);
  4576. this.ui.xyBtn.onClick(this, this.onXy);
  4577. this.ui.clickNode.onClick(this, this.changeSetting);
  4578. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4579. this.ui.xyBtn.visible = false;
  4580. this.ui.shakeBtn.visible = false;
  4581. }
  4582. changeSetting() {
  4583. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4584. this.showSetting = !this.showSetting;
  4585. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4586. }
  4587. switchSound() {
  4588. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4589. this.openSound = !this.openSound;
  4590. Moyu.onSetting(this.openSound, this.openShake);
  4591. xGame.soundMgr.onSetting(this.openSound);
  4592. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4593. }
  4594. switchShake() {
  4595. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4596. this.openShake = !this.openShake;
  4597. Moyu.onSetting(this.openSound, this.openShake);
  4598. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4599. }
  4600. onXy() {
  4601. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4602. MoyuMgr.showXy(1);
  4603. }
  4604. }
  4605. class ui_UILevelDisplay extends fgui.GComponent {
  4606. static createInstance() {
  4607. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4608. }
  4609. onConstruct() {
  4610. this.n9 = (this.getChild("n9"));
  4611. this.myNode = (this.getChild("myNode"));
  4612. this.closeNode = (this.getChild("closeNode"));
  4613. }
  4614. }
  4615. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4616. class ui_UILevelProp extends fgui.GComponent {
  4617. static createInstance() {
  4618. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4619. }
  4620. onConstruct() {
  4621. this.n16 = (this.getChild("n16"));
  4622. this.myNode = (this.getChild("myNode"));
  4623. this.closeBtn = (this.getChild("closeBtn"));
  4624. this.moneyNode = (this.getChild("moneyNode"));
  4625. this.t1 = this.getTransition("t1");
  4626. }
  4627. }
  4628. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  4629. class ui_ShowItem extends fgui.GComponent {
  4630. static createInstance() {
  4631. return (fgui.UIPackage.createObject("game", "ShowItem"));
  4632. }
  4633. onConstruct() {
  4634. this.myImg = (this.getChild("myImg"));
  4635. }
  4636. }
  4637. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  4638. class ShowItem {
  4639. constructor() {
  4640. this.ui = ui_ShowItem.createInstance();
  4641. }
  4642. destroySelf() {
  4643. if (!this.ui.isDisposed) {
  4644. this.ui.removeFromParent();
  4645. this.ui.dispose();
  4646. }
  4647. }
  4648. setParent(parent) {
  4649. parent.addChild(this.ui);
  4650. }
  4651. setPos(x, y) {
  4652. this.ui.x = x;
  4653. this.ui.y = y;
  4654. }
  4655. setUrl(index) {
  4656. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  4657. }
  4658. }
  4659. class ui_UIPower extends fgui.GComponent {
  4660. static createInstance() {
  4661. return (fgui.UIPackage.createObject("game", "UIPower"));
  4662. }
  4663. onConstruct() {
  4664. this.n11 = (this.getChild("n11"));
  4665. this.myNode = (this.getChild("myNode"));
  4666. this.t0 = this.getTransition("t0");
  4667. }
  4668. }
  4669. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  4670. class UIPower extends UIBase {
  4671. constructor() {
  4672. super();
  4673. }
  4674. onConstructor() {
  4675. this.ui = ui_UIPower.createInstance();
  4676. this.contentPane = this.ui;
  4677. this.isEject = false;
  4678. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4679. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  4680. }
  4681. show() {
  4682. super.show();
  4683. this.ui.t0.play();
  4684. }
  4685. videoGetPower() {
  4686. console.log('zh:qjff_AD_for_uipower');
  4687. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  4688. }
  4689. else {
  4690. console.log('zh:AD 失败,直接发放奖励');
  4691. this.qjff_AD_for_uipower();
  4692. }
  4693. }
  4694. qjff_AD_for_uipower() {
  4695. DataMgr.setPower(xGame.common.videoPower, true);
  4696. xGame.eventMgr.event(POWER_TIME);
  4697. this.hide();
  4698. }
  4699. }
  4700. UIPower.uiName = "UIPower";
  4701. class UILevelProp extends UIBase {
  4702. constructor() {
  4703. super();
  4704. this.firstPos = 385;
  4705. this.secondPos = 467;
  4706. this.showItemArr = [];
  4707. }
  4708. onConstructor() {
  4709. this.ui = ui_UILevelProp.createInstance();
  4710. this.contentPane = this.ui;
  4711. this.isEject = false;
  4712. this.addUIClick(this.ui.closeBtn, this.hide);
  4713. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  4714. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  4715. }
  4716. show(level) {
  4717. super.show();
  4718. this.ui.t1.play();
  4719. this.level = level;
  4720. this.data = cfgTable.placeballData[this.level];
  4721. this.updateSelf();
  4722. this.showPreView();
  4723. this.moneyNode.ui.c1.selectedIndex = 2;
  4724. this.moneyNode.checkPowerTime();
  4725. this.moneyNode.powerChange();
  4726. }
  4727. showPreView() {
  4728. let item;
  4729. let data;
  4730. for (let index = 0; index < this.showItemArr.length; index++) {
  4731. item = this.showItemArr[index];
  4732. item.destroySelf();
  4733. }
  4734. this.showItemArr = [];
  4735. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  4736. for (const key in cfgData) {
  4737. data = cfgData[key];
  4738. item = new ShowItem();
  4739. item.setParent(this.ui.myNode.displayRoot);
  4740. item.setPos(data.x, data.y);
  4741. item.setUrl(data.value);
  4742. this.showItemArr.push(item);
  4743. }
  4744. }
  4745. updateSelf() {
  4746. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  4747. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  4748. if (this.data.ball == -1) {
  4749. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  4750. }
  4751. else {
  4752. this.ui.myNode.conditionTxt.text = "Reward";
  4753. }
  4754. let localData = DataMgr.getPlaceBallLevel(this.level);
  4755. let getAward = localData.getAward;
  4756. let cfg = cfgTable.placeballData[this.level];
  4757. let coin = this.data.award[0];
  4758. let diamond = this.data.award[1];
  4759. if (cfg.type == PlaceBallType.challenge) {
  4760. diamond = 0;
  4761. coin = 100;
  4762. }
  4763. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  4764. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  4765. this.ui.myNode.coinNode.numTxt.text = coin + "";
  4766. if (cfg.type == PlaceBallType.challenge) {
  4767. this.ui.myNode.coinNode.numTxt.text = "";
  4768. }
  4769. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  4770. if (coin > 0 && diamond > 0) {
  4771. this.ui.myNode.diamondNode.x = 385;
  4772. this.ui.myNode.coinNode.x = 467;
  4773. }
  4774. else {
  4775. this.ui.myNode.diamondNode.x = 385;
  4776. this.ui.myNode.coinNode.x = 385;
  4777. }
  4778. if (!getAward) {
  4779. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  4780. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  4781. }
  4782. else {
  4783. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  4784. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  4785. }
  4786. }
  4787. startGame() {
  4788. if (DataMgr.powerEnough()) {
  4789. this.ui.myNode.startBtn.touchable = false;
  4790. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  4791. console.log('zh:startGame ');
  4792. this.ui.myNode.startBtn.touchable = true;
  4793. DataMgr.setPower(-1);
  4794. xGame.eventMgr.event(POWER_TIME);
  4795. xGame.common.gameMode = GameMode.placeBall;
  4796. xGame.common.placeBallCurLevel = this.level;
  4797. xGame.uiMgr.Show(UIGame);
  4798. xGame.uiMgr.Hide(UILevelDisplay);
  4799. xGame.uiMgr.Hide(UIMain);
  4800. this.hide();
  4801. }));
  4802. }
  4803. else {
  4804. console.log('zh:startGame no power');
  4805. xGame.uiMgr.Show(UIPower);
  4806. }
  4807. }
  4808. hide() {
  4809. super.hide();
  4810. }
  4811. }
  4812. UILevelProp.uiName = "UILevelProp";
  4813. class PutBallLevelDisplay {
  4814. constructor(ui, index) {
  4815. this.index = 0;
  4816. this.ui = ui;
  4817. this.index = index;
  4818. this.ui.onClick(this, this.clickSelf);
  4819. this.updateSelf();
  4820. this.ui.levelTxt.text = (this.index + 1) + "";
  4821. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  4822. this.ui.special.levelTxt.text = (this.index + 1) + "";
  4823. }
  4824. updateSelf() {
  4825. let level = this.index + 1;
  4826. this.data = DataMgr.getPlaceBallLevel(level);
  4827. this.ui.starNode.c1.selectedIndex = this.data.star;
  4828. let isChallenge = cfgTable.placeballData[level].type;
  4829. if (this.data.isCur) {
  4830. if (isChallenge) {
  4831. this.ui.c1.selectedIndex = 5;
  4832. }
  4833. else {
  4834. this.ui.c1.selectedIndex = 2;
  4835. }
  4836. }
  4837. else {
  4838. if (this.data.play) {
  4839. if (this.data.star == 3) {
  4840. this.ui.c1.selectedIndex = 0;
  4841. }
  4842. else {
  4843. this.ui.c1.selectedIndex = 1;
  4844. }
  4845. }
  4846. else {
  4847. if (isChallenge) {
  4848. this.ui.c1.selectedIndex = 4;
  4849. }
  4850. else {
  4851. this.ui.c1.selectedIndex = 3;
  4852. }
  4853. }
  4854. }
  4855. }
  4856. clickSelf() {
  4857. if (!this.data.play)
  4858. return;
  4859. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4860. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  4861. }
  4862. }
  4863. class UILevelDisplay extends UIBase {
  4864. constructor() {
  4865. super();
  4866. }
  4867. onConstructor() {
  4868. this.ui = ui_UILevelDisplay.createInstance();
  4869. this.contentPane = this.ui;
  4870. this.isEject = false;
  4871. this.myList = this.ui.myNode.myList;
  4872. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  4873. this.levelItemArr = [];
  4874. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  4875. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  4876. this.myList.numItems = levelNum;
  4877. if (Moyu.isKs)
  4878. this.ui.closeNode.closeBtn.x += 100;
  4879. }
  4880. levelItemRender(index, target) {
  4881. let item = new PutBallLevelDisplay(target, index);
  4882. this.levelItemArr.push(item);
  4883. }
  4884. show() {
  4885. super.show();
  4886. this.updateLevel();
  4887. this.scrollToPlace();
  4888. }
  4889. updateLevel() {
  4890. let temp;
  4891. for (let index = 0; index < this.levelItemArr.length; index++) {
  4892. temp = this.levelItemArr[index];
  4893. temp.updateSelf();
  4894. }
  4895. }
  4896. scrollToPlace() {
  4897. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  4898. let passArr = DataMgr.getPlaceBallLevelList();
  4899. let offest = passArr.length;
  4900. if (offest >= maxNum - 1)
  4901. offest = maxNum - 1;
  4902. this.myList.scrollToView(offest, true, true);
  4903. }
  4904. hide() {
  4905. super.hide();
  4906. }
  4907. }
  4908. UILevelDisplay.uiName = "UILevelDisplay";
  4909. class ui_UIMatching extends fgui.GComponent {
  4910. static createInstance() {
  4911. return (fgui.UIPackage.createObject("game", "UIMatching"));
  4912. }
  4913. onConstruct() {
  4914. this.n5 = (this.getChild("n5"));
  4915. this.n49 = (this.getChild("n49"));
  4916. this.n51 = (this.getChild("n51"));
  4917. this.n64 = (this.getChild("n64"));
  4918. this.n2 = (this.getChild("n2"));
  4919. this.n53 = (this.getChild("n53"));
  4920. this.n54 = (this.getChild("n54"));
  4921. this.n56 = (this.getChild("n56"));
  4922. this.n58 = (this.getChild("n58"));
  4923. this.n59 = (this.getChild("n59"));
  4924. this.n57 = (this.getChild("n57"));
  4925. this.n60 = (this.getChild("n60"));
  4926. this.n62 = (this.getChild("n62"));
  4927. this.awardTxt = (this.getChild("awardTxt"));
  4928. this.n61 = (this.getChild("n61"));
  4929. this.selfHead = (this.getChild("selfHead"));
  4930. this.aiHead = (this.getChild("aiHead"));
  4931. this.n82 = (this.getChild("n82"));
  4932. this.n84 = (this.getChild("n84"));
  4933. this.n83 = (this.getChild("n83"));
  4934. this.t1 = this.getTransition("t1");
  4935. this.t2 = this.getTransition("t2");
  4936. this.t3 = this.getTransition("t3");
  4937. this.t4 = this.getTransition("t4");
  4938. }
  4939. }
  4940. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  4941. class UIMatching extends UIBase {
  4942. constructor() {
  4943. super();
  4944. }
  4945. onConstructor() {
  4946. this.ui = ui_UIMatching.createInstance();
  4947. this.contentPane = this.ui;
  4948. this.isEject = false;
  4949. }
  4950. show(callback) {
  4951. super.show();
  4952. PlatMgr.showBanner(true);
  4953. this.callback = callback;
  4954. let user = Moyu.getUserInfo();
  4955. if (!this.selfPot) {
  4956. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  4957. }
  4958. if (!this.aiPot) {
  4959. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  4960. }
  4961. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  4962. this.ui.selfHead.nameTxt.text = user.nickName;
  4963. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  4964. this.ui.aiHead.nameTxt.text = "???";
  4965. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  4966. this.ui.selfHead.c1.selectedIndex = 0;
  4967. this.ui.aiHead.c1.selectedIndex = 0;
  4968. this.ui.selfHead.x = this.selfPot.x;
  4969. this.ui.selfHead.y = this.selfPot.y;
  4970. this.ui.aiHead.x = this.aiPot.x;
  4971. this.ui.aiHead.y = this.aiPot.y;
  4972. switch (xGame.common.gameMode) {
  4973. case GameMode.classic:
  4974. break;
  4975. case GameMode.bigMove:
  4976. this.initSkillData();
  4977. break;
  4978. default:
  4979. break;
  4980. }
  4981. this.ui.t1.play(Laya.Handler.create(this, () => {
  4982. this.ui.t2.play(Laya.Handler.create(this, () => {
  4983. switch (xGame.common.gameMode) {
  4984. case GameMode.classic:
  4985. this.waitingPeople();
  4986. break;
  4987. case GameMode.bigMove:
  4988. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  4989. break;
  4990. default:
  4991. break;
  4992. }
  4993. }));
  4994. }));
  4995. }
  4996. initSkillData() {
  4997. this.skillSelectData = [];
  4998. let skillUrl = xGame.common.skillIconList;
  4999. let skillName = xGame.common.skillNameList;
  5000. let skillLevel = DataMgr.getBigSkillList();
  5001. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  5002. for (let index = 0; index < 5; index++) {
  5003. let obj = {};
  5004. obj.skillImg = skillUrl[index];
  5005. obj.skillName = skillName[index];
  5006. obj.skillType = skillType[index];
  5007. obj.skillLevel = skillLevel[index];
  5008. this.skillSelectData.push(obj);
  5009. }
  5010. }
  5011. getAISkillLevel(myLevel) {
  5012. let video = xGame.common.upSkillLevel;
  5013. let aiLevel;
  5014. let temp;
  5015. if (video) {
  5016. temp = xGame.common.randomNum(-2, -1);
  5017. }
  5018. else {
  5019. if (myLevel <= 5) {
  5020. temp = xGame.common.randomNum(1, 3);
  5021. }
  5022. else if (myLevel <= 9) {
  5023. temp = xGame.common.randomNum(-2, 1);
  5024. }
  5025. else {
  5026. temp = xGame.common.randomNum(-4, 0);
  5027. }
  5028. }
  5029. aiLevel = temp + myLevel;
  5030. if (aiLevel <= 1)
  5031. aiLevel = 1;
  5032. if (aiLevel >= 10)
  5033. aiLevel = 10;
  5034. return aiLevel;
  5035. }
  5036. getAISkillType() {
  5037. return xGame.common.randomNum(1, 4);
  5038. let successTimes = DataMgr.getSkillSuccessTimes();
  5039. let info = cfgTable.aiskillData[successTimes];
  5040. if (!info) {
  5041. let max = Object.keys(cfgTable.aiskillData).length - 1;
  5042. info = cfgTable.aiskillData[max];
  5043. }
  5044. let dataArr = info.skillselect;
  5045. let myCfg = {};
  5046. for (let index = 0; index < dataArr.length; index++) {
  5047. let temp = dataArr[index].split('-');
  5048. myCfg[temp[0]] = {};
  5049. myCfg[temp[0]].id = parseInt(temp[0]);
  5050. myCfg[temp[0]].weight = parseInt(temp[1]);
  5051. }
  5052. let aiCfg = xGame.common.initWeight(myCfg);
  5053. let curData = xGame.common.getRandomWeightData(aiCfg);
  5054. return parseInt(curData.id);
  5055. }
  5056. getAISkillData(index) {
  5057. let myLevel = this.skillSelectData[index].skillLevel;
  5058. let aiLevel = this.getAISkillLevel(myLevel);
  5059. let aiType = this.getAISkillType() - 1;
  5060. return { aiLevel, aiType } = { aiLevel, aiType };
  5061. }
  5062. skillSelectFinish(index) {
  5063. let aiInfo = this.getAISkillData(index);
  5064. xGame.common.gameMgr.selfCurSkill = index;
  5065. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  5066. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  5067. this.ui.selfHead.c1.selectedIndex = 1;
  5068. this.ui.aiHead.c1.selectedIndex = 1;
  5069. let myData = this.skillSelectData[index];
  5070. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  5071. let guide = DataMgr.getSkillGuide();
  5072. if (guide == 0) {
  5073. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  5074. }
  5075. else {
  5076. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  5077. }
  5078. let aiData = this.skillSelectData[aiInfo.aiType];
  5079. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  5080. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  5081. this.waitingPeople();
  5082. }
  5083. waitingPeople() {
  5084. let time = xGame.common.randomNum(1000, 3000);
  5085. time += 1000;
  5086. Laya.timer.once(time, this, () => {
  5087. this.matchingSuccess();
  5088. });
  5089. }
  5090. matchingSuccess() {
  5091. let gameUI = xGame.common.gameUI;
  5092. let name = gameUI.ui.topNode.aiNameTxt.text;
  5093. let url = gameUI.ui.topNode.aiHeadLoader.url;
  5094. this.ui.aiHead.nameTxt.text = name;
  5095. this.ui.aiHead.headImg.url = url;
  5096. name = gameUI.ui.topNode.selfNameTxt.text;
  5097. url = gameUI.ui.topNode.selfHeadLoader.url;
  5098. this.ui.selfHead.nameTxt.text = name;
  5099. this.ui.selfHead.headImg.url = url;
  5100. this.ui.t3.play(Laya.Handler.create(this, () => {
  5101. this.callback && this.callback();
  5102. this.ui.t4.play(Laya.Handler.create(this, () => {
  5103. this.destroySelf();
  5104. }));
  5105. }));
  5106. }
  5107. destroySelf() {
  5108. this.callback = null;
  5109. this.skillSelectData = null;
  5110. this.selfPot = null;
  5111. this.aiPot = null;
  5112. if (!this.ui.isDisposed) {
  5113. this.ui.removeFromParent();
  5114. this.ui.dispose();
  5115. }
  5116. xGame.uiMgr.destroyUI(this);
  5117. }
  5118. }
  5119. UIMatching.uiName = "UIMatching";
  5120. class ui_UIRanking extends fgui.GComponent {
  5121. static createInstance() {
  5122. return (fgui.UIPackage.createObject("game", "UIRanking"));
  5123. }
  5124. onConstruct() {
  5125. this.n26 = (this.getChild("n26"));
  5126. this.myNode = (this.getChild("myNode"));
  5127. }
  5128. }
  5129. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  5130. class UIRanking extends UIBase {
  5131. constructor() {
  5132. super();
  5133. this.showSelf = true;
  5134. this.rankType = 1;
  5135. this.rankList = [];
  5136. this.myIndex = 0;
  5137. this.myStar = 0;
  5138. }
  5139. onConstructor() {
  5140. this.ui = ui_UIRanking.createInstance();
  5141. this.contentPane = this.ui;
  5142. this.isEject = false;
  5143. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  5144. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  5145. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  5146. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  5147. this.ui.myNode.myList.setVirtual();
  5148. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  5149. }
  5150. show() {
  5151. super.show();
  5152. this.myIndex = 51;
  5153. Moyu.getRankList({
  5154. rankId: xGame.common.curRankID,
  5155. type: MoyuRankType.total,
  5156. page: 1,
  5157. pageSize: 50,
  5158. }, this, this.updateItemData);
  5159. this.updateSelf();
  5160. let self = Moyu.getUserInfo();
  5161. if (!self.isAuth) {
  5162. Moyu.initUser(this, () => {
  5163. DataMgr.upRankData();
  5164. });
  5165. }
  5166. }
  5167. updateSelfItem() {
  5168. let self = Moyu.getUserInfo();
  5169. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  5170. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > 50 ? "未上榜" : this.myIndex.toString();
  5171. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  5172. this.ui.myNode.selfNode.nameTxt.text = Moyu.platType < 11 ? self.nickName : "myself";
  5173. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  5174. }
  5175. updateItemData(data) {
  5176. this.myStar = xGame.common.getAllStarNum();
  5177. if (this.rankList.length < 2) {
  5178. this.rankList = data;
  5179. let self = Moyu.getUserInfo();
  5180. for (let i = 0; i < data.length; i++) {
  5181. let data = this.rankList[i];
  5182. if (data.userId == self.userId) {
  5183. this.rankList.splice(i, 1);
  5184. break;
  5185. }
  5186. }
  5187. for (let i = 0; i < data.length; i++) {
  5188. let data = this.rankList[i];
  5189. if (data.rankScore < this.myStar && this.myIndex > 50) {
  5190. this.myIndex = i + 1;
  5191. let user = { headIcon: self.headIcon, nickName: "myself" };
  5192. let ud = { user: user, data: {} };
  5193. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5194. if (Moyu.platType < 11) {
  5195. user.headIcon = self.headIcon;
  5196. user.nickName = self.nickName;
  5197. }
  5198. this.rankList.splice(i, 0, md);
  5199. break;
  5200. }
  5201. }
  5202. }
  5203. this.updateSelfItem();
  5204. this.ui.myNode.myList.numItems = this.rankList.length;
  5205. }
  5206. updateItemUI(index, obj) {
  5207. let data = this.rankList[index];
  5208. let userData = JSON.parse(data.userData).user;
  5209. obj.nameTxt.text = userData.nickName.toString();
  5210. obj.valueTxt.text = data.rankScore;
  5211. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5212. obj.rankTxt.text = index + 1;
  5213. switch (index) {
  5214. case 0:
  5215. this.setImg(obj, 1, 0, 0);
  5216. obj.rankTxt.color = "#FFC047";
  5217. break;
  5218. case 1:
  5219. this.setImg(obj, 0, 1, 0);
  5220. obj.rankTxt.color = "#ACACAC";
  5221. break;
  5222. case 2:
  5223. this.setImg(obj, 0, 0, 1);
  5224. obj.rankTxt.color = "#D09672";
  5225. break;
  5226. default:
  5227. this.setImg(obj, 0, 0, 0);
  5228. obj.rankTxt.color = "#496FAB";
  5229. break;
  5230. }
  5231. }
  5232. setImg(obj, a, b, c) {
  5233. obj.img1.visible = a ? true : false;
  5234. obj.img2.visible = b ? true : false;
  5235. obj.img3.visible = c ? true : false;
  5236. }
  5237. changeList(type) {
  5238. this.rankType = type;
  5239. this.updateSelf();
  5240. }
  5241. changeSelfNode() {
  5242. this.showSelf = !this.showSelf;
  5243. this.updateSelf();
  5244. }
  5245. updateSelf() {
  5246. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5247. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5248. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5249. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5250. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5251. }
  5252. }
  5253. UIRanking.uiName = "UIRanking";
  5254. class ui_UISecretary extends fgui.GComponent {
  5255. static createInstance() {
  5256. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5257. }
  5258. onConstruct() {
  5259. this.n0 = (this.getChild("n0"));
  5260. this.myNode = (this.getChild("myNode"));
  5261. this.closeBtn = (this.getChild("closeBtn"));
  5262. this.t0 = this.getTransition("t0");
  5263. }
  5264. }
  5265. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5266. class UISecretary extends UIBase {
  5267. constructor() {
  5268. super();
  5269. this.curIndex = 1;
  5270. }
  5271. onConstructor() {
  5272. this.ui = ui_UISecretary.createInstance();
  5273. this.contentPane = this.ui;
  5274. this.isEject = false;
  5275. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5276. this.nodeObj = { left: null, right: null, cur: null };
  5277. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5278. }
  5279. show() {
  5280. super.show();
  5281. this.ui.t0.play();
  5282. this.updateData();
  5283. }
  5284. addSecretarySpine(node, spineName) {
  5285. if (spineName == "mishu") {
  5286. if (this.secretarySpine1) {
  5287. node.displayObject.destroyChildren();
  5288. this.playWoman(this.secretarySpine1, node.displayObject);
  5289. }
  5290. else {
  5291. let spine1 = new SpineMgr("mishu", () => {
  5292. this.secretarySpine1 = spine1;
  5293. this.playWoman(this.secretarySpine1, node.displayObject);
  5294. });
  5295. }
  5296. }
  5297. else {
  5298. if (this.secretarySpine2) {
  5299. node.displayObject.destroyChildren();
  5300. this.playWoman(this.secretarySpine2, node.displayObject);
  5301. }
  5302. else {
  5303. let spine2 = new SpineMgr("xiaomishu2", () => {
  5304. this.secretarySpine2 = spine2;
  5305. this.playWoman(this.secretarySpine2, node.displayObject);
  5306. });
  5307. }
  5308. }
  5309. }
  5310. playWoman(node, parent) {
  5311. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  5312. let yy = this.ui.myNode.gameNode3.secretary.height;
  5313. let scale = 1.5;
  5314. if (node == this.secretarySpine2) {
  5315. scale = 1.2;
  5316. }
  5317. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5318. node.play(data, 0, true, parent);
  5319. }
  5320. turnLeft() {
  5321. this.curIndex--;
  5322. if (this.curIndex < 1) {
  5323. this.curIndex = 2;
  5324. }
  5325. let left = this.nodeObj.left;
  5326. let right = this.nodeObj.right;
  5327. let cur = this.nodeObj.cur;
  5328. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5329. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5330. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5331. this.updateData();
  5332. }));
  5333. this.ui.myNode.setChildIndex(right, 2);
  5334. this.nodeObj.left = cur;
  5335. this.nodeObj.right = left;
  5336. this.nodeObj.cur = right;
  5337. }
  5338. turnRight() {
  5339. this.curIndex++;
  5340. if (this.curIndex > 2) {
  5341. this.curIndex = 1;
  5342. }
  5343. let left = this.nodeObj.left;
  5344. let right = this.nodeObj.right;
  5345. let cur = this.nodeObj.cur;
  5346. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5347. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5348. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5349. this.updateData();
  5350. }));
  5351. this.ui.myNode.setChildIndex(left, 2);
  5352. this.nodeObj.left = right;
  5353. this.nodeObj.right = cur;
  5354. this.nodeObj.cur = left;
  5355. }
  5356. updateData() {
  5357. let data = cfgTable.secretaryshopData;
  5358. let children = this.ui.myNode._children;
  5359. let temp;
  5360. let curData;
  5361. for (let index = 0; index < children.length; index++) {
  5362. temp = children[index];
  5363. curData = data[1];
  5364. temp.heightTxt.text = curData.height;
  5365. temp.foodTxt.text = curData.food;
  5366. temp.historyTxt.text = curData.history;
  5367. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5368. this.addSecretarySpine(temp.secretary, curData.spine);
  5369. let womanIndex = curData.id - 1;
  5370. let getWoman = DataMgr.getSecretary(womanIndex);
  5371. let curUse = DataMgr.getCurSecretary();
  5372. if (getWoman) {
  5373. if (curUse == womanIndex) {
  5374. temp.purchaseBtn.c1.selectedIndex = 1;
  5375. }
  5376. else {
  5377. temp.purchaseBtn.c1.selectedIndex = 2;
  5378. }
  5379. }
  5380. else {
  5381. temp.purchaseBtn.c1.selectedIndex = 0;
  5382. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5383. }
  5384. temp.purchaseBtn.offClick(this, this.clickSecretary);
  5385. temp.purchaseBtn.onClick(this, this.clickSecretary, [getWoman, curUse, womanIndex, curData.price]);
  5386. }
  5387. }
  5388. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5389. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5390. if (getWoman) {
  5391. if (curUse != womanIndex) {
  5392. console.log();
  5393. DataMgr.setCurSecretary(womanIndex);
  5394. this.updateData();
  5395. }
  5396. }
  5397. else {
  5398. let need = needDiamond;
  5399. if (DataMgr.diamondEnough(need)) {
  5400. DataMgr.setDiamond(-need);
  5401. DataMgr.setSecretary(womanIndex, 1);
  5402. DataMgr.setCurSecretary(womanIndex);
  5403. this.updateData();
  5404. }
  5405. else {
  5406. xGame.uiMgr.Show(UIAddProp, 1);
  5407. }
  5408. }
  5409. }
  5410. closeSelf() {
  5411. this.hide();
  5412. }
  5413. }
  5414. UISecretary.uiName = "UISecretary";
  5415. class ui_UIShop extends fgui.GComponent {
  5416. static createInstance() {
  5417. return (fgui.UIPackage.createObject("game", "UIShop"));
  5418. }
  5419. onConstruct() {
  5420. this.n48 = (this.getChild("n48"));
  5421. this.n0 = (this.getChild("n0"));
  5422. this.secretary = (this.getChild("secretary"));
  5423. this.talkNode = (this.getChild("talkNode"));
  5424. this.closeNode = (this.getChild("closeNode"));
  5425. this.moneyNode = (this.getChild("moneyNode"));
  5426. this.myNode = (this.getChild("myNode"));
  5427. }
  5428. }
  5429. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5430. class BallRodDisplay {
  5431. constructor(ui, index) {
  5432. this.index = 0;
  5433. this.uiIndex = 0;
  5434. this.ui = ui;
  5435. this.index = index;
  5436. this.initData();
  5437. }
  5438. initData() {
  5439. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5440. let data = cfgTable.ballrodData[this.index + 1];
  5441. this.ui.nameTxt.text = data.name;
  5442. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5443. this.ui.levelNode.c1.selectedIndex = data.quality;
  5444. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5445. if (data.spine) {
  5446. this.mySpine = new SpineMgr(data.spine, () => {
  5447. let xx = 150;
  5448. let yy = 70;
  5449. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5450. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5451. });
  5452. }
  5453. }
  5454. updateSelf() {
  5455. let get = DataMgr.getBallRod(this.index);
  5456. if (get == null)
  5457. get = 1;
  5458. let curUse = DataMgr.getCurBallRod();
  5459. if (get) {
  5460. if (curUse == this.index) {
  5461. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5462. }
  5463. else {
  5464. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5465. }
  5466. }
  5467. else {
  5468. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5469. }
  5470. }
  5471. buyBallRod() {
  5472. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5473. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5474. switch (selectedIndex) {
  5475. case 0:
  5476. break;
  5477. case 1:
  5478. DataMgr.setCurBallRod(this.index);
  5479. let ui = xGame.uiMgr.getUI(UIShop);
  5480. ui.updateBallRod();
  5481. break;
  5482. case 2:
  5483. let data = cfgTable.ballrodData[this.index + 1];
  5484. let need = data.price;
  5485. if (DataMgr.diamondEnough(need)) {
  5486. DataMgr.setDiamond(-need);
  5487. DataMgr.setBallRod(this.index, 1);
  5488. DataMgr.setCurBallRod(this.index);
  5489. let ui = xGame.uiMgr.getUI(UIShop);
  5490. ui.updateBallRod();
  5491. }
  5492. else {
  5493. xGame.uiMgr.Show(UIAddProp, 1);
  5494. }
  5495. break;
  5496. default:
  5497. break;
  5498. }
  5499. }
  5500. }
  5501. class UIShop extends UIBase {
  5502. constructor() {
  5503. super();
  5504. this.itemNums = 0;
  5505. }
  5506. onConstructor() {
  5507. this.ui = ui_UIShop.createInstance();
  5508. this.contentPane = this.ui;
  5509. this.isEject = false;
  5510. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5511. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5512. this.addUIClick(this.ui, this.interuptSecretary);
  5513. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  5514. this.ballRodArr = [];
  5515. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  5516. this.ui.myNode.myList.numItems = this.itemNums;
  5517. if (Moyu.isKs)
  5518. this.ui.closeNode.closeBtn.x += 100;
  5519. }
  5520. show() {
  5521. super.show();
  5522. this.playSecretaryIdle();
  5523. this.updateBallRod();
  5524. }
  5525. updateBallRod() {
  5526. for (let index = 0; index < this.ballRodArr.length; index++) {
  5527. this.ballRodArr[index].updateSelf();
  5528. }
  5529. }
  5530. renderBallRod(sort, obj) {
  5531. let index = this.getIndexBySort(sort + 1) - 1;
  5532. let ballRod = new BallRodDisplay(obj, index);
  5533. this.ballRodArr.push(ballRod);
  5534. }
  5535. getIndexBySort(sort) {
  5536. let object = cfgTable.ballrodData;
  5537. for (const key in object) {
  5538. if (object[key].sort == sort) {
  5539. return parseInt(key);
  5540. }
  5541. }
  5542. }
  5543. playSecretaryIdle() {
  5544. let parent = this.ui.secretary.displayObject;
  5545. parent.destroyChildren();
  5546. let xx = this.ui.secretary.width / 2;
  5547. let yy = this.ui.secretary.height;
  5548. let scale = xGame.common.getSecretaryScale();
  5549. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5550. xGame.common.secretary.play(data, 0, true, parent);
  5551. }
  5552. interuptSecretary() {
  5553. Laya.timer.clearAll(this);
  5554. this.playSecretaryRandomSound();
  5555. }
  5556. playSecretaryRandomSound() {
  5557. if (this.isHide)
  5558. return;
  5559. let time = xGame.common.randomNum(45000, 60000);
  5560. Laya.timer.once(time, this, () => {
  5561. if (this.isHide)
  5562. return;
  5563. let index = xGame.common.randomNum(4, 7);
  5564. xGame.soundMgr.playSound("s_main0" + index);
  5565. let words = 1;
  5566. switch (index) {
  5567. case 4:
  5568. words = 5;
  5569. break;
  5570. case 5:
  5571. words = 3;
  5572. break;
  5573. case 6:
  5574. words = 6;
  5575. break;
  5576. case 7:
  5577. words = 7;
  5578. break;
  5579. default:
  5580. break;
  5581. }
  5582. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5583. this.playSecretaryRandomSound();
  5584. });
  5585. }
  5586. closeSelf() {
  5587. this.hide();
  5588. }
  5589. }
  5590. UIShop.uiName = "UIShop";
  5591. class ui_UISign extends fgui.GComponent {
  5592. static createInstance() {
  5593. return (fgui.UIPackage.createObject("game", "UISign"));
  5594. }
  5595. onConstruct() {
  5596. this.n6 = (this.getChild("n6"));
  5597. this.closeNode = (this.getChild("closeNode"));
  5598. this.myNode = (this.getChild("myNode"));
  5599. this.moneyNode = (this.getChild("moneyNode"));
  5600. this.secretary = (this.getChild("secretary"));
  5601. this.talkNode = (this.getChild("talkNode"));
  5602. this.tripleBtn = (this.getChild("tripleBtn"));
  5603. this.normalBtn = (this.getChild("normalBtn"));
  5604. this.tipsNode = (this.getChild("tipsNode"));
  5605. this.againBtn = (this.getChild("againBtn"));
  5606. this.t0 = this.getTransition("t0");
  5607. }
  5608. }
  5609. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  5610. class SignMax {
  5611. constructor(ui) {
  5612. this.ui = ui;
  5613. }
  5614. updateSelf(index, sameDay, curDayIndex) {
  5615. let data = cfgTable.signData[index + 1];
  5616. this.ui.titleTxt.text = data.title;
  5617. let arr1 = data.award[0].split('-');
  5618. let arr2 = data.award[1].split('-');
  5619. let num1 = parseInt(arr1[1]);
  5620. let num2 = parseInt(arr2[1]);
  5621. this.ui.numTxt1.text = num1 + "";
  5622. this.ui.numTxt2.text = num2 + "";
  5623. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  5624. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  5625. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  5626. this.ui.numTxt1.visible = false;
  5627. }
  5628. else {
  5629. this.ui.numTxt1.visible = true;
  5630. }
  5631. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  5632. this.ui.numTxt2.visible = false;
  5633. }
  5634. else {
  5635. this.ui.numTxt2.visible = true;
  5636. }
  5637. if (index < curDayIndex) {
  5638. this.ui.c1.selectedIndex = 1;
  5639. }
  5640. else if (index == curDayIndex) {
  5641. if (sameDay) {
  5642. this.ui.c1.selectedIndex = 2;
  5643. }
  5644. else {
  5645. this.ui.c1.selectedIndex = 2;
  5646. }
  5647. }
  5648. else {
  5649. this.ui.c1.selectedIndex = 0;
  5650. }
  5651. }
  5652. }
  5653. class SignNormal {
  5654. constructor(ui) {
  5655. this.ui = ui;
  5656. }
  5657. updateSelf(index, sameDay, curDayIndex) {
  5658. let data = cfgTable.signData[index + 1];
  5659. this.ui.titleTxt.text = data.title;
  5660. let arr = data.award[0].split('-');
  5661. let type = parseInt(arr[0]);
  5662. let num = parseInt(arr[1]);
  5663. this.ui.numTxt.text = num + "";
  5664. if (type > 2) {
  5665. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  5666. this.ui.myIcon.rotation = 0;
  5667. }
  5668. else {
  5669. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  5670. this.ui.myIcon.rotation = 0;
  5671. }
  5672. if (xGame.common.signAwardContainsRod(data.award)) {
  5673. this.ui.numTxt.visible = false;
  5674. }
  5675. else {
  5676. this.ui.numTxt.visible = true;
  5677. }
  5678. if (index < curDayIndex) {
  5679. this.ui.c1.selectedIndex = 1;
  5680. }
  5681. else if (index == curDayIndex) {
  5682. if (sameDay) {
  5683. this.ui.c1.selectedIndex = 2;
  5684. }
  5685. else {
  5686. this.ui.c1.selectedIndex = 2;
  5687. }
  5688. }
  5689. else {
  5690. this.ui.c1.selectedIndex = 0;
  5691. }
  5692. }
  5693. }
  5694. class UISign extends UIBase {
  5695. constructor() {
  5696. super();
  5697. this.curDayIndex = 0;
  5698. this.starX = 0;
  5699. }
  5700. onConstructor() {
  5701. this.ui = ui_UISign.createInstance();
  5702. this.contentPane = this.ui;
  5703. this.isEject = false;
  5704. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5705. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5706. this.initSignItem();
  5707. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  5708. this.addUIClick(this.ui.againBtn, this.againGetAward);
  5709. }
  5710. show() {
  5711. super.show();
  5712. this.ui.t0.play();
  5713. this.playSecretaryIdle();
  5714. this.updateSign();
  5715. }
  5716. initSignItem() {
  5717. this.signArr = [];
  5718. for (let index = 0; index < 6; index++) {
  5719. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  5720. this.signArr.push(temp);
  5721. }
  5722. this.signMax = new SignMax(this.ui.myNode.day7);
  5723. if (Moyu.isKs)
  5724. this.ui.closeNode.closeBtn.x += 100;
  5725. }
  5726. updateSign() {
  5727. let sameDay = xGame.common.judgeSameDay();
  5728. let max = 7;
  5729. this.curDayIndex = DataMgr.getSignData();
  5730. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  5731. this.curDayIndex = 0;
  5732. if (!sameDay) {
  5733. this.ui.normalBtn.visible = true;
  5734. this.ui.tipsNode.visible = false;
  5735. this.ui.againBtn.visible = false;
  5736. }
  5737. else {
  5738. this.ui.normalBtn.visible = false;
  5739. let again = DataMgr.getExtraSign();
  5740. let isCurrency = false;
  5741. let index = this.curDayIndex;
  5742. if (index == 0)
  5743. index = 7;
  5744. let award = cfgTable.signData[index].award;
  5745. let num = award[0].split("-")[0];
  5746. if (num == "1" || num == "2")
  5747. isCurrency = true;
  5748. let showAgain = again == 0 && isCurrency;
  5749. this.ui.againBtn.visible = showAgain;
  5750. this.ui.tipsNode.visible = !showAgain;
  5751. }
  5752. for (let index = 0; index < this.signArr.length; index++) {
  5753. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  5754. }
  5755. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  5756. }
  5757. playSecretaryIdle() {
  5758. let parent = this.ui.secretary.displayObject;
  5759. parent.destroyChildren();
  5760. let xx = this.ui.secretary.width / 2;
  5761. let yy = this.ui.secretary.height;
  5762. let scale = xGame.common.getSecretaryScale();
  5763. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5764. xGame.common.secretary.play(data, 0, true, parent);
  5765. }
  5766. closeSelf() {
  5767. this.hide();
  5768. }
  5769. normalGetAward() {
  5770. let sameDay = xGame.common.judgeSameDay();
  5771. if (!sameDay) {
  5772. let award = cfgTable.signData[this.curDayIndex + 1].award;
  5773. let temp;
  5774. let type;
  5775. let num;
  5776. let arr = [];
  5777. for (let index = 0; index < award.length; index++) {
  5778. temp = award[index].split("-");
  5779. type = parseInt(temp[0]);
  5780. num = parseInt(temp[1]);
  5781. let awardType = new AwardType();
  5782. awardType.num = num;
  5783. awardType.type = type;
  5784. arr.push(awardType);
  5785. }
  5786. xGame.common.getAward(arr, (watchVideo) => {
  5787. this.curDayIndex++;
  5788. if (this.curDayIndex > 7)
  5789. this.curDayIndex = 0;
  5790. DataMgr.setSignData(this.curDayIndex);
  5791. DataMgr.setSignTime(new Date().getTime());
  5792. if (watchVideo) {
  5793. DataMgr.setExtraSign(1);
  5794. Moyu.sendDataEvent("signIn1");
  5795. }
  5796. this.updateSign();
  5797. });
  5798. }
  5799. }
  5800. againGetAward() {
  5801. Moyu.sendDataEvent("signIn2");
  5802. console.log('zh:qjff_AD_for_uisign');
  5803. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  5804. }
  5805. else {
  5806. console.log('zh:AD 失败,直接发放奖励');
  5807. this.qjff_AD_for_uisign();
  5808. }
  5809. }
  5810. qjff_AD_for_uisign() {
  5811. let index = this.curDayIndex;
  5812. if (index == 0)
  5813. index = 7;
  5814. let award = cfgTable.signData[index].award;
  5815. let temp;
  5816. let type;
  5817. let num;
  5818. for (let index = 0; index < award.length; index++) {
  5819. temp = award[index].split("-");
  5820. type = parseInt(temp[0]);
  5821. num = parseInt(temp[1]) * 3;
  5822. xGame.common.playObjFlyAnim(num, type);
  5823. }
  5824. DataMgr.setExtraSign(1);
  5825. this.updateSign();
  5826. }
  5827. }
  5828. UISign.uiName = "UISign";
  5829. class ui_UISkill extends fgui.GComponent {
  5830. static createInstance() {
  5831. return (fgui.UIPackage.createObject("game", "UISkill"));
  5832. }
  5833. onConstruct() {
  5834. this.n48 = (this.getChild("n48"));
  5835. this.n0 = (this.getChild("n0"));
  5836. this.secretary = (this.getChild("secretary"));
  5837. this.talkNode = (this.getChild("talkNode"));
  5838. this.closeNode = (this.getChild("closeNode"));
  5839. this.moneyNode = (this.getChild("moneyNode"));
  5840. this.skillNode = (this.getChild("skillNode"));
  5841. this.guideNode = (this.getChild("guideNode"));
  5842. }
  5843. }
  5844. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  5845. class SkillDisplay {
  5846. constructor(ui, data, uiIndex) {
  5847. this.starX = 0;
  5848. this.starY = 0;
  5849. this.index = 0;
  5850. this.ui = ui;
  5851. this.data = data;
  5852. this.index = uiIndex;
  5853. this.initSelf();
  5854. console.log('zh:SkillDisplay constructor this.skillData=', data);
  5855. }
  5856. initSelf() {
  5857. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  5858. this.ui.nameTxt.text = this.data.name;
  5859. this.ui.describeTxt.text = this.data.describe;
  5860. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  5861. this.ui.startBtn.onClick(this, this.startGame);
  5862. this.updateSelf();
  5863. }
  5864. updateSelf() {
  5865. this.checkTry();
  5866. let level = DataMgr.getBigSkillByIndex(this.index);
  5867. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  5868. }
  5869. checkTry() {
  5870. let index = this.index;
  5871. let level = DataMgr.getBigSkillByIndex(index);
  5872. if (level == null) {
  5873. DataMgr.setBigSkill(index, 1, false);
  5874. level = 1;
  5875. }
  5876. this.ui.levelTxt.text = "LV." + level;
  5877. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  5878. this.ui.tryNode.visible = true;
  5879. else
  5880. this.ui.tryNode.visible = false;
  5881. }
  5882. clickAddLevel() {
  5883. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5884. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  5885. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  5886. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  5887. this.qjff_AD_for_skilldisplay_clickAddLevel();
  5888. }
  5889. else {
  5890. console.log('zh:AD 失败,直接发放奖励');
  5891. this.qjff_AD_for_skilldisplay_clickAddLevel();
  5892. }
  5893. }
  5894. qjff_AD_for_skilldisplay_clickAddLevel() {
  5895. DataMgr.setBigSkill(this.data.index, 1);
  5896. this.updateSelf();
  5897. xGame.common.upSkillLevel = true;
  5898. }
  5899. startGame() {
  5900. if (this.data.index == 3) {
  5901. alert('Coming soon!');
  5902. return;
  5903. }
  5904. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5905. let needCoin = xGame.common.bigMoveNeedCoin;
  5906. xGame.common.passAwardCoin = 2000;
  5907. let guide = DataMgr.getSkillGuide();
  5908. console.log('zh:startGame guide=' + guide);
  5909. xGame.common.temSelfLevel = 0;
  5910. if (guide == 0) {
  5911. needCoin = 0;
  5912. xGame.common.temSelfLevel = 100;
  5913. }
  5914. if (DataMgr.coinEnough(needCoin)) {
  5915. DataMgr.setCoin(-needCoin);
  5916. xGame.common.curPlayerSkillType = this.index;
  5917. if (guide == 0)
  5918. xGame.common.curPlayerSkillType = 0;
  5919. xGame.uiMgr.Show(UIGame);
  5920. xGame.uiMgr.Hide(UIMain);
  5921. xGame.uiMgr.Show(UIMatching, () => {
  5922. xGame.common.gameUI.ui.alpha = 1;
  5923. xGame.common.gameUI.startGame();
  5924. xGame.uiMgr.Hide(UISkill);
  5925. });
  5926. }
  5927. else {
  5928. xGame.uiMgr.Show(UIAddProp, 0);
  5929. Moyu.sendDataEvent("AddCoinVideo");
  5930. }
  5931. }
  5932. }
  5933. class UISkill extends UIBase {
  5934. constructor() {
  5935. super();
  5936. this.skillData = [];
  5937. }
  5938. onConstructor() {
  5939. this.ui = ui_UISkill.createInstance();
  5940. this.contentPane = this.ui;
  5941. this.isEject = false;
  5942. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5943. this.initSkillData();
  5944. console.log('zh:aaaaaa1111111111');
  5945. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  5946. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  5947. console.log('zh:aaaaaa22222222');
  5948. this.displayList = [];
  5949. this.ui.skillNode.skillList.numItems = 3;
  5950. this.addUIClick(this.ui, this.interuptSecretary);
  5951. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  5952. this.ui.talkNode.visible = false;
  5953. if (Moyu.isKs)
  5954. this.ui.closeNode.closeBtn.x += 100;
  5955. }
  5956. show() {
  5957. super.show();
  5958. this.playSecretaryIdle();
  5959. this.moneyNode.ui.c1.selectedIndex = 1;
  5960. Laya.timer.clearAll(this);
  5961. xGame.soundMgr.playSound("s_start");
  5962. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5963. let guide = DataMgr.getSkillGuide();
  5964. this.ui.guideNode.visible = guide == 0;
  5965. let item = this.getSkillItemByUIIndex(0);
  5966. if (guide == 0) {
  5967. item.ui.c1.selectedIndex = 1;
  5968. }
  5969. else {
  5970. item.ui.c1.selectedIndex = 0;
  5971. }
  5972. this.ui.guideNode.guideBtn.visible = guide == 0;
  5973. for (let index = 0; index < this.displayList.length; index++) {
  5974. this.displayList[index].checkTry();
  5975. }
  5976. }
  5977. getSkillItemByUIIndex(cur) {
  5978. for (let index = 0; index < this.displayList.length; index++) {
  5979. if (this.displayList[index].index == cur) {
  5980. return this.displayList[index];
  5981. }
  5982. }
  5983. }
  5984. enterGuideLevel() {
  5985. let item = this.getSkillItemByUIIndex(0);
  5986. item.startGame();
  5987. if (DataMgr.getNewUser())
  5988. Moyu.sendDataEvent("gameStart1");
  5989. }
  5990. initSkillData() {
  5991. this.skillData = [];
  5992. let nameList = xGame.common.skillNameList;
  5993. let iconList = xGame.common.skillIconList;
  5994. let describeList = [
  5995. "Jump shot executed — ball bounced and pocketed an extra one!",
  5996. "Bonus Sweep: A random follow-up strike hits 1 extra ball after your shot!",
  5997. "Freeze Effect: Your shot freezes 1 random ball — enemy can’t hit it, and others bounce off!"
  5998. ];
  5999. console.log('zh:initSkillData 111111111');
  6000. let data;
  6001. for (let index = 0; index < nameList.length; index++) {
  6002. data = {};
  6003. data.name = nameList[index];
  6004. data.icon = iconList[index];
  6005. data.describe = describeList[index];
  6006. data.index = index;
  6007. this.skillData.push(data);
  6008. }
  6009. }
  6010. updateSkillItem(index, target) {
  6011. if (this.displayList[index] == null) {
  6012. let uiIndex;
  6013. switch (index) {
  6014. case 0:
  6015. uiIndex = 1;
  6016. break;
  6017. case 1:
  6018. uiIndex = 0;
  6019. break;
  6020. case 2:
  6021. uiIndex = 2;
  6022. break;
  6023. case 3:
  6024. uiIndex = 3;
  6025. break;
  6026. default:
  6027. break;
  6028. }
  6029. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  6030. this.displayList.push(temp);
  6031. }
  6032. }
  6033. playSecretaryIdle() {
  6034. let parent = this.ui.secretary.displayObject;
  6035. parent.destroyChildren();
  6036. let xx = this.ui.secretary.width / 2;
  6037. let yy = this.ui.secretary.height;
  6038. let scale = xGame.common.getSecretaryScale();
  6039. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6040. xGame.common.secretary.play(data, 0, true, parent);
  6041. }
  6042. returnUIMain() {
  6043. this.hide();
  6044. xGame.common.stopGirlPop(this.ui.talkNode);
  6045. xGame.uiMgr.Show(UIMain);
  6046. }
  6047. interuptSecretary() {
  6048. Laya.timer.clearAll(this);
  6049. this.playSecretaryRandomSound();
  6050. }
  6051. playSecretaryRandomSound() {
  6052. if (this.isHide)
  6053. return;
  6054. let time = xGame.common.randomNum(45000, 60000);
  6055. Laya.timer.once(time, this, () => {
  6056. if (this.isHide)
  6057. return;
  6058. let index = xGame.common.randomNum(4, 7);
  6059. xGame.soundMgr.playSound("s_main0" + index);
  6060. let words = 1;
  6061. switch (index) {
  6062. case 4:
  6063. words = 5;
  6064. break;
  6065. case 5:
  6066. words = 3;
  6067. break;
  6068. case 6:
  6069. words = 6;
  6070. break;
  6071. case 7:
  6072. words = 7;
  6073. break;
  6074. default:
  6075. break;
  6076. }
  6077. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6078. this.playSecretaryRandomSound();
  6079. });
  6080. }
  6081. }
  6082. UISkill.uiName = "UISkill";
  6083. class ui_UIMsg extends fgui.GComponent {
  6084. static createInstance() {
  6085. return (fgui.UIPackage.createObject("game", "UIMsg"));
  6086. }
  6087. onConstruct() {
  6088. this.tipsNode = (this.getChild("tipsNode"));
  6089. }
  6090. }
  6091. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  6092. class UIMsg extends UIBase {
  6093. constructor() {
  6094. super();
  6095. }
  6096. onConstructor() {
  6097. this.ui = ui_UIMsg.createInstance();
  6098. this.contentPane = this.ui;
  6099. this.isEject = false;
  6100. this.isMuti = true;
  6101. }
  6102. show(msg, callback) {
  6103. super.show();
  6104. this.ui.tipsNode.msgTxt.text = msg;
  6105. this.ui.alpha = 1;
  6106. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  6107. this.hide();
  6108. callback && callback();
  6109. }), 1000);
  6110. }
  6111. }
  6112. UIMsg.uiName = "UIMsg";
  6113. class ui_UIModeSelection extends fgui.GComponent {
  6114. static createInstance() {
  6115. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  6116. }
  6117. onConstruct() {
  6118. this.n19 = (this.getChild("n19"));
  6119. this.closeBtn = (this.getChild("closeBtn"));
  6120. this.myNode = (this.getChild("myNode"));
  6121. this.t0 = this.getTransition("t0");
  6122. }
  6123. }
  6124. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  6125. class UIModeSelection extends UIBase {
  6126. constructor() {
  6127. super();
  6128. }
  6129. onConstructor() {
  6130. this.ui = ui_UIModeSelection.createInstance();
  6131. this.contentPane = this.ui;
  6132. this.isEject = false;
  6133. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  6134. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  6135. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  6136. this.addUIClick(this.ui.closeBtn, this.hide);
  6137. this.peopleArr = [650, 6900, 3800];
  6138. this.peopleOffest = [50, 500, 200];
  6139. this.updateSelf();
  6140. }
  6141. show(callback) {
  6142. super.show();
  6143. this.ui.t0.play();
  6144. this.callback = callback;
  6145. }
  6146. updateSelf() {
  6147. let cfg = cfgTable.modeselectData;
  6148. for (let index = 1; index <= 3; index++) {
  6149. let node = this.ui.myNode["type" + index];
  6150. node.need.text = cfg[index].need;
  6151. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  6152. node.peopleTxt.text = this.getRandPeople(index - 1);
  6153. }
  6154. }
  6155. enterGame(type) {
  6156. xGame.common.classicRoomType = type;
  6157. let cfg = cfgTable.modeselectData[type];
  6158. let need = cfg.need;
  6159. xGame.common.passAwardCoin = cfg.award;
  6160. if (DataMgr.coinEnough(need)) {
  6161. DataMgr.setCoin(-need);
  6162. this.ui.myNode["type" + type].t0.play();
  6163. Laya.timer.once(200, this, () => {
  6164. this.callback && this.callback();
  6165. });
  6166. }
  6167. else {
  6168. Moyu.sendDataEvent("AddCoinVideo");
  6169. xGame.uiMgr.Show(UIAddProp, 0);
  6170. }
  6171. }
  6172. getRandPeople(index) {
  6173. let rand = this.peopleOffest[index];
  6174. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  6175. }
  6176. }
  6177. UIModeSelection.uiName = "UIModeSelection";
  6178. class ui_UIGetAward extends fgui.GComponent {
  6179. static createInstance() {
  6180. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  6181. }
  6182. onConstruct() {
  6183. this.n4 = (this.getChild("n4"));
  6184. this.n0 = (this.getChild("n0"));
  6185. this.myList = (this.getChild("myList"));
  6186. this.n1 = (this.getChild("n1"));
  6187. this.eftNode = (this.getChild("eftNode"));
  6188. this.btnNode = (this.getChild("btnNode"));
  6189. this.t0 = this.getTransition("t0");
  6190. }
  6191. }
  6192. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  6193. class UIGetAward extends UIBase {
  6194. constructor() {
  6195. super();
  6196. this.showTriple = true;
  6197. }
  6198. onConstructor() {
  6199. this.ui = ui_UIGetAward.createInstance();
  6200. this.contentPane = this.ui;
  6201. this.isEject = false;
  6202. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  6203. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  6204. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  6205. }
  6206. show(arr, showTriple, callback) {
  6207. super.show();
  6208. this.ui.t0.play();
  6209. this.ui.eftNode.visible = true;
  6210. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  6211. this.ui.eftNode.visible = false;
  6212. }), 1, 0, 0, 0.9);
  6213. this.awardArr = arr;
  6214. this.showTriple = showTriple;
  6215. this.callback = callback;
  6216. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  6217. this.ui.myList.numItems = arr.length;
  6218. xGame.soundMgr.playSound("getaward");
  6219. }
  6220. updateSelf(index, obj) {
  6221. let temp = this.awardArr[index];
  6222. let icon = this.getIcon(temp.type);
  6223. let str = icon;
  6224. if (temp.type > 2) {
  6225. str = "s" + icon;
  6226. }
  6227. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  6228. obj.myIcon.rotation = 0;
  6229. obj.numTxt.text = temp.num + "";
  6230. obj.numTxt.visible = temp.type > 2 ? false : true;
  6231. obj.nameTxt.text = this.getNameStr(temp.type);
  6232. }
  6233. renderItem(index, obj) {
  6234. this.updateSelf(index, obj);
  6235. }
  6236. tripleGetAward() {
  6237. console.log('zh:qjff_AD_for_uigetAward');
  6238. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  6239. }
  6240. else {
  6241. console.log('zh:AD 失败,直接发放奖励');
  6242. this.qjff_AD_for_uigetAward();
  6243. }
  6244. }
  6245. qjff_AD_for_uigetAward() {
  6246. this.getAward(3);
  6247. }
  6248. normalGetAward() {
  6249. if (PlatMgr.isMisVideo())
  6250. this.tripleGetAward();
  6251. else
  6252. this.getAward();
  6253. }
  6254. getAward(times = 1) {
  6255. this.hide();
  6256. for (let index = 0; index < this.awardArr.length; index++) {
  6257. this.awardArr[index].num *= times;
  6258. }
  6259. this.callback && this.callback(times != 1);
  6260. }
  6261. getIcon(type) {
  6262. switch (type) {
  6263. case Prop.diamond:
  6264. return "ty_zs";
  6265. case Prop.coin:
  6266. return "ty_jb";
  6267. case Prop.gan1:
  6268. return "qg1";
  6269. case Prop.gan2:
  6270. return "qg2";
  6271. case Prop.gan3:
  6272. return "qg3";
  6273. case Prop.gan4:
  6274. return "qg4";
  6275. default:
  6276. break;
  6277. }
  6278. }
  6279. getNameStr(type) {
  6280. switch (type) {
  6281. case Prop.diamond:
  6282. return "Diamond";
  6283. case Prop.coin:
  6284. return "Coins";
  6285. case Prop.gan1:
  6286. case Prop.gan2:
  6287. case Prop.gan3:
  6288. case Prop.gan4:
  6289. return cfgTable.ballrodData[type - 1].name;
  6290. default:
  6291. break;
  6292. }
  6293. }
  6294. }
  6295. UIGetAward.uiName = "UIGetAward";
  6296. class ui_UIRepentProp extends fgui.GComponent {
  6297. static createInstance() {
  6298. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  6299. }
  6300. onConstruct() {
  6301. this.c1 = this.getController("c1");
  6302. this.n11 = (this.getChild("n11"));
  6303. this.regretNode = (this.getChild("regretNode"));
  6304. this.helpLineNode = (this.getChild("helpLineNode"));
  6305. this.t0 = this.getTransition("t0");
  6306. }
  6307. }
  6308. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  6309. class UIRepentProp extends UIBase {
  6310. constructor() {
  6311. super();
  6312. this.viewType = 0;
  6313. this.regretType = 0;
  6314. }
  6315. onConstructor() {
  6316. this.ui = ui_UIRepentProp.createInstance();
  6317. this.contentPane = this.ui;
  6318. this.isEject = false;
  6319. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  6320. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  6321. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  6322. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  6323. }
  6324. show(viewType, regretType, callback) {
  6325. PlatMgr.showInsert(true);
  6326. this.viewType = viewType;
  6327. this.regretType = regretType;
  6328. this.callback = callback;
  6329. super.show();
  6330. this.ui.t0.play();
  6331. this.ui.c1.selectedIndex = this.viewType;
  6332. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  6333. if (this.viewType == 0) {
  6334. let guide = DataMgr.getGuideHelpLine();
  6335. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  6336. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  6337. }
  6338. xGame.common.gameMgr.gamePause = true;
  6339. }
  6340. hideSelf() {
  6341. xGame.common.gameMgr.gamePause = false;
  6342. this.callback && this.callback(false);
  6343. this.hide();
  6344. }
  6345. videoRegret() {
  6346. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  6347. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  6348. }
  6349. else {
  6350. console.log('zh:AD 失败,直接发放奖励');
  6351. this.qjff_AD_for_UIrepentProp_videoRegret();
  6352. }
  6353. }
  6354. qjff_AD_for_UIrepentProp_videoRegret() {
  6355. this.callback && this.callback(true);
  6356. this.hideSelf();
  6357. }
  6358. videoAddHelpLine() {
  6359. let guide = DataMgr.getGuideHelpLine();
  6360. if (guide == 0) {
  6361. this.callback && this.callback(true);
  6362. this.hideSelf();
  6363. DataMgr.setGuideHelpLine();
  6364. xGame.common.gameUI.ui.guideNode.visible = false;
  6365. }
  6366. else {
  6367. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  6368. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  6369. }
  6370. else {
  6371. console.log('zh:AD 失败,直接发放奖励');
  6372. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  6373. }
  6374. }
  6375. }
  6376. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  6377. this.callback && this.callback(true);
  6378. this.hideSelf();
  6379. }
  6380. }
  6381. UIRepentProp.uiName = "UIRepentProp";
  6382. class UIMain extends UIBase {
  6383. constructor() {
  6384. super();
  6385. this.firstEnter = true;
  6386. }
  6387. nativeCallJs(msg) {
  6388. let t = msg;
  6389. console.log("zh: nativeCallJs 奖励开始发放:", t);
  6390. switch (t) {
  6391. case 'qjff_chouJiang':
  6392. let dui = xGame.uiMgr.getUI(UIDraw);
  6393. dui.qjff_chouJiang();
  6394. break;
  6395. case 'qjff_AD_for_uisign':
  6396. let dui2 = xGame.uiMgr.getUI(UISign);
  6397. dui2.qjff_AD_for_uisign();
  6398. break;
  6399. case 'qjff_AD_for_uitry':
  6400. let dui3 = xGame.uiMgr.getUI(UITry);
  6401. dui3.qjff_AD_for_uitry();
  6402. break;
  6403. case 'qjff_AD_for_uipower':
  6404. let dui4 = xGame.uiMgr.getUI(UIPower);
  6405. dui4.qjff_AD_for_uipower();
  6406. break;
  6407. case 'qjff_AD_for_uigetAward':
  6408. let dui5 = xGame.uiMgr.getUI(UIGetAward);
  6409. dui5.qjff_AD_for_uigetAward();
  6410. break;
  6411. case 'qjff_AD_for_uiGameEnd':
  6412. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  6413. let dui6 = xGame.uiMgr.getUI(UIGameEnd);
  6414. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  6415. break;
  6416. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  6417. let dui7 = xGame.uiMgr.getUI(UIAddProp);
  6418. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  6419. break;
  6420. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  6421. let dui8 = xGame.uiMgr.getUI(UIAddProp);
  6422. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  6423. break;
  6424. case 'qjff_AD_for_UIrepentProp_videoRegret':
  6425. let dui9 = xGame.uiMgr.getUI(UIRepentProp);
  6426. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  6427. break;
  6428. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  6429. let dui10 = xGame.uiMgr.getUI(UIRepentProp);
  6430. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  6431. break;
  6432. case 'qjff_AD_for_UIBOX_onOpenBox':
  6433. let dui11 = xGame.uiMgr.getUI(UIBox);
  6434. dui11.qjff_AD_for_UIBOX_onOpenBox();
  6435. break;
  6436. case 'qjff_AD_for_UIAddCoin':
  6437. let dui12 = xGame.uiMgr.getUI(UIAddCoin);
  6438. dui12.qjff_AD_for_UIAddCoin();
  6439. break;
  6440. case '111a':
  6441. let dui14 = xGame.uiMgr.getUI(UISign);
  6442. dui14.qjff_AD_for_uisign();
  6443. break;
  6444. case '222a':
  6445. let dui15 = xGame.uiMgr.getUI(UISign);
  6446. dui15.qjff_AD_for_uisign();
  6447. break;
  6448. case '333a':
  6449. let dui16 = xGame.uiMgr.getUI(UISign);
  6450. dui16.qjff_AD_for_uisign();
  6451. break;
  6452. default:
  6453. console.log('zh:未知的方法名字' + t);
  6454. break;
  6455. }
  6456. }
  6457. onConstructor() {
  6458. console.log('zh: UIMain onConstructor');
  6459. this.ui = ui_UIMain.createInstance();
  6460. this.contentPane = this.ui;
  6461. this.isEject = false;
  6462. this.addEvent();
  6463. this.addClickSpine();
  6464. this.settingNode = new SettingNode(this.ui.settingNode);
  6465. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6466. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  6467. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  6468. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  6469. let curUse = DataMgr.getCurSecretary();
  6470. this.changeSecretary(curUse);
  6471. this.ui.talkNode.visible = false;
  6472. let guide = DataMgr.getSkillGuide();
  6473. if (xGame.common.isNewDay && guide == 1) {
  6474. xGame.common.isNewDay = false;
  6475. xGame.soundMgr.playSound("s_main01");
  6476. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6477. console.log("播放小秘书每天语音");
  6478. }
  6479. this.onGetUserInfo();
  6480. this.ui.n83.visible = false;
  6481. Moyu.setShareInfo("8Ball Fury", ["台球", "万宁", "桌球"], '2300002254');
  6482. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  6483. }
  6484. changeSecretary(curUse) {
  6485. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  6486. xGame.common.secretary && xGame.common.secretary.dispose();
  6487. this.addSecretarySpine(name);
  6488. }
  6489. addSecretarySpine(name) {
  6490. let spine = new SpineMgr(name, () => {
  6491. this.playSecretaryIdle();
  6492. });
  6493. xGame.common.secretary = spine;
  6494. }
  6495. addClickSpine() {
  6496. let clickSpine = new SpineMgr("dianji", () => {
  6497. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  6498. let parent = Laya.stage;
  6499. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  6500. clickSpine.play(data, 0, false, parent, (spine) => {
  6501. spine.destroy(true);
  6502. });
  6503. });
  6504. });
  6505. }
  6506. addEvent() {
  6507. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  6508. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  6509. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  6510. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  6511. this.addUIClick(this.ui.weeklyBtn, this.startWeekly);
  6512. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  6513. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  6514. this.addUIClick(this.ui, this.interuptSecretary);
  6515. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  6516. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  6517. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  6518. this.addUIClick(this.ui.shopBtn, this.openShopView);
  6519. this.addUIClick(this.ui.signBtn, this.openSignView);
  6520. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  6521. }
  6522. show(showFailWords) {
  6523. super.show();
  6524. this.moneyNode.ui.c1.selectedIndex = 1;
  6525. this.playSecretaryIdle();
  6526. xGame.soundMgr.playMusic("caromhall01");
  6527. Laya.timer.clearAll(this);
  6528. this.playSecretaryRandomSound();
  6529. if (showFailWords) {
  6530. setTimeout(() => {
  6531. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  6532. let words = -1;
  6533. if (str == "s_main02") {
  6534. words = 2;
  6535. }
  6536. else {
  6537. words = 3;
  6538. }
  6539. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6540. xGame.soundMgr.playSound(str);
  6541. }, 300);
  6542. }
  6543. this.showGuide();
  6544. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  6545. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  6546. let guide = DataMgr.getSkillGuide();
  6547. if (guide == 1) {
  6548. let randTime = xGame.common.randomNum(300, 800);
  6549. if (this.firstEnter) {
  6550. this.firstEnter = false;
  6551. randTime += 900;
  6552. }
  6553. Laya.timer.once(randTime, this, () => {
  6554. xGame.common.autoPopUIView();
  6555. });
  6556. }
  6557. }
  6558. checkActive(show) {
  6559. }
  6560. showGuide() {
  6561. let guide = DataMgr.getSkillGuide();
  6562. this.ui.guideBtn.visible = guide == 0;
  6563. this.ui.enterGuide.visible = false;
  6564. this.ui.secretaryGuide.visible = guide == 0;
  6565. if (guide == 0) {
  6566. xGame.soundMgr.playSound("s_guide");
  6567. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6568. }
  6569. }
  6570. ensureSecretary() {
  6571. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  6572. this.ui.secretaryGuide.visible = false;
  6573. this.ui.enterGuide.visible = true;
  6574. this.ui.wordsNode.t0.play();
  6575. if (DataMgr.getNewUser())
  6576. Moyu.sendDataEvent("gameReady");
  6577. }
  6578. playSecretaryIdle() {
  6579. let parent = this.ui.secretary.displayObject;
  6580. parent.destroyChildren();
  6581. let xx = this.ui.secretary.width / 2;
  6582. let yy = this.ui.secretary.height;
  6583. let scale = xGame.common.getSecretaryScale();
  6584. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6585. console.log("zh:playSecretaryIdle", data);
  6586. xGame.common.secretary.play(data, 0, true, parent);
  6587. }
  6588. startGame(type) {
  6589. xGame.common.gameMode = type;
  6590. Moyu.sendDataEvent("PlayGame", { type: type });
  6591. switch (xGame.common.gameMode) {
  6592. case GameMode.classic:
  6593. let challengeTimes = DataMgr.getChallengeTimes();
  6594. if (challengeTimes == 0) {
  6595. xGame.uiMgr.Show(UIInvitation);
  6596. }
  6597. else {
  6598. this.beginGame();
  6599. }
  6600. break;
  6601. case GameMode.bigMove:
  6602. this.beginGame();
  6603. if (DataMgr.getNewUser())
  6604. Moyu.sendDataEvent("gameStart0");
  6605. break;
  6606. default:
  6607. break;
  6608. }
  6609. }
  6610. beginGame(isNice = false) {
  6611. if (xGame.common.gameMode == GameMode.classic) {
  6612. if (isNice) {
  6613. this.enterClassic();
  6614. }
  6615. else {
  6616. xGame.uiMgr.Show(UIModeSelection, () => {
  6617. this.enterClassic();
  6618. });
  6619. }
  6620. }
  6621. else if (xGame.common.gameMode == GameMode.bigMove) {
  6622. this.ui.enterGuide.visible = false;
  6623. xGame.uiMgr.Show(UISkill);
  6624. }
  6625. }
  6626. enterClassic() {
  6627. xGame.uiMgr.Show(UIGame);
  6628. xGame.uiMgr.Show(UIMatching, () => {
  6629. if (!this.isHide)
  6630. this.hide();
  6631. xGame.common.gameUI.ui.alpha = 1;
  6632. xGame.common.gameUI.startGame();
  6633. xGame.uiMgr.Hide(UIGameEnd);
  6634. });
  6635. }
  6636. startGlobal() {
  6637. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  6638. }
  6639. startWeekly() {
  6640. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  6641. }
  6642. zhouSaiMonth() {
  6643. console.log('zh: zhouSaiMonth 被调用');
  6644. }
  6645. startPlaceBall() {
  6646. xGame.uiMgr.Show(UILevelDisplay);
  6647. }
  6648. hide() {
  6649. super.hide();
  6650. xGame.common.stopGirlPop(this.ui.talkNode);
  6651. }
  6652. onGetUserInfo(force = false) {
  6653. if (Moyu.isWx) {
  6654. let info = Moyu.getSystemInfo();
  6655. if (info)
  6656. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  6657. }
  6658. else {
  6659. Moyu.initUser(this, this.freshUser, force);
  6660. }
  6661. if (!Moyu.hasUserInfo) {
  6662. let user = Moyu.getUserInfo();
  6663. user.headIcon = 'res/ty_touxiang.png';
  6664. }
  6665. this.freshUser();
  6666. }
  6667. freshUser() {
  6668. let user = Moyu.getUserInfo();
  6669. if (!user.isAuth) {
  6670. user.headIcon = 'res/ty_touxiang.png';
  6671. }
  6672. else
  6673. DataMgr.upRankData();
  6674. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  6675. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  6676. }
  6677. interuptSecretary() {
  6678. Laya.timer.clearAll(this);
  6679. this.playSecretaryRandomSound();
  6680. }
  6681. playSecretaryRandomSound() {
  6682. if (this.isHide)
  6683. return;
  6684. let time = xGame.common.randomNum(45000, 60000);
  6685. Laya.timer.once(time, this, () => {
  6686. if (this.isHide)
  6687. return;
  6688. let index = xGame.common.randomNum(4, 7);
  6689. xGame.soundMgr.playSound("s_main0" + index);
  6690. let words = 1;
  6691. switch (index) {
  6692. case 4:
  6693. words = 5;
  6694. break;
  6695. case 5:
  6696. words = 3;
  6697. break;
  6698. case 6:
  6699. words = 6;
  6700. break;
  6701. case 7:
  6702. words = 7;
  6703. break;
  6704. default:
  6705. break;
  6706. }
  6707. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6708. this.playSecretaryRandomSound();
  6709. });
  6710. }
  6711. openSecretaryView() {
  6712. xGame.uiMgr.Show(UISecretary);
  6713. Moyu.sendDataEvent("secretary");
  6714. }
  6715. openShopView() {
  6716. xGame.uiMgr.Show(UIShop);
  6717. }
  6718. openSignView() {
  6719. xGame.uiMgr.Show(UISign);
  6720. }
  6721. openDrawView() {
  6722. xGame.uiMgr.Show(UIDraw);
  6723. }
  6724. openRanking() {
  6725. xGame.uiMgr.Show(UIRanking);
  6726. Moyu.sendDataEvent("rankingList");
  6727. }
  6728. }
  6729. UIMain.uiName = "UIMain";
  6730. class UIGameEnd extends UIBase {
  6731. constructor() {
  6732. super();
  6733. this.success = false;
  6734. this.awardCoinNum = 1000;
  6735. this.awardDiamondNum = 10;
  6736. }
  6737. onConstructor() {
  6738. this.ui = ui_UIGameEnd.createInstance();
  6739. this.contentPane = this.ui;
  6740. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  6741. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  6742. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  6743. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6744. this.ui.talkNode.visible = false;
  6745. if (Moyu.isKs)
  6746. this.ui.closeNode.closeBtn.x += 100;
  6747. }
  6748. updateType() {
  6749. switch (xGame.common.gameMode) {
  6750. case GameMode.classic:
  6751. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  6752. this.ui.coinNode.visible = this.success;
  6753. if (!this.success) {
  6754. Laya.timer.once(500, this, () => {
  6755. xGame.uiMgr.Show(UIAddCoin);
  6756. });
  6757. }
  6758. this.ui.isGetAward.visible = false;
  6759. this.ui.leftBtn.c1.selectedIndex = 3;
  6760. this.ui.rightBtn.c1.selectedIndex = 0;
  6761. this.moneyNode.ui.c1.selectedIndex = 1;
  6762. break;
  6763. case GameMode.bigMove:
  6764. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  6765. this.ui.coinNode.visible = this.success;
  6766. if (xGame.common.gameMode == GameMode.bigMove) {
  6767. if (this.success) {
  6768. DataMgr.setSkillSuccessTimes(1, true);
  6769. DataMgr.setSkillAccTimes(1);
  6770. }
  6771. else {
  6772. DataMgr.setSkillSuccessTimes(0, false);
  6773. }
  6774. }
  6775. if (!this.success) {
  6776. Laya.timer.once(500, this, () => {
  6777. xGame.uiMgr.Show(UIAddCoin);
  6778. });
  6779. }
  6780. this.ui.isGetAward.visible = false;
  6781. this.ui.leftBtn.c1.selectedIndex = 3;
  6782. this.ui.rightBtn.c1.selectedIndex = 0;
  6783. this.moneyNode.ui.c1.selectedIndex = 1;
  6784. break;
  6785. case GameMode.placeBall:
  6786. this.ui.coinNode.visible = false;
  6787. if (this.success) {
  6788. if (xGame.common.placeBallStarNum == 3) {
  6789. this.ui.c1.selectedIndex = 2;
  6790. }
  6791. else {
  6792. this.ui.c1.selectedIndex = 3;
  6793. }
  6794. }
  6795. else {
  6796. this.ui.c1.selectedIndex = 4;
  6797. }
  6798. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  6799. if (cfg.type == PlaceBallType.challenge) {
  6800. this.ui.c1.selectedIndex = 2;
  6801. }
  6802. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  6803. this.updatePlaceBallBtn();
  6804. this.updatePlaceBallStarNum();
  6805. this.updatePlaceBallAwardState();
  6806. this.moneyNode.ui.c1.selectedIndex = 2;
  6807. this.moneyNode.checkPowerTime();
  6808. this.moneyNode.powerChange();
  6809. DataMgr.upRankData();
  6810. break;
  6811. default:
  6812. break;
  6813. }
  6814. }
  6815. updatePlaceBallBtn() {
  6816. this.ui.leftBtn.c1.selectedIndex = 5;
  6817. if (this.success) {
  6818. this.ui.rightBtn.c1.selectedIndex = 14;
  6819. }
  6820. else {
  6821. if (xGame.common.placeBallStarNum == 3) {
  6822. this.ui.rightBtn.c1.selectedIndex = 14;
  6823. }
  6824. else {
  6825. this.ui.rightBtn.c1.selectedIndex = 1;
  6826. }
  6827. }
  6828. }
  6829. updatePlaceBallStarNum() {
  6830. let starNum = xGame.common.placeBallStarNum;
  6831. if (starNum == 0)
  6832. this.ui.starNumNode.c1.selectedIndex = 3;
  6833. else {
  6834. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  6835. }
  6836. }
  6837. updatePlaceBallAwardState() {
  6838. let level = xGame.common.placeBallCurLevel;
  6839. let starNum = xGame.common.placeBallStarNum;
  6840. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  6841. let data = cfgTable.placeballData[level].award;
  6842. let cfg = cfgTable.placeballData[level];
  6843. this.awardDiamondNum = data[1];
  6844. this.awardCoinNum = data[0];
  6845. if (cfg.type == PlaceBallType.challenge) {
  6846. this.awardDiamondNum = 0;
  6847. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  6848. }
  6849. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  6850. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  6851. if (cfg.type == PlaceBallType.challenge) {
  6852. this.ui.awardNode.coinNode.visible = true;
  6853. }
  6854. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  6855. this.ui.awardNode.diamondNode.x = 265;
  6856. this.ui.awardNode.coinNode.x = 354;
  6857. }
  6858. else {
  6859. this.ui.awardNode.diamondNode.x = 291;
  6860. this.ui.awardNode.coinNode.x = 291;
  6861. }
  6862. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  6863. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  6864. if (this.awardCoinNum == 0) {
  6865. this.ui.awardNode.coinNode.numTxt.text = "";
  6866. }
  6867. if (getAward) {
  6868. this.ui.isGetAward.visible = true;
  6869. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  6870. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  6871. }
  6872. else {
  6873. this.ui.isGetAward.visible = false;
  6874. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  6875. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  6876. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  6877. }
  6878. else {
  6879. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  6880. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  6881. }
  6882. }
  6883. }
  6884. show(success) {
  6885. super.show();
  6886. xGame.eventMgr.event(RESET_GAME);
  6887. this.success = success;
  6888. Laya.timer.clearAll(this);
  6889. this.playSecretaryAni();
  6890. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  6891. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  6892. offsetTime = Math.floor(offsetTime / 1000);
  6893. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  6894. this.updateType();
  6895. Laya.timer.once(200, this, () => {
  6896. this.addAward(() => {
  6897. this.updateType();
  6898. Laya.timer.once(500, this, () => {
  6899. this.showChallengeLevel();
  6900. });
  6901. });
  6902. });
  6903. if (this.success) {
  6904. xGame.soundMgr.playSound('slots_roll01');
  6905. xGame.soundMgr.playSound("s_win");
  6906. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6907. }
  6908. else {
  6909. xGame.soundMgr.playSound('matchwin01');
  6910. xGame.soundMgr.playSound("s_lose");
  6911. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6912. }
  6913. if (!Moyu.isLegal)
  6914. PlatMgr.showBanner(true);
  6915. let challengeNum = DataMgr.getChallengeTimes();
  6916. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  6917. DataMgr.setChallengeTimes(1);
  6918. }
  6919. if (this.success && xGame.common.gameMode == GameMode.classic) {
  6920. DataMgr.setClassicTimes();
  6921. }
  6922. }
  6923. showChallengeLevel() {
  6924. if (DataMgr.getChallengeTimes() != 0)
  6925. return;
  6926. let skill = DataMgr.getSkillAccTimes();
  6927. let put = DataMgr.getPlaceBallLevelList().length;
  6928. if (skill >= 3 || put >= 5) {
  6929. xGame.uiMgr.Show(UIInvitation);
  6930. this.hide();
  6931. }
  6932. }
  6933. addAward(callback) {
  6934. if (!this.success) {
  6935. callback && callback();
  6936. return;
  6937. }
  6938. switch (xGame.common.gameMode) {
  6939. case GameMode.classic:
  6940. this.awardCoinNum = xGame.common.passAwardCoin;
  6941. this.awardDiamondNum = 0;
  6942. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  6943. break;
  6944. case GameMode.bigMove:
  6945. this.awardCoinNum = xGame.common.passAwardCoin;
  6946. this.awardDiamondNum = 0;
  6947. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  6948. callback && callback();
  6949. break;
  6950. case GameMode.placeBall:
  6951. let level = xGame.common.placeBallCurLevel;
  6952. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  6953. if (xGame.common.placeBallStarNum != 3) {
  6954. callback && callback();
  6955. return;
  6956. }
  6957. else {
  6958. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  6959. if (getAward) {
  6960. callback && callback();
  6961. return;
  6962. }
  6963. }
  6964. let cfg = cfgTable.placeballData[level];
  6965. let data = cfgTable.placeballData[level].award;
  6966. this.awardCoinNum = data[0];
  6967. this.awardDiamondNum = data[1];
  6968. if (cfg.type == PlaceBallType.challenge) {
  6969. this.awardDiamondNum = 0;
  6970. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  6971. }
  6972. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  6973. let diamondAward;
  6974. if (this.awardDiamondNum > 0) {
  6975. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  6976. xGame.common.getAward([diamondAward, coinAward], callback);
  6977. }
  6978. else {
  6979. xGame.common.getAward([coinAward], callback);
  6980. }
  6981. if (cfg.type == PlaceBallType.normal) {
  6982. DataMgr.setPlaceBallAward(level);
  6983. }
  6984. break;
  6985. default:
  6986. break;
  6987. }
  6988. }
  6989. playSecretaryAni_old() {
  6990. let parent = this.ui.secretary.displayObject;
  6991. parent.destroyChildren();
  6992. let xx = this.ui.secretary.width / 2;
  6993. let yy = this.ui.secretary.height;
  6994. let scale = xGame.common.getSecretaryScale();
  6995. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6996. if (this.success) {
  6997. let rand = Math.random() <= 0.5 ? 2 : 3;
  6998. xGame.common.secretary.play(data, rand, false, parent, () => {
  6999. xGame.common.secretary.play(data, 1, true, parent);
  7000. });
  7001. }
  7002. else {
  7003. xGame.common.secretary.play(data, 0, true, parent);
  7004. }
  7005. }
  7006. playSecretaryAni() {
  7007. let parent = this.ui.secretary.displayObject;
  7008. parent.destroyChildren();
  7009. let xx = this.ui.secretary.width / 2;
  7010. let yy = this.ui.secretary.height;
  7011. let scale = xGame.common.getSecretaryScale();
  7012. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7013. if (this.success) {
  7014. let rand = 0;
  7015. xGame.common.secretary.play(data, 0, true, parent);
  7016. }
  7017. else {
  7018. xGame.common.secretary.play(data, 0, true, parent);
  7019. }
  7020. }
  7021. restartGame() {
  7022. switch (xGame.common.gameMode) {
  7023. case GameMode.classic:
  7024. xGame.eventMgr.event(RESTART_GAME);
  7025. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7026. break;
  7027. case GameMode.bigMove:
  7028. this.hide();
  7029. xGame.eventMgr.event(RESTART_GAME);
  7030. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7031. break;
  7032. default:
  7033. break;
  7034. }
  7035. }
  7036. hide() {
  7037. super.hide();
  7038. xGame.common.stopGirlPop(this.ui.talkNode);
  7039. PlatMgr.showBanner(false);
  7040. }
  7041. returnHome() {
  7042. this.hide();
  7043. let showFailWords = !this.success;
  7044. xGame.uiMgr.Show(UIMain, showFailWords);
  7045. }
  7046. clickLeftBtn() {
  7047. switch (xGame.common.gameMode) {
  7048. case GameMode.classic:
  7049. case GameMode.bigMove:
  7050. this.returnHome();
  7051. break;
  7052. case GameMode.placeBall:
  7053. let level = xGame.common.placeBallCurLevel;
  7054. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  7055. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7056. break;
  7057. default:
  7058. break;
  7059. }
  7060. }
  7061. powerStartPlaceBallLevel(level, btn) {
  7062. if (DataMgr.powerEnough()) {
  7063. btn.touchable = false;
  7064. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  7065. btn.touchable = true;
  7066. DataMgr.setPower(-1);
  7067. xGame.eventMgr.event(POWER_TIME);
  7068. this.startPlaceBallLevel(level);
  7069. }));
  7070. }
  7071. else {
  7072. xGame.uiMgr.Show(UIPower, 0);
  7073. }
  7074. }
  7075. clickRightBtn() {
  7076. switch (xGame.common.gameMode) {
  7077. case GameMode.classic:
  7078. console.log('zh:clickRightBtn 111');
  7079. case GameMode.bigMove:
  7080. console.log('zh:clickRightBtn 222');
  7081. this.restartGame();
  7082. break;
  7083. case GameMode.placeBall:
  7084. console.log('zh:clickRightBtn 333');
  7085. let level = xGame.common.placeBallCurLevel;
  7086. let data = DataMgr.getPlaceBallLevel(level);
  7087. let curPss = data.play && !data.isCur;
  7088. if (curPss) {
  7089. console.log('zh:clickRightBtn 333-111');
  7090. console.log('zh:当前LV=' + level);
  7091. if (level == 60) {
  7092. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  7093. Laya.timer.once(3000, this, () => {
  7094. this.returnHome();
  7095. });
  7096. }
  7097. else {
  7098. this.powerStartPlaceBallLevel(level + 1, this.ui.rightBtn);
  7099. }
  7100. }
  7101. else {
  7102. console.log('zh:clickRightBtn 333-000');
  7103. Moyu.sendDataEvent("placeBallNextLevel");
  7104. console.log('zh:qjff_AD_for_uiGameEnd');
  7105. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  7106. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  7107. }
  7108. else {
  7109. console.log('zh:AD 失败,直接发放奖励');
  7110. this.qjff_AD_for_uiGameEnd(level);
  7111. }
  7112. }
  7113. break;
  7114. default:
  7115. console.log('zh:clickRightBtn 444');
  7116. break;
  7117. }
  7118. }
  7119. qjff_AD_for_uiGameEnd(level) {
  7120. DataMgr.setPlaceBallLevel(level, 1);
  7121. this.startPlaceBallLevel(level + 1);
  7122. }
  7123. startPlaceBallLevel(level) {
  7124. xGame.common.gameMode = GameMode.placeBall;
  7125. xGame.common.placeBallCurLevel = level;
  7126. xGame.uiMgr.Show(UIGame);
  7127. this.hide();
  7128. }
  7129. }
  7130. UIGameEnd.uiName = "UIGameEnd";
  7131. class ui_UIVideoShare extends fgui.GComponent {
  7132. static createInstance() {
  7133. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  7134. }
  7135. onConstruct() {
  7136. this.n10 = (this.getChild("n10"));
  7137. this.myNode = (this.getChild("myNode"));
  7138. this.t0 = this.getTransition("t0");
  7139. }
  7140. }
  7141. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  7142. class UIVideoShare extends UIBase {
  7143. constructor() {
  7144. super();
  7145. this.success = false;
  7146. this.awardNum = 0;
  7147. this.isShared = true;
  7148. }
  7149. onConstructor() {
  7150. this.ui = ui_UIVideoShare.createInstance();
  7151. this.contentPane = this.ui;
  7152. this.isEject = false;
  7153. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  7154. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  7155. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  7156. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  7157. }
  7158. show(success) {
  7159. super.show();
  7160. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  7161. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  7162. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  7163. this.success = success;
  7164. let time = xGame.common.randomNum(600, 1500);
  7165. Moyu.showInsertAd(time, 60000);
  7166. if (success)
  7167. xGame.soundMgr.playSound("applause");
  7168. this.ui.t0.play();
  7169. this.checkShareState();
  7170. let times = DataMgr.getDailyVideoShareTimes();
  7171. this.awardNum = times == 0 ? 2000 : 200;
  7172. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  7173. }
  7174. checkShareState() {
  7175. if (PlatMgr.forceShare == 0) {
  7176. this.ui.myNode.closeBtn.visible = true;
  7177. this.ui.myNode.tipsNode.visible = false;
  7178. this.ui.myNode.closeBtn.x = 90;
  7179. this.ui.myNode.shareBtn.x = 342;
  7180. }
  7181. else if (PlatMgr.forceShare == 1) {
  7182. this.ui.myNode.closeBtn.visible = false;
  7183. this.ui.myNode.tipsNode.visible = true;
  7184. this.ui.myNode.shareBtn.x = 218;
  7185. this.isShared = true;
  7186. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  7187. }
  7188. }
  7189. checkForceShare() {
  7190. this.isShared = !this.isShared;
  7191. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  7192. }
  7193. videoShare() {
  7194. if (PlatMgr.forceShare == 1) {
  7195. if (this.isShared) {
  7196. this.shareGame();
  7197. }
  7198. else {
  7199. this.hideSelf();
  7200. }
  7201. }
  7202. else {
  7203. this.shareGame();
  7204. }
  7205. }
  7206. shareGame() {
  7207. Moyu.sendDataEvent("VideoShare");
  7208. if (Moyu.canShare() > 100) {
  7209. Moyu.shareGame((success) => {
  7210. if (success) {
  7211. DataMgr.setDailyVideoShareTimes(1);
  7212. DataMgr.setCoin(this.awardNum);
  7213. }
  7214. this.hideSelf();
  7215. }, this);
  7216. }
  7217. else {
  7218. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  7219. this.hideSelf();
  7220. }
  7221. }
  7222. hideSelf() {
  7223. this.hide();
  7224. xGame.uiMgr.Show(UIGameEnd, this.success);
  7225. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  7226. xGame.common.screenImg.destroy();
  7227. xGame.common.screenImg = null;
  7228. }
  7229. }
  7230. }
  7231. UIVideoShare.uiName = "UIVideoShare";
  7232. class ui_UITips extends fgui.GComponent {
  7233. static createInstance() {
  7234. return (fgui.UIPackage.createObject("game", "UITips"));
  7235. }
  7236. onConstruct() {
  7237. this.n0 = (this.getChild("n0"));
  7238. this.myNode = (this.getChild("myNode"));
  7239. this.t0 = this.getTransition("t0");
  7240. }
  7241. }
  7242. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  7243. class UITips extends UIBase {
  7244. constructor() {
  7245. super();
  7246. this.type = 0;
  7247. }
  7248. onConstructor() {
  7249. this.ui = ui_UITips.createInstance();
  7250. this.contentPane = this.ui;
  7251. this.isEject = false;
  7252. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  7253. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  7254. }
  7255. show(tipsTxt, womanTxt, type) {
  7256. super.show();
  7257. this.ui.t0.play();
  7258. this.ui.myNode.tipsTxt.text = tipsTxt;
  7259. this.ui.myNode.womanTxt.text = womanTxt;
  7260. PlatMgr.showInsert(true);
  7261. this.ui.myNode.c1.selectedIndex = type;
  7262. this.type = type;
  7263. switch (this.type) {
  7264. case TipsType.exitGame:
  7265. xGame.common.gameMgr.gamePause = true;
  7266. break;
  7267. case TipsType.foul:
  7268. Laya.timer.once(200, this, () => {
  7269. xGame.common.gameMgr.gamePause = true;
  7270. });
  7271. break;
  7272. default:
  7273. break;
  7274. }
  7275. }
  7276. clickLeftBtn() {
  7277. this.hide();
  7278. xGame.common.gameMgr.gamePause = false;
  7279. switch (this.type) {
  7280. case TipsType.exitGame:
  7281. break;
  7282. case TipsType.foul:
  7283. break;
  7284. default:
  7285. break;
  7286. }
  7287. }
  7288. clickRightBtn() {
  7289. this.hide();
  7290. switch (this.type) {
  7291. case TipsType.exitGame:
  7292. xGame.eventMgr.event(RESET_GAME);
  7293. xGame.uiMgr.Show(UIMain);
  7294. Moyu.recordEnd(this, null);
  7295. xGame.common.longHelpLine = false;
  7296. break;
  7297. case TipsType.foul:
  7298. xGame.common.gameMgr.gamePause = false;
  7299. Laya.timer.clearAll(this);
  7300. break;
  7301. default:
  7302. break;
  7303. }
  7304. }
  7305. }
  7306. UITips.uiName = "UITips";
  7307. class GameMgr {
  7308. constructor() {
  7309. this.selfCamp = "";
  7310. this.selfFoulNum = 0;
  7311. this.selfBallArr = [];
  7312. this.selfTimer = 0;
  7313. this.selfScore = 0;
  7314. this.aiCamp = "";
  7315. this.aiFoulNum = 0;
  7316. this.aiBallArr = [];
  7317. this.aiTimer = 0;
  7318. this.aiScore = 0;
  7319. this.aiSkillLevelNum = 1;
  7320. this.targertScore = 0;
  7321. this.setTime = 30;
  7322. this.selfTurnRate = 0.5;
  7323. this.accTime = 0;
  7324. this.curFoul = "";
  7325. this.maxFoulTimes = 3;
  7326. this.isFirstInGame = true;
  7327. this.firstColliObj = null;
  7328. this.inHoleBalls = [];
  7329. this.blackNum = 8;
  7330. this.success = false;
  7331. this.holePosList = [];
  7332. this.posObj = {};
  7333. this._selfTurn = false;
  7334. this.lastRootBallPos = new Laya.Vector2(311, 430);
  7335. this.ensureBallType = false;
  7336. this.isOpenBall = true;
  7337. this.finishOneShoot = true;
  7338. this.isEnd = false;
  7339. this.isChangeTurn = false;
  7340. this.isInterrupt = false;
  7341. this.aiPlayedBreakArmy = false;
  7342. this.isTouchedBall = false;
  7343. this.finishBalls = 0;
  7344. this.needBalls = 0;
  7345. this.allBallNum = 0;
  7346. this.placeBallPosData = {};
  7347. this.curHP = 0;
  7348. this.showLongView = false;
  7349. this.firstShoot = true;
  7350. this._gamePause = false;
  7351. this.trunCount = 0;
  7352. this.isBlackInHole = false;
  7353. this.isEnter = true;
  7354. xGame.eventMgr.offAll(ALL_BALL_STOP);
  7355. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  7356. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  7357. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  7358. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  7359. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  7360. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  7361. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  7362. }
  7363. get gamePause() {
  7364. return this._gamePause;
  7365. }
  7366. set gamePause(v) {
  7367. if (v) {
  7368. Laya.physicsTimer.pause();
  7369. }
  7370. else {
  7371. Laya.physicsTimer.resume();
  7372. }
  7373. this._gamePause = v;
  7374. }
  7375. get selfTurn() {
  7376. return this._selfTurn;
  7377. }
  7378. set selfTurn(val) {
  7379. this.trunCount++;
  7380. this._selfTurn = val;
  7381. if (val) {
  7382. xGame.common.d2World.d2Gan.ui.self.visible = true;
  7383. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  7384. }
  7385. else {
  7386. xGame.common.d2World.d2Gan.ui.self.visible = false;
  7387. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  7388. if (this.trunCount > 1)
  7389. PlatMgr.openBox();
  7390. }
  7391. }
  7392. resetGame() {
  7393. this.inHoleBalls = [];
  7394. this.isFirstInGame = true;
  7395. this.firstColliObj = null;
  7396. this.aiCamp = "";
  7397. this.selfCamp = "";
  7398. this.aiFoulNum = 0;
  7399. this.selfFoulNum = 0;
  7400. this.selfBallArr = [];
  7401. this.aiBallArr = [];
  7402. this.gamePause = false;
  7403. this.ensureBallType = false;
  7404. this.isInterrupt = false;
  7405. this.updateLeftBall();
  7406. this.clearTime();
  7407. this.aiPlayedBreakArmy = false;
  7408. this.isBlackInHole = false;
  7409. this.placeBallPosData = {};
  7410. if (xGame.common.d3World.knifeRoot) {
  7411. xGame.common.d3World.knifeRoot.destroyChildren();
  7412. }
  7413. }
  7414. gameReady() {
  7415. this.trunCount = 0;
  7416. this.firstColliObj = null;
  7417. this.isFirstInGame = true;
  7418. this.selfTurn = Math.random() <= this.selfTurnRate;
  7419. let challengeNum = DataMgr.getChallengeTimes();
  7420. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  7421. this.selfTurn = true;
  7422. }
  7423. if (xGame.common.gameMode == GameMode.placeBall)
  7424. this.selfTurn = true;
  7425. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  7426. this.selfTurn = true;
  7427. }
  7428. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  7429. this.checkGuide();
  7430. if (xGame.common.uiRodMethod)
  7431. xGame.common.uiRodMethod.resetRod();
  7432. xGame.common.d2World.getHelpLine();
  7433. this.isOpenBall = true;
  7434. this.isTouchedBall = false;
  7435. xGame.common.aiPlayer.stopRun();
  7436. this.setTime = 30;
  7437. let ui = xGame.common.gameUI.ui;
  7438. switch (xGame.common.gameMode) {
  7439. case GameMode.classic:
  7440. xGame.common.aiPlayer.init();
  7441. this.blackNum = 8;
  7442. this.placeRootBall();
  7443. this.peoplePlay(9, 10);
  7444. ui.wordsBtn.visible = true;
  7445. ui.aiWordsBtn.visible = true;
  7446. xGame.common.talkMgr.changeAIState(true);
  7447. DataMgr.gameData.gameCount++;
  7448. DataMgr.saveGameData();
  7449. break;
  7450. case GameMode.bigMove:
  7451. this.blackNum = -1;
  7452. this.selfScore = 0;
  7453. this.aiScore = 0;
  7454. xGame.common.aiPlayer.init();
  7455. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  7456. this.updateSelfScore();
  7457. this.updateAIScore();
  7458. this.updateTargetSroce();
  7459. this.placeRootBall();
  7460. this.peoplePlay(9, 10);
  7461. ui.wordsBtn.visible = true;
  7462. ui.aiWordsBtn.visible = true;
  7463. xGame.common.talkMgr.changeAIState(true);
  7464. if (DataMgr.getSkillGuide() < 1)
  7465. DataMgr.gameData.gameCount = 0;
  7466. else {
  7467. DataMgr.gameData.gameCount++;
  7468. DataMgr.saveGameData();
  7469. PlatMgr.openTry();
  7470. }
  7471. if (xGame.common.d3World.knifeRoot) {
  7472. xGame.common.d3World.knifeRoot.destroyChildren();
  7473. }
  7474. break;
  7475. case GameMode.placeBall:
  7476. this.blackNum = -1;
  7477. this.selfTurn = true;
  7478. this.setTime = 10000;
  7479. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  7480. this.curHP = this.placeBallData.hp;
  7481. if (this.placeBallData.ball == -1)
  7482. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  7483. else
  7484. this.needBalls = this.placeBallData.ball;
  7485. console.log("需要的进球数目", this.needBalls);
  7486. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  7487. this.finishBalls = 0;
  7488. this.placeBallPosData = {};
  7489. this.updatePlaceBallPos();
  7490. this.updatePlaceBallState();
  7491. this.finishOneShoot = true;
  7492. xGame.common.gameUI.ui.moveNode.visible = false;
  7493. this.isOpenBall = false;
  7494. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  7495. ui.wordsBtn.visible = false;
  7496. ui.aiWordsBtn.visible = false;
  7497. xGame.common.talkMgr.changeAIState(false);
  7498. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  7499. PlatMgr.openBox();
  7500. });
  7501. break;
  7502. default:
  7503. break;
  7504. }
  7505. this.showLongView = false;
  7506. xGame.common.wordsMgr.comboTimes = 1;
  7507. let guide = DataMgr.getSkillGuide();
  7508. if (guide)
  7509. xGame.eventMgr.event(WAIT_SHOOT);
  7510. xGame.common.upSkillLevel = false;
  7511. xGame.common.gameStartTime = new Date().getTime();
  7512. this.firstShoot = true;
  7513. }
  7514. checkGuide() {
  7515. let guide = DataMgr.getSkillGuide();
  7516. let gameUI = xGame.common.gameUI.ui;
  7517. gameUI.guide1.visible = false;
  7518. gameUI.guide2.visible = false;
  7519. gameUI.guide3.visible = false;
  7520. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  7521. this.selfTurn = true;
  7522. }
  7523. else {
  7524. return;
  7525. }
  7526. let oneBall = this.getOneBall();
  7527. gameUI.guide1.visible = true;
  7528. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  7529. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  7530. }
  7531. getOneBall() {
  7532. let arr = xGame.common.d2World.ballArr;
  7533. for (let index = 0; index < arr.length; index++) {
  7534. if (arr[index].number == 0)
  7535. continue;
  7536. return arr[index];
  7537. }
  7538. }
  7539. updateSelfScore() {
  7540. let ui = xGame.common.gameUI.ui.topNode;
  7541. ui.selfScoreTxt.text = this.selfScore + "";
  7542. }
  7543. updateAIScore() {
  7544. let ui = xGame.common.gameUI.ui.topNode;
  7545. ui.aiScoreTxt.text = this.aiScore + "";
  7546. }
  7547. updateTargetSroce() {
  7548. let ui = xGame.common.gameUI.ui.topNode;
  7549. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  7550. }
  7551. updateLeftBall() {
  7552. let topUI = xGame.common.gameUI.ui.topNode;
  7553. topUI.selfBallList.numItems = this.selfBallArr.length;
  7554. topUI.aiBallList.numItems = this.aiBallArr.length;
  7555. }
  7556. ballShoot() {
  7557. this.clearTime();
  7558. this.finishOneShoot = false;
  7559. xGame.common.gameUI.ui.moveNode.visible = false;
  7560. if (xGame.common.gameUI.ui.guideNode.visible) {
  7561. xGame.common.gameUI.ui.guideNode.visible = false;
  7562. }
  7563. if (this.firstShoot) {
  7564. this.firstShoot = false;
  7565. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  7566. }
  7567. }
  7568. ensureCamp(number) {
  7569. this.ensureBallType = true;
  7570. this.isOpenBall = false;
  7571. if (xGame.common.gameMode != GameMode.classic)
  7572. return;
  7573. let full = [1, 2, 3, 4, 5, 6, 7];
  7574. let flower = [9, 10, 11, 12, 13, 14, 15];
  7575. let sayWords = "";
  7576. if (this.selfTurn) {
  7577. if (number <= 7) {
  7578. this.selfCamp = ballCamp.full;
  7579. this.selfBallArr = full;
  7580. this.aiCamp = ballCamp.flower;
  7581. this.aiBallArr = flower;
  7582. sayWords = cfgTable.wordsData[3].msg;
  7583. }
  7584. else {
  7585. this.selfCamp = ballCamp.flower;
  7586. this.selfBallArr = flower;
  7587. this.aiCamp = ballCamp.full;
  7588. this.aiBallArr = full;
  7589. sayWords = cfgTable.wordsData[4].msg;
  7590. }
  7591. }
  7592. else {
  7593. if (number <= 7) {
  7594. this.selfCamp = ballCamp.flower;
  7595. this.selfBallArr = flower;
  7596. this.aiCamp = ballCamp.full;
  7597. this.aiBallArr = full;
  7598. sayWords = cfgTable.wordsData[2].msg;
  7599. }
  7600. else {
  7601. this.selfCamp = ballCamp.full;
  7602. this.selfBallArr = full;
  7603. this.aiCamp = ballCamp.flower;
  7604. this.aiBallArr = flower;
  7605. sayWords = cfgTable.wordsData[1].msg;
  7606. }
  7607. }
  7608. this.updateLeftBall();
  7609. xGame.uiMgr.Show(UIMsg, sayWords);
  7610. }
  7611. updatePlaceBallState() {
  7612. let ui = xGame.common.gameUI.ui;
  7613. switch (this.placeBallData.type) {
  7614. case PlaceBallType.normal:
  7615. let normal = ui.placeNormalNode;
  7616. normal.hpTxt.text = this.curHP + "";
  7617. this.updatePlaceBallStar(normal);
  7618. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  7619. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  7620. break;
  7621. case PlaceBallType.challenge:
  7622. let challenge = ui.placeChallengeNode;
  7623. challenge.hpTxt.text = "Shots:" + this.curHP;
  7624. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  7625. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  7626. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  7627. break;
  7628. default:
  7629. break;
  7630. }
  7631. }
  7632. playSubHpAni() {
  7633. let ui = xGame.common.gameUI.ui;
  7634. switch (this.placeBallData.type) {
  7635. case PlaceBallType.normal:
  7636. let normal = ui.placeNormalNode;
  7637. normal.hpTxt.visible = false;
  7638. normal.starAni.c1.selectedIndex = 1;
  7639. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  7640. normal.hpTxt.visible = true;
  7641. normal.starAni.c1.selectedIndex = 0;
  7642. }));
  7643. break;
  7644. default:
  7645. break;
  7646. }
  7647. }
  7648. getEndStarNum() {
  7649. let num;
  7650. let level = xGame.common.placeBallCurLevel;
  7651. if (this.curHP == this.placeBallData.hp) {
  7652. num = 3;
  7653. }
  7654. else if (this.curHP <= 1) {
  7655. num = 1;
  7656. }
  7657. else {
  7658. num = 2;
  7659. }
  7660. if (!this.success) {
  7661. num = 0;
  7662. }
  7663. else {
  7664. DataMgr.setPlaceBallLevel(level, num);
  7665. }
  7666. let myType = cfgTable.placeballData[level].type;
  7667. if (this.success && myType == 1) {
  7668. num = 3;
  7669. }
  7670. xGame.common.placeBallStarNum = num;
  7671. }
  7672. updatePlaceBallStar(node) {
  7673. let star = 0;
  7674. if (this.curHP == this.placeBallData.hp) {
  7675. star = 3;
  7676. }
  7677. else if (this.curHP >= 2) {
  7678. star = 2;
  7679. }
  7680. else if (this.curHP == 1) {
  7681. star = 1;
  7682. }
  7683. else {
  7684. star = 0;
  7685. }
  7686. let temp;
  7687. for (let index = 1; index <= 3; index++) {
  7688. temp = node["star" + index];
  7689. temp.c1.selectedIndex = star >= index ? 1 : 0;
  7690. }
  7691. node.myProgress.value = (star / 3) * 100;
  7692. }
  7693. openRegretView(isFoul, GoalNum, challenge = false) {
  7694. let regretType = -1;
  7695. if (isFoul) {
  7696. regretType = 1;
  7697. }
  7698. else {
  7699. if (GoalNum <= 0) {
  7700. regretType = 0;
  7701. }
  7702. }
  7703. if (challenge) {
  7704. regretType = 1;
  7705. }
  7706. if (regretType != -1) {
  7707. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  7708. if (success) {
  7709. this.curHP++;
  7710. this.updatePlaceBallState();
  7711. this.setPlaceBallAllPos();
  7712. xGame.common.gameUI.ui.moveNode.visible = false;
  7713. }
  7714. else {
  7715. if (this.curHP <= 0) {
  7716. this.success = false;
  7717. this.gameEnd();
  7718. }
  7719. this.playSubHpAni();
  7720. }
  7721. this.updatePlaceBallState();
  7722. this.updatePlaceBallPos();
  7723. });
  7724. }
  7725. }
  7726. setPlaceBallAllPos() {
  7727. let allBall = xGame.common.d2World.ballArr;
  7728. let cfgArr = this.placeBallPosData;
  7729. let temp;
  7730. let obj;
  7731. for (let index = 0; index < allBall.length; index++) {
  7732. temp = allBall[index];
  7733. if (temp.destroyed)
  7734. continue;
  7735. obj = cfgArr[temp.myUNID];
  7736. if (obj && obj.src && !obj.src.destroyed) {
  7737. temp.gameObj.x = obj.posX;
  7738. temp.gameObj.y = obj.posY;
  7739. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  7740. }
  7741. }
  7742. xGame.common.d2World.getHelpLine();
  7743. }
  7744. updatePlaceBallPos() {
  7745. let arr = xGame.common.d2World.ballArr;
  7746. let temp;
  7747. for (let index = 0; index < arr.length; index++) {
  7748. temp = arr[index];
  7749. if (!this.placeBallPosData[temp.myUNID]) {
  7750. this.placeBallPosData[temp.myUNID] = {
  7751. src: temp,
  7752. posX: temp.gameObj.x,
  7753. posY: temp.gameObj.y
  7754. };
  7755. }
  7756. else {
  7757. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  7758. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  7759. }
  7760. }
  7761. let check;
  7762. for (const key in this.placeBallPosData) {
  7763. check = this.placeBallPosData[key];
  7764. if (check.src.destroyed) {
  7765. delete this.placeBallPosData[key];
  7766. }
  7767. }
  7768. }
  7769. gameRun(type) {
  7770. if (this.gamePause)
  7771. return;
  7772. this.curFoul = this.getFoulType();
  7773. if (type) {
  7774. xGame.common.d2World.d2Gan.shoot();
  7775. xGame.common.gameUI.forceCancel();
  7776. this.curFoul = type;
  7777. }
  7778. this.isEnd = false;
  7779. this.isChangeTurn = true;
  7780. if (xGame.common.gameMode == GameMode.classic) {
  7781. this.judgeClassic(this.curFoul);
  7782. this.checkClassicWords(() => {
  7783. xGame.common.destroyClassicEmotion();
  7784. if (this.isEnd) {
  7785. if (this.isBlackInHole) {
  7786. xGame.common.gameUI.ui.blackAni.visible = true;
  7787. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  7788. xGame.common.gameUI.ui.blackAni.visible = false;
  7789. this.gameEnd();
  7790. }));
  7791. }
  7792. else {
  7793. this.gameEnd();
  7794. }
  7795. }
  7796. else {
  7797. this.waitShoot();
  7798. xGame.eventMgr.event(WAIT_SHOOT);
  7799. }
  7800. });
  7801. }
  7802. else if (xGame.common.gameMode == GameMode.bigMove) {
  7803. xGame.common.aiPlayer.stopRun();
  7804. let scoreArr = this.getScore(this.curFoul);
  7805. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  7806. this.isEnd = true;
  7807. }
  7808. this.checkBigSkillWords(() => {
  7809. if (this.isEnd) {
  7810. this.gameEnd();
  7811. }
  7812. else {
  7813. this.waitShoot();
  7814. xGame.eventMgr.event(WAIT_SHOOT);
  7815. }
  7816. });
  7817. }
  7818. else if (xGame.common.gameMode == GameMode.placeBall) {
  7819. xGame.common.destroyAwardSpine();
  7820. let isFoul = this.curFoul == FoulType.rootHole;
  7821. let GoalNum = this.inHoleBalls.length;
  7822. if (this.inHoleBalls.indexOf(0) > -1)
  7823. GoalNum -= 1;
  7824. if (isFoul) {
  7825. this.placeRootBall();
  7826. }
  7827. console.log("neeballs", this.needBalls);
  7828. console.log("当前完成的goalNum", GoalNum);
  7829. this.finishBalls += GoalNum;
  7830. console.log("当前完成的finishballs", this.finishBalls);
  7831. let need = this.needBalls;
  7832. if (this.placeBallData.type == PlaceBallType.challenge) {
  7833. need += 100;
  7834. }
  7835. if (this.finishBalls >= need) {
  7836. this.success = true;
  7837. this.gameEnd();
  7838. }
  7839. else {
  7840. switch (this.placeBallData.type) {
  7841. case PlaceBallType.normal:
  7842. if (!isFoul && GoalNum > 0) {
  7843. this.updatePlaceBallPos();
  7844. this.updatePlaceBallState();
  7845. }
  7846. else {
  7847. this.curHP--;
  7848. this.openRegretView(isFoul, GoalNum);
  7849. }
  7850. this.waitShoot();
  7851. xGame.eventMgr.event(WAIT_SHOOT);
  7852. break;
  7853. case PlaceBallType.challenge:
  7854. this.curHP--;
  7855. this.updatePlaceBallState();
  7856. if (isFoul) {
  7857. this.openRegretView(isFoul, GoalNum, true);
  7858. }
  7859. else {
  7860. this.updatePlaceBallPos();
  7861. if (this.curHP <= 0) {
  7862. this.success = true;
  7863. this.gameEnd();
  7864. }
  7865. }
  7866. this.waitShoot();
  7867. xGame.eventMgr.event(WAIT_SHOOT);
  7868. break;
  7869. default:
  7870. break;
  7871. }
  7872. }
  7873. }
  7874. }
  7875. checkClassicWords(callback) {
  7876. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  7877. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  7878. let type = this.getClassicWordsType();
  7879. if (condition && type != -1) {
  7880. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  7881. xGame.soundMgr.playSound(str);
  7882. xGame.common.wordsMgr.playClassicWords(type, callback);
  7883. }
  7884. else {
  7885. Laya.timer.once(300, this, () => {
  7886. callback && callback();
  7887. });
  7888. }
  7889. }
  7890. getClassicWordsType() {
  7891. let d2world = xGame.common.d2World;
  7892. let type = -1;
  7893. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  7894. type = ClassicWordsType.perfectShow;
  7895. return type;
  7896. }
  7897. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  7898. type = ClassicWordsType.directShoot;
  7899. return type;
  7900. }
  7901. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  7902. type = ClassicWordsType.anotherShoot;
  7903. return type;
  7904. }
  7905. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  7906. type = ClassicWordsType.bigPower;
  7907. return type;
  7908. }
  7909. let minSpeed = 1;
  7910. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  7911. type = ClassicWordsType.hardShoot;
  7912. return type;
  7913. }
  7914. if (this.inHoleBalls.length > 0) {
  7915. type = ClassicWordsType.directShoot;
  7916. return type;
  7917. }
  7918. return type;
  7919. }
  7920. checkBigSkillWords(callback) {
  7921. if (this.curFoul == FoulType.timeOut) {
  7922. callback && callback();
  7923. }
  7924. else {
  7925. let playSkill = false;
  7926. if (this.selfTurn) {
  7927. playSkill = true;
  7928. }
  7929. else {
  7930. if (!this.aiPlayedBreakArmy) {
  7931. this.aiPlayedBreakArmy = true;
  7932. playSkill = true;
  7933. }
  7934. if (this.aiCurSkill != SkillType.breakArmy) {
  7935. playSkill = true;
  7936. }
  7937. }
  7938. if (xGame.common.skillMgr.playedLastSkill) {
  7939. xGame.common.skillMgr.playedLastSkill = false;
  7940. playSkill = false;
  7941. }
  7942. if (playSkill) {
  7943. xGame.common.skillMgr.runBigSkill((extraScore) => {
  7944. let selfExtra = 0;
  7945. let aiExtra = 0;
  7946. if (this.selfTurn)
  7947. selfExtra += extraScore;
  7948. else
  7949. aiExtra += extraScore;
  7950. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  7951. this.isEnd = true;
  7952. }
  7953. this.playBigSkillTimes(callback);
  7954. });
  7955. }
  7956. else {
  7957. this.playBigSkillTimes(callback);
  7958. }
  7959. }
  7960. }
  7961. playBigSkillTimes(callback) {
  7962. let length = this.inHoleBalls.length;
  7963. if (this.inHoleBalls.indexOf(0) > -1) {
  7964. length = this.inHoleBalls.length - 1;
  7965. }
  7966. if (length <= 0) {
  7967. callback && callback();
  7968. return;
  7969. }
  7970. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  7971. callback && callback();
  7972. });
  7973. }
  7974. playSkillTips() {
  7975. let levelNum = 0;
  7976. let curType;
  7977. if (this.selfTurn) {
  7978. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  7979. curType = this.selfCurSkill;
  7980. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  7981. levelNum += 5;
  7982. }
  7983. }
  7984. else {
  7985. levelNum = this.aiSkillLevelNum;
  7986. curType = this.aiCurSkill;
  7987. }
  7988. let str = ``;
  7989. switch (curType) {
  7990. case SkillType.highSpace:
  7991. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  7992. break;
  7993. case SkillType.breakArmy:
  7994. str = `You pocketed ${levelNum} extra balls`;
  7995. break;
  7996. case SkillType.ice:
  7997. str = `${levelNum * 2} extra balls were frozen`;
  7998. break;
  7999. case SkillType.fireworks:
  8000. str = `${levelNum} extra balls exploded `;
  8001. break;
  8002. case SkillType.GuanYu:
  8003. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  8004. break;
  8005. default:
  8006. break;
  8007. }
  8008. xGame.uiMgr.Show(UIMsg, str);
  8009. }
  8010. getFoulType() {
  8011. let foulType = "";
  8012. if (this.firstColliObj == null) {
  8013. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  8014. return FoulType.rootHole;
  8015. }
  8016. return FoulType.notTouch;
  8017. }
  8018. else {
  8019. if (this.selfTurn) {
  8020. if (this.selfBallArr.length > 0) {
  8021. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  8022. foulType = FoulType.wrongTouch;
  8023. }
  8024. }
  8025. else {
  8026. if (this.ensureBallType) {
  8027. }
  8028. else {
  8029. if (this.firstColliObj == this.blackNum) {
  8030. foulType = FoulType.wrongTouch;
  8031. }
  8032. }
  8033. }
  8034. }
  8035. else {
  8036. if (this.aiBallArr.length > 0) {
  8037. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  8038. foulType = FoulType.wrongTouch;
  8039. }
  8040. }
  8041. else {
  8042. if (this.ensureBallType) {
  8043. }
  8044. else {
  8045. if (this.firstColliObj == this.blackNum) {
  8046. foulType = FoulType.wrongTouch;
  8047. }
  8048. }
  8049. }
  8050. }
  8051. if (this.inHoleBalls.length <= 0) {
  8052. return foulType;
  8053. }
  8054. let temp;
  8055. if (this.inHoleBalls.indexOf(0) > -1) {
  8056. foulType = FoulType.rootHole;
  8057. }
  8058. else {
  8059. for (let index = 0; index < this.inHoleBalls.length; index++) {
  8060. temp = this.inHoleBalls[index];
  8061. if (this.selfTurn) {
  8062. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  8063. foulType = FoulType.wrongHole;
  8064. break;
  8065. }
  8066. }
  8067. else {
  8068. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  8069. foulType = FoulType.wrongHole;
  8070. break;
  8071. }
  8072. }
  8073. }
  8074. }
  8075. let foo;
  8076. for (let index = 0; index < this.inHoleBalls.length; index++) {
  8077. temp = this.inHoleBalls[index];
  8078. foo = this.selfBallArr.indexOf(temp);
  8079. if (foo > -1) {
  8080. this.selfBallArr.splice(foo, 1);
  8081. }
  8082. foo = this.aiBallArr.indexOf(temp);
  8083. if (foo > -1) {
  8084. this.aiBallArr.splice(foo, 1);
  8085. }
  8086. }
  8087. this.updateLeftBall();
  8088. }
  8089. return foulType;
  8090. }
  8091. judgeGameEndByBlack(arr) {
  8092. if (this.selfTurn) {
  8093. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  8094. this.selfFoulNum = this.maxFoulTimes;
  8095. return true;
  8096. }
  8097. }
  8098. else {
  8099. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  8100. this.aiFoulNum = this.maxFoulTimes;
  8101. return true;
  8102. }
  8103. }
  8104. }
  8105. judgeClassic(type) {
  8106. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  8107. xGame.common.aiPlayer.stopRun();
  8108. if (this.judgeNormalSuccess()) {
  8109. this.isEnd = true;
  8110. return;
  8111. }
  8112. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  8113. if (this.selfTurn) {
  8114. if (isFoul) {
  8115. this.selfFoulNum++;
  8116. }
  8117. if (this.selfFoulNum >= this.maxFoulTimes) {
  8118. this.success = false;
  8119. this.isEnd = true;
  8120. return;
  8121. }
  8122. }
  8123. else {
  8124. if (isFoul)
  8125. this.aiFoulNum++;
  8126. if (this.aiFoulNum >= this.maxFoulTimes) {
  8127. this.success = true;
  8128. this.isEnd = true;
  8129. return;
  8130. }
  8131. }
  8132. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  8133. this.isChangeTurn = false;
  8134. }
  8135. else {
  8136. this.isInterrupt = true;
  8137. }
  8138. }
  8139. waitShoot() {
  8140. if (xGame.common.gameMode == GameMode.classic) {
  8141. switch (this.curFoul) {
  8142. case FoulType.timeOut:
  8143. case FoulType.rootHole:
  8144. this.selfTurn = !this.selfTurn;
  8145. this.peoplePlay(5, 6, true);
  8146. break;
  8147. case FoulType.notTouch:
  8148. this.selfTurn = !this.selfTurn;
  8149. this.peoplePlay(7, 7);
  8150. break;
  8151. case FoulType.wrongHole:
  8152. this.selfTurn = !this.selfTurn;
  8153. this.peoplePlay(11, 11);
  8154. break;
  8155. default:
  8156. if (this.inHoleBalls.length > 0) {
  8157. this.peoplePlay(0, 0, false, false);
  8158. }
  8159. else {
  8160. this.selfTurn = !this.selfTurn;
  8161. this.peoplePlay(7, 7);
  8162. }
  8163. break;
  8164. }
  8165. }
  8166. else if (xGame.common.gameMode == GameMode.bigMove) {
  8167. if (this.curFoul == FoulType.timeOut) {
  8168. this.selfTurn = !this.selfTurn;
  8169. this.peoplePlay(14, 15);
  8170. this.placeRootBall();
  8171. }
  8172. else {
  8173. this.selfTurn = !this.selfTurn;
  8174. if (this.curFoul == FoulType.rootHole) {
  8175. this.peoplePlay(12, 13);
  8176. this.placeRootBall();
  8177. }
  8178. else {
  8179. this.peoplePlay(0, 0, false, false);
  8180. }
  8181. }
  8182. }
  8183. else if (xGame.common.gameMode == GameMode.placeBall) {
  8184. this.finishOneShoot = true;
  8185. }
  8186. this.gameResult();
  8187. }
  8188. gameResult() {
  8189. this.firstColliObj = null;
  8190. this.inHoleBalls = [];
  8191. let curX = xGame.common.d2World.rootBall.gameObj.x;
  8192. let curY = xGame.common.d2World.rootBall.gameObj.y;
  8193. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  8194. if (xGame.common.uiRodMethod)
  8195. xGame.common.uiRodMethod.resetRod();
  8196. xGame.common.d2World.rootBall.showSelf();
  8197. this.clearIceSkill();
  8198. if (this.selfTurn) {
  8199. console.log("gameResult");
  8200. PlatMgr.gameInsert();
  8201. }
  8202. xGame.common.d3World.knifeRoot.destroyChildren();
  8203. if (this.selfTurn) {
  8204. xGame.common.gameUI.showHelpLineGuide();
  8205. xGame.common.gameUI.setTurnAlpha(true);
  8206. }
  8207. else {
  8208. xGame.common.gameUI.setTurnAlpha(false);
  8209. }
  8210. }
  8211. getScore(type) {
  8212. let selfAdd = 0;
  8213. let aiAdd = 0;
  8214. if (type == FoulType.timeOut) {
  8215. if (this.selfTurn)
  8216. aiAdd += 3;
  8217. else
  8218. selfAdd += 3;
  8219. }
  8220. else {
  8221. if (this.inHoleBalls.length > 0) {
  8222. if (this.selfTurn) {
  8223. if (type == FoulType.rootHole) {
  8224. aiAdd += 3;
  8225. if (this.inHoleBalls.length - 1 > 0) {
  8226. selfAdd += this.inHoleBalls.length - 1;
  8227. }
  8228. }
  8229. else {
  8230. selfAdd += this.inHoleBalls.length;
  8231. }
  8232. }
  8233. else {
  8234. if (type == FoulType.rootHole) {
  8235. selfAdd += 3;
  8236. if (this.inHoleBalls.length - 1 > 0) {
  8237. aiAdd += this.inHoleBalls.length - 1;
  8238. }
  8239. }
  8240. else {
  8241. aiAdd += this.inHoleBalls.length;
  8242. }
  8243. }
  8244. }
  8245. }
  8246. return [selfAdd, aiAdd];
  8247. }
  8248. judgeScoreEnd(selfAdd, aiAdd) {
  8249. this.selfScore += selfAdd;
  8250. this.aiScore += aiAdd;
  8251. this.updateAIScore();
  8252. this.updateSelfScore();
  8253. if (this.selfScore >= this.targertScore) {
  8254. this.success = true;
  8255. return true;
  8256. }
  8257. if (this.aiScore >= this.targertScore) {
  8258. this.success = false;
  8259. return true;
  8260. }
  8261. let ballArr = xGame.common.d2World.ballArr;
  8262. if (ballArr.length == 1 && ballArr[0].number == 0) {
  8263. if (this.selfScore > this.aiScore) {
  8264. this.success = true;
  8265. return true;
  8266. }
  8267. else if (this.selfScore < this.aiScore) {
  8268. this.success = false;
  8269. return true;
  8270. }
  8271. else {
  8272. if (this.selfTurn) {
  8273. this.success = false;
  8274. }
  8275. else {
  8276. this.success = true;
  8277. }
  8278. return true;
  8279. }
  8280. }
  8281. }
  8282. clearIceSkill() {
  8283. let arr = xGame.common.d2World.ballArr;
  8284. let temp;
  8285. if (this.selfTurn) {
  8286. if (this.selfCurSkill == SkillType.ice) {
  8287. for (let index = 0; index < arr.length; index++) {
  8288. temp = arr[index];
  8289. if (temp.ballFunc == "ice") {
  8290. temp.setBallFunc("normal", "self");
  8291. }
  8292. }
  8293. }
  8294. }
  8295. else {
  8296. if (this.aiCurSkill == SkillType.ice) {
  8297. for (let index = 0; index < arr.length; index++) {
  8298. temp = arr[index];
  8299. if (temp.ballFunc == "ice") {
  8300. temp.setBallFunc("normal", "ai");
  8301. }
  8302. }
  8303. }
  8304. }
  8305. }
  8306. judgeNormalSuccess() {
  8307. if (this.selfTurn) {
  8308. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  8309. this.success = true;
  8310. return true;
  8311. }
  8312. }
  8313. else {
  8314. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  8315. this.success = false;
  8316. return true;
  8317. }
  8318. }
  8319. }
  8320. gameEnd() {
  8321. if (Moyu.isTT) {
  8322. xGame.common.screenImg = getScreenImg();
  8323. }
  8324. console.log("游戏结束", this.success);
  8325. xGame.common.aiPlayer.stopRun();
  8326. if (xGame.common.gameMode == GameMode.placeBall) {
  8327. this.getEndStarNum();
  8328. this.updatePlaceBallState();
  8329. }
  8330. this.isEnter = false;
  8331. Moyu.recordEnd(this, () => {
  8332. if (this.isEnter)
  8333. return;
  8334. this.isEnter = true;
  8335. console.log("进入录结束回调");
  8336. this.enterNext();
  8337. });
  8338. Laya.timer.once(1000, this, () => {
  8339. if (this.isEnter)
  8340. return;
  8341. this.isEnter = true;
  8342. this.enterNext();
  8343. });
  8344. xGame.common.longHelpLine = false;
  8345. }
  8346. enterNext() {
  8347. Laya.timer.clearAll(this);
  8348. if (Moyu.canShare() > 100 || Moyu.isKs) {
  8349. xGame.uiMgr.Show(UIVideoShare, this.success);
  8350. }
  8351. else {
  8352. xGame.uiMgr.Show(UIGameEnd, this.success);
  8353. }
  8354. }
  8355. aiLeave() {
  8356. let ui = xGame.common.gameUI.ui;
  8357. ui.topNode.aiNameTxt.text = "offline";
  8358. }
  8359. aiGameEnd(suc) {
  8360. this.success = suc;
  8361. xGame.common.aiPlayer.stopRun();
  8362. if (this.success) {
  8363. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  8364. Laya.timer.once(1000, this, () => {
  8365. this.clearTime();
  8366. this.gameEnd();
  8367. });
  8368. }
  8369. }
  8370. openTimer() {
  8371. let src = xGame.common.gameUI;
  8372. if (this.selfTurn) {
  8373. src.ui.topNode.selfProgress.visible = true;
  8374. src.ui.topNode.aiProgress.visible = false;
  8375. this.curTimer = src.ui.topNode.selfProgress;
  8376. }
  8377. else {
  8378. src.ui.topNode.selfProgress.visible = false;
  8379. src.ui.topNode.aiProgress.visible = true;
  8380. this.curTimer = src.ui.topNode.aiProgress;
  8381. }
  8382. this.accTime = 0;
  8383. Laya.timer.clearAll(this);
  8384. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  8385. this.curTimer.value = 100;
  8386. }
  8387. updateTime(dt) {
  8388. if (this.gamePause)
  8389. return;
  8390. this.accTime += dt;
  8391. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  8392. if (this.accTime >= this.setTime) {
  8393. this.clearTime();
  8394. console.log("时钟进入了gameRun");
  8395. this.gameRun(FoulType.timeOut);
  8396. }
  8397. }
  8398. clearTime() {
  8399. let src = xGame.common.gameUI;
  8400. src.ui.topNode.selfProgress.visible = false;
  8401. src.ui.topNode.aiProgress.visible = false;
  8402. Laya.timer.clearAll(this);
  8403. }
  8404. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  8405. let ui = xGame.common.gameUI.ui;
  8406. let selfMsg, aiMsg;
  8407. if (sayWords) {
  8408. selfMsg = cfgTable.wordsData[selfIndex].msg;
  8409. aiMsg = cfgTable.wordsData[aiIndex].msg;
  8410. if (Foul) {
  8411. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  8412. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  8413. this.placeRootBall();
  8414. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  8415. if (this.curFoul == FoulType.rootHole) {
  8416. if (!DataMgr.getRootBallFoul()) {
  8417. DataMgr.setRootBallFoul();
  8418. aiMsg = "";
  8419. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  8420. let woman = "Boss, pay attention next time~";
  8421. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  8422. }
  8423. }
  8424. else if (this.curFoul == FoulType.timeOut) {
  8425. if (!DataMgr.getTimeoutFoul()) {
  8426. DataMgr.setTimeoutFoul();
  8427. aiMsg = "";
  8428. let tips = "Game timeout, 3 fouls, this game failed.";
  8429. let woman = "Boss, pay attention to the timeline~";
  8430. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  8431. }
  8432. }
  8433. }
  8434. }
  8435. }
  8436. if (this.selfTurn) {
  8437. if (sayWords) {
  8438. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  8439. ui.selfTurn.visible = true;
  8440. ui.aiTurn.visible = false;
  8441. ui.selfTurn.t0.play();
  8442. Moyu.vibration();
  8443. });
  8444. }
  8445. }
  8446. else {
  8447. let aiNum = xGame.tools.random(1, 11);
  8448. let challengeNum = DataMgr.getChallengeTimes();
  8449. let delay = false;
  8450. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8451. aiNum = 9;
  8452. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  8453. aiNum = 3;
  8454. if (challengeNum == 3) {
  8455. if (!this.showLongView) {
  8456. this.showLongView = true;
  8457. delay = true;
  8458. }
  8459. }
  8460. }
  8461. }
  8462. if (delay) {
  8463. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  8464. if (success) {
  8465. xGame.common.longHelpLine = true;
  8466. xGame.common.d2World.getHelpLine();
  8467. }
  8468. else {
  8469. aiNum = 10;
  8470. }
  8471. xGame.common.aiPlayer.setAiLevel(aiNum);
  8472. if (sayWords) {
  8473. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  8474. xGame.common.aiPlayer.runAI();
  8475. ui.selfTurn.visible = false;
  8476. ui.aiTurn.visible = true;
  8477. ui.aiTurn.t0.play();
  8478. });
  8479. }
  8480. else {
  8481. xGame.common.aiPlayer.runAI();
  8482. }
  8483. this.openTimer();
  8484. this.finishOneShoot = true;
  8485. if (this.selfTurn) {
  8486. ui.topNode.selfKuang.visible = true;
  8487. ui.topNode.aiKuang.visible = false;
  8488. ui.topNode.selfTips.visible = true;
  8489. ui.topNode.aiTips.visible = false;
  8490. }
  8491. else {
  8492. ui.topNode.selfKuang.visible = false;
  8493. ui.topNode.aiKuang.visible = true;
  8494. ui.topNode.selfTips.visible = false;
  8495. ui.topNode.aiTips.visible = true;
  8496. }
  8497. });
  8498. return;
  8499. }
  8500. if (xGame.common.gameMode == GameMode.classic) {
  8501. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  8502. if (cfg) {
  8503. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  8504. aiNum = aiLevel;
  8505. }
  8506. }
  8507. xGame.common.aiPlayer.setAiLevel(aiNum);
  8508. if (sayWords) {
  8509. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  8510. xGame.common.aiPlayer.runAI();
  8511. ui.selfTurn.visible = false;
  8512. ui.aiTurn.visible = true;
  8513. ui.aiTurn.t0.play();
  8514. });
  8515. }
  8516. else {
  8517. xGame.common.aiPlayer.runAI();
  8518. }
  8519. }
  8520. this.openTimer();
  8521. this.finishOneShoot = true;
  8522. if (this.selfTurn) {
  8523. ui.topNode.selfKuang.visible = true;
  8524. ui.topNode.aiKuang.visible = false;
  8525. ui.topNode.selfTips.visible = true;
  8526. ui.topNode.aiTips.visible = false;
  8527. }
  8528. else {
  8529. ui.topNode.selfKuang.visible = false;
  8530. ui.topNode.aiKuang.visible = true;
  8531. ui.topNode.selfTips.visible = false;
  8532. ui.topNode.aiTips.visible = true;
  8533. }
  8534. }
  8535. placeRootBall() {
  8536. let rootBall = xGame.common.d2World.rootBall;
  8537. if (!rootBall)
  8538. return;
  8539. rootBall.gameObj.x = this.lastRootBallPos.x;
  8540. rootBall.gameObj.y = this.lastRootBallPos.y;
  8541. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  8542. let moveNode = xGame.common.gameUI.ui.moveNode;
  8543. moveNode.visible = true;
  8544. moveNode.x = this.lastRootBallPos.x;
  8545. moveNode.y = this.lastRootBallPos.y;
  8546. if (!this.selfTurn) {
  8547. xGame.common.aiPlayer.resetRoot();
  8548. }
  8549. }
  8550. }
  8551. class ui_guanyuAni extends fgui.GComponent {
  8552. static createInstance() {
  8553. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  8554. }
  8555. onConstruct() {
  8556. this.n0 = (this.getChild("n0"));
  8557. }
  8558. }
  8559. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  8560. class UIFireworks extends UIBase {
  8561. constructor() {
  8562. super();
  8563. }
  8564. onConstructor() {
  8565. this.isEject = false;
  8566. }
  8567. show(callback) {
  8568. super.show();
  8569. }
  8570. }
  8571. UIFireworks.uiName = "UIFireworks";
  8572. class ui_UIGuanYu extends fgui.GComponent {
  8573. static createInstance() {
  8574. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  8575. }
  8576. onConstruct() {
  8577. this.n2 = (this.getChild("n2"));
  8578. this.n1 = (this.getChild("n1"));
  8579. this.n3 = (this.getChild("n3"));
  8580. this.n4 = (this.getChild("n4"));
  8581. this.n5 = (this.getChild("n5"));
  8582. this.n6 = (this.getChild("n6"));
  8583. this.n8 = (this.getChild("n8"));
  8584. this.n7 = (this.getChild("n7"));
  8585. this.t0 = this.getTransition("t0");
  8586. }
  8587. }
  8588. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  8589. class UIGuanYu extends UIBase {
  8590. constructor() {
  8591. super();
  8592. }
  8593. onConstructor() {
  8594. this.ui = ui_UIGuanYu.createInstance();
  8595. this.contentPane = this.ui;
  8596. this.isEject = false;
  8597. }
  8598. show(callback) {
  8599. super.show();
  8600. this.ui.t0.play(Laya.Handler.create(this, () => {
  8601. callback && callback();
  8602. this.hide();
  8603. }));
  8604. }
  8605. }
  8606. UIGuanYu.uiName = "UIGuanYu";
  8607. class SkillMgr {
  8608. constructor() {
  8609. this.leveNum = 0;
  8610. this.extraScore = 0;
  8611. this.selfTurn = false;
  8612. this.playedLastSkill = false;
  8613. this.tweenArr = [];
  8614. this._finishNum = 0;
  8615. this._curFinish = 0;
  8616. this._rootX = 0;
  8617. this._rootY = 0;
  8618. this.knifeTimes = 0;
  8619. this.knifeV2 = new Laya.Vector2();
  8620. this.knifeV3 = new Laya.Vector3();
  8621. this.rtStarX = 0;
  8622. this.rtStarY = 0;
  8623. this.addBigSkillSpine();
  8624. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8625. }
  8626. addBigSkillSpine() {
  8627. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  8628. console.log("extra2 success");
  8629. });
  8630. }
  8631. runBigSkill(callback) {
  8632. this.tweenArr = [];
  8633. this.callback = callback;
  8634. this.judgeSkill();
  8635. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  8636. let guide = DataMgr.getSkillGuide();
  8637. if (!xGame.common.gameMgr.selfTurn) {
  8638. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  8639. }
  8640. else {
  8641. if (xGame.common.temSelfLevel != 0) {
  8642. this.leveNum = xGame.common.temSelfLevel;
  8643. }
  8644. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  8645. this.leveNum += 5;
  8646. }
  8647. }
  8648. if (guide == 0) {
  8649. DataMgr.setSkillGuide(1);
  8650. if (DataMgr.getNewUser()) {
  8651. Moyu.sendDataEvent("gameFirstPlay");
  8652. DataMgr.setNewUser();
  8653. }
  8654. }
  8655. this.playSpineAni(() => {
  8656. switch (this.curSkill) {
  8657. case SkillType.highSpace:
  8658. this.runHighSpace();
  8659. break;
  8660. case SkillType.breakArmy:
  8661. this.runBreakArmy();
  8662. break;
  8663. case SkillType.ice:
  8664. this.runIce();
  8665. break;
  8666. case SkillType.fireworks:
  8667. this.runFireworks();
  8668. break;
  8669. case SkillType.GuanYu:
  8670. this.runGuanYu();
  8671. break;
  8672. default:
  8673. break;
  8674. }
  8675. });
  8676. }
  8677. judgeSkill() {
  8678. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  8679. let gameMgr = xGame.common.gameMgr;
  8680. let type;
  8681. for (let index = 0; index < typeArr.length; index++) {
  8682. type = typeArr[index];
  8683. if (gameMgr.selfTurn) {
  8684. if (gameMgr.selfCurSkill == type) {
  8685. this.selfTurn = true;
  8686. this.curSkill = type;
  8687. return;
  8688. }
  8689. }
  8690. else {
  8691. if (gameMgr.aiCurSkill == type) {
  8692. this.selfTurn = false;
  8693. this.curSkill = type;
  8694. return;
  8695. }
  8696. }
  8697. }
  8698. }
  8699. playSpineAni(callback) {
  8700. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  8701. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  8702. parent.destroyChildren();
  8703. let aniIndex = 0;
  8704. let skillSpine;
  8705. switch (this.curSkill) {
  8706. case SkillType.highSpace:
  8707. aniIndex = 1;
  8708. xGame.soundMgr.playSound("skill01");
  8709. skillSpine = this.skillSpine2;
  8710. data.scaleX = 0.5;
  8711. data.scaleY = 0.5;
  8712. skillSpine.play(data, 1, false, parent, () => {
  8713. callback && callback();
  8714. });
  8715. break;
  8716. case SkillType.breakArmy:
  8717. aniIndex = 2;
  8718. xGame.soundMgr.playSound("skill02");
  8719. skillSpine = this.skillSpine2;
  8720. data.scaleX = 0.5;
  8721. data.scaleY = 0.5;
  8722. skillSpine.play(data, 2, false, parent, () => {
  8723. callback && callback();
  8724. });
  8725. break;
  8726. case SkillType.ice:
  8727. aniIndex = 0;
  8728. xGame.soundMgr.playSound("skill03");
  8729. skillSpine = this.skillSpine2;
  8730. data.scaleX = 0.5;
  8731. data.scaleY = 0.5;
  8732. skillSpine.play(data, 0, false, parent, () => {
  8733. callback && callback();
  8734. });
  8735. break;
  8736. case SkillType.fireworks:
  8737. xGame.soundMgr.playSound("skill_04_01");
  8738. xGame.soundMgr.playSound("skill04");
  8739. xGame.uiMgr.Show(UIFireworks, callback);
  8740. break;
  8741. case SkillType.GuanYu:
  8742. xGame.soundMgr.playSound("skill05_1");
  8743. xGame.soundMgr.playSound("skill05");
  8744. xGame.uiMgr.Show(UIGuanYu, callback);
  8745. break;
  8746. default:
  8747. break;
  8748. }
  8749. }
  8750. getAllBallArr() {
  8751. let arr = xGame.common.d2World.ballArr;
  8752. let outArr = [];
  8753. for (let index = 0; index < arr.length; index++) {
  8754. if (arr[index] instanceof D2RootBallSrc)
  8755. continue;
  8756. if (arr[index].ballFunc == "ice")
  8757. continue;
  8758. if (arr[index].destroyed)
  8759. continue;
  8760. outArr.push(arr[index]);
  8761. }
  8762. return outArr;
  8763. }
  8764. getOneArr(deletObj) {
  8765. let allArr = this.getAllBallArr();
  8766. let temp;
  8767. for (let index = 0; index < allArr.length; index++) {
  8768. temp = allArr[index];
  8769. if (temp.id == deletObj.id) {
  8770. allArr.splice(index, 1);
  8771. break;
  8772. }
  8773. }
  8774. return allArr;
  8775. }
  8776. getNearBallBag(ball) {
  8777. let ui = xGame.common.gameUI.ui;
  8778. let circleArr = [];
  8779. for (let index = 1; index <= 6; index++) {
  8780. circleArr.push(ui.border["circle" + index]);
  8781. }
  8782. let outIndex = 0;
  8783. let temp;
  8784. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  8785. ;
  8786. let dis = 0;
  8787. for (let index = 1; index < circleArr.length; index++) {
  8788. temp = circleArr[index];
  8789. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  8790. if (dis < min) {
  8791. min = dis;
  8792. outIndex = index;
  8793. }
  8794. }
  8795. return [circleArr[outIndex], outIndex];
  8796. }
  8797. ballFlyToBag(ballArr, time = 300) {
  8798. let temp;
  8799. let hole;
  8800. this._finishNum = ballArr.length;
  8801. this._curFinish = 0;
  8802. let holeObj = {};
  8803. let holeCfg = {
  8804. "1": 0,
  8805. "2": 0,
  8806. "3": 0,
  8807. "4": 0,
  8808. "5": 0,
  8809. "6": 0
  8810. };
  8811. for (let index = 0; index < ballArr.length; index++) {
  8812. temp = ballArr[index];
  8813. temp.outColli.isSensor = true;
  8814. temp.innerColli.isSensor = true;
  8815. temp.isRunSkillAni = true;
  8816. let holeArr = this.getNearBallBag(temp);
  8817. hole = holeArr[0];
  8818. holeObj[index] = holeArr[1];
  8819. temp.d3BallSrc.scaleXYZ = 0.5;
  8820. this.tweenArr.push(temp.d3BallSrc, temp);
  8821. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  8822. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  8823. }));
  8824. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  8825. let mIndex = holeObj[this._curFinish];
  8826. let isDone = holeCfg[mIndex];
  8827. if (isDone) {
  8828. ballArr[this._curFinish].checkWrongBall(false);
  8829. }
  8830. else {
  8831. holeCfg[mIndex] = 1;
  8832. ballArr[this._curFinish].checkWrongBall();
  8833. }
  8834. this._curFinish++;
  8835. if (this._curFinish >= this._finishNum) {
  8836. if (this.curSkill == SkillType.highSpace) {
  8837. }
  8838. else if (this.curSkill == SkillType.breakArmy) {
  8839. let rootBall = xGame.common.d2World.rootBall;
  8840. rootBall.gameObj.x = this._rootX;
  8841. rootBall.gameObj.y = this._rootY;
  8842. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  8843. xGame.common.d2World.d2Gan.ui.visible = true;
  8844. xGame.common.d2World.d2HelpLine.ui.visible = true;
  8845. xGame.common.d2World.getHelpLine();
  8846. this.callback && this.callback(this.extraScore);
  8847. }
  8848. }
  8849. }));
  8850. }
  8851. }
  8852. runHighSpace() {
  8853. let rootBall = xGame.common.d2World.rootBall;
  8854. rootBall.showSelf();
  8855. let d3Src = rootBall.d3BallSrc;
  8856. let allArr = this.getAllBallArr();
  8857. if (allArr.length <= 0) {
  8858. this.callback && this.callback(0);
  8859. return;
  8860. }
  8861. let selectBall = xGame.common.d2World.targetBall;
  8862. let wrong = selectBall && selectBall.destroyed;
  8863. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  8864. selectBall = xGame.common.getRandArrEle(allArr);
  8865. }
  8866. let targetD3Src = selectBall.d3BallSrc;
  8867. xGame.common.d2World.d2Gan.ui.visible = false;
  8868. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8869. d3Src.scaleXYZ = 0.5;
  8870. this.tweenArr.push(d3Src);
  8871. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  8872. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  8873. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  8874. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  8875. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  8876. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  8877. let outArr = [selectBall];
  8878. let other = this.leveNum - 1;
  8879. if (other > 0) {
  8880. let nearArr = this.getOneArr(selectBall);
  8881. if (nearArr.length > 0) {
  8882. xGame.common.botherArr(nearArr);
  8883. if (other >= nearArr.length)
  8884. other = nearArr.length;
  8885. for (let index = 0; index < other; index++) {
  8886. outArr.push(nearArr[index]);
  8887. }
  8888. }
  8889. }
  8890. xGame.common.extraMoveNum = other + 1;
  8891. this.extraScore = other + 1;
  8892. this._rootX = selectBall.gameObj.x;
  8893. this._rootY = selectBall.gameObj.y;
  8894. rootBall.gameObj.x = this._rootX;
  8895. rootBall.gameObj.y = this._rootY;
  8896. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  8897. Laya.Tween.clearAll(d3Src);
  8898. this.addRandomForce(outArr);
  8899. }));
  8900. }));
  8901. }
  8902. addRandomForce(outArr) {
  8903. if (outArr.length > 0) {
  8904. xGame.common.d2World.openCheckStill = true;
  8905. this.playedLastSkill = true;
  8906. }
  8907. let temp;
  8908. for (let index = 0; index < outArr.length; index++) {
  8909. let angle = xGame.common.randomNum(0, 360);
  8910. let linearPercent = xGame.common.randomNum(65, 100);
  8911. temp = outArr[index];
  8912. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  8913. }
  8914. }
  8915. setLinearSpeed(angle, rigy, linearPercent) {
  8916. let sin = Math.sin(angle * Math.PI / 180);
  8917. let cos = Math.cos(angle * Math.PI / 180);
  8918. let maxSpeed = 4;
  8919. let speed = new Laya.Vector2();
  8920. speed.x = maxSpeed * linearPercent * sin;
  8921. speed.y = -maxSpeed * linearPercent * cos;
  8922. rigy.applyLinearImpulseToCenter(speed);
  8923. }
  8924. runBreakArmy() {
  8925. xGame.common.d2World.d2Gan.ui.visible = false;
  8926. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8927. let gameUI = xGame.common.gameUI.ui;
  8928. gameUI.skillRod.visible = true;
  8929. gameUI.skillRod.rotation = 110;
  8930. let outArr = this.getAllBallArr();
  8931. if (outArr.length <= 0) {
  8932. gameUI.skillRod.visible = false;
  8933. this.callback && this.callback(0);
  8934. return;
  8935. }
  8936. xGame.common.botherArr(outArr);
  8937. if (this.leveNum >= outArr.length)
  8938. this.leveNum = outArr.length;
  8939. let deleteNum = outArr.length - this.leveNum;
  8940. outArr.splice(0, deleteNum);
  8941. this.extraScore = this.leveNum;
  8942. let potX = gameUI.skillRod.x;
  8943. let potY = gameUI.skillRod.y;
  8944. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  8945. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  8946. let disArr = [];
  8947. for (let index = 0; index < outArr.length; index++) {
  8948. let obj = outArr[index];
  8949. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  8950. dis = Math.pow(dis, 0.5);
  8951. disArr.push(dis);
  8952. }
  8953. this.tweenArr.push(gameUI.skillRod);
  8954. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  8955. })).update = Laya.Handler.create(this, (e, t, c) => {
  8956. let angle = gameUI.skillRod.rotation;
  8957. let xx;
  8958. let yy;
  8959. let temp;
  8960. for (let index = 0; index < outArr.length; index++) {
  8961. temp = outArr[index];
  8962. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  8963. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  8964. yy -= 20;
  8965. temp.gameObj.x = xx;
  8966. temp.gameObj.y = yy;
  8967. temp.d3BallSrc.setTransPos(xx, yy);
  8968. }
  8969. if (angle <= 60) {
  8970. Laya.Tween.clearAll(gameUI.skillRod);
  8971. this.ballFlyToBag(outArr, 150);
  8972. gameUI.skillRod.visible = false;
  8973. }
  8974. }, null, false);
  8975. }
  8976. runIce() {
  8977. let ballArr = xGame.common.d2World.ballArr;
  8978. this.leveNum *= 2;
  8979. if (this.leveNum >= ballArr.length - 1)
  8980. this.leveNum = ballArr.length - 1;
  8981. let tempArr = [];
  8982. let outArr = [];
  8983. for (let index = 0; index < ballArr.length; index++) {
  8984. if (ballArr[index] instanceof D2RootBallSrc)
  8985. continue;
  8986. tempArr.push(ballArr[index]);
  8987. }
  8988. if (tempArr.length <= 0) {
  8989. this.callback && this.callback(0);
  8990. return;
  8991. }
  8992. xGame.common.botherArr(tempArr);
  8993. for (let index = 0; index < this.leveNum; index++) {
  8994. outArr.push(tempArr[index]);
  8995. }
  8996. this.extraScore = this.leveNum;
  8997. let temp;
  8998. for (let index = 0; index < outArr.length; index++) {
  8999. temp = outArr[index];
  9000. temp.d3BallSrc.playIceEft();
  9001. }
  9002. Laya.timer.once(2000, this, () => {
  9003. for (let index = 0; index < outArr.length; index++) {
  9004. temp = outArr[index];
  9005. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  9006. temp.setBallFunc("ice", str);
  9007. }
  9008. this.callback && this.callback(0);
  9009. });
  9010. }
  9011. runFireworks() {
  9012. let allArr = this.getAllBallArr();
  9013. if (allArr.length <= 0) {
  9014. this.callback && this.callback(0);
  9015. return;
  9016. }
  9017. xGame.common.d2World.d2Gan.ui.visible = false;
  9018. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9019. let outArr = [];
  9020. let other = this.leveNum;
  9021. if (other > 0) {
  9022. if (allArr.length > 0) {
  9023. xGame.common.botherArr(allArr);
  9024. if (other >= allArr.length)
  9025. other = allArr.length;
  9026. for (let index = 0; index < other; index++) {
  9027. outArr.push(allArr[index]);
  9028. }
  9029. }
  9030. }
  9031. xGame.common.extraMoveNum = other;
  9032. this.extraScore = other;
  9033. this.addRandmomFireworks(outArr);
  9034. }
  9035. addRandmomFireworks(outArr) {
  9036. Laya.timer.once(1100, this, () => {
  9037. if (outArr.length > 0) {
  9038. xGame.common.d2World.openCheckStill = true;
  9039. this.playedLastSkill = true;
  9040. }
  9041. });
  9042. xGame.soundMgr.playSound("skill_04_02");
  9043. let temp;
  9044. let delay = -200;
  9045. for (let index = 0; index < outArr.length; index++) {
  9046. temp = outArr[index];
  9047. delay += 200;
  9048. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  9049. let angle = xGame.common.randomNum(0, 360);
  9050. angle = this.getFireworksAngle(obj);
  9051. let linearPercent = xGame.common.randomNum(45, 80);
  9052. if (!obj.destroyed)
  9053. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  9054. });
  9055. }
  9056. }
  9057. getFireworksAngle(obj) {
  9058. let rootBall = xGame.common.d2World.rootBall;
  9059. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  9060. }
  9061. resetGame() {
  9062. Laya.timer.clearAll(this);
  9063. if (this.tweenArr) {
  9064. for (let index = 0; index < this.tweenArr.length; index++) {
  9065. Laya.Tween.clearAll(this.tweenArr[index]);
  9066. }
  9067. }
  9068. this.tweenArr = null;
  9069. }
  9070. runGuanYu() {
  9071. xGame.common.d2World.d2Gan.ui.visible = false;
  9072. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9073. let rootBall = xGame.common.d2World.rootBall;
  9074. if (rootBall.isInHole) {
  9075. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  9076. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  9077. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  9078. rootBall.showSelf();
  9079. }
  9080. this.rtStarX = rootBall.gameObj.x;
  9081. this.rtStarY = rootBall.gameObj.y;
  9082. this.knifeTimes = 0;
  9083. this.playedLastSkill = true;
  9084. rootBall.forceRun = true;
  9085. rootBall.rigy.type = "static";
  9086. xGame.common.d2World.openCheckStill = true;
  9087. this.guanyuRandomKnife();
  9088. }
  9089. guanyuRandomKnife() {
  9090. let rootBall = xGame.common.d2World.rootBall;
  9091. let dir = this.getRandDir();
  9092. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  9093. console.log("当前angle", angle);
  9094. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  9095. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  9096. let dis = 324;
  9097. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  9098. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  9099. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  9100. this.rtStarX = rootBall.gameObj.x;
  9101. this.rtStarY = rootBall.gameObj.y;
  9102. this.knifeTimes++;
  9103. let skillLevel;
  9104. if (xGame.common.gameMgr.selfTurn) {
  9105. skillLevel = DataMgr.getBigSkillByIndex(4);
  9106. }
  9107. else {
  9108. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  9109. }
  9110. if (!skillLevel)
  9111. skillLevel = 1;
  9112. skillLevel += 2;
  9113. if (this.knifeTimes < skillLevel) {
  9114. Laya.timer.once(400, this, () => {
  9115. this.guanyuRandomKnife();
  9116. });
  9117. }
  9118. else {
  9119. rootBall.forceRun = false;
  9120. rootBall.rigy.type = "dynamic";
  9121. xGame.common.extraMoveNum = skillLevel;
  9122. }
  9123. }));
  9124. }
  9125. getRandDir() {
  9126. let rootBall = xGame.common.d2World.rootBall;
  9127. let allBall = this.getAllBallArr();
  9128. let target = xGame.common.getRandArrEle(allBall);
  9129. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  9130. return this.knifeV2;
  9131. }
  9132. cloneKnife(x, y, rotation) {
  9133. let parent = xGame.common.d3World.knifeRoot;
  9134. let prefab = xGame.common.d3World.knife;
  9135. let clone = prefab.clone();
  9136. parent.addChild(clone);
  9137. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  9138. clone.transform.localPositionX = this.knifeV3.x;
  9139. clone.transform.localPositionY = 0;
  9140. clone.transform.localPositionZ = this.knifeV3.z;
  9141. clone.transform.localRotationEulerX = 0;
  9142. clone.transform.localRotationEulerY = rotation;
  9143. clone.transform.localRotationEulerZ = 0;
  9144. clone.active = true;
  9145. return clone;
  9146. }
  9147. cloneGuanYuEft(x, y, angle) {
  9148. return;
  9149. let parent = xGame.common.gameUI.ui.guanyuNode;
  9150. let eft = new ui_guanyuAni();
  9151. eft.parent = parent;
  9152. eft.x = x;
  9153. eft.y = y;
  9154. eft.rotation = angle;
  9155. }
  9156. }
  9157. class ui_UIWordsList extends fgui.GComponent {
  9158. static createInstance() {
  9159. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  9160. }
  9161. onConstruct() {
  9162. this.c1 = this.getController("c1");
  9163. this.n74 = (this.getChild("n74"));
  9164. this.clickNode = (this.getChild("clickNode"));
  9165. this.myNode = (this.getChild("myNode"));
  9166. this.n68 = (this.getChild("n68"));
  9167. this.n66 = (this.getChild("n66"));
  9168. this.n55 = (this.getChild("n55"));
  9169. this.wordsBtn = (this.getChild("wordsBtn"));
  9170. this.emotionBtn = (this.getChild("emotionBtn"));
  9171. this.mybggg = (this.getChild("mybggg"));
  9172. this.wordsList = (this.getChild("wordsList"));
  9173. this.emotionList = (this.getChild("emotionList"));
  9174. this.myRoot = (this.getChild("myRoot"));
  9175. }
  9176. }
  9177. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  9178. class EmotionDisplay {
  9179. constructor(index, ui) {
  9180. this.ui = ui;
  9181. this.index = index;
  9182. this.ui.onClick(this, this.clickSelf);
  9183. this.updateSelf();
  9184. }
  9185. updateSelf() {
  9186. let data = cfgTable.emotionData[this.index + 1];
  9187. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  9188. }
  9189. clickSelf() {
  9190. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9191. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  9192. xGame.common.talkMgr.closeTalkView();
  9193. }
  9194. }
  9195. class WordsDisplay {
  9196. constructor(index, ui) {
  9197. this.ui = ui;
  9198. this.index = index;
  9199. this.ui.onClick(this, this.clickSelf);
  9200. this.updateSelf();
  9201. }
  9202. updateSelf() {
  9203. let data = cfgTable.talkwordsData[this.index + 1];
  9204. this.ui.txt.text = data.msg;
  9205. }
  9206. clickSelf() {
  9207. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9208. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  9209. xGame.common.talkMgr.closeTalkView();
  9210. }
  9211. }
  9212. class UIWordsList extends UIBase {
  9213. constructor() {
  9214. super();
  9215. }
  9216. onConstructor() {
  9217. this.ui = ui_UIWordsList.createInstance();
  9218. this.contentPane = this.ui;
  9219. this.isEject = false;
  9220. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  9221. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  9222. this.addUIClick(this.ui.clickNode, this.hide);
  9223. this.initTalkList();
  9224. this.initEmotionList();
  9225. }
  9226. show() {
  9227. super.show();
  9228. }
  9229. initTalkList() {
  9230. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  9231. let data = cfgTable.talkwordsData;
  9232. let length = Object.keys(data).length;
  9233. this.ui.wordsList.numItems = length;
  9234. }
  9235. initEmotionList() {
  9236. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  9237. let data = cfgTable.emotionData;
  9238. let length = Object.keys(data).length;
  9239. this.ui.emotionList.numItems = length;
  9240. }
  9241. renderTalkItem(index, obj) {
  9242. let temp = new WordsDisplay(index, obj);
  9243. }
  9244. renderEmotionItem(index, obj) {
  9245. let temp = new EmotionDisplay(index, obj);
  9246. }
  9247. openTalkList() {
  9248. this.ui.c1.selectedIndex = 0;
  9249. }
  9250. openEmotionList() {
  9251. this.ui.c1.selectedIndex = 1;
  9252. }
  9253. }
  9254. UIWordsList.uiName = "UIWordsList";
  9255. class TalkMgr {
  9256. constructor() {
  9257. this.aiSpeak = true;
  9258. this.emotionList = [];
  9259. this.talkList = [];
  9260. this.addEvent();
  9261. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9262. this.emotionList = [];
  9263. this.talkList = [];
  9264. for (let k in cfgTable.emotionData) {
  9265. this.emotionList.push(cfgTable.emotionData[k].id);
  9266. }
  9267. for (let k in cfgTable.talkwordsData) {
  9268. this.talkList.push(cfgTable.talkwordsData[k].id);
  9269. }
  9270. }
  9271. addEvent() {
  9272. let ui = xGame.common.gameUI.ui;
  9273. ui.wordsBtn.visible = true;
  9274. ui.wordsBtn.onClick(this, this.openTalkView);
  9275. ui.aiWordsBtn.visible = true;
  9276. ui.aiWordsBtn.onClick(this, this.clickAIState);
  9277. }
  9278. openTalkView() {
  9279. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9280. xGame.uiMgr.Show(UIWordsList);
  9281. }
  9282. closeTalkView() {
  9283. xGame.uiMgr.Hide(UIWordsList);
  9284. }
  9285. clickAIState() {
  9286. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9287. this.aiSpeak = !this.aiSpeak;
  9288. this.changeAIState(this.aiSpeak);
  9289. }
  9290. changeAIState(speak) {
  9291. this.aiSpeak = speak;
  9292. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  9293. if (speak) {
  9294. btn.c1.selectedIndex = 0;
  9295. }
  9296. else {
  9297. btn.c1.selectedIndex = 1;
  9298. }
  9299. }
  9300. showSelfTalk(wordsId) {
  9301. let ui = xGame.common.gameUI.ui;
  9302. ui.selfTalk.visible = true;
  9303. ui.selfTalk.myNode.c1.selectedIndex = 1;
  9304. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  9305. ui.selfTalk.t0.play();
  9306. }
  9307. showSelfEmotion(emotionId) {
  9308. let ui = xGame.common.gameUI.ui;
  9309. ui.selfTalk.visible = true;
  9310. ui.selfTalk.myNode.c1.selectedIndex = 0;
  9311. this.selfSpine && this.selfSpine.dispose();
  9312. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  9313. let spineData = cfgTable.emotionData[emotionId].spine;
  9314. this.selfSpine = new SpineMgr(spineData, () => {
  9315. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  9316. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  9317. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  9318. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  9319. });
  9320. ui.selfTalk.t0.play();
  9321. }
  9322. showAITalk(wordsId) {
  9323. if (!this.aiSpeak)
  9324. return;
  9325. if (DataMgr.gameData.gameCount < 2)
  9326. return;
  9327. if (wordsId < 1)
  9328. wordsId = this.getRandTalk();
  9329. let ui = xGame.common.gameUI.ui;
  9330. ui.aiTalk.visible = true;
  9331. ui.aiTalk.myNode.c1.selectedIndex = 1;
  9332. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  9333. ui.aiTalk.t0.play();
  9334. }
  9335. getRandTalk() {
  9336. let rand = xGame.tools.random(0, this.talkList.length);
  9337. return this.emotionList[rand];
  9338. }
  9339. getRandEmotion() {
  9340. let rand = xGame.tools.random(0, this.emotionList.length);
  9341. return this.emotionList[rand];
  9342. }
  9343. showAIEmotion(emotionId) {
  9344. if (!this.aiSpeak)
  9345. return;
  9346. if (DataMgr.gameData.gameCount < 2)
  9347. return;
  9348. if (emotionId < 1)
  9349. emotionId = this.getRandEmotion();
  9350. let ui = xGame.common.gameUI.ui;
  9351. ui.aiTalk.visible = true;
  9352. ui.aiTalk.myNode.c1.selectedIndex = 0;
  9353. this.aiSpine && this.aiSpine.dispose();
  9354. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  9355. let spineData = cfgTable.emotionData[emotionId].spine;
  9356. this.aiSpine = new SpineMgr(spineData, () => {
  9357. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  9358. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  9359. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  9360. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  9361. });
  9362. ui.aiTalk.t0.play();
  9363. }
  9364. resetGame() {
  9365. let ui = xGame.common.gameUI.ui;
  9366. ui.aiTalk.visible = false;
  9367. ui.selfTalk.visible = false;
  9368. this.aiSpine && this.aiSpine.dispose();
  9369. this.selfSpine && this.selfSpine.dispose();
  9370. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  9371. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  9372. this.closeTalkView();
  9373. }
  9374. }
  9375. class WordsMgr {
  9376. constructor() {
  9377. this.comboTimes = 1;
  9378. this.skillTimes = 0;
  9379. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  9380. this.comboSpine = new SpineMgr("yxz_liangan");
  9381. this.skillSpine = new SpineMgr("yiganxqiu");
  9382. this.scoreSpine = new SpineMgr("defen");
  9383. }
  9384. setClassicCombo(isInterrupt) {
  9385. if (isInterrupt) {
  9386. this.comboTimes = 0;
  9387. }
  9388. }
  9389. playClassicWords(type, callback) {
  9390. this.callback = callback;
  9391. let aniIndex = type;
  9392. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9393. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  9394. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  9395. mySpine.destroy(true);
  9396. this.playClassicTimes();
  9397. });
  9398. }
  9399. playClassicTimes() {
  9400. this.comboTimes++;
  9401. if (this.comboTimes <= 1) {
  9402. this.callback && this.callback();
  9403. }
  9404. else {
  9405. let aniIndex = this.comboTimes - 1;
  9406. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9407. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  9408. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  9409. mySpine.destroy(true);
  9410. this.callback && this.callback();
  9411. });
  9412. }
  9413. }
  9414. playBigSkillTimes(times, callback) {
  9415. if (times <= 0) {
  9416. callback && callback();
  9417. return;
  9418. }
  9419. this.callback = callback;
  9420. let pre = "sz_0";
  9421. let aniIndex = 0;
  9422. this.getWordsImg(times, pre, () => {
  9423. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9424. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  9425. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  9426. let r1 = ``;
  9427. let r2 = ``;
  9428. if (times <= 9) {
  9429. r1 = `res/d2Res/${pre}${times}.png`;
  9430. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9431. aniIndex = 0;
  9432. }
  9433. else {
  9434. r1 = `res/d2Res/${pre}${times % 10}.png`;
  9435. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  9436. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  9437. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  9438. aniIndex = 1;
  9439. }
  9440. this.skillSpine.play(data, aniIndex, false, parent, () => {
  9441. mySpine.destroy(true);
  9442. xGame.common.gameMgr.playSkillTips();
  9443. this.playScore(times);
  9444. xGame.common.playRandomMutiBallBigSkillSound();
  9445. }, mySpine);
  9446. });
  9447. }
  9448. playScore(score) {
  9449. let pre = "sz_";
  9450. let aniIndex = 0;
  9451. this.getWordsImg(score, pre, () => {
  9452. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9453. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  9454. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  9455. let r1 = ``;
  9456. let r2 = ``;
  9457. if (score <= 9) {
  9458. r1 = `res/d2Res/${pre}${score}.png`;
  9459. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9460. aniIndex = 0;
  9461. }
  9462. else {
  9463. r1 = `res/d2Res/${pre}${score % 10}.png`;
  9464. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  9465. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9466. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  9467. aniIndex = 1;
  9468. }
  9469. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  9470. mySpine.destroy(true);
  9471. this.callback && this.callback();
  9472. }, mySpine);
  9473. });
  9474. }
  9475. getWordsImg(number, pre = "", callback) {
  9476. let arr = [];
  9477. if (number <= 9) {
  9478. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  9479. }
  9480. else {
  9481. 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 });
  9482. }
  9483. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  9484. callback && callback();
  9485. }));
  9486. }
  9487. }
  9488. class ui_UIRodMethod extends fgui.GComponent {
  9489. static createInstance() {
  9490. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  9491. }
  9492. onConstruct() {
  9493. this.n24 = (this.getChild("n24"));
  9494. this.white = (this.getChild("white"));
  9495. this.dot = (this.getChild("dot"));
  9496. this.sureBtn = (this.getChild("sureBtn"));
  9497. this.n20 = (this.getChild("n20"));
  9498. this.n21 = (this.getChild("n21"));
  9499. this.n22 = (this.getChild("n22"));
  9500. this.n23 = (this.getChild("n23"));
  9501. this.n5 = (this.getChild("n5"));
  9502. this.n14 = (this.getChild("n14"));
  9503. this.t0 = this.getTransition("t0");
  9504. }
  9505. }
  9506. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  9507. class UIRodMethod extends UIBase {
  9508. constructor() {
  9509. super();
  9510. this.isPressd = false;
  9511. }
  9512. onConstructor() {
  9513. this.ui = ui_UIRodMethod.createInstance();
  9514. this.contentPane = this.ui;
  9515. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  9516. this.moveDir = new Laya.Vector2();
  9517. this.moveDest = new Laya.Vector2();
  9518. this.centerPos = new Laya.Vector2();
  9519. xGame.common.uiRodMethod = this;
  9520. }
  9521. show() {
  9522. super.show();
  9523. xGame.common.gameMgr.gamePause = true;
  9524. this.openPressDotEvent();
  9525. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  9526. this.centerPos.x = this.ui.white.x;
  9527. this.centerPos.y = this.ui.white.y;
  9528. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  9529. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  9530. this.setDot();
  9531. }
  9532. setDot() {
  9533. this.ui.dot.x = this.moveDest.x;
  9534. this.ui.dot.y = this.moveDest.y;
  9535. }
  9536. closeSelf() {
  9537. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  9538. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  9539. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  9540. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  9541. xGame.common.gameMgr.gamePause = false;
  9542. this.hide();
  9543. }
  9544. openPressDotEvent() {
  9545. this.closePressDotEvent();
  9546. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9547. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  9548. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9549. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9550. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9551. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9552. }
  9553. closePressDotEvent() {
  9554. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9555. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  9556. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9557. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9558. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9559. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9560. }
  9561. onDown(e) {
  9562. if (e.type == Laya.Event.MOUSE_DOWN)
  9563. this.isPressd = true;
  9564. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  9565. this.isPressd = false;
  9566. if (!this.isPressd)
  9567. return;
  9568. this.moveDest.x = e.stageX;
  9569. this.moveDest.y = e.stageY;
  9570. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  9571. if (dis > 6724) {
  9572. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  9573. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  9574. }
  9575. this.setDot();
  9576. }
  9577. resetRod() {
  9578. this.ui.dot.x = this.ui.white.x;
  9579. this.ui.dot.y = this.ui.white.y;
  9580. this.gameRod.dot.x = this.gameRod.bg.x;
  9581. this.gameRod.dot.y = this.gameRod.bg.y;
  9582. xGame.common.rodOffest.x = 0;
  9583. xGame.common.rodOffest.y = 0;
  9584. }
  9585. }
  9586. UIRodMethod.uiName = "UIRodMethod";
  9587. class UIGame extends UIBase {
  9588. constructor() {
  9589. super();
  9590. this.powerNum = 0;
  9591. this.isD3Inited = false;
  9592. this.isPrePlay = false;
  9593. this.isMoveRod = false;
  9594. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  9595. this.rulerDis = 20;
  9596. this.rulerOffset = 0;
  9597. }
  9598. onConstructor() {
  9599. this.ui = ui_UIGame.createInstance();
  9600. this.contentPane = this.ui;
  9601. this.ui.x += xGame.common.sysOffestNum;
  9602. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  9603. this.isEject = false;
  9604. xGame.common.gameUI = this;
  9605. this.initSelf();
  9606. }
  9607. isTurnSelf() {
  9608. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  9609. return true;
  9610. }
  9611. }
  9612. initSelf() {
  9613. let topUI = this.ui.topNode;
  9614. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  9615. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  9616. this.barInfo = {};
  9617. this.barInfo.curY = 0;
  9618. this.barInfo.height = this.ui.powerNode.height;
  9619. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  9620. this.barInfo.powerStartY = this.ui.powerNode.y;
  9621. xGame.common.aiPlayer = new AIPlayer();
  9622. xGame.common.gameMgr = new GameMgr();
  9623. xGame.common.skillMgr = new SkillMgr();
  9624. xGame.common.wordsMgr = new WordsMgr();
  9625. xGame.common.talkMgr = new TalkMgr();
  9626. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  9627. console.log("加载经典模式表情文件chenggon !");
  9628. });
  9629. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  9630. console.log("挑战模式奖励模式spine加载成功!");
  9631. });
  9632. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  9633. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9634. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  9635. this.addUIClick(this.ui.returnBtn, this.returnHome);
  9636. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  9637. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  9638. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  9639. }
  9640. returnHome() {
  9641. let tips = "Are you sure to exit the game?";
  9642. let woman = "Boss, why don't you play for a while longer?";
  9643. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  9644. }
  9645. addRodMethodClick() {
  9646. if (this.isTurnSelf()) {
  9647. xGame.uiMgr.Show(UIRodMethod);
  9648. }
  9649. }
  9650. clickHelpLineBtn(force = false) {
  9651. if (!this.isTurnSelf())
  9652. return;
  9653. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  9654. if (success) {
  9655. xGame.common.longHelpLine = true;
  9656. xGame.common.d2World.getHelpLine();
  9657. Moyu.sendDataEvent("guideNum");
  9658. }
  9659. else {
  9660. }
  9661. });
  9662. }
  9663. renderSelfDisplayBalls(index, target) {
  9664. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  9665. target.myImg.url = xGame.common.getGameIconUrl(str);
  9666. }
  9667. renderAIDisplayBalls(index, target) {
  9668. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  9669. target.myImg.url = xGame.common.getGameIconUrl(str);
  9670. ;
  9671. }
  9672. updateMode() {
  9673. if (xGame.common.gameMode == GameMode.classic) {
  9674. this.ui.topNode.scoreNode.visible = false;
  9675. }
  9676. else if (xGame.common.gameMode == GameMode.bigMove) {
  9677. this.ui.topNode.scoreNode.visible = true;
  9678. }
  9679. }
  9680. show() {
  9681. super.show();
  9682. console.log("zh:uigame show");
  9683. this.ui.alpha = 0;
  9684. this.updateSelf();
  9685. console.log("zh:uigame bf gamemusic01 start");
  9686. xGame.soundMgr.playMusic("gamemusic01");
  9687. console.log("zh:uigame bf gamemusic01 end");
  9688. xGame.common.gameMgr.gamePause = false;
  9689. xGame.common.gameUI.ui.blackAni.visible = false;
  9690. xGame.common.gameUI.ui.whiteAni.visible = false;
  9691. this.ui.powerEft.visible = false;
  9692. this.ui.colorNode.visible = false;
  9693. this.updateHead();
  9694. }
  9695. updateSelf() {
  9696. if (xGame.common.gameMode == GameMode.classic) {
  9697. this.ui.c1.selectedIndex = 0;
  9698. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  9699. this.ui.topNode.middleNode.visible = true;
  9700. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  9701. }
  9702. else if (xGame.common.gameMode == GameMode.bigMove) {
  9703. this.ui.c1.selectedIndex = 0;
  9704. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  9705. this.ui.topNode.middleNode.visible = false;
  9706. let max = xGame.cfgMgr.getMaxBigMoveLength();
  9707. let rand = xGame.common.randomNum(1, max);
  9708. let guide = DataMgr.getSkillGuide();
  9709. if (guide == 0)
  9710. rand = 1;
  9711. xGame.common.bigMoveLevelIndex = rand;
  9712. }
  9713. else if (xGame.common.gameMode == GameMode.placeBall) {
  9714. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  9715. this.ui.c1.selectedIndex = 1 + data.type;
  9716. this.ui.alpha = 1;
  9717. this.startGame();
  9718. }
  9719. this.updateMode();
  9720. this.initD3world();
  9721. this.initD2world();
  9722. }
  9723. startGame() {
  9724. this.ui.snowNode.visible = Math.random() <= 0.1;
  9725. this.ui.d2Node.visible = false;
  9726. xGame.common.d3World.d3Hand.gameObj.active = false;
  9727. xGame.common.d3World.tableSrc.init();
  9728. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  9729. this.cameraViewChange(() => {
  9730. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  9731. switch (xGame.common.gameMode) {
  9732. case GameMode.classic:
  9733. xGame.common.d3World.d3Hand.gameObj.active = true;
  9734. this.playPutBallD3Ani();
  9735. break;
  9736. case GameMode.bigMove:
  9737. this.enterGame();
  9738. Laya.timer.once(500, this, () => {
  9739. this.ui.topNode.middleNode.visible = true;
  9740. this.ui.topNode.middleNode.t0.play();
  9741. });
  9742. break;
  9743. case GameMode.placeBall:
  9744. this.enterGame();
  9745. break;
  9746. default:
  9747. break;
  9748. }
  9749. });
  9750. PlatMgr.showBanner(false);
  9751. }
  9752. enterGame() {
  9753. this.ui.d2Node.visible = true;
  9754. xGame.common.d3World.d3Hand.gameObj.active = false;
  9755. xGame.common.showOneCamera("mainCamera");
  9756. Moyu.recordGame(30, true);
  9757. if (!this.isPrePlay) {
  9758. this.isPrePlay = true;
  9759. xGame.common.d3World.prePlayEft();
  9760. }
  9761. xGame.common.gameMgr.gameReady();
  9762. this.openAllEvent();
  9763. this.ui.snowNode.visible = false;
  9764. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  9765. this.ui.helpBtn.visible = condition;
  9766. }
  9767. showHelpLineGuide() {
  9768. let longGuide = DataMgr.getGuideHelpLine();
  9769. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  9770. this.ui.helpBtn.visible = true;
  9771. this.ui.guideNode.visible = true;
  9772. }
  9773. }
  9774. setTurnAlpha(alpha) {
  9775. this.ui.keduNode.alpha = alpha;
  9776. this.ui.ganNode.alpha = alpha;
  9777. this.ui.rodMethodNode.alpha = alpha;
  9778. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  9779. }
  9780. cameraViewChange(callback) {
  9781. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  9782. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  9783. xGame.common.showOneCamera("visitAngle");
  9784. cameraSrc.localRotationEulerY = 180;
  9785. cameraSrc.localRotationEulerZ = 0;
  9786. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  9787. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  9788. callback && callback();
  9789. }));
  9790. }));
  9791. }
  9792. playPutBallD3Ani() {
  9793. xGame.common.showOneCamera("mainCamera");
  9794. let handSrc = xGame.common.d3World.d3Hand;
  9795. handSrc.gameObj.active = true;
  9796. handSrc.transform.localPositionZ = 3;
  9797. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9798. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  9799. handSrc.gameObj.active = false;
  9800. this.enterGame();
  9801. }), 400);
  9802. }));
  9803. }
  9804. updateHead() {
  9805. let user = Moyu.getUserInfo();
  9806. this.ui.topNode.selfNameTxt.text = user.nickName;
  9807. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  9808. let aiData = xGame.cfgMgr.getRandomUserInfo();
  9809. if (DataMgr.getSkillGuide() < 1) {
  9810. this.ui.topNode.aiNameTxt.text = 'billiards';
  9811. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  9812. }
  9813. else {
  9814. this.ui.topNode.aiNameTxt.text = aiData.name;
  9815. let randNo = Math.floor(Math.random() * 10) + 1;
  9816. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  9817. }
  9818. }
  9819. initD2world() {
  9820. let node = this.ui.d2Root.displayObject;
  9821. let src = node.getComponent(D2World);
  9822. if (!src) {
  9823. xGame.common.d2World = node.addComponent(D2World);
  9824. }
  9825. xGame.common.d2World.initSelf();
  9826. }
  9827. initD3world() {
  9828. if (this.isD3Inited)
  9829. return;
  9830. this.isD3Inited = true;
  9831. let scene3D = xGame.common.d3Scene;
  9832. this.ui.d3Root.displayObject.addChild(scene3D);
  9833. scene3D.active = true;
  9834. xGame.common.d3World.tableSrc.setBorderPos();
  9835. }
  9836. onRootMove(e) {
  9837. let rootBall = xGame.common.d2World.rootBall;
  9838. this.ui.moveNode.x = e.x;
  9839. this.ui.moveNode.y = e.y;
  9840. rootBall.gameObj.x = e.x;
  9841. rootBall.gameObj.y = e.y;
  9842. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  9843. }
  9844. aiRootMove(move) {
  9845. if (move)
  9846. this.hideBallUI();
  9847. else {
  9848. this.showBallUI();
  9849. xGame.common.d2World.getHelpLine();
  9850. }
  9851. }
  9852. aiForce(type, force = 0) {
  9853. this.pressTarget = PressType.powerNode;
  9854. if (type == 1)
  9855. this.onEventUp({ force: true });
  9856. else if (type == 2)
  9857. this.onEventMove({ stageY: force, force: true });
  9858. }
  9859. onEventPress(e) {
  9860. if (e.stopPropagation)
  9861. e.stopPropagation();
  9862. if (!this.isTurnSelf())
  9863. return;
  9864. let target = e.target;
  9865. switch (target) {
  9866. case this.ui.myPowerNode.displayObject:
  9867. this.pressTarget = PressType.powerNode;
  9868. this.barInfo.curY = e.stageY;
  9869. this.updateBarInfo();
  9870. break;
  9871. case this.ui.moveNode.displayObject:
  9872. this.pressTarget = PressType.moveNode;
  9873. this.hideBallUI();
  9874. this.eventObj.curX = this.ui.moveNode.x;
  9875. this.eventObj.curY = this.ui.moveNode.y;
  9876. this.ui.moveNode.finger.visible = false;
  9877. this.eventObj.lastX = e.stageX;
  9878. this.eventObj.lastY = e.stageY;
  9879. break;
  9880. case this.ui.rulerClickNode.displayObject:
  9881. this.pressTarget = PressType.rulerNode;
  9882. this.eventObj.lastY = e.stageY;
  9883. break;
  9884. case this.ui.d2Root.displayObject:
  9885. this.pressTarget = PressType.d2Root;
  9886. this.eventObj.lastX = e.stageX;
  9887. this.eventObj.lastY = e.stageY;
  9888. this.eventObj.starX = e.stageX;
  9889. this.eventObj.starY = e.stageY;
  9890. this.eventObj.curX = 0;
  9891. this.eventObj.curY = 0;
  9892. xGame.common.d2World.d2Gan.setGanLastInfo();
  9893. this.rulerOffset = 0;
  9894. break;
  9895. default:
  9896. break;
  9897. }
  9898. }
  9899. onEventMove(e) {
  9900. if (e.stopPropagation)
  9901. e.stopPropagation();
  9902. if (e && e.force) {
  9903. }
  9904. else {
  9905. if (!this.isTurnSelf())
  9906. return;
  9907. }
  9908. switch (this.pressTarget) {
  9909. case PressType.powerNode:
  9910. this.barInfo.curY = e.stageY;
  9911. this.updateBarInfo();
  9912. this.isMoveRod = true;
  9913. break;
  9914. case PressType.moveNode:
  9915. let rootBall = xGame.common.d2World.rootBall;
  9916. let radius = rootBall.gameObj.width / 2;
  9917. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  9918. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  9919. let border = xGame.common.d2World.borderRect;
  9920. if (curX <= border.x + radius)
  9921. curX = border.x + radius;
  9922. else if (curX >= border.x + border.width - radius)
  9923. curX = border.x + border.width - radius;
  9924. if (curY <= border.y + radius)
  9925. curY = border.y + radius;
  9926. else if (curY >= border.y + border.height - radius)
  9927. curY = border.y + border.height - radius;
  9928. if (xGame.common.gameMgr.isOpenBall) {
  9929. if (curX >= border.x + border.openBallW - radius)
  9930. curX = border.x + border.openBallW - radius;
  9931. }
  9932. this.ui.moveNode.x = curX;
  9933. this.ui.moveNode.y = curY;
  9934. rootBall.gameObj.x = curX;
  9935. rootBall.gameObj.y = curY;
  9936. rootBall.d3BallSrc.setTransPos(curX, curY);
  9937. this.isMoveRod = true;
  9938. break;
  9939. case PressType.rulerNode:
  9940. let yy = e.stageY - this.eventObj.lastY;
  9941. this.eventObj.lastY = e.stageY;
  9942. let ruler1 = this.ui.rulerNode.img1;
  9943. let ruler2 = this.ui.rulerNode.img2;
  9944. ruler1.y += yy;
  9945. ruler2.y += yy;
  9946. this.rulerOffset += yy;
  9947. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  9948. this.rulerOffset = 0;
  9949. xGame.soundMgr.playSound("inch", 1, 10);
  9950. }
  9951. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  9952. let h = ruler1.height;
  9953. this.checkGuide();
  9954. this.isMoveRod = true;
  9955. if (ruler1.y >= h) {
  9956. ruler1.y = -h;
  9957. ruler2.y = 0;
  9958. return;
  9959. }
  9960. else if (ruler1.y <= -h) {
  9961. ruler1.y = h;
  9962. ruler2.y = 0;
  9963. return;
  9964. }
  9965. if (ruler2.y >= h) {
  9966. ruler2.y = -h;
  9967. ruler1.y = 0;
  9968. return;
  9969. }
  9970. else if (ruler2.y <= -h) {
  9971. ruler2.y = h;
  9972. ruler1.y = 0;
  9973. return;
  9974. }
  9975. break;
  9976. case PressType.d2Root:
  9977. this.eventObj.curX = e.stageX;
  9978. this.eventObj.curY = e.stageY;
  9979. let offset = this.checkRodMoveDir();
  9980. xGame.common.d2World.d2Gan.rotateSelf(offset);
  9981. this.eventObj.lastX = e.stageX;
  9982. this.eventObj.lastY = e.stageY;
  9983. break;
  9984. default:
  9985. break;
  9986. }
  9987. }
  9988. onEventUp(e) {
  9989. if (e.stopPropagation)
  9990. e.stopPropagation();
  9991. if (e && e.force) {
  9992. }
  9993. else {
  9994. if (!this.isTurnSelf())
  9995. return;
  9996. }
  9997. switch (this.pressTarget) {
  9998. case PressType.powerNode:
  9999. this.ui.powerNode.value = 0;
  10000. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  10001. this.ui.powerTxt.text = "";
  10002. if (this.powerNum > 0) {
  10003. xGame.eventMgr.event(BALL_SHOOT);
  10004. xGame.common.d2World.shoot(this.powerNum);
  10005. xGame.common.d2World.d2Gan.shoot();
  10006. xGame.common.d2World.d2HelpLine.shoot();
  10007. this.finishGuide();
  10008. this.ui.powerEft.visible = false;
  10009. this.ui.colorNode.visible = false;
  10010. let ganStr = "";
  10011. if (this.powerNum <= 30) {
  10012. ganStr = "gan_30";
  10013. }
  10014. else if (this.powerNum <= 60) {
  10015. ganStr = "gan_50";
  10016. }
  10017. else {
  10018. ganStr = "gan_80";
  10019. }
  10020. xGame.soundMgr.playSound(ganStr);
  10021. }
  10022. break;
  10023. case PressType.moveNode:
  10024. let rootBall = xGame.common.d2World.rootBall;
  10025. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  10026. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  10027. let isIntersect = this.judgeBallIntersect();
  10028. if (isIntersect) {
  10029. this.ui.moveNode.x = lastX;
  10030. this.ui.moveNode.y = lastY;
  10031. rootBall.gameObj.x = lastX;
  10032. rootBall.gameObj.y = lastY;
  10033. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  10034. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  10035. }
  10036. else {
  10037. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  10038. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  10039. }
  10040. this.showBallUI();
  10041. this.ui.moveNode.finger.visible = true;
  10042. xGame.common.d2World.getHelpLine();
  10043. break;
  10044. case PressType.rulerNode:
  10045. break;
  10046. case PressType.d2Root:
  10047. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  10048. if (dis <= 25) {
  10049. this.moveToClickDot(e);
  10050. }
  10051. break;
  10052. default:
  10053. break;
  10054. }
  10055. this.pressTarget = -1;
  10056. }
  10057. checkGuide() {
  10058. let guide = DataMgr.getSkillGuide();
  10059. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  10060. xGame.common.guideStep++;
  10061. xGame.common.gameUI.ui.guide2.visible = false;
  10062. xGame.common.gameUI.ui.guide3.visible = true;
  10063. }
  10064. }
  10065. finishGuide() {
  10066. let guide = DataMgr.getSkillGuide();
  10067. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  10068. xGame.common.guideStep = 10;
  10069. this.closeAllGuide();
  10070. }
  10071. }
  10072. closeAllGuide() {
  10073. xGame.common.gameUI.ui.guide1.visible = false;
  10074. xGame.common.gameUI.ui.guide2.visible = false;
  10075. xGame.common.gameUI.ui.guide3.visible = false;
  10076. }
  10077. updateBarInfo() {
  10078. let star = this.ui.powerNode.y;
  10079. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  10080. if (rate >= 1)
  10081. rate = 1;
  10082. if (rate <= 0)
  10083. rate = 0;
  10084. this.powerNum = Math.ceil(rate * 100);
  10085. this.ui.powerNode.value = this.powerNum;
  10086. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  10087. this.ui.colorNode.value = this.powerNum;
  10088. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  10089. this.ui.powerEft.visible = this.powerNum != 0;
  10090. this.ui.colorNode.visible = this.powerNum != 0;
  10091. this.ui.powerTxt.text = this.powerNum + "";
  10092. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  10093. }
  10094. forceCancel() {
  10095. this.ui.powerNode.value = 0;
  10096. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  10097. this.ui.powerTxt.text = "";
  10098. }
  10099. checkRodMoveDir() {
  10100. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  10101. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  10102. if (tempX >= 0 && tempY <= 0) {
  10103. return this.checkDir();
  10104. }
  10105. else if (tempX < 0 && tempY < 0) {
  10106. return this.checkDir(1, -1);
  10107. }
  10108. else if (tempX < 0 && tempY > 0) {
  10109. return this.checkDir(-1, -1);
  10110. }
  10111. else {
  10112. return this.checkDir(-1, 1);
  10113. }
  10114. }
  10115. checkDir(flagX = 1, flagY = 1) {
  10116. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  10117. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  10118. if (offsetY == 0) {
  10119. return offsetX * flagX;
  10120. }
  10121. if (offsetX == 0) {
  10122. return offsetY * flagY;
  10123. }
  10124. let angle = offsetY / offsetX;
  10125. if (Math.abs(angle) >= 1) {
  10126. return offsetY * flagY;
  10127. }
  10128. else {
  10129. return offsetX * flagX;
  10130. }
  10131. }
  10132. judgeBallIntersect() {
  10133. let rootBall = xGame.common.d2World.rootBall;
  10134. let ballArr = xGame.common.d2World.ballArr;
  10135. let radius = rootBall.gameObj.width / 2;
  10136. let temp;
  10137. let isIntersect = false;
  10138. for (let index = 0; index < ballArr.length; index++) {
  10139. temp = ballArr[index];
  10140. if (temp.number == rootBall.number)
  10141. continue;
  10142. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  10143. if (isIntersect) {
  10144. break;
  10145. }
  10146. }
  10147. return isIntersect;
  10148. }
  10149. hideBallUI() {
  10150. let d2Gan = xGame.common.d2World.d2Gan;
  10151. if (!d2Gan.ui.isDisposed)
  10152. d2Gan.ui.visible = false;
  10153. let d2Help = xGame.common.d2World.d2HelpLine;
  10154. if (!d2Help.ui.isDisposed)
  10155. d2Help.ui.visible = false;
  10156. let rootBall = xGame.common.d2World.rootBall;
  10157. if (!rootBall.destroyed) {
  10158. rootBall.gameObj.active = false;
  10159. }
  10160. }
  10161. showBallUI() {
  10162. let d2Gan = xGame.common.d2World.d2Gan;
  10163. if (!d2Gan.ui.isDisposed)
  10164. d2Gan.ui.visible = true;
  10165. let d2Help = xGame.common.d2World.d2HelpLine;
  10166. if (!d2Help.ui.isDisposed)
  10167. d2Help.ui.visible = true;
  10168. let rootBall = xGame.common.d2World.rootBall;
  10169. if (!rootBall.destroyed) {
  10170. rootBall.gameObj.active = true;
  10171. }
  10172. }
  10173. moveToClickDot(e) {
  10174. if (!this.isMoveRod && !xGame.common.clickedBall) {
  10175. let root = xGame.common.d2World.rootBall.gameObj;
  10176. let xx = e.stageX - xGame.common.sysOffestNum;
  10177. let yy = e.stageY;
  10178. let x = xx - root.x;
  10179. let y = yy - root.y;
  10180. let angle = xGame.common.getfguiRotation(x, y);
  10181. xGame.common.d2World.d2Gan.ui.rotation = angle;
  10182. xGame.common.d2World.getHelpLine();
  10183. }
  10184. this.isMoveRod = false;
  10185. xGame.common.clickedBall = false;
  10186. }
  10187. openAllEvent() {
  10188. this.closeAllEvent();
  10189. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10190. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10191. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10192. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10193. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  10194. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  10195. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  10196. }
  10197. closeAllEvent() {
  10198. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10199. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10200. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10201. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10202. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  10203. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  10204. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  10205. }
  10206. resetGame() {
  10207. this.closeAllEvent();
  10208. this.hideBallUI();
  10209. xGame.common.gameMgr.gamePause = true;
  10210. }
  10211. }
  10212. UIGame.uiName = "UIGame";
  10213. class UIAddProp extends UIBase {
  10214. constructor() {
  10215. super();
  10216. this.curType = "";
  10217. }
  10218. onConstructor() {
  10219. this.ui = ui_UIAddProp.createInstance();
  10220. this.contentPane = this.ui;
  10221. this.isEject = false;
  10222. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  10223. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  10224. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  10225. this.updateUI();
  10226. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  10227. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  10228. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  10229. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  10230. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  10231. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  10232. }
  10233. show(type) {
  10234. super.show();
  10235. this.curType = type == 0 ? "coin" : "diamond";
  10236. this.switchBtn("");
  10237. this.ui.t0.play();
  10238. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  10239. PlatMgr.showInsert(true);
  10240. }
  10241. closeSelf() {
  10242. this.hide();
  10243. }
  10244. updateUI() {
  10245. let data = cfgTable.moneyData;
  10246. let temp;
  10247. let obj;
  10248. for (const key in data) {
  10249. temp = data[key];
  10250. obj = this.ui.myNode["node" + key];
  10251. if (parseInt(key) <= 2) {
  10252. obj.diamondTxt.text = "+" + temp.num;
  10253. }
  10254. else {
  10255. obj.coinTxt.text = temp.num;
  10256. obj.diamondTxt.text = temp.get.split('_')[1];
  10257. }
  10258. }
  10259. this.updateDiamondShare();
  10260. }
  10261. updateDiamondShare() {
  10262. let data = DataMgr.getShareDiamondTimes();
  10263. if (data >= xGame.common.maxShareDiamondTimes) {
  10264. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  10265. this.ui.myNode.node1.touchable = false;
  10266. }
  10267. else {
  10268. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  10269. this.ui.myNode.node1.touchable = true;
  10270. }
  10271. }
  10272. switchBtn(type) {
  10273. if (type == "")
  10274. type = this.curType;
  10275. else {
  10276. if (this.curType == type) {
  10277. return;
  10278. }
  10279. else {
  10280. this.curType = type;
  10281. }
  10282. }
  10283. if (type == "coin") {
  10284. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  10285. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  10286. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  10287. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  10288. this.ui.myNode.c1.selectedIndex = 0;
  10289. }
  10290. else {
  10291. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  10292. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  10293. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  10294. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  10295. this.ui.myNode.c1.selectedIndex = 1;
  10296. }
  10297. }
  10298. convertCoin(index) {
  10299. let data = cfgTable.moneyData[index];
  10300. let coinNum = data.num;
  10301. let str = data.get.split('_')[1];
  10302. let needDiamond = parseInt(str);
  10303. if (DataMgr.diamondEnough(needDiamond)) {
  10304. DataMgr.setDiamond(-needDiamond);
  10305. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  10306. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  10307. }
  10308. else {
  10309. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  10310. this.switchBtn("diamond");
  10311. }
  10312. }
  10313. videoGetDiamond() {
  10314. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  10315. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  10316. }
  10317. else {
  10318. console.log('zh:AD 失败,直接发放奖励');
  10319. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  10320. }
  10321. }
  10322. qjff_AD_for_uiAddProp_videoGetDiamond() {
  10323. let num = cfgTable.moneyData[2].num;
  10324. xGame.common.playObjFlyAnim(num, Prop.diamond);
  10325. this.closeSelf();
  10326. }
  10327. videoGetCoin() {
  10328. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  10329. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  10330. }
  10331. else {
  10332. console.log('zh:AD 失败,直接发放奖励');
  10333. this.qjff_AD_for_uiAddProp_videoGetCoin();
  10334. }
  10335. }
  10336. qjff_AD_for_uiAddProp_videoGetCoin() {
  10337. xGame.common.playObjFlyAnim(2000, Prop.coin);
  10338. this.closeSelf();
  10339. }
  10340. shareGetDiamond() {
  10341. let times = DataMgr.getShareDiamondTimes();
  10342. if (times >= xGame.common.maxShareDiamondTimes) {
  10343. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  10344. }
  10345. else {
  10346. if (Moyu.isTT) {
  10347. let num = cfgTable.moneyData[1].num;
  10348. Moyu.shareVideo = '';
  10349. Moyu.shareGame((success) => {
  10350. if (success) {
  10351. xGame.uiMgr.Show(UIMsg, "分享成功!");
  10352. xGame.common.playObjFlyAnim(num, Prop.diamond);
  10353. DataMgr.setShareDiamondTimes(1);
  10354. this.updateDiamondShare();
  10355. }
  10356. else {
  10357. xGame.uiMgr.Show(UIMsg, "分享失败!");
  10358. }
  10359. });
  10360. }
  10361. else {
  10362. Moyu.showVideoAd(() => {
  10363. let diamond = xGame.common.randomNum(50, 100);
  10364. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  10365. DataMgr.setShareDiamondTimes(1);
  10366. this.updateDiamondShare();
  10367. }, EAdType.randomDiamond);
  10368. }
  10369. }
  10370. }
  10371. qjff_AD_for_uiAddProp_shareGetDiamond() {
  10372. }
  10373. openPutBallView() {
  10374. let end = xGame.uiMgr.getUI(UIGameEnd);
  10375. let skill = xGame.uiMgr.getUI(UISkill);
  10376. let level = xGame.uiMgr.getUI(UILevelDisplay);
  10377. let uigame = xGame.uiMgr.getUI(UIGame);
  10378. if (end && !end.isHide) {
  10379. xGame.uiMgr.Hide(UIGameEnd);
  10380. xGame.uiMgr.Show(UIMain);
  10381. }
  10382. if (skill && !skill.isHide)
  10383. xGame.uiMgr.Hide(UISkill);
  10384. if (uigame && !uigame.isHide)
  10385. xGame.uiMgr.Hide(UIGame);
  10386. if (level && !level.isHide) {
  10387. }
  10388. else {
  10389. xGame.uiMgr.Show(UILevelDisplay);
  10390. }
  10391. this.closeSelf();
  10392. }
  10393. }
  10394. UIAddProp.uiName = "UIAddProp";
  10395. class MoneyNode {
  10396. constructor(ui) {
  10397. this.leftTime = 0;
  10398. this.ui = ui;
  10399. this.ui.addCoinBtn.onClick(this, this.addCoin);
  10400. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  10401. this.ui.addPowerBtn.onClick(this, this.addPower);
  10402. this.ui.c1.selectedIndex = 1;
  10403. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  10404. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  10405. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  10406. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  10407. this.coinChange();
  10408. this.diamondChange();
  10409. this.powerChange();
  10410. }
  10411. addPower() {
  10412. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10413. xGame.uiMgr.Show(UIPower);
  10414. }
  10415. powerChange() {
  10416. let powerNum = DataMgr.getPower();
  10417. this.ui.powerTxt.text = powerNum + "";
  10418. }
  10419. checkPowerTime() {
  10420. let cur = new Date().getTime();
  10421. let last = DataMgr.getPowerTime();
  10422. if (last == 0) {
  10423. last = cur;
  10424. DataMgr.setPowerTime(cur);
  10425. }
  10426. let power = DataMgr.getPower();
  10427. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  10428. Laya.timer.clearAll(this);
  10429. if (power >= xGame.common.natureMaxPower) {
  10430. this.ui.powerTimeTxt.text = "";
  10431. DataMgr.setPowerTime(cur);
  10432. return;
  10433. }
  10434. if (power + offset >= xGame.common.natureMaxPower) {
  10435. DataMgr.setPower(xGame.common.natureMaxPower, false);
  10436. this.ui.powerTimeTxt.text = "";
  10437. DataMgr.setPowerTime(cur);
  10438. }
  10439. else {
  10440. if (offset > 0) {
  10441. DataMgr.setPower(offset);
  10442. DataMgr.setPowerTime(cur);
  10443. }
  10444. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  10445. this.leftTime = xGame.common.powerRecoverNum - time;
  10446. if (this.leftTime <= 0)
  10447. this.leftTime = 0;
  10448. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10449. Laya.timer.loop(1000, this, this.updatePowerTime);
  10450. }
  10451. }
  10452. updatePowerTime() {
  10453. this.leftTime -= 1;
  10454. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10455. if (this.leftTime <= 0) {
  10456. this.checkPowerTime();
  10457. }
  10458. }
  10459. coinChange() {
  10460. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  10461. }
  10462. diamondChange() {
  10463. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  10464. }
  10465. addCoin() {
  10466. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10467. Moyu.sendDataEvent("AddCoinBtn");
  10468. xGame.uiMgr.Show(UIAddProp, 0);
  10469. }
  10470. addDiamond() {
  10471. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10472. Moyu.sendDataEvent("AddDiamondBtn");
  10473. xGame.uiMgr.Show(UIAddProp, 1);
  10474. }
  10475. }
  10476. class UIDraw extends UIBase {
  10477. constructor() {
  10478. super();
  10479. this.curKey = 0;
  10480. }
  10481. onConstructor() {
  10482. this.ui = ui_UIDraw.createInstance();
  10483. this.contentPane = this.ui;
  10484. this.isEject = false;
  10485. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  10486. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  10487. this.addUIClick(this.ui.drawBtn, this.startDraw);
  10488. this.initDraw();
  10489. this.initUI();
  10490. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  10491. if (Moyu.isKs)
  10492. this.ui.closeNode.closeBtn.x += 100;
  10493. }
  10494. show() {
  10495. super.show();
  10496. this.ui.t0.play();
  10497. this.playSecretaryIdle();
  10498. this.updateDraw();
  10499. this.checkFree();
  10500. if (PlatMgr.bannerDelay > 0) {
  10501. this.ui.closeNode.closeBtn.visible = false;
  10502. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  10503. this.ui.closeNode.closeBtn.visible = true;
  10504. });
  10505. }
  10506. PlatMgr.showRateBanner();
  10507. }
  10508. hide() {
  10509. Laya.timer.clearAll(this);
  10510. super.hide();
  10511. }
  10512. checkFree() {
  10513. let isFree = DataMgr.getDailyfreeDrawTimes();
  10514. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  10515. }
  10516. initDraw() {
  10517. this.drawObj = [];
  10518. let data = cfgTable.drawData;
  10519. let temp;
  10520. let weight = 0;
  10521. for (const key in data) {
  10522. temp = data[key];
  10523. weight += temp.weight;
  10524. this.drawObj.push(weight);
  10525. }
  10526. this.allWeight = weight;
  10527. }
  10528. initUI() {
  10529. let data = cfgTable.drawData;
  10530. let temp;
  10531. let img;
  10532. let txt;
  10533. for (const key in data) {
  10534. temp = data[key];
  10535. img = this.ui.myNode.rotNode["img" + key];
  10536. txt = this.ui.myNode.rotNode["txt" + key];
  10537. img.url = xGame.common.getGameIconUrl(temp.icon);
  10538. txt.visible = true;
  10539. if (temp.award > 2) {
  10540. img.rotation = 0;
  10541. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  10542. }
  10543. else {
  10544. img.rotation = temp.rotation;
  10545. txt.text = temp.num;
  10546. }
  10547. }
  10548. }
  10549. getCurkey() {
  10550. let rand = Math.random() * this.allWeight;
  10551. let temp;
  10552. for (let index = 0; index < this.drawObj.length - 1; index++) {
  10553. temp = this.drawObj[index];
  10554. if (index == 0) {
  10555. if (rand < temp) {
  10556. return index + 1;
  10557. }
  10558. }
  10559. else {
  10560. if (rand >= temp && rand < this.drawObj[index + 1]) {
  10561. return index + 1;
  10562. }
  10563. }
  10564. }
  10565. return 2;
  10566. }
  10567. startDraw() {
  10568. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  10569. if (freeTimes > 0) {
  10570. this.beginDraw();
  10571. DataMgr.setDailyfreeDrawTimes(0);
  10572. this.checkFree();
  10573. }
  10574. else {
  10575. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  10576. }
  10577. else {
  10578. console.log('zh:AD 失败,直接发放奖励');
  10579. this.qjff_chouJiang();
  10580. }
  10581. }
  10582. }
  10583. qjff_chouJiang() {
  10584. this.beginDraw();
  10585. }
  10586. beginDraw() {
  10587. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  10588. this.ui.drawBtn.touchable = false;
  10589. this.curKey = this.getCurkey();
  10590. console.log("当前key", this.curKey);
  10591. let cell = 60;
  10592. let lap = 3;
  10593. let angle = cell * (this.curKey - 1) + lap * 360;
  10594. let target = this.ui.myNode.rotNode;
  10595. target.rotation = 0;
  10596. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  10597. console.log("旋转完成");
  10598. this.ui.drawBtn.touchable = true;
  10599. this.getAward();
  10600. }));
  10601. }
  10602. getAward() {
  10603. let data = cfgTable.drawData[this.curKey];
  10604. let temp = new AwardType();
  10605. temp.type = data.award;
  10606. temp.num = data.num;
  10607. xGame.common.getAward([temp], () => {
  10608. DataMgr.setDrawTimes(1);
  10609. this.updateDraw();
  10610. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  10611. });
  10612. }
  10613. updateDraw() {
  10614. let drawTimes = DataMgr.getDrawTimes();
  10615. let awardTimes = DataMgr.getDrawAwardTimes();
  10616. if (Math.floor(drawTimes / 3) > awardTimes) {
  10617. this.ui.extraNode.boxBtn.t0.play(null, -1);
  10618. this.ui.extraNode.boxBtn.touchable = true;
  10619. this.ui.extraNode.tipsTxt.text = "3/3";
  10620. this.ui.extraNode.barNode.width = 265;
  10621. this.getExtraAward();
  10622. }
  10623. else {
  10624. this.ui.extraNode.boxBtn.t0.stop();
  10625. this.ui.extraNode.boxBtn.touchable = false;
  10626. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  10627. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  10628. }
  10629. let data = cfgTable.drawData[1];
  10630. if (awardTimes == 0) {
  10631. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  10632. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  10633. this.ui.myNode.rotNode.img1.rotation = 0;
  10634. }
  10635. else {
  10636. let award = data.nextid;
  10637. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  10638. this.ui.myNode.rotNode.txt1.text = award[1];
  10639. this.ui.myNode.rotNode.img1.rotation = 0;
  10640. }
  10641. }
  10642. getExtraAward() {
  10643. let drawTimes = DataMgr.getDrawTimes();
  10644. let awardTimes = DataMgr.getDrawAwardTimes();
  10645. let data = cfgTable.drawData[1];
  10646. let award = new AwardType();
  10647. if (awardTimes == 0) {
  10648. award.num = data.num;
  10649. award.type = data.award;
  10650. xGame.common.getAward([award], () => {
  10651. let all = Math.floor(drawTimes / 3);
  10652. DataMgr.setDrawAwardTimes(all);
  10653. this.updateDraw();
  10654. });
  10655. }
  10656. else {
  10657. award.num = parseInt(data.nextid[1]);
  10658. award.type = parseInt(data.nextid[0]);
  10659. xGame.common.getAward([award], () => {
  10660. let all = Math.floor(drawTimes / 3);
  10661. DataMgr.setDrawAwardTimes(all);
  10662. this.updateDraw();
  10663. });
  10664. }
  10665. }
  10666. closeSelf() {
  10667. this.hide();
  10668. }
  10669. playSecretaryIdle() {
  10670. let parent = this.ui.secretary.displayObject;
  10671. parent.destroyChildren();
  10672. let xx = this.ui.secretary.width / 2;
  10673. let yy = this.ui.secretary.height;
  10674. let scale = xGame.common.getSecretaryScale();
  10675. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  10676. xGame.common.secretary.play(data, 0, true, parent);
  10677. }
  10678. }
  10679. UIDraw.uiName = "UIDraw";
  10680. class ui_UIFlyEft extends fgui.GComponent {
  10681. static createInstance() {
  10682. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  10683. }
  10684. onConstruct() {
  10685. this.n0 = (this.getChild("n0"));
  10686. this.n1 = (this.getChild("n1"));
  10687. this.n2 = (this.getChild("n2"));
  10688. this.n3 = (this.getChild("n3"));
  10689. this.n4 = (this.getChild("n4"));
  10690. this.n5 = (this.getChild("n5"));
  10691. this.n6 = (this.getChild("n6"));
  10692. this.n7 = (this.getChild("n7"));
  10693. this.iconNode = (this.getChild("iconNode"));
  10694. this.txt = (this.getChild("txt"));
  10695. this.txtNode = (this.getChild("txtNode"));
  10696. }
  10697. }
  10698. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  10699. class UIFlyEft extends UIBase {
  10700. constructor() {
  10701. super();
  10702. this.max = 8;
  10703. this.delay = 0;
  10704. }
  10705. onConstructor() {
  10706. this.ui = ui_UIFlyEft.createInstance();
  10707. this.contentPane = this.ui;
  10708. this.isEject = false;
  10709. this.isMuti = true;
  10710. this.ui.x += xGame.common.sysOffestNum;
  10711. }
  10712. getArrPos() {
  10713. if (this.iconPos && this.iconPos.length > 0)
  10714. return;
  10715. this.iconPos = [];
  10716. let temp;
  10717. for (let index = 0; index < this.max; index++) {
  10718. temp = this.ui["n" + index];
  10719. this.iconPos.push([temp.x, temp.y]);
  10720. }
  10721. }
  10722. show(stPos, edPos, num, type, callback) {
  10723. super.show();
  10724. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  10725. this.getArrPos();
  10726. this.updateUI(type);
  10727. this.updatePos();
  10728. this.runFly(edPos, callback);
  10729. this.runWorlds(stPos, num);
  10730. }
  10731. updateUI(type) {
  10732. let temp;
  10733. let str;
  10734. for (let index = 0; index < this.max; index++) {
  10735. temp = this.ui["n" + index];
  10736. str = this.getIconStr(type);
  10737. temp.url = xGame.common.getGameIconUrl(str);
  10738. }
  10739. }
  10740. getIconStr(type) {
  10741. switch (type) {
  10742. case Prop.diamond:
  10743. return "ty_zs";
  10744. case Prop.coin:
  10745. return "ty_jb";
  10746. default:
  10747. break;
  10748. }
  10749. }
  10750. updatePos() {
  10751. let temp;
  10752. for (let index = 0; index < this.max; index++) {
  10753. temp = this.ui["n" + index];
  10754. temp.x = this.iconPos[index][0];
  10755. temp.y = this.iconPos[index][1];
  10756. }
  10757. }
  10758. runFly(endPos, callback) {
  10759. let all = 0;
  10760. let temp;
  10761. for (let index = 0; index < this.max; index++) {
  10762. temp = this.ui["n" + index];
  10763. temp.visible = true;
  10764. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  10765. temp.visible = false;
  10766. all++;
  10767. if (all >= this.max) {
  10768. callback && callback();
  10769. }
  10770. }), 20 * index);
  10771. }
  10772. }
  10773. runWorlds(stPos, num) {
  10774. let str = "+" + num;
  10775. this.ui.txt.text = str;
  10776. let starX = stPos.x;
  10777. let starY = stPos.y + 50;
  10778. this.ui.txt.x = starX;
  10779. this.ui.txt.y = starY;
  10780. this.ui.txt.visible = true;
  10781. this.ui.txt.alpha = 1;
  10782. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  10783. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  10784. this.ui.txt.visible = false;
  10785. this.hide();
  10786. }));
  10787. }));
  10788. }
  10789. }
  10790. UIFlyEft.uiName = "UIFlyEft";
  10791. class Common {
  10792. constructor() {
  10793. this.convertNum = 0.025;
  10794. this.VectorUp = new Laya.Vector3(0, 1, 0);
  10795. this.scaleV3One = new Laya.Vector3();
  10796. this.scaleV3Two = new Laya.Vector3();
  10797. this.posV4 = new Laya.Vector4();
  10798. this.showDebug = false;
  10799. this.openGuide = true;
  10800. this.rodOffest = new Laya.Vector2(0, 0);
  10801. this.rodAngle = 0;
  10802. this.gameMode = GameMode.classic;
  10803. this.bigMoveLevelIndex = 1;
  10804. this.bigMoveNeedCoin = 1000;
  10805. this.classicNiceNeddCoin = 1000;
  10806. this.passAwardCoin = 2000;
  10807. this.classicRoomType = 1;
  10808. this.maxPower = 20;
  10809. this.natureMaxPower = 5;
  10810. this.videoPower = 2;
  10811. this.powerRecoverNum = 900;
  10812. this.curPlayerSkillType = 0;
  10813. this.isNewDay = false;
  10814. this.clickedBall = false;
  10815. this.placeBallCurLevel = 0;
  10816. this.placeBallStarNum = 0;
  10817. this.longHelpLine = false;
  10818. this.maxShareDiamondTimes = 3;
  10819. this.guideStep = 0;
  10820. this.temSelfLevel = 0;
  10821. this.extraMoveNum = 0;
  10822. this.curRankID = 0;
  10823. this.rankID = {
  10824. normalStar: 12000,
  10825. wxStar: 12001
  10826. };
  10827. this.skillNameList = ["Fall from the sky", "Unstoppable Force", "Freeze Shot"];
  10828. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  10829. this.btnClickStr = "buttonclick";
  10830. this.maxSkillLevel = 10;
  10831. this.upSkillLevel = false;
  10832. this.gameStartTime = 0;
  10833. this._sysOffestNum = 0;
  10834. this.angleV2 = new Laya.Vector2();
  10835. this.rootV = new Laya.Vector2(0, 1);
  10836. this.tempDir1 = new Laya.Vector2();
  10837. this.tempDir2 = new Laya.Vector2();
  10838. this.ballSize = 33;
  10839. this.stPos = new Laya.Point();
  10840. this.edPos = new Laya.Point();
  10841. Common._instance = this;
  10842. window["common"] = this;
  10843. }
  10844. static getInstance() {
  10845. if (!this._instance) {
  10846. this._instance = new Common();
  10847. }
  10848. return this._instance;
  10849. }
  10850. get sysOffestNum() {
  10851. if (this._sysOffestNum == 0) {
  10852. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  10853. }
  10854. return this._sysOffestNum;
  10855. }
  10856. testShader() {
  10857. let test = new LightShader();
  10858. test.texture = "res/d3Res/ballTexture/ball1.png";
  10859. Laya.stage.addChild(test);
  10860. }
  10861. playScale(node) {
  10862. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  10863. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  10864. }));
  10865. }));
  10866. }
  10867. setGroup(colli, ...group) {
  10868. let out = 0;
  10869. for (let index = 0; index < group.length; index++) {
  10870. if (index == 0) {
  10871. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10872. }
  10873. else {
  10874. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10875. }
  10876. }
  10877. colli.collisionGroup = out;
  10878. }
  10879. setCanGroupWith(colli, ...group) {
  10880. let out = 0;
  10881. for (let index = 0; index < group.length; index++) {
  10882. if (index == 0) {
  10883. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10884. }
  10885. else {
  10886. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10887. }
  10888. }
  10889. colli.canCollideWith = out;
  10890. }
  10891. loadPrefab(name, callback) {
  10892. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  10893. let prefab = new Laya.Prefab();
  10894. prefab.json = obj;
  10895. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  10896. callback && callback(img);
  10897. }));
  10898. }
  10899. pos2to3Convert(x, y, d3Pos) {
  10900. x = x + this.sysOffestNum;
  10901. d3Pos.setValue(x, y, 0);
  10902. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  10903. if (success) {
  10904. }
  10905. else {
  10906. console.error("转换出错了。。。。。。。。");
  10907. }
  10908. }
  10909. scale2to3Convert(num) {
  10910. this.scaleV3One.setValue(0, 0, 0);
  10911. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  10912. this.scaleV3Two.setValue(0, num, 0);
  10913. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  10914. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  10915. return outNum;
  10916. }
  10917. pos3to2Convert(d3Pos) {
  10918. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  10919. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  10920. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  10921. d3Pos.x -= this.sysOffestNum;
  10922. }
  10923. scale3to2Convert(num) {
  10924. let scale = this.scale2to3Convert(1);
  10925. let d2Out = num / scale;
  10926. return d2Out;
  10927. }
  10928. getCollider(type, restitution = 0.9, density = 10) {
  10929. let colli;
  10930. if (type == "box")
  10931. colli = new Laya.BoxCollider();
  10932. else
  10933. colli = new Laya.CircleCollider();
  10934. colli.friction = 0;
  10935. colli.restitution = restitution;
  10936. colli.density = density;
  10937. return colli;
  10938. }
  10939. getRigbody() {
  10940. let rigy = new Laya.RigidBody();
  10941. rigy.bullet = true;
  10942. rigy.allowRotation = false;
  10943. rigy.allowSleep = false;
  10944. rigy.gravityScale = 0;
  10945. return rigy;
  10946. }
  10947. getfguiRotation(x, y) {
  10948. this.angleV2.setValue(x, y);
  10949. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  10950. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  10951. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  10952. angle = -angle;
  10953. }
  10954. return 180 + angle;
  10955. }
  10956. getAngle(x, y) {
  10957. this.angleV2.setValue(x, y);
  10958. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  10959. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  10960. return angle;
  10961. }
  10962. randomNum(a, b) {
  10963. return a + Math.floor((b - a + 1) * Math.random());
  10964. }
  10965. getRandArrEle(arr) {
  10966. return arr[Math.floor(arr.length * Math.random())];
  10967. }
  10968. getSign(val) {
  10969. return val >= 0 ? 1 : -1;
  10970. }
  10971. botherArr(arr) {
  10972. let times = arr.length + 2;
  10973. let length = arr.length;
  10974. let a;
  10975. let b;
  10976. let temp;
  10977. for (let index = 0; index < times; index++) {
  10978. a = Math.floor(Math.random() * length);
  10979. b = Math.floor(Math.random() * length);
  10980. temp = arr[a];
  10981. arr[a] = arr[b];
  10982. arr[b] = temp;
  10983. }
  10984. }
  10985. getGameIconUrl(id) {
  10986. return "ui://game/" + id;
  10987. }
  10988. getComponentUrl(id) {
  10989. return "ui://game/" + id;
  10990. }
  10991. getAnimation() {
  10992. }
  10993. judgeSkillType(type = SkillType.highSpace) {
  10994. if (this.gameMode == GameMode.classic)
  10995. return;
  10996. let gameMgr = this.gameMgr;
  10997. if (gameMgr.selfTurn) {
  10998. if (gameMgr.selfCurSkill == type) {
  10999. return true;
  11000. }
  11001. }
  11002. else {
  11003. if (gameMgr.aiCurSkill == type) {
  11004. return true;
  11005. }
  11006. }
  11007. }
  11008. ballColliHole(collider) {
  11009. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  11010. xGame.common.gameMgr.isFirstInGame = false;
  11011. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  11012. }
  11013. collider.owner.mySrc.checkWrongBall();
  11014. }
  11015. getArrMaxEle(arr) {
  11016. let max = -Infinity;
  11017. for (let index = 0; index < arr.length; index++) {
  11018. max = Math.max(arr[index], max);
  11019. }
  11020. return max;
  11021. }
  11022. getArrMinEle(arr) {
  11023. let min = Infinity;
  11024. for (let index = 0; index < arr.length; index++) {
  11025. min = Math.min(arr[index], min);
  11026. }
  11027. return min;
  11028. }
  11029. playRandomMutiBallBigSkillSound() {
  11030. if (Math.random() <= 0.5)
  11031. return;
  11032. let rand = this.randomNum(1, 6);
  11033. let str = "ganfa0" + rand;
  11034. xGame.soundMgr.playSound(str);
  11035. }
  11036. showOneCamera(type) {
  11037. let object = xGame.common.d3World.cameraObj;
  11038. for (const key in object) {
  11039. if (Object.prototype.hasOwnProperty.call(object, key)) {
  11040. object[key].init();
  11041. object[key].owner.active = key == type;
  11042. }
  11043. }
  11044. }
  11045. checkBallOverBorder(x, y) {
  11046. let radius = 17;
  11047. let condition = this._checkBorder(x + radius, y) ||
  11048. this._checkBorder(x - radius, y) ||
  11049. this._checkBorder(x, y + radius) ||
  11050. this._checkBorder(x, y - radius);
  11051. if (condition) {
  11052. return true;
  11053. }
  11054. }
  11055. _checkBorder(x, y) {
  11056. let borderRect = this.d2World.borderRect;
  11057. let xOffest = 20;
  11058. let yOffest = 20;
  11059. if (y <= borderRect.y - yOffest) {
  11060. return true;
  11061. }
  11062. if (y >= borderRect.y + borderRect.height + yOffest) {
  11063. return true;
  11064. }
  11065. if (x <= borderRect.x - xOffest) {
  11066. return true;
  11067. }
  11068. if (x >= borderRect.x + borderRect.width + xOffest) {
  11069. return true;
  11070. }
  11071. }
  11072. initWeight(cfg) {
  11073. let allCfgData = { data: {}, allWeightNum: 0 };
  11074. let weightCfg = allCfgData.data;
  11075. let weight = 0;
  11076. for (const key in cfg) {
  11077. weightCfg[key] = {};
  11078. weightCfg[key].id = cfg[key].id;
  11079. weightCfg[key].minWeight = weight;
  11080. weight += cfg[key].weight;
  11081. weightCfg[key].maxWeight = weight;
  11082. }
  11083. allCfgData.allWeightNum = weight;
  11084. return allCfgData;
  11085. }
  11086. getRandomWeightData(cfg) {
  11087. let weightCfg = cfg.data;
  11088. let allWeightNum = cfg.allWeightNum;
  11089. let rand = Math.floor(Math.random() * allWeightNum);
  11090. for (const key in weightCfg) {
  11091. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  11092. return weightCfg[key];
  11093. }
  11094. }
  11095. return weightCfg[1];
  11096. }
  11097. showGirlTalkPop(wordsIndex, node, msgNode) {
  11098. node.visible = true;
  11099. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  11100. node.t0.play(Laya.Handler.create(this, () => {
  11101. node.visible = false;
  11102. }));
  11103. }
  11104. stopGirlPop(node) {
  11105. node.t0.stop();
  11106. node.visible = false;
  11107. }
  11108. createHead(loader, url, size = 107) {
  11109. if (Laya.Browser.name == "Browser") {
  11110. loader.url = url;
  11111. return;
  11112. }
  11113. if (Moyu.isTT) {
  11114. let localImage = new Image();
  11115. localImage.src = url;
  11116. localImage.onload = () => {
  11117. let t2d = new Laya.Texture2D();
  11118. t2d.width = size;
  11119. t2d.height = size;
  11120. loader.displayObject.graphics.drawImage(new Laya.Texture(t2d), 0, 0);
  11121. t2d.loadImageSource(localImage);
  11122. };
  11123. }
  11124. else {
  11125. console.log('zh:url=', url);
  11126. loader.url = url;
  11127. }
  11128. }
  11129. addTestCoin(num) {
  11130. DataMgr.setCoin(num);
  11131. }
  11132. addTestDiamond(num) {
  11133. DataMgr.setDiamond(num);
  11134. }
  11135. addTestSkill() {
  11136. DataMgr.setBigSkill(0, 99);
  11137. DataMgr.setBigSkill(1, 99);
  11138. DataMgr.setBigSkill(2, 99);
  11139. }
  11140. playClassicEmotion(number, x, y) {
  11141. if (this.gameMode == GameMode.bigMove)
  11142. return;
  11143. let randIndex = this.randomNum(0, 2);
  11144. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  11145. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  11146. if (this.gameMgr.selfTurn) {
  11147. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11148. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11149. }
  11150. else {
  11151. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11152. }
  11153. else {
  11154. if (number == this.gameMgr.blackNum) {
  11155. if (this.gameMgr.selfBallArr.length == 0) {
  11156. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11157. }
  11158. else {
  11159. }
  11160. }
  11161. else {
  11162. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11163. }
  11164. }
  11165. }
  11166. }
  11167. else {
  11168. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11169. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11170. }
  11171. else {
  11172. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11173. }
  11174. else {
  11175. if (number == this.gameMgr.blackNum) {
  11176. if (this.gameMgr.aiBallArr.length == 0) {
  11177. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11178. }
  11179. else {
  11180. }
  11181. }
  11182. else {
  11183. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11184. }
  11185. }
  11186. }
  11187. }
  11188. }
  11189. playHappySound(number) {
  11190. if (this.gameMode != GameMode.classic)
  11191. return;
  11192. if (number == 8)
  11193. return;
  11194. let play = false;
  11195. if (this.gameMgr.selfTurn) {
  11196. if (this.gameMgr.ensureBallType) {
  11197. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11198. play = true;
  11199. }
  11200. }
  11201. else {
  11202. play = true;
  11203. }
  11204. }
  11205. else {
  11206. if (this.gameMgr.ensureBallType) {
  11207. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11208. play = true;
  11209. }
  11210. }
  11211. else {
  11212. play = true;
  11213. }
  11214. }
  11215. if (play)
  11216. xGame.soundMgr.playSound("applause");
  11217. }
  11218. destroyClassicEmotion() {
  11219. if (this.gameMode == GameMode.bigMove)
  11220. return;
  11221. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  11222. parent.destroyChildren();
  11223. }
  11224. playAwardSpine(x, y) {
  11225. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  11226. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  11227. this.awardSpine.play(data, 0, false, parent);
  11228. }
  11229. destroyAwardSpine() {
  11230. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  11231. parent.destroyChildren();
  11232. }
  11233. isBlock(bx, by, hx, hy, except = null) {
  11234. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  11235. let balls = xGame.common.d2World.ballArr;
  11236. let outArr = [];
  11237. for (let index = 0; index < balls.length; index++) {
  11238. let obj = balls[index];
  11239. if (obj.number == 0)
  11240. continue;
  11241. if (obj == except)
  11242. continue;
  11243. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  11244. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  11245. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  11246. if (num >= 1)
  11247. num = 1;
  11248. if (num < 0)
  11249. continue;
  11250. let gap = Math.sin(Math.acos(num)) * dis;
  11251. if (gap < this.ballSize) {
  11252. outArr.push({
  11253. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  11254. disHon: Math.cos(Math.acos(num)) * dis,
  11255. disVer: Math.sin(Math.acos(num)) * dis,
  11256. src: balls[index],
  11257. dir: this.tempDir1
  11258. });
  11259. }
  11260. }
  11261. if (outArr.length > 0) {
  11262. outArr.sort((a, b) => { return a.dis - b.dis; });
  11263. return outArr[0];
  11264. }
  11265. }
  11266. AngleBetween(vector1, vector2) {
  11267. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  11268. return rad * (180 / Math.PI);
  11269. }
  11270. getSecretaryScale() {
  11271. if (this.secretary.spineName == "mishu") {
  11272. return 1.28;
  11273. }
  11274. else {
  11275. return 1.024;
  11276. }
  11277. }
  11278. signAwardContainsRod(arr) {
  11279. let temp;
  11280. for (let index = 0; index < arr.length; index++) {
  11281. temp = arr[index].split('-')[0];
  11282. if (parseInt(temp) > 2) {
  11283. return true;
  11284. }
  11285. }
  11286. }
  11287. judgeSameDay() {
  11288. let lastTime = DataMgr.getSignTime();
  11289. let curTime = new Date().getTime();
  11290. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  11291. return true;
  11292. }
  11293. return false;
  11294. }
  11295. getAward(arr, callback) {
  11296. let showTriple = arr[0].type <= 2;
  11297. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  11298. let temp;
  11299. for (let index = 0; index < arr.length; index++) {
  11300. temp = arr[index];
  11301. switch (temp.type) {
  11302. case 1:
  11303. this.playObjFlyAnim(temp.num, temp.type);
  11304. break;
  11305. case 2:
  11306. this.playObjFlyAnim(temp.num, temp.type);
  11307. break;
  11308. case 3:
  11309. case 4:
  11310. case 5:
  11311. case 6:
  11312. DataMgr.setBallRod(temp.type - 2, 1);
  11313. DataMgr.setCurBallRod(temp.type - 2);
  11314. break;
  11315. default:
  11316. break;
  11317. }
  11318. }
  11319. callback && callback(watchVideo);
  11320. });
  11321. }
  11322. getMoneyNode() {
  11323. let moneyNode;
  11324. let sign = xGame.uiMgr.getUI(UISign);
  11325. let draw = xGame.uiMgr.getUI(UIDraw);
  11326. let end = xGame.uiMgr.getUI(UIGameEnd);
  11327. let skill = xGame.uiMgr.getUI(UISkill);
  11328. if (sign && !sign.isHide)
  11329. moneyNode = sign.ui.moneyNode;
  11330. if (draw && !draw.isHide)
  11331. moneyNode = draw.ui.moneyNode;
  11332. if (end && !end.isHide)
  11333. moneyNode = end.ui.moneyNode;
  11334. if (skill && !skill.isHide)
  11335. moneyNode = skill.ui.moneyNode;
  11336. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  11337. let main = xGame.uiMgr.getUI(UIMain);
  11338. if (condition1 && main && !main.isHide) {
  11339. moneyNode = main.ui.moneyNode;
  11340. }
  11341. return moneyNode;
  11342. }
  11343. playObjFlyAnim(num, type, callback = null) {
  11344. this.stPos.x = Laya.stage.width / 2;
  11345. this.stPos.y = Laya.stage.height / 2;
  11346. let moneyNode = this.getMoneyNode();
  11347. switch (type) {
  11348. case Prop.diamond:
  11349. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  11350. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  11351. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  11352. this.edPos.x /= 2;
  11353. this.edPos.y /= 2;
  11354. break;
  11355. case Prop.coin:
  11356. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  11357. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  11358. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  11359. this.edPos.x /= 2;
  11360. this.edPos.y /= 2;
  11361. break;
  11362. default:
  11363. break;
  11364. }
  11365. xGame.soundMgr.playSound("coinbag");
  11366. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  11367. switch (type) {
  11368. case Prop.diamond:
  11369. DataMgr.setDiamond(num);
  11370. break;
  11371. case Prop.coin:
  11372. DataMgr.setCoin(num);
  11373. break;
  11374. default:
  11375. break;
  11376. }
  11377. callback && callback();
  11378. });
  11379. }
  11380. autoPopUIView() {
  11381. let arr = [];
  11382. let sign = this.judgeSameDay() ? false : true;
  11383. if (sign)
  11384. arr.push("sign");
  11385. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  11386. if (draw)
  11387. arr.push("draw");
  11388. if (arr.length <= 0)
  11389. return;
  11390. let str = this.getRandArrEle(arr);
  11391. switch (str) {
  11392. case "sign":
  11393. xGame.uiMgr.Show(UISign);
  11394. break;
  11395. case "draw":
  11396. xGame.uiMgr.Show(UIDraw);
  11397. break;
  11398. default:
  11399. break;
  11400. }
  11401. }
  11402. getMSTime(time) {
  11403. let min = Math.floor(time / 60);
  11404. let sec = Math.floor((time - min * 60));
  11405. if (sec < 10)
  11406. sec = "0" + sec;
  11407. if (min < 10)
  11408. min = "0" + min;
  11409. return `${min}:${sec}`;
  11410. }
  11411. testPower() {
  11412. DataMgr.setPower(0, false);
  11413. }
  11414. getAllStarNum() {
  11415. let data = DataMgr.getPlaceBallLevelList();
  11416. let out = 0;
  11417. for (let index = 0; index < data.length; index++) {
  11418. out += data[index].star;
  11419. }
  11420. return out;
  11421. }
  11422. recoverCameraView() {
  11423. Laya.timer.once(900, this, () => {
  11424. xGame.common.showOneCamera("mainCamera");
  11425. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  11426. xGame.common.gameUI.ui.d2Node.alpha = 1;
  11427. xGame.common.gameUI.ui.border.alpha = 0;
  11428. if (Laya.physicsTimer.scale < 1) {
  11429. Laya.physicsTimer.scale = 1;
  11430. }
  11431. }
  11432. });
  11433. }
  11434. getClassicLevel() {
  11435. let successTimes = DataMgr.getClassicTimes();
  11436. let needKey = "";
  11437. let lastKey = "";
  11438. let cfg = cfgTable.classictimesData;
  11439. let data;
  11440. for (const key in cfg) {
  11441. data = cfg[key];
  11442. if (successTimes <= data.times) {
  11443. needKey = key;
  11444. }
  11445. lastKey = key;
  11446. }
  11447. if (needKey == "")
  11448. needKey = lastKey;
  11449. return cfg[needKey];
  11450. }
  11451. }
  11452. Common._instance = null;
  11453. class ui_Component92 extends fgui.GComponent {
  11454. static createInstance() {
  11455. return (fgui.UIPackage.createObject("game", "Component92"));
  11456. }
  11457. onConstruct() {
  11458. this.n0 = (this.getChild("n0"));
  11459. }
  11460. }
  11461. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  11462. class ui_Component129 extends fgui.GProgressBar {
  11463. static createInstance() {
  11464. return (fgui.UIPackage.createObject("game", "Component129"));
  11465. }
  11466. onConstruct() {
  11467. this.bar_v = (this.getChild("bar_v"));
  11468. this.n84 = (this.getChild("n84"));
  11469. }
  11470. }
  11471. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  11472. class ui_Component130 extends fgui.GComponent {
  11473. static createInstance() {
  11474. return (fgui.UIPackage.createObject("game", "Component130"));
  11475. }
  11476. onConstruct() {
  11477. this.ani = (this.getChild("ani"));
  11478. this.t0 = this.getTransition("t0");
  11479. }
  11480. }
  11481. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  11482. class ui_powerEft extends fgui.GComponent {
  11483. static createInstance() {
  11484. return (fgui.UIPackage.createObject("game", "powerEft"));
  11485. }
  11486. onConstruct() {
  11487. this.ani = (this.getChild("ani"));
  11488. this.n88 = (this.getChild("n88"));
  11489. this.n89 = (this.getChild("n89"));
  11490. }
  11491. }
  11492. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  11493. class ui_PutBallLevelDisplay extends fgui.GComponent {
  11494. static createInstance() {
  11495. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  11496. }
  11497. onConstruct() {
  11498. this.c1 = this.getController("c1");
  11499. this.n2 = (this.getChild("n2"));
  11500. this.n22 = (this.getChild("n22"));
  11501. this.n23 = (this.getChild("n23"));
  11502. this.n15 = (this.getChild("n15"));
  11503. this.challenge = (this.getChild("challenge"));
  11504. this.n17 = (this.getChild("n17"));
  11505. this.n3 = (this.getChild("n3"));
  11506. this.starNode = (this.getChild("starNode"));
  11507. this.levelTxt = (this.getChild("levelTxt"));
  11508. this.n14 = (this.getChild("n14"));
  11509. this.n19 = (this.getChild("n19"));
  11510. this.n20 = (this.getChild("n20"));
  11511. this.n21 = (this.getChild("n21"));
  11512. this.special = (this.getChild("special"));
  11513. }
  11514. }
  11515. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  11516. class ui_Component79 extends fgui.GComponent {
  11517. static createInstance() {
  11518. return (fgui.UIPackage.createObject("game", "Component79"));
  11519. }
  11520. onConstruct() {
  11521. this.c1 = this.getController("c1");
  11522. this.n7 = (this.getChild("n7"));
  11523. this.n8 = (this.getChild("n8"));
  11524. this.n9 = (this.getChild("n9"));
  11525. this.n10 = (this.getChild("n10"));
  11526. this.n11 = (this.getChild("n11"));
  11527. this.n12 = (this.getChild("n12"));
  11528. }
  11529. }
  11530. ui_Component79.URL = "ui://isxx5ak7avag477";
  11531. class ui_Component80 extends fgui.GComponent {
  11532. static createInstance() {
  11533. return (fgui.UIPackage.createObject("game", "Component80"));
  11534. }
  11535. onConstruct() {
  11536. this.n0 = (this.getChild("n0"));
  11537. this.n1 = (this.getChild("n1"));
  11538. this.myList = (this.getChild("myList"));
  11539. this.t0 = this.getTransition("t0");
  11540. }
  11541. }
  11542. ui_Component80.URL = "ui://isxx5ak7avag47b";
  11543. class ui_SignNormal extends fgui.GComponent {
  11544. static createInstance() {
  11545. return (fgui.UIPackage.createObject("game", "SignNormal"));
  11546. }
  11547. onConstruct() {
  11548. this.c1 = this.getController("c1");
  11549. this.n7 = (this.getChild("n7"));
  11550. this.n15 = (this.getChild("n15"));
  11551. this.titleTxt = (this.getChild("titleTxt"));
  11552. this.n8 = (this.getChild("n8"));
  11553. this.myIcon = (this.getChild("myIcon"));
  11554. this.numTxt = (this.getChild("numTxt"));
  11555. this.n12 = (this.getChild("n12"));
  11556. this.n13 = (this.getChild("n13"));
  11557. this.n17 = (this.getChild("n17"));
  11558. this.n14 = (this.getChild("n14"));
  11559. }
  11560. }
  11561. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  11562. class ui_screenNode extends fgui.GComponent {
  11563. static createInstance() {
  11564. return (fgui.UIPackage.createObject("game", "screenNode"));
  11565. }
  11566. onConstruct() {
  11567. this.n9 = (this.getChild("n9"));
  11568. this.screenImg = (this.getChild("screenImg"));
  11569. }
  11570. }
  11571. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  11572. class ui_GetAwrad_com1 extends fgui.GComponent {
  11573. static createInstance() {
  11574. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  11575. }
  11576. onConstruct() {
  11577. this.n38 = (this.getChild("n38"));
  11578. this.n39 = (this.getChild("n39"));
  11579. this.n40 = (this.getChild("n40"));
  11580. this.t0 = this.getTransition("t0");
  11581. this.t1 = this.getTransition("t1");
  11582. }
  11583. }
  11584. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  11585. class ui_GetAwrad_com2 extends fgui.GComponent {
  11586. static createInstance() {
  11587. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  11588. }
  11589. onConstruct() {
  11590. this.n39 = (this.getChild("n39"));
  11591. this.n40 = (this.getChild("n40"));
  11592. this.t0 = this.getTransition("t0");
  11593. }
  11594. }
  11595. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  11596. class ui_Component128 extends fgui.GComponent {
  11597. static createInstance() {
  11598. return (fgui.UIPackage.createObject("game", "Component128"));
  11599. }
  11600. onConstruct() {
  11601. this.n38 = (this.getChild("n38"));
  11602. this.n40 = (this.getChild("n40"));
  11603. }
  11604. }
  11605. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  11606. class ui_Component100_1 extends fgui.GComponent {
  11607. static createInstance() {
  11608. return (fgui.UIPackage.createObject("game", "Component100_1"));
  11609. }
  11610. onConstruct() {
  11611. this.myNode = (this.getChild("myNode"));
  11612. this.t0 = this.getTransition("t0");
  11613. }
  11614. }
  11615. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  11616. class ui_Component142 extends fgui.GComponent {
  11617. static createInstance() {
  11618. return (fgui.UIPackage.createObject("game", "Component142"));
  11619. }
  11620. onConstruct() {
  11621. this.n41 = (this.getChild("n41"));
  11622. this.n42 = (this.getChild("n42"));
  11623. }
  11624. }
  11625. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  11626. class ui_main_guang extends fgui.GComponent {
  11627. static createInstance() {
  11628. return (fgui.UIPackage.createObject("game", "main_guang"));
  11629. }
  11630. onConstruct() {
  11631. this.n1 = (this.getChild("n1"));
  11632. this.n2 = (this.getChild("n2"));
  11633. this.n3 = (this.getChild("n3"));
  11634. this.n4 = (this.getChild("n4"));
  11635. this.n5 = (this.getChild("n5"));
  11636. this.n6 = (this.getChild("n6"));
  11637. this.n8 = (this.getChild("n8"));
  11638. this.t0 = this.getTransition("t0");
  11639. }
  11640. }
  11641. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  11642. class ui_try_com1 extends fgui.GComponent {
  11643. static createInstance() {
  11644. return (fgui.UIPackage.createObject("game", "try_com1"));
  11645. }
  11646. onConstruct() {
  11647. this.c1 = this.getController("c1");
  11648. this.n0 = (this.getChild("n0"));
  11649. this.n2 = (this.getChild("n2"));
  11650. this.cancelBtn = (this.getChild("cancelBtn"));
  11651. this.videoBtn = (this.getChild("videoBtn"));
  11652. this.n9 = (this.getChild("n9"));
  11653. this.n24 = (this.getChild("n24"));
  11654. this.titleTxt = (this.getChild("titleTxt"));
  11655. this.n32 = (this.getChild("n32"));
  11656. this.n29 = (this.getChild("n29"));
  11657. this.n36 = (this.getChild("n36"));
  11658. this.txtTime = (this.getChild("txtTime"));
  11659. this.t0 = this.getTransition("t0");
  11660. }
  11661. }
  11662. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  11663. class ui_try_com2 extends fgui.GComponent {
  11664. static createInstance() {
  11665. return (fgui.UIPackage.createObject("game", "try_com2"));
  11666. }
  11667. onConstruct() {
  11668. this.skillicon = (this.getChild("skillicon"));
  11669. this.n35 = (this.getChild("n35"));
  11670. this.n31 = (this.getChild("n31"));
  11671. this.n32 = (this.getChild("n32"));
  11672. this.n33 = (this.getChild("n33"));
  11673. this.n34 = (this.getChild("n34"));
  11674. }
  11675. }
  11676. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  11677. class ui_try_com3 extends fgui.GComponent {
  11678. static createInstance() {
  11679. return (fgui.UIPackage.createObject("game", "try_com3"));
  11680. }
  11681. onConstruct() {
  11682. this.n33 = (this.getChild("n33"));
  11683. this.n34 = (this.getChild("n34"));
  11684. this.n35 = (this.getChild("n35"));
  11685. this.t0 = this.getTransition("t0");
  11686. }
  11687. }
  11688. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  11689. class ui_huihe1 extends fgui.GComponent {
  11690. static createInstance() {
  11691. return (fgui.UIPackage.createObject("game", "huihe1"));
  11692. }
  11693. onConstruct() {
  11694. this.n0 = (this.getChild("n0"));
  11695. this.n1 = (this.getChild("n1"));
  11696. this.t0 = this.getTransition("t0");
  11697. }
  11698. }
  11699. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  11700. class ui_huihe2 extends fgui.GComponent {
  11701. static createInstance() {
  11702. return (fgui.UIPackage.createObject("game", "huihe2"));
  11703. }
  11704. onConstruct() {
  11705. this.n0 = (this.getChild("n0"));
  11706. this.n1 = (this.getChild("n1"));
  11707. this.t0 = this.getTransition("t0");
  11708. }
  11709. }
  11710. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  11711. class ui_Component143 extends fgui.GComponent {
  11712. static createInstance() {
  11713. return (fgui.UIPackage.createObject("game", "Component143"));
  11714. }
  11715. onConstruct() {
  11716. this.n3 = (this.getChild("n3"));
  11717. this.n4 = (this.getChild("n4"));
  11718. this.n5 = (this.getChild("n5"));
  11719. this.n6 = (this.getChild("n6"));
  11720. this.n7 = (this.getChild("n7"));
  11721. this.n8 = (this.getChild("n8"));
  11722. this.n9 = (this.getChild("n9"));
  11723. this.n10 = (this.getChild("n10"));
  11724. this.t0 = this.getTransition("t0");
  11725. }
  11726. }
  11727. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  11728. class ui_dh_jingbi2 extends fgui.GComponent {
  11729. static createInstance() {
  11730. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  11731. }
  11732. onConstruct() {
  11733. this.n0 = (this.getChild("n0"));
  11734. this.n1 = (this.getChild("n1"));
  11735. this.n2 = (this.getChild("n2"));
  11736. this.n3 = (this.getChild("n3"));
  11737. this.n4 = (this.getChild("n4"));
  11738. this.n5 = (this.getChild("n5"));
  11739. this.n6 = (this.getChild("n6"));
  11740. this.n8 = (this.getChild("n8"));
  11741. this.n10 = (this.getChild("n10"));
  11742. this.t0 = this.getTransition("t0");
  11743. }
  11744. }
  11745. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  11746. class ui_dh_jingbi2_1 extends fgui.GComponent {
  11747. static createInstance() {
  11748. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  11749. }
  11750. onConstruct() {
  11751. this.n1 = (this.getChild("n1"));
  11752. this.n4 = (this.getChild("n4"));
  11753. this.t0 = this.getTransition("t0");
  11754. }
  11755. }
  11756. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  11757. class ui_dh_jingbi3 extends fgui.GComponent {
  11758. static createInstance() {
  11759. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  11760. }
  11761. onConstruct() {
  11762. this.n0 = (this.getChild("n0"));
  11763. this.n1 = (this.getChild("n1"));
  11764. this.n2 = (this.getChild("n2"));
  11765. this.n3 = (this.getChild("n3"));
  11766. this.n4 = (this.getChild("n4"));
  11767. this.n5 = (this.getChild("n5"));
  11768. this.n6 = (this.getChild("n6"));
  11769. this.n8 = (this.getChild("n8"));
  11770. this.n10 = (this.getChild("n10"));
  11771. this.t0 = this.getTransition("t0");
  11772. }
  11773. }
  11774. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  11775. class ui_dh_jingbi3_1 extends fgui.GComponent {
  11776. static createInstance() {
  11777. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  11778. }
  11779. onConstruct() {
  11780. this.n3 = (this.getChild("n3"));
  11781. this.n1 = (this.getChild("n1"));
  11782. this.t0 = this.getTransition("t0");
  11783. }
  11784. }
  11785. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  11786. class ui_hb_jinbi1 extends fgui.GButton {
  11787. static createInstance() {
  11788. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  11789. }
  11790. onConstruct() {
  11791. this.n20 = (this.getChild("n20"));
  11792. this.n25 = (this.getChild("n25"));
  11793. this.coinTxt = (this.getChild("coinTxt"));
  11794. this.n28 = (this.getChild("n28"));
  11795. this.n32 = (this.getChild("n32"));
  11796. this.n38 = (this.getChild("n38"));
  11797. this.n45 = (this.getChild("n45"));
  11798. this.getTips = (this.getChild("getTips"));
  11799. this.n39 = (this.getChild("n39"));
  11800. this.diamondTxt = (this.getChild("diamondTxt"));
  11801. this.n41 = (this.getChild("n41"));
  11802. this.n42 = (this.getChild("n42"));
  11803. this.n46 = (this.getChild("n46"));
  11804. this.n47 = (this.getChild("n47"));
  11805. this.n48 = (this.getChild("n48"));
  11806. this.t0 = this.getTransition("t0");
  11807. }
  11808. }
  11809. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  11810. class ui_hb_jinbi2 extends fgui.GButton {
  11811. static createInstance() {
  11812. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  11813. }
  11814. onConstruct() {
  11815. this.n20 = (this.getChild("n20"));
  11816. this.n25 = (this.getChild("n25"));
  11817. this.coinTxt = (this.getChild("coinTxt"));
  11818. this.n28 = (this.getChild("n28"));
  11819. this.n32 = (this.getChild("n32"));
  11820. this.n38 = (this.getChild("n38"));
  11821. this.n39 = (this.getChild("n39"));
  11822. this.diamondTxt = (this.getChild("diamondTxt"));
  11823. this.n41 = (this.getChild("n41"));
  11824. this.n42 = (this.getChild("n42"));
  11825. this.n43 = (this.getChild("n43"));
  11826. this.n44 = (this.getChild("n44"));
  11827. this.n45 = (this.getChild("n45"));
  11828. this.t0 = this.getTransition("t0");
  11829. }
  11830. }
  11831. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  11832. class ui_hb_jinbi3 extends fgui.GButton {
  11833. static createInstance() {
  11834. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  11835. }
  11836. onConstruct() {
  11837. this.n20 = (this.getChild("n20"));
  11838. this.n25 = (this.getChild("n25"));
  11839. this.coinTxt = (this.getChild("coinTxt"));
  11840. this.n28 = (this.getChild("n28"));
  11841. this.n32 = (this.getChild("n32"));
  11842. this.n38 = (this.getChild("n38"));
  11843. this.n39 = (this.getChild("n39"));
  11844. this.diamondTxt = (this.getChild("diamondTxt"));
  11845. this.n41 = (this.getChild("n41"));
  11846. this.n42 = (this.getChild("n42"));
  11847. this.n43 = (this.getChild("n43"));
  11848. this.n44 = (this.getChild("n44"));
  11849. this.n45 = (this.getChild("n45"));
  11850. this.t0 = this.getTransition("t0");
  11851. }
  11852. }
  11853. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  11854. class ui_Component104 extends fgui.GComponent {
  11855. static createInstance() {
  11856. return (fgui.UIPackage.createObject("game", "Component104"));
  11857. }
  11858. onConstruct() {
  11859. this.c1 = this.getController("c1");
  11860. this.n12 = (this.getChild("n12"));
  11861. this.coinBtn = (this.getChild("coinBtn"));
  11862. this.diamondBtn = (this.getChild("diamondBtn"));
  11863. this.node3 = (this.getChild("node3"));
  11864. this.node4 = (this.getChild("node4"));
  11865. this.node5 = (this.getChild("node5"));
  11866. this.node1 = (this.getChild("node1"));
  11867. this.node2 = (this.getChild("node2"));
  11868. this.node6 = (this.getChild("node6"));
  11869. this.t0 = this.getTransition("t0");
  11870. }
  11871. }
  11872. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  11873. class ui_Component105 extends fgui.GButton {
  11874. static createInstance() {
  11875. return (fgui.UIPackage.createObject("game", "Component105"));
  11876. }
  11877. onConstruct() {
  11878. this.c1 = this.getController("c1");
  11879. this.n49 = (this.getChild("n49"));
  11880. this.n18 = (this.getChild("n18"));
  11881. this.n46 = (this.getChild("n46"));
  11882. this.n48 = (this.getChild("n48"));
  11883. }
  11884. }
  11885. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  11886. class ui_Component106 extends fgui.GButton {
  11887. static createInstance() {
  11888. return (fgui.UIPackage.createObject("game", "Component106"));
  11889. }
  11890. onConstruct() {
  11891. this.c1 = this.getController("c1");
  11892. this.n49 = (this.getChild("n49"));
  11893. this.n18 = (this.getChild("n18"));
  11894. this.n46 = (this.getChild("n46"));
  11895. this.n48 = (this.getChild("n48"));
  11896. }
  11897. }
  11898. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  11899. class ui_hb_zs1 extends fgui.GButton {
  11900. static createInstance() {
  11901. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  11902. }
  11903. onConstruct() {
  11904. this.c1 = this.getController("c1");
  11905. this.n20 = (this.getChild("n20"));
  11906. this.n21 = (this.getChild("n21"));
  11907. this.n26 = (this.getChild("n26"));
  11908. this.n27 = (this.getChild("n27"));
  11909. this.shareTxt = (this.getChild("shareTxt"));
  11910. this.n32 = (this.getChild("n32"));
  11911. this.n38 = (this.getChild("n38"));
  11912. this.n39 = (this.getChild("n39"));
  11913. this.n44 = (this.getChild("n44"));
  11914. this.diamondTxt = (this.getChild("diamondTxt"));
  11915. this.n41 = (this.getChild("n41"));
  11916. this.n45 = (this.getChild("n45"));
  11917. this.n47 = (this.getChild("n47"));
  11918. this.n48 = (this.getChild("n48"));
  11919. this.randTxt = (this.getChild("randTxt"));
  11920. this.n50 = (this.getChild("n50"));
  11921. this.t0 = this.getTransition("t0");
  11922. }
  11923. }
  11924. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  11925. class ui_dh_zs1 extends fgui.GComponent {
  11926. static createInstance() {
  11927. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  11928. }
  11929. onConstruct() {
  11930. this.n10 = (this.getChild("n10"));
  11931. this.n9 = (this.getChild("n9"));
  11932. this.n1 = (this.getChild("n1"));
  11933. this.n2 = (this.getChild("n2"));
  11934. this.n3 = (this.getChild("n3"));
  11935. this.n4 = (this.getChild("n4"));
  11936. this.n5 = (this.getChild("n5"));
  11937. this.n6 = (this.getChild("n6"));
  11938. this.n8 = (this.getChild("n8"));
  11939. this.n11 = (this.getChild("n11"));
  11940. this.t0 = this.getTransition("t0");
  11941. }
  11942. }
  11943. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  11944. class ui_dh_zs1_1 extends fgui.GComponent {
  11945. static createInstance() {
  11946. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  11947. }
  11948. onConstruct() {
  11949. this.n3 = (this.getChild("n3"));
  11950. this.n1 = (this.getChild("n1"));
  11951. this.t0 = this.getTransition("t0");
  11952. }
  11953. }
  11954. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  11955. class ui_hb_zs2 extends fgui.GButton {
  11956. static createInstance() {
  11957. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  11958. }
  11959. onConstruct() {
  11960. this.n20 = (this.getChild("n20"));
  11961. this.n21 = (this.getChild("n21"));
  11962. this.n26 = (this.getChild("n26"));
  11963. this.n27 = (this.getChild("n27"));
  11964. this.n32 = (this.getChild("n32"));
  11965. this.n38 = (this.getChild("n38"));
  11966. this.n39 = (this.getChild("n39"));
  11967. this.n44 = (this.getChild("n44"));
  11968. this.diamondTxt = (this.getChild("diamondTxt"));
  11969. this.n41 = (this.getChild("n41"));
  11970. this.n45 = (this.getChild("n45"));
  11971. this.t0 = this.getTransition("t0");
  11972. }
  11973. }
  11974. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  11975. class ui_hb_zs3 extends fgui.GButton {
  11976. static createInstance() {
  11977. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  11978. }
  11979. onConstruct() {
  11980. this.n20 = (this.getChild("n20"));
  11981. this.n21 = (this.getChild("n21"));
  11982. this.n26 = (this.getChild("n26"));
  11983. this.n27 = (this.getChild("n27"));
  11984. this.n32 = (this.getChild("n32"));
  11985. this.n38 = (this.getChild("n38"));
  11986. this.n47 = (this.getChild("n47"));
  11987. this.t0 = this.getTransition("t0");
  11988. }
  11989. }
  11990. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  11991. class ui_dh_zs2 extends fgui.GComponent {
  11992. static createInstance() {
  11993. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  11994. }
  11995. onConstruct() {
  11996. this.n10 = (this.getChild("n10"));
  11997. this.n9 = (this.getChild("n9"));
  11998. this.n1 = (this.getChild("n1"));
  11999. this.n2 = (this.getChild("n2"));
  12000. this.n3 = (this.getChild("n3"));
  12001. this.n4 = (this.getChild("n4"));
  12002. this.n5 = (this.getChild("n5"));
  12003. this.n6 = (this.getChild("n6"));
  12004. this.n8 = (this.getChild("n8"));
  12005. this.n11 = (this.getChild("n11"));
  12006. this.t0 = this.getTransition("t0");
  12007. }
  12008. }
  12009. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  12010. class ui_dh_zs2_1 extends fgui.GComponent {
  12011. static createInstance() {
  12012. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  12013. }
  12014. onConstruct() {
  12015. this.n3 = (this.getChild("n3"));
  12016. this.n1 = (this.getChild("n1"));
  12017. this.t0 = this.getTransition("t0");
  12018. }
  12019. }
  12020. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  12021. class ui_dh_zs3 extends fgui.GComponent {
  12022. static createInstance() {
  12023. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  12024. }
  12025. onConstruct() {
  12026. this.n10 = (this.getChild("n10"));
  12027. this.n9 = (this.getChild("n9"));
  12028. this.n1 = (this.getChild("n1"));
  12029. this.n2 = (this.getChild("n2"));
  12030. this.n3 = (this.getChild("n3"));
  12031. this.n4 = (this.getChild("n4"));
  12032. this.n5 = (this.getChild("n5"));
  12033. this.n6 = (this.getChild("n6"));
  12034. this.n8 = (this.getChild("n8"));
  12035. this.n11 = (this.getChild("n11"));
  12036. this.t0 = this.getTransition("t0");
  12037. }
  12038. }
  12039. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  12040. class ui_dh_zs3_1 extends fgui.GComponent {
  12041. static createInstance() {
  12042. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  12043. }
  12044. onConstruct() {
  12045. this.n3 = (this.getChild("n3"));
  12046. this.n1 = (this.getChild("n1"));
  12047. this.t0 = this.getTransition("t0");
  12048. }
  12049. }
  12050. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  12051. class ui_Component107 extends fgui.GComponent {
  12052. static createInstance() {
  12053. return (fgui.UIPackage.createObject("game", "Component107"));
  12054. }
  12055. onConstruct() {
  12056. this.n18 = (this.getChild("n18"));
  12057. this.n19 = (this.getChild("n19"));
  12058. this.n20 = (this.getChild("n20"));
  12059. this.n21 = (this.getChild("n21"));
  12060. this.n22 = (this.getChild("n22"));
  12061. this.levelTxt = (this.getChild("levelTxt"));
  12062. this.t0 = this.getTransition("t0");
  12063. }
  12064. }
  12065. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  12066. class ui_box_com1 extends fgui.GComponent {
  12067. static createInstance() {
  12068. return (fgui.UIPackage.createObject("game", "box_com1"));
  12069. }
  12070. onConstruct() {
  12071. this.n14 = (this.getChild("n14"));
  12072. this.n6 = (this.getChild("n6"));
  12073. this.t0 = this.getTransition("t0");
  12074. }
  12075. }
  12076. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  12077. class ui_box_com2 extends fgui.GProgressBar {
  12078. static createInstance() {
  12079. return (fgui.UIPackage.createObject("game", "box_com2"));
  12080. }
  12081. onConstruct() {
  12082. this.bg0 = (this.getChild("bg0"));
  12083. this.bg = (this.getChild("bg"));
  12084. this.bar = (this.getChild("bar"));
  12085. this.n7 = (this.getChild("n7"));
  12086. this.n8 = (this.getChild("n8"));
  12087. this.n10 = (this.getChild("n10"));
  12088. this.n11 = (this.getChild("n11"));
  12089. this.n12 = (this.getChild("n12"));
  12090. }
  12091. }
  12092. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  12093. class ui_box_com4 extends fgui.GComponent {
  12094. static createInstance() {
  12095. return (fgui.UIPackage.createObject("game", "box_com4"));
  12096. }
  12097. onConstruct() {
  12098. this.n8 = (this.getChild("n8"));
  12099. this.t0 = this.getTransition("t0");
  12100. }
  12101. }
  12102. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  12103. class ui_box_com3 extends fgui.GComponent {
  12104. static createInstance() {
  12105. return (fgui.UIPackage.createObject("game", "box_com3"));
  12106. }
  12107. onConstruct() {
  12108. this.n2 = (this.getChild("n2"));
  12109. this.n3 = (this.getChild("n3"));
  12110. this.n4 = (this.getChild("n4"));
  12111. this.n5 = (this.getChild("n5"));
  12112. this.t0 = this.getTransition("t0");
  12113. this.t1 = this.getTransition("t1");
  12114. }
  12115. }
  12116. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  12117. class ui_Component97 extends fgui.GComponent {
  12118. static createInstance() {
  12119. return (fgui.UIPackage.createObject("game", "Component97"));
  12120. }
  12121. onConstruct() {
  12122. this.c1 = this.getController("c1");
  12123. this.n46 = (this.getChild("n46"));
  12124. this.diamondNode = (this.getChild("diamondNode"));
  12125. this.coinNode = (this.getChild("coinNode"));
  12126. this.t0 = this.getTransition("t0");
  12127. }
  12128. }
  12129. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  12130. class ui_Component98 extends fgui.GButton {
  12131. static createInstance() {
  12132. return (fgui.UIPackage.createObject("game", "Component98"));
  12133. }
  12134. onConstruct() {
  12135. this.n8 = (this.getChild("n8"));
  12136. this.n40 = (this.getChild("n40"));
  12137. }
  12138. }
  12139. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  12140. class ui_Component28_11 extends fgui.GButton {
  12141. static createInstance() {
  12142. return (fgui.UIPackage.createObject("game", "Component28_11"));
  12143. }
  12144. onConstruct() {
  12145. this.c1 = this.getController("c1");
  12146. this.n12 = (this.getChild("n12"));
  12147. this.n17 = (this.getChild("n17"));
  12148. this.n13 = (this.getChild("n13"));
  12149. this.diamondTxt = (this.getChild("diamondTxt"));
  12150. this.n15 = (this.getChild("n15"));
  12151. this.n16 = (this.getChild("n16"));
  12152. }
  12153. }
  12154. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  12155. class ui_Component58_11 extends fgui.GComponent {
  12156. static createInstance() {
  12157. return (fgui.UIPackage.createObject("game", "Component58_11"));
  12158. }
  12159. onConstruct() {
  12160. this.n23 = (this.getChild("n23"));
  12161. this.n41 = (this.getChild("n41"));
  12162. this.myList = (this.getChild("myList"));
  12163. this.n45 = (this.getChild("n45"));
  12164. this.n44 = (this.getChild("n44"));
  12165. this.t0 = this.getTransition("t0");
  12166. }
  12167. }
  12168. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  12169. class ui_Component100 extends fgui.GComponent {
  12170. static createInstance() {
  12171. return (fgui.UIPackage.createObject("game", "Component100"));
  12172. }
  12173. onConstruct() {
  12174. this.c1 = this.getController("c1");
  12175. this.n75 = (this.getChild("n75"));
  12176. this.n76 = (this.getChild("n76"));
  12177. this.n80 = (this.getChild("n80"));
  12178. this.txt = (this.getChild("txt"));
  12179. this.spineRoot = (this.getChild("spineRoot"));
  12180. }
  12181. }
  12182. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  12183. class ui_Component101 extends fgui.GComponent {
  12184. static createInstance() {
  12185. return (fgui.UIPackage.createObject("game", "Component101"));
  12186. }
  12187. onConstruct() {
  12188. this.c1 = this.getController("c1");
  12189. this.n36 = (this.getChild("n36"));
  12190. this.n35 = (this.getChild("n35"));
  12191. this.n33 = (this.getChild("n33"));
  12192. this.n34 = (this.getChild("n34"));
  12193. }
  12194. }
  12195. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  12196. class ui_Component53 extends fgui.GComponent {
  12197. static createInstance() {
  12198. return (fgui.UIPackage.createObject("game", "Component53"));
  12199. }
  12200. onConstruct() {
  12201. this.n0 = (this.getChild("n0"));
  12202. this.n1 = (this.getChild("n1"));
  12203. this.n2 = (this.getChild("n2"));
  12204. this.n3 = (this.getChild("n3"));
  12205. this.n4 = (this.getChild("n4"));
  12206. this.n5 = (this.getChild("n5"));
  12207. this.n6 = (this.getChild("n6"));
  12208. this.n7 = (this.getChild("n7"));
  12209. this.n8 = (this.getChild("n8"));
  12210. this.n9 = (this.getChild("n9"));
  12211. this.n10 = (this.getChild("n10"));
  12212. this.n11 = (this.getChild("n11"));
  12213. this.n12 = (this.getChild("n12"));
  12214. this.n13 = (this.getChild("n13"));
  12215. this.n14 = (this.getChild("n14"));
  12216. this.n15 = (this.getChild("n15"));
  12217. this.n16 = (this.getChild("n16"));
  12218. this.n19 = (this.getChild("n19"));
  12219. this.n20 = (this.getChild("n20"));
  12220. this.n21 = (this.getChild("n21"));
  12221. this.n22 = (this.getChild("n22"));
  12222. this.n23 = (this.getChild("n23"));
  12223. this.n24 = (this.getChild("n24"));
  12224. this.n25 = (this.getChild("n25"));
  12225. this.n26 = (this.getChild("n26"));
  12226. this.n27 = (this.getChild("n27"));
  12227. this.n28 = (this.getChild("n28"));
  12228. this.n29 = (this.getChild("n29"));
  12229. this.n30 = (this.getChild("n30"));
  12230. this.n31 = (this.getChild("n31"));
  12231. this.n32 = (this.getChild("n32"));
  12232. this.n33 = (this.getChild("n33"));
  12233. this.n34 = (this.getChild("n34"));
  12234. this.n35 = (this.getChild("n35"));
  12235. this.t0 = this.getTransition("t0");
  12236. }
  12237. }
  12238. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  12239. class ui_Component58 extends fgui.GComponent {
  12240. static createInstance() {
  12241. return (fgui.UIPackage.createObject("game", "Component58"));
  12242. }
  12243. onConstruct() {
  12244. this.n23 = (this.getChild("n23"));
  12245. this.n41 = (this.getChild("n41"));
  12246. this.n8 = (this.getChild("n8"));
  12247. this.skillList = (this.getChild("skillList"));
  12248. this.t0 = this.getTransition("t0");
  12249. }
  12250. }
  12251. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  12252. class ui_Component59 extends fgui.GComponent {
  12253. static createInstance() {
  12254. return (fgui.UIPackage.createObject("game", "Component59"));
  12255. }
  12256. onConstruct() {
  12257. this.n3 = (this.getChild("n3"));
  12258. this.msgTxt = (this.getChild("msgTxt"));
  12259. this.t0 = this.getTransition("t0");
  12260. }
  12261. }
  12262. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  12263. class ui_RulerNode extends fgui.GComponent {
  12264. static createInstance() {
  12265. return (fgui.UIPackage.createObject("game", "RulerNode"));
  12266. }
  12267. onConstruct() {
  12268. this.n6 = (this.getChild("n6"));
  12269. this.n4 = (this.getChild("n4"));
  12270. this.img1 = (this.getChild("img1"));
  12271. this.img2 = (this.getChild("img2"));
  12272. }
  12273. }
  12274. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  12275. class ui_Component108 extends fgui.GComponent {
  12276. static createInstance() {
  12277. return (fgui.UIPackage.createObject("game", "Component108"));
  12278. }
  12279. onConstruct() {
  12280. this.n19 = (this.getChild("n19"));
  12281. this.t0 = this.getTransition("t0");
  12282. }
  12283. }
  12284. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  12285. class ui_Component63 extends fgui.GComponent {
  12286. static createInstance() {
  12287. return (fgui.UIPackage.createObject("game", "Component63"));
  12288. }
  12289. onConstruct() {
  12290. this.n66 = (this.getChild("n66"));
  12291. this.n56 = (this.getChild("n56"));
  12292. this.n63 = (this.getChild("n63"));
  12293. this.n65 = (this.getChild("n65"));
  12294. this.t0 = this.getTransition("t0");
  12295. }
  12296. }
  12297. ui_Component63.URL = "ui://isxx5ak7h657452";
  12298. class ui_topNode extends fgui.GComponent {
  12299. static createInstance() {
  12300. return (fgui.UIPackage.createObject("game", "topNode"));
  12301. }
  12302. onConstruct() {
  12303. this.selfProgress = (this.getChild("selfProgress"));
  12304. this.aiProgress = (this.getChild("aiProgress"));
  12305. this.selfKuang = (this.getChild("selfKuang"));
  12306. this.aiKuang = (this.getChild("aiKuang"));
  12307. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  12308. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  12309. this.n33 = (this.getChild("n33"));
  12310. this.n34 = (this.getChild("n34"));
  12311. this.selfNameTxt = (this.getChild("selfNameTxt"));
  12312. this.aiNameTxt = (this.getChild("aiNameTxt"));
  12313. this.selfBallList = (this.getChild("selfBallList"));
  12314. this.aiBallList = (this.getChild("aiBallList"));
  12315. this.middleNode = (this.getChild("middleNode"));
  12316. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  12317. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  12318. this.scoreNode = (this.getChild("scoreNode"));
  12319. this.selfTips = (this.getChild("selfTips"));
  12320. this.aiTips = (this.getChild("aiTips"));
  12321. }
  12322. }
  12323. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  12324. class ui_selfProgress extends fgui.GProgressBar {
  12325. static createInstance() {
  12326. return (fgui.UIPackage.createObject("game", "selfProgress"));
  12327. }
  12328. onConstruct() {
  12329. this.n3 = (this.getChild("n3"));
  12330. this.bar = (this.getChild("bar"));
  12331. }
  12332. }
  12333. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  12334. class ui_aiProgress extends fgui.GProgressBar {
  12335. static createInstance() {
  12336. return (fgui.UIPackage.createObject("game", "aiProgress"));
  12337. }
  12338. onConstruct() {
  12339. this.n3 = (this.getChild("n3"));
  12340. this.bar = (this.getChild("bar"));
  12341. }
  12342. }
  12343. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  12344. class ui_ballDisplay extends fgui.GComponent {
  12345. static createInstance() {
  12346. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  12347. }
  12348. onConstruct() {
  12349. this.myImg = (this.getChild("myImg"));
  12350. }
  12351. }
  12352. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  12353. class ui_moveNode extends fgui.GComponent {
  12354. static createInstance() {
  12355. return (fgui.UIPackage.createObject("game", "moveNode"));
  12356. }
  12357. onConstruct() {
  12358. this.n8 = (this.getChild("n8"));
  12359. this.finger = (this.getChild("finger"));
  12360. }
  12361. }
  12362. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  12363. class ui_cancelBtn extends fgui.GButton {
  12364. static createInstance() {
  12365. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  12366. }
  12367. onConstruct() {
  12368. this.c1 = this.getController("c1");
  12369. this.n0 = (this.getChild("n0"));
  12370. this.n1 = (this.getChild("n1"));
  12371. }
  12372. }
  12373. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  12374. class ui_shareBtn extends fgui.GButton {
  12375. static createInstance() {
  12376. return (fgui.UIPackage.createObject("game", "shareBtn"));
  12377. }
  12378. onConstruct() {
  12379. this.c1 = this.getController("c1");
  12380. this.n2 = (this.getChild("n2"));
  12381. this.n1 = (this.getChild("n1"));
  12382. this.n3 = (this.getChild("n3"));
  12383. this.n4 = (this.getChild("n4"));
  12384. this.n5 = (this.getChild("n5"));
  12385. this.n6 = (this.getChild("n6"));
  12386. }
  12387. }
  12388. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  12389. class ui_share2Btn extends fgui.GButton {
  12390. static createInstance() {
  12391. return (fgui.UIPackage.createObject("game", "share2Btn"));
  12392. }
  12393. onConstruct() {
  12394. this.n3 = (this.getChild("n3"));
  12395. }
  12396. }
  12397. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  12398. class ui_rodMethodNode extends fgui.GComponent {
  12399. static createInstance() {
  12400. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  12401. }
  12402. onConstruct() {
  12403. this.bg = (this.getChild("bg"));
  12404. this.dot = (this.getChild("dot"));
  12405. }
  12406. }
  12407. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  12408. class ui_sureBtn extends fgui.GButton {
  12409. static createInstance() {
  12410. return (fgui.UIPackage.createObject("game", "sureBtn"));
  12411. }
  12412. onConstruct() {
  12413. this.n2 = (this.getChild("n2"));
  12414. this.n1 = (this.getChild("n1"));
  12415. }
  12416. }
  12417. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  12418. class ui_Component18 extends fgui.GComponent {
  12419. static createInstance() {
  12420. return (fgui.UIPackage.createObject("game", "Component18"));
  12421. }
  12422. onConstruct() {
  12423. this.c1 = this.getController("c1");
  12424. this.nameTxt = (this.getChild("nameTxt"));
  12425. this.headImg = (this.getChild("headImg"));
  12426. this.n24 = (this.getChild("n24"));
  12427. this.skillImg = (this.getChild("skillImg"));
  12428. this.skillTxt = (this.getChild("skillTxt"));
  12429. }
  12430. }
  12431. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  12432. class ui_Component45 extends fgui.GComponent {
  12433. static createInstance() {
  12434. return (fgui.UIPackage.createObject("game", "Component45"));
  12435. }
  12436. onConstruct() {
  12437. this.c1 = this.getController("c1");
  12438. this.n40 = (this.getChild("n40"));
  12439. this.n41 = (this.getChild("n41"));
  12440. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  12441. this.n42 = (this.getChild("n42"));
  12442. this.awardTxt = (this.getChild("awardTxt"));
  12443. this.n44 = (this.getChild("n44"));
  12444. this.t0 = this.getTransition("t0");
  12445. }
  12446. }
  12447. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  12448. class ui_emotionDisplay extends fgui.GButton {
  12449. static createInstance() {
  12450. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  12451. }
  12452. onConstruct() {
  12453. this.myIcon = (this.getChild("myIcon"));
  12454. }
  12455. }
  12456. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  12457. class ui_Component49 extends fgui.GButton {
  12458. static createInstance() {
  12459. return (fgui.UIPackage.createObject("game", "Component49"));
  12460. }
  12461. onConstruct() {
  12462. this.n69 = (this.getChild("n69"));
  12463. this.n56 = (this.getChild("n56"));
  12464. }
  12465. }
  12466. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  12467. class ui_Component50 extends fgui.GButton {
  12468. static createInstance() {
  12469. return (fgui.UIPackage.createObject("game", "Component50"));
  12470. }
  12471. onConstruct() {
  12472. this.n54 = (this.getChild("n54"));
  12473. this.n65 = (this.getChild("n65"));
  12474. }
  12475. }
  12476. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  12477. class ui_Component51 extends fgui.GButton {
  12478. static createInstance() {
  12479. return (fgui.UIPackage.createObject("game", "Component51"));
  12480. }
  12481. onConstruct() {
  12482. this.c1 = this.getController("c1");
  12483. this.n51 = (this.getChild("n51"));
  12484. this.n54 = (this.getChild("n54"));
  12485. }
  12486. }
  12487. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  12488. class ui_Button5 extends fgui.GButton {
  12489. static createInstance() {
  12490. return (fgui.UIPackage.createObject("game", "Button5"));
  12491. }
  12492. onConstruct() {
  12493. this.c1 = this.getController("c1");
  12494. this.n0 = (this.getChild("n0"));
  12495. this.n2 = (this.getChild("n2"));
  12496. }
  12497. }
  12498. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  12499. class ui_Component124 extends fgui.GComponent {
  12500. static createInstance() {
  12501. return (fgui.UIPackage.createObject("game", "Component124"));
  12502. }
  12503. onConstruct() {
  12504. this.n22 = (this.getChild("n22"));
  12505. this.shareNode = (this.getChild("shareNode"));
  12506. }
  12507. }
  12508. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  12509. class ui_Component125 extends fgui.GComponent {
  12510. static createInstance() {
  12511. return (fgui.UIPackage.createObject("game", "Component125"));
  12512. }
  12513. onConstruct() {
  12514. this.n29 = (this.getChild("n29"));
  12515. this.coinTxt = (this.getChild("coinTxt"));
  12516. }
  12517. }
  12518. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  12519. class ui_Component52 extends fgui.GButton {
  12520. static createInstance() {
  12521. return (fgui.UIPackage.createObject("game", "Component52"));
  12522. }
  12523. onConstruct() {
  12524. this.n35 = (this.getChild("n35"));
  12525. this.n36 = (this.getChild("n36"));
  12526. }
  12527. }
  12528. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  12529. class ui_drawBtn extends fgui.GButton {
  12530. static createInstance() {
  12531. return (fgui.UIPackage.createObject("game", "drawBtn"));
  12532. }
  12533. onConstruct() {
  12534. this.c1 = this.getController("c1");
  12535. this.n2 = (this.getChild("n2"));
  12536. this.n1 = (this.getChild("n1"));
  12537. }
  12538. }
  12539. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  12540. class ui_Component43 extends fgui.GButton {
  12541. static createInstance() {
  12542. return (fgui.UIPackage.createObject("game", "Component43"));
  12543. }
  12544. onConstruct() {
  12545. this.n49 = (this.getChild("n49"));
  12546. }
  12547. }
  12548. ui_Component43.URL = "ui://isxx5ak7iveg434";
  12549. class ui_wordsDisplay extends fgui.GComponent {
  12550. static createInstance() {
  12551. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  12552. }
  12553. onConstruct() {
  12554. this.txt = (this.getChild("txt"));
  12555. this.n63 = (this.getChild("n63"));
  12556. }
  12557. }
  12558. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  12559. class ui_Component3 extends fgui.GComponent {
  12560. static createInstance() {
  12561. return (fgui.UIPackage.createObject("game", "Component3"));
  12562. }
  12563. onConstruct() {
  12564. this.n26 = (this.getChild("n26"));
  12565. this.n24 = (this.getChild("n24"));
  12566. this.nameTxt = (this.getChild("nameTxt"));
  12567. this.headRoot = (this.getChild("headRoot"));
  12568. }
  12569. }
  12570. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  12571. class ui_Component4 extends fgui.GComponent {
  12572. static createInstance() {
  12573. return (fgui.UIPackage.createObject("game", "Component4"));
  12574. }
  12575. onConstruct() {
  12576. this.headImg = (this.getChild("headImg"));
  12577. }
  12578. }
  12579. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  12580. class ui_Component7 extends fgui.GButton {
  12581. static createInstance() {
  12582. return (fgui.UIPackage.createObject("game", "Component7"));
  12583. }
  12584. onConstruct() {
  12585. this.n17 = (this.getChild("n17"));
  12586. }
  12587. }
  12588. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  12589. class ui_Component8 extends fgui.GButton {
  12590. static createInstance() {
  12591. return (fgui.UIPackage.createObject("game", "Component8"));
  12592. }
  12593. onConstruct() {
  12594. this.n19 = (this.getChild("n19"));
  12595. }
  12596. }
  12597. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  12598. class ui_Component9 extends fgui.GButton {
  12599. static createInstance() {
  12600. return (fgui.UIPackage.createObject("game", "Component9"));
  12601. }
  12602. onConstruct() {
  12603. this.n18 = (this.getChild("n18"));
  12604. }
  12605. }
  12606. ui_Component9.URL = "ui://isxx5ak7ixm43xs";
  12607. class ui_Component10 extends fgui.GButton {
  12608. static createInstance() {
  12609. return (fgui.UIPackage.createObject("game", "Component10"));
  12610. }
  12611. onConstruct() {
  12612. this.c1 = this.getController("c1");
  12613. this.n40 = (this.getChild("n40"));
  12614. }
  12615. }
  12616. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  12617. class ui_Component11 extends fgui.GButton {
  12618. static createInstance() {
  12619. return (fgui.UIPackage.createObject("game", "Component11"));
  12620. }
  12621. onConstruct() {
  12622. this.n34 = (this.getChild("n34"));
  12623. }
  12624. }
  12625. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  12626. class ui_Component12 extends fgui.GButton {
  12627. static createInstance() {
  12628. return (fgui.UIPackage.createObject("game", "Component12"));
  12629. }
  12630. onConstruct() {
  12631. this.n35 = (this.getChild("n35"));
  12632. }
  12633. }
  12634. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  12635. class ui_Component13 extends fgui.GButton {
  12636. static createInstance() {
  12637. return (fgui.UIPackage.createObject("game", "Component13"));
  12638. }
  12639. onConstruct() {
  12640. this.n27 = (this.getChild("n27"));
  12641. this.n36 = (this.getChild("n36"));
  12642. }
  12643. }
  12644. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  12645. class ui_dh_js_tuowei extends fgui.GComponent {
  12646. static createInstance() {
  12647. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  12648. }
  12649. onConstruct() {
  12650. this.n19 = (this.getChild("n19"));
  12651. this.n18 = (this.getChild("n18"));
  12652. this.n0 = (this.getChild("n0"));
  12653. this.n3 = (this.getChild("n3"));
  12654. this.n4 = (this.getChild("n4"));
  12655. this.n5 = (this.getChild("n5"));
  12656. this.n6 = (this.getChild("n6"));
  12657. this.n8 = (this.getChild("n8"));
  12658. this.n9 = (this.getChild("n9"));
  12659. this.n10 = (this.getChild("n10"));
  12660. this.n11 = (this.getChild("n11"));
  12661. this.n12 = (this.getChild("n12"));
  12662. this.n13 = (this.getChild("n13"));
  12663. this.n14 = (this.getChild("n14"));
  12664. this.n15 = (this.getChild("n15"));
  12665. this.n20 = (this.getChild("n20"));
  12666. this.t0 = this.getTransition("t0");
  12667. this.t1 = this.getTransition("t1");
  12668. }
  12669. }
  12670. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  12671. class ui_dh_js_tw_g extends fgui.GComponent {
  12672. static createInstance() {
  12673. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  12674. }
  12675. onConstruct() {
  12676. this.n0 = (this.getChild("n0"));
  12677. this.n1 = (this.getChild("n1"));
  12678. this.t0 = this.getTransition("t0");
  12679. }
  12680. }
  12681. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  12682. class ui_dh_js_xingxing extends fgui.GComponent {
  12683. static createInstance() {
  12684. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  12685. }
  12686. onConstruct() {
  12687. this.n1 = (this.getChild("n1"));
  12688. this.n2 = (this.getChild("n2"));
  12689. this.n3 = (this.getChild("n3"));
  12690. this.n4 = (this.getChild("n4"));
  12691. this.n0 = (this.getChild("n0"));
  12692. this.t2 = this.getTransition("t2");
  12693. this.t1 = this.getTransition("t1");
  12694. }
  12695. }
  12696. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  12697. class ui_dh_zy_jiazai extends fgui.GComponent {
  12698. static createInstance() {
  12699. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  12700. }
  12701. onConstruct() {
  12702. this.c1 = this.getController("c1");
  12703. this.n0 = (this.getChild("n0"));
  12704. this.n1 = (this.getChild("n1"));
  12705. this.n2 = (this.getChild("n2"));
  12706. this.n4 = (this.getChild("n4"));
  12707. this.n5 = (this.getChild("n5"));
  12708. this.n6 = (this.getChild("n6"));
  12709. this.n8 = (this.getChild("n8"));
  12710. this.n7 = (this.getChild("n7"));
  12711. this.t0 = this.getTransition("t0");
  12712. }
  12713. }
  12714. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  12715. class ui_dh_js_xingxing2 extends fgui.GComponent {
  12716. static createInstance() {
  12717. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  12718. }
  12719. onConstruct() {
  12720. this.c1 = this.getController("c1");
  12721. this.n3 = (this.getChild("n3"));
  12722. this.n5 = (this.getChild("n5"));
  12723. this.n4 = (this.getChild("n4"));
  12724. this.n0 = (this.getChild("n0"));
  12725. this.n1 = (this.getChild("n1"));
  12726. this.n2 = (this.getChild("n2"));
  12727. }
  12728. }
  12729. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  12730. class ui_dh_js_tuowei2 extends fgui.GComponent {
  12731. static createInstance() {
  12732. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  12733. }
  12734. onConstruct() {
  12735. this.n19 = (this.getChild("n19"));
  12736. this.n21 = (this.getChild("n21"));
  12737. this.n0 = (this.getChild("n0"));
  12738. this.n3 = (this.getChild("n3"));
  12739. this.n4 = (this.getChild("n4"));
  12740. this.n5 = (this.getChild("n5"));
  12741. this.n6 = (this.getChild("n6"));
  12742. this.n8 = (this.getChild("n8"));
  12743. this.n9 = (this.getChild("n9"));
  12744. this.n10 = (this.getChild("n10"));
  12745. this.n11 = (this.getChild("n11"));
  12746. this.n12 = (this.getChild("n12"));
  12747. this.n13 = (this.getChild("n13"));
  12748. this.n14 = (this.getChild("n14"));
  12749. this.n15 = (this.getChild("n15"));
  12750. this.n23 = (this.getChild("n23"));
  12751. this.t0 = this.getTransition("t0");
  12752. this.t1 = this.getTransition("t1");
  12753. }
  12754. }
  12755. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  12756. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  12757. static createInstance() {
  12758. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  12759. }
  12760. onConstruct() {
  12761. this.n1 = (this.getChild("n1"));
  12762. this.n2 = (this.getChild("n2"));
  12763. this.t0 = this.getTransition("t0");
  12764. }
  12765. }
  12766. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  12767. class ui_dh_js_shibai_1 extends fgui.GComponent {
  12768. static createInstance() {
  12769. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  12770. }
  12771. onConstruct() {
  12772. this.n4 = (this.getChild("n4"));
  12773. this.n2 = (this.getChild("n2"));
  12774. this.n3 = (this.getChild("n3"));
  12775. this.idle = this.getTransition("idle");
  12776. this.attack = this.getTransition("attack");
  12777. }
  12778. }
  12779. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  12780. class ui_special extends fgui.GComponent {
  12781. static createInstance() {
  12782. return (fgui.UIPackage.createObject("game", "special"));
  12783. }
  12784. onConstruct() {
  12785. this.n18 = (this.getChild("n18"));
  12786. this.n19 = (this.getChild("n19"));
  12787. this.n20 = (this.getChild("n20"));
  12788. this.n21 = (this.getChild("n21"));
  12789. this.n22 = (this.getChild("n22"));
  12790. this.levelTxt = (this.getChild("levelTxt"));
  12791. this.n24 = (this.getChild("n24"));
  12792. this.n25 = (this.getChild("n25"));
  12793. this.t0 = this.getTransition("t0");
  12794. }
  12795. }
  12796. ui_special.URL = "ui://isxx5ak7j979v4i6";
  12797. class ui_Component145 extends fgui.GComponent {
  12798. static createInstance() {
  12799. return (fgui.UIPackage.createObject("game", "Component145"));
  12800. }
  12801. onConstruct() {
  12802. this.guanyuNode = (this.getChild("guanyuNode"));
  12803. }
  12804. }
  12805. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  12806. class ui_longBtn extends fgui.GButton {
  12807. static createInstance() {
  12808. return (fgui.UIPackage.createObject("game", "longBtn"));
  12809. }
  12810. onConstruct() {
  12811. this.c1 = this.getController("c1");
  12812. this.n2 = (this.getChild("n2"));
  12813. this.n1 = (this.getChild("n1"));
  12814. this.n4 = (this.getChild("n4"));
  12815. }
  12816. }
  12817. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  12818. class ui_Component146 extends fgui.GComponent {
  12819. static createInstance() {
  12820. return (fgui.UIPackage.createObject("game", "Component146"));
  12821. }
  12822. onConstruct() {
  12823. this.n89 = (this.getChild("n89"));
  12824. this.n90 = (this.getChild("n90"));
  12825. this.guideBtn = (this.getChild("guideBtn"));
  12826. }
  12827. }
  12828. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  12829. class ui_Component146_11 extends fgui.GComponent {
  12830. static createInstance() {
  12831. return (fgui.UIPackage.createObject("game", "Component146_11"));
  12832. }
  12833. onConstruct() {
  12834. this.n89 = (this.getChild("n89"));
  12835. this.n90 = (this.getChild("n90"));
  12836. this.guideBtn = (this.getChild("guideBtn"));
  12837. }
  12838. }
  12839. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  12840. class ui_Component111_1 extends fgui.GComponent {
  12841. static createInstance() {
  12842. return (fgui.UIPackage.createObject("game", "Component111_1"));
  12843. }
  12844. onConstruct() {
  12845. this.n68 = (this.getChild("n68"));
  12846. this.myMask = (this.getChild("myMask"));
  12847. }
  12848. }
  12849. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  12850. class ui_Component64_1 extends fgui.GComponent {
  12851. static createInstance() {
  12852. return (fgui.UIPackage.createObject("game", "Component64_1"));
  12853. }
  12854. onConstruct() {
  12855. this.n57 = (this.getChild("n57"));
  12856. this.n54 = (this.getChild("n54"));
  12857. this.n55 = (this.getChild("n55"));
  12858. this.n56 = (this.getChild("n56"));
  12859. this.t1 = this.getTransition("t1");
  12860. }
  12861. }
  12862. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  12863. class ui_ModeSelection_com123 extends fgui.GComponent {
  12864. static createInstance() {
  12865. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  12866. }
  12867. onConstruct() {
  12868. this.type1 = (this.getChild("type1"));
  12869. this.type2 = (this.getChild("type2"));
  12870. this.type3 = (this.getChild("type3"));
  12871. this.n38 = (this.getChild("n38"));
  12872. this.t0 = this.getTransition("t0");
  12873. }
  12874. }
  12875. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  12876. class ui_Component132_2 extends fgui.GComponent {
  12877. static createInstance() {
  12878. return (fgui.UIPackage.createObject("game", "Component132_2"));
  12879. }
  12880. onConstruct() {
  12881. this.n25 = (this.getChild("n25"));
  12882. this.n26 = (this.getChild("n26"));
  12883. this.n27 = (this.getChild("n27"));
  12884. this.t0 = this.getTransition("t0");
  12885. }
  12886. }
  12887. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  12888. class ui_UIPower$1 extends fgui.GComponent {
  12889. static createInstance() {
  12890. return (fgui.UIPackage.createObject("game", "UIPower"));
  12891. }
  12892. onConstruct() {
  12893. this.n11 = (this.getChild("n11"));
  12894. this.myNode = (this.getChild("myNode"));
  12895. this.t0 = this.getTransition("t0");
  12896. }
  12897. }
  12898. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  12899. class ui_Component133 extends fgui.GComponent {
  12900. static createInstance() {
  12901. return (fgui.UIPackage.createObject("game", "Component133"));
  12902. }
  12903. onConstruct() {
  12904. this.n29 = (this.getChild("n29"));
  12905. this.n30 = (this.getChild("n30"));
  12906. }
  12907. }
  12908. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  12909. class ui_Component134 extends fgui.GComponent {
  12910. static createInstance() {
  12911. return (fgui.UIPackage.createObject("game", "Component134"));
  12912. }
  12913. onConstruct() {
  12914. this.n30 = (this.getChild("n30"));
  12915. this.n31 = (this.getChild("n31"));
  12916. this.t0 = this.getTransition("t0");
  12917. }
  12918. }
  12919. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  12920. class ui_Component135 extends fgui.GComponent {
  12921. static createInstance() {
  12922. return (fgui.UIPackage.createObject("game", "Component135"));
  12923. }
  12924. onConstruct() {
  12925. this.n30 = (this.getChild("n30"));
  12926. this.t0 = this.getTransition("t0");
  12927. }
  12928. }
  12929. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  12930. class ui_Component137 extends fgui.GComponent {
  12931. static createInstance() {
  12932. return (fgui.UIPackage.createObject("game", "Component137"));
  12933. }
  12934. onConstruct() {
  12935. this.n28 = (this.getChild("n28"));
  12936. this.n29 = (this.getChild("n29"));
  12937. this.n30 = (this.getChild("n30"));
  12938. this.n32 = (this.getChild("n32"));
  12939. }
  12940. }
  12941. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  12942. class ui_dh_zuanshi extends fgui.GButton {
  12943. static createInstance() {
  12944. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  12945. }
  12946. onConstruct() {
  12947. this.n1 = (this.getChild("n1"));
  12948. this.n2 = (this.getChild("n2"));
  12949. this.n0 = (this.getChild("n0"));
  12950. this.n3 = (this.getChild("n3"));
  12951. this.n4 = (this.getChild("n4"));
  12952. }
  12953. }
  12954. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  12955. class ui_Component138 extends fgui.GComponent {
  12956. static createInstance() {
  12957. return (fgui.UIPackage.createObject("game", "Component138"));
  12958. }
  12959. onConstruct() {
  12960. this.n1 = (this.getChild("n1"));
  12961. this.n2 = (this.getChild("n2"));
  12962. this.t0 = this.getTransition("t0");
  12963. }
  12964. }
  12965. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  12966. class ui_Component139 extends fgui.GComponent {
  12967. static createInstance() {
  12968. return (fgui.UIPackage.createObject("game", "Component139"));
  12969. }
  12970. onConstruct() {
  12971. this.n0 = (this.getChild("n0"));
  12972. this.t0 = this.getTransition("t0");
  12973. }
  12974. }
  12975. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  12976. class ui_Component140 extends fgui.GComponent {
  12977. static createInstance() {
  12978. return (fgui.UIPackage.createObject("game", "Component140"));
  12979. }
  12980. onConstruct() {
  12981. this.n2 = (this.getChild("n2"));
  12982. this.n3 = (this.getChild("n3"));
  12983. this.t0 = this.getTransition("t0");
  12984. }
  12985. }
  12986. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  12987. class ui_Component141 extends fgui.GComponent {
  12988. static createInstance() {
  12989. return (fgui.UIPackage.createObject("game", "Component141"));
  12990. }
  12991. onConstruct() {
  12992. this.n0 = (this.getChild("n0"));
  12993. this.t0 = this.getTransition("t0");
  12994. }
  12995. }
  12996. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  12997. class ui_powerNode extends fgui.GProgressBar {
  12998. static createInstance() {
  12999. return (fgui.UIPackage.createObject("game", "powerNode"));
  13000. }
  13001. onConstruct() {
  13002. this.n2 = (this.getChild("n2"));
  13003. this.bar_v = (this.getChild("bar_v"));
  13004. this.showImg = (this.getChild("showImg"));
  13005. this.n12 = (this.getChild("n12"));
  13006. }
  13007. }
  13008. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  13009. class ui_dh_jingbi1 extends fgui.GComponent {
  13010. static createInstance() {
  13011. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  13012. }
  13013. onConstruct() {
  13014. this.n0 = (this.getChild("n0"));
  13015. this.n1 = (this.getChild("n1"));
  13016. this.n2 = (this.getChild("n2"));
  13017. this.n3 = (this.getChild("n3"));
  13018. this.n4 = (this.getChild("n4"));
  13019. this.n5 = (this.getChild("n5"));
  13020. this.n6 = (this.getChild("n6"));
  13021. this.n8 = (this.getChild("n8"));
  13022. this.t0 = this.getTransition("t0");
  13023. }
  13024. }
  13025. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  13026. class ui_Component94 extends fgui.GButton {
  13027. static createInstance() {
  13028. return (fgui.UIPackage.createObject("game", "Component94"));
  13029. }
  13030. onConstruct() {
  13031. this.n77 = (this.getChild("n77"));
  13032. }
  13033. }
  13034. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  13035. class ui_Component95 extends fgui.GButton {
  13036. static createInstance() {
  13037. return (fgui.UIPackage.createObject("game", "Component95"));
  13038. }
  13039. onConstruct() {
  13040. this.n77 = (this.getChild("n77"));
  13041. }
  13042. }
  13043. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  13044. class ui_Component126 extends fgui.GComponent {
  13045. static createInstance() {
  13046. return (fgui.UIPackage.createObject("game", "Component126"));
  13047. }
  13048. onConstruct() {
  13049. this.c1 = this.getController("c1");
  13050. this.normalBtn = (this.getChild("normalBtn"));
  13051. this.tripleBtn = (this.getChild("tripleBtn"));
  13052. }
  13053. }
  13054. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  13055. class ui_Component60 extends fgui.GComponent {
  13056. static createInstance() {
  13057. return (fgui.UIPackage.createObject("game", "Component60"));
  13058. }
  13059. onConstruct() {
  13060. this.c1 = this.getController("c1");
  13061. this.n48 = (this.getChild("n48"));
  13062. this.womanTxt = (this.getChild("womanTxt"));
  13063. this.t0 = this.getTransition("t0");
  13064. }
  13065. }
  13066. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  13067. class ui_Component98_3 extends fgui.GButton {
  13068. static createInstance() {
  13069. return (fgui.UIPackage.createObject("game", "Component98_3"));
  13070. }
  13071. onConstruct() {
  13072. this.c1 = this.getController("c1");
  13073. this.n8 = (this.getChild("n8"));
  13074. this.n41 = (this.getChild("n41"));
  13075. this.n40 = (this.getChild("n40"));
  13076. }
  13077. }
  13078. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  13079. class ui_ModeSelection_com1 extends fgui.GButton {
  13080. static createInstance() {
  13081. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  13082. }
  13083. onConstruct() {
  13084. this.n34 = (this.getChild("n34"));
  13085. this.n36 = (this.getChild("n36"));
  13086. this.n22 = (this.getChild("n22"));
  13087. this.n20 = (this.getChild("n20"));
  13088. this.n23 = (this.getChild("n23"));
  13089. this.n24 = (this.getChild("n24"));
  13090. this.n26 = (this.getChild("n26"));
  13091. this.n33 = (this.getChild("n33"));
  13092. this.coinImg = (this.getChild("coinImg"));
  13093. this.need = (this.getChild("need"));
  13094. this.n35 = (this.getChild("n35"));
  13095. this.n29 = (this.getChild("n29"));
  13096. this.tipsTxt = (this.getChild("tipsTxt"));
  13097. this.n30 = (this.getChild("n30"));
  13098. this.peopleTxt = (this.getChild("peopleTxt"));
  13099. this.t0 = this.getTransition("t0");
  13100. }
  13101. }
  13102. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  13103. class ui_ModeSelection_com2 extends fgui.GButton {
  13104. static createInstance() {
  13105. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  13106. }
  13107. onConstruct() {
  13108. this.n36 = (this.getChild("n36"));
  13109. this.n34 = (this.getChild("n34"));
  13110. this.n22 = (this.getChild("n22"));
  13111. this.n20 = (this.getChild("n20"));
  13112. this.n23 = (this.getChild("n23"));
  13113. this.n24 = (this.getChild("n24"));
  13114. this.n26 = (this.getChild("n26"));
  13115. this.n33 = (this.getChild("n33"));
  13116. this.coinImg = (this.getChild("coinImg"));
  13117. this.need = (this.getChild("need"));
  13118. this.n35 = (this.getChild("n35"));
  13119. this.n29 = (this.getChild("n29"));
  13120. this.tipsTxt = (this.getChild("tipsTxt"));
  13121. this.n30 = (this.getChild("n30"));
  13122. this.peopleTxt = (this.getChild("peopleTxt"));
  13123. this.t0 = this.getTransition("t0");
  13124. }
  13125. }
  13126. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  13127. class ui_ModeSelection_com3 extends fgui.GButton {
  13128. static createInstance() {
  13129. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  13130. }
  13131. onConstruct() {
  13132. this.n34 = (this.getChild("n34"));
  13133. this.n36 = (this.getChild("n36"));
  13134. this.n22 = (this.getChild("n22"));
  13135. this.n20 = (this.getChild("n20"));
  13136. this.n23 = (this.getChild("n23"));
  13137. this.n24 = (this.getChild("n24"));
  13138. this.n26 = (this.getChild("n26"));
  13139. this.n33 = (this.getChild("n33"));
  13140. this.coinImg = (this.getChild("coinImg"));
  13141. this.need = (this.getChild("need"));
  13142. this.n35 = (this.getChild("n35"));
  13143. this.n29 = (this.getChild("n29"));
  13144. this.tipsTxt = (this.getChild("tipsTxt"));
  13145. this.n30 = (this.getChild("n30"));
  13146. this.peopleTxt = (this.getChild("peopleTxt"));
  13147. this.t0 = this.getTransition("t0");
  13148. }
  13149. }
  13150. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  13151. class ui_Invitation_com1 extends fgui.GComponent {
  13152. static createInstance() {
  13153. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  13154. }
  13155. onConstruct() {
  13156. this.n14 = (this.getChild("n14"));
  13157. this.n13 = (this.getChild("n13"));
  13158. this.n3 = (this.getChild("n3"));
  13159. this.n1 = (this.getChild("n1"));
  13160. this.n6 = (this.getChild("n6"));
  13161. this.n7 = (this.getChild("n7"));
  13162. this.enterBtn = (this.getChild("enterBtn"));
  13163. this.n11 = (this.getChild("n11"));
  13164. this.n12 = (this.getChild("n12"));
  13165. this.n15 = (this.getChild("n15"));
  13166. this.t0 = this.getTransition("t0");
  13167. this.t1 = this.getTransition("t1");
  13168. }
  13169. }
  13170. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  13171. class ui_Component87_1 extends fgui.GComponent {
  13172. static createInstance() {
  13173. return (fgui.UIPackage.createObject("game", "Component87_1"));
  13174. }
  13175. onConstruct() {
  13176. this.n74 = (this.getChild("n74"));
  13177. this.n73 = (this.getChild("n73"));
  13178. this.ballTxt = (this.getChild("ballTxt"));
  13179. this.n76 = (this.getChild("n76"));
  13180. this.helpLineBtn = (this.getChild("helpLineBtn"));
  13181. this.levelTxt = (this.getChild("levelTxt"));
  13182. this.n87 = (this.getChild("n87"));
  13183. this.n84 = (this.getChild("n84"));
  13184. this.hpTxt = (this.getChild("hpTxt"));
  13185. this.n89 = (this.getChild("n89"));
  13186. this.tipsTxt = (this.getChild("tipsTxt"));
  13187. }
  13188. }
  13189. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  13190. class ui_sqg1 extends fgui.GComponent {
  13191. static createInstance() {
  13192. return (fgui.UIPackage.createObject("game", "sqg1"));
  13193. }
  13194. onConstruct() {
  13195. this.n1 = (this.getChild("n1"));
  13196. this.n0 = (this.getChild("n0"));
  13197. }
  13198. }
  13199. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  13200. class ui_sqg2 extends fgui.GComponent {
  13201. static createInstance() {
  13202. return (fgui.UIPackage.createObject("game", "sqg2"));
  13203. }
  13204. onConstruct() {
  13205. this.n1 = (this.getChild("n1"));
  13206. this.n0 = (this.getChild("n0"));
  13207. }
  13208. }
  13209. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  13210. class ui_sqg3 extends fgui.GComponent {
  13211. static createInstance() {
  13212. return (fgui.UIPackage.createObject("game", "sqg3"));
  13213. }
  13214. onConstruct() {
  13215. this.n1 = (this.getChild("n1"));
  13216. this.n0 = (this.getChild("n0"));
  13217. }
  13218. }
  13219. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  13220. class ui_sqg4 extends fgui.GComponent {
  13221. static createInstance() {
  13222. return (fgui.UIPackage.createObject("game", "sqg4"));
  13223. }
  13224. onConstruct() {
  13225. this.n1 = (this.getChild("n1"));
  13226. this.n0 = (this.getChild("n0"));
  13227. }
  13228. }
  13229. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  13230. class ui_Component36 extends fgui.GButton {
  13231. static createInstance() {
  13232. return (fgui.UIPackage.createObject("game", "Component36"));
  13233. }
  13234. onConstruct() {
  13235. this.c1 = this.getController("c1");
  13236. this.n53 = (this.getChild("n53"));
  13237. this.n56 = (this.getChild("n56"));
  13238. }
  13239. }
  13240. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  13241. class ui_Component37 extends fgui.GButton {
  13242. static createInstance() {
  13243. return (fgui.UIPackage.createObject("game", "Component37"));
  13244. }
  13245. onConstruct() {
  13246. this.c1 = this.getController("c1");
  13247. this.n52 = (this.getChild("n52"));
  13248. this.n54 = (this.getChild("n54"));
  13249. }
  13250. }
  13251. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  13252. class ui_UISetting extends fgui.GComponent {
  13253. static createInstance() {
  13254. return (fgui.UIPackage.createObject("game", "UISetting"));
  13255. }
  13256. onConstruct() {
  13257. this.c1 = this.getController("c1");
  13258. this.n4 = (this.getChild("n4"));
  13259. this.soundBtn = (this.getChild("soundBtn"));
  13260. this.shakeBtn = (this.getChild("shakeBtn"));
  13261. this.clickNode = (this.getChild("clickNode"));
  13262. this.xyBtn = (this.getChild("xyBtn"));
  13263. }
  13264. }
  13265. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  13266. class ui_Component39 extends fgui.GComponent {
  13267. static createInstance() {
  13268. return (fgui.UIPackage.createObject("game", "Component39"));
  13269. }
  13270. onConstruct() {
  13271. this.n5 = (this.getChild("n5"));
  13272. this.n6 = (this.getChild("n6"));
  13273. this.n7 = (this.getChild("n7"));
  13274. this.t0 = this.getTransition("t0");
  13275. }
  13276. }
  13277. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  13278. class ui_Component40 extends fgui.GButton {
  13279. static createInstance() {
  13280. return (fgui.UIPackage.createObject("game", "Component40"));
  13281. }
  13282. onConstruct() {
  13283. this.n46 = (this.getChild("n46"));
  13284. this.n47 = (this.getChild("n47"));
  13285. }
  13286. }
  13287. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  13288. class ui_Component41 extends fgui.GComponent {
  13289. static createInstance() {
  13290. return (fgui.UIPackage.createObject("game", "Component41"));
  13291. }
  13292. onConstruct() {
  13293. this.c1 = this.getController("c1");
  13294. this.n0 = (this.getChild("n0"));
  13295. this.titleTxt = (this.getChild("titleTxt"));
  13296. this.n2 = (this.getChild("n2"));
  13297. this.msgTips = (this.getChild("msgTips"));
  13298. this.numTxt = (this.getChild("numTxt"));
  13299. this.n18 = (this.getChild("n18"));
  13300. this.cancelBtn = (this.getChild("cancelBtn"));
  13301. this.videoBtn = (this.getChild("videoBtn"));
  13302. this.n10 = (this.getChild("n10"));
  13303. }
  13304. }
  13305. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  13306. class ui_Component42 extends fgui.GComponent {
  13307. static createInstance() {
  13308. return (fgui.UIPackage.createObject("game", "Component42"));
  13309. }
  13310. onConstruct() {
  13311. this.c1 = this.getController("c1");
  13312. this.n1 = (this.getChild("n1"));
  13313. this.n2 = (this.getChild("n2"));
  13314. this.n3 = (this.getChild("n3"));
  13315. this.tipsTxt = (this.getChild("tipsTxt"));
  13316. this.cancelBtn = (this.getChild("cancelBtn"));
  13317. this.sureBtn = (this.getChild("sureBtn"));
  13318. this.n11 = (this.getChild("n11"));
  13319. this.n13 = (this.getChild("n13"));
  13320. this.n14 = (this.getChild("n14"));
  13321. this.womanTxt = (this.getChild("womanTxt"));
  13322. this.t0 = this.getTransition("t0");
  13323. }
  13324. }
  13325. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  13326. class ui_dh_js_shengli extends fgui.GComponent {
  13327. static createInstance() {
  13328. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  13329. }
  13330. onConstruct() {
  13331. this.n3 = (this.getChild("n3"));
  13332. this.n4 = (this.getChild("n4"));
  13333. this.n1 = (this.getChild("n1"));
  13334. this.n2 = (this.getChild("n2"));
  13335. this.n5 = (this.getChild("n5"));
  13336. this.n6 = (this.getChild("n6"));
  13337. this.n7 = (this.getChild("n7"));
  13338. this.n8 = (this.getChild("n8"));
  13339. this.attack = this.getTransition("attack");
  13340. this.idle = this.getTransition("idle");
  13341. }
  13342. }
  13343. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  13344. class ui_dh_js_shengli_g extends fgui.GComponent {
  13345. static createInstance() {
  13346. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  13347. }
  13348. onConstruct() {
  13349. this.n3 = (this.getChild("n3"));
  13350. this.n1 = (this.getChild("n1"));
  13351. this.t0 = this.getTransition("t0");
  13352. }
  13353. }
  13354. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  13355. class ui_dh_js_shibai extends fgui.GComponent {
  13356. static createInstance() {
  13357. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  13358. }
  13359. onConstruct() {
  13360. this.n0 = (this.getChild("n0"));
  13361. this.n1 = (this.getChild("n1"));
  13362. this.n2 = (this.getChild("n2"));
  13363. this.n3 = (this.getChild("n3"));
  13364. this.idle = this.getTransition("idle");
  13365. this.attack = this.getTransition("attack");
  13366. }
  13367. }
  13368. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  13369. class ui_dh_zy_ganfa extends fgui.GButton {
  13370. static createInstance() {
  13371. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  13372. }
  13373. onConstruct() {
  13374. this.n0 = (this.getChild("n0"));
  13375. }
  13376. }
  13377. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  13378. class ui_dh_zy_sc_guang extends fgui.GButton {
  13379. static createInstance() {
  13380. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  13381. }
  13382. onConstruct() {
  13383. this.n0 = (this.getChild("n0"));
  13384. this.n2 = (this.getChild("n2"));
  13385. }
  13386. }
  13387. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  13388. class ui_dh_zy_shangcheng extends fgui.GComponent {
  13389. static createInstance() {
  13390. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  13391. }
  13392. onConstruct() {
  13393. this.n0 = (this.getChild("n0"));
  13394. this.n3 = (this.getChild("n3"));
  13395. this.t0 = this.getTransition("t0");
  13396. }
  13397. }
  13398. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  13399. class ui_dh_zy_wanfa extends fgui.GButton {
  13400. static createInstance() {
  13401. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  13402. }
  13403. onConstruct() {
  13404. this.n0 = (this.getChild("n0"));
  13405. }
  13406. }
  13407. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  13408. class ui_Component53_1 extends fgui.GComponent {
  13409. static createInstance() {
  13410. return (fgui.UIPackage.createObject("game", "Component53_1"));
  13411. }
  13412. onConstruct() {
  13413. this.n0 = (this.getChild("n0"));
  13414. this.n1 = (this.getChild("n1"));
  13415. this.n2 = (this.getChild("n2"));
  13416. this.n3 = (this.getChild("n3"));
  13417. this.n4 = (this.getChild("n4"));
  13418. this.n5 = (this.getChild("n5"));
  13419. this.n6 = (this.getChild("n6"));
  13420. this.n7 = (this.getChild("n7"));
  13421. this.n8 = (this.getChild("n8"));
  13422. this.n9 = (this.getChild("n9"));
  13423. this.n10 = (this.getChild("n10"));
  13424. this.n11 = (this.getChild("n11"));
  13425. this.n12 = (this.getChild("n12"));
  13426. this.n13 = (this.getChild("n13"));
  13427. this.n14 = (this.getChild("n14"));
  13428. this.n15 = (this.getChild("n15"));
  13429. this.n16 = (this.getChild("n16"));
  13430. this.n19 = (this.getChild("n19"));
  13431. this.n20 = (this.getChild("n20"));
  13432. this.n21 = (this.getChild("n21"));
  13433. this.n22 = (this.getChild("n22"));
  13434. this.n23 = (this.getChild("n23"));
  13435. this.n24 = (this.getChild("n24"));
  13436. this.n25 = (this.getChild("n25"));
  13437. this.n26 = (this.getChild("n26"));
  13438. this.n27 = (this.getChild("n27"));
  13439. this.n28 = (this.getChild("n28"));
  13440. this.n29 = (this.getChild("n29"));
  13441. this.n30 = (this.getChild("n30"));
  13442. this.n31 = (this.getChild("n31"));
  13443. this.n32 = (this.getChild("n32"));
  13444. this.n33 = (this.getChild("n33"));
  13445. this.n34 = (this.getChild("n34"));
  13446. this.n35 = (this.getChild("n35"));
  13447. this.t0 = this.getTransition("t0");
  13448. }
  13449. }
  13450. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  13451. class ui_Component30 extends fgui.GComponent {
  13452. static createInstance() {
  13453. return (fgui.UIPackage.createObject("game", "Component30"));
  13454. }
  13455. onConstruct() {
  13456. this.c1 = this.getController("c1");
  13457. this.n46 = (this.getChild("n46"));
  13458. this.n47 = (this.getChild("n47"));
  13459. this.numTxt = (this.getChild("numTxt"));
  13460. this.n50 = (this.getChild("n50"));
  13461. this.n53 = (this.getChild("n53"));
  13462. this.n54 = (this.getChild("n54"));
  13463. this.n55 = (this.getChild("n55"));
  13464. this.n56 = (this.getChild("n56"));
  13465. }
  13466. }
  13467. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  13468. class ui_Component30_1 extends fgui.GComponent {
  13469. static createInstance() {
  13470. return (fgui.UIPackage.createObject("game", "Component30_1"));
  13471. }
  13472. onConstruct() {
  13473. this.c1 = this.getController("c1");
  13474. this.n46 = (this.getChild("n46"));
  13475. this.n47 = (this.getChild("n47"));
  13476. this.numTxt = (this.getChild("numTxt"));
  13477. this.n50 = (this.getChild("n50"));
  13478. this.n51 = (this.getChild("n51"));
  13479. this.n52 = (this.getChild("n52"));
  13480. this.n53 = (this.getChild("n53"));
  13481. this.n54 = (this.getChild("n54"));
  13482. }
  13483. }
  13484. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  13485. class ui_Component31 extends fgui.GComponent {
  13486. static createInstance() {
  13487. return (fgui.UIPackage.createObject("game", "Component31"));
  13488. }
  13489. onConstruct() {
  13490. this.n55 = (this.getChild("n55"));
  13491. this.n54 = (this.getChild("n54"));
  13492. this.conditionTxt = (this.getChild("conditionTxt"));
  13493. this.n57 = (this.getChild("n57"));
  13494. this.t0 = this.getTransition("t0");
  13495. }
  13496. }
  13497. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  13498. class ui_Component32 extends fgui.GComponent {
  13499. static createInstance() {
  13500. return (fgui.UIPackage.createObject("game", "Component32"));
  13501. }
  13502. onConstruct() {
  13503. this.n5 = (this.getChild("n5"));
  13504. this.n6 = (this.getChild("n6"));
  13505. this.n7 = (this.getChild("n7"));
  13506. this.t0 = this.getTransition("t0");
  13507. }
  13508. }
  13509. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  13510. class ui_AwardItem extends fgui.GComponent {
  13511. static createInstance() {
  13512. return (fgui.UIPackage.createObject("game", "AwardItem"));
  13513. }
  13514. onConstruct() {
  13515. this.n9 = (this.getChild("n9"));
  13516. this.myIcon = (this.getChild("myIcon"));
  13517. this.numTxt = (this.getChild("numTxt"));
  13518. this.nameTxt = (this.getChild("nameTxt"));
  13519. this.n16 = (this.getChild("n16"));
  13520. this.n17 = (this.getChild("n17"));
  13521. }
  13522. }
  13523. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  13524. class ui_ranking_com1 extends fgui.GButton {
  13525. static createInstance() {
  13526. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  13527. }
  13528. onConstruct() {
  13529. this.c1 = this.getController("c1");
  13530. this.n49 = (this.getChild("n49"));
  13531. this.n18 = (this.getChild("n18"));
  13532. this.n46 = (this.getChild("n46"));
  13533. this.n48 = (this.getChild("n48"));
  13534. this.n50 = (this.getChild("n50"));
  13535. }
  13536. }
  13537. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  13538. class ui_ranking_com2 extends fgui.GButton {
  13539. static createInstance() {
  13540. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  13541. }
  13542. onConstruct() {
  13543. this.c1 = this.getController("c1");
  13544. this.n49 = (this.getChild("n49"));
  13545. this.n18 = (this.getChild("n18"));
  13546. this.n46 = (this.getChild("n46"));
  13547. this.n48 = (this.getChild("n48"));
  13548. this.n50 = (this.getChild("n50"));
  13549. }
  13550. }
  13551. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  13552. class ui_ranking_com3 extends fgui.GComponent {
  13553. static createInstance() {
  13554. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  13555. }
  13556. onConstruct() {
  13557. this.n17 = (this.getChild("n17"));
  13558. this.myIcon = (this.getChild("myIcon"));
  13559. }
  13560. }
  13561. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  13562. class ui_ranking_com4 extends fgui.GComponent {
  13563. static createInstance() {
  13564. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  13565. }
  13566. onConstruct() {
  13567. this.n16 = (this.getChild("n16"));
  13568. this.head = (this.getChild("head"));
  13569. }
  13570. }
  13571. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  13572. class ui_ranking_com5 extends fgui.GComponent {
  13573. static createInstance() {
  13574. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  13575. }
  13576. onConstruct() {
  13577. this.c1 = this.getController("c1");
  13578. this.c2 = this.getController("c2");
  13579. this.n2 = (this.getChild("n2"));
  13580. this.n3 = (this.getChild("n3"));
  13581. this.levelBtn = (this.getChild("levelBtn"));
  13582. this.starBtn = (this.getChild("starBtn"));
  13583. this.n23 = (this.getChild("n23"));
  13584. this.n24 = (this.getChild("n24"));
  13585. this.n25 = (this.getChild("n25"));
  13586. this.myList = (this.getChild("myList"));
  13587. this.selfNode = (this.getChild("selfNode"));
  13588. this.n9 = (this.getChild("n9"));
  13589. this.n12 = (this.getChild("n12"));
  13590. this.n13 = (this.getChild("n13"));
  13591. this.n14 = (this.getChild("n14"));
  13592. this.n39 = (this.getChild("n39"));
  13593. this.n41 = (this.getChild("n41"));
  13594. this.n42 = (this.getChild("n42"));
  13595. this.n45 = (this.getChild("n45"));
  13596. this.changeBtn = (this.getChild("changeBtn"));
  13597. this.closeBtn = (this.getChild("closeBtn"));
  13598. this.t0 = this.getTransition("t0");
  13599. }
  13600. }
  13601. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  13602. class ui_RankItem extends fgui.GComponent {
  13603. static createInstance() {
  13604. return (fgui.UIPackage.createObject("game", "RankItem"));
  13605. }
  13606. onConstruct() {
  13607. this.n10 = (this.getChild("n10"));
  13608. this.n11 = (this.getChild("n11"));
  13609. this.rankTxt = (this.getChild("rankTxt"));
  13610. this.headNode = (this.getChild("headNode"));
  13611. this.nameTxt = (this.getChild("nameTxt"));
  13612. this.n19 = (this.getChild("n19"));
  13613. this.valueTxt = (this.getChild("valueTxt"));
  13614. this.img1 = (this.getChild("img1"));
  13615. this.img2 = (this.getChild("img2"));
  13616. this.img3 = (this.getChild("img3"));
  13617. }
  13618. }
  13619. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  13620. class ui_ranking_com9 extends fgui.GComponent {
  13621. static createInstance() {
  13622. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  13623. }
  13624. onConstruct() {
  13625. this.c1 = this.getController("c1");
  13626. this.n27 = (this.getChild("n27"));
  13627. this.n28 = (this.getChild("n28"));
  13628. this.headNode = (this.getChild("headNode"));
  13629. this.rankTxt = (this.getChild("rankTxt"));
  13630. this.nameTxt = (this.getChild("nameTxt"));
  13631. this.n34 = (this.getChild("n34"));
  13632. this.valueTxt = (this.getChild("valueTxt"));
  13633. this.n36 = (this.getChild("n36"));
  13634. this.n37 = (this.getChild("n37"));
  13635. this.n38 = (this.getChild("n38"));
  13636. this.n39 = (this.getChild("n39"));
  13637. this.n40 = (this.getChild("n40"));
  13638. }
  13639. }
  13640. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  13641. class ui_ranking_com10 extends fgui.GComponent {
  13642. static createInstance() {
  13643. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  13644. }
  13645. onConstruct() {
  13646. this.n23 = (this.getChild("n23"));
  13647. this.n24 = (this.getChild("n24"));
  13648. }
  13649. }
  13650. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  13651. class ui_ranking_com11 extends fgui.GComponent {
  13652. static createInstance() {
  13653. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  13654. }
  13655. onConstruct() {
  13656. this.n24 = (this.getChild("n24"));
  13657. this.n25 = (this.getChild("n25"));
  13658. this.t0 = this.getTransition("t0");
  13659. }
  13660. }
  13661. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  13662. class ui_ranking_com13 extends fgui.GButton {
  13663. static createInstance() {
  13664. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  13665. }
  13666. onConstruct() {
  13667. this.c1 = this.getController("c1");
  13668. this.n44 = (this.getChild("n44"));
  13669. this.n45 = (this.getChild("n45"));
  13670. this.n46 = (this.getChild("n46"));
  13671. }
  13672. }
  13673. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  13674. class ui_Component122 extends fgui.GComponent {
  13675. static createInstance() {
  13676. return (fgui.UIPackage.createObject("game", "Component122"));
  13677. }
  13678. onConstruct() {
  13679. this.gameNode3 = (this.getChild("gameNode3"));
  13680. }
  13681. }
  13682. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  13683. class ui_skillItem extends fgui.GComponent {
  13684. static createInstance() {
  13685. return (fgui.UIPackage.createObject("game", "skillItem"));
  13686. }
  13687. onConstruct() {
  13688. this.c1 = this.getController("c1");
  13689. this.n31 = (this.getChild("n31"));
  13690. this.n6 = (this.getChild("n6"));
  13691. this.skillImg = (this.getChild("skillImg"));
  13692. this.nameTxt = (this.getChild("nameTxt"));
  13693. this.levelTxt = (this.getChild("levelTxt"));
  13694. this.n28 = (this.getChild("n28"));
  13695. this.describeTxt = (this.getChild("describeTxt"));
  13696. this.n32 = (this.getChild("n32"));
  13697. this.mutiBtn = (this.getChild("mutiBtn"));
  13698. this.tryNode = (this.getChild("tryNode"));
  13699. this.normalBtn = (this.getChild("normalBtn"));
  13700. this.startBtn = (this.getChild("startBtn"));
  13701. this.n42 = (this.getChild("n42"));
  13702. this.n43 = (this.getChild("n43"));
  13703. this.n44 = (this.getChild("n44"));
  13704. }
  13705. }
  13706. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  13707. class ui_Component26 extends fgui.GButton {
  13708. static createInstance() {
  13709. return (fgui.UIPackage.createObject("game", "Component26"));
  13710. }
  13711. onConstruct() {
  13712. this.n11 = (this.getChild("n11"));
  13713. this.n30 = (this.getChild("n30"));
  13714. this.n34 = (this.getChild("n34"));
  13715. }
  13716. }
  13717. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  13718. class ui_Component28 extends fgui.GButton {
  13719. static createInstance() {
  13720. return (fgui.UIPackage.createObject("game", "Component28"));
  13721. }
  13722. onConstruct() {
  13723. this.n12 = (this.getChild("n12"));
  13724. this.n31 = (this.getChild("n31"));
  13725. this.curTxt = (this.getChild("curTxt"));
  13726. this.n33 = (this.getChild("n33"));
  13727. }
  13728. }
  13729. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  13730. class ui_Component1302 extends fgui.GComponent {
  13731. static createInstance() {
  13732. return (fgui.UIPackage.createObject("game", "Component1302"));
  13733. }
  13734. onConstruct() {
  13735. this.n2 = (this.getChild("n2"));
  13736. this.n3 = (this.getChild("n3"));
  13737. }
  13738. }
  13739. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  13740. class ui_Component113 extends fgui.GComponent {
  13741. static createInstance() {
  13742. return (fgui.UIPackage.createObject("game", "Component113"));
  13743. }
  13744. onConstruct() {
  13745. this.n85 = (this.getChild("n85"));
  13746. this.n86 = (this.getChild("n86"));
  13747. this.n77 = (this.getChild("n77"));
  13748. this.n79 = (this.getChild("n79"));
  13749. this.n80 = (this.getChild("n80"));
  13750. this.n81 = (this.getChild("n81"));
  13751. this.n82 = (this.getChild("n82"));
  13752. this.n84 = (this.getChild("n84"));
  13753. this.n87 = (this.getChild("n87"));
  13754. this.t0 = this.getTransition("t0");
  13755. }
  13756. }
  13757. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  13758. class ui_Component114 extends fgui.GComponent {
  13759. static createInstance() {
  13760. return (fgui.UIPackage.createObject("game", "Component114"));
  13761. }
  13762. onConstruct() {
  13763. this.n77 = (this.getChild("n77"));
  13764. this.t0 = this.getTransition("t0");
  13765. }
  13766. }
  13767. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  13768. class ui_Component115 extends fgui.GComponent {
  13769. static createInstance() {
  13770. return (fgui.UIPackage.createObject("game", "Component115"));
  13771. }
  13772. onConstruct() {
  13773. this.n83 = (this.getChild("n83"));
  13774. this.fingerNode = (this.getChild("fingerNode"));
  13775. this.n84 = (this.getChild("n84"));
  13776. }
  13777. }
  13778. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  13779. class ui_Component117 extends fgui.GComponent {
  13780. static createInstance() {
  13781. return (fgui.UIPackage.createObject("game", "Component117"));
  13782. }
  13783. onConstruct() {
  13784. this.n87 = (this.getChild("n87"));
  13785. this.n88 = (this.getChild("n88"));
  13786. this.n84 = (this.getChild("n84"));
  13787. this.n85 = (this.getChild("n85"));
  13788. this.n86 = (this.getChild("n86"));
  13789. this.t0 = this.getTransition("t0");
  13790. }
  13791. }
  13792. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  13793. class ui_Component98_1 extends fgui.GButton {
  13794. static createInstance() {
  13795. return (fgui.UIPackage.createObject("game", "Component98_1"));
  13796. }
  13797. onConstruct() {
  13798. this.c1 = this.getController("c1");
  13799. this.n8 = (this.getChild("n8"));
  13800. this.n41 = (this.getChild("n41"));
  13801. this.n40 = (this.getChild("n40"));
  13802. }
  13803. }
  13804. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  13805. class ui_Component61 extends fgui.GComponent {
  13806. static createInstance() {
  13807. return (fgui.UIPackage.createObject("game", "Component61"));
  13808. }
  13809. onConstruct() {
  13810. this.n14 = (this.getChild("n14"));
  13811. this.n6 = (this.getChild("n6"));
  13812. this.t0 = this.getTransition("t0");
  13813. }
  13814. }
  13815. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  13816. class ui_Component62 extends fgui.GComponent {
  13817. static createInstance() {
  13818. return (fgui.UIPackage.createObject("game", "Component62"));
  13819. }
  13820. onConstruct() {
  13821. this.n66 = (this.getChild("n66"));
  13822. this.n56 = (this.getChild("n56"));
  13823. this.n63 = (this.getChild("n63"));
  13824. this.n65 = (this.getChild("n65"));
  13825. this.t0 = this.getTransition("t0");
  13826. }
  13827. }
  13828. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  13829. class ui_d3Root extends fgui.GComponent {
  13830. static createInstance() {
  13831. return (fgui.UIPackage.createObject("game", "d3Root"));
  13832. }
  13833. onConstruct() {
  13834. }
  13835. }
  13836. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  13837. class ui_d2Root extends fgui.GComponent {
  13838. static createInstance() {
  13839. return (fgui.UIPackage.createObject("game", "d2Root"));
  13840. }
  13841. onConstruct() {
  13842. }
  13843. }
  13844. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  13845. class ui_ballNode extends fgui.GComponent {
  13846. static createInstance() {
  13847. return (fgui.UIPackage.createObject("game", "ballNode"));
  13848. }
  13849. onConstruct() {
  13850. }
  13851. }
  13852. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  13853. class ui_border extends fgui.GComponent {
  13854. static createInstance() {
  13855. return (fgui.UIPackage.createObject("game", "border"));
  13856. }
  13857. onConstruct() {
  13858. this.bar1 = (this.getChild("bar1"));
  13859. this.bar2 = (this.getChild("bar2"));
  13860. this.bar3 = (this.getChild("bar3"));
  13861. this.bar4 = (this.getChild("bar4"));
  13862. this.bar5 = (this.getChild("bar5"));
  13863. this.bar6 = (this.getChild("bar6"));
  13864. this.circle1 = (this.getChild("circle1"));
  13865. this.circle2 = (this.getChild("circle2"));
  13866. this.circle3 = (this.getChild("circle3"));
  13867. this.circle4 = (this.getChild("circle4"));
  13868. this.circle5 = (this.getChild("circle5"));
  13869. this.circle6 = (this.getChild("circle6"));
  13870. this.n28 = (this.getChild("n28"));
  13871. }
  13872. }
  13873. ui_border.URL = "ui://isxx5ak7sdh33qq";
  13874. class ui_Component41_2 extends fgui.GComponent {
  13875. static createInstance() {
  13876. return (fgui.UIPackage.createObject("game", "Component41_2"));
  13877. }
  13878. onConstruct() {
  13879. this.c1 = this.getController("c1");
  13880. this.n0 = (this.getChild("n0"));
  13881. this.n2 = (this.getChild("n2"));
  13882. this.n19 = (this.getChild("n19"));
  13883. this.cancelBtn = (this.getChild("cancelBtn"));
  13884. this.videoBtn = (this.getChild("videoBtn"));
  13885. this.n9 = (this.getChild("n9"));
  13886. this.n22 = (this.getChild("n22"));
  13887. this.tipsTxt = (this.getChild("tipsTxt"));
  13888. this.n23 = (this.getChild("n23"));
  13889. this.n24 = (this.getChild("n24"));
  13890. this.n26 = (this.getChild("n26"));
  13891. this.n27 = (this.getChild("n27"));
  13892. this.titleTxt = (this.getChild("titleTxt"));
  13893. }
  13894. }
  13895. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  13896. class ui_Component41_1 extends fgui.GComponent {
  13897. static createInstance() {
  13898. return (fgui.UIPackage.createObject("game", "Component41_1"));
  13899. }
  13900. onConstruct() {
  13901. this.c1 = this.getController("c1");
  13902. this.n0 = (this.getChild("n0"));
  13903. this.n2 = (this.getChild("n2"));
  13904. this.cancelBtn = (this.getChild("cancelBtn"));
  13905. this.videoBtn = (this.getChild("videoBtn"));
  13906. this.n27 = (this.getChild("n27"));
  13907. this.n30 = (this.getChild("n30"));
  13908. this.n31 = (this.getChild("n31"));
  13909. this.n32 = (this.getChild("n32"));
  13910. this.n33 = (this.getChild("n33"));
  13911. this.n34 = (this.getChild("n34"));
  13912. this.n35 = (this.getChild("n35"));
  13913. this.n36 = (this.getChild("n36"));
  13914. this.n1 = (this.getChild("n1"));
  13915. this.n37 = (this.getChild("n37"));
  13916. this.t0 = this.getTransition("t0");
  13917. this.t1 = this.getTransition("t1");
  13918. this.t2 = this.getTransition("t2");
  13919. this.t3 = this.getTransition("t3");
  13920. }
  13921. }
  13922. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  13923. class ui_againBtn extends fgui.GButton {
  13924. static createInstance() {
  13925. return (fgui.UIPackage.createObject("game", "againBtn"));
  13926. }
  13927. onConstruct() {
  13928. this.n2 = (this.getChild("n2"));
  13929. this.n1 = (this.getChild("n1"));
  13930. this.n5 = (this.getChild("n5"));
  13931. }
  13932. }
  13933. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  13934. class ui_Component118 extends fgui.GButton {
  13935. static createInstance() {
  13936. return (fgui.UIPackage.createObject("game", "Component118"));
  13937. }
  13938. onConstruct() {
  13939. this.c1 = this.getController("c1");
  13940. this.n14 = (this.getChild("n14"));
  13941. this.n9 = (this.getChild("n9"));
  13942. this.n10 = (this.getChild("n10"));
  13943. this.diamondTxt = (this.getChild("diamondTxt"));
  13944. this.n13 = (this.getChild("n13"));
  13945. this.n15 = (this.getChild("n15"));
  13946. }
  13947. }
  13948. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  13949. class ui_Component119 extends fgui.GComponent {
  13950. static createInstance() {
  13951. return (fgui.UIPackage.createObject("game", "Component119"));
  13952. }
  13953. onConstruct() {
  13954. this.n1 = (this.getChild("n1"));
  13955. this.n2 = (this.getChild("n2"));
  13956. this.n13 = (this.getChild("n13"));
  13957. this.n6 = (this.getChild("n6"));
  13958. this.screenNode = (this.getChild("screenNode"));
  13959. this.n15 = (this.getChild("n15"));
  13960. this.closeBtn = (this.getChild("closeBtn"));
  13961. this.share2Btn = (this.getChild("share2Btn"));
  13962. this.shareBtn = (this.getChild("shareBtn"));
  13963. this.tipsNode = (this.getChild("tipsNode"));
  13964. this.awardNode = (this.getChild("awardNode"));
  13965. }
  13966. }
  13967. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  13968. class ui_Component132_1 extends fgui.GComponent {
  13969. static createInstance() {
  13970. return (fgui.UIPackage.createObject("game", "Component132_1"));
  13971. }
  13972. onConstruct() {
  13973. this.n25 = (this.getChild("n25"));
  13974. this.n26 = (this.getChild("n26"));
  13975. this.n27 = (this.getChild("n27"));
  13976. this.t0 = this.getTransition("t0");
  13977. }
  13978. }
  13979. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  13980. class ui_SecretaryDisplay extends fgui.GComponent {
  13981. static createInstance() {
  13982. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  13983. }
  13984. onConstruct() {
  13985. this.n2 = (this.getChild("n2"));
  13986. this.levelTxt = (this.getChild("levelTxt"));
  13987. this.n4 = (this.getChild("n4"));
  13988. this.secretary = (this.getChild("secretary"));
  13989. this.purchaseBtn = (this.getChild("purchaseBtn"));
  13990. this.n16 = (this.getChild("n16"));
  13991. this.n37 = (this.getChild("n37"));
  13992. this.n41 = (this.getChild("n41"));
  13993. this.n14 = (this.getChild("n14"));
  13994. this.n17 = (this.getChild("n17"));
  13995. this.heightTxt = (this.getChild("heightTxt"));
  13996. this.n46 = (this.getChild("n46"));
  13997. this.n36 = (this.getChild("n36"));
  13998. this.n38 = (this.getChild("n38"));
  13999. this.foodTxt = (this.getChild("foodTxt"));
  14000. this.n47 = (this.getChild("n47"));
  14001. this.n40 = (this.getChild("n40"));
  14002. this.n42 = (this.getChild("n42"));
  14003. this.historyTxt = (this.getChild("historyTxt"));
  14004. this.n48 = (this.getChild("n48"));
  14005. this.nameImg = (this.getChild("nameImg"));
  14006. this.n12 = (this.getChild("n12"));
  14007. this.n49 = (this.getChild("n49"));
  14008. this.t0 = this.getTransition("t0");
  14009. }
  14010. }
  14011. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  14012. class ui_BallRodDisplay extends fgui.GComponent {
  14013. static createInstance() {
  14014. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  14015. }
  14016. onConstruct() {
  14017. this.c1 = this.getController("c1");
  14018. this.n31 = (this.getChild("n31"));
  14019. this.n6 = (this.getChild("n6"));
  14020. this.nameTxt = (this.getChild("nameTxt"));
  14021. this.rodImg = (this.getChild("rodImg"));
  14022. this.levelNode = (this.getChild("levelNode"));
  14023. this.eftRod = (this.getChild("eftRod"));
  14024. this.purchaseBtn = (this.getChild("purchaseBtn"));
  14025. }
  14026. }
  14027. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  14028. class ui_Component111_11 extends fgui.GComponent {
  14029. static createInstance() {
  14030. return (fgui.UIPackage.createObject("game", "Component111_11"));
  14031. }
  14032. onConstruct() {
  14033. this.n68 = (this.getChild("n68"));
  14034. this.n69 = (this.getChild("n69"));
  14035. }
  14036. }
  14037. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  14038. class ui_Component112 extends fgui.GComponent {
  14039. static createInstance() {
  14040. return (fgui.UIPackage.createObject("game", "Component112"));
  14041. }
  14042. onConstruct() {
  14043. this.n68 = (this.getChild("n68"));
  14044. this.n70 = (this.getChild("n70"));
  14045. this.myMask = (this.getChild("myMask"));
  14046. }
  14047. }
  14048. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  14049. class ui_Component111 extends fgui.GComponent {
  14050. static createInstance() {
  14051. return (fgui.UIPackage.createObject("game", "Component111"));
  14052. }
  14053. onConstruct() {
  14054. this.n68 = (this.getChild("n68"));
  14055. this.myMask = (this.getChild("myMask"));
  14056. }
  14057. }
  14058. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  14059. class ui_Component144 extends fgui.GButton {
  14060. static createInstance() {
  14061. return (fgui.UIPackage.createObject("game", "Component144"));
  14062. }
  14063. onConstruct() {
  14064. this.n8 = (this.getChild("n8"));
  14065. }
  14066. }
  14067. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  14068. class ui_Sign_com2 extends fgui.GComponent {
  14069. static createInstance() {
  14070. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  14071. }
  14072. onConstruct() {
  14073. this.n0 = (this.getChild("n0"));
  14074. this.n1 = (this.getChild("n1"));
  14075. this.t0 = this.getTransition("t0");
  14076. }
  14077. }
  14078. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  14079. class ui_Sign_guang extends fgui.GComponent {
  14080. static createInstance() {
  14081. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  14082. }
  14083. onConstruct() {
  14084. this.n1 = (this.getChild("n1"));
  14085. this.n2 = (this.getChild("n2"));
  14086. this.n3 = (this.getChild("n3"));
  14087. this.n4 = (this.getChild("n4"));
  14088. this.n5 = (this.getChild("n5"));
  14089. this.n6 = (this.getChild("n6"));
  14090. this.n8 = (this.getChild("n8"));
  14091. }
  14092. }
  14093. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  14094. class ui_SignMax extends fgui.GComponent {
  14095. static createInstance() {
  14096. return (fgui.UIPackage.createObject("game", "SignMax"));
  14097. }
  14098. onConstruct() {
  14099. this.c1 = this.getController("c1");
  14100. this.n7 = (this.getChild("n7"));
  14101. this.n15 = (this.getChild("n15"));
  14102. this.n8 = (this.getChild("n8"));
  14103. this.titleTxt = (this.getChild("titleTxt"));
  14104. this.myIcon1 = (this.getChild("myIcon1"));
  14105. this.numTxt1 = (this.getChild("numTxt1"));
  14106. this.myIcon2 = (this.getChild("myIcon2"));
  14107. this.n20 = (this.getChild("n20"));
  14108. this.n17 = (this.getChild("n17"));
  14109. this.numTxt2 = (this.getChild("numTxt2"));
  14110. this.n12 = (this.getChild("n12"));
  14111. this.n13 = (this.getChild("n13"));
  14112. this.n21 = (this.getChild("n21"));
  14113. this.n14 = (this.getChild("n14"));
  14114. }
  14115. }
  14116. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  14117. class ui_Sign_com2_1 extends fgui.GComponent {
  14118. static createInstance() {
  14119. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  14120. }
  14121. onConstruct() {
  14122. this.n0 = (this.getChild("n0"));
  14123. this.n1 = (this.getChild("n1"));
  14124. this.t0 = this.getTransition("t0");
  14125. }
  14126. }
  14127. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  14128. class ui_Sign_com5 extends fgui.GComponent {
  14129. static createInstance() {
  14130. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  14131. }
  14132. onConstruct() {
  14133. this.n3 = (this.getChild("n3"));
  14134. this.n29 = (this.getChild("n29"));
  14135. this.n4 = (this.getChild("n4"));
  14136. this.day1 = (this.getChild("day1"));
  14137. this.day2 = (this.getChild("day2"));
  14138. this.day3 = (this.getChild("day3"));
  14139. this.day4 = (this.getChild("day4"));
  14140. this.day5 = (this.getChild("day5"));
  14141. this.day6 = (this.getChild("day6"));
  14142. this.day7 = (this.getChild("day7"));
  14143. this.t0 = this.getTransition("t0");
  14144. }
  14145. }
  14146. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  14147. class ui_Sign_com8 extends fgui.GComponent {
  14148. static createInstance() {
  14149. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  14150. }
  14151. onConstruct() {
  14152. this.n48 = (this.getChild("n48"));
  14153. this.womanTxt = (this.getChild("womanTxt"));
  14154. this.t0 = this.getTransition("t0");
  14155. }
  14156. }
  14157. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  14158. class ui_Sign_com6 extends fgui.GComponent {
  14159. static createInstance() {
  14160. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  14161. }
  14162. onConstruct() {
  14163. this.n2 = (this.getChild("n2"));
  14164. this.n3 = (this.getChild("n3"));
  14165. this.t0 = this.getTransition("t0");
  14166. }
  14167. }
  14168. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  14169. class ui_Sign_com7 extends fgui.GComponent {
  14170. static createInstance() {
  14171. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  14172. }
  14173. onConstruct() {
  14174. this.n29 = (this.getChild("n29"));
  14175. this.n2 = (this.getChild("n2"));
  14176. }
  14177. }
  14178. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  14179. class ui_UITurntable_com1_2 extends fgui.GComponent {
  14180. static createInstance() {
  14181. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  14182. }
  14183. onConstruct() {
  14184. this.n5 = (this.getChild("n5"));
  14185. this.n4 = (this.getChild("n4"));
  14186. this.t0 = this.getTransition("t0");
  14187. }
  14188. }
  14189. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  14190. class ui_UITurntable_com2 extends fgui.GComponent {
  14191. static createInstance() {
  14192. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  14193. }
  14194. onConstruct() {
  14195. this.c1 = this.getController("c1");
  14196. this.n4 = (this.getChild("n4"));
  14197. this.n6 = (this.getChild("n6"));
  14198. this.n10 = (this.getChild("n10"));
  14199. this.n11 = (this.getChild("n11"));
  14200. this.n12 = (this.getChild("n12"));
  14201. this.n13 = (this.getChild("n13"));
  14202. this.n14 = (this.getChild("n14"));
  14203. this.n15 = (this.getChild("n15"));
  14204. this.n16 = (this.getChild("n16"));
  14205. this.n17 = (this.getChild("n17"));
  14206. this.n18 = (this.getChild("n18"));
  14207. this.n19 = (this.getChild("n19"));
  14208. this.n20 = (this.getChild("n20"));
  14209. this.n21 = (this.getChild("n21"));
  14210. this.n22 = (this.getChild("n22"));
  14211. this.n23 = (this.getChild("n23"));
  14212. this.n24 = (this.getChild("n24"));
  14213. this.n25 = (this.getChild("n25"));
  14214. this.n26 = (this.getChild("n26"));
  14215. this.n27 = (this.getChild("n27"));
  14216. this.n28 = (this.getChild("n28"));
  14217. this.n29 = (this.getChild("n29"));
  14218. this.n30 = (this.getChild("n30"));
  14219. this.n31 = (this.getChild("n31"));
  14220. this.n32 = (this.getChild("n32"));
  14221. this.n33 = (this.getChild("n33"));
  14222. }
  14223. }
  14224. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  14225. class ui_UITurntable_com1_1 extends fgui.GComponent {
  14226. static createInstance() {
  14227. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  14228. }
  14229. onConstruct() {
  14230. this.n5 = (this.getChild("n5"));
  14231. this.n4 = (this.getChild("n4"));
  14232. this.t0 = this.getTransition("t0");
  14233. }
  14234. }
  14235. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  14236. class ui_UITurntable_com5 extends fgui.GComponent {
  14237. static createInstance() {
  14238. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  14239. }
  14240. onConstruct() {
  14241. this.flashNode = (this.getChild("flashNode"));
  14242. this.rotNode = (this.getChild("rotNode"));
  14243. this.n3 = (this.getChild("n3"));
  14244. this.n21 = (this.getChild("n21"));
  14245. this.t0 = this.getTransition("t0");
  14246. }
  14247. }
  14248. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  14249. class ui_UITurntable_com7 extends fgui.GComponent {
  14250. static createInstance() {
  14251. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  14252. }
  14253. onConstruct() {
  14254. this.n2 = (this.getChild("n2"));
  14255. this.n35 = (this.getChild("n35"));
  14256. this.img1 = (this.getChild("img1"));
  14257. this.img2 = (this.getChild("img2"));
  14258. this.img3 = (this.getChild("img3"));
  14259. this.img4 = (this.getChild("img4"));
  14260. this.img6 = (this.getChild("img6"));
  14261. this.img5 = (this.getChild("img5"));
  14262. this.txt1 = (this.getChild("txt1"));
  14263. this.txt2 = (this.getChild("txt2"));
  14264. this.txt3 = (this.getChild("txt3"));
  14265. this.txt4 = (this.getChild("txt4"));
  14266. this.txt5 = (this.getChild("txt5"));
  14267. this.txt6 = (this.getChild("txt6"));
  14268. }
  14269. }
  14270. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  14271. class ui_UITurntable_com9 extends fgui.GComponent {
  14272. static createInstance() {
  14273. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  14274. }
  14275. onConstruct() {
  14276. this.n38 = (this.getChild("n38"));
  14277. this.n39 = (this.getChild("n39"));
  14278. }
  14279. }
  14280. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  14281. class ui_UITurntable_com10 extends fgui.GComponent {
  14282. static createInstance() {
  14283. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  14284. }
  14285. onConstruct() {
  14286. this.n39 = (this.getChild("n39"));
  14287. this.n40 = (this.getChild("n40"));
  14288. this.t0 = this.getTransition("t0");
  14289. }
  14290. }
  14291. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  14292. class ui_UITurntable_com11 extends fgui.GComponent {
  14293. static createInstance() {
  14294. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  14295. }
  14296. onConstruct() {
  14297. this.n38 = (this.getChild("n38"));
  14298. this.n39 = (this.getChild("n39"));
  14299. this.n40 = (this.getChild("n40"));
  14300. this.t0 = this.getTransition("t0");
  14301. }
  14302. }
  14303. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  14304. class ui_UITurntable_com12 extends fgui.GComponent {
  14305. static createInstance() {
  14306. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  14307. }
  14308. onConstruct() {
  14309. this.n43 = (this.getChild("n43"));
  14310. this.barNode = (this.getChild("barNode"));
  14311. this.tipsTxt = (this.getChild("tipsTxt"));
  14312. this.n45 = (this.getChild("n45"));
  14313. this.boxBtn = (this.getChild("boxBtn"));
  14314. }
  14315. }
  14316. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  14317. class ui_UITurntable_com1 extends fgui.GButton {
  14318. static createInstance() {
  14319. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  14320. }
  14321. onConstruct() {
  14322. this.n41 = (this.getChild("n41"));
  14323. this.n42 = (this.getChild("n42"));
  14324. this.t0 = this.getTransition("t0");
  14325. }
  14326. }
  14327. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  14328. class ui_UITurntable_com3 extends fgui.GComponent {
  14329. static createInstance() {
  14330. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  14331. }
  14332. onConstruct() {
  14333. this.n48 = (this.getChild("n48"));
  14334. this.womanTxt = (this.getChild("womanTxt"));
  14335. this.t0 = this.getTransition("t0");
  14336. }
  14337. }
  14338. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  14339. class ui_cancelBtn2 extends fgui.GButton {
  14340. static createInstance() {
  14341. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  14342. }
  14343. onConstruct() {
  14344. this.c1 = this.getController("c1");
  14345. this.n0 = (this.getChild("n0"));
  14346. this.n1 = (this.getChild("n1"));
  14347. this.n2 = (this.getChild("n2"));
  14348. this.n3 = (this.getChild("n3"));
  14349. this.n4 = (this.getChild("n4"));
  14350. this.n5 = (this.getChild("n5"));
  14351. this.n6 = (this.getChild("n6"));
  14352. this.n7 = (this.getChild("n7"));
  14353. this.n8 = (this.getChild("n8"));
  14354. this.powerEft = (this.getChild("powerEft"));
  14355. }
  14356. }
  14357. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  14358. class ui_shareBtn2 extends fgui.GButton {
  14359. static createInstance() {
  14360. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  14361. }
  14362. onConstruct() {
  14363. this.c1 = this.getController("c1");
  14364. this.n2 = (this.getChild("n2"));
  14365. this.n24 = (this.getChild("n24"));
  14366. this.n1 = (this.getChild("n1"));
  14367. this.n3 = (this.getChild("n3"));
  14368. this.n23 = (this.getChild("n23"));
  14369. this.n4 = (this.getChild("n4"));
  14370. this.n5 = (this.getChild("n5"));
  14371. this.n6 = (this.getChild("n6"));
  14372. this.n20 = (this.getChild("n20"));
  14373. this.n21 = (this.getChild("n21"));
  14374. this.n22 = (this.getChild("n22"));
  14375. this.powerEft = (this.getChild("powerEft"));
  14376. }
  14377. }
  14378. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  14379. class ui_UIMoney extends fgui.GComponent {
  14380. static createInstance() {
  14381. return (fgui.UIPackage.createObject("game", "UIMoney"));
  14382. }
  14383. onConstruct() {
  14384. this.c1 = this.getController("c1");
  14385. this.n4 = (this.getChild("n4"));
  14386. this.coinImg = (this.getChild("coinImg"));
  14387. this.addCoinBtn = (this.getChild("addCoinBtn"));
  14388. this.coinTxt = (this.getChild("coinTxt"));
  14389. this.n7 = (this.getChild("n7"));
  14390. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  14391. this.diamondTxt = (this.getChild("diamondTxt"));
  14392. this.diamondImg = (this.getChild("diamondImg"));
  14393. this.n12 = (this.getChild("n12"));
  14394. this.powerImg = (this.getChild("powerImg"));
  14395. this.addPowerBtn = (this.getChild("addPowerBtn"));
  14396. this.powerTxt = (this.getChild("powerTxt"));
  14397. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  14398. }
  14399. }
  14400. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  14401. class ui_backBtn extends fgui.GButton {
  14402. static createInstance() {
  14403. return (fgui.UIPackage.createObject("game", "backBtn"));
  14404. }
  14405. onConstruct() {
  14406. this.n0 = (this.getChild("n0"));
  14407. this.t0 = this.getTransition("t0");
  14408. this.t1 = this.getTransition("t1");
  14409. }
  14410. }
  14411. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  14412. class ui_MoneyBtn extends fgui.GButton {
  14413. static createInstance() {
  14414. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  14415. }
  14416. onConstruct() {
  14417. this.button = this.getController("button");
  14418. this.n0 = (this.getChild("n0"));
  14419. }
  14420. }
  14421. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  14422. class ui_UIMoneyBtn extends fgui.GComponent {
  14423. static createInstance() {
  14424. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  14425. }
  14426. onConstruct() {
  14427. this.n1 = (this.getChild("n1"));
  14428. this.closeBtn = (this.getChild("closeBtn"));
  14429. }
  14430. }
  14431. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  14432. class ui_Component64 extends fgui.GComponent {
  14433. static createInstance() {
  14434. return (fgui.UIPackage.createObject("game", "Component64"));
  14435. }
  14436. onConstruct() {
  14437. this.n57 = (this.getChild("n57"));
  14438. this.n54 = (this.getChild("n54"));
  14439. this.n55 = (this.getChild("n55"));
  14440. this.n56 = (this.getChild("n56"));
  14441. this.t1 = this.getTransition("t1");
  14442. }
  14443. }
  14444. ui_Component64.URL = "ui://isxx5ak7wp26456";
  14445. class ui_Component41_3 extends fgui.GComponent {
  14446. static createInstance() {
  14447. return (fgui.UIPackage.createObject("game", "Component41_3"));
  14448. }
  14449. onConstruct() {
  14450. this.c1 = this.getController("c1");
  14451. this.n0 = (this.getChild("n0"));
  14452. this.n2 = (this.getChild("n2"));
  14453. this.cancelBtn = (this.getChild("cancelBtn"));
  14454. this.videoBtn = (this.getChild("videoBtn"));
  14455. this.n9 = (this.getChild("n9"));
  14456. this.n24 = (this.getChild("n24"));
  14457. this.n27 = (this.getChild("n27"));
  14458. this.titleTxt = (this.getChild("titleTxt"));
  14459. this.n28 = (this.getChild("n28"));
  14460. this.t0 = this.getTransition("t0");
  14461. }
  14462. }
  14463. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  14464. class ui_dh_zs_4 extends fgui.GComponent {
  14465. static createInstance() {
  14466. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  14467. }
  14468. onConstruct() {
  14469. this.n1 = (this.getChild("n1"));
  14470. this.n2 = (this.getChild("n2"));
  14471. this.n3 = (this.getChild("n3"));
  14472. this.n4 = (this.getChild("n4"));
  14473. this.n5 = (this.getChild("n5"));
  14474. this.n6 = (this.getChild("n6"));
  14475. this.n8 = (this.getChild("n8"));
  14476. this.t0 = this.getTransition("t0");
  14477. }
  14478. }
  14479. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  14480. class ui_Component71_1 extends fgui.GButton {
  14481. static createInstance() {
  14482. return (fgui.UIPackage.createObject("game", "Component71_1"));
  14483. }
  14484. onConstruct() {
  14485. this.n17 = (this.getChild("n17"));
  14486. this.t0 = this.getTransition("t0");
  14487. }
  14488. }
  14489. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  14490. class ui_Component83 extends fgui.GComponent {
  14491. static createInstance() {
  14492. return (fgui.UIPackage.createObject("game", "Component83"));
  14493. }
  14494. onConstruct() {
  14495. this.c1 = this.getController("c1");
  14496. this.n17 = (this.getChild("n17"));
  14497. this.n19 = (this.getChild("n19"));
  14498. this.n20 = (this.getChild("n20"));
  14499. }
  14500. }
  14501. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  14502. class ui_Component84 extends fgui.GComponent {
  14503. static createInstance() {
  14504. return (fgui.UIPackage.createObject("game", "Component84"));
  14505. }
  14506. onConstruct() {
  14507. this.c1 = this.getController("c1");
  14508. this.n4 = (this.getChild("n4"));
  14509. this.n22 = (this.getChild("n22"));
  14510. this.n23 = (this.getChild("n23"));
  14511. this.numTxt = (this.getChild("numTxt"));
  14512. this.n25 = (this.getChild("n25"));
  14513. this.n26 = (this.getChild("n26"));
  14514. }
  14515. }
  14516. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  14517. class ui_Component84_1 extends fgui.GComponent {
  14518. static createInstance() {
  14519. return (fgui.UIPackage.createObject("game", "Component84_1"));
  14520. }
  14521. onConstruct() {
  14522. this.c1 = this.getController("c1");
  14523. this.n4 = (this.getChild("n4"));
  14524. this.n22 = (this.getChild("n22"));
  14525. this.n23 = (this.getChild("n23"));
  14526. this.numTxt = (this.getChild("numTxt"));
  14527. this.n25 = (this.getChild("n25"));
  14528. this.n26 = (this.getChild("n26"));
  14529. }
  14530. }
  14531. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  14532. class ui_Component85 extends fgui.GComponent {
  14533. static createInstance() {
  14534. return (fgui.UIPackage.createObject("game", "Component85"));
  14535. }
  14536. onConstruct() {
  14537. this.n1 = (this.getChild("n1"));
  14538. this.n6 = (this.getChild("n6"));
  14539. this.n2 = (this.getChild("n2"));
  14540. this.n3 = (this.getChild("n3"));
  14541. this.levelTxt = (this.getChild("levelTxt"));
  14542. this.n10 = (this.getChild("n10"));
  14543. this.n11 = (this.getChild("n11"));
  14544. this.n12 = (this.getChild("n12"));
  14545. this.n13 = (this.getChild("n13"));
  14546. this.n14 = (this.getChild("n14"));
  14547. this.modeNode = (this.getChild("modeNode"));
  14548. this.n18 = (this.getChild("n18"));
  14549. this.conditionTxt = (this.getChild("conditionTxt"));
  14550. this.diamondNode = (this.getChild("diamondNode"));
  14551. this.coinNode = (this.getChild("coinNode"));
  14552. this.startBtn = (this.getChild("startBtn"));
  14553. this.n28 = (this.getChild("n28"));
  14554. this.displayRoot = (this.getChild("displayRoot"));
  14555. this.t0 = this.getTransition("t0");
  14556. }
  14557. }
  14558. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  14559. class ui_Component86 extends fgui.GButton {
  14560. static createInstance() {
  14561. return (fgui.UIPackage.createObject("game", "Component86"));
  14562. }
  14563. onConstruct() {
  14564. this.n15 = (this.getChild("n15"));
  14565. this.t0 = this.getTransition("t0");
  14566. }
  14567. }
  14568. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  14569. class ui_Component87 extends fgui.GComponent {
  14570. static createInstance() {
  14571. return (fgui.UIPackage.createObject("game", "Component87"));
  14572. }
  14573. onConstruct() {
  14574. this.n66 = (this.getChild("n66"));
  14575. this.myProgress = (this.getChild("myProgress"));
  14576. this.starAni = (this.getChild("starAni"));
  14577. this.hpTxt = (this.getChild("hpTxt"));
  14578. this.n74 = (this.getChild("n74"));
  14579. this.n73 = (this.getChild("n73"));
  14580. this.ballTxt = (this.getChild("ballTxt"));
  14581. this.n76 = (this.getChild("n76"));
  14582. this.helpLineBtn = (this.getChild("helpLineBtn"));
  14583. this.levelTxt = (this.getChild("levelTxt"));
  14584. this.star1 = (this.getChild("star1"));
  14585. this.star2 = (this.getChild("star2"));
  14586. this.star3 = (this.getChild("star3"));
  14587. }
  14588. }
  14589. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  14590. class ui_Component88 extends fgui.GProgressBar {
  14591. static createInstance() {
  14592. return (fgui.UIPackage.createObject("game", "Component88"));
  14593. }
  14594. onConstruct() {
  14595. this.n68 = (this.getChild("n68"));
  14596. this.bar = (this.getChild("bar"));
  14597. }
  14598. }
  14599. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  14600. class ui_Component89 extends fgui.GComponent {
  14601. static createInstance() {
  14602. return (fgui.UIPackage.createObject("game", "Component89"));
  14603. }
  14604. onConstruct() {
  14605. this.c1 = this.getController("c1");
  14606. this.n71 = (this.getChild("n71"));
  14607. this.n72 = (this.getChild("n72"));
  14608. }
  14609. }
  14610. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  14611. class ui_Component90 extends fgui.GComponent {
  14612. static createInstance() {
  14613. return (fgui.UIPackage.createObject("game", "Component90"));
  14614. }
  14615. onConstruct() {
  14616. this.c1 = this.getController("c1");
  14617. this.n64 = (this.getChild("n64"));
  14618. this.n65 = (this.getChild("n65"));
  14619. this.n66 = (this.getChild("n66"));
  14620. this.t0 = this.getTransition("t0");
  14621. }
  14622. }
  14623. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  14624. class ui_Component127 extends fgui.GButton {
  14625. static createInstance() {
  14626. return (fgui.UIPackage.createObject("game", "Component127"));
  14627. }
  14628. onConstruct() {
  14629. this.n5 = (this.getChild("n5"));
  14630. }
  14631. }
  14632. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  14633. class gameBinder {
  14634. static bindAll() {
  14635. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  14636. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  14637. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  14638. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  14639. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  14640. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  14641. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  14642. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  14643. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  14644. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  14645. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  14646. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  14647. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  14648. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  14649. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  14650. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  14651. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  14652. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  14653. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  14654. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  14655. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  14656. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  14657. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  14658. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  14659. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  14660. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  14661. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  14662. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  14663. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  14664. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  14665. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  14666. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  14667. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  14668. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  14669. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  14670. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  14671. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  14672. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  14673. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  14674. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  14675. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  14676. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  14677. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  14678. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  14679. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  14680. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  14681. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  14682. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  14683. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  14684. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  14685. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  14686. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  14687. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  14688. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  14689. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  14690. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  14691. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  14692. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  14693. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  14694. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  14695. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  14696. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  14697. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  14698. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  14699. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  14700. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  14701. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  14702. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  14703. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  14704. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  14705. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  14706. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  14707. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  14708. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  14709. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  14710. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  14711. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  14712. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  14713. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  14714. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  14715. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  14716. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  14717. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  14718. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  14719. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  14720. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  14721. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  14722. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  14723. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  14724. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  14725. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  14726. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  14727. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  14728. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  14729. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  14730. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  14731. fgui.UIObjectFactory.setExtension(ui_Component9.URL, ui_Component9);
  14732. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  14733. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  14734. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  14735. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  14736. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  14737. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  14738. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  14739. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  14740. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  14741. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  14742. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  14743. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  14744. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  14745. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  14746. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  14747. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  14748. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  14749. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  14750. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  14751. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  14752. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  14753. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  14754. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  14755. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  14756. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  14757. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  14758. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  14759. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  14760. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  14761. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  14762. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  14763. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  14764. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  14765. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  14766. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  14767. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  14768. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  14769. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  14770. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  14771. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  14772. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  14773. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  14774. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  14775. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  14776. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  14777. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  14778. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  14779. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  14780. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  14781. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  14782. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  14783. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  14784. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  14785. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  14786. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  14787. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  14788. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  14789. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  14790. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  14791. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  14792. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  14793. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  14794. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  14795. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  14796. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  14797. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  14798. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  14799. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  14800. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  14801. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  14802. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  14803. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  14804. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  14805. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  14806. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  14807. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  14808. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  14809. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  14810. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  14811. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  14812. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  14813. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  14814. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  14815. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  14816. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  14817. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  14818. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  14819. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  14820. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  14821. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  14822. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  14823. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  14824. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  14825. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  14826. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  14827. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  14828. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  14829. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  14830. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  14831. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  14832. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  14833. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  14834. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  14835. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  14836. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  14837. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  14838. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  14839. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  14840. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  14841. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  14842. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  14843. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  14844. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  14845. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  14846. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  14847. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  14848. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  14849. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  14850. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  14851. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  14852. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  14853. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  14854. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  14855. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  14856. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  14857. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  14858. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  14859. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  14860. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  14861. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  14862. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  14863. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  14864. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  14865. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  14866. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  14867. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  14868. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  14869. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  14870. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  14871. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  14872. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  14873. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  14874. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  14875. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  14876. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  14877. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  14878. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  14879. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  14880. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  14881. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  14882. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  14883. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  14884. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  14885. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  14886. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  14887. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  14888. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  14889. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  14890. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  14891. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  14892. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  14893. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  14894. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  14895. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  14896. }
  14897. }
  14898. class ui_btn6 extends fgui.GButton {
  14899. static createInstance() {
  14900. return (fgui.UIPackage.createObject("loading", "btn6"));
  14901. }
  14902. onConstruct() {
  14903. this.n6 = (this.getChild("n6"));
  14904. this.n1 = (this.getChild("n1"));
  14905. }
  14906. }
  14907. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  14908. class ui_xyItem extends fgui.GComponent {
  14909. static createInstance() {
  14910. return (fgui.UIPackage.createObject("loading", "xyItem"));
  14911. }
  14912. onConstruct() {
  14913. this.xyItem = (this.getChild("xyItem"));
  14914. }
  14915. }
  14916. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  14917. class ui_loadinfo extends fgui.GProgressBar {
  14918. static createInstance() {
  14919. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  14920. }
  14921. onConstruct() {
  14922. this.bg = (this.getChild("bg"));
  14923. this.bar = (this.getChild("bar"));
  14924. this.title = (this.getChild("title"));
  14925. this.ani = (this.getChild("ani"));
  14926. }
  14927. }
  14928. ui_loadinfo.URL = "ui://37nctnhwis36c";
  14929. class ui_xyNode extends fgui.GComponent {
  14930. static createInstance() {
  14931. return (fgui.UIPackage.createObject("loading", "xyNode"));
  14932. }
  14933. onConstruct() {
  14934. this.n0 = (this.getChild("n0"));
  14935. this.btnYes = (this.getChild("btnYes"));
  14936. this.btnNo = (this.getChild("btnNo"));
  14937. this.btnKnown = (this.getChild("btnKnown"));
  14938. this.btnSure = (this.getChild("btnSure"));
  14939. this.txtWelcom = (this.getChild("txtWelcom"));
  14940. this.txtXy = (this.getChild("txtXy"));
  14941. this.n75 = (this.getChild("n75"));
  14942. this.btnXy1 = (this.getChild("btnXy1"));
  14943. this.btnXy3 = (this.getChild("btnXy3"));
  14944. this.btnXy2 = (this.getChild("btnXy2"));
  14945. this.n74 = (this.getChild("n74"));
  14946. this.xy1 = (this.getChild("xy1"));
  14947. this.txtTitle = (this.getChild("txtTitle"));
  14948. this.btnBack = (this.getChild("btnBack"));
  14949. this.xyList = (this.getChild("xyList"));
  14950. this.xy2 = (this.getChild("xy2"));
  14951. this.xyNode = (this.getChild("xyNode"));
  14952. }
  14953. }
  14954. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  14955. class ui_ageNode extends fgui.GComponent {
  14956. static createInstance() {
  14957. return (fgui.UIPackage.createObject("loading", "ageNode"));
  14958. }
  14959. onConstruct() {
  14960. this.n3 = (this.getChild("n3"));
  14961. this.n7 = (this.getChild("n7"));
  14962. this.n4 = (this.getChild("n4"));
  14963. this.btnAge = (this.getChild("btnAge"));
  14964. this.ageNode = (this.getChild("ageNode"));
  14965. }
  14966. }
  14967. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  14968. class ui_rnNode extends fgui.GComponent {
  14969. static createInstance() {
  14970. return (fgui.UIPackage.createObject("loading", "rnNode"));
  14971. }
  14972. onConstruct() {
  14973. this.n28 = (this.getChild("n28"));
  14974. this.n30 = (this.getChild("n30"));
  14975. this.n33 = (this.getChild("n33"));
  14976. this.rn1 = (this.getChild("rn1"));
  14977. this.n40 = (this.getChild("n40"));
  14978. this.n41 = (this.getChild("n41"));
  14979. this.rn3 = (this.getChild("rn3"));
  14980. this.n37 = (this.getChild("n37"));
  14981. this.n39 = (this.getChild("n39"));
  14982. this.rn2 = (this.getChild("rn2"));
  14983. this.n47 = (this.getChild("n47"));
  14984. this.n49 = (this.getChild("n49"));
  14985. this.n44 = (this.getChild("n44"));
  14986. this.inputCode = (this.getChild("inputCode"));
  14987. this.inputName = (this.getChild("inputName"));
  14988. this.n48 = (this.getChild("n48"));
  14989. this.n50 = (this.getChild("n50"));
  14990. this.rn4 = (this.getChild("rn4"));
  14991. this.btnCheck = (this.getChild("btnCheck"));
  14992. this.btnExit = (this.getChild("btnExit"));
  14993. this.btnDone = (this.getChild("btnDone"));
  14994. this.rnNode = (this.getChild("rnNode"));
  14995. }
  14996. }
  14997. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  14998. class ui_tipNode extends fgui.GComponent {
  14999. static createInstance() {
  15000. return (fgui.UIPackage.createObject("loading", "tipNode"));
  15001. }
  15002. onConstruct() {
  15003. this.bg = (this.getChild("bg"));
  15004. this.n55 = (this.getChild("n55"));
  15005. this.n56 = (this.getChild("n56"));
  15006. this.tipNode = (this.getChild("tipNode"));
  15007. }
  15008. }
  15009. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  15010. class ui_fcmNode extends fgui.GComponent {
  15011. static createInstance() {
  15012. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  15013. }
  15014. onConstruct() {
  15015. this.n63 = (this.getChild("n63"));
  15016. this.n62 = (this.getChild("n62"));
  15017. this.btnRn = (this.getChild("btnRn"));
  15018. this.n61 = (this.getChild("n61"));
  15019. this.n58 = (this.getChild("n58"));
  15020. this.fcmNode = (this.getChild("fcmNode"));
  15021. }
  15022. }
  15023. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  15024. class ui_msgNode extends fgui.GComponent {
  15025. static createInstance() {
  15026. return (fgui.UIPackage.createObject("loading", "msgNode"));
  15027. }
  15028. onConstruct() {
  15029. this.n69 = (this.getChild("n69"));
  15030. this.txtMsg = (this.getChild("txtMsg"));
  15031. this.msgNode = (this.getChild("msgNode"));
  15032. }
  15033. }
  15034. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  15035. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  15036. static createInstance() {
  15037. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  15038. }
  15039. onConstruct() {
  15040. this.n1 = (this.getChild("n1"));
  15041. this.n13 = (this.getChild("n13"));
  15042. this.n14 = (this.getChild("n14"));
  15043. this.n15 = (this.getChild("n15"));
  15044. this.n3 = (this.getChild("n3"));
  15045. this.n4 = (this.getChild("n4"));
  15046. this.n5 = (this.getChild("n5"));
  15047. this.n6 = (this.getChild("n6"));
  15048. this.n7 = (this.getChild("n7"));
  15049. this.n8 = (this.getChild("n8"));
  15050. this.n9 = (this.getChild("n9"));
  15051. this.n10 = (this.getChild("n10"));
  15052. this.n12 = (this.getChild("n12"));
  15053. this.n11 = (this.getChild("n11"));
  15054. this.n16 = (this.getChild("n16"));
  15055. this.n17 = (this.getChild("n17"));
  15056. this.n18 = (this.getChild("n18"));
  15057. this.n20 = (this.getChild("n20"));
  15058. this.n21 = (this.getChild("n21"));
  15059. this.t0 = this.getTransition("t0");
  15060. }
  15061. }
  15062. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  15063. class ui_btn5 extends fgui.GButton {
  15064. static createInstance() {
  15065. return (fgui.UIPackage.createObject("loading", "btn5"));
  15066. }
  15067. onConstruct() {
  15068. this.n9 = (this.getChild("n9"));
  15069. this.n1 = (this.getChild("n1"));
  15070. }
  15071. }
  15072. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  15073. class ui_UILoading extends fgui.GComponent {
  15074. static createInstance() {
  15075. return (fgui.UIPackage.createObject("loading", "UILoading"));
  15076. }
  15077. onConstruct() {
  15078. this.n12 = (this.getChild("n12"));
  15079. this.loadinfo = (this.getChild("loadinfo"));
  15080. this.n13 = (this.getChild("n13"));
  15081. this.txtLoad = (this.getChild("txtLoad"));
  15082. this.n18 = (this.getChild("n18"));
  15083. }
  15084. }
  15085. ui_UILoading.URL = "ui://37nctnhwphc33";
  15086. class ui_AgeItem extends fgui.GComponent {
  15087. static createInstance() {
  15088. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  15089. }
  15090. onConstruct() {
  15091. this.txtAge = (this.getChild("txtAge"));
  15092. }
  15093. }
  15094. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  15095. class ui_btn1 extends fgui.GButton {
  15096. static createInstance() {
  15097. return (fgui.UIPackage.createObject("loading", "btn1"));
  15098. }
  15099. onConstruct() {
  15100. this.n6 = (this.getChild("n6"));
  15101. this.n1 = (this.getChild("n1"));
  15102. }
  15103. }
  15104. ui_btn1.URL = "ui://37nctnhwxe622p";
  15105. class ui_btn3 extends fgui.GButton {
  15106. static createInstance() {
  15107. return (fgui.UIPackage.createObject("loading", "btn3"));
  15108. }
  15109. onConstruct() {
  15110. this.n9 = (this.getChild("n9"));
  15111. this.n1 = (this.getChild("n1"));
  15112. }
  15113. }
  15114. ui_btn3.URL = "ui://37nctnhwxe622s";
  15115. class ui_btn2 extends fgui.GButton {
  15116. static createInstance() {
  15117. return (fgui.UIPackage.createObject("loading", "btn2"));
  15118. }
  15119. onConstruct() {
  15120. this.n6 = (this.getChild("n6"));
  15121. this.n1 = (this.getChild("n1"));
  15122. }
  15123. }
  15124. ui_btn2.URL = "ui://37nctnhwxe622t";
  15125. class ui_btnBack extends fgui.GButton {
  15126. static createInstance() {
  15127. return (fgui.UIPackage.createObject("loading", "btnBack"));
  15128. }
  15129. onConstruct() {
  15130. this.n6 = (this.getChild("n6"));
  15131. this.n7 = (this.getChild("n7"));
  15132. }
  15133. }
  15134. ui_btnBack.URL = "ui://37nctnhwxe622u";
  15135. class ui_btnXy1 extends fgui.GButton {
  15136. static createInstance() {
  15137. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  15138. }
  15139. onConstruct() {
  15140. this.n1 = (this.getChild("n1"));
  15141. }
  15142. }
  15143. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  15144. class ui_btnXy2 extends fgui.GButton {
  15145. static createInstance() {
  15146. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  15147. }
  15148. onConstruct() {
  15149. this.n1 = (this.getChild("n1"));
  15150. }
  15151. }
  15152. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  15153. class ui_btnXy3 extends fgui.GButton {
  15154. static createInstance() {
  15155. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  15156. }
  15157. onConstruct() {
  15158. this.n1 = (this.getChild("n1"));
  15159. }
  15160. }
  15161. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  15162. class ui_btn4 extends fgui.GButton {
  15163. static createInstance() {
  15164. return (fgui.UIPackage.createObject("loading", "btn4"));
  15165. }
  15166. onConstruct() {
  15167. this.n9 = (this.getChild("n9"));
  15168. this.n1 = (this.getChild("n1"));
  15169. }
  15170. }
  15171. ui_btn4.URL = "ui://37nctnhwxe622z";
  15172. class loadingBinder {
  15173. static bindAll() {
  15174. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  15175. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  15176. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  15177. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  15178. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  15179. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  15180. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  15181. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  15182. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  15183. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  15184. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  15185. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  15186. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  15187. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  15188. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  15189. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  15190. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  15191. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  15192. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  15193. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  15194. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  15195. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  15196. }
  15197. }
  15198. class UIMgr {
  15199. constructor() {
  15200. this._stage = null;
  15201. this._uiList = [];
  15202. this._showList = [];
  15203. this._bindPkgList = [];
  15204. this.uiIndex = 0;
  15205. }
  15206. static get inst() {
  15207. if (UIMgr._inst == null) {
  15208. UIMgr._inst = new UIMgr();
  15209. }
  15210. return UIMgr._inst;
  15211. }
  15212. setStage(s) {
  15213. if (this._stage) {
  15214. console.log("ViewMgr::Stage->舞台不可赋值两次");
  15215. return;
  15216. }
  15217. this._stage = s;
  15218. }
  15219. clearTempData() {
  15220. console.log('zh:clearTempData start');
  15221. Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level');
  15222. console.log('zh:clearTempData end');
  15223. }
  15224. init() {
  15225. this.setStage(Laya.stage);
  15226. fairygui.UIConfig.defaultFont = "微软雅黑";
  15227. fairygui.UIConfig.modalLayerColor = "rgba(0,0,0,0.9)";
  15228. fairygui.UIConfig.packageFileExtension = "obj";
  15229. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  15230. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  15231. fairygui.GRoot.inst.width = Laya.stage.width;
  15232. fairygui.GRoot.inst.height = Laya.stage.height;
  15233. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  15234. }
  15235. addAllUpdate() {
  15236. this.uiIndex = 0;
  15237. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  15238. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  15239. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  15240. }
  15241. }
  15242. }
  15243. bindFUI(pkgname) {
  15244. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  15245. return;
  15246. }
  15247. switch (pkgname) {
  15248. case fguiRes.loading:
  15249. fairygui.UIPackage.addPackage(pkgname);
  15250. loadingBinder.bindAll();
  15251. this._bindPkgList.push(pkgname);
  15252. break;
  15253. case fguiRes.game:
  15254. fairygui.UIPackage.addPackage(pkgname);
  15255. gameBinder.bindAll();
  15256. this._bindPkgList.push(pkgname);
  15257. break;
  15258. default:
  15259. break;
  15260. }
  15261. }
  15262. Show(cls, ...param) {
  15263. let nameStr = cls.uiName;
  15264. for (let i = this._uiList.length - 1; i >= 0; i--) {
  15265. let temp = this._uiList[i];
  15266. let str = temp.className;
  15267. if (str == nameStr) {
  15268. if (temp.isMuti) {
  15269. if (temp.isHide) {
  15270. temp.show(...param);
  15271. this._uiList.splice(i, 1);
  15272. this._uiList.push(temp);
  15273. return temp;
  15274. }
  15275. }
  15276. else {
  15277. temp.show(...param);
  15278. this._uiList.splice(i, 1);
  15279. this._uiList.push(temp);
  15280. return temp;
  15281. }
  15282. }
  15283. }
  15284. let ui = new cls();
  15285. ui.className = nameStr;
  15286. this._showUI(ui, param);
  15287. return ui;
  15288. }
  15289. destroyUI(ui) {
  15290. for (let i = this._uiList.length - 1; i >= 0; i--) {
  15291. let temp = this._uiList[i].className;
  15292. if (temp == ui.className) {
  15293. this._uiList.splice(i, 1);
  15294. break;
  15295. }
  15296. }
  15297. this.checkUIState();
  15298. }
  15299. _showUI(ui, param) {
  15300. this._uiList.push(ui);
  15301. ui.show(...param);
  15302. }
  15303. Hide(uiClass) {
  15304. let ui = this.getUI(uiClass);
  15305. if (ui && !ui.isHide) {
  15306. ui.hide();
  15307. }
  15308. }
  15309. getUI(ui) {
  15310. let nameStr = ui.uiName;
  15311. for (let index = 0; index < this._uiList.length; index++) {
  15312. let temp = this._uiList[index];
  15313. if (temp.className == nameStr) {
  15314. return temp;
  15315. }
  15316. }
  15317. return null;
  15318. }
  15319. isShow(cls) {
  15320. for (var i of this._uiList) {
  15321. if (i instanceof cls) {
  15322. return i.isShowing;
  15323. }
  15324. }
  15325. return false;
  15326. }
  15327. showUINum() {
  15328. let num = 0;
  15329. for (var i of this._uiList) {
  15330. if (i.isShowing) {
  15331. num++;
  15332. }
  15333. }
  15334. return num;
  15335. }
  15336. checkUIState() {
  15337. Laya.timer.clear(this, this._uiCheck);
  15338. Laya.timer.once(400, this, this._uiCheck);
  15339. }
  15340. _uiCheck() {
  15341. let showList = [];
  15342. for (var i of this._uiList) {
  15343. if (!i.isHide) {
  15344. showList.push(i);
  15345. }
  15346. }
  15347. for (let index = 0; index < showList.length; index++) {
  15348. if (index == showList.length - 1) {
  15349. showList[index].checkActive(true);
  15350. }
  15351. else {
  15352. showList[index].checkActive(false);
  15353. }
  15354. }
  15355. }
  15356. showTip(msg, time = 600, size = 30) {
  15357. }
  15358. }
  15359. class UIShowList {
  15360. }
  15361. class SoundMgr {
  15362. constructor() {
  15363. this.soundMax = 4;
  15364. this.isLoad = false;
  15365. this.soundMap = {};
  15366. this.isSound = true;
  15367. this.openShake = true;
  15368. SoundMgr._instance = this;
  15369. }
  15370. static getInstance() {
  15371. if (!this._instance) {
  15372. this._instance = new SoundMgr();
  15373. }
  15374. return this._instance;
  15375. }
  15376. init() {
  15377. console.log('zh:sm init 1');
  15378. Laya.SoundManager.autoReleaseSound = true;
  15379. Laya.SoundManager.autoStopMusic = true;
  15380. Laya.SoundManager.musicVolume = 0.3;
  15381. Laya.SoundManager.soundVolume = 0.5;
  15382. this.musicPlayed = false;
  15383. this.audioUrl = "asset/sound/ogg/";
  15384. console.log('zh:sm init 2');
  15385. console.log('zh:dev type ');
  15386. if (Laya.Browser.onAndroid) {
  15387. console.log('zh:dev type android');
  15388. this.audioUrl = "asset/sound/ogg/";
  15389. this.isLoad = true;
  15390. }
  15391. else {
  15392. console.log('zh:dev type not android');
  15393. this.audioUrl = "asset/sound/mp3/";
  15394. this.isLoad = true;
  15395. }
  15396. }
  15397. onSetting(isS) {
  15398. this.isSound = isS;
  15399. this.mute(!this.isSound);
  15400. }
  15401. clearCount() {
  15402. for (var key in this.soundMap) {
  15403. delete this.soundMap[key];
  15404. }
  15405. }
  15406. playMusic(path, loop = 0) {
  15407. console.log('zh:playMusic 1 PATH=' + path);
  15408. this.musicPath = path;
  15409. if (!this.isLoad)
  15410. console.log('zh:playMusic 2');
  15411. return;
  15412. if (!path || path == "")
  15413. console.log('zh:playMusic 3');
  15414. return;
  15415. if (!this.isSound)
  15416. console.log('zh:playMusic 4');
  15417. return;
  15418. this.musicPlayed = true;
  15419. console.log('zh:playMusic 5');
  15420. let url = this.getUrl(path);
  15421. console.log('zh:playMusic 6' + url);
  15422. if (Laya.Browser.onPC) {
  15423. console.log('zh:playMusic 7');
  15424. Laya.loader.load(url, Laya.Handler.create(this, () => {
  15425. console.log('zh:playMusic 8');
  15426. this.play(url, loop);
  15427. }));
  15428. }
  15429. else
  15430. this.play(url, loop);
  15431. }
  15432. play(url, loop) {
  15433. Laya.SoundManager.playMusic(url, loop);
  15434. }
  15435. getUrl(path) {
  15436. let url = this.audioUrl + path;
  15437. if (Laya.Browser.onAndroid) {
  15438. url += ".ogg";
  15439. }
  15440. else {
  15441. url += ".mp3";
  15442. }
  15443. return url;
  15444. }
  15445. pauseMusic(pause) {
  15446. if (pause) {
  15447. this.mute(true);
  15448. }
  15449. else if (this.isSound)
  15450. this.mute(false);
  15451. }
  15452. stopMusic() {
  15453. Laya.SoundManager.stopMusic();
  15454. if (Moyu.isNeedPlatAudio) {
  15455. Moyu.stopMusic();
  15456. }
  15457. }
  15458. mute(mute) {
  15459. if (Moyu.isNeedPlatAudio) {
  15460. Moyu.pauseMusic(mute);
  15461. }
  15462. else {
  15463. Laya.SoundManager.musicMuted = mute;
  15464. if (!mute && !this.musicPlayed && this.musicPath) {
  15465. this.playMusic(this.musicPath);
  15466. }
  15467. }
  15468. }
  15469. stopSound(path) {
  15470. let url = this.getUrl(path);
  15471. Laya.SoundManager.stopSound(url);
  15472. }
  15473. playSound(path, loop = 1, soundMax = this.soundMax) {
  15474. if (!this.isLoad)
  15475. return;
  15476. if (!this.isSound)
  15477. return;
  15478. if (!path || path == "")
  15479. return;
  15480. let url = this.getUrl(path);
  15481. if (Moyu.isNeedPlatAudio) {
  15482. Moyu.playSound(path, loop == 0);
  15483. }
  15484. else {
  15485. let count = 1;
  15486. if (this.soundMap[path])
  15487. count = this.soundMap[path] + 1;
  15488. if (count > soundMax)
  15489. return;
  15490. this.soundMap[path] = count;
  15491. Laya.SoundManager.playSound(url, loop);
  15492. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  15493. }
  15494. }
  15495. removePath(path) {
  15496. if (this.soundMap[path]) {
  15497. let count = this.soundMap[path];
  15498. count--;
  15499. if (count < 1)
  15500. delete this.soundMap[path];
  15501. else
  15502. this.soundMap[path] = count;
  15503. }
  15504. }
  15505. playBtnSound() {
  15506. this.playSound("btn");
  15507. }
  15508. playGetSound() {
  15509. }
  15510. playCloseUISound() {
  15511. }
  15512. }
  15513. SoundMgr._instance = null;
  15514. var Handler$1 = Laya.Handler;
  15515. var EResType;
  15516. (function (EResType) {
  15517. EResType[EResType["none"] = 0] = "none";
  15518. EResType[EResType["nromal"] = 1] = "nromal";
  15519. EResType[EResType["td"] = 2] = "td";
  15520. EResType[EResType["sk"] = 3] = "sk";
  15521. })(EResType || (EResType = {}));
  15522. class CResLoader {
  15523. constructor(doneCall, proCall) {
  15524. this.completrCall = doneCall;
  15525. this.progressCall = proCall;
  15526. this.progressHander = new Handler$1(this, this.onProgress);
  15527. this.tdResMap = {};
  15528. }
  15529. load(resList) {
  15530. this.resCount = 0;
  15531. this.loadCount = 0;
  15532. for (let i = 0; i < resList.length; i++) {
  15533. let path = resList[i];
  15534. if (!path)
  15535. continue;
  15536. this.resCount++;
  15537. let type = this.getResType(path);
  15538. if (type == EResType.nromal)
  15539. this.loadNromal(path);
  15540. else if (type == EResType.td)
  15541. this.loadTd(path);
  15542. }
  15543. }
  15544. getRes(path) {
  15545. let type = this.getResType(path);
  15546. if (type == EResType.nromal)
  15547. return Laya.loader.getRes(path);
  15548. else if (type == EResType.td) {
  15549. let res = this.tdResMap[path];
  15550. if (res)
  15551. return res.clone();
  15552. return null;
  15553. }
  15554. }
  15555. destroy() {
  15556. this.progressHander.clear();
  15557. this.progressHander = null;
  15558. }
  15559. clearRes(path) {
  15560. let type = this.getResType(path);
  15561. if (type == EResType.nromal)
  15562. Laya.loader.clearRes(path);
  15563. else if (type == EResType.td) {
  15564. let obj = this.tdResMap[path];
  15565. if (obj)
  15566. obj.destroy();
  15567. delete this.tdResMap[path];
  15568. }
  15569. }
  15570. getResType(path) {
  15571. let exs = this.getExtension(path);
  15572. if (exs == "sk")
  15573. return EResType.sk;
  15574. if (exs == "ls" || exs == "lh" || exs == "lm")
  15575. return EResType.td;
  15576. else
  15577. return EResType.nromal;
  15578. }
  15579. getExtension(res) {
  15580. var index = res.lastIndexOf(".");
  15581. return res.substr(index + 1);
  15582. }
  15583. loadNromal(path) {
  15584. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  15585. if (res) {
  15586. this.onLoad();
  15587. }
  15588. else
  15589. console.log("load res fail:" + path);
  15590. }), this.progressHander);
  15591. }
  15592. loadSk() {
  15593. }
  15594. loadTd(path) {
  15595. if (this.tdResMap[path]) {
  15596. this.onLoad();
  15597. return;
  15598. }
  15599. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  15600. if (res) {
  15601. this.tdResMap[path] = res;
  15602. this.onLoad();
  15603. }
  15604. else
  15605. console.log("load res fail:" + path);
  15606. }));
  15607. }
  15608. onLoad() {
  15609. this.loadCount++;
  15610. this.onProgress(1);
  15611. if (this.loadCount >= this.resCount) {
  15612. this.completrCall.run();
  15613. }
  15614. }
  15615. onProgress(pro) {
  15616. let progress = (this.loadCount + pro) / this.resCount;
  15617. this.progressCall.runWith(progress);
  15618. }
  15619. }
  15620. var Handler$2 = Laya.Handler;
  15621. class ResInfo {
  15622. constructor() {
  15623. this.index = 0;
  15624. }
  15625. }
  15626. class ResMgr {
  15627. constructor() {
  15628. this.resList = [];
  15629. this.doneList = [];
  15630. this.resMap = {};
  15631. this.currentLoad = null;
  15632. this.completeHandler = new Handler$2(this, this.onComplete);
  15633. this.progressHandler = new Handler$2(this, this.onProgress);
  15634. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  15635. }
  15636. static getInstance() {
  15637. if (ResMgr._instance == null) {
  15638. ResMgr._instance = new ResMgr();
  15639. }
  15640. return ResMgr._instance;
  15641. }
  15642. loadList(list, completeHandler, progressHandler) {
  15643. if (list.length < 1) {
  15644. completeHandler.run();
  15645. return;
  15646. }
  15647. let info = this.getResInfo();
  15648. info.resList = list;
  15649. info.completeHandler = completeHandler;
  15650. info.progressHandler = progressHandler;
  15651. this.resList.push(info);
  15652. this.startLoad();
  15653. }
  15654. loadFguiRes(list, completeHandler, progressHandler) {
  15655. Laya.loader.load(list, completeHandler, progressHandler);
  15656. }
  15657. loadAny(list, completeHandler, progressHandler) {
  15658. Laya.loader.load(list, completeHandler, progressHandler);
  15659. }
  15660. load(path, completeHandler, progressHandler) {
  15661. let count = this.resMap[path];
  15662. if (count && count > 0) {
  15663. if (completeHandler)
  15664. completeHandler.run();
  15665. }
  15666. else
  15667. this.loadList([path], completeHandler, progressHandler);
  15668. }
  15669. getRes(path) {
  15670. let res = this.resMap[path];
  15671. if (!res)
  15672. this.showLog("资源不存在:" + path);
  15673. else
  15674. return this.loader.getRes(path);
  15675. }
  15676. clearList(list, force = false) {
  15677. if (!list || list.length < 1)
  15678. return;
  15679. let cr = () => {
  15680. for (const k in list) {
  15681. let v = list[k];
  15682. if (!v)
  15683. continue;
  15684. if (force) {
  15685. this.loader.clearRes(v);
  15686. delete this.resMap[v];
  15687. }
  15688. else {
  15689. let count = this.resMap[v];
  15690. if (count && count > 1) {
  15691. count--;
  15692. this.resMap[v] = count;
  15693. }
  15694. else {
  15695. this.loader.clearRes(v);
  15696. delete this.resMap[v];
  15697. }
  15698. }
  15699. }
  15700. if (!window.hasOwnProperty("ks"))
  15701. Laya.Resource.destroyUnusedResources();
  15702. };
  15703. Laya.timer.clearAll(this);
  15704. Laya.timer.once(2000, this, cr);
  15705. }
  15706. clear3D() {
  15707. for (const k in this.loader.tdResMap) {
  15708. this.loader.clearRes(k);
  15709. if (this.resMap[k])
  15710. delete this.resMap[k];
  15711. }
  15712. if (!window.hasOwnProperty("ks"))
  15713. Laya.Resource.destroyUnusedResources();
  15714. }
  15715. clear(path, force = false) {
  15716. this.clearList([path], force);
  15717. }
  15718. getResInfo() {
  15719. if (this.doneList.length > 0)
  15720. return this.doneList.pop();
  15721. else
  15722. return new ResInfo();
  15723. }
  15724. startLoad() {
  15725. if (this.currentLoad)
  15726. return;
  15727. this.currentLoad = this.resList.pop();
  15728. if (this.currentLoad) {
  15729. this.loader.load(this.currentLoad.resList);
  15730. }
  15731. }
  15732. onComplete() {
  15733. if (!this.currentLoad)
  15734. return;
  15735. for (const k in this.currentLoad.resList) {
  15736. let v = this.currentLoad.resList[k];
  15737. let count = this.resMap[v];
  15738. if (count)
  15739. count++;
  15740. else
  15741. count = 1;
  15742. this.resMap[v] = count;
  15743. }
  15744. if (this.currentLoad.completeHandler)
  15745. this.currentLoad.completeHandler.run();
  15746. this.doneList.push(this.currentLoad);
  15747. this.currentLoad = null;
  15748. this.startLoad();
  15749. }
  15750. onProgress(pro) {
  15751. if (!this.currentLoad)
  15752. return;
  15753. if (this.currentLoad.progressHandler)
  15754. this.currentLoad.progressHandler.runWith(pro);
  15755. }
  15756. showLog(str, ...args) {
  15757. console.log("[ResLoader] " + str);
  15758. }
  15759. }
  15760. ResMgr._instance = null;
  15761. class EventMgr extends Laya.EventDispatcher {
  15762. }
  15763. let eventMgr = new EventMgr();
  15764. class ConfigMgr {
  15765. static getInstance() {
  15766. if (!this._instance) {
  15767. this._instance = new ConfigMgr();
  15768. }
  15769. return this._instance;
  15770. }
  15771. init() {
  15772. this.npcJson = Laya.loader.getRes("res/json/npc.json").Data;
  15773. this.classicCfg = Laya.loader.getRes("res/json/classicCfg.json");
  15774. this.levelCfg = Laya.loader.getRes("res/json/levelCfg.json");
  15775. this.placeBallCfg = Laya.loader.getRes("res/json/placeBallCfg.json");
  15776. }
  15777. getUserInfoByIndex(index) {
  15778. return this.npcJson[index];
  15779. }
  15780. getRandomUserInfo() {
  15781. let index = xGame.tools.random(0, this.npcJson.length);
  15782. return this.npcJson[index];
  15783. }
  15784. getMaxBigMoveLength() {
  15785. return Object.keys(this.levelCfg).length;
  15786. }
  15787. getBigMoveLevelByIndex(index) {
  15788. let cfg = this.levelCfg;
  15789. cfg = cfg[index];
  15790. return cfg;
  15791. }
  15792. getRandomClassicLevel() {
  15793. let cfg = this.classicCfg;
  15794. let num = Object.keys(cfg).length;
  15795. let rand = xGame.common.randomNum(1, num);
  15796. return cfg[rand];
  15797. }
  15798. getPlaceBallByLevel(level) {
  15799. return this.placeBallCfg[level];
  15800. }
  15801. getMaxPlaceBall() {
  15802. return Object.keys(this.placeBallCfg).length;
  15803. }
  15804. }
  15805. class PoolD3Mgr {
  15806. constructor() {
  15807. this.pool = {};
  15808. }
  15809. static get ins() {
  15810. return this._ins || (this._ins = new PoolD3Mgr);
  15811. }
  15812. createList(key, prefab, parent) {
  15813. if (!this.pool[key]) {
  15814. this.pool[key] = {};
  15815. this.pool[key].prefab = prefab;
  15816. this.pool[key].list = [];
  15817. this.pool[key].parent = parent;
  15818. }
  15819. }
  15820. getItem(key) {
  15821. if (!this.pool[key]) {
  15822. return;
  15823. }
  15824. let temp;
  15825. if (this.pool[key].list.length > 0) {
  15826. temp = this.pool[key].list.pop();
  15827. }
  15828. else {
  15829. temp = this.pool[key].prefab.clone();
  15830. if (this.pool[key].parent) {
  15831. this.pool[key].parent.addChild(temp);
  15832. }
  15833. }
  15834. temp.active = true;
  15835. return temp;
  15836. }
  15837. putItem(key, obj) {
  15838. if (!this.pool[key]) {
  15839. return;
  15840. }
  15841. obj.active = false;
  15842. this.pool[key].list.push(obj);
  15843. }
  15844. }
  15845. let context$1 = context;
  15846. let uiMgr = UIMgr.inst;
  15847. let soundMgr = SoundMgr.getInstance();
  15848. let resMgr = ResMgr.getInstance();
  15849. let httpMgr = HttpMgr.getInstance();
  15850. let common = Common.getInstance();
  15851. let cfgMgr = ConfigMgr.getInstance();
  15852. let poolD3Mgr = PoolD3Mgr.ins;
  15853. let d3TexUrl = "res/d3Res/";
  15854. let d3ModeUrl = "res/unityRes/";
  15855. function setStageSize(view) {
  15856. if (view.width) {
  15857. view.width = Laya.stage.width;
  15858. view.height = Laya.stage.height;
  15859. }
  15860. }
  15861. function filledBg(view) {
  15862. let wh = Laya.stage.height / Laya.stage.width;
  15863. if (wh > 16 / 9) {
  15864. view.height = Laya.stage.height;
  15865. view.width = Laya.stage.height / 1334 * 750;
  15866. }
  15867. else {
  15868. view.width = Laya.stage.width;
  15869. view.height = Laya.stage.width / 750 * 1334;
  15870. }
  15871. }
  15872. function setNotch(view) {
  15873. if (view.height) {
  15874. view.y += context$1.notchHeight;
  15875. }
  15876. }
  15877. function showTip(str) {
  15878. uiMgr.Show(UIMsg, str);
  15879. }
  15880. function log(...args) {
  15881. console.log(args);
  15882. }
  15883. let xGame = {
  15884. context: context$1,
  15885. eventMgr,
  15886. resMgr,
  15887. uiMgr,
  15888. soundMgr,
  15889. define,
  15890. tools,
  15891. httpMgr,
  15892. d3TexUrl,
  15893. d3ModeUrl,
  15894. common,
  15895. cfgMgr,
  15896. poolD3Mgr,
  15897. setStageSize,
  15898. filledBg,
  15899. setNotch,
  15900. showTip,
  15901. log,
  15902. };
  15903. window["xGame"] = xGame;
  15904. let dataName = 'tBall_';
  15905. class UserData {
  15906. constructor() {
  15907. this.userId = "";
  15908. this.isAgree = false;
  15909. this.coinNum = 0;
  15910. this.gemNum = 0;
  15911. this.sound = true;
  15912. this.vibration = true;
  15913. this.currentDate = 0;
  15914. this.createTime = 0;
  15915. this.awardTime = 0;
  15916. this.roleId = 1;
  15917. this.roleList = [];
  15918. this.roleAds = [];
  15919. this.dressId = 101;
  15920. this.itemId = 201;
  15921. this.bigSkills = [1, 1, 1, 1, 1];
  15922. this.coin = 4000;
  15923. this.diamond = 0;
  15924. this.skillSuccessTimes = 0;
  15925. this.skillGuide = 0;
  15926. this.skillAccTimes = 0;
  15927. this.placeBallData = [];
  15928. this.shareDiamondTimes = 0;
  15929. this.dailyVideoShareTimes = 0;
  15930. this.secretary = [1, 0];
  15931. this.curSecretary = 0;
  15932. this.ballRod = [1, 0, 0, 0, 0, 1];
  15933. this.curBallRod = 5;
  15934. this.signData = 0;
  15935. this.signTime = 0;
  15936. this.drawTimes = 0;
  15937. this.drawAwardTimes = 0;
  15938. this.dailyfreeDrawTimes = 1;
  15939. this.power = 5;
  15940. this.powerTime = 0;
  15941. this.challengeTimes = 0;
  15942. this.extraSign = 0;
  15943. this.classicTimes = 0;
  15944. this.guideHelpLine = 0;
  15945. this.newUser = true;
  15946. this.rootBallFoul = 0;
  15947. this.timeoutFoul = 0;
  15948. this.roleList = [1];
  15949. }
  15950. saveData() {
  15951. let data = {};
  15952. for (let k in this) {
  15953. data[k.toString()] = this[k];
  15954. }
  15955. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  15956. }
  15957. getData() {
  15958. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  15959. if (ld) {
  15960. let localData = JSON.parse(ld);
  15961. if (localData) {
  15962. for (let k in this) {
  15963. let key = k.toString();
  15964. let data = localData[key];
  15965. if (data != undefined) {
  15966. this[k] = data;
  15967. }
  15968. }
  15969. }
  15970. }
  15971. }
  15972. }
  15973. class ItemData {
  15974. constructor() {
  15975. this.itemList = {};
  15976. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  15977. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  15978. }
  15979. saveData() {
  15980. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  15981. }
  15982. getData() {
  15983. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  15984. if (ld) {
  15985. let localData = JSON.parse(ld);
  15986. if (localData) {
  15987. this.itemList = localData;
  15988. }
  15989. }
  15990. }
  15991. }
  15992. class GameData {
  15993. constructor() {
  15994. this.curLevel = 0;
  15995. this.gameType = 1;
  15996. this.signIdx = 0;
  15997. this.signMax = 0;
  15998. this.rotaryTime = 0;
  15999. this.rotaryCount = 0;
  16000. this.rotaryList = [];
  16001. this.diyCount = 3;
  16002. this.awardIdx = 0;
  16003. this.shareNum = 2;
  16004. this.rankWeek = 0;
  16005. this.rankScore = 0;
  16006. this.gameCount = 0;
  16007. this.trySkill = -1;
  16008. this.tryTime = 0;
  16009. }
  16010. saveData() {
  16011. let data = {};
  16012. for (let k in this) {
  16013. data[k.toString()] = this[k];
  16014. }
  16015. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  16016. }
  16017. getData() {
  16018. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  16019. if (ld) {
  16020. let localData = JSON.parse(ld);
  16021. if (localData) {
  16022. for (let k in this) {
  16023. let key = k.toString();
  16024. let data = localData[key];
  16025. if (data != undefined) {
  16026. this[k] = data;
  16027. }
  16028. }
  16029. }
  16030. }
  16031. }
  16032. }
  16033. class DataMgr {
  16034. static Init() {
  16035. this.userData = new UserData();
  16036. this.gameData = new GameData();
  16037. this.itemData = new ItemData();
  16038. this.userData.getData();
  16039. this.gameData.getData();
  16040. this.itemData.getData();
  16041. this.roleId = this.userData.roleId;
  16042. this.resetUse();
  16043. }
  16044. static isNewDay() {
  16045. Moyu.isNewDay(this, (isnew) => {
  16046. xGame.common.isNewDay = isnew;
  16047. if (!isnew)
  16048. return;
  16049. DataMgr.setShareDiamondTimes(0, false);
  16050. DataMgr.setDailyVideoShareTimes(0, false);
  16051. DataMgr.setDailyfreeDrawTimes(1);
  16052. DataMgr.setExtraSign(0);
  16053. });
  16054. }
  16055. static deletData() {
  16056. Laya.LocalStorage.clear();
  16057. }
  16058. static upRankData() {
  16059. let num = xGame.common.getAllStarNum();
  16060. if (num > 0)
  16061. Moyu.upRankData(xGame.common.curRankID, num);
  16062. }
  16063. static addItem(id, count = 1) {
  16064. let v = this.itemData.itemList[id];
  16065. if (!v)
  16066. v = { id: id, count: count, adnum: 0, active: true };
  16067. else {
  16068. if (v.active) {
  16069. v.count += count;
  16070. }
  16071. else {
  16072. v.count = count;
  16073. v.active = true;
  16074. }
  16075. }
  16076. this.itemData.itemList[id] = v;
  16077. xGame.soundMgr.playGetSound();
  16078. this.saveItemData();
  16079. }
  16080. static hasItem(id) {
  16081. let v = this.itemData.itemList[id];
  16082. if (v && v.active)
  16083. return true;
  16084. return false;
  16085. }
  16086. static getItem(id) {
  16087. let v = this.itemData.itemList[id];
  16088. return v;
  16089. }
  16090. static getItemCount(id) {
  16091. let v = this.itemData.itemList[id];
  16092. if (v && v.active)
  16093. return v.count;
  16094. return 0;
  16095. }
  16096. static getItemAd(id) {
  16097. let v = this.itemData.itemList[id];
  16098. if (v) {
  16099. return v.adnum;
  16100. }
  16101. return 0;
  16102. }
  16103. static onItemAd(id, num = 1) {
  16104. let v = this.itemData.itemList[id];
  16105. if (!v)
  16106. v = { id: id, count: 1, adnum: num, active: false };
  16107. else
  16108. v.adnum += num;
  16109. this.itemData.itemList[id] = v;
  16110. this.saveItemData();
  16111. }
  16112. static costItem(id, count) {
  16113. let v = this.itemData.itemList[id];
  16114. if (v && v.active) {
  16115. if (v.count < count)
  16116. return false;
  16117. else {
  16118. v.count -= count;
  16119. this.itemData.itemList[id] = v;
  16120. return true;
  16121. }
  16122. }
  16123. return false;
  16124. }
  16125. static resetUse() {
  16126. this.dressId = this.userData.dressId;
  16127. this.itemId = this.userData.itemId;
  16128. }
  16129. static passLevel() {
  16130. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  16131. this.gameData.curLevel++;
  16132. this.curLevel = this.gameData.curLevel;
  16133. this.saveGameData();
  16134. }
  16135. static useRole(id) {
  16136. this.roleId = id;
  16137. if (this.hasRole(id)) {
  16138. this.userData.roleId = id;
  16139. this.saveUserData();
  16140. }
  16141. }
  16142. static addRole(id) {
  16143. if (this.hasRole(id))
  16144. return;
  16145. this.userData.roleList.push(id);
  16146. this.saveUserData();
  16147. }
  16148. static hasRole(id) {
  16149. return this.userData.roleList.indexOf(id) >= 0;
  16150. }
  16151. static gemEnough(num) {
  16152. return this.userData.gemNum >= num;
  16153. }
  16154. static roleHasAd(id) {
  16155. let count = this.userData.roleAds[id];
  16156. if (count != undefined && count >= 0)
  16157. return true;
  16158. else
  16159. return false;
  16160. }
  16161. static saveUserData(time = 1000, event, arg) {
  16162. if (this.userSaving)
  16163. return;
  16164. this.userSaving = true;
  16165. Laya.timer.once(time, this, () => {
  16166. this.userSaving = false;
  16167. this.userData.saveData();
  16168. if (event)
  16169. xGame.eventMgr.event(event, arg);
  16170. });
  16171. }
  16172. static saveGameData() {
  16173. if (this.gameSaving)
  16174. return;
  16175. this.gameSaving = true;
  16176. Laya.timer.once(1000, this, () => {
  16177. this.gameSaving = false;
  16178. this.gameData.saveData();
  16179. });
  16180. }
  16181. static saveItemData() {
  16182. let fun = () => {
  16183. this.itemData.saveData();
  16184. };
  16185. Laya.timer.clear(this, fun);
  16186. Laya.timer.once(500, this, fun);
  16187. }
  16188. static saveData() {
  16189. this.saveUserData();
  16190. this.saveGameData();
  16191. }
  16192. static getBigSkillList() {
  16193. return this.userData.bigSkills;
  16194. }
  16195. static getBigSkillByIndex(index) {
  16196. return this.userData.bigSkills[index];
  16197. }
  16198. static setBigSkill(index, val, addUp = true) {
  16199. if (addUp) {
  16200. this.userData.bigSkills[index] += val;
  16201. }
  16202. else {
  16203. this.userData.bigSkills[index] = val;
  16204. }
  16205. this.saveUserData();
  16206. }
  16207. static coinEnough(need) {
  16208. if (typeof need != "number") {
  16209. console.error("金币格式错误");
  16210. return;
  16211. }
  16212. return this.userData.coin >= need;
  16213. }
  16214. static setCoin(val) {
  16215. if (typeof val != "number") {
  16216. return;
  16217. }
  16218. this.userData.coin += val;
  16219. this.saveUserData();
  16220. xGame.eventMgr.event(COIN_CHANGE);
  16221. }
  16222. static getCoin() {
  16223. return this.userData.coin;
  16224. }
  16225. static diamondEnough(need) {
  16226. if (typeof need != "number") {
  16227. console.error("金币格式错误");
  16228. return;
  16229. }
  16230. return this.userData.diamond >= need;
  16231. }
  16232. static setDiamond(val) {
  16233. if (typeof val != "number") {
  16234. return;
  16235. }
  16236. this.userData.diamond += val;
  16237. this.saveUserData();
  16238. xGame.eventMgr.event(DIAMOND_CHANGE);
  16239. }
  16240. static getDiamond() {
  16241. return this.userData.diamond;
  16242. }
  16243. static getSkillSuccessTimes() {
  16244. return this.userData.skillSuccessTimes;
  16245. }
  16246. static setSkillSuccessTimes(val, addUp = true) {
  16247. if (addUp)
  16248. this.userData.skillSuccessTimes += val;
  16249. else
  16250. this.userData.skillSuccessTimes = val;
  16251. this.saveUserData();
  16252. }
  16253. static getSkillAccTimes() {
  16254. return this.userData.skillAccTimes;
  16255. }
  16256. static setSkillAccTimes(val) {
  16257. this.userData.skillAccTimes += val;
  16258. this.saveUserData();
  16259. }
  16260. static getSkillGuide() {
  16261. if (!xGame.common.openGuide) {
  16262. return 1;
  16263. }
  16264. return this.userData.skillGuide;
  16265. }
  16266. static setSkillGuide(val) {
  16267. this.userData.skillGuide = val;
  16268. this.saveUserData();
  16269. }
  16270. static getPlaceBallLevelList() {
  16271. return this.userData.placeBallData;
  16272. }
  16273. static getPlaceBallLevel(level) {
  16274. let arr = this.userData.placeBallData;
  16275. let index = level - 1;
  16276. let out;
  16277. if (arr[index]) {
  16278. out = arr[index];
  16279. }
  16280. else {
  16281. let max = arr.length;
  16282. if (max == index) {
  16283. out = {
  16284. star: 0,
  16285. play: true,
  16286. isCur: true,
  16287. getAward: false
  16288. };
  16289. }
  16290. else {
  16291. out = {
  16292. star: 0,
  16293. play: false,
  16294. getAward: false
  16295. };
  16296. }
  16297. }
  16298. return out;
  16299. }
  16300. static setPlaceBallLevel(level, star) {
  16301. let arr = this.userData.placeBallData;
  16302. let index = level - 1;
  16303. if (arr[index]) {
  16304. arr[index].star = Math.max(arr[index].star, star);
  16305. }
  16306. else {
  16307. let max = arr.length;
  16308. if (max == index) {
  16309. arr.push({
  16310. star: star,
  16311. play: true,
  16312. getAward: false
  16313. });
  16314. }
  16315. else {
  16316. console.error("关卡存储出错");
  16317. }
  16318. }
  16319. this.saveUserData();
  16320. }
  16321. static setPlaceBallAward(level) {
  16322. let arr = this.userData.placeBallData;
  16323. let index = level - 1;
  16324. if (arr[index]) {
  16325. arr[index].getAward = true;
  16326. }
  16327. this.saveUserData();
  16328. }
  16329. static getShareDiamondTimes() {
  16330. return this.userData.shareDiamondTimes;
  16331. }
  16332. static setShareDiamondTimes(val, addUp = true) {
  16333. if (addUp) {
  16334. this.userData.shareDiamondTimes += val;
  16335. }
  16336. else {
  16337. this.userData.shareDiamondTimes = val;
  16338. }
  16339. this.saveUserData();
  16340. }
  16341. static getDailyVideoShareTimes() {
  16342. return this.userData.dailyVideoShareTimes;
  16343. }
  16344. static setDailyVideoShareTimes(val, addUp = true) {
  16345. if (addUp) {
  16346. this.userData.dailyVideoShareTimes += val;
  16347. }
  16348. else {
  16349. this.userData.dailyVideoShareTimes = val;
  16350. }
  16351. this.saveUserData();
  16352. }
  16353. static getSecretary(index) {
  16354. return this.userData.secretary[index];
  16355. }
  16356. static setSecretary(index, val) {
  16357. this.userData.secretary[index] = val;
  16358. this.saveUserData();
  16359. }
  16360. static getCurSecretary() {
  16361. return this.userData.curSecretary;
  16362. }
  16363. static setCurSecretary(index) {
  16364. this.userData.curSecretary = index;
  16365. this.saveUserData();
  16366. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  16367. }
  16368. static getBallRod(index) {
  16369. return this.userData.ballRod[index];
  16370. }
  16371. static setBallRod(index, val) {
  16372. this.userData.ballRod[index] = val;
  16373. this.saveUserData();
  16374. }
  16375. static getCurBallRod() {
  16376. return this.userData.curBallRod;
  16377. }
  16378. static setCurBallRod(index) {
  16379. this.userData.curBallRod = index;
  16380. this.saveUserData();
  16381. }
  16382. static setSignData(val) {
  16383. this.userData.signData = val;
  16384. this.saveUserData();
  16385. }
  16386. static getSignData() {
  16387. return this.userData.signData;
  16388. }
  16389. static setSignTime(val) {
  16390. this.userData.signTime = val;
  16391. this.saveUserData();
  16392. }
  16393. static getSignTime() {
  16394. return this.userData.signTime;
  16395. }
  16396. static getDrawTimes() {
  16397. return this.userData.drawTimes;
  16398. }
  16399. static setDrawTimes(val, addUp = true) {
  16400. if (addUp) {
  16401. this.userData.drawTimes += val;
  16402. }
  16403. else {
  16404. this.userData.drawTimes = val;
  16405. }
  16406. this.saveUserData();
  16407. }
  16408. static getDrawAwardTimes() {
  16409. return this.userData.drawAwardTimes;
  16410. }
  16411. static setDrawAwardTimes(val) {
  16412. this.userData.drawAwardTimes = val;
  16413. this.saveUserData();
  16414. }
  16415. static getDailyfreeDrawTimes() {
  16416. return this.userData.dailyfreeDrawTimes;
  16417. }
  16418. static setDailyfreeDrawTimes(val) {
  16419. this.userData.dailyfreeDrawTimes = val;
  16420. this.saveUserData();
  16421. }
  16422. static setPower(val, addUp = true) {
  16423. if (addUp)
  16424. this.userData.power += val;
  16425. else
  16426. this.userData.power = val;
  16427. if (this.userData.power >= xGame.common.maxPower) {
  16428. this.userData.power = xGame.common.maxPower;
  16429. }
  16430. xGame.eventMgr.event(POWER_CHANGE, val);
  16431. this.saveUserData();
  16432. }
  16433. static getPower() {
  16434. return this.userData.power;
  16435. }
  16436. static setPowerTime(val) {
  16437. this.userData.powerTime = val;
  16438. this.saveUserData();
  16439. }
  16440. static getPowerTime() {
  16441. return this.userData.powerTime;
  16442. }
  16443. static powerEnough() {
  16444. return this.getPower() > 0;
  16445. }
  16446. static getChallengeTimes() {
  16447. return this.userData.challengeTimes;
  16448. }
  16449. static setChallengeTimes(val) {
  16450. this.userData.challengeTimes += val;
  16451. this.saveUserData();
  16452. }
  16453. static getExtraSign() {
  16454. return this.userData.extraSign;
  16455. }
  16456. static setExtraSign(val) {
  16457. this.userData.extraSign = val;
  16458. this.saveUserData();
  16459. }
  16460. static getClassicTimes() {
  16461. return this.userData.classicTimes;
  16462. }
  16463. static setClassicTimes() {
  16464. this.userData.classicTimes += 1;
  16465. this.saveUserData();
  16466. }
  16467. static getGuideHelpLine() {
  16468. return this.userData.guideHelpLine;
  16469. }
  16470. static setGuideHelpLine() {
  16471. this.userData.guideHelpLine = 1;
  16472. this.saveUserData();
  16473. }
  16474. static getNewUser() {
  16475. return this.userData.newUser;
  16476. }
  16477. static setNewUser() {
  16478. this.userData.newUser = false;
  16479. this.saveUserData();
  16480. }
  16481. static getRootBallFoul() {
  16482. return this.userData.rootBallFoul;
  16483. }
  16484. static setRootBallFoul() {
  16485. this.userData.rootBallFoul = 1;
  16486. this.saveUserData();
  16487. }
  16488. static getTimeoutFoul() {
  16489. return this.userData.timeoutFoul;
  16490. }
  16491. static setTimeoutFoul() {
  16492. this.userData.timeoutFoul = 1;
  16493. this.saveUserData();
  16494. }
  16495. }
  16496. DataMgr.isNewUser = false;
  16497. DataMgr.fristEnter = true;
  16498. DataMgr.levelType = 0;
  16499. DataMgr.awardId = 0;
  16500. DataMgr.awardCoin = 0;
  16501. DataMgr.sceneId = -1;
  16502. DataMgr.tryId = 0;
  16503. DataMgr.curLevel = 1;
  16504. DataMgr.vipLevel = 0;
  16505. DataMgr.maxLevel = 0;
  16506. DataMgr.awardRatio = 1;
  16507. DataMgr.gameList = [];
  16508. DataMgr.rankList = [];
  16509. DataMgr.recoverTime = 480000;
  16510. DataMgr.minScore = 0;
  16511. DataMgr.rankDis = 0;
  16512. DataMgr.userSaving = false;
  16513. DataMgr.gameSaving = false;
  16514. class D3Tween extends Laya.Script3D {
  16515. constructor() {
  16516. super();
  16517. this.isInited = false;
  16518. }
  16519. ;
  16520. init() {
  16521. if (this.isInited)
  16522. return;
  16523. this.isInited = true;
  16524. this.gameObj = this.owner;
  16525. this.transform = this.gameObj.transform;
  16526. }
  16527. get rotX() {
  16528. return this.transform.localRotationEulerX;
  16529. }
  16530. set rotX(v) {
  16531. this.transform.localRotationEulerX = v;
  16532. }
  16533. get rotY() {
  16534. return this.transform.localRotationEulerY;
  16535. }
  16536. set rotY(v) {
  16537. this.transform.localRotationEulerY = v;
  16538. }
  16539. get rotZ() {
  16540. return this.transform.localRotationEulerZ;
  16541. }
  16542. set rotZ(v) {
  16543. this.transform.localRotationEulerZ = v;
  16544. }
  16545. get posX() {
  16546. return this.transform.localPositionX;
  16547. }
  16548. set posX(v) {
  16549. this.transform.localPositionX = v;
  16550. }
  16551. get posY() {
  16552. return this.transform.localPositionY;
  16553. }
  16554. set posY(v) {
  16555. this.transform.localPositionY = v;
  16556. }
  16557. get posZ() {
  16558. return this.transform.localPositionZ;
  16559. }
  16560. set posZ(v) {
  16561. this.transform.localPositionZ = v;
  16562. }
  16563. get rotation() {
  16564. return this.transform.localRotation;
  16565. }
  16566. set rotation(v) {
  16567. this.transform.localRotation = v;
  16568. }
  16569. }
  16570. class D2Hole extends Laya.Script {
  16571. constructor() { super(); }
  16572. onTriggerEnter(collider) {
  16573. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  16574. return;
  16575. }
  16576. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  16577. if (collider.owner["mySrc"].isRunSkillAni) {
  16578. return;
  16579. }
  16580. if (collider.owner["mySrc"].number != 0) {
  16581. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  16582. }
  16583. xGame.common.ballColliHole(collider);
  16584. xGame.common.recoverCameraView();
  16585. }
  16586. }
  16587. }
  16588. class Table extends Laya.Script3D {
  16589. constructor() {
  16590. super();
  16591. this.isSetBorder = false;
  16592. this.inited = false;
  16593. }
  16594. ;
  16595. onAwake() {
  16596. this.init();
  16597. }
  16598. init() {
  16599. if (this.inited)
  16600. return;
  16601. this.inited = true;
  16602. this.gameObj = this.owner;
  16603. this.border = this.gameObj.getChildByName("border");
  16604. }
  16605. setBorderPos() {
  16606. if (this.isSetBorder)
  16607. return;
  16608. this.isSetBorder = true;
  16609. let ui = xGame.common.gameUI.ui;
  16610. let bar1 = this.border.getChildByName("bar1");
  16611. let bar2 = this.border.getChildByName("bar2");
  16612. let bar3 = this.border.getChildByName("bar3");
  16613. let bar4 = this.border.getChildByName("bar4");
  16614. let bar5 = this.border.getChildByName("bar5");
  16615. let bar6 = this.border.getChildByName("bar6");
  16616. this.setInfo(bar1, ui.border.bar1, "box");
  16617. this.setInfo(bar2, ui.border.bar2, "box");
  16618. this.setInfo(bar3, ui.border.bar3, "box");
  16619. this.setInfo(bar4, ui.border.bar4, "box");
  16620. this.setInfo(bar5, ui.border.bar5, "box");
  16621. this.setInfo(bar6, ui.border.bar6, "box");
  16622. let circle1 = this.border.getChildByName("circle1");
  16623. let circle2 = this.border.getChildByName("circle2");
  16624. let circle3 = this.border.getChildByName("circle3");
  16625. let circle4 = this.border.getChildByName("circle4");
  16626. let circle5 = this.border.getChildByName("circle5");
  16627. let circle6 = this.border.getChildByName("circle6");
  16628. this.setInfo(circle1, ui.border.circle1, "circle");
  16629. this.setInfo(circle2, ui.border.circle2, "circle");
  16630. this.setInfo(circle3, ui.border.circle3, "circle");
  16631. this.setInfo(circle4, ui.border.circle4, "circle");
  16632. this.setInfo(circle5, ui.border.circle5, "circle");
  16633. this.setInfo(circle6, ui.border.circle6, "circle");
  16634. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  16635. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  16636. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  16637. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  16638. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  16639. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  16640. let arr = xGame.common.gameMgr.holePosList;
  16641. xGame.common.gameMgr.posObj = {
  16642. "1": arr[0],
  16643. "3": arr[2],
  16644. "4": arr[3],
  16645. "6": arr[5]
  16646. };
  16647. }
  16648. initHolePos(x, y) {
  16649. if (x < 300)
  16650. x += 25;
  16651. else if (x > 1000)
  16652. x -= 25;
  16653. else if (y > 200)
  16654. y -= 10;
  16655. else
  16656. y += 10;
  16657. if (y < 200)
  16658. y += 30;
  16659. else if (y > 500)
  16660. y -= 30;
  16661. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  16662. }
  16663. setInfo(d3Obj, d2Obj, type) {
  16664. let ui = xGame.common.gameUI.ui;
  16665. let sprite = new Laya.Sprite();
  16666. ui.border.displayObject.addChild(sprite);
  16667. let colli = xGame.common.getCollider(type);
  16668. sprite.addComponentIntance(colli);
  16669. let rigy = xGame.common.getRigbody();
  16670. rigy.type = "static";
  16671. sprite.addComponentIntance(rigy);
  16672. let d3Pos = d3Obj.transform.position;
  16673. xGame.common.pos3to2Convert(d3Pos);
  16674. let scaleX = d3Obj.transform.localScaleX;
  16675. let scaleZ = d3Obj.transform.localScaleZ;
  16676. let width = xGame.common.scale3to2Convert(scaleZ);
  16677. let height = xGame.common.scale3to2Convert(scaleX);
  16678. sprite.pivotX = width / 2;
  16679. sprite.pivotY = height / 2;
  16680. sprite.x = d3Pos.x;
  16681. sprite.y = d3Pos.y;
  16682. sprite.width = width;
  16683. sprite.height = height;
  16684. d2Obj.x = d3Pos.x;
  16685. d2Obj.y = d3Pos.y;
  16686. d2Obj.width = width;
  16687. d2Obj.height = height;
  16688. if (type == "box") {
  16689. colli.width = width;
  16690. colli.height = height;
  16691. colli.isSensor = false;
  16692. colli.label = "border";
  16693. }
  16694. else {
  16695. colli.radius = width / 2;
  16696. colli.isSensor = true;
  16697. colli.label = "hole";
  16698. sprite.addComponent(D2Hole);
  16699. }
  16700. }
  16701. }
  16702. class D3World extends Laya.Script3D {
  16703. constructor() {
  16704. super();
  16705. this.loadNum = 0;
  16706. this.setLoadNum = 7;
  16707. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  16708. }
  16709. onAwake() {
  16710. }
  16711. loadScene() {
  16712. this.scene = this.owner;
  16713. let url = `res/unityRes/root.lh`;
  16714. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  16715. this.scene.addChild(prefab);
  16716. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  16717. this.putCameraInfo();
  16718. this.camera.enableHDR = false;
  16719. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  16720. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  16721. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  16722. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  16723. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  16724. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  16725. this.knife.active = false;
  16726. this.loadD3Obj();
  16727. }));
  16728. }
  16729. putCameraInfo() {
  16730. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  16731. this.cameraObj = new cameraType();
  16732. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  16733. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  16734. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  16735. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  16736. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  16737. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  16738. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  16739. this.visitAngleChild.init();
  16740. this.visitRootObj.posX = this.visitAngleChild.posX;
  16741. this.visitRootObj.posY = this.visitAngleChild.posY;
  16742. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  16743. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  16744. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  16745. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  16746. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  16747. xGame.common.showOneCamera("mainCamera");
  16748. }
  16749. loadD3Obj() {
  16750. this.loadTable();
  16751. this.loadRoom();
  16752. this.loadInHoleParticial();
  16753. this.loadIceParticial();
  16754. this.loadHitParticial();
  16755. this.loadFireworksParticial();
  16756. this.loadBall();
  16757. }
  16758. loadInHoleParticial() {
  16759. this.loadD3Res("inHoleEft", "", (prefab) => {
  16760. prefab.addComponent(Partical);
  16761. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  16762. });
  16763. }
  16764. loadIceParticial() {
  16765. this.loadD3Res("iceEft", "", (prefab) => {
  16766. prefab.addComponent(Partical);
  16767. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  16768. });
  16769. }
  16770. loadHitParticial() {
  16771. this.loadD3Res("hitEft", "", (prefab) => {
  16772. prefab.addComponent(Partical);
  16773. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  16774. });
  16775. }
  16776. loadFireworksParticial() {
  16777. this.loadD3Res("fireworksEft", "", (prefab) => {
  16778. prefab.addComponent(Partical);
  16779. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  16780. });
  16781. }
  16782. loadBall(index = 1) {
  16783. this.loadD3Res("ball", index, (prefab) => {
  16784. this.ballPrefab = prefab;
  16785. this.ballPrefab.addComponent(Ball);
  16786. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  16787. });
  16788. }
  16789. loadTable(index = 1) {
  16790. this.loadD3Res("table", index, (prefab) => {
  16791. this.tableSrc = prefab.addComponent(Table);
  16792. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  16793. this.d3Hand.init();
  16794. this.tableRoot.addChild(prefab);
  16795. });
  16796. }
  16797. loadRoom(index = 1) {
  16798. this.loadD3Res("room", index, (prefab) => {
  16799. this.roomRoot.addChild(prefab);
  16800. });
  16801. }
  16802. loadD3Res(type, index, callback) {
  16803. let url = `res/unityRes/${type}${index}.lh`;
  16804. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  16805. callback && callback(prefab);
  16806. this.checkResLoad();
  16807. }));
  16808. }
  16809. checkResLoad() {
  16810. this.loadNum++;
  16811. if (this.loadNum >= this.setLoadNum) {
  16812. xGame.eventMgr.event(D3RES_LOADED);
  16813. }
  16814. }
  16815. prePlayEft() {
  16816. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  16817. eft.transform.localPositionX = 0;
  16818. eft.transform.localPositionY = -5;
  16819. eft.transform.localPositionZ = 0;
  16820. eft.active = true;
  16821. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  16822. ice.transform.localPositionX = 0;
  16823. ice.transform.localPositionY = -5;
  16824. ice.transform.localPositionZ = 0;
  16825. ice.active = true;
  16826. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  16827. hit.transform.localPositionX = 0;
  16828. hit.transform.localPositionY = -5;
  16829. hit.transform.localPositionZ = 0;
  16830. hit.active = true;
  16831. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  16832. fireworks.transform.localPositionX = 0;
  16833. fireworks.transform.localPositionY = -5;
  16834. fireworks.transform.localPositionZ = 0;
  16835. fireworks.active = true;
  16836. }
  16837. }
  16838. class cameraType {
  16839. }
  16840. class MoyuMgr$1 {
  16841. static initMoyu() {
  16842. this.moyuView = new MoyuView$1();
  16843. Laya.stage.addChild(this.moyuView.ui.displayObject);
  16844. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  16845. this.moyuView.ui.displayObject.zOrder = 1000;
  16846. this.moyuView.init();
  16847. this.moyuView.showTip(true);
  16848. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  16849. window['XApk'] = this;
  16850. }
  16851. static showAge(show) {
  16852. if (this.moyuView)
  16853. this.moyuView.showAge(show);
  16854. }
  16855. static onPlatMsg(idx) {
  16856. if (!MoyuMgr$1.moyuView)
  16857. return;
  16858. if (idx == '0') {
  16859. MoyuMgr$1.moyuView.showTip(false);
  16860. }
  16861. }
  16862. static showAgree(call) {
  16863. if (this.moyuView)
  16864. this.moyuView.showAgree(call);
  16865. else
  16866. call && call();
  16867. }
  16868. static showXy(type = 1) {
  16869. if (this.moyuView)
  16870. this.moyuView.showXy(type);
  16871. }
  16872. }
  16873. MoyuMgr$1.isAdvise = false;
  16874. class MoyuView$1 {
  16875. constructor() {
  16876. this.ysxyNum = 1;
  16877. this.ysJson = null;
  16878. this.ui = ui_UIMoyu.createInstance();
  16879. }
  16880. init() {
  16881. this.ui.mainBg.visible = false;
  16882. this.ui.xyNode.visible = false;
  16883. this.ui.ageNode.visible = false;
  16884. this.ui.tipNode.visible = false;
  16885. this.ui.rnNode.visible = false;
  16886. this.ui.fcmNode.visible = false;
  16887. this.ui.ageTip.visible = false;
  16888. this.ui.msgNode.visible = false;
  16889. this.ui.visible = false;
  16890. this.ui.xyNode.xyList.setVirtual();
  16891. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  16892. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  16893. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  16894. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  16895. this.ui.xyNode.btnKnown.visible = false;
  16896. this.ui.xyNode.xy1.visible = false;
  16897. this.ui.xyNode.xy2.visible = false;
  16898. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  16899. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  16900. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  16901. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  16902. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  16903. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  16904. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  16905. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  16906. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  16907. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  16908. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  16909. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  16910. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  16911. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  16912. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  16913. this.ysxyNum = 2;
  16914. }
  16915. }
  16916. onClick(obj) {
  16917. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  16918. switch (obj) {
  16919. case this.ui.ageTip:
  16920. if (Moyu.isTTApk) {
  16921. this.ui.ageNode.visible = true;
  16922. this.ui.mainBg.visible = true;
  16923. }
  16924. break;
  16925. case this.ui.tipNode:
  16926. this.showTip(false);
  16927. break;
  16928. case this.ui.ageNode.btnAge:
  16929. this.ui.ageNode.visible = false;
  16930. this.ui.mainBg.visible = false;
  16931. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  16932. this.ui.visible = false;
  16933. break;
  16934. case this.ui.xyNode.btnXy3:
  16935. case this.ui.xyNode.btnXy1:
  16936. this.loadXy(1);
  16937. break;
  16938. case this.ui.xyNode.btnXy2:
  16939. this.loadXy(2);
  16940. break;
  16941. case this.ui.xyNode.btnBack:
  16942. this.ui.xyNode.xy1.visible = true;
  16943. this.ui.xyNode.xy2.visible = false;
  16944. break;
  16945. case this.ui.xyNode.btnKnown:
  16946. this.ui.xyNode.visible = false;
  16947. this.ui.mainBg.visible = false;
  16948. this.ui.visible = false;
  16949. break;
  16950. case this.ui.rnNode.btnCheck:
  16951. this.check();
  16952. break;
  16953. case this.ui.rnNode.btnExit:
  16954. case this.ui.xyNode.btnNo:
  16955. this.ysxyNum--;
  16956. if (this.ysxyNum > 0)
  16957. this.showMsg("Refuse to quit the game once again");
  16958. else {
  16959. Moyu.userAgree(false);
  16960. Moyu.exit();
  16961. }
  16962. break;
  16963. case this.ui.xyNode.btnSure:
  16964. case this.ui.xyNode.btnYes:
  16965. DataMgr.userData.isAgree = true;
  16966. DataMgr.saveUserData();
  16967. this.onAgree();
  16968. break;
  16969. case this.ui.rnNode.btnDone:
  16970. this.ui.rnNode.visible = false;
  16971. this.ui.visible = false;
  16972. break;
  16973. case this.ui.fcmNode.btnRn:
  16974. this.showRn();
  16975. break;
  16976. }
  16977. }
  16978. showTip(show) {
  16979. if (!Moyu.isVVApk && !Moyu.isOPApk)
  16980. return;
  16981. if (show) {
  16982. MoyuMgr$1.isAdvise = true;
  16983. this.ui.visible = true;
  16984. this.ui.tipNode.visible = true;
  16985. this.ui.tipNode.alpha = 1;
  16986. Laya.timer.once(1000, this, this.showTip, [false]);
  16987. }
  16988. else {
  16989. this.ui.tipNode.alpha = 1;
  16990. this.ui.tipNode.visible = true;
  16991. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  16992. this.ui.tipNode.visible = false;
  16993. MoyuMgr$1.isAdvise = false;
  16994. }), 1000);
  16995. }
  16996. }
  16997. showAge(show, px = 0, py = 0) {
  16998. if (Moyu.platType > 10 && !Moyu.isIos) {
  16999. this.ui.ageTip.x = px;
  17000. this.ui.ageTip.y = py;
  17001. this.ui.ageTip.visible = show;
  17002. if (show)
  17003. this.ui.visible = true;
  17004. }
  17005. }
  17006. showAgree(call) {
  17007. this.agreeCall = call;
  17008. this.onAgree();
  17009. return;
  17010. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  17011. this.showXy(0);
  17012. }
  17013. else
  17014. this.onAgree();
  17015. }
  17016. onAgree() {
  17017. if (!this.ui.ageNode.visible)
  17018. this.ui.visible = false;
  17019. this.ui.xyNode.visible = false;
  17020. Moyu.userAgree(true);
  17021. this.showAge(false);
  17022. this.agreeCall && this.agreeCall();
  17023. this.showRn();
  17024. }
  17025. showMsg(txt) {
  17026. this.ui.msgNode.txtMsg.text = txt;
  17027. this.ui.msgNode.visible = true;
  17028. this.ui.msgNode.alpha = 1;
  17029. this.ui.visible = true;
  17030. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  17031. this.ui.msgNode.visible = false;
  17032. }), 2500, true);
  17033. }
  17034. showRn() {
  17035. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  17036. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  17037. this.ui.rnNode.rn1.visible = true;
  17038. this.ui.rnNode.rn2.visible = false;
  17039. this.ui.rnNode.rn3.visible = false;
  17040. this.ui.rnNode.rn4.visible = false;
  17041. this.ui.rnNode.visible = true;
  17042. this.ui.mainBg.visible = true;
  17043. this.ui.rnNode.btnDone.visible = false;
  17044. this.ui.rnNode.btnExit.visible = true;
  17045. this.ui.rnNode.btnCheck.visible = true;
  17046. this.ui.fcmNode.visible = false;
  17047. this.ui.visible = true;
  17048. return;
  17049. }
  17050. }
  17051. this.showFcm();
  17052. }
  17053. showFcm() {
  17054. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  17055. Moyu.initFCM(true);
  17056. if (Moyu.gameTime < 1)
  17057. this.fcmLoop();
  17058. else if (Moyu.gameTime < 999)
  17059. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  17060. }
  17061. }
  17062. fcmLoop() {
  17063. if (Moyu.gameTime < 1) {
  17064. this.ui.rnNode.visible = false;
  17065. this.ui.fcmNode.visible = true;
  17066. this.ui.mainBg.visible = true;
  17067. this.ui.visible = true;
  17068. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  17069. Laya.timer.clear(this.ui, this.fcmLoop);
  17070. }
  17071. }
  17072. check() {
  17073. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  17074. this.ui.rnNode.rn1.visible = false;
  17075. this.ui.rnNode.rn2.visible = false;
  17076. this.ui.rnNode.rn4.visible = true;
  17077. }
  17078. else if (this.ui.rnNode.rn4.visible) {
  17079. let name = this.ui.rnNode.inputName.text;
  17080. let code = this.ui.rnNode.inputCode.text;
  17081. if (code && code.length == 18) {
  17082. this.ui.rnNode.rn1.visible = false;
  17083. this.ui.rnNode.rn4.visible = false;
  17084. Moyu.authenticate(name, code, (res) => {
  17085. this.ui.rnNode.rn2.visible = !res;
  17086. this.ui.rnNode.rn3.visible = res;
  17087. this.ui.rnNode.btnDone.visible = res;
  17088. this.ui.rnNode.btnExit.visible = !res;
  17089. this.ui.rnNode.btnCheck.visible = !res;
  17090. if (res)
  17091. this.showFcm();
  17092. });
  17093. }
  17094. else
  17095. this.showMsg("信息填写不完整");
  17096. }
  17097. }
  17098. loadXy(type = 0) {
  17099. this.ui.xyNode.xy1.visible = false;
  17100. this.ui.xyNode.xy2.visible = true;
  17101. this.ui.xyNode.xyList.scrollToView(0);
  17102. if (type == 1) {
  17103. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  17104. }
  17105. else if (type == 2) {
  17106. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  17107. }
  17108. }
  17109. showXy(type = 0) {
  17110. this.xyBtn();
  17111. if (type == 0) {
  17112. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  17113. this.ui.xyNode.btnSure.visible = true;
  17114. }
  17115. else {
  17116. this.ui.xyNode.btnYes.visible = true;
  17117. this.ui.xyNode.btnNo.visible = true;
  17118. }
  17119. }
  17120. else {
  17121. this.ui.xyNode.btnKnown.visible = true;
  17122. this.ui.mainBg.visible = true;
  17123. }
  17124. this.ui.xyNode.xy1.visible = true;
  17125. this.ui.xyNode.xy2.visible = false;
  17126. this.ui.xyNode.visible = true;
  17127. this.ui.visible = true;
  17128. }
  17129. xyBtn() {
  17130. this.ui.xyNode.btnSure.visible = false;
  17131. this.ui.xyNode.btnYes.visible = false;
  17132. this.ui.xyNode.btnNo.visible = false;
  17133. this.ui.xyNode.btnKnown.visible = false;
  17134. {
  17135. this.ui.xyNode.btnXy3.visible = false;
  17136. this.ui.xyNode.btnXy2.visible = true;
  17137. this.ui.xyNode.btnXy1.visible = true;
  17138. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  17139. }
  17140. }
  17141. createXY(json) {
  17142. this.ysJson = json.content;
  17143. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  17144. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  17145. this.ui.xyNode.xy2.visible = true;
  17146. }
  17147. renderListItem(idx, cell) {
  17148. let xy = this.ysJson[idx];
  17149. cell.height = xy.line * 30;
  17150. cell.xyItem.text = xy.text;
  17151. }
  17152. onDestroy() {
  17153. this.agreeCall = null;
  17154. }
  17155. }
  17156. class UILoading extends UIBase {
  17157. constructor() {
  17158. super();
  17159. this.accTime = 0;
  17160. this.curNum = 0;
  17161. this.rate = 1;
  17162. this.loadSubOk = false;
  17163. this.loadResOK = false;
  17164. this.openLoading = true;
  17165. this.beginLoadRes = false;
  17166. this.finishD2 = false;
  17167. this.finishD3 = false;
  17168. }
  17169. onConstructor() {
  17170. this.ui = ui_UILoading.createInstance();
  17171. this.contentPane = this.ui;
  17172. this.isEject = false;
  17173. this._initUI();
  17174. this._addEvent();
  17175. }
  17176. _initUI() {
  17177. MoyuMgr$1.initMoyu();
  17178. }
  17179. _addEvent() {
  17180. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  17181. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  17182. }
  17183. show() {
  17184. super.show();
  17185. console.log('zh:加载分包资源');
  17186. loadSubRes(this.subResProgress.bind(this));
  17187. this.ui.txtLoad.text = "Loading...";
  17188. }
  17189. subResProgress(pro, finish) {
  17190. this.curNum = pro;
  17191. if (finish) {
  17192. this.curNum = 1;
  17193. this.loadSubOk = true;
  17194. }
  17195. }
  17196. laodD3Res() {
  17197. let scene3D = new Laya.Scene3D();
  17198. xGame.common.d3Scene = scene3D;
  17199. xGame.common.d3World = scene3D.addComponent(D3World);
  17200. xGame.common.d3World.loadScene();
  17201. }
  17202. loadD2Res() {
  17203. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  17204. this.finishD2 = true;
  17205. this.checkLoadAll();
  17206. this.curNum = 1;
  17207. }), Laya.Handler.create(this, (pro) => {
  17208. this.curNum = pro;
  17209. }, null, false));
  17210. }
  17211. d3ResFinish() {
  17212. this.finishD3 = true;
  17213. this.checkLoadAll();
  17214. }
  17215. checkLoadAll() {
  17216. if (this.finishD2 && this.finishD3) {
  17217. this.loadResOK = true;
  17218. }
  17219. }
  17220. loadRes() {
  17221. this.laodD3Res();
  17222. this.loadD2Res();
  17223. }
  17224. myUpdate(dt) {
  17225. if (!this.openLoading)
  17226. return;
  17227. this.accTime += dt * this.rate;
  17228. if (this.accTime >= this.curNum)
  17229. this.accTime = this.curNum;
  17230. this.ui.loadinfo.value = this.accTime * 100;
  17231. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  17232. if (!this.beginLoadRes) {
  17233. this.beginLoadRes = true;
  17234. this.ui.txtLoad.text = "Loading...";
  17235. this.curNum = 0;
  17236. this.accTime = 0;
  17237. this.loadRes();
  17238. }
  17239. if (this.loadResOK) {
  17240. this.openLoading = false;
  17241. Laya.timer.once(300, this, () => {
  17242. xGame.common.d3Scene.active = false;
  17243. MoyuMgr$1.showAgree(enterGame);
  17244. });
  17245. }
  17246. }
  17247. }
  17248. release() {
  17249. }
  17250. hide() {
  17251. super.hide();
  17252. this.release();
  17253. }
  17254. onClose() {
  17255. this.hide();
  17256. }
  17257. }
  17258. UILoading.uiName = "UILoading";
  17259. class UIRepentProp$1 extends UIBase {
  17260. constructor() {
  17261. super();
  17262. this.viewType = 0;
  17263. this.regretType = 0;
  17264. }
  17265. onConstructor() {
  17266. this.ui = ui_UIRepentProp.createInstance();
  17267. this.contentPane = this.ui;
  17268. this.isEject = false;
  17269. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  17270. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  17271. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  17272. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  17273. }
  17274. show(viewType, regretType, callback) {
  17275. PlatMgr.showInsert(true);
  17276. this.viewType = viewType;
  17277. this.regretType = regretType;
  17278. this.callback = callback;
  17279. super.show();
  17280. this.ui.t0.play();
  17281. this.ui.c1.selectedIndex = this.viewType;
  17282. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  17283. if (this.viewType == 0) {
  17284. let guide = DataMgr.getGuideHelpLine();
  17285. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  17286. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  17287. }
  17288. xGame.common.gameMgr.gamePause = true;
  17289. }
  17290. hideSelf() {
  17291. xGame.common.gameMgr.gamePause = false;
  17292. this.callback && this.callback(false);
  17293. this.hide();
  17294. }
  17295. videoRegret() {
  17296. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  17297. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  17298. }
  17299. else {
  17300. console.log('zh:AD 失败,直接发放奖励');
  17301. this.qjff_AD_for_UIrepentProp_videoRegret();
  17302. }
  17303. }
  17304. qjff_AD_for_UIrepentProp_videoRegret() {
  17305. this.callback && this.callback(true);
  17306. this.hideSelf();
  17307. }
  17308. videoAddHelpLine() {
  17309. let guide = DataMgr.getGuideHelpLine();
  17310. if (guide == 0) {
  17311. this.callback && this.callback(true);
  17312. this.hideSelf();
  17313. DataMgr.setGuideHelpLine();
  17314. xGame.common.gameUI.ui.guideNode.visible = false;
  17315. }
  17316. else {
  17317. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  17318. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  17319. }
  17320. else {
  17321. console.log('zh:AD 失败,直接发放奖励');
  17322. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  17323. }
  17324. }
  17325. }
  17326. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  17327. this.callback && this.callback(true);
  17328. this.hideSelf();
  17329. }
  17330. }
  17331. UIRepentProp$1.uiName = "UIRepentProp";
  17332. class UIRodMethod$1 extends UIBase {
  17333. constructor() {
  17334. super();
  17335. this.isPressd = false;
  17336. }
  17337. onConstructor() {
  17338. this.ui = ui_UIRodMethod.createInstance();
  17339. this.contentPane = this.ui;
  17340. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  17341. this.moveDir = new Laya.Vector2();
  17342. this.moveDest = new Laya.Vector2();
  17343. this.centerPos = new Laya.Vector2();
  17344. xGame.common.uiRodMethod = this;
  17345. }
  17346. show() {
  17347. super.show();
  17348. xGame.common.gameMgr.gamePause = true;
  17349. this.openPressDotEvent();
  17350. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  17351. this.centerPos.x = this.ui.white.x;
  17352. this.centerPos.y = this.ui.white.y;
  17353. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  17354. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  17355. this.setDot();
  17356. }
  17357. setDot() {
  17358. this.ui.dot.x = this.moveDest.x;
  17359. this.ui.dot.y = this.moveDest.y;
  17360. }
  17361. closeSelf() {
  17362. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  17363. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  17364. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  17365. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  17366. xGame.common.gameMgr.gamePause = false;
  17367. this.hide();
  17368. }
  17369. openPressDotEvent() {
  17370. this.closePressDotEvent();
  17371. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17372. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17373. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17374. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17375. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17376. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17377. }
  17378. closePressDotEvent() {
  17379. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17380. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17381. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17382. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17383. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17384. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17385. }
  17386. onDown(e) {
  17387. if (e.type == Laya.Event.MOUSE_DOWN)
  17388. this.isPressd = true;
  17389. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  17390. this.isPressd = false;
  17391. if (!this.isPressd)
  17392. return;
  17393. this.moveDest.x = e.stageX;
  17394. this.moveDest.y = e.stageY;
  17395. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  17396. if (dis > 6724) {
  17397. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  17398. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  17399. }
  17400. this.setDot();
  17401. }
  17402. resetRod() {
  17403. this.ui.dot.x = this.ui.white.x;
  17404. this.ui.dot.y = this.ui.white.y;
  17405. this.gameRod.dot.x = this.gameRod.bg.x;
  17406. this.gameRod.dot.y = this.gameRod.bg.y;
  17407. xGame.common.rodOffest.x = 0;
  17408. xGame.common.rodOffest.y = 0;
  17409. }
  17410. }
  17411. UIRodMethod$1.uiName = "UIRodMethod";
  17412. class UIMsg$1 extends UIBase {
  17413. constructor() {
  17414. super();
  17415. }
  17416. onConstructor() {
  17417. this.ui = ui_UIMsg.createInstance();
  17418. this.contentPane = this.ui;
  17419. this.isEject = false;
  17420. this.isMuti = true;
  17421. }
  17422. show(msg, callback) {
  17423. super.show();
  17424. this.ui.tipsNode.msgTxt.text = msg;
  17425. this.ui.alpha = 1;
  17426. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  17427. this.hide();
  17428. callback && callback();
  17429. }), 1000);
  17430. }
  17431. }
  17432. UIMsg$1.uiName = "UIMsg";
  17433. class UITips$1 extends UIBase {
  17434. constructor() {
  17435. super();
  17436. this.type = 0;
  17437. }
  17438. onConstructor() {
  17439. this.ui = ui_UITips.createInstance();
  17440. this.contentPane = this.ui;
  17441. this.isEject = false;
  17442. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  17443. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  17444. }
  17445. show(tipsTxt, womanTxt, type) {
  17446. super.show();
  17447. this.ui.t0.play();
  17448. this.ui.myNode.tipsTxt.text = tipsTxt;
  17449. this.ui.myNode.womanTxt.text = womanTxt;
  17450. PlatMgr.showInsert(true);
  17451. this.ui.myNode.c1.selectedIndex = type;
  17452. this.type = type;
  17453. switch (this.type) {
  17454. case TipsType.exitGame:
  17455. xGame.common.gameMgr.gamePause = true;
  17456. break;
  17457. case TipsType.foul:
  17458. Laya.timer.once(200, this, () => {
  17459. xGame.common.gameMgr.gamePause = true;
  17460. });
  17461. break;
  17462. default:
  17463. break;
  17464. }
  17465. }
  17466. clickLeftBtn() {
  17467. this.hide();
  17468. xGame.common.gameMgr.gamePause = false;
  17469. switch (this.type) {
  17470. case TipsType.exitGame:
  17471. break;
  17472. case TipsType.foul:
  17473. break;
  17474. default:
  17475. break;
  17476. }
  17477. }
  17478. clickRightBtn() {
  17479. this.hide();
  17480. switch (this.type) {
  17481. case TipsType.exitGame:
  17482. xGame.eventMgr.event(RESET_GAME);
  17483. xGame.uiMgr.Show(UIMain$1);
  17484. Moyu.recordEnd(this, null);
  17485. xGame.common.longHelpLine = false;
  17486. break;
  17487. case TipsType.foul:
  17488. xGame.common.gameMgr.gamePause = false;
  17489. Laya.timer.clearAll(this);
  17490. break;
  17491. default:
  17492. break;
  17493. }
  17494. }
  17495. }
  17496. UITips$1.uiName = "UITips";
  17497. class UIGame$1 extends UIBase {
  17498. constructor() {
  17499. super();
  17500. this.powerNum = 0;
  17501. this.isD3Inited = false;
  17502. this.isPrePlay = false;
  17503. this.isMoveRod = false;
  17504. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  17505. this.rulerDis = 20;
  17506. this.rulerOffset = 0;
  17507. }
  17508. onConstructor() {
  17509. this.ui = ui_UIGame.createInstance();
  17510. this.contentPane = this.ui;
  17511. this.ui.x += xGame.common.sysOffestNum;
  17512. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  17513. this.isEject = false;
  17514. xGame.common.gameUI = this;
  17515. this.initSelf();
  17516. }
  17517. isTurnSelf() {
  17518. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  17519. return true;
  17520. }
  17521. }
  17522. initSelf() {
  17523. let topUI = this.ui.topNode;
  17524. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  17525. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  17526. this.barInfo = {};
  17527. this.barInfo.curY = 0;
  17528. this.barInfo.height = this.ui.powerNode.height;
  17529. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  17530. this.barInfo.powerStartY = this.ui.powerNode.y;
  17531. xGame.common.aiPlayer = new AIPlayer();
  17532. xGame.common.gameMgr = new GameMgr();
  17533. xGame.common.skillMgr = new SkillMgr();
  17534. xGame.common.wordsMgr = new WordsMgr();
  17535. xGame.common.talkMgr = new TalkMgr();
  17536. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  17537. console.log("加载经典模式表情文件chenggon !");
  17538. });
  17539. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  17540. console.log("挑战模式奖励模式spine加载成功!");
  17541. });
  17542. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  17543. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  17544. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  17545. this.addUIClick(this.ui.returnBtn, this.returnHome);
  17546. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  17547. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  17548. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  17549. }
  17550. returnHome() {
  17551. let tips = "Are you sure to exit the game?";
  17552. let woman = "Boss, why don't you play for a while longer?";
  17553. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  17554. }
  17555. addRodMethodClick() {
  17556. if (this.isTurnSelf()) {
  17557. xGame.uiMgr.Show(UIRodMethod$1);
  17558. }
  17559. }
  17560. clickHelpLineBtn(force = false) {
  17561. if (!this.isTurnSelf())
  17562. return;
  17563. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  17564. if (success) {
  17565. xGame.common.longHelpLine = true;
  17566. xGame.common.d2World.getHelpLine();
  17567. Moyu.sendDataEvent("guideNum");
  17568. }
  17569. else {
  17570. }
  17571. });
  17572. }
  17573. renderSelfDisplayBalls(index, target) {
  17574. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  17575. target.myImg.url = xGame.common.getGameIconUrl(str);
  17576. }
  17577. renderAIDisplayBalls(index, target) {
  17578. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  17579. target.myImg.url = xGame.common.getGameIconUrl(str);
  17580. ;
  17581. }
  17582. updateMode() {
  17583. if (xGame.common.gameMode == GameMode.classic) {
  17584. this.ui.topNode.scoreNode.visible = false;
  17585. }
  17586. else if (xGame.common.gameMode == GameMode.bigMove) {
  17587. this.ui.topNode.scoreNode.visible = true;
  17588. }
  17589. }
  17590. show() {
  17591. super.show();
  17592. console.log("zh:uigame show");
  17593. this.ui.alpha = 0;
  17594. this.updateSelf();
  17595. console.log("zh:uigame bf gamemusic01 start");
  17596. xGame.soundMgr.playMusic("gamemusic01");
  17597. console.log("zh:uigame bf gamemusic01 end");
  17598. xGame.common.gameMgr.gamePause = false;
  17599. xGame.common.gameUI.ui.blackAni.visible = false;
  17600. xGame.common.gameUI.ui.whiteAni.visible = false;
  17601. this.ui.powerEft.visible = false;
  17602. this.ui.colorNode.visible = false;
  17603. this.updateHead();
  17604. }
  17605. updateSelf() {
  17606. if (xGame.common.gameMode == GameMode.classic) {
  17607. this.ui.c1.selectedIndex = 0;
  17608. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  17609. this.ui.topNode.middleNode.visible = true;
  17610. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  17611. }
  17612. else if (xGame.common.gameMode == GameMode.bigMove) {
  17613. this.ui.c1.selectedIndex = 0;
  17614. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  17615. this.ui.topNode.middleNode.visible = false;
  17616. let max = xGame.cfgMgr.getMaxBigMoveLength();
  17617. let rand = xGame.common.randomNum(1, max);
  17618. let guide = DataMgr.getSkillGuide();
  17619. if (guide == 0)
  17620. rand = 1;
  17621. xGame.common.bigMoveLevelIndex = rand;
  17622. }
  17623. else if (xGame.common.gameMode == GameMode.placeBall) {
  17624. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  17625. this.ui.c1.selectedIndex = 1 + data.type;
  17626. this.ui.alpha = 1;
  17627. this.startGame();
  17628. }
  17629. this.updateMode();
  17630. this.initD3world();
  17631. this.initD2world();
  17632. }
  17633. startGame() {
  17634. this.ui.snowNode.visible = Math.random() <= 0.1;
  17635. this.ui.d2Node.visible = false;
  17636. xGame.common.d3World.d3Hand.gameObj.active = false;
  17637. xGame.common.d3World.tableSrc.init();
  17638. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  17639. this.cameraViewChange(() => {
  17640. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  17641. switch (xGame.common.gameMode) {
  17642. case GameMode.classic:
  17643. xGame.common.d3World.d3Hand.gameObj.active = true;
  17644. this.playPutBallD3Ani();
  17645. break;
  17646. case GameMode.bigMove:
  17647. this.enterGame();
  17648. Laya.timer.once(500, this, () => {
  17649. this.ui.topNode.middleNode.visible = true;
  17650. this.ui.topNode.middleNode.t0.play();
  17651. });
  17652. break;
  17653. case GameMode.placeBall:
  17654. this.enterGame();
  17655. break;
  17656. default:
  17657. break;
  17658. }
  17659. });
  17660. PlatMgr.showBanner(false);
  17661. }
  17662. enterGame() {
  17663. this.ui.d2Node.visible = true;
  17664. xGame.common.d3World.d3Hand.gameObj.active = false;
  17665. xGame.common.showOneCamera("mainCamera");
  17666. Moyu.recordGame(30, true);
  17667. if (!this.isPrePlay) {
  17668. this.isPrePlay = true;
  17669. xGame.common.d3World.prePlayEft();
  17670. }
  17671. xGame.common.gameMgr.gameReady();
  17672. this.openAllEvent();
  17673. this.ui.snowNode.visible = false;
  17674. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  17675. this.ui.helpBtn.visible = condition;
  17676. }
  17677. showHelpLineGuide() {
  17678. let longGuide = DataMgr.getGuideHelpLine();
  17679. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  17680. this.ui.helpBtn.visible = true;
  17681. this.ui.guideNode.visible = true;
  17682. }
  17683. }
  17684. setTurnAlpha(alpha) {
  17685. this.ui.keduNode.alpha = alpha;
  17686. this.ui.ganNode.alpha = alpha;
  17687. this.ui.rodMethodNode.alpha = alpha;
  17688. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  17689. }
  17690. cameraViewChange(callback) {
  17691. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  17692. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  17693. xGame.common.showOneCamera("visitAngle");
  17694. cameraSrc.localRotationEulerY = 180;
  17695. cameraSrc.localRotationEulerZ = 0;
  17696. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  17697. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  17698. callback && callback();
  17699. }));
  17700. }));
  17701. }
  17702. playPutBallD3Ani() {
  17703. xGame.common.showOneCamera("mainCamera");
  17704. let handSrc = xGame.common.d3World.d3Hand;
  17705. handSrc.gameObj.active = true;
  17706. handSrc.transform.localPositionZ = 3;
  17707. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  17708. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  17709. handSrc.gameObj.active = false;
  17710. this.enterGame();
  17711. }), 400);
  17712. }));
  17713. }
  17714. updateHead() {
  17715. let user = Moyu.getUserInfo();
  17716. this.ui.topNode.selfNameTxt.text = user.nickName;
  17717. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  17718. let aiData = xGame.cfgMgr.getRandomUserInfo();
  17719. if (DataMgr.getSkillGuide() < 1) {
  17720. this.ui.topNode.aiNameTxt.text = 'billiards';
  17721. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  17722. }
  17723. else {
  17724. this.ui.topNode.aiNameTxt.text = aiData.name;
  17725. let randNo = Math.floor(Math.random() * 10) + 1;
  17726. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  17727. }
  17728. }
  17729. initD2world() {
  17730. let node = this.ui.d2Root.displayObject;
  17731. let src = node.getComponent(D2World);
  17732. if (!src) {
  17733. xGame.common.d2World = node.addComponent(D2World);
  17734. }
  17735. xGame.common.d2World.initSelf();
  17736. }
  17737. initD3world() {
  17738. if (this.isD3Inited)
  17739. return;
  17740. this.isD3Inited = true;
  17741. let scene3D = xGame.common.d3Scene;
  17742. this.ui.d3Root.displayObject.addChild(scene3D);
  17743. scene3D.active = true;
  17744. xGame.common.d3World.tableSrc.setBorderPos();
  17745. }
  17746. onRootMove(e) {
  17747. let rootBall = xGame.common.d2World.rootBall;
  17748. this.ui.moveNode.x = e.x;
  17749. this.ui.moveNode.y = e.y;
  17750. rootBall.gameObj.x = e.x;
  17751. rootBall.gameObj.y = e.y;
  17752. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  17753. }
  17754. aiRootMove(move) {
  17755. if (move)
  17756. this.hideBallUI();
  17757. else {
  17758. this.showBallUI();
  17759. xGame.common.d2World.getHelpLine();
  17760. }
  17761. }
  17762. aiForce(type, force = 0) {
  17763. this.pressTarget = PressType.powerNode;
  17764. if (type == 1)
  17765. this.onEventUp({ force: true });
  17766. else if (type == 2)
  17767. this.onEventMove({ stageY: force, force: true });
  17768. }
  17769. onEventPress(e) {
  17770. if (e.stopPropagation)
  17771. e.stopPropagation();
  17772. if (!this.isTurnSelf())
  17773. return;
  17774. let target = e.target;
  17775. switch (target) {
  17776. case this.ui.myPowerNode.displayObject:
  17777. this.pressTarget = PressType.powerNode;
  17778. this.barInfo.curY = e.stageY;
  17779. this.updateBarInfo();
  17780. break;
  17781. case this.ui.moveNode.displayObject:
  17782. this.pressTarget = PressType.moveNode;
  17783. this.hideBallUI();
  17784. this.eventObj.curX = this.ui.moveNode.x;
  17785. this.eventObj.curY = this.ui.moveNode.y;
  17786. this.ui.moveNode.finger.visible = false;
  17787. this.eventObj.lastX = e.stageX;
  17788. this.eventObj.lastY = e.stageY;
  17789. break;
  17790. case this.ui.rulerClickNode.displayObject:
  17791. this.pressTarget = PressType.rulerNode;
  17792. this.eventObj.lastY = e.stageY;
  17793. break;
  17794. case this.ui.d2Root.displayObject:
  17795. this.pressTarget = PressType.d2Root;
  17796. this.eventObj.lastX = e.stageX;
  17797. this.eventObj.lastY = e.stageY;
  17798. this.eventObj.starX = e.stageX;
  17799. this.eventObj.starY = e.stageY;
  17800. this.eventObj.curX = 0;
  17801. this.eventObj.curY = 0;
  17802. xGame.common.d2World.d2Gan.setGanLastInfo();
  17803. this.rulerOffset = 0;
  17804. break;
  17805. default:
  17806. break;
  17807. }
  17808. }
  17809. onEventMove(e) {
  17810. if (e.stopPropagation)
  17811. e.stopPropagation();
  17812. if (e && e.force) {
  17813. }
  17814. else {
  17815. if (!this.isTurnSelf())
  17816. return;
  17817. }
  17818. switch (this.pressTarget) {
  17819. case PressType.powerNode:
  17820. this.barInfo.curY = e.stageY;
  17821. this.updateBarInfo();
  17822. this.isMoveRod = true;
  17823. break;
  17824. case PressType.moveNode:
  17825. let rootBall = xGame.common.d2World.rootBall;
  17826. let radius = rootBall.gameObj.width / 2;
  17827. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  17828. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  17829. let border = xGame.common.d2World.borderRect;
  17830. if (curX <= border.x + radius)
  17831. curX = border.x + radius;
  17832. else if (curX >= border.x + border.width - radius)
  17833. curX = border.x + border.width - radius;
  17834. if (curY <= border.y + radius)
  17835. curY = border.y + radius;
  17836. else if (curY >= border.y + border.height - radius)
  17837. curY = border.y + border.height - radius;
  17838. if (xGame.common.gameMgr.isOpenBall) {
  17839. if (curX >= border.x + border.openBallW - radius)
  17840. curX = border.x + border.openBallW - radius;
  17841. }
  17842. this.ui.moveNode.x = curX;
  17843. this.ui.moveNode.y = curY;
  17844. rootBall.gameObj.x = curX;
  17845. rootBall.gameObj.y = curY;
  17846. rootBall.d3BallSrc.setTransPos(curX, curY);
  17847. this.isMoveRod = true;
  17848. break;
  17849. case PressType.rulerNode:
  17850. let yy = e.stageY - this.eventObj.lastY;
  17851. this.eventObj.lastY = e.stageY;
  17852. let ruler1 = this.ui.rulerNode.img1;
  17853. let ruler2 = this.ui.rulerNode.img2;
  17854. ruler1.y += yy;
  17855. ruler2.y += yy;
  17856. this.rulerOffset += yy;
  17857. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  17858. this.rulerOffset = 0;
  17859. xGame.soundMgr.playSound("inch", 1, 10);
  17860. }
  17861. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  17862. let h = ruler1.height;
  17863. this.checkGuide();
  17864. this.isMoveRod = true;
  17865. if (ruler1.y >= h) {
  17866. ruler1.y = -h;
  17867. ruler2.y = 0;
  17868. return;
  17869. }
  17870. else if (ruler1.y <= -h) {
  17871. ruler1.y = h;
  17872. ruler2.y = 0;
  17873. return;
  17874. }
  17875. if (ruler2.y >= h) {
  17876. ruler2.y = -h;
  17877. ruler1.y = 0;
  17878. return;
  17879. }
  17880. else if (ruler2.y <= -h) {
  17881. ruler2.y = h;
  17882. ruler1.y = 0;
  17883. return;
  17884. }
  17885. break;
  17886. case PressType.d2Root:
  17887. this.eventObj.curX = e.stageX;
  17888. this.eventObj.curY = e.stageY;
  17889. let offset = this.checkRodMoveDir();
  17890. xGame.common.d2World.d2Gan.rotateSelf(offset);
  17891. this.eventObj.lastX = e.stageX;
  17892. this.eventObj.lastY = e.stageY;
  17893. break;
  17894. default:
  17895. break;
  17896. }
  17897. }
  17898. onEventUp(e) {
  17899. if (e.stopPropagation)
  17900. e.stopPropagation();
  17901. if (e && e.force) {
  17902. }
  17903. else {
  17904. if (!this.isTurnSelf())
  17905. return;
  17906. }
  17907. switch (this.pressTarget) {
  17908. case PressType.powerNode:
  17909. this.ui.powerNode.value = 0;
  17910. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  17911. this.ui.powerTxt.text = "";
  17912. if (this.powerNum > 0) {
  17913. xGame.eventMgr.event(BALL_SHOOT);
  17914. xGame.common.d2World.shoot(this.powerNum);
  17915. xGame.common.d2World.d2Gan.shoot();
  17916. xGame.common.d2World.d2HelpLine.shoot();
  17917. this.finishGuide();
  17918. this.ui.powerEft.visible = false;
  17919. this.ui.colorNode.visible = false;
  17920. let ganStr = "";
  17921. if (this.powerNum <= 30) {
  17922. ganStr = "gan_30";
  17923. }
  17924. else if (this.powerNum <= 60) {
  17925. ganStr = "gan_50";
  17926. }
  17927. else {
  17928. ganStr = "gan_80";
  17929. }
  17930. xGame.soundMgr.playSound(ganStr);
  17931. }
  17932. break;
  17933. case PressType.moveNode:
  17934. let rootBall = xGame.common.d2World.rootBall;
  17935. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  17936. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  17937. let isIntersect = this.judgeBallIntersect();
  17938. if (isIntersect) {
  17939. this.ui.moveNode.x = lastX;
  17940. this.ui.moveNode.y = lastY;
  17941. rootBall.gameObj.x = lastX;
  17942. rootBall.gameObj.y = lastY;
  17943. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  17944. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  17945. }
  17946. else {
  17947. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  17948. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  17949. }
  17950. this.showBallUI();
  17951. this.ui.moveNode.finger.visible = true;
  17952. xGame.common.d2World.getHelpLine();
  17953. break;
  17954. case PressType.rulerNode:
  17955. break;
  17956. case PressType.d2Root:
  17957. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  17958. if (dis <= 25) {
  17959. this.moveToClickDot(e);
  17960. }
  17961. break;
  17962. default:
  17963. break;
  17964. }
  17965. this.pressTarget = -1;
  17966. }
  17967. checkGuide() {
  17968. let guide = DataMgr.getSkillGuide();
  17969. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  17970. xGame.common.guideStep++;
  17971. xGame.common.gameUI.ui.guide2.visible = false;
  17972. xGame.common.gameUI.ui.guide3.visible = true;
  17973. }
  17974. }
  17975. finishGuide() {
  17976. let guide = DataMgr.getSkillGuide();
  17977. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  17978. xGame.common.guideStep = 10;
  17979. this.closeAllGuide();
  17980. }
  17981. }
  17982. closeAllGuide() {
  17983. xGame.common.gameUI.ui.guide1.visible = false;
  17984. xGame.common.gameUI.ui.guide2.visible = false;
  17985. xGame.common.gameUI.ui.guide3.visible = false;
  17986. }
  17987. updateBarInfo() {
  17988. let star = this.ui.powerNode.y;
  17989. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  17990. if (rate >= 1)
  17991. rate = 1;
  17992. if (rate <= 0)
  17993. rate = 0;
  17994. this.powerNum = Math.ceil(rate * 100);
  17995. this.ui.powerNode.value = this.powerNum;
  17996. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  17997. this.ui.colorNode.value = this.powerNum;
  17998. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  17999. this.ui.powerEft.visible = this.powerNum != 0;
  18000. this.ui.colorNode.visible = this.powerNum != 0;
  18001. this.ui.powerTxt.text = this.powerNum + "";
  18002. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  18003. }
  18004. forceCancel() {
  18005. this.ui.powerNode.value = 0;
  18006. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  18007. this.ui.powerTxt.text = "";
  18008. }
  18009. checkRodMoveDir() {
  18010. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  18011. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  18012. if (tempX >= 0 && tempY <= 0) {
  18013. return this.checkDir();
  18014. }
  18015. else if (tempX < 0 && tempY < 0) {
  18016. return this.checkDir(1, -1);
  18017. }
  18018. else if (tempX < 0 && tempY > 0) {
  18019. return this.checkDir(-1, -1);
  18020. }
  18021. else {
  18022. return this.checkDir(-1, 1);
  18023. }
  18024. }
  18025. checkDir(flagX = 1, flagY = 1) {
  18026. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  18027. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  18028. if (offsetY == 0) {
  18029. return offsetX * flagX;
  18030. }
  18031. if (offsetX == 0) {
  18032. return offsetY * flagY;
  18033. }
  18034. let angle = offsetY / offsetX;
  18035. if (Math.abs(angle) >= 1) {
  18036. return offsetY * flagY;
  18037. }
  18038. else {
  18039. return offsetX * flagX;
  18040. }
  18041. }
  18042. judgeBallIntersect() {
  18043. let rootBall = xGame.common.d2World.rootBall;
  18044. let ballArr = xGame.common.d2World.ballArr;
  18045. let radius = rootBall.gameObj.width / 2;
  18046. let temp;
  18047. let isIntersect = false;
  18048. for (let index = 0; index < ballArr.length; index++) {
  18049. temp = ballArr[index];
  18050. if (temp.number == rootBall.number)
  18051. continue;
  18052. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  18053. if (isIntersect) {
  18054. break;
  18055. }
  18056. }
  18057. return isIntersect;
  18058. }
  18059. hideBallUI() {
  18060. let d2Gan = xGame.common.d2World.d2Gan;
  18061. if (!d2Gan.ui.isDisposed)
  18062. d2Gan.ui.visible = false;
  18063. let d2Help = xGame.common.d2World.d2HelpLine;
  18064. if (!d2Help.ui.isDisposed)
  18065. d2Help.ui.visible = false;
  18066. let rootBall = xGame.common.d2World.rootBall;
  18067. if (!rootBall.destroyed) {
  18068. rootBall.gameObj.active = false;
  18069. }
  18070. }
  18071. showBallUI() {
  18072. let d2Gan = xGame.common.d2World.d2Gan;
  18073. if (!d2Gan.ui.isDisposed)
  18074. d2Gan.ui.visible = true;
  18075. let d2Help = xGame.common.d2World.d2HelpLine;
  18076. if (!d2Help.ui.isDisposed)
  18077. d2Help.ui.visible = true;
  18078. let rootBall = xGame.common.d2World.rootBall;
  18079. if (!rootBall.destroyed) {
  18080. rootBall.gameObj.active = true;
  18081. }
  18082. }
  18083. moveToClickDot(e) {
  18084. if (!this.isMoveRod && !xGame.common.clickedBall) {
  18085. let root = xGame.common.d2World.rootBall.gameObj;
  18086. let xx = e.stageX - xGame.common.sysOffestNum;
  18087. let yy = e.stageY;
  18088. let x = xx - root.x;
  18089. let y = yy - root.y;
  18090. let angle = xGame.common.getfguiRotation(x, y);
  18091. xGame.common.d2World.d2Gan.ui.rotation = angle;
  18092. xGame.common.d2World.getHelpLine();
  18093. }
  18094. this.isMoveRod = false;
  18095. xGame.common.clickedBall = false;
  18096. }
  18097. openAllEvent() {
  18098. this.closeAllEvent();
  18099. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18100. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18101. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18102. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18103. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  18104. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  18105. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  18106. }
  18107. closeAllEvent() {
  18108. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18109. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18110. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18111. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18112. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  18113. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  18114. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  18115. }
  18116. resetGame() {
  18117. this.closeAllEvent();
  18118. this.hideBallUI();
  18119. xGame.common.gameMgr.gamePause = true;
  18120. }
  18121. }
  18122. UIGame$1.uiName = "UIGame";
  18123. class UIAddCoin$1 extends UIBase {
  18124. constructor() {
  18125. super();
  18126. this.coinNum = 2000;
  18127. }
  18128. onConstructor() {
  18129. this.ui = ui_UIAddCoin.createInstance();
  18130. this.contentPane = this.ui;
  18131. this.isEject = false;
  18132. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  18133. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  18134. }
  18135. show() {
  18136. super.show();
  18137. this.ui.t0.play();
  18138. }
  18139. videoAddCoin() {
  18140. console.log('zh:qjff_AD_for_UIAddCoin');
  18141. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  18142. }
  18143. else {
  18144. console.log('zh:AD 失败,直接发放奖励');
  18145. this.qjff_AD_for_UIAddCoin();
  18146. }
  18147. }
  18148. qjff_AD_for_UIAddCoin() {
  18149. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  18150. this.hide();
  18151. }
  18152. }
  18153. UIAddCoin$1.uiName = "UIAddCoin";
  18154. class UIInvitation$1 extends UIBase {
  18155. constructor() {
  18156. super();
  18157. }
  18158. onConstructor() {
  18159. this.ui = ui_UIInvitation.createInstance();
  18160. this.contentPane = this.ui;
  18161. this.isEject = false;
  18162. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  18163. }
  18164. show() {
  18165. super.show();
  18166. }
  18167. enterGame() {
  18168. xGame.common.gameMode = GameMode.classic;
  18169. DataMgr.setChallengeTimes(1);
  18170. xGame.common.passAwardCoin = 2000;
  18171. let need = xGame.common.classicNiceNeddCoin;
  18172. if (DataMgr.coinEnough(need)) {
  18173. DataMgr.setCoin(-need);
  18174. xGame.eventMgr.event(RESTART_GAME, true);
  18175. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  18176. }
  18177. else {
  18178. xGame.eventMgr.event(RESTART_GAME, true);
  18179. }
  18180. this.hide();
  18181. }
  18182. hide() {
  18183. super.hide();
  18184. }
  18185. }
  18186. UIInvitation$1.uiName = "UIInvitation";
  18187. class UIPower$1 extends UIBase {
  18188. constructor() {
  18189. super();
  18190. }
  18191. onConstructor() {
  18192. this.ui = ui_UIPower.createInstance();
  18193. this.contentPane = this.ui;
  18194. this.isEject = false;
  18195. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  18196. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  18197. }
  18198. show() {
  18199. super.show();
  18200. this.ui.t0.play();
  18201. }
  18202. videoGetPower() {
  18203. console.log('zh:qjff_AD_for_uipower');
  18204. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  18205. }
  18206. else {
  18207. console.log('zh:AD 失败,直接发放奖励');
  18208. this.qjff_AD_for_uipower();
  18209. }
  18210. }
  18211. qjff_AD_for_uipower() {
  18212. DataMgr.setPower(xGame.common.videoPower, true);
  18213. xGame.eventMgr.event(POWER_TIME);
  18214. this.hide();
  18215. }
  18216. }
  18217. UIPower$1.uiName = "UIPower";
  18218. class UIGameEnd$1 extends UIBase {
  18219. constructor() {
  18220. super();
  18221. this.success = false;
  18222. this.awardCoinNum = 1000;
  18223. this.awardDiamondNum = 10;
  18224. }
  18225. onConstructor() {
  18226. this.ui = ui_UIGameEnd.createInstance();
  18227. this.contentPane = this.ui;
  18228. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  18229. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  18230. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  18231. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18232. this.ui.talkNode.visible = false;
  18233. if (Moyu.isKs)
  18234. this.ui.closeNode.closeBtn.x += 100;
  18235. }
  18236. updateType() {
  18237. switch (xGame.common.gameMode) {
  18238. case GameMode.classic:
  18239. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  18240. this.ui.coinNode.visible = this.success;
  18241. if (!this.success) {
  18242. Laya.timer.once(500, this, () => {
  18243. xGame.uiMgr.Show(UIAddCoin$1);
  18244. });
  18245. }
  18246. this.ui.isGetAward.visible = false;
  18247. this.ui.leftBtn.c1.selectedIndex = 3;
  18248. this.ui.rightBtn.c1.selectedIndex = 0;
  18249. this.moneyNode.ui.c1.selectedIndex = 1;
  18250. break;
  18251. case GameMode.bigMove:
  18252. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  18253. this.ui.coinNode.visible = this.success;
  18254. if (xGame.common.gameMode == GameMode.bigMove) {
  18255. if (this.success) {
  18256. DataMgr.setSkillSuccessTimes(1, true);
  18257. DataMgr.setSkillAccTimes(1);
  18258. }
  18259. else {
  18260. DataMgr.setSkillSuccessTimes(0, false);
  18261. }
  18262. }
  18263. if (!this.success) {
  18264. Laya.timer.once(500, this, () => {
  18265. xGame.uiMgr.Show(UIAddCoin$1);
  18266. });
  18267. }
  18268. this.ui.isGetAward.visible = false;
  18269. this.ui.leftBtn.c1.selectedIndex = 3;
  18270. this.ui.rightBtn.c1.selectedIndex = 0;
  18271. this.moneyNode.ui.c1.selectedIndex = 1;
  18272. break;
  18273. case GameMode.placeBall:
  18274. this.ui.coinNode.visible = false;
  18275. if (this.success) {
  18276. if (xGame.common.placeBallStarNum == 3) {
  18277. this.ui.c1.selectedIndex = 2;
  18278. }
  18279. else {
  18280. this.ui.c1.selectedIndex = 3;
  18281. }
  18282. }
  18283. else {
  18284. this.ui.c1.selectedIndex = 4;
  18285. }
  18286. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  18287. if (cfg.type == PlaceBallType.challenge) {
  18288. this.ui.c1.selectedIndex = 2;
  18289. }
  18290. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  18291. this.updatePlaceBallBtn();
  18292. this.updatePlaceBallStarNum();
  18293. this.updatePlaceBallAwardState();
  18294. this.moneyNode.ui.c1.selectedIndex = 2;
  18295. this.moneyNode.checkPowerTime();
  18296. this.moneyNode.powerChange();
  18297. DataMgr.upRankData();
  18298. break;
  18299. default:
  18300. break;
  18301. }
  18302. }
  18303. updatePlaceBallBtn() {
  18304. this.ui.leftBtn.c1.selectedIndex = 5;
  18305. if (this.success) {
  18306. this.ui.rightBtn.c1.selectedIndex = 14;
  18307. }
  18308. else {
  18309. if (xGame.common.placeBallStarNum == 3) {
  18310. this.ui.rightBtn.c1.selectedIndex = 14;
  18311. }
  18312. else {
  18313. this.ui.rightBtn.c1.selectedIndex = 1;
  18314. }
  18315. }
  18316. }
  18317. updatePlaceBallStarNum() {
  18318. let starNum = xGame.common.placeBallStarNum;
  18319. if (starNum == 0)
  18320. this.ui.starNumNode.c1.selectedIndex = 3;
  18321. else {
  18322. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  18323. }
  18324. }
  18325. updatePlaceBallAwardState() {
  18326. let level = xGame.common.placeBallCurLevel;
  18327. let starNum = xGame.common.placeBallStarNum;
  18328. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  18329. let data = cfgTable.placeballData[level].award;
  18330. let cfg = cfgTable.placeballData[level];
  18331. this.awardDiamondNum = data[1];
  18332. this.awardCoinNum = data[0];
  18333. if (cfg.type == PlaceBallType.challenge) {
  18334. this.awardDiamondNum = 0;
  18335. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  18336. }
  18337. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  18338. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  18339. if (cfg.type == PlaceBallType.challenge) {
  18340. this.ui.awardNode.coinNode.visible = true;
  18341. }
  18342. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  18343. this.ui.awardNode.diamondNode.x = 265;
  18344. this.ui.awardNode.coinNode.x = 354;
  18345. }
  18346. else {
  18347. this.ui.awardNode.diamondNode.x = 291;
  18348. this.ui.awardNode.coinNode.x = 291;
  18349. }
  18350. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  18351. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  18352. if (this.awardCoinNum == 0) {
  18353. this.ui.awardNode.coinNode.numTxt.text = "";
  18354. }
  18355. if (getAward) {
  18356. this.ui.isGetAward.visible = true;
  18357. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  18358. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  18359. }
  18360. else {
  18361. this.ui.isGetAward.visible = false;
  18362. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  18363. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  18364. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  18365. }
  18366. else {
  18367. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  18368. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  18369. }
  18370. }
  18371. }
  18372. show(success) {
  18373. super.show();
  18374. xGame.eventMgr.event(RESET_GAME);
  18375. this.success = success;
  18376. Laya.timer.clearAll(this);
  18377. this.playSecretaryAni();
  18378. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  18379. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  18380. offsetTime = Math.floor(offsetTime / 1000);
  18381. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  18382. this.updateType();
  18383. Laya.timer.once(200, this, () => {
  18384. this.addAward(() => {
  18385. this.updateType();
  18386. Laya.timer.once(500, this, () => {
  18387. this.showChallengeLevel();
  18388. });
  18389. });
  18390. });
  18391. if (this.success) {
  18392. xGame.soundMgr.playSound('slots_roll01');
  18393. xGame.soundMgr.playSound("s_win");
  18394. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18395. }
  18396. else {
  18397. xGame.soundMgr.playSound('matchwin01');
  18398. xGame.soundMgr.playSound("s_lose");
  18399. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18400. }
  18401. if (!Moyu.isLegal)
  18402. PlatMgr.showBanner(true);
  18403. let challengeNum = DataMgr.getChallengeTimes();
  18404. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  18405. DataMgr.setChallengeTimes(1);
  18406. }
  18407. if (this.success && xGame.common.gameMode == GameMode.classic) {
  18408. DataMgr.setClassicTimes();
  18409. }
  18410. }
  18411. showChallengeLevel() {
  18412. if (DataMgr.getChallengeTimes() != 0)
  18413. return;
  18414. let skill = DataMgr.getSkillAccTimes();
  18415. let put = DataMgr.getPlaceBallLevelList().length;
  18416. if (skill >= 3 || put >= 5) {
  18417. xGame.uiMgr.Show(UIInvitation$1);
  18418. this.hide();
  18419. }
  18420. }
  18421. addAward(callback) {
  18422. if (!this.success) {
  18423. callback && callback();
  18424. return;
  18425. }
  18426. switch (xGame.common.gameMode) {
  18427. case GameMode.classic:
  18428. this.awardCoinNum = xGame.common.passAwardCoin;
  18429. this.awardDiamondNum = 0;
  18430. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  18431. break;
  18432. case GameMode.bigMove:
  18433. this.awardCoinNum = xGame.common.passAwardCoin;
  18434. this.awardDiamondNum = 0;
  18435. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  18436. callback && callback();
  18437. break;
  18438. case GameMode.placeBall:
  18439. let level = xGame.common.placeBallCurLevel;
  18440. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  18441. if (xGame.common.placeBallStarNum != 3) {
  18442. callback && callback();
  18443. return;
  18444. }
  18445. else {
  18446. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  18447. if (getAward) {
  18448. callback && callback();
  18449. return;
  18450. }
  18451. }
  18452. let cfg = cfgTable.placeballData[level];
  18453. let data = cfgTable.placeballData[level].award;
  18454. this.awardCoinNum = data[0];
  18455. this.awardDiamondNum = data[1];
  18456. if (cfg.type == PlaceBallType.challenge) {
  18457. this.awardDiamondNum = 0;
  18458. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  18459. }
  18460. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  18461. let diamondAward;
  18462. if (this.awardDiamondNum > 0) {
  18463. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  18464. xGame.common.getAward([diamondAward, coinAward], callback);
  18465. }
  18466. else {
  18467. xGame.common.getAward([coinAward], callback);
  18468. }
  18469. if (cfg.type == PlaceBallType.normal) {
  18470. DataMgr.setPlaceBallAward(level);
  18471. }
  18472. break;
  18473. default:
  18474. break;
  18475. }
  18476. }
  18477. playSecretaryAni_old() {
  18478. let parent = this.ui.secretary.displayObject;
  18479. parent.destroyChildren();
  18480. let xx = this.ui.secretary.width / 2;
  18481. let yy = this.ui.secretary.height;
  18482. let scale = xGame.common.getSecretaryScale();
  18483. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18484. if (this.success) {
  18485. let rand = Math.random() <= 0.5 ? 2 : 3;
  18486. xGame.common.secretary.play(data, rand, false, parent, () => {
  18487. xGame.common.secretary.play(data, 1, true, parent);
  18488. });
  18489. }
  18490. else {
  18491. xGame.common.secretary.play(data, 0, true, parent);
  18492. }
  18493. }
  18494. playSecretaryAni() {
  18495. let parent = this.ui.secretary.displayObject;
  18496. parent.destroyChildren();
  18497. let xx = this.ui.secretary.width / 2;
  18498. let yy = this.ui.secretary.height;
  18499. let scale = xGame.common.getSecretaryScale();
  18500. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18501. if (this.success) {
  18502. let rand = 0;
  18503. xGame.common.secretary.play(data, 0, true, parent);
  18504. }
  18505. else {
  18506. xGame.common.secretary.play(data, 0, true, parent);
  18507. }
  18508. }
  18509. restartGame() {
  18510. switch (xGame.common.gameMode) {
  18511. case GameMode.classic:
  18512. xGame.eventMgr.event(RESTART_GAME);
  18513. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18514. break;
  18515. case GameMode.bigMove:
  18516. this.hide();
  18517. xGame.eventMgr.event(RESTART_GAME);
  18518. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18519. break;
  18520. default:
  18521. break;
  18522. }
  18523. }
  18524. hide() {
  18525. super.hide();
  18526. xGame.common.stopGirlPop(this.ui.talkNode);
  18527. PlatMgr.showBanner(false);
  18528. }
  18529. returnHome() {
  18530. this.hide();
  18531. let showFailWords = !this.success;
  18532. xGame.uiMgr.Show(UIMain$1, showFailWords);
  18533. }
  18534. clickLeftBtn() {
  18535. switch (xGame.common.gameMode) {
  18536. case GameMode.classic:
  18537. case GameMode.bigMove:
  18538. this.returnHome();
  18539. break;
  18540. case GameMode.placeBall:
  18541. let level = xGame.common.placeBallCurLevel;
  18542. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  18543. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18544. break;
  18545. default:
  18546. break;
  18547. }
  18548. }
  18549. powerStartPlaceBallLevel(level, btn) {
  18550. if (DataMgr.powerEnough()) {
  18551. btn.touchable = false;
  18552. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  18553. btn.touchable = true;
  18554. DataMgr.setPower(-1);
  18555. xGame.eventMgr.event(POWER_TIME);
  18556. this.startPlaceBallLevel(level);
  18557. }));
  18558. }
  18559. else {
  18560. xGame.uiMgr.Show(UIPower$1, 0);
  18561. }
  18562. }
  18563. clickRightBtn() {
  18564. switch (xGame.common.gameMode) {
  18565. case GameMode.classic:
  18566. console.log('zh:clickRightBtn 111');
  18567. case GameMode.bigMove:
  18568. console.log('zh:clickRightBtn 222');
  18569. this.restartGame();
  18570. break;
  18571. case GameMode.placeBall:
  18572. console.log('zh:clickRightBtn 333');
  18573. let level = xGame.common.placeBallCurLevel;
  18574. let data = DataMgr.getPlaceBallLevel(level);
  18575. let curPss = data.play && !data.isCur;
  18576. if (curPss) {
  18577. console.log('zh:clickRightBtn 333-111');
  18578. console.log('zh:当前LV=' + level);
  18579. if (level == 60) {
  18580. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  18581. Laya.timer.once(3000, this, () => {
  18582. this.returnHome();
  18583. });
  18584. }
  18585. else {
  18586. this.powerStartPlaceBallLevel(level + 1, this.ui.rightBtn);
  18587. }
  18588. }
  18589. else {
  18590. console.log('zh:clickRightBtn 333-000');
  18591. Moyu.sendDataEvent("placeBallNextLevel");
  18592. console.log('zh:qjff_AD_for_uiGameEnd');
  18593. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  18594. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  18595. }
  18596. else {
  18597. console.log('zh:AD 失败,直接发放奖励');
  18598. this.qjff_AD_for_uiGameEnd(level);
  18599. }
  18600. }
  18601. break;
  18602. default:
  18603. console.log('zh:clickRightBtn 444');
  18604. break;
  18605. }
  18606. }
  18607. qjff_AD_for_uiGameEnd(level) {
  18608. DataMgr.setPlaceBallLevel(level, 1);
  18609. this.startPlaceBallLevel(level + 1);
  18610. }
  18611. startPlaceBallLevel(level) {
  18612. xGame.common.gameMode = GameMode.placeBall;
  18613. xGame.common.placeBallCurLevel = level;
  18614. xGame.uiMgr.Show(UIGame$1);
  18615. this.hide();
  18616. }
  18617. }
  18618. UIGameEnd$1.uiName = "UIGameEnd";
  18619. class ShowItem$1 {
  18620. constructor() {
  18621. this.ui = ui_ShowItem.createInstance();
  18622. }
  18623. destroySelf() {
  18624. if (!this.ui.isDisposed) {
  18625. this.ui.removeFromParent();
  18626. this.ui.dispose();
  18627. }
  18628. }
  18629. setParent(parent) {
  18630. parent.addChild(this.ui);
  18631. }
  18632. setPos(x, y) {
  18633. this.ui.x = x;
  18634. this.ui.y = y;
  18635. }
  18636. setUrl(index) {
  18637. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  18638. }
  18639. }
  18640. class UILevelProp$1 extends UIBase {
  18641. constructor() {
  18642. super();
  18643. this.firstPos = 385;
  18644. this.secondPos = 467;
  18645. this.showItemArr = [];
  18646. }
  18647. onConstructor() {
  18648. this.ui = ui_UILevelProp.createInstance();
  18649. this.contentPane = this.ui;
  18650. this.isEject = false;
  18651. this.addUIClick(this.ui.closeBtn, this.hide);
  18652. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18653. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  18654. }
  18655. show(level) {
  18656. super.show();
  18657. this.ui.t1.play();
  18658. this.level = level;
  18659. this.data = cfgTable.placeballData[this.level];
  18660. this.updateSelf();
  18661. this.showPreView();
  18662. this.moneyNode.ui.c1.selectedIndex = 2;
  18663. this.moneyNode.checkPowerTime();
  18664. this.moneyNode.powerChange();
  18665. }
  18666. showPreView() {
  18667. let item;
  18668. let data;
  18669. for (let index = 0; index < this.showItemArr.length; index++) {
  18670. item = this.showItemArr[index];
  18671. item.destroySelf();
  18672. }
  18673. this.showItemArr = [];
  18674. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  18675. for (const key in cfgData) {
  18676. data = cfgData[key];
  18677. item = new ShowItem$1();
  18678. item.setParent(this.ui.myNode.displayRoot);
  18679. item.setPos(data.x, data.y);
  18680. item.setUrl(data.value);
  18681. this.showItemArr.push(item);
  18682. }
  18683. }
  18684. updateSelf() {
  18685. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  18686. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  18687. if (this.data.ball == -1) {
  18688. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  18689. }
  18690. else {
  18691. this.ui.myNode.conditionTxt.text = "Reward";
  18692. }
  18693. let localData = DataMgr.getPlaceBallLevel(this.level);
  18694. let getAward = localData.getAward;
  18695. let cfg = cfgTable.placeballData[this.level];
  18696. let coin = this.data.award[0];
  18697. let diamond = this.data.award[1];
  18698. if (cfg.type == PlaceBallType.challenge) {
  18699. diamond = 0;
  18700. coin = 100;
  18701. }
  18702. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  18703. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  18704. this.ui.myNode.coinNode.numTxt.text = coin + "";
  18705. if (cfg.type == PlaceBallType.challenge) {
  18706. this.ui.myNode.coinNode.numTxt.text = "";
  18707. }
  18708. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  18709. if (coin > 0 && diamond > 0) {
  18710. this.ui.myNode.diamondNode.x = 385;
  18711. this.ui.myNode.coinNode.x = 467;
  18712. }
  18713. else {
  18714. this.ui.myNode.diamondNode.x = 385;
  18715. this.ui.myNode.coinNode.x = 385;
  18716. }
  18717. if (!getAward) {
  18718. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  18719. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  18720. }
  18721. else {
  18722. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  18723. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  18724. }
  18725. }
  18726. startGame() {
  18727. if (DataMgr.powerEnough()) {
  18728. this.ui.myNode.startBtn.touchable = false;
  18729. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  18730. console.log('zh:startGame ');
  18731. this.ui.myNode.startBtn.touchable = true;
  18732. DataMgr.setPower(-1);
  18733. xGame.eventMgr.event(POWER_TIME);
  18734. xGame.common.gameMode = GameMode.placeBall;
  18735. xGame.common.placeBallCurLevel = this.level;
  18736. xGame.uiMgr.Show(UIGame$1);
  18737. xGame.uiMgr.Hide(UILevelDisplay$1);
  18738. xGame.uiMgr.Hide(UIMain$1);
  18739. this.hide();
  18740. }));
  18741. }
  18742. else {
  18743. console.log('zh:startGame no power');
  18744. xGame.uiMgr.Show(UIPower$1);
  18745. }
  18746. }
  18747. hide() {
  18748. super.hide();
  18749. }
  18750. }
  18751. UILevelProp$1.uiName = "UILevelProp";
  18752. class PutBallLevelDisplay$1 {
  18753. constructor(ui, index) {
  18754. this.index = 0;
  18755. this.ui = ui;
  18756. this.index = index;
  18757. this.ui.onClick(this, this.clickSelf);
  18758. this.updateSelf();
  18759. this.ui.levelTxt.text = (this.index + 1) + "";
  18760. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  18761. this.ui.special.levelTxt.text = (this.index + 1) + "";
  18762. }
  18763. updateSelf() {
  18764. let level = this.index + 1;
  18765. this.data = DataMgr.getPlaceBallLevel(level);
  18766. this.ui.starNode.c1.selectedIndex = this.data.star;
  18767. let isChallenge = cfgTable.placeballData[level].type;
  18768. if (this.data.isCur) {
  18769. if (isChallenge) {
  18770. this.ui.c1.selectedIndex = 5;
  18771. }
  18772. else {
  18773. this.ui.c1.selectedIndex = 2;
  18774. }
  18775. }
  18776. else {
  18777. if (this.data.play) {
  18778. if (this.data.star == 3) {
  18779. this.ui.c1.selectedIndex = 0;
  18780. }
  18781. else {
  18782. this.ui.c1.selectedIndex = 1;
  18783. }
  18784. }
  18785. else {
  18786. if (isChallenge) {
  18787. this.ui.c1.selectedIndex = 4;
  18788. }
  18789. else {
  18790. this.ui.c1.selectedIndex = 3;
  18791. }
  18792. }
  18793. }
  18794. }
  18795. clickSelf() {
  18796. if (!this.data.play)
  18797. return;
  18798. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18799. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  18800. }
  18801. }
  18802. class UILevelDisplay$1 extends UIBase {
  18803. constructor() {
  18804. super();
  18805. }
  18806. onConstructor() {
  18807. this.ui = ui_UILevelDisplay.createInstance();
  18808. this.contentPane = this.ui;
  18809. this.isEject = false;
  18810. this.myList = this.ui.myNode.myList;
  18811. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  18812. this.levelItemArr = [];
  18813. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  18814. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  18815. this.myList.numItems = levelNum;
  18816. if (Moyu.isKs)
  18817. this.ui.closeNode.closeBtn.x += 100;
  18818. }
  18819. levelItemRender(index, target) {
  18820. let item = new PutBallLevelDisplay$1(target, index);
  18821. this.levelItemArr.push(item);
  18822. }
  18823. show() {
  18824. super.show();
  18825. this.updateLevel();
  18826. this.scrollToPlace();
  18827. }
  18828. updateLevel() {
  18829. let temp;
  18830. for (let index = 0; index < this.levelItemArr.length; index++) {
  18831. temp = this.levelItemArr[index];
  18832. temp.updateSelf();
  18833. }
  18834. }
  18835. scrollToPlace() {
  18836. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  18837. let passArr = DataMgr.getPlaceBallLevelList();
  18838. let offest = passArr.length;
  18839. if (offest >= maxNum - 1)
  18840. offest = maxNum - 1;
  18841. this.myList.scrollToView(offest, true, true);
  18842. }
  18843. hide() {
  18844. super.hide();
  18845. }
  18846. }
  18847. UILevelDisplay$1.uiName = "UILevelDisplay";
  18848. class UIMatching$1 extends UIBase {
  18849. constructor() {
  18850. super();
  18851. }
  18852. onConstructor() {
  18853. this.ui = ui_UIMatching.createInstance();
  18854. this.contentPane = this.ui;
  18855. this.isEject = false;
  18856. }
  18857. show(callback) {
  18858. super.show();
  18859. PlatMgr.showBanner(true);
  18860. this.callback = callback;
  18861. let user = Moyu.getUserInfo();
  18862. if (!this.selfPot) {
  18863. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  18864. }
  18865. if (!this.aiPot) {
  18866. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  18867. }
  18868. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  18869. this.ui.selfHead.nameTxt.text = user.nickName;
  18870. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  18871. this.ui.aiHead.nameTxt.text = "???";
  18872. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  18873. this.ui.selfHead.c1.selectedIndex = 0;
  18874. this.ui.aiHead.c1.selectedIndex = 0;
  18875. this.ui.selfHead.x = this.selfPot.x;
  18876. this.ui.selfHead.y = this.selfPot.y;
  18877. this.ui.aiHead.x = this.aiPot.x;
  18878. this.ui.aiHead.y = this.aiPot.y;
  18879. switch (xGame.common.gameMode) {
  18880. case GameMode.classic:
  18881. break;
  18882. case GameMode.bigMove:
  18883. this.initSkillData();
  18884. break;
  18885. default:
  18886. break;
  18887. }
  18888. this.ui.t1.play(Laya.Handler.create(this, () => {
  18889. this.ui.t2.play(Laya.Handler.create(this, () => {
  18890. switch (xGame.common.gameMode) {
  18891. case GameMode.classic:
  18892. this.waitingPeople();
  18893. break;
  18894. case GameMode.bigMove:
  18895. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  18896. break;
  18897. default:
  18898. break;
  18899. }
  18900. }));
  18901. }));
  18902. }
  18903. initSkillData() {
  18904. this.skillSelectData = [];
  18905. let skillUrl = xGame.common.skillIconList;
  18906. let skillName = xGame.common.skillNameList;
  18907. let skillLevel = DataMgr.getBigSkillList();
  18908. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  18909. for (let index = 0; index < 5; index++) {
  18910. let obj = {};
  18911. obj.skillImg = skillUrl[index];
  18912. obj.skillName = skillName[index];
  18913. obj.skillType = skillType[index];
  18914. obj.skillLevel = skillLevel[index];
  18915. this.skillSelectData.push(obj);
  18916. }
  18917. }
  18918. getAISkillLevel(myLevel) {
  18919. let video = xGame.common.upSkillLevel;
  18920. let aiLevel;
  18921. let temp;
  18922. if (video) {
  18923. temp = xGame.common.randomNum(-2, -1);
  18924. }
  18925. else {
  18926. if (myLevel <= 5) {
  18927. temp = xGame.common.randomNum(1, 3);
  18928. }
  18929. else if (myLevel <= 9) {
  18930. temp = xGame.common.randomNum(-2, 1);
  18931. }
  18932. else {
  18933. temp = xGame.common.randomNum(-4, 0);
  18934. }
  18935. }
  18936. aiLevel = temp + myLevel;
  18937. if (aiLevel <= 1)
  18938. aiLevel = 1;
  18939. if (aiLevel >= 10)
  18940. aiLevel = 10;
  18941. return aiLevel;
  18942. }
  18943. getAISkillType() {
  18944. return xGame.common.randomNum(1, 4);
  18945. let successTimes = DataMgr.getSkillSuccessTimes();
  18946. let info = cfgTable.aiskillData[successTimes];
  18947. if (!info) {
  18948. let max = Object.keys(cfgTable.aiskillData).length - 1;
  18949. info = cfgTable.aiskillData[max];
  18950. }
  18951. let dataArr = info.skillselect;
  18952. let myCfg = {};
  18953. for (let index = 0; index < dataArr.length; index++) {
  18954. let temp = dataArr[index].split('-');
  18955. myCfg[temp[0]] = {};
  18956. myCfg[temp[0]].id = parseInt(temp[0]);
  18957. myCfg[temp[0]].weight = parseInt(temp[1]);
  18958. }
  18959. let aiCfg = xGame.common.initWeight(myCfg);
  18960. let curData = xGame.common.getRandomWeightData(aiCfg);
  18961. return parseInt(curData.id);
  18962. }
  18963. getAISkillData(index) {
  18964. let myLevel = this.skillSelectData[index].skillLevel;
  18965. let aiLevel = this.getAISkillLevel(myLevel);
  18966. let aiType = this.getAISkillType() - 1;
  18967. return { aiLevel, aiType } = { aiLevel, aiType };
  18968. }
  18969. skillSelectFinish(index) {
  18970. let aiInfo = this.getAISkillData(index);
  18971. xGame.common.gameMgr.selfCurSkill = index;
  18972. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  18973. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  18974. this.ui.selfHead.c1.selectedIndex = 1;
  18975. this.ui.aiHead.c1.selectedIndex = 1;
  18976. let myData = this.skillSelectData[index];
  18977. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  18978. let guide = DataMgr.getSkillGuide();
  18979. if (guide == 0) {
  18980. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  18981. }
  18982. else {
  18983. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  18984. }
  18985. let aiData = this.skillSelectData[aiInfo.aiType];
  18986. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  18987. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  18988. this.waitingPeople();
  18989. }
  18990. waitingPeople() {
  18991. let time = xGame.common.randomNum(1000, 3000);
  18992. time += 1000;
  18993. Laya.timer.once(time, this, () => {
  18994. this.matchingSuccess();
  18995. });
  18996. }
  18997. matchingSuccess() {
  18998. let gameUI = xGame.common.gameUI;
  18999. let name = gameUI.ui.topNode.aiNameTxt.text;
  19000. let url = gameUI.ui.topNode.aiHeadLoader.url;
  19001. this.ui.aiHead.nameTxt.text = name;
  19002. this.ui.aiHead.headImg.url = url;
  19003. name = gameUI.ui.topNode.selfNameTxt.text;
  19004. url = gameUI.ui.topNode.selfHeadLoader.url;
  19005. this.ui.selfHead.nameTxt.text = name;
  19006. this.ui.selfHead.headImg.url = url;
  19007. this.ui.t3.play(Laya.Handler.create(this, () => {
  19008. this.callback && this.callback();
  19009. this.ui.t4.play(Laya.Handler.create(this, () => {
  19010. this.destroySelf();
  19011. }));
  19012. }));
  19013. }
  19014. destroySelf() {
  19015. this.callback = null;
  19016. this.skillSelectData = null;
  19017. this.selfPot = null;
  19018. this.aiPot = null;
  19019. if (!this.ui.isDisposed) {
  19020. this.ui.removeFromParent();
  19021. this.ui.dispose();
  19022. }
  19023. xGame.uiMgr.destroyUI(this);
  19024. }
  19025. }
  19026. UIMatching$1.uiName = "UIMatching";
  19027. class SkillDisplay$1 {
  19028. constructor(ui, data, uiIndex) {
  19029. this.starX = 0;
  19030. this.starY = 0;
  19031. this.index = 0;
  19032. this.ui = ui;
  19033. this.data = data;
  19034. this.index = uiIndex;
  19035. this.initSelf();
  19036. console.log('zh:SkillDisplay constructor this.skillData=', data);
  19037. }
  19038. initSelf() {
  19039. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  19040. this.ui.nameTxt.text = this.data.name;
  19041. this.ui.describeTxt.text = this.data.describe;
  19042. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  19043. this.ui.startBtn.onClick(this, this.startGame);
  19044. this.updateSelf();
  19045. }
  19046. updateSelf() {
  19047. this.checkTry();
  19048. let level = DataMgr.getBigSkillByIndex(this.index);
  19049. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  19050. }
  19051. checkTry() {
  19052. let index = this.index;
  19053. let level = DataMgr.getBigSkillByIndex(index);
  19054. if (level == null) {
  19055. DataMgr.setBigSkill(index, 1, false);
  19056. level = 1;
  19057. }
  19058. this.ui.levelTxt.text = "LV." + level;
  19059. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  19060. this.ui.tryNode.visible = true;
  19061. else
  19062. this.ui.tryNode.visible = false;
  19063. }
  19064. clickAddLevel() {
  19065. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19066. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  19067. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  19068. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  19069. this.qjff_AD_for_skilldisplay_clickAddLevel();
  19070. }
  19071. else {
  19072. console.log('zh:AD 失败,直接发放奖励');
  19073. this.qjff_AD_for_skilldisplay_clickAddLevel();
  19074. }
  19075. }
  19076. qjff_AD_for_skilldisplay_clickAddLevel() {
  19077. DataMgr.setBigSkill(this.data.index, 1);
  19078. this.updateSelf();
  19079. xGame.common.upSkillLevel = true;
  19080. }
  19081. startGame() {
  19082. if (this.data.index == 3) {
  19083. alert('Coming soon!');
  19084. return;
  19085. }
  19086. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19087. let needCoin = xGame.common.bigMoveNeedCoin;
  19088. xGame.common.passAwardCoin = 2000;
  19089. let guide = DataMgr.getSkillGuide();
  19090. console.log('zh:startGame guide=' + guide);
  19091. xGame.common.temSelfLevel = 0;
  19092. if (guide == 0) {
  19093. needCoin = 0;
  19094. xGame.common.temSelfLevel = 100;
  19095. }
  19096. if (DataMgr.coinEnough(needCoin)) {
  19097. DataMgr.setCoin(-needCoin);
  19098. xGame.common.curPlayerSkillType = this.index;
  19099. if (guide == 0)
  19100. xGame.common.curPlayerSkillType = 0;
  19101. xGame.uiMgr.Show(UIGame$1);
  19102. xGame.uiMgr.Hide(UIMain$1);
  19103. xGame.uiMgr.Show(UIMatching$1, () => {
  19104. xGame.common.gameUI.ui.alpha = 1;
  19105. xGame.common.gameUI.startGame();
  19106. xGame.uiMgr.Hide(UISkill$1);
  19107. });
  19108. }
  19109. else {
  19110. xGame.uiMgr.Show(UIAddProp$1, 0);
  19111. Moyu.sendDataEvent("AddCoinVideo");
  19112. }
  19113. }
  19114. }
  19115. class UISkill$1 extends UIBase {
  19116. constructor() {
  19117. super();
  19118. this.skillData = [];
  19119. }
  19120. onConstructor() {
  19121. this.ui = ui_UISkill.createInstance();
  19122. this.contentPane = this.ui;
  19123. this.isEject = false;
  19124. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19125. this.initSkillData();
  19126. console.log('zh:aaaaaa1111111111');
  19127. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  19128. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  19129. console.log('zh:aaaaaa22222222');
  19130. this.displayList = [];
  19131. this.ui.skillNode.skillList.numItems = 3;
  19132. this.addUIClick(this.ui, this.interuptSecretary);
  19133. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  19134. this.ui.talkNode.visible = false;
  19135. if (Moyu.isKs)
  19136. this.ui.closeNode.closeBtn.x += 100;
  19137. }
  19138. show() {
  19139. super.show();
  19140. this.playSecretaryIdle();
  19141. this.moneyNode.ui.c1.selectedIndex = 1;
  19142. Laya.timer.clearAll(this);
  19143. xGame.soundMgr.playSound("s_start");
  19144. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19145. let guide = DataMgr.getSkillGuide();
  19146. this.ui.guideNode.visible = guide == 0;
  19147. let item = this.getSkillItemByUIIndex(0);
  19148. if (guide == 0) {
  19149. item.ui.c1.selectedIndex = 1;
  19150. }
  19151. else {
  19152. item.ui.c1.selectedIndex = 0;
  19153. }
  19154. this.ui.guideNode.guideBtn.visible = guide == 0;
  19155. for (let index = 0; index < this.displayList.length; index++) {
  19156. this.displayList[index].checkTry();
  19157. }
  19158. }
  19159. getSkillItemByUIIndex(cur) {
  19160. for (let index = 0; index < this.displayList.length; index++) {
  19161. if (this.displayList[index].index == cur) {
  19162. return this.displayList[index];
  19163. }
  19164. }
  19165. }
  19166. enterGuideLevel() {
  19167. let item = this.getSkillItemByUIIndex(0);
  19168. item.startGame();
  19169. if (DataMgr.getNewUser())
  19170. Moyu.sendDataEvent("gameStart1");
  19171. }
  19172. initSkillData() {
  19173. this.skillData = [];
  19174. let nameList = xGame.common.skillNameList;
  19175. let iconList = xGame.common.skillIconList;
  19176. let describeList = [
  19177. "Jump shot executed — ball bounced and pocketed an extra one!",
  19178. "Bonus Sweep: A random follow-up strike hits 1 extra ball after your shot!",
  19179. "Freeze Effect: Your shot freezes 1 random ball — enemy can’t hit it, and others bounce off!"
  19180. ];
  19181. console.log('zh:initSkillData 111111111');
  19182. let data;
  19183. for (let index = 0; index < nameList.length; index++) {
  19184. data = {};
  19185. data.name = nameList[index];
  19186. data.icon = iconList[index];
  19187. data.describe = describeList[index];
  19188. data.index = index;
  19189. this.skillData.push(data);
  19190. }
  19191. }
  19192. updateSkillItem(index, target) {
  19193. if (this.displayList[index] == null) {
  19194. let uiIndex;
  19195. switch (index) {
  19196. case 0:
  19197. uiIndex = 1;
  19198. break;
  19199. case 1:
  19200. uiIndex = 0;
  19201. break;
  19202. case 2:
  19203. uiIndex = 2;
  19204. break;
  19205. case 3:
  19206. uiIndex = 3;
  19207. break;
  19208. default:
  19209. break;
  19210. }
  19211. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  19212. this.displayList.push(temp);
  19213. }
  19214. }
  19215. playSecretaryIdle() {
  19216. let parent = this.ui.secretary.displayObject;
  19217. parent.destroyChildren();
  19218. let xx = this.ui.secretary.width / 2;
  19219. let yy = this.ui.secretary.height;
  19220. let scale = xGame.common.getSecretaryScale();
  19221. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19222. xGame.common.secretary.play(data, 0, true, parent);
  19223. }
  19224. returnUIMain() {
  19225. this.hide();
  19226. xGame.common.stopGirlPop(this.ui.talkNode);
  19227. xGame.uiMgr.Show(UIMain$1);
  19228. }
  19229. interuptSecretary() {
  19230. Laya.timer.clearAll(this);
  19231. this.playSecretaryRandomSound();
  19232. }
  19233. playSecretaryRandomSound() {
  19234. if (this.isHide)
  19235. return;
  19236. let time = xGame.common.randomNum(45000, 60000);
  19237. Laya.timer.once(time, this, () => {
  19238. if (this.isHide)
  19239. return;
  19240. let index = xGame.common.randomNum(4, 7);
  19241. xGame.soundMgr.playSound("s_main0" + index);
  19242. let words = 1;
  19243. switch (index) {
  19244. case 4:
  19245. words = 5;
  19246. break;
  19247. case 5:
  19248. words = 3;
  19249. break;
  19250. case 6:
  19251. words = 6;
  19252. break;
  19253. case 7:
  19254. words = 7;
  19255. break;
  19256. default:
  19257. break;
  19258. }
  19259. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19260. this.playSecretaryRandomSound();
  19261. });
  19262. }
  19263. }
  19264. UISkill$1.uiName = "UISkill";
  19265. class UIAddProp$1 extends UIBase {
  19266. constructor() {
  19267. super();
  19268. this.curType = "";
  19269. }
  19270. onConstructor() {
  19271. this.ui = ui_UIAddProp.createInstance();
  19272. this.contentPane = this.ui;
  19273. this.isEject = false;
  19274. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  19275. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  19276. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  19277. this.updateUI();
  19278. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  19279. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  19280. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  19281. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  19282. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  19283. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  19284. }
  19285. show(type) {
  19286. super.show();
  19287. this.curType = type == 0 ? "coin" : "diamond";
  19288. this.switchBtn("");
  19289. this.ui.t0.play();
  19290. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  19291. PlatMgr.showInsert(true);
  19292. }
  19293. closeSelf() {
  19294. this.hide();
  19295. }
  19296. updateUI() {
  19297. let data = cfgTable.moneyData;
  19298. let temp;
  19299. let obj;
  19300. for (const key in data) {
  19301. temp = data[key];
  19302. obj = this.ui.myNode["node" + key];
  19303. if (parseInt(key) <= 2) {
  19304. obj.diamondTxt.text = "+" + temp.num;
  19305. }
  19306. else {
  19307. obj.coinTxt.text = temp.num;
  19308. obj.diamondTxt.text = temp.get.split('_')[1];
  19309. }
  19310. }
  19311. this.updateDiamondShare();
  19312. }
  19313. updateDiamondShare() {
  19314. let data = DataMgr.getShareDiamondTimes();
  19315. if (data >= xGame.common.maxShareDiamondTimes) {
  19316. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  19317. this.ui.myNode.node1.touchable = false;
  19318. }
  19319. else {
  19320. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  19321. this.ui.myNode.node1.touchable = true;
  19322. }
  19323. }
  19324. switchBtn(type) {
  19325. if (type == "")
  19326. type = this.curType;
  19327. else {
  19328. if (this.curType == type) {
  19329. return;
  19330. }
  19331. else {
  19332. this.curType = type;
  19333. }
  19334. }
  19335. if (type == "coin") {
  19336. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  19337. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  19338. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  19339. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  19340. this.ui.myNode.c1.selectedIndex = 0;
  19341. }
  19342. else {
  19343. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  19344. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  19345. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  19346. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  19347. this.ui.myNode.c1.selectedIndex = 1;
  19348. }
  19349. }
  19350. convertCoin(index) {
  19351. let data = cfgTable.moneyData[index];
  19352. let coinNum = data.num;
  19353. let str = data.get.split('_')[1];
  19354. let needDiamond = parseInt(str);
  19355. if (DataMgr.diamondEnough(needDiamond)) {
  19356. DataMgr.setDiamond(-needDiamond);
  19357. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  19358. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  19359. }
  19360. else {
  19361. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  19362. this.switchBtn("diamond");
  19363. }
  19364. }
  19365. videoGetDiamond() {
  19366. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  19367. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  19368. }
  19369. else {
  19370. console.log('zh:AD 失败,直接发放奖励');
  19371. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  19372. }
  19373. }
  19374. qjff_AD_for_uiAddProp_videoGetDiamond() {
  19375. let num = cfgTable.moneyData[2].num;
  19376. xGame.common.playObjFlyAnim(num, Prop.diamond);
  19377. this.closeSelf();
  19378. }
  19379. videoGetCoin() {
  19380. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  19381. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  19382. }
  19383. else {
  19384. console.log('zh:AD 失败,直接发放奖励');
  19385. this.qjff_AD_for_uiAddProp_videoGetCoin();
  19386. }
  19387. }
  19388. qjff_AD_for_uiAddProp_videoGetCoin() {
  19389. xGame.common.playObjFlyAnim(2000, Prop.coin);
  19390. this.closeSelf();
  19391. }
  19392. shareGetDiamond() {
  19393. let times = DataMgr.getShareDiamondTimes();
  19394. if (times >= xGame.common.maxShareDiamondTimes) {
  19395. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  19396. }
  19397. else {
  19398. if (Moyu.isTT) {
  19399. let num = cfgTable.moneyData[1].num;
  19400. Moyu.shareVideo = '';
  19401. Moyu.shareGame((success) => {
  19402. if (success) {
  19403. xGame.uiMgr.Show(UIMsg$1, "分享成功!");
  19404. xGame.common.playObjFlyAnim(num, Prop.diamond);
  19405. DataMgr.setShareDiamondTimes(1);
  19406. this.updateDiamondShare();
  19407. }
  19408. else {
  19409. xGame.uiMgr.Show(UIMsg$1, "分享失败!");
  19410. }
  19411. });
  19412. }
  19413. else {
  19414. Moyu.showVideoAd(() => {
  19415. let diamond = xGame.common.randomNum(50, 100);
  19416. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  19417. DataMgr.setShareDiamondTimes(1);
  19418. this.updateDiamondShare();
  19419. }, EAdType.randomDiamond);
  19420. }
  19421. }
  19422. }
  19423. qjff_AD_for_uiAddProp_shareGetDiamond() {
  19424. }
  19425. openPutBallView() {
  19426. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  19427. let skill = xGame.uiMgr.getUI(UISkill$1);
  19428. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  19429. let uigame = xGame.uiMgr.getUI(UIGame$1);
  19430. if (end && !end.isHide) {
  19431. xGame.uiMgr.Hide(UIGameEnd$1);
  19432. xGame.uiMgr.Show(UIMain$1);
  19433. }
  19434. if (skill && !skill.isHide)
  19435. xGame.uiMgr.Hide(UISkill$1);
  19436. if (uigame && !uigame.isHide)
  19437. xGame.uiMgr.Hide(UIGame$1);
  19438. if (level && !level.isHide) {
  19439. }
  19440. else {
  19441. xGame.uiMgr.Show(UILevelDisplay$1);
  19442. }
  19443. this.closeSelf();
  19444. }
  19445. }
  19446. UIAddProp$1.uiName = "UIAddProp";
  19447. class MoneyNode$1 {
  19448. constructor(ui) {
  19449. this.leftTime = 0;
  19450. this.ui = ui;
  19451. this.ui.addCoinBtn.onClick(this, this.addCoin);
  19452. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  19453. this.ui.addPowerBtn.onClick(this, this.addPower);
  19454. this.ui.c1.selectedIndex = 1;
  19455. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  19456. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  19457. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  19458. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  19459. this.coinChange();
  19460. this.diamondChange();
  19461. this.powerChange();
  19462. }
  19463. addPower() {
  19464. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19465. xGame.uiMgr.Show(UIPower$1);
  19466. }
  19467. powerChange() {
  19468. let powerNum = DataMgr.getPower();
  19469. this.ui.powerTxt.text = powerNum + "";
  19470. }
  19471. checkPowerTime() {
  19472. let cur = new Date().getTime();
  19473. let last = DataMgr.getPowerTime();
  19474. if (last == 0) {
  19475. last = cur;
  19476. DataMgr.setPowerTime(cur);
  19477. }
  19478. let power = DataMgr.getPower();
  19479. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  19480. Laya.timer.clearAll(this);
  19481. if (power >= xGame.common.natureMaxPower) {
  19482. this.ui.powerTimeTxt.text = "";
  19483. DataMgr.setPowerTime(cur);
  19484. return;
  19485. }
  19486. if (power + offset >= xGame.common.natureMaxPower) {
  19487. DataMgr.setPower(xGame.common.natureMaxPower, false);
  19488. this.ui.powerTimeTxt.text = "";
  19489. DataMgr.setPowerTime(cur);
  19490. }
  19491. else {
  19492. if (offset > 0) {
  19493. DataMgr.setPower(offset);
  19494. DataMgr.setPowerTime(cur);
  19495. }
  19496. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  19497. this.leftTime = xGame.common.powerRecoverNum - time;
  19498. if (this.leftTime <= 0)
  19499. this.leftTime = 0;
  19500. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  19501. Laya.timer.loop(1000, this, this.updatePowerTime);
  19502. }
  19503. }
  19504. updatePowerTime() {
  19505. this.leftTime -= 1;
  19506. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  19507. if (this.leftTime <= 0) {
  19508. this.checkPowerTime();
  19509. }
  19510. }
  19511. coinChange() {
  19512. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  19513. }
  19514. diamondChange() {
  19515. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  19516. }
  19517. addCoin() {
  19518. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19519. Moyu.sendDataEvent("AddCoinBtn");
  19520. xGame.uiMgr.Show(UIAddProp$1, 0);
  19521. }
  19522. addDiamond() {
  19523. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19524. Moyu.sendDataEvent("AddDiamondBtn");
  19525. xGame.uiMgr.Show(UIAddProp$1, 1);
  19526. }
  19527. }
  19528. class SettingNode$1 {
  19529. constructor(ui) {
  19530. this.showSetting = false;
  19531. this.openSound = true;
  19532. this.openShake = true;
  19533. this.ui = ui;
  19534. this.ui.soundBtn.onClick(this, this.switchSound);
  19535. this.ui.shakeBtn.onClick(this, this.switchShake);
  19536. this.ui.xyBtn.onClick(this, this.onXy);
  19537. this.ui.clickNode.onClick(this, this.changeSetting);
  19538. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  19539. this.ui.xyBtn.visible = false;
  19540. this.ui.shakeBtn.visible = false;
  19541. }
  19542. changeSetting() {
  19543. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19544. this.showSetting = !this.showSetting;
  19545. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  19546. }
  19547. switchSound() {
  19548. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19549. this.openSound = !this.openSound;
  19550. Moyu.onSetting(this.openSound, this.openShake);
  19551. xGame.soundMgr.onSetting(this.openSound);
  19552. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  19553. }
  19554. switchShake() {
  19555. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19556. this.openShake = !this.openShake;
  19557. Moyu.onSetting(this.openSound, this.openShake);
  19558. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  19559. }
  19560. onXy() {
  19561. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19562. MoyuMgr$1.showXy(1);
  19563. }
  19564. }
  19565. class UIDraw$1 extends UIBase {
  19566. constructor() {
  19567. super();
  19568. this.curKey = 0;
  19569. }
  19570. onConstructor() {
  19571. this.ui = ui_UIDraw.createInstance();
  19572. this.contentPane = this.ui;
  19573. this.isEject = false;
  19574. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19575. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  19576. this.addUIClick(this.ui.drawBtn, this.startDraw);
  19577. this.initDraw();
  19578. this.initUI();
  19579. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  19580. if (Moyu.isKs)
  19581. this.ui.closeNode.closeBtn.x += 100;
  19582. }
  19583. show() {
  19584. super.show();
  19585. this.ui.t0.play();
  19586. this.playSecretaryIdle();
  19587. this.updateDraw();
  19588. this.checkFree();
  19589. if (PlatMgr.bannerDelay > 0) {
  19590. this.ui.closeNode.closeBtn.visible = false;
  19591. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  19592. this.ui.closeNode.closeBtn.visible = true;
  19593. });
  19594. }
  19595. PlatMgr.showRateBanner();
  19596. }
  19597. hide() {
  19598. Laya.timer.clearAll(this);
  19599. super.hide();
  19600. }
  19601. checkFree() {
  19602. let isFree = DataMgr.getDailyfreeDrawTimes();
  19603. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  19604. }
  19605. initDraw() {
  19606. this.drawObj = [];
  19607. let data = cfgTable.drawData;
  19608. let temp;
  19609. let weight = 0;
  19610. for (const key in data) {
  19611. temp = data[key];
  19612. weight += temp.weight;
  19613. this.drawObj.push(weight);
  19614. }
  19615. this.allWeight = weight;
  19616. }
  19617. initUI() {
  19618. let data = cfgTable.drawData;
  19619. let temp;
  19620. let img;
  19621. let txt;
  19622. for (const key in data) {
  19623. temp = data[key];
  19624. img = this.ui.myNode.rotNode["img" + key];
  19625. txt = this.ui.myNode.rotNode["txt" + key];
  19626. img.url = xGame.common.getGameIconUrl(temp.icon);
  19627. txt.visible = true;
  19628. if (temp.award > 2) {
  19629. img.rotation = 0;
  19630. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  19631. }
  19632. else {
  19633. img.rotation = temp.rotation;
  19634. txt.text = temp.num;
  19635. }
  19636. }
  19637. }
  19638. getCurkey() {
  19639. let rand = Math.random() * this.allWeight;
  19640. let temp;
  19641. for (let index = 0; index < this.drawObj.length - 1; index++) {
  19642. temp = this.drawObj[index];
  19643. if (index == 0) {
  19644. if (rand < temp) {
  19645. return index + 1;
  19646. }
  19647. }
  19648. else {
  19649. if (rand >= temp && rand < this.drawObj[index + 1]) {
  19650. return index + 1;
  19651. }
  19652. }
  19653. }
  19654. return 2;
  19655. }
  19656. startDraw() {
  19657. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  19658. if (freeTimes > 0) {
  19659. this.beginDraw();
  19660. DataMgr.setDailyfreeDrawTimes(0);
  19661. this.checkFree();
  19662. }
  19663. else {
  19664. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  19665. }
  19666. else {
  19667. console.log('zh:AD 失败,直接发放奖励');
  19668. this.qjff_chouJiang();
  19669. }
  19670. }
  19671. }
  19672. qjff_chouJiang() {
  19673. this.beginDraw();
  19674. }
  19675. beginDraw() {
  19676. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  19677. this.ui.drawBtn.touchable = false;
  19678. this.curKey = this.getCurkey();
  19679. console.log("当前key", this.curKey);
  19680. let cell = 60;
  19681. let lap = 3;
  19682. let angle = cell * (this.curKey - 1) + lap * 360;
  19683. let target = this.ui.myNode.rotNode;
  19684. target.rotation = 0;
  19685. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  19686. console.log("旋转完成");
  19687. this.ui.drawBtn.touchable = true;
  19688. this.getAward();
  19689. }));
  19690. }
  19691. getAward() {
  19692. let data = cfgTable.drawData[this.curKey];
  19693. let temp = new AwardType();
  19694. temp.type = data.award;
  19695. temp.num = data.num;
  19696. xGame.common.getAward([temp], () => {
  19697. DataMgr.setDrawTimes(1);
  19698. this.updateDraw();
  19699. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  19700. });
  19701. }
  19702. updateDraw() {
  19703. let drawTimes = DataMgr.getDrawTimes();
  19704. let awardTimes = DataMgr.getDrawAwardTimes();
  19705. if (Math.floor(drawTimes / 3) > awardTimes) {
  19706. this.ui.extraNode.boxBtn.t0.play(null, -1);
  19707. this.ui.extraNode.boxBtn.touchable = true;
  19708. this.ui.extraNode.tipsTxt.text = "3/3";
  19709. this.ui.extraNode.barNode.width = 265;
  19710. this.getExtraAward();
  19711. }
  19712. else {
  19713. this.ui.extraNode.boxBtn.t0.stop();
  19714. this.ui.extraNode.boxBtn.touchable = false;
  19715. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  19716. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  19717. }
  19718. let data = cfgTable.drawData[1];
  19719. if (awardTimes == 0) {
  19720. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  19721. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  19722. this.ui.myNode.rotNode.img1.rotation = 0;
  19723. }
  19724. else {
  19725. let award = data.nextid;
  19726. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  19727. this.ui.myNode.rotNode.txt1.text = award[1];
  19728. this.ui.myNode.rotNode.img1.rotation = 0;
  19729. }
  19730. }
  19731. getExtraAward() {
  19732. let drawTimes = DataMgr.getDrawTimes();
  19733. let awardTimes = DataMgr.getDrawAwardTimes();
  19734. let data = cfgTable.drawData[1];
  19735. let award = new AwardType();
  19736. if (awardTimes == 0) {
  19737. award.num = data.num;
  19738. award.type = data.award;
  19739. xGame.common.getAward([award], () => {
  19740. let all = Math.floor(drawTimes / 3);
  19741. DataMgr.setDrawAwardTimes(all);
  19742. this.updateDraw();
  19743. });
  19744. }
  19745. else {
  19746. award.num = parseInt(data.nextid[1]);
  19747. award.type = parseInt(data.nextid[0]);
  19748. xGame.common.getAward([award], () => {
  19749. let all = Math.floor(drawTimes / 3);
  19750. DataMgr.setDrawAwardTimes(all);
  19751. this.updateDraw();
  19752. });
  19753. }
  19754. }
  19755. closeSelf() {
  19756. this.hide();
  19757. }
  19758. playSecretaryIdle() {
  19759. let parent = this.ui.secretary.displayObject;
  19760. parent.destroyChildren();
  19761. let xx = this.ui.secretary.width / 2;
  19762. let yy = this.ui.secretary.height;
  19763. let scale = xGame.common.getSecretaryScale();
  19764. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19765. xGame.common.secretary.play(data, 0, true, parent);
  19766. }
  19767. }
  19768. UIDraw$1.uiName = "UIDraw";
  19769. class UIRanking$1 extends UIBase {
  19770. constructor() {
  19771. super();
  19772. this.showSelf = true;
  19773. this.rankType = 1;
  19774. this.rankList = [];
  19775. this.myIndex = 0;
  19776. this.myStar = 0;
  19777. }
  19778. onConstructor() {
  19779. this.ui = ui_UIRanking.createInstance();
  19780. this.contentPane = this.ui;
  19781. this.isEject = false;
  19782. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  19783. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  19784. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  19785. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  19786. this.ui.myNode.myList.setVirtual();
  19787. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  19788. }
  19789. show() {
  19790. super.show();
  19791. this.myIndex = 51;
  19792. Moyu.getRankList({
  19793. rankId: xGame.common.curRankID,
  19794. type: MoyuRankType.total,
  19795. page: 1,
  19796. pageSize: 50,
  19797. }, this, this.updateItemData);
  19798. this.updateSelf();
  19799. let self = Moyu.getUserInfo();
  19800. if (!self.isAuth) {
  19801. Moyu.initUser(this, () => {
  19802. DataMgr.upRankData();
  19803. });
  19804. }
  19805. }
  19806. updateSelfItem() {
  19807. let self = Moyu.getUserInfo();
  19808. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  19809. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > 50 ? "未上榜" : this.myIndex.toString();
  19810. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  19811. this.ui.myNode.selfNode.nameTxt.text = Moyu.platType < 11 ? self.nickName : "myself";
  19812. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  19813. }
  19814. updateItemData(data) {
  19815. this.myStar = xGame.common.getAllStarNum();
  19816. if (this.rankList.length < 2) {
  19817. this.rankList = data;
  19818. let self = Moyu.getUserInfo();
  19819. for (let i = 0; i < data.length; i++) {
  19820. let data = this.rankList[i];
  19821. if (data.userId == self.userId) {
  19822. this.rankList.splice(i, 1);
  19823. break;
  19824. }
  19825. }
  19826. for (let i = 0; i < data.length; i++) {
  19827. let data = this.rankList[i];
  19828. if (data.rankScore < this.myStar && this.myIndex > 50) {
  19829. this.myIndex = i + 1;
  19830. let user = { headIcon: self.headIcon, nickName: "myself" };
  19831. let ud = { user: user, data: {} };
  19832. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  19833. if (Moyu.platType < 11) {
  19834. user.headIcon = self.headIcon;
  19835. user.nickName = self.nickName;
  19836. }
  19837. this.rankList.splice(i, 0, md);
  19838. break;
  19839. }
  19840. }
  19841. }
  19842. this.updateSelfItem();
  19843. this.ui.myNode.myList.numItems = this.rankList.length;
  19844. }
  19845. updateItemUI(index, obj) {
  19846. let data = this.rankList[index];
  19847. let userData = JSON.parse(data.userData).user;
  19848. obj.nameTxt.text = userData.nickName.toString();
  19849. obj.valueTxt.text = data.rankScore;
  19850. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  19851. obj.rankTxt.text = index + 1;
  19852. switch (index) {
  19853. case 0:
  19854. this.setImg(obj, 1, 0, 0);
  19855. obj.rankTxt.color = "#FFC047";
  19856. break;
  19857. case 1:
  19858. this.setImg(obj, 0, 1, 0);
  19859. obj.rankTxt.color = "#ACACAC";
  19860. break;
  19861. case 2:
  19862. this.setImg(obj, 0, 0, 1);
  19863. obj.rankTxt.color = "#D09672";
  19864. break;
  19865. default:
  19866. this.setImg(obj, 0, 0, 0);
  19867. obj.rankTxt.color = "#496FAB";
  19868. break;
  19869. }
  19870. }
  19871. setImg(obj, a, b, c) {
  19872. obj.img1.visible = a ? true : false;
  19873. obj.img2.visible = b ? true : false;
  19874. obj.img3.visible = c ? true : false;
  19875. }
  19876. changeList(type) {
  19877. this.rankType = type;
  19878. this.updateSelf();
  19879. }
  19880. changeSelfNode() {
  19881. this.showSelf = !this.showSelf;
  19882. this.updateSelf();
  19883. }
  19884. updateSelf() {
  19885. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  19886. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  19887. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  19888. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  19889. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  19890. }
  19891. }
  19892. UIRanking$1.uiName = "UIRanking";
  19893. class UISecretary$1 extends UIBase {
  19894. constructor() {
  19895. super();
  19896. this.curIndex = 1;
  19897. }
  19898. onConstructor() {
  19899. this.ui = ui_UISecretary.createInstance();
  19900. this.contentPane = this.ui;
  19901. this.isEject = false;
  19902. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  19903. this.nodeObj = { left: null, right: null, cur: null };
  19904. this.nodeObj.cur = this.ui.myNode.gameNode3;
  19905. }
  19906. show() {
  19907. super.show();
  19908. this.ui.t0.play();
  19909. this.updateData();
  19910. }
  19911. addSecretarySpine(node, spineName) {
  19912. if (spineName == "mishu") {
  19913. if (this.secretarySpine1) {
  19914. node.displayObject.destroyChildren();
  19915. this.playWoman(this.secretarySpine1, node.displayObject);
  19916. }
  19917. else {
  19918. let spine1 = new SpineMgr("mishu", () => {
  19919. this.secretarySpine1 = spine1;
  19920. this.playWoman(this.secretarySpine1, node.displayObject);
  19921. });
  19922. }
  19923. }
  19924. else {
  19925. if (this.secretarySpine2) {
  19926. node.displayObject.destroyChildren();
  19927. this.playWoman(this.secretarySpine2, node.displayObject);
  19928. }
  19929. else {
  19930. let spine2 = new SpineMgr("xiaomishu2", () => {
  19931. this.secretarySpine2 = spine2;
  19932. this.playWoman(this.secretarySpine2, node.displayObject);
  19933. });
  19934. }
  19935. }
  19936. }
  19937. playWoman(node, parent) {
  19938. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  19939. let yy = this.ui.myNode.gameNode3.secretary.height;
  19940. let scale = 1.5;
  19941. if (node == this.secretarySpine2) {
  19942. scale = 1.2;
  19943. }
  19944. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19945. node.play(data, 0, true, parent);
  19946. }
  19947. turnLeft() {
  19948. this.curIndex--;
  19949. if (this.curIndex < 1) {
  19950. this.curIndex = 2;
  19951. }
  19952. let left = this.nodeObj.left;
  19953. let right = this.nodeObj.right;
  19954. let cur = this.nodeObj.cur;
  19955. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  19956. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  19957. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  19958. this.updateData();
  19959. }));
  19960. this.ui.myNode.setChildIndex(right, 2);
  19961. this.nodeObj.left = cur;
  19962. this.nodeObj.right = left;
  19963. this.nodeObj.cur = right;
  19964. }
  19965. turnRight() {
  19966. this.curIndex++;
  19967. if (this.curIndex > 2) {
  19968. this.curIndex = 1;
  19969. }
  19970. let left = this.nodeObj.left;
  19971. let right = this.nodeObj.right;
  19972. let cur = this.nodeObj.cur;
  19973. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  19974. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  19975. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  19976. this.updateData();
  19977. }));
  19978. this.ui.myNode.setChildIndex(left, 2);
  19979. this.nodeObj.left = right;
  19980. this.nodeObj.right = cur;
  19981. this.nodeObj.cur = left;
  19982. }
  19983. updateData() {
  19984. let data = cfgTable.secretaryshopData;
  19985. let children = this.ui.myNode._children;
  19986. let temp;
  19987. let curData;
  19988. for (let index = 0; index < children.length; index++) {
  19989. temp = children[index];
  19990. curData = data[1];
  19991. temp.heightTxt.text = curData.height;
  19992. temp.foodTxt.text = curData.food;
  19993. temp.historyTxt.text = curData.history;
  19994. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  19995. this.addSecretarySpine(temp.secretary, curData.spine);
  19996. let womanIndex = curData.id - 1;
  19997. let getWoman = DataMgr.getSecretary(womanIndex);
  19998. let curUse = DataMgr.getCurSecretary();
  19999. if (getWoman) {
  20000. if (curUse == womanIndex) {
  20001. temp.purchaseBtn.c1.selectedIndex = 1;
  20002. }
  20003. else {
  20004. temp.purchaseBtn.c1.selectedIndex = 2;
  20005. }
  20006. }
  20007. else {
  20008. temp.purchaseBtn.c1.selectedIndex = 0;
  20009. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  20010. }
  20011. temp.purchaseBtn.offClick(this, this.clickSecretary);
  20012. temp.purchaseBtn.onClick(this, this.clickSecretary, [getWoman, curUse, womanIndex, curData.price]);
  20013. }
  20014. }
  20015. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  20016. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20017. if (getWoman) {
  20018. if (curUse != womanIndex) {
  20019. console.log();
  20020. DataMgr.setCurSecretary(womanIndex);
  20021. this.updateData();
  20022. }
  20023. }
  20024. else {
  20025. let need = needDiamond;
  20026. if (DataMgr.diamondEnough(need)) {
  20027. DataMgr.setDiamond(-need);
  20028. DataMgr.setSecretary(womanIndex, 1);
  20029. DataMgr.setCurSecretary(womanIndex);
  20030. this.updateData();
  20031. }
  20032. else {
  20033. xGame.uiMgr.Show(UIAddProp$1, 1);
  20034. }
  20035. }
  20036. }
  20037. closeSelf() {
  20038. this.hide();
  20039. }
  20040. }
  20041. UISecretary$1.uiName = "UISecretary";
  20042. class BallRodDisplay$1 {
  20043. constructor(ui, index) {
  20044. this.index = 0;
  20045. this.uiIndex = 0;
  20046. this.ui = ui;
  20047. this.index = index;
  20048. this.initData();
  20049. }
  20050. initData() {
  20051. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  20052. let data = cfgTable.ballrodData[this.index + 1];
  20053. this.ui.nameTxt.text = data.name;
  20054. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  20055. this.ui.levelNode.c1.selectedIndex = data.quality;
  20056. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  20057. if (data.spine) {
  20058. this.mySpine = new SpineMgr(data.spine, () => {
  20059. let xx = 150;
  20060. let yy = 70;
  20061. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  20062. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  20063. });
  20064. }
  20065. }
  20066. updateSelf() {
  20067. let get = DataMgr.getBallRod(this.index);
  20068. if (get == null)
  20069. get = 1;
  20070. let curUse = DataMgr.getCurBallRod();
  20071. if (get) {
  20072. if (curUse == this.index) {
  20073. this.ui.purchaseBtn.c1.selectedIndex = 0;
  20074. }
  20075. else {
  20076. this.ui.purchaseBtn.c1.selectedIndex = 1;
  20077. }
  20078. }
  20079. else {
  20080. this.ui.purchaseBtn.c1.selectedIndex = 2;
  20081. }
  20082. }
  20083. buyBallRod() {
  20084. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20085. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  20086. switch (selectedIndex) {
  20087. case 0:
  20088. break;
  20089. case 1:
  20090. DataMgr.setCurBallRod(this.index);
  20091. let ui = xGame.uiMgr.getUI(UIShop$1);
  20092. ui.updateBallRod();
  20093. break;
  20094. case 2:
  20095. let data = cfgTable.ballrodData[this.index + 1];
  20096. let need = data.price;
  20097. if (DataMgr.diamondEnough(need)) {
  20098. DataMgr.setDiamond(-need);
  20099. DataMgr.setBallRod(this.index, 1);
  20100. DataMgr.setCurBallRod(this.index);
  20101. let ui = xGame.uiMgr.getUI(UIShop$1);
  20102. ui.updateBallRod();
  20103. }
  20104. else {
  20105. xGame.uiMgr.Show(UIAddProp$1, 1);
  20106. }
  20107. break;
  20108. default:
  20109. break;
  20110. }
  20111. }
  20112. }
  20113. class UIShop$1 extends UIBase {
  20114. constructor() {
  20115. super();
  20116. this.itemNums = 0;
  20117. }
  20118. onConstructor() {
  20119. this.ui = ui_UIShop.createInstance();
  20120. this.contentPane = this.ui;
  20121. this.isEject = false;
  20122. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20123. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  20124. this.addUIClick(this.ui, this.interuptSecretary);
  20125. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  20126. this.ballRodArr = [];
  20127. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  20128. this.ui.myNode.myList.numItems = this.itemNums;
  20129. if (Moyu.isKs)
  20130. this.ui.closeNode.closeBtn.x += 100;
  20131. }
  20132. show() {
  20133. super.show();
  20134. this.playSecretaryIdle();
  20135. this.updateBallRod();
  20136. }
  20137. updateBallRod() {
  20138. for (let index = 0; index < this.ballRodArr.length; index++) {
  20139. this.ballRodArr[index].updateSelf();
  20140. }
  20141. }
  20142. renderBallRod(sort, obj) {
  20143. let index = this.getIndexBySort(sort + 1) - 1;
  20144. let ballRod = new BallRodDisplay$1(obj, index);
  20145. this.ballRodArr.push(ballRod);
  20146. }
  20147. getIndexBySort(sort) {
  20148. let object = cfgTable.ballrodData;
  20149. for (const key in object) {
  20150. if (object[key].sort == sort) {
  20151. return parseInt(key);
  20152. }
  20153. }
  20154. }
  20155. playSecretaryIdle() {
  20156. let parent = this.ui.secretary.displayObject;
  20157. parent.destroyChildren();
  20158. let xx = this.ui.secretary.width / 2;
  20159. let yy = this.ui.secretary.height;
  20160. let scale = xGame.common.getSecretaryScale();
  20161. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20162. xGame.common.secretary.play(data, 0, true, parent);
  20163. }
  20164. interuptSecretary() {
  20165. Laya.timer.clearAll(this);
  20166. this.playSecretaryRandomSound();
  20167. }
  20168. playSecretaryRandomSound() {
  20169. if (this.isHide)
  20170. return;
  20171. let time = xGame.common.randomNum(45000, 60000);
  20172. Laya.timer.once(time, this, () => {
  20173. if (this.isHide)
  20174. return;
  20175. let index = xGame.common.randomNum(4, 7);
  20176. xGame.soundMgr.playSound("s_main0" + index);
  20177. let words = 1;
  20178. switch (index) {
  20179. case 4:
  20180. words = 5;
  20181. break;
  20182. case 5:
  20183. words = 3;
  20184. break;
  20185. case 6:
  20186. words = 6;
  20187. break;
  20188. case 7:
  20189. words = 7;
  20190. break;
  20191. default:
  20192. break;
  20193. }
  20194. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20195. this.playSecretaryRandomSound();
  20196. });
  20197. }
  20198. closeSelf() {
  20199. this.hide();
  20200. }
  20201. }
  20202. UIShop$1.uiName = "UIShop";
  20203. class SignMax$1 {
  20204. constructor(ui) {
  20205. this.ui = ui;
  20206. }
  20207. updateSelf(index, sameDay, curDayIndex) {
  20208. let data = cfgTable.signData[index + 1];
  20209. this.ui.titleTxt.text = data.title;
  20210. let arr1 = data.award[0].split('-');
  20211. let arr2 = data.award[1].split('-');
  20212. let num1 = parseInt(arr1[1]);
  20213. let num2 = parseInt(arr2[1]);
  20214. this.ui.numTxt1.text = num1 + "";
  20215. this.ui.numTxt2.text = num2 + "";
  20216. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  20217. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  20218. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  20219. this.ui.numTxt1.visible = false;
  20220. }
  20221. else {
  20222. this.ui.numTxt1.visible = true;
  20223. }
  20224. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  20225. this.ui.numTxt2.visible = false;
  20226. }
  20227. else {
  20228. this.ui.numTxt2.visible = true;
  20229. }
  20230. if (index < curDayIndex) {
  20231. this.ui.c1.selectedIndex = 1;
  20232. }
  20233. else if (index == curDayIndex) {
  20234. if (sameDay) {
  20235. this.ui.c1.selectedIndex = 2;
  20236. }
  20237. else {
  20238. this.ui.c1.selectedIndex = 2;
  20239. }
  20240. }
  20241. else {
  20242. this.ui.c1.selectedIndex = 0;
  20243. }
  20244. }
  20245. }
  20246. class SignNormal$1 {
  20247. constructor(ui) {
  20248. this.ui = ui;
  20249. }
  20250. updateSelf(index, sameDay, curDayIndex) {
  20251. let data = cfgTable.signData[index + 1];
  20252. this.ui.titleTxt.text = data.title;
  20253. let arr = data.award[0].split('-');
  20254. let type = parseInt(arr[0]);
  20255. let num = parseInt(arr[1]);
  20256. this.ui.numTxt.text = num + "";
  20257. if (type > 2) {
  20258. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  20259. this.ui.myIcon.rotation = 0;
  20260. }
  20261. else {
  20262. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  20263. this.ui.myIcon.rotation = 0;
  20264. }
  20265. if (xGame.common.signAwardContainsRod(data.award)) {
  20266. this.ui.numTxt.visible = false;
  20267. }
  20268. else {
  20269. this.ui.numTxt.visible = true;
  20270. }
  20271. if (index < curDayIndex) {
  20272. this.ui.c1.selectedIndex = 1;
  20273. }
  20274. else if (index == curDayIndex) {
  20275. if (sameDay) {
  20276. this.ui.c1.selectedIndex = 2;
  20277. }
  20278. else {
  20279. this.ui.c1.selectedIndex = 2;
  20280. }
  20281. }
  20282. else {
  20283. this.ui.c1.selectedIndex = 0;
  20284. }
  20285. }
  20286. }
  20287. class UISign$1 extends UIBase {
  20288. constructor() {
  20289. super();
  20290. this.curDayIndex = 0;
  20291. this.starX = 0;
  20292. }
  20293. onConstructor() {
  20294. this.ui = ui_UISign.createInstance();
  20295. this.contentPane = this.ui;
  20296. this.isEject = false;
  20297. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20298. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  20299. this.initSignItem();
  20300. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  20301. this.addUIClick(this.ui.againBtn, this.againGetAward);
  20302. }
  20303. show() {
  20304. super.show();
  20305. this.ui.t0.play();
  20306. this.playSecretaryIdle();
  20307. this.updateSign();
  20308. }
  20309. initSignItem() {
  20310. this.signArr = [];
  20311. for (let index = 0; index < 6; index++) {
  20312. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  20313. this.signArr.push(temp);
  20314. }
  20315. this.signMax = new SignMax$1(this.ui.myNode.day7);
  20316. if (Moyu.isKs)
  20317. this.ui.closeNode.closeBtn.x += 100;
  20318. }
  20319. updateSign() {
  20320. let sameDay = xGame.common.judgeSameDay();
  20321. let max = 7;
  20322. this.curDayIndex = DataMgr.getSignData();
  20323. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  20324. this.curDayIndex = 0;
  20325. if (!sameDay) {
  20326. this.ui.normalBtn.visible = true;
  20327. this.ui.tipsNode.visible = false;
  20328. this.ui.againBtn.visible = false;
  20329. }
  20330. else {
  20331. this.ui.normalBtn.visible = false;
  20332. let again = DataMgr.getExtraSign();
  20333. let isCurrency = false;
  20334. let index = this.curDayIndex;
  20335. if (index == 0)
  20336. index = 7;
  20337. let award = cfgTable.signData[index].award;
  20338. let num = award[0].split("-")[0];
  20339. if (num == "1" || num == "2")
  20340. isCurrency = true;
  20341. let showAgain = again == 0 && isCurrency;
  20342. this.ui.againBtn.visible = showAgain;
  20343. this.ui.tipsNode.visible = !showAgain;
  20344. }
  20345. for (let index = 0; index < this.signArr.length; index++) {
  20346. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  20347. }
  20348. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  20349. }
  20350. playSecretaryIdle() {
  20351. let parent = this.ui.secretary.displayObject;
  20352. parent.destroyChildren();
  20353. let xx = this.ui.secretary.width / 2;
  20354. let yy = this.ui.secretary.height;
  20355. let scale = xGame.common.getSecretaryScale();
  20356. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20357. xGame.common.secretary.play(data, 0, true, parent);
  20358. }
  20359. closeSelf() {
  20360. this.hide();
  20361. }
  20362. normalGetAward() {
  20363. let sameDay = xGame.common.judgeSameDay();
  20364. if (!sameDay) {
  20365. let award = cfgTable.signData[this.curDayIndex + 1].award;
  20366. let temp;
  20367. let type;
  20368. let num;
  20369. let arr = [];
  20370. for (let index = 0; index < award.length; index++) {
  20371. temp = award[index].split("-");
  20372. type = parseInt(temp[0]);
  20373. num = parseInt(temp[1]);
  20374. let awardType = new AwardType();
  20375. awardType.num = num;
  20376. awardType.type = type;
  20377. arr.push(awardType);
  20378. }
  20379. xGame.common.getAward(arr, (watchVideo) => {
  20380. this.curDayIndex++;
  20381. if (this.curDayIndex > 7)
  20382. this.curDayIndex = 0;
  20383. DataMgr.setSignData(this.curDayIndex);
  20384. DataMgr.setSignTime(new Date().getTime());
  20385. if (watchVideo) {
  20386. DataMgr.setExtraSign(1);
  20387. Moyu.sendDataEvent("signIn1");
  20388. }
  20389. this.updateSign();
  20390. });
  20391. }
  20392. }
  20393. againGetAward() {
  20394. Moyu.sendDataEvent("signIn2");
  20395. console.log('zh:qjff_AD_for_uisign');
  20396. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  20397. }
  20398. else {
  20399. console.log('zh:AD 失败,直接发放奖励');
  20400. this.qjff_AD_for_uisign();
  20401. }
  20402. }
  20403. qjff_AD_for_uisign() {
  20404. let index = this.curDayIndex;
  20405. if (index == 0)
  20406. index = 7;
  20407. let award = cfgTable.signData[index].award;
  20408. let temp;
  20409. let type;
  20410. let num;
  20411. for (let index = 0; index < award.length; index++) {
  20412. temp = award[index].split("-");
  20413. type = parseInt(temp[0]);
  20414. num = parseInt(temp[1]) * 3;
  20415. xGame.common.playObjFlyAnim(num, type);
  20416. }
  20417. DataMgr.setExtraSign(1);
  20418. this.updateSign();
  20419. }
  20420. }
  20421. UISign$1.uiName = "UISign";
  20422. class UIModeSelection$1 extends UIBase {
  20423. constructor() {
  20424. super();
  20425. }
  20426. onConstructor() {
  20427. this.ui = ui_UIModeSelection.createInstance();
  20428. this.contentPane = this.ui;
  20429. this.isEject = false;
  20430. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  20431. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  20432. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  20433. this.addUIClick(this.ui.closeBtn, this.hide);
  20434. this.peopleArr = [650, 6900, 3800];
  20435. this.peopleOffest = [50, 500, 200];
  20436. this.updateSelf();
  20437. }
  20438. show(callback) {
  20439. super.show();
  20440. this.ui.t0.play();
  20441. this.callback = callback;
  20442. }
  20443. updateSelf() {
  20444. let cfg = cfgTable.modeselectData;
  20445. for (let index = 1; index <= 3; index++) {
  20446. let node = this.ui.myNode["type" + index];
  20447. node.need.text = cfg[index].need;
  20448. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  20449. node.peopleTxt.text = this.getRandPeople(index - 1);
  20450. }
  20451. }
  20452. enterGame(type) {
  20453. xGame.common.classicRoomType = type;
  20454. let cfg = cfgTable.modeselectData[type];
  20455. let need = cfg.need;
  20456. xGame.common.passAwardCoin = cfg.award;
  20457. if (DataMgr.coinEnough(need)) {
  20458. DataMgr.setCoin(-need);
  20459. this.ui.myNode["type" + type].t0.play();
  20460. Laya.timer.once(200, this, () => {
  20461. this.callback && this.callback();
  20462. });
  20463. }
  20464. else {
  20465. Moyu.sendDataEvent("AddCoinVideo");
  20466. xGame.uiMgr.Show(UIAddProp$1, 0);
  20467. }
  20468. }
  20469. getRandPeople(index) {
  20470. let rand = this.peopleOffest[index];
  20471. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  20472. }
  20473. }
  20474. UIModeSelection$1.uiName = "UIModeSelection";
  20475. class UITry$1 extends UIBase {
  20476. constructor() {
  20477. super();
  20478. this.closeTime = 0;
  20479. this.closeNum = 0;
  20480. this.skillUrl = xGame.common.skillIconList;
  20481. }
  20482. onConstructor() {
  20483. this.ui = ui_UITry.createInstance();
  20484. this.contentPane = this.ui;
  20485. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  20486. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  20487. }
  20488. show() {
  20489. super.show();
  20490. this.closeNum = 0;
  20491. this.closeTime = 15;
  20492. this.ui.t0.play();
  20493. PlatMgr.showRateBanner();
  20494. this.ui.myNode.txtTime.text = this.closeTime.toString();
  20495. Laya.timer.loop(1000, this, this.updateTime);
  20496. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  20497. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  20498. xGame.common.gameMgr.gamePause = true;
  20499. }
  20500. updateTime() {
  20501. if (this.closeTime > 1) {
  20502. this.closeTime--;
  20503. this.ui.myNode.txtTime.text = this.closeTime.toString();
  20504. }
  20505. else
  20506. this.hide();
  20507. }
  20508. hide() {
  20509. Laya.timer.clearAll(this);
  20510. Moyu.showBannerAd(false);
  20511. super.hide();
  20512. xGame.common.gameMgr.gamePause = false;
  20513. }
  20514. onTry() {
  20515. console.log('zh:qjff_AD_for_uitry');
  20516. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  20517. }
  20518. else {
  20519. console.log('zh:AD 失败,直接发放奖励');
  20520. this.qjff_AD_for_uitry();
  20521. }
  20522. }
  20523. qjff_AD_for_uitry() {
  20524. let select = xGame.common.curPlayerSkillType;
  20525. DataMgr.gameData.trySkill = select;
  20526. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  20527. DataMgr.saveGameData();
  20528. DataMgr.setBigSkill(select, 1);
  20529. xGame.showTip("Trial Successful");
  20530. this.hide();
  20531. }
  20532. onCancel() {
  20533. if (this.closeNum > 0) {
  20534. this.closeNum--;
  20535. if (this.closeNum < 2)
  20536. this.hide();
  20537. return;
  20538. }
  20539. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  20540. this.onTry();
  20541. }
  20542. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  20543. this.closeNum = 3;
  20544. }
  20545. else
  20546. this.hide();
  20547. }
  20548. }
  20549. UITry$1.uiName = "UITry";
  20550. class UIGetAward$1 extends UIBase {
  20551. constructor() {
  20552. super();
  20553. this.showTriple = true;
  20554. }
  20555. onConstructor() {
  20556. this.ui = ui_UIGetAward.createInstance();
  20557. this.contentPane = this.ui;
  20558. this.isEject = false;
  20559. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  20560. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  20561. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  20562. }
  20563. show(arr, showTriple, callback) {
  20564. super.show();
  20565. this.ui.t0.play();
  20566. this.ui.eftNode.visible = true;
  20567. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  20568. this.ui.eftNode.visible = false;
  20569. }), 1, 0, 0, 0.9);
  20570. this.awardArr = arr;
  20571. this.showTriple = showTriple;
  20572. this.callback = callback;
  20573. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  20574. this.ui.myList.numItems = arr.length;
  20575. xGame.soundMgr.playSound("getaward");
  20576. }
  20577. updateSelf(index, obj) {
  20578. let temp = this.awardArr[index];
  20579. let icon = this.getIcon(temp.type);
  20580. let str = icon;
  20581. if (temp.type > 2) {
  20582. str = "s" + icon;
  20583. }
  20584. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  20585. obj.myIcon.rotation = 0;
  20586. obj.numTxt.text = temp.num + "";
  20587. obj.numTxt.visible = temp.type > 2 ? false : true;
  20588. obj.nameTxt.text = this.getNameStr(temp.type);
  20589. }
  20590. renderItem(index, obj) {
  20591. this.updateSelf(index, obj);
  20592. }
  20593. tripleGetAward() {
  20594. console.log('zh:qjff_AD_for_uigetAward');
  20595. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  20596. }
  20597. else {
  20598. console.log('zh:AD 失败,直接发放奖励');
  20599. this.qjff_AD_for_uigetAward();
  20600. }
  20601. }
  20602. qjff_AD_for_uigetAward() {
  20603. this.getAward(3);
  20604. }
  20605. normalGetAward() {
  20606. if (PlatMgr.isMisVideo())
  20607. this.tripleGetAward();
  20608. else
  20609. this.getAward();
  20610. }
  20611. getAward(times = 1) {
  20612. this.hide();
  20613. for (let index = 0; index < this.awardArr.length; index++) {
  20614. this.awardArr[index].num *= times;
  20615. }
  20616. this.callback && this.callback(times != 1);
  20617. }
  20618. getIcon(type) {
  20619. switch (type) {
  20620. case Prop.diamond:
  20621. return "ty_zs";
  20622. case Prop.coin:
  20623. return "ty_jb";
  20624. case Prop.gan1:
  20625. return "qg1";
  20626. case Prop.gan2:
  20627. return "qg2";
  20628. case Prop.gan3:
  20629. return "qg3";
  20630. case Prop.gan4:
  20631. return "qg4";
  20632. default:
  20633. break;
  20634. }
  20635. }
  20636. getNameStr(type) {
  20637. switch (type) {
  20638. case Prop.diamond:
  20639. return "Diamond";
  20640. case Prop.coin:
  20641. return "Coins";
  20642. case Prop.gan1:
  20643. case Prop.gan2:
  20644. case Prop.gan3:
  20645. case Prop.gan4:
  20646. return cfgTable.ballrodData[type - 1].name;
  20647. default:
  20648. break;
  20649. }
  20650. }
  20651. }
  20652. UIGetAward$1.uiName = "UIGetAward";
  20653. class UIBox$1 extends UIBase {
  20654. constructor() {
  20655. super();
  20656. this.boxNum = 0;
  20657. this.boxMax = 10;
  20658. this.inAd = false;
  20659. this.isClose = false;
  20660. }
  20661. onConstructor() {
  20662. this.ui = ui_UIBox.createInstance();
  20663. this.contentPane = this.ui;
  20664. this.isEject = false;
  20665. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  20666. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  20667. Laya.timer.loop(1000, this, this.update);
  20668. }
  20669. update() {
  20670. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  20671. this.boxNum -= 1;
  20672. this.upBar();
  20673. }
  20674. }
  20675. upBar() {
  20676. if (this.boxNum > this.boxMax)
  20677. this.boxNum = this.boxMax;
  20678. this.ui.bar.value = this.boxNum * 10;
  20679. }
  20680. show() {
  20681. super.show();
  20682. this.isClose = false;
  20683. this.boxNum = 0;
  20684. this.inAd = false;
  20685. this.upBar();
  20686. this.ui.t0.play();
  20687. this.ui.closeBtn.visible = false;
  20688. Laya.timer.once(3000, this, () => {
  20689. this.ui.closeBtn.visible = true;
  20690. this.ui.bar.alpha = 1;
  20691. });
  20692. Laya.timer.once(500, this, () => {
  20693. this.ui.t1.play();
  20694. });
  20695. }
  20696. hide() {
  20697. Laya.timer.clearAll(this);
  20698. Moyu.showBannerAd(false);
  20699. super.hide();
  20700. }
  20701. onOpenBox() {
  20702. this.boxNum++;
  20703. if (this.boxNum < this.boxMax) {
  20704. if (PlatMgr.getRand() < PlatMgr.boxInsertRate)
  20705. Moyu.showInsertAd(0, PlatMgr.insertGap);
  20706. }
  20707. else if (this.boxNum == this.boxMax) {
  20708. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  20709. this.ui.openBtn.c1.selectedIndex = 13;
  20710. this.inAd = true;
  20711. }
  20712. else
  20713. this.getAward();
  20714. }
  20715. else if (this.inAd) {
  20716. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  20717. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  20718. }
  20719. else {
  20720. console.log('zh:AD 失败,直接发放奖励');
  20721. this.qjff_AD_for_UIBOX_onOpenBox();
  20722. }
  20723. }
  20724. this.upBar();
  20725. }
  20726. qjff_AD_for_UIBOX_onOpenBox() {
  20727. this.getAward();
  20728. }
  20729. onCloseBox() {
  20730. if (this.isClose)
  20731. this.hide();
  20732. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  20733. this.isClose = true;
  20734. PlatMgr.showBanner(true, 0, 3000);
  20735. }
  20736. else
  20737. this.hide();
  20738. }
  20739. getAward() {
  20740. let str = "";
  20741. if (Math.random() < 0.5) {
  20742. let max = Moyu.isLegal ? 500 : 2500;
  20743. let num = xGame.tools.random(max, 500 + max);
  20744. DataMgr.setCoin(num);
  20745. str = "金币x" + num;
  20746. }
  20747. else {
  20748. let max = Moyu.isLegal ? 10 : 30;
  20749. let num = xGame.tools.random(max, 30 + max);
  20750. DataMgr.setDiamond(num);
  20751. str = "钻石x" + num;
  20752. }
  20753. xGame.showTip("恭喜获得-" + str);
  20754. this.hide();
  20755. }
  20756. }
  20757. UIBox$1.uiName = "UIBox";
  20758. class UIMain$1 extends UIBase {
  20759. constructor() {
  20760. super();
  20761. this.firstEnter = true;
  20762. }
  20763. nativeCallJs(msg) {
  20764. let t = msg;
  20765. console.log("zh: nativeCallJs 奖励开始发放:", t);
  20766. switch (t) {
  20767. case 'qjff_chouJiang':
  20768. let dui = xGame.uiMgr.getUI(UIDraw$1);
  20769. dui.qjff_chouJiang();
  20770. break;
  20771. case 'qjff_AD_for_uisign':
  20772. let dui2 = xGame.uiMgr.getUI(UISign$1);
  20773. dui2.qjff_AD_for_uisign();
  20774. break;
  20775. case 'qjff_AD_for_uitry':
  20776. let dui3 = xGame.uiMgr.getUI(UITry$1);
  20777. dui3.qjff_AD_for_uitry();
  20778. break;
  20779. case 'qjff_AD_for_uipower':
  20780. let dui4 = xGame.uiMgr.getUI(UIPower$1);
  20781. dui4.qjff_AD_for_uipower();
  20782. break;
  20783. case 'qjff_AD_for_uigetAward':
  20784. let dui5 = xGame.uiMgr.getUI(UIGetAward$1);
  20785. dui5.qjff_AD_for_uigetAward();
  20786. break;
  20787. case 'qjff_AD_for_uiGameEnd':
  20788. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  20789. let dui6 = xGame.uiMgr.getUI(UIGameEnd$1);
  20790. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  20791. break;
  20792. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  20793. let dui7 = xGame.uiMgr.getUI(UIAddProp$1);
  20794. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  20795. break;
  20796. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  20797. let dui8 = xGame.uiMgr.getUI(UIAddProp$1);
  20798. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  20799. break;
  20800. case 'qjff_AD_for_UIrepentProp_videoRegret':
  20801. let dui9 = xGame.uiMgr.getUI(UIRepentProp$1);
  20802. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  20803. break;
  20804. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  20805. let dui10 = xGame.uiMgr.getUI(UIRepentProp$1);
  20806. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  20807. break;
  20808. case 'qjff_AD_for_UIBOX_onOpenBox':
  20809. let dui11 = xGame.uiMgr.getUI(UIBox$1);
  20810. dui11.qjff_AD_for_UIBOX_onOpenBox();
  20811. break;
  20812. case 'qjff_AD_for_UIAddCoin':
  20813. let dui12 = xGame.uiMgr.getUI(UIAddCoin$1);
  20814. dui12.qjff_AD_for_UIAddCoin();
  20815. break;
  20816. case '111a':
  20817. let dui14 = xGame.uiMgr.getUI(UISign$1);
  20818. dui14.qjff_AD_for_uisign();
  20819. break;
  20820. case '222a':
  20821. let dui15 = xGame.uiMgr.getUI(UISign$1);
  20822. dui15.qjff_AD_for_uisign();
  20823. break;
  20824. case '333a':
  20825. let dui16 = xGame.uiMgr.getUI(UISign$1);
  20826. dui16.qjff_AD_for_uisign();
  20827. break;
  20828. default:
  20829. console.log('zh:未知的方法名字' + t);
  20830. break;
  20831. }
  20832. }
  20833. onConstructor() {
  20834. console.log('zh: UIMain onConstructor');
  20835. this.ui = ui_UIMain.createInstance();
  20836. this.contentPane = this.ui;
  20837. this.isEject = false;
  20838. this.addEvent();
  20839. this.addClickSpine();
  20840. this.settingNode = new SettingNode$1(this.ui.settingNode);
  20841. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20842. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  20843. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  20844. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  20845. let curUse = DataMgr.getCurSecretary();
  20846. this.changeSecretary(curUse);
  20847. this.ui.talkNode.visible = false;
  20848. let guide = DataMgr.getSkillGuide();
  20849. if (xGame.common.isNewDay && guide == 1) {
  20850. xGame.common.isNewDay = false;
  20851. xGame.soundMgr.playSound("s_main01");
  20852. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20853. console.log("播放小秘书每天语音");
  20854. }
  20855. this.onGetUserInfo();
  20856. this.ui.n83.visible = false;
  20857. Moyu.setShareInfo("8Ball Fury", ["台球", "万宁", "桌球"], '2300002254');
  20858. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  20859. }
  20860. changeSecretary(curUse) {
  20861. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  20862. xGame.common.secretary && xGame.common.secretary.dispose();
  20863. this.addSecretarySpine(name);
  20864. }
  20865. addSecretarySpine(name) {
  20866. let spine = new SpineMgr(name, () => {
  20867. this.playSecretaryIdle();
  20868. });
  20869. xGame.common.secretary = spine;
  20870. }
  20871. addClickSpine() {
  20872. let clickSpine = new SpineMgr("dianji", () => {
  20873. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  20874. let parent = Laya.stage;
  20875. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  20876. clickSpine.play(data, 0, false, parent, (spine) => {
  20877. spine.destroy(true);
  20878. });
  20879. });
  20880. });
  20881. }
  20882. addEvent() {
  20883. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  20884. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  20885. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  20886. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  20887. this.addUIClick(this.ui.weeklyBtn, this.startWeekly);
  20888. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  20889. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  20890. this.addUIClick(this.ui, this.interuptSecretary);
  20891. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  20892. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  20893. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  20894. this.addUIClick(this.ui.shopBtn, this.openShopView);
  20895. this.addUIClick(this.ui.signBtn, this.openSignView);
  20896. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  20897. }
  20898. show(showFailWords) {
  20899. super.show();
  20900. this.moneyNode.ui.c1.selectedIndex = 1;
  20901. this.playSecretaryIdle();
  20902. xGame.soundMgr.playMusic("caromhall01");
  20903. Laya.timer.clearAll(this);
  20904. this.playSecretaryRandomSound();
  20905. if (showFailWords) {
  20906. setTimeout(() => {
  20907. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  20908. let words = -1;
  20909. if (str == "s_main02") {
  20910. words = 2;
  20911. }
  20912. else {
  20913. words = 3;
  20914. }
  20915. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20916. xGame.soundMgr.playSound(str);
  20917. }, 300);
  20918. }
  20919. this.showGuide();
  20920. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  20921. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  20922. let guide = DataMgr.getSkillGuide();
  20923. if (guide == 1) {
  20924. let randTime = xGame.common.randomNum(300, 800);
  20925. if (this.firstEnter) {
  20926. this.firstEnter = false;
  20927. randTime += 900;
  20928. }
  20929. Laya.timer.once(randTime, this, () => {
  20930. xGame.common.autoPopUIView();
  20931. });
  20932. }
  20933. }
  20934. checkActive(show) {
  20935. }
  20936. showGuide() {
  20937. let guide = DataMgr.getSkillGuide();
  20938. this.ui.guideBtn.visible = guide == 0;
  20939. this.ui.enterGuide.visible = false;
  20940. this.ui.secretaryGuide.visible = guide == 0;
  20941. if (guide == 0) {
  20942. xGame.soundMgr.playSound("s_guide");
  20943. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20944. }
  20945. }
  20946. ensureSecretary() {
  20947. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  20948. this.ui.secretaryGuide.visible = false;
  20949. this.ui.enterGuide.visible = true;
  20950. this.ui.wordsNode.t0.play();
  20951. if (DataMgr.getNewUser())
  20952. Moyu.sendDataEvent("gameReady");
  20953. }
  20954. playSecretaryIdle() {
  20955. let parent = this.ui.secretary.displayObject;
  20956. parent.destroyChildren();
  20957. let xx = this.ui.secretary.width / 2;
  20958. let yy = this.ui.secretary.height;
  20959. let scale = xGame.common.getSecretaryScale();
  20960. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20961. console.log("zh:playSecretaryIdle", data);
  20962. xGame.common.secretary.play(data, 0, true, parent);
  20963. }
  20964. startGame(type) {
  20965. xGame.common.gameMode = type;
  20966. Moyu.sendDataEvent("PlayGame", { type: type });
  20967. switch (xGame.common.gameMode) {
  20968. case GameMode.classic:
  20969. let challengeTimes = DataMgr.getChallengeTimes();
  20970. if (challengeTimes == 0) {
  20971. xGame.uiMgr.Show(UIInvitation$1);
  20972. }
  20973. else {
  20974. this.beginGame();
  20975. }
  20976. break;
  20977. case GameMode.bigMove:
  20978. this.beginGame();
  20979. if (DataMgr.getNewUser())
  20980. Moyu.sendDataEvent("gameStart0");
  20981. break;
  20982. default:
  20983. break;
  20984. }
  20985. }
  20986. beginGame(isNice = false) {
  20987. if (xGame.common.gameMode == GameMode.classic) {
  20988. if (isNice) {
  20989. this.enterClassic();
  20990. }
  20991. else {
  20992. xGame.uiMgr.Show(UIModeSelection$1, () => {
  20993. this.enterClassic();
  20994. });
  20995. }
  20996. }
  20997. else if (xGame.common.gameMode == GameMode.bigMove) {
  20998. this.ui.enterGuide.visible = false;
  20999. xGame.uiMgr.Show(UISkill$1);
  21000. }
  21001. }
  21002. enterClassic() {
  21003. xGame.uiMgr.Show(UIGame$1);
  21004. xGame.uiMgr.Show(UIMatching$1, () => {
  21005. if (!this.isHide)
  21006. this.hide();
  21007. xGame.common.gameUI.ui.alpha = 1;
  21008. xGame.common.gameUI.startGame();
  21009. xGame.uiMgr.Hide(UIGameEnd$1);
  21010. });
  21011. }
  21012. startGlobal() {
  21013. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  21014. }
  21015. startWeekly() {
  21016. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  21017. }
  21018. zhouSaiMonth() {
  21019. console.log('zh: zhouSaiMonth 被调用');
  21020. }
  21021. startPlaceBall() {
  21022. xGame.uiMgr.Show(UILevelDisplay$1);
  21023. }
  21024. hide() {
  21025. super.hide();
  21026. xGame.common.stopGirlPop(this.ui.talkNode);
  21027. }
  21028. onGetUserInfo(force = false) {
  21029. if (Moyu.isWx) {
  21030. let info = Moyu.getSystemInfo();
  21031. if (info)
  21032. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  21033. }
  21034. else {
  21035. Moyu.initUser(this, this.freshUser, force);
  21036. }
  21037. if (!Moyu.hasUserInfo) {
  21038. let user = Moyu.getUserInfo();
  21039. user.headIcon = 'res/ty_touxiang.png';
  21040. }
  21041. this.freshUser();
  21042. }
  21043. freshUser() {
  21044. let user = Moyu.getUserInfo();
  21045. if (!user.isAuth) {
  21046. user.headIcon = 'res/ty_touxiang.png';
  21047. }
  21048. else
  21049. DataMgr.upRankData();
  21050. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  21051. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  21052. }
  21053. interuptSecretary() {
  21054. Laya.timer.clearAll(this);
  21055. this.playSecretaryRandomSound();
  21056. }
  21057. playSecretaryRandomSound() {
  21058. if (this.isHide)
  21059. return;
  21060. let time = xGame.common.randomNum(45000, 60000);
  21061. Laya.timer.once(time, this, () => {
  21062. if (this.isHide)
  21063. return;
  21064. let index = xGame.common.randomNum(4, 7);
  21065. xGame.soundMgr.playSound("s_main0" + index);
  21066. let words = 1;
  21067. switch (index) {
  21068. case 4:
  21069. words = 5;
  21070. break;
  21071. case 5:
  21072. words = 3;
  21073. break;
  21074. case 6:
  21075. words = 6;
  21076. break;
  21077. case 7:
  21078. words = 7;
  21079. break;
  21080. default:
  21081. break;
  21082. }
  21083. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21084. this.playSecretaryRandomSound();
  21085. });
  21086. }
  21087. openSecretaryView() {
  21088. xGame.uiMgr.Show(UISecretary$1);
  21089. Moyu.sendDataEvent("secretary");
  21090. }
  21091. openShopView() {
  21092. xGame.uiMgr.Show(UIShop$1);
  21093. }
  21094. openSignView() {
  21095. xGame.uiMgr.Show(UISign$1);
  21096. }
  21097. openDrawView() {
  21098. xGame.uiMgr.Show(UIDraw$1);
  21099. }
  21100. openRanking() {
  21101. xGame.uiMgr.Show(UIRanking$1);
  21102. Moyu.sendDataEvent("rankingList");
  21103. }
  21104. }
  21105. UIMain$1.uiName = "UIMain";
  21106. function InitShader() {
  21107. }
  21108. function appInit() {
  21109. xGame.context.init(getLoadingResList(), initCallback);
  21110. }
  21111. function getLoadingResList() {
  21112. return [
  21113. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  21114. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  21115. ];
  21116. }
  21117. function getGameResList() {
  21118. return [
  21119. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  21120. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  21121. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  21122. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  21123. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  21124. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  21125. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  21126. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  21127. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  21128. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  21129. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  21130. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  21131. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  21132. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  21133. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  21134. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  21135. { url: "res/json/npc.json", type: Laya.Loader.JSON },
  21136. { url: "res/json/classicCfg.json", type: Laya.Loader.JSON },
  21137. { url: "res/json/levelCfg.json", type: Laya.Loader.JSON },
  21138. { url: "res/json/placeBallCfg.json", type: Laya.Loader.JSON },
  21139. ];
  21140. }
  21141. function initCallback() {
  21142. window["DataMgr"] = DataMgr;
  21143. DataMgr.Init();
  21144. Moyu.init(getPlat(), this, () => {
  21145. DataMgr.isNewDay();
  21146. PlatMgr.initConfig();
  21147. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  21148. }, true);
  21149. console.log('zh:开始sm init1 start');
  21150. xGame.soundMgr.init();
  21151. console.log('zh:开始sm init1 end');
  21152. xGame.uiMgr.init();
  21153. xGame.uiMgr.clearTempData();
  21154. xGame.uiMgr.bindFUI(fguiRes.loading);
  21155. xGame.uiMgr.Show(UILoading);
  21156. }
  21157. function loadSubRes(callback) {
  21158. var tab = ["asset", "res", "spine"];
  21159. let subDone = 0;
  21160. for (var i = 0; i < tab.length; i++) {
  21161. let sub = tab[i];
  21162. Moyu.loadSubRes(sub, (pro) => {
  21163. callback && callback(pro, false);
  21164. }).then(() => {
  21165. subDone++;
  21166. if (subDone >= tab.length)
  21167. callback && callback(1, true);
  21168. });
  21169. }
  21170. }
  21171. function enterGame() {
  21172. xGame.cfgMgr.init();
  21173. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  21174. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  21175. xGame.uiMgr.Hide(UILoading);
  21176. fgui.UIPackage.removePackage(fguiRes.loading);
  21177. xGame.uiMgr.bindFUI(fguiRes.game);
  21178. xGame.uiMgr.Show(UIMain$1);
  21179. if (DataMgr.getNewUser())
  21180. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  21181. }
  21182. function getPlat() {
  21183. let cfg = new MoyuCfg();
  21184. cfg.plat = MoyuPlat.web;
  21185. cfg.myId = 120;
  21186. cfg.myKey = '8848a885774230a4';
  21187. cfg.version = 0;
  21188. if (window.hasOwnProperty("gamebox")) {
  21189. cfg.plat = MoyuPlat.f399;
  21190. cfg.version = 0;
  21191. }
  21192. else if (window.hasOwnProperty("ks")) {
  21193. cfg.plat = MoyuPlat.ks;
  21194. cfg.version = 0;
  21195. cfg.ads.ksVideoId = '2300002254_01';
  21196. cfg.ads.ksInsertId = '2300002254_02';
  21197. }
  21198. else if (Laya.Browser.onTTMiniGame) {
  21199. cfg.plat = MoyuPlat.tt;
  21200. cfg.version = 0;
  21201. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  21202. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  21203. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  21204. }
  21205. else if (Laya.Browser.onMiniGame) {
  21206. cfg.plat = MoyuPlat.wx;
  21207. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  21208. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  21209. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  21210. }
  21211. else if (Laya.Browser.onQQMiniGame) {
  21212. cfg.plat = MoyuPlat.qq;
  21213. }
  21214. else if (Laya.Browser.onQGMiniGame) {
  21215. cfg.plat = MoyuPlat.op;
  21216. cfg.ads.opVideoId = '455502';
  21217. cfg.ads.opBannerId = '455507';
  21218. }
  21219. else if (Laya.Browser.onVVMiniGame) {
  21220. cfg.plat = MoyuPlat.vv;
  21221. cfg.version = 0;
  21222. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  21223. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  21224. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  21225. }
  21226. else if (Laya.Browser.onHWMiniGame) {
  21227. cfg.plat = MoyuPlat.hw;
  21228. }
  21229. else if (window["mz"]) {
  21230. cfg.plat = MoyuPlat.mz;
  21231. }
  21232. else {
  21233. let cfg = window['conchConfig'];
  21234. if (cfg) {
  21235. var os = cfg.getOS();
  21236. if (os == "Conch-ios") {
  21237. cfg.plat = MoyuPlat.ios;
  21238. }
  21239. else if (os == "Conch-android") {
  21240. }
  21241. }
  21242. }
  21243. return cfg;
  21244. }
  21245. class Main {
  21246. constructor() {
  21247. if (window["Laya3D"])
  21248. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  21249. else {
  21250. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  21251. this.initMain();
  21252. }
  21253. }
  21254. initMain() {
  21255. Laya["Physics"] && Laya["Physics"].enable();
  21256. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  21257. Laya.stage.scaleMode = GameConfig.scaleMode;
  21258. Laya.stage.screenMode = GameConfig.screenMode;
  21259. Laya.stage.alignV = GameConfig.alignV;
  21260. Laya.stage.alignH = GameConfig.alignH;
  21261. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  21262. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  21263. Laya.enableDebugPanel();
  21264. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  21265. Laya["PhysicsDebugDraw"].enable();
  21266. if (GameConfig.stat)
  21267. Laya.Stat.show();
  21268. Laya.alertGlobalError(true);
  21269. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  21270. }
  21271. onVersionLoaded() {
  21272. appInit();
  21273. }
  21274. }
  21275. new Main();
  21276. }());
  21277. //# sourceMappingURL=bundle.js.map