1
0

bundle.js 796 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894
  1. (function () {
  2. 'use strict';
  3. class GameConfig {
  4. constructor() {
  5. }
  6. static init() {
  7. var reg = Laya.ClassUtils.regClass;
  8. }
  9. }
  10. GameConfig.width = 1334;
  11. GameConfig.height = 750;
  12. GameConfig.scaleMode = "fixedheight";
  13. GameConfig.screenMode = "horizontal";
  14. GameConfig.alignV = "top";
  15. GameConfig.alignH = "left";
  16. GameConfig.startScene = "";
  17. GameConfig.sceneRoot = "";
  18. GameConfig.debug = false;
  19. GameConfig.stat = false;
  20. GameConfig.physicsDebug = false;
  21. GameConfig.exportSceneToJson = true;
  22. GameConfig.init();
  23. let fguiRes = {
  24. game: "asset/fgui/game",
  25. loading: "fgui/loading"
  26. };
  27. let ballCamp = {
  28. full: "full",
  29. flower: "flower"
  30. };
  31. let FoulType = {
  32. "timeOut": "1",
  33. "notTouch": "2",
  34. "wrongTouch": "3",
  35. "wrongHole": "4",
  36. "rootHole": "5",
  37. };
  38. let ALL_BALL_STOP = "ALL_BALL_STOP";
  39. let WAIT_SHOOT = "WAIT_SHOOT";
  40. let D3RES_LOADED = "D3RES_LOADED";
  41. let BALL_SHOOT = "BALL_SHOOT";
  42. let FIRST_BALL_HOLE = "FIRST_BALL_HOLE";
  43. let RESET_GAME = "RESET_GAME";
  44. let COIN_CHANGE = "COIN_CHANGE";
  45. let DIAMOND_CHANGE = "DIAMOND_CHANGE";
  46. let RESTART_GAME = "RESTART_GAME";
  47. let GET_USER_INFO = "GET_USER_INFO";
  48. let CHANGE_SECRETARY = "CHANGE_SECRETARY";
  49. let POWER_CHANGE = "POWER_CHANGE";
  50. let POWER_TIME = "POWER_TIME";
  51. let baseHeadUrl = "https://mygame1.tangro.cn/headimg/";
  52. let poolKey = {
  53. inHoleEft: "inHoleEft",
  54. d3ball: "d3ball",
  55. iceEft: "iceEft",
  56. hitEft: "hitEft",
  57. fireworksEft: "fireworksEft",
  58. };
  59. var GameMode;
  60. (function (GameMode) {
  61. GameMode[GameMode["classic"] = 0] = "classic";
  62. GameMode[GameMode["bigMove"] = 1] = "bigMove";
  63. GameMode[GameMode["placeBall"] = 2] = "placeBall";
  64. })(GameMode || (GameMode = {}));
  65. var SkillType;
  66. (function (SkillType) {
  67. SkillType[SkillType["highSpace"] = 0] = "highSpace";
  68. SkillType[SkillType["breakArmy"] = 1] = "breakArmy";
  69. SkillType[SkillType["ice"] = 2] = "ice";
  70. SkillType[SkillType["fireworks"] = 3] = "fireworks";
  71. SkillType[SkillType["GuanYu"] = 4] = "GuanYu";
  72. })(SkillType || (SkillType = {}));
  73. var ClassicWordsType;
  74. (function (ClassicWordsType) {
  75. ClassicWordsType[ClassicWordsType["directShoot"] = 0] = "directShoot";
  76. ClassicWordsType[ClassicWordsType["bigPower"] = 1] = "bigPower";
  77. ClassicWordsType[ClassicWordsType["anotherShoot"] = 2] = "anotherShoot";
  78. ClassicWordsType[ClassicWordsType["perfectShow"] = 3] = "perfectShow";
  79. ClassicWordsType[ClassicWordsType["hardShoot"] = 4] = "hardShoot";
  80. })(ClassicWordsType || (ClassicWordsType = {}));
  81. var PressType;
  82. (function (PressType) {
  83. PressType[PressType["powerNode"] = 0] = "powerNode";
  84. PressType[PressType["d2Root"] = 1] = "d2Root";
  85. PressType[PressType["moveNode"] = 2] = "moveNode";
  86. PressType[PressType["rulerNode"] = 3] = "rulerNode";
  87. })(PressType || (PressType = {}));
  88. var PlaceBallType;
  89. (function (PlaceBallType) {
  90. PlaceBallType[PlaceBallType["normal"] = 0] = "normal";
  91. PlaceBallType[PlaceBallType["challenge"] = 1] = "challenge";
  92. })(PlaceBallType || (PlaceBallType = {}));
  93. var EAdType;
  94. (function (EAdType) {
  95. EAdType[EAdType["upSkill"] = 0] = "upSkill";
  96. EAdType[EAdType["addDiamond"] = 1] = "addDiamond";
  97. EAdType[EAdType["placeBallNextLevel"] = 2] = "placeBallNextLevel";
  98. EAdType[EAdType["regretBall"] = 3] = "regretBall";
  99. EAdType[EAdType["longHelpLine"] = 4] = "longHelpLine";
  100. EAdType[EAdType["addFailCoin"] = 5] = "addFailCoin";
  101. EAdType[EAdType["sign"] = 6] = "sign";
  102. EAdType[EAdType["draw"] = 7] = "draw";
  103. EAdType[EAdType["triple"] = 8] = "triple";
  104. EAdType[EAdType["randomDiamond"] = 9] = "randomDiamond";
  105. EAdType[EAdType["getPower"] = 10] = "getPower";
  106. EAdType[EAdType["box"] = 11] = "box";
  107. EAdType[EAdType["try"] = 12] = "try";
  108. EAdType[EAdType["againSign"] = 13] = "againSign";
  109. EAdType[EAdType["addCoin"] = 14] = "addCoin";
  110. })(EAdType || (EAdType = {}));
  111. var Prop;
  112. (function (Prop) {
  113. Prop[Prop["diamond"] = 1] = "diamond";
  114. Prop[Prop["coin"] = 2] = "coin";
  115. Prop[Prop["gan1"] = 3] = "gan1";
  116. Prop[Prop["gan2"] = 4] = "gan2";
  117. Prop[Prop["gan3"] = 5] = "gan3";
  118. Prop[Prop["gan4"] = 6] = "gan4";
  119. })(Prop || (Prop = {}));
  120. var TipsType;
  121. (function (TipsType) {
  122. TipsType[TipsType["exitGame"] = 0] = "exitGame";
  123. TipsType[TipsType["foul"] = 1] = "foul";
  124. })(TipsType || (TipsType = {}));
  125. class AwardType {
  126. constructor(type, num) {
  127. this.type = type;
  128. this.num = num;
  129. }
  130. }
  131. var define = /*#__PURE__*/Object.freeze({
  132. fguiRes: fguiRes,
  133. ballCamp: ballCamp,
  134. FoulType: FoulType,
  135. ALL_BALL_STOP: ALL_BALL_STOP,
  136. WAIT_SHOOT: WAIT_SHOOT,
  137. D3RES_LOADED: D3RES_LOADED,
  138. BALL_SHOOT: BALL_SHOOT,
  139. FIRST_BALL_HOLE: FIRST_BALL_HOLE,
  140. RESET_GAME: RESET_GAME,
  141. COIN_CHANGE: COIN_CHANGE,
  142. DIAMOND_CHANGE: DIAMOND_CHANGE,
  143. RESTART_GAME: RESTART_GAME,
  144. GET_USER_INFO: GET_USER_INFO,
  145. CHANGE_SECRETARY: CHANGE_SECRETARY,
  146. POWER_CHANGE: POWER_CHANGE,
  147. POWER_TIME: POWER_TIME,
  148. baseHeadUrl: baseHeadUrl,
  149. poolKey: poolKey,
  150. get GameMode () { return GameMode; },
  151. get SkillType () { return SkillType; },
  152. get ClassicWordsType () { return ClassicWordsType; },
  153. get PressType () { return PressType; },
  154. get PlaceBallType () { return PlaceBallType; },
  155. get EAdType () { return EAdType; },
  156. get Prop () { return Prop; },
  157. get TipsType () { return TipsType; },
  158. AwardType: AwardType
  159. });
  160. class CContext {
  161. constructor() {
  162. this.winSize = { width: 0, height: 0 };
  163. this.notchHeight = 0;
  164. this.bannerHeight = 0;
  165. }
  166. init(resList, callback) {
  167. this.winSize = { width: Laya.Browser.clientWidth, height: Laya.Browser.clientHeight };
  168. this.notchHeight = this.getNotchHeight();
  169. this.bannerHeight = this.getBannerHeight();
  170. Laya.loader.load(resList, Laya.Handler.create(this, () => {
  171. callback && callback();
  172. }));
  173. }
  174. getNotchHeight() {
  175. let notchHeight = 50;
  176. if (Laya.Browser.onMiniGame) {
  177. let deviceInfo = wx.getSystemInfoSync();
  178. if (Laya.Browser.onIOS) {
  179. if (deviceInfo.model.search('iPhone X') != -1) {
  180. notchHeight = deviceInfo.statusBarHeight - 10;
  181. }
  182. else {
  183. if ((deviceInfo.screenWidth == 375 && deviceInfo.screenHeight == 812) ||
  184. (deviceInfo.screenWidth == 414 && deviceInfo.screenHeight == 896)) {
  185. notchHeight = deviceInfo.statusBarHeight - 10;
  186. }
  187. }
  188. }
  189. else if (Laya.Browser.onAndroid) {
  190. if (deviceInfo.screenWidth / deviceInfo.screenHeight < (9 / 16)) {
  191. notchHeight = deviceInfo.statusBarHeight;
  192. }
  193. }
  194. }
  195. return notchHeight;
  196. }
  197. getBannerHeight() {
  198. return 0;
  199. }
  200. }
  201. let context = new CContext();
  202. var Handler = Laya.Handler;
  203. var Tween = Laya.Tween;
  204. function playClickEffect(btn) {
  205. if (!btn)
  206. return;
  207. Laya.Tween.to(btn, { scaleX: 1.05, scaleY: 1.05 }, 20, null, Laya.Handler.create(null, () => {
  208. if (!btn)
  209. return;
  210. Laya.Tween.to(btn, { scaleX: 0.96, scaleY: 0.96 }, 30, null, Laya.Handler.create(null, () => {
  211. if (!btn)
  212. return;
  213. Laya.Tween.to(btn, { scaleX: 1, scaleY: 1 }, 20, null, null, 0, true);
  214. }), 0, true);
  215. }), 0, true);
  216. }
  217. function getNumList(strList) {
  218. let dataList = [];
  219. if (strList) {
  220. let list = strList;
  221. let array = list.split(',');
  222. for (var v in array) {
  223. dataList.push(Number(array[v]));
  224. }
  225. }
  226. return dataList;
  227. }
  228. function getStrList(strList) {
  229. let dataList = [];
  230. if (strList) {
  231. let list = strList;
  232. let array = list.split('|');
  233. for (var v in array) {
  234. dataList.push(String(array[v]));
  235. }
  236. }
  237. return dataList;
  238. }
  239. function getRandStr(len) {
  240. let list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'];
  241. let str = "";
  242. for (let i = 0; i < len; i++) {
  243. let rand = random(0, list.length);
  244. str += list[rand];
  245. }
  246. return str;
  247. }
  248. function getUserId() {
  249. let str = getRandStr(12) + Laya.timer.currTimer % 1000000;
  250. return str;
  251. }
  252. function formatPos(pos, len = 2) {
  253. let v = Math.pow(10, len);
  254. pos.x = Math.floor(pos.x * v) / v;
  255. pos.y = Math.floor(pos.y * v) / v;
  256. if (pos.z)
  257. pos.z = Math.floor(pos.z * v) / v;
  258. return pos;
  259. }
  260. function setPosInt(pos) {
  261. pos.x = pos.x > 0 ? Math.ceil(pos.x) : Math.floor(pos.x);
  262. pos.y = pos.y > 0 ? Math.ceil(pos.y) : Math.floor(pos.y);
  263. pos.z = pos.z > 0 ? Math.ceil(pos.z) : Math.floor(pos.z);
  264. return pos;
  265. }
  266. function random(min, max) {
  267. var rang = max - min;
  268. var rand = Math.random() * rang;
  269. return Math.floor(rand) + min;
  270. }
  271. function randomList(list, num) {
  272. if (list.length <= num)
  273. return list;
  274. let arry = [];
  275. list.forEach(item => {
  276. arry.push(item);
  277. });
  278. let nums = [];
  279. for (let i = 0; i < num; i++) {
  280. let rand = random(0, arry.length);
  281. let v = arry[rand];
  282. nums.push(v);
  283. arry.splice(rand, 1);
  284. }
  285. return nums;
  286. }
  287. function worldToScreen(camera, point, pos) {
  288. camera.viewport.project(point, camera.projectionViewMatrix, pos);
  289. pos.x = pos.x / Laya.stage.clientScaleX;
  290. pos.y = pos.y / Laya.stage.clientScaleY;
  291. }
  292. function getStringLenght(str) {
  293. return str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  294. }
  295. function reviseString(str, len) {
  296. let ld = str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  297. if (ld > len) {
  298. let sl = Math.floor(len / 2);
  299. let rs = str.substring(0, sl);
  300. let d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  301. while (d + 2 < len) {
  302. sl++;
  303. rs = str.substring(0, sl);
  304. d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  305. }
  306. return rs + "...";
  307. }
  308. return str;
  309. }
  310. function getCoinString(coin) {
  311. if (coin < 10000)
  312. return coin.toString();
  313. else if (coin < 1000000) {
  314. let vh = Math.ceil(coin / 100);
  315. return (vh / 10) + "k";
  316. }
  317. else if (coin < 1000000000) {
  318. var vh = Math.ceil(coin / 100000);
  319. return (vh / 10) + "m";
  320. }
  321. else if (coin < 1000000000000) {
  322. var vh = Math.ceil(coin / 100000000);
  323. return (vh / 10) + "b";
  324. }
  325. else if (coin < 1000000000000000) {
  326. var vh = Math.ceil(coin / 100000000000);
  327. return (vh / 10) + "t";
  328. }
  329. }
  330. function getV3Dest(pos, dir, dis, dest) {
  331. dir.x *= dis;
  332. dir.y *= dis;
  333. dir.z *= dis;
  334. Laya.Vector3.add(pos, dir, dest);
  335. return dest;
  336. }
  337. function getV2Dest(x1, y1, dir, dis, dest) {
  338. dest.x = x1 + dir.x * dis;
  339. dest.y = y1 + dir.y * dis;
  340. return dest;
  341. }
  342. function getV2Dir(x1, y1, x2, y2, dir) {
  343. dir.x = x2 - x1;
  344. dir.y = y2 - y1;
  345. Laya.Vector2.normalize(dir, dir);
  346. return dir;
  347. }
  348. function getV3Dir(p1, p2, dir) {
  349. Laya.Vector3.subtract(p1, p2, dir);
  350. Laya.Vector3.normalize(dir, dir);
  351. return dir;
  352. }
  353. function copyPos(ip, op) {
  354. op.x = ip.x;
  355. op.y = ip.y;
  356. if (ip.z)
  357. op.z = ip.z;
  358. return op;
  359. }
  360. function getScreenImg() {
  361. let gl = Laya.WebGLContext.mainContext;
  362. let pixels = new Uint8Array(gl.drawingBufferWidth * gl.drawingBufferHeight * 4);
  363. gl.readPixels(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
  364. let w = gl.drawingBufferWidth;
  365. let h = gl.drawingBufferHeight;
  366. let texture2d = new Laya.Texture2D(w, h, Laya.TextureFormat.R8G8B8A8, false, false);
  367. texture2d.setPixels(pixels);
  368. return new Laya.Texture(texture2d);
  369. }
  370. function playMoveByPositions(sp, positions, v, completeCallback) {
  371. let p;
  372. let play = () => {
  373. if (positions.length == 0) {
  374. completeCallback();
  375. return;
  376. }
  377. p = positions[0];
  378. positions.splice(0, 1);
  379. Laya.Tween.to(sp, { x: p.x, y: p.y }, getDistance(sp.x, sp.y, p.x, p.y) / v * 1000, null, Handler.create(this, () => {
  380. play();
  381. }));
  382. };
  383. play();
  384. }
  385. function setStarPos(node, num, max) {
  386. for (let i = 1; i <= 5; i++) {
  387. let img = node.getChildAt(i - 1);
  388. img.width = img.height = 30;
  389. img.pivotX = img.pivotY = 0.5;
  390. img.gray = i > num;
  391. img.visible = i <= max;
  392. if (max == 3) {
  393. img.x = node.width / 2 + (i - 2) * 30 - 15;
  394. img.y = node.height - 40;
  395. if (i == 2)
  396. img.y = node.height - 30;
  397. }
  398. else if (max == 5) {
  399. let ly = Math.abs(i - 3);
  400. img.x = node.width / 2 + (i - 3) * 20 - 15;
  401. img.y = node.height - ly * 8 - 30;
  402. }
  403. }
  404. }
  405. function playLoopAnimRotate(sp, time, clockwise = true) {
  406. let rotation;
  407. sp.rotation = sp.rotation % 360;
  408. if (clockwise) {
  409. rotation = -360;
  410. }
  411. else {
  412. rotation = 360;
  413. }
  414. Tween.to(sp, { rotation: rotation }, time, null, Handler.create(this, () => {
  415. this.playLoopAnimRotate(sp, time, clockwise);
  416. }));
  417. }
  418. function playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, isBig = true) {
  419. let x, y;
  420. if (isBig) {
  421. x = valueXMin;
  422. y = valueYMin;
  423. }
  424. else {
  425. x = valueXMax;
  426. y = valueYMax;
  427. }
  428. Tween.to(sp, { x: x, y: y }, time, null, Handler.create(this, () => {
  429. this.playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, !isBig);
  430. }));
  431. }
  432. function playLoopAnimScale(sp, valueMin, valueMax, time, isBig = true) {
  433. let scale;
  434. if (isBig) {
  435. scale = valueMin;
  436. }
  437. else {
  438. scale = valueMax;
  439. }
  440. Tween.to(sp, { scaleX: scale, scaleY: scale }, time, null, Handler.create(this, () => {
  441. playLoopAnimScale(sp, valueMin, valueMax, time, !isBig);
  442. }));
  443. }
  444. function playLoopAnimRotation(sp, valueMin, valueMax, time, isBig = true, count = 8) {
  445. let value;
  446. if (isBig) {
  447. value = valueMin;
  448. }
  449. else {
  450. value = valueMax;
  451. }
  452. if (count) {
  453. count--;
  454. Tween.to(sp, { rotation: value }, time, null, Handler.create(this, () => {
  455. playLoopAnimRotation(sp, valueMin, valueMax, time, !isBig, count);
  456. }));
  457. }
  458. else {
  459. sp.rotation = 0;
  460. }
  461. }
  462. function inRect(rect, p) {
  463. if (p.x >= rect.x && p.x <= rect.x + rect.w) {
  464. if (p.y >= rect.y && p.y <= rect.y + rect.h) {
  465. return true;
  466. }
  467. }
  468. return false;
  469. }
  470. function getNumberK(number) {
  471. if (number < 1000) {
  472. return number.toString();
  473. }
  474. else {
  475. return (number / 1000).toFixed(1) + "k";
  476. }
  477. }
  478. function pointInsideCircle(point, circle, r) {
  479. if (r === 0)
  480. return false;
  481. var dx = circle.x - point.x;
  482. var dy = circle.y - point.y;
  483. return dx * dx + dy * dy <= r * r;
  484. }
  485. function formatString(str, data) {
  486. if (!str || data == undefined) {
  487. return str;
  488. }
  489. if (typeof data === "object") {
  490. for (var key in data) {
  491. if (data.hasOwnProperty(key)) {
  492. str = str.replace(new RegExp("\{" + key + "\}", "g"), data[key]);
  493. }
  494. }
  495. }
  496. else {
  497. var args = arguments, reg = new RegExp("\{([0-" + (args.length - 1) + "])\}", "g");
  498. return str.replace(reg, function (match, index) {
  499. return args[index - (-1)];
  500. });
  501. }
  502. return str;
  503. }
  504. function getIntersection(a, b) {
  505. let t = [];
  506. for (var i = 0; i < a.length; i++) {
  507. for (var j = 0; j < b.length; j++) {
  508. if (a[i] == b[j]) {
  509. t.push(a[i]);
  510. }
  511. }
  512. }
  513. return t;
  514. }
  515. function getComplement(a, b) {
  516. let t = [];
  517. let count = false;
  518. for (var i = 0; i < a.length; i++) {
  519. count = false;
  520. for (var j = 0; j < b.length; j++) {
  521. if (a[i] == b[j]) {
  522. count = true;
  523. break;
  524. }
  525. }
  526. if (!count) {
  527. t.push(a[i]);
  528. }
  529. }
  530. return t;
  531. }
  532. function geSpriteStageRect(sp) {
  533. var point = sp.localToGlobal(Laya.Point.TEMP.setTo(0, 0));
  534. let rect = {
  535. x: point.x,
  536. y: point.y,
  537. width: sp.width * sp.globalScaleX,
  538. height: sp.height * sp.globalScaleY
  539. };
  540. return rect;
  541. }
  542. function touchButton(button) {
  543. let event = new Laya.Event();
  544. button.event(Laya.Event.CLICK, event.setTo(Laya.Event.CLICK, button, button));
  545. }
  546. function setColor(sprite, r, g, b) {
  547. var redMat = [
  548. r / 255, 0, 0, 0, 0,
  549. g / 255, 0, 0, 0, 0,
  550. b / 255, 0, 0, 0, 0,
  551. 0, 0, 0, 1, 0,
  552. ];
  553. var filter = new Laya.ColorFilter(redMat);
  554. sprite.filters = [filter];
  555. }
  556. function clone(obj, newobj = {}) {
  557. for (var attr in obj) {
  558. if (typeof obj[attr] == "object") {
  559. newobj[attr] = clone(obj[attr], newobj[attr]);
  560. }
  561. else {
  562. newobj[attr] = obj[attr];
  563. }
  564. }
  565. return newobj;
  566. }
  567. function _ms(arr, compare, begin, end) {
  568. const size = end - begin;
  569. if (size <= 1) {
  570. return;
  571. }
  572. const middle = (end + begin) >> 1;
  573. _ms(arr, compare, begin, middle);
  574. _ms(arr, compare, middle, end);
  575. if (compare(arr[middle - 1], arr[middle]) <= 0) {
  576. return;
  577. }
  578. const merged = [];
  579. let leftIndex = begin, rightIndex = middle;
  580. while (merged.length < size) {
  581. if (leftIndex === middle) {
  582. merged.push(arr[rightIndex++]);
  583. }
  584. else if (rightIndex === end) {
  585. merged.push(arr[leftIndex++]);
  586. }
  587. else {
  588. const c = compare(arr[leftIndex], arr[rightIndex]);
  589. if (c <= 0) {
  590. merged.push(arr[leftIndex++]);
  591. }
  592. else {
  593. merged.push(arr[rightIndex++]);
  594. }
  595. }
  596. }
  597. arr.splice(begin, size, ...merged);
  598. }
  599. function sort(arr, compare) {
  600. if (!Array.isArray(arr)) {
  601. throw new Error('sort的参数必须为数组');
  602. }
  603. _ms(arr, compare, 0, arr.length);
  604. return arr;
  605. }
  606. function getLanguage(id) {
  607. }
  608. function getLanguageByTip(id) {
  609. }
  610. function toWeights(array) {
  611. let max = 0;
  612. for (var i = 0; i < array.length; i++) {
  613. max = max + array[i];
  614. if (array[i] == 0) {
  615. array[i] = 0;
  616. }
  617. else {
  618. array[i] = max;
  619. }
  620. }
  621. return array;
  622. }
  623. function unique(array) {
  624. var n = {}, r = [], len = array.length, val, type;
  625. for (var i = 0; i < array.length; i++) {
  626. val = array[i];
  627. type = typeof val;
  628. if (!n[val]) {
  629. n[val] = [type];
  630. r.push(val);
  631. }
  632. else if (n[val].indexOf(type) < 0) {
  633. n[val].push(type);
  634. r.push(val);
  635. }
  636. }
  637. return r;
  638. }
  639. function unique1(array) {
  640. var r = [];
  641. for (var i = 0, l = array.length; i < l; i++) {
  642. for (var j = i + 1; j < l; j++)
  643. if (array[i] == array[j])
  644. j == ++i;
  645. r.push(array[i]);
  646. }
  647. return r;
  648. }
  649. function getDistance(x1, y1, x2, y2) {
  650. return Math.pow(((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)), 0.5);
  651. }
  652. function getV2Dis(pos1, pos2) {
  653. return Math.pow(((pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y)), 0.5);
  654. }
  655. function getV2SqDis(pos1, pos2) {
  656. return (pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y);
  657. }
  658. function getDis(x1, y1, x2, y2) {
  659. return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
  660. }
  661. function getDeltaxy(x1, y1, x2, y2) {
  662. return Math.abs(x1 - x2) + Math.abs(y1 - y2);
  663. }
  664. function getSymbolNumber(num) {
  665. if (num > 0) {
  666. return "+" + num;
  667. }
  668. else if (num < 0) {
  669. return num.toString();
  670. }
  671. return num.toString();
  672. }
  673. function fixNumber(num, length) {
  674. return ('' + num).length < length ? ((new Array(length + 1)).join('0') + num).slice(-length) : '' + num;
  675. }
  676. function toThousands(num) {
  677. return num.replace(/(\d)(?=(?:\d{3})+$)/g, '$1,');
  678. }
  679. let moneyUnitStr = ["", "K", "M", "B", "T", "AK", "AM", "AB", "AT", "BK", "BM", "BB", "BT", "CK", "CM", "CB", "CT"];
  680. function fmtMoney(money) {
  681. money = toThousands(money.replace(/^0+/, ''));
  682. if (money.length == 0) {
  683. money = "0";
  684. }
  685. let unit = 0;
  686. for (var i = 0; i < money.length; i++) {
  687. if (money.charAt(i) == ",") {
  688. unit++;
  689. }
  690. }
  691. if (unit == 0) {
  692. return money;
  693. }
  694. else {
  695. let idx = money.indexOf(",");
  696. if (idx) {
  697. money = money.slice(0, idx + 2) + moneyUnitStr[unit];
  698. }
  699. return money.replace(",", ".");
  700. }
  701. }
  702. function flatten(arr) {
  703. while (arr.some(item => Array.isArray(item))) {
  704. arr = [].concat(...arr);
  705. }
  706. return arr;
  707. }
  708. function getDistanceByPoint(p1, p2) {
  709. return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
  710. }
  711. function getAngleByPoint(p1, p2) {
  712. return Math.atan2((p2.y - p1.y), (p2.x - p1.x)) * (180 / Math.PI);
  713. }
  714. function toIntByArray(array) {
  715. for (var index = 0; index < array.length; index++) {
  716. array[index] = parseInt(array[index]);
  717. }
  718. return array;
  719. }
  720. function getAngle0To360(angle) {
  721. while (angle < 0) {
  722. angle += 360;
  723. }
  724. while (angle >= 360) {
  725. angle -= 360;
  726. }
  727. return angle;
  728. }
  729. function toAngle(radian) {
  730. return radian * 180 / Math.PI;
  731. }
  732. function toRadian(angle) {
  733. return angle * Math.PI / 180;
  734. }
  735. function getArrayValueRandom(array) {
  736. return array[random(0, array.length - 1)];
  737. }
  738. function promptByTip(tipId, color = "#FFFFFF", strokeColor = null, time = 1000, fontSize = 35, opacity = 1) {
  739. }
  740. function promptByErrorCode(id, color = "#FFFFFF", strokeColor = "#FF8B00", time = 1000, fontSize = 35, opacity = 1) {
  741. }
  742. function fmtTimeMMSS(time) {
  743. if (time < 0) {
  744. time = 0;
  745. }
  746. else
  747. time = Math.floor(time);
  748. return fixNumber(Math.floor(time / 60), 2) + ":" + fixNumber(time % 60, 2);
  749. }
  750. function fmtTimeMS(time) {
  751. if (time < 0) {
  752. time = 0;
  753. }
  754. return fixNumber(Math.floor(time / 60), 2) + "m" + fixNumber(time % 60, 2) + "s";
  755. }
  756. function fmtTimeHHMM(time) {
  757. if (time < 0) {
  758. time = 0;
  759. }
  760. time = Math.floor(time / 1000);
  761. return fixNumber(Math.floor(time / 3600), 2) + ":" + fixNumber(Math.floor((time % 3600) / 60), 2) + ":" + fixNumber(Math.floor(time % 60), 2);
  762. }
  763. let severTime = 0;
  764. function getServerTime() {
  765. return new Date(new Date().getTime() - severTime);
  766. }
  767. function setServerTime(data) {
  768. severTime = (new Date().getTime() - data);
  769. }
  770. var tools = /*#__PURE__*/Object.freeze({
  771. playClickEffect: playClickEffect,
  772. getNumList: getNumList,
  773. getStrList: getStrList,
  774. getRandStr: getRandStr,
  775. getUserId: getUserId,
  776. formatPos: formatPos,
  777. setPosInt: setPosInt,
  778. random: random,
  779. randomList: randomList,
  780. worldToScreen: worldToScreen,
  781. getStringLenght: getStringLenght,
  782. reviseString: reviseString,
  783. getCoinString: getCoinString,
  784. getV3Dest: getV3Dest,
  785. getV2Dest: getV2Dest,
  786. getV2Dir: getV2Dir,
  787. getV3Dir: getV3Dir,
  788. copyPos: copyPos,
  789. getScreenImg: getScreenImg,
  790. playMoveByPositions: playMoveByPositions,
  791. setStarPos: setStarPos,
  792. playLoopAnimRotate: playLoopAnimRotate,
  793. playLoopAnimPosition: playLoopAnimPosition,
  794. playLoopAnimScale: playLoopAnimScale,
  795. playLoopAnimRotation: playLoopAnimRotation,
  796. inRect: inRect,
  797. getNumberK: getNumberK,
  798. pointInsideCircle: pointInsideCircle,
  799. formatString: formatString,
  800. getIntersection: getIntersection,
  801. getComplement: getComplement,
  802. geSpriteStageRect: geSpriteStageRect,
  803. touchButton: touchButton,
  804. setColor: setColor,
  805. clone: clone,
  806. sort: sort,
  807. getLanguage: getLanguage,
  808. getLanguageByTip: getLanguageByTip,
  809. toWeights: toWeights,
  810. unique: unique,
  811. unique1: unique1,
  812. getDistance: getDistance,
  813. getV2Dis: getV2Dis,
  814. getV2SqDis: getV2SqDis,
  815. getDis: getDis,
  816. getDeltaxy: getDeltaxy,
  817. getSymbolNumber: getSymbolNumber,
  818. fixNumber: fixNumber,
  819. toThousands: toThousands,
  820. fmtMoney: fmtMoney,
  821. flatten: flatten,
  822. getDistanceByPoint: getDistanceByPoint,
  823. getAngleByPoint: getAngleByPoint,
  824. toIntByArray: toIntByArray,
  825. getAngle0To360: getAngle0To360,
  826. toAngle: toAngle,
  827. toRadian: toRadian,
  828. getArrayValueRandom: getArrayValueRandom,
  829. promptByTip: promptByTip,
  830. promptByErrorCode: promptByErrorCode,
  831. fmtTimeMMSS: fmtTimeMMSS,
  832. fmtTimeMS: fmtTimeMS,
  833. fmtTimeHHMM: fmtTimeHHMM,
  834. getServerTime: getServerTime,
  835. setServerTime: setServerTime
  836. });
  837. class HttpMgr {
  838. constructor() {
  839. HttpMgr._instance = this;
  840. }
  841. static getInstance() {
  842. if (!this._instance) {
  843. this._instance = new HttpMgr();
  844. }
  845. return this._instance;
  846. }
  847. sendPost(url, data, call) {
  848. let httpObj = new Laya.HttpRequest();
  849. httpObj.http.timeout = 5000;
  850. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  851. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  852. httpObj.send(url, data, 'post', 'text', ["Content-Type", "application/json; charset=UTF-8"]);
  853. function errorHandler(error) {
  854. console.log("errorHandler:" + error);
  855. }
  856. function completeHandler(data) {
  857. if (data && data.length > 0) {
  858. let jsonData = JSON.parse(data);
  859. if (call)
  860. call(jsonData);
  861. }
  862. }
  863. }
  864. sendGet(url, call) {
  865. let httpObj = new Laya.HttpRequest();
  866. httpObj.http.timeout = 5000;
  867. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  868. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  869. httpObj.send(url, '', 'get');
  870. function errorHandler(error) {
  871. console.log("errorHandler:" + error);
  872. }
  873. function completeHandler(data) {
  874. if (data && data.length > 0) {
  875. if (call)
  876. call(data);
  877. }
  878. }
  879. }
  880. }
  881. HttpMgr._instance = null;
  882. class LightShader extends Laya.Sprite {
  883. constructor() {
  884. super();
  885. this._time = 0;
  886. this._sin = 0;
  887. this.initShader();
  888. }
  889. initShader() {
  890. var vs = `
  891. #define FSHIGHPRECISION
  892. attribute vec4 posuv;
  893. uniform vec2 size;
  894. varying vec4 v_texcoord;
  895. void main() {
  896. vec4 pos = vec4(posuv.xy,0.,1.);
  897. vec4 pos1 =vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,0.,1.0);
  898. gl_Position=pos1;
  899. v_texcoord.xy = posuv.xy;
  900. }
  901. `;
  902. var ps = `
  903. #define FSHIGHPRECISION
  904. precision highp float;
  905. varying vec4 v_texcoord;
  906. uniform vec2 size;
  907. uniform sampler2D texture;
  908. uniform float u_Time;
  909. void main() {
  910. vec4 color= texture2D(texture, v_texcoord.xy);
  911. float width = 0.2;
  912. float start = u_Time;
  913. float offset = 1.0;
  914. vec2 myuv = vec2(v_texcoord.x/size.x,v_texcoord.y/size.y);
  915. if( myuv.x < (start - offset * myuv.y) && myuv.x > (start - offset * myuv.y - width))
  916. {
  917. color.r=1.1;
  918. color.g=1.1;
  919. color.b=1.1;
  920. gl_FragColor = color;
  921. } else {
  922. gl_FragColor = color;
  923. }
  924. }
  925. `;
  926. this.shaderValue = new Laya.Value2D(LightShader.DissolveSurfaceSaveName, LightShader.DissolveSurfaceSaveName);
  927. this.customRenderEnable = true;
  928. this.shaderValue.shader = new Laya.Shader2X(vs, ps, LightShader.DissolveSurfaceSaveName);
  929. }
  930. customRender(context, x, y) {
  931. this.onUpdate();
  932. if (!this.texture)
  933. return;
  934. let xx = x - this.pivotX;
  935. let yy = y - this.pivotY;
  936. context.drawTarget(this.texture, xx, yy, this.width, this.height, null, this.shaderValue);
  937. }
  938. onUpdate() {
  939. this._time += 2 * Laya.timer.delta * 0.001;
  940. this._sin = Math.sin(this._time);
  941. if (this._sin > 0.99) {
  942. this._sin = 0;
  943. this._time = 0;
  944. }
  945. this.shaderValue['u_Time'] = this._sin;
  946. }
  947. }
  948. LightShader.DissolveSurfaceSaveName = 9997;
  949. class UIBase extends fairygui.Window {
  950. constructor() {
  951. super();
  952. this.isEject = true;
  953. this.isHide = true;
  954. this.showbanner = true;
  955. this.className = "";
  956. this.isMuti = false;
  957. this.showbanner = false;
  958. this.onConstructor();
  959. }
  960. checkActive(show) {
  961. }
  962. getUIName() {
  963. return UIBase.uiName;
  964. }
  965. onConstructor() {
  966. }
  967. onInit() {
  968. if (!!this.contentPane) {
  969. this.contentPane.setSize(fairygui.GRoot.inst.width, fairygui.GRoot.inst.height);
  970. }
  971. this.setPivot(0.5, 0.5, false);
  972. }
  973. doShowAnimation() {
  974. if (!this.isEject)
  975. return;
  976. super.doShowAnimation();
  977. Laya.Tween.clearTween(this);
  978. this.scaleX = this.scaleY = 0.8;
  979. let tweenFunc1 = (func) => {
  980. Laya.Tween.to(this, { scaleX: 1.1, scaleY: 1.1 }, 100, Laya.Ease.linearIn, Laya.Handler.create(this, func));
  981. };
  982. let tweenFunc2 = (func) => {
  983. Laya.Tween.to(this, { scaleX: 1, scaleY: 1 }, 60, Laya.Ease.linearOut, Laya.Handler.create(this, this.refresh));
  984. };
  985. tweenFunc1(tweenFunc2);
  986. }
  987. show(...args) {
  988. super.show();
  989. this._openParam = args;
  990. this.isHide = false;
  991. xGame.uiMgr.checkUIState();
  992. }
  993. moveBannerButton() {
  994. }
  995. showBannerButton() {
  996. this.bannerButton.visible = true;
  997. Laya.Tween.to(this.bannerButton, { alpha: 1 }, 500, Laya.Ease.linearOut, Laya.Handler.create(this, () => {
  998. this.bannerButton.touchable = true;
  999. }));
  1000. }
  1001. hide() {
  1002. super.hide();
  1003. this.isHide = true;
  1004. xGame.uiMgr.checkUIState();
  1005. }
  1006. Dispose() {
  1007. super.dispose();
  1008. }
  1009. myUpdate(delay) {
  1010. }
  1011. refresh() { }
  1012. addUIClick(obj, func, arr = null) {
  1013. obj.onClick(this, func, arr);
  1014. obj.onClick(this, this.playBtnSound);
  1015. }
  1016. offUIClick(obj, func) {
  1017. obj.offClick(this, func);
  1018. }
  1019. playBtnSound() {
  1020. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  1021. }
  1022. }
  1023. UIBase.lastShowBanner = 0;
  1024. UIBase.showBannerNum = 0;
  1025. UIBase.uiName = "";
  1026. class ui_UIDraw extends fgui.GComponent {
  1027. static createInstance() {
  1028. return (fgui.UIPackage.createObject("game", "UIDraw"));
  1029. }
  1030. onConstruct() {
  1031. this.n1 = (this.getChild("n1"));
  1032. this.extraNode = (this.getChild("extraNode"));
  1033. this.myNode = (this.getChild("myNode"));
  1034. this.closeNode = (this.getChild("closeNode"));
  1035. this.moneyNode = (this.getChild("moneyNode"));
  1036. this.n38 = (this.getChild("n38"));
  1037. this.secretary = (this.getChild("secretary"));
  1038. this.drawBtn = (this.getChild("drawBtn"));
  1039. this.talkNode = (this.getChild("talkNode"));
  1040. this.t0 = this.getTransition("t0");
  1041. }
  1042. }
  1043. ui_UIDraw.URL = "ui://isxx5ak7wcn5v4ke";
  1044. class ui_UIBox extends fgui.GComponent {
  1045. static createInstance() {
  1046. return (fgui.UIPackage.createObject("game", "UIBox"));
  1047. }
  1048. onConstruct() {
  1049. this.n0 = (this.getChild("n0"));
  1050. this.n12 = (this.getChild("n12"));
  1051. this.n1 = (this.getChild("n1"));
  1052. this.n2 = (this.getChild("n2"));
  1053. this.bar = (this.getChild("bar"));
  1054. this.closeBtn = (this.getChild("closeBtn"));
  1055. this.openBtn = (this.getChild("openBtn"));
  1056. this.t0 = this.getTransition("t0");
  1057. this.t1 = this.getTransition("t1");
  1058. }
  1059. }
  1060. ui_UIBox.URL = "ui://isxx5ak7erstv4nm";
  1061. class UIBox extends UIBase {
  1062. constructor() {
  1063. super();
  1064. this.boxNum = 0;
  1065. this.boxMax = 10;
  1066. this.inAd = false;
  1067. this.isClose = false;
  1068. }
  1069. onConstructor() {
  1070. this.ui = ui_UIBox.createInstance();
  1071. this.contentPane = this.ui;
  1072. this.isEject = false;
  1073. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  1074. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  1075. Laya.timer.loop(1000, this, this.update);
  1076. }
  1077. update() {
  1078. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  1079. this.boxNum -= 1;
  1080. this.upBar();
  1081. }
  1082. }
  1083. upBar() {
  1084. if (this.boxNum > this.boxMax)
  1085. this.boxNum = this.boxMax;
  1086. this.ui.bar.value = this.boxNum * 10;
  1087. }
  1088. show() {
  1089. super.show();
  1090. this.isClose = false;
  1091. this.boxNum = 0;
  1092. this.inAd = false;
  1093. this.upBar();
  1094. this.ui.t0.play();
  1095. this.ui.closeBtn.visible = false;
  1096. Laya.timer.once(3000, this, () => {
  1097. this.ui.closeBtn.visible = true;
  1098. this.ui.bar.alpha = 1;
  1099. });
  1100. Laya.timer.once(500, this, () => {
  1101. this.ui.t1.play();
  1102. });
  1103. }
  1104. hide() {
  1105. Laya.timer.clearAll(this);
  1106. Moyu.showBannerAd(false);
  1107. super.hide();
  1108. }
  1109. onOpenBox() {
  1110. this.boxNum++;
  1111. if (this.boxNum < this.boxMax) {
  1112. if (PlatMgr.getRand() < PlatMgr.boxInsertRate)
  1113. Moyu.showInsertAd(0, PlatMgr.insertGap);
  1114. }
  1115. else if (this.boxNum == this.boxMax) {
  1116. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  1117. this.ui.openBtn.c1.selectedIndex = 13;
  1118. this.inAd = true;
  1119. }
  1120. else
  1121. this.getAward();
  1122. }
  1123. else if (this.inAd) {
  1124. Moyu.showVideoAd(() => {
  1125. this.getAward();
  1126. }, EAdType.box);
  1127. }
  1128. this.upBar();
  1129. }
  1130. onCloseBox() {
  1131. if (this.isClose)
  1132. this.hide();
  1133. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  1134. this.isClose = true;
  1135. PlatMgr.showBanner(true, 0, 3000);
  1136. }
  1137. else
  1138. this.hide();
  1139. }
  1140. getAward() {
  1141. let str = "";
  1142. if (Math.random() < 0.5) {
  1143. let max = Moyu.isLegal ? 500 : 2500;
  1144. let num = xGame.tools.random(max, 500 + max);
  1145. DataMgr.setCoin(num);
  1146. str = "金币x" + num;
  1147. }
  1148. else {
  1149. let max = Moyu.isLegal ? 10 : 30;
  1150. let num = xGame.tools.random(max, 30 + max);
  1151. DataMgr.setDiamond(num);
  1152. str = "钻石x" + num;
  1153. }
  1154. xGame.showTip("恭喜获得-" + str);
  1155. this.hide();
  1156. }
  1157. }
  1158. UIBox.uiName = "UIBox";
  1159. class ui_UITry extends fgui.GComponent {
  1160. static createInstance() {
  1161. return (fgui.UIPackage.createObject("game", "UITry"));
  1162. }
  1163. onConstruct() {
  1164. this.n11 = (this.getChild("n11"));
  1165. this.myNode = (this.getChild("myNode"));
  1166. this.t0 = this.getTransition("t0");
  1167. }
  1168. }
  1169. ui_UITry.URL = "ui://isxx5ak7cj92v4o4";
  1170. class UITry extends UIBase {
  1171. constructor() {
  1172. super();
  1173. this.closeTime = 0;
  1174. this.closeNum = 0;
  1175. this.skillUrl = xGame.common.skillIconList;
  1176. }
  1177. onConstructor() {
  1178. this.ui = ui_UITry.createInstance();
  1179. this.contentPane = this.ui;
  1180. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  1181. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  1182. }
  1183. show() {
  1184. super.show();
  1185. this.closeNum = 0;
  1186. this.closeTime = 15;
  1187. this.ui.t0.play();
  1188. PlatMgr.showRateBanner();
  1189. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1190. Laya.timer.loop(1000, this, this.updateTime);
  1191. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  1192. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  1193. xGame.common.gameMgr.gamePause = true;
  1194. }
  1195. updateTime() {
  1196. if (this.closeTime > 1) {
  1197. this.closeTime--;
  1198. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1199. }
  1200. else
  1201. this.hide();
  1202. }
  1203. hide() {
  1204. Laya.timer.clearAll(this);
  1205. Moyu.showBannerAd(false);
  1206. super.hide();
  1207. xGame.common.gameMgr.gamePause = false;
  1208. }
  1209. onTry() {
  1210. Moyu.showVideoAd(() => {
  1211. let select = xGame.common.curPlayerSkillType;
  1212. DataMgr.gameData.trySkill = select;
  1213. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  1214. DataMgr.saveGameData();
  1215. DataMgr.setBigSkill(select, 1);
  1216. xGame.showTip("试用成功");
  1217. this.hide();
  1218. }, EAdType.try);
  1219. }
  1220. onCancel() {
  1221. if (this.closeNum > 0) {
  1222. this.closeNum--;
  1223. if (this.closeNum < 2)
  1224. this.hide();
  1225. return;
  1226. }
  1227. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  1228. this.onTry();
  1229. }
  1230. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  1231. this.closeNum = 3;
  1232. }
  1233. else
  1234. this.hide();
  1235. }
  1236. }
  1237. UITry.uiName = "UITry";
  1238. class PlatMgr {
  1239. static initConfig() {
  1240. this.lastVt = 0;
  1241. if (!Moyu.platConfig)
  1242. return;
  1243. for (let k in Moyu.platConfig) {
  1244. let pd = this[k];
  1245. let pc = Moyu.platConfig[k];
  1246. if (pd != undefined && pc != undefined)
  1247. this[k] = pc;
  1248. }
  1249. Moyu.setBannerPos(0.5, 1);
  1250. }
  1251. static rand100(num) {
  1252. return xGame.tools.random(0, 100) < num;
  1253. }
  1254. static isMisVideo() {
  1255. let dt = Laya.timer.currTimer - this.lastVt;
  1256. if (dt > this.forceVideoGap && this.rand100(this.forceVideoRate)) {
  1257. this.lastVt = Laya.timer.currTimer;
  1258. return true;
  1259. }
  1260. else {
  1261. if (this.rand100(this.fullVideoRate))
  1262. Moyu.showInsertAd(0, 0, 'full');
  1263. return false;
  1264. }
  1265. }
  1266. static showVideo(call, type) {
  1267. Moyu.showVideoAd(() => {
  1268. this.lastVt = Laya.timer.currTimer;
  1269. call && call();
  1270. }, type);
  1271. }
  1272. static showInsert(delay = false) {
  1273. if (this.getRand() < this.insertRate) {
  1274. let dt = delay ? this.insertDelay : 0;
  1275. Moyu.showInsertAd(dt, this.insertGap);
  1276. }
  1277. }
  1278. static gameInsert() {
  1279. if (this.getRand() < this.gameInsertRate) {
  1280. Moyu.showInsertAd(xGame.tools.random(2000, 5100), this.insertGap);
  1281. }
  1282. }
  1283. static showRateBanner() {
  1284. if (this.getRand() < this.bannerRate)
  1285. this.showBanner(true, this.bannerDelay, 3000);
  1286. }
  1287. static showBanner(show, delay = 0, hide = 0) {
  1288. if (!show)
  1289. Moyu.showBannerAd(false);
  1290. else {
  1291. Laya.timer.clear(this, this.bannerShow);
  1292. if (delay > 0)
  1293. Laya.timer.once(delay, this, this.bannerShow, [true]);
  1294. else
  1295. this.bannerShow(true);
  1296. if (hide > 0)
  1297. Laya.timer.once(hide, this, this.bannerShow, [false]);
  1298. }
  1299. }
  1300. static bannerShow(show) {
  1301. Moyu.showBannerAd(show);
  1302. console.log("showBanner" + show);
  1303. }
  1304. static getRand() {
  1305. return xGame.tools.random(0, 100);
  1306. }
  1307. static openBox() {
  1308. if (this.getRand() < this.boxRate)
  1309. xGame.uiMgr.Show(UIBox);
  1310. }
  1311. static openTry() {
  1312. if (Laya.timer.currTimer < DataMgr.gameData.tryTime)
  1313. return;
  1314. if (this.getRand() < this.tryRate)
  1315. xGame.uiMgr.Show(UITry);
  1316. else if (DataMgr.gameData.gameCount == 1)
  1317. xGame.uiMgr.Show(UITry);
  1318. }
  1319. }
  1320. PlatMgr.forceShare = 0;
  1321. PlatMgr.signAdRate = 0;
  1322. PlatMgr.forceVideoRate = 0;
  1323. PlatMgr.forceVideoGap = 0;
  1324. PlatMgr.fullVideoRate = 0;
  1325. PlatMgr.gameInsertRate = 0;
  1326. PlatMgr.insertGap = 0;
  1327. PlatMgr.insertDelay = 0;
  1328. PlatMgr.insertRate = 0;
  1329. PlatMgr.boxRate = 0;
  1330. PlatMgr.boxVideoRate = 0;
  1331. PlatMgr.boxInsertRate = 0;
  1332. PlatMgr.boxBannerRate = 0;
  1333. PlatMgr.tryRate = 0;
  1334. PlatMgr.tryClose3Rate = 0;
  1335. PlatMgr.tryVideoRate = 0;
  1336. PlatMgr.bannerRate = 0;
  1337. PlatMgr.lastVt = 0;
  1338. class ui_UIAddProp extends fgui.GComponent {
  1339. static createInstance() {
  1340. return (fgui.UIPackage.createObject("game", "UIAddProp"));
  1341. }
  1342. onConstruct() {
  1343. this.n11 = (this.getChild("n11"));
  1344. this.myNode = (this.getChild("myNode"));
  1345. this.closeBtn = (this.getChild("closeBtn"));
  1346. this.t0 = this.getTransition("t0");
  1347. }
  1348. }
  1349. ui_UIAddProp.URL = "ui://isxx5ak7p4tr42k";
  1350. class SpineMgr {
  1351. constructor(name, loadCb = null) {
  1352. this.loaded = false;
  1353. this.spineName = '';
  1354. this.loadedCallback = loadCb;
  1355. this.templet = new Laya.Templet();
  1356. this.templet.on(Laya.Event.COMPLETE, this, this.parseComplete);
  1357. this.templet.on(Laya.Event.ERROR, this, this.onError);
  1358. this.templet.loadAni(`spine/${name}.sk`);
  1359. this.templet.lock = true;
  1360. this.spineName = name;
  1361. }
  1362. onError() {
  1363. console.log("spine加载出错");
  1364. }
  1365. parseComplete() {
  1366. this.loaded = true;
  1367. this.loadedCallback && this.loadedCallback();
  1368. }
  1369. dispose() {
  1370. if (this.templet && !this.templet.destroyed) {
  1371. this.templet.destroy();
  1372. }
  1373. this.templet = null;
  1374. }
  1375. play(data, aniIndex, isLoop = true, parent, callback, mySpine = null) {
  1376. if (!this.loaded) {
  1377. return;
  1378. }
  1379. let spine;
  1380. if (mySpine) {
  1381. spine = mySpine;
  1382. }
  1383. else {
  1384. spine = this.createSpine(data, parent);
  1385. }
  1386. spine.play(aniIndex, isLoop, true, 0, 0, true);
  1387. if (!isLoop) {
  1388. spine.on(Laya.Event.STOPPED, this, () => {
  1389. spine.offAll(Laya.Event.STOPPED);
  1390. callback && callback(spine);
  1391. });
  1392. }
  1393. return spine;
  1394. }
  1395. createSpine(data, parent, type = 1) {
  1396. let spine;
  1397. spine = this.templet.buildArmature(type);
  1398. spine.showSkinByIndex(0);
  1399. parent.addChild(spine);
  1400. spine.pos(data.x, data.y);
  1401. spine.scale(data.scaleX, data.scaleY, true);
  1402. return spine;
  1403. }
  1404. }
  1405. var AIState;
  1406. (function (AIState) {
  1407. AIState[AIState["none"] = 0] = "none";
  1408. AIState[AIState["idle"] = 1] = "idle";
  1409. AIState[AIState["reset"] = 2] = "reset";
  1410. AIState[AIState["move"] = 3] = "move";
  1411. AIState[AIState["wait"] = 4] = "wait";
  1412. AIState[AIState["select"] = 5] = "select";
  1413. AIState[AIState["turn"] = 6] = "turn";
  1414. AIState[AIState["shoot"] = 7] = "shoot";
  1415. AIState[AIState["leave"] = 8] = "leave";
  1416. })(AIState || (AIState = {}));
  1417. class AIPlayer {
  1418. constructor() {
  1419. this.dtime = 30;
  1420. this.awayTime = 0;
  1421. this.awayNum = 0;
  1422. this.hideTime = 0;
  1423. this.rootMoveTime = 0;
  1424. this.isGuide = false;
  1425. this.state = AIState.none;
  1426. this.waitTime = 0;
  1427. this.forceNum = 0;
  1428. this.forceMax = 0;
  1429. this.ballSize = 33;
  1430. this.selectNum = 0;
  1431. this.destRot = 0;
  1432. this.aiLv = 10;
  1433. this.kickBall = [];
  1434. this.lineBall = [];
  1435. this.scoreBall = [];
  1436. this.holeBall = [];
  1437. this.turnNum = 0;
  1438. this.setNum = 0;
  1439. this.setMax = 0;
  1440. this.setRate = 0;
  1441. this.rectL = 0;
  1442. this.rectR = 0;
  1443. this.rectT = 0;
  1444. this.rectB = 0;
  1445. this.rootPos = { x: 0, y: 0 };
  1446. this.bestForce = 0;
  1447. this.bestAngle = 180;
  1448. this.bestPos = { x: 0, y: 0 };
  1449. this.bestKick = { x: 0, y: 0 };
  1450. this.posList = [];
  1451. this.posIdx = 0;
  1452. this.chatTime = 3000;
  1453. this.tempDir1 = new Laya.Vector2();
  1454. this.tempDir2 = new Laya.Vector2();
  1455. this.tempDir3 = new Laya.Vector2();
  1456. Laya.timer.loop(this.dtime, this, this.onUpdate);
  1457. xGame.eventMgr.off(RESET_GAME, this, this.resetAI);
  1458. xGame.eventMgr.on(RESET_GAME, this, this.resetAI);
  1459. this.gameSrc = xGame.common.gameUI;
  1460. this.hideTime = Laya.timer.currTimer;
  1461. Moyu.setOnTipCall((id) => {
  1462. if (id == 20012)
  1463. this.hideTime = Laya.timer.currTimer;
  1464. else
  1465. (id == 20011);
  1466. {
  1467. let dt = Laya.timer.currTimer - this.hideTime;
  1468. console.log("onshow" + dt);
  1469. if (dt > 30000 && this.state > AIState.none)
  1470. xGame.common.gameMgr.aiGameEnd(false);
  1471. }
  1472. }, this);
  1473. }
  1474. init() {
  1475. this.isGuide = DataMgr.getSkillGuide() < 1 || DataMgr.gameData.gameCount < 1;
  1476. this.awayTime = xGame.tools.random(5000, 10000);
  1477. this.awayNum = 0;
  1478. this.hideTime = Laya.timer.currTimer;
  1479. let rect = xGame.common.d2World.borderRect;
  1480. this.rectL = Math.ceil(rect.x) + 17;
  1481. this.rectT = Math.ceil(rect.y) + 17;
  1482. this.rectR = Math.floor(rect.x + rect.width) - 17;
  1483. this.rectB = Math.floor(rect.y + rect.height) - 17;
  1484. this.wBall = xGame.common.d2World.rootBall;
  1485. this.ballSize = this.wBall.gameObj.width - 1;
  1486. if (this.posList.length < 1) {
  1487. let dp = 40;
  1488. for (let i = this.rectL; i < this.rectR + dp; i = i + dp) {
  1489. for (let j = this.rectT; j < this.rectB + dp; j = j + dp) {
  1490. let dx = i < this.rectR ? i : this.rectR;
  1491. let dy = j < this.rectB ? j : this.rectB;
  1492. let order = xGame.tools.random(0, 1000);
  1493. this.posList.push({ x: dx, y: dy, order: order });
  1494. }
  1495. }
  1496. this.posList.sort(function (a, b) {
  1497. return a.order - b.order;
  1498. });
  1499. this.setMax = this.posList.length;
  1500. }
  1501. this.state = AIState.idle;
  1502. }
  1503. setAiLevel(num) {
  1504. this.aiLv = num;
  1505. }
  1506. initBall() {
  1507. this.rootPos.x = this.wBall.gameObj.x;
  1508. this.rootPos.y = this.wBall.gameObj.y;
  1509. this.initHoleBall();
  1510. }
  1511. initHoleBall() {
  1512. this.kickBall = [];
  1513. this.lineBall = [];
  1514. this.scoreBall = [];
  1515. this.holeBall = [];
  1516. this.selectNum = 0;
  1517. this.forceNum = 0;
  1518. this.forceMax = 0;
  1519. this.turnNum = 0;
  1520. let list = xGame.common.d2World.ballArr;
  1521. if (list.length < 20 && !this.isGuide) {
  1522. let holes = xGame.common.gameMgr.holePosList;
  1523. for (let i = 0; i < list.length; i++) {
  1524. let obj = list[i];
  1525. if (!obj)
  1526. continue;
  1527. obj.kickPos.x = 0;
  1528. obj.kickPos.y = 0;
  1529. obj.poleAngle = 0;
  1530. obj.hard = 0;
  1531. obj.borderDis = 0;
  1532. obj.kickAngle = 180;
  1533. if (obj.number == 0)
  1534. continue;
  1535. if (obj.ballType == xGame.common.gameMgr.selfCamp)
  1536. continue;
  1537. if (obj.number == 8 && xGame.common.gameMode == 0) {
  1538. if (xGame.common.gameMgr.aiBallArr.length > 0 || !xGame.common.gameMgr.ensureBallType)
  1539. continue;
  1540. }
  1541. let b = obj.gameObj;
  1542. let wbp = this.rootPos;
  1543. let bx = wbp.x - b.x;
  1544. let by = wbp.y - b.y;
  1545. obj.borderDis = xGame.tools.random(0, 100);
  1546. this.kickBall.push(obj);
  1547. if (!this.isLine(wbp, obj))
  1548. continue;
  1549. obj.kickAngle = xGame.tools.random(90, 180);
  1550. obj.kickPos.x = b.x;
  1551. obj.kickPos.y = b.y;
  1552. this.lineBall.push(obj);
  1553. let minDis = 999999;
  1554. let hole = false;
  1555. for (let j = 0; j < holes.length; j++) {
  1556. let hp = holes[j];
  1557. if (bx >= 0 && hp.x > b.x + 100)
  1558. continue;
  1559. if (bx <= 0 && hp.x < b.x - 100)
  1560. continue;
  1561. if (by < -10 && hp.y < wbp.y)
  1562. continue;
  1563. if (by > 10 && hp.y > wbp.y)
  1564. continue;
  1565. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  1566. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  1567. if (dis < minDis) {
  1568. let dx = b.x - this.tempDir1.x * this.ballSize;
  1569. let dy = b.y - this.tempDir1.y * this.ballSize;
  1570. this.tempDir3.x = this.tempDir1.x;
  1571. this.tempDir3.y = this.tempDir1.y;
  1572. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  1573. obj.kickPos.x = dx;
  1574. obj.kickPos.y = dy;
  1575. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  1576. if (num > 1)
  1577. num = 1;
  1578. obj.kickAngle = Math.acos(num) * 57.3;
  1579. if (b.x < this.rectL + 2 || b.x > this.rectR - 2 || b.y < this.rectT + 2 || b.y > this.rectB - 2)
  1580. dis = dis * 2;
  1581. if (Math.abs(hp.x - 600) < 100)
  1582. dis += 50;
  1583. obj.hard = dis + obj.kickAngle * 3;
  1584. hole = true;
  1585. }
  1586. }
  1587. }
  1588. }
  1589. if (hole) {
  1590. this.scoreBall.push(obj);
  1591. this.holeBall.push(obj);
  1592. }
  1593. }
  1594. this.scoreBall.sort(function (a, b) {
  1595. return a.hard - b.hard;
  1596. });
  1597. this.holeBall.sort(function (a, b) {
  1598. return a.kickAngle - b.kickAngle;
  1599. });
  1600. this.kickBall.sort(function (a, b) {
  1601. return a.borderDis - b.borderDis;
  1602. });
  1603. }
  1604. else {
  1605. let max = list.length - 1;
  1606. let i = xGame.tools.random(0, max);
  1607. for (i; i <= max; i++) {
  1608. let idx = i >= max ? i -= max : i;
  1609. let obj = list[idx];
  1610. if (obj && obj.number != 0) {
  1611. obj.kickAngle = xGame.tools.random(90, 180);
  1612. obj.kickPos.x = obj.gameObj.x + xGame.tools.random(-10, 10);
  1613. obj.kickPos.y = obj.gameObj.y + xGame.tools.random(-10, 10);
  1614. this.lineBall.push(obj);
  1615. break;
  1616. }
  1617. }
  1618. }
  1619. }
  1620. selectBall() {
  1621. let ball = null;
  1622. this.destRot = 0;
  1623. let max = this.isGuide ? 1 : 3 - Math.ceil(this.aiLv / 4) + xGame.tools.random(0, 2);
  1624. let ai = 110 - this.aiLv * 10;
  1625. let mis = xGame.tools.random(-ai, ai) * 0.005;
  1626. let score = false;
  1627. if (this.scoreBall.length < 1) {
  1628. if (this.lineBall.length < 1) {
  1629. for (let i = 0; i < this.kickBall.length; i++) {
  1630. let list = [];
  1631. let bo = this.kickBall[i];
  1632. let bobj = bo.gameObj;
  1633. let rect = xGame.common.d2World.borderRect;
  1634. let mobj = this.wBall.gameObj;
  1635. let minb = bobj.y - rect.y - 20;
  1636. let minw = mobj.y - rect.y - 50;
  1637. if (minb > 0 && minw > 0) {
  1638. let dlenx = 0;
  1639. let dleny = mobj.y - rect.y;
  1640. let spx = mobj.x;
  1641. let spy = rect.y - dleny;
  1642. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1643. }
  1644. minb = rect.y + rect.height - bobj.y - 20;
  1645. minw = rect.y + rect.height - mobj.y - 50;
  1646. if (minb > 0 && minw > 0) {
  1647. let dlenx = 0;
  1648. let dleny = rect.y + rect.height - mobj.y;
  1649. let spx = mobj.x;
  1650. let spy = rect.y + rect.height + dleny;
  1651. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1652. }
  1653. minb = bobj.x - rect.x - 20;
  1654. minw = mobj.x - rect.x - 50;
  1655. if (minb > 0 && minw > 0) {
  1656. let dlenx = mobj.x - rect.x;
  1657. let dleny = 0;
  1658. let spx = rect.x - dlenx;
  1659. let spy = mobj.y;
  1660. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1661. }
  1662. minb = rect.x + rect.width - bobj.x - 20;
  1663. minw = rect.x + rect.width - mobj.x - 50;
  1664. if (minb > 0 && minw > 0) {
  1665. let dlenx = rect.x + rect.width - mobj.x;
  1666. let dleny = 0;
  1667. let spx = rect.x + rect.width + dlenx;
  1668. let spy = mobj.y;
  1669. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1670. }
  1671. list.sort(function (a, b) {
  1672. return a.order - b.order;
  1673. });
  1674. for (let i = 0; i < list.length; i++) {
  1675. let data = list[i];
  1676. let mx = mobj.x - bobj.x;
  1677. let my = mobj.y - bobj.y;
  1678. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  1679. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  1680. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1681. if (num > 1)
  1682. num = 1;
  1683. let cos = Math.acos(num);
  1684. if (cos > 1.57)
  1685. cos = 1.57;
  1686. else if (cos < 0.01)
  1687. cos = 0.01;
  1688. let tan = Math.tan(cos);
  1689. let dx = tan * data.dleny;
  1690. let dy = tan * data.dlenx;
  1691. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  1692. if (Math.abs(bx - 667) < 40)
  1693. continue;
  1694. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  1695. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  1696. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  1697. this.forceMax = dis * 0.08;
  1698. this.destRot += mis * 0.1;
  1699. this.setKick(bx, by);
  1700. return true;
  1701. }
  1702. }
  1703. }
  1704. }
  1705. else {
  1706. ball = xGame.common.getRandArrEle(this.lineBall);
  1707. }
  1708. }
  1709. else {
  1710. for (let i = 0; i < this.scoreBall.length; i++) {
  1711. if (i < this.scoreBall.length - 1) {
  1712. let rand = 70 + this.aiLv * 10 + i * 10;
  1713. if (xGame.tools.random(0, 100) < rand) {
  1714. ball = this.scoreBall[i];
  1715. break;
  1716. }
  1717. }
  1718. else {
  1719. ball = this.scoreBall[i];
  1720. break;
  1721. }
  1722. }
  1723. score = true;
  1724. this.selectNum++;
  1725. }
  1726. if (!ball)
  1727. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  1728. if (this.selectNum >= max) {
  1729. let dx = ball.gameObj.x;
  1730. let dy = ball.gameObj.y;
  1731. let kickAngle = 0;
  1732. if (score) {
  1733. dx = ball.kickPos.x;
  1734. dy = ball.kickPos.y;
  1735. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  1736. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  1737. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  1738. if (adot > 1)
  1739. adot = 1;
  1740. kickAngle = Math.acos(adot) * 57.3;
  1741. if (kickAngle > 45) {
  1742. let kdx = ball.kickPos.x - ball.gameObj.x;
  1743. let kdy = ball.kickPos.y - ball.gameObj.y;
  1744. dx = ball.kickPos.x - kdx * mis * 0.3;
  1745. dy = ball.kickPos.y - kdy * mis * 0.3;
  1746. }
  1747. else
  1748. this.destRot += mis;
  1749. }
  1750. else if (ball.poleAngle != 0) {
  1751. this.destRot += ball.poleAngle;
  1752. }
  1753. if (xGame.common.gameMode == 0) {
  1754. let af = kickAngle * 0.08;
  1755. this.forceMax = ball.hard * 0.1 + af * af;
  1756. }
  1757. this.setKick(dx, dy);
  1758. }
  1759. else {
  1760. let rand = this.aiLv * 5 + 40;
  1761. if (xGame.tools.random(0, 100) < rand && this.scoreBall.length > 0)
  1762. ball = xGame.common.getRandArrEle(this.scoreBall);
  1763. else
  1764. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  1765. rand = this.aiLv * 3 + 40 + this.selectNum * 20;
  1766. if (xGame.tools.random(0, 100) > rand) {
  1767. this.selectNum = max;
  1768. }
  1769. this.setState(AIState.select, xGame.tools.random(500, 1000));
  1770. this.selectNum++;
  1771. }
  1772. ball.onClick(0, true);
  1773. }
  1774. isBlock(bn, bx, by, hx, hy, dn = -1) {
  1775. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  1776. let balls = xGame.common.d2World.ballArr;
  1777. let max = xGame.tools.getDis(hx, hy, bx, by);
  1778. for (let index = 0; index < balls.length; index++) {
  1779. let obj = balls[index];
  1780. if (obj.number == 0)
  1781. continue;
  1782. if (obj.number == bn || obj.number == dn)
  1783. continue;
  1784. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  1785. if (dis * dis > max)
  1786. continue;
  1787. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  1788. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1789. if (num > 1)
  1790. num = 1;
  1791. if (num < 0)
  1792. continue;
  1793. let gap = Math.sin(Math.acos(num)) * dis;
  1794. if (gap < this.ballSize)
  1795. return true;
  1796. }
  1797. return false;
  1798. }
  1799. isLine(xy, ball) {
  1800. let bx = xy.x;
  1801. let by = xy.y;
  1802. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  1803. let dis = ball.getDestDis(xy);
  1804. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  1805. let sin = Math.sin(angle);
  1806. let cos = Math.cos(angle);
  1807. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  1808. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  1809. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  1810. let dx = bx + this.tempDir2.x * dis;
  1811. let dy = by + this.tempDir2.y * dis;
  1812. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  1813. sin = Math.sin(-angle);
  1814. cos = Math.cos(-angle);
  1815. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  1816. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  1817. dx = bx + this.tempDir2.x * dis;
  1818. dy = by + this.tempDir2.y * dis;
  1819. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  1820. if (isr && isl)
  1821. return false;
  1822. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  1823. }
  1824. return true;
  1825. }
  1826. turnPole() {
  1827. this.turnNum++;
  1828. let rot = xGame.common.d2World.d2Gan.ui.rotation % 360;
  1829. let dr = rot - this.destRot;
  1830. let abs = Math.abs(dr) % 360;
  1831. if (abs > 180) {
  1832. if (rot > 180)
  1833. rot -= 360;
  1834. if (this.destRot > 180)
  1835. this.destRot -= 360;
  1836. }
  1837. let max = this.turnNum * 5 + this.aiLv * 5;
  1838. if (abs < 0.2 && xGame.tools.random(0, 100) < max) {
  1839. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  1840. let at = xGame.tools.random(1000, 2000);
  1841. if (!this.onAway(3))
  1842. at += xGame.tools.random(10000, 15000);
  1843. this.setState(AIState.shoot, at);
  1844. }
  1845. else {
  1846. let mr = 0;
  1847. if (abs > 3)
  1848. mr = 1 + xGame.tools.random(2, 6) * abs * 0.01;
  1849. else if (Math.random() > 0.6)
  1850. mr = xGame.tools.random(1, 10) * 0.1;
  1851. mr = dr > 0 ? -mr : mr;
  1852. xGame.common.d2World.d2Gan.rotDest(rot + mr);
  1853. }
  1854. }
  1855. setKick(dx, dy) {
  1856. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  1857. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  1858. this.tempDir1.x = 0;
  1859. this.tempDir1.y = 1;
  1860. this.tempDir2.y = -this.tempDir2.y;
  1861. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1862. if (num > 1)
  1863. num = 1;
  1864. let rot = Math.acos(num) * 57.3;
  1865. if (this.tempDir2.x < 0)
  1866. rot = 360 - rot;
  1867. this.destRot += rot;
  1868. if (!xGame.common.gameMgr.finishOneShoot) {
  1869. this.forceMax += xGame.tools.random(10, 50);
  1870. this.forceMax -= this.aiLv * 2;
  1871. if (this.forceMax < 20)
  1872. this.forceMax = 20;
  1873. }
  1874. if (this.forceMax > 100)
  1875. this.forceMax = 101;
  1876. else if (this.forceMax < 10)
  1877. this.forceMax += xGame.tools.random(0, 10);
  1878. if (xGame.common.gameMode == 1)
  1879. this.forceMax = xGame.tools.random(80, 100);
  1880. else
  1881. this.forceMax = xGame.tools.random(this.forceMax * 0.5, this.forceMax);
  1882. let max = 2000 - this.aiLv * 100;
  1883. if (Math.random() > 0.8)
  1884. max += xGame.tools.random(100, 2000);
  1885. this.setState(AIState.turn, xGame.tools.random(500, max));
  1886. }
  1887. shoot() {
  1888. if (this.waitTime < 0 && Math.abs(this.forceNum - this.forceMax) < 4) {
  1889. if (Math.random() > 0.8) {
  1890. this.gameSrc.aiForce(1);
  1891. this.setState(AIState.wait);
  1892. }
  1893. }
  1894. else {
  1895. let df = xGame.tools.random(3, 8);
  1896. if (this.forceNum < this.forceMax)
  1897. this.forceNum += df;
  1898. else
  1899. this.forceNum -= df;
  1900. let startY = this.gameSrc.ui.powerNode.y;
  1901. let height = this.gameSrc.ui.powerNode.height;
  1902. let force = startY + height * this.forceNum * 0.01;
  1903. this.gameSrc.aiForce(2, force);
  1904. }
  1905. }
  1906. reset() {
  1907. for (let i = 0; i < 4; i++) {
  1908. this.setRate--;
  1909. this.setNum++;
  1910. let pos = this.posList[this.posIdx];
  1911. this.rootPos.x = pos.x + xGame.tools.random(-20, 20);
  1912. this.rootPos.y = pos.y + xGame.tools.random(-20, 20);
  1913. if (!xGame.common.gameMgr.isTouchedBall && this.rootPos.x > 387)
  1914. this.rootPos.x = 387;
  1915. if (this.rootPos.x < this.rectL)
  1916. this.rootPos.x = this.rectL;
  1917. else if (this.rootPos.x > this.rectR)
  1918. this.rootPos.x = this.rectR;
  1919. if (this.rootPos.y < this.rectT)
  1920. this.rootPos.y = this.rectT;
  1921. else if (this.rootPos.y > this.rectB)
  1922. this.rootPos.y = this.rectB;
  1923. this.posIdx++;
  1924. let max = this.posList.length;
  1925. if (this.posIdx >= max)
  1926. this.posIdx -= max;
  1927. this.initHoleBall();
  1928. let ball = null;
  1929. if (this.scoreBall.length > 0)
  1930. ball = this.scoreBall[0];
  1931. else if (this.lineBall.length > 0)
  1932. ball = xGame.common.getRandArrEle(this.lineBall);
  1933. if (ball && ball.kickAngle < this.bestAngle) {
  1934. this.bestAngle = ball.kickAngle;
  1935. this.bestKick.x = ball.kickPos.x;
  1936. this.bestKick.y = ball.kickPos.y;
  1937. this.bestPos.x = this.rootPos.x;
  1938. this.bestPos.y = this.rootPos.y;
  1939. this.bestForce = ball.hard * 0.08;
  1940. }
  1941. }
  1942. if (this.setNum >= this.setMax)
  1943. this.setMax = 0;
  1944. if (this.setRate < 1) {
  1945. this.setState(AIState.move, 0);
  1946. this.rootMoveTime = Laya.timer.currTimer;
  1947. this.gameSrc.aiRootMove(true);
  1948. }
  1949. }
  1950. delayLine() {
  1951. this.gameSrc.aiRootMove(false);
  1952. }
  1953. move() {
  1954. if (this.bestPos.x < 1)
  1955. this.bestPos = this.rootPos;
  1956. let wObj = this.wBall.gameObj;
  1957. let destx = wObj.x;
  1958. let desty = wObj.y;
  1959. let dx = Math.abs(destx - this.bestPos.x);
  1960. let dy = Math.abs(desty - this.bestPos.y);
  1961. let mx = 3 + dx * 0.03;
  1962. let my = 3 + dy * 0.03;
  1963. if (dx < 4 && dy < 4) {
  1964. let dt = Laya.timer.currTimer - this.rootMoveTime;
  1965. dt = dt < 1000 ? 1000 - dt : 0;
  1966. if (this.setMax > 0) {
  1967. let min = this.setMax * 0.3 + this.aiLv * 5;
  1968. this.setRate = xGame.tools.random(min, this.setMax);
  1969. this.setState(AIState.reset, 0);
  1970. }
  1971. else {
  1972. this.destRot = 0;
  1973. this.forceMax = this.bestForce;
  1974. this.setKick(this.bestKick.x, this.bestKick.y);
  1975. }
  1976. if (dt > 100) {
  1977. Laya.timer.clear(this, this.delayLine);
  1978. Laya.timer.once(dt, this, this.delayLine);
  1979. }
  1980. else
  1981. this.gameSrc.aiRootMove(false);
  1982. }
  1983. else {
  1984. if (dx > 4)
  1985. destx = wObj.x < this.bestPos.x ? wObj.x + mx : wObj.x - mx;
  1986. if (dy > 4)
  1987. desty = wObj.y < this.bestPos.y ? wObj.y + my : wObj.y - my;
  1988. this.gameSrc.onRootMove({ x: destx, y: desty });
  1989. }
  1990. }
  1991. resetRoot() {
  1992. this.bestAngle = 180;
  1993. this.bestForce = 0;
  1994. this.setMax = this.posList.length;
  1995. this.posIdx = xGame.tools.random(0, this.setMax);
  1996. let min = this.setMax * 0.3 + this.aiLv * 5;
  1997. this.setRate = xGame.tools.random(min, this.setMax);
  1998. let max = 2000 - this.aiLv * 100;
  1999. if (Math.random() > 0.8)
  2000. max += xGame.tools.random(100, 1000);
  2001. if (this.isGuide)
  2002. this.setState(AIState.select, 500);
  2003. else if (this.onAway(2))
  2004. this.setState(AIState.reset, xGame.tools.random(400, max));
  2005. else
  2006. this.setState(AIState.none);
  2007. if (xGame.common.gameMgr.finishOneShoot)
  2008. this.chat();
  2009. }
  2010. runAI() {
  2011. if (this.state > AIState.idle)
  2012. return;
  2013. this.initBall();
  2014. this.onGame(2500);
  2015. if (Math.random() > 0.6)
  2016. this.chat();
  2017. }
  2018. stopRun() {
  2019. this.setState(AIState.idle);
  2020. }
  2021. onGame(base) {
  2022. let max = base - this.aiLv * 100;
  2023. if (Math.random() > 0.8)
  2024. max += xGame.tools.random(100, 1000);
  2025. if (this.onAway(2))
  2026. this.setState(AIState.select, xGame.tools.random(500, max));
  2027. else
  2028. this.setState(AIState.none);
  2029. }
  2030. setState(sta, wt = 0) {
  2031. if (this.state == AIState.none)
  2032. return;
  2033. this.state = sta;
  2034. this.waitTime = wt;
  2035. }
  2036. onUpdate() {
  2037. if (this.state == AIState.none)
  2038. return;
  2039. this.awayTime -= this.dtime;
  2040. if (this.awayTime < 1) {
  2041. this.awayTime = xGame.tools.random(6000, 10000);
  2042. this.awayNum += (11 - this.aiLv);
  2043. this.onAway(1);
  2044. }
  2045. if (this.waitTime >= 0) {
  2046. this.waitTime -= this.dtime;
  2047. return;
  2048. }
  2049. switch (this.state) {
  2050. case AIState.idle:
  2051. this.chat();
  2052. break;
  2053. case AIState.reset:
  2054. this.reset();
  2055. break;
  2056. case AIState.move:
  2057. this.move();
  2058. break;
  2059. case AIState.leave:
  2060. this.state = AIState.none;
  2061. xGame.common.gameMgr.aiGameEnd(true);
  2062. break;
  2063. case AIState.select:
  2064. this.selectBall();
  2065. break;
  2066. case AIState.turn:
  2067. this.turnPole();
  2068. break;
  2069. case AIState.shoot:
  2070. this.shoot();
  2071. break;
  2072. }
  2073. }
  2074. onAway(type) {
  2075. if (type == 1) {
  2076. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2077. let num = this.awayNum + db * 20;
  2078. if (db > 0 && num > 0 && xGame.tools.random(0, 10000) < num && this.state == AIState.idle) {
  2079. xGame.common.gameMgr.aiLeave();
  2080. this.setState(AIState.leave, 6666);
  2081. }
  2082. }
  2083. else if (type == 2) {
  2084. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2085. let num = this.awayNum + db * 30;
  2086. if (xGame.tools.random(0, 10000) < num)
  2087. return false;
  2088. }
  2089. else if (type == 3) {
  2090. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2091. let num = this.awayNum + db * 10;
  2092. if (xGame.tools.random(0, 4000) < num)
  2093. return false;
  2094. }
  2095. return true;
  2096. }
  2097. chat() {
  2098. if (this.chatTime > 0) {
  2099. this.chatTime -= this.dtime;
  2100. return;
  2101. }
  2102. this.chatTime = xGame.tools.random(2000, 10000);
  2103. let rand = xGame.tools.random(0, 100);
  2104. if (rand < 15)
  2105. this.talk();
  2106. else if (rand < 35)
  2107. this.emotion();
  2108. }
  2109. talk() {
  2110. xGame.common.talkMgr.showAITalk(0);
  2111. }
  2112. emotion() {
  2113. xGame.common.talkMgr.showAIEmotion(0);
  2114. }
  2115. resetAI() {
  2116. this.stopRun();
  2117. this.state = AIState.none;
  2118. }
  2119. }
  2120. class Partical extends Laya.Script3D {
  2121. constructor() {
  2122. super();
  2123. this.duration = 2000;
  2124. }
  2125. ;
  2126. onAwake() {
  2127. this.gameObj = this.owner;
  2128. }
  2129. onEnable() {
  2130. this.openTimer();
  2131. }
  2132. openTimer() {
  2133. Laya.timer.once(this.duration, this, this.disappear);
  2134. }
  2135. setCallback(obj, callback) {
  2136. this.obj = obj;
  2137. this.callback = callback;
  2138. Laya.timer.clearAll(this);
  2139. Laya.timer.once(this.duration, this, this.disappear);
  2140. }
  2141. disappear() {
  2142. xGame.poolD3Mgr.putItem(this.gameObj.name, this.gameObj);
  2143. this.callback && this.callback(this.obj);
  2144. }
  2145. }
  2146. class Ball extends Laya.Script3D {
  2147. constructor() {
  2148. super();
  2149. this.posV3 = new Laya.Vector3();
  2150. this.rotRate = 2.1;
  2151. this.rotSpeed = new Laya.Vector3();
  2152. this.myIndex = 0;
  2153. }
  2154. onAwake() {
  2155. this.gameObj = this.owner;
  2156. this.transform = this.gameObj.transform;
  2157. this.ballNode = this.gameObj.getChildByName("Ball");
  2158. this.shadowNode = this.gameObj.getChildByName("shadow");
  2159. }
  2160. initSelf(index, x, y, owner) {
  2161. this.d2BallSrc = owner;
  2162. this.myIndex = index;
  2163. this.setAlbedoTexture();
  2164. this.setTransPos(x, y);
  2165. this.setScale();
  2166. this.ballNode.transform.localRotationEulerX = 90;
  2167. if (index == 0) {
  2168. }
  2169. }
  2170. setAlbedoTexture(isIce = false) {
  2171. let url;
  2172. if (isIce) {
  2173. url = `res/d3Res/ballTexture/ice.jpg`;
  2174. }
  2175. else {
  2176. url = `res/d3Res/ballTexture/ball${this.myIndex}.png`;
  2177. }
  2178. Laya.Texture2D.load(url, Laya.Handler.create(this, (tex) => {
  2179. this.ballNode.meshRenderer.material["albedoTexture"] = tex;
  2180. }));
  2181. }
  2182. runFireworks(obj, delay, callback) {
  2183. Laya.timer.clearAll(this);
  2184. Laya.timer.once(delay + 1, this, () => {
  2185. let fire = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  2186. fire.transform.localPositionX = this.transform.localPositionX;
  2187. fire.transform.localPositionY = this.transform.localPositionY;
  2188. fire.transform.localPositionZ = this.transform.localPositionZ;
  2189. let src = fire.getComponent(Partical);
  2190. src.duration = 1000;
  2191. src.setCallback(obj, callback);
  2192. let eft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  2193. eft.transform.localPositionX = this.transform.localPositionX;
  2194. eft.transform.localPositionY = this.transform.localPositionY;
  2195. eft.transform.localPositionZ = this.transform.localPositionZ;
  2196. });
  2197. }
  2198. setTransPos(x, y) {
  2199. this.setRotation();
  2200. xGame.common.pos2to3Convert(x, y, this.posV3);
  2201. this.transform.localPositionX = this.posV3.x;
  2202. this.transform.localPositionY = 0;
  2203. this.transform.localPositionZ = this.posV3.z;
  2204. this.transform.localRotationEulerX = 0;
  2205. this.transform.localRotationEulerY = 0;
  2206. this.transform.localRotationEulerZ = 0;
  2207. this.shadowNode.transform.localPositionX = this.posV3.x / 30;
  2208. this.shadowNode.transform.localPositionY = 0.1;
  2209. this.shadowNode.transform.localPositionZ = this.posV3.z / 30;
  2210. }
  2211. setRotation() {
  2212. if (this.d2BallSrc.canRot) {
  2213. let speed = this.d2BallSrc.rigy.linearVelocity;
  2214. this.rotSpeed.x = speed.x * this.rotRate;
  2215. this.rotSpeed.z = speed.y * this.rotRate;
  2216. this.rotSpeed.y = this.d2BallSrc.rotY;
  2217. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2218. }
  2219. else if (Math.abs(this.d2BallSrc.rotY) > 0.1) {
  2220. this.rotSpeed.x = this.rotSpeed.y = 0;
  2221. this.rotSpeed.y = this.d2BallSrc.rotY;
  2222. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2223. }
  2224. }
  2225. setScale() {
  2226. let radius = xGame.common.d2World.rootBall.ui.width;
  2227. let scale = xGame.common.scale2to3Convert(radius);
  2228. this.transform.localScaleX = scale;
  2229. this.transform.localScaleY = scale;
  2230. this.transform.localScaleZ = scale;
  2231. }
  2232. playInHoleEft() {
  2233. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  2234. eft.transform.position = this.transform.position;
  2235. }
  2236. playIceEft() {
  2237. let eft = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  2238. eft.transform.position = this.transform.position;
  2239. }
  2240. get scaleXYZ() {
  2241. return this.transform.localScaleX;
  2242. }
  2243. set scaleXYZ(val) {
  2244. this.transform.localScaleX = val;
  2245. this.transform.localScaleY = val;
  2246. this.transform.localScaleZ = val;
  2247. }
  2248. get posX() {
  2249. return this.transform.localPositionX;
  2250. }
  2251. set posX(val) {
  2252. this.transform.localPositionX = val;
  2253. }
  2254. get posY() {
  2255. return this.transform.localPositionY;
  2256. }
  2257. set posY(val) {
  2258. this.transform.localPositionY = val;
  2259. }
  2260. get posZ() {
  2261. return this.transform.localPositionZ;
  2262. }
  2263. set posZ(val) {
  2264. this.transform.localPositionZ = val;
  2265. }
  2266. destroySelf() {
  2267. this.posV3 = null;
  2268. this.rotSpeed = null;
  2269. this.d2BallSrc = null;
  2270. this.ballNode = null;
  2271. this.gameObj.destroy(true);
  2272. this.transform = null;
  2273. this.destroy();
  2274. }
  2275. }
  2276. class ui_D2Ball extends fgui.GComponent {
  2277. static createInstance() {
  2278. return (fgui.UIPackage.createObject("game", "D2Ball"));
  2279. }
  2280. onConstruct() {
  2281. this.myIcon = (this.getChild("myIcon"));
  2282. this.inner = (this.getChild("inner"));
  2283. this.n8 = (this.getChild("n8"));
  2284. this.n4 = (this.getChild("n4"));
  2285. this.wrongTips = (this.getChild("wrongTips"));
  2286. this.rightTips = (this.getChild("rightTips"));
  2287. this.breathAni = this.getTransition("breathAni");
  2288. }
  2289. }
  2290. ui_D2Ball.URL = "ui://isxx5ak7kt443qi";
  2291. class D2BallSrc extends Laya.Script {
  2292. constructor() {
  2293. super();
  2294. this.number = 0;
  2295. this.startX = 0;
  2296. this.startY = 0;
  2297. this.angleV2 = new Laya.Vector2();
  2298. this.isRootBall = false;
  2299. this.isBlackBall = false;
  2300. this.ballType = "";
  2301. this.canRot = true;
  2302. this.rotY = 0;
  2303. this.poleAngle = 0;
  2304. this.kickPos = { x: 0, y: 0 };
  2305. this.hard = 0;
  2306. this.kickAngle = 0;
  2307. this.borderDis = 0;
  2308. this.speedP10 = 5.6;
  2309. this.lastSpeed = { x: 0, y: 0 };
  2310. this.stillSpeed = 0.12;
  2311. this.ballFunc = "normal";
  2312. this.isRunSkillAni = false;
  2313. this.isInHole = false;
  2314. this.iceOwner = "";
  2315. this.forceRun = false;
  2316. this.myUNID = "";
  2317. this.rectL = 0;
  2318. this.rectR = 0;
  2319. this.rectT = 0;
  2320. this.rectB = 0;
  2321. this.forceVec = new Laya.Vector2();
  2322. this.lastDis = 0;
  2323. this.helpOut = { type: "", x: 0, y: 0 };
  2324. }
  2325. initSelf(number, x, y, d3Ball) {
  2326. if (!this.gameObj)
  2327. this.gameObj = this.owner;
  2328. this.number = number;
  2329. this.startX = x;
  2330. this.startY = y;
  2331. this.d3Ball = d3Ball;
  2332. this.isRootBall = false;
  2333. this.isBlackBall = false;
  2334. this.ballType = "";
  2335. if (number == 0) {
  2336. this.isRootBall = true;
  2337. }
  2338. else if (number == 8) {
  2339. this.isBlackBall = true;
  2340. }
  2341. else {
  2342. if (number <= 7) {
  2343. this.ballType = ballCamp.full;
  2344. }
  2345. else {
  2346. this.ballType = ballCamp.flower;
  2347. }
  2348. }
  2349. this.setInfo();
  2350. this.setD3Ball();
  2351. this.owner["mySrc"] = this;
  2352. this.rigy.linearDamping = 1;
  2353. D2BallSrc._unid++;
  2354. this.myUNID = "d2ball" + D2BallSrc._unid;
  2355. let rect = xGame.common.d2World.borderRect;
  2356. this.rectL = Math.ceil(rect.x) + 20;
  2357. this.rectT = Math.ceil(rect.y) + 20;
  2358. this.rectR = Math.floor(rect.x + rect.width) - 20;
  2359. this.rectB = Math.floor(rect.y + rect.height) - 20;
  2360. }
  2361. setInfo() {
  2362. this.gameObj.x = this.startX;
  2363. this.gameObj.y = this.startY;
  2364. let radius = this.ui.width / 2;
  2365. this.gameObj.width = radius * 2;
  2366. this.gameObj.height = radius * 2;
  2367. if (xGame.common.showDebug) {
  2368. this.ui.myIcon.alpha = 1;
  2369. this.ui.inner.alpha = 1;
  2370. }
  2371. else {
  2372. this.ui.myIcon.alpha = 0;
  2373. this.ui.inner.alpha = 0;
  2374. }
  2375. }
  2376. setD3Ball() {
  2377. this.d3Ball = this.d3Ball;
  2378. this.d3BallSrc = this.d3Ball.getComponent(Ball);
  2379. this.d3BallSrc.initSelf(this.number, this.startX, this.startY, this);
  2380. }
  2381. onUpdate() {
  2382. if (xGame.common.gameMgr.gamePause)
  2383. return;
  2384. if (this.isInHole)
  2385. return;
  2386. if (!xGame.common.d2World.openCheckStill)
  2387. return;
  2388. this.runBall();
  2389. }
  2390. runBall() {
  2391. this.lastSpeed.x = this.rigy.linearVelocity.x;
  2392. this.lastSpeed.y = this.rigy.linearVelocity.y;
  2393. this.d3BallSrc.setTransPos(this.gameObj.x, this.gameObj.y);
  2394. this.judgeBorder();
  2395. }
  2396. getDestDis(dest) {
  2397. return xGame.tools.getDistance(dest.x, dest.y, this.gameObj.x, this.gameObj.y);
  2398. }
  2399. setmyXY(x, y) {
  2400. this.d3BallSrc.setTransPos(x, y);
  2401. }
  2402. getSpeed() {
  2403. let speed = this.rigy.linearVelocity;
  2404. return speed.x * speed.x + speed.y * speed.y;
  2405. }
  2406. onTriggerEnter(collider) {
  2407. if (!collider || !collider.owner)
  2408. return;
  2409. let coll = "collide";
  2410. let speed = this.getSpeed();
  2411. let sv2 = this.speedP10 * this.speedP10;
  2412. if (collider.label == "ball") {
  2413. if (speed < 9 && this.number != 0)
  2414. coll = "";
  2415. else if (speed < sv2)
  2416. coll = "collide_4";
  2417. else if (speed < sv2 * 6.2)
  2418. coll = "collide_3";
  2419. else if (speed < sv2 * 25)
  2420. coll = "collide_2";
  2421. else if (speed < sv2 * 56)
  2422. coll = "collide_1";
  2423. xGame.soundMgr.playSound(coll);
  2424. if (this.gameObj.x < this.rectL || this.gameObj.x > this.rectR || this.gameObj.y < this.rectT || this.gameObj.y > this.rectB) {
  2425. if (collider.owner) {
  2426. let rig = collider.owner.getComponent(D2BallSrc);
  2427. if (Math.abs(rig.rigy.linearVelocity.x) > 0)
  2428. rig.lastSpeed.x = rig.rigy.linearVelocity.x;
  2429. if (Math.abs(rig.rigy.linearVelocity.y) > 0)
  2430. rig.lastSpeed.y = rig.rigy.linearVelocity.y;
  2431. let vx = Math.abs(rig.lastSpeed.x * 0.4);
  2432. let vy = Math.abs(rig.lastSpeed.y * 0.5);
  2433. let rx = 0;
  2434. let ry = 0;
  2435. if (this.gameObj.x < this.rectL)
  2436. rx = vx;
  2437. else if (this.gameObj.x > this.rectR)
  2438. rx = -vx;
  2439. else if (this.gameObj.y < this.rectT)
  2440. ry = vy;
  2441. else if (this.gameObj.y > this.rectB)
  2442. ry = -vy;
  2443. this.rigy.applyLinearImpulseToCenter({ x: rx, y: ry });
  2444. }
  2445. }
  2446. if (this.number != 0) {
  2447. return;
  2448. }
  2449. else {
  2450. if (this.forceRun) {
  2451. console.log("randon force");
  2452. this.applyForce(collider);
  2453. }
  2454. }
  2455. if (xGame.common.d2World.isOnSameLine) {
  2456. xGame.common.d2World.isOnSameLine = false;
  2457. this.rigy.linearVelocity = { x: 0, y: 0 };
  2458. }
  2459. if (xGame.common.gameMgr.firstColliObj == null) {
  2460. xGame.common.gameMgr.firstColliObj = collider.owner["mySrc"].number;
  2461. xGame.common.gameMgr.isTouchedBall = true;
  2462. }
  2463. }
  2464. else {
  2465. xGame.common.recoverCameraView();
  2466. let wallStr = "";
  2467. if (speed < 9) { }
  2468. else if (speed < sv2) { }
  2469. else if (speed < sv2 * 6.2)
  2470. wallStr = "wall_30";
  2471. else if (speed < sv2 * 25)
  2472. wallStr = "wall_50";
  2473. else if (speed < sv2 * 56)
  2474. wallStr = "wall_80";
  2475. xGame.soundMgr.playSound(wallStr);
  2476. }
  2477. }
  2478. applyForce(collider) {
  2479. let src = collider.owner.mySrc;
  2480. this.forceVec.x = src.gameObj.x - this.gameObj.x;
  2481. this.forceVec.y = src.gameObj.y - this.gameObj.y;
  2482. Laya.Vector2.normalize(this.forceVec, this.forceVec);
  2483. Laya.Vector2.scale(this.forceVec, 50, this.forceVec);
  2484. src.rigy.applyLinearImpulseToCenter({ x: this.forceVec.x, y: this.forceVec.y });
  2485. }
  2486. checkWrongBall(playEft = true) {
  2487. if (this.isInHole)
  2488. return;
  2489. xGame.common.gameMgr.inHoleBalls.push(this.number);
  2490. if (this.number != 0 && playEft)
  2491. this.d3BallSrc.playInHoleEft();
  2492. let coll = "inpocket_1";
  2493. let speed = this.getSpeed();
  2494. let sv2 = this.speedP10 * this.speedP10 * 0.8;
  2495. if (speed < 9 && this.number != 0)
  2496. coll = "";
  2497. else if (speed < sv2 * 6.2)
  2498. coll = "inpocket_4";
  2499. else if (speed < sv2 * 25)
  2500. coll = "collide_3";
  2501. else if (speed < sv2 * 56)
  2502. coll = "collide_2";
  2503. xGame.soundMgr.playSound(coll);
  2504. this.isInHole = true;
  2505. if (this.number == 0) {
  2506. console.log("白球进了。。");
  2507. this.reset();
  2508. this.rigy.linearVelocity = { x: 0, y: 0 };
  2509. this.hideSelf();
  2510. xGame.common.gameUI.ui.whiteAni.visible = true;
  2511. xGame.common.gameUI.ui.whiteAni.t0.play(Laya.Handler.create(this, () => {
  2512. xGame.common.gameUI.ui.whiteAni.visible = false;
  2513. }));
  2514. }
  2515. else {
  2516. xGame.common.playClassicEmotion(this.number, this.gameObj.x, this.gameObj.y);
  2517. xGame.common.d2World.removeOneBall(this);
  2518. this.destroySelf();
  2519. xGame.common.playHappySound(this.number);
  2520. this.runFlyEft();
  2521. }
  2522. }
  2523. runFlyEft() {
  2524. if (xGame.common.gameMode == GameMode.placeBall && xGame.common.gameMgr.placeBallData.type == PlaceBallType.challenge) {
  2525. xGame.common.playAwardSpine(this.gameObj.x + 100, this.gameObj.y - 100);
  2526. }
  2527. }
  2528. hideSelf() {
  2529. if (this.d3Ball)
  2530. this.d3Ball.active = false;
  2531. }
  2532. showSelf() {
  2533. this.isInHole = false;
  2534. if (this.d3Ball && !this.d3Ball.active)
  2535. this.d3Ball.active = true;
  2536. }
  2537. isStill() {
  2538. let speed = this.rigy.linearVelocity;
  2539. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed) {
  2540. this.rigy.linearVelocity = { x: 0, y: 0 };
  2541. return true;
  2542. }
  2543. return false;
  2544. }
  2545. reset() {
  2546. }
  2547. destroySelf() {
  2548. this.d3BallSrc.destroySelf();
  2549. if (!this.ui.isDisposed) {
  2550. this.ui.removeFromParent();
  2551. this.ui.dispose();
  2552. this.ui = null;
  2553. }
  2554. this.outColli = null;
  2555. this.innerColli = null;
  2556. this.rigy = null;
  2557. this.d3Ball = null;
  2558. this.d3BallSrc = null;
  2559. this.angleV2 = null;
  2560. this.gameObj.destroy(true);
  2561. this.destroy();
  2562. }
  2563. judgeBorder() {
  2564. if (this.forceRun && this.owner == xGame.common.d2World.rootBall.owner) {
  2565. return;
  2566. }
  2567. if (this.destroyed)
  2568. return;
  2569. if (xGame.common.gameMode == GameMode.classic)
  2570. return;
  2571. let isOver = xGame.common.checkBallOverBorder(this.gameObj.x, this.gameObj.y);
  2572. if (isOver) {
  2573. this.checkWrongBall();
  2574. }
  2575. }
  2576. onClick(e, force = false) {
  2577. if (this.number == 0)
  2578. return;
  2579. if (force) {
  2580. }
  2581. else {
  2582. if (xGame.common.d2World.openCheckStill)
  2583. return;
  2584. if (!xGame.common.gameMgr.selfTurn) {
  2585. return;
  2586. }
  2587. }
  2588. if (!xGame.common.gameMgr.finishOneShoot)
  2589. return;
  2590. let root = xGame.common.d2World.rootBall.gameObj;
  2591. let x = this.gameObj.x - root.x;
  2592. let y = this.gameObj.y - root.y;
  2593. let angle = xGame.common.getfguiRotation(x, y);
  2594. xGame.common.d2World.d2Gan.ui.rotation = angle;
  2595. xGame.common.d2World.getHelpLine();
  2596. xGame.common.clickedBall = true;
  2597. this.checkGuide();
  2598. }
  2599. checkGuide() {
  2600. let guide = DataMgr.getSkillGuide();
  2601. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) {
  2602. xGame.common.guideStep++;
  2603. xGame.common.gameUI.ui.guide1.visible = false;
  2604. xGame.common.gameUI.ui.guide2.visible = true;
  2605. }
  2606. }
  2607. checkDistance(disX, disY, angle) {
  2608. let diameter = this.gameObj.width - 1;
  2609. let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2);
  2610. if (!this.lastDis)
  2611. this.lastDis = dis;
  2612. else {
  2613. if (dis > this.lastDis) {
  2614. this.helpOut.type = "remove";
  2615. return this.helpOut;
  2616. }
  2617. }
  2618. if (dis <= Math.pow(diameter, 2)) {
  2619. let del = 0.01;
  2620. let offest = 0;
  2621. let realX = disX - this.gameObj.x;
  2622. let realY = disY - this.gameObj.y;
  2623. while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) {
  2624. offest += del;
  2625. realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180);
  2626. realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180);
  2627. }
  2628. this.helpOut.type = "ok";
  2629. this.helpOut.x = realX + this.gameObj.x;
  2630. this.helpOut.y = realY + this.gameObj.y;
  2631. return this.helpOut;
  2632. }
  2633. else {
  2634. this.helpOut.type = "no";
  2635. return this.helpOut;
  2636. }
  2637. }
  2638. clearBallEft() {
  2639. this.clearBallRightEft();
  2640. this.clearBallWrongEft();
  2641. }
  2642. clearBallRightEft() {
  2643. this.ui.breathAni.stop();
  2644. this.ui.rightTips.visible = false;
  2645. }
  2646. clearBallWrongEft() {
  2647. this.ui.wrongTips.visible = false;
  2648. }
  2649. showWrongEft() {
  2650. if (!xGame.common.gameMgr.selfTurn)
  2651. return;
  2652. this.ui.wrongTips.visible = true;
  2653. }
  2654. showRightEft() {
  2655. if (!xGame.common.gameMgr.selfTurn)
  2656. return;
  2657. this.ui.rightTips.visible = true;
  2658. this.ui.rightTips.scaleX = 1;
  2659. this.ui.rightTips.scaleY = 1;
  2660. this.ui.breathAni.play();
  2661. }
  2662. setBallFunc(type, owner) {
  2663. if (type == "ice") {
  2664. this.ballFunc = type;
  2665. this.d3BallSrc.setAlbedoTexture(true);
  2666. this.rigy.type = "static";
  2667. this.iceOwner = owner;
  2668. }
  2669. else {
  2670. if (owner == this.iceOwner) {
  2671. this.ballFunc = type;
  2672. this.d3BallSrc.setAlbedoTexture(false);
  2673. this.rigy.type = "dynamic";
  2674. }
  2675. }
  2676. }
  2677. }
  2678. D2BallSrc._unid = 0;
  2679. class D2RootBallSrc extends D2BallSrc {
  2680. constructor() {
  2681. super();
  2682. this.maxSpeed = 0;
  2683. this.classicMaxSpeed = 2.2;
  2684. this.bigSkillMaxSpeed = 4;
  2685. this.angle = 0;
  2686. this.allPercent = 0;
  2687. this.linearPercent = 0;
  2688. this.anglePercent = 0;
  2689. this.maxAngleRate = 0.6;
  2690. this.baseRot = 7;
  2691. this.angleMax = 0;
  2692. this.speed = new Laya.Vector2();
  2693. this.rotSpeed = new Laya.Vector2();
  2694. }
  2695. isStill() {
  2696. let speed = this.rigy.linearVelocity;
  2697. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) {
  2698. if (this.anglePercent <= 0.1) {
  2699. this.rigy.linearVelocity = { x: 0, y: 0 };
  2700. return true;
  2701. }
  2702. }
  2703. return false;
  2704. }
  2705. reset() {
  2706. this.linearPercent = 0;
  2707. this.anglePercent = 0;
  2708. }
  2709. setSpeed(percent, angle) {
  2710. this.allPercent = percent;
  2711. this.angle = angle;
  2712. this.setAngleSpeed();
  2713. this.setLinearSpeed();
  2714. let hit = "hit";
  2715. if (percent < 25)
  2716. hit = "hit03";
  2717. else if (percent < 50)
  2718. hit = "hit02";
  2719. else if (percent < 75)
  2720. hit = "hit01";
  2721. xGame.soundMgr.playSound(hit);
  2722. }
  2723. setAngleSpeed() {
  2724. let offest = xGame.common.rodOffest;
  2725. let radius = 82;
  2726. let rate = Math.abs(offest.y / radius) * 0.5;
  2727. if (offest.y > 0)
  2728. this.angleMax = -this.baseRot * 2;
  2729. else
  2730. this.angleMax = this.baseRot;
  2731. this.rotY = -offest.x / radius * 100;
  2732. this.anglePercent = this.maxAngleRate * rate * this.allPercent;
  2733. this.linearPercent = this.allPercent - this.anglePercent;
  2734. }
  2735. setLinearSpeed() {
  2736. if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) {
  2737. if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) {
  2738. if (!xGame.common.longHelpLine) {
  2739. let offset = -150 + xGame.common.randomNum(0, 300);
  2740. offset /= 100;
  2741. this.angle += offset;
  2742. }
  2743. }
  2744. }
  2745. let sin = Math.sin(this.angle * Math.PI / 180);
  2746. let cos = Math.cos(this.angle * Math.PI / 180);
  2747. switch (xGame.common.gameMode) {
  2748. case GameMode.classic:
  2749. this.maxSpeed = this.classicMaxSpeed;
  2750. break;
  2751. case GameMode.bigMove:
  2752. this.maxSpeed = this.bigSkillMaxSpeed;
  2753. break;
  2754. case GameMode.placeBall:
  2755. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  2756. if (data.type == 1) {
  2757. this.maxSpeed = this.bigSkillMaxSpeed;
  2758. }
  2759. else {
  2760. this.maxSpeed = this.classicMaxSpeed;
  2761. }
  2762. break;
  2763. default:
  2764. break;
  2765. }
  2766. this.speed.x = this.maxSpeed * this.linearPercent * sin;
  2767. this.speed.y = -this.maxSpeed * this.linearPercent * cos;
  2768. this.rotSpeed.x = -this.angleMax * sin * this.anglePercent;
  2769. this.rotSpeed.y = this.angleMax * cos * this.anglePercent;
  2770. this.rigy.applyLinearImpulseToCenter(this.speed);
  2771. }
  2772. onUpdate() {
  2773. if (this.anglePercent > 0.1) {
  2774. this.anglePercent *= 0.97;
  2775. this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent;
  2776. this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent;
  2777. this.rigy.applyForceToCenter(this.rotSpeed);
  2778. Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed);
  2779. Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed);
  2780. let num = Laya.Vector2.dot(this.speed, this.rotSpeed);
  2781. if (num > 0.9)
  2782. this.canRot = true;
  2783. }
  2784. else
  2785. this.canRot = true;
  2786. if (Math.abs(this.rotY) > 0.1)
  2787. this.rotY *= 0.98;
  2788. super.onUpdate();
  2789. }
  2790. destroySelf() {
  2791. super.destroySelf();
  2792. this.speed = null;
  2793. }
  2794. }
  2795. class D2Ball extends Laya.Sprite {
  2796. constructor(isRootBall = false) {
  2797. super();
  2798. this.ui = ui_D2Ball.createInstance();
  2799. this.pivotX = this.ui.width / 2;
  2800. this.pivotY = this.ui.width / 2;
  2801. this.x = 0;
  2802. this.y = 0;
  2803. this.addChild(this.ui.displayObject);
  2804. this.ui.displayObject.x += this.ui.width / 2;
  2805. this.ui.displayObject.y += this.ui.width / 2;
  2806. if (isRootBall) {
  2807. this.d2Src = this.addComponent(D2RootBallSrc);
  2808. }
  2809. else {
  2810. this.d2Src = this.addComponent(D2BallSrc);
  2811. }
  2812. this.d2Src.ui = this.ui;
  2813. this.addCircleCollider();
  2814. this.addInnerCircleCollider();
  2815. this.addRigyBody();
  2816. }
  2817. addCircleCollider() {
  2818. let colli = xGame.common.getCollider("circle");
  2819. colli.radius = this.ui.width / 2;
  2820. this.addComponentIntance(colli);
  2821. this.d2Src.outColli = colli;
  2822. colli.label = "ball";
  2823. }
  2824. addInnerCircleCollider() {
  2825. let colli = xGame.common.getCollider("circle");
  2826. colli.radius = this.ui.inner.width / 2;
  2827. colli.x = (this.ui.width - this.ui.inner.width) / 2;
  2828. colli.y = (this.ui.width - this.ui.inner.width) / 2;
  2829. this.addComponentIntance(colli);
  2830. this.d2Src.innerColli = colli;
  2831. colli.label = "inner";
  2832. }
  2833. addRigyBody() {
  2834. let rigy = xGame.common.getRigbody();
  2835. rigy.type = "dynamic";
  2836. this.addComponentIntance(rigy);
  2837. this.d2Src.rigy = rigy;
  2838. }
  2839. disposeSelf() {
  2840. if (!this.ui.isDisposed) {
  2841. this.ui.dispose();
  2842. this.ui.removeFromParent();
  2843. this.ui = null;
  2844. }
  2845. }
  2846. }
  2847. class ui_D2Gan extends fgui.GComponent {
  2848. static createInstance() {
  2849. return (fgui.UIPackage.createObject("game", "D2Gan"));
  2850. }
  2851. onConstruct() {
  2852. this.myIcon = (this.getChild("myIcon"));
  2853. this.selfRodIcon = (this.getChild("selfRodIcon"));
  2854. this.selfEftRoot = (this.getChild("selfEftRoot"));
  2855. this.self = (this.getChild("self"));
  2856. this.aiRodIcon = (this.getChild("aiRodIcon"));
  2857. this.aiEftRoot = (this.getChild("aiEftRoot"));
  2858. this.ai = (this.getChild("ai"));
  2859. }
  2860. }
  2861. ui_D2Gan.URL = "ui://isxx5ak7sdh33qp";
  2862. class D2Gan {
  2863. constructor() {
  2864. this.offset = 0.15;
  2865. this.cell = 1.5;
  2866. this.onBallCell = 0.4;
  2867. this.lastInfo = { x: 0, y: 0, rotation: 0 };
  2868. this.moveNum = 70;
  2869. this.rulerRate = 0.1;
  2870. this.ui = ui_D2Gan.createInstance();
  2871. this.changeSelfRod();
  2872. this.changeAIRod();
  2873. }
  2874. changeSelfRod() {
  2875. let index = DataMgr.getCurBallRod();
  2876. let data = cfgTable.ballrodData[index + 1];
  2877. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  2878. this.selfMySpine && this.selfMySpine.dispose();
  2879. this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img);
  2880. if (data.spine) {
  2881. this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img);
  2882. this.selfMySpine = new SpineMgr(data.spine, () => {
  2883. let xx = this.ui.selfEftRoot.width / 2;
  2884. let yy = this.ui.selfEftRoot.height / 2;
  2885. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  2886. let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject);
  2887. outSpine.rotation = -90;
  2888. });
  2889. }
  2890. }
  2891. changeAIRod() {
  2892. let length = Object.keys(cfgTable.ballrodData).length;
  2893. let rand = Math.floor(length * Math.random()) + 1;
  2894. let data = cfgTable.ballrodData[rand];
  2895. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  2896. this.aiMySpine && this.aiMySpine.dispose();
  2897. this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img);
  2898. if (data.spine) {
  2899. this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img);
  2900. this.aiMySpine = new SpineMgr(data.spine, () => {
  2901. let xx = this.ui.aiEftRoot.width / 2;
  2902. let yy = this.ui.aiEftRoot.height / 2;
  2903. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  2904. let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject);
  2905. outSpine.rotation = -90;
  2906. });
  2907. }
  2908. }
  2909. setGanLastInfo() {
  2910. this.lastInfo.rotation = this.ui.rotation;
  2911. this.lastInfo.x = this.ui.x;
  2912. this.lastInfo.y = this.ui.y;
  2913. }
  2914. rotateSelf(flag, isRuler = false) {
  2915. let angle;
  2916. flag = flag * this.offset;
  2917. if (xGame.common.d2World.isHelpLineOnBall) {
  2918. angle = flag * this.onBallCell;
  2919. }
  2920. else {
  2921. angle = flag * this.cell;
  2922. }
  2923. if (isRuler) {
  2924. angle *= this.rulerRate;
  2925. }
  2926. this.ui.rotation += angle;
  2927. xGame.common.d2World.getHelpLine();
  2928. }
  2929. checkDistance() {
  2930. let target = xGame.common.d2World.targetBall;
  2931. let root = xGame.common.d2World.rootBall;
  2932. if (target == null) {
  2933. return 1;
  2934. }
  2935. let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2);
  2936. if (dis <= 2500) {
  2937. return 5;
  2938. }
  2939. return 1;
  2940. }
  2941. rotDest(rot) {
  2942. this.ui.rotation = rot;
  2943. xGame.common.d2World.getHelpLine();
  2944. }
  2945. storagePower(powerNum) {
  2946. let pos = (powerNum / 100) * this.moveNum;
  2947. let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos;
  2948. let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos;
  2949. this.ui.x = this.lastInfo.x + xx;
  2950. this.ui.y = this.lastInfo.y + yy;
  2951. }
  2952. shoot() {
  2953. this.storagePower(0);
  2954. this.ui.visible = false;
  2955. }
  2956. destroySelf() {
  2957. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  2958. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  2959. this.selfMySpine && this.selfMySpine.dispose();
  2960. this.aiMySpine && this.aiMySpine.dispose();
  2961. this.lastInfo = null;
  2962. if (!this.ui.isDisposed) {
  2963. this.ui.removeFromParent();
  2964. this.ui.dispose();
  2965. }
  2966. }
  2967. }
  2968. class ui_HelpLine extends fgui.GComponent {
  2969. static createInstance() {
  2970. return (fgui.UIPackage.createObject("game", "HelpLine"));
  2971. }
  2972. onConstruct() {
  2973. this.n10 = (this.getChild("n10"));
  2974. this.rect = (this.getChild("rect"));
  2975. this.dir11 = (this.getChild("dir11"));
  2976. this.dir = (this.getChild("dir"));
  2977. this.rootDir = (this.getChild("rootDir"));
  2978. this.dirDot = (this.getChild("dirDot"));
  2979. }
  2980. }
  2981. ui_HelpLine.URL = "ui://isxx5ak7sdh33qs";
  2982. class D2HelpLine {
  2983. constructor() {
  2984. this.starX = 0;
  2985. this.starY = 0;
  2986. this.ui = ui_HelpLine.createInstance();
  2987. xGame.common.gameUI.ui.ballNode.addChild(this.ui);
  2988. this.starX = this.ui.rect.x;
  2989. this.starY = this.ui.rect.y;
  2990. }
  2991. shoot() {
  2992. this.ui.visible = false;
  2993. }
  2994. destroySelf() {
  2995. if (this.ui.isDisposed) {
  2996. this.ui.removeFromParent();
  2997. this.ui.dispose();
  2998. }
  2999. }
  3000. }
  3001. class D2World extends Laya.Script {
  3002. constructor() {
  3003. super();
  3004. this.ballArr = [];
  3005. this.openCheckStill = false;
  3006. this.checkArr = [];
  3007. this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 };
  3008. this.isHelpLineOnBall = false;
  3009. this.isOnSameLine = false;
  3010. this.reflectAngle = 0;
  3011. this.powerPercent = 0;
  3012. this.inHolesSpeed = [];
  3013. this.outDir = new Laya.Vector2();
  3014. this.rootDir = new Laya.Vector2();
  3015. this.aiLv = 0;
  3016. this.rootPos = new Laya.Vector2();
  3017. this.tempDir1 = new Laya.Vector2();
  3018. this.tempDir2 = new Laya.Vector2();
  3019. this.tempDir3 = new Laya.Vector2();
  3020. this.ballSize = 33;
  3021. this.destRot = 0;
  3022. }
  3023. initSelf() {
  3024. this.createBalls();
  3025. xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop);
  3026. xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop);
  3027. xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot);
  3028. xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot);
  3029. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  3030. }
  3031. setBorderRect() {
  3032. let ui = xGame.common.gameUI.ui;
  3033. let starX = ui.border.bar5.x + ui.border.bar5.width / 2;
  3034. let starY = ui.border.bar1.y + ui.border.bar1.height / 2;
  3035. let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width);
  3036. let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height);
  3037. this.borderRect.x = starX;
  3038. this.borderRect.y = starY;
  3039. this.borderRect.width = width;
  3040. this.borderRect.height = height;
  3041. }
  3042. resetGame() {
  3043. this.openCheckStill = false;
  3044. let temp;
  3045. for (let index = 0; index < this.ballArr.length; index++) {
  3046. temp = this.ballArr[index];
  3047. temp.destroySelf();
  3048. }
  3049. xGame.common.d3World.ballRoot.destroyChildren();
  3050. xGame.common.gameUI.ui.ballNode.removeChildren();
  3051. console.log("进入摧毁逻辑");
  3052. this.d2Gan.destroySelf();
  3053. this.d2HelpLine.destroySelf();
  3054. this.ballArr = [];
  3055. }
  3056. setD2Gan() {
  3057. let ballNode = this.rootBall.ui;
  3058. let d2Gan = new D2Gan();
  3059. this.d2Gan = d2Gan;
  3060. let ganNode = d2Gan.ui;
  3061. ballNode.addChild(ganNode);
  3062. ganNode.pivotX = ganNode.pivotX;
  3063. ganNode.pivotY = ganNode.pivotY;
  3064. ganNode.x = ganNode.myIcon.width / 2;
  3065. ganNode.y = this.rootBall.gameObj.width;
  3066. d2Gan.setGanLastInfo();
  3067. }
  3068. setHelpLine() {
  3069. let d2Help = new D2HelpLine();
  3070. this.d2HelpLine = d2Help;
  3071. }
  3072. createBalls() {
  3073. let cfg;
  3074. switch (xGame.common.gameMode) {
  3075. case GameMode.classic:
  3076. cfg = xGame.cfgMgr.getRandomClassicLevel();
  3077. break;
  3078. case GameMode.bigMove:
  3079. cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex);
  3080. break;
  3081. case GameMode.placeBall:
  3082. cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel);
  3083. break;
  3084. default:
  3085. break;
  3086. }
  3087. cfg = JSON.parse(JSON.stringify(cfg));
  3088. for (const key in cfg) {
  3089. if (cfg[key].value == 0) {
  3090. this.createRootBall(cfg[key]);
  3091. delete cfg[key];
  3092. break;
  3093. }
  3094. }
  3095. this.createOtherBalls(cfg);
  3096. }
  3097. createRootBall(data) {
  3098. let root = new D2Ball(true);
  3099. xGame.common.gameUI.ui.ballNode.displayObject.addChild(root);
  3100. this.rootBall = root.d2Src;
  3101. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3102. let d3BallSrc = d3Ball.getComponent(Ball);
  3103. xGame.common.d3World.rootBall = d3Ball;
  3104. xGame.common.d3World.rootBallSrc = d3BallSrc;
  3105. let xx = data.x;
  3106. let yy = data.y;
  3107. let numer = data.value;
  3108. xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy);
  3109. this.rootBall.initSelf(numer, xx, yy, d3Ball);
  3110. this.ballArr.push(this.rootBall);
  3111. this.setD2Gan();
  3112. this.setHelpLine();
  3113. }
  3114. createOtherBalls(cfg) {
  3115. let temp;
  3116. let src;
  3117. let data;
  3118. for (const key in cfg) {
  3119. data = cfg[key];
  3120. temp = new D2Ball();
  3121. xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp);
  3122. src = temp.d2Src;
  3123. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3124. src.initSelf(data.value, data.x, data.y, d3Ball);
  3125. this.ballArr.push(src);
  3126. }
  3127. }
  3128. shoot(percent) {
  3129. this.powerPercent = percent;
  3130. this.openCheckStill = true;
  3131. let d2Angle = this.d2Gan.ui.rotation;
  3132. this.rootBall.setSpeed(percent, d2Angle);
  3133. this.clearBallAllEft();
  3134. this.changePlayerView();
  3135. }
  3136. onUpdate() {
  3137. if (!this.openCheckStill)
  3138. return;
  3139. this.checkStill();
  3140. }
  3141. checkStill() {
  3142. for (let index = 0; index < this.ballArr.length; index++) {
  3143. if (!this.ballArr[index].isStill()) {
  3144. return;
  3145. }
  3146. }
  3147. xGame.eventMgr.event(ALL_BALL_STOP);
  3148. }
  3149. allBallStop() {
  3150. this.openCheckStill = false;
  3151. xGame.common.recoverCameraView();
  3152. }
  3153. waitShoot() {
  3154. if (!this.d2Gan.ui.isDisposed) {
  3155. this.d2Gan.ui.visible = true;
  3156. }
  3157. if (!this.d2HelpLine.ui.isDisposed) {
  3158. this.d2HelpLine.ui.visible = true;
  3159. }
  3160. this.clearBallAllEft();
  3161. this.showBallRightEft();
  3162. this.getHelpLine();
  3163. this.inHolesSpeed = [];
  3164. this.selectOneBall();
  3165. }
  3166. _getAllBallArr() {
  3167. let arr = this.ballArr;
  3168. let outArr = [];
  3169. for (let index = 0; index < arr.length; index++) {
  3170. if (arr[index] instanceof D2RootBallSrc)
  3171. continue;
  3172. if (arr[index].ballFunc == "ice")
  3173. continue;
  3174. if (arr[index].destroyed)
  3175. continue;
  3176. outArr.push(arr[index]);
  3177. }
  3178. return outArr;
  3179. }
  3180. _getBlackObj() {
  3181. let arr = this.ballArr;
  3182. for (let index = 0; index < arr.length; index++) {
  3183. if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) {
  3184. return arr[index];
  3185. }
  3186. }
  3187. }
  3188. selectOneBall() {
  3189. let all = this._getAllBallArr();
  3190. let target;
  3191. switch (xGame.common.gameMode) {
  3192. case GameMode.classic:
  3193. if (xGame.common.gameMgr.selfTurn) {
  3194. let self = xGame.common.gameMgr.selfBallArr;
  3195. let black = this._getBlackObj();
  3196. if (xGame.common.gameMgr.ensureBallType) {
  3197. if (self.length > 0) {
  3198. let out = [];
  3199. for (let j = 0; j < all.length; j++) {
  3200. if (self.indexOf(all[j].number) > -1) {
  3201. out.push(all[j]);
  3202. }
  3203. }
  3204. target = this.selectBestEnterOne(out);
  3205. }
  3206. else {
  3207. target = this.selectBestEnterOne([black]);
  3208. }
  3209. }
  3210. else {
  3211. target = this.selectBestEnterOne(all);
  3212. }
  3213. }
  3214. else {
  3215. target = this.selectBestEnterOne(all);
  3216. }
  3217. break;
  3218. case GameMode.bigMove:
  3219. target = this.selectBestEnterOne(all);
  3220. break;
  3221. case GameMode.placeBall:
  3222. if (all.length > 0) {
  3223. target = this.selectBestEnterOne(all);
  3224. }
  3225. break;
  3226. default:
  3227. break;
  3228. }
  3229. if (target && !target.destroyed && target.onClick) {
  3230. target.onClick(0, true);
  3231. let num = -200 + xGame.common.randomNum(0, 400);
  3232. num /= 150;
  3233. if (xGame.common.longHelpLine) {
  3234. num = 0;
  3235. }
  3236. this.destRot += num;
  3237. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  3238. }
  3239. }
  3240. removeOneBall(ball) {
  3241. for (let index = 0; index < this.ballArr.length; index++) {
  3242. if (this.ballArr[index].id == ball.id) {
  3243. this.ballArr.splice(index, 1);
  3244. break;
  3245. }
  3246. }
  3247. }
  3248. getHelpLine() {
  3249. this.d2HelpLine.ui.dirDot.visible = false;
  3250. this.isOnSameLine = false;
  3251. let startX = this.rootBall.gameObj.x;
  3252. let startY = this.rootBall.gameObj.y;
  3253. let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation);
  3254. if (dis == null) {
  3255. this.d2HelpLine.ui.visible = false;
  3256. console.error("辅助线异常");
  3257. return;
  3258. }
  3259. this.d2HelpLine.ui.visible = true;
  3260. let angle = this.d2Gan.ui.rotation;
  3261. let radius = 16.5;
  3262. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3263. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3264. let colliObj = xGame.common.isBlock(startX, startY, disX, disY);
  3265. if (colliObj == null) {
  3266. this.getColliPos(disX, disY, radius, angle);
  3267. xGame.common.d2World.isHelpLineOnBall = false;
  3268. this.targetBall = null;
  3269. this.reflectAngle = 0;
  3270. this.showBallWrongEft();
  3271. }
  3272. else {
  3273. let target = colliObj.src;
  3274. let radius = 16.5;
  3275. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3276. dis1 = Math.sqrt(dis1);
  3277. let realDis = colliObj.disHon - dis1;
  3278. let dir = colliObj.dir;
  3279. let xx = startX + dir.x * realDis;
  3280. let yy = startY + dir.y * realDis;
  3281. this.getColliPos(xx, yy, radius, angle);
  3282. let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180;
  3283. if (Math.abs(reflectAngle - angle) <= 0.02) {
  3284. let offset = xGame.common.rodOffest;
  3285. if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1)
  3286. this.isOnSameLine = true;
  3287. }
  3288. this.getRootDirLine(reflectAngle, angle, xx, yy, target);
  3289. xGame.common.d2World.isHelpLineOnBall = true;
  3290. this.targetBall = target;
  3291. this.reflectAngle = reflectAngle;
  3292. this.showBallWrongEft();
  3293. if (xGame.common.longHelpLine) {
  3294. this.delayReflectLine(target, reflectAngle);
  3295. }
  3296. }
  3297. }
  3298. getBorderDot(startX, startY, angle) {
  3299. let radius = 17;
  3300. let distance;
  3301. let isDone;
  3302. distance = -(this.borderRect.y - startY + radius) / Math.cos(angle * Math.PI / 180);
  3303. isDone = this.judgeUpDown(distance, angle, startX);
  3304. if (isDone != null) {
  3305. return isDone;
  3306. }
  3307. distance = -(this.borderRect.y + this.borderRect.height - startY - radius) / Math.cos(angle * Math.PI / 180);
  3308. isDone = this.judgeUpDown(distance, angle, startX);
  3309. if (isDone != null) {
  3310. return isDone;
  3311. }
  3312. distance = (this.borderRect.x - startX + radius) / Math.sin(angle * Math.PI / 180);
  3313. isDone = this.judgeLeftRight(distance, angle, startY);
  3314. if (isDone != null) {
  3315. return isDone;
  3316. }
  3317. distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180);
  3318. isDone = this.judgeLeftRight(distance, angle, startY);
  3319. if (isDone != null) {
  3320. return isDone;
  3321. }
  3322. }
  3323. judgeUpDown(distance, angle, startX) {
  3324. let flag = Math.sin(angle * Math.PI / 180);
  3325. let temp = startX + distance * Math.sin(angle * Math.PI / 180);
  3326. if (distance >= 0) {
  3327. if (flag > 0) {
  3328. if (temp < this.borderRect.x + this.borderRect.width) {
  3329. return distance;
  3330. }
  3331. }
  3332. else {
  3333. if (temp > this.borderRect.x) {
  3334. return distance;
  3335. }
  3336. }
  3337. }
  3338. }
  3339. judgeLeftRight(distance, angle, starY) {
  3340. let flag = -Math.cos(angle * Math.PI / 180);
  3341. let temp = starY + distance * -Math.cos(angle * Math.PI / 180);
  3342. if (distance >= 0) {
  3343. if (flag > 0) {
  3344. if (temp < this.borderRect.y + this.borderRect.height) {
  3345. return distance;
  3346. }
  3347. }
  3348. else {
  3349. if (temp > this.borderRect.y) {
  3350. return distance;
  3351. }
  3352. }
  3353. }
  3354. }
  3355. clearBallAllEft() {
  3356. let temp;
  3357. for (let index = 0; index < this.ballArr.length; index++) {
  3358. temp = this.ballArr[index];
  3359. temp.clearBallEft();
  3360. }
  3361. }
  3362. showBallRightEft() {
  3363. let gameMgr = xGame.common.gameMgr;
  3364. let temp;
  3365. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3366. if (targetArr.length <= 0)
  3367. return;
  3368. for (let index = 0; index < this.ballArr.length; index++) {
  3369. temp = this.ballArr[index];
  3370. if (targetArr.indexOf(temp.number) > -1) {
  3371. temp.showRightEft();
  3372. }
  3373. }
  3374. }
  3375. showBallWrongEft() {
  3376. let gameMgr = xGame.common.gameMgr;
  3377. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3378. if (targetArr.length <= 0)
  3379. return;
  3380. let temp;
  3381. for (let index = 0; index < this.ballArr.length; index++) {
  3382. temp = this.ballArr[index];
  3383. if (this.targetBall && this.targetBall.number == temp.number) {
  3384. if (targetArr.indexOf(temp.number) <= -1) {
  3385. temp.showWrongEft();
  3386. }
  3387. else {
  3388. temp.clearBallWrongEft();
  3389. }
  3390. }
  3391. else {
  3392. temp.clearBallWrongEft();
  3393. }
  3394. }
  3395. }
  3396. getColliPos(x, y, radius, angle) {
  3397. this.d2HelpLine.ui.x = x;
  3398. this.d2HelpLine.ui.y = y;
  3399. let dirX = x - this.rootBall.gameObj.x;
  3400. let dirY = y - this.rootBall.gameObj.y;
  3401. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3402. if (rectH <= 0)
  3403. rectH = 0;
  3404. this.d2HelpLine.ui.rect.height = 0;
  3405. this.d2HelpLine.ui.rect.height = rectH;
  3406. this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY);
  3407. if (rectH < this.rootBall.gameObj.width) {
  3408. this.d2HelpLine.ui.rect.visible = false;
  3409. }
  3410. else {
  3411. this.d2HelpLine.ui.rect.visible = true;
  3412. }
  3413. this.d2HelpLine.ui.dir.visible = false;
  3414. this.d2HelpLine.ui.rootDir.visible = false;
  3415. }
  3416. getReflectLine(x, y, radius, target) {
  3417. this.d2HelpLine.ui.dir.visible = true;
  3418. let dirX = target.x - x;
  3419. let dirY = target.y - y;
  3420. let angle = xGame.common.getfguiRotation(dirX, dirY) + 180;
  3421. this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX;
  3422. this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY;
  3423. this.d2HelpLine.ui.dir.height = 48;
  3424. this.d2HelpLine.ui.dir.rotation = angle;
  3425. this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180);
  3426. this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180);
  3427. return angle;
  3428. }
  3429. getRootDirLine(angle, rodAngle, xx, yy, target) {
  3430. let rtX = xGame.common.d2World.rootBall.gameObj.x;
  3431. let rtY = xGame.common.d2World.rootBall.gameObj.y;
  3432. let targetX = target.gameObj.x;
  3433. let targetY = target.gameObj.y;
  3434. this.outDir.setValue(targetX - xx, targetY - yy);
  3435. this.rootDir.setValue(rtX - xx, rtY - yy);
  3436. let ver = Math.PI / 2;
  3437. let sin = Math.sin(ver);
  3438. let cos = Math.cos(ver);
  3439. let outX = this.outDir.x * cos - this.outDir.y * sin;
  3440. let outY = this.outDir.x * sin + this.outDir.y * cos;
  3441. this.outDir.setValue(outX, outY);
  3442. Laya.Vector2.normalize(this.rootDir, this.rootDir);
  3443. Laya.Vector2.normalize(this.outDir, this.outDir);
  3444. let result = Laya.Vector2.dot(this.rootDir, this.outDir);
  3445. if (Math.abs(result) <= 0.08) {
  3446. this.d2HelpLine.ui.rootDir.visible = false;
  3447. return;
  3448. }
  3449. if (result > 0) {
  3450. angle += 90;
  3451. }
  3452. else if (result < 0) {
  3453. angle -= 90;
  3454. }
  3455. this.d2HelpLine.ui.rootDir.visible = true;
  3456. this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX;
  3457. this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY;
  3458. this.d2HelpLine.ui.rootDir.rotation = angle;
  3459. }
  3460. delayReflectLine(obj, angle) {
  3461. if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) {
  3462. return;
  3463. }
  3464. this.isOnSameLine = false;
  3465. let startX = obj.gameObj.x;
  3466. let startY = obj.gameObj.y;
  3467. let dis = this.getBorderDot(startX, startY, angle);
  3468. if (dis == null) {
  3469. this.d2HelpLine.ui.dirDot.visible = false;
  3470. return;
  3471. }
  3472. this.d2HelpLine.ui.visible = true;
  3473. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3474. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3475. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, obj);
  3476. if (colliObj == null) {
  3477. this.setDelayLine(disX, disY, obj, angle);
  3478. }
  3479. else {
  3480. let radius = 16;
  3481. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3482. dis1 = Math.sqrt(dis1);
  3483. let realDis = colliObj.disHon - dis1;
  3484. let dir = colliObj.dir;
  3485. let xx = startX + dir.x * realDis;
  3486. let yy = startY + dir.y * realDis;
  3487. this.setDelayLine(xx, yy, obj, angle);
  3488. }
  3489. }
  3490. setDelayLine(x, y, obj, angle) {
  3491. let dirX = x - obj.gameObj.x;
  3492. let dirY = y - obj.gameObj.y;
  3493. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3494. if (rectH <= 0)
  3495. rectH = 0;
  3496. this.d2HelpLine.ui.dir.height = rectH;
  3497. this.d2HelpLine.ui.dirDot.visible = true;
  3498. this.d2HelpLine.ui.dirDot.x = 17;
  3499. this.d2HelpLine.ui.dirDot.y = 17;
  3500. this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180);
  3501. ;
  3502. this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180);
  3503. }
  3504. changePlayerView() {
  3505. if (Math.random() >= 0.7)
  3506. return;
  3507. if (!this.targetBall) {
  3508. return;
  3509. }
  3510. if (!xGame.common.gameMgr.selfTurn)
  3511. return;
  3512. switch (xGame.common.gameMode) {
  3513. case GameMode.classic:
  3514. if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) {
  3515. if (this.targetBall.number != 8) {
  3516. return;
  3517. }
  3518. }
  3519. break;
  3520. case GameMode.bigMove:
  3521. return;
  3522. case GameMode.placeBall:
  3523. break;
  3524. default:
  3525. break;
  3526. }
  3527. let startX = this.targetBall.gameObj.x;
  3528. let startY = this.targetBall.gameObj.y;
  3529. let angle = this.reflectAngle;
  3530. let dis = this.getBorderDot(startX, startY, angle);
  3531. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3532. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3533. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall);
  3534. if (colliObj) {
  3535. return;
  3536. }
  3537. let offset = 40;
  3538. let posObj = xGame.common.gameMgr.posObj;
  3539. let temp;
  3540. let radius;
  3541. let tarX, tarY;
  3542. for (const key in posObj) {
  3543. temp = posObj[key];
  3544. radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5);
  3545. tarX = startX + radius * Math.sin(angle * Math.PI / 180);
  3546. tarY = startY + radius * -Math.cos(angle * Math.PI / 180);
  3547. if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) {
  3548. xGame.common.showOneCamera("angle" + key);
  3549. xGame.common.gameUI.ui.d2Node.alpha = 0;
  3550. Laya.physicsTimer.scale = 0.7;
  3551. break;
  3552. }
  3553. }
  3554. }
  3555. selectBestEnterOne(arr) {
  3556. this.aiLv = xGame.tools.random(1, 11);
  3557. this.aiLv = 10;
  3558. this.wBall = xGame.common.d2World.rootBall;
  3559. this.rootPos.x = this.wBall.gameObj.x;
  3560. this.rootPos.y = this.wBall.gameObj.y;
  3561. this.initHoleBall(arr);
  3562. return this.selectBall();
  3563. }
  3564. selectBall() {
  3565. let ball = null;
  3566. this.destRot = 0;
  3567. let ai = 110 - this.aiLv * 10;
  3568. let mis = xGame.tools.random(-ai, ai) * 0.005;
  3569. let score = false;
  3570. if (this.scoreBall.length < 1) {
  3571. if (this.lineBall.length < 1) {
  3572. for (let i = 0; i < this.kickBall.length; i++) {
  3573. let list = [];
  3574. let bo = this.kickBall[i];
  3575. let bobj = bo.gameObj;
  3576. let rect = xGame.common.d2World.borderRect;
  3577. let mobj = this.wBall.gameObj;
  3578. let minb = bobj.y - rect.y - 20;
  3579. let minw = mobj.y - rect.y - 50;
  3580. if (minb > 0 && minw > 0) {
  3581. let dlenx = 0;
  3582. let dleny = mobj.y - rect.y;
  3583. let spx = mobj.x;
  3584. let spy = rect.y - dleny;
  3585. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3586. }
  3587. minb = rect.y + rect.height - bobj.y - 20;
  3588. minw = rect.y + rect.height - mobj.y - 50;
  3589. if (minb > 0 && minw > 0) {
  3590. let dlenx = 0;
  3591. let dleny = rect.y + rect.height - mobj.y;
  3592. let spx = mobj.x;
  3593. let spy = rect.y + rect.height + dleny;
  3594. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3595. }
  3596. minb = bobj.x - rect.x - 20;
  3597. minw = mobj.x - rect.x - 50;
  3598. if (minb > 0 && minw > 0) {
  3599. let dlenx = mobj.x - rect.x;
  3600. let dleny = 0;
  3601. let spx = rect.x - dlenx;
  3602. let spy = mobj.y;
  3603. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3604. }
  3605. minb = rect.x + rect.width - bobj.x - 20;
  3606. minw = rect.x + rect.width - mobj.x - 50;
  3607. if (minb > 0 && minw > 0) {
  3608. let dlenx = rect.x + rect.width - mobj.x;
  3609. let dleny = 0;
  3610. let spx = rect.x + rect.width + dlenx;
  3611. let spy = mobj.y;
  3612. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3613. }
  3614. list.sort(function (a, b) {
  3615. return a.order - b.order;
  3616. });
  3617. for (let i = 0; i < list.length; i++) {
  3618. let data = list[i];
  3619. let mx = mobj.x - bobj.x;
  3620. let my = mobj.y - bobj.y;
  3621. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  3622. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  3623. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3624. if (num > 1)
  3625. num = 1;
  3626. let cos = Math.acos(num);
  3627. if (cos > 1.57)
  3628. cos = 1.57;
  3629. else if (cos < 0.01)
  3630. cos = 0.01;
  3631. let tan = Math.tan(cos);
  3632. let dx = tan * data.dleny;
  3633. let dy = tan * data.dlenx;
  3634. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  3635. if (Math.abs(bx - 667) < 40)
  3636. continue;
  3637. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  3638. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  3639. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  3640. this.forceMax = dis * 0.08;
  3641. this.destRot += mis * 0.1;
  3642. this.setKick(bx, by);
  3643. return true;
  3644. }
  3645. }
  3646. }
  3647. }
  3648. else {
  3649. ball = xGame.common.getRandArrEle(this.lineBall);
  3650. }
  3651. }
  3652. else {
  3653. for (let i = 0; i < this.scoreBall.length; i++) {
  3654. if (i < this.scoreBall.length - 1) {
  3655. let rand = 70 + this.aiLv * 10 + i * 10;
  3656. if (xGame.tools.random(0, 100) < rand) {
  3657. ball = this.scoreBall[i];
  3658. break;
  3659. }
  3660. }
  3661. else {
  3662. ball = this.scoreBall[i];
  3663. break;
  3664. }
  3665. }
  3666. score = true;
  3667. this.selectNum++;
  3668. }
  3669. if (!ball)
  3670. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  3671. let dx = ball.gameObj.x;
  3672. let dy = ball.gameObj.y;
  3673. let kickAngle = 0;
  3674. if (score) {
  3675. dx = ball.kickPos.x;
  3676. dy = ball.kickPos.y;
  3677. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  3678. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  3679. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  3680. if (adot > 1)
  3681. adot = 1;
  3682. kickAngle = Math.acos(adot) * 57.3;
  3683. if (kickAngle > 45) {
  3684. let kdx = ball.kickPos.x - ball.gameObj.x;
  3685. let kdy = ball.kickPos.y - ball.gameObj.y;
  3686. dx = ball.kickPos.x - kdx * mis * 0.3;
  3687. dy = ball.kickPos.y - kdy * mis * 0.3;
  3688. }
  3689. else
  3690. this.destRot += mis;
  3691. }
  3692. else if (ball.poleAngle != 0) {
  3693. this.destRot += ball.poleAngle;
  3694. }
  3695. if (xGame.common.gameMode == 0) {
  3696. let af = kickAngle * 0.08;
  3697. this.forceMax = ball.hard * 0.1 + af * af;
  3698. }
  3699. this.setKick(dx, dy);
  3700. return ball;
  3701. }
  3702. initHoleBall(arr) {
  3703. this.kickBall = [];
  3704. this.lineBall = [];
  3705. this.scoreBall = [];
  3706. this.holeBall = [];
  3707. this.selectNum = 0;
  3708. this.forceNum = 0;
  3709. this.forceMax = 0;
  3710. this.turnNum = 0;
  3711. let list = arr;
  3712. let holes = xGame.common.gameMgr.holePosList;
  3713. let self = xGame.common.aiPlayer;
  3714. for (let i = 0; i < list.length; i++) {
  3715. let obj = list[i];
  3716. if (!obj)
  3717. continue;
  3718. obj.kickPos.x = 0;
  3719. obj.kickPos.y = 0;
  3720. obj.poleAngle = 0;
  3721. obj.hard = 0;
  3722. obj.borderDis = 0;
  3723. obj.kickAngle = 180;
  3724. let b = obj.gameObj;
  3725. let wbp = this.rootPos;
  3726. let bx = wbp.x - b.x;
  3727. let by = wbp.y - b.y;
  3728. obj.borderDis = xGame.tools.random(0, 100);
  3729. this.kickBall.push(obj);
  3730. if (!this.isLine(wbp, obj))
  3731. continue;
  3732. obj.kickAngle = xGame.tools.random(90, 180);
  3733. obj.kickPos.x = b.x;
  3734. obj.kickPos.y = b.y;
  3735. this.lineBall.push(obj);
  3736. let minDis = 999999;
  3737. let hole = false;
  3738. for (let j = 0; j < holes.length; j++) {
  3739. let hp = holes[j];
  3740. if (bx >= 0 && hp.x > b.x + 100)
  3741. continue;
  3742. if (bx <= 0 && hp.x < b.x - 100)
  3743. continue;
  3744. if (by < -10 && hp.y < wbp.y)
  3745. continue;
  3746. if (by > 10 && hp.y > wbp.y)
  3747. continue;
  3748. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  3749. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  3750. if (dis < minDis) {
  3751. let dx = b.x - this.tempDir1.x * this.ballSize;
  3752. let dy = b.y - this.tempDir1.y * this.ballSize;
  3753. this.tempDir3.x = this.tempDir1.x;
  3754. this.tempDir3.y = this.tempDir1.y;
  3755. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  3756. obj.kickPos.x = dx;
  3757. obj.kickPos.y = dy;
  3758. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  3759. if (num > 1)
  3760. num = 1;
  3761. obj.kickAngle = Math.acos(num) * 57.3;
  3762. if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2)
  3763. dis = dis * 2;
  3764. if (Math.abs(hp.x - 600) < 100)
  3765. dis += 50;
  3766. obj.hard = dis + obj.kickAngle * 3;
  3767. hole = true;
  3768. }
  3769. }
  3770. }
  3771. }
  3772. if (hole) {
  3773. this.scoreBall.push(obj);
  3774. this.holeBall.push(obj);
  3775. }
  3776. }
  3777. this.scoreBall.sort(function (a, b) {
  3778. return a.hard - b.hard;
  3779. });
  3780. this.holeBall.sort(function (a, b) {
  3781. return a.kickAngle - b.kickAngle;
  3782. });
  3783. this.kickBall.sort(function (a, b) {
  3784. return a.borderDis - b.borderDis;
  3785. });
  3786. }
  3787. isBlock(bn, bx, by, hx, hy, dn = -1) {
  3788. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  3789. let balls = xGame.common.d2World.ballArr;
  3790. let max = xGame.tools.getDis(hx, hy, bx, by);
  3791. for (let index = 0; index < balls.length; index++) {
  3792. let obj = balls[index];
  3793. if (obj.number == 0)
  3794. continue;
  3795. if (obj.number == bn || obj.number == dn)
  3796. continue;
  3797. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  3798. if (dis * dis > max)
  3799. continue;
  3800. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  3801. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3802. if (num > 1)
  3803. num = 1;
  3804. if (num < 0)
  3805. continue;
  3806. let gap = Math.sin(Math.acos(num)) * dis;
  3807. if (gap < this.ballSize)
  3808. return true;
  3809. }
  3810. return false;
  3811. }
  3812. isLine(xy, ball) {
  3813. let bx = xy.x;
  3814. let by = xy.y;
  3815. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  3816. let dis = ball.getDestDis(xy);
  3817. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  3818. let sin = Math.sin(angle);
  3819. let cos = Math.cos(angle);
  3820. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  3821. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  3822. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  3823. let dx = bx + this.tempDir2.x * dis;
  3824. let dy = by + this.tempDir2.y * dis;
  3825. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  3826. sin = Math.sin(-angle);
  3827. cos = Math.cos(-angle);
  3828. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  3829. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  3830. dx = bx + this.tempDir2.x * dis;
  3831. dy = by + this.tempDir2.y * dis;
  3832. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  3833. if (isr && isl)
  3834. return false;
  3835. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  3836. }
  3837. return true;
  3838. }
  3839. setKick(dx, dy) {
  3840. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  3841. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  3842. this.tempDir1.x = 0;
  3843. this.tempDir1.y = 1;
  3844. this.tempDir2.y = -this.tempDir2.y;
  3845. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3846. if (num > 1)
  3847. num = 1;
  3848. let rot = Math.acos(num) * 57.3;
  3849. if (this.tempDir2.x < 0)
  3850. rot = 360 - rot;
  3851. this.destRot += rot;
  3852. }
  3853. }
  3854. class ui_UIGame extends fgui.GComponent {
  3855. static createInstance() {
  3856. return (fgui.UIPackage.createObject("game", "UIGame"));
  3857. }
  3858. onConstruct() {
  3859. this.c1 = this.getController("c1");
  3860. this.d3Root = (this.getChild("d3Root"));
  3861. this.clickNode = (this.getChild("clickNode"));
  3862. this.d2Root = (this.getChild("d2Root"));
  3863. this.topNode = (this.getChild("topNode"));
  3864. this.n72 = (this.getChild("n72"));
  3865. this.n40 = (this.getChild("n40"));
  3866. this.rulerNode = (this.getChild("rulerNode"));
  3867. this.rulerClickNode = (this.getChild("rulerClickNode"));
  3868. this.n50 = (this.getChild("n50"));
  3869. this.keduNode = (this.getChild("keduNode"));
  3870. this.powerTxt = (this.getChild("powerTxt"));
  3871. this.powerNode = (this.getChild("powerNode"));
  3872. this.colorNode = (this.getChild("colorNode"));
  3873. this.powerEft = (this.getChild("powerEft"));
  3874. this.myPowerNode = (this.getChild("myPowerNode"));
  3875. this.ganNode = (this.getChild("ganNode"));
  3876. this.rodMethodNode = (this.getChild("rodMethodNode"));
  3877. this.placeChallengeNode = (this.getChild("placeChallengeNode"));
  3878. this.placeNormalNode = (this.getChild("placeNormalNode"));
  3879. this.skillRod = (this.getChild("skillRod"));
  3880. this.border = (this.getChild("border"));
  3881. this.bigSkillNode = (this.getChild("bigSkillNode"));
  3882. this.classicWorldsNode = (this.getChild("classicWorldsNode"));
  3883. this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode"));
  3884. this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode"));
  3885. this.awardSpineNode = (this.getChild("awardSpineNode"));
  3886. this.guanyuNode = (this.getChild("guanyuNode"));
  3887. this.helpBtn = (this.getChild("helpBtn"));
  3888. this.wordsBtn = (this.getChild("wordsBtn"));
  3889. this.aiWordsBtn = (this.getChild("aiWordsBtn"));
  3890. this.returnBtn = (this.getChild("returnBtn"));
  3891. this.ballNode = (this.getChild("ballNode"));
  3892. this.whiteAni = (this.getChild("whiteAni"));
  3893. this.blackAni = (this.getChild("blackAni"));
  3894. this.selfTurn = (this.getChild("selfTurn"));
  3895. this.aiTurn = (this.getChild("aiTurn"));
  3896. this.deskNode = (this.getChild("deskNode"));
  3897. this.moveNode = (this.getChild("moveNode"));
  3898. this.selfTalk = (this.getChild("selfTalk"));
  3899. this.aiTalk = (this.getChild("aiTalk"));
  3900. this.d2Node = (this.getChild("d2Node"));
  3901. this.snowNode = (this.getChild("snowNode"));
  3902. this.guide2 = (this.getChild("guide2"));
  3903. this.guide1 = (this.getChild("guide1"));
  3904. this.guide3 = (this.getChild("guide3"));
  3905. this.guideNode = (this.getChild("guideNode"));
  3906. }
  3907. }
  3908. ui_UIGame.URL = "ui://isxx5ak7kt443qg";
  3909. class ui_UIGameEnd extends fgui.GComponent {
  3910. static createInstance() {
  3911. return (fgui.UIPackage.createObject("game", "UIGameEnd"));
  3912. }
  3913. onConstruct() {
  3914. this.c1 = this.getController("c1");
  3915. this.n22 = (this.getChild("n22"));
  3916. this.n2 = (this.getChild("n2"));
  3917. this.n52 = (this.getChild("n52"));
  3918. this.n53 = (this.getChild("n53"));
  3919. this.coinNode = (this.getChild("coinNode"));
  3920. this.closeNode = (this.getChild("closeNode"));
  3921. this.moneyNode = (this.getChild("moneyNode"));
  3922. this.secretary = (this.getChild("secretary"));
  3923. this.n27 = (this.getChild("n27"));
  3924. this.n29 = (this.getChild("n29"));
  3925. this.talkNode = (this.getChild("talkNode"));
  3926. this.n38 = (this.getChild("n38"));
  3927. this.n39 = (this.getChild("n39"));
  3928. this.n40 = (this.getChild("n40"));
  3929. this.starNumNode = (this.getChild("starNumNode"));
  3930. this.awardNode = (this.getChild("awardNode"));
  3931. this.n47 = (this.getChild("n47"));
  3932. this.conditionNode = (this.getChild("conditionNode"));
  3933. this.isGetAward = (this.getChild("isGetAward"));
  3934. this.leftBtn = (this.getChild("leftBtn"));
  3935. this.rightBtn = (this.getChild("rightBtn"));
  3936. this.btnNode = (this.getChild("btnNode"));
  3937. }
  3938. }
  3939. ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3";
  3940. class ui_UIAddCoin extends fgui.GComponent {
  3941. static createInstance() {
  3942. return (fgui.UIPackage.createObject("game", "UIAddCoin"));
  3943. }
  3944. onConstruct() {
  3945. this.n11 = (this.getChild("n11"));
  3946. this.myNode = (this.getChild("myNode"));
  3947. this.t0 = this.getTransition("t0");
  3948. }
  3949. }
  3950. ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs";
  3951. class UIAddCoin extends UIBase {
  3952. constructor() {
  3953. super();
  3954. this.coinNum = 2000;
  3955. }
  3956. onConstructor() {
  3957. this.ui = ui_UIAddCoin.createInstance();
  3958. this.contentPane = this.ui;
  3959. this.isEject = false;
  3960. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  3961. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  3962. }
  3963. show() {
  3964. super.show();
  3965. this.ui.t0.play();
  3966. }
  3967. videoAddCoin() {
  3968. Moyu.showVideoAd(() => {
  3969. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  3970. this.hide();
  3971. }, EAdType.addFailCoin);
  3972. }
  3973. }
  3974. UIAddCoin.uiName = "UIAddCoin";
  3975. class ui_UIInvitation extends fgui.GComponent {
  3976. static createInstance() {
  3977. return (fgui.UIPackage.createObject("game", "UIInvitation"));
  3978. }
  3979. onConstruct() {
  3980. this.n14 = (this.getChild("n14"));
  3981. this.myNode = (this.getChild("myNode"));
  3982. this.t0 = this.getTransition("t0");
  3983. }
  3984. }
  3985. ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r";
  3986. class UIInvitation extends UIBase {
  3987. constructor() {
  3988. super();
  3989. }
  3990. onConstructor() {
  3991. this.ui = ui_UIInvitation.createInstance();
  3992. this.contentPane = this.ui;
  3993. this.isEject = false;
  3994. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  3995. }
  3996. show() {
  3997. super.show();
  3998. }
  3999. enterGame() {
  4000. xGame.common.gameMode = GameMode.classic;
  4001. DataMgr.setChallengeTimes(1);
  4002. xGame.common.passAwardCoin = 2000;
  4003. let need = xGame.common.classicNiceNeddCoin;
  4004. if (DataMgr.coinEnough(need)) {
  4005. DataMgr.setCoin(-need);
  4006. xGame.eventMgr.event(RESTART_GAME, true);
  4007. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  4008. }
  4009. else {
  4010. xGame.eventMgr.event(RESTART_GAME, true);
  4011. }
  4012. this.hide();
  4013. }
  4014. hide() {
  4015. super.hide();
  4016. }
  4017. }
  4018. UIInvitation.uiName = "UIInvitation";
  4019. class ui_UIMain extends fgui.GComponent {
  4020. static createInstance() {
  4021. return (fgui.UIPackage.createObject("game", "UIMain"));
  4022. }
  4023. onConstruct() {
  4024. this.n47 = (this.getChild("n47"));
  4025. this.n10 = (this.getChild("n10"));
  4026. this.secretary = (this.getChild("secretary"));
  4027. this.n33 = (this.getChild("n33"));
  4028. this.shopBtn = (this.getChild("shopBtn"));
  4029. this.moneyNode = (this.getChild("moneyNode"));
  4030. this.headNode = (this.getChild("headNode"));
  4031. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4032. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4033. this.classicBtn = (this.getChild("classicBtn"));
  4034. this.weeklyBtn = (this.getChild("weeklyBtn"));
  4035. this.globalBtn = (this.getChild("globalBtn"));
  4036. this.n44 = (this.getChild("n44"));
  4037. this.signBtn = (this.getChild("signBtn"));
  4038. this.drawBtn = (this.getChild("drawBtn"));
  4039. this.settingNode = (this.getChild("settingNode"));
  4040. this.n45 = (this.getChild("n45"));
  4041. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4042. this.rankBtn = (this.getChild("rankBtn"));
  4043. this.n46 = (this.getChild("n46"));
  4044. this.liucheng1 = (this.getChild("liucheng1"));
  4045. this.rightBtn = (this.getChild("rightBtn"));
  4046. this.n75 = (this.getChild("n75"));
  4047. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4048. this.liucheng2 = (this.getChild("liucheng2"));
  4049. this.guideBtn = (this.getChild("guideBtn"));
  4050. this.n73 = (this.getChild("n73"));
  4051. this.wordsNode = (this.getChild("wordsNode"));
  4052. this.enterGuide = (this.getChild("enterGuide"));
  4053. this.talkNode = (this.getChild("talkNode"));
  4054. this.n83 = (this.getChild("n83"));
  4055. this.n84 = (this.getChild("n84"));
  4056. }
  4057. }
  4058. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4059. class ui_UIMoyu extends fgui.GComponent {
  4060. static createInstance() {
  4061. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4062. }
  4063. onConstruct() {
  4064. this.ageTip = (this.getChild("ageTip"));
  4065. this.mainBg = (this.getChild("mainBg"));
  4066. this.xyNode = (this.getChild("xyNode"));
  4067. this.rnNode = (this.getChild("rnNode"));
  4068. this.fcmNode = (this.getChild("fcmNode"));
  4069. this.ageNode = (this.getChild("ageNode"));
  4070. this.tipNode = (this.getChild("tipNode"));
  4071. this.msgNode = (this.getChild("msgNode"));
  4072. }
  4073. }
  4074. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4075. class MoyuMgr {
  4076. static initMoyu() {
  4077. this.moyuView = new MoyuView();
  4078. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4079. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4080. this.moyuView.ui.displayObject.zOrder = 1000;
  4081. this.moyuView.init();
  4082. this.moyuView.showTip(true);
  4083. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4084. window['XApk'] = this;
  4085. }
  4086. static showAge(show) {
  4087. if (this.moyuView)
  4088. this.moyuView.showAge(show);
  4089. }
  4090. static onPlatMsg(idx) {
  4091. if (!MoyuMgr.moyuView)
  4092. return;
  4093. if (idx == '0') {
  4094. MoyuMgr.moyuView.showTip(false);
  4095. }
  4096. }
  4097. static showAgree(call) {
  4098. if (this.moyuView)
  4099. this.moyuView.showAgree(call);
  4100. else
  4101. call && call();
  4102. }
  4103. static showXy(type = 1) {
  4104. if (this.moyuView)
  4105. this.moyuView.showXy(type);
  4106. }
  4107. }
  4108. MoyuMgr.isAdvise = false;
  4109. class MoyuView {
  4110. constructor() {
  4111. this.ysxyNum = 1;
  4112. this.ysJson = null;
  4113. this.ui = ui_UIMoyu.createInstance();
  4114. }
  4115. init() {
  4116. this.ui.mainBg.visible = false;
  4117. this.ui.xyNode.visible = false;
  4118. this.ui.ageNode.visible = false;
  4119. this.ui.tipNode.visible = false;
  4120. this.ui.rnNode.visible = false;
  4121. this.ui.fcmNode.visible = false;
  4122. this.ui.ageTip.visible = false;
  4123. this.ui.msgNode.visible = false;
  4124. this.ui.visible = false;
  4125. this.ui.xyNode.xyList.setVirtual();
  4126. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4127. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4128. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4129. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4130. this.ui.xyNode.btnKnown.visible = false;
  4131. this.ui.xyNode.xy1.visible = false;
  4132. this.ui.xyNode.xy2.visible = false;
  4133. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4134. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4135. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4136. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4137. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4138. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4139. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4140. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4141. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4142. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4143. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4144. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4145. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4146. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4147. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4148. this.ysxyNum = 2;
  4149. }
  4150. }
  4151. onClick(obj) {
  4152. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4153. switch (obj) {
  4154. case this.ui.ageTip:
  4155. if (Moyu.isTTApk) {
  4156. this.ui.ageNode.visible = true;
  4157. this.ui.mainBg.visible = true;
  4158. }
  4159. break;
  4160. case this.ui.tipNode:
  4161. this.showTip(false);
  4162. break;
  4163. case this.ui.ageNode.btnAge:
  4164. this.ui.ageNode.visible = false;
  4165. this.ui.mainBg.visible = false;
  4166. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4167. this.ui.visible = false;
  4168. break;
  4169. case this.ui.xyNode.btnXy3:
  4170. case this.ui.xyNode.btnXy1:
  4171. this.loadXy(1);
  4172. break;
  4173. case this.ui.xyNode.btnXy2:
  4174. this.loadXy(2);
  4175. break;
  4176. case this.ui.xyNode.btnBack:
  4177. this.ui.xyNode.xy1.visible = true;
  4178. this.ui.xyNode.xy2.visible = false;
  4179. break;
  4180. case this.ui.xyNode.btnKnown:
  4181. this.ui.xyNode.visible = false;
  4182. this.ui.mainBg.visible = false;
  4183. this.ui.visible = false;
  4184. break;
  4185. case this.ui.rnNode.btnCheck:
  4186. this.check();
  4187. break;
  4188. case this.ui.rnNode.btnExit:
  4189. case this.ui.xyNode.btnNo:
  4190. this.ysxyNum--;
  4191. if (this.ysxyNum > 0)
  4192. this.showMsg("再次拒绝退出游戏");
  4193. else {
  4194. Moyu.userAgree(false);
  4195. Moyu.exit();
  4196. }
  4197. break;
  4198. case this.ui.xyNode.btnSure:
  4199. case this.ui.xyNode.btnYes:
  4200. DataMgr.userData.isAgree = true;
  4201. DataMgr.saveUserData();
  4202. this.onAgree();
  4203. break;
  4204. case this.ui.rnNode.btnDone:
  4205. this.ui.rnNode.visible = false;
  4206. this.ui.visible = false;
  4207. break;
  4208. case this.ui.fcmNode.btnRn:
  4209. this.showRn();
  4210. break;
  4211. }
  4212. }
  4213. showTip(show) {
  4214. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4215. return;
  4216. if (show) {
  4217. MoyuMgr.isAdvise = true;
  4218. this.ui.visible = true;
  4219. this.ui.tipNode.visible = true;
  4220. this.ui.tipNode.alpha = 1;
  4221. Laya.timer.once(1000, this, this.showTip, [false]);
  4222. }
  4223. else {
  4224. this.ui.tipNode.alpha = 1;
  4225. this.ui.tipNode.visible = true;
  4226. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4227. this.ui.tipNode.visible = false;
  4228. MoyuMgr.isAdvise = false;
  4229. }), 1000);
  4230. }
  4231. }
  4232. showAge(show, px = 0, py = 0) {
  4233. if (Moyu.platType > 10 && !Moyu.isIos) {
  4234. this.ui.ageTip.x = px;
  4235. this.ui.ageTip.y = py;
  4236. this.ui.ageTip.visible = show;
  4237. if (show)
  4238. this.ui.visible = true;
  4239. }
  4240. }
  4241. showAgree(call) {
  4242. this.agreeCall = call;
  4243. this.onAgree();
  4244. return;
  4245. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4246. this.showXy(0);
  4247. }
  4248. else
  4249. this.onAgree();
  4250. }
  4251. onAgree() {
  4252. if (!this.ui.ageNode.visible)
  4253. this.ui.visible = false;
  4254. this.ui.xyNode.visible = false;
  4255. Moyu.userAgree(true);
  4256. this.showAge(false);
  4257. this.agreeCall && this.agreeCall();
  4258. this.showRn();
  4259. }
  4260. showMsg(txt) {
  4261. this.ui.msgNode.txtMsg.text = txt;
  4262. this.ui.msgNode.visible = true;
  4263. this.ui.msgNode.alpha = 1;
  4264. this.ui.visible = true;
  4265. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4266. this.ui.msgNode.visible = false;
  4267. }), 2500, true);
  4268. }
  4269. showRn() {
  4270. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4271. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4272. this.ui.rnNode.rn1.visible = true;
  4273. this.ui.rnNode.rn2.visible = false;
  4274. this.ui.rnNode.rn3.visible = false;
  4275. this.ui.rnNode.rn4.visible = false;
  4276. this.ui.rnNode.visible = true;
  4277. this.ui.mainBg.visible = true;
  4278. this.ui.rnNode.btnDone.visible = false;
  4279. this.ui.rnNode.btnExit.visible = true;
  4280. this.ui.rnNode.btnCheck.visible = true;
  4281. this.ui.fcmNode.visible = false;
  4282. this.ui.visible = true;
  4283. return;
  4284. }
  4285. }
  4286. this.showFcm();
  4287. }
  4288. showFcm() {
  4289. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4290. Moyu.initFCM(true);
  4291. if (Moyu.gameTime < 1)
  4292. this.fcmLoop();
  4293. else if (Moyu.gameTime < 999)
  4294. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4295. }
  4296. }
  4297. fcmLoop() {
  4298. if (Moyu.gameTime < 1) {
  4299. this.ui.rnNode.visible = false;
  4300. this.ui.fcmNode.visible = true;
  4301. this.ui.mainBg.visible = true;
  4302. this.ui.visible = true;
  4303. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4304. Laya.timer.clear(this.ui, this.fcmLoop);
  4305. }
  4306. }
  4307. check() {
  4308. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4309. this.ui.rnNode.rn1.visible = false;
  4310. this.ui.rnNode.rn2.visible = false;
  4311. this.ui.rnNode.rn4.visible = true;
  4312. }
  4313. else if (this.ui.rnNode.rn4.visible) {
  4314. let name = this.ui.rnNode.inputName.text;
  4315. let code = this.ui.rnNode.inputCode.text;
  4316. if (code && code.length == 18) {
  4317. this.ui.rnNode.rn1.visible = false;
  4318. this.ui.rnNode.rn4.visible = false;
  4319. Moyu.authenticate(name, code, (res) => {
  4320. this.ui.rnNode.rn2.visible = !res;
  4321. this.ui.rnNode.rn3.visible = res;
  4322. this.ui.rnNode.btnDone.visible = res;
  4323. this.ui.rnNode.btnExit.visible = !res;
  4324. this.ui.rnNode.btnCheck.visible = !res;
  4325. if (res)
  4326. this.showFcm();
  4327. });
  4328. }
  4329. else
  4330. this.showMsg("信息填写不完整");
  4331. }
  4332. }
  4333. loadXy(type = 0) {
  4334. this.ui.xyNode.xy1.visible = false;
  4335. this.ui.xyNode.xy2.visible = true;
  4336. this.ui.xyNode.xyList.scrollToView(0);
  4337. if (type == 1) {
  4338. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4339. }
  4340. else if (type == 2) {
  4341. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4342. }
  4343. }
  4344. showXy(type = 0) {
  4345. this.xyBtn();
  4346. if (type == 0) {
  4347. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4348. this.ui.xyNode.btnSure.visible = true;
  4349. }
  4350. else {
  4351. this.ui.xyNode.btnYes.visible = true;
  4352. this.ui.xyNode.btnNo.visible = true;
  4353. }
  4354. }
  4355. else {
  4356. this.ui.xyNode.btnKnown.visible = true;
  4357. this.ui.mainBg.visible = true;
  4358. }
  4359. this.ui.xyNode.xy1.visible = true;
  4360. this.ui.xyNode.xy2.visible = false;
  4361. this.ui.xyNode.visible = true;
  4362. this.ui.visible = true;
  4363. }
  4364. xyBtn() {
  4365. this.ui.xyNode.btnSure.visible = false;
  4366. this.ui.xyNode.btnYes.visible = false;
  4367. this.ui.xyNode.btnNo.visible = false;
  4368. this.ui.xyNode.btnKnown.visible = false;
  4369. {
  4370. this.ui.xyNode.btnXy3.visible = false;
  4371. this.ui.xyNode.btnXy2.visible = true;
  4372. this.ui.xyNode.btnXy1.visible = true;
  4373. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4374. }
  4375. }
  4376. createXY(json) {
  4377. this.ysJson = json.content;
  4378. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4379. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4380. this.ui.xyNode.xy2.visible = true;
  4381. }
  4382. renderListItem(idx, cell) {
  4383. let xy = this.ysJson[idx];
  4384. cell.height = xy.line * 30;
  4385. cell.xyItem.text = xy.text;
  4386. }
  4387. onDestroy() {
  4388. this.agreeCall = null;
  4389. }
  4390. }
  4391. class SettingNode {
  4392. constructor(ui) {
  4393. this.showSetting = false;
  4394. this.openSound = true;
  4395. this.openShake = true;
  4396. this.ui = ui;
  4397. this.ui.soundBtn.onClick(this, this.switchSound);
  4398. this.ui.shakeBtn.onClick(this, this.switchShake);
  4399. this.ui.xyBtn.onClick(this, this.onXy);
  4400. this.ui.clickNode.onClick(this, this.changeSetting);
  4401. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4402. }
  4403. changeSetting() {
  4404. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4405. this.showSetting = !this.showSetting;
  4406. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4407. }
  4408. switchSound() {
  4409. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4410. this.openSound = !this.openSound;
  4411. Moyu.onSetting(this.openSound, this.openShake);
  4412. xGame.soundMgr.onSetting(this.openSound);
  4413. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4414. }
  4415. switchShake() {
  4416. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4417. this.openShake = !this.openShake;
  4418. Moyu.onSetting(this.openSound, this.openShake);
  4419. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4420. }
  4421. onXy() {
  4422. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4423. MoyuMgr.showXy(1);
  4424. }
  4425. }
  4426. class ui_UILevelDisplay extends fgui.GComponent {
  4427. static createInstance() {
  4428. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4429. }
  4430. onConstruct() {
  4431. this.n9 = (this.getChild("n9"));
  4432. this.myNode = (this.getChild("myNode"));
  4433. this.closeNode = (this.getChild("closeNode"));
  4434. }
  4435. }
  4436. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4437. class ui_UILevelProp extends fgui.GComponent {
  4438. static createInstance() {
  4439. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4440. }
  4441. onConstruct() {
  4442. this.n16 = (this.getChild("n16"));
  4443. this.myNode = (this.getChild("myNode"));
  4444. this.closeBtn = (this.getChild("closeBtn"));
  4445. this.moneyNode = (this.getChild("moneyNode"));
  4446. this.t1 = this.getTransition("t1");
  4447. }
  4448. }
  4449. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  4450. class ui_ShowItem extends fgui.GComponent {
  4451. static createInstance() {
  4452. return (fgui.UIPackage.createObject("game", "ShowItem"));
  4453. }
  4454. onConstruct() {
  4455. this.myImg = (this.getChild("myImg"));
  4456. }
  4457. }
  4458. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  4459. class ShowItem {
  4460. constructor() {
  4461. this.ui = ui_ShowItem.createInstance();
  4462. }
  4463. destroySelf() {
  4464. if (!this.ui.isDisposed) {
  4465. this.ui.removeFromParent();
  4466. this.ui.dispose();
  4467. }
  4468. }
  4469. setParent(parent) {
  4470. parent.addChild(this.ui);
  4471. }
  4472. setPos(x, y) {
  4473. this.ui.x = x;
  4474. this.ui.y = y;
  4475. }
  4476. setUrl(index) {
  4477. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  4478. }
  4479. }
  4480. class ui_UIPower extends fgui.GComponent {
  4481. static createInstance() {
  4482. return (fgui.UIPackage.createObject("game", "UIPower"));
  4483. }
  4484. onConstruct() {
  4485. this.n11 = (this.getChild("n11"));
  4486. this.myNode = (this.getChild("myNode"));
  4487. this.t0 = this.getTransition("t0");
  4488. }
  4489. }
  4490. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  4491. class UIPower extends UIBase {
  4492. constructor() {
  4493. super();
  4494. }
  4495. onConstructor() {
  4496. this.ui = ui_UIPower.createInstance();
  4497. this.contentPane = this.ui;
  4498. this.isEject = false;
  4499. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4500. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  4501. }
  4502. show() {
  4503. super.show();
  4504. this.ui.t0.play();
  4505. }
  4506. videoGetPower() {
  4507. Moyu.showVideoAd(() => {
  4508. DataMgr.setPower(xGame.common.videoPower, true);
  4509. xGame.eventMgr.event(POWER_TIME);
  4510. this.hide();
  4511. }, EAdType.getPower);
  4512. }
  4513. }
  4514. UIPower.uiName = "UIPower";
  4515. class UILevelProp extends UIBase {
  4516. constructor() {
  4517. super();
  4518. this.firstPos = 385;
  4519. this.secondPos = 467;
  4520. this.showItemArr = [];
  4521. }
  4522. onConstructor() {
  4523. this.ui = ui_UILevelProp.createInstance();
  4524. this.contentPane = this.ui;
  4525. this.isEject = false;
  4526. this.addUIClick(this.ui.closeBtn, this.hide);
  4527. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  4528. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  4529. }
  4530. show(level) {
  4531. super.show();
  4532. this.ui.t1.play();
  4533. this.level = level;
  4534. this.data = cfgTable.placeballData[this.level];
  4535. this.updateSelf();
  4536. this.showPreView();
  4537. this.moneyNode.ui.c1.selectedIndex = 2;
  4538. this.moneyNode.checkPowerTime();
  4539. this.moneyNode.powerChange();
  4540. }
  4541. showPreView() {
  4542. let item;
  4543. let data;
  4544. for (let index = 0; index < this.showItemArr.length; index++) {
  4545. item = this.showItemArr[index];
  4546. item.destroySelf();
  4547. }
  4548. this.showItemArr = [];
  4549. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  4550. for (const key in cfgData) {
  4551. data = cfgData[key];
  4552. item = new ShowItem();
  4553. item.setParent(this.ui.myNode.displayRoot);
  4554. item.setPos(data.x, data.y);
  4555. item.setUrl(data.value);
  4556. this.showItemArr.push(item);
  4557. }
  4558. }
  4559. updateSelf() {
  4560. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  4561. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  4562. if (this.data.ball == -1) {
  4563. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  4564. }
  4565. else {
  4566. this.ui.myNode.conditionTxt.text = "Reward";
  4567. }
  4568. let localData = DataMgr.getPlaceBallLevel(this.level);
  4569. let getAward = localData.getAward;
  4570. let cfg = cfgTable.placeballData[this.level];
  4571. let coin = this.data.award[0];
  4572. let diamond = this.data.award[1];
  4573. if (cfg.type == PlaceBallType.challenge) {
  4574. diamond = 0;
  4575. coin = 100;
  4576. }
  4577. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  4578. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  4579. this.ui.myNode.coinNode.numTxt.text = coin + "";
  4580. if (cfg.type == PlaceBallType.challenge) {
  4581. this.ui.myNode.coinNode.numTxt.text = "";
  4582. }
  4583. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  4584. if (coin > 0 && diamond > 0) {
  4585. this.ui.myNode.diamondNode.x = 385;
  4586. this.ui.myNode.coinNode.x = 467;
  4587. }
  4588. else {
  4589. this.ui.myNode.diamondNode.x = 385;
  4590. this.ui.myNode.coinNode.x = 385;
  4591. }
  4592. if (!getAward) {
  4593. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  4594. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  4595. }
  4596. else {
  4597. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  4598. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  4599. }
  4600. }
  4601. startGame() {
  4602. if (DataMgr.powerEnough()) {
  4603. this.ui.myNode.startBtn.touchable = false;
  4604. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  4605. console.log('zh:startGame ');
  4606. this.ui.myNode.startBtn.touchable = true;
  4607. DataMgr.setPower(-1);
  4608. xGame.eventMgr.event(POWER_TIME);
  4609. xGame.common.gameMode = GameMode.placeBall;
  4610. xGame.common.placeBallCurLevel = this.level;
  4611. xGame.uiMgr.Show(UIGame);
  4612. xGame.uiMgr.Hide(UILevelDisplay);
  4613. xGame.uiMgr.Hide(UIMain);
  4614. this.hide();
  4615. }));
  4616. }
  4617. else {
  4618. xGame.uiMgr.Show(UIPower);
  4619. }
  4620. }
  4621. hide() {
  4622. super.hide();
  4623. }
  4624. }
  4625. UILevelProp.uiName = "UILevelProp";
  4626. class PutBallLevelDisplay {
  4627. constructor(ui, index) {
  4628. this.index = 0;
  4629. this.ui = ui;
  4630. this.index = index;
  4631. this.ui.onClick(this, this.clickSelf);
  4632. this.updateSelf();
  4633. this.ui.levelTxt.text = (this.index + 1) + "";
  4634. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  4635. this.ui.special.levelTxt.text = (this.index + 1) + "";
  4636. }
  4637. updateSelf() {
  4638. let level = this.index + 1;
  4639. this.data = DataMgr.getPlaceBallLevel(level);
  4640. this.ui.starNode.c1.selectedIndex = this.data.star;
  4641. let isChallenge = cfgTable.placeballData[level].type;
  4642. if (this.data.isCur) {
  4643. if (isChallenge) {
  4644. this.ui.c1.selectedIndex = 5;
  4645. }
  4646. else {
  4647. this.ui.c1.selectedIndex = 2;
  4648. }
  4649. }
  4650. else {
  4651. if (this.data.play) {
  4652. if (this.data.star == 3) {
  4653. this.ui.c1.selectedIndex = 0;
  4654. }
  4655. else {
  4656. this.ui.c1.selectedIndex = 1;
  4657. }
  4658. }
  4659. else {
  4660. if (isChallenge) {
  4661. this.ui.c1.selectedIndex = 4;
  4662. }
  4663. else {
  4664. this.ui.c1.selectedIndex = 3;
  4665. }
  4666. }
  4667. }
  4668. }
  4669. clickSelf() {
  4670. if (!this.data.play)
  4671. return;
  4672. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4673. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  4674. }
  4675. }
  4676. class UILevelDisplay extends UIBase {
  4677. constructor() {
  4678. super();
  4679. }
  4680. onConstructor() {
  4681. this.ui = ui_UILevelDisplay.createInstance();
  4682. this.contentPane = this.ui;
  4683. this.isEject = false;
  4684. this.myList = this.ui.myNode.myList;
  4685. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  4686. this.levelItemArr = [];
  4687. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  4688. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  4689. this.myList.numItems = levelNum;
  4690. if (Moyu.isKs)
  4691. this.ui.closeNode.closeBtn.x += 100;
  4692. }
  4693. levelItemRender(index, target) {
  4694. let item = new PutBallLevelDisplay(target, index);
  4695. this.levelItemArr.push(item);
  4696. }
  4697. show() {
  4698. super.show();
  4699. this.updateLevel();
  4700. this.scrollToPlace();
  4701. }
  4702. updateLevel() {
  4703. let temp;
  4704. for (let index = 0; index < this.levelItemArr.length; index++) {
  4705. temp = this.levelItemArr[index];
  4706. temp.updateSelf();
  4707. }
  4708. }
  4709. scrollToPlace() {
  4710. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  4711. let passArr = DataMgr.getPlaceBallLevelList();
  4712. let offest = passArr.length;
  4713. if (offest >= maxNum - 1)
  4714. offest = maxNum - 1;
  4715. this.myList.scrollToView(offest, true, true);
  4716. }
  4717. hide() {
  4718. super.hide();
  4719. }
  4720. }
  4721. UILevelDisplay.uiName = "UILevelDisplay";
  4722. class ui_UIMatching extends fgui.GComponent {
  4723. static createInstance() {
  4724. return (fgui.UIPackage.createObject("game", "UIMatching"));
  4725. }
  4726. onConstruct() {
  4727. this.n5 = (this.getChild("n5"));
  4728. this.n49 = (this.getChild("n49"));
  4729. this.n51 = (this.getChild("n51"));
  4730. this.n64 = (this.getChild("n64"));
  4731. this.n2 = (this.getChild("n2"));
  4732. this.n53 = (this.getChild("n53"));
  4733. this.n54 = (this.getChild("n54"));
  4734. this.n56 = (this.getChild("n56"));
  4735. this.n58 = (this.getChild("n58"));
  4736. this.n59 = (this.getChild("n59"));
  4737. this.n57 = (this.getChild("n57"));
  4738. this.n60 = (this.getChild("n60"));
  4739. this.n62 = (this.getChild("n62"));
  4740. this.awardTxt = (this.getChild("awardTxt"));
  4741. this.n61 = (this.getChild("n61"));
  4742. this.selfHead = (this.getChild("selfHead"));
  4743. this.aiHead = (this.getChild("aiHead"));
  4744. this.n82 = (this.getChild("n82"));
  4745. this.n84 = (this.getChild("n84"));
  4746. this.n83 = (this.getChild("n83"));
  4747. this.t1 = this.getTransition("t1");
  4748. this.t2 = this.getTransition("t2");
  4749. this.t3 = this.getTransition("t3");
  4750. this.t4 = this.getTransition("t4");
  4751. }
  4752. }
  4753. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  4754. class UIMatching extends UIBase {
  4755. constructor() {
  4756. super();
  4757. }
  4758. onConstructor() {
  4759. this.ui = ui_UIMatching.createInstance();
  4760. this.contentPane = this.ui;
  4761. this.isEject = false;
  4762. }
  4763. show(callback) {
  4764. super.show();
  4765. PlatMgr.showBanner(true);
  4766. this.callback = callback;
  4767. let user = Moyu.getUserInfo();
  4768. if (!this.selfPot) {
  4769. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  4770. }
  4771. if (!this.aiPot) {
  4772. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  4773. }
  4774. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  4775. this.ui.selfHead.nameTxt.text = user.nickName;
  4776. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  4777. this.ui.aiHead.nameTxt.text = "???";
  4778. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  4779. this.ui.selfHead.c1.selectedIndex = 0;
  4780. this.ui.aiHead.c1.selectedIndex = 0;
  4781. this.ui.selfHead.x = this.selfPot.x;
  4782. this.ui.selfHead.y = this.selfPot.y;
  4783. this.ui.aiHead.x = this.aiPot.x;
  4784. this.ui.aiHead.y = this.aiPot.y;
  4785. switch (xGame.common.gameMode) {
  4786. case GameMode.classic:
  4787. break;
  4788. case GameMode.bigMove:
  4789. this.initSkillData();
  4790. break;
  4791. default:
  4792. break;
  4793. }
  4794. this.ui.t1.play(Laya.Handler.create(this, () => {
  4795. this.ui.t2.play(Laya.Handler.create(this, () => {
  4796. switch (xGame.common.gameMode) {
  4797. case GameMode.classic:
  4798. this.waitingPeople();
  4799. break;
  4800. case GameMode.bigMove:
  4801. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  4802. break;
  4803. default:
  4804. break;
  4805. }
  4806. }));
  4807. }));
  4808. }
  4809. initSkillData() {
  4810. this.skillSelectData = [];
  4811. let skillUrl = xGame.common.skillIconList;
  4812. let skillName = xGame.common.skillNameList;
  4813. let skillLevel = DataMgr.getBigSkillList();
  4814. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  4815. for (let index = 0; index < 5; index++) {
  4816. let obj = {};
  4817. obj.skillImg = skillUrl[index];
  4818. obj.skillName = skillName[index];
  4819. obj.skillType = skillType[index];
  4820. obj.skillLevel = skillLevel[index];
  4821. this.skillSelectData.push(obj);
  4822. }
  4823. }
  4824. getAISkillLevel(myLevel) {
  4825. let video = xGame.common.upSkillLevel;
  4826. let aiLevel;
  4827. let temp;
  4828. if (video) {
  4829. temp = xGame.common.randomNum(-2, -1);
  4830. }
  4831. else {
  4832. if (myLevel <= 5) {
  4833. temp = xGame.common.randomNum(1, 3);
  4834. }
  4835. else if (myLevel <= 9) {
  4836. temp = xGame.common.randomNum(-2, 1);
  4837. }
  4838. else {
  4839. temp = xGame.common.randomNum(-4, 0);
  4840. }
  4841. }
  4842. aiLevel = temp + myLevel;
  4843. if (aiLevel <= 1)
  4844. aiLevel = 1;
  4845. if (aiLevel >= 10)
  4846. aiLevel = 10;
  4847. return aiLevel;
  4848. }
  4849. getAISkillType() {
  4850. return xGame.common.randomNum(1, 4);
  4851. let successTimes = DataMgr.getSkillSuccessTimes();
  4852. let info = cfgTable.aiskillData[successTimes];
  4853. if (!info) {
  4854. let max = Object.keys(cfgTable.aiskillData).length - 1;
  4855. info = cfgTable.aiskillData[max];
  4856. }
  4857. let dataArr = info.skillselect;
  4858. let myCfg = {};
  4859. for (let index = 0; index < dataArr.length; index++) {
  4860. let temp = dataArr[index].split('-');
  4861. myCfg[temp[0]] = {};
  4862. myCfg[temp[0]].id = parseInt(temp[0]);
  4863. myCfg[temp[0]].weight = parseInt(temp[1]);
  4864. }
  4865. let aiCfg = xGame.common.initWeight(myCfg);
  4866. let curData = xGame.common.getRandomWeightData(aiCfg);
  4867. return parseInt(curData.id);
  4868. }
  4869. getAISkillData(index) {
  4870. let myLevel = this.skillSelectData[index].skillLevel;
  4871. let aiLevel = this.getAISkillLevel(myLevel);
  4872. let aiType = this.getAISkillType() - 1;
  4873. return { aiLevel, aiType } = { aiLevel, aiType };
  4874. }
  4875. skillSelectFinish(index) {
  4876. let aiInfo = this.getAISkillData(index);
  4877. xGame.common.gameMgr.selfCurSkill = index;
  4878. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  4879. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  4880. this.ui.selfHead.c1.selectedIndex = 1;
  4881. this.ui.aiHead.c1.selectedIndex = 1;
  4882. let myData = this.skillSelectData[index];
  4883. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  4884. let guide = DataMgr.getSkillGuide();
  4885. if (guide == 0) {
  4886. this.ui.selfHead.skillTxt.text = myData.skillName + " 满级";
  4887. }
  4888. else {
  4889. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  4890. }
  4891. let aiData = this.skillSelectData[aiInfo.aiType];
  4892. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  4893. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  4894. this.waitingPeople();
  4895. }
  4896. waitingPeople() {
  4897. let time = xGame.common.randomNum(1000, 3000);
  4898. time += 1000;
  4899. Laya.timer.once(time, this, () => {
  4900. this.matchingSuccess();
  4901. });
  4902. }
  4903. matchingSuccess() {
  4904. let gameUI = xGame.common.gameUI;
  4905. let name = gameUI.ui.topNode.aiNameTxt.text;
  4906. let url = gameUI.ui.topNode.aiHeadLoader.url;
  4907. this.ui.aiHead.nameTxt.text = name;
  4908. this.ui.aiHead.headImg.url = url;
  4909. name = gameUI.ui.topNode.selfNameTxt.text;
  4910. url = gameUI.ui.topNode.selfHeadLoader.url;
  4911. this.ui.selfHead.nameTxt.text = name;
  4912. this.ui.selfHead.headImg.url = url;
  4913. this.ui.t3.play(Laya.Handler.create(this, () => {
  4914. this.callback && this.callback();
  4915. this.ui.t4.play(Laya.Handler.create(this, () => {
  4916. this.destroySelf();
  4917. }));
  4918. }));
  4919. }
  4920. destroySelf() {
  4921. this.callback = null;
  4922. this.skillSelectData = null;
  4923. this.selfPot = null;
  4924. this.aiPot = null;
  4925. if (!this.ui.isDisposed) {
  4926. this.ui.removeFromParent();
  4927. this.ui.dispose();
  4928. }
  4929. xGame.uiMgr.destroyUI(this);
  4930. }
  4931. }
  4932. UIMatching.uiName = "UIMatching";
  4933. class ui_UIRanking extends fgui.GComponent {
  4934. static createInstance() {
  4935. return (fgui.UIPackage.createObject("game", "UIRanking"));
  4936. }
  4937. onConstruct() {
  4938. this.n26 = (this.getChild("n26"));
  4939. this.myNode = (this.getChild("myNode"));
  4940. }
  4941. }
  4942. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  4943. class UIRanking extends UIBase {
  4944. constructor() {
  4945. super();
  4946. this.showSelf = true;
  4947. this.rankType = 1;
  4948. this.rankList = [];
  4949. this.myIndex = 0;
  4950. this.myStar = 0;
  4951. }
  4952. onConstructor() {
  4953. this.ui = ui_UIRanking.createInstance();
  4954. this.contentPane = this.ui;
  4955. this.isEject = false;
  4956. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  4957. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  4958. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  4959. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  4960. this.ui.myNode.myList.setVirtual();
  4961. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  4962. }
  4963. show() {
  4964. super.show();
  4965. this.myIndex = 51;
  4966. Moyu.getRankList({
  4967. rankId: xGame.common.curRankID,
  4968. type: MoyuRankType.total,
  4969. page: 1,
  4970. pageSize: 50,
  4971. }, this, this.updateItemData);
  4972. this.updateSelf();
  4973. let self = Moyu.getUserInfo();
  4974. if (!self.isAuth) {
  4975. Moyu.initUser(this, () => {
  4976. DataMgr.upRankData();
  4977. });
  4978. }
  4979. }
  4980. updateSelfItem() {
  4981. let self = Moyu.getUserInfo();
  4982. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  4983. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > 50 ? "未上榜" : this.myIndex.toString();
  4984. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  4985. this.ui.myNode.selfNode.nameTxt.text = Moyu.platType < 11 ? self.nickName : "myself";
  4986. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  4987. }
  4988. updateItemData(data) {
  4989. this.myStar = xGame.common.getAllStarNum();
  4990. if (this.rankList.length < 2) {
  4991. this.rankList = data;
  4992. let self = Moyu.getUserInfo();
  4993. for (let i = 0; i < data.length; i++) {
  4994. let data = this.rankList[i];
  4995. if (data.userId == self.userId) {
  4996. this.rankList.splice(i, 1);
  4997. break;
  4998. }
  4999. }
  5000. for (let i = 0; i < data.length; i++) {
  5001. let data = this.rankList[i];
  5002. if (data.rankScore < this.myStar && this.myIndex > 50) {
  5003. this.myIndex = i + 1;
  5004. let user = { headIcon: self.headIcon, nickName: "myself" };
  5005. let ud = { user: user, data: {} };
  5006. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5007. if (Moyu.platType < 11) {
  5008. user.headIcon = self.headIcon;
  5009. user.nickName = self.nickName;
  5010. }
  5011. this.rankList.splice(i, 0, md);
  5012. break;
  5013. }
  5014. }
  5015. }
  5016. this.updateSelfItem();
  5017. this.ui.myNode.myList.numItems = this.rankList.length;
  5018. }
  5019. updateItemUI(index, obj) {
  5020. let data = this.rankList[index];
  5021. let userData = JSON.parse(data.userData).user;
  5022. obj.nameTxt.text = userData.nickName.toString();
  5023. obj.valueTxt.text = data.rankScore;
  5024. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5025. obj.rankTxt.text = index + 1;
  5026. switch (index) {
  5027. case 0:
  5028. this.setImg(obj, 1, 0, 0);
  5029. obj.rankTxt.color = "#FFC047";
  5030. break;
  5031. case 1:
  5032. this.setImg(obj, 0, 1, 0);
  5033. obj.rankTxt.color = "#ACACAC";
  5034. break;
  5035. case 2:
  5036. this.setImg(obj, 0, 0, 1);
  5037. obj.rankTxt.color = "#D09672";
  5038. break;
  5039. default:
  5040. this.setImg(obj, 0, 0, 0);
  5041. obj.rankTxt.color = "#496FAB";
  5042. break;
  5043. }
  5044. }
  5045. setImg(obj, a, b, c) {
  5046. obj.img1.visible = a ? true : false;
  5047. obj.img2.visible = b ? true : false;
  5048. obj.img3.visible = c ? true : false;
  5049. }
  5050. changeList(type) {
  5051. this.rankType = type;
  5052. this.updateSelf();
  5053. }
  5054. changeSelfNode() {
  5055. this.showSelf = !this.showSelf;
  5056. this.updateSelf();
  5057. }
  5058. updateSelf() {
  5059. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5060. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5061. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5062. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5063. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5064. }
  5065. }
  5066. UIRanking.uiName = "UIRanking";
  5067. class ui_UISecretary extends fgui.GComponent {
  5068. static createInstance() {
  5069. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5070. }
  5071. onConstruct() {
  5072. this.n0 = (this.getChild("n0"));
  5073. this.myNode = (this.getChild("myNode"));
  5074. this.rightBtn = (this.getChild("rightBtn"));
  5075. this.leftBtn = (this.getChild("leftBtn"));
  5076. this.closeBtn = (this.getChild("closeBtn"));
  5077. this.t0 = this.getTransition("t0");
  5078. }
  5079. }
  5080. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5081. class UISecretary extends UIBase {
  5082. constructor() {
  5083. super();
  5084. this.curIndex = 1;
  5085. }
  5086. onConstructor() {
  5087. this.ui = ui_UISecretary.createInstance();
  5088. this.contentPane = this.ui;
  5089. this.isEject = false;
  5090. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5091. this.addUIClick(this.ui.leftBtn, this.turnLeft);
  5092. this.addUIClick(this.ui.rightBtn, this.turnRight);
  5093. this.nodeObj = { left: null, right: null, cur: null };
  5094. this.nodeObj.left = this.ui.myNode.gameNode1;
  5095. this.nodeObj.right = this.ui.myNode.gameNode2;
  5096. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5097. }
  5098. show() {
  5099. super.show();
  5100. this.ui.t0.play();
  5101. this.updateData();
  5102. }
  5103. addSecretarySpine(node, spineName) {
  5104. if (spineName == "mishu") {
  5105. if (this.secretarySpine1) {
  5106. node.displayObject.destroyChildren();
  5107. this.playWoman(this.secretarySpine1, node.displayObject);
  5108. }
  5109. else {
  5110. let spine1 = new SpineMgr("mishu", () => {
  5111. this.secretarySpine1 = spine1;
  5112. this.playWoman(this.secretarySpine1, node.displayObject);
  5113. });
  5114. }
  5115. }
  5116. else {
  5117. if (this.secretarySpine2) {
  5118. node.displayObject.destroyChildren();
  5119. this.playWoman(this.secretarySpine2, node.displayObject);
  5120. }
  5121. else {
  5122. let spine2 = new SpineMgr("xiaomishu2", () => {
  5123. this.secretarySpine2 = spine2;
  5124. this.playWoman(this.secretarySpine2, node.displayObject);
  5125. });
  5126. }
  5127. }
  5128. }
  5129. playWoman(node, parent) {
  5130. let xx = this.ui.myNode.gameNode1.secretary.width / 2;
  5131. let yy = this.ui.myNode.gameNode1.secretary.height;
  5132. let scale = 1.5;
  5133. if (node == this.secretarySpine2) {
  5134. scale = 1.2;
  5135. }
  5136. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5137. node.play(data, 1, true, parent);
  5138. }
  5139. turnLeft() {
  5140. this.curIndex--;
  5141. if (this.curIndex < 1) {
  5142. this.curIndex = 2;
  5143. }
  5144. let left = this.nodeObj.left;
  5145. let right = this.nodeObj.right;
  5146. let cur = this.nodeObj.cur;
  5147. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5148. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5149. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5150. this.updateData();
  5151. }));
  5152. this.ui.myNode.setChildIndex(right, 2);
  5153. this.nodeObj.left = cur;
  5154. this.nodeObj.right = left;
  5155. this.nodeObj.cur = right;
  5156. }
  5157. turnRight() {
  5158. this.curIndex++;
  5159. if (this.curIndex > 2) {
  5160. this.curIndex = 1;
  5161. }
  5162. let left = this.nodeObj.left;
  5163. let right = this.nodeObj.right;
  5164. let cur = this.nodeObj.cur;
  5165. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5166. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5167. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5168. this.updateData();
  5169. }));
  5170. this.ui.myNode.setChildIndex(left, 2);
  5171. this.nodeObj.left = right;
  5172. this.nodeObj.right = cur;
  5173. this.nodeObj.cur = left;
  5174. }
  5175. updateData() {
  5176. let data = cfgTable.secretaryshopData;
  5177. let children = this.ui.myNode._children;
  5178. let temp;
  5179. let curData;
  5180. for (let index = 0; index < children.length; index++) {
  5181. temp = children[index];
  5182. if (index == 2) {
  5183. curData = data[this.curIndex];
  5184. temp.purchaseBtn.touchable = true;
  5185. }
  5186. else {
  5187. temp.purchaseBtn.touchable = false;
  5188. if (this.curIndex == 1) {
  5189. curData = data[2];
  5190. }
  5191. else {
  5192. curData = data[1];
  5193. }
  5194. }
  5195. temp.heightTxt.text = curData.height;
  5196. temp.foodTxt.text = curData.food;
  5197. temp.historyTxt.text = curData.history;
  5198. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5199. this.addSecretarySpine(temp.secretary, curData.spine);
  5200. let womanIndex = curData.id - 1;
  5201. let getWoman = DataMgr.getSecretary(womanIndex);
  5202. let curUse = DataMgr.getCurSecretary();
  5203. if (getWoman) {
  5204. if (curUse == womanIndex) {
  5205. temp.purchaseBtn.c1.selectedIndex = 1;
  5206. }
  5207. else {
  5208. temp.purchaseBtn.c1.selectedIndex = 2;
  5209. }
  5210. }
  5211. else {
  5212. temp.purchaseBtn.c1.selectedIndex = 0;
  5213. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5214. }
  5215. temp.purchaseBtn.offClick(this, this.clickSecretary);
  5216. temp.purchaseBtn.onClick(this, this.clickSecretary, [getWoman, curUse, womanIndex, curData.price]);
  5217. }
  5218. }
  5219. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5220. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5221. if (getWoman) {
  5222. if (curUse != womanIndex) {
  5223. console.log();
  5224. DataMgr.setCurSecretary(womanIndex);
  5225. this.updateData();
  5226. }
  5227. }
  5228. else {
  5229. let need = needDiamond;
  5230. if (DataMgr.diamondEnough(need)) {
  5231. DataMgr.setDiamond(-need);
  5232. DataMgr.setSecretary(womanIndex, 1);
  5233. DataMgr.setCurSecretary(womanIndex);
  5234. this.updateData();
  5235. }
  5236. else {
  5237. xGame.uiMgr.Show(UIAddProp, 1);
  5238. }
  5239. }
  5240. }
  5241. closeSelf() {
  5242. this.hide();
  5243. }
  5244. }
  5245. UISecretary.uiName = "UISecretary";
  5246. class ui_UIShop extends fgui.GComponent {
  5247. static createInstance() {
  5248. return (fgui.UIPackage.createObject("game", "UIShop"));
  5249. }
  5250. onConstruct() {
  5251. this.n48 = (this.getChild("n48"));
  5252. this.n0 = (this.getChild("n0"));
  5253. this.secretary = (this.getChild("secretary"));
  5254. this.talkNode = (this.getChild("talkNode"));
  5255. this.closeNode = (this.getChild("closeNode"));
  5256. this.moneyNode = (this.getChild("moneyNode"));
  5257. this.myNode = (this.getChild("myNode"));
  5258. }
  5259. }
  5260. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5261. class BallRodDisplay {
  5262. constructor(ui, index) {
  5263. this.index = 0;
  5264. this.uiIndex = 0;
  5265. this.ui = ui;
  5266. this.index = index;
  5267. this.initData();
  5268. }
  5269. initData() {
  5270. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5271. let data = cfgTable.ballrodData[this.index + 1];
  5272. this.ui.nameTxt.text = data.name;
  5273. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5274. this.ui.levelNode.c1.selectedIndex = data.quality;
  5275. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5276. if (data.spine) {
  5277. this.mySpine = new SpineMgr(data.spine, () => {
  5278. let xx = 150;
  5279. let yy = 70;
  5280. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5281. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5282. });
  5283. }
  5284. }
  5285. updateSelf() {
  5286. let get = DataMgr.getBallRod(this.index);
  5287. if (get == null)
  5288. get = 1;
  5289. let curUse = DataMgr.getCurBallRod();
  5290. if (get) {
  5291. if (curUse == this.index) {
  5292. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5293. }
  5294. else {
  5295. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5296. }
  5297. }
  5298. else {
  5299. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5300. }
  5301. }
  5302. buyBallRod() {
  5303. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5304. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5305. switch (selectedIndex) {
  5306. case 0:
  5307. break;
  5308. case 1:
  5309. DataMgr.setCurBallRod(this.index);
  5310. let ui = xGame.uiMgr.getUI(UIShop);
  5311. ui.updateBallRod();
  5312. break;
  5313. case 2:
  5314. let data = cfgTable.ballrodData[this.index + 1];
  5315. let need = data.price;
  5316. if (DataMgr.diamondEnough(need)) {
  5317. DataMgr.setDiamond(-need);
  5318. DataMgr.setBallRod(this.index, 1);
  5319. DataMgr.setCurBallRod(this.index);
  5320. let ui = xGame.uiMgr.getUI(UIShop);
  5321. ui.updateBallRod();
  5322. }
  5323. else {
  5324. xGame.uiMgr.Show(UIAddProp, 1);
  5325. }
  5326. break;
  5327. default:
  5328. break;
  5329. }
  5330. }
  5331. }
  5332. class UIShop extends UIBase {
  5333. constructor() {
  5334. super();
  5335. this.itemNums = 0;
  5336. }
  5337. onConstructor() {
  5338. this.ui = ui_UIShop.createInstance();
  5339. this.contentPane = this.ui;
  5340. this.isEject = false;
  5341. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5342. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5343. this.addUIClick(this.ui, this.interuptSecretary);
  5344. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  5345. this.ballRodArr = [];
  5346. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  5347. this.ui.myNode.myList.numItems = this.itemNums;
  5348. if (Moyu.isKs)
  5349. this.ui.closeNode.closeBtn.x += 100;
  5350. }
  5351. show() {
  5352. super.show();
  5353. this.playSecretaryIdle();
  5354. this.updateBallRod();
  5355. }
  5356. updateBallRod() {
  5357. for (let index = 0; index < this.ballRodArr.length; index++) {
  5358. this.ballRodArr[index].updateSelf();
  5359. }
  5360. }
  5361. renderBallRod(sort, obj) {
  5362. let index = this.getIndexBySort(sort + 1) - 1;
  5363. let ballRod = new BallRodDisplay(obj, index);
  5364. this.ballRodArr.push(ballRod);
  5365. }
  5366. getIndexBySort(sort) {
  5367. let object = cfgTable.ballrodData;
  5368. for (const key in object) {
  5369. if (object[key].sort == sort) {
  5370. return parseInt(key);
  5371. }
  5372. }
  5373. }
  5374. playSecretaryIdle() {
  5375. let parent = this.ui.secretary.displayObject;
  5376. parent.destroyChildren();
  5377. let xx = this.ui.secretary.width / 2;
  5378. let yy = this.ui.secretary.height;
  5379. let scale = xGame.common.getSecretaryScale();
  5380. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5381. xGame.common.secretary.play(data, 1, true, parent);
  5382. }
  5383. interuptSecretary() {
  5384. Laya.timer.clearAll(this);
  5385. this.playSecretaryRandomSound();
  5386. }
  5387. playSecretaryRandomSound() {
  5388. if (this.isHide)
  5389. return;
  5390. let time = xGame.common.randomNum(45000, 60000);
  5391. Laya.timer.once(time, this, () => {
  5392. if (this.isHide)
  5393. return;
  5394. let index = xGame.common.randomNum(4, 7);
  5395. xGame.soundMgr.playSound("s_main0" + index);
  5396. let words = 1;
  5397. switch (index) {
  5398. case 4:
  5399. words = 5;
  5400. break;
  5401. case 5:
  5402. words = 3;
  5403. break;
  5404. case 6:
  5405. words = 6;
  5406. break;
  5407. case 7:
  5408. words = 7;
  5409. break;
  5410. default:
  5411. break;
  5412. }
  5413. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5414. this.playSecretaryRandomSound();
  5415. });
  5416. }
  5417. closeSelf() {
  5418. this.hide();
  5419. }
  5420. }
  5421. UIShop.uiName = "UIShop";
  5422. class ui_UISign extends fgui.GComponent {
  5423. static createInstance() {
  5424. return (fgui.UIPackage.createObject("game", "UISign"));
  5425. }
  5426. onConstruct() {
  5427. this.n6 = (this.getChild("n6"));
  5428. this.closeNode = (this.getChild("closeNode"));
  5429. this.myNode = (this.getChild("myNode"));
  5430. this.moneyNode = (this.getChild("moneyNode"));
  5431. this.secretary = (this.getChild("secretary"));
  5432. this.talkNode = (this.getChild("talkNode"));
  5433. this.tripleBtn = (this.getChild("tripleBtn"));
  5434. this.normalBtn = (this.getChild("normalBtn"));
  5435. this.tipsNode = (this.getChild("tipsNode"));
  5436. this.againBtn = (this.getChild("againBtn"));
  5437. this.t0 = this.getTransition("t0");
  5438. }
  5439. }
  5440. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  5441. class SignMax {
  5442. constructor(ui) {
  5443. this.ui = ui;
  5444. }
  5445. updateSelf(index, sameDay, curDayIndex) {
  5446. let data = cfgTable.signData[index + 1];
  5447. this.ui.titleTxt.text = data.title;
  5448. let arr1 = data.award[0].split('-');
  5449. let arr2 = data.award[1].split('-');
  5450. let num1 = parseInt(arr1[1]);
  5451. let num2 = parseInt(arr2[1]);
  5452. this.ui.numTxt1.text = num1 + "";
  5453. this.ui.numTxt2.text = num2 + "";
  5454. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  5455. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  5456. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  5457. this.ui.numTxt1.visible = false;
  5458. }
  5459. else {
  5460. this.ui.numTxt1.visible = true;
  5461. }
  5462. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  5463. this.ui.numTxt2.visible = false;
  5464. }
  5465. else {
  5466. this.ui.numTxt2.visible = true;
  5467. }
  5468. if (index < curDayIndex) {
  5469. this.ui.c1.selectedIndex = 1;
  5470. }
  5471. else if (index == curDayIndex) {
  5472. if (sameDay) {
  5473. this.ui.c1.selectedIndex = 2;
  5474. }
  5475. else {
  5476. this.ui.c1.selectedIndex = 2;
  5477. }
  5478. }
  5479. else {
  5480. this.ui.c1.selectedIndex = 0;
  5481. }
  5482. }
  5483. }
  5484. class SignNormal {
  5485. constructor(ui) {
  5486. this.ui = ui;
  5487. }
  5488. updateSelf(index, sameDay, curDayIndex) {
  5489. let data = cfgTable.signData[index + 1];
  5490. this.ui.titleTxt.text = data.title;
  5491. let arr = data.award[0].split('-');
  5492. let type = parseInt(arr[0]);
  5493. let num = parseInt(arr[1]);
  5494. this.ui.numTxt.text = num + "";
  5495. if (type > 2) {
  5496. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  5497. this.ui.myIcon.rotation = 0;
  5498. }
  5499. else {
  5500. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  5501. this.ui.myIcon.rotation = 0;
  5502. }
  5503. if (xGame.common.signAwardContainsRod(data.award)) {
  5504. this.ui.numTxt.visible = false;
  5505. }
  5506. else {
  5507. this.ui.numTxt.visible = true;
  5508. }
  5509. if (index < curDayIndex) {
  5510. this.ui.c1.selectedIndex = 1;
  5511. }
  5512. else if (index == curDayIndex) {
  5513. if (sameDay) {
  5514. this.ui.c1.selectedIndex = 2;
  5515. }
  5516. else {
  5517. this.ui.c1.selectedIndex = 2;
  5518. }
  5519. }
  5520. else {
  5521. this.ui.c1.selectedIndex = 0;
  5522. }
  5523. }
  5524. }
  5525. class UISign extends UIBase {
  5526. constructor() {
  5527. super();
  5528. this.curDayIndex = 0;
  5529. this.starX = 0;
  5530. }
  5531. onConstructor() {
  5532. this.ui = ui_UISign.createInstance();
  5533. this.contentPane = this.ui;
  5534. this.isEject = false;
  5535. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5536. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5537. this.initSignItem();
  5538. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  5539. this.addUIClick(this.ui.againBtn, this.againGetAward);
  5540. }
  5541. show() {
  5542. super.show();
  5543. this.ui.t0.play();
  5544. this.playSecretaryIdle();
  5545. this.updateSign();
  5546. }
  5547. initSignItem() {
  5548. this.signArr = [];
  5549. for (let index = 0; index < 6; index++) {
  5550. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  5551. this.signArr.push(temp);
  5552. }
  5553. this.signMax = new SignMax(this.ui.myNode.day7);
  5554. if (Moyu.isKs)
  5555. this.ui.closeNode.closeBtn.x += 100;
  5556. }
  5557. updateSign() {
  5558. let sameDay = xGame.common.judgeSameDay();
  5559. let max = 7;
  5560. this.curDayIndex = DataMgr.getSignData();
  5561. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  5562. this.curDayIndex = 0;
  5563. if (!sameDay) {
  5564. this.ui.normalBtn.visible = true;
  5565. this.ui.tipsNode.visible = false;
  5566. this.ui.againBtn.visible = false;
  5567. }
  5568. else {
  5569. this.ui.normalBtn.visible = false;
  5570. let again = DataMgr.getExtraSign();
  5571. let isCurrency = false;
  5572. let index = this.curDayIndex;
  5573. if (index == 0)
  5574. index = 7;
  5575. let award = cfgTable.signData[index].award;
  5576. let num = award[0].split("-")[0];
  5577. if (num == "1" || num == "2")
  5578. isCurrency = true;
  5579. let showAgain = again == 0 && isCurrency;
  5580. this.ui.againBtn.visible = showAgain;
  5581. this.ui.tipsNode.visible = !showAgain;
  5582. }
  5583. for (let index = 0; index < this.signArr.length; index++) {
  5584. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  5585. }
  5586. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  5587. }
  5588. playSecretaryIdle() {
  5589. let parent = this.ui.secretary.displayObject;
  5590. parent.destroyChildren();
  5591. let xx = this.ui.secretary.width / 2;
  5592. let yy = this.ui.secretary.height;
  5593. let scale = xGame.common.getSecretaryScale();
  5594. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5595. xGame.common.secretary.play(data, 1, true, parent);
  5596. }
  5597. closeSelf() {
  5598. this.hide();
  5599. }
  5600. normalGetAward() {
  5601. let sameDay = xGame.common.judgeSameDay();
  5602. if (!sameDay) {
  5603. let award = cfgTable.signData[this.curDayIndex + 1].award;
  5604. let temp;
  5605. let type;
  5606. let num;
  5607. let arr = [];
  5608. for (let index = 0; index < award.length; index++) {
  5609. temp = award[index].split("-");
  5610. type = parseInt(temp[0]);
  5611. num = parseInt(temp[1]);
  5612. let awardType = new AwardType();
  5613. awardType.num = num;
  5614. awardType.type = type;
  5615. arr.push(awardType);
  5616. }
  5617. xGame.common.getAward(arr, (watchVideo) => {
  5618. this.curDayIndex++;
  5619. if (this.curDayIndex > 7)
  5620. this.curDayIndex = 0;
  5621. DataMgr.setSignData(this.curDayIndex);
  5622. DataMgr.setSignTime(new Date().getTime());
  5623. if (watchVideo) {
  5624. DataMgr.setExtraSign(1);
  5625. Moyu.sendDataEvent("signIn1");
  5626. }
  5627. this.updateSign();
  5628. });
  5629. }
  5630. }
  5631. againGetAward() {
  5632. Moyu.sendDataEvent("signIn2");
  5633. Moyu.showVideoAd(() => {
  5634. let index = this.curDayIndex;
  5635. if (index == 0)
  5636. index = 7;
  5637. let award = cfgTable.signData[index].award;
  5638. let temp;
  5639. let type;
  5640. let num;
  5641. for (let index = 0; index < award.length; index++) {
  5642. temp = award[index].split("-");
  5643. type = parseInt(temp[0]);
  5644. num = parseInt(temp[1]) * 3;
  5645. xGame.common.playObjFlyAnim(num, type);
  5646. }
  5647. DataMgr.setExtraSign(1);
  5648. this.updateSign();
  5649. }, EAdType.againSign);
  5650. }
  5651. }
  5652. UISign.uiName = "UISign";
  5653. class ui_UISkill extends fgui.GComponent {
  5654. static createInstance() {
  5655. return (fgui.UIPackage.createObject("game", "UISkill"));
  5656. }
  5657. onConstruct() {
  5658. this.n48 = (this.getChild("n48"));
  5659. this.n0 = (this.getChild("n0"));
  5660. this.secretary = (this.getChild("secretary"));
  5661. this.talkNode = (this.getChild("talkNode"));
  5662. this.closeNode = (this.getChild("closeNode"));
  5663. this.moneyNode = (this.getChild("moneyNode"));
  5664. this.skillNode = (this.getChild("skillNode"));
  5665. this.guideNode = (this.getChild("guideNode"));
  5666. }
  5667. }
  5668. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  5669. class SkillDisplay {
  5670. constructor(ui, data, uiIndex) {
  5671. this.starX = 0;
  5672. this.starY = 0;
  5673. this.index = 0;
  5674. this.ui = ui;
  5675. this.data = data;
  5676. this.index = uiIndex;
  5677. this.initSelf();
  5678. console.log('zh:SkillDisplay constructor this.skillData=', data);
  5679. }
  5680. initSelf() {
  5681. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  5682. this.ui.nameTxt.text = this.data.name;
  5683. this.ui.describeTxt.text = this.data.describe;
  5684. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  5685. this.ui.startBtn.onClick(this, this.startGame);
  5686. this.updateSelf();
  5687. }
  5688. updateSelf() {
  5689. this.checkTry();
  5690. let level = DataMgr.getBigSkillByIndex(this.index);
  5691. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  5692. }
  5693. checkTry() {
  5694. let index = this.index;
  5695. let level = DataMgr.getBigSkillByIndex(index);
  5696. if (level == null) {
  5697. DataMgr.setBigSkill(index, 1, false);
  5698. level = 1;
  5699. }
  5700. this.ui.levelTxt.text = "LV." + level;
  5701. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  5702. this.ui.tryNode.visible = true;
  5703. else
  5704. this.ui.tryNode.visible = false;
  5705. }
  5706. clickAddLevel() {
  5707. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5708. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  5709. Moyu.showVideoAd(() => {
  5710. DataMgr.setBigSkill(this.data.index, 1);
  5711. this.updateSelf();
  5712. xGame.common.upSkillLevel = true;
  5713. }, EAdType.upSkill);
  5714. }
  5715. startGame() {
  5716. if (this.data.index == 3) {
  5717. alert('期待吧');
  5718. return;
  5719. }
  5720. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5721. let needCoin = xGame.common.bigMoveNeedCoin;
  5722. xGame.common.passAwardCoin = 2000;
  5723. let guide = DataMgr.getSkillGuide();
  5724. console.log('zh:startGame guide=' + guide);
  5725. xGame.common.temSelfLevel = 0;
  5726. if (guide == 0) {
  5727. needCoin = 0;
  5728. xGame.common.temSelfLevel = 100;
  5729. }
  5730. if (DataMgr.coinEnough(needCoin)) {
  5731. DataMgr.setCoin(-needCoin);
  5732. xGame.common.curPlayerSkillType = this.index;
  5733. if (guide == 0)
  5734. xGame.common.curPlayerSkillType = 0;
  5735. xGame.uiMgr.Show(UIGame);
  5736. xGame.uiMgr.Hide(UIMain);
  5737. xGame.uiMgr.Show(UIMatching, () => {
  5738. xGame.common.gameUI.ui.alpha = 1;
  5739. xGame.common.gameUI.startGame();
  5740. xGame.uiMgr.Hide(UISkill);
  5741. });
  5742. }
  5743. else {
  5744. xGame.uiMgr.Show(UIAddProp, 0);
  5745. Moyu.sendDataEvent("AddCoinVideo");
  5746. }
  5747. }
  5748. }
  5749. class UISkill extends UIBase {
  5750. constructor() {
  5751. super();
  5752. this.skillData = [];
  5753. }
  5754. onConstructor() {
  5755. this.ui = ui_UISkill.createInstance();
  5756. this.contentPane = this.ui;
  5757. this.isEject = false;
  5758. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5759. this.initSkillData();
  5760. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  5761. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  5762. this.displayList = [];
  5763. this.ui.skillNode.skillList.numItems = 4;
  5764. this.addUIClick(this.ui, this.interuptSecretary);
  5765. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  5766. this.ui.talkNode.visible = false;
  5767. if (Moyu.isKs)
  5768. this.ui.closeNode.closeBtn.x += 100;
  5769. }
  5770. show() {
  5771. super.show();
  5772. this.playSecretaryIdle();
  5773. this.moneyNode.ui.c1.selectedIndex = 1;
  5774. Laya.timer.clearAll(this);
  5775. xGame.soundMgr.playSound("s_start");
  5776. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5777. let guide = DataMgr.getSkillGuide();
  5778. this.ui.guideNode.visible = guide == 0;
  5779. let item = this.getSkillItemByUIIndex(0);
  5780. if (guide == 0) {
  5781. item.ui.c1.selectedIndex = 1;
  5782. }
  5783. else {
  5784. item.ui.c1.selectedIndex = 0;
  5785. }
  5786. this.ui.guideNode.guideBtn.visible = guide == 0;
  5787. for (let index = 0; index < this.displayList.length; index++) {
  5788. this.displayList[index].checkTry();
  5789. }
  5790. }
  5791. getSkillItemByUIIndex(cur) {
  5792. for (let index = 0; index < this.displayList.length; index++) {
  5793. if (this.displayList[index].index == cur) {
  5794. return this.displayList[index];
  5795. }
  5796. }
  5797. }
  5798. enterGuideLevel() {
  5799. let item = this.getSkillItemByUIIndex(0);
  5800. item.startGame();
  5801. if (DataMgr.getNewUser())
  5802. Moyu.sendDataEvent("gameStart1");
  5803. }
  5804. initSkillData() {
  5805. this.skillData = [];
  5806. let nameList = xGame.common.skillNameList;
  5807. let iconList = xGame.common.skillIconList;
  5808. let describeList = [
  5809. "Jump shot executed — ball bounced and pocketed an extra one!",
  5810. "Bonus Sweep: A random follow-up strike hits 1 extra ball after your shot!",
  5811. "Freeze Effect: Your shot freezes 1 random ball — enemy can’t hit it, and others bounce off!"
  5812. ];
  5813. let data;
  5814. for (let index = 0; index < nameList.length; index++) {
  5815. data = {};
  5816. data.name = nameList[index];
  5817. data.icon = iconList[index];
  5818. data.describe = describeList[index];
  5819. data.index = index;
  5820. this.skillData.push(data);
  5821. }
  5822. }
  5823. updateSkillItem(index, target) {
  5824. if (this.displayList[index] == null) {
  5825. let uiIndex;
  5826. switch (index) {
  5827. case 0:
  5828. uiIndex = 1;
  5829. break;
  5830. case 1:
  5831. uiIndex = 0;
  5832. break;
  5833. case 2:
  5834. uiIndex = 2;
  5835. break;
  5836. case 3:
  5837. uiIndex = 3;
  5838. break;
  5839. default:
  5840. break;
  5841. }
  5842. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  5843. this.displayList.push(temp);
  5844. }
  5845. }
  5846. playSecretaryIdle() {
  5847. let parent = this.ui.secretary.displayObject;
  5848. parent.destroyChildren();
  5849. let xx = this.ui.secretary.width / 2;
  5850. let yy = this.ui.secretary.height;
  5851. let scale = xGame.common.getSecretaryScale();
  5852. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5853. xGame.common.secretary.play(data, 1, true, parent);
  5854. }
  5855. returnUIMain() {
  5856. this.hide();
  5857. xGame.common.stopGirlPop(this.ui.talkNode);
  5858. xGame.uiMgr.Show(UIMain);
  5859. }
  5860. interuptSecretary() {
  5861. Laya.timer.clearAll(this);
  5862. this.playSecretaryRandomSound();
  5863. }
  5864. playSecretaryRandomSound() {
  5865. if (this.isHide)
  5866. return;
  5867. let time = xGame.common.randomNum(45000, 60000);
  5868. Laya.timer.once(time, this, () => {
  5869. if (this.isHide)
  5870. return;
  5871. let index = xGame.common.randomNum(4, 7);
  5872. xGame.soundMgr.playSound("s_main0" + index);
  5873. let words = 1;
  5874. switch (index) {
  5875. case 4:
  5876. words = 5;
  5877. break;
  5878. case 5:
  5879. words = 3;
  5880. break;
  5881. case 6:
  5882. words = 6;
  5883. break;
  5884. case 7:
  5885. words = 7;
  5886. break;
  5887. default:
  5888. break;
  5889. }
  5890. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5891. this.playSecretaryRandomSound();
  5892. });
  5893. }
  5894. }
  5895. UISkill.uiName = "UISkill";
  5896. class ui_UIMsg extends fgui.GComponent {
  5897. static createInstance() {
  5898. return (fgui.UIPackage.createObject("game", "UIMsg"));
  5899. }
  5900. onConstruct() {
  5901. this.tipsNode = (this.getChild("tipsNode"));
  5902. }
  5903. }
  5904. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  5905. class UIMsg extends UIBase {
  5906. constructor() {
  5907. super();
  5908. }
  5909. onConstructor() {
  5910. this.ui = ui_UIMsg.createInstance();
  5911. this.contentPane = this.ui;
  5912. this.isEject = false;
  5913. this.isMuti = true;
  5914. }
  5915. show(msg, callback) {
  5916. super.show();
  5917. this.ui.tipsNode.msgTxt.text = msg;
  5918. this.ui.alpha = 1;
  5919. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  5920. this.hide();
  5921. callback && callback();
  5922. }), 1000);
  5923. }
  5924. }
  5925. UIMsg.uiName = "UIMsg";
  5926. class ui_UIModeSelection extends fgui.GComponent {
  5927. static createInstance() {
  5928. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  5929. }
  5930. onConstruct() {
  5931. this.n19 = (this.getChild("n19"));
  5932. this.closeBtn = (this.getChild("closeBtn"));
  5933. this.myNode = (this.getChild("myNode"));
  5934. this.t0 = this.getTransition("t0");
  5935. }
  5936. }
  5937. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  5938. class UIModeSelection extends UIBase {
  5939. constructor() {
  5940. super();
  5941. }
  5942. onConstructor() {
  5943. this.ui = ui_UIModeSelection.createInstance();
  5944. this.contentPane = this.ui;
  5945. this.isEject = false;
  5946. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  5947. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  5948. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  5949. this.addUIClick(this.ui.closeBtn, this.hide);
  5950. this.peopleArr = [650, 6900, 3800];
  5951. this.peopleOffest = [50, 500, 200];
  5952. this.updateSelf();
  5953. }
  5954. show(callback) {
  5955. super.show();
  5956. this.ui.t0.play();
  5957. this.callback = callback;
  5958. }
  5959. updateSelf() {
  5960. let cfg = cfgTable.modeselectData;
  5961. for (let index = 1; index <= 3; index++) {
  5962. let node = this.ui.myNode["type" + index];
  5963. node.need.text = cfg[index].need;
  5964. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  5965. node.peopleTxt.text = this.getRandPeople(index - 1);
  5966. }
  5967. }
  5968. enterGame(type) {
  5969. xGame.common.classicRoomType = type;
  5970. let cfg = cfgTable.modeselectData[type];
  5971. let need = cfg.need;
  5972. xGame.common.passAwardCoin = cfg.award;
  5973. if (DataMgr.coinEnough(need)) {
  5974. DataMgr.setCoin(-need);
  5975. this.ui.myNode["type" + type].t0.play();
  5976. Laya.timer.once(200, this, () => {
  5977. this.callback && this.callback();
  5978. });
  5979. }
  5980. else {
  5981. Moyu.sendDataEvent("AddCoinVideo");
  5982. xGame.uiMgr.Show(UIAddProp, 0);
  5983. }
  5984. }
  5985. getRandPeople(index) {
  5986. let rand = this.peopleOffest[index];
  5987. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  5988. }
  5989. }
  5990. UIModeSelection.uiName = "UIModeSelection";
  5991. class UIMain extends UIBase {
  5992. constructor() {
  5993. super();
  5994. this.firstEnter = true;
  5995. }
  5996. onConstructor() {
  5997. this.ui = ui_UIMain.createInstance();
  5998. this.contentPane = this.ui;
  5999. this.isEject = false;
  6000. this.addEvent();
  6001. this.addClickSpine();
  6002. this.settingNode = new SettingNode(this.ui.settingNode);
  6003. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6004. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  6005. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  6006. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  6007. let curUse = DataMgr.getCurSecretary();
  6008. this.changeSecretary(curUse);
  6009. this.ui.talkNode.visible = false;
  6010. let guide = DataMgr.getSkillGuide();
  6011. if (xGame.common.isNewDay && guide == 1) {
  6012. xGame.common.isNewDay = false;
  6013. xGame.soundMgr.playSound("s_main01");
  6014. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6015. console.log("播放小秘书每天语音");
  6016. }
  6017. this.onGetUserInfo();
  6018. this.ui.n83.visible = false;
  6019. Moyu.setShareInfo("8Ball Fury", ["台球", "万宁", "桌球"], '2300002254');
  6020. }
  6021. changeSecretary(curUse) {
  6022. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  6023. xGame.common.secretary && xGame.common.secretary.dispose();
  6024. this.addSecretarySpine(name);
  6025. }
  6026. addSecretarySpine(name) {
  6027. let spine = new SpineMgr(name, () => {
  6028. this.playSecretaryIdle();
  6029. });
  6030. xGame.common.secretary = spine;
  6031. }
  6032. addClickSpine() {
  6033. let clickSpine = new SpineMgr("dianji", () => {
  6034. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  6035. let parent = Laya.stage;
  6036. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  6037. clickSpine.play(data, 0, false, parent, (spine) => {
  6038. spine.destroy(true);
  6039. });
  6040. });
  6041. });
  6042. }
  6043. addEvent() {
  6044. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  6045. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  6046. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  6047. this.addUIClick(this.ui.weeklyBtn, this.startWeekly);
  6048. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  6049. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  6050. this.addUIClick(this.ui, this.interuptSecretary);
  6051. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  6052. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  6053. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  6054. this.addUIClick(this.ui.shopBtn, this.openShopView);
  6055. this.addUIClick(this.ui.signBtn, this.openSignView);
  6056. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  6057. this.addUIClick(this.ui.rankBtn, this.openRanking);
  6058. }
  6059. show(showFailWords) {
  6060. super.show();
  6061. this.moneyNode.ui.c1.selectedIndex = 1;
  6062. this.playSecretaryIdle();
  6063. xGame.soundMgr.playMusic("caromhall01");
  6064. Laya.timer.clearAll(this);
  6065. this.playSecretaryRandomSound();
  6066. if (showFailWords) {
  6067. setTimeout(() => {
  6068. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  6069. let words = -1;
  6070. if (str == "s_main02") {
  6071. words = 2;
  6072. }
  6073. else {
  6074. words = 3;
  6075. }
  6076. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6077. xGame.soundMgr.playSound(str);
  6078. }, 300);
  6079. }
  6080. this.showGuide();
  6081. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  6082. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  6083. let guide = DataMgr.getSkillGuide();
  6084. if (guide == 1) {
  6085. let randTime = xGame.common.randomNum(300, 800);
  6086. if (this.firstEnter) {
  6087. this.firstEnter = false;
  6088. randTime += 900;
  6089. }
  6090. Laya.timer.once(randTime, this, () => {
  6091. xGame.common.autoPopUIView();
  6092. });
  6093. }
  6094. }
  6095. checkActive(show) {
  6096. }
  6097. showGuide() {
  6098. let guide = DataMgr.getSkillGuide();
  6099. this.ui.guideBtn.visible = guide == 0;
  6100. this.ui.enterGuide.visible = false;
  6101. this.ui.secretaryGuide.visible = guide == 0;
  6102. if (guide == 0) {
  6103. xGame.soundMgr.playSound("s_guide");
  6104. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6105. }
  6106. }
  6107. ensureSecretary() {
  6108. this.ui.secretaryGuide.visible = false;
  6109. this.ui.enterGuide.visible = true;
  6110. this.ui.wordsNode.t0.play();
  6111. if (DataMgr.getNewUser())
  6112. Moyu.sendDataEvent("gameReady");
  6113. }
  6114. playSecretaryIdle() {
  6115. let parent = this.ui.secretary.displayObject;
  6116. parent.destroyChildren();
  6117. let xx = this.ui.secretary.width / 2;
  6118. let yy = this.ui.secretary.height;
  6119. let scale = xGame.common.getSecretaryScale();
  6120. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6121. xGame.common.secretary.play(data, 1, true, parent);
  6122. }
  6123. startGame(type) {
  6124. xGame.common.gameMode = type;
  6125. Moyu.sendDataEvent("PlayGame", { type: type });
  6126. switch (xGame.common.gameMode) {
  6127. case GameMode.classic:
  6128. let challengeTimes = DataMgr.getChallengeTimes();
  6129. if (challengeTimes == 0) {
  6130. xGame.uiMgr.Show(UIInvitation);
  6131. }
  6132. else {
  6133. this.beginGame();
  6134. }
  6135. break;
  6136. case GameMode.bigMove:
  6137. this.beginGame();
  6138. if (DataMgr.getNewUser())
  6139. Moyu.sendDataEvent("gameStart0");
  6140. break;
  6141. default:
  6142. break;
  6143. }
  6144. }
  6145. beginGame(isNice = false) {
  6146. if (xGame.common.gameMode == GameMode.classic) {
  6147. if (isNice) {
  6148. this.enterClassic();
  6149. }
  6150. else {
  6151. xGame.uiMgr.Show(UIModeSelection, () => {
  6152. this.enterClassic();
  6153. });
  6154. }
  6155. }
  6156. else if (xGame.common.gameMode == GameMode.bigMove) {
  6157. this.ui.enterGuide.visible = false;
  6158. xGame.uiMgr.Show(UISkill);
  6159. }
  6160. }
  6161. enterClassic() {
  6162. xGame.uiMgr.Show(UIGame);
  6163. xGame.uiMgr.Show(UIMatching, () => {
  6164. if (!this.isHide)
  6165. this.hide();
  6166. xGame.common.gameUI.ui.alpha = 1;
  6167. xGame.common.gameUI.startGame();
  6168. xGame.uiMgr.Hide(UIGameEnd);
  6169. });
  6170. }
  6171. startGlobal() {
  6172. xGame.uiMgr.Show(UIMsg, "敬请期待~");
  6173. }
  6174. startWeekly() {
  6175. xGame.uiMgr.Show(UIMsg, "敬请期待~");
  6176. }
  6177. startPlaceBall() {
  6178. xGame.uiMgr.Show(UILevelDisplay);
  6179. }
  6180. hide() {
  6181. super.hide();
  6182. xGame.common.stopGirlPop(this.ui.talkNode);
  6183. }
  6184. onGetUserInfo(force = false) {
  6185. if (Moyu.isWx) {
  6186. let info = Moyu.getSystemInfo();
  6187. if (info)
  6188. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  6189. }
  6190. else {
  6191. Moyu.initUser(this, this.freshUser, force);
  6192. }
  6193. if (!Moyu.hasUserInfo) {
  6194. let user = Moyu.getUserInfo();
  6195. user.headIcon = 'res/ty_touxiang.png';
  6196. }
  6197. this.freshUser();
  6198. }
  6199. freshUser() {
  6200. let user = Moyu.getUserInfo();
  6201. if (!user.isAuth) {
  6202. user.headIcon = 'res/ty_touxiang.png';
  6203. }
  6204. else
  6205. DataMgr.upRankData();
  6206. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  6207. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  6208. }
  6209. interuptSecretary() {
  6210. Laya.timer.clearAll(this);
  6211. this.playSecretaryRandomSound();
  6212. }
  6213. playSecretaryRandomSound() {
  6214. if (this.isHide)
  6215. return;
  6216. let time = xGame.common.randomNum(45000, 60000);
  6217. Laya.timer.once(time, this, () => {
  6218. if (this.isHide)
  6219. return;
  6220. let index = xGame.common.randomNum(4, 7);
  6221. xGame.soundMgr.playSound("s_main0" + index);
  6222. let words = 1;
  6223. switch (index) {
  6224. case 4:
  6225. words = 5;
  6226. break;
  6227. case 5:
  6228. words = 3;
  6229. break;
  6230. case 6:
  6231. words = 6;
  6232. break;
  6233. case 7:
  6234. words = 7;
  6235. break;
  6236. default:
  6237. break;
  6238. }
  6239. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6240. this.playSecretaryRandomSound();
  6241. });
  6242. }
  6243. openSecretaryView() {
  6244. xGame.uiMgr.Show(UISecretary);
  6245. Moyu.sendDataEvent("secretary");
  6246. }
  6247. openShopView() {
  6248. xGame.uiMgr.Show(UIShop);
  6249. }
  6250. openSignView() {
  6251. xGame.uiMgr.Show(UISign);
  6252. }
  6253. openDrawView() {
  6254. xGame.uiMgr.Show(UIDraw);
  6255. }
  6256. openRanking() {
  6257. xGame.uiMgr.Show(UIRanking);
  6258. Moyu.sendDataEvent("rankingList");
  6259. }
  6260. }
  6261. UIMain.uiName = "UIMain";
  6262. class UIGameEnd extends UIBase {
  6263. constructor() {
  6264. super();
  6265. this.success = false;
  6266. this.awardCoinNum = 1000;
  6267. this.awardDiamondNum = 10;
  6268. }
  6269. onConstructor() {
  6270. this.ui = ui_UIGameEnd.createInstance();
  6271. this.contentPane = this.ui;
  6272. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  6273. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  6274. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  6275. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6276. this.ui.talkNode.visible = false;
  6277. if (Moyu.isKs)
  6278. this.ui.closeNode.closeBtn.x += 100;
  6279. }
  6280. updateType() {
  6281. switch (xGame.common.gameMode) {
  6282. case GameMode.classic:
  6283. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  6284. this.ui.coinNode.visible = this.success;
  6285. if (!this.success) {
  6286. Laya.timer.once(500, this, () => {
  6287. xGame.uiMgr.Show(UIAddCoin);
  6288. });
  6289. }
  6290. this.ui.isGetAward.visible = false;
  6291. this.ui.leftBtn.c1.selectedIndex = 3;
  6292. this.ui.rightBtn.c1.selectedIndex = 0;
  6293. this.moneyNode.ui.c1.selectedIndex = 1;
  6294. break;
  6295. case GameMode.bigMove:
  6296. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  6297. this.ui.coinNode.visible = this.success;
  6298. if (xGame.common.gameMode == GameMode.bigMove) {
  6299. if (this.success) {
  6300. DataMgr.setSkillSuccessTimes(1, true);
  6301. DataMgr.setSkillAccTimes(1);
  6302. }
  6303. else {
  6304. DataMgr.setSkillSuccessTimes(0, false);
  6305. }
  6306. }
  6307. if (!this.success) {
  6308. Laya.timer.once(500, this, () => {
  6309. xGame.uiMgr.Show(UIAddCoin);
  6310. });
  6311. }
  6312. this.ui.isGetAward.visible = false;
  6313. this.ui.leftBtn.c1.selectedIndex = 3;
  6314. this.ui.rightBtn.c1.selectedIndex = 0;
  6315. this.moneyNode.ui.c1.selectedIndex = 1;
  6316. break;
  6317. case GameMode.placeBall:
  6318. this.ui.coinNode.visible = false;
  6319. if (this.success) {
  6320. if (xGame.common.placeBallStarNum == 3) {
  6321. this.ui.c1.selectedIndex = 2;
  6322. }
  6323. else {
  6324. this.ui.c1.selectedIndex = 3;
  6325. }
  6326. }
  6327. else {
  6328. this.ui.c1.selectedIndex = 4;
  6329. }
  6330. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  6331. if (cfg.type == PlaceBallType.challenge) {
  6332. this.ui.c1.selectedIndex = 2;
  6333. }
  6334. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `打进场上所有球` : `打进${cfg.ball}颗球`;
  6335. this.updatePlaceBallBtn();
  6336. this.updatePlaceBallStarNum();
  6337. this.updatePlaceBallAwardState();
  6338. this.moneyNode.ui.c1.selectedIndex = 2;
  6339. this.moneyNode.checkPowerTime();
  6340. this.moneyNode.powerChange();
  6341. DataMgr.upRankData();
  6342. break;
  6343. default:
  6344. break;
  6345. }
  6346. }
  6347. updatePlaceBallBtn() {
  6348. this.ui.leftBtn.c1.selectedIndex = 5;
  6349. if (this.success) {
  6350. this.ui.rightBtn.c1.selectedIndex = 14;
  6351. }
  6352. else {
  6353. if (xGame.common.placeBallStarNum == 3) {
  6354. this.ui.rightBtn.c1.selectedIndex = 14;
  6355. }
  6356. else {
  6357. this.ui.rightBtn.c1.selectedIndex = 1;
  6358. }
  6359. }
  6360. }
  6361. updatePlaceBallStarNum() {
  6362. let starNum = xGame.common.placeBallStarNum;
  6363. if (starNum == 0)
  6364. this.ui.starNumNode.c1.selectedIndex = 3;
  6365. else {
  6366. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  6367. }
  6368. }
  6369. updatePlaceBallAwardState() {
  6370. let level = xGame.common.placeBallCurLevel;
  6371. let starNum = xGame.common.placeBallStarNum;
  6372. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  6373. let data = cfgTable.placeballData[level].award;
  6374. let cfg = cfgTable.placeballData[level];
  6375. this.awardDiamondNum = data[1];
  6376. this.awardCoinNum = data[0];
  6377. if (cfg.type == PlaceBallType.challenge) {
  6378. this.awardDiamondNum = 0;
  6379. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  6380. }
  6381. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  6382. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  6383. if (cfg.type == PlaceBallType.challenge) {
  6384. this.ui.awardNode.coinNode.visible = true;
  6385. }
  6386. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  6387. this.ui.awardNode.diamondNode.x = 265;
  6388. this.ui.awardNode.coinNode.x = 354;
  6389. }
  6390. else {
  6391. this.ui.awardNode.diamondNode.x = 291;
  6392. this.ui.awardNode.coinNode.x = 291;
  6393. }
  6394. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  6395. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  6396. if (this.awardCoinNum == 0) {
  6397. this.ui.awardNode.coinNode.numTxt.text = "";
  6398. }
  6399. if (getAward) {
  6400. this.ui.isGetAward.visible = true;
  6401. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  6402. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  6403. }
  6404. else {
  6405. this.ui.isGetAward.visible = false;
  6406. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  6407. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  6408. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  6409. }
  6410. else {
  6411. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  6412. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  6413. }
  6414. }
  6415. }
  6416. show(success) {
  6417. super.show();
  6418. xGame.eventMgr.event(RESET_GAME);
  6419. this.success = success;
  6420. Laya.timer.clearAll(this);
  6421. this.playSecretaryAni();
  6422. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  6423. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  6424. offsetTime = Math.floor(offsetTime / 1000);
  6425. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  6426. this.updateType();
  6427. Laya.timer.once(200, this, () => {
  6428. this.addAward(() => {
  6429. this.updateType();
  6430. Laya.timer.once(500, this, () => {
  6431. this.showChallengeLevel();
  6432. });
  6433. });
  6434. });
  6435. if (this.success) {
  6436. xGame.soundMgr.playSound('slots_roll01');
  6437. xGame.soundMgr.playSound("s_win");
  6438. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6439. }
  6440. else {
  6441. xGame.soundMgr.playSound('matchwin01');
  6442. xGame.soundMgr.playSound("s_lose");
  6443. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6444. }
  6445. if (!Moyu.isLegal)
  6446. PlatMgr.showBanner(true);
  6447. let challengeNum = DataMgr.getChallengeTimes();
  6448. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  6449. DataMgr.setChallengeTimes(1);
  6450. }
  6451. if (this.success && xGame.common.gameMode == GameMode.classic) {
  6452. DataMgr.setClassicTimes();
  6453. }
  6454. }
  6455. showChallengeLevel() {
  6456. if (DataMgr.getChallengeTimes() != 0)
  6457. return;
  6458. let skill = DataMgr.getSkillAccTimes();
  6459. let put = DataMgr.getPlaceBallLevelList().length;
  6460. if (skill >= 3 || put >= 5) {
  6461. xGame.uiMgr.Show(UIInvitation);
  6462. this.hide();
  6463. }
  6464. }
  6465. addAward(callback) {
  6466. if (!this.success) {
  6467. callback && callback();
  6468. return;
  6469. }
  6470. switch (xGame.common.gameMode) {
  6471. case GameMode.classic:
  6472. this.awardCoinNum = xGame.common.passAwardCoin;
  6473. this.awardDiamondNum = 0;
  6474. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  6475. break;
  6476. case GameMode.bigMove:
  6477. this.awardCoinNum = xGame.common.passAwardCoin;
  6478. this.awardDiamondNum = 0;
  6479. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  6480. callback && callback();
  6481. break;
  6482. case GameMode.placeBall:
  6483. let level = xGame.common.placeBallCurLevel;
  6484. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  6485. if (xGame.common.placeBallStarNum != 3) {
  6486. callback && callback();
  6487. return;
  6488. }
  6489. else {
  6490. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  6491. if (getAward) {
  6492. callback && callback();
  6493. return;
  6494. }
  6495. }
  6496. let cfg = cfgTable.placeballData[level];
  6497. let data = cfgTable.placeballData[level].award;
  6498. this.awardCoinNum = data[0];
  6499. this.awardDiamondNum = data[1];
  6500. if (cfg.type == PlaceBallType.challenge) {
  6501. this.awardDiamondNum = 0;
  6502. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  6503. }
  6504. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  6505. let diamondAward;
  6506. if (this.awardDiamondNum > 0) {
  6507. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  6508. xGame.common.getAward([diamondAward, coinAward], callback);
  6509. }
  6510. else {
  6511. xGame.common.getAward([coinAward], callback);
  6512. }
  6513. if (cfg.type == PlaceBallType.normal) {
  6514. DataMgr.setPlaceBallAward(level);
  6515. }
  6516. break;
  6517. default:
  6518. break;
  6519. }
  6520. }
  6521. playSecretaryAni() {
  6522. let parent = this.ui.secretary.displayObject;
  6523. parent.destroyChildren();
  6524. let xx = this.ui.secretary.width / 2;
  6525. let yy = this.ui.secretary.height;
  6526. let scale = xGame.common.getSecretaryScale();
  6527. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6528. if (this.success) {
  6529. let rand = Math.random() <= 0.5 ? 2 : 3;
  6530. xGame.common.secretary.play(data, rand, false, parent, () => {
  6531. xGame.common.secretary.play(data, 1, true, parent);
  6532. });
  6533. }
  6534. else {
  6535. xGame.common.secretary.play(data, 0, true, parent);
  6536. }
  6537. }
  6538. restartGame() {
  6539. switch (xGame.common.gameMode) {
  6540. case GameMode.classic:
  6541. xGame.eventMgr.event(RESTART_GAME);
  6542. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  6543. break;
  6544. case GameMode.bigMove:
  6545. this.hide();
  6546. xGame.eventMgr.event(RESTART_GAME);
  6547. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  6548. break;
  6549. default:
  6550. break;
  6551. }
  6552. }
  6553. hide() {
  6554. super.hide();
  6555. xGame.common.stopGirlPop(this.ui.talkNode);
  6556. PlatMgr.showBanner(false);
  6557. }
  6558. returnHome() {
  6559. this.hide();
  6560. let showFailWords = !this.success;
  6561. xGame.uiMgr.Show(UIMain, showFailWords);
  6562. }
  6563. clickLeftBtn() {
  6564. switch (xGame.common.gameMode) {
  6565. case GameMode.classic:
  6566. case GameMode.bigMove:
  6567. this.returnHome();
  6568. break;
  6569. case GameMode.placeBall:
  6570. let level = xGame.common.placeBallCurLevel;
  6571. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  6572. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  6573. break;
  6574. default:
  6575. break;
  6576. }
  6577. }
  6578. powerStartPlaceBallLevel(level, btn) {
  6579. if (DataMgr.powerEnough()) {
  6580. btn.touchable = false;
  6581. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  6582. btn.touchable = true;
  6583. DataMgr.setPower(-1);
  6584. xGame.eventMgr.event(POWER_TIME);
  6585. this.startPlaceBallLevel(level);
  6586. }));
  6587. }
  6588. else {
  6589. xGame.uiMgr.Show(UIPower, 0);
  6590. }
  6591. }
  6592. clickRightBtn() {
  6593. switch (xGame.common.gameMode) {
  6594. case GameMode.classic:
  6595. case GameMode.bigMove:
  6596. this.restartGame();
  6597. break;
  6598. case GameMode.placeBall:
  6599. let level = xGame.common.placeBallCurLevel;
  6600. let data = DataMgr.getPlaceBallLevel(level);
  6601. let curPss = data.play && !data.isCur;
  6602. if (curPss) {
  6603. this.powerStartPlaceBallLevel(level + 1, this.ui.rightBtn);
  6604. }
  6605. else {
  6606. Moyu.sendDataEvent("placeBallNextLevel");
  6607. Moyu.showVideoAd(() => {
  6608. DataMgr.setPlaceBallLevel(level, 1);
  6609. this.startPlaceBallLevel(level + 1);
  6610. }, xGame.define.EAdType.placeBallNextLevel);
  6611. }
  6612. break;
  6613. default:
  6614. break;
  6615. }
  6616. }
  6617. startPlaceBallLevel(level) {
  6618. xGame.common.gameMode = GameMode.placeBall;
  6619. xGame.common.placeBallCurLevel = level;
  6620. xGame.uiMgr.Show(UIGame);
  6621. this.hide();
  6622. }
  6623. }
  6624. UIGameEnd.uiName = "UIGameEnd";
  6625. class ui_UIRepentProp extends fgui.GComponent {
  6626. static createInstance() {
  6627. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  6628. }
  6629. onConstruct() {
  6630. this.c1 = this.getController("c1");
  6631. this.n11 = (this.getChild("n11"));
  6632. this.regretNode = (this.getChild("regretNode"));
  6633. this.helpLineNode = (this.getChild("helpLineNode"));
  6634. this.t0 = this.getTransition("t0");
  6635. }
  6636. }
  6637. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  6638. class UIRepentProp extends UIBase {
  6639. constructor() {
  6640. super();
  6641. this.viewType = 0;
  6642. this.regretType = 0;
  6643. }
  6644. onConstructor() {
  6645. this.ui = ui_UIRepentProp.createInstance();
  6646. this.contentPane = this.ui;
  6647. this.isEject = false;
  6648. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  6649. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  6650. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  6651. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  6652. }
  6653. show(viewType, regretType, callback) {
  6654. PlatMgr.showInsert(true);
  6655. this.viewType = viewType;
  6656. this.regretType = regretType;
  6657. this.callback = callback;
  6658. super.show();
  6659. this.ui.t0.play();
  6660. this.ui.c1.selectedIndex = this.viewType;
  6661. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  6662. if (this.viewType == 0) {
  6663. let guide = DataMgr.getGuideHelpLine();
  6664. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  6665. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  6666. }
  6667. xGame.common.gameMgr.gamePause = true;
  6668. }
  6669. hideSelf() {
  6670. xGame.common.gameMgr.gamePause = false;
  6671. this.callback && this.callback(false);
  6672. this.hide();
  6673. }
  6674. videoRegret() {
  6675. Moyu.showVideoAd(() => {
  6676. this.callback && this.callback(true);
  6677. this.hideSelf();
  6678. }, EAdType.regretBall);
  6679. }
  6680. videoAddHelpLine() {
  6681. let guide = DataMgr.getGuideHelpLine();
  6682. if (guide == 0) {
  6683. this.callback && this.callback(true);
  6684. this.hideSelf();
  6685. DataMgr.setGuideHelpLine();
  6686. xGame.common.gameUI.ui.guideNode.visible = false;
  6687. }
  6688. else {
  6689. Moyu.showVideoAd(() => {
  6690. this.callback && this.callback(true);
  6691. this.hideSelf();
  6692. }, EAdType.longHelpLine);
  6693. }
  6694. }
  6695. }
  6696. UIRepentProp.uiName = "UIRepentProp";
  6697. class ui_UIVideoShare extends fgui.GComponent {
  6698. static createInstance() {
  6699. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  6700. }
  6701. onConstruct() {
  6702. this.n10 = (this.getChild("n10"));
  6703. this.myNode = (this.getChild("myNode"));
  6704. this.t0 = this.getTransition("t0");
  6705. }
  6706. }
  6707. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  6708. class UIVideoShare extends UIBase {
  6709. constructor() {
  6710. super();
  6711. this.success = false;
  6712. this.awardNum = 0;
  6713. this.isShared = true;
  6714. }
  6715. onConstructor() {
  6716. this.ui = ui_UIVideoShare.createInstance();
  6717. this.contentPane = this.ui;
  6718. this.isEject = false;
  6719. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  6720. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  6721. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  6722. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  6723. }
  6724. show(success) {
  6725. super.show();
  6726. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  6727. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  6728. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  6729. this.success = success;
  6730. let time = xGame.common.randomNum(600, 1500);
  6731. Moyu.showInsertAd(time, 60000);
  6732. if (success)
  6733. xGame.soundMgr.playSound("applause");
  6734. this.ui.t0.play();
  6735. this.checkShareState();
  6736. let times = DataMgr.getDailyVideoShareTimes();
  6737. this.awardNum = times == 0 ? 2000 : 200;
  6738. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  6739. }
  6740. checkShareState() {
  6741. if (PlatMgr.forceShare == 0) {
  6742. this.ui.myNode.closeBtn.visible = true;
  6743. this.ui.myNode.tipsNode.visible = false;
  6744. this.ui.myNode.closeBtn.x = 90;
  6745. this.ui.myNode.shareBtn.x = 342;
  6746. }
  6747. else if (PlatMgr.forceShare == 1) {
  6748. this.ui.myNode.closeBtn.visible = false;
  6749. this.ui.myNode.tipsNode.visible = true;
  6750. this.ui.myNode.shareBtn.x = 218;
  6751. this.isShared = true;
  6752. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  6753. }
  6754. }
  6755. checkForceShare() {
  6756. this.isShared = !this.isShared;
  6757. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  6758. }
  6759. videoShare() {
  6760. if (PlatMgr.forceShare == 1) {
  6761. if (this.isShared) {
  6762. this.shareGame();
  6763. }
  6764. else {
  6765. this.hideSelf();
  6766. }
  6767. }
  6768. else {
  6769. this.shareGame();
  6770. }
  6771. }
  6772. shareGame() {
  6773. Moyu.sendDataEvent("VideoShare");
  6774. if (Moyu.canShare() > 100) {
  6775. Moyu.shareGame((success) => {
  6776. if (success) {
  6777. DataMgr.setDailyVideoShareTimes(1);
  6778. DataMgr.setCoin(this.awardNum);
  6779. }
  6780. this.hideSelf();
  6781. }, this);
  6782. }
  6783. else {
  6784. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  6785. this.hideSelf();
  6786. }
  6787. }
  6788. hideSelf() {
  6789. this.hide();
  6790. xGame.uiMgr.Show(UIGameEnd, this.success);
  6791. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  6792. xGame.common.screenImg.destroy();
  6793. xGame.common.screenImg = null;
  6794. }
  6795. }
  6796. }
  6797. UIVideoShare.uiName = "UIVideoShare";
  6798. class ui_UITips extends fgui.GComponent {
  6799. static createInstance() {
  6800. return (fgui.UIPackage.createObject("game", "UITips"));
  6801. }
  6802. onConstruct() {
  6803. this.n0 = (this.getChild("n0"));
  6804. this.myNode = (this.getChild("myNode"));
  6805. this.t0 = this.getTransition("t0");
  6806. }
  6807. }
  6808. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  6809. class UITips extends UIBase {
  6810. constructor() {
  6811. super();
  6812. this.type = 0;
  6813. }
  6814. onConstructor() {
  6815. this.ui = ui_UITips.createInstance();
  6816. this.contentPane = this.ui;
  6817. this.isEject = false;
  6818. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  6819. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  6820. }
  6821. show(tipsTxt, womanTxt, type) {
  6822. super.show();
  6823. this.ui.t0.play();
  6824. this.ui.myNode.tipsTxt.text = tipsTxt;
  6825. this.ui.myNode.womanTxt.text = womanTxt;
  6826. PlatMgr.showInsert(true);
  6827. this.ui.myNode.c1.selectedIndex = type;
  6828. this.type = type;
  6829. switch (this.type) {
  6830. case TipsType.exitGame:
  6831. xGame.common.gameMgr.gamePause = true;
  6832. break;
  6833. case TipsType.foul:
  6834. Laya.timer.once(200, this, () => {
  6835. xGame.common.gameMgr.gamePause = true;
  6836. });
  6837. break;
  6838. default:
  6839. break;
  6840. }
  6841. }
  6842. clickLeftBtn() {
  6843. this.hide();
  6844. xGame.common.gameMgr.gamePause = false;
  6845. switch (this.type) {
  6846. case TipsType.exitGame:
  6847. break;
  6848. case TipsType.foul:
  6849. break;
  6850. default:
  6851. break;
  6852. }
  6853. }
  6854. clickRightBtn() {
  6855. this.hide();
  6856. switch (this.type) {
  6857. case TipsType.exitGame:
  6858. xGame.eventMgr.event(RESET_GAME);
  6859. xGame.uiMgr.Show(UIMain);
  6860. Moyu.recordEnd(this, null);
  6861. xGame.common.longHelpLine = false;
  6862. break;
  6863. case TipsType.foul:
  6864. xGame.common.gameMgr.gamePause = false;
  6865. Laya.timer.clearAll(this);
  6866. break;
  6867. default:
  6868. break;
  6869. }
  6870. }
  6871. }
  6872. UITips.uiName = "UITips";
  6873. class GameMgr {
  6874. constructor() {
  6875. this.selfCamp = "";
  6876. this.selfFoulNum = 0;
  6877. this.selfBallArr = [];
  6878. this.selfTimer = 0;
  6879. this.selfScore = 0;
  6880. this.aiCamp = "";
  6881. this.aiFoulNum = 0;
  6882. this.aiBallArr = [];
  6883. this.aiTimer = 0;
  6884. this.aiScore = 0;
  6885. this.aiSkillLevelNum = 1;
  6886. this.targertScore = 0;
  6887. this.setTime = 30;
  6888. this.selfTurnRate = 0.5;
  6889. this.accTime = 0;
  6890. this.curFoul = "";
  6891. this.maxFoulTimes = 3;
  6892. this.isFirstInGame = true;
  6893. this.firstColliObj = null;
  6894. this.inHoleBalls = [];
  6895. this.blackNum = 8;
  6896. this.success = false;
  6897. this.holePosList = [];
  6898. this.posObj = {};
  6899. this._selfTurn = false;
  6900. this.lastRootBallPos = new Laya.Vector2(311, 430);
  6901. this.ensureBallType = false;
  6902. this.isOpenBall = true;
  6903. this.finishOneShoot = true;
  6904. this.isEnd = false;
  6905. this.isChangeTurn = false;
  6906. this.isInterrupt = false;
  6907. this.aiPlayedBreakArmy = false;
  6908. this.isTouchedBall = false;
  6909. this.finishBalls = 0;
  6910. this.needBalls = 0;
  6911. this.allBallNum = 0;
  6912. this.placeBallPosData = {};
  6913. this.curHP = 0;
  6914. this.showLongView = false;
  6915. this.firstShoot = true;
  6916. this._gamePause = false;
  6917. this.trunCount = 0;
  6918. this.isBlackInHole = false;
  6919. this.isEnter = true;
  6920. xGame.eventMgr.offAll(ALL_BALL_STOP);
  6921. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  6922. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  6923. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  6924. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  6925. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  6926. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  6927. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  6928. }
  6929. get gamePause() {
  6930. return this._gamePause;
  6931. }
  6932. set gamePause(v) {
  6933. if (v) {
  6934. Laya.physicsTimer.pause();
  6935. }
  6936. else {
  6937. Laya.physicsTimer.resume();
  6938. }
  6939. this._gamePause = v;
  6940. }
  6941. get selfTurn() {
  6942. return this._selfTurn;
  6943. }
  6944. set selfTurn(val) {
  6945. this.trunCount++;
  6946. this._selfTurn = val;
  6947. if (val) {
  6948. xGame.common.d2World.d2Gan.ui.self.visible = true;
  6949. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  6950. }
  6951. else {
  6952. xGame.common.d2World.d2Gan.ui.self.visible = false;
  6953. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  6954. if (this.trunCount > 1)
  6955. PlatMgr.openBox();
  6956. }
  6957. }
  6958. resetGame() {
  6959. this.inHoleBalls = [];
  6960. this.isFirstInGame = true;
  6961. this.firstColliObj = null;
  6962. this.aiCamp = "";
  6963. this.selfCamp = "";
  6964. this.aiFoulNum = 0;
  6965. this.selfFoulNum = 0;
  6966. this.selfBallArr = [];
  6967. this.aiBallArr = [];
  6968. this.gamePause = false;
  6969. this.ensureBallType = false;
  6970. this.isInterrupt = false;
  6971. this.updateLeftBall();
  6972. this.clearTime();
  6973. this.aiPlayedBreakArmy = false;
  6974. this.isBlackInHole = false;
  6975. this.placeBallPosData = {};
  6976. if (xGame.common.d3World.knifeRoot) {
  6977. xGame.common.d3World.knifeRoot.destroyChildren();
  6978. }
  6979. }
  6980. gameReady() {
  6981. this.trunCount = 0;
  6982. this.firstColliObj = null;
  6983. this.isFirstInGame = true;
  6984. this.selfTurn = Math.random() <= this.selfTurnRate;
  6985. let challengeNum = DataMgr.getChallengeTimes();
  6986. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  6987. this.selfTurn = true;
  6988. }
  6989. if (xGame.common.gameMode == GameMode.placeBall)
  6990. this.selfTurn = true;
  6991. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  6992. this.selfTurn = true;
  6993. }
  6994. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  6995. this.checkGuide();
  6996. if (xGame.common.uiRodMethod)
  6997. xGame.common.uiRodMethod.resetRod();
  6998. xGame.common.d2World.getHelpLine();
  6999. this.isOpenBall = true;
  7000. this.isTouchedBall = false;
  7001. xGame.common.aiPlayer.stopRun();
  7002. this.setTime = 30;
  7003. let ui = xGame.common.gameUI.ui;
  7004. switch (xGame.common.gameMode) {
  7005. case GameMode.classic:
  7006. xGame.common.aiPlayer.init();
  7007. this.blackNum = 8;
  7008. this.placeRootBall();
  7009. this.peoplePlay(9, 10);
  7010. ui.wordsBtn.visible = true;
  7011. ui.aiWordsBtn.visible = true;
  7012. xGame.common.talkMgr.changeAIState(true);
  7013. DataMgr.gameData.gameCount++;
  7014. DataMgr.saveGameData();
  7015. break;
  7016. case GameMode.bigMove:
  7017. this.blackNum = -1;
  7018. this.selfScore = 0;
  7019. this.aiScore = 0;
  7020. xGame.common.aiPlayer.init();
  7021. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  7022. this.updateSelfScore();
  7023. this.updateAIScore();
  7024. this.updateTargetSroce();
  7025. this.placeRootBall();
  7026. this.peoplePlay(9, 10);
  7027. ui.wordsBtn.visible = true;
  7028. ui.aiWordsBtn.visible = true;
  7029. xGame.common.talkMgr.changeAIState(true);
  7030. if (DataMgr.getSkillGuide() < 1)
  7031. DataMgr.gameData.gameCount = 0;
  7032. else {
  7033. DataMgr.gameData.gameCount++;
  7034. DataMgr.saveGameData();
  7035. PlatMgr.openTry();
  7036. }
  7037. if (xGame.common.d3World.knifeRoot) {
  7038. xGame.common.d3World.knifeRoot.destroyChildren();
  7039. }
  7040. break;
  7041. case GameMode.placeBall:
  7042. this.blackNum = -1;
  7043. this.selfTurn = true;
  7044. this.setTime = 10000;
  7045. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  7046. this.curHP = this.placeBallData.hp;
  7047. if (this.placeBallData.ball == -1)
  7048. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  7049. else
  7050. this.needBalls = this.placeBallData.ball;
  7051. console.log("需要的进球数目", this.needBalls);
  7052. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  7053. this.finishBalls = 0;
  7054. this.placeBallPosData = {};
  7055. this.updatePlaceBallPos();
  7056. this.updatePlaceBallState();
  7057. this.finishOneShoot = true;
  7058. xGame.common.gameUI.ui.moveNode.visible = false;
  7059. this.isOpenBall = false;
  7060. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  7061. ui.wordsBtn.visible = false;
  7062. ui.aiWordsBtn.visible = false;
  7063. xGame.common.talkMgr.changeAIState(false);
  7064. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  7065. PlatMgr.openBox();
  7066. });
  7067. break;
  7068. default:
  7069. break;
  7070. }
  7071. this.showLongView = false;
  7072. xGame.common.wordsMgr.comboTimes = 1;
  7073. let guide = DataMgr.getSkillGuide();
  7074. if (guide)
  7075. xGame.eventMgr.event(WAIT_SHOOT);
  7076. xGame.common.upSkillLevel = false;
  7077. xGame.common.gameStartTime = new Date().getTime();
  7078. this.firstShoot = true;
  7079. }
  7080. checkGuide() {
  7081. let guide = DataMgr.getSkillGuide();
  7082. let gameUI = xGame.common.gameUI.ui;
  7083. gameUI.guide1.visible = false;
  7084. gameUI.guide2.visible = false;
  7085. gameUI.guide3.visible = false;
  7086. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  7087. this.selfTurn = true;
  7088. }
  7089. else {
  7090. return;
  7091. }
  7092. let oneBall = this.getOneBall();
  7093. gameUI.guide1.visible = true;
  7094. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  7095. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  7096. }
  7097. getOneBall() {
  7098. let arr = xGame.common.d2World.ballArr;
  7099. for (let index = 0; index < arr.length; index++) {
  7100. if (arr[index].number == 0)
  7101. continue;
  7102. return arr[index];
  7103. }
  7104. }
  7105. updateSelfScore() {
  7106. let ui = xGame.common.gameUI.ui.topNode;
  7107. ui.selfScoreTxt.text = this.selfScore + "";
  7108. }
  7109. updateAIScore() {
  7110. let ui = xGame.common.gameUI.ui.topNode;
  7111. ui.aiScoreTxt.text = this.aiScore + "";
  7112. }
  7113. updateTargetSroce() {
  7114. let ui = xGame.common.gameUI.ui.topNode;
  7115. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  7116. }
  7117. updateLeftBall() {
  7118. let topUI = xGame.common.gameUI.ui.topNode;
  7119. topUI.selfBallList.numItems = this.selfBallArr.length;
  7120. topUI.aiBallList.numItems = this.aiBallArr.length;
  7121. }
  7122. ballShoot() {
  7123. this.clearTime();
  7124. this.finishOneShoot = false;
  7125. xGame.common.gameUI.ui.moveNode.visible = false;
  7126. if (xGame.common.gameUI.ui.guideNode.visible) {
  7127. xGame.common.gameUI.ui.guideNode.visible = false;
  7128. }
  7129. if (this.firstShoot) {
  7130. this.firstShoot = false;
  7131. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  7132. }
  7133. }
  7134. ensureCamp(number) {
  7135. this.ensureBallType = true;
  7136. this.isOpenBall = false;
  7137. if (xGame.common.gameMode != GameMode.classic)
  7138. return;
  7139. let full = [1, 2, 3, 4, 5, 6, 7];
  7140. let flower = [9, 10, 11, 12, 13, 14, 15];
  7141. let sayWords = "";
  7142. if (this.selfTurn) {
  7143. if (number <= 7) {
  7144. this.selfCamp = ballCamp.full;
  7145. this.selfBallArr = full;
  7146. this.aiCamp = ballCamp.flower;
  7147. this.aiBallArr = flower;
  7148. sayWords = cfgTable.wordsData[3].msg;
  7149. }
  7150. else {
  7151. this.selfCamp = ballCamp.flower;
  7152. this.selfBallArr = flower;
  7153. this.aiCamp = ballCamp.full;
  7154. this.aiBallArr = full;
  7155. sayWords = cfgTable.wordsData[4].msg;
  7156. }
  7157. }
  7158. else {
  7159. if (number <= 7) {
  7160. this.selfCamp = ballCamp.flower;
  7161. this.selfBallArr = flower;
  7162. this.aiCamp = ballCamp.full;
  7163. this.aiBallArr = full;
  7164. sayWords = cfgTable.wordsData[2].msg;
  7165. }
  7166. else {
  7167. this.selfCamp = ballCamp.full;
  7168. this.selfBallArr = full;
  7169. this.aiCamp = ballCamp.flower;
  7170. this.aiBallArr = flower;
  7171. sayWords = cfgTable.wordsData[1].msg;
  7172. }
  7173. }
  7174. this.updateLeftBall();
  7175. xGame.uiMgr.Show(UIMsg, sayWords);
  7176. }
  7177. updatePlaceBallState() {
  7178. let ui = xGame.common.gameUI.ui;
  7179. switch (this.placeBallData.type) {
  7180. case PlaceBallType.normal:
  7181. let normal = ui.placeNormalNode;
  7182. normal.hpTxt.text = this.curHP + "";
  7183. this.updatePlaceBallStar(normal);
  7184. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  7185. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  7186. break;
  7187. case PlaceBallType.challenge:
  7188. let challenge = ui.placeChallengeNode;
  7189. challenge.hpTxt.text = "杆数:" + this.curHP;
  7190. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  7191. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  7192. challenge.tipsTxt.text = `打进${this.needBalls}颗球`;
  7193. break;
  7194. default:
  7195. break;
  7196. }
  7197. }
  7198. playSubHpAni() {
  7199. let ui = xGame.common.gameUI.ui;
  7200. switch (this.placeBallData.type) {
  7201. case PlaceBallType.normal:
  7202. let normal = ui.placeNormalNode;
  7203. normal.hpTxt.visible = false;
  7204. normal.starAni.c1.selectedIndex = 1;
  7205. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  7206. normal.hpTxt.visible = true;
  7207. normal.starAni.c1.selectedIndex = 0;
  7208. }));
  7209. break;
  7210. default:
  7211. break;
  7212. }
  7213. }
  7214. getEndStarNum() {
  7215. let num;
  7216. let level = xGame.common.placeBallCurLevel;
  7217. if (this.curHP == this.placeBallData.hp) {
  7218. num = 3;
  7219. }
  7220. else if (this.curHP <= 1) {
  7221. num = 1;
  7222. }
  7223. else {
  7224. num = 2;
  7225. }
  7226. if (!this.success) {
  7227. num = 0;
  7228. }
  7229. else {
  7230. DataMgr.setPlaceBallLevel(level, num);
  7231. }
  7232. let myType = cfgTable.placeballData[level].type;
  7233. if (this.success && myType == 1) {
  7234. num = 3;
  7235. }
  7236. xGame.common.placeBallStarNum = num;
  7237. }
  7238. updatePlaceBallStar(node) {
  7239. let star = 0;
  7240. if (this.curHP == this.placeBallData.hp) {
  7241. star = 3;
  7242. }
  7243. else if (this.curHP >= 2) {
  7244. star = 2;
  7245. }
  7246. else if (this.curHP == 1) {
  7247. star = 1;
  7248. }
  7249. else {
  7250. star = 0;
  7251. }
  7252. let temp;
  7253. for (let index = 1; index <= 3; index++) {
  7254. temp = node["star" + index];
  7255. temp.c1.selectedIndex = star >= index ? 1 : 0;
  7256. }
  7257. node.myProgress.value = (star / 3) * 100;
  7258. }
  7259. openRegretView(isFoul, GoalNum, challenge = false) {
  7260. let regretType = -1;
  7261. if (isFoul) {
  7262. regretType = 1;
  7263. }
  7264. else {
  7265. if (GoalNum <= 0) {
  7266. regretType = 0;
  7267. }
  7268. }
  7269. if (challenge) {
  7270. regretType = 1;
  7271. }
  7272. if (regretType != -1) {
  7273. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  7274. if (success) {
  7275. this.curHP++;
  7276. this.updatePlaceBallState();
  7277. this.setPlaceBallAllPos();
  7278. xGame.common.gameUI.ui.moveNode.visible = false;
  7279. }
  7280. else {
  7281. if (this.curHP <= 0) {
  7282. this.success = false;
  7283. this.gameEnd();
  7284. }
  7285. this.playSubHpAni();
  7286. }
  7287. this.updatePlaceBallState();
  7288. this.updatePlaceBallPos();
  7289. });
  7290. }
  7291. }
  7292. setPlaceBallAllPos() {
  7293. let allBall = xGame.common.d2World.ballArr;
  7294. let cfgArr = this.placeBallPosData;
  7295. let temp;
  7296. let obj;
  7297. for (let index = 0; index < allBall.length; index++) {
  7298. temp = allBall[index];
  7299. if (temp.destroyed)
  7300. continue;
  7301. obj = cfgArr[temp.myUNID];
  7302. if (obj && obj.src && !obj.src.destroyed) {
  7303. temp.gameObj.x = obj.posX;
  7304. temp.gameObj.y = obj.posY;
  7305. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  7306. }
  7307. }
  7308. xGame.common.d2World.getHelpLine();
  7309. }
  7310. updatePlaceBallPos() {
  7311. let arr = xGame.common.d2World.ballArr;
  7312. let temp;
  7313. for (let index = 0; index < arr.length; index++) {
  7314. temp = arr[index];
  7315. if (!this.placeBallPosData[temp.myUNID]) {
  7316. this.placeBallPosData[temp.myUNID] = {
  7317. src: temp,
  7318. posX: temp.gameObj.x,
  7319. posY: temp.gameObj.y
  7320. };
  7321. }
  7322. else {
  7323. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  7324. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  7325. }
  7326. }
  7327. let check;
  7328. for (const key in this.placeBallPosData) {
  7329. check = this.placeBallPosData[key];
  7330. if (check.src.destroyed) {
  7331. delete this.placeBallPosData[key];
  7332. }
  7333. }
  7334. }
  7335. gameRun(type) {
  7336. if (this.gamePause)
  7337. return;
  7338. this.curFoul = this.getFoulType();
  7339. if (type) {
  7340. xGame.common.d2World.d2Gan.shoot();
  7341. xGame.common.gameUI.forceCancel();
  7342. this.curFoul = type;
  7343. }
  7344. this.isEnd = false;
  7345. this.isChangeTurn = true;
  7346. if (xGame.common.gameMode == GameMode.classic) {
  7347. this.judgeClassic(this.curFoul);
  7348. this.checkClassicWords(() => {
  7349. xGame.common.destroyClassicEmotion();
  7350. if (this.isEnd) {
  7351. if (this.isBlackInHole) {
  7352. xGame.common.gameUI.ui.blackAni.visible = true;
  7353. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  7354. xGame.common.gameUI.ui.blackAni.visible = false;
  7355. this.gameEnd();
  7356. }));
  7357. }
  7358. else {
  7359. this.gameEnd();
  7360. }
  7361. }
  7362. else {
  7363. this.waitShoot();
  7364. xGame.eventMgr.event(WAIT_SHOOT);
  7365. }
  7366. });
  7367. }
  7368. else if (xGame.common.gameMode == GameMode.bigMove) {
  7369. xGame.common.aiPlayer.stopRun();
  7370. let scoreArr = this.getScore(this.curFoul);
  7371. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  7372. this.isEnd = true;
  7373. }
  7374. this.checkBigSkillWords(() => {
  7375. if (this.isEnd) {
  7376. this.gameEnd();
  7377. }
  7378. else {
  7379. this.waitShoot();
  7380. xGame.eventMgr.event(WAIT_SHOOT);
  7381. }
  7382. });
  7383. }
  7384. else if (xGame.common.gameMode == GameMode.placeBall) {
  7385. xGame.common.destroyAwardSpine();
  7386. let isFoul = this.curFoul == FoulType.rootHole;
  7387. let GoalNum = this.inHoleBalls.length;
  7388. if (this.inHoleBalls.indexOf(0) > -1)
  7389. GoalNum -= 1;
  7390. if (isFoul) {
  7391. this.placeRootBall();
  7392. }
  7393. console.log("neeballs", this.needBalls);
  7394. console.log("当前完成的goalNum", GoalNum);
  7395. this.finishBalls += GoalNum;
  7396. console.log("当前完成的finishballs", this.finishBalls);
  7397. let need = this.needBalls;
  7398. if (this.placeBallData.type == PlaceBallType.challenge) {
  7399. need += 100;
  7400. }
  7401. if (this.finishBalls >= need) {
  7402. this.success = true;
  7403. this.gameEnd();
  7404. }
  7405. else {
  7406. switch (this.placeBallData.type) {
  7407. case PlaceBallType.normal:
  7408. if (!isFoul && GoalNum > 0) {
  7409. this.updatePlaceBallPos();
  7410. this.updatePlaceBallState();
  7411. }
  7412. else {
  7413. this.curHP--;
  7414. this.openRegretView(isFoul, GoalNum);
  7415. }
  7416. this.waitShoot();
  7417. xGame.eventMgr.event(WAIT_SHOOT);
  7418. break;
  7419. case PlaceBallType.challenge:
  7420. this.curHP--;
  7421. this.updatePlaceBallState();
  7422. if (isFoul) {
  7423. this.openRegretView(isFoul, GoalNum, true);
  7424. }
  7425. else {
  7426. this.updatePlaceBallPos();
  7427. if (this.curHP <= 0) {
  7428. this.success = true;
  7429. this.gameEnd();
  7430. }
  7431. }
  7432. this.waitShoot();
  7433. xGame.eventMgr.event(WAIT_SHOOT);
  7434. break;
  7435. default:
  7436. break;
  7437. }
  7438. }
  7439. }
  7440. }
  7441. checkClassicWords(callback) {
  7442. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  7443. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  7444. let type = this.getClassicWordsType();
  7445. if (condition && type != -1) {
  7446. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  7447. xGame.soundMgr.playSound(str);
  7448. xGame.common.wordsMgr.playClassicWords(type, callback);
  7449. }
  7450. else {
  7451. Laya.timer.once(300, this, () => {
  7452. callback && callback();
  7453. });
  7454. }
  7455. }
  7456. getClassicWordsType() {
  7457. let d2world = xGame.common.d2World;
  7458. let type = -1;
  7459. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  7460. type = ClassicWordsType.perfectShow;
  7461. return type;
  7462. }
  7463. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  7464. type = ClassicWordsType.directShoot;
  7465. return type;
  7466. }
  7467. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  7468. type = ClassicWordsType.anotherShoot;
  7469. return type;
  7470. }
  7471. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  7472. type = ClassicWordsType.bigPower;
  7473. return type;
  7474. }
  7475. let minSpeed = 1;
  7476. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  7477. type = ClassicWordsType.hardShoot;
  7478. return type;
  7479. }
  7480. if (this.inHoleBalls.length > 0) {
  7481. type = ClassicWordsType.directShoot;
  7482. return type;
  7483. }
  7484. return type;
  7485. }
  7486. checkBigSkillWords(callback) {
  7487. if (this.curFoul == FoulType.timeOut) {
  7488. callback && callback();
  7489. }
  7490. else {
  7491. let playSkill = false;
  7492. if (this.selfTurn) {
  7493. playSkill = true;
  7494. }
  7495. else {
  7496. if (!this.aiPlayedBreakArmy) {
  7497. this.aiPlayedBreakArmy = true;
  7498. playSkill = true;
  7499. }
  7500. if (this.aiCurSkill != SkillType.breakArmy) {
  7501. playSkill = true;
  7502. }
  7503. }
  7504. if (xGame.common.skillMgr.playedLastSkill) {
  7505. xGame.common.skillMgr.playedLastSkill = false;
  7506. playSkill = false;
  7507. }
  7508. if (playSkill) {
  7509. xGame.common.skillMgr.runBigSkill((extraScore) => {
  7510. let selfExtra = 0;
  7511. let aiExtra = 0;
  7512. if (this.selfTurn)
  7513. selfExtra += extraScore;
  7514. else
  7515. aiExtra += extraScore;
  7516. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  7517. this.isEnd = true;
  7518. }
  7519. this.playBigSkillTimes(callback);
  7520. });
  7521. }
  7522. else {
  7523. this.playBigSkillTimes(callback);
  7524. }
  7525. }
  7526. }
  7527. playBigSkillTimes(callback) {
  7528. let length = this.inHoleBalls.length;
  7529. if (this.inHoleBalls.indexOf(0) > -1) {
  7530. length = this.inHoleBalls.length - 1;
  7531. }
  7532. if (length <= 0) {
  7533. callback && callback();
  7534. return;
  7535. }
  7536. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  7537. callback && callback();
  7538. });
  7539. }
  7540. playSkillTips() {
  7541. let levelNum = 0;
  7542. let curType;
  7543. if (this.selfTurn) {
  7544. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  7545. curType = this.selfCurSkill;
  7546. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  7547. levelNum += 5;
  7548. }
  7549. }
  7550. else {
  7551. levelNum = this.aiSkillLevelNum;
  7552. curType = this.aiCurSkill;
  7553. }
  7554. let str = ``;
  7555. switch (curType) {
  7556. case SkillType.highSpace:
  7557. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  7558. break;
  7559. case SkillType.breakArmy:
  7560. str = `You pocketed ${levelNum} extra balls`;
  7561. break;
  7562. case SkillType.ice:
  7563. str = `${levelNum * 2} extra balls were frozen`;
  7564. break;
  7565. case SkillType.fireworks:
  7566. str = `${levelNum} extra balls exploded `;
  7567. break;
  7568. case SkillType.GuanYu:
  7569. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  7570. break;
  7571. default:
  7572. break;
  7573. }
  7574. xGame.uiMgr.Show(UIMsg, str);
  7575. }
  7576. getFoulType() {
  7577. let foulType = "";
  7578. if (this.firstColliObj == null) {
  7579. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  7580. return FoulType.rootHole;
  7581. }
  7582. return FoulType.notTouch;
  7583. }
  7584. else {
  7585. if (this.selfTurn) {
  7586. if (this.selfBallArr.length > 0) {
  7587. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  7588. foulType = FoulType.wrongTouch;
  7589. }
  7590. }
  7591. else {
  7592. if (this.ensureBallType) {
  7593. }
  7594. else {
  7595. if (this.firstColliObj == this.blackNum) {
  7596. foulType = FoulType.wrongTouch;
  7597. }
  7598. }
  7599. }
  7600. }
  7601. else {
  7602. if (this.aiBallArr.length > 0) {
  7603. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  7604. foulType = FoulType.wrongTouch;
  7605. }
  7606. }
  7607. else {
  7608. if (this.ensureBallType) {
  7609. }
  7610. else {
  7611. if (this.firstColliObj == this.blackNum) {
  7612. foulType = FoulType.wrongTouch;
  7613. }
  7614. }
  7615. }
  7616. }
  7617. if (this.inHoleBalls.length <= 0) {
  7618. return foulType;
  7619. }
  7620. let temp;
  7621. if (this.inHoleBalls.indexOf(0) > -1) {
  7622. foulType = FoulType.rootHole;
  7623. }
  7624. else {
  7625. for (let index = 0; index < this.inHoleBalls.length; index++) {
  7626. temp = this.inHoleBalls[index];
  7627. if (this.selfTurn) {
  7628. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  7629. foulType = FoulType.wrongHole;
  7630. break;
  7631. }
  7632. }
  7633. else {
  7634. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  7635. foulType = FoulType.wrongHole;
  7636. break;
  7637. }
  7638. }
  7639. }
  7640. }
  7641. let foo;
  7642. for (let index = 0; index < this.inHoleBalls.length; index++) {
  7643. temp = this.inHoleBalls[index];
  7644. foo = this.selfBallArr.indexOf(temp);
  7645. if (foo > -1) {
  7646. this.selfBallArr.splice(foo, 1);
  7647. }
  7648. foo = this.aiBallArr.indexOf(temp);
  7649. if (foo > -1) {
  7650. this.aiBallArr.splice(foo, 1);
  7651. }
  7652. }
  7653. this.updateLeftBall();
  7654. }
  7655. return foulType;
  7656. }
  7657. judgeGameEndByBlack(arr) {
  7658. if (this.selfTurn) {
  7659. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  7660. this.selfFoulNum = this.maxFoulTimes;
  7661. return true;
  7662. }
  7663. }
  7664. else {
  7665. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  7666. this.aiFoulNum = this.maxFoulTimes;
  7667. return true;
  7668. }
  7669. }
  7670. }
  7671. judgeClassic(type) {
  7672. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  7673. xGame.common.aiPlayer.stopRun();
  7674. if (this.judgeNormalSuccess()) {
  7675. this.isEnd = true;
  7676. return;
  7677. }
  7678. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  7679. if (this.selfTurn) {
  7680. if (isFoul) {
  7681. this.selfFoulNum++;
  7682. }
  7683. if (this.selfFoulNum >= this.maxFoulTimes) {
  7684. this.success = false;
  7685. this.isEnd = true;
  7686. return;
  7687. }
  7688. }
  7689. else {
  7690. if (isFoul)
  7691. this.aiFoulNum++;
  7692. if (this.aiFoulNum >= this.maxFoulTimes) {
  7693. this.success = true;
  7694. this.isEnd = true;
  7695. return;
  7696. }
  7697. }
  7698. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  7699. this.isChangeTurn = false;
  7700. }
  7701. else {
  7702. this.isInterrupt = true;
  7703. }
  7704. }
  7705. waitShoot() {
  7706. if (xGame.common.gameMode == GameMode.classic) {
  7707. switch (this.curFoul) {
  7708. case FoulType.timeOut:
  7709. case FoulType.rootHole:
  7710. this.selfTurn = !this.selfTurn;
  7711. this.peoplePlay(5, 6, true);
  7712. break;
  7713. case FoulType.notTouch:
  7714. this.selfTurn = !this.selfTurn;
  7715. this.peoplePlay(7, 7);
  7716. break;
  7717. case FoulType.wrongHole:
  7718. this.selfTurn = !this.selfTurn;
  7719. this.peoplePlay(11, 11);
  7720. break;
  7721. default:
  7722. if (this.inHoleBalls.length > 0) {
  7723. this.peoplePlay(0, 0, false, false);
  7724. }
  7725. else {
  7726. this.selfTurn = !this.selfTurn;
  7727. this.peoplePlay(7, 7);
  7728. }
  7729. break;
  7730. }
  7731. }
  7732. else if (xGame.common.gameMode == GameMode.bigMove) {
  7733. if (this.curFoul == FoulType.timeOut) {
  7734. this.selfTurn = !this.selfTurn;
  7735. this.peoplePlay(14, 15);
  7736. this.placeRootBall();
  7737. }
  7738. else {
  7739. this.selfTurn = !this.selfTurn;
  7740. if (this.curFoul == FoulType.rootHole) {
  7741. this.peoplePlay(12, 13);
  7742. this.placeRootBall();
  7743. }
  7744. else {
  7745. this.peoplePlay(0, 0, false, false);
  7746. }
  7747. }
  7748. }
  7749. else if (xGame.common.gameMode == GameMode.placeBall) {
  7750. this.finishOneShoot = true;
  7751. }
  7752. this.gameResult();
  7753. }
  7754. gameResult() {
  7755. this.firstColliObj = null;
  7756. this.inHoleBalls = [];
  7757. let curX = xGame.common.d2World.rootBall.gameObj.x;
  7758. let curY = xGame.common.d2World.rootBall.gameObj.y;
  7759. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  7760. if (xGame.common.uiRodMethod)
  7761. xGame.common.uiRodMethod.resetRod();
  7762. xGame.common.d2World.rootBall.showSelf();
  7763. this.clearIceSkill();
  7764. if (this.selfTurn) {
  7765. console.log("gameResult");
  7766. PlatMgr.gameInsert();
  7767. }
  7768. xGame.common.d3World.knifeRoot.destroyChildren();
  7769. if (this.selfTurn) {
  7770. xGame.common.gameUI.showHelpLineGuide();
  7771. xGame.common.gameUI.setTurnAlpha(true);
  7772. }
  7773. else {
  7774. xGame.common.gameUI.setTurnAlpha(false);
  7775. }
  7776. }
  7777. getScore(type) {
  7778. let selfAdd = 0;
  7779. let aiAdd = 0;
  7780. if (type == FoulType.timeOut) {
  7781. if (this.selfTurn)
  7782. aiAdd += 3;
  7783. else
  7784. selfAdd += 3;
  7785. }
  7786. else {
  7787. if (this.inHoleBalls.length > 0) {
  7788. if (this.selfTurn) {
  7789. if (type == FoulType.rootHole) {
  7790. aiAdd += 3;
  7791. if (this.inHoleBalls.length - 1 > 0) {
  7792. selfAdd += this.inHoleBalls.length - 1;
  7793. }
  7794. }
  7795. else {
  7796. selfAdd += this.inHoleBalls.length;
  7797. }
  7798. }
  7799. else {
  7800. if (type == FoulType.rootHole) {
  7801. selfAdd += 3;
  7802. if (this.inHoleBalls.length - 1 > 0) {
  7803. aiAdd += this.inHoleBalls.length - 1;
  7804. }
  7805. }
  7806. else {
  7807. aiAdd += this.inHoleBalls.length;
  7808. }
  7809. }
  7810. }
  7811. }
  7812. return [selfAdd, aiAdd];
  7813. }
  7814. judgeScoreEnd(selfAdd, aiAdd) {
  7815. this.selfScore += selfAdd;
  7816. this.aiScore += aiAdd;
  7817. this.updateAIScore();
  7818. this.updateSelfScore();
  7819. if (this.selfScore >= this.targertScore) {
  7820. this.success = true;
  7821. return true;
  7822. }
  7823. if (this.aiScore >= this.targertScore) {
  7824. this.success = false;
  7825. return true;
  7826. }
  7827. let ballArr = xGame.common.d2World.ballArr;
  7828. if (ballArr.length == 1 && ballArr[0].number == 0) {
  7829. if (this.selfScore > this.aiScore) {
  7830. this.success = true;
  7831. return true;
  7832. }
  7833. else if (this.selfScore < this.aiScore) {
  7834. this.success = false;
  7835. return true;
  7836. }
  7837. else {
  7838. if (this.selfTurn) {
  7839. this.success = false;
  7840. }
  7841. else {
  7842. this.success = true;
  7843. }
  7844. return true;
  7845. }
  7846. }
  7847. }
  7848. clearIceSkill() {
  7849. let arr = xGame.common.d2World.ballArr;
  7850. let temp;
  7851. if (this.selfTurn) {
  7852. if (this.selfCurSkill == SkillType.ice) {
  7853. for (let index = 0; index < arr.length; index++) {
  7854. temp = arr[index];
  7855. if (temp.ballFunc == "ice") {
  7856. temp.setBallFunc("normal", "self");
  7857. }
  7858. }
  7859. }
  7860. }
  7861. else {
  7862. if (this.aiCurSkill == SkillType.ice) {
  7863. for (let index = 0; index < arr.length; index++) {
  7864. temp = arr[index];
  7865. if (temp.ballFunc == "ice") {
  7866. temp.setBallFunc("normal", "ai");
  7867. }
  7868. }
  7869. }
  7870. }
  7871. }
  7872. judgeNormalSuccess() {
  7873. if (this.selfTurn) {
  7874. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  7875. this.success = true;
  7876. return true;
  7877. }
  7878. }
  7879. else {
  7880. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  7881. this.success = false;
  7882. return true;
  7883. }
  7884. }
  7885. }
  7886. gameEnd() {
  7887. if (Moyu.isTT) {
  7888. xGame.common.screenImg = getScreenImg();
  7889. }
  7890. console.log("游戏结束", this.success);
  7891. xGame.common.aiPlayer.stopRun();
  7892. if (xGame.common.gameMode == GameMode.placeBall) {
  7893. this.getEndStarNum();
  7894. this.updatePlaceBallState();
  7895. }
  7896. this.isEnter = false;
  7897. Moyu.recordEnd(this, () => {
  7898. if (this.isEnter)
  7899. return;
  7900. this.isEnter = true;
  7901. console.log("进入录结束回调");
  7902. this.enterNext();
  7903. });
  7904. Laya.timer.once(1000, this, () => {
  7905. if (this.isEnter)
  7906. return;
  7907. this.isEnter = true;
  7908. this.enterNext();
  7909. });
  7910. xGame.common.longHelpLine = false;
  7911. }
  7912. enterNext() {
  7913. Laya.timer.clearAll(this);
  7914. if (Moyu.canShare() > 100 || Moyu.isKs) {
  7915. xGame.uiMgr.Show(UIVideoShare, this.success);
  7916. }
  7917. else {
  7918. xGame.uiMgr.Show(UIGameEnd, this.success);
  7919. }
  7920. }
  7921. aiLeave() {
  7922. let ui = xGame.common.gameUI.ui;
  7923. ui.topNode.aiNameTxt.text = "offline";
  7924. }
  7925. aiGameEnd(suc) {
  7926. this.success = suc;
  7927. xGame.common.aiPlayer.stopRun();
  7928. if (this.success) {
  7929. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  7930. Laya.timer.once(1000, this, () => {
  7931. this.clearTime();
  7932. this.gameEnd();
  7933. });
  7934. }
  7935. }
  7936. openTimer() {
  7937. let src = xGame.common.gameUI;
  7938. if (this.selfTurn) {
  7939. src.ui.topNode.selfProgress.visible = true;
  7940. src.ui.topNode.aiProgress.visible = false;
  7941. this.curTimer = src.ui.topNode.selfProgress;
  7942. }
  7943. else {
  7944. src.ui.topNode.selfProgress.visible = false;
  7945. src.ui.topNode.aiProgress.visible = true;
  7946. this.curTimer = src.ui.topNode.aiProgress;
  7947. }
  7948. this.accTime = 0;
  7949. Laya.timer.clearAll(this);
  7950. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  7951. this.curTimer.value = 100;
  7952. }
  7953. updateTime(dt) {
  7954. if (this.gamePause)
  7955. return;
  7956. this.accTime += dt;
  7957. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  7958. if (this.accTime >= this.setTime) {
  7959. this.clearTime();
  7960. console.log("时钟进入了gameRun");
  7961. this.gameRun(FoulType.timeOut);
  7962. }
  7963. }
  7964. clearTime() {
  7965. let src = xGame.common.gameUI;
  7966. src.ui.topNode.selfProgress.visible = false;
  7967. src.ui.topNode.aiProgress.visible = false;
  7968. Laya.timer.clearAll(this);
  7969. }
  7970. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  7971. let ui = xGame.common.gameUI.ui;
  7972. let selfMsg, aiMsg;
  7973. if (sayWords) {
  7974. selfMsg = cfgTable.wordsData[selfIndex].msg;
  7975. aiMsg = cfgTable.wordsData[aiIndex].msg;
  7976. if (Foul) {
  7977. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  7978. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  7979. this.placeRootBall();
  7980. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  7981. if (this.curFoul == FoulType.rootHole) {
  7982. if (!DataMgr.getRootBallFoul()) {
  7983. DataMgr.setRootBallFoul();
  7984. aiMsg = "";
  7985. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  7986. let woman = "Boss, pay attention next time~";
  7987. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  7988. }
  7989. }
  7990. else if (this.curFoul == FoulType.timeOut) {
  7991. if (!DataMgr.getTimeoutFoul()) {
  7992. DataMgr.setTimeoutFoul();
  7993. aiMsg = "";
  7994. let tips = "Game timeout, 3 fouls, this game failed.";
  7995. let woman = "Boss, pay attention to the timeline~";
  7996. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  7997. }
  7998. }
  7999. }
  8000. }
  8001. }
  8002. if (this.selfTurn) {
  8003. if (sayWords) {
  8004. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  8005. ui.selfTurn.visible = true;
  8006. ui.aiTurn.visible = false;
  8007. ui.selfTurn.t0.play();
  8008. Moyu.vibration();
  8009. });
  8010. }
  8011. }
  8012. else {
  8013. let aiNum = xGame.tools.random(1, 11);
  8014. let challengeNum = DataMgr.getChallengeTimes();
  8015. let delay = false;
  8016. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8017. aiNum = 9;
  8018. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  8019. aiNum = 3;
  8020. if (challengeNum == 3) {
  8021. if (!this.showLongView) {
  8022. this.showLongView = true;
  8023. delay = true;
  8024. }
  8025. }
  8026. }
  8027. }
  8028. if (delay) {
  8029. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  8030. if (success) {
  8031. xGame.common.longHelpLine = true;
  8032. xGame.common.d2World.getHelpLine();
  8033. }
  8034. else {
  8035. aiNum = 10;
  8036. }
  8037. xGame.common.aiPlayer.setAiLevel(aiNum);
  8038. if (sayWords) {
  8039. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  8040. xGame.common.aiPlayer.runAI();
  8041. ui.selfTurn.visible = false;
  8042. ui.aiTurn.visible = true;
  8043. ui.aiTurn.t0.play();
  8044. });
  8045. }
  8046. else {
  8047. xGame.common.aiPlayer.runAI();
  8048. }
  8049. this.openTimer();
  8050. this.finishOneShoot = true;
  8051. if (this.selfTurn) {
  8052. ui.topNode.selfKuang.visible = true;
  8053. ui.topNode.aiKuang.visible = false;
  8054. ui.topNode.selfTips.visible = true;
  8055. ui.topNode.aiTips.visible = false;
  8056. }
  8057. else {
  8058. ui.topNode.selfKuang.visible = false;
  8059. ui.topNode.aiKuang.visible = true;
  8060. ui.topNode.selfTips.visible = false;
  8061. ui.topNode.aiTips.visible = true;
  8062. }
  8063. });
  8064. return;
  8065. }
  8066. if (xGame.common.gameMode == GameMode.classic) {
  8067. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  8068. if (cfg) {
  8069. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  8070. aiNum = aiLevel;
  8071. }
  8072. }
  8073. xGame.common.aiPlayer.setAiLevel(aiNum);
  8074. if (sayWords) {
  8075. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  8076. xGame.common.aiPlayer.runAI();
  8077. ui.selfTurn.visible = false;
  8078. ui.aiTurn.visible = true;
  8079. ui.aiTurn.t0.play();
  8080. });
  8081. }
  8082. else {
  8083. xGame.common.aiPlayer.runAI();
  8084. }
  8085. }
  8086. this.openTimer();
  8087. this.finishOneShoot = true;
  8088. if (this.selfTurn) {
  8089. ui.topNode.selfKuang.visible = true;
  8090. ui.topNode.aiKuang.visible = false;
  8091. ui.topNode.selfTips.visible = true;
  8092. ui.topNode.aiTips.visible = false;
  8093. }
  8094. else {
  8095. ui.topNode.selfKuang.visible = false;
  8096. ui.topNode.aiKuang.visible = true;
  8097. ui.topNode.selfTips.visible = false;
  8098. ui.topNode.aiTips.visible = true;
  8099. }
  8100. }
  8101. placeRootBall() {
  8102. let rootBall = xGame.common.d2World.rootBall;
  8103. if (!rootBall)
  8104. return;
  8105. rootBall.gameObj.x = this.lastRootBallPos.x;
  8106. rootBall.gameObj.y = this.lastRootBallPos.y;
  8107. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  8108. let moveNode = xGame.common.gameUI.ui.moveNode;
  8109. moveNode.visible = true;
  8110. moveNode.x = this.lastRootBallPos.x;
  8111. moveNode.y = this.lastRootBallPos.y;
  8112. if (!this.selfTurn) {
  8113. xGame.common.aiPlayer.resetRoot();
  8114. }
  8115. }
  8116. }
  8117. class ui_guanyuAni extends fgui.GComponent {
  8118. static createInstance() {
  8119. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  8120. }
  8121. onConstruct() {
  8122. this.n0 = (this.getChild("n0"));
  8123. }
  8124. }
  8125. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  8126. class UIFireworks extends UIBase {
  8127. constructor() {
  8128. super();
  8129. }
  8130. onConstructor() {
  8131. this.isEject = false;
  8132. }
  8133. show(callback) {
  8134. super.show();
  8135. }
  8136. }
  8137. UIFireworks.uiName = "UIFireworks";
  8138. class ui_UIGuanYu extends fgui.GComponent {
  8139. static createInstance() {
  8140. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  8141. }
  8142. onConstruct() {
  8143. this.n2 = (this.getChild("n2"));
  8144. this.n1 = (this.getChild("n1"));
  8145. this.n3 = (this.getChild("n3"));
  8146. this.n4 = (this.getChild("n4"));
  8147. this.n5 = (this.getChild("n5"));
  8148. this.n6 = (this.getChild("n6"));
  8149. this.n8 = (this.getChild("n8"));
  8150. this.n7 = (this.getChild("n7"));
  8151. this.t0 = this.getTransition("t0");
  8152. }
  8153. }
  8154. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  8155. class UIGuanYu extends UIBase {
  8156. constructor() {
  8157. super();
  8158. }
  8159. onConstructor() {
  8160. this.ui = ui_UIGuanYu.createInstance();
  8161. this.contentPane = this.ui;
  8162. this.isEject = false;
  8163. }
  8164. show(callback) {
  8165. super.show();
  8166. this.ui.t0.play(Laya.Handler.create(this, () => {
  8167. callback && callback();
  8168. this.hide();
  8169. }));
  8170. }
  8171. }
  8172. UIGuanYu.uiName = "UIGuanYu";
  8173. class SkillMgr {
  8174. constructor() {
  8175. this.leveNum = 0;
  8176. this.extraScore = 0;
  8177. this.selfTurn = false;
  8178. this.playedLastSkill = false;
  8179. this.tweenArr = [];
  8180. this._finishNum = 0;
  8181. this._curFinish = 0;
  8182. this._rootX = 0;
  8183. this._rootY = 0;
  8184. this.knifeTimes = 0;
  8185. this.knifeV2 = new Laya.Vector2();
  8186. this.knifeV3 = new Laya.Vector3();
  8187. this.rtStarX = 0;
  8188. this.rtStarY = 0;
  8189. this.addBigSkillSpine();
  8190. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8191. }
  8192. addBigSkillSpine() {
  8193. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  8194. console.log("extra2 success");
  8195. });
  8196. }
  8197. runBigSkill(callback) {
  8198. this.tweenArr = [];
  8199. this.callback = callback;
  8200. this.judgeSkill();
  8201. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  8202. let guide = DataMgr.getSkillGuide();
  8203. if (!xGame.common.gameMgr.selfTurn) {
  8204. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  8205. }
  8206. else {
  8207. if (xGame.common.temSelfLevel != 0) {
  8208. this.leveNum = xGame.common.temSelfLevel;
  8209. }
  8210. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  8211. this.leveNum += 5;
  8212. }
  8213. }
  8214. if (guide == 0) {
  8215. DataMgr.setSkillGuide(1);
  8216. if (DataMgr.getNewUser()) {
  8217. Moyu.sendDataEvent("gameFirstPlay");
  8218. DataMgr.setNewUser();
  8219. }
  8220. }
  8221. this.playSpineAni(() => {
  8222. switch (this.curSkill) {
  8223. case SkillType.highSpace:
  8224. this.runHighSpace();
  8225. break;
  8226. case SkillType.breakArmy:
  8227. this.runBreakArmy();
  8228. break;
  8229. case SkillType.ice:
  8230. this.runIce();
  8231. break;
  8232. case SkillType.fireworks:
  8233. this.runFireworks();
  8234. break;
  8235. case SkillType.GuanYu:
  8236. this.runGuanYu();
  8237. break;
  8238. default:
  8239. break;
  8240. }
  8241. });
  8242. }
  8243. judgeSkill() {
  8244. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  8245. let gameMgr = xGame.common.gameMgr;
  8246. let type;
  8247. for (let index = 0; index < typeArr.length; index++) {
  8248. type = typeArr[index];
  8249. if (gameMgr.selfTurn) {
  8250. if (gameMgr.selfCurSkill == type) {
  8251. this.selfTurn = true;
  8252. this.curSkill = type;
  8253. return;
  8254. }
  8255. }
  8256. else {
  8257. if (gameMgr.aiCurSkill == type) {
  8258. this.selfTurn = false;
  8259. this.curSkill = type;
  8260. return;
  8261. }
  8262. }
  8263. }
  8264. }
  8265. playSpineAni(callback) {
  8266. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  8267. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  8268. parent.destroyChildren();
  8269. let aniIndex = 0;
  8270. let skillSpine;
  8271. switch (this.curSkill) {
  8272. case SkillType.highSpace:
  8273. aniIndex = 1;
  8274. xGame.soundMgr.playSound("skill01");
  8275. skillSpine = this.skillSpine2;
  8276. data.scaleX = 0.5;
  8277. data.scaleY = 0.5;
  8278. skillSpine.play(data, 1, false, parent, () => {
  8279. callback && callback();
  8280. });
  8281. break;
  8282. case SkillType.breakArmy:
  8283. aniIndex = 2;
  8284. xGame.soundMgr.playSound("skill02");
  8285. skillSpine = this.skillSpine2;
  8286. data.scaleX = 0.5;
  8287. data.scaleY = 0.5;
  8288. skillSpine.play(data, 2, false, parent, () => {
  8289. callback && callback();
  8290. });
  8291. break;
  8292. case SkillType.ice:
  8293. aniIndex = 0;
  8294. xGame.soundMgr.playSound("skill03");
  8295. skillSpine = this.skillSpine2;
  8296. data.scaleX = 0.5;
  8297. data.scaleY = 0.5;
  8298. skillSpine.play(data, 0, false, parent, () => {
  8299. callback && callback();
  8300. });
  8301. break;
  8302. case SkillType.fireworks:
  8303. xGame.soundMgr.playSound("skill_04_01");
  8304. xGame.soundMgr.playSound("skill04");
  8305. xGame.uiMgr.Show(UIFireworks, callback);
  8306. break;
  8307. case SkillType.GuanYu:
  8308. xGame.soundMgr.playSound("skill05_1");
  8309. xGame.soundMgr.playSound("skill05");
  8310. xGame.uiMgr.Show(UIGuanYu, callback);
  8311. break;
  8312. default:
  8313. break;
  8314. }
  8315. }
  8316. getAllBallArr() {
  8317. let arr = xGame.common.d2World.ballArr;
  8318. let outArr = [];
  8319. for (let index = 0; index < arr.length; index++) {
  8320. if (arr[index] instanceof D2RootBallSrc)
  8321. continue;
  8322. if (arr[index].ballFunc == "ice")
  8323. continue;
  8324. if (arr[index].destroyed)
  8325. continue;
  8326. outArr.push(arr[index]);
  8327. }
  8328. return outArr;
  8329. }
  8330. getOneArr(deletObj) {
  8331. let allArr = this.getAllBallArr();
  8332. let temp;
  8333. for (let index = 0; index < allArr.length; index++) {
  8334. temp = allArr[index];
  8335. if (temp.id == deletObj.id) {
  8336. allArr.splice(index, 1);
  8337. break;
  8338. }
  8339. }
  8340. return allArr;
  8341. }
  8342. getNearBallBag(ball) {
  8343. let ui = xGame.common.gameUI.ui;
  8344. let circleArr = [];
  8345. for (let index = 1; index <= 6; index++) {
  8346. circleArr.push(ui.border["circle" + index]);
  8347. }
  8348. let outIndex = 0;
  8349. let temp;
  8350. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  8351. ;
  8352. let dis = 0;
  8353. for (let index = 1; index < circleArr.length; index++) {
  8354. temp = circleArr[index];
  8355. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  8356. if (dis < min) {
  8357. min = dis;
  8358. outIndex = index;
  8359. }
  8360. }
  8361. return [circleArr[outIndex], outIndex];
  8362. }
  8363. ballFlyToBag(ballArr, time = 300) {
  8364. let temp;
  8365. let hole;
  8366. this._finishNum = ballArr.length;
  8367. this._curFinish = 0;
  8368. let holeObj = {};
  8369. let holeCfg = {
  8370. "1": 0,
  8371. "2": 0,
  8372. "3": 0,
  8373. "4": 0,
  8374. "5": 0,
  8375. "6": 0
  8376. };
  8377. for (let index = 0; index < ballArr.length; index++) {
  8378. temp = ballArr[index];
  8379. temp.outColli.isSensor = true;
  8380. temp.innerColli.isSensor = true;
  8381. temp.isRunSkillAni = true;
  8382. let holeArr = this.getNearBallBag(temp);
  8383. hole = holeArr[0];
  8384. holeObj[index] = holeArr[1];
  8385. temp.d3BallSrc.scaleXYZ = 0.5;
  8386. this.tweenArr.push(temp.d3BallSrc, temp);
  8387. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  8388. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  8389. }));
  8390. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  8391. let mIndex = holeObj[this._curFinish];
  8392. let isDone = holeCfg[mIndex];
  8393. if (isDone) {
  8394. ballArr[this._curFinish].checkWrongBall(false);
  8395. }
  8396. else {
  8397. holeCfg[mIndex] = 1;
  8398. ballArr[this._curFinish].checkWrongBall();
  8399. }
  8400. this._curFinish++;
  8401. if (this._curFinish >= this._finishNum) {
  8402. if (this.curSkill == SkillType.highSpace) {
  8403. }
  8404. else if (this.curSkill == SkillType.breakArmy) {
  8405. let rootBall = xGame.common.d2World.rootBall;
  8406. rootBall.gameObj.x = this._rootX;
  8407. rootBall.gameObj.y = this._rootY;
  8408. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  8409. xGame.common.d2World.d2Gan.ui.visible = true;
  8410. xGame.common.d2World.d2HelpLine.ui.visible = true;
  8411. xGame.common.d2World.getHelpLine();
  8412. this.callback && this.callback(this.extraScore);
  8413. }
  8414. }
  8415. }));
  8416. }
  8417. }
  8418. runHighSpace() {
  8419. let rootBall = xGame.common.d2World.rootBall;
  8420. rootBall.showSelf();
  8421. let d3Src = rootBall.d3BallSrc;
  8422. let allArr = this.getAllBallArr();
  8423. if (allArr.length <= 0) {
  8424. this.callback && this.callback(0);
  8425. return;
  8426. }
  8427. let selectBall = xGame.common.d2World.targetBall;
  8428. let wrong = selectBall && selectBall.destroyed;
  8429. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  8430. selectBall = xGame.common.getRandArrEle(allArr);
  8431. }
  8432. let targetD3Src = selectBall.d3BallSrc;
  8433. xGame.common.d2World.d2Gan.ui.visible = false;
  8434. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8435. d3Src.scaleXYZ = 0.5;
  8436. this.tweenArr.push(d3Src);
  8437. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  8438. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  8439. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  8440. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  8441. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  8442. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  8443. let outArr = [selectBall];
  8444. let other = this.leveNum - 1;
  8445. if (other > 0) {
  8446. let nearArr = this.getOneArr(selectBall);
  8447. if (nearArr.length > 0) {
  8448. xGame.common.botherArr(nearArr);
  8449. if (other >= nearArr.length)
  8450. other = nearArr.length;
  8451. for (let index = 0; index < other; index++) {
  8452. outArr.push(nearArr[index]);
  8453. }
  8454. }
  8455. }
  8456. xGame.common.extraMoveNum = other + 1;
  8457. this.extraScore = other + 1;
  8458. this._rootX = selectBall.gameObj.x;
  8459. this._rootY = selectBall.gameObj.y;
  8460. rootBall.gameObj.x = this._rootX;
  8461. rootBall.gameObj.y = this._rootY;
  8462. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  8463. Laya.Tween.clearAll(d3Src);
  8464. this.addRandomForce(outArr);
  8465. }));
  8466. }));
  8467. }
  8468. addRandomForce(outArr) {
  8469. if (outArr.length > 0) {
  8470. xGame.common.d2World.openCheckStill = true;
  8471. this.playedLastSkill = true;
  8472. }
  8473. let temp;
  8474. for (let index = 0; index < outArr.length; index++) {
  8475. let angle = xGame.common.randomNum(0, 360);
  8476. let linearPercent = xGame.common.randomNum(65, 100);
  8477. temp = outArr[index];
  8478. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  8479. }
  8480. }
  8481. setLinearSpeed(angle, rigy, linearPercent) {
  8482. let sin = Math.sin(angle * Math.PI / 180);
  8483. let cos = Math.cos(angle * Math.PI / 180);
  8484. let maxSpeed = 4;
  8485. let speed = new Laya.Vector2();
  8486. speed.x = maxSpeed * linearPercent * sin;
  8487. speed.y = -maxSpeed * linearPercent * cos;
  8488. rigy.applyLinearImpulseToCenter(speed);
  8489. }
  8490. runBreakArmy() {
  8491. xGame.common.d2World.d2Gan.ui.visible = false;
  8492. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8493. let gameUI = xGame.common.gameUI.ui;
  8494. gameUI.skillRod.visible = true;
  8495. gameUI.skillRod.rotation = 110;
  8496. let outArr = this.getAllBallArr();
  8497. if (outArr.length <= 0) {
  8498. gameUI.skillRod.visible = false;
  8499. this.callback && this.callback(0);
  8500. return;
  8501. }
  8502. xGame.common.botherArr(outArr);
  8503. if (this.leveNum >= outArr.length)
  8504. this.leveNum = outArr.length;
  8505. let deleteNum = outArr.length - this.leveNum;
  8506. outArr.splice(0, deleteNum);
  8507. this.extraScore = this.leveNum;
  8508. let potX = gameUI.skillRod.x;
  8509. let potY = gameUI.skillRod.y;
  8510. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  8511. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  8512. let disArr = [];
  8513. for (let index = 0; index < outArr.length; index++) {
  8514. let obj = outArr[index];
  8515. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  8516. dis = Math.pow(dis, 0.5);
  8517. disArr.push(dis);
  8518. }
  8519. this.tweenArr.push(gameUI.skillRod);
  8520. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  8521. })).update = Laya.Handler.create(this, (e, t, c) => {
  8522. let angle = gameUI.skillRod.rotation;
  8523. let xx;
  8524. let yy;
  8525. let temp;
  8526. for (let index = 0; index < outArr.length; index++) {
  8527. temp = outArr[index];
  8528. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  8529. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  8530. yy -= 20;
  8531. temp.gameObj.x = xx;
  8532. temp.gameObj.y = yy;
  8533. temp.d3BallSrc.setTransPos(xx, yy);
  8534. }
  8535. if (angle <= 60) {
  8536. Laya.Tween.clearAll(gameUI.skillRod);
  8537. this.ballFlyToBag(outArr, 150);
  8538. gameUI.skillRod.visible = false;
  8539. }
  8540. }, null, false);
  8541. }
  8542. runIce() {
  8543. let ballArr = xGame.common.d2World.ballArr;
  8544. this.leveNum *= 2;
  8545. if (this.leveNum >= ballArr.length - 1)
  8546. this.leveNum = ballArr.length - 1;
  8547. let tempArr = [];
  8548. let outArr = [];
  8549. for (let index = 0; index < ballArr.length; index++) {
  8550. if (ballArr[index] instanceof D2RootBallSrc)
  8551. continue;
  8552. tempArr.push(ballArr[index]);
  8553. }
  8554. if (tempArr.length <= 0) {
  8555. this.callback && this.callback(0);
  8556. return;
  8557. }
  8558. xGame.common.botherArr(tempArr);
  8559. for (let index = 0; index < this.leveNum; index++) {
  8560. outArr.push(tempArr[index]);
  8561. }
  8562. this.extraScore = this.leveNum;
  8563. let temp;
  8564. for (let index = 0; index < outArr.length; index++) {
  8565. temp = outArr[index];
  8566. temp.d3BallSrc.playIceEft();
  8567. }
  8568. Laya.timer.once(2000, this, () => {
  8569. for (let index = 0; index < outArr.length; index++) {
  8570. temp = outArr[index];
  8571. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  8572. temp.setBallFunc("ice", str);
  8573. }
  8574. this.callback && this.callback(0);
  8575. });
  8576. }
  8577. runFireworks() {
  8578. let allArr = this.getAllBallArr();
  8579. if (allArr.length <= 0) {
  8580. this.callback && this.callback(0);
  8581. return;
  8582. }
  8583. xGame.common.d2World.d2Gan.ui.visible = false;
  8584. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8585. let outArr = [];
  8586. let other = this.leveNum;
  8587. if (other > 0) {
  8588. if (allArr.length > 0) {
  8589. xGame.common.botherArr(allArr);
  8590. if (other >= allArr.length)
  8591. other = allArr.length;
  8592. for (let index = 0; index < other; index++) {
  8593. outArr.push(allArr[index]);
  8594. }
  8595. }
  8596. }
  8597. xGame.common.extraMoveNum = other;
  8598. this.extraScore = other;
  8599. this.addRandmomFireworks(outArr);
  8600. }
  8601. addRandmomFireworks(outArr) {
  8602. Laya.timer.once(1100, this, () => {
  8603. if (outArr.length > 0) {
  8604. xGame.common.d2World.openCheckStill = true;
  8605. this.playedLastSkill = true;
  8606. }
  8607. });
  8608. xGame.soundMgr.playSound("skill_04_02");
  8609. let temp;
  8610. let delay = -200;
  8611. for (let index = 0; index < outArr.length; index++) {
  8612. temp = outArr[index];
  8613. delay += 200;
  8614. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  8615. let angle = xGame.common.randomNum(0, 360);
  8616. angle = this.getFireworksAngle(obj);
  8617. let linearPercent = xGame.common.randomNum(45, 80);
  8618. if (!obj.destroyed)
  8619. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  8620. });
  8621. }
  8622. }
  8623. getFireworksAngle(obj) {
  8624. let rootBall = xGame.common.d2World.rootBall;
  8625. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  8626. }
  8627. resetGame() {
  8628. Laya.timer.clearAll(this);
  8629. if (this.tweenArr) {
  8630. for (let index = 0; index < this.tweenArr.length; index++) {
  8631. Laya.Tween.clearAll(this.tweenArr[index]);
  8632. }
  8633. }
  8634. this.tweenArr = null;
  8635. }
  8636. runGuanYu() {
  8637. xGame.common.d2World.d2Gan.ui.visible = false;
  8638. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8639. let rootBall = xGame.common.d2World.rootBall;
  8640. if (rootBall.isInHole) {
  8641. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  8642. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  8643. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  8644. rootBall.showSelf();
  8645. }
  8646. this.rtStarX = rootBall.gameObj.x;
  8647. this.rtStarY = rootBall.gameObj.y;
  8648. this.knifeTimes = 0;
  8649. this.playedLastSkill = true;
  8650. rootBall.forceRun = true;
  8651. rootBall.rigy.type = "static";
  8652. xGame.common.d2World.openCheckStill = true;
  8653. this.guanyuRandomKnife();
  8654. }
  8655. guanyuRandomKnife() {
  8656. let rootBall = xGame.common.d2World.rootBall;
  8657. let dir = this.getRandDir();
  8658. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  8659. console.log("当前angle", angle);
  8660. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  8661. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  8662. let dis = 324;
  8663. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  8664. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  8665. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  8666. this.rtStarX = rootBall.gameObj.x;
  8667. this.rtStarY = rootBall.gameObj.y;
  8668. this.knifeTimes++;
  8669. let skillLevel;
  8670. if (xGame.common.gameMgr.selfTurn) {
  8671. skillLevel = DataMgr.getBigSkillByIndex(4);
  8672. }
  8673. else {
  8674. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  8675. }
  8676. if (!skillLevel)
  8677. skillLevel = 1;
  8678. skillLevel += 2;
  8679. if (this.knifeTimes < skillLevel) {
  8680. Laya.timer.once(400, this, () => {
  8681. this.guanyuRandomKnife();
  8682. });
  8683. }
  8684. else {
  8685. rootBall.forceRun = false;
  8686. rootBall.rigy.type = "dynamic";
  8687. xGame.common.extraMoveNum = skillLevel;
  8688. }
  8689. }));
  8690. }
  8691. getRandDir() {
  8692. let rootBall = xGame.common.d2World.rootBall;
  8693. let allBall = this.getAllBallArr();
  8694. let target = xGame.common.getRandArrEle(allBall);
  8695. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  8696. return this.knifeV2;
  8697. }
  8698. cloneKnife(x, y, rotation) {
  8699. let parent = xGame.common.d3World.knifeRoot;
  8700. let prefab = xGame.common.d3World.knife;
  8701. let clone = prefab.clone();
  8702. parent.addChild(clone);
  8703. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  8704. clone.transform.localPositionX = this.knifeV3.x;
  8705. clone.transform.localPositionY = 0;
  8706. clone.transform.localPositionZ = this.knifeV3.z;
  8707. clone.transform.localRotationEulerX = 0;
  8708. clone.transform.localRotationEulerY = rotation;
  8709. clone.transform.localRotationEulerZ = 0;
  8710. clone.active = true;
  8711. return clone;
  8712. }
  8713. cloneGuanYuEft(x, y, angle) {
  8714. return;
  8715. let parent = xGame.common.gameUI.ui.guanyuNode;
  8716. let eft = new ui_guanyuAni();
  8717. eft.parent = parent;
  8718. eft.x = x;
  8719. eft.y = y;
  8720. eft.rotation = angle;
  8721. }
  8722. }
  8723. class ui_UIWordsList extends fgui.GComponent {
  8724. static createInstance() {
  8725. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  8726. }
  8727. onConstruct() {
  8728. this.c1 = this.getController("c1");
  8729. this.n74 = (this.getChild("n74"));
  8730. this.clickNode = (this.getChild("clickNode"));
  8731. this.myNode = (this.getChild("myNode"));
  8732. this.n68 = (this.getChild("n68"));
  8733. this.n66 = (this.getChild("n66"));
  8734. this.n55 = (this.getChild("n55"));
  8735. this.wordsBtn = (this.getChild("wordsBtn"));
  8736. this.emotionBtn = (this.getChild("emotionBtn"));
  8737. this.mybggg = (this.getChild("mybggg"));
  8738. this.wordsList = (this.getChild("wordsList"));
  8739. this.emotionList = (this.getChild("emotionList"));
  8740. this.myRoot = (this.getChild("myRoot"));
  8741. }
  8742. }
  8743. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  8744. class EmotionDisplay {
  8745. constructor(index, ui) {
  8746. this.ui = ui;
  8747. this.index = index;
  8748. this.ui.onClick(this, this.clickSelf);
  8749. this.updateSelf();
  8750. }
  8751. updateSelf() {
  8752. let data = cfgTable.emotionData[this.index + 1];
  8753. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  8754. }
  8755. clickSelf() {
  8756. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  8757. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  8758. xGame.common.talkMgr.closeTalkView();
  8759. }
  8760. }
  8761. class WordsDisplay {
  8762. constructor(index, ui) {
  8763. this.ui = ui;
  8764. this.index = index;
  8765. this.ui.onClick(this, this.clickSelf);
  8766. this.updateSelf();
  8767. }
  8768. updateSelf() {
  8769. let data = cfgTable.talkwordsData[this.index + 1];
  8770. this.ui.txt.text = data.msg;
  8771. }
  8772. clickSelf() {
  8773. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  8774. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  8775. xGame.common.talkMgr.closeTalkView();
  8776. }
  8777. }
  8778. class UIWordsList extends UIBase {
  8779. constructor() {
  8780. super();
  8781. }
  8782. onConstructor() {
  8783. this.ui = ui_UIWordsList.createInstance();
  8784. this.contentPane = this.ui;
  8785. this.isEject = false;
  8786. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  8787. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  8788. this.addUIClick(this.ui.clickNode, this.hide);
  8789. this.initTalkList();
  8790. this.initEmotionList();
  8791. }
  8792. show() {
  8793. super.show();
  8794. }
  8795. initTalkList() {
  8796. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  8797. let data = cfgTable.talkwordsData;
  8798. let length = Object.keys(data).length;
  8799. this.ui.wordsList.numItems = length;
  8800. }
  8801. initEmotionList() {
  8802. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  8803. let data = cfgTable.emotionData;
  8804. let length = Object.keys(data).length;
  8805. this.ui.emotionList.numItems = length;
  8806. }
  8807. renderTalkItem(index, obj) {
  8808. let temp = new WordsDisplay(index, obj);
  8809. }
  8810. renderEmotionItem(index, obj) {
  8811. let temp = new EmotionDisplay(index, obj);
  8812. }
  8813. openTalkList() {
  8814. this.ui.c1.selectedIndex = 0;
  8815. }
  8816. openEmotionList() {
  8817. this.ui.c1.selectedIndex = 1;
  8818. }
  8819. }
  8820. UIWordsList.uiName = "UIWordsList";
  8821. class TalkMgr {
  8822. constructor() {
  8823. this.aiSpeak = true;
  8824. this.emotionList = [];
  8825. this.talkList = [];
  8826. this.addEvent();
  8827. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8828. this.emotionList = [];
  8829. this.talkList = [];
  8830. for (let k in cfgTable.emotionData) {
  8831. this.emotionList.push(cfgTable.emotionData[k].id);
  8832. }
  8833. for (let k in cfgTable.talkwordsData) {
  8834. this.talkList.push(cfgTable.talkwordsData[k].id);
  8835. }
  8836. }
  8837. addEvent() {
  8838. let ui = xGame.common.gameUI.ui;
  8839. ui.wordsBtn.visible = true;
  8840. ui.wordsBtn.onClick(this, this.openTalkView);
  8841. ui.aiWordsBtn.visible = true;
  8842. ui.aiWordsBtn.onClick(this, this.clickAIState);
  8843. }
  8844. openTalkView() {
  8845. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  8846. xGame.uiMgr.Show(UIWordsList);
  8847. }
  8848. closeTalkView() {
  8849. xGame.uiMgr.Hide(UIWordsList);
  8850. }
  8851. clickAIState() {
  8852. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  8853. this.aiSpeak = !this.aiSpeak;
  8854. this.changeAIState(this.aiSpeak);
  8855. }
  8856. changeAIState(speak) {
  8857. this.aiSpeak = speak;
  8858. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  8859. if (speak) {
  8860. btn.c1.selectedIndex = 0;
  8861. }
  8862. else {
  8863. btn.c1.selectedIndex = 1;
  8864. }
  8865. }
  8866. showSelfTalk(wordsId) {
  8867. let ui = xGame.common.gameUI.ui;
  8868. ui.selfTalk.visible = true;
  8869. ui.selfTalk.myNode.c1.selectedIndex = 1;
  8870. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  8871. ui.selfTalk.t0.play();
  8872. }
  8873. showSelfEmotion(emotionId) {
  8874. let ui = xGame.common.gameUI.ui;
  8875. ui.selfTalk.visible = true;
  8876. ui.selfTalk.myNode.c1.selectedIndex = 0;
  8877. this.selfSpine && this.selfSpine.dispose();
  8878. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  8879. let spineData = cfgTable.emotionData[emotionId].spine;
  8880. this.selfSpine = new SpineMgr(spineData, () => {
  8881. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  8882. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  8883. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  8884. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  8885. });
  8886. ui.selfTalk.t0.play();
  8887. }
  8888. showAITalk(wordsId) {
  8889. if (!this.aiSpeak)
  8890. return;
  8891. if (DataMgr.gameData.gameCount < 2)
  8892. return;
  8893. if (wordsId < 1)
  8894. wordsId = this.getRandTalk();
  8895. let ui = xGame.common.gameUI.ui;
  8896. ui.aiTalk.visible = true;
  8897. ui.aiTalk.myNode.c1.selectedIndex = 1;
  8898. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  8899. ui.aiTalk.t0.play();
  8900. }
  8901. getRandTalk() {
  8902. let rand = xGame.tools.random(0, this.talkList.length);
  8903. return this.emotionList[rand];
  8904. }
  8905. getRandEmotion() {
  8906. let rand = xGame.tools.random(0, this.emotionList.length);
  8907. return this.emotionList[rand];
  8908. }
  8909. showAIEmotion(emotionId) {
  8910. if (!this.aiSpeak)
  8911. return;
  8912. if (DataMgr.gameData.gameCount < 2)
  8913. return;
  8914. if (emotionId < 1)
  8915. emotionId = this.getRandEmotion();
  8916. let ui = xGame.common.gameUI.ui;
  8917. ui.aiTalk.visible = true;
  8918. ui.aiTalk.myNode.c1.selectedIndex = 0;
  8919. this.aiSpine && this.aiSpine.dispose();
  8920. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  8921. let spineData = cfgTable.emotionData[emotionId].spine;
  8922. this.aiSpine = new SpineMgr(spineData, () => {
  8923. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  8924. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  8925. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  8926. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  8927. });
  8928. ui.aiTalk.t0.play();
  8929. }
  8930. resetGame() {
  8931. let ui = xGame.common.gameUI.ui;
  8932. ui.aiTalk.visible = false;
  8933. ui.selfTalk.visible = false;
  8934. this.aiSpine && this.aiSpine.dispose();
  8935. this.selfSpine && this.selfSpine.dispose();
  8936. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  8937. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  8938. this.closeTalkView();
  8939. }
  8940. }
  8941. class WordsMgr {
  8942. constructor() {
  8943. this.comboTimes = 1;
  8944. this.skillTimes = 0;
  8945. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  8946. this.comboSpine = new SpineMgr("yxz_liangan");
  8947. this.skillSpine = new SpineMgr("yiganxqiu");
  8948. this.scoreSpine = new SpineMgr("defen");
  8949. }
  8950. setClassicCombo(isInterrupt) {
  8951. if (isInterrupt) {
  8952. this.comboTimes = 0;
  8953. }
  8954. }
  8955. playClassicWords(type, callback) {
  8956. this.callback = callback;
  8957. let aniIndex = type;
  8958. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  8959. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  8960. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  8961. mySpine.destroy(true);
  8962. this.playClassicTimes();
  8963. });
  8964. }
  8965. playClassicTimes() {
  8966. this.comboTimes++;
  8967. if (this.comboTimes <= 1) {
  8968. this.callback && this.callback();
  8969. }
  8970. else {
  8971. let aniIndex = this.comboTimes - 1;
  8972. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  8973. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  8974. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  8975. mySpine.destroy(true);
  8976. this.callback && this.callback();
  8977. });
  8978. }
  8979. }
  8980. playBigSkillTimes(times, callback) {
  8981. if (times <= 0) {
  8982. callback && callback();
  8983. return;
  8984. }
  8985. this.callback = callback;
  8986. let pre = "sz_0";
  8987. let aniIndex = 0;
  8988. this.getWordsImg(times, pre, () => {
  8989. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  8990. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  8991. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  8992. let r1 = ``;
  8993. let r2 = ``;
  8994. if (times <= 9) {
  8995. r1 = `res/d2Res/${pre}${times}.png`;
  8996. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  8997. aniIndex = 0;
  8998. }
  8999. else {
  9000. r1 = `res/d2Res/${pre}${times % 10}.png`;
  9001. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  9002. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  9003. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  9004. aniIndex = 1;
  9005. }
  9006. this.skillSpine.play(data, aniIndex, false, parent, () => {
  9007. mySpine.destroy(true);
  9008. xGame.common.gameMgr.playSkillTips();
  9009. this.playScore(times);
  9010. xGame.common.playRandomMutiBallBigSkillSound();
  9011. }, mySpine);
  9012. });
  9013. }
  9014. playScore(score) {
  9015. let pre = "sz_";
  9016. let aniIndex = 0;
  9017. this.getWordsImg(score, pre, () => {
  9018. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9019. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  9020. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  9021. let r1 = ``;
  9022. let r2 = ``;
  9023. if (score <= 9) {
  9024. r1 = `res/d2Res/${pre}${score}.png`;
  9025. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9026. aniIndex = 0;
  9027. }
  9028. else {
  9029. r1 = `res/d2Res/${pre}${score % 10}.png`;
  9030. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  9031. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9032. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  9033. aniIndex = 1;
  9034. }
  9035. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  9036. mySpine.destroy(true);
  9037. this.callback && this.callback();
  9038. }, mySpine);
  9039. });
  9040. }
  9041. getWordsImg(number, pre = "", callback) {
  9042. let arr = [];
  9043. if (number <= 9) {
  9044. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  9045. }
  9046. else {
  9047. 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 });
  9048. }
  9049. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  9050. callback && callback();
  9051. }));
  9052. }
  9053. }
  9054. class ui_UIRodMethod extends fgui.GComponent {
  9055. static createInstance() {
  9056. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  9057. }
  9058. onConstruct() {
  9059. this.n24 = (this.getChild("n24"));
  9060. this.white = (this.getChild("white"));
  9061. this.dot = (this.getChild("dot"));
  9062. this.sureBtn = (this.getChild("sureBtn"));
  9063. this.n20 = (this.getChild("n20"));
  9064. this.n21 = (this.getChild("n21"));
  9065. this.n22 = (this.getChild("n22"));
  9066. this.n23 = (this.getChild("n23"));
  9067. this.n5 = (this.getChild("n5"));
  9068. this.n14 = (this.getChild("n14"));
  9069. this.t0 = this.getTransition("t0");
  9070. }
  9071. }
  9072. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  9073. class UIRodMethod extends UIBase {
  9074. constructor() {
  9075. super();
  9076. this.isPressd = false;
  9077. }
  9078. onConstructor() {
  9079. this.ui = ui_UIRodMethod.createInstance();
  9080. this.contentPane = this.ui;
  9081. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  9082. this.moveDir = new Laya.Vector2();
  9083. this.moveDest = new Laya.Vector2();
  9084. this.centerPos = new Laya.Vector2();
  9085. xGame.common.uiRodMethod = this;
  9086. }
  9087. show() {
  9088. super.show();
  9089. xGame.common.gameMgr.gamePause = true;
  9090. this.openPressDotEvent();
  9091. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  9092. this.centerPos.x = this.ui.white.x;
  9093. this.centerPos.y = this.ui.white.y;
  9094. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  9095. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  9096. this.setDot();
  9097. }
  9098. setDot() {
  9099. this.ui.dot.x = this.moveDest.x;
  9100. this.ui.dot.y = this.moveDest.y;
  9101. }
  9102. closeSelf() {
  9103. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  9104. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  9105. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  9106. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  9107. xGame.common.gameMgr.gamePause = false;
  9108. this.hide();
  9109. }
  9110. openPressDotEvent() {
  9111. this.closePressDotEvent();
  9112. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9113. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  9114. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9115. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9116. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9117. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9118. }
  9119. closePressDotEvent() {
  9120. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9121. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  9122. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9123. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9124. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9125. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9126. }
  9127. onDown(e) {
  9128. if (e.type == Laya.Event.MOUSE_DOWN)
  9129. this.isPressd = true;
  9130. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  9131. this.isPressd = false;
  9132. if (!this.isPressd)
  9133. return;
  9134. this.moveDest.x = e.stageX;
  9135. this.moveDest.y = e.stageY;
  9136. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  9137. if (dis > 6724) {
  9138. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  9139. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  9140. }
  9141. this.setDot();
  9142. }
  9143. resetRod() {
  9144. this.ui.dot.x = this.ui.white.x;
  9145. this.ui.dot.y = this.ui.white.y;
  9146. this.gameRod.dot.x = this.gameRod.bg.x;
  9147. this.gameRod.dot.y = this.gameRod.bg.y;
  9148. xGame.common.rodOffest.x = 0;
  9149. xGame.common.rodOffest.y = 0;
  9150. }
  9151. }
  9152. UIRodMethod.uiName = "UIRodMethod";
  9153. class UIGame extends UIBase {
  9154. constructor() {
  9155. super();
  9156. this.powerNum = 0;
  9157. this.isD3Inited = false;
  9158. this.isPrePlay = false;
  9159. this.isMoveRod = false;
  9160. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  9161. this.rulerDis = 20;
  9162. this.rulerOffset = 0;
  9163. }
  9164. onConstructor() {
  9165. this.ui = ui_UIGame.createInstance();
  9166. this.contentPane = this.ui;
  9167. this.ui.x += xGame.common.sysOffestNum;
  9168. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  9169. this.isEject = false;
  9170. xGame.common.gameUI = this;
  9171. this.initSelf();
  9172. }
  9173. isTurnSelf() {
  9174. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  9175. return true;
  9176. }
  9177. }
  9178. initSelf() {
  9179. let topUI = this.ui.topNode;
  9180. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  9181. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  9182. this.barInfo = {};
  9183. this.barInfo.curY = 0;
  9184. this.barInfo.height = this.ui.powerNode.height;
  9185. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  9186. this.barInfo.powerStartY = this.ui.powerNode.y;
  9187. xGame.common.aiPlayer = new AIPlayer();
  9188. xGame.common.gameMgr = new GameMgr();
  9189. xGame.common.skillMgr = new SkillMgr();
  9190. xGame.common.wordsMgr = new WordsMgr();
  9191. xGame.common.talkMgr = new TalkMgr();
  9192. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  9193. console.log("加载经典模式表情文件chenggon !");
  9194. });
  9195. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  9196. console.log("挑战模式奖励模式spine加载成功!");
  9197. });
  9198. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  9199. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9200. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  9201. this.addUIClick(this.ui.returnBtn, this.returnHome);
  9202. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  9203. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  9204. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  9205. }
  9206. returnHome() {
  9207. let tips = "Are you sure to exit the game?";
  9208. let woman = "Boss, why don't you play for a while longer?";
  9209. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  9210. }
  9211. addRodMethodClick() {
  9212. if (this.isTurnSelf()) {
  9213. xGame.uiMgr.Show(UIRodMethod);
  9214. }
  9215. }
  9216. clickHelpLineBtn(force = false) {
  9217. if (!this.isTurnSelf())
  9218. return;
  9219. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  9220. if (success) {
  9221. xGame.common.longHelpLine = true;
  9222. xGame.common.d2World.getHelpLine();
  9223. Moyu.sendDataEvent("guideNum");
  9224. }
  9225. else {
  9226. }
  9227. });
  9228. }
  9229. renderSelfDisplayBalls(index, target) {
  9230. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  9231. target.myImg.url = xGame.common.getGameIconUrl(str);
  9232. }
  9233. renderAIDisplayBalls(index, target) {
  9234. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  9235. target.myImg.url = xGame.common.getGameIconUrl(str);
  9236. ;
  9237. }
  9238. updateMode() {
  9239. if (xGame.common.gameMode == GameMode.classic) {
  9240. this.ui.topNode.scoreNode.visible = false;
  9241. }
  9242. else if (xGame.common.gameMode == GameMode.bigMove) {
  9243. this.ui.topNode.scoreNode.visible = true;
  9244. }
  9245. }
  9246. show() {
  9247. super.show();
  9248. console.log("zh:uigame show");
  9249. this.ui.alpha = 0;
  9250. this.updateSelf();
  9251. console.log("zh:uigame bf gamemusic01 start");
  9252. xGame.soundMgr.playMusic("gamemusic01");
  9253. console.log("zh:uigame bf gamemusic01 end");
  9254. xGame.common.gameMgr.gamePause = false;
  9255. xGame.common.gameUI.ui.blackAni.visible = false;
  9256. xGame.common.gameUI.ui.whiteAni.visible = false;
  9257. this.ui.powerEft.visible = false;
  9258. this.ui.colorNode.visible = false;
  9259. this.updateHead();
  9260. }
  9261. updateSelf() {
  9262. if (xGame.common.gameMode == GameMode.classic) {
  9263. this.ui.c1.selectedIndex = 0;
  9264. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  9265. this.ui.topNode.middleNode.visible = true;
  9266. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  9267. }
  9268. else if (xGame.common.gameMode == GameMode.bigMove) {
  9269. this.ui.c1.selectedIndex = 0;
  9270. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  9271. this.ui.topNode.middleNode.visible = false;
  9272. let max = xGame.cfgMgr.getMaxBigMoveLength();
  9273. let rand = xGame.common.randomNum(1, max);
  9274. let guide = DataMgr.getSkillGuide();
  9275. if (guide == 0)
  9276. rand = 1;
  9277. xGame.common.bigMoveLevelIndex = rand;
  9278. }
  9279. else if (xGame.common.gameMode == GameMode.placeBall) {
  9280. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  9281. this.ui.c1.selectedIndex = 1 + data.type;
  9282. this.ui.alpha = 1;
  9283. this.startGame();
  9284. }
  9285. this.updateMode();
  9286. this.initD3world();
  9287. this.initD2world();
  9288. }
  9289. startGame() {
  9290. this.ui.snowNode.visible = Math.random() <= 0.1;
  9291. this.ui.d2Node.visible = false;
  9292. xGame.common.d3World.d3Hand.gameObj.active = false;
  9293. xGame.common.d3World.tableSrc.init();
  9294. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  9295. this.cameraViewChange(() => {
  9296. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  9297. switch (xGame.common.gameMode) {
  9298. case GameMode.classic:
  9299. xGame.common.d3World.d3Hand.gameObj.active = true;
  9300. this.playPutBallD3Ani();
  9301. break;
  9302. case GameMode.bigMove:
  9303. this.enterGame();
  9304. Laya.timer.once(500, this, () => {
  9305. this.ui.topNode.middleNode.visible = true;
  9306. this.ui.topNode.middleNode.t0.play();
  9307. });
  9308. break;
  9309. case GameMode.placeBall:
  9310. this.enterGame();
  9311. break;
  9312. default:
  9313. break;
  9314. }
  9315. });
  9316. PlatMgr.showBanner(false);
  9317. }
  9318. enterGame() {
  9319. this.ui.d2Node.visible = true;
  9320. xGame.common.d3World.d3Hand.gameObj.active = false;
  9321. xGame.common.showOneCamera("mainCamera");
  9322. Moyu.recordGame(30, true);
  9323. if (!this.isPrePlay) {
  9324. this.isPrePlay = true;
  9325. xGame.common.d3World.prePlayEft();
  9326. }
  9327. xGame.common.gameMgr.gameReady();
  9328. this.openAllEvent();
  9329. this.ui.snowNode.visible = false;
  9330. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  9331. this.ui.helpBtn.visible = condition;
  9332. }
  9333. showHelpLineGuide() {
  9334. let longGuide = DataMgr.getGuideHelpLine();
  9335. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  9336. this.ui.helpBtn.visible = true;
  9337. this.ui.guideNode.visible = true;
  9338. }
  9339. }
  9340. setTurnAlpha(alpha) {
  9341. this.ui.keduNode.alpha = alpha;
  9342. this.ui.ganNode.alpha = alpha;
  9343. this.ui.rodMethodNode.alpha = alpha;
  9344. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  9345. }
  9346. cameraViewChange(callback) {
  9347. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  9348. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  9349. xGame.common.showOneCamera("visitAngle");
  9350. cameraSrc.localRotationEulerY = 180;
  9351. cameraSrc.localRotationEulerZ = 0;
  9352. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  9353. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  9354. callback && callback();
  9355. }));
  9356. }));
  9357. }
  9358. playPutBallD3Ani() {
  9359. xGame.common.showOneCamera("mainCamera");
  9360. let handSrc = xGame.common.d3World.d3Hand;
  9361. handSrc.gameObj.active = true;
  9362. handSrc.transform.localPositionZ = 3;
  9363. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9364. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  9365. handSrc.gameObj.active = false;
  9366. this.enterGame();
  9367. }), 400);
  9368. }));
  9369. }
  9370. updateHead() {
  9371. let user = Moyu.getUserInfo();
  9372. this.ui.topNode.selfNameTxt.text = user.nickName;
  9373. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  9374. let aiData = xGame.cfgMgr.getRandomUserInfo();
  9375. if (DataMgr.getSkillGuide() < 1) {
  9376. this.ui.topNode.aiNameTxt.text = 'billiards';
  9377. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  9378. }
  9379. else {
  9380. this.ui.topNode.aiNameTxt.text = aiData.name;
  9381. this.ui.topNode.aiHeadLoader.url = baseHeadUrl + aiData.icon;
  9382. }
  9383. }
  9384. initD2world() {
  9385. let node = this.ui.d2Root.displayObject;
  9386. let src = node.getComponent(D2World);
  9387. if (!src) {
  9388. xGame.common.d2World = node.addComponent(D2World);
  9389. }
  9390. xGame.common.d2World.initSelf();
  9391. }
  9392. initD3world() {
  9393. if (this.isD3Inited)
  9394. return;
  9395. this.isD3Inited = true;
  9396. let scene3D = xGame.common.d3Scene;
  9397. this.ui.d3Root.displayObject.addChild(scene3D);
  9398. scene3D.active = true;
  9399. xGame.common.d3World.tableSrc.setBorderPos();
  9400. }
  9401. onRootMove(e) {
  9402. let rootBall = xGame.common.d2World.rootBall;
  9403. this.ui.moveNode.x = e.x;
  9404. this.ui.moveNode.y = e.y;
  9405. rootBall.gameObj.x = e.x;
  9406. rootBall.gameObj.y = e.y;
  9407. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  9408. }
  9409. aiRootMove(move) {
  9410. if (move)
  9411. this.hideBallUI();
  9412. else {
  9413. this.showBallUI();
  9414. xGame.common.d2World.getHelpLine();
  9415. }
  9416. }
  9417. aiForce(type, force = 0) {
  9418. this.pressTarget = PressType.powerNode;
  9419. if (type == 1)
  9420. this.onEventUp({ force: true });
  9421. else if (type == 2)
  9422. this.onEventMove({ stageY: force, force: true });
  9423. }
  9424. onEventPress(e) {
  9425. if (e.stopPropagation)
  9426. e.stopPropagation();
  9427. if (!this.isTurnSelf())
  9428. return;
  9429. let target = e.target;
  9430. switch (target) {
  9431. case this.ui.myPowerNode.displayObject:
  9432. this.pressTarget = PressType.powerNode;
  9433. this.barInfo.curY = e.stageY;
  9434. this.updateBarInfo();
  9435. break;
  9436. case this.ui.moveNode.displayObject:
  9437. this.pressTarget = PressType.moveNode;
  9438. this.hideBallUI();
  9439. this.eventObj.curX = this.ui.moveNode.x;
  9440. this.eventObj.curY = this.ui.moveNode.y;
  9441. this.ui.moveNode.finger.visible = false;
  9442. this.eventObj.lastX = e.stageX;
  9443. this.eventObj.lastY = e.stageY;
  9444. break;
  9445. case this.ui.rulerClickNode.displayObject:
  9446. this.pressTarget = PressType.rulerNode;
  9447. this.eventObj.lastY = e.stageY;
  9448. break;
  9449. case this.ui.d2Root.displayObject:
  9450. this.pressTarget = PressType.d2Root;
  9451. this.eventObj.lastX = e.stageX;
  9452. this.eventObj.lastY = e.stageY;
  9453. this.eventObj.starX = e.stageX;
  9454. this.eventObj.starY = e.stageY;
  9455. this.eventObj.curX = 0;
  9456. this.eventObj.curY = 0;
  9457. xGame.common.d2World.d2Gan.setGanLastInfo();
  9458. this.rulerOffset = 0;
  9459. break;
  9460. default:
  9461. break;
  9462. }
  9463. }
  9464. onEventMove(e) {
  9465. if (e.stopPropagation)
  9466. e.stopPropagation();
  9467. if (e && e.force) {
  9468. }
  9469. else {
  9470. if (!this.isTurnSelf())
  9471. return;
  9472. }
  9473. switch (this.pressTarget) {
  9474. case PressType.powerNode:
  9475. this.barInfo.curY = e.stageY;
  9476. this.updateBarInfo();
  9477. this.isMoveRod = true;
  9478. break;
  9479. case PressType.moveNode:
  9480. let rootBall = xGame.common.d2World.rootBall;
  9481. let radius = rootBall.gameObj.width / 2;
  9482. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  9483. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  9484. let border = xGame.common.d2World.borderRect;
  9485. if (curX <= border.x + radius)
  9486. curX = border.x + radius;
  9487. else if (curX >= border.x + border.width - radius)
  9488. curX = border.x + border.width - radius;
  9489. if (curY <= border.y + radius)
  9490. curY = border.y + radius;
  9491. else if (curY >= border.y + border.height - radius)
  9492. curY = border.y + border.height - radius;
  9493. if (xGame.common.gameMgr.isOpenBall) {
  9494. if (curX >= border.x + border.openBallW - radius)
  9495. curX = border.x + border.openBallW - radius;
  9496. }
  9497. this.ui.moveNode.x = curX;
  9498. this.ui.moveNode.y = curY;
  9499. rootBall.gameObj.x = curX;
  9500. rootBall.gameObj.y = curY;
  9501. rootBall.d3BallSrc.setTransPos(curX, curY);
  9502. this.isMoveRod = true;
  9503. break;
  9504. case PressType.rulerNode:
  9505. let yy = e.stageY - this.eventObj.lastY;
  9506. this.eventObj.lastY = e.stageY;
  9507. let ruler1 = this.ui.rulerNode.img1;
  9508. let ruler2 = this.ui.rulerNode.img2;
  9509. ruler1.y += yy;
  9510. ruler2.y += yy;
  9511. this.rulerOffset += yy;
  9512. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  9513. this.rulerOffset = 0;
  9514. xGame.soundMgr.playSound("inch", 1, 10);
  9515. }
  9516. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  9517. let h = ruler1.height;
  9518. this.checkGuide();
  9519. this.isMoveRod = true;
  9520. if (ruler1.y >= h) {
  9521. ruler1.y = -h;
  9522. ruler2.y = 0;
  9523. return;
  9524. }
  9525. else if (ruler1.y <= -h) {
  9526. ruler1.y = h;
  9527. ruler2.y = 0;
  9528. return;
  9529. }
  9530. if (ruler2.y >= h) {
  9531. ruler2.y = -h;
  9532. ruler1.y = 0;
  9533. return;
  9534. }
  9535. else if (ruler2.y <= -h) {
  9536. ruler2.y = h;
  9537. ruler1.y = 0;
  9538. return;
  9539. }
  9540. break;
  9541. case PressType.d2Root:
  9542. this.eventObj.curX = e.stageX;
  9543. this.eventObj.curY = e.stageY;
  9544. let offset = this.checkRodMoveDir();
  9545. xGame.common.d2World.d2Gan.rotateSelf(offset);
  9546. this.eventObj.lastX = e.stageX;
  9547. this.eventObj.lastY = e.stageY;
  9548. break;
  9549. default:
  9550. break;
  9551. }
  9552. }
  9553. onEventUp(e) {
  9554. if (e.stopPropagation)
  9555. e.stopPropagation();
  9556. if (e && e.force) {
  9557. }
  9558. else {
  9559. if (!this.isTurnSelf())
  9560. return;
  9561. }
  9562. switch (this.pressTarget) {
  9563. case PressType.powerNode:
  9564. this.ui.powerNode.value = 0;
  9565. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  9566. this.ui.powerTxt.text = "";
  9567. if (this.powerNum > 0) {
  9568. xGame.eventMgr.event(BALL_SHOOT);
  9569. xGame.common.d2World.shoot(this.powerNum);
  9570. xGame.common.d2World.d2Gan.shoot();
  9571. xGame.common.d2World.d2HelpLine.shoot();
  9572. this.finishGuide();
  9573. this.ui.powerEft.visible = false;
  9574. this.ui.colorNode.visible = false;
  9575. let ganStr = "";
  9576. if (this.powerNum <= 30) {
  9577. ganStr = "gan_30";
  9578. }
  9579. else if (this.powerNum <= 60) {
  9580. ganStr = "gan_50";
  9581. }
  9582. else {
  9583. ganStr = "gan_80";
  9584. }
  9585. xGame.soundMgr.playSound(ganStr);
  9586. }
  9587. break;
  9588. case PressType.moveNode:
  9589. let rootBall = xGame.common.d2World.rootBall;
  9590. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  9591. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  9592. let isIntersect = this.judgeBallIntersect();
  9593. if (isIntersect) {
  9594. this.ui.moveNode.x = lastX;
  9595. this.ui.moveNode.y = lastY;
  9596. rootBall.gameObj.x = lastX;
  9597. rootBall.gameObj.y = lastY;
  9598. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  9599. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  9600. }
  9601. else {
  9602. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  9603. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  9604. }
  9605. this.showBallUI();
  9606. this.ui.moveNode.finger.visible = true;
  9607. xGame.common.d2World.getHelpLine();
  9608. break;
  9609. case PressType.rulerNode:
  9610. break;
  9611. case PressType.d2Root:
  9612. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  9613. if (dis <= 25) {
  9614. this.moveToClickDot(e);
  9615. }
  9616. break;
  9617. default:
  9618. break;
  9619. }
  9620. this.pressTarget = -1;
  9621. }
  9622. checkGuide() {
  9623. let guide = DataMgr.getSkillGuide();
  9624. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  9625. xGame.common.guideStep++;
  9626. xGame.common.gameUI.ui.guide2.visible = false;
  9627. xGame.common.gameUI.ui.guide3.visible = true;
  9628. }
  9629. }
  9630. finishGuide() {
  9631. let guide = DataMgr.getSkillGuide();
  9632. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  9633. xGame.common.guideStep = 10;
  9634. this.closeAllGuide();
  9635. }
  9636. }
  9637. closeAllGuide() {
  9638. xGame.common.gameUI.ui.guide1.visible = false;
  9639. xGame.common.gameUI.ui.guide2.visible = false;
  9640. xGame.common.gameUI.ui.guide3.visible = false;
  9641. }
  9642. updateBarInfo() {
  9643. let star = this.ui.powerNode.y;
  9644. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  9645. if (rate >= 1)
  9646. rate = 1;
  9647. if (rate <= 0)
  9648. rate = 0;
  9649. this.powerNum = Math.ceil(rate * 100);
  9650. this.ui.powerNode.value = this.powerNum;
  9651. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  9652. this.ui.colorNode.value = this.powerNum;
  9653. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  9654. this.ui.powerEft.visible = this.powerNum != 0;
  9655. this.ui.colorNode.visible = this.powerNum != 0;
  9656. this.ui.powerTxt.text = this.powerNum + "";
  9657. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  9658. }
  9659. forceCancel() {
  9660. this.ui.powerNode.value = 0;
  9661. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  9662. this.ui.powerTxt.text = "";
  9663. }
  9664. checkRodMoveDir() {
  9665. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  9666. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  9667. if (tempX >= 0 && tempY <= 0) {
  9668. return this.checkDir();
  9669. }
  9670. else if (tempX < 0 && tempY < 0) {
  9671. return this.checkDir(1, -1);
  9672. }
  9673. else if (tempX < 0 && tempY > 0) {
  9674. return this.checkDir(-1, -1);
  9675. }
  9676. else {
  9677. return this.checkDir(-1, 1);
  9678. }
  9679. }
  9680. checkDir(flagX = 1, flagY = 1) {
  9681. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  9682. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  9683. if (offsetY == 0) {
  9684. return offsetX * flagX;
  9685. }
  9686. if (offsetX == 0) {
  9687. return offsetY * flagY;
  9688. }
  9689. let angle = offsetY / offsetX;
  9690. if (Math.abs(angle) >= 1) {
  9691. return offsetY * flagY;
  9692. }
  9693. else {
  9694. return offsetX * flagX;
  9695. }
  9696. }
  9697. judgeBallIntersect() {
  9698. let rootBall = xGame.common.d2World.rootBall;
  9699. let ballArr = xGame.common.d2World.ballArr;
  9700. let radius = rootBall.gameObj.width / 2;
  9701. let temp;
  9702. let isIntersect = false;
  9703. for (let index = 0; index < ballArr.length; index++) {
  9704. temp = ballArr[index];
  9705. if (temp.number == rootBall.number)
  9706. continue;
  9707. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  9708. if (isIntersect) {
  9709. break;
  9710. }
  9711. }
  9712. return isIntersect;
  9713. }
  9714. hideBallUI() {
  9715. let d2Gan = xGame.common.d2World.d2Gan;
  9716. if (!d2Gan.ui.isDisposed)
  9717. d2Gan.ui.visible = false;
  9718. let d2Help = xGame.common.d2World.d2HelpLine;
  9719. if (!d2Help.ui.isDisposed)
  9720. d2Help.ui.visible = false;
  9721. let rootBall = xGame.common.d2World.rootBall;
  9722. if (!rootBall.destroyed) {
  9723. rootBall.gameObj.active = false;
  9724. }
  9725. }
  9726. showBallUI() {
  9727. let d2Gan = xGame.common.d2World.d2Gan;
  9728. if (!d2Gan.ui.isDisposed)
  9729. d2Gan.ui.visible = true;
  9730. let d2Help = xGame.common.d2World.d2HelpLine;
  9731. if (!d2Help.ui.isDisposed)
  9732. d2Help.ui.visible = true;
  9733. let rootBall = xGame.common.d2World.rootBall;
  9734. if (!rootBall.destroyed) {
  9735. rootBall.gameObj.active = true;
  9736. }
  9737. }
  9738. moveToClickDot(e) {
  9739. if (!this.isMoveRod && !xGame.common.clickedBall) {
  9740. let root = xGame.common.d2World.rootBall.gameObj;
  9741. let xx = e.stageX - xGame.common.sysOffestNum;
  9742. let yy = e.stageY;
  9743. let x = xx - root.x;
  9744. let y = yy - root.y;
  9745. let angle = xGame.common.getfguiRotation(x, y);
  9746. xGame.common.d2World.d2Gan.ui.rotation = angle;
  9747. xGame.common.d2World.getHelpLine();
  9748. }
  9749. this.isMoveRod = false;
  9750. xGame.common.clickedBall = false;
  9751. }
  9752. openAllEvent() {
  9753. this.closeAllEvent();
  9754. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9755. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9756. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9757. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9758. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  9759. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  9760. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  9761. }
  9762. closeAllEvent() {
  9763. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9764. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9765. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9766. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9767. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  9768. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  9769. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  9770. }
  9771. resetGame() {
  9772. this.closeAllEvent();
  9773. this.hideBallUI();
  9774. xGame.common.gameMgr.gamePause = true;
  9775. }
  9776. }
  9777. UIGame.uiName = "UIGame";
  9778. class UIAddProp extends UIBase {
  9779. constructor() {
  9780. super();
  9781. this.curType = "";
  9782. }
  9783. onConstructor() {
  9784. this.ui = ui_UIAddProp.createInstance();
  9785. this.contentPane = this.ui;
  9786. this.isEject = false;
  9787. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  9788. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  9789. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  9790. this.updateUI();
  9791. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  9792. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  9793. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  9794. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  9795. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  9796. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  9797. }
  9798. show(type) {
  9799. super.show();
  9800. this.curType = type == 0 ? "coin" : "diamond";
  9801. this.switchBtn("");
  9802. this.ui.t0.play();
  9803. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  9804. PlatMgr.showInsert(true);
  9805. }
  9806. closeSelf() {
  9807. this.hide();
  9808. }
  9809. updateUI() {
  9810. let data = cfgTable.moneyData;
  9811. let temp;
  9812. let obj;
  9813. for (const key in data) {
  9814. temp = data[key];
  9815. obj = this.ui.myNode["node" + key];
  9816. if (parseInt(key) <= 2) {
  9817. obj.diamondTxt.text = "+" + temp.num;
  9818. }
  9819. else {
  9820. obj.coinTxt.text = temp.num;
  9821. obj.diamondTxt.text = temp.get.split('_')[1];
  9822. }
  9823. }
  9824. this.updateDiamondShare();
  9825. }
  9826. updateDiamondShare() {
  9827. let data = DataMgr.getShareDiamondTimes();
  9828. if (data >= xGame.common.maxShareDiamondTimes) {
  9829. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  9830. this.ui.myNode.node1.touchable = false;
  9831. }
  9832. else {
  9833. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  9834. this.ui.myNode.node1.touchable = true;
  9835. }
  9836. }
  9837. switchBtn(type) {
  9838. if (type == "")
  9839. type = this.curType;
  9840. else {
  9841. if (this.curType == type) {
  9842. return;
  9843. }
  9844. else {
  9845. this.curType = type;
  9846. }
  9847. }
  9848. if (type == "coin") {
  9849. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  9850. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  9851. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  9852. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  9853. this.ui.myNode.c1.selectedIndex = 0;
  9854. }
  9855. else {
  9856. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  9857. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  9858. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  9859. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  9860. this.ui.myNode.c1.selectedIndex = 1;
  9861. }
  9862. }
  9863. convertCoin(index) {
  9864. let data = cfgTable.moneyData[index];
  9865. let coinNum = data.num;
  9866. let str = data.get.split('_')[1];
  9867. let needDiamond = parseInt(str);
  9868. if (DataMgr.diamondEnough(needDiamond)) {
  9869. DataMgr.setDiamond(-needDiamond);
  9870. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  9871. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  9872. }
  9873. else {
  9874. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  9875. this.switchBtn("diamond");
  9876. }
  9877. }
  9878. videoGetDiamond() {
  9879. let num = cfgTable.moneyData[2].num;
  9880. Moyu.showVideoAd(() => {
  9881. xGame.common.playObjFlyAnim(num, Prop.diamond);
  9882. this.closeSelf();
  9883. }, EAdType.addDiamond);
  9884. }
  9885. videoGetCoin() {
  9886. Moyu.showVideoAd(() => {
  9887. xGame.common.playObjFlyAnim(2000, Prop.coin);
  9888. this.closeSelf();
  9889. }, EAdType.addCoin);
  9890. }
  9891. shareGetDiamond() {
  9892. let times = DataMgr.getShareDiamondTimes();
  9893. if (times >= xGame.common.maxShareDiamondTimes) {
  9894. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  9895. }
  9896. else {
  9897. if (Moyu.isTT) {
  9898. let num = cfgTable.moneyData[1].num;
  9899. Moyu.shareVideo = '';
  9900. Moyu.shareGame((success) => {
  9901. if (success) {
  9902. xGame.uiMgr.Show(UIMsg, "分享成功!");
  9903. xGame.common.playObjFlyAnim(num, Prop.diamond);
  9904. DataMgr.setShareDiamondTimes(1);
  9905. this.updateDiamondShare();
  9906. }
  9907. else {
  9908. xGame.uiMgr.Show(UIMsg, "分享失败!");
  9909. }
  9910. });
  9911. }
  9912. else {
  9913. Moyu.showVideoAd(() => {
  9914. let diamond = xGame.common.randomNum(50, 100);
  9915. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  9916. DataMgr.setShareDiamondTimes(1);
  9917. this.updateDiamondShare();
  9918. }, EAdType.randomDiamond);
  9919. }
  9920. }
  9921. }
  9922. openPutBallView() {
  9923. let end = xGame.uiMgr.getUI(UIGameEnd);
  9924. let skill = xGame.uiMgr.getUI(UISkill);
  9925. let level = xGame.uiMgr.getUI(UILevelDisplay);
  9926. let uigame = xGame.uiMgr.getUI(UIGame);
  9927. if (end && !end.isHide) {
  9928. xGame.uiMgr.Hide(UIGameEnd);
  9929. xGame.uiMgr.Show(UIMain);
  9930. }
  9931. if (skill && !skill.isHide)
  9932. xGame.uiMgr.Hide(UISkill);
  9933. if (uigame && !uigame.isHide)
  9934. xGame.uiMgr.Hide(UIGame);
  9935. if (level && !level.isHide) {
  9936. }
  9937. else {
  9938. xGame.uiMgr.Show(UILevelDisplay);
  9939. }
  9940. this.closeSelf();
  9941. }
  9942. }
  9943. UIAddProp.uiName = "UIAddProp";
  9944. class MoneyNode {
  9945. constructor(ui) {
  9946. this.leftTime = 0;
  9947. this.ui = ui;
  9948. this.ui.addCoinBtn.onClick(this, this.addCoin);
  9949. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  9950. this.ui.addPowerBtn.onClick(this, this.addPower);
  9951. this.ui.c1.selectedIndex = 1;
  9952. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  9953. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  9954. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  9955. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  9956. this.coinChange();
  9957. this.diamondChange();
  9958. this.powerChange();
  9959. }
  9960. addPower() {
  9961. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9962. xGame.uiMgr.Show(UIPower);
  9963. }
  9964. powerChange() {
  9965. let powerNum = DataMgr.getPower();
  9966. this.ui.powerTxt.text = powerNum + "";
  9967. }
  9968. checkPowerTime() {
  9969. let cur = new Date().getTime();
  9970. let last = DataMgr.getPowerTime();
  9971. if (last == 0) {
  9972. last = cur;
  9973. DataMgr.setPowerTime(cur);
  9974. }
  9975. let power = DataMgr.getPower();
  9976. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  9977. Laya.timer.clearAll(this);
  9978. if (power >= xGame.common.natureMaxPower) {
  9979. this.ui.powerTimeTxt.text = "";
  9980. DataMgr.setPowerTime(cur);
  9981. return;
  9982. }
  9983. if (power + offset >= xGame.common.natureMaxPower) {
  9984. DataMgr.setPower(xGame.common.natureMaxPower, false);
  9985. this.ui.powerTimeTxt.text = "";
  9986. DataMgr.setPowerTime(cur);
  9987. }
  9988. else {
  9989. if (offset > 0) {
  9990. DataMgr.setPower(offset);
  9991. DataMgr.setPowerTime(cur);
  9992. }
  9993. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  9994. this.leftTime = xGame.common.powerRecoverNum - time;
  9995. if (this.leftTime <= 0)
  9996. this.leftTime = 0;
  9997. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  9998. Laya.timer.loop(1000, this, this.updatePowerTime);
  9999. }
  10000. }
  10001. updatePowerTime() {
  10002. this.leftTime -= 1;
  10003. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10004. if (this.leftTime <= 0) {
  10005. this.checkPowerTime();
  10006. }
  10007. }
  10008. coinChange() {
  10009. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  10010. }
  10011. diamondChange() {
  10012. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  10013. }
  10014. addCoin() {
  10015. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10016. Moyu.sendDataEvent("AddCoinBtn");
  10017. xGame.uiMgr.Show(UIAddProp, 0);
  10018. }
  10019. addDiamond() {
  10020. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10021. Moyu.sendDataEvent("AddDiamondBtn");
  10022. xGame.uiMgr.Show(UIAddProp, 1);
  10023. }
  10024. }
  10025. class UIDraw extends UIBase {
  10026. constructor() {
  10027. super();
  10028. this.curKey = 0;
  10029. }
  10030. onConstructor() {
  10031. this.ui = ui_UIDraw.createInstance();
  10032. this.contentPane = this.ui;
  10033. this.isEject = false;
  10034. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  10035. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  10036. this.addUIClick(this.ui.drawBtn, this.startDraw);
  10037. this.initDraw();
  10038. this.initUI();
  10039. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  10040. if (Moyu.isKs)
  10041. this.ui.closeNode.closeBtn.x += 100;
  10042. }
  10043. show() {
  10044. super.show();
  10045. this.ui.t0.play();
  10046. this.playSecretaryIdle();
  10047. this.updateDraw();
  10048. this.checkFree();
  10049. if (PlatMgr.bannerDelay > 0) {
  10050. this.ui.closeNode.closeBtn.visible = false;
  10051. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  10052. this.ui.closeNode.closeBtn.visible = true;
  10053. });
  10054. }
  10055. PlatMgr.showRateBanner();
  10056. }
  10057. hide() {
  10058. Laya.timer.clearAll(this);
  10059. super.hide();
  10060. }
  10061. checkFree() {
  10062. let isFree = DataMgr.getDailyfreeDrawTimes();
  10063. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  10064. }
  10065. initDraw() {
  10066. this.drawObj = [];
  10067. let data = cfgTable.drawData;
  10068. let temp;
  10069. let weight = 0;
  10070. for (const key in data) {
  10071. temp = data[key];
  10072. weight += temp.weight;
  10073. this.drawObj.push(weight);
  10074. }
  10075. this.allWeight = weight;
  10076. }
  10077. initUI() {
  10078. let data = cfgTable.drawData;
  10079. let temp;
  10080. let img;
  10081. let txt;
  10082. for (const key in data) {
  10083. temp = data[key];
  10084. img = this.ui.myNode.rotNode["img" + key];
  10085. txt = this.ui.myNode.rotNode["txt" + key];
  10086. img.url = xGame.common.getGameIconUrl(temp.icon);
  10087. txt.visible = true;
  10088. if (temp.award > 2) {
  10089. img.rotation = 0;
  10090. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  10091. }
  10092. else {
  10093. img.rotation = temp.rotation;
  10094. txt.text = temp.num;
  10095. }
  10096. }
  10097. }
  10098. getCurkey() {
  10099. let rand = Math.random() * this.allWeight;
  10100. let temp;
  10101. for (let index = 0; index < this.drawObj.length - 1; index++) {
  10102. temp = this.drawObj[index];
  10103. if (index == 0) {
  10104. if (rand < temp) {
  10105. return index + 1;
  10106. }
  10107. }
  10108. else {
  10109. if (rand >= temp && rand < this.drawObj[index + 1]) {
  10110. return index + 1;
  10111. }
  10112. }
  10113. }
  10114. return 2;
  10115. }
  10116. startDraw() {
  10117. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  10118. if (freeTimes > 0) {
  10119. this.beginDraw();
  10120. DataMgr.setDailyfreeDrawTimes(0);
  10121. this.checkFree();
  10122. }
  10123. else {
  10124. Moyu.sendDataEvent("turntable");
  10125. Moyu.showVideoAd(() => {
  10126. this.beginDraw();
  10127. }, EAdType.draw);
  10128. }
  10129. }
  10130. beginDraw() {
  10131. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  10132. this.ui.drawBtn.touchable = false;
  10133. this.curKey = this.getCurkey();
  10134. console.log("当前key", this.curKey);
  10135. let cell = 60;
  10136. let lap = 3;
  10137. let angle = cell * (this.curKey - 1) + lap * 360;
  10138. let target = this.ui.myNode.rotNode;
  10139. target.rotation = 0;
  10140. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  10141. console.log("旋转完成");
  10142. this.ui.drawBtn.touchable = true;
  10143. this.getAward();
  10144. }));
  10145. }
  10146. getAward() {
  10147. let data = cfgTable.drawData[this.curKey];
  10148. let temp = new AwardType();
  10149. temp.type = data.award;
  10150. temp.num = data.num;
  10151. xGame.common.getAward([temp], () => {
  10152. DataMgr.setDrawTimes(1);
  10153. this.updateDraw();
  10154. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  10155. });
  10156. }
  10157. updateDraw() {
  10158. let drawTimes = DataMgr.getDrawTimes();
  10159. let awardTimes = DataMgr.getDrawAwardTimes();
  10160. if (Math.floor(drawTimes / 3) > awardTimes) {
  10161. this.ui.extraNode.boxBtn.t0.play(null, -1);
  10162. this.ui.extraNode.boxBtn.touchable = true;
  10163. this.ui.extraNode.tipsTxt.text = "3/3";
  10164. this.ui.extraNode.barNode.width = 265;
  10165. this.getExtraAward();
  10166. }
  10167. else {
  10168. this.ui.extraNode.boxBtn.t0.stop();
  10169. this.ui.extraNode.boxBtn.touchable = false;
  10170. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  10171. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  10172. }
  10173. let data = cfgTable.drawData[1];
  10174. if (awardTimes == 0) {
  10175. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  10176. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  10177. this.ui.myNode.rotNode.img1.rotation = 0;
  10178. }
  10179. else {
  10180. let award = data.nextid;
  10181. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  10182. this.ui.myNode.rotNode.txt1.text = award[1];
  10183. this.ui.myNode.rotNode.img1.rotation = 0;
  10184. }
  10185. }
  10186. getExtraAward() {
  10187. let drawTimes = DataMgr.getDrawTimes();
  10188. let awardTimes = DataMgr.getDrawAwardTimes();
  10189. let data = cfgTable.drawData[1];
  10190. let award = new AwardType();
  10191. if (awardTimes == 0) {
  10192. award.num = data.num;
  10193. award.type = data.award;
  10194. xGame.common.getAward([award], () => {
  10195. let all = Math.floor(drawTimes / 3);
  10196. DataMgr.setDrawAwardTimes(all);
  10197. this.updateDraw();
  10198. });
  10199. }
  10200. else {
  10201. award.num = parseInt(data.nextid[1]);
  10202. award.type = parseInt(data.nextid[0]);
  10203. xGame.common.getAward([award], () => {
  10204. let all = Math.floor(drawTimes / 3);
  10205. DataMgr.setDrawAwardTimes(all);
  10206. this.updateDraw();
  10207. });
  10208. }
  10209. }
  10210. closeSelf() {
  10211. this.hide();
  10212. }
  10213. playSecretaryIdle() {
  10214. let parent = this.ui.secretary.displayObject;
  10215. parent.destroyChildren();
  10216. let xx = this.ui.secretary.width / 2;
  10217. let yy = this.ui.secretary.height;
  10218. let scale = xGame.common.getSecretaryScale();
  10219. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  10220. xGame.common.secretary.play(data, 1, true, parent);
  10221. }
  10222. }
  10223. UIDraw.uiName = "UIDraw";
  10224. class ui_UIFlyEft extends fgui.GComponent {
  10225. static createInstance() {
  10226. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  10227. }
  10228. onConstruct() {
  10229. this.n0 = (this.getChild("n0"));
  10230. this.n1 = (this.getChild("n1"));
  10231. this.n2 = (this.getChild("n2"));
  10232. this.n3 = (this.getChild("n3"));
  10233. this.n4 = (this.getChild("n4"));
  10234. this.n5 = (this.getChild("n5"));
  10235. this.n6 = (this.getChild("n6"));
  10236. this.n7 = (this.getChild("n7"));
  10237. this.iconNode = (this.getChild("iconNode"));
  10238. this.txt = (this.getChild("txt"));
  10239. this.txtNode = (this.getChild("txtNode"));
  10240. }
  10241. }
  10242. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  10243. class UIFlyEft extends UIBase {
  10244. constructor() {
  10245. super();
  10246. this.max = 8;
  10247. this.delay = 0;
  10248. }
  10249. onConstructor() {
  10250. this.ui = ui_UIFlyEft.createInstance();
  10251. this.contentPane = this.ui;
  10252. this.isEject = false;
  10253. this.isMuti = true;
  10254. this.ui.x += xGame.common.sysOffestNum;
  10255. }
  10256. getArrPos() {
  10257. if (this.iconPos && this.iconPos.length > 0)
  10258. return;
  10259. this.iconPos = [];
  10260. let temp;
  10261. for (let index = 0; index < this.max; index++) {
  10262. temp = this.ui["n" + index];
  10263. this.iconPos.push([temp.x, temp.y]);
  10264. }
  10265. }
  10266. show(stPos, edPos, num, type, callback) {
  10267. super.show();
  10268. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  10269. this.getArrPos();
  10270. this.updateUI(type);
  10271. this.updatePos();
  10272. this.runFly(edPos, callback);
  10273. this.runWorlds(stPos, num);
  10274. }
  10275. updateUI(type) {
  10276. let temp;
  10277. let str;
  10278. for (let index = 0; index < this.max; index++) {
  10279. temp = this.ui["n" + index];
  10280. str = this.getIconStr(type);
  10281. temp.url = xGame.common.getGameIconUrl(str);
  10282. }
  10283. }
  10284. getIconStr(type) {
  10285. switch (type) {
  10286. case Prop.diamond:
  10287. return "ty_zs";
  10288. case Prop.coin:
  10289. return "ty_jb";
  10290. default:
  10291. break;
  10292. }
  10293. }
  10294. updatePos() {
  10295. let temp;
  10296. for (let index = 0; index < this.max; index++) {
  10297. temp = this.ui["n" + index];
  10298. temp.x = this.iconPos[index][0];
  10299. temp.y = this.iconPos[index][1];
  10300. }
  10301. }
  10302. runFly(endPos, callback) {
  10303. let all = 0;
  10304. let temp;
  10305. for (let index = 0; index < this.max; index++) {
  10306. temp = this.ui["n" + index];
  10307. temp.visible = true;
  10308. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  10309. temp.visible = false;
  10310. all++;
  10311. if (all >= this.max) {
  10312. callback && callback();
  10313. }
  10314. }), 20 * index);
  10315. }
  10316. }
  10317. runWorlds(stPos, num) {
  10318. let str = "+" + num;
  10319. this.ui.txt.text = str;
  10320. let starX = stPos.x;
  10321. let starY = stPos.y + 50;
  10322. this.ui.txt.x = starX;
  10323. this.ui.txt.y = starY;
  10324. this.ui.txt.visible = true;
  10325. this.ui.txt.alpha = 1;
  10326. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  10327. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  10328. this.ui.txt.visible = false;
  10329. this.hide();
  10330. }));
  10331. }));
  10332. }
  10333. }
  10334. UIFlyEft.uiName = "UIFlyEft";
  10335. class ui_UIGetAward extends fgui.GComponent {
  10336. static createInstance() {
  10337. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  10338. }
  10339. onConstruct() {
  10340. this.n4 = (this.getChild("n4"));
  10341. this.n0 = (this.getChild("n0"));
  10342. this.myList = (this.getChild("myList"));
  10343. this.n1 = (this.getChild("n1"));
  10344. this.eftNode = (this.getChild("eftNode"));
  10345. this.btnNode = (this.getChild("btnNode"));
  10346. this.t0 = this.getTransition("t0");
  10347. }
  10348. }
  10349. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  10350. class UIGetAward extends UIBase {
  10351. constructor() {
  10352. super();
  10353. this.showTriple = true;
  10354. }
  10355. onConstructor() {
  10356. this.ui = ui_UIGetAward.createInstance();
  10357. this.contentPane = this.ui;
  10358. this.isEject = false;
  10359. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  10360. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  10361. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  10362. }
  10363. show(arr, showTriple, callback) {
  10364. super.show();
  10365. this.ui.t0.play();
  10366. this.ui.eftNode.visible = true;
  10367. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  10368. this.ui.eftNode.visible = false;
  10369. }), 1, 0, 0, 0.9);
  10370. this.awardArr = arr;
  10371. this.showTriple = showTriple;
  10372. this.callback = callback;
  10373. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  10374. this.ui.myList.numItems = arr.length;
  10375. xGame.soundMgr.playSound("getaward");
  10376. }
  10377. updateSelf(index, obj) {
  10378. let temp = this.awardArr[index];
  10379. let icon = this.getIcon(temp.type);
  10380. let str = icon;
  10381. if (temp.type > 2) {
  10382. str = "s" + icon;
  10383. }
  10384. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  10385. obj.myIcon.rotation = 0;
  10386. obj.numTxt.text = temp.num + "";
  10387. obj.numTxt.visible = temp.type > 2 ? false : true;
  10388. obj.nameTxt.text = this.getNameStr(temp.type);
  10389. }
  10390. renderItem(index, obj) {
  10391. this.updateSelf(index, obj);
  10392. }
  10393. tripleGetAward() {
  10394. Moyu.showVideoAd(() => {
  10395. this.getAward(3);
  10396. }, EAdType.triple);
  10397. }
  10398. normalGetAward() {
  10399. if (PlatMgr.isMisVideo())
  10400. this.tripleGetAward();
  10401. else
  10402. this.getAward();
  10403. }
  10404. getAward(times = 1) {
  10405. this.hide();
  10406. for (let index = 0; index < this.awardArr.length; index++) {
  10407. this.awardArr[index].num *= times;
  10408. }
  10409. this.callback && this.callback(times != 1);
  10410. }
  10411. getIcon(type) {
  10412. switch (type) {
  10413. case Prop.diamond:
  10414. return "ty_zs";
  10415. case Prop.coin:
  10416. return "ty_jb";
  10417. case Prop.gan1:
  10418. return "qg1";
  10419. case Prop.gan2:
  10420. return "qg2";
  10421. case Prop.gan3:
  10422. return "qg3";
  10423. case Prop.gan4:
  10424. return "qg4";
  10425. default:
  10426. break;
  10427. }
  10428. }
  10429. getNameStr(type) {
  10430. switch (type) {
  10431. case Prop.diamond:
  10432. return "Diamond";
  10433. case Prop.coin:
  10434. return "Coins";
  10435. case Prop.gan1:
  10436. case Prop.gan2:
  10437. case Prop.gan3:
  10438. case Prop.gan4:
  10439. return cfgTable.ballrodData[type - 1].name;
  10440. default:
  10441. break;
  10442. }
  10443. }
  10444. }
  10445. UIGetAward.uiName = "UIGetAward";
  10446. class Common {
  10447. constructor() {
  10448. this.convertNum = 0.025;
  10449. this.VectorUp = new Laya.Vector3(0, 1, 0);
  10450. this.scaleV3One = new Laya.Vector3();
  10451. this.scaleV3Two = new Laya.Vector3();
  10452. this.posV4 = new Laya.Vector4();
  10453. this.showDebug = false;
  10454. this.openGuide = true;
  10455. this.rodOffest = new Laya.Vector2(0, 0);
  10456. this.rodAngle = 0;
  10457. this.gameMode = GameMode.classic;
  10458. this.bigMoveLevelIndex = 1;
  10459. this.bigMoveNeedCoin = 1000;
  10460. this.classicNiceNeddCoin = 1000;
  10461. this.passAwardCoin = 2000;
  10462. this.classicRoomType = 1;
  10463. this.maxPower = 20;
  10464. this.natureMaxPower = 5;
  10465. this.videoPower = 2;
  10466. this.powerRecoverNum = 900;
  10467. this.curPlayerSkillType = 0;
  10468. this.isNewDay = false;
  10469. this.clickedBall = false;
  10470. this.placeBallCurLevel = 0;
  10471. this.placeBallStarNum = 0;
  10472. this.longHelpLine = false;
  10473. this.maxShareDiamondTimes = 3;
  10474. this.guideStep = 0;
  10475. this.temSelfLevel = 0;
  10476. this.extraMoveNum = 0;
  10477. this.curRankID = 0;
  10478. this.rankID = {
  10479. normalStar: 12000,
  10480. wxStar: 12001
  10481. };
  10482. this.skillNameList = ["Fall from the sky", "Unstoppable Force", "Freeze Shot", "Coming Soon"];
  10483. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4", "gf_jn4"];
  10484. this.btnClickStr = "buttonclick";
  10485. this.maxSkillLevel = 10;
  10486. this.upSkillLevel = false;
  10487. this.gameStartTime = 0;
  10488. this._sysOffestNum = 0;
  10489. this.angleV2 = new Laya.Vector2();
  10490. this.rootV = new Laya.Vector2(0, 1);
  10491. this.tempDir1 = new Laya.Vector2();
  10492. this.tempDir2 = new Laya.Vector2();
  10493. this.ballSize = 33;
  10494. this.stPos = new Laya.Point();
  10495. this.edPos = new Laya.Point();
  10496. Common._instance = this;
  10497. window["common"] = this;
  10498. }
  10499. static getInstance() {
  10500. if (!this._instance) {
  10501. this._instance = new Common();
  10502. }
  10503. return this._instance;
  10504. }
  10505. get sysOffestNum() {
  10506. if (this._sysOffestNum == 0) {
  10507. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  10508. }
  10509. return this._sysOffestNum;
  10510. }
  10511. testShader() {
  10512. let test = new LightShader();
  10513. test.texture = "res/d3Res/ballTexture/ball1.png";
  10514. Laya.stage.addChild(test);
  10515. }
  10516. playScale(node) {
  10517. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  10518. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  10519. }));
  10520. }));
  10521. }
  10522. setGroup(colli, ...group) {
  10523. let out = 0;
  10524. for (let index = 0; index < group.length; index++) {
  10525. if (index == 0) {
  10526. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10527. }
  10528. else {
  10529. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10530. }
  10531. }
  10532. colli.collisionGroup = out;
  10533. }
  10534. setCanGroupWith(colli, ...group) {
  10535. let out = 0;
  10536. for (let index = 0; index < group.length; index++) {
  10537. if (index == 0) {
  10538. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10539. }
  10540. else {
  10541. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10542. }
  10543. }
  10544. colli.canCollideWith = out;
  10545. }
  10546. loadPrefab(name, callback) {
  10547. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  10548. let prefab = new Laya.Prefab();
  10549. prefab.json = obj;
  10550. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  10551. callback && callback(img);
  10552. }));
  10553. }
  10554. pos2to3Convert(x, y, d3Pos) {
  10555. x = x + this.sysOffestNum;
  10556. d3Pos.setValue(x, y, 0);
  10557. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  10558. if (success) {
  10559. }
  10560. else {
  10561. console.error("转换出错了。。。。。。。。");
  10562. }
  10563. }
  10564. scale2to3Convert(num) {
  10565. this.scaleV3One.setValue(0, 0, 0);
  10566. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  10567. this.scaleV3Two.setValue(0, num, 0);
  10568. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  10569. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  10570. return outNum;
  10571. }
  10572. pos3to2Convert(d3Pos) {
  10573. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  10574. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  10575. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  10576. d3Pos.x -= this.sysOffestNum;
  10577. }
  10578. scale3to2Convert(num) {
  10579. let scale = this.scale2to3Convert(1);
  10580. let d2Out = num / scale;
  10581. return d2Out;
  10582. }
  10583. getCollider(type, restitution = 0.9, density = 10) {
  10584. let colli;
  10585. if (type == "box")
  10586. colli = new Laya.BoxCollider();
  10587. else
  10588. colli = new Laya.CircleCollider();
  10589. colli.friction = 0;
  10590. colli.restitution = restitution;
  10591. colli.density = density;
  10592. return colli;
  10593. }
  10594. getRigbody() {
  10595. let rigy = new Laya.RigidBody();
  10596. rigy.bullet = true;
  10597. rigy.allowRotation = false;
  10598. rigy.allowSleep = false;
  10599. rigy.gravityScale = 0;
  10600. return rigy;
  10601. }
  10602. getfguiRotation(x, y) {
  10603. this.angleV2.setValue(x, y);
  10604. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  10605. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  10606. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  10607. angle = -angle;
  10608. }
  10609. return 180 + angle;
  10610. }
  10611. getAngle(x, y) {
  10612. this.angleV2.setValue(x, y);
  10613. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  10614. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  10615. return angle;
  10616. }
  10617. randomNum(a, b) {
  10618. return a + Math.floor((b - a + 1) * Math.random());
  10619. }
  10620. getRandArrEle(arr) {
  10621. return arr[Math.floor(arr.length * Math.random())];
  10622. }
  10623. getSign(val) {
  10624. return val >= 0 ? 1 : -1;
  10625. }
  10626. botherArr(arr) {
  10627. let times = arr.length + 2;
  10628. let length = arr.length;
  10629. let a;
  10630. let b;
  10631. let temp;
  10632. for (let index = 0; index < times; index++) {
  10633. a = Math.floor(Math.random() * length);
  10634. b = Math.floor(Math.random() * length);
  10635. temp = arr[a];
  10636. arr[a] = arr[b];
  10637. arr[b] = temp;
  10638. }
  10639. }
  10640. getGameIconUrl(id) {
  10641. return "ui://game/" + id;
  10642. }
  10643. getComponentUrl(id) {
  10644. return "ui://game/" + id;
  10645. }
  10646. getAnimation() {
  10647. }
  10648. judgeSkillType(type = SkillType.highSpace) {
  10649. if (this.gameMode == GameMode.classic)
  10650. return;
  10651. let gameMgr = this.gameMgr;
  10652. if (gameMgr.selfTurn) {
  10653. if (gameMgr.selfCurSkill == type) {
  10654. return true;
  10655. }
  10656. }
  10657. else {
  10658. if (gameMgr.aiCurSkill == type) {
  10659. return true;
  10660. }
  10661. }
  10662. }
  10663. ballColliHole(collider) {
  10664. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  10665. xGame.common.gameMgr.isFirstInGame = false;
  10666. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  10667. }
  10668. collider.owner.mySrc.checkWrongBall();
  10669. }
  10670. getArrMaxEle(arr) {
  10671. let max = -Infinity;
  10672. for (let index = 0; index < arr.length; index++) {
  10673. max = Math.max(arr[index], max);
  10674. }
  10675. return max;
  10676. }
  10677. getArrMinEle(arr) {
  10678. let min = Infinity;
  10679. for (let index = 0; index < arr.length; index++) {
  10680. min = Math.min(arr[index], min);
  10681. }
  10682. return min;
  10683. }
  10684. playRandomMutiBallBigSkillSound() {
  10685. if (Math.random() <= 0.5)
  10686. return;
  10687. let rand = this.randomNum(1, 6);
  10688. let str = "ganfa0" + rand;
  10689. xGame.soundMgr.playSound(str);
  10690. }
  10691. showOneCamera(type) {
  10692. let object = xGame.common.d3World.cameraObj;
  10693. for (const key in object) {
  10694. if (Object.prototype.hasOwnProperty.call(object, key)) {
  10695. object[key].init();
  10696. object[key].owner.active = key == type;
  10697. }
  10698. }
  10699. }
  10700. checkBallOverBorder(x, y) {
  10701. let radius = 17;
  10702. let condition = this._checkBorder(x + radius, y) ||
  10703. this._checkBorder(x - radius, y) ||
  10704. this._checkBorder(x, y + radius) ||
  10705. this._checkBorder(x, y - radius);
  10706. if (condition) {
  10707. return true;
  10708. }
  10709. }
  10710. _checkBorder(x, y) {
  10711. let borderRect = this.d2World.borderRect;
  10712. let xOffest = 20;
  10713. let yOffest = 20;
  10714. if (y <= borderRect.y - yOffest) {
  10715. return true;
  10716. }
  10717. if (y >= borderRect.y + borderRect.height + yOffest) {
  10718. return true;
  10719. }
  10720. if (x <= borderRect.x - xOffest) {
  10721. return true;
  10722. }
  10723. if (x >= borderRect.x + borderRect.width + xOffest) {
  10724. return true;
  10725. }
  10726. }
  10727. initWeight(cfg) {
  10728. let allCfgData = { data: {}, allWeightNum: 0 };
  10729. let weightCfg = allCfgData.data;
  10730. let weight = 0;
  10731. for (const key in cfg) {
  10732. weightCfg[key] = {};
  10733. weightCfg[key].id = cfg[key].id;
  10734. weightCfg[key].minWeight = weight;
  10735. weight += cfg[key].weight;
  10736. weightCfg[key].maxWeight = weight;
  10737. }
  10738. allCfgData.allWeightNum = weight;
  10739. return allCfgData;
  10740. }
  10741. getRandomWeightData(cfg) {
  10742. let weightCfg = cfg.data;
  10743. let allWeightNum = cfg.allWeightNum;
  10744. let rand = Math.floor(Math.random() * allWeightNum);
  10745. for (const key in weightCfg) {
  10746. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  10747. return weightCfg[key];
  10748. }
  10749. }
  10750. return weightCfg[1];
  10751. }
  10752. showGirlTalkPop(wordsIndex, node, msgNode) {
  10753. node.visible = true;
  10754. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  10755. node.t0.play(Laya.Handler.create(this, () => {
  10756. node.visible = false;
  10757. }));
  10758. }
  10759. stopGirlPop(node) {
  10760. node.t0.stop();
  10761. node.visible = false;
  10762. }
  10763. createHead(loader, url, size = 107) {
  10764. if (Laya.Browser.name == "Browser") {
  10765. loader.url = url;
  10766. return;
  10767. }
  10768. if (Moyu.isTT) {
  10769. let localImage = new Image();
  10770. localImage.src = url;
  10771. localImage.onload = () => {
  10772. let t2d = new Laya.Texture2D();
  10773. t2d.width = size;
  10774. t2d.height = size;
  10775. loader.displayObject.graphics.drawImage(new Laya.Texture(t2d), 0, 0);
  10776. t2d.loadImageSource(localImage);
  10777. };
  10778. }
  10779. else {
  10780. loader.url = url;
  10781. }
  10782. }
  10783. addTestCoin(num) {
  10784. DataMgr.setCoin(num);
  10785. }
  10786. addTestDiamond(num) {
  10787. DataMgr.setDiamond(num);
  10788. }
  10789. addTestSkill() {
  10790. DataMgr.setBigSkill(0, 99);
  10791. DataMgr.setBigSkill(1, 99);
  10792. DataMgr.setBigSkill(2, 99);
  10793. }
  10794. playClassicEmotion(number, x, y) {
  10795. if (this.gameMode == GameMode.bigMove)
  10796. return;
  10797. let randIndex = this.randomNum(0, 2);
  10798. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  10799. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  10800. if (this.gameMgr.selfTurn) {
  10801. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  10802. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10803. }
  10804. else {
  10805. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  10806. }
  10807. else {
  10808. if (number == this.gameMgr.blackNum) {
  10809. if (this.gameMgr.selfBallArr.length == 0) {
  10810. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10811. }
  10812. else {
  10813. }
  10814. }
  10815. else {
  10816. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10817. }
  10818. }
  10819. }
  10820. }
  10821. else {
  10822. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  10823. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10824. }
  10825. else {
  10826. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  10827. }
  10828. else {
  10829. if (number == this.gameMgr.blackNum) {
  10830. if (this.gameMgr.aiBallArr.length == 0) {
  10831. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10832. }
  10833. else {
  10834. }
  10835. }
  10836. else {
  10837. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10838. }
  10839. }
  10840. }
  10841. }
  10842. }
  10843. playHappySound(number) {
  10844. if (this.gameMode != GameMode.classic)
  10845. return;
  10846. if (number == 8)
  10847. return;
  10848. let play = false;
  10849. if (this.gameMgr.selfTurn) {
  10850. if (this.gameMgr.ensureBallType) {
  10851. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  10852. play = true;
  10853. }
  10854. }
  10855. else {
  10856. play = true;
  10857. }
  10858. }
  10859. else {
  10860. if (this.gameMgr.ensureBallType) {
  10861. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  10862. play = true;
  10863. }
  10864. }
  10865. else {
  10866. play = true;
  10867. }
  10868. }
  10869. if (play)
  10870. xGame.soundMgr.playSound("applause");
  10871. }
  10872. destroyClassicEmotion() {
  10873. if (this.gameMode == GameMode.bigMove)
  10874. return;
  10875. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  10876. parent.destroyChildren();
  10877. }
  10878. playAwardSpine(x, y) {
  10879. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  10880. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  10881. this.awardSpine.play(data, 0, false, parent);
  10882. }
  10883. destroyAwardSpine() {
  10884. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  10885. parent.destroyChildren();
  10886. }
  10887. isBlock(bx, by, hx, hy, except = null) {
  10888. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  10889. let balls = xGame.common.d2World.ballArr;
  10890. let outArr = [];
  10891. for (let index = 0; index < balls.length; index++) {
  10892. let obj = balls[index];
  10893. if (obj.number == 0)
  10894. continue;
  10895. if (obj == except)
  10896. continue;
  10897. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  10898. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  10899. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  10900. if (num >= 1)
  10901. num = 1;
  10902. if (num < 0)
  10903. continue;
  10904. let gap = Math.sin(Math.acos(num)) * dis;
  10905. if (gap < this.ballSize) {
  10906. outArr.push({
  10907. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  10908. disHon: Math.cos(Math.acos(num)) * dis,
  10909. disVer: Math.sin(Math.acos(num)) * dis,
  10910. src: balls[index],
  10911. dir: this.tempDir1
  10912. });
  10913. }
  10914. }
  10915. if (outArr.length > 0) {
  10916. outArr.sort((a, b) => { return a.dis - b.dis; });
  10917. return outArr[0];
  10918. }
  10919. }
  10920. AngleBetween(vector1, vector2) {
  10921. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  10922. return rad * (180 / Math.PI);
  10923. }
  10924. getSecretaryScale() {
  10925. if (this.secretary.spineName == "mishu") {
  10926. return 1.28;
  10927. }
  10928. else {
  10929. return 1.024;
  10930. }
  10931. }
  10932. signAwardContainsRod(arr) {
  10933. let temp;
  10934. for (let index = 0; index < arr.length; index++) {
  10935. temp = arr[index].split('-')[0];
  10936. if (parseInt(temp) > 2) {
  10937. return true;
  10938. }
  10939. }
  10940. }
  10941. judgeSameDay() {
  10942. let lastTime = DataMgr.getSignTime();
  10943. let curTime = new Date().getTime();
  10944. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  10945. return true;
  10946. }
  10947. return false;
  10948. }
  10949. getAward(arr, callback) {
  10950. let showTriple = arr[0].type <= 2;
  10951. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  10952. let temp;
  10953. for (let index = 0; index < arr.length; index++) {
  10954. temp = arr[index];
  10955. switch (temp.type) {
  10956. case 1:
  10957. this.playObjFlyAnim(temp.num, temp.type);
  10958. break;
  10959. case 2:
  10960. this.playObjFlyAnim(temp.num, temp.type);
  10961. break;
  10962. case 3:
  10963. case 4:
  10964. case 5:
  10965. case 6:
  10966. DataMgr.setBallRod(temp.type - 2, 1);
  10967. DataMgr.setCurBallRod(temp.type - 2);
  10968. break;
  10969. default:
  10970. break;
  10971. }
  10972. }
  10973. callback && callback(watchVideo);
  10974. });
  10975. }
  10976. getMoneyNode() {
  10977. let moneyNode;
  10978. let sign = xGame.uiMgr.getUI(UISign);
  10979. let draw = xGame.uiMgr.getUI(UIDraw);
  10980. let end = xGame.uiMgr.getUI(UIGameEnd);
  10981. let skill = xGame.uiMgr.getUI(UISkill);
  10982. if (sign && !sign.isHide)
  10983. moneyNode = sign.ui.moneyNode;
  10984. if (draw && !draw.isHide)
  10985. moneyNode = draw.ui.moneyNode;
  10986. if (end && !end.isHide)
  10987. moneyNode = end.ui.moneyNode;
  10988. if (skill && !skill.isHide)
  10989. moneyNode = skill.ui.moneyNode;
  10990. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  10991. let main = xGame.uiMgr.getUI(UIMain);
  10992. if (condition1 && main && !main.isHide) {
  10993. moneyNode = main.ui.moneyNode;
  10994. }
  10995. return moneyNode;
  10996. }
  10997. playObjFlyAnim(num, type, callback = null) {
  10998. this.stPos.x = Laya.stage.width / 2;
  10999. this.stPos.y = Laya.stage.height / 2;
  11000. let moneyNode = this.getMoneyNode();
  11001. switch (type) {
  11002. case Prop.diamond:
  11003. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  11004. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  11005. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  11006. this.edPos.x /= 2;
  11007. this.edPos.y /= 2;
  11008. break;
  11009. case Prop.coin:
  11010. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  11011. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  11012. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  11013. this.edPos.x /= 2;
  11014. this.edPos.y /= 2;
  11015. break;
  11016. default:
  11017. break;
  11018. }
  11019. xGame.soundMgr.playSound("coinbag");
  11020. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  11021. switch (type) {
  11022. case Prop.diamond:
  11023. DataMgr.setDiamond(num);
  11024. break;
  11025. case Prop.coin:
  11026. DataMgr.setCoin(num);
  11027. break;
  11028. default:
  11029. break;
  11030. }
  11031. callback && callback();
  11032. });
  11033. }
  11034. autoPopUIView() {
  11035. let arr = [];
  11036. let sign = this.judgeSameDay() ? false : true;
  11037. if (sign)
  11038. arr.push("sign");
  11039. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  11040. if (draw)
  11041. arr.push("draw");
  11042. if (arr.length <= 0)
  11043. return;
  11044. let str = this.getRandArrEle(arr);
  11045. switch (str) {
  11046. case "sign":
  11047. xGame.uiMgr.Show(UISign);
  11048. break;
  11049. case "draw":
  11050. xGame.uiMgr.Show(UIDraw);
  11051. break;
  11052. default:
  11053. break;
  11054. }
  11055. }
  11056. getMSTime(time) {
  11057. let min = Math.floor(time / 60);
  11058. let sec = Math.floor((time - min * 60));
  11059. if (sec < 10)
  11060. sec = "0" + sec;
  11061. if (min < 10)
  11062. min = "0" + min;
  11063. return `${min}:${sec}`;
  11064. }
  11065. testPower() {
  11066. DataMgr.setPower(0, false);
  11067. }
  11068. getAllStarNum() {
  11069. let data = DataMgr.getPlaceBallLevelList();
  11070. let out = 0;
  11071. for (let index = 0; index < data.length; index++) {
  11072. out += data[index].star;
  11073. }
  11074. return out;
  11075. }
  11076. recoverCameraView() {
  11077. Laya.timer.once(900, this, () => {
  11078. xGame.common.showOneCamera("mainCamera");
  11079. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  11080. xGame.common.gameUI.ui.d2Node.alpha = 1;
  11081. xGame.common.gameUI.ui.border.alpha = 0;
  11082. if (Laya.physicsTimer.scale < 1) {
  11083. Laya.physicsTimer.scale = 1;
  11084. }
  11085. }
  11086. });
  11087. }
  11088. getClassicLevel() {
  11089. let successTimes = DataMgr.getClassicTimes();
  11090. let needKey = "";
  11091. let lastKey = "";
  11092. let cfg = cfgTable.classictimesData;
  11093. let data;
  11094. for (const key in cfg) {
  11095. data = cfg[key];
  11096. if (successTimes <= data.times) {
  11097. needKey = key;
  11098. }
  11099. lastKey = key;
  11100. }
  11101. if (needKey == "")
  11102. needKey = lastKey;
  11103. return cfg[needKey];
  11104. }
  11105. }
  11106. Common._instance = null;
  11107. class ui_Component92 extends fgui.GComponent {
  11108. static createInstance() {
  11109. return (fgui.UIPackage.createObject("game", "Component92"));
  11110. }
  11111. onConstruct() {
  11112. this.n0 = (this.getChild("n0"));
  11113. }
  11114. }
  11115. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  11116. class ui_Component129 extends fgui.GProgressBar {
  11117. static createInstance() {
  11118. return (fgui.UIPackage.createObject("game", "Component129"));
  11119. }
  11120. onConstruct() {
  11121. this.bar_v = (this.getChild("bar_v"));
  11122. this.n84 = (this.getChild("n84"));
  11123. }
  11124. }
  11125. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  11126. class ui_Component130 extends fgui.GComponent {
  11127. static createInstance() {
  11128. return (fgui.UIPackage.createObject("game", "Component130"));
  11129. }
  11130. onConstruct() {
  11131. this.ani = (this.getChild("ani"));
  11132. this.t0 = this.getTransition("t0");
  11133. }
  11134. }
  11135. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  11136. class ui_powerEft extends fgui.GComponent {
  11137. static createInstance() {
  11138. return (fgui.UIPackage.createObject("game", "powerEft"));
  11139. }
  11140. onConstruct() {
  11141. this.ani = (this.getChild("ani"));
  11142. this.n88 = (this.getChild("n88"));
  11143. this.n89 = (this.getChild("n89"));
  11144. }
  11145. }
  11146. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  11147. class ui_PutBallLevelDisplay extends fgui.GComponent {
  11148. static createInstance() {
  11149. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  11150. }
  11151. onConstruct() {
  11152. this.c1 = this.getController("c1");
  11153. this.n2 = (this.getChild("n2"));
  11154. this.n22 = (this.getChild("n22"));
  11155. this.n23 = (this.getChild("n23"));
  11156. this.n15 = (this.getChild("n15"));
  11157. this.challenge = (this.getChild("challenge"));
  11158. this.n17 = (this.getChild("n17"));
  11159. this.n3 = (this.getChild("n3"));
  11160. this.starNode = (this.getChild("starNode"));
  11161. this.levelTxt = (this.getChild("levelTxt"));
  11162. this.n14 = (this.getChild("n14"));
  11163. this.n19 = (this.getChild("n19"));
  11164. this.n20 = (this.getChild("n20"));
  11165. this.n21 = (this.getChild("n21"));
  11166. this.special = (this.getChild("special"));
  11167. }
  11168. }
  11169. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  11170. class ui_Component79 extends fgui.GComponent {
  11171. static createInstance() {
  11172. return (fgui.UIPackage.createObject("game", "Component79"));
  11173. }
  11174. onConstruct() {
  11175. this.c1 = this.getController("c1");
  11176. this.n7 = (this.getChild("n7"));
  11177. this.n8 = (this.getChild("n8"));
  11178. this.n9 = (this.getChild("n9"));
  11179. this.n10 = (this.getChild("n10"));
  11180. this.n11 = (this.getChild("n11"));
  11181. this.n12 = (this.getChild("n12"));
  11182. }
  11183. }
  11184. ui_Component79.URL = "ui://isxx5ak7avag477";
  11185. class ui_Component80 extends fgui.GComponent {
  11186. static createInstance() {
  11187. return (fgui.UIPackage.createObject("game", "Component80"));
  11188. }
  11189. onConstruct() {
  11190. this.n0 = (this.getChild("n0"));
  11191. this.n1 = (this.getChild("n1"));
  11192. this.myList = (this.getChild("myList"));
  11193. this.t0 = this.getTransition("t0");
  11194. }
  11195. }
  11196. ui_Component80.URL = "ui://isxx5ak7avag47b";
  11197. class ui_SignNormal extends fgui.GComponent {
  11198. static createInstance() {
  11199. return (fgui.UIPackage.createObject("game", "SignNormal"));
  11200. }
  11201. onConstruct() {
  11202. this.c1 = this.getController("c1");
  11203. this.n7 = (this.getChild("n7"));
  11204. this.n15 = (this.getChild("n15"));
  11205. this.titleTxt = (this.getChild("titleTxt"));
  11206. this.n8 = (this.getChild("n8"));
  11207. this.myIcon = (this.getChild("myIcon"));
  11208. this.numTxt = (this.getChild("numTxt"));
  11209. this.n12 = (this.getChild("n12"));
  11210. this.n13 = (this.getChild("n13"));
  11211. this.n17 = (this.getChild("n17"));
  11212. this.n14 = (this.getChild("n14"));
  11213. }
  11214. }
  11215. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  11216. class ui_screenNode extends fgui.GComponent {
  11217. static createInstance() {
  11218. return (fgui.UIPackage.createObject("game", "screenNode"));
  11219. }
  11220. onConstruct() {
  11221. this.n9 = (this.getChild("n9"));
  11222. this.screenImg = (this.getChild("screenImg"));
  11223. }
  11224. }
  11225. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  11226. class ui_GetAwrad_com1 extends fgui.GComponent {
  11227. static createInstance() {
  11228. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  11229. }
  11230. onConstruct() {
  11231. this.n38 = (this.getChild("n38"));
  11232. this.n39 = (this.getChild("n39"));
  11233. this.n40 = (this.getChild("n40"));
  11234. this.t0 = this.getTransition("t0");
  11235. this.t1 = this.getTransition("t1");
  11236. }
  11237. }
  11238. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  11239. class ui_GetAwrad_com2 extends fgui.GComponent {
  11240. static createInstance() {
  11241. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  11242. }
  11243. onConstruct() {
  11244. this.n39 = (this.getChild("n39"));
  11245. this.n40 = (this.getChild("n40"));
  11246. this.t0 = this.getTransition("t0");
  11247. }
  11248. }
  11249. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  11250. class ui_Component128 extends fgui.GComponent {
  11251. static createInstance() {
  11252. return (fgui.UIPackage.createObject("game", "Component128"));
  11253. }
  11254. onConstruct() {
  11255. this.n38 = (this.getChild("n38"));
  11256. this.n40 = (this.getChild("n40"));
  11257. }
  11258. }
  11259. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  11260. class ui_Component100_1 extends fgui.GComponent {
  11261. static createInstance() {
  11262. return (fgui.UIPackage.createObject("game", "Component100_1"));
  11263. }
  11264. onConstruct() {
  11265. this.myNode = (this.getChild("myNode"));
  11266. this.t0 = this.getTransition("t0");
  11267. }
  11268. }
  11269. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  11270. class ui_Component142 extends fgui.GComponent {
  11271. static createInstance() {
  11272. return (fgui.UIPackage.createObject("game", "Component142"));
  11273. }
  11274. onConstruct() {
  11275. this.n41 = (this.getChild("n41"));
  11276. this.n42 = (this.getChild("n42"));
  11277. }
  11278. }
  11279. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  11280. class ui_main_guang extends fgui.GComponent {
  11281. static createInstance() {
  11282. return (fgui.UIPackage.createObject("game", "main_guang"));
  11283. }
  11284. onConstruct() {
  11285. this.n1 = (this.getChild("n1"));
  11286. this.n2 = (this.getChild("n2"));
  11287. this.n3 = (this.getChild("n3"));
  11288. this.n4 = (this.getChild("n4"));
  11289. this.n5 = (this.getChild("n5"));
  11290. this.n6 = (this.getChild("n6"));
  11291. this.n8 = (this.getChild("n8"));
  11292. this.t0 = this.getTransition("t0");
  11293. }
  11294. }
  11295. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  11296. class ui_try_com1 extends fgui.GComponent {
  11297. static createInstance() {
  11298. return (fgui.UIPackage.createObject("game", "try_com1"));
  11299. }
  11300. onConstruct() {
  11301. this.c1 = this.getController("c1");
  11302. this.n0 = (this.getChild("n0"));
  11303. this.n2 = (this.getChild("n2"));
  11304. this.cancelBtn = (this.getChild("cancelBtn"));
  11305. this.videoBtn = (this.getChild("videoBtn"));
  11306. this.n9 = (this.getChild("n9"));
  11307. this.n24 = (this.getChild("n24"));
  11308. this.titleTxt = (this.getChild("titleTxt"));
  11309. this.n32 = (this.getChild("n32"));
  11310. this.n29 = (this.getChild("n29"));
  11311. this.n36 = (this.getChild("n36"));
  11312. this.txtTime = (this.getChild("txtTime"));
  11313. this.t0 = this.getTransition("t0");
  11314. }
  11315. }
  11316. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  11317. class ui_try_com2 extends fgui.GComponent {
  11318. static createInstance() {
  11319. return (fgui.UIPackage.createObject("game", "try_com2"));
  11320. }
  11321. onConstruct() {
  11322. this.skillicon = (this.getChild("skillicon"));
  11323. this.n35 = (this.getChild("n35"));
  11324. this.n31 = (this.getChild("n31"));
  11325. this.n32 = (this.getChild("n32"));
  11326. this.n33 = (this.getChild("n33"));
  11327. this.n34 = (this.getChild("n34"));
  11328. }
  11329. }
  11330. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  11331. class ui_try_com3 extends fgui.GComponent {
  11332. static createInstance() {
  11333. return (fgui.UIPackage.createObject("game", "try_com3"));
  11334. }
  11335. onConstruct() {
  11336. this.n33 = (this.getChild("n33"));
  11337. this.n34 = (this.getChild("n34"));
  11338. this.n35 = (this.getChild("n35"));
  11339. this.t0 = this.getTransition("t0");
  11340. }
  11341. }
  11342. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  11343. class ui_Component121 extends fgui.GButton {
  11344. static createInstance() {
  11345. return (fgui.UIPackage.createObject("game", "Component121"));
  11346. }
  11347. onConstruct() {
  11348. this.n3 = (this.getChild("n3"));
  11349. this.t0 = this.getTransition("t0");
  11350. }
  11351. }
  11352. ui_Component121.URL = "ui://isxx5ak7cy72v4ib";
  11353. class ui_huihe1 extends fgui.GComponent {
  11354. static createInstance() {
  11355. return (fgui.UIPackage.createObject("game", "huihe1"));
  11356. }
  11357. onConstruct() {
  11358. this.n0 = (this.getChild("n0"));
  11359. this.n1 = (this.getChild("n1"));
  11360. this.t0 = this.getTransition("t0");
  11361. }
  11362. }
  11363. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  11364. class ui_huihe2 extends fgui.GComponent {
  11365. static createInstance() {
  11366. return (fgui.UIPackage.createObject("game", "huihe2"));
  11367. }
  11368. onConstruct() {
  11369. this.n0 = (this.getChild("n0"));
  11370. this.n1 = (this.getChild("n1"));
  11371. this.t0 = this.getTransition("t0");
  11372. }
  11373. }
  11374. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  11375. class ui_Component143 extends fgui.GComponent {
  11376. static createInstance() {
  11377. return (fgui.UIPackage.createObject("game", "Component143"));
  11378. }
  11379. onConstruct() {
  11380. this.n3 = (this.getChild("n3"));
  11381. this.n4 = (this.getChild("n4"));
  11382. this.n5 = (this.getChild("n5"));
  11383. this.n6 = (this.getChild("n6"));
  11384. this.n7 = (this.getChild("n7"));
  11385. this.n8 = (this.getChild("n8"));
  11386. this.n9 = (this.getChild("n9"));
  11387. this.n10 = (this.getChild("n10"));
  11388. this.t0 = this.getTransition("t0");
  11389. }
  11390. }
  11391. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  11392. class ui_dh_jingbi2 extends fgui.GComponent {
  11393. static createInstance() {
  11394. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  11395. }
  11396. onConstruct() {
  11397. this.n0 = (this.getChild("n0"));
  11398. this.n1 = (this.getChild("n1"));
  11399. this.n2 = (this.getChild("n2"));
  11400. this.n3 = (this.getChild("n3"));
  11401. this.n4 = (this.getChild("n4"));
  11402. this.n5 = (this.getChild("n5"));
  11403. this.n6 = (this.getChild("n6"));
  11404. this.n8 = (this.getChild("n8"));
  11405. this.n10 = (this.getChild("n10"));
  11406. this.t0 = this.getTransition("t0");
  11407. }
  11408. }
  11409. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  11410. class ui_dh_jingbi2_1 extends fgui.GComponent {
  11411. static createInstance() {
  11412. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  11413. }
  11414. onConstruct() {
  11415. this.n1 = (this.getChild("n1"));
  11416. this.n4 = (this.getChild("n4"));
  11417. this.t0 = this.getTransition("t0");
  11418. }
  11419. }
  11420. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  11421. class ui_dh_jingbi3 extends fgui.GComponent {
  11422. static createInstance() {
  11423. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  11424. }
  11425. onConstruct() {
  11426. this.n0 = (this.getChild("n0"));
  11427. this.n1 = (this.getChild("n1"));
  11428. this.n2 = (this.getChild("n2"));
  11429. this.n3 = (this.getChild("n3"));
  11430. this.n4 = (this.getChild("n4"));
  11431. this.n5 = (this.getChild("n5"));
  11432. this.n6 = (this.getChild("n6"));
  11433. this.n8 = (this.getChild("n8"));
  11434. this.n10 = (this.getChild("n10"));
  11435. this.t0 = this.getTransition("t0");
  11436. }
  11437. }
  11438. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  11439. class ui_dh_jingbi3_1 extends fgui.GComponent {
  11440. static createInstance() {
  11441. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  11442. }
  11443. onConstruct() {
  11444. this.n3 = (this.getChild("n3"));
  11445. this.n1 = (this.getChild("n1"));
  11446. this.t0 = this.getTransition("t0");
  11447. }
  11448. }
  11449. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  11450. class ui_hb_jinbi1 extends fgui.GButton {
  11451. static createInstance() {
  11452. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  11453. }
  11454. onConstruct() {
  11455. this.n20 = (this.getChild("n20"));
  11456. this.n25 = (this.getChild("n25"));
  11457. this.coinTxt = (this.getChild("coinTxt"));
  11458. this.n28 = (this.getChild("n28"));
  11459. this.n32 = (this.getChild("n32"));
  11460. this.n38 = (this.getChild("n38"));
  11461. this.n45 = (this.getChild("n45"));
  11462. this.getTips = (this.getChild("getTips"));
  11463. this.n39 = (this.getChild("n39"));
  11464. this.diamondTxt = (this.getChild("diamondTxt"));
  11465. this.n41 = (this.getChild("n41"));
  11466. this.n42 = (this.getChild("n42"));
  11467. this.n46 = (this.getChild("n46"));
  11468. this.n47 = (this.getChild("n47"));
  11469. this.n48 = (this.getChild("n48"));
  11470. this.t0 = this.getTransition("t0");
  11471. }
  11472. }
  11473. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  11474. class ui_hb_jinbi2 extends fgui.GButton {
  11475. static createInstance() {
  11476. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  11477. }
  11478. onConstruct() {
  11479. this.n20 = (this.getChild("n20"));
  11480. this.n25 = (this.getChild("n25"));
  11481. this.coinTxt = (this.getChild("coinTxt"));
  11482. this.n28 = (this.getChild("n28"));
  11483. this.n32 = (this.getChild("n32"));
  11484. this.n38 = (this.getChild("n38"));
  11485. this.n39 = (this.getChild("n39"));
  11486. this.diamondTxt = (this.getChild("diamondTxt"));
  11487. this.n41 = (this.getChild("n41"));
  11488. this.n42 = (this.getChild("n42"));
  11489. this.n43 = (this.getChild("n43"));
  11490. this.n44 = (this.getChild("n44"));
  11491. this.n45 = (this.getChild("n45"));
  11492. this.t0 = this.getTransition("t0");
  11493. }
  11494. }
  11495. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  11496. class ui_hb_jinbi3 extends fgui.GButton {
  11497. static createInstance() {
  11498. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  11499. }
  11500. onConstruct() {
  11501. this.n20 = (this.getChild("n20"));
  11502. this.n25 = (this.getChild("n25"));
  11503. this.coinTxt = (this.getChild("coinTxt"));
  11504. this.n28 = (this.getChild("n28"));
  11505. this.n32 = (this.getChild("n32"));
  11506. this.n38 = (this.getChild("n38"));
  11507. this.n39 = (this.getChild("n39"));
  11508. this.diamondTxt = (this.getChild("diamondTxt"));
  11509. this.n41 = (this.getChild("n41"));
  11510. this.n42 = (this.getChild("n42"));
  11511. this.n43 = (this.getChild("n43"));
  11512. this.n44 = (this.getChild("n44"));
  11513. this.n45 = (this.getChild("n45"));
  11514. this.t0 = this.getTransition("t0");
  11515. }
  11516. }
  11517. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  11518. class ui_Component104 extends fgui.GComponent {
  11519. static createInstance() {
  11520. return (fgui.UIPackage.createObject("game", "Component104"));
  11521. }
  11522. onConstruct() {
  11523. this.c1 = this.getController("c1");
  11524. this.n12 = (this.getChild("n12"));
  11525. this.coinBtn = (this.getChild("coinBtn"));
  11526. this.diamondBtn = (this.getChild("diamondBtn"));
  11527. this.node3 = (this.getChild("node3"));
  11528. this.node4 = (this.getChild("node4"));
  11529. this.node5 = (this.getChild("node5"));
  11530. this.node1 = (this.getChild("node1"));
  11531. this.node2 = (this.getChild("node2"));
  11532. this.node6 = (this.getChild("node6"));
  11533. this.t0 = this.getTransition("t0");
  11534. }
  11535. }
  11536. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  11537. class ui_Component105 extends fgui.GButton {
  11538. static createInstance() {
  11539. return (fgui.UIPackage.createObject("game", "Component105"));
  11540. }
  11541. onConstruct() {
  11542. this.c1 = this.getController("c1");
  11543. this.n49 = (this.getChild("n49"));
  11544. this.n18 = (this.getChild("n18"));
  11545. this.n46 = (this.getChild("n46"));
  11546. this.n48 = (this.getChild("n48"));
  11547. }
  11548. }
  11549. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  11550. class ui_Component106 extends fgui.GButton {
  11551. static createInstance() {
  11552. return (fgui.UIPackage.createObject("game", "Component106"));
  11553. }
  11554. onConstruct() {
  11555. this.c1 = this.getController("c1");
  11556. this.n49 = (this.getChild("n49"));
  11557. this.n18 = (this.getChild("n18"));
  11558. this.n46 = (this.getChild("n46"));
  11559. this.n48 = (this.getChild("n48"));
  11560. }
  11561. }
  11562. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  11563. class ui_hb_zs1 extends fgui.GButton {
  11564. static createInstance() {
  11565. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  11566. }
  11567. onConstruct() {
  11568. this.c1 = this.getController("c1");
  11569. this.n20 = (this.getChild("n20"));
  11570. this.n21 = (this.getChild("n21"));
  11571. this.n26 = (this.getChild("n26"));
  11572. this.n27 = (this.getChild("n27"));
  11573. this.shareTxt = (this.getChild("shareTxt"));
  11574. this.n32 = (this.getChild("n32"));
  11575. this.n38 = (this.getChild("n38"));
  11576. this.n39 = (this.getChild("n39"));
  11577. this.n44 = (this.getChild("n44"));
  11578. this.diamondTxt = (this.getChild("diamondTxt"));
  11579. this.n41 = (this.getChild("n41"));
  11580. this.n45 = (this.getChild("n45"));
  11581. this.n47 = (this.getChild("n47"));
  11582. this.n48 = (this.getChild("n48"));
  11583. this.randTxt = (this.getChild("randTxt"));
  11584. this.n50 = (this.getChild("n50"));
  11585. this.t0 = this.getTransition("t0");
  11586. }
  11587. }
  11588. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  11589. class ui_dh_zs1 extends fgui.GComponent {
  11590. static createInstance() {
  11591. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  11592. }
  11593. onConstruct() {
  11594. this.n10 = (this.getChild("n10"));
  11595. this.n9 = (this.getChild("n9"));
  11596. this.n1 = (this.getChild("n1"));
  11597. this.n2 = (this.getChild("n2"));
  11598. this.n3 = (this.getChild("n3"));
  11599. this.n4 = (this.getChild("n4"));
  11600. this.n5 = (this.getChild("n5"));
  11601. this.n6 = (this.getChild("n6"));
  11602. this.n8 = (this.getChild("n8"));
  11603. this.n11 = (this.getChild("n11"));
  11604. this.t0 = this.getTransition("t0");
  11605. }
  11606. }
  11607. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  11608. class ui_dh_zs1_1 extends fgui.GComponent {
  11609. static createInstance() {
  11610. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  11611. }
  11612. onConstruct() {
  11613. this.n3 = (this.getChild("n3"));
  11614. this.n1 = (this.getChild("n1"));
  11615. this.t0 = this.getTransition("t0");
  11616. }
  11617. }
  11618. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  11619. class ui_hb_zs2 extends fgui.GButton {
  11620. static createInstance() {
  11621. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  11622. }
  11623. onConstruct() {
  11624. this.n20 = (this.getChild("n20"));
  11625. this.n21 = (this.getChild("n21"));
  11626. this.n26 = (this.getChild("n26"));
  11627. this.n27 = (this.getChild("n27"));
  11628. this.n32 = (this.getChild("n32"));
  11629. this.n38 = (this.getChild("n38"));
  11630. this.n39 = (this.getChild("n39"));
  11631. this.n44 = (this.getChild("n44"));
  11632. this.diamondTxt = (this.getChild("diamondTxt"));
  11633. this.n41 = (this.getChild("n41"));
  11634. this.n45 = (this.getChild("n45"));
  11635. this.t0 = this.getTransition("t0");
  11636. }
  11637. }
  11638. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  11639. class ui_hb_zs3 extends fgui.GButton {
  11640. static createInstance() {
  11641. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  11642. }
  11643. onConstruct() {
  11644. this.n20 = (this.getChild("n20"));
  11645. this.n21 = (this.getChild("n21"));
  11646. this.n26 = (this.getChild("n26"));
  11647. this.n27 = (this.getChild("n27"));
  11648. this.n32 = (this.getChild("n32"));
  11649. this.n38 = (this.getChild("n38"));
  11650. this.n47 = (this.getChild("n47"));
  11651. this.t0 = this.getTransition("t0");
  11652. }
  11653. }
  11654. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  11655. class ui_dh_zs2 extends fgui.GComponent {
  11656. static createInstance() {
  11657. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  11658. }
  11659. onConstruct() {
  11660. this.n10 = (this.getChild("n10"));
  11661. this.n9 = (this.getChild("n9"));
  11662. this.n1 = (this.getChild("n1"));
  11663. this.n2 = (this.getChild("n2"));
  11664. this.n3 = (this.getChild("n3"));
  11665. this.n4 = (this.getChild("n4"));
  11666. this.n5 = (this.getChild("n5"));
  11667. this.n6 = (this.getChild("n6"));
  11668. this.n8 = (this.getChild("n8"));
  11669. this.n11 = (this.getChild("n11"));
  11670. this.t0 = this.getTransition("t0");
  11671. }
  11672. }
  11673. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  11674. class ui_dh_zs2_1 extends fgui.GComponent {
  11675. static createInstance() {
  11676. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  11677. }
  11678. onConstruct() {
  11679. this.n3 = (this.getChild("n3"));
  11680. this.n1 = (this.getChild("n1"));
  11681. this.t0 = this.getTransition("t0");
  11682. }
  11683. }
  11684. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  11685. class ui_dh_zs3 extends fgui.GComponent {
  11686. static createInstance() {
  11687. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  11688. }
  11689. onConstruct() {
  11690. this.n10 = (this.getChild("n10"));
  11691. this.n9 = (this.getChild("n9"));
  11692. this.n1 = (this.getChild("n1"));
  11693. this.n2 = (this.getChild("n2"));
  11694. this.n3 = (this.getChild("n3"));
  11695. this.n4 = (this.getChild("n4"));
  11696. this.n5 = (this.getChild("n5"));
  11697. this.n6 = (this.getChild("n6"));
  11698. this.n8 = (this.getChild("n8"));
  11699. this.n11 = (this.getChild("n11"));
  11700. this.t0 = this.getTransition("t0");
  11701. }
  11702. }
  11703. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  11704. class ui_dh_zs3_1 extends fgui.GComponent {
  11705. static createInstance() {
  11706. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  11707. }
  11708. onConstruct() {
  11709. this.n3 = (this.getChild("n3"));
  11710. this.n1 = (this.getChild("n1"));
  11711. this.t0 = this.getTransition("t0");
  11712. }
  11713. }
  11714. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  11715. class ui_Component107 extends fgui.GComponent {
  11716. static createInstance() {
  11717. return (fgui.UIPackage.createObject("game", "Component107"));
  11718. }
  11719. onConstruct() {
  11720. this.n18 = (this.getChild("n18"));
  11721. this.n19 = (this.getChild("n19"));
  11722. this.n20 = (this.getChild("n20"));
  11723. this.n21 = (this.getChild("n21"));
  11724. this.n22 = (this.getChild("n22"));
  11725. this.levelTxt = (this.getChild("levelTxt"));
  11726. this.t0 = this.getTransition("t0");
  11727. }
  11728. }
  11729. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  11730. class ui_box_com1 extends fgui.GComponent {
  11731. static createInstance() {
  11732. return (fgui.UIPackage.createObject("game", "box_com1"));
  11733. }
  11734. onConstruct() {
  11735. this.n14 = (this.getChild("n14"));
  11736. this.n6 = (this.getChild("n6"));
  11737. this.t0 = this.getTransition("t0");
  11738. }
  11739. }
  11740. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  11741. class ui_box_com2 extends fgui.GProgressBar {
  11742. static createInstance() {
  11743. return (fgui.UIPackage.createObject("game", "box_com2"));
  11744. }
  11745. onConstruct() {
  11746. this.bg0 = (this.getChild("bg0"));
  11747. this.bg = (this.getChild("bg"));
  11748. this.bar = (this.getChild("bar"));
  11749. this.n7 = (this.getChild("n7"));
  11750. this.n8 = (this.getChild("n8"));
  11751. this.n10 = (this.getChild("n10"));
  11752. this.n11 = (this.getChild("n11"));
  11753. this.n12 = (this.getChild("n12"));
  11754. }
  11755. }
  11756. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  11757. class ui_box_com4 extends fgui.GComponent {
  11758. static createInstance() {
  11759. return (fgui.UIPackage.createObject("game", "box_com4"));
  11760. }
  11761. onConstruct() {
  11762. this.n8 = (this.getChild("n8"));
  11763. this.t0 = this.getTransition("t0");
  11764. }
  11765. }
  11766. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  11767. class ui_box_com3 extends fgui.GComponent {
  11768. static createInstance() {
  11769. return (fgui.UIPackage.createObject("game", "box_com3"));
  11770. }
  11771. onConstruct() {
  11772. this.n2 = (this.getChild("n2"));
  11773. this.n3 = (this.getChild("n3"));
  11774. this.n4 = (this.getChild("n4"));
  11775. this.n5 = (this.getChild("n5"));
  11776. this.t0 = this.getTransition("t0");
  11777. this.t1 = this.getTransition("t1");
  11778. }
  11779. }
  11780. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  11781. class ui_Component97 extends fgui.GComponent {
  11782. static createInstance() {
  11783. return (fgui.UIPackage.createObject("game", "Component97"));
  11784. }
  11785. onConstruct() {
  11786. this.c1 = this.getController("c1");
  11787. this.n46 = (this.getChild("n46"));
  11788. this.diamondNode = (this.getChild("diamondNode"));
  11789. this.coinNode = (this.getChild("coinNode"));
  11790. this.t0 = this.getTransition("t0");
  11791. }
  11792. }
  11793. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  11794. class ui_Component98 extends fgui.GButton {
  11795. static createInstance() {
  11796. return (fgui.UIPackage.createObject("game", "Component98"));
  11797. }
  11798. onConstruct() {
  11799. this.n8 = (this.getChild("n8"));
  11800. this.n40 = (this.getChild("n40"));
  11801. }
  11802. }
  11803. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  11804. class ui_Component28_11 extends fgui.GButton {
  11805. static createInstance() {
  11806. return (fgui.UIPackage.createObject("game", "Component28_11"));
  11807. }
  11808. onConstruct() {
  11809. this.c1 = this.getController("c1");
  11810. this.n12 = (this.getChild("n12"));
  11811. this.n17 = (this.getChild("n17"));
  11812. this.n13 = (this.getChild("n13"));
  11813. this.diamondTxt = (this.getChild("diamondTxt"));
  11814. this.n15 = (this.getChild("n15"));
  11815. this.n16 = (this.getChild("n16"));
  11816. }
  11817. }
  11818. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  11819. class ui_Component58_11 extends fgui.GComponent {
  11820. static createInstance() {
  11821. return (fgui.UIPackage.createObject("game", "Component58_11"));
  11822. }
  11823. onConstruct() {
  11824. this.n23 = (this.getChild("n23"));
  11825. this.n41 = (this.getChild("n41"));
  11826. this.myList = (this.getChild("myList"));
  11827. this.n45 = (this.getChild("n45"));
  11828. this.n44 = (this.getChild("n44"));
  11829. this.t0 = this.getTransition("t0");
  11830. }
  11831. }
  11832. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  11833. class ui_Component100 extends fgui.GComponent {
  11834. static createInstance() {
  11835. return (fgui.UIPackage.createObject("game", "Component100"));
  11836. }
  11837. onConstruct() {
  11838. this.c1 = this.getController("c1");
  11839. this.n75 = (this.getChild("n75"));
  11840. this.n76 = (this.getChild("n76"));
  11841. this.n80 = (this.getChild("n80"));
  11842. this.txt = (this.getChild("txt"));
  11843. this.spineRoot = (this.getChild("spineRoot"));
  11844. }
  11845. }
  11846. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  11847. class ui_Component101 extends fgui.GComponent {
  11848. static createInstance() {
  11849. return (fgui.UIPackage.createObject("game", "Component101"));
  11850. }
  11851. onConstruct() {
  11852. this.c1 = this.getController("c1");
  11853. this.n36 = (this.getChild("n36"));
  11854. this.n35 = (this.getChild("n35"));
  11855. this.n33 = (this.getChild("n33"));
  11856. this.n34 = (this.getChild("n34"));
  11857. }
  11858. }
  11859. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  11860. class ui_Component53 extends fgui.GComponent {
  11861. static createInstance() {
  11862. return (fgui.UIPackage.createObject("game", "Component53"));
  11863. }
  11864. onConstruct() {
  11865. this.n0 = (this.getChild("n0"));
  11866. this.n1 = (this.getChild("n1"));
  11867. this.n2 = (this.getChild("n2"));
  11868. this.n3 = (this.getChild("n3"));
  11869. this.n4 = (this.getChild("n4"));
  11870. this.n5 = (this.getChild("n5"));
  11871. this.n6 = (this.getChild("n6"));
  11872. this.n7 = (this.getChild("n7"));
  11873. this.n8 = (this.getChild("n8"));
  11874. this.n9 = (this.getChild("n9"));
  11875. this.n10 = (this.getChild("n10"));
  11876. this.n11 = (this.getChild("n11"));
  11877. this.n12 = (this.getChild("n12"));
  11878. this.n13 = (this.getChild("n13"));
  11879. this.n14 = (this.getChild("n14"));
  11880. this.n15 = (this.getChild("n15"));
  11881. this.n16 = (this.getChild("n16"));
  11882. this.n19 = (this.getChild("n19"));
  11883. this.n20 = (this.getChild("n20"));
  11884. this.n21 = (this.getChild("n21"));
  11885. this.n22 = (this.getChild("n22"));
  11886. this.n23 = (this.getChild("n23"));
  11887. this.n24 = (this.getChild("n24"));
  11888. this.n25 = (this.getChild("n25"));
  11889. this.n26 = (this.getChild("n26"));
  11890. this.n27 = (this.getChild("n27"));
  11891. this.n28 = (this.getChild("n28"));
  11892. this.n29 = (this.getChild("n29"));
  11893. this.n30 = (this.getChild("n30"));
  11894. this.n31 = (this.getChild("n31"));
  11895. this.n32 = (this.getChild("n32"));
  11896. this.n33 = (this.getChild("n33"));
  11897. this.n34 = (this.getChild("n34"));
  11898. this.n35 = (this.getChild("n35"));
  11899. this.t0 = this.getTransition("t0");
  11900. }
  11901. }
  11902. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  11903. class ui_Component58 extends fgui.GComponent {
  11904. static createInstance() {
  11905. return (fgui.UIPackage.createObject("game", "Component58"));
  11906. }
  11907. onConstruct() {
  11908. this.n23 = (this.getChild("n23"));
  11909. this.n41 = (this.getChild("n41"));
  11910. this.n8 = (this.getChild("n8"));
  11911. this.skillList = (this.getChild("skillList"));
  11912. this.t0 = this.getTransition("t0");
  11913. }
  11914. }
  11915. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  11916. class ui_Component59 extends fgui.GComponent {
  11917. static createInstance() {
  11918. return (fgui.UIPackage.createObject("game", "Component59"));
  11919. }
  11920. onConstruct() {
  11921. this.n3 = (this.getChild("n3"));
  11922. this.msgTxt = (this.getChild("msgTxt"));
  11923. this.t0 = this.getTransition("t0");
  11924. }
  11925. }
  11926. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  11927. class ui_RulerNode extends fgui.GComponent {
  11928. static createInstance() {
  11929. return (fgui.UIPackage.createObject("game", "RulerNode"));
  11930. }
  11931. onConstruct() {
  11932. this.n6 = (this.getChild("n6"));
  11933. this.n4 = (this.getChild("n4"));
  11934. this.img1 = (this.getChild("img1"));
  11935. this.img2 = (this.getChild("img2"));
  11936. }
  11937. }
  11938. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  11939. class ui_Component108 extends fgui.GComponent {
  11940. static createInstance() {
  11941. return (fgui.UIPackage.createObject("game", "Component108"));
  11942. }
  11943. onConstruct() {
  11944. this.n19 = (this.getChild("n19"));
  11945. this.t0 = this.getTransition("t0");
  11946. }
  11947. }
  11948. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  11949. class ui_Component63 extends fgui.GComponent {
  11950. static createInstance() {
  11951. return (fgui.UIPackage.createObject("game", "Component63"));
  11952. }
  11953. onConstruct() {
  11954. this.n66 = (this.getChild("n66"));
  11955. this.n56 = (this.getChild("n56"));
  11956. this.n63 = (this.getChild("n63"));
  11957. this.n65 = (this.getChild("n65"));
  11958. this.t0 = this.getTransition("t0");
  11959. }
  11960. }
  11961. ui_Component63.URL = "ui://isxx5ak7h657452";
  11962. class ui_topNode extends fgui.GComponent {
  11963. static createInstance() {
  11964. return (fgui.UIPackage.createObject("game", "topNode"));
  11965. }
  11966. onConstruct() {
  11967. this.selfProgress = (this.getChild("selfProgress"));
  11968. this.aiProgress = (this.getChild("aiProgress"));
  11969. this.selfKuang = (this.getChild("selfKuang"));
  11970. this.aiKuang = (this.getChild("aiKuang"));
  11971. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  11972. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  11973. this.n33 = (this.getChild("n33"));
  11974. this.n34 = (this.getChild("n34"));
  11975. this.selfNameTxt = (this.getChild("selfNameTxt"));
  11976. this.aiNameTxt = (this.getChild("aiNameTxt"));
  11977. this.selfBallList = (this.getChild("selfBallList"));
  11978. this.aiBallList = (this.getChild("aiBallList"));
  11979. this.middleNode = (this.getChild("middleNode"));
  11980. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  11981. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  11982. this.scoreNode = (this.getChild("scoreNode"));
  11983. this.selfTips = (this.getChild("selfTips"));
  11984. this.aiTips = (this.getChild("aiTips"));
  11985. }
  11986. }
  11987. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  11988. class ui_selfProgress extends fgui.GProgressBar {
  11989. static createInstance() {
  11990. return (fgui.UIPackage.createObject("game", "selfProgress"));
  11991. }
  11992. onConstruct() {
  11993. this.n3 = (this.getChild("n3"));
  11994. this.bar = (this.getChild("bar"));
  11995. }
  11996. }
  11997. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  11998. class ui_aiProgress extends fgui.GProgressBar {
  11999. static createInstance() {
  12000. return (fgui.UIPackage.createObject("game", "aiProgress"));
  12001. }
  12002. onConstruct() {
  12003. this.n3 = (this.getChild("n3"));
  12004. this.bar = (this.getChild("bar"));
  12005. }
  12006. }
  12007. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  12008. class ui_ballDisplay extends fgui.GComponent {
  12009. static createInstance() {
  12010. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  12011. }
  12012. onConstruct() {
  12013. this.myImg = (this.getChild("myImg"));
  12014. }
  12015. }
  12016. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  12017. class ui_moveNode extends fgui.GComponent {
  12018. static createInstance() {
  12019. return (fgui.UIPackage.createObject("game", "moveNode"));
  12020. }
  12021. onConstruct() {
  12022. this.n8 = (this.getChild("n8"));
  12023. this.finger = (this.getChild("finger"));
  12024. }
  12025. }
  12026. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  12027. class ui_cancelBtn extends fgui.GButton {
  12028. static createInstance() {
  12029. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  12030. }
  12031. onConstruct() {
  12032. this.c1 = this.getController("c1");
  12033. this.n0 = (this.getChild("n0"));
  12034. this.n1 = (this.getChild("n1"));
  12035. }
  12036. }
  12037. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  12038. class ui_shareBtn extends fgui.GButton {
  12039. static createInstance() {
  12040. return (fgui.UIPackage.createObject("game", "shareBtn"));
  12041. }
  12042. onConstruct() {
  12043. this.c1 = this.getController("c1");
  12044. this.n2 = (this.getChild("n2"));
  12045. this.n1 = (this.getChild("n1"));
  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. }
  12051. }
  12052. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  12053. class ui_share2Btn extends fgui.GButton {
  12054. static createInstance() {
  12055. return (fgui.UIPackage.createObject("game", "share2Btn"));
  12056. }
  12057. onConstruct() {
  12058. this.n3 = (this.getChild("n3"));
  12059. }
  12060. }
  12061. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  12062. class ui_rodMethodNode extends fgui.GComponent {
  12063. static createInstance() {
  12064. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  12065. }
  12066. onConstruct() {
  12067. this.bg = (this.getChild("bg"));
  12068. this.dot = (this.getChild("dot"));
  12069. }
  12070. }
  12071. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  12072. class ui_sureBtn extends fgui.GButton {
  12073. static createInstance() {
  12074. return (fgui.UIPackage.createObject("game", "sureBtn"));
  12075. }
  12076. onConstruct() {
  12077. this.n2 = (this.getChild("n2"));
  12078. this.n1 = (this.getChild("n1"));
  12079. }
  12080. }
  12081. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  12082. class ui_Component18 extends fgui.GComponent {
  12083. static createInstance() {
  12084. return (fgui.UIPackage.createObject("game", "Component18"));
  12085. }
  12086. onConstruct() {
  12087. this.c1 = this.getController("c1");
  12088. this.nameTxt = (this.getChild("nameTxt"));
  12089. this.headImg = (this.getChild("headImg"));
  12090. this.n24 = (this.getChild("n24"));
  12091. this.skillImg = (this.getChild("skillImg"));
  12092. this.skillTxt = (this.getChild("skillTxt"));
  12093. }
  12094. }
  12095. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  12096. class ui_Component45 extends fgui.GComponent {
  12097. static createInstance() {
  12098. return (fgui.UIPackage.createObject("game", "Component45"));
  12099. }
  12100. onConstruct() {
  12101. this.c1 = this.getController("c1");
  12102. this.n40 = (this.getChild("n40"));
  12103. this.n41 = (this.getChild("n41"));
  12104. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  12105. this.n42 = (this.getChild("n42"));
  12106. this.awardTxt = (this.getChild("awardTxt"));
  12107. this.n44 = (this.getChild("n44"));
  12108. this.t0 = this.getTransition("t0");
  12109. }
  12110. }
  12111. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  12112. class ui_emotionDisplay extends fgui.GButton {
  12113. static createInstance() {
  12114. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  12115. }
  12116. onConstruct() {
  12117. this.myIcon = (this.getChild("myIcon"));
  12118. }
  12119. }
  12120. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  12121. class ui_Component49 extends fgui.GButton {
  12122. static createInstance() {
  12123. return (fgui.UIPackage.createObject("game", "Component49"));
  12124. }
  12125. onConstruct() {
  12126. this.n69 = (this.getChild("n69"));
  12127. this.n56 = (this.getChild("n56"));
  12128. }
  12129. }
  12130. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  12131. class ui_Component50 extends fgui.GButton {
  12132. static createInstance() {
  12133. return (fgui.UIPackage.createObject("game", "Component50"));
  12134. }
  12135. onConstruct() {
  12136. this.n54 = (this.getChild("n54"));
  12137. this.n65 = (this.getChild("n65"));
  12138. }
  12139. }
  12140. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  12141. class ui_Component51 extends fgui.GButton {
  12142. static createInstance() {
  12143. return (fgui.UIPackage.createObject("game", "Component51"));
  12144. }
  12145. onConstruct() {
  12146. this.c1 = this.getController("c1");
  12147. this.n51 = (this.getChild("n51"));
  12148. this.n54 = (this.getChild("n54"));
  12149. }
  12150. }
  12151. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  12152. class ui_Button5 extends fgui.GButton {
  12153. static createInstance() {
  12154. return (fgui.UIPackage.createObject("game", "Button5"));
  12155. }
  12156. onConstruct() {
  12157. this.c1 = this.getController("c1");
  12158. this.n0 = (this.getChild("n0"));
  12159. this.n2 = (this.getChild("n2"));
  12160. }
  12161. }
  12162. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  12163. class ui_Component124 extends fgui.GComponent {
  12164. static createInstance() {
  12165. return (fgui.UIPackage.createObject("game", "Component124"));
  12166. }
  12167. onConstruct() {
  12168. this.n22 = (this.getChild("n22"));
  12169. this.shareNode = (this.getChild("shareNode"));
  12170. }
  12171. }
  12172. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  12173. class ui_Component125 extends fgui.GComponent {
  12174. static createInstance() {
  12175. return (fgui.UIPackage.createObject("game", "Component125"));
  12176. }
  12177. onConstruct() {
  12178. this.n29 = (this.getChild("n29"));
  12179. this.coinTxt = (this.getChild("coinTxt"));
  12180. }
  12181. }
  12182. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  12183. class ui_Component52 extends fgui.GButton {
  12184. static createInstance() {
  12185. return (fgui.UIPackage.createObject("game", "Component52"));
  12186. }
  12187. onConstruct() {
  12188. this.n35 = (this.getChild("n35"));
  12189. this.n36 = (this.getChild("n36"));
  12190. }
  12191. }
  12192. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  12193. class ui_drawBtn extends fgui.GButton {
  12194. static createInstance() {
  12195. return (fgui.UIPackage.createObject("game", "drawBtn"));
  12196. }
  12197. onConstruct() {
  12198. this.c1 = this.getController("c1");
  12199. this.n2 = (this.getChild("n2"));
  12200. this.n1 = (this.getChild("n1"));
  12201. this.n5 = (this.getChild("n5"));
  12202. }
  12203. }
  12204. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  12205. class ui_Component43 extends fgui.GButton {
  12206. static createInstance() {
  12207. return (fgui.UIPackage.createObject("game", "Component43"));
  12208. }
  12209. onConstruct() {
  12210. this.n49 = (this.getChild("n49"));
  12211. }
  12212. }
  12213. ui_Component43.URL = "ui://isxx5ak7iveg434";
  12214. class ui_wordsDisplay extends fgui.GComponent {
  12215. static createInstance() {
  12216. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  12217. }
  12218. onConstruct() {
  12219. this.txt = (this.getChild("txt"));
  12220. this.n63 = (this.getChild("n63"));
  12221. }
  12222. }
  12223. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  12224. class ui_Component3 extends fgui.GComponent {
  12225. static createInstance() {
  12226. return (fgui.UIPackage.createObject("game", "Component3"));
  12227. }
  12228. onConstruct() {
  12229. this.n26 = (this.getChild("n26"));
  12230. this.n24 = (this.getChild("n24"));
  12231. this.nameTxt = (this.getChild("nameTxt"));
  12232. this.headRoot = (this.getChild("headRoot"));
  12233. }
  12234. }
  12235. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  12236. class ui_Component4 extends fgui.GComponent {
  12237. static createInstance() {
  12238. return (fgui.UIPackage.createObject("game", "Component4"));
  12239. }
  12240. onConstruct() {
  12241. this.n44 = (this.getChild("n44"));
  12242. this.headImg = (this.getChild("headImg"));
  12243. }
  12244. }
  12245. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  12246. class ui_Component7 extends fgui.GButton {
  12247. static createInstance() {
  12248. return (fgui.UIPackage.createObject("game", "Component7"));
  12249. }
  12250. onConstruct() {
  12251. this.n17 = (this.getChild("n17"));
  12252. }
  12253. }
  12254. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  12255. class ui_Component8 extends fgui.GButton {
  12256. static createInstance() {
  12257. return (fgui.UIPackage.createObject("game", "Component8"));
  12258. }
  12259. onConstruct() {
  12260. this.n19 = (this.getChild("n19"));
  12261. }
  12262. }
  12263. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  12264. class ui_Component9 extends fgui.GButton {
  12265. static createInstance() {
  12266. return (fgui.UIPackage.createObject("game", "Component9"));
  12267. }
  12268. onConstruct() {
  12269. this.n18 = (this.getChild("n18"));
  12270. }
  12271. }
  12272. ui_Component9.URL = "ui://isxx5ak7ixm43xs";
  12273. class ui_Component10 extends fgui.GButton {
  12274. static createInstance() {
  12275. return (fgui.UIPackage.createObject("game", "Component10"));
  12276. }
  12277. onConstruct() {
  12278. this.c1 = this.getController("c1");
  12279. this.n40 = (this.getChild("n40"));
  12280. this.n41 = (this.getChild("n41"));
  12281. }
  12282. }
  12283. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  12284. class ui_Component11 extends fgui.GButton {
  12285. static createInstance() {
  12286. return (fgui.UIPackage.createObject("game", "Component11"));
  12287. }
  12288. onConstruct() {
  12289. this.n34 = (this.getChild("n34"));
  12290. }
  12291. }
  12292. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  12293. class ui_Component12 extends fgui.GButton {
  12294. static createInstance() {
  12295. return (fgui.UIPackage.createObject("game", "Component12"));
  12296. }
  12297. onConstruct() {
  12298. this.n35 = (this.getChild("n35"));
  12299. }
  12300. }
  12301. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  12302. class ui_Component13 extends fgui.GButton {
  12303. static createInstance() {
  12304. return (fgui.UIPackage.createObject("game", "Component13"));
  12305. }
  12306. onConstruct() {
  12307. this.n27 = (this.getChild("n27"));
  12308. this.n36 = (this.getChild("n36"));
  12309. }
  12310. }
  12311. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  12312. class ui_Component16 extends fgui.GButton {
  12313. static createInstance() {
  12314. return (fgui.UIPackage.createObject("game", "Component16"));
  12315. }
  12316. onConstruct() {
  12317. }
  12318. }
  12319. ui_Component16.URL = "ui://isxx5ak7ixm43xz";
  12320. class ui_dh_js_tuowei extends fgui.GComponent {
  12321. static createInstance() {
  12322. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  12323. }
  12324. onConstruct() {
  12325. this.n19 = (this.getChild("n19"));
  12326. this.n18 = (this.getChild("n18"));
  12327. this.n0 = (this.getChild("n0"));
  12328. this.n3 = (this.getChild("n3"));
  12329. this.n4 = (this.getChild("n4"));
  12330. this.n5 = (this.getChild("n5"));
  12331. this.n6 = (this.getChild("n6"));
  12332. this.n8 = (this.getChild("n8"));
  12333. this.n9 = (this.getChild("n9"));
  12334. this.n10 = (this.getChild("n10"));
  12335. this.n11 = (this.getChild("n11"));
  12336. this.n12 = (this.getChild("n12"));
  12337. this.n13 = (this.getChild("n13"));
  12338. this.n14 = (this.getChild("n14"));
  12339. this.n15 = (this.getChild("n15"));
  12340. this.n20 = (this.getChild("n20"));
  12341. this.t0 = this.getTransition("t0");
  12342. this.t1 = this.getTransition("t1");
  12343. }
  12344. }
  12345. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  12346. class ui_dh_js_tw_g extends fgui.GComponent {
  12347. static createInstance() {
  12348. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  12349. }
  12350. onConstruct() {
  12351. this.n0 = (this.getChild("n0"));
  12352. this.n1 = (this.getChild("n1"));
  12353. this.t0 = this.getTransition("t0");
  12354. }
  12355. }
  12356. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  12357. class ui_dh_js_xingxing extends fgui.GComponent {
  12358. static createInstance() {
  12359. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  12360. }
  12361. onConstruct() {
  12362. this.n1 = (this.getChild("n1"));
  12363. this.n2 = (this.getChild("n2"));
  12364. this.n3 = (this.getChild("n3"));
  12365. this.n4 = (this.getChild("n4"));
  12366. this.n0 = (this.getChild("n0"));
  12367. this.t2 = this.getTransition("t2");
  12368. this.t1 = this.getTransition("t1");
  12369. }
  12370. }
  12371. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  12372. class ui_dh_zy_jiazai extends fgui.GComponent {
  12373. static createInstance() {
  12374. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  12375. }
  12376. onConstruct() {
  12377. this.c1 = this.getController("c1");
  12378. this.n0 = (this.getChild("n0"));
  12379. this.n1 = (this.getChild("n1"));
  12380. this.n2 = (this.getChild("n2"));
  12381. this.n4 = (this.getChild("n4"));
  12382. this.n5 = (this.getChild("n5"));
  12383. this.n6 = (this.getChild("n6"));
  12384. this.n8 = (this.getChild("n8"));
  12385. this.n7 = (this.getChild("n7"));
  12386. this.t0 = this.getTransition("t0");
  12387. }
  12388. }
  12389. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  12390. class ui_dh_js_xingxing2 extends fgui.GComponent {
  12391. static createInstance() {
  12392. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  12393. }
  12394. onConstruct() {
  12395. this.c1 = this.getController("c1");
  12396. this.n3 = (this.getChild("n3"));
  12397. this.n5 = (this.getChild("n5"));
  12398. this.n4 = (this.getChild("n4"));
  12399. this.n0 = (this.getChild("n0"));
  12400. this.n1 = (this.getChild("n1"));
  12401. this.n2 = (this.getChild("n2"));
  12402. }
  12403. }
  12404. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  12405. class ui_dh_js_tuowei2 extends fgui.GComponent {
  12406. static createInstance() {
  12407. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  12408. }
  12409. onConstruct() {
  12410. this.n19 = (this.getChild("n19"));
  12411. this.n21 = (this.getChild("n21"));
  12412. this.n0 = (this.getChild("n0"));
  12413. this.n3 = (this.getChild("n3"));
  12414. this.n4 = (this.getChild("n4"));
  12415. this.n5 = (this.getChild("n5"));
  12416. this.n6 = (this.getChild("n6"));
  12417. this.n8 = (this.getChild("n8"));
  12418. this.n9 = (this.getChild("n9"));
  12419. this.n10 = (this.getChild("n10"));
  12420. this.n11 = (this.getChild("n11"));
  12421. this.n12 = (this.getChild("n12"));
  12422. this.n13 = (this.getChild("n13"));
  12423. this.n14 = (this.getChild("n14"));
  12424. this.n15 = (this.getChild("n15"));
  12425. this.n23 = (this.getChild("n23"));
  12426. this.t0 = this.getTransition("t0");
  12427. this.t1 = this.getTransition("t1");
  12428. }
  12429. }
  12430. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  12431. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  12432. static createInstance() {
  12433. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  12434. }
  12435. onConstruct() {
  12436. this.n1 = (this.getChild("n1"));
  12437. this.n2 = (this.getChild("n2"));
  12438. this.t0 = this.getTransition("t0");
  12439. }
  12440. }
  12441. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  12442. class ui_dh_js_shibai_1 extends fgui.GComponent {
  12443. static createInstance() {
  12444. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  12445. }
  12446. onConstruct() {
  12447. this.n4 = (this.getChild("n4"));
  12448. this.n2 = (this.getChild("n2"));
  12449. this.n3 = (this.getChild("n3"));
  12450. this.idle = this.getTransition("idle");
  12451. this.attack = this.getTransition("attack");
  12452. }
  12453. }
  12454. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  12455. class ui_special extends fgui.GComponent {
  12456. static createInstance() {
  12457. return (fgui.UIPackage.createObject("game", "special"));
  12458. }
  12459. onConstruct() {
  12460. this.n18 = (this.getChild("n18"));
  12461. this.n19 = (this.getChild("n19"));
  12462. this.n20 = (this.getChild("n20"));
  12463. this.n21 = (this.getChild("n21"));
  12464. this.n22 = (this.getChild("n22"));
  12465. this.levelTxt = (this.getChild("levelTxt"));
  12466. this.n24 = (this.getChild("n24"));
  12467. this.n25 = (this.getChild("n25"));
  12468. this.t0 = this.getTransition("t0");
  12469. }
  12470. }
  12471. ui_special.URL = "ui://isxx5ak7j979v4i6";
  12472. class ui_Component145 extends fgui.GComponent {
  12473. static createInstance() {
  12474. return (fgui.UIPackage.createObject("game", "Component145"));
  12475. }
  12476. onConstruct() {
  12477. this.guanyuNode = (this.getChild("guanyuNode"));
  12478. }
  12479. }
  12480. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  12481. class ui_longBtn extends fgui.GButton {
  12482. static createInstance() {
  12483. return (fgui.UIPackage.createObject("game", "longBtn"));
  12484. }
  12485. onConstruct() {
  12486. this.c1 = this.getController("c1");
  12487. this.n2 = (this.getChild("n2"));
  12488. this.n1 = (this.getChild("n1"));
  12489. this.n4 = (this.getChild("n4"));
  12490. }
  12491. }
  12492. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  12493. class ui_Component146 extends fgui.GComponent {
  12494. static createInstance() {
  12495. return (fgui.UIPackage.createObject("game", "Component146"));
  12496. }
  12497. onConstruct() {
  12498. this.n89 = (this.getChild("n89"));
  12499. this.n90 = (this.getChild("n90"));
  12500. this.guideBtn = (this.getChild("guideBtn"));
  12501. this.n93 = (this.getChild("n93"));
  12502. }
  12503. }
  12504. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  12505. class ui_Component146_11 extends fgui.GComponent {
  12506. static createInstance() {
  12507. return (fgui.UIPackage.createObject("game", "Component146_11"));
  12508. }
  12509. onConstruct() {
  12510. this.n89 = (this.getChild("n89"));
  12511. this.n90 = (this.getChild("n90"));
  12512. this.guideBtn = (this.getChild("guideBtn"));
  12513. }
  12514. }
  12515. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  12516. class ui_Component111_1 extends fgui.GComponent {
  12517. static createInstance() {
  12518. return (fgui.UIPackage.createObject("game", "Component111_1"));
  12519. }
  12520. onConstruct() {
  12521. this.n68 = (this.getChild("n68"));
  12522. this.myMask = (this.getChild("myMask"));
  12523. }
  12524. }
  12525. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  12526. class ui_Component64_1 extends fgui.GComponent {
  12527. static createInstance() {
  12528. return (fgui.UIPackage.createObject("game", "Component64_1"));
  12529. }
  12530. onConstruct() {
  12531. this.n57 = (this.getChild("n57"));
  12532. this.n54 = (this.getChild("n54"));
  12533. this.n55 = (this.getChild("n55"));
  12534. this.n56 = (this.getChild("n56"));
  12535. this.t1 = this.getTransition("t1");
  12536. }
  12537. }
  12538. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  12539. class ui_ModeSelection_com123 extends fgui.GComponent {
  12540. static createInstance() {
  12541. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  12542. }
  12543. onConstruct() {
  12544. this.type1 = (this.getChild("type1"));
  12545. this.type2 = (this.getChild("type2"));
  12546. this.type3 = (this.getChild("type3"));
  12547. this.n38 = (this.getChild("n38"));
  12548. this.t0 = this.getTransition("t0");
  12549. }
  12550. }
  12551. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  12552. class ui_Component132_2 extends fgui.GComponent {
  12553. static createInstance() {
  12554. return (fgui.UIPackage.createObject("game", "Component132_2"));
  12555. }
  12556. onConstruct() {
  12557. this.n25 = (this.getChild("n25"));
  12558. this.n26 = (this.getChild("n26"));
  12559. this.n27 = (this.getChild("n27"));
  12560. this.t0 = this.getTransition("t0");
  12561. }
  12562. }
  12563. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  12564. class ui_UIPower$1 extends fgui.GComponent {
  12565. static createInstance() {
  12566. return (fgui.UIPackage.createObject("game", "UIPower"));
  12567. }
  12568. onConstruct() {
  12569. this.n11 = (this.getChild("n11"));
  12570. this.myNode = (this.getChild("myNode"));
  12571. this.t0 = this.getTransition("t0");
  12572. }
  12573. }
  12574. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  12575. class ui_Component133 extends fgui.GComponent {
  12576. static createInstance() {
  12577. return (fgui.UIPackage.createObject("game", "Component133"));
  12578. }
  12579. onConstruct() {
  12580. this.n29 = (this.getChild("n29"));
  12581. this.n30 = (this.getChild("n30"));
  12582. }
  12583. }
  12584. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  12585. class ui_Component134 extends fgui.GComponent {
  12586. static createInstance() {
  12587. return (fgui.UIPackage.createObject("game", "Component134"));
  12588. }
  12589. onConstruct() {
  12590. this.n30 = (this.getChild("n30"));
  12591. this.n31 = (this.getChild("n31"));
  12592. this.t0 = this.getTransition("t0");
  12593. }
  12594. }
  12595. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  12596. class ui_Component135 extends fgui.GComponent {
  12597. static createInstance() {
  12598. return (fgui.UIPackage.createObject("game", "Component135"));
  12599. }
  12600. onConstruct() {
  12601. this.n30 = (this.getChild("n30"));
  12602. this.t0 = this.getTransition("t0");
  12603. }
  12604. }
  12605. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  12606. class ui_Component137 extends fgui.GComponent {
  12607. static createInstance() {
  12608. return (fgui.UIPackage.createObject("game", "Component137"));
  12609. }
  12610. onConstruct() {
  12611. this.n28 = (this.getChild("n28"));
  12612. this.n29 = (this.getChild("n29"));
  12613. this.n30 = (this.getChild("n30"));
  12614. this.n32 = (this.getChild("n32"));
  12615. }
  12616. }
  12617. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  12618. class ui_dh_zuanshi extends fgui.GButton {
  12619. static createInstance() {
  12620. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  12621. }
  12622. onConstruct() {
  12623. this.n1 = (this.getChild("n1"));
  12624. this.n2 = (this.getChild("n2"));
  12625. this.n0 = (this.getChild("n0"));
  12626. this.n3 = (this.getChild("n3"));
  12627. this.n4 = (this.getChild("n4"));
  12628. }
  12629. }
  12630. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  12631. class ui_Component138 extends fgui.GComponent {
  12632. static createInstance() {
  12633. return (fgui.UIPackage.createObject("game", "Component138"));
  12634. }
  12635. onConstruct() {
  12636. this.n1 = (this.getChild("n1"));
  12637. this.n2 = (this.getChild("n2"));
  12638. this.t0 = this.getTransition("t0");
  12639. }
  12640. }
  12641. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  12642. class ui_Component139 extends fgui.GComponent {
  12643. static createInstance() {
  12644. return (fgui.UIPackage.createObject("game", "Component139"));
  12645. }
  12646. onConstruct() {
  12647. this.n0 = (this.getChild("n0"));
  12648. this.t0 = this.getTransition("t0");
  12649. }
  12650. }
  12651. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  12652. class ui_Component140 extends fgui.GComponent {
  12653. static createInstance() {
  12654. return (fgui.UIPackage.createObject("game", "Component140"));
  12655. }
  12656. onConstruct() {
  12657. this.n2 = (this.getChild("n2"));
  12658. this.n3 = (this.getChild("n3"));
  12659. this.t0 = this.getTransition("t0");
  12660. }
  12661. }
  12662. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  12663. class ui_Component141 extends fgui.GComponent {
  12664. static createInstance() {
  12665. return (fgui.UIPackage.createObject("game", "Component141"));
  12666. }
  12667. onConstruct() {
  12668. this.n0 = (this.getChild("n0"));
  12669. this.t0 = this.getTransition("t0");
  12670. }
  12671. }
  12672. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  12673. class ui_powerNode extends fgui.GProgressBar {
  12674. static createInstance() {
  12675. return (fgui.UIPackage.createObject("game", "powerNode"));
  12676. }
  12677. onConstruct() {
  12678. this.n2 = (this.getChild("n2"));
  12679. this.bar_v = (this.getChild("bar_v"));
  12680. this.showImg = (this.getChild("showImg"));
  12681. this.n12 = (this.getChild("n12"));
  12682. }
  12683. }
  12684. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  12685. class ui_dh_jingbi1 extends fgui.GComponent {
  12686. static createInstance() {
  12687. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  12688. }
  12689. onConstruct() {
  12690. this.n0 = (this.getChild("n0"));
  12691. this.n1 = (this.getChild("n1"));
  12692. this.n2 = (this.getChild("n2"));
  12693. this.n3 = (this.getChild("n3"));
  12694. this.n4 = (this.getChild("n4"));
  12695. this.n5 = (this.getChild("n5"));
  12696. this.n6 = (this.getChild("n6"));
  12697. this.n8 = (this.getChild("n8"));
  12698. this.t0 = this.getTransition("t0");
  12699. }
  12700. }
  12701. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  12702. class ui_Component94 extends fgui.GButton {
  12703. static createInstance() {
  12704. return (fgui.UIPackage.createObject("game", "Component94"));
  12705. }
  12706. onConstruct() {
  12707. this.n77 = (this.getChild("n77"));
  12708. }
  12709. }
  12710. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  12711. class ui_Component95 extends fgui.GButton {
  12712. static createInstance() {
  12713. return (fgui.UIPackage.createObject("game", "Component95"));
  12714. }
  12715. onConstruct() {
  12716. this.n77 = (this.getChild("n77"));
  12717. }
  12718. }
  12719. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  12720. class ui_Component126 extends fgui.GComponent {
  12721. static createInstance() {
  12722. return (fgui.UIPackage.createObject("game", "Component126"));
  12723. }
  12724. onConstruct() {
  12725. this.c1 = this.getController("c1");
  12726. this.normalBtn = (this.getChild("normalBtn"));
  12727. this.tripleBtn = (this.getChild("tripleBtn"));
  12728. }
  12729. }
  12730. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  12731. class ui_Component60 extends fgui.GComponent {
  12732. static createInstance() {
  12733. return (fgui.UIPackage.createObject("game", "Component60"));
  12734. }
  12735. onConstruct() {
  12736. this.c1 = this.getController("c1");
  12737. this.n48 = (this.getChild("n48"));
  12738. this.womanTxt = (this.getChild("womanTxt"));
  12739. this.t0 = this.getTransition("t0");
  12740. }
  12741. }
  12742. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  12743. class ui_Component98_3 extends fgui.GButton {
  12744. static createInstance() {
  12745. return (fgui.UIPackage.createObject("game", "Component98_3"));
  12746. }
  12747. onConstruct() {
  12748. this.c1 = this.getController("c1");
  12749. this.n8 = (this.getChild("n8"));
  12750. this.n41 = (this.getChild("n41"));
  12751. this.n40 = (this.getChild("n40"));
  12752. }
  12753. }
  12754. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  12755. class ui_ModeSelection_com1 extends fgui.GButton {
  12756. static createInstance() {
  12757. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  12758. }
  12759. onConstruct() {
  12760. this.n34 = (this.getChild("n34"));
  12761. this.n36 = (this.getChild("n36"));
  12762. this.n22 = (this.getChild("n22"));
  12763. this.n20 = (this.getChild("n20"));
  12764. this.n23 = (this.getChild("n23"));
  12765. this.n24 = (this.getChild("n24"));
  12766. this.n26 = (this.getChild("n26"));
  12767. this.n33 = (this.getChild("n33"));
  12768. this.coinImg = (this.getChild("coinImg"));
  12769. this.need = (this.getChild("need"));
  12770. this.n35 = (this.getChild("n35"));
  12771. this.n29 = (this.getChild("n29"));
  12772. this.tipsTxt = (this.getChild("tipsTxt"));
  12773. this.n30 = (this.getChild("n30"));
  12774. this.peopleTxt = (this.getChild("peopleTxt"));
  12775. this.t0 = this.getTransition("t0");
  12776. }
  12777. }
  12778. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  12779. class ui_ModeSelection_com2 extends fgui.GButton {
  12780. static createInstance() {
  12781. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  12782. }
  12783. onConstruct() {
  12784. this.n36 = (this.getChild("n36"));
  12785. this.n34 = (this.getChild("n34"));
  12786. this.n22 = (this.getChild("n22"));
  12787. this.n20 = (this.getChild("n20"));
  12788. this.n23 = (this.getChild("n23"));
  12789. this.n24 = (this.getChild("n24"));
  12790. this.n26 = (this.getChild("n26"));
  12791. this.n33 = (this.getChild("n33"));
  12792. this.coinImg = (this.getChild("coinImg"));
  12793. this.need = (this.getChild("need"));
  12794. this.n35 = (this.getChild("n35"));
  12795. this.n29 = (this.getChild("n29"));
  12796. this.tipsTxt = (this.getChild("tipsTxt"));
  12797. this.n30 = (this.getChild("n30"));
  12798. this.peopleTxt = (this.getChild("peopleTxt"));
  12799. this.t0 = this.getTransition("t0");
  12800. }
  12801. }
  12802. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  12803. class ui_ModeSelection_com3 extends fgui.GButton {
  12804. static createInstance() {
  12805. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  12806. }
  12807. onConstruct() {
  12808. this.n34 = (this.getChild("n34"));
  12809. this.n36 = (this.getChild("n36"));
  12810. this.n22 = (this.getChild("n22"));
  12811. this.n20 = (this.getChild("n20"));
  12812. this.n23 = (this.getChild("n23"));
  12813. this.n24 = (this.getChild("n24"));
  12814. this.n26 = (this.getChild("n26"));
  12815. this.n33 = (this.getChild("n33"));
  12816. this.coinImg = (this.getChild("coinImg"));
  12817. this.need = (this.getChild("need"));
  12818. this.n35 = (this.getChild("n35"));
  12819. this.n29 = (this.getChild("n29"));
  12820. this.tipsTxt = (this.getChild("tipsTxt"));
  12821. this.n30 = (this.getChild("n30"));
  12822. this.peopleTxt = (this.getChild("peopleTxt"));
  12823. this.t0 = this.getTransition("t0");
  12824. }
  12825. }
  12826. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  12827. class ui_Invitation_com1 extends fgui.GComponent {
  12828. static createInstance() {
  12829. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  12830. }
  12831. onConstruct() {
  12832. this.n14 = (this.getChild("n14"));
  12833. this.n13 = (this.getChild("n13"));
  12834. this.n3 = (this.getChild("n3"));
  12835. this.n1 = (this.getChild("n1"));
  12836. this.n6 = (this.getChild("n6"));
  12837. this.n7 = (this.getChild("n7"));
  12838. this.enterBtn = (this.getChild("enterBtn"));
  12839. this.n11 = (this.getChild("n11"));
  12840. this.n12 = (this.getChild("n12"));
  12841. this.n15 = (this.getChild("n15"));
  12842. this.t0 = this.getTransition("t0");
  12843. this.t1 = this.getTransition("t1");
  12844. }
  12845. }
  12846. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  12847. class ui_Component87_1 extends fgui.GComponent {
  12848. static createInstance() {
  12849. return (fgui.UIPackage.createObject("game", "Component87_1"));
  12850. }
  12851. onConstruct() {
  12852. this.n74 = (this.getChild("n74"));
  12853. this.n73 = (this.getChild("n73"));
  12854. this.ballTxt = (this.getChild("ballTxt"));
  12855. this.n76 = (this.getChild("n76"));
  12856. this.helpLineBtn = (this.getChild("helpLineBtn"));
  12857. this.levelTxt = (this.getChild("levelTxt"));
  12858. this.n87 = (this.getChild("n87"));
  12859. this.n84 = (this.getChild("n84"));
  12860. this.hpTxt = (this.getChild("hpTxt"));
  12861. this.n89 = (this.getChild("n89"));
  12862. this.tipsTxt = (this.getChild("tipsTxt"));
  12863. }
  12864. }
  12865. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  12866. class ui_sqg1 extends fgui.GComponent {
  12867. static createInstance() {
  12868. return (fgui.UIPackage.createObject("game", "sqg1"));
  12869. }
  12870. onConstruct() {
  12871. this.n1 = (this.getChild("n1"));
  12872. this.n0 = (this.getChild("n0"));
  12873. }
  12874. }
  12875. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  12876. class ui_sqg2 extends fgui.GComponent {
  12877. static createInstance() {
  12878. return (fgui.UIPackage.createObject("game", "sqg2"));
  12879. }
  12880. onConstruct() {
  12881. this.n1 = (this.getChild("n1"));
  12882. this.n0 = (this.getChild("n0"));
  12883. }
  12884. }
  12885. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  12886. class ui_sqg3 extends fgui.GComponent {
  12887. static createInstance() {
  12888. return (fgui.UIPackage.createObject("game", "sqg3"));
  12889. }
  12890. onConstruct() {
  12891. this.n1 = (this.getChild("n1"));
  12892. this.n0 = (this.getChild("n0"));
  12893. }
  12894. }
  12895. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  12896. class ui_sqg4 extends fgui.GComponent {
  12897. static createInstance() {
  12898. return (fgui.UIPackage.createObject("game", "sqg4"));
  12899. }
  12900. onConstruct() {
  12901. this.n1 = (this.getChild("n1"));
  12902. this.n0 = (this.getChild("n0"));
  12903. }
  12904. }
  12905. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  12906. class ui_Component36 extends fgui.GButton {
  12907. static createInstance() {
  12908. return (fgui.UIPackage.createObject("game", "Component36"));
  12909. }
  12910. onConstruct() {
  12911. this.c1 = this.getController("c1");
  12912. this.n53 = (this.getChild("n53"));
  12913. this.n56 = (this.getChild("n56"));
  12914. }
  12915. }
  12916. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  12917. class ui_Component37 extends fgui.GButton {
  12918. static createInstance() {
  12919. return (fgui.UIPackage.createObject("game", "Component37"));
  12920. }
  12921. onConstruct() {
  12922. this.c1 = this.getController("c1");
  12923. this.n52 = (this.getChild("n52"));
  12924. this.n54 = (this.getChild("n54"));
  12925. }
  12926. }
  12927. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  12928. class ui_UISetting extends fgui.GComponent {
  12929. static createInstance() {
  12930. return (fgui.UIPackage.createObject("game", "UISetting"));
  12931. }
  12932. onConstruct() {
  12933. this.c1 = this.getController("c1");
  12934. this.n4 = (this.getChild("n4"));
  12935. this.soundBtn = (this.getChild("soundBtn"));
  12936. this.shakeBtn = (this.getChild("shakeBtn"));
  12937. this.clickNode = (this.getChild("clickNode"));
  12938. this.xyBtn = (this.getChild("xyBtn"));
  12939. }
  12940. }
  12941. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  12942. class ui_Component39 extends fgui.GComponent {
  12943. static createInstance() {
  12944. return (fgui.UIPackage.createObject("game", "Component39"));
  12945. }
  12946. onConstruct() {
  12947. this.n5 = (this.getChild("n5"));
  12948. this.n6 = (this.getChild("n6"));
  12949. this.n7 = (this.getChild("n7"));
  12950. this.t0 = this.getTransition("t0");
  12951. }
  12952. }
  12953. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  12954. class ui_Component40 extends fgui.GButton {
  12955. static createInstance() {
  12956. return (fgui.UIPackage.createObject("game", "Component40"));
  12957. }
  12958. onConstruct() {
  12959. this.n46 = (this.getChild("n46"));
  12960. this.n47 = (this.getChild("n47"));
  12961. }
  12962. }
  12963. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  12964. class ui_Component41 extends fgui.GComponent {
  12965. static createInstance() {
  12966. return (fgui.UIPackage.createObject("game", "Component41"));
  12967. }
  12968. onConstruct() {
  12969. this.c1 = this.getController("c1");
  12970. this.n0 = (this.getChild("n0"));
  12971. this.titleTxt = (this.getChild("titleTxt"));
  12972. this.n2 = (this.getChild("n2"));
  12973. this.msgTips = (this.getChild("msgTips"));
  12974. this.numTxt = (this.getChild("numTxt"));
  12975. this.n18 = (this.getChild("n18"));
  12976. this.cancelBtn = (this.getChild("cancelBtn"));
  12977. this.videoBtn = (this.getChild("videoBtn"));
  12978. this.n10 = (this.getChild("n10"));
  12979. }
  12980. }
  12981. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  12982. class ui_Component42 extends fgui.GComponent {
  12983. static createInstance() {
  12984. return (fgui.UIPackage.createObject("game", "Component42"));
  12985. }
  12986. onConstruct() {
  12987. this.c1 = this.getController("c1");
  12988. this.n1 = (this.getChild("n1"));
  12989. this.n2 = (this.getChild("n2"));
  12990. this.n3 = (this.getChild("n3"));
  12991. this.tipsTxt = (this.getChild("tipsTxt"));
  12992. this.cancelBtn = (this.getChild("cancelBtn"));
  12993. this.sureBtn = (this.getChild("sureBtn"));
  12994. this.n11 = (this.getChild("n11"));
  12995. this.n13 = (this.getChild("n13"));
  12996. this.n14 = (this.getChild("n14"));
  12997. this.womanTxt = (this.getChild("womanTxt"));
  12998. this.t0 = this.getTransition("t0");
  12999. }
  13000. }
  13001. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  13002. class ui_dh_js_shengli extends fgui.GComponent {
  13003. static createInstance() {
  13004. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  13005. }
  13006. onConstruct() {
  13007. this.n3 = (this.getChild("n3"));
  13008. this.n4 = (this.getChild("n4"));
  13009. this.n1 = (this.getChild("n1"));
  13010. this.n2 = (this.getChild("n2"));
  13011. this.n5 = (this.getChild("n5"));
  13012. this.n6 = (this.getChild("n6"));
  13013. this.n7 = (this.getChild("n7"));
  13014. this.n8 = (this.getChild("n8"));
  13015. this.attack = this.getTransition("attack");
  13016. this.idle = this.getTransition("idle");
  13017. }
  13018. }
  13019. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  13020. class ui_dh_js_shengli_g extends fgui.GComponent {
  13021. static createInstance() {
  13022. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  13023. }
  13024. onConstruct() {
  13025. this.n3 = (this.getChild("n3"));
  13026. this.n1 = (this.getChild("n1"));
  13027. this.t0 = this.getTransition("t0");
  13028. }
  13029. }
  13030. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  13031. class ui_dh_js_shibai extends fgui.GComponent {
  13032. static createInstance() {
  13033. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  13034. }
  13035. onConstruct() {
  13036. this.n0 = (this.getChild("n0"));
  13037. this.n1 = (this.getChild("n1"));
  13038. this.n2 = (this.getChild("n2"));
  13039. this.n3 = (this.getChild("n3"));
  13040. this.idle = this.getTransition("idle");
  13041. this.attack = this.getTransition("attack");
  13042. }
  13043. }
  13044. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  13045. class ui_dh_zy_ganfa extends fgui.GButton {
  13046. static createInstance() {
  13047. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  13048. }
  13049. onConstruct() {
  13050. this.n0 = (this.getChild("n0"));
  13051. }
  13052. }
  13053. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  13054. class ui_dh_zy_sc_guang extends fgui.GButton {
  13055. static createInstance() {
  13056. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  13057. }
  13058. onConstruct() {
  13059. this.n0 = (this.getChild("n0"));
  13060. this.n2 = (this.getChild("n2"));
  13061. }
  13062. }
  13063. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  13064. class ui_dh_zy_shangcheng extends fgui.GComponent {
  13065. static createInstance() {
  13066. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  13067. }
  13068. onConstruct() {
  13069. this.n0 = (this.getChild("n0"));
  13070. this.n3 = (this.getChild("n3"));
  13071. this.t0 = this.getTransition("t0");
  13072. }
  13073. }
  13074. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  13075. class ui_dh_zy_wanfa extends fgui.GButton {
  13076. static createInstance() {
  13077. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  13078. }
  13079. onConstruct() {
  13080. this.n0 = (this.getChild("n0"));
  13081. }
  13082. }
  13083. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  13084. class ui_Component53_1 extends fgui.GComponent {
  13085. static createInstance() {
  13086. return (fgui.UIPackage.createObject("game", "Component53_1"));
  13087. }
  13088. onConstruct() {
  13089. this.n0 = (this.getChild("n0"));
  13090. this.n1 = (this.getChild("n1"));
  13091. this.n2 = (this.getChild("n2"));
  13092. this.n3 = (this.getChild("n3"));
  13093. this.n4 = (this.getChild("n4"));
  13094. this.n5 = (this.getChild("n5"));
  13095. this.n6 = (this.getChild("n6"));
  13096. this.n7 = (this.getChild("n7"));
  13097. this.n8 = (this.getChild("n8"));
  13098. this.n9 = (this.getChild("n9"));
  13099. this.n10 = (this.getChild("n10"));
  13100. this.n11 = (this.getChild("n11"));
  13101. this.n12 = (this.getChild("n12"));
  13102. this.n13 = (this.getChild("n13"));
  13103. this.n14 = (this.getChild("n14"));
  13104. this.n15 = (this.getChild("n15"));
  13105. this.n16 = (this.getChild("n16"));
  13106. this.n19 = (this.getChild("n19"));
  13107. this.n20 = (this.getChild("n20"));
  13108. this.n21 = (this.getChild("n21"));
  13109. this.n22 = (this.getChild("n22"));
  13110. this.n23 = (this.getChild("n23"));
  13111. this.n24 = (this.getChild("n24"));
  13112. this.n25 = (this.getChild("n25"));
  13113. this.n26 = (this.getChild("n26"));
  13114. this.n27 = (this.getChild("n27"));
  13115. this.n28 = (this.getChild("n28"));
  13116. this.n29 = (this.getChild("n29"));
  13117. this.n30 = (this.getChild("n30"));
  13118. this.n31 = (this.getChild("n31"));
  13119. this.n32 = (this.getChild("n32"));
  13120. this.n33 = (this.getChild("n33"));
  13121. this.n34 = (this.getChild("n34"));
  13122. this.n35 = (this.getChild("n35"));
  13123. this.t0 = this.getTransition("t0");
  13124. }
  13125. }
  13126. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  13127. class ui_Component30 extends fgui.GComponent {
  13128. static createInstance() {
  13129. return (fgui.UIPackage.createObject("game", "Component30"));
  13130. }
  13131. onConstruct() {
  13132. this.c1 = this.getController("c1");
  13133. this.n46 = (this.getChild("n46"));
  13134. this.n47 = (this.getChild("n47"));
  13135. this.numTxt = (this.getChild("numTxt"));
  13136. this.n50 = (this.getChild("n50"));
  13137. this.n53 = (this.getChild("n53"));
  13138. this.n54 = (this.getChild("n54"));
  13139. this.n55 = (this.getChild("n55"));
  13140. this.n56 = (this.getChild("n56"));
  13141. }
  13142. }
  13143. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  13144. class ui_Component30_1 extends fgui.GComponent {
  13145. static createInstance() {
  13146. return (fgui.UIPackage.createObject("game", "Component30_1"));
  13147. }
  13148. onConstruct() {
  13149. this.c1 = this.getController("c1");
  13150. this.n46 = (this.getChild("n46"));
  13151. this.n47 = (this.getChild("n47"));
  13152. this.numTxt = (this.getChild("numTxt"));
  13153. this.n50 = (this.getChild("n50"));
  13154. this.n51 = (this.getChild("n51"));
  13155. this.n52 = (this.getChild("n52"));
  13156. this.n53 = (this.getChild("n53"));
  13157. this.n54 = (this.getChild("n54"));
  13158. }
  13159. }
  13160. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  13161. class ui_Component31 extends fgui.GComponent {
  13162. static createInstance() {
  13163. return (fgui.UIPackage.createObject("game", "Component31"));
  13164. }
  13165. onConstruct() {
  13166. this.n55 = (this.getChild("n55"));
  13167. this.n54 = (this.getChild("n54"));
  13168. this.conditionTxt = (this.getChild("conditionTxt"));
  13169. this.n57 = (this.getChild("n57"));
  13170. this.t0 = this.getTransition("t0");
  13171. }
  13172. }
  13173. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  13174. class ui_Component32 extends fgui.GComponent {
  13175. static createInstance() {
  13176. return (fgui.UIPackage.createObject("game", "Component32"));
  13177. }
  13178. onConstruct() {
  13179. this.n5 = (this.getChild("n5"));
  13180. this.n6 = (this.getChild("n6"));
  13181. this.n7 = (this.getChild("n7"));
  13182. this.t0 = this.getTransition("t0");
  13183. }
  13184. }
  13185. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  13186. class ui_AwardItem extends fgui.GComponent {
  13187. static createInstance() {
  13188. return (fgui.UIPackage.createObject("game", "AwardItem"));
  13189. }
  13190. onConstruct() {
  13191. this.n9 = (this.getChild("n9"));
  13192. this.myIcon = (this.getChild("myIcon"));
  13193. this.numTxt = (this.getChild("numTxt"));
  13194. this.nameTxt = (this.getChild("nameTxt"));
  13195. this.n16 = (this.getChild("n16"));
  13196. this.n17 = (this.getChild("n17"));
  13197. }
  13198. }
  13199. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  13200. class ui_ranking_com1 extends fgui.GButton {
  13201. static createInstance() {
  13202. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  13203. }
  13204. onConstruct() {
  13205. this.c1 = this.getController("c1");
  13206. this.n49 = (this.getChild("n49"));
  13207. this.n18 = (this.getChild("n18"));
  13208. this.n46 = (this.getChild("n46"));
  13209. this.n48 = (this.getChild("n48"));
  13210. this.n50 = (this.getChild("n50"));
  13211. }
  13212. }
  13213. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  13214. class ui_ranking_com2 extends fgui.GButton {
  13215. static createInstance() {
  13216. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  13217. }
  13218. onConstruct() {
  13219. this.c1 = this.getController("c1");
  13220. this.n49 = (this.getChild("n49"));
  13221. this.n18 = (this.getChild("n18"));
  13222. this.n46 = (this.getChild("n46"));
  13223. this.n48 = (this.getChild("n48"));
  13224. this.n50 = (this.getChild("n50"));
  13225. }
  13226. }
  13227. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  13228. class ui_ranking_com3 extends fgui.GComponent {
  13229. static createInstance() {
  13230. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  13231. }
  13232. onConstruct() {
  13233. this.n17 = (this.getChild("n17"));
  13234. this.myIcon = (this.getChild("myIcon"));
  13235. }
  13236. }
  13237. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  13238. class ui_ranking_com4 extends fgui.GComponent {
  13239. static createInstance() {
  13240. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  13241. }
  13242. onConstruct() {
  13243. this.n16 = (this.getChild("n16"));
  13244. this.head = (this.getChild("head"));
  13245. }
  13246. }
  13247. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  13248. class ui_ranking_com5 extends fgui.GComponent {
  13249. static createInstance() {
  13250. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  13251. }
  13252. onConstruct() {
  13253. this.c1 = this.getController("c1");
  13254. this.c2 = this.getController("c2");
  13255. this.n2 = (this.getChild("n2"));
  13256. this.n3 = (this.getChild("n3"));
  13257. this.levelBtn = (this.getChild("levelBtn"));
  13258. this.starBtn = (this.getChild("starBtn"));
  13259. this.n23 = (this.getChild("n23"));
  13260. this.n24 = (this.getChild("n24"));
  13261. this.n25 = (this.getChild("n25"));
  13262. this.myList = (this.getChild("myList"));
  13263. this.selfNode = (this.getChild("selfNode"));
  13264. this.n9 = (this.getChild("n9"));
  13265. this.n12 = (this.getChild("n12"));
  13266. this.n13 = (this.getChild("n13"));
  13267. this.n14 = (this.getChild("n14"));
  13268. this.n39 = (this.getChild("n39"));
  13269. this.n41 = (this.getChild("n41"));
  13270. this.n42 = (this.getChild("n42"));
  13271. this.n45 = (this.getChild("n45"));
  13272. this.changeBtn = (this.getChild("changeBtn"));
  13273. this.closeBtn = (this.getChild("closeBtn"));
  13274. this.t0 = this.getTransition("t0");
  13275. }
  13276. }
  13277. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  13278. class ui_RankItem extends fgui.GComponent {
  13279. static createInstance() {
  13280. return (fgui.UIPackage.createObject("game", "RankItem"));
  13281. }
  13282. onConstruct() {
  13283. this.n10 = (this.getChild("n10"));
  13284. this.n11 = (this.getChild("n11"));
  13285. this.rankTxt = (this.getChild("rankTxt"));
  13286. this.headNode = (this.getChild("headNode"));
  13287. this.nameTxt = (this.getChild("nameTxt"));
  13288. this.n19 = (this.getChild("n19"));
  13289. this.valueTxt = (this.getChild("valueTxt"));
  13290. this.img1 = (this.getChild("img1"));
  13291. this.img2 = (this.getChild("img2"));
  13292. this.img3 = (this.getChild("img3"));
  13293. }
  13294. }
  13295. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  13296. class ui_ranking_com9 extends fgui.GComponent {
  13297. static createInstance() {
  13298. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  13299. }
  13300. onConstruct() {
  13301. this.c1 = this.getController("c1");
  13302. this.n27 = (this.getChild("n27"));
  13303. this.n28 = (this.getChild("n28"));
  13304. this.headNode = (this.getChild("headNode"));
  13305. this.rankTxt = (this.getChild("rankTxt"));
  13306. this.nameTxt = (this.getChild("nameTxt"));
  13307. this.n34 = (this.getChild("n34"));
  13308. this.valueTxt = (this.getChild("valueTxt"));
  13309. this.n36 = (this.getChild("n36"));
  13310. this.n37 = (this.getChild("n37"));
  13311. this.n38 = (this.getChild("n38"));
  13312. this.n39 = (this.getChild("n39"));
  13313. this.n40 = (this.getChild("n40"));
  13314. }
  13315. }
  13316. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  13317. class ui_ranking_com10 extends fgui.GComponent {
  13318. static createInstance() {
  13319. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  13320. }
  13321. onConstruct() {
  13322. this.n23 = (this.getChild("n23"));
  13323. this.n24 = (this.getChild("n24"));
  13324. }
  13325. }
  13326. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  13327. class ui_ranking_com11 extends fgui.GComponent {
  13328. static createInstance() {
  13329. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  13330. }
  13331. onConstruct() {
  13332. this.n24 = (this.getChild("n24"));
  13333. this.n25 = (this.getChild("n25"));
  13334. this.t0 = this.getTransition("t0");
  13335. }
  13336. }
  13337. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  13338. class ui_ranking_com13 extends fgui.GButton {
  13339. static createInstance() {
  13340. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  13341. }
  13342. onConstruct() {
  13343. this.c1 = this.getController("c1");
  13344. this.n44 = (this.getChild("n44"));
  13345. this.n45 = (this.getChild("n45"));
  13346. this.n46 = (this.getChild("n46"));
  13347. }
  13348. }
  13349. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  13350. class ui_Component122 extends fgui.GComponent {
  13351. static createInstance() {
  13352. return (fgui.UIPackage.createObject("game", "Component122"));
  13353. }
  13354. onConstruct() {
  13355. this.gameNode1 = (this.getChild("gameNode1"));
  13356. this.gameNode2 = (this.getChild("gameNode2"));
  13357. this.gameNode3 = (this.getChild("gameNode3"));
  13358. }
  13359. }
  13360. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  13361. class ui_skillItem extends fgui.GComponent {
  13362. static createInstance() {
  13363. return (fgui.UIPackage.createObject("game", "skillItem"));
  13364. }
  13365. onConstruct() {
  13366. this.c1 = this.getController("c1");
  13367. this.n31 = (this.getChild("n31"));
  13368. this.n6 = (this.getChild("n6"));
  13369. this.skillImg = (this.getChild("skillImg"));
  13370. this.nameTxt = (this.getChild("nameTxt"));
  13371. this.levelTxt = (this.getChild("levelTxt"));
  13372. this.n28 = (this.getChild("n28"));
  13373. this.describeTxt = (this.getChild("describeTxt"));
  13374. this.n32 = (this.getChild("n32"));
  13375. this.mutiBtn = (this.getChild("mutiBtn"));
  13376. this.tryNode = (this.getChild("tryNode"));
  13377. this.normalBtn = (this.getChild("normalBtn"));
  13378. this.startBtn = (this.getChild("startBtn"));
  13379. this.n42 = (this.getChild("n42"));
  13380. this.n43 = (this.getChild("n43"));
  13381. this.n44 = (this.getChild("n44"));
  13382. }
  13383. }
  13384. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  13385. class ui_Component26 extends fgui.GButton {
  13386. static createInstance() {
  13387. return (fgui.UIPackage.createObject("game", "Component26"));
  13388. }
  13389. onConstruct() {
  13390. this.n11 = (this.getChild("n11"));
  13391. this.n30 = (this.getChild("n30"));
  13392. this.n34 = (this.getChild("n34"));
  13393. }
  13394. }
  13395. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  13396. class ui_Component28 extends fgui.GButton {
  13397. static createInstance() {
  13398. return (fgui.UIPackage.createObject("game", "Component28"));
  13399. }
  13400. onConstruct() {
  13401. this.n12 = (this.getChild("n12"));
  13402. this.n31 = (this.getChild("n31"));
  13403. this.curTxt = (this.getChild("curTxt"));
  13404. this.n33 = (this.getChild("n33"));
  13405. }
  13406. }
  13407. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  13408. class ui_Component113 extends fgui.GComponent {
  13409. static createInstance() {
  13410. return (fgui.UIPackage.createObject("game", "Component113"));
  13411. }
  13412. onConstruct() {
  13413. this.n85 = (this.getChild("n85"));
  13414. this.n86 = (this.getChild("n86"));
  13415. this.n77 = (this.getChild("n77"));
  13416. this.n79 = (this.getChild("n79"));
  13417. this.n80 = (this.getChild("n80"));
  13418. this.n81 = (this.getChild("n81"));
  13419. this.n82 = (this.getChild("n82"));
  13420. this.n84 = (this.getChild("n84"));
  13421. this.n87 = (this.getChild("n87"));
  13422. this.t0 = this.getTransition("t0");
  13423. }
  13424. }
  13425. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  13426. class ui_Component114 extends fgui.GComponent {
  13427. static createInstance() {
  13428. return (fgui.UIPackage.createObject("game", "Component114"));
  13429. }
  13430. onConstruct() {
  13431. this.n77 = (this.getChild("n77"));
  13432. this.t0 = this.getTransition("t0");
  13433. }
  13434. }
  13435. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  13436. class ui_Component115 extends fgui.GComponent {
  13437. static createInstance() {
  13438. return (fgui.UIPackage.createObject("game", "Component115"));
  13439. }
  13440. onConstruct() {
  13441. this.n83 = (this.getChild("n83"));
  13442. this.fingerNode = (this.getChild("fingerNode"));
  13443. this.n84 = (this.getChild("n84"));
  13444. }
  13445. }
  13446. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  13447. class ui_Component117 extends fgui.GComponent {
  13448. static createInstance() {
  13449. return (fgui.UIPackage.createObject("game", "Component117"));
  13450. }
  13451. onConstruct() {
  13452. this.n87 = (this.getChild("n87"));
  13453. this.n88 = (this.getChild("n88"));
  13454. this.n84 = (this.getChild("n84"));
  13455. this.n85 = (this.getChild("n85"));
  13456. this.n86 = (this.getChild("n86"));
  13457. this.t0 = this.getTransition("t0");
  13458. }
  13459. }
  13460. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  13461. class ui_Component98_1 extends fgui.GButton {
  13462. static createInstance() {
  13463. return (fgui.UIPackage.createObject("game", "Component98_1"));
  13464. }
  13465. onConstruct() {
  13466. this.c1 = this.getController("c1");
  13467. this.n8 = (this.getChild("n8"));
  13468. this.n41 = (this.getChild("n41"));
  13469. this.n40 = (this.getChild("n40"));
  13470. }
  13471. }
  13472. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  13473. class ui_Component61 extends fgui.GComponent {
  13474. static createInstance() {
  13475. return (fgui.UIPackage.createObject("game", "Component61"));
  13476. }
  13477. onConstruct() {
  13478. this.n14 = (this.getChild("n14"));
  13479. this.n6 = (this.getChild("n6"));
  13480. this.t0 = this.getTransition("t0");
  13481. }
  13482. }
  13483. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  13484. class ui_Component62 extends fgui.GComponent {
  13485. static createInstance() {
  13486. return (fgui.UIPackage.createObject("game", "Component62"));
  13487. }
  13488. onConstruct() {
  13489. this.n66 = (this.getChild("n66"));
  13490. this.n56 = (this.getChild("n56"));
  13491. this.n63 = (this.getChild("n63"));
  13492. this.n65 = (this.getChild("n65"));
  13493. this.t0 = this.getTransition("t0");
  13494. }
  13495. }
  13496. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  13497. class ui_d3Root extends fgui.GComponent {
  13498. static createInstance() {
  13499. return (fgui.UIPackage.createObject("game", "d3Root"));
  13500. }
  13501. onConstruct() {
  13502. }
  13503. }
  13504. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  13505. class ui_d2Root extends fgui.GComponent {
  13506. static createInstance() {
  13507. return (fgui.UIPackage.createObject("game", "d2Root"));
  13508. }
  13509. onConstruct() {
  13510. }
  13511. }
  13512. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  13513. class ui_ballNode extends fgui.GComponent {
  13514. static createInstance() {
  13515. return (fgui.UIPackage.createObject("game", "ballNode"));
  13516. }
  13517. onConstruct() {
  13518. }
  13519. }
  13520. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  13521. class ui_border extends fgui.GComponent {
  13522. static createInstance() {
  13523. return (fgui.UIPackage.createObject("game", "border"));
  13524. }
  13525. onConstruct() {
  13526. this.bar1 = (this.getChild("bar1"));
  13527. this.bar2 = (this.getChild("bar2"));
  13528. this.bar3 = (this.getChild("bar3"));
  13529. this.bar4 = (this.getChild("bar4"));
  13530. this.bar5 = (this.getChild("bar5"));
  13531. this.bar6 = (this.getChild("bar6"));
  13532. this.circle1 = (this.getChild("circle1"));
  13533. this.circle2 = (this.getChild("circle2"));
  13534. this.circle3 = (this.getChild("circle3"));
  13535. this.circle4 = (this.getChild("circle4"));
  13536. this.circle5 = (this.getChild("circle5"));
  13537. this.circle6 = (this.getChild("circle6"));
  13538. this.n28 = (this.getChild("n28"));
  13539. }
  13540. }
  13541. ui_border.URL = "ui://isxx5ak7sdh33qq";
  13542. class ui_Component41_2 extends fgui.GComponent {
  13543. static createInstance() {
  13544. return (fgui.UIPackage.createObject("game", "Component41_2"));
  13545. }
  13546. onConstruct() {
  13547. this.c1 = this.getController("c1");
  13548. this.n0 = (this.getChild("n0"));
  13549. this.n2 = (this.getChild("n2"));
  13550. this.n19 = (this.getChild("n19"));
  13551. this.cancelBtn = (this.getChild("cancelBtn"));
  13552. this.videoBtn = (this.getChild("videoBtn"));
  13553. this.n9 = (this.getChild("n9"));
  13554. this.n22 = (this.getChild("n22"));
  13555. this.tipsTxt = (this.getChild("tipsTxt"));
  13556. this.n23 = (this.getChild("n23"));
  13557. this.n24 = (this.getChild("n24"));
  13558. this.n26 = (this.getChild("n26"));
  13559. this.n27 = (this.getChild("n27"));
  13560. this.titleTxt = (this.getChild("titleTxt"));
  13561. }
  13562. }
  13563. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  13564. class ui_Component41_1 extends fgui.GComponent {
  13565. static createInstance() {
  13566. return (fgui.UIPackage.createObject("game", "Component41_1"));
  13567. }
  13568. onConstruct() {
  13569. this.c1 = this.getController("c1");
  13570. this.n0 = (this.getChild("n0"));
  13571. this.n2 = (this.getChild("n2"));
  13572. this.cancelBtn = (this.getChild("cancelBtn"));
  13573. this.videoBtn = (this.getChild("videoBtn"));
  13574. this.n27 = (this.getChild("n27"));
  13575. this.n30 = (this.getChild("n30"));
  13576. this.n31 = (this.getChild("n31"));
  13577. this.n32 = (this.getChild("n32"));
  13578. this.n33 = (this.getChild("n33"));
  13579. this.n34 = (this.getChild("n34"));
  13580. this.n35 = (this.getChild("n35"));
  13581. this.n36 = (this.getChild("n36"));
  13582. this.n1 = (this.getChild("n1"));
  13583. this.n37 = (this.getChild("n37"));
  13584. this.t0 = this.getTransition("t0");
  13585. this.t1 = this.getTransition("t1");
  13586. this.t2 = this.getTransition("t2");
  13587. this.t3 = this.getTransition("t3");
  13588. }
  13589. }
  13590. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  13591. class ui_againBtn extends fgui.GButton {
  13592. static createInstance() {
  13593. return (fgui.UIPackage.createObject("game", "againBtn"));
  13594. }
  13595. onConstruct() {
  13596. this.n2 = (this.getChild("n2"));
  13597. this.n1 = (this.getChild("n1"));
  13598. this.n5 = (this.getChild("n5"));
  13599. }
  13600. }
  13601. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  13602. class ui_Component118 extends fgui.GButton {
  13603. static createInstance() {
  13604. return (fgui.UIPackage.createObject("game", "Component118"));
  13605. }
  13606. onConstruct() {
  13607. this.c1 = this.getController("c1");
  13608. this.n14 = (this.getChild("n14"));
  13609. this.n9 = (this.getChild("n9"));
  13610. this.n10 = (this.getChild("n10"));
  13611. this.diamondTxt = (this.getChild("diamondTxt"));
  13612. this.n13 = (this.getChild("n13"));
  13613. this.n15 = (this.getChild("n15"));
  13614. }
  13615. }
  13616. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  13617. class ui_Component119 extends fgui.GComponent {
  13618. static createInstance() {
  13619. return (fgui.UIPackage.createObject("game", "Component119"));
  13620. }
  13621. onConstruct() {
  13622. this.n1 = (this.getChild("n1"));
  13623. this.n2 = (this.getChild("n2"));
  13624. this.n13 = (this.getChild("n13"));
  13625. this.n6 = (this.getChild("n6"));
  13626. this.screenNode = (this.getChild("screenNode"));
  13627. this.n15 = (this.getChild("n15"));
  13628. this.closeBtn = (this.getChild("closeBtn"));
  13629. this.share2Btn = (this.getChild("share2Btn"));
  13630. this.shareBtn = (this.getChild("shareBtn"));
  13631. this.tipsNode = (this.getChild("tipsNode"));
  13632. this.awardNode = (this.getChild("awardNode"));
  13633. }
  13634. }
  13635. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  13636. class ui_Component132_1 extends fgui.GComponent {
  13637. static createInstance() {
  13638. return (fgui.UIPackage.createObject("game", "Component132_1"));
  13639. }
  13640. onConstruct() {
  13641. this.n25 = (this.getChild("n25"));
  13642. this.n26 = (this.getChild("n26"));
  13643. this.n27 = (this.getChild("n27"));
  13644. this.t0 = this.getTransition("t0");
  13645. }
  13646. }
  13647. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  13648. class ui_SecretaryDisplay extends fgui.GComponent {
  13649. static createInstance() {
  13650. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  13651. }
  13652. onConstruct() {
  13653. this.n2 = (this.getChild("n2"));
  13654. this.levelTxt = (this.getChild("levelTxt"));
  13655. this.n4 = (this.getChild("n4"));
  13656. this.secretary = (this.getChild("secretary"));
  13657. this.purchaseBtn = (this.getChild("purchaseBtn"));
  13658. this.n16 = (this.getChild("n16"));
  13659. this.n37 = (this.getChild("n37"));
  13660. this.n41 = (this.getChild("n41"));
  13661. this.n14 = (this.getChild("n14"));
  13662. this.n17 = (this.getChild("n17"));
  13663. this.heightTxt = (this.getChild("heightTxt"));
  13664. this.n46 = (this.getChild("n46"));
  13665. this.n36 = (this.getChild("n36"));
  13666. this.n38 = (this.getChild("n38"));
  13667. this.foodTxt = (this.getChild("foodTxt"));
  13668. this.n47 = (this.getChild("n47"));
  13669. this.n40 = (this.getChild("n40"));
  13670. this.n42 = (this.getChild("n42"));
  13671. this.historyTxt = (this.getChild("historyTxt"));
  13672. this.n48 = (this.getChild("n48"));
  13673. this.nameImg = (this.getChild("nameImg"));
  13674. this.n12 = (this.getChild("n12"));
  13675. this.n49 = (this.getChild("n49"));
  13676. this.t0 = this.getTransition("t0");
  13677. }
  13678. }
  13679. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  13680. class ui_BallRodDisplay extends fgui.GComponent {
  13681. static createInstance() {
  13682. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  13683. }
  13684. onConstruct() {
  13685. this.c1 = this.getController("c1");
  13686. this.n31 = (this.getChild("n31"));
  13687. this.n6 = (this.getChild("n6"));
  13688. this.nameTxt = (this.getChild("nameTxt"));
  13689. this.rodImg = (this.getChild("rodImg"));
  13690. this.levelNode = (this.getChild("levelNode"));
  13691. this.eftRod = (this.getChild("eftRod"));
  13692. this.purchaseBtn = (this.getChild("purchaseBtn"));
  13693. }
  13694. }
  13695. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  13696. class ui_Component111_11 extends fgui.GComponent {
  13697. static createInstance() {
  13698. return (fgui.UIPackage.createObject("game", "Component111_11"));
  13699. }
  13700. onConstruct() {
  13701. this.n68 = (this.getChild("n68"));
  13702. this.n69 = (this.getChild("n69"));
  13703. }
  13704. }
  13705. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  13706. class ui_Component112 extends fgui.GComponent {
  13707. static createInstance() {
  13708. return (fgui.UIPackage.createObject("game", "Component112"));
  13709. }
  13710. onConstruct() {
  13711. this.n68 = (this.getChild("n68"));
  13712. this.n70 = (this.getChild("n70"));
  13713. this.myMask = (this.getChild("myMask"));
  13714. }
  13715. }
  13716. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  13717. class ui_Component111 extends fgui.GComponent {
  13718. static createInstance() {
  13719. return (fgui.UIPackage.createObject("game", "Component111"));
  13720. }
  13721. onConstruct() {
  13722. this.n68 = (this.getChild("n68"));
  13723. this.myMask = (this.getChild("myMask"));
  13724. }
  13725. }
  13726. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  13727. class ui_Component144 extends fgui.GButton {
  13728. static createInstance() {
  13729. return (fgui.UIPackage.createObject("game", "Component144"));
  13730. }
  13731. onConstruct() {
  13732. this.n8 = (this.getChild("n8"));
  13733. }
  13734. }
  13735. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  13736. class ui_Sign_com2 extends fgui.GComponent {
  13737. static createInstance() {
  13738. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  13739. }
  13740. onConstruct() {
  13741. this.n0 = (this.getChild("n0"));
  13742. this.n1 = (this.getChild("n1"));
  13743. this.t0 = this.getTransition("t0");
  13744. }
  13745. }
  13746. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  13747. class ui_Sign_guang extends fgui.GComponent {
  13748. static createInstance() {
  13749. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  13750. }
  13751. onConstruct() {
  13752. this.n1 = (this.getChild("n1"));
  13753. this.n2 = (this.getChild("n2"));
  13754. this.n3 = (this.getChild("n3"));
  13755. this.n4 = (this.getChild("n4"));
  13756. this.n5 = (this.getChild("n5"));
  13757. this.n6 = (this.getChild("n6"));
  13758. this.n8 = (this.getChild("n8"));
  13759. }
  13760. }
  13761. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  13762. class ui_SignMax extends fgui.GComponent {
  13763. static createInstance() {
  13764. return (fgui.UIPackage.createObject("game", "SignMax"));
  13765. }
  13766. onConstruct() {
  13767. this.c1 = this.getController("c1");
  13768. this.n7 = (this.getChild("n7"));
  13769. this.n15 = (this.getChild("n15"));
  13770. this.n8 = (this.getChild("n8"));
  13771. this.titleTxt = (this.getChild("titleTxt"));
  13772. this.myIcon1 = (this.getChild("myIcon1"));
  13773. this.numTxt1 = (this.getChild("numTxt1"));
  13774. this.myIcon2 = (this.getChild("myIcon2"));
  13775. this.n20 = (this.getChild("n20"));
  13776. this.n17 = (this.getChild("n17"));
  13777. this.numTxt2 = (this.getChild("numTxt2"));
  13778. this.n12 = (this.getChild("n12"));
  13779. this.n13 = (this.getChild("n13"));
  13780. this.n21 = (this.getChild("n21"));
  13781. this.n14 = (this.getChild("n14"));
  13782. }
  13783. }
  13784. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  13785. class ui_Sign_com2_1 extends fgui.GComponent {
  13786. static createInstance() {
  13787. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  13788. }
  13789. onConstruct() {
  13790. this.n0 = (this.getChild("n0"));
  13791. this.n1 = (this.getChild("n1"));
  13792. this.t0 = this.getTransition("t0");
  13793. }
  13794. }
  13795. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  13796. class ui_Sign_com5 extends fgui.GComponent {
  13797. static createInstance() {
  13798. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  13799. }
  13800. onConstruct() {
  13801. this.n3 = (this.getChild("n3"));
  13802. this.n29 = (this.getChild("n29"));
  13803. this.n4 = (this.getChild("n4"));
  13804. this.day1 = (this.getChild("day1"));
  13805. this.day2 = (this.getChild("day2"));
  13806. this.day3 = (this.getChild("day3"));
  13807. this.day4 = (this.getChild("day4"));
  13808. this.day5 = (this.getChild("day5"));
  13809. this.day6 = (this.getChild("day6"));
  13810. this.day7 = (this.getChild("day7"));
  13811. this.t0 = this.getTransition("t0");
  13812. }
  13813. }
  13814. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  13815. class ui_Sign_com8 extends fgui.GComponent {
  13816. static createInstance() {
  13817. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  13818. }
  13819. onConstruct() {
  13820. this.n48 = (this.getChild("n48"));
  13821. this.womanTxt = (this.getChild("womanTxt"));
  13822. this.t0 = this.getTransition("t0");
  13823. }
  13824. }
  13825. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  13826. class ui_Sign_com6 extends fgui.GComponent {
  13827. static createInstance() {
  13828. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  13829. }
  13830. onConstruct() {
  13831. this.n2 = (this.getChild("n2"));
  13832. this.n3 = (this.getChild("n3"));
  13833. this.t0 = this.getTransition("t0");
  13834. }
  13835. }
  13836. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  13837. class ui_Sign_com7 extends fgui.GComponent {
  13838. static createInstance() {
  13839. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  13840. }
  13841. onConstruct() {
  13842. this.n29 = (this.getChild("n29"));
  13843. this.n2 = (this.getChild("n2"));
  13844. }
  13845. }
  13846. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  13847. class ui_UITurntable_com1_2 extends fgui.GComponent {
  13848. static createInstance() {
  13849. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  13850. }
  13851. onConstruct() {
  13852. this.n5 = (this.getChild("n5"));
  13853. this.n4 = (this.getChild("n4"));
  13854. this.t0 = this.getTransition("t0");
  13855. }
  13856. }
  13857. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  13858. class ui_UITurntable_com2 extends fgui.GComponent {
  13859. static createInstance() {
  13860. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  13861. }
  13862. onConstruct() {
  13863. this.c1 = this.getController("c1");
  13864. this.n4 = (this.getChild("n4"));
  13865. this.n6 = (this.getChild("n6"));
  13866. this.n10 = (this.getChild("n10"));
  13867. this.n11 = (this.getChild("n11"));
  13868. this.n12 = (this.getChild("n12"));
  13869. this.n13 = (this.getChild("n13"));
  13870. this.n14 = (this.getChild("n14"));
  13871. this.n15 = (this.getChild("n15"));
  13872. this.n16 = (this.getChild("n16"));
  13873. this.n17 = (this.getChild("n17"));
  13874. this.n18 = (this.getChild("n18"));
  13875. this.n19 = (this.getChild("n19"));
  13876. this.n20 = (this.getChild("n20"));
  13877. this.n21 = (this.getChild("n21"));
  13878. this.n22 = (this.getChild("n22"));
  13879. this.n23 = (this.getChild("n23"));
  13880. this.n24 = (this.getChild("n24"));
  13881. this.n25 = (this.getChild("n25"));
  13882. this.n26 = (this.getChild("n26"));
  13883. this.n27 = (this.getChild("n27"));
  13884. this.n28 = (this.getChild("n28"));
  13885. this.n29 = (this.getChild("n29"));
  13886. this.n30 = (this.getChild("n30"));
  13887. this.n31 = (this.getChild("n31"));
  13888. this.n32 = (this.getChild("n32"));
  13889. this.n33 = (this.getChild("n33"));
  13890. }
  13891. }
  13892. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  13893. class ui_UITurntable_com1_1 extends fgui.GComponent {
  13894. static createInstance() {
  13895. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  13896. }
  13897. onConstruct() {
  13898. this.n5 = (this.getChild("n5"));
  13899. this.n4 = (this.getChild("n4"));
  13900. this.t0 = this.getTransition("t0");
  13901. }
  13902. }
  13903. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  13904. class ui_UITurntable_com5 extends fgui.GComponent {
  13905. static createInstance() {
  13906. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  13907. }
  13908. onConstruct() {
  13909. this.flashNode = (this.getChild("flashNode"));
  13910. this.rotNode = (this.getChild("rotNode"));
  13911. this.n3 = (this.getChild("n3"));
  13912. this.n21 = (this.getChild("n21"));
  13913. this.t0 = this.getTransition("t0");
  13914. }
  13915. }
  13916. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  13917. class ui_UITurntable_com7 extends fgui.GComponent {
  13918. static createInstance() {
  13919. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  13920. }
  13921. onConstruct() {
  13922. this.n2 = (this.getChild("n2"));
  13923. this.n35 = (this.getChild("n35"));
  13924. this.img1 = (this.getChild("img1"));
  13925. this.img2 = (this.getChild("img2"));
  13926. this.img3 = (this.getChild("img3"));
  13927. this.img4 = (this.getChild("img4"));
  13928. this.img6 = (this.getChild("img6"));
  13929. this.img5 = (this.getChild("img5"));
  13930. this.txt1 = (this.getChild("txt1"));
  13931. this.txt2 = (this.getChild("txt2"));
  13932. this.txt3 = (this.getChild("txt3"));
  13933. this.txt4 = (this.getChild("txt4"));
  13934. this.txt5 = (this.getChild("txt5"));
  13935. this.txt6 = (this.getChild("txt6"));
  13936. }
  13937. }
  13938. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  13939. class ui_UITurntable_com9 extends fgui.GComponent {
  13940. static createInstance() {
  13941. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  13942. }
  13943. onConstruct() {
  13944. this.n38 = (this.getChild("n38"));
  13945. this.n39 = (this.getChild("n39"));
  13946. }
  13947. }
  13948. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  13949. class ui_UITurntable_com10 extends fgui.GComponent {
  13950. static createInstance() {
  13951. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  13952. }
  13953. onConstruct() {
  13954. this.n39 = (this.getChild("n39"));
  13955. this.n40 = (this.getChild("n40"));
  13956. this.t0 = this.getTransition("t0");
  13957. }
  13958. }
  13959. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  13960. class ui_UITurntable_com11 extends fgui.GComponent {
  13961. static createInstance() {
  13962. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  13963. }
  13964. onConstruct() {
  13965. this.n38 = (this.getChild("n38"));
  13966. this.n39 = (this.getChild("n39"));
  13967. this.n40 = (this.getChild("n40"));
  13968. this.t0 = this.getTransition("t0");
  13969. }
  13970. }
  13971. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  13972. class ui_UITurntable_com12 extends fgui.GComponent {
  13973. static createInstance() {
  13974. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  13975. }
  13976. onConstruct() {
  13977. this.n43 = (this.getChild("n43"));
  13978. this.barNode = (this.getChild("barNode"));
  13979. this.tipsTxt = (this.getChild("tipsTxt"));
  13980. this.n45 = (this.getChild("n45"));
  13981. this.boxBtn = (this.getChild("boxBtn"));
  13982. }
  13983. }
  13984. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  13985. class ui_UITurntable_com1 extends fgui.GButton {
  13986. static createInstance() {
  13987. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  13988. }
  13989. onConstruct() {
  13990. this.n41 = (this.getChild("n41"));
  13991. this.n42 = (this.getChild("n42"));
  13992. this.t0 = this.getTransition("t0");
  13993. }
  13994. }
  13995. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  13996. class ui_UITurntable_com3 extends fgui.GComponent {
  13997. static createInstance() {
  13998. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  13999. }
  14000. onConstruct() {
  14001. this.n48 = (this.getChild("n48"));
  14002. this.womanTxt = (this.getChild("womanTxt"));
  14003. this.t0 = this.getTransition("t0");
  14004. }
  14005. }
  14006. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  14007. class ui_cancelBtn2 extends fgui.GButton {
  14008. static createInstance() {
  14009. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  14010. }
  14011. onConstruct() {
  14012. this.c1 = this.getController("c1");
  14013. this.n0 = (this.getChild("n0"));
  14014. this.n1 = (this.getChild("n1"));
  14015. this.n2 = (this.getChild("n2"));
  14016. this.n3 = (this.getChild("n3"));
  14017. this.n4 = (this.getChild("n4"));
  14018. this.n5 = (this.getChild("n5"));
  14019. this.n6 = (this.getChild("n6"));
  14020. this.n7 = (this.getChild("n7"));
  14021. this.n8 = (this.getChild("n8"));
  14022. this.powerEft = (this.getChild("powerEft"));
  14023. }
  14024. }
  14025. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  14026. class ui_shareBtn2 extends fgui.GButton {
  14027. static createInstance() {
  14028. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  14029. }
  14030. onConstruct() {
  14031. this.c1 = this.getController("c1");
  14032. this.n2 = (this.getChild("n2"));
  14033. this.n24 = (this.getChild("n24"));
  14034. this.n1 = (this.getChild("n1"));
  14035. this.n3 = (this.getChild("n3"));
  14036. this.n23 = (this.getChild("n23"));
  14037. this.n4 = (this.getChild("n4"));
  14038. this.n5 = (this.getChild("n5"));
  14039. this.n6 = (this.getChild("n6"));
  14040. this.n20 = (this.getChild("n20"));
  14041. this.n21 = (this.getChild("n21"));
  14042. this.n22 = (this.getChild("n22"));
  14043. this.powerEft = (this.getChild("powerEft"));
  14044. }
  14045. }
  14046. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  14047. class ui_UIMoney extends fgui.GComponent {
  14048. static createInstance() {
  14049. return (fgui.UIPackage.createObject("game", "UIMoney"));
  14050. }
  14051. onConstruct() {
  14052. this.c1 = this.getController("c1");
  14053. this.n4 = (this.getChild("n4"));
  14054. this.coinImg = (this.getChild("coinImg"));
  14055. this.addCoinBtn = (this.getChild("addCoinBtn"));
  14056. this.coinTxt = (this.getChild("coinTxt"));
  14057. this.n7 = (this.getChild("n7"));
  14058. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  14059. this.diamondTxt = (this.getChild("diamondTxt"));
  14060. this.diamondImg = (this.getChild("diamondImg"));
  14061. this.n12 = (this.getChild("n12"));
  14062. this.powerImg = (this.getChild("powerImg"));
  14063. this.addPowerBtn = (this.getChild("addPowerBtn"));
  14064. this.powerTxt = (this.getChild("powerTxt"));
  14065. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  14066. }
  14067. }
  14068. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  14069. class ui_backBtn extends fgui.GButton {
  14070. static createInstance() {
  14071. return (fgui.UIPackage.createObject("game", "backBtn"));
  14072. }
  14073. onConstruct() {
  14074. this.n0 = (this.getChild("n0"));
  14075. this.t0 = this.getTransition("t0");
  14076. this.t1 = this.getTransition("t1");
  14077. }
  14078. }
  14079. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  14080. class ui_MoneyBtn extends fgui.GButton {
  14081. static createInstance() {
  14082. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  14083. }
  14084. onConstruct() {
  14085. this.button = this.getController("button");
  14086. this.n0 = (this.getChild("n0"));
  14087. }
  14088. }
  14089. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  14090. class ui_UIMoneyBtn extends fgui.GComponent {
  14091. static createInstance() {
  14092. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  14093. }
  14094. onConstruct() {
  14095. this.n1 = (this.getChild("n1"));
  14096. this.closeBtn = (this.getChild("closeBtn"));
  14097. }
  14098. }
  14099. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  14100. class ui_Component64 extends fgui.GComponent {
  14101. static createInstance() {
  14102. return (fgui.UIPackage.createObject("game", "Component64"));
  14103. }
  14104. onConstruct() {
  14105. this.n57 = (this.getChild("n57"));
  14106. this.n54 = (this.getChild("n54"));
  14107. this.n55 = (this.getChild("n55"));
  14108. this.n56 = (this.getChild("n56"));
  14109. this.t1 = this.getTransition("t1");
  14110. }
  14111. }
  14112. ui_Component64.URL = "ui://isxx5ak7wp26456";
  14113. class ui_Component41_3 extends fgui.GComponent {
  14114. static createInstance() {
  14115. return (fgui.UIPackage.createObject("game", "Component41_3"));
  14116. }
  14117. onConstruct() {
  14118. this.c1 = this.getController("c1");
  14119. this.n0 = (this.getChild("n0"));
  14120. this.n2 = (this.getChild("n2"));
  14121. this.cancelBtn = (this.getChild("cancelBtn"));
  14122. this.videoBtn = (this.getChild("videoBtn"));
  14123. this.n9 = (this.getChild("n9"));
  14124. this.n24 = (this.getChild("n24"));
  14125. this.n27 = (this.getChild("n27"));
  14126. this.titleTxt = (this.getChild("titleTxt"));
  14127. this.n28 = (this.getChild("n28"));
  14128. this.t0 = this.getTransition("t0");
  14129. }
  14130. }
  14131. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  14132. class ui_dh_zs_4 extends fgui.GComponent {
  14133. static createInstance() {
  14134. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  14135. }
  14136. onConstruct() {
  14137. this.n1 = (this.getChild("n1"));
  14138. this.n2 = (this.getChild("n2"));
  14139. this.n3 = (this.getChild("n3"));
  14140. this.n4 = (this.getChild("n4"));
  14141. this.n5 = (this.getChild("n5"));
  14142. this.n6 = (this.getChild("n6"));
  14143. this.n8 = (this.getChild("n8"));
  14144. this.t0 = this.getTransition("t0");
  14145. }
  14146. }
  14147. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  14148. class ui_Component71_1 extends fgui.GButton {
  14149. static createInstance() {
  14150. return (fgui.UIPackage.createObject("game", "Component71_1"));
  14151. }
  14152. onConstruct() {
  14153. this.n17 = (this.getChild("n17"));
  14154. this.t0 = this.getTransition("t0");
  14155. }
  14156. }
  14157. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  14158. class ui_Component83 extends fgui.GComponent {
  14159. static createInstance() {
  14160. return (fgui.UIPackage.createObject("game", "Component83"));
  14161. }
  14162. onConstruct() {
  14163. this.c1 = this.getController("c1");
  14164. this.n17 = (this.getChild("n17"));
  14165. this.n19 = (this.getChild("n19"));
  14166. this.n20 = (this.getChild("n20"));
  14167. }
  14168. }
  14169. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  14170. class ui_Component84 extends fgui.GComponent {
  14171. static createInstance() {
  14172. return (fgui.UIPackage.createObject("game", "Component84"));
  14173. }
  14174. onConstruct() {
  14175. this.c1 = this.getController("c1");
  14176. this.n4 = (this.getChild("n4"));
  14177. this.n22 = (this.getChild("n22"));
  14178. this.n23 = (this.getChild("n23"));
  14179. this.numTxt = (this.getChild("numTxt"));
  14180. this.n25 = (this.getChild("n25"));
  14181. this.n26 = (this.getChild("n26"));
  14182. }
  14183. }
  14184. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  14185. class ui_Component84_1 extends fgui.GComponent {
  14186. static createInstance() {
  14187. return (fgui.UIPackage.createObject("game", "Component84_1"));
  14188. }
  14189. onConstruct() {
  14190. this.c1 = this.getController("c1");
  14191. this.n4 = (this.getChild("n4"));
  14192. this.n22 = (this.getChild("n22"));
  14193. this.n23 = (this.getChild("n23"));
  14194. this.numTxt = (this.getChild("numTxt"));
  14195. this.n25 = (this.getChild("n25"));
  14196. this.n26 = (this.getChild("n26"));
  14197. }
  14198. }
  14199. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  14200. class ui_Component85 extends fgui.GComponent {
  14201. static createInstance() {
  14202. return (fgui.UIPackage.createObject("game", "Component85"));
  14203. }
  14204. onConstruct() {
  14205. this.n1 = (this.getChild("n1"));
  14206. this.n6 = (this.getChild("n6"));
  14207. this.n2 = (this.getChild("n2"));
  14208. this.n3 = (this.getChild("n3"));
  14209. this.levelTxt = (this.getChild("levelTxt"));
  14210. this.n10 = (this.getChild("n10"));
  14211. this.n11 = (this.getChild("n11"));
  14212. this.n12 = (this.getChild("n12"));
  14213. this.n13 = (this.getChild("n13"));
  14214. this.n14 = (this.getChild("n14"));
  14215. this.modeNode = (this.getChild("modeNode"));
  14216. this.n18 = (this.getChild("n18"));
  14217. this.conditionTxt = (this.getChild("conditionTxt"));
  14218. this.diamondNode = (this.getChild("diamondNode"));
  14219. this.coinNode = (this.getChild("coinNode"));
  14220. this.startBtn = (this.getChild("startBtn"));
  14221. this.n28 = (this.getChild("n28"));
  14222. this.displayRoot = (this.getChild("displayRoot"));
  14223. this.t0 = this.getTransition("t0");
  14224. }
  14225. }
  14226. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  14227. class ui_Component86 extends fgui.GButton {
  14228. static createInstance() {
  14229. return (fgui.UIPackage.createObject("game", "Component86"));
  14230. }
  14231. onConstruct() {
  14232. this.n15 = (this.getChild("n15"));
  14233. this.t0 = this.getTransition("t0");
  14234. }
  14235. }
  14236. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  14237. class ui_Component87 extends fgui.GComponent {
  14238. static createInstance() {
  14239. return (fgui.UIPackage.createObject("game", "Component87"));
  14240. }
  14241. onConstruct() {
  14242. this.n66 = (this.getChild("n66"));
  14243. this.myProgress = (this.getChild("myProgress"));
  14244. this.starAni = (this.getChild("starAni"));
  14245. this.hpTxt = (this.getChild("hpTxt"));
  14246. this.n74 = (this.getChild("n74"));
  14247. this.n73 = (this.getChild("n73"));
  14248. this.ballTxt = (this.getChild("ballTxt"));
  14249. this.n76 = (this.getChild("n76"));
  14250. this.helpLineBtn = (this.getChild("helpLineBtn"));
  14251. this.levelTxt = (this.getChild("levelTxt"));
  14252. this.star1 = (this.getChild("star1"));
  14253. this.star2 = (this.getChild("star2"));
  14254. this.star3 = (this.getChild("star3"));
  14255. }
  14256. }
  14257. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  14258. class ui_Component88 extends fgui.GProgressBar {
  14259. static createInstance() {
  14260. return (fgui.UIPackage.createObject("game", "Component88"));
  14261. }
  14262. onConstruct() {
  14263. this.n68 = (this.getChild("n68"));
  14264. this.bar = (this.getChild("bar"));
  14265. }
  14266. }
  14267. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  14268. class ui_Component89 extends fgui.GComponent {
  14269. static createInstance() {
  14270. return (fgui.UIPackage.createObject("game", "Component89"));
  14271. }
  14272. onConstruct() {
  14273. this.c1 = this.getController("c1");
  14274. this.n71 = (this.getChild("n71"));
  14275. this.n72 = (this.getChild("n72"));
  14276. }
  14277. }
  14278. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  14279. class ui_Component90 extends fgui.GComponent {
  14280. static createInstance() {
  14281. return (fgui.UIPackage.createObject("game", "Component90"));
  14282. }
  14283. onConstruct() {
  14284. this.c1 = this.getController("c1");
  14285. this.n64 = (this.getChild("n64"));
  14286. this.n65 = (this.getChild("n65"));
  14287. this.n66 = (this.getChild("n66"));
  14288. this.t0 = this.getTransition("t0");
  14289. }
  14290. }
  14291. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  14292. class ui_Component127 extends fgui.GButton {
  14293. static createInstance() {
  14294. return (fgui.UIPackage.createObject("game", "Component127"));
  14295. }
  14296. onConstruct() {
  14297. this.n5 = (this.getChild("n5"));
  14298. }
  14299. }
  14300. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  14301. class gameBinder {
  14302. static bindAll() {
  14303. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  14304. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  14305. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  14306. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  14307. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  14308. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  14309. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  14310. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  14311. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  14312. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  14313. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  14314. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  14315. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  14316. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  14317. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  14318. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  14319. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  14320. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  14321. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  14322. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  14323. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  14324. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  14325. fgui.UIObjectFactory.setExtension(ui_Component121.URL, ui_Component121);
  14326. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  14327. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  14328. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  14329. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  14330. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  14331. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  14332. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  14333. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  14334. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  14335. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  14336. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  14337. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  14338. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  14339. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  14340. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  14341. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  14342. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  14343. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  14344. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  14345. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  14346. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  14347. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  14348. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  14349. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  14350. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  14351. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  14352. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  14353. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  14354. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  14355. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  14356. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  14357. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  14358. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  14359. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  14360. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  14361. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  14362. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  14363. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  14364. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  14365. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  14366. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  14367. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  14368. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  14369. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  14370. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  14371. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  14372. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  14373. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  14374. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  14375. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  14376. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  14377. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  14378. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  14379. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  14380. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  14381. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  14382. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  14383. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  14384. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  14385. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  14386. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  14387. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  14388. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  14389. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  14390. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  14391. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  14392. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  14393. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  14394. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  14395. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  14396. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  14397. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  14398. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  14399. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  14400. fgui.UIObjectFactory.setExtension(ui_Component9.URL, ui_Component9);
  14401. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  14402. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  14403. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  14404. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  14405. fgui.UIObjectFactory.setExtension(ui_Component16.URL, ui_Component16);
  14406. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  14407. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  14408. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  14409. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  14410. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  14411. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  14412. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  14413. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  14414. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  14415. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  14416. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  14417. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  14418. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  14419. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  14420. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  14421. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  14422. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  14423. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  14424. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  14425. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  14426. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  14427. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  14428. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  14429. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  14430. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  14431. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  14432. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  14433. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  14434. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  14435. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  14436. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  14437. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  14438. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  14439. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  14440. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  14441. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  14442. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  14443. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  14444. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  14445. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  14446. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  14447. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  14448. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  14449. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  14450. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  14451. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  14452. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  14453. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  14454. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  14455. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  14456. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  14457. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  14458. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  14459. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  14460. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  14461. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  14462. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  14463. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  14464. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  14465. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  14466. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  14467. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  14468. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  14469. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  14470. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  14471. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  14472. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  14473. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  14474. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  14475. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  14476. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  14477. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  14478. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  14479. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  14480. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  14481. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  14482. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  14483. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  14484. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  14485. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  14486. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  14487. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  14488. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  14489. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  14490. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  14491. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  14492. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  14493. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  14494. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  14495. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  14496. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  14497. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  14498. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  14499. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  14500. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  14501. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  14502. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  14503. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  14504. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  14505. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  14506. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  14507. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  14508. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  14509. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  14510. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  14511. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  14512. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  14513. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  14514. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  14515. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  14516. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  14517. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  14518. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  14519. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  14520. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  14521. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  14522. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  14523. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  14524. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  14525. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  14526. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  14527. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  14528. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  14529. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  14530. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  14531. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  14532. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  14533. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  14534. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  14535. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  14536. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  14537. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  14538. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  14539. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  14540. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  14541. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  14542. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  14543. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  14544. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  14545. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  14546. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  14547. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  14548. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  14549. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  14550. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  14551. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  14552. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  14553. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  14554. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  14555. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  14556. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  14557. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  14558. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  14559. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  14560. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  14561. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  14562. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  14563. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  14564. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  14565. }
  14566. }
  14567. class ui_btn6 extends fgui.GButton {
  14568. static createInstance() {
  14569. return (fgui.UIPackage.createObject("loading", "btn6"));
  14570. }
  14571. onConstruct() {
  14572. this.n6 = (this.getChild("n6"));
  14573. this.n1 = (this.getChild("n1"));
  14574. }
  14575. }
  14576. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  14577. class ui_xyItem extends fgui.GComponent {
  14578. static createInstance() {
  14579. return (fgui.UIPackage.createObject("loading", "xyItem"));
  14580. }
  14581. onConstruct() {
  14582. this.xyItem = (this.getChild("xyItem"));
  14583. }
  14584. }
  14585. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  14586. class ui_loadinfo extends fgui.GProgressBar {
  14587. static createInstance() {
  14588. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  14589. }
  14590. onConstruct() {
  14591. this.bg = (this.getChild("bg"));
  14592. this.bar = (this.getChild("bar"));
  14593. this.title = (this.getChild("title"));
  14594. this.ani = (this.getChild("ani"));
  14595. }
  14596. }
  14597. ui_loadinfo.URL = "ui://37nctnhwis36c";
  14598. class ui_xyNode extends fgui.GComponent {
  14599. static createInstance() {
  14600. return (fgui.UIPackage.createObject("loading", "xyNode"));
  14601. }
  14602. onConstruct() {
  14603. this.n0 = (this.getChild("n0"));
  14604. this.btnYes = (this.getChild("btnYes"));
  14605. this.btnNo = (this.getChild("btnNo"));
  14606. this.btnKnown = (this.getChild("btnKnown"));
  14607. this.btnSure = (this.getChild("btnSure"));
  14608. this.txtWelcom = (this.getChild("txtWelcom"));
  14609. this.txtXy = (this.getChild("txtXy"));
  14610. this.n75 = (this.getChild("n75"));
  14611. this.btnXy1 = (this.getChild("btnXy1"));
  14612. this.btnXy3 = (this.getChild("btnXy3"));
  14613. this.btnXy2 = (this.getChild("btnXy2"));
  14614. this.n74 = (this.getChild("n74"));
  14615. this.xy1 = (this.getChild("xy1"));
  14616. this.txtTitle = (this.getChild("txtTitle"));
  14617. this.btnBack = (this.getChild("btnBack"));
  14618. this.xyList = (this.getChild("xyList"));
  14619. this.xy2 = (this.getChild("xy2"));
  14620. this.xyNode = (this.getChild("xyNode"));
  14621. }
  14622. }
  14623. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  14624. class ui_ageNode extends fgui.GComponent {
  14625. static createInstance() {
  14626. return (fgui.UIPackage.createObject("loading", "ageNode"));
  14627. }
  14628. onConstruct() {
  14629. this.n3 = (this.getChild("n3"));
  14630. this.n7 = (this.getChild("n7"));
  14631. this.n4 = (this.getChild("n4"));
  14632. this.btnAge = (this.getChild("btnAge"));
  14633. this.ageNode = (this.getChild("ageNode"));
  14634. }
  14635. }
  14636. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  14637. class ui_rnNode extends fgui.GComponent {
  14638. static createInstance() {
  14639. return (fgui.UIPackage.createObject("loading", "rnNode"));
  14640. }
  14641. onConstruct() {
  14642. this.n28 = (this.getChild("n28"));
  14643. this.n30 = (this.getChild("n30"));
  14644. this.n33 = (this.getChild("n33"));
  14645. this.rn1 = (this.getChild("rn1"));
  14646. this.n40 = (this.getChild("n40"));
  14647. this.n41 = (this.getChild("n41"));
  14648. this.rn3 = (this.getChild("rn3"));
  14649. this.n37 = (this.getChild("n37"));
  14650. this.n39 = (this.getChild("n39"));
  14651. this.rn2 = (this.getChild("rn2"));
  14652. this.n47 = (this.getChild("n47"));
  14653. this.n49 = (this.getChild("n49"));
  14654. this.n44 = (this.getChild("n44"));
  14655. this.inputCode = (this.getChild("inputCode"));
  14656. this.inputName = (this.getChild("inputName"));
  14657. this.n48 = (this.getChild("n48"));
  14658. this.n50 = (this.getChild("n50"));
  14659. this.rn4 = (this.getChild("rn4"));
  14660. this.btnCheck = (this.getChild("btnCheck"));
  14661. this.btnExit = (this.getChild("btnExit"));
  14662. this.btnDone = (this.getChild("btnDone"));
  14663. this.rnNode = (this.getChild("rnNode"));
  14664. }
  14665. }
  14666. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  14667. class ui_tipNode extends fgui.GComponent {
  14668. static createInstance() {
  14669. return (fgui.UIPackage.createObject("loading", "tipNode"));
  14670. }
  14671. onConstruct() {
  14672. this.bg = (this.getChild("bg"));
  14673. this.n55 = (this.getChild("n55"));
  14674. this.n56 = (this.getChild("n56"));
  14675. this.tipNode = (this.getChild("tipNode"));
  14676. }
  14677. }
  14678. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  14679. class ui_fcmNode extends fgui.GComponent {
  14680. static createInstance() {
  14681. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  14682. }
  14683. onConstruct() {
  14684. this.n63 = (this.getChild("n63"));
  14685. this.n62 = (this.getChild("n62"));
  14686. this.btnRn = (this.getChild("btnRn"));
  14687. this.n61 = (this.getChild("n61"));
  14688. this.n58 = (this.getChild("n58"));
  14689. this.fcmNode = (this.getChild("fcmNode"));
  14690. }
  14691. }
  14692. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  14693. class ui_msgNode extends fgui.GComponent {
  14694. static createInstance() {
  14695. return (fgui.UIPackage.createObject("loading", "msgNode"));
  14696. }
  14697. onConstruct() {
  14698. this.n69 = (this.getChild("n69"));
  14699. this.txtMsg = (this.getChild("txtMsg"));
  14700. this.msgNode = (this.getChild("msgNode"));
  14701. }
  14702. }
  14703. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  14704. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  14705. static createInstance() {
  14706. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  14707. }
  14708. onConstruct() {
  14709. this.n1 = (this.getChild("n1"));
  14710. this.n13 = (this.getChild("n13"));
  14711. this.n14 = (this.getChild("n14"));
  14712. this.n15 = (this.getChild("n15"));
  14713. this.n3 = (this.getChild("n3"));
  14714. this.n4 = (this.getChild("n4"));
  14715. this.n5 = (this.getChild("n5"));
  14716. this.n6 = (this.getChild("n6"));
  14717. this.n7 = (this.getChild("n7"));
  14718. this.n8 = (this.getChild("n8"));
  14719. this.n9 = (this.getChild("n9"));
  14720. this.n10 = (this.getChild("n10"));
  14721. this.n12 = (this.getChild("n12"));
  14722. this.n11 = (this.getChild("n11"));
  14723. this.n16 = (this.getChild("n16"));
  14724. this.n17 = (this.getChild("n17"));
  14725. this.n18 = (this.getChild("n18"));
  14726. this.n20 = (this.getChild("n20"));
  14727. this.n21 = (this.getChild("n21"));
  14728. this.t0 = this.getTransition("t0");
  14729. }
  14730. }
  14731. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  14732. class ui_btn5 extends fgui.GButton {
  14733. static createInstance() {
  14734. return (fgui.UIPackage.createObject("loading", "btn5"));
  14735. }
  14736. onConstruct() {
  14737. this.n9 = (this.getChild("n9"));
  14738. this.n1 = (this.getChild("n1"));
  14739. }
  14740. }
  14741. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  14742. class ui_UILoading extends fgui.GComponent {
  14743. static createInstance() {
  14744. return (fgui.UIPackage.createObject("loading", "UILoading"));
  14745. }
  14746. onConstruct() {
  14747. this.n12 = (this.getChild("n12"));
  14748. this.loadinfo = (this.getChild("loadinfo"));
  14749. this.n13 = (this.getChild("n13"));
  14750. this.txtLoad = (this.getChild("txtLoad"));
  14751. this.n19 = (this.getChild("n19"));
  14752. this.n20 = (this.getChild("n20"));
  14753. this.t_d = (this.getChild("t_d"));
  14754. this.n18 = (this.getChild("n18"));
  14755. }
  14756. }
  14757. ui_UILoading.URL = "ui://37nctnhwphc33";
  14758. class ui_AgeItem extends fgui.GComponent {
  14759. static createInstance() {
  14760. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  14761. }
  14762. onConstruct() {
  14763. this.txtAge = (this.getChild("txtAge"));
  14764. }
  14765. }
  14766. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  14767. class ui_btn1 extends fgui.GButton {
  14768. static createInstance() {
  14769. return (fgui.UIPackage.createObject("loading", "btn1"));
  14770. }
  14771. onConstruct() {
  14772. this.n6 = (this.getChild("n6"));
  14773. this.n1 = (this.getChild("n1"));
  14774. }
  14775. }
  14776. ui_btn1.URL = "ui://37nctnhwxe622p";
  14777. class ui_btn3 extends fgui.GButton {
  14778. static createInstance() {
  14779. return (fgui.UIPackage.createObject("loading", "btn3"));
  14780. }
  14781. onConstruct() {
  14782. this.n9 = (this.getChild("n9"));
  14783. this.n1 = (this.getChild("n1"));
  14784. }
  14785. }
  14786. ui_btn3.URL = "ui://37nctnhwxe622s";
  14787. class ui_btn2 extends fgui.GButton {
  14788. static createInstance() {
  14789. return (fgui.UIPackage.createObject("loading", "btn2"));
  14790. }
  14791. onConstruct() {
  14792. this.n6 = (this.getChild("n6"));
  14793. this.n1 = (this.getChild("n1"));
  14794. }
  14795. }
  14796. ui_btn2.URL = "ui://37nctnhwxe622t";
  14797. class ui_btnBack extends fgui.GButton {
  14798. static createInstance() {
  14799. return (fgui.UIPackage.createObject("loading", "btnBack"));
  14800. }
  14801. onConstruct() {
  14802. this.n6 = (this.getChild("n6"));
  14803. this.n7 = (this.getChild("n7"));
  14804. }
  14805. }
  14806. ui_btnBack.URL = "ui://37nctnhwxe622u";
  14807. class ui_btnXy1 extends fgui.GButton {
  14808. static createInstance() {
  14809. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  14810. }
  14811. onConstruct() {
  14812. this.n1 = (this.getChild("n1"));
  14813. }
  14814. }
  14815. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  14816. class ui_btnXy2 extends fgui.GButton {
  14817. static createInstance() {
  14818. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  14819. }
  14820. onConstruct() {
  14821. this.n1 = (this.getChild("n1"));
  14822. }
  14823. }
  14824. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  14825. class ui_btnXy3 extends fgui.GButton {
  14826. static createInstance() {
  14827. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  14828. }
  14829. onConstruct() {
  14830. this.n1 = (this.getChild("n1"));
  14831. }
  14832. }
  14833. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  14834. class ui_btn4 extends fgui.GButton {
  14835. static createInstance() {
  14836. return (fgui.UIPackage.createObject("loading", "btn4"));
  14837. }
  14838. onConstruct() {
  14839. this.n9 = (this.getChild("n9"));
  14840. this.n1 = (this.getChild("n1"));
  14841. }
  14842. }
  14843. ui_btn4.URL = "ui://37nctnhwxe622z";
  14844. class loadingBinder {
  14845. static bindAll() {
  14846. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  14847. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  14848. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  14849. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  14850. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  14851. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  14852. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  14853. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  14854. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  14855. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  14856. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  14857. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  14858. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  14859. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  14860. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  14861. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  14862. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  14863. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  14864. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  14865. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  14866. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  14867. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  14868. }
  14869. }
  14870. class UIMgr {
  14871. constructor() {
  14872. this._stage = null;
  14873. this._uiList = [];
  14874. this._showList = [];
  14875. this._bindPkgList = [];
  14876. this.uiIndex = 0;
  14877. }
  14878. static get inst() {
  14879. if (UIMgr._inst == null) {
  14880. UIMgr._inst = new UIMgr();
  14881. }
  14882. return UIMgr._inst;
  14883. }
  14884. setStage(s) {
  14885. if (this._stage) {
  14886. console.log("ViewMgr::Stage->舞台不可赋值两次");
  14887. return;
  14888. }
  14889. this._stage = s;
  14890. }
  14891. init() {
  14892. this.setStage(Laya.stage);
  14893. fairygui.UIConfig.defaultFont = "微软雅黑";
  14894. fairygui.UIConfig.modalLayerColor = "rgba(0,0,0,0.9)";
  14895. fairygui.UIConfig.packageFileExtension = "obj";
  14896. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  14897. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  14898. fairygui.GRoot.inst.width = Laya.stage.width;
  14899. fairygui.GRoot.inst.height = Laya.stage.height;
  14900. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  14901. }
  14902. addAllUpdate() {
  14903. this.uiIndex = 0;
  14904. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  14905. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  14906. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  14907. }
  14908. }
  14909. }
  14910. bindFUI(pkgname) {
  14911. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  14912. return;
  14913. }
  14914. switch (pkgname) {
  14915. case fguiRes.loading:
  14916. fairygui.UIPackage.addPackage(pkgname);
  14917. loadingBinder.bindAll();
  14918. this._bindPkgList.push(pkgname);
  14919. break;
  14920. case fguiRes.game:
  14921. fairygui.UIPackage.addPackage(pkgname);
  14922. gameBinder.bindAll();
  14923. this._bindPkgList.push(pkgname);
  14924. break;
  14925. default:
  14926. break;
  14927. }
  14928. }
  14929. Show(cls, ...param) {
  14930. let nameStr = cls.uiName;
  14931. for (let i = this._uiList.length - 1; i >= 0; i--) {
  14932. let temp = this._uiList[i];
  14933. let str = temp.className;
  14934. if (str == nameStr) {
  14935. if (temp.isMuti) {
  14936. if (temp.isHide) {
  14937. temp.show(...param);
  14938. this._uiList.splice(i, 1);
  14939. this._uiList.push(temp);
  14940. return temp;
  14941. }
  14942. }
  14943. else {
  14944. temp.show(...param);
  14945. this._uiList.splice(i, 1);
  14946. this._uiList.push(temp);
  14947. return temp;
  14948. }
  14949. }
  14950. }
  14951. let ui = new cls();
  14952. ui.className = nameStr;
  14953. this._showUI(ui, param);
  14954. return ui;
  14955. }
  14956. destroyUI(ui) {
  14957. for (let i = this._uiList.length - 1; i >= 0; i--) {
  14958. let temp = this._uiList[i].className;
  14959. if (temp == ui.className) {
  14960. this._uiList.splice(i, 1);
  14961. break;
  14962. }
  14963. }
  14964. this.checkUIState();
  14965. }
  14966. _showUI(ui, param) {
  14967. this._uiList.push(ui);
  14968. ui.show(...param);
  14969. }
  14970. Hide(uiClass) {
  14971. let ui = this.getUI(uiClass);
  14972. if (ui && !ui.isHide) {
  14973. ui.hide();
  14974. }
  14975. }
  14976. getUI(ui) {
  14977. let nameStr = ui.uiName;
  14978. for (let index = 0; index < this._uiList.length; index++) {
  14979. let temp = this._uiList[index];
  14980. if (temp.className == nameStr) {
  14981. return temp;
  14982. }
  14983. }
  14984. return null;
  14985. }
  14986. isShow(cls) {
  14987. for (var i of this._uiList) {
  14988. if (i instanceof cls) {
  14989. return i.isShowing;
  14990. }
  14991. }
  14992. return false;
  14993. }
  14994. showUINum() {
  14995. let num = 0;
  14996. for (var i of this._uiList) {
  14997. if (i.isShowing) {
  14998. num++;
  14999. }
  15000. }
  15001. return num;
  15002. }
  15003. checkUIState() {
  15004. Laya.timer.clear(this, this._uiCheck);
  15005. Laya.timer.once(400, this, this._uiCheck);
  15006. }
  15007. _uiCheck() {
  15008. let showList = [];
  15009. for (var i of this._uiList) {
  15010. if (!i.isHide) {
  15011. showList.push(i);
  15012. }
  15013. }
  15014. for (let index = 0; index < showList.length; index++) {
  15015. if (index == showList.length - 1) {
  15016. showList[index].checkActive(true);
  15017. }
  15018. else {
  15019. showList[index].checkActive(false);
  15020. }
  15021. }
  15022. }
  15023. showTip(msg, time = 600, size = 30) {
  15024. }
  15025. }
  15026. class UIShowList {
  15027. }
  15028. class SoundMgr {
  15029. constructor() {
  15030. this.soundMax = 4;
  15031. this.isLoad = false;
  15032. this.soundMap = {};
  15033. this.isSound = true;
  15034. this.openShake = true;
  15035. SoundMgr._instance = this;
  15036. }
  15037. static getInstance() {
  15038. if (!this._instance) {
  15039. this._instance = new SoundMgr();
  15040. }
  15041. return this._instance;
  15042. }
  15043. init() {
  15044. console.log('zh:sm init 1');
  15045. Laya.SoundManager.autoReleaseSound = true;
  15046. Laya.SoundManager.autoStopMusic = true;
  15047. Laya.SoundManager.musicVolume = 0.3;
  15048. Laya.SoundManager.soundVolume = 0.5;
  15049. this.musicPlayed = false;
  15050. this.audioUrl = "asset/sound/ogg/";
  15051. console.log('zh:sm init 2');
  15052. console.log('zh:dev type ');
  15053. if (Laya.Browser.onAndroid) {
  15054. console.log('zh:dev type android');
  15055. this.audioUrl = "asset/sound/ogg/";
  15056. this.isLoad = true;
  15057. }
  15058. else {
  15059. console.log('zh:dev type not android');
  15060. this.audioUrl = "asset/sound/mp3/";
  15061. this.isLoad = true;
  15062. }
  15063. }
  15064. onSetting(isS) {
  15065. this.isSound = isS;
  15066. this.mute(!this.isSound);
  15067. }
  15068. clearCount() {
  15069. for (var key in this.soundMap) {
  15070. delete this.soundMap[key];
  15071. }
  15072. }
  15073. playMusic(path, loop = 0) {
  15074. console.log('zh:playMusic 1 PATH=' + path);
  15075. this.musicPath = path;
  15076. if (!this.isLoad)
  15077. console.log('zh:playMusic 2');
  15078. return;
  15079. if (!path || path == "")
  15080. console.log('zh:playMusic 3');
  15081. return;
  15082. if (!this.isSound)
  15083. console.log('zh:playMusic 4');
  15084. return;
  15085. this.musicPlayed = true;
  15086. console.log('zh:playMusic 5');
  15087. let url = this.getUrl(path);
  15088. console.log('zh:playMusic 6' + url);
  15089. if (Laya.Browser.onPC) {
  15090. console.log('zh:playMusic 7');
  15091. Laya.loader.load(url, Laya.Handler.create(this, () => {
  15092. console.log('zh:playMusic 8');
  15093. this.play(url, loop);
  15094. }));
  15095. }
  15096. else
  15097. this.play(url, loop);
  15098. }
  15099. play(url, loop) {
  15100. Laya.SoundManager.playMusic(url, loop);
  15101. }
  15102. getUrl(path) {
  15103. let url = this.audioUrl + path;
  15104. if (Laya.Browser.onAndroid) {
  15105. url += ".ogg";
  15106. }
  15107. else {
  15108. url += ".mp3";
  15109. }
  15110. return url;
  15111. }
  15112. pauseMusic(pause) {
  15113. if (pause) {
  15114. this.mute(true);
  15115. }
  15116. else if (this.isSound)
  15117. this.mute(false);
  15118. }
  15119. stopMusic() {
  15120. Laya.SoundManager.stopMusic();
  15121. if (Moyu.isNeedPlatAudio) {
  15122. Moyu.stopMusic();
  15123. }
  15124. }
  15125. mute(mute) {
  15126. if (Moyu.isNeedPlatAudio) {
  15127. Moyu.pauseMusic(mute);
  15128. }
  15129. else {
  15130. Laya.SoundManager.musicMuted = mute;
  15131. if (!mute && !this.musicPlayed && this.musicPath) {
  15132. this.playMusic(this.musicPath);
  15133. }
  15134. }
  15135. }
  15136. stopSound(path) {
  15137. let url = this.getUrl(path);
  15138. Laya.SoundManager.stopSound(url);
  15139. }
  15140. playSound(path, loop = 1, soundMax = this.soundMax) {
  15141. if (!this.isLoad)
  15142. return;
  15143. if (!this.isSound)
  15144. return;
  15145. if (!path || path == "")
  15146. return;
  15147. let url = this.getUrl(path);
  15148. if (Moyu.isNeedPlatAudio) {
  15149. Moyu.playSound(path, loop == 0);
  15150. }
  15151. else {
  15152. let count = 1;
  15153. if (this.soundMap[path])
  15154. count = this.soundMap[path] + 1;
  15155. if (count > soundMax)
  15156. return;
  15157. this.soundMap[path] = count;
  15158. Laya.SoundManager.playSound(url, loop);
  15159. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  15160. }
  15161. }
  15162. removePath(path) {
  15163. if (this.soundMap[path]) {
  15164. let count = this.soundMap[path];
  15165. count--;
  15166. if (count < 1)
  15167. delete this.soundMap[path];
  15168. else
  15169. this.soundMap[path] = count;
  15170. }
  15171. }
  15172. playBtnSound() {
  15173. this.playSound("btn");
  15174. }
  15175. playGetSound() {
  15176. }
  15177. playCloseUISound() {
  15178. }
  15179. }
  15180. SoundMgr._instance = null;
  15181. var Handler$1 = Laya.Handler;
  15182. var EResType;
  15183. (function (EResType) {
  15184. EResType[EResType["none"] = 0] = "none";
  15185. EResType[EResType["nromal"] = 1] = "nromal";
  15186. EResType[EResType["td"] = 2] = "td";
  15187. EResType[EResType["sk"] = 3] = "sk";
  15188. })(EResType || (EResType = {}));
  15189. class CResLoader {
  15190. constructor(doneCall, proCall) {
  15191. this.completrCall = doneCall;
  15192. this.progressCall = proCall;
  15193. this.progressHander = new Handler$1(this, this.onProgress);
  15194. this.tdResMap = {};
  15195. }
  15196. load(resList) {
  15197. this.resCount = 0;
  15198. this.loadCount = 0;
  15199. for (let i = 0; i < resList.length; i++) {
  15200. let path = resList[i];
  15201. if (!path)
  15202. continue;
  15203. this.resCount++;
  15204. let type = this.getResType(path);
  15205. if (type == EResType.nromal)
  15206. this.loadNromal(path);
  15207. else if (type == EResType.td)
  15208. this.loadTd(path);
  15209. }
  15210. }
  15211. getRes(path) {
  15212. let type = this.getResType(path);
  15213. if (type == EResType.nromal)
  15214. return Laya.loader.getRes(path);
  15215. else if (type == EResType.td) {
  15216. let res = this.tdResMap[path];
  15217. if (res)
  15218. return res.clone();
  15219. return null;
  15220. }
  15221. }
  15222. destroy() {
  15223. this.progressHander.clear();
  15224. this.progressHander = null;
  15225. }
  15226. clearRes(path) {
  15227. let type = this.getResType(path);
  15228. if (type == EResType.nromal)
  15229. Laya.loader.clearRes(path);
  15230. else if (type == EResType.td) {
  15231. let obj = this.tdResMap[path];
  15232. if (obj)
  15233. obj.destroy();
  15234. delete this.tdResMap[path];
  15235. }
  15236. }
  15237. getResType(path) {
  15238. let exs = this.getExtension(path);
  15239. if (exs == "sk")
  15240. return EResType.sk;
  15241. if (exs == "ls" || exs == "lh" || exs == "lm")
  15242. return EResType.td;
  15243. else
  15244. return EResType.nromal;
  15245. }
  15246. getExtension(res) {
  15247. var index = res.lastIndexOf(".");
  15248. return res.substr(index + 1);
  15249. }
  15250. loadNromal(path) {
  15251. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  15252. if (res) {
  15253. this.onLoad();
  15254. }
  15255. else
  15256. console.log("load res fail:" + path);
  15257. }), this.progressHander);
  15258. }
  15259. loadSk() {
  15260. }
  15261. loadTd(path) {
  15262. if (this.tdResMap[path]) {
  15263. this.onLoad();
  15264. return;
  15265. }
  15266. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  15267. if (res) {
  15268. this.tdResMap[path] = res;
  15269. this.onLoad();
  15270. }
  15271. else
  15272. console.log("load res fail:" + path);
  15273. }));
  15274. }
  15275. onLoad() {
  15276. this.loadCount++;
  15277. this.onProgress(1);
  15278. if (this.loadCount >= this.resCount) {
  15279. this.completrCall.run();
  15280. }
  15281. }
  15282. onProgress(pro) {
  15283. let progress = (this.loadCount + pro) / this.resCount;
  15284. this.progressCall.runWith(progress);
  15285. }
  15286. }
  15287. var Handler$2 = Laya.Handler;
  15288. class ResInfo {
  15289. constructor() {
  15290. this.index = 0;
  15291. }
  15292. }
  15293. class ResMgr {
  15294. constructor() {
  15295. this.resList = [];
  15296. this.doneList = [];
  15297. this.resMap = {};
  15298. this.currentLoad = null;
  15299. this.completeHandler = new Handler$2(this, this.onComplete);
  15300. this.progressHandler = new Handler$2(this, this.onProgress);
  15301. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  15302. }
  15303. static getInstance() {
  15304. if (ResMgr._instance == null) {
  15305. ResMgr._instance = new ResMgr();
  15306. }
  15307. return ResMgr._instance;
  15308. }
  15309. loadList(list, completeHandler, progressHandler) {
  15310. if (list.length < 1) {
  15311. completeHandler.run();
  15312. return;
  15313. }
  15314. let info = this.getResInfo();
  15315. info.resList = list;
  15316. info.completeHandler = completeHandler;
  15317. info.progressHandler = progressHandler;
  15318. this.resList.push(info);
  15319. this.startLoad();
  15320. }
  15321. loadFguiRes(list, completeHandler, progressHandler) {
  15322. Laya.loader.load(list, completeHandler, progressHandler);
  15323. }
  15324. loadAny(list, completeHandler, progressHandler) {
  15325. Laya.loader.load(list, completeHandler, progressHandler);
  15326. }
  15327. load(path, completeHandler, progressHandler) {
  15328. let count = this.resMap[path];
  15329. if (count && count > 0) {
  15330. if (completeHandler)
  15331. completeHandler.run();
  15332. }
  15333. else
  15334. this.loadList([path], completeHandler, progressHandler);
  15335. }
  15336. getRes(path) {
  15337. let res = this.resMap[path];
  15338. if (!res)
  15339. this.showLog("资源不存在:" + path);
  15340. else
  15341. return this.loader.getRes(path);
  15342. }
  15343. clearList(list, force = false) {
  15344. if (!list || list.length < 1)
  15345. return;
  15346. let cr = () => {
  15347. for (const k in list) {
  15348. let v = list[k];
  15349. if (!v)
  15350. continue;
  15351. if (force) {
  15352. this.loader.clearRes(v);
  15353. delete this.resMap[v];
  15354. }
  15355. else {
  15356. let count = this.resMap[v];
  15357. if (count && count > 1) {
  15358. count--;
  15359. this.resMap[v] = count;
  15360. }
  15361. else {
  15362. this.loader.clearRes(v);
  15363. delete this.resMap[v];
  15364. }
  15365. }
  15366. }
  15367. if (!window.hasOwnProperty("ks"))
  15368. Laya.Resource.destroyUnusedResources();
  15369. };
  15370. Laya.timer.clearAll(this);
  15371. Laya.timer.once(2000, this, cr);
  15372. }
  15373. clear3D() {
  15374. for (const k in this.loader.tdResMap) {
  15375. this.loader.clearRes(k);
  15376. if (this.resMap[k])
  15377. delete this.resMap[k];
  15378. }
  15379. if (!window.hasOwnProperty("ks"))
  15380. Laya.Resource.destroyUnusedResources();
  15381. }
  15382. clear(path, force = false) {
  15383. this.clearList([path], force);
  15384. }
  15385. getResInfo() {
  15386. if (this.doneList.length > 0)
  15387. return this.doneList.pop();
  15388. else
  15389. return new ResInfo();
  15390. }
  15391. startLoad() {
  15392. if (this.currentLoad)
  15393. return;
  15394. this.currentLoad = this.resList.pop();
  15395. if (this.currentLoad) {
  15396. this.loader.load(this.currentLoad.resList);
  15397. }
  15398. }
  15399. onComplete() {
  15400. if (!this.currentLoad)
  15401. return;
  15402. for (const k in this.currentLoad.resList) {
  15403. let v = this.currentLoad.resList[k];
  15404. let count = this.resMap[v];
  15405. if (count)
  15406. count++;
  15407. else
  15408. count = 1;
  15409. this.resMap[v] = count;
  15410. }
  15411. if (this.currentLoad.completeHandler)
  15412. this.currentLoad.completeHandler.run();
  15413. this.doneList.push(this.currentLoad);
  15414. this.currentLoad = null;
  15415. this.startLoad();
  15416. }
  15417. onProgress(pro) {
  15418. if (!this.currentLoad)
  15419. return;
  15420. if (this.currentLoad.progressHandler)
  15421. this.currentLoad.progressHandler.runWith(pro);
  15422. }
  15423. showLog(str, ...args) {
  15424. console.log("[ResLoader] " + str);
  15425. }
  15426. }
  15427. ResMgr._instance = null;
  15428. class EventMgr extends Laya.EventDispatcher {
  15429. }
  15430. let eventMgr = new EventMgr();
  15431. class ConfigMgr {
  15432. static getInstance() {
  15433. if (!this._instance) {
  15434. this._instance = new ConfigMgr();
  15435. }
  15436. return this._instance;
  15437. }
  15438. init() {
  15439. this.npcJson = Laya.loader.getRes("res/json/npc.json").Data;
  15440. this.classicCfg = Laya.loader.getRes("res/json/classicCfg.json");
  15441. this.levelCfg = Laya.loader.getRes("res/json/levelCfg.json");
  15442. this.placeBallCfg = Laya.loader.getRes("res/json/placeBallCfg.json");
  15443. }
  15444. getUserInfoByIndex(index) {
  15445. return this.npcJson[index];
  15446. }
  15447. getRandomUserInfo() {
  15448. let index = xGame.tools.random(0, this.npcJson.length);
  15449. return this.npcJson[index];
  15450. }
  15451. getMaxBigMoveLength() {
  15452. return Object.keys(this.levelCfg).length;
  15453. }
  15454. getBigMoveLevelByIndex(index) {
  15455. let cfg = this.levelCfg;
  15456. cfg = cfg[index];
  15457. return cfg;
  15458. }
  15459. getRandomClassicLevel() {
  15460. let cfg = this.classicCfg;
  15461. let num = Object.keys(cfg).length;
  15462. let rand = xGame.common.randomNum(1, num);
  15463. return cfg[rand];
  15464. }
  15465. getPlaceBallByLevel(level) {
  15466. return this.placeBallCfg[level];
  15467. }
  15468. getMaxPlaceBall() {
  15469. return Object.keys(this.placeBallCfg).length;
  15470. }
  15471. }
  15472. class PoolD3Mgr {
  15473. constructor() {
  15474. this.pool = {};
  15475. }
  15476. static get ins() {
  15477. return this._ins || (this._ins = new PoolD3Mgr);
  15478. }
  15479. createList(key, prefab, parent) {
  15480. if (!this.pool[key]) {
  15481. this.pool[key] = {};
  15482. this.pool[key].prefab = prefab;
  15483. this.pool[key].list = [];
  15484. this.pool[key].parent = parent;
  15485. }
  15486. }
  15487. getItem(key) {
  15488. if (!this.pool[key]) {
  15489. return;
  15490. }
  15491. let temp;
  15492. if (this.pool[key].list.length > 0) {
  15493. temp = this.pool[key].list.pop();
  15494. }
  15495. else {
  15496. temp = this.pool[key].prefab.clone();
  15497. if (this.pool[key].parent) {
  15498. this.pool[key].parent.addChild(temp);
  15499. }
  15500. }
  15501. temp.active = true;
  15502. return temp;
  15503. }
  15504. putItem(key, obj) {
  15505. if (!this.pool[key]) {
  15506. return;
  15507. }
  15508. obj.active = false;
  15509. this.pool[key].list.push(obj);
  15510. }
  15511. }
  15512. let context$1 = context;
  15513. let uiMgr = UIMgr.inst;
  15514. let soundMgr = SoundMgr.getInstance();
  15515. let resMgr = ResMgr.getInstance();
  15516. let httpMgr = HttpMgr.getInstance();
  15517. let common = Common.getInstance();
  15518. let cfgMgr = ConfigMgr.getInstance();
  15519. let poolD3Mgr = PoolD3Mgr.ins;
  15520. let d3TexUrl = "res/d3Res/";
  15521. let d3ModeUrl = "res/unityRes/";
  15522. function setStageSize(view) {
  15523. if (view.width) {
  15524. view.width = Laya.stage.width;
  15525. view.height = Laya.stage.height;
  15526. }
  15527. }
  15528. function filledBg(view) {
  15529. let wh = Laya.stage.height / Laya.stage.width;
  15530. if (wh > 16 / 9) {
  15531. view.height = Laya.stage.height;
  15532. view.width = Laya.stage.height / 1334 * 750;
  15533. }
  15534. else {
  15535. view.width = Laya.stage.width;
  15536. view.height = Laya.stage.width / 750 * 1334;
  15537. }
  15538. }
  15539. function setNotch(view) {
  15540. if (view.height) {
  15541. view.y += context$1.notchHeight;
  15542. }
  15543. }
  15544. function showTip(str) {
  15545. uiMgr.Show(UIMsg, str);
  15546. }
  15547. function log(...args) {
  15548. console.log(args);
  15549. }
  15550. let xGame = {
  15551. context: context$1,
  15552. eventMgr,
  15553. resMgr,
  15554. uiMgr,
  15555. soundMgr,
  15556. define,
  15557. tools,
  15558. httpMgr,
  15559. d3TexUrl,
  15560. d3ModeUrl,
  15561. common,
  15562. cfgMgr,
  15563. poolD3Mgr,
  15564. setStageSize,
  15565. filledBg,
  15566. setNotch,
  15567. showTip,
  15568. log,
  15569. };
  15570. window["xGame"] = xGame;
  15571. let dataName = 'tBall_';
  15572. class UserData {
  15573. constructor() {
  15574. this.userId = "";
  15575. this.isAgree = false;
  15576. this.coinNum = 0;
  15577. this.gemNum = 0;
  15578. this.sound = true;
  15579. this.vibration = true;
  15580. this.currentDate = 0;
  15581. this.createTime = 0;
  15582. this.awardTime = 0;
  15583. this.roleId = 1;
  15584. this.roleList = [];
  15585. this.roleAds = [];
  15586. this.dressId = 101;
  15587. this.itemId = 201;
  15588. this.bigSkills = [1, 1, 1, 1, 1];
  15589. this.coin = 4000;
  15590. this.diamond = 0;
  15591. this.skillSuccessTimes = 0;
  15592. this.skillGuide = 0;
  15593. this.skillAccTimes = 0;
  15594. this.placeBallData = [];
  15595. this.shareDiamondTimes = 0;
  15596. this.dailyVideoShareTimes = 0;
  15597. this.secretary = [1, 0];
  15598. this.curSecretary = 0;
  15599. this.ballRod = [1, 0, 0, 0, 0, 1];
  15600. this.curBallRod = 5;
  15601. this.signData = 0;
  15602. this.signTime = 0;
  15603. this.drawTimes = 0;
  15604. this.drawAwardTimes = 0;
  15605. this.dailyfreeDrawTimes = 1;
  15606. this.power = 5;
  15607. this.powerTime = 0;
  15608. this.challengeTimes = 0;
  15609. this.extraSign = 0;
  15610. this.classicTimes = 0;
  15611. this.guideHelpLine = 0;
  15612. this.newUser = true;
  15613. this.rootBallFoul = 0;
  15614. this.timeoutFoul = 0;
  15615. this.roleList = [1];
  15616. }
  15617. saveData() {
  15618. let data = {};
  15619. for (let k in this) {
  15620. data[k.toString()] = this[k];
  15621. }
  15622. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  15623. }
  15624. getData() {
  15625. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  15626. if (ld) {
  15627. let localData = JSON.parse(ld);
  15628. if (localData) {
  15629. for (let k in this) {
  15630. let key = k.toString();
  15631. let data = localData[key];
  15632. if (data != undefined) {
  15633. this[k] = data;
  15634. }
  15635. }
  15636. }
  15637. }
  15638. }
  15639. }
  15640. class ItemData {
  15641. constructor() {
  15642. this.itemList = {};
  15643. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  15644. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  15645. }
  15646. saveData() {
  15647. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  15648. }
  15649. getData() {
  15650. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  15651. if (ld) {
  15652. let localData = JSON.parse(ld);
  15653. if (localData) {
  15654. this.itemList = localData;
  15655. }
  15656. }
  15657. }
  15658. }
  15659. class GameData {
  15660. constructor() {
  15661. this.curLevel = 0;
  15662. this.gameType = 1;
  15663. this.signIdx = 0;
  15664. this.signMax = 0;
  15665. this.rotaryTime = 0;
  15666. this.rotaryCount = 0;
  15667. this.rotaryList = [];
  15668. this.diyCount = 3;
  15669. this.awardIdx = 0;
  15670. this.shareNum = 2;
  15671. this.rankWeek = 0;
  15672. this.rankScore = 0;
  15673. this.gameCount = 0;
  15674. this.trySkill = -1;
  15675. this.tryTime = 0;
  15676. }
  15677. saveData() {
  15678. let data = {};
  15679. for (let k in this) {
  15680. data[k.toString()] = this[k];
  15681. }
  15682. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  15683. }
  15684. getData() {
  15685. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  15686. if (ld) {
  15687. let localData = JSON.parse(ld);
  15688. if (localData) {
  15689. for (let k in this) {
  15690. let key = k.toString();
  15691. let data = localData[key];
  15692. if (data != undefined) {
  15693. this[k] = data;
  15694. }
  15695. }
  15696. }
  15697. }
  15698. }
  15699. }
  15700. class DataMgr {
  15701. static Init() {
  15702. this.userData = new UserData();
  15703. this.gameData = new GameData();
  15704. this.itemData = new ItemData();
  15705. this.userData.getData();
  15706. this.gameData.getData();
  15707. this.itemData.getData();
  15708. this.roleId = this.userData.roleId;
  15709. this.resetUse();
  15710. }
  15711. static isNewDay() {
  15712. Moyu.isNewDay(this, (isnew) => {
  15713. xGame.common.isNewDay = isnew;
  15714. if (!isnew)
  15715. return;
  15716. DataMgr.setShareDiamondTimes(0, false);
  15717. DataMgr.setDailyVideoShareTimes(0, false);
  15718. DataMgr.setDailyfreeDrawTimes(1);
  15719. DataMgr.setExtraSign(0);
  15720. });
  15721. }
  15722. static deletData() {
  15723. Laya.LocalStorage.clear();
  15724. }
  15725. static upRankData() {
  15726. let num = xGame.common.getAllStarNum();
  15727. if (num > 0)
  15728. Moyu.upRankData(xGame.common.curRankID, num);
  15729. }
  15730. static addItem(id, count = 1) {
  15731. let v = this.itemData.itemList[id];
  15732. if (!v)
  15733. v = { id: id, count: count, adnum: 0, active: true };
  15734. else {
  15735. if (v.active) {
  15736. v.count += count;
  15737. }
  15738. else {
  15739. v.count = count;
  15740. v.active = true;
  15741. }
  15742. }
  15743. this.itemData.itemList[id] = v;
  15744. xGame.soundMgr.playGetSound();
  15745. this.saveItemData();
  15746. }
  15747. static hasItem(id) {
  15748. let v = this.itemData.itemList[id];
  15749. if (v && v.active)
  15750. return true;
  15751. return false;
  15752. }
  15753. static getItem(id) {
  15754. let v = this.itemData.itemList[id];
  15755. return v;
  15756. }
  15757. static getItemCount(id) {
  15758. let v = this.itemData.itemList[id];
  15759. if (v && v.active)
  15760. return v.count;
  15761. return 0;
  15762. }
  15763. static getItemAd(id) {
  15764. let v = this.itemData.itemList[id];
  15765. if (v) {
  15766. return v.adnum;
  15767. }
  15768. return 0;
  15769. }
  15770. static onItemAd(id, num = 1) {
  15771. let v = this.itemData.itemList[id];
  15772. if (!v)
  15773. v = { id: id, count: 1, adnum: num, active: false };
  15774. else
  15775. v.adnum += num;
  15776. this.itemData.itemList[id] = v;
  15777. this.saveItemData();
  15778. }
  15779. static costItem(id, count) {
  15780. let v = this.itemData.itemList[id];
  15781. if (v && v.active) {
  15782. if (v.count < count)
  15783. return false;
  15784. else {
  15785. v.count -= count;
  15786. this.itemData.itemList[id] = v;
  15787. return true;
  15788. }
  15789. }
  15790. return false;
  15791. }
  15792. static resetUse() {
  15793. this.dressId = this.userData.dressId;
  15794. this.itemId = this.userData.itemId;
  15795. }
  15796. static passLevel() {
  15797. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  15798. this.gameData.curLevel++;
  15799. this.curLevel = this.gameData.curLevel;
  15800. this.saveGameData();
  15801. }
  15802. static useRole(id) {
  15803. this.roleId = id;
  15804. if (this.hasRole(id)) {
  15805. this.userData.roleId = id;
  15806. this.saveUserData();
  15807. }
  15808. }
  15809. static addRole(id) {
  15810. if (this.hasRole(id))
  15811. return;
  15812. this.userData.roleList.push(id);
  15813. this.saveUserData();
  15814. }
  15815. static hasRole(id) {
  15816. return this.userData.roleList.indexOf(id) >= 0;
  15817. }
  15818. static gemEnough(num) {
  15819. return this.userData.gemNum >= num;
  15820. }
  15821. static roleHasAd(id) {
  15822. let count = this.userData.roleAds[id];
  15823. if (count != undefined && count >= 0)
  15824. return true;
  15825. else
  15826. return false;
  15827. }
  15828. static saveUserData(time = 1000, event, arg) {
  15829. if (this.userSaving)
  15830. return;
  15831. this.userSaving = true;
  15832. Laya.timer.once(time, this, () => {
  15833. this.userSaving = false;
  15834. this.userData.saveData();
  15835. if (event)
  15836. xGame.eventMgr.event(event, arg);
  15837. });
  15838. }
  15839. static saveGameData() {
  15840. if (this.gameSaving)
  15841. return;
  15842. this.gameSaving = true;
  15843. Laya.timer.once(1000, this, () => {
  15844. this.gameSaving = false;
  15845. this.gameData.saveData();
  15846. });
  15847. }
  15848. static saveItemData() {
  15849. let fun = () => {
  15850. this.itemData.saveData();
  15851. };
  15852. Laya.timer.clear(this, fun);
  15853. Laya.timer.once(500, this, fun);
  15854. }
  15855. static saveData() {
  15856. this.saveUserData();
  15857. this.saveGameData();
  15858. }
  15859. static getBigSkillList() {
  15860. return this.userData.bigSkills;
  15861. }
  15862. static getBigSkillByIndex(index) {
  15863. return this.userData.bigSkills[index];
  15864. }
  15865. static setBigSkill(index, val, addUp = true) {
  15866. if (addUp) {
  15867. this.userData.bigSkills[index] += val;
  15868. }
  15869. else {
  15870. this.userData.bigSkills[index] = val;
  15871. }
  15872. this.saveUserData();
  15873. }
  15874. static coinEnough(need) {
  15875. if (typeof need != "number") {
  15876. console.error("金币格式错误");
  15877. return;
  15878. }
  15879. return this.userData.coin >= need;
  15880. }
  15881. static setCoin(val) {
  15882. if (typeof val != "number") {
  15883. return;
  15884. }
  15885. this.userData.coin += val;
  15886. this.saveUserData();
  15887. xGame.eventMgr.event(COIN_CHANGE);
  15888. }
  15889. static getCoin() {
  15890. return this.userData.coin;
  15891. }
  15892. static diamondEnough(need) {
  15893. if (typeof need != "number") {
  15894. console.error("金币格式错误");
  15895. return;
  15896. }
  15897. return this.userData.diamond >= need;
  15898. }
  15899. static setDiamond(val) {
  15900. if (typeof val != "number") {
  15901. return;
  15902. }
  15903. this.userData.diamond += val;
  15904. this.saveUserData();
  15905. xGame.eventMgr.event(DIAMOND_CHANGE);
  15906. }
  15907. static getDiamond() {
  15908. return this.userData.diamond;
  15909. }
  15910. static getSkillSuccessTimes() {
  15911. return this.userData.skillSuccessTimes;
  15912. }
  15913. static setSkillSuccessTimes(val, addUp = true) {
  15914. if (addUp)
  15915. this.userData.skillSuccessTimes += val;
  15916. else
  15917. this.userData.skillSuccessTimes = val;
  15918. this.saveUserData();
  15919. }
  15920. static getSkillAccTimes() {
  15921. return this.userData.skillAccTimes;
  15922. }
  15923. static setSkillAccTimes(val) {
  15924. this.userData.skillAccTimes += val;
  15925. this.saveUserData();
  15926. }
  15927. static getSkillGuide() {
  15928. if (!xGame.common.openGuide) {
  15929. return 1;
  15930. }
  15931. return this.userData.skillGuide;
  15932. }
  15933. static setSkillGuide(val) {
  15934. this.userData.skillGuide = val;
  15935. this.saveUserData();
  15936. }
  15937. static getPlaceBallLevelList() {
  15938. return this.userData.placeBallData;
  15939. }
  15940. static getPlaceBallLevel(level) {
  15941. let arr = this.userData.placeBallData;
  15942. let index = level - 1;
  15943. let out;
  15944. if (arr[index]) {
  15945. out = arr[index];
  15946. }
  15947. else {
  15948. let max = arr.length;
  15949. if (max == index) {
  15950. out = {
  15951. star: 0,
  15952. play: true,
  15953. isCur: true,
  15954. getAward: false
  15955. };
  15956. }
  15957. else {
  15958. out = {
  15959. star: 0,
  15960. play: false,
  15961. getAward: false
  15962. };
  15963. }
  15964. }
  15965. return out;
  15966. }
  15967. static setPlaceBallLevel(level, star) {
  15968. let arr = this.userData.placeBallData;
  15969. let index = level - 1;
  15970. if (arr[index]) {
  15971. arr[index].star = Math.max(arr[index].star, star);
  15972. }
  15973. else {
  15974. let max = arr.length;
  15975. if (max == index) {
  15976. arr.push({
  15977. star: star,
  15978. play: true,
  15979. getAward: false
  15980. });
  15981. }
  15982. else {
  15983. console.error("关卡存储出错");
  15984. }
  15985. }
  15986. this.saveUserData();
  15987. }
  15988. static setPlaceBallAward(level) {
  15989. let arr = this.userData.placeBallData;
  15990. let index = level - 1;
  15991. if (arr[index]) {
  15992. arr[index].getAward = true;
  15993. }
  15994. this.saveUserData();
  15995. }
  15996. static getShareDiamondTimes() {
  15997. return this.userData.shareDiamondTimes;
  15998. }
  15999. static setShareDiamondTimes(val, addUp = true) {
  16000. if (addUp) {
  16001. this.userData.shareDiamondTimes += val;
  16002. }
  16003. else {
  16004. this.userData.shareDiamondTimes = val;
  16005. }
  16006. this.saveUserData();
  16007. }
  16008. static getDailyVideoShareTimes() {
  16009. return this.userData.dailyVideoShareTimes;
  16010. }
  16011. static setDailyVideoShareTimes(val, addUp = true) {
  16012. if (addUp) {
  16013. this.userData.dailyVideoShareTimes += val;
  16014. }
  16015. else {
  16016. this.userData.dailyVideoShareTimes = val;
  16017. }
  16018. this.saveUserData();
  16019. }
  16020. static getSecretary(index) {
  16021. return this.userData.secretary[index];
  16022. }
  16023. static setSecretary(index, val) {
  16024. this.userData.secretary[index] = val;
  16025. this.saveUserData();
  16026. }
  16027. static getCurSecretary() {
  16028. return this.userData.curSecretary;
  16029. }
  16030. static setCurSecretary(index) {
  16031. this.userData.curSecretary = index;
  16032. this.saveUserData();
  16033. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  16034. }
  16035. static getBallRod(index) {
  16036. return this.userData.ballRod[index];
  16037. }
  16038. static setBallRod(index, val) {
  16039. this.userData.ballRod[index] = val;
  16040. this.saveUserData();
  16041. }
  16042. static getCurBallRod() {
  16043. return this.userData.curBallRod;
  16044. }
  16045. static setCurBallRod(index) {
  16046. this.userData.curBallRod = index;
  16047. this.saveUserData();
  16048. }
  16049. static setSignData(val) {
  16050. this.userData.signData = val;
  16051. this.saveUserData();
  16052. }
  16053. static getSignData() {
  16054. return this.userData.signData;
  16055. }
  16056. static setSignTime(val) {
  16057. this.userData.signTime = val;
  16058. this.saveUserData();
  16059. }
  16060. static getSignTime() {
  16061. return this.userData.signTime;
  16062. }
  16063. static getDrawTimes() {
  16064. return this.userData.drawTimes;
  16065. }
  16066. static setDrawTimes(val, addUp = true) {
  16067. if (addUp) {
  16068. this.userData.drawTimes += val;
  16069. }
  16070. else {
  16071. this.userData.drawTimes = val;
  16072. }
  16073. this.saveUserData();
  16074. }
  16075. static getDrawAwardTimes() {
  16076. return this.userData.drawAwardTimes;
  16077. }
  16078. static setDrawAwardTimes(val) {
  16079. this.userData.drawAwardTimes = val;
  16080. this.saveUserData();
  16081. }
  16082. static getDailyfreeDrawTimes() {
  16083. return this.userData.dailyfreeDrawTimes;
  16084. }
  16085. static setDailyfreeDrawTimes(val) {
  16086. this.userData.dailyfreeDrawTimes = val;
  16087. this.saveUserData();
  16088. }
  16089. static setPower(val, addUp = true) {
  16090. if (addUp)
  16091. this.userData.power += val;
  16092. else
  16093. this.userData.power = val;
  16094. if (this.userData.power >= xGame.common.maxPower) {
  16095. this.userData.power = xGame.common.maxPower;
  16096. }
  16097. xGame.eventMgr.event(POWER_CHANGE, val);
  16098. this.saveUserData();
  16099. }
  16100. static getPower() {
  16101. return this.userData.power;
  16102. }
  16103. static setPowerTime(val) {
  16104. this.userData.powerTime = val;
  16105. this.saveUserData();
  16106. }
  16107. static getPowerTime() {
  16108. return this.userData.powerTime;
  16109. }
  16110. static powerEnough() {
  16111. return this.getPower() > 0;
  16112. }
  16113. static getChallengeTimes() {
  16114. return this.userData.challengeTimes;
  16115. }
  16116. static setChallengeTimes(val) {
  16117. this.userData.challengeTimes += val;
  16118. this.saveUserData();
  16119. }
  16120. static getExtraSign() {
  16121. return this.userData.extraSign;
  16122. }
  16123. static setExtraSign(val) {
  16124. this.userData.extraSign = val;
  16125. this.saveUserData();
  16126. }
  16127. static getClassicTimes() {
  16128. return this.userData.classicTimes;
  16129. }
  16130. static setClassicTimes() {
  16131. this.userData.classicTimes += 1;
  16132. this.saveUserData();
  16133. }
  16134. static getGuideHelpLine() {
  16135. return this.userData.guideHelpLine;
  16136. }
  16137. static setGuideHelpLine() {
  16138. this.userData.guideHelpLine = 1;
  16139. this.saveUserData();
  16140. }
  16141. static getNewUser() {
  16142. return this.userData.newUser;
  16143. }
  16144. static setNewUser() {
  16145. this.userData.newUser = false;
  16146. this.saveUserData();
  16147. }
  16148. static getRootBallFoul() {
  16149. return this.userData.rootBallFoul;
  16150. }
  16151. static setRootBallFoul() {
  16152. this.userData.rootBallFoul = 1;
  16153. this.saveUserData();
  16154. }
  16155. static getTimeoutFoul() {
  16156. return this.userData.timeoutFoul;
  16157. }
  16158. static setTimeoutFoul() {
  16159. this.userData.timeoutFoul = 1;
  16160. this.saveUserData();
  16161. }
  16162. }
  16163. DataMgr.isNewUser = false;
  16164. DataMgr.fristEnter = true;
  16165. DataMgr.levelType = 0;
  16166. DataMgr.awardId = 0;
  16167. DataMgr.awardCoin = 0;
  16168. DataMgr.sceneId = -1;
  16169. DataMgr.tryId = 0;
  16170. DataMgr.curLevel = 1;
  16171. DataMgr.vipLevel = 0;
  16172. DataMgr.maxLevel = 0;
  16173. DataMgr.awardRatio = 1;
  16174. DataMgr.gameList = [];
  16175. DataMgr.rankList = [];
  16176. DataMgr.recoverTime = 480000;
  16177. DataMgr.minScore = 0;
  16178. DataMgr.rankDis = 0;
  16179. DataMgr.userSaving = false;
  16180. DataMgr.gameSaving = false;
  16181. class D3Tween extends Laya.Script3D {
  16182. constructor() {
  16183. super();
  16184. this.isInited = false;
  16185. }
  16186. ;
  16187. init() {
  16188. if (this.isInited)
  16189. return;
  16190. this.isInited = true;
  16191. this.gameObj = this.owner;
  16192. this.transform = this.gameObj.transform;
  16193. }
  16194. get rotX() {
  16195. return this.transform.localRotationEulerX;
  16196. }
  16197. set rotX(v) {
  16198. this.transform.localRotationEulerX = v;
  16199. }
  16200. get rotY() {
  16201. return this.transform.localRotationEulerY;
  16202. }
  16203. set rotY(v) {
  16204. this.transform.localRotationEulerY = v;
  16205. }
  16206. get rotZ() {
  16207. return this.transform.localRotationEulerZ;
  16208. }
  16209. set rotZ(v) {
  16210. this.transform.localRotationEulerZ = v;
  16211. }
  16212. get posX() {
  16213. return this.transform.localPositionX;
  16214. }
  16215. set posX(v) {
  16216. this.transform.localPositionX = v;
  16217. }
  16218. get posY() {
  16219. return this.transform.localPositionY;
  16220. }
  16221. set posY(v) {
  16222. this.transform.localPositionY = v;
  16223. }
  16224. get posZ() {
  16225. return this.transform.localPositionZ;
  16226. }
  16227. set posZ(v) {
  16228. this.transform.localPositionZ = v;
  16229. }
  16230. get rotation() {
  16231. return this.transform.localRotation;
  16232. }
  16233. set rotation(v) {
  16234. this.transform.localRotation = v;
  16235. }
  16236. }
  16237. class D2Hole extends Laya.Script {
  16238. constructor() { super(); }
  16239. onTriggerEnter(collider) {
  16240. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  16241. return;
  16242. }
  16243. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  16244. if (collider.owner["mySrc"].isRunSkillAni) {
  16245. return;
  16246. }
  16247. if (collider.owner["mySrc"].number != 0) {
  16248. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  16249. }
  16250. xGame.common.ballColliHole(collider);
  16251. xGame.common.recoverCameraView();
  16252. }
  16253. }
  16254. }
  16255. class Table extends Laya.Script3D {
  16256. constructor() {
  16257. super();
  16258. this.isSetBorder = false;
  16259. this.inited = false;
  16260. }
  16261. ;
  16262. onAwake() {
  16263. this.init();
  16264. }
  16265. init() {
  16266. if (this.inited)
  16267. return;
  16268. this.inited = true;
  16269. this.gameObj = this.owner;
  16270. this.border = this.gameObj.getChildByName("border");
  16271. }
  16272. setBorderPos() {
  16273. if (this.isSetBorder)
  16274. return;
  16275. this.isSetBorder = true;
  16276. let ui = xGame.common.gameUI.ui;
  16277. let bar1 = this.border.getChildByName("bar1");
  16278. let bar2 = this.border.getChildByName("bar2");
  16279. let bar3 = this.border.getChildByName("bar3");
  16280. let bar4 = this.border.getChildByName("bar4");
  16281. let bar5 = this.border.getChildByName("bar5");
  16282. let bar6 = this.border.getChildByName("bar6");
  16283. this.setInfo(bar1, ui.border.bar1, "box");
  16284. this.setInfo(bar2, ui.border.bar2, "box");
  16285. this.setInfo(bar3, ui.border.bar3, "box");
  16286. this.setInfo(bar4, ui.border.bar4, "box");
  16287. this.setInfo(bar5, ui.border.bar5, "box");
  16288. this.setInfo(bar6, ui.border.bar6, "box");
  16289. let circle1 = this.border.getChildByName("circle1");
  16290. let circle2 = this.border.getChildByName("circle2");
  16291. let circle3 = this.border.getChildByName("circle3");
  16292. let circle4 = this.border.getChildByName("circle4");
  16293. let circle5 = this.border.getChildByName("circle5");
  16294. let circle6 = this.border.getChildByName("circle6");
  16295. this.setInfo(circle1, ui.border.circle1, "circle");
  16296. this.setInfo(circle2, ui.border.circle2, "circle");
  16297. this.setInfo(circle3, ui.border.circle3, "circle");
  16298. this.setInfo(circle4, ui.border.circle4, "circle");
  16299. this.setInfo(circle5, ui.border.circle5, "circle");
  16300. this.setInfo(circle6, ui.border.circle6, "circle");
  16301. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  16302. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  16303. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  16304. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  16305. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  16306. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  16307. let arr = xGame.common.gameMgr.holePosList;
  16308. xGame.common.gameMgr.posObj = {
  16309. "1": arr[0],
  16310. "3": arr[2],
  16311. "4": arr[3],
  16312. "6": arr[5]
  16313. };
  16314. }
  16315. initHolePos(x, y) {
  16316. if (x < 300)
  16317. x += 25;
  16318. else if (x > 1000)
  16319. x -= 25;
  16320. else if (y > 200)
  16321. y -= 10;
  16322. else
  16323. y += 10;
  16324. if (y < 200)
  16325. y += 30;
  16326. else if (y > 500)
  16327. y -= 30;
  16328. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  16329. }
  16330. setInfo(d3Obj, d2Obj, type) {
  16331. let ui = xGame.common.gameUI.ui;
  16332. let sprite = new Laya.Sprite();
  16333. ui.border.displayObject.addChild(sprite);
  16334. let colli = xGame.common.getCollider(type);
  16335. sprite.addComponentIntance(colli);
  16336. let rigy = xGame.common.getRigbody();
  16337. rigy.type = "static";
  16338. sprite.addComponentIntance(rigy);
  16339. let d3Pos = d3Obj.transform.position;
  16340. xGame.common.pos3to2Convert(d3Pos);
  16341. let scaleX = d3Obj.transform.localScaleX;
  16342. let scaleZ = d3Obj.transform.localScaleZ;
  16343. let width = xGame.common.scale3to2Convert(scaleZ);
  16344. let height = xGame.common.scale3to2Convert(scaleX);
  16345. sprite.pivotX = width / 2;
  16346. sprite.pivotY = height / 2;
  16347. sprite.x = d3Pos.x;
  16348. sprite.y = d3Pos.y;
  16349. sprite.width = width;
  16350. sprite.height = height;
  16351. d2Obj.x = d3Pos.x;
  16352. d2Obj.y = d3Pos.y;
  16353. d2Obj.width = width;
  16354. d2Obj.height = height;
  16355. if (type == "box") {
  16356. colli.width = width;
  16357. colli.height = height;
  16358. colli.isSensor = false;
  16359. colli.label = "border";
  16360. }
  16361. else {
  16362. colli.radius = width / 2;
  16363. colli.isSensor = true;
  16364. colli.label = "hole";
  16365. sprite.addComponent(D2Hole);
  16366. }
  16367. }
  16368. }
  16369. class D3World extends Laya.Script3D {
  16370. constructor() {
  16371. super();
  16372. this.loadNum = 0;
  16373. this.setLoadNum = 7;
  16374. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  16375. }
  16376. onAwake() {
  16377. }
  16378. loadScene() {
  16379. this.scene = this.owner;
  16380. let url = `res/unityRes/root.lh`;
  16381. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  16382. this.scene.addChild(prefab);
  16383. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  16384. this.putCameraInfo();
  16385. this.camera.enableHDR = false;
  16386. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  16387. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  16388. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  16389. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  16390. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  16391. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  16392. this.knife.active = false;
  16393. this.loadD3Obj();
  16394. }));
  16395. }
  16396. putCameraInfo() {
  16397. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  16398. this.cameraObj = new cameraType();
  16399. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  16400. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  16401. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  16402. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  16403. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  16404. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  16405. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  16406. this.visitAngleChild.init();
  16407. this.visitRootObj.posX = this.visitAngleChild.posX;
  16408. this.visitRootObj.posY = this.visitAngleChild.posY;
  16409. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  16410. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  16411. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  16412. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  16413. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  16414. xGame.common.showOneCamera("mainCamera");
  16415. }
  16416. loadD3Obj() {
  16417. this.loadTable();
  16418. this.loadRoom();
  16419. this.loadInHoleParticial();
  16420. this.loadIceParticial();
  16421. this.loadHitParticial();
  16422. this.loadFireworksParticial();
  16423. this.loadBall();
  16424. }
  16425. loadInHoleParticial() {
  16426. this.loadD3Res("inHoleEft", "", (prefab) => {
  16427. prefab.addComponent(Partical);
  16428. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  16429. });
  16430. }
  16431. loadIceParticial() {
  16432. this.loadD3Res("iceEft", "", (prefab) => {
  16433. prefab.addComponent(Partical);
  16434. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  16435. });
  16436. }
  16437. loadHitParticial() {
  16438. this.loadD3Res("hitEft", "", (prefab) => {
  16439. prefab.addComponent(Partical);
  16440. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  16441. });
  16442. }
  16443. loadFireworksParticial() {
  16444. this.loadD3Res("fireworksEft", "", (prefab) => {
  16445. prefab.addComponent(Partical);
  16446. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  16447. });
  16448. }
  16449. loadBall(index = 1) {
  16450. this.loadD3Res("ball", index, (prefab) => {
  16451. this.ballPrefab = prefab;
  16452. this.ballPrefab.addComponent(Ball);
  16453. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  16454. });
  16455. }
  16456. loadTable(index = 1) {
  16457. this.loadD3Res("table", index, (prefab) => {
  16458. this.tableSrc = prefab.addComponent(Table);
  16459. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  16460. this.d3Hand.init();
  16461. this.tableRoot.addChild(prefab);
  16462. });
  16463. }
  16464. loadRoom(index = 1) {
  16465. this.loadD3Res("room", index, (prefab) => {
  16466. this.roomRoot.addChild(prefab);
  16467. });
  16468. }
  16469. loadD3Res(type, index, callback) {
  16470. let url = `res/unityRes/${type}${index}.lh`;
  16471. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  16472. callback && callback(prefab);
  16473. this.checkResLoad();
  16474. }));
  16475. }
  16476. checkResLoad() {
  16477. this.loadNum++;
  16478. if (this.loadNum >= this.setLoadNum) {
  16479. xGame.eventMgr.event(D3RES_LOADED);
  16480. }
  16481. }
  16482. prePlayEft() {
  16483. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  16484. eft.transform.localPositionX = 0;
  16485. eft.transform.localPositionY = -5;
  16486. eft.transform.localPositionZ = 0;
  16487. eft.active = true;
  16488. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  16489. ice.transform.localPositionX = 0;
  16490. ice.transform.localPositionY = -5;
  16491. ice.transform.localPositionZ = 0;
  16492. ice.active = true;
  16493. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  16494. hit.transform.localPositionX = 0;
  16495. hit.transform.localPositionY = -5;
  16496. hit.transform.localPositionZ = 0;
  16497. hit.active = true;
  16498. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  16499. fireworks.transform.localPositionX = 0;
  16500. fireworks.transform.localPositionY = -5;
  16501. fireworks.transform.localPositionZ = 0;
  16502. fireworks.active = true;
  16503. }
  16504. }
  16505. class cameraType {
  16506. }
  16507. class MoyuMgr$1 {
  16508. static initMoyu() {
  16509. this.moyuView = new MoyuView$1();
  16510. Laya.stage.addChild(this.moyuView.ui.displayObject);
  16511. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  16512. this.moyuView.ui.displayObject.zOrder = 1000;
  16513. this.moyuView.init();
  16514. this.moyuView.showTip(true);
  16515. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  16516. window['XApk'] = this;
  16517. }
  16518. static showAge(show) {
  16519. if (this.moyuView)
  16520. this.moyuView.showAge(show);
  16521. }
  16522. static onPlatMsg(idx) {
  16523. if (!MoyuMgr$1.moyuView)
  16524. return;
  16525. if (idx == '0') {
  16526. MoyuMgr$1.moyuView.showTip(false);
  16527. }
  16528. }
  16529. static showAgree(call) {
  16530. if (this.moyuView)
  16531. this.moyuView.showAgree(call);
  16532. else
  16533. call && call();
  16534. }
  16535. static showXy(type = 1) {
  16536. if (this.moyuView)
  16537. this.moyuView.showXy(type);
  16538. }
  16539. }
  16540. MoyuMgr$1.isAdvise = false;
  16541. class MoyuView$1 {
  16542. constructor() {
  16543. this.ysxyNum = 1;
  16544. this.ysJson = null;
  16545. this.ui = ui_UIMoyu.createInstance();
  16546. }
  16547. init() {
  16548. this.ui.mainBg.visible = false;
  16549. this.ui.xyNode.visible = false;
  16550. this.ui.ageNode.visible = false;
  16551. this.ui.tipNode.visible = false;
  16552. this.ui.rnNode.visible = false;
  16553. this.ui.fcmNode.visible = false;
  16554. this.ui.ageTip.visible = false;
  16555. this.ui.msgNode.visible = false;
  16556. this.ui.visible = false;
  16557. this.ui.xyNode.xyList.setVirtual();
  16558. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  16559. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  16560. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  16561. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  16562. this.ui.xyNode.btnKnown.visible = false;
  16563. this.ui.xyNode.xy1.visible = false;
  16564. this.ui.xyNode.xy2.visible = false;
  16565. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  16566. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  16567. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  16568. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  16569. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  16570. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  16571. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  16572. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  16573. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  16574. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  16575. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  16576. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  16577. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  16578. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  16579. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  16580. this.ysxyNum = 2;
  16581. }
  16582. }
  16583. onClick(obj) {
  16584. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  16585. switch (obj) {
  16586. case this.ui.ageTip:
  16587. if (Moyu.isTTApk) {
  16588. this.ui.ageNode.visible = true;
  16589. this.ui.mainBg.visible = true;
  16590. }
  16591. break;
  16592. case this.ui.tipNode:
  16593. this.showTip(false);
  16594. break;
  16595. case this.ui.ageNode.btnAge:
  16596. this.ui.ageNode.visible = false;
  16597. this.ui.mainBg.visible = false;
  16598. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  16599. this.ui.visible = false;
  16600. break;
  16601. case this.ui.xyNode.btnXy3:
  16602. case this.ui.xyNode.btnXy1:
  16603. this.loadXy(1);
  16604. break;
  16605. case this.ui.xyNode.btnXy2:
  16606. this.loadXy(2);
  16607. break;
  16608. case this.ui.xyNode.btnBack:
  16609. this.ui.xyNode.xy1.visible = true;
  16610. this.ui.xyNode.xy2.visible = false;
  16611. break;
  16612. case this.ui.xyNode.btnKnown:
  16613. this.ui.xyNode.visible = false;
  16614. this.ui.mainBg.visible = false;
  16615. this.ui.visible = false;
  16616. break;
  16617. case this.ui.rnNode.btnCheck:
  16618. this.check();
  16619. break;
  16620. case this.ui.rnNode.btnExit:
  16621. case this.ui.xyNode.btnNo:
  16622. this.ysxyNum--;
  16623. if (this.ysxyNum > 0)
  16624. this.showMsg("再次拒绝退出游戏");
  16625. else {
  16626. Moyu.userAgree(false);
  16627. Moyu.exit();
  16628. }
  16629. break;
  16630. case this.ui.xyNode.btnSure:
  16631. case this.ui.xyNode.btnYes:
  16632. DataMgr.userData.isAgree = true;
  16633. DataMgr.saveUserData();
  16634. this.onAgree();
  16635. break;
  16636. case this.ui.rnNode.btnDone:
  16637. this.ui.rnNode.visible = false;
  16638. this.ui.visible = false;
  16639. break;
  16640. case this.ui.fcmNode.btnRn:
  16641. this.showRn();
  16642. break;
  16643. }
  16644. }
  16645. showTip(show) {
  16646. if (!Moyu.isVVApk && !Moyu.isOPApk)
  16647. return;
  16648. if (show) {
  16649. MoyuMgr$1.isAdvise = true;
  16650. this.ui.visible = true;
  16651. this.ui.tipNode.visible = true;
  16652. this.ui.tipNode.alpha = 1;
  16653. Laya.timer.once(1000, this, this.showTip, [false]);
  16654. }
  16655. else {
  16656. this.ui.tipNode.alpha = 1;
  16657. this.ui.tipNode.visible = true;
  16658. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  16659. this.ui.tipNode.visible = false;
  16660. MoyuMgr$1.isAdvise = false;
  16661. }), 1000);
  16662. }
  16663. }
  16664. showAge(show, px = 0, py = 0) {
  16665. if (Moyu.platType > 10 && !Moyu.isIos) {
  16666. this.ui.ageTip.x = px;
  16667. this.ui.ageTip.y = py;
  16668. this.ui.ageTip.visible = show;
  16669. if (show)
  16670. this.ui.visible = true;
  16671. }
  16672. }
  16673. showAgree(call) {
  16674. this.agreeCall = call;
  16675. this.onAgree();
  16676. return;
  16677. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  16678. this.showXy(0);
  16679. }
  16680. else
  16681. this.onAgree();
  16682. }
  16683. onAgree() {
  16684. if (!this.ui.ageNode.visible)
  16685. this.ui.visible = false;
  16686. this.ui.xyNode.visible = false;
  16687. Moyu.userAgree(true);
  16688. this.showAge(false);
  16689. this.agreeCall && this.agreeCall();
  16690. this.showRn();
  16691. }
  16692. showMsg(txt) {
  16693. this.ui.msgNode.txtMsg.text = txt;
  16694. this.ui.msgNode.visible = true;
  16695. this.ui.msgNode.alpha = 1;
  16696. this.ui.visible = true;
  16697. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  16698. this.ui.msgNode.visible = false;
  16699. }), 2500, true);
  16700. }
  16701. showRn() {
  16702. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  16703. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  16704. this.ui.rnNode.rn1.visible = true;
  16705. this.ui.rnNode.rn2.visible = false;
  16706. this.ui.rnNode.rn3.visible = false;
  16707. this.ui.rnNode.rn4.visible = false;
  16708. this.ui.rnNode.visible = true;
  16709. this.ui.mainBg.visible = true;
  16710. this.ui.rnNode.btnDone.visible = false;
  16711. this.ui.rnNode.btnExit.visible = true;
  16712. this.ui.rnNode.btnCheck.visible = true;
  16713. this.ui.fcmNode.visible = false;
  16714. this.ui.visible = true;
  16715. return;
  16716. }
  16717. }
  16718. this.showFcm();
  16719. }
  16720. showFcm() {
  16721. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  16722. Moyu.initFCM(true);
  16723. if (Moyu.gameTime < 1)
  16724. this.fcmLoop();
  16725. else if (Moyu.gameTime < 999)
  16726. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  16727. }
  16728. }
  16729. fcmLoop() {
  16730. if (Moyu.gameTime < 1) {
  16731. this.ui.rnNode.visible = false;
  16732. this.ui.fcmNode.visible = true;
  16733. this.ui.mainBg.visible = true;
  16734. this.ui.visible = true;
  16735. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  16736. Laya.timer.clear(this.ui, this.fcmLoop);
  16737. }
  16738. }
  16739. check() {
  16740. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  16741. this.ui.rnNode.rn1.visible = false;
  16742. this.ui.rnNode.rn2.visible = false;
  16743. this.ui.rnNode.rn4.visible = true;
  16744. }
  16745. else if (this.ui.rnNode.rn4.visible) {
  16746. let name = this.ui.rnNode.inputName.text;
  16747. let code = this.ui.rnNode.inputCode.text;
  16748. if (code && code.length == 18) {
  16749. this.ui.rnNode.rn1.visible = false;
  16750. this.ui.rnNode.rn4.visible = false;
  16751. Moyu.authenticate(name, code, (res) => {
  16752. this.ui.rnNode.rn2.visible = !res;
  16753. this.ui.rnNode.rn3.visible = res;
  16754. this.ui.rnNode.btnDone.visible = res;
  16755. this.ui.rnNode.btnExit.visible = !res;
  16756. this.ui.rnNode.btnCheck.visible = !res;
  16757. if (res)
  16758. this.showFcm();
  16759. });
  16760. }
  16761. else
  16762. this.showMsg("信息填写不完整");
  16763. }
  16764. }
  16765. loadXy(type = 0) {
  16766. this.ui.xyNode.xy1.visible = false;
  16767. this.ui.xyNode.xy2.visible = true;
  16768. this.ui.xyNode.xyList.scrollToView(0);
  16769. if (type == 1) {
  16770. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  16771. }
  16772. else if (type == 2) {
  16773. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  16774. }
  16775. }
  16776. showXy(type = 0) {
  16777. this.xyBtn();
  16778. if (type == 0) {
  16779. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  16780. this.ui.xyNode.btnSure.visible = true;
  16781. }
  16782. else {
  16783. this.ui.xyNode.btnYes.visible = true;
  16784. this.ui.xyNode.btnNo.visible = true;
  16785. }
  16786. }
  16787. else {
  16788. this.ui.xyNode.btnKnown.visible = true;
  16789. this.ui.mainBg.visible = true;
  16790. }
  16791. this.ui.xyNode.xy1.visible = true;
  16792. this.ui.xyNode.xy2.visible = false;
  16793. this.ui.xyNode.visible = true;
  16794. this.ui.visible = true;
  16795. }
  16796. xyBtn() {
  16797. this.ui.xyNode.btnSure.visible = false;
  16798. this.ui.xyNode.btnYes.visible = false;
  16799. this.ui.xyNode.btnNo.visible = false;
  16800. this.ui.xyNode.btnKnown.visible = false;
  16801. {
  16802. this.ui.xyNode.btnXy3.visible = false;
  16803. this.ui.xyNode.btnXy2.visible = true;
  16804. this.ui.xyNode.btnXy1.visible = true;
  16805. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  16806. }
  16807. }
  16808. createXY(json) {
  16809. this.ysJson = json.content;
  16810. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  16811. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  16812. this.ui.xyNode.xy2.visible = true;
  16813. }
  16814. renderListItem(idx, cell) {
  16815. let xy = this.ysJson[idx];
  16816. cell.height = xy.line * 30;
  16817. cell.xyItem.text = xy.text;
  16818. }
  16819. onDestroy() {
  16820. this.agreeCall = null;
  16821. }
  16822. }
  16823. class UILoading extends UIBase {
  16824. constructor() {
  16825. super();
  16826. this.accTime = 0;
  16827. this.curNum = 0;
  16828. this.rate = 1;
  16829. this.loadSubOk = false;
  16830. this.loadResOK = false;
  16831. this.openLoading = true;
  16832. this.beginLoadRes = false;
  16833. this.finishD2 = false;
  16834. this.finishD3 = false;
  16835. }
  16836. onConstructor() {
  16837. this.ui = ui_UILoading.createInstance();
  16838. this.contentPane = this.ui;
  16839. this.isEject = false;
  16840. this._initUI();
  16841. this._addEvent();
  16842. }
  16843. _initUI() {
  16844. MoyuMgr$1.initMoyu();
  16845. }
  16846. _addEvent() {
  16847. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  16848. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  16849. }
  16850. show() {
  16851. super.show();
  16852. console.log('zh:加载分包资源');
  16853. loadSubRes(this.subResProgress.bind(this));
  16854. this.ui.txtLoad.text = "Loading...";
  16855. }
  16856. subResProgress(pro, finish) {
  16857. this.curNum = pro;
  16858. if (finish) {
  16859. this.curNum = 1;
  16860. this.loadSubOk = true;
  16861. }
  16862. }
  16863. laodD3Res() {
  16864. let scene3D = new Laya.Scene3D();
  16865. xGame.common.d3Scene = scene3D;
  16866. xGame.common.d3World = scene3D.addComponent(D3World);
  16867. xGame.common.d3World.loadScene();
  16868. }
  16869. loadD2Res() {
  16870. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  16871. this.finishD2 = true;
  16872. this.checkLoadAll();
  16873. this.curNum = 1;
  16874. }), Laya.Handler.create(this, (pro) => {
  16875. this.curNum = pro;
  16876. }, null, false));
  16877. }
  16878. d3ResFinish() {
  16879. this.finishD3 = true;
  16880. this.checkLoadAll();
  16881. }
  16882. checkLoadAll() {
  16883. if (this.finishD2 && this.finishD3) {
  16884. this.loadResOK = true;
  16885. }
  16886. }
  16887. loadRes() {
  16888. this.laodD3Res();
  16889. this.loadD2Res();
  16890. }
  16891. myUpdate(dt) {
  16892. if (!this.openLoading)
  16893. return;
  16894. this.accTime += dt * this.rate;
  16895. if (this.accTime >= this.curNum)
  16896. this.accTime = this.curNum;
  16897. this.ui.loadinfo.value = this.accTime * 100;
  16898. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  16899. if (!this.beginLoadRes) {
  16900. this.beginLoadRes = true;
  16901. this.ui.txtLoad.text = "Loading...";
  16902. this.curNum = 0;
  16903. this.accTime = 0;
  16904. this.loadRes();
  16905. }
  16906. if (this.loadResOK) {
  16907. this.openLoading = false;
  16908. Laya.timer.once(300, this, () => {
  16909. xGame.common.d3Scene.active = false;
  16910. MoyuMgr$1.showAgree(enterGame);
  16911. });
  16912. }
  16913. }
  16914. }
  16915. release() {
  16916. }
  16917. hide() {
  16918. super.hide();
  16919. this.release();
  16920. }
  16921. onClose() {
  16922. this.hide();
  16923. }
  16924. }
  16925. UILoading.uiName = "UILoading";
  16926. class UIRepentProp$1 extends UIBase {
  16927. constructor() {
  16928. super();
  16929. this.viewType = 0;
  16930. this.regretType = 0;
  16931. }
  16932. onConstructor() {
  16933. this.ui = ui_UIRepentProp.createInstance();
  16934. this.contentPane = this.ui;
  16935. this.isEject = false;
  16936. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  16937. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  16938. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  16939. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  16940. }
  16941. show(viewType, regretType, callback) {
  16942. PlatMgr.showInsert(true);
  16943. this.viewType = viewType;
  16944. this.regretType = regretType;
  16945. this.callback = callback;
  16946. super.show();
  16947. this.ui.t0.play();
  16948. this.ui.c1.selectedIndex = this.viewType;
  16949. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  16950. if (this.viewType == 0) {
  16951. let guide = DataMgr.getGuideHelpLine();
  16952. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  16953. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  16954. }
  16955. xGame.common.gameMgr.gamePause = true;
  16956. }
  16957. hideSelf() {
  16958. xGame.common.gameMgr.gamePause = false;
  16959. this.callback && this.callback(false);
  16960. this.hide();
  16961. }
  16962. videoRegret() {
  16963. Moyu.showVideoAd(() => {
  16964. this.callback && this.callback(true);
  16965. this.hideSelf();
  16966. }, EAdType.regretBall);
  16967. }
  16968. videoAddHelpLine() {
  16969. let guide = DataMgr.getGuideHelpLine();
  16970. if (guide == 0) {
  16971. this.callback && this.callback(true);
  16972. this.hideSelf();
  16973. DataMgr.setGuideHelpLine();
  16974. xGame.common.gameUI.ui.guideNode.visible = false;
  16975. }
  16976. else {
  16977. Moyu.showVideoAd(() => {
  16978. this.callback && this.callback(true);
  16979. this.hideSelf();
  16980. }, EAdType.longHelpLine);
  16981. }
  16982. }
  16983. }
  16984. UIRepentProp$1.uiName = "UIRepentProp";
  16985. class UIRodMethod$1 extends UIBase {
  16986. constructor() {
  16987. super();
  16988. this.isPressd = false;
  16989. }
  16990. onConstructor() {
  16991. this.ui = ui_UIRodMethod.createInstance();
  16992. this.contentPane = this.ui;
  16993. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  16994. this.moveDir = new Laya.Vector2();
  16995. this.moveDest = new Laya.Vector2();
  16996. this.centerPos = new Laya.Vector2();
  16997. xGame.common.uiRodMethod = this;
  16998. }
  16999. show() {
  17000. super.show();
  17001. xGame.common.gameMgr.gamePause = true;
  17002. this.openPressDotEvent();
  17003. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  17004. this.centerPos.x = this.ui.white.x;
  17005. this.centerPos.y = this.ui.white.y;
  17006. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  17007. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  17008. this.setDot();
  17009. }
  17010. setDot() {
  17011. this.ui.dot.x = this.moveDest.x;
  17012. this.ui.dot.y = this.moveDest.y;
  17013. }
  17014. closeSelf() {
  17015. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  17016. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  17017. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  17018. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  17019. xGame.common.gameMgr.gamePause = false;
  17020. this.hide();
  17021. }
  17022. openPressDotEvent() {
  17023. this.closePressDotEvent();
  17024. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17025. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17026. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17027. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17028. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17029. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17030. }
  17031. closePressDotEvent() {
  17032. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17033. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17034. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17035. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17036. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17037. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17038. }
  17039. onDown(e) {
  17040. if (e.type == Laya.Event.MOUSE_DOWN)
  17041. this.isPressd = true;
  17042. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  17043. this.isPressd = false;
  17044. if (!this.isPressd)
  17045. return;
  17046. this.moveDest.x = e.stageX;
  17047. this.moveDest.y = e.stageY;
  17048. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  17049. if (dis > 6724) {
  17050. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  17051. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  17052. }
  17053. this.setDot();
  17054. }
  17055. resetRod() {
  17056. this.ui.dot.x = this.ui.white.x;
  17057. this.ui.dot.y = this.ui.white.y;
  17058. this.gameRod.dot.x = this.gameRod.bg.x;
  17059. this.gameRod.dot.y = this.gameRod.bg.y;
  17060. xGame.common.rodOffest.x = 0;
  17061. xGame.common.rodOffest.y = 0;
  17062. }
  17063. }
  17064. UIRodMethod$1.uiName = "UIRodMethod";
  17065. class UIMsg$1 extends UIBase {
  17066. constructor() {
  17067. super();
  17068. }
  17069. onConstructor() {
  17070. this.ui = ui_UIMsg.createInstance();
  17071. this.contentPane = this.ui;
  17072. this.isEject = false;
  17073. this.isMuti = true;
  17074. }
  17075. show(msg, callback) {
  17076. super.show();
  17077. this.ui.tipsNode.msgTxt.text = msg;
  17078. this.ui.alpha = 1;
  17079. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  17080. this.hide();
  17081. callback && callback();
  17082. }), 1000);
  17083. }
  17084. }
  17085. UIMsg$1.uiName = "UIMsg";
  17086. class UITips$1 extends UIBase {
  17087. constructor() {
  17088. super();
  17089. this.type = 0;
  17090. }
  17091. onConstructor() {
  17092. this.ui = ui_UITips.createInstance();
  17093. this.contentPane = this.ui;
  17094. this.isEject = false;
  17095. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  17096. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  17097. }
  17098. show(tipsTxt, womanTxt, type) {
  17099. super.show();
  17100. this.ui.t0.play();
  17101. this.ui.myNode.tipsTxt.text = tipsTxt;
  17102. this.ui.myNode.womanTxt.text = womanTxt;
  17103. PlatMgr.showInsert(true);
  17104. this.ui.myNode.c1.selectedIndex = type;
  17105. this.type = type;
  17106. switch (this.type) {
  17107. case TipsType.exitGame:
  17108. xGame.common.gameMgr.gamePause = true;
  17109. break;
  17110. case TipsType.foul:
  17111. Laya.timer.once(200, this, () => {
  17112. xGame.common.gameMgr.gamePause = true;
  17113. });
  17114. break;
  17115. default:
  17116. break;
  17117. }
  17118. }
  17119. clickLeftBtn() {
  17120. this.hide();
  17121. xGame.common.gameMgr.gamePause = false;
  17122. switch (this.type) {
  17123. case TipsType.exitGame:
  17124. break;
  17125. case TipsType.foul:
  17126. break;
  17127. default:
  17128. break;
  17129. }
  17130. }
  17131. clickRightBtn() {
  17132. this.hide();
  17133. switch (this.type) {
  17134. case TipsType.exitGame:
  17135. xGame.eventMgr.event(RESET_GAME);
  17136. xGame.uiMgr.Show(UIMain$1);
  17137. Moyu.recordEnd(this, null);
  17138. xGame.common.longHelpLine = false;
  17139. break;
  17140. case TipsType.foul:
  17141. xGame.common.gameMgr.gamePause = false;
  17142. Laya.timer.clearAll(this);
  17143. break;
  17144. default:
  17145. break;
  17146. }
  17147. }
  17148. }
  17149. UITips$1.uiName = "UITips";
  17150. class UIGame$1 extends UIBase {
  17151. constructor() {
  17152. super();
  17153. this.powerNum = 0;
  17154. this.isD3Inited = false;
  17155. this.isPrePlay = false;
  17156. this.isMoveRod = false;
  17157. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  17158. this.rulerDis = 20;
  17159. this.rulerOffset = 0;
  17160. }
  17161. onConstructor() {
  17162. this.ui = ui_UIGame.createInstance();
  17163. this.contentPane = this.ui;
  17164. this.ui.x += xGame.common.sysOffestNum;
  17165. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  17166. this.isEject = false;
  17167. xGame.common.gameUI = this;
  17168. this.initSelf();
  17169. }
  17170. isTurnSelf() {
  17171. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  17172. return true;
  17173. }
  17174. }
  17175. initSelf() {
  17176. let topUI = this.ui.topNode;
  17177. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  17178. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  17179. this.barInfo = {};
  17180. this.barInfo.curY = 0;
  17181. this.barInfo.height = this.ui.powerNode.height;
  17182. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  17183. this.barInfo.powerStartY = this.ui.powerNode.y;
  17184. xGame.common.aiPlayer = new AIPlayer();
  17185. xGame.common.gameMgr = new GameMgr();
  17186. xGame.common.skillMgr = new SkillMgr();
  17187. xGame.common.wordsMgr = new WordsMgr();
  17188. xGame.common.talkMgr = new TalkMgr();
  17189. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  17190. console.log("加载经典模式表情文件chenggon !");
  17191. });
  17192. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  17193. console.log("挑战模式奖励模式spine加载成功!");
  17194. });
  17195. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  17196. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  17197. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  17198. this.addUIClick(this.ui.returnBtn, this.returnHome);
  17199. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  17200. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  17201. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  17202. }
  17203. returnHome() {
  17204. let tips = "Are you sure to exit the game?";
  17205. let woman = "Boss, why don't you play for a while longer?";
  17206. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  17207. }
  17208. addRodMethodClick() {
  17209. if (this.isTurnSelf()) {
  17210. xGame.uiMgr.Show(UIRodMethod$1);
  17211. }
  17212. }
  17213. clickHelpLineBtn(force = false) {
  17214. if (!this.isTurnSelf())
  17215. return;
  17216. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  17217. if (success) {
  17218. xGame.common.longHelpLine = true;
  17219. xGame.common.d2World.getHelpLine();
  17220. Moyu.sendDataEvent("guideNum");
  17221. }
  17222. else {
  17223. }
  17224. });
  17225. }
  17226. renderSelfDisplayBalls(index, target) {
  17227. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  17228. target.myImg.url = xGame.common.getGameIconUrl(str);
  17229. }
  17230. renderAIDisplayBalls(index, target) {
  17231. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  17232. target.myImg.url = xGame.common.getGameIconUrl(str);
  17233. ;
  17234. }
  17235. updateMode() {
  17236. if (xGame.common.gameMode == GameMode.classic) {
  17237. this.ui.topNode.scoreNode.visible = false;
  17238. }
  17239. else if (xGame.common.gameMode == GameMode.bigMove) {
  17240. this.ui.topNode.scoreNode.visible = true;
  17241. }
  17242. }
  17243. show() {
  17244. super.show();
  17245. console.log("zh:uigame show");
  17246. this.ui.alpha = 0;
  17247. this.updateSelf();
  17248. console.log("zh:uigame bf gamemusic01 start");
  17249. xGame.soundMgr.playMusic("gamemusic01");
  17250. console.log("zh:uigame bf gamemusic01 end");
  17251. xGame.common.gameMgr.gamePause = false;
  17252. xGame.common.gameUI.ui.blackAni.visible = false;
  17253. xGame.common.gameUI.ui.whiteAni.visible = false;
  17254. this.ui.powerEft.visible = false;
  17255. this.ui.colorNode.visible = false;
  17256. this.updateHead();
  17257. }
  17258. updateSelf() {
  17259. if (xGame.common.gameMode == GameMode.classic) {
  17260. this.ui.c1.selectedIndex = 0;
  17261. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  17262. this.ui.topNode.middleNode.visible = true;
  17263. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  17264. }
  17265. else if (xGame.common.gameMode == GameMode.bigMove) {
  17266. this.ui.c1.selectedIndex = 0;
  17267. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  17268. this.ui.topNode.middleNode.visible = false;
  17269. let max = xGame.cfgMgr.getMaxBigMoveLength();
  17270. let rand = xGame.common.randomNum(1, max);
  17271. let guide = DataMgr.getSkillGuide();
  17272. if (guide == 0)
  17273. rand = 1;
  17274. xGame.common.bigMoveLevelIndex = rand;
  17275. }
  17276. else if (xGame.common.gameMode == GameMode.placeBall) {
  17277. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  17278. this.ui.c1.selectedIndex = 1 + data.type;
  17279. this.ui.alpha = 1;
  17280. this.startGame();
  17281. }
  17282. this.updateMode();
  17283. this.initD3world();
  17284. this.initD2world();
  17285. }
  17286. startGame() {
  17287. this.ui.snowNode.visible = Math.random() <= 0.1;
  17288. this.ui.d2Node.visible = false;
  17289. xGame.common.d3World.d3Hand.gameObj.active = false;
  17290. xGame.common.d3World.tableSrc.init();
  17291. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  17292. this.cameraViewChange(() => {
  17293. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  17294. switch (xGame.common.gameMode) {
  17295. case GameMode.classic:
  17296. xGame.common.d3World.d3Hand.gameObj.active = true;
  17297. this.playPutBallD3Ani();
  17298. break;
  17299. case GameMode.bigMove:
  17300. this.enterGame();
  17301. Laya.timer.once(500, this, () => {
  17302. this.ui.topNode.middleNode.visible = true;
  17303. this.ui.topNode.middleNode.t0.play();
  17304. });
  17305. break;
  17306. case GameMode.placeBall:
  17307. this.enterGame();
  17308. break;
  17309. default:
  17310. break;
  17311. }
  17312. });
  17313. PlatMgr.showBanner(false);
  17314. }
  17315. enterGame() {
  17316. this.ui.d2Node.visible = true;
  17317. xGame.common.d3World.d3Hand.gameObj.active = false;
  17318. xGame.common.showOneCamera("mainCamera");
  17319. Moyu.recordGame(30, true);
  17320. if (!this.isPrePlay) {
  17321. this.isPrePlay = true;
  17322. xGame.common.d3World.prePlayEft();
  17323. }
  17324. xGame.common.gameMgr.gameReady();
  17325. this.openAllEvent();
  17326. this.ui.snowNode.visible = false;
  17327. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  17328. this.ui.helpBtn.visible = condition;
  17329. }
  17330. showHelpLineGuide() {
  17331. let longGuide = DataMgr.getGuideHelpLine();
  17332. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  17333. this.ui.helpBtn.visible = true;
  17334. this.ui.guideNode.visible = true;
  17335. }
  17336. }
  17337. setTurnAlpha(alpha) {
  17338. this.ui.keduNode.alpha = alpha;
  17339. this.ui.ganNode.alpha = alpha;
  17340. this.ui.rodMethodNode.alpha = alpha;
  17341. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  17342. }
  17343. cameraViewChange(callback) {
  17344. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  17345. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  17346. xGame.common.showOneCamera("visitAngle");
  17347. cameraSrc.localRotationEulerY = 180;
  17348. cameraSrc.localRotationEulerZ = 0;
  17349. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  17350. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  17351. callback && callback();
  17352. }));
  17353. }));
  17354. }
  17355. playPutBallD3Ani() {
  17356. xGame.common.showOneCamera("mainCamera");
  17357. let handSrc = xGame.common.d3World.d3Hand;
  17358. handSrc.gameObj.active = true;
  17359. handSrc.transform.localPositionZ = 3;
  17360. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  17361. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  17362. handSrc.gameObj.active = false;
  17363. this.enterGame();
  17364. }), 400);
  17365. }));
  17366. }
  17367. updateHead() {
  17368. let user = Moyu.getUserInfo();
  17369. this.ui.topNode.selfNameTxt.text = user.nickName;
  17370. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  17371. let aiData = xGame.cfgMgr.getRandomUserInfo();
  17372. if (DataMgr.getSkillGuide() < 1) {
  17373. this.ui.topNode.aiNameTxt.text = 'billiards';
  17374. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  17375. }
  17376. else {
  17377. this.ui.topNode.aiNameTxt.text = aiData.name;
  17378. this.ui.topNode.aiHeadLoader.url = baseHeadUrl + aiData.icon;
  17379. }
  17380. }
  17381. initD2world() {
  17382. let node = this.ui.d2Root.displayObject;
  17383. let src = node.getComponent(D2World);
  17384. if (!src) {
  17385. xGame.common.d2World = node.addComponent(D2World);
  17386. }
  17387. xGame.common.d2World.initSelf();
  17388. }
  17389. initD3world() {
  17390. if (this.isD3Inited)
  17391. return;
  17392. this.isD3Inited = true;
  17393. let scene3D = xGame.common.d3Scene;
  17394. this.ui.d3Root.displayObject.addChild(scene3D);
  17395. scene3D.active = true;
  17396. xGame.common.d3World.tableSrc.setBorderPos();
  17397. }
  17398. onRootMove(e) {
  17399. let rootBall = xGame.common.d2World.rootBall;
  17400. this.ui.moveNode.x = e.x;
  17401. this.ui.moveNode.y = e.y;
  17402. rootBall.gameObj.x = e.x;
  17403. rootBall.gameObj.y = e.y;
  17404. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  17405. }
  17406. aiRootMove(move) {
  17407. if (move)
  17408. this.hideBallUI();
  17409. else {
  17410. this.showBallUI();
  17411. xGame.common.d2World.getHelpLine();
  17412. }
  17413. }
  17414. aiForce(type, force = 0) {
  17415. this.pressTarget = PressType.powerNode;
  17416. if (type == 1)
  17417. this.onEventUp({ force: true });
  17418. else if (type == 2)
  17419. this.onEventMove({ stageY: force, force: true });
  17420. }
  17421. onEventPress(e) {
  17422. if (e.stopPropagation)
  17423. e.stopPropagation();
  17424. if (!this.isTurnSelf())
  17425. return;
  17426. let target = e.target;
  17427. switch (target) {
  17428. case this.ui.myPowerNode.displayObject:
  17429. this.pressTarget = PressType.powerNode;
  17430. this.barInfo.curY = e.stageY;
  17431. this.updateBarInfo();
  17432. break;
  17433. case this.ui.moveNode.displayObject:
  17434. this.pressTarget = PressType.moveNode;
  17435. this.hideBallUI();
  17436. this.eventObj.curX = this.ui.moveNode.x;
  17437. this.eventObj.curY = this.ui.moveNode.y;
  17438. this.ui.moveNode.finger.visible = false;
  17439. this.eventObj.lastX = e.stageX;
  17440. this.eventObj.lastY = e.stageY;
  17441. break;
  17442. case this.ui.rulerClickNode.displayObject:
  17443. this.pressTarget = PressType.rulerNode;
  17444. this.eventObj.lastY = e.stageY;
  17445. break;
  17446. case this.ui.d2Root.displayObject:
  17447. this.pressTarget = PressType.d2Root;
  17448. this.eventObj.lastX = e.stageX;
  17449. this.eventObj.lastY = e.stageY;
  17450. this.eventObj.starX = e.stageX;
  17451. this.eventObj.starY = e.stageY;
  17452. this.eventObj.curX = 0;
  17453. this.eventObj.curY = 0;
  17454. xGame.common.d2World.d2Gan.setGanLastInfo();
  17455. this.rulerOffset = 0;
  17456. break;
  17457. default:
  17458. break;
  17459. }
  17460. }
  17461. onEventMove(e) {
  17462. if (e.stopPropagation)
  17463. e.stopPropagation();
  17464. if (e && e.force) {
  17465. }
  17466. else {
  17467. if (!this.isTurnSelf())
  17468. return;
  17469. }
  17470. switch (this.pressTarget) {
  17471. case PressType.powerNode:
  17472. this.barInfo.curY = e.stageY;
  17473. this.updateBarInfo();
  17474. this.isMoveRod = true;
  17475. break;
  17476. case PressType.moveNode:
  17477. let rootBall = xGame.common.d2World.rootBall;
  17478. let radius = rootBall.gameObj.width / 2;
  17479. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  17480. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  17481. let border = xGame.common.d2World.borderRect;
  17482. if (curX <= border.x + radius)
  17483. curX = border.x + radius;
  17484. else if (curX >= border.x + border.width - radius)
  17485. curX = border.x + border.width - radius;
  17486. if (curY <= border.y + radius)
  17487. curY = border.y + radius;
  17488. else if (curY >= border.y + border.height - radius)
  17489. curY = border.y + border.height - radius;
  17490. if (xGame.common.gameMgr.isOpenBall) {
  17491. if (curX >= border.x + border.openBallW - radius)
  17492. curX = border.x + border.openBallW - radius;
  17493. }
  17494. this.ui.moveNode.x = curX;
  17495. this.ui.moveNode.y = curY;
  17496. rootBall.gameObj.x = curX;
  17497. rootBall.gameObj.y = curY;
  17498. rootBall.d3BallSrc.setTransPos(curX, curY);
  17499. this.isMoveRod = true;
  17500. break;
  17501. case PressType.rulerNode:
  17502. let yy = e.stageY - this.eventObj.lastY;
  17503. this.eventObj.lastY = e.stageY;
  17504. let ruler1 = this.ui.rulerNode.img1;
  17505. let ruler2 = this.ui.rulerNode.img2;
  17506. ruler1.y += yy;
  17507. ruler2.y += yy;
  17508. this.rulerOffset += yy;
  17509. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  17510. this.rulerOffset = 0;
  17511. xGame.soundMgr.playSound("inch", 1, 10);
  17512. }
  17513. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  17514. let h = ruler1.height;
  17515. this.checkGuide();
  17516. this.isMoveRod = true;
  17517. if (ruler1.y >= h) {
  17518. ruler1.y = -h;
  17519. ruler2.y = 0;
  17520. return;
  17521. }
  17522. else if (ruler1.y <= -h) {
  17523. ruler1.y = h;
  17524. ruler2.y = 0;
  17525. return;
  17526. }
  17527. if (ruler2.y >= h) {
  17528. ruler2.y = -h;
  17529. ruler1.y = 0;
  17530. return;
  17531. }
  17532. else if (ruler2.y <= -h) {
  17533. ruler2.y = h;
  17534. ruler1.y = 0;
  17535. return;
  17536. }
  17537. break;
  17538. case PressType.d2Root:
  17539. this.eventObj.curX = e.stageX;
  17540. this.eventObj.curY = e.stageY;
  17541. let offset = this.checkRodMoveDir();
  17542. xGame.common.d2World.d2Gan.rotateSelf(offset);
  17543. this.eventObj.lastX = e.stageX;
  17544. this.eventObj.lastY = e.stageY;
  17545. break;
  17546. default:
  17547. break;
  17548. }
  17549. }
  17550. onEventUp(e) {
  17551. if (e.stopPropagation)
  17552. e.stopPropagation();
  17553. if (e && e.force) {
  17554. }
  17555. else {
  17556. if (!this.isTurnSelf())
  17557. return;
  17558. }
  17559. switch (this.pressTarget) {
  17560. case PressType.powerNode:
  17561. this.ui.powerNode.value = 0;
  17562. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  17563. this.ui.powerTxt.text = "";
  17564. if (this.powerNum > 0) {
  17565. xGame.eventMgr.event(BALL_SHOOT);
  17566. xGame.common.d2World.shoot(this.powerNum);
  17567. xGame.common.d2World.d2Gan.shoot();
  17568. xGame.common.d2World.d2HelpLine.shoot();
  17569. this.finishGuide();
  17570. this.ui.powerEft.visible = false;
  17571. this.ui.colorNode.visible = false;
  17572. let ganStr = "";
  17573. if (this.powerNum <= 30) {
  17574. ganStr = "gan_30";
  17575. }
  17576. else if (this.powerNum <= 60) {
  17577. ganStr = "gan_50";
  17578. }
  17579. else {
  17580. ganStr = "gan_80";
  17581. }
  17582. xGame.soundMgr.playSound(ganStr);
  17583. }
  17584. break;
  17585. case PressType.moveNode:
  17586. let rootBall = xGame.common.d2World.rootBall;
  17587. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  17588. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  17589. let isIntersect = this.judgeBallIntersect();
  17590. if (isIntersect) {
  17591. this.ui.moveNode.x = lastX;
  17592. this.ui.moveNode.y = lastY;
  17593. rootBall.gameObj.x = lastX;
  17594. rootBall.gameObj.y = lastY;
  17595. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  17596. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  17597. }
  17598. else {
  17599. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  17600. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  17601. }
  17602. this.showBallUI();
  17603. this.ui.moveNode.finger.visible = true;
  17604. xGame.common.d2World.getHelpLine();
  17605. break;
  17606. case PressType.rulerNode:
  17607. break;
  17608. case PressType.d2Root:
  17609. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  17610. if (dis <= 25) {
  17611. this.moveToClickDot(e);
  17612. }
  17613. break;
  17614. default:
  17615. break;
  17616. }
  17617. this.pressTarget = -1;
  17618. }
  17619. checkGuide() {
  17620. let guide = DataMgr.getSkillGuide();
  17621. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  17622. xGame.common.guideStep++;
  17623. xGame.common.gameUI.ui.guide2.visible = false;
  17624. xGame.common.gameUI.ui.guide3.visible = true;
  17625. }
  17626. }
  17627. finishGuide() {
  17628. let guide = DataMgr.getSkillGuide();
  17629. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  17630. xGame.common.guideStep = 10;
  17631. this.closeAllGuide();
  17632. }
  17633. }
  17634. closeAllGuide() {
  17635. xGame.common.gameUI.ui.guide1.visible = false;
  17636. xGame.common.gameUI.ui.guide2.visible = false;
  17637. xGame.common.gameUI.ui.guide3.visible = false;
  17638. }
  17639. updateBarInfo() {
  17640. let star = this.ui.powerNode.y;
  17641. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  17642. if (rate >= 1)
  17643. rate = 1;
  17644. if (rate <= 0)
  17645. rate = 0;
  17646. this.powerNum = Math.ceil(rate * 100);
  17647. this.ui.powerNode.value = this.powerNum;
  17648. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  17649. this.ui.colorNode.value = this.powerNum;
  17650. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  17651. this.ui.powerEft.visible = this.powerNum != 0;
  17652. this.ui.colorNode.visible = this.powerNum != 0;
  17653. this.ui.powerTxt.text = this.powerNum + "";
  17654. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  17655. }
  17656. forceCancel() {
  17657. this.ui.powerNode.value = 0;
  17658. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  17659. this.ui.powerTxt.text = "";
  17660. }
  17661. checkRodMoveDir() {
  17662. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  17663. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  17664. if (tempX >= 0 && tempY <= 0) {
  17665. return this.checkDir();
  17666. }
  17667. else if (tempX < 0 && tempY < 0) {
  17668. return this.checkDir(1, -1);
  17669. }
  17670. else if (tempX < 0 && tempY > 0) {
  17671. return this.checkDir(-1, -1);
  17672. }
  17673. else {
  17674. return this.checkDir(-1, 1);
  17675. }
  17676. }
  17677. checkDir(flagX = 1, flagY = 1) {
  17678. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  17679. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  17680. if (offsetY == 0) {
  17681. return offsetX * flagX;
  17682. }
  17683. if (offsetX == 0) {
  17684. return offsetY * flagY;
  17685. }
  17686. let angle = offsetY / offsetX;
  17687. if (Math.abs(angle) >= 1) {
  17688. return offsetY * flagY;
  17689. }
  17690. else {
  17691. return offsetX * flagX;
  17692. }
  17693. }
  17694. judgeBallIntersect() {
  17695. let rootBall = xGame.common.d2World.rootBall;
  17696. let ballArr = xGame.common.d2World.ballArr;
  17697. let radius = rootBall.gameObj.width / 2;
  17698. let temp;
  17699. let isIntersect = false;
  17700. for (let index = 0; index < ballArr.length; index++) {
  17701. temp = ballArr[index];
  17702. if (temp.number == rootBall.number)
  17703. continue;
  17704. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  17705. if (isIntersect) {
  17706. break;
  17707. }
  17708. }
  17709. return isIntersect;
  17710. }
  17711. hideBallUI() {
  17712. let d2Gan = xGame.common.d2World.d2Gan;
  17713. if (!d2Gan.ui.isDisposed)
  17714. d2Gan.ui.visible = false;
  17715. let d2Help = xGame.common.d2World.d2HelpLine;
  17716. if (!d2Help.ui.isDisposed)
  17717. d2Help.ui.visible = false;
  17718. let rootBall = xGame.common.d2World.rootBall;
  17719. if (!rootBall.destroyed) {
  17720. rootBall.gameObj.active = false;
  17721. }
  17722. }
  17723. showBallUI() {
  17724. let d2Gan = xGame.common.d2World.d2Gan;
  17725. if (!d2Gan.ui.isDisposed)
  17726. d2Gan.ui.visible = true;
  17727. let d2Help = xGame.common.d2World.d2HelpLine;
  17728. if (!d2Help.ui.isDisposed)
  17729. d2Help.ui.visible = true;
  17730. let rootBall = xGame.common.d2World.rootBall;
  17731. if (!rootBall.destroyed) {
  17732. rootBall.gameObj.active = true;
  17733. }
  17734. }
  17735. moveToClickDot(e) {
  17736. if (!this.isMoveRod && !xGame.common.clickedBall) {
  17737. let root = xGame.common.d2World.rootBall.gameObj;
  17738. let xx = e.stageX - xGame.common.sysOffestNum;
  17739. let yy = e.stageY;
  17740. let x = xx - root.x;
  17741. let y = yy - root.y;
  17742. let angle = xGame.common.getfguiRotation(x, y);
  17743. xGame.common.d2World.d2Gan.ui.rotation = angle;
  17744. xGame.common.d2World.getHelpLine();
  17745. }
  17746. this.isMoveRod = false;
  17747. xGame.common.clickedBall = false;
  17748. }
  17749. openAllEvent() {
  17750. this.closeAllEvent();
  17751. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17752. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17753. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17754. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17755. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  17756. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  17757. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  17758. }
  17759. closeAllEvent() {
  17760. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17761. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17762. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17763. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17764. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  17765. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  17766. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  17767. }
  17768. resetGame() {
  17769. this.closeAllEvent();
  17770. this.hideBallUI();
  17771. xGame.common.gameMgr.gamePause = true;
  17772. }
  17773. }
  17774. UIGame$1.uiName = "UIGame";
  17775. class UIAddCoin$1 extends UIBase {
  17776. constructor() {
  17777. super();
  17778. this.coinNum = 2000;
  17779. }
  17780. onConstructor() {
  17781. this.ui = ui_UIAddCoin.createInstance();
  17782. this.contentPane = this.ui;
  17783. this.isEject = false;
  17784. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  17785. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  17786. }
  17787. show() {
  17788. super.show();
  17789. this.ui.t0.play();
  17790. }
  17791. videoAddCoin() {
  17792. Moyu.showVideoAd(() => {
  17793. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  17794. this.hide();
  17795. }, EAdType.addFailCoin);
  17796. }
  17797. }
  17798. UIAddCoin$1.uiName = "UIAddCoin";
  17799. class UIInvitation$1 extends UIBase {
  17800. constructor() {
  17801. super();
  17802. }
  17803. onConstructor() {
  17804. this.ui = ui_UIInvitation.createInstance();
  17805. this.contentPane = this.ui;
  17806. this.isEject = false;
  17807. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  17808. }
  17809. show() {
  17810. super.show();
  17811. }
  17812. enterGame() {
  17813. xGame.common.gameMode = GameMode.classic;
  17814. DataMgr.setChallengeTimes(1);
  17815. xGame.common.passAwardCoin = 2000;
  17816. let need = xGame.common.classicNiceNeddCoin;
  17817. if (DataMgr.coinEnough(need)) {
  17818. DataMgr.setCoin(-need);
  17819. xGame.eventMgr.event(RESTART_GAME, true);
  17820. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  17821. }
  17822. else {
  17823. xGame.eventMgr.event(RESTART_GAME, true);
  17824. }
  17825. this.hide();
  17826. }
  17827. hide() {
  17828. super.hide();
  17829. }
  17830. }
  17831. UIInvitation$1.uiName = "UIInvitation";
  17832. class UIPower$1 extends UIBase {
  17833. constructor() {
  17834. super();
  17835. }
  17836. onConstructor() {
  17837. this.ui = ui_UIPower.createInstance();
  17838. this.contentPane = this.ui;
  17839. this.isEject = false;
  17840. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  17841. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  17842. }
  17843. show() {
  17844. super.show();
  17845. this.ui.t0.play();
  17846. }
  17847. videoGetPower() {
  17848. Moyu.showVideoAd(() => {
  17849. DataMgr.setPower(xGame.common.videoPower, true);
  17850. xGame.eventMgr.event(POWER_TIME);
  17851. this.hide();
  17852. }, EAdType.getPower);
  17853. }
  17854. }
  17855. UIPower$1.uiName = "UIPower";
  17856. class UIGameEnd$1 extends UIBase {
  17857. constructor() {
  17858. super();
  17859. this.success = false;
  17860. this.awardCoinNum = 1000;
  17861. this.awardDiamondNum = 10;
  17862. }
  17863. onConstructor() {
  17864. this.ui = ui_UIGameEnd.createInstance();
  17865. this.contentPane = this.ui;
  17866. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  17867. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  17868. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  17869. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  17870. this.ui.talkNode.visible = false;
  17871. if (Moyu.isKs)
  17872. this.ui.closeNode.closeBtn.x += 100;
  17873. }
  17874. updateType() {
  17875. switch (xGame.common.gameMode) {
  17876. case GameMode.classic:
  17877. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  17878. this.ui.coinNode.visible = this.success;
  17879. if (!this.success) {
  17880. Laya.timer.once(500, this, () => {
  17881. xGame.uiMgr.Show(UIAddCoin$1);
  17882. });
  17883. }
  17884. this.ui.isGetAward.visible = false;
  17885. this.ui.leftBtn.c1.selectedIndex = 3;
  17886. this.ui.rightBtn.c1.selectedIndex = 0;
  17887. this.moneyNode.ui.c1.selectedIndex = 1;
  17888. break;
  17889. case GameMode.bigMove:
  17890. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  17891. this.ui.coinNode.visible = this.success;
  17892. if (xGame.common.gameMode == GameMode.bigMove) {
  17893. if (this.success) {
  17894. DataMgr.setSkillSuccessTimes(1, true);
  17895. DataMgr.setSkillAccTimes(1);
  17896. }
  17897. else {
  17898. DataMgr.setSkillSuccessTimes(0, false);
  17899. }
  17900. }
  17901. if (!this.success) {
  17902. Laya.timer.once(500, this, () => {
  17903. xGame.uiMgr.Show(UIAddCoin$1);
  17904. });
  17905. }
  17906. this.ui.isGetAward.visible = false;
  17907. this.ui.leftBtn.c1.selectedIndex = 3;
  17908. this.ui.rightBtn.c1.selectedIndex = 0;
  17909. this.moneyNode.ui.c1.selectedIndex = 1;
  17910. break;
  17911. case GameMode.placeBall:
  17912. this.ui.coinNode.visible = false;
  17913. if (this.success) {
  17914. if (xGame.common.placeBallStarNum == 3) {
  17915. this.ui.c1.selectedIndex = 2;
  17916. }
  17917. else {
  17918. this.ui.c1.selectedIndex = 3;
  17919. }
  17920. }
  17921. else {
  17922. this.ui.c1.selectedIndex = 4;
  17923. }
  17924. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  17925. if (cfg.type == PlaceBallType.challenge) {
  17926. this.ui.c1.selectedIndex = 2;
  17927. }
  17928. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `打进场上所有球` : `打进${cfg.ball}颗球`;
  17929. this.updatePlaceBallBtn();
  17930. this.updatePlaceBallStarNum();
  17931. this.updatePlaceBallAwardState();
  17932. this.moneyNode.ui.c1.selectedIndex = 2;
  17933. this.moneyNode.checkPowerTime();
  17934. this.moneyNode.powerChange();
  17935. DataMgr.upRankData();
  17936. break;
  17937. default:
  17938. break;
  17939. }
  17940. }
  17941. updatePlaceBallBtn() {
  17942. this.ui.leftBtn.c1.selectedIndex = 5;
  17943. if (this.success) {
  17944. this.ui.rightBtn.c1.selectedIndex = 14;
  17945. }
  17946. else {
  17947. if (xGame.common.placeBallStarNum == 3) {
  17948. this.ui.rightBtn.c1.selectedIndex = 14;
  17949. }
  17950. else {
  17951. this.ui.rightBtn.c1.selectedIndex = 1;
  17952. }
  17953. }
  17954. }
  17955. updatePlaceBallStarNum() {
  17956. let starNum = xGame.common.placeBallStarNum;
  17957. if (starNum == 0)
  17958. this.ui.starNumNode.c1.selectedIndex = 3;
  17959. else {
  17960. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  17961. }
  17962. }
  17963. updatePlaceBallAwardState() {
  17964. let level = xGame.common.placeBallCurLevel;
  17965. let starNum = xGame.common.placeBallStarNum;
  17966. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  17967. let data = cfgTable.placeballData[level].award;
  17968. let cfg = cfgTable.placeballData[level];
  17969. this.awardDiamondNum = data[1];
  17970. this.awardCoinNum = data[0];
  17971. if (cfg.type == PlaceBallType.challenge) {
  17972. this.awardDiamondNum = 0;
  17973. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  17974. }
  17975. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  17976. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  17977. if (cfg.type == PlaceBallType.challenge) {
  17978. this.ui.awardNode.coinNode.visible = true;
  17979. }
  17980. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  17981. this.ui.awardNode.diamondNode.x = 265;
  17982. this.ui.awardNode.coinNode.x = 354;
  17983. }
  17984. else {
  17985. this.ui.awardNode.diamondNode.x = 291;
  17986. this.ui.awardNode.coinNode.x = 291;
  17987. }
  17988. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  17989. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  17990. if (this.awardCoinNum == 0) {
  17991. this.ui.awardNode.coinNode.numTxt.text = "";
  17992. }
  17993. if (getAward) {
  17994. this.ui.isGetAward.visible = true;
  17995. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  17996. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  17997. }
  17998. else {
  17999. this.ui.isGetAward.visible = false;
  18000. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  18001. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  18002. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  18003. }
  18004. else {
  18005. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  18006. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  18007. }
  18008. }
  18009. }
  18010. show(success) {
  18011. super.show();
  18012. xGame.eventMgr.event(RESET_GAME);
  18013. this.success = success;
  18014. Laya.timer.clearAll(this);
  18015. this.playSecretaryAni();
  18016. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  18017. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  18018. offsetTime = Math.floor(offsetTime / 1000);
  18019. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  18020. this.updateType();
  18021. Laya.timer.once(200, this, () => {
  18022. this.addAward(() => {
  18023. this.updateType();
  18024. Laya.timer.once(500, this, () => {
  18025. this.showChallengeLevel();
  18026. });
  18027. });
  18028. });
  18029. if (this.success) {
  18030. xGame.soundMgr.playSound('slots_roll01');
  18031. xGame.soundMgr.playSound("s_win");
  18032. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18033. }
  18034. else {
  18035. xGame.soundMgr.playSound('matchwin01');
  18036. xGame.soundMgr.playSound("s_lose");
  18037. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18038. }
  18039. if (!Moyu.isLegal)
  18040. PlatMgr.showBanner(true);
  18041. let challengeNum = DataMgr.getChallengeTimes();
  18042. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  18043. DataMgr.setChallengeTimes(1);
  18044. }
  18045. if (this.success && xGame.common.gameMode == GameMode.classic) {
  18046. DataMgr.setClassicTimes();
  18047. }
  18048. }
  18049. showChallengeLevel() {
  18050. if (DataMgr.getChallengeTimes() != 0)
  18051. return;
  18052. let skill = DataMgr.getSkillAccTimes();
  18053. let put = DataMgr.getPlaceBallLevelList().length;
  18054. if (skill >= 3 || put >= 5) {
  18055. xGame.uiMgr.Show(UIInvitation$1);
  18056. this.hide();
  18057. }
  18058. }
  18059. addAward(callback) {
  18060. if (!this.success) {
  18061. callback && callback();
  18062. return;
  18063. }
  18064. switch (xGame.common.gameMode) {
  18065. case GameMode.classic:
  18066. this.awardCoinNum = xGame.common.passAwardCoin;
  18067. this.awardDiamondNum = 0;
  18068. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  18069. break;
  18070. case GameMode.bigMove:
  18071. this.awardCoinNum = xGame.common.passAwardCoin;
  18072. this.awardDiamondNum = 0;
  18073. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  18074. callback && callback();
  18075. break;
  18076. case GameMode.placeBall:
  18077. let level = xGame.common.placeBallCurLevel;
  18078. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  18079. if (xGame.common.placeBallStarNum != 3) {
  18080. callback && callback();
  18081. return;
  18082. }
  18083. else {
  18084. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  18085. if (getAward) {
  18086. callback && callback();
  18087. return;
  18088. }
  18089. }
  18090. let cfg = cfgTable.placeballData[level];
  18091. let data = cfgTable.placeballData[level].award;
  18092. this.awardCoinNum = data[0];
  18093. this.awardDiamondNum = data[1];
  18094. if (cfg.type == PlaceBallType.challenge) {
  18095. this.awardDiamondNum = 0;
  18096. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  18097. }
  18098. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  18099. let diamondAward;
  18100. if (this.awardDiamondNum > 0) {
  18101. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  18102. xGame.common.getAward([diamondAward, coinAward], callback);
  18103. }
  18104. else {
  18105. xGame.common.getAward([coinAward], callback);
  18106. }
  18107. if (cfg.type == PlaceBallType.normal) {
  18108. DataMgr.setPlaceBallAward(level);
  18109. }
  18110. break;
  18111. default:
  18112. break;
  18113. }
  18114. }
  18115. playSecretaryAni() {
  18116. let parent = this.ui.secretary.displayObject;
  18117. parent.destroyChildren();
  18118. let xx = this.ui.secretary.width / 2;
  18119. let yy = this.ui.secretary.height;
  18120. let scale = xGame.common.getSecretaryScale();
  18121. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18122. if (this.success) {
  18123. let rand = Math.random() <= 0.5 ? 2 : 3;
  18124. xGame.common.secretary.play(data, rand, false, parent, () => {
  18125. xGame.common.secretary.play(data, 1, true, parent);
  18126. });
  18127. }
  18128. else {
  18129. xGame.common.secretary.play(data, 0, true, parent);
  18130. }
  18131. }
  18132. restartGame() {
  18133. switch (xGame.common.gameMode) {
  18134. case GameMode.classic:
  18135. xGame.eventMgr.event(RESTART_GAME);
  18136. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18137. break;
  18138. case GameMode.bigMove:
  18139. this.hide();
  18140. xGame.eventMgr.event(RESTART_GAME);
  18141. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18142. break;
  18143. default:
  18144. break;
  18145. }
  18146. }
  18147. hide() {
  18148. super.hide();
  18149. xGame.common.stopGirlPop(this.ui.talkNode);
  18150. PlatMgr.showBanner(false);
  18151. }
  18152. returnHome() {
  18153. this.hide();
  18154. let showFailWords = !this.success;
  18155. xGame.uiMgr.Show(UIMain$1, showFailWords);
  18156. }
  18157. clickLeftBtn() {
  18158. switch (xGame.common.gameMode) {
  18159. case GameMode.classic:
  18160. case GameMode.bigMove:
  18161. this.returnHome();
  18162. break;
  18163. case GameMode.placeBall:
  18164. let level = xGame.common.placeBallCurLevel;
  18165. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  18166. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18167. break;
  18168. default:
  18169. break;
  18170. }
  18171. }
  18172. powerStartPlaceBallLevel(level, btn) {
  18173. if (DataMgr.powerEnough()) {
  18174. btn.touchable = false;
  18175. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  18176. btn.touchable = true;
  18177. DataMgr.setPower(-1);
  18178. xGame.eventMgr.event(POWER_TIME);
  18179. this.startPlaceBallLevel(level);
  18180. }));
  18181. }
  18182. else {
  18183. xGame.uiMgr.Show(UIPower$1, 0);
  18184. }
  18185. }
  18186. clickRightBtn() {
  18187. switch (xGame.common.gameMode) {
  18188. case GameMode.classic:
  18189. case GameMode.bigMove:
  18190. this.restartGame();
  18191. break;
  18192. case GameMode.placeBall:
  18193. let level = xGame.common.placeBallCurLevel;
  18194. let data = DataMgr.getPlaceBallLevel(level);
  18195. let curPss = data.play && !data.isCur;
  18196. if (curPss) {
  18197. this.powerStartPlaceBallLevel(level + 1, this.ui.rightBtn);
  18198. }
  18199. else {
  18200. Moyu.sendDataEvent("placeBallNextLevel");
  18201. Moyu.showVideoAd(() => {
  18202. DataMgr.setPlaceBallLevel(level, 1);
  18203. this.startPlaceBallLevel(level + 1);
  18204. }, xGame.define.EAdType.placeBallNextLevel);
  18205. }
  18206. break;
  18207. default:
  18208. break;
  18209. }
  18210. }
  18211. startPlaceBallLevel(level) {
  18212. xGame.common.gameMode = GameMode.placeBall;
  18213. xGame.common.placeBallCurLevel = level;
  18214. xGame.uiMgr.Show(UIGame$1);
  18215. this.hide();
  18216. }
  18217. }
  18218. UIGameEnd$1.uiName = "UIGameEnd";
  18219. class ShowItem$1 {
  18220. constructor() {
  18221. this.ui = ui_ShowItem.createInstance();
  18222. }
  18223. destroySelf() {
  18224. if (!this.ui.isDisposed) {
  18225. this.ui.removeFromParent();
  18226. this.ui.dispose();
  18227. }
  18228. }
  18229. setParent(parent) {
  18230. parent.addChild(this.ui);
  18231. }
  18232. setPos(x, y) {
  18233. this.ui.x = x;
  18234. this.ui.y = y;
  18235. }
  18236. setUrl(index) {
  18237. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  18238. }
  18239. }
  18240. class UILevelProp$1 extends UIBase {
  18241. constructor() {
  18242. super();
  18243. this.firstPos = 385;
  18244. this.secondPos = 467;
  18245. this.showItemArr = [];
  18246. }
  18247. onConstructor() {
  18248. this.ui = ui_UILevelProp.createInstance();
  18249. this.contentPane = this.ui;
  18250. this.isEject = false;
  18251. this.addUIClick(this.ui.closeBtn, this.hide);
  18252. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18253. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  18254. }
  18255. show(level) {
  18256. super.show();
  18257. this.ui.t1.play();
  18258. this.level = level;
  18259. this.data = cfgTable.placeballData[this.level];
  18260. this.updateSelf();
  18261. this.showPreView();
  18262. this.moneyNode.ui.c1.selectedIndex = 2;
  18263. this.moneyNode.checkPowerTime();
  18264. this.moneyNode.powerChange();
  18265. }
  18266. showPreView() {
  18267. let item;
  18268. let data;
  18269. for (let index = 0; index < this.showItemArr.length; index++) {
  18270. item = this.showItemArr[index];
  18271. item.destroySelf();
  18272. }
  18273. this.showItemArr = [];
  18274. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  18275. for (const key in cfgData) {
  18276. data = cfgData[key];
  18277. item = new ShowItem$1();
  18278. item.setParent(this.ui.myNode.displayRoot);
  18279. item.setPos(data.x, data.y);
  18280. item.setUrl(data.value);
  18281. this.showItemArr.push(item);
  18282. }
  18283. }
  18284. updateSelf() {
  18285. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  18286. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  18287. if (this.data.ball == -1) {
  18288. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  18289. }
  18290. else {
  18291. this.ui.myNode.conditionTxt.text = "Reward";
  18292. }
  18293. let localData = DataMgr.getPlaceBallLevel(this.level);
  18294. let getAward = localData.getAward;
  18295. let cfg = cfgTable.placeballData[this.level];
  18296. let coin = this.data.award[0];
  18297. let diamond = this.data.award[1];
  18298. if (cfg.type == PlaceBallType.challenge) {
  18299. diamond = 0;
  18300. coin = 100;
  18301. }
  18302. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  18303. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  18304. this.ui.myNode.coinNode.numTxt.text = coin + "";
  18305. if (cfg.type == PlaceBallType.challenge) {
  18306. this.ui.myNode.coinNode.numTxt.text = "";
  18307. }
  18308. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  18309. if (coin > 0 && diamond > 0) {
  18310. this.ui.myNode.diamondNode.x = 385;
  18311. this.ui.myNode.coinNode.x = 467;
  18312. }
  18313. else {
  18314. this.ui.myNode.diamondNode.x = 385;
  18315. this.ui.myNode.coinNode.x = 385;
  18316. }
  18317. if (!getAward) {
  18318. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  18319. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  18320. }
  18321. else {
  18322. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  18323. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  18324. }
  18325. }
  18326. startGame() {
  18327. if (DataMgr.powerEnough()) {
  18328. this.ui.myNode.startBtn.touchable = false;
  18329. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  18330. console.log('zh:startGame ');
  18331. this.ui.myNode.startBtn.touchable = true;
  18332. DataMgr.setPower(-1);
  18333. xGame.eventMgr.event(POWER_TIME);
  18334. xGame.common.gameMode = GameMode.placeBall;
  18335. xGame.common.placeBallCurLevel = this.level;
  18336. xGame.uiMgr.Show(UIGame$1);
  18337. xGame.uiMgr.Hide(UILevelDisplay$1);
  18338. xGame.uiMgr.Hide(UIMain$1);
  18339. this.hide();
  18340. }));
  18341. }
  18342. else {
  18343. xGame.uiMgr.Show(UIPower$1);
  18344. }
  18345. }
  18346. hide() {
  18347. super.hide();
  18348. }
  18349. }
  18350. UILevelProp$1.uiName = "UILevelProp";
  18351. class PutBallLevelDisplay$1 {
  18352. constructor(ui, index) {
  18353. this.index = 0;
  18354. this.ui = ui;
  18355. this.index = index;
  18356. this.ui.onClick(this, this.clickSelf);
  18357. this.updateSelf();
  18358. this.ui.levelTxt.text = (this.index + 1) + "";
  18359. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  18360. this.ui.special.levelTxt.text = (this.index + 1) + "";
  18361. }
  18362. updateSelf() {
  18363. let level = this.index + 1;
  18364. this.data = DataMgr.getPlaceBallLevel(level);
  18365. this.ui.starNode.c1.selectedIndex = this.data.star;
  18366. let isChallenge = cfgTable.placeballData[level].type;
  18367. if (this.data.isCur) {
  18368. if (isChallenge) {
  18369. this.ui.c1.selectedIndex = 5;
  18370. }
  18371. else {
  18372. this.ui.c1.selectedIndex = 2;
  18373. }
  18374. }
  18375. else {
  18376. if (this.data.play) {
  18377. if (this.data.star == 3) {
  18378. this.ui.c1.selectedIndex = 0;
  18379. }
  18380. else {
  18381. this.ui.c1.selectedIndex = 1;
  18382. }
  18383. }
  18384. else {
  18385. if (isChallenge) {
  18386. this.ui.c1.selectedIndex = 4;
  18387. }
  18388. else {
  18389. this.ui.c1.selectedIndex = 3;
  18390. }
  18391. }
  18392. }
  18393. }
  18394. clickSelf() {
  18395. if (!this.data.play)
  18396. return;
  18397. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18398. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  18399. }
  18400. }
  18401. class UILevelDisplay$1 extends UIBase {
  18402. constructor() {
  18403. super();
  18404. }
  18405. onConstructor() {
  18406. this.ui = ui_UILevelDisplay.createInstance();
  18407. this.contentPane = this.ui;
  18408. this.isEject = false;
  18409. this.myList = this.ui.myNode.myList;
  18410. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  18411. this.levelItemArr = [];
  18412. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  18413. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  18414. this.myList.numItems = levelNum;
  18415. if (Moyu.isKs)
  18416. this.ui.closeNode.closeBtn.x += 100;
  18417. }
  18418. levelItemRender(index, target) {
  18419. let item = new PutBallLevelDisplay$1(target, index);
  18420. this.levelItemArr.push(item);
  18421. }
  18422. show() {
  18423. super.show();
  18424. this.updateLevel();
  18425. this.scrollToPlace();
  18426. }
  18427. updateLevel() {
  18428. let temp;
  18429. for (let index = 0; index < this.levelItemArr.length; index++) {
  18430. temp = this.levelItemArr[index];
  18431. temp.updateSelf();
  18432. }
  18433. }
  18434. scrollToPlace() {
  18435. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  18436. let passArr = DataMgr.getPlaceBallLevelList();
  18437. let offest = passArr.length;
  18438. if (offest >= maxNum - 1)
  18439. offest = maxNum - 1;
  18440. this.myList.scrollToView(offest, true, true);
  18441. }
  18442. hide() {
  18443. super.hide();
  18444. }
  18445. }
  18446. UILevelDisplay$1.uiName = "UILevelDisplay";
  18447. class UIMatching$1 extends UIBase {
  18448. constructor() {
  18449. super();
  18450. }
  18451. onConstructor() {
  18452. this.ui = ui_UIMatching.createInstance();
  18453. this.contentPane = this.ui;
  18454. this.isEject = false;
  18455. }
  18456. show(callback) {
  18457. super.show();
  18458. PlatMgr.showBanner(true);
  18459. this.callback = callback;
  18460. let user = Moyu.getUserInfo();
  18461. if (!this.selfPot) {
  18462. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  18463. }
  18464. if (!this.aiPot) {
  18465. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  18466. }
  18467. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  18468. this.ui.selfHead.nameTxt.text = user.nickName;
  18469. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  18470. this.ui.aiHead.nameTxt.text = "???";
  18471. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  18472. this.ui.selfHead.c1.selectedIndex = 0;
  18473. this.ui.aiHead.c1.selectedIndex = 0;
  18474. this.ui.selfHead.x = this.selfPot.x;
  18475. this.ui.selfHead.y = this.selfPot.y;
  18476. this.ui.aiHead.x = this.aiPot.x;
  18477. this.ui.aiHead.y = this.aiPot.y;
  18478. switch (xGame.common.gameMode) {
  18479. case GameMode.classic:
  18480. break;
  18481. case GameMode.bigMove:
  18482. this.initSkillData();
  18483. break;
  18484. default:
  18485. break;
  18486. }
  18487. this.ui.t1.play(Laya.Handler.create(this, () => {
  18488. this.ui.t2.play(Laya.Handler.create(this, () => {
  18489. switch (xGame.common.gameMode) {
  18490. case GameMode.classic:
  18491. this.waitingPeople();
  18492. break;
  18493. case GameMode.bigMove:
  18494. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  18495. break;
  18496. default:
  18497. break;
  18498. }
  18499. }));
  18500. }));
  18501. }
  18502. initSkillData() {
  18503. this.skillSelectData = [];
  18504. let skillUrl = xGame.common.skillIconList;
  18505. let skillName = xGame.common.skillNameList;
  18506. let skillLevel = DataMgr.getBigSkillList();
  18507. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  18508. for (let index = 0; index < 5; index++) {
  18509. let obj = {};
  18510. obj.skillImg = skillUrl[index];
  18511. obj.skillName = skillName[index];
  18512. obj.skillType = skillType[index];
  18513. obj.skillLevel = skillLevel[index];
  18514. this.skillSelectData.push(obj);
  18515. }
  18516. }
  18517. getAISkillLevel(myLevel) {
  18518. let video = xGame.common.upSkillLevel;
  18519. let aiLevel;
  18520. let temp;
  18521. if (video) {
  18522. temp = xGame.common.randomNum(-2, -1);
  18523. }
  18524. else {
  18525. if (myLevel <= 5) {
  18526. temp = xGame.common.randomNum(1, 3);
  18527. }
  18528. else if (myLevel <= 9) {
  18529. temp = xGame.common.randomNum(-2, 1);
  18530. }
  18531. else {
  18532. temp = xGame.common.randomNum(-4, 0);
  18533. }
  18534. }
  18535. aiLevel = temp + myLevel;
  18536. if (aiLevel <= 1)
  18537. aiLevel = 1;
  18538. if (aiLevel >= 10)
  18539. aiLevel = 10;
  18540. return aiLevel;
  18541. }
  18542. getAISkillType() {
  18543. return xGame.common.randomNum(1, 4);
  18544. let successTimes = DataMgr.getSkillSuccessTimes();
  18545. let info = cfgTable.aiskillData[successTimes];
  18546. if (!info) {
  18547. let max = Object.keys(cfgTable.aiskillData).length - 1;
  18548. info = cfgTable.aiskillData[max];
  18549. }
  18550. let dataArr = info.skillselect;
  18551. let myCfg = {};
  18552. for (let index = 0; index < dataArr.length; index++) {
  18553. let temp = dataArr[index].split('-');
  18554. myCfg[temp[0]] = {};
  18555. myCfg[temp[0]].id = parseInt(temp[0]);
  18556. myCfg[temp[0]].weight = parseInt(temp[1]);
  18557. }
  18558. let aiCfg = xGame.common.initWeight(myCfg);
  18559. let curData = xGame.common.getRandomWeightData(aiCfg);
  18560. return parseInt(curData.id);
  18561. }
  18562. getAISkillData(index) {
  18563. let myLevel = this.skillSelectData[index].skillLevel;
  18564. let aiLevel = this.getAISkillLevel(myLevel);
  18565. let aiType = this.getAISkillType() - 1;
  18566. return { aiLevel, aiType } = { aiLevel, aiType };
  18567. }
  18568. skillSelectFinish(index) {
  18569. let aiInfo = this.getAISkillData(index);
  18570. xGame.common.gameMgr.selfCurSkill = index;
  18571. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  18572. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  18573. this.ui.selfHead.c1.selectedIndex = 1;
  18574. this.ui.aiHead.c1.selectedIndex = 1;
  18575. let myData = this.skillSelectData[index];
  18576. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  18577. let guide = DataMgr.getSkillGuide();
  18578. if (guide == 0) {
  18579. this.ui.selfHead.skillTxt.text = myData.skillName + " 满级";
  18580. }
  18581. else {
  18582. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  18583. }
  18584. let aiData = this.skillSelectData[aiInfo.aiType];
  18585. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  18586. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  18587. this.waitingPeople();
  18588. }
  18589. waitingPeople() {
  18590. let time = xGame.common.randomNum(1000, 3000);
  18591. time += 1000;
  18592. Laya.timer.once(time, this, () => {
  18593. this.matchingSuccess();
  18594. });
  18595. }
  18596. matchingSuccess() {
  18597. let gameUI = xGame.common.gameUI;
  18598. let name = gameUI.ui.topNode.aiNameTxt.text;
  18599. let url = gameUI.ui.topNode.aiHeadLoader.url;
  18600. this.ui.aiHead.nameTxt.text = name;
  18601. this.ui.aiHead.headImg.url = url;
  18602. name = gameUI.ui.topNode.selfNameTxt.text;
  18603. url = gameUI.ui.topNode.selfHeadLoader.url;
  18604. this.ui.selfHead.nameTxt.text = name;
  18605. this.ui.selfHead.headImg.url = url;
  18606. this.ui.t3.play(Laya.Handler.create(this, () => {
  18607. this.callback && this.callback();
  18608. this.ui.t4.play(Laya.Handler.create(this, () => {
  18609. this.destroySelf();
  18610. }));
  18611. }));
  18612. }
  18613. destroySelf() {
  18614. this.callback = null;
  18615. this.skillSelectData = null;
  18616. this.selfPot = null;
  18617. this.aiPot = null;
  18618. if (!this.ui.isDisposed) {
  18619. this.ui.removeFromParent();
  18620. this.ui.dispose();
  18621. }
  18622. xGame.uiMgr.destroyUI(this);
  18623. }
  18624. }
  18625. UIMatching$1.uiName = "UIMatching";
  18626. class SkillDisplay$1 {
  18627. constructor(ui, data, uiIndex) {
  18628. this.starX = 0;
  18629. this.starY = 0;
  18630. this.index = 0;
  18631. this.ui = ui;
  18632. this.data = data;
  18633. this.index = uiIndex;
  18634. this.initSelf();
  18635. console.log('zh:SkillDisplay constructor this.skillData=', data);
  18636. }
  18637. initSelf() {
  18638. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  18639. this.ui.nameTxt.text = this.data.name;
  18640. this.ui.describeTxt.text = this.data.describe;
  18641. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  18642. this.ui.startBtn.onClick(this, this.startGame);
  18643. this.updateSelf();
  18644. }
  18645. updateSelf() {
  18646. this.checkTry();
  18647. let level = DataMgr.getBigSkillByIndex(this.index);
  18648. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  18649. }
  18650. checkTry() {
  18651. let index = this.index;
  18652. let level = DataMgr.getBigSkillByIndex(index);
  18653. if (level == null) {
  18654. DataMgr.setBigSkill(index, 1, false);
  18655. level = 1;
  18656. }
  18657. this.ui.levelTxt.text = "LV." + level;
  18658. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  18659. this.ui.tryNode.visible = true;
  18660. else
  18661. this.ui.tryNode.visible = false;
  18662. }
  18663. clickAddLevel() {
  18664. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18665. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  18666. Moyu.showVideoAd(() => {
  18667. DataMgr.setBigSkill(this.data.index, 1);
  18668. this.updateSelf();
  18669. xGame.common.upSkillLevel = true;
  18670. }, EAdType.upSkill);
  18671. }
  18672. startGame() {
  18673. if (this.data.index == 3) {
  18674. alert('期待吧');
  18675. return;
  18676. }
  18677. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18678. let needCoin = xGame.common.bigMoveNeedCoin;
  18679. xGame.common.passAwardCoin = 2000;
  18680. let guide = DataMgr.getSkillGuide();
  18681. console.log('zh:startGame guide=' + guide);
  18682. xGame.common.temSelfLevel = 0;
  18683. if (guide == 0) {
  18684. needCoin = 0;
  18685. xGame.common.temSelfLevel = 100;
  18686. }
  18687. if (DataMgr.coinEnough(needCoin)) {
  18688. DataMgr.setCoin(-needCoin);
  18689. xGame.common.curPlayerSkillType = this.index;
  18690. if (guide == 0)
  18691. xGame.common.curPlayerSkillType = 0;
  18692. xGame.uiMgr.Show(UIGame$1);
  18693. xGame.uiMgr.Hide(UIMain$1);
  18694. xGame.uiMgr.Show(UIMatching$1, () => {
  18695. xGame.common.gameUI.ui.alpha = 1;
  18696. xGame.common.gameUI.startGame();
  18697. xGame.uiMgr.Hide(UISkill$1);
  18698. });
  18699. }
  18700. else {
  18701. xGame.uiMgr.Show(UIAddProp$1, 0);
  18702. Moyu.sendDataEvent("AddCoinVideo");
  18703. }
  18704. }
  18705. }
  18706. class UISkill$1 extends UIBase {
  18707. constructor() {
  18708. super();
  18709. this.skillData = [];
  18710. }
  18711. onConstructor() {
  18712. this.ui = ui_UISkill.createInstance();
  18713. this.contentPane = this.ui;
  18714. this.isEject = false;
  18715. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18716. this.initSkillData();
  18717. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  18718. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  18719. this.displayList = [];
  18720. this.ui.skillNode.skillList.numItems = 4;
  18721. this.addUIClick(this.ui, this.interuptSecretary);
  18722. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  18723. this.ui.talkNode.visible = false;
  18724. if (Moyu.isKs)
  18725. this.ui.closeNode.closeBtn.x += 100;
  18726. }
  18727. show() {
  18728. super.show();
  18729. this.playSecretaryIdle();
  18730. this.moneyNode.ui.c1.selectedIndex = 1;
  18731. Laya.timer.clearAll(this);
  18732. xGame.soundMgr.playSound("s_start");
  18733. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18734. let guide = DataMgr.getSkillGuide();
  18735. this.ui.guideNode.visible = guide == 0;
  18736. let item = this.getSkillItemByUIIndex(0);
  18737. if (guide == 0) {
  18738. item.ui.c1.selectedIndex = 1;
  18739. }
  18740. else {
  18741. item.ui.c1.selectedIndex = 0;
  18742. }
  18743. this.ui.guideNode.guideBtn.visible = guide == 0;
  18744. for (let index = 0; index < this.displayList.length; index++) {
  18745. this.displayList[index].checkTry();
  18746. }
  18747. }
  18748. getSkillItemByUIIndex(cur) {
  18749. for (let index = 0; index < this.displayList.length; index++) {
  18750. if (this.displayList[index].index == cur) {
  18751. return this.displayList[index];
  18752. }
  18753. }
  18754. }
  18755. enterGuideLevel() {
  18756. let item = this.getSkillItemByUIIndex(0);
  18757. item.startGame();
  18758. if (DataMgr.getNewUser())
  18759. Moyu.sendDataEvent("gameStart1");
  18760. }
  18761. initSkillData() {
  18762. this.skillData = [];
  18763. let nameList = xGame.common.skillNameList;
  18764. let iconList = xGame.common.skillIconList;
  18765. let describeList = [
  18766. "Jump shot executed — ball bounced and pocketed an extra one!",
  18767. "Bonus Sweep: A random follow-up strike hits 1 extra ball after your shot!",
  18768. "Freeze Effect: Your shot freezes 1 random ball — enemy can’t hit it, and others bounce off!"
  18769. ];
  18770. let data;
  18771. for (let index = 0; index < nameList.length; index++) {
  18772. data = {};
  18773. data.name = nameList[index];
  18774. data.icon = iconList[index];
  18775. data.describe = describeList[index];
  18776. data.index = index;
  18777. this.skillData.push(data);
  18778. }
  18779. }
  18780. updateSkillItem(index, target) {
  18781. if (this.displayList[index] == null) {
  18782. let uiIndex;
  18783. switch (index) {
  18784. case 0:
  18785. uiIndex = 1;
  18786. break;
  18787. case 1:
  18788. uiIndex = 0;
  18789. break;
  18790. case 2:
  18791. uiIndex = 2;
  18792. break;
  18793. case 3:
  18794. uiIndex = 3;
  18795. break;
  18796. default:
  18797. break;
  18798. }
  18799. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  18800. this.displayList.push(temp);
  18801. }
  18802. }
  18803. playSecretaryIdle() {
  18804. let parent = this.ui.secretary.displayObject;
  18805. parent.destroyChildren();
  18806. let xx = this.ui.secretary.width / 2;
  18807. let yy = this.ui.secretary.height;
  18808. let scale = xGame.common.getSecretaryScale();
  18809. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18810. xGame.common.secretary.play(data, 1, true, parent);
  18811. }
  18812. returnUIMain() {
  18813. this.hide();
  18814. xGame.common.stopGirlPop(this.ui.talkNode);
  18815. xGame.uiMgr.Show(UIMain$1);
  18816. }
  18817. interuptSecretary() {
  18818. Laya.timer.clearAll(this);
  18819. this.playSecretaryRandomSound();
  18820. }
  18821. playSecretaryRandomSound() {
  18822. if (this.isHide)
  18823. return;
  18824. let time = xGame.common.randomNum(45000, 60000);
  18825. Laya.timer.once(time, this, () => {
  18826. if (this.isHide)
  18827. return;
  18828. let index = xGame.common.randomNum(4, 7);
  18829. xGame.soundMgr.playSound("s_main0" + index);
  18830. let words = 1;
  18831. switch (index) {
  18832. case 4:
  18833. words = 5;
  18834. break;
  18835. case 5:
  18836. words = 3;
  18837. break;
  18838. case 6:
  18839. words = 6;
  18840. break;
  18841. case 7:
  18842. words = 7;
  18843. break;
  18844. default:
  18845. break;
  18846. }
  18847. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18848. this.playSecretaryRandomSound();
  18849. });
  18850. }
  18851. }
  18852. UISkill$1.uiName = "UISkill";
  18853. class UIAddProp$1 extends UIBase {
  18854. constructor() {
  18855. super();
  18856. this.curType = "";
  18857. }
  18858. onConstructor() {
  18859. this.ui = ui_UIAddProp.createInstance();
  18860. this.contentPane = this.ui;
  18861. this.isEject = false;
  18862. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  18863. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  18864. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  18865. this.updateUI();
  18866. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  18867. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  18868. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  18869. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  18870. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  18871. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  18872. }
  18873. show(type) {
  18874. super.show();
  18875. this.curType = type == 0 ? "coin" : "diamond";
  18876. this.switchBtn("");
  18877. this.ui.t0.play();
  18878. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  18879. PlatMgr.showInsert(true);
  18880. }
  18881. closeSelf() {
  18882. this.hide();
  18883. }
  18884. updateUI() {
  18885. let data = cfgTable.moneyData;
  18886. let temp;
  18887. let obj;
  18888. for (const key in data) {
  18889. temp = data[key];
  18890. obj = this.ui.myNode["node" + key];
  18891. if (parseInt(key) <= 2) {
  18892. obj.diamondTxt.text = "+" + temp.num;
  18893. }
  18894. else {
  18895. obj.coinTxt.text = temp.num;
  18896. obj.diamondTxt.text = temp.get.split('_')[1];
  18897. }
  18898. }
  18899. this.updateDiamondShare();
  18900. }
  18901. updateDiamondShare() {
  18902. let data = DataMgr.getShareDiamondTimes();
  18903. if (data >= xGame.common.maxShareDiamondTimes) {
  18904. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  18905. this.ui.myNode.node1.touchable = false;
  18906. }
  18907. else {
  18908. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  18909. this.ui.myNode.node1.touchable = true;
  18910. }
  18911. }
  18912. switchBtn(type) {
  18913. if (type == "")
  18914. type = this.curType;
  18915. else {
  18916. if (this.curType == type) {
  18917. return;
  18918. }
  18919. else {
  18920. this.curType = type;
  18921. }
  18922. }
  18923. if (type == "coin") {
  18924. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  18925. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  18926. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  18927. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  18928. this.ui.myNode.c1.selectedIndex = 0;
  18929. }
  18930. else {
  18931. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  18932. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  18933. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  18934. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  18935. this.ui.myNode.c1.selectedIndex = 1;
  18936. }
  18937. }
  18938. convertCoin(index) {
  18939. let data = cfgTable.moneyData[index];
  18940. let coinNum = data.num;
  18941. let str = data.get.split('_')[1];
  18942. let needDiamond = parseInt(str);
  18943. if (DataMgr.diamondEnough(needDiamond)) {
  18944. DataMgr.setDiamond(-needDiamond);
  18945. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  18946. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  18947. }
  18948. else {
  18949. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  18950. this.switchBtn("diamond");
  18951. }
  18952. }
  18953. videoGetDiamond() {
  18954. let num = cfgTable.moneyData[2].num;
  18955. Moyu.showVideoAd(() => {
  18956. xGame.common.playObjFlyAnim(num, Prop.diamond);
  18957. this.closeSelf();
  18958. }, EAdType.addDiamond);
  18959. }
  18960. videoGetCoin() {
  18961. Moyu.showVideoAd(() => {
  18962. xGame.common.playObjFlyAnim(2000, Prop.coin);
  18963. this.closeSelf();
  18964. }, EAdType.addCoin);
  18965. }
  18966. shareGetDiamond() {
  18967. let times = DataMgr.getShareDiamondTimes();
  18968. if (times >= xGame.common.maxShareDiamondTimes) {
  18969. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  18970. }
  18971. else {
  18972. if (Moyu.isTT) {
  18973. let num = cfgTable.moneyData[1].num;
  18974. Moyu.shareVideo = '';
  18975. Moyu.shareGame((success) => {
  18976. if (success) {
  18977. xGame.uiMgr.Show(UIMsg$1, "分享成功!");
  18978. xGame.common.playObjFlyAnim(num, Prop.diamond);
  18979. DataMgr.setShareDiamondTimes(1);
  18980. this.updateDiamondShare();
  18981. }
  18982. else {
  18983. xGame.uiMgr.Show(UIMsg$1, "分享失败!");
  18984. }
  18985. });
  18986. }
  18987. else {
  18988. Moyu.showVideoAd(() => {
  18989. let diamond = xGame.common.randomNum(50, 100);
  18990. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  18991. DataMgr.setShareDiamondTimes(1);
  18992. this.updateDiamondShare();
  18993. }, EAdType.randomDiamond);
  18994. }
  18995. }
  18996. }
  18997. openPutBallView() {
  18998. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  18999. let skill = xGame.uiMgr.getUI(UISkill$1);
  19000. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  19001. let uigame = xGame.uiMgr.getUI(UIGame$1);
  19002. if (end && !end.isHide) {
  19003. xGame.uiMgr.Hide(UIGameEnd$1);
  19004. xGame.uiMgr.Show(UIMain$1);
  19005. }
  19006. if (skill && !skill.isHide)
  19007. xGame.uiMgr.Hide(UISkill$1);
  19008. if (uigame && !uigame.isHide)
  19009. xGame.uiMgr.Hide(UIGame$1);
  19010. if (level && !level.isHide) {
  19011. }
  19012. else {
  19013. xGame.uiMgr.Show(UILevelDisplay$1);
  19014. }
  19015. this.closeSelf();
  19016. }
  19017. }
  19018. UIAddProp$1.uiName = "UIAddProp";
  19019. class MoneyNode$1 {
  19020. constructor(ui) {
  19021. this.leftTime = 0;
  19022. this.ui = ui;
  19023. this.ui.addCoinBtn.onClick(this, this.addCoin);
  19024. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  19025. this.ui.addPowerBtn.onClick(this, this.addPower);
  19026. this.ui.c1.selectedIndex = 1;
  19027. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  19028. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  19029. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  19030. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  19031. this.coinChange();
  19032. this.diamondChange();
  19033. this.powerChange();
  19034. }
  19035. addPower() {
  19036. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19037. xGame.uiMgr.Show(UIPower$1);
  19038. }
  19039. powerChange() {
  19040. let powerNum = DataMgr.getPower();
  19041. this.ui.powerTxt.text = powerNum + "";
  19042. }
  19043. checkPowerTime() {
  19044. let cur = new Date().getTime();
  19045. let last = DataMgr.getPowerTime();
  19046. if (last == 0) {
  19047. last = cur;
  19048. DataMgr.setPowerTime(cur);
  19049. }
  19050. let power = DataMgr.getPower();
  19051. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  19052. Laya.timer.clearAll(this);
  19053. if (power >= xGame.common.natureMaxPower) {
  19054. this.ui.powerTimeTxt.text = "";
  19055. DataMgr.setPowerTime(cur);
  19056. return;
  19057. }
  19058. if (power + offset >= xGame.common.natureMaxPower) {
  19059. DataMgr.setPower(xGame.common.natureMaxPower, false);
  19060. this.ui.powerTimeTxt.text = "";
  19061. DataMgr.setPowerTime(cur);
  19062. }
  19063. else {
  19064. if (offset > 0) {
  19065. DataMgr.setPower(offset);
  19066. DataMgr.setPowerTime(cur);
  19067. }
  19068. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  19069. this.leftTime = xGame.common.powerRecoverNum - time;
  19070. if (this.leftTime <= 0)
  19071. this.leftTime = 0;
  19072. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  19073. Laya.timer.loop(1000, this, this.updatePowerTime);
  19074. }
  19075. }
  19076. updatePowerTime() {
  19077. this.leftTime -= 1;
  19078. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  19079. if (this.leftTime <= 0) {
  19080. this.checkPowerTime();
  19081. }
  19082. }
  19083. coinChange() {
  19084. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  19085. }
  19086. diamondChange() {
  19087. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  19088. }
  19089. addCoin() {
  19090. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19091. Moyu.sendDataEvent("AddCoinBtn");
  19092. xGame.uiMgr.Show(UIAddProp$1, 0);
  19093. }
  19094. addDiamond() {
  19095. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19096. Moyu.sendDataEvent("AddDiamondBtn");
  19097. xGame.uiMgr.Show(UIAddProp$1, 1);
  19098. }
  19099. }
  19100. class SettingNode$1 {
  19101. constructor(ui) {
  19102. this.showSetting = false;
  19103. this.openSound = true;
  19104. this.openShake = true;
  19105. this.ui = ui;
  19106. this.ui.soundBtn.onClick(this, this.switchSound);
  19107. this.ui.shakeBtn.onClick(this, this.switchShake);
  19108. this.ui.xyBtn.onClick(this, this.onXy);
  19109. this.ui.clickNode.onClick(this, this.changeSetting);
  19110. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  19111. }
  19112. changeSetting() {
  19113. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19114. this.showSetting = !this.showSetting;
  19115. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  19116. }
  19117. switchSound() {
  19118. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19119. this.openSound = !this.openSound;
  19120. Moyu.onSetting(this.openSound, this.openShake);
  19121. xGame.soundMgr.onSetting(this.openSound);
  19122. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  19123. }
  19124. switchShake() {
  19125. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19126. this.openShake = !this.openShake;
  19127. Moyu.onSetting(this.openSound, this.openShake);
  19128. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  19129. }
  19130. onXy() {
  19131. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19132. MoyuMgr$1.showXy(1);
  19133. }
  19134. }
  19135. class UIDraw$1 extends UIBase {
  19136. constructor() {
  19137. super();
  19138. this.curKey = 0;
  19139. }
  19140. onConstructor() {
  19141. this.ui = ui_UIDraw.createInstance();
  19142. this.contentPane = this.ui;
  19143. this.isEject = false;
  19144. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19145. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  19146. this.addUIClick(this.ui.drawBtn, this.startDraw);
  19147. this.initDraw();
  19148. this.initUI();
  19149. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  19150. if (Moyu.isKs)
  19151. this.ui.closeNode.closeBtn.x += 100;
  19152. }
  19153. show() {
  19154. super.show();
  19155. this.ui.t0.play();
  19156. this.playSecretaryIdle();
  19157. this.updateDraw();
  19158. this.checkFree();
  19159. if (PlatMgr.bannerDelay > 0) {
  19160. this.ui.closeNode.closeBtn.visible = false;
  19161. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  19162. this.ui.closeNode.closeBtn.visible = true;
  19163. });
  19164. }
  19165. PlatMgr.showRateBanner();
  19166. }
  19167. hide() {
  19168. Laya.timer.clearAll(this);
  19169. super.hide();
  19170. }
  19171. checkFree() {
  19172. let isFree = DataMgr.getDailyfreeDrawTimes();
  19173. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  19174. }
  19175. initDraw() {
  19176. this.drawObj = [];
  19177. let data = cfgTable.drawData;
  19178. let temp;
  19179. let weight = 0;
  19180. for (const key in data) {
  19181. temp = data[key];
  19182. weight += temp.weight;
  19183. this.drawObj.push(weight);
  19184. }
  19185. this.allWeight = weight;
  19186. }
  19187. initUI() {
  19188. let data = cfgTable.drawData;
  19189. let temp;
  19190. let img;
  19191. let txt;
  19192. for (const key in data) {
  19193. temp = data[key];
  19194. img = this.ui.myNode.rotNode["img" + key];
  19195. txt = this.ui.myNode.rotNode["txt" + key];
  19196. img.url = xGame.common.getGameIconUrl(temp.icon);
  19197. txt.visible = true;
  19198. if (temp.award > 2) {
  19199. img.rotation = 0;
  19200. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  19201. }
  19202. else {
  19203. img.rotation = temp.rotation;
  19204. txt.text = temp.num;
  19205. }
  19206. }
  19207. }
  19208. getCurkey() {
  19209. let rand = Math.random() * this.allWeight;
  19210. let temp;
  19211. for (let index = 0; index < this.drawObj.length - 1; index++) {
  19212. temp = this.drawObj[index];
  19213. if (index == 0) {
  19214. if (rand < temp) {
  19215. return index + 1;
  19216. }
  19217. }
  19218. else {
  19219. if (rand >= temp && rand < this.drawObj[index + 1]) {
  19220. return index + 1;
  19221. }
  19222. }
  19223. }
  19224. return 2;
  19225. }
  19226. startDraw() {
  19227. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  19228. if (freeTimes > 0) {
  19229. this.beginDraw();
  19230. DataMgr.setDailyfreeDrawTimes(0);
  19231. this.checkFree();
  19232. }
  19233. else {
  19234. Moyu.sendDataEvent("turntable");
  19235. Moyu.showVideoAd(() => {
  19236. this.beginDraw();
  19237. }, EAdType.draw);
  19238. }
  19239. }
  19240. beginDraw() {
  19241. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  19242. this.ui.drawBtn.touchable = false;
  19243. this.curKey = this.getCurkey();
  19244. console.log("当前key", this.curKey);
  19245. let cell = 60;
  19246. let lap = 3;
  19247. let angle = cell * (this.curKey - 1) + lap * 360;
  19248. let target = this.ui.myNode.rotNode;
  19249. target.rotation = 0;
  19250. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  19251. console.log("旋转完成");
  19252. this.ui.drawBtn.touchable = true;
  19253. this.getAward();
  19254. }));
  19255. }
  19256. getAward() {
  19257. let data = cfgTable.drawData[this.curKey];
  19258. let temp = new AwardType();
  19259. temp.type = data.award;
  19260. temp.num = data.num;
  19261. xGame.common.getAward([temp], () => {
  19262. DataMgr.setDrawTimes(1);
  19263. this.updateDraw();
  19264. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  19265. });
  19266. }
  19267. updateDraw() {
  19268. let drawTimes = DataMgr.getDrawTimes();
  19269. let awardTimes = DataMgr.getDrawAwardTimes();
  19270. if (Math.floor(drawTimes / 3) > awardTimes) {
  19271. this.ui.extraNode.boxBtn.t0.play(null, -1);
  19272. this.ui.extraNode.boxBtn.touchable = true;
  19273. this.ui.extraNode.tipsTxt.text = "3/3";
  19274. this.ui.extraNode.barNode.width = 265;
  19275. this.getExtraAward();
  19276. }
  19277. else {
  19278. this.ui.extraNode.boxBtn.t0.stop();
  19279. this.ui.extraNode.boxBtn.touchable = false;
  19280. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  19281. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  19282. }
  19283. let data = cfgTable.drawData[1];
  19284. if (awardTimes == 0) {
  19285. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  19286. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  19287. this.ui.myNode.rotNode.img1.rotation = 0;
  19288. }
  19289. else {
  19290. let award = data.nextid;
  19291. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  19292. this.ui.myNode.rotNode.txt1.text = award[1];
  19293. this.ui.myNode.rotNode.img1.rotation = 0;
  19294. }
  19295. }
  19296. getExtraAward() {
  19297. let drawTimes = DataMgr.getDrawTimes();
  19298. let awardTimes = DataMgr.getDrawAwardTimes();
  19299. let data = cfgTable.drawData[1];
  19300. let award = new AwardType();
  19301. if (awardTimes == 0) {
  19302. award.num = data.num;
  19303. award.type = data.award;
  19304. xGame.common.getAward([award], () => {
  19305. let all = Math.floor(drawTimes / 3);
  19306. DataMgr.setDrawAwardTimes(all);
  19307. this.updateDraw();
  19308. });
  19309. }
  19310. else {
  19311. award.num = parseInt(data.nextid[1]);
  19312. award.type = parseInt(data.nextid[0]);
  19313. xGame.common.getAward([award], () => {
  19314. let all = Math.floor(drawTimes / 3);
  19315. DataMgr.setDrawAwardTimes(all);
  19316. this.updateDraw();
  19317. });
  19318. }
  19319. }
  19320. closeSelf() {
  19321. this.hide();
  19322. }
  19323. playSecretaryIdle() {
  19324. let parent = this.ui.secretary.displayObject;
  19325. parent.destroyChildren();
  19326. let xx = this.ui.secretary.width / 2;
  19327. let yy = this.ui.secretary.height;
  19328. let scale = xGame.common.getSecretaryScale();
  19329. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19330. xGame.common.secretary.play(data, 1, true, parent);
  19331. }
  19332. }
  19333. UIDraw$1.uiName = "UIDraw";
  19334. class UIRanking$1 extends UIBase {
  19335. constructor() {
  19336. super();
  19337. this.showSelf = true;
  19338. this.rankType = 1;
  19339. this.rankList = [];
  19340. this.myIndex = 0;
  19341. this.myStar = 0;
  19342. }
  19343. onConstructor() {
  19344. this.ui = ui_UIRanking.createInstance();
  19345. this.contentPane = this.ui;
  19346. this.isEject = false;
  19347. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  19348. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  19349. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  19350. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  19351. this.ui.myNode.myList.setVirtual();
  19352. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  19353. }
  19354. show() {
  19355. super.show();
  19356. this.myIndex = 51;
  19357. Moyu.getRankList({
  19358. rankId: xGame.common.curRankID,
  19359. type: MoyuRankType.total,
  19360. page: 1,
  19361. pageSize: 50,
  19362. }, this, this.updateItemData);
  19363. this.updateSelf();
  19364. let self = Moyu.getUserInfo();
  19365. if (!self.isAuth) {
  19366. Moyu.initUser(this, () => {
  19367. DataMgr.upRankData();
  19368. });
  19369. }
  19370. }
  19371. updateSelfItem() {
  19372. let self = Moyu.getUserInfo();
  19373. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  19374. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > 50 ? "未上榜" : this.myIndex.toString();
  19375. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  19376. this.ui.myNode.selfNode.nameTxt.text = Moyu.platType < 11 ? self.nickName : "myself";
  19377. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  19378. }
  19379. updateItemData(data) {
  19380. this.myStar = xGame.common.getAllStarNum();
  19381. if (this.rankList.length < 2) {
  19382. this.rankList = data;
  19383. let self = Moyu.getUserInfo();
  19384. for (let i = 0; i < data.length; i++) {
  19385. let data = this.rankList[i];
  19386. if (data.userId == self.userId) {
  19387. this.rankList.splice(i, 1);
  19388. break;
  19389. }
  19390. }
  19391. for (let i = 0; i < data.length; i++) {
  19392. let data = this.rankList[i];
  19393. if (data.rankScore < this.myStar && this.myIndex > 50) {
  19394. this.myIndex = i + 1;
  19395. let user = { headIcon: self.headIcon, nickName: "myself" };
  19396. let ud = { user: user, data: {} };
  19397. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  19398. if (Moyu.platType < 11) {
  19399. user.headIcon = self.headIcon;
  19400. user.nickName = self.nickName;
  19401. }
  19402. this.rankList.splice(i, 0, md);
  19403. break;
  19404. }
  19405. }
  19406. }
  19407. this.updateSelfItem();
  19408. this.ui.myNode.myList.numItems = this.rankList.length;
  19409. }
  19410. updateItemUI(index, obj) {
  19411. let data = this.rankList[index];
  19412. let userData = JSON.parse(data.userData).user;
  19413. obj.nameTxt.text = userData.nickName.toString();
  19414. obj.valueTxt.text = data.rankScore;
  19415. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  19416. obj.rankTxt.text = index + 1;
  19417. switch (index) {
  19418. case 0:
  19419. this.setImg(obj, 1, 0, 0);
  19420. obj.rankTxt.color = "#FFC047";
  19421. break;
  19422. case 1:
  19423. this.setImg(obj, 0, 1, 0);
  19424. obj.rankTxt.color = "#ACACAC";
  19425. break;
  19426. case 2:
  19427. this.setImg(obj, 0, 0, 1);
  19428. obj.rankTxt.color = "#D09672";
  19429. break;
  19430. default:
  19431. this.setImg(obj, 0, 0, 0);
  19432. obj.rankTxt.color = "#496FAB";
  19433. break;
  19434. }
  19435. }
  19436. setImg(obj, a, b, c) {
  19437. obj.img1.visible = a ? true : false;
  19438. obj.img2.visible = b ? true : false;
  19439. obj.img3.visible = c ? true : false;
  19440. }
  19441. changeList(type) {
  19442. this.rankType = type;
  19443. this.updateSelf();
  19444. }
  19445. changeSelfNode() {
  19446. this.showSelf = !this.showSelf;
  19447. this.updateSelf();
  19448. }
  19449. updateSelf() {
  19450. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  19451. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  19452. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  19453. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  19454. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  19455. }
  19456. }
  19457. UIRanking$1.uiName = "UIRanking";
  19458. class UISecretary$1 extends UIBase {
  19459. constructor() {
  19460. super();
  19461. this.curIndex = 1;
  19462. }
  19463. onConstructor() {
  19464. this.ui = ui_UISecretary.createInstance();
  19465. this.contentPane = this.ui;
  19466. this.isEject = false;
  19467. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  19468. this.addUIClick(this.ui.leftBtn, this.turnLeft);
  19469. this.addUIClick(this.ui.rightBtn, this.turnRight);
  19470. this.nodeObj = { left: null, right: null, cur: null };
  19471. this.nodeObj.left = this.ui.myNode.gameNode1;
  19472. this.nodeObj.right = this.ui.myNode.gameNode2;
  19473. this.nodeObj.cur = this.ui.myNode.gameNode3;
  19474. }
  19475. show() {
  19476. super.show();
  19477. this.ui.t0.play();
  19478. this.updateData();
  19479. }
  19480. addSecretarySpine(node, spineName) {
  19481. if (spineName == "mishu") {
  19482. if (this.secretarySpine1) {
  19483. node.displayObject.destroyChildren();
  19484. this.playWoman(this.secretarySpine1, node.displayObject);
  19485. }
  19486. else {
  19487. let spine1 = new SpineMgr("mishu", () => {
  19488. this.secretarySpine1 = spine1;
  19489. this.playWoman(this.secretarySpine1, node.displayObject);
  19490. });
  19491. }
  19492. }
  19493. else {
  19494. if (this.secretarySpine2) {
  19495. node.displayObject.destroyChildren();
  19496. this.playWoman(this.secretarySpine2, node.displayObject);
  19497. }
  19498. else {
  19499. let spine2 = new SpineMgr("xiaomishu2", () => {
  19500. this.secretarySpine2 = spine2;
  19501. this.playWoman(this.secretarySpine2, node.displayObject);
  19502. });
  19503. }
  19504. }
  19505. }
  19506. playWoman(node, parent) {
  19507. let xx = this.ui.myNode.gameNode1.secretary.width / 2;
  19508. let yy = this.ui.myNode.gameNode1.secretary.height;
  19509. let scale = 1.5;
  19510. if (node == this.secretarySpine2) {
  19511. scale = 1.2;
  19512. }
  19513. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19514. node.play(data, 1, true, parent);
  19515. }
  19516. turnLeft() {
  19517. this.curIndex--;
  19518. if (this.curIndex < 1) {
  19519. this.curIndex = 2;
  19520. }
  19521. let left = this.nodeObj.left;
  19522. let right = this.nodeObj.right;
  19523. let cur = this.nodeObj.cur;
  19524. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  19525. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  19526. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  19527. this.updateData();
  19528. }));
  19529. this.ui.myNode.setChildIndex(right, 2);
  19530. this.nodeObj.left = cur;
  19531. this.nodeObj.right = left;
  19532. this.nodeObj.cur = right;
  19533. }
  19534. turnRight() {
  19535. this.curIndex++;
  19536. if (this.curIndex > 2) {
  19537. this.curIndex = 1;
  19538. }
  19539. let left = this.nodeObj.left;
  19540. let right = this.nodeObj.right;
  19541. let cur = this.nodeObj.cur;
  19542. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  19543. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  19544. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  19545. this.updateData();
  19546. }));
  19547. this.ui.myNode.setChildIndex(left, 2);
  19548. this.nodeObj.left = right;
  19549. this.nodeObj.right = cur;
  19550. this.nodeObj.cur = left;
  19551. }
  19552. updateData() {
  19553. let data = cfgTable.secretaryshopData;
  19554. let children = this.ui.myNode._children;
  19555. let temp;
  19556. let curData;
  19557. for (let index = 0; index < children.length; index++) {
  19558. temp = children[index];
  19559. if (index == 2) {
  19560. curData = data[this.curIndex];
  19561. temp.purchaseBtn.touchable = true;
  19562. }
  19563. else {
  19564. temp.purchaseBtn.touchable = false;
  19565. if (this.curIndex == 1) {
  19566. curData = data[2];
  19567. }
  19568. else {
  19569. curData = data[1];
  19570. }
  19571. }
  19572. temp.heightTxt.text = curData.height;
  19573. temp.foodTxt.text = curData.food;
  19574. temp.historyTxt.text = curData.history;
  19575. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  19576. this.addSecretarySpine(temp.secretary, curData.spine);
  19577. let womanIndex = curData.id - 1;
  19578. let getWoman = DataMgr.getSecretary(womanIndex);
  19579. let curUse = DataMgr.getCurSecretary();
  19580. if (getWoman) {
  19581. if (curUse == womanIndex) {
  19582. temp.purchaseBtn.c1.selectedIndex = 1;
  19583. }
  19584. else {
  19585. temp.purchaseBtn.c1.selectedIndex = 2;
  19586. }
  19587. }
  19588. else {
  19589. temp.purchaseBtn.c1.selectedIndex = 0;
  19590. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  19591. }
  19592. temp.purchaseBtn.offClick(this, this.clickSecretary);
  19593. temp.purchaseBtn.onClick(this, this.clickSecretary, [getWoman, curUse, womanIndex, curData.price]);
  19594. }
  19595. }
  19596. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  19597. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19598. if (getWoman) {
  19599. if (curUse != womanIndex) {
  19600. console.log();
  19601. DataMgr.setCurSecretary(womanIndex);
  19602. this.updateData();
  19603. }
  19604. }
  19605. else {
  19606. let need = needDiamond;
  19607. if (DataMgr.diamondEnough(need)) {
  19608. DataMgr.setDiamond(-need);
  19609. DataMgr.setSecretary(womanIndex, 1);
  19610. DataMgr.setCurSecretary(womanIndex);
  19611. this.updateData();
  19612. }
  19613. else {
  19614. xGame.uiMgr.Show(UIAddProp$1, 1);
  19615. }
  19616. }
  19617. }
  19618. closeSelf() {
  19619. this.hide();
  19620. }
  19621. }
  19622. UISecretary$1.uiName = "UISecretary";
  19623. class BallRodDisplay$1 {
  19624. constructor(ui, index) {
  19625. this.index = 0;
  19626. this.uiIndex = 0;
  19627. this.ui = ui;
  19628. this.index = index;
  19629. this.initData();
  19630. }
  19631. initData() {
  19632. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  19633. let data = cfgTable.ballrodData[this.index + 1];
  19634. this.ui.nameTxt.text = data.name;
  19635. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  19636. this.ui.levelNode.c1.selectedIndex = data.quality;
  19637. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  19638. if (data.spine) {
  19639. this.mySpine = new SpineMgr(data.spine, () => {
  19640. let xx = 150;
  19641. let yy = 70;
  19642. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  19643. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  19644. });
  19645. }
  19646. }
  19647. updateSelf() {
  19648. let get = DataMgr.getBallRod(this.index);
  19649. if (get == null)
  19650. get = 1;
  19651. let curUse = DataMgr.getCurBallRod();
  19652. if (get) {
  19653. if (curUse == this.index) {
  19654. this.ui.purchaseBtn.c1.selectedIndex = 0;
  19655. }
  19656. else {
  19657. this.ui.purchaseBtn.c1.selectedIndex = 1;
  19658. }
  19659. }
  19660. else {
  19661. this.ui.purchaseBtn.c1.selectedIndex = 2;
  19662. }
  19663. }
  19664. buyBallRod() {
  19665. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19666. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  19667. switch (selectedIndex) {
  19668. case 0:
  19669. break;
  19670. case 1:
  19671. DataMgr.setCurBallRod(this.index);
  19672. let ui = xGame.uiMgr.getUI(UIShop$1);
  19673. ui.updateBallRod();
  19674. break;
  19675. case 2:
  19676. let data = cfgTable.ballrodData[this.index + 1];
  19677. let need = data.price;
  19678. if (DataMgr.diamondEnough(need)) {
  19679. DataMgr.setDiamond(-need);
  19680. DataMgr.setBallRod(this.index, 1);
  19681. DataMgr.setCurBallRod(this.index);
  19682. let ui = xGame.uiMgr.getUI(UIShop$1);
  19683. ui.updateBallRod();
  19684. }
  19685. else {
  19686. xGame.uiMgr.Show(UIAddProp$1, 1);
  19687. }
  19688. break;
  19689. default:
  19690. break;
  19691. }
  19692. }
  19693. }
  19694. class UIShop$1 extends UIBase {
  19695. constructor() {
  19696. super();
  19697. this.itemNums = 0;
  19698. }
  19699. onConstructor() {
  19700. this.ui = ui_UIShop.createInstance();
  19701. this.contentPane = this.ui;
  19702. this.isEject = false;
  19703. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19704. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  19705. this.addUIClick(this.ui, this.interuptSecretary);
  19706. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  19707. this.ballRodArr = [];
  19708. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  19709. this.ui.myNode.myList.numItems = this.itemNums;
  19710. if (Moyu.isKs)
  19711. this.ui.closeNode.closeBtn.x += 100;
  19712. }
  19713. show() {
  19714. super.show();
  19715. this.playSecretaryIdle();
  19716. this.updateBallRod();
  19717. }
  19718. updateBallRod() {
  19719. for (let index = 0; index < this.ballRodArr.length; index++) {
  19720. this.ballRodArr[index].updateSelf();
  19721. }
  19722. }
  19723. renderBallRod(sort, obj) {
  19724. let index = this.getIndexBySort(sort + 1) - 1;
  19725. let ballRod = new BallRodDisplay$1(obj, index);
  19726. this.ballRodArr.push(ballRod);
  19727. }
  19728. getIndexBySort(sort) {
  19729. let object = cfgTable.ballrodData;
  19730. for (const key in object) {
  19731. if (object[key].sort == sort) {
  19732. return parseInt(key);
  19733. }
  19734. }
  19735. }
  19736. playSecretaryIdle() {
  19737. let parent = this.ui.secretary.displayObject;
  19738. parent.destroyChildren();
  19739. let xx = this.ui.secretary.width / 2;
  19740. let yy = this.ui.secretary.height;
  19741. let scale = xGame.common.getSecretaryScale();
  19742. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19743. xGame.common.secretary.play(data, 1, true, parent);
  19744. }
  19745. interuptSecretary() {
  19746. Laya.timer.clearAll(this);
  19747. this.playSecretaryRandomSound();
  19748. }
  19749. playSecretaryRandomSound() {
  19750. if (this.isHide)
  19751. return;
  19752. let time = xGame.common.randomNum(45000, 60000);
  19753. Laya.timer.once(time, this, () => {
  19754. if (this.isHide)
  19755. return;
  19756. let index = xGame.common.randomNum(4, 7);
  19757. xGame.soundMgr.playSound("s_main0" + index);
  19758. let words = 1;
  19759. switch (index) {
  19760. case 4:
  19761. words = 5;
  19762. break;
  19763. case 5:
  19764. words = 3;
  19765. break;
  19766. case 6:
  19767. words = 6;
  19768. break;
  19769. case 7:
  19770. words = 7;
  19771. break;
  19772. default:
  19773. break;
  19774. }
  19775. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19776. this.playSecretaryRandomSound();
  19777. });
  19778. }
  19779. closeSelf() {
  19780. this.hide();
  19781. }
  19782. }
  19783. UIShop$1.uiName = "UIShop";
  19784. class SignMax$1 {
  19785. constructor(ui) {
  19786. this.ui = ui;
  19787. }
  19788. updateSelf(index, sameDay, curDayIndex) {
  19789. let data = cfgTable.signData[index + 1];
  19790. this.ui.titleTxt.text = data.title;
  19791. let arr1 = data.award[0].split('-');
  19792. let arr2 = data.award[1].split('-');
  19793. let num1 = parseInt(arr1[1]);
  19794. let num2 = parseInt(arr2[1]);
  19795. this.ui.numTxt1.text = num1 + "";
  19796. this.ui.numTxt2.text = num2 + "";
  19797. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  19798. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  19799. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  19800. this.ui.numTxt1.visible = false;
  19801. }
  19802. else {
  19803. this.ui.numTxt1.visible = true;
  19804. }
  19805. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  19806. this.ui.numTxt2.visible = false;
  19807. }
  19808. else {
  19809. this.ui.numTxt2.visible = true;
  19810. }
  19811. if (index < curDayIndex) {
  19812. this.ui.c1.selectedIndex = 1;
  19813. }
  19814. else if (index == curDayIndex) {
  19815. if (sameDay) {
  19816. this.ui.c1.selectedIndex = 2;
  19817. }
  19818. else {
  19819. this.ui.c1.selectedIndex = 2;
  19820. }
  19821. }
  19822. else {
  19823. this.ui.c1.selectedIndex = 0;
  19824. }
  19825. }
  19826. }
  19827. class SignNormal$1 {
  19828. constructor(ui) {
  19829. this.ui = ui;
  19830. }
  19831. updateSelf(index, sameDay, curDayIndex) {
  19832. let data = cfgTable.signData[index + 1];
  19833. this.ui.titleTxt.text = data.title;
  19834. let arr = data.award[0].split('-');
  19835. let type = parseInt(arr[0]);
  19836. let num = parseInt(arr[1]);
  19837. this.ui.numTxt.text = num + "";
  19838. if (type > 2) {
  19839. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  19840. this.ui.myIcon.rotation = 0;
  19841. }
  19842. else {
  19843. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  19844. this.ui.myIcon.rotation = 0;
  19845. }
  19846. if (xGame.common.signAwardContainsRod(data.award)) {
  19847. this.ui.numTxt.visible = false;
  19848. }
  19849. else {
  19850. this.ui.numTxt.visible = true;
  19851. }
  19852. if (index < curDayIndex) {
  19853. this.ui.c1.selectedIndex = 1;
  19854. }
  19855. else if (index == curDayIndex) {
  19856. if (sameDay) {
  19857. this.ui.c1.selectedIndex = 2;
  19858. }
  19859. else {
  19860. this.ui.c1.selectedIndex = 2;
  19861. }
  19862. }
  19863. else {
  19864. this.ui.c1.selectedIndex = 0;
  19865. }
  19866. }
  19867. }
  19868. class UISign$1 extends UIBase {
  19869. constructor() {
  19870. super();
  19871. this.curDayIndex = 0;
  19872. this.starX = 0;
  19873. }
  19874. onConstructor() {
  19875. this.ui = ui_UISign.createInstance();
  19876. this.contentPane = this.ui;
  19877. this.isEject = false;
  19878. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19879. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  19880. this.initSignItem();
  19881. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  19882. this.addUIClick(this.ui.againBtn, this.againGetAward);
  19883. }
  19884. show() {
  19885. super.show();
  19886. this.ui.t0.play();
  19887. this.playSecretaryIdle();
  19888. this.updateSign();
  19889. }
  19890. initSignItem() {
  19891. this.signArr = [];
  19892. for (let index = 0; index < 6; index++) {
  19893. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  19894. this.signArr.push(temp);
  19895. }
  19896. this.signMax = new SignMax$1(this.ui.myNode.day7);
  19897. if (Moyu.isKs)
  19898. this.ui.closeNode.closeBtn.x += 100;
  19899. }
  19900. updateSign() {
  19901. let sameDay = xGame.common.judgeSameDay();
  19902. let max = 7;
  19903. this.curDayIndex = DataMgr.getSignData();
  19904. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  19905. this.curDayIndex = 0;
  19906. if (!sameDay) {
  19907. this.ui.normalBtn.visible = true;
  19908. this.ui.tipsNode.visible = false;
  19909. this.ui.againBtn.visible = false;
  19910. }
  19911. else {
  19912. this.ui.normalBtn.visible = false;
  19913. let again = DataMgr.getExtraSign();
  19914. let isCurrency = false;
  19915. let index = this.curDayIndex;
  19916. if (index == 0)
  19917. index = 7;
  19918. let award = cfgTable.signData[index].award;
  19919. let num = award[0].split("-")[0];
  19920. if (num == "1" || num == "2")
  19921. isCurrency = true;
  19922. let showAgain = again == 0 && isCurrency;
  19923. this.ui.againBtn.visible = showAgain;
  19924. this.ui.tipsNode.visible = !showAgain;
  19925. }
  19926. for (let index = 0; index < this.signArr.length; index++) {
  19927. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  19928. }
  19929. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  19930. }
  19931. playSecretaryIdle() {
  19932. let parent = this.ui.secretary.displayObject;
  19933. parent.destroyChildren();
  19934. let xx = this.ui.secretary.width / 2;
  19935. let yy = this.ui.secretary.height;
  19936. let scale = xGame.common.getSecretaryScale();
  19937. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19938. xGame.common.secretary.play(data, 1, true, parent);
  19939. }
  19940. closeSelf() {
  19941. this.hide();
  19942. }
  19943. normalGetAward() {
  19944. let sameDay = xGame.common.judgeSameDay();
  19945. if (!sameDay) {
  19946. let award = cfgTable.signData[this.curDayIndex + 1].award;
  19947. let temp;
  19948. let type;
  19949. let num;
  19950. let arr = [];
  19951. for (let index = 0; index < award.length; index++) {
  19952. temp = award[index].split("-");
  19953. type = parseInt(temp[0]);
  19954. num = parseInt(temp[1]);
  19955. let awardType = new AwardType();
  19956. awardType.num = num;
  19957. awardType.type = type;
  19958. arr.push(awardType);
  19959. }
  19960. xGame.common.getAward(arr, (watchVideo) => {
  19961. this.curDayIndex++;
  19962. if (this.curDayIndex > 7)
  19963. this.curDayIndex = 0;
  19964. DataMgr.setSignData(this.curDayIndex);
  19965. DataMgr.setSignTime(new Date().getTime());
  19966. if (watchVideo) {
  19967. DataMgr.setExtraSign(1);
  19968. Moyu.sendDataEvent("signIn1");
  19969. }
  19970. this.updateSign();
  19971. });
  19972. }
  19973. }
  19974. againGetAward() {
  19975. Moyu.sendDataEvent("signIn2");
  19976. Moyu.showVideoAd(() => {
  19977. let index = this.curDayIndex;
  19978. if (index == 0)
  19979. index = 7;
  19980. let award = cfgTable.signData[index].award;
  19981. let temp;
  19982. let type;
  19983. let num;
  19984. for (let index = 0; index < award.length; index++) {
  19985. temp = award[index].split("-");
  19986. type = parseInt(temp[0]);
  19987. num = parseInt(temp[1]) * 3;
  19988. xGame.common.playObjFlyAnim(num, type);
  19989. }
  19990. DataMgr.setExtraSign(1);
  19991. this.updateSign();
  19992. }, EAdType.againSign);
  19993. }
  19994. }
  19995. UISign$1.uiName = "UISign";
  19996. class UIModeSelection$1 extends UIBase {
  19997. constructor() {
  19998. super();
  19999. }
  20000. onConstructor() {
  20001. this.ui = ui_UIModeSelection.createInstance();
  20002. this.contentPane = this.ui;
  20003. this.isEject = false;
  20004. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  20005. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  20006. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  20007. this.addUIClick(this.ui.closeBtn, this.hide);
  20008. this.peopleArr = [650, 6900, 3800];
  20009. this.peopleOffest = [50, 500, 200];
  20010. this.updateSelf();
  20011. }
  20012. show(callback) {
  20013. super.show();
  20014. this.ui.t0.play();
  20015. this.callback = callback;
  20016. }
  20017. updateSelf() {
  20018. let cfg = cfgTable.modeselectData;
  20019. for (let index = 1; index <= 3; index++) {
  20020. let node = this.ui.myNode["type" + index];
  20021. node.need.text = cfg[index].need;
  20022. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  20023. node.peopleTxt.text = this.getRandPeople(index - 1);
  20024. }
  20025. }
  20026. enterGame(type) {
  20027. xGame.common.classicRoomType = type;
  20028. let cfg = cfgTable.modeselectData[type];
  20029. let need = cfg.need;
  20030. xGame.common.passAwardCoin = cfg.award;
  20031. if (DataMgr.coinEnough(need)) {
  20032. DataMgr.setCoin(-need);
  20033. this.ui.myNode["type" + type].t0.play();
  20034. Laya.timer.once(200, this, () => {
  20035. this.callback && this.callback();
  20036. });
  20037. }
  20038. else {
  20039. Moyu.sendDataEvent("AddCoinVideo");
  20040. xGame.uiMgr.Show(UIAddProp$1, 0);
  20041. }
  20042. }
  20043. getRandPeople(index) {
  20044. let rand = this.peopleOffest[index];
  20045. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  20046. }
  20047. }
  20048. UIModeSelection$1.uiName = "UIModeSelection";
  20049. class UIMain$1 extends UIBase {
  20050. constructor() {
  20051. super();
  20052. this.firstEnter = true;
  20053. }
  20054. onConstructor() {
  20055. this.ui = ui_UIMain.createInstance();
  20056. this.contentPane = this.ui;
  20057. this.isEject = false;
  20058. this.addEvent();
  20059. this.addClickSpine();
  20060. this.settingNode = new SettingNode$1(this.ui.settingNode);
  20061. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20062. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  20063. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  20064. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  20065. let curUse = DataMgr.getCurSecretary();
  20066. this.changeSecretary(curUse);
  20067. this.ui.talkNode.visible = false;
  20068. let guide = DataMgr.getSkillGuide();
  20069. if (xGame.common.isNewDay && guide == 1) {
  20070. xGame.common.isNewDay = false;
  20071. xGame.soundMgr.playSound("s_main01");
  20072. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20073. console.log("播放小秘书每天语音");
  20074. }
  20075. this.onGetUserInfo();
  20076. this.ui.n83.visible = false;
  20077. Moyu.setShareInfo("8Ball Fury", ["台球", "万宁", "桌球"], '2300002254');
  20078. }
  20079. changeSecretary(curUse) {
  20080. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  20081. xGame.common.secretary && xGame.common.secretary.dispose();
  20082. this.addSecretarySpine(name);
  20083. }
  20084. addSecretarySpine(name) {
  20085. let spine = new SpineMgr(name, () => {
  20086. this.playSecretaryIdle();
  20087. });
  20088. xGame.common.secretary = spine;
  20089. }
  20090. addClickSpine() {
  20091. let clickSpine = new SpineMgr("dianji", () => {
  20092. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  20093. let parent = Laya.stage;
  20094. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  20095. clickSpine.play(data, 0, false, parent, (spine) => {
  20096. spine.destroy(true);
  20097. });
  20098. });
  20099. });
  20100. }
  20101. addEvent() {
  20102. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  20103. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  20104. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  20105. this.addUIClick(this.ui.weeklyBtn, this.startWeekly);
  20106. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  20107. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  20108. this.addUIClick(this.ui, this.interuptSecretary);
  20109. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  20110. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  20111. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  20112. this.addUIClick(this.ui.shopBtn, this.openShopView);
  20113. this.addUIClick(this.ui.signBtn, this.openSignView);
  20114. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  20115. this.addUIClick(this.ui.rankBtn, this.openRanking);
  20116. }
  20117. show(showFailWords) {
  20118. super.show();
  20119. this.moneyNode.ui.c1.selectedIndex = 1;
  20120. this.playSecretaryIdle();
  20121. xGame.soundMgr.playMusic("caromhall01");
  20122. Laya.timer.clearAll(this);
  20123. this.playSecretaryRandomSound();
  20124. if (showFailWords) {
  20125. setTimeout(() => {
  20126. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  20127. let words = -1;
  20128. if (str == "s_main02") {
  20129. words = 2;
  20130. }
  20131. else {
  20132. words = 3;
  20133. }
  20134. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20135. xGame.soundMgr.playSound(str);
  20136. }, 300);
  20137. }
  20138. this.showGuide();
  20139. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  20140. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  20141. let guide = DataMgr.getSkillGuide();
  20142. if (guide == 1) {
  20143. let randTime = xGame.common.randomNum(300, 800);
  20144. if (this.firstEnter) {
  20145. this.firstEnter = false;
  20146. randTime += 900;
  20147. }
  20148. Laya.timer.once(randTime, this, () => {
  20149. xGame.common.autoPopUIView();
  20150. });
  20151. }
  20152. }
  20153. checkActive(show) {
  20154. }
  20155. showGuide() {
  20156. let guide = DataMgr.getSkillGuide();
  20157. this.ui.guideBtn.visible = guide == 0;
  20158. this.ui.enterGuide.visible = false;
  20159. this.ui.secretaryGuide.visible = guide == 0;
  20160. if (guide == 0) {
  20161. xGame.soundMgr.playSound("s_guide");
  20162. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20163. }
  20164. }
  20165. ensureSecretary() {
  20166. this.ui.secretaryGuide.visible = false;
  20167. this.ui.enterGuide.visible = true;
  20168. this.ui.wordsNode.t0.play();
  20169. if (DataMgr.getNewUser())
  20170. Moyu.sendDataEvent("gameReady");
  20171. }
  20172. playSecretaryIdle() {
  20173. let parent = this.ui.secretary.displayObject;
  20174. parent.destroyChildren();
  20175. let xx = this.ui.secretary.width / 2;
  20176. let yy = this.ui.secretary.height;
  20177. let scale = xGame.common.getSecretaryScale();
  20178. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20179. xGame.common.secretary.play(data, 1, true, parent);
  20180. }
  20181. startGame(type) {
  20182. xGame.common.gameMode = type;
  20183. Moyu.sendDataEvent("PlayGame", { type: type });
  20184. switch (xGame.common.gameMode) {
  20185. case GameMode.classic:
  20186. let challengeTimes = DataMgr.getChallengeTimes();
  20187. if (challengeTimes == 0) {
  20188. xGame.uiMgr.Show(UIInvitation$1);
  20189. }
  20190. else {
  20191. this.beginGame();
  20192. }
  20193. break;
  20194. case GameMode.bigMove:
  20195. this.beginGame();
  20196. if (DataMgr.getNewUser())
  20197. Moyu.sendDataEvent("gameStart0");
  20198. break;
  20199. default:
  20200. break;
  20201. }
  20202. }
  20203. beginGame(isNice = false) {
  20204. if (xGame.common.gameMode == GameMode.classic) {
  20205. if (isNice) {
  20206. this.enterClassic();
  20207. }
  20208. else {
  20209. xGame.uiMgr.Show(UIModeSelection$1, () => {
  20210. this.enterClassic();
  20211. });
  20212. }
  20213. }
  20214. else if (xGame.common.gameMode == GameMode.bigMove) {
  20215. this.ui.enterGuide.visible = false;
  20216. xGame.uiMgr.Show(UISkill$1);
  20217. }
  20218. }
  20219. enterClassic() {
  20220. xGame.uiMgr.Show(UIGame$1);
  20221. xGame.uiMgr.Show(UIMatching$1, () => {
  20222. if (!this.isHide)
  20223. this.hide();
  20224. xGame.common.gameUI.ui.alpha = 1;
  20225. xGame.common.gameUI.startGame();
  20226. xGame.uiMgr.Hide(UIGameEnd$1);
  20227. });
  20228. }
  20229. startGlobal() {
  20230. xGame.uiMgr.Show(UIMsg$1, "敬请期待~");
  20231. }
  20232. startWeekly() {
  20233. xGame.uiMgr.Show(UIMsg$1, "敬请期待~");
  20234. }
  20235. startPlaceBall() {
  20236. xGame.uiMgr.Show(UILevelDisplay$1);
  20237. }
  20238. hide() {
  20239. super.hide();
  20240. xGame.common.stopGirlPop(this.ui.talkNode);
  20241. }
  20242. onGetUserInfo(force = false) {
  20243. if (Moyu.isWx) {
  20244. let info = Moyu.getSystemInfo();
  20245. if (info)
  20246. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  20247. }
  20248. else {
  20249. Moyu.initUser(this, this.freshUser, force);
  20250. }
  20251. if (!Moyu.hasUserInfo) {
  20252. let user = Moyu.getUserInfo();
  20253. user.headIcon = 'res/ty_touxiang.png';
  20254. }
  20255. this.freshUser();
  20256. }
  20257. freshUser() {
  20258. let user = Moyu.getUserInfo();
  20259. if (!user.isAuth) {
  20260. user.headIcon = 'res/ty_touxiang.png';
  20261. }
  20262. else
  20263. DataMgr.upRankData();
  20264. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  20265. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  20266. }
  20267. interuptSecretary() {
  20268. Laya.timer.clearAll(this);
  20269. this.playSecretaryRandomSound();
  20270. }
  20271. playSecretaryRandomSound() {
  20272. if (this.isHide)
  20273. return;
  20274. let time = xGame.common.randomNum(45000, 60000);
  20275. Laya.timer.once(time, this, () => {
  20276. if (this.isHide)
  20277. return;
  20278. let index = xGame.common.randomNum(4, 7);
  20279. xGame.soundMgr.playSound("s_main0" + index);
  20280. let words = 1;
  20281. switch (index) {
  20282. case 4:
  20283. words = 5;
  20284. break;
  20285. case 5:
  20286. words = 3;
  20287. break;
  20288. case 6:
  20289. words = 6;
  20290. break;
  20291. case 7:
  20292. words = 7;
  20293. break;
  20294. default:
  20295. break;
  20296. }
  20297. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20298. this.playSecretaryRandomSound();
  20299. });
  20300. }
  20301. openSecretaryView() {
  20302. xGame.uiMgr.Show(UISecretary$1);
  20303. Moyu.sendDataEvent("secretary");
  20304. }
  20305. openShopView() {
  20306. xGame.uiMgr.Show(UIShop$1);
  20307. }
  20308. openSignView() {
  20309. xGame.uiMgr.Show(UISign$1);
  20310. }
  20311. openDrawView() {
  20312. xGame.uiMgr.Show(UIDraw$1);
  20313. }
  20314. openRanking() {
  20315. xGame.uiMgr.Show(UIRanking$1);
  20316. Moyu.sendDataEvent("rankingList");
  20317. }
  20318. }
  20319. UIMain$1.uiName = "UIMain";
  20320. function InitShader() {
  20321. }
  20322. function appInit() {
  20323. xGame.context.init(getLoadingResList(), initCallback);
  20324. }
  20325. function getLoadingResList() {
  20326. return [
  20327. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  20328. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  20329. ];
  20330. }
  20331. function getGameResList() {
  20332. return [
  20333. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  20334. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  20335. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  20336. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  20337. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  20338. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  20339. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  20340. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  20341. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  20342. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  20343. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  20344. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  20345. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  20346. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  20347. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  20348. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  20349. { url: "res/json/npc.json", type: Laya.Loader.JSON },
  20350. { url: "res/json/classicCfg.json", type: Laya.Loader.JSON },
  20351. { url: "res/json/levelCfg.json", type: Laya.Loader.JSON },
  20352. { url: "res/json/placeBallCfg.json", type: Laya.Loader.JSON },
  20353. ];
  20354. }
  20355. function initCallback() {
  20356. window["DataMgr"] = DataMgr;
  20357. DataMgr.Init();
  20358. Moyu.init(getPlat(), this, () => {
  20359. DataMgr.isNewDay();
  20360. PlatMgr.initConfig();
  20361. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  20362. }, true);
  20363. console.log('zh:开始sm init1 start');
  20364. xGame.soundMgr.init();
  20365. console.log('zh:开始sm init1 end');
  20366. xGame.uiMgr.init();
  20367. xGame.uiMgr.bindFUI(fguiRes.loading);
  20368. xGame.uiMgr.Show(UILoading);
  20369. }
  20370. function loadSubRes(callback) {
  20371. var tab = ["asset", "res", "spine"];
  20372. let subDone = 0;
  20373. for (var i = 0; i < tab.length; i++) {
  20374. let sub = tab[i];
  20375. Moyu.loadSubRes(sub, (pro) => {
  20376. callback && callback(pro, false);
  20377. }).then(() => {
  20378. subDone++;
  20379. if (subDone >= tab.length)
  20380. callback && callback(1, true);
  20381. });
  20382. }
  20383. }
  20384. function enterGame() {
  20385. xGame.cfgMgr.init();
  20386. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  20387. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  20388. xGame.uiMgr.Hide(UILoading);
  20389. fgui.UIPackage.removePackage(fguiRes.loading);
  20390. xGame.uiMgr.bindFUI(fguiRes.game);
  20391. xGame.uiMgr.Show(UIMain$1);
  20392. if (DataMgr.getNewUser())
  20393. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  20394. }
  20395. function getPlat() {
  20396. let cfg = new MoyuCfg();
  20397. cfg.plat = MoyuPlat.web;
  20398. cfg.myId = 120;
  20399. cfg.myKey = '8848a885774230a4';
  20400. cfg.version = 0;
  20401. if (window.hasOwnProperty("gamebox")) {
  20402. cfg.plat = MoyuPlat.f399;
  20403. cfg.version = 0;
  20404. }
  20405. else if (window.hasOwnProperty("ks")) {
  20406. cfg.plat = MoyuPlat.ks;
  20407. cfg.version = 0;
  20408. cfg.ads.ksVideoId = '2300002254_01';
  20409. cfg.ads.ksInsertId = '2300002254_02';
  20410. }
  20411. else if (Laya.Browser.onTTMiniGame) {
  20412. cfg.plat = MoyuPlat.tt;
  20413. cfg.version = 0;
  20414. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  20415. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  20416. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  20417. }
  20418. else if (Laya.Browser.onMiniGame) {
  20419. cfg.plat = MoyuPlat.wx;
  20420. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  20421. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  20422. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  20423. }
  20424. else if (Laya.Browser.onQQMiniGame) {
  20425. cfg.plat = MoyuPlat.qq;
  20426. }
  20427. else if (Laya.Browser.onQGMiniGame) {
  20428. cfg.plat = MoyuPlat.op;
  20429. cfg.ads.opVideoId = '455502';
  20430. cfg.ads.opBannerId = '455507';
  20431. }
  20432. else if (Laya.Browser.onVVMiniGame) {
  20433. cfg.plat = MoyuPlat.vv;
  20434. cfg.version = 0;
  20435. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  20436. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  20437. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  20438. }
  20439. else if (Laya.Browser.onHWMiniGame) {
  20440. cfg.plat = MoyuPlat.hw;
  20441. }
  20442. else if (window["mz"]) {
  20443. cfg.plat = MoyuPlat.mz;
  20444. }
  20445. else {
  20446. let cfg = window['conchConfig'];
  20447. if (cfg) {
  20448. var os = cfg.getOS();
  20449. if (os == "Conch-ios") {
  20450. cfg.plat = MoyuPlat.ios;
  20451. }
  20452. else if (os == "Conch-android") {
  20453. }
  20454. }
  20455. }
  20456. return cfg;
  20457. }
  20458. class Main {
  20459. constructor() {
  20460. if (window["Laya3D"])
  20461. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  20462. else {
  20463. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  20464. this.initMain();
  20465. }
  20466. }
  20467. initMain() {
  20468. Laya["Physics"] && Laya["Physics"].enable();
  20469. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  20470. Laya.stage.scaleMode = GameConfig.scaleMode;
  20471. Laya.stage.screenMode = GameConfig.screenMode;
  20472. Laya.stage.alignV = GameConfig.alignV;
  20473. Laya.stage.alignH = GameConfig.alignH;
  20474. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  20475. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  20476. Laya.enableDebugPanel();
  20477. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  20478. Laya["PhysicsDebugDraw"].enable();
  20479. if (GameConfig.stat)
  20480. Laya.Stat.show();
  20481. Laya.alertGlobalError(true);
  20482. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  20483. }
  20484. onVersionLoaded() {
  20485. appInit();
  20486. }
  20487. }
  20488. new Main();
  20489. }());
  20490. //# sourceMappingURL=bundle.js.map