1
0

bundle.js 828 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710
  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.shopBtn = (this.getChild("shopBtn"));
  4205. this.moneyNode = (this.getChild("moneyNode"));
  4206. this.headNode = (this.getChild("headNode"));
  4207. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4208. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4209. this.classicBtn = (this.getChild("classicBtn"));
  4210. this.globalBtn = (this.getChild("globalBtn"));
  4211. this.n44 = (this.getChild("n44"));
  4212. this.signBtn = (this.getChild("signBtn"));
  4213. this.drawBtn = (this.getChild("drawBtn"));
  4214. this.settingNode = (this.getChild("settingNode"));
  4215. this.n45 = (this.getChild("n45"));
  4216. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4217. this.n46 = (this.getChild("n46"));
  4218. this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
  4219. this.liucheng1 = (this.getChild("liucheng1"));
  4220. this.rightBtn = (this.getChild("rightBtn"));
  4221. this.n75 = (this.getChild("n75"));
  4222. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4223. this.liucheng2 = (this.getChild("liucheng2"));
  4224. this.guideBtn = (this.getChild("guideBtn"));
  4225. this.n73 = (this.getChild("n73"));
  4226. this.wordsNode = (this.getChild("wordsNode"));
  4227. this.enterGuide = (this.getChild("enterGuide"));
  4228. this.talkNode = (this.getChild("talkNode"));
  4229. this.n83 = (this.getChild("n83"));
  4230. this.n84 = (this.getChild("n84"));
  4231. }
  4232. }
  4233. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4234. class ui_UIMoyu extends fgui.GComponent {
  4235. static createInstance() {
  4236. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4237. }
  4238. onConstruct() {
  4239. this.ageTip = (this.getChild("ageTip"));
  4240. this.mainBg = (this.getChild("mainBg"));
  4241. this.xyNode = (this.getChild("xyNode"));
  4242. this.rnNode = (this.getChild("rnNode"));
  4243. this.fcmNode = (this.getChild("fcmNode"));
  4244. this.ageNode = (this.getChild("ageNode"));
  4245. this.tipNode = (this.getChild("tipNode"));
  4246. this.msgNode = (this.getChild("msgNode"));
  4247. }
  4248. }
  4249. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4250. class MoyuMgr {
  4251. static initMoyu() {
  4252. this.moyuView = new MoyuView();
  4253. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4254. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4255. this.moyuView.ui.displayObject.zOrder = 1000;
  4256. this.moyuView.init();
  4257. this.moyuView.showTip(true);
  4258. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4259. window['XApk'] = this;
  4260. }
  4261. static showAge(show) {
  4262. if (this.moyuView)
  4263. this.moyuView.showAge(show);
  4264. }
  4265. static onPlatMsg(idx) {
  4266. if (!MoyuMgr.moyuView)
  4267. return;
  4268. if (idx == '0') {
  4269. MoyuMgr.moyuView.showTip(false);
  4270. }
  4271. }
  4272. static showAgree(call) {
  4273. if (this.moyuView)
  4274. this.moyuView.showAgree(call);
  4275. else
  4276. call && call();
  4277. }
  4278. static showXy(type = 1) {
  4279. if (this.moyuView)
  4280. this.moyuView.showXy(type);
  4281. }
  4282. }
  4283. MoyuMgr.isAdvise = false;
  4284. class MoyuView {
  4285. constructor() {
  4286. this.ysxyNum = 1;
  4287. this.ysJson = null;
  4288. this.ui = ui_UIMoyu.createInstance();
  4289. }
  4290. init() {
  4291. this.ui.mainBg.visible = false;
  4292. this.ui.xyNode.visible = false;
  4293. this.ui.ageNode.visible = false;
  4294. this.ui.tipNode.visible = false;
  4295. this.ui.rnNode.visible = false;
  4296. this.ui.fcmNode.visible = false;
  4297. this.ui.ageTip.visible = false;
  4298. this.ui.msgNode.visible = false;
  4299. this.ui.visible = false;
  4300. this.ui.xyNode.xyList.setVirtual();
  4301. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4302. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4303. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4304. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4305. this.ui.xyNode.btnKnown.visible = false;
  4306. this.ui.xyNode.xy1.visible = false;
  4307. this.ui.xyNode.xy2.visible = false;
  4308. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4309. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4310. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4311. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4312. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4313. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4314. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4315. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4316. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4317. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4318. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4319. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4320. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4321. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4322. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4323. this.ysxyNum = 2;
  4324. }
  4325. }
  4326. onClick(obj) {
  4327. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4328. switch (obj) {
  4329. case this.ui.ageTip:
  4330. if (Moyu.isTTApk) {
  4331. this.ui.ageNode.visible = true;
  4332. this.ui.mainBg.visible = true;
  4333. }
  4334. break;
  4335. case this.ui.tipNode:
  4336. this.showTip(false);
  4337. break;
  4338. case this.ui.ageNode.btnAge:
  4339. this.ui.ageNode.visible = false;
  4340. this.ui.mainBg.visible = false;
  4341. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4342. this.ui.visible = false;
  4343. break;
  4344. case this.ui.xyNode.btnXy3:
  4345. case this.ui.xyNode.btnXy1:
  4346. this.loadXy(1);
  4347. break;
  4348. case this.ui.xyNode.btnXy2:
  4349. this.loadXy(2);
  4350. break;
  4351. case this.ui.xyNode.btnBack:
  4352. this.ui.xyNode.xy1.visible = true;
  4353. this.ui.xyNode.xy2.visible = false;
  4354. break;
  4355. case this.ui.xyNode.btnKnown:
  4356. this.ui.xyNode.visible = false;
  4357. this.ui.mainBg.visible = false;
  4358. this.ui.visible = false;
  4359. break;
  4360. case this.ui.rnNode.btnCheck:
  4361. this.check();
  4362. break;
  4363. case this.ui.rnNode.btnExit:
  4364. case this.ui.xyNode.btnNo:
  4365. this.ysxyNum--;
  4366. if (this.ysxyNum > 0)
  4367. this.showMsg("Refuse to quit the game once again");
  4368. else {
  4369. Moyu.userAgree(false);
  4370. Moyu.exit();
  4371. }
  4372. break;
  4373. case this.ui.xyNode.btnSure:
  4374. case this.ui.xyNode.btnYes:
  4375. DataMgr.userData.isAgree = true;
  4376. DataMgr.saveUserData();
  4377. this.onAgree();
  4378. break;
  4379. case this.ui.rnNode.btnDone:
  4380. this.ui.rnNode.visible = false;
  4381. this.ui.visible = false;
  4382. break;
  4383. case this.ui.fcmNode.btnRn:
  4384. this.showRn();
  4385. break;
  4386. }
  4387. }
  4388. showTip(show) {
  4389. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4390. return;
  4391. if (show) {
  4392. MoyuMgr.isAdvise = true;
  4393. this.ui.visible = true;
  4394. this.ui.tipNode.visible = true;
  4395. this.ui.tipNode.alpha = 1;
  4396. Laya.timer.once(1000, this, this.showTip, [false]);
  4397. }
  4398. else {
  4399. this.ui.tipNode.alpha = 1;
  4400. this.ui.tipNode.visible = true;
  4401. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4402. this.ui.tipNode.visible = false;
  4403. MoyuMgr.isAdvise = false;
  4404. }), 1000);
  4405. }
  4406. }
  4407. showAge(show, px = 0, py = 0) {
  4408. if (Moyu.platType > 10 && !Moyu.isIos) {
  4409. this.ui.ageTip.x = px;
  4410. this.ui.ageTip.y = py;
  4411. this.ui.ageTip.visible = show;
  4412. if (show)
  4413. this.ui.visible = true;
  4414. }
  4415. }
  4416. showAgree(call) {
  4417. this.agreeCall = call;
  4418. this.onAgree();
  4419. return;
  4420. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4421. this.showXy(0);
  4422. }
  4423. else
  4424. this.onAgree();
  4425. }
  4426. onAgree() {
  4427. if (!this.ui.ageNode.visible)
  4428. this.ui.visible = false;
  4429. this.ui.xyNode.visible = false;
  4430. Moyu.userAgree(true);
  4431. this.showAge(false);
  4432. this.agreeCall && this.agreeCall();
  4433. this.showRn();
  4434. }
  4435. showMsg(txt) {
  4436. this.ui.msgNode.txtMsg.text = txt;
  4437. this.ui.msgNode.visible = true;
  4438. this.ui.msgNode.alpha = 1;
  4439. this.ui.visible = true;
  4440. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4441. this.ui.msgNode.visible = false;
  4442. }), 2500, true);
  4443. }
  4444. showRn() {
  4445. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4446. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4447. this.ui.rnNode.rn1.visible = true;
  4448. this.ui.rnNode.rn2.visible = false;
  4449. this.ui.rnNode.rn3.visible = false;
  4450. this.ui.rnNode.rn4.visible = false;
  4451. this.ui.rnNode.visible = true;
  4452. this.ui.mainBg.visible = true;
  4453. this.ui.rnNode.btnDone.visible = false;
  4454. this.ui.rnNode.btnExit.visible = true;
  4455. this.ui.rnNode.btnCheck.visible = true;
  4456. this.ui.fcmNode.visible = false;
  4457. this.ui.visible = true;
  4458. return;
  4459. }
  4460. }
  4461. this.showFcm();
  4462. }
  4463. showFcm() {
  4464. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4465. Moyu.initFCM(true);
  4466. if (Moyu.gameTime < 1)
  4467. this.fcmLoop();
  4468. else if (Moyu.gameTime < 999)
  4469. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4470. }
  4471. }
  4472. fcmLoop() {
  4473. if (Moyu.gameTime < 1) {
  4474. this.ui.rnNode.visible = false;
  4475. this.ui.fcmNode.visible = true;
  4476. this.ui.mainBg.visible = true;
  4477. this.ui.visible = true;
  4478. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4479. Laya.timer.clear(this.ui, this.fcmLoop);
  4480. }
  4481. }
  4482. check() {
  4483. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4484. this.ui.rnNode.rn1.visible = false;
  4485. this.ui.rnNode.rn2.visible = false;
  4486. this.ui.rnNode.rn4.visible = true;
  4487. }
  4488. else if (this.ui.rnNode.rn4.visible) {
  4489. let name = this.ui.rnNode.inputName.text;
  4490. let code = this.ui.rnNode.inputCode.text;
  4491. if (code && code.length == 18) {
  4492. this.ui.rnNode.rn1.visible = false;
  4493. this.ui.rnNode.rn4.visible = false;
  4494. Moyu.authenticate(name, code, (res) => {
  4495. this.ui.rnNode.rn2.visible = !res;
  4496. this.ui.rnNode.rn3.visible = res;
  4497. this.ui.rnNode.btnDone.visible = res;
  4498. this.ui.rnNode.btnExit.visible = !res;
  4499. this.ui.rnNode.btnCheck.visible = !res;
  4500. if (res)
  4501. this.showFcm();
  4502. });
  4503. }
  4504. else
  4505. this.showMsg("信息填写不完整");
  4506. }
  4507. }
  4508. loadXy(type = 0) {
  4509. this.ui.xyNode.xy1.visible = false;
  4510. this.ui.xyNode.xy2.visible = true;
  4511. this.ui.xyNode.xyList.scrollToView(0);
  4512. if (type == 1) {
  4513. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4514. }
  4515. else if (type == 2) {
  4516. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4517. }
  4518. }
  4519. showXy(type = 0) {
  4520. this.xyBtn();
  4521. if (type == 0) {
  4522. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4523. this.ui.xyNode.btnSure.visible = true;
  4524. }
  4525. else {
  4526. this.ui.xyNode.btnYes.visible = true;
  4527. this.ui.xyNode.btnNo.visible = true;
  4528. }
  4529. }
  4530. else {
  4531. this.ui.xyNode.btnKnown.visible = true;
  4532. this.ui.mainBg.visible = true;
  4533. }
  4534. this.ui.xyNode.xy1.visible = true;
  4535. this.ui.xyNode.xy2.visible = false;
  4536. this.ui.xyNode.visible = true;
  4537. this.ui.visible = true;
  4538. }
  4539. xyBtn() {
  4540. this.ui.xyNode.btnSure.visible = false;
  4541. this.ui.xyNode.btnYes.visible = false;
  4542. this.ui.xyNode.btnNo.visible = false;
  4543. this.ui.xyNode.btnKnown.visible = false;
  4544. {
  4545. this.ui.xyNode.btnXy3.visible = false;
  4546. this.ui.xyNode.btnXy2.visible = true;
  4547. this.ui.xyNode.btnXy1.visible = true;
  4548. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4549. }
  4550. }
  4551. createXY(json) {
  4552. this.ysJson = json.content;
  4553. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4554. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4555. this.ui.xyNode.xy2.visible = true;
  4556. }
  4557. renderListItem(idx, cell) {
  4558. let xy = this.ysJson[idx];
  4559. cell.height = xy.line * 30;
  4560. cell.xyItem.text = xy.text;
  4561. }
  4562. onDestroy() {
  4563. this.agreeCall = null;
  4564. }
  4565. }
  4566. class SettingNode {
  4567. constructor(ui) {
  4568. this.showSetting = false;
  4569. this.openSound = true;
  4570. this.openShake = true;
  4571. this.ui = ui;
  4572. this.ui.soundBtn.onClick(this, this.switchSound);
  4573. this.ui.shakeBtn.onClick(this, this.switchShake);
  4574. this.ui.xyBtn.onClick(this, this.onXy);
  4575. this.ui.clickNode.onClick(this, this.changeSetting);
  4576. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4577. this.ui.xyBtn.visible = false;
  4578. this.ui.shakeBtn.visible = false;
  4579. }
  4580. changeSetting() {
  4581. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4582. this.showSetting = !this.showSetting;
  4583. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4584. }
  4585. switchSound() {
  4586. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4587. this.openSound = !this.openSound;
  4588. Moyu.onSetting(this.openSound, this.openShake);
  4589. xGame.soundMgr.onSetting(this.openSound);
  4590. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4591. }
  4592. switchShake() {
  4593. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4594. this.openShake = !this.openShake;
  4595. Moyu.onSetting(this.openSound, this.openShake);
  4596. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4597. }
  4598. onXy() {
  4599. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4600. MoyuMgr.showXy(1);
  4601. }
  4602. }
  4603. class ui_UILevelDisplay extends fgui.GComponent {
  4604. static createInstance() {
  4605. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4606. }
  4607. onConstruct() {
  4608. this.n9 = (this.getChild("n9"));
  4609. this.myNode = (this.getChild("myNode"));
  4610. this.closeNode = (this.getChild("closeNode"));
  4611. }
  4612. }
  4613. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4614. class ui_UILevelProp extends fgui.GComponent {
  4615. static createInstance() {
  4616. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4617. }
  4618. onConstruct() {
  4619. this.n16 = (this.getChild("n16"));
  4620. this.myNode = (this.getChild("myNode"));
  4621. this.closeBtn = (this.getChild("closeBtn"));
  4622. this.moneyNode = (this.getChild("moneyNode"));
  4623. this.t1 = this.getTransition("t1");
  4624. }
  4625. }
  4626. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  4627. class ui_ShowItem extends fgui.GComponent {
  4628. static createInstance() {
  4629. return (fgui.UIPackage.createObject("game", "ShowItem"));
  4630. }
  4631. onConstruct() {
  4632. this.myImg = (this.getChild("myImg"));
  4633. }
  4634. }
  4635. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  4636. class ShowItem {
  4637. constructor() {
  4638. this.ui = ui_ShowItem.createInstance();
  4639. }
  4640. destroySelf() {
  4641. if (!this.ui.isDisposed) {
  4642. this.ui.removeFromParent();
  4643. this.ui.dispose();
  4644. }
  4645. }
  4646. setParent(parent) {
  4647. parent.addChild(this.ui);
  4648. }
  4649. setPos(x, y) {
  4650. this.ui.x = x;
  4651. this.ui.y = y;
  4652. }
  4653. setUrl(index) {
  4654. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  4655. }
  4656. }
  4657. class ui_UIPower extends fgui.GComponent {
  4658. static createInstance() {
  4659. return (fgui.UIPackage.createObject("game", "UIPower"));
  4660. }
  4661. onConstruct() {
  4662. this.n11 = (this.getChild("n11"));
  4663. this.myNode = (this.getChild("myNode"));
  4664. this.t0 = this.getTransition("t0");
  4665. }
  4666. }
  4667. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  4668. class UIPower extends UIBase {
  4669. constructor() {
  4670. super();
  4671. }
  4672. onConstructor() {
  4673. this.ui = ui_UIPower.createInstance();
  4674. this.contentPane = this.ui;
  4675. this.isEject = false;
  4676. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4677. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  4678. }
  4679. show() {
  4680. super.show();
  4681. this.ui.t0.play();
  4682. }
  4683. videoGetPower() {
  4684. console.log('zh:qjff_AD_for_uipower');
  4685. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  4686. }
  4687. else {
  4688. console.log('zh:AD 失败,直接发放奖励');
  4689. this.qjff_AD_for_uipower();
  4690. }
  4691. }
  4692. qjff_AD_for_uipower() {
  4693. DataMgr.setPower(xGame.common.videoPower, true);
  4694. xGame.eventMgr.event(POWER_TIME);
  4695. this.hide();
  4696. }
  4697. }
  4698. UIPower.uiName = "UIPower";
  4699. class UILevelProp extends UIBase {
  4700. constructor() {
  4701. super();
  4702. this.firstPos = 385;
  4703. this.secondPos = 467;
  4704. this.showItemArr = [];
  4705. }
  4706. onFontLoaded() {
  4707. try {
  4708. this.ui.myNode.conditionTxt.font = "arial";
  4709. console.log("zh: onFontLoaded 设置arial字体成功");
  4710. }
  4711. catch (error) {
  4712. console.log("zh: constructor onFontLoaded加载arial字体失败");
  4713. }
  4714. }
  4715. onConstructor() {
  4716. this.ui = ui_UILevelProp.createInstance();
  4717. this.contentPane = this.ui;
  4718. this.isEject = false;
  4719. this.addUIClick(this.ui.closeBtn, this.hide);
  4720. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  4721. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  4722. }
  4723. show(level) {
  4724. super.show();
  4725. this.ui.t1.play();
  4726. this.level = level;
  4727. this.data = cfgTable.placeballData[this.level];
  4728. this.updateSelf();
  4729. this.showPreView();
  4730. this.moneyNode.ui.c1.selectedIndex = 2;
  4731. this.moneyNode.checkPowerTime();
  4732. this.moneyNode.powerChange();
  4733. }
  4734. showPreView() {
  4735. let item;
  4736. let data;
  4737. for (let index = 0; index < this.showItemArr.length; index++) {
  4738. item = this.showItemArr[index];
  4739. item.destroySelf();
  4740. }
  4741. this.showItemArr = [];
  4742. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  4743. for (const key in cfgData) {
  4744. data = cfgData[key];
  4745. item = new ShowItem();
  4746. item.setParent(this.ui.myNode.displayRoot);
  4747. item.setPos(data.x, data.y);
  4748. item.setUrl(data.value);
  4749. this.showItemArr.push(item);
  4750. }
  4751. }
  4752. updateSelf() {
  4753. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  4754. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  4755. if (this.data.ball == -1) {
  4756. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  4757. }
  4758. else {
  4759. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  4760. }
  4761. let localData = DataMgr.getPlaceBallLevel(this.level);
  4762. let getAward = localData.getAward;
  4763. let cfg = cfgTable.placeballData[this.level];
  4764. let coin = this.data.award[0];
  4765. let diamond = this.data.award[1];
  4766. if (cfg.type == PlaceBallType.challenge) {
  4767. diamond = 0;
  4768. coin = 100;
  4769. }
  4770. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  4771. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  4772. this.ui.myNode.coinNode.numTxt.text = coin + "";
  4773. if (cfg.type == PlaceBallType.challenge) {
  4774. this.ui.myNode.coinNode.numTxt.text = "";
  4775. }
  4776. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  4777. if (coin > 0 && diamond > 0) {
  4778. this.ui.myNode.diamondNode.x = 385;
  4779. this.ui.myNode.coinNode.x = 467;
  4780. }
  4781. else {
  4782. this.ui.myNode.diamondNode.x = 385;
  4783. this.ui.myNode.coinNode.x = 385;
  4784. }
  4785. if (!getAward) {
  4786. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  4787. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  4788. }
  4789. else {
  4790. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  4791. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  4792. }
  4793. }
  4794. startGame() {
  4795. if (DataMgr.powerEnough()) {
  4796. this.ui.myNode.startBtn.touchable = false;
  4797. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  4798. console.log('zh:startGame ');
  4799. this.ui.myNode.startBtn.touchable = true;
  4800. DataMgr.setPower(-1);
  4801. xGame.eventMgr.event(POWER_TIME);
  4802. xGame.common.gameMode = GameMode.placeBall;
  4803. xGame.common.placeBallCurLevel = this.level;
  4804. xGame.uiMgr.Show(UIGame);
  4805. xGame.uiMgr.Hide(UILevelDisplay);
  4806. xGame.uiMgr.Hide(UIMain);
  4807. this.hide();
  4808. }));
  4809. }
  4810. else {
  4811. console.log('zh:startGame no power');
  4812. xGame.uiMgr.Show(UIPower);
  4813. }
  4814. }
  4815. hide() {
  4816. super.hide();
  4817. }
  4818. }
  4819. UILevelProp.uiName = "UILevelProp";
  4820. class PutBallLevelDisplay {
  4821. constructor(ui, index) {
  4822. this.index = 0;
  4823. this.ui = ui;
  4824. this.index = index;
  4825. this.ui.onClick(this, this.clickSelf);
  4826. this.updateSelf();
  4827. this.ui.levelTxt.text = (this.index + 1) + "";
  4828. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  4829. this.ui.special.levelTxt.text = (this.index + 1) + "";
  4830. }
  4831. updateSelf() {
  4832. let level = this.index + 1;
  4833. this.data = DataMgr.getPlaceBallLevel(level);
  4834. this.ui.starNode.c1.selectedIndex = this.data.star;
  4835. let isChallenge = cfgTable.placeballData[level].type;
  4836. if (this.data.isCur) {
  4837. if (isChallenge) {
  4838. this.ui.c1.selectedIndex = 5;
  4839. }
  4840. else {
  4841. this.ui.c1.selectedIndex = 2;
  4842. }
  4843. }
  4844. else {
  4845. if (this.data.play) {
  4846. if (this.data.star == 3) {
  4847. this.ui.c1.selectedIndex = 0;
  4848. }
  4849. else {
  4850. this.ui.c1.selectedIndex = 1;
  4851. }
  4852. }
  4853. else {
  4854. if (isChallenge) {
  4855. this.ui.c1.selectedIndex = 4;
  4856. }
  4857. else {
  4858. this.ui.c1.selectedIndex = 3;
  4859. }
  4860. }
  4861. }
  4862. }
  4863. clickSelf() {
  4864. if (!this.data.play)
  4865. return;
  4866. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4867. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  4868. }
  4869. }
  4870. class UILevelDisplay extends UIBase {
  4871. constructor() {
  4872. super();
  4873. }
  4874. onConstructor() {
  4875. this.ui = ui_UILevelDisplay.createInstance();
  4876. this.contentPane = this.ui;
  4877. this.isEject = false;
  4878. this.myList = this.ui.myNode.myList;
  4879. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  4880. this.levelItemArr = [];
  4881. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  4882. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  4883. this.myList.numItems = levelNum;
  4884. if (Moyu.isKs)
  4885. this.ui.closeNode.closeBtn.x += 100;
  4886. }
  4887. levelItemRender(index, target) {
  4888. let item = new PutBallLevelDisplay(target, index);
  4889. this.levelItemArr.push(item);
  4890. }
  4891. show() {
  4892. super.show();
  4893. this.updateLevel();
  4894. this.scrollToPlace();
  4895. }
  4896. updateLevel() {
  4897. let temp;
  4898. for (let index = 0; index < this.levelItemArr.length; index++) {
  4899. temp = this.levelItemArr[index];
  4900. temp.updateSelf();
  4901. }
  4902. }
  4903. scrollToPlace() {
  4904. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  4905. let passArr = DataMgr.getPlaceBallLevelList();
  4906. let offest = passArr.length;
  4907. if (offest >= maxNum - 1)
  4908. offest = maxNum - 1;
  4909. this.myList.scrollToView(offest, true, true);
  4910. }
  4911. hide() {
  4912. super.hide();
  4913. }
  4914. }
  4915. UILevelDisplay.uiName = "UILevelDisplay";
  4916. class ui_UIMatching extends fgui.GComponent {
  4917. static createInstance() {
  4918. return (fgui.UIPackage.createObject("game", "UIMatching"));
  4919. }
  4920. onConstruct() {
  4921. this.n5 = (this.getChild("n5"));
  4922. this.n49 = (this.getChild("n49"));
  4923. this.n51 = (this.getChild("n51"));
  4924. this.n64 = (this.getChild("n64"));
  4925. this.n2 = (this.getChild("n2"));
  4926. this.n53 = (this.getChild("n53"));
  4927. this.n54 = (this.getChild("n54"));
  4928. this.n56 = (this.getChild("n56"));
  4929. this.n58 = (this.getChild("n58"));
  4930. this.n59 = (this.getChild("n59"));
  4931. this.n57 = (this.getChild("n57"));
  4932. this.n60 = (this.getChild("n60"));
  4933. this.n62 = (this.getChild("n62"));
  4934. this.awardTxt = (this.getChild("awardTxt"));
  4935. this.n61 = (this.getChild("n61"));
  4936. this.selfHead = (this.getChild("selfHead"));
  4937. this.aiHead = (this.getChild("aiHead"));
  4938. this.n82 = (this.getChild("n82"));
  4939. this.n84 = (this.getChild("n84"));
  4940. this.n83 = (this.getChild("n83"));
  4941. this.t1 = this.getTransition("t1");
  4942. this.t2 = this.getTransition("t2");
  4943. this.t3 = this.getTransition("t3");
  4944. this.t4 = this.getTransition("t4");
  4945. }
  4946. }
  4947. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  4948. class UIMatching extends UIBase {
  4949. constructor() {
  4950. super();
  4951. }
  4952. onConstructor() {
  4953. this.ui = ui_UIMatching.createInstance();
  4954. this.contentPane = this.ui;
  4955. this.isEject = false;
  4956. }
  4957. show(callback) {
  4958. super.show();
  4959. PlatMgr.showBanner(true);
  4960. this.callback = callback;
  4961. let user = Moyu.getUserInfo();
  4962. if (!this.selfPot) {
  4963. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  4964. }
  4965. if (!this.aiPot) {
  4966. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  4967. }
  4968. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  4969. this.ui.selfHead.nameTxt.text = user.nickName;
  4970. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  4971. this.ui.aiHead.nameTxt.text = "???";
  4972. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  4973. this.ui.selfHead.c1.selectedIndex = 0;
  4974. this.ui.aiHead.c1.selectedIndex = 0;
  4975. this.ui.selfHead.x = this.selfPot.x;
  4976. this.ui.selfHead.y = this.selfPot.y;
  4977. this.ui.aiHead.x = this.aiPot.x;
  4978. this.ui.aiHead.y = this.aiPot.y;
  4979. switch (xGame.common.gameMode) {
  4980. case GameMode.classic:
  4981. break;
  4982. case GameMode.bigMove:
  4983. this.initSkillData();
  4984. break;
  4985. default:
  4986. break;
  4987. }
  4988. this.ui.t1.play(Laya.Handler.create(this, () => {
  4989. this.ui.t2.play(Laya.Handler.create(this, () => {
  4990. switch (xGame.common.gameMode) {
  4991. case GameMode.classic:
  4992. this.waitingPeople();
  4993. break;
  4994. case GameMode.bigMove:
  4995. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  4996. break;
  4997. default:
  4998. break;
  4999. }
  5000. }));
  5001. }));
  5002. }
  5003. initSkillData() {
  5004. this.skillSelectData = [];
  5005. let skillUrl = xGame.common.skillIconList;
  5006. let skillName = xGame.common.skillNameList;
  5007. let skillLevel = DataMgr.getBigSkillList();
  5008. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  5009. for (let index = 0; index < 5; index++) {
  5010. let obj = {};
  5011. obj.skillImg = skillUrl[index];
  5012. obj.skillName = skillName[index];
  5013. obj.skillType = skillType[index];
  5014. obj.skillLevel = skillLevel[index];
  5015. this.skillSelectData.push(obj);
  5016. }
  5017. }
  5018. getAISkillLevel(myLevel) {
  5019. let video = xGame.common.upSkillLevel;
  5020. let aiLevel;
  5021. let temp;
  5022. if (video) {
  5023. temp = xGame.common.randomNum(-2, -1);
  5024. }
  5025. else {
  5026. if (myLevel <= 5) {
  5027. temp = xGame.common.randomNum(1, 3);
  5028. }
  5029. else if (myLevel <= 9) {
  5030. temp = xGame.common.randomNum(-2, 1);
  5031. }
  5032. else {
  5033. temp = xGame.common.randomNum(-4, 0);
  5034. }
  5035. }
  5036. aiLevel = temp + myLevel;
  5037. if (aiLevel <= 1)
  5038. aiLevel = 1;
  5039. if (aiLevel >= 10)
  5040. aiLevel = 10;
  5041. return aiLevel;
  5042. }
  5043. getAISkillType() {
  5044. return xGame.common.randomNum(1, 4);
  5045. let successTimes = DataMgr.getSkillSuccessTimes();
  5046. let info = cfgTable.aiskillData[successTimes];
  5047. if (!info) {
  5048. let max = Object.keys(cfgTable.aiskillData).length - 1;
  5049. info = cfgTable.aiskillData[max];
  5050. }
  5051. let dataArr = info.skillselect;
  5052. let myCfg = {};
  5053. for (let index = 0; index < dataArr.length; index++) {
  5054. let temp = dataArr[index].split('-');
  5055. myCfg[temp[0]] = {};
  5056. myCfg[temp[0]].id = parseInt(temp[0]);
  5057. myCfg[temp[0]].weight = parseInt(temp[1]);
  5058. }
  5059. let aiCfg = xGame.common.initWeight(myCfg);
  5060. let curData = xGame.common.getRandomWeightData(aiCfg);
  5061. return parseInt(curData.id);
  5062. }
  5063. getAISkillData(index) {
  5064. let myLevel = this.skillSelectData[index].skillLevel;
  5065. let aiLevel = this.getAISkillLevel(myLevel);
  5066. let aiType = this.getAISkillType() - 1;
  5067. return { aiLevel, aiType } = { aiLevel, aiType };
  5068. }
  5069. skillSelectFinish(index) {
  5070. let aiInfo = this.getAISkillData(index);
  5071. xGame.common.gameMgr.selfCurSkill = index;
  5072. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  5073. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  5074. this.ui.selfHead.c1.selectedIndex = 1;
  5075. this.ui.aiHead.c1.selectedIndex = 1;
  5076. let myData = this.skillSelectData[index];
  5077. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  5078. let guide = DataMgr.getSkillGuide();
  5079. if (guide == 0) {
  5080. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  5081. }
  5082. else {
  5083. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  5084. }
  5085. let aiData = this.skillSelectData[aiInfo.aiType];
  5086. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  5087. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  5088. this.waitingPeople();
  5089. }
  5090. waitingPeople() {
  5091. let time = xGame.common.randomNum(1000, 3000);
  5092. time += 1000;
  5093. Laya.timer.once(time, this, () => {
  5094. this.matchingSuccess();
  5095. });
  5096. }
  5097. matchingSuccess() {
  5098. let gameUI = xGame.common.gameUI;
  5099. let name = gameUI.ui.topNode.aiNameTxt.text;
  5100. let url = gameUI.ui.topNode.aiHeadLoader.url;
  5101. this.ui.aiHead.nameTxt.text = name;
  5102. this.ui.aiHead.headImg.url = url;
  5103. name = gameUI.ui.topNode.selfNameTxt.text;
  5104. url = gameUI.ui.topNode.selfHeadLoader.url;
  5105. this.ui.selfHead.nameTxt.text = name;
  5106. this.ui.selfHead.headImg.url = url;
  5107. this.ui.t3.play(Laya.Handler.create(this, () => {
  5108. this.callback && this.callback();
  5109. this.ui.t4.play(Laya.Handler.create(this, () => {
  5110. this.destroySelf();
  5111. }));
  5112. }));
  5113. }
  5114. destroySelf() {
  5115. this.callback = null;
  5116. this.skillSelectData = null;
  5117. this.selfPot = null;
  5118. this.aiPot = null;
  5119. if (!this.ui.isDisposed) {
  5120. this.ui.removeFromParent();
  5121. this.ui.dispose();
  5122. }
  5123. xGame.uiMgr.destroyUI(this);
  5124. }
  5125. }
  5126. UIMatching.uiName = "UIMatching";
  5127. class ui_UIRanking extends fgui.GComponent {
  5128. static createInstance() {
  5129. return (fgui.UIPackage.createObject("game", "UIRanking"));
  5130. }
  5131. onConstruct() {
  5132. this.n26 = (this.getChild("n26"));
  5133. this.myNode = (this.getChild("myNode"));
  5134. }
  5135. }
  5136. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  5137. class UIRanking extends UIBase {
  5138. constructor() {
  5139. super();
  5140. this.showSelf = true;
  5141. this.rankType = 1;
  5142. this.rankList = [];
  5143. this.myIndex = 0;
  5144. this.myStar = 0;
  5145. }
  5146. onConstructor() {
  5147. this.ui = ui_UIRanking.createInstance();
  5148. this.contentPane = this.ui;
  5149. this.isEject = false;
  5150. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  5151. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  5152. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  5153. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  5154. this.ui.myNode.myList.setVirtual();
  5155. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  5156. }
  5157. show() {
  5158. super.show();
  5159. this.myIndex = 51;
  5160. Moyu.getRankList({
  5161. rankId: xGame.common.curRankID,
  5162. type: MoyuRankType.total,
  5163. page: 1,
  5164. pageSize: 50,
  5165. }, this, this.updateItemData);
  5166. this.updateSelf();
  5167. let self = Moyu.getUserInfo();
  5168. if (!self.isAuth) {
  5169. Moyu.initUser(this, () => {
  5170. DataMgr.upRankData();
  5171. });
  5172. }
  5173. }
  5174. updateSelfItem() {
  5175. let self = Moyu.getUserInfo();
  5176. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  5177. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > 50 ? "未上榜" : this.myIndex.toString();
  5178. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  5179. this.ui.myNode.selfNode.nameTxt.text = Moyu.platType < 11 ? self.nickName : "myself";
  5180. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  5181. }
  5182. updateItemData(data) {
  5183. this.myStar = xGame.common.getAllStarNum();
  5184. if (this.rankList.length < 2) {
  5185. this.rankList = data;
  5186. let self = Moyu.getUserInfo();
  5187. for (let i = 0; i < data.length; i++) {
  5188. let data = this.rankList[i];
  5189. if (data.userId == self.userId) {
  5190. this.rankList.splice(i, 1);
  5191. break;
  5192. }
  5193. }
  5194. for (let i = 0; i < data.length; i++) {
  5195. let data = this.rankList[i];
  5196. if (data.rankScore < this.myStar && this.myIndex > 50) {
  5197. this.myIndex = i + 1;
  5198. let user = { headIcon: self.headIcon, nickName: "myself" };
  5199. let ud = { user: user, data: {} };
  5200. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5201. if (Moyu.platType < 11) {
  5202. user.headIcon = self.headIcon;
  5203. user.nickName = self.nickName;
  5204. }
  5205. this.rankList.splice(i, 0, md);
  5206. break;
  5207. }
  5208. }
  5209. }
  5210. this.updateSelfItem();
  5211. this.ui.myNode.myList.numItems = this.rankList.length;
  5212. }
  5213. updateItemUI(index, obj) {
  5214. let data = this.rankList[index];
  5215. let userData = JSON.parse(data.userData).user;
  5216. obj.nameTxt.text = userData.nickName.toString();
  5217. obj.valueTxt.text = data.rankScore;
  5218. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5219. obj.rankTxt.text = index + 1;
  5220. switch (index) {
  5221. case 0:
  5222. this.setImg(obj, 1, 0, 0);
  5223. obj.rankTxt.color = "#FFC047";
  5224. break;
  5225. case 1:
  5226. this.setImg(obj, 0, 1, 0);
  5227. obj.rankTxt.color = "#ACACAC";
  5228. break;
  5229. case 2:
  5230. this.setImg(obj, 0, 0, 1);
  5231. obj.rankTxt.color = "#D09672";
  5232. break;
  5233. default:
  5234. this.setImg(obj, 0, 0, 0);
  5235. obj.rankTxt.color = "#496FAB";
  5236. break;
  5237. }
  5238. }
  5239. setImg(obj, a, b, c) {
  5240. obj.img1.visible = a ? true : false;
  5241. obj.img2.visible = b ? true : false;
  5242. obj.img3.visible = c ? true : false;
  5243. }
  5244. changeList(type) {
  5245. this.rankType = type;
  5246. this.updateSelf();
  5247. }
  5248. changeSelfNode() {
  5249. this.showSelf = !this.showSelf;
  5250. this.updateSelf();
  5251. }
  5252. updateSelf() {
  5253. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5254. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5255. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5256. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5257. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5258. }
  5259. }
  5260. UIRanking.uiName = "UIRanking";
  5261. class ui_UISecretary extends fgui.GComponent {
  5262. static createInstance() {
  5263. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5264. }
  5265. onConstruct() {
  5266. this.n0 = (this.getChild("n0"));
  5267. this.myNode = (this.getChild("myNode"));
  5268. this.closeBtn = (this.getChild("closeBtn"));
  5269. this.t0 = this.getTransition("t0");
  5270. }
  5271. }
  5272. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5273. class UISecretary extends UIBase {
  5274. constructor() {
  5275. super();
  5276. this.curIndex = 1;
  5277. }
  5278. onConstructor() {
  5279. this.ui = ui_UISecretary.createInstance();
  5280. this.contentPane = this.ui;
  5281. this.isEject = false;
  5282. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5283. this.nodeObj = { left: null, right: null, cur: null };
  5284. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5285. }
  5286. show() {
  5287. super.show();
  5288. this.ui.t0.play();
  5289. this.updateData();
  5290. }
  5291. addSecretarySpine(node, spineName) {
  5292. if (spineName == "mishu") {
  5293. if (this.secretarySpine1) {
  5294. node.displayObject.destroyChildren();
  5295. this.playWoman(this.secretarySpine1, node.displayObject);
  5296. }
  5297. else {
  5298. let spine1 = new SpineMgr("mishu", () => {
  5299. this.secretarySpine1 = spine1;
  5300. this.playWoman(this.secretarySpine1, node.displayObject);
  5301. });
  5302. }
  5303. }
  5304. else {
  5305. if (this.secretarySpine2) {
  5306. node.displayObject.destroyChildren();
  5307. this.playWoman(this.secretarySpine2, node.displayObject);
  5308. }
  5309. else {
  5310. let spine2 = new SpineMgr("xiaomishu2", () => {
  5311. this.secretarySpine2 = spine2;
  5312. this.playWoman(this.secretarySpine2, node.displayObject);
  5313. });
  5314. }
  5315. }
  5316. }
  5317. playWoman(node, parent) {
  5318. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  5319. let yy = this.ui.myNode.gameNode3.secretary.height;
  5320. let scale = 1.5;
  5321. if (node == this.secretarySpine2) {
  5322. scale = 1.2;
  5323. }
  5324. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5325. node.play(data, 0, true, parent);
  5326. }
  5327. turnLeft() {
  5328. this.curIndex--;
  5329. if (this.curIndex < 1) {
  5330. this.curIndex = 2;
  5331. }
  5332. let left = this.nodeObj.left;
  5333. let right = this.nodeObj.right;
  5334. let cur = this.nodeObj.cur;
  5335. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5336. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5337. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5338. this.updateData();
  5339. }));
  5340. this.ui.myNode.setChildIndex(right, 2);
  5341. this.nodeObj.left = cur;
  5342. this.nodeObj.right = left;
  5343. this.nodeObj.cur = right;
  5344. }
  5345. turnRight() {
  5346. this.curIndex++;
  5347. if (this.curIndex > 2) {
  5348. this.curIndex = 1;
  5349. }
  5350. let left = this.nodeObj.left;
  5351. let right = this.nodeObj.right;
  5352. let cur = this.nodeObj.cur;
  5353. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5354. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5355. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5356. this.updateData();
  5357. }));
  5358. this.ui.myNode.setChildIndex(left, 2);
  5359. this.nodeObj.left = right;
  5360. this.nodeObj.right = cur;
  5361. this.nodeObj.cur = left;
  5362. }
  5363. updateData() {
  5364. console.log('zh: updateData FFFFFFFFFF');
  5365. let data = cfgTable.secretaryshopData;
  5366. let children = this.ui.myNode._children;
  5367. let temp;
  5368. let curData;
  5369. for (let index = 0; index < children.length; index++) {
  5370. temp = children[index];
  5371. curData = data[1];
  5372. temp.heightTxt.text = curData.height;
  5373. temp.foodTxt.text = curData.food;
  5374. temp.historyTxt.text = curData.history;
  5375. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5376. this.addSecretarySpine(temp.secretary, curData.spine);
  5377. let womanIndex = curData.id - 1;
  5378. let getWoman = DataMgr.getSecretary(womanIndex);
  5379. let curUse = DataMgr.getCurSecretary();
  5380. if (getWoman) {
  5381. if (curUse == womanIndex) {
  5382. temp.purchaseBtn.c1.selectedIndex = 1;
  5383. }
  5384. else {
  5385. temp.purchaseBtn.c1.selectedIndex = 2;
  5386. }
  5387. }
  5388. else {
  5389. temp.purchaseBtn.c1.selectedIndex = 0;
  5390. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5391. }
  5392. temp.purchaseBtn.offClick(this, this.clickSecretary);
  5393. temp.purchaseBtn.onClick(this, this.clickSecretary, [getWoman, curUse, womanIndex, curData.price]);
  5394. }
  5395. }
  5396. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5397. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5398. if (getWoman) {
  5399. if (curUse != womanIndex) {
  5400. console.log();
  5401. DataMgr.setCurSecretary(womanIndex);
  5402. this.updateData();
  5403. }
  5404. }
  5405. else {
  5406. console.log('zh:点击购买了');
  5407. let need = needDiamond;
  5408. if (DataMgr.diamondEnough(need)) {
  5409. DataMgr.setDiamond(-need);
  5410. DataMgr.setSecretary(womanIndex, 1);
  5411. DataMgr.setCurSecretary(womanIndex);
  5412. this.updateData();
  5413. }
  5414. else {
  5415. xGame.uiMgr.Show(UIAddProp, 1);
  5416. }
  5417. }
  5418. }
  5419. closeSelf() {
  5420. this.hide();
  5421. }
  5422. }
  5423. UISecretary.uiName = "UISecretary";
  5424. class ui_UIShop extends fgui.GComponent {
  5425. static createInstance() {
  5426. return (fgui.UIPackage.createObject("game", "UIShop"));
  5427. }
  5428. onConstruct() {
  5429. this.n48 = (this.getChild("n48"));
  5430. this.n0 = (this.getChild("n0"));
  5431. this.secretary = (this.getChild("secretary"));
  5432. this.talkNode = (this.getChild("talkNode"));
  5433. this.closeNode = (this.getChild("closeNode"));
  5434. this.moneyNode = (this.getChild("moneyNode"));
  5435. this.myNode = (this.getChild("myNode"));
  5436. }
  5437. }
  5438. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5439. class BallRodDisplay {
  5440. constructor(ui, index) {
  5441. this.index = 0;
  5442. this.uiIndex = 0;
  5443. this.ui = ui;
  5444. this.index = index;
  5445. this.initData();
  5446. }
  5447. initData() {
  5448. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5449. let data = cfgTable.ballrodData[this.index + 1];
  5450. this.ui.nameTxt.text = data.name;
  5451. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5452. this.ui.levelNode.c1.selectedIndex = data.quality;
  5453. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5454. if (data.spine) {
  5455. this.mySpine = new SpineMgr(data.spine, () => {
  5456. let xx = 150;
  5457. let yy = 70;
  5458. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5459. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5460. });
  5461. }
  5462. }
  5463. updateSelf() {
  5464. console.log('zh:updateSelf -------------- ');
  5465. let get = DataMgr.getBallRod(this.index);
  5466. if (get == null)
  5467. get = 1;
  5468. let curUse = DataMgr.getCurBallRod();
  5469. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5470. if (get) {
  5471. if (curUse == this.index) {
  5472. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5473. }
  5474. else {
  5475. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5476. }
  5477. }
  5478. else {
  5479. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5480. }
  5481. }
  5482. buyBallRod() {
  5483. console.log('zh:buyBallRod eeeeee');
  5484. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5485. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5486. switch (selectedIndex) {
  5487. case 0:
  5488. break;
  5489. case 1:
  5490. console.log('zh:点击了 USE THIS');
  5491. DataMgr.setCurBallRod(this.index);
  5492. let curUse = DataMgr.getCurBallRod();
  5493. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5494. let ui = xGame.uiMgr.getUI(UIShop);
  5495. ui.updateBallRod();
  5496. break;
  5497. case 2:
  5498. let data = cfgTable.ballrodData[this.index + 1];
  5499. let need = data.price;
  5500. if (DataMgr.diamondEnough(need)) {
  5501. DataMgr.setDiamond(-need);
  5502. DataMgr.setBallRod(this.index, 1);
  5503. DataMgr.setCurBallRod(this.index);
  5504. let ui = xGame.uiMgr.getUI(UIShop);
  5505. ui.updateBallRod();
  5506. }
  5507. else {
  5508. xGame.uiMgr.Show(UIAddProp, 1);
  5509. }
  5510. break;
  5511. default:
  5512. break;
  5513. }
  5514. }
  5515. }
  5516. class UIShop extends UIBase {
  5517. constructor() {
  5518. super();
  5519. this.itemNums = 0;
  5520. }
  5521. onConstructor() {
  5522. this.ui = ui_UIShop.createInstance();
  5523. this.contentPane = this.ui;
  5524. this.isEject = false;
  5525. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5526. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5527. this.addUIClick(this.ui, this.interuptSecretary);
  5528. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  5529. this.ballRodArr = [];
  5530. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  5531. this.ui.myNode.myList.numItems = this.itemNums;
  5532. if (Moyu.isKs)
  5533. this.ui.closeNode.closeBtn.x += 100;
  5534. }
  5535. show() {
  5536. super.show();
  5537. this.playSecretaryIdle();
  5538. this.updateBallRod();
  5539. }
  5540. updateBallRod() {
  5541. for (let index = 0; index < this.ballRodArr.length; index++) {
  5542. this.ballRodArr[index].updateSelf();
  5543. }
  5544. }
  5545. renderBallRod(sort, obj) {
  5546. let index = this.getIndexBySort(sort + 1) - 1;
  5547. let ballRod = new BallRodDisplay(obj, index);
  5548. this.ballRodArr.push(ballRod);
  5549. }
  5550. getIndexBySort(sort) {
  5551. let object = cfgTable.ballrodData;
  5552. for (const key in object) {
  5553. if (object[key].sort == sort) {
  5554. return parseInt(key);
  5555. }
  5556. }
  5557. }
  5558. playSecretaryIdle() {
  5559. let parent = this.ui.secretary.displayObject;
  5560. parent.destroyChildren();
  5561. let xx = this.ui.secretary.width / 2;
  5562. let yy = this.ui.secretary.height;
  5563. let scale = xGame.common.getSecretaryScale();
  5564. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5565. xGame.common.secretary.play(data, 0, true, parent);
  5566. }
  5567. interuptSecretary() {
  5568. Laya.timer.clearAll(this);
  5569. this.playSecretaryRandomSound();
  5570. }
  5571. playSecretaryRandomSound() {
  5572. if (this.isHide)
  5573. return;
  5574. let time = xGame.common.randomNum(45000, 60000);
  5575. Laya.timer.once(time, this, () => {
  5576. if (this.isHide)
  5577. return;
  5578. let index = xGame.common.randomNum(4, 7);
  5579. xGame.soundMgr.playSound("s_main0" + index);
  5580. let words = 1;
  5581. switch (index) {
  5582. case 4:
  5583. words = 5;
  5584. break;
  5585. case 5:
  5586. words = 3;
  5587. break;
  5588. case 6:
  5589. words = 6;
  5590. break;
  5591. case 7:
  5592. words = 7;
  5593. break;
  5594. default:
  5595. break;
  5596. }
  5597. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5598. this.playSecretaryRandomSound();
  5599. });
  5600. }
  5601. closeSelf() {
  5602. this.hide();
  5603. }
  5604. }
  5605. UIShop.uiName = "UIShop";
  5606. class ui_UISign extends fgui.GComponent {
  5607. static createInstance() {
  5608. return (fgui.UIPackage.createObject("game", "UISign"));
  5609. }
  5610. onConstruct() {
  5611. this.n6 = (this.getChild("n6"));
  5612. this.closeNode = (this.getChild("closeNode"));
  5613. this.myNode = (this.getChild("myNode"));
  5614. this.moneyNode = (this.getChild("moneyNode"));
  5615. this.secretary = (this.getChild("secretary"));
  5616. this.talkNode = (this.getChild("talkNode"));
  5617. this.tripleBtn = (this.getChild("tripleBtn"));
  5618. this.normalBtn = (this.getChild("normalBtn"));
  5619. this.tipsNode = (this.getChild("tipsNode"));
  5620. this.againBtn = (this.getChild("againBtn"));
  5621. this.t0 = this.getTransition("t0");
  5622. }
  5623. }
  5624. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  5625. class SignMax {
  5626. constructor(ui) {
  5627. this.ui = ui;
  5628. }
  5629. updateSelf(index, sameDay, curDayIndex) {
  5630. let data = cfgTable.signData[index + 1];
  5631. this.ui.titleTxt.text = data.title;
  5632. let arr1 = data.award[0].split('-');
  5633. let arr2 = data.award[1].split('-');
  5634. let num1 = parseInt(arr1[1]);
  5635. let num2 = parseInt(arr2[1]);
  5636. this.ui.numTxt1.text = num1 + "";
  5637. this.ui.numTxt2.text = num2 + "";
  5638. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  5639. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  5640. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  5641. this.ui.numTxt1.visible = false;
  5642. }
  5643. else {
  5644. this.ui.numTxt1.visible = true;
  5645. }
  5646. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  5647. this.ui.numTxt2.visible = false;
  5648. }
  5649. else {
  5650. this.ui.numTxt2.visible = true;
  5651. }
  5652. if (index < curDayIndex) {
  5653. this.ui.c1.selectedIndex = 1;
  5654. }
  5655. else if (index == curDayIndex) {
  5656. if (sameDay) {
  5657. this.ui.c1.selectedIndex = 2;
  5658. }
  5659. else {
  5660. this.ui.c1.selectedIndex = 2;
  5661. }
  5662. }
  5663. else {
  5664. this.ui.c1.selectedIndex = 0;
  5665. }
  5666. }
  5667. }
  5668. class SignNormal {
  5669. constructor(ui) {
  5670. this.ui = ui;
  5671. }
  5672. updateSelf(index, sameDay, curDayIndex) {
  5673. let data = cfgTable.signData[index + 1];
  5674. this.ui.titleTxt.text = data.title;
  5675. let arr = data.award[0].split('-');
  5676. let type = parseInt(arr[0]);
  5677. let num = parseInt(arr[1]);
  5678. this.ui.numTxt.text = num + "";
  5679. if (type > 2) {
  5680. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  5681. this.ui.myIcon.rotation = 0;
  5682. }
  5683. else {
  5684. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  5685. this.ui.myIcon.rotation = 0;
  5686. }
  5687. if (xGame.common.signAwardContainsRod(data.award)) {
  5688. this.ui.numTxt.visible = false;
  5689. }
  5690. else {
  5691. this.ui.numTxt.visible = true;
  5692. }
  5693. if (index < curDayIndex) {
  5694. this.ui.c1.selectedIndex = 1;
  5695. }
  5696. else if (index == curDayIndex) {
  5697. if (sameDay) {
  5698. this.ui.c1.selectedIndex = 2;
  5699. }
  5700. else {
  5701. this.ui.c1.selectedIndex = 2;
  5702. }
  5703. }
  5704. else {
  5705. this.ui.c1.selectedIndex = 0;
  5706. }
  5707. }
  5708. }
  5709. class UISign extends UIBase {
  5710. constructor() {
  5711. super();
  5712. this.curDayIndex = 0;
  5713. this.starX = 0;
  5714. }
  5715. onConstructor() {
  5716. this.ui = ui_UISign.createInstance();
  5717. this.contentPane = this.ui;
  5718. this.isEject = false;
  5719. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5720. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5721. this.initSignItem();
  5722. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  5723. this.addUIClick(this.ui.againBtn, this.againGetAward);
  5724. }
  5725. show() {
  5726. super.show();
  5727. this.ui.t0.play();
  5728. this.playSecretaryIdle();
  5729. this.updateSign();
  5730. }
  5731. initSignItem() {
  5732. this.signArr = [];
  5733. for (let index = 0; index < 6; index++) {
  5734. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  5735. this.signArr.push(temp);
  5736. }
  5737. this.signMax = new SignMax(this.ui.myNode.day7);
  5738. if (Moyu.isKs)
  5739. this.ui.closeNode.closeBtn.x += 100;
  5740. }
  5741. updateSign() {
  5742. let sameDay = xGame.common.judgeSameDay();
  5743. let max = 7;
  5744. this.curDayIndex = DataMgr.getSignData();
  5745. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  5746. this.curDayIndex = 0;
  5747. if (!sameDay) {
  5748. this.ui.normalBtn.visible = true;
  5749. this.ui.tipsNode.visible = false;
  5750. this.ui.againBtn.visible = false;
  5751. }
  5752. else {
  5753. this.ui.normalBtn.visible = false;
  5754. let again = DataMgr.getExtraSign();
  5755. let isCurrency = false;
  5756. let index = this.curDayIndex;
  5757. if (index == 0)
  5758. index = 7;
  5759. let award = cfgTable.signData[index].award;
  5760. let num = award[0].split("-")[0];
  5761. if (num == "1" || num == "2")
  5762. isCurrency = true;
  5763. let showAgain = again == 0 && isCurrency;
  5764. this.ui.againBtn.visible = showAgain;
  5765. this.ui.tipsNode.visible = !showAgain;
  5766. }
  5767. for (let index = 0; index < this.signArr.length; index++) {
  5768. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  5769. }
  5770. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  5771. }
  5772. playSecretaryIdle() {
  5773. let parent = this.ui.secretary.displayObject;
  5774. parent.destroyChildren();
  5775. let xx = this.ui.secretary.width / 2;
  5776. let yy = this.ui.secretary.height;
  5777. let scale = xGame.common.getSecretaryScale();
  5778. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5779. xGame.common.secretary.play(data, 0, true, parent);
  5780. }
  5781. closeSelf() {
  5782. this.hide();
  5783. }
  5784. normalGetAward() {
  5785. let sameDay = xGame.common.judgeSameDay();
  5786. if (!sameDay) {
  5787. let award = cfgTable.signData[this.curDayIndex + 1].award;
  5788. let temp;
  5789. let type;
  5790. let num;
  5791. let arr = [];
  5792. for (let index = 0; index < award.length; index++) {
  5793. temp = award[index].split("-");
  5794. type = parseInt(temp[0]);
  5795. num = parseInt(temp[1]);
  5796. let awardType = new AwardType();
  5797. awardType.num = num;
  5798. awardType.type = type;
  5799. arr.push(awardType);
  5800. }
  5801. xGame.common.getAward(arr, (watchVideo) => {
  5802. this.curDayIndex++;
  5803. if (this.curDayIndex > 7)
  5804. this.curDayIndex = 0;
  5805. DataMgr.setSignData(this.curDayIndex);
  5806. DataMgr.setSignTime(new Date().getTime());
  5807. if (watchVideo) {
  5808. DataMgr.setExtraSign(1);
  5809. Moyu.sendDataEvent("signIn1");
  5810. }
  5811. this.updateSign();
  5812. });
  5813. }
  5814. }
  5815. againGetAward() {
  5816. Moyu.sendDataEvent("signIn2");
  5817. console.log('zh:qjff_AD_for_uisign');
  5818. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  5819. }
  5820. else {
  5821. console.log('zh:AD 失败,直接发放奖励');
  5822. this.qjff_AD_for_uisign();
  5823. }
  5824. }
  5825. qjff_AD_for_uisign() {
  5826. let index = this.curDayIndex;
  5827. if (index == 0)
  5828. index = 7;
  5829. let award = cfgTable.signData[index].award;
  5830. let temp;
  5831. let type;
  5832. let num;
  5833. for (let index = 0; index < award.length; index++) {
  5834. temp = award[index].split("-");
  5835. type = parseInt(temp[0]);
  5836. num = parseInt(temp[1]) * 3;
  5837. xGame.common.playObjFlyAnim(num, type);
  5838. }
  5839. DataMgr.setExtraSign(1);
  5840. this.updateSign();
  5841. }
  5842. }
  5843. UISign.uiName = "UISign";
  5844. class ui_UISkill extends fgui.GComponent {
  5845. static createInstance() {
  5846. return (fgui.UIPackage.createObject("game", "UISkill"));
  5847. }
  5848. onConstruct() {
  5849. this.n48 = (this.getChild("n48"));
  5850. this.n0 = (this.getChild("n0"));
  5851. this.secretary = (this.getChild("secretary"));
  5852. this.talkNode = (this.getChild("talkNode"));
  5853. this.closeNode = (this.getChild("closeNode"));
  5854. this.moneyNode = (this.getChild("moneyNode"));
  5855. this.skillNode = (this.getChild("skillNode"));
  5856. this.guideNode = (this.getChild("guideNode"));
  5857. }
  5858. }
  5859. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  5860. class SkillDisplay {
  5861. constructor(ui, data, uiIndex) {
  5862. this.starX = 0;
  5863. this.starY = 0;
  5864. this.index = 0;
  5865. this.ui = ui;
  5866. this.data = data;
  5867. this.index = uiIndex;
  5868. this.initSelf();
  5869. console.log('zh:SkillDisplay constructor this.skillData=', data);
  5870. }
  5871. initSelf() {
  5872. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  5873. this.ui.nameTxt.text = this.data.name;
  5874. this.ui.describeTxt.text = this.data.describe;
  5875. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  5876. this.ui.startBtn.onClick(this, this.startGame);
  5877. this.updateSelf();
  5878. }
  5879. updateSelf() {
  5880. this.checkTry();
  5881. let level = DataMgr.getBigSkillByIndex(this.index);
  5882. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  5883. }
  5884. checkTry() {
  5885. let index = this.index;
  5886. let level = DataMgr.getBigSkillByIndex(index);
  5887. if (level == null) {
  5888. DataMgr.setBigSkill(index, 1, false);
  5889. level = 1;
  5890. }
  5891. this.ui.levelTxt.text = "LV." + level;
  5892. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  5893. this.ui.tryNode.visible = true;
  5894. else
  5895. this.ui.tryNode.visible = false;
  5896. }
  5897. clickAddLevel() {
  5898. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5899. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  5900. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  5901. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  5902. this.qjff_AD_for_skilldisplay_clickAddLevel();
  5903. }
  5904. else {
  5905. console.log('zh:AD 失败,直接发放奖励');
  5906. this.qjff_AD_for_skilldisplay_clickAddLevel();
  5907. }
  5908. }
  5909. qjff_AD_for_skilldisplay_clickAddLevel() {
  5910. DataMgr.setBigSkill(this.data.index, 1);
  5911. this.updateSelf();
  5912. xGame.common.upSkillLevel = true;
  5913. }
  5914. startGame() {
  5915. if (this.data.index == 3) {
  5916. alert('Coming soon!');
  5917. return;
  5918. }
  5919. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5920. let needCoin = xGame.common.bigMoveNeedCoin;
  5921. xGame.common.passAwardCoin = 2000;
  5922. let guide = DataMgr.getSkillGuide();
  5923. console.log('zh:startGame guide=' + guide);
  5924. xGame.common.temSelfLevel = 0;
  5925. if (guide == 0) {
  5926. needCoin = 0;
  5927. xGame.common.temSelfLevel = 100;
  5928. }
  5929. if (DataMgr.coinEnough(needCoin)) {
  5930. DataMgr.setCoin(-needCoin);
  5931. xGame.common.curPlayerSkillType = this.index;
  5932. if (guide == 0)
  5933. xGame.common.curPlayerSkillType = 0;
  5934. xGame.uiMgr.Show(UIGame);
  5935. xGame.uiMgr.Hide(UIMain);
  5936. xGame.uiMgr.Show(UIMatching, () => {
  5937. xGame.common.gameUI.ui.alpha = 1;
  5938. xGame.common.gameUI.startGame();
  5939. xGame.uiMgr.Hide(UISkill);
  5940. });
  5941. }
  5942. else {
  5943. xGame.uiMgr.Show(UIAddProp, 0);
  5944. Moyu.sendDataEvent("AddCoinVideo");
  5945. }
  5946. }
  5947. }
  5948. class UISkill extends UIBase {
  5949. constructor() {
  5950. super();
  5951. this.skillData = [];
  5952. }
  5953. onConstructor() {
  5954. this.ui = ui_UISkill.createInstance();
  5955. this.contentPane = this.ui;
  5956. this.isEject = false;
  5957. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5958. this.initSkillData();
  5959. console.log('zh:aaaaaa1111111111');
  5960. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  5961. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  5962. console.log('zh:aaaaaa22222222');
  5963. this.displayList = [];
  5964. this.ui.skillNode.skillList.numItems = 3;
  5965. this.addUIClick(this.ui, this.interuptSecretary);
  5966. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  5967. this.ui.talkNode.visible = false;
  5968. if (Moyu.isKs)
  5969. this.ui.closeNode.closeBtn.x += 100;
  5970. }
  5971. show() {
  5972. super.show();
  5973. this.playSecretaryIdle();
  5974. this.moneyNode.ui.c1.selectedIndex = 1;
  5975. Laya.timer.clearAll(this);
  5976. xGame.soundMgr.playSound("s_start");
  5977. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5978. let guide = DataMgr.getSkillGuide();
  5979. this.ui.guideNode.visible = guide == 0;
  5980. let item = this.getSkillItemByUIIndex(0);
  5981. if (guide == 0) {
  5982. item.ui.c1.selectedIndex = 1;
  5983. }
  5984. else {
  5985. item.ui.c1.selectedIndex = 0;
  5986. }
  5987. this.ui.guideNode.guideBtn.visible = guide == 0;
  5988. for (let index = 0; index < this.displayList.length; index++) {
  5989. this.displayList[index].checkTry();
  5990. }
  5991. }
  5992. getSkillItemByUIIndex(cur) {
  5993. for (let index = 0; index < this.displayList.length; index++) {
  5994. if (this.displayList[index].index == cur) {
  5995. return this.displayList[index];
  5996. }
  5997. }
  5998. }
  5999. enterGuideLevel() {
  6000. let item = this.getSkillItemByUIIndex(0);
  6001. item.startGame();
  6002. if (DataMgr.getNewUser())
  6003. Moyu.sendDataEvent("gameStart1");
  6004. }
  6005. initSkillData() {
  6006. this.skillData = [];
  6007. let nameList = xGame.common.skillNameList;
  6008. let iconList = xGame.common.skillIconList;
  6009. let describeList = [
  6010. "Jump shot executed — ball bounced and pocketed an extra one!",
  6011. "Bonus Sweep: A random follow-up strike hits 1 extra ball after your shot!",
  6012. "Freeze Effect: Your shot freezes 1 random ball — enemy can’t hit it, and others bounce off!"
  6013. ];
  6014. console.log('zh:initSkillData 111111111');
  6015. let data;
  6016. for (let index = 0; index < nameList.length; index++) {
  6017. data = {};
  6018. data.name = nameList[index];
  6019. data.icon = iconList[index];
  6020. data.describe = describeList[index];
  6021. data.index = index;
  6022. this.skillData.push(data);
  6023. }
  6024. }
  6025. updateSkillItem(index, target) {
  6026. if (this.displayList[index] == null) {
  6027. let uiIndex;
  6028. switch (index) {
  6029. case 0:
  6030. uiIndex = 1;
  6031. break;
  6032. case 1:
  6033. uiIndex = 0;
  6034. break;
  6035. case 2:
  6036. uiIndex = 2;
  6037. break;
  6038. case 3:
  6039. uiIndex = 3;
  6040. break;
  6041. default:
  6042. break;
  6043. }
  6044. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  6045. this.displayList.push(temp);
  6046. }
  6047. }
  6048. playSecretaryIdle() {
  6049. let parent = this.ui.secretary.displayObject;
  6050. parent.destroyChildren();
  6051. let xx = this.ui.secretary.width / 2;
  6052. let yy = this.ui.secretary.height;
  6053. let scale = xGame.common.getSecretaryScale();
  6054. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6055. xGame.common.secretary.play(data, 0, true, parent);
  6056. }
  6057. returnUIMain() {
  6058. this.hide();
  6059. xGame.common.stopGirlPop(this.ui.talkNode);
  6060. xGame.uiMgr.Show(UIMain);
  6061. }
  6062. interuptSecretary() {
  6063. Laya.timer.clearAll(this);
  6064. this.playSecretaryRandomSound();
  6065. }
  6066. playSecretaryRandomSound() {
  6067. if (this.isHide)
  6068. return;
  6069. let time = xGame.common.randomNum(45000, 60000);
  6070. Laya.timer.once(time, this, () => {
  6071. if (this.isHide)
  6072. return;
  6073. let index = xGame.common.randomNum(4, 7);
  6074. xGame.soundMgr.playSound("s_main0" + index);
  6075. let words = 1;
  6076. switch (index) {
  6077. case 4:
  6078. words = 5;
  6079. break;
  6080. case 5:
  6081. words = 3;
  6082. break;
  6083. case 6:
  6084. words = 6;
  6085. break;
  6086. case 7:
  6087. words = 7;
  6088. break;
  6089. default:
  6090. break;
  6091. }
  6092. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6093. this.playSecretaryRandomSound();
  6094. });
  6095. }
  6096. }
  6097. UISkill.uiName = "UISkill";
  6098. class ui_UIMsg extends fgui.GComponent {
  6099. static createInstance() {
  6100. return (fgui.UIPackage.createObject("game", "UIMsg"));
  6101. }
  6102. onConstruct() {
  6103. this.tipsNode = (this.getChild("tipsNode"));
  6104. }
  6105. }
  6106. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  6107. class UIMsg extends UIBase {
  6108. constructor() {
  6109. super();
  6110. }
  6111. onConstructor() {
  6112. this.ui = ui_UIMsg.createInstance();
  6113. this.contentPane = this.ui;
  6114. this.isEject = false;
  6115. this.isMuti = true;
  6116. }
  6117. show(msg, callback) {
  6118. super.show();
  6119. this.ui.tipsNode.msgTxt.text = msg;
  6120. this.ui.alpha = 1;
  6121. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  6122. this.hide();
  6123. callback && callback();
  6124. }), 1000);
  6125. }
  6126. }
  6127. UIMsg.uiName = "UIMsg";
  6128. class ui_UIModeSelection extends fgui.GComponent {
  6129. static createInstance() {
  6130. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  6131. }
  6132. onConstruct() {
  6133. this.n19 = (this.getChild("n19"));
  6134. this.closeBtn = (this.getChild("closeBtn"));
  6135. this.myNode = (this.getChild("myNode"));
  6136. this.t0 = this.getTransition("t0");
  6137. }
  6138. }
  6139. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  6140. class UIModeSelection extends UIBase {
  6141. constructor() {
  6142. super();
  6143. }
  6144. onConstructor() {
  6145. this.ui = ui_UIModeSelection.createInstance();
  6146. this.contentPane = this.ui;
  6147. this.isEject = false;
  6148. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  6149. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  6150. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  6151. this.addUIClick(this.ui.closeBtn, this.hide);
  6152. this.peopleArr = [650, 6900, 3800];
  6153. this.peopleOffest = [50, 500, 200];
  6154. this.updateSelf();
  6155. }
  6156. show(callback) {
  6157. super.show();
  6158. this.ui.t0.play();
  6159. this.callback = callback;
  6160. }
  6161. updateSelf() {
  6162. let cfg = cfgTable.modeselectData;
  6163. for (let index = 1; index <= 3; index++) {
  6164. let node = this.ui.myNode["type" + index];
  6165. node.need.text = cfg[index].need;
  6166. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  6167. node.peopleTxt.text = this.getRandPeople(index - 1);
  6168. }
  6169. }
  6170. enterGame(type) {
  6171. xGame.common.classicRoomType = type;
  6172. let cfg = cfgTable.modeselectData[type];
  6173. let need = cfg.need;
  6174. xGame.common.passAwardCoin = cfg.award;
  6175. if (DataMgr.coinEnough(need)) {
  6176. DataMgr.setCoin(-need);
  6177. this.ui.myNode["type" + type].t0.play();
  6178. Laya.timer.once(200, this, () => {
  6179. this.callback && this.callback();
  6180. });
  6181. }
  6182. else {
  6183. Moyu.sendDataEvent("AddCoinVideo");
  6184. xGame.uiMgr.Show(UIAddProp, 0);
  6185. }
  6186. }
  6187. getRandPeople(index) {
  6188. let rand = this.peopleOffest[index];
  6189. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  6190. }
  6191. }
  6192. UIModeSelection.uiName = "UIModeSelection";
  6193. class ui_UIGetAward extends fgui.GComponent {
  6194. static createInstance() {
  6195. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  6196. }
  6197. onConstruct() {
  6198. this.n4 = (this.getChild("n4"));
  6199. this.n0 = (this.getChild("n0"));
  6200. this.myList = (this.getChild("myList"));
  6201. this.n1 = (this.getChild("n1"));
  6202. this.eftNode = (this.getChild("eftNode"));
  6203. this.btnNode = (this.getChild("btnNode"));
  6204. this.t0 = this.getTransition("t0");
  6205. }
  6206. }
  6207. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  6208. class UIGetAward extends UIBase {
  6209. constructor() {
  6210. super();
  6211. this.showTriple = true;
  6212. }
  6213. onConstructor() {
  6214. this.ui = ui_UIGetAward.createInstance();
  6215. this.contentPane = this.ui;
  6216. this.isEject = false;
  6217. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  6218. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  6219. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  6220. }
  6221. show(arr, showTriple, callback) {
  6222. super.show();
  6223. this.ui.t0.play();
  6224. this.ui.eftNode.visible = true;
  6225. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  6226. this.ui.eftNode.visible = false;
  6227. }), 1, 0, 0, 0.9);
  6228. this.awardArr = arr;
  6229. this.showTriple = showTriple;
  6230. this.callback = callback;
  6231. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  6232. this.ui.myList.numItems = arr.length;
  6233. xGame.soundMgr.playSound("getaward");
  6234. }
  6235. updateSelf(index, obj) {
  6236. let temp = this.awardArr[index];
  6237. let icon = this.getIcon(temp.type);
  6238. let str = icon;
  6239. if (temp.type > 2) {
  6240. str = "s" + icon;
  6241. }
  6242. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  6243. obj.myIcon.rotation = 0;
  6244. obj.numTxt.text = temp.num + "";
  6245. obj.numTxt.visible = temp.type > 2 ? false : true;
  6246. obj.nameTxt.text = this.getNameStr(temp.type);
  6247. }
  6248. renderItem(index, obj) {
  6249. this.updateSelf(index, obj);
  6250. }
  6251. tripleGetAward() {
  6252. console.log('zh:qjff_AD_for_uigetAward');
  6253. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  6254. }
  6255. else {
  6256. console.log('zh:AD 失败,直接发放奖励');
  6257. this.qjff_AD_for_uigetAward();
  6258. }
  6259. }
  6260. qjff_AD_for_uigetAward() {
  6261. this.getAward(3);
  6262. }
  6263. normalGetAward() {
  6264. if (PlatMgr.isMisVideo())
  6265. this.tripleGetAward();
  6266. else
  6267. this.getAward();
  6268. }
  6269. getAward(times = 1) {
  6270. this.hide();
  6271. for (let index = 0; index < this.awardArr.length; index++) {
  6272. this.awardArr[index].num *= times;
  6273. }
  6274. this.callback && this.callback(times != 1);
  6275. }
  6276. getIcon(type) {
  6277. switch (type) {
  6278. case Prop.diamond:
  6279. return "ty_zs";
  6280. case Prop.coin:
  6281. return "ty_jb";
  6282. case Prop.gan1:
  6283. return "qg1";
  6284. case Prop.gan2:
  6285. return "qg2";
  6286. case Prop.gan3:
  6287. return "qg3";
  6288. case Prop.gan4:
  6289. return "qg4";
  6290. default:
  6291. break;
  6292. }
  6293. }
  6294. getNameStr(type) {
  6295. switch (type) {
  6296. case Prop.diamond:
  6297. return "Diamond";
  6298. case Prop.coin:
  6299. return "Coins";
  6300. case Prop.gan1:
  6301. case Prop.gan2:
  6302. case Prop.gan3:
  6303. case Prop.gan4:
  6304. return cfgTable.ballrodData[type - 1].name;
  6305. default:
  6306. break;
  6307. }
  6308. }
  6309. }
  6310. UIGetAward.uiName = "UIGetAward";
  6311. class ui_UIRepentProp extends fgui.GComponent {
  6312. static createInstance() {
  6313. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  6314. }
  6315. onConstruct() {
  6316. this.c1 = this.getController("c1");
  6317. this.n11 = (this.getChild("n11"));
  6318. this.regretNode = (this.getChild("regretNode"));
  6319. this.helpLineNode = (this.getChild("helpLineNode"));
  6320. this.t0 = this.getTransition("t0");
  6321. }
  6322. }
  6323. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  6324. class UIRepentProp extends UIBase {
  6325. constructor() {
  6326. super();
  6327. this.viewType = 0;
  6328. this.regretType = 0;
  6329. }
  6330. onConstructor() {
  6331. this.ui = ui_UIRepentProp.createInstance();
  6332. this.contentPane = this.ui;
  6333. this.isEject = false;
  6334. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  6335. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  6336. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  6337. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  6338. }
  6339. show(viewType, regretType, callback) {
  6340. PlatMgr.showInsert(true);
  6341. this.viewType = viewType;
  6342. this.regretType = regretType;
  6343. this.callback = callback;
  6344. super.show();
  6345. this.ui.t0.play();
  6346. this.ui.c1.selectedIndex = this.viewType;
  6347. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  6348. if (this.viewType == 0) {
  6349. let guide = DataMgr.getGuideHelpLine();
  6350. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  6351. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  6352. }
  6353. xGame.common.gameMgr.gamePause = true;
  6354. }
  6355. hideSelf() {
  6356. xGame.common.gameMgr.gamePause = false;
  6357. this.callback && this.callback(false);
  6358. this.hide();
  6359. }
  6360. videoRegret() {
  6361. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  6362. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  6363. }
  6364. else {
  6365. console.log('zh:AD 失败,直接发放奖励');
  6366. this.qjff_AD_for_UIrepentProp_videoRegret();
  6367. }
  6368. }
  6369. qjff_AD_for_UIrepentProp_videoRegret() {
  6370. this.callback && this.callback(true);
  6371. this.hideSelf();
  6372. }
  6373. videoAddHelpLine() {
  6374. let guide = DataMgr.getGuideHelpLine();
  6375. if (guide == 0) {
  6376. this.callback && this.callback(true);
  6377. this.hideSelf();
  6378. DataMgr.setGuideHelpLine();
  6379. xGame.common.gameUI.ui.guideNode.visible = false;
  6380. }
  6381. else {
  6382. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  6383. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  6384. }
  6385. else {
  6386. console.log('zh:AD 失败,直接发放奖励');
  6387. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  6388. }
  6389. }
  6390. }
  6391. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  6392. this.callback && this.callback(true);
  6393. this.hideSelf();
  6394. }
  6395. }
  6396. UIRepentProp.uiName = "UIRepentProp";
  6397. class UIMain extends UIBase {
  6398. constructor() {
  6399. super();
  6400. this.firstEnter = true;
  6401. }
  6402. nativeCallJs(msg) {
  6403. let t = msg;
  6404. console.log("zh: nativeCallJs 奖励开始发放:", t);
  6405. switch (t) {
  6406. case 'qjff_chouJiang':
  6407. let dui = xGame.uiMgr.getUI(UIDraw);
  6408. dui.qjff_chouJiang();
  6409. break;
  6410. case 'qjff_AD_for_uisign':
  6411. let dui2 = xGame.uiMgr.getUI(UISign);
  6412. dui2.qjff_AD_for_uisign();
  6413. break;
  6414. case 'qjff_AD_for_uitry':
  6415. let dui3 = xGame.uiMgr.getUI(UITry);
  6416. dui3.qjff_AD_for_uitry();
  6417. break;
  6418. case 'qjff_AD_for_uipower':
  6419. let dui4 = xGame.uiMgr.getUI(UIPower);
  6420. dui4.qjff_AD_for_uipower();
  6421. break;
  6422. case 'qjff_AD_for_uigetAward':
  6423. let dui5 = xGame.uiMgr.getUI(UIGetAward);
  6424. dui5.qjff_AD_for_uigetAward();
  6425. break;
  6426. case 'qjff_AD_for_uiGameEnd':
  6427. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  6428. let dui6 = xGame.uiMgr.getUI(UIGameEnd);
  6429. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  6430. break;
  6431. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  6432. let dui7 = xGame.uiMgr.getUI(UIAddProp);
  6433. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  6434. break;
  6435. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  6436. let dui8 = xGame.uiMgr.getUI(UIAddProp);
  6437. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  6438. break;
  6439. case 'qjff_AD_for_UIrepentProp_videoRegret':
  6440. let dui9 = xGame.uiMgr.getUI(UIRepentProp);
  6441. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  6442. break;
  6443. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  6444. let dui10 = xGame.uiMgr.getUI(UIRepentProp);
  6445. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  6446. break;
  6447. case 'qjff_AD_for_UIBOX_onOpenBox':
  6448. let dui11 = xGame.uiMgr.getUI(UIBox);
  6449. dui11.qjff_AD_for_UIBOX_onOpenBox();
  6450. break;
  6451. case 'qjff_AD_for_UIAddCoin':
  6452. let dui12 = xGame.uiMgr.getUI(UIAddCoin);
  6453. dui12.qjff_AD_for_UIAddCoin();
  6454. break;
  6455. case '111a':
  6456. let dui14 = xGame.uiMgr.getUI(UISign);
  6457. dui14.qjff_AD_for_uisign();
  6458. break;
  6459. case '222a':
  6460. let dui15 = xGame.uiMgr.getUI(UISign);
  6461. dui15.qjff_AD_for_uisign();
  6462. break;
  6463. case '333a':
  6464. let dui16 = xGame.uiMgr.getUI(UISign);
  6465. dui16.qjff_AD_for_uisign();
  6466. break;
  6467. default:
  6468. console.log('zh:未知的方法名字' + t);
  6469. break;
  6470. }
  6471. }
  6472. onConstructor() {
  6473. console.log('zh: UIMain onConstructor');
  6474. this.ui = ui_UIMain.createInstance();
  6475. this.contentPane = this.ui;
  6476. this.isEject = false;
  6477. this.addEvent();
  6478. this.addClickSpine();
  6479. this.settingNode = new SettingNode(this.ui.settingNode);
  6480. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6481. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  6482. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  6483. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  6484. let curUse = DataMgr.getCurSecretary();
  6485. this.changeSecretary(curUse);
  6486. this.ui.talkNode.visible = false;
  6487. let guide = DataMgr.getSkillGuide();
  6488. if (xGame.common.isNewDay && guide == 1) {
  6489. xGame.common.isNewDay = false;
  6490. xGame.soundMgr.playSound("s_main01");
  6491. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6492. console.log("播放小秘书每天语音");
  6493. }
  6494. this.onGetUserInfo();
  6495. this.ui.n83.visible = false;
  6496. Moyu.setShareInfo("8Ball Fury", ["台球", "万宁", "桌球"], '2300002254');
  6497. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  6498. }
  6499. changeSecretary(curUse) {
  6500. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  6501. xGame.common.secretary && xGame.common.secretary.dispose();
  6502. this.addSecretarySpine(name);
  6503. }
  6504. addSecretarySpine(name) {
  6505. let spine = new SpineMgr(name, () => {
  6506. this.playSecretaryIdle();
  6507. });
  6508. xGame.common.secretary = spine;
  6509. }
  6510. addClickSpine() {
  6511. let clickSpine = new SpineMgr("dianji", () => {
  6512. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  6513. let parent = Laya.stage;
  6514. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  6515. clickSpine.play(data, 0, false, parent, (spine) => {
  6516. spine.destroy(true);
  6517. });
  6518. });
  6519. });
  6520. }
  6521. addEvent() {
  6522. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  6523. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  6524. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  6525. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  6526. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  6527. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  6528. this.addUIClick(this.ui, this.interuptSecretary);
  6529. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  6530. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  6531. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  6532. this.addUIClick(this.ui.shopBtn, this.openShopView);
  6533. this.addUIClick(this.ui.signBtn, this.openSignView);
  6534. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  6535. }
  6536. show(showFailWords) {
  6537. super.show();
  6538. this.moneyNode.ui.c1.selectedIndex = 1;
  6539. this.playSecretaryIdle();
  6540. xGame.soundMgr.playMusic("caromhall01");
  6541. Laya.timer.clearAll(this);
  6542. this.playSecretaryRandomSound();
  6543. if (showFailWords) {
  6544. setTimeout(() => {
  6545. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  6546. let words = -1;
  6547. if (str == "s_main02") {
  6548. words = 2;
  6549. }
  6550. else {
  6551. words = 3;
  6552. }
  6553. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6554. xGame.soundMgr.playSound(str);
  6555. }, 300);
  6556. }
  6557. this.showGuide();
  6558. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  6559. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  6560. let guide = DataMgr.getSkillGuide();
  6561. if (guide == 1) {
  6562. let randTime = xGame.common.randomNum(300, 800);
  6563. if (this.firstEnter) {
  6564. this.firstEnter = false;
  6565. randTime += 900;
  6566. }
  6567. Laya.timer.once(randTime, this, () => {
  6568. xGame.common.autoPopUIView();
  6569. });
  6570. }
  6571. }
  6572. checkActive(show) {
  6573. }
  6574. showGuide() {
  6575. let guide = DataMgr.getSkillGuide();
  6576. this.ui.guideBtn.visible = guide == 0;
  6577. this.ui.enterGuide.visible = false;
  6578. this.ui.secretaryGuide.visible = guide == 0;
  6579. if (guide == 0) {
  6580. xGame.soundMgr.playSound("s_guide");
  6581. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6582. }
  6583. }
  6584. ensureSecretary() {
  6585. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  6586. this.ui.secretaryGuide.visible = false;
  6587. this.ui.enterGuide.visible = true;
  6588. this.ui.wordsNode.t0.play();
  6589. if (DataMgr.getNewUser())
  6590. Moyu.sendDataEvent("gameReady");
  6591. }
  6592. playSecretaryIdle() {
  6593. let parent = this.ui.secretary.displayObject;
  6594. parent.destroyChildren();
  6595. let xx = this.ui.secretary.width / 2;
  6596. let yy = this.ui.secretary.height;
  6597. let scale = xGame.common.getSecretaryScale();
  6598. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6599. console.log("zh:playSecretaryIdle", data);
  6600. xGame.common.secretary.play(data, 0, true, parent);
  6601. }
  6602. startGame(type) {
  6603. xGame.common.gameMode = type;
  6604. Moyu.sendDataEvent("PlayGame", { type: type });
  6605. switch (xGame.common.gameMode) {
  6606. case GameMode.classic:
  6607. let challengeTimes = DataMgr.getChallengeTimes();
  6608. if (challengeTimes == 0) {
  6609. xGame.uiMgr.Show(UIInvitation);
  6610. }
  6611. else {
  6612. this.beginGame();
  6613. }
  6614. break;
  6615. case GameMode.bigMove:
  6616. this.beginGame();
  6617. if (DataMgr.getNewUser())
  6618. Moyu.sendDataEvent("gameStart0");
  6619. break;
  6620. default:
  6621. break;
  6622. }
  6623. }
  6624. beginGame(isNice = false) {
  6625. if (xGame.common.gameMode == GameMode.classic) {
  6626. if (isNice) {
  6627. this.enterClassic();
  6628. }
  6629. else {
  6630. xGame.uiMgr.Show(UIModeSelection, () => {
  6631. this.enterClassic();
  6632. });
  6633. }
  6634. }
  6635. else if (xGame.common.gameMode == GameMode.bigMove) {
  6636. this.ui.enterGuide.visible = false;
  6637. xGame.uiMgr.Show(UISkill);
  6638. }
  6639. }
  6640. enterClassic() {
  6641. xGame.uiMgr.Show(UIGame);
  6642. xGame.uiMgr.Show(UIMatching, () => {
  6643. if (!this.isHide)
  6644. this.hide();
  6645. xGame.common.gameUI.ui.alpha = 1;
  6646. xGame.common.gameUI.startGame();
  6647. xGame.uiMgr.Hide(UIGameEnd);
  6648. });
  6649. }
  6650. startGlobal() {
  6651. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  6652. }
  6653. startWeekly() {
  6654. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  6655. }
  6656. zhouSaiMonth() {
  6657. console.log('zh: zhouSaiMonth 被调用');
  6658. }
  6659. startPlaceBall() {
  6660. xGame.uiMgr.Show(UILevelDisplay);
  6661. }
  6662. hide() {
  6663. super.hide();
  6664. xGame.common.stopGirlPop(this.ui.talkNode);
  6665. }
  6666. onGetUserInfo(force = false) {
  6667. if (Moyu.isWx) {
  6668. let info = Moyu.getSystemInfo();
  6669. if (info)
  6670. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  6671. }
  6672. else {
  6673. Moyu.initUser(this, this.freshUser, force);
  6674. }
  6675. if (!Moyu.hasUserInfo) {
  6676. let user = Moyu.getUserInfo();
  6677. user.headIcon = 'res/ty_touxiang.png';
  6678. }
  6679. this.freshUser();
  6680. }
  6681. freshUser() {
  6682. let user = Moyu.getUserInfo();
  6683. if (!user.isAuth) {
  6684. user.headIcon = 'res/ty_touxiang.png';
  6685. }
  6686. else
  6687. DataMgr.upRankData();
  6688. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  6689. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  6690. }
  6691. interuptSecretary() {
  6692. Laya.timer.clearAll(this);
  6693. this.playSecretaryRandomSound();
  6694. }
  6695. playSecretaryRandomSound() {
  6696. if (this.isHide)
  6697. return;
  6698. let time = xGame.common.randomNum(45000, 60000);
  6699. Laya.timer.once(time, this, () => {
  6700. if (this.isHide)
  6701. return;
  6702. let index = xGame.common.randomNum(4, 7);
  6703. xGame.soundMgr.playSound("s_main0" + index);
  6704. let words = 1;
  6705. switch (index) {
  6706. case 4:
  6707. words = 5;
  6708. break;
  6709. case 5:
  6710. words = 3;
  6711. break;
  6712. case 6:
  6713. words = 6;
  6714. break;
  6715. case 7:
  6716. words = 7;
  6717. break;
  6718. default:
  6719. break;
  6720. }
  6721. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6722. this.playSecretaryRandomSound();
  6723. });
  6724. }
  6725. openSecretaryView() {
  6726. xGame.uiMgr.Show(UISecretary);
  6727. Moyu.sendDataEvent("secretary");
  6728. }
  6729. openShopView() {
  6730. xGame.uiMgr.Show(UIShop);
  6731. }
  6732. openSignView() {
  6733. xGame.uiMgr.Show(UISign);
  6734. }
  6735. openDrawView() {
  6736. xGame.uiMgr.Show(UIDraw);
  6737. }
  6738. openRanking() {
  6739. xGame.uiMgr.Show(UIRanking);
  6740. Moyu.sendDataEvent("rankingList");
  6741. }
  6742. }
  6743. UIMain.uiName = "UIMain";
  6744. class UIGameEnd extends UIBase {
  6745. constructor() {
  6746. super();
  6747. this.success = false;
  6748. this.awardCoinNum = 1000;
  6749. this.awardDiamondNum = 10;
  6750. }
  6751. onConstructor() {
  6752. this.ui = ui_UIGameEnd.createInstance();
  6753. this.contentPane = this.ui;
  6754. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  6755. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  6756. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  6757. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6758. this.ui.talkNode.visible = false;
  6759. if (Moyu.isKs)
  6760. this.ui.closeNode.closeBtn.x += 100;
  6761. }
  6762. updateType() {
  6763. switch (xGame.common.gameMode) {
  6764. case GameMode.classic:
  6765. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  6766. this.ui.coinNode.visible = this.success;
  6767. if (!this.success) {
  6768. Laya.timer.once(500, this, () => {
  6769. xGame.uiMgr.Show(UIAddCoin);
  6770. });
  6771. }
  6772. this.ui.isGetAward.visible = false;
  6773. this.ui.leftBtn.c1.selectedIndex = 3;
  6774. this.ui.rightBtn.c1.selectedIndex = 0;
  6775. this.moneyNode.ui.c1.selectedIndex = 1;
  6776. break;
  6777. case GameMode.bigMove:
  6778. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  6779. this.ui.coinNode.visible = this.success;
  6780. if (xGame.common.gameMode == GameMode.bigMove) {
  6781. if (this.success) {
  6782. DataMgr.setSkillSuccessTimes(1, true);
  6783. DataMgr.setSkillAccTimes(1);
  6784. }
  6785. else {
  6786. DataMgr.setSkillSuccessTimes(0, false);
  6787. }
  6788. }
  6789. if (!this.success) {
  6790. Laya.timer.once(500, this, () => {
  6791. xGame.uiMgr.Show(UIAddCoin);
  6792. });
  6793. }
  6794. this.ui.isGetAward.visible = false;
  6795. this.ui.leftBtn.c1.selectedIndex = 3;
  6796. this.ui.rightBtn.c1.selectedIndex = 0;
  6797. this.moneyNode.ui.c1.selectedIndex = 1;
  6798. break;
  6799. case GameMode.placeBall:
  6800. this.ui.coinNode.visible = false;
  6801. if (this.success) {
  6802. if (xGame.common.placeBallStarNum == 3) {
  6803. this.ui.c1.selectedIndex = 2;
  6804. }
  6805. else {
  6806. this.ui.c1.selectedIndex = 3;
  6807. }
  6808. }
  6809. else {
  6810. this.ui.c1.selectedIndex = 4;
  6811. }
  6812. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  6813. if (cfg.type == PlaceBallType.challenge) {
  6814. this.ui.c1.selectedIndex = 2;
  6815. }
  6816. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  6817. this.updatePlaceBallBtn();
  6818. this.updatePlaceBallStarNum();
  6819. this.updatePlaceBallAwardState();
  6820. this.moneyNode.ui.c1.selectedIndex = 2;
  6821. this.moneyNode.checkPowerTime();
  6822. this.moneyNode.powerChange();
  6823. DataMgr.upRankData();
  6824. break;
  6825. default:
  6826. break;
  6827. }
  6828. }
  6829. updatePlaceBallBtn() {
  6830. this.ui.leftBtn.c1.selectedIndex = 5;
  6831. if (this.success) {
  6832. this.ui.rightBtn.c1.selectedIndex = 14;
  6833. }
  6834. else {
  6835. if (xGame.common.placeBallStarNum == 3) {
  6836. this.ui.rightBtn.c1.selectedIndex = 14;
  6837. }
  6838. else {
  6839. this.ui.rightBtn.c1.selectedIndex = 1;
  6840. }
  6841. }
  6842. }
  6843. updatePlaceBallStarNum() {
  6844. let starNum = xGame.common.placeBallStarNum;
  6845. if (starNum == 0)
  6846. this.ui.starNumNode.c1.selectedIndex = 3;
  6847. else {
  6848. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  6849. }
  6850. }
  6851. updatePlaceBallAwardState() {
  6852. let level = xGame.common.placeBallCurLevel;
  6853. let starNum = xGame.common.placeBallStarNum;
  6854. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  6855. let data = cfgTable.placeballData[level].award;
  6856. let cfg = cfgTable.placeballData[level];
  6857. this.awardDiamondNum = data[1];
  6858. this.awardCoinNum = data[0];
  6859. if (cfg.type == PlaceBallType.challenge) {
  6860. this.awardDiamondNum = 0;
  6861. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  6862. }
  6863. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  6864. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  6865. if (cfg.type == PlaceBallType.challenge) {
  6866. this.ui.awardNode.coinNode.visible = true;
  6867. }
  6868. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  6869. this.ui.awardNode.diamondNode.x = 265;
  6870. this.ui.awardNode.coinNode.x = 354;
  6871. }
  6872. else {
  6873. this.ui.awardNode.diamondNode.x = 291;
  6874. this.ui.awardNode.coinNode.x = 291;
  6875. }
  6876. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  6877. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  6878. if (this.awardCoinNum == 0) {
  6879. this.ui.awardNode.coinNode.numTxt.text = "";
  6880. }
  6881. if (getAward) {
  6882. this.ui.isGetAward.visible = true;
  6883. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  6884. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  6885. }
  6886. else {
  6887. this.ui.isGetAward.visible = false;
  6888. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  6889. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  6890. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  6891. }
  6892. else {
  6893. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  6894. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  6895. }
  6896. }
  6897. }
  6898. show(success) {
  6899. super.show();
  6900. xGame.eventMgr.event(RESET_GAME);
  6901. this.success = success;
  6902. Laya.timer.clearAll(this);
  6903. this.playSecretaryAni();
  6904. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  6905. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  6906. offsetTime = Math.floor(offsetTime / 1000);
  6907. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  6908. this.updateType();
  6909. Laya.timer.once(200, this, () => {
  6910. this.addAward(() => {
  6911. this.updateType();
  6912. Laya.timer.once(500, this, () => {
  6913. this.showChallengeLevel();
  6914. });
  6915. });
  6916. });
  6917. if (this.success) {
  6918. xGame.soundMgr.playSound('slots_roll01');
  6919. xGame.soundMgr.playSound("s_win");
  6920. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6921. }
  6922. else {
  6923. xGame.soundMgr.playSound('matchwin01');
  6924. xGame.soundMgr.playSound("s_lose");
  6925. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6926. }
  6927. if (!Moyu.isLegal)
  6928. PlatMgr.showBanner(true);
  6929. let challengeNum = DataMgr.getChallengeTimes();
  6930. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  6931. DataMgr.setChallengeTimes(1);
  6932. }
  6933. if (this.success && xGame.common.gameMode == GameMode.classic) {
  6934. DataMgr.setClassicTimes();
  6935. }
  6936. }
  6937. showChallengeLevel() {
  6938. if (DataMgr.getChallengeTimes() != 0)
  6939. return;
  6940. let skill = DataMgr.getSkillAccTimes();
  6941. let put = DataMgr.getPlaceBallLevelList().length;
  6942. if (skill >= 3 || put >= 5) {
  6943. xGame.uiMgr.Show(UIInvitation);
  6944. this.hide();
  6945. }
  6946. }
  6947. addAward(callback) {
  6948. if (!this.success) {
  6949. callback && callback();
  6950. return;
  6951. }
  6952. switch (xGame.common.gameMode) {
  6953. case GameMode.classic:
  6954. this.awardCoinNum = xGame.common.passAwardCoin;
  6955. this.awardDiamondNum = 0;
  6956. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  6957. break;
  6958. case GameMode.bigMove:
  6959. this.awardCoinNum = xGame.common.passAwardCoin;
  6960. this.awardDiamondNum = 0;
  6961. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  6962. callback && callback();
  6963. break;
  6964. case GameMode.placeBall:
  6965. let level = xGame.common.placeBallCurLevel;
  6966. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  6967. if (xGame.common.placeBallStarNum != 3) {
  6968. callback && callback();
  6969. return;
  6970. }
  6971. else {
  6972. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  6973. if (getAward) {
  6974. callback && callback();
  6975. return;
  6976. }
  6977. }
  6978. let cfg = cfgTable.placeballData[level];
  6979. let data = cfgTable.placeballData[level].award;
  6980. this.awardCoinNum = data[0];
  6981. this.awardDiamondNum = data[1];
  6982. if (cfg.type == PlaceBallType.challenge) {
  6983. this.awardDiamondNum = 0;
  6984. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  6985. }
  6986. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  6987. let diamondAward;
  6988. if (this.awardDiamondNum > 0) {
  6989. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  6990. xGame.common.getAward([diamondAward, coinAward], callback);
  6991. }
  6992. else {
  6993. xGame.common.getAward([coinAward], callback);
  6994. }
  6995. if (cfg.type == PlaceBallType.normal) {
  6996. DataMgr.setPlaceBallAward(level);
  6997. }
  6998. break;
  6999. default:
  7000. break;
  7001. }
  7002. }
  7003. playSecretaryAni_old() {
  7004. let parent = this.ui.secretary.displayObject;
  7005. parent.destroyChildren();
  7006. let xx = this.ui.secretary.width / 2;
  7007. let yy = this.ui.secretary.height;
  7008. let scale = xGame.common.getSecretaryScale();
  7009. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7010. if (this.success) {
  7011. let rand = Math.random() <= 0.5 ? 2 : 3;
  7012. xGame.common.secretary.play(data, rand, false, parent, () => {
  7013. xGame.common.secretary.play(data, 1, true, parent);
  7014. });
  7015. }
  7016. else {
  7017. xGame.common.secretary.play(data, 0, true, parent);
  7018. }
  7019. }
  7020. playSecretaryAni() {
  7021. let parent = this.ui.secretary.displayObject;
  7022. parent.destroyChildren();
  7023. let xx = this.ui.secretary.width / 2;
  7024. let yy = this.ui.secretary.height;
  7025. let scale = xGame.common.getSecretaryScale();
  7026. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7027. if (this.success) {
  7028. let rand = 0;
  7029. xGame.common.secretary.play(data, 0, true, parent);
  7030. }
  7031. else {
  7032. xGame.common.secretary.play(data, 0, true, parent);
  7033. }
  7034. }
  7035. restartGame() {
  7036. switch (xGame.common.gameMode) {
  7037. case GameMode.classic:
  7038. xGame.eventMgr.event(RESTART_GAME);
  7039. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7040. break;
  7041. case GameMode.bigMove:
  7042. this.hide();
  7043. xGame.eventMgr.event(RESTART_GAME);
  7044. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7045. break;
  7046. default:
  7047. break;
  7048. }
  7049. }
  7050. hide() {
  7051. super.hide();
  7052. xGame.common.stopGirlPop(this.ui.talkNode);
  7053. PlatMgr.showBanner(false);
  7054. }
  7055. returnHome() {
  7056. this.hide();
  7057. let showFailWords = !this.success;
  7058. xGame.uiMgr.Show(UIMain, showFailWords);
  7059. }
  7060. clickLeftBtn() {
  7061. switch (xGame.common.gameMode) {
  7062. case GameMode.classic:
  7063. case GameMode.bigMove:
  7064. this.returnHome();
  7065. break;
  7066. case GameMode.placeBall:
  7067. let level = xGame.common.placeBallCurLevel;
  7068. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  7069. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7070. break;
  7071. default:
  7072. break;
  7073. }
  7074. }
  7075. powerStartPlaceBallLevel(level, btn) {
  7076. if (DataMgr.powerEnough()) {
  7077. btn.touchable = false;
  7078. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  7079. btn.touchable = true;
  7080. DataMgr.setPower(-1);
  7081. xGame.eventMgr.event(POWER_TIME);
  7082. this.startPlaceBallLevel(level);
  7083. }));
  7084. }
  7085. else {
  7086. xGame.uiMgr.Show(UIPower, 0);
  7087. }
  7088. }
  7089. clickRightBtn() {
  7090. switch (xGame.common.gameMode) {
  7091. case GameMode.classic:
  7092. console.log('zh:clickRightBtn 111');
  7093. case GameMode.bigMove:
  7094. console.log('zh:clickRightBtn 222');
  7095. this.restartGame();
  7096. break;
  7097. case GameMode.placeBall:
  7098. console.log('zh:clickRightBtn 333');
  7099. let level = xGame.common.placeBallCurLevel;
  7100. let data = DataMgr.getPlaceBallLevel(level);
  7101. let curPss = data.play && !data.isCur;
  7102. if (curPss) {
  7103. console.log('zh:clickRightBtn 333-111');
  7104. console.log('zh:当前LV=' + level);
  7105. if (level == 60) {
  7106. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  7107. Laya.timer.once(3000, this, () => {
  7108. this.returnHome();
  7109. });
  7110. }
  7111. else {
  7112. this.powerStartPlaceBallLevel(level + 1, this.ui.rightBtn);
  7113. }
  7114. }
  7115. else {
  7116. console.log('zh:clickRightBtn 333-000');
  7117. Moyu.sendDataEvent("placeBallNextLevel");
  7118. console.log('zh:qjff_AD_for_uiGameEnd');
  7119. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  7120. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  7121. }
  7122. else {
  7123. console.log('zh:AD 失败,直接发放奖励');
  7124. this.qjff_AD_for_uiGameEnd(level);
  7125. }
  7126. }
  7127. break;
  7128. default:
  7129. console.log('zh:clickRightBtn 444');
  7130. break;
  7131. }
  7132. }
  7133. qjff_AD_for_uiGameEnd(level) {
  7134. DataMgr.setPlaceBallLevel(level, 1);
  7135. this.startPlaceBallLevel(level + 1);
  7136. }
  7137. startPlaceBallLevel(level) {
  7138. xGame.common.gameMode = GameMode.placeBall;
  7139. xGame.common.placeBallCurLevel = level;
  7140. xGame.uiMgr.Show(UIGame);
  7141. this.hide();
  7142. }
  7143. }
  7144. UIGameEnd.uiName = "UIGameEnd";
  7145. class ui_UIVideoShare extends fgui.GComponent {
  7146. static createInstance() {
  7147. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  7148. }
  7149. onConstruct() {
  7150. this.n10 = (this.getChild("n10"));
  7151. this.myNode = (this.getChild("myNode"));
  7152. this.t0 = this.getTransition("t0");
  7153. }
  7154. }
  7155. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  7156. class UIVideoShare extends UIBase {
  7157. constructor() {
  7158. super();
  7159. this.success = false;
  7160. this.awardNum = 0;
  7161. this.isShared = true;
  7162. }
  7163. onConstructor() {
  7164. this.ui = ui_UIVideoShare.createInstance();
  7165. this.contentPane = this.ui;
  7166. this.isEject = false;
  7167. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  7168. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  7169. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  7170. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  7171. }
  7172. show(success) {
  7173. super.show();
  7174. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  7175. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  7176. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  7177. this.success = success;
  7178. let time = xGame.common.randomNum(600, 1500);
  7179. Moyu.showInsertAd(time, 60000);
  7180. if (success)
  7181. xGame.soundMgr.playSound("applause");
  7182. this.ui.t0.play();
  7183. this.checkShareState();
  7184. let times = DataMgr.getDailyVideoShareTimes();
  7185. this.awardNum = times == 0 ? 2000 : 200;
  7186. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  7187. }
  7188. checkShareState() {
  7189. if (PlatMgr.forceShare == 0) {
  7190. this.ui.myNode.closeBtn.visible = true;
  7191. this.ui.myNode.tipsNode.visible = false;
  7192. this.ui.myNode.closeBtn.x = 90;
  7193. this.ui.myNode.shareBtn.x = 342;
  7194. }
  7195. else if (PlatMgr.forceShare == 1) {
  7196. this.ui.myNode.closeBtn.visible = false;
  7197. this.ui.myNode.tipsNode.visible = true;
  7198. this.ui.myNode.shareBtn.x = 218;
  7199. this.isShared = true;
  7200. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  7201. }
  7202. }
  7203. checkForceShare() {
  7204. this.isShared = !this.isShared;
  7205. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  7206. }
  7207. videoShare() {
  7208. if (PlatMgr.forceShare == 1) {
  7209. if (this.isShared) {
  7210. this.shareGame();
  7211. }
  7212. else {
  7213. this.hideSelf();
  7214. }
  7215. }
  7216. else {
  7217. this.shareGame();
  7218. }
  7219. }
  7220. shareGame() {
  7221. Moyu.sendDataEvent("VideoShare");
  7222. if (Moyu.canShare() > 100) {
  7223. Moyu.shareGame((success) => {
  7224. if (success) {
  7225. DataMgr.setDailyVideoShareTimes(1);
  7226. DataMgr.setCoin(this.awardNum);
  7227. }
  7228. this.hideSelf();
  7229. }, this);
  7230. }
  7231. else {
  7232. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  7233. this.hideSelf();
  7234. }
  7235. }
  7236. hideSelf() {
  7237. this.hide();
  7238. xGame.uiMgr.Show(UIGameEnd, this.success);
  7239. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  7240. xGame.common.screenImg.destroy();
  7241. xGame.common.screenImg = null;
  7242. }
  7243. }
  7244. }
  7245. UIVideoShare.uiName = "UIVideoShare";
  7246. class ui_UITips extends fgui.GComponent {
  7247. static createInstance() {
  7248. return (fgui.UIPackage.createObject("game", "UITips"));
  7249. }
  7250. onConstruct() {
  7251. this.n0 = (this.getChild("n0"));
  7252. this.myNode = (this.getChild("myNode"));
  7253. this.t0 = this.getTransition("t0");
  7254. }
  7255. }
  7256. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  7257. class UITips extends UIBase {
  7258. constructor() {
  7259. super();
  7260. this.type = 0;
  7261. }
  7262. onConstructor() {
  7263. this.ui = ui_UITips.createInstance();
  7264. this.contentPane = this.ui;
  7265. this.isEject = false;
  7266. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  7267. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  7268. }
  7269. show(tipsTxt, womanTxt, type) {
  7270. super.show();
  7271. this.ui.t0.play();
  7272. this.ui.myNode.tipsTxt.text = tipsTxt;
  7273. this.ui.myNode.womanTxt.text = womanTxt;
  7274. PlatMgr.showInsert(true);
  7275. this.ui.myNode.c1.selectedIndex = type;
  7276. this.type = type;
  7277. switch (this.type) {
  7278. case TipsType.exitGame:
  7279. xGame.common.gameMgr.gamePause = true;
  7280. break;
  7281. case TipsType.foul:
  7282. Laya.timer.once(200, this, () => {
  7283. xGame.common.gameMgr.gamePause = true;
  7284. });
  7285. break;
  7286. default:
  7287. break;
  7288. }
  7289. }
  7290. clickLeftBtn() {
  7291. this.hide();
  7292. xGame.common.gameMgr.gamePause = false;
  7293. switch (this.type) {
  7294. case TipsType.exitGame:
  7295. break;
  7296. case TipsType.foul:
  7297. break;
  7298. default:
  7299. break;
  7300. }
  7301. }
  7302. clickRightBtn() {
  7303. this.hide();
  7304. switch (this.type) {
  7305. case TipsType.exitGame:
  7306. xGame.eventMgr.event(RESET_GAME);
  7307. xGame.uiMgr.Show(UIMain);
  7308. Moyu.recordEnd(this, null);
  7309. xGame.common.longHelpLine = false;
  7310. break;
  7311. case TipsType.foul:
  7312. xGame.common.gameMgr.gamePause = false;
  7313. Laya.timer.clearAll(this);
  7314. break;
  7315. default:
  7316. break;
  7317. }
  7318. }
  7319. }
  7320. UITips.uiName = "UITips";
  7321. class GameMgr {
  7322. constructor() {
  7323. this.selfCamp = "";
  7324. this.selfFoulNum = 0;
  7325. this.selfBallArr = [];
  7326. this.selfTimer = 0;
  7327. this.selfScore = 0;
  7328. this.aiCamp = "";
  7329. this.aiFoulNum = 0;
  7330. this.aiBallArr = [];
  7331. this.aiTimer = 0;
  7332. this.aiScore = 0;
  7333. this.aiSkillLevelNum = 1;
  7334. this.targertScore = 0;
  7335. this.setTime = 30;
  7336. this.selfTurnRate = 0.5;
  7337. this.accTime = 0;
  7338. this.curFoul = "";
  7339. this.maxFoulTimes = 3;
  7340. this.isFirstInGame = true;
  7341. this.firstColliObj = null;
  7342. this.inHoleBalls = [];
  7343. this.blackNum = 8;
  7344. this.success = false;
  7345. this.holePosList = [];
  7346. this.posObj = {};
  7347. this._selfTurn = false;
  7348. this.lastRootBallPos = new Laya.Vector2(311, 430);
  7349. this.ensureBallType = false;
  7350. this.isOpenBall = true;
  7351. this.finishOneShoot = true;
  7352. this.isEnd = false;
  7353. this.isChangeTurn = false;
  7354. this.isInterrupt = false;
  7355. this.aiPlayedBreakArmy = false;
  7356. this.isTouchedBall = false;
  7357. this.finishBalls = 0;
  7358. this.needBalls = 0;
  7359. this.allBallNum = 0;
  7360. this.placeBallPosData = {};
  7361. this.curHP = 0;
  7362. this.showLongView = false;
  7363. this.firstShoot = true;
  7364. this._gamePause = false;
  7365. this.trunCount = 0;
  7366. this.isBlackInHole = false;
  7367. this.isEnter = true;
  7368. xGame.eventMgr.offAll(ALL_BALL_STOP);
  7369. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  7370. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  7371. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  7372. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  7373. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  7374. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  7375. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  7376. }
  7377. get gamePause() {
  7378. return this._gamePause;
  7379. }
  7380. set gamePause(v) {
  7381. if (v) {
  7382. Laya.physicsTimer.pause();
  7383. }
  7384. else {
  7385. Laya.physicsTimer.resume();
  7386. }
  7387. this._gamePause = v;
  7388. }
  7389. get selfTurn() {
  7390. return this._selfTurn;
  7391. }
  7392. set selfTurn(val) {
  7393. this.trunCount++;
  7394. this._selfTurn = val;
  7395. if (val) {
  7396. xGame.common.d2World.d2Gan.ui.self.visible = true;
  7397. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  7398. }
  7399. else {
  7400. xGame.common.d2World.d2Gan.ui.self.visible = false;
  7401. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  7402. if (this.trunCount > 1)
  7403. PlatMgr.openBox();
  7404. }
  7405. }
  7406. resetGame() {
  7407. this.inHoleBalls = [];
  7408. this.isFirstInGame = true;
  7409. this.firstColliObj = null;
  7410. this.aiCamp = "";
  7411. this.selfCamp = "";
  7412. this.aiFoulNum = 0;
  7413. this.selfFoulNum = 0;
  7414. this.selfBallArr = [];
  7415. this.aiBallArr = [];
  7416. this.gamePause = false;
  7417. this.ensureBallType = false;
  7418. this.isInterrupt = false;
  7419. this.updateLeftBall();
  7420. this.clearTime();
  7421. this.aiPlayedBreakArmy = false;
  7422. this.isBlackInHole = false;
  7423. this.placeBallPosData = {};
  7424. if (xGame.common.d3World.knifeRoot) {
  7425. xGame.common.d3World.knifeRoot.destroyChildren();
  7426. }
  7427. }
  7428. gameReady() {
  7429. this.trunCount = 0;
  7430. this.firstColliObj = null;
  7431. this.isFirstInGame = true;
  7432. this.selfTurn = Math.random() <= this.selfTurnRate;
  7433. let challengeNum = DataMgr.getChallengeTimes();
  7434. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  7435. this.selfTurn = true;
  7436. }
  7437. if (xGame.common.gameMode == GameMode.placeBall)
  7438. this.selfTurn = true;
  7439. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  7440. this.selfTurn = true;
  7441. }
  7442. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  7443. this.checkGuide();
  7444. if (xGame.common.uiRodMethod)
  7445. xGame.common.uiRodMethod.resetRod();
  7446. xGame.common.d2World.getHelpLine();
  7447. this.isOpenBall = true;
  7448. this.isTouchedBall = false;
  7449. xGame.common.aiPlayer.stopRun();
  7450. this.setTime = 30;
  7451. let ui = xGame.common.gameUI.ui;
  7452. switch (xGame.common.gameMode) {
  7453. case GameMode.classic:
  7454. xGame.common.aiPlayer.init();
  7455. this.blackNum = 8;
  7456. this.placeRootBall();
  7457. this.peoplePlay(9, 10);
  7458. ui.wordsBtn.visible = true;
  7459. ui.aiWordsBtn.visible = true;
  7460. xGame.common.talkMgr.changeAIState(true);
  7461. DataMgr.gameData.gameCount++;
  7462. DataMgr.saveGameData();
  7463. break;
  7464. case GameMode.bigMove:
  7465. this.blackNum = -1;
  7466. this.selfScore = 0;
  7467. this.aiScore = 0;
  7468. xGame.common.aiPlayer.init();
  7469. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  7470. this.updateSelfScore();
  7471. this.updateAIScore();
  7472. this.updateTargetSroce();
  7473. this.placeRootBall();
  7474. this.peoplePlay(9, 10);
  7475. ui.wordsBtn.visible = true;
  7476. ui.aiWordsBtn.visible = true;
  7477. xGame.common.talkMgr.changeAIState(true);
  7478. if (DataMgr.getSkillGuide() < 1)
  7479. DataMgr.gameData.gameCount = 0;
  7480. else {
  7481. DataMgr.gameData.gameCount++;
  7482. DataMgr.saveGameData();
  7483. PlatMgr.openTry();
  7484. }
  7485. if (xGame.common.d3World.knifeRoot) {
  7486. xGame.common.d3World.knifeRoot.destroyChildren();
  7487. }
  7488. break;
  7489. case GameMode.placeBall:
  7490. this.blackNum = -1;
  7491. this.selfTurn = true;
  7492. this.setTime = 10000;
  7493. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  7494. this.curHP = this.placeBallData.hp;
  7495. if (this.placeBallData.ball == -1)
  7496. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  7497. else
  7498. this.needBalls = this.placeBallData.ball;
  7499. console.log("需要的进球数目", this.needBalls);
  7500. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  7501. this.finishBalls = 0;
  7502. this.placeBallPosData = {};
  7503. this.updatePlaceBallPos();
  7504. this.updatePlaceBallState();
  7505. this.finishOneShoot = true;
  7506. xGame.common.gameUI.ui.moveNode.visible = false;
  7507. this.isOpenBall = false;
  7508. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  7509. ui.wordsBtn.visible = false;
  7510. ui.aiWordsBtn.visible = false;
  7511. xGame.common.talkMgr.changeAIState(false);
  7512. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  7513. PlatMgr.openBox();
  7514. });
  7515. break;
  7516. default:
  7517. break;
  7518. }
  7519. this.showLongView = false;
  7520. xGame.common.wordsMgr.comboTimes = 1;
  7521. let guide = DataMgr.getSkillGuide();
  7522. if (guide)
  7523. xGame.eventMgr.event(WAIT_SHOOT);
  7524. xGame.common.upSkillLevel = false;
  7525. xGame.common.gameStartTime = new Date().getTime();
  7526. this.firstShoot = true;
  7527. }
  7528. checkGuide() {
  7529. let guide = DataMgr.getSkillGuide();
  7530. let gameUI = xGame.common.gameUI.ui;
  7531. gameUI.guide1.visible = false;
  7532. gameUI.guide2.visible = false;
  7533. gameUI.guide3.visible = false;
  7534. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  7535. this.selfTurn = true;
  7536. }
  7537. else {
  7538. return;
  7539. }
  7540. let oneBall = this.getOneBall();
  7541. gameUI.guide1.visible = true;
  7542. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  7543. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  7544. }
  7545. getOneBall() {
  7546. let arr = xGame.common.d2World.ballArr;
  7547. for (let index = 0; index < arr.length; index++) {
  7548. if (arr[index].number == 0)
  7549. continue;
  7550. return arr[index];
  7551. }
  7552. }
  7553. updateSelfScore() {
  7554. let ui = xGame.common.gameUI.ui.topNode;
  7555. ui.selfScoreTxt.text = this.selfScore + "";
  7556. }
  7557. updateAIScore() {
  7558. let ui = xGame.common.gameUI.ui.topNode;
  7559. ui.aiScoreTxt.text = this.aiScore + "";
  7560. }
  7561. updateTargetSroce() {
  7562. let ui = xGame.common.gameUI.ui.topNode;
  7563. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  7564. }
  7565. updateLeftBall() {
  7566. let topUI = xGame.common.gameUI.ui.topNode;
  7567. topUI.selfBallList.numItems = this.selfBallArr.length;
  7568. topUI.aiBallList.numItems = this.aiBallArr.length;
  7569. }
  7570. ballShoot() {
  7571. this.clearTime();
  7572. this.finishOneShoot = false;
  7573. xGame.common.gameUI.ui.moveNode.visible = false;
  7574. if (xGame.common.gameUI.ui.guideNode.visible) {
  7575. xGame.common.gameUI.ui.guideNode.visible = false;
  7576. }
  7577. if (this.firstShoot) {
  7578. this.firstShoot = false;
  7579. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  7580. }
  7581. }
  7582. ensureCamp(number) {
  7583. this.ensureBallType = true;
  7584. this.isOpenBall = false;
  7585. if (xGame.common.gameMode != GameMode.classic)
  7586. return;
  7587. let full = [1, 2, 3, 4, 5, 6, 7];
  7588. let flower = [9, 10, 11, 12, 13, 14, 15];
  7589. let sayWords = "";
  7590. if (this.selfTurn) {
  7591. if (number <= 7) {
  7592. this.selfCamp = ballCamp.full;
  7593. this.selfBallArr = full;
  7594. this.aiCamp = ballCamp.flower;
  7595. this.aiBallArr = flower;
  7596. sayWords = cfgTable.wordsData[3].msg;
  7597. }
  7598. else {
  7599. this.selfCamp = ballCamp.flower;
  7600. this.selfBallArr = flower;
  7601. this.aiCamp = ballCamp.full;
  7602. this.aiBallArr = full;
  7603. sayWords = cfgTable.wordsData[4].msg;
  7604. }
  7605. }
  7606. else {
  7607. if (number <= 7) {
  7608. this.selfCamp = ballCamp.flower;
  7609. this.selfBallArr = flower;
  7610. this.aiCamp = ballCamp.full;
  7611. this.aiBallArr = full;
  7612. sayWords = cfgTable.wordsData[2].msg;
  7613. }
  7614. else {
  7615. this.selfCamp = ballCamp.full;
  7616. this.selfBallArr = full;
  7617. this.aiCamp = ballCamp.flower;
  7618. this.aiBallArr = flower;
  7619. sayWords = cfgTable.wordsData[1].msg;
  7620. }
  7621. }
  7622. this.updateLeftBall();
  7623. xGame.uiMgr.Show(UIMsg, sayWords);
  7624. }
  7625. updatePlaceBallState() {
  7626. let ui = xGame.common.gameUI.ui;
  7627. switch (this.placeBallData.type) {
  7628. case PlaceBallType.normal:
  7629. let normal = ui.placeNormalNode;
  7630. normal.hpTxt.text = this.curHP + "";
  7631. this.updatePlaceBallStar(normal);
  7632. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  7633. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  7634. break;
  7635. case PlaceBallType.challenge:
  7636. let challenge = ui.placeChallengeNode;
  7637. challenge.hpTxt.text = "Shots:" + this.curHP;
  7638. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  7639. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  7640. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  7641. break;
  7642. default:
  7643. break;
  7644. }
  7645. }
  7646. playSubHpAni() {
  7647. let ui = xGame.common.gameUI.ui;
  7648. switch (this.placeBallData.type) {
  7649. case PlaceBallType.normal:
  7650. let normal = ui.placeNormalNode;
  7651. normal.hpTxt.visible = false;
  7652. normal.starAni.c1.selectedIndex = 1;
  7653. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  7654. normal.hpTxt.visible = true;
  7655. normal.starAni.c1.selectedIndex = 0;
  7656. }));
  7657. break;
  7658. default:
  7659. break;
  7660. }
  7661. }
  7662. getEndStarNum() {
  7663. let num;
  7664. let level = xGame.common.placeBallCurLevel;
  7665. if (this.curHP == this.placeBallData.hp) {
  7666. num = 3;
  7667. }
  7668. else if (this.curHP <= 1) {
  7669. num = 1;
  7670. }
  7671. else {
  7672. num = 2;
  7673. }
  7674. if (!this.success) {
  7675. num = 0;
  7676. }
  7677. else {
  7678. DataMgr.setPlaceBallLevel(level, num);
  7679. }
  7680. let myType = cfgTable.placeballData[level].type;
  7681. if (this.success && myType == 1) {
  7682. num = 3;
  7683. }
  7684. xGame.common.placeBallStarNum = num;
  7685. }
  7686. updatePlaceBallStar(node) {
  7687. let star = 0;
  7688. if (this.curHP == this.placeBallData.hp) {
  7689. star = 3;
  7690. }
  7691. else if (this.curHP >= 2) {
  7692. star = 2;
  7693. }
  7694. else if (this.curHP == 1) {
  7695. star = 1;
  7696. }
  7697. else {
  7698. star = 0;
  7699. }
  7700. let temp;
  7701. for (let index = 1; index <= 3; index++) {
  7702. temp = node["star" + index];
  7703. temp.c1.selectedIndex = star >= index ? 1 : 0;
  7704. }
  7705. node.myProgress.value = (star / 3) * 100;
  7706. }
  7707. openRegretView(isFoul, GoalNum, challenge = false) {
  7708. let regretType = -1;
  7709. if (isFoul) {
  7710. regretType = 1;
  7711. }
  7712. else {
  7713. if (GoalNum <= 0) {
  7714. regretType = 0;
  7715. }
  7716. }
  7717. if (challenge) {
  7718. regretType = 1;
  7719. }
  7720. if (regretType != -1) {
  7721. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  7722. if (success) {
  7723. this.curHP++;
  7724. this.updatePlaceBallState();
  7725. this.setPlaceBallAllPos();
  7726. xGame.common.gameUI.ui.moveNode.visible = false;
  7727. }
  7728. else {
  7729. if (this.curHP <= 0) {
  7730. this.success = false;
  7731. this.gameEnd();
  7732. }
  7733. this.playSubHpAni();
  7734. }
  7735. this.updatePlaceBallState();
  7736. this.updatePlaceBallPos();
  7737. });
  7738. }
  7739. }
  7740. setPlaceBallAllPos() {
  7741. let allBall = xGame.common.d2World.ballArr;
  7742. let cfgArr = this.placeBallPosData;
  7743. let temp;
  7744. let obj;
  7745. for (let index = 0; index < allBall.length; index++) {
  7746. temp = allBall[index];
  7747. if (temp.destroyed)
  7748. continue;
  7749. obj = cfgArr[temp.myUNID];
  7750. if (obj && obj.src && !obj.src.destroyed) {
  7751. temp.gameObj.x = obj.posX;
  7752. temp.gameObj.y = obj.posY;
  7753. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  7754. }
  7755. }
  7756. xGame.common.d2World.getHelpLine();
  7757. }
  7758. updatePlaceBallPos() {
  7759. let arr = xGame.common.d2World.ballArr;
  7760. let temp;
  7761. for (let index = 0; index < arr.length; index++) {
  7762. temp = arr[index];
  7763. if (!this.placeBallPosData[temp.myUNID]) {
  7764. this.placeBallPosData[temp.myUNID] = {
  7765. src: temp,
  7766. posX: temp.gameObj.x,
  7767. posY: temp.gameObj.y
  7768. };
  7769. }
  7770. else {
  7771. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  7772. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  7773. }
  7774. }
  7775. let check;
  7776. for (const key in this.placeBallPosData) {
  7777. check = this.placeBallPosData[key];
  7778. if (check.src.destroyed) {
  7779. delete this.placeBallPosData[key];
  7780. }
  7781. }
  7782. }
  7783. gameRun(type) {
  7784. if (this.gamePause)
  7785. return;
  7786. this.curFoul = this.getFoulType();
  7787. if (type) {
  7788. xGame.common.d2World.d2Gan.shoot();
  7789. xGame.common.gameUI.forceCancel();
  7790. this.curFoul = type;
  7791. }
  7792. this.isEnd = false;
  7793. this.isChangeTurn = true;
  7794. if (xGame.common.gameMode == GameMode.classic) {
  7795. this.judgeClassic(this.curFoul);
  7796. this.checkClassicWords(() => {
  7797. xGame.common.destroyClassicEmotion();
  7798. if (this.isEnd) {
  7799. if (this.isBlackInHole) {
  7800. xGame.common.gameUI.ui.blackAni.visible = true;
  7801. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  7802. xGame.common.gameUI.ui.blackAni.visible = false;
  7803. this.gameEnd();
  7804. }));
  7805. }
  7806. else {
  7807. this.gameEnd();
  7808. }
  7809. }
  7810. else {
  7811. this.waitShoot();
  7812. xGame.eventMgr.event(WAIT_SHOOT);
  7813. }
  7814. });
  7815. }
  7816. else if (xGame.common.gameMode == GameMode.bigMove) {
  7817. xGame.common.aiPlayer.stopRun();
  7818. let scoreArr = this.getScore(this.curFoul);
  7819. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  7820. this.isEnd = true;
  7821. }
  7822. this.checkBigSkillWords(() => {
  7823. if (this.isEnd) {
  7824. this.gameEnd();
  7825. }
  7826. else {
  7827. this.waitShoot();
  7828. xGame.eventMgr.event(WAIT_SHOOT);
  7829. }
  7830. });
  7831. }
  7832. else if (xGame.common.gameMode == GameMode.placeBall) {
  7833. xGame.common.destroyAwardSpine();
  7834. let isFoul = this.curFoul == FoulType.rootHole;
  7835. let GoalNum = this.inHoleBalls.length;
  7836. if (this.inHoleBalls.indexOf(0) > -1)
  7837. GoalNum -= 1;
  7838. if (isFoul) {
  7839. this.placeRootBall();
  7840. }
  7841. console.log("neeballs", this.needBalls);
  7842. console.log("当前完成的goalNum", GoalNum);
  7843. this.finishBalls += GoalNum;
  7844. console.log("当前完成的finishballs", this.finishBalls);
  7845. let need = this.needBalls;
  7846. if (this.placeBallData.type == PlaceBallType.challenge) {
  7847. need += 100;
  7848. }
  7849. if (this.finishBalls >= need) {
  7850. this.success = true;
  7851. this.gameEnd();
  7852. }
  7853. else {
  7854. switch (this.placeBallData.type) {
  7855. case PlaceBallType.normal:
  7856. if (!isFoul && GoalNum > 0) {
  7857. this.updatePlaceBallPos();
  7858. this.updatePlaceBallState();
  7859. }
  7860. else {
  7861. this.curHP--;
  7862. this.openRegretView(isFoul, GoalNum);
  7863. }
  7864. this.waitShoot();
  7865. xGame.eventMgr.event(WAIT_SHOOT);
  7866. break;
  7867. case PlaceBallType.challenge:
  7868. this.curHP--;
  7869. this.updatePlaceBallState();
  7870. if (isFoul) {
  7871. this.openRegretView(isFoul, GoalNum, true);
  7872. }
  7873. else {
  7874. this.updatePlaceBallPos();
  7875. if (this.curHP <= 0) {
  7876. this.success = true;
  7877. this.gameEnd();
  7878. }
  7879. }
  7880. this.waitShoot();
  7881. xGame.eventMgr.event(WAIT_SHOOT);
  7882. break;
  7883. default:
  7884. break;
  7885. }
  7886. }
  7887. }
  7888. }
  7889. checkClassicWords(callback) {
  7890. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  7891. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  7892. let type = this.getClassicWordsType();
  7893. if (condition && type != -1) {
  7894. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  7895. xGame.soundMgr.playSound(str);
  7896. xGame.common.wordsMgr.playClassicWords(type, callback);
  7897. }
  7898. else {
  7899. Laya.timer.once(300, this, () => {
  7900. callback && callback();
  7901. });
  7902. }
  7903. }
  7904. getClassicWordsType() {
  7905. let d2world = xGame.common.d2World;
  7906. let type = -1;
  7907. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  7908. type = ClassicWordsType.perfectShow;
  7909. return type;
  7910. }
  7911. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  7912. type = ClassicWordsType.directShoot;
  7913. return type;
  7914. }
  7915. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  7916. type = ClassicWordsType.anotherShoot;
  7917. return type;
  7918. }
  7919. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  7920. type = ClassicWordsType.bigPower;
  7921. return type;
  7922. }
  7923. let minSpeed = 1;
  7924. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  7925. type = ClassicWordsType.hardShoot;
  7926. return type;
  7927. }
  7928. if (this.inHoleBalls.length > 0) {
  7929. type = ClassicWordsType.directShoot;
  7930. return type;
  7931. }
  7932. return type;
  7933. }
  7934. checkBigSkillWords(callback) {
  7935. if (this.curFoul == FoulType.timeOut) {
  7936. callback && callback();
  7937. }
  7938. else {
  7939. let playSkill = false;
  7940. if (this.selfTurn) {
  7941. playSkill = true;
  7942. }
  7943. else {
  7944. if (!this.aiPlayedBreakArmy) {
  7945. this.aiPlayedBreakArmy = true;
  7946. playSkill = true;
  7947. }
  7948. if (this.aiCurSkill != SkillType.breakArmy) {
  7949. playSkill = true;
  7950. }
  7951. }
  7952. if (xGame.common.skillMgr.playedLastSkill) {
  7953. xGame.common.skillMgr.playedLastSkill = false;
  7954. playSkill = false;
  7955. }
  7956. if (playSkill) {
  7957. xGame.common.skillMgr.runBigSkill((extraScore) => {
  7958. let selfExtra = 0;
  7959. let aiExtra = 0;
  7960. if (this.selfTurn)
  7961. selfExtra += extraScore;
  7962. else
  7963. aiExtra += extraScore;
  7964. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  7965. this.isEnd = true;
  7966. }
  7967. this.playBigSkillTimes(callback);
  7968. });
  7969. }
  7970. else {
  7971. this.playBigSkillTimes(callback);
  7972. }
  7973. }
  7974. }
  7975. playBigSkillTimes(callback) {
  7976. let length = this.inHoleBalls.length;
  7977. if (this.inHoleBalls.indexOf(0) > -1) {
  7978. length = this.inHoleBalls.length - 1;
  7979. }
  7980. if (length <= 0) {
  7981. callback && callback();
  7982. return;
  7983. }
  7984. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  7985. callback && callback();
  7986. });
  7987. }
  7988. playSkillTips() {
  7989. let levelNum = 0;
  7990. let curType;
  7991. if (this.selfTurn) {
  7992. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  7993. curType = this.selfCurSkill;
  7994. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  7995. levelNum += 5;
  7996. }
  7997. }
  7998. else {
  7999. levelNum = this.aiSkillLevelNum;
  8000. curType = this.aiCurSkill;
  8001. }
  8002. let str = ``;
  8003. switch (curType) {
  8004. case SkillType.highSpace:
  8005. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  8006. break;
  8007. case SkillType.breakArmy:
  8008. str = `You pocketed ${levelNum} extra balls`;
  8009. break;
  8010. case SkillType.ice:
  8011. str = `${levelNum * 2} extra balls were frozen`;
  8012. break;
  8013. case SkillType.fireworks:
  8014. str = `${levelNum} extra balls exploded `;
  8015. break;
  8016. case SkillType.GuanYu:
  8017. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  8018. break;
  8019. default:
  8020. break;
  8021. }
  8022. xGame.uiMgr.Show(UIMsg, str);
  8023. }
  8024. getFoulType() {
  8025. let foulType = "";
  8026. if (this.firstColliObj == null) {
  8027. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  8028. return FoulType.rootHole;
  8029. }
  8030. return FoulType.notTouch;
  8031. }
  8032. else {
  8033. if (this.selfTurn) {
  8034. if (this.selfBallArr.length > 0) {
  8035. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  8036. foulType = FoulType.wrongTouch;
  8037. }
  8038. }
  8039. else {
  8040. if (this.ensureBallType) {
  8041. }
  8042. else {
  8043. if (this.firstColliObj == this.blackNum) {
  8044. foulType = FoulType.wrongTouch;
  8045. }
  8046. }
  8047. }
  8048. }
  8049. else {
  8050. if (this.aiBallArr.length > 0) {
  8051. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  8052. foulType = FoulType.wrongTouch;
  8053. }
  8054. }
  8055. else {
  8056. if (this.ensureBallType) {
  8057. }
  8058. else {
  8059. if (this.firstColliObj == this.blackNum) {
  8060. foulType = FoulType.wrongTouch;
  8061. }
  8062. }
  8063. }
  8064. }
  8065. if (this.inHoleBalls.length <= 0) {
  8066. return foulType;
  8067. }
  8068. let temp;
  8069. if (this.inHoleBalls.indexOf(0) > -1) {
  8070. foulType = FoulType.rootHole;
  8071. }
  8072. else {
  8073. for (let index = 0; index < this.inHoleBalls.length; index++) {
  8074. temp = this.inHoleBalls[index];
  8075. if (this.selfTurn) {
  8076. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  8077. foulType = FoulType.wrongHole;
  8078. break;
  8079. }
  8080. }
  8081. else {
  8082. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  8083. foulType = FoulType.wrongHole;
  8084. break;
  8085. }
  8086. }
  8087. }
  8088. }
  8089. let foo;
  8090. for (let index = 0; index < this.inHoleBalls.length; index++) {
  8091. temp = this.inHoleBalls[index];
  8092. foo = this.selfBallArr.indexOf(temp);
  8093. if (foo > -1) {
  8094. this.selfBallArr.splice(foo, 1);
  8095. }
  8096. foo = this.aiBallArr.indexOf(temp);
  8097. if (foo > -1) {
  8098. this.aiBallArr.splice(foo, 1);
  8099. }
  8100. }
  8101. this.updateLeftBall();
  8102. }
  8103. return foulType;
  8104. }
  8105. judgeGameEndByBlack(arr) {
  8106. if (this.selfTurn) {
  8107. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  8108. this.selfFoulNum = this.maxFoulTimes;
  8109. return true;
  8110. }
  8111. }
  8112. else {
  8113. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  8114. this.aiFoulNum = this.maxFoulTimes;
  8115. return true;
  8116. }
  8117. }
  8118. }
  8119. judgeClassic(type) {
  8120. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  8121. xGame.common.aiPlayer.stopRun();
  8122. if (this.judgeNormalSuccess()) {
  8123. this.isEnd = true;
  8124. return;
  8125. }
  8126. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  8127. if (this.selfTurn) {
  8128. if (isFoul) {
  8129. this.selfFoulNum++;
  8130. }
  8131. if (this.selfFoulNum >= this.maxFoulTimes) {
  8132. this.success = false;
  8133. this.isEnd = true;
  8134. return;
  8135. }
  8136. }
  8137. else {
  8138. if (isFoul)
  8139. this.aiFoulNum++;
  8140. if (this.aiFoulNum >= this.maxFoulTimes) {
  8141. this.success = true;
  8142. this.isEnd = true;
  8143. return;
  8144. }
  8145. }
  8146. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  8147. this.isChangeTurn = false;
  8148. }
  8149. else {
  8150. this.isInterrupt = true;
  8151. }
  8152. }
  8153. waitShoot() {
  8154. if (xGame.common.gameMode == GameMode.classic) {
  8155. switch (this.curFoul) {
  8156. case FoulType.timeOut:
  8157. case FoulType.rootHole:
  8158. this.selfTurn = !this.selfTurn;
  8159. this.peoplePlay(5, 6, true);
  8160. break;
  8161. case FoulType.notTouch:
  8162. this.selfTurn = !this.selfTurn;
  8163. this.peoplePlay(7, 7);
  8164. break;
  8165. case FoulType.wrongHole:
  8166. this.selfTurn = !this.selfTurn;
  8167. this.peoplePlay(11, 11);
  8168. break;
  8169. default:
  8170. if (this.inHoleBalls.length > 0) {
  8171. this.peoplePlay(0, 0, false, false);
  8172. }
  8173. else {
  8174. this.selfTurn = !this.selfTurn;
  8175. this.peoplePlay(7, 7);
  8176. }
  8177. break;
  8178. }
  8179. }
  8180. else if (xGame.common.gameMode == GameMode.bigMove) {
  8181. if (this.curFoul == FoulType.timeOut) {
  8182. this.selfTurn = !this.selfTurn;
  8183. this.peoplePlay(14, 15);
  8184. this.placeRootBall();
  8185. }
  8186. else {
  8187. this.selfTurn = !this.selfTurn;
  8188. if (this.curFoul == FoulType.rootHole) {
  8189. this.peoplePlay(12, 13);
  8190. this.placeRootBall();
  8191. }
  8192. else {
  8193. this.peoplePlay(0, 0, false, false);
  8194. }
  8195. }
  8196. }
  8197. else if (xGame.common.gameMode == GameMode.placeBall) {
  8198. this.finishOneShoot = true;
  8199. }
  8200. this.gameResult();
  8201. }
  8202. gameResult() {
  8203. this.firstColliObj = null;
  8204. this.inHoleBalls = [];
  8205. let curX = xGame.common.d2World.rootBall.gameObj.x;
  8206. let curY = xGame.common.d2World.rootBall.gameObj.y;
  8207. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  8208. if (xGame.common.uiRodMethod)
  8209. xGame.common.uiRodMethod.resetRod();
  8210. xGame.common.d2World.rootBall.showSelf();
  8211. this.clearIceSkill();
  8212. if (this.selfTurn) {
  8213. console.log("gameResult");
  8214. PlatMgr.gameInsert();
  8215. }
  8216. xGame.common.d3World.knifeRoot.destroyChildren();
  8217. if (this.selfTurn) {
  8218. xGame.common.gameUI.showHelpLineGuide();
  8219. xGame.common.gameUI.setTurnAlpha(true);
  8220. }
  8221. else {
  8222. xGame.common.gameUI.setTurnAlpha(false);
  8223. }
  8224. }
  8225. getScore(type) {
  8226. let selfAdd = 0;
  8227. let aiAdd = 0;
  8228. if (type == FoulType.timeOut) {
  8229. if (this.selfTurn)
  8230. aiAdd += 3;
  8231. else
  8232. selfAdd += 3;
  8233. }
  8234. else {
  8235. if (this.inHoleBalls.length > 0) {
  8236. if (this.selfTurn) {
  8237. if (type == FoulType.rootHole) {
  8238. aiAdd += 3;
  8239. if (this.inHoleBalls.length - 1 > 0) {
  8240. selfAdd += this.inHoleBalls.length - 1;
  8241. }
  8242. }
  8243. else {
  8244. selfAdd += this.inHoleBalls.length;
  8245. }
  8246. }
  8247. else {
  8248. if (type == FoulType.rootHole) {
  8249. selfAdd += 3;
  8250. if (this.inHoleBalls.length - 1 > 0) {
  8251. aiAdd += this.inHoleBalls.length - 1;
  8252. }
  8253. }
  8254. else {
  8255. aiAdd += this.inHoleBalls.length;
  8256. }
  8257. }
  8258. }
  8259. }
  8260. return [selfAdd, aiAdd];
  8261. }
  8262. judgeScoreEnd(selfAdd, aiAdd) {
  8263. this.selfScore += selfAdd;
  8264. this.aiScore += aiAdd;
  8265. this.updateAIScore();
  8266. this.updateSelfScore();
  8267. if (this.selfScore >= this.targertScore) {
  8268. this.success = true;
  8269. return true;
  8270. }
  8271. if (this.aiScore >= this.targertScore) {
  8272. this.success = false;
  8273. return true;
  8274. }
  8275. let ballArr = xGame.common.d2World.ballArr;
  8276. if (ballArr.length == 1 && ballArr[0].number == 0) {
  8277. if (this.selfScore > this.aiScore) {
  8278. this.success = true;
  8279. return true;
  8280. }
  8281. else if (this.selfScore < this.aiScore) {
  8282. this.success = false;
  8283. return true;
  8284. }
  8285. else {
  8286. if (this.selfTurn) {
  8287. this.success = false;
  8288. }
  8289. else {
  8290. this.success = true;
  8291. }
  8292. return true;
  8293. }
  8294. }
  8295. }
  8296. clearIceSkill() {
  8297. let arr = xGame.common.d2World.ballArr;
  8298. let temp;
  8299. if (this.selfTurn) {
  8300. if (this.selfCurSkill == SkillType.ice) {
  8301. for (let index = 0; index < arr.length; index++) {
  8302. temp = arr[index];
  8303. if (temp.ballFunc == "ice") {
  8304. temp.setBallFunc("normal", "self");
  8305. }
  8306. }
  8307. }
  8308. }
  8309. else {
  8310. if (this.aiCurSkill == SkillType.ice) {
  8311. for (let index = 0; index < arr.length; index++) {
  8312. temp = arr[index];
  8313. if (temp.ballFunc == "ice") {
  8314. temp.setBallFunc("normal", "ai");
  8315. }
  8316. }
  8317. }
  8318. }
  8319. }
  8320. judgeNormalSuccess() {
  8321. if (this.selfTurn) {
  8322. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  8323. this.success = true;
  8324. return true;
  8325. }
  8326. }
  8327. else {
  8328. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  8329. this.success = false;
  8330. return true;
  8331. }
  8332. }
  8333. }
  8334. gameEnd() {
  8335. if (Moyu.isTT) {
  8336. xGame.common.screenImg = getScreenImg();
  8337. }
  8338. console.log("游戏结束", this.success);
  8339. xGame.common.aiPlayer.stopRun();
  8340. if (xGame.common.gameMode == GameMode.placeBall) {
  8341. this.getEndStarNum();
  8342. this.updatePlaceBallState();
  8343. }
  8344. this.isEnter = false;
  8345. Moyu.recordEnd(this, () => {
  8346. if (this.isEnter)
  8347. return;
  8348. this.isEnter = true;
  8349. console.log("进入录结束回调");
  8350. this.enterNext();
  8351. });
  8352. Laya.timer.once(1000, this, () => {
  8353. if (this.isEnter)
  8354. return;
  8355. this.isEnter = true;
  8356. this.enterNext();
  8357. });
  8358. xGame.common.longHelpLine = false;
  8359. }
  8360. enterNext() {
  8361. Laya.timer.clearAll(this);
  8362. if (Moyu.canShare() > 100 || Moyu.isKs) {
  8363. xGame.uiMgr.Show(UIVideoShare, this.success);
  8364. }
  8365. else {
  8366. xGame.uiMgr.Show(UIGameEnd, this.success);
  8367. }
  8368. }
  8369. aiLeave() {
  8370. let ui = xGame.common.gameUI.ui;
  8371. ui.topNode.aiNameTxt.text = "offline";
  8372. }
  8373. aiGameEnd(suc) {
  8374. this.success = suc;
  8375. xGame.common.aiPlayer.stopRun();
  8376. if (this.success) {
  8377. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  8378. Laya.timer.once(1000, this, () => {
  8379. this.clearTime();
  8380. this.gameEnd();
  8381. });
  8382. }
  8383. }
  8384. openTimer() {
  8385. let src = xGame.common.gameUI;
  8386. if (this.selfTurn) {
  8387. src.ui.topNode.selfProgress.visible = true;
  8388. src.ui.topNode.aiProgress.visible = false;
  8389. this.curTimer = src.ui.topNode.selfProgress;
  8390. }
  8391. else {
  8392. src.ui.topNode.selfProgress.visible = false;
  8393. src.ui.topNode.aiProgress.visible = true;
  8394. this.curTimer = src.ui.topNode.aiProgress;
  8395. }
  8396. this.accTime = 0;
  8397. Laya.timer.clearAll(this);
  8398. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  8399. this.curTimer.value = 100;
  8400. }
  8401. updateTime(dt) {
  8402. if (this.gamePause)
  8403. return;
  8404. this.accTime += dt;
  8405. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  8406. if (this.accTime >= this.setTime) {
  8407. this.clearTime();
  8408. console.log("时钟进入了gameRun");
  8409. this.gameRun(FoulType.timeOut);
  8410. }
  8411. }
  8412. clearTime() {
  8413. let src = xGame.common.gameUI;
  8414. src.ui.topNode.selfProgress.visible = false;
  8415. src.ui.topNode.aiProgress.visible = false;
  8416. Laya.timer.clearAll(this);
  8417. }
  8418. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  8419. let ui = xGame.common.gameUI.ui;
  8420. let selfMsg, aiMsg;
  8421. if (sayWords) {
  8422. selfMsg = cfgTable.wordsData[selfIndex].msg;
  8423. aiMsg = cfgTable.wordsData[aiIndex].msg;
  8424. if (Foul) {
  8425. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  8426. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  8427. this.placeRootBall();
  8428. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  8429. if (this.curFoul == FoulType.rootHole) {
  8430. if (!DataMgr.getRootBallFoul()) {
  8431. DataMgr.setRootBallFoul();
  8432. aiMsg = "";
  8433. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  8434. let woman = "Boss, pay attention next time~";
  8435. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  8436. }
  8437. }
  8438. else if (this.curFoul == FoulType.timeOut) {
  8439. if (!DataMgr.getTimeoutFoul()) {
  8440. DataMgr.setTimeoutFoul();
  8441. aiMsg = "";
  8442. let tips = "Game timeout, 3 fouls, this game failed.";
  8443. let woman = "Boss, pay attention to the timeline~";
  8444. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  8445. }
  8446. }
  8447. }
  8448. }
  8449. }
  8450. if (this.selfTurn) {
  8451. if (sayWords) {
  8452. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  8453. ui.selfTurn.visible = true;
  8454. ui.aiTurn.visible = false;
  8455. ui.selfTurn.t0.play();
  8456. Moyu.vibration();
  8457. });
  8458. }
  8459. }
  8460. else {
  8461. let aiNum = xGame.tools.random(1, 11);
  8462. let challengeNum = DataMgr.getChallengeTimes();
  8463. let delay = false;
  8464. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8465. aiNum = 9;
  8466. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  8467. aiNum = 3;
  8468. if (challengeNum == 3) {
  8469. if (!this.showLongView) {
  8470. this.showLongView = true;
  8471. delay = true;
  8472. }
  8473. }
  8474. }
  8475. }
  8476. if (delay) {
  8477. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  8478. if (success) {
  8479. xGame.common.longHelpLine = true;
  8480. xGame.common.d2World.getHelpLine();
  8481. }
  8482. else {
  8483. aiNum = 10;
  8484. }
  8485. xGame.common.aiPlayer.setAiLevel(aiNum);
  8486. if (sayWords) {
  8487. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  8488. xGame.common.aiPlayer.runAI();
  8489. ui.selfTurn.visible = false;
  8490. ui.aiTurn.visible = true;
  8491. ui.aiTurn.t0.play();
  8492. });
  8493. }
  8494. else {
  8495. xGame.common.aiPlayer.runAI();
  8496. }
  8497. this.openTimer();
  8498. this.finishOneShoot = true;
  8499. if (this.selfTurn) {
  8500. ui.topNode.selfKuang.visible = true;
  8501. ui.topNode.aiKuang.visible = false;
  8502. ui.topNode.selfTips.visible = true;
  8503. ui.topNode.aiTips.visible = false;
  8504. }
  8505. else {
  8506. ui.topNode.selfKuang.visible = false;
  8507. ui.topNode.aiKuang.visible = true;
  8508. ui.topNode.selfTips.visible = false;
  8509. ui.topNode.aiTips.visible = true;
  8510. }
  8511. });
  8512. return;
  8513. }
  8514. if (xGame.common.gameMode == GameMode.classic) {
  8515. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  8516. if (cfg) {
  8517. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  8518. aiNum = aiLevel;
  8519. }
  8520. }
  8521. xGame.common.aiPlayer.setAiLevel(aiNum);
  8522. if (sayWords) {
  8523. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  8524. xGame.common.aiPlayer.runAI();
  8525. ui.selfTurn.visible = false;
  8526. ui.aiTurn.visible = true;
  8527. ui.aiTurn.t0.play();
  8528. });
  8529. }
  8530. else {
  8531. xGame.common.aiPlayer.runAI();
  8532. }
  8533. }
  8534. this.openTimer();
  8535. this.finishOneShoot = true;
  8536. if (this.selfTurn) {
  8537. ui.topNode.selfKuang.visible = true;
  8538. ui.topNode.aiKuang.visible = false;
  8539. ui.topNode.selfTips.visible = true;
  8540. ui.topNode.aiTips.visible = false;
  8541. }
  8542. else {
  8543. ui.topNode.selfKuang.visible = false;
  8544. ui.topNode.aiKuang.visible = true;
  8545. ui.topNode.selfTips.visible = false;
  8546. ui.topNode.aiTips.visible = true;
  8547. }
  8548. }
  8549. placeRootBall() {
  8550. let rootBall = xGame.common.d2World.rootBall;
  8551. if (!rootBall)
  8552. return;
  8553. rootBall.gameObj.x = this.lastRootBallPos.x;
  8554. rootBall.gameObj.y = this.lastRootBallPos.y;
  8555. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  8556. let moveNode = xGame.common.gameUI.ui.moveNode;
  8557. moveNode.visible = true;
  8558. moveNode.x = this.lastRootBallPos.x;
  8559. moveNode.y = this.lastRootBallPos.y;
  8560. if (!this.selfTurn) {
  8561. xGame.common.aiPlayer.resetRoot();
  8562. }
  8563. }
  8564. }
  8565. class ui_guanyuAni extends fgui.GComponent {
  8566. static createInstance() {
  8567. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  8568. }
  8569. onConstruct() {
  8570. this.n0 = (this.getChild("n0"));
  8571. }
  8572. }
  8573. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  8574. class UIFireworks extends UIBase {
  8575. constructor() {
  8576. super();
  8577. }
  8578. onConstructor() {
  8579. this.isEject = false;
  8580. }
  8581. show(callback) {
  8582. super.show();
  8583. }
  8584. }
  8585. UIFireworks.uiName = "UIFireworks";
  8586. class ui_UIGuanYu extends fgui.GComponent {
  8587. static createInstance() {
  8588. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  8589. }
  8590. onConstruct() {
  8591. this.n2 = (this.getChild("n2"));
  8592. this.n1 = (this.getChild("n1"));
  8593. this.n3 = (this.getChild("n3"));
  8594. this.n4 = (this.getChild("n4"));
  8595. this.n5 = (this.getChild("n5"));
  8596. this.n6 = (this.getChild("n6"));
  8597. this.n8 = (this.getChild("n8"));
  8598. this.n7 = (this.getChild("n7"));
  8599. this.t0 = this.getTransition("t0");
  8600. }
  8601. }
  8602. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  8603. class UIGuanYu extends UIBase {
  8604. constructor() {
  8605. super();
  8606. }
  8607. onConstructor() {
  8608. this.ui = ui_UIGuanYu.createInstance();
  8609. this.contentPane = this.ui;
  8610. this.isEject = false;
  8611. }
  8612. show(callback) {
  8613. super.show();
  8614. this.ui.t0.play(Laya.Handler.create(this, () => {
  8615. callback && callback();
  8616. this.hide();
  8617. }));
  8618. }
  8619. }
  8620. UIGuanYu.uiName = "UIGuanYu";
  8621. class SkillMgr {
  8622. constructor() {
  8623. this.leveNum = 0;
  8624. this.extraScore = 0;
  8625. this.selfTurn = false;
  8626. this.playedLastSkill = false;
  8627. this.tweenArr = [];
  8628. this._finishNum = 0;
  8629. this._curFinish = 0;
  8630. this._rootX = 0;
  8631. this._rootY = 0;
  8632. this.knifeTimes = 0;
  8633. this.knifeV2 = new Laya.Vector2();
  8634. this.knifeV3 = new Laya.Vector3();
  8635. this.rtStarX = 0;
  8636. this.rtStarY = 0;
  8637. this.addBigSkillSpine();
  8638. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8639. }
  8640. addBigSkillSpine() {
  8641. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  8642. console.log("extra2 success");
  8643. });
  8644. }
  8645. runBigSkill(callback) {
  8646. this.tweenArr = [];
  8647. this.callback = callback;
  8648. this.judgeSkill();
  8649. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  8650. let guide = DataMgr.getSkillGuide();
  8651. if (!xGame.common.gameMgr.selfTurn) {
  8652. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  8653. }
  8654. else {
  8655. if (xGame.common.temSelfLevel != 0) {
  8656. this.leveNum = xGame.common.temSelfLevel;
  8657. }
  8658. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  8659. this.leveNum += 5;
  8660. }
  8661. }
  8662. if (guide == 0) {
  8663. DataMgr.setSkillGuide(1);
  8664. if (DataMgr.getNewUser()) {
  8665. Moyu.sendDataEvent("gameFirstPlay");
  8666. DataMgr.setNewUser();
  8667. }
  8668. }
  8669. this.playSpineAni(() => {
  8670. switch (this.curSkill) {
  8671. case SkillType.highSpace:
  8672. this.runHighSpace();
  8673. break;
  8674. case SkillType.breakArmy:
  8675. this.runBreakArmy();
  8676. break;
  8677. case SkillType.ice:
  8678. this.runIce();
  8679. break;
  8680. case SkillType.fireworks:
  8681. this.runFireworks();
  8682. break;
  8683. case SkillType.GuanYu:
  8684. this.runGuanYu();
  8685. break;
  8686. default:
  8687. break;
  8688. }
  8689. });
  8690. }
  8691. judgeSkill() {
  8692. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  8693. let gameMgr = xGame.common.gameMgr;
  8694. let type;
  8695. for (let index = 0; index < typeArr.length; index++) {
  8696. type = typeArr[index];
  8697. if (gameMgr.selfTurn) {
  8698. if (gameMgr.selfCurSkill == type) {
  8699. this.selfTurn = true;
  8700. this.curSkill = type;
  8701. return;
  8702. }
  8703. }
  8704. else {
  8705. if (gameMgr.aiCurSkill == type) {
  8706. this.selfTurn = false;
  8707. this.curSkill = type;
  8708. return;
  8709. }
  8710. }
  8711. }
  8712. }
  8713. playSpineAni(callback) {
  8714. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  8715. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  8716. parent.destroyChildren();
  8717. let aniIndex = 0;
  8718. let skillSpine;
  8719. switch (this.curSkill) {
  8720. case SkillType.highSpace:
  8721. aniIndex = 1;
  8722. xGame.soundMgr.playSound("skill01");
  8723. skillSpine = this.skillSpine2;
  8724. data.scaleX = 0.5;
  8725. data.scaleY = 0.5;
  8726. skillSpine.play(data, 1, false, parent, () => {
  8727. callback && callback();
  8728. });
  8729. break;
  8730. case SkillType.breakArmy:
  8731. aniIndex = 2;
  8732. xGame.soundMgr.playSound("skill02");
  8733. skillSpine = this.skillSpine2;
  8734. data.scaleX = 0.5;
  8735. data.scaleY = 0.5;
  8736. skillSpine.play(data, 2, false, parent, () => {
  8737. callback && callback();
  8738. });
  8739. break;
  8740. case SkillType.ice:
  8741. aniIndex = 0;
  8742. xGame.soundMgr.playSound("skill03");
  8743. skillSpine = this.skillSpine2;
  8744. data.scaleX = 0.5;
  8745. data.scaleY = 0.5;
  8746. skillSpine.play(data, 0, false, parent, () => {
  8747. callback && callback();
  8748. });
  8749. break;
  8750. case SkillType.fireworks:
  8751. xGame.soundMgr.playSound("skill_04_01");
  8752. xGame.soundMgr.playSound("skill04");
  8753. xGame.uiMgr.Show(UIFireworks, callback);
  8754. break;
  8755. case SkillType.GuanYu:
  8756. xGame.soundMgr.playSound("skill05_1");
  8757. xGame.soundMgr.playSound("skill05");
  8758. xGame.uiMgr.Show(UIGuanYu, callback);
  8759. break;
  8760. default:
  8761. break;
  8762. }
  8763. }
  8764. getAllBallArr() {
  8765. let arr = xGame.common.d2World.ballArr;
  8766. let outArr = [];
  8767. for (let index = 0; index < arr.length; index++) {
  8768. if (arr[index] instanceof D2RootBallSrc)
  8769. continue;
  8770. if (arr[index].ballFunc == "ice")
  8771. continue;
  8772. if (arr[index].destroyed)
  8773. continue;
  8774. outArr.push(arr[index]);
  8775. }
  8776. return outArr;
  8777. }
  8778. getOneArr(deletObj) {
  8779. let allArr = this.getAllBallArr();
  8780. let temp;
  8781. for (let index = 0; index < allArr.length; index++) {
  8782. temp = allArr[index];
  8783. if (temp.id == deletObj.id) {
  8784. allArr.splice(index, 1);
  8785. break;
  8786. }
  8787. }
  8788. return allArr;
  8789. }
  8790. getNearBallBag(ball) {
  8791. let ui = xGame.common.gameUI.ui;
  8792. let circleArr = [];
  8793. for (let index = 1; index <= 6; index++) {
  8794. circleArr.push(ui.border["circle" + index]);
  8795. }
  8796. let outIndex = 0;
  8797. let temp;
  8798. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  8799. ;
  8800. let dis = 0;
  8801. for (let index = 1; index < circleArr.length; index++) {
  8802. temp = circleArr[index];
  8803. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  8804. if (dis < min) {
  8805. min = dis;
  8806. outIndex = index;
  8807. }
  8808. }
  8809. return [circleArr[outIndex], outIndex];
  8810. }
  8811. ballFlyToBag(ballArr, time = 300) {
  8812. let temp;
  8813. let hole;
  8814. this._finishNum = ballArr.length;
  8815. this._curFinish = 0;
  8816. let holeObj = {};
  8817. let holeCfg = {
  8818. "1": 0,
  8819. "2": 0,
  8820. "3": 0,
  8821. "4": 0,
  8822. "5": 0,
  8823. "6": 0
  8824. };
  8825. for (let index = 0; index < ballArr.length; index++) {
  8826. temp = ballArr[index];
  8827. temp.outColli.isSensor = true;
  8828. temp.innerColli.isSensor = true;
  8829. temp.isRunSkillAni = true;
  8830. let holeArr = this.getNearBallBag(temp);
  8831. hole = holeArr[0];
  8832. holeObj[index] = holeArr[1];
  8833. temp.d3BallSrc.scaleXYZ = 0.5;
  8834. this.tweenArr.push(temp.d3BallSrc, temp);
  8835. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  8836. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  8837. }));
  8838. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  8839. let mIndex = holeObj[this._curFinish];
  8840. let isDone = holeCfg[mIndex];
  8841. if (isDone) {
  8842. ballArr[this._curFinish].checkWrongBall(false);
  8843. }
  8844. else {
  8845. holeCfg[mIndex] = 1;
  8846. ballArr[this._curFinish].checkWrongBall();
  8847. }
  8848. this._curFinish++;
  8849. if (this._curFinish >= this._finishNum) {
  8850. if (this.curSkill == SkillType.highSpace) {
  8851. }
  8852. else if (this.curSkill == SkillType.breakArmy) {
  8853. let rootBall = xGame.common.d2World.rootBall;
  8854. rootBall.gameObj.x = this._rootX;
  8855. rootBall.gameObj.y = this._rootY;
  8856. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  8857. xGame.common.d2World.d2Gan.ui.visible = true;
  8858. xGame.common.d2World.d2HelpLine.ui.visible = true;
  8859. xGame.common.d2World.getHelpLine();
  8860. this.callback && this.callback(this.extraScore);
  8861. }
  8862. }
  8863. }));
  8864. }
  8865. }
  8866. runHighSpace() {
  8867. let rootBall = xGame.common.d2World.rootBall;
  8868. rootBall.showSelf();
  8869. let d3Src = rootBall.d3BallSrc;
  8870. let allArr = this.getAllBallArr();
  8871. if (allArr.length <= 0) {
  8872. this.callback && this.callback(0);
  8873. return;
  8874. }
  8875. let selectBall = xGame.common.d2World.targetBall;
  8876. let wrong = selectBall && selectBall.destroyed;
  8877. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  8878. selectBall = xGame.common.getRandArrEle(allArr);
  8879. }
  8880. let targetD3Src = selectBall.d3BallSrc;
  8881. xGame.common.d2World.d2Gan.ui.visible = false;
  8882. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8883. d3Src.scaleXYZ = 0.5;
  8884. this.tweenArr.push(d3Src);
  8885. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  8886. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  8887. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  8888. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  8889. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  8890. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  8891. let outArr = [selectBall];
  8892. let other = this.leveNum - 1;
  8893. if (other > 0) {
  8894. let nearArr = this.getOneArr(selectBall);
  8895. if (nearArr.length > 0) {
  8896. xGame.common.botherArr(nearArr);
  8897. if (other >= nearArr.length)
  8898. other = nearArr.length;
  8899. for (let index = 0; index < other; index++) {
  8900. outArr.push(nearArr[index]);
  8901. }
  8902. }
  8903. }
  8904. xGame.common.extraMoveNum = other + 1;
  8905. this.extraScore = other + 1;
  8906. this._rootX = selectBall.gameObj.x;
  8907. this._rootY = selectBall.gameObj.y;
  8908. rootBall.gameObj.x = this._rootX;
  8909. rootBall.gameObj.y = this._rootY;
  8910. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  8911. Laya.Tween.clearAll(d3Src);
  8912. this.addRandomForce(outArr);
  8913. }));
  8914. }));
  8915. }
  8916. addRandomForce(outArr) {
  8917. if (outArr.length > 0) {
  8918. xGame.common.d2World.openCheckStill = true;
  8919. this.playedLastSkill = true;
  8920. }
  8921. let temp;
  8922. for (let index = 0; index < outArr.length; index++) {
  8923. let angle = xGame.common.randomNum(0, 360);
  8924. let linearPercent = xGame.common.randomNum(65, 100);
  8925. temp = outArr[index];
  8926. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  8927. }
  8928. }
  8929. setLinearSpeed(angle, rigy, linearPercent) {
  8930. let sin = Math.sin(angle * Math.PI / 180);
  8931. let cos = Math.cos(angle * Math.PI / 180);
  8932. let maxSpeed = 4;
  8933. let speed = new Laya.Vector2();
  8934. speed.x = maxSpeed * linearPercent * sin;
  8935. speed.y = -maxSpeed * linearPercent * cos;
  8936. rigy.applyLinearImpulseToCenter(speed);
  8937. }
  8938. runBreakArmy() {
  8939. xGame.common.d2World.d2Gan.ui.visible = false;
  8940. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8941. let gameUI = xGame.common.gameUI.ui;
  8942. gameUI.skillRod.visible = true;
  8943. gameUI.skillRod.rotation = 110;
  8944. let outArr = this.getAllBallArr();
  8945. if (outArr.length <= 0) {
  8946. gameUI.skillRod.visible = false;
  8947. this.callback && this.callback(0);
  8948. return;
  8949. }
  8950. xGame.common.botherArr(outArr);
  8951. if (this.leveNum >= outArr.length)
  8952. this.leveNum = outArr.length;
  8953. let deleteNum = outArr.length - this.leveNum;
  8954. outArr.splice(0, deleteNum);
  8955. this.extraScore = this.leveNum;
  8956. let potX = gameUI.skillRod.x;
  8957. let potY = gameUI.skillRod.y;
  8958. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  8959. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  8960. let disArr = [];
  8961. for (let index = 0; index < outArr.length; index++) {
  8962. let obj = outArr[index];
  8963. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  8964. dis = Math.pow(dis, 0.5);
  8965. disArr.push(dis);
  8966. }
  8967. this.tweenArr.push(gameUI.skillRod);
  8968. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  8969. })).update = Laya.Handler.create(this, (e, t, c) => {
  8970. let angle = gameUI.skillRod.rotation;
  8971. let xx;
  8972. let yy;
  8973. let temp;
  8974. for (let index = 0; index < outArr.length; index++) {
  8975. temp = outArr[index];
  8976. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  8977. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  8978. yy -= 20;
  8979. temp.gameObj.x = xx;
  8980. temp.gameObj.y = yy;
  8981. temp.d3BallSrc.setTransPos(xx, yy);
  8982. }
  8983. if (angle <= 60) {
  8984. Laya.Tween.clearAll(gameUI.skillRod);
  8985. this.ballFlyToBag(outArr, 150);
  8986. gameUI.skillRod.visible = false;
  8987. }
  8988. }, null, false);
  8989. }
  8990. runIce() {
  8991. let ballArr = xGame.common.d2World.ballArr;
  8992. this.leveNum *= 2;
  8993. if (this.leveNum >= ballArr.length - 1)
  8994. this.leveNum = ballArr.length - 1;
  8995. let tempArr = [];
  8996. let outArr = [];
  8997. for (let index = 0; index < ballArr.length; index++) {
  8998. if (ballArr[index] instanceof D2RootBallSrc)
  8999. continue;
  9000. tempArr.push(ballArr[index]);
  9001. }
  9002. if (tempArr.length <= 0) {
  9003. this.callback && this.callback(0);
  9004. return;
  9005. }
  9006. xGame.common.botherArr(tempArr);
  9007. for (let index = 0; index < this.leveNum; index++) {
  9008. outArr.push(tempArr[index]);
  9009. }
  9010. this.extraScore = this.leveNum;
  9011. let temp;
  9012. for (let index = 0; index < outArr.length; index++) {
  9013. temp = outArr[index];
  9014. temp.d3BallSrc.playIceEft();
  9015. }
  9016. Laya.timer.once(2000, this, () => {
  9017. for (let index = 0; index < outArr.length; index++) {
  9018. temp = outArr[index];
  9019. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  9020. temp.setBallFunc("ice", str);
  9021. }
  9022. this.callback && this.callback(0);
  9023. });
  9024. }
  9025. runFireworks() {
  9026. let allArr = this.getAllBallArr();
  9027. if (allArr.length <= 0) {
  9028. this.callback && this.callback(0);
  9029. return;
  9030. }
  9031. xGame.common.d2World.d2Gan.ui.visible = false;
  9032. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9033. let outArr = [];
  9034. let other = this.leveNum;
  9035. if (other > 0) {
  9036. if (allArr.length > 0) {
  9037. xGame.common.botherArr(allArr);
  9038. if (other >= allArr.length)
  9039. other = allArr.length;
  9040. for (let index = 0; index < other; index++) {
  9041. outArr.push(allArr[index]);
  9042. }
  9043. }
  9044. }
  9045. xGame.common.extraMoveNum = other;
  9046. this.extraScore = other;
  9047. this.addRandmomFireworks(outArr);
  9048. }
  9049. addRandmomFireworks(outArr) {
  9050. Laya.timer.once(1100, this, () => {
  9051. if (outArr.length > 0) {
  9052. xGame.common.d2World.openCheckStill = true;
  9053. this.playedLastSkill = true;
  9054. }
  9055. });
  9056. xGame.soundMgr.playSound("skill_04_02");
  9057. let temp;
  9058. let delay = -200;
  9059. for (let index = 0; index < outArr.length; index++) {
  9060. temp = outArr[index];
  9061. delay += 200;
  9062. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  9063. let angle = xGame.common.randomNum(0, 360);
  9064. angle = this.getFireworksAngle(obj);
  9065. let linearPercent = xGame.common.randomNum(45, 80);
  9066. if (!obj.destroyed)
  9067. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  9068. });
  9069. }
  9070. }
  9071. getFireworksAngle(obj) {
  9072. let rootBall = xGame.common.d2World.rootBall;
  9073. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  9074. }
  9075. resetGame() {
  9076. Laya.timer.clearAll(this);
  9077. if (this.tweenArr) {
  9078. for (let index = 0; index < this.tweenArr.length; index++) {
  9079. Laya.Tween.clearAll(this.tweenArr[index]);
  9080. }
  9081. }
  9082. this.tweenArr = null;
  9083. }
  9084. runGuanYu() {
  9085. xGame.common.d2World.d2Gan.ui.visible = false;
  9086. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9087. let rootBall = xGame.common.d2World.rootBall;
  9088. if (rootBall.isInHole) {
  9089. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  9090. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  9091. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  9092. rootBall.showSelf();
  9093. }
  9094. this.rtStarX = rootBall.gameObj.x;
  9095. this.rtStarY = rootBall.gameObj.y;
  9096. this.knifeTimes = 0;
  9097. this.playedLastSkill = true;
  9098. rootBall.forceRun = true;
  9099. rootBall.rigy.type = "static";
  9100. xGame.common.d2World.openCheckStill = true;
  9101. this.guanyuRandomKnife();
  9102. }
  9103. guanyuRandomKnife() {
  9104. let rootBall = xGame.common.d2World.rootBall;
  9105. let dir = this.getRandDir();
  9106. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  9107. console.log("当前angle", angle);
  9108. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  9109. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  9110. let dis = 324;
  9111. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  9112. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  9113. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  9114. this.rtStarX = rootBall.gameObj.x;
  9115. this.rtStarY = rootBall.gameObj.y;
  9116. this.knifeTimes++;
  9117. let skillLevel;
  9118. if (xGame.common.gameMgr.selfTurn) {
  9119. skillLevel = DataMgr.getBigSkillByIndex(4);
  9120. }
  9121. else {
  9122. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  9123. }
  9124. if (!skillLevel)
  9125. skillLevel = 1;
  9126. skillLevel += 2;
  9127. if (this.knifeTimes < skillLevel) {
  9128. Laya.timer.once(400, this, () => {
  9129. this.guanyuRandomKnife();
  9130. });
  9131. }
  9132. else {
  9133. rootBall.forceRun = false;
  9134. rootBall.rigy.type = "dynamic";
  9135. xGame.common.extraMoveNum = skillLevel;
  9136. }
  9137. }));
  9138. }
  9139. getRandDir() {
  9140. let rootBall = xGame.common.d2World.rootBall;
  9141. let allBall = this.getAllBallArr();
  9142. let target = xGame.common.getRandArrEle(allBall);
  9143. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  9144. return this.knifeV2;
  9145. }
  9146. cloneKnife(x, y, rotation) {
  9147. let parent = xGame.common.d3World.knifeRoot;
  9148. let prefab = xGame.common.d3World.knife;
  9149. let clone = prefab.clone();
  9150. parent.addChild(clone);
  9151. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  9152. clone.transform.localPositionX = this.knifeV3.x;
  9153. clone.transform.localPositionY = 0;
  9154. clone.transform.localPositionZ = this.knifeV3.z;
  9155. clone.transform.localRotationEulerX = 0;
  9156. clone.transform.localRotationEulerY = rotation;
  9157. clone.transform.localRotationEulerZ = 0;
  9158. clone.active = true;
  9159. return clone;
  9160. }
  9161. cloneGuanYuEft(x, y, angle) {
  9162. return;
  9163. let parent = xGame.common.gameUI.ui.guanyuNode;
  9164. let eft = new ui_guanyuAni();
  9165. eft.parent = parent;
  9166. eft.x = x;
  9167. eft.y = y;
  9168. eft.rotation = angle;
  9169. }
  9170. }
  9171. class ui_UIWordsList extends fgui.GComponent {
  9172. static createInstance() {
  9173. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  9174. }
  9175. onConstruct() {
  9176. this.c1 = this.getController("c1");
  9177. this.n74 = (this.getChild("n74"));
  9178. this.clickNode = (this.getChild("clickNode"));
  9179. this.myNode = (this.getChild("myNode"));
  9180. this.n68 = (this.getChild("n68"));
  9181. this.n66 = (this.getChild("n66"));
  9182. this.n55 = (this.getChild("n55"));
  9183. this.wordsBtn = (this.getChild("wordsBtn"));
  9184. this.emotionBtn = (this.getChild("emotionBtn"));
  9185. this.mybggg = (this.getChild("mybggg"));
  9186. this.wordsList = (this.getChild("wordsList"));
  9187. this.emotionList = (this.getChild("emotionList"));
  9188. this.myRoot = (this.getChild("myRoot"));
  9189. }
  9190. }
  9191. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  9192. class EmotionDisplay {
  9193. constructor(index, ui) {
  9194. this.ui = ui;
  9195. this.index = index;
  9196. this.ui.onClick(this, this.clickSelf);
  9197. this.updateSelf();
  9198. }
  9199. updateSelf() {
  9200. let data = cfgTable.emotionData[this.index + 1];
  9201. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  9202. }
  9203. clickSelf() {
  9204. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9205. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  9206. xGame.common.talkMgr.closeTalkView();
  9207. }
  9208. }
  9209. class WordsDisplay {
  9210. constructor(index, ui) {
  9211. this.ui = ui;
  9212. this.index = index;
  9213. this.ui.onClick(this, this.clickSelf);
  9214. this.updateSelf();
  9215. }
  9216. updateSelf() {
  9217. let data = cfgTable.talkwordsData[this.index + 1];
  9218. this.ui.txt.text = data.msg;
  9219. }
  9220. clickSelf() {
  9221. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9222. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  9223. xGame.common.talkMgr.closeTalkView();
  9224. }
  9225. }
  9226. class UIWordsList extends UIBase {
  9227. constructor() {
  9228. super();
  9229. }
  9230. onConstructor() {
  9231. this.ui = ui_UIWordsList.createInstance();
  9232. this.contentPane = this.ui;
  9233. this.isEject = false;
  9234. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  9235. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  9236. this.addUIClick(this.ui.clickNode, this.hide);
  9237. this.initTalkList();
  9238. this.initEmotionList();
  9239. }
  9240. show() {
  9241. super.show();
  9242. }
  9243. initTalkList() {
  9244. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  9245. let data = cfgTable.talkwordsData;
  9246. let length = Object.keys(data).length;
  9247. this.ui.wordsList.numItems = length;
  9248. }
  9249. initEmotionList() {
  9250. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  9251. let data = cfgTable.emotionData;
  9252. let length = Object.keys(data).length;
  9253. this.ui.emotionList.numItems = length;
  9254. }
  9255. renderTalkItem(index, obj) {
  9256. let temp = new WordsDisplay(index, obj);
  9257. }
  9258. renderEmotionItem(index, obj) {
  9259. let temp = new EmotionDisplay(index, obj);
  9260. }
  9261. openTalkList() {
  9262. this.ui.c1.selectedIndex = 0;
  9263. }
  9264. openEmotionList() {
  9265. this.ui.c1.selectedIndex = 1;
  9266. }
  9267. }
  9268. UIWordsList.uiName = "UIWordsList";
  9269. class TalkMgr {
  9270. constructor() {
  9271. this.aiSpeak = true;
  9272. this.emotionList = [];
  9273. this.talkList = [];
  9274. this.addEvent();
  9275. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9276. this.emotionList = [];
  9277. this.talkList = [];
  9278. for (let k in cfgTable.emotionData) {
  9279. this.emotionList.push(cfgTable.emotionData[k].id);
  9280. }
  9281. for (let k in cfgTable.talkwordsData) {
  9282. this.talkList.push(cfgTable.talkwordsData[k].id);
  9283. }
  9284. }
  9285. addEvent() {
  9286. let ui = xGame.common.gameUI.ui;
  9287. ui.wordsBtn.visible = true;
  9288. ui.wordsBtn.onClick(this, this.openTalkView);
  9289. ui.aiWordsBtn.visible = true;
  9290. ui.aiWordsBtn.onClick(this, this.clickAIState);
  9291. }
  9292. openTalkView() {
  9293. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9294. xGame.uiMgr.Show(UIWordsList);
  9295. }
  9296. closeTalkView() {
  9297. xGame.uiMgr.Hide(UIWordsList);
  9298. }
  9299. clickAIState() {
  9300. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9301. this.aiSpeak = !this.aiSpeak;
  9302. this.changeAIState(this.aiSpeak);
  9303. }
  9304. changeAIState(speak) {
  9305. this.aiSpeak = speak;
  9306. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  9307. if (speak) {
  9308. btn.c1.selectedIndex = 0;
  9309. }
  9310. else {
  9311. btn.c1.selectedIndex = 1;
  9312. }
  9313. }
  9314. showSelfTalk(wordsId) {
  9315. let ui = xGame.common.gameUI.ui;
  9316. ui.selfTalk.visible = true;
  9317. ui.selfTalk.myNode.c1.selectedIndex = 1;
  9318. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  9319. ui.selfTalk.t0.play();
  9320. }
  9321. showSelfEmotion(emotionId) {
  9322. let ui = xGame.common.gameUI.ui;
  9323. ui.selfTalk.visible = true;
  9324. ui.selfTalk.myNode.c1.selectedIndex = 0;
  9325. this.selfSpine && this.selfSpine.dispose();
  9326. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  9327. let spineData = cfgTable.emotionData[emotionId].spine;
  9328. this.selfSpine = new SpineMgr(spineData, () => {
  9329. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  9330. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  9331. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  9332. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  9333. });
  9334. ui.selfTalk.t0.play();
  9335. }
  9336. showAITalk(wordsId) {
  9337. if (!this.aiSpeak)
  9338. return;
  9339. if (DataMgr.gameData.gameCount < 2)
  9340. return;
  9341. if (wordsId < 1)
  9342. wordsId = this.getRandTalk();
  9343. let ui = xGame.common.gameUI.ui;
  9344. ui.aiTalk.visible = true;
  9345. ui.aiTalk.myNode.c1.selectedIndex = 1;
  9346. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  9347. ui.aiTalk.t0.play();
  9348. }
  9349. getRandTalk() {
  9350. let rand = xGame.tools.random(0, this.talkList.length);
  9351. return this.emotionList[rand];
  9352. }
  9353. getRandEmotion() {
  9354. let rand = xGame.tools.random(0, this.emotionList.length);
  9355. return this.emotionList[rand];
  9356. }
  9357. showAIEmotion(emotionId) {
  9358. if (!this.aiSpeak)
  9359. return;
  9360. if (DataMgr.gameData.gameCount < 2)
  9361. return;
  9362. if (emotionId < 1)
  9363. emotionId = this.getRandEmotion();
  9364. let ui = xGame.common.gameUI.ui;
  9365. ui.aiTalk.visible = true;
  9366. ui.aiTalk.myNode.c1.selectedIndex = 0;
  9367. this.aiSpine && this.aiSpine.dispose();
  9368. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  9369. let spineData = cfgTable.emotionData[emotionId].spine;
  9370. this.aiSpine = new SpineMgr(spineData, () => {
  9371. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  9372. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  9373. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  9374. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  9375. });
  9376. ui.aiTalk.t0.play();
  9377. }
  9378. resetGame() {
  9379. let ui = xGame.common.gameUI.ui;
  9380. ui.aiTalk.visible = false;
  9381. ui.selfTalk.visible = false;
  9382. this.aiSpine && this.aiSpine.dispose();
  9383. this.selfSpine && this.selfSpine.dispose();
  9384. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  9385. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  9386. this.closeTalkView();
  9387. }
  9388. }
  9389. class WordsMgr {
  9390. constructor() {
  9391. this.comboTimes = 1;
  9392. this.skillTimes = 0;
  9393. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  9394. this.comboSpine = new SpineMgr("yxz_liangan");
  9395. this.skillSpine = new SpineMgr("yiganxqiu");
  9396. this.scoreSpine = new SpineMgr("defen");
  9397. }
  9398. setClassicCombo(isInterrupt) {
  9399. if (isInterrupt) {
  9400. this.comboTimes = 0;
  9401. }
  9402. }
  9403. playClassicWords(type, callback) {
  9404. this.callback = callback;
  9405. let aniIndex = type;
  9406. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9407. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  9408. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  9409. mySpine.destroy(true);
  9410. this.playClassicTimes();
  9411. });
  9412. }
  9413. playClassicTimes() {
  9414. this.comboTimes++;
  9415. if (this.comboTimes <= 1) {
  9416. this.callback && this.callback();
  9417. }
  9418. else {
  9419. let aniIndex = this.comboTimes - 1;
  9420. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9421. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  9422. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  9423. mySpine.destroy(true);
  9424. this.callback && this.callback();
  9425. });
  9426. }
  9427. }
  9428. playBigSkillTimes(times, callback) {
  9429. if (times <= 0) {
  9430. callback && callback();
  9431. return;
  9432. }
  9433. this.callback = callback;
  9434. let pre = "sz_0";
  9435. let aniIndex = 0;
  9436. this.getWordsImg(times, pre, () => {
  9437. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9438. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  9439. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  9440. let r1 = ``;
  9441. let r2 = ``;
  9442. if (times <= 9) {
  9443. r1 = `res/d2Res/${pre}${times}.png`;
  9444. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9445. aniIndex = 0;
  9446. }
  9447. else {
  9448. r1 = `res/d2Res/${pre}${times % 10}.png`;
  9449. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  9450. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  9451. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  9452. aniIndex = 1;
  9453. }
  9454. this.skillSpine.play(data, aniIndex, false, parent, () => {
  9455. mySpine.destroy(true);
  9456. xGame.common.gameMgr.playSkillTips();
  9457. this.playScore(times);
  9458. xGame.common.playRandomMutiBallBigSkillSound();
  9459. }, mySpine);
  9460. });
  9461. }
  9462. playScore(score) {
  9463. let pre = "sz_";
  9464. let aniIndex = 0;
  9465. this.getWordsImg(score, pre, () => {
  9466. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9467. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  9468. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  9469. let r1 = ``;
  9470. let r2 = ``;
  9471. if (score <= 9) {
  9472. r1 = `res/d2Res/${pre}${score}.png`;
  9473. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9474. aniIndex = 0;
  9475. }
  9476. else {
  9477. r1 = `res/d2Res/${pre}${score % 10}.png`;
  9478. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  9479. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9480. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  9481. aniIndex = 1;
  9482. }
  9483. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  9484. mySpine.destroy(true);
  9485. this.callback && this.callback();
  9486. }, mySpine);
  9487. });
  9488. }
  9489. getWordsImg(number, pre = "", callback) {
  9490. let arr = [];
  9491. if (number <= 9) {
  9492. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  9493. }
  9494. else {
  9495. 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 });
  9496. }
  9497. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  9498. callback && callback();
  9499. }));
  9500. }
  9501. }
  9502. class ui_UIRodMethod extends fgui.GComponent {
  9503. static createInstance() {
  9504. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  9505. }
  9506. onConstruct() {
  9507. this.n24 = (this.getChild("n24"));
  9508. this.white = (this.getChild("white"));
  9509. this.dot = (this.getChild("dot"));
  9510. this.sureBtn = (this.getChild("sureBtn"));
  9511. this.n20 = (this.getChild("n20"));
  9512. this.n21 = (this.getChild("n21"));
  9513. this.n22 = (this.getChild("n22"));
  9514. this.n23 = (this.getChild("n23"));
  9515. this.n5 = (this.getChild("n5"));
  9516. this.n14 = (this.getChild("n14"));
  9517. this.t0 = this.getTransition("t0");
  9518. }
  9519. }
  9520. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  9521. class UIRodMethod extends UIBase {
  9522. constructor() {
  9523. super();
  9524. this.isPressd = false;
  9525. }
  9526. onConstructor() {
  9527. this.ui = ui_UIRodMethod.createInstance();
  9528. this.contentPane = this.ui;
  9529. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  9530. this.moveDir = new Laya.Vector2();
  9531. this.moveDest = new Laya.Vector2();
  9532. this.centerPos = new Laya.Vector2();
  9533. xGame.common.uiRodMethod = this;
  9534. }
  9535. show() {
  9536. super.show();
  9537. xGame.common.gameMgr.gamePause = true;
  9538. this.openPressDotEvent();
  9539. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  9540. this.centerPos.x = this.ui.white.x;
  9541. this.centerPos.y = this.ui.white.y;
  9542. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  9543. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  9544. this.setDot();
  9545. }
  9546. setDot() {
  9547. this.ui.dot.x = this.moveDest.x;
  9548. this.ui.dot.y = this.moveDest.y;
  9549. }
  9550. closeSelf() {
  9551. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  9552. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  9553. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  9554. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  9555. xGame.common.gameMgr.gamePause = false;
  9556. this.hide();
  9557. }
  9558. openPressDotEvent() {
  9559. this.closePressDotEvent();
  9560. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9561. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  9562. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9563. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9564. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9565. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9566. }
  9567. closePressDotEvent() {
  9568. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9569. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  9570. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9571. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9572. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9573. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9574. }
  9575. onDown(e) {
  9576. if (e.type == Laya.Event.MOUSE_DOWN)
  9577. this.isPressd = true;
  9578. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  9579. this.isPressd = false;
  9580. if (!this.isPressd)
  9581. return;
  9582. this.moveDest.x = e.stageX;
  9583. this.moveDest.y = e.stageY;
  9584. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  9585. if (dis > 6724) {
  9586. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  9587. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  9588. }
  9589. this.setDot();
  9590. }
  9591. resetRod() {
  9592. this.ui.dot.x = this.ui.white.x;
  9593. this.ui.dot.y = this.ui.white.y;
  9594. this.gameRod.dot.x = this.gameRod.bg.x;
  9595. this.gameRod.dot.y = this.gameRod.bg.y;
  9596. xGame.common.rodOffest.x = 0;
  9597. xGame.common.rodOffest.y = 0;
  9598. }
  9599. }
  9600. UIRodMethod.uiName = "UIRodMethod";
  9601. class UIGame extends UIBase {
  9602. constructor() {
  9603. super();
  9604. this.powerNum = 0;
  9605. this.isD3Inited = false;
  9606. this.isPrePlay = false;
  9607. this.isMoveRod = false;
  9608. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  9609. this.rulerDis = 20;
  9610. this.rulerOffset = 0;
  9611. }
  9612. onConstructor() {
  9613. this.ui = ui_UIGame.createInstance();
  9614. this.contentPane = this.ui;
  9615. this.ui.x += xGame.common.sysOffestNum;
  9616. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  9617. this.isEject = false;
  9618. xGame.common.gameUI = this;
  9619. this.initSelf();
  9620. }
  9621. isTurnSelf() {
  9622. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  9623. return true;
  9624. }
  9625. }
  9626. initSelf() {
  9627. let topUI = this.ui.topNode;
  9628. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  9629. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  9630. this.barInfo = {};
  9631. this.barInfo.curY = 0;
  9632. this.barInfo.height = this.ui.powerNode.height;
  9633. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  9634. this.barInfo.powerStartY = this.ui.powerNode.y;
  9635. xGame.common.aiPlayer = new AIPlayer();
  9636. xGame.common.gameMgr = new GameMgr();
  9637. xGame.common.skillMgr = new SkillMgr();
  9638. xGame.common.wordsMgr = new WordsMgr();
  9639. xGame.common.talkMgr = new TalkMgr();
  9640. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  9641. console.log("加载经典模式表情文件chenggon !");
  9642. });
  9643. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  9644. console.log("挑战模式奖励模式spine加载成功!");
  9645. });
  9646. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  9647. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9648. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  9649. this.addUIClick(this.ui.returnBtn, this.returnHome);
  9650. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  9651. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  9652. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  9653. }
  9654. getGanZiImg() {
  9655. let index = DataMgr.getCurBallRod();
  9656. let data = cfgTable.ballrodData[index + 1];
  9657. let gan_url = xGame.common.getGameIconUrl(data.img);
  9658. console.log('zh:getGanZiImg gan_url==' + gan_url);
  9659. this.ui.powerNode.showImg.url = gan_url;
  9660. console.log('zh:修改杆子图标O K');
  9661. }
  9662. returnHome() {
  9663. let tips = "Are you sure to exit the game?";
  9664. let woman = "Boss, why don't you play for a while longer?";
  9665. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  9666. }
  9667. addRodMethodClick() {
  9668. if (this.isTurnSelf()) {
  9669. xGame.uiMgr.Show(UIRodMethod);
  9670. }
  9671. }
  9672. clickHelpLineBtn(force = false) {
  9673. if (!this.isTurnSelf())
  9674. return;
  9675. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  9676. if (success) {
  9677. xGame.common.longHelpLine = true;
  9678. xGame.common.d2World.getHelpLine();
  9679. Moyu.sendDataEvent("guideNum");
  9680. }
  9681. else {
  9682. }
  9683. });
  9684. }
  9685. renderSelfDisplayBalls(index, target) {
  9686. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  9687. target.myImg.url = xGame.common.getGameIconUrl(str);
  9688. }
  9689. renderAIDisplayBalls(index, target) {
  9690. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  9691. target.myImg.url = xGame.common.getGameIconUrl(str);
  9692. ;
  9693. }
  9694. updateMode() {
  9695. if (xGame.common.gameMode == GameMode.classic) {
  9696. this.ui.topNode.scoreNode.visible = false;
  9697. }
  9698. else if (xGame.common.gameMode == GameMode.bigMove) {
  9699. this.ui.topNode.scoreNode.visible = true;
  9700. }
  9701. }
  9702. show() {
  9703. super.show();
  9704. console.log("zh:uigame show");
  9705. this.ui.alpha = 0;
  9706. this.updateSelf();
  9707. console.log("zh:uigame bf gamemusic01 start");
  9708. xGame.soundMgr.playMusic("gamemusic01");
  9709. console.log("zh:uigame bf gamemusic01 end");
  9710. xGame.common.gameMgr.gamePause = false;
  9711. xGame.common.gameUI.ui.blackAni.visible = false;
  9712. xGame.common.gameUI.ui.whiteAni.visible = false;
  9713. this.ui.powerEft.visible = false;
  9714. this.ui.colorNode.visible = false;
  9715. this.updateHead();
  9716. let curUse = DataMgr.getCurBallRod();
  9717. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  9718. this.getGanZiImg();
  9719. }
  9720. updateSelf() {
  9721. if (xGame.common.gameMode == GameMode.classic) {
  9722. this.ui.c1.selectedIndex = 0;
  9723. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  9724. this.ui.topNode.middleNode.visible = true;
  9725. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  9726. }
  9727. else if (xGame.common.gameMode == GameMode.bigMove) {
  9728. this.ui.c1.selectedIndex = 0;
  9729. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  9730. this.ui.topNode.middleNode.visible = false;
  9731. let max = xGame.cfgMgr.getMaxBigMoveLength();
  9732. let rand = xGame.common.randomNum(1, max);
  9733. let guide = DataMgr.getSkillGuide();
  9734. if (guide == 0)
  9735. rand = 1;
  9736. xGame.common.bigMoveLevelIndex = rand;
  9737. }
  9738. else if (xGame.common.gameMode == GameMode.placeBall) {
  9739. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  9740. this.ui.c1.selectedIndex = 1 + data.type;
  9741. this.ui.alpha = 1;
  9742. this.startGame();
  9743. }
  9744. this.updateMode();
  9745. this.initD3world();
  9746. this.initD2world();
  9747. }
  9748. startGame() {
  9749. this.ui.snowNode.visible = Math.random() <= 0.1;
  9750. this.ui.d2Node.visible = false;
  9751. xGame.common.d3World.d3Hand.gameObj.active = false;
  9752. xGame.common.d3World.tableSrc.init();
  9753. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  9754. this.cameraViewChange(() => {
  9755. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  9756. switch (xGame.common.gameMode) {
  9757. case GameMode.classic:
  9758. xGame.common.d3World.d3Hand.gameObj.active = true;
  9759. this.playPutBallD3Ani();
  9760. break;
  9761. case GameMode.bigMove:
  9762. this.enterGame();
  9763. Laya.timer.once(500, this, () => {
  9764. this.ui.topNode.middleNode.visible = true;
  9765. this.ui.topNode.middleNode.t0.play();
  9766. });
  9767. break;
  9768. case GameMode.placeBall:
  9769. this.enterGame();
  9770. break;
  9771. default:
  9772. break;
  9773. }
  9774. });
  9775. PlatMgr.showBanner(false);
  9776. }
  9777. enterGame() {
  9778. this.ui.d2Node.visible = true;
  9779. xGame.common.d3World.d3Hand.gameObj.active = false;
  9780. xGame.common.showOneCamera("mainCamera");
  9781. Moyu.recordGame(30, true);
  9782. if (!this.isPrePlay) {
  9783. this.isPrePlay = true;
  9784. xGame.common.d3World.prePlayEft();
  9785. }
  9786. xGame.common.gameMgr.gameReady();
  9787. this.openAllEvent();
  9788. this.ui.snowNode.visible = false;
  9789. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  9790. this.ui.helpBtn.visible = condition;
  9791. }
  9792. showHelpLineGuide() {
  9793. let longGuide = DataMgr.getGuideHelpLine();
  9794. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  9795. this.ui.helpBtn.visible = true;
  9796. this.ui.guideNode.visible = true;
  9797. }
  9798. }
  9799. setTurnAlpha(alpha) {
  9800. this.ui.keduNode.alpha = alpha;
  9801. this.ui.ganNode.alpha = alpha;
  9802. this.ui.rodMethodNode.alpha = alpha;
  9803. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  9804. }
  9805. cameraViewChange(callback) {
  9806. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  9807. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  9808. xGame.common.showOneCamera("visitAngle");
  9809. cameraSrc.localRotationEulerY = 180;
  9810. cameraSrc.localRotationEulerZ = 0;
  9811. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  9812. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  9813. callback && callback();
  9814. }));
  9815. }));
  9816. }
  9817. playPutBallD3Ani() {
  9818. xGame.common.showOneCamera("mainCamera");
  9819. let handSrc = xGame.common.d3World.d3Hand;
  9820. handSrc.gameObj.active = true;
  9821. handSrc.transform.localPositionZ = 3;
  9822. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9823. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  9824. handSrc.gameObj.active = false;
  9825. this.enterGame();
  9826. }), 400);
  9827. }));
  9828. }
  9829. updateHead() {
  9830. let user = Moyu.getUserInfo();
  9831. this.ui.topNode.selfNameTxt.text = user.nickName;
  9832. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  9833. let aiData = xGame.cfgMgr.getRandomUserInfo();
  9834. if (DataMgr.getSkillGuide() < 1) {
  9835. this.ui.topNode.aiNameTxt.text = 'billiards';
  9836. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  9837. }
  9838. else {
  9839. this.ui.topNode.aiNameTxt.text = aiData.name;
  9840. let randNo = Math.floor(Math.random() * 10) + 1;
  9841. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  9842. }
  9843. }
  9844. initD2world() {
  9845. let node = this.ui.d2Root.displayObject;
  9846. let src = node.getComponent(D2World);
  9847. if (!src) {
  9848. xGame.common.d2World = node.addComponent(D2World);
  9849. }
  9850. xGame.common.d2World.initSelf();
  9851. }
  9852. initD3world() {
  9853. if (this.isD3Inited)
  9854. return;
  9855. this.isD3Inited = true;
  9856. let scene3D = xGame.common.d3Scene;
  9857. this.ui.d3Root.displayObject.addChild(scene3D);
  9858. scene3D.active = true;
  9859. xGame.common.d3World.tableSrc.setBorderPos();
  9860. }
  9861. onRootMove(e) {
  9862. let rootBall = xGame.common.d2World.rootBall;
  9863. this.ui.moveNode.x = e.x;
  9864. this.ui.moveNode.y = e.y;
  9865. rootBall.gameObj.x = e.x;
  9866. rootBall.gameObj.y = e.y;
  9867. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  9868. }
  9869. aiRootMove(move) {
  9870. if (move)
  9871. this.hideBallUI();
  9872. else {
  9873. this.showBallUI();
  9874. xGame.common.d2World.getHelpLine();
  9875. }
  9876. }
  9877. aiForce(type, force = 0) {
  9878. this.pressTarget = PressType.powerNode;
  9879. if (type == 1)
  9880. this.onEventUp({ force: true });
  9881. else if (type == 2)
  9882. this.onEventMove({ stageY: force, force: true });
  9883. }
  9884. onEventPress(e) {
  9885. if (e.stopPropagation)
  9886. e.stopPropagation();
  9887. if (!this.isTurnSelf())
  9888. return;
  9889. let target = e.target;
  9890. switch (target) {
  9891. case this.ui.myPowerNode.displayObject:
  9892. this.pressTarget = PressType.powerNode;
  9893. this.barInfo.curY = e.stageY;
  9894. this.updateBarInfo();
  9895. break;
  9896. case this.ui.moveNode.displayObject:
  9897. this.pressTarget = PressType.moveNode;
  9898. this.hideBallUI();
  9899. this.eventObj.curX = this.ui.moveNode.x;
  9900. this.eventObj.curY = this.ui.moveNode.y;
  9901. this.ui.moveNode.finger.visible = false;
  9902. this.eventObj.lastX = e.stageX;
  9903. this.eventObj.lastY = e.stageY;
  9904. break;
  9905. case this.ui.rulerClickNode.displayObject:
  9906. this.pressTarget = PressType.rulerNode;
  9907. this.eventObj.lastY = e.stageY;
  9908. break;
  9909. case this.ui.d2Root.displayObject:
  9910. this.pressTarget = PressType.d2Root;
  9911. this.eventObj.lastX = e.stageX;
  9912. this.eventObj.lastY = e.stageY;
  9913. this.eventObj.starX = e.stageX;
  9914. this.eventObj.starY = e.stageY;
  9915. this.eventObj.curX = 0;
  9916. this.eventObj.curY = 0;
  9917. xGame.common.d2World.d2Gan.setGanLastInfo();
  9918. this.rulerOffset = 0;
  9919. break;
  9920. default:
  9921. break;
  9922. }
  9923. }
  9924. onEventMove(e) {
  9925. if (e.stopPropagation)
  9926. e.stopPropagation();
  9927. if (e && e.force) {
  9928. }
  9929. else {
  9930. if (!this.isTurnSelf())
  9931. return;
  9932. }
  9933. switch (this.pressTarget) {
  9934. case PressType.powerNode:
  9935. this.barInfo.curY = e.stageY;
  9936. this.updateBarInfo();
  9937. this.isMoveRod = true;
  9938. break;
  9939. case PressType.moveNode:
  9940. let rootBall = xGame.common.d2World.rootBall;
  9941. let radius = rootBall.gameObj.width / 2;
  9942. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  9943. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  9944. let border = xGame.common.d2World.borderRect;
  9945. if (curX <= border.x + radius)
  9946. curX = border.x + radius;
  9947. else if (curX >= border.x + border.width - radius)
  9948. curX = border.x + border.width - radius;
  9949. if (curY <= border.y + radius)
  9950. curY = border.y + radius;
  9951. else if (curY >= border.y + border.height - radius)
  9952. curY = border.y + border.height - radius;
  9953. if (xGame.common.gameMgr.isOpenBall) {
  9954. if (curX >= border.x + border.openBallW - radius)
  9955. curX = border.x + border.openBallW - radius;
  9956. }
  9957. this.ui.moveNode.x = curX;
  9958. this.ui.moveNode.y = curY;
  9959. rootBall.gameObj.x = curX;
  9960. rootBall.gameObj.y = curY;
  9961. rootBall.d3BallSrc.setTransPos(curX, curY);
  9962. this.isMoveRod = true;
  9963. break;
  9964. case PressType.rulerNode:
  9965. let yy = e.stageY - this.eventObj.lastY;
  9966. this.eventObj.lastY = e.stageY;
  9967. let ruler1 = this.ui.rulerNode.img1;
  9968. let ruler2 = this.ui.rulerNode.img2;
  9969. ruler1.y += yy;
  9970. ruler2.y += yy;
  9971. this.rulerOffset += yy;
  9972. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  9973. this.rulerOffset = 0;
  9974. xGame.soundMgr.playSound("inch", 1, 10);
  9975. }
  9976. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  9977. let h = ruler1.height;
  9978. this.checkGuide();
  9979. this.isMoveRod = true;
  9980. if (ruler1.y >= h) {
  9981. ruler1.y = -h;
  9982. ruler2.y = 0;
  9983. return;
  9984. }
  9985. else if (ruler1.y <= -h) {
  9986. ruler1.y = h;
  9987. ruler2.y = 0;
  9988. return;
  9989. }
  9990. if (ruler2.y >= h) {
  9991. ruler2.y = -h;
  9992. ruler1.y = 0;
  9993. return;
  9994. }
  9995. else if (ruler2.y <= -h) {
  9996. ruler2.y = h;
  9997. ruler1.y = 0;
  9998. return;
  9999. }
  10000. break;
  10001. case PressType.d2Root:
  10002. this.eventObj.curX = e.stageX;
  10003. this.eventObj.curY = e.stageY;
  10004. let offset = this.checkRodMoveDir();
  10005. xGame.common.d2World.d2Gan.rotateSelf(offset);
  10006. this.eventObj.lastX = e.stageX;
  10007. this.eventObj.lastY = e.stageY;
  10008. break;
  10009. default:
  10010. break;
  10011. }
  10012. }
  10013. onEventUp(e) {
  10014. if (e.stopPropagation)
  10015. e.stopPropagation();
  10016. if (e && e.force) {
  10017. }
  10018. else {
  10019. if (!this.isTurnSelf())
  10020. return;
  10021. }
  10022. switch (this.pressTarget) {
  10023. case PressType.powerNode:
  10024. this.ui.powerNode.value = 0;
  10025. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  10026. this.ui.powerTxt.text = "";
  10027. if (this.powerNum > 0) {
  10028. xGame.eventMgr.event(BALL_SHOOT);
  10029. xGame.common.d2World.shoot(this.powerNum);
  10030. xGame.common.d2World.d2Gan.shoot();
  10031. xGame.common.d2World.d2HelpLine.shoot();
  10032. this.finishGuide();
  10033. this.ui.powerEft.visible = false;
  10034. this.ui.colorNode.visible = false;
  10035. let ganStr = "";
  10036. if (this.powerNum <= 30) {
  10037. ganStr = "gan_30";
  10038. }
  10039. else if (this.powerNum <= 60) {
  10040. ganStr = "gan_50";
  10041. }
  10042. else {
  10043. ganStr = "gan_80";
  10044. }
  10045. xGame.soundMgr.playSound(ganStr);
  10046. }
  10047. break;
  10048. case PressType.moveNode:
  10049. let rootBall = xGame.common.d2World.rootBall;
  10050. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  10051. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  10052. let isIntersect = this.judgeBallIntersect();
  10053. if (isIntersect) {
  10054. this.ui.moveNode.x = lastX;
  10055. this.ui.moveNode.y = lastY;
  10056. rootBall.gameObj.x = lastX;
  10057. rootBall.gameObj.y = lastY;
  10058. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  10059. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  10060. }
  10061. else {
  10062. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  10063. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  10064. }
  10065. this.showBallUI();
  10066. this.ui.moveNode.finger.visible = true;
  10067. xGame.common.d2World.getHelpLine();
  10068. break;
  10069. case PressType.rulerNode:
  10070. break;
  10071. case PressType.d2Root:
  10072. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  10073. if (dis <= 25) {
  10074. this.moveToClickDot(e);
  10075. }
  10076. break;
  10077. default:
  10078. break;
  10079. }
  10080. this.pressTarget = -1;
  10081. }
  10082. checkGuide() {
  10083. let guide = DataMgr.getSkillGuide();
  10084. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  10085. xGame.common.guideStep++;
  10086. xGame.common.gameUI.ui.guide2.visible = false;
  10087. xGame.common.gameUI.ui.guide3.visible = true;
  10088. }
  10089. }
  10090. finishGuide() {
  10091. let guide = DataMgr.getSkillGuide();
  10092. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  10093. xGame.common.guideStep = 10;
  10094. this.closeAllGuide();
  10095. }
  10096. }
  10097. closeAllGuide() {
  10098. xGame.common.gameUI.ui.guide1.visible = false;
  10099. xGame.common.gameUI.ui.guide2.visible = false;
  10100. xGame.common.gameUI.ui.guide3.visible = false;
  10101. }
  10102. updateBarInfo() {
  10103. let star = this.ui.powerNode.y;
  10104. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  10105. if (rate >= 1)
  10106. rate = 1;
  10107. if (rate <= 0)
  10108. rate = 0;
  10109. this.powerNum = Math.ceil(rate * 100);
  10110. this.ui.powerNode.value = this.powerNum;
  10111. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  10112. this.ui.colorNode.value = this.powerNum;
  10113. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  10114. this.ui.powerEft.visible = this.powerNum != 0;
  10115. this.ui.colorNode.visible = this.powerNum != 0;
  10116. this.ui.powerTxt.text = this.powerNum + "";
  10117. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  10118. }
  10119. forceCancel() {
  10120. this.ui.powerNode.value = 0;
  10121. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  10122. this.ui.powerTxt.text = "";
  10123. }
  10124. checkRodMoveDir() {
  10125. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  10126. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  10127. if (tempX >= 0 && tempY <= 0) {
  10128. return this.checkDir();
  10129. }
  10130. else if (tempX < 0 && tempY < 0) {
  10131. return this.checkDir(1, -1);
  10132. }
  10133. else if (tempX < 0 && tempY > 0) {
  10134. return this.checkDir(-1, -1);
  10135. }
  10136. else {
  10137. return this.checkDir(-1, 1);
  10138. }
  10139. }
  10140. checkDir(flagX = 1, flagY = 1) {
  10141. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  10142. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  10143. if (offsetY == 0) {
  10144. return offsetX * flagX;
  10145. }
  10146. if (offsetX == 0) {
  10147. return offsetY * flagY;
  10148. }
  10149. let angle = offsetY / offsetX;
  10150. if (Math.abs(angle) >= 1) {
  10151. return offsetY * flagY;
  10152. }
  10153. else {
  10154. return offsetX * flagX;
  10155. }
  10156. }
  10157. judgeBallIntersect() {
  10158. let rootBall = xGame.common.d2World.rootBall;
  10159. let ballArr = xGame.common.d2World.ballArr;
  10160. let radius = rootBall.gameObj.width / 2;
  10161. let temp;
  10162. let isIntersect = false;
  10163. for (let index = 0; index < ballArr.length; index++) {
  10164. temp = ballArr[index];
  10165. if (temp.number == rootBall.number)
  10166. continue;
  10167. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  10168. if (isIntersect) {
  10169. break;
  10170. }
  10171. }
  10172. return isIntersect;
  10173. }
  10174. hideBallUI() {
  10175. let d2Gan = xGame.common.d2World.d2Gan;
  10176. if (!d2Gan.ui.isDisposed)
  10177. d2Gan.ui.visible = false;
  10178. let d2Help = xGame.common.d2World.d2HelpLine;
  10179. if (!d2Help.ui.isDisposed)
  10180. d2Help.ui.visible = false;
  10181. let rootBall = xGame.common.d2World.rootBall;
  10182. if (!rootBall.destroyed) {
  10183. rootBall.gameObj.active = false;
  10184. }
  10185. }
  10186. showBallUI() {
  10187. let d2Gan = xGame.common.d2World.d2Gan;
  10188. if (!d2Gan.ui.isDisposed)
  10189. d2Gan.ui.visible = true;
  10190. let d2Help = xGame.common.d2World.d2HelpLine;
  10191. if (!d2Help.ui.isDisposed)
  10192. d2Help.ui.visible = true;
  10193. let rootBall = xGame.common.d2World.rootBall;
  10194. if (!rootBall.destroyed) {
  10195. rootBall.gameObj.active = true;
  10196. }
  10197. }
  10198. moveToClickDot(e) {
  10199. if (!this.isMoveRod && !xGame.common.clickedBall) {
  10200. let root = xGame.common.d2World.rootBall.gameObj;
  10201. let xx = e.stageX - xGame.common.sysOffestNum;
  10202. let yy = e.stageY;
  10203. let x = xx - root.x;
  10204. let y = yy - root.y;
  10205. let angle = xGame.common.getfguiRotation(x, y);
  10206. xGame.common.d2World.d2Gan.ui.rotation = angle;
  10207. xGame.common.d2World.getHelpLine();
  10208. }
  10209. this.isMoveRod = false;
  10210. xGame.common.clickedBall = false;
  10211. }
  10212. openAllEvent() {
  10213. this.closeAllEvent();
  10214. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10215. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10216. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10217. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10218. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  10219. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  10220. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  10221. }
  10222. closeAllEvent() {
  10223. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10224. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10225. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10226. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10227. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  10228. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  10229. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  10230. }
  10231. resetGame() {
  10232. this.closeAllEvent();
  10233. this.hideBallUI();
  10234. xGame.common.gameMgr.gamePause = true;
  10235. }
  10236. }
  10237. UIGame.uiName = "UIGame";
  10238. class UIAddProp extends UIBase {
  10239. constructor() {
  10240. super();
  10241. this.curType = "";
  10242. }
  10243. onConstructor() {
  10244. this.ui = ui_UIAddProp.createInstance();
  10245. this.contentPane = this.ui;
  10246. this.isEject = false;
  10247. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  10248. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  10249. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  10250. this.updateUI();
  10251. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  10252. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  10253. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  10254. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  10255. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  10256. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  10257. }
  10258. show(type) {
  10259. super.show();
  10260. this.curType = type == 0 ? "coin" : "diamond";
  10261. this.switchBtn("");
  10262. this.ui.t0.play();
  10263. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  10264. PlatMgr.showInsert(true);
  10265. }
  10266. closeSelf() {
  10267. this.hide();
  10268. }
  10269. updateUI() {
  10270. let data = cfgTable.moneyData;
  10271. let temp;
  10272. let obj;
  10273. for (const key in data) {
  10274. temp = data[key];
  10275. obj = this.ui.myNode["node" + key];
  10276. if (parseInt(key) <= 2) {
  10277. obj.diamondTxt.text = "+" + temp.num;
  10278. }
  10279. else {
  10280. obj.coinTxt.text = temp.num;
  10281. obj.diamondTxt.text = temp.get.split('_')[1];
  10282. }
  10283. }
  10284. this.updateDiamondShare();
  10285. }
  10286. updateDiamondShare() {
  10287. let data = DataMgr.getShareDiamondTimes();
  10288. if (data >= xGame.common.maxShareDiamondTimes) {
  10289. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  10290. this.ui.myNode.node1.touchable = false;
  10291. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  10292. }
  10293. else {
  10294. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  10295. this.ui.myNode.node1.touchable = true;
  10296. }
  10297. }
  10298. switchBtn(type) {
  10299. if (type == "")
  10300. type = this.curType;
  10301. else {
  10302. if (this.curType == type) {
  10303. return;
  10304. }
  10305. else {
  10306. this.curType = type;
  10307. }
  10308. }
  10309. if (type == "coin") {
  10310. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  10311. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  10312. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  10313. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  10314. this.ui.myNode.c1.selectedIndex = 0;
  10315. }
  10316. else {
  10317. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  10318. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  10319. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  10320. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  10321. this.ui.myNode.c1.selectedIndex = 1;
  10322. }
  10323. }
  10324. convertCoin(index) {
  10325. let data = cfgTable.moneyData[index];
  10326. let coinNum = data.num;
  10327. let str = data.get.split('_')[1];
  10328. let needDiamond = parseInt(str);
  10329. if (DataMgr.diamondEnough(needDiamond)) {
  10330. DataMgr.setDiamond(-needDiamond);
  10331. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  10332. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  10333. }
  10334. else {
  10335. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  10336. this.switchBtn("diamond");
  10337. }
  10338. }
  10339. videoGetDiamond() {
  10340. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  10341. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  10342. }
  10343. else {
  10344. console.log('zh:AD 失败,直接发放奖励');
  10345. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  10346. }
  10347. }
  10348. qjff_AD_for_uiAddProp_videoGetDiamond() {
  10349. let num = cfgTable.moneyData[2].num;
  10350. xGame.common.playObjFlyAnim(num, Prop.diamond);
  10351. this.closeSelf();
  10352. }
  10353. videoGetCoin() {
  10354. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  10355. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  10356. }
  10357. else {
  10358. console.log('zh:AD 失败,直接发放奖励');
  10359. this.qjff_AD_for_uiAddProp_videoGetCoin();
  10360. }
  10361. }
  10362. qjff_AD_for_uiAddProp_videoGetCoin() {
  10363. xGame.common.playObjFlyAnim(2000, Prop.coin);
  10364. this.closeSelf();
  10365. }
  10366. shareGetDiamond() {
  10367. let times = DataMgr.getShareDiamondTimes();
  10368. if (times >= xGame.common.maxShareDiamondTimes) {
  10369. console.log('zh: 233333333333 maxShareDiamondTimes');
  10370. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  10371. }
  10372. else {
  10373. console.log('zh:33333333333333ad');
  10374. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  10375. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  10376. }
  10377. else {
  10378. console.log('zh:AD 失败,直接发放奖励');
  10379. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  10380. }
  10381. }
  10382. }
  10383. qjff_AD_for_uiAddProp_shareGetDiamond() {
  10384. let diamond = xGame.common.randomNum(50, 100);
  10385. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  10386. DataMgr.setShareDiamondTimes(1);
  10387. this.updateDiamondShare();
  10388. }
  10389. openPutBallView() {
  10390. let end = xGame.uiMgr.getUI(UIGameEnd);
  10391. let skill = xGame.uiMgr.getUI(UISkill);
  10392. let level = xGame.uiMgr.getUI(UILevelDisplay);
  10393. let uigame = xGame.uiMgr.getUI(UIGame);
  10394. if (end && !end.isHide) {
  10395. xGame.uiMgr.Hide(UIGameEnd);
  10396. xGame.uiMgr.Show(UIMain);
  10397. }
  10398. if (skill && !skill.isHide)
  10399. xGame.uiMgr.Hide(UISkill);
  10400. if (uigame && !uigame.isHide)
  10401. xGame.uiMgr.Hide(UIGame);
  10402. if (level && !level.isHide) {
  10403. }
  10404. else {
  10405. xGame.uiMgr.Show(UILevelDisplay);
  10406. }
  10407. this.closeSelf();
  10408. }
  10409. }
  10410. UIAddProp.uiName = "UIAddProp";
  10411. class MoneyNode {
  10412. constructor(ui) {
  10413. this.leftTime = 0;
  10414. this.ui = ui;
  10415. this.ui.addCoinBtn.onClick(this, this.addCoin);
  10416. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  10417. this.ui.addPowerBtn.onClick(this, this.addPower);
  10418. this.ui.c1.selectedIndex = 1;
  10419. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  10420. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  10421. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  10422. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  10423. this.coinChange();
  10424. this.diamondChange();
  10425. this.powerChange();
  10426. }
  10427. addPower() {
  10428. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10429. xGame.uiMgr.Show(UIPower);
  10430. }
  10431. powerChange() {
  10432. let powerNum = DataMgr.getPower();
  10433. this.ui.powerTxt.text = powerNum + "";
  10434. }
  10435. checkPowerTime() {
  10436. let cur = new Date().getTime();
  10437. let last = DataMgr.getPowerTime();
  10438. if (last == 0) {
  10439. last = cur;
  10440. DataMgr.setPowerTime(cur);
  10441. }
  10442. let power = DataMgr.getPower();
  10443. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  10444. Laya.timer.clearAll(this);
  10445. if (power >= xGame.common.natureMaxPower) {
  10446. this.ui.powerTimeTxt.text = "";
  10447. DataMgr.setPowerTime(cur);
  10448. return;
  10449. }
  10450. if (power + offset >= xGame.common.natureMaxPower) {
  10451. DataMgr.setPower(xGame.common.natureMaxPower, false);
  10452. this.ui.powerTimeTxt.text = "";
  10453. DataMgr.setPowerTime(cur);
  10454. }
  10455. else {
  10456. if (offset > 0) {
  10457. DataMgr.setPower(offset);
  10458. DataMgr.setPowerTime(cur);
  10459. }
  10460. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  10461. this.leftTime = xGame.common.powerRecoverNum - time;
  10462. if (this.leftTime <= 0)
  10463. this.leftTime = 0;
  10464. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10465. Laya.timer.loop(1000, this, this.updatePowerTime);
  10466. }
  10467. }
  10468. updatePowerTime() {
  10469. this.leftTime -= 1;
  10470. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10471. if (this.leftTime <= 0) {
  10472. this.checkPowerTime();
  10473. }
  10474. }
  10475. coinChange() {
  10476. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  10477. }
  10478. diamondChange() {
  10479. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  10480. }
  10481. addCoin() {
  10482. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10483. Moyu.sendDataEvent("AddCoinBtn");
  10484. xGame.uiMgr.Show(UIAddProp, 0);
  10485. }
  10486. addDiamond() {
  10487. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10488. Moyu.sendDataEvent("AddDiamondBtn");
  10489. xGame.uiMgr.Show(UIAddProp, 1);
  10490. }
  10491. }
  10492. class UIDraw extends UIBase {
  10493. constructor() {
  10494. super();
  10495. this.curKey = 0;
  10496. }
  10497. onConstructor() {
  10498. this.ui = ui_UIDraw.createInstance();
  10499. this.contentPane = this.ui;
  10500. this.isEject = false;
  10501. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  10502. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  10503. this.addUIClick(this.ui.drawBtn, this.startDraw);
  10504. this.initDraw();
  10505. this.initUI();
  10506. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  10507. if (Moyu.isKs)
  10508. this.ui.closeNode.closeBtn.x += 100;
  10509. }
  10510. show() {
  10511. super.show();
  10512. this.ui.t0.play();
  10513. this.playSecretaryIdle();
  10514. this.updateDraw();
  10515. this.checkFree();
  10516. if (PlatMgr.bannerDelay > 0) {
  10517. this.ui.closeNode.closeBtn.visible = false;
  10518. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  10519. this.ui.closeNode.closeBtn.visible = true;
  10520. });
  10521. }
  10522. PlatMgr.showRateBanner();
  10523. }
  10524. hide() {
  10525. Laya.timer.clearAll(this);
  10526. super.hide();
  10527. }
  10528. checkFree() {
  10529. let isFree = DataMgr.getDailyfreeDrawTimes();
  10530. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  10531. }
  10532. initDraw() {
  10533. this.drawObj = [];
  10534. let data = cfgTable.drawData;
  10535. let temp;
  10536. let weight = 0;
  10537. for (const key in data) {
  10538. temp = data[key];
  10539. weight += temp.weight;
  10540. this.drawObj.push(weight);
  10541. }
  10542. this.allWeight = weight;
  10543. }
  10544. initUI() {
  10545. let data = cfgTable.drawData;
  10546. let temp;
  10547. let img;
  10548. let txt;
  10549. for (const key in data) {
  10550. temp = data[key];
  10551. img = this.ui.myNode.rotNode["img" + key];
  10552. txt = this.ui.myNode.rotNode["txt" + key];
  10553. img.url = xGame.common.getGameIconUrl(temp.icon);
  10554. txt.visible = true;
  10555. if (temp.award > 2) {
  10556. img.rotation = 0;
  10557. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  10558. }
  10559. else {
  10560. img.rotation = temp.rotation;
  10561. txt.text = temp.num;
  10562. }
  10563. }
  10564. }
  10565. getCurkey() {
  10566. let rand = Math.random() * this.allWeight;
  10567. let temp;
  10568. for (let index = 0; index < this.drawObj.length - 1; index++) {
  10569. temp = this.drawObj[index];
  10570. if (index == 0) {
  10571. if (rand < temp) {
  10572. return index + 1;
  10573. }
  10574. }
  10575. else {
  10576. if (rand >= temp && rand < this.drawObj[index + 1]) {
  10577. return index + 1;
  10578. }
  10579. }
  10580. }
  10581. return 2;
  10582. }
  10583. startDraw() {
  10584. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  10585. if (freeTimes > 0) {
  10586. this.beginDraw();
  10587. DataMgr.setDailyfreeDrawTimes(0);
  10588. this.checkFree();
  10589. }
  10590. else {
  10591. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  10592. }
  10593. else {
  10594. console.log('zh:AD 失败,直接发放奖励');
  10595. this.qjff_chouJiang();
  10596. }
  10597. }
  10598. }
  10599. qjff_chouJiang() {
  10600. this.beginDraw();
  10601. }
  10602. beginDraw() {
  10603. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  10604. this.ui.drawBtn.touchable = false;
  10605. this.curKey = this.getCurkey();
  10606. console.log("当前key", this.curKey);
  10607. let cell = 60;
  10608. let lap = 3;
  10609. let angle = cell * (this.curKey - 1) + lap * 360;
  10610. let target = this.ui.myNode.rotNode;
  10611. target.rotation = 0;
  10612. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  10613. console.log("旋转完成");
  10614. this.ui.drawBtn.touchable = true;
  10615. this.getAward();
  10616. }));
  10617. }
  10618. getAward() {
  10619. let data = cfgTable.drawData[this.curKey];
  10620. let temp = new AwardType();
  10621. temp.type = data.award;
  10622. temp.num = data.num;
  10623. xGame.common.getAward([temp], () => {
  10624. DataMgr.setDrawTimes(1);
  10625. this.updateDraw();
  10626. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  10627. });
  10628. }
  10629. updateDraw() {
  10630. let drawTimes = DataMgr.getDrawTimes();
  10631. let awardTimes = DataMgr.getDrawAwardTimes();
  10632. if (Math.floor(drawTimes / 3) > awardTimes) {
  10633. this.ui.extraNode.boxBtn.t0.play(null, -1);
  10634. this.ui.extraNode.boxBtn.touchable = true;
  10635. this.ui.extraNode.tipsTxt.text = "3/3";
  10636. this.ui.extraNode.barNode.width = 265;
  10637. this.getExtraAward();
  10638. }
  10639. else {
  10640. this.ui.extraNode.boxBtn.t0.stop();
  10641. this.ui.extraNode.boxBtn.touchable = false;
  10642. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  10643. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  10644. }
  10645. let data = cfgTable.drawData[1];
  10646. if (awardTimes == 0) {
  10647. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  10648. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  10649. this.ui.myNode.rotNode.img1.rotation = 0;
  10650. }
  10651. else {
  10652. let award = data.nextid;
  10653. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  10654. this.ui.myNode.rotNode.txt1.text = award[1];
  10655. this.ui.myNode.rotNode.img1.rotation = 0;
  10656. }
  10657. }
  10658. getExtraAward() {
  10659. let drawTimes = DataMgr.getDrawTimes();
  10660. let awardTimes = DataMgr.getDrawAwardTimes();
  10661. let data = cfgTable.drawData[1];
  10662. let award = new AwardType();
  10663. if (awardTimes == 0) {
  10664. award.num = data.num;
  10665. award.type = data.award;
  10666. xGame.common.getAward([award], () => {
  10667. let all = Math.floor(drawTimes / 3);
  10668. DataMgr.setDrawAwardTimes(all);
  10669. this.updateDraw();
  10670. });
  10671. }
  10672. else {
  10673. award.num = parseInt(data.nextid[1]);
  10674. award.type = parseInt(data.nextid[0]);
  10675. xGame.common.getAward([award], () => {
  10676. let all = Math.floor(drawTimes / 3);
  10677. DataMgr.setDrawAwardTimes(all);
  10678. this.updateDraw();
  10679. });
  10680. }
  10681. }
  10682. closeSelf() {
  10683. this.hide();
  10684. }
  10685. playSecretaryIdle() {
  10686. let parent = this.ui.secretary.displayObject;
  10687. parent.destroyChildren();
  10688. let xx = this.ui.secretary.width / 2;
  10689. let yy = this.ui.secretary.height;
  10690. let scale = xGame.common.getSecretaryScale();
  10691. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  10692. xGame.common.secretary.play(data, 0, true, parent);
  10693. }
  10694. }
  10695. UIDraw.uiName = "UIDraw";
  10696. class ui_UIFlyEft extends fgui.GComponent {
  10697. static createInstance() {
  10698. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  10699. }
  10700. onConstruct() {
  10701. this.n0 = (this.getChild("n0"));
  10702. this.n1 = (this.getChild("n1"));
  10703. this.n2 = (this.getChild("n2"));
  10704. this.n3 = (this.getChild("n3"));
  10705. this.n4 = (this.getChild("n4"));
  10706. this.n5 = (this.getChild("n5"));
  10707. this.n6 = (this.getChild("n6"));
  10708. this.n7 = (this.getChild("n7"));
  10709. this.iconNode = (this.getChild("iconNode"));
  10710. this.txt = (this.getChild("txt"));
  10711. this.txtNode = (this.getChild("txtNode"));
  10712. }
  10713. }
  10714. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  10715. class UIFlyEft extends UIBase {
  10716. constructor() {
  10717. super();
  10718. this.max = 8;
  10719. this.delay = 0;
  10720. }
  10721. onConstructor() {
  10722. this.ui = ui_UIFlyEft.createInstance();
  10723. this.contentPane = this.ui;
  10724. this.isEject = false;
  10725. this.isMuti = true;
  10726. this.ui.x += xGame.common.sysOffestNum;
  10727. }
  10728. getArrPos() {
  10729. if (this.iconPos && this.iconPos.length > 0)
  10730. return;
  10731. this.iconPos = [];
  10732. let temp;
  10733. for (let index = 0; index < this.max; index++) {
  10734. temp = this.ui["n" + index];
  10735. this.iconPos.push([temp.x, temp.y]);
  10736. }
  10737. }
  10738. show(stPos, edPos, num, type, callback) {
  10739. super.show();
  10740. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  10741. this.getArrPos();
  10742. this.updateUI(type);
  10743. this.updatePos();
  10744. this.runFly(edPos, callback);
  10745. this.runWorlds(stPos, num);
  10746. }
  10747. updateUI(type) {
  10748. let temp;
  10749. let str;
  10750. for (let index = 0; index < this.max; index++) {
  10751. temp = this.ui["n" + index];
  10752. str = this.getIconStr(type);
  10753. temp.url = xGame.common.getGameIconUrl(str);
  10754. }
  10755. }
  10756. getIconStr(type) {
  10757. switch (type) {
  10758. case Prop.diamond:
  10759. return "ty_zs";
  10760. case Prop.coin:
  10761. return "ty_jb";
  10762. default:
  10763. break;
  10764. }
  10765. }
  10766. updatePos() {
  10767. let temp;
  10768. for (let index = 0; index < this.max; index++) {
  10769. temp = this.ui["n" + index];
  10770. temp.x = this.iconPos[index][0];
  10771. temp.y = this.iconPos[index][1];
  10772. }
  10773. }
  10774. runFly(endPos, callback) {
  10775. let all = 0;
  10776. let temp;
  10777. for (let index = 0; index < this.max; index++) {
  10778. temp = this.ui["n" + index];
  10779. temp.visible = true;
  10780. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  10781. temp.visible = false;
  10782. all++;
  10783. if (all >= this.max) {
  10784. callback && callback();
  10785. }
  10786. }), 20 * index);
  10787. }
  10788. }
  10789. runWorlds(stPos, num) {
  10790. let str = "+" + num;
  10791. this.ui.txt.text = str;
  10792. let starX = stPos.x;
  10793. let starY = stPos.y + 50;
  10794. this.ui.txt.x = starX;
  10795. this.ui.txt.y = starY;
  10796. this.ui.txt.visible = true;
  10797. this.ui.txt.alpha = 1;
  10798. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  10799. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  10800. this.ui.txt.visible = false;
  10801. this.hide();
  10802. }));
  10803. }));
  10804. }
  10805. }
  10806. UIFlyEft.uiName = "UIFlyEft";
  10807. class Common {
  10808. constructor() {
  10809. this.convertNum = 0.025;
  10810. this.VectorUp = new Laya.Vector3(0, 1, 0);
  10811. this.scaleV3One = new Laya.Vector3();
  10812. this.scaleV3Two = new Laya.Vector3();
  10813. this.posV4 = new Laya.Vector4();
  10814. this.showDebug = false;
  10815. this.openGuide = true;
  10816. this.rodOffest = new Laya.Vector2(0, 0);
  10817. this.rodAngle = 0;
  10818. this.gameMode = GameMode.classic;
  10819. this.bigMoveLevelIndex = 1;
  10820. this.bigMoveNeedCoin = 1000;
  10821. this.classicNiceNeddCoin = 1000;
  10822. this.passAwardCoin = 2000;
  10823. this.classicRoomType = 1;
  10824. this.maxPower = 20;
  10825. this.natureMaxPower = 5;
  10826. this.videoPower = 2;
  10827. this.powerRecoverNum = 900;
  10828. this.curPlayerSkillType = 0;
  10829. this.isNewDay = false;
  10830. this.clickedBall = false;
  10831. this.placeBallCurLevel = 0;
  10832. this.placeBallStarNum = 0;
  10833. this.longHelpLine = false;
  10834. this.maxShareDiamondTimes = 3;
  10835. this.guideStep = 0;
  10836. this.temSelfLevel = 0;
  10837. this.extraMoveNum = 0;
  10838. this.curRankID = 0;
  10839. this.rankID = {
  10840. normalStar: 12000,
  10841. wxStar: 12001
  10842. };
  10843. this.skillNameList = ["Fall from the sky", "Unstoppable Force", "Freeze Shot"];
  10844. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  10845. this.btnClickStr = "buttonclick";
  10846. this.maxSkillLevel = 10;
  10847. this.upSkillLevel = false;
  10848. this.gameStartTime = 0;
  10849. this._sysOffestNum = 0;
  10850. this.angleV2 = new Laya.Vector2();
  10851. this.rootV = new Laya.Vector2(0, 1);
  10852. this.tempDir1 = new Laya.Vector2();
  10853. this.tempDir2 = new Laya.Vector2();
  10854. this.ballSize = 33;
  10855. this.stPos = new Laya.Point();
  10856. this.edPos = new Laya.Point();
  10857. Common._instance = this;
  10858. window["common"] = this;
  10859. }
  10860. static getInstance() {
  10861. if (!this._instance) {
  10862. this._instance = new Common();
  10863. }
  10864. return this._instance;
  10865. }
  10866. get sysOffestNum() {
  10867. if (this._sysOffestNum == 0) {
  10868. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  10869. }
  10870. return this._sysOffestNum;
  10871. }
  10872. testShader() {
  10873. let test = new LightShader();
  10874. test.texture = "res/d3Res/ballTexture/ball1.png";
  10875. Laya.stage.addChild(test);
  10876. }
  10877. playScale(node) {
  10878. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  10879. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  10880. }));
  10881. }));
  10882. }
  10883. setGroup(colli, ...group) {
  10884. let out = 0;
  10885. for (let index = 0; index < group.length; index++) {
  10886. if (index == 0) {
  10887. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10888. }
  10889. else {
  10890. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10891. }
  10892. }
  10893. colli.collisionGroup = out;
  10894. }
  10895. setCanGroupWith(colli, ...group) {
  10896. let out = 0;
  10897. for (let index = 0; index < group.length; index++) {
  10898. if (index == 0) {
  10899. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10900. }
  10901. else {
  10902. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10903. }
  10904. }
  10905. colli.canCollideWith = out;
  10906. }
  10907. loadPrefab(name, callback) {
  10908. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  10909. let prefab = new Laya.Prefab();
  10910. prefab.json = obj;
  10911. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  10912. callback && callback(img);
  10913. }));
  10914. }
  10915. pos2to3Convert(x, y, d3Pos) {
  10916. x = x + this.sysOffestNum;
  10917. d3Pos.setValue(x, y, 0);
  10918. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  10919. if (success) {
  10920. }
  10921. else {
  10922. console.error("转换出错了。。。。。。。。");
  10923. }
  10924. }
  10925. scale2to3Convert(num) {
  10926. this.scaleV3One.setValue(0, 0, 0);
  10927. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  10928. this.scaleV3Two.setValue(0, num, 0);
  10929. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  10930. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  10931. return outNum;
  10932. }
  10933. pos3to2Convert(d3Pos) {
  10934. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  10935. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  10936. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  10937. d3Pos.x -= this.sysOffestNum;
  10938. }
  10939. scale3to2Convert(num) {
  10940. let scale = this.scale2to3Convert(1);
  10941. let d2Out = num / scale;
  10942. return d2Out;
  10943. }
  10944. getCollider(type, restitution = 0.9, density = 10) {
  10945. let colli;
  10946. if (type == "box")
  10947. colli = new Laya.BoxCollider();
  10948. else
  10949. colli = new Laya.CircleCollider();
  10950. colli.friction = 0;
  10951. colli.restitution = restitution;
  10952. colli.density = density;
  10953. return colli;
  10954. }
  10955. getRigbody() {
  10956. let rigy = new Laya.RigidBody();
  10957. rigy.bullet = true;
  10958. rigy.allowRotation = false;
  10959. rigy.allowSleep = false;
  10960. rigy.gravityScale = 0;
  10961. return rigy;
  10962. }
  10963. getfguiRotation(x, y) {
  10964. this.angleV2.setValue(x, y);
  10965. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  10966. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  10967. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  10968. angle = -angle;
  10969. }
  10970. return 180 + angle;
  10971. }
  10972. getAngle(x, y) {
  10973. this.angleV2.setValue(x, y);
  10974. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  10975. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  10976. return angle;
  10977. }
  10978. randomNum(a, b) {
  10979. return a + Math.floor((b - a + 1) * Math.random());
  10980. }
  10981. getRandArrEle(arr) {
  10982. return arr[Math.floor(arr.length * Math.random())];
  10983. }
  10984. getSign(val) {
  10985. return val >= 0 ? 1 : -1;
  10986. }
  10987. botherArr(arr) {
  10988. let times = arr.length + 2;
  10989. let length = arr.length;
  10990. let a;
  10991. let b;
  10992. let temp;
  10993. for (let index = 0; index < times; index++) {
  10994. a = Math.floor(Math.random() * length);
  10995. b = Math.floor(Math.random() * length);
  10996. temp = arr[a];
  10997. arr[a] = arr[b];
  10998. arr[b] = temp;
  10999. }
  11000. }
  11001. getGameIconUrl(id) {
  11002. return "ui://game/" + id;
  11003. }
  11004. getComponentUrl(id) {
  11005. return "ui://game/" + id;
  11006. }
  11007. getAnimation() {
  11008. }
  11009. judgeSkillType(type = SkillType.highSpace) {
  11010. if (this.gameMode == GameMode.classic)
  11011. return;
  11012. let gameMgr = this.gameMgr;
  11013. if (gameMgr.selfTurn) {
  11014. if (gameMgr.selfCurSkill == type) {
  11015. return true;
  11016. }
  11017. }
  11018. else {
  11019. if (gameMgr.aiCurSkill == type) {
  11020. return true;
  11021. }
  11022. }
  11023. }
  11024. ballColliHole(collider) {
  11025. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  11026. xGame.common.gameMgr.isFirstInGame = false;
  11027. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  11028. }
  11029. collider.owner.mySrc.checkWrongBall();
  11030. }
  11031. getArrMaxEle(arr) {
  11032. let max = -Infinity;
  11033. for (let index = 0; index < arr.length; index++) {
  11034. max = Math.max(arr[index], max);
  11035. }
  11036. return max;
  11037. }
  11038. getArrMinEle(arr) {
  11039. let min = Infinity;
  11040. for (let index = 0; index < arr.length; index++) {
  11041. min = Math.min(arr[index], min);
  11042. }
  11043. return min;
  11044. }
  11045. playRandomMutiBallBigSkillSound() {
  11046. if (Math.random() <= 0.5)
  11047. return;
  11048. let rand = this.randomNum(1, 6);
  11049. let str = "ganfa0" + rand;
  11050. xGame.soundMgr.playSound(str);
  11051. }
  11052. showOneCamera(type) {
  11053. let object = xGame.common.d3World.cameraObj;
  11054. for (const key in object) {
  11055. if (Object.prototype.hasOwnProperty.call(object, key)) {
  11056. object[key].init();
  11057. object[key].owner.active = key == type;
  11058. }
  11059. }
  11060. }
  11061. checkBallOverBorder(x, y) {
  11062. let radius = 17;
  11063. let condition = this._checkBorder(x + radius, y) ||
  11064. this._checkBorder(x - radius, y) ||
  11065. this._checkBorder(x, y + radius) ||
  11066. this._checkBorder(x, y - radius);
  11067. if (condition) {
  11068. return true;
  11069. }
  11070. }
  11071. _checkBorder(x, y) {
  11072. let borderRect = this.d2World.borderRect;
  11073. let xOffest = 20;
  11074. let yOffest = 20;
  11075. if (y <= borderRect.y - yOffest) {
  11076. return true;
  11077. }
  11078. if (y >= borderRect.y + borderRect.height + yOffest) {
  11079. return true;
  11080. }
  11081. if (x <= borderRect.x - xOffest) {
  11082. return true;
  11083. }
  11084. if (x >= borderRect.x + borderRect.width + xOffest) {
  11085. return true;
  11086. }
  11087. }
  11088. initWeight(cfg) {
  11089. let allCfgData = { data: {}, allWeightNum: 0 };
  11090. let weightCfg = allCfgData.data;
  11091. let weight = 0;
  11092. for (const key in cfg) {
  11093. weightCfg[key] = {};
  11094. weightCfg[key].id = cfg[key].id;
  11095. weightCfg[key].minWeight = weight;
  11096. weight += cfg[key].weight;
  11097. weightCfg[key].maxWeight = weight;
  11098. }
  11099. allCfgData.allWeightNum = weight;
  11100. return allCfgData;
  11101. }
  11102. getRandomWeightData(cfg) {
  11103. let weightCfg = cfg.data;
  11104. let allWeightNum = cfg.allWeightNum;
  11105. let rand = Math.floor(Math.random() * allWeightNum);
  11106. for (const key in weightCfg) {
  11107. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  11108. return weightCfg[key];
  11109. }
  11110. }
  11111. return weightCfg[1];
  11112. }
  11113. showGirlTalkPop(wordsIndex, node, msgNode) {
  11114. node.visible = true;
  11115. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  11116. node.t0.play(Laya.Handler.create(this, () => {
  11117. node.visible = false;
  11118. }));
  11119. }
  11120. stopGirlPop(node) {
  11121. node.t0.stop();
  11122. node.visible = false;
  11123. }
  11124. createHead(loader, url, size = 107) {
  11125. if (Laya.Browser.name == "Browser") {
  11126. loader.url = url;
  11127. return;
  11128. }
  11129. if (Moyu.isTT) {
  11130. let localImage = new Image();
  11131. localImage.src = url;
  11132. localImage.onload = () => {
  11133. let t2d = new Laya.Texture2D();
  11134. t2d.width = size;
  11135. t2d.height = size;
  11136. loader.displayObject.graphics.drawImage(new Laya.Texture(t2d), 0, 0);
  11137. t2d.loadImageSource(localImage);
  11138. };
  11139. }
  11140. else {
  11141. console.log('zh:url=', url);
  11142. loader.url = url;
  11143. }
  11144. }
  11145. addTestCoin(num) {
  11146. DataMgr.setCoin(num);
  11147. }
  11148. addTestDiamond(num) {
  11149. DataMgr.setDiamond(num);
  11150. }
  11151. addTestSkill() {
  11152. DataMgr.setBigSkill(0, 99);
  11153. DataMgr.setBigSkill(1, 99);
  11154. DataMgr.setBigSkill(2, 99);
  11155. }
  11156. playClassicEmotion(number, x, y) {
  11157. if (this.gameMode == GameMode.bigMove)
  11158. return;
  11159. let randIndex = this.randomNum(0, 2);
  11160. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  11161. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  11162. if (this.gameMgr.selfTurn) {
  11163. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11164. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11165. }
  11166. else {
  11167. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11168. }
  11169. else {
  11170. if (number == this.gameMgr.blackNum) {
  11171. if (this.gameMgr.selfBallArr.length == 0) {
  11172. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11173. }
  11174. else {
  11175. }
  11176. }
  11177. else {
  11178. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11179. }
  11180. }
  11181. }
  11182. }
  11183. else {
  11184. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11185. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11186. }
  11187. else {
  11188. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11189. }
  11190. else {
  11191. if (number == this.gameMgr.blackNum) {
  11192. if (this.gameMgr.aiBallArr.length == 0) {
  11193. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11194. }
  11195. else {
  11196. }
  11197. }
  11198. else {
  11199. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11200. }
  11201. }
  11202. }
  11203. }
  11204. }
  11205. playHappySound(number) {
  11206. if (this.gameMode != GameMode.classic)
  11207. return;
  11208. if (number == 8)
  11209. return;
  11210. let play = false;
  11211. if (this.gameMgr.selfTurn) {
  11212. if (this.gameMgr.ensureBallType) {
  11213. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11214. play = true;
  11215. }
  11216. }
  11217. else {
  11218. play = true;
  11219. }
  11220. }
  11221. else {
  11222. if (this.gameMgr.ensureBallType) {
  11223. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11224. play = true;
  11225. }
  11226. }
  11227. else {
  11228. play = true;
  11229. }
  11230. }
  11231. if (play)
  11232. xGame.soundMgr.playSound("applause");
  11233. }
  11234. destroyClassicEmotion() {
  11235. if (this.gameMode == GameMode.bigMove)
  11236. return;
  11237. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  11238. parent.destroyChildren();
  11239. }
  11240. playAwardSpine(x, y) {
  11241. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  11242. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  11243. this.awardSpine.play(data, 0, false, parent);
  11244. }
  11245. destroyAwardSpine() {
  11246. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  11247. parent.destroyChildren();
  11248. }
  11249. isBlock(bx, by, hx, hy, except = null) {
  11250. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  11251. let balls = xGame.common.d2World.ballArr;
  11252. let outArr = [];
  11253. for (let index = 0; index < balls.length; index++) {
  11254. let obj = balls[index];
  11255. if (obj.number == 0)
  11256. continue;
  11257. if (obj == except)
  11258. continue;
  11259. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  11260. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  11261. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  11262. if (num >= 1)
  11263. num = 1;
  11264. if (num < 0)
  11265. continue;
  11266. let gap = Math.sin(Math.acos(num)) * dis;
  11267. if (gap < this.ballSize) {
  11268. outArr.push({
  11269. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  11270. disHon: Math.cos(Math.acos(num)) * dis,
  11271. disVer: Math.sin(Math.acos(num)) * dis,
  11272. src: balls[index],
  11273. dir: this.tempDir1
  11274. });
  11275. }
  11276. }
  11277. if (outArr.length > 0) {
  11278. outArr.sort((a, b) => { return a.dis - b.dis; });
  11279. return outArr[0];
  11280. }
  11281. }
  11282. AngleBetween(vector1, vector2) {
  11283. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  11284. return rad * (180 / Math.PI);
  11285. }
  11286. getSecretaryScale() {
  11287. if (this.secretary.spineName == "mishu") {
  11288. return 1.28;
  11289. }
  11290. else {
  11291. return 1.024;
  11292. }
  11293. }
  11294. signAwardContainsRod(arr) {
  11295. let temp;
  11296. for (let index = 0; index < arr.length; index++) {
  11297. temp = arr[index].split('-')[0];
  11298. if (parseInt(temp) > 2) {
  11299. return true;
  11300. }
  11301. }
  11302. }
  11303. judgeSameDay() {
  11304. let lastTime = DataMgr.getSignTime();
  11305. let curTime = new Date().getTime();
  11306. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  11307. return true;
  11308. }
  11309. return false;
  11310. }
  11311. getAward(arr, callback) {
  11312. let showTriple = arr[0].type <= 2;
  11313. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  11314. let temp;
  11315. for (let index = 0; index < arr.length; index++) {
  11316. temp = arr[index];
  11317. switch (temp.type) {
  11318. case 1:
  11319. this.playObjFlyAnim(temp.num, temp.type);
  11320. break;
  11321. case 2:
  11322. this.playObjFlyAnim(temp.num, temp.type);
  11323. break;
  11324. case 3:
  11325. case 4:
  11326. case 5:
  11327. case 6:
  11328. DataMgr.setBallRod(temp.type - 2, 1);
  11329. DataMgr.setCurBallRod(temp.type - 2);
  11330. break;
  11331. default:
  11332. break;
  11333. }
  11334. }
  11335. callback && callback(watchVideo);
  11336. });
  11337. }
  11338. getMoneyNode() {
  11339. let moneyNode;
  11340. let sign = xGame.uiMgr.getUI(UISign);
  11341. let draw = xGame.uiMgr.getUI(UIDraw);
  11342. let end = xGame.uiMgr.getUI(UIGameEnd);
  11343. let skill = xGame.uiMgr.getUI(UISkill);
  11344. if (sign && !sign.isHide)
  11345. moneyNode = sign.ui.moneyNode;
  11346. if (draw && !draw.isHide)
  11347. moneyNode = draw.ui.moneyNode;
  11348. if (end && !end.isHide)
  11349. moneyNode = end.ui.moneyNode;
  11350. if (skill && !skill.isHide)
  11351. moneyNode = skill.ui.moneyNode;
  11352. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  11353. let main = xGame.uiMgr.getUI(UIMain);
  11354. if (condition1 && main && !main.isHide) {
  11355. moneyNode = main.ui.moneyNode;
  11356. }
  11357. return moneyNode;
  11358. }
  11359. playObjFlyAnim(num, type, callback = null) {
  11360. this.stPos.x = Laya.stage.width / 2;
  11361. this.stPos.y = Laya.stage.height / 2;
  11362. let moneyNode = this.getMoneyNode();
  11363. switch (type) {
  11364. case Prop.diamond:
  11365. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  11366. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  11367. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  11368. this.edPos.x /= 2;
  11369. this.edPos.y /= 2;
  11370. break;
  11371. case Prop.coin:
  11372. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  11373. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  11374. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  11375. this.edPos.x /= 2;
  11376. this.edPos.y /= 2;
  11377. break;
  11378. default:
  11379. break;
  11380. }
  11381. xGame.soundMgr.playSound("coinbag");
  11382. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  11383. switch (type) {
  11384. case Prop.diamond:
  11385. DataMgr.setDiamond(num);
  11386. break;
  11387. case Prop.coin:
  11388. DataMgr.setCoin(num);
  11389. break;
  11390. default:
  11391. break;
  11392. }
  11393. callback && callback();
  11394. });
  11395. }
  11396. autoPopUIView() {
  11397. let arr = [];
  11398. let sign = this.judgeSameDay() ? false : true;
  11399. if (sign)
  11400. arr.push("sign");
  11401. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  11402. if (draw)
  11403. arr.push("draw");
  11404. if (arr.length <= 0)
  11405. return;
  11406. let str = this.getRandArrEle(arr);
  11407. switch (str) {
  11408. case "sign":
  11409. xGame.uiMgr.Show(UISign);
  11410. break;
  11411. case "draw":
  11412. xGame.uiMgr.Show(UIDraw);
  11413. break;
  11414. default:
  11415. break;
  11416. }
  11417. }
  11418. getMSTime(time) {
  11419. let min = Math.floor(time / 60);
  11420. let sec = Math.floor((time - min * 60));
  11421. if (sec < 10)
  11422. sec = "0" + sec;
  11423. if (min < 10)
  11424. min = "0" + min;
  11425. return `${min}:${sec}`;
  11426. }
  11427. testPower() {
  11428. DataMgr.setPower(0, false);
  11429. }
  11430. getAllStarNum() {
  11431. let data = DataMgr.getPlaceBallLevelList();
  11432. let out = 0;
  11433. for (let index = 0; index < data.length; index++) {
  11434. out += data[index].star;
  11435. }
  11436. return out;
  11437. }
  11438. recoverCameraView() {
  11439. Laya.timer.once(900, this, () => {
  11440. xGame.common.showOneCamera("mainCamera");
  11441. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  11442. xGame.common.gameUI.ui.d2Node.alpha = 1;
  11443. xGame.common.gameUI.ui.border.alpha = 0;
  11444. if (Laya.physicsTimer.scale < 1) {
  11445. Laya.physicsTimer.scale = 1;
  11446. }
  11447. }
  11448. });
  11449. }
  11450. getClassicLevel() {
  11451. let successTimes = DataMgr.getClassicTimes();
  11452. let needKey = "";
  11453. let lastKey = "";
  11454. let cfg = cfgTable.classictimesData;
  11455. let data;
  11456. for (const key in cfg) {
  11457. data = cfg[key];
  11458. if (successTimes <= data.times) {
  11459. needKey = key;
  11460. }
  11461. lastKey = key;
  11462. }
  11463. if (needKey == "")
  11464. needKey = lastKey;
  11465. return cfg[needKey];
  11466. }
  11467. }
  11468. Common._instance = null;
  11469. class ui_Component92 extends fgui.GComponent {
  11470. static createInstance() {
  11471. return (fgui.UIPackage.createObject("game", "Component92"));
  11472. }
  11473. onConstruct() {
  11474. this.n0 = (this.getChild("n0"));
  11475. }
  11476. }
  11477. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  11478. class ui_Component129 extends fgui.GProgressBar {
  11479. static createInstance() {
  11480. return (fgui.UIPackage.createObject("game", "Component129"));
  11481. }
  11482. onConstruct() {
  11483. this.bar_v = (this.getChild("bar_v"));
  11484. this.n84 = (this.getChild("n84"));
  11485. }
  11486. }
  11487. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  11488. class ui_Component130 extends fgui.GComponent {
  11489. static createInstance() {
  11490. return (fgui.UIPackage.createObject("game", "Component130"));
  11491. }
  11492. onConstruct() {
  11493. this.ani = (this.getChild("ani"));
  11494. this.t0 = this.getTransition("t0");
  11495. }
  11496. }
  11497. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  11498. class ui_powerEft extends fgui.GComponent {
  11499. static createInstance() {
  11500. return (fgui.UIPackage.createObject("game", "powerEft"));
  11501. }
  11502. onConstruct() {
  11503. this.ani = (this.getChild("ani"));
  11504. this.n88 = (this.getChild("n88"));
  11505. this.n89 = (this.getChild("n89"));
  11506. }
  11507. }
  11508. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  11509. class ui_PutBallLevelDisplay extends fgui.GComponent {
  11510. static createInstance() {
  11511. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  11512. }
  11513. onConstruct() {
  11514. this.c1 = this.getController("c1");
  11515. this.n2 = (this.getChild("n2"));
  11516. this.n22 = (this.getChild("n22"));
  11517. this.n23 = (this.getChild("n23"));
  11518. this.n15 = (this.getChild("n15"));
  11519. this.challenge = (this.getChild("challenge"));
  11520. this.n17 = (this.getChild("n17"));
  11521. this.n3 = (this.getChild("n3"));
  11522. this.starNode = (this.getChild("starNode"));
  11523. this.levelTxt = (this.getChild("levelTxt"));
  11524. this.n14 = (this.getChild("n14"));
  11525. this.n19 = (this.getChild("n19"));
  11526. this.n20 = (this.getChild("n20"));
  11527. this.n21 = (this.getChild("n21"));
  11528. this.special = (this.getChild("special"));
  11529. }
  11530. }
  11531. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  11532. class ui_Component79 extends fgui.GComponent {
  11533. static createInstance() {
  11534. return (fgui.UIPackage.createObject("game", "Component79"));
  11535. }
  11536. onConstruct() {
  11537. this.c1 = this.getController("c1");
  11538. this.n7 = (this.getChild("n7"));
  11539. this.n8 = (this.getChild("n8"));
  11540. this.n9 = (this.getChild("n9"));
  11541. this.n10 = (this.getChild("n10"));
  11542. this.n11 = (this.getChild("n11"));
  11543. this.n12 = (this.getChild("n12"));
  11544. }
  11545. }
  11546. ui_Component79.URL = "ui://isxx5ak7avag477";
  11547. class ui_Component80 extends fgui.GComponent {
  11548. static createInstance() {
  11549. return (fgui.UIPackage.createObject("game", "Component80"));
  11550. }
  11551. onConstruct() {
  11552. this.n0 = (this.getChild("n0"));
  11553. this.n1 = (this.getChild("n1"));
  11554. this.myList = (this.getChild("myList"));
  11555. this.t0 = this.getTransition("t0");
  11556. }
  11557. }
  11558. ui_Component80.URL = "ui://isxx5ak7avag47b";
  11559. class ui_SignNormal extends fgui.GComponent {
  11560. static createInstance() {
  11561. return (fgui.UIPackage.createObject("game", "SignNormal"));
  11562. }
  11563. onConstruct() {
  11564. this.c1 = this.getController("c1");
  11565. this.n7 = (this.getChild("n7"));
  11566. this.n15 = (this.getChild("n15"));
  11567. this.titleTxt = (this.getChild("titleTxt"));
  11568. this.n8 = (this.getChild("n8"));
  11569. this.myIcon = (this.getChild("myIcon"));
  11570. this.numTxt = (this.getChild("numTxt"));
  11571. this.n12 = (this.getChild("n12"));
  11572. this.n13 = (this.getChild("n13"));
  11573. this.n17 = (this.getChild("n17"));
  11574. this.n14 = (this.getChild("n14"));
  11575. }
  11576. }
  11577. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  11578. class ui_screenNode extends fgui.GComponent {
  11579. static createInstance() {
  11580. return (fgui.UIPackage.createObject("game", "screenNode"));
  11581. }
  11582. onConstruct() {
  11583. this.n9 = (this.getChild("n9"));
  11584. this.screenImg = (this.getChild("screenImg"));
  11585. }
  11586. }
  11587. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  11588. class ui_GetAwrad_com1 extends fgui.GComponent {
  11589. static createInstance() {
  11590. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  11591. }
  11592. onConstruct() {
  11593. this.n38 = (this.getChild("n38"));
  11594. this.n39 = (this.getChild("n39"));
  11595. this.n40 = (this.getChild("n40"));
  11596. this.t0 = this.getTransition("t0");
  11597. this.t1 = this.getTransition("t1");
  11598. }
  11599. }
  11600. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  11601. class ui_GetAwrad_com2 extends fgui.GComponent {
  11602. static createInstance() {
  11603. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  11604. }
  11605. onConstruct() {
  11606. this.n39 = (this.getChild("n39"));
  11607. this.n40 = (this.getChild("n40"));
  11608. this.t0 = this.getTransition("t0");
  11609. }
  11610. }
  11611. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  11612. class ui_Component128 extends fgui.GComponent {
  11613. static createInstance() {
  11614. return (fgui.UIPackage.createObject("game", "Component128"));
  11615. }
  11616. onConstruct() {
  11617. this.n38 = (this.getChild("n38"));
  11618. this.n40 = (this.getChild("n40"));
  11619. }
  11620. }
  11621. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  11622. class ui_Component100_1 extends fgui.GComponent {
  11623. static createInstance() {
  11624. return (fgui.UIPackage.createObject("game", "Component100_1"));
  11625. }
  11626. onConstruct() {
  11627. this.myNode = (this.getChild("myNode"));
  11628. this.t0 = this.getTransition("t0");
  11629. }
  11630. }
  11631. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  11632. class ui_Component142 extends fgui.GComponent {
  11633. static createInstance() {
  11634. return (fgui.UIPackage.createObject("game", "Component142"));
  11635. }
  11636. onConstruct() {
  11637. this.n41 = (this.getChild("n41"));
  11638. this.n42 = (this.getChild("n42"));
  11639. }
  11640. }
  11641. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  11642. class ui_main_guang extends fgui.GComponent {
  11643. static createInstance() {
  11644. return (fgui.UIPackage.createObject("game", "main_guang"));
  11645. }
  11646. onConstruct() {
  11647. this.n1 = (this.getChild("n1"));
  11648. this.n2 = (this.getChild("n2"));
  11649. this.n3 = (this.getChild("n3"));
  11650. this.n4 = (this.getChild("n4"));
  11651. this.n5 = (this.getChild("n5"));
  11652. this.n6 = (this.getChild("n6"));
  11653. this.n8 = (this.getChild("n8"));
  11654. this.t0 = this.getTransition("t0");
  11655. }
  11656. }
  11657. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  11658. class ui_try_com1 extends fgui.GComponent {
  11659. static createInstance() {
  11660. return (fgui.UIPackage.createObject("game", "try_com1"));
  11661. }
  11662. onConstruct() {
  11663. this.c1 = this.getController("c1");
  11664. this.n0 = (this.getChild("n0"));
  11665. this.n2 = (this.getChild("n2"));
  11666. this.cancelBtn = (this.getChild("cancelBtn"));
  11667. this.videoBtn = (this.getChild("videoBtn"));
  11668. this.n9 = (this.getChild("n9"));
  11669. this.n24 = (this.getChild("n24"));
  11670. this.titleTxt = (this.getChild("titleTxt"));
  11671. this.n32 = (this.getChild("n32"));
  11672. this.n29 = (this.getChild("n29"));
  11673. this.n36 = (this.getChild("n36"));
  11674. this.txtTime = (this.getChild("txtTime"));
  11675. this.t0 = this.getTransition("t0");
  11676. }
  11677. }
  11678. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  11679. class ui_try_com2 extends fgui.GComponent {
  11680. static createInstance() {
  11681. return (fgui.UIPackage.createObject("game", "try_com2"));
  11682. }
  11683. onConstruct() {
  11684. this.skillicon = (this.getChild("skillicon"));
  11685. this.n35 = (this.getChild("n35"));
  11686. this.n31 = (this.getChild("n31"));
  11687. this.n32 = (this.getChild("n32"));
  11688. this.n33 = (this.getChild("n33"));
  11689. this.n34 = (this.getChild("n34"));
  11690. }
  11691. }
  11692. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  11693. class ui_try_com3 extends fgui.GComponent {
  11694. static createInstance() {
  11695. return (fgui.UIPackage.createObject("game", "try_com3"));
  11696. }
  11697. onConstruct() {
  11698. this.n33 = (this.getChild("n33"));
  11699. this.n34 = (this.getChild("n34"));
  11700. this.n35 = (this.getChild("n35"));
  11701. this.t0 = this.getTransition("t0");
  11702. }
  11703. }
  11704. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  11705. class ui_huihe1 extends fgui.GComponent {
  11706. static createInstance() {
  11707. return (fgui.UIPackage.createObject("game", "huihe1"));
  11708. }
  11709. onConstruct() {
  11710. this.n0 = (this.getChild("n0"));
  11711. this.n1 = (this.getChild("n1"));
  11712. this.t0 = this.getTransition("t0");
  11713. }
  11714. }
  11715. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  11716. class ui_huihe2 extends fgui.GComponent {
  11717. static createInstance() {
  11718. return (fgui.UIPackage.createObject("game", "huihe2"));
  11719. }
  11720. onConstruct() {
  11721. this.n0 = (this.getChild("n0"));
  11722. this.n1 = (this.getChild("n1"));
  11723. this.t0 = this.getTransition("t0");
  11724. }
  11725. }
  11726. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  11727. class ui_Component143 extends fgui.GComponent {
  11728. static createInstance() {
  11729. return (fgui.UIPackage.createObject("game", "Component143"));
  11730. }
  11731. onConstruct() {
  11732. this.n3 = (this.getChild("n3"));
  11733. this.n4 = (this.getChild("n4"));
  11734. this.n5 = (this.getChild("n5"));
  11735. this.n6 = (this.getChild("n6"));
  11736. this.n7 = (this.getChild("n7"));
  11737. this.n8 = (this.getChild("n8"));
  11738. this.n9 = (this.getChild("n9"));
  11739. this.n10 = (this.getChild("n10"));
  11740. this.t0 = this.getTransition("t0");
  11741. }
  11742. }
  11743. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  11744. class ui_dh_jingbi2 extends fgui.GComponent {
  11745. static createInstance() {
  11746. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  11747. }
  11748. onConstruct() {
  11749. this.n0 = (this.getChild("n0"));
  11750. this.n1 = (this.getChild("n1"));
  11751. this.n2 = (this.getChild("n2"));
  11752. this.n3 = (this.getChild("n3"));
  11753. this.n4 = (this.getChild("n4"));
  11754. this.n5 = (this.getChild("n5"));
  11755. this.n6 = (this.getChild("n6"));
  11756. this.n8 = (this.getChild("n8"));
  11757. this.n10 = (this.getChild("n10"));
  11758. this.t0 = this.getTransition("t0");
  11759. }
  11760. }
  11761. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  11762. class ui_dh_jingbi2_1 extends fgui.GComponent {
  11763. static createInstance() {
  11764. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  11765. }
  11766. onConstruct() {
  11767. this.n1 = (this.getChild("n1"));
  11768. this.n4 = (this.getChild("n4"));
  11769. this.t0 = this.getTransition("t0");
  11770. }
  11771. }
  11772. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  11773. class ui_dh_jingbi3 extends fgui.GComponent {
  11774. static createInstance() {
  11775. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  11776. }
  11777. onConstruct() {
  11778. this.n0 = (this.getChild("n0"));
  11779. this.n1 = (this.getChild("n1"));
  11780. this.n2 = (this.getChild("n2"));
  11781. this.n3 = (this.getChild("n3"));
  11782. this.n4 = (this.getChild("n4"));
  11783. this.n5 = (this.getChild("n5"));
  11784. this.n6 = (this.getChild("n6"));
  11785. this.n8 = (this.getChild("n8"));
  11786. this.n10 = (this.getChild("n10"));
  11787. this.t0 = this.getTransition("t0");
  11788. }
  11789. }
  11790. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  11791. class ui_dh_jingbi3_1 extends fgui.GComponent {
  11792. static createInstance() {
  11793. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  11794. }
  11795. onConstruct() {
  11796. this.n3 = (this.getChild("n3"));
  11797. this.n1 = (this.getChild("n1"));
  11798. this.t0 = this.getTransition("t0");
  11799. }
  11800. }
  11801. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  11802. class ui_hb_jinbi1 extends fgui.GButton {
  11803. static createInstance() {
  11804. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  11805. }
  11806. onConstruct() {
  11807. this.n20 = (this.getChild("n20"));
  11808. this.n25 = (this.getChild("n25"));
  11809. this.coinTxt = (this.getChild("coinTxt"));
  11810. this.n28 = (this.getChild("n28"));
  11811. this.n32 = (this.getChild("n32"));
  11812. this.n38 = (this.getChild("n38"));
  11813. this.n45 = (this.getChild("n45"));
  11814. this.getTips = (this.getChild("getTips"));
  11815. this.n39 = (this.getChild("n39"));
  11816. this.diamondTxt = (this.getChild("diamondTxt"));
  11817. this.n41 = (this.getChild("n41"));
  11818. this.n42 = (this.getChild("n42"));
  11819. this.n46 = (this.getChild("n46"));
  11820. this.n47 = (this.getChild("n47"));
  11821. this.n48 = (this.getChild("n48"));
  11822. this.t0 = this.getTransition("t0");
  11823. }
  11824. }
  11825. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  11826. class ui_hb_jinbi2 extends fgui.GButton {
  11827. static createInstance() {
  11828. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  11829. }
  11830. onConstruct() {
  11831. this.n20 = (this.getChild("n20"));
  11832. this.n25 = (this.getChild("n25"));
  11833. this.coinTxt = (this.getChild("coinTxt"));
  11834. this.n28 = (this.getChild("n28"));
  11835. this.n32 = (this.getChild("n32"));
  11836. this.n38 = (this.getChild("n38"));
  11837. this.n39 = (this.getChild("n39"));
  11838. this.diamondTxt = (this.getChild("diamondTxt"));
  11839. this.n41 = (this.getChild("n41"));
  11840. this.n42 = (this.getChild("n42"));
  11841. this.n43 = (this.getChild("n43"));
  11842. this.n44 = (this.getChild("n44"));
  11843. this.n45 = (this.getChild("n45"));
  11844. this.t0 = this.getTransition("t0");
  11845. }
  11846. }
  11847. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  11848. class ui_hb_jinbi3 extends fgui.GButton {
  11849. static createInstance() {
  11850. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  11851. }
  11852. onConstruct() {
  11853. this.n20 = (this.getChild("n20"));
  11854. this.n25 = (this.getChild("n25"));
  11855. this.coinTxt = (this.getChild("coinTxt"));
  11856. this.n28 = (this.getChild("n28"));
  11857. this.n32 = (this.getChild("n32"));
  11858. this.n38 = (this.getChild("n38"));
  11859. this.n39 = (this.getChild("n39"));
  11860. this.diamondTxt = (this.getChild("diamondTxt"));
  11861. this.n41 = (this.getChild("n41"));
  11862. this.n42 = (this.getChild("n42"));
  11863. this.n43 = (this.getChild("n43"));
  11864. this.n44 = (this.getChild("n44"));
  11865. this.n45 = (this.getChild("n45"));
  11866. this.t0 = this.getTransition("t0");
  11867. }
  11868. }
  11869. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  11870. class ui_Component104 extends fgui.GComponent {
  11871. static createInstance() {
  11872. return (fgui.UIPackage.createObject("game", "Component104"));
  11873. }
  11874. onConstruct() {
  11875. this.c1 = this.getController("c1");
  11876. this.n12 = (this.getChild("n12"));
  11877. this.coinBtn = (this.getChild("coinBtn"));
  11878. this.diamondBtn = (this.getChild("diamondBtn"));
  11879. this.node3 = (this.getChild("node3"));
  11880. this.node4 = (this.getChild("node4"));
  11881. this.node5 = (this.getChild("node5"));
  11882. this.node1 = (this.getChild("node1"));
  11883. this.node2 = (this.getChild("node2"));
  11884. this.node6 = (this.getChild("node6"));
  11885. this.t0 = this.getTransition("t0");
  11886. }
  11887. }
  11888. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  11889. class ui_Component105 extends fgui.GButton {
  11890. static createInstance() {
  11891. return (fgui.UIPackage.createObject("game", "Component105"));
  11892. }
  11893. onConstruct() {
  11894. this.c1 = this.getController("c1");
  11895. this.n49 = (this.getChild("n49"));
  11896. this.n18 = (this.getChild("n18"));
  11897. this.n46 = (this.getChild("n46"));
  11898. this.n48 = (this.getChild("n48"));
  11899. }
  11900. }
  11901. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  11902. class ui_Component106 extends fgui.GButton {
  11903. static createInstance() {
  11904. return (fgui.UIPackage.createObject("game", "Component106"));
  11905. }
  11906. onConstruct() {
  11907. this.c1 = this.getController("c1");
  11908. this.n49 = (this.getChild("n49"));
  11909. this.n18 = (this.getChild("n18"));
  11910. this.n46 = (this.getChild("n46"));
  11911. this.n48 = (this.getChild("n48"));
  11912. }
  11913. }
  11914. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  11915. class ui_hb_zs1 extends fgui.GButton {
  11916. static createInstance() {
  11917. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  11918. }
  11919. onConstruct() {
  11920. this.c1 = this.getController("c1");
  11921. this.n20 = (this.getChild("n20"));
  11922. this.n21 = (this.getChild("n21"));
  11923. this.n26 = (this.getChild("n26"));
  11924. this.n27 = (this.getChild("n27"));
  11925. this.shareTxt = (this.getChild("shareTxt"));
  11926. this.n32 = (this.getChild("n32"));
  11927. this.n38 = (this.getChild("n38"));
  11928. this.n39 = (this.getChild("n39"));
  11929. this.n44 = (this.getChild("n44"));
  11930. this.diamondTxt = (this.getChild("diamondTxt"));
  11931. this.n41 = (this.getChild("n41"));
  11932. this.n45 = (this.getChild("n45"));
  11933. this.n47 = (this.getChild("n47"));
  11934. this.n48 = (this.getChild("n48"));
  11935. this.randTxt = (this.getChild("randTxt"));
  11936. this.n50 = (this.getChild("n50"));
  11937. this.t0 = this.getTransition("t0");
  11938. }
  11939. }
  11940. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  11941. class ui_dh_zs1 extends fgui.GComponent {
  11942. static createInstance() {
  11943. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  11944. }
  11945. onConstruct() {
  11946. this.n10 = (this.getChild("n10"));
  11947. this.n9 = (this.getChild("n9"));
  11948. this.n1 = (this.getChild("n1"));
  11949. this.n2 = (this.getChild("n2"));
  11950. this.n3 = (this.getChild("n3"));
  11951. this.n4 = (this.getChild("n4"));
  11952. this.n5 = (this.getChild("n5"));
  11953. this.n6 = (this.getChild("n6"));
  11954. this.n8 = (this.getChild("n8"));
  11955. this.n11 = (this.getChild("n11"));
  11956. this.t0 = this.getTransition("t0");
  11957. }
  11958. }
  11959. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  11960. class ui_dh_zs1_1 extends fgui.GComponent {
  11961. static createInstance() {
  11962. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  11963. }
  11964. onConstruct() {
  11965. this.n3 = (this.getChild("n3"));
  11966. this.n1 = (this.getChild("n1"));
  11967. this.t0 = this.getTransition("t0");
  11968. }
  11969. }
  11970. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  11971. class ui_hb_zs2 extends fgui.GButton {
  11972. static createInstance() {
  11973. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  11974. }
  11975. onConstruct() {
  11976. this.n20 = (this.getChild("n20"));
  11977. this.n21 = (this.getChild("n21"));
  11978. this.n26 = (this.getChild("n26"));
  11979. this.n27 = (this.getChild("n27"));
  11980. this.n32 = (this.getChild("n32"));
  11981. this.n38 = (this.getChild("n38"));
  11982. this.n39 = (this.getChild("n39"));
  11983. this.n44 = (this.getChild("n44"));
  11984. this.diamondTxt = (this.getChild("diamondTxt"));
  11985. this.n41 = (this.getChild("n41"));
  11986. this.n45 = (this.getChild("n45"));
  11987. this.t0 = this.getTransition("t0");
  11988. }
  11989. }
  11990. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  11991. class ui_hb_zs3 extends fgui.GButton {
  11992. static createInstance() {
  11993. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  11994. }
  11995. onConstruct() {
  11996. this.n20 = (this.getChild("n20"));
  11997. this.n21 = (this.getChild("n21"));
  11998. this.n26 = (this.getChild("n26"));
  11999. this.n27 = (this.getChild("n27"));
  12000. this.n32 = (this.getChild("n32"));
  12001. this.n38 = (this.getChild("n38"));
  12002. this.n47 = (this.getChild("n47"));
  12003. this.t0 = this.getTransition("t0");
  12004. }
  12005. }
  12006. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  12007. class ui_dh_zs2 extends fgui.GComponent {
  12008. static createInstance() {
  12009. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  12010. }
  12011. onConstruct() {
  12012. this.n10 = (this.getChild("n10"));
  12013. this.n9 = (this.getChild("n9"));
  12014. this.n1 = (this.getChild("n1"));
  12015. this.n2 = (this.getChild("n2"));
  12016. this.n3 = (this.getChild("n3"));
  12017. this.n4 = (this.getChild("n4"));
  12018. this.n5 = (this.getChild("n5"));
  12019. this.n6 = (this.getChild("n6"));
  12020. this.n8 = (this.getChild("n8"));
  12021. this.n11 = (this.getChild("n11"));
  12022. this.t0 = this.getTransition("t0");
  12023. }
  12024. }
  12025. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  12026. class ui_dh_zs2_1 extends fgui.GComponent {
  12027. static createInstance() {
  12028. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  12029. }
  12030. onConstruct() {
  12031. this.n3 = (this.getChild("n3"));
  12032. this.n1 = (this.getChild("n1"));
  12033. this.t0 = this.getTransition("t0");
  12034. }
  12035. }
  12036. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  12037. class ui_dh_zs3 extends fgui.GComponent {
  12038. static createInstance() {
  12039. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  12040. }
  12041. onConstruct() {
  12042. this.n10 = (this.getChild("n10"));
  12043. this.n9 = (this.getChild("n9"));
  12044. this.n1 = (this.getChild("n1"));
  12045. this.n2 = (this.getChild("n2"));
  12046. this.n3 = (this.getChild("n3"));
  12047. this.n4 = (this.getChild("n4"));
  12048. this.n5 = (this.getChild("n5"));
  12049. this.n6 = (this.getChild("n6"));
  12050. this.n8 = (this.getChild("n8"));
  12051. this.n11 = (this.getChild("n11"));
  12052. this.t0 = this.getTransition("t0");
  12053. }
  12054. }
  12055. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  12056. class ui_dh_zs3_1 extends fgui.GComponent {
  12057. static createInstance() {
  12058. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  12059. }
  12060. onConstruct() {
  12061. this.n3 = (this.getChild("n3"));
  12062. this.n1 = (this.getChild("n1"));
  12063. this.t0 = this.getTransition("t0");
  12064. }
  12065. }
  12066. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  12067. class ui_Component107 extends fgui.GComponent {
  12068. static createInstance() {
  12069. return (fgui.UIPackage.createObject("game", "Component107"));
  12070. }
  12071. onConstruct() {
  12072. this.n18 = (this.getChild("n18"));
  12073. this.n19 = (this.getChild("n19"));
  12074. this.n20 = (this.getChild("n20"));
  12075. this.n21 = (this.getChild("n21"));
  12076. this.n22 = (this.getChild("n22"));
  12077. this.levelTxt = (this.getChild("levelTxt"));
  12078. this.t0 = this.getTransition("t0");
  12079. }
  12080. }
  12081. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  12082. class ui_box_com1 extends fgui.GComponent {
  12083. static createInstance() {
  12084. return (fgui.UIPackage.createObject("game", "box_com1"));
  12085. }
  12086. onConstruct() {
  12087. this.n14 = (this.getChild("n14"));
  12088. this.n6 = (this.getChild("n6"));
  12089. this.t0 = this.getTransition("t0");
  12090. }
  12091. }
  12092. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  12093. class ui_box_com2 extends fgui.GProgressBar {
  12094. static createInstance() {
  12095. return (fgui.UIPackage.createObject("game", "box_com2"));
  12096. }
  12097. onConstruct() {
  12098. this.bg0 = (this.getChild("bg0"));
  12099. this.bg = (this.getChild("bg"));
  12100. this.bar = (this.getChild("bar"));
  12101. this.n7 = (this.getChild("n7"));
  12102. this.n8 = (this.getChild("n8"));
  12103. this.n10 = (this.getChild("n10"));
  12104. this.n11 = (this.getChild("n11"));
  12105. this.n12 = (this.getChild("n12"));
  12106. }
  12107. }
  12108. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  12109. class ui_box_com4 extends fgui.GComponent {
  12110. static createInstance() {
  12111. return (fgui.UIPackage.createObject("game", "box_com4"));
  12112. }
  12113. onConstruct() {
  12114. this.n8 = (this.getChild("n8"));
  12115. this.t0 = this.getTransition("t0");
  12116. }
  12117. }
  12118. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  12119. class ui_box_com3 extends fgui.GComponent {
  12120. static createInstance() {
  12121. return (fgui.UIPackage.createObject("game", "box_com3"));
  12122. }
  12123. onConstruct() {
  12124. this.n2 = (this.getChild("n2"));
  12125. this.n3 = (this.getChild("n3"));
  12126. this.n4 = (this.getChild("n4"));
  12127. this.n5 = (this.getChild("n5"));
  12128. this.t0 = this.getTransition("t0");
  12129. this.t1 = this.getTransition("t1");
  12130. }
  12131. }
  12132. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  12133. class ui_Component97 extends fgui.GComponent {
  12134. static createInstance() {
  12135. return (fgui.UIPackage.createObject("game", "Component97"));
  12136. }
  12137. onConstruct() {
  12138. this.c1 = this.getController("c1");
  12139. this.n46 = (this.getChild("n46"));
  12140. this.diamondNode = (this.getChild("diamondNode"));
  12141. this.coinNode = (this.getChild("coinNode"));
  12142. this.t0 = this.getTransition("t0");
  12143. }
  12144. }
  12145. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  12146. class ui_Component98 extends fgui.GButton {
  12147. static createInstance() {
  12148. return (fgui.UIPackage.createObject("game", "Component98"));
  12149. }
  12150. onConstruct() {
  12151. this.n8 = (this.getChild("n8"));
  12152. this.n40 = (this.getChild("n40"));
  12153. }
  12154. }
  12155. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  12156. class ui_Component28_11 extends fgui.GButton {
  12157. static createInstance() {
  12158. return (fgui.UIPackage.createObject("game", "Component28_11"));
  12159. }
  12160. onConstruct() {
  12161. this.c1 = this.getController("c1");
  12162. this.n12 = (this.getChild("n12"));
  12163. this.n17 = (this.getChild("n17"));
  12164. this.n13 = (this.getChild("n13"));
  12165. this.diamondTxt = (this.getChild("diamondTxt"));
  12166. this.n15 = (this.getChild("n15"));
  12167. this.n16 = (this.getChild("n16"));
  12168. }
  12169. }
  12170. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  12171. class ui_Component58_11 extends fgui.GComponent {
  12172. static createInstance() {
  12173. return (fgui.UIPackage.createObject("game", "Component58_11"));
  12174. }
  12175. onConstruct() {
  12176. this.n23 = (this.getChild("n23"));
  12177. this.n41 = (this.getChild("n41"));
  12178. this.myList = (this.getChild("myList"));
  12179. this.n45 = (this.getChild("n45"));
  12180. this.n44 = (this.getChild("n44"));
  12181. this.t0 = this.getTransition("t0");
  12182. }
  12183. }
  12184. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  12185. class ui_Component100 extends fgui.GComponent {
  12186. static createInstance() {
  12187. return (fgui.UIPackage.createObject("game", "Component100"));
  12188. }
  12189. onConstruct() {
  12190. this.c1 = this.getController("c1");
  12191. this.n75 = (this.getChild("n75"));
  12192. this.n76 = (this.getChild("n76"));
  12193. this.n80 = (this.getChild("n80"));
  12194. this.txt = (this.getChild("txt"));
  12195. this.spineRoot = (this.getChild("spineRoot"));
  12196. }
  12197. }
  12198. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  12199. class ui_Component101 extends fgui.GComponent {
  12200. static createInstance() {
  12201. return (fgui.UIPackage.createObject("game", "Component101"));
  12202. }
  12203. onConstruct() {
  12204. this.c1 = this.getController("c1");
  12205. this.n36 = (this.getChild("n36"));
  12206. this.n35 = (this.getChild("n35"));
  12207. this.n33 = (this.getChild("n33"));
  12208. this.n34 = (this.getChild("n34"));
  12209. }
  12210. }
  12211. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  12212. class ui_Component53 extends fgui.GComponent {
  12213. static createInstance() {
  12214. return (fgui.UIPackage.createObject("game", "Component53"));
  12215. }
  12216. onConstruct() {
  12217. this.n0 = (this.getChild("n0"));
  12218. this.n1 = (this.getChild("n1"));
  12219. this.n2 = (this.getChild("n2"));
  12220. this.n3 = (this.getChild("n3"));
  12221. this.n4 = (this.getChild("n4"));
  12222. this.n5 = (this.getChild("n5"));
  12223. this.n6 = (this.getChild("n6"));
  12224. this.n7 = (this.getChild("n7"));
  12225. this.n8 = (this.getChild("n8"));
  12226. this.n9 = (this.getChild("n9"));
  12227. this.n10 = (this.getChild("n10"));
  12228. this.n11 = (this.getChild("n11"));
  12229. this.n12 = (this.getChild("n12"));
  12230. this.n13 = (this.getChild("n13"));
  12231. this.n14 = (this.getChild("n14"));
  12232. this.n15 = (this.getChild("n15"));
  12233. this.n16 = (this.getChild("n16"));
  12234. this.n19 = (this.getChild("n19"));
  12235. this.n20 = (this.getChild("n20"));
  12236. this.n21 = (this.getChild("n21"));
  12237. this.n22 = (this.getChild("n22"));
  12238. this.n23 = (this.getChild("n23"));
  12239. this.n24 = (this.getChild("n24"));
  12240. this.n25 = (this.getChild("n25"));
  12241. this.n26 = (this.getChild("n26"));
  12242. this.n27 = (this.getChild("n27"));
  12243. this.n28 = (this.getChild("n28"));
  12244. this.n29 = (this.getChild("n29"));
  12245. this.n30 = (this.getChild("n30"));
  12246. this.n31 = (this.getChild("n31"));
  12247. this.n32 = (this.getChild("n32"));
  12248. this.n33 = (this.getChild("n33"));
  12249. this.n34 = (this.getChild("n34"));
  12250. this.n35 = (this.getChild("n35"));
  12251. this.t0 = this.getTransition("t0");
  12252. }
  12253. }
  12254. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  12255. class ui_Component58 extends fgui.GComponent {
  12256. static createInstance() {
  12257. return (fgui.UIPackage.createObject("game", "Component58"));
  12258. }
  12259. onConstruct() {
  12260. this.n23 = (this.getChild("n23"));
  12261. this.n41 = (this.getChild("n41"));
  12262. this.n8 = (this.getChild("n8"));
  12263. this.skillList = (this.getChild("skillList"));
  12264. this.t0 = this.getTransition("t0");
  12265. }
  12266. }
  12267. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  12268. class ui_Component59 extends fgui.GComponent {
  12269. static createInstance() {
  12270. return (fgui.UIPackage.createObject("game", "Component59"));
  12271. }
  12272. onConstruct() {
  12273. this.n3 = (this.getChild("n3"));
  12274. this.msgTxt = (this.getChild("msgTxt"));
  12275. this.t0 = this.getTransition("t0");
  12276. }
  12277. }
  12278. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  12279. class ui_RulerNode extends fgui.GComponent {
  12280. static createInstance() {
  12281. return (fgui.UIPackage.createObject("game", "RulerNode"));
  12282. }
  12283. onConstruct() {
  12284. this.n6 = (this.getChild("n6"));
  12285. this.n4 = (this.getChild("n4"));
  12286. this.img1 = (this.getChild("img1"));
  12287. this.img2 = (this.getChild("img2"));
  12288. }
  12289. }
  12290. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  12291. class ui_Component108 extends fgui.GComponent {
  12292. static createInstance() {
  12293. return (fgui.UIPackage.createObject("game", "Component108"));
  12294. }
  12295. onConstruct() {
  12296. this.n19 = (this.getChild("n19"));
  12297. this.t0 = this.getTransition("t0");
  12298. }
  12299. }
  12300. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  12301. class ui_Component63 extends fgui.GComponent {
  12302. static createInstance() {
  12303. return (fgui.UIPackage.createObject("game", "Component63"));
  12304. }
  12305. onConstruct() {
  12306. this.n66 = (this.getChild("n66"));
  12307. this.n56 = (this.getChild("n56"));
  12308. this.n63 = (this.getChild("n63"));
  12309. this.n65 = (this.getChild("n65"));
  12310. this.t0 = this.getTransition("t0");
  12311. }
  12312. }
  12313. ui_Component63.URL = "ui://isxx5ak7h657452";
  12314. class ui_topNode extends fgui.GComponent {
  12315. static createInstance() {
  12316. return (fgui.UIPackage.createObject("game", "topNode"));
  12317. }
  12318. onConstruct() {
  12319. this.selfProgress = (this.getChild("selfProgress"));
  12320. this.aiProgress = (this.getChild("aiProgress"));
  12321. this.selfKuang = (this.getChild("selfKuang"));
  12322. this.aiKuang = (this.getChild("aiKuang"));
  12323. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  12324. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  12325. this.n33 = (this.getChild("n33"));
  12326. this.n34 = (this.getChild("n34"));
  12327. this.selfNameTxt = (this.getChild("selfNameTxt"));
  12328. this.aiNameTxt = (this.getChild("aiNameTxt"));
  12329. this.selfBallList = (this.getChild("selfBallList"));
  12330. this.aiBallList = (this.getChild("aiBallList"));
  12331. this.middleNode = (this.getChild("middleNode"));
  12332. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  12333. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  12334. this.scoreNode = (this.getChild("scoreNode"));
  12335. this.selfTips = (this.getChild("selfTips"));
  12336. this.aiTips = (this.getChild("aiTips"));
  12337. }
  12338. }
  12339. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  12340. class ui_selfProgress extends fgui.GProgressBar {
  12341. static createInstance() {
  12342. return (fgui.UIPackage.createObject("game", "selfProgress"));
  12343. }
  12344. onConstruct() {
  12345. this.n3 = (this.getChild("n3"));
  12346. this.bar = (this.getChild("bar"));
  12347. }
  12348. }
  12349. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  12350. class ui_aiProgress extends fgui.GProgressBar {
  12351. static createInstance() {
  12352. return (fgui.UIPackage.createObject("game", "aiProgress"));
  12353. }
  12354. onConstruct() {
  12355. this.n3 = (this.getChild("n3"));
  12356. this.bar = (this.getChild("bar"));
  12357. }
  12358. }
  12359. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  12360. class ui_ballDisplay extends fgui.GComponent {
  12361. static createInstance() {
  12362. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  12363. }
  12364. onConstruct() {
  12365. this.myImg = (this.getChild("myImg"));
  12366. }
  12367. }
  12368. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  12369. class ui_moveNode extends fgui.GComponent {
  12370. static createInstance() {
  12371. return (fgui.UIPackage.createObject("game", "moveNode"));
  12372. }
  12373. onConstruct() {
  12374. this.n8 = (this.getChild("n8"));
  12375. this.finger = (this.getChild("finger"));
  12376. }
  12377. }
  12378. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  12379. class ui_cancelBtn extends fgui.GButton {
  12380. static createInstance() {
  12381. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  12382. }
  12383. onConstruct() {
  12384. this.c1 = this.getController("c1");
  12385. this.n0 = (this.getChild("n0"));
  12386. this.n1 = (this.getChild("n1"));
  12387. }
  12388. }
  12389. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  12390. class ui_shareBtn extends fgui.GButton {
  12391. static createInstance() {
  12392. return (fgui.UIPackage.createObject("game", "shareBtn"));
  12393. }
  12394. onConstruct() {
  12395. this.c1 = this.getController("c1");
  12396. this.n2 = (this.getChild("n2"));
  12397. this.n1 = (this.getChild("n1"));
  12398. this.n3 = (this.getChild("n3"));
  12399. this.n4 = (this.getChild("n4"));
  12400. this.n5 = (this.getChild("n5"));
  12401. this.n6 = (this.getChild("n6"));
  12402. }
  12403. }
  12404. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  12405. class ui_share2Btn extends fgui.GButton {
  12406. static createInstance() {
  12407. return (fgui.UIPackage.createObject("game", "share2Btn"));
  12408. }
  12409. onConstruct() {
  12410. this.n3 = (this.getChild("n3"));
  12411. }
  12412. }
  12413. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  12414. class ui_rodMethodNode extends fgui.GComponent {
  12415. static createInstance() {
  12416. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  12417. }
  12418. onConstruct() {
  12419. this.bg = (this.getChild("bg"));
  12420. this.dot = (this.getChild("dot"));
  12421. }
  12422. }
  12423. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  12424. class ui_sureBtn extends fgui.GButton {
  12425. static createInstance() {
  12426. return (fgui.UIPackage.createObject("game", "sureBtn"));
  12427. }
  12428. onConstruct() {
  12429. this.n2 = (this.getChild("n2"));
  12430. this.n1 = (this.getChild("n1"));
  12431. }
  12432. }
  12433. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  12434. class ui_Component18 extends fgui.GComponent {
  12435. static createInstance() {
  12436. return (fgui.UIPackage.createObject("game", "Component18"));
  12437. }
  12438. onConstruct() {
  12439. this.c1 = this.getController("c1");
  12440. this.nameTxt = (this.getChild("nameTxt"));
  12441. this.headImg = (this.getChild("headImg"));
  12442. this.n24 = (this.getChild("n24"));
  12443. this.skillImg = (this.getChild("skillImg"));
  12444. this.skillTxt = (this.getChild("skillTxt"));
  12445. }
  12446. }
  12447. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  12448. class ui_Component45 extends fgui.GComponent {
  12449. static createInstance() {
  12450. return (fgui.UIPackage.createObject("game", "Component45"));
  12451. }
  12452. onConstruct() {
  12453. this.c1 = this.getController("c1");
  12454. this.n40 = (this.getChild("n40"));
  12455. this.n41 = (this.getChild("n41"));
  12456. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  12457. this.n42 = (this.getChild("n42"));
  12458. this.awardTxt = (this.getChild("awardTxt"));
  12459. this.n44 = (this.getChild("n44"));
  12460. this.t0 = this.getTransition("t0");
  12461. }
  12462. }
  12463. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  12464. class ui_emotionDisplay extends fgui.GButton {
  12465. static createInstance() {
  12466. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  12467. }
  12468. onConstruct() {
  12469. this.myIcon = (this.getChild("myIcon"));
  12470. }
  12471. }
  12472. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  12473. class ui_Component49 extends fgui.GButton {
  12474. static createInstance() {
  12475. return (fgui.UIPackage.createObject("game", "Component49"));
  12476. }
  12477. onConstruct() {
  12478. this.n69 = (this.getChild("n69"));
  12479. this.n56 = (this.getChild("n56"));
  12480. }
  12481. }
  12482. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  12483. class ui_Component50 extends fgui.GButton {
  12484. static createInstance() {
  12485. return (fgui.UIPackage.createObject("game", "Component50"));
  12486. }
  12487. onConstruct() {
  12488. this.n54 = (this.getChild("n54"));
  12489. this.n65 = (this.getChild("n65"));
  12490. }
  12491. }
  12492. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  12493. class ui_Component51 extends fgui.GButton {
  12494. static createInstance() {
  12495. return (fgui.UIPackage.createObject("game", "Component51"));
  12496. }
  12497. onConstruct() {
  12498. this.c1 = this.getController("c1");
  12499. this.n51 = (this.getChild("n51"));
  12500. this.n54 = (this.getChild("n54"));
  12501. }
  12502. }
  12503. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  12504. class ui_Button5 extends fgui.GButton {
  12505. static createInstance() {
  12506. return (fgui.UIPackage.createObject("game", "Button5"));
  12507. }
  12508. onConstruct() {
  12509. this.c1 = this.getController("c1");
  12510. this.n0 = (this.getChild("n0"));
  12511. this.n2 = (this.getChild("n2"));
  12512. }
  12513. }
  12514. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  12515. class ui_Component124 extends fgui.GComponent {
  12516. static createInstance() {
  12517. return (fgui.UIPackage.createObject("game", "Component124"));
  12518. }
  12519. onConstruct() {
  12520. this.n22 = (this.getChild("n22"));
  12521. this.shareNode = (this.getChild("shareNode"));
  12522. }
  12523. }
  12524. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  12525. class ui_Component125 extends fgui.GComponent {
  12526. static createInstance() {
  12527. return (fgui.UIPackage.createObject("game", "Component125"));
  12528. }
  12529. onConstruct() {
  12530. this.n29 = (this.getChild("n29"));
  12531. this.coinTxt = (this.getChild("coinTxt"));
  12532. }
  12533. }
  12534. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  12535. class ui_Component52 extends fgui.GButton {
  12536. static createInstance() {
  12537. return (fgui.UIPackage.createObject("game", "Component52"));
  12538. }
  12539. onConstruct() {
  12540. this.n35 = (this.getChild("n35"));
  12541. this.n36 = (this.getChild("n36"));
  12542. }
  12543. }
  12544. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  12545. class ui_drawBtn extends fgui.GButton {
  12546. static createInstance() {
  12547. return (fgui.UIPackage.createObject("game", "drawBtn"));
  12548. }
  12549. onConstruct() {
  12550. this.c1 = this.getController("c1");
  12551. this.n2 = (this.getChild("n2"));
  12552. this.n1 = (this.getChild("n1"));
  12553. this.n5 = (this.getChild("n5"));
  12554. }
  12555. }
  12556. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  12557. class ui_Component43 extends fgui.GButton {
  12558. static createInstance() {
  12559. return (fgui.UIPackage.createObject("game", "Component43"));
  12560. }
  12561. onConstruct() {
  12562. this.n49 = (this.getChild("n49"));
  12563. }
  12564. }
  12565. ui_Component43.URL = "ui://isxx5ak7iveg434";
  12566. class ui_wordsDisplay extends fgui.GComponent {
  12567. static createInstance() {
  12568. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  12569. }
  12570. onConstruct() {
  12571. this.txt = (this.getChild("txt"));
  12572. this.n63 = (this.getChild("n63"));
  12573. }
  12574. }
  12575. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  12576. class ui_Component3 extends fgui.GComponent {
  12577. static createInstance() {
  12578. return (fgui.UIPackage.createObject("game", "Component3"));
  12579. }
  12580. onConstruct() {
  12581. this.n26 = (this.getChild("n26"));
  12582. this.n24 = (this.getChild("n24"));
  12583. this.nameTxt = (this.getChild("nameTxt"));
  12584. this.headRoot = (this.getChild("headRoot"));
  12585. }
  12586. }
  12587. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  12588. class ui_Component4 extends fgui.GComponent {
  12589. static createInstance() {
  12590. return (fgui.UIPackage.createObject("game", "Component4"));
  12591. }
  12592. onConstruct() {
  12593. this.headImg = (this.getChild("headImg"));
  12594. }
  12595. }
  12596. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  12597. class ui_Component7 extends fgui.GButton {
  12598. static createInstance() {
  12599. return (fgui.UIPackage.createObject("game", "Component7"));
  12600. }
  12601. onConstruct() {
  12602. this.n17 = (this.getChild("n17"));
  12603. }
  12604. }
  12605. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  12606. class ui_Component8 extends fgui.GButton {
  12607. static createInstance() {
  12608. return (fgui.UIPackage.createObject("game", "Component8"));
  12609. }
  12610. onConstruct() {
  12611. this.n19 = (this.getChild("n19"));
  12612. }
  12613. }
  12614. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  12615. class ui_Component10 extends fgui.GButton {
  12616. static createInstance() {
  12617. return (fgui.UIPackage.createObject("game", "Component10"));
  12618. }
  12619. onConstruct() {
  12620. this.c1 = this.getController("c1");
  12621. this.n40 = (this.getChild("n40"));
  12622. }
  12623. }
  12624. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  12625. class ui_Component11 extends fgui.GButton {
  12626. static createInstance() {
  12627. return (fgui.UIPackage.createObject("game", "Component11"));
  12628. }
  12629. onConstruct() {
  12630. this.n34 = (this.getChild("n34"));
  12631. }
  12632. }
  12633. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  12634. class ui_Component12 extends fgui.GButton {
  12635. static createInstance() {
  12636. return (fgui.UIPackage.createObject("game", "Component12"));
  12637. }
  12638. onConstruct() {
  12639. this.n35 = (this.getChild("n35"));
  12640. }
  12641. }
  12642. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  12643. class ui_Component13 extends fgui.GButton {
  12644. static createInstance() {
  12645. return (fgui.UIPackage.createObject("game", "Component13"));
  12646. }
  12647. onConstruct() {
  12648. this.n27 = (this.getChild("n27"));
  12649. this.n36 = (this.getChild("n36"));
  12650. }
  12651. }
  12652. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  12653. class ui_dh_js_tuowei extends fgui.GComponent {
  12654. static createInstance() {
  12655. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  12656. }
  12657. onConstruct() {
  12658. this.n19 = (this.getChild("n19"));
  12659. this.n18 = (this.getChild("n18"));
  12660. this.n0 = (this.getChild("n0"));
  12661. this.n3 = (this.getChild("n3"));
  12662. this.n4 = (this.getChild("n4"));
  12663. this.n5 = (this.getChild("n5"));
  12664. this.n6 = (this.getChild("n6"));
  12665. this.n8 = (this.getChild("n8"));
  12666. this.n9 = (this.getChild("n9"));
  12667. this.n10 = (this.getChild("n10"));
  12668. this.n11 = (this.getChild("n11"));
  12669. this.n12 = (this.getChild("n12"));
  12670. this.n13 = (this.getChild("n13"));
  12671. this.n14 = (this.getChild("n14"));
  12672. this.n15 = (this.getChild("n15"));
  12673. this.n20 = (this.getChild("n20"));
  12674. this.t0 = this.getTransition("t0");
  12675. this.t1 = this.getTransition("t1");
  12676. }
  12677. }
  12678. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  12679. class ui_dh_js_tw_g extends fgui.GComponent {
  12680. static createInstance() {
  12681. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  12682. }
  12683. onConstruct() {
  12684. this.n0 = (this.getChild("n0"));
  12685. this.n1 = (this.getChild("n1"));
  12686. this.t0 = this.getTransition("t0");
  12687. }
  12688. }
  12689. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  12690. class ui_dh_js_xingxing extends fgui.GComponent {
  12691. static createInstance() {
  12692. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  12693. }
  12694. onConstruct() {
  12695. this.n1 = (this.getChild("n1"));
  12696. this.n2 = (this.getChild("n2"));
  12697. this.n3 = (this.getChild("n3"));
  12698. this.n4 = (this.getChild("n4"));
  12699. this.n0 = (this.getChild("n0"));
  12700. this.t2 = this.getTransition("t2");
  12701. this.t1 = this.getTransition("t1");
  12702. }
  12703. }
  12704. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  12705. class ui_dh_zy_jiazai extends fgui.GComponent {
  12706. static createInstance() {
  12707. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  12708. }
  12709. onConstruct() {
  12710. this.c1 = this.getController("c1");
  12711. this.n0 = (this.getChild("n0"));
  12712. this.n1 = (this.getChild("n1"));
  12713. this.n2 = (this.getChild("n2"));
  12714. this.n4 = (this.getChild("n4"));
  12715. this.n5 = (this.getChild("n5"));
  12716. this.n6 = (this.getChild("n6"));
  12717. this.n8 = (this.getChild("n8"));
  12718. this.n7 = (this.getChild("n7"));
  12719. this.t0 = this.getTransition("t0");
  12720. }
  12721. }
  12722. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  12723. class ui_dh_js_xingxing2 extends fgui.GComponent {
  12724. static createInstance() {
  12725. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  12726. }
  12727. onConstruct() {
  12728. this.c1 = this.getController("c1");
  12729. this.n3 = (this.getChild("n3"));
  12730. this.n5 = (this.getChild("n5"));
  12731. this.n4 = (this.getChild("n4"));
  12732. this.n0 = (this.getChild("n0"));
  12733. this.n1 = (this.getChild("n1"));
  12734. this.n2 = (this.getChild("n2"));
  12735. }
  12736. }
  12737. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  12738. class ui_dh_js_tuowei2 extends fgui.GComponent {
  12739. static createInstance() {
  12740. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  12741. }
  12742. onConstruct() {
  12743. this.n19 = (this.getChild("n19"));
  12744. this.n21 = (this.getChild("n21"));
  12745. this.n0 = (this.getChild("n0"));
  12746. this.n3 = (this.getChild("n3"));
  12747. this.n4 = (this.getChild("n4"));
  12748. this.n5 = (this.getChild("n5"));
  12749. this.n6 = (this.getChild("n6"));
  12750. this.n8 = (this.getChild("n8"));
  12751. this.n9 = (this.getChild("n9"));
  12752. this.n10 = (this.getChild("n10"));
  12753. this.n11 = (this.getChild("n11"));
  12754. this.n12 = (this.getChild("n12"));
  12755. this.n13 = (this.getChild("n13"));
  12756. this.n14 = (this.getChild("n14"));
  12757. this.n15 = (this.getChild("n15"));
  12758. this.n23 = (this.getChild("n23"));
  12759. this.t0 = this.getTransition("t0");
  12760. this.t1 = this.getTransition("t1");
  12761. }
  12762. }
  12763. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  12764. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  12765. static createInstance() {
  12766. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  12767. }
  12768. onConstruct() {
  12769. this.n1 = (this.getChild("n1"));
  12770. this.n2 = (this.getChild("n2"));
  12771. this.t0 = this.getTransition("t0");
  12772. }
  12773. }
  12774. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  12775. class ui_dh_js_shibai_1 extends fgui.GComponent {
  12776. static createInstance() {
  12777. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  12778. }
  12779. onConstruct() {
  12780. this.n4 = (this.getChild("n4"));
  12781. this.n2 = (this.getChild("n2"));
  12782. this.n3 = (this.getChild("n3"));
  12783. this.idle = this.getTransition("idle");
  12784. this.attack = this.getTransition("attack");
  12785. }
  12786. }
  12787. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  12788. class ui_special extends fgui.GComponent {
  12789. static createInstance() {
  12790. return (fgui.UIPackage.createObject("game", "special"));
  12791. }
  12792. onConstruct() {
  12793. this.n18 = (this.getChild("n18"));
  12794. this.n19 = (this.getChild("n19"));
  12795. this.n20 = (this.getChild("n20"));
  12796. this.n21 = (this.getChild("n21"));
  12797. this.n22 = (this.getChild("n22"));
  12798. this.levelTxt = (this.getChild("levelTxt"));
  12799. this.n24 = (this.getChild("n24"));
  12800. this.n25 = (this.getChild("n25"));
  12801. this.t0 = this.getTransition("t0");
  12802. }
  12803. }
  12804. ui_special.URL = "ui://isxx5ak7j979v4i6";
  12805. class ui_Component145 extends fgui.GComponent {
  12806. static createInstance() {
  12807. return (fgui.UIPackage.createObject("game", "Component145"));
  12808. }
  12809. onConstruct() {
  12810. this.guanyuNode = (this.getChild("guanyuNode"));
  12811. }
  12812. }
  12813. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  12814. class ui_longBtn extends fgui.GButton {
  12815. static createInstance() {
  12816. return (fgui.UIPackage.createObject("game", "longBtn"));
  12817. }
  12818. onConstruct() {
  12819. this.c1 = this.getController("c1");
  12820. this.n2 = (this.getChild("n2"));
  12821. this.n1 = (this.getChild("n1"));
  12822. this.n4 = (this.getChild("n4"));
  12823. }
  12824. }
  12825. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  12826. class ui_Component146 extends fgui.GComponent {
  12827. static createInstance() {
  12828. return (fgui.UIPackage.createObject("game", "Component146"));
  12829. }
  12830. onConstruct() {
  12831. this.n89 = (this.getChild("n89"));
  12832. this.n90 = (this.getChild("n90"));
  12833. this.guideBtn = (this.getChild("guideBtn"));
  12834. }
  12835. }
  12836. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  12837. class ui_Component146_11 extends fgui.GComponent {
  12838. static createInstance() {
  12839. return (fgui.UIPackage.createObject("game", "Component146_11"));
  12840. }
  12841. onConstruct() {
  12842. this.n89 = (this.getChild("n89"));
  12843. this.n90 = (this.getChild("n90"));
  12844. this.guideBtn = (this.getChild("guideBtn"));
  12845. }
  12846. }
  12847. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  12848. class ui_Component111_1 extends fgui.GComponent {
  12849. static createInstance() {
  12850. return (fgui.UIPackage.createObject("game", "Component111_1"));
  12851. }
  12852. onConstruct() {
  12853. this.n68 = (this.getChild("n68"));
  12854. this.myMask = (this.getChild("myMask"));
  12855. }
  12856. }
  12857. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  12858. class ui_Component64_1 extends fgui.GComponent {
  12859. static createInstance() {
  12860. return (fgui.UIPackage.createObject("game", "Component64_1"));
  12861. }
  12862. onConstruct() {
  12863. this.n57 = (this.getChild("n57"));
  12864. this.n54 = (this.getChild("n54"));
  12865. this.n55 = (this.getChild("n55"));
  12866. this.n56 = (this.getChild("n56"));
  12867. this.t1 = this.getTransition("t1");
  12868. }
  12869. }
  12870. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  12871. class ui_ModeSelection_com123 extends fgui.GComponent {
  12872. static createInstance() {
  12873. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  12874. }
  12875. onConstruct() {
  12876. this.type1 = (this.getChild("type1"));
  12877. this.type2 = (this.getChild("type2"));
  12878. this.type3 = (this.getChild("type3"));
  12879. this.n38 = (this.getChild("n38"));
  12880. this.t0 = this.getTransition("t0");
  12881. }
  12882. }
  12883. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  12884. class ui_Component132_2 extends fgui.GComponent {
  12885. static createInstance() {
  12886. return (fgui.UIPackage.createObject("game", "Component132_2"));
  12887. }
  12888. onConstruct() {
  12889. this.n25 = (this.getChild("n25"));
  12890. this.n26 = (this.getChild("n26"));
  12891. this.n27 = (this.getChild("n27"));
  12892. this.t0 = this.getTransition("t0");
  12893. }
  12894. }
  12895. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  12896. class ui_UIPower$1 extends fgui.GComponent {
  12897. static createInstance() {
  12898. return (fgui.UIPackage.createObject("game", "UIPower"));
  12899. }
  12900. onConstruct() {
  12901. this.n11 = (this.getChild("n11"));
  12902. this.myNode = (this.getChild("myNode"));
  12903. this.t0 = this.getTransition("t0");
  12904. }
  12905. }
  12906. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  12907. class ui_Component133 extends fgui.GComponent {
  12908. static createInstance() {
  12909. return (fgui.UIPackage.createObject("game", "Component133"));
  12910. }
  12911. onConstruct() {
  12912. this.n29 = (this.getChild("n29"));
  12913. this.n30 = (this.getChild("n30"));
  12914. }
  12915. }
  12916. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  12917. class ui_Component134 extends fgui.GComponent {
  12918. static createInstance() {
  12919. return (fgui.UIPackage.createObject("game", "Component134"));
  12920. }
  12921. onConstruct() {
  12922. this.n30 = (this.getChild("n30"));
  12923. this.n31 = (this.getChild("n31"));
  12924. this.t0 = this.getTransition("t0");
  12925. }
  12926. }
  12927. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  12928. class ui_Component135 extends fgui.GComponent {
  12929. static createInstance() {
  12930. return (fgui.UIPackage.createObject("game", "Component135"));
  12931. }
  12932. onConstruct() {
  12933. this.n30 = (this.getChild("n30"));
  12934. this.t0 = this.getTransition("t0");
  12935. }
  12936. }
  12937. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  12938. class ui_Component137 extends fgui.GComponent {
  12939. static createInstance() {
  12940. return (fgui.UIPackage.createObject("game", "Component137"));
  12941. }
  12942. onConstruct() {
  12943. this.n28 = (this.getChild("n28"));
  12944. this.n29 = (this.getChild("n29"));
  12945. this.n30 = (this.getChild("n30"));
  12946. this.n32 = (this.getChild("n32"));
  12947. }
  12948. }
  12949. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  12950. class ui_dh_zuanshi extends fgui.GButton {
  12951. static createInstance() {
  12952. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  12953. }
  12954. onConstruct() {
  12955. this.n1 = (this.getChild("n1"));
  12956. this.n2 = (this.getChild("n2"));
  12957. this.n0 = (this.getChild("n0"));
  12958. this.n3 = (this.getChild("n3"));
  12959. this.n4 = (this.getChild("n4"));
  12960. }
  12961. }
  12962. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  12963. class ui_Component138 extends fgui.GComponent {
  12964. static createInstance() {
  12965. return (fgui.UIPackage.createObject("game", "Component138"));
  12966. }
  12967. onConstruct() {
  12968. this.n1 = (this.getChild("n1"));
  12969. this.n2 = (this.getChild("n2"));
  12970. this.t0 = this.getTransition("t0");
  12971. }
  12972. }
  12973. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  12974. class ui_Component139 extends fgui.GComponent {
  12975. static createInstance() {
  12976. return (fgui.UIPackage.createObject("game", "Component139"));
  12977. }
  12978. onConstruct() {
  12979. this.n0 = (this.getChild("n0"));
  12980. this.t0 = this.getTransition("t0");
  12981. }
  12982. }
  12983. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  12984. class ui_Component140 extends fgui.GComponent {
  12985. static createInstance() {
  12986. return (fgui.UIPackage.createObject("game", "Component140"));
  12987. }
  12988. onConstruct() {
  12989. this.n2 = (this.getChild("n2"));
  12990. this.n3 = (this.getChild("n3"));
  12991. this.t0 = this.getTransition("t0");
  12992. }
  12993. }
  12994. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  12995. class ui_Component141 extends fgui.GComponent {
  12996. static createInstance() {
  12997. return (fgui.UIPackage.createObject("game", "Component141"));
  12998. }
  12999. onConstruct() {
  13000. this.n0 = (this.getChild("n0"));
  13001. this.t0 = this.getTransition("t0");
  13002. }
  13003. }
  13004. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  13005. class ui_powerNode extends fgui.GProgressBar {
  13006. static createInstance() {
  13007. return (fgui.UIPackage.createObject("game", "powerNode"));
  13008. }
  13009. onConstruct() {
  13010. this.n2 = (this.getChild("n2"));
  13011. this.bar_v = (this.getChild("bar_v"));
  13012. this.showImg = (this.getChild("showImg"));
  13013. this.n12 = (this.getChild("n12"));
  13014. }
  13015. }
  13016. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  13017. class ui_dh_jingbi1 extends fgui.GComponent {
  13018. static createInstance() {
  13019. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  13020. }
  13021. onConstruct() {
  13022. this.n0 = (this.getChild("n0"));
  13023. this.n1 = (this.getChild("n1"));
  13024. this.n2 = (this.getChild("n2"));
  13025. this.n3 = (this.getChild("n3"));
  13026. this.n4 = (this.getChild("n4"));
  13027. this.n5 = (this.getChild("n5"));
  13028. this.n6 = (this.getChild("n6"));
  13029. this.n8 = (this.getChild("n8"));
  13030. this.t0 = this.getTransition("t0");
  13031. }
  13032. }
  13033. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  13034. class ui_Component94 extends fgui.GButton {
  13035. static createInstance() {
  13036. return (fgui.UIPackage.createObject("game", "Component94"));
  13037. }
  13038. onConstruct() {
  13039. this.n77 = (this.getChild("n77"));
  13040. }
  13041. }
  13042. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  13043. class ui_Component95 extends fgui.GButton {
  13044. static createInstance() {
  13045. return (fgui.UIPackage.createObject("game", "Component95"));
  13046. }
  13047. onConstruct() {
  13048. this.n77 = (this.getChild("n77"));
  13049. }
  13050. }
  13051. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  13052. class ui_Component126 extends fgui.GComponent {
  13053. static createInstance() {
  13054. return (fgui.UIPackage.createObject("game", "Component126"));
  13055. }
  13056. onConstruct() {
  13057. this.c1 = this.getController("c1");
  13058. this.normalBtn = (this.getChild("normalBtn"));
  13059. this.tripleBtn = (this.getChild("tripleBtn"));
  13060. }
  13061. }
  13062. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  13063. class ui_Component60 extends fgui.GComponent {
  13064. static createInstance() {
  13065. return (fgui.UIPackage.createObject("game", "Component60"));
  13066. }
  13067. onConstruct() {
  13068. this.c1 = this.getController("c1");
  13069. this.n48 = (this.getChild("n48"));
  13070. this.womanTxt = (this.getChild("womanTxt"));
  13071. this.t0 = this.getTransition("t0");
  13072. }
  13073. }
  13074. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  13075. class ui_Component98_3 extends fgui.GButton {
  13076. static createInstance() {
  13077. return (fgui.UIPackage.createObject("game", "Component98_3"));
  13078. }
  13079. onConstruct() {
  13080. this.c1 = this.getController("c1");
  13081. this.n8 = (this.getChild("n8"));
  13082. this.n41 = (this.getChild("n41"));
  13083. this.n40 = (this.getChild("n40"));
  13084. }
  13085. }
  13086. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  13087. class ui_ModeSelection_com1 extends fgui.GButton {
  13088. static createInstance() {
  13089. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  13090. }
  13091. onConstruct() {
  13092. this.n34 = (this.getChild("n34"));
  13093. this.n36 = (this.getChild("n36"));
  13094. this.n22 = (this.getChild("n22"));
  13095. this.n20 = (this.getChild("n20"));
  13096. this.n23 = (this.getChild("n23"));
  13097. this.n24 = (this.getChild("n24"));
  13098. this.n26 = (this.getChild("n26"));
  13099. this.n33 = (this.getChild("n33"));
  13100. this.coinImg = (this.getChild("coinImg"));
  13101. this.need = (this.getChild("need"));
  13102. this.n35 = (this.getChild("n35"));
  13103. this.n29 = (this.getChild("n29"));
  13104. this.tipsTxt = (this.getChild("tipsTxt"));
  13105. this.n30 = (this.getChild("n30"));
  13106. this.peopleTxt = (this.getChild("peopleTxt"));
  13107. this.t0 = this.getTransition("t0");
  13108. }
  13109. }
  13110. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  13111. class ui_ModeSelection_com2 extends fgui.GButton {
  13112. static createInstance() {
  13113. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  13114. }
  13115. onConstruct() {
  13116. this.n36 = (this.getChild("n36"));
  13117. this.n34 = (this.getChild("n34"));
  13118. this.n22 = (this.getChild("n22"));
  13119. this.n20 = (this.getChild("n20"));
  13120. this.n23 = (this.getChild("n23"));
  13121. this.n24 = (this.getChild("n24"));
  13122. this.n26 = (this.getChild("n26"));
  13123. this.n33 = (this.getChild("n33"));
  13124. this.coinImg = (this.getChild("coinImg"));
  13125. this.need = (this.getChild("need"));
  13126. this.n35 = (this.getChild("n35"));
  13127. this.n29 = (this.getChild("n29"));
  13128. this.tipsTxt = (this.getChild("tipsTxt"));
  13129. this.n30 = (this.getChild("n30"));
  13130. this.peopleTxt = (this.getChild("peopleTxt"));
  13131. this.t0 = this.getTransition("t0");
  13132. }
  13133. }
  13134. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  13135. class ui_ModeSelection_com3 extends fgui.GButton {
  13136. static createInstance() {
  13137. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  13138. }
  13139. onConstruct() {
  13140. this.n34 = (this.getChild("n34"));
  13141. this.n36 = (this.getChild("n36"));
  13142. this.n22 = (this.getChild("n22"));
  13143. this.n20 = (this.getChild("n20"));
  13144. this.n23 = (this.getChild("n23"));
  13145. this.n24 = (this.getChild("n24"));
  13146. this.n26 = (this.getChild("n26"));
  13147. this.n33 = (this.getChild("n33"));
  13148. this.coinImg = (this.getChild("coinImg"));
  13149. this.need = (this.getChild("need"));
  13150. this.n35 = (this.getChild("n35"));
  13151. this.n29 = (this.getChild("n29"));
  13152. this.tipsTxt = (this.getChild("tipsTxt"));
  13153. this.n30 = (this.getChild("n30"));
  13154. this.peopleTxt = (this.getChild("peopleTxt"));
  13155. this.t0 = this.getTransition("t0");
  13156. }
  13157. }
  13158. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  13159. class ui_Invitation_com1 extends fgui.GComponent {
  13160. static createInstance() {
  13161. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  13162. }
  13163. onConstruct() {
  13164. this.n14 = (this.getChild("n14"));
  13165. this.n13 = (this.getChild("n13"));
  13166. this.n3 = (this.getChild("n3"));
  13167. this.n1 = (this.getChild("n1"));
  13168. this.n6 = (this.getChild("n6"));
  13169. this.n7 = (this.getChild("n7"));
  13170. this.enterBtn = (this.getChild("enterBtn"));
  13171. this.n11 = (this.getChild("n11"));
  13172. this.n12 = (this.getChild("n12"));
  13173. this.n15 = (this.getChild("n15"));
  13174. this.t0 = this.getTransition("t0");
  13175. this.t1 = this.getTransition("t1");
  13176. }
  13177. }
  13178. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  13179. class ui_Component87_1 extends fgui.GComponent {
  13180. static createInstance() {
  13181. return (fgui.UIPackage.createObject("game", "Component87_1"));
  13182. }
  13183. onConstruct() {
  13184. this.n74 = (this.getChild("n74"));
  13185. this.n73 = (this.getChild("n73"));
  13186. this.ballTxt = (this.getChild("ballTxt"));
  13187. this.n76 = (this.getChild("n76"));
  13188. this.helpLineBtn = (this.getChild("helpLineBtn"));
  13189. this.levelTxt = (this.getChild("levelTxt"));
  13190. this.n87 = (this.getChild("n87"));
  13191. this.n84 = (this.getChild("n84"));
  13192. this.hpTxt = (this.getChild("hpTxt"));
  13193. this.n89 = (this.getChild("n89"));
  13194. this.tipsTxt = (this.getChild("tipsTxt"));
  13195. }
  13196. }
  13197. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  13198. class ui_sqg1 extends fgui.GComponent {
  13199. static createInstance() {
  13200. return (fgui.UIPackage.createObject("game", "sqg1"));
  13201. }
  13202. onConstruct() {
  13203. this.n1 = (this.getChild("n1"));
  13204. this.n0 = (this.getChild("n0"));
  13205. }
  13206. }
  13207. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  13208. class ui_sqg2 extends fgui.GComponent {
  13209. static createInstance() {
  13210. return (fgui.UIPackage.createObject("game", "sqg2"));
  13211. }
  13212. onConstruct() {
  13213. this.n1 = (this.getChild("n1"));
  13214. this.n0 = (this.getChild("n0"));
  13215. }
  13216. }
  13217. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  13218. class ui_sqg3 extends fgui.GComponent {
  13219. static createInstance() {
  13220. return (fgui.UIPackage.createObject("game", "sqg3"));
  13221. }
  13222. onConstruct() {
  13223. this.n1 = (this.getChild("n1"));
  13224. this.n0 = (this.getChild("n0"));
  13225. }
  13226. }
  13227. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  13228. class ui_sqg4 extends fgui.GComponent {
  13229. static createInstance() {
  13230. return (fgui.UIPackage.createObject("game", "sqg4"));
  13231. }
  13232. onConstruct() {
  13233. this.n1 = (this.getChild("n1"));
  13234. this.n0 = (this.getChild("n0"));
  13235. }
  13236. }
  13237. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  13238. class ui_Component36 extends fgui.GButton {
  13239. static createInstance() {
  13240. return (fgui.UIPackage.createObject("game", "Component36"));
  13241. }
  13242. onConstruct() {
  13243. this.c1 = this.getController("c1");
  13244. this.n53 = (this.getChild("n53"));
  13245. this.n56 = (this.getChild("n56"));
  13246. }
  13247. }
  13248. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  13249. class ui_Component37 extends fgui.GButton {
  13250. static createInstance() {
  13251. return (fgui.UIPackage.createObject("game", "Component37"));
  13252. }
  13253. onConstruct() {
  13254. this.c1 = this.getController("c1");
  13255. this.n52 = (this.getChild("n52"));
  13256. this.n54 = (this.getChild("n54"));
  13257. }
  13258. }
  13259. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  13260. class ui_UISetting extends fgui.GComponent {
  13261. static createInstance() {
  13262. return (fgui.UIPackage.createObject("game", "UISetting"));
  13263. }
  13264. onConstruct() {
  13265. this.c1 = this.getController("c1");
  13266. this.n4 = (this.getChild("n4"));
  13267. this.soundBtn = (this.getChild("soundBtn"));
  13268. this.shakeBtn = (this.getChild("shakeBtn"));
  13269. this.clickNode = (this.getChild("clickNode"));
  13270. this.xyBtn = (this.getChild("xyBtn"));
  13271. }
  13272. }
  13273. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  13274. class ui_Component39 extends fgui.GComponent {
  13275. static createInstance() {
  13276. return (fgui.UIPackage.createObject("game", "Component39"));
  13277. }
  13278. onConstruct() {
  13279. this.n5 = (this.getChild("n5"));
  13280. this.n6 = (this.getChild("n6"));
  13281. this.n7 = (this.getChild("n7"));
  13282. this.t0 = this.getTransition("t0");
  13283. }
  13284. }
  13285. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  13286. class ui_Component40 extends fgui.GButton {
  13287. static createInstance() {
  13288. return (fgui.UIPackage.createObject("game", "Component40"));
  13289. }
  13290. onConstruct() {
  13291. this.n46 = (this.getChild("n46"));
  13292. this.n47 = (this.getChild("n47"));
  13293. }
  13294. }
  13295. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  13296. class ui_Component41 extends fgui.GComponent {
  13297. static createInstance() {
  13298. return (fgui.UIPackage.createObject("game", "Component41"));
  13299. }
  13300. onConstruct() {
  13301. this.c1 = this.getController("c1");
  13302. this.n0 = (this.getChild("n0"));
  13303. this.titleTxt = (this.getChild("titleTxt"));
  13304. this.n2 = (this.getChild("n2"));
  13305. this.msgTips = (this.getChild("msgTips"));
  13306. this.numTxt = (this.getChild("numTxt"));
  13307. this.n18 = (this.getChild("n18"));
  13308. this.cancelBtn = (this.getChild("cancelBtn"));
  13309. this.videoBtn = (this.getChild("videoBtn"));
  13310. this.n10 = (this.getChild("n10"));
  13311. }
  13312. }
  13313. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  13314. class ui_Component42 extends fgui.GComponent {
  13315. static createInstance() {
  13316. return (fgui.UIPackage.createObject("game", "Component42"));
  13317. }
  13318. onConstruct() {
  13319. this.c1 = this.getController("c1");
  13320. this.n1 = (this.getChild("n1"));
  13321. this.n2 = (this.getChild("n2"));
  13322. this.n3 = (this.getChild("n3"));
  13323. this.tipsTxt = (this.getChild("tipsTxt"));
  13324. this.cancelBtn = (this.getChild("cancelBtn"));
  13325. this.sureBtn = (this.getChild("sureBtn"));
  13326. this.n11 = (this.getChild("n11"));
  13327. this.n13 = (this.getChild("n13"));
  13328. this.n14 = (this.getChild("n14"));
  13329. this.womanTxt = (this.getChild("womanTxt"));
  13330. this.t0 = this.getTransition("t0");
  13331. }
  13332. }
  13333. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  13334. class ui_dh_js_shengli extends fgui.GComponent {
  13335. static createInstance() {
  13336. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  13337. }
  13338. onConstruct() {
  13339. this.n3 = (this.getChild("n3"));
  13340. this.n4 = (this.getChild("n4"));
  13341. this.n1 = (this.getChild("n1"));
  13342. this.n2 = (this.getChild("n2"));
  13343. this.n5 = (this.getChild("n5"));
  13344. this.n6 = (this.getChild("n6"));
  13345. this.n7 = (this.getChild("n7"));
  13346. this.n8 = (this.getChild("n8"));
  13347. this.attack = this.getTransition("attack");
  13348. this.idle = this.getTransition("idle");
  13349. }
  13350. }
  13351. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  13352. class ui_dh_js_shengli_g extends fgui.GComponent {
  13353. static createInstance() {
  13354. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  13355. }
  13356. onConstruct() {
  13357. this.n3 = (this.getChild("n3"));
  13358. this.n1 = (this.getChild("n1"));
  13359. this.t0 = this.getTransition("t0");
  13360. }
  13361. }
  13362. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  13363. class ui_dh_js_shibai extends fgui.GComponent {
  13364. static createInstance() {
  13365. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  13366. }
  13367. onConstruct() {
  13368. this.n0 = (this.getChild("n0"));
  13369. this.n1 = (this.getChild("n1"));
  13370. this.n2 = (this.getChild("n2"));
  13371. this.n3 = (this.getChild("n3"));
  13372. this.idle = this.getTransition("idle");
  13373. this.attack = this.getTransition("attack");
  13374. }
  13375. }
  13376. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  13377. class ui_dh_zy_ganfa extends fgui.GButton {
  13378. static createInstance() {
  13379. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  13380. }
  13381. onConstruct() {
  13382. this.n0 = (this.getChild("n0"));
  13383. }
  13384. }
  13385. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  13386. class ui_dh_zy_sc_guang extends fgui.GButton {
  13387. static createInstance() {
  13388. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  13389. }
  13390. onConstruct() {
  13391. this.n0 = (this.getChild("n0"));
  13392. this.n2 = (this.getChild("n2"));
  13393. }
  13394. }
  13395. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  13396. class ui_dh_zy_shangcheng extends fgui.GComponent {
  13397. static createInstance() {
  13398. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  13399. }
  13400. onConstruct() {
  13401. this.n0 = (this.getChild("n0"));
  13402. this.n3 = (this.getChild("n3"));
  13403. this.t0 = this.getTransition("t0");
  13404. }
  13405. }
  13406. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  13407. class ui_dh_zy_wanfa extends fgui.GButton {
  13408. static createInstance() {
  13409. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  13410. }
  13411. onConstruct() {
  13412. this.n0 = (this.getChild("n0"));
  13413. }
  13414. }
  13415. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  13416. class ui_Component53_1 extends fgui.GComponent {
  13417. static createInstance() {
  13418. return (fgui.UIPackage.createObject("game", "Component53_1"));
  13419. }
  13420. onConstruct() {
  13421. this.n0 = (this.getChild("n0"));
  13422. this.n1 = (this.getChild("n1"));
  13423. this.n2 = (this.getChild("n2"));
  13424. this.n3 = (this.getChild("n3"));
  13425. this.n4 = (this.getChild("n4"));
  13426. this.n5 = (this.getChild("n5"));
  13427. this.n6 = (this.getChild("n6"));
  13428. this.n7 = (this.getChild("n7"));
  13429. this.n8 = (this.getChild("n8"));
  13430. this.n9 = (this.getChild("n9"));
  13431. this.n10 = (this.getChild("n10"));
  13432. this.n11 = (this.getChild("n11"));
  13433. this.n12 = (this.getChild("n12"));
  13434. this.n13 = (this.getChild("n13"));
  13435. this.n14 = (this.getChild("n14"));
  13436. this.n15 = (this.getChild("n15"));
  13437. this.n16 = (this.getChild("n16"));
  13438. this.n19 = (this.getChild("n19"));
  13439. this.n20 = (this.getChild("n20"));
  13440. this.n21 = (this.getChild("n21"));
  13441. this.n22 = (this.getChild("n22"));
  13442. this.n23 = (this.getChild("n23"));
  13443. this.n24 = (this.getChild("n24"));
  13444. this.n25 = (this.getChild("n25"));
  13445. this.n26 = (this.getChild("n26"));
  13446. this.n27 = (this.getChild("n27"));
  13447. this.n28 = (this.getChild("n28"));
  13448. this.n29 = (this.getChild("n29"));
  13449. this.n30 = (this.getChild("n30"));
  13450. this.n31 = (this.getChild("n31"));
  13451. this.n32 = (this.getChild("n32"));
  13452. this.n33 = (this.getChild("n33"));
  13453. this.n34 = (this.getChild("n34"));
  13454. this.n35 = (this.getChild("n35"));
  13455. this.t0 = this.getTransition("t0");
  13456. }
  13457. }
  13458. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  13459. class ui_Component30 extends fgui.GComponent {
  13460. static createInstance() {
  13461. return (fgui.UIPackage.createObject("game", "Component30"));
  13462. }
  13463. onConstruct() {
  13464. this.c1 = this.getController("c1");
  13465. this.n46 = (this.getChild("n46"));
  13466. this.n47 = (this.getChild("n47"));
  13467. this.numTxt = (this.getChild("numTxt"));
  13468. this.n50 = (this.getChild("n50"));
  13469. this.n53 = (this.getChild("n53"));
  13470. this.n54 = (this.getChild("n54"));
  13471. this.n55 = (this.getChild("n55"));
  13472. this.n56 = (this.getChild("n56"));
  13473. }
  13474. }
  13475. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  13476. class ui_Component30_1 extends fgui.GComponent {
  13477. static createInstance() {
  13478. return (fgui.UIPackage.createObject("game", "Component30_1"));
  13479. }
  13480. onConstruct() {
  13481. this.c1 = this.getController("c1");
  13482. this.n46 = (this.getChild("n46"));
  13483. this.n47 = (this.getChild("n47"));
  13484. this.numTxt = (this.getChild("numTxt"));
  13485. this.n50 = (this.getChild("n50"));
  13486. this.n51 = (this.getChild("n51"));
  13487. this.n52 = (this.getChild("n52"));
  13488. this.n53 = (this.getChild("n53"));
  13489. this.n54 = (this.getChild("n54"));
  13490. }
  13491. }
  13492. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  13493. class ui_Component31 extends fgui.GComponent {
  13494. static createInstance() {
  13495. return (fgui.UIPackage.createObject("game", "Component31"));
  13496. }
  13497. onConstruct() {
  13498. this.n55 = (this.getChild("n55"));
  13499. this.n54 = (this.getChild("n54"));
  13500. this.conditionTxt = (this.getChild("conditionTxt"));
  13501. this.n57 = (this.getChild("n57"));
  13502. this.t0 = this.getTransition("t0");
  13503. }
  13504. }
  13505. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  13506. class ui_Component32 extends fgui.GComponent {
  13507. static createInstance() {
  13508. return (fgui.UIPackage.createObject("game", "Component32"));
  13509. }
  13510. onConstruct() {
  13511. this.n5 = (this.getChild("n5"));
  13512. this.n6 = (this.getChild("n6"));
  13513. this.n7 = (this.getChild("n7"));
  13514. this.t0 = this.getTransition("t0");
  13515. }
  13516. }
  13517. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  13518. class ui_AwardItem extends fgui.GComponent {
  13519. static createInstance() {
  13520. return (fgui.UIPackage.createObject("game", "AwardItem"));
  13521. }
  13522. onConstruct() {
  13523. this.n9 = (this.getChild("n9"));
  13524. this.myIcon = (this.getChild("myIcon"));
  13525. this.numTxt = (this.getChild("numTxt"));
  13526. this.nameTxt = (this.getChild("nameTxt"));
  13527. this.n16 = (this.getChild("n16"));
  13528. this.n17 = (this.getChild("n17"));
  13529. }
  13530. }
  13531. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  13532. class ui_ranking_com1 extends fgui.GButton {
  13533. static createInstance() {
  13534. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  13535. }
  13536. onConstruct() {
  13537. this.c1 = this.getController("c1");
  13538. this.n49 = (this.getChild("n49"));
  13539. this.n18 = (this.getChild("n18"));
  13540. this.n46 = (this.getChild("n46"));
  13541. this.n48 = (this.getChild("n48"));
  13542. this.n50 = (this.getChild("n50"));
  13543. }
  13544. }
  13545. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  13546. class ui_ranking_com2 extends fgui.GButton {
  13547. static createInstance() {
  13548. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  13549. }
  13550. onConstruct() {
  13551. this.c1 = this.getController("c1");
  13552. this.n49 = (this.getChild("n49"));
  13553. this.n18 = (this.getChild("n18"));
  13554. this.n46 = (this.getChild("n46"));
  13555. this.n48 = (this.getChild("n48"));
  13556. this.n50 = (this.getChild("n50"));
  13557. }
  13558. }
  13559. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  13560. class ui_ranking_com3 extends fgui.GComponent {
  13561. static createInstance() {
  13562. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  13563. }
  13564. onConstruct() {
  13565. this.n17 = (this.getChild("n17"));
  13566. this.myIcon = (this.getChild("myIcon"));
  13567. }
  13568. }
  13569. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  13570. class ui_ranking_com4 extends fgui.GComponent {
  13571. static createInstance() {
  13572. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  13573. }
  13574. onConstruct() {
  13575. this.n16 = (this.getChild("n16"));
  13576. this.head = (this.getChild("head"));
  13577. }
  13578. }
  13579. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  13580. class ui_ranking_com5 extends fgui.GComponent {
  13581. static createInstance() {
  13582. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  13583. }
  13584. onConstruct() {
  13585. this.c1 = this.getController("c1");
  13586. this.c2 = this.getController("c2");
  13587. this.n2 = (this.getChild("n2"));
  13588. this.n3 = (this.getChild("n3"));
  13589. this.levelBtn = (this.getChild("levelBtn"));
  13590. this.starBtn = (this.getChild("starBtn"));
  13591. this.n23 = (this.getChild("n23"));
  13592. this.n24 = (this.getChild("n24"));
  13593. this.n25 = (this.getChild("n25"));
  13594. this.myList = (this.getChild("myList"));
  13595. this.selfNode = (this.getChild("selfNode"));
  13596. this.n9 = (this.getChild("n9"));
  13597. this.n12 = (this.getChild("n12"));
  13598. this.n13 = (this.getChild("n13"));
  13599. this.n14 = (this.getChild("n14"));
  13600. this.n39 = (this.getChild("n39"));
  13601. this.n41 = (this.getChild("n41"));
  13602. this.n42 = (this.getChild("n42"));
  13603. this.n45 = (this.getChild("n45"));
  13604. this.changeBtn = (this.getChild("changeBtn"));
  13605. this.closeBtn = (this.getChild("closeBtn"));
  13606. this.t0 = this.getTransition("t0");
  13607. }
  13608. }
  13609. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  13610. class ui_RankItem extends fgui.GComponent {
  13611. static createInstance() {
  13612. return (fgui.UIPackage.createObject("game", "RankItem"));
  13613. }
  13614. onConstruct() {
  13615. this.n10 = (this.getChild("n10"));
  13616. this.n11 = (this.getChild("n11"));
  13617. this.rankTxt = (this.getChild("rankTxt"));
  13618. this.headNode = (this.getChild("headNode"));
  13619. this.nameTxt = (this.getChild("nameTxt"));
  13620. this.n19 = (this.getChild("n19"));
  13621. this.valueTxt = (this.getChild("valueTxt"));
  13622. this.img1 = (this.getChild("img1"));
  13623. this.img2 = (this.getChild("img2"));
  13624. this.img3 = (this.getChild("img3"));
  13625. }
  13626. }
  13627. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  13628. class ui_ranking_com9 extends fgui.GComponent {
  13629. static createInstance() {
  13630. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  13631. }
  13632. onConstruct() {
  13633. this.c1 = this.getController("c1");
  13634. this.n27 = (this.getChild("n27"));
  13635. this.n28 = (this.getChild("n28"));
  13636. this.headNode = (this.getChild("headNode"));
  13637. this.rankTxt = (this.getChild("rankTxt"));
  13638. this.nameTxt = (this.getChild("nameTxt"));
  13639. this.n34 = (this.getChild("n34"));
  13640. this.valueTxt = (this.getChild("valueTxt"));
  13641. this.n36 = (this.getChild("n36"));
  13642. this.n37 = (this.getChild("n37"));
  13643. this.n38 = (this.getChild("n38"));
  13644. this.n39 = (this.getChild("n39"));
  13645. this.n40 = (this.getChild("n40"));
  13646. }
  13647. }
  13648. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  13649. class ui_ranking_com10 extends fgui.GComponent {
  13650. static createInstance() {
  13651. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  13652. }
  13653. onConstruct() {
  13654. this.n23 = (this.getChild("n23"));
  13655. this.n24 = (this.getChild("n24"));
  13656. }
  13657. }
  13658. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  13659. class ui_ranking_com11 extends fgui.GComponent {
  13660. static createInstance() {
  13661. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  13662. }
  13663. onConstruct() {
  13664. this.n24 = (this.getChild("n24"));
  13665. this.n25 = (this.getChild("n25"));
  13666. this.t0 = this.getTransition("t0");
  13667. }
  13668. }
  13669. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  13670. class ui_ranking_com13 extends fgui.GButton {
  13671. static createInstance() {
  13672. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  13673. }
  13674. onConstruct() {
  13675. this.c1 = this.getController("c1");
  13676. this.n44 = (this.getChild("n44"));
  13677. this.n45 = (this.getChild("n45"));
  13678. this.n46 = (this.getChild("n46"));
  13679. }
  13680. }
  13681. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  13682. class ui_Component122 extends fgui.GComponent {
  13683. static createInstance() {
  13684. return (fgui.UIPackage.createObject("game", "Component122"));
  13685. }
  13686. onConstruct() {
  13687. this.gameNode3 = (this.getChild("gameNode3"));
  13688. }
  13689. }
  13690. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  13691. class ui_skillItem extends fgui.GComponent {
  13692. static createInstance() {
  13693. return (fgui.UIPackage.createObject("game", "skillItem"));
  13694. }
  13695. onConstruct() {
  13696. this.c1 = this.getController("c1");
  13697. this.n31 = (this.getChild("n31"));
  13698. this.n6 = (this.getChild("n6"));
  13699. this.skillImg = (this.getChild("skillImg"));
  13700. this.nameTxt = (this.getChild("nameTxt"));
  13701. this.levelTxt = (this.getChild("levelTxt"));
  13702. this.n28 = (this.getChild("n28"));
  13703. this.describeTxt = (this.getChild("describeTxt"));
  13704. this.n32 = (this.getChild("n32"));
  13705. this.mutiBtn = (this.getChild("mutiBtn"));
  13706. this.tryNode = (this.getChild("tryNode"));
  13707. this.normalBtn = (this.getChild("normalBtn"));
  13708. this.startBtn = (this.getChild("startBtn"));
  13709. this.n42 = (this.getChild("n42"));
  13710. this.n43 = (this.getChild("n43"));
  13711. this.n44 = (this.getChild("n44"));
  13712. }
  13713. }
  13714. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  13715. class ui_Component26 extends fgui.GButton {
  13716. static createInstance() {
  13717. return (fgui.UIPackage.createObject("game", "Component26"));
  13718. }
  13719. onConstruct() {
  13720. this.n11 = (this.getChild("n11"));
  13721. this.n30 = (this.getChild("n30"));
  13722. this.n34 = (this.getChild("n34"));
  13723. }
  13724. }
  13725. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  13726. class ui_Component28 extends fgui.GButton {
  13727. static createInstance() {
  13728. return (fgui.UIPackage.createObject("game", "Component28"));
  13729. }
  13730. onConstruct() {
  13731. this.n12 = (this.getChild("n12"));
  13732. this.n31 = (this.getChild("n31"));
  13733. this.curTxt = (this.getChild("curTxt"));
  13734. this.n33 = (this.getChild("n33"));
  13735. }
  13736. }
  13737. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  13738. class ui_Component1302 extends fgui.GComponent {
  13739. static createInstance() {
  13740. return (fgui.UIPackage.createObject("game", "Component1302"));
  13741. }
  13742. onConstruct() {
  13743. this.n2 = (this.getChild("n2"));
  13744. this.n3 = (this.getChild("n3"));
  13745. }
  13746. }
  13747. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  13748. class ui_Component113 extends fgui.GComponent {
  13749. static createInstance() {
  13750. return (fgui.UIPackage.createObject("game", "Component113"));
  13751. }
  13752. onConstruct() {
  13753. this.n85 = (this.getChild("n85"));
  13754. this.n86 = (this.getChild("n86"));
  13755. this.n77 = (this.getChild("n77"));
  13756. this.n79 = (this.getChild("n79"));
  13757. this.n80 = (this.getChild("n80"));
  13758. this.n81 = (this.getChild("n81"));
  13759. this.n82 = (this.getChild("n82"));
  13760. this.n84 = (this.getChild("n84"));
  13761. this.n87 = (this.getChild("n87"));
  13762. this.t0 = this.getTransition("t0");
  13763. }
  13764. }
  13765. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  13766. class ui_Component114 extends fgui.GComponent {
  13767. static createInstance() {
  13768. return (fgui.UIPackage.createObject("game", "Component114"));
  13769. }
  13770. onConstruct() {
  13771. this.n77 = (this.getChild("n77"));
  13772. this.t0 = this.getTransition("t0");
  13773. }
  13774. }
  13775. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  13776. class ui_Component115 extends fgui.GComponent {
  13777. static createInstance() {
  13778. return (fgui.UIPackage.createObject("game", "Component115"));
  13779. }
  13780. onConstruct() {
  13781. this.n83 = (this.getChild("n83"));
  13782. this.fingerNode = (this.getChild("fingerNode"));
  13783. this.n84 = (this.getChild("n84"));
  13784. }
  13785. }
  13786. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  13787. class ui_Component117 extends fgui.GComponent {
  13788. static createInstance() {
  13789. return (fgui.UIPackage.createObject("game", "Component117"));
  13790. }
  13791. onConstruct() {
  13792. this.n87 = (this.getChild("n87"));
  13793. this.n88 = (this.getChild("n88"));
  13794. this.n84 = (this.getChild("n84"));
  13795. this.n85 = (this.getChild("n85"));
  13796. this.n86 = (this.getChild("n86"));
  13797. this.t0 = this.getTransition("t0");
  13798. }
  13799. }
  13800. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  13801. class ui_Component98_1 extends fgui.GButton {
  13802. static createInstance() {
  13803. return (fgui.UIPackage.createObject("game", "Component98_1"));
  13804. }
  13805. onConstruct() {
  13806. this.c1 = this.getController("c1");
  13807. this.n8 = (this.getChild("n8"));
  13808. this.n41 = (this.getChild("n41"));
  13809. this.n40 = (this.getChild("n40"));
  13810. }
  13811. }
  13812. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  13813. class ui_Component61 extends fgui.GComponent {
  13814. static createInstance() {
  13815. return (fgui.UIPackage.createObject("game", "Component61"));
  13816. }
  13817. onConstruct() {
  13818. this.n14 = (this.getChild("n14"));
  13819. this.n6 = (this.getChild("n6"));
  13820. this.t0 = this.getTransition("t0");
  13821. }
  13822. }
  13823. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  13824. class ui_Component62 extends fgui.GComponent {
  13825. static createInstance() {
  13826. return (fgui.UIPackage.createObject("game", "Component62"));
  13827. }
  13828. onConstruct() {
  13829. this.n66 = (this.getChild("n66"));
  13830. this.n56 = (this.getChild("n56"));
  13831. this.n63 = (this.getChild("n63"));
  13832. this.n65 = (this.getChild("n65"));
  13833. this.t0 = this.getTransition("t0");
  13834. }
  13835. }
  13836. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  13837. class ui_d3Root extends fgui.GComponent {
  13838. static createInstance() {
  13839. return (fgui.UIPackage.createObject("game", "d3Root"));
  13840. }
  13841. onConstruct() {
  13842. }
  13843. }
  13844. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  13845. class ui_d2Root extends fgui.GComponent {
  13846. static createInstance() {
  13847. return (fgui.UIPackage.createObject("game", "d2Root"));
  13848. }
  13849. onConstruct() {
  13850. }
  13851. }
  13852. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  13853. class ui_ballNode extends fgui.GComponent {
  13854. static createInstance() {
  13855. return (fgui.UIPackage.createObject("game", "ballNode"));
  13856. }
  13857. onConstruct() {
  13858. }
  13859. }
  13860. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  13861. class ui_border extends fgui.GComponent {
  13862. static createInstance() {
  13863. return (fgui.UIPackage.createObject("game", "border"));
  13864. }
  13865. onConstruct() {
  13866. this.bar1 = (this.getChild("bar1"));
  13867. this.bar2 = (this.getChild("bar2"));
  13868. this.bar3 = (this.getChild("bar3"));
  13869. this.bar4 = (this.getChild("bar4"));
  13870. this.bar5 = (this.getChild("bar5"));
  13871. this.bar6 = (this.getChild("bar6"));
  13872. this.circle1 = (this.getChild("circle1"));
  13873. this.circle2 = (this.getChild("circle2"));
  13874. this.circle3 = (this.getChild("circle3"));
  13875. this.circle4 = (this.getChild("circle4"));
  13876. this.circle5 = (this.getChild("circle5"));
  13877. this.circle6 = (this.getChild("circle6"));
  13878. this.n28 = (this.getChild("n28"));
  13879. }
  13880. }
  13881. ui_border.URL = "ui://isxx5ak7sdh33qq";
  13882. class ui_Component41_2 extends fgui.GComponent {
  13883. static createInstance() {
  13884. return (fgui.UIPackage.createObject("game", "Component41_2"));
  13885. }
  13886. onConstruct() {
  13887. this.c1 = this.getController("c1");
  13888. this.n0 = (this.getChild("n0"));
  13889. this.n2 = (this.getChild("n2"));
  13890. this.n19 = (this.getChild("n19"));
  13891. this.cancelBtn = (this.getChild("cancelBtn"));
  13892. this.videoBtn = (this.getChild("videoBtn"));
  13893. this.n9 = (this.getChild("n9"));
  13894. this.n22 = (this.getChild("n22"));
  13895. this.tipsTxt = (this.getChild("tipsTxt"));
  13896. this.n23 = (this.getChild("n23"));
  13897. this.n24 = (this.getChild("n24"));
  13898. this.n26 = (this.getChild("n26"));
  13899. this.n27 = (this.getChild("n27"));
  13900. this.titleTxt = (this.getChild("titleTxt"));
  13901. }
  13902. }
  13903. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  13904. class ui_Component41_1 extends fgui.GComponent {
  13905. static createInstance() {
  13906. return (fgui.UIPackage.createObject("game", "Component41_1"));
  13907. }
  13908. onConstruct() {
  13909. this.c1 = this.getController("c1");
  13910. this.n0 = (this.getChild("n0"));
  13911. this.n2 = (this.getChild("n2"));
  13912. this.cancelBtn = (this.getChild("cancelBtn"));
  13913. this.videoBtn = (this.getChild("videoBtn"));
  13914. this.n27 = (this.getChild("n27"));
  13915. this.n30 = (this.getChild("n30"));
  13916. this.n31 = (this.getChild("n31"));
  13917. this.n32 = (this.getChild("n32"));
  13918. this.n33 = (this.getChild("n33"));
  13919. this.n34 = (this.getChild("n34"));
  13920. this.n35 = (this.getChild("n35"));
  13921. this.n36 = (this.getChild("n36"));
  13922. this.n1 = (this.getChild("n1"));
  13923. this.n37 = (this.getChild("n37"));
  13924. this.t0 = this.getTransition("t0");
  13925. this.t1 = this.getTransition("t1");
  13926. this.t2 = this.getTransition("t2");
  13927. this.t3 = this.getTransition("t3");
  13928. }
  13929. }
  13930. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  13931. class ui_againBtn extends fgui.GButton {
  13932. static createInstance() {
  13933. return (fgui.UIPackage.createObject("game", "againBtn"));
  13934. }
  13935. onConstruct() {
  13936. this.n2 = (this.getChild("n2"));
  13937. this.n1 = (this.getChild("n1"));
  13938. this.n5 = (this.getChild("n5"));
  13939. }
  13940. }
  13941. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  13942. class ui_Component118 extends fgui.GButton {
  13943. static createInstance() {
  13944. return (fgui.UIPackage.createObject("game", "Component118"));
  13945. }
  13946. onConstruct() {
  13947. this.c1 = this.getController("c1");
  13948. this.n14 = (this.getChild("n14"));
  13949. this.n9 = (this.getChild("n9"));
  13950. this.n10 = (this.getChild("n10"));
  13951. this.diamondTxt = (this.getChild("diamondTxt"));
  13952. this.n13 = (this.getChild("n13"));
  13953. this.n15 = (this.getChild("n15"));
  13954. }
  13955. }
  13956. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  13957. class ui_Component119 extends fgui.GComponent {
  13958. static createInstance() {
  13959. return (fgui.UIPackage.createObject("game", "Component119"));
  13960. }
  13961. onConstruct() {
  13962. this.n1 = (this.getChild("n1"));
  13963. this.n2 = (this.getChild("n2"));
  13964. this.n13 = (this.getChild("n13"));
  13965. this.n6 = (this.getChild("n6"));
  13966. this.screenNode = (this.getChild("screenNode"));
  13967. this.n15 = (this.getChild("n15"));
  13968. this.closeBtn = (this.getChild("closeBtn"));
  13969. this.share2Btn = (this.getChild("share2Btn"));
  13970. this.shareBtn = (this.getChild("shareBtn"));
  13971. this.tipsNode = (this.getChild("tipsNode"));
  13972. this.awardNode = (this.getChild("awardNode"));
  13973. }
  13974. }
  13975. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  13976. class ui_Component132_1 extends fgui.GComponent {
  13977. static createInstance() {
  13978. return (fgui.UIPackage.createObject("game", "Component132_1"));
  13979. }
  13980. onConstruct() {
  13981. this.n25 = (this.getChild("n25"));
  13982. this.n26 = (this.getChild("n26"));
  13983. this.n27 = (this.getChild("n27"));
  13984. this.t0 = this.getTransition("t0");
  13985. }
  13986. }
  13987. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  13988. class ui_SecretaryDisplay extends fgui.GComponent {
  13989. static createInstance() {
  13990. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  13991. }
  13992. onConstruct() {
  13993. this.n2 = (this.getChild("n2"));
  13994. this.levelTxt = (this.getChild("levelTxt"));
  13995. this.n4 = (this.getChild("n4"));
  13996. this.secretary = (this.getChild("secretary"));
  13997. this.purchaseBtn = (this.getChild("purchaseBtn"));
  13998. this.n16 = (this.getChild("n16"));
  13999. this.n37 = (this.getChild("n37"));
  14000. this.n41 = (this.getChild("n41"));
  14001. this.n14 = (this.getChild("n14"));
  14002. this.n17 = (this.getChild("n17"));
  14003. this.heightTxt = (this.getChild("heightTxt"));
  14004. this.n46 = (this.getChild("n46"));
  14005. this.n36 = (this.getChild("n36"));
  14006. this.n38 = (this.getChild("n38"));
  14007. this.foodTxt = (this.getChild("foodTxt"));
  14008. this.n47 = (this.getChild("n47"));
  14009. this.n40 = (this.getChild("n40"));
  14010. this.n42 = (this.getChild("n42"));
  14011. this.historyTxt = (this.getChild("historyTxt"));
  14012. this.n48 = (this.getChild("n48"));
  14013. this.nameImg = (this.getChild("nameImg"));
  14014. this.n12 = (this.getChild("n12"));
  14015. this.n49 = (this.getChild("n49"));
  14016. this.t0 = this.getTransition("t0");
  14017. }
  14018. }
  14019. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  14020. class ui_BallRodDisplay extends fgui.GComponent {
  14021. static createInstance() {
  14022. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  14023. }
  14024. onConstruct() {
  14025. this.c1 = this.getController("c1");
  14026. this.n31 = (this.getChild("n31"));
  14027. this.n6 = (this.getChild("n6"));
  14028. this.nameTxt = (this.getChild("nameTxt"));
  14029. this.rodImg = (this.getChild("rodImg"));
  14030. this.levelNode = (this.getChild("levelNode"));
  14031. this.eftRod = (this.getChild("eftRod"));
  14032. this.purchaseBtn = (this.getChild("purchaseBtn"));
  14033. }
  14034. }
  14035. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  14036. class ui_Component111_11 extends fgui.GComponent {
  14037. static createInstance() {
  14038. return (fgui.UIPackage.createObject("game", "Component111_11"));
  14039. }
  14040. onConstruct() {
  14041. this.n68 = (this.getChild("n68"));
  14042. this.n69 = (this.getChild("n69"));
  14043. }
  14044. }
  14045. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  14046. class ui_Component112 extends fgui.GComponent {
  14047. static createInstance() {
  14048. return (fgui.UIPackage.createObject("game", "Component112"));
  14049. }
  14050. onConstruct() {
  14051. this.n68 = (this.getChild("n68"));
  14052. this.n70 = (this.getChild("n70"));
  14053. this.myMask = (this.getChild("myMask"));
  14054. }
  14055. }
  14056. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  14057. class ui_Component111 extends fgui.GComponent {
  14058. static createInstance() {
  14059. return (fgui.UIPackage.createObject("game", "Component111"));
  14060. }
  14061. onConstruct() {
  14062. this.n68 = (this.getChild("n68"));
  14063. this.myMask = (this.getChild("myMask"));
  14064. }
  14065. }
  14066. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  14067. class ui_Component144 extends fgui.GButton {
  14068. static createInstance() {
  14069. return (fgui.UIPackage.createObject("game", "Component144"));
  14070. }
  14071. onConstruct() {
  14072. this.n8 = (this.getChild("n8"));
  14073. }
  14074. }
  14075. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  14076. class ui_Sign_com2 extends fgui.GComponent {
  14077. static createInstance() {
  14078. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  14079. }
  14080. onConstruct() {
  14081. this.n0 = (this.getChild("n0"));
  14082. this.n1 = (this.getChild("n1"));
  14083. this.t0 = this.getTransition("t0");
  14084. }
  14085. }
  14086. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  14087. class ui_Sign_guang extends fgui.GComponent {
  14088. static createInstance() {
  14089. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  14090. }
  14091. onConstruct() {
  14092. this.n1 = (this.getChild("n1"));
  14093. this.n2 = (this.getChild("n2"));
  14094. this.n3 = (this.getChild("n3"));
  14095. this.n4 = (this.getChild("n4"));
  14096. this.n5 = (this.getChild("n5"));
  14097. this.n6 = (this.getChild("n6"));
  14098. this.n8 = (this.getChild("n8"));
  14099. }
  14100. }
  14101. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  14102. class ui_SignMax extends fgui.GComponent {
  14103. static createInstance() {
  14104. return (fgui.UIPackage.createObject("game", "SignMax"));
  14105. }
  14106. onConstruct() {
  14107. this.c1 = this.getController("c1");
  14108. this.n7 = (this.getChild("n7"));
  14109. this.n15 = (this.getChild("n15"));
  14110. this.n8 = (this.getChild("n8"));
  14111. this.titleTxt = (this.getChild("titleTxt"));
  14112. this.myIcon1 = (this.getChild("myIcon1"));
  14113. this.numTxt1 = (this.getChild("numTxt1"));
  14114. this.myIcon2 = (this.getChild("myIcon2"));
  14115. this.n20 = (this.getChild("n20"));
  14116. this.n17 = (this.getChild("n17"));
  14117. this.numTxt2 = (this.getChild("numTxt2"));
  14118. this.n12 = (this.getChild("n12"));
  14119. this.n13 = (this.getChild("n13"));
  14120. this.n21 = (this.getChild("n21"));
  14121. this.n14 = (this.getChild("n14"));
  14122. }
  14123. }
  14124. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  14125. class ui_Sign_com2_1 extends fgui.GComponent {
  14126. static createInstance() {
  14127. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  14128. }
  14129. onConstruct() {
  14130. this.n0 = (this.getChild("n0"));
  14131. this.n1 = (this.getChild("n1"));
  14132. this.t0 = this.getTransition("t0");
  14133. }
  14134. }
  14135. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  14136. class ui_Sign_com5 extends fgui.GComponent {
  14137. static createInstance() {
  14138. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  14139. }
  14140. onConstruct() {
  14141. this.n3 = (this.getChild("n3"));
  14142. this.n29 = (this.getChild("n29"));
  14143. this.n4 = (this.getChild("n4"));
  14144. this.day1 = (this.getChild("day1"));
  14145. this.day2 = (this.getChild("day2"));
  14146. this.day3 = (this.getChild("day3"));
  14147. this.day4 = (this.getChild("day4"));
  14148. this.day5 = (this.getChild("day5"));
  14149. this.day6 = (this.getChild("day6"));
  14150. this.day7 = (this.getChild("day7"));
  14151. this.t0 = this.getTransition("t0");
  14152. }
  14153. }
  14154. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  14155. class ui_Sign_com8 extends fgui.GComponent {
  14156. static createInstance() {
  14157. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  14158. }
  14159. onConstruct() {
  14160. this.n48 = (this.getChild("n48"));
  14161. this.womanTxt = (this.getChild("womanTxt"));
  14162. this.t0 = this.getTransition("t0");
  14163. }
  14164. }
  14165. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  14166. class ui_Sign_com6 extends fgui.GComponent {
  14167. static createInstance() {
  14168. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  14169. }
  14170. onConstruct() {
  14171. this.n2 = (this.getChild("n2"));
  14172. this.n3 = (this.getChild("n3"));
  14173. this.t0 = this.getTransition("t0");
  14174. }
  14175. }
  14176. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  14177. class ui_Sign_com7 extends fgui.GComponent {
  14178. static createInstance() {
  14179. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  14180. }
  14181. onConstruct() {
  14182. this.n29 = (this.getChild("n29"));
  14183. this.n2 = (this.getChild("n2"));
  14184. }
  14185. }
  14186. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  14187. class ui_UITurntable_com1_2 extends fgui.GComponent {
  14188. static createInstance() {
  14189. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  14190. }
  14191. onConstruct() {
  14192. this.n5 = (this.getChild("n5"));
  14193. this.n4 = (this.getChild("n4"));
  14194. this.t0 = this.getTransition("t0");
  14195. }
  14196. }
  14197. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  14198. class ui_UITurntable_com2 extends fgui.GComponent {
  14199. static createInstance() {
  14200. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  14201. }
  14202. onConstruct() {
  14203. this.c1 = this.getController("c1");
  14204. this.n4 = (this.getChild("n4"));
  14205. this.n6 = (this.getChild("n6"));
  14206. this.n10 = (this.getChild("n10"));
  14207. this.n11 = (this.getChild("n11"));
  14208. this.n12 = (this.getChild("n12"));
  14209. this.n13 = (this.getChild("n13"));
  14210. this.n14 = (this.getChild("n14"));
  14211. this.n15 = (this.getChild("n15"));
  14212. this.n16 = (this.getChild("n16"));
  14213. this.n17 = (this.getChild("n17"));
  14214. this.n18 = (this.getChild("n18"));
  14215. this.n19 = (this.getChild("n19"));
  14216. this.n20 = (this.getChild("n20"));
  14217. this.n21 = (this.getChild("n21"));
  14218. this.n22 = (this.getChild("n22"));
  14219. this.n23 = (this.getChild("n23"));
  14220. this.n24 = (this.getChild("n24"));
  14221. this.n25 = (this.getChild("n25"));
  14222. this.n26 = (this.getChild("n26"));
  14223. this.n27 = (this.getChild("n27"));
  14224. this.n28 = (this.getChild("n28"));
  14225. this.n29 = (this.getChild("n29"));
  14226. this.n30 = (this.getChild("n30"));
  14227. this.n31 = (this.getChild("n31"));
  14228. this.n32 = (this.getChild("n32"));
  14229. this.n33 = (this.getChild("n33"));
  14230. }
  14231. }
  14232. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  14233. class ui_UITurntable_com1_1 extends fgui.GComponent {
  14234. static createInstance() {
  14235. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  14236. }
  14237. onConstruct() {
  14238. this.n5 = (this.getChild("n5"));
  14239. this.n4 = (this.getChild("n4"));
  14240. this.t0 = this.getTransition("t0");
  14241. }
  14242. }
  14243. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  14244. class ui_UITurntable_com5 extends fgui.GComponent {
  14245. static createInstance() {
  14246. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  14247. }
  14248. onConstruct() {
  14249. this.flashNode = (this.getChild("flashNode"));
  14250. this.rotNode = (this.getChild("rotNode"));
  14251. this.n3 = (this.getChild("n3"));
  14252. this.n21 = (this.getChild("n21"));
  14253. this.t0 = this.getTransition("t0");
  14254. }
  14255. }
  14256. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  14257. class ui_UITurntable_com7 extends fgui.GComponent {
  14258. static createInstance() {
  14259. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  14260. }
  14261. onConstruct() {
  14262. this.n2 = (this.getChild("n2"));
  14263. this.n35 = (this.getChild("n35"));
  14264. this.img1 = (this.getChild("img1"));
  14265. this.img2 = (this.getChild("img2"));
  14266. this.img3 = (this.getChild("img3"));
  14267. this.img4 = (this.getChild("img4"));
  14268. this.img6 = (this.getChild("img6"));
  14269. this.img5 = (this.getChild("img5"));
  14270. this.txt1 = (this.getChild("txt1"));
  14271. this.txt2 = (this.getChild("txt2"));
  14272. this.txt3 = (this.getChild("txt3"));
  14273. this.txt4 = (this.getChild("txt4"));
  14274. this.txt5 = (this.getChild("txt5"));
  14275. this.txt6 = (this.getChild("txt6"));
  14276. }
  14277. }
  14278. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  14279. class ui_UITurntable_com9 extends fgui.GComponent {
  14280. static createInstance() {
  14281. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  14282. }
  14283. onConstruct() {
  14284. this.n38 = (this.getChild("n38"));
  14285. this.n39 = (this.getChild("n39"));
  14286. }
  14287. }
  14288. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  14289. class ui_UITurntable_com10 extends fgui.GComponent {
  14290. static createInstance() {
  14291. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  14292. }
  14293. onConstruct() {
  14294. this.n39 = (this.getChild("n39"));
  14295. this.n40 = (this.getChild("n40"));
  14296. this.t0 = this.getTransition("t0");
  14297. }
  14298. }
  14299. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  14300. class ui_UITurntable_com11 extends fgui.GComponent {
  14301. static createInstance() {
  14302. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  14303. }
  14304. onConstruct() {
  14305. this.n38 = (this.getChild("n38"));
  14306. this.n39 = (this.getChild("n39"));
  14307. this.n40 = (this.getChild("n40"));
  14308. this.t0 = this.getTransition("t0");
  14309. }
  14310. }
  14311. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  14312. class ui_UITurntable_com12 extends fgui.GComponent {
  14313. static createInstance() {
  14314. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  14315. }
  14316. onConstruct() {
  14317. this.n43 = (this.getChild("n43"));
  14318. this.barNode = (this.getChild("barNode"));
  14319. this.tipsTxt = (this.getChild("tipsTxt"));
  14320. this.n45 = (this.getChild("n45"));
  14321. this.boxBtn = (this.getChild("boxBtn"));
  14322. }
  14323. }
  14324. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  14325. class ui_UITurntable_com1 extends fgui.GButton {
  14326. static createInstance() {
  14327. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  14328. }
  14329. onConstruct() {
  14330. this.n41 = (this.getChild("n41"));
  14331. this.n42 = (this.getChild("n42"));
  14332. this.t0 = this.getTransition("t0");
  14333. }
  14334. }
  14335. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  14336. class ui_UITurntable_com3 extends fgui.GComponent {
  14337. static createInstance() {
  14338. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  14339. }
  14340. onConstruct() {
  14341. this.n48 = (this.getChild("n48"));
  14342. this.womanTxt = (this.getChild("womanTxt"));
  14343. this.t0 = this.getTransition("t0");
  14344. }
  14345. }
  14346. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  14347. class ui_cancelBtn2 extends fgui.GButton {
  14348. static createInstance() {
  14349. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  14350. }
  14351. onConstruct() {
  14352. this.c1 = this.getController("c1");
  14353. this.n0 = (this.getChild("n0"));
  14354. this.n1 = (this.getChild("n1"));
  14355. this.n2 = (this.getChild("n2"));
  14356. this.n3 = (this.getChild("n3"));
  14357. this.n4 = (this.getChild("n4"));
  14358. this.n5 = (this.getChild("n5"));
  14359. this.n6 = (this.getChild("n6"));
  14360. this.n7 = (this.getChild("n7"));
  14361. this.n8 = (this.getChild("n8"));
  14362. this.powerEft = (this.getChild("powerEft"));
  14363. }
  14364. }
  14365. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  14366. class ui_shareBtn2 extends fgui.GButton {
  14367. static createInstance() {
  14368. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  14369. }
  14370. onConstruct() {
  14371. this.c1 = this.getController("c1");
  14372. this.n2 = (this.getChild("n2"));
  14373. this.n24 = (this.getChild("n24"));
  14374. this.n1 = (this.getChild("n1"));
  14375. this.n3 = (this.getChild("n3"));
  14376. this.n23 = (this.getChild("n23"));
  14377. this.n4 = (this.getChild("n4"));
  14378. this.n5 = (this.getChild("n5"));
  14379. this.n6 = (this.getChild("n6"));
  14380. this.n20 = (this.getChild("n20"));
  14381. this.n21 = (this.getChild("n21"));
  14382. this.n22 = (this.getChild("n22"));
  14383. this.powerEft = (this.getChild("powerEft"));
  14384. }
  14385. }
  14386. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  14387. class ui_UIMoney extends fgui.GComponent {
  14388. static createInstance() {
  14389. return (fgui.UIPackage.createObject("game", "UIMoney"));
  14390. }
  14391. onConstruct() {
  14392. this.c1 = this.getController("c1");
  14393. this.n4 = (this.getChild("n4"));
  14394. this.coinImg = (this.getChild("coinImg"));
  14395. this.addCoinBtn = (this.getChild("addCoinBtn"));
  14396. this.coinTxt = (this.getChild("coinTxt"));
  14397. this.n7 = (this.getChild("n7"));
  14398. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  14399. this.diamondTxt = (this.getChild("diamondTxt"));
  14400. this.diamondImg = (this.getChild("diamondImg"));
  14401. this.n12 = (this.getChild("n12"));
  14402. this.powerImg = (this.getChild("powerImg"));
  14403. this.addPowerBtn = (this.getChild("addPowerBtn"));
  14404. this.powerTxt = (this.getChild("powerTxt"));
  14405. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  14406. }
  14407. }
  14408. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  14409. class ui_backBtn extends fgui.GButton {
  14410. static createInstance() {
  14411. return (fgui.UIPackage.createObject("game", "backBtn"));
  14412. }
  14413. onConstruct() {
  14414. this.n0 = (this.getChild("n0"));
  14415. this.t0 = this.getTransition("t0");
  14416. this.t1 = this.getTransition("t1");
  14417. }
  14418. }
  14419. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  14420. class ui_MoneyBtn extends fgui.GButton {
  14421. static createInstance() {
  14422. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  14423. }
  14424. onConstruct() {
  14425. this.button = this.getController("button");
  14426. this.n0 = (this.getChild("n0"));
  14427. }
  14428. }
  14429. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  14430. class ui_UIMoneyBtn extends fgui.GComponent {
  14431. static createInstance() {
  14432. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  14433. }
  14434. onConstruct() {
  14435. this.n1 = (this.getChild("n1"));
  14436. this.closeBtn = (this.getChild("closeBtn"));
  14437. }
  14438. }
  14439. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  14440. class ui_Component64 extends fgui.GComponent {
  14441. static createInstance() {
  14442. return (fgui.UIPackage.createObject("game", "Component64"));
  14443. }
  14444. onConstruct() {
  14445. this.n57 = (this.getChild("n57"));
  14446. this.n54 = (this.getChild("n54"));
  14447. this.n55 = (this.getChild("n55"));
  14448. this.n56 = (this.getChild("n56"));
  14449. this.t1 = this.getTransition("t1");
  14450. }
  14451. }
  14452. ui_Component64.URL = "ui://isxx5ak7wp26456";
  14453. class ui_Component41_3 extends fgui.GComponent {
  14454. static createInstance() {
  14455. return (fgui.UIPackage.createObject("game", "Component41_3"));
  14456. }
  14457. onConstruct() {
  14458. this.c1 = this.getController("c1");
  14459. this.n0 = (this.getChild("n0"));
  14460. this.n2 = (this.getChild("n2"));
  14461. this.cancelBtn = (this.getChild("cancelBtn"));
  14462. this.videoBtn = (this.getChild("videoBtn"));
  14463. this.n9 = (this.getChild("n9"));
  14464. this.n24 = (this.getChild("n24"));
  14465. this.n27 = (this.getChild("n27"));
  14466. this.titleTxt = (this.getChild("titleTxt"));
  14467. this.n28 = (this.getChild("n28"));
  14468. this.t0 = this.getTransition("t0");
  14469. }
  14470. }
  14471. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  14472. class ui_dh_zs_4 extends fgui.GComponent {
  14473. static createInstance() {
  14474. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  14475. }
  14476. onConstruct() {
  14477. this.n1 = (this.getChild("n1"));
  14478. this.n2 = (this.getChild("n2"));
  14479. this.n3 = (this.getChild("n3"));
  14480. this.n4 = (this.getChild("n4"));
  14481. this.n5 = (this.getChild("n5"));
  14482. this.n6 = (this.getChild("n6"));
  14483. this.n8 = (this.getChild("n8"));
  14484. this.t0 = this.getTransition("t0");
  14485. }
  14486. }
  14487. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  14488. class ui_Component71_1 extends fgui.GButton {
  14489. static createInstance() {
  14490. return (fgui.UIPackage.createObject("game", "Component71_1"));
  14491. }
  14492. onConstruct() {
  14493. this.n17 = (this.getChild("n17"));
  14494. this.t0 = this.getTransition("t0");
  14495. }
  14496. }
  14497. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  14498. class ui_Component83 extends fgui.GComponent {
  14499. static createInstance() {
  14500. return (fgui.UIPackage.createObject("game", "Component83"));
  14501. }
  14502. onConstruct() {
  14503. this.c1 = this.getController("c1");
  14504. this.n17 = (this.getChild("n17"));
  14505. this.n19 = (this.getChild("n19"));
  14506. this.n20 = (this.getChild("n20"));
  14507. }
  14508. }
  14509. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  14510. class ui_Component84 extends fgui.GComponent {
  14511. static createInstance() {
  14512. return (fgui.UIPackage.createObject("game", "Component84"));
  14513. }
  14514. onConstruct() {
  14515. this.c1 = this.getController("c1");
  14516. this.n4 = (this.getChild("n4"));
  14517. this.n22 = (this.getChild("n22"));
  14518. this.n23 = (this.getChild("n23"));
  14519. this.numTxt = (this.getChild("numTxt"));
  14520. this.n25 = (this.getChild("n25"));
  14521. this.n26 = (this.getChild("n26"));
  14522. }
  14523. }
  14524. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  14525. class ui_Component84_1 extends fgui.GComponent {
  14526. static createInstance() {
  14527. return (fgui.UIPackage.createObject("game", "Component84_1"));
  14528. }
  14529. onConstruct() {
  14530. this.c1 = this.getController("c1");
  14531. this.n4 = (this.getChild("n4"));
  14532. this.n22 = (this.getChild("n22"));
  14533. this.n23 = (this.getChild("n23"));
  14534. this.numTxt = (this.getChild("numTxt"));
  14535. this.n25 = (this.getChild("n25"));
  14536. this.n26 = (this.getChild("n26"));
  14537. }
  14538. }
  14539. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  14540. class ui_Component85 extends fgui.GComponent {
  14541. static createInstance() {
  14542. return (fgui.UIPackage.createObject("game", "Component85"));
  14543. }
  14544. onConstruct() {
  14545. this.n1 = (this.getChild("n1"));
  14546. this.n6 = (this.getChild("n6"));
  14547. this.n2 = (this.getChild("n2"));
  14548. this.n3 = (this.getChild("n3"));
  14549. this.levelTxt = (this.getChild("levelTxt"));
  14550. this.n10 = (this.getChild("n10"));
  14551. this.n11 = (this.getChild("n11"));
  14552. this.n12 = (this.getChild("n12"));
  14553. this.n13 = (this.getChild("n13"));
  14554. this.n14 = (this.getChild("n14"));
  14555. this.modeNode = (this.getChild("modeNode"));
  14556. this.n18 = (this.getChild("n18"));
  14557. this.conditionTxt = (this.getChild("conditionTxt"));
  14558. this.diamondNode = (this.getChild("diamondNode"));
  14559. this.coinNode = (this.getChild("coinNode"));
  14560. this.startBtn = (this.getChild("startBtn"));
  14561. this.n28 = (this.getChild("n28"));
  14562. this.displayRoot = (this.getChild("displayRoot"));
  14563. this.t0 = this.getTransition("t0");
  14564. }
  14565. }
  14566. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  14567. class ui_Component86 extends fgui.GButton {
  14568. static createInstance() {
  14569. return (fgui.UIPackage.createObject("game", "Component86"));
  14570. }
  14571. onConstruct() {
  14572. this.n15 = (this.getChild("n15"));
  14573. this.t0 = this.getTransition("t0");
  14574. }
  14575. }
  14576. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  14577. class ui_Component87 extends fgui.GComponent {
  14578. static createInstance() {
  14579. return (fgui.UIPackage.createObject("game", "Component87"));
  14580. }
  14581. onConstruct() {
  14582. this.n66 = (this.getChild("n66"));
  14583. this.myProgress = (this.getChild("myProgress"));
  14584. this.starAni = (this.getChild("starAni"));
  14585. this.hpTxt = (this.getChild("hpTxt"));
  14586. this.n74 = (this.getChild("n74"));
  14587. this.n73 = (this.getChild("n73"));
  14588. this.ballTxt = (this.getChild("ballTxt"));
  14589. this.n76 = (this.getChild("n76"));
  14590. this.helpLineBtn = (this.getChild("helpLineBtn"));
  14591. this.levelTxt = (this.getChild("levelTxt"));
  14592. this.star1 = (this.getChild("star1"));
  14593. this.star2 = (this.getChild("star2"));
  14594. this.star3 = (this.getChild("star3"));
  14595. }
  14596. }
  14597. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  14598. class ui_Component88 extends fgui.GProgressBar {
  14599. static createInstance() {
  14600. return (fgui.UIPackage.createObject("game", "Component88"));
  14601. }
  14602. onConstruct() {
  14603. this.n68 = (this.getChild("n68"));
  14604. this.bar = (this.getChild("bar"));
  14605. }
  14606. }
  14607. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  14608. class ui_Component89 extends fgui.GComponent {
  14609. static createInstance() {
  14610. return (fgui.UIPackage.createObject("game", "Component89"));
  14611. }
  14612. onConstruct() {
  14613. this.c1 = this.getController("c1");
  14614. this.n71 = (this.getChild("n71"));
  14615. this.n72 = (this.getChild("n72"));
  14616. }
  14617. }
  14618. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  14619. class ui_Component90 extends fgui.GComponent {
  14620. static createInstance() {
  14621. return (fgui.UIPackage.createObject("game", "Component90"));
  14622. }
  14623. onConstruct() {
  14624. this.c1 = this.getController("c1");
  14625. this.n64 = (this.getChild("n64"));
  14626. this.n65 = (this.getChild("n65"));
  14627. this.n66 = (this.getChild("n66"));
  14628. this.t0 = this.getTransition("t0");
  14629. }
  14630. }
  14631. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  14632. class ui_Component127 extends fgui.GButton {
  14633. static createInstance() {
  14634. return (fgui.UIPackage.createObject("game", "Component127"));
  14635. }
  14636. onConstruct() {
  14637. this.n5 = (this.getChild("n5"));
  14638. }
  14639. }
  14640. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  14641. class gameBinder {
  14642. static bindAll() {
  14643. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  14644. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  14645. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  14646. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  14647. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  14648. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  14649. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  14650. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  14651. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  14652. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  14653. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  14654. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  14655. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  14656. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  14657. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  14658. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  14659. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  14660. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  14661. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  14662. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  14663. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  14664. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  14665. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  14666. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  14667. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  14668. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  14669. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  14670. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  14671. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  14672. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  14673. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  14674. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  14675. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  14676. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  14677. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  14678. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  14679. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  14680. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  14681. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  14682. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  14683. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  14684. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  14685. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  14686. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  14687. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  14688. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  14689. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  14690. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  14691. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  14692. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  14693. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  14694. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  14695. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  14696. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  14697. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  14698. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  14699. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  14700. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  14701. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  14702. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  14703. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  14704. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  14705. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  14706. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  14707. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  14708. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  14709. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  14710. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  14711. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  14712. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  14713. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  14714. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  14715. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  14716. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  14717. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  14718. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  14719. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  14720. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  14721. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  14722. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  14723. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  14724. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  14725. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  14726. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  14727. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  14728. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  14729. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  14730. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  14731. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  14732. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  14733. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  14734. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  14735. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  14736. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  14737. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  14738. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  14739. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  14740. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  14741. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  14742. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  14743. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  14744. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  14745. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  14746. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  14747. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  14748. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  14749. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  14750. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  14751. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  14752. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  14753. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  14754. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  14755. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  14756. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  14757. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  14758. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  14759. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  14760. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  14761. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  14762. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  14763. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  14764. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  14765. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  14766. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  14767. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  14768. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  14769. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  14770. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  14771. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  14772. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  14773. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  14774. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  14775. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  14776. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  14777. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  14778. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  14779. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  14780. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  14781. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  14782. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  14783. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  14784. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  14785. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  14786. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  14787. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  14788. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  14789. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  14790. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  14791. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  14792. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  14793. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  14794. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  14795. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  14796. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  14797. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  14798. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  14799. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  14800. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  14801. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  14802. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  14803. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  14804. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  14805. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  14806. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  14807. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  14808. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  14809. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  14810. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  14811. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  14812. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  14813. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  14814. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  14815. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  14816. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  14817. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  14818. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  14819. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  14820. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  14821. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  14822. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  14823. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  14824. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  14825. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  14826. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  14827. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  14828. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  14829. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  14830. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  14831. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  14832. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  14833. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  14834. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  14835. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  14836. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  14837. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  14838. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  14839. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  14840. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  14841. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  14842. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  14843. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  14844. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  14845. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  14846. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  14847. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  14848. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  14849. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  14850. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  14851. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  14852. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  14853. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  14854. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  14855. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  14856. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  14857. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  14858. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  14859. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  14860. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  14861. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  14862. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  14863. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  14864. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  14865. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  14866. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  14867. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  14868. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  14869. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  14870. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  14871. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  14872. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  14873. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  14874. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  14875. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  14876. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  14877. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  14878. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  14879. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  14880. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  14881. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  14882. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  14883. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  14884. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  14885. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  14886. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  14887. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  14888. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  14889. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  14890. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  14891. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  14892. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  14893. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  14894. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  14895. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  14896. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  14897. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  14898. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  14899. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  14900. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  14901. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  14902. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  14903. }
  14904. }
  14905. class ui_btn6 extends fgui.GButton {
  14906. static createInstance() {
  14907. return (fgui.UIPackage.createObject("loading", "btn6"));
  14908. }
  14909. onConstruct() {
  14910. this.n6 = (this.getChild("n6"));
  14911. this.n1 = (this.getChild("n1"));
  14912. }
  14913. }
  14914. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  14915. class ui_xyItem extends fgui.GComponent {
  14916. static createInstance() {
  14917. return (fgui.UIPackage.createObject("loading", "xyItem"));
  14918. }
  14919. onConstruct() {
  14920. this.xyItem = (this.getChild("xyItem"));
  14921. }
  14922. }
  14923. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  14924. class ui_loadinfo extends fgui.GProgressBar {
  14925. static createInstance() {
  14926. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  14927. }
  14928. onConstruct() {
  14929. this.bg = (this.getChild("bg"));
  14930. this.bar = (this.getChild("bar"));
  14931. this.title = (this.getChild("title"));
  14932. this.ani = (this.getChild("ani"));
  14933. }
  14934. }
  14935. ui_loadinfo.URL = "ui://37nctnhwis36c";
  14936. class ui_xyNode extends fgui.GComponent {
  14937. static createInstance() {
  14938. return (fgui.UIPackage.createObject("loading", "xyNode"));
  14939. }
  14940. onConstruct() {
  14941. this.n0 = (this.getChild("n0"));
  14942. this.btnYes = (this.getChild("btnYes"));
  14943. this.btnNo = (this.getChild("btnNo"));
  14944. this.btnKnown = (this.getChild("btnKnown"));
  14945. this.btnSure = (this.getChild("btnSure"));
  14946. this.txtWelcom = (this.getChild("txtWelcom"));
  14947. this.txtXy = (this.getChild("txtXy"));
  14948. this.n75 = (this.getChild("n75"));
  14949. this.btnXy1 = (this.getChild("btnXy1"));
  14950. this.btnXy3 = (this.getChild("btnXy3"));
  14951. this.btnXy2 = (this.getChild("btnXy2"));
  14952. this.n74 = (this.getChild("n74"));
  14953. this.xy1 = (this.getChild("xy1"));
  14954. this.txtTitle = (this.getChild("txtTitle"));
  14955. this.btnBack = (this.getChild("btnBack"));
  14956. this.xyList = (this.getChild("xyList"));
  14957. this.xy2 = (this.getChild("xy2"));
  14958. this.xyNode = (this.getChild("xyNode"));
  14959. }
  14960. }
  14961. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  14962. class ui_ageNode extends fgui.GComponent {
  14963. static createInstance() {
  14964. return (fgui.UIPackage.createObject("loading", "ageNode"));
  14965. }
  14966. onConstruct() {
  14967. this.n3 = (this.getChild("n3"));
  14968. this.n7 = (this.getChild("n7"));
  14969. this.n4 = (this.getChild("n4"));
  14970. this.btnAge = (this.getChild("btnAge"));
  14971. this.ageNode = (this.getChild("ageNode"));
  14972. }
  14973. }
  14974. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  14975. class ui_rnNode extends fgui.GComponent {
  14976. static createInstance() {
  14977. return (fgui.UIPackage.createObject("loading", "rnNode"));
  14978. }
  14979. onConstruct() {
  14980. this.n28 = (this.getChild("n28"));
  14981. this.n30 = (this.getChild("n30"));
  14982. this.n33 = (this.getChild("n33"));
  14983. this.rn1 = (this.getChild("rn1"));
  14984. this.n40 = (this.getChild("n40"));
  14985. this.n41 = (this.getChild("n41"));
  14986. this.rn3 = (this.getChild("rn3"));
  14987. this.n37 = (this.getChild("n37"));
  14988. this.n39 = (this.getChild("n39"));
  14989. this.rn2 = (this.getChild("rn2"));
  14990. this.n47 = (this.getChild("n47"));
  14991. this.n49 = (this.getChild("n49"));
  14992. this.n44 = (this.getChild("n44"));
  14993. this.inputCode = (this.getChild("inputCode"));
  14994. this.inputName = (this.getChild("inputName"));
  14995. this.n48 = (this.getChild("n48"));
  14996. this.n50 = (this.getChild("n50"));
  14997. this.rn4 = (this.getChild("rn4"));
  14998. this.btnCheck = (this.getChild("btnCheck"));
  14999. this.btnExit = (this.getChild("btnExit"));
  15000. this.btnDone = (this.getChild("btnDone"));
  15001. this.rnNode = (this.getChild("rnNode"));
  15002. }
  15003. }
  15004. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  15005. class ui_tipNode extends fgui.GComponent {
  15006. static createInstance() {
  15007. return (fgui.UIPackage.createObject("loading", "tipNode"));
  15008. }
  15009. onConstruct() {
  15010. this.bg = (this.getChild("bg"));
  15011. this.n55 = (this.getChild("n55"));
  15012. this.n56 = (this.getChild("n56"));
  15013. this.tipNode = (this.getChild("tipNode"));
  15014. }
  15015. }
  15016. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  15017. class ui_fcmNode extends fgui.GComponent {
  15018. static createInstance() {
  15019. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  15020. }
  15021. onConstruct() {
  15022. this.n63 = (this.getChild("n63"));
  15023. this.n62 = (this.getChild("n62"));
  15024. this.btnRn = (this.getChild("btnRn"));
  15025. this.n61 = (this.getChild("n61"));
  15026. this.n58 = (this.getChild("n58"));
  15027. this.fcmNode = (this.getChild("fcmNode"));
  15028. }
  15029. }
  15030. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  15031. class ui_msgNode extends fgui.GComponent {
  15032. static createInstance() {
  15033. return (fgui.UIPackage.createObject("loading", "msgNode"));
  15034. }
  15035. onConstruct() {
  15036. this.n69 = (this.getChild("n69"));
  15037. this.txtMsg = (this.getChild("txtMsg"));
  15038. this.msgNode = (this.getChild("msgNode"));
  15039. }
  15040. }
  15041. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  15042. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  15043. static createInstance() {
  15044. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  15045. }
  15046. onConstruct() {
  15047. this.n1 = (this.getChild("n1"));
  15048. this.n13 = (this.getChild("n13"));
  15049. this.n14 = (this.getChild("n14"));
  15050. this.n15 = (this.getChild("n15"));
  15051. this.n3 = (this.getChild("n3"));
  15052. this.n4 = (this.getChild("n4"));
  15053. this.n5 = (this.getChild("n5"));
  15054. this.n6 = (this.getChild("n6"));
  15055. this.n7 = (this.getChild("n7"));
  15056. this.n8 = (this.getChild("n8"));
  15057. this.n9 = (this.getChild("n9"));
  15058. this.n10 = (this.getChild("n10"));
  15059. this.n12 = (this.getChild("n12"));
  15060. this.n11 = (this.getChild("n11"));
  15061. this.n16 = (this.getChild("n16"));
  15062. this.n17 = (this.getChild("n17"));
  15063. this.n18 = (this.getChild("n18"));
  15064. this.n20 = (this.getChild("n20"));
  15065. this.n21 = (this.getChild("n21"));
  15066. this.t0 = this.getTransition("t0");
  15067. }
  15068. }
  15069. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  15070. class ui_btn5 extends fgui.GButton {
  15071. static createInstance() {
  15072. return (fgui.UIPackage.createObject("loading", "btn5"));
  15073. }
  15074. onConstruct() {
  15075. this.n9 = (this.getChild("n9"));
  15076. this.n1 = (this.getChild("n1"));
  15077. }
  15078. }
  15079. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  15080. class ui_UILoading extends fgui.GComponent {
  15081. static createInstance() {
  15082. return (fgui.UIPackage.createObject("loading", "UILoading"));
  15083. }
  15084. onConstruct() {
  15085. this.n12 = (this.getChild("n12"));
  15086. this.loadinfo = (this.getChild("loadinfo"));
  15087. this.n13 = (this.getChild("n13"));
  15088. this.txtLoad = (this.getChild("txtLoad"));
  15089. this.n18 = (this.getChild("n18"));
  15090. }
  15091. }
  15092. ui_UILoading.URL = "ui://37nctnhwphc33";
  15093. class ui_AgeItem extends fgui.GComponent {
  15094. static createInstance() {
  15095. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  15096. }
  15097. onConstruct() {
  15098. this.txtAge = (this.getChild("txtAge"));
  15099. }
  15100. }
  15101. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  15102. class ui_btn1 extends fgui.GButton {
  15103. static createInstance() {
  15104. return (fgui.UIPackage.createObject("loading", "btn1"));
  15105. }
  15106. onConstruct() {
  15107. this.n6 = (this.getChild("n6"));
  15108. this.n1 = (this.getChild("n1"));
  15109. }
  15110. }
  15111. ui_btn1.URL = "ui://37nctnhwxe622p";
  15112. class ui_btn3 extends fgui.GButton {
  15113. static createInstance() {
  15114. return (fgui.UIPackage.createObject("loading", "btn3"));
  15115. }
  15116. onConstruct() {
  15117. this.n9 = (this.getChild("n9"));
  15118. this.n1 = (this.getChild("n1"));
  15119. }
  15120. }
  15121. ui_btn3.URL = "ui://37nctnhwxe622s";
  15122. class ui_btn2 extends fgui.GButton {
  15123. static createInstance() {
  15124. return (fgui.UIPackage.createObject("loading", "btn2"));
  15125. }
  15126. onConstruct() {
  15127. this.n6 = (this.getChild("n6"));
  15128. this.n1 = (this.getChild("n1"));
  15129. }
  15130. }
  15131. ui_btn2.URL = "ui://37nctnhwxe622t";
  15132. class ui_btnBack extends fgui.GButton {
  15133. static createInstance() {
  15134. return (fgui.UIPackage.createObject("loading", "btnBack"));
  15135. }
  15136. onConstruct() {
  15137. this.n6 = (this.getChild("n6"));
  15138. this.n7 = (this.getChild("n7"));
  15139. }
  15140. }
  15141. ui_btnBack.URL = "ui://37nctnhwxe622u";
  15142. class ui_btnXy1 extends fgui.GButton {
  15143. static createInstance() {
  15144. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  15145. }
  15146. onConstruct() {
  15147. this.n1 = (this.getChild("n1"));
  15148. }
  15149. }
  15150. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  15151. class ui_btnXy2 extends fgui.GButton {
  15152. static createInstance() {
  15153. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  15154. }
  15155. onConstruct() {
  15156. this.n1 = (this.getChild("n1"));
  15157. }
  15158. }
  15159. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  15160. class ui_btnXy3 extends fgui.GButton {
  15161. static createInstance() {
  15162. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  15163. }
  15164. onConstruct() {
  15165. this.n1 = (this.getChild("n1"));
  15166. }
  15167. }
  15168. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  15169. class ui_btn4 extends fgui.GButton {
  15170. static createInstance() {
  15171. return (fgui.UIPackage.createObject("loading", "btn4"));
  15172. }
  15173. onConstruct() {
  15174. this.n9 = (this.getChild("n9"));
  15175. this.n1 = (this.getChild("n1"));
  15176. }
  15177. }
  15178. ui_btn4.URL = "ui://37nctnhwxe622z";
  15179. class loadingBinder {
  15180. static bindAll() {
  15181. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  15182. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  15183. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  15184. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  15185. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  15186. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  15187. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  15188. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  15189. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  15190. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  15191. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  15192. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  15193. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  15194. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  15195. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  15196. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  15197. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  15198. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  15199. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  15200. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  15201. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  15202. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  15203. }
  15204. }
  15205. class UIMgr {
  15206. constructor() {
  15207. this._stage = null;
  15208. this._uiList = [];
  15209. this._showList = [];
  15210. this._bindPkgList = [];
  15211. this.uiIndex = 0;
  15212. }
  15213. static get inst() {
  15214. if (UIMgr._inst == null) {
  15215. UIMgr._inst = new UIMgr();
  15216. }
  15217. return UIMgr._inst;
  15218. }
  15219. setStage(s) {
  15220. if (this._stage) {
  15221. console.log("ViewMgr::Stage->舞台不可赋值两次");
  15222. return;
  15223. }
  15224. this._stage = s;
  15225. }
  15226. clearTempData() {
  15227. console.log('zh:clearTempData start');
  15228. Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level');
  15229. console.log('zh:clearTempData end');
  15230. }
  15231. init() {
  15232. this.setStage(Laya.stage);
  15233. fairygui.UIConfig.defaultFont = "微软雅黑";
  15234. fairygui.UIConfig.modalLayerColor = "rgba(0,0,0,0.9)";
  15235. fairygui.UIConfig.packageFileExtension = "obj";
  15236. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  15237. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  15238. fairygui.GRoot.inst.width = Laya.stage.width;
  15239. fairygui.GRoot.inst.height = Laya.stage.height;
  15240. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  15241. }
  15242. addAllUpdate() {
  15243. this.uiIndex = 0;
  15244. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  15245. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  15246. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  15247. }
  15248. }
  15249. }
  15250. bindFUI(pkgname) {
  15251. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  15252. return;
  15253. }
  15254. switch (pkgname) {
  15255. case fguiRes.loading:
  15256. fairygui.UIPackage.addPackage(pkgname);
  15257. loadingBinder.bindAll();
  15258. this._bindPkgList.push(pkgname);
  15259. break;
  15260. case fguiRes.game:
  15261. fairygui.UIPackage.addPackage(pkgname);
  15262. gameBinder.bindAll();
  15263. this._bindPkgList.push(pkgname);
  15264. break;
  15265. default:
  15266. break;
  15267. }
  15268. }
  15269. Show(cls, ...param) {
  15270. let nameStr = cls.uiName;
  15271. for (let i = this._uiList.length - 1; i >= 0; i--) {
  15272. let temp = this._uiList[i];
  15273. let str = temp.className;
  15274. if (str == nameStr) {
  15275. if (temp.isMuti) {
  15276. if (temp.isHide) {
  15277. temp.show(...param);
  15278. this._uiList.splice(i, 1);
  15279. this._uiList.push(temp);
  15280. return temp;
  15281. }
  15282. }
  15283. else {
  15284. temp.show(...param);
  15285. this._uiList.splice(i, 1);
  15286. this._uiList.push(temp);
  15287. return temp;
  15288. }
  15289. }
  15290. }
  15291. let ui = new cls();
  15292. ui.className = nameStr;
  15293. this._showUI(ui, param);
  15294. return ui;
  15295. }
  15296. destroyUI(ui) {
  15297. for (let i = this._uiList.length - 1; i >= 0; i--) {
  15298. let temp = this._uiList[i].className;
  15299. if (temp == ui.className) {
  15300. this._uiList.splice(i, 1);
  15301. break;
  15302. }
  15303. }
  15304. this.checkUIState();
  15305. }
  15306. _showUI(ui, param) {
  15307. this._uiList.push(ui);
  15308. ui.show(...param);
  15309. }
  15310. Hide(uiClass) {
  15311. let ui = this.getUI(uiClass);
  15312. if (ui && !ui.isHide) {
  15313. ui.hide();
  15314. }
  15315. }
  15316. getUI(ui) {
  15317. let nameStr = ui.uiName;
  15318. for (let index = 0; index < this._uiList.length; index++) {
  15319. let temp = this._uiList[index];
  15320. if (temp.className == nameStr) {
  15321. return temp;
  15322. }
  15323. }
  15324. return null;
  15325. }
  15326. isShow(cls) {
  15327. for (var i of this._uiList) {
  15328. if (i instanceof cls) {
  15329. return i.isShowing;
  15330. }
  15331. }
  15332. return false;
  15333. }
  15334. showUINum() {
  15335. let num = 0;
  15336. for (var i of this._uiList) {
  15337. if (i.isShowing) {
  15338. num++;
  15339. }
  15340. }
  15341. return num;
  15342. }
  15343. checkUIState() {
  15344. Laya.timer.clear(this, this._uiCheck);
  15345. Laya.timer.once(400, this, this._uiCheck);
  15346. }
  15347. _uiCheck() {
  15348. let showList = [];
  15349. for (var i of this._uiList) {
  15350. if (!i.isHide) {
  15351. showList.push(i);
  15352. }
  15353. }
  15354. for (let index = 0; index < showList.length; index++) {
  15355. if (index == showList.length - 1) {
  15356. showList[index].checkActive(true);
  15357. }
  15358. else {
  15359. showList[index].checkActive(false);
  15360. }
  15361. }
  15362. }
  15363. showTip(msg, time = 600, size = 30) {
  15364. }
  15365. }
  15366. class UIShowList {
  15367. }
  15368. class SoundMgr {
  15369. constructor() {
  15370. this.soundMax = 4;
  15371. this.isLoad = false;
  15372. this.soundMap = {};
  15373. this.isSound = true;
  15374. this.openShake = true;
  15375. SoundMgr._instance = this;
  15376. }
  15377. static getInstance() {
  15378. if (!this._instance) {
  15379. this._instance = new SoundMgr();
  15380. }
  15381. return this._instance;
  15382. }
  15383. init() {
  15384. console.log('zh:sm init 1');
  15385. Laya.SoundManager.autoReleaseSound = true;
  15386. Laya.SoundManager.autoStopMusic = true;
  15387. Laya.SoundManager.musicVolume = 0.3;
  15388. Laya.SoundManager.soundVolume = 0.5;
  15389. this.musicPlayed = false;
  15390. this.audioUrl = "asset/sound/ogg/";
  15391. console.log('zh:sm init 2');
  15392. console.log('zh:dev type ');
  15393. if (Laya.Browser.onAndroid) {
  15394. console.log('zh:dev type android');
  15395. this.audioUrl = "asset/sound/ogg/";
  15396. this.isLoad = true;
  15397. }
  15398. else {
  15399. console.log('zh:dev type not android');
  15400. this.audioUrl = "asset/sound/mp3/";
  15401. this.isLoad = true;
  15402. }
  15403. }
  15404. onSetting(isS) {
  15405. this.isSound = isS;
  15406. this.mute(!this.isSound);
  15407. }
  15408. clearCount() {
  15409. for (var key in this.soundMap) {
  15410. delete this.soundMap[key];
  15411. }
  15412. }
  15413. playMusic(path, loop = 0) {
  15414. console.log('zh:playMusic 1 PATH=' + path);
  15415. this.musicPath = path;
  15416. if (!this.isLoad)
  15417. console.log('zh:playMusic 2');
  15418. return;
  15419. if (!path || path == "")
  15420. console.log('zh:playMusic 3');
  15421. return;
  15422. if (!this.isSound)
  15423. console.log('zh:playMusic 4');
  15424. return;
  15425. this.musicPlayed = true;
  15426. console.log('zh:playMusic 5');
  15427. let url = this.getUrl(path);
  15428. console.log('zh:playMusic 6' + url);
  15429. if (Laya.Browser.onPC) {
  15430. console.log('zh:playMusic 7');
  15431. Laya.loader.load(url, Laya.Handler.create(this, () => {
  15432. console.log('zh:playMusic 8');
  15433. this.play(url, loop);
  15434. }));
  15435. }
  15436. else
  15437. this.play(url, loop);
  15438. }
  15439. play(url, loop) {
  15440. Laya.SoundManager.playMusic(url, loop);
  15441. }
  15442. getUrl(path) {
  15443. let url = this.audioUrl + path;
  15444. if (Laya.Browser.onAndroid) {
  15445. url += ".ogg";
  15446. }
  15447. else {
  15448. url += ".mp3";
  15449. }
  15450. return url;
  15451. }
  15452. pauseMusic(pause) {
  15453. if (pause) {
  15454. this.mute(true);
  15455. }
  15456. else if (this.isSound)
  15457. this.mute(false);
  15458. }
  15459. stopMusic() {
  15460. Laya.SoundManager.stopMusic();
  15461. if (Moyu.isNeedPlatAudio) {
  15462. Moyu.stopMusic();
  15463. }
  15464. }
  15465. mute(mute) {
  15466. if (Moyu.isNeedPlatAudio) {
  15467. Moyu.pauseMusic(mute);
  15468. }
  15469. else {
  15470. Laya.SoundManager.musicMuted = mute;
  15471. if (!mute && !this.musicPlayed && this.musicPath) {
  15472. this.playMusic(this.musicPath);
  15473. }
  15474. }
  15475. }
  15476. stopSound(path) {
  15477. let url = this.getUrl(path);
  15478. Laya.SoundManager.stopSound(url);
  15479. }
  15480. playSound(path, loop = 1, soundMax = this.soundMax) {
  15481. if (!this.isLoad)
  15482. return;
  15483. if (!this.isSound)
  15484. return;
  15485. if (!path || path == "")
  15486. return;
  15487. let url = this.getUrl(path);
  15488. if (Moyu.isNeedPlatAudio) {
  15489. Moyu.playSound(path, loop == 0);
  15490. }
  15491. else {
  15492. let count = 1;
  15493. if (this.soundMap[path])
  15494. count = this.soundMap[path] + 1;
  15495. if (count > soundMax)
  15496. return;
  15497. this.soundMap[path] = count;
  15498. Laya.SoundManager.playSound(url, loop);
  15499. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  15500. }
  15501. }
  15502. removePath(path) {
  15503. if (this.soundMap[path]) {
  15504. let count = this.soundMap[path];
  15505. count--;
  15506. if (count < 1)
  15507. delete this.soundMap[path];
  15508. else
  15509. this.soundMap[path] = count;
  15510. }
  15511. }
  15512. playBtnSound() {
  15513. this.playSound("btn");
  15514. }
  15515. playGetSound() {
  15516. }
  15517. playCloseUISound() {
  15518. }
  15519. }
  15520. SoundMgr._instance = null;
  15521. var Handler$1 = Laya.Handler;
  15522. var EResType;
  15523. (function (EResType) {
  15524. EResType[EResType["none"] = 0] = "none";
  15525. EResType[EResType["nromal"] = 1] = "nromal";
  15526. EResType[EResType["td"] = 2] = "td";
  15527. EResType[EResType["sk"] = 3] = "sk";
  15528. })(EResType || (EResType = {}));
  15529. class CResLoader {
  15530. constructor(doneCall, proCall) {
  15531. this.completrCall = doneCall;
  15532. this.progressCall = proCall;
  15533. this.progressHander = new Handler$1(this, this.onProgress);
  15534. this.tdResMap = {};
  15535. }
  15536. load(resList) {
  15537. this.resCount = 0;
  15538. this.loadCount = 0;
  15539. for (let i = 0; i < resList.length; i++) {
  15540. let path = resList[i];
  15541. if (!path)
  15542. continue;
  15543. this.resCount++;
  15544. let type = this.getResType(path);
  15545. if (type == EResType.nromal)
  15546. this.loadNromal(path);
  15547. else if (type == EResType.td)
  15548. this.loadTd(path);
  15549. }
  15550. }
  15551. getRes(path) {
  15552. let type = this.getResType(path);
  15553. if (type == EResType.nromal)
  15554. return Laya.loader.getRes(path);
  15555. else if (type == EResType.td) {
  15556. let res = this.tdResMap[path];
  15557. if (res)
  15558. return res.clone();
  15559. return null;
  15560. }
  15561. }
  15562. destroy() {
  15563. this.progressHander.clear();
  15564. this.progressHander = null;
  15565. }
  15566. clearRes(path) {
  15567. let type = this.getResType(path);
  15568. if (type == EResType.nromal)
  15569. Laya.loader.clearRes(path);
  15570. else if (type == EResType.td) {
  15571. let obj = this.tdResMap[path];
  15572. if (obj)
  15573. obj.destroy();
  15574. delete this.tdResMap[path];
  15575. }
  15576. }
  15577. getResType(path) {
  15578. let exs = this.getExtension(path);
  15579. if (exs == "sk")
  15580. return EResType.sk;
  15581. if (exs == "ls" || exs == "lh" || exs == "lm")
  15582. return EResType.td;
  15583. else
  15584. return EResType.nromal;
  15585. }
  15586. getExtension(res) {
  15587. var index = res.lastIndexOf(".");
  15588. return res.substr(index + 1);
  15589. }
  15590. loadNromal(path) {
  15591. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  15592. if (res) {
  15593. this.onLoad();
  15594. }
  15595. else
  15596. console.log("load res fail:" + path);
  15597. }), this.progressHander);
  15598. }
  15599. loadSk() {
  15600. }
  15601. loadTd(path) {
  15602. if (this.tdResMap[path]) {
  15603. this.onLoad();
  15604. return;
  15605. }
  15606. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  15607. if (res) {
  15608. this.tdResMap[path] = res;
  15609. this.onLoad();
  15610. }
  15611. else
  15612. console.log("load res fail:" + path);
  15613. }));
  15614. }
  15615. onLoad() {
  15616. this.loadCount++;
  15617. this.onProgress(1);
  15618. if (this.loadCount >= this.resCount) {
  15619. this.completrCall.run();
  15620. }
  15621. }
  15622. onProgress(pro) {
  15623. let progress = (this.loadCount + pro) / this.resCount;
  15624. this.progressCall.runWith(progress);
  15625. }
  15626. }
  15627. var Handler$2 = Laya.Handler;
  15628. class ResInfo {
  15629. constructor() {
  15630. this.index = 0;
  15631. }
  15632. }
  15633. class ResMgr {
  15634. constructor() {
  15635. this.resList = [];
  15636. this.doneList = [];
  15637. this.resMap = {};
  15638. this.currentLoad = null;
  15639. this.completeHandler = new Handler$2(this, this.onComplete);
  15640. this.progressHandler = new Handler$2(this, this.onProgress);
  15641. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  15642. }
  15643. static getInstance() {
  15644. if (ResMgr._instance == null) {
  15645. ResMgr._instance = new ResMgr();
  15646. }
  15647. return ResMgr._instance;
  15648. }
  15649. loadList(list, completeHandler, progressHandler) {
  15650. if (list.length < 1) {
  15651. completeHandler.run();
  15652. return;
  15653. }
  15654. let info = this.getResInfo();
  15655. info.resList = list;
  15656. info.completeHandler = completeHandler;
  15657. info.progressHandler = progressHandler;
  15658. this.resList.push(info);
  15659. this.startLoad();
  15660. }
  15661. loadFguiRes(list, completeHandler, progressHandler) {
  15662. Laya.loader.load(list, completeHandler, progressHandler);
  15663. }
  15664. loadAny(list, completeHandler, progressHandler) {
  15665. Laya.loader.load(list, completeHandler, progressHandler);
  15666. }
  15667. load(path, completeHandler, progressHandler) {
  15668. let count = this.resMap[path];
  15669. if (count && count > 0) {
  15670. if (completeHandler)
  15671. completeHandler.run();
  15672. }
  15673. else
  15674. this.loadList([path], completeHandler, progressHandler);
  15675. }
  15676. getRes(path) {
  15677. let res = this.resMap[path];
  15678. if (!res)
  15679. this.showLog("资源不存在:" + path);
  15680. else
  15681. return this.loader.getRes(path);
  15682. }
  15683. clearList(list, force = false) {
  15684. if (!list || list.length < 1)
  15685. return;
  15686. let cr = () => {
  15687. for (const k in list) {
  15688. let v = list[k];
  15689. if (!v)
  15690. continue;
  15691. if (force) {
  15692. this.loader.clearRes(v);
  15693. delete this.resMap[v];
  15694. }
  15695. else {
  15696. let count = this.resMap[v];
  15697. if (count && count > 1) {
  15698. count--;
  15699. this.resMap[v] = count;
  15700. }
  15701. else {
  15702. this.loader.clearRes(v);
  15703. delete this.resMap[v];
  15704. }
  15705. }
  15706. }
  15707. if (!window.hasOwnProperty("ks"))
  15708. Laya.Resource.destroyUnusedResources();
  15709. };
  15710. Laya.timer.clearAll(this);
  15711. Laya.timer.once(2000, this, cr);
  15712. }
  15713. clear3D() {
  15714. for (const k in this.loader.tdResMap) {
  15715. this.loader.clearRes(k);
  15716. if (this.resMap[k])
  15717. delete this.resMap[k];
  15718. }
  15719. if (!window.hasOwnProperty("ks"))
  15720. Laya.Resource.destroyUnusedResources();
  15721. }
  15722. clear(path, force = false) {
  15723. this.clearList([path], force);
  15724. }
  15725. getResInfo() {
  15726. if (this.doneList.length > 0)
  15727. return this.doneList.pop();
  15728. else
  15729. return new ResInfo();
  15730. }
  15731. startLoad() {
  15732. if (this.currentLoad)
  15733. return;
  15734. this.currentLoad = this.resList.pop();
  15735. if (this.currentLoad) {
  15736. this.loader.load(this.currentLoad.resList);
  15737. }
  15738. }
  15739. onComplete() {
  15740. if (!this.currentLoad)
  15741. return;
  15742. for (const k in this.currentLoad.resList) {
  15743. let v = this.currentLoad.resList[k];
  15744. let count = this.resMap[v];
  15745. if (count)
  15746. count++;
  15747. else
  15748. count = 1;
  15749. this.resMap[v] = count;
  15750. }
  15751. if (this.currentLoad.completeHandler)
  15752. this.currentLoad.completeHandler.run();
  15753. this.doneList.push(this.currentLoad);
  15754. this.currentLoad = null;
  15755. this.startLoad();
  15756. }
  15757. onProgress(pro) {
  15758. if (!this.currentLoad)
  15759. return;
  15760. if (this.currentLoad.progressHandler)
  15761. this.currentLoad.progressHandler.runWith(pro);
  15762. }
  15763. showLog(str, ...args) {
  15764. console.log("[ResLoader] " + str);
  15765. }
  15766. }
  15767. ResMgr._instance = null;
  15768. class EventMgr extends Laya.EventDispatcher {
  15769. }
  15770. let eventMgr = new EventMgr();
  15771. class ConfigMgr {
  15772. static getInstance() {
  15773. if (!this._instance) {
  15774. this._instance = new ConfigMgr();
  15775. }
  15776. return this._instance;
  15777. }
  15778. init() {
  15779. this.npcJson = Laya.loader.getRes("res/json/npc.json").Data;
  15780. this.classicCfg = Laya.loader.getRes("res/json/classicCfg.json");
  15781. this.levelCfg = Laya.loader.getRes("res/json/levelCfg.json");
  15782. this.placeBallCfg = Laya.loader.getRes("res/json/placeBallCfg.json");
  15783. }
  15784. getUserInfoByIndex(index) {
  15785. return this.npcJson[index];
  15786. }
  15787. getRandomUserInfo() {
  15788. let index = xGame.tools.random(0, this.npcJson.length);
  15789. return this.npcJson[index];
  15790. }
  15791. getMaxBigMoveLength() {
  15792. return Object.keys(this.levelCfg).length;
  15793. }
  15794. getBigMoveLevelByIndex(index) {
  15795. let cfg = this.levelCfg;
  15796. cfg = cfg[index];
  15797. return cfg;
  15798. }
  15799. getRandomClassicLevel() {
  15800. let cfg = this.classicCfg;
  15801. let num = Object.keys(cfg).length;
  15802. let rand = xGame.common.randomNum(1, num);
  15803. return cfg[rand];
  15804. }
  15805. getPlaceBallByLevel(level) {
  15806. return this.placeBallCfg[level];
  15807. }
  15808. getMaxPlaceBall() {
  15809. return Object.keys(this.placeBallCfg).length;
  15810. }
  15811. }
  15812. class PoolD3Mgr {
  15813. constructor() {
  15814. this.pool = {};
  15815. }
  15816. static get ins() {
  15817. return this._ins || (this._ins = new PoolD3Mgr);
  15818. }
  15819. createList(key, prefab, parent) {
  15820. if (!this.pool[key]) {
  15821. this.pool[key] = {};
  15822. this.pool[key].prefab = prefab;
  15823. this.pool[key].list = [];
  15824. this.pool[key].parent = parent;
  15825. }
  15826. }
  15827. getItem(key) {
  15828. if (!this.pool[key]) {
  15829. return;
  15830. }
  15831. let temp;
  15832. if (this.pool[key].list.length > 0) {
  15833. temp = this.pool[key].list.pop();
  15834. }
  15835. else {
  15836. temp = this.pool[key].prefab.clone();
  15837. if (this.pool[key].parent) {
  15838. this.pool[key].parent.addChild(temp);
  15839. }
  15840. }
  15841. temp.active = true;
  15842. return temp;
  15843. }
  15844. putItem(key, obj) {
  15845. if (!this.pool[key]) {
  15846. return;
  15847. }
  15848. obj.active = false;
  15849. this.pool[key].list.push(obj);
  15850. }
  15851. }
  15852. let context$1 = context;
  15853. let uiMgr = UIMgr.inst;
  15854. let soundMgr = SoundMgr.getInstance();
  15855. let resMgr = ResMgr.getInstance();
  15856. let httpMgr = HttpMgr.getInstance();
  15857. let common = Common.getInstance();
  15858. let cfgMgr = ConfigMgr.getInstance();
  15859. let poolD3Mgr = PoolD3Mgr.ins;
  15860. let d3TexUrl = "res/d3Res/";
  15861. let d3ModeUrl = "res/unityRes/";
  15862. function setStageSize(view) {
  15863. if (view.width) {
  15864. view.width = Laya.stage.width;
  15865. view.height = Laya.stage.height;
  15866. }
  15867. }
  15868. function filledBg(view) {
  15869. let wh = Laya.stage.height / Laya.stage.width;
  15870. if (wh > 16 / 9) {
  15871. view.height = Laya.stage.height;
  15872. view.width = Laya.stage.height / 1334 * 750;
  15873. }
  15874. else {
  15875. view.width = Laya.stage.width;
  15876. view.height = Laya.stage.width / 750 * 1334;
  15877. }
  15878. }
  15879. function setNotch(view) {
  15880. if (view.height) {
  15881. view.y += context$1.notchHeight;
  15882. }
  15883. }
  15884. function showTip(str) {
  15885. uiMgr.Show(UIMsg, str);
  15886. }
  15887. function log(...args) {
  15888. console.log(args);
  15889. }
  15890. let xGame = {
  15891. context: context$1,
  15892. eventMgr,
  15893. resMgr,
  15894. uiMgr,
  15895. soundMgr,
  15896. define,
  15897. tools,
  15898. httpMgr,
  15899. d3TexUrl,
  15900. d3ModeUrl,
  15901. common,
  15902. cfgMgr,
  15903. poolD3Mgr,
  15904. setStageSize,
  15905. filledBg,
  15906. setNotch,
  15907. showTip,
  15908. log,
  15909. };
  15910. window["xGame"] = xGame;
  15911. let dataName = 'tBall_';
  15912. class UserData {
  15913. constructor() {
  15914. this.userId = "";
  15915. this.isAgree = false;
  15916. this.coinNum = 0;
  15917. this.gemNum = 0;
  15918. this.sound = true;
  15919. this.vibration = true;
  15920. this.currentDate = 0;
  15921. this.createTime = 0;
  15922. this.awardTime = 0;
  15923. this.roleId = 1;
  15924. this.roleList = [];
  15925. this.roleAds = [];
  15926. this.dressId = 101;
  15927. this.itemId = 201;
  15928. this.bigSkills = [1, 1, 1, 1, 1];
  15929. this.coin = 4000;
  15930. this.diamond = 0;
  15931. this.skillSuccessTimes = 0;
  15932. this.skillGuide = 0;
  15933. this.skillAccTimes = 0;
  15934. this.placeBallData = [];
  15935. this.shareDiamondTimes = 0;
  15936. this.dailyVideoShareTimes = 0;
  15937. this.secretary = [1, 0];
  15938. this.curSecretary = 0;
  15939. this.ballRod = [1, 0, 0, 0, 0, 1];
  15940. this.curBallRod = 5;
  15941. this.signData = 0;
  15942. this.signTime = 0;
  15943. this.drawTimes = 0;
  15944. this.drawAwardTimes = 0;
  15945. this.dailyfreeDrawTimes = 1;
  15946. this.power = 5;
  15947. this.powerTime = 0;
  15948. this.challengeTimes = 0;
  15949. this.extraSign = 0;
  15950. this.classicTimes = 0;
  15951. this.guideHelpLine = 0;
  15952. this.newUser = true;
  15953. this.rootBallFoul = 0;
  15954. this.timeoutFoul = 0;
  15955. this.roleList = [1];
  15956. }
  15957. saveData() {
  15958. let data = {};
  15959. for (let k in this) {
  15960. data[k.toString()] = this[k];
  15961. }
  15962. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  15963. }
  15964. getData() {
  15965. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  15966. if (ld) {
  15967. let localData = JSON.parse(ld);
  15968. if (localData) {
  15969. for (let k in this) {
  15970. let key = k.toString();
  15971. let data = localData[key];
  15972. if (data != undefined) {
  15973. this[k] = data;
  15974. }
  15975. }
  15976. }
  15977. }
  15978. }
  15979. }
  15980. class ItemData {
  15981. constructor() {
  15982. this.itemList = {};
  15983. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  15984. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  15985. }
  15986. saveData() {
  15987. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  15988. }
  15989. getData() {
  15990. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  15991. if (ld) {
  15992. let localData = JSON.parse(ld);
  15993. if (localData) {
  15994. this.itemList = localData;
  15995. }
  15996. }
  15997. }
  15998. }
  15999. class GameData {
  16000. constructor() {
  16001. this.curLevel = 0;
  16002. this.gameType = 1;
  16003. this.signIdx = 0;
  16004. this.signMax = 0;
  16005. this.rotaryTime = 0;
  16006. this.rotaryCount = 0;
  16007. this.rotaryList = [];
  16008. this.diyCount = 3;
  16009. this.awardIdx = 0;
  16010. this.shareNum = 2;
  16011. this.rankWeek = 0;
  16012. this.rankScore = 0;
  16013. this.gameCount = 0;
  16014. this.trySkill = -1;
  16015. this.tryTime = 0;
  16016. }
  16017. saveData() {
  16018. let data = {};
  16019. for (let k in this) {
  16020. data[k.toString()] = this[k];
  16021. }
  16022. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  16023. }
  16024. getData() {
  16025. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  16026. if (ld) {
  16027. let localData = JSON.parse(ld);
  16028. if (localData) {
  16029. for (let k in this) {
  16030. let key = k.toString();
  16031. let data = localData[key];
  16032. if (data != undefined) {
  16033. this[k] = data;
  16034. }
  16035. }
  16036. }
  16037. }
  16038. }
  16039. }
  16040. class DataMgr {
  16041. static Init() {
  16042. this.userData = new UserData();
  16043. this.gameData = new GameData();
  16044. this.itemData = new ItemData();
  16045. this.userData.getData();
  16046. this.gameData.getData();
  16047. this.itemData.getData();
  16048. this.roleId = this.userData.roleId;
  16049. this.resetUse();
  16050. }
  16051. static isNewDay() {
  16052. Moyu.isNewDay(this, (isnew) => {
  16053. xGame.common.isNewDay = isnew;
  16054. if (!isnew)
  16055. return;
  16056. DataMgr.setShareDiamondTimes(0, false);
  16057. DataMgr.setDailyVideoShareTimes(0, false);
  16058. DataMgr.setDailyfreeDrawTimes(1);
  16059. DataMgr.setExtraSign(0);
  16060. });
  16061. }
  16062. static deletData() {
  16063. Laya.LocalStorage.clear();
  16064. }
  16065. static upRankData() {
  16066. let num = xGame.common.getAllStarNum();
  16067. if (num > 0)
  16068. Moyu.upRankData(xGame.common.curRankID, num);
  16069. }
  16070. static addItem(id, count = 1) {
  16071. let v = this.itemData.itemList[id];
  16072. if (!v)
  16073. v = { id: id, count: count, adnum: 0, active: true };
  16074. else {
  16075. if (v.active) {
  16076. v.count += count;
  16077. }
  16078. else {
  16079. v.count = count;
  16080. v.active = true;
  16081. }
  16082. }
  16083. this.itemData.itemList[id] = v;
  16084. xGame.soundMgr.playGetSound();
  16085. this.saveItemData();
  16086. }
  16087. static hasItem(id) {
  16088. let v = this.itemData.itemList[id];
  16089. if (v && v.active)
  16090. return true;
  16091. return false;
  16092. }
  16093. static getItem(id) {
  16094. let v = this.itemData.itemList[id];
  16095. return v;
  16096. }
  16097. static getItemCount(id) {
  16098. let v = this.itemData.itemList[id];
  16099. if (v && v.active)
  16100. return v.count;
  16101. return 0;
  16102. }
  16103. static getItemAd(id) {
  16104. let v = this.itemData.itemList[id];
  16105. if (v) {
  16106. return v.adnum;
  16107. }
  16108. return 0;
  16109. }
  16110. static onItemAd(id, num = 1) {
  16111. let v = this.itemData.itemList[id];
  16112. if (!v)
  16113. v = { id: id, count: 1, adnum: num, active: false };
  16114. else
  16115. v.adnum += num;
  16116. this.itemData.itemList[id] = v;
  16117. this.saveItemData();
  16118. }
  16119. static costItem(id, count) {
  16120. let v = this.itemData.itemList[id];
  16121. if (v && v.active) {
  16122. if (v.count < count)
  16123. return false;
  16124. else {
  16125. v.count -= count;
  16126. this.itemData.itemList[id] = v;
  16127. return true;
  16128. }
  16129. }
  16130. return false;
  16131. }
  16132. static resetUse() {
  16133. this.dressId = this.userData.dressId;
  16134. this.itemId = this.userData.itemId;
  16135. }
  16136. static passLevel() {
  16137. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  16138. this.gameData.curLevel++;
  16139. this.curLevel = this.gameData.curLevel;
  16140. this.saveGameData();
  16141. }
  16142. static useRole(id) {
  16143. this.roleId = id;
  16144. if (this.hasRole(id)) {
  16145. this.userData.roleId = id;
  16146. this.saveUserData();
  16147. }
  16148. }
  16149. static addRole(id) {
  16150. if (this.hasRole(id))
  16151. return;
  16152. this.userData.roleList.push(id);
  16153. this.saveUserData();
  16154. }
  16155. static hasRole(id) {
  16156. return this.userData.roleList.indexOf(id) >= 0;
  16157. }
  16158. static gemEnough(num) {
  16159. return this.userData.gemNum >= num;
  16160. }
  16161. static roleHasAd(id) {
  16162. let count = this.userData.roleAds[id];
  16163. if (count != undefined && count >= 0)
  16164. return true;
  16165. else
  16166. return false;
  16167. }
  16168. static saveUserData(time = 500, event, arg) {
  16169. if (this.userSaving)
  16170. return;
  16171. this.userSaving = true;
  16172. Laya.timer.once(time, this, () => {
  16173. this.userSaving = false;
  16174. this.userData.saveData();
  16175. if (event)
  16176. xGame.eventMgr.event(event, arg);
  16177. });
  16178. }
  16179. static saveGameData() {
  16180. if (this.gameSaving)
  16181. return;
  16182. this.gameSaving = true;
  16183. Laya.timer.once(1000, this, () => {
  16184. this.gameSaving = false;
  16185. this.gameData.saveData();
  16186. });
  16187. }
  16188. static saveItemData() {
  16189. let fun = () => {
  16190. this.itemData.saveData();
  16191. };
  16192. Laya.timer.clear(this, fun);
  16193. Laya.timer.once(500, this, fun);
  16194. }
  16195. static saveData() {
  16196. this.saveUserData();
  16197. this.saveGameData();
  16198. }
  16199. static getBigSkillList() {
  16200. return this.userData.bigSkills;
  16201. }
  16202. static getBigSkillByIndex(index) {
  16203. return this.userData.bigSkills[index];
  16204. }
  16205. static setBigSkill(index, val, addUp = true) {
  16206. if (addUp) {
  16207. this.userData.bigSkills[index] += val;
  16208. }
  16209. else {
  16210. this.userData.bigSkills[index] = val;
  16211. }
  16212. this.saveUserData();
  16213. }
  16214. static coinEnough(need) {
  16215. if (typeof need != "number") {
  16216. console.error("金币格式错误");
  16217. return;
  16218. }
  16219. return this.userData.coin >= need;
  16220. }
  16221. static setCoin(val) {
  16222. if (typeof val != "number") {
  16223. return;
  16224. }
  16225. this.userData.coin += val;
  16226. this.saveUserData();
  16227. xGame.eventMgr.event(COIN_CHANGE);
  16228. }
  16229. static getCoin() {
  16230. return this.userData.coin;
  16231. }
  16232. static diamondEnough(need) {
  16233. if (typeof need != "number") {
  16234. console.error("金币格式错误");
  16235. return;
  16236. }
  16237. return this.userData.diamond >= need;
  16238. }
  16239. static setDiamond(val) {
  16240. if (typeof val != "number") {
  16241. return;
  16242. }
  16243. this.userData.diamond += val;
  16244. this.saveUserData();
  16245. xGame.eventMgr.event(DIAMOND_CHANGE);
  16246. }
  16247. static getDiamond() {
  16248. return this.userData.diamond;
  16249. }
  16250. static getSkillSuccessTimes() {
  16251. return this.userData.skillSuccessTimes;
  16252. }
  16253. static setSkillSuccessTimes(val, addUp = true) {
  16254. if (addUp)
  16255. this.userData.skillSuccessTimes += val;
  16256. else
  16257. this.userData.skillSuccessTimes = val;
  16258. this.saveUserData();
  16259. }
  16260. static getSkillAccTimes() {
  16261. return this.userData.skillAccTimes;
  16262. }
  16263. static setSkillAccTimes(val) {
  16264. this.userData.skillAccTimes += val;
  16265. this.saveUserData();
  16266. }
  16267. static getSkillGuide() {
  16268. if (!xGame.common.openGuide) {
  16269. return 1;
  16270. }
  16271. return this.userData.skillGuide;
  16272. }
  16273. static setSkillGuide(val) {
  16274. this.userData.skillGuide = val;
  16275. this.saveUserData();
  16276. }
  16277. static getPlaceBallLevelList() {
  16278. return this.userData.placeBallData;
  16279. }
  16280. static getPlaceBallLevel(level) {
  16281. let arr = this.userData.placeBallData;
  16282. let index = level - 1;
  16283. let out;
  16284. if (arr[index]) {
  16285. out = arr[index];
  16286. }
  16287. else {
  16288. let max = arr.length;
  16289. if (max == index) {
  16290. out = {
  16291. star: 0,
  16292. play: true,
  16293. isCur: true,
  16294. getAward: false
  16295. };
  16296. }
  16297. else {
  16298. out = {
  16299. star: 0,
  16300. play: false,
  16301. getAward: false
  16302. };
  16303. }
  16304. }
  16305. return out;
  16306. }
  16307. static setPlaceBallLevel(level, star) {
  16308. let arr = this.userData.placeBallData;
  16309. let index = level - 1;
  16310. if (arr[index]) {
  16311. arr[index].star = Math.max(arr[index].star, star);
  16312. }
  16313. else {
  16314. let max = arr.length;
  16315. if (max == index) {
  16316. arr.push({
  16317. star: star,
  16318. play: true,
  16319. getAward: false
  16320. });
  16321. }
  16322. else {
  16323. console.error("关卡存储出错");
  16324. }
  16325. }
  16326. this.saveUserData();
  16327. }
  16328. static setPlaceBallAward(level) {
  16329. let arr = this.userData.placeBallData;
  16330. let index = level - 1;
  16331. if (arr[index]) {
  16332. arr[index].getAward = true;
  16333. }
  16334. this.saveUserData();
  16335. }
  16336. static getShareDiamondTimes() {
  16337. return this.userData.shareDiamondTimes;
  16338. }
  16339. static setShareDiamondTimes(val, addUp = true) {
  16340. if (addUp) {
  16341. this.userData.shareDiamondTimes += val;
  16342. }
  16343. else {
  16344. this.userData.shareDiamondTimes = val;
  16345. }
  16346. this.saveUserData();
  16347. }
  16348. static getDailyVideoShareTimes() {
  16349. return this.userData.dailyVideoShareTimes;
  16350. }
  16351. static setDailyVideoShareTimes(val, addUp = true) {
  16352. if (addUp) {
  16353. this.userData.dailyVideoShareTimes += val;
  16354. }
  16355. else {
  16356. this.userData.dailyVideoShareTimes = val;
  16357. }
  16358. this.saveUserData();
  16359. }
  16360. static getSecretary(index) {
  16361. return this.userData.secretary[index];
  16362. }
  16363. static setSecretary(index, val) {
  16364. this.userData.secretary[index] = val;
  16365. this.saveUserData();
  16366. }
  16367. static getCurSecretary() {
  16368. return this.userData.curSecretary;
  16369. }
  16370. static setCurSecretary(index) {
  16371. this.userData.curSecretary = index;
  16372. this.saveUserData();
  16373. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  16374. }
  16375. static getBallRod(index) {
  16376. return this.userData.ballRod[index];
  16377. }
  16378. static setBallRod(index, val) {
  16379. this.userData.ballRod[index] = val;
  16380. this.saveUserData();
  16381. }
  16382. static getCurBallRod() {
  16383. return this.userData.curBallRod;
  16384. }
  16385. static setCurBallRod(index) {
  16386. this.userData.curBallRod = index;
  16387. this.saveUserData();
  16388. }
  16389. static setSignData(val) {
  16390. this.userData.signData = val;
  16391. this.saveUserData();
  16392. }
  16393. static getSignData() {
  16394. return this.userData.signData;
  16395. }
  16396. static setSignTime(val) {
  16397. this.userData.signTime = val;
  16398. this.saveUserData();
  16399. }
  16400. static getSignTime() {
  16401. return this.userData.signTime;
  16402. }
  16403. static getDrawTimes() {
  16404. return this.userData.drawTimes;
  16405. }
  16406. static setDrawTimes(val, addUp = true) {
  16407. if (addUp) {
  16408. this.userData.drawTimes += val;
  16409. }
  16410. else {
  16411. this.userData.drawTimes = val;
  16412. }
  16413. this.saveUserData();
  16414. }
  16415. static getDrawAwardTimes() {
  16416. return this.userData.drawAwardTimes;
  16417. }
  16418. static setDrawAwardTimes(val) {
  16419. this.userData.drawAwardTimes = val;
  16420. this.saveUserData();
  16421. }
  16422. static getDailyfreeDrawTimes() {
  16423. return this.userData.dailyfreeDrawTimes;
  16424. }
  16425. static setDailyfreeDrawTimes(val) {
  16426. this.userData.dailyfreeDrawTimes = val;
  16427. this.saveUserData();
  16428. }
  16429. static setPower(val, addUp = true) {
  16430. if (addUp)
  16431. this.userData.power += val;
  16432. else
  16433. this.userData.power = val;
  16434. if (this.userData.power >= xGame.common.maxPower) {
  16435. this.userData.power = xGame.common.maxPower;
  16436. }
  16437. xGame.eventMgr.event(POWER_CHANGE, val);
  16438. this.saveUserData();
  16439. }
  16440. static getPower() {
  16441. return this.userData.power;
  16442. }
  16443. static setPowerTime(val) {
  16444. this.userData.powerTime = val;
  16445. this.saveUserData();
  16446. }
  16447. static getPowerTime() {
  16448. return this.userData.powerTime;
  16449. }
  16450. static powerEnough() {
  16451. return this.getPower() > 0;
  16452. }
  16453. static getChallengeTimes() {
  16454. return this.userData.challengeTimes;
  16455. }
  16456. static setChallengeTimes(val) {
  16457. this.userData.challengeTimes += val;
  16458. this.saveUserData();
  16459. }
  16460. static getExtraSign() {
  16461. return this.userData.extraSign;
  16462. }
  16463. static setExtraSign(val) {
  16464. this.userData.extraSign = val;
  16465. this.saveUserData();
  16466. }
  16467. static getClassicTimes() {
  16468. return this.userData.classicTimes;
  16469. }
  16470. static setClassicTimes() {
  16471. this.userData.classicTimes += 1;
  16472. this.saveUserData();
  16473. }
  16474. static getGuideHelpLine() {
  16475. return this.userData.guideHelpLine;
  16476. }
  16477. static setGuideHelpLine() {
  16478. this.userData.guideHelpLine = 1;
  16479. this.saveUserData();
  16480. }
  16481. static getNewUser() {
  16482. return this.userData.newUser;
  16483. }
  16484. static setNewUser() {
  16485. this.userData.newUser = false;
  16486. this.saveUserData();
  16487. }
  16488. static getRootBallFoul() {
  16489. return this.userData.rootBallFoul;
  16490. }
  16491. static setRootBallFoul() {
  16492. this.userData.rootBallFoul = 1;
  16493. this.saveUserData();
  16494. }
  16495. static getTimeoutFoul() {
  16496. return this.userData.timeoutFoul;
  16497. }
  16498. static setTimeoutFoul() {
  16499. this.userData.timeoutFoul = 1;
  16500. this.saveUserData();
  16501. }
  16502. }
  16503. DataMgr.isNewUser = false;
  16504. DataMgr.fristEnter = true;
  16505. DataMgr.levelType = 0;
  16506. DataMgr.awardId = 0;
  16507. DataMgr.awardCoin = 0;
  16508. DataMgr.sceneId = -1;
  16509. DataMgr.tryId = 0;
  16510. DataMgr.curLevel = 1;
  16511. DataMgr.vipLevel = 0;
  16512. DataMgr.maxLevel = 0;
  16513. DataMgr.awardRatio = 1;
  16514. DataMgr.gameList = [];
  16515. DataMgr.rankList = [];
  16516. DataMgr.recoverTime = 480000;
  16517. DataMgr.minScore = 0;
  16518. DataMgr.rankDis = 0;
  16519. DataMgr.userSaving = false;
  16520. DataMgr.gameSaving = false;
  16521. class D3Tween extends Laya.Script3D {
  16522. constructor() {
  16523. super();
  16524. this.isInited = false;
  16525. }
  16526. ;
  16527. init() {
  16528. if (this.isInited)
  16529. return;
  16530. this.isInited = true;
  16531. this.gameObj = this.owner;
  16532. this.transform = this.gameObj.transform;
  16533. }
  16534. get rotX() {
  16535. return this.transform.localRotationEulerX;
  16536. }
  16537. set rotX(v) {
  16538. this.transform.localRotationEulerX = v;
  16539. }
  16540. get rotY() {
  16541. return this.transform.localRotationEulerY;
  16542. }
  16543. set rotY(v) {
  16544. this.transform.localRotationEulerY = v;
  16545. }
  16546. get rotZ() {
  16547. return this.transform.localRotationEulerZ;
  16548. }
  16549. set rotZ(v) {
  16550. this.transform.localRotationEulerZ = v;
  16551. }
  16552. get posX() {
  16553. return this.transform.localPositionX;
  16554. }
  16555. set posX(v) {
  16556. this.transform.localPositionX = v;
  16557. }
  16558. get posY() {
  16559. return this.transform.localPositionY;
  16560. }
  16561. set posY(v) {
  16562. this.transform.localPositionY = v;
  16563. }
  16564. get posZ() {
  16565. return this.transform.localPositionZ;
  16566. }
  16567. set posZ(v) {
  16568. this.transform.localPositionZ = v;
  16569. }
  16570. get rotation() {
  16571. return this.transform.localRotation;
  16572. }
  16573. set rotation(v) {
  16574. this.transform.localRotation = v;
  16575. }
  16576. }
  16577. class D2Hole extends Laya.Script {
  16578. constructor() { super(); }
  16579. onTriggerEnter(collider) {
  16580. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  16581. return;
  16582. }
  16583. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  16584. if (collider.owner["mySrc"].isRunSkillAni) {
  16585. return;
  16586. }
  16587. if (collider.owner["mySrc"].number != 0) {
  16588. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  16589. }
  16590. xGame.common.ballColliHole(collider);
  16591. xGame.common.recoverCameraView();
  16592. }
  16593. }
  16594. }
  16595. class Table extends Laya.Script3D {
  16596. constructor() {
  16597. super();
  16598. this.isSetBorder = false;
  16599. this.inited = false;
  16600. }
  16601. ;
  16602. onAwake() {
  16603. this.init();
  16604. }
  16605. init() {
  16606. if (this.inited)
  16607. return;
  16608. this.inited = true;
  16609. this.gameObj = this.owner;
  16610. this.border = this.gameObj.getChildByName("border");
  16611. }
  16612. setBorderPos() {
  16613. if (this.isSetBorder)
  16614. return;
  16615. this.isSetBorder = true;
  16616. let ui = xGame.common.gameUI.ui;
  16617. let bar1 = this.border.getChildByName("bar1");
  16618. let bar2 = this.border.getChildByName("bar2");
  16619. let bar3 = this.border.getChildByName("bar3");
  16620. let bar4 = this.border.getChildByName("bar4");
  16621. let bar5 = this.border.getChildByName("bar5");
  16622. let bar6 = this.border.getChildByName("bar6");
  16623. this.setInfo(bar1, ui.border.bar1, "box");
  16624. this.setInfo(bar2, ui.border.bar2, "box");
  16625. this.setInfo(bar3, ui.border.bar3, "box");
  16626. this.setInfo(bar4, ui.border.bar4, "box");
  16627. this.setInfo(bar5, ui.border.bar5, "box");
  16628. this.setInfo(bar6, ui.border.bar6, "box");
  16629. let circle1 = this.border.getChildByName("circle1");
  16630. let circle2 = this.border.getChildByName("circle2");
  16631. let circle3 = this.border.getChildByName("circle3");
  16632. let circle4 = this.border.getChildByName("circle4");
  16633. let circle5 = this.border.getChildByName("circle5");
  16634. let circle6 = this.border.getChildByName("circle6");
  16635. this.setInfo(circle1, ui.border.circle1, "circle");
  16636. this.setInfo(circle2, ui.border.circle2, "circle");
  16637. this.setInfo(circle3, ui.border.circle3, "circle");
  16638. this.setInfo(circle4, ui.border.circle4, "circle");
  16639. this.setInfo(circle5, ui.border.circle5, "circle");
  16640. this.setInfo(circle6, ui.border.circle6, "circle");
  16641. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  16642. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  16643. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  16644. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  16645. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  16646. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  16647. let arr = xGame.common.gameMgr.holePosList;
  16648. xGame.common.gameMgr.posObj = {
  16649. "1": arr[0],
  16650. "3": arr[2],
  16651. "4": arr[3],
  16652. "6": arr[5]
  16653. };
  16654. }
  16655. initHolePos(x, y) {
  16656. if (x < 300)
  16657. x += 25;
  16658. else if (x > 1000)
  16659. x -= 25;
  16660. else if (y > 200)
  16661. y -= 10;
  16662. else
  16663. y += 10;
  16664. if (y < 200)
  16665. y += 30;
  16666. else if (y > 500)
  16667. y -= 30;
  16668. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  16669. }
  16670. setInfo(d3Obj, d2Obj, type) {
  16671. let ui = xGame.common.gameUI.ui;
  16672. let sprite = new Laya.Sprite();
  16673. ui.border.displayObject.addChild(sprite);
  16674. let colli = xGame.common.getCollider(type);
  16675. sprite.addComponentIntance(colli);
  16676. let rigy = xGame.common.getRigbody();
  16677. rigy.type = "static";
  16678. sprite.addComponentIntance(rigy);
  16679. let d3Pos = d3Obj.transform.position;
  16680. xGame.common.pos3to2Convert(d3Pos);
  16681. let scaleX = d3Obj.transform.localScaleX;
  16682. let scaleZ = d3Obj.transform.localScaleZ;
  16683. let width = xGame.common.scale3to2Convert(scaleZ);
  16684. let height = xGame.common.scale3to2Convert(scaleX);
  16685. sprite.pivotX = width / 2;
  16686. sprite.pivotY = height / 2;
  16687. sprite.x = d3Pos.x;
  16688. sprite.y = d3Pos.y;
  16689. sprite.width = width;
  16690. sprite.height = height;
  16691. d2Obj.x = d3Pos.x;
  16692. d2Obj.y = d3Pos.y;
  16693. d2Obj.width = width;
  16694. d2Obj.height = height;
  16695. if (type == "box") {
  16696. colli.width = width;
  16697. colli.height = height;
  16698. colli.isSensor = false;
  16699. colli.label = "border";
  16700. }
  16701. else {
  16702. colli.radius = width / 2;
  16703. colli.isSensor = true;
  16704. colli.label = "hole";
  16705. sprite.addComponent(D2Hole);
  16706. }
  16707. }
  16708. }
  16709. class D3World extends Laya.Script3D {
  16710. constructor() {
  16711. super();
  16712. this.loadNum = 0;
  16713. this.setLoadNum = 7;
  16714. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  16715. }
  16716. onAwake() {
  16717. }
  16718. loadScene() {
  16719. this.scene = this.owner;
  16720. let url = `res/unityRes/root.lh`;
  16721. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  16722. this.scene.addChild(prefab);
  16723. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  16724. this.putCameraInfo();
  16725. this.camera.enableHDR = false;
  16726. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  16727. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  16728. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  16729. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  16730. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  16731. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  16732. this.knife.active = false;
  16733. this.loadD3Obj();
  16734. }));
  16735. }
  16736. putCameraInfo() {
  16737. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  16738. this.cameraObj = new cameraType();
  16739. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  16740. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  16741. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  16742. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  16743. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  16744. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  16745. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  16746. this.visitAngleChild.init();
  16747. this.visitRootObj.posX = this.visitAngleChild.posX;
  16748. this.visitRootObj.posY = this.visitAngleChild.posY;
  16749. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  16750. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  16751. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  16752. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  16753. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  16754. xGame.common.showOneCamera("mainCamera");
  16755. }
  16756. loadD3Obj() {
  16757. this.loadTable();
  16758. this.loadRoom();
  16759. this.loadInHoleParticial();
  16760. this.loadIceParticial();
  16761. this.loadHitParticial();
  16762. this.loadFireworksParticial();
  16763. this.loadBall();
  16764. }
  16765. loadInHoleParticial() {
  16766. this.loadD3Res("inHoleEft", "", (prefab) => {
  16767. prefab.addComponent(Partical);
  16768. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  16769. });
  16770. }
  16771. loadIceParticial() {
  16772. this.loadD3Res("iceEft", "", (prefab) => {
  16773. prefab.addComponent(Partical);
  16774. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  16775. });
  16776. }
  16777. loadHitParticial() {
  16778. this.loadD3Res("hitEft", "", (prefab) => {
  16779. prefab.addComponent(Partical);
  16780. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  16781. });
  16782. }
  16783. loadFireworksParticial() {
  16784. this.loadD3Res("fireworksEft", "", (prefab) => {
  16785. prefab.addComponent(Partical);
  16786. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  16787. });
  16788. }
  16789. loadBall(index = 1) {
  16790. this.loadD3Res("ball", index, (prefab) => {
  16791. this.ballPrefab = prefab;
  16792. this.ballPrefab.addComponent(Ball);
  16793. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  16794. });
  16795. }
  16796. loadTable(index = 1) {
  16797. this.loadD3Res("table", index, (prefab) => {
  16798. this.tableSrc = prefab.addComponent(Table);
  16799. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  16800. this.d3Hand.init();
  16801. this.tableRoot.addChild(prefab);
  16802. });
  16803. }
  16804. loadRoom(index = 1) {
  16805. this.loadD3Res("room", index, (prefab) => {
  16806. this.roomRoot.addChild(prefab);
  16807. });
  16808. }
  16809. loadD3Res(type, index, callback) {
  16810. let url = `res/unityRes/${type}${index}.lh`;
  16811. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  16812. callback && callback(prefab);
  16813. this.checkResLoad();
  16814. }));
  16815. }
  16816. checkResLoad() {
  16817. this.loadNum++;
  16818. if (this.loadNum >= this.setLoadNum) {
  16819. xGame.eventMgr.event(D3RES_LOADED);
  16820. }
  16821. }
  16822. prePlayEft() {
  16823. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  16824. eft.transform.localPositionX = 0;
  16825. eft.transform.localPositionY = -5;
  16826. eft.transform.localPositionZ = 0;
  16827. eft.active = true;
  16828. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  16829. ice.transform.localPositionX = 0;
  16830. ice.transform.localPositionY = -5;
  16831. ice.transform.localPositionZ = 0;
  16832. ice.active = true;
  16833. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  16834. hit.transform.localPositionX = 0;
  16835. hit.transform.localPositionY = -5;
  16836. hit.transform.localPositionZ = 0;
  16837. hit.active = true;
  16838. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  16839. fireworks.transform.localPositionX = 0;
  16840. fireworks.transform.localPositionY = -5;
  16841. fireworks.transform.localPositionZ = 0;
  16842. fireworks.active = true;
  16843. }
  16844. }
  16845. class cameraType {
  16846. }
  16847. class MoyuMgr$1 {
  16848. static initMoyu() {
  16849. this.moyuView = new MoyuView$1();
  16850. Laya.stage.addChild(this.moyuView.ui.displayObject);
  16851. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  16852. this.moyuView.ui.displayObject.zOrder = 1000;
  16853. this.moyuView.init();
  16854. this.moyuView.showTip(true);
  16855. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  16856. window['XApk'] = this;
  16857. }
  16858. static showAge(show) {
  16859. if (this.moyuView)
  16860. this.moyuView.showAge(show);
  16861. }
  16862. static onPlatMsg(idx) {
  16863. if (!MoyuMgr$1.moyuView)
  16864. return;
  16865. if (idx == '0') {
  16866. MoyuMgr$1.moyuView.showTip(false);
  16867. }
  16868. }
  16869. static showAgree(call) {
  16870. if (this.moyuView)
  16871. this.moyuView.showAgree(call);
  16872. else
  16873. call && call();
  16874. }
  16875. static showXy(type = 1) {
  16876. if (this.moyuView)
  16877. this.moyuView.showXy(type);
  16878. }
  16879. }
  16880. MoyuMgr$1.isAdvise = false;
  16881. class MoyuView$1 {
  16882. constructor() {
  16883. this.ysxyNum = 1;
  16884. this.ysJson = null;
  16885. this.ui = ui_UIMoyu.createInstance();
  16886. }
  16887. init() {
  16888. this.ui.mainBg.visible = false;
  16889. this.ui.xyNode.visible = false;
  16890. this.ui.ageNode.visible = false;
  16891. this.ui.tipNode.visible = false;
  16892. this.ui.rnNode.visible = false;
  16893. this.ui.fcmNode.visible = false;
  16894. this.ui.ageTip.visible = false;
  16895. this.ui.msgNode.visible = false;
  16896. this.ui.visible = false;
  16897. this.ui.xyNode.xyList.setVirtual();
  16898. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  16899. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  16900. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  16901. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  16902. this.ui.xyNode.btnKnown.visible = false;
  16903. this.ui.xyNode.xy1.visible = false;
  16904. this.ui.xyNode.xy2.visible = false;
  16905. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  16906. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  16907. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  16908. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  16909. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  16910. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  16911. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  16912. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  16913. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  16914. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  16915. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  16916. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  16917. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  16918. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  16919. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  16920. this.ysxyNum = 2;
  16921. }
  16922. }
  16923. onClick(obj) {
  16924. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  16925. switch (obj) {
  16926. case this.ui.ageTip:
  16927. if (Moyu.isTTApk) {
  16928. this.ui.ageNode.visible = true;
  16929. this.ui.mainBg.visible = true;
  16930. }
  16931. break;
  16932. case this.ui.tipNode:
  16933. this.showTip(false);
  16934. break;
  16935. case this.ui.ageNode.btnAge:
  16936. this.ui.ageNode.visible = false;
  16937. this.ui.mainBg.visible = false;
  16938. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  16939. this.ui.visible = false;
  16940. break;
  16941. case this.ui.xyNode.btnXy3:
  16942. case this.ui.xyNode.btnXy1:
  16943. this.loadXy(1);
  16944. break;
  16945. case this.ui.xyNode.btnXy2:
  16946. this.loadXy(2);
  16947. break;
  16948. case this.ui.xyNode.btnBack:
  16949. this.ui.xyNode.xy1.visible = true;
  16950. this.ui.xyNode.xy2.visible = false;
  16951. break;
  16952. case this.ui.xyNode.btnKnown:
  16953. this.ui.xyNode.visible = false;
  16954. this.ui.mainBg.visible = false;
  16955. this.ui.visible = false;
  16956. break;
  16957. case this.ui.rnNode.btnCheck:
  16958. this.check();
  16959. break;
  16960. case this.ui.rnNode.btnExit:
  16961. case this.ui.xyNode.btnNo:
  16962. this.ysxyNum--;
  16963. if (this.ysxyNum > 0)
  16964. this.showMsg("Refuse to quit the game once again");
  16965. else {
  16966. Moyu.userAgree(false);
  16967. Moyu.exit();
  16968. }
  16969. break;
  16970. case this.ui.xyNode.btnSure:
  16971. case this.ui.xyNode.btnYes:
  16972. DataMgr.userData.isAgree = true;
  16973. DataMgr.saveUserData();
  16974. this.onAgree();
  16975. break;
  16976. case this.ui.rnNode.btnDone:
  16977. this.ui.rnNode.visible = false;
  16978. this.ui.visible = false;
  16979. break;
  16980. case this.ui.fcmNode.btnRn:
  16981. this.showRn();
  16982. break;
  16983. }
  16984. }
  16985. showTip(show) {
  16986. if (!Moyu.isVVApk && !Moyu.isOPApk)
  16987. return;
  16988. if (show) {
  16989. MoyuMgr$1.isAdvise = true;
  16990. this.ui.visible = true;
  16991. this.ui.tipNode.visible = true;
  16992. this.ui.tipNode.alpha = 1;
  16993. Laya.timer.once(1000, this, this.showTip, [false]);
  16994. }
  16995. else {
  16996. this.ui.tipNode.alpha = 1;
  16997. this.ui.tipNode.visible = true;
  16998. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  16999. this.ui.tipNode.visible = false;
  17000. MoyuMgr$1.isAdvise = false;
  17001. }), 1000);
  17002. }
  17003. }
  17004. showAge(show, px = 0, py = 0) {
  17005. if (Moyu.platType > 10 && !Moyu.isIos) {
  17006. this.ui.ageTip.x = px;
  17007. this.ui.ageTip.y = py;
  17008. this.ui.ageTip.visible = show;
  17009. if (show)
  17010. this.ui.visible = true;
  17011. }
  17012. }
  17013. showAgree(call) {
  17014. this.agreeCall = call;
  17015. this.onAgree();
  17016. return;
  17017. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  17018. this.showXy(0);
  17019. }
  17020. else
  17021. this.onAgree();
  17022. }
  17023. onAgree() {
  17024. if (!this.ui.ageNode.visible)
  17025. this.ui.visible = false;
  17026. this.ui.xyNode.visible = false;
  17027. Moyu.userAgree(true);
  17028. this.showAge(false);
  17029. this.agreeCall && this.agreeCall();
  17030. this.showRn();
  17031. }
  17032. showMsg(txt) {
  17033. this.ui.msgNode.txtMsg.text = txt;
  17034. this.ui.msgNode.visible = true;
  17035. this.ui.msgNode.alpha = 1;
  17036. this.ui.visible = true;
  17037. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  17038. this.ui.msgNode.visible = false;
  17039. }), 2500, true);
  17040. }
  17041. showRn() {
  17042. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  17043. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  17044. this.ui.rnNode.rn1.visible = true;
  17045. this.ui.rnNode.rn2.visible = false;
  17046. this.ui.rnNode.rn3.visible = false;
  17047. this.ui.rnNode.rn4.visible = false;
  17048. this.ui.rnNode.visible = true;
  17049. this.ui.mainBg.visible = true;
  17050. this.ui.rnNode.btnDone.visible = false;
  17051. this.ui.rnNode.btnExit.visible = true;
  17052. this.ui.rnNode.btnCheck.visible = true;
  17053. this.ui.fcmNode.visible = false;
  17054. this.ui.visible = true;
  17055. return;
  17056. }
  17057. }
  17058. this.showFcm();
  17059. }
  17060. showFcm() {
  17061. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  17062. Moyu.initFCM(true);
  17063. if (Moyu.gameTime < 1)
  17064. this.fcmLoop();
  17065. else if (Moyu.gameTime < 999)
  17066. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  17067. }
  17068. }
  17069. fcmLoop() {
  17070. if (Moyu.gameTime < 1) {
  17071. this.ui.rnNode.visible = false;
  17072. this.ui.fcmNode.visible = true;
  17073. this.ui.mainBg.visible = true;
  17074. this.ui.visible = true;
  17075. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  17076. Laya.timer.clear(this.ui, this.fcmLoop);
  17077. }
  17078. }
  17079. check() {
  17080. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  17081. this.ui.rnNode.rn1.visible = false;
  17082. this.ui.rnNode.rn2.visible = false;
  17083. this.ui.rnNode.rn4.visible = true;
  17084. }
  17085. else if (this.ui.rnNode.rn4.visible) {
  17086. let name = this.ui.rnNode.inputName.text;
  17087. let code = this.ui.rnNode.inputCode.text;
  17088. if (code && code.length == 18) {
  17089. this.ui.rnNode.rn1.visible = false;
  17090. this.ui.rnNode.rn4.visible = false;
  17091. Moyu.authenticate(name, code, (res) => {
  17092. this.ui.rnNode.rn2.visible = !res;
  17093. this.ui.rnNode.rn3.visible = res;
  17094. this.ui.rnNode.btnDone.visible = res;
  17095. this.ui.rnNode.btnExit.visible = !res;
  17096. this.ui.rnNode.btnCheck.visible = !res;
  17097. if (res)
  17098. this.showFcm();
  17099. });
  17100. }
  17101. else
  17102. this.showMsg("信息填写不完整");
  17103. }
  17104. }
  17105. loadXy(type = 0) {
  17106. this.ui.xyNode.xy1.visible = false;
  17107. this.ui.xyNode.xy2.visible = true;
  17108. this.ui.xyNode.xyList.scrollToView(0);
  17109. if (type == 1) {
  17110. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  17111. }
  17112. else if (type == 2) {
  17113. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  17114. }
  17115. }
  17116. showXy(type = 0) {
  17117. this.xyBtn();
  17118. if (type == 0) {
  17119. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  17120. this.ui.xyNode.btnSure.visible = true;
  17121. }
  17122. else {
  17123. this.ui.xyNode.btnYes.visible = true;
  17124. this.ui.xyNode.btnNo.visible = true;
  17125. }
  17126. }
  17127. else {
  17128. this.ui.xyNode.btnKnown.visible = true;
  17129. this.ui.mainBg.visible = true;
  17130. }
  17131. this.ui.xyNode.xy1.visible = true;
  17132. this.ui.xyNode.xy2.visible = false;
  17133. this.ui.xyNode.visible = true;
  17134. this.ui.visible = true;
  17135. }
  17136. xyBtn() {
  17137. this.ui.xyNode.btnSure.visible = false;
  17138. this.ui.xyNode.btnYes.visible = false;
  17139. this.ui.xyNode.btnNo.visible = false;
  17140. this.ui.xyNode.btnKnown.visible = false;
  17141. {
  17142. this.ui.xyNode.btnXy3.visible = false;
  17143. this.ui.xyNode.btnXy2.visible = true;
  17144. this.ui.xyNode.btnXy1.visible = true;
  17145. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  17146. }
  17147. }
  17148. createXY(json) {
  17149. this.ysJson = json.content;
  17150. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  17151. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  17152. this.ui.xyNode.xy2.visible = true;
  17153. }
  17154. renderListItem(idx, cell) {
  17155. let xy = this.ysJson[idx];
  17156. cell.height = xy.line * 30;
  17157. cell.xyItem.text = xy.text;
  17158. }
  17159. onDestroy() {
  17160. this.agreeCall = null;
  17161. }
  17162. }
  17163. class UILoading extends UIBase {
  17164. constructor() {
  17165. super();
  17166. this.accTime = 0;
  17167. this.curNum = 0;
  17168. this.rate = 1;
  17169. this.loadSubOk = false;
  17170. this.loadResOK = false;
  17171. this.openLoading = true;
  17172. this.beginLoadRes = false;
  17173. this.finishD2 = false;
  17174. this.finishD3 = false;
  17175. }
  17176. onConstructor() {
  17177. this.ui = ui_UILoading.createInstance();
  17178. this.contentPane = this.ui;
  17179. this.isEject = false;
  17180. this._initUI();
  17181. this._addEvent();
  17182. }
  17183. _initUI() {
  17184. MoyuMgr$1.initMoyu();
  17185. }
  17186. _addEvent() {
  17187. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  17188. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  17189. }
  17190. show() {
  17191. super.show();
  17192. console.log('zh:加载分包资源');
  17193. loadSubRes(this.subResProgress.bind(this));
  17194. this.ui.txtLoad.text = "Loading...";
  17195. }
  17196. subResProgress(pro, finish) {
  17197. this.curNum = pro;
  17198. if (finish) {
  17199. this.curNum = 1;
  17200. this.loadSubOk = true;
  17201. }
  17202. }
  17203. laodD3Res() {
  17204. let scene3D = new Laya.Scene3D();
  17205. xGame.common.d3Scene = scene3D;
  17206. xGame.common.d3World = scene3D.addComponent(D3World);
  17207. xGame.common.d3World.loadScene();
  17208. }
  17209. loadD2Res() {
  17210. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  17211. this.finishD2 = true;
  17212. this.checkLoadAll();
  17213. this.curNum = 1;
  17214. }), Laya.Handler.create(this, (pro) => {
  17215. this.curNum = pro;
  17216. }, null, false));
  17217. }
  17218. d3ResFinish() {
  17219. this.finishD3 = true;
  17220. this.checkLoadAll();
  17221. }
  17222. checkLoadAll() {
  17223. if (this.finishD2 && this.finishD3) {
  17224. this.loadResOK = true;
  17225. }
  17226. }
  17227. loadRes() {
  17228. this.laodD3Res();
  17229. this.loadD2Res();
  17230. }
  17231. myUpdate(dt) {
  17232. if (!this.openLoading)
  17233. return;
  17234. this.accTime += dt * this.rate;
  17235. if (this.accTime >= this.curNum)
  17236. this.accTime = this.curNum;
  17237. this.ui.loadinfo.value = this.accTime * 100;
  17238. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  17239. if (!this.beginLoadRes) {
  17240. this.beginLoadRes = true;
  17241. this.ui.txtLoad.text = "Loading...";
  17242. this.curNum = 0;
  17243. this.accTime = 0;
  17244. this.loadRes();
  17245. }
  17246. if (this.loadResOK) {
  17247. this.openLoading = false;
  17248. Laya.timer.once(300, this, () => {
  17249. xGame.common.d3Scene.active = false;
  17250. MoyuMgr$1.showAgree(enterGame);
  17251. });
  17252. }
  17253. }
  17254. }
  17255. release() {
  17256. }
  17257. hide() {
  17258. super.hide();
  17259. this.release();
  17260. }
  17261. onClose() {
  17262. this.hide();
  17263. }
  17264. }
  17265. UILoading.uiName = "UILoading";
  17266. class UIRepentProp$1 extends UIBase {
  17267. constructor() {
  17268. super();
  17269. this.viewType = 0;
  17270. this.regretType = 0;
  17271. }
  17272. onConstructor() {
  17273. this.ui = ui_UIRepentProp.createInstance();
  17274. this.contentPane = this.ui;
  17275. this.isEject = false;
  17276. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  17277. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  17278. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  17279. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  17280. }
  17281. show(viewType, regretType, callback) {
  17282. PlatMgr.showInsert(true);
  17283. this.viewType = viewType;
  17284. this.regretType = regretType;
  17285. this.callback = callback;
  17286. super.show();
  17287. this.ui.t0.play();
  17288. this.ui.c1.selectedIndex = this.viewType;
  17289. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  17290. if (this.viewType == 0) {
  17291. let guide = DataMgr.getGuideHelpLine();
  17292. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  17293. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  17294. }
  17295. xGame.common.gameMgr.gamePause = true;
  17296. }
  17297. hideSelf() {
  17298. xGame.common.gameMgr.gamePause = false;
  17299. this.callback && this.callback(false);
  17300. this.hide();
  17301. }
  17302. videoRegret() {
  17303. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  17304. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  17305. }
  17306. else {
  17307. console.log('zh:AD 失败,直接发放奖励');
  17308. this.qjff_AD_for_UIrepentProp_videoRegret();
  17309. }
  17310. }
  17311. qjff_AD_for_UIrepentProp_videoRegret() {
  17312. this.callback && this.callback(true);
  17313. this.hideSelf();
  17314. }
  17315. videoAddHelpLine() {
  17316. let guide = DataMgr.getGuideHelpLine();
  17317. if (guide == 0) {
  17318. this.callback && this.callback(true);
  17319. this.hideSelf();
  17320. DataMgr.setGuideHelpLine();
  17321. xGame.common.gameUI.ui.guideNode.visible = false;
  17322. }
  17323. else {
  17324. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  17325. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  17326. }
  17327. else {
  17328. console.log('zh:AD 失败,直接发放奖励');
  17329. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  17330. }
  17331. }
  17332. }
  17333. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  17334. this.callback && this.callback(true);
  17335. this.hideSelf();
  17336. }
  17337. }
  17338. UIRepentProp$1.uiName = "UIRepentProp";
  17339. class UIRodMethod$1 extends UIBase {
  17340. constructor() {
  17341. super();
  17342. this.isPressd = false;
  17343. }
  17344. onConstructor() {
  17345. this.ui = ui_UIRodMethod.createInstance();
  17346. this.contentPane = this.ui;
  17347. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  17348. this.moveDir = new Laya.Vector2();
  17349. this.moveDest = new Laya.Vector2();
  17350. this.centerPos = new Laya.Vector2();
  17351. xGame.common.uiRodMethod = this;
  17352. }
  17353. show() {
  17354. super.show();
  17355. xGame.common.gameMgr.gamePause = true;
  17356. this.openPressDotEvent();
  17357. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  17358. this.centerPos.x = this.ui.white.x;
  17359. this.centerPos.y = this.ui.white.y;
  17360. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  17361. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  17362. this.setDot();
  17363. }
  17364. setDot() {
  17365. this.ui.dot.x = this.moveDest.x;
  17366. this.ui.dot.y = this.moveDest.y;
  17367. }
  17368. closeSelf() {
  17369. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  17370. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  17371. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  17372. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  17373. xGame.common.gameMgr.gamePause = false;
  17374. this.hide();
  17375. }
  17376. openPressDotEvent() {
  17377. this.closePressDotEvent();
  17378. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17379. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17380. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17381. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17382. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17383. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17384. }
  17385. closePressDotEvent() {
  17386. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17387. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17388. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17389. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17390. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17391. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17392. }
  17393. onDown(e) {
  17394. if (e.type == Laya.Event.MOUSE_DOWN)
  17395. this.isPressd = true;
  17396. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  17397. this.isPressd = false;
  17398. if (!this.isPressd)
  17399. return;
  17400. this.moveDest.x = e.stageX;
  17401. this.moveDest.y = e.stageY;
  17402. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  17403. if (dis > 6724) {
  17404. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  17405. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  17406. }
  17407. this.setDot();
  17408. }
  17409. resetRod() {
  17410. this.ui.dot.x = this.ui.white.x;
  17411. this.ui.dot.y = this.ui.white.y;
  17412. this.gameRod.dot.x = this.gameRod.bg.x;
  17413. this.gameRod.dot.y = this.gameRod.bg.y;
  17414. xGame.common.rodOffest.x = 0;
  17415. xGame.common.rodOffest.y = 0;
  17416. }
  17417. }
  17418. UIRodMethod$1.uiName = "UIRodMethod";
  17419. class UIMsg$1 extends UIBase {
  17420. constructor() {
  17421. super();
  17422. }
  17423. onConstructor() {
  17424. this.ui = ui_UIMsg.createInstance();
  17425. this.contentPane = this.ui;
  17426. this.isEject = false;
  17427. this.isMuti = true;
  17428. }
  17429. show(msg, callback) {
  17430. super.show();
  17431. this.ui.tipsNode.msgTxt.text = msg;
  17432. this.ui.alpha = 1;
  17433. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  17434. this.hide();
  17435. callback && callback();
  17436. }), 1000);
  17437. }
  17438. }
  17439. UIMsg$1.uiName = "UIMsg";
  17440. class UITips$1 extends UIBase {
  17441. constructor() {
  17442. super();
  17443. this.type = 0;
  17444. }
  17445. onConstructor() {
  17446. this.ui = ui_UITips.createInstance();
  17447. this.contentPane = this.ui;
  17448. this.isEject = false;
  17449. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  17450. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  17451. }
  17452. show(tipsTxt, womanTxt, type) {
  17453. super.show();
  17454. this.ui.t0.play();
  17455. this.ui.myNode.tipsTxt.text = tipsTxt;
  17456. this.ui.myNode.womanTxt.text = womanTxt;
  17457. PlatMgr.showInsert(true);
  17458. this.ui.myNode.c1.selectedIndex = type;
  17459. this.type = type;
  17460. switch (this.type) {
  17461. case TipsType.exitGame:
  17462. xGame.common.gameMgr.gamePause = true;
  17463. break;
  17464. case TipsType.foul:
  17465. Laya.timer.once(200, this, () => {
  17466. xGame.common.gameMgr.gamePause = true;
  17467. });
  17468. break;
  17469. default:
  17470. break;
  17471. }
  17472. }
  17473. clickLeftBtn() {
  17474. this.hide();
  17475. xGame.common.gameMgr.gamePause = false;
  17476. switch (this.type) {
  17477. case TipsType.exitGame:
  17478. break;
  17479. case TipsType.foul:
  17480. break;
  17481. default:
  17482. break;
  17483. }
  17484. }
  17485. clickRightBtn() {
  17486. this.hide();
  17487. switch (this.type) {
  17488. case TipsType.exitGame:
  17489. xGame.eventMgr.event(RESET_GAME);
  17490. xGame.uiMgr.Show(UIMain$1);
  17491. Moyu.recordEnd(this, null);
  17492. xGame.common.longHelpLine = false;
  17493. break;
  17494. case TipsType.foul:
  17495. xGame.common.gameMgr.gamePause = false;
  17496. Laya.timer.clearAll(this);
  17497. break;
  17498. default:
  17499. break;
  17500. }
  17501. }
  17502. }
  17503. UITips$1.uiName = "UITips";
  17504. class UIGame$1 extends UIBase {
  17505. constructor() {
  17506. super();
  17507. this.powerNum = 0;
  17508. this.isD3Inited = false;
  17509. this.isPrePlay = false;
  17510. this.isMoveRod = false;
  17511. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  17512. this.rulerDis = 20;
  17513. this.rulerOffset = 0;
  17514. }
  17515. onConstructor() {
  17516. this.ui = ui_UIGame.createInstance();
  17517. this.contentPane = this.ui;
  17518. this.ui.x += xGame.common.sysOffestNum;
  17519. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  17520. this.isEject = false;
  17521. xGame.common.gameUI = this;
  17522. this.initSelf();
  17523. }
  17524. isTurnSelf() {
  17525. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  17526. return true;
  17527. }
  17528. }
  17529. initSelf() {
  17530. let topUI = this.ui.topNode;
  17531. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  17532. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  17533. this.barInfo = {};
  17534. this.barInfo.curY = 0;
  17535. this.barInfo.height = this.ui.powerNode.height;
  17536. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  17537. this.barInfo.powerStartY = this.ui.powerNode.y;
  17538. xGame.common.aiPlayer = new AIPlayer();
  17539. xGame.common.gameMgr = new GameMgr();
  17540. xGame.common.skillMgr = new SkillMgr();
  17541. xGame.common.wordsMgr = new WordsMgr();
  17542. xGame.common.talkMgr = new TalkMgr();
  17543. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  17544. console.log("加载经典模式表情文件chenggon !");
  17545. });
  17546. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  17547. console.log("挑战模式奖励模式spine加载成功!");
  17548. });
  17549. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  17550. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  17551. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  17552. this.addUIClick(this.ui.returnBtn, this.returnHome);
  17553. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  17554. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  17555. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  17556. }
  17557. getGanZiImg() {
  17558. let index = DataMgr.getCurBallRod();
  17559. let data = cfgTable.ballrodData[index + 1];
  17560. let gan_url = xGame.common.getGameIconUrl(data.img);
  17561. console.log('zh:getGanZiImg gan_url==' + gan_url);
  17562. this.ui.powerNode.showImg.url = gan_url;
  17563. console.log('zh:修改杆子图标O K');
  17564. }
  17565. returnHome() {
  17566. let tips = "Are you sure to exit the game?";
  17567. let woman = "Boss, why don't you play for a while longer?";
  17568. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  17569. }
  17570. addRodMethodClick() {
  17571. if (this.isTurnSelf()) {
  17572. xGame.uiMgr.Show(UIRodMethod$1);
  17573. }
  17574. }
  17575. clickHelpLineBtn(force = false) {
  17576. if (!this.isTurnSelf())
  17577. return;
  17578. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  17579. if (success) {
  17580. xGame.common.longHelpLine = true;
  17581. xGame.common.d2World.getHelpLine();
  17582. Moyu.sendDataEvent("guideNum");
  17583. }
  17584. else {
  17585. }
  17586. });
  17587. }
  17588. renderSelfDisplayBalls(index, target) {
  17589. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  17590. target.myImg.url = xGame.common.getGameIconUrl(str);
  17591. }
  17592. renderAIDisplayBalls(index, target) {
  17593. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  17594. target.myImg.url = xGame.common.getGameIconUrl(str);
  17595. ;
  17596. }
  17597. updateMode() {
  17598. if (xGame.common.gameMode == GameMode.classic) {
  17599. this.ui.topNode.scoreNode.visible = false;
  17600. }
  17601. else if (xGame.common.gameMode == GameMode.bigMove) {
  17602. this.ui.topNode.scoreNode.visible = true;
  17603. }
  17604. }
  17605. show() {
  17606. super.show();
  17607. console.log("zh:uigame show");
  17608. this.ui.alpha = 0;
  17609. this.updateSelf();
  17610. console.log("zh:uigame bf gamemusic01 start");
  17611. xGame.soundMgr.playMusic("gamemusic01");
  17612. console.log("zh:uigame bf gamemusic01 end");
  17613. xGame.common.gameMgr.gamePause = false;
  17614. xGame.common.gameUI.ui.blackAni.visible = false;
  17615. xGame.common.gameUI.ui.whiteAni.visible = false;
  17616. this.ui.powerEft.visible = false;
  17617. this.ui.colorNode.visible = false;
  17618. this.updateHead();
  17619. let curUse = DataMgr.getCurBallRod();
  17620. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  17621. this.getGanZiImg();
  17622. }
  17623. updateSelf() {
  17624. if (xGame.common.gameMode == GameMode.classic) {
  17625. this.ui.c1.selectedIndex = 0;
  17626. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  17627. this.ui.topNode.middleNode.visible = true;
  17628. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  17629. }
  17630. else if (xGame.common.gameMode == GameMode.bigMove) {
  17631. this.ui.c1.selectedIndex = 0;
  17632. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  17633. this.ui.topNode.middleNode.visible = false;
  17634. let max = xGame.cfgMgr.getMaxBigMoveLength();
  17635. let rand = xGame.common.randomNum(1, max);
  17636. let guide = DataMgr.getSkillGuide();
  17637. if (guide == 0)
  17638. rand = 1;
  17639. xGame.common.bigMoveLevelIndex = rand;
  17640. }
  17641. else if (xGame.common.gameMode == GameMode.placeBall) {
  17642. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  17643. this.ui.c1.selectedIndex = 1 + data.type;
  17644. this.ui.alpha = 1;
  17645. this.startGame();
  17646. }
  17647. this.updateMode();
  17648. this.initD3world();
  17649. this.initD2world();
  17650. }
  17651. startGame() {
  17652. this.ui.snowNode.visible = Math.random() <= 0.1;
  17653. this.ui.d2Node.visible = false;
  17654. xGame.common.d3World.d3Hand.gameObj.active = false;
  17655. xGame.common.d3World.tableSrc.init();
  17656. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  17657. this.cameraViewChange(() => {
  17658. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  17659. switch (xGame.common.gameMode) {
  17660. case GameMode.classic:
  17661. xGame.common.d3World.d3Hand.gameObj.active = true;
  17662. this.playPutBallD3Ani();
  17663. break;
  17664. case GameMode.bigMove:
  17665. this.enterGame();
  17666. Laya.timer.once(500, this, () => {
  17667. this.ui.topNode.middleNode.visible = true;
  17668. this.ui.topNode.middleNode.t0.play();
  17669. });
  17670. break;
  17671. case GameMode.placeBall:
  17672. this.enterGame();
  17673. break;
  17674. default:
  17675. break;
  17676. }
  17677. });
  17678. PlatMgr.showBanner(false);
  17679. }
  17680. enterGame() {
  17681. this.ui.d2Node.visible = true;
  17682. xGame.common.d3World.d3Hand.gameObj.active = false;
  17683. xGame.common.showOneCamera("mainCamera");
  17684. Moyu.recordGame(30, true);
  17685. if (!this.isPrePlay) {
  17686. this.isPrePlay = true;
  17687. xGame.common.d3World.prePlayEft();
  17688. }
  17689. xGame.common.gameMgr.gameReady();
  17690. this.openAllEvent();
  17691. this.ui.snowNode.visible = false;
  17692. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  17693. this.ui.helpBtn.visible = condition;
  17694. }
  17695. showHelpLineGuide() {
  17696. let longGuide = DataMgr.getGuideHelpLine();
  17697. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  17698. this.ui.helpBtn.visible = true;
  17699. this.ui.guideNode.visible = true;
  17700. }
  17701. }
  17702. setTurnAlpha(alpha) {
  17703. this.ui.keduNode.alpha = alpha;
  17704. this.ui.ganNode.alpha = alpha;
  17705. this.ui.rodMethodNode.alpha = alpha;
  17706. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  17707. }
  17708. cameraViewChange(callback) {
  17709. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  17710. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  17711. xGame.common.showOneCamera("visitAngle");
  17712. cameraSrc.localRotationEulerY = 180;
  17713. cameraSrc.localRotationEulerZ = 0;
  17714. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  17715. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  17716. callback && callback();
  17717. }));
  17718. }));
  17719. }
  17720. playPutBallD3Ani() {
  17721. xGame.common.showOneCamera("mainCamera");
  17722. let handSrc = xGame.common.d3World.d3Hand;
  17723. handSrc.gameObj.active = true;
  17724. handSrc.transform.localPositionZ = 3;
  17725. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  17726. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  17727. handSrc.gameObj.active = false;
  17728. this.enterGame();
  17729. }), 400);
  17730. }));
  17731. }
  17732. updateHead() {
  17733. let user = Moyu.getUserInfo();
  17734. this.ui.topNode.selfNameTxt.text = user.nickName;
  17735. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  17736. let aiData = xGame.cfgMgr.getRandomUserInfo();
  17737. if (DataMgr.getSkillGuide() < 1) {
  17738. this.ui.topNode.aiNameTxt.text = 'billiards';
  17739. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  17740. }
  17741. else {
  17742. this.ui.topNode.aiNameTxt.text = aiData.name;
  17743. let randNo = Math.floor(Math.random() * 10) + 1;
  17744. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  17745. }
  17746. }
  17747. initD2world() {
  17748. let node = this.ui.d2Root.displayObject;
  17749. let src = node.getComponent(D2World);
  17750. if (!src) {
  17751. xGame.common.d2World = node.addComponent(D2World);
  17752. }
  17753. xGame.common.d2World.initSelf();
  17754. }
  17755. initD3world() {
  17756. if (this.isD3Inited)
  17757. return;
  17758. this.isD3Inited = true;
  17759. let scene3D = xGame.common.d3Scene;
  17760. this.ui.d3Root.displayObject.addChild(scene3D);
  17761. scene3D.active = true;
  17762. xGame.common.d3World.tableSrc.setBorderPos();
  17763. }
  17764. onRootMove(e) {
  17765. let rootBall = xGame.common.d2World.rootBall;
  17766. this.ui.moveNode.x = e.x;
  17767. this.ui.moveNode.y = e.y;
  17768. rootBall.gameObj.x = e.x;
  17769. rootBall.gameObj.y = e.y;
  17770. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  17771. }
  17772. aiRootMove(move) {
  17773. if (move)
  17774. this.hideBallUI();
  17775. else {
  17776. this.showBallUI();
  17777. xGame.common.d2World.getHelpLine();
  17778. }
  17779. }
  17780. aiForce(type, force = 0) {
  17781. this.pressTarget = PressType.powerNode;
  17782. if (type == 1)
  17783. this.onEventUp({ force: true });
  17784. else if (type == 2)
  17785. this.onEventMove({ stageY: force, force: true });
  17786. }
  17787. onEventPress(e) {
  17788. if (e.stopPropagation)
  17789. e.stopPropagation();
  17790. if (!this.isTurnSelf())
  17791. return;
  17792. let target = e.target;
  17793. switch (target) {
  17794. case this.ui.myPowerNode.displayObject:
  17795. this.pressTarget = PressType.powerNode;
  17796. this.barInfo.curY = e.stageY;
  17797. this.updateBarInfo();
  17798. break;
  17799. case this.ui.moveNode.displayObject:
  17800. this.pressTarget = PressType.moveNode;
  17801. this.hideBallUI();
  17802. this.eventObj.curX = this.ui.moveNode.x;
  17803. this.eventObj.curY = this.ui.moveNode.y;
  17804. this.ui.moveNode.finger.visible = false;
  17805. this.eventObj.lastX = e.stageX;
  17806. this.eventObj.lastY = e.stageY;
  17807. break;
  17808. case this.ui.rulerClickNode.displayObject:
  17809. this.pressTarget = PressType.rulerNode;
  17810. this.eventObj.lastY = e.stageY;
  17811. break;
  17812. case this.ui.d2Root.displayObject:
  17813. this.pressTarget = PressType.d2Root;
  17814. this.eventObj.lastX = e.stageX;
  17815. this.eventObj.lastY = e.stageY;
  17816. this.eventObj.starX = e.stageX;
  17817. this.eventObj.starY = e.stageY;
  17818. this.eventObj.curX = 0;
  17819. this.eventObj.curY = 0;
  17820. xGame.common.d2World.d2Gan.setGanLastInfo();
  17821. this.rulerOffset = 0;
  17822. break;
  17823. default:
  17824. break;
  17825. }
  17826. }
  17827. onEventMove(e) {
  17828. if (e.stopPropagation)
  17829. e.stopPropagation();
  17830. if (e && e.force) {
  17831. }
  17832. else {
  17833. if (!this.isTurnSelf())
  17834. return;
  17835. }
  17836. switch (this.pressTarget) {
  17837. case PressType.powerNode:
  17838. this.barInfo.curY = e.stageY;
  17839. this.updateBarInfo();
  17840. this.isMoveRod = true;
  17841. break;
  17842. case PressType.moveNode:
  17843. let rootBall = xGame.common.d2World.rootBall;
  17844. let radius = rootBall.gameObj.width / 2;
  17845. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  17846. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  17847. let border = xGame.common.d2World.borderRect;
  17848. if (curX <= border.x + radius)
  17849. curX = border.x + radius;
  17850. else if (curX >= border.x + border.width - radius)
  17851. curX = border.x + border.width - radius;
  17852. if (curY <= border.y + radius)
  17853. curY = border.y + radius;
  17854. else if (curY >= border.y + border.height - radius)
  17855. curY = border.y + border.height - radius;
  17856. if (xGame.common.gameMgr.isOpenBall) {
  17857. if (curX >= border.x + border.openBallW - radius)
  17858. curX = border.x + border.openBallW - radius;
  17859. }
  17860. this.ui.moveNode.x = curX;
  17861. this.ui.moveNode.y = curY;
  17862. rootBall.gameObj.x = curX;
  17863. rootBall.gameObj.y = curY;
  17864. rootBall.d3BallSrc.setTransPos(curX, curY);
  17865. this.isMoveRod = true;
  17866. break;
  17867. case PressType.rulerNode:
  17868. let yy = e.stageY - this.eventObj.lastY;
  17869. this.eventObj.lastY = e.stageY;
  17870. let ruler1 = this.ui.rulerNode.img1;
  17871. let ruler2 = this.ui.rulerNode.img2;
  17872. ruler1.y += yy;
  17873. ruler2.y += yy;
  17874. this.rulerOffset += yy;
  17875. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  17876. this.rulerOffset = 0;
  17877. xGame.soundMgr.playSound("inch", 1, 10);
  17878. }
  17879. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  17880. let h = ruler1.height;
  17881. this.checkGuide();
  17882. this.isMoveRod = true;
  17883. if (ruler1.y >= h) {
  17884. ruler1.y = -h;
  17885. ruler2.y = 0;
  17886. return;
  17887. }
  17888. else if (ruler1.y <= -h) {
  17889. ruler1.y = h;
  17890. ruler2.y = 0;
  17891. return;
  17892. }
  17893. if (ruler2.y >= h) {
  17894. ruler2.y = -h;
  17895. ruler1.y = 0;
  17896. return;
  17897. }
  17898. else if (ruler2.y <= -h) {
  17899. ruler2.y = h;
  17900. ruler1.y = 0;
  17901. return;
  17902. }
  17903. break;
  17904. case PressType.d2Root:
  17905. this.eventObj.curX = e.stageX;
  17906. this.eventObj.curY = e.stageY;
  17907. let offset = this.checkRodMoveDir();
  17908. xGame.common.d2World.d2Gan.rotateSelf(offset);
  17909. this.eventObj.lastX = e.stageX;
  17910. this.eventObj.lastY = e.stageY;
  17911. break;
  17912. default:
  17913. break;
  17914. }
  17915. }
  17916. onEventUp(e) {
  17917. if (e.stopPropagation)
  17918. e.stopPropagation();
  17919. if (e && e.force) {
  17920. }
  17921. else {
  17922. if (!this.isTurnSelf())
  17923. return;
  17924. }
  17925. switch (this.pressTarget) {
  17926. case PressType.powerNode:
  17927. this.ui.powerNode.value = 0;
  17928. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  17929. this.ui.powerTxt.text = "";
  17930. if (this.powerNum > 0) {
  17931. xGame.eventMgr.event(BALL_SHOOT);
  17932. xGame.common.d2World.shoot(this.powerNum);
  17933. xGame.common.d2World.d2Gan.shoot();
  17934. xGame.common.d2World.d2HelpLine.shoot();
  17935. this.finishGuide();
  17936. this.ui.powerEft.visible = false;
  17937. this.ui.colorNode.visible = false;
  17938. let ganStr = "";
  17939. if (this.powerNum <= 30) {
  17940. ganStr = "gan_30";
  17941. }
  17942. else if (this.powerNum <= 60) {
  17943. ganStr = "gan_50";
  17944. }
  17945. else {
  17946. ganStr = "gan_80";
  17947. }
  17948. xGame.soundMgr.playSound(ganStr);
  17949. }
  17950. break;
  17951. case PressType.moveNode:
  17952. let rootBall = xGame.common.d2World.rootBall;
  17953. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  17954. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  17955. let isIntersect = this.judgeBallIntersect();
  17956. if (isIntersect) {
  17957. this.ui.moveNode.x = lastX;
  17958. this.ui.moveNode.y = lastY;
  17959. rootBall.gameObj.x = lastX;
  17960. rootBall.gameObj.y = lastY;
  17961. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  17962. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  17963. }
  17964. else {
  17965. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  17966. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  17967. }
  17968. this.showBallUI();
  17969. this.ui.moveNode.finger.visible = true;
  17970. xGame.common.d2World.getHelpLine();
  17971. break;
  17972. case PressType.rulerNode:
  17973. break;
  17974. case PressType.d2Root:
  17975. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  17976. if (dis <= 25) {
  17977. this.moveToClickDot(e);
  17978. }
  17979. break;
  17980. default:
  17981. break;
  17982. }
  17983. this.pressTarget = -1;
  17984. }
  17985. checkGuide() {
  17986. let guide = DataMgr.getSkillGuide();
  17987. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  17988. xGame.common.guideStep++;
  17989. xGame.common.gameUI.ui.guide2.visible = false;
  17990. xGame.common.gameUI.ui.guide3.visible = true;
  17991. }
  17992. }
  17993. finishGuide() {
  17994. let guide = DataMgr.getSkillGuide();
  17995. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  17996. xGame.common.guideStep = 10;
  17997. this.closeAllGuide();
  17998. }
  17999. }
  18000. closeAllGuide() {
  18001. xGame.common.gameUI.ui.guide1.visible = false;
  18002. xGame.common.gameUI.ui.guide2.visible = false;
  18003. xGame.common.gameUI.ui.guide3.visible = false;
  18004. }
  18005. updateBarInfo() {
  18006. let star = this.ui.powerNode.y;
  18007. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  18008. if (rate >= 1)
  18009. rate = 1;
  18010. if (rate <= 0)
  18011. rate = 0;
  18012. this.powerNum = Math.ceil(rate * 100);
  18013. this.ui.powerNode.value = this.powerNum;
  18014. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  18015. this.ui.colorNode.value = this.powerNum;
  18016. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  18017. this.ui.powerEft.visible = this.powerNum != 0;
  18018. this.ui.colorNode.visible = this.powerNum != 0;
  18019. this.ui.powerTxt.text = this.powerNum + "";
  18020. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  18021. }
  18022. forceCancel() {
  18023. this.ui.powerNode.value = 0;
  18024. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  18025. this.ui.powerTxt.text = "";
  18026. }
  18027. checkRodMoveDir() {
  18028. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  18029. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  18030. if (tempX >= 0 && tempY <= 0) {
  18031. return this.checkDir();
  18032. }
  18033. else if (tempX < 0 && tempY < 0) {
  18034. return this.checkDir(1, -1);
  18035. }
  18036. else if (tempX < 0 && tempY > 0) {
  18037. return this.checkDir(-1, -1);
  18038. }
  18039. else {
  18040. return this.checkDir(-1, 1);
  18041. }
  18042. }
  18043. checkDir(flagX = 1, flagY = 1) {
  18044. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  18045. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  18046. if (offsetY == 0) {
  18047. return offsetX * flagX;
  18048. }
  18049. if (offsetX == 0) {
  18050. return offsetY * flagY;
  18051. }
  18052. let angle = offsetY / offsetX;
  18053. if (Math.abs(angle) >= 1) {
  18054. return offsetY * flagY;
  18055. }
  18056. else {
  18057. return offsetX * flagX;
  18058. }
  18059. }
  18060. judgeBallIntersect() {
  18061. let rootBall = xGame.common.d2World.rootBall;
  18062. let ballArr = xGame.common.d2World.ballArr;
  18063. let radius = rootBall.gameObj.width / 2;
  18064. let temp;
  18065. let isIntersect = false;
  18066. for (let index = 0; index < ballArr.length; index++) {
  18067. temp = ballArr[index];
  18068. if (temp.number == rootBall.number)
  18069. continue;
  18070. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  18071. if (isIntersect) {
  18072. break;
  18073. }
  18074. }
  18075. return isIntersect;
  18076. }
  18077. hideBallUI() {
  18078. let d2Gan = xGame.common.d2World.d2Gan;
  18079. if (!d2Gan.ui.isDisposed)
  18080. d2Gan.ui.visible = false;
  18081. let d2Help = xGame.common.d2World.d2HelpLine;
  18082. if (!d2Help.ui.isDisposed)
  18083. d2Help.ui.visible = false;
  18084. let rootBall = xGame.common.d2World.rootBall;
  18085. if (!rootBall.destroyed) {
  18086. rootBall.gameObj.active = false;
  18087. }
  18088. }
  18089. showBallUI() {
  18090. let d2Gan = xGame.common.d2World.d2Gan;
  18091. if (!d2Gan.ui.isDisposed)
  18092. d2Gan.ui.visible = true;
  18093. let d2Help = xGame.common.d2World.d2HelpLine;
  18094. if (!d2Help.ui.isDisposed)
  18095. d2Help.ui.visible = true;
  18096. let rootBall = xGame.common.d2World.rootBall;
  18097. if (!rootBall.destroyed) {
  18098. rootBall.gameObj.active = true;
  18099. }
  18100. }
  18101. moveToClickDot(e) {
  18102. if (!this.isMoveRod && !xGame.common.clickedBall) {
  18103. let root = xGame.common.d2World.rootBall.gameObj;
  18104. let xx = e.stageX - xGame.common.sysOffestNum;
  18105. let yy = e.stageY;
  18106. let x = xx - root.x;
  18107. let y = yy - root.y;
  18108. let angle = xGame.common.getfguiRotation(x, y);
  18109. xGame.common.d2World.d2Gan.ui.rotation = angle;
  18110. xGame.common.d2World.getHelpLine();
  18111. }
  18112. this.isMoveRod = false;
  18113. xGame.common.clickedBall = false;
  18114. }
  18115. openAllEvent() {
  18116. this.closeAllEvent();
  18117. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18118. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18119. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18120. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18121. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  18122. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  18123. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  18124. }
  18125. closeAllEvent() {
  18126. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18127. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18128. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18129. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18130. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  18131. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  18132. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  18133. }
  18134. resetGame() {
  18135. this.closeAllEvent();
  18136. this.hideBallUI();
  18137. xGame.common.gameMgr.gamePause = true;
  18138. }
  18139. }
  18140. UIGame$1.uiName = "UIGame";
  18141. class UIAddCoin$1 extends UIBase {
  18142. constructor() {
  18143. super();
  18144. this.coinNum = 2000;
  18145. }
  18146. onConstructor() {
  18147. this.ui = ui_UIAddCoin.createInstance();
  18148. this.contentPane = this.ui;
  18149. this.isEject = false;
  18150. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  18151. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  18152. }
  18153. show() {
  18154. super.show();
  18155. this.ui.t0.play();
  18156. }
  18157. videoAddCoin() {
  18158. console.log('zh:qjff_AD_for_UIAddCoin');
  18159. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  18160. }
  18161. else {
  18162. console.log('zh:AD 失败,直接发放奖励');
  18163. this.qjff_AD_for_UIAddCoin();
  18164. }
  18165. }
  18166. qjff_AD_for_UIAddCoin() {
  18167. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  18168. this.hide();
  18169. }
  18170. }
  18171. UIAddCoin$1.uiName = "UIAddCoin";
  18172. class UIInvitation$1 extends UIBase {
  18173. constructor() {
  18174. super();
  18175. }
  18176. onConstructor() {
  18177. this.ui = ui_UIInvitation.createInstance();
  18178. this.contentPane = this.ui;
  18179. this.isEject = false;
  18180. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  18181. }
  18182. show() {
  18183. super.show();
  18184. }
  18185. enterGame() {
  18186. xGame.common.gameMode = GameMode.classic;
  18187. DataMgr.setChallengeTimes(1);
  18188. xGame.common.passAwardCoin = 2000;
  18189. let need = xGame.common.classicNiceNeddCoin;
  18190. if (DataMgr.coinEnough(need)) {
  18191. DataMgr.setCoin(-need);
  18192. xGame.eventMgr.event(RESTART_GAME, true);
  18193. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  18194. }
  18195. else {
  18196. xGame.eventMgr.event(RESTART_GAME, true);
  18197. }
  18198. this.hide();
  18199. }
  18200. hide() {
  18201. super.hide();
  18202. }
  18203. }
  18204. UIInvitation$1.uiName = "UIInvitation";
  18205. class UIPower$1 extends UIBase {
  18206. constructor() {
  18207. super();
  18208. }
  18209. onConstructor() {
  18210. this.ui = ui_UIPower.createInstance();
  18211. this.contentPane = this.ui;
  18212. this.isEject = false;
  18213. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  18214. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  18215. }
  18216. show() {
  18217. super.show();
  18218. this.ui.t0.play();
  18219. }
  18220. videoGetPower() {
  18221. console.log('zh:qjff_AD_for_uipower');
  18222. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  18223. }
  18224. else {
  18225. console.log('zh:AD 失败,直接发放奖励');
  18226. this.qjff_AD_for_uipower();
  18227. }
  18228. }
  18229. qjff_AD_for_uipower() {
  18230. DataMgr.setPower(xGame.common.videoPower, true);
  18231. xGame.eventMgr.event(POWER_TIME);
  18232. this.hide();
  18233. }
  18234. }
  18235. UIPower$1.uiName = "UIPower";
  18236. class UIGameEnd$1 extends UIBase {
  18237. constructor() {
  18238. super();
  18239. this.success = false;
  18240. this.awardCoinNum = 1000;
  18241. this.awardDiamondNum = 10;
  18242. }
  18243. onConstructor() {
  18244. this.ui = ui_UIGameEnd.createInstance();
  18245. this.contentPane = this.ui;
  18246. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  18247. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  18248. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  18249. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18250. this.ui.talkNode.visible = false;
  18251. if (Moyu.isKs)
  18252. this.ui.closeNode.closeBtn.x += 100;
  18253. }
  18254. updateType() {
  18255. switch (xGame.common.gameMode) {
  18256. case GameMode.classic:
  18257. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  18258. this.ui.coinNode.visible = this.success;
  18259. if (!this.success) {
  18260. Laya.timer.once(500, this, () => {
  18261. xGame.uiMgr.Show(UIAddCoin$1);
  18262. });
  18263. }
  18264. this.ui.isGetAward.visible = false;
  18265. this.ui.leftBtn.c1.selectedIndex = 3;
  18266. this.ui.rightBtn.c1.selectedIndex = 0;
  18267. this.moneyNode.ui.c1.selectedIndex = 1;
  18268. break;
  18269. case GameMode.bigMove:
  18270. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  18271. this.ui.coinNode.visible = this.success;
  18272. if (xGame.common.gameMode == GameMode.bigMove) {
  18273. if (this.success) {
  18274. DataMgr.setSkillSuccessTimes(1, true);
  18275. DataMgr.setSkillAccTimes(1);
  18276. }
  18277. else {
  18278. DataMgr.setSkillSuccessTimes(0, false);
  18279. }
  18280. }
  18281. if (!this.success) {
  18282. Laya.timer.once(500, this, () => {
  18283. xGame.uiMgr.Show(UIAddCoin$1);
  18284. });
  18285. }
  18286. this.ui.isGetAward.visible = false;
  18287. this.ui.leftBtn.c1.selectedIndex = 3;
  18288. this.ui.rightBtn.c1.selectedIndex = 0;
  18289. this.moneyNode.ui.c1.selectedIndex = 1;
  18290. break;
  18291. case GameMode.placeBall:
  18292. this.ui.coinNode.visible = false;
  18293. if (this.success) {
  18294. if (xGame.common.placeBallStarNum == 3) {
  18295. this.ui.c1.selectedIndex = 2;
  18296. }
  18297. else {
  18298. this.ui.c1.selectedIndex = 3;
  18299. }
  18300. }
  18301. else {
  18302. this.ui.c1.selectedIndex = 4;
  18303. }
  18304. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  18305. if (cfg.type == PlaceBallType.challenge) {
  18306. this.ui.c1.selectedIndex = 2;
  18307. }
  18308. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  18309. this.updatePlaceBallBtn();
  18310. this.updatePlaceBallStarNum();
  18311. this.updatePlaceBallAwardState();
  18312. this.moneyNode.ui.c1.selectedIndex = 2;
  18313. this.moneyNode.checkPowerTime();
  18314. this.moneyNode.powerChange();
  18315. DataMgr.upRankData();
  18316. break;
  18317. default:
  18318. break;
  18319. }
  18320. }
  18321. updatePlaceBallBtn() {
  18322. this.ui.leftBtn.c1.selectedIndex = 5;
  18323. if (this.success) {
  18324. this.ui.rightBtn.c1.selectedIndex = 14;
  18325. }
  18326. else {
  18327. if (xGame.common.placeBallStarNum == 3) {
  18328. this.ui.rightBtn.c1.selectedIndex = 14;
  18329. }
  18330. else {
  18331. this.ui.rightBtn.c1.selectedIndex = 1;
  18332. }
  18333. }
  18334. }
  18335. updatePlaceBallStarNum() {
  18336. let starNum = xGame.common.placeBallStarNum;
  18337. if (starNum == 0)
  18338. this.ui.starNumNode.c1.selectedIndex = 3;
  18339. else {
  18340. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  18341. }
  18342. }
  18343. updatePlaceBallAwardState() {
  18344. let level = xGame.common.placeBallCurLevel;
  18345. let starNum = xGame.common.placeBallStarNum;
  18346. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  18347. let data = cfgTable.placeballData[level].award;
  18348. let cfg = cfgTable.placeballData[level];
  18349. this.awardDiamondNum = data[1];
  18350. this.awardCoinNum = data[0];
  18351. if (cfg.type == PlaceBallType.challenge) {
  18352. this.awardDiamondNum = 0;
  18353. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  18354. }
  18355. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  18356. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  18357. if (cfg.type == PlaceBallType.challenge) {
  18358. this.ui.awardNode.coinNode.visible = true;
  18359. }
  18360. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  18361. this.ui.awardNode.diamondNode.x = 265;
  18362. this.ui.awardNode.coinNode.x = 354;
  18363. }
  18364. else {
  18365. this.ui.awardNode.diamondNode.x = 291;
  18366. this.ui.awardNode.coinNode.x = 291;
  18367. }
  18368. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  18369. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  18370. if (this.awardCoinNum == 0) {
  18371. this.ui.awardNode.coinNode.numTxt.text = "";
  18372. }
  18373. if (getAward) {
  18374. this.ui.isGetAward.visible = true;
  18375. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  18376. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  18377. }
  18378. else {
  18379. this.ui.isGetAward.visible = false;
  18380. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  18381. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  18382. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  18383. }
  18384. else {
  18385. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  18386. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  18387. }
  18388. }
  18389. }
  18390. show(success) {
  18391. super.show();
  18392. xGame.eventMgr.event(RESET_GAME);
  18393. this.success = success;
  18394. Laya.timer.clearAll(this);
  18395. this.playSecretaryAni();
  18396. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  18397. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  18398. offsetTime = Math.floor(offsetTime / 1000);
  18399. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  18400. this.updateType();
  18401. Laya.timer.once(200, this, () => {
  18402. this.addAward(() => {
  18403. this.updateType();
  18404. Laya.timer.once(500, this, () => {
  18405. this.showChallengeLevel();
  18406. });
  18407. });
  18408. });
  18409. if (this.success) {
  18410. xGame.soundMgr.playSound('slots_roll01');
  18411. xGame.soundMgr.playSound("s_win");
  18412. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18413. }
  18414. else {
  18415. xGame.soundMgr.playSound('matchwin01');
  18416. xGame.soundMgr.playSound("s_lose");
  18417. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18418. }
  18419. if (!Moyu.isLegal)
  18420. PlatMgr.showBanner(true);
  18421. let challengeNum = DataMgr.getChallengeTimes();
  18422. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  18423. DataMgr.setChallengeTimes(1);
  18424. }
  18425. if (this.success && xGame.common.gameMode == GameMode.classic) {
  18426. DataMgr.setClassicTimes();
  18427. }
  18428. }
  18429. showChallengeLevel() {
  18430. if (DataMgr.getChallengeTimes() != 0)
  18431. return;
  18432. let skill = DataMgr.getSkillAccTimes();
  18433. let put = DataMgr.getPlaceBallLevelList().length;
  18434. if (skill >= 3 || put >= 5) {
  18435. xGame.uiMgr.Show(UIInvitation$1);
  18436. this.hide();
  18437. }
  18438. }
  18439. addAward(callback) {
  18440. if (!this.success) {
  18441. callback && callback();
  18442. return;
  18443. }
  18444. switch (xGame.common.gameMode) {
  18445. case GameMode.classic:
  18446. this.awardCoinNum = xGame.common.passAwardCoin;
  18447. this.awardDiamondNum = 0;
  18448. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  18449. break;
  18450. case GameMode.bigMove:
  18451. this.awardCoinNum = xGame.common.passAwardCoin;
  18452. this.awardDiamondNum = 0;
  18453. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  18454. callback && callback();
  18455. break;
  18456. case GameMode.placeBall:
  18457. let level = xGame.common.placeBallCurLevel;
  18458. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  18459. if (xGame.common.placeBallStarNum != 3) {
  18460. callback && callback();
  18461. return;
  18462. }
  18463. else {
  18464. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  18465. if (getAward) {
  18466. callback && callback();
  18467. return;
  18468. }
  18469. }
  18470. let cfg = cfgTable.placeballData[level];
  18471. let data = cfgTable.placeballData[level].award;
  18472. this.awardCoinNum = data[0];
  18473. this.awardDiamondNum = data[1];
  18474. if (cfg.type == PlaceBallType.challenge) {
  18475. this.awardDiamondNum = 0;
  18476. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  18477. }
  18478. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  18479. let diamondAward;
  18480. if (this.awardDiamondNum > 0) {
  18481. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  18482. xGame.common.getAward([diamondAward, coinAward], callback);
  18483. }
  18484. else {
  18485. xGame.common.getAward([coinAward], callback);
  18486. }
  18487. if (cfg.type == PlaceBallType.normal) {
  18488. DataMgr.setPlaceBallAward(level);
  18489. }
  18490. break;
  18491. default:
  18492. break;
  18493. }
  18494. }
  18495. playSecretaryAni_old() {
  18496. let parent = this.ui.secretary.displayObject;
  18497. parent.destroyChildren();
  18498. let xx = this.ui.secretary.width / 2;
  18499. let yy = this.ui.secretary.height;
  18500. let scale = xGame.common.getSecretaryScale();
  18501. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18502. if (this.success) {
  18503. let rand = Math.random() <= 0.5 ? 2 : 3;
  18504. xGame.common.secretary.play(data, rand, false, parent, () => {
  18505. xGame.common.secretary.play(data, 1, true, parent);
  18506. });
  18507. }
  18508. else {
  18509. xGame.common.secretary.play(data, 0, true, parent);
  18510. }
  18511. }
  18512. playSecretaryAni() {
  18513. let parent = this.ui.secretary.displayObject;
  18514. parent.destroyChildren();
  18515. let xx = this.ui.secretary.width / 2;
  18516. let yy = this.ui.secretary.height;
  18517. let scale = xGame.common.getSecretaryScale();
  18518. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18519. if (this.success) {
  18520. let rand = 0;
  18521. xGame.common.secretary.play(data, 0, true, parent);
  18522. }
  18523. else {
  18524. xGame.common.secretary.play(data, 0, true, parent);
  18525. }
  18526. }
  18527. restartGame() {
  18528. switch (xGame.common.gameMode) {
  18529. case GameMode.classic:
  18530. xGame.eventMgr.event(RESTART_GAME);
  18531. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18532. break;
  18533. case GameMode.bigMove:
  18534. this.hide();
  18535. xGame.eventMgr.event(RESTART_GAME);
  18536. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18537. break;
  18538. default:
  18539. break;
  18540. }
  18541. }
  18542. hide() {
  18543. super.hide();
  18544. xGame.common.stopGirlPop(this.ui.talkNode);
  18545. PlatMgr.showBanner(false);
  18546. }
  18547. returnHome() {
  18548. this.hide();
  18549. let showFailWords = !this.success;
  18550. xGame.uiMgr.Show(UIMain$1, showFailWords);
  18551. }
  18552. clickLeftBtn() {
  18553. switch (xGame.common.gameMode) {
  18554. case GameMode.classic:
  18555. case GameMode.bigMove:
  18556. this.returnHome();
  18557. break;
  18558. case GameMode.placeBall:
  18559. let level = xGame.common.placeBallCurLevel;
  18560. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  18561. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18562. break;
  18563. default:
  18564. break;
  18565. }
  18566. }
  18567. powerStartPlaceBallLevel(level, btn) {
  18568. if (DataMgr.powerEnough()) {
  18569. btn.touchable = false;
  18570. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  18571. btn.touchable = true;
  18572. DataMgr.setPower(-1);
  18573. xGame.eventMgr.event(POWER_TIME);
  18574. this.startPlaceBallLevel(level);
  18575. }));
  18576. }
  18577. else {
  18578. xGame.uiMgr.Show(UIPower$1, 0);
  18579. }
  18580. }
  18581. clickRightBtn() {
  18582. switch (xGame.common.gameMode) {
  18583. case GameMode.classic:
  18584. console.log('zh:clickRightBtn 111');
  18585. case GameMode.bigMove:
  18586. console.log('zh:clickRightBtn 222');
  18587. this.restartGame();
  18588. break;
  18589. case GameMode.placeBall:
  18590. console.log('zh:clickRightBtn 333');
  18591. let level = xGame.common.placeBallCurLevel;
  18592. let data = DataMgr.getPlaceBallLevel(level);
  18593. let curPss = data.play && !data.isCur;
  18594. if (curPss) {
  18595. console.log('zh:clickRightBtn 333-111');
  18596. console.log('zh:当前LV=' + level);
  18597. if (level == 60) {
  18598. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  18599. Laya.timer.once(3000, this, () => {
  18600. this.returnHome();
  18601. });
  18602. }
  18603. else {
  18604. this.powerStartPlaceBallLevel(level + 1, this.ui.rightBtn);
  18605. }
  18606. }
  18607. else {
  18608. console.log('zh:clickRightBtn 333-000');
  18609. Moyu.sendDataEvent("placeBallNextLevel");
  18610. console.log('zh:qjff_AD_for_uiGameEnd');
  18611. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  18612. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  18613. }
  18614. else {
  18615. console.log('zh:AD 失败,直接发放奖励');
  18616. this.qjff_AD_for_uiGameEnd(level);
  18617. }
  18618. }
  18619. break;
  18620. default:
  18621. console.log('zh:clickRightBtn 444');
  18622. break;
  18623. }
  18624. }
  18625. qjff_AD_for_uiGameEnd(level) {
  18626. DataMgr.setPlaceBallLevel(level, 1);
  18627. this.startPlaceBallLevel(level + 1);
  18628. }
  18629. startPlaceBallLevel(level) {
  18630. xGame.common.gameMode = GameMode.placeBall;
  18631. xGame.common.placeBallCurLevel = level;
  18632. xGame.uiMgr.Show(UIGame$1);
  18633. this.hide();
  18634. }
  18635. }
  18636. UIGameEnd$1.uiName = "UIGameEnd";
  18637. class ShowItem$1 {
  18638. constructor() {
  18639. this.ui = ui_ShowItem.createInstance();
  18640. }
  18641. destroySelf() {
  18642. if (!this.ui.isDisposed) {
  18643. this.ui.removeFromParent();
  18644. this.ui.dispose();
  18645. }
  18646. }
  18647. setParent(parent) {
  18648. parent.addChild(this.ui);
  18649. }
  18650. setPos(x, y) {
  18651. this.ui.x = x;
  18652. this.ui.y = y;
  18653. }
  18654. setUrl(index) {
  18655. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  18656. }
  18657. }
  18658. class UILevelProp$1 extends UIBase {
  18659. constructor() {
  18660. super();
  18661. this.firstPos = 385;
  18662. this.secondPos = 467;
  18663. this.showItemArr = [];
  18664. }
  18665. onFontLoaded() {
  18666. try {
  18667. this.ui.myNode.conditionTxt.font = "arial";
  18668. console.log("zh: onFontLoaded 设置arial字体成功");
  18669. }
  18670. catch (error) {
  18671. console.log("zh: constructor onFontLoaded加载arial字体失败");
  18672. }
  18673. }
  18674. onConstructor() {
  18675. this.ui = ui_UILevelProp.createInstance();
  18676. this.contentPane = this.ui;
  18677. this.isEject = false;
  18678. this.addUIClick(this.ui.closeBtn, this.hide);
  18679. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18680. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  18681. }
  18682. show(level) {
  18683. super.show();
  18684. this.ui.t1.play();
  18685. this.level = level;
  18686. this.data = cfgTable.placeballData[this.level];
  18687. this.updateSelf();
  18688. this.showPreView();
  18689. this.moneyNode.ui.c1.selectedIndex = 2;
  18690. this.moneyNode.checkPowerTime();
  18691. this.moneyNode.powerChange();
  18692. }
  18693. showPreView() {
  18694. let item;
  18695. let data;
  18696. for (let index = 0; index < this.showItemArr.length; index++) {
  18697. item = this.showItemArr[index];
  18698. item.destroySelf();
  18699. }
  18700. this.showItemArr = [];
  18701. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  18702. for (const key in cfgData) {
  18703. data = cfgData[key];
  18704. item = new ShowItem$1();
  18705. item.setParent(this.ui.myNode.displayRoot);
  18706. item.setPos(data.x, data.y);
  18707. item.setUrl(data.value);
  18708. this.showItemArr.push(item);
  18709. }
  18710. }
  18711. updateSelf() {
  18712. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  18713. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  18714. if (this.data.ball == -1) {
  18715. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  18716. }
  18717. else {
  18718. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  18719. }
  18720. let localData = DataMgr.getPlaceBallLevel(this.level);
  18721. let getAward = localData.getAward;
  18722. let cfg = cfgTable.placeballData[this.level];
  18723. let coin = this.data.award[0];
  18724. let diamond = this.data.award[1];
  18725. if (cfg.type == PlaceBallType.challenge) {
  18726. diamond = 0;
  18727. coin = 100;
  18728. }
  18729. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  18730. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  18731. this.ui.myNode.coinNode.numTxt.text = coin + "";
  18732. if (cfg.type == PlaceBallType.challenge) {
  18733. this.ui.myNode.coinNode.numTxt.text = "";
  18734. }
  18735. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  18736. if (coin > 0 && diamond > 0) {
  18737. this.ui.myNode.diamondNode.x = 385;
  18738. this.ui.myNode.coinNode.x = 467;
  18739. }
  18740. else {
  18741. this.ui.myNode.diamondNode.x = 385;
  18742. this.ui.myNode.coinNode.x = 385;
  18743. }
  18744. if (!getAward) {
  18745. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  18746. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  18747. }
  18748. else {
  18749. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  18750. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  18751. }
  18752. }
  18753. startGame() {
  18754. if (DataMgr.powerEnough()) {
  18755. this.ui.myNode.startBtn.touchable = false;
  18756. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  18757. console.log('zh:startGame ');
  18758. this.ui.myNode.startBtn.touchable = true;
  18759. DataMgr.setPower(-1);
  18760. xGame.eventMgr.event(POWER_TIME);
  18761. xGame.common.gameMode = GameMode.placeBall;
  18762. xGame.common.placeBallCurLevel = this.level;
  18763. xGame.uiMgr.Show(UIGame$1);
  18764. xGame.uiMgr.Hide(UILevelDisplay$1);
  18765. xGame.uiMgr.Hide(UIMain$1);
  18766. this.hide();
  18767. }));
  18768. }
  18769. else {
  18770. console.log('zh:startGame no power');
  18771. xGame.uiMgr.Show(UIPower$1);
  18772. }
  18773. }
  18774. hide() {
  18775. super.hide();
  18776. }
  18777. }
  18778. UILevelProp$1.uiName = "UILevelProp";
  18779. class PutBallLevelDisplay$1 {
  18780. constructor(ui, index) {
  18781. this.index = 0;
  18782. this.ui = ui;
  18783. this.index = index;
  18784. this.ui.onClick(this, this.clickSelf);
  18785. this.updateSelf();
  18786. this.ui.levelTxt.text = (this.index + 1) + "";
  18787. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  18788. this.ui.special.levelTxt.text = (this.index + 1) + "";
  18789. }
  18790. updateSelf() {
  18791. let level = this.index + 1;
  18792. this.data = DataMgr.getPlaceBallLevel(level);
  18793. this.ui.starNode.c1.selectedIndex = this.data.star;
  18794. let isChallenge = cfgTable.placeballData[level].type;
  18795. if (this.data.isCur) {
  18796. if (isChallenge) {
  18797. this.ui.c1.selectedIndex = 5;
  18798. }
  18799. else {
  18800. this.ui.c1.selectedIndex = 2;
  18801. }
  18802. }
  18803. else {
  18804. if (this.data.play) {
  18805. if (this.data.star == 3) {
  18806. this.ui.c1.selectedIndex = 0;
  18807. }
  18808. else {
  18809. this.ui.c1.selectedIndex = 1;
  18810. }
  18811. }
  18812. else {
  18813. if (isChallenge) {
  18814. this.ui.c1.selectedIndex = 4;
  18815. }
  18816. else {
  18817. this.ui.c1.selectedIndex = 3;
  18818. }
  18819. }
  18820. }
  18821. }
  18822. clickSelf() {
  18823. if (!this.data.play)
  18824. return;
  18825. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18826. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  18827. }
  18828. }
  18829. class UILevelDisplay$1 extends UIBase {
  18830. constructor() {
  18831. super();
  18832. }
  18833. onConstructor() {
  18834. this.ui = ui_UILevelDisplay.createInstance();
  18835. this.contentPane = this.ui;
  18836. this.isEject = false;
  18837. this.myList = this.ui.myNode.myList;
  18838. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  18839. this.levelItemArr = [];
  18840. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  18841. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  18842. this.myList.numItems = levelNum;
  18843. if (Moyu.isKs)
  18844. this.ui.closeNode.closeBtn.x += 100;
  18845. }
  18846. levelItemRender(index, target) {
  18847. let item = new PutBallLevelDisplay$1(target, index);
  18848. this.levelItemArr.push(item);
  18849. }
  18850. show() {
  18851. super.show();
  18852. this.updateLevel();
  18853. this.scrollToPlace();
  18854. }
  18855. updateLevel() {
  18856. let temp;
  18857. for (let index = 0; index < this.levelItemArr.length; index++) {
  18858. temp = this.levelItemArr[index];
  18859. temp.updateSelf();
  18860. }
  18861. }
  18862. scrollToPlace() {
  18863. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  18864. let passArr = DataMgr.getPlaceBallLevelList();
  18865. let offest = passArr.length;
  18866. if (offest >= maxNum - 1)
  18867. offest = maxNum - 1;
  18868. this.myList.scrollToView(offest, true, true);
  18869. }
  18870. hide() {
  18871. super.hide();
  18872. }
  18873. }
  18874. UILevelDisplay$1.uiName = "UILevelDisplay";
  18875. class UIMatching$1 extends UIBase {
  18876. constructor() {
  18877. super();
  18878. }
  18879. onConstructor() {
  18880. this.ui = ui_UIMatching.createInstance();
  18881. this.contentPane = this.ui;
  18882. this.isEject = false;
  18883. }
  18884. show(callback) {
  18885. super.show();
  18886. PlatMgr.showBanner(true);
  18887. this.callback = callback;
  18888. let user = Moyu.getUserInfo();
  18889. if (!this.selfPot) {
  18890. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  18891. }
  18892. if (!this.aiPot) {
  18893. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  18894. }
  18895. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  18896. this.ui.selfHead.nameTxt.text = user.nickName;
  18897. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  18898. this.ui.aiHead.nameTxt.text = "???";
  18899. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  18900. this.ui.selfHead.c1.selectedIndex = 0;
  18901. this.ui.aiHead.c1.selectedIndex = 0;
  18902. this.ui.selfHead.x = this.selfPot.x;
  18903. this.ui.selfHead.y = this.selfPot.y;
  18904. this.ui.aiHead.x = this.aiPot.x;
  18905. this.ui.aiHead.y = this.aiPot.y;
  18906. switch (xGame.common.gameMode) {
  18907. case GameMode.classic:
  18908. break;
  18909. case GameMode.bigMove:
  18910. this.initSkillData();
  18911. break;
  18912. default:
  18913. break;
  18914. }
  18915. this.ui.t1.play(Laya.Handler.create(this, () => {
  18916. this.ui.t2.play(Laya.Handler.create(this, () => {
  18917. switch (xGame.common.gameMode) {
  18918. case GameMode.classic:
  18919. this.waitingPeople();
  18920. break;
  18921. case GameMode.bigMove:
  18922. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  18923. break;
  18924. default:
  18925. break;
  18926. }
  18927. }));
  18928. }));
  18929. }
  18930. initSkillData() {
  18931. this.skillSelectData = [];
  18932. let skillUrl = xGame.common.skillIconList;
  18933. let skillName = xGame.common.skillNameList;
  18934. let skillLevel = DataMgr.getBigSkillList();
  18935. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  18936. for (let index = 0; index < 5; index++) {
  18937. let obj = {};
  18938. obj.skillImg = skillUrl[index];
  18939. obj.skillName = skillName[index];
  18940. obj.skillType = skillType[index];
  18941. obj.skillLevel = skillLevel[index];
  18942. this.skillSelectData.push(obj);
  18943. }
  18944. }
  18945. getAISkillLevel(myLevel) {
  18946. let video = xGame.common.upSkillLevel;
  18947. let aiLevel;
  18948. let temp;
  18949. if (video) {
  18950. temp = xGame.common.randomNum(-2, -1);
  18951. }
  18952. else {
  18953. if (myLevel <= 5) {
  18954. temp = xGame.common.randomNum(1, 3);
  18955. }
  18956. else if (myLevel <= 9) {
  18957. temp = xGame.common.randomNum(-2, 1);
  18958. }
  18959. else {
  18960. temp = xGame.common.randomNum(-4, 0);
  18961. }
  18962. }
  18963. aiLevel = temp + myLevel;
  18964. if (aiLevel <= 1)
  18965. aiLevel = 1;
  18966. if (aiLevel >= 10)
  18967. aiLevel = 10;
  18968. return aiLevel;
  18969. }
  18970. getAISkillType() {
  18971. return xGame.common.randomNum(1, 4);
  18972. let successTimes = DataMgr.getSkillSuccessTimes();
  18973. let info = cfgTable.aiskillData[successTimes];
  18974. if (!info) {
  18975. let max = Object.keys(cfgTable.aiskillData).length - 1;
  18976. info = cfgTable.aiskillData[max];
  18977. }
  18978. let dataArr = info.skillselect;
  18979. let myCfg = {};
  18980. for (let index = 0; index < dataArr.length; index++) {
  18981. let temp = dataArr[index].split('-');
  18982. myCfg[temp[0]] = {};
  18983. myCfg[temp[0]].id = parseInt(temp[0]);
  18984. myCfg[temp[0]].weight = parseInt(temp[1]);
  18985. }
  18986. let aiCfg = xGame.common.initWeight(myCfg);
  18987. let curData = xGame.common.getRandomWeightData(aiCfg);
  18988. return parseInt(curData.id);
  18989. }
  18990. getAISkillData(index) {
  18991. let myLevel = this.skillSelectData[index].skillLevel;
  18992. let aiLevel = this.getAISkillLevel(myLevel);
  18993. let aiType = this.getAISkillType() - 1;
  18994. return { aiLevel, aiType } = { aiLevel, aiType };
  18995. }
  18996. skillSelectFinish(index) {
  18997. let aiInfo = this.getAISkillData(index);
  18998. xGame.common.gameMgr.selfCurSkill = index;
  18999. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  19000. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  19001. this.ui.selfHead.c1.selectedIndex = 1;
  19002. this.ui.aiHead.c1.selectedIndex = 1;
  19003. let myData = this.skillSelectData[index];
  19004. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  19005. let guide = DataMgr.getSkillGuide();
  19006. if (guide == 0) {
  19007. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  19008. }
  19009. else {
  19010. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  19011. }
  19012. let aiData = this.skillSelectData[aiInfo.aiType];
  19013. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  19014. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  19015. this.waitingPeople();
  19016. }
  19017. waitingPeople() {
  19018. let time = xGame.common.randomNum(1000, 3000);
  19019. time += 1000;
  19020. Laya.timer.once(time, this, () => {
  19021. this.matchingSuccess();
  19022. });
  19023. }
  19024. matchingSuccess() {
  19025. let gameUI = xGame.common.gameUI;
  19026. let name = gameUI.ui.topNode.aiNameTxt.text;
  19027. let url = gameUI.ui.topNode.aiHeadLoader.url;
  19028. this.ui.aiHead.nameTxt.text = name;
  19029. this.ui.aiHead.headImg.url = url;
  19030. name = gameUI.ui.topNode.selfNameTxt.text;
  19031. url = gameUI.ui.topNode.selfHeadLoader.url;
  19032. this.ui.selfHead.nameTxt.text = name;
  19033. this.ui.selfHead.headImg.url = url;
  19034. this.ui.t3.play(Laya.Handler.create(this, () => {
  19035. this.callback && this.callback();
  19036. this.ui.t4.play(Laya.Handler.create(this, () => {
  19037. this.destroySelf();
  19038. }));
  19039. }));
  19040. }
  19041. destroySelf() {
  19042. this.callback = null;
  19043. this.skillSelectData = null;
  19044. this.selfPot = null;
  19045. this.aiPot = null;
  19046. if (!this.ui.isDisposed) {
  19047. this.ui.removeFromParent();
  19048. this.ui.dispose();
  19049. }
  19050. xGame.uiMgr.destroyUI(this);
  19051. }
  19052. }
  19053. UIMatching$1.uiName = "UIMatching";
  19054. class SkillDisplay$1 {
  19055. constructor(ui, data, uiIndex) {
  19056. this.starX = 0;
  19057. this.starY = 0;
  19058. this.index = 0;
  19059. this.ui = ui;
  19060. this.data = data;
  19061. this.index = uiIndex;
  19062. this.initSelf();
  19063. console.log('zh:SkillDisplay constructor this.skillData=', data);
  19064. }
  19065. initSelf() {
  19066. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  19067. this.ui.nameTxt.text = this.data.name;
  19068. this.ui.describeTxt.text = this.data.describe;
  19069. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  19070. this.ui.startBtn.onClick(this, this.startGame);
  19071. this.updateSelf();
  19072. }
  19073. updateSelf() {
  19074. this.checkTry();
  19075. let level = DataMgr.getBigSkillByIndex(this.index);
  19076. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  19077. }
  19078. checkTry() {
  19079. let index = this.index;
  19080. let level = DataMgr.getBigSkillByIndex(index);
  19081. if (level == null) {
  19082. DataMgr.setBigSkill(index, 1, false);
  19083. level = 1;
  19084. }
  19085. this.ui.levelTxt.text = "LV." + level;
  19086. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  19087. this.ui.tryNode.visible = true;
  19088. else
  19089. this.ui.tryNode.visible = false;
  19090. }
  19091. clickAddLevel() {
  19092. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19093. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  19094. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  19095. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  19096. this.qjff_AD_for_skilldisplay_clickAddLevel();
  19097. }
  19098. else {
  19099. console.log('zh:AD 失败,直接发放奖励');
  19100. this.qjff_AD_for_skilldisplay_clickAddLevel();
  19101. }
  19102. }
  19103. qjff_AD_for_skilldisplay_clickAddLevel() {
  19104. DataMgr.setBigSkill(this.data.index, 1);
  19105. this.updateSelf();
  19106. xGame.common.upSkillLevel = true;
  19107. }
  19108. startGame() {
  19109. if (this.data.index == 3) {
  19110. alert('Coming soon!');
  19111. return;
  19112. }
  19113. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19114. let needCoin = xGame.common.bigMoveNeedCoin;
  19115. xGame.common.passAwardCoin = 2000;
  19116. let guide = DataMgr.getSkillGuide();
  19117. console.log('zh:startGame guide=' + guide);
  19118. xGame.common.temSelfLevel = 0;
  19119. if (guide == 0) {
  19120. needCoin = 0;
  19121. xGame.common.temSelfLevel = 100;
  19122. }
  19123. if (DataMgr.coinEnough(needCoin)) {
  19124. DataMgr.setCoin(-needCoin);
  19125. xGame.common.curPlayerSkillType = this.index;
  19126. if (guide == 0)
  19127. xGame.common.curPlayerSkillType = 0;
  19128. xGame.uiMgr.Show(UIGame$1);
  19129. xGame.uiMgr.Hide(UIMain$1);
  19130. xGame.uiMgr.Show(UIMatching$1, () => {
  19131. xGame.common.gameUI.ui.alpha = 1;
  19132. xGame.common.gameUI.startGame();
  19133. xGame.uiMgr.Hide(UISkill$1);
  19134. });
  19135. }
  19136. else {
  19137. xGame.uiMgr.Show(UIAddProp$1, 0);
  19138. Moyu.sendDataEvent("AddCoinVideo");
  19139. }
  19140. }
  19141. }
  19142. class UISkill$1 extends UIBase {
  19143. constructor() {
  19144. super();
  19145. this.skillData = [];
  19146. }
  19147. onConstructor() {
  19148. this.ui = ui_UISkill.createInstance();
  19149. this.contentPane = this.ui;
  19150. this.isEject = false;
  19151. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19152. this.initSkillData();
  19153. console.log('zh:aaaaaa1111111111');
  19154. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  19155. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  19156. console.log('zh:aaaaaa22222222');
  19157. this.displayList = [];
  19158. this.ui.skillNode.skillList.numItems = 3;
  19159. this.addUIClick(this.ui, this.interuptSecretary);
  19160. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  19161. this.ui.talkNode.visible = false;
  19162. if (Moyu.isKs)
  19163. this.ui.closeNode.closeBtn.x += 100;
  19164. }
  19165. show() {
  19166. super.show();
  19167. this.playSecretaryIdle();
  19168. this.moneyNode.ui.c1.selectedIndex = 1;
  19169. Laya.timer.clearAll(this);
  19170. xGame.soundMgr.playSound("s_start");
  19171. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19172. let guide = DataMgr.getSkillGuide();
  19173. this.ui.guideNode.visible = guide == 0;
  19174. let item = this.getSkillItemByUIIndex(0);
  19175. if (guide == 0) {
  19176. item.ui.c1.selectedIndex = 1;
  19177. }
  19178. else {
  19179. item.ui.c1.selectedIndex = 0;
  19180. }
  19181. this.ui.guideNode.guideBtn.visible = guide == 0;
  19182. for (let index = 0; index < this.displayList.length; index++) {
  19183. this.displayList[index].checkTry();
  19184. }
  19185. }
  19186. getSkillItemByUIIndex(cur) {
  19187. for (let index = 0; index < this.displayList.length; index++) {
  19188. if (this.displayList[index].index == cur) {
  19189. return this.displayList[index];
  19190. }
  19191. }
  19192. }
  19193. enterGuideLevel() {
  19194. let item = this.getSkillItemByUIIndex(0);
  19195. item.startGame();
  19196. if (DataMgr.getNewUser())
  19197. Moyu.sendDataEvent("gameStart1");
  19198. }
  19199. initSkillData() {
  19200. this.skillData = [];
  19201. let nameList = xGame.common.skillNameList;
  19202. let iconList = xGame.common.skillIconList;
  19203. let describeList = [
  19204. "Jump shot executed — ball bounced and pocketed an extra one!",
  19205. "Bonus Sweep: A random follow-up strike hits 1 extra ball after your shot!",
  19206. "Freeze Effect: Your shot freezes 1 random ball — enemy can’t hit it, and others bounce off!"
  19207. ];
  19208. console.log('zh:initSkillData 111111111');
  19209. let data;
  19210. for (let index = 0; index < nameList.length; index++) {
  19211. data = {};
  19212. data.name = nameList[index];
  19213. data.icon = iconList[index];
  19214. data.describe = describeList[index];
  19215. data.index = index;
  19216. this.skillData.push(data);
  19217. }
  19218. }
  19219. updateSkillItem(index, target) {
  19220. if (this.displayList[index] == null) {
  19221. let uiIndex;
  19222. switch (index) {
  19223. case 0:
  19224. uiIndex = 1;
  19225. break;
  19226. case 1:
  19227. uiIndex = 0;
  19228. break;
  19229. case 2:
  19230. uiIndex = 2;
  19231. break;
  19232. case 3:
  19233. uiIndex = 3;
  19234. break;
  19235. default:
  19236. break;
  19237. }
  19238. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  19239. this.displayList.push(temp);
  19240. }
  19241. }
  19242. playSecretaryIdle() {
  19243. let parent = this.ui.secretary.displayObject;
  19244. parent.destroyChildren();
  19245. let xx = this.ui.secretary.width / 2;
  19246. let yy = this.ui.secretary.height;
  19247. let scale = xGame.common.getSecretaryScale();
  19248. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19249. xGame.common.secretary.play(data, 0, true, parent);
  19250. }
  19251. returnUIMain() {
  19252. this.hide();
  19253. xGame.common.stopGirlPop(this.ui.talkNode);
  19254. xGame.uiMgr.Show(UIMain$1);
  19255. }
  19256. interuptSecretary() {
  19257. Laya.timer.clearAll(this);
  19258. this.playSecretaryRandomSound();
  19259. }
  19260. playSecretaryRandomSound() {
  19261. if (this.isHide)
  19262. return;
  19263. let time = xGame.common.randomNum(45000, 60000);
  19264. Laya.timer.once(time, this, () => {
  19265. if (this.isHide)
  19266. return;
  19267. let index = xGame.common.randomNum(4, 7);
  19268. xGame.soundMgr.playSound("s_main0" + index);
  19269. let words = 1;
  19270. switch (index) {
  19271. case 4:
  19272. words = 5;
  19273. break;
  19274. case 5:
  19275. words = 3;
  19276. break;
  19277. case 6:
  19278. words = 6;
  19279. break;
  19280. case 7:
  19281. words = 7;
  19282. break;
  19283. default:
  19284. break;
  19285. }
  19286. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19287. this.playSecretaryRandomSound();
  19288. });
  19289. }
  19290. }
  19291. UISkill$1.uiName = "UISkill";
  19292. class UIAddProp$1 extends UIBase {
  19293. constructor() {
  19294. super();
  19295. this.curType = "";
  19296. }
  19297. onConstructor() {
  19298. this.ui = ui_UIAddProp.createInstance();
  19299. this.contentPane = this.ui;
  19300. this.isEject = false;
  19301. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  19302. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  19303. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  19304. this.updateUI();
  19305. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  19306. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  19307. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  19308. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  19309. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  19310. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  19311. }
  19312. show(type) {
  19313. super.show();
  19314. this.curType = type == 0 ? "coin" : "diamond";
  19315. this.switchBtn("");
  19316. this.ui.t0.play();
  19317. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  19318. PlatMgr.showInsert(true);
  19319. }
  19320. closeSelf() {
  19321. this.hide();
  19322. }
  19323. updateUI() {
  19324. let data = cfgTable.moneyData;
  19325. let temp;
  19326. let obj;
  19327. for (const key in data) {
  19328. temp = data[key];
  19329. obj = this.ui.myNode["node" + key];
  19330. if (parseInt(key) <= 2) {
  19331. obj.diamondTxt.text = "+" + temp.num;
  19332. }
  19333. else {
  19334. obj.coinTxt.text = temp.num;
  19335. obj.diamondTxt.text = temp.get.split('_')[1];
  19336. }
  19337. }
  19338. this.updateDiamondShare();
  19339. }
  19340. updateDiamondShare() {
  19341. let data = DataMgr.getShareDiamondTimes();
  19342. if (data >= xGame.common.maxShareDiamondTimes) {
  19343. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  19344. this.ui.myNode.node1.touchable = false;
  19345. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  19346. }
  19347. else {
  19348. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  19349. this.ui.myNode.node1.touchable = true;
  19350. }
  19351. }
  19352. switchBtn(type) {
  19353. if (type == "")
  19354. type = this.curType;
  19355. else {
  19356. if (this.curType == type) {
  19357. return;
  19358. }
  19359. else {
  19360. this.curType = type;
  19361. }
  19362. }
  19363. if (type == "coin") {
  19364. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  19365. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  19366. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  19367. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  19368. this.ui.myNode.c1.selectedIndex = 0;
  19369. }
  19370. else {
  19371. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  19372. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  19373. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  19374. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  19375. this.ui.myNode.c1.selectedIndex = 1;
  19376. }
  19377. }
  19378. convertCoin(index) {
  19379. let data = cfgTable.moneyData[index];
  19380. let coinNum = data.num;
  19381. let str = data.get.split('_')[1];
  19382. let needDiamond = parseInt(str);
  19383. if (DataMgr.diamondEnough(needDiamond)) {
  19384. DataMgr.setDiamond(-needDiamond);
  19385. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  19386. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  19387. }
  19388. else {
  19389. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  19390. this.switchBtn("diamond");
  19391. }
  19392. }
  19393. videoGetDiamond() {
  19394. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  19395. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  19396. }
  19397. else {
  19398. console.log('zh:AD 失败,直接发放奖励');
  19399. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  19400. }
  19401. }
  19402. qjff_AD_for_uiAddProp_videoGetDiamond() {
  19403. let num = cfgTable.moneyData[2].num;
  19404. xGame.common.playObjFlyAnim(num, Prop.diamond);
  19405. this.closeSelf();
  19406. }
  19407. videoGetCoin() {
  19408. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  19409. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  19410. }
  19411. else {
  19412. console.log('zh:AD 失败,直接发放奖励');
  19413. this.qjff_AD_for_uiAddProp_videoGetCoin();
  19414. }
  19415. }
  19416. qjff_AD_for_uiAddProp_videoGetCoin() {
  19417. xGame.common.playObjFlyAnim(2000, Prop.coin);
  19418. this.closeSelf();
  19419. }
  19420. shareGetDiamond() {
  19421. let times = DataMgr.getShareDiamondTimes();
  19422. if (times >= xGame.common.maxShareDiamondTimes) {
  19423. console.log('zh: 233333333333 maxShareDiamondTimes');
  19424. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  19425. }
  19426. else {
  19427. console.log('zh:33333333333333ad');
  19428. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  19429. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  19430. }
  19431. else {
  19432. console.log('zh:AD 失败,直接发放奖励');
  19433. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  19434. }
  19435. }
  19436. }
  19437. qjff_AD_for_uiAddProp_shareGetDiamond() {
  19438. let diamond = xGame.common.randomNum(50, 100);
  19439. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  19440. DataMgr.setShareDiamondTimes(1);
  19441. this.updateDiamondShare();
  19442. }
  19443. openPutBallView() {
  19444. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  19445. let skill = xGame.uiMgr.getUI(UISkill$1);
  19446. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  19447. let uigame = xGame.uiMgr.getUI(UIGame$1);
  19448. if (end && !end.isHide) {
  19449. xGame.uiMgr.Hide(UIGameEnd$1);
  19450. xGame.uiMgr.Show(UIMain$1);
  19451. }
  19452. if (skill && !skill.isHide)
  19453. xGame.uiMgr.Hide(UISkill$1);
  19454. if (uigame && !uigame.isHide)
  19455. xGame.uiMgr.Hide(UIGame$1);
  19456. if (level && !level.isHide) {
  19457. }
  19458. else {
  19459. xGame.uiMgr.Show(UILevelDisplay$1);
  19460. }
  19461. this.closeSelf();
  19462. }
  19463. }
  19464. UIAddProp$1.uiName = "UIAddProp";
  19465. class MoneyNode$1 {
  19466. constructor(ui) {
  19467. this.leftTime = 0;
  19468. this.ui = ui;
  19469. this.ui.addCoinBtn.onClick(this, this.addCoin);
  19470. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  19471. this.ui.addPowerBtn.onClick(this, this.addPower);
  19472. this.ui.c1.selectedIndex = 1;
  19473. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  19474. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  19475. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  19476. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  19477. this.coinChange();
  19478. this.diamondChange();
  19479. this.powerChange();
  19480. }
  19481. addPower() {
  19482. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19483. xGame.uiMgr.Show(UIPower$1);
  19484. }
  19485. powerChange() {
  19486. let powerNum = DataMgr.getPower();
  19487. this.ui.powerTxt.text = powerNum + "";
  19488. }
  19489. checkPowerTime() {
  19490. let cur = new Date().getTime();
  19491. let last = DataMgr.getPowerTime();
  19492. if (last == 0) {
  19493. last = cur;
  19494. DataMgr.setPowerTime(cur);
  19495. }
  19496. let power = DataMgr.getPower();
  19497. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  19498. Laya.timer.clearAll(this);
  19499. if (power >= xGame.common.natureMaxPower) {
  19500. this.ui.powerTimeTxt.text = "";
  19501. DataMgr.setPowerTime(cur);
  19502. return;
  19503. }
  19504. if (power + offset >= xGame.common.natureMaxPower) {
  19505. DataMgr.setPower(xGame.common.natureMaxPower, false);
  19506. this.ui.powerTimeTxt.text = "";
  19507. DataMgr.setPowerTime(cur);
  19508. }
  19509. else {
  19510. if (offset > 0) {
  19511. DataMgr.setPower(offset);
  19512. DataMgr.setPowerTime(cur);
  19513. }
  19514. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  19515. this.leftTime = xGame.common.powerRecoverNum - time;
  19516. if (this.leftTime <= 0)
  19517. this.leftTime = 0;
  19518. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  19519. Laya.timer.loop(1000, this, this.updatePowerTime);
  19520. }
  19521. }
  19522. updatePowerTime() {
  19523. this.leftTime -= 1;
  19524. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  19525. if (this.leftTime <= 0) {
  19526. this.checkPowerTime();
  19527. }
  19528. }
  19529. coinChange() {
  19530. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  19531. }
  19532. diamondChange() {
  19533. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  19534. }
  19535. addCoin() {
  19536. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19537. Moyu.sendDataEvent("AddCoinBtn");
  19538. xGame.uiMgr.Show(UIAddProp$1, 0);
  19539. }
  19540. addDiamond() {
  19541. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19542. Moyu.sendDataEvent("AddDiamondBtn");
  19543. xGame.uiMgr.Show(UIAddProp$1, 1);
  19544. }
  19545. }
  19546. class SettingNode$1 {
  19547. constructor(ui) {
  19548. this.showSetting = false;
  19549. this.openSound = true;
  19550. this.openShake = true;
  19551. this.ui = ui;
  19552. this.ui.soundBtn.onClick(this, this.switchSound);
  19553. this.ui.shakeBtn.onClick(this, this.switchShake);
  19554. this.ui.xyBtn.onClick(this, this.onXy);
  19555. this.ui.clickNode.onClick(this, this.changeSetting);
  19556. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  19557. this.ui.xyBtn.visible = false;
  19558. this.ui.shakeBtn.visible = false;
  19559. }
  19560. changeSetting() {
  19561. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19562. this.showSetting = !this.showSetting;
  19563. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  19564. }
  19565. switchSound() {
  19566. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19567. this.openSound = !this.openSound;
  19568. Moyu.onSetting(this.openSound, this.openShake);
  19569. xGame.soundMgr.onSetting(this.openSound);
  19570. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  19571. }
  19572. switchShake() {
  19573. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19574. this.openShake = !this.openShake;
  19575. Moyu.onSetting(this.openSound, this.openShake);
  19576. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  19577. }
  19578. onXy() {
  19579. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19580. MoyuMgr$1.showXy(1);
  19581. }
  19582. }
  19583. class UIDraw$1 extends UIBase {
  19584. constructor() {
  19585. super();
  19586. this.curKey = 0;
  19587. }
  19588. onConstructor() {
  19589. this.ui = ui_UIDraw.createInstance();
  19590. this.contentPane = this.ui;
  19591. this.isEject = false;
  19592. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19593. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  19594. this.addUIClick(this.ui.drawBtn, this.startDraw);
  19595. this.initDraw();
  19596. this.initUI();
  19597. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  19598. if (Moyu.isKs)
  19599. this.ui.closeNode.closeBtn.x += 100;
  19600. }
  19601. show() {
  19602. super.show();
  19603. this.ui.t0.play();
  19604. this.playSecretaryIdle();
  19605. this.updateDraw();
  19606. this.checkFree();
  19607. if (PlatMgr.bannerDelay > 0) {
  19608. this.ui.closeNode.closeBtn.visible = false;
  19609. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  19610. this.ui.closeNode.closeBtn.visible = true;
  19611. });
  19612. }
  19613. PlatMgr.showRateBanner();
  19614. }
  19615. hide() {
  19616. Laya.timer.clearAll(this);
  19617. super.hide();
  19618. }
  19619. checkFree() {
  19620. let isFree = DataMgr.getDailyfreeDrawTimes();
  19621. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  19622. }
  19623. initDraw() {
  19624. this.drawObj = [];
  19625. let data = cfgTable.drawData;
  19626. let temp;
  19627. let weight = 0;
  19628. for (const key in data) {
  19629. temp = data[key];
  19630. weight += temp.weight;
  19631. this.drawObj.push(weight);
  19632. }
  19633. this.allWeight = weight;
  19634. }
  19635. initUI() {
  19636. let data = cfgTable.drawData;
  19637. let temp;
  19638. let img;
  19639. let txt;
  19640. for (const key in data) {
  19641. temp = data[key];
  19642. img = this.ui.myNode.rotNode["img" + key];
  19643. txt = this.ui.myNode.rotNode["txt" + key];
  19644. img.url = xGame.common.getGameIconUrl(temp.icon);
  19645. txt.visible = true;
  19646. if (temp.award > 2) {
  19647. img.rotation = 0;
  19648. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  19649. }
  19650. else {
  19651. img.rotation = temp.rotation;
  19652. txt.text = temp.num;
  19653. }
  19654. }
  19655. }
  19656. getCurkey() {
  19657. let rand = Math.random() * this.allWeight;
  19658. let temp;
  19659. for (let index = 0; index < this.drawObj.length - 1; index++) {
  19660. temp = this.drawObj[index];
  19661. if (index == 0) {
  19662. if (rand < temp) {
  19663. return index + 1;
  19664. }
  19665. }
  19666. else {
  19667. if (rand >= temp && rand < this.drawObj[index + 1]) {
  19668. return index + 1;
  19669. }
  19670. }
  19671. }
  19672. return 2;
  19673. }
  19674. startDraw() {
  19675. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  19676. if (freeTimes > 0) {
  19677. this.beginDraw();
  19678. DataMgr.setDailyfreeDrawTimes(0);
  19679. this.checkFree();
  19680. }
  19681. else {
  19682. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  19683. }
  19684. else {
  19685. console.log('zh:AD 失败,直接发放奖励');
  19686. this.qjff_chouJiang();
  19687. }
  19688. }
  19689. }
  19690. qjff_chouJiang() {
  19691. this.beginDraw();
  19692. }
  19693. beginDraw() {
  19694. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  19695. this.ui.drawBtn.touchable = false;
  19696. this.curKey = this.getCurkey();
  19697. console.log("当前key", this.curKey);
  19698. let cell = 60;
  19699. let lap = 3;
  19700. let angle = cell * (this.curKey - 1) + lap * 360;
  19701. let target = this.ui.myNode.rotNode;
  19702. target.rotation = 0;
  19703. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  19704. console.log("旋转完成");
  19705. this.ui.drawBtn.touchable = true;
  19706. this.getAward();
  19707. }));
  19708. }
  19709. getAward() {
  19710. let data = cfgTable.drawData[this.curKey];
  19711. let temp = new AwardType();
  19712. temp.type = data.award;
  19713. temp.num = data.num;
  19714. xGame.common.getAward([temp], () => {
  19715. DataMgr.setDrawTimes(1);
  19716. this.updateDraw();
  19717. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  19718. });
  19719. }
  19720. updateDraw() {
  19721. let drawTimes = DataMgr.getDrawTimes();
  19722. let awardTimes = DataMgr.getDrawAwardTimes();
  19723. if (Math.floor(drawTimes / 3) > awardTimes) {
  19724. this.ui.extraNode.boxBtn.t0.play(null, -1);
  19725. this.ui.extraNode.boxBtn.touchable = true;
  19726. this.ui.extraNode.tipsTxt.text = "3/3";
  19727. this.ui.extraNode.barNode.width = 265;
  19728. this.getExtraAward();
  19729. }
  19730. else {
  19731. this.ui.extraNode.boxBtn.t0.stop();
  19732. this.ui.extraNode.boxBtn.touchable = false;
  19733. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  19734. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  19735. }
  19736. let data = cfgTable.drawData[1];
  19737. if (awardTimes == 0) {
  19738. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  19739. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  19740. this.ui.myNode.rotNode.img1.rotation = 0;
  19741. }
  19742. else {
  19743. let award = data.nextid;
  19744. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  19745. this.ui.myNode.rotNode.txt1.text = award[1];
  19746. this.ui.myNode.rotNode.img1.rotation = 0;
  19747. }
  19748. }
  19749. getExtraAward() {
  19750. let drawTimes = DataMgr.getDrawTimes();
  19751. let awardTimes = DataMgr.getDrawAwardTimes();
  19752. let data = cfgTable.drawData[1];
  19753. let award = new AwardType();
  19754. if (awardTimes == 0) {
  19755. award.num = data.num;
  19756. award.type = data.award;
  19757. xGame.common.getAward([award], () => {
  19758. let all = Math.floor(drawTimes / 3);
  19759. DataMgr.setDrawAwardTimes(all);
  19760. this.updateDraw();
  19761. });
  19762. }
  19763. else {
  19764. award.num = parseInt(data.nextid[1]);
  19765. award.type = parseInt(data.nextid[0]);
  19766. xGame.common.getAward([award], () => {
  19767. let all = Math.floor(drawTimes / 3);
  19768. DataMgr.setDrawAwardTimes(all);
  19769. this.updateDraw();
  19770. });
  19771. }
  19772. }
  19773. closeSelf() {
  19774. this.hide();
  19775. }
  19776. playSecretaryIdle() {
  19777. let parent = this.ui.secretary.displayObject;
  19778. parent.destroyChildren();
  19779. let xx = this.ui.secretary.width / 2;
  19780. let yy = this.ui.secretary.height;
  19781. let scale = xGame.common.getSecretaryScale();
  19782. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19783. xGame.common.secretary.play(data, 0, true, parent);
  19784. }
  19785. }
  19786. UIDraw$1.uiName = "UIDraw";
  19787. class UIRanking$1 extends UIBase {
  19788. constructor() {
  19789. super();
  19790. this.showSelf = true;
  19791. this.rankType = 1;
  19792. this.rankList = [];
  19793. this.myIndex = 0;
  19794. this.myStar = 0;
  19795. }
  19796. onConstructor() {
  19797. this.ui = ui_UIRanking.createInstance();
  19798. this.contentPane = this.ui;
  19799. this.isEject = false;
  19800. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  19801. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  19802. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  19803. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  19804. this.ui.myNode.myList.setVirtual();
  19805. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  19806. }
  19807. show() {
  19808. super.show();
  19809. this.myIndex = 51;
  19810. Moyu.getRankList({
  19811. rankId: xGame.common.curRankID,
  19812. type: MoyuRankType.total,
  19813. page: 1,
  19814. pageSize: 50,
  19815. }, this, this.updateItemData);
  19816. this.updateSelf();
  19817. let self = Moyu.getUserInfo();
  19818. if (!self.isAuth) {
  19819. Moyu.initUser(this, () => {
  19820. DataMgr.upRankData();
  19821. });
  19822. }
  19823. }
  19824. updateSelfItem() {
  19825. let self = Moyu.getUserInfo();
  19826. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  19827. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > 50 ? "未上榜" : this.myIndex.toString();
  19828. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  19829. this.ui.myNode.selfNode.nameTxt.text = Moyu.platType < 11 ? self.nickName : "myself";
  19830. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  19831. }
  19832. updateItemData(data) {
  19833. this.myStar = xGame.common.getAllStarNum();
  19834. if (this.rankList.length < 2) {
  19835. this.rankList = data;
  19836. let self = Moyu.getUserInfo();
  19837. for (let i = 0; i < data.length; i++) {
  19838. let data = this.rankList[i];
  19839. if (data.userId == self.userId) {
  19840. this.rankList.splice(i, 1);
  19841. break;
  19842. }
  19843. }
  19844. for (let i = 0; i < data.length; i++) {
  19845. let data = this.rankList[i];
  19846. if (data.rankScore < this.myStar && this.myIndex > 50) {
  19847. this.myIndex = i + 1;
  19848. let user = { headIcon: self.headIcon, nickName: "myself" };
  19849. let ud = { user: user, data: {} };
  19850. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  19851. if (Moyu.platType < 11) {
  19852. user.headIcon = self.headIcon;
  19853. user.nickName = self.nickName;
  19854. }
  19855. this.rankList.splice(i, 0, md);
  19856. break;
  19857. }
  19858. }
  19859. }
  19860. this.updateSelfItem();
  19861. this.ui.myNode.myList.numItems = this.rankList.length;
  19862. }
  19863. updateItemUI(index, obj) {
  19864. let data = this.rankList[index];
  19865. let userData = JSON.parse(data.userData).user;
  19866. obj.nameTxt.text = userData.nickName.toString();
  19867. obj.valueTxt.text = data.rankScore;
  19868. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  19869. obj.rankTxt.text = index + 1;
  19870. switch (index) {
  19871. case 0:
  19872. this.setImg(obj, 1, 0, 0);
  19873. obj.rankTxt.color = "#FFC047";
  19874. break;
  19875. case 1:
  19876. this.setImg(obj, 0, 1, 0);
  19877. obj.rankTxt.color = "#ACACAC";
  19878. break;
  19879. case 2:
  19880. this.setImg(obj, 0, 0, 1);
  19881. obj.rankTxt.color = "#D09672";
  19882. break;
  19883. default:
  19884. this.setImg(obj, 0, 0, 0);
  19885. obj.rankTxt.color = "#496FAB";
  19886. break;
  19887. }
  19888. }
  19889. setImg(obj, a, b, c) {
  19890. obj.img1.visible = a ? true : false;
  19891. obj.img2.visible = b ? true : false;
  19892. obj.img3.visible = c ? true : false;
  19893. }
  19894. changeList(type) {
  19895. this.rankType = type;
  19896. this.updateSelf();
  19897. }
  19898. changeSelfNode() {
  19899. this.showSelf = !this.showSelf;
  19900. this.updateSelf();
  19901. }
  19902. updateSelf() {
  19903. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  19904. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  19905. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  19906. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  19907. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  19908. }
  19909. }
  19910. UIRanking$1.uiName = "UIRanking";
  19911. class UISecretary$1 extends UIBase {
  19912. constructor() {
  19913. super();
  19914. this.curIndex = 1;
  19915. }
  19916. onConstructor() {
  19917. this.ui = ui_UISecretary.createInstance();
  19918. this.contentPane = this.ui;
  19919. this.isEject = false;
  19920. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  19921. this.nodeObj = { left: null, right: null, cur: null };
  19922. this.nodeObj.cur = this.ui.myNode.gameNode3;
  19923. }
  19924. show() {
  19925. super.show();
  19926. this.ui.t0.play();
  19927. this.updateData();
  19928. }
  19929. addSecretarySpine(node, spineName) {
  19930. if (spineName == "mishu") {
  19931. if (this.secretarySpine1) {
  19932. node.displayObject.destroyChildren();
  19933. this.playWoman(this.secretarySpine1, node.displayObject);
  19934. }
  19935. else {
  19936. let spine1 = new SpineMgr("mishu", () => {
  19937. this.secretarySpine1 = spine1;
  19938. this.playWoman(this.secretarySpine1, node.displayObject);
  19939. });
  19940. }
  19941. }
  19942. else {
  19943. if (this.secretarySpine2) {
  19944. node.displayObject.destroyChildren();
  19945. this.playWoman(this.secretarySpine2, node.displayObject);
  19946. }
  19947. else {
  19948. let spine2 = new SpineMgr("xiaomishu2", () => {
  19949. this.secretarySpine2 = spine2;
  19950. this.playWoman(this.secretarySpine2, node.displayObject);
  19951. });
  19952. }
  19953. }
  19954. }
  19955. playWoman(node, parent) {
  19956. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  19957. let yy = this.ui.myNode.gameNode3.secretary.height;
  19958. let scale = 1.5;
  19959. if (node == this.secretarySpine2) {
  19960. scale = 1.2;
  19961. }
  19962. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19963. node.play(data, 0, true, parent);
  19964. }
  19965. turnLeft() {
  19966. this.curIndex--;
  19967. if (this.curIndex < 1) {
  19968. this.curIndex = 2;
  19969. }
  19970. let left = this.nodeObj.left;
  19971. let right = this.nodeObj.right;
  19972. let cur = this.nodeObj.cur;
  19973. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  19974. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  19975. Laya.Tween.to(cur, { 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(right, 2);
  19979. this.nodeObj.left = cur;
  19980. this.nodeObj.right = left;
  19981. this.nodeObj.cur = right;
  19982. }
  19983. turnRight() {
  19984. this.curIndex++;
  19985. if (this.curIndex > 2) {
  19986. this.curIndex = 1;
  19987. }
  19988. let left = this.nodeObj.left;
  19989. let right = this.nodeObj.right;
  19990. let cur = this.nodeObj.cur;
  19991. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  19992. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  19993. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  19994. this.updateData();
  19995. }));
  19996. this.ui.myNode.setChildIndex(left, 2);
  19997. this.nodeObj.left = right;
  19998. this.nodeObj.right = cur;
  19999. this.nodeObj.cur = left;
  20000. }
  20001. updateData() {
  20002. console.log('zh: updateData FFFFFFFFFF');
  20003. let data = cfgTable.secretaryshopData;
  20004. let children = this.ui.myNode._children;
  20005. let temp;
  20006. let curData;
  20007. for (let index = 0; index < children.length; index++) {
  20008. temp = children[index];
  20009. curData = data[1];
  20010. temp.heightTxt.text = curData.height;
  20011. temp.foodTxt.text = curData.food;
  20012. temp.historyTxt.text = curData.history;
  20013. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  20014. this.addSecretarySpine(temp.secretary, curData.spine);
  20015. let womanIndex = curData.id - 1;
  20016. let getWoman = DataMgr.getSecretary(womanIndex);
  20017. let curUse = DataMgr.getCurSecretary();
  20018. if (getWoman) {
  20019. if (curUse == womanIndex) {
  20020. temp.purchaseBtn.c1.selectedIndex = 1;
  20021. }
  20022. else {
  20023. temp.purchaseBtn.c1.selectedIndex = 2;
  20024. }
  20025. }
  20026. else {
  20027. temp.purchaseBtn.c1.selectedIndex = 0;
  20028. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  20029. }
  20030. temp.purchaseBtn.offClick(this, this.clickSecretary);
  20031. temp.purchaseBtn.onClick(this, this.clickSecretary, [getWoman, curUse, womanIndex, curData.price]);
  20032. }
  20033. }
  20034. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  20035. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20036. if (getWoman) {
  20037. if (curUse != womanIndex) {
  20038. console.log();
  20039. DataMgr.setCurSecretary(womanIndex);
  20040. this.updateData();
  20041. }
  20042. }
  20043. else {
  20044. console.log('zh:点击购买了');
  20045. let need = needDiamond;
  20046. if (DataMgr.diamondEnough(need)) {
  20047. DataMgr.setDiamond(-need);
  20048. DataMgr.setSecretary(womanIndex, 1);
  20049. DataMgr.setCurSecretary(womanIndex);
  20050. this.updateData();
  20051. }
  20052. else {
  20053. xGame.uiMgr.Show(UIAddProp$1, 1);
  20054. }
  20055. }
  20056. }
  20057. closeSelf() {
  20058. this.hide();
  20059. }
  20060. }
  20061. UISecretary$1.uiName = "UISecretary";
  20062. class BallRodDisplay$1 {
  20063. constructor(ui, index) {
  20064. this.index = 0;
  20065. this.uiIndex = 0;
  20066. this.ui = ui;
  20067. this.index = index;
  20068. this.initData();
  20069. }
  20070. initData() {
  20071. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  20072. let data = cfgTable.ballrodData[this.index + 1];
  20073. this.ui.nameTxt.text = data.name;
  20074. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  20075. this.ui.levelNode.c1.selectedIndex = data.quality;
  20076. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  20077. if (data.spine) {
  20078. this.mySpine = new SpineMgr(data.spine, () => {
  20079. let xx = 150;
  20080. let yy = 70;
  20081. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  20082. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  20083. });
  20084. }
  20085. }
  20086. updateSelf() {
  20087. console.log('zh:updateSelf -------------- ');
  20088. let get = DataMgr.getBallRod(this.index);
  20089. if (get == null)
  20090. get = 1;
  20091. let curUse = DataMgr.getCurBallRod();
  20092. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  20093. if (get) {
  20094. if (curUse == this.index) {
  20095. this.ui.purchaseBtn.c1.selectedIndex = 0;
  20096. }
  20097. else {
  20098. this.ui.purchaseBtn.c1.selectedIndex = 1;
  20099. }
  20100. }
  20101. else {
  20102. this.ui.purchaseBtn.c1.selectedIndex = 2;
  20103. }
  20104. }
  20105. buyBallRod() {
  20106. console.log('zh:buyBallRod eeeeee');
  20107. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20108. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  20109. switch (selectedIndex) {
  20110. case 0:
  20111. break;
  20112. case 1:
  20113. console.log('zh:点击了 USE THIS');
  20114. DataMgr.setCurBallRod(this.index);
  20115. let curUse = DataMgr.getCurBallRod();
  20116. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  20117. let ui = xGame.uiMgr.getUI(UIShop$1);
  20118. ui.updateBallRod();
  20119. break;
  20120. case 2:
  20121. let data = cfgTable.ballrodData[this.index + 1];
  20122. let need = data.price;
  20123. if (DataMgr.diamondEnough(need)) {
  20124. DataMgr.setDiamond(-need);
  20125. DataMgr.setBallRod(this.index, 1);
  20126. DataMgr.setCurBallRod(this.index);
  20127. let ui = xGame.uiMgr.getUI(UIShop$1);
  20128. ui.updateBallRod();
  20129. }
  20130. else {
  20131. xGame.uiMgr.Show(UIAddProp$1, 1);
  20132. }
  20133. break;
  20134. default:
  20135. break;
  20136. }
  20137. }
  20138. }
  20139. class UIShop$1 extends UIBase {
  20140. constructor() {
  20141. super();
  20142. this.itemNums = 0;
  20143. }
  20144. onConstructor() {
  20145. this.ui = ui_UIShop.createInstance();
  20146. this.contentPane = this.ui;
  20147. this.isEject = false;
  20148. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20149. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  20150. this.addUIClick(this.ui, this.interuptSecretary);
  20151. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  20152. this.ballRodArr = [];
  20153. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  20154. this.ui.myNode.myList.numItems = this.itemNums;
  20155. if (Moyu.isKs)
  20156. this.ui.closeNode.closeBtn.x += 100;
  20157. }
  20158. show() {
  20159. super.show();
  20160. this.playSecretaryIdle();
  20161. this.updateBallRod();
  20162. }
  20163. updateBallRod() {
  20164. for (let index = 0; index < this.ballRodArr.length; index++) {
  20165. this.ballRodArr[index].updateSelf();
  20166. }
  20167. }
  20168. renderBallRod(sort, obj) {
  20169. let index = this.getIndexBySort(sort + 1) - 1;
  20170. let ballRod = new BallRodDisplay$1(obj, index);
  20171. this.ballRodArr.push(ballRod);
  20172. }
  20173. getIndexBySort(sort) {
  20174. let object = cfgTable.ballrodData;
  20175. for (const key in object) {
  20176. if (object[key].sort == sort) {
  20177. return parseInt(key);
  20178. }
  20179. }
  20180. }
  20181. playSecretaryIdle() {
  20182. let parent = this.ui.secretary.displayObject;
  20183. parent.destroyChildren();
  20184. let xx = this.ui.secretary.width / 2;
  20185. let yy = this.ui.secretary.height;
  20186. let scale = xGame.common.getSecretaryScale();
  20187. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20188. xGame.common.secretary.play(data, 0, true, parent);
  20189. }
  20190. interuptSecretary() {
  20191. Laya.timer.clearAll(this);
  20192. this.playSecretaryRandomSound();
  20193. }
  20194. playSecretaryRandomSound() {
  20195. if (this.isHide)
  20196. return;
  20197. let time = xGame.common.randomNum(45000, 60000);
  20198. Laya.timer.once(time, this, () => {
  20199. if (this.isHide)
  20200. return;
  20201. let index = xGame.common.randomNum(4, 7);
  20202. xGame.soundMgr.playSound("s_main0" + index);
  20203. let words = 1;
  20204. switch (index) {
  20205. case 4:
  20206. words = 5;
  20207. break;
  20208. case 5:
  20209. words = 3;
  20210. break;
  20211. case 6:
  20212. words = 6;
  20213. break;
  20214. case 7:
  20215. words = 7;
  20216. break;
  20217. default:
  20218. break;
  20219. }
  20220. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20221. this.playSecretaryRandomSound();
  20222. });
  20223. }
  20224. closeSelf() {
  20225. this.hide();
  20226. }
  20227. }
  20228. UIShop$1.uiName = "UIShop";
  20229. class SignMax$1 {
  20230. constructor(ui) {
  20231. this.ui = ui;
  20232. }
  20233. updateSelf(index, sameDay, curDayIndex) {
  20234. let data = cfgTable.signData[index + 1];
  20235. this.ui.titleTxt.text = data.title;
  20236. let arr1 = data.award[0].split('-');
  20237. let arr2 = data.award[1].split('-');
  20238. let num1 = parseInt(arr1[1]);
  20239. let num2 = parseInt(arr2[1]);
  20240. this.ui.numTxt1.text = num1 + "";
  20241. this.ui.numTxt2.text = num2 + "";
  20242. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  20243. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  20244. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  20245. this.ui.numTxt1.visible = false;
  20246. }
  20247. else {
  20248. this.ui.numTxt1.visible = true;
  20249. }
  20250. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  20251. this.ui.numTxt2.visible = false;
  20252. }
  20253. else {
  20254. this.ui.numTxt2.visible = true;
  20255. }
  20256. if (index < curDayIndex) {
  20257. this.ui.c1.selectedIndex = 1;
  20258. }
  20259. else if (index == curDayIndex) {
  20260. if (sameDay) {
  20261. this.ui.c1.selectedIndex = 2;
  20262. }
  20263. else {
  20264. this.ui.c1.selectedIndex = 2;
  20265. }
  20266. }
  20267. else {
  20268. this.ui.c1.selectedIndex = 0;
  20269. }
  20270. }
  20271. }
  20272. class SignNormal$1 {
  20273. constructor(ui) {
  20274. this.ui = ui;
  20275. }
  20276. updateSelf(index, sameDay, curDayIndex) {
  20277. let data = cfgTable.signData[index + 1];
  20278. this.ui.titleTxt.text = data.title;
  20279. let arr = data.award[0].split('-');
  20280. let type = parseInt(arr[0]);
  20281. let num = parseInt(arr[1]);
  20282. this.ui.numTxt.text = num + "";
  20283. if (type > 2) {
  20284. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  20285. this.ui.myIcon.rotation = 0;
  20286. }
  20287. else {
  20288. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  20289. this.ui.myIcon.rotation = 0;
  20290. }
  20291. if (xGame.common.signAwardContainsRod(data.award)) {
  20292. this.ui.numTxt.visible = false;
  20293. }
  20294. else {
  20295. this.ui.numTxt.visible = true;
  20296. }
  20297. if (index < curDayIndex) {
  20298. this.ui.c1.selectedIndex = 1;
  20299. }
  20300. else if (index == curDayIndex) {
  20301. if (sameDay) {
  20302. this.ui.c1.selectedIndex = 2;
  20303. }
  20304. else {
  20305. this.ui.c1.selectedIndex = 2;
  20306. }
  20307. }
  20308. else {
  20309. this.ui.c1.selectedIndex = 0;
  20310. }
  20311. }
  20312. }
  20313. class UISign$1 extends UIBase {
  20314. constructor() {
  20315. super();
  20316. this.curDayIndex = 0;
  20317. this.starX = 0;
  20318. }
  20319. onConstructor() {
  20320. this.ui = ui_UISign.createInstance();
  20321. this.contentPane = this.ui;
  20322. this.isEject = false;
  20323. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20324. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  20325. this.initSignItem();
  20326. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  20327. this.addUIClick(this.ui.againBtn, this.againGetAward);
  20328. }
  20329. show() {
  20330. super.show();
  20331. this.ui.t0.play();
  20332. this.playSecretaryIdle();
  20333. this.updateSign();
  20334. }
  20335. initSignItem() {
  20336. this.signArr = [];
  20337. for (let index = 0; index < 6; index++) {
  20338. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  20339. this.signArr.push(temp);
  20340. }
  20341. this.signMax = new SignMax$1(this.ui.myNode.day7);
  20342. if (Moyu.isKs)
  20343. this.ui.closeNode.closeBtn.x += 100;
  20344. }
  20345. updateSign() {
  20346. let sameDay = xGame.common.judgeSameDay();
  20347. let max = 7;
  20348. this.curDayIndex = DataMgr.getSignData();
  20349. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  20350. this.curDayIndex = 0;
  20351. if (!sameDay) {
  20352. this.ui.normalBtn.visible = true;
  20353. this.ui.tipsNode.visible = false;
  20354. this.ui.againBtn.visible = false;
  20355. }
  20356. else {
  20357. this.ui.normalBtn.visible = false;
  20358. let again = DataMgr.getExtraSign();
  20359. let isCurrency = false;
  20360. let index = this.curDayIndex;
  20361. if (index == 0)
  20362. index = 7;
  20363. let award = cfgTable.signData[index].award;
  20364. let num = award[0].split("-")[0];
  20365. if (num == "1" || num == "2")
  20366. isCurrency = true;
  20367. let showAgain = again == 0 && isCurrency;
  20368. this.ui.againBtn.visible = showAgain;
  20369. this.ui.tipsNode.visible = !showAgain;
  20370. }
  20371. for (let index = 0; index < this.signArr.length; index++) {
  20372. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  20373. }
  20374. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  20375. }
  20376. playSecretaryIdle() {
  20377. let parent = this.ui.secretary.displayObject;
  20378. parent.destroyChildren();
  20379. let xx = this.ui.secretary.width / 2;
  20380. let yy = this.ui.secretary.height;
  20381. let scale = xGame.common.getSecretaryScale();
  20382. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20383. xGame.common.secretary.play(data, 0, true, parent);
  20384. }
  20385. closeSelf() {
  20386. this.hide();
  20387. }
  20388. normalGetAward() {
  20389. let sameDay = xGame.common.judgeSameDay();
  20390. if (!sameDay) {
  20391. let award = cfgTable.signData[this.curDayIndex + 1].award;
  20392. let temp;
  20393. let type;
  20394. let num;
  20395. let arr = [];
  20396. for (let index = 0; index < award.length; index++) {
  20397. temp = award[index].split("-");
  20398. type = parseInt(temp[0]);
  20399. num = parseInt(temp[1]);
  20400. let awardType = new AwardType();
  20401. awardType.num = num;
  20402. awardType.type = type;
  20403. arr.push(awardType);
  20404. }
  20405. xGame.common.getAward(arr, (watchVideo) => {
  20406. this.curDayIndex++;
  20407. if (this.curDayIndex > 7)
  20408. this.curDayIndex = 0;
  20409. DataMgr.setSignData(this.curDayIndex);
  20410. DataMgr.setSignTime(new Date().getTime());
  20411. if (watchVideo) {
  20412. DataMgr.setExtraSign(1);
  20413. Moyu.sendDataEvent("signIn1");
  20414. }
  20415. this.updateSign();
  20416. });
  20417. }
  20418. }
  20419. againGetAward() {
  20420. Moyu.sendDataEvent("signIn2");
  20421. console.log('zh:qjff_AD_for_uisign');
  20422. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  20423. }
  20424. else {
  20425. console.log('zh:AD 失败,直接发放奖励');
  20426. this.qjff_AD_for_uisign();
  20427. }
  20428. }
  20429. qjff_AD_for_uisign() {
  20430. let index = this.curDayIndex;
  20431. if (index == 0)
  20432. index = 7;
  20433. let award = cfgTable.signData[index].award;
  20434. let temp;
  20435. let type;
  20436. let num;
  20437. for (let index = 0; index < award.length; index++) {
  20438. temp = award[index].split("-");
  20439. type = parseInt(temp[0]);
  20440. num = parseInt(temp[1]) * 3;
  20441. xGame.common.playObjFlyAnim(num, type);
  20442. }
  20443. DataMgr.setExtraSign(1);
  20444. this.updateSign();
  20445. }
  20446. }
  20447. UISign$1.uiName = "UISign";
  20448. class UIModeSelection$1 extends UIBase {
  20449. constructor() {
  20450. super();
  20451. }
  20452. onConstructor() {
  20453. this.ui = ui_UIModeSelection.createInstance();
  20454. this.contentPane = this.ui;
  20455. this.isEject = false;
  20456. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  20457. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  20458. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  20459. this.addUIClick(this.ui.closeBtn, this.hide);
  20460. this.peopleArr = [650, 6900, 3800];
  20461. this.peopleOffest = [50, 500, 200];
  20462. this.updateSelf();
  20463. }
  20464. show(callback) {
  20465. super.show();
  20466. this.ui.t0.play();
  20467. this.callback = callback;
  20468. }
  20469. updateSelf() {
  20470. let cfg = cfgTable.modeselectData;
  20471. for (let index = 1; index <= 3; index++) {
  20472. let node = this.ui.myNode["type" + index];
  20473. node.need.text = cfg[index].need;
  20474. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  20475. node.peopleTxt.text = this.getRandPeople(index - 1);
  20476. }
  20477. }
  20478. enterGame(type) {
  20479. xGame.common.classicRoomType = type;
  20480. let cfg = cfgTable.modeselectData[type];
  20481. let need = cfg.need;
  20482. xGame.common.passAwardCoin = cfg.award;
  20483. if (DataMgr.coinEnough(need)) {
  20484. DataMgr.setCoin(-need);
  20485. this.ui.myNode["type" + type].t0.play();
  20486. Laya.timer.once(200, this, () => {
  20487. this.callback && this.callback();
  20488. });
  20489. }
  20490. else {
  20491. Moyu.sendDataEvent("AddCoinVideo");
  20492. xGame.uiMgr.Show(UIAddProp$1, 0);
  20493. }
  20494. }
  20495. getRandPeople(index) {
  20496. let rand = this.peopleOffest[index];
  20497. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  20498. }
  20499. }
  20500. UIModeSelection$1.uiName = "UIModeSelection";
  20501. class UITry$1 extends UIBase {
  20502. constructor() {
  20503. super();
  20504. this.closeTime = 0;
  20505. this.closeNum = 0;
  20506. this.skillUrl = xGame.common.skillIconList;
  20507. }
  20508. onConstructor() {
  20509. this.ui = ui_UITry.createInstance();
  20510. this.contentPane = this.ui;
  20511. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  20512. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  20513. }
  20514. show() {
  20515. super.show();
  20516. this.closeNum = 0;
  20517. this.closeTime = 15;
  20518. this.ui.t0.play();
  20519. PlatMgr.showRateBanner();
  20520. this.ui.myNode.txtTime.text = this.closeTime.toString();
  20521. Laya.timer.loop(1000, this, this.updateTime);
  20522. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  20523. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  20524. xGame.common.gameMgr.gamePause = true;
  20525. }
  20526. updateTime() {
  20527. if (this.closeTime > 1) {
  20528. this.closeTime--;
  20529. this.ui.myNode.txtTime.text = this.closeTime.toString();
  20530. }
  20531. else
  20532. this.hide();
  20533. }
  20534. hide() {
  20535. Laya.timer.clearAll(this);
  20536. Moyu.showBannerAd(false);
  20537. super.hide();
  20538. xGame.common.gameMgr.gamePause = false;
  20539. }
  20540. onTry() {
  20541. console.log('zh:qjff_AD_for_uitry');
  20542. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  20543. }
  20544. else {
  20545. console.log('zh:AD 失败,直接发放奖励');
  20546. this.qjff_AD_for_uitry();
  20547. }
  20548. }
  20549. qjff_AD_for_uitry() {
  20550. let select = xGame.common.curPlayerSkillType;
  20551. DataMgr.gameData.trySkill = select;
  20552. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  20553. DataMgr.saveGameData();
  20554. DataMgr.setBigSkill(select, 1);
  20555. xGame.showTip("Trial Successful");
  20556. this.hide();
  20557. }
  20558. onCancel() {
  20559. if (this.closeNum > 0) {
  20560. this.closeNum--;
  20561. if (this.closeNum < 2)
  20562. this.hide();
  20563. return;
  20564. }
  20565. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  20566. this.onTry();
  20567. }
  20568. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  20569. this.closeNum = 3;
  20570. }
  20571. else
  20572. this.hide();
  20573. }
  20574. }
  20575. UITry$1.uiName = "UITry";
  20576. class UIGetAward$1 extends UIBase {
  20577. constructor() {
  20578. super();
  20579. this.showTriple = true;
  20580. }
  20581. onConstructor() {
  20582. this.ui = ui_UIGetAward.createInstance();
  20583. this.contentPane = this.ui;
  20584. this.isEject = false;
  20585. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  20586. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  20587. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  20588. }
  20589. show(arr, showTriple, callback) {
  20590. super.show();
  20591. this.ui.t0.play();
  20592. this.ui.eftNode.visible = true;
  20593. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  20594. this.ui.eftNode.visible = false;
  20595. }), 1, 0, 0, 0.9);
  20596. this.awardArr = arr;
  20597. this.showTriple = showTriple;
  20598. this.callback = callback;
  20599. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  20600. this.ui.myList.numItems = arr.length;
  20601. xGame.soundMgr.playSound("getaward");
  20602. }
  20603. updateSelf(index, obj) {
  20604. let temp = this.awardArr[index];
  20605. let icon = this.getIcon(temp.type);
  20606. let str = icon;
  20607. if (temp.type > 2) {
  20608. str = "s" + icon;
  20609. }
  20610. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  20611. obj.myIcon.rotation = 0;
  20612. obj.numTxt.text = temp.num + "";
  20613. obj.numTxt.visible = temp.type > 2 ? false : true;
  20614. obj.nameTxt.text = this.getNameStr(temp.type);
  20615. }
  20616. renderItem(index, obj) {
  20617. this.updateSelf(index, obj);
  20618. }
  20619. tripleGetAward() {
  20620. console.log('zh:qjff_AD_for_uigetAward');
  20621. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  20622. }
  20623. else {
  20624. console.log('zh:AD 失败,直接发放奖励');
  20625. this.qjff_AD_for_uigetAward();
  20626. }
  20627. }
  20628. qjff_AD_for_uigetAward() {
  20629. this.getAward(3);
  20630. }
  20631. normalGetAward() {
  20632. if (PlatMgr.isMisVideo())
  20633. this.tripleGetAward();
  20634. else
  20635. this.getAward();
  20636. }
  20637. getAward(times = 1) {
  20638. this.hide();
  20639. for (let index = 0; index < this.awardArr.length; index++) {
  20640. this.awardArr[index].num *= times;
  20641. }
  20642. this.callback && this.callback(times != 1);
  20643. }
  20644. getIcon(type) {
  20645. switch (type) {
  20646. case Prop.diamond:
  20647. return "ty_zs";
  20648. case Prop.coin:
  20649. return "ty_jb";
  20650. case Prop.gan1:
  20651. return "qg1";
  20652. case Prop.gan2:
  20653. return "qg2";
  20654. case Prop.gan3:
  20655. return "qg3";
  20656. case Prop.gan4:
  20657. return "qg4";
  20658. default:
  20659. break;
  20660. }
  20661. }
  20662. getNameStr(type) {
  20663. switch (type) {
  20664. case Prop.diamond:
  20665. return "Diamond";
  20666. case Prop.coin:
  20667. return "Coins";
  20668. case Prop.gan1:
  20669. case Prop.gan2:
  20670. case Prop.gan3:
  20671. case Prop.gan4:
  20672. return cfgTable.ballrodData[type - 1].name;
  20673. default:
  20674. break;
  20675. }
  20676. }
  20677. }
  20678. UIGetAward$1.uiName = "UIGetAward";
  20679. class UIBox$1 extends UIBase {
  20680. constructor() {
  20681. super();
  20682. this.boxNum = 0;
  20683. this.boxMax = 10;
  20684. this.inAd = false;
  20685. this.isClose = false;
  20686. }
  20687. onConstructor() {
  20688. this.ui = ui_UIBox.createInstance();
  20689. this.contentPane = this.ui;
  20690. this.isEject = false;
  20691. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  20692. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  20693. Laya.timer.loop(1000, this, this.update);
  20694. }
  20695. update() {
  20696. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  20697. this.boxNum -= 1;
  20698. this.upBar();
  20699. }
  20700. }
  20701. upBar() {
  20702. if (this.boxNum > this.boxMax)
  20703. this.boxNum = this.boxMax;
  20704. this.ui.bar.value = this.boxNum * 10;
  20705. }
  20706. show() {
  20707. super.show();
  20708. this.isClose = false;
  20709. this.boxNum = 0;
  20710. this.inAd = false;
  20711. this.upBar();
  20712. this.ui.t0.play();
  20713. this.ui.closeBtn.visible = false;
  20714. Laya.timer.once(3000, this, () => {
  20715. this.ui.closeBtn.visible = true;
  20716. this.ui.bar.alpha = 1;
  20717. });
  20718. Laya.timer.once(500, this, () => {
  20719. this.ui.t1.play();
  20720. });
  20721. }
  20722. hide() {
  20723. Laya.timer.clearAll(this);
  20724. Moyu.showBannerAd(false);
  20725. super.hide();
  20726. }
  20727. onOpenBox() {
  20728. this.boxNum++;
  20729. if (this.boxNum < this.boxMax) {
  20730. if (PlatMgr.getRand() < PlatMgr.boxInsertRate)
  20731. Moyu.showInsertAd(0, PlatMgr.insertGap);
  20732. }
  20733. else if (this.boxNum == this.boxMax) {
  20734. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  20735. this.ui.openBtn.c1.selectedIndex = 13;
  20736. this.inAd = true;
  20737. }
  20738. else
  20739. this.getAward();
  20740. }
  20741. else if (this.inAd) {
  20742. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  20743. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  20744. }
  20745. else {
  20746. console.log('zh:AD 失败,直接发放奖励');
  20747. this.qjff_AD_for_UIBOX_onOpenBox();
  20748. }
  20749. }
  20750. this.upBar();
  20751. }
  20752. qjff_AD_for_UIBOX_onOpenBox() {
  20753. this.getAward();
  20754. }
  20755. onCloseBox() {
  20756. if (this.isClose)
  20757. this.hide();
  20758. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  20759. this.isClose = true;
  20760. PlatMgr.showBanner(true, 0, 3000);
  20761. }
  20762. else
  20763. this.hide();
  20764. }
  20765. getAward() {
  20766. let str = "";
  20767. if (Math.random() < 0.5) {
  20768. let max = Moyu.isLegal ? 500 : 2500;
  20769. let num = xGame.tools.random(max, 500 + max);
  20770. DataMgr.setCoin(num);
  20771. str = "金币x" + num;
  20772. }
  20773. else {
  20774. let max = Moyu.isLegal ? 10 : 30;
  20775. let num = xGame.tools.random(max, 30 + max);
  20776. DataMgr.setDiamond(num);
  20777. str = "钻石x" + num;
  20778. }
  20779. xGame.showTip("恭喜获得-" + str);
  20780. this.hide();
  20781. }
  20782. }
  20783. UIBox$1.uiName = "UIBox";
  20784. class UIMain$1 extends UIBase {
  20785. constructor() {
  20786. super();
  20787. this.firstEnter = true;
  20788. }
  20789. nativeCallJs(msg) {
  20790. let t = msg;
  20791. console.log("zh: nativeCallJs 奖励开始发放:", t);
  20792. switch (t) {
  20793. case 'qjff_chouJiang':
  20794. let dui = xGame.uiMgr.getUI(UIDraw$1);
  20795. dui.qjff_chouJiang();
  20796. break;
  20797. case 'qjff_AD_for_uisign':
  20798. let dui2 = xGame.uiMgr.getUI(UISign$1);
  20799. dui2.qjff_AD_for_uisign();
  20800. break;
  20801. case 'qjff_AD_for_uitry':
  20802. let dui3 = xGame.uiMgr.getUI(UITry$1);
  20803. dui3.qjff_AD_for_uitry();
  20804. break;
  20805. case 'qjff_AD_for_uipower':
  20806. let dui4 = xGame.uiMgr.getUI(UIPower$1);
  20807. dui4.qjff_AD_for_uipower();
  20808. break;
  20809. case 'qjff_AD_for_uigetAward':
  20810. let dui5 = xGame.uiMgr.getUI(UIGetAward$1);
  20811. dui5.qjff_AD_for_uigetAward();
  20812. break;
  20813. case 'qjff_AD_for_uiGameEnd':
  20814. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  20815. let dui6 = xGame.uiMgr.getUI(UIGameEnd$1);
  20816. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  20817. break;
  20818. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  20819. let dui7 = xGame.uiMgr.getUI(UIAddProp$1);
  20820. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  20821. break;
  20822. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  20823. let dui8 = xGame.uiMgr.getUI(UIAddProp$1);
  20824. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  20825. break;
  20826. case 'qjff_AD_for_UIrepentProp_videoRegret':
  20827. let dui9 = xGame.uiMgr.getUI(UIRepentProp$1);
  20828. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  20829. break;
  20830. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  20831. let dui10 = xGame.uiMgr.getUI(UIRepentProp$1);
  20832. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  20833. break;
  20834. case 'qjff_AD_for_UIBOX_onOpenBox':
  20835. let dui11 = xGame.uiMgr.getUI(UIBox$1);
  20836. dui11.qjff_AD_for_UIBOX_onOpenBox();
  20837. break;
  20838. case 'qjff_AD_for_UIAddCoin':
  20839. let dui12 = xGame.uiMgr.getUI(UIAddCoin$1);
  20840. dui12.qjff_AD_for_UIAddCoin();
  20841. break;
  20842. case '111a':
  20843. let dui14 = xGame.uiMgr.getUI(UISign$1);
  20844. dui14.qjff_AD_for_uisign();
  20845. break;
  20846. case '222a':
  20847. let dui15 = xGame.uiMgr.getUI(UISign$1);
  20848. dui15.qjff_AD_for_uisign();
  20849. break;
  20850. case '333a':
  20851. let dui16 = xGame.uiMgr.getUI(UISign$1);
  20852. dui16.qjff_AD_for_uisign();
  20853. break;
  20854. default:
  20855. console.log('zh:未知的方法名字' + t);
  20856. break;
  20857. }
  20858. }
  20859. onConstructor() {
  20860. console.log('zh: UIMain onConstructor');
  20861. this.ui = ui_UIMain.createInstance();
  20862. this.contentPane = this.ui;
  20863. this.isEject = false;
  20864. this.addEvent();
  20865. this.addClickSpine();
  20866. this.settingNode = new SettingNode$1(this.ui.settingNode);
  20867. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20868. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  20869. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  20870. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  20871. let curUse = DataMgr.getCurSecretary();
  20872. this.changeSecretary(curUse);
  20873. this.ui.talkNode.visible = false;
  20874. let guide = DataMgr.getSkillGuide();
  20875. if (xGame.common.isNewDay && guide == 1) {
  20876. xGame.common.isNewDay = false;
  20877. xGame.soundMgr.playSound("s_main01");
  20878. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20879. console.log("播放小秘书每天语音");
  20880. }
  20881. this.onGetUserInfo();
  20882. this.ui.n83.visible = false;
  20883. Moyu.setShareInfo("8Ball Fury", ["台球", "万宁", "桌球"], '2300002254');
  20884. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  20885. }
  20886. changeSecretary(curUse) {
  20887. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  20888. xGame.common.secretary && xGame.common.secretary.dispose();
  20889. this.addSecretarySpine(name);
  20890. }
  20891. addSecretarySpine(name) {
  20892. let spine = new SpineMgr(name, () => {
  20893. this.playSecretaryIdle();
  20894. });
  20895. xGame.common.secretary = spine;
  20896. }
  20897. addClickSpine() {
  20898. let clickSpine = new SpineMgr("dianji", () => {
  20899. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  20900. let parent = Laya.stage;
  20901. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  20902. clickSpine.play(data, 0, false, parent, (spine) => {
  20903. spine.destroy(true);
  20904. });
  20905. });
  20906. });
  20907. }
  20908. addEvent() {
  20909. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  20910. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  20911. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  20912. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  20913. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  20914. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  20915. this.addUIClick(this.ui, this.interuptSecretary);
  20916. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  20917. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  20918. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  20919. this.addUIClick(this.ui.shopBtn, this.openShopView);
  20920. this.addUIClick(this.ui.signBtn, this.openSignView);
  20921. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  20922. }
  20923. show(showFailWords) {
  20924. super.show();
  20925. this.moneyNode.ui.c1.selectedIndex = 1;
  20926. this.playSecretaryIdle();
  20927. xGame.soundMgr.playMusic("caromhall01");
  20928. Laya.timer.clearAll(this);
  20929. this.playSecretaryRandomSound();
  20930. if (showFailWords) {
  20931. setTimeout(() => {
  20932. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  20933. let words = -1;
  20934. if (str == "s_main02") {
  20935. words = 2;
  20936. }
  20937. else {
  20938. words = 3;
  20939. }
  20940. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20941. xGame.soundMgr.playSound(str);
  20942. }, 300);
  20943. }
  20944. this.showGuide();
  20945. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  20946. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  20947. let guide = DataMgr.getSkillGuide();
  20948. if (guide == 1) {
  20949. let randTime = xGame.common.randomNum(300, 800);
  20950. if (this.firstEnter) {
  20951. this.firstEnter = false;
  20952. randTime += 900;
  20953. }
  20954. Laya.timer.once(randTime, this, () => {
  20955. xGame.common.autoPopUIView();
  20956. });
  20957. }
  20958. }
  20959. checkActive(show) {
  20960. }
  20961. showGuide() {
  20962. let guide = DataMgr.getSkillGuide();
  20963. this.ui.guideBtn.visible = guide == 0;
  20964. this.ui.enterGuide.visible = false;
  20965. this.ui.secretaryGuide.visible = guide == 0;
  20966. if (guide == 0) {
  20967. xGame.soundMgr.playSound("s_guide");
  20968. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20969. }
  20970. }
  20971. ensureSecretary() {
  20972. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  20973. this.ui.secretaryGuide.visible = false;
  20974. this.ui.enterGuide.visible = true;
  20975. this.ui.wordsNode.t0.play();
  20976. if (DataMgr.getNewUser())
  20977. Moyu.sendDataEvent("gameReady");
  20978. }
  20979. playSecretaryIdle() {
  20980. let parent = this.ui.secretary.displayObject;
  20981. parent.destroyChildren();
  20982. let xx = this.ui.secretary.width / 2;
  20983. let yy = this.ui.secretary.height;
  20984. let scale = xGame.common.getSecretaryScale();
  20985. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20986. console.log("zh:playSecretaryIdle", data);
  20987. xGame.common.secretary.play(data, 0, true, parent);
  20988. }
  20989. startGame(type) {
  20990. xGame.common.gameMode = type;
  20991. Moyu.sendDataEvent("PlayGame", { type: type });
  20992. switch (xGame.common.gameMode) {
  20993. case GameMode.classic:
  20994. let challengeTimes = DataMgr.getChallengeTimes();
  20995. if (challengeTimes == 0) {
  20996. xGame.uiMgr.Show(UIInvitation$1);
  20997. }
  20998. else {
  20999. this.beginGame();
  21000. }
  21001. break;
  21002. case GameMode.bigMove:
  21003. this.beginGame();
  21004. if (DataMgr.getNewUser())
  21005. Moyu.sendDataEvent("gameStart0");
  21006. break;
  21007. default:
  21008. break;
  21009. }
  21010. }
  21011. beginGame(isNice = false) {
  21012. if (xGame.common.gameMode == GameMode.classic) {
  21013. if (isNice) {
  21014. this.enterClassic();
  21015. }
  21016. else {
  21017. xGame.uiMgr.Show(UIModeSelection$1, () => {
  21018. this.enterClassic();
  21019. });
  21020. }
  21021. }
  21022. else if (xGame.common.gameMode == GameMode.bigMove) {
  21023. this.ui.enterGuide.visible = false;
  21024. xGame.uiMgr.Show(UISkill$1);
  21025. }
  21026. }
  21027. enterClassic() {
  21028. xGame.uiMgr.Show(UIGame$1);
  21029. xGame.uiMgr.Show(UIMatching$1, () => {
  21030. if (!this.isHide)
  21031. this.hide();
  21032. xGame.common.gameUI.ui.alpha = 1;
  21033. xGame.common.gameUI.startGame();
  21034. xGame.uiMgr.Hide(UIGameEnd$1);
  21035. });
  21036. }
  21037. startGlobal() {
  21038. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  21039. }
  21040. startWeekly() {
  21041. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  21042. }
  21043. zhouSaiMonth() {
  21044. console.log('zh: zhouSaiMonth 被调用');
  21045. }
  21046. startPlaceBall() {
  21047. xGame.uiMgr.Show(UILevelDisplay$1);
  21048. }
  21049. hide() {
  21050. super.hide();
  21051. xGame.common.stopGirlPop(this.ui.talkNode);
  21052. }
  21053. onGetUserInfo(force = false) {
  21054. if (Moyu.isWx) {
  21055. let info = Moyu.getSystemInfo();
  21056. if (info)
  21057. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  21058. }
  21059. else {
  21060. Moyu.initUser(this, this.freshUser, force);
  21061. }
  21062. if (!Moyu.hasUserInfo) {
  21063. let user = Moyu.getUserInfo();
  21064. user.headIcon = 'res/ty_touxiang.png';
  21065. }
  21066. this.freshUser();
  21067. }
  21068. freshUser() {
  21069. let user = Moyu.getUserInfo();
  21070. if (!user.isAuth) {
  21071. user.headIcon = 'res/ty_touxiang.png';
  21072. }
  21073. else
  21074. DataMgr.upRankData();
  21075. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  21076. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  21077. }
  21078. interuptSecretary() {
  21079. Laya.timer.clearAll(this);
  21080. this.playSecretaryRandomSound();
  21081. }
  21082. playSecretaryRandomSound() {
  21083. if (this.isHide)
  21084. return;
  21085. let time = xGame.common.randomNum(45000, 60000);
  21086. Laya.timer.once(time, this, () => {
  21087. if (this.isHide)
  21088. return;
  21089. let index = xGame.common.randomNum(4, 7);
  21090. xGame.soundMgr.playSound("s_main0" + index);
  21091. let words = 1;
  21092. switch (index) {
  21093. case 4:
  21094. words = 5;
  21095. break;
  21096. case 5:
  21097. words = 3;
  21098. break;
  21099. case 6:
  21100. words = 6;
  21101. break;
  21102. case 7:
  21103. words = 7;
  21104. break;
  21105. default:
  21106. break;
  21107. }
  21108. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21109. this.playSecretaryRandomSound();
  21110. });
  21111. }
  21112. openSecretaryView() {
  21113. xGame.uiMgr.Show(UISecretary$1);
  21114. Moyu.sendDataEvent("secretary");
  21115. }
  21116. openShopView() {
  21117. xGame.uiMgr.Show(UIShop$1);
  21118. }
  21119. openSignView() {
  21120. xGame.uiMgr.Show(UISign$1);
  21121. }
  21122. openDrawView() {
  21123. xGame.uiMgr.Show(UIDraw$1);
  21124. }
  21125. openRanking() {
  21126. xGame.uiMgr.Show(UIRanking$1);
  21127. Moyu.sendDataEvent("rankingList");
  21128. }
  21129. }
  21130. UIMain$1.uiName = "UIMain";
  21131. function InitShader() {
  21132. }
  21133. function appInit() {
  21134. xGame.context.init(getLoadingResList(), initCallback);
  21135. }
  21136. function getLoadingResList() {
  21137. return [
  21138. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  21139. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  21140. ];
  21141. }
  21142. function getGameResList() {
  21143. return [
  21144. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  21145. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  21146. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  21147. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  21148. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  21149. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  21150. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  21151. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  21152. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  21153. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  21154. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  21155. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  21156. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  21157. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  21158. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  21159. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  21160. { url: "res/json/npc.json", type: Laya.Loader.JSON },
  21161. { url: "res/json/classicCfg.json", type: Laya.Loader.JSON },
  21162. { url: "res/json/levelCfg.json", type: Laya.Loader.JSON },
  21163. { url: "res/json/placeBallCfg.json", type: Laya.Loader.JSON },
  21164. { url: "res/font/arial.ttf", type: Laya.Loader.FONT },
  21165. ];
  21166. }
  21167. function initCallback() {
  21168. window["DataMgr"] = DataMgr;
  21169. DataMgr.Init();
  21170. Moyu.init(getPlat(), this, () => {
  21171. DataMgr.isNewDay();
  21172. PlatMgr.initConfig();
  21173. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  21174. }, true);
  21175. console.log('zh:开始sm init1 start');
  21176. xGame.soundMgr.init();
  21177. console.log('zh:开始sm init1 end');
  21178. xGame.uiMgr.init();
  21179. xGame.uiMgr.clearTempData();
  21180. xGame.uiMgr.bindFUI(fguiRes.loading);
  21181. xGame.uiMgr.Show(UILoading);
  21182. }
  21183. function loadSubRes(callback) {
  21184. var tab = ["asset", "res", "spine"];
  21185. let subDone = 0;
  21186. for (var i = 0; i < tab.length; i++) {
  21187. let sub = tab[i];
  21188. Moyu.loadSubRes(sub, (pro) => {
  21189. callback && callback(pro, false);
  21190. }).then(() => {
  21191. subDone++;
  21192. if (subDone >= tab.length)
  21193. callback && callback(1, true);
  21194. });
  21195. }
  21196. }
  21197. function enterGame() {
  21198. xGame.cfgMgr.init();
  21199. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  21200. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  21201. xGame.uiMgr.Hide(UILoading);
  21202. fgui.UIPackage.removePackage(fguiRes.loading);
  21203. xGame.uiMgr.bindFUI(fguiRes.game);
  21204. xGame.uiMgr.Show(UIMain$1);
  21205. if (DataMgr.getNewUser())
  21206. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  21207. }
  21208. function getPlat() {
  21209. let cfg = new MoyuCfg();
  21210. cfg.plat = MoyuPlat.web;
  21211. cfg.myId = 120;
  21212. cfg.myKey = '8848a885774230a4';
  21213. cfg.version = 0;
  21214. if (window.hasOwnProperty("gamebox")) {
  21215. cfg.plat = MoyuPlat.f399;
  21216. cfg.version = 0;
  21217. }
  21218. else if (window.hasOwnProperty("ks")) {
  21219. cfg.plat = MoyuPlat.ks;
  21220. cfg.version = 0;
  21221. cfg.ads.ksVideoId = '2300002254_01';
  21222. cfg.ads.ksInsertId = '2300002254_02';
  21223. }
  21224. else if (Laya.Browser.onTTMiniGame) {
  21225. cfg.plat = MoyuPlat.tt;
  21226. cfg.version = 0;
  21227. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  21228. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  21229. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  21230. }
  21231. else if (Laya.Browser.onMiniGame) {
  21232. cfg.plat = MoyuPlat.wx;
  21233. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  21234. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  21235. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  21236. }
  21237. else if (Laya.Browser.onQQMiniGame) {
  21238. cfg.plat = MoyuPlat.qq;
  21239. }
  21240. else if (Laya.Browser.onQGMiniGame) {
  21241. cfg.plat = MoyuPlat.op;
  21242. cfg.ads.opVideoId = '455502';
  21243. cfg.ads.opBannerId = '455507';
  21244. }
  21245. else if (Laya.Browser.onVVMiniGame) {
  21246. cfg.plat = MoyuPlat.vv;
  21247. cfg.version = 0;
  21248. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  21249. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  21250. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  21251. }
  21252. else if (Laya.Browser.onHWMiniGame) {
  21253. cfg.plat = MoyuPlat.hw;
  21254. }
  21255. else if (window["mz"]) {
  21256. cfg.plat = MoyuPlat.mz;
  21257. }
  21258. else {
  21259. let cfg = window['conchConfig'];
  21260. if (cfg) {
  21261. var os = cfg.getOS();
  21262. if (os == "Conch-ios") {
  21263. cfg.plat = MoyuPlat.ios;
  21264. }
  21265. else if (os == "Conch-android") {
  21266. }
  21267. }
  21268. }
  21269. return cfg;
  21270. }
  21271. class Main {
  21272. constructor() {
  21273. if (window["Laya3D"])
  21274. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  21275. else {
  21276. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  21277. this.initMain();
  21278. }
  21279. }
  21280. initMain() {
  21281. Laya["Physics"] && Laya["Physics"].enable();
  21282. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  21283. Laya.stage.scaleMode = GameConfig.scaleMode;
  21284. Laya.stage.screenMode = GameConfig.screenMode;
  21285. Laya.stage.alignV = GameConfig.alignV;
  21286. Laya.stage.alignH = GameConfig.alignH;
  21287. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  21288. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  21289. Laya.enableDebugPanel();
  21290. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  21291. Laya["PhysicsDebugDraw"].enable();
  21292. if (GameConfig.stat)
  21293. Laya.Stat.show();
  21294. Laya.alertGlobalError(true);
  21295. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  21296. }
  21297. onVersionLoaded() {
  21298. appInit();
  21299. }
  21300. }
  21301. new Main();
  21302. }());
  21303. //# sourceMappingURL=bundle.js.map